@oh-my-pi/pi-coding-agent 15.10.10 → 15.10.12
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 +142 -7
- package/dist/cli.js +23108 -0
- package/dist/tokenizers.linux-x64-gnu-xcjh3jwk.node +0 -0
- package/dist/types/async/job-manager.d.ts +18 -0
- package/dist/types/cli/args.d.ts +2 -1
- package/dist/types/cli/dry-balance-cli.d.ts +1 -1
- package/dist/types/cli/gallery-cli.d.ts +1 -1
- package/dist/types/cli/gallery-fixtures/types.d.ts +1 -1
- package/dist/types/cli/usage-cli.d.ts +72 -0
- package/dist/types/cli-commands.d.ts +12 -0
- package/dist/types/commands/launch.d.ts +5 -1
- package/dist/types/commands/read.d.ts +1 -1
- package/dist/types/commands/usage.d.ts +25 -0
- package/dist/types/config/api-key-resolver.d.ts +3 -0
- package/dist/types/config/append-only-context-mode.d.ts +2 -1
- package/dist/types/config/model-discovery.d.ts +55 -0
- package/dist/types/config/model-registry.d.ts +8 -219
- package/dist/types/config/model-resolver.d.ts +34 -10
- package/dist/types/config/model-roles.d.ts +28 -0
- package/dist/types/config/models-config-schema.d.ts +523 -42
- package/dist/types/config/models-config.d.ts +385 -0
- package/dist/types/config/settings-schema.d.ts +41 -8
- package/dist/types/config/settings.d.ts +8 -1
- package/dist/types/debug/log-viewer.d.ts +1 -1
- package/dist/types/debug/raw-sse.d.ts +1 -1
- package/dist/types/edit/hashline/noop-loop-guard.d.ts +72 -0
- package/dist/types/eval/backend.d.ts +0 -2
- package/dist/types/eval/idle-timeout.d.ts +0 -4
- package/dist/types/eval/js/shared/rewrite-imports.d.ts +6 -6
- package/dist/types/eval/py/executor.d.ts +5 -0
- package/dist/types/eval/py/kernel.d.ts +6 -1
- package/dist/types/eval/py/runtime.d.ts +9 -0
- package/dist/types/exec/bash-executor.d.ts +2 -0
- package/dist/types/export/html/template.generated.d.ts +1 -1
- package/dist/types/extensibility/extensions/runner.d.ts +3 -2
- package/dist/types/extensibility/extensions/types.d.ts +6 -3
- package/dist/types/hindsight/mental-models.d.ts +17 -8
- package/dist/types/internal-urls/artifact-protocol.d.ts +2 -2
- package/dist/types/internal-urls/types.d.ts +1 -1
- package/dist/types/lsp/edits.d.ts +9 -0
- package/dist/types/lsp/index.d.ts +2 -2
- package/dist/types/lsp/types.d.ts +2 -0
- package/dist/types/lsp/utils.d.ts +3 -0
- package/dist/types/mcp/json-rpc.d.ts +5 -0
- package/dist/types/memory-backend/index.d.ts +1 -0
- package/dist/types/memory-backend/runtime.d.ts +4 -0
- package/dist/types/memory-backend/types.d.ts +66 -1
- package/dist/types/mnemopi/state.d.ts +11 -1
- package/dist/types/modes/components/agent-dashboard.d.ts +1 -1
- package/dist/types/modes/components/assistant-message.d.ts +3 -1
- package/dist/types/modes/components/bash-execution.d.ts +1 -1
- package/dist/types/modes/components/copy-selector.d.ts +1 -1
- package/dist/types/modes/components/dynamic-border.d.ts +1 -1
- package/dist/types/modes/components/extensions/extension-dashboard.d.ts +1 -1
- package/dist/types/modes/components/extensions/extension-list.d.ts +1 -1
- package/dist/types/modes/components/extensions/inspector-panel.d.ts +1 -1
- package/dist/types/modes/components/footer.d.ts +1 -1
- package/dist/types/modes/components/hook-editor.d.ts +5 -0
- package/dist/types/modes/components/hook-input.d.ts +4 -0
- package/dist/types/modes/components/hook-selector.d.ts +1 -1
- package/dist/types/modes/components/model-selector.d.ts +1 -1
- package/dist/types/modes/components/plan-review-overlay.d.ts +1 -1
- package/dist/types/modes/components/session-observer-overlay.d.ts +1 -1
- package/dist/types/modes/components/session-selector.d.ts +1 -1
- package/dist/types/modes/components/status-line/component.d.ts +1 -1
- package/dist/types/modes/components/tiny-title-download-progress.d.ts +1 -1
- package/dist/types/modes/components/transcript-container.d.ts +25 -6
- package/dist/types/modes/components/tree-selector.d.ts +1 -1
- package/dist/types/modes/components/user-message-selector.d.ts +1 -1
- package/dist/types/modes/components/user-message.d.ts +2 -1
- package/dist/types/modes/components/visual-truncate.d.ts +1 -1
- package/dist/types/modes/components/welcome.d.ts +19 -3
- package/dist/types/modes/controllers/mcp-command-controller.d.ts +1 -1
- package/dist/types/modes/controllers/streaming-reveal.d.ts +1 -1
- package/dist/types/modes/index.d.ts +3 -3
- package/dist/types/modes/interactive-mode.d.ts +8 -3
- package/dist/types/modes/oauth-manual-input.d.ts +7 -0
- package/dist/types/modes/rpc/rpc-client.d.ts +39 -2
- package/dist/types/modes/rpc/rpc-mode.d.ts +31 -2
- package/dist/types/modes/rpc/rpc-subagents.d.ts +24 -0
- package/dist/types/modes/rpc/rpc-types.d.ts +75 -1
- package/dist/types/modes/setup-wizard/index.d.ts +5 -1
- package/dist/types/modes/setup-wizard/lazy.d.ts +2 -0
- package/dist/types/modes/setup-wizard/scenes/sign-in.d.ts +1 -1
- package/dist/types/modes/setup-wizard/scenes/types.d.ts +1 -1
- package/dist/types/modes/setup-wizard/scenes/web-search.d.ts +1 -1
- package/dist/types/modes/setup-wizard/wizard-overlay.d.ts +1 -1
- package/dist/types/modes/types.d.ts +4 -1
- package/dist/types/secrets/index.d.ts +1 -1
- package/dist/types/secrets/obfuscator.d.ts +8 -2
- package/dist/types/session/agent-session.d.ts +15 -3
- package/dist/types/session/auth-broker-config.d.ts +4 -0
- package/dist/types/session/session-manager.d.ts +1 -1
- package/dist/types/session/streaming-output.d.ts +23 -0
- package/dist/types/slash-commands/acp-builtins.d.ts +16 -0
- package/dist/types/slash-commands/builtin-registry.d.ts +1 -0
- package/dist/types/slash-commands/helpers/stats-dashboard.d.ts +13 -0
- package/dist/types/slash-commands/types.d.ts +1 -1
- package/dist/types/ssh/connection-manager.d.ts +8 -0
- package/dist/types/system-prompt.d.ts +2 -0
- package/dist/types/task/executor.d.ts +1 -0
- package/dist/types/task/index.d.ts +2 -2
- package/dist/types/task/parallel.d.ts +2 -2
- package/dist/types/task/types.d.ts +8 -0
- package/dist/types/task/worktree.d.ts +2 -0
- package/dist/types/thinking.d.ts +4 -0
- package/dist/types/tiny/title-client.d.ts +11 -0
- package/dist/types/tiny/title-protocol.d.ts +1 -0
- package/dist/types/tools/ask.d.ts +4 -0
- package/dist/types/tools/conflict-detect.d.ts +16 -0
- package/dist/types/tools/github-cache.d.ts +7 -0
- package/dist/types/tools/index.d.ts +6 -0
- package/dist/types/tools/sqlite-reader.d.ts +3 -0
- package/dist/types/tui/output-block.d.ts +3 -3
- package/dist/types/utils/changelog.d.ts +8 -0
- package/dist/types/utils/git.d.ts +15 -2
- package/dist/types/utils/title-generator.d.ts +3 -2
- package/dist/types/web/scrapers/readthedocs.d.ts +3 -0
- package/dist/types/web/scrapers/types.d.ts +12 -0
- package/dist/types/web/search/providers/codex.d.ts +1 -1
- package/dist/types/web/search/providers/gemini.d.ts +1 -1
- package/examples/extensions/tools.ts +5 -4
- package/package.json +14 -11
- package/scripts/build-binary.ts +18 -23
- package/scripts/bundle-dist.ts +81 -0
- package/scripts/{dev-launch → omp} +1 -1
- package/scripts/{dev-launch-preload.ts → omp.ts} +1 -1
- package/src/async/job-manager.ts +57 -3
- package/src/auto-thinking/classifier.ts +1 -0
- package/src/autoresearch/dashboard.ts +1 -1
- package/src/autoresearch/prompt-setup.md +6 -6
- package/src/autoresearch/prompt.md +6 -6
- package/src/capability/fs.ts +10 -0
- package/src/cli/args.ts +4 -1
- package/src/cli/auth-gateway-cli.ts +1 -3
- package/src/cli/dry-balance-cli.ts +1 -1
- package/src/cli/gallery-cli.ts +1 -1
- package/src/cli/gallery-fixtures/fs.ts +1 -1
- package/src/cli/gallery-fixtures/types.ts +5 -1
- package/src/cli/list-models.ts +2 -1
- package/src/cli/usage-cli.ts +603 -0
- package/src/cli-commands.ts +30 -0
- package/src/cli.ts +76 -13
- package/src/commands/complete.ts +1 -1
- package/src/commands/launch.ts +5 -1
- package/src/commands/read.ts +6 -3
- package/src/commands/usage.ts +35 -0
- package/src/commit/agentic/agent.ts +1 -1
- package/src/commit/model-selection.ts +4 -3
- package/src/config/api-key-resolver.ts +8 -6
- package/src/config/append-only-context-mode.ts +6 -12
- package/src/config/model-discovery.ts +554 -0
- package/src/config/model-registry.ts +320 -1041
- package/src/config/model-resolver.ts +173 -156
- package/src/config/model-roles.ts +74 -0
- package/src/config/models-config-schema.ts +57 -8
- package/src/config/models-config.ts +129 -0
- package/src/config/settings-schema.ts +61 -19
- package/src/config/settings.ts +98 -4
- package/src/dap/client.ts +124 -37
- package/src/dap/session.ts +259 -158
- package/src/debug/log-viewer.ts +1 -1
- package/src/debug/raw-sse.ts +1 -1
- package/src/edit/diff.ts +47 -3
- package/src/edit/hashline/block-resolver.ts +20 -1
- package/src/edit/hashline/diff.ts +36 -1
- package/src/edit/hashline/execute.ts +47 -4
- package/src/edit/hashline/noop-loop-guard.ts +99 -0
- package/src/edit/index.ts +16 -1
- package/src/edit/modes/patch.ts +52 -0
- package/src/edit/modes/replace.ts +56 -22
- package/src/edit/notebook.ts +22 -2
- package/src/edit/renderer.ts +36 -10
- package/src/eval/__tests__/completion-bridge.test.ts +1 -1
- package/src/eval/backend.ts +0 -2
- package/src/eval/completion-bridge.ts +3 -1
- package/src/eval/idle-timeout.ts +2 -9
- package/src/eval/js/context-manager.ts +6 -8
- package/src/eval/js/executor.ts +6 -2
- package/src/eval/js/index.ts +0 -2
- package/src/eval/js/shared/helpers.ts +5 -6
- package/src/eval/js/shared/local-module-loader.ts +1 -1
- package/src/eval/js/shared/prelude.txt +62 -1
- package/src/eval/js/shared/rewrite-imports.ts +40 -22
- package/src/eval/js/shared/runtime.ts +1 -1
- package/src/eval/py/executor.ts +29 -7
- package/src/eval/py/index.ts +6 -3
- package/src/eval/py/kernel.ts +43 -4
- package/src/eval/py/runner.py +107 -3
- package/src/eval/py/runtime.ts +37 -0
- package/src/exec/bash-executor.ts +85 -4
- package/src/export/html/template.generated.ts +1 -1
- package/src/export/html/template.js +3 -1
- package/src/extensibility/extensions/get-commands-handler.ts +2 -1
- package/src/extensibility/extensions/runner.ts +6 -1
- package/src/extensibility/extensions/types.ts +6 -2
- package/src/extensibility/plugins/legacy-pi-compat.ts +20 -3
- package/src/hindsight/bank.ts +17 -2
- package/src/hindsight/mental-models.ts +59 -12
- package/src/hindsight/state.ts +6 -1
- package/src/internal-urls/artifact-protocol.ts +11 -2
- package/src/internal-urls/docs-index.generated.ts +11 -11
- package/src/internal-urls/issue-pr-protocol.ts +12 -5
- package/src/internal-urls/router.ts +1 -1
- package/src/internal-urls/types.ts +1 -1
- package/src/lib/xai-http.ts +1 -1
- package/src/lsp/client.ts +118 -38
- package/src/lsp/clients/biome-client.ts +101 -39
- package/src/lsp/edits.ts +143 -95
- package/src/lsp/index.ts +31 -22
- package/src/lsp/render.ts +1 -1
- package/src/lsp/types.ts +2 -0
- package/src/lsp/utils.ts +28 -10
- package/src/main.ts +183 -23
- package/src/mcp/json-rpc.ts +35 -5
- package/src/mcp/transports/stdio.ts +7 -1
- package/src/memories/index.ts +4 -1
- package/src/memory-backend/index.ts +1 -0
- package/src/memory-backend/local-backend.ts +9 -0
- package/src/memory-backend/off-backend.ts +9 -0
- package/src/memory-backend/runtime.ts +66 -0
- package/src/memory-backend/types.ts +81 -1
- package/src/mnemopi/backend.ts +176 -7
- package/src/mnemopi/state.ts +38 -2
- package/src/modes/acp/acp-agent.ts +119 -11
- package/src/modes/components/agent-dashboard.ts +10 -7
- package/src/modes/components/assistant-message.ts +32 -28
- package/src/modes/components/bash-execution.ts +1 -1
- package/src/modes/components/copy-selector.ts +1 -1
- package/src/modes/components/diff.ts +13 -2
- package/src/modes/components/dynamic-border.ts +12 -3
- package/src/modes/components/extensions/extension-dashboard.ts +8 -5
- package/src/modes/components/extensions/extension-list.ts +1 -1
- package/src/modes/components/extensions/inspector-panel.ts +1 -1
- package/src/modes/components/footer.ts +4 -2
- package/src/modes/components/history-search.ts +1 -1
- package/src/modes/components/hook-editor.ts +8 -0
- package/src/modes/components/hook-input.ts +8 -0
- package/src/modes/components/hook-selector.ts +2 -2
- package/src/modes/components/model-selector.ts +4 -2
- package/src/modes/components/plan-review-overlay.ts +1 -1
- package/src/modes/components/session-observer-overlay.ts +2 -2
- package/src/modes/components/session-selector.ts +1 -1
- package/src/modes/components/settings-selector.ts +5 -1
- package/src/modes/components/status-line/component.ts +119 -35
- package/src/modes/components/tiny-title-download-progress.ts +1 -1
- package/src/modes/components/transcript-container.ts +258 -53
- package/src/modes/components/tree-selector.ts +3 -3
- package/src/modes/components/user-message-selector.ts +1 -1
- package/src/modes/components/user-message.ts +17 -5
- package/src/modes/components/visual-truncate.ts +1 -1
- package/src/modes/components/welcome.ts +108 -26
- package/src/modes/controllers/command-controller.ts +11 -4
- package/src/modes/controllers/event-controller.ts +73 -4
- package/src/modes/controllers/input-controller.ts +2 -1
- package/src/modes/controllers/mcp-command-controller.ts +39 -4
- package/src/modes/controllers/selector-controller.ts +1 -1
- package/src/modes/controllers/streaming-reveal.ts +85 -18
- package/src/modes/index.ts +3 -21
- package/src/modes/interactive-mode.ts +42 -18
- package/src/modes/oauth-manual-input.ts +30 -3
- package/src/modes/rpc/rpc-client.ts +154 -3
- package/src/modes/rpc/rpc-mode.ts +97 -12
- package/src/modes/rpc/rpc-subagents.ts +265 -0
- package/src/modes/rpc/rpc-types.ts +81 -1
- package/src/modes/setup-wizard/index.ts +12 -2
- package/src/modes/setup-wizard/lazy.ts +16 -0
- package/src/modes/setup-wizard/scenes/glyph.ts +1 -1
- package/src/modes/setup-wizard/scenes/providers.ts +1 -1
- package/src/modes/setup-wizard/scenes/sign-in.ts +1 -1
- package/src/modes/setup-wizard/scenes/theme.ts +1 -1
- package/src/modes/setup-wizard/scenes/types.ts +1 -1
- package/src/modes/setup-wizard/scenes/web-search.ts +1 -1
- package/src/modes/setup-wizard/wizard-overlay.ts +1 -1
- package/src/modes/types.ts +4 -1
- package/src/prompts/agents/explore.md +2 -2
- package/src/prompts/agents/librarian.md +1 -2
- package/src/prompts/agents/oracle.md +1 -1
- package/src/prompts/agents/plan.md +5 -5
- package/src/prompts/agents/task.md +5 -5
- package/src/prompts/ci-green-request.md +5 -7
- package/src/prompts/goals/goal-budget-limit.md +2 -2
- package/src/prompts/goals/goal-continuation.md +4 -4
- package/src/prompts/goals/goal-mode-active.md +1 -1
- package/src/prompts/memories/read-path.md +1 -1
- package/src/prompts/memories/stage_one_system.md +2 -2
- package/src/prompts/review-custom-request.md +1 -1
- package/src/prompts/system/agent-creation-architect.md +2 -2
- package/src/prompts/system/auto-continue.md +1 -1
- package/src/prompts/system/background-tan-dispatch.md +1 -1
- package/src/prompts/system/btw-user.md +2 -2
- package/src/prompts/system/commit-message-system.md +13 -1
- package/src/prompts/system/custom-system-prompt.md +1 -1
- package/src/prompts/system/eager-todo.md +2 -2
- package/src/prompts/system/irc-incoming.md +1 -1
- package/src/prompts/system/manual-continue.md +1 -1
- package/src/prompts/system/omfg-user.md +3 -4
- package/src/prompts/system/orchestrate-notice.md +9 -9
- package/src/prompts/system/plan-mode-active.md +4 -4
- package/src/prompts/system/plan-mode-subagent.md +4 -5
- package/src/prompts/system/plan-mode-tool-decision-reminder.md +1 -1
- package/src/prompts/system/project-prompt.md +2 -2
- package/src/prompts/system/subagent-system-prompt.md +4 -4
- package/src/prompts/system/system-prompt.md +13 -24
- package/src/prompts/system/title-system.md +2 -2
- package/src/prompts/system/ttsr-tool-reminder.md +1 -1
- package/src/prompts/system/workflow-notice.md +1 -1
- package/src/prompts/tools/ast-edit.md +1 -1
- package/src/prompts/tools/ast-grep.md +2 -2
- package/src/prompts/tools/bash.md +5 -7
- package/src/prompts/tools/browser.md +7 -7
- package/src/prompts/tools/debug.md +1 -1
- package/src/prompts/tools/eval.md +3 -3
- package/src/prompts/tools/find.md +0 -1
- package/src/prompts/tools/github.md +8 -7
- package/src/prompts/tools/goal.md +1 -1
- package/src/prompts/tools/image-gen.md +1 -1
- package/src/prompts/tools/inspect-image-system.md +1 -1
- package/src/prompts/tools/irc.md +15 -15
- package/src/prompts/tools/lsp.md +2 -2
- package/src/prompts/tools/patch.md +2 -2
- package/src/prompts/tools/read.md +3 -4
- package/src/prompts/tools/recall.md +1 -1
- package/src/prompts/tools/reflect.md +1 -1
- package/src/prompts/tools/render-mermaid.md +2 -2
- package/src/prompts/tools/replace.md +4 -10
- package/src/prompts/tools/rewind.md +2 -2
- package/src/prompts/tools/search-tool-bm25.md +1 -9
- package/src/prompts/tools/search.md +0 -1
- package/src/prompts/tools/ssh.md +0 -4
- package/src/prompts/tools/task.md +2 -3
- package/src/prompts/tools/todo.md +1 -1
- package/src/sdk.ts +31 -11
- package/src/secrets/index.ts +8 -1
- package/src/secrets/obfuscator.ts +39 -18
- package/src/session/agent-session.ts +223 -64
- package/src/session/auth-broker-config.ts +30 -1
- package/src/session/session-manager.ts +2 -2
- package/src/session/streaming-output.ts +188 -11
- package/src/slash-commands/acp-builtins.ts +24 -0
- package/src/slash-commands/builtin-registry.ts +40 -0
- package/src/slash-commands/helpers/stats-dashboard.ts +85 -0
- package/src/slash-commands/types.ts +1 -1
- package/src/ssh/connection-manager.ts +27 -0
- package/src/system-prompt.ts +14 -0
- package/src/task/commands.ts +2 -1
- package/src/task/executor.ts +74 -65
- package/src/task/index.ts +146 -68
- package/src/task/parallel.ts +3 -3
- package/src/task/render.ts +20 -5
- package/src/task/types.ts +9 -0
- package/src/task/worktree.ts +64 -56
- package/src/thinking.ts +9 -1
- package/src/tiny/title-client.ts +60 -16
- package/src/tiny/title-protocol.ts +1 -1
- package/src/tiny/worker.ts +6 -4
- package/src/tools/archive-reader.ts +30 -2
- package/src/tools/ask.ts +104 -21
- package/src/tools/ast-edit.ts +25 -5
- package/src/tools/auto-generated-guard.ts +20 -3
- package/src/tools/bash-interactive.ts +27 -7
- package/src/tools/bash.ts +100 -18
- package/src/tools/browser/launch.ts +11 -2
- package/src/tools/browser/readable.ts +19 -2
- package/src/tools/browser/registry.ts +4 -1
- package/src/tools/browser/render.ts +2 -2
- package/src/tools/browser/tab-supervisor.ts +55 -16
- package/src/tools/conflict-detect.ts +50 -4
- package/src/tools/debug.ts +1 -1
- package/src/tools/eval-render.ts +5 -5
- package/src/tools/eval.ts +0 -2
- package/src/tools/fetch.ts +33 -10
- package/src/tools/gh-cache-invalidation.ts +63 -8
- package/src/tools/gh-renderer.ts +1 -1
- package/src/tools/gh.ts +172 -29
- package/src/tools/github-cache.ts +70 -6
- package/src/tools/image-gen.ts +14 -13
- package/src/tools/index.ts +13 -1
- package/src/tools/inspect-image.ts +1 -0
- package/src/tools/irc.ts +5 -1
- package/src/tools/job.ts +1 -1
- package/src/tools/read.ts +202 -61
- package/src/tools/render-utils.ts +3 -3
- package/src/tools/resolve.ts +1 -1
- package/src/tools/search.ts +92 -29
- package/src/tools/sqlite-reader.ts +17 -5
- package/src/tools/ssh.ts +8 -8
- package/src/tools/todo.ts +38 -8
- package/src/tools/write.ts +118 -18
- package/src/tui/output-block.ts +4 -4
- package/src/utils/changelog.ts +27 -1
- package/src/utils/commit-message-generator.ts +1 -0
- package/src/utils/file-mentions.ts +2 -1
- package/src/utils/git.ts +267 -13
- package/src/utils/title-generator.ts +24 -5
- package/src/web/scrapers/arxiv.ts +1 -1
- package/src/web/scrapers/go-pkg.ts +1 -1
- package/src/web/scrapers/iacr.ts +1 -1
- package/src/web/scrapers/readthedocs.ts +1 -1
- package/src/web/scrapers/twitter.ts +2 -1
- package/src/web/scrapers/types.ts +87 -8
- package/src/web/scrapers/wikipedia.ts +1 -1
- package/src/web/scrapers/youtube.ts +6 -1
- package/src/web/search/index.ts +1 -1
- package/src/web/search/providers/codex.ts +2 -1
- package/src/web/search/providers/gemini.ts +2 -3
- package/src/web/search/render.ts +8 -6
- package/dist/types/config/model-equivalence.d.ts +0 -24
- package/dist/types/config/model-id-affixes.d.ts +0 -12
- package/dist/types/config/model-provider-priority.d.ts +0 -1
- package/dist/types/exec/idle-timeout-watchdog.d.ts +0 -18
- package/src/config/model-equivalence.ts +0 -875
- package/src/config/model-id-affixes.ts +0 -81
- package/src/config/model-provider-priority.ts +0 -56
- package/src/exec/idle-timeout-watchdog.ts +0 -126
|
@@ -1,4 +1,14 @@
|
|
|
1
1
|
import { type Component } from "@oh-my-pi/pi-tui";
|
|
2
|
+
/**
|
|
3
|
+
* Fixed number of session rows in the welcome box so its height doesn't shift
|
|
4
|
+
* between the pre-TUI splash (loading placeholder) and the loaded state.
|
|
5
|
+
*/
|
|
6
|
+
export declare const WELCOME_SESSION_SLOTS = 4;
|
|
7
|
+
/**
|
|
8
|
+
* Fixed number of LSP-server rows, for the same reason. Overflow is sliced so
|
|
9
|
+
* the box height is constant regardless of how many servers a project has.
|
|
10
|
+
*/
|
|
11
|
+
export declare const WELCOME_LSP_SLOTS = 4;
|
|
2
12
|
export declare function renderWelcomeTip(tip: string, boxWidth: number): string[];
|
|
3
13
|
export interface RecentSession {
|
|
4
14
|
name: string;
|
|
@@ -6,7 +16,7 @@ export interface RecentSession {
|
|
|
6
16
|
}
|
|
7
17
|
export interface LspServerInfo {
|
|
8
18
|
name: string;
|
|
9
|
-
status: "ready" | "error" | "connecting";
|
|
19
|
+
status: "ready" | "error" | "connecting" | "available";
|
|
10
20
|
fileTypes: string[];
|
|
11
21
|
}
|
|
12
22
|
/**
|
|
@@ -19,8 +29,14 @@ export declare class WelcomeComponent implements Component {
|
|
|
19
29
|
private providerName;
|
|
20
30
|
private recentSessions;
|
|
21
31
|
private lspServers;
|
|
22
|
-
constructor(version: string, modelName: string, providerName: string, recentSessions?: RecentSession[], lspServers?: LspServerInfo[]);
|
|
32
|
+
constructor(version: string, modelName: string, providerName: string, recentSessions?: RecentSession[] | null, lspServers?: LspServerInfo[]);
|
|
23
33
|
invalidate(): void;
|
|
34
|
+
/**
|
|
35
|
+
* Freeze the logo on the intro animation's first frame. The pre-TUI startup
|
|
36
|
+
* splash uses this so the in-TUI intro — which starts at that exact frame —
|
|
37
|
+
* picks up seamlessly from the splash's static box.
|
|
38
|
+
*/
|
|
39
|
+
holdIntroFirstFrame(): void;
|
|
24
40
|
/**
|
|
25
41
|
* Play a one-shot intro that sweeps the gradient through every phase
|
|
26
42
|
* before settling on the resting frame. Safe to call multiple times —
|
|
@@ -30,7 +46,7 @@ export declare class WelcomeComponent implements Component {
|
|
|
30
46
|
setModel(modelName: string, providerName: string): void;
|
|
31
47
|
setRecentSessions(sessions: RecentSession[]): void;
|
|
32
48
|
setLspServers(servers: LspServerInfo[]): void;
|
|
33
|
-
render(termWidth: number): string[];
|
|
49
|
+
render(termWidth: number): readonly string[];
|
|
34
50
|
}
|
|
35
51
|
export declare const PI_LOGO: string[];
|
|
36
52
|
export interface ShineConfig {
|
|
@@ -5,7 +5,7 @@ export declare class MCPAuthorizationLinkPrompt implements Component {
|
|
|
5
5
|
#private;
|
|
6
6
|
constructor(url: string);
|
|
7
7
|
invalidate(): void;
|
|
8
|
-
render(_width: number): string[];
|
|
8
|
+
render(_width: number): readonly string[];
|
|
9
9
|
}
|
|
10
10
|
export declare class MCPCommandController {
|
|
11
11
|
#private;
|
|
@@ -10,7 +10,7 @@ type StreamingRevealControllerOptions = {
|
|
|
10
10
|
requestRender(): void;
|
|
11
11
|
};
|
|
12
12
|
export declare function visibleUnits(message: AssistantMessage, hideThinking: boolean): number;
|
|
13
|
-
export declare function buildDisplayMessage(target: AssistantMessage, revealed: number, hideThinking: boolean): AssistantMessage;
|
|
13
|
+
export declare function buildDisplayMessage(target: AssistantMessage, revealed: number, hideThinking: boolean, countOf?: (index: number, text: string) => number): AssistantMessage;
|
|
14
14
|
export declare function nextStep(backlog: number): number;
|
|
15
15
|
export declare class StreamingRevealController {
|
|
16
16
|
#private;
|
|
@@ -5,6 +5,6 @@
|
|
|
5
5
|
* barrel does not pull print, RPC server, or ACP server mode into the normal
|
|
6
6
|
* TUI graph.
|
|
7
7
|
*/
|
|
8
|
-
export
|
|
9
|
-
export
|
|
10
|
-
export
|
|
8
|
+
export * from "./interactive-mode";
|
|
9
|
+
export * from "./rpc/rpc-client";
|
|
10
|
+
export * from "./rpc/rpc-types";
|
|
@@ -1,12 +1,13 @@
|
|
|
1
1
|
import { type Agent, type AgentMessage } from "@oh-my-pi/pi-agent-core";
|
|
2
2
|
import type { CompactionOutcome } from "@oh-my-pi/pi-agent-core/compaction";
|
|
3
|
-
import {
|
|
3
|
+
import type { AssistantMessage, ImageContent, Message, UsageReport } from "@oh-my-pi/pi-ai";
|
|
4
4
|
import type { Component, EditorTheme } from "@oh-my-pi/pi-tui";
|
|
5
5
|
import { Container, Loader, Spacer, Text, TUI } from "@oh-my-pi/pi-tui";
|
|
6
6
|
import { KeybindingsManager } from "../config/keybindings";
|
|
7
7
|
import { Settings } from "../config/settings";
|
|
8
8
|
import type { ExtensionUIContext, ExtensionUIDialogOptions, ExtensionUISelectItem, ExtensionWidgetContent, ExtensionWidgetOptions } from "../extensibility/extensions";
|
|
9
9
|
import type { CompactOptions } from "../extensibility/extensions/types";
|
|
10
|
+
import type { MCPManager } from "../mcp";
|
|
10
11
|
import { type PlanApprovalDetails } from "../plan-mode/approved-plan";
|
|
11
12
|
import type { AgentSession } from "../session/agent-session";
|
|
12
13
|
import { HistoryStorage } from "../session/history-storage";
|
|
@@ -49,6 +50,7 @@ export declare class InteractiveMode implements InteractiveModeContext {
|
|
|
49
50
|
keybindings: KeybindingsManager;
|
|
50
51
|
agent: Agent;
|
|
51
52
|
historyStorage?: HistoryStorage;
|
|
53
|
+
titleSystemPrompt?: string;
|
|
52
54
|
ui: TUI;
|
|
53
55
|
chatContainer: TranscriptContainer;
|
|
54
56
|
pendingMessagesContainer: Container;
|
|
@@ -108,10 +110,12 @@ export declare class InteractiveMode implements InteractiveModeContext {
|
|
|
108
110
|
skillCommands: Map<string, string>;
|
|
109
111
|
oauthManualInput: OAuthManualInputManager;
|
|
110
112
|
readonly lspServers: LspStartupServerInfo[] | undefined;
|
|
111
|
-
mcpManager?:
|
|
112
|
-
constructor(session: AgentSession, version: string, changelogMarkdown?: string | undefined, setToolUIContext?: (uiContext: ExtensionUIContext, hasUI: boolean) => void, lspServers?: LspStartupServerInfo[] | undefined, mcpManager?:
|
|
113
|
+
mcpManager?: MCPManager;
|
|
114
|
+
constructor(session: AgentSession, version: string, changelogMarkdown?: string | undefined, setToolUIContext?: (uiContext: ExtensionUIContext, hasUI: boolean) => void, lspServers?: LspStartupServerInfo[] | undefined, mcpManager?: MCPManager, eventBus?: EventBus, titleSystemPrompt?: string);
|
|
113
115
|
playWelcomeIntro(): void;
|
|
114
116
|
init(options?: InteractiveModeInitOptions): Promise<void>;
|
|
117
|
+
/** Reload the title-generation system prompt override for the provided working directory. */
|
|
118
|
+
refreshTitleSystemPrompt(cwd?: string): Promise<void>;
|
|
115
119
|
/** Reload slash commands and autocomplete for the provided working directory. */
|
|
116
120
|
refreshSlashCommandState(cwd?: string): Promise<void>;
|
|
117
121
|
/**
|
|
@@ -260,6 +264,7 @@ export declare class InteractiveMode implements InteractiveModeContext {
|
|
|
260
264
|
handleResumeSession(sessionPath: string): Promise<void>;
|
|
261
265
|
handleSessionDeleteCommand(): Promise<void>;
|
|
262
266
|
showOAuthSelector(mode: "login" | "logout", providerId?: string): Promise<void>;
|
|
267
|
+
showProviderSetup(): Promise<void>;
|
|
263
268
|
showHookConfirm(title: string, message: string): Promise<boolean>;
|
|
264
269
|
handleCtrlC(): void;
|
|
265
270
|
handleCtrlD(): void;
|
|
@@ -1,8 +1,15 @@
|
|
|
1
|
+
type ClaimedInput = {
|
|
2
|
+
promise: Promise<string>;
|
|
3
|
+
clear: (reason?: string) => void;
|
|
4
|
+
};
|
|
1
5
|
export declare class OAuthManualInputManager {
|
|
2
6
|
#private;
|
|
3
7
|
waitForInput(providerId: string): Promise<string>;
|
|
8
|
+
tryWaitForInput(providerId: string): Promise<string> | undefined;
|
|
9
|
+
tryClaimInput(providerId: string): ClaimedInput | undefined;
|
|
4
10
|
submit(input: string): boolean;
|
|
5
11
|
clear(reason?: string): void;
|
|
6
12
|
hasPending(): boolean;
|
|
7
13
|
get pendingProviderId(): string | undefined;
|
|
8
14
|
}
|
|
15
|
+
export {};
|
|
@@ -7,8 +7,8 @@ import type { AgentEvent, AgentMessage, AgentToolResult, ThinkingLevel } from "@
|
|
|
7
7
|
import type { CompactionResult } from "@oh-my-pi/pi-agent-core/compaction";
|
|
8
8
|
import type { ImageContent, Model } from "@oh-my-pi/pi-ai";
|
|
9
9
|
import type { BashResult } from "../../exec/bash-executor";
|
|
10
|
-
import type { SessionStats } from "../../session/agent-session";
|
|
11
|
-
import type { RpcHandoffResult, RpcHostToolDefinition, RpcSessionState } from "./rpc-types";
|
|
10
|
+
import type { AgentSessionEvent, SessionStats } from "../../session/agent-session";
|
|
11
|
+
import type { RpcHandoffResult, RpcHostToolDefinition, RpcSessionState, RpcSubagentEventFrame, RpcSubagentLifecycleFrame, RpcSubagentMessagesResult, RpcSubagentProgressFrame, RpcSubagentSnapshot, RpcSubagentSubscriptionLevel } from "./rpc-types";
|
|
12
12
|
export interface RpcClientOptions {
|
|
13
13
|
/** Path to the CLI entry point (default: searches for dist/cli.js) */
|
|
14
14
|
cliPath?: string;
|
|
@@ -29,6 +29,10 @@ export interface RpcClientOptions {
|
|
|
29
29
|
}
|
|
30
30
|
export type ModelInfo = Pick<Model, "provider" | "id" | "contextWindow" | "reasoning" | "thinking">;
|
|
31
31
|
export type RpcEventListener = (event: AgentEvent) => void;
|
|
32
|
+
export type RpcSessionEventListener = (event: AgentSessionEvent) => void;
|
|
33
|
+
export type RpcSubagentLifecycleListener = (payload: RpcSubagentLifecycleFrame["payload"]) => void;
|
|
34
|
+
export type RpcSubagentProgressListener = (payload: RpcSubagentProgressFrame["payload"]) => void;
|
|
35
|
+
export type RpcSubagentEventListener = (payload: RpcSubagentEventFrame["payload"]) => void;
|
|
32
36
|
export interface RpcClientToolContext<TDetails = unknown> {
|
|
33
37
|
toolCallId: string;
|
|
34
38
|
signal: AbortSignal;
|
|
@@ -60,6 +64,22 @@ export declare class RpcClient {
|
|
|
60
64
|
* Subscribe to agent events.
|
|
61
65
|
*/
|
|
62
66
|
onEvent(listener: RpcEventListener): () => void;
|
|
67
|
+
/**
|
|
68
|
+
* Subscribe to all top-level session events, including non-core session state events.
|
|
69
|
+
*/
|
|
70
|
+
onSessionEvent(listener: RpcSessionEventListener): () => void;
|
|
71
|
+
/**
|
|
72
|
+
* Subscribe to subagent lifecycle frames after setSubagentSubscription("progress" | "events").
|
|
73
|
+
*/
|
|
74
|
+
onSubagentLifecycle(listener: RpcSubagentLifecycleListener): () => void;
|
|
75
|
+
/**
|
|
76
|
+
* Subscribe to aggregated subagent progress frames after setSubagentSubscription("progress" | "events").
|
|
77
|
+
*/
|
|
78
|
+
onSubagentProgress(listener: RpcSubagentProgressListener): () => void;
|
|
79
|
+
/**
|
|
80
|
+
* Subscribe to raw subagent session events. Call setSubagentSubscription(\"events\") to enable them server-side.
|
|
81
|
+
*/
|
|
82
|
+
onSubagentEvent(listener: RpcSubagentEventListener): () => void;
|
|
63
83
|
/**
|
|
64
84
|
* Get collected stderr output (useful for debugging).
|
|
65
85
|
*/
|
|
@@ -98,6 +118,23 @@ export declare class RpcClient {
|
|
|
98
118
|
* Get current session state.
|
|
99
119
|
*/
|
|
100
120
|
getState(): Promise<RpcSessionState>;
|
|
121
|
+
/**
|
|
122
|
+
* Configure subagent frames emitted by the RPC server. Servers default to "off".
|
|
123
|
+
* "progress" emits lifecycle/progress frames; "events" additionally emits raw subagent session events.
|
|
124
|
+
*/
|
|
125
|
+
setSubagentSubscription(level: RpcSubagentSubscriptionLevel): Promise<RpcSubagentSubscriptionLevel>;
|
|
126
|
+
/**
|
|
127
|
+
* Return the RPC server's current subagent snapshot.
|
|
128
|
+
*/
|
|
129
|
+
getSubagents(): Promise<RpcSubagentSnapshot[]>;
|
|
130
|
+
/**
|
|
131
|
+
* Read persisted transcript entries for a tracked subagent session.
|
|
132
|
+
*/
|
|
133
|
+
getSubagentMessages(selector: {
|
|
134
|
+
subagentId?: string;
|
|
135
|
+
sessionFile?: string;
|
|
136
|
+
fromByte?: number;
|
|
137
|
+
}): Promise<RpcSubagentMessagesResult>;
|
|
101
138
|
/**
|
|
102
139
|
* Set model by provider and ID.
|
|
103
140
|
*/
|
|
@@ -1,12 +1,41 @@
|
|
|
1
1
|
import { type ExtensionUIContext, type ExtensionUIDialogOptions } from "../../extensibility/extensions";
|
|
2
2
|
import type { AgentSession } from "../../session/agent-session";
|
|
3
|
-
import type {
|
|
3
|
+
import type { EventBus } from "../../utils/event-bus";
|
|
4
|
+
import { RpcSubagentRegistry } from "./rpc-subagents";
|
|
5
|
+
import type { RpcCommand, RpcExtensionUIRequest, RpcExtensionUIResponse, RpcHostToolCallRequest, RpcHostToolCancelRequest, RpcHostUriCancelRequest, RpcHostUriRequest, RpcResponse } from "./rpc-types";
|
|
4
6
|
export type * from "./rpc-types";
|
|
5
7
|
export type PendingExtensionRequest = {
|
|
6
8
|
resolve: (response: RpcExtensionUIResponse) => void;
|
|
7
9
|
reject: (error: Error) => void;
|
|
8
10
|
};
|
|
9
11
|
type RpcOutput = (obj: RpcResponse | RpcExtensionUIRequest | RpcHostToolCallRequest | RpcHostToolCancelRequest | RpcHostUriRequest | RpcHostUriCancelRequest | object) => void;
|
|
12
|
+
export type RpcSessionChangeCommand = Extract<RpcCommand, {
|
|
13
|
+
type: "new_session";
|
|
14
|
+
} | {
|
|
15
|
+
type: "switch_session";
|
|
16
|
+
} | {
|
|
17
|
+
type: "branch";
|
|
18
|
+
}>;
|
|
19
|
+
export type RpcSessionChangeResult = {
|
|
20
|
+
type: "new_session";
|
|
21
|
+
data: {
|
|
22
|
+
cancelled: boolean;
|
|
23
|
+
};
|
|
24
|
+
} | {
|
|
25
|
+
type: "switch_session";
|
|
26
|
+
data: {
|
|
27
|
+
cancelled: boolean;
|
|
28
|
+
};
|
|
29
|
+
} | {
|
|
30
|
+
type: "branch";
|
|
31
|
+
data: {
|
|
32
|
+
text: string;
|
|
33
|
+
cancelled: boolean;
|
|
34
|
+
};
|
|
35
|
+
};
|
|
36
|
+
export type RpcSessionChangeSession = Pick<AgentSession, "newSession" | "switchSession" | "branch">;
|
|
37
|
+
export type RpcSubagentResetRegistry = Pick<RpcSubagentRegistry, "clear">;
|
|
38
|
+
export declare function handleRpcSessionChange(session: RpcSessionChangeSession, command: RpcSessionChangeCommand, subagentRegistry?: RpcSubagentResetRegistry): Promise<RpcSessionChangeResult>;
|
|
10
39
|
export declare function requestRpcEditor(pendingRequests: Map<string, PendingExtensionRequest>, output: RpcOutput, title: string, prefill?: string, dialogOptions?: ExtensionUIDialogOptions, editorOptions?: {
|
|
11
40
|
promptStyle?: boolean;
|
|
12
41
|
}): Promise<string | undefined>;
|
|
@@ -14,4 +43,4 @@ export declare function requestRpcEditor(pendingRequests: Map<string, PendingExt
|
|
|
14
43
|
* Run in RPC mode.
|
|
15
44
|
* Listens for JSON commands on stdin, outputs events and responses on stdout.
|
|
16
45
|
*/
|
|
17
|
-
export declare function runRpcMode(session: AgentSession, setToolUIContext?: (uiContext: ExtensionUIContext, hasUI: boolean) => void): Promise<never>;
|
|
46
|
+
export declare function runRpcMode(session: AgentSession, setToolUIContext?: (uiContext: ExtensionUIContext, hasUI: boolean) => void, eventBus?: EventBus): Promise<never>;
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import { type SubagentEventPayload, type SubagentLifecyclePayload, type SubagentProgressPayload } from "../../task";
|
|
2
|
+
import type { EventBus } from "../../utils/event-bus";
|
|
3
|
+
import type { RpcSubagentFrame, RpcSubagentMessagesResult, RpcSubagentSnapshot, RpcSubagentSubscriptionLevel } from "./rpc-types";
|
|
4
|
+
export interface RpcSubagentTranscriptSelector {
|
|
5
|
+
subagentId?: string;
|
|
6
|
+
sessionFile?: string;
|
|
7
|
+
fromByte?: number;
|
|
8
|
+
}
|
|
9
|
+
type RpcSubagentOutput = (frame: RpcSubagentFrame) => void;
|
|
10
|
+
export declare function readRpcSubagentTranscript(sessionFile: string, fromByte?: number): Promise<RpcSubagentMessagesResult>;
|
|
11
|
+
export declare class RpcSubagentRegistry {
|
|
12
|
+
#private;
|
|
13
|
+
constructor(eventBus: EventBus, output: RpcSubagentOutput);
|
|
14
|
+
dispose(): void;
|
|
15
|
+
clear(): void;
|
|
16
|
+
setSubscriptionLevel(level: RpcSubagentSubscriptionLevel): void;
|
|
17
|
+
getSubscriptionLevel(): RpcSubagentSubscriptionLevel;
|
|
18
|
+
getSubagents(): RpcSubagentSnapshot[];
|
|
19
|
+
handleLifecycle(payload: SubagentLifecyclePayload): void;
|
|
20
|
+
handleProgress(payload: SubagentProgressPayload): void;
|
|
21
|
+
handleEvent(payload: SubagentEventPayload): void;
|
|
22
|
+
resolveSessionFile(selector: RpcSubagentTranscriptSelector): string;
|
|
23
|
+
}
|
|
24
|
+
export {};
|
|
@@ -9,7 +9,9 @@ import type { CompactionResult } from "@oh-my-pi/pi-agent-core/compaction";
|
|
|
9
9
|
import type { Effort, ImageContent, Model } from "@oh-my-pi/pi-ai";
|
|
10
10
|
import type { BashResult } from "../../exec/bash-executor";
|
|
11
11
|
import type { ContextUsage } from "../../extensibility/extensions/types";
|
|
12
|
-
import type { SessionStats } from "../../session/agent-session";
|
|
12
|
+
import type { AgentSessionEvent, SessionStats } from "../../session/agent-session";
|
|
13
|
+
import type { FileEntry } from "../../session/session-manager";
|
|
14
|
+
import type { AgentProgress, SubagentEventPayload, SubagentLifecyclePayload, SubagentProgressPayload } from "../../task";
|
|
13
15
|
import type { TodoPhase } from "../../tools/todo";
|
|
14
16
|
export type RpcCommand = {
|
|
15
17
|
id?: string;
|
|
@@ -54,6 +56,19 @@ export type RpcCommand = {
|
|
|
54
56
|
id?: string;
|
|
55
57
|
type: "set_host_uri_schemes";
|
|
56
58
|
schemes: RpcHostUriSchemeDefinition[];
|
|
59
|
+
} | {
|
|
60
|
+
id?: string;
|
|
61
|
+
type: "set_subagent_subscription";
|
|
62
|
+
level: RpcSubagentSubscriptionLevel;
|
|
63
|
+
} | {
|
|
64
|
+
id?: string;
|
|
65
|
+
type: "get_subagents";
|
|
66
|
+
} | {
|
|
67
|
+
id?: string;
|
|
68
|
+
type: "get_subagent_messages";
|
|
69
|
+
subagentId?: string;
|
|
70
|
+
sessionFile?: string;
|
|
71
|
+
fromByte?: number;
|
|
57
72
|
} | {
|
|
58
73
|
id?: string;
|
|
59
74
|
type: "set_model";
|
|
@@ -174,6 +189,29 @@ export interface RpcSessionState {
|
|
|
174
189
|
export interface RpcHandoffResult {
|
|
175
190
|
savedPath?: string;
|
|
176
191
|
}
|
|
192
|
+
export type RpcSubagentSubscriptionLevel = "off" | "progress" | "events";
|
|
193
|
+
export interface RpcSubagentSnapshot {
|
|
194
|
+
id: string;
|
|
195
|
+
index: number;
|
|
196
|
+
agent: string;
|
|
197
|
+
agentSource: AgentProgress["agentSource"];
|
|
198
|
+
description?: string;
|
|
199
|
+
status: AgentProgress["status"];
|
|
200
|
+
task?: string;
|
|
201
|
+
assignment?: string;
|
|
202
|
+
sessionFile?: string;
|
|
203
|
+
lastUpdate: number;
|
|
204
|
+
progress?: AgentProgress;
|
|
205
|
+
parentToolCallId?: string;
|
|
206
|
+
}
|
|
207
|
+
export interface RpcSubagentMessagesResult {
|
|
208
|
+
sessionFile: string;
|
|
209
|
+
fromByte: number;
|
|
210
|
+
nextByte: number;
|
|
211
|
+
reset: boolean;
|
|
212
|
+
entries: FileEntry[];
|
|
213
|
+
messages: AgentMessage[];
|
|
214
|
+
}
|
|
177
215
|
export type RpcResponse = {
|
|
178
216
|
id?: string;
|
|
179
217
|
type: "response";
|
|
@@ -237,6 +275,28 @@ export type RpcResponse = {
|
|
|
237
275
|
data: {
|
|
238
276
|
schemes: string[];
|
|
239
277
|
};
|
|
278
|
+
} | {
|
|
279
|
+
id?: string;
|
|
280
|
+
type: "response";
|
|
281
|
+
command: "set_subagent_subscription";
|
|
282
|
+
success: true;
|
|
283
|
+
data: {
|
|
284
|
+
level: RpcSubagentSubscriptionLevel;
|
|
285
|
+
};
|
|
286
|
+
} | {
|
|
287
|
+
id?: string;
|
|
288
|
+
type: "response";
|
|
289
|
+
command: "get_subagents";
|
|
290
|
+
success: true;
|
|
291
|
+
data: {
|
|
292
|
+
subagents: RpcSubagentSnapshot[];
|
|
293
|
+
};
|
|
294
|
+
} | {
|
|
295
|
+
id?: string;
|
|
296
|
+
type: "response";
|
|
297
|
+
command: "get_subagent_messages";
|
|
298
|
+
success: true;
|
|
299
|
+
data: RpcSubagentMessagesResult;
|
|
240
300
|
} | {
|
|
241
301
|
id?: string;
|
|
242
302
|
type: "response";
|
|
@@ -418,6 +478,20 @@ export type RpcResponse = {
|
|
|
418
478
|
success: false;
|
|
419
479
|
error: string;
|
|
420
480
|
};
|
|
481
|
+
export interface RpcSubagentLifecycleFrame {
|
|
482
|
+
type: "subagent_lifecycle";
|
|
483
|
+
payload: SubagentLifecyclePayload;
|
|
484
|
+
}
|
|
485
|
+
export interface RpcSubagentProgressFrame {
|
|
486
|
+
type: "subagent_progress";
|
|
487
|
+
payload: SubagentProgressPayload;
|
|
488
|
+
}
|
|
489
|
+
export interface RpcSubagentEventFrame {
|
|
490
|
+
type: "subagent_event";
|
|
491
|
+
payload: SubagentEventPayload;
|
|
492
|
+
}
|
|
493
|
+
export type RpcSubagentFrame = RpcSubagentLifecycleFrame | RpcSubagentProgressFrame | RpcSubagentEventFrame;
|
|
494
|
+
export type RpcSessionEventFrame = AgentSessionEvent | RpcSubagentFrame;
|
|
421
495
|
/** Emitted when an extension needs user input */
|
|
422
496
|
export type RpcExtensionUIRequest = {
|
|
423
497
|
type: "extension_ui_request";
|
|
@@ -14,4 +14,8 @@ export interface SetupSceneSelectionOptions {
|
|
|
14
14
|
}
|
|
15
15
|
export declare function selectSetupScenes(storedVersion: number, scenes: readonly SetupScene[], ctx?: InteractiveModeContext, options?: SetupSceneSelectionOptions): Promise<SetupScene[]>;
|
|
16
16
|
export declare function markSetupWizardComplete(settings: Settings, version?: number): Promise<void>;
|
|
17
|
-
export
|
|
17
|
+
export interface RunSetupWizardOptions {
|
|
18
|
+
markComplete?: boolean;
|
|
19
|
+
playWelcomeIntro?: boolean;
|
|
20
|
+
}
|
|
21
|
+
export declare function runSetupWizard(ctx: InteractiveModeContext, scenes?: readonly SetupScene[], options?: RunSetupWizardOptions): Promise<void>;
|
|
@@ -27,7 +27,7 @@ export interface SetupTab {
|
|
|
27
27
|
* login). The parent scene MUST NOT switch tabs or finish while modal.
|
|
28
28
|
*/
|
|
29
29
|
readonly modal: boolean;
|
|
30
|
-
render(width: number): string[];
|
|
30
|
+
render(width: number): readonly string[];
|
|
31
31
|
handleInput(data: string): void;
|
|
32
32
|
invalidate(): void;
|
|
33
33
|
/** Called when the tab becomes active (including initial mount). */
|
|
@@ -22,6 +22,7 @@ import type { HookInputComponent } from "./components/hook-input";
|
|
|
22
22
|
import type { HookSelectorComponent, HookSelectorOptions } from "./components/hook-selector";
|
|
23
23
|
import type { StatusLineComponent } from "./components/status-line";
|
|
24
24
|
import type { ToolExecutionHandle } from "./components/tool-execution";
|
|
25
|
+
import type { TranscriptContainer } from "./components/transcript-container";
|
|
25
26
|
import type { LoopLimitRuntime } from "./loop-limit";
|
|
26
27
|
import type { OAuthManualInputManager } from "./oauth-manual-input";
|
|
27
28
|
import type { Theme } from "./theme/theme";
|
|
@@ -61,7 +62,7 @@ export interface InteractiveModeInitOptions {
|
|
|
61
62
|
export type InteractiveSelectorDialogOptions = ExtensionUIDialogOptions & Pick<HookSelectorOptions, "disabledIndices">;
|
|
62
63
|
export interface InteractiveModeContext {
|
|
63
64
|
ui: TUI;
|
|
64
|
-
chatContainer:
|
|
65
|
+
chatContainer: TranscriptContainer;
|
|
65
66
|
pendingMessagesContainer: Container;
|
|
66
67
|
statusContainer: Container;
|
|
67
68
|
todoContainer: Container;
|
|
@@ -81,6 +82,7 @@ export interface InteractiveModeContext {
|
|
|
81
82
|
historyStorage?: HistoryStorage;
|
|
82
83
|
mcpManager?: MCPManager;
|
|
83
84
|
lspServers?: LspStartupServerInfo[];
|
|
85
|
+
titleSystemPrompt?: string;
|
|
84
86
|
isInitialized: boolean;
|
|
85
87
|
isBashMode: boolean;
|
|
86
88
|
toolOutputExpanded: boolean;
|
|
@@ -261,6 +263,7 @@ export interface InteractiveModeContext {
|
|
|
261
263
|
handleResumeSession(sessionPath: string): Promise<void>;
|
|
262
264
|
handleSessionDeleteCommand(): Promise<void>;
|
|
263
265
|
showOAuthSelector(mode: "login" | "logout", providerId?: string): Promise<void>;
|
|
266
|
+
showProviderSetup(): Promise<void>;
|
|
264
267
|
showHookConfirm(title: string, message: string): Promise<boolean>;
|
|
265
268
|
showDebugSelector(): Promise<void>;
|
|
266
269
|
showSessionObserver(): void;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { SecretEntry } from "./obfuscator";
|
|
2
|
-
export { deobfuscateSessionContext, obfuscateMessages, type SecretEntry, SecretObfuscator } from "./obfuscator";
|
|
2
|
+
export { deobfuscateSessionContext, obfuscateMessages, obfuscateProviderContext, obfuscateProviderTools, type SecretEntry, SecretObfuscator, } from "./obfuscator";
|
|
3
3
|
/**
|
|
4
4
|
* Load secrets from project-local and global secrets.yml files.
|
|
5
5
|
* Project-local entries override global entries with matching content.
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { Message } from "@oh-my-pi/pi-ai";
|
|
1
|
+
import type { Context, Message, Tool } from "@oh-my-pi/pi-ai";
|
|
2
2
|
import type { SessionContext } from "../session/session-manager";
|
|
3
3
|
export interface SecretEntry {
|
|
4
4
|
type: "plain" | "regex";
|
|
@@ -17,7 +17,13 @@ export declare class SecretObfuscator {
|
|
|
17
17
|
deobfuscate(text: string): string;
|
|
18
18
|
/** Deep-walk an object, deobfuscating all string values. */
|
|
19
19
|
deobfuscateObject<T>(obj: T): T;
|
|
20
|
+
/** Deep-walk an object, obfuscating all string values. */
|
|
21
|
+
obfuscateObject<T>(obj: T): T;
|
|
20
22
|
}
|
|
21
23
|
export declare function deobfuscateSessionContext(sessionContext: SessionContext, obfuscator: SecretObfuscator | undefined): SessionContext;
|
|
22
|
-
/** Obfuscate all
|
|
24
|
+
/** Obfuscate all string content in LLM messages (for outbound interception). */
|
|
23
25
|
export declare function obfuscateMessages(obfuscator: SecretObfuscator, messages: Message[]): Message[];
|
|
26
|
+
/** Obfuscate provider request context without walking live tool schema instances. */
|
|
27
|
+
export declare function obfuscateProviderContext(obfuscator: SecretObfuscator | undefined, context: Context): Context;
|
|
28
|
+
/** Convert tool schemas to wire JSON Schema before obfuscating provider-visible strings. */
|
|
29
|
+
export declare function obfuscateProviderTools(obfuscator: SecretObfuscator | undefined, tools: Tool[] | undefined): Tool[] | undefined;
|
|
@@ -19,7 +19,7 @@ import type { AssistantMessage, ImageContent, Message, MessageAttribution, Model
|
|
|
19
19
|
import { Effort } from "@oh-my-pi/pi-ai";
|
|
20
20
|
import { type AsyncJob, type AsyncJobDeliveryState, AsyncJobManager } from "../async";
|
|
21
21
|
import type { Rule } from "../capability/rule";
|
|
22
|
-
import {
|
|
22
|
+
import type { ModelRegistry } from "../config/model-registry";
|
|
23
23
|
import { type ResolvedModelRoleValue } from "../config/model-resolver";
|
|
24
24
|
import { type PromptTemplate } from "../config/prompt-templates";
|
|
25
25
|
import type { Settings, SkillsSettings } from "../config/settings";
|
|
@@ -127,6 +127,8 @@ export interface AgentSessionConfig {
|
|
|
127
127
|
agent: Agent;
|
|
128
128
|
sessionManager: SessionManager;
|
|
129
129
|
settings: Settings;
|
|
130
|
+
/** Whether the caller explicitly requested yolo/auto-approve behavior for this session. */
|
|
131
|
+
autoApprove?: boolean;
|
|
130
132
|
/** Models to cycle through with Ctrl+P (from --models flag) */
|
|
131
133
|
scopedModels?: Array<{
|
|
132
134
|
model: Model;
|
|
@@ -548,7 +550,14 @@ export declare class AgentSession {
|
|
|
548
550
|
* @throws Error if streaming and no streamingBehavior specified
|
|
549
551
|
* @throws Error if no model selected or no API key available (when not streaming)
|
|
550
552
|
*/
|
|
551
|
-
|
|
553
|
+
/**
|
|
554
|
+
* Returns `false` when the command was fully handled locally (extension or
|
|
555
|
+
* custom-TS command consumed without calling the LLM). Returns `true` when
|
|
556
|
+
* the prompt was forwarded to the agent — either directly or queued as a
|
|
557
|
+
* steer/follow-up. Callers that render a UI or manage turn lifecycle (e.g.
|
|
558
|
+
* the ACP agent) use this to know whether to expect an `agent_end` event.
|
|
559
|
+
*/
|
|
560
|
+
prompt(text: string, options?: PromptOptions): Promise<boolean>;
|
|
552
561
|
promptCustomMessage<T = unknown>(message: Pick<CustomMessage<T>, "customType" | "content" | "display" | "details" | "attribution">, options?: Pick<PromptOptions, "streamingBehavior" | "toolChoice">): Promise<void>;
|
|
553
562
|
/**
|
|
554
563
|
* Queue a steering message to interrupt the agent mid-run.
|
|
@@ -700,7 +709,8 @@ export declare class AgentSession {
|
|
|
700
709
|
*/
|
|
701
710
|
cycleRoleModels(roleOrder: readonly string[], direction?: "forward" | "backward"): Promise<RoleModelCycleResult | undefined>;
|
|
702
711
|
/**
|
|
703
|
-
* Get all available models with valid API keys.
|
|
712
|
+
* Get all available models with valid API keys, filtered by `enabledModels` when configured.
|
|
713
|
+
* See {@link filterAvailableModelsByEnabledPatterns} for supported pattern forms and limitations.
|
|
704
714
|
*/
|
|
705
715
|
getAvailableModels(): Model[];
|
|
706
716
|
/**
|
|
@@ -849,9 +859,11 @@ export declare class AgentSession {
|
|
|
849
859
|
* @param command The bash command to execute
|
|
850
860
|
* @param onChunk Optional streaming callback for output
|
|
851
861
|
* @param options.excludeFromContext If true, command output won't be sent to LLM (!! prefix)
|
|
862
|
+
* @param options.useUserShell If true, allow caller to request configured user-shell routing
|
|
852
863
|
*/
|
|
853
864
|
executeBash(command: string, onChunk?: (chunk: string) => void, options?: {
|
|
854
865
|
excludeFromContext?: boolean;
|
|
866
|
+
useUserShell?: boolean;
|
|
855
867
|
}): Promise<BashResult>;
|
|
856
868
|
/**
|
|
857
869
|
* Record a bash execution result in session history.
|
|
@@ -9,5 +9,9 @@ export declare function getAuthBrokerTokenFilePath(): string;
|
|
|
9
9
|
* (broker disabled — local store is used). Throws when URL is set but no
|
|
10
10
|
* token is available — the caller cannot fall back silently because the
|
|
11
11
|
* user explicitly asked to use the broker.
|
|
12
|
+
*
|
|
13
|
+
* Successful resolutions (including "no broker configured") are memoized for
|
|
14
|
+
* the process lifetime; failures are not, so a missing token can be fixed and
|
|
15
|
+
* retried. Concurrent callers share one in-flight resolution.
|
|
12
16
|
*/
|
|
13
17
|
export declare function resolveAuthBrokerConfig(): Promise<AuthBrokerClientConfig | null>;
|
|
@@ -249,7 +249,7 @@ declare class RecentSessionInfo {
|
|
|
249
249
|
export declare function recoverOrphanedBackups(sessionDir: string, storage: SessionStorage): Promise<void>;
|
|
250
250
|
/** Exported for testing */
|
|
251
251
|
export declare function findMostRecentSession(sessionDir: string, storage?: SessionStorage): Promise<string | null>;
|
|
252
|
-
/** Get recent sessions for display in welcome screen */
|
|
252
|
+
/** Get recent sessions for display in welcome screen (which reserves WELCOME_SESSION_SLOTS rows) */
|
|
253
253
|
export declare function getRecentSessions(sessionDir: string, limit?: number, storage?: SessionStorage): Promise<RecentSessionInfo[]>;
|
|
254
254
|
/**
|
|
255
255
|
* Manages conversation sessions as append-only trees stored in JSONL files.
|
|
@@ -2,6 +2,15 @@ import type { AgentToolUpdateCallback } from "@oh-my-pi/pi-agent-core";
|
|
|
2
2
|
export declare const DEFAULT_MAX_LINES = 3000;
|
|
3
3
|
export declare const DEFAULT_MAX_BYTES: number;
|
|
4
4
|
export declare const DEFAULT_MAX_COLUMN = 512;
|
|
5
|
+
/**
|
|
6
|
+
* Default artifact-on-disk cap for {@link OutputSink}.
|
|
7
|
+
*
|
|
8
|
+
* `0` means unbounded: by default, `artifact://<id>` references preserve the
|
|
9
|
+
* complete raw stream instead of a capped head/tail sample.
|
|
10
|
+
*/
|
|
11
|
+
export declare const ARTIFACT_DEFAULT_MAX_BYTES = 0;
|
|
12
|
+
/** Default head budget; the remainder becomes the rolling tail window. */
|
|
13
|
+
export declare const ARTIFACT_DEFAULT_HEAD_BYTES: number;
|
|
5
14
|
export interface OutputSummary {
|
|
6
15
|
output: string;
|
|
7
16
|
truncated: boolean;
|
|
@@ -41,6 +50,20 @@ export interface OutputSinkOptions {
|
|
|
41
50
|
onChunk?: (chunk: string) => void;
|
|
42
51
|
/** Minimum ms between onChunk calls. 0 = every chunk (default). */
|
|
43
52
|
chunkThrottleMs?: number;
|
|
53
|
+
/**
|
|
54
|
+
* Optional cap on bytes written to the artifact-on-disk file. When the cap
|
|
55
|
+
* is hit, the head window is preserved verbatim and subsequent output feeds
|
|
56
|
+
* a rolling tail window; on close, the sink writes a single
|
|
57
|
+
* `[ARTIFACT TRUNCATED: …]` notice between them. Default
|
|
58
|
+
* {@link ARTIFACT_DEFAULT_MAX_BYTES} (unbounded).
|
|
59
|
+
*/
|
|
60
|
+
artifactMaxBytes?: number;
|
|
61
|
+
/**
|
|
62
|
+
* Bytes reserved for the head window of the capped artifact file. The
|
|
63
|
+
* tail window receives `artifactMaxBytes - artifactHeadBytes`. Default
|
|
64
|
+
* {@link ARTIFACT_DEFAULT_HEAD_BYTES}; clamped to `[0, artifactMaxBytes]`.
|
|
65
|
+
*/
|
|
66
|
+
artifactHeadBytes?: number;
|
|
44
67
|
}
|
|
45
68
|
export interface TruncationResult {
|
|
46
69
|
content: string;
|
|
@@ -1,6 +1,22 @@
|
|
|
1
1
|
import type { AvailableCommand } from "@agentclientprotocol/sdk";
|
|
2
2
|
import type { AcpBuiltinSlashCommandResult, SlashCommandRuntime } from "./types";
|
|
3
3
|
export type { AcpBuiltinSlashCommandResult } from "./types";
|
|
4
|
+
/**
|
|
5
|
+
* All names (primary + aliases) that are reserved by ACP builtins. Used to
|
|
6
|
+
* filter out extension commands that would shadow a builtin or its alias at
|
|
7
|
+
* dispatch time (e.g. `models` is an alias for `/model`, so an extension
|
|
8
|
+
* registering `models` would appear in the palette but execute the builtin).
|
|
9
|
+
*/
|
|
10
|
+
export declare const ACP_BUILTIN_RESERVED_NAMES: ReadonlySet<string>;
|
|
11
|
+
/**
|
|
12
|
+
* Whether an extension command named `name` would be captured by ACP builtin
|
|
13
|
+
* dispatch before reaching the extension handler. Beyond exact name/alias
|
|
14
|
+
* collisions, `parseSlashCommand` treats `:` as a name/args separator, so a
|
|
15
|
+
* colon-namespaced name whose prefix is a handled builtin (e.g. `model:foo`)
|
|
16
|
+
* executes the `/model` builtin with `foo` as args. Such names must not be
|
|
17
|
+
* advertised to ACP clients.
|
|
18
|
+
*/
|
|
19
|
+
export declare function isAcpBuiltinShadowedName(name: string): boolean;
|
|
4
20
|
/**
|
|
5
21
|
* Commands advertised to ACP clients. Entries without a text-mode `handle`
|
|
6
22
|
* (e.g. `/quit`, `/login`, dashboards) are filtered out so the client doesn't
|