@ashx-j/lunr 0.2.9 → 0.2.10

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 (108) hide show
  1. package/dist/builtin-extensions/ashxj-spinners.d.ts +1 -4
  2. package/dist/builtin-extensions/ashxj-spinners.d.ts.map +1 -1
  3. package/dist/builtin-extensions/ashxj-spinners.js +3 -29
  4. package/dist/builtin-extensions/ashxj-spinners.js.map +1 -1
  5. package/dist/builtin-extensions/ashxj-tui.d.ts.map +1 -1
  6. package/dist/builtin-extensions/ashxj-tui.js +5 -4
  7. package/dist/builtin-extensions/ashxj-tui.js.map +1 -1
  8. package/dist/builtin-extensions/pi-subagents/src/extension/schemas.d.ts.map +1 -1
  9. package/dist/builtin-extensions/pi-subagents/src/extension/schemas.js +2 -2
  10. package/dist/builtin-extensions/pi-subagents/src/extension/schemas.js.map +1 -1
  11. package/dist/builtin-extensions/pi-subagents/src/extension/tool-description.d.ts +1 -1
  12. package/dist/builtin-extensions/pi-subagents/src/extension/tool-description.d.ts.map +1 -1
  13. package/dist/builtin-extensions/pi-subagents/src/extension/tool-description.js +1 -1
  14. package/dist/builtin-extensions/pi-subagents/src/extension/tool-description.js.map +1 -1
  15. package/dist/builtin-extensions/pi-subagents/src/runs/foreground/execution.d.ts.map +1 -1
  16. package/dist/builtin-extensions/pi-subagents/src/runs/foreground/execution.js +5 -1
  17. package/dist/builtin-extensions/pi-subagents/src/runs/foreground/execution.js.map +1 -1
  18. package/dist/builtin-extensions/pi-subagents/src/runs/shared/parallel-utils.d.ts +2 -2
  19. package/dist/builtin-extensions/pi-subagents/src/runs/shared/parallel-utils.d.ts.map +1 -1
  20. package/dist/builtin-extensions/pi-subagents/src/runs/shared/parallel-utils.js +2 -2
  21. package/dist/builtin-extensions/pi-subagents/src/runs/shared/parallel-utils.js.map +1 -1
  22. package/dist/builtin-extensions/pi-subagents/src/shared/types.d.ts +2 -2
  23. package/dist/builtin-extensions/pi-subagents/src/shared/types.d.ts.map +1 -1
  24. package/dist/builtin-extensions/pi-subagents/src/shared/types.js +2 -2
  25. package/dist/builtin-extensions/pi-subagents/src/shared/types.js.map +1 -1
  26. package/dist/builtin-extensions/pi-subagents/src/tui/render.d.ts +4 -6
  27. package/dist/builtin-extensions/pi-subagents/src/tui/render.d.ts.map +1 -1
  28. package/dist/builtin-extensions/pi-subagents/src/tui/render.js +26 -18
  29. package/dist/builtin-extensions/pi-subagents/src/tui/render.js.map +1 -1
  30. package/dist/builtin-extensions/pi-web-access/index.d.ts.map +1 -1
  31. package/dist/builtin-extensions/pi-web-access/index.js +3 -1
  32. package/dist/builtin-extensions/pi-web-access/index.js.map +1 -1
  33. package/dist/catalog/models.json +1 -1
  34. package/dist/catalog/providers/nvidia.json +1 -1
  35. package/dist/catalog/providers/opencode-go.json +1 -1
  36. package/dist/catalog/providers/opencode.json +1 -1
  37. package/dist/catalog/providers/openrouter.json +1 -1
  38. package/dist/catalog/providers/qwen-cloud-cn.json +1 -1
  39. package/dist/catalog/providers/vercel-ai-gateway.json +1 -1
  40. package/dist/catalog/providers/xai.json +1 -1
  41. package/dist/catalog/publication.json +3 -3
  42. package/dist/core/agent-session.d.ts +2 -0
  43. package/dist/core/agent-session.d.ts.map +1 -1
  44. package/dist/core/agent-session.js +9 -1
  45. package/dist/core/agent-session.js.map +1 -1
  46. package/dist/core/customize.d.ts +1 -0
  47. package/dist/core/customize.d.ts.map +1 -1
  48. package/dist/core/customize.js +3 -0
  49. package/dist/core/customize.js.map +1 -1
  50. package/dist/core/settings-manager.d.ts +3 -0
  51. package/dist/core/settings-manager.d.ts.map +1 -1
  52. package/dist/core/settings-manager.js +8 -0
  53. package/dist/core/settings-manager.js.map +1 -1
  54. package/dist/core/tools/bash.d.ts.map +1 -1
  55. package/dist/core/tools/bash.js +2 -1
  56. package/dist/core/tools/bash.js.map +1 -1
  57. package/dist/core/tools/edit.d.ts.map +1 -1
  58. package/dist/core/tools/edit.js +9 -6
  59. package/dist/core/tools/edit.js.map +1 -1
  60. package/dist/core/tools/find.d.ts.map +1 -1
  61. package/dist/core/tools/find.js +2 -1
  62. package/dist/core/tools/find.js.map +1 -1
  63. package/dist/core/tools/grep.d.ts.map +1 -1
  64. package/dist/core/tools/grep.js +2 -1
  65. package/dist/core/tools/grep.js.map +1 -1
  66. package/dist/core/tools/ls.d.ts.map +1 -1
  67. package/dist/core/tools/ls.js +2 -1
  68. package/dist/core/tools/ls.js.map +1 -1
  69. package/dist/core/tools/read.d.ts.map +1 -1
  70. package/dist/core/tools/read.js +2 -1
  71. package/dist/core/tools/read.js.map +1 -1
  72. package/dist/core/tools/render-utils.d.ts +13 -3
  73. package/dist/core/tools/render-utils.d.ts.map +1 -1
  74. package/dist/core/tools/render-utils.js +10 -2
  75. package/dist/core/tools/render-utils.js.map +1 -1
  76. package/dist/core/tools/write.d.ts.map +1 -1
  77. package/dist/core/tools/write.js +5 -3
  78. package/dist/core/tools/write.js.map +1 -1
  79. package/dist/gateway/agent-bridge.d.ts +1 -0
  80. package/dist/gateway/agent-bridge.d.ts.map +1 -1
  81. package/dist/gateway/agent-bridge.js.map +1 -1
  82. package/dist/modes/interactive/components/settings-selector.d.ts +2 -0
  83. package/dist/modes/interactive/components/settings-selector.d.ts.map +1 -1
  84. package/dist/modes/interactive/components/settings-selector.js +11 -1
  85. package/dist/modes/interactive/components/settings-selector.js.map +1 -1
  86. package/dist/modes/interactive/components/thinking-tail.d.ts +1 -0
  87. package/dist/modes/interactive/components/thinking-tail.d.ts.map +1 -1
  88. package/dist/modes/interactive/components/thinking-tail.js +2 -6
  89. package/dist/modes/interactive/components/thinking-tail.js.map +1 -1
  90. package/dist/modes/interactive/components/tool-execution.d.ts +6 -0
  91. package/dist/modes/interactive/components/tool-execution.d.ts.map +1 -1
  92. package/dist/modes/interactive/components/tool-execution.js +75 -16
  93. package/dist/modes/interactive/components/tool-execution.js.map +1 -1
  94. package/dist/modes/interactive/interactive-mode.d.ts +15 -1
  95. package/dist/modes/interactive/interactive-mode.d.ts.map +1 -1
  96. package/dist/modes/interactive/interactive-mode.js +139 -34
  97. package/dist/modes/interactive/interactive-mode.js.map +1 -1
  98. package/docs/terminal-setup.md +2 -2
  99. package/examples/extensions/custom-provider-anthropic/package-lock.json +2 -2
  100. package/examples/extensions/custom-provider-anthropic/package.json +1 -1
  101. package/examples/extensions/custom-provider-gitlab-duo/package.json +1 -1
  102. package/examples/extensions/gondolin/package-lock.json +2 -2
  103. package/examples/extensions/gondolin/package.json +1 -1
  104. package/examples/extensions/sandbox/package-lock.json +2 -2
  105. package/examples/extensions/sandbox/package.json +1 -1
  106. package/examples/extensions/with-deps/package-lock.json +2 -2
  107. package/examples/extensions/with-deps/package.json +1 -1
  108. package/package.json +4 -4
@@ -1 +1 @@
1
- {"version":3,"file":"ashxj-tui.js","sourceRoot":"","sources":["../../src/builtin-extensions/ashxj-tui.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA+BG;AAEH,OAAO,EAAE,YAAY,EAAE,MAAM,kDAAkD,CAAC;AAEhF,uFAAmF;AACnF,MAAM,oBAAoB,GAAG,MAAM,CAAC,GAAG,CAAC,iBAAiB,CAAC,CAAC;AAC3D,MAAM,sBAAsB,GAAG,MAAM,CAAC,GAAG,CAAC,uBAAuB,CAAC,CAAC;AAgBnE,SAAS,mBAAmB,GAAyC;IACpE,OAAQ,UAAsC,CAAC,oBAAoB,CAAyC,CAAC;AAAA,CAC7G;AACD,SAAS,wBAAwB,GAA8C;IAC9E,OAAQ,UAAsC,CAAC,sBAAsB,CAA8C,CAAC;AAAA,CACpH;AACD,SAAS,uBAAuB,GAAY;IAC3C,OAAO,mBAAmB,EAAE,EAAE,eAAe,EAAE,IAAI,KAAK,CAAC;AAAA,CACzD;AACD,kFAAkF;AAClF,8EAA8E;AAC9E,SAAS,iBAAiB,GASxB;IACD,MAAM,MAAM,GAAG,mBAAmB,EAAE,CAAC;IACrC,OAAO;QACN,GAAG,EAAE,MAAM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C;QAC1C,IAAI,CAAC;YACJ,IAAI,OAAO,GAAG,CAAC,EAAE,EAAE,kBAAkB,KAAK,UAAU;gBAAE,GAAG,CAAC,EAAE,CAAC,kBAAkB,CAAC,SAAS,CAAC,CAAC;QAC5F,CAAC;QAAC,MAAM,CAAC;YACR,YAAY;QACb,CAAC;QACD,IAAI,CAAC;YACJ,IAAI,OAAO,GAAG,CAAC,EAAE,EAAE,SAAS,KAAK,UAAU;gBAAE,GAAG,CAAC,EAAE,CAAC,SAAS,CAAC,SAAS,CAAC,CAAC;QAC1E,CAAC;QAAC,MAAM,CAAC;YACR,YAAY;QACb,CAAC;QACD,eAAe,GAAG,SAAS,CAAC;IAAA,CAC5B,CAAC,CAAC;IAEH,6EAA6E;IAC7E,sDAAsD;IACtD,MAAM,cAAc,GAAG;QACtB,cAAc;QACd,uBAAuB;QACvB,WAAW;QACX,aAAa;QACb,oBAAoB;QACpB,iBAAiB;KACjB,CAAC;IACF,KAAK,MAAM,EAAE,IAAI,cAAc,EAAE,CAAC;QACjC,EAAE,CAAC,EAAE,CAAC,EAAE,EAAE,GAAG,EAAE,CAAC,aAAa,EAAE,CAAC,CAAC;IAClC,CAAC;AAAA,CACD","sourcesContent":["/**\n * ashxj-tui — a custom slim chatbox for pi.\n *\n * Replaces pi-zentui's prompt box + statusline with:\n * - A rounded prompt box that auto-expands as the typed message wraps to\n * multiple rows (the sides extend; height grows with content).\n * - A right-aligned chip on the box's BOTTOM border:\n * model · provider · effort (e.g. `glm-5.2 · Ollama Cloud · xhigh`)\n * - A slim stats line (extension statuses · context% · ↑↓; each segment\n * toggle-gated via the lunr customize bridge) BELOW the box, not wrapped\n * around the input.\n * - No session-mode indicator anywhere (pi has no such concept).\n *\n * Loaded by pi via jiti — no build step, plain TypeScript.\n *\n * NOTE on type imports (see `ashxj-thinking`/`simple-memory` for the convention):\n * This file declares structural types inline rather than importing them from\n * `@ashx-j/lunr` / `@ashx-j/lunr-tui`.\n * pi-coding-agent's `index.d.ts` re-exports from internal `.d.ts` files that\n * contain subpath imports like `@ashx-j/lunr-ai/compat`, which do not\n * resolve under `tsc` with a file argument. We keep the typecheck\n * self-contained with inline types and verify via the included `tsconfig.json`\n * (`moduleResolution: \"Bundler\"` + `skipLibCheck: true`).\n *\n * The ONE exception is `CustomEditor`, imported as a RUNTIME VALUE directly\n * from its defining module (`modes/interactive/components/custom-editor.ts`).\n * We must `extends` it to inherit pi's app keybindings (escape, ctrl+d, model\n * switching, extension shortcuts) — wrapping would lose those. It is imported\n * from the concrete module, NOT the package barrel, because the barrel\n * re-exports main.ts which imports this file — a circular import that crashes\n * under vite-node (`Class extends value undefined`).\n */\n\nimport { CustomEditor } from \"../modes/interactive/components/custom-editor.js\";\n\n// lunr: customize bridge — read the prompt-symbol toggle (bridgeless → no symbol).\nconst PROMPT_SYMBOL_BRIDGE = Symbol.for(\"@lunr/customize\");\nconst PERMISSION_MODE_BRIDGE = Symbol.for(\"@lunr/permission-mode\");\ninterface CustomizeBridgeForPrompt {\n\tgetPromptSymbol(): boolean;\n\t// lunr: footer element toggles (added to the same bridge).\n\tgetFooterMcp?(): boolean;\n\tgetFooterLsp?(): boolean;\n\tgetFooterContext?(): boolean;\n\tgetFooterTokens?(): boolean;\n\tgetFooterStatuses?(): boolean;\n\tgetFooterGit?(): boolean;\n\tgetFooterPlan?(): boolean;\n\tgetFooterPlanBar?(): boolean;\n}\ninterface PermissionModeBridgeForFooter {\n\tgetMode(): string | undefined;\n}\nfunction lunrCustomizeBridge(): CustomizeBridgeForPrompt | undefined {\n\treturn (globalThis as Record<symbol, unknown>)[PROMPT_SYMBOL_BRIDGE] as CustomizeBridgeForPrompt | undefined;\n}\nfunction lunrPermissionModeBridge(): PermissionModeBridgeForFooter | undefined {\n\treturn (globalThis as Record<symbol, unknown>)[PERMISSION_MODE_BRIDGE] as PermissionModeBridgeForFooter | undefined;\n}\nfunction lunrPromptSymbolEnabled(): boolean {\n\treturn lunrCustomizeBridge()?.getPromptSymbol() ?? false;\n}\n// lunr: footer toggles, read at render time. Bridgeless / missing-getter fallback\n// matches the settings-manager defaults: MCP on, LSP off, everything else on.\nfunction lunrFooterToggles(): {\n\tmcp: boolean;\n\tlsp: boolean;\n\tcontext: boolean;\n\ttokens: boolean;\n\tstatuses: boolean;\n\tgit: boolean;\n\tplan: boolean;\n\tplanBar: boolean;\n} {\n\tconst bridge = lunrCustomizeBridge();\n\treturn {\n\t\tmcp: bridge?.getFooterMcp?.() ?? true,\n\t\tlsp: bridge?.getFooterLsp?.() ?? false,\n\t\tcontext: bridge?.getFooterContext?.() ?? true,\n\t\ttokens: bridge?.getFooterTokens?.() ?? true,\n\t\tstatuses: bridge?.getFooterStatuses?.() ?? true,\n\t\tgit: bridge?.getFooterGit?.() ?? true,\n\t\tplan: bridge?.getFooterPlan?.() ?? true,\n\t\tplanBar: bridge?.getFooterPlanBar?.() ?? true,\n\t};\n}\n\nconst USAGE_SERVICE_BRIDGE = Symbol.for(\"@lunr/usage-service\");\ninterface UsageServiceBridgeForFooter {\n\tpickForFooter?(providerId: string): { label: string; usedPercent: number } | undefined;\n\tprefetch?(providerId: string): void;\n}\nfunction lunrUsageBridge(): UsageServiceBridgeForFooter | undefined {\n\treturn (globalThis as Record<symbol, unknown>)[USAGE_SERVICE_BRIDGE] as UsageServiceBridgeForFooter | undefined;\n}\n\nfunction compactPlanBar(percent: number, theme: Theme): string {\n\tconst cells = 8;\n\tconst clamped = Math.max(0, Math.min(100, percent));\n\tconst filled = Math.round((clamped / 100) * cells);\n\tconst token = clamped > 90 ? \"error\" : clamped > 70 ? \"warning\" : \"success\";\n\tconst fill = filled > 0 ? color(theme, token, \"█\".repeat(filled)) : \"\";\n\tconst rest = filled < cells ? color(theme, \"dim\", \"░\".repeat(cells - filled)) : \"\";\n\treturn fill + rest;\n}\n// lunr: permission mode for the footer safety indicator (always shown).\nfunction lunrPermissionMode(): string | undefined {\n\treturn lunrPermissionModeBridge()?.getMode();\n}\n// lunr: prompt glyph comes from the theme tokens `glyphs.promptMoon` /\n// `glyphs.promptArrow` (defaults below match moon.json). An empty token hides\n// that part; both empty = no glyph at all.\nfunction lunrPromptGlyph(theme: Theme | undefined): string {\n\tconst moon = theme?.glyph?.(\"promptMoon\") ?? \"☾\";\n\tconst arrow = theme?.glyph?.(\"promptArrow\") ?? \">\";\n\tconst parts = [moon, arrow].filter((s) => s !== \"\");\n\treturn parts.length > 0 ? `${parts.join(\" \")} ` : \"\";\n}\n\n// ---------------------------------------------------------------------------\n// Minimal structural types (inline — see file header)\n// ---------------------------------------------------------------------------\n\ntype ThinkingLevel = \"off\" | \"minimal\" | \"low\" | \"medium\" | \"high\" | \"xhigh\" | \"max\";\n\n/** Theme token for the chatbox thinking-level border / effort chip. */\nexport function thinkingThemeToken(level: ThinkingLevel): string {\n\tswitch (level) {\n\t\tcase \"off\":\n\t\t\treturn \"thinkingOff\";\n\t\tcase \"minimal\":\n\t\t\treturn \"thinkingMinimal\";\n\t\tcase \"low\":\n\t\t\treturn \"thinkingLow\";\n\t\tcase \"medium\":\n\t\t\treturn \"thinkingMedium\";\n\t\tcase \"high\":\n\t\t\treturn \"thinkingHigh\";\n\t\tcase \"xhigh\":\n\t\t\treturn \"thinkingXhigh\";\n\t\tcase \"max\":\n\t\t\treturn \"thinkingMax\";\n\t\tdefault:\n\t\t\treturn \"thinkingOff\";\n\t}\n}\n\n/** Chip effort label — identity, locked so xhigh/max are never mapped down to high. */\nexport function formatChipEffort(level: ThinkingLevel): string {\n\treturn level;\n}\n\n/** Trimmed view of pi's `Theme` — only the methods we use. */\ninterface Theme {\n\tfg(token: string, text: string): string;\n\t/** lunr: prompt glyph tokens (optional for forward/backward compat). */\n\tglyph?(name: \"promptMoon\" | \"promptArrow\"): string;\n}\n\n/** Trimmed view of `pi-tui`'s `TUI` — only the method we use. */\ninterface TUIHandle {\n\trequestRender(force?: boolean): void;\n}\n\n/** Trimmed view of `pi-tui`'s `EditorTheme`. */\ninterface EditorThemeLike {\n\tborderColor: (str: string) => string;\n\tselectList: unknown;\n}\n\n/** Opaque keybindings manager. */\ninterface KeybindingsLike {\n\treadonly _?: unknown;\n}\n\n/** Trimmed view of an autocomplete list (the editor's private `autocompleteList`). */\ninterface AutocompleteListLike {\n\trender(width: number): string[];\n}\n\n/** Trimmed view of pi's `ReadonlyFooterDataProvider`. */\ninterface ReadonlyFooterDataProvider {\n\tgetGitBranch(): string | null;\n\tgetGitDiffstat?(): { added: number; removed: number } | null;\n\tgetExtensionStatuses(): ReadonlyMap<string, string>;\n\tgetAvailableProviderCount(): number;\n\tonBranchChange(callback: () => void): () => void;\n}\n\n/** Trimmed view of the `getContextUsage` return value. */\ninterface ContextUsage {\n\ttokens: number | null;\n\tcontextWindow: number;\n\tpercent: number | null;\n}\n\n/** Trimmed view of an assistant message's usage — the bits we render. */\ninterface AssistantUsage {\n\tinput: number;\n\toutput: number;\n\tcost: { total: number };\n}\n\n/** Trimmed view of an assistant message. */\ninterface AssistantMessageLike {\n\trole: \"assistant\";\n\tusage: AssistantUsage;\n}\n\n/** Trimmed view of a session entry — only what we iterate over. */\ntype SessionEntry =\n\t| { type: \"message\"; message: AssistantMessageLike }\n\t| { type: string; message?: unknown };\n\n/** Trimmed view of a `ReadonlySessionManager`. */\ninterface ReadonlySessionManagerLike {\n\tgetEntries(): readonly SessionEntry[];\n\tgetBranch?(): readonly SessionEntry[];\n}\n\n/** Trimmed view of a `Model`. */\ninterface ModelLike {\n\tid?: string;\n\tprovider?: string;\n\tcontextWindow?: number;\n\treasoning?: boolean;\n\tthinkingLevelMap?: Record<string, string | null>;\n}\n\ninterface ExtensionUIContextLike {\n\tsetEditorComponent(factory: EditorFactoryLike | undefined): void;\n\tsetFooter(factory: FooterFactoryLike | undefined): void;\n\treadonly theme?: Theme;\n}\n\n/** Trimmed view of `ExtensionContext`. */\ninterface ExtensionContextLike {\n\tmode: \"tui\" | \"rpc\" | \"json\" | \"print\";\n\thasUI: boolean;\n\tmodel: ModelLike | undefined;\n\tsessionManager: ReadonlySessionManagerLike;\n\tgetContextUsage(): ContextUsage | undefined;\n\tui: ExtensionUIContextLike;\n}\n\n/** Trimmed view of `ExtensionAPI`. */\ninterface ExtensionAPI {\n\tgetThinkingLevel(): ThinkingLevel;\n\ton(event: string, handler: (event: unknown, ctx: ExtensionContextLike) => void): void;\n}\n\n/** `setEditorComponent` factory shape. */\ntype EditorFactoryLike = (\n\ttui: TUIHandle,\n\ttheme: EditorThemeLike,\n\tkeybindings: KeybindingsLike,\n) => EditorComponentLike;\n\ninterface EditorComponentLike {\n\trender(width: number): string[];\n\tgetText(): string;\n\tsetText(text: string): void;\n\tinvalidate(): void;\n\thandleInput?(data: string): void;\n}\n\n/** `setFooter` factory shape. */\ntype FooterFactoryLike = (\n\ttui: TUIHandle,\n\ttheme: Theme,\n\tfooterData: ReadonlyFooterDataProvider,\n) => FooterComponentLike;\n\ninterface FooterComponentLike {\n\trender(width: number): string[];\n\tdispose?(): void;\n\tinvalidate?(): void;\n}\n\n// ---------------------------------------------------------------------------\n// Display-width helpers (ANSI-aware; CJK-aware)\n//\n// The editor (`Editor.render`) word-wraps to the given width using grapheme\n// width, so each returned line is ≤ that many visual columns. To right-pad a\n// line for our box we need a width model that matches closely enough: skip ALL\n// escape sequences (SGR color, OSC/DCS/APC/PM/SOS string sequences such as\n// pi-tui's `CURSOR_MARKER` `ESC _pi:c BEL`, and two-char escapes), count common\n// East-Asian wide ranges as 2, combining marks and variation selectors as 0.\n// Handling the string sequences as 0-width is what keeps the right `│` rail\n// aligned on the focused (cursor) line — the base editor embeds the marker and\n// the TUI strips it at flush time, so we must not count it here.\n// ---------------------------------------------------------------------------\n\nfunction skipAnsi(str: string, pos: number): number {\n\tif (str.charCodeAt(pos) !== 0x1b) return 0;\n\tconst next = str.charCodeAt(pos + 1);\n\t// CSI: ESC [ ... <final 0x40-0x7e>\n\tif (next === 0x5b /* [ */) {\n\t\tlet j = pos + 2;\n\t\twhile (j < str.length) {\n\t\t\tconst c = str.charCodeAt(j);\n\t\t\tif (c >= 0x40 && c <= 0x7e) return j + 1 - pos;\n\t\t\tj++;\n\t\t}\n\t\treturn str.length - pos; // unterminated; consume the rest\n\t}\n\t// String sequences — OSC (]), DCS (P), APC (_), PM (^), SOS (X) — terminated\n\t// by BEL (0x07) or ST (ESC \\). pi-tui's CURSOR_MARKER `ESC _pi:c BEL` is APC;\n\t// OSC color queries are OSC. All are zero visual width.\n\tif (\n\t\tnext === 0x5d /* ] */ ||\n\t\tnext === 0x50 /* P */ ||\n\t\tnext === 0x5f /* _ */ ||\n\t\tnext === 0x5e /* ^ */ ||\n\t\tnext === 0x58 /* X */\n\t) {\n\t\tlet j = pos + 2;\n\t\twhile (j < str.length) {\n\t\t\tconst c = str.charCodeAt(j);\n\t\t\tif (c === 0x07 /* BEL */) return j + 1 - pos;\n\t\t\tif (c === 0x1b && str.charCodeAt(j + 1) === 0x5c /* \\ */) return j + 2 - pos;\n\t\t\tj++;\n\t\t}\n\t\treturn str.length - pos; // unterminated; consume the rest\n\t}\n\t// Any other ESC sequence: consume ESC + one final byte (e.g. ESC c, ESC \\,\n\t// ESC ( B). A lone trailing ESC with no following byte is 0 width too.\n\treturn Number.isNaN(next) ? 1 : 2;\n}\n\nfunction isWide(cp: number): boolean {\n\treturn (\n\t\t(cp >= 0x1100 && cp <= 0x115f) ||\n\t\t(cp >= 0x2e80 && cp <= 0x303e) ||\n\t\t(cp >= 0x3041 && cp <= 0x33ff) ||\n\t\t(cp >= 0x3400 && cp <= 0x4dbf) ||\n\t\t(cp >= 0x4e00 && cp <= 0x9fff) ||\n\t\t(cp >= 0xa000 && cp <= 0xa4cf) ||\n\t\t(cp >= 0xac00 && cp <= 0xd7a3) ||\n\t\t(cp >= 0xf900 && cp <= 0xfaff) ||\n\t\t(cp >= 0xfe30 && cp <= 0xfe4f) ||\n\t\t(cp >= 0xff00 && cp <= 0xff60) ||\n\t\t(cp >= 0xffe0 && cp <= 0xffe6) ||\n\t\t(cp >= 0x1f300 && cp <= 0x1faff) ||\n\t\t(cp >= 0x20000 && cp <= 0x3fffd)\n\t);\n}\n\nfunction charWidth(cp: number): number {\n\tif (cp >= 0x20 && cp < 0x7f) return 1;\n\tif ((cp >= 0x0300 && cp <= 0x036f) || (cp >= 0xfe00 && cp <= 0xfe0f) || cp === 0x200d) return 0;\n\treturn isWide(cp) ? 2 : 1;\n}\n\n/** Visible width of a string, ignoring SGR color codes. */\nfunction displayWidth(str: string): number {\n\tlet w = 0;\n\tlet i = 0;\n\twhile (i < str.length) {\n\t\tconst skip = skipAnsi(str, i);\n\t\tif (skip > 0) {\n\t\t\ti += skip;\n\t\t\tcontinue;\n\t\t}\n\t\tconst cp = str.codePointAt(i) ?? 0;\n\t\tw += charWidth(cp);\n\t\ti += cp > 0xffff ? 2 : 1;\n\t}\n\treturn w;\n}\n\n/** Right-pad a (possibly colored) line to `width` visible columns. */\nfunction padRight(line: string, width: number): string {\n\tconst w = displayWidth(line);\n\tif (w >= width) return line;\n\treturn line + \" \".repeat(width - w);\n}\n\n/** Truncate a plain (non-ANSI) string to `maxWidth` visible columns. */\nfunction truncatePlain(text: string, maxWidth: number): string {\n\tif (maxWidth <= 0) return \"\";\n\tif (displayWidth(text) <= maxWidth) return text;\n\tlet out = \"\";\n\tlet w = 0;\n\tlet i = 0;\n\twhile (i < text.length) {\n\t\tconst code = text.codePointAt(i) ?? 0;\n\t\tconst cw = charWidth(code);\n\t\tif (w + cw > maxWidth) break;\n\t\tout += String.fromCodePoint(code);\n\t\tw += cw;\n\t\ti += code > 0xffff ? 2 : 1;\n\t}\n\treturn out;\n}\n\n/** Truncate a (possibly ANSI-colored) string to `maxWidth` visible columns,\n * re-emitting an SGR reset at the cut so styling doesn't bleed. */\nfunction truncateToWidth(text: string, maxWidth: number, ellipsis = \"\"): string {\n\tif (maxWidth <= 0) return \"\";\n\tif (displayWidth(text) <= maxWidth) return text;\n\tconst target = Math.max(0, maxWidth - displayWidth(ellipsis));\n\tlet out = \"\";\n\tlet w = 0;\n\tlet i = 0;\n\twhile (i < text.length && w < target) {\n\t\tconst skip = skipAnsi(text, i);\n\t\tif (skip > 0) {\n\t\t\tout += text.slice(i, i + skip);\n\t\t\ti += skip;\n\t\t\tcontinue;\n\t\t}\n\t\tconst code = text.codePointAt(i) ?? 0;\n\t\tconst cw = charWidth(code);\n\t\tif (w + cw > target) break;\n\t\tout += String.fromCodePoint(code);\n\t\tw += cw;\n\t\ti += code > 0xffff ? 2 : 1;\n\t}\n\tout += \"\\x1b[0m\";\n\treturn out + ellipsis;\n}\n\n/** Clamp each rendered line to `width` visible columns (fallback path). */\nfunction clampLines(lines: string[], width: number): string[] {\n\treturn lines.map((l) => (displayWidth(l) > width ? truncateToWidth(l, width, \"\") : l));\n}\n\n/** Apply a theme `fg` token safely; falls back to plain text. */\nfunction color(theme: Theme | undefined, token: string, text: string): string {\n\ttry {\n\t\treturn theme?.fg?.(token, text) ?? text;\n\t} catch {\n\t\treturn text;\n\t}\n}\n\n// lunr: strip ANSI escape sequences so footer statuses can be re-colored uniformly.\nfunction stripAnsi(s: string): string {\n\treturn s.replace(/\\x1b\\[[0-9;]*m/g, \"\");\n}\n\n// ---------------------------------------------------------------------------\n// Stats formatting\n// ---------------------------------------------------------------------------\n\n/** Compact token-count formatter: `999`, `1.2k`, `15k`, `1.2M`, `15M`.\n * Matches pi's FooterComponent / the captured zentui examples\n * (`↑9.0M ↓112k`, `20%/1.0M`). */\nfunction formatCount(count: number): string {\n\tif (count < 1000) return count.toString();\n\tif (count < 10000) return `${(count / 1000).toFixed(1)}k`;\n\tif (count < 1000000) return `${Math.round(count / 1000)}k`;\n\tif (count < 10000000) return `${(count / 1000000).toFixed(1)}M`;\n\treturn `${Math.round(count / 1000000)}M`;\n}\n\n/** Sum input/output tokens across assistant messages in the session. */\nfunction getUsageTotals(ctx: ExtensionContextLike): { input: number; output: number } {\n\tlet input = 0;\n\tlet output = 0;\n\tconst entries = ctx.sessionManager.getEntries?.() ?? ctx.sessionManager.getBranch?.() ?? [];\n\tfor (const entry of entries as readonly SessionEntry[]) {\n\t\tif (entry.type !== \"message\") continue;\n\t\tconst m = entry.message as AssistantMessageLike | undefined;\n\t\tif (!m || m.role !== \"assistant\") continue;\n\t\tconst u = m.usage;\n\t\tif (!u) continue;\n\t\tinput += u.input ?? 0;\n\t\toutput += u.output ?? 0;\n\t}\n\treturn { input, output };\n}\n\n// ---------------------------------------------------------------------------\n// Provider display label\n//\n// `ctx.model.provider` is a ProviderId string (e.g. `\"ollama-cloud\"`), NOT the\n// human label. `BUILT_IN_PROVIDER_DISPLAY_NAMES` exists in pi core but is not\n// re-exported to extensions, so we derive the label (mirrors zentui's\n// `formatProviderLabel`, with an explicit `ollama-cloud` entry).\n// ---------------------------------------------------------------------------\n\nfunction formatProviderLabel(provider: string | undefined): string {\n\tif (!provider) return \"Unknown\";\n\tconst known: Record<string, string> = {\n\t\tanthropic: \"Anthropic\",\n\t\tgemini: \"Google\",\n\t\tgoogle: \"Google\",\n\t\tollama: \"Ollama\",\n\t\t\"ollama-cloud\": \"Ollama Cloud\",\n\t\topenai: \"OpenAI\",\n\t\t\"openai-codex\": \"OpenAI\",\n\t\tmistral: \"Mistral\",\n\t};\n\treturn (\n\t\tknown[provider] ??\n\t\tprovider.replace(/[-_]/g, \" \").replace(/\\b\\w/g, (c) => c.toUpperCase())\n\t);\n}\n\n// ---------------------------------------------------------------------------\n// The chip: `model · provider · effort`\n// ---------------------------------------------------------------------------\n\nfunction colorEffort(theme: Theme | undefined, level: ThinkingLevel, text: string): string {\n\tconst token = thinkingThemeToken(level);\n\tconst painted = color(theme, token, text);\n\tif (token === \"thinkingMax\" && painted === text) {\n\t\treturn color(theme, \"thinkingXhigh\", text);\n\t}\n\treturn painted;\n}\n\nfunction buildChip(ctx: ExtensionContextLike, pi: ExtensionAPI): { left: string; effort: string; level: ThinkingLevel } {\n\tconst modelId = ctx.model?.id ?? \"no-model\";\n\tconst providerLabel = formatProviderLabel(ctx.model?.provider);\n\tconst level = pi.getThinkingLevel();\n\tconst effort = formatChipEffort(level);\n\treturn { left: `${modelId} \\u00b7 ${providerLabel} \\u00b7 `, effort, level };\n}\n\n// ---------------------------------------------------------------------------\n// The prompt box — `ChatboxEditor extends CustomEditor`\n// ---------------------------------------------------------------------------\n\nclass ChatboxEditor extends CustomEditor {\n\tprivate readonly ctx: ExtensionContextLike;\n\tprivate readonly pi: ExtensionAPI;\n\n\tconstructor(\n\t\ttui: TUIHandle,\n\t\ttheme: EditorThemeLike,\n\t\tkeybindings: KeybindingsLike,\n\t\tctx: ExtensionContextLike,\n\t\tpi: ExtensionAPI,\n\t) {\n\t\t// CustomEditor ctor: (tui, theme, keybindings, options?: EditorOptions).\n\t\t// Casts keep the inline types from leaking into the real base signature.\n\t\tsuper(tui as unknown as never, theme as unknown as never, keybindings as unknown as never, {\n\t\t\tpaddingX: 0,\n\t\t});\n\t\tthis.ctx = ctx;\n\t\tthis.pi = pi;\n\t\t// lunr: do not clobber borderColor — InteractiveMode.updateEditorBorderColor()\n\t\t// owns it (thinkingOff…thinkingMax, or bashMode).\n\t}\n\n\tprivate color(token: string, text: string): string {\n\t\treturn color(this.ctx.ui?.theme, token, text);\n\t}\n\n\toverride render(width: number): string[] {\n\t\t// Too narrow to draw a box — defer to the base editor, clamped.\n\t\tif (width <= 4) {\n\t\t\treturn clampLines(super.render(width), width);\n\t\t}\n\n\t\t// Rails: `│ ` (left) + ` │` (right) => 4 columns of chrome.\n\t\tconst promptSymbol = lunrPromptSymbolEnabled();\n\t\tconst glyph = lunrPromptGlyph(this.ctx.ui?.theme);\n\t\tconst glyphW = promptSymbol ? displayWidth(glyph) : 0;\n\t\tconst innerWidth = Math.max(1, width - 4 - glyphW);\n\t\tconst base = super.render(innerWidth);\n\n\t\t// The base editor appends the autocomplete menu lines (if any) to the END\n\t\t// of its render output. Split them off so the body sits inside the box and\n\t\t// the autocomplete renders BELOW the bottom border (preserves slash\n\t\t// commands). Mirrors zentui's `renderPolishedFrame`.\n\t\tconst showing = this.isShowingAutocomplete();\n\t\tconst acList = (this as unknown as { autocompleteList?: AutocompleteListLike }).autocompleteList;\n\t\tlet acCount = 0;\n\t\tif (showing && acList && typeof acList.render === \"function\") {\n\t\t\ttry {\n\t\t\t\tacCount = acList.render(innerWidth).length;\n\t\t\t} catch {\n\t\t\t\tacCount = 0;\n\t\t\t}\n\t\t}\n\n\t\t// `super.render` returns [base top ─ border, ...wrapped text lines, base\n\t\t// bottom ─ border, ...autocomplete lines] — the base editor draws its OWN\n\t\t// straight borders and (when active) appends the autocomplete menu. Split the\n\t\t// autocomplete off the end, then STRIP the base's first/last lines (its own\n\t\t// borders) so we don't render them a second time inside our rounded frame.\n\t\t// Mirrors zentui's `editorFrame.slice(1, -1)` (renderPolishedFrame).\n\t\tlet frame = base;\n\t\tlet acLines: string[] = [];\n\t\tif (acCount > 0 && acCount < frame.length) {\n\t\t\tacLines = frame.slice(frame.length - acCount);\n\t\t\tframe = frame.slice(0, frame.length - acCount);\n\t\t}\n\t\tconst inner = frame.length >= 2 ? frame.slice(1, frame.length - 1) : frame;\n\t\tconst body = inner.length > 0 ? inner : [\"\"];\n\n\t\tconst border = (s: string): string => this.borderColor(s);\n\n\t\t// Top border: ╭─…─╮\n\t\tconst top = border(\"\\u256d\" + \"\\u2500\".repeat(width - 2) + \"\\u256e\");\n\n\t\t// Body: │ <padded line> │ (auto-grows with the number of wrapped lines)\n\t\t// lunr: prefix the first body line with the dim theme prompt glyph (☾ > by\n\t\t// default); a same-width blank gutter keeps subsequent lines aligned.\n\t\tconst gutter = glyphW > 0 ? \" \".repeat(glyphW) : \"\";\n\t\tconst bodyLines = body.map((ln: string, i: number) => {\n\t\t\tconst prefix = i === 0 && glyphW > 0 ? this.color(\"dim\", glyph) : gutter;\n\t\t\treturn border(\"\\u2502 \") + prefix + padRight(ln, innerWidth) + border(\" \\u2502\");\n\t\t});\n\n\t\t// Bottom border with the right-aligned chip: ╰─…─ <chip> ─╯\n\t\tconst bottom = this.renderBottomBorder(width);\n\n\t\treturn [top, ...bodyLines, bottom, ...acLines];\n\t}\n\n\tprivate renderBottomBorder(width: number): string {\n\t\tconst border = (s: string): string => this.borderColor(s);\n\t\tconst parts = buildChip(this.ctx, this.pi);\n\t\tconst plain = parts.left + parts.effort;\n\t\tconst overhead = 4;\n\t\tconst maxChip = Math.max(0, width - overhead);\n\t\tconst truncated = displayWidth(plain) > maxChip;\n\t\tconst chipPlain = truncated ? truncatePlain(plain, maxChip) : plain;\n\t\tconst chipW = displayWidth(chipPlain);\n\t\tconst dashTotal = Math.max(0, width - overhead - chipW);\n\t\t// Right-align the chip: a single trailing dash before the corner, the\n\t\t// rest lead (right-aligns the chip near the corner).\n\t\tconst rightDashes = Math.min(dashTotal, 1);\n\t\tconst leftDashes = dashTotal - rightDashes;\n\n\t\tconst left = \"\\u2570\" + \"\\u2500\".repeat(leftDashes) + \" \";\n\t\tconst right = \" \" + \"\\u2500\".repeat(rightDashes) + \"\\u256f\";\n\t\tconst theme = this.ctx.ui?.theme;\n\t\t// Truncated chips may have lost the effort token — paint all white.\n\t\t// Otherwise model/provider stay white and the effort uses the thinking token.\n\t\tconst chip = truncated\n\t\t\t? this.color(\"white\", chipPlain)\n\t\t\t: this.color(\"white\", parts.left) + colorEffort(theme, parts.level, parts.effort);\n\t\treturn border(left) + chip + border(right);\n\t}\n}\n\n// ---------------------------------------------------------------------------\n// The stats line (footer) — slim, single line, BELOW the box\n// ---------------------------------------------------------------------------\n\nfunction renderStatsLine(\n\twidth: number,\n\tctx: ExtensionContextLike,\n\ttheme: Theme,\n\tfooterData: ReadonlyFooterDataProvider,\n): string[] {\n\tconst sep = color(theme, \"accent2\", \" | \"); // lunr: theme-polish — separator uses subtle accent2 blue (was bright-black plain fallback)\n\tconst parts: string[] = [];\n\n\t// lunr: mode zone — permission mode + agent-mode statuses (plan/goal/swarm/research)\n\t// render as ONE segment (dim middot-separated), not scattered across piped sections.\n\tconst modeZone: string[] = [];\n\n\t// lunr: permission mode safety indicator — always shown (not toggle-gated).\n\tconst mode = lunrPermissionMode();\n\tif (mode === \"yolo\" || mode === \"auto\") modeZone.push(color(theme, \"warning\", mode));\n\telse if (mode === \"manual\" || mode === \"plan\") modeZone.push(color(theme, \"white\", mode)); // lunr: theme-polish — manual/plan read white (was dim)\n\n\t// lunr: footer element toggles from the customize bridge (read at render time).\n\tconst footerToggles = lunrFooterToggles();\n\n\t// 1) Extension statuses published by other extensions (rendered as-is,\n\t// already styled): LSP (`pi-lsp-extension`), MCP (`pi-mcp-adapter`),\n\t// throughput/tokens (`pi-tps-was-taken`). These are NOT on `ctx` directly.\n\tconst statuses = footerData.getExtensionStatuses?.();\n\tif (statuses && statuses.size > 0) {\n\t\t// lunr: status segments are toggle-gated via the customize bridge:\n\t\t// footerStatuses gates plan/goal/swarm/research/tps, footerMcp gates\n\t\t// mcp/mcp-auth, footerLsp gates lsp. Publishers keep calling\n\t\t// ctx.ui.setStatus harmlessly when their segment is hidden.\n\t\t// lunr: plan/goal/swarm/research join the mode zone; tps/mcp/lsp stay piped.\n\t\tconst modeKeys: string[] = footerToggles.statuses ? [\"plan\", \"goal\", \"swarm\", \"research\"] : [];\n\t\tfor (const key of modeKeys) {\n\t\t\tconst v = statuses.get(key);\n\t\t\tif (v) modeZone.push(color(theme, \"white\", stripAnsi(v)));\n\t\t}\n\t\tconst pipedKeys: string[] = [];\n\t\tif (footerToggles.statuses) pipedKeys.push(\"tps\");\n\t\tif (footerToggles.mcp) pipedKeys.push(\"mcp\", \"mcp-auth\");\n\t\tif (footerToggles.lsp) pipedKeys.push(\"lsp\");\n\t\tfor (const key of pipedKeys) {\n\t\t\tconst v = statuses.get(key);\n\t\t\t// lunr: unify footer status colors (white, was dim) so the whole stats line reads as one tone.\n\t\t\tif (v) parts.push(color(theme, \"white\", stripAnsi(v))); // lunr: theme-polish — status segments white (was dim)\n\t\t}\n\t}\n\tif (modeZone.length > 0) {\n\t\tparts.unshift(modeZone.join(color(theme, \"dim\", \" · \")));\n\t}\n\n\t// lunr: git branch + working-tree +/- vs HEAD (gated on footerGit).\n\tif (footerToggles.git) {\n\t\tconst branch = footerData.getGitBranch?.();\n\t\tif (branch) {\n\t\t\tconst diff = footerData.getGitDiffstat?.();\n\t\t\tlet gitSeg = color(theme, \"white\", branch);\n\t\t\tif (diff && (diff.added !== 0 || diff.removed !== 0)) {\n\t\t\t\tgitSeg +=\n\t\t\t\t\t` ${color(theme, \"success\", `+${diff.added}`)} ${color(theme, \"error\", `-${diff.removed}`)}`;\n\t\t\t}\n\t\t\tparts.push(gitSeg);\n\t\t}\n\t}\n\n\t// lunr: live subscription window bar (gated on footerPlan). Hidden with no plan.\n\tif (footerToggles.plan) {\n\t\tconst provider = ctx.model?.provider;\n\t\tif (provider) {\n\t\t\tconst usage = lunrUsageBridge();\n\t\t\tusage?.prefetch?.(provider);\n\t\t\tconst seg = usage?.pickForFooter?.(provider);\n\t\t\tif (seg) {\n\t\t\t\tconst pct = `${Math.round(seg.usedPercent)}%`;\n\t\t\t\tconst barColor = seg.usedPercent > 90 ? \"error\" : seg.usedPercent > 70 ? \"warning\" : \"success\";\n\t\t\t\tconst bar = footerToggles.planBar ? `${compactPlanBar(seg.usedPercent, theme)} ` : \"\";\n\t\t\t\tparts.push(color(theme, \"white\", seg.label) + \" \" + bar + color(theme, barColor, pct));\n\t\t\t}\n\t\t}\n\t}\n\n\t// 2) Context usage: `pct/window` (lunr: gated on footerContext).\n\tif (footerToggles.context) {\n\t\tconst usage = ctx.getContextUsage();\n\t\tconst win = ctx.model?.contextWindow ?? usage?.contextWindow ?? 0;\n\t\tconst pct = usage?.percent == null ? \"?\" : `${Math.round(usage.percent)}%`;\n\t\tconst ctxSeg = `${pct}/${formatCount(win)}`;\n\t\tconst pv = usage?.percent ?? 0;\n\t\tif (pv > 90) parts.push(color(theme, \"error\", ctxSeg));\n\t\telse if (pv > 70) parts.push(color(theme, \"warning\", ctxSeg));\n\t\telse parts.push(color(theme, \"white\", ctxSeg)); // lunr: theme-polish — normal context % white (was dim)\n\t}\n\n\t// 3) Token totals: ↑in ↓out (lunr: gated on footerTokens).\n\tif (footerToggles.tokens) {\n\t\tconst totals = getUsageTotals(ctx);\n\t\tparts.push(color(theme, \"white\", `\\u2191${formatCount(totals.input)} \\u2193${formatCount(totals.output)}`)); // lunr: theme-polish — token totals white (was dim)\n\t}\n\n\t// lunr: cost/usage counter segment removed entirely (both the $x.xxx dollar\n\t// counter for API-key providers and the plan-usage limit bar for OAuth/subscription\n\t// providers). Segments 1-3 (statuses, context, tokens) remain.\n\n\tlet line = parts.join(sep);\n\tif (displayWidth(line) > width) {\n\t\tline = truncateToWidth(line, width, \"\");\n\t}\n\treturn [line];\n}\n\n// ---------------------------------------------------------------------------\n// Install / teardown\n// ---------------------------------------------------------------------------\n\nfunction installEditor(\n\tctx: ExtensionContextLike,\n\tpi: ExtensionAPI,\n\tsetRequestor: (r: () => void) => void,\n): void {\n\tif (typeof ctx.ui.setEditorComponent !== \"function\") return;\n\tconst factory: EditorFactoryLike = (tui, _theme, _keybindings) => {\n\t\tsetRequestor(() => {\n\t\t\ttry {\n\t\t\t\ttui.requestRender();\n\t\t\t} catch {\n\t\t\t\t/* ignore */\n\t\t\t}\n\t\t});\n\t\treturn new ChatboxEditor(tui, _theme, _keybindings, ctx, pi);\n\t};\n\tctx.ui.setEditorComponent(factory);\n}\n\nfunction installFooter(\n\tctx: ExtensionContextLike,\n\tsetRequestor: (r: () => void) => void,\n): void {\n\tif (typeof ctx.ui.setFooter !== \"function\") return;\n\tlet disposed = false;\n\tconst factory: FooterFactoryLike = (tui, _theme, _footerData) => {\n\t\tsetRequestor(() => {\n\t\t\ttry {\n\t\t\t\ttui.requestRender();\n\t\t\t} catch {\n\t\t\t\t/* ignore */\n\t\t\t}\n\t\t});\n\t\treturn {\n\t\t\tinvalidate(): void {\n\t\t\t\t// render is pure\n\t\t\t},\n\t\t\tdispose(): void {\n\t\t\t\tdisposed = true;\n\t\t\t},\n\t\t\trender(width: number): string[] {\n\t\t\t\tif (disposed) return [];\n\t\t\t\treturn renderStatsLine(width, ctx, _theme, _footerData);\n\t\t\t},\n\t\t};\n\t};\n\tctx.ui.setFooter(factory);\n}\n\n// ---------------------------------------------------------------------------\n// Extension entry point\n// ---------------------------------------------------------------------------\n\nexport default function (pi: ExtensionAPI): void {\n\tlet renderRequestor: (() => void) | undefined = undefined;\n\tconst requestRender = (): void => {\n\t\ttry {\n\t\t\trenderRequestor?.();\n\t\t} catch {\n\t\t\t/* ignore */\n\t\t}\n\t};\n\n\tpi.on(\"session_start\", (_event, ctx) => {\n\t\tif (!ctx.hasUI || ctx.mode !== \"tui\") return;\n\t\tinstallEditor(ctx, pi, (r) => {\n\t\t\trenderRequestor = r;\n\t\t});\n\t\tinstallFooter(ctx, (r) => {\n\t\t\tif (!renderRequestor) renderRequestor = r;\n\t\t});\n\t});\n\n\tpi.on(\"session_shutdown\", (_event, ctx) => {\n\t\ttry {\n\t\t\tif (typeof ctx.ui?.setEditorComponent === \"function\") ctx.ui.setEditorComponent(undefined);\n\t\t} catch {\n\t\t\t/* ignore */\n\t\t}\n\t\ttry {\n\t\t\tif (typeof ctx.ui?.setFooter === \"function\") ctx.ui.setFooter(undefined);\n\t\t} catch {\n\t\t\t/* ignore */\n\t\t}\n\t\trenderRequestor = undefined;\n\t});\n\n\t// Re-render triggers: model/provider + effort (chip), and token/cost/context\n\t// (stats line). Event names match those zentui wires.\n\tconst reRenderEvents = [\n\t\t\"model_select\",\n\t\t\"thinking_level_select\",\n\t\t\"agent_end\",\n\t\t\"message_end\",\n\t\t\"tool_execution_end\",\n\t\t\"session_compact\",\n\t];\n\tfor (const ev of reRenderEvents) {\n\t\tpi.on(ev, () => requestRender());\n\t}\n}"]}
1
+ {"version":3,"file":"ashxj-tui.js","sourceRoot":"","sources":["../../src/builtin-extensions/ashxj-tui.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA+BG;AAEH,OAAO,EAAE,YAAY,EAAE,MAAM,kDAAkD,CAAC;AAEhF,uFAAmF;AACnF,MA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AE,CAAC;QACjC,EAAE,CAAC,EAAE,CAAC,EAAE,EAAE,GAAG,EAAE,CAAC,aAAa,EAAE,CAAC,CAAC;IAClC,CAAC;AAAA,CACD","sourcesContent":["/**\n * ashxj-tui — a custom slim chatbox for pi.\n *\n * Replaces pi-zentui's prompt box + statusline with:\n * - A rounded prompt box that auto-expands as the typed message wraps to\n * multiple rows (the sides extend; height grows with content).\n * - A right-aligned chip on the box's BOTTOM border:\n * model · provider · effort (e.g. `glm-5.2 · Ollama Cloud · xhigh`)\n * - A slim stats line (extension statuses · context% · ↑↓; each segment\n * toggle-gated via the lunr customize bridge) BELOW the box, not wrapped\n * around the input.\n * - No session-mode indicator anywhere (pi has no such concept).\n *\n * Loaded by pi via jiti — no build step, plain TypeScript.\n *\n * NOTE on type imports (see `ashxj-thinking`/`simple-memory` for the convention):\n * This file declares structural types inline rather than importing them from\n * `@ashx-j/lunr` / `@ashx-j/lunr-tui`.\n * pi-coding-agent's `index.d.ts` re-exports from internal `.d.ts` files that\n * contain subpath imports like `@ashx-j/lunr-ai/compat`, which do not\n * resolve under `tsc` with a file argument. We keep the typecheck\n * self-contained with inline types and verify via the included `tsconfig.json`\n * (`moduleResolution: \"Bundler\"` + `skipLibCheck: true`).\n *\n * The ONE exception is `CustomEditor`, imported as a RUNTIME VALUE directly\n * from its defining module (`modes/interactive/components/custom-editor.ts`).\n * We must `extends` it to inherit pi's app keybindings (escape, ctrl+d, model\n * switching, extension shortcuts) — wrapping would lose those. It is imported\n * from the concrete module, NOT the package barrel, because the barrel\n * re-exports main.ts which imports this file — a circular import that crashes\n * under vite-node (`Class extends value undefined`).\n */\n\nimport { CustomEditor } from \"../modes/interactive/components/custom-editor.js\";\n\n// lunr: customize bridge — read the prompt-symbol toggle (bridgeless → no symbol).\nconst PROMPT_SYMBOL_BRIDGE = Symbol.for(\"@lunr/customize\");\nconst PERMISSION_MODE_BRIDGE = Symbol.for(\"@lunr/permission-mode\");\ninterface CustomizeBridgeForPrompt {\n\tgetPromptSymbol(): boolean;\n\t// lunr: footer element toggles (added to the same bridge).\n\tgetFooterMcp?(): boolean;\n\tgetFooterLsp?(): boolean;\n\tgetFooterContext?(): boolean;\n\tgetFooterTokens?(): boolean;\n\tgetFooterTps?(): boolean;\n\tgetFooterStatuses?(): boolean;\n\tgetFooterGit?(): boolean;\n\tgetFooterPlan?(): boolean;\n\tgetFooterPlanBar?(): boolean;\n}\ninterface PermissionModeBridgeForFooter {\n\tgetMode(): string | undefined;\n}\nfunction lunrCustomizeBridge(): CustomizeBridgeForPrompt | undefined {\n\treturn (globalThis as Record<symbol, unknown>)[PROMPT_SYMBOL_BRIDGE] as CustomizeBridgeForPrompt | undefined;\n}\nfunction lunrPermissionModeBridge(): PermissionModeBridgeForFooter | undefined {\n\treturn (globalThis as Record<symbol, unknown>)[PERMISSION_MODE_BRIDGE] as PermissionModeBridgeForFooter | undefined;\n}\nfunction lunrPromptSymbolEnabled(): boolean {\n\treturn lunrCustomizeBridge()?.getPromptSymbol() ?? false;\n}\n// lunr: footer toggles, read at render time. Bridgeless / missing-getter fallback\n// matches the settings-manager defaults: MCP on, LSP off, everything else on.\nfunction lunrFooterToggles(): {\n\tmcp: boolean;\n\tlsp: boolean;\n\tcontext: boolean;\n\ttokens: boolean;\n\ttps: boolean;\n\tstatuses: boolean;\n\tgit: boolean;\n\tplan: boolean;\n\tplanBar: boolean;\n} {\n\tconst bridge = lunrCustomizeBridge();\n\treturn {\n\t\tmcp: bridge?.getFooterMcp?.() ?? true,\n\t\tlsp: bridge?.getFooterLsp?.() ?? false,\n\t\tcontext: bridge?.getFooterContext?.() ?? true,\n\t\ttokens: bridge?.getFooterTokens?.() ?? true,\n\t\ttps: bridge?.getFooterTps?.() ?? true,\n\t\tstatuses: bridge?.getFooterStatuses?.() ?? true,\n\t\tgit: bridge?.getFooterGit?.() ?? true,\n\t\tplan: bridge?.getFooterPlan?.() ?? true,\n\t\tplanBar: bridge?.getFooterPlanBar?.() ?? true,\n\t};\n}\n\nconst USAGE_SERVICE_BRIDGE = Symbol.for(\"@lunr/usage-service\");\ninterface UsageServiceBridgeForFooter {\n\tpickForFooter?(providerId: string): { label: string; usedPercent: number } | undefined;\n\tprefetch?(providerId: string): void;\n}\nfunction lunrUsageBridge(): UsageServiceBridgeForFooter | undefined {\n\treturn (globalThis as Record<symbol, unknown>)[USAGE_SERVICE_BRIDGE] as UsageServiceBridgeForFooter | undefined;\n}\n\nfunction compactPlanBar(percent: number, theme: Theme): string {\n\tconst cells = 8;\n\tconst clamped = Math.max(0, Math.min(100, percent));\n\tconst filled = Math.round((clamped / 100) * cells);\n\tconst token = clamped > 90 ? \"error\" : clamped > 70 ? \"warning\" : \"success\";\n\tconst fill = filled > 0 ? color(theme, token, \"█\".repeat(filled)) : \"\";\n\tconst rest = filled < cells ? color(theme, \"dim\", \"░\".repeat(cells - filled)) : \"\";\n\treturn fill + rest;\n}\n// lunr: permission mode for the footer safety indicator (always shown).\nfunction lunrPermissionMode(): string | undefined {\n\treturn lunrPermissionModeBridge()?.getMode();\n}\n// lunr: prompt glyph comes from the theme tokens `glyphs.promptMoon` /\n// `glyphs.promptArrow` (defaults below match moon.json). An empty token hides\n// that part; both empty = no glyph at all.\nfunction lunrPromptGlyph(theme: Theme | undefined): string {\n\tconst moon = theme?.glyph?.(\"promptMoon\") ?? \"☾\";\n\tconst arrow = theme?.glyph?.(\"promptArrow\") ?? \">\";\n\tconst parts = [moon, arrow].filter((s) => s !== \"\");\n\treturn parts.length > 0 ? `${parts.join(\" \")} ` : \"\";\n}\n\n// ---------------------------------------------------------------------------\n// Minimal structural types (inline — see file header)\n// ---------------------------------------------------------------------------\n\ntype ThinkingLevel = \"off\" | \"minimal\" | \"low\" | \"medium\" | \"high\" | \"xhigh\" | \"max\";\n\n/** Theme token for the chatbox thinking-level border / effort chip. */\nexport function thinkingThemeToken(level: ThinkingLevel): string {\n\tswitch (level) {\n\t\tcase \"off\":\n\t\t\treturn \"thinkingOff\";\n\t\tcase \"minimal\":\n\t\t\treturn \"thinkingMinimal\";\n\t\tcase \"low\":\n\t\t\treturn \"thinkingLow\";\n\t\tcase \"medium\":\n\t\t\treturn \"thinkingMedium\";\n\t\tcase \"high\":\n\t\t\treturn \"thinkingHigh\";\n\t\tcase \"xhigh\":\n\t\t\treturn \"thinkingXhigh\";\n\t\tcase \"max\":\n\t\t\treturn \"thinkingMax\";\n\t\tdefault:\n\t\t\treturn \"thinkingOff\";\n\t}\n}\n\n/** Chip effort label — identity, locked so xhigh/max are never mapped down to high. */\nexport function formatChipEffort(level: ThinkingLevel): string {\n\treturn level;\n}\n\n/** Trimmed view of pi's `Theme` — only the methods we use. */\ninterface Theme {\n\tfg(token: string, text: string): string;\n\t/** lunr: prompt glyph tokens (optional for forward/backward compat). */\n\tglyph?(name: \"promptMoon\" | \"promptArrow\"): string;\n}\n\n/** Trimmed view of `pi-tui`'s `TUI` — only the method we use. */\ninterface TUIHandle {\n\trequestRender(force?: boolean): void;\n}\n\n/** Trimmed view of `pi-tui`'s `EditorTheme`. */\ninterface EditorThemeLike {\n\tborderColor: (str: string) => string;\n\tselectList: unknown;\n}\n\n/** Opaque keybindings manager. */\ninterface KeybindingsLike {\n\treadonly _?: unknown;\n}\n\n/** Trimmed view of an autocomplete list (the editor's private `autocompleteList`). */\ninterface AutocompleteListLike {\n\trender(width: number): string[];\n}\n\n/** Trimmed view of pi's `ReadonlyFooterDataProvider`. */\ninterface ReadonlyFooterDataProvider {\n\tgetGitBranch(): string | null;\n\tgetGitDiffstat?(): { added: number; removed: number } | null;\n\tgetExtensionStatuses(): ReadonlyMap<string, string>;\n\tgetAvailableProviderCount(): number;\n\tonBranchChange(callback: () => void): () => void;\n}\n\n/** Trimmed view of the `getContextUsage` return value. */\ninterface ContextUsage {\n\ttokens: number | null;\n\tcontextWindow: number;\n\tpercent: number | null;\n}\n\n/** Trimmed view of an assistant message's usage — the bits we render. */\ninterface AssistantUsage {\n\tinput: number;\n\toutput: number;\n\tcost: { total: number };\n}\n\n/** Trimmed view of an assistant message. */\ninterface AssistantMessageLike {\n\trole: \"assistant\";\n\tusage: AssistantUsage;\n}\n\n/** Trimmed view of a session entry — only what we iterate over. */\ntype SessionEntry =\n\t| { type: \"message\"; message: AssistantMessageLike }\n\t| { type: string; message?: unknown };\n\n/** Trimmed view of a `ReadonlySessionManager`. */\ninterface ReadonlySessionManagerLike {\n\tgetEntries(): readonly SessionEntry[];\n\tgetBranch?(): readonly SessionEntry[];\n}\n\n/** Trimmed view of a `Model`. */\ninterface ModelLike {\n\tid?: string;\n\tprovider?: string;\n\tcontextWindow?: number;\n\treasoning?: boolean;\n\tthinkingLevelMap?: Record<string, string | null>;\n}\n\ninterface ExtensionUIContextLike {\n\tsetEditorComponent(factory: EditorFactoryLike | undefined): void;\n\tsetFooter(factory: FooterFactoryLike | undefined): void;\n\treadonly theme?: Theme;\n}\n\n/** Trimmed view of `ExtensionContext`. */\ninterface ExtensionContextLike {\n\tmode: \"tui\" | \"rpc\" | \"json\" | \"print\";\n\thasUI: boolean;\n\tmodel: ModelLike | undefined;\n\tsessionManager: ReadonlySessionManagerLike;\n\tgetContextUsage(): ContextUsage | undefined;\n\tui: ExtensionUIContextLike;\n}\n\n/** Trimmed view of `ExtensionAPI`. */\ninterface ExtensionAPI {\n\tgetThinkingLevel(): ThinkingLevel;\n\ton(event: string, handler: (event: unknown, ctx: ExtensionContextLike) => void): void;\n}\n\n/** `setEditorComponent` factory shape. */\ntype EditorFactoryLike = (\n\ttui: TUIHandle,\n\ttheme: EditorThemeLike,\n\tkeybindings: KeybindingsLike,\n) => EditorComponentLike;\n\ninterface EditorComponentLike {\n\trender(width: number): string[];\n\tgetText(): string;\n\tsetText(text: string): void;\n\tinvalidate(): void;\n\thandleInput?(data: string): void;\n}\n\n/** `setFooter` factory shape. */\ntype FooterFactoryLike = (\n\ttui: TUIHandle,\n\ttheme: Theme,\n\tfooterData: ReadonlyFooterDataProvider,\n) => FooterComponentLike;\n\ninterface FooterComponentLike {\n\trender(width: number): string[];\n\tdispose?(): void;\n\tinvalidate?(): void;\n}\n\n// ---------------------------------------------------------------------------\n// Display-width helpers (ANSI-aware; CJK-aware)\n//\n// The editor (`Editor.render`) word-wraps to the given width using grapheme\n// width, so each returned line is ≤ that many visual columns. To right-pad a\n// line for our box we need a width model that matches closely enough: skip ALL\n// escape sequences (SGR color, OSC/DCS/APC/PM/SOS string sequences such as\n// pi-tui's `CURSOR_MARKER` `ESC _pi:c BEL`, and two-char escapes), count common\n// East-Asian wide ranges as 2, combining marks and variation selectors as 0.\n// Handling the string sequences as 0-width is what keeps the right `│` rail\n// aligned on the focused (cursor) line — the base editor embeds the marker and\n// the TUI strips it at flush time, so we must not count it here.\n// ---------------------------------------------------------------------------\n\nfunction skipAnsi(str: string, pos: number): number {\n\tif (str.charCodeAt(pos) !== 0x1b) return 0;\n\tconst next = str.charCodeAt(pos + 1);\n\t// CSI: ESC [ ... <final 0x40-0x7e>\n\tif (next === 0x5b /* [ */) {\n\t\tlet j = pos + 2;\n\t\twhile (j < str.length) {\n\t\t\tconst c = str.charCodeAt(j);\n\t\t\tif (c >= 0x40 && c <= 0x7e) return j + 1 - pos;\n\t\t\tj++;\n\t\t}\n\t\treturn str.length - pos; // unterminated; consume the rest\n\t}\n\t// String sequences — OSC (]), DCS (P), APC (_), PM (^), SOS (X) — terminated\n\t// by BEL (0x07) or ST (ESC \\). pi-tui's CURSOR_MARKER `ESC _pi:c BEL` is APC;\n\t// OSC color queries are OSC. All are zero visual width.\n\tif (\n\t\tnext === 0x5d /* ] */ ||\n\t\tnext === 0x50 /* P */ ||\n\t\tnext === 0x5f /* _ */ ||\n\t\tnext === 0x5e /* ^ */ ||\n\t\tnext === 0x58 /* X */\n\t) {\n\t\tlet j = pos + 2;\n\t\twhile (j < str.length) {\n\t\t\tconst c = str.charCodeAt(j);\n\t\t\tif (c === 0x07 /* BEL */) return j + 1 - pos;\n\t\t\tif (c === 0x1b && str.charCodeAt(j + 1) === 0x5c /* \\ */) return j + 2 - pos;\n\t\t\tj++;\n\t\t}\n\t\treturn str.length - pos; // unterminated; consume the rest\n\t}\n\t// Any other ESC sequence: consume ESC + one final byte (e.g. ESC c, ESC \\,\n\t// ESC ( B). A lone trailing ESC with no following byte is 0 width too.\n\treturn Number.isNaN(next) ? 1 : 2;\n}\n\nfunction isWide(cp: number): boolean {\n\treturn (\n\t\t(cp >= 0x1100 && cp <= 0x115f) ||\n\t\t(cp >= 0x2e80 && cp <= 0x303e) ||\n\t\t(cp >= 0x3041 && cp <= 0x33ff) ||\n\t\t(cp >= 0x3400 && cp <= 0x4dbf) ||\n\t\t(cp >= 0x4e00 && cp <= 0x9fff) ||\n\t\t(cp >= 0xa000 && cp <= 0xa4cf) ||\n\t\t(cp >= 0xac00 && cp <= 0xd7a3) ||\n\t\t(cp >= 0xf900 && cp <= 0xfaff) ||\n\t\t(cp >= 0xfe30 && cp <= 0xfe4f) ||\n\t\t(cp >= 0xff00 && cp <= 0xff60) ||\n\t\t(cp >= 0xffe0 && cp <= 0xffe6) ||\n\t\t(cp >= 0x1f300 && cp <= 0x1faff) ||\n\t\t(cp >= 0x20000 && cp <= 0x3fffd)\n\t);\n}\n\nfunction charWidth(cp: number): number {\n\tif (cp >= 0x20 && cp < 0x7f) return 1;\n\tif ((cp >= 0x0300 && cp <= 0x036f) || (cp >= 0xfe00 && cp <= 0xfe0f) || cp === 0x200d) return 0;\n\treturn isWide(cp) ? 2 : 1;\n}\n\n/** Visible width of a string, ignoring SGR color codes. */\nfunction displayWidth(str: string): number {\n\tlet w = 0;\n\tlet i = 0;\n\twhile (i < str.length) {\n\t\tconst skip = skipAnsi(str, i);\n\t\tif (skip > 0) {\n\t\t\ti += skip;\n\t\t\tcontinue;\n\t\t}\n\t\tconst cp = str.codePointAt(i) ?? 0;\n\t\tw += charWidth(cp);\n\t\ti += cp > 0xffff ? 2 : 1;\n\t}\n\treturn w;\n}\n\n/** Right-pad a (possibly colored) line to `width` visible columns. */\nfunction padRight(line: string, width: number): string {\n\tconst w = displayWidth(line);\n\tif (w >= width) return line;\n\treturn line + \" \".repeat(width - w);\n}\n\n/** Truncate a plain (non-ANSI) string to `maxWidth` visible columns. */\nfunction truncatePlain(text: string, maxWidth: number): string {\n\tif (maxWidth <= 0) return \"\";\n\tif (displayWidth(text) <= maxWidth) return text;\n\tlet out = \"\";\n\tlet w = 0;\n\tlet i = 0;\n\twhile (i < text.length) {\n\t\tconst code = text.codePointAt(i) ?? 0;\n\t\tconst cw = charWidth(code);\n\t\tif (w + cw > maxWidth) break;\n\t\tout += String.fromCodePoint(code);\n\t\tw += cw;\n\t\ti += code > 0xffff ? 2 : 1;\n\t}\n\treturn out;\n}\n\n/** Truncate a (possibly ANSI-colored) string to `maxWidth` visible columns,\n * re-emitting an SGR reset at the cut so styling doesn't bleed. */\nfunction truncateToWidth(text: string, maxWidth: number, ellipsis = \"\"): string {\n\tif (maxWidth <= 0) return \"\";\n\tif (displayWidth(text) <= maxWidth) return text;\n\tconst target = Math.max(0, maxWidth - displayWidth(ellipsis));\n\tlet out = \"\";\n\tlet w = 0;\n\tlet i = 0;\n\twhile (i < text.length && w < target) {\n\t\tconst skip = skipAnsi(text, i);\n\t\tif (skip > 0) {\n\t\t\tout += text.slice(i, i + skip);\n\t\t\ti += skip;\n\t\t\tcontinue;\n\t\t}\n\t\tconst code = text.codePointAt(i) ?? 0;\n\t\tconst cw = charWidth(code);\n\t\tif (w + cw > target) break;\n\t\tout += String.fromCodePoint(code);\n\t\tw += cw;\n\t\ti += code > 0xffff ? 2 : 1;\n\t}\n\tout += \"\\x1b[0m\";\n\treturn out + ellipsis;\n}\n\n/** Clamp each rendered line to `width` visible columns (fallback path). */\nfunction clampLines(lines: string[], width: number): string[] {\n\treturn lines.map((l) => (displayWidth(l) > width ? truncateToWidth(l, width, \"\") : l));\n}\n\n/** Apply a theme `fg` token safely; falls back to plain text. */\nfunction color(theme: Theme | undefined, token: string, text: string): string {\n\ttry {\n\t\treturn theme?.fg?.(token, text) ?? text;\n\t} catch {\n\t\treturn text;\n\t}\n}\n\n// lunr: strip ANSI escape sequences so footer statuses can be re-colored uniformly.\nfunction stripAnsi(s: string): string {\n\treturn s.replace(/\\x1b\\[[0-9;]*m/g, \"\");\n}\n\n// ---------------------------------------------------------------------------\n// Stats formatting\n// ---------------------------------------------------------------------------\n\n/** Compact token-count formatter: `999`, `1.2k`, `15k`, `1.2M`, `15M`.\n * Matches pi's FooterComponent / the captured zentui examples\n * (`↑9.0M ↓112k`, `20%/1.0M`). */\nfunction formatCount(count: number): string {\n\tif (count < 1000) return count.toString();\n\tif (count < 10000) return `${(count / 1000).toFixed(1)}k`;\n\tif (count < 1000000) return `${Math.round(count / 1000)}k`;\n\tif (count < 10000000) return `${(count / 1000000).toFixed(1)}M`;\n\treturn `${Math.round(count / 1000000)}M`;\n}\n\n/** Sum input/output tokens across assistant messages in the session. */\nfunction getUsageTotals(ctx: ExtensionContextLike): { input: number; output: number } {\n\tlet input = 0;\n\tlet output = 0;\n\tconst entries = ctx.sessionManager.getEntries?.() ?? ctx.sessionManager.getBranch?.() ?? [];\n\tfor (const entry of entries as readonly SessionEntry[]) {\n\t\tif (entry.type !== \"message\") continue;\n\t\tconst m = entry.message as AssistantMessageLike | undefined;\n\t\tif (!m || m.role !== \"assistant\") continue;\n\t\tconst u = m.usage;\n\t\tif (!u) continue;\n\t\tinput += u.input ?? 0;\n\t\toutput += u.output ?? 0;\n\t}\n\treturn { input, output };\n}\n\n// ---------------------------------------------------------------------------\n// Provider display label\n//\n// `ctx.model.provider` is a ProviderId string (e.g. `\"ollama-cloud\"`), NOT the\n// human label. `BUILT_IN_PROVIDER_DISPLAY_NAMES` exists in pi core but is not\n// re-exported to extensions, so we derive the label (mirrors zentui's\n// `formatProviderLabel`, with an explicit `ollama-cloud` entry).\n// ---------------------------------------------------------------------------\n\nfunction formatProviderLabel(provider: string | undefined): string {\n\tif (!provider) return \"Unknown\";\n\tconst known: Record<string, string> = {\n\t\tanthropic: \"Anthropic\",\n\t\tgemini: \"Google\",\n\t\tgoogle: \"Google\",\n\t\tollama: \"Ollama\",\n\t\t\"ollama-cloud\": \"Ollama Cloud\",\n\t\topenai: \"OpenAI\",\n\t\t\"openai-codex\": \"OpenAI\",\n\t\tmistral: \"Mistral\",\n\t};\n\treturn (\n\t\tknown[provider] ??\n\t\tprovider.replace(/[-_]/g, \" \").replace(/\\b\\w/g, (c) => c.toUpperCase())\n\t);\n}\n\n// ---------------------------------------------------------------------------\n// The chip: `model · provider · effort`\n// ---------------------------------------------------------------------------\n\nfunction colorEffort(theme: Theme | undefined, level: ThinkingLevel, text: string): string {\n\tconst token = thinkingThemeToken(level);\n\tconst painted = color(theme, token, text);\n\tif (token === \"thinkingMax\" && painted === text) {\n\t\treturn color(theme, \"thinkingXhigh\", text);\n\t}\n\treturn painted;\n}\n\nfunction buildChip(ctx: ExtensionContextLike, pi: ExtensionAPI): { left: string; effort: string; level: ThinkingLevel } {\n\tconst modelId = ctx.model?.id ?? \"no-model\";\n\tconst providerLabel = formatProviderLabel(ctx.model?.provider);\n\tconst level = pi.getThinkingLevel();\n\tconst effort = formatChipEffort(level);\n\treturn { left: `${modelId} \\u00b7 ${providerLabel} \\u00b7 `, effort, level };\n}\n\n// ---------------------------------------------------------------------------\n// The prompt box — `ChatboxEditor extends CustomEditor`\n// ---------------------------------------------------------------------------\n\nclass ChatboxEditor extends CustomEditor {\n\tprivate readonly ctx: ExtensionContextLike;\n\tprivate readonly pi: ExtensionAPI;\n\n\tconstructor(\n\t\ttui: TUIHandle,\n\t\ttheme: EditorThemeLike,\n\t\tkeybindings: KeybindingsLike,\n\t\tctx: ExtensionContextLike,\n\t\tpi: ExtensionAPI,\n\t) {\n\t\t// CustomEditor ctor: (tui, theme, keybindings, options?: EditorOptions).\n\t\t// Casts keep the inline types from leaking into the real base signature.\n\t\tsuper(tui as unknown as never, theme as unknown as never, keybindings as unknown as never, {\n\t\t\tpaddingX: 0,\n\t\t});\n\t\tthis.ctx = ctx;\n\t\tthis.pi = pi;\n\t\t// lunr: do not clobber borderColor — InteractiveMode.updateEditorBorderColor()\n\t\t// owns it (thinkingOff…thinkingMax, or bashMode).\n\t}\n\n\tprivate color(token: string, text: string): string {\n\t\treturn color(this.ctx.ui?.theme, token, text);\n\t}\n\n\toverride render(width: number): string[] {\n\t\t// Too narrow to draw a box — defer to the base editor, clamped.\n\t\tif (width <= 4) {\n\t\t\treturn clampLines(super.render(width), width);\n\t\t}\n\n\t\t// Rails: `│ ` (left) + ` │` (right) => 4 columns of chrome.\n\t\tconst promptSymbol = lunrPromptSymbolEnabled();\n\t\tconst glyph = lunrPromptGlyph(this.ctx.ui?.theme);\n\t\tconst glyphW = promptSymbol ? displayWidth(glyph) : 0;\n\t\tconst innerWidth = Math.max(1, width - 4 - glyphW);\n\t\tconst base = super.render(innerWidth);\n\n\t\t// The base editor appends the autocomplete menu lines (if any) to the END\n\t\t// of its render output. Split them off so the body sits inside the box and\n\t\t// the autocomplete renders BELOW the bottom border (preserves slash\n\t\t// commands). Mirrors zentui's `renderPolishedFrame`.\n\t\tconst showing = this.isShowingAutocomplete();\n\t\tconst acList = (this as unknown as { autocompleteList?: AutocompleteListLike }).autocompleteList;\n\t\tlet acCount = 0;\n\t\tif (showing && acList && typeof acList.render === \"function\") {\n\t\t\ttry {\n\t\t\t\tacCount = acList.render(innerWidth).length;\n\t\t\t} catch {\n\t\t\t\tacCount = 0;\n\t\t\t}\n\t\t}\n\n\t\t// `super.render` returns [base top ─ border, ...wrapped text lines, base\n\t\t// bottom ─ border, ...autocomplete lines] — the base editor draws its OWN\n\t\t// straight borders and (when active) appends the autocomplete menu. Split the\n\t\t// autocomplete off the end, then STRIP the base's first/last lines (its own\n\t\t// borders) so we don't render them a second time inside our rounded frame.\n\t\t// Mirrors zentui's `editorFrame.slice(1, -1)` (renderPolishedFrame).\n\t\tlet frame = base;\n\t\tlet acLines: string[] = [];\n\t\tif (acCount > 0 && acCount < frame.length) {\n\t\t\tacLines = frame.slice(frame.length - acCount);\n\t\t\tframe = frame.slice(0, frame.length - acCount);\n\t\t}\n\t\tconst inner = frame.length >= 2 ? frame.slice(1, frame.length - 1) : frame;\n\t\tconst body = inner.length > 0 ? inner : [\"\"];\n\n\t\tconst border = (s: string): string => this.borderColor(s);\n\n\t\t// Top border: ╭─…─╮\n\t\tconst top = border(\"\\u256d\" + \"\\u2500\".repeat(width - 2) + \"\\u256e\");\n\n\t\t// Body: │ <padded line> │ (auto-grows with the number of wrapped lines)\n\t\t// lunr: prefix the first body line with the dim theme prompt glyph (☾ > by\n\t\t// default); a same-width blank gutter keeps subsequent lines aligned.\n\t\tconst gutter = glyphW > 0 ? \" \".repeat(glyphW) : \"\";\n\t\tconst bodyLines = body.map((ln: string, i: number) => {\n\t\t\tconst prefix = i === 0 && glyphW > 0 ? this.color(\"dim\", glyph) : gutter;\n\t\t\treturn border(\"\\u2502 \") + prefix + padRight(ln, innerWidth) + border(\" \\u2502\");\n\t\t});\n\n\t\t// Bottom border with the right-aligned chip: ╰─…─ <chip> ─╯\n\t\tconst bottom = this.renderBottomBorder(width);\n\n\t\treturn [top, ...bodyLines, bottom, ...acLines];\n\t}\n\n\tprivate renderBottomBorder(width: number): string {\n\t\tconst border = (s: string): string => this.borderColor(s);\n\t\tconst parts = buildChip(this.ctx, this.pi);\n\t\tconst plain = parts.left + parts.effort;\n\t\tconst overhead = 4;\n\t\tconst maxChip = Math.max(0, width - overhead);\n\t\tconst truncated = displayWidth(plain) > maxChip;\n\t\tconst chipPlain = truncated ? truncatePlain(plain, maxChip) : plain;\n\t\tconst chipW = displayWidth(chipPlain);\n\t\tconst dashTotal = Math.max(0, width - overhead - chipW);\n\t\t// Right-align the chip: a single trailing dash before the corner, the\n\t\t// rest lead (right-aligns the chip near the corner).\n\t\tconst rightDashes = Math.min(dashTotal, 1);\n\t\tconst leftDashes = dashTotal - rightDashes;\n\n\t\tconst left = \"\\u2570\" + \"\\u2500\".repeat(leftDashes) + \" \";\n\t\tconst right = \" \" + \"\\u2500\".repeat(rightDashes) + \"\\u256f\";\n\t\tconst theme = this.ctx.ui?.theme;\n\t\t// Truncated chips may have lost the effort token — paint all white.\n\t\t// Otherwise model/provider stay white and the effort uses the thinking token.\n\t\tconst chip = truncated\n\t\t\t? this.color(\"white\", chipPlain)\n\t\t\t: this.color(\"white\", parts.left) + colorEffort(theme, parts.level, parts.effort);\n\t\treturn border(left) + chip + border(right);\n\t}\n}\n\n// ---------------------------------------------------------------------------\n// The stats line (footer) — slim, single line, BELOW the box\n// ---------------------------------------------------------------------------\n\nfunction renderStatsLine(\n\twidth: number,\n\tctx: ExtensionContextLike,\n\ttheme: Theme,\n\tfooterData: ReadonlyFooterDataProvider,\n): string[] {\n\tconst sep = color(theme, \"accent2\", \" | \"); // lunr: theme-polish — separator uses subtle accent2 blue (was bright-black plain fallback)\n\tconst parts: string[] = [];\n\n\t// lunr: mode zone — permission mode + agent-mode statuses (plan/goal/swarm/research)\n\t// render as ONE segment (dim middot-separated), not scattered across piped sections.\n\tconst modeZone: string[] = [];\n\n\t// lunr: permission mode safety indicator — always shown (not toggle-gated).\n\tconst mode = lunrPermissionMode();\n\tif (mode === \"yolo\" || mode === \"auto\") modeZone.push(color(theme, \"warning\", mode));\n\telse if (mode === \"manual\" || mode === \"plan\") modeZone.push(color(theme, \"white\", mode)); // lunr: theme-polish — manual/plan read white (was dim)\n\n\t// lunr: footer element toggles from the customize bridge (read at render time).\n\tconst footerToggles = lunrFooterToggles();\n\n\t// 1) Extension statuses published by other extensions (rendered as-is,\n\t// already styled): LSP (`pi-lsp-extension`), MCP (`pi-mcp-adapter`),\n\t// throughput/tokens (`pi-tps-was-taken`). These are NOT on `ctx` directly.\n\tconst statuses = footerData.getExtensionStatuses?.();\n\tif (statuses && statuses.size > 0) {\n\t\t// lunr: status segments are toggle-gated via the customize bridge:\n\t\t// footerStatuses gates plan/goal/swarm/research, footerTps gates tps,\n\t\t// footerMcp gates mcp/mcp-auth, footerLsp gates lsp. Publishers keep\n\t\t// calling ctx.ui.setStatus harmlessly when their segment is hidden.\n\t\t// lunr: plan/goal/swarm/research join the mode zone; tps/mcp/lsp stay piped.\n\t\tconst modeKeys: string[] = footerToggles.statuses ? [\"plan\", \"goal\", \"swarm\", \"research\"] : [];\n\t\tfor (const key of modeKeys) {\n\t\t\tconst v = statuses.get(key);\n\t\t\tif (v) modeZone.push(color(theme, \"white\", stripAnsi(v)));\n\t\t}\n\t\tconst pipedKeys: string[] = [];\n\t\tif (footerToggles.tps) pipedKeys.push(\"tps\");\n\t\tif (footerToggles.mcp) pipedKeys.push(\"mcp\", \"mcp-auth\");\n\t\tif (footerToggles.lsp) pipedKeys.push(\"lsp\");\n\t\tfor (const key of pipedKeys) {\n\t\t\tconst v = statuses.get(key);\n\t\t\t// lunr: unify footer status colors (white, was dim) so the whole stats line reads as one tone.\n\t\t\tif (v) parts.push(color(theme, \"white\", stripAnsi(v))); // lunr: theme-polish — status segments white (was dim)\n\t\t}\n\t}\n\tif (modeZone.length > 0) {\n\t\tparts.unshift(modeZone.join(color(theme, \"dim\", \" · \")));\n\t}\n\n\t// lunr: git branch + working-tree +/- vs HEAD (gated on footerGit).\n\tif (footerToggles.git) {\n\t\tconst branch = footerData.getGitBranch?.();\n\t\tif (branch) {\n\t\t\tconst diff = footerData.getGitDiffstat?.();\n\t\t\tlet gitSeg = color(theme, \"white\", branch);\n\t\t\tif (diff && (diff.added !== 0 || diff.removed !== 0)) {\n\t\t\t\tgitSeg +=\n\t\t\t\t\t` ${color(theme, \"success\", `+${diff.added}`)} ${color(theme, \"error\", `-${diff.removed}`)}`;\n\t\t\t}\n\t\t\tparts.push(gitSeg);\n\t\t}\n\t}\n\n\t// lunr: live subscription window bar (gated on footerPlan). Hidden with no plan.\n\tif (footerToggles.plan) {\n\t\tconst provider = ctx.model?.provider;\n\t\tif (provider) {\n\t\t\tconst usage = lunrUsageBridge();\n\t\t\tusage?.prefetch?.(provider);\n\t\t\tconst seg = usage?.pickForFooter?.(provider);\n\t\t\tif (seg) {\n\t\t\t\tconst pct = `${Math.round(seg.usedPercent)}%`;\n\t\t\t\tconst barColor = seg.usedPercent > 90 ? \"error\" : seg.usedPercent > 70 ? \"warning\" : \"success\";\n\t\t\t\tconst bar = footerToggles.planBar ? `${compactPlanBar(seg.usedPercent, theme)} ` : \"\";\n\t\t\t\tparts.push(color(theme, \"white\", seg.label) + \" \" + bar + color(theme, barColor, pct));\n\t\t\t}\n\t\t}\n\t}\n\n\t// 2) Context usage: `pct/window` (lunr: gated on footerContext).\n\tif (footerToggles.context) {\n\t\tconst usage = ctx.getContextUsage();\n\t\tconst win = ctx.model?.contextWindow ?? usage?.contextWindow ?? 0;\n\t\tconst pct = usage?.percent == null ? \"?\" : `${Math.round(usage.percent)}%`;\n\t\tconst ctxSeg = `${pct}/${formatCount(win)}`;\n\t\tconst pv = usage?.percent ?? 0;\n\t\tif (pv > 90) parts.push(color(theme, \"error\", ctxSeg));\n\t\telse if (pv > 70) parts.push(color(theme, \"warning\", ctxSeg));\n\t\telse parts.push(color(theme, \"white\", ctxSeg)); // lunr: theme-polish — normal context % white (was dim)\n\t}\n\n\t// 3) Token totals: ↑in ↓out (lunr: gated on footerTokens).\n\tif (footerToggles.tokens) {\n\t\tconst totals = getUsageTotals(ctx);\n\t\tparts.push(color(theme, \"white\", `\\u2191${formatCount(totals.input)} \\u2193${formatCount(totals.output)}`)); // lunr: theme-polish — token totals white (was dim)\n\t}\n\n\t// lunr: cost/usage counter segment removed entirely (both the $x.xxx dollar\n\t// counter for API-key providers and the plan-usage limit bar for OAuth/subscription\n\t// providers). Segments 1-3 (statuses, context, tokens) remain.\n\n\tlet line = parts.join(sep);\n\tif (displayWidth(line) > width) {\n\t\tline = truncateToWidth(line, width, \"\");\n\t}\n\treturn [line];\n}\n\n// ---------------------------------------------------------------------------\n// Install / teardown\n// ---------------------------------------------------------------------------\n\nfunction installEditor(\n\tctx: ExtensionContextLike,\n\tpi: ExtensionAPI,\n\tsetRequestor: (r: () => void) => void,\n): void {\n\tif (typeof ctx.ui.setEditorComponent !== \"function\") return;\n\tconst factory: EditorFactoryLike = (tui, _theme, _keybindings) => {\n\t\tsetRequestor(() => {\n\t\t\ttry {\n\t\t\t\ttui.requestRender();\n\t\t\t} catch {\n\t\t\t\t/* ignore */\n\t\t\t}\n\t\t});\n\t\treturn new ChatboxEditor(tui, _theme, _keybindings, ctx, pi);\n\t};\n\tctx.ui.setEditorComponent(factory);\n}\n\nfunction installFooter(\n\tctx: ExtensionContextLike,\n\tsetRequestor: (r: () => void) => void,\n): void {\n\tif (typeof ctx.ui.setFooter !== \"function\") return;\n\tlet disposed = false;\n\tconst factory: FooterFactoryLike = (tui, _theme, _footerData) => {\n\t\tsetRequestor(() => {\n\t\t\ttry {\n\t\t\t\ttui.requestRender();\n\t\t\t} catch {\n\t\t\t\t/* ignore */\n\t\t\t}\n\t\t});\n\t\treturn {\n\t\t\tinvalidate(): void {\n\t\t\t\t// render is pure\n\t\t\t},\n\t\t\tdispose(): void {\n\t\t\t\tdisposed = true;\n\t\t\t},\n\t\t\trender(width: number): string[] {\n\t\t\t\tif (disposed) return [];\n\t\t\t\treturn renderStatsLine(width, ctx, _theme, _footerData);\n\t\t\t},\n\t\t};\n\t};\n\tctx.ui.setFooter(factory);\n}\n\n// ---------------------------------------------------------------------------\n// Extension entry point\n// ---------------------------------------------------------------------------\n\nexport default function (pi: ExtensionAPI): void {\n\tlet renderRequestor: (() => void) | undefined = undefined;\n\tconst requestRender = (): void => {\n\t\ttry {\n\t\t\trenderRequestor?.();\n\t\t} catch {\n\t\t\t/* ignore */\n\t\t}\n\t};\n\n\tpi.on(\"session_start\", (_event, ctx) => {\n\t\tif (!ctx.hasUI || ctx.mode !== \"tui\") return;\n\t\tinstallEditor(ctx, pi, (r) => {\n\t\t\trenderRequestor = r;\n\t\t});\n\t\tinstallFooter(ctx, (r) => {\n\t\t\tif (!renderRequestor) renderRequestor = r;\n\t\t});\n\t});\n\n\tpi.on(\"session_shutdown\", (_event, ctx) => {\n\t\ttry {\n\t\t\tif (typeof ctx.ui?.setEditorComponent === \"function\") ctx.ui.setEditorComponent(undefined);\n\t\t} catch {\n\t\t\t/* ignore */\n\t\t}\n\t\ttry {\n\t\t\tif (typeof ctx.ui?.setFooter === \"function\") ctx.ui.setFooter(undefined);\n\t\t} catch {\n\t\t\t/* ignore */\n\t\t}\n\t\trenderRequestor = undefined;\n\t});\n\n\t// Re-render triggers: model/provider + effort (chip), and token/cost/context\n\t// (stats line). Event names match those zentui wires.\n\tconst reRenderEvents = [\n\t\t\"model_select\",\n\t\t\"thinking_level_select\",\n\t\t\"agent_end\",\n\t\t\"message_end\",\n\t\t\"tool_execution_end\",\n\t\t\"session_compact\",\n\t];\n\tfor (const ev of reRenderEvents) {\n\t\tpi.on(ev, () => requestRender());\n\t}\n}"]}
@@ -1 +1 @@
1
- {"version":3,"file":"schemas.d.ts","sourceRoot":"","sources":["../../../../../src/builtin-extensions/pi-subagents/src/extension/schemas.ts"],"names":[],"mappings":"AACA;;GAEG;AAEH,OAAO,EAAE,IAAI,EAAE,MAAM,SAAS,CAAC;AAkH/B,eAAO,MAAM,kBAAkB;;;;;;;;;;;;;;;;;;;;;;EAkB7B,CAAC;AAEH,eAAO,MAAM,mBAAmB;;;;;;;;;EASG,CAAC;AAEpC,eAAO,MAAM,6BAA6B;;;;;;;;;;;;;;;;;;;;EAgBP,CAAC;AAEpC,eAAO,MAAM,oBAAoB;;;EAGE,CAAC;AAGpC,eAAO,MAAM,SAAS;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAoCpB,CAAC;AAmGH,eAAO,MAAM,cAAc;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAA0D,CAAC;AAetF,eAAO,MAAM,kBAAkB;;;;EAA8D,CAAC","sourcesContent":["// @ts-nocheck\n/**\n * TypeBox schemas for subagent tool parameters\n */\n\nimport { Type } from \"typebox\";\n\nfunction keepTopLevelParameterDescriptions<T>(schema: T): T {\n\treturn pruneNestedDescriptions(schema, []) as T;\n}\n\nfunction pruneNestedDescriptions(value: unknown, path: string[]): unknown {\n\tif (!value || typeof value !== \"object\") return value;\n\n\tconst result = Array.isArray(value) ? [] : Object.create(Object.getPrototypeOf(value));\n\tfor (const key of Reflect.ownKeys(value)) {\n\t\tconst descriptor = Object.getOwnPropertyDescriptor(value, key);\n\t\tif (!descriptor) continue;\n\t\tif (key === \"description\" && !isTopLevelParameterDescription(path)) continue;\n\t\tif (\"value\" in descriptor) {\n\t\t\tconst nextPath = typeof key === \"string\" ? [...path, key] : path;\n\t\t\tdescriptor.value = pruneNestedDescriptions(descriptor.value, nextPath);\n\t\t}\n\t\tObject.defineProperty(result, key, descriptor);\n\t}\n\treturn result;\n}\n\nfunction isTopLevelParameterDescription(path: string[]): boolean {\n\treturn path.length === 2 && path[0] === \"properties\";\n}\n\nconst SkillOverride = Type.Unsafe({\n\tanyOf: [\n\t\t{ type: \"array\", items: { type: \"string\" } },\n\t\t{ type: \"boolean\" },\n\t\t{ type: \"string\" },\n\t],\n\tdescription: \"Skill name(s) to make available (comma-separated), array of strings, or boolean (false disables, true uses default)\",\n});\n\nconst OutputOverride = Type.Unsafe({\n\tanyOf: [\n\t\t{ type: \"string\" },\n\t\t{ type: \"boolean\" },\n\t],\n\tdescription: \"Output filename/path (string), or false to disable file output\",\n});\n\nconst OutputModeOverride = Type.String({\n\tenum: [\"inline\", \"file-only\"],\n\tdescription: \"Return saved output inline (default) or only a concise file reference. file-only requires output to be a path.\",\n});\n\n// lunr: model tier override for 3-tier subagent routing; resolved through the\n// @lunr/model-tiers bridge and ignored when tier mode is disabled.\nconst TierOverride = Type.String({\n\tenum: [\"light\", \"standard\", \"heavy\"],\n\tdescription: \"Model tier ('light' cheap/fast, 'standard' typical, 'heavy' complex reasoning) when model tiers are enabled. An explicit model overrides the tier; omit both to inherit the parent model.\",\n});\n\nconst ReadsOverride = Type.Unsafe({\n\tanyOf: [\n\t\t{ type: \"array\", items: { type: \"string\" } },\n\t\t{ type: \"boolean\" },\n\t],\n\tdescription: \"Files to read before running (array of filenames), or false to disable\",\n});\n\nconst JsonSchemaObject = Type.Unsafe({\n\ttype: \"object\",\n\tadditionalProperties: true,\n\tdescription: \"JSON Schema object for strict structured output. Non-object roots are rejected.\",\n});\n\nconst AcceptanceOverride = Type.Unsafe({\n\tanyOf: [\n\t\t{ type: \"string\", enum: [\"auto\", \"attested\", \"checked\", \"verified\", \"reviewed\"] },\n\t\t{ type: \"boolean\", enum: [false] },\n\t\t{ type: \"object\", additionalProperties: true },\n\t],\n\tdescription: \"Optional acceptance policy. Omitted means auto-inferred; verified requires configured runtime commands. Reviewed is inferred-only because explicit runs cannot supply an independent reviewer result. Bare \\\"none\\\" requires { level: \\\"none\\\", reason: \\\"...\\\" }, while false is deprecated.\",\n});\n\nconst TurnBudgetOverride = Type.Object({\n\tmaxTurns: Type.Integer({ minimum: 1 }),\n\tgraceTurns: Type.Optional(Type.Integer({ minimum: 0 })),\n}, { additionalProperties: false, description: \"Optional assistant-turn budget. At maxTurns the child is asked to wrap up; after graceTurns additional assistant turns it is aborted and partial output is returned.\" });\n\nconst ToolBudgetBlock = Type.Unsafe({\n\tanyOf: [\n\t\t{ type: \"array\", minItems: 1, items: { type: \"string\", minLength: 1 } },\n\t\t{ type: \"string\", enum: [\"*\"] },\n\t],\n});\n\nconst ToolBudgetOverride = Type.Object({\n\tsoft: Type.Optional(Type.Integer({ minimum: 1 })),\n\thard: Type.Integer({ minimum: 1 }),\n\tblock: Type.Optional(ToolBudgetBlock),\n}, { additionalProperties: false, description: \"Optional child tool-call budget. soft nudges the child; after hard, block tools (default read/grep/find/ls, or '*' for all tools) are blocked so the child can finalize.\" });\n\nconst TaskItem = Type.Object({\n\tagent: Type.String(), \n\ttask: Type.String(), \n\tcwd: Type.Optional(Type.String()),\n\tcount: Type.Optional(Type.Integer({ minimum: 1, description: \"Repeat this parallel task N times with the same settings.\" })),\n\toutput: Type.Optional(OutputOverride),\n\toutputMode: Type.Optional(OutputModeOverride),\n\treads: Type.Optional(ReadsOverride),\n\tprogress: Type.Optional(Type.Boolean({ description: \"Enable progress.md tracking for this task\" })),\n\tmodel: Type.Optional(Type.String({ description: \"Override model for this task (e.g. 'google/gemini-3-pro')\" })),\n\ttier: Type.Optional(TierOverride), // lunr: model tiers\n\tskill: Type.Optional(SkillOverride),\n\ttoolBudget: Type.Optional(ToolBudgetOverride),\n\tacceptance: Type.Optional(AcceptanceOverride),\n});\n\n// Parallel task item (within a parallel step)\nexport const ParallelTaskSchema = Type.Object({\n\tagent: Type.String(),\n\ttask: Type.Optional(Type.String({ description: \"Task template with {task}, {previous}, {chain_dir} variables. Defaults to {previous}.\" })),\n\tphase: Type.Optional(Type.String({ description: \"Optional phase/group label for status and graph rendering.\" })),\n\tlabel: Type.Optional(Type.String({ description: \"Optional user-facing label for this parallel task.\" })),\n\tas: Type.Optional(Type.String({ description: \"Optional safe identifier used as {outputs.name} in later chain steps.\" })),\n\toutputSchema: Type.Optional(JsonSchemaObject),\n\tcwd: Type.Optional(Type.String()),\n\tcount: Type.Optional(Type.Integer({ minimum: 1, description: \"Repeat this parallel task N times with the same settings.\" })),\n\toutput: Type.Optional(OutputOverride),\n\toutputMode: Type.Optional(OutputModeOverride),\n\treads: Type.Optional(ReadsOverride),\n\tprogress: Type.Optional(Type.Boolean({ description: \"Enable progress.md tracking in {chain_dir}\" })),\n\tskill: Type.Optional(SkillOverride),\n\tmodel: Type.Optional(Type.String({ description: \"Override model for this task\" })),\n\ttier: Type.Optional(TierOverride), // lunr: model tiers\n\ttoolBudget: Type.Optional(ToolBudgetOverride),\n\tacceptance: Type.Optional(AcceptanceOverride),\n});\n\nexport const DynamicExpandSchema = Type.Object({\n\tfrom: Type.Object({\n\t\toutput: Type.String({ description: \"Prior named structured output to expand from.\" }),\n\t\tpath: Type.String({ description: \"JSON Pointer into the structured output, e.g. /items.\" }),\n\t}, { additionalProperties: false }),\n\titem: Type.Optional(Type.String({ description: \"Template variable name for each item. Defaults to item.\" })),\n\tkey: Type.Optional(Type.String({ description: \"JSON Pointer relative to each item for stable child ids.\" })),\n\tmaxItems: Type.Optional(Type.Integer({ minimum: 0, description: \"Required fanout bound unless configured globally.\" })),\n\tonEmpty: Type.Optional(Type.String({ enum: [\"skip\", \"fail\"], description: \"Empty input behavior. Defaults to skip.\" })),\n}, { additionalProperties: false });\n\nexport const DynamicParallelTemplateSchema = Type.Object({\n\tagent: Type.String(),\n\ttask: Type.Optional(Type.String({ description: \"Task template with {item}, {item.path}, {task}, {previous}, {chain_dir}, and {outputs.name} variables.\" })),\n\tphase: Type.Optional(Type.String({ description: \"Optional phase/group label for status and graph rendering.\" })),\n\tlabel: Type.Optional(Type.String({ description: \"Optional user-facing label; item templates are supported.\" })),\n\toutputSchema: Type.Optional(JsonSchemaObject),\n\tcwd: Type.Optional(Type.String()),\n\toutput: Type.Optional(OutputOverride),\n\toutputMode: Type.Optional(OutputModeOverride),\n\treads: Type.Optional(ReadsOverride),\n\tprogress: Type.Optional(Type.Boolean({ description: \"Enable progress.md tracking in {chain_dir}\" })),\n\tskill: Type.Optional(SkillOverride),\n\tmodel: Type.Optional(Type.String({ description: \"Override model for this task\" })),\n\ttier: Type.Optional(TierOverride), // lunr: model tiers\n\ttoolBudget: Type.Optional(ToolBudgetOverride),\n\tacceptance: Type.Optional(AcceptanceOverride),\n}, { additionalProperties: false });\n\nexport const DynamicCollectSchema = Type.Object({\n\tas: Type.String({ description: \"Safe output name for the ordered collected result array.\" }),\n\toutputSchema: Type.Optional(JsonSchemaObject),\n}, { additionalProperties: false });\n\n// Flattened so chain steps do not need an object-shape anyOf/oneOf union.\nexport const ChainItem = Type.Object({\n\tagent: Type.Optional(Type.String({ description: \"Sequential step agent name\" })),\n\ttask: Type.Optional(Type.String({\n\t\tdescription: \"Task template with variables: {task}=original request, {previous}=prior step's text response, {chain_dir}=shared folder, {outputs.name}=prior named output. Required for first step, defaults to '{previous}' for subsequent steps.\"\n\t})),\n\tphase: Type.Optional(Type.String({ description: \"Optional phase/group label for status and graph rendering.\" })),\n\tlabel: Type.Optional(Type.String({ description: \"Optional user-facing label for this chain step.\" })),\n\tas: Type.Optional(Type.String({ description: \"Optional safe identifier used as {outputs.name} in later chain steps.\" })),\n\toutputSchema: Type.Optional(JsonSchemaObject),\n\tcwd: Type.Optional(Type.String()),\n\toutput: Type.Optional(OutputOverride),\n\toutputMode: Type.Optional(OutputModeOverride),\n\treads: Type.Optional(ReadsOverride),\n\tprogress: Type.Optional(Type.Boolean({ description: \"Enable progress.md tracking in {chain_dir}\" })),\n\tskill: Type.Optional(SkillOverride),\n\tmodel: Type.Optional(Type.String({ description: \"Override model for this step\" })),\n\ttier: Type.Optional(TierOverride), // lunr: model tiers\n\ttoolBudget: Type.Optional(ToolBudgetOverride),\n\tacceptance: Type.Optional(AcceptanceOverride),\n\tparallel: Type.Optional(Type.Unsafe({\n\t\tanyOf: [\n\t\t\tType.Array(ParallelTaskSchema, { minItems: 1, description: \"Tasks to run in parallel\" }),\n\t\t\tDynamicParallelTemplateSchema,\n\t\t],\n\t\tdescription: \"Static parallel tasks array, or a single dynamic fanout child template when expand/collect are present.\",\n\t})),\n\texpand: Type.Optional(DynamicExpandSchema),\n\tcollect: Type.Optional(DynamicCollectSchema),\n\tconcurrency: Type.Optional(Type.Number({ description: \"Max concurrent tasks (default: 4)\" })),\n\tfailFast: Type.Optional(Type.Boolean({ description: \"Stop on first failure (default: false)\" })),\n\tworktree: Type.Optional(Type.Boolean({\n\t\tdescription: \"Create isolated git worktrees for each parallel task.\"\n\t})),\n}, {\n\tdescription: \"Chain step: use {agent, task?, ...} for sequential, {parallel: [...]} for static concurrent execution, or {expand, parallel: {...}, collect} for dynamic fanout.\",\n\tadditionalProperties: false,\n});\n\nconst ControlOverrides = Type.Object({\n\tenabled: Type.Optional(Type.Boolean({ description: \"Enable/disable subagent control attention tracking for this run\" })),\n\tneedsAttentionAfterMs: Type.Optional(Type.Integer({ minimum: 1, description: \"No-observed-activity window before a run needs attention\" })),\n\tactiveNoticeAfterMs: Type.Optional(Type.Integer({ minimum: 1, description: \"Active-long-running notice threshold by elapsed ms (default: 240000)\" })),\n\tactiveNoticeAfterTurns: Type.Optional(Type.Integer({ minimum: 1, description: \"Optional active-long-running notice threshold by assistant turns (disabled by default)\" })),\n\tactiveNoticeAfterTokens: Type.Optional(Type.Integer({ minimum: 1, description: \"Optional active-long-running notice threshold by total tokens (disabled by default)\" })),\n\tfailedToolAttemptsBeforeAttention: Type.Optional(Type.Integer({ minimum: 1, description: \"Consecutive mutating-tool failures before escalating to needs_attention (default: 3)\" })),\n\tnotifyOn: Type.Optional(Type.Array(Type.String({ enum: [\"active_long_running\", \"needs_attention\"] }), {\n\t\tdescription: \"Control event types that should notify the parent/orchestrator. Defaults to active_long_running and needs_attention.\",\n\t})),\n\tnotifyChannels: Type.Optional(Type.Array(Type.String({ enum: [\"event\", \"async\", \"intercom\"] }), {\n\t\tdescription: \"Notification channels to use when available. Defaults to event, async, and intercom.\",\n\t})),\n});\n\nconst SubagentParamsSchema = Type.Object({\n\tagent: Type.Optional(Type.String({ description: \"Agent name (SINGLE mode) or target for management get/update/delete\" })),\n\ttask: Type.Optional(Type.String({ description: \"Task (SINGLE mode, optional for self-contained agents)\" })),\n\t// Management action (when present, tool operates in management mode)\n\taction: Type.Optional(Type.String({\n\t\tdescription: \"Management/control action only. Must be omitted for execution mode (single, parallel, or chain).\"\n\t})),\n\tid: Type.Optional(Type.String({\n\t\tdescription: \"Run id or prefix for action='status', action='interrupt', action='stop', action='resume', action='steer', or action='append-step'.\"\n\t})),\n\trunId: Type.Optional(Type.String({\n\t\tdescription: \"Target run ID for action='interrupt', action='stop', action='resume', action='steer', or action='append-step'. Prefer id for new calls.\"\n\t})),\n\tdir: Type.Optional(Type.String({\n\t\tdescription: \"Async run directory for action='status', action='stop', action='resume', or action='steer'.\"\n\t})),\n\tindex: Type.Optional(Type.Integer({ minimum: 0, description: \"Zero-based child index for actions that target a specific child or transcript.\" })),\n\tview: Type.Optional(Type.String({\n\t\tenum: [\"fleet\", \"transcript\"],\n\t\tdescription: \"Optional status view. Use view='fleet' for a read-only active foreground/async fleet surface, or view='transcript' with id/dir (and optional index) to tail a run transcript.\",\n\t})),\n\tlines: Type.Optional(Type.Integer({ minimum: 1, maximum: 500, description: \"Maximum transcript lines for action='status', view='transcript'. Defaults to 80.\" })),\n\tmessage: Type.Optional(Type.String({ description: \"Follow-up message for action='resume' or non-terminal guidance for action='steer'. Use index to choose a child from multi-child runs.\" })),\n\tscope: Type.Optional(Type.String({ enum: [\"session\", \"user\", \"project\"], description: \"Scope for action='watchdog.configure'. Defaults to session to avoid persistent settings writes unless user/project is explicit.\" })),\n\ttarget: Type.Optional(Type.String({ enum: [\"main\", \"children\", \"child\"], description: \"Target for action='watchdog.configure'. Defaults to main. Use target='child' with agent for a per-agent child watchdog override.\" })),\n\tthinking: Type.Optional(Type.Unsafe({ anyOf: [{ type: \"string\" }, { type: \"boolean\", enum: [false] }], description: \"Thinking level for action='watchdog.configure' (off/minimal/low/medium/high/xhigh/max, inherit, or false for off).\" })),\n\tschedule: Type.Optional(Type.String({ description: \"Explicit one-shot schedule for action='schedule'. Only honored when scheduledRuns.enabled is true. Use '+10m' or a future ISO timestamp with timezone; scheduled runs always launch async with fresh context.\" })),\n\tscheduleName: Type.Optional(Type.String({ description: \"Optional display name for action='schedule'.\" })),\n\t// Chain identifier for management (can't reuse 'chain' — that's the execution array)\n\tchainName: Type.Optional(Type.String({\n\t\tdescription: \"Chain name for get/update/delete management actions\"\n\t})),\n\t// Agent/chain configuration for create/update (nested to avoid conflicts with execution fields)\n\tconfig: Type.Optional(Type.Unsafe({\n\t\tanyOf: [\n\t\t\t{ type: \"object\", additionalProperties: true },\n\t\t\t{ type: \"string\" },\n\t\t],\n\t\tdescription: \"Agent/chain config for create/update. Object or JSON string; presence of steps creates a chain.\"\n\t})),\n\ttasks: Type.Optional(Type.Array(TaskItem, { description: \"PARALLEL mode: [{agent, task, count?, output?, outputMode?, reads?, progress?}, ...]\" })),\n\tconcurrency: Type.Optional(Type.Integer({ minimum: 1, description: \"Top-level PARALLEL mode only: max concurrent tasks. Defaults to config.parallel.concurrency or 4.\" })),\n\tworktree: Type.Optional(Type.Boolean({\n\t\tdescription: \"Create isolated git worktrees for parallel tasks; requires clean git state.\"\n\t})),\n\tchain: Type.Optional(Type.Array(ChainItem, { description: \"CHAIN mode: sequential steps; each result becomes {previous}. append-step takes one tail step and may use {chain_dir}/{outputs.name}.\" })),\n\tcontext: Type.Optional(Type.String({\n\t\tenum: [\"fresh\"],\n\t\tdescription: \"Children always start with a fresh session. Fork context is not available.\",\n\t})),\n\tchainDir: Type.Optional(Type.String({ description: \"Persistent chain artifact directory; defaults to user-scoped temp storage.\" })),\n\tasync: Type.Optional(Type.Boolean({ description: \"Run in background (default: false, or per config)\" })),\n\ttimeoutMs: Type.Optional(Type.Integer({ minimum: 1, description: \"Optional run-level timeout in ms for foreground and async/background runs. Alias of maxRuntimeMs.\" })),\n\tmaxRuntimeMs: Type.Optional(Type.Integer({ minimum: 1, description: \"Alias of timeoutMs for optional run-level timeout in foreground and async/background runs.\" })),\n\tturnBudget: Type.Optional(TurnBudgetOverride),\n\ttoolBudget: Type.Optional(ToolBudgetOverride),\n\tagentScope: Type.Optional(Type.String({ description: \"Agent discovery scope: 'user', 'project', or 'both' (default: 'both'; project wins on name collisions)\" })),\n\tcwd: Type.Optional(Type.String()),\n\tartifacts: Type.Optional(Type.Boolean({ description: \"Write debug artifacts (default: true)\" })),\n\tincludeProgress: Type.Optional(Type.Boolean({ description: \"Include full progress in result (default: false)\" })),\n\tshare: Type.Optional(Type.Boolean({ description: \"Upload session to GitHub Gist for sharing (default: false)\" })),\n\tsessionDir: Type.Optional(\n\t\tType.String({ description: \"Directory to store session logs (default: temp; enables sessions even if share=false)\" }),\n\t),\n\t// Clarification TUI\n\tclarify: Type.Optional(Type.Boolean({ description: \"Show TUI to preview/edit before execution. Explicit clarify: true keeps the run foreground for the clarify UI; omitted clarify can still run in the background when async: true is set.\" })),\n\tcontrol: Type.Optional(ControlOverrides),\n\t// Solo agent overrides\n\toutput: Type.Optional(Type.Unsafe({\n\t\tanyOf: [\n\t\t\t{ type: \"string\" },\n\t\t\t{ type: \"boolean\" },\n\t\t],\n\t\tdescription: \"Output file for single agent (string), or false to disable. Relative paths resolve against cwd.\",\n\t})),\n\toutputMode: Type.Optional(OutputModeOverride),\n\tskill: Type.Optional(SkillOverride),\n\tmodel: Type.Optional(Type.String({ description: \"Override model for single agent (e.g. 'anthropic/claude-sonnet-4')\" })),\n\ttier: Type.Optional(TierOverride), // lunr: model tiers\n\tacceptance: Type.Optional(AcceptanceOverride),\n});\n\nexport const SubagentParams = keepTopLevelParameterDescriptions(SubagentParamsSchema);\n\nconst SubagentWaitParamsSchema = Type.Object({\n\tid: Type.Optional(Type.String({\n\t\tdescription: \"Async run or remembered detached foreground run id/prefix to wait for one specific run. Omit to wait across every active async run started in this session.\",\n\t})),\n\tall: Type.Optional(Type.Boolean({\n\t\tdescription: \"Wait for ALL active runs to finish. Default false: return as soon as the first run finishes, so a fleet manager can spawn a replacement and wait again. Ignored when id targets a single run.\",\n\t})),\n\ttimeoutMs: Type.Optional(Type.Integer({\n\t\tminimum: 1,\n\t\tdescription: \"Give up waiting after this many milliseconds (the runs keep going regardless). Defaults to 1800000 (30 minutes).\",\n\t})),\n});\n\nexport const SubagentWaitParams = keepTopLevelParameterDescriptions(SubagentWaitParamsSchema);\n"]}
1
+ {"version":3,"file":"schemas.d.ts","sourceRoot":"","sources":["../../../../../src/builtin-extensions/pi-subagents/src/extension/schemas.ts"],"names":[],"mappings":"AACA;;GAEG;AAEH,OAAO,EAAE,IAAI,EAAE,MAAM,SAAS,CAAC;AAkH/B,eAAO,MAAM,kBAAkB;;;;;;;;;;;;;;;;;;;;;;EAkB7B,CAAC;AAEH,eAAO,MAAM,mBAAmB;;;;;;;;;EASG,CAAC;AAEpC,eAAO,MAAM,6BAA6B;;;;;;;;;;;;;;;;;;;;EAgBP,CAAC;AAEpC,eAAO,MAAM,oBAAoB;;;EAGE,CAAC;AAGpC,eAAO,MAAM,SAAS;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAoCpB,CAAC;AAmGH,eAAO,MAAM,cAAc;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAA0D,CAAC;AAetF,eAAO,MAAM,kBAAkB;;;;EAA8D,CAAC","sourcesContent":["// @ts-nocheck\n/**\n * TypeBox schemas for subagent tool parameters\n */\n\nimport { Type } from \"typebox\";\n\nfunction keepTopLevelParameterDescriptions<T>(schema: T): T {\n\treturn pruneNestedDescriptions(schema, []) as T;\n}\n\nfunction pruneNestedDescriptions(value: unknown, path: string[]): unknown {\n\tif (!value || typeof value !== \"object\") return value;\n\n\tconst result = Array.isArray(value) ? [] : Object.create(Object.getPrototypeOf(value));\n\tfor (const key of Reflect.ownKeys(value)) {\n\t\tconst descriptor = Object.getOwnPropertyDescriptor(value, key);\n\t\tif (!descriptor) continue;\n\t\tif (key === \"description\" && !isTopLevelParameterDescription(path)) continue;\n\t\tif (\"value\" in descriptor) {\n\t\t\tconst nextPath = typeof key === \"string\" ? [...path, key] : path;\n\t\t\tdescriptor.value = pruneNestedDescriptions(descriptor.value, nextPath);\n\t\t}\n\t\tObject.defineProperty(result, key, descriptor);\n\t}\n\treturn result;\n}\n\nfunction isTopLevelParameterDescription(path: string[]): boolean {\n\treturn path.length === 2 && path[0] === \"properties\";\n}\n\nconst SkillOverride = Type.Unsafe({\n\tanyOf: [\n\t\t{ type: \"array\", items: { type: \"string\" } },\n\t\t{ type: \"boolean\" },\n\t\t{ type: \"string\" },\n\t],\n\tdescription: \"Skill name(s) to make available (comma-separated), array of strings, or boolean (false disables, true uses default)\",\n});\n\nconst OutputOverride = Type.Unsafe({\n\tanyOf: [\n\t\t{ type: \"string\" },\n\t\t{ type: \"boolean\" },\n\t],\n\tdescription: \"Output filename/path (string), or false to disable file output\",\n});\n\nconst OutputModeOverride = Type.String({\n\tenum: [\"inline\", \"file-only\"],\n\tdescription: \"Return saved output inline (default) or only a concise file reference. file-only requires output to be a path.\",\n});\n\n// lunr: model tier override for 3-tier subagent routing; resolved through the\n// @lunr/model-tiers bridge and ignored when tier mode is disabled.\nconst TierOverride = Type.String({\n\tenum: [\"light\", \"standard\", \"heavy\"],\n\tdescription: \"Model tier ('light' cheap/fast, 'standard' typical, 'heavy' complex reasoning) when model tiers are enabled. An explicit model overrides the tier; omit both to inherit the parent model.\",\n});\n\nconst ReadsOverride = Type.Unsafe({\n\tanyOf: [\n\t\t{ type: \"array\", items: { type: \"string\" } },\n\t\t{ type: \"boolean\" },\n\t],\n\tdescription: \"Files to read before running (array of filenames), or false to disable\",\n});\n\nconst JsonSchemaObject = Type.Unsafe({\n\ttype: \"object\",\n\tadditionalProperties: true,\n\tdescription: \"JSON Schema object for strict structured output. Non-object roots are rejected.\",\n});\n\nconst AcceptanceOverride = Type.Unsafe({\n\tanyOf: [\n\t\t{ type: \"string\", enum: [\"auto\", \"attested\", \"checked\", \"verified\", \"reviewed\"] },\n\t\t{ type: \"boolean\", enum: [false] },\n\t\t{ type: \"object\", additionalProperties: true },\n\t],\n\tdescription: \"Optional acceptance policy. Omitted means auto-inferred; verified requires configured runtime commands. Reviewed is inferred-only because explicit runs cannot supply an independent reviewer result. Bare \\\"none\\\" requires { level: \\\"none\\\", reason: \\\"...\\\" }, while false is deprecated.\",\n});\n\nconst TurnBudgetOverride = Type.Object({\n\tmaxTurns: Type.Integer({ minimum: 1 }),\n\tgraceTurns: Type.Optional(Type.Integer({ minimum: 0 })),\n}, { additionalProperties: false, description: \"Optional assistant-turn budget. At maxTurns the child is asked to wrap up; after graceTurns additional assistant turns it is aborted and partial output is returned.\" });\n\nconst ToolBudgetBlock = Type.Unsafe({\n\tanyOf: [\n\t\t{ type: \"array\", minItems: 1, items: { type: \"string\", minLength: 1 } },\n\t\t{ type: \"string\", enum: [\"*\"] },\n\t],\n});\n\nconst ToolBudgetOverride = Type.Object({\n\tsoft: Type.Optional(Type.Integer({ minimum: 1 })),\n\thard: Type.Integer({ minimum: 1 }),\n\tblock: Type.Optional(ToolBudgetBlock),\n}, { additionalProperties: false, description: \"Optional child tool-call budget. soft nudges the child; after hard, block tools (default read/grep/find/ls, or '*' for all tools) are blocked so the child can finalize.\" });\n\nconst TaskItem = Type.Object({\n\tagent: Type.String(), \n\ttask: Type.String(), \n\tcwd: Type.Optional(Type.String()),\n\tcount: Type.Optional(Type.Integer({ minimum: 1, description: \"Repeat this parallel task N times with the same settings.\" })),\n\toutput: Type.Optional(OutputOverride),\n\toutputMode: Type.Optional(OutputModeOverride),\n\treads: Type.Optional(ReadsOverride),\n\tprogress: Type.Optional(Type.Boolean({ description: \"Enable progress.md tracking for this task\" })),\n\tmodel: Type.Optional(Type.String({ description: \"Override model for this task (e.g. 'google/gemini-3-pro')\" })),\n\ttier: Type.Optional(TierOverride), // lunr: model tiers\n\tskill: Type.Optional(SkillOverride),\n\ttoolBudget: Type.Optional(ToolBudgetOverride),\n\tacceptance: Type.Optional(AcceptanceOverride),\n});\n\n// Parallel task item (within a parallel step)\nexport const ParallelTaskSchema = Type.Object({\n\tagent: Type.String(),\n\ttask: Type.Optional(Type.String({ description: \"Task template with {task}, {previous}, {chain_dir} variables. Defaults to {previous}.\" })),\n\tphase: Type.Optional(Type.String({ description: \"Optional phase/group label for status and graph rendering.\" })),\n\tlabel: Type.Optional(Type.String({ description: \"Optional user-facing label for this parallel task.\" })),\n\tas: Type.Optional(Type.String({ description: \"Optional safe identifier used as {outputs.name} in later chain steps.\" })),\n\toutputSchema: Type.Optional(JsonSchemaObject),\n\tcwd: Type.Optional(Type.String()),\n\tcount: Type.Optional(Type.Integer({ minimum: 1, description: \"Repeat this parallel task N times with the same settings.\" })),\n\toutput: Type.Optional(OutputOverride),\n\toutputMode: Type.Optional(OutputModeOverride),\n\treads: Type.Optional(ReadsOverride),\n\tprogress: Type.Optional(Type.Boolean({ description: \"Enable progress.md tracking in {chain_dir}\" })),\n\tskill: Type.Optional(SkillOverride),\n\tmodel: Type.Optional(Type.String({ description: \"Override model for this task\" })),\n\ttier: Type.Optional(TierOverride), // lunr: model tiers\n\ttoolBudget: Type.Optional(ToolBudgetOverride),\n\tacceptance: Type.Optional(AcceptanceOverride),\n});\n\nexport const DynamicExpandSchema = Type.Object({\n\tfrom: Type.Object({\n\t\toutput: Type.String({ description: \"Prior named structured output to expand from.\" }),\n\t\tpath: Type.String({ description: \"JSON Pointer into the structured output, e.g. /items.\" }),\n\t}, { additionalProperties: false }),\n\titem: Type.Optional(Type.String({ description: \"Template variable name for each item. Defaults to item.\" })),\n\tkey: Type.Optional(Type.String({ description: \"JSON Pointer relative to each item for stable child ids.\" })),\n\tmaxItems: Type.Optional(Type.Integer({ minimum: 0, description: \"Required fanout bound unless configured globally.\" })),\n\tonEmpty: Type.Optional(Type.String({ enum: [\"skip\", \"fail\"], description: \"Empty input behavior. Defaults to skip.\" })),\n}, { additionalProperties: false });\n\nexport const DynamicParallelTemplateSchema = Type.Object({\n\tagent: Type.String(),\n\ttask: Type.Optional(Type.String({ description: \"Task template with {item}, {item.path}, {task}, {previous}, {chain_dir}, and {outputs.name} variables.\" })),\n\tphase: Type.Optional(Type.String({ description: \"Optional phase/group label for status and graph rendering.\" })),\n\tlabel: Type.Optional(Type.String({ description: \"Optional user-facing label; item templates are supported.\" })),\n\toutputSchema: Type.Optional(JsonSchemaObject),\n\tcwd: Type.Optional(Type.String()),\n\toutput: Type.Optional(OutputOverride),\n\toutputMode: Type.Optional(OutputModeOverride),\n\treads: Type.Optional(ReadsOverride),\n\tprogress: Type.Optional(Type.Boolean({ description: \"Enable progress.md tracking in {chain_dir}\" })),\n\tskill: Type.Optional(SkillOverride),\n\tmodel: Type.Optional(Type.String({ description: \"Override model for this task\" })),\n\ttier: Type.Optional(TierOverride), // lunr: model tiers\n\ttoolBudget: Type.Optional(ToolBudgetOverride),\n\tacceptance: Type.Optional(AcceptanceOverride),\n}, { additionalProperties: false });\n\nexport const DynamicCollectSchema = Type.Object({\n\tas: Type.String({ description: \"Safe output name for the ordered collected result array.\" }),\n\toutputSchema: Type.Optional(JsonSchemaObject),\n}, { additionalProperties: false });\n\n// Flattened so chain steps do not need an object-shape anyOf/oneOf union.\nexport const ChainItem = Type.Object({\n\tagent: Type.Optional(Type.String({ description: \"Sequential step agent name\" })),\n\ttask: Type.Optional(Type.String({\n\t\tdescription: \"Task template with variables: {task}=original request, {previous}=prior step's text response, {chain_dir}=shared folder, {outputs.name}=prior named output. Required for first step, defaults to '{previous}' for subsequent steps.\"\n\t})),\n\tphase: Type.Optional(Type.String({ description: \"Optional phase/group label for status and graph rendering.\" })),\n\tlabel: Type.Optional(Type.String({ description: \"Optional user-facing label for this chain step.\" })),\n\tas: Type.Optional(Type.String({ description: \"Optional safe identifier used as {outputs.name} in later chain steps.\" })),\n\toutputSchema: Type.Optional(JsonSchemaObject),\n\tcwd: Type.Optional(Type.String()),\n\toutput: Type.Optional(OutputOverride),\n\toutputMode: Type.Optional(OutputModeOverride),\n\treads: Type.Optional(ReadsOverride),\n\tprogress: Type.Optional(Type.Boolean({ description: \"Enable progress.md tracking in {chain_dir}\" })),\n\tskill: Type.Optional(SkillOverride),\n\tmodel: Type.Optional(Type.String({ description: \"Override model for this step\" })),\n\ttier: Type.Optional(TierOverride), // lunr: model tiers\n\ttoolBudget: Type.Optional(ToolBudgetOverride),\n\tacceptance: Type.Optional(AcceptanceOverride),\n\tparallel: Type.Optional(Type.Unsafe({\n\t\tanyOf: [\n\t\t\tType.Array(ParallelTaskSchema, { minItems: 1, description: \"Tasks to run in parallel\" }),\n\t\t\tDynamicParallelTemplateSchema,\n\t\t],\n\t\tdescription: \"Static parallel tasks array, or a single dynamic fanout child template when expand/collect are present.\",\n\t})),\n\texpand: Type.Optional(DynamicExpandSchema),\n\tcollect: Type.Optional(DynamicCollectSchema),\n\tconcurrency: Type.Optional(Type.Number({ description: \"Max concurrent tasks (default: unlimited)\" })),\n\tfailFast: Type.Optional(Type.Boolean({ description: \"Stop on first failure (default: false)\" })),\n\tworktree: Type.Optional(Type.Boolean({\n\t\tdescription: \"Create isolated git worktrees for each parallel task.\"\n\t})),\n}, {\n\tdescription: \"Chain step: use {agent, task?, ...} for sequential, {parallel: [...]} for static concurrent execution, or {expand, parallel: {...}, collect} for dynamic fanout.\",\n\tadditionalProperties: false,\n});\n\nconst ControlOverrides = Type.Object({\n\tenabled: Type.Optional(Type.Boolean({ description: \"Enable/disable subagent control attention tracking for this run\" })),\n\tneedsAttentionAfterMs: Type.Optional(Type.Integer({ minimum: 1, description: \"No-observed-activity window before a run needs attention\" })),\n\tactiveNoticeAfterMs: Type.Optional(Type.Integer({ minimum: 1, description: \"Active-long-running notice threshold by elapsed ms (default: 240000)\" })),\n\tactiveNoticeAfterTurns: Type.Optional(Type.Integer({ minimum: 1, description: \"Optional active-long-running notice threshold by assistant turns (disabled by default)\" })),\n\tactiveNoticeAfterTokens: Type.Optional(Type.Integer({ minimum: 1, description: \"Optional active-long-running notice threshold by total tokens (disabled by default)\" })),\n\tfailedToolAttemptsBeforeAttention: Type.Optional(Type.Integer({ minimum: 1, description: \"Consecutive mutating-tool failures before escalating to needs_attention (default: 3)\" })),\n\tnotifyOn: Type.Optional(Type.Array(Type.String({ enum: [\"active_long_running\", \"needs_attention\"] }), {\n\t\tdescription: \"Control event types that should notify the parent/orchestrator. Defaults to active_long_running and needs_attention.\",\n\t})),\n\tnotifyChannels: Type.Optional(Type.Array(Type.String({ enum: [\"event\", \"async\", \"intercom\"] }), {\n\t\tdescription: \"Notification channels to use when available. Defaults to event, async, and intercom.\",\n\t})),\n});\n\nconst SubagentParamsSchema = Type.Object({\n\tagent: Type.Optional(Type.String({ description: \"Agent name (SINGLE mode) or target for management get/update/delete\" })),\n\ttask: Type.Optional(Type.String({ description: \"Task (SINGLE mode, optional for self-contained agents)\" })),\n\t// Management action (when present, tool operates in management mode)\n\taction: Type.Optional(Type.String({\n\t\tdescription: \"Management/control action only. Must be omitted for execution mode (single, parallel, or chain).\"\n\t})),\n\tid: Type.Optional(Type.String({\n\t\tdescription: \"Run id or prefix for action='status', action='interrupt', action='stop', action='resume', action='steer', or action='append-step'.\"\n\t})),\n\trunId: Type.Optional(Type.String({\n\t\tdescription: \"Target run ID for action='interrupt', action='stop', action='resume', action='steer', or action='append-step'. Prefer id for new calls.\"\n\t})),\n\tdir: Type.Optional(Type.String({\n\t\tdescription: \"Async run directory for action='status', action='stop', action='resume', or action='steer'.\"\n\t})),\n\tindex: Type.Optional(Type.Integer({ minimum: 0, description: \"Zero-based child index for actions that target a specific child or transcript.\" })),\n\tview: Type.Optional(Type.String({\n\t\tenum: [\"fleet\", \"transcript\"],\n\t\tdescription: \"Optional status view. Use view='fleet' for a read-only active foreground/async fleet surface, or view='transcript' with id/dir (and optional index) to tail a run transcript.\",\n\t})),\n\tlines: Type.Optional(Type.Integer({ minimum: 1, maximum: 500, description: \"Maximum transcript lines for action='status', view='transcript'. Defaults to 80.\" })),\n\tmessage: Type.Optional(Type.String({ description: \"Follow-up message for action='resume' or non-terminal guidance for action='steer'. Use index to choose a child from multi-child runs.\" })),\n\tscope: Type.Optional(Type.String({ enum: [\"session\", \"user\", \"project\"], description: \"Scope for action='watchdog.configure'. Defaults to session to avoid persistent settings writes unless user/project is explicit.\" })),\n\ttarget: Type.Optional(Type.String({ enum: [\"main\", \"children\", \"child\"], description: \"Target for action='watchdog.configure'. Defaults to main. Use target='child' with agent for a per-agent child watchdog override.\" })),\n\tthinking: Type.Optional(Type.Unsafe({ anyOf: [{ type: \"string\" }, { type: \"boolean\", enum: [false] }], description: \"Thinking level for action='watchdog.configure' (off/minimal/low/medium/high/xhigh/max, inherit, or false for off).\" })),\n\tschedule: Type.Optional(Type.String({ description: \"Explicit one-shot schedule for action='schedule'. Only honored when scheduledRuns.enabled is true. Use '+10m' or a future ISO timestamp with timezone; scheduled runs always launch async with fresh context.\" })),\n\tscheduleName: Type.Optional(Type.String({ description: \"Optional display name for action='schedule'.\" })),\n\t// Chain identifier for management (can't reuse 'chain' — that's the execution array)\n\tchainName: Type.Optional(Type.String({\n\t\tdescription: \"Chain name for get/update/delete management actions\"\n\t})),\n\t// Agent/chain configuration for create/update (nested to avoid conflicts with execution fields)\n\tconfig: Type.Optional(Type.Unsafe({\n\t\tanyOf: [\n\t\t\t{ type: \"object\", additionalProperties: true },\n\t\t\t{ type: \"string\" },\n\t\t],\n\t\tdescription: \"Agent/chain config for create/update. Object or JSON string; presence of steps creates a chain.\"\n\t})),\n\ttasks: Type.Optional(Type.Array(TaskItem, { description: \"PARALLEL mode: [{agent, task, count?, output?, outputMode?, reads?, progress?}, ...]\" })),\n\tconcurrency: Type.Optional(Type.Integer({ minimum: 1, description: \"Top-level PARALLEL mode only: max concurrent tasks. Defaults to config.parallel.concurrency or unlimited.\" })),\n\tworktree: Type.Optional(Type.Boolean({\n\t\tdescription: \"Create isolated git worktrees for parallel tasks; requires clean git state.\"\n\t})),\n\tchain: Type.Optional(Type.Array(ChainItem, { description: \"CHAIN mode: sequential steps; each result becomes {previous}. append-step takes one tail step and may use {chain_dir}/{outputs.name}.\" })),\n\tcontext: Type.Optional(Type.String({\n\t\tenum: [\"fresh\"],\n\t\tdescription: \"Children always start with a fresh session. Fork context is not available.\",\n\t})),\n\tchainDir: Type.Optional(Type.String({ description: \"Persistent chain artifact directory; defaults to user-scoped temp storage.\" })),\n\tasync: Type.Optional(Type.Boolean({ description: \"Run in background (default: false, or per config)\" })),\n\ttimeoutMs: Type.Optional(Type.Integer({ minimum: 1, description: \"Optional run-level timeout in ms for foreground and async/background runs. Alias of maxRuntimeMs.\" })),\n\tmaxRuntimeMs: Type.Optional(Type.Integer({ minimum: 1, description: \"Alias of timeoutMs for optional run-level timeout in foreground and async/background runs.\" })),\n\tturnBudget: Type.Optional(TurnBudgetOverride),\n\ttoolBudget: Type.Optional(ToolBudgetOverride),\n\tagentScope: Type.Optional(Type.String({ description: \"Agent discovery scope: 'user', 'project', or 'both' (default: 'both'; project wins on name collisions)\" })),\n\tcwd: Type.Optional(Type.String()),\n\tartifacts: Type.Optional(Type.Boolean({ description: \"Write debug artifacts (default: true)\" })),\n\tincludeProgress: Type.Optional(Type.Boolean({ description: \"Include full progress in result (default: false)\" })),\n\tshare: Type.Optional(Type.Boolean({ description: \"Upload session to GitHub Gist for sharing (default: false)\" })),\n\tsessionDir: Type.Optional(\n\t\tType.String({ description: \"Directory to store session logs (default: temp; enables sessions even if share=false)\" }),\n\t),\n\t// Clarification TUI\n\tclarify: Type.Optional(Type.Boolean({ description: \"Show TUI to preview/edit before execution. Explicit clarify: true keeps the run foreground for the clarify UI; omitted clarify can still run in the background when async: true is set.\" })),\n\tcontrol: Type.Optional(ControlOverrides),\n\t// Solo agent overrides\n\toutput: Type.Optional(Type.Unsafe({\n\t\tanyOf: [\n\t\t\t{ type: \"string\" },\n\t\t\t{ type: \"boolean\" },\n\t\t],\n\t\tdescription: \"Output file for single agent (string), or false to disable. Relative paths resolve against cwd.\",\n\t})),\n\toutputMode: Type.Optional(OutputModeOverride),\n\tskill: Type.Optional(SkillOverride),\n\tmodel: Type.Optional(Type.String({ description: \"Override model for single agent (e.g. 'anthropic/claude-sonnet-4')\" })),\n\ttier: Type.Optional(TierOverride), // lunr: model tiers\n\tacceptance: Type.Optional(AcceptanceOverride),\n});\n\nexport const SubagentParams = keepTopLevelParameterDescriptions(SubagentParamsSchema);\n\nconst SubagentWaitParamsSchema = Type.Object({\n\tid: Type.Optional(Type.String({\n\t\tdescription: \"Async run or remembered detached foreground run id/prefix to wait for one specific run. Omit to wait across every active async run started in this session.\",\n\t})),\n\tall: Type.Optional(Type.Boolean({\n\t\tdescription: \"Wait for ALL active runs to finish. Default false: return as soon as the first run finishes, so a fleet manager can spawn a replacement and wait again. Ignored when id targets a single run.\",\n\t})),\n\ttimeoutMs: Type.Optional(Type.Integer({\n\t\tminimum: 1,\n\t\tdescription: \"Give up waiting after this many milliseconds (the runs keep going regardless). Defaults to 1800000 (30 minutes).\",\n\t})),\n});\n\nexport const SubagentWaitParams = keepTopLevelParameterDescriptions(SubagentWaitParamsSchema);\n"]}
@@ -182,7 +182,7 @@ export const ChainItem = Type.Object({
182
182
  })),
183
183
  expand: Type.Optional(DynamicExpandSchema),
184
184
  collect: Type.Optional(DynamicCollectSchema),
185
- concurrency: Type.Optional(Type.Number({ description: "Max concurrent tasks (default: 4)" })),
185
+ concurrency: Type.Optional(Type.Number({ description: "Max concurrent tasks (default: unlimited)" })),
186
186
  failFast: Type.Optional(Type.Boolean({ description: "Stop on first failure (default: false)" })),
187
187
  worktree: Type.Optional(Type.Boolean({
188
188
  description: "Create isolated git worktrees for each parallel task."
@@ -246,7 +246,7 @@ const SubagentParamsSchema = Type.Object({
246
246
  description: "Agent/chain config for create/update. Object or JSON string; presence of steps creates a chain."
247
247
  })),
248
248
  tasks: Type.Optional(Type.Array(TaskItem, { description: "PARALLEL mode: [{agent, task, count?, output?, outputMode?, reads?, progress?}, ...]" })),
249
- concurrency: Type.Optional(Type.Integer({ minimum: 1, description: "Top-level PARALLEL mode only: max concurrent tasks. Defaults to config.parallel.concurrency or 4." })),
249
+ concurrency: Type.Optional(Type.Integer({ minimum: 1, description: "Top-level PARALLEL mode only: max concurrent tasks. Defaults to config.parallel.concurrency or unlimited." })),
250
250
  worktree: Type.Optional(Type.Boolean({
251
251
  description: "Create isolated git worktrees for parallel tasks; requires clean git state."
252
252
  })),
@@ -1 +1 @@
1
- {"version":3,"file":"schemas.js","sourceRoot":"","sources":["../../../../../src/builtin-extensions/pi-subagents/src/extension/schemas.ts"],"names":[],"mappings":"AAAA,cAAc;AACd;;GAEG;AAEH,OAAO,EAAE,IAAI,EAAE,MAAM,SAAS,CAAC;AAE/B,SAAS,iCAAiC,CA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,QAAQ,CAAC,YAAY,CAAC,EAAE,oBAAoB;IACvD,UAAU,EAAE,IAAI,CAAC,QAAQ,CAAC,kBAAkB,CAAC;CAC7C,CAAC,CAAC;AAEH,MAAM,CAAC,MAAM,cAAc,GAAG,iCAAiC,CAAC,oBAAoB,CAAC,CAAC;AAEtF,MAAM,wBAAwB,GAAG,IAAI,CAAC,MAAM,CAAC;IAC5C,EAAE,EAAE,IAAI,CAAC,QAAQ,CAAC,IAAI,CAAC,MAAM,CAAC;QAC7B,WAAW,EAAE,6JAA6J;KAC1K,CAAC,CAAC;IACH,GAAG,EAAE,IAAI,CAAC,QAAQ,CAAC,IAAI,CAAC,OAAO,CAAC;QAC/B,WAAW,EAAE,+LAA+L;KAC5M,CAAC,CAAC;IACH,SAAS,EAAE,IAAI,CAAC,QAAQ,CAAC,IAAI,CAAC,OAAO,CAAC;QACrC,OAAO,EAAE,CAAC;QACV,WAAW,EAAE,kHAAkH;KAC/H,CAAC,CAAC;CACH,CAAC,CAAC;AAEH,MAAM,CAAC,MAAM,kBAAkB,GAAG,iCAAiC,CAAC,wBAAwB,CAAC,CAAC","sourcesContent":["// @ts-nocheck\n/**\n * TypeBox schemas for subagent tool parameters\n */\n\nimport { Type } from \"typebox\";\n\nfunction keepTopLevelParameterDescriptions<T>(schema: T): T {\n\treturn pruneNestedDescriptions(schema, []) as T;\n}\n\nfunction pruneNestedDescriptions(value: unknown, path: string[]): unknown {\n\tif (!value || typeof value !== \"object\") return value;\n\n\tconst result = Array.isArray(value) ? [] : Object.create(Object.getPrototypeOf(value));\n\tfor (const key of Reflect.ownKeys(value)) {\n\t\tconst descriptor = Object.getOwnPropertyDescriptor(value, key);\n\t\tif (!descriptor) continue;\n\t\tif (key === \"description\" && !isTopLevelParameterDescription(path)) continue;\n\t\tif (\"value\" in descriptor) {\n\t\t\tconst nextPath = typeof key === \"string\" ? [...path, key] : path;\n\t\t\tdescriptor.value = pruneNestedDescriptions(descriptor.value, nextPath);\n\t\t}\n\t\tObject.defineProperty(result, key, descriptor);\n\t}\n\treturn result;\n}\n\nfunction isTopLevelParameterDescription(path: string[]): boolean {\n\treturn path.length === 2 && path[0] === \"properties\";\n}\n\nconst SkillOverride = Type.Unsafe({\n\tanyOf: [\n\t\t{ type: \"array\", items: { type: \"string\" } },\n\t\t{ type: \"boolean\" },\n\t\t{ type: \"string\" },\n\t],\n\tdescription: \"Skill name(s) to make available (comma-separated), array of strings, or boolean (false disables, true uses default)\",\n});\n\nconst OutputOverride = Type.Unsafe({\n\tanyOf: [\n\t\t{ type: \"string\" },\n\t\t{ type: \"boolean\" },\n\t],\n\tdescription: \"Output filename/path (string), or false to disable file output\",\n});\n\nconst OutputModeOverride = Type.String({\n\tenum: [\"inline\", \"file-only\"],\n\tdescription: \"Return saved output inline (default) or only a concise file reference. file-only requires output to be a path.\",\n});\n\n// lunr: model tier override for 3-tier subagent routing; resolved through the\n// @lunr/model-tiers bridge and ignored when tier mode is disabled.\nconst TierOverride = Type.String({\n\tenum: [\"light\", \"standard\", \"heavy\"],\n\tdescription: \"Model tier ('light' cheap/fast, 'standard' typical, 'heavy' complex reasoning) when model tiers are enabled. An explicit model overrides the tier; omit both to inherit the parent model.\",\n});\n\nconst ReadsOverride = Type.Unsafe({\n\tanyOf: [\n\t\t{ type: \"array\", items: { type: \"string\" } },\n\t\t{ type: \"boolean\" },\n\t],\n\tdescription: \"Files to read before running (array of filenames), or false to disable\",\n});\n\nconst JsonSchemaObject = Type.Unsafe({\n\ttype: \"object\",\n\tadditionalProperties: true,\n\tdescription: \"JSON Schema object for strict structured output. Non-object roots are rejected.\",\n});\n\nconst AcceptanceOverride = Type.Unsafe({\n\tanyOf: [\n\t\t{ type: \"string\", enum: [\"auto\", \"attested\", \"checked\", \"verified\", \"reviewed\"] },\n\t\t{ type: \"boolean\", enum: [false] },\n\t\t{ type: \"object\", additionalProperties: true },\n\t],\n\tdescription: \"Optional acceptance policy. Omitted means auto-inferred; verified requires configured runtime commands. Reviewed is inferred-only because explicit runs cannot supply an independent reviewer result. Bare \\\"none\\\" requires { level: \\\"none\\\", reason: \\\"...\\\" }, while false is deprecated.\",\n});\n\nconst TurnBudgetOverride = Type.Object({\n\tmaxTurns: Type.Integer({ minimum: 1 }),\n\tgraceTurns: Type.Optional(Type.Integer({ minimum: 0 })),\n}, { additionalProperties: false, description: \"Optional assistant-turn budget. At maxTurns the child is asked to wrap up; after graceTurns additional assistant turns it is aborted and partial output is returned.\" });\n\nconst ToolBudgetBlock = Type.Unsafe({\n\tanyOf: [\n\t\t{ type: \"array\", minItems: 1, items: { type: \"string\", minLength: 1 } },\n\t\t{ type: \"string\", enum: [\"*\"] },\n\t],\n});\n\nconst ToolBudgetOverride = Type.Object({\n\tsoft: Type.Optional(Type.Integer({ minimum: 1 })),\n\thard: Type.Integer({ minimum: 1 }),\n\tblock: Type.Optional(ToolBudgetBlock),\n}, { additionalProperties: false, description: \"Optional child tool-call budget. soft nudges the child; after hard, block tools (default read/grep/find/ls, or '*' for all tools) are blocked so the child can finalize.\" });\n\nconst TaskItem = Type.Object({\n\tagent: Type.String(), \n\ttask: Type.String(), \n\tcwd: Type.Optional(Type.String()),\n\tcount: Type.Optional(Type.Integer({ minimum: 1, description: \"Repeat this parallel task N times with the same settings.\" })),\n\toutput: Type.Optional(OutputOverride),\n\toutputMode: Type.Optional(OutputModeOverride),\n\treads: Type.Optional(ReadsOverride),\n\tprogress: Type.Optional(Type.Boolean({ description: \"Enable progress.md tracking for this task\" })),\n\tmodel: Type.Optional(Type.String({ description: \"Override model for this task (e.g. 'google/gemini-3-pro')\" })),\n\ttier: Type.Optional(TierOverride), // lunr: model tiers\n\tskill: Type.Optional(SkillOverride),\n\ttoolBudget: Type.Optional(ToolBudgetOverride),\n\tacceptance: Type.Optional(AcceptanceOverride),\n});\n\n// Parallel task item (within a parallel step)\nexport const ParallelTaskSchema = Type.Object({\n\tagent: Type.String(),\n\ttask: Type.Optional(Type.String({ description: \"Task template with {task}, {previous}, {chain_dir} variables. Defaults to {previous}.\" })),\n\tphase: Type.Optional(Type.String({ description: \"Optional phase/group label for status and graph rendering.\" })),\n\tlabel: Type.Optional(Type.String({ description: \"Optional user-facing label for this parallel task.\" })),\n\tas: Type.Optional(Type.String({ description: \"Optional safe identifier used as {outputs.name} in later chain steps.\" })),\n\toutputSchema: Type.Optional(JsonSchemaObject),\n\tcwd: Type.Optional(Type.String()),\n\tcount: Type.Optional(Type.Integer({ minimum: 1, description: \"Repeat this parallel task N times with the same settings.\" })),\n\toutput: Type.Optional(OutputOverride),\n\toutputMode: Type.Optional(OutputModeOverride),\n\treads: Type.Optional(ReadsOverride),\n\tprogress: Type.Optional(Type.Boolean({ description: \"Enable progress.md tracking in {chain_dir}\" })),\n\tskill: Type.Optional(SkillOverride),\n\tmodel: Type.Optional(Type.String({ description: \"Override model for this task\" })),\n\ttier: Type.Optional(TierOverride), // lunr: model tiers\n\ttoolBudget: Type.Optional(ToolBudgetOverride),\n\tacceptance: Type.Optional(AcceptanceOverride),\n});\n\nexport const DynamicExpandSchema = Type.Object({\n\tfrom: Type.Object({\n\t\toutput: Type.String({ description: \"Prior named structured output to expand from.\" }),\n\t\tpath: Type.String({ description: \"JSON Pointer into the structured output, e.g. /items.\" }),\n\t}, { additionalProperties: false }),\n\titem: Type.Optional(Type.String({ description: \"Template variable name for each item. Defaults to item.\" })),\n\tkey: Type.Optional(Type.String({ description: \"JSON Pointer relative to each item for stable child ids.\" })),\n\tmaxItems: Type.Optional(Type.Integer({ minimum: 0, description: \"Required fanout bound unless configured globally.\" })),\n\tonEmpty: Type.Optional(Type.String({ enum: [\"skip\", \"fail\"], description: \"Empty input behavior. Defaults to skip.\" })),\n}, { additionalProperties: false });\n\nexport const DynamicParallelTemplateSchema = Type.Object({\n\tagent: Type.String(),\n\ttask: Type.Optional(Type.String({ description: \"Task template with {item}, {item.path}, {task}, {previous}, {chain_dir}, and {outputs.name} variables.\" })),\n\tphase: Type.Optional(Type.String({ description: \"Optional phase/group label for status and graph rendering.\" })),\n\tlabel: Type.Optional(Type.String({ description: \"Optional user-facing label; item templates are supported.\" })),\n\toutputSchema: Type.Optional(JsonSchemaObject),\n\tcwd: Type.Optional(Type.String()),\n\toutput: Type.Optional(OutputOverride),\n\toutputMode: Type.Optional(OutputModeOverride),\n\treads: Type.Optional(ReadsOverride),\n\tprogress: Type.Optional(Type.Boolean({ description: \"Enable progress.md tracking in {chain_dir}\" })),\n\tskill: Type.Optional(SkillOverride),\n\tmodel: Type.Optional(Type.String({ description: \"Override model for this task\" })),\n\ttier: Type.Optional(TierOverride), // lunr: model tiers\n\ttoolBudget: Type.Optional(ToolBudgetOverride),\n\tacceptance: Type.Optional(AcceptanceOverride),\n}, { additionalProperties: false });\n\nexport const DynamicCollectSchema = Type.Object({\n\tas: Type.String({ description: \"Safe output name for the ordered collected result array.\" }),\n\toutputSchema: Type.Optional(JsonSchemaObject),\n}, { additionalProperties: false });\n\n// Flattened so chain steps do not need an object-shape anyOf/oneOf union.\nexport const ChainItem = Type.Object({\n\tagent: Type.Optional(Type.String({ description: \"Sequential step agent name\" })),\n\ttask: Type.Optional(Type.String({\n\t\tdescription: \"Task template with variables: {task}=original request, {previous}=prior step's text response, {chain_dir}=shared folder, {outputs.name}=prior named output. Required for first step, defaults to '{previous}' for subsequent steps.\"\n\t})),\n\tphase: Type.Optional(Type.String({ description: \"Optional phase/group label for status and graph rendering.\" })),\n\tlabel: Type.Optional(Type.String({ description: \"Optional user-facing label for this chain step.\" })),\n\tas: Type.Optional(Type.String({ description: \"Optional safe identifier used as {outputs.name} in later chain steps.\" })),\n\toutputSchema: Type.Optional(JsonSchemaObject),\n\tcwd: Type.Optional(Type.String()),\n\toutput: Type.Optional(OutputOverride),\n\toutputMode: Type.Optional(OutputModeOverride),\n\treads: Type.Optional(ReadsOverride),\n\tprogress: Type.Optional(Type.Boolean({ description: \"Enable progress.md tracking in {chain_dir}\" })),\n\tskill: Type.Optional(SkillOverride),\n\tmodel: Type.Optional(Type.String({ description: \"Override model for this step\" })),\n\ttier: Type.Optional(TierOverride), // lunr: model tiers\n\ttoolBudget: Type.Optional(ToolBudgetOverride),\n\tacceptance: Type.Optional(AcceptanceOverride),\n\tparallel: Type.Optional(Type.Unsafe({\n\t\tanyOf: [\n\t\t\tType.Array(ParallelTaskSchema, { minItems: 1, description: \"Tasks to run in parallel\" }),\n\t\t\tDynamicParallelTemplateSchema,\n\t\t],\n\t\tdescription: \"Static parallel tasks array, or a single dynamic fanout child template when expand/collect are present.\",\n\t})),\n\texpand: Type.Optional(DynamicExpandSchema),\n\tcollect: Type.Optional(DynamicCollectSchema),\n\tconcurrency: Type.Optional(Type.Number({ description: \"Max concurrent tasks (default: 4)\" })),\n\tfailFast: Type.Optional(Type.Boolean({ description: \"Stop on first failure (default: false)\" })),\n\tworktree: Type.Optional(Type.Boolean({\n\t\tdescription: \"Create isolated git worktrees for each parallel task.\"\n\t})),\n}, {\n\tdescription: \"Chain step: use {agent, task?, ...} for sequential, {parallel: [...]} for static concurrent execution, or {expand, parallel: {...}, collect} for dynamic fanout.\",\n\tadditionalProperties: false,\n});\n\nconst ControlOverrides = Type.Object({\n\tenabled: Type.Optional(Type.Boolean({ description: \"Enable/disable subagent control attention tracking for this run\" })),\n\tneedsAttentionAfterMs: Type.Optional(Type.Integer({ minimum: 1, description: \"No-observed-activity window before a run needs attention\" })),\n\tactiveNoticeAfterMs: Type.Optional(Type.Integer({ minimum: 1, description: \"Active-long-running notice threshold by elapsed ms (default: 240000)\" })),\n\tactiveNoticeAfterTurns: Type.Optional(Type.Integer({ minimum: 1, description: \"Optional active-long-running notice threshold by assistant turns (disabled by default)\" })),\n\tactiveNoticeAfterTokens: Type.Optional(Type.Integer({ minimum: 1, description: \"Optional active-long-running notice threshold by total tokens (disabled by default)\" })),\n\tfailedToolAttemptsBeforeAttention: Type.Optional(Type.Integer({ minimum: 1, description: \"Consecutive mutating-tool failures before escalating to needs_attention (default: 3)\" })),\n\tnotifyOn: Type.Optional(Type.Array(Type.String({ enum: [\"active_long_running\", \"needs_attention\"] }), {\n\t\tdescription: \"Control event types that should notify the parent/orchestrator. Defaults to active_long_running and needs_attention.\",\n\t})),\n\tnotifyChannels: Type.Optional(Type.Array(Type.String({ enum: [\"event\", \"async\", \"intercom\"] }), {\n\t\tdescription: \"Notification channels to use when available. Defaults to event, async, and intercom.\",\n\t})),\n});\n\nconst SubagentParamsSchema = Type.Object({\n\tagent: Type.Optional(Type.String({ description: \"Agent name (SINGLE mode) or target for management get/update/delete\" })),\n\ttask: Type.Optional(Type.String({ description: \"Task (SINGLE mode, optional for self-contained agents)\" })),\n\t// Management action (when present, tool operates in management mode)\n\taction: Type.Optional(Type.String({\n\t\tdescription: \"Management/control action only. Must be omitted for execution mode (single, parallel, or chain).\"\n\t})),\n\tid: Type.Optional(Type.String({\n\t\tdescription: \"Run id or prefix for action='status', action='interrupt', action='stop', action='resume', action='steer', or action='append-step'.\"\n\t})),\n\trunId: Type.Optional(Type.String({\n\t\tdescription: \"Target run ID for action='interrupt', action='stop', action='resume', action='steer', or action='append-step'. Prefer id for new calls.\"\n\t})),\n\tdir: Type.Optional(Type.String({\n\t\tdescription: \"Async run directory for action='status', action='stop', action='resume', or action='steer'.\"\n\t})),\n\tindex: Type.Optional(Type.Integer({ minimum: 0, description: \"Zero-based child index for actions that target a specific child or transcript.\" })),\n\tview: Type.Optional(Type.String({\n\t\tenum: [\"fleet\", \"transcript\"],\n\t\tdescription: \"Optional status view. Use view='fleet' for a read-only active foreground/async fleet surface, or view='transcript' with id/dir (and optional index) to tail a run transcript.\",\n\t})),\n\tlines: Type.Optional(Type.Integer({ minimum: 1, maximum: 500, description: \"Maximum transcript lines for action='status', view='transcript'. Defaults to 80.\" })),\n\tmessage: Type.Optional(Type.String({ description: \"Follow-up message for action='resume' or non-terminal guidance for action='steer'. Use index to choose a child from multi-child runs.\" })),\n\tscope: Type.Optional(Type.String({ enum: [\"session\", \"user\", \"project\"], description: \"Scope for action='watchdog.configure'. Defaults to session to avoid persistent settings writes unless user/project is explicit.\" })),\n\ttarget: Type.Optional(Type.String({ enum: [\"main\", \"children\", \"child\"], description: \"Target for action='watchdog.configure'. Defaults to main. Use target='child' with agent for a per-agent child watchdog override.\" })),\n\tthinking: Type.Optional(Type.Unsafe({ anyOf: [{ type: \"string\" }, { type: \"boolean\", enum: [false] }], description: \"Thinking level for action='watchdog.configure' (off/minimal/low/medium/high/xhigh/max, inherit, or false for off).\" })),\n\tschedule: Type.Optional(Type.String({ description: \"Explicit one-shot schedule for action='schedule'. Only honored when scheduledRuns.enabled is true. Use '+10m' or a future ISO timestamp with timezone; scheduled runs always launch async with fresh context.\" })),\n\tscheduleName: Type.Optional(Type.String({ description: \"Optional display name for action='schedule'.\" })),\n\t// Chain identifier for management (can't reuse 'chain' — that's the execution array)\n\tchainName: Type.Optional(Type.String({\n\t\tdescription: \"Chain name for get/update/delete management actions\"\n\t})),\n\t// Agent/chain configuration for create/update (nested to avoid conflicts with execution fields)\n\tconfig: Type.Optional(Type.Unsafe({\n\t\tanyOf: [\n\t\t\t{ type: \"object\", additionalProperties: true },\n\t\t\t{ type: \"string\" },\n\t\t],\n\t\tdescription: \"Agent/chain config for create/update. Object or JSON string; presence of steps creates a chain.\"\n\t})),\n\ttasks: Type.Optional(Type.Array(TaskItem, { description: \"PARALLEL mode: [{agent, task, count?, output?, outputMode?, reads?, progress?}, ...]\" })),\n\tconcurrency: Type.Optional(Type.Integer({ minimum: 1, description: \"Top-level PARALLEL mode only: max concurrent tasks. Defaults to config.parallel.concurrency or 4.\" })),\n\tworktree: Type.Optional(Type.Boolean({\n\t\tdescription: \"Create isolated git worktrees for parallel tasks; requires clean git state.\"\n\t})),\n\tchain: Type.Optional(Type.Array(ChainItem, { description: \"CHAIN mode: sequential steps; each result becomes {previous}. append-step takes one tail step and may use {chain_dir}/{outputs.name}.\" })),\n\tcontext: Type.Optional(Type.String({\n\t\tenum: [\"fresh\"],\n\t\tdescription: \"Children always start with a fresh session. Fork context is not available.\",\n\t})),\n\tchainDir: Type.Optional(Type.String({ description: \"Persistent chain artifact directory; defaults to user-scoped temp storage.\" })),\n\tasync: Type.Optional(Type.Boolean({ description: \"Run in background (default: false, or per config)\" })),\n\ttimeoutMs: Type.Optional(Type.Integer({ minimum: 1, description: \"Optional run-level timeout in ms for foreground and async/background runs. Alias of maxRuntimeMs.\" })),\n\tmaxRuntimeMs: Type.Optional(Type.Integer({ minimum: 1, description: \"Alias of timeoutMs for optional run-level timeout in foreground and async/background runs.\" })),\n\tturnBudget: Type.Optional(TurnBudgetOverride),\n\ttoolBudget: Type.Optional(ToolBudgetOverride),\n\tagentScope: Type.Optional(Type.String({ description: \"Agent discovery scope: 'user', 'project', or 'both' (default: 'both'; project wins on name collisions)\" })),\n\tcwd: Type.Optional(Type.String()),\n\tartifacts: Type.Optional(Type.Boolean({ description: \"Write debug artifacts (default: true)\" })),\n\tincludeProgress: Type.Optional(Type.Boolean({ description: \"Include full progress in result (default: false)\" })),\n\tshare: Type.Optional(Type.Boolean({ description: \"Upload session to GitHub Gist for sharing (default: false)\" })),\n\tsessionDir: Type.Optional(\n\t\tType.String({ description: \"Directory to store session logs (default: temp; enables sessions even if share=false)\" }),\n\t),\n\t// Clarification TUI\n\tclarify: Type.Optional(Type.Boolean({ description: \"Show TUI to preview/edit before execution. Explicit clarify: true keeps the run foreground for the clarify UI; omitted clarify can still run in the background when async: true is set.\" })),\n\tcontrol: Type.Optional(ControlOverrides),\n\t// Solo agent overrides\n\toutput: Type.Optional(Type.Unsafe({\n\t\tanyOf: [\n\t\t\t{ type: \"string\" },\n\t\t\t{ type: \"boolean\" },\n\t\t],\n\t\tdescription: \"Output file for single agent (string), or false to disable. Relative paths resolve against cwd.\",\n\t})),\n\toutputMode: Type.Optional(OutputModeOverride),\n\tskill: Type.Optional(SkillOverride),\n\tmodel: Type.Optional(Type.String({ description: \"Override model for single agent (e.g. 'anthropic/claude-sonnet-4')\" })),\n\ttier: Type.Optional(TierOverride), // lunr: model tiers\n\tacceptance: Type.Optional(AcceptanceOverride),\n});\n\nexport const SubagentParams = keepTopLevelParameterDescriptions(SubagentParamsSchema);\n\nconst SubagentWaitParamsSchema = Type.Object({\n\tid: Type.Optional(Type.String({\n\t\tdescription: \"Async run or remembered detached foreground run id/prefix to wait for one specific run. Omit to wait across every active async run started in this session.\",\n\t})),\n\tall: Type.Optional(Type.Boolean({\n\t\tdescription: \"Wait for ALL active runs to finish. Default false: return as soon as the first run finishes, so a fleet manager can spawn a replacement and wait again. Ignored when id targets a single run.\",\n\t})),\n\ttimeoutMs: Type.Optional(Type.Integer({\n\t\tminimum: 1,\n\t\tdescription: \"Give up waiting after this many milliseconds (the runs keep going regardless). Defaults to 1800000 (30 minutes).\",\n\t})),\n});\n\nexport const SubagentWaitParams = keepTopLevelParameterDescriptions(SubagentWaitParamsSchema);\n"]}
1
+ {"version":3,"file":"schemas.js","sourceRoot":"","sources":["../../../../../src/builtin-extensions/pi-subagents/src/extension/schemas.ts"],"names":[],"mappings":"AAAA,cAAc;AACd;;GAEG;AAEH,OAAO,EAAE,IAAI,EAAE,MAAM,SAAS,CAAC;AAE/B,SAAS,iCAAiC,CAAI,MAAS,EAAK;IAC3D,OAAO,uBAAuB,CAAC,MAAM,EAAE,EAAE,CAAM,CAAC;AAAA,CAChD;AAED,SAAS,uBAAuB,CAAC,KAAc,EAAE,IAAc,EAAW;IACzE,IAAI,CAAC,KAAK,IAAI,OAAO,KAAK,KAAK,QAAQ;QAAE,OAAO,KAAK,CAAC;IAEtD,MAAM,MAAM,GAAG,KAAK,CAAC,OAAO,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,MAAM,CAAC,MAAM,CAAC,MAAM,CAAC,cAAc,CAAC,KAAK,CAAC,CAAC,CAAC;IACvF,KAAK,MAAM,GAAG,IAAI,OAAO,CAAC,OAAO,CAAC,KAAK,CAAC,EAAE,CAAC;QAC1C,MAAM,UAAU,GAAG,MAAM,CAAC,wBAAwB,CAAC,KAAK,EAAE,GAAG,CAAC,CA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AAE,CAAC;QACV,WAAW,EAAE,kHAAkH;KAC/H,CAAC,CAAC;CACH,CAAC,CAAC;AAEH,MAAM,CAAC,MAAM,kBAAkB,GAAG,iCAAiC,CAAC,wBAAwB,CAAC,CAAC","sourcesContent":["// @ts-nocheck\n/**\n * TypeBox schemas for subagent tool parameters\n */\n\nimport { Type } from \"typebox\";\n\nfunction keepTopLevelParameterDescriptions<T>(schema: T): T {\n\treturn pruneNestedDescriptions(schema, []) as T;\n}\n\nfunction pruneNestedDescriptions(value: unknown, path: string[]): unknown {\n\tif (!value || typeof value !== \"object\") return value;\n\n\tconst result = Array.isArray(value) ? [] : Object.create(Object.getPrototypeOf(value));\n\tfor (const key of Reflect.ownKeys(value)) {\n\t\tconst descriptor = Object.getOwnPropertyDescriptor(value, key);\n\t\tif (!descriptor) continue;\n\t\tif (key === \"description\" && !isTopLevelParameterDescription(path)) continue;\n\t\tif (\"value\" in descriptor) {\n\t\t\tconst nextPath = typeof key === \"string\" ? [...path, key] : path;\n\t\t\tdescriptor.value = pruneNestedDescriptions(descriptor.value, nextPath);\n\t\t}\n\t\tObject.defineProperty(result, key, descriptor);\n\t}\n\treturn result;\n}\n\nfunction isTopLevelParameterDescription(path: string[]): boolean {\n\treturn path.length === 2 && path[0] === \"properties\";\n}\n\nconst SkillOverride = Type.Unsafe({\n\tanyOf: [\n\t\t{ type: \"array\", items: { type: \"string\" } },\n\t\t{ type: \"boolean\" },\n\t\t{ type: \"string\" },\n\t],\n\tdescription: \"Skill name(s) to make available (comma-separated), array of strings, or boolean (false disables, true uses default)\",\n});\n\nconst OutputOverride = Type.Unsafe({\n\tanyOf: [\n\t\t{ type: \"string\" },\n\t\t{ type: \"boolean\" },\n\t],\n\tdescription: \"Output filename/path (string), or false to disable file output\",\n});\n\nconst OutputModeOverride = Type.String({\n\tenum: [\"inline\", \"file-only\"],\n\tdescription: \"Return saved output inline (default) or only a concise file reference. file-only requires output to be a path.\",\n});\n\n// lunr: model tier override for 3-tier subagent routing; resolved through the\n// @lunr/model-tiers bridge and ignored when tier mode is disabled.\nconst TierOverride = Type.String({\n\tenum: [\"light\", \"standard\", \"heavy\"],\n\tdescription: \"Model tier ('light' cheap/fast, 'standard' typical, 'heavy' complex reasoning) when model tiers are enabled. An explicit model overrides the tier; omit both to inherit the parent model.\",\n});\n\nconst ReadsOverride = Type.Unsafe({\n\tanyOf: [\n\t\t{ type: \"array\", items: { type: \"string\" } },\n\t\t{ type: \"boolean\" },\n\t],\n\tdescription: \"Files to read before running (array of filenames), or false to disable\",\n});\n\nconst JsonSchemaObject = Type.Unsafe({\n\ttype: \"object\",\n\tadditionalProperties: true,\n\tdescription: \"JSON Schema object for strict structured output. Non-object roots are rejected.\",\n});\n\nconst AcceptanceOverride = Type.Unsafe({\n\tanyOf: [\n\t\t{ type: \"string\", enum: [\"auto\", \"attested\", \"checked\", \"verified\", \"reviewed\"] },\n\t\t{ type: \"boolean\", enum: [false] },\n\t\t{ type: \"object\", additionalProperties: true },\n\t],\n\tdescription: \"Optional acceptance policy. Omitted means auto-inferred; verified requires configured runtime commands. Reviewed is inferred-only because explicit runs cannot supply an independent reviewer result. Bare \\\"none\\\" requires { level: \\\"none\\\", reason: \\\"...\\\" }, while false is deprecated.\",\n});\n\nconst TurnBudgetOverride = Type.Object({\n\tmaxTurns: Type.Integer({ minimum: 1 }),\n\tgraceTurns: Type.Optional(Type.Integer({ minimum: 0 })),\n}, { additionalProperties: false, description: \"Optional assistant-turn budget. At maxTurns the child is asked to wrap up; after graceTurns additional assistant turns it is aborted and partial output is returned.\" });\n\nconst ToolBudgetBlock = Type.Unsafe({\n\tanyOf: [\n\t\t{ type: \"array\", minItems: 1, items: { type: \"string\", minLength: 1 } },\n\t\t{ type: \"string\", enum: [\"*\"] },\n\t],\n});\n\nconst ToolBudgetOverride = Type.Object({\n\tsoft: Type.Optional(Type.Integer({ minimum: 1 })),\n\thard: Type.Integer({ minimum: 1 }),\n\tblock: Type.Optional(ToolBudgetBlock),\n}, { additionalProperties: false, description: \"Optional child tool-call budget. soft nudges the child; after hard, block tools (default read/grep/find/ls, or '*' for all tools) are blocked so the child can finalize.\" });\n\nconst TaskItem = Type.Object({\n\tagent: Type.String(), \n\ttask: Type.String(), \n\tcwd: Type.Optional(Type.String()),\n\tcount: Type.Optional(Type.Integer({ minimum: 1, description: \"Repeat this parallel task N times with the same settings.\" })),\n\toutput: Type.Optional(OutputOverride),\n\toutputMode: Type.Optional(OutputModeOverride),\n\treads: Type.Optional(ReadsOverride),\n\tprogress: Type.Optional(Type.Boolean({ description: \"Enable progress.md tracking for this task\" })),\n\tmodel: Type.Optional(Type.String({ description: \"Override model for this task (e.g. 'google/gemini-3-pro')\" })),\n\ttier: Type.Optional(TierOverride), // lunr: model tiers\n\tskill: Type.Optional(SkillOverride),\n\ttoolBudget: Type.Optional(ToolBudgetOverride),\n\tacceptance: Type.Optional(AcceptanceOverride),\n});\n\n// Parallel task item (within a parallel step)\nexport const ParallelTaskSchema = Type.Object({\n\tagent: Type.String(),\n\ttask: Type.Optional(Type.String({ description: \"Task template with {task}, {previous}, {chain_dir} variables. Defaults to {previous}.\" })),\n\tphase: Type.Optional(Type.String({ description: \"Optional phase/group label for status and graph rendering.\" })),\n\tlabel: Type.Optional(Type.String({ description: \"Optional user-facing label for this parallel task.\" })),\n\tas: Type.Optional(Type.String({ description: \"Optional safe identifier used as {outputs.name} in later chain steps.\" })),\n\toutputSchema: Type.Optional(JsonSchemaObject),\n\tcwd: Type.Optional(Type.String()),\n\tcount: Type.Optional(Type.Integer({ minimum: 1, description: \"Repeat this parallel task N times with the same settings.\" })),\n\toutput: Type.Optional(OutputOverride),\n\toutputMode: Type.Optional(OutputModeOverride),\n\treads: Type.Optional(ReadsOverride),\n\tprogress: Type.Optional(Type.Boolean({ description: \"Enable progress.md tracking in {chain_dir}\" })),\n\tskill: Type.Optional(SkillOverride),\n\tmodel: Type.Optional(Type.String({ description: \"Override model for this task\" })),\n\ttier: Type.Optional(TierOverride), // lunr: model tiers\n\ttoolBudget: Type.Optional(ToolBudgetOverride),\n\tacceptance: Type.Optional(AcceptanceOverride),\n});\n\nexport const DynamicExpandSchema = Type.Object({\n\tfrom: Type.Object({\n\t\toutput: Type.String({ description: \"Prior named structured output to expand from.\" }),\n\t\tpath: Type.String({ description: \"JSON Pointer into the structured output, e.g. /items.\" }),\n\t}, { additionalProperties: false }),\n\titem: Type.Optional(Type.String({ description: \"Template variable name for each item. Defaults to item.\" })),\n\tkey: Type.Optional(Type.String({ description: \"JSON Pointer relative to each item for stable child ids.\" })),\n\tmaxItems: Type.Optional(Type.Integer({ minimum: 0, description: \"Required fanout bound unless configured globally.\" })),\n\tonEmpty: Type.Optional(Type.String({ enum: [\"skip\", \"fail\"], description: \"Empty input behavior. Defaults to skip.\" })),\n}, { additionalProperties: false });\n\nexport const DynamicParallelTemplateSchema = Type.Object({\n\tagent: Type.String(),\n\ttask: Type.Optional(Type.String({ description: \"Task template with {item}, {item.path}, {task}, {previous}, {chain_dir}, and {outputs.name} variables.\" })),\n\tphase: Type.Optional(Type.String({ description: \"Optional phase/group label for status and graph rendering.\" })),\n\tlabel: Type.Optional(Type.String({ description: \"Optional user-facing label; item templates are supported.\" })),\n\toutputSchema: Type.Optional(JsonSchemaObject),\n\tcwd: Type.Optional(Type.String()),\n\toutput: Type.Optional(OutputOverride),\n\toutputMode: Type.Optional(OutputModeOverride),\n\treads: Type.Optional(ReadsOverride),\n\tprogress: Type.Optional(Type.Boolean({ description: \"Enable progress.md tracking in {chain_dir}\" })),\n\tskill: Type.Optional(SkillOverride),\n\tmodel: Type.Optional(Type.String({ description: \"Override model for this task\" })),\n\ttier: Type.Optional(TierOverride), // lunr: model tiers\n\ttoolBudget: Type.Optional(ToolBudgetOverride),\n\tacceptance: Type.Optional(AcceptanceOverride),\n}, { additionalProperties: false });\n\nexport const DynamicCollectSchema = Type.Object({\n\tas: Type.String({ description: \"Safe output name for the ordered collected result array.\" }),\n\toutputSchema: Type.Optional(JsonSchemaObject),\n}, { additionalProperties: false });\n\n// Flattened so chain steps do not need an object-shape anyOf/oneOf union.\nexport const ChainItem = Type.Object({\n\tagent: Type.Optional(Type.String({ description: \"Sequential step agent name\" })),\n\ttask: Type.Optional(Type.String({\n\t\tdescription: \"Task template with variables: {task}=original request, {previous}=prior step's text response, {chain_dir}=shared folder, {outputs.name}=prior named output. Required for first step, defaults to '{previous}' for subsequent steps.\"\n\t})),\n\tphase: Type.Optional(Type.String({ description: \"Optional phase/group label for status and graph rendering.\" })),\n\tlabel: Type.Optional(Type.String({ description: \"Optional user-facing label for this chain step.\" })),\n\tas: Type.Optional(Type.String({ description: \"Optional safe identifier used as {outputs.name} in later chain steps.\" })),\n\toutputSchema: Type.Optional(JsonSchemaObject),\n\tcwd: Type.Optional(Type.String()),\n\toutput: Type.Optional(OutputOverride),\n\toutputMode: Type.Optional(OutputModeOverride),\n\treads: Type.Optional(ReadsOverride),\n\tprogress: Type.Optional(Type.Boolean({ description: \"Enable progress.md tracking in {chain_dir}\" })),\n\tskill: Type.Optional(SkillOverride),\n\tmodel: Type.Optional(Type.String({ description: \"Override model for this step\" })),\n\ttier: Type.Optional(TierOverride), // lunr: model tiers\n\ttoolBudget: Type.Optional(ToolBudgetOverride),\n\tacceptance: Type.Optional(AcceptanceOverride),\n\tparallel: Type.Optional(Type.Unsafe({\n\t\tanyOf: [\n\t\t\tType.Array(ParallelTaskSchema, { minItems: 1, description: \"Tasks to run in parallel\" }),\n\t\t\tDynamicParallelTemplateSchema,\n\t\t],\n\t\tdescription: \"Static parallel tasks array, or a single dynamic fanout child template when expand/collect are present.\",\n\t})),\n\texpand: Type.Optional(DynamicExpandSchema),\n\tcollect: Type.Optional(DynamicCollectSchema),\n\tconcurrency: Type.Optional(Type.Number({ description: \"Max concurrent tasks (default: unlimited)\" })),\n\tfailFast: Type.Optional(Type.Boolean({ description: \"Stop on first failure (default: false)\" })),\n\tworktree: Type.Optional(Type.Boolean({\n\t\tdescription: \"Create isolated git worktrees for each parallel task.\"\n\t})),\n}, {\n\tdescription: \"Chain step: use {agent, task?, ...} for sequential, {parallel: [...]} for static concurrent execution, or {expand, parallel: {...}, collect} for dynamic fanout.\",\n\tadditionalProperties: false,\n});\n\nconst ControlOverrides = Type.Object({\n\tenabled: Type.Optional(Type.Boolean({ description: \"Enable/disable subagent control attention tracking for this run\" })),\n\tneedsAttentionAfterMs: Type.Optional(Type.Integer({ minimum: 1, description: \"No-observed-activity window before a run needs attention\" })),\n\tactiveNoticeAfterMs: Type.Optional(Type.Integer({ minimum: 1, description: \"Active-long-running notice threshold by elapsed ms (default: 240000)\" })),\n\tactiveNoticeAfterTurns: Type.Optional(Type.Integer({ minimum: 1, description: \"Optional active-long-running notice threshold by assistant turns (disabled by default)\" })),\n\tactiveNoticeAfterTokens: Type.Optional(Type.Integer({ minimum: 1, description: \"Optional active-long-running notice threshold by total tokens (disabled by default)\" })),\n\tfailedToolAttemptsBeforeAttention: Type.Optional(Type.Integer({ minimum: 1, description: \"Consecutive mutating-tool failures before escalating to needs_attention (default: 3)\" })),\n\tnotifyOn: Type.Optional(Type.Array(Type.String({ enum: [\"active_long_running\", \"needs_attention\"] }), {\n\t\tdescription: \"Control event types that should notify the parent/orchestrator. Defaults to active_long_running and needs_attention.\",\n\t})),\n\tnotifyChannels: Type.Optional(Type.Array(Type.String({ enum: [\"event\", \"async\", \"intercom\"] }), {\n\t\tdescription: \"Notification channels to use when available. Defaults to event, async, and intercom.\",\n\t})),\n});\n\nconst SubagentParamsSchema = Type.Object({\n\tagent: Type.Optional(Type.String({ description: \"Agent name (SINGLE mode) or target for management get/update/delete\" })),\n\ttask: Type.Optional(Type.String({ description: \"Task (SINGLE mode, optional for self-contained agents)\" })),\n\t// Management action (when present, tool operates in management mode)\n\taction: Type.Optional(Type.String({\n\t\tdescription: \"Management/control action only. Must be omitted for execution mode (single, parallel, or chain).\"\n\t})),\n\tid: Type.Optional(Type.String({\n\t\tdescription: \"Run id or prefix for action='status', action='interrupt', action='stop', action='resume', action='steer', or action='append-step'.\"\n\t})),\n\trunId: Type.Optional(Type.String({\n\t\tdescription: \"Target run ID for action='interrupt', action='stop', action='resume', action='steer', or action='append-step'. Prefer id for new calls.\"\n\t})),\n\tdir: Type.Optional(Type.String({\n\t\tdescription: \"Async run directory for action='status', action='stop', action='resume', or action='steer'.\"\n\t})),\n\tindex: Type.Optional(Type.Integer({ minimum: 0, description: \"Zero-based child index for actions that target a specific child or transcript.\" })),\n\tview: Type.Optional(Type.String({\n\t\tenum: [\"fleet\", \"transcript\"],\n\t\tdescription: \"Optional status view. Use view='fleet' for a read-only active foreground/async fleet surface, or view='transcript' with id/dir (and optional index) to tail a run transcript.\",\n\t})),\n\tlines: Type.Optional(Type.Integer({ minimum: 1, maximum: 500, description: \"Maximum transcript lines for action='status', view='transcript'. Defaults to 80.\" })),\n\tmessage: Type.Optional(Type.String({ description: \"Follow-up message for action='resume' or non-terminal guidance for action='steer'. Use index to choose a child from multi-child runs.\" })),\n\tscope: Type.Optional(Type.String({ enum: [\"session\", \"user\", \"project\"], description: \"Scope for action='watchdog.configure'. Defaults to session to avoid persistent settings writes unless user/project is explicit.\" })),\n\ttarget: Type.Optional(Type.String({ enum: [\"main\", \"children\", \"child\"], description: \"Target for action='watchdog.configure'. Defaults to main. Use target='child' with agent for a per-agent child watchdog override.\" })),\n\tthinking: Type.Optional(Type.Unsafe({ anyOf: [{ type: \"string\" }, { type: \"boolean\", enum: [false] }], description: \"Thinking level for action='watchdog.configure' (off/minimal/low/medium/high/xhigh/max, inherit, or false for off).\" })),\n\tschedule: Type.Optional(Type.String({ description: \"Explicit one-shot schedule for action='schedule'. Only honored when scheduledRuns.enabled is true. Use '+10m' or a future ISO timestamp with timezone; scheduled runs always launch async with fresh context.\" })),\n\tscheduleName: Type.Optional(Type.String({ description: \"Optional display name for action='schedule'.\" })),\n\t// Chain identifier for management (can't reuse 'chain' — that's the execution array)\n\tchainName: Type.Optional(Type.String({\n\t\tdescription: \"Chain name for get/update/delete management actions\"\n\t})),\n\t// Agent/chain configuration for create/update (nested to avoid conflicts with execution fields)\n\tconfig: Type.Optional(Type.Unsafe({\n\t\tanyOf: [\n\t\t\t{ type: \"object\", additionalProperties: true },\n\t\t\t{ type: \"string\" },\n\t\t],\n\t\tdescription: \"Agent/chain config for create/update. Object or JSON string; presence of steps creates a chain.\"\n\t})),\n\ttasks: Type.Optional(Type.Array(TaskItem, { description: \"PARALLEL mode: [{agent, task, count?, output?, outputMode?, reads?, progress?}, ...]\" })),\n\tconcurrency: Type.Optional(Type.Integer({ minimum: 1, description: \"Top-level PARALLEL mode only: max concurrent tasks. Defaults to config.parallel.concurrency or unlimited.\" })),\n\tworktree: Type.Optional(Type.Boolean({\n\t\tdescription: \"Create isolated git worktrees for parallel tasks; requires clean git state.\"\n\t})),\n\tchain: Type.Optional(Type.Array(ChainItem, { description: \"CHAIN mode: sequential steps; each result becomes {previous}. append-step takes one tail step and may use {chain_dir}/{outputs.name}.\" })),\n\tcontext: Type.Optional(Type.String({\n\t\tenum: [\"fresh\"],\n\t\tdescription: \"Children always start with a fresh session. Fork context is not available.\",\n\t})),\n\tchainDir: Type.Optional(Type.String({ description: \"Persistent chain artifact directory; defaults to user-scoped temp storage.\" })),\n\tasync: Type.Optional(Type.Boolean({ description: \"Run in background (default: false, or per config)\" })),\n\ttimeoutMs: Type.Optional(Type.Integer({ minimum: 1, description: \"Optional run-level timeout in ms for foreground and async/background runs. Alias of maxRuntimeMs.\" })),\n\tmaxRuntimeMs: Type.Optional(Type.Integer({ minimum: 1, description: \"Alias of timeoutMs for optional run-level timeout in foreground and async/background runs.\" })),\n\tturnBudget: Type.Optional(TurnBudgetOverride),\n\ttoolBudget: Type.Optional(ToolBudgetOverride),\n\tagentScope: Type.Optional(Type.String({ description: \"Agent discovery scope: 'user', 'project', or 'both' (default: 'both'; project wins on name collisions)\" })),\n\tcwd: Type.Optional(Type.String()),\n\tartifacts: Type.Optional(Type.Boolean({ description: \"Write debug artifacts (default: true)\" })),\n\tincludeProgress: Type.Optional(Type.Boolean({ description: \"Include full progress in result (default: false)\" })),\n\tshare: Type.Optional(Type.Boolean({ description: \"Upload session to GitHub Gist for sharing (default: false)\" })),\n\tsessionDir: Type.Optional(\n\t\tType.String({ description: \"Directory to store session logs (default: temp; enables sessions even if share=false)\" }),\n\t),\n\t// Clarification TUI\n\tclarify: Type.Optional(Type.Boolean({ description: \"Show TUI to preview/edit before execution. Explicit clarify: true keeps the run foreground for the clarify UI; omitted clarify can still run in the background when async: true is set.\" })),\n\tcontrol: Type.Optional(ControlOverrides),\n\t// Solo agent overrides\n\toutput: Type.Optional(Type.Unsafe({\n\t\tanyOf: [\n\t\t\t{ type: \"string\" },\n\t\t\t{ type: \"boolean\" },\n\t\t],\n\t\tdescription: \"Output file for single agent (string), or false to disable. Relative paths resolve against cwd.\",\n\t})),\n\toutputMode: Type.Optional(OutputModeOverride),\n\tskill: Type.Optional(SkillOverride),\n\tmodel: Type.Optional(Type.String({ description: \"Override model for single agent (e.g. 'anthropic/claude-sonnet-4')\" })),\n\ttier: Type.Optional(TierOverride), // lunr: model tiers\n\tacceptance: Type.Optional(AcceptanceOverride),\n});\n\nexport const SubagentParams = keepTopLevelParameterDescriptions(SubagentParamsSchema);\n\nconst SubagentWaitParamsSchema = Type.Object({\n\tid: Type.Optional(Type.String({\n\t\tdescription: \"Async run or remembered detached foreground run id/prefix to wait for one specific run. Omit to wait across every active async run started in this session.\",\n\t})),\n\tall: Type.Optional(Type.Boolean({\n\t\tdescription: \"Wait for ALL active runs to finish. Default false: return as soon as the first run finishes, so a fleet manager can spawn a replacement and wait again. Ignored when id targets a single run.\",\n\t})),\n\ttimeoutMs: Type.Optional(Type.Integer({\n\t\tminimum: 1,\n\t\tdescription: \"Give up waiting after this many milliseconds (the runs keep going regardless). Defaults to 1800000 (30 minutes).\",\n\t})),\n});\n\nexport const SubagentWaitParams = keepTopLevelParameterDescriptions(SubagentWaitParamsSchema);\n"]}