@oh-my-pi/pi-coding-agent 7.0.0 → 8.0.1
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 +87 -0
- package/README.md +1 -1
- package/docs/hooks.md +2 -2
- package/docs/sdk.md +1 -1
- package/package.json +12 -11
- package/scripts/format-prompts.ts +143 -0
- package/scripts/generate-template.ts +1 -1
- package/src/cli/args.ts +3 -3
- package/src/cli/config-cli.ts +4 -4
- package/src/cli/file-processor.ts +3 -3
- package/src/cli/list-models.ts +2 -2
- package/src/cli/plugin-cli.ts +3 -3
- package/src/cli/session-picker.ts +2 -2
- package/src/cli/setup-cli.ts +2 -2
- package/src/cli/stats-cli.ts +1 -1
- package/src/cli/update-cli.ts +2 -2
- package/src/{core → config}/keybindings.ts +1 -1
- package/src/{core → config}/model-registry.ts +1 -1
- package/src/{core → config}/model-resolver.ts +3 -3
- package/src/{core → config}/prompt-templates.ts +2 -2
- package/src/{core → config}/settings-manager.ts +6 -6
- package/src/{core/cursor/exec-bridge.ts → cursor.ts} +4 -4
- package/src/discovery/agents-md.ts +4 -4
- package/src/discovery/builtin.ts +17 -17
- package/src/discovery/claude.ts +12 -12
- package/src/discovery/cline.ts +6 -6
- package/src/discovery/codex.ts +21 -21
- package/src/discovery/cursor.ts +9 -9
- package/src/discovery/gemini.ts +9 -9
- package/src/discovery/github.ts +6 -6
- package/src/discovery/helpers.ts +4 -4
- package/src/discovery/index.ts +16 -16
- package/src/discovery/mcp-json.ts +4 -4
- package/src/discovery/ssh.ts +4 -4
- package/src/discovery/vscode.ts +4 -4
- package/src/discovery/windsurf.ts +6 -6
- package/src/{core/tools/exa → exa}/company.ts +2 -3
- package/src/{core/tools/exa → exa}/index.ts +2 -2
- package/src/{core/tools/exa → exa}/linkedin.ts +2 -3
- package/src/{core/tools/exa → exa}/mcp-client.ts +2 -2
- package/src/{core/tools/exa → exa}/render.ts +3 -3
- package/src/{core/tools/exa → exa}/researcher.ts +1 -1
- package/src/{core/tools/exa → exa}/search.ts +2 -10
- package/src/{core/tools/exa → exa}/websets.ts +1 -1
- package/src/{core → exec}/bash-executor.ts +22 -6
- package/src/{core → export}/custom-share.ts +1 -1
- package/src/{core/export-html → export/html}/index.ts +3 -3
- package/src/{core → export}/ttsr.ts +2 -2
- package/src/{core → extensibility}/custom-commands/bundled/review/index.ts +4 -4
- package/src/{core → extensibility}/custom-commands/loader.ts +3 -3
- package/src/{core → extensibility}/custom-commands/types.ts +1 -1
- package/src/{core → extensibility}/custom-tools/loader.ts +9 -9
- package/src/{core → extensibility}/custom-tools/types.ts +6 -6
- package/src/{core → extensibility}/custom-tools/wrapper.ts +1 -1
- package/src/{core → extensibility}/extensions/loader.ts +8 -8
- package/src/{core → extensibility}/extensions/runner.ts +3 -3
- package/src/{core → extensibility}/extensions/types.ts +15 -15
- package/src/{core → extensibility}/extensions/wrapper.ts +1 -1
- package/src/{core → extensibility}/hooks/index.ts +1 -1
- package/src/{core → extensibility}/hooks/loader.ts +7 -7
- package/src/{core → extensibility}/hooks/runner.ts +4 -4
- package/src/{core → extensibility}/hooks/types.ts +9 -9
- package/src/{core → extensibility}/plugins/doctor.ts +1 -1
- package/src/{core → extensibility}/plugins/installer.ts +2 -3
- package/src/{core → extensibility}/plugins/paths.ts +1 -1
- package/src/{core → extensibility}/skills.ts +8 -48
- package/src/{core → extensibility}/slash-commands.ts +6 -6
- package/src/index.ts +127 -128
- package/src/internal-urls/agent-protocol.ts +126 -0
- package/src/internal-urls/artifact-protocol.ts +93 -0
- package/src/internal-urls/index.ts +28 -0
- package/src/internal-urls/json-query.ts +126 -0
- package/src/internal-urls/router.ts +69 -0
- package/src/internal-urls/rule-protocol.ts +56 -0
- package/src/internal-urls/skill-protocol.ts +112 -0
- package/src/internal-urls/types.ts +48 -0
- package/src/{core/python-executor.ts → ipy/executor.ts} +51 -11
- package/src/{core/python-gateway-coordinator.ts → ipy/gateway-coordinator.ts} +41 -325
- package/src/{core/python-kernel.ts → ipy/kernel.ts} +38 -10
- package/src/ipy/prelude.ts +3 -0
- package/src/{core/tools/lsp → lsp}/client.ts +7 -6
- package/src/{core/tools/lsp → lsp}/clients/biome-client.ts +1 -1
- package/src/{core/tools/lsp → lsp}/clients/index.ts +1 -1
- package/src/{core/tools/lsp → lsp}/clients/lsp-linter-client.ts +4 -4
- package/src/{core/tools/lsp → lsp}/config.ts +1 -1
- package/src/{core/tools/lsp → lsp}/index.ts +16 -15
- package/src/{core/tools/lsp → lsp}/render.ts +2 -2
- package/src/{core/tools/lsp → lsp}/types.ts +14 -16
- package/src/{core/tools/lsp → lsp}/utils.ts +1 -1
- package/src/main.ts +12 -12
- package/src/{core/mcp → mcp}/config.ts +8 -8
- package/src/{core/mcp → mcp}/loader.ts +5 -6
- package/src/{core/mcp → mcp}/manager.ts +2 -2
- package/src/{core/mcp → mcp}/tool-bridge.ts +35 -6
- package/src/{core/mcp → mcp}/tool-cache.ts +1 -1
- package/src/{core/mcp → mcp}/transports/http.ts +7 -1
- package/src/{core/mcp → mcp}/transports/stdio.ts +1 -1
- package/src/{core/mcp → mcp}/types.ts +1 -1
- package/src/migrations.ts +2 -2
- package/src/modes/{interactive/components → components}/armin.ts +1 -1
- package/src/modes/{interactive/components → components}/assistant-message.ts +1 -1
- package/src/modes/{interactive/components → components}/bash-execution.ts +37 -29
- package/src/modes/{interactive/components → components}/bordered-loader.ts +1 -1
- package/src/modes/{interactive/components → components}/branch-summary-message.ts +2 -2
- package/src/modes/{interactive/components → components}/compaction-summary-message.ts +2 -2
- package/src/modes/{interactive/components → components}/custom-message.ts +3 -3
- package/src/modes/{interactive/components → components}/diff.ts +1 -1
- package/src/modes/{interactive/components → components}/dynamic-border.ts +1 -1
- package/src/modes/{interactive/components → components}/extensions/extension-dashboard.ts +3 -3
- package/src/modes/{interactive/components → components}/extensions/extension-list.ts +2 -2
- package/src/modes/{interactive/components → components}/extensions/inspector-panel.ts +1 -1
- package/src/modes/{interactive/components → components}/extensions/state-manager.ts +11 -17
- package/src/modes/{interactive/components → components}/extensions/types.ts +1 -1
- package/src/modes/{interactive/components → components}/footer.ts +3 -3
- package/src/modes/{interactive/components → components}/history-search.ts +2 -2
- package/src/modes/{interactive/components → components}/hook-editor.ts +1 -1
- package/src/modes/{interactive/components → components}/hook-input.ts +1 -1
- package/src/modes/{interactive/components → components}/hook-message.ts +3 -3
- package/src/modes/{interactive/components → components}/hook-selector.ts +1 -1
- package/src/modes/{interactive/components → components}/keybinding-hints.ts +2 -2
- package/src/modes/{interactive/components → components}/login-dialog.ts +1 -1
- package/src/modes/{interactive/components → components}/model-selector.ts +5 -5
- package/src/modes/{interactive/components → components}/oauth-selector.ts +2 -2
- package/src/modes/{interactive/components → components}/plugin-settings.ts +3 -3
- package/src/modes/{interactive/components → components}/python-execution.ts +35 -24
- package/src/modes/{interactive/components → components}/queue-mode-selector.ts +1 -1
- package/src/modes/{interactive/components → components}/read-tool-group.ts +2 -2
- package/src/modes/{interactive/components → components}/session-selector.ts +3 -3
- package/src/modes/{interactive/components → components}/settings-defs.ts +2 -2
- package/src/modes/{interactive/components → components}/settings-selector.ts +2 -2
- package/src/modes/{interactive/components → components}/show-images-selector.ts +1 -1
- package/src/modes/{interactive/components → components}/status-line/segments.ts +2 -2
- package/src/modes/{interactive/components → components}/status-line/separators.ts +1 -1
- package/src/modes/{interactive/components → components}/status-line/types.ts +2 -2
- package/src/modes/{interactive/components → components}/status-line-segment-editor.ts +2 -2
- package/src/modes/{interactive/components → components}/status-line.ts +3 -3
- package/src/modes/{interactive/components → components}/theme-selector.ts +1 -1
- package/src/modes/{interactive/components → components}/thinking-selector.ts +1 -1
- package/src/modes/{interactive/components → components}/todo-display.ts +3 -4
- package/src/modes/{interactive/components → components}/todo-reminder.ts +2 -2
- package/src/modes/{interactive/components → components}/tool-execution.ts +8 -8
- package/src/modes/{interactive/components → components}/tree-selector.ts +3 -3
- package/src/modes/{interactive/components → components}/ttsr-notification.ts +2 -2
- package/src/modes/{interactive/components → components}/user-message-selector.ts +1 -1
- package/src/modes/{interactive/components → components}/user-message.ts +1 -1
- package/src/modes/{interactive/components → components}/welcome.ts +2 -2
- package/src/modes/{interactive/controllers → controllers}/command-controller.ts +32 -30
- package/src/modes/{interactive/controllers → controllers}/event-controller.ts +9 -9
- package/src/modes/{interactive/controllers → controllers}/extension-ui-controller.ts +8 -8
- package/src/modes/{interactive/controllers → controllers}/input-controller.ts +6 -6
- package/src/modes/{interactive/controllers → controllers}/selector-controller.ts +16 -16
- package/src/modes/index.ts +1 -1
- package/src/modes/{interactive/interactive-mode.ts → interactive-mode.ts} +14 -14
- package/src/modes/print-mode.ts +1 -1
- package/src/modes/rpc/rpc-client.ts +3 -3
- package/src/modes/rpc/rpc-mode.ts +3 -3
- package/src/modes/rpc/rpc-types.ts +3 -3
- package/src/modes/{interactive/theme → theme}/theme.ts +1 -1
- package/src/modes/{interactive/types.ts → types.ts} +8 -9
- package/src/modes/{interactive/utils → utils}/ui-helpers.ts +20 -27
- package/src/{core/tools/patch → patch}/applicator.ts +1 -1
- package/src/{core/tools/patch → patch}/diff.ts +1 -1
- package/src/{core/tools/patch → patch}/index.ts +31 -36
- package/src/{core/tools/patch → patch}/shared.ts +9 -6
- package/src/prompts/agents/explore.md +83 -46
- package/src/prompts/agents/init.md +9 -4
- package/src/prompts/agents/plan.md +8 -7
- package/src/prompts/agents/reviewer.md +36 -18
- package/src/prompts/agents/task.md +4 -4
- package/src/prompts/compaction/branch-summary-preamble.md +0 -1
- package/src/prompts/review-request.md +0 -1
- package/src/prompts/system/custom-system-prompt.md +2 -14
- package/src/prompts/system/file-operations.md +0 -2
- package/src/prompts/system/system-prompt.md +147 -138
- package/src/prompts/system/web-search.md +26 -0
- package/src/prompts/tools/ask.md +31 -24
- package/src/prompts/tools/bash.md +20 -17
- package/src/prompts/tools/calculator.md +9 -5
- package/src/prompts/tools/fetch.md +16 -0
- package/src/prompts/tools/find.md +15 -5
- package/src/prompts/tools/gemini-image.md +21 -6
- package/src/prompts/tools/grep.md +28 -12
- package/src/prompts/tools/lsp.md +35 -14
- package/src/prompts/tools/patch.md +39 -41
- package/src/prompts/tools/python.md +59 -76
- package/src/prompts/tools/read.md +23 -22
- package/src/prompts/tools/replace.md +19 -12
- package/src/prompts/tools/ssh.md +21 -28
- package/src/prompts/tools/task.md +54 -44
- package/src/prompts/tools/todo-write.md +52 -163
- package/src/prompts/tools/web-search.md +16 -9
- package/src/prompts/tools/write.md +13 -2
- package/src/{core/sdk.ts → sdk.ts} +65 -34
- package/src/{core → session}/agent-session.ts +45 -37
- package/src/{core → session}/agent-storage.ts +2 -2
- package/src/session/artifacts.ts +110 -0
- package/src/{core → session}/auth-storage.ts +1 -1
- package/src/{core → session}/compaction/branch-summarization.ts +5 -5
- package/src/{core → session}/compaction/compaction.ts +6 -6
- package/src/{core → session}/compaction/utils.ts +3 -3
- package/src/{core → session}/history-storage.ts +1 -1
- package/src/{core → session}/messages.ts +6 -8
- package/src/{core → session}/session-manager.ts +2 -2
- package/src/{core → session}/storage-migration.ts +2 -2
- package/src/session/streaming-output.ts +177 -0
- package/src/{core/ssh → ssh}/connection-manager.ts +1 -1
- package/src/{core/ssh → ssh}/ssh-executor.ts +19 -4
- package/src/{core/ssh → ssh}/sshfs-mount.ts +1 -1
- package/src/{core/system-prompt.ts → system-prompt.ts} +8 -37
- package/src/{core/tools/task → task}/agents.ts +8 -8
- package/src/{core/tools/task → task}/commands.ts +5 -6
- package/src/{core/tools/task → task}/discovery.ts +3 -3
- package/src/{core/tools/task → task}/executor.ts +34 -44
- package/src/{core/tools/task → task}/index.ts +206 -50
- package/src/{core/tools/task → task}/render.ts +80 -23
- package/src/{core/tools/task → task}/subprocess-tool-registry.ts +1 -1
- package/src/task/template.ts +47 -0
- package/src/{core/tools/task → task}/types.ts +19 -27
- package/src/{core/tools/task → task}/worker-protocol.ts +8 -4
- package/src/{core/tools/task → task}/worker.ts +34 -29
- package/src/task/worktree.ts +166 -0
- package/src/{core/tools → tools}/ask.ts +13 -21
- package/src/{core/tools → tools}/bash-interceptor.ts +1 -1
- package/src/{core/tools → tools}/bash.ts +61 -63
- package/src/{core/tools → tools}/calculator.ts +4 -4
- package/src/{core/tools → tools}/complete.ts +1 -1
- package/src/{core/tools → tools}/context.ts +2 -2
- package/src/{core/tools/web-fetch.ts → tools/fetch.ts} +97 -76
- package/src/{core/tools → tools}/find.ts +80 -104
- package/src/{core/tools → tools}/gemini-image.ts +420 -29
- package/src/{core/tools → tools}/grep.ts +155 -164
- package/src/{core/tools → tools}/index.ts +63 -56
- package/src/tools/list-limit.ts +40 -0
- package/src/{core/tools → tools}/ls.ts +44 -35
- package/src/{core/tools → tools}/notebook.ts +3 -3
- package/src/tools/output-meta.ts +443 -0
- package/src/tools/output-utils.ts +63 -0
- package/src/{core/tools → tools}/python.ts +105 -89
- package/src/tools/read.ts +882 -0
- package/src/{core/tools → tools}/render-utils.ts +1 -1
- package/src/{core/tools → tools}/renderers.ts +8 -10
- package/src/{core/tools → tools}/review.ts +2 -2
- package/src/{core/tools → tools}/ssh.ts +56 -59
- package/src/{core/tools → tools}/todo-write.ts +12 -23
- package/src/tools/tool-errors.ts +95 -0
- package/src/tools/tool-result.ts +92 -0
- package/src/{core/tools → tools}/truncate.ts +2 -2
- package/src/{core/tools → tools}/write.ts +15 -13
- package/src/utils/changelog.ts +1 -1
- package/src/{core → utils}/file-mentions.ts +4 -4
- package/src/utils/image-convert.ts +1 -1
- package/src/utils/image-resize.ts +1 -1
- package/src/utils/shell.ts +1 -1
- package/src/{core → utils}/title-generator.ts +4 -4
- package/src/utils/tools-manager.ts +1 -1
- package/src/{core/tools/web-scrapers → web/scrapers}/choosealicense.ts +1 -1
- package/src/{core/tools/web-scrapers → web/scrapers}/twitter.ts +3 -2
- package/src/{core/tools/web-scrapers → web/scrapers}/types.ts +4 -2
- package/src/{core/tools/web-scrapers → web/scrapers}/utils.ts +1 -1
- package/src/{core/tools/web-scrapers → web/scrapers}/youtube.ts +14 -13
- package/src/{core/tools/web-search → web/search}/auth.ts +4 -4
- package/src/{core/tools/web-search → web/search}/index.ts +22 -71
- package/src/{core/tools/web-search → web/search}/providers/anthropic.ts +7 -10
- package/src/{core/tools/web-search → web/search}/providers/exa.ts +2 -2
- package/src/{core/tools/web-search → web/search}/providers/perplexity.ts +4 -16
- package/src/{core/tools/web-search → web/search}/render.ts +3 -3
- package/tsconfig.json +25 -0
- package/scripts/migrate-sessions.sh +0 -93
- package/src/core/index.ts +0 -56
- package/src/core/python-prelude.ts +0 -3
- package/src/core/ssh-executor.ts +0 -5
- package/src/core/streaming-output.ts +0 -115
- package/src/core/tools/output.ts +0 -519
- package/src/core/tools/read.ts +0 -717
- package/src/core/tools/task/template.ts +0 -37
- package/src/prompts/tools/output.md +0 -47
- package/src/prompts/tools/web-fetch.md +0 -9
- package/src/vendor/photon/photon_rs_bg.wasm.b64.js +0 -1
- /package/src/{core/tools/exa → exa}/types.ts +0 -0
- /package/src/{core → exec}/exec.ts +0 -0
- /package/src/{core/export-html → export/html}/template.css +0 -0
- /package/src/{core/export-html → export/html}/template.generated.ts +0 -0
- /package/src/{core/export-html → export/html}/template.html +0 -0
- /package/src/{core/export-html → export/html}/template.js +0 -0
- /package/src/{core/export-html → export/html}/template.macro.ts +0 -0
- /package/src/{core/export-html → export/html}/vendor/highlight.min.js +0 -0
- /package/src/{core/export-html → export/html}/vendor/marked.min.js +0 -0
- /package/src/{core → extensibility}/custom-commands/index.ts +0 -0
- /package/src/{core → extensibility}/custom-tools/index.ts +0 -0
- /package/src/{core → extensibility}/extensions/index.ts +0 -0
- /package/src/{core → extensibility}/hooks/tool-wrapper.ts +0 -0
- /package/src/{core → extensibility}/plugins/index.ts +0 -0
- /package/src/{core → extensibility}/plugins/loader.ts +0 -0
- /package/src/{core → extensibility}/plugins/manager.ts +0 -0
- /package/src/{core → extensibility}/plugins/parser.ts +0 -0
- /package/src/{core → extensibility}/plugins/types.ts +0 -0
- /package/src/{core/python-modules.ts → ipy/modules.ts} +0 -0
- /package/src/{core/python-prelude.py → ipy/prelude.py} +0 -0
- /package/src/{core/tools/lsp → lsp}/defaults.json +0 -0
- /package/src/{core/tools/lsp → lsp}/edits.ts +0 -0
- /package/src/{core/tools/lsp → lsp}/lspmux.ts +0 -0
- /package/src/{core/tools/lsp → lsp}/rust-analyzer.ts +0 -0
- /package/src/{core/mcp → mcp}/client.ts +0 -0
- /package/src/{core/mcp → mcp}/index.ts +0 -0
- /package/src/{core/mcp → mcp}/json-rpc.ts +0 -0
- /package/src/{core/mcp → mcp}/transports/index.ts +0 -0
- /package/src/modes/{interactive/components → components}/countdown-timer.ts +0 -0
- /package/src/modes/{interactive/components → components}/custom-editor.ts +0 -0
- /package/src/modes/{interactive/components → components}/extensions/index.ts +0 -0
- /package/src/modes/{interactive/components → components}/index.ts +0 -0
- /package/src/modes/{interactive/components → components}/status-line/index.ts +0 -0
- /package/src/modes/{interactive/components → components}/status-line/presets.ts +0 -0
- /package/src/modes/{interactive/components → components}/visual-truncate.ts +0 -0
- /package/src/modes/{interactive/theme → theme}/dark.json +0 -0
- /package/src/modes/{interactive/theme → theme}/defaults/alabaster.json +0 -0
- /package/src/modes/{interactive/theme → theme}/defaults/amethyst.json +0 -0
- /package/src/modes/{interactive/theme → theme}/defaults/anthracite.json +0 -0
- /package/src/modes/{interactive/theme → theme}/defaults/basalt.json +0 -0
- /package/src/modes/{interactive/theme → theme}/defaults/birch.json +0 -0
- /package/src/modes/{interactive/theme → theme}/defaults/dark-abyss.json +0 -0
- /package/src/modes/{interactive/theme → theme}/defaults/dark-arctic.json +0 -0
- /package/src/modes/{interactive/theme → theme}/defaults/dark-aurora.json +0 -0
- /package/src/modes/{interactive/theme → theme}/defaults/dark-catppuccin.json +0 -0
- /package/src/modes/{interactive/theme → theme}/defaults/dark-cavern.json +0 -0
- /package/src/modes/{interactive/theme → theme}/defaults/dark-copper.json +0 -0
- /package/src/modes/{interactive/theme → theme}/defaults/dark-cosmos.json +0 -0
- /package/src/modes/{interactive/theme → theme}/defaults/dark-cyberpunk.json +0 -0
- /package/src/modes/{interactive/theme → theme}/defaults/dark-dracula.json +0 -0
- /package/src/modes/{interactive/theme → theme}/defaults/dark-eclipse.json +0 -0
- /package/src/modes/{interactive/theme → theme}/defaults/dark-ember.json +0 -0
- /package/src/modes/{interactive/theme → theme}/defaults/dark-equinox.json +0 -0
- /package/src/modes/{interactive/theme → theme}/defaults/dark-forest.json +0 -0
- /package/src/modes/{interactive/theme → theme}/defaults/dark-github.json +0 -0
- /package/src/modes/{interactive/theme → theme}/defaults/dark-gruvbox.json +0 -0
- /package/src/modes/{interactive/theme → theme}/defaults/dark-lavender.json +0 -0
- /package/src/modes/{interactive/theme → theme}/defaults/dark-lunar.json +0 -0
- /package/src/modes/{interactive/theme → theme}/defaults/dark-midnight.json +0 -0
- /package/src/modes/{interactive/theme → theme}/defaults/dark-monochrome.json +0 -0
- /package/src/modes/{interactive/theme → theme}/defaults/dark-monokai.json +0 -0
- /package/src/modes/{interactive/theme → theme}/defaults/dark-nebula.json +0 -0
- /package/src/modes/{interactive/theme → theme}/defaults/dark-nord.json +0 -0
- /package/src/modes/{interactive/theme → theme}/defaults/dark-ocean.json +0 -0
- /package/src/modes/{interactive/theme → theme}/defaults/dark-one.json +0 -0
- /package/src/modes/{interactive/theme → theme}/defaults/dark-rainforest.json +0 -0
- /package/src/modes/{interactive/theme → theme}/defaults/dark-reef.json +0 -0
- /package/src/modes/{interactive/theme → theme}/defaults/dark-retro.json +0 -0
- /package/src/modes/{interactive/theme → theme}/defaults/dark-rose-pine.json +0 -0
- /package/src/modes/{interactive/theme → theme}/defaults/dark-sakura.json +0 -0
- /package/src/modes/{interactive/theme → theme}/defaults/dark-slate.json +0 -0
- /package/src/modes/{interactive/theme → theme}/defaults/dark-solarized.json +0 -0
- /package/src/modes/{interactive/theme → theme}/defaults/dark-solstice.json +0 -0
- /package/src/modes/{interactive/theme → theme}/defaults/dark-starfall.json +0 -0
- /package/src/modes/{interactive/theme → theme}/defaults/dark-sunset.json +0 -0
- /package/src/modes/{interactive/theme → theme}/defaults/dark-swamp.json +0 -0
- /package/src/modes/{interactive/theme → theme}/defaults/dark-synthwave.json +0 -0
- /package/src/modes/{interactive/theme → theme}/defaults/dark-taiga.json +0 -0
- /package/src/modes/{interactive/theme → theme}/defaults/dark-terminal.json +0 -0
- /package/src/modes/{interactive/theme → theme}/defaults/dark-tokyo-night.json +0 -0
- /package/src/modes/{interactive/theme → theme}/defaults/dark-tundra.json +0 -0
- /package/src/modes/{interactive/theme → theme}/defaults/dark-twilight.json +0 -0
- /package/src/modes/{interactive/theme → theme}/defaults/dark-volcanic.json +0 -0
- /package/src/modes/{interactive/theme → theme}/defaults/graphite.json +0 -0
- /package/src/modes/{interactive/theme → theme}/defaults/index.ts +0 -0
- /package/src/modes/{interactive/theme → theme}/defaults/light-arctic.json +0 -0
- /package/src/modes/{interactive/theme → theme}/defaults/light-aurora-day.json +0 -0
- /package/src/modes/{interactive/theme → theme}/defaults/light-canyon.json +0 -0
- /package/src/modes/{interactive/theme → theme}/defaults/light-catppuccin.json +0 -0
- /package/src/modes/{interactive/theme → theme}/defaults/light-cirrus.json +0 -0
- /package/src/modes/{interactive/theme → theme}/defaults/light-coral.json +0 -0
- /package/src/modes/{interactive/theme → theme}/defaults/light-cyberpunk.json +0 -0
- /package/src/modes/{interactive/theme → theme}/defaults/light-dawn.json +0 -0
- /package/src/modes/{interactive/theme → theme}/defaults/light-dunes.json +0 -0
- /package/src/modes/{interactive/theme → theme}/defaults/light-eucalyptus.json +0 -0
- /package/src/modes/{interactive/theme → theme}/defaults/light-forest.json +0 -0
- /package/src/modes/{interactive/theme → theme}/defaults/light-frost.json +0 -0
- /package/src/modes/{interactive/theme → theme}/defaults/light-github.json +0 -0
- /package/src/modes/{interactive/theme → theme}/defaults/light-glacier.json +0 -0
- /package/src/modes/{interactive/theme → theme}/defaults/light-gruvbox.json +0 -0
- /package/src/modes/{interactive/theme → theme}/defaults/light-haze.json +0 -0
- /package/src/modes/{interactive/theme → theme}/defaults/light-honeycomb.json +0 -0
- /package/src/modes/{interactive/theme → theme}/defaults/light-lagoon.json +0 -0
- /package/src/modes/{interactive/theme → theme}/defaults/light-lavender.json +0 -0
- /package/src/modes/{interactive/theme → theme}/defaults/light-meadow.json +0 -0
- /package/src/modes/{interactive/theme → theme}/defaults/light-mint.json +0 -0
- /package/src/modes/{interactive/theme → theme}/defaults/light-monochrome.json +0 -0
- /package/src/modes/{interactive/theme → theme}/defaults/light-ocean.json +0 -0
- /package/src/modes/{interactive/theme → theme}/defaults/light-one.json +0 -0
- /package/src/modes/{interactive/theme → theme}/defaults/light-opal.json +0 -0
- /package/src/modes/{interactive/theme → theme}/defaults/light-orchard.json +0 -0
- /package/src/modes/{interactive/theme → theme}/defaults/light-paper.json +0 -0
- /package/src/modes/{interactive/theme → theme}/defaults/light-prism.json +0 -0
- /package/src/modes/{interactive/theme → theme}/defaults/light-retro.json +0 -0
- /package/src/modes/{interactive/theme → theme}/defaults/light-sand.json +0 -0
- /package/src/modes/{interactive/theme → theme}/defaults/light-savanna.json +0 -0
- /package/src/modes/{interactive/theme → theme}/defaults/light-solarized.json +0 -0
- /package/src/modes/{interactive/theme → theme}/defaults/light-soleil.json +0 -0
- /package/src/modes/{interactive/theme → theme}/defaults/light-sunset.json +0 -0
- /package/src/modes/{interactive/theme → theme}/defaults/light-synthwave.json +0 -0
- /package/src/modes/{interactive/theme → theme}/defaults/light-tokyo-night.json +0 -0
- /package/src/modes/{interactive/theme → theme}/defaults/light-wetland.json +0 -0
- /package/src/modes/{interactive/theme → theme}/defaults/light-zenith.json +0 -0
- /package/src/modes/{interactive/theme → theme}/defaults/limestone.json +0 -0
- /package/src/modes/{interactive/theme → theme}/defaults/mahogany.json +0 -0
- /package/src/modes/{interactive/theme → theme}/defaults/marble.json +0 -0
- /package/src/modes/{interactive/theme → theme}/defaults/obsidian.json +0 -0
- /package/src/modes/{interactive/theme → theme}/defaults/onyx.json +0 -0
- /package/src/modes/{interactive/theme → theme}/defaults/pearl.json +0 -0
- /package/src/modes/{interactive/theme → theme}/defaults/porcelain.json +0 -0
- /package/src/modes/{interactive/theme → theme}/defaults/quartz.json +0 -0
- /package/src/modes/{interactive/theme → theme}/defaults/sandstone.json +0 -0
- /package/src/modes/{interactive/theme → theme}/defaults/titanium.json +0 -0
- /package/src/modes/{interactive/theme → theme}/light.json +0 -0
- /package/src/modes/{interactive/theme → theme}/theme-schema.json +0 -0
- /package/src/{core/tools/patch → patch}/fuzzy.ts +0 -0
- /package/src/{core/tools/patch → patch}/normalize.ts +0 -0
- /package/src/{core/tools/patch → patch}/normative.ts +0 -0
- /package/src/{core/tools/patch → patch}/parser.ts +0 -0
- /package/src/{core/tools/patch → patch}/types.ts +0 -0
- /package/src/{core → session}/compaction/index.ts +0 -0
- /package/src/{core → session}/session-storage.ts +0 -0
- /package/src/{core/tools/task → task}/name-generator.ts +0 -0
- /package/src/{core/tools/task → task}/omp-command.ts +0 -0
- /package/src/{core/tools/task → task}/parallel.ts +0 -0
- /package/src/{core/tools → tools}/jtd-to-json-schema.ts +0 -0
- /package/src/{core/tools → tools}/path-utils.ts +0 -0
- /package/src/{core → utils}/event-bus.ts +0 -0
- /package/src/{core → utils}/frontmatter.ts +0 -0
- /package/src/{core → utils}/terminal-notify.ts +0 -0
- /package/src/{core → utils}/timings.ts +0 -0
- /package/src/{core → utils}/utils.ts +0 -0
- /package/src/{core/tools/web-scrapers → web/scrapers}/artifacthub.ts +0 -0
- /package/src/{core/tools/web-scrapers → web/scrapers}/arxiv.ts +0 -0
- /package/src/{core/tools/web-scrapers → web/scrapers}/aur.ts +0 -0
- /package/src/{core/tools/web-scrapers → web/scrapers}/biorxiv.ts +0 -0
- /package/src/{core/tools/web-scrapers → web/scrapers}/bluesky.ts +0 -0
- /package/src/{core/tools/web-scrapers → web/scrapers}/brew.ts +0 -0
- /package/src/{core/tools/web-scrapers → web/scrapers}/cheatsh.ts +0 -0
- /package/src/{core/tools/web-scrapers → web/scrapers}/chocolatey.ts +0 -0
- /package/src/{core/tools/web-scrapers → web/scrapers}/cisa-kev.ts +0 -0
- /package/src/{core/tools/web-scrapers → web/scrapers}/clojars.ts +0 -0
- /package/src/{core/tools/web-scrapers → web/scrapers}/coingecko.ts +0 -0
- /package/src/{core/tools/web-scrapers → web/scrapers}/crates-io.ts +0 -0
- /package/src/{core/tools/web-scrapers → web/scrapers}/crossref.ts +0 -0
- /package/src/{core/tools/web-scrapers → web/scrapers}/devto.ts +0 -0
- /package/src/{core/tools/web-scrapers → web/scrapers}/discogs.ts +0 -0
- /package/src/{core/tools/web-scrapers → web/scrapers}/discourse.ts +0 -0
- /package/src/{core/tools/web-scrapers → web/scrapers}/dockerhub.ts +0 -0
- /package/src/{core/tools/web-scrapers → web/scrapers}/fdroid.ts +0 -0
- /package/src/{core/tools/web-scrapers → web/scrapers}/firefox-addons.ts +0 -0
- /package/src/{core/tools/web-scrapers → web/scrapers}/flathub.ts +0 -0
- /package/src/{core/tools/web-scrapers → web/scrapers}/github-gist.ts +0 -0
- /package/src/{core/tools/web-scrapers → web/scrapers}/github.ts +0 -0
- /package/src/{core/tools/web-scrapers → web/scrapers}/gitlab.ts +0 -0
- /package/src/{core/tools/web-scrapers → web/scrapers}/go-pkg.ts +0 -0
- /package/src/{core/tools/web-scrapers → web/scrapers}/hackage.ts +0 -0
- /package/src/{core/tools/web-scrapers → web/scrapers}/hackernews.ts +0 -0
- /package/src/{core/tools/web-scrapers → web/scrapers}/hex.ts +0 -0
- /package/src/{core/tools/web-scrapers → web/scrapers}/huggingface.ts +0 -0
- /package/src/{core/tools/web-scrapers → web/scrapers}/iacr.ts +0 -0
- /package/src/{core/tools/web-scrapers → web/scrapers}/index.ts +0 -0
- /package/src/{core/tools/web-scrapers → web/scrapers}/jetbrains-marketplace.ts +0 -0
- /package/src/{core/tools/web-scrapers → web/scrapers}/lemmy.ts +0 -0
- /package/src/{core/tools/web-scrapers → web/scrapers}/lobsters.ts +0 -0
- /package/src/{core/tools/web-scrapers → web/scrapers}/mastodon.ts +0 -0
- /package/src/{core/tools/web-scrapers → web/scrapers}/maven.ts +0 -0
- /package/src/{core/tools/web-scrapers → web/scrapers}/mdn.ts +0 -0
- /package/src/{core/tools/web-scrapers → web/scrapers}/metacpan.ts +0 -0
- /package/src/{core/tools/web-scrapers → web/scrapers}/musicbrainz.ts +0 -0
- /package/src/{core/tools/web-scrapers → web/scrapers}/npm.ts +0 -0
- /package/src/{core/tools/web-scrapers → web/scrapers}/nuget.ts +0 -0
- /package/src/{core/tools/web-scrapers → web/scrapers}/nvd.ts +0 -0
- /package/src/{core/tools/web-scrapers → web/scrapers}/ollama.ts +0 -0
- /package/src/{core/tools/web-scrapers → web/scrapers}/open-vsx.ts +0 -0
- /package/src/{core/tools/web-scrapers → web/scrapers}/opencorporates.ts +0 -0
- /package/src/{core/tools/web-scrapers → web/scrapers}/openlibrary.ts +0 -0
- /package/src/{core/tools/web-scrapers → web/scrapers}/orcid.ts +0 -0
- /package/src/{core/tools/web-scrapers → web/scrapers}/osv.ts +0 -0
- /package/src/{core/tools/web-scrapers → web/scrapers}/packagist.ts +0 -0
- /package/src/{core/tools/web-scrapers → web/scrapers}/pub-dev.ts +0 -0
- /package/src/{core/tools/web-scrapers → web/scrapers}/pubmed.ts +0 -0
- /package/src/{core/tools/web-scrapers → web/scrapers}/pypi.ts +0 -0
- /package/src/{core/tools/web-scrapers → web/scrapers}/rawg.ts +0 -0
- /package/src/{core/tools/web-scrapers → web/scrapers}/readthedocs.ts +0 -0
- /package/src/{core/tools/web-scrapers → web/scrapers}/reddit.ts +0 -0
- /package/src/{core/tools/web-scrapers → web/scrapers}/repology.ts +0 -0
- /package/src/{core/tools/web-scrapers → web/scrapers}/rfc.ts +0 -0
- /package/src/{core/tools/web-scrapers → web/scrapers}/rubygems.ts +0 -0
- /package/src/{core/tools/web-scrapers → web/scrapers}/searchcode.ts +0 -0
- /package/src/{core/tools/web-scrapers → web/scrapers}/sec-edgar.ts +0 -0
- /package/src/{core/tools/web-scrapers → web/scrapers}/semantic-scholar.ts +0 -0
- /package/src/{core/tools/web-scrapers → web/scrapers}/snapcraft.ts +0 -0
- /package/src/{core/tools/web-scrapers → web/scrapers}/sourcegraph.ts +0 -0
- /package/src/{core/tools/web-scrapers → web/scrapers}/spdx.ts +0 -0
- /package/src/{core/tools/web-scrapers → web/scrapers}/spotify.ts +0 -0
- /package/src/{core/tools/web-scrapers → web/scrapers}/stackoverflow.ts +0 -0
- /package/src/{core/tools/web-scrapers → web/scrapers}/terraform.ts +0 -0
- /package/src/{core/tools/web-scrapers → web/scrapers}/tldr.ts +0 -0
- /package/src/{core/tools/web-scrapers → web/scrapers}/vimeo.ts +0 -0
- /package/src/{core/tools/web-scrapers → web/scrapers}/vscode-marketplace.ts +0 -0
- /package/src/{core/tools/web-scrapers → web/scrapers}/w3c.ts +0 -0
- /package/src/{core/tools/web-scrapers → web/scrapers}/wikidata.ts +0 -0
- /package/src/{core/tools/web-scrapers → web/scrapers}/wikipedia.ts +0 -0
- /package/src/{core/tools/web-search → web/search}/types.ts +0 -0
|
@@ -7,14 +7,14 @@ import { homedir } from "node:os";
|
|
|
7
7
|
import { join } from "node:path";
|
|
8
8
|
import { $ } from "bun";
|
|
9
9
|
import chalk from "chalk";
|
|
10
|
-
import { contextFileCapability } from "
|
|
11
|
-
import { systemPromptCapability } from "
|
|
12
|
-
import {
|
|
13
|
-
import
|
|
14
|
-
import
|
|
15
|
-
import {
|
|
16
|
-
import
|
|
17
|
-
import
|
|
10
|
+
import { contextFileCapability } from "$c/capability/context-file";
|
|
11
|
+
import { systemPromptCapability } from "$c/capability/system-prompt";
|
|
12
|
+
import { renderPromptTemplate } from "$c/config/prompt-templates";
|
|
13
|
+
import type { SkillsSettings } from "$c/config/settings-manager";
|
|
14
|
+
import { type ContextFile, loadCapability, type SystemPrompt as SystemPromptFile } from "$c/discovery/index";
|
|
15
|
+
import { loadSkills, type Skill } from "$c/extensibility/skills";
|
|
16
|
+
import customSystemPromptTemplate from "$c/prompts/system/custom-system-prompt.md" with { type: "text" };
|
|
17
|
+
import systemPromptTemplate from "$c/prompts/system/system-prompt.md" with { type: "text" };
|
|
18
18
|
import type { ToolName } from "./tools/index";
|
|
19
19
|
|
|
20
20
|
interface GitContext {
|
|
@@ -68,29 +68,6 @@ export async function loadGitContext(cwd: string): Promise<GitContext | null> {
|
|
|
68
68
|
};
|
|
69
69
|
}
|
|
70
70
|
|
|
71
|
-
/** Tool descriptions for system prompt */
|
|
72
|
-
const toolDescriptions: Record<ToolName, string> = {
|
|
73
|
-
ask: "Ask user for input or clarification",
|
|
74
|
-
read: "Read file contents",
|
|
75
|
-
bash: "Execute bash commands (npm, docker, etc.)",
|
|
76
|
-
python: "Execute Python code via a session-backed IPython kernel",
|
|
77
|
-
calc: "{ calculations: array of { expression: string, prefix: string, suffix: string } } Basic calculations.",
|
|
78
|
-
ssh: "Execute commands on remote hosts via SSH",
|
|
79
|
-
edit: "Make surgical edits to files (find exact text and replace)",
|
|
80
|
-
write: "Create or overwrite files",
|
|
81
|
-
grep: "Search file contents for patterns (respects .gitignore)",
|
|
82
|
-
find: "Find files by glob pattern (respects .gitignore)",
|
|
83
|
-
git: "Structured Git operations with safety guards (status, diff, log, commit, push, pr, etc.)",
|
|
84
|
-
ls: "List directory contents",
|
|
85
|
-
lsp: "PREFERRED for semantic code queries: go-to-definition, find-all-references, hover (type info), call hierarchy. Returns precise, deterministic results. Use BEFORE grep for symbol lookups.",
|
|
86
|
-
notebook: "Edit Jupyter notebook cells",
|
|
87
|
-
output: "Output structured data to the user (bypasses tool result formatting)",
|
|
88
|
-
task: "Spawn a sub-agent to handle complex tasks",
|
|
89
|
-
web_fetch: "Fetch and render URLs into clean text for LLM consumption",
|
|
90
|
-
web_search: "Search the web for information",
|
|
91
|
-
report_finding: "Report a finding during code review",
|
|
92
|
-
};
|
|
93
|
-
|
|
94
71
|
function firstNonEmpty(values: Array<string | undefined | null>): string | null {
|
|
95
72
|
for (const value of values) {
|
|
96
73
|
const trimmed = value?.trim();
|
|
@@ -726,10 +703,6 @@ export async function buildSystemPrompt(options: BuildSystemPromptOptions = {}):
|
|
|
726
703
|
// Use defaults
|
|
727
704
|
toolNamesArray = defaultToolNames;
|
|
728
705
|
}
|
|
729
|
-
const toolDescriptionsArray = toolNamesArray.map((name) => ({
|
|
730
|
-
name,
|
|
731
|
-
description: toolDescriptions[name as ToolName] ?? "",
|
|
732
|
-
}));
|
|
733
706
|
|
|
734
707
|
// Resolve skills: use provided or discover
|
|
735
708
|
const skills =
|
|
@@ -750,7 +723,6 @@ export async function buildSystemPrompt(options: BuildSystemPromptOptions = {}):
|
|
|
750
723
|
appendPrompt: resolvedAppendPrompt ?? "",
|
|
751
724
|
contextFiles,
|
|
752
725
|
agentsMdSearch,
|
|
753
|
-
toolDescriptions: toolDescriptionsArray,
|
|
754
726
|
git,
|
|
755
727
|
skills: filteredSkills,
|
|
756
728
|
rules: rules ?? [],
|
|
@@ -761,7 +733,6 @@ export async function buildSystemPrompt(options: BuildSystemPromptOptions = {}):
|
|
|
761
733
|
|
|
762
734
|
return renderPromptTemplate(systemPromptTemplate, {
|
|
763
735
|
tools: toolNamesArray,
|
|
764
|
-
toolDescriptions: toolDescriptionsArray,
|
|
765
736
|
environment: await getEnvironmentInfo(),
|
|
766
737
|
systemPromptCustomization: systemPromptCustomization ?? "",
|
|
767
738
|
contextFiles,
|
|
@@ -4,15 +4,15 @@
|
|
|
4
4
|
* Agents are embedded at build time via Bun's import with { type: "text" }.
|
|
5
5
|
*/
|
|
6
6
|
|
|
7
|
-
import {
|
|
8
|
-
import { parseAgentFields } from "
|
|
9
|
-
import exploreMd from "
|
|
7
|
+
import { renderPromptTemplate } from "$c/config/prompt-templates";
|
|
8
|
+
import { parseAgentFields } from "$c/discovery/helpers";
|
|
9
|
+
import exploreMd from "$c/prompts/agents/explore.md" with { type: "text" };
|
|
10
10
|
// Embed agent markdown files at build time
|
|
11
|
-
import agentFrontmatterTemplate from "
|
|
12
|
-
import planMd from "
|
|
13
|
-
import reviewerMd from "
|
|
14
|
-
import taskMd from "
|
|
15
|
-
import {
|
|
11
|
+
import agentFrontmatterTemplate from "$c/prompts/agents/frontmatter.md" with { type: "text" };
|
|
12
|
+
import planMd from "$c/prompts/agents/plan.md" with { type: "text" };
|
|
13
|
+
import reviewerMd from "$c/prompts/agents/reviewer.md" with { type: "text" };
|
|
14
|
+
import taskMd from "$c/prompts/agents/task.md" with { type: "text" };
|
|
15
|
+
import { parseFrontmatter } from "$c/utils/frontmatter";
|
|
16
16
|
import type { AgentDefinition, AgentSource } from "./types";
|
|
17
17
|
|
|
18
18
|
interface AgentFrontmatter {
|
|
@@ -5,13 +5,12 @@
|
|
|
5
5
|
*/
|
|
6
6
|
|
|
7
7
|
import * as path from "node:path";
|
|
8
|
-
import { type SlashCommand, slashCommandCapability } from "
|
|
9
|
-
import {
|
|
10
|
-
import { loadCapability } from "
|
|
11
|
-
|
|
8
|
+
import { type SlashCommand, slashCommandCapability } from "$c/capability/slash-command";
|
|
9
|
+
import { renderPromptTemplate } from "$c/config/prompt-templates";
|
|
10
|
+
import { loadCapability } from "$c/discovery";
|
|
12
11
|
// Embed command markdown files at build time
|
|
13
|
-
import initMd from "
|
|
14
|
-
import {
|
|
12
|
+
import initMd from "$c/prompts/agents/init.md" with { type: "text" };
|
|
13
|
+
import { parseFrontmatter } from "$c/utils/frontmatter";
|
|
15
14
|
|
|
16
15
|
const EMBEDDED_COMMANDS: { name: string; content: string }[] = [
|
|
17
16
|
{ name: "init.md", content: renderPromptTemplate(initMd) },
|
|
@@ -14,9 +14,9 @@
|
|
|
14
14
|
|
|
15
15
|
import * as fs from "node:fs";
|
|
16
16
|
import * as path from "node:path";
|
|
17
|
-
import { findAllNearestProjectConfigDirs, getConfigDirs } from "
|
|
18
|
-
import {
|
|
19
|
-
import {
|
|
17
|
+
import { findAllNearestProjectConfigDirs, getConfigDirs } from "$c/config";
|
|
18
|
+
import { parseAgentFields } from "$c/discovery/helpers";
|
|
19
|
+
import { parseFrontmatter } from "$c/utils/frontmatter";
|
|
20
20
|
import { loadBundledAgents } from "./agents";
|
|
21
21
|
import type { AgentDefinition, AgentSource } from "./types";
|
|
22
22
|
|
|
@@ -6,17 +6,17 @@
|
|
|
6
6
|
|
|
7
7
|
import path from "node:path";
|
|
8
8
|
import type { AgentEvent, ThinkingLevel } from "@oh-my-pi/pi-agent-core";
|
|
9
|
-
import type {
|
|
10
|
-
import
|
|
11
|
-
import {
|
|
12
|
-
import
|
|
13
|
-
import type {
|
|
14
|
-
import {
|
|
15
|
-
import {
|
|
9
|
+
import type { ModelRegistry } from "$c/config/model-registry";
|
|
10
|
+
import { formatModelString, parseModelPattern } from "$c/config/model-resolver";
|
|
11
|
+
import { checkPythonKernelAvailability } from "$c/ipy/kernel";
|
|
12
|
+
import { LspTool } from "$c/lsp/index";
|
|
13
|
+
import type { LspParams } from "$c/lsp/types";
|
|
14
|
+
import { callTool } from "$c/mcp/client";
|
|
15
|
+
import type { MCPManager } from "$c/mcp/manager";
|
|
16
|
+
import type { AuthStorage } from "$c/session/auth-storage";
|
|
17
|
+
import { PythonTool, type PythonToolParams } from "$c/tools/python";
|
|
18
|
+
import type { EventBus } from "$c/utils/event-bus";
|
|
16
19
|
import type { ToolSession } from "..";
|
|
17
|
-
import { LspTool } from "../lsp/index";
|
|
18
|
-
import type { LspParams } from "../lsp/types";
|
|
19
|
-
import { PythonTool, type PythonToolParams } from "../python";
|
|
20
20
|
import { subprocessToolRegistry } from "./subprocess-tool-registry";
|
|
21
21
|
import {
|
|
22
22
|
type AgentDefinition,
|
|
@@ -41,11 +41,12 @@ import type {
|
|
|
41
41
|
/** Options for worker execution */
|
|
42
42
|
export interface ExecutorOptions {
|
|
43
43
|
cwd: string;
|
|
44
|
+
worktree?: string;
|
|
44
45
|
agent: AgentDefinition;
|
|
45
46
|
task: string;
|
|
46
47
|
description?: string;
|
|
47
48
|
index: number;
|
|
48
|
-
|
|
49
|
+
id: string;
|
|
49
50
|
context?: string;
|
|
50
51
|
modelOverride?: string;
|
|
51
52
|
thinkingLevel?: ThinkingLevel;
|
|
@@ -61,7 +62,7 @@ export interface ExecutorOptions {
|
|
|
61
62
|
authStorage?: AuthStorage;
|
|
62
63
|
modelRegistry?: ModelRegistry;
|
|
63
64
|
settingsManager?: {
|
|
64
|
-
serialize: () => import("
|
|
65
|
+
serialize: () => import("$c/config/settings-manager").Settings;
|
|
65
66
|
getPythonToolMode?: () => "ipy-only" | "bash-only" | "both";
|
|
66
67
|
getPythonKernelMode?: () => "session" | "per-call";
|
|
67
68
|
getPythonSharedGateway?: () => boolean;
|
|
@@ -162,35 +163,24 @@ function getUsageTokens(usage: unknown): number {
|
|
|
162
163
|
return input + output + cacheRead + cacheWrite;
|
|
163
164
|
}
|
|
164
165
|
|
|
165
|
-
/**
|
|
166
|
-
* Parse MCP tool name to extract server and tool names.
|
|
167
|
-
* Format: mcp_<serverName>_<toolName>
|
|
168
|
-
* Note: Uses lastIndexOf to handle server names with underscores.
|
|
169
|
-
*/
|
|
170
|
-
function parseMCPToolName(fullName: string): { serverName: string; toolName: string } | undefined {
|
|
171
|
-
if (!fullName.startsWith("mcp_")) return undefined;
|
|
172
|
-
const rest = fullName.slice(4);
|
|
173
|
-
const underscoreIndex = rest.lastIndexOf("_");
|
|
174
|
-
if (underscoreIndex === -1) return undefined;
|
|
175
|
-
return {
|
|
176
|
-
serverName: rest.slice(0, underscoreIndex),
|
|
177
|
-
toolName: rest.slice(underscoreIndex + 1),
|
|
178
|
-
};
|
|
179
|
-
}
|
|
180
|
-
|
|
181
166
|
/**
|
|
182
167
|
* Extract MCP tool metadata from MCPManager for passing to worker.
|
|
168
|
+
*
|
|
169
|
+
* MCPTool and DeferredMCPTool expose mcpToolName (original MCP tool name)
|
|
170
|
+
* and mcpServerName properties. We use these directly when available,
|
|
171
|
+
* falling back to empty strings if not.
|
|
183
172
|
*/
|
|
184
173
|
function extractMCPToolMetadata(mcpManager: MCPManager): MCPToolMetadata[] {
|
|
185
174
|
return mcpManager.getTools().map((tool) => {
|
|
186
|
-
|
|
175
|
+
// MCPTool and DeferredMCPTool have these properties
|
|
176
|
+
const mcpTool = tool as { mcpToolName?: string; mcpServerName?: string };
|
|
187
177
|
return {
|
|
188
178
|
name: tool.name,
|
|
189
179
|
label: tool.label ?? tool.name,
|
|
190
180
|
description: tool.description ?? "",
|
|
191
181
|
parameters: tool.parameters,
|
|
192
|
-
serverName:
|
|
193
|
-
mcpToolName:
|
|
182
|
+
serverName: mcpTool.mcpServerName ?? "",
|
|
183
|
+
mcpToolName: mcpTool.mcpToolName ?? "",
|
|
194
184
|
};
|
|
195
185
|
});
|
|
196
186
|
}
|
|
@@ -204,7 +194,8 @@ export async function runSubprocess(options: ExecutorOptions): Promise<SingleRes
|
|
|
204
194
|
agent,
|
|
205
195
|
task,
|
|
206
196
|
index,
|
|
207
|
-
|
|
197
|
+
id,
|
|
198
|
+
worktree,
|
|
208
199
|
context,
|
|
209
200
|
modelOverride,
|
|
210
201
|
thinkingLevel,
|
|
@@ -218,7 +209,7 @@ export async function runSubprocess(options: ExecutorOptions): Promise<SingleRes
|
|
|
218
209
|
// Initialize progress
|
|
219
210
|
const progress: AgentProgress = {
|
|
220
211
|
index,
|
|
221
|
-
|
|
212
|
+
id,
|
|
222
213
|
agent: agent.name,
|
|
223
214
|
agentSource: agent.source,
|
|
224
215
|
status: "running",
|
|
@@ -236,7 +227,7 @@ export async function runSubprocess(options: ExecutorOptions): Promise<SingleRes
|
|
|
236
227
|
if (signal?.aborted) {
|
|
237
228
|
return {
|
|
238
229
|
index,
|
|
239
|
-
|
|
230
|
+
id,
|
|
240
231
|
agent: agent.name,
|
|
241
232
|
agentSource: agent.source,
|
|
242
233
|
task,
|
|
@@ -258,7 +249,7 @@ export async function runSubprocess(options: ExecutorOptions): Promise<SingleRes
|
|
|
258
249
|
// Set up artifact paths and write input file upfront if artifacts dir provided
|
|
259
250
|
let subtaskSessionFile: string | undefined;
|
|
260
251
|
if (options.artifactsDir) {
|
|
261
|
-
subtaskSessionFile = path.join(options.artifactsDir, `${
|
|
252
|
+
subtaskSessionFile = path.join(options.artifactsDir, `${id}.jsonl`);
|
|
262
253
|
}
|
|
263
254
|
|
|
264
255
|
// Add tools if specified
|
|
@@ -324,7 +315,7 @@ export async function runSubprocess(options: ExecutorOptions): Promise<SingleRes
|
|
|
324
315
|
} catch (err) {
|
|
325
316
|
return {
|
|
326
317
|
index,
|
|
327
|
-
|
|
318
|
+
id,
|
|
328
319
|
agent: agent.name,
|
|
329
320
|
agentSource: agent.source,
|
|
330
321
|
task,
|
|
@@ -385,7 +376,7 @@ export async function runSubprocess(options: ExecutorOptions): Promise<SingleRes
|
|
|
385
376
|
return AbortSignal.timeout(timeoutMs);
|
|
386
377
|
};
|
|
387
378
|
|
|
388
|
-
const pythonSessionFile = sessionFile ?? `subtask:${
|
|
379
|
+
const pythonSessionFile = sessionFile ?? `subtask:${id}`;
|
|
389
380
|
const pythonToolSession: ToolSession = {
|
|
390
381
|
cwd,
|
|
391
382
|
hasUI: false,
|
|
@@ -689,6 +680,7 @@ export async function runSubprocess(options: ExecutorOptions): Promise<SingleRes
|
|
|
689
680
|
type: "start",
|
|
690
681
|
payload: {
|
|
691
682
|
cwd,
|
|
683
|
+
worktree,
|
|
692
684
|
task: fullTask,
|
|
693
685
|
systemPrompt: agent.systemPrompt,
|
|
694
686
|
model: resolvedModel,
|
|
@@ -743,12 +735,10 @@ export async function runSubprocess(options: ExecutorOptions): Promise<SingleRes
|
|
|
743
735
|
return;
|
|
744
736
|
}
|
|
745
737
|
try {
|
|
746
|
-
const parsed = parseMCPToolName(request.toolName);
|
|
747
|
-
if (!parsed) throw new Error(`Invalid MCP tool name: ${request.toolName}`);
|
|
748
738
|
const result = await withTimeout(
|
|
749
739
|
(async () => {
|
|
750
|
-
const connection = await mcpManager.waitForConnection(
|
|
751
|
-
return callTool(connection,
|
|
740
|
+
const connection = await mcpManager.waitForConnection(request.serverName);
|
|
741
|
+
return callTool(connection, request.mcpToolName, request.params);
|
|
752
742
|
})(),
|
|
753
743
|
request.timeoutMs,
|
|
754
744
|
);
|
|
@@ -1025,11 +1015,11 @@ export async function runSubprocess(options: ExecutorOptions): Promise<SingleRes
|
|
|
1025
1015
|
const { text: truncatedOutput, truncated } = truncateOutput(rawOutput);
|
|
1026
1016
|
|
|
1027
1017
|
// Write output artifact (input and jsonl already written in real-time)
|
|
1028
|
-
// Compute output metadata for
|
|
1018
|
+
// Compute output metadata for agent:// URL integration
|
|
1029
1019
|
let outputMeta: { lineCount: number; charCount: number } | undefined;
|
|
1030
1020
|
let outputPath: string | undefined;
|
|
1031
1021
|
if (options.artifactsDir) {
|
|
1032
|
-
outputPath = path.join(options.artifactsDir, `${
|
|
1022
|
+
outputPath = path.join(options.artifactsDir, `${id}.md`);
|
|
1033
1023
|
try {
|
|
1034
1024
|
await Bun.write(outputPath, rawOutput);
|
|
1035
1025
|
outputMeta = {
|
|
@@ -1048,7 +1038,7 @@ export async function runSubprocess(options: ExecutorOptions): Promise<SingleRes
|
|
|
1048
1038
|
|
|
1049
1039
|
return {
|
|
1050
1040
|
index,
|
|
1051
|
-
|
|
1041
|
+
id,
|
|
1052
1042
|
agent: agent.name,
|
|
1053
1043
|
agentSource: agent.source,
|
|
1054
1044
|
task,
|