@kolisachint/hoocode-agent 0.4.138 → 0.4.140

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (38) hide show
  1. package/CHANGELOG.md +24 -0
  2. package/dist/cli/args.d.ts.map +1 -1
  3. package/dist/cli/args.js +2 -0
  4. package/dist/cli/args.js.map +1 -1
  5. package/dist/core/extensions/plugins/formats/copilot.d.ts +7 -2
  6. package/dist/core/extensions/plugins/formats/copilot.d.ts.map +1 -1
  7. package/dist/core/extensions/plugins/formats/copilot.js +27 -7
  8. package/dist/core/extensions/plugins/formats/copilot.js.map +1 -1
  9. package/dist/core/model-resolver.d.ts.map +1 -1
  10. package/dist/core/model-resolver.js +5 -2
  11. package/dist/core/model-resolver.js.map +1 -1
  12. package/dist/core/prompt-templates.d.ts.map +1 -1
  13. package/dist/core/prompt-templates.js +3 -1
  14. package/dist/core/prompt-templates.js.map +1 -1
  15. package/dist/core/sdk.d.ts.map +1 -1
  16. package/dist/core/sdk.js +16 -3
  17. package/dist/core/sdk.js.map +1 -1
  18. package/dist/core/tools/find.d.ts.map +1 -1
  19. package/dist/core/tools/find.js +23 -3
  20. package/dist/core/tools/find.js.map +1 -1
  21. package/dist/core/tools/grep.d.ts.map +1 -1
  22. package/dist/core/tools/grep.js +128 -85
  23. package/dist/core/tools/grep.js.map +1 -1
  24. package/dist/core/tools/native-search.d.ts +90 -0
  25. package/dist/core/tools/native-search.d.ts.map +1 -0
  26. package/dist/core/tools/native-search.js +255 -0
  27. package/dist/core/tools/native-search.js.map +1 -0
  28. package/dist/extensions/core/config.d.ts +13 -0
  29. package/dist/extensions/core/config.d.ts.map +1 -1
  30. package/dist/extensions/core/config.js.map +1 -1
  31. package/dist/modes/interactive/interactive-mode.d.ts.map +1 -1
  32. package/dist/modes/interactive/interactive-mode.js +13 -4
  33. package/dist/modes/interactive/interactive-mode.js.map +1 -1
  34. package/examples/extensions/custom-provider-anthropic/package.json +1 -1
  35. package/examples/extensions/custom-provider-gitlab-duo/package.json +1 -1
  36. package/examples/extensions/sandbox/package.json +1 -1
  37. package/examples/extensions/with-deps/package.json +1 -1
  38. package/package.json +4 -4
package/CHANGELOG.md CHANGED
@@ -1,5 +1,29 @@
1
1
  # Changelog
2
2
 
3
+ ## [0.4.140] - 2026-07-17
4
+
5
+ ## [0.4.139] - 2026-07-17
6
+
7
+ ### Fixed
8
+
9
+ - GitHub Copilot plugin authoring (`ProposePlugin` / `UpdatePlugin` with
10
+ `--support-platform github`) now emits custom agents as
11
+ `agents/<name>.agent.md` with a YAML-list `tools` frontmatter, matching the
12
+ current GitHub Copilot plugin spec (docs.github.com custom agents /
13
+ plugins-creating; verified 2026-07) so Copilot recognizes them. Previously
14
+ they were written as bare `agents/<name>.md` with a Claude-style comma-string
15
+ `tools`, which Copilot does not load as agents. The reader still accepts the
16
+ bare `.md` layout (and the legacy `.github/chatmodes/` fallback), so
17
+ previously authored plugins keep loading.
18
+ - GitHub Copilot plugin authoring now maps a plugin's commands to Copilot
19
+ prompt files — `.github/prompts/<name>.prompt.md` — instead of Claude-style
20
+ `commands/<name>.md`, matching the Copilot/VS Code prompt-file convention and
21
+ this adapter's workspace command layout. The reader loads them from
22
+ `.github/prompts/` (and still honors a manifest `commands` path or a
23
+ `commands/` dir). Relatedly, command-name derivation now strips a `.prompt.md`
24
+ suffix, so a `greet.prompt.md` prompt file loads as the command `greet`
25
+ (previously `greet.prompt`).
26
+
3
27
  ## [0.4.138] - 2026-07-17
4
28
 
5
29
  ### Changed
@@ -1 +1 @@
1
- {"version":3,"file":"args.d.ts","sourceRoot":"","sources":["../../src/cli/args.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,iCAAiC,CAAC;AAGrE,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,6BAA6B,CAAC;AAEjE,MAAM,MAAM,IAAI,GAAG,MAAM,GAAG,MAAM,GAAG,KAAK,CAAC;AAE3C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8E;IAC9E,YAAY,EAAE,GAAG,CAAC,MAAM,EAAE,OAAO,GAAG,MAAM,CAAC,CAAC;IAC5C,WAAW,EAAE,KAAK,CAAC;QAAE,IAAI,EAAE,SAAS,GAAG,OAAO,CAAC;QAAC,OAAO,EAAE,MAAM,CAAA;KAAE,CAAC,CAAC;CACnE;AAID,wBAAgB,oBAAoB,CAAC,KAAK,EAAE,MAAM,GAAG,KAAK,IAAI,aAAa,CAE1E;AAED,wBAAgB,SAAS,CAAC,IAAI,EAAE,MAAM,EAAE,GAAG,IAAI,CAoM9C;AAED,wBAAgB,SAAS,CAAC,cAAc,CAAC,EAAE,aAAa,EAAE,GAAG,IAAI,CAyOhE","sourcesContent":["/**\n * CLI argument parsing and help display\n */\n\nimport type { ThinkingLevel } from \"@kolisachint/hoocode-agent-core\";\nimport chalk from \"chalk\";\nimport { APP_NAME, CONFIG_DIR_NAME, ENV_AGENT_DIR, ENV_SESSION_DIR } from \"../config.js\";\nimport type { ExtensionFlag } from \"../core/extensions/types.js\";\n\nexport type Mode = \"text\" | \"json\" | \"rpc\";\n\nexport interface Args {\n\tprovider?: string;\n\tmodel?: string;\n\tapiKey?: string;\n\tsystemPrompt?: string;\n\tthinking?: ThinkingLevel;\n\tcontinue?: boolean;\n\tresume?: boolean;\n\thelp?: boolean;\n\tversion?: boolean;\n\tmode?: Mode;\n\tnoSession?: boolean;\n\t/** Internal: task id assigned by SubagentPool when this process is a spawned subagent. */\n\ttaskId?: string;\n\t/** Hard cap on assistant turns. Near the cap the agent is asked to wrap up; at the cap it is stopped. */\n\tmaxTurns?: number;\n\tsession?: string;\n\t/** Base URL of a hooteams server to bridge into the task panel's teams view, or \"auto\" to discover a config and spawn one locally. */\n\tteam?: string;\n\tfork?: string;\n\tsessionDir?: string;\n\tmodels?: string[];\n\ttools?: string[];\n\tdisallowedTools?: string[];\n\tnoTools?: boolean;\n\tnoBuiltinTools?: boolean;\n\t/** Tri-state override of the `enableSubagent` setting (default true): --enable-subagents → true, --no-subagents → false, unset → setting. */\n\tsubagent?: boolean;\n\t/** Dispatch eligible subagents on reused warm RPC workers (overrides the warmSubagents setting). */\n\twarmSubagents?: boolean;\n\t/** Tree-wide subagent nesting cap (overrides the maxSubagentDepth setting). */\n\tmaxSubagentDepth?: number;\n\t/** Internal: restricts which subagent types this process may delegate to. */\n\tdelegateAllow?: string[];\n\ttodoWrite?: boolean;\n\t/** Enable the webfetch + websearch tools (off by default). */\n\tenableWebTools?: boolean;\n\t/** Enable the browser_run + browser_continue tools (browsertools engine, off by default). */\n\tenableBrowserTools?: boolean;\n\t/** Default the streamed live viewer on for browser_run runs and auto-open it (off by default). */\n\tenableBrowserLivePreview?: boolean;\n\t/** Enable the document tools — DocRead/DocEdit/DocWrite + DocScan/DocGrep/DocPeek (off by default). */\n\tenableFileTools?: boolean;\n\t/** Enable the autonomous plugin system — plugin lifecycle tools (SearchPlugins, InstallPlugin, ...) and ProposePlugin (off by default). */\n\tenablePluginTools?: boolean;\n\t/** Minimal low-token preset for small/local models: read/write/edit/bash only, terse prompt, no subagents/todo/skills/context files/mode appendix. */\n\tlight?: boolean;\n\t/** Print the fixed per-turn surface (system prompt + serialized tool schema token estimate) and exit. */\n\tprintTokenSurface?: boolean;\n\t/**\n\t * Platform layout(s) hoocode targets when it WRITES artifacts (authored\n\t * plugins, /new-skill //new-agent //new-command scaffolds). Raw tokens as\n\t * given (comma-separated and/or repeated); normalized downstream:\n\t * agents|native, claude, github|copilot|gh.\n\t */\n\tsupportPlatform?: string[];\n\t/** Path to an explicit PEM CA bundle to trust additively for hoocode's own TLS traffic. */\n\tcaCert?: string;\n\t/** Trust the OS/system CA store additively (opt-in) for hoocode's own TLS traffic. */\n\tuseSystemCa?: boolean;\n\textensions?: string[];\n\tnoExtensions?: boolean;\n\tprint?: boolean;\n\texport?: string;\n\tnoSkills?: boolean;\n\tskills?: string[];\n\tagents?: string[];\n\tpromptTemplates?: string[];\n\tnoPromptTemplates?: boolean;\n\tslashCommands?: string[];\n\tnoSlashCommands?: boolean;\n\tthemes?: string[];\n\tnoThemes?: boolean;\n\tmodePaths?: string[];\n\tnoContextFiles?: boolean;\n\tlistModels?: string | true;\n\toffline?: boolean;\n\tverbose?: boolean;\n\tmessages: string[];\n\tfileArgs: string[];\n\t/** Unknown flags (potentially extension flags) - map of flag name to value */\n\tunknownFlags: Map<string, boolean | string>;\n\tdiagnostics: Array<{ type: \"warning\" | \"error\"; message: string }>;\n}\n\nconst VALID_THINKING_LEVELS = [\"off\", \"minimal\", \"low\", \"medium\", \"high\", \"xhigh\"] as const;\n\nexport function isValidThinkingLevel(level: string): level is ThinkingLevel {\n\treturn VALID_THINKING_LEVELS.includes(level as ThinkingLevel);\n}\n\nexport function parseArgs(args: string[]): Args {\n\tconst result: Args = {\n\t\tmessages: [],\n\t\tfileArgs: [],\n\t\tunknownFlags: new Map(),\n\t\tdiagnostics: [],\n\t};\n\n\tfor (let i = 0; i < args.length; i++) {\n\t\tconst arg = args[i];\n\n\t\tif (arg === \"--help\" || arg === \"-h\") {\n\t\t\tresult.help = true;\n\t\t} else if (arg === \"--version\" || arg === \"-v\") {\n\t\t\tresult.version = true;\n\t\t} else if (arg === \"--mode\" && i + 1 < args.length) {\n\t\t\tconst mode = args[++i];\n\t\t\tif (mode === \"text\" || mode === \"json\" || mode === \"rpc\") {\n\t\t\t\tresult.mode = mode;\n\t\t\t}\n\t\t} else if (arg === \"--continue\" || arg === \"-c\") {\n\t\t\tresult.continue = true;\n\t\t} else if (arg === \"--resume\" || arg === \"-r\") {\n\t\t\tresult.resume = true;\n\t\t} else if (arg === \"--provider\" && i + 1 < args.length) {\n\t\t\tresult.provider = args[++i];\n\t\t} else if (arg === \"--model\" && i + 1 < args.length) {\n\t\t\tresult.model = args[++i];\n\t\t} else if (arg === \"--api-key\" && i + 1 < args.length) {\n\t\t\tresult.apiKey = args[++i];\n\t\t} else if (arg === \"--system-prompt\" && i + 1 < args.length) {\n\t\t\tresult.systemPrompt = args[++i];\n\t\t} else if (arg === \"--no-session\") {\n\t\t\tresult.noSession = true;\n\t\t} else if (arg === \"--task-id\" && i + 1 < args.length) {\n\t\t\tresult.taskId = args[++i];\n\t\t} else if (arg === \"--max-turns\" && i + 1 < args.length) {\n\t\t\tconst n = Number.parseInt(args[++i], 10);\n\t\t\tif (Number.isInteger(n) && n > 0) {\n\t\t\t\tresult.maxTurns = n;\n\t\t\t}\n\t\t} else if (arg === \"--session\" && i + 1 < args.length) {\n\t\t\tresult.session = args[++i];\n\t\t} else if (arg === \"--team\" && i + 1 < args.length) {\n\t\t\tresult.team = args[++i];\n\t\t} else if (arg === \"--fork\" && i + 1 < args.length) {\n\t\t\tresult.fork = args[++i];\n\t\t} else if (arg === \"--session-dir\" && i + 1 < args.length) {\n\t\t\tresult.sessionDir = args[++i];\n\t\t} else if (arg === \"--models\" && i + 1 < args.length) {\n\t\t\tresult.models = args[++i].split(\",\").map((s) => s.trim());\n\t\t} else if (arg === \"--no-tools\" || arg === \"-nt\") {\n\t\t\tresult.noTools = true;\n\t\t} else if (arg === \"--no-builtin-tools\" || arg === \"-nbt\") {\n\t\t\tresult.noBuiltinTools = true;\n\t\t} else if (arg === \"--enable-subagents\") {\n\t\t\tresult.subagent = true;\n\t\t} else if (arg === \"--no-subagents\" || arg === \"--disable-subagents\") {\n\t\t\tresult.subagent = false;\n\t\t} else if (arg === \"--warm-subagents\") {\n\t\t\tresult.warmSubagents = true;\n\t\t} else if (arg === \"--max-subagent-depth\" && i + 1 < args.length) {\n\t\t\tconst n = Number.parseInt(args[++i], 10);\n\t\t\tif (Number.isInteger(n) && n >= 1) {\n\t\t\t\tresult.maxSubagentDepth = n;\n\t\t\t}\n\t\t} else if (arg === \"--delegate-allow\" && i + 1 < args.length) {\n\t\t\tresult.delegateAllow = args[++i]\n\t\t\t\t.split(\",\")\n\t\t\t\t.map((s) => s.trim())\n\t\t\t\t.filter((name) => name.length > 0);\n\t\t} else if (arg === \"--enable-todowrite\") {\n\t\t\tresult.todoWrite = true;\n\t\t} else if (arg === \"--enable-webtools\") {\n\t\t\tresult.enableWebTools = true;\n\t\t} else if (arg === \"--enable-browsertools\") {\n\t\t\tresult.enableBrowserTools = true;\n\t\t} else if (arg === \"--enable-browser-live-preview\") {\n\t\t\tresult.enableBrowserLivePreview = true;\n\t\t} else if (arg === \"--enable-filetools\") {\n\t\t\tresult.enableFileTools = true;\n\t\t} else if (arg === \"--enable-plugintools\") {\n\t\t\tresult.enablePluginTools = true;\n\t\t} else if (arg === \"--light\") {\n\t\t\tresult.light = true;\n\t\t} else if (arg === \"--print-token-surface\") {\n\t\t\tresult.printTokenSurface = true;\n\t\t} else if (arg === \"--support-platform\" && i + 1 < args.length) {\n\t\t\tresult.supportPlatform = [\n\t\t\t\t...(result.supportPlatform ?? []),\n\t\t\t\t...args[++i]\n\t\t\t\t\t.split(\",\")\n\t\t\t\t\t.map((s) => s.trim())\n\t\t\t\t\t.filter(Boolean),\n\t\t\t];\n\t\t} else if (arg === \"--ca-cert\" && i + 1 < args.length) {\n\t\t\tresult.caCert = args[++i];\n\t\t} else if (arg === \"--use-system-ca\") {\n\t\t\tresult.useSystemCa = true;\n\t\t} else if ((arg === \"--tools\" || arg === \"-t\") && i + 1 < args.length) {\n\t\t\tresult.tools = args[++i]\n\t\t\t\t.split(\",\")\n\t\t\t\t.map((s) => s.trim())\n\t\t\t\t.filter((name) => name.length > 0);\n\t\t} else if (arg === \"--disallowed-tools\" && i + 1 < args.length) {\n\t\t\tresult.disallowedTools = args[++i]\n\t\t\t\t.split(\",\")\n\t\t\t\t.map((s) => s.trim())\n\t\t\t\t.filter((name) => name.length > 0);\n\t\t} else if (arg === \"--thinking\" && i + 1 < args.length) {\n\t\t\tconst level = args[++i];\n\t\t\tif (isValidThinkingLevel(level)) {\n\t\t\t\tresult.thinking = level;\n\t\t\t} else {\n\t\t\t\tresult.diagnostics.push({\n\t\t\t\t\ttype: \"warning\",\n\t\t\t\t\tmessage: `Invalid thinking level \"${level}\". Valid values: ${VALID_THINKING_LEVELS.join(\", \")}`,\n\t\t\t\t});\n\t\t\t}\n\t\t} else if (arg === \"--print\" || arg === \"-p\") {\n\t\t\tresult.print = true;\n\t\t\tconst next = args[i + 1];\n\t\t\tif (next !== undefined && !next.startsWith(\"@\") && (!next.startsWith(\"-\") || next.startsWith(\"---\"))) {\n\t\t\t\tresult.messages.push(next);\n\t\t\t\ti++;\n\t\t\t}\n\t\t} else if (arg === \"--export\" && i + 1 < args.length) {\n\t\t\tresult.export = args[++i];\n\t\t} else if ((arg === \"--extension\" || arg === \"-e\") && i + 1 < args.length) {\n\t\t\tresult.extensions = result.extensions ?? [];\n\t\t\tresult.extensions.push(args[++i]);\n\t\t} else if (arg === \"--no-extensions\" || arg === \"-ne\") {\n\t\t\tresult.noExtensions = true;\n\t\t} else if (arg === \"--skill\" && i + 1 < args.length) {\n\t\t\tresult.skills = result.skills ?? [];\n\t\t\tresult.skills.push(args[++i]);\n\t\t} else if (arg === \"--agent\" && i + 1 < args.length) {\n\t\t\tresult.agents = result.agents ?? [];\n\t\t\tresult.agents.push(args[++i]);\n\t\t} else if (arg === \"--prompt-template\" && i + 1 < args.length) {\n\t\t\tresult.promptTemplates = result.promptTemplates ?? [];\n\t\t\tresult.promptTemplates.push(args[++i]);\n\t\t} else if (arg === \"--slash-command\" && i + 1 < args.length) {\n\t\t\tresult.slashCommands = result.slashCommands ?? [];\n\t\t\tresult.slashCommands.push(args[++i]);\n\t\t} else if (arg === \"--theme\" && i + 1 < args.length) {\n\t\t\tresult.themes = result.themes ?? [];\n\t\t\tresult.themes.push(args[++i]);\n\t\t} else if (arg === \"--mode-path\" && i + 1 < args.length) {\n\t\t\tresult.modePaths = result.modePaths ?? [];\n\t\t\tresult.modePaths.push(args[++i]);\n\t\t} else if (arg === \"--no-skills\" || arg === \"-ns\") {\n\t\t\tresult.noSkills = true;\n\t\t} else if (arg === \"--no-prompt-templates\" || arg === \"-np\") {\n\t\t\tresult.noPromptTemplates = true;\n\t\t} else if (arg === \"--no-slash-commands\" || arg === \"-nsc\") {\n\t\t\tresult.noSlashCommands = true;\n\t\t} else if (arg === \"--no-themes\") {\n\t\t\tresult.noThemes = true;\n\t\t} else if (arg === \"--no-context-files\" || arg === \"-nc\") {\n\t\t\tresult.noContextFiles = true;\n\t\t} else if (arg === \"--list-models\") {\n\t\t\t// Check if next arg is a search pattern (not a flag or file arg)\n\t\t\tif (i + 1 < args.length && !args[i + 1].startsWith(\"-\") && !args[i + 1].startsWith(\"@\")) {\n\t\t\t\tresult.listModels = args[++i];\n\t\t\t} else {\n\t\t\t\tresult.listModels = true;\n\t\t\t}\n\t\t} else if (arg === \"--verbose\") {\n\t\t\tresult.verbose = true;\n\t\t} else if (arg === \"--offline\") {\n\t\t\tresult.offline = true;\n\t\t} else if (arg.startsWith(\"@\")) {\n\t\t\tresult.fileArgs.push(arg.slice(1)); // Remove @ prefix\n\t\t} else if (arg.startsWith(\"--\")) {\n\t\t\tconst eqIndex = arg.indexOf(\"=\");\n\t\t\tif (eqIndex !== -1) {\n\t\t\t\tresult.unknownFlags.set(arg.slice(2, eqIndex), arg.slice(eqIndex + 1));\n\t\t\t} else {\n\t\t\t\tconst flagName = arg.slice(2);\n\t\t\t\tconst next = args[i + 1];\n\t\t\t\tif (next !== undefined && !next.startsWith(\"-\") && !next.startsWith(\"@\")) {\n\t\t\t\t\tresult.unknownFlags.set(flagName, next);\n\t\t\t\t\ti++;\n\t\t\t\t} else {\n\t\t\t\t\tresult.unknownFlags.set(flagName, true);\n\t\t\t\t}\n\t\t\t}\n\t\t} else if (arg.startsWith(\"-\") && !arg.startsWith(\"--\")) {\n\t\t\tresult.diagnostics.push({ type: \"error\", message: `Unknown option: ${arg}` });\n\t\t} else if (!arg.startsWith(\"-\")) {\n\t\t\tresult.messages.push(arg);\n\t\t}\n\t}\n\n\treturn result;\n}\n\nexport function printHelp(extensionFlags?: ExtensionFlag[]): void {\n\tconst extensionFlagsText =\n\t\textensionFlags && extensionFlags.length > 0\n\t\t\t? `\\n${chalk.bold(\"Extension CLI Flags:\")}\\n${extensionFlags\n\t\t\t\t\t.map((flag) => {\n\t\t\t\t\t\tconst value = flag.type === \"string\" ? \" <value>\" : \"\";\n\t\t\t\t\t\tconst description = flag.description ?? `Registered by ${flag.extensionPath}`;\n\t\t\t\t\t\treturn ` --${flag.name}${value}`.padEnd(30) + description;\n\t\t\t\t\t})\n\t\t\t\t\t.join(\"\\n\")}\\n`\n\t\t\t: \"\";\n\tconsole.log(`${chalk.bold(APP_NAME)} - AI coding assistant with read, bash, edit, write tools\n\n${chalk.bold(\"Usage:\")}\n ${APP_NAME} [options] [@files...] [messages...]\n\n${chalk.bold(\"Commands:\")}\n ${APP_NAME} install <source> [-l] Install extension source and add to settings\n ${APP_NAME} remove <source> [-l] Remove extension source from settings\n ${APP_NAME} uninstall <source> [-l] Alias for remove\n ${APP_NAME} update [source|self|pi] Update hoocode and installed extensions\n ${APP_NAME} list List installed extensions from settings\n ${APP_NAME} config Open TUI to enable/disable package resources\n ${APP_NAME} resources List discovered skills, subagents, slash commands, and MCP servers\n ${APP_NAME} <command> --help Show help for install/remove/uninstall/update/list\n\n${chalk.bold(\"Options:\")}\n --provider <name> Provider name (default: google)\n --model <pattern> Model pattern or ID (supports \"provider/id\" and optional \":<thinking>\")\n --api-key <key> API key (defaults to env vars)\n --system-prompt <text> System prompt (default: coding assistant prompt)\n --mode <mode> Output mode: text (default), json, or rpc\n --print, -p Non-interactive mode: process prompt and exit\n --continue, -c Continue previous session\n --resume, -r Select a session to resume\n --session <path|id> Use specific session file or partial UUID\n --fork <path|id> Fork specific session file or partial UUID into a new session\n --session-dir <dir> Directory for session storage and lookup\n --no-session Don't save session (ephemeral)\n --team <url|auto> Bridge a hooteams server into the task panel's teams view\n (focus roles, nudge, attach, answer approval gates);\n \"auto\" finds .agents/teams/default.json\n or hooteams.config.json upward from cwd and spawns hooteams locally\n --models <patterns> Comma-separated model patterns for Ctrl+P cycling\n Supports globs (anthropic/*, *sonnet*) and fuzzy matching\n --no-tools, -nt Disable all tools by default (built-in and extension)\n --no-builtin-tools, -nbt Disable built-in tools by default but keep extension/custom tools enabled\n --tools, -t <tools> Comma-separated allowlist of tool names to enable\n Applies to built-in, extension, and custom tools\n --disallowed-tools <tools> Comma-separated denylist of tool names to disable\n (subtracted from the allowlist or default set)\n --max-turns <n> Hard cap on assistant turns; the agent is asked to wrap up near the\n cap and stopped at it (mainly used for spawned subagents)\n --enable-subagents Enable the subagent tool (delegate tasks to isolated agent loops).\n On by default (the \"enableSubagent\" setting defaults to true)\n --no-subagents Disable the subagent tool for this session (overrides the setting)\n --warm-subagents Dispatch eligible subagents on reused warm RPC workers (experimental)\n --max-subagent-depth <n> Tree-wide subagent nesting cap (default 2 = one level of nesting;\n 1 = no nesting). Overrides the \"maxSubagentDepth\" setting\n Can also be enabled via the \"enableSubagent\" setting\n --enable-todowrite Enable the TodoWrite tool (maintain a live todo list in the task panel)\n Can also be enabled via the \"enableTodoWrite\" setting\n --enable-webtools Enable the webfetch + websearch tools (network access, off by default)\n Can also be enabled via the \"enableWebTools\" setting\n Block hosts with a .webtoolsignore file (gitignore syntax)\n --enable-browsertools Enable the browser_run + browser_continue tools (off by default)\n Deterministic browser automation via the browsertools engine,\n pausing for LLM decisions (NeedsParent) mid-flow\n Can also be enabled via the \"enableBrowserTools\" setting\n --enable-browser-live-preview Default the live viewer on for browser_run runs and auto-open it\n Streams the page + the agent's tool-call log over a local WebSocket\n Set HOOCODE_BROWSERTOOLS_NO_OPEN=1 to print the URL without opening\n Can also be enabled via the \"enableBrowserLivePreview\" setting\n --enable-filetools Enable the document tools (off by default)\n DocRead/DocEdit/DocWrite (extract + lossless id-based edit) and\n DocScan/DocGrep/DocPeek (cheap outline/search/partial read) for\n XML, drawio, docx/xlsx/pptx, PDF via the filetools binary\n Can also be enabled via the \"enableFileTools\" setting\n --enable-plugintools Enable the autonomous plugin system (off by default)\n Plugin lifecycle tools (SearchPlugins, InstallPlugin, ...) and\n ProposePlugin, plus the runtime plugin-reuse nudge\n Can also be enabled via the \"enablePluginTools\" setting\n --light Minimal low-token preset for small/local models:\n only the read/write/edit/bash tools (short descriptions,\n stripped schemas; search via bash), a terse system prompt, and\n no subagents/TodoWrite/skills/context files/mode appendix\n Can also be enabled via the \"light\" setting\n --print-token-surface Print the fixed per-turn surface (system prompt + serialized\n tool schema token estimate) and exit\n --support-platform <list> Platform layout(s) hoocode targets when it writes artifacts:\n authored plugins (ProposePlugin) and the /new-skill /new-agent\n /new-command scaffolds. Comma-separated and/or repeated.\n Tokens: claude, copilot (alias: github, gh), agents (alias: native)\n e.g. --support-platform copilot writes .github/skills/<name>/SKILL.md,\n .github/agents/<name>.agent.md, .github/prompts/<name>.prompt.md and\n a .github/plugin/plugin.json manifest for authored plugins\n Default: claude + copilot for authored plugins; .hoocode/ for scaffolds\n Can also be set via the \"supportPlatform\" setting\n --thinking <level> Set thinking level: off, minimal, low, medium, high, xhigh\n --extension, -e <path> Load an extension file (can be used multiple times)\n --no-extensions, -ne Disable extension discovery (explicit -e paths still work)\n --skill <path> Load a skill file or directory (can be used multiple times)\n --no-skills, -ns Disable skills discovery and loading\n --agent <path> Load an agent file or directory (can be used multiple times)\n --prompt-template <path> Load a prompt template / slash command file or directory (repeatable)\n --slash-command <path> Alias of --prompt-template (prompts and slash commands are one feature)\n --no-prompt-templates, -np Disable prompt template / slash command discovery (same as --no-slash-commands)\n --no-slash-commands, -nsc Disable prompt template / slash command discovery (same as --no-prompt-templates)\n --theme <path> Load a theme file or directory (can be used multiple times)\n --no-themes Disable theme discovery and loading\n --mode-path <dir> Add a directory to search for {name}/system.md mode files (can be used multiple times)\n --no-context-files, -nc Disable AGENTS.md and CLAUDE.md discovery and loading\n --export <file> Export session file to HTML and exit\n --list-models [search] List available models (with optional fuzzy search)\n --verbose Force verbose startup (overrides quietStartup setting)\n --offline Disable startup network operations (same as HOOCODE_OFFLINE=1)\n --ca-cert <path> Trust an extra PEM CA bundle for hoocode's own TLS traffic (provider\n calls, GitHub API, downloads). Additive to the bundled roots;\n verification stays ON. Also: HOOCODE_CA_CERT / NODE_EXTRA_CA_CERTS.\n Does not affect the webfetch/websearch binary.\n --use-system-ca Also trust the OS/system CA store (opt-in). Same as\n HOOCODE_USE_SYSTEM_CA=1\n --help, -h Show this help\n --version, -v Show version number\n\nExtensions can register additional flags (e.g., --plan from plan-mode extension).${extensionFlagsText}\n\n${chalk.bold(\"Examples:\")}\n # Interactive mode\n ${APP_NAME}\n\n # Interactive mode with initial prompt\n ${APP_NAME} \"List all .ts files in src/\"\n\n # Include files in initial message\n ${APP_NAME} @prompt.md @image.png \"What color is the sky?\"\n\n # Non-interactive mode (process and exit)\n ${APP_NAME} -p \"List all .ts files in src/\"\n\n # Multiple messages (interactive)\n ${APP_NAME} \"Read package.json\" \"What dependencies do we have?\"\n\n # Continue previous session\n ${APP_NAME} --continue \"What did we discuss?\"\n\n # Use different model\n ${APP_NAME} --provider openai --model gpt-4o-mini \"Help me refactor this code\"\n\n # Use model with provider prefix (no --provider needed)\n ${APP_NAME} --model openai/gpt-4o \"Help me refactor this code\"\n\n # Use model with thinking level shorthand\n ${APP_NAME} --model sonnet:high \"Solve this complex problem\"\n\n # Limit model cycling to specific models\n ${APP_NAME} --models claude-sonnet,claude-haiku,gpt-4o\n\n # Limit to a specific provider with glob pattern\n ${APP_NAME} --models \"github-copilot/*\"\n\n # Cycle models with fixed thinking levels\n ${APP_NAME} --models sonnet:high,haiku:low\n\n # Start with a specific thinking level\n ${APP_NAME} --thinking high \"Solve this complex problem\"\n\n # Read-only mode (no file modifications possible)\n ${APP_NAME} --tools read,grep,find,ls -p \"Review the code in src/\"\n\n # Export a session file to HTML\n ${APP_NAME} --export ~/${CONFIG_DIR_NAME}/agent/sessions/--path--/session.jsonl\n ${APP_NAME} --export session.jsonl output.html\n\n${chalk.bold(\"Environment Variables:\")}\n ANTHROPIC_API_KEY - Anthropic Claude API key\n ANTHROPIC_OAUTH_TOKEN - Anthropic OAuth token (alternative to API key)\n OPENAI_API_KEY - OpenAI GPT API key\n AZURE_OPENAI_API_KEY - Azure OpenAI API key\n AZURE_OPENAI_BASE_URL - Azure OpenAI/Cognitive Services base URL (e.g. https://{resource}.openai.azure.com)\n AZURE_OPENAI_RESOURCE_NAME - Azure OpenAI resource name (alternative to base URL)\n AZURE_OPENAI_API_VERSION - Azure OpenAI API version (default: v1)\n AZURE_OPENAI_DEPLOYMENT_NAME_MAP - Azure OpenAI model=deployment map (comma-separated)\n DEEPSEEK_API_KEY - DeepSeek API key\n GEMINI_API_KEY - Google Gemini API key\n GROQ_API_KEY - Groq API key\n CEREBRAS_API_KEY - Cerebras API key\n XAI_API_KEY - xAI Grok API key\n FIREWORKS_API_KEY - Fireworks API key\n TOGETHER_API_KEY - Together AI API key\n OPENROUTER_API_KEY - OpenRouter API key\n AI_GATEWAY_API_KEY - Vercel AI Gateway API key\n ZAI_API_KEY - ZAI API key\n MISTRAL_API_KEY - Mistral API key\n MINIMAX_API_KEY - MiniMax API key\n MOONSHOT_API_KEY - Moonshot AI API key\n OPENCODE_API_KEY - OpenCode Zen/OpenCode Go API key\n KIMI_API_KEY - Kimi For Coding API key\n CLOUDFLARE_API_KEY - Cloudflare API token (Workers AI and AI Gateway)\n CLOUDFLARE_ACCOUNT_ID - Cloudflare account id (required for both)\n CLOUDFLARE_GATEWAY_ID - Cloudflare AI Gateway slug (required for AI Gateway)\n XIAOMI_API_KEY - Xiaomi MiMo API key (api.xiaomimimo.com billing)\n XIAOMI_TOKEN_PLAN_CN_API_KEY - Xiaomi MiMo Token Plan API key (China region)\n XIAOMI_TOKEN_PLAN_AMS_API_KEY - Xiaomi MiMo Token Plan API key (Amsterdam region)\n XIAOMI_TOKEN_PLAN_SGP_API_KEY - Xiaomi MiMo Token Plan API key (Singapore region)\n NVIDIA_API_KEY - NVIDIA API key (integrate.api.nvidia.com)\n AWS_PROFILE - AWS profile for Amazon Bedrock\n AWS_ACCESS_KEY_ID - AWS access key for Amazon Bedrock\n AWS_SECRET_ACCESS_KEY - AWS secret key for Amazon Bedrock\n AWS_BEARER_TOKEN_BEDROCK - Bedrock API key (bearer token)\n AWS_REGION - AWS region for Amazon Bedrock (e.g., us-east-1)\n ${ENV_AGENT_DIR.padEnd(32)} - Config directory (default: ~/${CONFIG_DIR_NAME}/agent)\n ${ENV_SESSION_DIR.padEnd(32)} - Session storage directory (overridden by --session-dir)\n HOOCODE_PACKAGE_DIR - Override package directory (for Nix/Guix store paths).\n HOOCODE_OFFLINE - Disable startup network operations when set to 1/true/yes.\n HOOCODE_CA_CERT - Path to an extra PEM CA bundle to trust for hoocode's own TLS traffic\n (additive; verification stays on). Precedence: --ca-cert > this > NODE_EXTRA_CA_CERTS\n HOOCODE_USE_SYSTEM_CA - Also trust the OS/system CA store when set to 1/true/yes (same as --use-system-ca)\n NODE_EXTRA_CA_CERTS - Standard Node path to an extra PEM CA bundle (used as the lowest-precedence CA source)\n HOOCODE_WEBTOOLS_CA_CERT - Path to a PEM CA bundle forwarded to the webtools binary (webfetch/websearch) as --ca-cert\n HOOCODE_WEBTOOLS_INSECURE - Forward --insecure to the webtools binary (disables its TLS verification) when set to 1/true/yes\n HOOCODE_TELEMETRY - Override install telemetry when set to 1/true/yes or 0/false/no.\n HOOCODE_SHARE_VIEWER_URL - Base URL for /share command (default: https://pi.dev/session/).\n\n${chalk.bold(\"Built-in Tool Names:\")}\n read - Read file contents\n bash - Execute bash commands\n edit - Edit files with find/replace\n write - Write files (creates/overwrites)\n grep - Search file contents (read-only, off by default)\n find - Find files by glob pattern (read-only, off by default)\n ls - List directory contents (read-only, off by default)\n`);\n}\n"]}
1
+ {"version":3,"file":"args.d.ts","sourceRoot":"","sources":["../../src/cli/args.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,iCAAiC,CAAC;AAGrE,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,6BAA6B,CAAC;AAEjE,MAAM,MAAM,IAAI,GAAG,MAAM,GAAG,MAAM,GAAG,KAA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AC;IACnB,8EAA8E;IAC9E,YAAY,EAAE,GAAG,CAAC,MAAM,EAAE,OAAO,GAAG,MAAM,CAAC,CAAC;IAC5C,WAAW,EAAE,KAAK,CAAC;QAAE,IAAI,EAAE,SAAS,GAAG,OAAO,CAAC;QAAC,OAAO,EAAE,MAAM,CAAA;KAAE,CAAC,CAAC;CACnE;AAID,wBAAgB,oBAAoB,CAAC,KAAK,EAAE,MAAM,GAAG,KAAK,IAAI,aAAa,CAE1E;AAED,wBAAgB,SAAS,CAAC,IAAI,EAAE,MAAM,EAAE,GAAG,IAAI,CAoM9C;AAED,wBAAgB,SAAS,CAAC,cAAc,CAAC,EAAE,aAAa,EAAE,GAAG,IAAI,CA2OhE","sourcesContent":["/**\n * CLI argument parsing and help display\n */\n\nimport type { ThinkingLevel } from \"@kolisachint/hoocode-agent-core\";\nimport chalk from \"chalk\";\nimport { APP_NAME, CONFIG_DIR_NAME, ENV_AGENT_DIR, ENV_SESSION_DIR } from \"../config.js\";\nimport type { ExtensionFlag } from \"../core/extensions/types.js\";\n\nexport type Mode = \"text\" | \"json\" | \"rpc\";\n\nexport interface Args {\n\tprovider?: string;\n\tmodel?: string;\n\tapiKey?: string;\n\tsystemPrompt?: string;\n\tthinking?: ThinkingLevel;\n\tcontinue?: boolean;\n\tresume?: boolean;\n\thelp?: boolean;\n\tversion?: boolean;\n\tmode?: Mode;\n\tnoSession?: boolean;\n\t/** Internal: task id assigned by SubagentPool when this process is a spawned subagent. */\n\ttaskId?: string;\n\t/** Hard cap on assistant turns. Near the cap the agent is asked to wrap up; at the cap it is stopped. */\n\tmaxTurns?: number;\n\tsession?: string;\n\t/** Base URL of a hooteams server to bridge into the task panel's teams view, or \"auto\" to discover a config and spawn one locally. */\n\tteam?: string;\n\tfork?: string;\n\tsessionDir?: string;\n\tmodels?: string[];\n\ttools?: string[];\n\tdisallowedTools?: string[];\n\tnoTools?: boolean;\n\tnoBuiltinTools?: boolean;\n\t/** Tri-state override of the `enableSubagent` setting (default true): --enable-subagents → true, --no-subagents → false, unset → setting. */\n\tsubagent?: boolean;\n\t/** Dispatch eligible subagents on reused warm RPC workers (overrides the warmSubagents setting). */\n\twarmSubagents?: boolean;\n\t/** Tree-wide subagent nesting cap (overrides the maxSubagentDepth setting). */\n\tmaxSubagentDepth?: number;\n\t/** Internal: restricts which subagent types this process may delegate to. */\n\tdelegateAllow?: string[];\n\ttodoWrite?: boolean;\n\t/** Enable the webfetch + websearch tools (off by default). */\n\tenableWebTools?: boolean;\n\t/** Enable the browser_run + browser_continue tools (browsertools engine, off by default). */\n\tenableBrowserTools?: boolean;\n\t/** Default the streamed live viewer on for browser_run runs and auto-open it (off by default). */\n\tenableBrowserLivePreview?: boolean;\n\t/** Enable the document tools — DocRead/DocEdit/DocWrite + DocScan/DocGrep/DocPeek (off by default). */\n\tenableFileTools?: boolean;\n\t/** Enable the autonomous plugin system — plugin lifecycle tools (SearchPlugins, InstallPlugin, ...) and ProposePlugin (off by default). */\n\tenablePluginTools?: boolean;\n\t/** Minimal low-token preset for small/local models: read/write/edit/bash only, terse prompt, no subagents/todo/skills/context files/mode appendix. */\n\tlight?: boolean;\n\t/** Print the fixed per-turn surface (system prompt + serialized tool schema token estimate) and exit. */\n\tprintTokenSurface?: boolean;\n\t/**\n\t * Platform layout(s) hoocode targets when it WRITES artifacts (authored\n\t * plugins, /new-skill //new-agent //new-command scaffolds). Raw tokens as\n\t * given (comma-separated and/or repeated); normalized downstream:\n\t * agents|native, claude, github|copilot|gh.\n\t */\n\tsupportPlatform?: string[];\n\t/** Path to an explicit PEM CA bundle to trust additively for hoocode's own TLS traffic. */\n\tcaCert?: string;\n\t/** Trust the OS/system CA store additively (opt-in) for hoocode's own TLS traffic. */\n\tuseSystemCa?: boolean;\n\textensions?: string[];\n\tnoExtensions?: boolean;\n\tprint?: boolean;\n\texport?: string;\n\tnoSkills?: boolean;\n\tskills?: string[];\n\tagents?: string[];\n\tpromptTemplates?: string[];\n\tnoPromptTemplates?: boolean;\n\tslashCommands?: string[];\n\tnoSlashCommands?: boolean;\n\tthemes?: string[];\n\tnoThemes?: boolean;\n\tmodePaths?: string[];\n\tnoContextFiles?: boolean;\n\tlistModels?: string | true;\n\toffline?: boolean;\n\tverbose?: boolean;\n\tmessages: string[];\n\tfileArgs: string[];\n\t/** Unknown flags (potentially extension flags) - map of flag name to value */\n\tunknownFlags: Map<string, boolean | string>;\n\tdiagnostics: Array<{ type: \"warning\" | \"error\"; message: string }>;\n}\n\nconst VALID_THINKING_LEVELS = [\"off\", \"minimal\", \"low\", \"medium\", \"high\", \"xhigh\"] as const;\n\nexport function isValidThinkingLevel(level: string): level is ThinkingLevel {\n\treturn VALID_THINKING_LEVELS.includes(level as ThinkingLevel);\n}\n\nexport function parseArgs(args: string[]): Args {\n\tconst result: Args = {\n\t\tmessages: [],\n\t\tfileArgs: [],\n\t\tunknownFlags: new Map(),\n\t\tdiagnostics: [],\n\t};\n\n\tfor (let i = 0; i < args.length; i++) {\n\t\tconst arg = args[i];\n\n\t\tif (arg === \"--help\" || arg === \"-h\") {\n\t\t\tresult.help = true;\n\t\t} else if (arg === \"--version\" || arg === \"-v\") {\n\t\t\tresult.version = true;\n\t\t} else if (arg === \"--mode\" && i + 1 < args.length) {\n\t\t\tconst mode = args[++i];\n\t\t\tif (mode === \"text\" || mode === \"json\" || mode === \"rpc\") {\n\t\t\t\tresult.mode = mode;\n\t\t\t}\n\t\t} else if (arg === \"--continue\" || arg === \"-c\") {\n\t\t\tresult.continue = true;\n\t\t} else if (arg === \"--resume\" || arg === \"-r\") {\n\t\t\tresult.resume = true;\n\t\t} else if (arg === \"--provider\" && i + 1 < args.length) {\n\t\t\tresult.provider = args[++i];\n\t\t} else if (arg === \"--model\" && i + 1 < args.length) {\n\t\t\tresult.model = args[++i];\n\t\t} else if (arg === \"--api-key\" && i + 1 < args.length) {\n\t\t\tresult.apiKey = args[++i];\n\t\t} else if (arg === \"--system-prompt\" && i + 1 < args.length) {\n\t\t\tresult.systemPrompt = args[++i];\n\t\t} else if (arg === \"--no-session\") {\n\t\t\tresult.noSession = true;\n\t\t} else if (arg === \"--task-id\" && i + 1 < args.length) {\n\t\t\tresult.taskId = args[++i];\n\t\t} else if (arg === \"--max-turns\" && i + 1 < args.length) {\n\t\t\tconst n = Number.parseInt(args[++i], 10);\n\t\t\tif (Number.isInteger(n) && n > 0) {\n\t\t\t\tresult.maxTurns = n;\n\t\t\t}\n\t\t} else if (arg === \"--session\" && i + 1 < args.length) {\n\t\t\tresult.session = args[++i];\n\t\t} else if (arg === \"--team\" && i + 1 < args.length) {\n\t\t\tresult.team = args[++i];\n\t\t} else if (arg === \"--fork\" && i + 1 < args.length) {\n\t\t\tresult.fork = args[++i];\n\t\t} else if (arg === \"--session-dir\" && i + 1 < args.length) {\n\t\t\tresult.sessionDir = args[++i];\n\t\t} else if (arg === \"--models\" && i + 1 < args.length) {\n\t\t\tresult.models = args[++i].split(\",\").map((s) => s.trim());\n\t\t} else if (arg === \"--no-tools\" || arg === \"-nt\") {\n\t\t\tresult.noTools = true;\n\t\t} else if (arg === \"--no-builtin-tools\" || arg === \"-nbt\") {\n\t\t\tresult.noBuiltinTools = true;\n\t\t} else if (arg === \"--enable-subagents\") {\n\t\t\tresult.subagent = true;\n\t\t} else if (arg === \"--no-subagents\" || arg === \"--disable-subagents\") {\n\t\t\tresult.subagent = false;\n\t\t} else if (arg === \"--warm-subagents\") {\n\t\t\tresult.warmSubagents = true;\n\t\t} else if (arg === \"--max-subagent-depth\" && i + 1 < args.length) {\n\t\t\tconst n = Number.parseInt(args[++i], 10);\n\t\t\tif (Number.isInteger(n) && n >= 1) {\n\t\t\t\tresult.maxSubagentDepth = n;\n\t\t\t}\n\t\t} else if (arg === \"--delegate-allow\" && i + 1 < args.length) {\n\t\t\tresult.delegateAllow = args[++i]\n\t\t\t\t.split(\",\")\n\t\t\t\t.map((s) => s.trim())\n\t\t\t\t.filter((name) => name.length > 0);\n\t\t} else if (arg === \"--enable-todowrite\") {\n\t\t\tresult.todoWrite = true;\n\t\t} else if (arg === \"--enable-webtools\") {\n\t\t\tresult.enableWebTools = true;\n\t\t} else if (arg === \"--enable-browsertools\") {\n\t\t\tresult.enableBrowserTools = true;\n\t\t} else if (arg === \"--enable-browser-live-preview\") {\n\t\t\tresult.enableBrowserLivePreview = true;\n\t\t} else if (arg === \"--enable-filetools\") {\n\t\t\tresult.enableFileTools = true;\n\t\t} else if (arg === \"--enable-plugintools\") {\n\t\t\tresult.enablePluginTools = true;\n\t\t} else if (arg === \"--light\") {\n\t\t\tresult.light = true;\n\t\t} else if (arg === \"--print-token-surface\") {\n\t\t\tresult.printTokenSurface = true;\n\t\t} else if (arg === \"--support-platform\" && i + 1 < args.length) {\n\t\t\tresult.supportPlatform = [\n\t\t\t\t...(result.supportPlatform ?? []),\n\t\t\t\t...args[++i]\n\t\t\t\t\t.split(\",\")\n\t\t\t\t\t.map((s) => s.trim())\n\t\t\t\t\t.filter(Boolean),\n\t\t\t];\n\t\t} else if (arg === \"--ca-cert\" && i + 1 < args.length) {\n\t\t\tresult.caCert = args[++i];\n\t\t} else if (arg === \"--use-system-ca\") {\n\t\t\tresult.useSystemCa = true;\n\t\t} else if ((arg === \"--tools\" || arg === \"-t\") && i + 1 < args.length) {\n\t\t\tresult.tools = args[++i]\n\t\t\t\t.split(\",\")\n\t\t\t\t.map((s) => s.trim())\n\t\t\t\t.filter((name) => name.length > 0);\n\t\t} else if (arg === \"--disallowed-tools\" && i + 1 < args.length) {\n\t\t\tresult.disallowedTools = args[++i]\n\t\t\t\t.split(\",\")\n\t\t\t\t.map((s) => s.trim())\n\t\t\t\t.filter((name) => name.length > 0);\n\t\t} else if (arg === \"--thinking\" && i + 1 < args.length) {\n\t\t\tconst level = args[++i];\n\t\t\tif (isValidThinkingLevel(level)) {\n\t\t\t\tresult.thinking = level;\n\t\t\t} else {\n\t\t\t\tresult.diagnostics.push({\n\t\t\t\t\ttype: \"warning\",\n\t\t\t\t\tmessage: `Invalid thinking level \"${level}\". Valid values: ${VALID_THINKING_LEVELS.join(\", \")}`,\n\t\t\t\t});\n\t\t\t}\n\t\t} else if (arg === \"--print\" || arg === \"-p\") {\n\t\t\tresult.print = true;\n\t\t\tconst next = args[i + 1];\n\t\t\tif (next !== undefined && !next.startsWith(\"@\") && (!next.startsWith(\"-\") || next.startsWith(\"---\"))) {\n\t\t\t\tresult.messages.push(next);\n\t\t\t\ti++;\n\t\t\t}\n\t\t} else if (arg === \"--export\" && i + 1 < args.length) {\n\t\t\tresult.export = args[++i];\n\t\t} else if ((arg === \"--extension\" || arg === \"-e\") && i + 1 < args.length) {\n\t\t\tresult.extensions = result.extensions ?? [];\n\t\t\tresult.extensions.push(args[++i]);\n\t\t} else if (arg === \"--no-extensions\" || arg === \"-ne\") {\n\t\t\tresult.noExtensions = true;\n\t\t} else if (arg === \"--skill\" && i + 1 < args.length) {\n\t\t\tresult.skills = result.skills ?? [];\n\t\t\tresult.skills.push(args[++i]);\n\t\t} else if (arg === \"--agent\" && i + 1 < args.length) {\n\t\t\tresult.agents = result.agents ?? [];\n\t\t\tresult.agents.push(args[++i]);\n\t\t} else if (arg === \"--prompt-template\" && i + 1 < args.length) {\n\t\t\tresult.promptTemplates = result.promptTemplates ?? [];\n\t\t\tresult.promptTemplates.push(args[++i]);\n\t\t} else if (arg === \"--slash-command\" && i + 1 < args.length) {\n\t\t\tresult.slashCommands = result.slashCommands ?? [];\n\t\t\tresult.slashCommands.push(args[++i]);\n\t\t} else if (arg === \"--theme\" && i + 1 < args.length) {\n\t\t\tresult.themes = result.themes ?? [];\n\t\t\tresult.themes.push(args[++i]);\n\t\t} else if (arg === \"--mode-path\" && i + 1 < args.length) {\n\t\t\tresult.modePaths = result.modePaths ?? [];\n\t\t\tresult.modePaths.push(args[++i]);\n\t\t} else if (arg === \"--no-skills\" || arg === \"-ns\") {\n\t\t\tresult.noSkills = true;\n\t\t} else if (arg === \"--no-prompt-templates\" || arg === \"-np\") {\n\t\t\tresult.noPromptTemplates = true;\n\t\t} else if (arg === \"--no-slash-commands\" || arg === \"-nsc\") {\n\t\t\tresult.noSlashCommands = true;\n\t\t} else if (arg === \"--no-themes\") {\n\t\t\tresult.noThemes = true;\n\t\t} else if (arg === \"--no-context-files\" || arg === \"-nc\") {\n\t\t\tresult.noContextFiles = true;\n\t\t} else if (arg === \"--list-models\") {\n\t\t\t// Check if next arg is a search pattern (not a flag or file arg)\n\t\t\tif (i + 1 < args.length && !args[i + 1].startsWith(\"-\") && !args[i + 1].startsWith(\"@\")) {\n\t\t\t\tresult.listModels = args[++i];\n\t\t\t} else {\n\t\t\t\tresult.listModels = true;\n\t\t\t}\n\t\t} else if (arg === \"--verbose\") {\n\t\t\tresult.verbose = true;\n\t\t} else if (arg === \"--offline\") {\n\t\t\tresult.offline = true;\n\t\t} else if (arg.startsWith(\"@\")) {\n\t\t\tresult.fileArgs.push(arg.slice(1)); // Remove @ prefix\n\t\t} else if (arg.startsWith(\"--\")) {\n\t\t\tconst eqIndex = arg.indexOf(\"=\");\n\t\t\tif (eqIndex !== -1) {\n\t\t\t\tresult.unknownFlags.set(arg.slice(2, eqIndex), arg.slice(eqIndex + 1));\n\t\t\t} else {\n\t\t\t\tconst flagName = arg.slice(2);\n\t\t\t\tconst next = args[i + 1];\n\t\t\t\tif (next !== undefined && !next.startsWith(\"-\") && !next.startsWith(\"@\")) {\n\t\t\t\t\tresult.unknownFlags.set(flagName, next);\n\t\t\t\t\ti++;\n\t\t\t\t} else {\n\t\t\t\t\tresult.unknownFlags.set(flagName, true);\n\t\t\t\t}\n\t\t\t}\n\t\t} else if (arg.startsWith(\"-\") && !arg.startsWith(\"--\")) {\n\t\t\tresult.diagnostics.push({ type: \"error\", message: `Unknown option: ${arg}` });\n\t\t} else if (!arg.startsWith(\"-\")) {\n\t\t\tresult.messages.push(arg);\n\t\t}\n\t}\n\n\treturn result;\n}\n\nexport function printHelp(extensionFlags?: ExtensionFlag[]): void {\n\tconst extensionFlagsText =\n\t\textensionFlags && extensionFlags.length > 0\n\t\t\t? `\\n${chalk.bold(\"Extension CLI Flags:\")}\\n${extensionFlags\n\t\t\t\t\t.map((flag) => {\n\t\t\t\t\t\tconst value = flag.type === \"string\" ? \" <value>\" : \"\";\n\t\t\t\t\t\tconst description = flag.description ?? `Registered by ${flag.extensionPath}`;\n\t\t\t\t\t\treturn ` --${flag.name}${value}`.padEnd(30) + description;\n\t\t\t\t\t})\n\t\t\t\t\t.join(\"\\n\")}\\n`\n\t\t\t: \"\";\n\tconsole.log(`${chalk.bold(APP_NAME)} - AI coding assistant with read, bash, edit, write tools\n\n${chalk.bold(\"Usage:\")}\n ${APP_NAME} [options] [@files...] [messages...]\n\n${chalk.bold(\"Commands:\")}\n ${APP_NAME} install <source> [-l] Install extension source and add to settings\n ${APP_NAME} remove <source> [-l] Remove extension source from settings\n ${APP_NAME} uninstall <source> [-l] Alias for remove\n ${APP_NAME} update [source|self|pi] Update hoocode and installed extensions\n ${APP_NAME} list List installed extensions from settings\n ${APP_NAME} config Open TUI to enable/disable package resources\n ${APP_NAME} resources List discovered skills, subagents, slash commands, and MCP servers\n ${APP_NAME} <command> --help Show help for install/remove/uninstall/update/list\n\n${chalk.bold(\"Options:\")}\n --provider <name> Provider name (default: google)\n --model <pattern> Model pattern or ID (supports \"provider/id\" and optional \":<thinking>\")\n --api-key <key> API key (defaults to env vars)\n --system-prompt <text> System prompt (default: coding assistant prompt)\n --mode <mode> Output mode: text (default), json, or rpc\n --print, -p Non-interactive mode: process prompt and exit\n --continue, -c Continue previous session\n --resume, -r Select a session to resume\n --session <path|id> Use specific session file or partial UUID\n --fork <path|id> Fork specific session file or partial UUID into a new session\n --session-dir <dir> Directory for session storage and lookup\n --no-session Don't save session (ephemeral)\n --team <url|auto> Bridge a hooteams server into the task panel's teams view\n (focus roles, nudge, attach, answer approval gates);\n \"auto\" finds .agents/teams/default.json\n or hooteams.config.json upward from cwd and spawns hooteams locally\n --models <patterns> Comma-separated model patterns for Ctrl+P cycling\n Supports globs (anthropic/*, *sonnet*) and fuzzy matching\n --no-tools, -nt Disable all tools by default (built-in and extension)\n --no-builtin-tools, -nbt Disable built-in tools by default but keep extension/custom tools enabled\n --tools, -t <tools> Comma-separated allowlist of tool names to enable\n Applies to built-in, extension, and custom tools\n --disallowed-tools <tools> Comma-separated denylist of tool names to disable\n (subtracted from the allowlist or default set)\n --max-turns <n> Hard cap on assistant turns; the agent is asked to wrap up near the\n cap and stopped at it (mainly used for spawned subagents)\n --enable-subagents Enable the subagent tool (delegate tasks to isolated agent loops).\n On by default (the \"enableSubagent\" setting defaults to true)\n --no-subagents Disable the subagent tool for this session (overrides the setting)\n --warm-subagents Dispatch eligible subagents on reused warm RPC workers (experimental)\n --max-subagent-depth <n> Tree-wide subagent nesting cap (default 2 = one level of nesting;\n 1 = no nesting). Overrides the \"maxSubagentDepth\" setting\n Can also be enabled via the \"enableSubagent\" setting\n --enable-todowrite Enable the TodoWrite tool (maintain a live todo list in the task panel)\n Can also be enabled via the \"enableTodoWrite\" setting\n --enable-webtools Enable the webfetch + websearch tools (network access, off by default)\n Can also be enabled via the \"enableWebTools\" setting\n Block hosts with a .webtoolsignore file (gitignore syntax)\n --enable-browsertools Enable the browser_run + browser_continue tools (off by default)\n Deterministic browser automation via the browsertools engine,\n pausing for LLM decisions (NeedsParent) mid-flow\n Can also be enabled via the \"enableBrowserTools\" setting\n --enable-browser-live-preview Default the live viewer on for browser_run runs and auto-open it\n Streams the page + the agent's tool-call log over a local WebSocket\n Set HOOCODE_BROWSERTOOLS_NO_OPEN=1 to print the URL without opening\n Can also be enabled via the \"enableBrowserLivePreview\" setting\n --enable-filetools Enable the document tools (off by default)\n DocRead/DocEdit/DocWrite (extract + lossless id-based edit) and\n DocScan/DocGrep/DocPeek (cheap outline/search/partial read) for\n XML, drawio, docx/xlsx/pptx, PDF via the filetools binary\n Can also be enabled via the \"enableFileTools\" setting\n --enable-plugintools Enable the autonomous plugin system (off by default)\n Plugin lifecycle tools (SearchPlugins, InstallPlugin, ...) and\n ProposePlugin, plus the runtime plugin-reuse nudge\n Can also be enabled via the \"enablePluginTools\" setting\n --light Minimal low-token preset for small/local models:\n only the read/write/edit/bash tools (short descriptions,\n stripped schemas; search via bash), a terse system prompt, and\n no subagents/TodoWrite/skills/context files/mode appendix\n Can also be enabled via the \"light\" setting\n --print-token-surface Print the fixed per-turn surface (system prompt + serialized\n tool schema token estimate) and exit\n --support-platform <list> Platform layout(s) hoocode targets when it writes artifacts:\n authored plugins (ProposePlugin) and the /new-skill /new-agent\n /new-command scaffolds. Comma-separated and/or repeated.\n Tokens: claude, copilot (alias: github, gh), agents (alias: native)\n e.g. --support-platform copilot writes .github/skills/<name>/SKILL.md,\n .github/agents/<name>.agent.md, .github/prompts/<name>.prompt.md and\n a .github/plugin/plugin.json manifest for authored plugins\n Default: claude + copilot for authored plugins; .hoocode/ for scaffolds\n Can also be set via the \"supportPlatform\" setting\n --thinking <level> Set thinking level: off, minimal, low, medium, high, xhigh\n --extension, -e <path> Load an extension file (can be used multiple times)\n --no-extensions, -ne Disable extension discovery (explicit -e paths still work)\n --skill <path> Load a skill file or directory (can be used multiple times)\n --no-skills, -ns Disable skills discovery and loading\n --agent <path> Load an agent file or directory (can be used multiple times)\n --prompt-template <path> Load a prompt template / slash command file or directory (repeatable)\n --slash-command <path> Alias of --prompt-template (prompts and slash commands are one feature)\n --no-prompt-templates, -np Disable prompt template / slash command discovery (same as --no-slash-commands)\n --no-slash-commands, -nsc Disable prompt template / slash command discovery (same as --no-prompt-templates)\n --theme <path> Load a theme file or directory (can be used multiple times)\n --no-themes Disable theme discovery and loading\n --mode-path <dir> Add a directory to search for {name}/system.md mode files (can be used multiple times)\n --no-context-files, -nc Disable AGENTS.md and CLAUDE.md discovery and loading\n --export <file> Export session file to HTML and exit\n --list-models [search] List available models (with optional fuzzy search)\n --verbose Force verbose startup (overrides quietStartup setting)\n --offline Disable startup network operations (same as HOOCODE_OFFLINE=1)\n --ca-cert <path> Trust an extra PEM CA bundle for hoocode's own TLS traffic (provider\n calls, GitHub API, downloads). Additive to the bundled roots;\n verification stays ON. Also: HOOCODE_CA_CERT / NODE_EXTRA_CA_CERTS.\n Does not affect the webfetch/websearch binary.\n --use-system-ca Also trust the OS/system CA store (opt-in). Same as\n HOOCODE_USE_SYSTEM_CA=1\n --help, -h Show this help\n --version, -v Show version number\n\nExtensions can register additional flags (e.g., --plan from plan-mode extension).${extensionFlagsText}\n\n${chalk.bold(\"Examples:\")}\n # Interactive mode\n ${APP_NAME}\n\n # Interactive mode with initial prompt\n ${APP_NAME} \"List all .ts files in src/\"\n\n # Include files in initial message\n ${APP_NAME} @prompt.md @image.png \"What color is the sky?\"\n\n # Non-interactive mode (process and exit)\n ${APP_NAME} -p \"List all .ts files in src/\"\n\n # Multiple messages (interactive)\n ${APP_NAME} \"Read package.json\" \"What dependencies do we have?\"\n\n # Continue previous session\n ${APP_NAME} --continue \"What did we discuss?\"\n\n # Use different model\n ${APP_NAME} --provider openai --model gpt-4o-mini \"Help me refactor this code\"\n\n # Use model with provider prefix (no --provider needed)\n ${APP_NAME} --model openai/gpt-4o \"Help me refactor this code\"\n\n # Use model with thinking level shorthand\n ${APP_NAME} --model sonnet:high \"Solve this complex problem\"\n\n # Limit model cycling to specific models\n ${APP_NAME} --models claude-sonnet,claude-haiku,gpt-4o\n\n # Limit to a specific provider with glob pattern\n ${APP_NAME} --models \"github-copilot/*\"\n\n # Cycle models with fixed thinking levels\n ${APP_NAME} --models sonnet:high,haiku:low\n\n # Start with a specific thinking level\n ${APP_NAME} --thinking high \"Solve this complex problem\"\n\n # Read-only mode (no file modifications possible)\n ${APP_NAME} --tools read,grep,find,ls -p \"Review the code in src/\"\n\n # Export a session file to HTML\n ${APP_NAME} --export ~/${CONFIG_DIR_NAME}/agent/sessions/--path--/session.jsonl\n ${APP_NAME} --export session.jsonl output.html\n\n${chalk.bold(\"Environment Variables:\")}\n ANTHROPIC_API_KEY - Anthropic Claude API key\n ANTHROPIC_OAUTH_TOKEN - Anthropic OAuth token (alternative to API key)\n OPENAI_API_KEY - OpenAI GPT API key\n AZURE_OPENAI_API_KEY - Azure OpenAI API key\n AZURE_OPENAI_BASE_URL - Azure OpenAI/Cognitive Services base URL (e.g. https://{resource}.openai.azure.com)\n AZURE_OPENAI_RESOURCE_NAME - Azure OpenAI resource name (alternative to base URL)\n AZURE_OPENAI_API_VERSION - Azure OpenAI API version (default: v1)\n AZURE_OPENAI_DEPLOYMENT_NAME_MAP - Azure OpenAI model=deployment map (comma-separated)\n DEEPSEEK_API_KEY - DeepSeek API key\n GEMINI_API_KEY - Google Gemini API key\n GROQ_API_KEY - Groq API key\n CEREBRAS_API_KEY - Cerebras API key\n XAI_API_KEY - xAI Grok API key\n FIREWORKS_API_KEY - Fireworks API key\n TOGETHER_API_KEY - Together AI API key\n OPENROUTER_API_KEY - OpenRouter API key\n AI_GATEWAY_API_KEY - Vercel AI Gateway API key\n ZAI_API_KEY - ZAI API key\n MISTRAL_API_KEY - Mistral API key\n MINIMAX_API_KEY - MiniMax API key\n MOONSHOT_API_KEY - Moonshot AI API key\n OPENCODE_API_KEY - OpenCode Zen/OpenCode Go API key\n KIMI_API_KEY - Kimi For Coding API key\n CLOUDFLARE_API_KEY - Cloudflare API token (Workers AI and AI Gateway)\n CLOUDFLARE_ACCOUNT_ID - Cloudflare account id (required for both)\n CLOUDFLARE_GATEWAY_ID - Cloudflare AI Gateway slug (required for AI Gateway)\n XIAOMI_API_KEY - Xiaomi MiMo API key (api.xiaomimimo.com billing)\n XIAOMI_TOKEN_PLAN_CN_API_KEY - Xiaomi MiMo Token Plan API key (China region)\n XIAOMI_TOKEN_PLAN_AMS_API_KEY - Xiaomi MiMo Token Plan API key (Amsterdam region)\n XIAOMI_TOKEN_PLAN_SGP_API_KEY - Xiaomi MiMo Token Plan API key (Singapore region)\n NVIDIA_API_KEY - NVIDIA API key (integrate.api.nvidia.com)\n AWS_PROFILE - AWS profile for Amazon Bedrock\n AWS_ACCESS_KEY_ID - AWS access key for Amazon Bedrock\n AWS_SECRET_ACCESS_KEY - AWS secret key for Amazon Bedrock\n AWS_BEARER_TOKEN_BEDROCK - Bedrock API key (bearer token)\n AWS_REGION - AWS region for Amazon Bedrock (e.g., us-east-1)\n ${ENV_AGENT_DIR.padEnd(32)} - Config directory (default: ~/${CONFIG_DIR_NAME}/agent)\n ${ENV_SESSION_DIR.padEnd(32)} - Session storage directory (overridden by --session-dir)\n HOOCODE_PACKAGE_DIR - Override package directory (for Nix/Guix store paths).\n HOOCODE_OFFLINE - Disable startup network operations when set to 1/true/yes.\n HOOCODE_NATIVE_SEARCH - Force the pure-JS find/grep fallback instead of the fd/rg binaries\n when set to 1 (also used automatically when fd/rg are unavailable).\n HOOCODE_CA_CERT - Path to an extra PEM CA bundle to trust for hoocode's own TLS traffic\n (additive; verification stays on). Precedence: --ca-cert > this > NODE_EXTRA_CA_CERTS\n HOOCODE_USE_SYSTEM_CA - Also trust the OS/system CA store when set to 1/true/yes (same as --use-system-ca)\n NODE_EXTRA_CA_CERTS - Standard Node path to an extra PEM CA bundle (used as the lowest-precedence CA source)\n HOOCODE_WEBTOOLS_CA_CERT - Path to a PEM CA bundle forwarded to the webtools binary (webfetch/websearch) as --ca-cert\n HOOCODE_WEBTOOLS_INSECURE - Forward --insecure to the webtools binary (disables its TLS verification) when set to 1/true/yes\n HOOCODE_TELEMETRY - Override install telemetry when set to 1/true/yes or 0/false/no.\n HOOCODE_SHARE_VIEWER_URL - Base URL for /share command (default: https://pi.dev/session/).\n\n${chalk.bold(\"Built-in Tool Names:\")}\n read - Read file contents\n bash - Execute bash commands\n edit - Edit files with find/replace\n write - Write files (creates/overwrites)\n grep - Search file contents (read-only, off by default)\n find - Find files by glob pattern (read-only, off by default)\n ls - List directory contents (read-only, off by default)\n`);\n}\n"]}
package/dist/cli/args.js CHANGED
@@ -478,6 +478,8 @@ ${chalk.bold("Environment Variables:")}
478
478
  ${ENV_SESSION_DIR.padEnd(32)} - Session storage directory (overridden by --session-dir)
479
479
  HOOCODE_PACKAGE_DIR - Override package directory (for Nix/Guix store paths).
480
480
  HOOCODE_OFFLINE - Disable startup network operations when set to 1/true/yes.
481
+ HOOCODE_NATIVE_SEARCH - Force the pure-JS find/grep fallback instead of the fd/rg binaries
482
+ when set to 1 (also used automatically when fd/rg are unavailable).
481
483
  HOOCODE_CA_CERT - Path to an extra PEM CA bundle to trust for hoocode's own TLS traffic
482
484
  (additive; verification stays on). Precedence: --ca-cert > this > NODE_EXTRA_CA_CERTS
483
485
  HOOCODE_USE_SYSTEM_CA - Also trust the OS/system CA store when set to 1/true/yes (same as --use-system-ca)
@@ -1 +1 @@
1
- {"version":3,"file":"args.js","sourceRoot":"","sources":["../../src/cli/args.ts"],"names":[],"mappings":"AAAA;;GAEG;AAGH,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,EAAE,QAAQ,EAAE,eAAe,EAAE,aAAa,EAAE,eAAe,EAAE,MAAM,cAAc,CAAC;AA0FzF,MAAM,qBAAqB,GAAG,CAAC,KAAK,EAAE,SAAS,EAAE,KAAK,EAAE,QAAQ,EAAE,MAAM,EAAE,OAAO,CAAU,CAAC;AAE5F,MAAM,UAAU,oBAAoB,CAAC,KAAa,EAA0B;IAC3E,OAAO,qBAAqB,CAAC,QAAQ,CAAC,KAAsB,CAAC,CAAC;AAAA,CAC9D;AAED,MAAM,UAAU,SAAS,CAAC,IAAc,EAAQ;IAC/C,MAAM,MAAM,GAAS;QACpB,QAAQ,EAAE,EAAE;QACZ,QAAQ,EAAE,EAAE;QACZ,YAAY,EAAE,IAAI,GAAG,EAAE;QACvB,WAAW,EAAE,EAAE;KACf,CAAC;IAEF,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,IAAI,CAAC,MAAM,EAAE,CAAC,EAAE,EAAE,CAAC;QACtC,MAAM,GAAG,GAAG,IAAI,CAAC,CAAC,CAAC,CAAC;QAEpB,IAAI,GAAG,KAAK,QAAQ,IAAI,GAAG,KAAK,IAAI,EAAE,CAAC;YACtC,MAAM,CAAC,IA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,QAAQ;;;IAGR,QAAQ,eAAe,eAAe;IACtC,QAAQ;;EAEV,KAAK,CAAC,IAAI,CAAC,wBAAwB,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;IAqClC,aAAa,CAAC,MAAM,CAAC,EAAE,CAAC,mCAAmC,eAAe;IAC1E,eAAe,CAAC,MAAM,CAAC,EAAE,CAAC;;;;;;;;;;;;EAY5B,KAAK,CAAC,IAAI,CAAC,sBAAsB,CAAC;;;;;;;;CAQnC,CAAC,CAAC;AAAA,CACF","sourcesContent":["/**\n * CLI argument parsing and help display\n */\n\nimport type { ThinkingLevel } from \"@kolisachint/hoocode-agent-core\";\nimport chalk from \"chalk\";\nimport { APP_NAME, CONFIG_DIR_NAME, ENV_AGENT_DIR, ENV_SESSION_DIR } from \"../config.js\";\nimport type { ExtensionFlag } from \"../core/extensions/types.js\";\n\nexport type Mode = \"text\" | \"json\" | \"rpc\";\n\nexport interface Args {\n\tprovider?: string;\n\tmodel?: string;\n\tapiKey?: string;\n\tsystemPrompt?: string;\n\tthinking?: ThinkingLevel;\n\tcontinue?: boolean;\n\tresume?: boolean;\n\thelp?: boolean;\n\tversion?: boolean;\n\tmode?: Mode;\n\tnoSession?: boolean;\n\t/** Internal: task id assigned by SubagentPool when this process is a spawned subagent. */\n\ttaskId?: string;\n\t/** Hard cap on assistant turns. Near the cap the agent is asked to wrap up; at the cap it is stopped. */\n\tmaxTurns?: number;\n\tsession?: string;\n\t/** Base URL of a hooteams server to bridge into the task panel's teams view, or \"auto\" to discover a config and spawn one locally. */\n\tteam?: string;\n\tfork?: string;\n\tsessionDir?: string;\n\tmodels?: string[];\n\ttools?: string[];\n\tdisallowedTools?: string[];\n\tnoTools?: boolean;\n\tnoBuiltinTools?: boolean;\n\t/** Tri-state override of the `enableSubagent` setting (default true): --enable-subagents → true, --no-subagents → false, unset → setting. */\n\tsubagent?: boolean;\n\t/** Dispatch eligible subagents on reused warm RPC workers (overrides the warmSubagents setting). */\n\twarmSubagents?: boolean;\n\t/** Tree-wide subagent nesting cap (overrides the maxSubagentDepth setting). */\n\tmaxSubagentDepth?: number;\n\t/** Internal: restricts which subagent types this process may delegate to. */\n\tdelegateAllow?: string[];\n\ttodoWrite?: boolean;\n\t/** Enable the webfetch + websearch tools (off by default). */\n\tenableWebTools?: boolean;\n\t/** Enable the browser_run + browser_continue tools (browsertools engine, off by default). */\n\tenableBrowserTools?: boolean;\n\t/** Default the streamed live viewer on for browser_run runs and auto-open it (off by default). */\n\tenableBrowserLivePreview?: boolean;\n\t/** Enable the document tools — DocRead/DocEdit/DocWrite + DocScan/DocGrep/DocPeek (off by default). */\n\tenableFileTools?: boolean;\n\t/** Enable the autonomous plugin system — plugin lifecycle tools (SearchPlugins, InstallPlugin, ...) and ProposePlugin (off by default). */\n\tenablePluginTools?: boolean;\n\t/** Minimal low-token preset for small/local models: read/write/edit/bash only, terse prompt, no subagents/todo/skills/context files/mode appendix. */\n\tlight?: boolean;\n\t/** Print the fixed per-turn surface (system prompt + serialized tool schema token estimate) and exit. */\n\tprintTokenSurface?: boolean;\n\t/**\n\t * Platform layout(s) hoocode targets when it WRITES artifacts (authored\n\t * plugins, /new-skill //new-agent //new-command scaffolds). Raw tokens as\n\t * given (comma-separated and/or repeated); normalized downstream:\n\t * agents|native, claude, github|copilot|gh.\n\t */\n\tsupportPlatform?: string[];\n\t/** Path to an explicit PEM CA bundle to trust additively for hoocode's own TLS traffic. */\n\tcaCert?: string;\n\t/** Trust the OS/system CA store additively (opt-in) for hoocode's own TLS traffic. */\n\tuseSystemCa?: boolean;\n\textensions?: string[];\n\tnoExtensions?: boolean;\n\tprint?: boolean;\n\texport?: string;\n\tnoSkills?: boolean;\n\tskills?: string[];\n\tagents?: string[];\n\tpromptTemplates?: string[];\n\tnoPromptTemplates?: boolean;\n\tslashCommands?: string[];\n\tnoSlashCommands?: boolean;\n\tthemes?: string[];\n\tnoThemes?: boolean;\n\tmodePaths?: string[];\n\tnoContextFiles?: boolean;\n\tlistModels?: string | true;\n\toffline?: boolean;\n\tverbose?: boolean;\n\tmessages: string[];\n\tfileArgs: string[];\n\t/** Unknown flags (potentially extension flags) - map of flag name to value */\n\tunknownFlags: Map<string, boolean | string>;\n\tdiagnostics: Array<{ type: \"warning\" | \"error\"; message: string }>;\n}\n\nconst VALID_THINKING_LEVELS = [\"off\", \"minimal\", \"low\", \"medium\", \"high\", \"xhigh\"] as const;\n\nexport function isValidThinkingLevel(level: string): level is ThinkingLevel {\n\treturn VALID_THINKING_LEVELS.includes(level as ThinkingLevel);\n}\n\nexport function parseArgs(args: string[]): Args {\n\tconst result: Args = {\n\t\tmessages: [],\n\t\tfileArgs: [],\n\t\tunknownFlags: new Map(),\n\t\tdiagnostics: [],\n\t};\n\n\tfor (let i = 0; i < args.length; i++) {\n\t\tconst arg = args[i];\n\n\t\tif (arg === \"--help\" || arg === \"-h\") {\n\t\t\tresult.help = true;\n\t\t} else if (arg === \"--version\" || arg === \"-v\") {\n\t\t\tresult.version = true;\n\t\t} else if (arg === \"--mode\" && i + 1 < args.length) {\n\t\t\tconst mode = args[++i];\n\t\t\tif (mode === \"text\" || mode === \"json\" || mode === \"rpc\") {\n\t\t\t\tresult.mode = mode;\n\t\t\t}\n\t\t} else if (arg === \"--continue\" || arg === \"-c\") {\n\t\t\tresult.continue = true;\n\t\t} else if (arg === \"--resume\" || arg === \"-r\") {\n\t\t\tresult.resume = true;\n\t\t} else if (arg === \"--provider\" && i + 1 < args.length) {\n\t\t\tresult.provider = args[++i];\n\t\t} else if (arg === \"--model\" && i + 1 < args.length) {\n\t\t\tresult.model = args[++i];\n\t\t} else if (arg === \"--api-key\" && i + 1 < args.length) {\n\t\t\tresult.apiKey = args[++i];\n\t\t} else if (arg === \"--system-prompt\" && i + 1 < args.length) {\n\t\t\tresult.systemPrompt = args[++i];\n\t\t} else if (arg === \"--no-session\") {\n\t\t\tresult.noSession = true;\n\t\t} else if (arg === \"--task-id\" && i + 1 < args.length) {\n\t\t\tresult.taskId = args[++i];\n\t\t} else if (arg === \"--max-turns\" && i + 1 < args.length) {\n\t\t\tconst n = Number.parseInt(args[++i], 10);\n\t\t\tif (Number.isInteger(n) && n > 0) {\n\t\t\t\tresult.maxTurns = n;\n\t\t\t}\n\t\t} else if (arg === \"--session\" && i + 1 < args.length) {\n\t\t\tresult.session = args[++i];\n\t\t} else if (arg === \"--team\" && i + 1 < args.length) {\n\t\t\tresult.team = args[++i];\n\t\t} else if (arg === \"--fork\" && i + 1 < args.length) {\n\t\t\tresult.fork = args[++i];\n\t\t} else if (arg === \"--session-dir\" && i + 1 < args.length) {\n\t\t\tresult.sessionDir = args[++i];\n\t\t} else if (arg === \"--models\" && i + 1 < args.length) {\n\t\t\tresult.models = args[++i].split(\",\").map((s) => s.trim());\n\t\t} else if (arg === \"--no-tools\" || arg === \"-nt\") {\n\t\t\tresult.noTools = true;\n\t\t} else if (arg === \"--no-builtin-tools\" || arg === \"-nbt\") {\n\t\t\tresult.noBuiltinTools = true;\n\t\t} else if (arg === \"--enable-subagents\") {\n\t\t\tresult.subagent = true;\n\t\t} else if (arg === \"--no-subagents\" || arg === \"--disable-subagents\") {\n\t\t\tresult.subagent = false;\n\t\t} else if (arg === \"--warm-subagents\") {\n\t\t\tresult.warmSubagents = true;\n\t\t} else if (arg === \"--max-subagent-depth\" && i + 1 < args.length) {\n\t\t\tconst n = Number.parseInt(args[++i], 10);\n\t\t\tif (Number.isInteger(n) && n >= 1) {\n\t\t\t\tresult.maxSubagentDepth = n;\n\t\t\t}\n\t\t} else if (arg === \"--delegate-allow\" && i + 1 < args.length) {\n\t\t\tresult.delegateAllow = args[++i]\n\t\t\t\t.split(\",\")\n\t\t\t\t.map((s) => s.trim())\n\t\t\t\t.filter((name) => name.length > 0);\n\t\t} else if (arg === \"--enable-todowrite\") {\n\t\t\tresult.todoWrite = true;\n\t\t} else if (arg === \"--enable-webtools\") {\n\t\t\tresult.enableWebTools = true;\n\t\t} else if (arg === \"--enable-browsertools\") {\n\t\t\tresult.enableBrowserTools = true;\n\t\t} else if (arg === \"--enable-browser-live-preview\") {\n\t\t\tresult.enableBrowserLivePreview = true;\n\t\t} else if (arg === \"--enable-filetools\") {\n\t\t\tresult.enableFileTools = true;\n\t\t} else if (arg === \"--enable-plugintools\") {\n\t\t\tresult.enablePluginTools = true;\n\t\t} else if (arg === \"--light\") {\n\t\t\tresult.light = true;\n\t\t} else if (arg === \"--print-token-surface\") {\n\t\t\tresult.printTokenSurface = true;\n\t\t} else if (arg === \"--support-platform\" && i + 1 < args.length) {\n\t\t\tresult.supportPlatform = [\n\t\t\t\t...(result.supportPlatform ?? []),\n\t\t\t\t...args[++i]\n\t\t\t\t\t.split(\",\")\n\t\t\t\t\t.map((s) => s.trim())\n\t\t\t\t\t.filter(Boolean),\n\t\t\t];\n\t\t} else if (arg === \"--ca-cert\" && i + 1 < args.length) {\n\t\t\tresult.caCert = args[++i];\n\t\t} else if (arg === \"--use-system-ca\") {\n\t\t\tresult.useSystemCa = true;\n\t\t} else if ((arg === \"--tools\" || arg === \"-t\") && i + 1 < args.length) {\n\t\t\tresult.tools = args[++i]\n\t\t\t\t.split(\",\")\n\t\t\t\t.map((s) => s.trim())\n\t\t\t\t.filter((name) => name.length > 0);\n\t\t} else if (arg === \"--disallowed-tools\" && i + 1 < args.length) {\n\t\t\tresult.disallowedTools = args[++i]\n\t\t\t\t.split(\",\")\n\t\t\t\t.map((s) => s.trim())\n\t\t\t\t.filter((name) => name.length > 0);\n\t\t} else if (arg === \"--thinking\" && i + 1 < args.length) {\n\t\t\tconst level = args[++i];\n\t\t\tif (isValidThinkingLevel(level)) {\n\t\t\t\tresult.thinking = level;\n\t\t\t} else {\n\t\t\t\tresult.diagnostics.push({\n\t\t\t\t\ttype: \"warning\",\n\t\t\t\t\tmessage: `Invalid thinking level \"${level}\". Valid values: ${VALID_THINKING_LEVELS.join(\", \")}`,\n\t\t\t\t});\n\t\t\t}\n\t\t} else if (arg === \"--print\" || arg === \"-p\") {\n\t\t\tresult.print = true;\n\t\t\tconst next = args[i + 1];\n\t\t\tif (next !== undefined && !next.startsWith(\"@\") && (!next.startsWith(\"-\") || next.startsWith(\"---\"))) {\n\t\t\t\tresult.messages.push(next);\n\t\t\t\ti++;\n\t\t\t}\n\t\t} else if (arg === \"--export\" && i + 1 < args.length) {\n\t\t\tresult.export = args[++i];\n\t\t} else if ((arg === \"--extension\" || arg === \"-e\") && i + 1 < args.length) {\n\t\t\tresult.extensions = result.extensions ?? [];\n\t\t\tresult.extensions.push(args[++i]);\n\t\t} else if (arg === \"--no-extensions\" || arg === \"-ne\") {\n\t\t\tresult.noExtensions = true;\n\t\t} else if (arg === \"--skill\" && i + 1 < args.length) {\n\t\t\tresult.skills = result.skills ?? [];\n\t\t\tresult.skills.push(args[++i]);\n\t\t} else if (arg === \"--agent\" && i + 1 < args.length) {\n\t\t\tresult.agents = result.agents ?? [];\n\t\t\tresult.agents.push(args[++i]);\n\t\t} else if (arg === \"--prompt-template\" && i + 1 < args.length) {\n\t\t\tresult.promptTemplates = result.promptTemplates ?? [];\n\t\t\tresult.promptTemplates.push(args[++i]);\n\t\t} else if (arg === \"--slash-command\" && i + 1 < args.length) {\n\t\t\tresult.slashCommands = result.slashCommands ?? [];\n\t\t\tresult.slashCommands.push(args[++i]);\n\t\t} else if (arg === \"--theme\" && i + 1 < args.length) {\n\t\t\tresult.themes = result.themes ?? [];\n\t\t\tresult.themes.push(args[++i]);\n\t\t} else if (arg === \"--mode-path\" && i + 1 < args.length) {\n\t\t\tresult.modePaths = result.modePaths ?? [];\n\t\t\tresult.modePaths.push(args[++i]);\n\t\t} else if (arg === \"--no-skills\" || arg === \"-ns\") {\n\t\t\tresult.noSkills = true;\n\t\t} else if (arg === \"--no-prompt-templates\" || arg === \"-np\") {\n\t\t\tresult.noPromptTemplates = true;\n\t\t} else if (arg === \"--no-slash-commands\" || arg === \"-nsc\") {\n\t\t\tresult.noSlashCommands = true;\n\t\t} else if (arg === \"--no-themes\") {\n\t\t\tresult.noThemes = true;\n\t\t} else if (arg === \"--no-context-files\" || arg === \"-nc\") {\n\t\t\tresult.noContextFiles = true;\n\t\t} else if (arg === \"--list-models\") {\n\t\t\t// Check if next arg is a search pattern (not a flag or file arg)\n\t\t\tif (i + 1 < args.length && !args[i + 1].startsWith(\"-\") && !args[i + 1].startsWith(\"@\")) {\n\t\t\t\tresult.listModels = args[++i];\n\t\t\t} else {\n\t\t\t\tresult.listModels = true;\n\t\t\t}\n\t\t} else if (arg === \"--verbose\") {\n\t\t\tresult.verbose = true;\n\t\t} else if (arg === \"--offline\") {\n\t\t\tresult.offline = true;\n\t\t} else if (arg.startsWith(\"@\")) {\n\t\t\tresult.fileArgs.push(arg.slice(1)); // Remove @ prefix\n\t\t} else if (arg.startsWith(\"--\")) {\n\t\t\tconst eqIndex = arg.indexOf(\"=\");\n\t\t\tif (eqIndex !== -1) {\n\t\t\t\tresult.unknownFlags.set(arg.slice(2, eqIndex), arg.slice(eqIndex + 1));\n\t\t\t} else {\n\t\t\t\tconst flagName = arg.slice(2);\n\t\t\t\tconst next = args[i + 1];\n\t\t\t\tif (next !== undefined && !next.startsWith(\"-\") && !next.startsWith(\"@\")) {\n\t\t\t\t\tresult.unknownFlags.set(flagName, next);\n\t\t\t\t\ti++;\n\t\t\t\t} else {\n\t\t\t\t\tresult.unknownFlags.set(flagName, true);\n\t\t\t\t}\n\t\t\t}\n\t\t} else if (arg.startsWith(\"-\") && !arg.startsWith(\"--\")) {\n\t\t\tresult.diagnostics.push({ type: \"error\", message: `Unknown option: ${arg}` });\n\t\t} else if (!arg.startsWith(\"-\")) {\n\t\t\tresult.messages.push(arg);\n\t\t}\n\t}\n\n\treturn result;\n}\n\nexport function printHelp(extensionFlags?: ExtensionFlag[]): void {\n\tconst extensionFlagsText =\n\t\textensionFlags && extensionFlags.length > 0\n\t\t\t? `\\n${chalk.bold(\"Extension CLI Flags:\")}\\n${extensionFlags\n\t\t\t\t\t.map((flag) => {\n\t\t\t\t\t\tconst value = flag.type === \"string\" ? \" <value>\" : \"\";\n\t\t\t\t\t\tconst description = flag.description ?? `Registered by ${flag.extensionPath}`;\n\t\t\t\t\t\treturn ` --${flag.name}${value}`.padEnd(30) + description;\n\t\t\t\t\t})\n\t\t\t\t\t.join(\"\\n\")}\\n`\n\t\t\t: \"\";\n\tconsole.log(`${chalk.bold(APP_NAME)} - AI coding assistant with read, bash, edit, write tools\n\n${chalk.bold(\"Usage:\")}\n ${APP_NAME} [options] [@files...] [messages...]\n\n${chalk.bold(\"Commands:\")}\n ${APP_NAME} install <source> [-l] Install extension source and add to settings\n ${APP_NAME} remove <source> [-l] Remove extension source from settings\n ${APP_NAME} uninstall <source> [-l] Alias for remove\n ${APP_NAME} update [source|self|pi] Update hoocode and installed extensions\n ${APP_NAME} list List installed extensions from settings\n ${APP_NAME} config Open TUI to enable/disable package resources\n ${APP_NAME} resources List discovered skills, subagents, slash commands, and MCP servers\n ${APP_NAME} <command> --help Show help for install/remove/uninstall/update/list\n\n${chalk.bold(\"Options:\")}\n --provider <name> Provider name (default: google)\n --model <pattern> Model pattern or ID (supports \"provider/id\" and optional \":<thinking>\")\n --api-key <key> API key (defaults to env vars)\n --system-prompt <text> System prompt (default: coding assistant prompt)\n --mode <mode> Output mode: text (default), json, or rpc\n --print, -p Non-interactive mode: process prompt and exit\n --continue, -c Continue previous session\n --resume, -r Select a session to resume\n --session <path|id> Use specific session file or partial UUID\n --fork <path|id> Fork specific session file or partial UUID into a new session\n --session-dir <dir> Directory for session storage and lookup\n --no-session Don't save session (ephemeral)\n --team <url|auto> Bridge a hooteams server into the task panel's teams view\n (focus roles, nudge, attach, answer approval gates);\n \"auto\" finds .agents/teams/default.json\n or hooteams.config.json upward from cwd and spawns hooteams locally\n --models <patterns> Comma-separated model patterns for Ctrl+P cycling\n Supports globs (anthropic/*, *sonnet*) and fuzzy matching\n --no-tools, -nt Disable all tools by default (built-in and extension)\n --no-builtin-tools, -nbt Disable built-in tools by default but keep extension/custom tools enabled\n --tools, -t <tools> Comma-separated allowlist of tool names to enable\n Applies to built-in, extension, and custom tools\n --disallowed-tools <tools> Comma-separated denylist of tool names to disable\n (subtracted from the allowlist or default set)\n --max-turns <n> Hard cap on assistant turns; the agent is asked to wrap up near the\n cap and stopped at it (mainly used for spawned subagents)\n --enable-subagents Enable the subagent tool (delegate tasks to isolated agent loops).\n On by default (the \"enableSubagent\" setting defaults to true)\n --no-subagents Disable the subagent tool for this session (overrides the setting)\n --warm-subagents Dispatch eligible subagents on reused warm RPC workers (experimental)\n --max-subagent-depth <n> Tree-wide subagent nesting cap (default 2 = one level of nesting;\n 1 = no nesting). Overrides the \"maxSubagentDepth\" setting\n Can also be enabled via the \"enableSubagent\" setting\n --enable-todowrite Enable the TodoWrite tool (maintain a live todo list in the task panel)\n Can also be enabled via the \"enableTodoWrite\" setting\n --enable-webtools Enable the webfetch + websearch tools (network access, off by default)\n Can also be enabled via the \"enableWebTools\" setting\n Block hosts with a .webtoolsignore file (gitignore syntax)\n --enable-browsertools Enable the browser_run + browser_continue tools (off by default)\n Deterministic browser automation via the browsertools engine,\n pausing for LLM decisions (NeedsParent) mid-flow\n Can also be enabled via the \"enableBrowserTools\" setting\n --enable-browser-live-preview Default the live viewer on for browser_run runs and auto-open it\n Streams the page + the agent's tool-call log over a local WebSocket\n Set HOOCODE_BROWSERTOOLS_NO_OPEN=1 to print the URL without opening\n Can also be enabled via the \"enableBrowserLivePreview\" setting\n --enable-filetools Enable the document tools (off by default)\n DocRead/DocEdit/DocWrite (extract + lossless id-based edit) and\n DocScan/DocGrep/DocPeek (cheap outline/search/partial read) for\n XML, drawio, docx/xlsx/pptx, PDF via the filetools binary\n Can also be enabled via the \"enableFileTools\" setting\n --enable-plugintools Enable the autonomous plugin system (off by default)\n Plugin lifecycle tools (SearchPlugins, InstallPlugin, ...) and\n ProposePlugin, plus the runtime plugin-reuse nudge\n Can also be enabled via the \"enablePluginTools\" setting\n --light Minimal low-token preset for small/local models:\n only the read/write/edit/bash tools (short descriptions,\n stripped schemas; search via bash), a terse system prompt, and\n no subagents/TodoWrite/skills/context files/mode appendix\n Can also be enabled via the \"light\" setting\n --print-token-surface Print the fixed per-turn surface (system prompt + serialized\n tool schema token estimate) and exit\n --support-platform <list> Platform layout(s) hoocode targets when it writes artifacts:\n authored plugins (ProposePlugin) and the /new-skill /new-agent\n /new-command scaffolds. Comma-separated and/or repeated.\n Tokens: claude, copilot (alias: github, gh), agents (alias: native)\n e.g. --support-platform copilot writes .github/skills/<name>/SKILL.md,\n .github/agents/<name>.agent.md, .github/prompts/<name>.prompt.md and\n a .github/plugin/plugin.json manifest for authored plugins\n Default: claude + copilot for authored plugins; .hoocode/ for scaffolds\n Can also be set via the \"supportPlatform\" setting\n --thinking <level> Set thinking level: off, minimal, low, medium, high, xhigh\n --extension, -e <path> Load an extension file (can be used multiple times)\n --no-extensions, -ne Disable extension discovery (explicit -e paths still work)\n --skill <path> Load a skill file or directory (can be used multiple times)\n --no-skills, -ns Disable skills discovery and loading\n --agent <path> Load an agent file or directory (can be used multiple times)\n --prompt-template <path> Load a prompt template / slash command file or directory (repeatable)\n --slash-command <path> Alias of --prompt-template (prompts and slash commands are one feature)\n --no-prompt-templates, -np Disable prompt template / slash command discovery (same as --no-slash-commands)\n --no-slash-commands, -nsc Disable prompt template / slash command discovery (same as --no-prompt-templates)\n --theme <path> Load a theme file or directory (can be used multiple times)\n --no-themes Disable theme discovery and loading\n --mode-path <dir> Add a directory to search for {name}/system.md mode files (can be used multiple times)\n --no-context-files, -nc Disable AGENTS.md and CLAUDE.md discovery and loading\n --export <file> Export session file to HTML and exit\n --list-models [search] List available models (with optional fuzzy search)\n --verbose Force verbose startup (overrides quietStartup setting)\n --offline Disable startup network operations (same as HOOCODE_OFFLINE=1)\n --ca-cert <path> Trust an extra PEM CA bundle for hoocode's own TLS traffic (provider\n calls, GitHub API, downloads). Additive to the bundled roots;\n verification stays ON. Also: HOOCODE_CA_CERT / NODE_EXTRA_CA_CERTS.\n Does not affect the webfetch/websearch binary.\n --use-system-ca Also trust the OS/system CA store (opt-in). Same as\n HOOCODE_USE_SYSTEM_CA=1\n --help, -h Show this help\n --version, -v Show version number\n\nExtensions can register additional flags (e.g., --plan from plan-mode extension).${extensionFlagsText}\n\n${chalk.bold(\"Examples:\")}\n # Interactive mode\n ${APP_NAME}\n\n # Interactive mode with initial prompt\n ${APP_NAME} \"List all .ts files in src/\"\n\n # Include files in initial message\n ${APP_NAME} @prompt.md @image.png \"What color is the sky?\"\n\n # Non-interactive mode (process and exit)\n ${APP_NAME} -p \"List all .ts files in src/\"\n\n # Multiple messages (interactive)\n ${APP_NAME} \"Read package.json\" \"What dependencies do we have?\"\n\n # Continue previous session\n ${APP_NAME} --continue \"What did we discuss?\"\n\n # Use different model\n ${APP_NAME} --provider openai --model gpt-4o-mini \"Help me refactor this code\"\n\n # Use model with provider prefix (no --provider needed)\n ${APP_NAME} --model openai/gpt-4o \"Help me refactor this code\"\n\n # Use model with thinking level shorthand\n ${APP_NAME} --model sonnet:high \"Solve this complex problem\"\n\n # Limit model cycling to specific models\n ${APP_NAME} --models claude-sonnet,claude-haiku,gpt-4o\n\n # Limit to a specific provider with glob pattern\n ${APP_NAME} --models \"github-copilot/*\"\n\n # Cycle models with fixed thinking levels\n ${APP_NAME} --models sonnet:high,haiku:low\n\n # Start with a specific thinking level\n ${APP_NAME} --thinking high \"Solve this complex problem\"\n\n # Read-only mode (no file modifications possible)\n ${APP_NAME} --tools read,grep,find,ls -p \"Review the code in src/\"\n\n # Export a session file to HTML\n ${APP_NAME} --export ~/${CONFIG_DIR_NAME}/agent/sessions/--path--/session.jsonl\n ${APP_NAME} --export session.jsonl output.html\n\n${chalk.bold(\"Environment Variables:\")}\n ANTHROPIC_API_KEY - Anthropic Claude API key\n ANTHROPIC_OAUTH_TOKEN - Anthropic OAuth token (alternative to API key)\n OPENAI_API_KEY - OpenAI GPT API key\n AZURE_OPENAI_API_KEY - Azure OpenAI API key\n AZURE_OPENAI_BASE_URL - Azure OpenAI/Cognitive Services base URL (e.g. https://{resource}.openai.azure.com)\n AZURE_OPENAI_RESOURCE_NAME - Azure OpenAI resource name (alternative to base URL)\n AZURE_OPENAI_API_VERSION - Azure OpenAI API version (default: v1)\n AZURE_OPENAI_DEPLOYMENT_NAME_MAP - Azure OpenAI model=deployment map (comma-separated)\n DEEPSEEK_API_KEY - DeepSeek API key\n GEMINI_API_KEY - Google Gemini API key\n GROQ_API_KEY - Groq API key\n CEREBRAS_API_KEY - Cerebras API key\n XAI_API_KEY - xAI Grok API key\n FIREWORKS_API_KEY - Fireworks API key\n TOGETHER_API_KEY - Together AI API key\n OPENROUTER_API_KEY - OpenRouter API key\n AI_GATEWAY_API_KEY - Vercel AI Gateway API key\n ZAI_API_KEY - ZAI API key\n MISTRAL_API_KEY - Mistral API key\n MINIMAX_API_KEY - MiniMax API key\n MOONSHOT_API_KEY - Moonshot AI API key\n OPENCODE_API_KEY - OpenCode Zen/OpenCode Go API key\n KIMI_API_KEY - Kimi For Coding API key\n CLOUDFLARE_API_KEY - Cloudflare API token (Workers AI and AI Gateway)\n CLOUDFLARE_ACCOUNT_ID - Cloudflare account id (required for both)\n CLOUDFLARE_GATEWAY_ID - Cloudflare AI Gateway slug (required for AI Gateway)\n XIAOMI_API_KEY - Xiaomi MiMo API key (api.xiaomimimo.com billing)\n XIAOMI_TOKEN_PLAN_CN_API_KEY - Xiaomi MiMo Token Plan API key (China region)\n XIAOMI_TOKEN_PLAN_AMS_API_KEY - Xiaomi MiMo Token Plan API key (Amsterdam region)\n XIAOMI_TOKEN_PLAN_SGP_API_KEY - Xiaomi MiMo Token Plan API key (Singapore region)\n NVIDIA_API_KEY - NVIDIA API key (integrate.api.nvidia.com)\n AWS_PROFILE - AWS profile for Amazon Bedrock\n AWS_ACCESS_KEY_ID - AWS access key for Amazon Bedrock\n AWS_SECRET_ACCESS_KEY - AWS secret key for Amazon Bedrock\n AWS_BEARER_TOKEN_BEDROCK - Bedrock API key (bearer token)\n AWS_REGION - AWS region for Amazon Bedrock (e.g., us-east-1)\n ${ENV_AGENT_DIR.padEnd(32)} - Config directory (default: ~/${CONFIG_DIR_NAME}/agent)\n ${ENV_SESSION_DIR.padEnd(32)} - Session storage directory (overridden by --session-dir)\n HOOCODE_PACKAGE_DIR - Override package directory (for Nix/Guix store paths).\n HOOCODE_OFFLINE - Disable startup network operations when set to 1/true/yes.\n HOOCODE_CA_CERT - Path to an extra PEM CA bundle to trust for hoocode's own TLS traffic\n (additive; verification stays on). Precedence: --ca-cert > this > NODE_EXTRA_CA_CERTS\n HOOCODE_USE_SYSTEM_CA - Also trust the OS/system CA store when set to 1/true/yes (same as --use-system-ca)\n NODE_EXTRA_CA_CERTS - Standard Node path to an extra PEM CA bundle (used as the lowest-precedence CA source)\n HOOCODE_WEBTOOLS_CA_CERT - Path to a PEM CA bundle forwarded to the webtools binary (webfetch/websearch) as --ca-cert\n HOOCODE_WEBTOOLS_INSECURE - Forward --insecure to the webtools binary (disables its TLS verification) when set to 1/true/yes\n HOOCODE_TELEMETRY - Override install telemetry when set to 1/true/yes or 0/false/no.\n HOOCODE_SHARE_VIEWER_URL - Base URL for /share command (default: https://pi.dev/session/).\n\n${chalk.bold(\"Built-in Tool Names:\")}\n read - Read file contents\n bash - Execute bash commands\n edit - Edit files with find/replace\n write - Write files (creates/overwrites)\n grep - Search file contents (read-only, off by default)\n find - Find files by glob pattern (read-only, off by default)\n ls - List directory contents (read-only, off by default)\n`);\n}\n"]}
1
+ {"version":3,"file":"args.js","sourceRoot":"","sources":["../../src/cli/args.ts"],"names":[],"mappings":"AAAA;;GAEG;AAGH,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,EAAE,QAAQ,EAAE,eAAe,EAAE,aAAa,EAAE,eAAe,EAAE,MAAM,cAAc,CAAC;AA0FzF,MAAM,qBAAqB,GAAG,CAAC,KAAK,EAAE,SAAS,EAAE,KAAK,EAAE,QAAQ,EAAE,MAAM,EAAE,OAAO,CAAU,CAAC;AAE5F,MAAM,UAAU,oBAAoB,CA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QAAQ;IACR,QAAQ;IACR,QAAQ;IACR,QAAQ;IACR,QAAQ;IACR,QAAQ;IACR,QAAQ;IACR,QAAQ;;EAEV,KAAK,CAAC,IAAI,CAAC,UAAU,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;mFAmG2D,kBAAkB;;EAEnG,KAAK,CAAC,IAAI,CAAC,WAAW,CAAC;;IAErB,QAAQ;;;IAGR,QAAQ;;;IAGR,QAAQ;;;IAGR,QAAQ;;;IAGR,QAAQ;;;IAGR,QAAQ;;;IAGR,QAAQ;;;IAGR,QAAQ;;;IAGR,QAAQ;;;IAGR,QAAQ;;;IAGR,QAAQ;;;IAGR,QAAQ;;;IAGR,QAAQ;;;IAGR,QAAQ;;;IAGR,QAAQ,eAAe,eAAe;IACtC,QAAQ;;EAEV,KAAK,CAAC,IAAI,CAAC,wBAAwB,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;IAqClC,aAAa,CAAC,MAAM,CAAC,EAAE,CAAC,mCAAmC,eAAe;IAC1E,eAAe,CAAC,MAAM,CAAC,EAAE,CAAC;;;;;;;;;;;;;;EAc5B,KAAK,CAAC,IAAI,CAAC,sBAAsB,CAAC;;;;;;;;CAQnC,CAAC,CAAC;AAAA,CACF","sourcesContent":["/**\n * CLI argument parsing and help display\n */\n\nimport type { ThinkingLevel } from \"@kolisachint/hoocode-agent-core\";\nimport chalk from \"chalk\";\nimport { APP_NAME, CONFIG_DIR_NAME, ENV_AGENT_DIR, ENV_SESSION_DIR } from \"../config.js\";\nimport type { ExtensionFlag } from \"../core/extensions/types.js\";\n\nexport type Mode = \"text\" | \"json\" | \"rpc\";\n\nexport interface Args {\n\tprovider?: string;\n\tmodel?: string;\n\tapiKey?: string;\n\tsystemPrompt?: string;\n\tthinking?: ThinkingLevel;\n\tcontinue?: boolean;\n\tresume?: boolean;\n\thelp?: boolean;\n\tversion?: boolean;\n\tmode?: Mode;\n\tnoSession?: boolean;\n\t/** Internal: task id assigned by SubagentPool when this process is a spawned subagent. */\n\ttaskId?: string;\n\t/** Hard cap on assistant turns. Near the cap the agent is asked to wrap up; at the cap it is stopped. */\n\tmaxTurns?: number;\n\tsession?: string;\n\t/** Base URL of a hooteams server to bridge into the task panel's teams view, or \"auto\" to discover a config and spawn one locally. */\n\tteam?: string;\n\tfork?: string;\n\tsessionDir?: string;\n\tmodels?: string[];\n\ttools?: string[];\n\tdisallowedTools?: string[];\n\tnoTools?: boolean;\n\tnoBuiltinTools?: boolean;\n\t/** Tri-state override of the `enableSubagent` setting (default true): --enable-subagents → true, --no-subagents → false, unset → setting. */\n\tsubagent?: boolean;\n\t/** Dispatch eligible subagents on reused warm RPC workers (overrides the warmSubagents setting). */\n\twarmSubagents?: boolean;\n\t/** Tree-wide subagent nesting cap (overrides the maxSubagentDepth setting). */\n\tmaxSubagentDepth?: number;\n\t/** Internal: restricts which subagent types this process may delegate to. */\n\tdelegateAllow?: string[];\n\ttodoWrite?: boolean;\n\t/** Enable the webfetch + websearch tools (off by default). */\n\tenableWebTools?: boolean;\n\t/** Enable the browser_run + browser_continue tools (browsertools engine, off by default). */\n\tenableBrowserTools?: boolean;\n\t/** Default the streamed live viewer on for browser_run runs and auto-open it (off by default). */\n\tenableBrowserLivePreview?: boolean;\n\t/** Enable the document tools — DocRead/DocEdit/DocWrite + DocScan/DocGrep/DocPeek (off by default). */\n\tenableFileTools?: boolean;\n\t/** Enable the autonomous plugin system — plugin lifecycle tools (SearchPlugins, InstallPlugin, ...) and ProposePlugin (off by default). */\n\tenablePluginTools?: boolean;\n\t/** Minimal low-token preset for small/local models: read/write/edit/bash only, terse prompt, no subagents/todo/skills/context files/mode appendix. */\n\tlight?: boolean;\n\t/** Print the fixed per-turn surface (system prompt + serialized tool schema token estimate) and exit. */\n\tprintTokenSurface?: boolean;\n\t/**\n\t * Platform layout(s) hoocode targets when it WRITES artifacts (authored\n\t * plugins, /new-skill //new-agent //new-command scaffolds). Raw tokens as\n\t * given (comma-separated and/or repeated); normalized downstream:\n\t * agents|native, claude, github|copilot|gh.\n\t */\n\tsupportPlatform?: string[];\n\t/** Path to an explicit PEM CA bundle to trust additively for hoocode's own TLS traffic. */\n\tcaCert?: string;\n\t/** Trust the OS/system CA store additively (opt-in) for hoocode's own TLS traffic. */\n\tuseSystemCa?: boolean;\n\textensions?: string[];\n\tnoExtensions?: boolean;\n\tprint?: boolean;\n\texport?: string;\n\tnoSkills?: boolean;\n\tskills?: string[];\n\tagents?: string[];\n\tpromptTemplates?: string[];\n\tnoPromptTemplates?: boolean;\n\tslashCommands?: string[];\n\tnoSlashCommands?: boolean;\n\tthemes?: string[];\n\tnoThemes?: boolean;\n\tmodePaths?: string[];\n\tnoContextFiles?: boolean;\n\tlistModels?: string | true;\n\toffline?: boolean;\n\tverbose?: boolean;\n\tmessages: string[];\n\tfileArgs: string[];\n\t/** Unknown flags (potentially extension flags) - map of flag name to value */\n\tunknownFlags: Map<string, boolean | string>;\n\tdiagnostics: Array<{ type: \"warning\" | \"error\"; message: string }>;\n}\n\nconst VALID_THINKING_LEVELS = [\"off\", \"minimal\", \"low\", \"medium\", \"high\", \"xhigh\"] as const;\n\nexport function isValidThinkingLevel(level: string): level is ThinkingLevel {\n\treturn VALID_THINKING_LEVELS.includes(level as ThinkingLevel);\n}\n\nexport function parseArgs(args: string[]): Args {\n\tconst result: Args = {\n\t\tmessages: [],\n\t\tfileArgs: [],\n\t\tunknownFlags: new Map(),\n\t\tdiagnostics: [],\n\t};\n\n\tfor (let i = 0; i < args.length; i++) {\n\t\tconst arg = args[i];\n\n\t\tif (arg === \"--help\" || arg === \"-h\") {\n\t\t\tresult.help = true;\n\t\t} else if (arg === \"--version\" || arg === \"-v\") {\n\t\t\tresult.version = true;\n\t\t} else if (arg === \"--mode\" && i + 1 < args.length) {\n\t\t\tconst mode = args[++i];\n\t\t\tif (mode === \"text\" || mode === \"json\" || mode === \"rpc\") {\n\t\t\t\tresult.mode = mode;\n\t\t\t}\n\t\t} else if (arg === \"--continue\" || arg === \"-c\") {\n\t\t\tresult.continue = true;\n\t\t} else if (arg === \"--resume\" || arg === \"-r\") {\n\t\t\tresult.resume = true;\n\t\t} else if (arg === \"--provider\" && i + 1 < args.length) {\n\t\t\tresult.provider = args[++i];\n\t\t} else if (arg === \"--model\" && i + 1 < args.length) {\n\t\t\tresult.model = args[++i];\n\t\t} else if (arg === \"--api-key\" && i + 1 < args.length) {\n\t\t\tresult.apiKey = args[++i];\n\t\t} else if (arg === \"--system-prompt\" && i + 1 < args.length) {\n\t\t\tresult.systemPrompt = args[++i];\n\t\t} else if (arg === \"--no-session\") {\n\t\t\tresult.noSession = true;\n\t\t} else if (arg === \"--task-id\" && i + 1 < args.length) {\n\t\t\tresult.taskId = args[++i];\n\t\t} else if (arg === \"--max-turns\" && i + 1 < args.length) {\n\t\t\tconst n = Number.parseInt(args[++i], 10);\n\t\t\tif (Number.isInteger(n) && n > 0) {\n\t\t\t\tresult.maxTurns = n;\n\t\t\t}\n\t\t} else if (arg === \"--session\" && i + 1 < args.length) {\n\t\t\tresult.session = args[++i];\n\t\t} else if (arg === \"--team\" && i + 1 < args.length) {\n\t\t\tresult.team = args[++i];\n\t\t} else if (arg === \"--fork\" && i + 1 < args.length) {\n\t\t\tresult.fork = args[++i];\n\t\t} else if (arg === \"--session-dir\" && i + 1 < args.length) {\n\t\t\tresult.sessionDir = args[++i];\n\t\t} else if (arg === \"--models\" && i + 1 < args.length) {\n\t\t\tresult.models = args[++i].split(\",\").map((s) => s.trim());\n\t\t} else if (arg === \"--no-tools\" || arg === \"-nt\") {\n\t\t\tresult.noTools = true;\n\t\t} else if (arg === \"--no-builtin-tools\" || arg === \"-nbt\") {\n\t\t\tresult.noBuiltinTools = true;\n\t\t} else if (arg === \"--enable-subagents\") {\n\t\t\tresult.subagent = true;\n\t\t} else if (arg === \"--no-subagents\" || arg === \"--disable-subagents\") {\n\t\t\tresult.subagent = false;\n\t\t} else if (arg === \"--warm-subagents\") {\n\t\t\tresult.warmSubagents = true;\n\t\t} else if (arg === \"--max-subagent-depth\" && i + 1 < args.length) {\n\t\t\tconst n = Number.parseInt(args[++i], 10);\n\t\t\tif (Number.isInteger(n) && n >= 1) {\n\t\t\t\tresult.maxSubagentDepth = n;\n\t\t\t}\n\t\t} else if (arg === \"--delegate-allow\" && i + 1 < args.length) {\n\t\t\tresult.delegateAllow = args[++i]\n\t\t\t\t.split(\",\")\n\t\t\t\t.map((s) => s.trim())\n\t\t\t\t.filter((name) => name.length > 0);\n\t\t} else if (arg === \"--enable-todowrite\") {\n\t\t\tresult.todoWrite = true;\n\t\t} else if (arg === \"--enable-webtools\") {\n\t\t\tresult.enableWebTools = true;\n\t\t} else if (arg === \"--enable-browsertools\") {\n\t\t\tresult.enableBrowserTools = true;\n\t\t} else if (arg === \"--enable-browser-live-preview\") {\n\t\t\tresult.enableBrowserLivePreview = true;\n\t\t} else if (arg === \"--enable-filetools\") {\n\t\t\tresult.enableFileTools = true;\n\t\t} else if (arg === \"--enable-plugintools\") {\n\t\t\tresult.enablePluginTools = true;\n\t\t} else if (arg === \"--light\") {\n\t\t\tresult.light = true;\n\t\t} else if (arg === \"--print-token-surface\") {\n\t\t\tresult.printTokenSurface = true;\n\t\t} else if (arg === \"--support-platform\" && i + 1 < args.length) {\n\t\t\tresult.supportPlatform = [\n\t\t\t\t...(result.supportPlatform ?? []),\n\t\t\t\t...args[++i]\n\t\t\t\t\t.split(\",\")\n\t\t\t\t\t.map((s) => s.trim())\n\t\t\t\t\t.filter(Boolean),\n\t\t\t];\n\t\t} else if (arg === \"--ca-cert\" && i + 1 < args.length) {\n\t\t\tresult.caCert = args[++i];\n\t\t} else if (arg === \"--use-system-ca\") {\n\t\t\tresult.useSystemCa = true;\n\t\t} else if ((arg === \"--tools\" || arg === \"-t\") && i + 1 < args.length) {\n\t\t\tresult.tools = args[++i]\n\t\t\t\t.split(\",\")\n\t\t\t\t.map((s) => s.trim())\n\t\t\t\t.filter((name) => name.length > 0);\n\t\t} else if (arg === \"--disallowed-tools\" && i + 1 < args.length) {\n\t\t\tresult.disallowedTools = args[++i]\n\t\t\t\t.split(\",\")\n\t\t\t\t.map((s) => s.trim())\n\t\t\t\t.filter((name) => name.length > 0);\n\t\t} else if (arg === \"--thinking\" && i + 1 < args.length) {\n\t\t\tconst level = args[++i];\n\t\t\tif (isValidThinkingLevel(level)) {\n\t\t\t\tresult.thinking = level;\n\t\t\t} else {\n\t\t\t\tresult.diagnostics.push({\n\t\t\t\t\ttype: \"warning\",\n\t\t\t\t\tmessage: `Invalid thinking level \"${level}\". Valid values: ${VALID_THINKING_LEVELS.join(\", \")}`,\n\t\t\t\t});\n\t\t\t}\n\t\t} else if (arg === \"--print\" || arg === \"-p\") {\n\t\t\tresult.print = true;\n\t\t\tconst next = args[i + 1];\n\t\t\tif (next !== undefined && !next.startsWith(\"@\") && (!next.startsWith(\"-\") || next.startsWith(\"---\"))) {\n\t\t\t\tresult.messages.push(next);\n\t\t\t\ti++;\n\t\t\t}\n\t\t} else if (arg === \"--export\" && i + 1 < args.length) {\n\t\t\tresult.export = args[++i];\n\t\t} else if ((arg === \"--extension\" || arg === \"-e\") && i + 1 < args.length) {\n\t\t\tresult.extensions = result.extensions ?? [];\n\t\t\tresult.extensions.push(args[++i]);\n\t\t} else if (arg === \"--no-extensions\" || arg === \"-ne\") {\n\t\t\tresult.noExtensions = true;\n\t\t} else if (arg === \"--skill\" && i + 1 < args.length) {\n\t\t\tresult.skills = result.skills ?? [];\n\t\t\tresult.skills.push(args[++i]);\n\t\t} else if (arg === \"--agent\" && i + 1 < args.length) {\n\t\t\tresult.agents = result.agents ?? [];\n\t\t\tresult.agents.push(args[++i]);\n\t\t} else if (arg === \"--prompt-template\" && i + 1 < args.length) {\n\t\t\tresult.promptTemplates = result.promptTemplates ?? [];\n\t\t\tresult.promptTemplates.push(args[++i]);\n\t\t} else if (arg === \"--slash-command\" && i + 1 < args.length) {\n\t\t\tresult.slashCommands = result.slashCommands ?? [];\n\t\t\tresult.slashCommands.push(args[++i]);\n\t\t} else if (arg === \"--theme\" && i + 1 < args.length) {\n\t\t\tresult.themes = result.themes ?? [];\n\t\t\tresult.themes.push(args[++i]);\n\t\t} else if (arg === \"--mode-path\" && i + 1 < args.length) {\n\t\t\tresult.modePaths = result.modePaths ?? [];\n\t\t\tresult.modePaths.push(args[++i]);\n\t\t} else if (arg === \"--no-skills\" || arg === \"-ns\") {\n\t\t\tresult.noSkills = true;\n\t\t} else if (arg === \"--no-prompt-templates\" || arg === \"-np\") {\n\t\t\tresult.noPromptTemplates = true;\n\t\t} else if (arg === \"--no-slash-commands\" || arg === \"-nsc\") {\n\t\t\tresult.noSlashCommands = true;\n\t\t} else if (arg === \"--no-themes\") {\n\t\t\tresult.noThemes = true;\n\t\t} else if (arg === \"--no-context-files\" || arg === \"-nc\") {\n\t\t\tresult.noContextFiles = true;\n\t\t} else if (arg === \"--list-models\") {\n\t\t\t// Check if next arg is a search pattern (not a flag or file arg)\n\t\t\tif (i + 1 < args.length && !args[i + 1].startsWith(\"-\") && !args[i + 1].startsWith(\"@\")) {\n\t\t\t\tresult.listModels = args[++i];\n\t\t\t} else {\n\t\t\t\tresult.listModels = true;\n\t\t\t}\n\t\t} else if (arg === \"--verbose\") {\n\t\t\tresult.verbose = true;\n\t\t} else if (arg === \"--offline\") {\n\t\t\tresult.offline = true;\n\t\t} else if (arg.startsWith(\"@\")) {\n\t\t\tresult.fileArgs.push(arg.slice(1)); // Remove @ prefix\n\t\t} else if (arg.startsWith(\"--\")) {\n\t\t\tconst eqIndex = arg.indexOf(\"=\");\n\t\t\tif (eqIndex !== -1) {\n\t\t\t\tresult.unknownFlags.set(arg.slice(2, eqIndex), arg.slice(eqIndex + 1));\n\t\t\t} else {\n\t\t\t\tconst flagName = arg.slice(2);\n\t\t\t\tconst next = args[i + 1];\n\t\t\t\tif (next !== undefined && !next.startsWith(\"-\") && !next.startsWith(\"@\")) {\n\t\t\t\t\tresult.unknownFlags.set(flagName, next);\n\t\t\t\t\ti++;\n\t\t\t\t} else {\n\t\t\t\t\tresult.unknownFlags.set(flagName, true);\n\t\t\t\t}\n\t\t\t}\n\t\t} else if (arg.startsWith(\"-\") && !arg.startsWith(\"--\")) {\n\t\t\tresult.diagnostics.push({ type: \"error\", message: `Unknown option: ${arg}` });\n\t\t} else if (!arg.startsWith(\"-\")) {\n\t\t\tresult.messages.push(arg);\n\t\t}\n\t}\n\n\treturn result;\n}\n\nexport function printHelp(extensionFlags?: ExtensionFlag[]): void {\n\tconst extensionFlagsText =\n\t\textensionFlags && extensionFlags.length > 0\n\t\t\t? `\\n${chalk.bold(\"Extension CLI Flags:\")}\\n${extensionFlags\n\t\t\t\t\t.map((flag) => {\n\t\t\t\t\t\tconst value = flag.type === \"string\" ? \" <value>\" : \"\";\n\t\t\t\t\t\tconst description = flag.description ?? `Registered by ${flag.extensionPath}`;\n\t\t\t\t\t\treturn ` --${flag.name}${value}`.padEnd(30) + description;\n\t\t\t\t\t})\n\t\t\t\t\t.join(\"\\n\")}\\n`\n\t\t\t: \"\";\n\tconsole.log(`${chalk.bold(APP_NAME)} - AI coding assistant with read, bash, edit, write tools\n\n${chalk.bold(\"Usage:\")}\n ${APP_NAME} [options] [@files...] [messages...]\n\n${chalk.bold(\"Commands:\")}\n ${APP_NAME} install <source> [-l] Install extension source and add to settings\n ${APP_NAME} remove <source> [-l] Remove extension source from settings\n ${APP_NAME} uninstall <source> [-l] Alias for remove\n ${APP_NAME} update [source|self|pi] Update hoocode and installed extensions\n ${APP_NAME} list List installed extensions from settings\n ${APP_NAME} config Open TUI to enable/disable package resources\n ${APP_NAME} resources List discovered skills, subagents, slash commands, and MCP servers\n ${APP_NAME} <command> --help Show help for install/remove/uninstall/update/list\n\n${chalk.bold(\"Options:\")}\n --provider <name> Provider name (default: google)\n --model <pattern> Model pattern or ID (supports \"provider/id\" and optional \":<thinking>\")\n --api-key <key> API key (defaults to env vars)\n --system-prompt <text> System prompt (default: coding assistant prompt)\n --mode <mode> Output mode: text (default), json, or rpc\n --print, -p Non-interactive mode: process prompt and exit\n --continue, -c Continue previous session\n --resume, -r Select a session to resume\n --session <path|id> Use specific session file or partial UUID\n --fork <path|id> Fork specific session file or partial UUID into a new session\n --session-dir <dir> Directory for session storage and lookup\n --no-session Don't save session (ephemeral)\n --team <url|auto> Bridge a hooteams server into the task panel's teams view\n (focus roles, nudge, attach, answer approval gates);\n \"auto\" finds .agents/teams/default.json\n or hooteams.config.json upward from cwd and spawns hooteams locally\n --models <patterns> Comma-separated model patterns for Ctrl+P cycling\n Supports globs (anthropic/*, *sonnet*) and fuzzy matching\n --no-tools, -nt Disable all tools by default (built-in and extension)\n --no-builtin-tools, -nbt Disable built-in tools by default but keep extension/custom tools enabled\n --tools, -t <tools> Comma-separated allowlist of tool names to enable\n Applies to built-in, extension, and custom tools\n --disallowed-tools <tools> Comma-separated denylist of tool names to disable\n (subtracted from the allowlist or default set)\n --max-turns <n> Hard cap on assistant turns; the agent is asked to wrap up near the\n cap and stopped at it (mainly used for spawned subagents)\n --enable-subagents Enable the subagent tool (delegate tasks to isolated agent loops).\n On by default (the \"enableSubagent\" setting defaults to true)\n --no-subagents Disable the subagent tool for this session (overrides the setting)\n --warm-subagents Dispatch eligible subagents on reused warm RPC workers (experimental)\n --max-subagent-depth <n> Tree-wide subagent nesting cap (default 2 = one level of nesting;\n 1 = no nesting). Overrides the \"maxSubagentDepth\" setting\n Can also be enabled via the \"enableSubagent\" setting\n --enable-todowrite Enable the TodoWrite tool (maintain a live todo list in the task panel)\n Can also be enabled via the \"enableTodoWrite\" setting\n --enable-webtools Enable the webfetch + websearch tools (network access, off by default)\n Can also be enabled via the \"enableWebTools\" setting\n Block hosts with a .webtoolsignore file (gitignore syntax)\n --enable-browsertools Enable the browser_run + browser_continue tools (off by default)\n Deterministic browser automation via the browsertools engine,\n pausing for LLM decisions (NeedsParent) mid-flow\n Can also be enabled via the \"enableBrowserTools\" setting\n --enable-browser-live-preview Default the live viewer on for browser_run runs and auto-open it\n Streams the page + the agent's tool-call log over a local WebSocket\n Set HOOCODE_BROWSERTOOLS_NO_OPEN=1 to print the URL without opening\n Can also be enabled via the \"enableBrowserLivePreview\" setting\n --enable-filetools Enable the document tools (off by default)\n DocRead/DocEdit/DocWrite (extract + lossless id-based edit) and\n DocScan/DocGrep/DocPeek (cheap outline/search/partial read) for\n XML, drawio, docx/xlsx/pptx, PDF via the filetools binary\n Can also be enabled via the \"enableFileTools\" setting\n --enable-plugintools Enable the autonomous plugin system (off by default)\n Plugin lifecycle tools (SearchPlugins, InstallPlugin, ...) and\n ProposePlugin, plus the runtime plugin-reuse nudge\n Can also be enabled via the \"enablePluginTools\" setting\n --light Minimal low-token preset for small/local models:\n only the read/write/edit/bash tools (short descriptions,\n stripped schemas; search via bash), a terse system prompt, and\n no subagents/TodoWrite/skills/context files/mode appendix\n Can also be enabled via the \"light\" setting\n --print-token-surface Print the fixed per-turn surface (system prompt + serialized\n tool schema token estimate) and exit\n --support-platform <list> Platform layout(s) hoocode targets when it writes artifacts:\n authored plugins (ProposePlugin) and the /new-skill /new-agent\n /new-command scaffolds. Comma-separated and/or repeated.\n Tokens: claude, copilot (alias: github, gh), agents (alias: native)\n e.g. --support-platform copilot writes .github/skills/<name>/SKILL.md,\n .github/agents/<name>.agent.md, .github/prompts/<name>.prompt.md and\n a .github/plugin/plugin.json manifest for authored plugins\n Default: claude + copilot for authored plugins; .hoocode/ for scaffolds\n Can also be set via the \"supportPlatform\" setting\n --thinking <level> Set thinking level: off, minimal, low, medium, high, xhigh\n --extension, -e <path> Load an extension file (can be used multiple times)\n --no-extensions, -ne Disable extension discovery (explicit -e paths still work)\n --skill <path> Load a skill file or directory (can be used multiple times)\n --no-skills, -ns Disable skills discovery and loading\n --agent <path> Load an agent file or directory (can be used multiple times)\n --prompt-template <path> Load a prompt template / slash command file or directory (repeatable)\n --slash-command <path> Alias of --prompt-template (prompts and slash commands are one feature)\n --no-prompt-templates, -np Disable prompt template / slash command discovery (same as --no-slash-commands)\n --no-slash-commands, -nsc Disable prompt template / slash command discovery (same as --no-prompt-templates)\n --theme <path> Load a theme file or directory (can be used multiple times)\n --no-themes Disable theme discovery and loading\n --mode-path <dir> Add a directory to search for {name}/system.md mode files (can be used multiple times)\n --no-context-files, -nc Disable AGENTS.md and CLAUDE.md discovery and loading\n --export <file> Export session file to HTML and exit\n --list-models [search] List available models (with optional fuzzy search)\n --verbose Force verbose startup (overrides quietStartup setting)\n --offline Disable startup network operations (same as HOOCODE_OFFLINE=1)\n --ca-cert <path> Trust an extra PEM CA bundle for hoocode's own TLS traffic (provider\n calls, GitHub API, downloads). Additive to the bundled roots;\n verification stays ON. Also: HOOCODE_CA_CERT / NODE_EXTRA_CA_CERTS.\n Does not affect the webfetch/websearch binary.\n --use-system-ca Also trust the OS/system CA store (opt-in). Same as\n HOOCODE_USE_SYSTEM_CA=1\n --help, -h Show this help\n --version, -v Show version number\n\nExtensions can register additional flags (e.g., --plan from plan-mode extension).${extensionFlagsText}\n\n${chalk.bold(\"Examples:\")}\n # Interactive mode\n ${APP_NAME}\n\n # Interactive mode with initial prompt\n ${APP_NAME} \"List all .ts files in src/\"\n\n # Include files in initial message\n ${APP_NAME} @prompt.md @image.png \"What color is the sky?\"\n\n # Non-interactive mode (process and exit)\n ${APP_NAME} -p \"List all .ts files in src/\"\n\n # Multiple messages (interactive)\n ${APP_NAME} \"Read package.json\" \"What dependencies do we have?\"\n\n # Continue previous session\n ${APP_NAME} --continue \"What did we discuss?\"\n\n # Use different model\n ${APP_NAME} --provider openai --model gpt-4o-mini \"Help me refactor this code\"\n\n # Use model with provider prefix (no --provider needed)\n ${APP_NAME} --model openai/gpt-4o \"Help me refactor this code\"\n\n # Use model with thinking level shorthand\n ${APP_NAME} --model sonnet:high \"Solve this complex problem\"\n\n # Limit model cycling to specific models\n ${APP_NAME} --models claude-sonnet,claude-haiku,gpt-4o\n\n # Limit to a specific provider with glob pattern\n ${APP_NAME} --models \"github-copilot/*\"\n\n # Cycle models with fixed thinking levels\n ${APP_NAME} --models sonnet:high,haiku:low\n\n # Start with a specific thinking level\n ${APP_NAME} --thinking high \"Solve this complex problem\"\n\n # Read-only mode (no file modifications possible)\n ${APP_NAME} --tools read,grep,find,ls -p \"Review the code in src/\"\n\n # Export a session file to HTML\n ${APP_NAME} --export ~/${CONFIG_DIR_NAME}/agent/sessions/--path--/session.jsonl\n ${APP_NAME} --export session.jsonl output.html\n\n${chalk.bold(\"Environment Variables:\")}\n ANTHROPIC_API_KEY - Anthropic Claude API key\n ANTHROPIC_OAUTH_TOKEN - Anthropic OAuth token (alternative to API key)\n OPENAI_API_KEY - OpenAI GPT API key\n AZURE_OPENAI_API_KEY - Azure OpenAI API key\n AZURE_OPENAI_BASE_URL - Azure OpenAI/Cognitive Services base URL (e.g. https://{resource}.openai.azure.com)\n AZURE_OPENAI_RESOURCE_NAME - Azure OpenAI resource name (alternative to base URL)\n AZURE_OPENAI_API_VERSION - Azure OpenAI API version (default: v1)\n AZURE_OPENAI_DEPLOYMENT_NAME_MAP - Azure OpenAI model=deployment map (comma-separated)\n DEEPSEEK_API_KEY - DeepSeek API key\n GEMINI_API_KEY - Google Gemini API key\n GROQ_API_KEY - Groq API key\n CEREBRAS_API_KEY - Cerebras API key\n XAI_API_KEY - xAI Grok API key\n FIREWORKS_API_KEY - Fireworks API key\n TOGETHER_API_KEY - Together AI API key\n OPENROUTER_API_KEY - OpenRouter API key\n AI_GATEWAY_API_KEY - Vercel AI Gateway API key\n ZAI_API_KEY - ZAI API key\n MISTRAL_API_KEY - Mistral API key\n MINIMAX_API_KEY - MiniMax API key\n MOONSHOT_API_KEY - Moonshot AI API key\n OPENCODE_API_KEY - OpenCode Zen/OpenCode Go API key\n KIMI_API_KEY - Kimi For Coding API key\n CLOUDFLARE_API_KEY - Cloudflare API token (Workers AI and AI Gateway)\n CLOUDFLARE_ACCOUNT_ID - Cloudflare account id (required for both)\n CLOUDFLARE_GATEWAY_ID - Cloudflare AI Gateway slug (required for AI Gateway)\n XIAOMI_API_KEY - Xiaomi MiMo API key (api.xiaomimimo.com billing)\n XIAOMI_TOKEN_PLAN_CN_API_KEY - Xiaomi MiMo Token Plan API key (China region)\n XIAOMI_TOKEN_PLAN_AMS_API_KEY - Xiaomi MiMo Token Plan API key (Amsterdam region)\n XIAOMI_TOKEN_PLAN_SGP_API_KEY - Xiaomi MiMo Token Plan API key (Singapore region)\n NVIDIA_API_KEY - NVIDIA API key (integrate.api.nvidia.com)\n AWS_PROFILE - AWS profile for Amazon Bedrock\n AWS_ACCESS_KEY_ID - AWS access key for Amazon Bedrock\n AWS_SECRET_ACCESS_KEY - AWS secret key for Amazon Bedrock\n AWS_BEARER_TOKEN_BEDROCK - Bedrock API key (bearer token)\n AWS_REGION - AWS region for Amazon Bedrock (e.g., us-east-1)\n ${ENV_AGENT_DIR.padEnd(32)} - Config directory (default: ~/${CONFIG_DIR_NAME}/agent)\n ${ENV_SESSION_DIR.padEnd(32)} - Session storage directory (overridden by --session-dir)\n HOOCODE_PACKAGE_DIR - Override package directory (for Nix/Guix store paths).\n HOOCODE_OFFLINE - Disable startup network operations when set to 1/true/yes.\n HOOCODE_NATIVE_SEARCH - Force the pure-JS find/grep fallback instead of the fd/rg binaries\n when set to 1 (also used automatically when fd/rg are unavailable).\n HOOCODE_CA_CERT - Path to an extra PEM CA bundle to trust for hoocode's own TLS traffic\n (additive; verification stays on). Precedence: --ca-cert > this > NODE_EXTRA_CA_CERTS\n HOOCODE_USE_SYSTEM_CA - Also trust the OS/system CA store when set to 1/true/yes (same as --use-system-ca)\n NODE_EXTRA_CA_CERTS - Standard Node path to an extra PEM CA bundle (used as the lowest-precedence CA source)\n HOOCODE_WEBTOOLS_CA_CERT - Path to a PEM CA bundle forwarded to the webtools binary (webfetch/websearch) as --ca-cert\n HOOCODE_WEBTOOLS_INSECURE - Forward --insecure to the webtools binary (disables its TLS verification) when set to 1/true/yes\n HOOCODE_TELEMETRY - Override install telemetry when set to 1/true/yes or 0/false/no.\n HOOCODE_SHARE_VIEWER_URL - Base URL for /share command (default: https://pi.dev/session/).\n\n${chalk.bold(\"Built-in Tool Names:\")}\n read - Read file contents\n bash - Execute bash commands\n edit - Edit files with find/replace\n write - Write files (creates/overwrites)\n grep - Search file contents (read-only, off by default)\n find - Find files by glob pattern (read-only, off by default)\n ls - List directory contents (read-only, off by default)\n`);\n}\n"]}
@@ -15,8 +15,13 @@
15
15
  * reads those natively anyway.) The capability tree matches the Claude layout:
16
16
  *
17
17
  * skills skills/<name>/SKILL.md (or the manifest's `skills` path override)
18
- * commands commands/<name>.md
19
- * subagents agents/<name>.md (Copilot also emits/reads `.agent.md` names)
18
+ * commands .github/prompts/<name>.prompt.md (Copilot's prompt-file convention — the
19
+ * analog of a slash command; a manifest
20
+ * `commands` path or `commands/` dir is read too)
21
+ * subagents agents/<name>.agent.md (Copilot's custom-agent convention — the
22
+ * `.agent.md` suffix and a YAML-list `tools`
23
+ * frontmatter are what Copilot recognizes; the
24
+ * reader still accepts bare `.md` names)
20
25
  * hooks hooks.json or hooks/hooks.json ({ description?, hooks: { Event: [...] } })
21
26
  * MCP servers .mcp.json ({ mcpServers } | { servers })
22
27
  *
@@ -1 +1 @@
1
- {"version":3,"file":"copilot.d.ts","sourceRoot":"","sources":["../../../../../src/core/extensions/plugins/formats/copilot.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAqCG;AAmBH,OAAO,KAAK,EAA4B,mBAAmB,EAAE,MAAM,YAAY,CAAC;AA2ChF,eAAO,MAAM,aAAa,EAAE,mBAwI3B,CAAC","sourcesContent":["/**\n * GitHub Copilot format.\n *\n * hoocode's preferred Copilot home is the `.github/plugin/` marker directory —\n * the convention used by the real-world plugins indexed by\n * github/copilot-plugins (e.g. microsoft/work-iq) and the documented location\n * for GitHub-hosted marketplaces. The official Copilot CLI plugin reference\n * (docs.github.com copilot/reference/copilot-cli-reference/cli-plugin-reference,\n * \"File locations\"; verified 2026-07) accepts several locations for both files\n * (`.plugin/`, plugin root, `.github/plugin/`, `.claude-plugin/`), so this\n * adapter reads them all — `.github/plugin/` first, then root, then `.plugin/`,\n * then the legacy hoocode layout — and writes `.github/plugin/`.\n * (`.claude-plugin/` belongs to the Claude adapter, which wins precedence, so a\n * `.claude-plugin`-only directory correctly parses as a Claude plugin; Copilot\n * reads those natively anyway.) The capability tree matches the Claude layout:\n *\n * skills skills/<name>/SKILL.md (or the manifest's `skills` path override)\n * commands commands/<name>.md\n * subagents agents/<name>.md (Copilot also emits/reads `.agent.md` names)\n * hooks hooks.json or hooks/hooks.json ({ description?, hooks: { Event: [...] } })\n * MCP servers .mcp.json ({ mcpServers } | { servers })\n *\n * Workspace-level (non-plugin) conventions, per the current GitHub Copilot\n * customization docs (docs.github.com — agent skills, custom agents, prompt\n * files; verified 2026-07):\n *\n * skills .github/skills/<name>/SKILL.md (agentskills.io open standard)\n * custom agents .github/agents/<name>.agent.md (frontmatter: name, description,\n * tools as a YAML list, model, ...)\n * prompt files .github/prompts/<name>.prompt.md (VS Code / Copilot prompt files)\n *\n * Earlier hoocode releases authored a different Copilot mapping\n * (`.github/copilot-plugin.json` + `.github/prompts/*.prompt.md` +\n * `.github/chatmodes/*.chatmode.md`); the reader still accepts that layout as a\n * legacy fallback so previously authored plugins keep loading. Copilot\n * conventions move quickly; this file is the single place that encodes them,\n * so tracking an upstream change never reaches beyond this adapter.\n */\n\nimport * as fs from \"node:fs\";\nimport * as path from \"node:path\";\nimport type { NormalizedPlugin } from \"../manifest.js\";\nimport {\n\tauthoredHooksToConfig,\n\tdirIfExists,\n\temitJson,\n\temitMarkdown,\n\tnormalizeHooks,\n\tnormalizeMcp,\n\tparseAuthor,\n\ttype RawManifest,\n\treadJson,\n\tresolveCapabilityDir,\n\tslug,\n\ttoolsYamlList,\n} from \"./shared.js\";\nimport type { EmittedFile, PluginDraft, PluginFormatAdapter } from \"./types.js\";\n\nconst MARKER_DIR = \".github\";\n/**\n * Manifest probe order: `.github/plugin/plugin.json` first — hoocode's\n * preferred Copilot home, matching the real-world plugins indexed by\n * github/copilot-plugins (e.g. microsoft/work-iq) — then the Copilot CLI\n * reference's other locations (root `plugin.json`, `.plugin/plugin.json`) and\n * hoocode's legacy `.github/copilot-plugin.json`. (`.claude-plugin/plugin.json`,\n * also probed by the CLI, belongs to the Claude adapter.)\n */\nconst MANIFEST_REL_PATHS = [\n\tpath.join(MARKER_DIR, \"plugin\", \"plugin.json\"),\n\t\"plugin.json\",\n\tpath.join(\".plugin\", \"plugin.json\"),\n\tpath.join(MARKER_DIR, \"copilot-plugin.json\"),\n] as const;\n/** Authored manifest location: the preferred `.github/plugin/` home. */\nconst emitManifestRelPath = path.join(MARKER_DIR, \"plugin\", \"plugin.json\");\n\n// Legacy authored layout (read-only fallbacks).\nconst LEGACY_PROMPTS_DIR = path.join(MARKER_DIR, \"prompts\");\nconst LEGACY_CHATMODES_DIR = path.join(MARKER_DIR, \"chatmodes\");\nconst LEGACY_MCP_FILE = path.join(MARKER_DIR, \"mcp.json\");\nconst LEGACY_HOOKS_FILE = path.join(MARKER_DIR, \"hooks\", \"hooks.json\");\n\n/** Read a hooks JSON file (either `{ hooks: {...} }` or a bare event map). */\nfunction readHooksFile(root: string, rel: string): NormalizedPlugin[\"hooks\"] {\n\tconst file = path.join(root, rel);\n\tif (!fs.existsSync(file)) return undefined;\n\tconst raw = readJson<{ hooks?: Record<string, unknown> } | Record<string, unknown>>(file);\n\tif (!raw || typeof raw !== \"object\") return undefined;\n\tconst config = (\"hooks\" in raw && raw.hooks ? raw.hooks : raw) as NormalizedPlugin[\"hooks\"];\n\treturn config && Object.keys(config).length > 0 ? config : undefined;\n}\n\nfunction manifestPathFor(root: string): string | undefined {\n\tfor (const rel of MANIFEST_REL_PATHS) {\n\t\tif (readJson(path.join(root, rel)) != null) return path.join(root, rel);\n\t}\n\treturn undefined;\n}\n\nexport const copilotFormat: PluginFormatAdapter = {\n\tid: \"copilot\",\n\tplatform: \"github\",\n\tprecedence: 2,\n\tlabel: \"GitHub Copilot (.github)\",\n\t// .github/plugin/ first (hoocode's preferred Copilot home and the documented\n\t// location for GitHub-hosted marketplaces), then the legacy .github/ spot,\n\t// then the Copilot CLI's other probe locations (root, .plugin/).\n\tmarketplaceFiles: [\n\t\tpath.join(MARKER_DIR, \"plugin\", \"marketplace.json\"),\n\t\tpath.join(MARKER_DIR, \"marketplace.json\"),\n\t\t\"marketplace.json\",\n\t\tpath.join(\".plugin\", \"marketplace.json\"),\n\t],\n\n\tworkspace: {\n\t\troot: MARKER_DIR,\n\t\t// Copilot reads repo skills from .github/skills (also .claude/skills and\n\t\t// .agents/skills, which the sibling adapters cover).\n\t\temitSkill: (s) => ({\n\t\t\tpath: path.join(MARKER_DIR, \"skills\", slug(s.name), \"SKILL.md\"),\n\t\t\tcontent: emitMarkdown({ name: s.name, description: s.description }, s.body),\n\t\t}),\n\t\t// Custom agents take `tools` as a YAML list (not the Claude comma string).\n\t\temitAgent: (a) => ({\n\t\t\tpath: path.join(MARKER_DIR, \"agents\", `${slug(a.name)}.agent.md`),\n\t\t\tcontent: emitMarkdown(\n\t\t\t\t{ name: a.name, description: a.description, tools: toolsYamlList(a.tools), model: a.model },\n\t\t\t\ta.body,\n\t\t\t),\n\t\t}),\n\t\t// The closest Copilot equivalent of a slash command is a prompt file.\n\t\temitCommand: (c) => ({\n\t\t\tpath: path.join(MARKER_DIR, \"prompts\", `${slug(c.name)}.prompt.md`),\n\t\t\tcontent: emitMarkdown({ description: c.description }, c.body),\n\t\t}),\n\t},\n\n\tdetectPlugin(root: string): boolean {\n\t\treturn manifestPathFor(root) !== undefined;\n\t},\n\n\tparsePlugin(root: string): NormalizedPlugin | null {\n\t\tconst manifestPath = manifestPathFor(root);\n\t\tif (!manifestPath) return null;\n\t\tconst raw = readJson<RawManifest>(manifestPath);\n\t\tif (!raw) return null;\n\n\t\tconst id = (raw.name ?? path.basename(root)).trim();\n\t\tif (!id) return null;\n\n\t\treturn {\n\t\t\tid,\n\t\t\tversion: raw.version,\n\t\t\tdescription: raw.description,\n\t\t\tauthor: parseAuthor(raw.author),\n\t\t\troot,\n\t\t\tmanifestPath,\n\t\t\tformat: \"copilot\",\n\t\t\t// Single-format view; the registry widens this to every format present.\n\t\t\tsupportPlatform: [\"github\"],\n\t\t\t// Claude-mirror layout (manifest overrides honored), with the legacy\n\t\t\t// prompts/chatmodes locations as read-only fallbacks.\n\t\t\tskillsDir: resolveCapabilityDir(root, raw.skills, \"skills\"),\n\t\t\tcommandsDir: resolveCapabilityDir(root, raw.commands, \"commands\") ?? dirIfExists(root, LEGACY_PROMPTS_DIR),\n\t\t\tagentsDir: resolveCapabilityDir(root, raw.agents, \"agents\") ?? dirIfExists(root, LEGACY_CHATMODES_DIR),\n\t\t\tthemesDir: resolveCapabilityDir(root, raw.themes, \"themes\"),\n\t\t\t// Copilot CLI plugins put hooks config at root `hooks.json`; normalizeHooks\n\t\t\t// covers the Claude-mirror `hooks/hooks.json`, then the legacy location.\n\t\t\thooks:\n\t\t\t\tnormalizeHooks(raw.hooks, root) ??\n\t\t\t\treadHooksFile(root, \"hooks.json\") ??\n\t\t\t\treadHooksFile(root, LEGACY_HOOKS_FILE),\n\t\t\tmcpServers: normalizeMcp(raw.mcpServers, root) ?? normalizeMcp(undefined, root, LEGACY_MCP_FILE),\n\t\t\t// Providers are a native-only concept.\n\t\t\tproviders: undefined,\n\t\t};\n\t},\n\n\temit(draft: PluginDraft): EmittedFile[] {\n\t\t// Only the manifest is Copilot-specific — the canonical location is root\n\t\t// `plugin.json` (Copilot CLI spec) — and the capability tree mirrors the\n\t\t// Claude layout, so a plugin authored for both platforms is one tree with a\n\t\t// root manifest for Copilot and a .claude-plugin/ manifest for Claude.\n\t\tconst files: EmittedFile[] = [];\n\n\t\tfiles.push({\n\t\t\tpath: emitManifestRelPath,\n\t\t\tcontent: emitJson({\n\t\t\t\tname: draft.id,\n\t\t\t\t...(draft.version ? { version: draft.version } : {}),\n\t\t\t\t...(draft.description ? { description: draft.description } : {}),\n\t\t\t\t// Spec: `author` is an object with a required `name`.\n\t\t\t\t...(draft.author ? { author: { name: draft.author } } : {}),\n\t\t\t}),\n\t\t});\n\n\t\tfor (const s of draft.skills ?? []) {\n\t\t\tfiles.push({\n\t\t\t\tpath: path.join(\"skills\", slug(s.name), \"SKILL.md\"),\n\t\t\t\tcontent: emitMarkdown({ name: s.name, description: s.description }, s.body),\n\t\t\t});\n\t\t}\n\t\tfor (const c of draft.commands ?? []) {\n\t\t\tfiles.push({\n\t\t\t\tpath: path.join(\"commands\", `${slug(c.name)}.md`),\n\t\t\t\tcontent: emitMarkdown({ description: c.description }, c.body),\n\t\t\t});\n\t\t}\n\t\tfor (const a of draft.agents ?? []) {\n\t\t\tfiles.push({\n\t\t\t\tpath: path.join(\"agents\", `${slug(a.name)}.md`),\n\t\t\t\tcontent: emitMarkdown({ name: a.name, description: a.description, tools: a.tools, model: a.model }, a.body),\n\t\t\t});\n\t\t}\n\t\tif (draft.mcpServers?.length) {\n\t\t\tfiles.push({\n\t\t\t\tpath: \".mcp.json\",\n\t\t\t\tcontent: emitJson({\n\t\t\t\t\tmcpServers: Object.fromEntries(\n\t\t\t\t\t\tdraft.mcpServers.map((s) => [\n\t\t\t\t\t\t\ts.name,\n\t\t\t\t\t\t\t{ command: s.command, ...(s.args ? { args: s.args } : {}), ...(s.env ? { env: s.env } : {}) },\n\t\t\t\t\t\t]),\n\t\t\t\t\t),\n\t\t\t\t}),\n\t\t\t});\n\t\t}\n\t\tif (draft.hooks?.length) {\n\t\t\tfiles.push({\n\t\t\t\tpath: path.join(\"hooks\", \"hooks.json\"),\n\t\t\t\tcontent: emitJson({ hooks: authoredHooksToConfig(draft.hooks) }),\n\t\t\t});\n\t\t}\n\t\treturn files;\n\t},\n};\n"]}
1
+ {"version":3,"file":"copilot.d.ts","sourceRoot":"","sources":["../../../../../src/core/extensions/plugins/formats/copilot.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA0CG;AAmBH,OAAO,KAAK,EAA4B,mBAAmB,EAAE,MAAM,YAAY,CAAC;AAiDhF,eAAO,MAAM,aAAa,EAAE,mBAoJ3B,CAAC","sourcesContent":["/**\n * GitHub Copilot format.\n *\n * hoocode's preferred Copilot home is the `.github/plugin/` marker directory —\n * the convention used by the real-world plugins indexed by\n * github/copilot-plugins (e.g. microsoft/work-iq) and the documented location\n * for GitHub-hosted marketplaces. The official Copilot CLI plugin reference\n * (docs.github.com copilot/reference/copilot-cli-reference/cli-plugin-reference,\n * \"File locations\"; verified 2026-07) accepts several locations for both files\n * (`.plugin/`, plugin root, `.github/plugin/`, `.claude-plugin/`), so this\n * adapter reads them all — `.github/plugin/` first, then root, then `.plugin/`,\n * then the legacy hoocode layout — and writes `.github/plugin/`.\n * (`.claude-plugin/` belongs to the Claude adapter, which wins precedence, so a\n * `.claude-plugin`-only directory correctly parses as a Claude plugin; Copilot\n * reads those natively anyway.) The capability tree matches the Claude layout:\n *\n * skills skills/<name>/SKILL.md (or the manifest's `skills` path override)\n * commands .github/prompts/<name>.prompt.md (Copilot's prompt-file convention — the\n * analog of a slash command; a manifest\n * `commands` path or `commands/` dir is read too)\n * subagents agents/<name>.agent.md (Copilot's custom-agent convention — the\n * `.agent.md` suffix and a YAML-list `tools`\n * frontmatter are what Copilot recognizes; the\n * reader still accepts bare `.md` names)\n * hooks hooks.json or hooks/hooks.json ({ description?, hooks: { Event: [...] } })\n * MCP servers .mcp.json ({ mcpServers } | { servers })\n *\n * Workspace-level (non-plugin) conventions, per the current GitHub Copilot\n * customization docs (docs.github.com — agent skills, custom agents, prompt\n * files; verified 2026-07):\n *\n * skills .github/skills/<name>/SKILL.md (agentskills.io open standard)\n * custom agents .github/agents/<name>.agent.md (frontmatter: name, description,\n * tools as a YAML list, model, ...)\n * prompt files .github/prompts/<name>.prompt.md (VS Code / Copilot prompt files)\n *\n * Earlier hoocode releases authored a different Copilot mapping\n * (`.github/copilot-plugin.json` + `.github/prompts/*.prompt.md` +\n * `.github/chatmodes/*.chatmode.md`); the reader still accepts that layout as a\n * legacy fallback so previously authored plugins keep loading. Copilot\n * conventions move quickly; this file is the single place that encodes them,\n * so tracking an upstream change never reaches beyond this adapter.\n */\n\nimport * as fs from \"node:fs\";\nimport * as path from \"node:path\";\nimport type { NormalizedPlugin } from \"../manifest.js\";\nimport {\n\tauthoredHooksToConfig,\n\tdirIfExists,\n\temitJson,\n\temitMarkdown,\n\tnormalizeHooks,\n\tnormalizeMcp,\n\tparseAuthor,\n\ttype RawManifest,\n\treadJson,\n\tresolveCapabilityDir,\n\tslug,\n\ttoolsYamlList,\n} from \"./shared.js\";\nimport type { EmittedFile, PluginDraft, PluginFormatAdapter } from \"./types.js\";\n\nconst MARKER_DIR = \".github\";\n/**\n * Manifest probe order: `.github/plugin/plugin.json` first — hoocode's\n * preferred Copilot home, matching the real-world plugins indexed by\n * github/copilot-plugins (e.g. microsoft/work-iq) — then the Copilot CLI\n * reference's other locations (root `plugin.json`, `.plugin/plugin.json`) and\n * hoocode's legacy `.github/copilot-plugin.json`. (`.claude-plugin/plugin.json`,\n * also probed by the CLI, belongs to the Claude adapter.)\n */\nconst MANIFEST_REL_PATHS = [\n\tpath.join(MARKER_DIR, \"plugin\", \"plugin.json\"),\n\t\"plugin.json\",\n\tpath.join(\".plugin\", \"plugin.json\"),\n\tpath.join(MARKER_DIR, \"copilot-plugin.json\"),\n] as const;\n/** Authored manifest location: the preferred `.github/plugin/` home. */\nconst emitManifestRelPath = path.join(MARKER_DIR, \"plugin\", \"plugin.json\");\n\n/**\n * Copilot prompt-file home. `.github/prompts/<name>.prompt.md` is the current\n * Copilot/VS Code prompt-file convention, and hoocode maps a plugin's commands\n * to it (both the writer and this reader), so it is the authored location for\n * commands — not merely a legacy fallback.\n */\nconst PROMPTS_DIR = path.join(MARKER_DIR, \"prompts\");\n// Legacy authored layout (read-only fallbacks).\nconst LEGACY_CHATMODES_DIR = path.join(MARKER_DIR, \"chatmodes\");\nconst LEGACY_MCP_FILE = path.join(MARKER_DIR, \"mcp.json\");\nconst LEGACY_HOOKS_FILE = path.join(MARKER_DIR, \"hooks\", \"hooks.json\");\n\n/** Read a hooks JSON file (either `{ hooks: {...} }` or a bare event map). */\nfunction readHooksFile(root: string, rel: string): NormalizedPlugin[\"hooks\"] {\n\tconst file = path.join(root, rel);\n\tif (!fs.existsSync(file)) return undefined;\n\tconst raw = readJson<{ hooks?: Record<string, unknown> } | Record<string, unknown>>(file);\n\tif (!raw || typeof raw !== \"object\") return undefined;\n\tconst config = (\"hooks\" in raw && raw.hooks ? raw.hooks : raw) as NormalizedPlugin[\"hooks\"];\n\treturn config && Object.keys(config).length > 0 ? config : undefined;\n}\n\nfunction manifestPathFor(root: string): string | undefined {\n\tfor (const rel of MANIFEST_REL_PATHS) {\n\t\tif (readJson(path.join(root, rel)) != null) return path.join(root, rel);\n\t}\n\treturn undefined;\n}\n\nexport const copilotFormat: PluginFormatAdapter = {\n\tid: \"copilot\",\n\tplatform: \"github\",\n\tprecedence: 2,\n\tlabel: \"GitHub Copilot (.github)\",\n\t// .github/plugin/ first (hoocode's preferred Copilot home and the documented\n\t// location for GitHub-hosted marketplaces), then the legacy .github/ spot,\n\t// then the Copilot CLI's other probe locations (root, .plugin/).\n\tmarketplaceFiles: [\n\t\tpath.join(MARKER_DIR, \"plugin\", \"marketplace.json\"),\n\t\tpath.join(MARKER_DIR, \"marketplace.json\"),\n\t\t\"marketplace.json\",\n\t\tpath.join(\".plugin\", \"marketplace.json\"),\n\t],\n\n\tworkspace: {\n\t\troot: MARKER_DIR,\n\t\t// Copilot reads repo skills from .github/skills (also .claude/skills and\n\t\t// .agents/skills, which the sibling adapters cover).\n\t\temitSkill: (s) => ({\n\t\t\tpath: path.join(MARKER_DIR, \"skills\", slug(s.name), \"SKILL.md\"),\n\t\t\tcontent: emitMarkdown({ name: s.name, description: s.description }, s.body),\n\t\t}),\n\t\t// Custom agents take `tools` as a YAML list (not the Claude comma string).\n\t\temitAgent: (a) => ({\n\t\t\tpath: path.join(MARKER_DIR, \"agents\", `${slug(a.name)}.agent.md`),\n\t\t\tcontent: emitMarkdown(\n\t\t\t\t{ name: a.name, description: a.description, tools: toolsYamlList(a.tools), model: a.model },\n\t\t\t\ta.body,\n\t\t\t),\n\t\t}),\n\t\t// The closest Copilot equivalent of a slash command is a prompt file.\n\t\temitCommand: (c) => ({\n\t\t\tpath: path.join(MARKER_DIR, \"prompts\", `${slug(c.name)}.prompt.md`),\n\t\t\tcontent: emitMarkdown({ description: c.description }, c.body),\n\t\t}),\n\t},\n\n\tdetectPlugin(root: string): boolean {\n\t\treturn manifestPathFor(root) !== undefined;\n\t},\n\n\tparsePlugin(root: string): NormalizedPlugin | null {\n\t\tconst manifestPath = manifestPathFor(root);\n\t\tif (!manifestPath) return null;\n\t\tconst raw = readJson<RawManifest>(manifestPath);\n\t\tif (!raw) return null;\n\n\t\tconst id = (raw.name ?? path.basename(root)).trim();\n\t\tif (!id) return null;\n\n\t\treturn {\n\t\t\tid,\n\t\t\tversion: raw.version,\n\t\t\tdescription: raw.description,\n\t\t\tauthor: parseAuthor(raw.author),\n\t\t\troot,\n\t\t\tmanifestPath,\n\t\t\tformat: \"copilot\",\n\t\t\t// Single-format view; the registry widens this to every format present.\n\t\t\tsupportPlatform: [\"github\"],\n\t\t\t// Claude-mirror layout (manifest overrides honored), with the legacy\n\t\t\t// prompts/chatmodes locations as read-only fallbacks.\n\t\t\tskillsDir: resolveCapabilityDir(root, raw.skills, \"skills\"),\n\t\t\t// Commands map to Copilot prompt files at `.github/prompts/`; a manifest\n\t\t\t// `commands` override or a conventional `commands/` dir still wins if present.\n\t\t\tcommandsDir: resolveCapabilityDir(root, raw.commands, \"commands\") ?? dirIfExists(root, PROMPTS_DIR),\n\t\t\tagentsDir: resolveCapabilityDir(root, raw.agents, \"agents\") ?? dirIfExists(root, LEGACY_CHATMODES_DIR),\n\t\t\tthemesDir: resolveCapabilityDir(root, raw.themes, \"themes\"),\n\t\t\t// Copilot CLI plugins put hooks config at root `hooks.json`; normalizeHooks\n\t\t\t// covers the Claude-mirror `hooks/hooks.json`, then the legacy location.\n\t\t\thooks:\n\t\t\t\tnormalizeHooks(raw.hooks, root) ??\n\t\t\t\treadHooksFile(root, \"hooks.json\") ??\n\t\t\t\treadHooksFile(root, LEGACY_HOOKS_FILE),\n\t\t\tmcpServers: normalizeMcp(raw.mcpServers, root) ?? normalizeMcp(undefined, root, LEGACY_MCP_FILE),\n\t\t\t// Providers are a native-only concept.\n\t\t\tproviders: undefined,\n\t\t};\n\t},\n\n\temit(draft: PluginDraft): EmittedFile[] {\n\t\t// Only the manifest is Copilot-specific — the canonical location is root\n\t\t// `plugin.json` (Copilot CLI spec) — and the capability tree mirrors the\n\t\t// Claude layout, so a plugin authored for both platforms is one tree with a\n\t\t// root manifest for Copilot and a .claude-plugin/ manifest for Claude.\n\t\tconst files: EmittedFile[] = [];\n\n\t\tfiles.push({\n\t\t\tpath: emitManifestRelPath,\n\t\t\tcontent: emitJson({\n\t\t\t\tname: draft.id,\n\t\t\t\t...(draft.version ? { version: draft.version } : {}),\n\t\t\t\t...(draft.description ? { description: draft.description } : {}),\n\t\t\t\t// Spec: `author` is an object with a required `name`.\n\t\t\t\t...(draft.author ? { author: { name: draft.author } } : {}),\n\t\t\t}),\n\t\t});\n\n\t\tfor (const s of draft.skills ?? []) {\n\t\t\tfiles.push({\n\t\t\t\tpath: path.join(\"skills\", slug(s.name), \"SKILL.md\"),\n\t\t\t\tcontent: emitMarkdown({ name: s.name, description: s.description }, s.body),\n\t\t\t});\n\t\t}\n\t\tfor (const c of draft.commands ?? []) {\n\t\t\t// Copilot's analog of a slash command is a prompt file:\n\t\t\t// `.github/prompts/<name>.prompt.md` (docs.github.com prompt files;\n\t\t\t// verified 2026-07) — same target as this adapter's workspace.emitCommand.\n\t\t\tfiles.push({\n\t\t\t\tpath: path.join(PROMPTS_DIR, `${slug(c.name)}.prompt.md`),\n\t\t\t\tcontent: emitMarkdown({ description: c.description }, c.body),\n\t\t\t});\n\t\t}\n\t\tfor (const a of draft.agents ?? []) {\n\t\t\t// Copilot recognizes custom agents by the `.agent.md` suffix, and takes\n\t\t\t// `tools` as a YAML list (not the Claude comma string) — matching this\n\t\t\t// adapter's workspace.emitAgent and the current GitHub Copilot docs\n\t\t\t// (docs.github.com custom agents / plugins-creating; verified 2026-07).\n\t\t\tfiles.push({\n\t\t\t\tpath: path.join(\"agents\", `${slug(a.name)}.agent.md`),\n\t\t\t\tcontent: emitMarkdown(\n\t\t\t\t\t{ name: a.name, description: a.description, tools: toolsYamlList(a.tools), model: a.model },\n\t\t\t\t\ta.body,\n\t\t\t\t),\n\t\t\t});\n\t\t}\n\t\tif (draft.mcpServers?.length) {\n\t\t\tfiles.push({\n\t\t\t\tpath: \".mcp.json\",\n\t\t\t\tcontent: emitJson({\n\t\t\t\t\tmcpServers: Object.fromEntries(\n\t\t\t\t\t\tdraft.mcpServers.map((s) => [\n\t\t\t\t\t\t\ts.name,\n\t\t\t\t\t\t\t{ command: s.command, ...(s.args ? { args: s.args } : {}), ...(s.env ? { env: s.env } : {}) },\n\t\t\t\t\t\t]),\n\t\t\t\t\t),\n\t\t\t\t}),\n\t\t\t});\n\t\t}\n\t\tif (draft.hooks?.length) {\n\t\t\tfiles.push({\n\t\t\t\tpath: path.join(\"hooks\", \"hooks.json\"),\n\t\t\t\tcontent: emitJson({ hooks: authoredHooksToConfig(draft.hooks) }),\n\t\t\t});\n\t\t}\n\t\treturn files;\n\t},\n};\n"]}
@@ -15,8 +15,13 @@
15
15
  * reads those natively anyway.) The capability tree matches the Claude layout:
16
16
  *
17
17
  * skills skills/<name>/SKILL.md (or the manifest's `skills` path override)
18
- * commands commands/<name>.md
19
- * subagents agents/<name>.md (Copilot also emits/reads `.agent.md` names)
18
+ * commands .github/prompts/<name>.prompt.md (Copilot's prompt-file convention — the
19
+ * analog of a slash command; a manifest
20
+ * `commands` path or `commands/` dir is read too)
21
+ * subagents agents/<name>.agent.md (Copilot's custom-agent convention — the
22
+ * `.agent.md` suffix and a YAML-list `tools`
23
+ * frontmatter are what Copilot recognizes; the
24
+ * reader still accepts bare `.md` names)
20
25
  * hooks hooks.json or hooks/hooks.json ({ description?, hooks: { Event: [...] } })
21
26
  * MCP servers .mcp.json ({ mcpServers } | { servers })
22
27
  *
@@ -56,8 +61,14 @@ const MANIFEST_REL_PATHS = [
56
61
  ];
57
62
  /** Authored manifest location: the preferred `.github/plugin/` home. */
58
63
  const emitManifestRelPath = path.join(MARKER_DIR, "plugin", "plugin.json");
64
+ /**
65
+ * Copilot prompt-file home. `.github/prompts/<name>.prompt.md` is the current
66
+ * Copilot/VS Code prompt-file convention, and hoocode maps a plugin's commands
67
+ * to it (both the writer and this reader), so it is the authored location for
68
+ * commands — not merely a legacy fallback.
69
+ */
70
+ const PROMPTS_DIR = path.join(MARKER_DIR, "prompts");
59
71
  // Legacy authored layout (read-only fallbacks).
60
- const LEGACY_PROMPTS_DIR = path.join(MARKER_DIR, "prompts");
61
72
  const LEGACY_CHATMODES_DIR = path.join(MARKER_DIR, "chatmodes");
62
73
  const LEGACY_MCP_FILE = path.join(MARKER_DIR, "mcp.json");
63
74
  const LEGACY_HOOKS_FILE = path.join(MARKER_DIR, "hooks", "hooks.json");
@@ -138,7 +149,9 @@ export const copilotFormat = {
138
149
  // Claude-mirror layout (manifest overrides honored), with the legacy
139
150
  // prompts/chatmodes locations as read-only fallbacks.
140
151
  skillsDir: resolveCapabilityDir(root, raw.skills, "skills"),
141
- commandsDir: resolveCapabilityDir(root, raw.commands, "commands") ?? dirIfExists(root, LEGACY_PROMPTS_DIR),
152
+ // Commands map to Copilot prompt files at `.github/prompts/`; a manifest
153
+ // `commands` override or a conventional `commands/` dir still wins if present.
154
+ commandsDir: resolveCapabilityDir(root, raw.commands, "commands") ?? dirIfExists(root, PROMPTS_DIR),
142
155
  agentsDir: resolveCapabilityDir(root, raw.agents, "agents") ?? dirIfExists(root, LEGACY_CHATMODES_DIR),
143
156
  themesDir: resolveCapabilityDir(root, raw.themes, "themes"),
144
157
  // Copilot CLI plugins put hooks config at root `hooks.json`; normalizeHooks
@@ -174,15 +187,22 @@ export const copilotFormat = {
174
187
  });
175
188
  }
176
189
  for (const c of draft.commands ?? []) {
190
+ // Copilot's analog of a slash command is a prompt file:
191
+ // `.github/prompts/<name>.prompt.md` (docs.github.com prompt files;
192
+ // verified 2026-07) — same target as this adapter's workspace.emitCommand.
177
193
  files.push({
178
- path: path.join("commands", `${slug(c.name)}.md`),
194
+ path: path.join(PROMPTS_DIR, `${slug(c.name)}.prompt.md`),
179
195
  content: emitMarkdown({ description: c.description }, c.body),
180
196
  });
181
197
  }
182
198
  for (const a of draft.agents ?? []) {
199
+ // Copilot recognizes custom agents by the `.agent.md` suffix, and takes
200
+ // `tools` as a YAML list (not the Claude comma string) — matching this
201
+ // adapter's workspace.emitAgent and the current GitHub Copilot docs
202
+ // (docs.github.com custom agents / plugins-creating; verified 2026-07).
183
203
  files.push({
184
- path: path.join("agents", `${slug(a.name)}.md`),
185
- content: emitMarkdown({ name: a.name, description: a.description, tools: a.tools, model: a.model }, a.body),
204
+ path: path.join("agents", `${slug(a.name)}.agent.md`),
205
+ content: emitMarkdown({ name: a.name, description: a.description, tools: toolsYamlList(a.tools), model: a.model }, a.body),
186
206
  });
187
207
  }
188
208
  if (draft.mcpServers?.length) {