@code-yeongyu/senpi 2026.6.6-3 → 2026.6.10-2
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 +30 -0
- package/README.md +102 -100
- package/dist/cli/args.d.ts.map +1 -1
- package/dist/cli/args.js +1 -2
- package/dist/cli/args.js.map +1 -1
- package/dist/cli/project-trust.d.ts +10 -0
- package/dist/cli/project-trust.d.ts.map +1 -0
- package/dist/cli/project-trust.js +48 -0
- package/dist/cli/project-trust.js.map +1 -0
- package/dist/cli/startup-ui.d.ts +7 -0
- package/dist/cli/startup-ui.d.ts.map +1 -0
- package/dist/cli/startup-ui.js +59 -0
- package/dist/cli/startup-ui.js.map +1 -0
- package/dist/cli.js +10 -1
- package/dist/cli.js.map +1 -1
- package/dist/core/agent-session-runtime.d.ts +3 -1
- package/dist/core/agent-session-runtime.d.ts.map +1 -1
- package/dist/core/agent-session-runtime.js +4 -1
- package/dist/core/agent-session-runtime.js.map +1 -1
- package/dist/core/agent-session-services.d.ts +2 -1
- package/dist/core/agent-session-services.d.ts.map +1 -1
- package/dist/core/agent-session-services.js +2 -2
- package/dist/core/agent-session-services.js.map +1 -1
- package/dist/core/agent-session.d.ts +1 -0
- package/dist/core/agent-session.d.ts.map +1 -1
- package/dist/core/agent-session.js +6 -0
- package/dist/core/agent-session.js.map +1 -1
- package/dist/core/compaction/utils.d.ts +1 -1
- package/dist/core/compaction/utils.d.ts.map +1 -1
- package/dist/core/compaction/utils.js +1 -1
- package/dist/core/compaction/utils.js.map +1 -1
- package/dist/core/extensions/builtin/compaction/degradation-monitor.d.ts +0 -1
- package/dist/core/extensions/builtin/compaction/degradation-monitor.d.ts.map +1 -1
- package/dist/core/extensions/builtin/compaction/degradation-monitor.js +0 -1
- package/dist/core/extensions/builtin/compaction/degradation-monitor.js.map +1 -1
- package/dist/core/extensions/builtin/compaction/index.d.ts.map +1 -1
- package/dist/core/extensions/builtin/compaction/index.js +4 -4
- package/dist/core/extensions/builtin/compaction/index.js.map +1 -1
- package/dist/core/extensions/builtin/compaction/policy.d.ts +0 -5
- package/dist/core/extensions/builtin/compaction/policy.d.ts.map +1 -1
- package/dist/core/extensions/builtin/compaction/policy.js +0 -4
- package/dist/core/extensions/builtin/compaction/policy.js.map +1 -1
- package/dist/core/extensions/builtin/compaction/speculative.d.ts +0 -6
- package/dist/core/extensions/builtin/compaction/speculative.d.ts.map +1 -1
- package/dist/core/extensions/builtin/compaction/speculative.js +0 -3
- package/dist/core/extensions/builtin/compaction/speculative.js.map +1 -1
- package/dist/core/extensions/builtin/gpt-apply-patch/extension.d.ts +1 -1
- package/dist/core/extensions/builtin/gpt-apply-patch/extension.d.ts.map +1 -1
- package/dist/core/extensions/builtin/gpt-apply-patch/extension.js +10 -2
- package/dist/core/extensions/builtin/gpt-apply-patch/extension.js.map +1 -1
- package/dist/core/extensions/builtin/permission-system/cli.d.ts +0 -3
- package/dist/core/extensions/builtin/permission-system/cli.d.ts.map +1 -1
- package/dist/core/extensions/builtin/permission-system/cli.js +0 -13
- package/dist/core/extensions/builtin/permission-system/cli.js.map +1 -1
- package/dist/core/extensions/builtin/todotools/index.d.ts.map +1 -1
- package/dist/core/extensions/builtin/todotools/index.js +0 -2
- package/dist/core/extensions/builtin/todotools/index.js.map +1 -1
- package/dist/core/extensions/builtin/todotools/prompt.d.ts +1 -1
- package/dist/core/extensions/builtin/todotools/prompt.d.ts.map +1 -1
- package/dist/core/extensions/builtin/todotools/prompt.js +0 -2
- package/dist/core/extensions/builtin/todotools/prompt.js.map +1 -1
- package/dist/core/extensions/index.d.ts +1 -1
- package/dist/core/extensions/index.d.ts.map +1 -1
- package/dist/core/extensions/index.js.map +1 -1
- package/dist/core/extensions/loader.d.ts +1 -1
- package/dist/core/extensions/loader.d.ts.map +1 -1
- package/dist/core/extensions/loader.js +4 -4
- package/dist/core/extensions/loader.js.map +1 -1
- package/dist/core/extensions/runner.d.ts +7 -2
- package/dist/core/extensions/runner.d.ts.map +1 -1
- package/dist/core/extensions/runner.js +34 -0
- package/dist/core/extensions/runner.js.map +1 -1
- package/dist/core/extensions/types.d.ts +21 -1
- package/dist/core/extensions/types.d.ts.map +1 -1
- package/dist/core/extensions/types.js.map +1 -1
- package/dist/core/model-registry.d.ts +3 -4
- package/dist/core/model-registry.d.ts.map +1 -1
- package/dist/core/model-registry.js +23 -6
- package/dist/core/model-registry.js.map +1 -1
- package/dist/core/project-trust.d.ts +15 -0
- package/dist/core/project-trust.d.ts.map +1 -0
- package/dist/core/project-trust.js +58 -0
- package/dist/core/project-trust.js.map +1 -0
- package/dist/core/prompt-templates.d.ts +2 -1
- package/dist/core/prompt-templates.d.ts.map +1 -1
- package/dist/core/prompt-templates.js +24 -26
- package/dist/core/prompt-templates.js.map +1 -1
- package/dist/core/resolve-config-value.d.ts +0 -4
- package/dist/core/resolve-config-value.d.ts.map +1 -1
- package/dist/core/resolve-config-value.js +0 -15
- package/dist/core/resolve-config-value.js.map +1 -1
- package/dist/core/resource-loader.d.ts +14 -3
- package/dist/core/resource-loader.d.ts.map +1 -1
- package/dist/core/resource-loader.js +128 -58
- package/dist/core/resource-loader.js.map +1 -1
- package/dist/core/session-manager.d.ts +3 -0
- package/dist/core/session-manager.d.ts.map +1 -1
- package/dist/core/session-manager.js +34 -17
- package/dist/core/session-manager.js.map +1 -1
- package/dist/core/session-resident-store.d.ts +16 -0
- package/dist/core/session-resident-store.d.ts.map +1 -0
- package/dist/core/session-resident-store.js +48 -0
- package/dist/core/session-resident-store.js.map +1 -0
- package/dist/core/settings-manager.d.ts +4 -0
- package/dist/core/settings-manager.d.ts.map +1 -1
- package/dist/core/settings-manager.js +9 -0
- package/dist/core/settings-manager.js.map +1 -1
- package/dist/core/tools/edit-diff.d.ts +0 -5
- package/dist/core/tools/edit-diff.d.ts.map +1 -1
- package/dist/core/tools/edit-diff.js +0 -7
- package/dist/core/tools/edit-diff.js.map +1 -1
- package/dist/core/tools/index.d.ts +0 -5
- package/dist/core/tools/index.d.ts.map +1 -1
- package/dist/core/tools/index.js +0 -67
- package/dist/core/tools/index.js.map +1 -1
- package/dist/core/trust-manager.d.ts +22 -0
- package/dist/core/trust-manager.d.ts.map +1 -1
- package/dist/core/trust-manager.js +75 -22
- package/dist/core/trust-manager.js.map +1 -1
- package/dist/index.d.ts +5 -5
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +2 -2
- package/dist/index.js.map +1 -1
- package/dist/main.d.ts.map +1 -1
- package/dist/main.js +92 -129
- package/dist/main.js.map +1 -1
- package/dist/migrations.d.ts.map +1 -1
- package/dist/migrations.js +39 -34
- package/dist/migrations.js.map +1 -1
- package/dist/modes/index.d.ts +1 -1
- package/dist/modes/index.d.ts.map +1 -1
- package/dist/modes/index.js.map +1 -1
- package/dist/modes/interactive/components/login-dialog.d.ts +1 -0
- package/dist/modes/interactive/components/login-dialog.d.ts.map +1 -1
- package/dist/modes/interactive/components/login-dialog.js +7 -1
- package/dist/modes/interactive/components/login-dialog.js.map +1 -1
- package/dist/modes/interactive/components/settings-selector.d.ts +3 -1
- package/dist/modes/interactive/components/settings-selector.d.ts.map +1 -1
- package/dist/modes/interactive/components/settings-selector.js +20 -0
- package/dist/modes/interactive/components/settings-selector.js.map +1 -1
- package/dist/modes/interactive/components/tool-execution.d.ts.map +1 -1
- package/dist/modes/interactive/components/tool-execution.js +26 -4
- package/dist/modes/interactive/components/tool-execution.js.map +1 -1
- package/dist/modes/interactive/components/trust-selector.d.ts +6 -3
- package/dist/modes/interactive/components/trust-selector.d.ts.map +1 -1
- package/dist/modes/interactive/components/trust-selector.js +22 -18
- package/dist/modes/interactive/components/trust-selector.js.map +1 -1
- package/dist/modes/interactive/interactive-mode.d.ts +15 -0
- package/dist/modes/interactive/interactive-mode.d.ts.map +1 -1
- package/dist/modes/interactive/interactive-mode.js +158 -19
- package/dist/modes/interactive/interactive-mode.js.map +1 -1
- package/dist/modes/interactive/theme/theme.d.ts +0 -4
- package/dist/modes/interactive/theme/theme.d.ts.map +1 -1
- package/dist/modes/interactive/theme/theme.js +0 -7
- package/dist/modes/interactive/theme/theme.js.map +1 -1
- package/dist/modes/interactive/working-status.d.ts +2 -0
- package/dist/modes/interactive/working-status.d.ts.map +1 -1
- package/dist/modes/interactive/working-status.js +34 -0
- package/dist/modes/interactive/working-status.js.map +1 -1
- package/dist/modes/rpc/rpc-types.d.ts +0 -1
- package/dist/modes/rpc/rpc-types.d.ts.map +1 -1
- package/dist/modes/rpc/rpc-types.js.map +1 -1
- package/dist/package-manager-cli.d.ts +6 -2
- package/dist/package-manager-cli.d.ts.map +1 -1
- package/dist/package-manager-cli.js +58 -11
- package/dist/package-manager-cli.js.map +1 -1
- package/dist/senpi +10 -1
- package/dist/utils/changelog.d.ts +1 -0
- package/dist/utils/changelog.d.ts.map +1 -1
- package/dist/utils/changelog.js +78 -0
- package/dist/utils/changelog.js.map +1 -1
- package/docs/compaction-guide.md +9 -9
- package/docs/compaction.md +2 -2
- package/docs/containerization.md +22 -22
- package/docs/custom-provider.md +13 -13
- package/docs/development.md +4 -2
- package/docs/docs.json +4 -0
- package/docs/extensions.md +46 -18
- package/docs/index.md +5 -4
- package/docs/json.md +21 -15
- package/docs/keybindings.md +6 -3
- package/docs/models.md +10 -43
- package/docs/packages.md +11 -13
- package/docs/prompt-templates.md +10 -3
- package/docs/providers.md +9 -9
- package/docs/rpc.md +14 -13
- package/docs/sdk.md +18 -9
- package/docs/security.md +55 -0
- package/docs/session-format.md +4 -4
- package/docs/sessions.md +14 -14
- package/docs/settings.md +14 -11
- package/docs/skills.md +8 -8
- package/docs/terminal-setup.md +38 -4
- package/docs/termux.md +3 -3
- package/docs/tmux.md +4 -2
- package/docs/tui.md +4 -4
- package/docs/usage.md +55 -57
- package/examples/extensions/README.md +1 -0
- package/examples/extensions/custom-provider-anthropic/package-lock.json +2 -2
- package/examples/extensions/custom-provider-anthropic/package.json +1 -1
- package/examples/extensions/custom-provider-gitlab-duo/package.json +1 -1
- package/examples/extensions/gondolin/package-lock.json +2 -2
- package/examples/extensions/gondolin/package.json +1 -1
- package/examples/extensions/project-trust.ts +64 -0
- package/examples/extensions/sandbox/package-lock.json +2 -2
- package/examples/extensions/sandbox/package.json +1 -1
- package/examples/extensions/with-deps/package-lock.json +2 -2
- package/examples/extensions/with-deps/package.json +1 -1
- package/node_modules/@earendil-works/pi-agent-core/README.md +4 -3
- package/node_modules/@earendil-works/pi-agent-core/dist/agent-loop.js +125 -77
- package/node_modules/@earendil-works/pi-agent-core/dist/agent-loop.js.map +1 -1
- package/node_modules/@earendil-works/pi-agent-core/dist/harness/compaction/compaction.d.ts +1 -1
- package/node_modules/@earendil-works/pi-agent-core/dist/harness/compaction/compaction.d.ts.map +1 -1
- package/node_modules/@earendil-works/pi-agent-core/dist/harness/compaction/compaction.js +1 -1
- package/node_modules/@earendil-works/pi-agent-core/dist/harness/compaction/compaction.js.map +1 -1
- package/node_modules/@earendil-works/pi-agent-core/dist/harness/types.d.ts +0 -2
- package/node_modules/@earendil-works/pi-agent-core/dist/harness/types.d.ts.map +1 -1
- package/node_modules/@earendil-works/pi-agent-core/dist/harness/types.js +0 -4
- package/node_modules/@earendil-works/pi-agent-core/dist/harness/types.js.map +1 -1
- package/node_modules/@earendil-works/pi-agent-core/dist/types.d.ts +7 -4
- package/node_modules/@earendil-works/pi-agent-core/dist/types.d.ts.map +1 -1
- package/node_modules/@earendil-works/pi-agent-core/dist/types.js.map +1 -1
- package/node_modules/@earendil-works/pi-agent-core/package.json +2 -2
- package/node_modules/@earendil-works/pi-ai/README.md +4 -5
- package/node_modules/@earendil-works/pi-ai/dist/api-registry.d.ts +0 -1
- package/node_modules/@earendil-works/pi-ai/dist/api-registry.d.ts.map +1 -1
- package/node_modules/@earendil-works/pi-ai/dist/api-registry.js +0 -3
- package/node_modules/@earendil-works/pi-ai/dist/api-registry.js.map +1 -1
- package/node_modules/@earendil-works/pi-ai/dist/image-models.generated.d.ts +2 -2
- package/node_modules/@earendil-works/pi-ai/dist/image-models.generated.js +6 -6
- package/node_modules/@earendil-works/pi-ai/dist/image-models.generated.js.map +1 -1
- package/node_modules/@earendil-works/pi-ai/dist/models.generated.d.ts +355 -313
- package/node_modules/@earendil-works/pi-ai/dist/models.generated.d.ts.map +1 -1
- package/node_modules/@earendil-works/pi-ai/dist/models.generated.js +376 -431
- package/node_modules/@earendil-works/pi-ai/dist/models.generated.js.map +1 -1
- package/node_modules/@earendil-works/pi-ai/dist/providers/amazon-bedrock.d.ts.map +1 -1
- package/node_modules/@earendil-works/pi-ai/dist/providers/amazon-bedrock.js +15 -7
- package/node_modules/@earendil-works/pi-ai/dist/providers/amazon-bedrock.js.map +1 -1
- package/node_modules/@earendil-works/pi-ai/dist/providers/anthropic.d.ts +1 -1
- package/node_modules/@earendil-works/pi-ai/dist/providers/anthropic.d.ts.map +1 -1
- package/node_modules/@earendil-works/pi-ai/dist/providers/anthropic.js +17 -7
- package/node_modules/@earendil-works/pi-ai/dist/providers/anthropic.js.map +1 -1
- package/node_modules/@earendil-works/pi-ai/dist/providers/azure-openai-responses.js +1 -0
- package/node_modules/@earendil-works/pi-ai/dist/providers/azure-openai-responses.js.map +1 -1
- package/node_modules/@earendil-works/pi-ai/dist/providers/google-shared.d.ts +0 -4
- package/node_modules/@earendil-works/pi-ai/dist/providers/google-shared.d.ts.map +1 -1
- package/node_modules/@earendil-works/pi-ai/dist/providers/google-shared.js +0 -13
- package/node_modules/@earendil-works/pi-ai/dist/providers/google-shared.js.map +1 -1
- package/node_modules/@earendil-works/pi-ai/dist/providers/openai-completions.d.ts.map +1 -1
- package/node_modules/@earendil-works/pi-ai/dist/providers/openai-completions.js +4 -3
- package/node_modules/@earendil-works/pi-ai/dist/providers/openai-completions.js.map +1 -1
- package/node_modules/@earendil-works/pi-ai/dist/providers/openai-responses-shared.d.ts.map +1 -1
- package/node_modules/@earendil-works/pi-ai/dist/providers/openai-responses-shared.js +2 -1
- package/node_modules/@earendil-works/pi-ai/dist/providers/openai-responses-shared.js.map +1 -1
- package/node_modules/@earendil-works/pi-ai/dist/providers/openai-responses.d.ts.map +1 -1
- package/node_modules/@earendil-works/pi-ai/dist/providers/openai-responses.js +3 -2
- package/node_modules/@earendil-works/pi-ai/dist/providers/openai-responses.js.map +1 -1
- package/node_modules/@earendil-works/pi-ai/dist/providers/simple-options.d.ts +1 -7
- package/node_modules/@earendil-works/pi-ai/dist/providers/simple-options.d.ts.map +1 -1
- package/node_modules/@earendil-works/pi-ai/dist/providers/simple-options.js +2 -16
- package/node_modules/@earendil-works/pi-ai/dist/providers/simple-options.js.map +1 -1
- package/node_modules/@earendil-works/pi-ai/dist/types.d.ts +5 -1
- package/node_modules/@earendil-works/pi-ai/dist/types.d.ts.map +1 -1
- package/node_modules/@earendil-works/pi-ai/dist/types.js.map +1 -1
- package/node_modules/@earendil-works/pi-ai/dist/utils/overflow.d.ts +0 -4
- package/node_modules/@earendil-works/pi-ai/dist/utils/overflow.d.ts.map +1 -1
- package/node_modules/@earendil-works/pi-ai/dist/utils/overflow.js +0 -6
- package/node_modules/@earendil-works/pi-ai/dist/utils/overflow.js.map +1 -1
- package/node_modules/@earendil-works/pi-ai/package.json +1 -1
- package/node_modules/@earendil-works/pi-tui/README.md +1 -2
- package/node_modules/@earendil-works/pi-tui/dist/autocomplete.d.ts +2 -0
- package/node_modules/@earendil-works/pi-tui/dist/autocomplete.d.ts.map +1 -1
- package/node_modules/@earendil-works/pi-tui/dist/autocomplete.js.map +1 -1
- package/node_modules/@earendil-works/pi-tui/dist/components/editor.d.ts +6 -1
- package/node_modules/@earendil-works/pi-tui/dist/components/editor.d.ts.map +1 -1
- package/node_modules/@earendil-works/pi-tui/dist/components/editor.js +89 -39
- package/node_modules/@earendil-works/pi-tui/dist/components/editor.js.map +1 -1
- package/node_modules/@earendil-works/pi-tui/dist/components/loader.d.ts +5 -0
- package/node_modules/@earendil-works/pi-tui/dist/components/loader.d.ts.map +1 -1
- package/node_modules/@earendil-works/pi-tui/dist/components/loader.js +18 -4
- package/node_modules/@earendil-works/pi-tui/dist/components/loader.js.map +1 -1
- package/node_modules/@earendil-works/pi-tui/dist/fuzzy.d.ts.map +1 -1
- package/node_modules/@earendil-works/pi-tui/dist/fuzzy.js +131 -61
- package/node_modules/@earendil-works/pi-tui/dist/fuzzy.js.map +1 -1
- package/node_modules/@earendil-works/pi-tui/dist/index.d.ts +1 -1
- package/node_modules/@earendil-works/pi-tui/dist/index.d.ts.map +1 -1
- package/node_modules/@earendil-works/pi-tui/dist/index.js +1 -1
- package/node_modules/@earendil-works/pi-tui/dist/index.js.map +1 -1
- package/node_modules/@earendil-works/pi-tui/dist/terminal-image.d.ts +0 -1
- package/node_modules/@earendil-works/pi-tui/dist/terminal-image.d.ts.map +1 -1
- package/node_modules/@earendil-works/pi-tui/dist/terminal-image.js +4 -7
- package/node_modules/@earendil-works/pi-tui/dist/terminal-image.js.map +1 -1
- package/node_modules/@earendil-works/pi-tui/dist/terminal.d.ts +4 -7
- package/node_modules/@earendil-works/pi-tui/dist/terminal.d.ts.map +1 -1
- package/node_modules/@earendil-works/pi-tui/dist/terminal.js +38 -76
- package/node_modules/@earendil-works/pi-tui/dist/terminal.js.map +1 -1
- package/node_modules/@earendil-works/pi-tui/dist/tui.d.ts.map +1 -1
- package/node_modules/@earendil-works/pi-tui/dist/tui.js +14 -4
- package/node_modules/@earendil-works/pi-tui/dist/tui.js.map +1 -1
- package/node_modules/@earendil-works/pi-tui/dist/utils.d.ts +0 -4
- package/node_modules/@earendil-works/pi-tui/dist/utils.d.ts.map +1 -1
- package/node_modules/@earendil-works/pi-tui/dist/utils.js +43 -21
- package/node_modules/@earendil-works/pi-tui/dist/utils.js.map +1 -1
- package/node_modules/@earendil-works/pi-tui/package.json +1 -1
- package/npm-shrinkwrap.json +12 -12
- package/package.json +4 -8
- package/dist/core/extensions/builtin/compaction/overflow-detection.d.ts +0 -11
- package/dist/core/extensions/builtin/compaction/overflow-detection.d.ts.map +0 -1
- package/dist/core/extensions/builtin/compaction/overflow-detection.js +0 -40
- package/dist/core/extensions/builtin/compaction/overflow-detection.js.map +0 -1
- package/dist/core/extensions/builtin/system-messages.d.ts +0 -47
- package/dist/core/extensions/builtin/system-messages.d.ts.map +0 -1
- package/dist/core/extensions/builtin/system-messages.js +0 -117
- package/dist/core/extensions/builtin/system-messages.js.map +0 -1
- package/dist/core/extensions/builtin/todotools/continuation/config.d.ts +0 -10
- package/dist/core/extensions/builtin/todotools/continuation/config.d.ts.map +0 -1
- package/dist/core/extensions/builtin/todotools/continuation/config.js +0 -33
- package/dist/core/extensions/builtin/todotools/continuation/config.js.map +0 -1
- package/dist/core/extensions/builtin/todotools/continuation/index.d.ts +0 -2
- package/dist/core/extensions/builtin/todotools/continuation/index.d.ts.map +0 -1
- package/dist/core/extensions/builtin/todotools/continuation/index.js +0 -2
- package/dist/core/extensions/builtin/todotools/continuation/index.js.map +0 -1
- package/dist/core/extensions/builtin/todotools/continuation/prompt.d.ts +0 -5
- package/dist/core/extensions/builtin/todotools/continuation/prompt.d.ts.map +0 -1
- package/dist/core/extensions/builtin/todotools/continuation/prompt.js +0 -34
- package/dist/core/extensions/builtin/todotools/continuation/prompt.js.map +0 -1
- package/dist/core/extensions/builtin/todotools/continuation/runtime.d.ts +0 -11
- package/dist/core/extensions/builtin/todotools/continuation/runtime.d.ts.map +0 -1
- package/dist/core/extensions/builtin/todotools/continuation/runtime.js +0 -201
- package/dist/core/extensions/builtin/todotools/continuation/runtime.js.map +0 -1
- package/dist/core/extensions/builtin/todotools/settings.d.ts +0 -6
- package/dist/core/extensions/builtin/todotools/settings.d.ts.map +0 -1
- package/dist/core/extensions/builtin/todotools/settings.js +0 -58
- package/dist/core/extensions/builtin/todotools/settings.js.map +0 -1
- package/dist/core/extensions/builtin/todotools/system-messages.d.ts +0 -34
- package/dist/core/extensions/builtin/todotools/system-messages.d.ts.map +0 -1
- package/dist/core/extensions/builtin/todotools/system-messages.js +0 -82
- package/dist/core/extensions/builtin/todotools/system-messages.js.map +0 -1
- package/dist/core/index.d.ts +0 -12
- package/dist/core/index.d.ts.map +0 -1
- package/dist/core/index.js +0 -12
- package/dist/core/index.js.map +0 -1
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "pi-extension-gondolin",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.79.1",
|
|
4
4
|
"lockfileVersion": 3,
|
|
5
5
|
"requires": true,
|
|
6
6
|
"packages": {
|
|
7
7
|
"": {
|
|
8
8
|
"name": "pi-extension-gondolin",
|
|
9
|
-
"version": "0.
|
|
9
|
+
"version": "0.79.1",
|
|
10
10
|
"dependencies": {
|
|
11
11
|
"@earendil-works/gondolin": "0.12.0"
|
|
12
12
|
}
|
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Project Trust Extension
|
|
3
|
+
*
|
|
4
|
+
* Demonstrates the project_trust event. Install globally or pass via -e:
|
|
5
|
+
*
|
|
6
|
+
* mkdir -p ~/.pi/agent/extensions
|
|
7
|
+
* cp packages/coding-agent/examples/extensions/project-trust.ts ~/.pi/agent/extensions/
|
|
8
|
+
*
|
|
9
|
+
* Or:
|
|
10
|
+
*
|
|
11
|
+
* pi -e packages/coding-agent/examples/extensions/project-trust.ts
|
|
12
|
+
*
|
|
13
|
+
* Try it in a project containing .pi, AGENTS.md/CLAUDE.md, or .agents/skills.
|
|
14
|
+
*/
|
|
15
|
+
|
|
16
|
+
import type { ExtensionAPI, ProjectTrustEventResult } from "@earendil-works/pi-coding-agent";
|
|
17
|
+
|
|
18
|
+
export default function (pi: ExtensionAPI) {
|
|
19
|
+
let loadCount = 0;
|
|
20
|
+
loadCount++;
|
|
21
|
+
|
|
22
|
+
// Multiple handlers in one extension are allowed. The first handler that returns
|
|
23
|
+
// { trusted: "yes" } or { trusted: "no" } wins and suppresses the built-in
|
|
24
|
+
// trust prompt. Return { trusted: "undecided" } to let another handler or the
|
|
25
|
+
// built-in flow decide.
|
|
26
|
+
pi.on("project_trust", async (event, ctx): Promise<ProjectTrustEventResult> => {
|
|
27
|
+
ctx.ui.notify(`project_trust fired for ${event.cwd} (mode: ${ctx.mode}, load: ${loadCount})`, "info");
|
|
28
|
+
|
|
29
|
+
if (!ctx.hasUI) {
|
|
30
|
+
return { trusted: "undecided" };
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
const choice = await ctx.ui.select(`Project trust for:\n${event.cwd}`, [
|
|
34
|
+
"Trust and remember",
|
|
35
|
+
"Trust with note and remember",
|
|
36
|
+
"Trust this session",
|
|
37
|
+
"Do not trust this session",
|
|
38
|
+
"Let built-in prompt decide",
|
|
39
|
+
]);
|
|
40
|
+
|
|
41
|
+
if (choice === "Trust with note and remember") {
|
|
42
|
+
const note = await ctx.ui.input("Project trust note", "Optional note for this demo");
|
|
43
|
+
ctx.ui.notify(note ? `Recorded demo note: ${note}` : "No demo note entered", "info");
|
|
44
|
+
return { trusted: "yes", remember: true };
|
|
45
|
+
}
|
|
46
|
+
if (choice === "Trust and remember") {
|
|
47
|
+
return { trusted: "yes", remember: true };
|
|
48
|
+
}
|
|
49
|
+
if (choice === "Trust this session") {
|
|
50
|
+
return { trusted: "yes" };
|
|
51
|
+
}
|
|
52
|
+
if (choice === "Do not trust this session") {
|
|
53
|
+
return { trusted: "no" };
|
|
54
|
+
}
|
|
55
|
+
if (choice === "Let built-in prompt decide") {
|
|
56
|
+
return { trusted: "undecided" };
|
|
57
|
+
}
|
|
58
|
+
return { trusted: "undecided" };
|
|
59
|
+
});
|
|
60
|
+
|
|
61
|
+
pi.on("session_start", (_event, ctx) => {
|
|
62
|
+
ctx.ui.notify(`project-trust example loaded after trust resolution in ${ctx.cwd}`, "info");
|
|
63
|
+
});
|
|
64
|
+
}
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "pi-extension-sandbox",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.9.1",
|
|
4
4
|
"lockfileVersion": 3,
|
|
5
5
|
"requires": true,
|
|
6
6
|
"packages": {
|
|
7
7
|
"": {
|
|
8
8
|
"name": "pi-extension-sandbox",
|
|
9
|
-
"version": "1.
|
|
9
|
+
"version": "1.9.1",
|
|
10
10
|
"dependencies": {
|
|
11
11
|
"@anthropic-ai/sandbox-runtime": "^0.0.26"
|
|
12
12
|
}
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "pi-extension-with-deps",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.79.1",
|
|
4
4
|
"lockfileVersion": 3,
|
|
5
5
|
"requires": true,
|
|
6
6
|
"packages": {
|
|
7
7
|
"": {
|
|
8
8
|
"name": "pi-extension-with-deps",
|
|
9
|
-
"version": "0.
|
|
9
|
+
"version": "0.79.1",
|
|
10
10
|
"dependencies": {
|
|
11
11
|
"ms": "^2.1.3"
|
|
12
12
|
},
|
|
@@ -106,7 +106,7 @@ Tool execution mode is configurable:
|
|
|
106
106
|
|
|
107
107
|
In parallel mode, tool completion events follow tool completion order, but persisted toolResult messages still follow assistant source order.
|
|
108
108
|
|
|
109
|
-
The mode can be set globally via `toolExecution` in the agent config, or per-tool via `executionMode` on `AgentTool`.
|
|
109
|
+
The mode can be set globally via `toolExecution` in the agent config, or per-tool via `executionMode` on `AgentTool`. In parallel mode, a tool call targeting a tool with `executionMode: "sequential"` runs as an exclusive barrier: it waits for all previously scheduled calls in the batch to finish, and later calls wait for it to complete. Parallel tools before or after the barrier still execute concurrently with each other.
|
|
110
110
|
|
|
111
111
|
The `beforeToolCall` hook runs after `tool_execution_start` and validated argument parsing. It can block execution. The `afterToolCall` hook runs after tool execution finishes and before `tool_execution_end` and final tool result message events are emitted.
|
|
112
112
|
|
|
@@ -164,7 +164,7 @@ const agent = new Agent({
|
|
|
164
164
|
initialState: {
|
|
165
165
|
systemPrompt: string,
|
|
166
166
|
model: Model<any>,
|
|
167
|
-
thinkingLevel: "off" | "minimal" | "low" | "medium" | "high" | "xhigh",
|
|
167
|
+
thinkingLevel: "off" | "minimal" | "low" | "medium" | "high" | "xhigh" | "max", // "max" is Anthropic-only adaptive thinking effort
|
|
168
168
|
tools: AgentTool<any>[],
|
|
169
169
|
messages: AgentMessage[],
|
|
170
170
|
},
|
|
@@ -391,7 +391,8 @@ const readFileTool: AgentTool = {
|
|
|
391
391
|
path: Type.String({ description: "File path" }),
|
|
392
392
|
}),
|
|
393
393
|
// Override execution mode for this tool (optional).
|
|
394
|
-
// "sequential"
|
|
394
|
+
// "sequential" makes this tool an exclusive barrier in parallel batches:
|
|
395
|
+
// it runs alone, but parallel tools before or after it still run concurrently.
|
|
395
396
|
// "parallel" allows concurrent execution with other tool calls.
|
|
396
397
|
// If omitted, the global toolExecution config applies.
|
|
397
398
|
executionMode: "sequential",
|
|
@@ -213,54 +213,60 @@ async function streamAssistantResponse(context, config, signal, emit, streamFn)
|
|
|
213
213
|
signal,
|
|
214
214
|
});
|
|
215
215
|
const iterator = response[Symbol.asyncIterator]();
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
switch (event.type) {
|
|
222
|
-
case "start":
|
|
223
|
-
partialMessage = event.partial;
|
|
224
|
-
context.messages.push(partialMessage);
|
|
225
|
-
addedPartial = true;
|
|
226
|
-
await emit({ type: "message_start", message: { ...partialMessage } });
|
|
216
|
+
const eventReader = createAssistantEventReader(iterator, config.timeoutMs, signal);
|
|
217
|
+
try {
|
|
218
|
+
while (true) {
|
|
219
|
+
const next = await eventReader.next();
|
|
220
|
+
if (next.done)
|
|
227
221
|
break;
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
case "thinking_start":
|
|
232
|
-
case "thinking_delta":
|
|
233
|
-
case "thinking_end":
|
|
234
|
-
case "toolcall_start":
|
|
235
|
-
case "toolcall_delta":
|
|
236
|
-
case "toolcall_end":
|
|
237
|
-
if (partialMessage) {
|
|
222
|
+
const event = next.value;
|
|
223
|
+
switch (event.type) {
|
|
224
|
+
case "start":
|
|
238
225
|
partialMessage = event.partial;
|
|
239
|
-
context.messages
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
226
|
+
context.messages.push(partialMessage);
|
|
227
|
+
addedPartial = true;
|
|
228
|
+
await emit({ type: "message_start", message: { ...partialMessage } });
|
|
229
|
+
break;
|
|
230
|
+
case "text_start":
|
|
231
|
+
case "text_delta":
|
|
232
|
+
case "text_end":
|
|
233
|
+
case "thinking_start":
|
|
234
|
+
case "thinking_delta":
|
|
235
|
+
case "thinking_end":
|
|
236
|
+
case "toolcall_start":
|
|
237
|
+
case "toolcall_delta":
|
|
238
|
+
case "toolcall_end":
|
|
239
|
+
if (partialMessage) {
|
|
240
|
+
partialMessage = event.partial;
|
|
241
|
+
context.messages[context.messages.length - 1] = partialMessage;
|
|
242
|
+
await emit({
|
|
243
|
+
type: "message_update",
|
|
244
|
+
assistantMessageEvent: event,
|
|
245
|
+
message: { ...partialMessage },
|
|
246
|
+
});
|
|
247
|
+
}
|
|
248
|
+
break;
|
|
249
|
+
case "done":
|
|
250
|
+
case "error": {
|
|
251
|
+
const finalMessage = normalizeTerminalAssistantMessage(await response.result(), event);
|
|
252
|
+
if (addedPartial) {
|
|
253
|
+
context.messages[context.messages.length - 1] = finalMessage;
|
|
254
|
+
}
|
|
255
|
+
else {
|
|
256
|
+
context.messages.push(finalMessage);
|
|
257
|
+
}
|
|
258
|
+
if (!addedPartial) {
|
|
259
|
+
await emit({ type: "message_start", message: { ...finalMessage } });
|
|
260
|
+
}
|
|
261
|
+
await emit({ type: "message_end", message: finalMessage });
|
|
262
|
+
return finalMessage;
|
|
252
263
|
}
|
|
253
|
-
else {
|
|
254
|
-
context.messages.push(finalMessage);
|
|
255
|
-
}
|
|
256
|
-
if (!addedPartial) {
|
|
257
|
-
await emit({ type: "message_start", message: { ...finalMessage } });
|
|
258
|
-
}
|
|
259
|
-
await emit({ type: "message_end", message: finalMessage });
|
|
260
|
-
return finalMessage;
|
|
261
264
|
}
|
|
262
265
|
}
|
|
263
266
|
}
|
|
267
|
+
finally {
|
|
268
|
+
eventReader.dispose();
|
|
269
|
+
}
|
|
264
270
|
const finalMessage = await response.result();
|
|
265
271
|
if (addedPartial) {
|
|
266
272
|
context.messages[context.messages.length - 1] = finalMessage;
|
|
@@ -285,16 +291,39 @@ async function streamAssistantResponse(context, config, signal, emit, streamFn)
|
|
|
285
291
|
return finalMessage;
|
|
286
292
|
}
|
|
287
293
|
}
|
|
288
|
-
|
|
294
|
+
const ABORTED = Symbol("aborted");
|
|
295
|
+
function createAssistantEventReader(iterator, timeoutMs, signal) {
|
|
289
296
|
const idleTimeoutMs = typeof timeoutMs === "number" && Number.isFinite(timeoutMs) && timeoutMs > 0 ? timeoutMs : undefined;
|
|
290
|
-
|
|
291
|
-
|
|
297
|
+
let removeAbortListener;
|
|
298
|
+
let abortPromise;
|
|
299
|
+
if (signal !== undefined) {
|
|
300
|
+
if (signal.aborted) {
|
|
301
|
+
abortPromise = Promise.resolve(ABORTED);
|
|
302
|
+
}
|
|
303
|
+
else {
|
|
304
|
+
abortPromise = new Promise((resolve) => {
|
|
305
|
+
const abortHandler = () => resolve(ABORTED);
|
|
306
|
+
signal.addEventListener("abort", abortHandler, { once: true });
|
|
307
|
+
removeAbortListener = () => signal.removeEventListener("abort", abortHandler);
|
|
308
|
+
});
|
|
309
|
+
}
|
|
292
310
|
}
|
|
293
|
-
|
|
294
|
-
|
|
311
|
+
return {
|
|
312
|
+
next: () => {
|
|
313
|
+
if (signal?.aborted) {
|
|
314
|
+
void iterator.return?.();
|
|
315
|
+
return Promise.reject(new Error("Request was aborted"));
|
|
316
|
+
}
|
|
317
|
+
return readNextAssistantEvent(iterator, idleTimeoutMs, abortPromise);
|
|
318
|
+
},
|
|
319
|
+
dispose: () => removeAbortListener?.(),
|
|
320
|
+
};
|
|
321
|
+
}
|
|
322
|
+
async function readNextAssistantEvent(iterator, idleTimeoutMs, abortPromise) {
|
|
323
|
+
if (idleTimeoutMs === undefined && abortPromise === undefined) {
|
|
324
|
+
return iterator.next();
|
|
295
325
|
}
|
|
296
326
|
let timeout;
|
|
297
|
-
let abortHandler;
|
|
298
327
|
let settled = false;
|
|
299
328
|
return new Promise((resolve, reject) => {
|
|
300
329
|
const settle = (complete) => {
|
|
@@ -304,9 +333,6 @@ async function readNextAssistantEvent(iterator, timeoutMs, signal) {
|
|
|
304
333
|
if (timeout !== undefined) {
|
|
305
334
|
clearTimeout(timeout);
|
|
306
335
|
}
|
|
307
|
-
if (abortHandler !== undefined) {
|
|
308
|
-
signal?.removeEventListener("abort", abortHandler);
|
|
309
|
-
}
|
|
310
336
|
complete();
|
|
311
337
|
};
|
|
312
338
|
if (idleTimeoutMs !== undefined) {
|
|
@@ -315,14 +341,15 @@ async function readNextAssistantEvent(iterator, timeoutMs, signal) {
|
|
|
315
341
|
settle(() => reject(new StreamIdleTimeoutError(idleTimeoutMs)));
|
|
316
342
|
}, idleTimeoutMs);
|
|
317
343
|
}
|
|
318
|
-
|
|
319
|
-
|
|
344
|
+
const next = abortPromise ? Promise.race([iterator.next(), abortPromise]) : iterator.next();
|
|
345
|
+
void next.then((result) => {
|
|
346
|
+
if (result === ABORTED) {
|
|
320
347
|
void iterator.return?.();
|
|
321
348
|
settle(() => reject(new Error("Request was aborted")));
|
|
322
|
-
|
|
323
|
-
|
|
324
|
-
|
|
325
|
-
|
|
349
|
+
return;
|
|
350
|
+
}
|
|
351
|
+
settle(() => resolve(result));
|
|
352
|
+
}, (error) => settle(() => reject(error)));
|
|
326
353
|
});
|
|
327
354
|
}
|
|
328
355
|
/**
|
|
@@ -330,8 +357,7 @@ async function readNextAssistantEvent(iterator, timeoutMs, signal) {
|
|
|
330
357
|
*/
|
|
331
358
|
async function executeToolCalls(currentContext, assistantMessage, config, signal, emit) {
|
|
332
359
|
const toolCalls = assistantMessage.content.filter((c) => c.type === "toolCall");
|
|
333
|
-
|
|
334
|
-
if (config.toolExecution === "sequential" || hasSequentialToolCall) {
|
|
360
|
+
if (config.toolExecution === "sequential") {
|
|
335
361
|
return executeToolCallsSequential(currentContext, assistantMessage, toolCalls, config, signal, emit);
|
|
336
362
|
}
|
|
337
363
|
return executeToolCallsParallel(currentContext, assistantMessage, toolCalls, config, signal, emit);
|
|
@@ -406,6 +432,8 @@ async function executeToolCallsSequential(currentContext, assistantMessage, tool
|
|
|
406
432
|
}
|
|
407
433
|
async function executeToolCallsParallel(currentContext, assistantMessage, toolCalls, config, signal, emit) {
|
|
408
434
|
const finalizedCalls = [];
|
|
435
|
+
let lastSequentialCall;
|
|
436
|
+
let currentParallelWave = [];
|
|
409
437
|
for (const toolCall of toolCalls) {
|
|
410
438
|
await emit({
|
|
411
439
|
type: "tool_execution_start",
|
|
@@ -414,30 +442,31 @@ async function executeToolCallsParallel(currentContext, assistantMessage, toolCa
|
|
|
414
442
|
args: toolCall.arguments,
|
|
415
443
|
});
|
|
416
444
|
const preparation = await prepareToolCall(currentContext, assistantMessage, toolCall, config, signal);
|
|
417
|
-
|
|
418
|
-
|
|
419
|
-
|
|
420
|
-
|
|
421
|
-
|
|
422
|
-
|
|
423
|
-
|
|
424
|
-
|
|
425
|
-
|
|
426
|
-
break;
|
|
427
|
-
}
|
|
428
|
-
continue;
|
|
429
|
-
}
|
|
430
|
-
finalizedCalls.push(async () => {
|
|
431
|
-
const executed = await executePreparedToolCall(preparation, signal, emit);
|
|
432
|
-
const finalized = await finalizeExecutedToolCall(currentContext, assistantMessage, preparation, executed, config, signal);
|
|
445
|
+
const isSequential = isSequentialToolCall(currentContext, toolCall);
|
|
446
|
+
const dependencies = isSequential
|
|
447
|
+
? [...(lastSequentialCall ? [lastSequentialCall] : []), ...currentParallelWave]
|
|
448
|
+
: lastSequentialCall
|
|
449
|
+
? [lastSequentialCall]
|
|
450
|
+
: [];
|
|
451
|
+
const finalizedCall = (async () => {
|
|
452
|
+
await Promise.all(dependencies);
|
|
453
|
+
const finalized = await runPreparedToolCall(currentContext, assistantMessage, preparation, config, signal, emit);
|
|
433
454
|
await emitToolExecutionEnd(finalized, emit);
|
|
434
455
|
return finalized;
|
|
435
|
-
});
|
|
456
|
+
})();
|
|
457
|
+
finalizedCalls.push(finalizedCall);
|
|
458
|
+
if (isSequential) {
|
|
459
|
+
lastSequentialCall = finalizedCall;
|
|
460
|
+
currentParallelWave = [];
|
|
461
|
+
}
|
|
462
|
+
else {
|
|
463
|
+
currentParallelWave.push(finalizedCall);
|
|
464
|
+
}
|
|
436
465
|
if (signal?.aborted) {
|
|
437
466
|
break;
|
|
438
467
|
}
|
|
439
468
|
}
|
|
440
|
-
const orderedFinalizedCalls = await Promise.all(finalizedCalls
|
|
469
|
+
const orderedFinalizedCalls = await Promise.all(finalizedCalls);
|
|
441
470
|
const messages = [];
|
|
442
471
|
for (const finalized of orderedFinalizedCalls) {
|
|
443
472
|
const toolResultMessage = createToolResultMessage(finalized);
|
|
@@ -449,6 +478,20 @@ async function executeToolCallsParallel(currentContext, assistantMessage, toolCa
|
|
|
449
478
|
terminate: shouldTerminateToolBatch(orderedFinalizedCalls),
|
|
450
479
|
};
|
|
451
480
|
}
|
|
481
|
+
async function runPreparedToolCall(currentContext, assistantMessage, preparation, config, signal, emit) {
|
|
482
|
+
if (preparation.kind === "immediate") {
|
|
483
|
+
return {
|
|
484
|
+
toolCall: preparation.toolCall,
|
|
485
|
+
result: preparation.result,
|
|
486
|
+
isError: preparation.isError,
|
|
487
|
+
};
|
|
488
|
+
}
|
|
489
|
+
const executed = await executePreparedToolCall(preparation, signal, emit);
|
|
490
|
+
return finalizeExecutedToolCall(currentContext, assistantMessage, preparation, executed, config, signal);
|
|
491
|
+
}
|
|
492
|
+
function isSequentialToolCall(currentContext, toolCall) {
|
|
493
|
+
return currentContext.tools?.find((tool) => tool.name === toolCall.name)?.executionMode === "sequential";
|
|
494
|
+
}
|
|
452
495
|
function shouldTerminateToolBatch(finalizedCalls) {
|
|
453
496
|
return finalizedCalls.length > 0 && finalizedCalls.every((finalized) => finalized.result.terminate === true);
|
|
454
497
|
}
|
|
@@ -470,6 +513,7 @@ async function prepareToolCall(currentContext, assistantMessage, toolCall, confi
|
|
|
470
513
|
if (!tool) {
|
|
471
514
|
return {
|
|
472
515
|
kind: "immediate",
|
|
516
|
+
toolCall,
|
|
473
517
|
result: createErrorToolResult(`Tool ${toolCall.name} not found`),
|
|
474
518
|
isError: true,
|
|
475
519
|
};
|
|
@@ -487,6 +531,7 @@ async function prepareToolCall(currentContext, assistantMessage, toolCall, confi
|
|
|
487
531
|
if (signal?.aborted) {
|
|
488
532
|
return {
|
|
489
533
|
kind: "immediate",
|
|
534
|
+
toolCall,
|
|
490
535
|
result: createErrorToolResult("Operation aborted"),
|
|
491
536
|
isError: true,
|
|
492
537
|
};
|
|
@@ -494,6 +539,7 @@ async function prepareToolCall(currentContext, assistantMessage, toolCall, confi
|
|
|
494
539
|
if (beforeResult?.block) {
|
|
495
540
|
return {
|
|
496
541
|
kind: "immediate",
|
|
542
|
+
toolCall,
|
|
497
543
|
result: createErrorToolResult(beforeResult.reason || "Tool execution was blocked"),
|
|
498
544
|
isError: true,
|
|
499
545
|
};
|
|
@@ -502,6 +548,7 @@ async function prepareToolCall(currentContext, assistantMessage, toolCall, confi
|
|
|
502
548
|
if (signal?.aborted) {
|
|
503
549
|
return {
|
|
504
550
|
kind: "immediate",
|
|
551
|
+
toolCall,
|
|
505
552
|
result: createErrorToolResult("Operation aborted"),
|
|
506
553
|
isError: true,
|
|
507
554
|
};
|
|
@@ -516,6 +563,7 @@ async function prepareToolCall(currentContext, assistantMessage, toolCall, confi
|
|
|
516
563
|
catch (error) {
|
|
517
564
|
return {
|
|
518
565
|
kind: "immediate",
|
|
566
|
+
toolCall,
|
|
519
567
|
result: createErrorToolResult(error instanceof Error ? error.message : String(error)),
|
|
520
568
|
isError: true,
|
|
521
569
|
};
|