{
  "agent": {
    "capabilities": {
      "apple_apps": [],
      "applescript_enabled": false,
      "browser_use_enabled": false,
      "computer_use_enabled": false,
      "db_enabled": false,
      "image_enabled": false,
      "knowledge_enabled": false,
      "memory_enabled": false,
      "render_chart_enabled": false,
      "search_memory_enabled": false,
      "self_scheduling_enabled": false,
      "speak_enabled": false,
      "tools_enabled": true,
      "web_search_enabled": true
    },
    "description": "",
    "max_tokens": null,
    "model": "OsaurusAI/LFM2.5-24B-A2B-JANGH2",
    "name": "Dinoki",
    "sandbox": {
      "allowed_domains": [],
      "background_process_enabled": false,
      "enabled": false,
      "max_commands_per_turn": 10,
      "network_enabled": true,
      "plugin_create": false
    },
    "subagents": {
      "agents": [],
      "enabled": false
    },
    "system_prompt": "You are a pragmatic coding partner. Read the user's code carefully, ask clarifying questions when intent is ambiguous, and prefer minimal diffs that match the surrounding style. Explain trade-offs briefly. When you write code, make sure it actually compiles and runs.",
    "temperature": null,
    "tools": {
      "mode": "auto"
    },
    "working_folder": "~/Desktop/ridgeline"
  },
  "author": {
    "address": "0xc820da3Ce55C600A6282D2B21083Fe5Aa7E51F3D",
    "signature": "3d4ccb3365dbf10f91b7c0fa595cb495ffad5f07386fd21055e154d2aa817c9855f8f0102a7e34b1fc17cf5f60e7588d15f0bf1e409614835b3fd40c1137dbb31b"
  },
  "available_to_orchestrator": true,
  "bundled": [
    {
      "available_to_orchestrator": true,
      "changelog": "Built and tested single-URL YouTube downloads with per-run video/audio selection, folder choice, safe URL handling, MP4 merging, and overwrite support.",
      "content_hash": "sha256:75f33d79c6c575095b00ae6e406199b59dbc1a0bb8a792659fc984a4420a6236",
      "created_at": "2026-10-07T19:23:31Z",
      "format": "osaurus.template",
      "format_version": 1,
      "id": "BC20B98D-1B93-4A74-A971-C8F77F56CABB",
      "kind": "workflow",
      "name": "YouTube Downloader",
      "requirements": {
        "dependencies": [
          {
            "binaries": [
              "yt-dlp"
            ],
            "manager": "pip",
            "packages": [
              "yt-dlp"
            ]
          },
          {
            "binaries": [
              "ffmpeg"
            ],
            "manager": "apk",
            "packages": [
              "ffmpeg"
            ]
          }
        ],
        "knowledge": [],
        "mcp_servers": [],
        "models": [],
        "network": [],
        "notes": {},
        "permissions": [],
        "plugins": [],
        "secrets": [],
        "tools": [
          "shell_run",
          "file_copy"
        ]
      },
      "summary": "Download one authorized YouTube video or audio file to a folder you choose.",
      "version": 1,
      "workflow": {
        "dependencies": [
          {
            "binaries": [
              "yt-dlp"
            ],
            "manager": "pip",
            "packages": [
              "yt-dlp"
            ]
          },
          {
            "binaries": [
              "ffmpeg"
            ],
            "manager": "apk",
            "packages": [
              "ffmpeg"
            ]
          }
        ],
        "edges": [
          {
            "from": "prepare",
            "to": "download_video",
            "when": {
              "op": "equals",
              "path": "choice",
              "value": "video"
            }
          },
          {
            "from": "prepare",
            "to": "download_audio",
            "when": {
              "op": "equals",
              "path": "choice",
              "value": "audio"
            }
          },
          {
            "from": "download_video",
            "to": "copy_video"
          },
          {
            "from": "download_audio",
            "to": "copy_audio"
          },
          {
            "from": "copy_video",
            "to": "finish"
          },
          {
            "from": "copy_audio",
            "to": "finish"
          }
        ],
        "examples": [
          {
            "input": {
              "destination_folder": "tmp",
              "download_type": "audio",
              "youtube_url": "https://www.youtube.com/watch?v=jNQXAC9IVRw"
            },
            "name": "Download one YouTube audio file"
          },
          {
            "input": {
              "destination_folder": "tmp",
              "download_type": "video",
              "youtube_url": "https://www.youtube.com/watch?v=jNQXAC9IVRw"
            },
            "name": "Download one YouTube video"
          }
        ],
        "input_schema": {
          "additionalProperties": false,
          "properties": {
            "destination_folder": {
              "description": "Choose where the downloaded file should be saved.",
              "format": "folder",
              "title": "Destination folder",
              "type": "string"
            },
            "download_type": {
              "description": "Choose whether to save video or audio.",
              "enum": [
                "video",
                "audio"
              ],
              "title": "Download type",
              "type": "string"
            },
            "youtube_url": {
              "description": "Paste the URL of one YouTube video.",
              "title": "YouTube link",
              "type": "string"
            }
          },
          "required": [
            "youtube_url",
            "download_type",
            "destination_folder"
          ],
          "type": "object",
          "x-order": [
            "youtube_url",
            "download_type",
            "destination_folder"
          ]
        },
        "model_slots": [],
        "nodes": [
          {
            "code": {
              "network": [],
              "secrets": [],
              "source": "async function run(input, ctx) {\n  const bytes = [];\n  for (const ch of input.url.trim()) {\n    const cp = ch.codePointAt(0);\n    if (cp <= 0x7f) bytes.push(cp);\n    else if (cp <= 0x7ff) bytes.push(0xc0 | (cp >> 6), 0x80 | (cp & 0x3f));\n    else if (cp <= 0xffff) bytes.push(0xe0 | (cp >> 12), 0x80 | ((cp >> 6) & 0x3f), 0x80 | (cp & 0x3f));\n    else bytes.push(0xf0 | (cp >> 18), 0x80 | ((cp >> 12) & 0x3f), 0x80 | ((cp >> 6) & 0x3f), 0x80 | (cp & 0x3f));\n  }\n  const alphabet = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/';\n  let out = '';\n  for (let i = 0; i < bytes.length; i += 3) {\n    const a = bytes[i];\n    const b = i + 1 < bytes.length ? bytes[i + 1] : 0;\n    const c = i + 2 < bytes.length ? bytes[i + 2] : 0;\n    const n = (a << 16) | (b << 8) | c;\n    out += alphabet[(n >> 18) & 63] + alphabet[(n >> 12) & 63];\n    out += i + 1 < bytes.length ? alphabet[(n >> 6) & 63] : '=';\n    out += i + 2 < bytes.length ? alphabet[n & 63] : '=';\n  }\n  return { choice: input.choice, url_b64: out, overwrite: true };\n}",
              "timeout": 30
            },
            "id": "prepare",
            "input": {
              "choice": "{{input.download_type}}",
              "url": "{{input.youtube_url}}"
            },
            "intent": "Safely encode the URL and select the requested download branch.",
            "kind": "code",
            "name": "Prepare safe download",
            "output_schema": {
              "additionalProperties": false,
              "properties": {
                "choice": {
                  "enum": [
                    "video",
                    "audio"
                  ],
                  "type": "string"
                },
                "overwrite": {
                  "type": "boolean"
                },
                "url_b64": {
                  "type": "string"
                }
              },
              "required": [
                "choice",
                "url_b64",
                "overwrite"
              ],
              "type": "object"
            },
            "retry": {
              "backoff_seconds": 1,
              "max_attempts": 1
            },
            "timeout": 120
          },
          {
            "id": "download_video",
            "input": {
              "command": "URL_B64='{{nodes.prepare.output.url_b64}}'; URL=$(printf '%s' \"$URL_B64\" | base64 -d); rm -f youtube-download.mp4 youtube-download.f*; yt-dlp --js-runtimes node --no-playlist --format 'bv*[ext=mp4]+ba[ext=m4a]/bv*+ba/b' --merge-output-format mp4 --output youtube-download.mp4 \"$URL\""
            },
            "intent": "Download the best directly available MP4 video with audio.",
            "kind": "tool",
            "name": "Download video",
            "output_schema": {},
            "retry": {
              "backoff_seconds": 2,
              "max_attempts": 2
            },
            "timeout": 300,
            "tool": {
              "name": "shell_run"
            }
          },
          {
            "id": "download_audio",
            "input": {
              "command": "URL_B64='{{nodes.prepare.output.url_b64}}'; URL=$(printf '%s' \"$URL_B64\" | base64 -d); rm -f youtube-download.m4a; yt-dlp --js-runtimes node --no-playlist --format 'bestaudio[ext=m4a]' --output youtube-download.m4a \"$URL\""
            },
            "intent": "Download the best directly available M4A audio stream.",
            "kind": "tool",
            "name": "Download audio",
            "output_schema": {},
            "retry": {
              "backoff_seconds": 2,
              "max_attempts": 2
            },
            "timeout": 180,
            "tool": {
              "name": "shell_run"
            }
          },
          {
            "id": "copy_video",
            "input": {
              "destination": "{{input.destination_folder}}/youtube-download.mp4",
              "overwrite": "{{nodes.prepare.output.overwrite}}",
              "source": "youtube-download.mp4"
            },
            "intent": "Copy the completed MP4 file to the chosen folder.",
            "kind": "tool",
            "name": "Save video",
            "output_schema": {},
            "retry": {
              "backoff_seconds": 1,
              "max_attempts": 1
            },
            "timeout": 120,
            "tool": {
              "name": "file_copy"
            }
          },
          {
            "id": "copy_audio",
            "input": {
              "destination": "{{input.destination_folder}}/youtube-download.m4a",
              "overwrite": "{{nodes.prepare.output.overwrite}}",
              "source": "youtube-download.m4a"
            },
            "intent": "Copy the completed M4A file to the chosen folder.",
            "kind": "tool",
            "name": "Save audio",
            "output_schema": {},
            "retry": {
              "backoff_seconds": 1,
              "max_attempts": 1
            },
            "timeout": 120,
            "tool": {
              "name": "file_copy"
            }
          },
          {
            "code": {
              "network": [],
              "secrets": [],
              "source": "async function run(input, ctx) {\n  const folder = input.folder.replace(/\\/$/, '');\n  const filename = input.media_type === 'video' ? 'youtube-download.mp4' : 'youtube-download.m4a';\n  return {\n    file_path: folder + '/' + filename,\n    media_type: input.media_type,\n    note: 'Download completed. Only save content you are authorized to download.'\n  };\n}",
              "timeout": 30
            },
            "id": "finish",
            "input": {
              "folder": "{{input.destination_folder}}",
              "media_type": "{{input.download_type}}"
            },
            "intent": "Return the path and type of the file that was saved.",
            "kind": "code",
            "name": "Report saved file",
            "output_schema": {
              "additionalProperties": false,
              "properties": {
                "file_path": {
                  "type": "string"
                },
                "media_type": {
                  "enum": [
                    "video",
                    "audio"
                  ],
                  "type": "string"
                },
                "note": {
                  "type": "string"
                }
              },
              "required": [
                "file_path",
                "media_type",
                "note"
              ],
              "type": "object"
            },
            "retry": {
              "backoff_seconds": 1,
              "max_attempts": 1
            },
            "timeout": 120
          }
        ],
        "output": {
          "file_path": "{{nodes.finish.output.file_path}}",
          "media_type": "{{nodes.finish.output.media_type}}",
          "note": "{{nodes.finish.output.note}}"
        },
        "output_schema": {
          "additionalProperties": false,
          "properties": {
            "file_path": {
              "title": "Saved file",
              "type": "string"
            },
            "media_type": {
              "enum": [
                "video",
                "audio"
              ],
              "title": "Download type",
              "type": "string"
            },
            "note": {
              "title": "Result",
              "type": "string"
            }
          },
          "required": [
            "file_path",
            "media_type",
            "note"
          ],
          "type": "object"
        },
        "requirement_notes": {},
        "secrets": []
      }
    }
  ],
  "changelog": "",
  "content_hash": "sha256:1493443cea4a1e7aed88754c0ee52f4f43bdbdf93460a63a8b990a1d71dfdd20",
  "created_at": "2026-10-14T19:47:48Z",
  "format": "osaurus.template",
  "format_version": 1,
  "id": "C35CA33C-1FC6-49D7-A44F-F0F7FE6DAAE9",
  "kind": "agent",
  "name": "Dinoki",
  "requirements": {
    "knowledge": [],
    "mcp_servers": [],
    "models": [
      {
        "locality": "cloud_allowed",
        "needs_tool_use": true,
        "preferred": "OsaurusAI/LFM2.5-24B-A2B-JANGH2",
        "slot": "main",
        "strictness": "preferred"
      }
    ],
    "network": [],
    "notes": {},
    "permissions": [],
    "plugins": [],
    "secrets": [],
    "working_folder": {
      "label": "Working Folder",
      "path": "~/Desktop/ridgeline"
    }
  },
  "version": 2,
  "workflows": [
    {
      "id": "BC20B98D-1B93-4A74-A971-C8F77F56CABB",
      "min_version": 1
    }
  ]
}