@ashx-j/lunr 0.1.0
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.
- package/CHANGELOG.md +5042 -0
- package/README.md +691 -0
- package/dist/builtin-extensions/ashxj-spinners.d.ts +3 -0
- package/dist/builtin-extensions/ashxj-spinners.d.ts.map +1 -0
- package/dist/builtin-extensions/ashxj-spinners.js +271 -0
- package/dist/builtin-extensions/ashxj-spinners.js.map +1 -0
- package/dist/builtin-extensions/ashxj-thinking.d.ts +65 -0
- package/dist/builtin-extensions/ashxj-thinking.d.ts.map +1 -0
- package/dist/builtin-extensions/ashxj-thinking.js +308 -0
- package/dist/builtin-extensions/ashxj-thinking.js.map +1 -0
- package/dist/builtin-extensions/ashxj-tui.d.ts +137 -0
- package/dist/builtin-extensions/ashxj-tui.d.ts.map +1 -0
- package/dist/builtin-extensions/ashxj-tui.js +579 -0
- package/dist/builtin-extensions/ashxj-tui.js.map +1 -0
- package/dist/builtin-extensions/index.d.ts +11 -0
- package/dist/builtin-extensions/index.d.ts.map +1 -0
- package/dist/builtin-extensions/index.js +62 -0
- package/dist/builtin-extensions/index.js.map +1 -0
- package/dist/builtin-extensions/lunr-behavior.d.ts +43 -0
- package/dist/builtin-extensions/lunr-behavior.d.ts.map +1 -0
- package/dist/builtin-extensions/lunr-behavior.js +201 -0
- package/dist/builtin-extensions/lunr-behavior.js.map +1 -0
- package/dist/builtin-extensions/lunr-cron.d.ts +26 -0
- package/dist/builtin-extensions/lunr-cron.d.ts.map +1 -0
- package/dist/builtin-extensions/lunr-cron.js +346 -0
- package/dist/builtin-extensions/lunr-cron.js.map +1 -0
- package/dist/builtin-extensions/lunr-local-providers/index.d.ts +20 -0
- package/dist/builtin-extensions/lunr-local-providers/index.d.ts.map +1 -0
- package/dist/builtin-extensions/lunr-local-providers/index.js +108 -0
- package/dist/builtin-extensions/lunr-local-providers/index.js.map +1 -0
- package/dist/builtin-extensions/lunr-local-providers/local-servers.d.ts +51 -0
- package/dist/builtin-extensions/lunr-local-providers/local-servers.d.ts.map +1 -0
- package/dist/builtin-extensions/lunr-local-providers/local-servers.js +128 -0
- package/dist/builtin-extensions/lunr-local-providers/local-servers.js.map +1 -0
- package/dist/builtin-extensions/lunr-plan-tools.d.ts +25 -0
- package/dist/builtin-extensions/lunr-plan-tools.d.ts.map +1 -0
- package/dist/builtin-extensions/lunr-plan-tools.js +59 -0
- package/dist/builtin-extensions/lunr-plan-tools.js.map +1 -0
- package/dist/builtin-extensions/lunr-skill-creator/index.d.ts +12 -0
- package/dist/builtin-extensions/lunr-skill-creator/index.d.ts.map +1 -0
- package/dist/builtin-extensions/lunr-skill-creator/index.js +18 -0
- package/dist/builtin-extensions/lunr-skill-creator/index.js.map +1 -0
- package/dist/builtin-extensions/lunr-skill-creator/skills/skill-creator/SKILL.md +68 -0
- package/dist/builtin-extensions/lunr-todos.d.ts +52 -0
- package/dist/builtin-extensions/lunr-todos.d.ts.map +1 -0
- package/dist/builtin-extensions/lunr-todos.js +189 -0
- package/dist/builtin-extensions/lunr-todos.js.map +1 -0
- package/dist/builtin-extensions/narumiruna-pi-goal/src/accounting.d.ts +23 -0
- package/dist/builtin-extensions/narumiruna-pi-goal/src/accounting.d.ts.map +1 -0
- package/dist/builtin-extensions/narumiruna-pi-goal/src/accounting.js +77 -0
- package/dist/builtin-extensions/narumiruna-pi-goal/src/accounting.js.map +1 -0
- package/dist/builtin-extensions/narumiruna-pi-goal/src/command.d.ts +18 -0
- package/dist/builtin-extensions/narumiruna-pi-goal/src/command.d.ts.map +1 -0
- package/dist/builtin-extensions/narumiruna-pi-goal/src/command.js +165 -0
- package/dist/builtin-extensions/narumiruna-pi-goal/src/command.js.map +1 -0
- package/dist/builtin-extensions/narumiruna-pi-goal/src/commands.d.ts +19 -0
- package/dist/builtin-extensions/narumiruna-pi-goal/src/commands.d.ts.map +1 -0
- package/dist/builtin-extensions/narumiruna-pi-goal/src/commands.js +495 -0
- package/dist/builtin-extensions/narumiruna-pi-goal/src/commands.js.map +1 -0
- package/dist/builtin-extensions/narumiruna-pi-goal/src/goal.d.ts +10 -0
- package/dist/builtin-extensions/narumiruna-pi-goal/src/goal.d.ts.map +1 -0
- package/dist/builtin-extensions/narumiruna-pi-goal/src/goal.js +857 -0
- package/dist/builtin-extensions/narumiruna-pi-goal/src/goal.js.map +1 -0
- package/dist/builtin-extensions/narumiruna-pi-goal/src/persistence.d.ts +57 -0
- package/dist/builtin-extensions/narumiruna-pi-goal/src/persistence.d.ts.map +1 -0
- package/dist/builtin-extensions/narumiruna-pi-goal/src/persistence.js +225 -0
- package/dist/builtin-extensions/narumiruna-pi-goal/src/persistence.js.map +1 -0
- package/dist/builtin-extensions/narumiruna-pi-goal/src/prompts.d.ts +20 -0
- package/dist/builtin-extensions/narumiruna-pi-goal/src/prompts.d.ts.map +1 -0
- package/dist/builtin-extensions/narumiruna-pi-goal/src/prompts.js +75 -0
- package/dist/builtin-extensions/narumiruna-pi-goal/src/prompts.js.map +1 -0
- package/dist/builtin-extensions/narumiruna-pi-goal/src/queue.d.ts +16 -0
- package/dist/builtin-extensions/narumiruna-pi-goal/src/queue.d.ts.map +1 -0
- package/dist/builtin-extensions/narumiruna-pi-goal/src/queue.js +67 -0
- package/dist/builtin-extensions/narumiruna-pi-goal/src/queue.js.map +1 -0
- package/dist/builtin-extensions/narumiruna-pi-goal/src/runtime.d.ts +157 -0
- package/dist/builtin-extensions/narumiruna-pi-goal/src/runtime.d.ts.map +1 -0
- package/dist/builtin-extensions/narumiruna-pi-goal/src/runtime.js +825 -0
- package/dist/builtin-extensions/narumiruna-pi-goal/src/runtime.js.map +1 -0
- package/dist/builtin-extensions/narumiruna-pi-goal/src/settings.d.ts +22 -0
- package/dist/builtin-extensions/narumiruna-pi-goal/src/settings.d.ts.map +1 -0
- package/dist/builtin-extensions/narumiruna-pi-goal/src/settings.js +64 -0
- package/dist/builtin-extensions/narumiruna-pi-goal/src/settings.js.map +1 -0
- package/dist/builtin-extensions/pi-intercom/broker/broker.d.ts +2 -0
- package/dist/builtin-extensions/pi-intercom/broker/broker.d.ts.map +1 -0
- package/dist/builtin-extensions/pi-intercom/broker/broker.js +541 -0
- package/dist/builtin-extensions/pi-intercom/broker/broker.js.map +1 -0
- package/dist/builtin-extensions/pi-intercom/broker/client.d.ts +39 -0
- package/dist/builtin-extensions/pi-intercom/broker/client.d.ts.map +1 -0
- package/dist/builtin-extensions/pi-intercom/broker/client.js +484 -0
- package/dist/builtin-extensions/pi-intercom/broker/client.js.map +1 -0
- package/dist/builtin-extensions/pi-intercom/broker/framing.d.ts +14 -0
- package/dist/builtin-extensions/pi-intercom/broker/framing.d.ts.map +1 -0
- package/dist/builtin-extensions/pi-intercom/broker/framing.js +74 -0
- package/dist/builtin-extensions/pi-intercom/broker/framing.js.map +1 -0
- package/dist/builtin-extensions/pi-intercom/broker/paths.d.ts +22 -0
- package/dist/builtin-extensions/pi-intercom/broker/paths.d.ts.map +1 -0
- package/dist/builtin-extensions/pi-intercom/broker/paths.js +88 -0
- package/dist/builtin-extensions/pi-intercom/broker/paths.js.map +1 -0
- package/dist/builtin-extensions/pi-intercom/broker/spawn.d.ts +27 -0
- package/dist/builtin-extensions/pi-intercom/broker/spawn.d.ts.map +1 -0
- package/dist/builtin-extensions/pi-intercom/broker/spawn.js +313 -0
- package/dist/builtin-extensions/pi-intercom/broker/spawn.js.map +1 -0
- package/dist/builtin-extensions/pi-intercom/config.d.ts +22 -0
- package/dist/builtin-extensions/pi-intercom/config.d.ts.map +1 -0
- package/dist/builtin-extensions/pi-intercom/config.js +103 -0
- package/dist/builtin-extensions/pi-intercom/config.js.map +1 -0
- package/dist/builtin-extensions/pi-intercom/index.d.ts +3 -0
- package/dist/builtin-extensions/pi-intercom/index.d.ts.map +1 -0
- package/dist/builtin-extensions/pi-intercom/index.js +1800 -0
- package/dist/builtin-extensions/pi-intercom/index.js.map +1 -0
- package/dist/builtin-extensions/pi-intercom/reply-tracker.d.ts +27 -0
- package/dist/builtin-extensions/pi-intercom/reply-tracker.d.ts.map +1 -0
- package/dist/builtin-extensions/pi-intercom/reply-tracker.js +101 -0
- package/dist/builtin-extensions/pi-intercom/reply-tracker.js.map +1 -0
- package/dist/builtin-extensions/pi-intercom/types.d.ts +84 -0
- package/dist/builtin-extensions/pi-intercom/types.d.ts.map +1 -0
- package/dist/builtin-extensions/pi-intercom/types.js +2 -0
- package/dist/builtin-extensions/pi-intercom/types.js.map +1 -0
- package/dist/builtin-extensions/pi-intercom/ui/compose.d.ts +27 -0
- package/dist/builtin-extensions/pi-intercom/ui/compose.d.ts.map +1 -0
- package/dist/builtin-extensions/pi-intercom/ui/compose.js +112 -0
- package/dist/builtin-extensions/pi-intercom/ui/compose.js.map +1 -0
- package/dist/builtin-extensions/pi-intercom/ui/inline-message.d.ts +15 -0
- package/dist/builtin-extensions/pi-intercom/ui/inline-message.d.ts.map +1 -0
- package/dist/builtin-extensions/pi-intercom/ui/inline-message.js +86 -0
- package/dist/builtin-extensions/pi-intercom/ui/inline-message.js.map +1 -0
- package/dist/builtin-extensions/pi-intercom/ui/session-list.d.ts +18 -0
- package/dist/builtin-extensions/pi-intercom/ui/session-list.d.ts.map +1 -0
- package/dist/builtin-extensions/pi-intercom/ui/session-list.js +134 -0
- package/dist/builtin-extensions/pi-intercom/ui/session-list.js.map +1 -0
- package/dist/builtin-extensions/pi-lsp-extension/bemol-extension/bemol.d.ts +81 -0
- package/dist/builtin-extensions/pi-lsp-extension/bemol-extension/bemol.d.ts.map +1 -0
- package/dist/builtin-extensions/pi-lsp-extension/bemol-extension/bemol.js +273 -0
- package/dist/builtin-extensions/pi-lsp-extension/bemol-extension/bemol.js.map +1 -0
- package/dist/builtin-extensions/pi-lsp-extension/bemol-extension/index.d.ts +13 -0
- package/dist/builtin-extensions/pi-lsp-extension/bemol-extension/index.d.ts.map +1 -0
- package/dist/builtin-extensions/pi-lsp-extension/bemol-extension/index.js +163 -0
- package/dist/builtin-extensions/pi-lsp-extension/bemol-extension/index.js.map +1 -0
- package/dist/builtin-extensions/pi-lsp-extension/bemol-extension/locks.d.ts +34 -0
- package/dist/builtin-extensions/pi-lsp-extension/bemol-extension/locks.d.ts.map +1 -0
- package/dist/builtin-extensions/pi-lsp-extension/bemol-extension/locks.js +148 -0
- package/dist/builtin-extensions/pi-lsp-extension/bemol-extension/locks.js.map +1 -0
- package/dist/builtin-extensions/pi-lsp-extension/src/file-sync.d.ts +59 -0
- package/dist/builtin-extensions/pi-lsp-extension/src/file-sync.d.ts.map +1 -0
- package/dist/builtin-extensions/pi-lsp-extension/src/file-sync.js +172 -0
- package/dist/builtin-extensions/pi-lsp-extension/src/file-sync.js.map +1 -0
- package/dist/builtin-extensions/pi-lsp-extension/src/index.d.ts +25 -0
- package/dist/builtin-extensions/pi-lsp-extension/src/index.d.ts.map +1 -0
- package/dist/builtin-extensions/pi-lsp-extension/src/index.js +521 -0
- package/dist/builtin-extensions/pi-lsp-extension/src/index.js.map +1 -0
- package/dist/builtin-extensions/pi-lsp-extension/src/lsp-client.d.ts +80 -0
- package/dist/builtin-extensions/pi-lsp-extension/src/lsp-client.d.ts.map +1 -0
- package/dist/builtin-extensions/pi-lsp-extension/src/lsp-client.js +366 -0
- package/dist/builtin-extensions/pi-lsp-extension/src/lsp-client.js.map +1 -0
- package/dist/builtin-extensions/pi-lsp-extension/src/lsp-daemon.d.ts +22 -0
- package/dist/builtin-extensions/pi-lsp-extension/src/lsp-daemon.d.ts.map +1 -0
- package/dist/builtin-extensions/pi-lsp-extension/src/lsp-daemon.js +476 -0
- package/dist/builtin-extensions/pi-lsp-extension/src/lsp-daemon.js.map +1 -0
- package/dist/builtin-extensions/pi-lsp-extension/src/lsp-manager.d.ts +141 -0
- package/dist/builtin-extensions/pi-lsp-extension/src/lsp-manager.d.ts.map +1 -0
- package/dist/builtin-extensions/pi-lsp-extension/src/lsp-manager.js +633 -0
- package/dist/builtin-extensions/pi-lsp-extension/src/lsp-manager.js.map +1 -0
- package/dist/builtin-extensions/pi-lsp-extension/src/resolve-provider.d.ts +30 -0
- package/dist/builtin-extensions/pi-lsp-extension/src/resolve-provider.d.ts.map +1 -0
- package/dist/builtin-extensions/pi-lsp-extension/src/resolve-provider.js +52 -0
- package/dist/builtin-extensions/pi-lsp-extension/src/resolve-provider.js.map +1 -0
- package/dist/builtin-extensions/pi-lsp-extension/src/shared/constants.d.ts +12 -0
- package/dist/builtin-extensions/pi-lsp-extension/src/shared/constants.d.ts.map +1 -0
- package/dist/builtin-extensions/pi-lsp-extension/src/shared/constants.js +18 -0
- package/dist/builtin-extensions/pi-lsp-extension/src/shared/constants.js.map +1 -0
- package/dist/builtin-extensions/pi-lsp-extension/src/shared/debug.d.ts +10 -0
- package/dist/builtin-extensions/pi-lsp-extension/src/shared/debug.d.ts.map +1 -0
- package/dist/builtin-extensions/pi-lsp-extension/src/shared/debug.js +18 -0
- package/dist/builtin-extensions/pi-lsp-extension/src/shared/debug.js.map +1 -0
- package/dist/builtin-extensions/pi-lsp-extension/src/shared/format.d.ts +9 -0
- package/dist/builtin-extensions/pi-lsp-extension/src/shared/format.d.ts.map +1 -0
- package/dist/builtin-extensions/pi-lsp-extension/src/shared/format.js +29 -0
- package/dist/builtin-extensions/pi-lsp-extension/src/shared/format.js.map +1 -0
- package/dist/builtin-extensions/pi-lsp-extension/src/shared/language-map.d.ts +10 -0
- package/dist/builtin-extensions/pi-lsp-extension/src/shared/language-map.d.ts.map +1 -0
- package/dist/builtin-extensions/pi-lsp-extension/src/shared/language-map.js +51 -0
- package/dist/builtin-extensions/pi-lsp-extension/src/shared/language-map.js.map +1 -0
- package/dist/builtin-extensions/pi-lsp-extension/src/shared/resolve-position.d.ts +33 -0
- package/dist/builtin-extensions/pi-lsp-extension/src/shared/resolve-position.d.ts.map +1 -0
- package/dist/builtin-extensions/pi-lsp-extension/src/shared/resolve-position.js +191 -0
- package/dist/builtin-extensions/pi-lsp-extension/src/shared/resolve-position.js.map +1 -0
- package/dist/builtin-extensions/pi-lsp-extension/src/shared/timing.d.ts +14 -0
- package/dist/builtin-extensions/pi-lsp-extension/src/shared/timing.d.ts.map +1 -0
- package/dist/builtin-extensions/pi-lsp-extension/src/shared/timing.js +15 -0
- package/dist/builtin-extensions/pi-lsp-extension/src/shared/timing.js.map +1 -0
- package/dist/builtin-extensions/pi-lsp-extension/src/tools/code-actions.d.ts +23 -0
- package/dist/builtin-extensions/pi-lsp-extension/src/tools/code-actions.d.ts.map +1 -0
- package/dist/builtin-extensions/pi-lsp-extension/src/tools/code-actions.js +259 -0
- package/dist/builtin-extensions/pi-lsp-extension/src/tools/code-actions.js.map +1 -0
- package/dist/builtin-extensions/pi-lsp-extension/src/tools/code-overview.d.ts +23 -0
- package/dist/builtin-extensions/pi-lsp-extension/src/tools/code-overview.d.ts.map +1 -0
- package/dist/builtin-extensions/pi-lsp-extension/src/tools/code-overview.js +197 -0
- package/dist/builtin-extensions/pi-lsp-extension/src/tools/code-overview.js.map +1 -0
- package/dist/builtin-extensions/pi-lsp-extension/src/tools/code-rewrite.d.ts +23 -0
- package/dist/builtin-extensions/pi-lsp-extension/src/tools/code-rewrite.d.ts.map +1 -0
- package/dist/builtin-extensions/pi-lsp-extension/src/tools/code-rewrite.js +131 -0
- package/dist/builtin-extensions/pi-lsp-extension/src/tools/code-rewrite.js.map +1 -0
- package/dist/builtin-extensions/pi-lsp-extension/src/tools/code-search.d.ts +18 -0
- package/dist/builtin-extensions/pi-lsp-extension/src/tools/code-search.d.ts.map +1 -0
- package/dist/builtin-extensions/pi-lsp-extension/src/tools/code-search.js +87 -0
- package/dist/builtin-extensions/pi-lsp-extension/src/tools/code-search.js.map +1 -0
- package/dist/builtin-extensions/pi-lsp-extension/src/tools/completions.d.ts +34 -0
- package/dist/builtin-extensions/pi-lsp-extension/src/tools/completions.d.ts.map +1 -0
- package/dist/builtin-extensions/pi-lsp-extension/src/tools/completions.js +347 -0
- package/dist/builtin-extensions/pi-lsp-extension/src/tools/completions.js.map +1 -0
- package/dist/builtin-extensions/pi-lsp-extension/src/tools/definition.d.ts +20 -0
- package/dist/builtin-extensions/pi-lsp-extension/src/tools/definition.d.ts.map +1 -0
- package/dist/builtin-extensions/pi-lsp-extension/src/tools/definition.js +166 -0
- package/dist/builtin-extensions/pi-lsp-extension/src/tools/definition.js.map +1 -0
- package/dist/builtin-extensions/pi-lsp-extension/src/tools/diagnostics.d.ts +22 -0
- package/dist/builtin-extensions/pi-lsp-extension/src/tools/diagnostics.d.ts.map +1 -0
- package/dist/builtin-extensions/pi-lsp-extension/src/tools/diagnostics.js +228 -0
- package/dist/builtin-extensions/pi-lsp-extension/src/tools/diagnostics.js.map +1 -0
- package/dist/builtin-extensions/pi-lsp-extension/src/tools/hover.d.ts +19 -0
- package/dist/builtin-extensions/pi-lsp-extension/src/tools/hover.d.ts.map +1 -0
- package/dist/builtin-extensions/pi-lsp-extension/src/tools/hover.js +143 -0
- package/dist/builtin-extensions/pi-lsp-extension/src/tools/hover.js.map +1 -0
- package/dist/builtin-extensions/pi-lsp-extension/src/tools/references.d.ts +20 -0
- package/dist/builtin-extensions/pi-lsp-extension/src/tools/references.d.ts.map +1 -0
- package/dist/builtin-extensions/pi-lsp-extension/src/tools/references.js +98 -0
- package/dist/builtin-extensions/pi-lsp-extension/src/tools/references.js.map +1 -0
- package/dist/builtin-extensions/pi-lsp-extension/src/tools/rename.d.ts +22 -0
- package/dist/builtin-extensions/pi-lsp-extension/src/tools/rename.d.ts.map +1 -0
- package/dist/builtin-extensions/pi-lsp-extension/src/tools/rename.js +150 -0
- package/dist/builtin-extensions/pi-lsp-extension/src/tools/rename.js.map +1 -0
- package/dist/builtin-extensions/pi-lsp-extension/src/tools/symbols.d.ts +18 -0
- package/dist/builtin-extensions/pi-lsp-extension/src/tools/symbols.d.ts.map +1 -0
- package/dist/builtin-extensions/pi-lsp-extension/src/tools/symbols.js +211 -0
- package/dist/builtin-extensions/pi-lsp-extension/src/tools/symbols.js.map +1 -0
- package/dist/builtin-extensions/pi-lsp-extension/src/tree-sitter/parser-manager.d.ts +44 -0
- package/dist/builtin-extensions/pi-lsp-extension/src/tree-sitter/parser-manager.d.ts.map +1 -0
- package/dist/builtin-extensions/pi-lsp-extension/src/tree-sitter/parser-manager.js +188 -0
- package/dist/builtin-extensions/pi-lsp-extension/src/tree-sitter/parser-manager.js.map +1 -0
- package/dist/builtin-extensions/pi-lsp-extension/src/tree-sitter/pattern-compiler.d.ts +58 -0
- package/dist/builtin-extensions/pi-lsp-extension/src/tree-sitter/pattern-compiler.d.ts.map +1 -0
- package/dist/builtin-extensions/pi-lsp-extension/src/tree-sitter/pattern-compiler.js +260 -0
- package/dist/builtin-extensions/pi-lsp-extension/src/tree-sitter/pattern-compiler.js.map +1 -0
- package/dist/builtin-extensions/pi-lsp-extension/src/tree-sitter/rewrite-engine.d.ts +33 -0
- package/dist/builtin-extensions/pi-lsp-extension/src/tree-sitter/rewrite-engine.d.ts.map +1 -0
- package/dist/builtin-extensions/pi-lsp-extension/src/tree-sitter/rewrite-engine.js +102 -0
- package/dist/builtin-extensions/pi-lsp-extension/src/tree-sitter/rewrite-engine.js.map +1 -0
- package/dist/builtin-extensions/pi-lsp-extension/src/tree-sitter/search-engine.d.ts +38 -0
- package/dist/builtin-extensions/pi-lsp-extension/src/tree-sitter/search-engine.d.ts.map +1 -0
- package/dist/builtin-extensions/pi-lsp-extension/src/tree-sitter/search-engine.js +276 -0
- package/dist/builtin-extensions/pi-lsp-extension/src/tree-sitter/search-engine.js.map +1 -0
- package/dist/builtin-extensions/pi-lsp-extension/src/tree-sitter/symbol-extractor.d.ts +77 -0
- package/dist/builtin-extensions/pi-lsp-extension/src/tree-sitter/symbol-extractor.d.ts.map +1 -0
- package/dist/builtin-extensions/pi-lsp-extension/src/tree-sitter/symbol-extractor.js +339 -0
- package/dist/builtin-extensions/pi-lsp-extension/src/tree-sitter/symbol-extractor.js.map +1 -0
- package/dist/builtin-extensions/pi-lsp-extension/src/tree-sitter/workspace-index.d.ts +51 -0
- package/dist/builtin-extensions/pi-lsp-extension/src/tree-sitter/workspace-index.d.ts.map +1 -0
- package/dist/builtin-extensions/pi-lsp-extension/src/tree-sitter/workspace-index.js +219 -0
- package/dist/builtin-extensions/pi-lsp-extension/src/tree-sitter/workspace-index.js.map +1 -0
- package/dist/builtin-extensions/pi-lsp-extension/src/workspace-provider.d.ts +45 -0
- package/dist/builtin-extensions/pi-lsp-extension/src/workspace-provider.d.ts.map +1 -0
- package/dist/builtin-extensions/pi-lsp-extension/src/workspace-provider.js +30 -0
- package/dist/builtin-extensions/pi-lsp-extension/src/workspace-provider.js.map +1 -0
- package/dist/builtin-extensions/pi-mcp-adapter/abort.d.ts +3 -0
- package/dist/builtin-extensions/pi-mcp-adapter/abort.d.ts.map +1 -0
- package/dist/builtin-extensions/pi-mcp-adapter/abort.js +37 -0
- package/dist/builtin-extensions/pi-mcp-adapter/abort.js.map +1 -0
- package/dist/builtin-extensions/pi-mcp-adapter/agent-dir.d.ts +3 -0
- package/dist/builtin-extensions/pi-mcp-adapter/agent-dir.d.ts.map +1 -0
- package/dist/builtin-extensions/pi-mcp-adapter/agent-dir.js +22 -0
- package/dist/builtin-extensions/pi-mcp-adapter/agent-dir.js.map +1 -0
- package/dist/builtin-extensions/pi-mcp-adapter/commands.d.ts +18 -0
- package/dist/builtin-extensions/pi-mcp-adapter/commands.d.ts.map +1 -0
- package/dist/builtin-extensions/pi-mcp-adapter/commands.js +327 -0
- package/dist/builtin-extensions/pi-mcp-adapter/commands.js.map +1 -0
- package/dist/builtin-extensions/pi-mcp-adapter/config.d.ts +79 -0
- package/dist/builtin-extensions/pi-mcp-adapter/config.d.ts.map +1 -0
- package/dist/builtin-extensions/pi-mcp-adapter/config.js +557 -0
- package/dist/builtin-extensions/pi-mcp-adapter/config.js.map +1 -0
- package/dist/builtin-extensions/pi-mcp-adapter/consent-manager.d.ts +14 -0
- package/dist/builtin-extensions/pi-mcp-adapter/consent-manager.d.ts.map +1 -0
- package/dist/builtin-extensions/pi-mcp-adapter/consent-manager.js +61 -0
- package/dist/builtin-extensions/pi-mcp-adapter/consent-manager.js.map +1 -0
- package/dist/builtin-extensions/pi-mcp-adapter/direct-tools.d.ts +11 -0
- package/dist/builtin-extensions/pi-mcp-adapter/direct-tools.d.ts.map +1 -0
- package/dist/builtin-extensions/pi-mcp-adapter/direct-tools.js +374 -0
- package/dist/builtin-extensions/pi-mcp-adapter/direct-tools.js.map +1 -0
- package/dist/builtin-extensions/pi-mcp-adapter/elicitation-handler.d.ts +18 -0
- package/dist/builtin-extensions/pi-mcp-adapter/elicitation-handler.d.ts.map +1 -0
- package/dist/builtin-extensions/pi-mcp-adapter/elicitation-handler.js +309 -0
- package/dist/builtin-extensions/pi-mcp-adapter/elicitation-handler.js.map +1 -0
- package/dist/builtin-extensions/pi-mcp-adapter/error-signal.d.ts +16 -0
- package/dist/builtin-extensions/pi-mcp-adapter/error-signal.d.ts.map +1 -0
- package/dist/builtin-extensions/pi-mcp-adapter/error-signal.js +23 -0
- package/dist/builtin-extensions/pi-mcp-adapter/error-signal.js.map +1 -0
- package/dist/builtin-extensions/pi-mcp-adapter/errors.d.ts +100 -0
- package/dist/builtin-extensions/pi-mcp-adapter/errors.d.ts.map +1 -0
- package/dist/builtin-extensions/pi-mcp-adapter/errors.js +167 -0
- package/dist/builtin-extensions/pi-mcp-adapter/errors.js.map +1 -0
- package/dist/builtin-extensions/pi-mcp-adapter/glimpse-ui.d.ts +10 -0
- package/dist/builtin-extensions/pi-mcp-adapter/glimpse-ui.d.ts.map +1 -0
- package/dist/builtin-extensions/pi-mcp-adapter/glimpse-ui.js +77 -0
- package/dist/builtin-extensions/pi-mcp-adapter/glimpse-ui.js.map +1 -0
- package/dist/builtin-extensions/pi-mcp-adapter/host-html-template.d.ts +17 -0
- package/dist/builtin-extensions/pi-mcp-adapter/host-html-template.d.ts.map +1 -0
- package/dist/builtin-extensions/pi-mcp-adapter/host-html-template.js +413 -0
- package/dist/builtin-extensions/pi-mcp-adapter/host-html-template.js.map +1 -0
- package/dist/builtin-extensions/pi-mcp-adapter/index.d.ts +3 -0
- package/dist/builtin-extensions/pi-mcp-adapter/index.d.ts.map +1 -0
- package/dist/builtin-extensions/pi-mcp-adapter/index.js +334 -0
- package/dist/builtin-extensions/pi-mcp-adapter/index.js.map +1 -0
- package/dist/builtin-extensions/pi-mcp-adapter/init.d.ts +11 -0
- package/dist/builtin-extensions/pi-mcp-adapter/init.d.ts.map +1 -0
- package/dist/builtin-extensions/pi-mcp-adapter/init.js +296 -0
- package/dist/builtin-extensions/pi-mcp-adapter/init.js.map +1 -0
- package/dist/builtin-extensions/pi-mcp-adapter/lifecycle.d.ts +30 -0
- package/dist/builtin-extensions/pi-mcp-adapter/lifecycle.d.ts.map +1 -0
- package/dist/builtin-extensions/pi-mcp-adapter/lifecycle.js +80 -0
- package/dist/builtin-extensions/pi-mcp-adapter/lifecycle.js.map +1 -0
- package/dist/builtin-extensions/pi-mcp-adapter/logger.d.ts +52 -0
- package/dist/builtin-extensions/pi-mcp-adapter/logger.d.ts.map +1 -0
- package/dist/builtin-extensions/pi-mcp-adapter/logger.js +132 -0
- package/dist/builtin-extensions/pi-mcp-adapter/logger.js.map +1 -0
- package/dist/builtin-extensions/pi-mcp-adapter/mcp-auth-flow.d.ts +86 -0
- package/dist/builtin-extensions/pi-mcp-adapter/mcp-auth-flow.d.ts.map +1 -0
- package/dist/builtin-extensions/pi-mcp-adapter/mcp-auth-flow.js +482 -0
- package/dist/builtin-extensions/pi-mcp-adapter/mcp-auth-flow.js.map +1 -0
- package/dist/builtin-extensions/pi-mcp-adapter/mcp-auth.d.ts +104 -0
- package/dist/builtin-extensions/pi-mcp-adapter/mcp-auth.d.ts.map +1 -0
- package/dist/builtin-extensions/pi-mcp-adapter/mcp-auth.js +252 -0
- package/dist/builtin-extensions/pi-mcp-adapter/mcp-auth.js.map +1 -0
- package/dist/builtin-extensions/pi-mcp-adapter/mcp-callback-server.d.ts +45 -0
- package/dist/builtin-extensions/pi-mcp-adapter/mcp-callback-server.d.ts.map +1 -0
- package/dist/builtin-extensions/pi-mcp-adapter/mcp-callback-server.js +305 -0
- package/dist/builtin-extensions/pi-mcp-adapter/mcp-callback-server.js.map +1 -0
- package/dist/builtin-extensions/pi-mcp-adapter/mcp-oauth-provider.d.ts +111 -0
- package/dist/builtin-extensions/pi-mcp-adapter/mcp-oauth-provider.d.ts.map +1 -0
- package/dist/builtin-extensions/pi-mcp-adapter/mcp-oauth-provider.js +302 -0
- package/dist/builtin-extensions/pi-mcp-adapter/mcp-oauth-provider.js.map +1 -0
- package/dist/builtin-extensions/pi-mcp-adapter/mcp-output-guard.d.ts +59 -0
- package/dist/builtin-extensions/pi-mcp-adapter/mcp-output-guard.d.ts.map +1 -0
- package/dist/builtin-extensions/pi-mcp-adapter/mcp-output-guard.js +325 -0
- package/dist/builtin-extensions/pi-mcp-adapter/mcp-output-guard.js.map +1 -0
- package/dist/builtin-extensions/pi-mcp-adapter/mcp-panel.d.ts +64 -0
- package/dist/builtin-extensions/pi-mcp-adapter/mcp-panel.d.ts.map +1 -0
- package/dist/builtin-extensions/pi-mcp-adapter/mcp-panel.js +777 -0
- package/dist/builtin-extensions/pi-mcp-adapter/mcp-panel.js.map +1 -0
- package/dist/builtin-extensions/pi-mcp-adapter/mcp-setup-panel.d.ts +77 -0
- package/dist/builtin-extensions/pi-mcp-adapter/mcp-setup-panel.d.ts.map +1 -0
- package/dist/builtin-extensions/pi-mcp-adapter/mcp-setup-panel.js +490 -0
- package/dist/builtin-extensions/pi-mcp-adapter/mcp-setup-panel.js.map +1 -0
- package/dist/builtin-extensions/pi-mcp-adapter/metadata-cache.d.ts +32 -0
- package/dist/builtin-extensions/pi-mcp-adapter/metadata-cache.d.ts.map +1 -0
- package/dist/builtin-extensions/pi-mcp-adapter/metadata-cache.js +160 -0
- package/dist/builtin-extensions/pi-mcp-adapter/metadata-cache.js.map +1 -0
- package/dist/builtin-extensions/pi-mcp-adapter/npx-resolver.d.ts +7 -0
- package/dist/builtin-extensions/pi-mcp-adapter/npx-resolver.d.ts.map +1 -0
- package/dist/builtin-extensions/pi-mcp-adapter/npx-resolver.js +388 -0
- package/dist/builtin-extensions/pi-mcp-adapter/npx-resolver.js.map +1 -0
- package/dist/builtin-extensions/pi-mcp-adapter/oauth-handler.d.ts +19 -0
- package/dist/builtin-extensions/pi-mcp-adapter/oauth-handler.d.ts.map +1 -0
- package/dist/builtin-extensions/pi-mcp-adapter/oauth-handler.js +53 -0
- package/dist/builtin-extensions/pi-mcp-adapter/oauth-handler.js.map +1 -0
- package/dist/builtin-extensions/pi-mcp-adapter/onboarding-state.d.ts +13 -0
- package/dist/builtin-extensions/pi-mcp-adapter/onboarding-state.d.ts.map +1 -0
- package/dist/builtin-extensions/pi-mcp-adapter/onboarding-state.js +58 -0
- package/dist/builtin-extensions/pi-mcp-adapter/onboarding-state.js.map +1 -0
- package/dist/builtin-extensions/pi-mcp-adapter/panel-keys.d.ts +17 -0
- package/dist/builtin-extensions/pi-mcp-adapter/panel-keys.d.ts.map +1 -0
- package/dist/builtin-extensions/pi-mcp-adapter/panel-keys.js +17 -0
- package/dist/builtin-extensions/pi-mcp-adapter/panel-keys.js.map +1 -0
- package/dist/builtin-extensions/pi-mcp-adapter/proxy-modes.d.ts +14 -0
- package/dist/builtin-extensions/pi-mcp-adapter/proxy-modes.d.ts.map +1 -0
- package/dist/builtin-extensions/pi-mcp-adapter/proxy-modes.js +853 -0
- package/dist/builtin-extensions/pi-mcp-adapter/proxy-modes.js.map +1 -0
- package/dist/builtin-extensions/pi-mcp-adapter/resource-tools.d.ts +2 -0
- package/dist/builtin-extensions/pi-mcp-adapter/resource-tools.d.ts.map +1 -0
- package/dist/builtin-extensions/pi-mcp-adapter/resource-tools.js +16 -0
- package/dist/builtin-extensions/pi-mcp-adapter/resource-tools.js.map +1 -0
- package/dist/builtin-extensions/pi-mcp-adapter/sampling-handler.d.ts +16 -0
- package/dist/builtin-extensions/pi-mcp-adapter/sampling-handler.d.ts.map +1 -0
- package/dist/builtin-extensions/pi-mcp-adapter/sampling-handler.js +209 -0
- package/dist/builtin-extensions/pi-mcp-adapter/sampling-handler.js.map +1 -0
- package/dist/builtin-extensions/pi-mcp-adapter/server-manager.d.ts +58 -0
- package/dist/builtin-extensions/pi-mcp-adapter/server-manager.d.ts.map +1 -0
- package/dist/builtin-extensions/pi-mcp-adapter/server-manager.js +403 -0
- package/dist/builtin-extensions/pi-mcp-adapter/server-manager.js.map +1 -0
- package/dist/builtin-extensions/pi-mcp-adapter/state.d.ts +41 -0
- package/dist/builtin-extensions/pi-mcp-adapter/state.d.ts.map +1 -0
- package/dist/builtin-extensions/pi-mcp-adapter/state.js +2 -0
- package/dist/builtin-extensions/pi-mcp-adapter/state.js.map +1 -0
- package/dist/builtin-extensions/pi-mcp-adapter/tool-metadata.d.ts +11 -0
- package/dist/builtin-extensions/pi-mcp-adapter/tool-metadata.d.ts.map +1 -0
- package/dist/builtin-extensions/pi-mcp-adapter/tool-metadata.js +178 -0
- package/dist/builtin-extensions/pi-mcp-adapter/tool-metadata.js.map +1 -0
- package/dist/builtin-extensions/pi-mcp-adapter/tool-registrar.d.ts +11 -0
- package/dist/builtin-extensions/pi-mcp-adapter/tool-registrar.d.ts.map +1 -0
- package/dist/builtin-extensions/pi-mcp-adapter/tool-registrar.js +66 -0
- package/dist/builtin-extensions/pi-mcp-adapter/tool-registrar.js.map +1 -0
- package/dist/builtin-extensions/pi-mcp-adapter/tool-result-renderer.d.ts +35 -0
- package/dist/builtin-extensions/pi-mcp-adapter/tool-result-renderer.d.ts.map +1 -0
- package/dist/builtin-extensions/pi-mcp-adapter/tool-result-renderer.js +107 -0
- package/dist/builtin-extensions/pi-mcp-adapter/tool-result-renderer.js.map +1 -0
- package/dist/builtin-extensions/pi-mcp-adapter/types.d.ts +286 -0
- package/dist/builtin-extensions/pi-mcp-adapter/types.d.ts.map +1 -0
- package/dist/builtin-extensions/pi-mcp-adapter/types.js +94 -0
- package/dist/builtin-extensions/pi-mcp-adapter/types.js.map +1 -0
- package/dist/builtin-extensions/pi-mcp-adapter/ui-resource-handler.d.ts +10 -0
- package/dist/builtin-extensions/pi-mcp-adapter/ui-resource-handler.d.ts.map +1 -0
- package/dist/builtin-extensions/pi-mcp-adapter/ui-resource-handler.js +118 -0
- package/dist/builtin-extensions/pi-mcp-adapter/ui-resource-handler.js.map +1 -0
- package/dist/builtin-extensions/pi-mcp-adapter/ui-server.d.ts +37 -0
- package/dist/builtin-extensions/pi-mcp-adapter/ui-server.d.ts.map +1 -0
- package/dist/builtin-extensions/pi-mcp-adapter/ui-server.js +524 -0
- package/dist/builtin-extensions/pi-mcp-adapter/ui-server.js.map +1 -0
- package/dist/builtin-extensions/pi-mcp-adapter/ui-session.d.ts +27 -0
- package/dist/builtin-extensions/pi-mcp-adapter/ui-session.d.ts.map +1 -0
- package/dist/builtin-extensions/pi-mcp-adapter/ui-session.js +311 -0
- package/dist/builtin-extensions/pi-mcp-adapter/ui-session.js.map +1 -0
- package/dist/builtin-extensions/pi-mcp-adapter/ui-stream-types.d.ts +105 -0
- package/dist/builtin-extensions/pi-mcp-adapter/ui-stream-types.d.ts.map +1 -0
- package/dist/builtin-extensions/pi-mcp-adapter/ui-stream-types.js +60 -0
- package/dist/builtin-extensions/pi-mcp-adapter/ui-stream-types.js.map +1 -0
- package/dist/builtin-extensions/pi-mcp-adapter/utils.d.ts +18 -0
- package/dist/builtin-extensions/pi-mcp-adapter/utils.d.ts.map +1 -0
- package/dist/builtin-extensions/pi-mcp-adapter/utils.js +112 -0
- package/dist/builtin-extensions/pi-mcp-adapter/utils.js.map +1 -0
- package/dist/builtin-extensions/pi-mcp-adapter/vitest.config.d.ts +3 -0
- package/dist/builtin-extensions/pi-mcp-adapter/vitest.config.d.ts.map +1 -0
- package/dist/builtin-extensions/pi-mcp-adapter/vitest.config.js +15 -0
- package/dist/builtin-extensions/pi-mcp-adapter/vitest.config.js.map +1 -0
- package/dist/builtin-extensions/pi-ollama-cloud/index.d.ts +31 -0
- package/dist/builtin-extensions/pi-ollama-cloud/index.d.ts.map +1 -0
- package/dist/builtin-extensions/pi-ollama-cloud/index.js +120 -0
- package/dist/builtin-extensions/pi-ollama-cloud/index.js.map +1 -0
- package/dist/builtin-extensions/pi-ollama-cloud/models.d.ts +49 -0
- package/dist/builtin-extensions/pi-ollama-cloud/models.d.ts.map +1 -0
- package/dist/builtin-extensions/pi-ollama-cloud/models.generated.d.ts +3 -0
- package/dist/builtin-extensions/pi-ollama-cloud/models.generated.d.ts.map +1 -0
- package/dist/builtin-extensions/pi-ollama-cloud/models.generated.js +1135 -0
- package/dist/builtin-extensions/pi-ollama-cloud/models.generated.js.map +1 -0
- package/dist/builtin-extensions/pi-ollama-cloud/models.js +239 -0
- package/dist/builtin-extensions/pi-ollama-cloud/models.js.map +1 -0
- package/dist/builtin-extensions/pi-ollama-cloud/thinking-levels.d.ts +40 -0
- package/dist/builtin-extensions/pi-ollama-cloud/thinking-levels.d.ts.map +1 -0
- package/dist/builtin-extensions/pi-ollama-cloud/thinking-levels.js +80 -0
- package/dist/builtin-extensions/pi-ollama-cloud/thinking-levels.js.map +1 -0
- package/dist/builtin-extensions/pi-ollama-cloud/utils.d.ts +9 -0
- package/dist/builtin-extensions/pi-ollama-cloud/utils.d.ts.map +1 -0
- package/dist/builtin-extensions/pi-ollama-cloud/utils.js +52 -0
- package/dist/builtin-extensions/pi-ollama-cloud/utils.js.map +1 -0
- package/dist/builtin-extensions/pi-prompt-template-model/args.d.ts +56 -0
- package/dist/builtin-extensions/pi-prompt-template-model/args.d.ts.map +1 -0
- package/dist/builtin-extensions/pi-prompt-template-model/args.js +555 -0
- package/dist/builtin-extensions/pi-prompt-template-model/args.js.map +1 -0
- package/dist/builtin-extensions/pi-prompt-template-model/chain-parser.d.ts +22 -0
- package/dist/builtin-extensions/pi-prompt-template-model/chain-parser.d.ts.map +1 -0
- package/dist/builtin-extensions/pi-prompt-template-model/chain-parser.js +249 -0
- package/dist/builtin-extensions/pi-prompt-template-model/chain-parser.js.map +1 -0
- package/dist/builtin-extensions/pi-prompt-template-model/deterministic-renderer.d.ts +20 -0
- package/dist/builtin-extensions/pi-prompt-template-model/deterministic-renderer.d.ts.map +1 -0
- package/dist/builtin-extensions/pi-prompt-template-model/deterministic-renderer.js +102 -0
- package/dist/builtin-extensions/pi-prompt-template-model/deterministic-renderer.js.map +1 -0
- package/dist/builtin-extensions/pi-prompt-template-model/deterministic-step.d.ts +30 -0
- package/dist/builtin-extensions/pi-prompt-template-model/deterministic-step.d.ts.map +1 -0
- package/dist/builtin-extensions/pi-prompt-template-model/deterministic-step.js +260 -0
- package/dist/builtin-extensions/pi-prompt-template-model/deterministic-step.js.map +1 -0
- package/dist/builtin-extensions/pi-prompt-template-model/index.d.ts +3 -0
- package/dist/builtin-extensions/pi-prompt-template-model/index.d.ts.map +1 -0
- package/dist/builtin-extensions/pi-prompt-template-model/index.js +1403 -0
- package/dist/builtin-extensions/pi-prompt-template-model/index.js.map +1 -0
- package/dist/builtin-extensions/pi-prompt-template-model/loop-utils.d.ts +8 -0
- package/dist/builtin-extensions/pi-prompt-template-model/loop-utils.d.ts.map +1 -0
- package/dist/builtin-extensions/pi-prompt-template-model/loop-utils.js +164 -0
- package/dist/builtin-extensions/pi-prompt-template-model/loop-utils.js.map +1 -0
- package/dist/builtin-extensions/pi-prompt-template-model/model-selection.d.ts +22 -0
- package/dist/builtin-extensions/pi-prompt-template-model/model-selection.d.ts.map +1 -0
- package/dist/builtin-extensions/pi-prompt-template-model/model-selection.js +82 -0
- package/dist/builtin-extensions/pi-prompt-template-model/model-selection.js.map +1 -0
- package/dist/builtin-extensions/pi-prompt-template-model/notifications.d.ts +6 -0
- package/dist/builtin-extensions/pi-prompt-template-model/notifications.d.ts.map +1 -0
- package/dist/builtin-extensions/pi-prompt-template-model/notifications.js +21 -0
- package/dist/builtin-extensions/pi-prompt-template-model/notifications.js.map +1 -0
- package/dist/builtin-extensions/pi-prompt-template-model/prompt-execution.d.ts +24 -0
- package/dist/builtin-extensions/pi-prompt-template-model/prompt-execution.d.ts.map +1 -0
- package/dist/builtin-extensions/pi-prompt-template-model/prompt-execution.js +56 -0
- package/dist/builtin-extensions/pi-prompt-template-model/prompt-execution.js.map +1 -0
- package/dist/builtin-extensions/pi-prompt-template-model/prompt-loader.d.ts +80 -0
- package/dist/builtin-extensions/pi-prompt-template-model/prompt-loader.d.ts.map +1 -0
- package/dist/builtin-extensions/pi-prompt-template-model/prompt-loader.js +1234 -0
- package/dist/builtin-extensions/pi-prompt-template-model/prompt-loader.js.map +1 -0
- package/dist/builtin-extensions/pi-prompt-template-model/skill-loaded-renderer.d.ts +11 -0
- package/dist/builtin-extensions/pi-prompt-template-model/skill-loaded-renderer.d.ts.map +1 -0
- package/dist/builtin-extensions/pi-prompt-template-model/skill-loaded-renderer.js +31 -0
- package/dist/builtin-extensions/pi-prompt-template-model/skill-loaded-renderer.js.map +1 -0
- package/dist/builtin-extensions/pi-prompt-template-model/subagent-renderer.d.ts +43 -0
- package/dist/builtin-extensions/pi-prompt-template-model/subagent-renderer.d.ts.map +1 -0
- package/dist/builtin-extensions/pi-prompt-template-model/subagent-renderer.js +177 -0
- package/dist/builtin-extensions/pi-prompt-template-model/subagent-renderer.js.map +1 -0
- package/dist/builtin-extensions/pi-prompt-template-model/subagent-runtime.d.ts +97 -0
- package/dist/builtin-extensions/pi-prompt-template-model/subagent-runtime.d.ts.map +1 -0
- package/dist/builtin-extensions/pi-prompt-template-model/subagent-runtime.js +64 -0
- package/dist/builtin-extensions/pi-prompt-template-model/subagent-runtime.js.map +1 -0
- package/dist/builtin-extensions/pi-prompt-template-model/subagent-step.d.ts +48 -0
- package/dist/builtin-extensions/pi-prompt-template-model/subagent-step.d.ts.map +1 -0
- package/dist/builtin-extensions/pi-prompt-template-model/subagent-step.js +550 -0
- package/dist/builtin-extensions/pi-prompt-template-model/subagent-step.js.map +1 -0
- package/dist/builtin-extensions/pi-prompt-template-model/subagent-widget.d.ts +8 -0
- package/dist/builtin-extensions/pi-prompt-template-model/subagent-widget.d.ts.map +1 -0
- package/dist/builtin-extensions/pi-prompt-template-model/subagent-widget.js +230 -0
- package/dist/builtin-extensions/pi-prompt-template-model/subagent-widget.js.map +1 -0
- package/dist/builtin-extensions/pi-prompt-template-model/template-conditionals.d.ts +10 -0
- package/dist/builtin-extensions/pi-prompt-template-model/template-conditionals.d.ts.map +1 -0
- package/dist/builtin-extensions/pi-prompt-template-model/template-conditionals.js +226 -0
- package/dist/builtin-extensions/pi-prompt-template-model/template-conditionals.js.map +1 -0
- package/dist/builtin-extensions/pi-prompt-template-model/tool-manager.d.ts +17 -0
- package/dist/builtin-extensions/pi-prompt-template-model/tool-manager.d.ts.map +1 -0
- package/dist/builtin-extensions/pi-prompt-template-model/tool-manager.js +201 -0
- package/dist/builtin-extensions/pi-prompt-template-model/tool-manager.js.map +1 -0
- package/dist/builtin-extensions/pi-subagents/agents/context-builder.md +46 -0
- package/dist/builtin-extensions/pi-subagents/agents/deep-researcher.md +36 -0
- package/dist/builtin-extensions/pi-subagents/agents/delegate.md +12 -0
- package/dist/builtin-extensions/pi-subagents/agents/oracle.md +73 -0
- package/dist/builtin-extensions/pi-subagents/agents/planner.md +55 -0
- package/dist/builtin-extensions/pi-subagents/agents/research-writer.md +37 -0
- package/dist/builtin-extensions/pi-subagents/agents/researcher.md +52 -0
- package/dist/builtin-extensions/pi-subagents/agents/reviewer.md +79 -0
- package/dist/builtin-extensions/pi-subagents/agents/scout.md +50 -0
- package/dist/builtin-extensions/pi-subagents/agents/worker.md +55 -0
- package/dist/builtin-extensions/pi-subagents/index.d.ts +2 -0
- package/dist/builtin-extensions/pi-subagents/index.d.ts.map +1 -0
- package/dist/builtin-extensions/pi-subagents/index.js +3 -0
- package/dist/builtin-extensions/pi-subagents/index.js.map +1 -0
- package/dist/builtin-extensions/pi-subagents/src/agents/agent-management.d.ts +20 -0
- package/dist/builtin-extensions/pi-subagents/src/agents/agent-management.d.ts.map +1 -0
- package/dist/builtin-extensions/pi-subagents/src/agents/agent-management.js +1273 -0
- package/dist/builtin-extensions/pi-subagents/src/agents/agent-management.js.map +1 -0
- package/dist/builtin-extensions/pi-subagents/src/agents/agent-memory.d.ts +49 -0
- package/dist/builtin-extensions/pi-subagents/src/agents/agent-memory.d.ts.map +1 -0
- package/dist/builtin-extensions/pi-subagents/src/agents/agent-memory.js +252 -0
- package/dist/builtin-extensions/pi-subagents/src/agents/agent-memory.js.map +1 -0
- package/dist/builtin-extensions/pi-subagents/src/agents/agent-scope.d.ts +3 -0
- package/dist/builtin-extensions/pi-subagents/src/agents/agent-scope.d.ts.map +1 -0
- package/dist/builtin-extensions/pi-subagents/src/agents/agent-scope.js +6 -0
- package/dist/builtin-extensions/pi-subagents/src/agents/agent-scope.js.map +1 -0
- package/dist/builtin-extensions/pi-subagents/src/agents/agent-selection.d.ts +3 -0
- package/dist/builtin-extensions/pi-subagents/src/agents/agent-selection.d.ts.map +1 -0
- package/dist/builtin-extensions/pi-subagents/src/agents/agent-selection.js +23 -0
- package/dist/builtin-extensions/pi-subagents/src/agents/agent-selection.js.map +1 -0
- package/dist/builtin-extensions/pi-subagents/src/agents/agent-serializer.d.ts +8 -0
- package/dist/builtin-extensions/pi-subagents/src/agents/agent-serializer.d.ts.map +1 -0
- package/dist/builtin-extensions/pi-subagents/src/agents/agent-serializer.js +143 -0
- package/dist/builtin-extensions/pi-subagents/src/agents/agent-serializer.js.map +1 -0
- package/dist/builtin-extensions/pi-subagents/src/agents/agents.d.ts +176 -0
- package/dist/builtin-extensions/pi-subagents/src/agents/agents.d.ts.map +1 -0
- package/dist/builtin-extensions/pi-subagents/src/agents/agents.js +1326 -0
- package/dist/builtin-extensions/pi-subagents/src/agents/agents.js.map +1 -0
- package/dist/builtin-extensions/pi-subagents/src/agents/chain-serializer.d.ts +7 -0
- package/dist/builtin-extensions/pi-subagents/src/agents/chain-serializer.d.ts.map +1 -0
- package/dist/builtin-extensions/pi-subagents/src/agents/chain-serializer.js +307 -0
- package/dist/builtin-extensions/pi-subagents/src/agents/chain-serializer.js.map +1 -0
- package/dist/builtin-extensions/pi-subagents/src/agents/frontmatter.d.ts +11 -0
- package/dist/builtin-extensions/pi-subagents/src/agents/frontmatter.d.ts.map +1 -0
- package/dist/builtin-extensions/pi-subagents/src/agents/frontmatter.js +84 -0
- package/dist/builtin-extensions/pi-subagents/src/agents/frontmatter.js.map +1 -0
- package/dist/builtin-extensions/pi-subagents/src/agents/identity.d.ts +8 -0
- package/dist/builtin-extensions/pi-subagents/src/agents/identity.d.ts.map +1 -0
- package/dist/builtin-extensions/pi-subagents/src/agents/identity.js +30 -0
- package/dist/builtin-extensions/pi-subagents/src/agents/identity.js.map +1 -0
- package/dist/builtin-extensions/pi-subagents/src/agents/proactive-skills.d.ts +35 -0
- package/dist/builtin-extensions/pi-subagents/src/agents/proactive-skills.d.ts.map +1 -0
- package/dist/builtin-extensions/pi-subagents/src/agents/proactive-skills.js +151 -0
- package/dist/builtin-extensions/pi-subagents/src/agents/proactive-skills.js.map +1 -0
- package/dist/builtin-extensions/pi-subagents/src/agents/skills.d.ts +33 -0
- package/dist/builtin-extensions/pi-subagents/src/agents/skills.d.ts.map +1 -0
- package/dist/builtin-extensions/pi-subagents/src/agents/skills.js +674 -0
- package/dist/builtin-extensions/pi-subagents/src/agents/skills.js.map +1 -0
- package/dist/builtin-extensions/pi-subagents/src/api/background-work.d.ts +35 -0
- package/dist/builtin-extensions/pi-subagents/src/api/background-work.d.ts.map +1 -0
- package/dist/builtin-extensions/pi-subagents/src/api/background-work.js +162 -0
- package/dist/builtin-extensions/pi-subagents/src/api/background-work.js.map +1 -0
- package/dist/builtin-extensions/pi-subagents/src/api/delegation.d.ts +113 -0
- package/dist/builtin-extensions/pi-subagents/src/api/delegation.d.ts.map +1 -0
- package/dist/builtin-extensions/pi-subagents/src/api/delegation.js +10 -0
- package/dist/builtin-extensions/pi-subagents/src/api/delegation.js.map +1 -0
- package/dist/builtin-extensions/pi-subagents/src/extension/chain-validation.d.ts +34 -0
- package/dist/builtin-extensions/pi-subagents/src/extension/chain-validation.d.ts.map +1 -0
- package/dist/builtin-extensions/pi-subagents/src/extension/chain-validation.js +125 -0
- package/dist/builtin-extensions/pi-subagents/src/extension/chain-validation.js.map +1 -0
- package/dist/builtin-extensions/pi-subagents/src/extension/config.d.ts +6 -0
- package/dist/builtin-extensions/pi-subagents/src/extension/config.d.ts.map +1 -0
- package/dist/builtin-extensions/pi-subagents/src/extension/config.js +37 -0
- package/dist/builtin-extensions/pi-subagents/src/extension/config.js.map +1 -0
- package/dist/builtin-extensions/pi-subagents/src/extension/control-notices.d.ts +21 -0
- package/dist/builtin-extensions/pi-subagents/src/extension/control-notices.d.ts.map +1 -0
- package/dist/builtin-extensions/pi-subagents/src/extension/control-notices.js +70 -0
- package/dist/builtin-extensions/pi-subagents/src/extension/control-notices.js.map +1 -0
- package/dist/builtin-extensions/pi-subagents/src/extension/doctor.d.ts +33 -0
- package/dist/builtin-extensions/pi-subagents/src/extension/doctor.d.ts.map +1 -0
- package/dist/builtin-extensions/pi-subagents/src/extension/doctor.js +174 -0
- package/dist/builtin-extensions/pi-subagents/src/extension/doctor.js.map +1 -0
- package/dist/builtin-extensions/pi-subagents/src/extension/fanout-child.d.ts +3 -0
- package/dist/builtin-extensions/pi-subagents/src/extension/fanout-child.d.ts.map +1 -0
- package/dist/builtin-extensions/pi-subagents/src/extension/fanout-child.js +175 -0
- package/dist/builtin-extensions/pi-subagents/src/extension/fanout-child.js.map +1 -0
- package/dist/builtin-extensions/pi-subagents/src/extension/index.d.ts +17 -0
- package/dist/builtin-extensions/pi-subagents/src/extension/index.d.ts.map +1 -0
- package/dist/builtin-extensions/pi-subagents/src/extension/index.js +577 -0
- package/dist/builtin-extensions/pi-subagents/src/extension/index.js.map +1 -0
- package/dist/builtin-extensions/pi-subagents/src/extension/rpc.d.ts +57 -0
- package/dist/builtin-extensions/pi-subagents/src/extension/rpc.d.ts.map +1 -0
- package/dist/builtin-extensions/pi-subagents/src/extension/rpc.js +291 -0
- package/dist/builtin-extensions/pi-subagents/src/extension/rpc.js.map +1 -0
- package/dist/builtin-extensions/pi-subagents/src/extension/schemas.d.ts +225 -0
- package/dist/builtin-extensions/pi-subagents/src/extension/schemas.d.ts.map +1 -0
- package/dist/builtin-extensions/pi-subagents/src/extension/schemas.js +301 -0
- package/dist/builtin-extensions/pi-subagents/src/extension/schemas.js.map +1 -0
- package/dist/builtin-extensions/pi-subagents/src/extension/steering-notices.d.ts +15 -0
- package/dist/builtin-extensions/pi-subagents/src/extension/steering-notices.d.ts.map +1 -0
- package/dist/builtin-extensions/pi-subagents/src/extension/steering-notices.js +23 -0
- package/dist/builtin-extensions/pi-subagents/src/extension/steering-notices.js.map +1 -0
- package/dist/builtin-extensions/pi-subagents/src/extension/tool-description.d.ts +12 -0
- package/dist/builtin-extensions/pi-subagents/src/extension/tool-description.d.ts.map +1 -0
- package/dist/builtin-extensions/pi-subagents/src/extension/tool-description.js +225 -0
- package/dist/builtin-extensions/pi-subagents/src/extension/tool-description.js.map +1 -0
- package/dist/builtin-extensions/pi-subagents/src/intercom/intercom-bridge.d.ts +35 -0
- package/dist/builtin-extensions/pi-subagents/src/intercom/intercom-bridge.d.ts.map +1 -0
- package/dist/builtin-extensions/pi-subagents/src/intercom/intercom-bridge.js +144 -0
- package/dist/builtin-extensions/pi-subagents/src/intercom/intercom-bridge.js.map +1 -0
- package/dist/builtin-extensions/pi-subagents/src/intercom/native-supervisor-channel.d.ts +36 -0
- package/dist/builtin-extensions/pi-subagents/src/intercom/native-supervisor-channel.d.ts.map +1 -0
- package/dist/builtin-extensions/pi-subagents/src/intercom/native-supervisor-channel.js +626 -0
- package/dist/builtin-extensions/pi-subagents/src/intercom/native-supervisor-channel.js.map +1 -0
- package/dist/builtin-extensions/pi-subagents/src/intercom/result-intercom.d.ts +31 -0
- package/dist/builtin-extensions/pi-subagents/src/intercom/result-intercom.d.ts.map +1 -0
- package/dist/builtin-extensions/pi-subagents/src/intercom/result-intercom.js +331 -0
- package/dist/builtin-extensions/pi-subagents/src/intercom/result-intercom.js.map +1 -0
- package/dist/builtin-extensions/pi-subagents/src/profiles/profiles.d.ts +131 -0
- package/dist/builtin-extensions/pi-subagents/src/profiles/profiles.d.ts.map +1 -0
- package/dist/builtin-extensions/pi-subagents/src/profiles/profiles.js +491 -0
- package/dist/builtin-extensions/pi-subagents/src/profiles/profiles.js.map +1 -0
- package/dist/builtin-extensions/pi-subagents/src/runs/background/async-execution.d.ts +169 -0
- package/dist/builtin-extensions/pi-subagents/src/runs/background/async-execution.d.ts.map +1 -0
- package/dist/builtin-extensions/pi-subagents/src/runs/background/async-execution.js +1065 -0
- package/dist/builtin-extensions/pi-subagents/src/runs/background/async-execution.js.map +1 -0
- package/dist/builtin-extensions/pi-subagents/src/runs/background/async-job-tracker.d.ts +20 -0
- package/dist/builtin-extensions/pi-subagents/src/runs/background/async-job-tracker.d.ts.map +1 -0
- package/dist/builtin-extensions/pi-subagents/src/runs/background/async-job-tracker.js +500 -0
- package/dist/builtin-extensions/pi-subagents/src/runs/background/async-job-tracker.js.map +1 -0
- package/dist/builtin-extensions/pi-subagents/src/runs/background/async-resume.d.ts +64 -0
- package/dist/builtin-extensions/pi-subagents/src/runs/background/async-resume.d.ts.map +1 -0
- package/dist/builtin-extensions/pi-subagents/src/runs/background/async-resume.js +525 -0
- package/dist/builtin-extensions/pi-subagents/src/runs/background/async-resume.js.map +1 -0
- package/dist/builtin-extensions/pi-subagents/src/runs/background/async-status.d.ts +96 -0
- package/dist/builtin-extensions/pi-subagents/src/runs/background/async-status.d.ts.map +1 -0
- package/dist/builtin-extensions/pi-subagents/src/runs/background/async-status.js +336 -0
- package/dist/builtin-extensions/pi-subagents/src/runs/background/async-status.js.map +1 -0
- package/dist/builtin-extensions/pi-subagents/src/runs/background/auto-drain.d.ts +15 -0
- package/dist/builtin-extensions/pi-subagents/src/runs/background/auto-drain.d.ts.map +1 -0
- package/dist/builtin-extensions/pi-subagents/src/runs/background/auto-drain.js +47 -0
- package/dist/builtin-extensions/pi-subagents/src/runs/background/auto-drain.js.map +1 -0
- package/dist/builtin-extensions/pi-subagents/src/runs/background/chain-append.d.ts +31 -0
- package/dist/builtin-extensions/pi-subagents/src/runs/background/chain-append.d.ts.map +1 -0
- package/dist/builtin-extensions/pi-subagents/src/runs/background/chain-append.js +260 -0
- package/dist/builtin-extensions/pi-subagents/src/runs/background/chain-append.js.map +1 -0
- package/dist/builtin-extensions/pi-subagents/src/runs/background/chain-root-attachment.d.ts +35 -0
- package/dist/builtin-extensions/pi-subagents/src/runs/background/chain-root-attachment.d.ts.map +1 -0
- package/dist/builtin-extensions/pi-subagents/src/runs/background/chain-root-attachment.js +146 -0
- package/dist/builtin-extensions/pi-subagents/src/runs/background/chain-root-attachment.js.map +1 -0
- package/dist/builtin-extensions/pi-subagents/src/runs/background/completion-batcher.d.ts +52 -0
- package/dist/builtin-extensions/pi-subagents/src/runs/background/completion-batcher.d.ts.map +1 -0
- package/dist/builtin-extensions/pi-subagents/src/runs/background/completion-batcher.js +119 -0
- package/dist/builtin-extensions/pi-subagents/src/runs/background/completion-batcher.js.map +1 -0
- package/dist/builtin-extensions/pi-subagents/src/runs/background/completion-dedupe.d.ts +14 -0
- package/dist/builtin-extensions/pi-subagents/src/runs/background/completion-dedupe.d.ts.map +1 -0
- package/dist/builtin-extensions/pi-subagents/src/runs/background/completion-dedupe.js +55 -0
- package/dist/builtin-extensions/pi-subagents/src/runs/background/completion-dedupe.js.map +1 -0
- package/dist/builtin-extensions/pi-subagents/src/runs/background/control-channel.d.ts +182 -0
- package/dist/builtin-extensions/pi-subagents/src/runs/background/control-channel.d.ts.map +1 -0
- package/dist/builtin-extensions/pi-subagents/src/runs/background/control-channel.js +487 -0
- package/dist/builtin-extensions/pi-subagents/src/runs/background/control-channel.js.map +1 -0
- package/dist/builtin-extensions/pi-subagents/src/runs/background/fleet-view.d.ts +43 -0
- package/dist/builtin-extensions/pi-subagents/src/runs/background/fleet-view.d.ts.map +1 -0
- package/dist/builtin-extensions/pi-subagents/src/runs/background/fleet-view.js +518 -0
- package/dist/builtin-extensions/pi-subagents/src/runs/background/fleet-view.js.map +1 -0
- package/dist/builtin-extensions/pi-subagents/src/runs/background/notify.d.ts +63 -0
- package/dist/builtin-extensions/pi-subagents/src/runs/background/notify.d.ts.map +1 -0
- package/dist/builtin-extensions/pi-subagents/src/runs/background/notify.js +202 -0
- package/dist/builtin-extensions/pi-subagents/src/runs/background/notify.js.map +1 -0
- package/dist/builtin-extensions/pi-subagents/src/runs/background/parallel-groups.d.ts +4 -0
- package/dist/builtin-extensions/pi-subagents/src/runs/background/parallel-groups.d.ts.map +1 -0
- package/dist/builtin-extensions/pi-subagents/src/runs/background/parallel-groups.js +47 -0
- package/dist/builtin-extensions/pi-subagents/src/runs/background/parallel-groups.js.map +1 -0
- package/dist/builtin-extensions/pi-subagents/src/runs/background/result-watcher.d.ts +22 -0
- package/dist/builtin-extensions/pi-subagents/src/runs/background/result-watcher.d.ts.map +1 -0
- package/dist/builtin-extensions/pi-subagents/src/runs/background/result-watcher.js +247 -0
- package/dist/builtin-extensions/pi-subagents/src/runs/background/result-watcher.js.map +1 -0
- package/dist/builtin-extensions/pi-subagents/src/runs/background/run-id-resolver.d.ts +23 -0
- package/dist/builtin-extensions/pi-subagents/src/runs/background/run-id-resolver.d.ts.map +1 -0
- package/dist/builtin-extensions/pi-subagents/src/runs/background/run-id-resolver.js +91 -0
- package/dist/builtin-extensions/pi-subagents/src/runs/background/run-id-resolver.js.map +1 -0
- package/dist/builtin-extensions/pi-subagents/src/runs/background/run-status.d.ts +24 -0
- package/dist/builtin-extensions/pi-subagents/src/runs/background/run-status.d.ts.map +1 -0
- package/dist/builtin-extensions/pi-subagents/src/runs/background/run-status.js +453 -0
- package/dist/builtin-extensions/pi-subagents/src/runs/background/run-status.js.map +1 -0
- package/dist/builtin-extensions/pi-subagents/src/runs/background/scheduled-runs.d.ts +48 -0
- package/dist/builtin-extensions/pi-subagents/src/runs/background/scheduled-runs.d.ts.map +1 -0
- package/dist/builtin-extensions/pi-subagents/src/runs/background/scheduled-runs.js +473 -0
- package/dist/builtin-extensions/pi-subagents/src/runs/background/scheduled-runs.js.map +1 -0
- package/dist/builtin-extensions/pi-subagents/src/runs/background/stale-run-reconciler.d.ts +34 -0
- package/dist/builtin-extensions/pi-subagents/src/runs/background/stale-run-reconciler.d.ts.map +1 -0
- package/dist/builtin-extensions/pi-subagents/src/runs/background/stale-run-reconciler.js +351 -0
- package/dist/builtin-extensions/pi-subagents/src/runs/background/stale-run-reconciler.js.map +1 -0
- package/dist/builtin-extensions/pi-subagents/src/runs/background/steering.d.ts +44 -0
- package/dist/builtin-extensions/pi-subagents/src/runs/background/steering.d.ts.map +1 -0
- package/dist/builtin-extensions/pi-subagents/src/runs/background/steering.js +228 -0
- package/dist/builtin-extensions/pi-subagents/src/runs/background/steering.js.map +1 -0
- package/dist/builtin-extensions/pi-subagents/src/runs/background/subagent-runner.d.ts +2 -0
- package/dist/builtin-extensions/pi-subagents/src/runs/background/subagent-runner.d.ts.map +1 -0
- package/dist/builtin-extensions/pi-subagents/src/runs/background/subagent-runner.js +3513 -0
- package/dist/builtin-extensions/pi-subagents/src/runs/background/subagent-runner.js.map +1 -0
- package/dist/builtin-extensions/pi-subagents/src/runs/background/subagent-wait.d.ts +95 -0
- package/dist/builtin-extensions/pi-subagents/src/runs/background/subagent-wait.d.ts.map +1 -0
- package/dist/builtin-extensions/pi-subagents/src/runs/background/subagent-wait.js +387 -0
- package/dist/builtin-extensions/pi-subagents/src/runs/background/subagent-wait.js.map +1 -0
- package/dist/builtin-extensions/pi-subagents/src/runs/background/top-level-async.d.ts +8 -0
- package/dist/builtin-extensions/pi-subagents/src/runs/background/top-level-async.d.ts.map +1 -0
- package/dist/builtin-extensions/pi-subagents/src/runs/background/top-level-async.js +6 -0
- package/dist/builtin-extensions/pi-subagents/src/runs/background/top-level-async.js.map +1 -0
- package/dist/builtin-extensions/pi-subagents/src/runs/background/wait-config.d.ts +7 -0
- package/dist/builtin-extensions/pi-subagents/src/runs/background/wait-config.d.ts.map +1 -0
- package/dist/builtin-extensions/pi-subagents/src/runs/background/wait-config.js +34 -0
- package/dist/builtin-extensions/pi-subagents/src/runs/background/wait-config.js.map +1 -0
- package/dist/builtin-extensions/pi-subagents/src/runs/background/wait-tool.d.ts +4 -0
- package/dist/builtin-extensions/pi-subagents/src/runs/background/wait-tool.d.ts.map +1 -0
- package/dist/builtin-extensions/pi-subagents/src/runs/background/wait-tool.js +24 -0
- package/dist/builtin-extensions/pi-subagents/src/runs/background/wait-tool.js.map +1 -0
- package/dist/builtin-extensions/pi-subagents/src/runs/foreground/async-steering-action.d.ts +23 -0
- package/dist/builtin-extensions/pi-subagents/src/runs/foreground/async-steering-action.d.ts.map +1 -0
- package/dist/builtin-extensions/pi-subagents/src/runs/foreground/async-steering-action.js +230 -0
- package/dist/builtin-extensions/pi-subagents/src/runs/foreground/async-steering-action.js.map +1 -0
- package/dist/builtin-extensions/pi-subagents/src/runs/foreground/chain-clarify.d.ts +127 -0
- package/dist/builtin-extensions/pi-subagents/src/runs/foreground/chain-clarify.d.ts.map +1 -0
- package/dist/builtin-extensions/pi-subagents/src/runs/foreground/chain-clarify.js +1161 -0
- package/dist/builtin-extensions/pi-subagents/src/runs/foreground/chain-clarify.js.map +1 -0
- package/dist/builtin-extensions/pi-subagents/src/runs/foreground/chain-execution.d.ts +81 -0
- package/dist/builtin-extensions/pi-subagents/src/runs/foreground/chain-execution.d.ts.map +1 -0
- package/dist/builtin-extensions/pi-subagents/src/runs/foreground/chain-execution.js +1014 -0
- package/dist/builtin-extensions/pi-subagents/src/runs/foreground/chain-execution.js.map +1 -0
- package/dist/builtin-extensions/pi-subagents/src/runs/foreground/execution.d.ts +10 -0
- package/dist/builtin-extensions/pi-subagents/src/runs/foreground/execution.d.ts.map +1 -0
- package/dist/builtin-extensions/pi-subagents/src/runs/foreground/execution.js +1374 -0
- package/dist/builtin-extensions/pi-subagents/src/runs/foreground/execution.js.map +1 -0
- package/dist/builtin-extensions/pi-subagents/src/runs/foreground/subagent-executor.d.ts +87 -0
- package/dist/builtin-extensions/pi-subagents/src/runs/foreground/subagent-executor.d.ts.map +1 -0
- package/dist/builtin-extensions/pi-subagents/src/runs/foreground/subagent-executor.js +3358 -0
- package/dist/builtin-extensions/pi-subagents/src/runs/foreground/subagent-executor.js.map +1 -0
- package/dist/builtin-extensions/pi-subagents/src/runs/shared/acceptance.d.ts +64 -0
- package/dist/builtin-extensions/pi-subagents/src/runs/shared/acceptance.d.ts.map +1 -0
- package/dist/builtin-extensions/pi-subagents/src/runs/shared/acceptance.js +1122 -0
- package/dist/builtin-extensions/pi-subagents/src/runs/shared/acceptance.js.map +1 -0
- package/dist/builtin-extensions/pi-subagents/src/runs/shared/chain-outputs.d.ts +19 -0
- package/dist/builtin-extensions/pi-subagents/src/runs/shared/chain-outputs.d.ts.map +1 -0
- package/dist/builtin-extensions/pi-subagents/src/runs/shared/chain-outputs.js +106 -0
- package/dist/builtin-extensions/pi-subagents/src/runs/shared/chain-outputs.js.map +1 -0
- package/dist/builtin-extensions/pi-subagents/src/runs/shared/child-protocol.d.ts +27 -0
- package/dist/builtin-extensions/pi-subagents/src/runs/shared/child-protocol.d.ts.map +1 -0
- package/dist/builtin-extensions/pi-subagents/src/runs/shared/child-protocol.js +108 -0
- package/dist/builtin-extensions/pi-subagents/src/runs/shared/child-protocol.js.map +1 -0
- package/dist/builtin-extensions/pi-subagents/src/runs/shared/completion-guard.d.ts +19 -0
- package/dist/builtin-extensions/pi-subagents/src/runs/shared/completion-guard.d.ts.map +1 -0
- package/dist/builtin-extensions/pi-subagents/src/runs/shared/completion-guard.js +51 -0
- package/dist/builtin-extensions/pi-subagents/src/runs/shared/completion-guard.js.map +1 -0
- package/dist/builtin-extensions/pi-subagents/src/runs/shared/dynamic-fanout.d.ts +49 -0
- package/dist/builtin-extensions/pi-subagents/src/runs/shared/dynamic-fanout.d.ts.map +1 -0
- package/dist/builtin-extensions/pi-subagents/src/runs/shared/dynamic-fanout.js +274 -0
- package/dist/builtin-extensions/pi-subagents/src/runs/shared/dynamic-fanout.js.map +1 -0
- package/dist/builtin-extensions/pi-subagents/src/runs/shared/long-running-guard.d.ts +33 -0
- package/dist/builtin-extensions/pi-subagents/src/runs/shared/long-running-guard.d.ts.map +1 -0
- package/dist/builtin-extensions/pi-subagents/src/runs/shared/long-running-guard.js +152 -0
- package/dist/builtin-extensions/pi-subagents/src/runs/shared/long-running-guard.js.map +1 -0
- package/dist/builtin-extensions/pi-subagents/src/runs/shared/mcp-direct-tool-allowlist.d.ts +18 -0
- package/dist/builtin-extensions/pi-subagents/src/runs/shared/mcp-direct-tool-allowlist.d.ts.map +1 -0
- package/dist/builtin-extensions/pi-subagents/src/runs/shared/mcp-direct-tool-allowlist.js +326 -0
- package/dist/builtin-extensions/pi-subagents/src/runs/shared/mcp-direct-tool-allowlist.js.map +1 -0
- package/dist/builtin-extensions/pi-subagents/src/runs/shared/model-fallback.d.ts +83 -0
- package/dist/builtin-extensions/pi-subagents/src/runs/shared/model-fallback.d.ts.map +1 -0
- package/dist/builtin-extensions/pi-subagents/src/runs/shared/model-fallback.js +291 -0
- package/dist/builtin-extensions/pi-subagents/src/runs/shared/model-fallback.js.map +1 -0
- package/dist/builtin-extensions/pi-subagents/src/runs/shared/model-scope.d.ts +49 -0
- package/dist/builtin-extensions/pi-subagents/src/runs/shared/model-scope.d.ts.map +1 -0
- package/dist/builtin-extensions/pi-subagents/src/runs/shared/model-scope.js +98 -0
- package/dist/builtin-extensions/pi-subagents/src/runs/shared/model-scope.js.map +1 -0
- package/dist/builtin-extensions/pi-subagents/src/runs/shared/nested-events.d.ts +121 -0
- package/dist/builtin-extensions/pi-subagents/src/runs/shared/nested-events.d.ts.map +1 -0
- package/dist/builtin-extensions/pi-subagents/src/runs/shared/nested-events.js +881 -0
- package/dist/builtin-extensions/pi-subagents/src/runs/shared/nested-events.js.map +1 -0
- package/dist/builtin-extensions/pi-subagents/src/runs/shared/nested-path.d.ts +11 -0
- package/dist/builtin-extensions/pi-subagents/src/runs/shared/nested-path.d.ts.map +1 -0
- package/dist/builtin-extensions/pi-subagents/src/runs/shared/nested-path.js +50 -0
- package/dist/builtin-extensions/pi-subagents/src/runs/shared/nested-path.js.map +1 -0
- package/dist/builtin-extensions/pi-subagents/src/runs/shared/nested-render.d.ts +19 -0
- package/dist/builtin-extensions/pi-subagents/src/runs/shared/nested-render.d.ts.map +1 -0
- package/dist/builtin-extensions/pi-subagents/src/runs/shared/nested-render.js +109 -0
- package/dist/builtin-extensions/pi-subagents/src/runs/shared/nested-render.js.map +1 -0
- package/dist/builtin-extensions/pi-subagents/src/runs/shared/parallel-utils.d.ts +101 -0
- package/dist/builtin-extensions/pi-subagents/src/runs/shared/parallel-utils.d.ts.map +1 -0
- package/dist/builtin-extensions/pi-subagents/src/runs/shared/parallel-utils.js +112 -0
- package/dist/builtin-extensions/pi-subagents/src/runs/shared/parallel-utils.js.map +1 -0
- package/dist/builtin-extensions/pi-subagents/src/runs/shared/pi-args.d.ts +80 -0
- package/dist/builtin-extensions/pi-subagents/src/runs/shared/pi-args.d.ts.map +1 -0
- package/dist/builtin-extensions/pi-subagents/src/runs/shared/pi-args.js +252 -0
- package/dist/builtin-extensions/pi-subagents/src/runs/shared/pi-args.js.map +1 -0
- package/dist/builtin-extensions/pi-subagents/src/runs/shared/pi-spawn.d.ts +25 -0
- package/dist/builtin-extensions/pi-subagents/src/runs/shared/pi-spawn.d.ts.map +1 -0
- package/dist/builtin-extensions/pi-subagents/src/runs/shared/pi-spawn.js +111 -0
- package/dist/builtin-extensions/pi-subagents/src/runs/shared/pi-spawn.js.map +1 -0
- package/dist/builtin-extensions/pi-subagents/src/runs/shared/run-history.d.ts +11 -0
- package/dist/builtin-extensions/pi-subagents/src/runs/shared/run-history.d.ts.map +1 -0
- package/dist/builtin-extensions/pi-subagents/src/runs/shared/run-history.js +57 -0
- package/dist/builtin-extensions/pi-subagents/src/runs/shared/run-history.js.map +1 -0
- package/dist/builtin-extensions/pi-subagents/src/runs/shared/session-lease.d.ts +54 -0
- package/dist/builtin-extensions/pi-subagents/src/runs/shared/session-lease.d.ts.map +1 -0
- package/dist/builtin-extensions/pi-subagents/src/runs/shared/session-lease.js +244 -0
- package/dist/builtin-extensions/pi-subagents/src/runs/shared/session-lease.js.map +1 -0
- package/dist/builtin-extensions/pi-subagents/src/runs/shared/single-output.d.ts +50 -0
- package/dist/builtin-extensions/pi-subagents/src/runs/shared/single-output.d.ts.map +1 -0
- package/dist/builtin-extensions/pi-subagents/src/runs/shared/single-output.js +202 -0
- package/dist/builtin-extensions/pi-subagents/src/runs/shared/single-output.js.map +1 -0
- package/dist/builtin-extensions/pi-subagents/src/runs/shared/structured-output.d.ts +22 -0
- package/dist/builtin-extensions/pi-subagents/src/runs/shared/structured-output.d.ts.map +1 -0
- package/dist/builtin-extensions/pi-subagents/src/runs/shared/structured-output.js +67 -0
- package/dist/builtin-extensions/pi-subagents/src/runs/shared/structured-output.js.map +1 -0
- package/dist/builtin-extensions/pi-subagents/src/runs/shared/subagent-control.d.ts +35 -0
- package/dist/builtin-extensions/pi-subagents/src/runs/shared/subagent-control.d.ts.map +1 -0
- package/dist/builtin-extensions/pi-subagents/src/runs/shared/subagent-control.js +187 -0
- package/dist/builtin-extensions/pi-subagents/src/runs/shared/subagent-control.js.map +1 -0
- package/dist/builtin-extensions/pi-subagents/src/runs/shared/subagent-prompt-runtime.d.ts +22 -0
- package/dist/builtin-extensions/pi-subagents/src/runs/shared/subagent-prompt-runtime.d.ts.map +1 -0
- package/dist/builtin-extensions/pi-subagents/src/runs/shared/subagent-prompt-runtime.js +438 -0
- package/dist/builtin-extensions/pi-subagents/src/runs/shared/subagent-prompt-runtime.js.map +1 -0
- package/dist/builtin-extensions/pi-subagents/src/runs/shared/task-intent.d.ts +35 -0
- package/dist/builtin-extensions/pi-subagents/src/runs/shared/task-intent.d.ts.map +1 -0
- package/dist/builtin-extensions/pi-subagents/src/runs/shared/task-intent.js +154 -0
- package/dist/builtin-extensions/pi-subagents/src/runs/shared/task-intent.js.map +1 -0
- package/dist/builtin-extensions/pi-subagents/src/runs/shared/tool-availability.d.ts +13 -0
- package/dist/builtin-extensions/pi-subagents/src/runs/shared/tool-availability.d.ts.map +1 -0
- package/dist/builtin-extensions/pi-subagents/src/runs/shared/tool-availability.js +51 -0
- package/dist/builtin-extensions/pi-subagents/src/runs/shared/tool-availability.js.map +1 -0
- package/dist/builtin-extensions/pi-subagents/src/runs/shared/tool-budget.d.ts +16 -0
- package/dist/builtin-extensions/pi-subagents/src/runs/shared/tool-budget.d.ts.map +1 -0
- package/dist/builtin-extensions/pi-subagents/src/runs/shared/tool-budget.js +74 -0
- package/dist/builtin-extensions/pi-subagents/src/runs/shared/tool-budget.js.map +1 -0
- package/dist/builtin-extensions/pi-subagents/src/runs/shared/turn-budget.d.ts +14 -0
- package/dist/builtin-extensions/pi-subagents/src/runs/shared/turn-budget.d.ts.map +1 -0
- package/dist/builtin-extensions/pi-subagents/src/runs/shared/turn-budget.js +66 -0
- package/dist/builtin-extensions/pi-subagents/src/runs/shared/turn-budget.js.map +1 -0
- package/dist/builtin-extensions/pi-subagents/src/runs/shared/workflow-graph.d.ts +30 -0
- package/dist/builtin-extensions/pi-subagents/src/runs/shared/workflow-graph.d.ts.map +1 -0
- package/dist/builtin-extensions/pi-subagents/src/runs/shared/workflow-graph.js +200 -0
- package/dist/builtin-extensions/pi-subagents/src/runs/shared/workflow-graph.js.map +1 -0
- package/dist/builtin-extensions/pi-subagents/src/runs/shared/worktree.d.ts +49 -0
- package/dist/builtin-extensions/pi-subagents/src/runs/shared/worktree.d.ts.map +1 -0
- package/dist/builtin-extensions/pi-subagents/src/runs/shared/worktree.js +473 -0
- package/dist/builtin-extensions/pi-subagents/src/runs/shared/worktree.js.map +1 -0
- package/dist/builtin-extensions/pi-subagents/src/shared/artifacts.d.ts +13 -0
- package/dist/builtin-extensions/pi-subagents/src/shared/artifacts.d.ts.map +1 -0
- package/dist/builtin-extensions/pi-subagents/src/shared/artifacts.js +104 -0
- package/dist/builtin-extensions/pi-subagents/src/shared/artifacts.js.map +1 -0
- package/dist/builtin-extensions/pi-subagents/src/shared/atomic-json.d.ts +17 -0
- package/dist/builtin-extensions/pi-subagents/src/shared/atomic-json.d.ts.map +1 -0
- package/dist/builtin-extensions/pi-subagents/src/shared/atomic-json.js +68 -0
- package/dist/builtin-extensions/pi-subagents/src/shared/atomic-json.js.map +1 -0
- package/dist/builtin-extensions/pi-subagents/src/shared/child-transcript.d.ts +36 -0
- package/dist/builtin-extensions/pi-subagents/src/shared/child-transcript.d.ts.map +1 -0
- package/dist/builtin-extensions/pi-subagents/src/shared/child-transcript.js +173 -0
- package/dist/builtin-extensions/pi-subagents/src/shared/child-transcript.js.map +1 -0
- package/dist/builtin-extensions/pi-subagents/src/shared/file-coalescer.d.ts +11 -0
- package/dist/builtin-extensions/pi-subagents/src/shared/file-coalescer.d.ts.map +1 -0
- package/dist/builtin-extensions/pi-subagents/src/shared/file-coalescer.js +26 -0
- package/dist/builtin-extensions/pi-subagents/src/shared/file-coalescer.js.map +1 -0
- package/dist/builtin-extensions/pi-subagents/src/shared/fork-context.d.ts +44 -0
- package/dist/builtin-extensions/pi-subagents/src/shared/fork-context.d.ts.map +1 -0
- package/dist/builtin-extensions/pi-subagents/src/shared/fork-context.js +158 -0
- package/dist/builtin-extensions/pi-subagents/src/shared/fork-context.js.map +1 -0
- package/dist/builtin-extensions/pi-subagents/src/shared/formatters.d.ts +34 -0
- package/dist/builtin-extensions/pi-subagents/src/shared/formatters.d.ts.map +1 -0
- package/dist/builtin-extensions/pi-subagents/src/shared/formatters.js +128 -0
- package/dist/builtin-extensions/pi-subagents/src/shared/formatters.js.map +1 -0
- package/dist/builtin-extensions/pi-subagents/src/shared/jsonl-writer.d.ts +20 -0
- package/dist/builtin-extensions/pi-subagents/src/shared/jsonl-writer.d.ts.map +1 -0
- package/dist/builtin-extensions/pi-subagents/src/shared/jsonl-writer.js +59 -0
- package/dist/builtin-extensions/pi-subagents/src/shared/jsonl-writer.js.map +1 -0
- package/dist/builtin-extensions/pi-subagents/src/shared/model-info.d.ts +31 -0
- package/dist/builtin-extensions/pi-subagents/src/shared/model-info.d.ts.map +1 -0
- package/dist/builtin-extensions/pi-subagents/src/shared/model-info.js +68 -0
- package/dist/builtin-extensions/pi-subagents/src/shared/model-info.js.map +1 -0
- package/dist/builtin-extensions/pi-subagents/src/shared/post-exit-stdio-guard.d.ts +17 -0
- package/dist/builtin-extensions/pi-subagents/src/shared/post-exit-stdio-guard.d.ts.map +1 -0
- package/dist/builtin-extensions/pi-subagents/src/shared/post-exit-stdio-guard.js +72 -0
- package/dist/builtin-extensions/pi-subagents/src/shared/post-exit-stdio-guard.js.map +1 -0
- package/dist/builtin-extensions/pi-subagents/src/shared/session-identity.d.ts +7 -0
- package/dist/builtin-extensions/pi-subagents/src/shared/session-identity.d.ts.map +1 -0
- package/dist/builtin-extensions/pi-subagents/src/shared/session-identity.js +7 -0
- package/dist/builtin-extensions/pi-subagents/src/shared/session-identity.js.map +1 -0
- package/dist/builtin-extensions/pi-subagents/src/shared/session-tokens.d.ts +3 -0
- package/dist/builtin-extensions/pi-subagents/src/shared/session-tokens.d.ts.map +1 -0
- package/dist/builtin-extensions/pi-subagents/src/shared/session-tokens.js +49 -0
- package/dist/builtin-extensions/pi-subagents/src/shared/session-tokens.js.map +1 -0
- package/dist/builtin-extensions/pi-subagents/src/shared/settings.d.ts +136 -0
- package/dist/builtin-extensions/pi-subagents/src/shared/settings.d.ts.map +1 -0
- package/dist/builtin-extensions/pi-subagents/src/shared/settings.js +285 -0
- package/dist/builtin-extensions/pi-subagents/src/shared/settings.js.map +1 -0
- package/dist/builtin-extensions/pi-subagents/src/shared/status-format.d.ts +10 -0
- package/dist/builtin-extensions/pi-subagents/src/shared/status-format.d.ts.map +1 -0
- package/dist/builtin-extensions/pi-subagents/src/shared/status-format.js +61 -0
- package/dist/builtin-extensions/pi-subagents/src/shared/status-format.js.map +1 -0
- package/dist/builtin-extensions/pi-subagents/src/shared/types.d.ts +1101 -0
- package/dist/builtin-extensions/pi-subagents/src/shared/types.d.ts.map +1 -0
- package/dist/builtin-extensions/pi-subagents/src/shared/types.js +221 -0
- package/dist/builtin-extensions/pi-subagents/src/shared/types.js.map +1 -0
- package/dist/builtin-extensions/pi-subagents/src/shared/utils.d.ts +52 -0
- package/dist/builtin-extensions/pi-subagents/src/shared/utils.d.ts.map +1 -0
- package/dist/builtin-extensions/pi-subagents/src/shared/utils.js +562 -0
- package/dist/builtin-extensions/pi-subagents/src/shared/utils.js.map +1 -0
- package/dist/builtin-extensions/pi-subagents/src/slash/delegation-adapters.d.ts +149 -0
- package/dist/builtin-extensions/pi-subagents/src/slash/delegation-adapters.d.ts.map +1 -0
- package/dist/builtin-extensions/pi-subagents/src/slash/delegation-adapters.js +321 -0
- package/dist/builtin-extensions/pi-subagents/src/slash/delegation-adapters.js.map +1 -0
- package/dist/builtin-extensions/pi-subagents/src/slash/delegation-request.d.ts +11 -0
- package/dist/builtin-extensions/pi-subagents/src/slash/delegation-request.d.ts.map +1 -0
- package/dist/builtin-extensions/pi-subagents/src/slash/delegation-request.js +102 -0
- package/dist/builtin-extensions/pi-subagents/src/slash/delegation-request.js.map +1 -0
- package/dist/builtin-extensions/pi-subagents/src/slash/prompt-template-bridge.d.ts +25 -0
- package/dist/builtin-extensions/pi-subagents/src/slash/prompt-template-bridge.d.ts.map +1 -0
- package/dist/builtin-extensions/pi-subagents/src/slash/prompt-template-bridge.js +200 -0
- package/dist/builtin-extensions/pi-subagents/src/slash/prompt-template-bridge.js.map +1 -0
- package/dist/builtin-extensions/pi-subagents/src/slash/prompt-workflows.d.ts +23 -0
- package/dist/builtin-extensions/pi-subagents/src/slash/prompt-workflows.d.ts.map +1 -0
- package/dist/builtin-extensions/pi-subagents/src/slash/prompt-workflows.js +305 -0
- package/dist/builtin-extensions/pi-subagents/src/slash/prompt-workflows.js.map +1 -0
- package/dist/builtin-extensions/pi-subagents/src/slash/slash-bridge.d.ts +31 -0
- package/dist/builtin-extensions/pi-subagents/src/slash/slash-bridge.d.ts.map +1 -0
- package/dist/builtin-extensions/pi-subagents/src/slash/slash-bridge.js +117 -0
- package/dist/builtin-extensions/pi-subagents/src/slash/slash-bridge.js.map +1 -0
- package/dist/builtin-extensions/pi-subagents/src/slash/slash-commands.d.ts +51 -0
- package/dist/builtin-extensions/pi-subagents/src/slash/slash-commands.d.ts.map +1 -0
- package/dist/builtin-extensions/pi-subagents/src/slash/slash-commands.js +1531 -0
- package/dist/builtin-extensions/pi-subagents/src/slash/slash-commands.js.map +1 -0
- package/dist/builtin-extensions/pi-subagents/src/slash/slash-live-state.d.ts +22 -0
- package/dist/builtin-extensions/pi-subagents/src/slash/slash-live-state.d.ts.map +1 -0
- package/dist/builtin-extensions/pi-subagents/src/slash/slash-live-state.js +246 -0
- package/dist/builtin-extensions/pi-subagents/src/slash/slash-live-state.js.map +1 -0
- package/dist/builtin-extensions/pi-subagents/src/tui/fleet.d.ts +78 -0
- package/dist/builtin-extensions/pi-subagents/src/tui/fleet.d.ts.map +1 -0
- package/dist/builtin-extensions/pi-subagents/src/tui/fleet.js +401 -0
- package/dist/builtin-extensions/pi-subagents/src/tui/fleet.js.map +1 -0
- package/dist/builtin-extensions/pi-subagents/src/tui/render-helpers.d.ts +13 -0
- package/dist/builtin-extensions/pi-subagents/src/tui/render-helpers.d.ts.map +1 -0
- package/dist/builtin-extensions/pi-subagents/src/tui/render-helpers.js +74 -0
- package/dist/builtin-extensions/pi-subagents/src/tui/render-helpers.js.map +1 -0
- package/dist/builtin-extensions/pi-subagents/src/tui/render.d.ts +35 -0
- package/dist/builtin-extensions/pi-subagents/src/tui/render.d.ts.map +1 -0
- package/dist/builtin-extensions/pi-subagents/src/tui/render.js +1687 -0
- package/dist/builtin-extensions/pi-subagents/src/tui/render.js.map +1 -0
- package/dist/builtin-extensions/pi-subagents/src/watchdog/change-signature.d.ts +8 -0
- package/dist/builtin-extensions/pi-subagents/src/watchdog/change-signature.d.ts.map +1 -0
- package/dist/builtin-extensions/pi-subagents/src/watchdog/change-signature.js +123 -0
- package/dist/builtin-extensions/pi-subagents/src/watchdog/change-signature.js.map +1 -0
- package/dist/builtin-extensions/pi-subagents/src/watchdog/child-status.d.ts +58 -0
- package/dist/builtin-extensions/pi-subagents/src/watchdog/child-status.d.ts.map +1 -0
- package/dist/builtin-extensions/pi-subagents/src/watchdog/child-status.js +160 -0
- package/dist/builtin-extensions/pi-subagents/src/watchdog/child-status.js.map +1 -0
- package/dist/builtin-extensions/pi-subagents/src/watchdog/emission-guard.d.ts +34 -0
- package/dist/builtin-extensions/pi-subagents/src/watchdog/emission-guard.d.ts.map +1 -0
- package/dist/builtin-extensions/pi-subagents/src/watchdog/emission-guard.js +96 -0
- package/dist/builtin-extensions/pi-subagents/src/watchdog/emission-guard.js.map +1 -0
- package/dist/builtin-extensions/pi-subagents/src/watchdog/lsp-diagnostics.d.ts +18 -0
- package/dist/builtin-extensions/pi-subagents/src/watchdog/lsp-diagnostics.d.ts.map +1 -0
- package/dist/builtin-extensions/pi-subagents/src/watchdog/lsp-diagnostics.js +485 -0
- package/dist/builtin-extensions/pi-subagents/src/watchdog/lsp-diagnostics.js.map +1 -0
- package/dist/builtin-extensions/pi-subagents/src/watchdog/model-selection.d.ts +21 -0
- package/dist/builtin-extensions/pi-subagents/src/watchdog/model-selection.d.ts.map +1 -0
- package/dist/builtin-extensions/pi-subagents/src/watchdog/model-selection.js +151 -0
- package/dist/builtin-extensions/pi-subagents/src/watchdog/model-selection.js.map +1 -0
- package/dist/builtin-extensions/pi-subagents/src/watchdog/register-child.d.ts +4 -0
- package/dist/builtin-extensions/pi-subagents/src/watchdog/register-child.d.ts.map +1 -0
- package/dist/builtin-extensions/pi-subagents/src/watchdog/register-child.js +111 -0
- package/dist/builtin-extensions/pi-subagents/src/watchdog/register-child.js.map +1 -0
- package/dist/builtin-extensions/pi-subagents/src/watchdog/register-main.d.ts +10 -0
- package/dist/builtin-extensions/pi-subagents/src/watchdog/register-main.d.ts.map +1 -0
- package/dist/builtin-extensions/pi-subagents/src/watchdog/register-main.js +407 -0
- package/dist/builtin-extensions/pi-subagents/src/watchdog/register-main.js.map +1 -0
- package/dist/builtin-extensions/pi-subagents/src/watchdog/render.d.ts +12 -0
- package/dist/builtin-extensions/pi-subagents/src/watchdog/render.d.ts.map +1 -0
- package/dist/builtin-extensions/pi-subagents/src/watchdog/render.js +55 -0
- package/dist/builtin-extensions/pi-subagents/src/watchdog/render.js.map +1 -0
- package/dist/builtin-extensions/pi-subagents/src/watchdog/review.d.ts +29 -0
- package/dist/builtin-extensions/pi-subagents/src/watchdog/review.d.ts.map +1 -0
- package/dist/builtin-extensions/pi-subagents/src/watchdog/review.js +245 -0
- package/dist/builtin-extensions/pi-subagents/src/watchdog/review.js.map +1 -0
- package/dist/builtin-extensions/pi-subagents/src/watchdog/runtime.d.ts +141 -0
- package/dist/builtin-extensions/pi-subagents/src/watchdog/runtime.d.ts.map +1 -0
- package/dist/builtin-extensions/pi-subagents/src/watchdog/runtime.js +647 -0
- package/dist/builtin-extensions/pi-subagents/src/watchdog/runtime.js.map +1 -0
- package/dist/builtin-extensions/pi-subagents/src/watchdog/settings.d.ts +30 -0
- package/dist/builtin-extensions/pi-subagents/src/watchdog/settings.d.ts.map +1 -0
- package/dist/builtin-extensions/pi-subagents/src/watchdog/settings.js +486 -0
- package/dist/builtin-extensions/pi-subagents/src/watchdog/settings.js.map +1 -0
- package/dist/builtin-extensions/pi-subagents/src/watchdog/tool-actions.d.ts +18 -0
- package/dist/builtin-extensions/pi-subagents/src/watchdog/tool-actions.d.ts.map +1 -0
- package/dist/builtin-extensions/pi-subagents/src/watchdog/tool-actions.js +150 -0
- package/dist/builtin-extensions/pi-subagents/src/watchdog/tool-actions.js.map +1 -0
- package/dist/builtin-extensions/pi-subagents/src/watchdog/turn-delta.d.ts +10 -0
- package/dist/builtin-extensions/pi-subagents/src/watchdog/turn-delta.d.ts.map +1 -0
- package/dist/builtin-extensions/pi-subagents/src/watchdog/turn-delta.js +159 -0
- package/dist/builtin-extensions/pi-subagents/src/watchdog/turn-delta.js.map +1 -0
- package/dist/builtin-extensions/pi-subagents/src/watchdog/types.d.ts +143 -0
- package/dist/builtin-extensions/pi-subagents/src/watchdog/types.d.ts.map +1 -0
- package/dist/builtin-extensions/pi-subagents/src/watchdog/types.js +31 -0
- package/dist/builtin-extensions/pi-subagents/src/watchdog/types.js.map +1 -0
- package/dist/builtin-extensions/pi-subagents/src/watchdog/warning-format.d.ts +8 -0
- package/dist/builtin-extensions/pi-subagents/src/watchdog/warning-format.d.ts.map +1 -0
- package/dist/builtin-extensions/pi-subagents/src/watchdog/warning-format.js +62 -0
- package/dist/builtin-extensions/pi-subagents/src/watchdog/warning-format.js.map +1 -0
- package/dist/builtin-extensions/pi-tps.d.ts +3 -0
- package/dist/builtin-extensions/pi-tps.d.ts.map +1 -0
- package/dist/builtin-extensions/pi-tps.js +89 -0
- package/dist/builtin-extensions/pi-tps.js.map +1 -0
- package/dist/builtin-extensions/pi-web-access/activity.d.ts +34 -0
- package/dist/builtin-extensions/pi-web-access/activity.d.ts.map +1 -0
- package/dist/builtin-extensions/pi-web-access/activity.js +68 -0
- package/dist/builtin-extensions/pi-web-access/activity.js.map +1 -0
- package/dist/builtin-extensions/pi-web-access/brave.d.ts +4 -0
- package/dist/builtin-extensions/pi-web-access/brave.d.ts.map +1 -0
- package/dist/builtin-extensions/pi-web-access/brave.js +185 -0
- package/dist/builtin-extensions/pi-web-access/brave.js.map +1 -0
- package/dist/builtin-extensions/pi-web-access/chrome-cookies.d.ts +9 -0
- package/dist/builtin-extensions/pi-web-access/chrome-cookies.d.ts.map +1 -0
- package/dist/builtin-extensions/pi-web-access/chrome-cookies.js +299 -0
- package/dist/builtin-extensions/pi-web-access/chrome-cookies.js.map +1 -0
- package/dist/builtin-extensions/pi-web-access/curator-page.d.ts +13 -0
- package/dist/builtin-extensions/pi-web-access/curator-page.d.ts.map +1 -0
- package/dist/builtin-extensions/pi-web-access/curator-page.js +3382 -0
- package/dist/builtin-extensions/pi-web-access/curator-page.js.map +1 -0
- package/dist/builtin-extensions/pi-web-access/curator-server.d.ts +71 -0
- package/dist/builtin-extensions/pi-web-access/curator-server.d.ts.map +1 -0
- package/dist/builtin-extensions/pi-web-access/curator-server.js +604 -0
- package/dist/builtin-extensions/pi-web-access/curator-server.js.map +1 -0
- package/dist/builtin-extensions/pi-web-access/exa.d.ts +10 -0
- package/dist/builtin-extensions/pi-web-access/exa.d.ts.map +1 -0
- package/dist/builtin-extensions/pi-web-access/exa.js +391 -0
- package/dist/builtin-extensions/pi-web-access/exa.js.map +1 -0
- package/dist/builtin-extensions/pi-web-access/extract.d.ts +48 -0
- package/dist/builtin-extensions/pi-web-access/extract.d.ts.map +1 -0
- package/dist/builtin-extensions/pi-web-access/extract.js +619 -0
- package/dist/builtin-extensions/pi-web-access/extract.js.map +1 -0
- package/dist/builtin-extensions/pi-web-access/fetch-params.d.ts +21 -0
- package/dist/builtin-extensions/pi-web-access/fetch-params.d.ts.map +1 -0
- package/dist/builtin-extensions/pi-web-access/fetch-params.js +44 -0
- package/dist/builtin-extensions/pi-web-access/fetch-params.js.map +1 -0
- package/dist/builtin-extensions/pi-web-access/gemini-api.d.ts +18 -0
- package/dist/builtin-extensions/pi-web-access/gemini-api.d.ts.map +1 -0
- package/dist/builtin-extensions/pi-web-access/gemini-api.js +120 -0
- package/dist/builtin-extensions/pi-web-access/gemini-api.js.map +1 -0
- package/dist/builtin-extensions/pi-web-access/gemini-search.d.ts +14 -0
- package/dist/builtin-extensions/pi-web-access/gemini-search.d.ts.map +1 -0
- package/dist/builtin-extensions/pi-web-access/gemini-search.js +371 -0
- package/dist/builtin-extensions/pi-web-access/gemini-search.js.map +1 -0
- package/dist/builtin-extensions/pi-web-access/gemini-url-context.d.ts +4 -0
- package/dist/builtin-extensions/pi-web-access/gemini-url-context.d.ts.map +1 -0
- package/dist/builtin-extensions/pi-web-access/gemini-url-context.js +101 -0
- package/dist/builtin-extensions/pi-web-access/gemini-url-context.js.map +1 -0
- package/dist/builtin-extensions/pi-web-access/gemini-web-config.d.ts +4 -0
- package/dist/builtin-extensions/pi-web-access/gemini-web-config.d.ts.map +1 -0
- package/dist/builtin-extensions/pi-web-access/gemini-web-config.js +43 -0
- package/dist/builtin-extensions/pi-web-access/gemini-web-config.js.map +1 -0
- package/dist/builtin-extensions/pi-web-access/gemini-web.d.ts +12 -0
- package/dist/builtin-extensions/pi-web-access/gemini-web.d.ts.map +1 -0
- package/dist/builtin-extensions/pi-web-access/gemini-web.js +331 -0
- package/dist/builtin-extensions/pi-web-access/gemini-web.js.map +1 -0
- package/dist/builtin-extensions/pi-web-access/github-api.d.ts +7 -0
- package/dist/builtin-extensions/pi-web-access/github-api.d.ts.map +1 -0
- package/dist/builtin-extensions/pi-web-access/github-api.js +161 -0
- package/dist/builtin-extensions/pi-web-access/github-api.js.map +1 -0
- package/dist/builtin-extensions/pi-web-access/github-extract.d.ts +13 -0
- package/dist/builtin-extensions/pi-web-access/github-extract.d.ts.map +1 -0
- package/dist/builtin-extensions/pi-web-access/github-extract.js +558 -0
- package/dist/builtin-extensions/pi-web-access/github-extract.js.map +1 -0
- package/dist/builtin-extensions/pi-web-access/index.d.ts +3 -0
- package/dist/builtin-extensions/pi-web-access/index.d.ts.map +1 -0
- package/dist/builtin-extensions/pi-web-access/index.js +2347 -0
- package/dist/builtin-extensions/pi-web-access/index.js.map +1 -0
- package/dist/builtin-extensions/pi-web-access/openai-search.d.ts +13 -0
- package/dist/builtin-extensions/pi-web-access/openai-search.d.ts.map +1 -0
- package/dist/builtin-extensions/pi-web-access/openai-search.js +374 -0
- package/dist/builtin-extensions/pi-web-access/openai-search.js.map +1 -0
- package/dist/builtin-extensions/pi-web-access/parallel.d.ts +12 -0
- package/dist/builtin-extensions/pi-web-access/parallel.d.ts.map +1 -0
- package/dist/builtin-extensions/pi-web-access/parallel.js +316 -0
- package/dist/builtin-extensions/pi-web-access/parallel.js.map +1 -0
- package/dist/builtin-extensions/pi-web-access/pdf-extract.d.ts +26 -0
- package/dist/builtin-extensions/pi-web-access/pdf-extract.d.ts.map +1 -0
- package/dist/builtin-extensions/pi-web-access/pdf-extract.js +150 -0
- package/dist/builtin-extensions/pi-web-access/pdf-extract.js.map +1 -0
- package/dist/builtin-extensions/pi-web-access/perplexity.d.ts +20 -0
- package/dist/builtin-extensions/pi-web-access/perplexity.d.ts.map +1 -0
- package/dist/builtin-extensions/pi-web-access/perplexity.js +150 -0
- package/dist/builtin-extensions/pi-web-access/perplexity.js.map +1 -0
- package/dist/builtin-extensions/pi-web-access/render-search-error.d.ts +57 -0
- package/dist/builtin-extensions/pi-web-access/render-search-error.d.ts.map +1 -0
- package/dist/builtin-extensions/pi-web-access/render-search-error.js +131 -0
- package/dist/builtin-extensions/pi-web-access/render-search-error.js.map +1 -0
- package/dist/builtin-extensions/pi-web-access/rsc-extract.d.ts +12 -0
- package/dist/builtin-extensions/pi-web-access/rsc-extract.d.ts.map +1 -0
- package/dist/builtin-extensions/pi-web-access/rsc-extract.js +330 -0
- package/dist/builtin-extensions/pi-web-access/rsc-extract.js.map +1 -0
- package/dist/builtin-extensions/pi-web-access/ssrf-protection.d.ts +24 -0
- package/dist/builtin-extensions/pi-web-access/ssrf-protection.d.ts.map +1 -0
- package/dist/builtin-extensions/pi-web-access/ssrf-protection.js +255 -0
- package/dist/builtin-extensions/pi-web-access/ssrf-protection.js.map +1 -0
- package/dist/builtin-extensions/pi-web-access/storage.d.ts +25 -0
- package/dist/builtin-extensions/pi-web-access/storage.d.ts.map +1 -0
- package/dist/builtin-extensions/pi-web-access/storage.js +49 -0
- package/dist/builtin-extensions/pi-web-access/storage.js.map +1 -0
- package/dist/builtin-extensions/pi-web-access/summary-model-scope.d.ts +13 -0
- package/dist/builtin-extensions/pi-web-access/summary-model-scope.d.ts.map +1 -0
- package/dist/builtin-extensions/pi-web-access/summary-model-scope.js +86 -0
- package/dist/builtin-extensions/pi-web-access/summary-model-scope.js.map +1 -0
- package/dist/builtin-extensions/pi-web-access/summary-review.d.ts +21 -0
- package/dist/builtin-extensions/pi-web-access/summary-review.d.ts.map +1 -0
- package/dist/builtin-extensions/pi-web-access/summary-review.js +278 -0
- package/dist/builtin-extensions/pi-web-access/summary-review.js.map +1 -0
- package/dist/builtin-extensions/pi-web-access/tavily.d.ts +8 -0
- package/dist/builtin-extensions/pi-web-access/tavily.d.ts.map +1 -0
- package/dist/builtin-extensions/pi-web-access/tavily.js +184 -0
- package/dist/builtin-extensions/pi-web-access/tavily.js.map +1 -0
- package/dist/builtin-extensions/pi-web-access/utils.d.ts +12 -0
- package/dist/builtin-extensions/pi-web-access/utils.d.ts.map +1 -0
- package/dist/builtin-extensions/pi-web-access/utils.js +61 -0
- package/dist/builtin-extensions/pi-web-access/utils.js.map +1 -0
- package/dist/builtin-extensions/pi-web-access/video-extract.d.ts +14 -0
- package/dist/builtin-extensions/pi-web-access/video-extract.d.ts.map +1 -0
- package/dist/builtin-extensions/pi-web-access/video-extract.js +324 -0
- package/dist/builtin-extensions/pi-web-access/video-extract.js.map +1 -0
- package/dist/builtin-extensions/pi-web-access/youtube-extract.d.ts +27 -0
- package/dist/builtin-extensions/pi-web-access/youtube-extract.d.ts.map +1 -0
- package/dist/builtin-extensions/pi-web-access/youtube-extract.js +282 -0
- package/dist/builtin-extensions/pi-web-access/youtube-extract.js.map +1 -0
- package/dist/builtin-extensions/simple-pi-memory.d.ts +55 -0
- package/dist/builtin-extensions/simple-pi-memory.d.ts.map +1 -0
- package/dist/builtin-extensions/simple-pi-memory.js +239 -0
- package/dist/builtin-extensions/simple-pi-memory.js.map +1 -0
- package/dist/bun/cli.d.ts +3 -0
- package/dist/bun/cli.d.ts.map +1 -0
- package/dist/bun/cli.js +11 -0
- package/dist/bun/cli.js.map +1 -0
- package/dist/bun/register-bedrock.d.ts +2 -0
- package/dist/bun/register-bedrock.d.ts.map +1 -0
- package/dist/bun/register-bedrock.js +4 -0
- package/dist/bun/register-bedrock.js.map +1 -0
- package/dist/bun/restore-sandbox-env.d.ts +17 -0
- package/dist/bun/restore-sandbox-env.d.ts.map +1 -0
- package/dist/bun/restore-sandbox-env.js +36 -0
- package/dist/bun/restore-sandbox-env.js.map +1 -0
- package/dist/catalog/models.json +1 -0
- package/dist/catalog/providers/amazon-bedrock.json +1 -0
- package/dist/catalog/providers/ant-ling.json +1 -0
- package/dist/catalog/providers/anthropic.json +1 -0
- package/dist/catalog/providers/azure-openai-responses.json +1 -0
- package/dist/catalog/providers/cerebras.json +1 -0
- package/dist/catalog/providers/cloudflare-ai-gateway.json +1 -0
- package/dist/catalog/providers/cloudflare-workers-ai.json +1 -0
- package/dist/catalog/providers/deepseek.json +1 -0
- package/dist/catalog/providers/fireworks.json +1 -0
- package/dist/catalog/providers/github-copilot.json +1 -0
- package/dist/catalog/providers/google-vertex.json +1 -0
- package/dist/catalog/providers/google.json +1 -0
- package/dist/catalog/providers/groq.json +1 -0
- package/dist/catalog/providers/huggingface.json +1 -0
- package/dist/catalog/providers/kimi-coding.json +1 -0
- package/dist/catalog/providers/minimax-cn.json +1 -0
- package/dist/catalog/providers/minimax.json +1 -0
- package/dist/catalog/providers/mistral.json +1 -0
- package/dist/catalog/providers/moonshotai-cn.json +1 -0
- package/dist/catalog/providers/moonshotai.json +1 -0
- package/dist/catalog/providers/nvidia.json +1 -0
- package/dist/catalog/providers/openai-codex.json +1 -0
- package/dist/catalog/providers/openai.json +1 -0
- package/dist/catalog/providers/opencode-go.json +1 -0
- package/dist/catalog/providers/opencode.json +1 -0
- package/dist/catalog/providers/openrouter.json +1 -0
- package/dist/catalog/providers/qwen-cloud-cn.json +1 -0
- package/dist/catalog/providers/qwen-cloud.json +1 -0
- package/dist/catalog/providers/qwen-token-plan-cn.json +1 -0
- package/dist/catalog/providers/qwen-token-plan.json +1 -0
- package/dist/catalog/providers/together.json +1 -0
- package/dist/catalog/providers/vercel-ai-gateway.json +1 -0
- package/dist/catalog/providers/xai.json +1 -0
- package/dist/catalog/providers/xiaomi-token-plan-ams.json +1 -0
- package/dist/catalog/providers/xiaomi-token-plan-cn.json +1 -0
- package/dist/catalog/providers/xiaomi-token-plan-sgp.json +1 -0
- package/dist/catalog/providers/xiaomi.json +1 -0
- package/dist/catalog/providers/zai-coding-cn.json +1 -0
- package/dist/catalog/providers/zai.json +1 -0
- package/dist/catalog/providers.json +1 -0
- package/dist/catalog/publication.json +6 -0
- package/dist/cli/args.d.ts +57 -0
- package/dist/cli/args.d.ts.map +1 -0
- package/dist/cli/args.js +381 -0
- package/dist/cli/args.js.map +1 -0
- package/dist/cli/config-selector.d.ts +16 -0
- package/dist/cli/config-selector.d.ts.map +1 -0
- package/dist/cli/config-selector.js +31 -0
- package/dist/cli/config-selector.js.map +1 -0
- package/dist/cli/file-processor.d.ts +15 -0
- package/dist/cli/file-processor.d.ts.map +1 -0
- package/dist/cli/file-processor.js +70 -0
- package/dist/cli/file-processor.js.map +1 -0
- package/dist/cli/initial-message.d.ts +18 -0
- package/dist/cli/initial-message.d.ts.map +1 -0
- package/dist/cli/initial-message.js +22 -0
- package/dist/cli/initial-message.js.map +1 -0
- package/dist/cli/install-cli.d.ts +13 -0
- package/dist/cli/install-cli.d.ts.map +1 -0
- package/dist/cli/install-cli.js +352 -0
- package/dist/cli/install-cli.js.map +1 -0
- package/dist/cli/list-models.d.ts +9 -0
- package/dist/cli/list-models.d.ts.map +1 -0
- package/dist/cli/list-models.js +98 -0
- package/dist/cli/list-models.js.map +1 -0
- package/dist/cli/project-trust.d.ts +10 -0
- package/dist/cli/project-trust.d.ts.map +1 -0
- package/dist/cli/project-trust.js +48 -0
- package/dist/cli/project-trust.js.map +1 -0
- package/dist/cli/read-secret.d.ts +6 -0
- package/dist/cli/read-secret.d.ts.map +1 -0
- package/dist/cli/read-secret.js +62 -0
- package/dist/cli/read-secret.js.map +1 -0
- package/dist/cli/session-picker.d.ts +10 -0
- package/dist/cli/session-picker.d.ts.map +1 -0
- package/dist/cli/session-picker.js +36 -0
- package/dist/cli/session-picker.js.map +1 -0
- package/dist/cli/startup-ui.d.ts +20 -0
- package/dist/cli/startup-ui.d.ts.map +1 -0
- package/dist/cli/startup-ui.js +190 -0
- package/dist/cli/startup-ui.js.map +1 -0
- package/dist/cli.d.ts +3 -0
- package/dist/cli.d.ts.map +1 -0
- package/dist/cli.js +18 -0
- package/dist/cli.js.map +1 -0
- package/dist/config.d.ts +84 -0
- package/dist/config.d.ts.map +1 -0
- package/dist/config.js +211 -0
- package/dist/config.js.map +1 -0
- package/dist/core/agent-session-runtime.d.ts +119 -0
- package/dist/core/agent-session-runtime.d.ts.map +1 -0
- package/dist/core/agent-session-runtime.js +306 -0
- package/dist/core/agent-session-runtime.js.map +1 -0
- package/dist/core/agent-session-services.d.ts +85 -0
- package/dist/core/agent-session-services.d.ts.map +1 -0
- package/dist/core/agent-session-services.js +120 -0
- package/dist/core/agent-session-services.js.map +1 -0
- package/dist/core/agent-session.d.ts +650 -0
- package/dist/core/agent-session.d.ts.map +1 -0
- package/dist/core/agent-session.js +2797 -0
- package/dist/core/agent-session.js.map +1 -0
- package/dist/core/auth-guidance.d.ts +5 -0
- package/dist/core/auth-guidance.d.ts.map +1 -0
- package/dist/core/auth-guidance.js +21 -0
- package/dist/core/auth-guidance.js.map +1 -0
- package/dist/core/auth-storage.d.ts +56 -0
- package/dist/core/auth-storage.d.ts.map +1 -0
- package/dist/core/auth-storage.js +229 -0
- package/dist/core/auth-storage.js.map +1 -0
- package/dist/core/bash-executor.d.ts +32 -0
- package/dist/core/bash-executor.d.ts.map +1 -0
- package/dist/core/bash-executor.js +111 -0
- package/dist/core/bash-executor.js.map +1 -0
- package/dist/core/cache-stats.d.ts +49 -0
- package/dist/core/cache-stats.d.ts.map +1 -0
- package/dist/core/cache-stats.js +101 -0
- package/dist/core/cache-stats.js.map +1 -0
- package/dist/core/catalog-merge.d.ts +46 -0
- package/dist/core/catalog-merge.d.ts.map +1 -0
- package/dist/core/catalog-merge.js +128 -0
- package/dist/core/catalog-merge.js.map +1 -0
- package/dist/core/compaction/branch-summarization.d.ts +92 -0
- package/dist/core/compaction/branch-summarization.d.ts.map +1 -0
- package/dist/core/compaction/branch-summarization.js +249 -0
- package/dist/core/compaction/branch-summarization.js.map +1 -0
- package/dist/core/compaction/compaction.d.ts +121 -0
- package/dist/core/compaction/compaction.d.ts.map +1 -0
- package/dist/core/compaction/compaction.js +600 -0
- package/dist/core/compaction/compaction.js.map +1 -0
- package/dist/core/compaction/index.d.ts +7 -0
- package/dist/core/compaction/index.d.ts.map +1 -0
- package/dist/core/compaction/index.js +7 -0
- package/dist/core/compaction/index.js.map +1 -0
- package/dist/core/compaction/utils.d.ts +38 -0
- package/dist/core/compaction/utils.d.ts.map +1 -0
- package/dist/core/compaction/utils.js +153 -0
- package/dist/core/compaction/utils.js.map +1 -0
- package/dist/core/context-breakdown.d.ts +67 -0
- package/dist/core/context-breakdown.d.ts.map +1 -0
- package/dist/core/context-breakdown.js +116 -0
- package/dist/core/context-breakdown.js.map +1 -0
- package/dist/core/cron/fire-guard.d.ts +16 -0
- package/dist/core/cron/fire-guard.d.ts.map +1 -0
- package/dist/core/cron/fire-guard.js +24 -0
- package/dist/core/cron/fire-guard.js.map +1 -0
- package/dist/core/cron/jobs.d.ts +162 -0
- package/dist/core/cron/jobs.d.ts.map +1 -0
- package/dist/core/cron/jobs.js +545 -0
- package/dist/core/cron/jobs.js.map +1 -0
- package/dist/core/cron/origin-context.d.ts +22 -0
- package/dist/core/cron/origin-context.d.ts.map +1 -0
- package/dist/core/cron/origin-context.js +22 -0
- package/dist/core/cron/origin-context.js.map +1 -0
- package/dist/core/cron/scheduler.d.ts +51 -0
- package/dist/core/cron/scheduler.d.ts.map +1 -0
- package/dist/core/cron/scheduler.js +165 -0
- package/dist/core/cron/scheduler.js.map +1 -0
- package/dist/core/customize.d.ts +31 -0
- package/dist/core/customize.d.ts.map +1 -0
- package/dist/core/customize.js +54 -0
- package/dist/core/customize.js.map +1 -0
- package/dist/core/defaults.d.ts +3 -0
- package/dist/core/defaults.d.ts.map +1 -0
- package/dist/core/defaults.js +2 -0
- package/dist/core/defaults.js.map +1 -0
- package/dist/core/diagnostics.d.ts +15 -0
- package/dist/core/diagnostics.d.ts.map +1 -0
- package/dist/core/diagnostics.js +2 -0
- package/dist/core/diagnostics.js.map +1 -0
- package/dist/core/event-bus.d.ts +9 -0
- package/dist/core/event-bus.d.ts.map +1 -0
- package/dist/core/event-bus.js +25 -0
- package/dist/core/event-bus.js.map +1 -0
- package/dist/core/exec.d.ts +29 -0
- package/dist/core/exec.d.ts.map +1 -0
- package/dist/core/exec.js +75 -0
- package/dist/core/exec.js.map +1 -0
- package/dist/core/experimental.d.ts +2 -0
- package/dist/core/experimental.d.ts.map +1 -0
- package/dist/core/experimental.js +4 -0
- package/dist/core/experimental.js.map +1 -0
- package/dist/core/export-html/ansi-to-html.d.ts +22 -0
- package/dist/core/export-html/ansi-to-html.d.ts.map +1 -0
- package/dist/core/export-html/ansi-to-html.js +249 -0
- package/dist/core/export-html/ansi-to-html.js.map +1 -0
- package/dist/core/export-html/index.d.ts +37 -0
- package/dist/core/export-html/index.d.ts.map +1 -0
- package/dist/core/export-html/index.js +226 -0
- package/dist/core/export-html/index.js.map +1 -0
- package/dist/core/export-html/template.css +1066 -0
- package/dist/core/export-html/template.html +55 -0
- package/dist/core/export-html/template.js +1864 -0
- package/dist/core/export-html/tool-renderer.d.ts +34 -0
- package/dist/core/export-html/tool-renderer.d.ts.map +1 -0
- package/dist/core/export-html/tool-renderer.js +108 -0
- package/dist/core/export-html/tool-renderer.js.map +1 -0
- package/dist/core/export-html/vendor/highlight.min.js +1213 -0
- package/dist/core/export-html/vendor/marked.min.js +78 -0
- package/dist/core/extensions/index.d.ts +12 -0
- package/dist/core/extensions/index.d.ts.map +1 -0
- package/dist/core/extensions/index.js +9 -0
- package/dist/core/extensions/index.js.map +1 -0
- package/dist/core/extensions/loader.d.ts +23 -0
- package/dist/core/extensions/loader.d.ts.map +1 -0
- package/dist/core/extensions/loader.js +547 -0
- package/dist/core/extensions/loader.js.map +1 -0
- package/dist/core/extensions/runner.d.ts +170 -0
- package/dist/core/extensions/runner.d.ts.map +1 -0
- package/dist/core/extensions/runner.js +923 -0
- package/dist/core/extensions/runner.js.map +1 -0
- package/dist/core/extensions/types.d.ts +1247 -0
- package/dist/core/extensions/types.d.ts.map +1 -0
- package/dist/core/extensions/types.js +45 -0
- package/dist/core/extensions/types.js.map +1 -0
- package/dist/core/extensions/wrapper.d.ts +20 -0
- package/dist/core/extensions/wrapper.d.ts.map +1 -0
- package/dist/core/extensions/wrapper.js +41 -0
- package/dist/core/extensions/wrapper.js.map +1 -0
- package/dist/core/footer-data-provider.d.ts +54 -0
- package/dist/core/footer-data-provider.d.ts.map +1 -0
- package/dist/core/footer-data-provider.js +338 -0
- package/dist/core/footer-data-provider.js.map +1 -0
- package/dist/core/http-dispatcher.d.ts +22 -0
- package/dist/core/http-dispatcher.d.ts.map +1 -0
- package/dist/core/http-dispatcher.js +91 -0
- package/dist/core/http-dispatcher.js.map +1 -0
- package/dist/core/index.d.ts +13 -0
- package/dist/core/index.d.ts.map +1 -0
- package/dist/core/index.js +13 -0
- package/dist/core/index.js.map +1 -0
- package/dist/core/injected-prompt.d.ts +20 -0
- package/dist/core/injected-prompt.d.ts.map +1 -0
- package/dist/core/injected-prompt.js +64 -0
- package/dist/core/injected-prompt.js.map +1 -0
- package/dist/core/install-features.d.ts +106 -0
- package/dist/core/install-features.d.ts.map +1 -0
- package/dist/core/install-features.js +392 -0
- package/dist/core/install-features.js.map +1 -0
- package/dist/core/install-layout.d.ts +18 -0
- package/dist/core/install-layout.d.ts.map +1 -0
- package/dist/core/install-layout.js +54 -0
- package/dist/core/install-layout.js.map +1 -0
- package/dist/core/keybindings.d.ts +373 -0
- package/dist/core/keybindings.d.ts.map +1 -0
- package/dist/core/keybindings.js +309 -0
- package/dist/core/keybindings.js.map +1 -0
- package/dist/core/live-catalog.d.ts +74 -0
- package/dist/core/live-catalog.d.ts.map +1 -0
- package/dist/core/live-catalog.js +351 -0
- package/dist/core/live-catalog.js.map +1 -0
- package/dist/core/memory-cap.d.ts +27 -0
- package/dist/core/memory-cap.d.ts.map +1 -0
- package/dist/core/memory-cap.js +32 -0
- package/dist/core/memory-cap.js.map +1 -0
- package/dist/core/messages.d.ts +77 -0
- package/dist/core/messages.d.ts.map +1 -0
- package/dist/core/messages.js +123 -0
- package/dist/core/messages.js.map +1 -0
- package/dist/core/model-config-writer.d.ts +24 -0
- package/dist/core/model-config-writer.d.ts.map +1 -0
- package/dist/core/model-config-writer.js +84 -0
- package/dist/core/model-config-writer.js.map +1 -0
- package/dist/core/model-config.d.ts +512 -0
- package/dist/core/model-config.d.ts.map +1 -0
- package/dist/core/model-config.js +243 -0
- package/dist/core/model-config.js.map +1 -0
- package/dist/core/model-registry.d.ts +39 -0
- package/dist/core/model-registry.d.ts.map +1 -0
- package/dist/core/model-registry.js +89 -0
- package/dist/core/model-registry.js.map +1 -0
- package/dist/core/model-resolver.d.ts +121 -0
- package/dist/core/model-resolver.d.ts.map +1 -0
- package/dist/core/model-resolver.js +536 -0
- package/dist/core/model-resolver.js.map +1 -0
- package/dist/core/model-runtime.d.ts +115 -0
- package/dist/core/model-runtime.d.ts.map +1 -0
- package/dist/core/model-runtime.js +640 -0
- package/dist/core/model-runtime.js.map +1 -0
- package/dist/core/model-tiers.d.ts +34 -0
- package/dist/core/model-tiers.d.ts.map +1 -0
- package/dist/core/model-tiers.js +53 -0
- package/dist/core/model-tiers.js.map +1 -0
- package/dist/core/models-store.d.ts +17 -0
- package/dist/core/models-store.d.ts.map +1 -0
- package/dist/core/models-store.js +45 -0
- package/dist/core/models-store.js.map +1 -0
- package/dist/core/official-catalog.d.ts +72 -0
- package/dist/core/official-catalog.d.ts.map +1 -0
- package/dist/core/official-catalog.js +370 -0
- package/dist/core/official-catalog.js.map +1 -0
- package/dist/core/output-guard.d.ts +7 -0
- package/dist/core/output-guard.d.ts.map +1 -0
- package/dist/core/output-guard.js +89 -0
- package/dist/core/output-guard.js.map +1 -0
- package/dist/core/package-manager.d.ts +198 -0
- package/dist/core/package-manager.d.ts.map +1 -0
- package/dist/core/package-manager.js +2005 -0
- package/dist/core/package-manager.js.map +1 -0
- package/dist/core/permission-mode.d.ts +19 -0
- package/dist/core/permission-mode.d.ts.map +1 -0
- package/dist/core/permission-mode.js +26 -0
- package/dist/core/permission-mode.js.map +1 -0
- package/dist/core/permissions.d.ts +99 -0
- package/dist/core/permissions.d.ts.map +1 -0
- package/dist/core/permissions.js +323 -0
- package/dist/core/permissions.js.map +1 -0
- package/dist/core/plan-mode.d.ts +37 -0
- package/dist/core/plan-mode.d.ts.map +1 -0
- package/dist/core/plan-mode.js +388 -0
- package/dist/core/plan-mode.js.map +1 -0
- package/dist/core/process-registry.d.ts +40 -0
- package/dist/core/process-registry.d.ts.map +1 -0
- package/dist/core/process-registry.js +190 -0
- package/dist/core/process-registry.js.map +1 -0
- package/dist/core/project-trust.d.ts +15 -0
- package/dist/core/project-trust.d.ts.map +1 -0
- package/dist/core/project-trust.js +59 -0
- package/dist/core/project-trust.js.map +1 -0
- package/dist/core/prompt-templates.d.ts +53 -0
- package/dist/core/prompt-templates.d.ts.map +1 -0
- package/dist/core/prompt-templates.js +236 -0
- package/dist/core/prompt-templates.js.map +1 -0
- package/dist/core/provider-attribution.d.ts +4 -0
- package/dist/core/provider-attribution.d.ts.map +1 -0
- package/dist/core/provider-attribution.js +31 -0
- package/dist/core/provider-attribution.js.map +1 -0
- package/dist/core/provider-composer.d.ts +55 -0
- package/dist/core/provider-composer.d.ts.map +1 -0
- package/dist/core/provider-composer.js +375 -0
- package/dist/core/provider-composer.js.map +1 -0
- package/dist/core/radius.d.ts +2 -0
- package/dist/core/radius.d.ts.map +1 -0
- package/dist/core/radius.js +2 -0
- package/dist/core/radius.js.map +1 -0
- package/dist/core/resolve-config-value.d.ts +30 -0
- package/dist/core/resolve-config-value.d.ts.map +1 -0
- package/dist/core/resolve-config-value.js +247 -0
- package/dist/core/resolve-config-value.js.map +1 -0
- package/dist/core/resource-loader.d.ts +206 -0
- package/dist/core/resource-loader.d.ts.map +1 -0
- package/dist/core/resource-loader.js +816 -0
- package/dist/core/resource-loader.js.map +1 -0
- package/dist/core/rollback.d.ts +80 -0
- package/dist/core/rollback.d.ts.map +1 -0
- package/dist/core/rollback.js +582 -0
- package/dist/core/rollback.js.map +1 -0
- package/dist/core/runtime-credentials.d.ts +15 -0
- package/dist/core/runtime-credentials.d.ts.map +1 -0
- package/dist/core/runtime-credentials.js +36 -0
- package/dist/core/runtime-credentials.js.map +1 -0
- package/dist/core/sdk.d.ts +106 -0
- package/dist/core/sdk.d.ts.map +1 -0
- package/dist/core/sdk.js +264 -0
- package/dist/core/sdk.js.map +1 -0
- package/dist/core/search-curator.d.ts +23 -0
- package/dist/core/search-curator.d.ts.map +1 -0
- package/dist/core/search-curator.js +34 -0
- package/dist/core/search-curator.js.map +1 -0
- package/dist/core/session-cwd.d.ts +19 -0
- package/dist/core/session-cwd.d.ts.map +1 -0
- package/dist/core/session-cwd.js +38 -0
- package/dist/core/session-cwd.js.map +1 -0
- package/dist/core/session-manager.d.ts +351 -0
- package/dist/core/session-manager.d.ts.map +1 -0
- package/dist/core/session-manager.js +1262 -0
- package/dist/core/session-manager.js.map +1 -0
- package/dist/core/session-retention.d.ts +17 -0
- package/dist/core/session-retention.d.ts.map +1 -0
- package/dist/core/session-retention.js +69 -0
- package/dist/core/session-retention.js.map +1 -0
- package/dist/core/settings-manager.d.ts +355 -0
- package/dist/core/settings-manager.d.ts.map +1 -0
- package/dist/core/settings-manager.js +1064 -0
- package/dist/core/settings-manager.js.map +1 -0
- package/dist/core/skills.d.ts +60 -0
- package/dist/core/skills.d.ts.map +1 -0
- package/dist/core/skills.js +387 -0
- package/dist/core/skills.js.map +1 -0
- package/dist/core/slash-commands.d.ts +15 -0
- package/dist/core/slash-commands.d.ts.map +1 -0
- package/dist/core/slash-commands.js +58 -0
- package/dist/core/slash-commands.js.map +1 -0
- package/dist/core/source-info.d.ts +18 -0
- package/dist/core/source-info.d.ts.map +1 -0
- package/dist/core/source-info.js +19 -0
- package/dist/core/source-info.js.map +1 -0
- package/dist/core/subscriptions.d.ts +64 -0
- package/dist/core/subscriptions.d.ts.map +1 -0
- package/dist/core/subscriptions.js +259 -0
- package/dist/core/subscriptions.js.map +1 -0
- package/dist/core/swarm.d.ts +41 -0
- package/dist/core/swarm.d.ts.map +1 -0
- package/dist/core/swarm.js +81 -0
- package/dist/core/swarm.js.map +1 -0
- package/dist/core/system-prompt.d.ts +28 -0
- package/dist/core/system-prompt.d.ts.map +1 -0
- package/dist/core/system-prompt.js +107 -0
- package/dist/core/system-prompt.js.map +1 -0
- package/dist/core/timings.d.ts +10 -0
- package/dist/core/timings.d.ts.map +1 -0
- package/dist/core/timings.js +41 -0
- package/dist/core/timings.js.map +1 -0
- package/dist/core/tools/bash.d.ts +69 -0
- package/dist/core/tools/bash.d.ts.map +1 -0
- package/dist/core/tools/bash.js +395 -0
- package/dist/core/tools/bash.js.map +1 -0
- package/dist/core/tools/edit-diff.d.ts +106 -0
- package/dist/core/tools/edit-diff.d.ts.map +1 -0
- package/dist/core/tools/edit-diff.js +424 -0
- package/dist/core/tools/edit-diff.js.map +1 -0
- package/dist/core/tools/edit.d.ts +51 -0
- package/dist/core/tools/edit.d.ts.map +1 -0
- package/dist/core/tools/edit.js +293 -0
- package/dist/core/tools/edit.js.map +1 -0
- package/dist/core/tools/file-mutation-queue.d.ts +6 -0
- package/dist/core/tools/file-mutation-queue.d.ts.map +1 -0
- package/dist/core/tools/file-mutation-queue.js +52 -0
- package/dist/core/tools/file-mutation-queue.js.map +1 -0
- package/dist/core/tools/find.d.ts +35 -0
- package/dist/core/tools/find.d.ts.map +1 -0
- package/dist/core/tools/find.js +313 -0
- package/dist/core/tools/find.js.map +1 -0
- package/dist/core/tools/grep.d.ts +37 -0
- package/dist/core/tools/grep.d.ts.map +1 -0
- package/dist/core/tools/grep.js +312 -0
- package/dist/core/tools/grep.js.map +1 -0
- package/dist/core/tools/index.d.ts +40 -0
- package/dist/core/tools/index.d.ts.map +1 -0
- package/dist/core/tools/index.js +112 -0
- package/dist/core/tools/index.js.map +1 -0
- package/dist/core/tools/ls.d.ts +37 -0
- package/dist/core/tools/ls.d.ts.map +1 -0
- package/dist/core/tools/ls.js +175 -0
- package/dist/core/tools/ls.js.map +1 -0
- package/dist/core/tools/output-accumulator.d.ts +52 -0
- package/dist/core/tools/output-accumulator.d.ts.map +1 -0
- package/dist/core/tools/output-accumulator.js +184 -0
- package/dist/core/tools/output-accumulator.js.map +1 -0
- package/dist/core/tools/path-utils.d.ts +10 -0
- package/dist/core/tools/path-utils.d.ts.map +1 -0
- package/dist/core/tools/path-utils.js +99 -0
- package/dist/core/tools/path-utils.js.map +1 -0
- package/dist/core/tools/read.d.ts +35 -0
- package/dist/core/tools/read.d.ts.map +1 -0
- package/dist/core/tools/read.js +285 -0
- package/dist/core/tools/read.js.map +1 -0
- package/dist/core/tools/render-utils.d.ts +36 -0
- package/dist/core/tools/render-utils.d.ts.map +1 -0
- package/dist/core/tools/render-utils.js +88 -0
- package/dist/core/tools/render-utils.js.map +1 -0
- package/dist/core/tools/tool-definition-wrapper.d.ts +14 -0
- package/dist/core/tools/tool-definition-wrapper.d.ts.map +1 -0
- package/dist/core/tools/tool-definition-wrapper.js +34 -0
- package/dist/core/tools/tool-definition-wrapper.js.map +1 -0
- package/dist/core/tools/truncate.d.ts +70 -0
- package/dist/core/tools/truncate.d.ts.map +1 -0
- package/dist/core/tools/truncate.js +215 -0
- package/dist/core/tools/truncate.js.map +1 -0
- package/dist/core/tools/write.d.ts +26 -0
- package/dist/core/tools/write.d.ts.map +1 -0
- package/dist/core/tools/write.js +202 -0
- package/dist/core/tools/write.js.map +1 -0
- package/dist/core/trust-manager.d.ts +36 -0
- package/dist/core/trust-manager.d.ts.map +1 -0
- package/dist/core/trust-manager.js +202 -0
- package/dist/core/trust-manager.js.map +1 -0
- package/dist/core/usage-adapters/kimi-coding.d.ts +11 -0
- package/dist/core/usage-adapters/kimi-coding.d.ts.map +1 -0
- package/dist/core/usage-adapters/kimi-coding.js +78 -0
- package/dist/core/usage-adapters/kimi-coding.js.map +1 -0
- package/dist/core/usage-adapters/openai-codex.d.ts +4 -0
- package/dist/core/usage-adapters/openai-codex.d.ts.map +1 -0
- package/dist/core/usage-adapters/openai-codex.js +180 -0
- package/dist/core/usage-adapters/openai-codex.js.map +1 -0
- package/dist/core/usage-adapters/shared.d.ts +20 -0
- package/dist/core/usage-adapters/shared.d.ts.map +1 -0
- package/dist/core/usage-adapters/shared.js +75 -0
- package/dist/core/usage-adapters/shared.js.map +1 -0
- package/dist/core/usage-adapters/xai.d.ts +21 -0
- package/dist/core/usage-adapters/xai.d.ts.map +1 -0
- package/dist/core/usage-adapters/xai.js +77 -0
- package/dist/core/usage-adapters/xai.js.map +1 -0
- package/dist/core/usage-adapters/zai.d.ts +14 -0
- package/dist/core/usage-adapters/zai.d.ts.map +1 -0
- package/dist/core/usage-adapters/zai.js +67 -0
- package/dist/core/usage-adapters/zai.js.map +1 -0
- package/dist/core/usage-history.d.ts +63 -0
- package/dist/core/usage-history.d.ts.map +1 -0
- package/dist/core/usage-history.js +239 -0
- package/dist/core/usage-history.js.map +1 -0
- package/dist/core/usage-limit.d.ts +17 -0
- package/dist/core/usage-limit.d.ts.map +1 -0
- package/dist/core/usage-limit.js +79 -0
- package/dist/core/usage-limit.js.map +1 -0
- package/dist/core/usage-service.d.ts +33 -0
- package/dist/core/usage-service.d.ts.map +1 -0
- package/dist/core/usage-service.js +56 -0
- package/dist/core/usage-service.js.map +1 -0
- package/dist/core/user-models.d.ts +50 -0
- package/dist/core/user-models.d.ts.map +1 -0
- package/dist/core/user-models.js +192 -0
- package/dist/core/user-models.js.map +1 -0
- package/dist/gateway/adapters/discord.d.ts +251 -0
- package/dist/gateway/adapters/discord.d.ts.map +1 -0
- package/dist/gateway/adapters/discord.js +693 -0
- package/dist/gateway/adapters/discord.js.map +1 -0
- package/dist/gateway/adapters/telegram.d.ts +187 -0
- package/dist/gateway/adapters/telegram.d.ts.map +1 -0
- package/dist/gateway/adapters/telegram.js +581 -0
- package/dist/gateway/adapters/telegram.js.map +1 -0
- package/dist/gateway/agent-bridge.d.ts +143 -0
- package/dist/gateway/agent-bridge.d.ts.map +1 -0
- package/dist/gateway/agent-bridge.js +466 -0
- package/dist/gateway/agent-bridge.js.map +1 -0
- package/dist/gateway/approval.d.ts +34 -0
- package/dist/gateway/approval.d.ts.map +1 -0
- package/dist/gateway/approval.js +152 -0
- package/dist/gateway/approval.js.map +1 -0
- package/dist/gateway/authz.d.ts +21 -0
- package/dist/gateway/authz.d.ts.map +1 -0
- package/dist/gateway/authz.js +61 -0
- package/dist/gateway/authz.js.map +1 -0
- package/dist/gateway/buttons.d.ts +58 -0
- package/dist/gateway/buttons.d.ts.map +1 -0
- package/dist/gateway/buttons.js +269 -0
- package/dist/gateway/buttons.js.map +1 -0
- package/dist/gateway/command.d.ts +8 -0
- package/dist/gateway/command.d.ts.map +1 -0
- package/dist/gateway/command.js +16 -0
- package/dist/gateway/command.js.map +1 -0
- package/dist/gateway/commands.d.ts +43 -0
- package/dist/gateway/commands.d.ts.map +1 -0
- package/dist/gateway/commands.js +642 -0
- package/dist/gateway/commands.js.map +1 -0
- package/dist/gateway/config.d.ts +53 -0
- package/dist/gateway/config.d.ts.map +1 -0
- package/dist/gateway/config.js +136 -0
- package/dist/gateway/config.js.map +1 -0
- package/dist/gateway/cron.d.ts +69 -0
- package/dist/gateway/cron.d.ts.map +1 -0
- package/dist/gateway/cron.js +321 -0
- package/dist/gateway/cron.js.map +1 -0
- package/dist/gateway/index.d.ts +31 -0
- package/dist/gateway/index.d.ts.map +1 -0
- package/dist/gateway/index.js +233 -0
- package/dist/gateway/index.js.map +1 -0
- package/dist/gateway/pairing.d.ts +44 -0
- package/dist/gateway/pairing.d.ts.map +1 -0
- package/dist/gateway/pairing.js +171 -0
- package/dist/gateway/pairing.js.map +1 -0
- package/dist/gateway/router.d.ts +48 -0
- package/dist/gateway/router.d.ts.map +1 -0
- package/dist/gateway/router.js +215 -0
- package/dist/gateway/router.js.map +1 -0
- package/dist/gateway/session-keys.d.ts +18 -0
- package/dist/gateway/session-keys.d.ts.map +1 -0
- package/dist/gateway/session-keys.js +26 -0
- package/dist/gateway/session-keys.js.map +1 -0
- package/dist/gateway/store.d.ts +28 -0
- package/dist/gateway/store.d.ts.map +1 -0
- package/dist/gateway/store.js +93 -0
- package/dist/gateway/store.js.map +1 -0
- package/dist/gateway/stream.d.ts +55 -0
- package/dist/gateway/stream.d.ts.map +1 -0
- package/dist/gateway/stream.js +107 -0
- package/dist/gateway/stream.js.map +1 -0
- package/dist/gateway/text.d.ts +18 -0
- package/dist/gateway/text.d.ts.map +1 -0
- package/dist/gateway/text.js +136 -0
- package/dist/gateway/text.js.map +1 -0
- package/dist/gateway/types.d.ts +95 -0
- package/dist/gateway/types.d.ts.map +1 -0
- package/dist/gateway/types.js +9 -0
- package/dist/gateway/types.js.map +1 -0
- package/dist/index.d.ts +35 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +47 -0
- package/dist/index.js.map +1 -0
- package/dist/main.d.ts +12 -0
- package/dist/main.d.ts.map +1 -0
- package/dist/main.js +742 -0
- package/dist/main.js.map +1 -0
- package/dist/migrations.d.ts +46 -0
- package/dist/migrations.d.ts.map +1 -0
- package/dist/migrations.js +351 -0
- package/dist/migrations.js.map +1 -0
- package/dist/modes/index.d.ts +9 -0
- package/dist/modes/index.d.ts.map +1 -0
- package/dist/modes/index.js +8 -0
- package/dist/modes/index.js.map +1 -0
- package/dist/modes/interactive/assets/clankolas.png +0 -0
- package/dist/modes/interactive/components/armin.d.ts +34 -0
- package/dist/modes/interactive/components/armin.d.ts.map +1 -0
- package/dist/modes/interactive/components/armin.js +333 -0
- package/dist/modes/interactive/components/armin.js.map +1 -0
- package/dist/modes/interactive/components/assistant-message.d.ts +31 -0
- package/dist/modes/interactive/components/assistant-message.d.ts.map +1 -0
- package/dist/modes/interactive/components/assistant-message.js +246 -0
- package/dist/modes/interactive/components/assistant-message.js.map +1 -0
- package/dist/modes/interactive/components/bash-execution.d.ts +32 -0
- package/dist/modes/interactive/components/bash-execution.d.ts.map +1 -0
- package/dist/modes/interactive/components/bash-execution.js +171 -0
- package/dist/modes/interactive/components/bash-execution.js.map +1 -0
- package/dist/modes/interactive/components/boot-ascii.d.ts +6 -0
- package/dist/modes/interactive/components/boot-ascii.d.ts.map +1 -0
- package/dist/modes/interactive/components/boot-ascii.js +6 -0
- package/dist/modes/interactive/components/boot-ascii.js.map +1 -0
- package/dist/modes/interactive/components/boot-screen.d.ts +22 -0
- package/dist/modes/interactive/components/boot-screen.d.ts.map +1 -0
- package/dist/modes/interactive/components/boot-screen.js +53 -0
- package/dist/modes/interactive/components/boot-screen.js.map +1 -0
- package/dist/modes/interactive/components/bordered-loader.d.ts +16 -0
- package/dist/modes/interactive/components/bordered-loader.d.ts.map +1 -0
- package/dist/modes/interactive/components/bordered-loader.js +54 -0
- package/dist/modes/interactive/components/bordered-loader.js.map +1 -0
- package/dist/modes/interactive/components/branch-summary-message.d.ts +16 -0
- package/dist/modes/interactive/components/branch-summary-message.d.ts.map +1 -0
- package/dist/modes/interactive/components/branch-summary-message.js +44 -0
- package/dist/modes/interactive/components/branch-summary-message.js.map +1 -0
- package/dist/modes/interactive/components/compaction-summary-message.d.ts +16 -0
- package/dist/modes/interactive/components/compaction-summary-message.d.ts.map +1 -0
- package/dist/modes/interactive/components/compaction-summary-message.js +45 -0
- package/dist/modes/interactive/components/compaction-summary-message.js.map +1 -0
- package/dist/modes/interactive/components/config-selector.d.ts +102 -0
- package/dist/modes/interactive/components/config-selector.d.ts.map +1 -0
- package/dist/modes/interactive/components/config-selector.js +761 -0
- package/dist/modes/interactive/components/config-selector.js.map +1 -0
- package/dist/modes/interactive/components/context-view.d.ts +13 -0
- package/dist/modes/interactive/components/context-view.d.ts.map +1 -0
- package/dist/modes/interactive/components/context-view.js +42 -0
- package/dist/modes/interactive/components/context-view.js.map +1 -0
- package/dist/modes/interactive/components/countdown-timer.d.ts +14 -0
- package/dist/modes/interactive/components/countdown-timer.d.ts.map +1 -0
- package/dist/modes/interactive/components/countdown-timer.js +33 -0
- package/dist/modes/interactive/components/countdown-timer.js.map +1 -0
- package/dist/modes/interactive/components/custom-editor.d.ts +21 -0
- package/dist/modes/interactive/components/custom-editor.d.ts.map +1 -0
- package/dist/modes/interactive/components/custom-editor.js +70 -0
- package/dist/modes/interactive/components/custom-editor.js.map +1 -0
- package/dist/modes/interactive/components/custom-entry.d.ts +19 -0
- package/dist/modes/interactive/components/custom-entry.d.ts.map +1 -0
- package/dist/modes/interactive/components/custom-entry.js +52 -0
- package/dist/modes/interactive/components/custom-entry.js.map +1 -0
- package/dist/modes/interactive/components/custom-message.d.ts +20 -0
- package/dist/modes/interactive/components/custom-message.d.ts.map +1 -0
- package/dist/modes/interactive/components/custom-message.js +79 -0
- package/dist/modes/interactive/components/custom-message.js.map +1 -0
- package/dist/modes/interactive/components/daxnuts.d.ts +23 -0
- package/dist/modes/interactive/components/daxnuts.d.ts.map +1 -0
- package/dist/modes/interactive/components/daxnuts.js +140 -0
- package/dist/modes/interactive/components/daxnuts.js.map +1 -0
- package/dist/modes/interactive/components/diff.d.ts +12 -0
- package/dist/modes/interactive/components/diff.d.ts.map +1 -0
- package/dist/modes/interactive/components/diff.js +133 -0
- package/dist/modes/interactive/components/diff.js.map +1 -0
- package/dist/modes/interactive/components/dynamic-border.d.ts +15 -0
- package/dist/modes/interactive/components/dynamic-border.d.ts.map +1 -0
- package/dist/modes/interactive/components/dynamic-border.js +21 -0
- package/dist/modes/interactive/components/dynamic-border.js.map +1 -0
- package/dist/modes/interactive/components/earendil-announcement.d.ts +5 -0
- package/dist/modes/interactive/components/earendil-announcement.d.ts.map +1 -0
- package/dist/modes/interactive/components/earendil-announcement.js +40 -0
- package/dist/modes/interactive/components/earendil-announcement.js.map +1 -0
- package/dist/modes/interactive/components/exit-card.d.ts +22 -0
- package/dist/modes/interactive/components/exit-card.d.ts.map +1 -0
- package/dist/modes/interactive/components/exit-card.js +69 -0
- package/dist/modes/interactive/components/exit-card.js.map +1 -0
- package/dist/modes/interactive/components/extension-editor.d.ts +22 -0
- package/dist/modes/interactive/components/extension-editor.d.ts.map +1 -0
- package/dist/modes/interactive/components/extension-editor.js +128 -0
- package/dist/modes/interactive/components/extension-editor.js.map +1 -0
- package/dist/modes/interactive/components/extension-input.d.ts +23 -0
- package/dist/modes/interactive/components/extension-input.d.ts.map +1 -0
- package/dist/modes/interactive/components/extension-input.js +61 -0
- package/dist/modes/interactive/components/extension-input.js.map +1 -0
- package/dist/modes/interactive/components/extension-selector.d.ts +30 -0
- package/dist/modes/interactive/components/extension-selector.d.ts.map +1 -0
- package/dist/modes/interactive/components/extension-selector.js +106 -0
- package/dist/modes/interactive/components/extension-selector.js.map +1 -0
- package/dist/modes/interactive/components/first-time-setup.d.ts +25 -0
- package/dist/modes/interactive/components/first-time-setup.d.ts.map +1 -0
- package/dist/modes/interactive/components/first-time-setup.js +99 -0
- package/dist/modes/interactive/components/first-time-setup.js.map +1 -0
- package/dist/modes/interactive/components/footer.d.ts +32 -0
- package/dist/modes/interactive/components/footer.d.ts.map +1 -0
- package/dist/modes/interactive/components/footer.js +221 -0
- package/dist/modes/interactive/components/footer.js.map +1 -0
- package/dist/modes/interactive/components/index.d.ts +34 -0
- package/dist/modes/interactive/components/index.d.ts.map +1 -0
- package/dist/modes/interactive/components/index.js +35 -0
- package/dist/modes/interactive/components/index.js.map +1 -0
- package/dist/modes/interactive/components/injected-prompt-message.d.ts +21 -0
- package/dist/modes/interactive/components/injected-prompt-message.d.ts.map +1 -0
- package/dist/modes/interactive/components/injected-prompt-message.js +51 -0
- package/dist/modes/interactive/components/injected-prompt-message.js.map +1 -0
- package/dist/modes/interactive/components/keybinding-hints.d.ts +13 -0
- package/dist/modes/interactive/components/keybinding-hints.d.ts.map +1 -0
- package/dist/modes/interactive/components/keybinding-hints.js +36 -0
- package/dist/modes/interactive/components/keybinding-hints.js.map +1 -0
- package/dist/modes/interactive/components/login-dialog.d.ts +52 -0
- package/dist/modes/interactive/components/login-dialog.d.ts.map +1 -0
- package/dist/modes/interactive/components/login-dialog.js +188 -0
- package/dist/modes/interactive/components/login-dialog.js.map +1 -0
- package/dist/modes/interactive/components/model-selector.d.ts +61 -0
- package/dist/modes/interactive/components/model-selector.d.ts.map +1 -0
- package/dist/modes/interactive/components/model-selector.js +320 -0
- package/dist/modes/interactive/components/model-selector.js.map +1 -0
- package/dist/modes/interactive/components/oauth-selector.d.ts +33 -0
- package/dist/modes/interactive/components/oauth-selector.d.ts.map +1 -0
- package/dist/modes/interactive/components/oauth-selector.js +163 -0
- package/dist/modes/interactive/components/oauth-selector.js.map +1 -0
- package/dist/modes/interactive/components/processes-selector.d.ts +19 -0
- package/dist/modes/interactive/components/processes-selector.d.ts.map +1 -0
- package/dist/modes/interactive/components/processes-selector.js +170 -0
- package/dist/modes/interactive/components/processes-selector.js.map +1 -0
- package/dist/modes/interactive/components/scoped-models-selector.d.ts +42 -0
- package/dist/modes/interactive/components/scoped-models-selector.d.ts.map +1 -0
- package/dist/modes/interactive/components/scoped-models-selector.js +293 -0
- package/dist/modes/interactive/components/scoped-models-selector.js.map +1 -0
- package/dist/modes/interactive/components/session-selector-search.d.ts +23 -0
- package/dist/modes/interactive/components/session-selector-search.d.ts.map +1 -0
- package/dist/modes/interactive/components/session-selector-search.js +155 -0
- package/dist/modes/interactive/components/session-selector-search.js.map +1 -0
- package/dist/modes/interactive/components/session-selector.d.ts +95 -0
- package/dist/modes/interactive/components/session-selector.d.ts.map +1 -0
- package/dist/modes/interactive/components/session-selector.js +857 -0
- package/dist/modes/interactive/components/session-selector.js.map +1 -0
- package/dist/modes/interactive/components/settings-selector.d.ts +139 -0
- package/dist/modes/interactive/components/settings-selector.d.ts.map +1 -0
- package/dist/modes/interactive/components/settings-selector.js +1156 -0
- package/dist/modes/interactive/components/settings-selector.js.map +1 -0
- package/dist/modes/interactive/components/show-images-selector.d.ts +10 -0
- package/dist/modes/interactive/components/show-images-selector.d.ts.map +1 -0
- package/dist/modes/interactive/components/show-images-selector.js +39 -0
- package/dist/modes/interactive/components/show-images-selector.js.map +1 -0
- package/dist/modes/interactive/components/skill-invocation-message.d.ts +17 -0
- package/dist/modes/interactive/components/skill-invocation-message.d.ts.map +1 -0
- package/dist/modes/interactive/components/skill-invocation-message.js +47 -0
- package/dist/modes/interactive/components/skill-invocation-message.js.map +1 -0
- package/dist/modes/interactive/components/status-indicator.d.ts +28 -0
- package/dist/modes/interactive/components/status-indicator.d.ts.map +1 -0
- package/dist/modes/interactive/components/status-indicator.js +60 -0
- package/dist/modes/interactive/components/status-indicator.js.map +1 -0
- package/dist/modes/interactive/components/theme-selector.d.ts +11 -0
- package/dist/modes/interactive/components/theme-selector.d.ts.map +1 -0
- package/dist/modes/interactive/components/theme-selector.js +50 -0
- package/dist/modes/interactive/components/theme-selector.js.map +1 -0
- package/dist/modes/interactive/components/thinking-selector.d.ts +11 -0
- package/dist/modes/interactive/components/thinking-selector.d.ts.map +1 -0
- package/dist/modes/interactive/components/thinking-selector.js +52 -0
- package/dist/modes/interactive/components/thinking-selector.js.map +1 -0
- package/dist/modes/interactive/components/thinking-summary.d.ts +36 -0
- package/dist/modes/interactive/components/thinking-summary.d.ts.map +1 -0
- package/dist/modes/interactive/components/thinking-summary.js +94 -0
- package/dist/modes/interactive/components/thinking-summary.js.map +1 -0
- package/dist/modes/interactive/components/thinking-tail.d.ts +21 -0
- package/dist/modes/interactive/components/thinking-tail.d.ts.map +1 -0
- package/dist/modes/interactive/components/thinking-tail.js +29 -0
- package/dist/modes/interactive/components/thinking-tail.js.map +1 -0
- package/dist/modes/interactive/components/tool-execution.d.ts +67 -0
- package/dist/modes/interactive/components/tool-execution.d.ts.map +1 -0
- package/dist/modes/interactive/components/tool-execution.js +340 -0
- package/dist/modes/interactive/components/tool-execution.js.map +1 -0
- package/dist/modes/interactive/components/tree-selector.d.ts +94 -0
- package/dist/modes/interactive/components/tree-selector.d.ts.map +1 -0
- package/dist/modes/interactive/components/tree-selector.js +1245 -0
- package/dist/modes/interactive/components/tree-selector.js.map +1 -0
- package/dist/modes/interactive/components/trust-selector.d.ts +23 -0
- package/dist/modes/interactive/components/trust-selector.d.ts.map +1 -0
- package/dist/modes/interactive/components/trust-selector.js +91 -0
- package/dist/modes/interactive/components/trust-selector.js.map +1 -0
- package/dist/modes/interactive/components/usage-view.d.ts +63 -0
- package/dist/modes/interactive/components/usage-view.d.ts.map +1 -0
- package/dist/modes/interactive/components/usage-view.js +189 -0
- package/dist/modes/interactive/components/usage-view.js.map +1 -0
- package/dist/modes/interactive/components/user-message-selector.d.ts +30 -0
- package/dist/modes/interactive/components/user-message-selector.d.ts.map +1 -0
- package/dist/modes/interactive/components/user-message-selector.js +114 -0
- package/dist/modes/interactive/components/user-message-selector.js.map +1 -0
- package/dist/modes/interactive/components/user-message.d.ts +16 -0
- package/dist/modes/interactive/components/user-message.d.ts.map +1 -0
- package/dist/modes/interactive/components/user-message.js +62 -0
- package/dist/modes/interactive/components/user-message.js.map +1 -0
- package/dist/modes/interactive/components/visual-truncate.d.ts +24 -0
- package/dist/modes/interactive/components/visual-truncate.d.ts.map +1 -0
- package/dist/modes/interactive/components/visual-truncate.js +33 -0
- package/dist/modes/interactive/components/visual-truncate.js.map +1 -0
- package/dist/modes/interactive/interactive-mode.d.ts +448 -0
- package/dist/modes/interactive/interactive-mode.d.ts.map +1 -0
- package/dist/modes/interactive/interactive-mode.js +6487 -0
- package/dist/modes/interactive/interactive-mode.js.map +1 -0
- package/dist/modes/interactive/model-search.d.ts +12 -0
- package/dist/modes/interactive/model-search.d.ts.map +1 -0
- package/dist/modes/interactive/model-search.js +15 -0
- package/dist/modes/interactive/model-search.js.map +1 -0
- package/dist/modes/interactive/smooth-streaming.d.ts +10 -0
- package/dist/modes/interactive/smooth-streaming.d.ts.map +1 -0
- package/dist/modes/interactive/smooth-streaming.js +95 -0
- package/dist/modes/interactive/smooth-streaming.js.map +1 -0
- package/dist/modes/interactive/theme/moon.json +83 -0
- package/dist/modes/interactive/theme/theme-controller.d.ts +29 -0
- package/dist/modes/interactive/theme/theme-controller.d.ts.map +1 -0
- package/dist/modes/interactive/theme/theme-controller.js +97 -0
- package/dist/modes/interactive/theme/theme-controller.js.map +1 -0
- package/dist/modes/interactive/theme/theme-schema.json +363 -0
- package/dist/modes/interactive/theme/theme.d.ts +128 -0
- package/dist/modes/interactive/theme/theme.d.ts.map +1 -0
- package/dist/modes/interactive/theme/theme.js +1092 -0
- package/dist/modes/interactive/theme/theme.js.map +1 -0
- package/dist/modes/print-mode.d.ts +28 -0
- package/dist/modes/print-mode.d.ts.map +1 -0
- package/dist/modes/print-mode.js +132 -0
- package/dist/modes/print-mode.js.map +1 -0
- package/dist/modes/rpc/jsonl.d.ts +17 -0
- package/dist/modes/rpc/jsonl.d.ts.map +1 -0
- package/dist/modes/rpc/jsonl.js +49 -0
- package/dist/modes/rpc/jsonl.js.map +1 -0
- package/dist/modes/rpc/rpc-client.d.ts +242 -0
- package/dist/modes/rpc/rpc-client.d.ts.map +1 -0
- package/dist/modes/rpc/rpc-client.js +481 -0
- package/dist/modes/rpc/rpc-client.js.map +1 -0
- package/dist/modes/rpc/rpc-mode.d.ts +20 -0
- package/dist/modes/rpc/rpc-mode.d.ts.map +1 -0
- package/dist/modes/rpc/rpc-mode.js +635 -0
- package/dist/modes/rpc/rpc-mode.js.map +1 -0
- package/dist/modes/rpc/rpc-types.d.ts +446 -0
- package/dist/modes/rpc/rpc-types.d.ts.map +1 -0
- package/dist/modes/rpc/rpc-types.js +8 -0
- package/dist/modes/rpc/rpc-types.js.map +1 -0
- package/dist/package-manager-cli.d.ts +8 -0
- package/dist/package-manager-cli.d.ts.map +1 -0
- package/dist/package-manager-cli.js +378 -0
- package/dist/package-manager-cli.js.map +1 -0
- package/dist/rpc-entry.d.ts +3 -0
- package/dist/rpc-entry.d.ts.map +1 -0
- package/dist/rpc-entry.js +10 -0
- package/dist/rpc-entry.js.map +1 -0
- package/dist/utils/ansi.d.ts +2 -0
- package/dist/utils/ansi.d.ts.map +1 -0
- package/dist/utils/ansi.js +52 -0
- package/dist/utils/ansi.js.map +1 -0
- package/dist/utils/child-process.d.ts +18 -0
- package/dist/utils/child-process.d.ts.map +1 -0
- package/dist/utils/child-process.js +106 -0
- package/dist/utils/child-process.js.map +1 -0
- package/dist/utils/clipboard-image.d.ts +11 -0
- package/dist/utils/clipboard-image.d.ts.map +1 -0
- package/dist/utils/clipboard-image.js +300 -0
- package/dist/utils/clipboard-image.js.map +1 -0
- package/dist/utils/clipboard-native.d.ts +11 -0
- package/dist/utils/clipboard-native.d.ts.map +1 -0
- package/dist/utils/clipboard-native.js +20 -0
- package/dist/utils/clipboard-native.js.map +1 -0
- package/dist/utils/clipboard.d.ts +4 -0
- package/dist/utils/clipboard.d.ts.map +1 -0
- package/dist/utils/clipboard.js +130 -0
- package/dist/utils/clipboard.js.map +1 -0
- package/dist/utils/deprecation.d.ts +4 -0
- package/dist/utils/deprecation.d.ts.map +1 -0
- package/dist/utils/deprecation.js +13 -0
- package/dist/utils/deprecation.js.map +1 -0
- package/dist/utils/exif-orientation.d.ts +5 -0
- package/dist/utils/exif-orientation.d.ts.map +1 -0
- package/dist/utils/exif-orientation.js +158 -0
- package/dist/utils/exif-orientation.js.map +1 -0
- package/dist/utils/frontmatter.d.ts +8 -0
- package/dist/utils/frontmatter.d.ts.map +1 -0
- package/dist/utils/frontmatter.js +26 -0
- package/dist/utils/frontmatter.js.map +1 -0
- package/dist/utils/fs-watch.d.ts +5 -0
- package/dist/utils/fs-watch.d.ts.map +1 -0
- package/dist/utils/fs-watch.js +25 -0
- package/dist/utils/fs-watch.js.map +1 -0
- package/dist/utils/git.d.ts +26 -0
- package/dist/utils/git.d.ts.map +1 -0
- package/dist/utils/git.js +195 -0
- package/dist/utils/git.js.map +1 -0
- package/dist/utils/html.d.ts +7 -0
- package/dist/utils/html.d.ts.map +1 -0
- package/dist/utils/html.js +40 -0
- package/dist/utils/html.js.map +1 -0
- package/dist/utils/image-convert.d.ts +10 -0
- package/dist/utils/image-convert.d.ts.map +1 -0
- package/dist/utils/image-convert.js +45 -0
- package/dist/utils/image-convert.js.map +1 -0
- package/dist/utils/image-process.d.ts +18 -0
- package/dist/utils/image-process.d.ts.map +1 -0
- package/dist/utils/image-process.js +83 -0
- package/dist/utils/image-process.js.map +1 -0
- package/dist/utils/image-resize-core.d.ts +30 -0
- package/dist/utils/image-resize-core.d.ts.map +1 -0
- package/dist/utils/image-resize-core.js +124 -0
- package/dist/utils/image-resize-core.js.map +1 -0
- package/dist/utils/image-resize-worker.d.ts +2 -0
- package/dist/utils/image-resize-worker.d.ts.map +1 -0
- package/dist/utils/image-resize-worker.js +31 -0
- package/dist/utils/image-resize-worker.js.map +1 -0
- package/dist/utils/image-resize.d.ts +16 -0
- package/dist/utils/image-resize.d.ts.map +1 -0
- package/dist/utils/image-resize.js +97 -0
- package/dist/utils/image-resize.js.map +1 -0
- package/dist/utils/json.d.ts +3 -0
- package/dist/utils/json.d.ts.map +1 -0
- package/dist/utils/json.js +7 -0
- package/dist/utils/json.js.map +1 -0
- package/dist/utils/mime.d.ts +3 -0
- package/dist/utils/mime.d.ts.map +1 -0
- package/dist/utils/mime.js +110 -0
- package/dist/utils/mime.js.map +1 -0
- package/dist/utils/open-browser.d.ts +9 -0
- package/dist/utils/open-browser.d.ts.map +1 -0
- package/dist/utils/open-browser.js +22 -0
- package/dist/utils/open-browser.js.map +1 -0
- package/dist/utils/paths.d.ts +31 -0
- package/dist/utils/paths.d.ts.map +1 -0
- package/dist/utils/paths.js +92 -0
- package/dist/utils/paths.js.map +1 -0
- package/dist/utils/photon.d.ts +21 -0
- package/dist/utils/photon.d.ts.map +1 -0
- package/dist/utils/photon.js +121 -0
- package/dist/utils/photon.js.map +1 -0
- package/dist/utils/pi-user-agent.d.ts +2 -0
- package/dist/utils/pi-user-agent.d.ts.map +1 -0
- package/dist/utils/pi-user-agent.js +5 -0
- package/dist/utils/pi-user-agent.js.map +1 -0
- package/dist/utils/shell.d.ts +31 -0
- package/dist/utils/shell.d.ts.map +1 -0
- package/dist/utils/shell.js +202 -0
- package/dist/utils/shell.js.map +1 -0
- package/dist/utils/sleep.d.ts +5 -0
- package/dist/utils/sleep.d.ts.map +1 -0
- package/dist/utils/sleep.js +17 -0
- package/dist/utils/sleep.js.map +1 -0
- package/dist/utils/syntax-highlight.d.ts +12 -0
- package/dist/utils/syntax-highlight.d.ts.map +1 -0
- package/dist/utils/syntax-highlight.js +118 -0
- package/dist/utils/syntax-highlight.js.map +1 -0
- package/dist/utils/tools-manager.d.ts +3 -0
- package/dist/utils/tools-manager.d.ts.map +1 -0
- package/dist/utils/tools-manager.js +328 -0
- package/dist/utils/tools-manager.js.map +1 -0
- package/docs/compaction.md +396 -0
- package/docs/containerization.md +111 -0
- package/docs/custom-provider.md +735 -0
- package/docs/development.md +71 -0
- package/docs/docs.json +156 -0
- package/docs/extensions.md +2911 -0
- package/docs/images/doom-extension.png +0 -0
- package/docs/images/exy.png +0 -0
- package/docs/images/interactive-mode.png +0 -0
- package/docs/images/tree-view.png +0 -0
- package/docs/index.md +82 -0
- package/docs/json.md +82 -0
- package/docs/keybindings.md +201 -0
- package/docs/models.md +540 -0
- package/docs/packages.md +228 -0
- package/docs/prompt-templates.md +95 -0
- package/docs/providers.md +294 -0
- package/docs/quickstart.md +165 -0
- package/docs/rpc.md +1480 -0
- package/docs/sdk.md +1183 -0
- package/docs/security.md +59 -0
- package/docs/session-format.md +422 -0
- package/docs/sessions.md +145 -0
- package/docs/settings.md +302 -0
- package/docs/shell-aliases.md +13 -0
- package/docs/skills.md +231 -0
- package/docs/terminal-setup.md +142 -0
- package/docs/termux.md +127 -0
- package/docs/themes.md +297 -0
- package/docs/tmux.md +63 -0
- package/docs/tui.md +927 -0
- package/docs/usage.md +312 -0
- package/docs/windows.md +17 -0
- package/examples/README.md +25 -0
- package/examples/extensions/README.md +213 -0
- package/examples/extensions/auto-commit-on-exit.ts +49 -0
- package/examples/extensions/bash-spawn-hook.ts +30 -0
- package/examples/extensions/bookmark.ts +50 -0
- package/examples/extensions/border-status-editor.ts +150 -0
- package/examples/extensions/built-in-tool-renderer.ts +249 -0
- package/examples/extensions/claude-rules.ts +86 -0
- package/examples/extensions/commands.ts +72 -0
- package/examples/extensions/confirm-destructive.ts +59 -0
- package/examples/extensions/custom-compaction.ts +128 -0
- package/examples/extensions/custom-footer.ts +64 -0
- package/examples/extensions/custom-header.ts +73 -0
- package/examples/extensions/custom-provider-anthropic/index.ts +604 -0
- package/examples/extensions/custom-provider-anthropic/package-lock.json +24 -0
- package/examples/extensions/custom-provider-anthropic/package.json +19 -0
- package/examples/extensions/custom-provider-gitlab-duo/index.ts +404 -0
- package/examples/extensions/custom-provider-gitlab-duo/package.json +16 -0
- package/examples/extensions/custom-provider-gitlab-duo/test.ts +82 -0
- package/examples/extensions/dirty-repo-guard.ts +56 -0
- package/examples/extensions/doom-overlay/README.md +46 -0
- package/examples/extensions/doom-overlay/doom/build/doom.js +21 -0
- package/examples/extensions/doom-overlay/doom/build/doom.wasm +0 -0
- package/examples/extensions/doom-overlay/doom/build.sh +152 -0
- package/examples/extensions/doom-overlay/doom/doomgeneric_pi.c +72 -0
- package/examples/extensions/doom-overlay/doom-component.ts +132 -0
- package/examples/extensions/doom-overlay/doom-engine.ts +173 -0
- package/examples/extensions/doom-overlay/doom-keys.ts +104 -0
- package/examples/extensions/doom-overlay/index.ts +74 -0
- package/examples/extensions/doom-overlay/wad-finder.ts +51 -0
- package/examples/extensions/dynamic-resources/SKILL.md +8 -0
- package/examples/extensions/dynamic-resources/dynamic.json +79 -0
- package/examples/extensions/dynamic-resources/dynamic.md +5 -0
- package/examples/extensions/dynamic-resources/index.ts +15 -0
- package/examples/extensions/dynamic-tools.ts +74 -0
- package/examples/extensions/entry-renderer.ts +41 -0
- package/examples/extensions/event-bus.ts +43 -0
- package/examples/extensions/file-trigger.ts +41 -0
- package/examples/extensions/git-checkpoint.ts +53 -0
- package/examples/extensions/git-merge-and-resolve.ts +115 -0
- package/examples/extensions/github-issue-autocomplete.ts +185 -0
- package/examples/extensions/gondolin/index.ts +531 -0
- package/examples/extensions/gondolin/package-lock.json +185 -0
- package/examples/extensions/gondolin/package.json +19 -0
- package/examples/extensions/handoff.ts +191 -0
- package/examples/extensions/hello.ts +26 -0
- package/examples/extensions/hidden-thinking-label.ts +53 -0
- package/examples/extensions/inline-bash.ts +94 -0
- package/examples/extensions/input-transform-streaming.ts +39 -0
- package/examples/extensions/input-transform.ts +43 -0
- package/examples/extensions/interactive-shell.ts +196 -0
- package/examples/extensions/kimi-deferred-tools.ts +61 -0
- package/examples/extensions/mac-system-theme.ts +47 -0
- package/examples/extensions/message-renderer.ts +59 -0
- package/examples/extensions/minimal-mode.ts +426 -0
- package/examples/extensions/modal-editor.ts +85 -0
- package/examples/extensions/model-status.ts +31 -0
- package/examples/extensions/notify.ts +55 -0
- package/examples/extensions/overlay-qa-tests.ts +1450 -0
- package/examples/extensions/overlay-test.ts +153 -0
- package/examples/extensions/permission-gate.ts +34 -0
- package/examples/extensions/pirate.ts +47 -0
- package/examples/extensions/plan-mode/README.md +66 -0
- package/examples/extensions/plan-mode/index.ts +390 -0
- package/examples/extensions/plan-mode/utils.ts +168 -0
- package/examples/extensions/preset.ts +436 -0
- package/examples/extensions/project-trust.ts +64 -0
- package/examples/extensions/prompt-customizer.ts +97 -0
- package/examples/extensions/protected-paths.ts +30 -0
- package/examples/extensions/provider-payload.ts +18 -0
- package/examples/extensions/qna.ts +122 -0
- package/examples/extensions/question.ts +286 -0
- package/examples/extensions/questionnaire.ts +448 -0
- package/examples/extensions/rainbow-editor.ts +88 -0
- package/examples/extensions/reload-runtime.ts +37 -0
- package/examples/extensions/rpc-demo.ts +118 -0
- package/examples/extensions/sandbox/index.ts +321 -0
- package/examples/extensions/sandbox/package-lock.json +92 -0
- package/examples/extensions/sandbox/package.json +19 -0
- package/examples/extensions/send-user-message.ts +97 -0
- package/examples/extensions/session-name.ts +27 -0
- package/examples/extensions/shutdown-command.ts +63 -0
- package/examples/extensions/snake.ts +343 -0
- package/examples/extensions/space-invaders.ts +560 -0
- package/examples/extensions/ssh.ts +220 -0
- package/examples/extensions/status-line.ts +32 -0
- package/examples/extensions/structured-output.ts +65 -0
- package/examples/extensions/subagent/README.md +175 -0
- package/examples/extensions/subagent/agents/planner.md +37 -0
- package/examples/extensions/subagent/agents/reviewer.md +35 -0
- package/examples/extensions/subagent/agents/scout.md +50 -0
- package/examples/extensions/subagent/agents/worker.md +24 -0
- package/examples/extensions/subagent/agents.ts +126 -0
- package/examples/extensions/subagent/index.ts +1015 -0
- package/examples/extensions/subagent/prompts/implement-and-review.md +10 -0
- package/examples/extensions/subagent/prompts/implement.md +10 -0
- package/examples/extensions/subagent/prompts/scout-and-plan.md +9 -0
- package/examples/extensions/summarize.ts +207 -0
- package/examples/extensions/system-prompt-header.ts +17 -0
- package/examples/extensions/tic-tac-toe.ts +1008 -0
- package/examples/extensions/timed-confirm.ts +70 -0
- package/examples/extensions/titlebar-spinner.ts +58 -0
- package/examples/extensions/todo.ts +297 -0
- package/examples/extensions/tool-override.ts +144 -0
- package/examples/extensions/tools.ts +146 -0
- package/examples/extensions/trigger-compact.ts +50 -0
- package/examples/extensions/truncated-tool.ts +195 -0
- package/examples/extensions/widget-placement.ts +9 -0
- package/examples/extensions/with-deps/index.ts +32 -0
- package/examples/extensions/with-deps/package-lock.json +31 -0
- package/examples/extensions/with-deps/package.json +22 -0
- package/examples/extensions/working-indicator.ts +123 -0
- package/examples/extensions/working-message-test.ts +25 -0
- package/examples/rpc-extension-ui.ts +632 -0
- package/examples/sdk/01-minimal.ts +26 -0
- package/examples/sdk/02-custom-model.ts +50 -0
- package/examples/sdk/03-custom-prompt.ts +75 -0
- package/examples/sdk/04-skills.ts +55 -0
- package/examples/sdk/05-tools.ts +48 -0
- package/examples/sdk/06-extensions.ts +99 -0
- package/examples/sdk/07-context-files.ts +47 -0
- package/examples/sdk/08-prompt-templates.ts +51 -0
- package/examples/sdk/09-api-keys-and-oauth.ts +34 -0
- package/examples/sdk/10-settings.ts +53 -0
- package/examples/sdk/11-sessions.ts +52 -0
- package/examples/sdk/12-full-control.ts +72 -0
- package/examples/sdk/13-session-runtime.ts +67 -0
- package/examples/sdk/README.md +140 -0
- package/package.json +116 -0
|
@@ -0,0 +1,2347 @@
|
|
|
1
|
+
var __rewriteRelativeImportExtension = (this && this.__rewriteRelativeImportExtension) || function (path, preserveJsx) {
|
|
2
|
+
if (typeof path === "string" && /^\.\.?\//.test(path)) {
|
|
3
|
+
return path.replace(/\.(tsx)$|((?:\.d)?)((?:\.[^./]+?)?)\.([cm]?)ts$/i, function (m, tsx, d, ext, cm) {
|
|
4
|
+
return tsx ? preserveJsx ? ".jsx" : ".js" : d && (!ext || !cm) ? m : (d + ext + "." + cm.toLowerCase() + "js");
|
|
5
|
+
});
|
|
6
|
+
}
|
|
7
|
+
return path;
|
|
8
|
+
};
|
|
9
|
+
import { Box, Text, truncateToWidth } from "@earendil-works/pi-tui";
|
|
10
|
+
import { Type } from "typebox";
|
|
11
|
+
import { StringEnum, complete } from "@earendil-works/pi-ai/compat";
|
|
12
|
+
import { fetchAllContent } from "./extract.js";
|
|
13
|
+
import { normalizeFetchContentParams } from "./fetch-params.js";
|
|
14
|
+
import { clearCloneCache } from "./github-extract.js";
|
|
15
|
+
import { search } from "./gemini-search.js";
|
|
16
|
+
import { formatSeconds, getWebSearchConfigDir, getWebSearchConfigPath } from "./utils.js";
|
|
17
|
+
import { clearResults, deleteResult, generateId, getAllResults, getResult, restoreFromSession, storeResult, } from "./storage.js";
|
|
18
|
+
import { activityMonitor } from "./activity.js";
|
|
19
|
+
import { startCuratorServer } from "./curator-server.js";
|
|
20
|
+
import { buildDeterministicSummary, generateSummaryDraft, } from "./summary-review.js";
|
|
21
|
+
import { randomUUID } from "node:crypto";
|
|
22
|
+
import { execFileSync } from "node:child_process";
|
|
23
|
+
import { createRequire } from "node:module";
|
|
24
|
+
import { platform } from "node:os";
|
|
25
|
+
import { existsSync, readFileSync, writeFileSync, mkdirSync } from "node:fs";
|
|
26
|
+
import { join } from "node:path";
|
|
27
|
+
import { isPerplexityAvailable } from "./perplexity.js";
|
|
28
|
+
import { isExaAvailable } from "./exa.js";
|
|
29
|
+
import { isGeminiApiAvailable } from "./gemini-api.js";
|
|
30
|
+
import { getActiveGoogleEmail, isGeminiWebAvailable } from "./gemini-web.js";
|
|
31
|
+
import { isBrowserCookieAccessAllowed } from "./gemini-web-config.js";
|
|
32
|
+
import { isBraveAvailable } from "./brave.js";
|
|
33
|
+
import { isOpenAISearchAvailable } from "./openai-search.js";
|
|
34
|
+
import { isParallelAvailable } from "./parallel.js";
|
|
35
|
+
import { isTavilyAvailable } from "./tavily.js";
|
|
36
|
+
import { buildSearchErrorPlan } from "./render-search-error.js";
|
|
37
|
+
import { loadEnabledModelPatterns, modelMatchesEnabledPatterns } from "./summary-model-scope.js";
|
|
38
|
+
const WEB_SEARCH_CONFIG_PATH = getWebSearchConfigPath();
|
|
39
|
+
/** Shared collapsed/expanded renderer for an error/cancel plan produced by
|
|
40
|
+
* buildSearchErrorPlan(). Used by every tool renderResult's error branch so
|
|
41
|
+
* Ctrl+O (app.tools.expand) reveals diagnostics instead of a dead-end single line. */
|
|
42
|
+
function renderSearchErrorPlan(plan, expanded, theme) {
|
|
43
|
+
if (expanded) {
|
|
44
|
+
return new Text(plan.expanded.map((l, i) => i === 0 ? theme.fg("error", l) : theme.fg("toolOutput", l)).join("\n"), 0, 0);
|
|
45
|
+
}
|
|
46
|
+
const box = new Box(1, 0, (t) => theme.bg("toolErrorBg", t));
|
|
47
|
+
box.addChild(new Text(theme.fg("error", plan.expanded[0]), 0, 0));
|
|
48
|
+
for (const line of plan.collapsed) {
|
|
49
|
+
box.addChild(new Text(theme.fg("dim", line), 0, 0));
|
|
50
|
+
}
|
|
51
|
+
if (plan.expandHint) {
|
|
52
|
+
box.addChild(new Text(theme.fg("muted", plan.expandHint), 0, 0));
|
|
53
|
+
}
|
|
54
|
+
return box;
|
|
55
|
+
}
|
|
56
|
+
function loadConfig() {
|
|
57
|
+
if (!existsSync(WEB_SEARCH_CONFIG_PATH))
|
|
58
|
+
return {};
|
|
59
|
+
const raw = readFileSync(WEB_SEARCH_CONFIG_PATH, "utf-8");
|
|
60
|
+
try {
|
|
61
|
+
return JSON.parse(raw);
|
|
62
|
+
}
|
|
63
|
+
catch (err) {
|
|
64
|
+
const message = err instanceof Error ? err.message : String(err);
|
|
65
|
+
throw new Error(`Failed to parse ${WEB_SEARCH_CONFIG_PATH}: ${message}`);
|
|
66
|
+
}
|
|
67
|
+
}
|
|
68
|
+
function saveConfig(updates) {
|
|
69
|
+
let config = {};
|
|
70
|
+
if (existsSync(WEB_SEARCH_CONFIG_PATH)) {
|
|
71
|
+
const raw = readFileSync(WEB_SEARCH_CONFIG_PATH, "utf-8");
|
|
72
|
+
try {
|
|
73
|
+
config = JSON.parse(raw);
|
|
74
|
+
}
|
|
75
|
+
catch (err) {
|
|
76
|
+
const message = err instanceof Error ? err.message : String(err);
|
|
77
|
+
throw new Error(`Failed to parse ${WEB_SEARCH_CONFIG_PATH}: ${message}`);
|
|
78
|
+
}
|
|
79
|
+
}
|
|
80
|
+
Object.assign(config, updates);
|
|
81
|
+
const dir = getWebSearchConfigDir();
|
|
82
|
+
if (!existsSync(dir))
|
|
83
|
+
mkdirSync(dir, { recursive: true });
|
|
84
|
+
writeFileSync(WEB_SEARCH_CONFIG_PATH, JSON.stringify(config, null, 2) + "\n");
|
|
85
|
+
}
|
|
86
|
+
const DEFAULT_SHORTCUTS = { curate: "ctrl+shift+s", activity: "ctrl+shift+w" };
|
|
87
|
+
const DEFAULT_CURATOR_TIMEOUT_SECONDS = 20;
|
|
88
|
+
const MAX_CURATOR_TIMEOUT_SECONDS = 600;
|
|
89
|
+
function loadConfigForExtensionInit() {
|
|
90
|
+
try {
|
|
91
|
+
return loadConfig();
|
|
92
|
+
}
|
|
93
|
+
catch (err) {
|
|
94
|
+
const message = err instanceof Error ? err.message : String(err);
|
|
95
|
+
console.error(`[pi-web-access] ${message}`);
|
|
96
|
+
return {};
|
|
97
|
+
}
|
|
98
|
+
}
|
|
99
|
+
function normalizeProviderInput(value) {
|
|
100
|
+
if (value === undefined)
|
|
101
|
+
return undefined;
|
|
102
|
+
if (typeof value !== "string")
|
|
103
|
+
return "auto";
|
|
104
|
+
const normalized = value.trim().toLowerCase();
|
|
105
|
+
const valid = ["auto", "openai", "brave", "parallel", "tavily", "exa", "perplexity", "gemini"];
|
|
106
|
+
return valid.includes(normalized) ? normalized : "auto";
|
|
107
|
+
}
|
|
108
|
+
function normalizeCuratorTimeoutSeconds(value) {
|
|
109
|
+
if (typeof value !== "number" || !Number.isFinite(value))
|
|
110
|
+
return undefined;
|
|
111
|
+
const normalized = Math.floor(value);
|
|
112
|
+
if (normalized < 1)
|
|
113
|
+
return undefined;
|
|
114
|
+
return Math.min(normalized, MAX_CURATOR_TIMEOUT_SECONDS);
|
|
115
|
+
}
|
|
116
|
+
function resolveWorkflow(input, hasUI) {
|
|
117
|
+
const normalized = typeof input === "string" ? input.trim().toLowerCase() : "";
|
|
118
|
+
if (normalized === "auto-summary")
|
|
119
|
+
return "auto-summary";
|
|
120
|
+
if (!hasUI)
|
|
121
|
+
return "none";
|
|
122
|
+
if (normalized === "none")
|
|
123
|
+
return "none";
|
|
124
|
+
return "summary-review";
|
|
125
|
+
}
|
|
126
|
+
function normalizeQueryList(queryList) {
|
|
127
|
+
const normalized = [];
|
|
128
|
+
for (const query of queryList) {
|
|
129
|
+
if (typeof query !== "string")
|
|
130
|
+
continue;
|
|
131
|
+
const trimmed = query.trim();
|
|
132
|
+
if (trimmed.length > 0)
|
|
133
|
+
normalized.push(trimmed);
|
|
134
|
+
}
|
|
135
|
+
return normalized;
|
|
136
|
+
}
|
|
137
|
+
function getCuratorTimeoutSeconds() {
|
|
138
|
+
const source = loadConfig();
|
|
139
|
+
return normalizeCuratorTimeoutSeconds(source.curatorTimeoutSeconds) ?? DEFAULT_CURATOR_TIMEOUT_SECONDS;
|
|
140
|
+
}
|
|
141
|
+
async function getProviderAvailability(ctx) {
|
|
142
|
+
const geminiWebAvail = await isGeminiWebAvailable();
|
|
143
|
+
return {
|
|
144
|
+
openai: await isOpenAISearchAvailable(ctx),
|
|
145
|
+
brave: isBraveAvailable(),
|
|
146
|
+
parallel: isParallelAvailable(),
|
|
147
|
+
tavily: isTavilyAvailable(),
|
|
148
|
+
perplexity: isPerplexityAvailable(),
|
|
149
|
+
exa: isExaAvailable(),
|
|
150
|
+
gemini: isGeminiApiAvailable() || !!geminiWebAvail,
|
|
151
|
+
};
|
|
152
|
+
}
|
|
153
|
+
function shouldPreferOpenAI(options) {
|
|
154
|
+
if (!options)
|
|
155
|
+
return true;
|
|
156
|
+
if (options.recencyFilter)
|
|
157
|
+
return false;
|
|
158
|
+
if (typeof options.numResults === "number" && Number.isFinite(options.numResults) && Math.floor(options.numResults) !== 5) {
|
|
159
|
+
return false;
|
|
160
|
+
}
|
|
161
|
+
return true;
|
|
162
|
+
}
|
|
163
|
+
async function loadCuratorBootstrap(requestedProvider, ctx, options) {
|
|
164
|
+
const availableProviders = await getProviderAvailability(ctx);
|
|
165
|
+
return {
|
|
166
|
+
availableProviders,
|
|
167
|
+
defaultProvider: resolveProvider(requestedProvider, availableProviders, options),
|
|
168
|
+
timeoutSeconds: getCuratorTimeoutSeconds(),
|
|
169
|
+
};
|
|
170
|
+
}
|
|
171
|
+
function firstAvailableProvider(available, preferOpenAI, fallback) {
|
|
172
|
+
if (preferOpenAI && available.openai)
|
|
173
|
+
return "openai";
|
|
174
|
+
if (available.exa)
|
|
175
|
+
return "exa";
|
|
176
|
+
if (available.brave)
|
|
177
|
+
return "brave";
|
|
178
|
+
if (available.parallel)
|
|
179
|
+
return "parallel";
|
|
180
|
+
if (available.tavily)
|
|
181
|
+
return "tavily";
|
|
182
|
+
if (available.perplexity)
|
|
183
|
+
return "perplexity";
|
|
184
|
+
if (available.gemini)
|
|
185
|
+
return "gemini";
|
|
186
|
+
return fallback;
|
|
187
|
+
}
|
|
188
|
+
function resolveProvider(requested, available, options) {
|
|
189
|
+
const provider = normalizeProviderInput(requested ?? loadConfig().provider ?? "auto") ?? "auto";
|
|
190
|
+
const preferOpenAI = shouldPreferOpenAI(options);
|
|
191
|
+
if (provider === "auto") {
|
|
192
|
+
return firstAvailableProvider(available, preferOpenAI, "exa");
|
|
193
|
+
}
|
|
194
|
+
if (provider === "openai" && !available.openai) {
|
|
195
|
+
return firstAvailableProvider(available, false, "openai");
|
|
196
|
+
}
|
|
197
|
+
if (provider === "brave" && !available.brave) {
|
|
198
|
+
return firstAvailableProvider(available, preferOpenAI, "brave");
|
|
199
|
+
}
|
|
200
|
+
if (provider === "parallel" && !available.parallel) {
|
|
201
|
+
return firstAvailableProvider(available, preferOpenAI, "parallel");
|
|
202
|
+
}
|
|
203
|
+
if (provider === "tavily" && !available.tavily) {
|
|
204
|
+
return firstAvailableProvider(available, preferOpenAI, "tavily");
|
|
205
|
+
}
|
|
206
|
+
if (provider === "exa" && !available.exa) {
|
|
207
|
+
return firstAvailableProvider(available, preferOpenAI, "exa");
|
|
208
|
+
}
|
|
209
|
+
if (provider === "perplexity" && !available.perplexity) {
|
|
210
|
+
return firstAvailableProvider(available, preferOpenAI, "perplexity");
|
|
211
|
+
}
|
|
212
|
+
if (provider === "gemini" && !available.gemini) {
|
|
213
|
+
return firstAvailableProvider(available, preferOpenAI, "gemini");
|
|
214
|
+
}
|
|
215
|
+
return provider;
|
|
216
|
+
}
|
|
217
|
+
const pendingFetches = new Map();
|
|
218
|
+
let sessionActive = false;
|
|
219
|
+
let widgetVisible = false;
|
|
220
|
+
let widgetUnsubscribe = null;
|
|
221
|
+
const pendingCurates = new Map();
|
|
222
|
+
const activeCurators = new Map();
|
|
223
|
+
const glimpseWins = new Map();
|
|
224
|
+
const MAX_INLINE_CONTENT = 30000; // Content returned directly to agent
|
|
225
|
+
function stripThumbnails(results) {
|
|
226
|
+
return results.map(({ thumbnail, frames, ...rest }) => rest);
|
|
227
|
+
}
|
|
228
|
+
function formatSearchSummary(results, answer) {
|
|
229
|
+
let output = answer ? `${answer}\n\n---\n\n**Sources:**\n` : "";
|
|
230
|
+
output += results.map((r, i) => `${i + 1}. ${r.title}\n ${r.url}`).join("\n\n");
|
|
231
|
+
return output;
|
|
232
|
+
}
|
|
233
|
+
function duplicateQuerySet(results) {
|
|
234
|
+
const counts = new Map();
|
|
235
|
+
for (const result of results) {
|
|
236
|
+
counts.set(result.query, (counts.get(result.query) ?? 0) + 1);
|
|
237
|
+
}
|
|
238
|
+
const duplicates = new Set();
|
|
239
|
+
for (const [query, count] of counts) {
|
|
240
|
+
if (count > 1)
|
|
241
|
+
duplicates.add(query);
|
|
242
|
+
}
|
|
243
|
+
return duplicates;
|
|
244
|
+
}
|
|
245
|
+
function formatQueryHeader(query, provider, duplicateQueries) {
|
|
246
|
+
const suffix = duplicateQueries.has(query) && provider ? ` (${provider})` : "";
|
|
247
|
+
return `## Query: "${query}"${suffix}\n\n`;
|
|
248
|
+
}
|
|
249
|
+
function hasFullInlineCoverage(urls, inlineContent) {
|
|
250
|
+
if (!inlineContent || inlineContent.length === 0)
|
|
251
|
+
return false;
|
|
252
|
+
const coveredUrls = new Set(inlineContent.map(c => c.url));
|
|
253
|
+
return urls.every(url => coveredUrls.has(url));
|
|
254
|
+
}
|
|
255
|
+
function formatFullResults(queryData) {
|
|
256
|
+
let output = `## Results for: "${queryData.query}"\n\n`;
|
|
257
|
+
if (queryData.answer) {
|
|
258
|
+
output += `${queryData.answer}\n\n---\n\n`;
|
|
259
|
+
}
|
|
260
|
+
for (const r of queryData.results) {
|
|
261
|
+
output += `### ${r.title}\n${r.url}\n\n`;
|
|
262
|
+
}
|
|
263
|
+
return output;
|
|
264
|
+
}
|
|
265
|
+
function abortPendingFetches() {
|
|
266
|
+
for (const controller of pendingFetches.values()) {
|
|
267
|
+
controller.abort();
|
|
268
|
+
}
|
|
269
|
+
pendingFetches.clear();
|
|
270
|
+
}
|
|
271
|
+
function closeCurator(callId) {
|
|
272
|
+
if (callId !== undefined) {
|
|
273
|
+
const win = glimpseWins.get(callId);
|
|
274
|
+
glimpseWins.delete(callId);
|
|
275
|
+
try {
|
|
276
|
+
win?.close();
|
|
277
|
+
}
|
|
278
|
+
catch { }
|
|
279
|
+
pendingCurates.get(callId)?.cancel("stale");
|
|
280
|
+
pendingCurates.delete(callId);
|
|
281
|
+
const curator = activeCurators.get(callId);
|
|
282
|
+
activeCurators.delete(callId);
|
|
283
|
+
try {
|
|
284
|
+
curator?.close();
|
|
285
|
+
}
|
|
286
|
+
catch { }
|
|
287
|
+
return;
|
|
288
|
+
}
|
|
289
|
+
for (const win of glimpseWins.values()) {
|
|
290
|
+
try {
|
|
291
|
+
win.close();
|
|
292
|
+
}
|
|
293
|
+
catch { }
|
|
294
|
+
}
|
|
295
|
+
glimpseWins.clear();
|
|
296
|
+
for (const pc of pendingCurates.values()) {
|
|
297
|
+
try {
|
|
298
|
+
pc.cancel("stale");
|
|
299
|
+
}
|
|
300
|
+
catch { }
|
|
301
|
+
}
|
|
302
|
+
pendingCurates.clear();
|
|
303
|
+
for (const curator of activeCurators.values()) {
|
|
304
|
+
try {
|
|
305
|
+
curator.close();
|
|
306
|
+
}
|
|
307
|
+
catch { }
|
|
308
|
+
}
|
|
309
|
+
activeCurators.clear();
|
|
310
|
+
}
|
|
311
|
+
async function openInBrowser(pi, url) {
|
|
312
|
+
const plat = platform();
|
|
313
|
+
const result = plat === "darwin"
|
|
314
|
+
? await pi.exec("open", [url])
|
|
315
|
+
: plat === "win32"
|
|
316
|
+
? await pi.exec("cmd", ["/c", "start", "", url])
|
|
317
|
+
: await pi.exec("xdg-open", [url]);
|
|
318
|
+
if (result.code !== 0) {
|
|
319
|
+
throw new Error(result.stderr || `Failed to open browser (exit code ${result.code})`);
|
|
320
|
+
}
|
|
321
|
+
}
|
|
322
|
+
let glimpseOpen;
|
|
323
|
+
function findGlimpseMjs() {
|
|
324
|
+
try {
|
|
325
|
+
const req = createRequire(import.meta.url);
|
|
326
|
+
return req.resolve("glimpseui");
|
|
327
|
+
}
|
|
328
|
+
catch {
|
|
329
|
+
// Optional dependency.
|
|
330
|
+
}
|
|
331
|
+
try {
|
|
332
|
+
const globalRoot = execFileSync("npm", ["root", "-g"], { encoding: "utf-8" }).trim();
|
|
333
|
+
const entry = join(globalRoot, "glimpseui", "src", "glimpse.mjs");
|
|
334
|
+
if (existsSync(entry))
|
|
335
|
+
return entry;
|
|
336
|
+
}
|
|
337
|
+
catch {
|
|
338
|
+
// npm may be unavailable.
|
|
339
|
+
}
|
|
340
|
+
return null;
|
|
341
|
+
}
|
|
342
|
+
async function getGlimpseOpen() {
|
|
343
|
+
if (glimpseOpen !== undefined)
|
|
344
|
+
return glimpseOpen;
|
|
345
|
+
const resolved = findGlimpseMjs();
|
|
346
|
+
if (resolved) {
|
|
347
|
+
try {
|
|
348
|
+
glimpseOpen = (await import(__rewriteRelativeImportExtension(resolved))).open;
|
|
349
|
+
return glimpseOpen;
|
|
350
|
+
}
|
|
351
|
+
catch { }
|
|
352
|
+
}
|
|
353
|
+
glimpseOpen = null;
|
|
354
|
+
return glimpseOpen;
|
|
355
|
+
}
|
|
356
|
+
function openInGlimpse(open, url, title) {
|
|
357
|
+
const shellHTML = `<!DOCTYPE html>
|
|
358
|
+
<html>
|
|
359
|
+
<head><meta charset="UTF-8"><title>${title}</title></head>
|
|
360
|
+
<body style="margin:0; background:#1a1a2e;">
|
|
361
|
+
<script>window.location.replace(${JSON.stringify(url)});</script>
|
|
362
|
+
</body>
|
|
363
|
+
</html>`;
|
|
364
|
+
const win = open(shellHTML, {
|
|
365
|
+
width: 800,
|
|
366
|
+
height: 900,
|
|
367
|
+
title,
|
|
368
|
+
});
|
|
369
|
+
let maxHeight = 1200;
|
|
370
|
+
win.on("ready", (info) => {
|
|
371
|
+
const visibleHeight = info?.screen?.visibleHeight;
|
|
372
|
+
if (typeof visibleHeight === "number" && visibleHeight > 0) {
|
|
373
|
+
maxHeight = Math.floor(visibleHeight * 0.85);
|
|
374
|
+
}
|
|
375
|
+
});
|
|
376
|
+
win.on("message", (data) => {
|
|
377
|
+
if (!data || typeof data !== "object")
|
|
378
|
+
return;
|
|
379
|
+
const msg = data;
|
|
380
|
+
if (msg.type !== "resize" || typeof msg.height !== "number")
|
|
381
|
+
return;
|
|
382
|
+
const clamped = Math.max(400, Math.min(Math.round(msg.height), maxHeight));
|
|
383
|
+
win._write({ type: "resize", width: 800, height: clamped });
|
|
384
|
+
});
|
|
385
|
+
return win;
|
|
386
|
+
}
|
|
387
|
+
function extractDomain(url) {
|
|
388
|
+
try {
|
|
389
|
+
return new URL(url).hostname;
|
|
390
|
+
}
|
|
391
|
+
catch {
|
|
392
|
+
return url;
|
|
393
|
+
}
|
|
394
|
+
}
|
|
395
|
+
function updateWidget(ctx) {
|
|
396
|
+
const theme = ctx.ui.theme;
|
|
397
|
+
const entries = activityMonitor.getEntries();
|
|
398
|
+
const lines = [];
|
|
399
|
+
lines.push(theme.fg("accent", "─── Web Search Activity " + "─".repeat(36)));
|
|
400
|
+
if (entries.length === 0) {
|
|
401
|
+
lines.push(theme.fg("muted", " No activity yet"));
|
|
402
|
+
}
|
|
403
|
+
else {
|
|
404
|
+
for (const e of entries) {
|
|
405
|
+
lines.push(" " + formatEntryLine(e, theme));
|
|
406
|
+
}
|
|
407
|
+
}
|
|
408
|
+
lines.push(theme.fg("accent", "─".repeat(60)));
|
|
409
|
+
const rateInfo = activityMonitor.getRateLimitInfo();
|
|
410
|
+
const resetMs = rateInfo.oldestTimestamp ? Math.max(0, rateInfo.oldestTimestamp + rateInfo.windowMs - Date.now()) : 0;
|
|
411
|
+
const resetSec = Math.ceil(resetMs / 1000);
|
|
412
|
+
lines.push(theme.fg("muted", `Rate: ${rateInfo.used}/${rateInfo.max}`) +
|
|
413
|
+
(resetMs > 0 ? theme.fg("dim", ` (resets in ${resetSec}s)`) : ""));
|
|
414
|
+
ctx.ui.setWidget("web-activity", new Text(lines.join("\n"), 0, 0));
|
|
415
|
+
}
|
|
416
|
+
function formatEntryLine(entry, theme) {
|
|
417
|
+
const typeStr = entry.type === "api" ? "API" : "GET";
|
|
418
|
+
const target = entry.type === "api"
|
|
419
|
+
? `"${truncateToWidth(entry.query || "", 28, "")}"`
|
|
420
|
+
: truncateToWidth(entry.url?.replace(/^https?:\/\//, "") || "", 30, "");
|
|
421
|
+
const duration = entry.endTime
|
|
422
|
+
? `${((entry.endTime - entry.startTime) / 1000).toFixed(1)}s`
|
|
423
|
+
: `${((Date.now() - entry.startTime) / 1000).toFixed(1)}s`;
|
|
424
|
+
let statusStr;
|
|
425
|
+
let indicator;
|
|
426
|
+
if (entry.error) {
|
|
427
|
+
statusStr = "err";
|
|
428
|
+
indicator = theme.fg("error", "✗");
|
|
429
|
+
}
|
|
430
|
+
else if (entry.status === null) {
|
|
431
|
+
statusStr = "...";
|
|
432
|
+
indicator = theme.fg("warning", "⋯");
|
|
433
|
+
}
|
|
434
|
+
else if (entry.status === 0) {
|
|
435
|
+
statusStr = "abort";
|
|
436
|
+
indicator = theme.fg("muted", "○");
|
|
437
|
+
}
|
|
438
|
+
else {
|
|
439
|
+
statusStr = String(entry.status);
|
|
440
|
+
indicator = entry.status >= 200 && entry.status < 300 ? theme.fg("success", "✓") : theme.fg("error", "✗");
|
|
441
|
+
}
|
|
442
|
+
return `${typeStr.padEnd(4)} ${target.padEnd(32)} ${statusStr.padStart(5)} ${duration.padStart(5)} ${indicator}`;
|
|
443
|
+
}
|
|
444
|
+
function handleSessionChange(ctx) {
|
|
445
|
+
abortPendingFetches();
|
|
446
|
+
closeCurator();
|
|
447
|
+
clearCloneCache();
|
|
448
|
+
sessionActive = true;
|
|
449
|
+
restoreFromSession(ctx);
|
|
450
|
+
// Unsubscribe before clear() to avoid callback with stale ctx
|
|
451
|
+
widgetUnsubscribe?.();
|
|
452
|
+
widgetUnsubscribe = null;
|
|
453
|
+
activityMonitor.clear();
|
|
454
|
+
if (widgetVisible) {
|
|
455
|
+
// Re-subscribe with new ctx
|
|
456
|
+
widgetUnsubscribe = activityMonitor.onUpdate(() => updateWidget(ctx));
|
|
457
|
+
updateWidget(ctx);
|
|
458
|
+
}
|
|
459
|
+
}
|
|
460
|
+
export default function (pi) {
|
|
461
|
+
const initConfig = loadConfigForExtensionInit();
|
|
462
|
+
const curateKey = initConfig.shortcuts?.curate || DEFAULT_SHORTCUTS.curate;
|
|
463
|
+
const activityKey = initConfig.shortcuts?.activity || DEFAULT_SHORTCUTS.activity;
|
|
464
|
+
// lunr: expose curator workflow state to core (/settings "Extensions" submenu)
|
|
465
|
+
// so the /settings toggle writes through the same web-search.json saveConfig
|
|
466
|
+
// path as /curator — single source of truth, no forked state.
|
|
467
|
+
globalThis[Symbol.for("@lunr/search-curator")] = {
|
|
468
|
+
getWorkflow() {
|
|
469
|
+
return resolveWorkflow(loadConfigForExtensionInit().workflow, true);
|
|
470
|
+
},
|
|
471
|
+
setWorkflow(workflow) {
|
|
472
|
+
saveConfig({ workflow });
|
|
473
|
+
},
|
|
474
|
+
};
|
|
475
|
+
function startBackgroundFetch(urls) {
|
|
476
|
+
if (urls.length === 0)
|
|
477
|
+
return null;
|
|
478
|
+
const fetchId = generateId();
|
|
479
|
+
const controller = new AbortController();
|
|
480
|
+
pendingFetches.set(fetchId, controller);
|
|
481
|
+
fetchAllContent(urls, controller.signal)
|
|
482
|
+
.then((fetched) => {
|
|
483
|
+
if (!sessionActive || !pendingFetches.has(fetchId))
|
|
484
|
+
return;
|
|
485
|
+
const data = {
|
|
486
|
+
id: fetchId,
|
|
487
|
+
type: "fetch",
|
|
488
|
+
timestamp: Date.now(),
|
|
489
|
+
urls: stripThumbnails(fetched),
|
|
490
|
+
};
|
|
491
|
+
storeResult(fetchId, data);
|
|
492
|
+
pi.appendEntry("web-search-results", data);
|
|
493
|
+
const ok = fetched.filter(f => !f.error).length;
|
|
494
|
+
pi.sendMessage({
|
|
495
|
+
customType: "web-search-content-ready",
|
|
496
|
+
content: `Content fetched for ${ok}/${fetched.length} URLs [${fetchId}]. Full page content now available.`,
|
|
497
|
+
display: true,
|
|
498
|
+
}, { triggerTurn: true });
|
|
499
|
+
})
|
|
500
|
+
.catch((err) => {
|
|
501
|
+
if (!sessionActive || !pendingFetches.has(fetchId))
|
|
502
|
+
return;
|
|
503
|
+
const message = err instanceof Error ? err.message : String(err);
|
|
504
|
+
const isAbort = (err instanceof Error && err.name === "AbortError") || message.toLowerCase().includes("abort");
|
|
505
|
+
if (!isAbort) {
|
|
506
|
+
pi.sendMessage({
|
|
507
|
+
customType: "web-search-error",
|
|
508
|
+
content: `Content fetch failed [${fetchId}]: ${message}`,
|
|
509
|
+
display: true,
|
|
510
|
+
}, { triggerTurn: false });
|
|
511
|
+
}
|
|
512
|
+
})
|
|
513
|
+
.finally(() => { pendingFetches.delete(fetchId); });
|
|
514
|
+
return fetchId;
|
|
515
|
+
}
|
|
516
|
+
function storeAndPublishSearch(results) {
|
|
517
|
+
const id = generateId();
|
|
518
|
+
const data = {
|
|
519
|
+
id, type: "search", timestamp: Date.now(), queries: results,
|
|
520
|
+
};
|
|
521
|
+
storeResult(id, data);
|
|
522
|
+
pi.appendEntry("web-search-results", data);
|
|
523
|
+
return id;
|
|
524
|
+
}
|
|
525
|
+
function normalizeSummaryMeta(meta, summaryText) {
|
|
526
|
+
const normalizedText = summaryText.trim();
|
|
527
|
+
if (!meta) {
|
|
528
|
+
return {
|
|
529
|
+
model: null,
|
|
530
|
+
durationMs: 0,
|
|
531
|
+
tokenEstimate: normalizedText.length > 0 ? Math.max(1, Math.ceil(normalizedText.length / 4)) : 0,
|
|
532
|
+
fallbackUsed: false,
|
|
533
|
+
edited: false,
|
|
534
|
+
};
|
|
535
|
+
}
|
|
536
|
+
return {
|
|
537
|
+
model: meta.model,
|
|
538
|
+
durationMs: Number.isFinite(meta.durationMs) && meta.durationMs >= 0 ? meta.durationMs : 0,
|
|
539
|
+
tokenEstimate: Number.isFinite(meta.tokenEstimate) && meta.tokenEstimate >= 0
|
|
540
|
+
? meta.tokenEstimate
|
|
541
|
+
: (normalizedText.length > 0 ? Math.max(1, Math.ceil(normalizedText.length / 4)) : 0),
|
|
542
|
+
fallbackUsed: meta.fallbackUsed === true,
|
|
543
|
+
fallbackReason: meta.fallbackReason,
|
|
544
|
+
edited: meta.edited === true,
|
|
545
|
+
};
|
|
546
|
+
}
|
|
547
|
+
function buildCurationCancelledReturn(reason, partial) {
|
|
548
|
+
const message = `Search curation cancelled (${reason}).`;
|
|
549
|
+
const cancelledQueries = partial?.queries?.length
|
|
550
|
+
? partial.queries.map(q => ({
|
|
551
|
+
query: q.query,
|
|
552
|
+
provider: q.provider ?? null,
|
|
553
|
+
error: q.error,
|
|
554
|
+
resultCount: q.results?.length ?? 0,
|
|
555
|
+
}))
|
|
556
|
+
: undefined;
|
|
557
|
+
const extraLines = [];
|
|
558
|
+
if (partial?.curatorUrl)
|
|
559
|
+
extraLines.push(`curator: ${partial.curatorUrl}`);
|
|
560
|
+
if (partial?.browserOpenError)
|
|
561
|
+
extraLines.push(`browser open error: ${partial.browserOpenError}`);
|
|
562
|
+
return {
|
|
563
|
+
content: [{ type: "text", text: message }],
|
|
564
|
+
details: {
|
|
565
|
+
error: message,
|
|
566
|
+
cancelled: true,
|
|
567
|
+
cancelReason: reason,
|
|
568
|
+
browserConnected: partial?.browserConnected,
|
|
569
|
+
lastHeartbeatAgeMs: partial?.lastHeartbeatAgeMs,
|
|
570
|
+
queryCount: partial?.queryCount,
|
|
571
|
+
cancelledQueries,
|
|
572
|
+
extraLines: extraLines.length > 0 ? extraLines : undefined,
|
|
573
|
+
},
|
|
574
|
+
};
|
|
575
|
+
}
|
|
576
|
+
async function resolveFirstAvailableModel(ctx, candidates) {
|
|
577
|
+
const enabledModelPatterns = loadEnabledModelPatterns(ctx);
|
|
578
|
+
for (const { provider, id } of candidates) {
|
|
579
|
+
const model = ctx.modelRegistry.find(provider, id);
|
|
580
|
+
if (!model || !modelMatchesEnabledPatterns(model, enabledModelPatterns))
|
|
581
|
+
continue;
|
|
582
|
+
const auth = await ctx.modelRegistry.getApiKeyAndHeaders(model);
|
|
583
|
+
if (auth.ok && auth.apiKey)
|
|
584
|
+
return { model, apiKey: auth.apiKey, headers: auth.headers };
|
|
585
|
+
}
|
|
586
|
+
throw new Error(`No enabled model available: ${candidates.map(c => `${c.provider}/${c.id}`).join(", ")}`);
|
|
587
|
+
}
|
|
588
|
+
async function rewriteSearchQuery(query, ctx, signal) {
|
|
589
|
+
const { model, apiKey, headers } = await resolveFirstAvailableModel(ctx, [
|
|
590
|
+
{ provider: "anthropic", id: "claude-haiku-4-5" },
|
|
591
|
+
{ provider: "google", id: "gemini-2.5-flash" },
|
|
592
|
+
{ provider: "openai", id: "gpt-4.1-mini" },
|
|
593
|
+
]);
|
|
594
|
+
const response = await complete(model, {
|
|
595
|
+
messages: [{
|
|
596
|
+
role: "user",
|
|
597
|
+
content: [{ type: "text", text: `Rewrite this web search query to get better, more specific results. Add relevant year qualifiers, precise technical terms, and specificity. Return ONLY the improved query text, nothing else.\n\nQuery: ${query}` }],
|
|
598
|
+
timestamp: Date.now(),
|
|
599
|
+
}],
|
|
600
|
+
}, { apiKey, headers, signal });
|
|
601
|
+
if (response.stopReason === "aborted")
|
|
602
|
+
throw new Error("Aborted");
|
|
603
|
+
const contentParts = Array.isArray(response.content) ? response.content : [];
|
|
604
|
+
const text = contentParts
|
|
605
|
+
.map(p => {
|
|
606
|
+
if (!p || typeof p !== "object")
|
|
607
|
+
return "";
|
|
608
|
+
const part = p;
|
|
609
|
+
return typeof part.text === "string" ? part.text : "";
|
|
610
|
+
})
|
|
611
|
+
.join("")
|
|
612
|
+
.trim();
|
|
613
|
+
if (!text)
|
|
614
|
+
throw new Error("Rewrite returned empty response");
|
|
615
|
+
return text;
|
|
616
|
+
}
|
|
617
|
+
async function generateSummaryForSelectedIndices(selectedQueryIndices, resultsByIndex, summaryContext, signal, modelOverride, feedback) {
|
|
618
|
+
const selectedResults = [];
|
|
619
|
+
for (const qi of selectedQueryIndices) {
|
|
620
|
+
const result = resultsByIndex.get(qi);
|
|
621
|
+
if (result)
|
|
622
|
+
selectedResults.push(result);
|
|
623
|
+
}
|
|
624
|
+
if (selectedResults.length === 0) {
|
|
625
|
+
throw new Error("No selected results available for summary generation");
|
|
626
|
+
}
|
|
627
|
+
try {
|
|
628
|
+
return await generateSummaryDraft(selectedResults, summaryContext, signal, modelOverride, feedback);
|
|
629
|
+
}
|
|
630
|
+
catch (err) {
|
|
631
|
+
const isEmptyResponse = err instanceof Error && err.message.includes("Summary model returned empty response");
|
|
632
|
+
if (!isEmptyResponse)
|
|
633
|
+
throw err;
|
|
634
|
+
const deterministic = buildDeterministicSummary(selectedResults);
|
|
635
|
+
return {
|
|
636
|
+
summary: deterministic.summary,
|
|
637
|
+
meta: {
|
|
638
|
+
...deterministic.meta,
|
|
639
|
+
fallbackReason: "summary-model-empty-response",
|
|
640
|
+
},
|
|
641
|
+
};
|
|
642
|
+
}
|
|
643
|
+
}
|
|
644
|
+
async function loadSummaryModelChoices(summaryContext) {
|
|
645
|
+
const summaryModels = [];
|
|
646
|
+
const seen = new Set();
|
|
647
|
+
const availableValues = new Set();
|
|
648
|
+
const addModel = (provider, id) => {
|
|
649
|
+
const value = `${provider}/${id}`;
|
|
650
|
+
if (seen.has(value))
|
|
651
|
+
return;
|
|
652
|
+
seen.add(value);
|
|
653
|
+
summaryModels.push({ value, label: value });
|
|
654
|
+
};
|
|
655
|
+
let enabledModelPatterns = null;
|
|
656
|
+
let scopeLoaded = true;
|
|
657
|
+
try {
|
|
658
|
+
enabledModelPatterns = loadEnabledModelPatterns(summaryContext);
|
|
659
|
+
const availableModels = summaryContext.modelRegistry.getAvailable();
|
|
660
|
+
for (const model of availableModels) {
|
|
661
|
+
if (!modelMatchesEnabledPatterns(model, enabledModelPatterns))
|
|
662
|
+
continue;
|
|
663
|
+
const value = `${model.provider}/${model.id}`;
|
|
664
|
+
availableValues.add(value);
|
|
665
|
+
addModel(model.provider, model.id);
|
|
666
|
+
}
|
|
667
|
+
}
|
|
668
|
+
catch (err) {
|
|
669
|
+
scopeLoaded = false;
|
|
670
|
+
const message = err instanceof Error ? err.message : String(err);
|
|
671
|
+
console.error(`Failed to load summary models: ${message}`);
|
|
672
|
+
}
|
|
673
|
+
const currentModelValue = summaryContext.model
|
|
674
|
+
? `${summaryContext.model.provider}/${summaryContext.model.id}`
|
|
675
|
+
: null;
|
|
676
|
+
if (scopeLoaded && summaryContext.model && currentModelValue && !seen.has(currentModelValue) && modelMatchesEnabledPatterns(summaryContext.model, enabledModelPatterns)) {
|
|
677
|
+
addModel(summaryContext.model.provider, summaryContext.model.id);
|
|
678
|
+
}
|
|
679
|
+
const config = loadConfig();
|
|
680
|
+
const configuredSummaryModel = typeof config.summaryModel === "string" ? config.summaryModel.trim() : "";
|
|
681
|
+
const preferredDefaults = [
|
|
682
|
+
"anthropic/claude-haiku-4-5",
|
|
683
|
+
"openai-codex/gpt-5.3-codex-spark",
|
|
684
|
+
];
|
|
685
|
+
let defaultSummaryModel = null;
|
|
686
|
+
if (configuredSummaryModel.length > 0 && availableValues.has(configuredSummaryModel)) {
|
|
687
|
+
defaultSummaryModel = configuredSummaryModel;
|
|
688
|
+
}
|
|
689
|
+
if (!defaultSummaryModel) {
|
|
690
|
+
for (const preferred of preferredDefaults) {
|
|
691
|
+
if (availableValues.has(preferred)) {
|
|
692
|
+
defaultSummaryModel = preferred;
|
|
693
|
+
break;
|
|
694
|
+
}
|
|
695
|
+
}
|
|
696
|
+
}
|
|
697
|
+
return { summaryModels, defaultSummaryModel };
|
|
698
|
+
}
|
|
699
|
+
function resolveSummaryForSubmit(payload, resultsByIndex) {
|
|
700
|
+
const submittedSummary = typeof payload.summary === "string" ? payload.summary.trim() : "";
|
|
701
|
+
if (submittedSummary.length > 0) {
|
|
702
|
+
return {
|
|
703
|
+
approvedSummary: submittedSummary,
|
|
704
|
+
summaryMeta: normalizeSummaryMeta(payload.summaryMeta, submittedSummary),
|
|
705
|
+
};
|
|
706
|
+
}
|
|
707
|
+
const selected = filterByQueryIndices(payload.selectedQueryIndices, resultsByIndex).results;
|
|
708
|
+
const fallbackResults = selected.length > 0 ? selected : [...resultsByIndex.values()];
|
|
709
|
+
const deterministic = buildDeterministicSummary(fallbackResults);
|
|
710
|
+
return {
|
|
711
|
+
approvedSummary: deterministic.summary,
|
|
712
|
+
summaryMeta: deterministic.meta,
|
|
713
|
+
};
|
|
714
|
+
}
|
|
715
|
+
function buildSearchReturn(opts) {
|
|
716
|
+
const sc = opts.results.filter(r => !r.error).length;
|
|
717
|
+
const tr = opts.results.reduce((sum, r) => sum + r.results.length, 0);
|
|
718
|
+
const hasApprovedSummary = typeof opts.approvedSummary === "string" && opts.approvedSummary.trim().length > 0;
|
|
719
|
+
let output = "";
|
|
720
|
+
if (hasApprovedSummary) {
|
|
721
|
+
output = opts.approvedSummary.trim();
|
|
722
|
+
}
|
|
723
|
+
else {
|
|
724
|
+
if (opts.curated) {
|
|
725
|
+
output += "[These results were manually curated by the user in the browser. Use them as-is — do not re-search or discard.]\n\n";
|
|
726
|
+
}
|
|
727
|
+
const duplicateQueries = opts.curated ? duplicateQuerySet(opts.results) : new Set();
|
|
728
|
+
for (const { query, answer, results, error, provider } of opts.results) {
|
|
729
|
+
if (opts.queryList.length > 1) {
|
|
730
|
+
output += opts.curated
|
|
731
|
+
? formatQueryHeader(query, provider, duplicateQueries)
|
|
732
|
+
: `## Query: "${query}"\n\n`;
|
|
733
|
+
}
|
|
734
|
+
if (error)
|
|
735
|
+
output += `Error: ${error}\n\n`;
|
|
736
|
+
else if (results.length === 0)
|
|
737
|
+
output += "No results found.\n\n";
|
|
738
|
+
else
|
|
739
|
+
output += formatSearchSummary(results, answer) + "\n\n";
|
|
740
|
+
}
|
|
741
|
+
}
|
|
742
|
+
const hasInlineReady = hasFullInlineCoverage(opts.urls, opts.inlineContent);
|
|
743
|
+
let fetchId = null;
|
|
744
|
+
if (hasInlineReady && opts.inlineContent) {
|
|
745
|
+
fetchId = generateId();
|
|
746
|
+
const data = {
|
|
747
|
+
id: fetchId,
|
|
748
|
+
type: "fetch",
|
|
749
|
+
timestamp: Date.now(),
|
|
750
|
+
urls: opts.inlineContent,
|
|
751
|
+
};
|
|
752
|
+
storeResult(fetchId, data);
|
|
753
|
+
pi.appendEntry("web-search-results", data);
|
|
754
|
+
if (!hasApprovedSummary) {
|
|
755
|
+
output += `---\nFull content for ${opts.inlineContent.length} sources available [${fetchId}].`;
|
|
756
|
+
}
|
|
757
|
+
}
|
|
758
|
+
else if (opts.includeContent) {
|
|
759
|
+
fetchId = startBackgroundFetch(opts.urls);
|
|
760
|
+
if (fetchId && !hasApprovedSummary) {
|
|
761
|
+
output += `---\nContent fetching in background [${fetchId}]. Will notify when ready.`;
|
|
762
|
+
}
|
|
763
|
+
}
|
|
764
|
+
const searchId = storeAndPublishSearch(opts.results);
|
|
765
|
+
const isBackgroundFetch = fetchId !== null && !hasInlineReady;
|
|
766
|
+
return {
|
|
767
|
+
content: [{ type: "text", text: output.trim() }],
|
|
768
|
+
details: {
|
|
769
|
+
queries: opts.queryList,
|
|
770
|
+
queryCount: opts.queryList.length,
|
|
771
|
+
successfulQueries: sc,
|
|
772
|
+
totalResults: tr,
|
|
773
|
+
includeContent: opts.includeContent,
|
|
774
|
+
fetchId,
|
|
775
|
+
fetchUrls: isBackgroundFetch ? opts.urls : undefined,
|
|
776
|
+
searchId,
|
|
777
|
+
...(opts.curated ? {
|
|
778
|
+
curated: true,
|
|
779
|
+
curatedFrom: opts.curatedFrom,
|
|
780
|
+
curatedQueries: opts.results.map(r => ({
|
|
781
|
+
query: r.query,
|
|
782
|
+
provider: r.provider || null,
|
|
783
|
+
answer: r.answer || null,
|
|
784
|
+
sources: r.results.map(s => ({ title: s.title, url: s.url })),
|
|
785
|
+
error: r.error,
|
|
786
|
+
})),
|
|
787
|
+
} : {}),
|
|
788
|
+
...((opts.workflow && hasApprovedSummary)
|
|
789
|
+
? {
|
|
790
|
+
summary: {
|
|
791
|
+
text: opts.approvedSummary.trim(),
|
|
792
|
+
workflow: opts.workflow,
|
|
793
|
+
model: opts.summaryMeta?.model ?? null,
|
|
794
|
+
durationMs: opts.summaryMeta?.durationMs ?? 0,
|
|
795
|
+
tokenEstimate: opts.summaryMeta?.tokenEstimate ?? 0,
|
|
796
|
+
fallbackUsed: opts.summaryMeta?.fallbackUsed === true,
|
|
797
|
+
fallbackReason: opts.summaryMeta?.fallbackReason,
|
|
798
|
+
edited: opts.summaryMeta?.edited === true,
|
|
799
|
+
},
|
|
800
|
+
}
|
|
801
|
+
: {}),
|
|
802
|
+
},
|
|
803
|
+
};
|
|
804
|
+
}
|
|
805
|
+
function filterByQueryIndices(selectedQueryIndices, results) {
|
|
806
|
+
const filteredResults = [];
|
|
807
|
+
const filteredUrls = [];
|
|
808
|
+
for (const qi of selectedQueryIndices) {
|
|
809
|
+
const r = results.get(qi);
|
|
810
|
+
if (r) {
|
|
811
|
+
filteredResults.push(r);
|
|
812
|
+
for (const res of r.results) {
|
|
813
|
+
if (!filteredUrls.includes(res.url))
|
|
814
|
+
filteredUrls.push(res.url);
|
|
815
|
+
}
|
|
816
|
+
}
|
|
817
|
+
}
|
|
818
|
+
return { results: filteredResults, urls: filteredUrls };
|
|
819
|
+
}
|
|
820
|
+
function collectAllResultsAndUrls(resultsByIndex) {
|
|
821
|
+
const results = [...resultsByIndex.values()];
|
|
822
|
+
const urls = [];
|
|
823
|
+
for (const result of results) {
|
|
824
|
+
for (const source of result.results) {
|
|
825
|
+
if (!urls.includes(source.url))
|
|
826
|
+
urls.push(source.url);
|
|
827
|
+
}
|
|
828
|
+
}
|
|
829
|
+
return { results, urls };
|
|
830
|
+
}
|
|
831
|
+
async function openCuratorBrowser(callId, pc, searchesComplete = true) {
|
|
832
|
+
if (pendingCurates.get(callId) !== pc)
|
|
833
|
+
return;
|
|
834
|
+
let handle = null;
|
|
835
|
+
try {
|
|
836
|
+
pc.phase = "curating";
|
|
837
|
+
const searchAbort = new AbortController();
|
|
838
|
+
const addSearchSignal = pc.signal
|
|
839
|
+
? AbortSignal.any([pc.signal, searchAbort.signal])
|
|
840
|
+
: searchAbort.signal;
|
|
841
|
+
const sessionToken = randomUUID();
|
|
842
|
+
handle = await startCuratorServer({
|
|
843
|
+
queries: pc.queryList,
|
|
844
|
+
sessionToken,
|
|
845
|
+
timeout: pc.timeoutSeconds,
|
|
846
|
+
availableProviders: pc.availableProviders,
|
|
847
|
+
defaultProvider: pc.defaultProvider,
|
|
848
|
+
searchProvider: pc.searchProvider,
|
|
849
|
+
summaryModels: pc.summaryModels,
|
|
850
|
+
defaultSummaryModel: pc.defaultSummaryModel,
|
|
851
|
+
}, {
|
|
852
|
+
async onSummarize(selectedQueryIndices, summarizeSignal, model, feedback) {
|
|
853
|
+
if (pendingCurates.get(callId) !== pc)
|
|
854
|
+
throw new Error("Curator session is no longer active.");
|
|
855
|
+
pc.onUpdate?.({
|
|
856
|
+
content: [{ type: "text", text: "Generating summary draft..." }],
|
|
857
|
+
details: { phase: "generating-summary", progress: 0.9, curatorUrl: pc.curatorUrl, timeoutSeconds: pc.timeoutSeconds, shortcut: curateKey },
|
|
858
|
+
});
|
|
859
|
+
const draft = await generateSummaryForSelectedIndices(selectedQueryIndices, pc.searchResults, pc.summaryContext, summarizeSignal, model, feedback);
|
|
860
|
+
if (pendingCurates.get(callId) !== pc)
|
|
861
|
+
throw new Error("Curator session is no longer active.");
|
|
862
|
+
pc.onUpdate?.({
|
|
863
|
+
content: [{ type: "text", text: "Summary draft ready — waiting for approval..." }],
|
|
864
|
+
details: { phase: "waiting-for-approval", progress: 1, curatorUrl: pc.curatorUrl, timeoutSeconds: pc.timeoutSeconds, shortcut: curateKey },
|
|
865
|
+
});
|
|
866
|
+
return draft;
|
|
867
|
+
},
|
|
868
|
+
onSubmit(payload) {
|
|
869
|
+
if (pendingCurates.get(callId) !== pc)
|
|
870
|
+
return;
|
|
871
|
+
searchAbort.abort();
|
|
872
|
+
const filtered = payload.selectedQueryIndices.length > 0
|
|
873
|
+
? filterByQueryIndices(payload.selectedQueryIndices, pc.searchResults)
|
|
874
|
+
: collectAllResultsAndUrls(pc.searchResults);
|
|
875
|
+
const filteredInline = pc.allInlineContent.filter(c => filtered.urls.includes(c.url));
|
|
876
|
+
const base = {
|
|
877
|
+
queryList: filtered.results.map(r => r.query),
|
|
878
|
+
results: filtered.results,
|
|
879
|
+
urls: filtered.urls,
|
|
880
|
+
includeContent: pc.includeContent,
|
|
881
|
+
inlineContent: filteredInline.length > 0 ? filteredInline : undefined,
|
|
882
|
+
curated: true,
|
|
883
|
+
curatedFrom: pc.searchResults.size,
|
|
884
|
+
};
|
|
885
|
+
if (!payload.rawResults) {
|
|
886
|
+
const resolvedSummary = resolveSummaryForSubmit(payload, pc.searchResults);
|
|
887
|
+
base.workflow = pc.workflow;
|
|
888
|
+
base.approvedSummary = resolvedSummary.approvedSummary;
|
|
889
|
+
base.summaryMeta = resolvedSummary.summaryMeta;
|
|
890
|
+
}
|
|
891
|
+
pc.finish(buildSearchReturn(base));
|
|
892
|
+
closeCurator(callId);
|
|
893
|
+
},
|
|
894
|
+
onCancel(reason) {
|
|
895
|
+
if (pendingCurates.get(callId) !== pc)
|
|
896
|
+
return;
|
|
897
|
+
searchAbort.abort();
|
|
898
|
+
if (reason === "timeout") {
|
|
899
|
+
const resolvedSummary = resolveSummaryForSubmit({ selectedQueryIndices: [], summary: undefined, summaryMeta: undefined }, pc.searchResults);
|
|
900
|
+
const all = collectAllResultsAndUrls(pc.searchResults);
|
|
901
|
+
const filteredInline = pc.allInlineContent.filter(c => all.urls.includes(c.url));
|
|
902
|
+
pc.finish(buildSearchReturn({
|
|
903
|
+
queryList: all.results.map(r => r.query),
|
|
904
|
+
results: all.results,
|
|
905
|
+
urls: all.urls,
|
|
906
|
+
includeContent: pc.includeContent,
|
|
907
|
+
inlineContent: filteredInline.length > 0 ? filteredInline : undefined,
|
|
908
|
+
curated: true,
|
|
909
|
+
curatedFrom: pc.searchResults.size,
|
|
910
|
+
workflow: pc.workflow,
|
|
911
|
+
approvedSummary: resolvedSummary.approvedSummary,
|
|
912
|
+
summaryMeta: resolvedSummary.summaryMeta,
|
|
913
|
+
}));
|
|
914
|
+
}
|
|
915
|
+
else {
|
|
916
|
+
const conn = activeCurators.get(callId)?.getConnectionState();
|
|
917
|
+
pc.finish(buildCurationCancelledReturn(reason, {
|
|
918
|
+
queries: Array.from(pc.searchResults.values()),
|
|
919
|
+
queryCount: pc.queryList.length,
|
|
920
|
+
browserConnected: conn?.browserConnected,
|
|
921
|
+
lastHeartbeatAgeMs: conn?.lastHeartbeatAgeMs,
|
|
922
|
+
curatorUrl: pc.curatorUrl,
|
|
923
|
+
browserOpenError: pc.browserOpenError,
|
|
924
|
+
}));
|
|
925
|
+
}
|
|
926
|
+
closeCurator(callId);
|
|
927
|
+
},
|
|
928
|
+
onProviderChange(provider) {
|
|
929
|
+
if (pendingCurates.get(callId) !== pc)
|
|
930
|
+
return;
|
|
931
|
+
const normalized = normalizeProviderInput(provider);
|
|
932
|
+
if (!normalized || normalized === "auto")
|
|
933
|
+
return;
|
|
934
|
+
pc.defaultProvider = normalized;
|
|
935
|
+
pc.searchProvider = normalized;
|
|
936
|
+
try {
|
|
937
|
+
saveConfig({ provider: normalized });
|
|
938
|
+
}
|
|
939
|
+
catch (err) {
|
|
940
|
+
const message = err instanceof Error ? err.message : String(err);
|
|
941
|
+
console.error(`Failed to persist default provider: ${message}`);
|
|
942
|
+
}
|
|
943
|
+
},
|
|
944
|
+
async onAddSearch(query, queryIndex, provider) {
|
|
945
|
+
if (pendingCurates.get(callId) !== pc)
|
|
946
|
+
throw new Error("Curator session is no longer active.");
|
|
947
|
+
const normalizedProvider = normalizeProviderInput(provider);
|
|
948
|
+
const requestedProvider = !normalizedProvider || normalizedProvider === "auto"
|
|
949
|
+
? pc.searchProvider
|
|
950
|
+
: normalizedProvider;
|
|
951
|
+
try {
|
|
952
|
+
const { answer, results, inlineContent, provider: actualProvider } = await search(query, {
|
|
953
|
+
provider: requestedProvider,
|
|
954
|
+
numResults: pc.numResults,
|
|
955
|
+
recencyFilter: pc.recencyFilter,
|
|
956
|
+
domainFilter: pc.domainFilter,
|
|
957
|
+
includeContent: pc.includeContent,
|
|
958
|
+
signal: addSearchSignal,
|
|
959
|
+
extensionContext: ctx,
|
|
960
|
+
});
|
|
961
|
+
if (pendingCurates.get(callId) !== pc)
|
|
962
|
+
throw new Error("Curator session is no longer active.");
|
|
963
|
+
pc.searchResults.set(queryIndex, { query, answer, results, error: null, provider: actualProvider });
|
|
964
|
+
if (inlineContent)
|
|
965
|
+
pc.allInlineContent.push(...inlineContent);
|
|
966
|
+
return {
|
|
967
|
+
answer,
|
|
968
|
+
results: results.map(r => ({ title: r.title, url: r.url, domain: extractDomain(r.url) })),
|
|
969
|
+
provider: actualProvider,
|
|
970
|
+
};
|
|
971
|
+
}
|
|
972
|
+
catch (err) {
|
|
973
|
+
const message = err instanceof Error ? err.message : String(err);
|
|
974
|
+
if (pendingCurates.get(callId) === pc) {
|
|
975
|
+
pc.searchResults.set(queryIndex, { query, answer: "", results: [], error: message, provider: requestedProvider });
|
|
976
|
+
}
|
|
977
|
+
throw err;
|
|
978
|
+
}
|
|
979
|
+
},
|
|
980
|
+
async onRewriteQuery(query, rewriteSignal) {
|
|
981
|
+
if (pendingCurates.get(callId) !== pc)
|
|
982
|
+
throw new Error("Curator session is no longer active.");
|
|
983
|
+
return rewriteSearchQuery(query, pc.summaryContext, rewriteSignal);
|
|
984
|
+
},
|
|
985
|
+
});
|
|
986
|
+
if (pendingCurates.get(callId) !== pc) {
|
|
987
|
+
handle.close();
|
|
988
|
+
return;
|
|
989
|
+
}
|
|
990
|
+
activeCurators.set(callId, handle);
|
|
991
|
+
pc.curatorUrl = handle.url;
|
|
992
|
+
for (const [qi, data] of pc.searchResults) {
|
|
993
|
+
if (data.error) {
|
|
994
|
+
handle.pushError(qi, data.error, data.provider);
|
|
995
|
+
}
|
|
996
|
+
else {
|
|
997
|
+
handle.pushResult(qi, {
|
|
998
|
+
answer: data.answer,
|
|
999
|
+
results: data.results.map(r => ({ title: r.title, url: r.url, domain: extractDomain(r.url) })),
|
|
1000
|
+
provider: data.provider || pc.defaultProvider,
|
|
1001
|
+
});
|
|
1002
|
+
}
|
|
1003
|
+
}
|
|
1004
|
+
if (searchesComplete)
|
|
1005
|
+
handle.searchesDone();
|
|
1006
|
+
const sendCuratorFallbackUpdate = (message) => {
|
|
1007
|
+
pc.onUpdate?.({
|
|
1008
|
+
content: [{ type: "text", text: `${message}\nOpen manually: ${handle.url}` }],
|
|
1009
|
+
details: {
|
|
1010
|
+
phase: "curator-fallback",
|
|
1011
|
+
progress: searchesComplete ? 1 : 0.5,
|
|
1012
|
+
curatorUrl: handle.url,
|
|
1013
|
+
timeoutSeconds: pc.timeoutSeconds,
|
|
1014
|
+
shortcut: curateKey,
|
|
1015
|
+
browserOpenError: pc.browserOpenError,
|
|
1016
|
+
},
|
|
1017
|
+
});
|
|
1018
|
+
};
|
|
1019
|
+
pc.onUpdate?.({
|
|
1020
|
+
content: [{ type: "text", text: searchesComplete ? "Waiting for summary approval in browser..." : "Searches streaming to browser..." }],
|
|
1021
|
+
details: {
|
|
1022
|
+
phase: "curating",
|
|
1023
|
+
progress: searchesComplete ? 1 : 0.5,
|
|
1024
|
+
curatorUrl: handle.url,
|
|
1025
|
+
timeoutSeconds: pc.timeoutSeconds,
|
|
1026
|
+
shortcut: curateKey,
|
|
1027
|
+
},
|
|
1028
|
+
});
|
|
1029
|
+
const open = platform() === "darwin" ? await getGlimpseOpen() : null;
|
|
1030
|
+
if (open) {
|
|
1031
|
+
try {
|
|
1032
|
+
const win = openInGlimpse(open, handle.url, "Search Curator");
|
|
1033
|
+
glimpseWins.set(callId, win);
|
|
1034
|
+
win.on("closed", () => {
|
|
1035
|
+
if (glimpseWins.get(callId) === win) {
|
|
1036
|
+
glimpseWins.delete(callId);
|
|
1037
|
+
closeCurator(callId);
|
|
1038
|
+
}
|
|
1039
|
+
});
|
|
1040
|
+
return;
|
|
1041
|
+
}
|
|
1042
|
+
catch (err) {
|
|
1043
|
+
const message = err instanceof Error ? err.message : String(err);
|
|
1044
|
+
console.error(`Failed to open Glimpse curator window: ${message}`);
|
|
1045
|
+
glimpseWins.delete(callId);
|
|
1046
|
+
}
|
|
1047
|
+
}
|
|
1048
|
+
await openInBrowser(pi, handle.url);
|
|
1049
|
+
}
|
|
1050
|
+
catch (err) {
|
|
1051
|
+
const message = err instanceof Error ? err.message : String(err);
|
|
1052
|
+
console.error(`Failed to open curator UI: ${message}`);
|
|
1053
|
+
if (handle && activeCurators.get(callId) === handle && pendingCurates.get(callId) === pc) {
|
|
1054
|
+
pc.browserOpenError = message;
|
|
1055
|
+
sendCuratorFallbackUpdate("Search curator is running, but the browser did not open automatically.");
|
|
1056
|
+
}
|
|
1057
|
+
else if (pendingCurates.get(callId) === pc || (handle && activeCurators.get(callId) === handle)) {
|
|
1058
|
+
closeCurator(callId);
|
|
1059
|
+
}
|
|
1060
|
+
}
|
|
1061
|
+
}
|
|
1062
|
+
pi.registerShortcut(curateKey, {
|
|
1063
|
+
description: "Review search results",
|
|
1064
|
+
handler: async (ctx) => {
|
|
1065
|
+
const entries = [...pendingCurates.entries()];
|
|
1066
|
+
if (entries.length === 0)
|
|
1067
|
+
return;
|
|
1068
|
+
const [callId, pc] = entries[entries.length - 1];
|
|
1069
|
+
if (pc.phase === "searching") {
|
|
1070
|
+
pc.browserPromise = openCuratorBrowser(callId, pc, false);
|
|
1071
|
+
ctx.ui.notify("Opening curator — remaining searches will stream in", "info");
|
|
1072
|
+
return;
|
|
1073
|
+
}
|
|
1074
|
+
},
|
|
1075
|
+
});
|
|
1076
|
+
pi.registerShortcut(activityKey, {
|
|
1077
|
+
description: "Toggle web search activity",
|
|
1078
|
+
handler: async (ctx) => {
|
|
1079
|
+
widgetVisible = !widgetVisible;
|
|
1080
|
+
if (widgetVisible) {
|
|
1081
|
+
widgetUnsubscribe = activityMonitor.onUpdate(() => updateWidget(ctx));
|
|
1082
|
+
updateWidget(ctx);
|
|
1083
|
+
}
|
|
1084
|
+
else {
|
|
1085
|
+
widgetUnsubscribe?.();
|
|
1086
|
+
widgetUnsubscribe = null;
|
|
1087
|
+
ctx.ui.setWidget("web-activity", undefined);
|
|
1088
|
+
}
|
|
1089
|
+
},
|
|
1090
|
+
});
|
|
1091
|
+
pi.on("session_start", async (_event, ctx) => handleSessionChange(ctx));
|
|
1092
|
+
pi.on("session_tree", async (_event, ctx) => handleSessionChange(ctx));
|
|
1093
|
+
pi.on("session_shutdown", () => {
|
|
1094
|
+
sessionActive = false;
|
|
1095
|
+
abortPendingFetches();
|
|
1096
|
+
closeCurator();
|
|
1097
|
+
clearCloneCache();
|
|
1098
|
+
clearResults();
|
|
1099
|
+
// Unsubscribe before clear() to avoid callback with stale ctx
|
|
1100
|
+
widgetUnsubscribe?.();
|
|
1101
|
+
widgetUnsubscribe = null;
|
|
1102
|
+
activityMonitor.clear();
|
|
1103
|
+
widgetVisible = false;
|
|
1104
|
+
});
|
|
1105
|
+
if (initConfig.webSearch?.enabled !== false)
|
|
1106
|
+
pi.registerTool({
|
|
1107
|
+
name: "web_search",
|
|
1108
|
+
label: "Web Search",
|
|
1109
|
+
description: `Search the web using OpenAI, Brave, Parallel, Tavily, Exa, Perplexity, or Gemini. Returns an AI-synthesized answer with source citations. OpenAI web_search uses a Codex subscription or OpenAI API key. For comprehensive research, prefer queries (plural) with 2-4 varied angles over a single query — each query gets its own synthesized answer, so varying phrasing and scope gives much broader coverage. When includeContent is true, full page content is fetched in the background. Searches auto-open the interactive browser curator and stream results live; set workflow to "none" to skip curation or "auto-summary" for a model-generated summary without the browser curator. Provider auto-selects: OpenAI when suitable and available, then Exa, Brave, Parallel, Tavily, Perplexity, Gemini API, then Gemini Web.`,
|
|
1110
|
+
promptSnippet: "Use for web research questions. Prefer {queries:[...]} with 2-4 varied angles over a single query for broader coverage.",
|
|
1111
|
+
parameters: Type.Object({
|
|
1112
|
+
query: Type.Optional(Type.String({ description: "Single search query. For research tasks, prefer 'queries' with multiple varied angles instead." })),
|
|
1113
|
+
queries: Type.Optional(Type.Array(Type.String(), { description: "Multiple queries searched in sequence, each returning its own synthesized answer. Prefer this for research — vary phrasing, scope, and angle across 2-4 queries to maximize coverage. Good: ['React vs Vue performance benchmarks 2026', 'React vs Vue developer experience comparison', 'React ecosystem size vs Vue ecosystem']. Bad: ['React vs Vue', 'React vs Vue comparison', 'React vs Vue review'] (too similar, redundant results)." })),
|
|
1114
|
+
numResults: Type.Optional(Type.Number({ description: "Results per query (default: 5, max: 20)" })),
|
|
1115
|
+
includeContent: Type.Optional(Type.Boolean({ description: "Fetch full page content (async)" })),
|
|
1116
|
+
recencyFilter: Type.Optional(StringEnum(["day", "week", "month", "year"], { description: "Filter by recency" })),
|
|
1117
|
+
domainFilter: Type.Optional(Type.Array(Type.String(), { description: "Limit to domains (prefix with - to exclude)" })),
|
|
1118
|
+
provider: Type.Optional(StringEnum(["auto", "openai", "brave", "parallel", "tavily", "exa", "perplexity", "gemini"], { description: "Search provider (default: auto)" })),
|
|
1119
|
+
workflow: Type.Optional(StringEnum(["none", "summary-review", "auto-summary"], {
|
|
1120
|
+
description: "Search workflow mode: none = no curator, summary-review = open curator with auto summary draft (default), auto-summary = generate summary without opening curator",
|
|
1121
|
+
})),
|
|
1122
|
+
}),
|
|
1123
|
+
async execute(callId, params, signal, onUpdate, ctx) {
|
|
1124
|
+
const rawQueryList = Array.isArray(params.queries)
|
|
1125
|
+
? params.queries
|
|
1126
|
+
: (params.query !== undefined ? [params.query] : []);
|
|
1127
|
+
const queryList = normalizeQueryList(rawQueryList);
|
|
1128
|
+
const configWorkflow = loadConfigForExtensionInit().workflow;
|
|
1129
|
+
const workflow = resolveWorkflow(params.workflow ?? configWorkflow, ctx?.hasUI !== false);
|
|
1130
|
+
const shouldCurate = workflow === "summary-review";
|
|
1131
|
+
if (queryList.length === 0) {
|
|
1132
|
+
return {
|
|
1133
|
+
content: [{ type: "text", text: "Error: No query provided. Use 'query' or 'queries' parameter." }],
|
|
1134
|
+
details: { error: "No query provided" },
|
|
1135
|
+
};
|
|
1136
|
+
}
|
|
1137
|
+
if (shouldCurate && !ctx) {
|
|
1138
|
+
return {
|
|
1139
|
+
content: [{ type: "text", text: "Error: Curation requires an active extension context." }],
|
|
1140
|
+
details: { error: "Missing extension context" },
|
|
1141
|
+
};
|
|
1142
|
+
}
|
|
1143
|
+
if (shouldCurate) {
|
|
1144
|
+
closeCurator(callId);
|
|
1145
|
+
let resolvePromise = () => { };
|
|
1146
|
+
const promise = new Promise((resolve) => {
|
|
1147
|
+
resolvePromise = resolve;
|
|
1148
|
+
});
|
|
1149
|
+
const includeContent = params.includeContent ?? false;
|
|
1150
|
+
const searchResults = new Map();
|
|
1151
|
+
const allInlineContent = [];
|
|
1152
|
+
const searchAbort = new AbortController();
|
|
1153
|
+
const searchSignal = signal
|
|
1154
|
+
? AbortSignal.any([signal, searchAbort.signal])
|
|
1155
|
+
: searchAbort.signal;
|
|
1156
|
+
let cancelled = false;
|
|
1157
|
+
const bootstrap = await loadCuratorBootstrap(params.provider, ctx, {
|
|
1158
|
+
numResults: params.numResults,
|
|
1159
|
+
recencyFilter: params.recencyFilter,
|
|
1160
|
+
});
|
|
1161
|
+
const availableProviders = bootstrap.availableProviders;
|
|
1162
|
+
const defaultProvider = bootstrap.defaultProvider;
|
|
1163
|
+
const rawSearchProvider = normalizeProviderInput(params.provider ?? loadConfig().provider ?? "auto") ?? "auto";
|
|
1164
|
+
const searchProvider = rawSearchProvider === "auto" ? "auto" : defaultProvider;
|
|
1165
|
+
const curatorTimeoutSeconds = bootstrap.timeoutSeconds;
|
|
1166
|
+
const curatorWorkflow = "summary-review";
|
|
1167
|
+
const summaryContext = {
|
|
1168
|
+
model: ctx.model,
|
|
1169
|
+
modelRegistry: ctx.modelRegistry,
|
|
1170
|
+
cwd: ctx.cwd,
|
|
1171
|
+
isProjectTrusted: () => ctx.isProjectTrusted(),
|
|
1172
|
+
};
|
|
1173
|
+
const summaryModelChoices = await loadSummaryModelChoices(summaryContext);
|
|
1174
|
+
const pc = {
|
|
1175
|
+
phase: "searching",
|
|
1176
|
+
workflow: curatorWorkflow,
|
|
1177
|
+
summaryContext,
|
|
1178
|
+
searchResults,
|
|
1179
|
+
allInlineContent,
|
|
1180
|
+
queryList,
|
|
1181
|
+
includeContent,
|
|
1182
|
+
numResults: params.numResults,
|
|
1183
|
+
recencyFilter: params.recencyFilter,
|
|
1184
|
+
domainFilter: params.domainFilter,
|
|
1185
|
+
availableProviders,
|
|
1186
|
+
defaultProvider,
|
|
1187
|
+
searchProvider,
|
|
1188
|
+
summaryModels: summaryModelChoices.summaryModels,
|
|
1189
|
+
defaultSummaryModel: summaryModelChoices.defaultSummaryModel,
|
|
1190
|
+
timeoutSeconds: curatorTimeoutSeconds,
|
|
1191
|
+
onUpdate: onUpdate,
|
|
1192
|
+
signal,
|
|
1193
|
+
abortSearches: () => {
|
|
1194
|
+
if (!searchAbort.signal.aborted)
|
|
1195
|
+
searchAbort.abort();
|
|
1196
|
+
},
|
|
1197
|
+
finish: () => { },
|
|
1198
|
+
cancel: () => { },
|
|
1199
|
+
};
|
|
1200
|
+
const finish = (value) => {
|
|
1201
|
+
if (cancelled)
|
|
1202
|
+
return;
|
|
1203
|
+
cancelled = true;
|
|
1204
|
+
pc.abortSearches();
|
|
1205
|
+
signal?.removeEventListener("abort", onAbort);
|
|
1206
|
+
pendingCurates.delete(callId);
|
|
1207
|
+
resolvePromise(value);
|
|
1208
|
+
};
|
|
1209
|
+
const cancel = (reason = "stale") => {
|
|
1210
|
+
if (cancelled)
|
|
1211
|
+
return;
|
|
1212
|
+
const conn = activeCurators.get(callId)?.getConnectionState();
|
|
1213
|
+
finish(buildCurationCancelledReturn(reason, {
|
|
1214
|
+
queries: Array.from(searchResults.values()),
|
|
1215
|
+
queryCount: queryList.length,
|
|
1216
|
+
browserConnected: conn?.browserConnected,
|
|
1217
|
+
lastHeartbeatAgeMs: conn?.lastHeartbeatAgeMs,
|
|
1218
|
+
curatorUrl: pc.curatorUrl,
|
|
1219
|
+
browserOpenError: pc.browserOpenError,
|
|
1220
|
+
}));
|
|
1221
|
+
};
|
|
1222
|
+
pc.finish = finish;
|
|
1223
|
+
pc.cancel = cancel;
|
|
1224
|
+
const onAbort = () => closeCurator(callId);
|
|
1225
|
+
pendingCurates.set(callId, pc);
|
|
1226
|
+
signal?.addEventListener("abort", onAbort, { once: true });
|
|
1227
|
+
pc.browserPromise = openCuratorBrowser(callId, pc, false);
|
|
1228
|
+
for (let qi = 0; qi < queryList.length; qi++) {
|
|
1229
|
+
if (signal?.aborted || cancelled || searchAbort.signal.aborted)
|
|
1230
|
+
break;
|
|
1231
|
+
onUpdate?.({
|
|
1232
|
+
content: [{ type: "text", text: `Searching ${qi + 1}/${queryList.length}: "${queryList[qi]}"...` }],
|
|
1233
|
+
details: { phase: "searching", progress: qi / queryList.length, currentQuery: queryList[qi] },
|
|
1234
|
+
});
|
|
1235
|
+
const requestedProvider = pc.searchProvider;
|
|
1236
|
+
try {
|
|
1237
|
+
const { answer, results, inlineContent, provider } = await search(queryList[qi], {
|
|
1238
|
+
provider: requestedProvider,
|
|
1239
|
+
numResults: params.numResults,
|
|
1240
|
+
recencyFilter: params.recencyFilter,
|
|
1241
|
+
domainFilter: params.domainFilter,
|
|
1242
|
+
includeContent: params.includeContent,
|
|
1243
|
+
signal: searchSignal,
|
|
1244
|
+
extensionContext: ctx,
|
|
1245
|
+
});
|
|
1246
|
+
if (signal?.aborted || cancelled || searchAbort.signal.aborted)
|
|
1247
|
+
break;
|
|
1248
|
+
searchResults.set(qi, { query: queryList[qi], answer, results, error: null, provider });
|
|
1249
|
+
if (inlineContent)
|
|
1250
|
+
allInlineContent.push(...inlineContent);
|
|
1251
|
+
const curator = activeCurators.get(callId);
|
|
1252
|
+
if (curator) {
|
|
1253
|
+
curator.pushResult(qi, {
|
|
1254
|
+
answer,
|
|
1255
|
+
results: results.map(r => ({ title: r.title, url: r.url, domain: extractDomain(r.url) })),
|
|
1256
|
+
provider,
|
|
1257
|
+
});
|
|
1258
|
+
}
|
|
1259
|
+
}
|
|
1260
|
+
catch (err) {
|
|
1261
|
+
if (signal?.aborted || cancelled || searchAbort.signal.aborted)
|
|
1262
|
+
break;
|
|
1263
|
+
const message = err instanceof Error ? err.message : String(err);
|
|
1264
|
+
searchResults.set(qi, { query: queryList[qi], answer: "", results: [], error: message, provider: requestedProvider });
|
|
1265
|
+
const curator = activeCurators.get(callId);
|
|
1266
|
+
if (curator) {
|
|
1267
|
+
curator.pushError(qi, message, requestedProvider);
|
|
1268
|
+
}
|
|
1269
|
+
}
|
|
1270
|
+
}
|
|
1271
|
+
if (signal?.aborted || cancelled || searchAbort.signal.aborted) {
|
|
1272
|
+
cancel();
|
|
1273
|
+
return promise;
|
|
1274
|
+
}
|
|
1275
|
+
await pc.browserPromise;
|
|
1276
|
+
const curator = activeCurators.get(callId);
|
|
1277
|
+
if (curator && !cancelled) {
|
|
1278
|
+
curator.searchesDone();
|
|
1279
|
+
if (pc.browserOpenError) {
|
|
1280
|
+
pc.onUpdate?.({
|
|
1281
|
+
content: [{ type: "text", text: `All searches complete. Open the curator manually: ${pc.curatorUrl}` }],
|
|
1282
|
+
details: {
|
|
1283
|
+
phase: "curator-fallback",
|
|
1284
|
+
progress: 1,
|
|
1285
|
+
curatorUrl: pc.curatorUrl,
|
|
1286
|
+
timeoutSeconds: pc.timeoutSeconds,
|
|
1287
|
+
shortcut: curateKey,
|
|
1288
|
+
browserOpenError: pc.browserOpenError,
|
|
1289
|
+
},
|
|
1290
|
+
});
|
|
1291
|
+
}
|
|
1292
|
+
else {
|
|
1293
|
+
pc.onUpdate?.({
|
|
1294
|
+
content: [{ type: "text", text: "All searches complete — waiting for summary approval in browser..." }],
|
|
1295
|
+
details: {
|
|
1296
|
+
phase: "curating",
|
|
1297
|
+
progress: 1,
|
|
1298
|
+
curatorUrl: pc.curatorUrl,
|
|
1299
|
+
timeoutSeconds: pc.timeoutSeconds,
|
|
1300
|
+
shortcut: curateKey,
|
|
1301
|
+
},
|
|
1302
|
+
});
|
|
1303
|
+
}
|
|
1304
|
+
}
|
|
1305
|
+
return promise;
|
|
1306
|
+
}
|
|
1307
|
+
const searchResults = [];
|
|
1308
|
+
const allUrls = [];
|
|
1309
|
+
const allInlineContent = [];
|
|
1310
|
+
const resolvedProvider = normalizeProviderInput(params.provider ?? loadConfig().provider);
|
|
1311
|
+
for (let i = 0; i < queryList.length; i++) {
|
|
1312
|
+
const query = queryList[i];
|
|
1313
|
+
onUpdate?.({
|
|
1314
|
+
content: [{ type: "text", text: `Searching ${i + 1}/${queryList.length}: "${query}"...` }],
|
|
1315
|
+
details: { phase: "search", progress: i / queryList.length, currentQuery: query },
|
|
1316
|
+
});
|
|
1317
|
+
try {
|
|
1318
|
+
const { answer, results, inlineContent, provider } = await search(query, {
|
|
1319
|
+
provider: resolvedProvider,
|
|
1320
|
+
numResults: params.numResults,
|
|
1321
|
+
recencyFilter: params.recencyFilter,
|
|
1322
|
+
domainFilter: params.domainFilter,
|
|
1323
|
+
includeContent: params.includeContent,
|
|
1324
|
+
signal,
|
|
1325
|
+
extensionContext: ctx,
|
|
1326
|
+
});
|
|
1327
|
+
searchResults.push({ query, answer, results, error: null, provider });
|
|
1328
|
+
for (const r of results) {
|
|
1329
|
+
if (!allUrls.includes(r.url)) {
|
|
1330
|
+
allUrls.push(r.url);
|
|
1331
|
+
}
|
|
1332
|
+
}
|
|
1333
|
+
if (inlineContent)
|
|
1334
|
+
allInlineContent.push(...inlineContent);
|
|
1335
|
+
}
|
|
1336
|
+
catch (err) {
|
|
1337
|
+
const message = err instanceof Error ? err.message : String(err);
|
|
1338
|
+
const requestedProvider = typeof resolvedProvider === "string" && resolvedProvider !== "auto"
|
|
1339
|
+
? resolvedProvider
|
|
1340
|
+
: undefined;
|
|
1341
|
+
searchResults.push({ query, answer: "", results: [], error: message, provider: requestedProvider });
|
|
1342
|
+
}
|
|
1343
|
+
}
|
|
1344
|
+
let approvedSummary;
|
|
1345
|
+
let summaryMeta;
|
|
1346
|
+
if (workflow === "auto-summary") {
|
|
1347
|
+
if (!ctx) {
|
|
1348
|
+
return {
|
|
1349
|
+
content: [{ type: "text", text: "Error: Auto-summary requires an active extension context." }],
|
|
1350
|
+
details: { error: "Missing extension context" },
|
|
1351
|
+
};
|
|
1352
|
+
}
|
|
1353
|
+
onUpdate?.({
|
|
1354
|
+
content: [{ type: "text", text: "Generating summary..." }],
|
|
1355
|
+
details: { phase: "generating-summary", progress: 1 },
|
|
1356
|
+
});
|
|
1357
|
+
const summaryContext = {
|
|
1358
|
+
model: ctx.model,
|
|
1359
|
+
modelRegistry: ctx.modelRegistry,
|
|
1360
|
+
cwd: ctx.cwd,
|
|
1361
|
+
isProjectTrusted: () => ctx.isProjectTrusted(),
|
|
1362
|
+
};
|
|
1363
|
+
const summaryModelChoices = await loadSummaryModelChoices(summaryContext);
|
|
1364
|
+
const generated = await generateSummaryDraft(searchResults, summaryContext, signal, summaryModelChoices.defaultSummaryModel ?? undefined);
|
|
1365
|
+
approvedSummary = generated.summary;
|
|
1366
|
+
summaryMeta = generated.meta;
|
|
1367
|
+
}
|
|
1368
|
+
return buildSearchReturn({
|
|
1369
|
+
queryList,
|
|
1370
|
+
results: searchResults,
|
|
1371
|
+
urls: allUrls,
|
|
1372
|
+
includeContent: params.includeContent ?? false,
|
|
1373
|
+
inlineContent: allInlineContent.length > 0 ? allInlineContent : undefined,
|
|
1374
|
+
workflow: workflow === "auto-summary" ? "auto-summary" : undefined,
|
|
1375
|
+
approvedSummary,
|
|
1376
|
+
summaryMeta,
|
|
1377
|
+
});
|
|
1378
|
+
},
|
|
1379
|
+
renderCall(args, theme) {
|
|
1380
|
+
const input = args;
|
|
1381
|
+
const rawQueryList = Array.isArray(input.queries)
|
|
1382
|
+
? input.queries
|
|
1383
|
+
: (input.query !== undefined ? [input.query] : []);
|
|
1384
|
+
const queryList = normalizeQueryList(rawQueryList);
|
|
1385
|
+
if (queryList.length === 0) {
|
|
1386
|
+
return new Text(theme.fg("toolTitle", theme.bold("search ")) + theme.fg("error", "(no query)"), 0, 0);
|
|
1387
|
+
}
|
|
1388
|
+
if (queryList.length === 1) {
|
|
1389
|
+
const q = queryList[0];
|
|
1390
|
+
const display = q.length > 60 ? q.slice(0, 57) + "..." : q;
|
|
1391
|
+
return new Text(theme.fg("toolTitle", theme.bold("search ")) + theme.fg("accent", `"${display}"`), 0, 0);
|
|
1392
|
+
}
|
|
1393
|
+
const lines = [theme.fg("toolTitle", theme.bold("search ")) + theme.fg("accent", `${queryList.length} queries`)];
|
|
1394
|
+
for (const q of queryList.slice(0, 5)) {
|
|
1395
|
+
const display = q.length > 50 ? q.slice(0, 47) + "..." : q;
|
|
1396
|
+
lines.push(theme.fg("muted", ` "${display}"`));
|
|
1397
|
+
}
|
|
1398
|
+
if (queryList.length > 5) {
|
|
1399
|
+
lines.push(theme.fg("muted", ` ... and ${queryList.length - 5} more`));
|
|
1400
|
+
}
|
|
1401
|
+
return new Text(lines.join("\n"), 0, 0);
|
|
1402
|
+
},
|
|
1403
|
+
renderResult(result, { expanded, isPartial }, theme) {
|
|
1404
|
+
const details = result.details;
|
|
1405
|
+
if (isPartial) {
|
|
1406
|
+
if (details?.phase === "curator-fallback") {
|
|
1407
|
+
const lines = [theme.fg("warning", "Open the search curator manually:")];
|
|
1408
|
+
if (details?.curatorUrl)
|
|
1409
|
+
lines.push(theme.fg("muted", ` ${details.curatorUrl}`));
|
|
1410
|
+
if (details?.browserOpenError)
|
|
1411
|
+
lines.push(theme.fg("dim", ` auto-open failed: ${details.browserOpenError}`));
|
|
1412
|
+
const timeout = typeof details?.timeoutSeconds === "number" ? details.timeoutSeconds : undefined;
|
|
1413
|
+
const shortcut = typeof details?.shortcut === "string" ? details.shortcut : curateKey;
|
|
1414
|
+
lines.push(theme.fg("dim", timeout ? ` auto-submits after ${timeout}s idle; ${shortcut} reopens` : ` ${shortcut} reopens`));
|
|
1415
|
+
return new Text(lines.join("\n"), 0, 0);
|
|
1416
|
+
}
|
|
1417
|
+
if (details?.phase === "curating" || details?.phase === "waiting-for-approval" || details?.phase === "generating-summary") {
|
|
1418
|
+
const phaseText = details?.phase === "generating-summary"
|
|
1419
|
+
? "generating summary draft..."
|
|
1420
|
+
: details?.phase === "waiting-for-approval"
|
|
1421
|
+
? "summary draft ready; approve in browser..."
|
|
1422
|
+
: "waiting for summary approval in browser...";
|
|
1423
|
+
const lines = [theme.fg("accent", phaseText)];
|
|
1424
|
+
if (details?.curatorUrl) {
|
|
1425
|
+
lines.push(theme.fg("muted", ` ${details.curatorUrl}`));
|
|
1426
|
+
}
|
|
1427
|
+
const timeout = typeof details?.timeoutSeconds === "number" ? details.timeoutSeconds : undefined;
|
|
1428
|
+
const shortcut = typeof details?.shortcut === "string" ? details.shortcut : curateKey;
|
|
1429
|
+
if (timeout) {
|
|
1430
|
+
lines.push(theme.fg("dim", ` auto-submits after ${timeout}s idle; ${shortcut} reopens`));
|
|
1431
|
+
}
|
|
1432
|
+
else {
|
|
1433
|
+
lines.push(theme.fg("dim", ` ${shortcut} reopens`));
|
|
1434
|
+
}
|
|
1435
|
+
return new Text(lines.join("\n"), 0, 0);
|
|
1436
|
+
}
|
|
1437
|
+
if (details?.phase === "searching") {
|
|
1438
|
+
const progress = details?.progress ?? 0;
|
|
1439
|
+
const bar = "\u2588".repeat(Math.floor(progress * 10)) + "\u2591".repeat(10 - Math.floor(progress * 10));
|
|
1440
|
+
const query = details?.currentQuery || "";
|
|
1441
|
+
const display = query.length > 40 ? query.slice(0, 37) + "..." : query;
|
|
1442
|
+
return new Text(theme.fg("accent", `[${bar}] ${display}`), 0, 0);
|
|
1443
|
+
}
|
|
1444
|
+
const progress = details?.progress ?? 0;
|
|
1445
|
+
const bar = "\u2588".repeat(Math.floor(progress * 10)) + "\u2591".repeat(10 - Math.floor(progress * 10));
|
|
1446
|
+
return new Text(theme.fg("accent", `[${bar}] ${details?.phase || "searching"}`), 0, 0);
|
|
1447
|
+
}
|
|
1448
|
+
if (details?.error) {
|
|
1449
|
+
// Expandable Ctrl+O diagnostics: which queries completed, per-query errors,
|
|
1450
|
+
// browser connection state, cancel reason. See render-search-error.ts.
|
|
1451
|
+
const plan = buildSearchErrorPlan(details);
|
|
1452
|
+
if (plan)
|
|
1453
|
+
return renderSearchErrorPlan(plan, expanded, theme);
|
|
1454
|
+
return new Text(theme.fg("error", `Error: ${details.error}`), 0, 0);
|
|
1455
|
+
}
|
|
1456
|
+
let statusLine;
|
|
1457
|
+
const queryInfo = details?.queryCount === 1 ? "" : `${details?.successfulQueries}/${details?.queryCount} queries, `;
|
|
1458
|
+
statusLine = theme.fg("success", `${queryInfo}${details?.totalResults ?? 0} sources`);
|
|
1459
|
+
if (details?.curated && details?.curatedFrom) {
|
|
1460
|
+
statusLine += theme.fg("muted", ` (${details.queryCount}/${details.curatedFrom} queries curated)`);
|
|
1461
|
+
}
|
|
1462
|
+
if (details?.fetchId && details?.fetchUrls) {
|
|
1463
|
+
statusLine += theme.fg("muted", ` (fetching ${details.fetchUrls.length} URLs)`);
|
|
1464
|
+
}
|
|
1465
|
+
else if (details?.fetchId) {
|
|
1466
|
+
statusLine += theme.fg("muted", " (content ready)");
|
|
1467
|
+
}
|
|
1468
|
+
// Build expanded lines first so collapsed view can reference total count
|
|
1469
|
+
const lines = [statusLine];
|
|
1470
|
+
if (details?.summary?.text) {
|
|
1471
|
+
lines.push("");
|
|
1472
|
+
lines.push(theme.fg("accent", `── Summary (${details.summary.workflow}) ` + "─".repeat(32)));
|
|
1473
|
+
lines.push("");
|
|
1474
|
+
for (const line of details.summary.text.split("\n")) {
|
|
1475
|
+
lines.push(` ${line}`);
|
|
1476
|
+
}
|
|
1477
|
+
lines.push("");
|
|
1478
|
+
const metaParts = [
|
|
1479
|
+
details.summary.model ? `model=${details.summary.model}` : "model=deterministic",
|
|
1480
|
+
`duration=${details.summary.durationMs}ms`,
|
|
1481
|
+
`tokens~${details.summary.tokenEstimate}`,
|
|
1482
|
+
details.summary.fallbackUsed ? "fallback=true" : "fallback=false",
|
|
1483
|
+
details.summary.edited ? "edited=true" : "edited=false",
|
|
1484
|
+
];
|
|
1485
|
+
if (details.summary.fallbackReason) {
|
|
1486
|
+
metaParts.push(`reason=${details.summary.fallbackReason}`);
|
|
1487
|
+
}
|
|
1488
|
+
lines.push(theme.fg("dim", " " + metaParts.join(" · ")));
|
|
1489
|
+
}
|
|
1490
|
+
const queryDetails = details?.curatedQueries;
|
|
1491
|
+
if (queryDetails?.length) {
|
|
1492
|
+
const kept = queryDetails.length;
|
|
1493
|
+
const from = details?.curatedFrom ?? kept;
|
|
1494
|
+
lines.push("");
|
|
1495
|
+
lines.push(theme.fg("accent", `\u2500\u2500 Curated Results (${kept} of ${from} queries kept) ` + "\u2500".repeat(24)));
|
|
1496
|
+
for (const cq of queryDetails) {
|
|
1497
|
+
lines.push("");
|
|
1498
|
+
const dq = cq.query.length > 65 ? cq.query.slice(0, 62) + "..." : cq.query;
|
|
1499
|
+
const providerLabel = cq.provider ? ` (${cq.provider})` : "";
|
|
1500
|
+
lines.push(theme.fg("accent", ` "${dq}"${providerLabel}`));
|
|
1501
|
+
if (cq.error) {
|
|
1502
|
+
lines.push(theme.fg("error", ` ${cq.error}`));
|
|
1503
|
+
}
|
|
1504
|
+
else if (cq.answer) {
|
|
1505
|
+
lines.push("");
|
|
1506
|
+
for (const line of cq.answer.split("\n")) {
|
|
1507
|
+
lines.push(` ${line}`);
|
|
1508
|
+
}
|
|
1509
|
+
}
|
|
1510
|
+
if (cq.sources.length > 0) {
|
|
1511
|
+
lines.push("");
|
|
1512
|
+
for (const s of cq.sources) {
|
|
1513
|
+
const domain = s.url.replace(/^https?:\/\//, "").replace(/\/.*$/, "");
|
|
1514
|
+
const title = s.title.length > 50 ? s.title.slice(0, 47) + "..." : s.title;
|
|
1515
|
+
lines.push(theme.fg("muted", ` \u25b8 ${title}`) + theme.fg("dim", ` \u00b7 ${domain}`));
|
|
1516
|
+
}
|
|
1517
|
+
}
|
|
1518
|
+
}
|
|
1519
|
+
lines.push("");
|
|
1520
|
+
}
|
|
1521
|
+
else {
|
|
1522
|
+
const textContent = result.content.find((c) => c.type === "text")?.text || "";
|
|
1523
|
+
const preview = textContent.length > 500 ? textContent.slice(0, 500) + "..." : textContent;
|
|
1524
|
+
for (const line of preview.split("\n")) {
|
|
1525
|
+
lines.push(theme.fg("dim", line));
|
|
1526
|
+
}
|
|
1527
|
+
}
|
|
1528
|
+
if (details?.fetchUrls && details.fetchUrls.length > 0) {
|
|
1529
|
+
if (details.curated) {
|
|
1530
|
+
lines.push(theme.fg("muted", `Fetching ${details.fetchUrls.length} URLs in background`));
|
|
1531
|
+
}
|
|
1532
|
+
else {
|
|
1533
|
+
lines.push(theme.fg("muted", "Fetching:"));
|
|
1534
|
+
for (const u of details.fetchUrls.slice(0, 5)) {
|
|
1535
|
+
const display = u.length > 60 ? u.slice(0, 57) + "..." : u;
|
|
1536
|
+
lines.push(theme.fg("dim", " " + display));
|
|
1537
|
+
}
|
|
1538
|
+
if (details.fetchUrls.length > 5) {
|
|
1539
|
+
lines.push(theme.fg("dim", ` ... and ${details.fetchUrls.length - 5} more`));
|
|
1540
|
+
}
|
|
1541
|
+
}
|
|
1542
|
+
}
|
|
1543
|
+
const totalLines = lines.length;
|
|
1544
|
+
if (!expanded) {
|
|
1545
|
+
const box = new Box(1, 0, (t) => theme.bg("toolSuccessBg", t));
|
|
1546
|
+
box.addChild(new Text(statusLine, 0, 0));
|
|
1547
|
+
let collapsedLines = 1; // statusLine
|
|
1548
|
+
const summaryPreview = details?.summary?.text?.trim() || "";
|
|
1549
|
+
if (summaryPreview) {
|
|
1550
|
+
const preview = summaryPreview.length > 120 ? summaryPreview.slice(0, 117) + "..." : summaryPreview;
|
|
1551
|
+
box.addChild(new Text(theme.fg("dim", preview), 0, 0));
|
|
1552
|
+
collapsedLines++;
|
|
1553
|
+
}
|
|
1554
|
+
else if (details?.curatedQueries?.length) {
|
|
1555
|
+
for (const cq of details.curatedQueries.slice(0, 3)) {
|
|
1556
|
+
const dq = cq.query.length > 55 ? cq.query.slice(0, 52) + "..." : cq.query;
|
|
1557
|
+
const srcCount = cq.sources?.length ?? 0;
|
|
1558
|
+
const suffix = cq.error ? theme.fg("error", " (error)") : theme.fg("dim", ` · ${srcCount} sources`);
|
|
1559
|
+
box.addChild(new Text(theme.fg("accent", ` "${dq}"`) + suffix, 0, 0));
|
|
1560
|
+
collapsedLines++;
|
|
1561
|
+
}
|
|
1562
|
+
if (details.curatedQueries.length > 3) {
|
|
1563
|
+
box.addChild(new Text(theme.fg("dim", ` ... and ${details.curatedQueries.length - 3} more`), 0, 0));
|
|
1564
|
+
collapsedLines++;
|
|
1565
|
+
}
|
|
1566
|
+
}
|
|
1567
|
+
else {
|
|
1568
|
+
const textContent = result.content.find((c) => c.type === "text")?.text || "";
|
|
1569
|
+
const firstContentLine = textContent.split("\n").find(l => {
|
|
1570
|
+
const t = l.trim();
|
|
1571
|
+
return t && !t.startsWith("[") && !t.startsWith("#") && !t.startsWith("---");
|
|
1572
|
+
});
|
|
1573
|
+
const fallbackLine = (firstContentLine?.trim() || "").replace(/\*\*/g, "");
|
|
1574
|
+
if (fallbackLine) {
|
|
1575
|
+
const preview = fallbackLine.length > 120 ? fallbackLine.slice(0, 117) + "..." : fallbackLine;
|
|
1576
|
+
box.addChild(new Text(theme.fg("dim", preview), 0, 0));
|
|
1577
|
+
collapsedLines++;
|
|
1578
|
+
}
|
|
1579
|
+
}
|
|
1580
|
+
const moreLines = Math.max(0, totalLines - collapsedLines);
|
|
1581
|
+
if (moreLines > 0) {
|
|
1582
|
+
box.addChild(new Text(theme.fg("muted", `\n... (${moreLines} more lines, ${totalLines} total, ctrl+o to expand)`), 0, 0));
|
|
1583
|
+
}
|
|
1584
|
+
return box;
|
|
1585
|
+
}
|
|
1586
|
+
return new Text(lines.join("\n"), 0, 0);
|
|
1587
|
+
},
|
|
1588
|
+
});
|
|
1589
|
+
pi.registerTool({
|
|
1590
|
+
name: "fetch_content",
|
|
1591
|
+
label: "Fetch Content",
|
|
1592
|
+
description: "Fetch URL(s) and extract readable content as markdown. Supports YouTube video transcripts (with thumbnail), GitHub repository contents, and local video files (with frame thumbnail). Video frames can be extracted via timestamp/range or sampled across the entire video with frames alone. Falls back to Gemini for pages that block bots or fail Readability extraction. For YouTube and video files: ALWAYS pass the user's specific question via the prompt parameter — this directs the AI to focus on that aspect of the video, producing much better results than a generic extraction. Content is always stored and can be retrieved with get_search_content.",
|
|
1593
|
+
promptSnippet: "Use to extract readable content from URL(s), YouTube, GitHub repos, or local videos. For video questions, pass the user's exact question in prompt.",
|
|
1594
|
+
parameters: Type.Object({
|
|
1595
|
+
url: Type.Optional(Type.String({ description: "Single URL to fetch" })),
|
|
1596
|
+
urls: Type.Optional(Type.Array(Type.String(), { description: "Multiple URLs (parallel)" })),
|
|
1597
|
+
forceClone: Type.Optional(Type.Boolean({
|
|
1598
|
+
description: "Force cloning large GitHub repositories that exceed the size threshold",
|
|
1599
|
+
})),
|
|
1600
|
+
prompt: Type.Optional(Type.String({
|
|
1601
|
+
description: "Question or instruction for video analysis (YouTube and video files). Pass the user's specific question here — e.g. 'describe the book shown at the advice for beginners section'. Without this, a generic transcript extraction is used which may miss what the user is asking about.",
|
|
1602
|
+
})),
|
|
1603
|
+
timestamp: Type.Optional(Type.String({
|
|
1604
|
+
description: "Extract video frame(s) at a timestamp or time range. Single: '1:23:45', '23:45', or '85' (seconds). Range: '23:41-25:00' extracts evenly-spaced frames across that span (default 6). Use frames with ranges to control density; single+frames uses a fixed 5s interval. YouTube requires yt-dlp + ffmpeg; local videos require ffmpeg. Use a range when you know the approximate area but not the exact moment — you'll get a contact sheet to visually identify the right frame.",
|
|
1605
|
+
})),
|
|
1606
|
+
frames: Type.Optional(Type.Integer({
|
|
1607
|
+
minimum: 1,
|
|
1608
|
+
maximum: 12,
|
|
1609
|
+
description: "Number of frames to extract. Use with timestamp range for custom density, with single timestamp to get N frames at 5s intervals, or alone to sample across the entire video. Requires yt-dlp + ffmpeg for YouTube, ffmpeg for local video.",
|
|
1610
|
+
})),
|
|
1611
|
+
model: Type.Optional(Type.String({
|
|
1612
|
+
description: "Override the Gemini model for video/YouTube analysis (e.g. 'gemini-2.5-flash', 'gemini-3-flash-preview'). Defaults to config or gemini-3-flash-preview.",
|
|
1613
|
+
})),
|
|
1614
|
+
}),
|
|
1615
|
+
async execute(_toolCallId, params, signal, onUpdate) {
|
|
1616
|
+
const { urlList, options } = normalizeFetchContentParams(params);
|
|
1617
|
+
if (urlList.length === 0) {
|
|
1618
|
+
return {
|
|
1619
|
+
content: [{ type: "text", text: "Error: No URL provided." }],
|
|
1620
|
+
details: { error: "No URL provided" },
|
|
1621
|
+
};
|
|
1622
|
+
}
|
|
1623
|
+
onUpdate?.({
|
|
1624
|
+
content: [{ type: "text", text: `Fetching ${urlList.length} URL(s)...` }],
|
|
1625
|
+
details: { phase: "fetch", progress: 0 },
|
|
1626
|
+
});
|
|
1627
|
+
const fetchResults = await fetchAllContent(urlList, signal, options);
|
|
1628
|
+
const successful = fetchResults.filter((r) => !r.error).length;
|
|
1629
|
+
const totalChars = fetchResults.reduce((sum, r) => sum + r.content.length, 0);
|
|
1630
|
+
// ALWAYS store results (even for single URL)
|
|
1631
|
+
const responseId = generateId();
|
|
1632
|
+
const data = {
|
|
1633
|
+
id: responseId,
|
|
1634
|
+
type: "fetch",
|
|
1635
|
+
timestamp: Date.now(),
|
|
1636
|
+
urls: stripThumbnails(fetchResults),
|
|
1637
|
+
};
|
|
1638
|
+
storeResult(responseId, data);
|
|
1639
|
+
pi.appendEntry("web-search-results", data);
|
|
1640
|
+
// Single URL: return content directly (possibly truncated) with responseId
|
|
1641
|
+
if (urlList.length === 1) {
|
|
1642
|
+
const result = fetchResults[0];
|
|
1643
|
+
if (result.error) {
|
|
1644
|
+
return {
|
|
1645
|
+
content: [{ type: "text", text: `Error: ${result.error}` }],
|
|
1646
|
+
details: { urls: urlList, urlCount: 1, successful: 0, error: result.error, responseId, prompt: params.prompt, timestamp: params.timestamp, frames: params.frames },
|
|
1647
|
+
};
|
|
1648
|
+
}
|
|
1649
|
+
const fullLength = result.content.length;
|
|
1650
|
+
const truncated = fullLength > MAX_INLINE_CONTENT;
|
|
1651
|
+
let output = truncated
|
|
1652
|
+
? result.content.slice(0, MAX_INLINE_CONTENT) + "\n\n[Content truncated...]"
|
|
1653
|
+
: result.content;
|
|
1654
|
+
if (truncated) {
|
|
1655
|
+
output += `\n\n---\nShowing ${MAX_INLINE_CONTENT} of ${fullLength} chars. ` +
|
|
1656
|
+
`Use get_search_content({ responseId: "${responseId}", urlIndex: 0 }) for full content.`;
|
|
1657
|
+
}
|
|
1658
|
+
const content = [];
|
|
1659
|
+
if (result.frames?.length) {
|
|
1660
|
+
for (const frame of result.frames) {
|
|
1661
|
+
content.push({ type: "image", data: frame.data, mimeType: frame.mimeType });
|
|
1662
|
+
content.push({ type: "text", text: `Frame at ${frame.timestamp}` });
|
|
1663
|
+
}
|
|
1664
|
+
}
|
|
1665
|
+
else if (result.thumbnail) {
|
|
1666
|
+
content.push({ type: "image", data: result.thumbnail.data, mimeType: result.thumbnail.mimeType });
|
|
1667
|
+
}
|
|
1668
|
+
content.push({ type: "text", text: output });
|
|
1669
|
+
const imageCount = (result.frames?.length ?? 0) + (result.thumbnail ? 1 : 0);
|
|
1670
|
+
return {
|
|
1671
|
+
content,
|
|
1672
|
+
details: {
|
|
1673
|
+
urls: urlList,
|
|
1674
|
+
urlCount: 1,
|
|
1675
|
+
successful: 1,
|
|
1676
|
+
totalChars: fullLength,
|
|
1677
|
+
title: result.title,
|
|
1678
|
+
responseId,
|
|
1679
|
+
truncated,
|
|
1680
|
+
hasImage: imageCount > 0,
|
|
1681
|
+
imageCount,
|
|
1682
|
+
prompt: params.prompt,
|
|
1683
|
+
timestamp: params.timestamp,
|
|
1684
|
+
frames: params.frames,
|
|
1685
|
+
duration: result.duration,
|
|
1686
|
+
},
|
|
1687
|
+
};
|
|
1688
|
+
}
|
|
1689
|
+
// Multi-URL: existing behavior (summary + responseId)
|
|
1690
|
+
let output = "## Fetched URLs\n\n";
|
|
1691
|
+
for (const { url, title, content, error } of fetchResults) {
|
|
1692
|
+
if (error) {
|
|
1693
|
+
output += `- ${url}: Error - ${error}\n`;
|
|
1694
|
+
}
|
|
1695
|
+
else {
|
|
1696
|
+
output += `- ${title || url} (${content.length} chars)\n`;
|
|
1697
|
+
}
|
|
1698
|
+
}
|
|
1699
|
+
output += `\n---\nUse get_search_content({ responseId: "${responseId}", urlIndex: 0 }) to retrieve full content.`;
|
|
1700
|
+
return {
|
|
1701
|
+
content: [{ type: "text", text: output }],
|
|
1702
|
+
details: { urls: urlList, urlCount: urlList.length, successful, totalChars, responseId },
|
|
1703
|
+
};
|
|
1704
|
+
},
|
|
1705
|
+
renderCall(args, theme) {
|
|
1706
|
+
const { url, urls, prompt, timestamp, frames, model } = args;
|
|
1707
|
+
const urlList = urls ?? (url ? [url] : []);
|
|
1708
|
+
if (urlList.length === 0) {
|
|
1709
|
+
return new Text(theme.fg("toolTitle", theme.bold("fetch ")) + theme.fg("error", "(no URL)"), 0, 0);
|
|
1710
|
+
}
|
|
1711
|
+
const lines = [];
|
|
1712
|
+
if (urlList.length === 1) {
|
|
1713
|
+
const display = urlList[0].length > 60 ? urlList[0].slice(0, 57) + "..." : urlList[0];
|
|
1714
|
+
lines.push(theme.fg("toolTitle", theme.bold("fetch ")) + theme.fg("accent", display));
|
|
1715
|
+
}
|
|
1716
|
+
else {
|
|
1717
|
+
lines.push(theme.fg("toolTitle", theme.bold("fetch ")) + theme.fg("accent", `${urlList.length} URLs`));
|
|
1718
|
+
for (const u of urlList.slice(0, 5)) {
|
|
1719
|
+
const display = u.length > 60 ? u.slice(0, 57) + "..." : u;
|
|
1720
|
+
lines.push(theme.fg("muted", " " + display));
|
|
1721
|
+
}
|
|
1722
|
+
if (urlList.length > 5) {
|
|
1723
|
+
lines.push(theme.fg("muted", ` ... and ${urlList.length - 5} more`));
|
|
1724
|
+
}
|
|
1725
|
+
}
|
|
1726
|
+
if (timestamp) {
|
|
1727
|
+
lines.push(theme.fg("dim", " timestamp: ") + theme.fg("warning", timestamp));
|
|
1728
|
+
}
|
|
1729
|
+
if (typeof frames === "number") {
|
|
1730
|
+
lines.push(theme.fg("dim", " frames: ") + theme.fg("warning", String(frames)));
|
|
1731
|
+
}
|
|
1732
|
+
if (prompt) {
|
|
1733
|
+
const display = prompt.length > 250 ? prompt.slice(0, 247) + "..." : prompt;
|
|
1734
|
+
lines.push(theme.fg("dim", " prompt: ") + theme.fg("muted", `"${display}"`));
|
|
1735
|
+
}
|
|
1736
|
+
if (model) {
|
|
1737
|
+
lines.push(theme.fg("dim", " model: ") + theme.fg("warning", model));
|
|
1738
|
+
}
|
|
1739
|
+
return new Text(lines.join("\n"), 0, 0);
|
|
1740
|
+
},
|
|
1741
|
+
renderResult(result, { expanded, isPartial }, theme) {
|
|
1742
|
+
const details = result.details;
|
|
1743
|
+
if (isPartial) {
|
|
1744
|
+
const progress = details?.progress ?? 0;
|
|
1745
|
+
const bar = "\u2588".repeat(Math.floor(progress * 10)) + "\u2591".repeat(10 - Math.floor(progress * 10));
|
|
1746
|
+
return new Text(theme.fg("accent", `[${bar}] ${details?.phase || "fetching"}`), 0, 0);
|
|
1747
|
+
}
|
|
1748
|
+
if (details?.error) {
|
|
1749
|
+
const fd = details;
|
|
1750
|
+
const extras = [];
|
|
1751
|
+
if (typeof fd.urlCount === "number" || typeof fd.successful === "number") {
|
|
1752
|
+
extras.push(`urls: ${fd.successful ?? 0}/${fd.urlCount ?? 0} succeeded`);
|
|
1753
|
+
}
|
|
1754
|
+
if (fd.responseId)
|
|
1755
|
+
extras.push(`response id: ${fd.responseId}`);
|
|
1756
|
+
if (fd.urls && fd.urls.length > 0) {
|
|
1757
|
+
for (const u of fd.urls.slice(0, 8))
|
|
1758
|
+
extras.push(` \u25b8 ${u}`);
|
|
1759
|
+
if (fd.urls.length > 8)
|
|
1760
|
+
extras.push(` ... and ${fd.urls.length - 8} more`);
|
|
1761
|
+
}
|
|
1762
|
+
const plan = buildSearchErrorPlan({ error: details.error, extraLines: extras });
|
|
1763
|
+
if (plan)
|
|
1764
|
+
return renderSearchErrorPlan(plan, expanded, theme);
|
|
1765
|
+
return new Text(theme.fg("error", `Error: ${details.error}`), 0, 0);
|
|
1766
|
+
}
|
|
1767
|
+
if (details?.urlCount === 1) {
|
|
1768
|
+
const title = details?.title || "Untitled";
|
|
1769
|
+
const imgCount = details?.imageCount ?? (details?.hasImage ? 1 : 0);
|
|
1770
|
+
const imageBadge = imgCount > 1
|
|
1771
|
+
? theme.fg("accent", ` [${imgCount} images]`)
|
|
1772
|
+
: imgCount === 1
|
|
1773
|
+
? theme.fg("accent", " [image]")
|
|
1774
|
+
: "";
|
|
1775
|
+
let statusLine = theme.fg("success", title) + theme.fg("muted", ` (${details?.totalChars ?? 0} chars)`) + imageBadge;
|
|
1776
|
+
if (details?.truncated) {
|
|
1777
|
+
statusLine += theme.fg("warning", " [truncated]");
|
|
1778
|
+
}
|
|
1779
|
+
if (typeof details?.duration === "number") {
|
|
1780
|
+
statusLine += theme.fg("muted", ` | ${formatSeconds(Math.floor(details.duration))} total`);
|
|
1781
|
+
}
|
|
1782
|
+
const textContent = result.content.find((c) => c.type === "text")?.text || "";
|
|
1783
|
+
if (!expanded) {
|
|
1784
|
+
const brief = textContent.length > 200 ? textContent.slice(0, 200) + "..." : textContent;
|
|
1785
|
+
return new Text(statusLine + "\n" + theme.fg("dim", brief), 0, 0);
|
|
1786
|
+
}
|
|
1787
|
+
const lines = [statusLine];
|
|
1788
|
+
if (details?.prompt) {
|
|
1789
|
+
const display = details.prompt.length > 250 ? details.prompt.slice(0, 247) + "..." : details.prompt;
|
|
1790
|
+
lines.push(theme.fg("dim", ` prompt: "${display}"`));
|
|
1791
|
+
}
|
|
1792
|
+
if (details?.timestamp) {
|
|
1793
|
+
lines.push(theme.fg("dim", ` timestamp: ${details.timestamp}`));
|
|
1794
|
+
}
|
|
1795
|
+
if (typeof details?.frames === "number") {
|
|
1796
|
+
lines.push(theme.fg("dim", ` frames: ${details.frames}`));
|
|
1797
|
+
}
|
|
1798
|
+
const preview = textContent.length > 500 ? textContent.slice(0, 500) + "..." : textContent;
|
|
1799
|
+
lines.push(theme.fg("dim", preview));
|
|
1800
|
+
return new Text(lines.join("\n"), 0, 0);
|
|
1801
|
+
}
|
|
1802
|
+
const countColor = (details?.successful ?? 0) > 0 ? "success" : "error";
|
|
1803
|
+
const statusLine = theme.fg(countColor, `${details?.successful}/${details?.urlCount} URLs`) + theme.fg("muted", " (content stored)");
|
|
1804
|
+
if (!expanded) {
|
|
1805
|
+
return new Text(statusLine, 0, 0);
|
|
1806
|
+
}
|
|
1807
|
+
const textContent = result.content.find((c) => c.type === "text")?.text || "";
|
|
1808
|
+
const preview = textContent.length > 500 ? textContent.slice(0, 500) + "..." : textContent;
|
|
1809
|
+
return new Text(statusLine + "\n" + theme.fg("dim", preview), 0, 0);
|
|
1810
|
+
},
|
|
1811
|
+
});
|
|
1812
|
+
pi.registerTool({
|
|
1813
|
+
name: "get_search_content",
|
|
1814
|
+
label: "Get Search Content",
|
|
1815
|
+
description: "Retrieve full content from a previous web_search or fetch_content call.",
|
|
1816
|
+
promptSnippet: "Use after web_search/fetch_content when full stored content is needed via responseId plus query/url selectors.",
|
|
1817
|
+
parameters: Type.Object({
|
|
1818
|
+
responseId: Type.String({ description: "The responseId from web_search or fetch_content" }),
|
|
1819
|
+
query: Type.Optional(Type.String({ description: "Get content for this query (web_search)" })),
|
|
1820
|
+
queryIndex: Type.Optional(Type.Number({ description: "Get content for query at index" })),
|
|
1821
|
+
url: Type.Optional(Type.String({ description: "Get content for this URL" })),
|
|
1822
|
+
urlIndex: Type.Optional(Type.Number({ description: "Get content for URL at index" })),
|
|
1823
|
+
}),
|
|
1824
|
+
async execute(_toolCallId, params) {
|
|
1825
|
+
const data = getResult(params.responseId);
|
|
1826
|
+
if (!data) {
|
|
1827
|
+
return {
|
|
1828
|
+
content: [{ type: "text", text: `Error: No stored results for "${params.responseId}"` }],
|
|
1829
|
+
details: { error: "Not found", responseId: params.responseId },
|
|
1830
|
+
};
|
|
1831
|
+
}
|
|
1832
|
+
if (data.type === "search" && data.queries) {
|
|
1833
|
+
let queryData;
|
|
1834
|
+
if (params.query !== undefined) {
|
|
1835
|
+
queryData = data.queries.find((q) => q.query === params.query);
|
|
1836
|
+
if (!queryData) {
|
|
1837
|
+
const available = data.queries.map((q) => `"${q.query}"`).join(", ");
|
|
1838
|
+
return {
|
|
1839
|
+
content: [{ type: "text", text: `Query "${params.query}" not found. Available: ${available}` }],
|
|
1840
|
+
details: { error: "Query not found" },
|
|
1841
|
+
};
|
|
1842
|
+
}
|
|
1843
|
+
}
|
|
1844
|
+
else if (params.queryIndex !== undefined) {
|
|
1845
|
+
queryData = data.queries[params.queryIndex];
|
|
1846
|
+
if (!queryData) {
|
|
1847
|
+
return {
|
|
1848
|
+
content: [{ type: "text", text: `Index ${params.queryIndex} out of range (0-${data.queries.length - 1})` }],
|
|
1849
|
+
details: { error: "Index out of range" },
|
|
1850
|
+
};
|
|
1851
|
+
}
|
|
1852
|
+
}
|
|
1853
|
+
else {
|
|
1854
|
+
const available = data.queries.map((q, i) => `${i}: "${q.query}"`).join(", ");
|
|
1855
|
+
return {
|
|
1856
|
+
content: [{ type: "text", text: `Specify query or queryIndex. Available: ${available}` }],
|
|
1857
|
+
details: { error: "No query specified" },
|
|
1858
|
+
};
|
|
1859
|
+
}
|
|
1860
|
+
if (queryData.error) {
|
|
1861
|
+
return {
|
|
1862
|
+
content: [{ type: "text", text: `Error for "${queryData.query}": ${queryData.error}` }],
|
|
1863
|
+
details: { error: queryData.error, query: queryData.query },
|
|
1864
|
+
};
|
|
1865
|
+
}
|
|
1866
|
+
return {
|
|
1867
|
+
content: [{ type: "text", text: formatFullResults(queryData) }],
|
|
1868
|
+
details: { query: queryData.query, resultCount: queryData.results.length },
|
|
1869
|
+
};
|
|
1870
|
+
}
|
|
1871
|
+
if (data.type === "fetch" && data.urls) {
|
|
1872
|
+
let urlData;
|
|
1873
|
+
if (params.url !== undefined) {
|
|
1874
|
+
urlData = data.urls.find((u) => u.url === params.url);
|
|
1875
|
+
if (!urlData) {
|
|
1876
|
+
const available = data.urls.map((u) => u.url).join("\n ");
|
|
1877
|
+
return {
|
|
1878
|
+
content: [{ type: "text", text: `URL not found. Available:\n ${available}` }],
|
|
1879
|
+
details: { error: "URL not found" },
|
|
1880
|
+
};
|
|
1881
|
+
}
|
|
1882
|
+
}
|
|
1883
|
+
else if (params.urlIndex !== undefined) {
|
|
1884
|
+
urlData = data.urls[params.urlIndex];
|
|
1885
|
+
if (!urlData) {
|
|
1886
|
+
return {
|
|
1887
|
+
content: [{ type: "text", text: `Index ${params.urlIndex} out of range (0-${data.urls.length - 1})` }],
|
|
1888
|
+
details: { error: "Index out of range" },
|
|
1889
|
+
};
|
|
1890
|
+
}
|
|
1891
|
+
}
|
|
1892
|
+
else {
|
|
1893
|
+
const available = data.urls.map((u, i) => `${i}: ${u.url}`).join("\n ");
|
|
1894
|
+
return {
|
|
1895
|
+
content: [{ type: "text", text: `Specify url or urlIndex. Available:\n ${available}` }],
|
|
1896
|
+
details: { error: "No URL specified" },
|
|
1897
|
+
};
|
|
1898
|
+
}
|
|
1899
|
+
if (urlData.error) {
|
|
1900
|
+
return {
|
|
1901
|
+
content: [{ type: "text", text: `Error for ${urlData.url}: ${urlData.error}` }],
|
|
1902
|
+
details: { error: urlData.error, url: urlData.url },
|
|
1903
|
+
};
|
|
1904
|
+
}
|
|
1905
|
+
return {
|
|
1906
|
+
content: [{ type: "text", text: `# ${urlData.title}\n\n${urlData.content}` }],
|
|
1907
|
+
details: { url: urlData.url, title: urlData.title, contentLength: urlData.content.length },
|
|
1908
|
+
};
|
|
1909
|
+
}
|
|
1910
|
+
return {
|
|
1911
|
+
content: [{ type: "text", text: "Invalid stored data format" }],
|
|
1912
|
+
details: { error: "Invalid data" },
|
|
1913
|
+
};
|
|
1914
|
+
},
|
|
1915
|
+
renderCall(args, theme) {
|
|
1916
|
+
const { responseId, query, queryIndex, url, urlIndex } = args;
|
|
1917
|
+
let target = "";
|
|
1918
|
+
if (query)
|
|
1919
|
+
target = `query="${query}"`;
|
|
1920
|
+
else if (queryIndex !== undefined)
|
|
1921
|
+
target = `queryIndex=${queryIndex}`;
|
|
1922
|
+
else if (url)
|
|
1923
|
+
target = url.length > 30 ? url.slice(0, 27) + "..." : url;
|
|
1924
|
+
else if (urlIndex !== undefined)
|
|
1925
|
+
target = `urlIndex=${urlIndex}`;
|
|
1926
|
+
return new Text(theme.fg("toolTitle", theme.bold("get_content ")) + theme.fg("accent", target || responseId.slice(0, 8)), 0, 0);
|
|
1927
|
+
},
|
|
1928
|
+
renderResult(result, { expanded }, theme) {
|
|
1929
|
+
const details = result.details;
|
|
1930
|
+
if (details?.error) {
|
|
1931
|
+
const extras = [];
|
|
1932
|
+
if (details.query)
|
|
1933
|
+
extras.push(`query: ${details.query}`);
|
|
1934
|
+
if (details.url)
|
|
1935
|
+
extras.push(`url: ${details.url}`);
|
|
1936
|
+
else if (details.title)
|
|
1937
|
+
extras.push(`resource: ${details.title}`);
|
|
1938
|
+
const plan = buildSearchErrorPlan({ error: details.error, extraLines: extras });
|
|
1939
|
+
if (plan)
|
|
1940
|
+
return renderSearchErrorPlan(plan, expanded, theme);
|
|
1941
|
+
return new Text(theme.fg("error", `Error: ${details.error}`), 0, 0);
|
|
1942
|
+
}
|
|
1943
|
+
let statusLine;
|
|
1944
|
+
if (details?.query) {
|
|
1945
|
+
statusLine = theme.fg("success", `"${details.query}"`) + theme.fg("muted", ` (${details.resultCount} results)`);
|
|
1946
|
+
}
|
|
1947
|
+
else {
|
|
1948
|
+
statusLine = theme.fg("success", details?.title || "Content") + theme.fg("muted", ` (${details?.contentLength ?? 0} chars)`);
|
|
1949
|
+
}
|
|
1950
|
+
if (!expanded) {
|
|
1951
|
+
return new Text(statusLine, 0, 0);
|
|
1952
|
+
}
|
|
1953
|
+
const textContent = result.content.find((c) => c.type === "text")?.text || "";
|
|
1954
|
+
const preview = textContent.length > 500 ? textContent.slice(0, 500) + "..." : textContent;
|
|
1955
|
+
return new Text(statusLine + "\n" + theme.fg("dim", preview), 0, 0);
|
|
1956
|
+
},
|
|
1957
|
+
});
|
|
1958
|
+
pi.registerCommand("websearch", {
|
|
1959
|
+
description: "Open web search curator",
|
|
1960
|
+
handler: async (args, ctx) => {
|
|
1961
|
+
const sessionToken = randomUUID();
|
|
1962
|
+
const commandCallId = `cmd:${sessionToken}`;
|
|
1963
|
+
closeCurator(commandCallId);
|
|
1964
|
+
const raw = args.trim();
|
|
1965
|
+
const queries = raw.length > 0
|
|
1966
|
+
? normalizeQueryList(raw.split(","))
|
|
1967
|
+
: [];
|
|
1968
|
+
let bootstrap;
|
|
1969
|
+
try {
|
|
1970
|
+
bootstrap = await loadCuratorBootstrap(undefined, ctx);
|
|
1971
|
+
}
|
|
1972
|
+
catch (err) {
|
|
1973
|
+
const message = err instanceof Error ? err.message : String(err);
|
|
1974
|
+
ctx.ui.notify(`Failed to load web search config: ${message}`, "error");
|
|
1975
|
+
return;
|
|
1976
|
+
}
|
|
1977
|
+
const availableProviders = bootstrap.availableProviders;
|
|
1978
|
+
const initialProvider = bootstrap.defaultProvider;
|
|
1979
|
+
const curatorTimeoutSeconds = bootstrap.timeoutSeconds;
|
|
1980
|
+
let currentProvider = initialProvider;
|
|
1981
|
+
const rawSearchProvider = normalizeProviderInput(loadConfig().provider ?? "auto") ?? "auto";
|
|
1982
|
+
let currentSearchProvider = rawSearchProvider === "auto" ? "auto" : initialProvider;
|
|
1983
|
+
const summaryContext = {
|
|
1984
|
+
model: ctx.model,
|
|
1985
|
+
modelRegistry: ctx.modelRegistry,
|
|
1986
|
+
cwd: ctx.cwd,
|
|
1987
|
+
isProjectTrusted: () => ctx.isProjectTrusted(),
|
|
1988
|
+
};
|
|
1989
|
+
const summaryModelChoices = await loadSummaryModelChoices(summaryContext);
|
|
1990
|
+
ctx.ui.notify("Opening web search curator...", "info");
|
|
1991
|
+
const collected = new Map();
|
|
1992
|
+
const searchAbort = new AbortController();
|
|
1993
|
+
let aborted = false;
|
|
1994
|
+
let commandHandle = null;
|
|
1995
|
+
const isCommandActive = () => commandHandle !== null && activeCurators.get(commandCallId) === commandHandle;
|
|
1996
|
+
function sendFollowUpFromReturn(payload) {
|
|
1997
|
+
pi.sendMessage({
|
|
1998
|
+
customType: "web-search-results",
|
|
1999
|
+
content: payload.content,
|
|
2000
|
+
display: true,
|
|
2001
|
+
details: payload.details,
|
|
2002
|
+
}, { triggerTurn: true, deliverAs: "followUp" });
|
|
2003
|
+
}
|
|
2004
|
+
try {
|
|
2005
|
+
const handle = await startCuratorServer({
|
|
2006
|
+
queries,
|
|
2007
|
+
sessionToken,
|
|
2008
|
+
timeout: curatorTimeoutSeconds,
|
|
2009
|
+
availableProviders,
|
|
2010
|
+
defaultProvider: initialProvider,
|
|
2011
|
+
searchProvider: currentSearchProvider,
|
|
2012
|
+
summaryModels: summaryModelChoices.summaryModels,
|
|
2013
|
+
defaultSummaryModel: summaryModelChoices.defaultSummaryModel,
|
|
2014
|
+
}, {
|
|
2015
|
+
async onSummarize(selectedQueryIndices, summarizeSignal, model, feedback) {
|
|
2016
|
+
if (commandHandle && !isCommandActive()) {
|
|
2017
|
+
throw new Error("Curator session is no longer active.");
|
|
2018
|
+
}
|
|
2019
|
+
return generateSummaryForSelectedIndices(selectedQueryIndices, collected, summaryContext, summarizeSignal, model, feedback);
|
|
2020
|
+
},
|
|
2021
|
+
onSubmit(payload) {
|
|
2022
|
+
if (commandHandle && !isCommandActive())
|
|
2023
|
+
return;
|
|
2024
|
+
aborted = true;
|
|
2025
|
+
searchAbort.abort();
|
|
2026
|
+
const filtered = payload.selectedQueryIndices.length > 0
|
|
2027
|
+
? filterByQueryIndices(payload.selectedQueryIndices, collected)
|
|
2028
|
+
: collectAllResultsAndUrls(collected);
|
|
2029
|
+
const base = {
|
|
2030
|
+
queryList: filtered.results.map(r => r.query),
|
|
2031
|
+
results: filtered.results,
|
|
2032
|
+
urls: filtered.urls,
|
|
2033
|
+
includeContent: false,
|
|
2034
|
+
curated: true,
|
|
2035
|
+
curatedFrom: collected.size,
|
|
2036
|
+
};
|
|
2037
|
+
if (!payload.rawResults) {
|
|
2038
|
+
const resolvedSummary = resolveSummaryForSubmit(payload, collected);
|
|
2039
|
+
base.workflow = "summary-review";
|
|
2040
|
+
base.approvedSummary = resolvedSummary.approvedSummary;
|
|
2041
|
+
base.summaryMeta = resolvedSummary.summaryMeta;
|
|
2042
|
+
}
|
|
2043
|
+
sendFollowUpFromReturn(buildSearchReturn(base));
|
|
2044
|
+
closeCurator(commandCallId);
|
|
2045
|
+
},
|
|
2046
|
+
onCancel(reason) {
|
|
2047
|
+
if (commandHandle && !isCommandActive())
|
|
2048
|
+
return;
|
|
2049
|
+
aborted = true;
|
|
2050
|
+
searchAbort.abort();
|
|
2051
|
+
if (reason === "timeout") {
|
|
2052
|
+
const all = collectAllResultsAndUrls(collected);
|
|
2053
|
+
const resolvedSummary = resolveSummaryForSubmit({ selectedQueryIndices: [], summary: undefined, summaryMeta: undefined }, collected);
|
|
2054
|
+
sendFollowUpFromReturn(buildSearchReturn({
|
|
2055
|
+
queryList: all.results.map(r => r.query),
|
|
2056
|
+
results: all.results,
|
|
2057
|
+
urls: all.urls,
|
|
2058
|
+
includeContent: false,
|
|
2059
|
+
curated: true,
|
|
2060
|
+
curatedFrom: collected.size,
|
|
2061
|
+
workflow: "summary-review",
|
|
2062
|
+
approvedSummary: resolvedSummary.approvedSummary,
|
|
2063
|
+
summaryMeta: resolvedSummary.summaryMeta,
|
|
2064
|
+
}));
|
|
2065
|
+
}
|
|
2066
|
+
closeCurator(commandCallId);
|
|
2067
|
+
},
|
|
2068
|
+
onProviderChange(provider) {
|
|
2069
|
+
if (commandHandle && !isCommandActive())
|
|
2070
|
+
return;
|
|
2071
|
+
const normalized = normalizeProviderInput(provider);
|
|
2072
|
+
if (!normalized || normalized === "auto")
|
|
2073
|
+
return;
|
|
2074
|
+
currentProvider = normalized;
|
|
2075
|
+
currentSearchProvider = normalized;
|
|
2076
|
+
try {
|
|
2077
|
+
saveConfig({ provider: normalized });
|
|
2078
|
+
}
|
|
2079
|
+
catch (err) {
|
|
2080
|
+
const message = err instanceof Error ? err.message : String(err);
|
|
2081
|
+
console.error(`Failed to persist default provider: ${message}`);
|
|
2082
|
+
}
|
|
2083
|
+
},
|
|
2084
|
+
async onAddSearch(query, queryIndex, provider) {
|
|
2085
|
+
if (commandHandle && !isCommandActive()) {
|
|
2086
|
+
throw new Error("Curator session is no longer active.");
|
|
2087
|
+
}
|
|
2088
|
+
const normalizedProvider = normalizeProviderInput(provider);
|
|
2089
|
+
const requestedProvider = !normalizedProvider || normalizedProvider === "auto"
|
|
2090
|
+
? currentSearchProvider
|
|
2091
|
+
: normalizedProvider;
|
|
2092
|
+
try {
|
|
2093
|
+
const { answer, results, provider: actualProvider } = await search(query, {
|
|
2094
|
+
provider: requestedProvider,
|
|
2095
|
+
signal: searchAbort.signal,
|
|
2096
|
+
extensionContext: ctx,
|
|
2097
|
+
});
|
|
2098
|
+
if (commandHandle && !isCommandActive()) {
|
|
2099
|
+
throw new Error("Curator session is no longer active.");
|
|
2100
|
+
}
|
|
2101
|
+
collected.set(queryIndex, { query, answer, results, error: null, provider: actualProvider });
|
|
2102
|
+
return {
|
|
2103
|
+
answer,
|
|
2104
|
+
results: results.map(r => ({ title: r.title, url: r.url, domain: extractDomain(r.url) })),
|
|
2105
|
+
provider: actualProvider,
|
|
2106
|
+
};
|
|
2107
|
+
}
|
|
2108
|
+
catch (err) {
|
|
2109
|
+
const message = err instanceof Error ? err.message : String(err);
|
|
2110
|
+
if (!commandHandle || isCommandActive()) {
|
|
2111
|
+
collected.set(queryIndex, { query, answer: "", results: [], error: message, provider: requestedProvider });
|
|
2112
|
+
}
|
|
2113
|
+
throw err;
|
|
2114
|
+
}
|
|
2115
|
+
},
|
|
2116
|
+
async onRewriteQuery(query, rewriteSignal) {
|
|
2117
|
+
if (commandHandle && !isCommandActive()) {
|
|
2118
|
+
throw new Error("Curator session is no longer active.");
|
|
2119
|
+
}
|
|
2120
|
+
return rewriteSearchQuery(query, summaryContext, rewriteSignal);
|
|
2121
|
+
},
|
|
2122
|
+
});
|
|
2123
|
+
commandHandle = handle;
|
|
2124
|
+
activeCurators.set(commandCallId, handle);
|
|
2125
|
+
const open = platform() === "darwin" ? await getGlimpseOpen() : null;
|
|
2126
|
+
let browserOpenError = null;
|
|
2127
|
+
if (open) {
|
|
2128
|
+
try {
|
|
2129
|
+
const win = openInGlimpse(open, handle.url, "Search Curator");
|
|
2130
|
+
glimpseWins.set(commandCallId, win);
|
|
2131
|
+
win.on("closed", () => {
|
|
2132
|
+
if (glimpseWins.get(commandCallId) === win) {
|
|
2133
|
+
glimpseWins.delete(commandCallId);
|
|
2134
|
+
closeCurator(commandCallId);
|
|
2135
|
+
}
|
|
2136
|
+
});
|
|
2137
|
+
}
|
|
2138
|
+
catch (err) {
|
|
2139
|
+
const message = err instanceof Error ? err.message : String(err);
|
|
2140
|
+
console.error(`Failed to open Glimpse curator window: ${message}`);
|
|
2141
|
+
glimpseWins.delete(commandCallId);
|
|
2142
|
+
try {
|
|
2143
|
+
await openInBrowser(pi, handle.url);
|
|
2144
|
+
}
|
|
2145
|
+
catch (browserErr) {
|
|
2146
|
+
browserOpenError = browserErr instanceof Error ? browserErr.message : String(browserErr);
|
|
2147
|
+
}
|
|
2148
|
+
}
|
|
2149
|
+
}
|
|
2150
|
+
else {
|
|
2151
|
+
try {
|
|
2152
|
+
await openInBrowser(pi, handle.url);
|
|
2153
|
+
}
|
|
2154
|
+
catch (browserErr) {
|
|
2155
|
+
browserOpenError = browserErr instanceof Error ? browserErr.message : String(browserErr);
|
|
2156
|
+
}
|
|
2157
|
+
}
|
|
2158
|
+
if (browserOpenError) {
|
|
2159
|
+
console.error(`Failed to open curator UI: ${browserOpenError}`);
|
|
2160
|
+
ctx.ui.notify(`Search curator is running, but the browser did not open automatically. Open manually: ${handle.url}`, "info");
|
|
2161
|
+
}
|
|
2162
|
+
if (queries.length > 0) {
|
|
2163
|
+
(async () => {
|
|
2164
|
+
for (let qi = 0; qi < queries.length; qi++) {
|
|
2165
|
+
if (aborted || !isCommandActive())
|
|
2166
|
+
break;
|
|
2167
|
+
const requestedProvider = currentSearchProvider;
|
|
2168
|
+
try {
|
|
2169
|
+
const { answer, results, provider } = await search(queries[qi], {
|
|
2170
|
+
provider: requestedProvider,
|
|
2171
|
+
signal: searchAbort.signal,
|
|
2172
|
+
extensionContext: ctx,
|
|
2173
|
+
});
|
|
2174
|
+
if (aborted || !isCommandActive())
|
|
2175
|
+
break;
|
|
2176
|
+
handle.pushResult(qi, {
|
|
2177
|
+
answer,
|
|
2178
|
+
results: results.map(r => ({ title: r.title, url: r.url, domain: extractDomain(r.url) })),
|
|
2179
|
+
provider,
|
|
2180
|
+
});
|
|
2181
|
+
collected.set(qi, { query: queries[qi], answer, results, error: null, provider });
|
|
2182
|
+
}
|
|
2183
|
+
catch (err) {
|
|
2184
|
+
if (aborted || !isCommandActive())
|
|
2185
|
+
break;
|
|
2186
|
+
const message = err instanceof Error ? err.message : String(err);
|
|
2187
|
+
handle.pushError(qi, message, requestedProvider);
|
|
2188
|
+
collected.set(qi, { query: queries[qi], answer: "", results: [], error: message, provider: requestedProvider });
|
|
2189
|
+
}
|
|
2190
|
+
}
|
|
2191
|
+
if (!aborted && isCommandActive())
|
|
2192
|
+
handle.searchesDone();
|
|
2193
|
+
})();
|
|
2194
|
+
}
|
|
2195
|
+
else {
|
|
2196
|
+
if (isCommandActive())
|
|
2197
|
+
handle.searchesDone();
|
|
2198
|
+
}
|
|
2199
|
+
}
|
|
2200
|
+
catch (err) {
|
|
2201
|
+
closeCurator(commandCallId);
|
|
2202
|
+
const message = err instanceof Error ? err.message : String(err);
|
|
2203
|
+
ctx.ui.notify(`Failed to open curator: ${message}`, "error");
|
|
2204
|
+
}
|
|
2205
|
+
},
|
|
2206
|
+
});
|
|
2207
|
+
pi.registerCommand("curator", {
|
|
2208
|
+
description: "Toggle or configure the search curator workflow",
|
|
2209
|
+
handler: async (args, ctx) => {
|
|
2210
|
+
const arg = args.trim().toLowerCase();
|
|
2211
|
+
let newWorkflow;
|
|
2212
|
+
if (arg.length === 0) {
|
|
2213
|
+
const current = resolveWorkflow(loadConfigForExtensionInit().workflow, true);
|
|
2214
|
+
newWorkflow = current === "none" ? "summary-review" : "none";
|
|
2215
|
+
}
|
|
2216
|
+
else if (arg === "on") {
|
|
2217
|
+
newWorkflow = "summary-review";
|
|
2218
|
+
}
|
|
2219
|
+
else if (arg === "off") {
|
|
2220
|
+
newWorkflow = "none";
|
|
2221
|
+
}
|
|
2222
|
+
else if (arg === "none" || arg === "summary-review" || arg === "auto-summary") {
|
|
2223
|
+
newWorkflow = arg;
|
|
2224
|
+
}
|
|
2225
|
+
else {
|
|
2226
|
+
ctx.ui.notify(`Unknown option: ${arg}. Use on, off, summary-review, or auto-summary.`, "error");
|
|
2227
|
+
return;
|
|
2228
|
+
}
|
|
2229
|
+
try {
|
|
2230
|
+
saveConfig({ workflow: newWorkflow });
|
|
2231
|
+
}
|
|
2232
|
+
catch (err) {
|
|
2233
|
+
const message = err instanceof Error ? err.message : String(err);
|
|
2234
|
+
ctx.ui.notify(`Failed to save config: ${message}`, "error");
|
|
2235
|
+
return;
|
|
2236
|
+
}
|
|
2237
|
+
const label = newWorkflow === "none"
|
|
2238
|
+
? "Curator disabled — web_search will return raw results"
|
|
2239
|
+
: newWorkflow === "auto-summary"
|
|
2240
|
+
? "Auto-summary enabled — web_search will generate a summary without opening the curator"
|
|
2241
|
+
: "Curator enabled — web_search will open curator and auto-generate a summary draft";
|
|
2242
|
+
pi.sendMessage({
|
|
2243
|
+
customType: "curator-config",
|
|
2244
|
+
content: [{ type: "text", text: label }],
|
|
2245
|
+
display: true,
|
|
2246
|
+
details: { workflow: newWorkflow },
|
|
2247
|
+
}, { triggerTurn: false, deliverAs: "followUp" });
|
|
2248
|
+
},
|
|
2249
|
+
});
|
|
2250
|
+
pi.registerCommand("google-account", {
|
|
2251
|
+
description: "Show the active Google account for Gemini Web",
|
|
2252
|
+
handler: async () => {
|
|
2253
|
+
if (!isBrowserCookieAccessAllowed()) {
|
|
2254
|
+
pi.sendMessage({
|
|
2255
|
+
customType: "google-account",
|
|
2256
|
+
content: [{ type: "text", text: `Gemini Web browser cookie access is disabled. Set allowBrowserCookies: true in ${WEB_SEARCH_CONFIG_PATH} to enable it.` }],
|
|
2257
|
+
display: true,
|
|
2258
|
+
details: { available: false, cookieAccessAllowed: false },
|
|
2259
|
+
}, { triggerTurn: true, deliverAs: "followUp" });
|
|
2260
|
+
return;
|
|
2261
|
+
}
|
|
2262
|
+
const cookies = await isGeminiWebAvailable();
|
|
2263
|
+
if (!cookies) {
|
|
2264
|
+
pi.sendMessage({
|
|
2265
|
+
customType: "google-account",
|
|
2266
|
+
content: [{ type: "text", text: "Gemini Web is unavailable. Sign into gemini.google.com in a supported Chromium-based browser." }],
|
|
2267
|
+
display: true,
|
|
2268
|
+
details: { available: false, cookieAccessAllowed: true },
|
|
2269
|
+
}, { triggerTurn: true, deliverAs: "followUp" });
|
|
2270
|
+
return;
|
|
2271
|
+
}
|
|
2272
|
+
const email = await getActiveGoogleEmail(cookies);
|
|
2273
|
+
const text = email
|
|
2274
|
+
? `Active Google account: ${email}`
|
|
2275
|
+
: "Gemini Web is available, but the active Google account could not be determined.";
|
|
2276
|
+
pi.sendMessage({
|
|
2277
|
+
customType: "google-account",
|
|
2278
|
+
content: [{ type: "text", text }],
|
|
2279
|
+
display: true,
|
|
2280
|
+
details: { available: true, email: email ?? null },
|
|
2281
|
+
}, { triggerTurn: true, deliverAs: "followUp" });
|
|
2282
|
+
},
|
|
2283
|
+
});
|
|
2284
|
+
pi.registerCommand("search", {
|
|
2285
|
+
description: "Browse stored web search results",
|
|
2286
|
+
handler: async (_args, ctx) => {
|
|
2287
|
+
const results = getAllResults();
|
|
2288
|
+
if (results.length === 0) {
|
|
2289
|
+
ctx.ui.notify("No stored search results", "info");
|
|
2290
|
+
return;
|
|
2291
|
+
}
|
|
2292
|
+
const options = results.map((r) => {
|
|
2293
|
+
const age = Math.floor((Date.now() - r.timestamp) / 60000);
|
|
2294
|
+
const ageStr = age < 60 ? `${age}m ago` : `${Math.floor(age / 60)}h ago`;
|
|
2295
|
+
if (r.type === "search" && r.queries) {
|
|
2296
|
+
const query = r.queries[0]?.query || "unknown";
|
|
2297
|
+
return `[${r.id.slice(0, 6)}] "${query}" (${r.queries.length} queries) - ${ageStr}`;
|
|
2298
|
+
}
|
|
2299
|
+
if (r.type === "fetch" && r.urls) {
|
|
2300
|
+
return `[${r.id.slice(0, 6)}] ${r.urls.length} URLs fetched - ${ageStr}`;
|
|
2301
|
+
}
|
|
2302
|
+
return `[${r.id.slice(0, 6)}] ${r.type} - ${ageStr}`;
|
|
2303
|
+
});
|
|
2304
|
+
const choice = await ctx.ui.select("Stored Search Results", options);
|
|
2305
|
+
if (!choice)
|
|
2306
|
+
return;
|
|
2307
|
+
const match = choice.match(/^\[([a-z0-9]+)\]/);
|
|
2308
|
+
if (!match)
|
|
2309
|
+
return;
|
|
2310
|
+
const selected = results.find((r) => r.id.startsWith(match[1]));
|
|
2311
|
+
if (!selected)
|
|
2312
|
+
return;
|
|
2313
|
+
const actions = ["View details", "Delete"];
|
|
2314
|
+
const action = await ctx.ui.select(`Result ${selected.id.slice(0, 6)}`, actions);
|
|
2315
|
+
if (action === "Delete") {
|
|
2316
|
+
deleteResult(selected.id);
|
|
2317
|
+
ctx.ui.notify(`Deleted ${selected.id.slice(0, 6)}`, "info");
|
|
2318
|
+
}
|
|
2319
|
+
else if (action === "View details") {
|
|
2320
|
+
let info = `ID: ${selected.id}\nType: ${selected.type}\nAge: ${Math.floor((Date.now() - selected.timestamp) / 60000)}m\n\n`;
|
|
2321
|
+
if (selected.type === "search" && selected.queries) {
|
|
2322
|
+
info += "Queries:\n";
|
|
2323
|
+
const queries = selected.queries.slice(0, 10);
|
|
2324
|
+
for (const q of queries) {
|
|
2325
|
+
info += `- "${q.query}" (${q.results.length} results)\n`;
|
|
2326
|
+
}
|
|
2327
|
+
if (selected.queries.length > 10) {
|
|
2328
|
+
info += `... and ${selected.queries.length - 10} more\n`;
|
|
2329
|
+
}
|
|
2330
|
+
}
|
|
2331
|
+
if (selected.type === "fetch" && selected.urls) {
|
|
2332
|
+
info += "URLs:\n";
|
|
2333
|
+
const urls = selected.urls.slice(0, 10);
|
|
2334
|
+
for (const u of urls) {
|
|
2335
|
+
const urlDisplay = u.url.length > 50 ? u.url.slice(0, 47) + "..." : u.url;
|
|
2336
|
+
info += `- ${urlDisplay} (${u.error || `${u.content.length} chars`})\n`;
|
|
2337
|
+
}
|
|
2338
|
+
if (selected.urls.length > 10) {
|
|
2339
|
+
info += `... and ${selected.urls.length - 10} more\n`;
|
|
2340
|
+
}
|
|
2341
|
+
}
|
|
2342
|
+
ctx.ui.notify(info, "info");
|
|
2343
|
+
}
|
|
2344
|
+
},
|
|
2345
|
+
});
|
|
2346
|
+
}
|
|
2347
|
+
//# sourceMappingURL=index.js.map
|