@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
package/docs/keybindings.md
CHANGED
|
@@ -2,11 +2,11 @@
|
|
|
2
2
|
|
|
3
3
|
All keyboard shortcuts can be customized via `~/.senpi/agent/keybindings.json`. Each action can be bound to one or more keys.
|
|
4
4
|
|
|
5
|
-
The config file uses the same namespaced keybinding ids that
|
|
5
|
+
The config file uses the same namespaced keybinding ids that senpi uses internally and that extension authors use in `keyHint()` and injected `keybindings` managers.
|
|
6
6
|
|
|
7
7
|
Older configs using pre-namespaced ids such as `cursorUp` or `expandTools` are migrated automatically to the namespaced ids on startup.
|
|
8
8
|
|
|
9
|
-
After editing `keybindings.json`, run `/reload` in
|
|
9
|
+
After editing `keybindings.json`, run `/reload` in senpi to apply the changes without restarting the session.
|
|
10
10
|
|
|
11
11
|
## Key Format
|
|
12
12
|
|
|
@@ -88,6 +88,8 @@ Modifier combinations: `ctrl+shift+x`, `alt+ctrl+x`, `ctrl+shift+alt+x`, `ctrl+1
|
|
|
88
88
|
| `app.suspend` | `ctrl+z` (none on Windows) | Suspend to background |
|
|
89
89
|
| `app.editor.external` | `ctrl+g` | Open in external editor (`$VISUAL` or `$EDITOR`) |
|
|
90
90
|
| `app.clipboard.pasteImage` | `ctrl+v` (`alt+v` on Windows) | Paste image from clipboard |
|
|
91
|
+
| `app.history.search` | `ctrl+r` | Search prompt history across sessions |
|
|
92
|
+
| `app.sessions.observe` | `ctrl+s` | Observe session transcripts |
|
|
91
93
|
|
|
92
94
|
### Sessions
|
|
93
95
|
|
|
@@ -145,6 +147,7 @@ Used inside the favorite models selector (opened via `/favorite-models`).
|
|
|
145
147
|
| Keybinding id | Default | Description |
|
|
146
148
|
|--------|---------|-------------|
|
|
147
149
|
| `app.models.save` | `ctrl+s` | Save current favorite model selection to settings |
|
|
150
|
+
| `app.models.toggleFavorite` | `ctrl+f` | Toggle favorite status of the selected model |
|
|
148
151
|
| `app.models.enableAll` | `ctrl+a` | Favorite all models (or all matching the current search) |
|
|
149
152
|
| `app.models.clearAll` | `ctrl+x` | Clear all models (or all matching the current search) |
|
|
150
153
|
| `app.models.toggleProvider` | `ctrl+p` | Toggle favorite models for the current provider |
|
|
@@ -165,7 +168,7 @@ Create `~/.senpi/agent/keybindings.json`:
|
|
|
165
168
|
|
|
166
169
|
Each action can have a single key or an array of keys. User config overrides defaults.
|
|
167
170
|
|
|
168
|
-
On native Windows, `app.suspend` has no default binding because Windows terminals do not support Unix job control. If you bind it manually,
|
|
171
|
+
On native Windows, `app.suspend` has no default binding because Windows terminals do not support Unix job control. If you bind it manually, senpi shows a status message instead of suspending. In WSL, the normal Linux `ctrl+z`/`fg` behavior still applies.
|
|
169
172
|
|
|
170
173
|
### Emacs Example
|
|
171
174
|
|
package/docs/models.md
CHANGED
|
@@ -36,7 +36,7 @@ For local models (Ollama, LM Studio, vLLM), only `id` is required per model:
|
|
|
36
36
|
|
|
37
37
|
The `apiKey` is required but Ollama ignores it, so any value works.
|
|
38
38
|
|
|
39
|
-
Some OpenAI-compatible servers do not understand the `developer` role used for reasoning-capable models. For those providers, set `compat.supportsDeveloperRole` to `false` so
|
|
39
|
+
Some OpenAI-compatible servers do not understand the `developer` role used for reasoning-capable models. For those providers, set `compat.supportsDeveloperRole` to `false` so senpi sends the system prompt as a `system` message instead. If the server also does not support `reasoning_effort`, set `compat.supportsReasoningEffort` to `false` too.
|
|
40
40
|
|
|
41
41
|
You can set `compat` at the provider level to apply to all models, or at the model level to override a specific model. This commonly applies to Ollama, vLLM, SGLang, and similar OpenAI-compatible servers.
|
|
42
42
|
|
|
@@ -168,7 +168,7 @@ The `apiKey` and `headers` fields support command execution, environment interpo
|
|
|
168
168
|
|
|
169
169
|
Legacy uppercase env-var-like values such as `MY_API_KEY` are migrated to `$MY_API_KEY` on startup.
|
|
170
170
|
|
|
171
|
-
For `models.json`, shell commands are resolved at request time.
|
|
171
|
+
For `models.json`, shell commands are resolved at request time. senpi intentionally does not apply built-in TTL, stale reuse, or recovery logic for arbitrary commands. Different commands need different caching and failure strategies, and senpi cannot infer the right one.
|
|
172
172
|
|
|
173
173
|
If your command is slow, expensive, rate-limited, or should keep using a previous value on transient failures, wrap it in your own script or command that implements the caching or TTL behavior you want.
|
|
174
174
|
|
|
@@ -198,11 +198,10 @@ If your command is slow, expensive, rate-limited, or should keep using a previou
|
|
|
198
198
|
| Field | Required | Default | Description |
|
|
199
199
|
|-------|----------|---------|-------------|
|
|
200
200
|
| `id` | Yes | — | Model identifier (passed to the API) |
|
|
201
|
-
| `name` | No | `id` | Human-readable model label. Used for matching (`--model` patterns) and shown
|
|
202
|
-
| `promptPreset` | No | auto-detected | System prompt preset for this model. Use this when a provider-specific model ID should force a known preset, such as `"kimi-k2-6"`. |
|
|
201
|
+
| `name` | No | `id` | Human-readable model label. Used for matching (`--model` patterns) and shown as secondary model detail text. |
|
|
203
202
|
| `api` | No | provider's `api` | Override provider's API for this model |
|
|
204
203
|
| `reasoning` | No | `false` | Supports extended thinking |
|
|
205
|
-
| `thinkingLevelMap` | No | omitted | Maps
|
|
204
|
+
| `thinkingLevelMap` | No | omitted | Maps senpi thinking levels to provider values and marks unsupported levels (see below) |
|
|
206
205
|
| `input` | No | `["text"]` | Input types: `["text"]` or `["text", "image"]` |
|
|
207
206
|
| `contextWindow` | No | `128000` | Context window size in tokens |
|
|
208
207
|
| `maxTokens` | No | `16384` | Maximum output tokens |
|
|
@@ -210,36 +209,12 @@ If your command is slow, expensive, rate-limited, or should keep using a previou
|
|
|
210
209
|
| `compat` | No | provider `compat` | Provider compatibility overrides. Merged with provider-level `compat` when both are set. |
|
|
211
210
|
|
|
212
211
|
Current behavior:
|
|
213
|
-
- `/model
|
|
214
|
-
- The configured `name` is used for model matching and detail/status
|
|
215
|
-
|
|
216
|
-
### Prompt Preset
|
|
217
|
-
|
|
218
|
-
Use `promptPreset` on a model when auto-detection cannot infer the right system prompt preset from the provider's model ID.
|
|
219
|
-
|
|
220
|
-
```json
|
|
221
|
-
{
|
|
222
|
-
"providers": {
|
|
223
|
-
"moonshot": {
|
|
224
|
-
"baseUrl": "https://api.moonshot.ai/v1",
|
|
225
|
-
"api": "openai-responses",
|
|
226
|
-
"apiKey": "MOONSHOT_API_KEY",
|
|
227
|
-
"models": [
|
|
228
|
-
{
|
|
229
|
-
"id": "kimi-k2p6-turbo",
|
|
230
|
-
"promptPreset": "kimi-k2-6"
|
|
231
|
-
}
|
|
232
|
-
]
|
|
233
|
-
}
|
|
234
|
-
}
|
|
235
|
-
}
|
|
236
|
-
```
|
|
237
|
-
|
|
238
|
-
If `settings.json` sets `promptPreset` to anything other than `"auto"`, that settings override wins. Model-level `promptPreset` is used when settings remain on `"auto"`.
|
|
212
|
+
- `/model`, `--list-models`, and the interactive footer display entries by model `id`.
|
|
213
|
+
- The configured `name` is used for model matching and secondary model detail text. It does not replace the footer/status-bar model id.
|
|
239
214
|
|
|
240
215
|
### Thinking Level Map
|
|
241
216
|
|
|
242
|
-
Use `thinkingLevelMap` on a model to describe model-specific thinking controls. Keys are
|
|
217
|
+
Use `thinkingLevelMap` on a model to describe model-specific thinking controls. Keys are senpi thinking levels: `off`, `minimal`, `low`, `medium`, `high`, `xhigh`.
|
|
243
218
|
|
|
244
219
|
Values are tristate:
|
|
245
220
|
|
|
@@ -339,19 +314,20 @@ Use `modelOverrides` to customize specific built-in models without replacing the
|
|
|
339
314
|
}
|
|
340
315
|
```
|
|
341
316
|
|
|
342
|
-
`modelOverrides` supports these fields per model: `name`, `
|
|
317
|
+
`modelOverrides` supports these fields per model: `name`, `reasoning`, `input`, `cost` (partial), `contextWindow`, `maxTokens`, `headers`, `compat`.
|
|
343
318
|
|
|
344
319
|
Behavior notes:
|
|
345
320
|
- `modelOverrides` are applied to built-in provider models.
|
|
346
321
|
- Unknown model IDs are ignored.
|
|
347
322
|
- You can combine provider-level `baseUrl`/`headers` with `modelOverrides`.
|
|
323
|
+
- Overriding `name` changes model matching and secondary detail text only; the footer and primary model lists continue to show the model `id`.
|
|
348
324
|
- If `models` is also defined for a provider, custom models are merged after built-in overrides. A custom model with the same `id` replaces the overridden built-in model entry.
|
|
349
325
|
|
|
350
326
|
## Anthropic Messages Compatibility
|
|
351
327
|
|
|
352
328
|
For providers or proxies using `api: "anthropic-messages"`, use `compat` to control Anthropic-specific request compatibility.
|
|
353
329
|
|
|
354
|
-
By default
|
|
330
|
+
By default senpi sends per-tool `eager_input_streaming: true`. If a proxy or Anthropic-compatible backend rejects that field, set `supportsEagerToolInputStreaming` to `false`. Senpi will omit `tools[].eager_input_streaming` and send the legacy `fine-grained-tool-streaming-2025-05-14` beta header for tool-enabled requests instead.
|
|
355
331
|
|
|
356
332
|
Some Anthropic models require adaptive thinking (`thinking.type: "adaptive"` plus `output_config.effort`) instead of the legacy budget-based thinking payload. Built-in models set this automatically. For custom providers or aliases that route to those models, set `forceAdaptiveThinking` to `true`.
|
|
357
333
|
|
|
@@ -432,15 +408,6 @@ For providers with partial OpenAI compatibility, use the `compat` field.
|
|
|
432
408
|
| `openRouterRouting` | OpenRouter provider routing preferences. This object is sent as-is in the `provider` field of the [OpenRouter API request](https://openrouter.ai/docs/guides/routing/provider-selection). |
|
|
433
409
|
| `vercelGatewayRouting` | Vercel AI Gateway routing config for provider selection (`only`, `order`) |
|
|
434
410
|
|
|
435
|
-
For `api: "openai-responses"` models, only Responses-specific `compat` fields apply:
|
|
436
|
-
|
|
437
|
-
| Field | Description |
|
|
438
|
-
|-------|-------------|
|
|
439
|
-
| `sendSessionIdHeader` | Send the OpenAI cache-affinity `session_id` header from `sessionId`. Default: `true`. |
|
|
440
|
-
| `supportsLongCacheRetention` | Accepts `prompt_cache_retention: "24h"` when cache retention is `long`. Default: `true`. |
|
|
441
|
-
| `supportsWebSocket` | Supports OpenAI Responses WebSocket transport. Default: `true` only for `api.openai.com`. |
|
|
442
|
-
| `supportsWebSearchPreview` | Supports OpenAI-native `web_search_preview` tools. Default: `true` only for `api.openai.com`; custom Responses proxies must opt in. |
|
|
443
|
-
|
|
444
411
|
`openrouter` uses `reasoning: { effort }`. `together` uses `reasoning: { enabled }` and also `reasoning_effort` when `supportsReasoningEffort` is enabled. `qwen` uses top-level `enable_thinking`. Use `qwen-chat-template` for local Qwen-compatible servers that require `chat_template_kwargs.enable_thinking`.
|
|
445
412
|
|
|
446
413
|
`cacheControlFormat: "anthropic"` is for OpenAI-compatible providers that expose Anthropic-style prompt caching through `cache_control` markers on text content and tool definitions.
|
package/docs/packages.md
CHANGED
|
@@ -26,27 +26,25 @@ senpi install https://github.com/user/repo # raw URLs work too
|
|
|
26
26
|
senpi install /absolute/path/to/package
|
|
27
27
|
senpi install ./relative/path/to/package
|
|
28
28
|
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
29
|
+
senpi remove npm:@foo/bar
|
|
30
|
+
senpi list # show installed packages from settings
|
|
31
|
+
senpi update # update senpi, update packages, and reconcile pinned git refs
|
|
32
|
+
senpi update --extensions # update packages and reconcile pinned git refs only
|
|
33
|
+
senpi update --self # update senpi only
|
|
34
|
+
senpi update --self --force # reinstall senpi even if current
|
|
35
|
+
senpi update npm:@foo/bar # update one package
|
|
36
|
+
senpi update --extension npm:@foo/bar
|
|
37
37
|
```
|
|
38
38
|
|
|
39
39
|
These commands manage senpi packages, not the senpi CLI installation. To uninstall senpi itself, see [Quickstart](quickstart.md#uninstall).
|
|
40
40
|
|
|
41
41
|
By default, `install` and `remove` write to global settings (`~/.senpi/agent/settings.json`). Use `-l` to write to project settings (`.senpi/settings.json`) instead. Project settings can be shared with your team, and senpi installs any missing packages automatically on startup after the project is trusted.
|
|
42
42
|
|
|
43
|
-
Project package commands read project settings only when the project is trusted. Use `--approve` to trust project-local files for one command, or `--no-approve` to ignore them for one command.
|
|
44
|
-
|
|
45
43
|
To try a package without installing it, use `--extension` or `-e`. This installs to a temporary directory for the current run only:
|
|
46
44
|
|
|
47
45
|
```bash
|
|
48
|
-
|
|
49
|
-
|
|
46
|
+
senpi -e npm:@foo/bar
|
|
47
|
+
senpi -e git:github.com/user/repo
|
|
50
48
|
```
|
|
51
49
|
|
|
52
50
|
## Package Sources
|
|
@@ -60,7 +58,7 @@ npm:@scope/pkg@1.2.3
|
|
|
60
58
|
npm:pkg
|
|
61
59
|
```
|
|
62
60
|
|
|
63
|
-
- Versioned specs are pinned and skipped by package updates (`
|
|
61
|
+
- Versioned specs are pinned and skipped by package updates (`senpi update`, `senpi update --extensions`).
|
|
64
62
|
- Global installs use `npm install -g`.
|
|
65
63
|
- Project installs go under `.senpi/npm/`.
|
|
66
64
|
- Set `npmCommand` in `settings.json` to pin npm package lookup and install operations to a specific wrapper command such as `mise` or `asdf`.
|
package/docs/prompt-templates.md
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
>
|
|
1
|
+
> senpi can create prompt templates. Ask it to build one for your workflow.
|
|
2
2
|
|
|
3
3
|
# Prompt Templates
|
|
4
4
|
|
|
@@ -6,7 +6,7 @@ Prompt templates are Markdown snippets that expand into full prompts. Type `/nam
|
|
|
6
6
|
|
|
7
7
|
## Locations
|
|
8
8
|
|
|
9
|
-
|
|
9
|
+
Senpi loads prompt templates from:
|
|
10
10
|
|
|
11
11
|
- Global: `~/.senpi/agent/prompts/*.md`
|
|
12
12
|
- Project: `.senpi/prompts/*.md` (only after the project is trusted)
|
|
@@ -64,10 +64,11 @@ Type `/` followed by the template name in the editor. Autocomplete shows availab
|
|
|
64
64
|
|
|
65
65
|
## Arguments
|
|
66
66
|
|
|
67
|
-
Templates support positional arguments and simple slicing:
|
|
67
|
+
Templates support positional arguments, defaults, and simple slicing:
|
|
68
68
|
|
|
69
69
|
- `$1`, `$2`, ... positional args
|
|
70
70
|
- `$@` or `$ARGUMENTS` for all args joined
|
|
71
|
+
- `${1:-default}` uses arg 1 when present/non-empty, otherwise `default`
|
|
71
72
|
- `${@:N}` for args from the Nth position (1-indexed)
|
|
72
73
|
- `${@:N:L}` for `L` args starting at N
|
|
73
74
|
|
|
@@ -80,6 +81,12 @@ description: Create a component
|
|
|
80
81
|
Create a React component named $1 with features: $@
|
|
81
82
|
```
|
|
82
83
|
|
|
84
|
+
Default values are useful for optional arguments:
|
|
85
|
+
|
|
86
|
+
```markdown
|
|
87
|
+
Summarize the current state in ${1:-7} bullet points.
|
|
88
|
+
```
|
|
89
|
+
|
|
83
90
|
Usage: `/component Button "onClick handler" "disabled support"`
|
|
84
91
|
|
|
85
92
|
## Loading Rules
|
package/docs/providers.md
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
# Providers
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
Senpi supports subscription-based providers via OAuth and API key providers via environment variables or auth file. For each provider, senpi knows all available models. The list is updated with every senpi release.
|
|
4
4
|
|
|
5
5
|
## Table of Contents
|
|
6
6
|
|
|
@@ -43,7 +43,7 @@ Use `/login` in interactive mode and select a provider to store an API key in `a
|
|
|
43
43
|
|
|
44
44
|
```bash
|
|
45
45
|
export ANTHROPIC_API_KEY=sk-ant-...
|
|
46
|
-
|
|
46
|
+
senpi
|
|
47
47
|
```
|
|
48
48
|
|
|
49
49
|
| Provider | Environment Variable | `auth.json` key |
|
|
@@ -78,7 +78,7 @@ pi
|
|
|
78
78
|
| Xiaomi MiMo Token Plan (Amsterdam) | `XIAOMI_TOKEN_PLAN_AMS_API_KEY` | `xiaomi-token-plan-ams` |
|
|
79
79
|
| Xiaomi MiMo Token Plan (Singapore) | `XIAOMI_TOKEN_PLAN_SGP_API_KEY` | `xiaomi-token-plan-sgp` |
|
|
80
80
|
|
|
81
|
-
Reference for environment variables and `auth.json` keys: [`const envMap`](https://github.com/
|
|
81
|
+
Reference for environment variables and `auth.json` keys: [`const envMap`](https://github.com/code-yeongyu/senpi/blob/main/packages/ai/src/env-api-keys.ts) in [`packages/ai/src/env-api-keys.ts`](https://github.com/code-yeongyu/senpi/blob/main/packages/ai/src/env-api-keys.ts).
|
|
82
82
|
|
|
83
83
|
#### Auth File
|
|
84
84
|
|
|
@@ -169,14 +169,14 @@ export AWS_REGION=us-west-2
|
|
|
169
169
|
Also supports ECS task roles (`AWS_CONTAINER_CREDENTIALS_*`) and IRSA (`AWS_WEB_IDENTITY_TOKEN_FILE`).
|
|
170
170
|
|
|
171
171
|
```bash
|
|
172
|
-
|
|
172
|
+
senpi --provider amazon-bedrock --model us.anthropic.claude-sonnet-4-20250514-v1:0
|
|
173
173
|
```
|
|
174
174
|
|
|
175
175
|
Prompt caching is enabled automatically for Claude models whose ID contains a recognizable model name (base models and system-defined inference profiles). For application inference profiles (whose ARNs don't contain the model name), set `AWS_BEDROCK_FORCE_CACHE=1` to enable cache points:
|
|
176
176
|
|
|
177
177
|
```bash
|
|
178
178
|
export AWS_BEDROCK_FORCE_CACHE=1
|
|
179
|
-
|
|
179
|
+
senpi --provider amazon-bedrock --model arn:aws:bedrock:us-east-1:123456789012:application-inference-profile/abc123
|
|
180
180
|
```
|
|
181
181
|
|
|
182
182
|
If you are connecting to a Bedrock API proxy, the following environment variables can be used:
|
|
@@ -200,7 +200,7 @@ export AWS_BEDROCK_FORCE_HTTP1=1
|
|
|
200
200
|
export CLOUDFLARE_API_KEY=... # or use /login
|
|
201
201
|
export CLOUDFLARE_ACCOUNT_ID=...
|
|
202
202
|
export CLOUDFLARE_GATEWAY_ID=... # create at dash.cloudflare.com → AI → AI Gateway
|
|
203
|
-
|
|
203
|
+
senpi --provider cloudflare-ai-gateway --model "claude-sonnet-4-5"
|
|
204
204
|
```
|
|
205
205
|
|
|
206
206
|
Routes to OpenAI, Anthropic, and Workers AI through Cloudflare AI Gateway. Workers AI uses the Unified API (`/compat`) and prefixed model IDs (`workers-ai/@cf/...`). OpenAI uses the OpenAI passthrough route (`/openai`) with native OpenAI model IDs such as `gpt-5.1`. Anthropic uses the Anthropic passthrough route (`/anthropic`) with native Anthropic model IDs such as `claude-sonnet-4-5`.
|
|
@@ -214,7 +214,7 @@ AI Gateway authentication uses `CLOUDFLARE_API_KEY` as `cf-aig-authorization`. U
|
|
|
214
214
|
| Stored BYOK | Cloudflare token only | Cloudflare injects provider keys stored in the AI Gateway dashboard |
|
|
215
215
|
| Inline BYOK | Cloudflare token plus upstream `Authorization` header | The request supplies the upstream provider key |
|
|
216
216
|
|
|
217
|
-
For normal
|
|
217
|
+
For normal senpi usage, prefer unified billing or stored BYOK. Inline BYOK requires configuring an additional upstream `Authorization` header for the Cloudflare AI Gateway provider, for example via a `models.json` provider/model override.
|
|
218
218
|
|
|
219
219
|
### Cloudflare Workers AI
|
|
220
220
|
|
|
@@ -223,10 +223,10 @@ For normal pi usage, prefer unified billing or stored BYOK. Inline BYOK requires
|
|
|
223
223
|
```bash
|
|
224
224
|
export CLOUDFLARE_API_KEY=... # or use /login
|
|
225
225
|
export CLOUDFLARE_ACCOUNT_ID=...
|
|
226
|
-
|
|
226
|
+
senpi --provider cloudflare-workers-ai --model "@cf/moonshotai/kimi-k2.6"
|
|
227
227
|
```
|
|
228
228
|
|
|
229
|
-
|
|
229
|
+
Senpi automatically sets `x-session-affinity` for [prefix caching](https://developers.cloudflare.com/workers-ai/features/prompt-caching/) discounts.
|
|
230
230
|
|
|
231
231
|
### Google Vertex AI
|
|
232
232
|
|
package/docs/rpc.md
CHANGED
|
@@ -7,7 +7,7 @@ RPC mode enables headless operation of the coding agent via a JSON protocol over
|
|
|
7
7
|
## Starting RPC Mode
|
|
8
8
|
|
|
9
9
|
```bash
|
|
10
|
-
|
|
10
|
+
senpi --mode rpc [options]
|
|
11
11
|
```
|
|
12
12
|
|
|
13
13
|
Common options:
|
|
@@ -695,7 +695,7 @@ Response:
|
|
|
695
695
|
}
|
|
696
696
|
```
|
|
697
697
|
|
|
698
|
-
The current session name is available via `get_state` in the `sessionName` field. To set the initial name when starting RPC mode, pass `--name <name>` or `-n <name>` to the `
|
|
698
|
+
The current session name is available via `get_state` in the `sessionName` field. To set the initial name when starting RPC mode, pass `--name <name>` or `-n <name>` to the `senpi --mode rpc` process.
|
|
699
699
|
|
|
700
700
|
### Commands
|
|
701
701
|
|
|
@@ -715,9 +715,9 @@ Response:
|
|
|
715
715
|
"success": true,
|
|
716
716
|
"data": {
|
|
717
717
|
"commands": [
|
|
718
|
-
{"name": "session-name", "description": "Set or clear session name", "source": "extension", "path": "/home/user/.senpi/agent/extensions/session.ts"},
|
|
719
|
-
{"name": "fix-tests", "description": "Fix failing tests", "source": "prompt", "
|
|
720
|
-
{"name": "skill:brave-search", "description": "Web search via Brave API", "source": "skill", "
|
|
718
|
+
{"name": "session-name", "description": "Set or clear session name", "source": "extension", "sourceInfo": {"path": "/home/user/.senpi/agent/extensions/session.ts", "source": "auto", "scope": "user", "origin": "top-level"}},
|
|
719
|
+
{"name": "fix-tests", "description": "Fix failing tests", "source": "prompt", "sourceInfo": {"path": "/home/user/myproject/.senpi/prompts/fix-tests.md", "source": "auto", "scope": "project", "origin": "top-level"}},
|
|
720
|
+
{"name": "skill:brave-search", "description": "Web search via Brave API", "source": "skill", "sourceInfo": {"path": "/home/user/.senpi/agent/skills/brave-search/SKILL.md", "source": "auto", "scope": "user", "origin": "top-level"}}
|
|
721
721
|
]
|
|
722
722
|
}
|
|
723
723
|
}
|
|
@@ -730,11 +730,12 @@ Each command has:
|
|
|
730
730
|
- `"extension"`: Registered via `pi.registerCommand()` in an extension
|
|
731
731
|
- `"prompt"`: Loaded from a prompt template `.md` file
|
|
732
732
|
- `"skill"`: Loaded from a skill directory (name is prefixed with `skill:`)
|
|
733
|
-
- `
|
|
734
|
-
- `
|
|
735
|
-
- `"
|
|
736
|
-
- `"
|
|
737
|
-
- `
|
|
733
|
+
- `sourceInfo`: Provenance metadata for the owning resource (present for all sources, including extensions):
|
|
734
|
+
- `path`: Absolute file path to the command source
|
|
735
|
+
- `source`: Source identifier string (for example `"auto"` for auto-discovered locations, `"local"` for settings entries, `"cli"` for CLI paths, `"builtin"`, `"sdk"`, or a package source)
|
|
736
|
+
- `scope`: `"user"`, `"project"`, or `"temporary"`
|
|
737
|
+
- `origin`: `"package"` or `"top-level"`
|
|
738
|
+
- `baseDir`: Base directory of the owning resource (optional)
|
|
738
739
|
|
|
739
740
|
**Note**: Built-in TUI commands (`/settings`, `/hotkeys`, etc.) are not included. They are handled only in interactive mode and would not execute if sent via `prompt`.
|
|
740
741
|
|
|
@@ -1133,7 +1134,7 @@ Set the terminal window/tab title. Fire-and-forget.
|
|
|
1133
1134
|
"type": "extension_ui_request",
|
|
1134
1135
|
"id": "uuid-8",
|
|
1135
1136
|
"method": "setTitle",
|
|
1136
|
-
"title": "
|
|
1137
|
+
"title": "senpi - my project"
|
|
1137
1138
|
}
|
|
1138
1139
|
```
|
|
1139
1140
|
|
|
@@ -1320,7 +1321,7 @@ import subprocess
|
|
|
1320
1321
|
import json
|
|
1321
1322
|
|
|
1322
1323
|
proc = subprocess.Popen(
|
|
1323
|
-
["
|
|
1324
|
+
["senpi", "--mode", "rpc", "--no-session"],
|
|
1324
1325
|
stdin=subprocess.PIPE,
|
|
1325
1326
|
stdout=subprocess.PIPE,
|
|
1326
1327
|
text=True
|
|
@@ -1359,7 +1360,7 @@ For a complete example of handling the extension UI protocol, see [`examples/rpc
|
|
|
1359
1360
|
const { spawn } = require("child_process");
|
|
1360
1361
|
const { StringDecoder } = require("string_decoder");
|
|
1361
1362
|
|
|
1362
|
-
const agent = spawn("
|
|
1363
|
+
const agent = spawn("senpi", ["--mode", "rpc", "--no-session"]);
|
|
1363
1364
|
|
|
1364
1365
|
function attachJsonlReader(stream, onLine) {
|
|
1365
1366
|
const decoder = new StringDecoder("utf8");
|
package/docs/sdk.md
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
# SDK
|
|
4
4
|
|
|
5
|
-
The SDK provides programmatic access to
|
|
5
|
+
The SDK provides programmatic access to senpi's agent capabilities. Use it to embed senpi in other applications, build custom interfaces, or integrate with automated workflows.
|
|
6
6
|
|
|
7
7
|
**Example use cases:**
|
|
8
8
|
- Build a custom UI (web, desktop, mobile)
|
|
@@ -209,7 +209,7 @@ await session.prompt("What files are here?");
|
|
|
209
209
|
|
|
210
210
|
// With images
|
|
211
211
|
await session.prompt("What's in this image?", {
|
|
212
|
-
images: [{ type: "image",
|
|
212
|
+
images: [{ type: "image", data: "base64-encoded-data", mimeType: "image/png" }]
|
|
213
213
|
});
|
|
214
214
|
|
|
215
215
|
// During streaming: must specify how to queue the message
|
|
@@ -473,7 +473,7 @@ Specify which built-in tools to enable:
|
|
|
473
473
|
- `noTools: "builtin"` disables default built-ins while keeping extension and custom tools enabled
|
|
474
474
|
- `excludeTools` disables specific built-in, extension, or custom tool names after any `tools` allowlist is applied
|
|
475
475
|
|
|
476
|
-
The `edit` tool returns `details.diff` for
|
|
476
|
+
The `edit` tool returns `details.diff` for senpi's TUI display and `details.patch` as a standard unified patch for SDK consumers.
|
|
477
477
|
|
|
478
478
|
```typescript
|
|
479
479
|
import { createAgentSession } from "@code-yeongyu/senpi";
|
|
@@ -600,6 +600,7 @@ eventBus.on("my-extension:status", (data) => console.log(data));
|
|
|
600
600
|
```typescript
|
|
601
601
|
import {
|
|
602
602
|
createAgentSession,
|
|
603
|
+
createSyntheticSourceInfo,
|
|
603
604
|
DefaultResourceLoader,
|
|
604
605
|
type Skill,
|
|
605
606
|
} from "@code-yeongyu/senpi";
|
|
@@ -609,7 +610,8 @@ const customSkill: Skill = {
|
|
|
609
610
|
description: "Custom instructions",
|
|
610
611
|
filePath: "/path/to/SKILL.md",
|
|
611
612
|
baseDir: "/path/to",
|
|
612
|
-
source: "
|
|
613
|
+
sourceInfo: createSyntheticSourceInfo("/path/to/SKILL.md", { source: "sdk" }),
|
|
614
|
+
disableModelInvocation: false,
|
|
613
615
|
};
|
|
614
616
|
|
|
615
617
|
const loader = new DefaultResourceLoader({
|
|
@@ -650,6 +652,7 @@ const { session } = await createAgentSession({ resourceLoader: loader });
|
|
|
650
652
|
```typescript
|
|
651
653
|
import {
|
|
652
654
|
createAgentSession,
|
|
655
|
+
createSyntheticSourceInfo,
|
|
653
656
|
DefaultResourceLoader,
|
|
654
657
|
type PromptTemplate,
|
|
655
658
|
} from "@code-yeongyu/senpi";
|
|
@@ -657,7 +660,8 @@ import {
|
|
|
657
660
|
const customCommand: PromptTemplate = {
|
|
658
661
|
name: "deploy",
|
|
659
662
|
description: "Deploy the application",
|
|
660
|
-
|
|
663
|
+
filePath: "/virtual/prompts/deploy.md",
|
|
664
|
+
sourceInfo: createSyntheticSourceInfo("/virtual/prompts/deploy.md", { source: "sdk" }),
|
|
661
665
|
content: "# Deploy\n\n1. Build\n2. Test\n3. Deploy",
|
|
662
666
|
};
|
|
663
667
|
|
|
@@ -714,7 +718,7 @@ const { session: opened } = await createAgentSession({
|
|
|
714
718
|
|
|
715
719
|
// List sessions
|
|
716
720
|
const currentProjectSessions = await SessionManager.list(process.cwd());
|
|
717
|
-
const allSessions = await SessionManager.listAll(
|
|
721
|
+
const allSessions = await SessionManager.listAll(); // All sessions across all projects
|
|
718
722
|
|
|
719
723
|
// Session replacement API for /new, /resume, /fork, /clone, and import flows.
|
|
720
724
|
const createRuntime: CreateAgentSessionRuntimeFactory = async ({ cwd, sessionManager, sessionStartEvent }) => {
|
|
@@ -756,12 +760,12 @@ const sm = SessionManager.open("/path/to/session.jsonl");
|
|
|
756
760
|
|
|
757
761
|
// Session listing
|
|
758
762
|
const currentProjectSessions = await SessionManager.list(process.cwd());
|
|
759
|
-
const allSessions = await SessionManager.listAll(
|
|
763
|
+
const allSessions = await SessionManager.listAll(); // All sessions across all projects
|
|
760
764
|
|
|
761
765
|
// Tree traversal
|
|
762
766
|
const entries = sm.getEntries(); // All entries (excludes header)
|
|
763
767
|
const tree = sm.getTree(); // Full tree structure
|
|
764
|
-
const
|
|
768
|
+
const branch = sm.getBranch(); // Entries from root to current leaf
|
|
765
769
|
const leaf = sm.getLeafEntry(); // Current leaf entry
|
|
766
770
|
const entry = sm.getEntry(id); // Get entry by ID
|
|
767
771
|
const children = sm.getChildren(id); // Direct children of entry
|
|
@@ -1076,7 +1080,7 @@ See [RPC documentation](rpc.md) for the JSON protocol.
|
|
|
1076
1080
|
For subprocess-based integration without building with the SDK, use the CLI directly:
|
|
1077
1081
|
|
|
1078
1082
|
```bash
|
|
1079
|
-
|
|
1083
|
+
senpi --mode rpc --no-session
|
|
1080
1084
|
```
|
|
1081
1085
|
|
|
1082
1086
|
See [RPC documentation](rpc.md) for the JSON protocol.
|
|
@@ -1113,6 +1117,11 @@ createEventBus
|
|
|
1113
1117
|
|
|
1114
1118
|
// Helpers
|
|
1115
1119
|
defineTool
|
|
1120
|
+
getAgentDir
|
|
1121
|
+
getPackageDir
|
|
1122
|
+
getReadmePath
|
|
1123
|
+
getDocsPath
|
|
1124
|
+
getExamplesPath
|
|
1116
1125
|
|
|
1117
1126
|
// Session management
|
|
1118
1127
|
SessionManager
|
package/docs/security.md
ADDED
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
# Security
|
|
2
|
+
|
|
3
|
+
Pi is a local coding agent. It runs with the permissions of the user account that starts it, and it treats files writable by that user as inside the same local trust boundary.
|
|
4
|
+
|
|
5
|
+
## Project Trust
|
|
6
|
+
|
|
7
|
+
Project trust controls whether pi loads project-local settings, resources, packages, and extensions. It is not a sandbox and it does not restrict what the model can ask tools to do after you start working in a directory.
|
|
8
|
+
|
|
9
|
+
Pi considers a project to have trust inputs when it finds any of these from the current working directory:
|
|
10
|
+
|
|
11
|
+
- `.senpi/` in the current directory
|
|
12
|
+
- `.agents/skills` in the current directory or an ancestor directory
|
|
13
|
+
|
|
14
|
+
When an interactive session starts in a project with configs in `.senpi` or `.agents/skills` and no saved decision for the current directory or a parent directory, pi follows `defaultProjectTrust` from global settings. The default value is `"ask"`, which asks whether to trust the project when UI is available. Saved decisions are stored by canonical directory in `~/.senpi/agent/trust.json`, and the closest saved decision on the current or parent path applies before the global default.
|
|
15
|
+
|
|
16
|
+
Trusting a project allows pi to load trust-gated project inputs, including:
|
|
17
|
+
|
|
18
|
+
- `.senpi/settings.json`
|
|
19
|
+
- `.senpi` resources such as extensions, skills, prompt templates, themes, and system prompt files
|
|
20
|
+
- missing project packages configured through project settings
|
|
21
|
+
- project-local extensions and project package-managed extensions
|
|
22
|
+
|
|
23
|
+
Declining trust skips protected resources. `AGENTS.md` and `CLAUDE.md` context files are loaded regardless of project trust unless context loading is disabled. Before trust is resolved, pi only loads context files, user/global extensions, and CLI `-e` extensions. User/global and CLI extensions can handle the `project_trust` event; the first extension that returns a yes/no decision owns the decision.
|
|
24
|
+
|
|
25
|
+
Non-interactive modes (`-p`, `--mode json`, and `--mode rpc`) do not show a trust prompt. Without an applicable saved trust decision, `defaultProjectTrust: "ask"` and `"never"` ignore such resources, while `"always"` trusts them. Use `--approve`/`-a` or `--no-approve`/`-na` to override project trust for one run.
|
|
26
|
+
|
|
27
|
+
## No Built-in Sandbox
|
|
28
|
+
|
|
29
|
+
Pi does not include a built-in sandbox. Built-in tools can read files, write files, edit files, and run shell commands with the permissions of the pi process. Extensions are TypeScript modules that run with the same permissions. Package installs, shell commands, language servers, test commands, and other developer tools behave as ordinary local processes.
|
|
30
|
+
|
|
31
|
+
This is intentional. Pi is designed to operate on local source trees, invoke project toolchains, and integrate with the user's existing development environment. A partial in-process sandbox would be easy to misunderstand as a security boundary while still depending on the host shell, filesystem, package managers, credentials, and extension code. Real isolation needs to come from the operating system or a virtualization/container boundary.
|
|
32
|
+
|
|
33
|
+
Project trust is only an input-loading guard. It prevents a repository from silently changing pi's settings or extensions before you approve it. It does not make untrusted code, untrusted prompts, or untrusted model output safe. Prompt injection from repository files, comments, documentation, context files, or build output is expected local-agent risk and cannot be reliably prevented by pi.
|
|
34
|
+
|
|
35
|
+
## Running Untrusted or Unmonitored Work
|
|
36
|
+
|
|
37
|
+
For untrusted repositories, generated code you do not intend to monitor closely, or unattended automation, run pi in a contained environment. Use a container, VM, micro-VM, remote sandbox, or policy-controlled sandbox with only the files and credentials required for the task.
|
|
38
|
+
|
|
39
|
+
Common patterns are documented in [Containerization](containerization.md):
|
|
40
|
+
|
|
41
|
+
- run the whole `senpi` process inside OpenShell or Docker
|
|
42
|
+
- run host senpi while routing built-in tool execution into a Gondolin micro-VM
|
|
43
|
+
- mount only the workspace paths the agent should access
|
|
44
|
+
- avoid mounting host `~/.senpi/agent` unless the container should access host sessions, settings, and credentials
|
|
45
|
+
- pass the minimum required API keys or use short-lived credentials
|
|
46
|
+
- restrict network access when the task does not need it
|
|
47
|
+
- review diffs and outputs before copying results back to trusted systems
|
|
48
|
+
|
|
49
|
+
If you bind-mount a host workspace read/write, writes from inside the container or VM can still modify host files. Use read-only mounts or copy files into and out of the sandbox when you need stronger protection from unintended writes.
|
|
50
|
+
|
|
51
|
+
## Reporting Security Issues
|
|
52
|
+
|
|
53
|
+
To report a security issue, follow the repository [Security Policy](https://github.com/earendil-works/pi-mono/blob/main/SECURITY.md). Do not open a public issue for security-sensitive reports.
|
|
54
|
+
|
|
55
|
+
Expected local-agent behavior, lack of a built-in sandbox, prompt injection from untrusted content, and behavior of user-installed extensions or skills are generally outside the security boundary unless the report demonstrates a real privilege-boundary bypass or shows how pi grants access that the local user did not already have.
|
package/docs/session-format.md
CHANGED
|
@@ -14,7 +14,7 @@ Where `<path>` is the working directory with `/` replaced by `-`.
|
|
|
14
14
|
|
|
15
15
|
Sessions can be removed by deleting their `.jsonl` files under `~/.senpi/agent/sessions/`.
|
|
16
16
|
|
|
17
|
-
|
|
17
|
+
Senpi also supports deleting sessions interactively from `/resume` (select a session and press `Ctrl+D`, then confirm). When available, senpi uses the `trash` CLI to avoid permanent deletion.
|
|
18
18
|
|
|
19
19
|
## Session Version
|
|
20
20
|
|
|
@@ -116,7 +116,7 @@ interface Usage {
|
|
|
116
116
|
}
|
|
117
117
|
```
|
|
118
118
|
|
|
119
|
-
### Extended Message Types (from
|
|
119
|
+
### Extended Message Types (from @code-yeongyu/senpi)
|
|
120
120
|
|
|
121
121
|
```typescript
|
|
122
122
|
interface BashExecutionMessage {
|
|
@@ -233,7 +233,7 @@ Created when context is compacted. Stores a summary of earlier messages.
|
|
|
233
233
|
|
|
234
234
|
Optional fields:
|
|
235
235
|
- `details`: Implementation-specific data (e.g., `{ readFiles: string[], modifiedFiles: string[] }` for default, or custom data for extensions)
|
|
236
|
-
- `fromHook`: `true` if generated by an extension, `false`/`undefined` if
|
|
236
|
+
- `fromHook`: `true` if generated by an extension, `false`/`undefined` if senpi-generated (legacy field name)
|
|
237
237
|
|
|
238
238
|
### BranchSummaryEntry
|
|
239
239
|
|
|
@@ -245,7 +245,7 @@ Created when switching branches via `/tree` with an LLM generated summary of the
|
|
|
245
245
|
|
|
246
246
|
Optional fields:
|
|
247
247
|
- `details`: File tracking data (`{ readFiles: string[], modifiedFiles: string[] }`) for default, or custom data for extensions
|
|
248
|
-
- `fromHook`: `true` if generated by an extension, `false`/`undefined` if
|
|
248
|
+
- `fromHook`: `true` if generated by an extension, `false`/`undefined` if senpi-generated (legacy field name)
|
|
249
249
|
|
|
250
250
|
### CustomEntry
|
|
251
251
|
|