@draht/coding-agent 2026.5.12 → 2026.7.7
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 +41 -0
- package/README.md +1 -4
- package/bin/draht-tools.cjs +3756 -1
- package/dist/bun/cli.d.ts.map +1 -1
- package/dist/bun/cli.js +4 -2
- package/dist/bun/cli.js.map +1 -1
- package/dist/bun/register-bedrock.d.ts.map +1 -1
- package/dist/bun/register-bedrock.js +1 -1
- package/dist/bun/register-bedrock.js.map +1 -1
- package/dist/bun/restore-sandbox-env.d.ts +17 -0
- package/dist/bun/restore-sandbox-env.d.ts.map +1 -0
- package/dist/bun/restore-sandbox-env.js +36 -0
- package/dist/bun/restore-sandbox-env.js.map +1 -0
- package/dist/cli/args.d.ts +9 -4
- package/dist/cli/args.d.ts.map +1 -1
- package/dist/cli/args.js +91 -38
- package/dist/cli/args.js.map +1 -1
- package/dist/cli/config-selector.d.ts +5 -3
- package/dist/cli/config-selector.d.ts.map +1 -1
- package/dist/cli/config-selector.js +1 -1
- package/dist/cli/config-selector.js.map +1 -1
- package/dist/cli/file-processor.d.ts.map +1 -1
- package/dist/cli/file-processor.js +13 -26
- package/dist/cli/file-processor.js.map +1 -1
- package/dist/cli/initial-message.d.ts +1 -1
- package/dist/cli/initial-message.d.ts.map +1 -1
- package/dist/cli/initial-message.js.map +1 -1
- package/dist/cli/list-models.d.ts +1 -1
- package/dist/cli/list-models.d.ts.map +1 -1
- package/dist/cli/list-models.js +7 -1
- package/dist/cli/list-models.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/session-picker.d.ts +3 -2
- package/dist/cli/session-picker.d.ts.map +1 -1
- package/dist/cli/session-picker.js +5 -4
- package/dist/cli/session-picker.js.map +1 -1
- package/dist/cli/startup-ui.d.ts +20 -0
- package/dist/cli/startup-ui.d.ts.map +1 -0
- package/dist/cli/startup-ui.js +184 -0
- package/dist/cli/startup-ui.js.map +1 -0
- package/dist/cli.d.ts.map +1 -1
- package/dist/cli.js +7 -4
- package/dist/cli.js.map +1 -1
- package/dist/config.d.ts +27 -13
- package/dist/config.d.ts.map +1 -1
- package/dist/config.js +284 -63
- package/dist/config.js.map +1 -1
- package/dist/core/agent-session-runtime.d.ts +45 -9
- package/dist/core/agent-session-runtime.d.ts.map +1 -1
- package/dist/core/agent-session-runtime.js +100 -33
- package/dist/core/agent-session-runtime.js.map +1 -1
- package/dist/core/agent-session-services.d.ts +6 -4
- package/dist/core/agent-session-services.d.ts.map +1 -1
- package/dist/core/agent-session-services.js +7 -4
- package/dist/core/agent-session-services.js.map +1 -1
- package/dist/core/agent-session.d.ts +55 -33
- package/dist/core/agent-session.d.ts.map +1 -1
- package/dist/core/agent-session.js +560 -492
- package/dist/core/agent-session.js.map +1 -1
- package/dist/core/auth-guidance.d.ts +5 -0
- package/dist/core/auth-guidance.d.ts.map +1 -0
- package/dist/core/auth-guidance.js +21 -0
- package/dist/core/auth-guidance.js.map +1 -0
- package/dist/core/auth-storage.d.ts +21 -13
- package/dist/core/auth-storage.d.ts.map +1 -1
- package/dist/core/auth-storage.js +48 -28
- package/dist/core/auth-storage.js.map +1 -1
- package/dist/core/bash-executor.d.ts +1 -15
- package/dist/core/bash-executor.d.ts.map +1 -1
- package/dist/core/bash-executor.js +10 -24
- package/dist/core/bash-executor.js.map +1 -1
- package/dist/core/builtins/subagent.d.ts.map +1 -1
- package/dist/core/builtins/subagent.js +1 -2
- package/dist/core/builtins/subagent.js.map +1 -1
- package/dist/core/compaction/branch-summarization.d.ts +9 -5
- package/dist/core/compaction/branch-summarization.d.ts.map +1 -1
- package/dist/core/compaction/branch-summarization.js +10 -4
- package/dist/core/compaction/branch-summarization.js.map +1 -1
- package/dist/core/compaction/compaction.d.ts +8 -7
- package/dist/core/compaction/compaction.d.ts.map +1 -1
- package/dist/core/compaction/compaction.js +56 -47
- package/dist/core/compaction/compaction.js.map +1 -1
- package/dist/core/compaction/index.d.ts +3 -3
- package/dist/core/compaction/index.d.ts.map +1 -1
- package/dist/core/compaction/index.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/exec.d.ts.map +1 -1
- package/dist/core/exec.js.map +1 -1
- package/dist/core/experimental.d.ts +2 -0
- package/dist/core/experimental.d.ts.map +1 -0
- package/dist/core/experimental.js +4 -0
- package/dist/core/experimental.js.map +1 -0
- package/dist/core/export-html/ansi-to-html.d.ts.map +1 -1
- package/dist/core/export-html/ansi-to-html.js +1 -1
- package/dist/core/export-html/ansi-to-html.js.map +1 -1
- package/dist/core/export-html/index.d.ts +1 -1
- package/dist/core/export-html/index.d.ts.map +1 -1
- package/dist/core/export-html/index.js +13 -11
- package/dist/core/export-html/index.js.map +1 -1
- package/dist/core/export-html/template.css +69 -4
- package/dist/core/export-html/template.js +231 -57
- package/dist/core/export-html/tool-renderer.d.ts +0 -6
- package/dist/core/export-html/tool-renderer.d.ts.map +1 -1
- package/dist/core/export-html/tool-renderer.js +15 -2
- package/dist/core/export-html/tool-renderer.js.map +1 -1
- package/dist/core/export-html/vendor/marked.min.js +75 -3
- package/dist/core/extensions/index.d.ts +8 -8
- 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 +5 -6
- package/dist/core/extensions/loader.d.ts.map +1 -1
- package/dist/core/extensions/loader.js +98 -43
- package/dist/core/extensions/loader.js.map +1 -1
- package/dist/core/extensions/runner.d.ts +31 -12
- package/dist/core/extensions/runner.d.ts.map +1 -1
- package/dist/core/extensions/runner.js +248 -33
- package/dist/core/extensions/runner.js.map +1 -1
- package/dist/core/extensions/types.d.ts +191 -36
- package/dist/core/extensions/types.d.ts.map +1 -1
- package/dist/core/extensions/types.js.map +1 -1
- package/dist/core/extensions/wrapper.d.ts.map +1 -1
- package/dist/core/extensions/wrapper.js +2 -2
- package/dist/core/extensions/wrapper.js.map +1 -1
- package/dist/core/footer-data-provider.d.ts +7 -1
- package/dist/core/footer-data-provider.d.ts.map +1 -1
- package/dist/core/footer-data-provider.js +78 -54
- package/dist/core/footer-data-provider.js.map +1 -1
- package/dist/core/http-dispatcher.d.ts +22 -0
- package/dist/core/http-dispatcher.d.ts.map +1 -0
- package/dist/core/http-dispatcher.js +91 -0
- package/dist/core/http-dispatcher.js.map +1 -0
- package/dist/core/index.d.ts +9 -8
- package/dist/core/index.d.ts.map +1 -1
- package/dist/core/index.js +2 -1
- package/dist/core/index.js.map +1 -1
- package/dist/core/keybindings.d.ts +67 -2
- package/dist/core/keybindings.d.ts.map +1 -1
- package/dist/core/keybindings.js +59 -7
- package/dist/core/keybindings.js.map +1 -1
- package/dist/core/model-registry.d.ts +24 -5
- package/dist/core/model-registry.d.ts.map +1 -1
- package/dist/core/model-registry.js +188 -51
- package/dist/core/model-registry.js.map +1 -1
- package/dist/core/model-resolver.d.ts +12 -1
- package/dist/core/model-resolver.d.ts.map +1 -1
- package/dist/core/model-resolver.js +84 -39
- package/dist/core/model-resolver.js.map +1 -1
- package/dist/core/output-guard.d.ts +1 -0
- package/dist/core/output-guard.d.ts.map +1 -1
- package/dist/core/output-guard.js +52 -22
- package/dist/core/output-guard.js.map +1 -1
- package/dist/core/package-manager.d.ts +22 -4
- package/dist/core/package-manager.d.ts.map +1 -1
- package/dist/core/package-manager.js +455 -157
- package/dist/core/package-manager.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 +59 -0
- package/dist/core/project-trust.js.map +1 -0
- package/dist/core/prompt-templates.d.ts +13 -11
- package/dist/core/prompt-templates.d.ts.map +1 -1
- package/dist/core/prompt-templates.js +67 -76
- package/dist/core/prompt-templates.js.map +1 -1
- package/dist/core/provider-attribution.d.ts +4 -0
- package/dist/core/provider-attribution.d.ts.map +1 -0
- package/dist/core/provider-attribution.js +72 -0
- package/dist/core/provider-attribution.js.map +1 -0
- package/dist/core/provider-display-names.d.ts +2 -0
- package/dist/core/provider-display-names.d.ts.map +1 -0
- package/dist/core/provider-display-names.js +36 -0
- package/dist/core/provider-display-names.js.map +1 -0
- package/dist/core/resolve-config-value.d.ts +13 -6
- package/dist/core/resolve-config-value.d.ts.map +1 -1
- package/dist/core/resolve-config-value.js +143 -22
- package/dist/core/resolve-config-value.js.map +1 -1
- package/dist/core/resource-loader.d.ts +36 -15
- package/dist/core/resource-loader.d.ts.map +1 -1
- package/dist/core/resource-loader.js +178 -79
- package/dist/core/resource-loader.js.map +1 -1
- package/dist/core/sdk.d.ts +34 -18
- package/dist/core/sdk.d.ts.map +1 -1
- package/dist/core/sdk.js +47 -16
- package/dist/core/sdk.js.map +1 -1
- package/dist/core/session-manager.d.ts +32 -14
- package/dist/core/session-manager.d.ts.map +1 -1
- package/dist/core/session-manager.js +366 -209
- package/dist/core/session-manager.js.map +1 -1
- package/dist/core/settings-manager.d.ts +62 -6
- package/dist/core/settings-manager.d.ts.map +1 -1
- package/dist/core/settings-manager.js +230 -40
- package/dist/core/settings-manager.js.map +1 -1
- package/dist/core/skills.d.ts +10 -10
- package/dist/core/skills.d.ts.map +1 -1
- package/dist/core/skills.js +13 -35
- package/dist/core/skills.js.map +1 -1
- package/dist/core/slash-commands.d.ts +1 -1
- package/dist/core/slash-commands.d.ts.map +1 -1
- package/dist/core/slash-commands.js +7 -4
- package/dist/core/slash-commands.js.map +1 -1
- package/dist/core/source-info.d.ts +1 -1
- package/dist/core/source-info.d.ts.map +1 -1
- package/dist/core/source-info.js.map +1 -1
- package/dist/core/system-prompt.d.ts +4 -4
- package/dist/core/system-prompt.d.ts.map +1 -1
- package/dist/core/system-prompt.js +20 -16
- package/dist/core/system-prompt.js.map +1 -1
- package/dist/core/telemetry.d.ts +3 -0
- package/dist/core/telemetry.d.ts.map +1 -0
- package/dist/core/telemetry.js +9 -0
- package/dist/core/telemetry.js.map +1 -0
- package/dist/core/timings.d.ts +4 -2
- package/dist/core/timings.d.ts.map +1 -1
- package/dist/core/timings.js +24 -14
- package/dist/core/timings.js.map +1 -1
- package/dist/core/tools/bash.d.ts +11 -16
- package/dist/core/tools/bash.d.ts.map +1 -1
- package/dist/core/tools/bash.js +187 -178
- package/dist/core/tools/bash.js.map +1 -1
- package/dist/core/tools/edit-diff.d.ts +26 -5
- package/dist/core/tools/edit-diff.d.ts.map +1 -1
- package/dist/core/tools/edit-diff.js +110 -23
- package/dist/core/tools/edit-diff.js.map +1 -1
- package/dist/core/tools/edit.d.ts +22 -24
- package/dist/core/tools/edit.d.ts.map +1 -1
- package/dist/core/tools/edit.js +201 -113
- package/dist/core/tools/edit.js.map +1 -1
- package/dist/core/tools/file-mutation-queue.d.ts.map +1 -1
- package/dist/core/tools/file-mutation-queue.js +27 -12
- package/dist/core/tools/file-mutation-queue.js.map +1 -1
- package/dist/core/tools/find.d.ts +7 -18
- package/dist/core/tools/find.d.ts.map +1 -1
- package/dist/core/tools/find.js +148 -101
- package/dist/core/tools/find.js.map +1 -1
- package/dist/core/tools/grep.d.ts +11 -30
- package/dist/core/tools/grep.d.ts.map +1 -1
- package/dist/core/tools/grep.js +23 -12
- package/dist/core/tools/grep.js.map +1 -1
- package/dist/core/tools/index.d.ts +26 -101
- package/dist/core/tools/index.d.ts.map +1 -1
- package/dist/core/tools/index.js +78 -52
- package/dist/core/tools/index.js.map +1 -1
- package/dist/core/tools/ls.d.ts +6 -15
- package/dist/core/tools/ls.d.ts.map +1 -1
- package/dist/core/tools/ls.js +12 -17
- package/dist/core/tools/ls.js.map +1 -1
- package/dist/core/tools/output-accumulator.d.ts +52 -0
- package/dist/core/tools/output-accumulator.d.ts.map +1 -0
- package/dist/core/tools/output-accumulator.js +184 -0
- package/dist/core/tools/output-accumulator.js.map +1 -0
- package/dist/core/tools/path-utils.d.ts +2 -0
- package/dist/core/tools/path-utils.d.ts.map +1 -1
- package/dist/core/tools/path-utils.js +40 -22
- package/dist/core/tools/path-utils.js.map +1 -1
- package/dist/core/tools/read.d.ts +7 -18
- package/dist/core/tools/read.d.ts.map +1 -1
- package/dist/core/tools/read.js +103 -52
- package/dist/core/tools/read.js.map +1 -1
- package/dist/core/tools/render-utils.d.ts +5 -2
- package/dist/core/tools/render-utils.d.ts.map +1 -1
- package/dist/core/tools/render-utils.js +18 -2
- package/dist/core/tools/render-utils.js.map +1 -1
- package/dist/core/tools/tool-definition-wrapper.d.ts.map +1 -1
- package/dist/core/tools/tool-definition-wrapper.js +2 -0
- package/dist/core/tools/tool-definition-wrapper.js.map +1 -1
- package/dist/core/tools/truncate.d.ts.map +1 -1
- package/dist/core/tools/truncate.js +12 -2
- package/dist/core/tools/truncate.js.map +1 -1
- package/dist/core/tools/write.d.ts +5 -14
- package/dist/core/tools/write.d.ts.map +1 -1
- package/dist/core/tools/write.js +27 -46
- package/dist/core/tools/write.js.map +1 -1
- package/dist/core/trust-manager.d.ts +36 -0
- package/dist/core/trust-manager.d.ts.map +1 -0
- package/dist/core/trust-manager.js +202 -0
- package/dist/core/trust-manager.js.map +1 -0
- package/dist/index.d.ts +33 -29
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +12 -9
- package/dist/index.js.map +1 -1
- package/dist/main.d.ts +5 -1
- package/dist/main.d.ts.map +1 -1
- package/dist/main.js +208 -93
- package/dist/main.js.map +1 -1
- package/dist/migrations.d.ts +2 -2
- package/dist/migrations.d.ts.map +1 -1
- package/dist/migrations.js +4 -4
- package/dist/migrations.js.map +1 -1
- package/dist/modes/index.d.ts +5 -5
- package/dist/modes/index.d.ts.map +1 -1
- package/dist/modes/index.js.map +1 -1
- package/dist/modes/interactive/assets/clankolas.png +0 -0
- package/dist/modes/interactive/components/assistant-message.d.ts +5 -1
- package/dist/modes/interactive/components/assistant-message.d.ts.map +1 -1
- package/dist/modes/interactive/components/assistant-message.js +37 -15
- package/dist/modes/interactive/components/assistant-message.js.map +1 -1
- package/dist/modes/interactive/components/bash-execution.d.ts +1 -1
- package/dist/modes/interactive/components/bash-execution.d.ts.map +1 -1
- package/dist/modes/interactive/components/bash-execution.js +3 -3
- package/dist/modes/interactive/components/bash-execution.js.map +1 -1
- package/dist/modes/interactive/components/bordered-loader.d.ts.map +1 -1
- package/dist/modes/interactive/components/bordered-loader.js +3 -0
- package/dist/modes/interactive/components/bordered-loader.js.map +1 -1
- package/dist/modes/interactive/components/config-selector.d.ts +36 -5
- package/dist/modes/interactive/components/config-selector.d.ts.map +1 -1
- package/dist/modes/interactive/components/config-selector.js +318 -36
- package/dist/modes/interactive/components/config-selector.js.map +1 -1
- package/dist/modes/interactive/components/countdown-timer.d.ts +2 -2
- package/dist/modes/interactive/components/countdown-timer.d.ts.map +1 -1
- package/dist/modes/interactive/components/countdown-timer.js +2 -2
- package/dist/modes/interactive/components/countdown-timer.js.map +1 -1
- package/dist/modes/interactive/components/custom-editor.d.ts +1 -1
- package/dist/modes/interactive/components/custom-editor.d.ts.map +1 -1
- package/dist/modes/interactive/components/custom-editor.js.map +1 -1
- package/dist/modes/interactive/components/custom-entry.d.ts +19 -0
- package/dist/modes/interactive/components/custom-entry.d.ts.map +1 -0
- package/dist/modes/interactive/components/custom-entry.js +52 -0
- package/dist/modes/interactive/components/custom-entry.js.map +1 -0
- package/dist/modes/interactive/components/custom-message.d.ts +2 -2
- package/dist/modes/interactive/components/custom-message.d.ts.map +1 -1
- package/dist/modes/interactive/components/custom-message.js.map +1 -1
- package/dist/modes/interactive/components/diff.d.ts.map +1 -1
- package/dist/modes/interactive/components/diff.js.map +1 -1
- package/dist/modes/interactive/components/earendil-announcement.d.ts.map +1 -1
- package/dist/modes/interactive/components/earendil-announcement.js.map +1 -1
- package/dist/modes/interactive/components/extension-editor.d.ts +3 -1
- package/dist/modes/interactive/components/extension-editor.d.ts.map +1 -1
- package/dist/modes/interactive/components/extension-editor.js +26 -9
- package/dist/modes/interactive/components/extension-editor.js.map +1 -1
- package/dist/modes/interactive/components/extension-input.d.ts.map +1 -1
- package/dist/modes/interactive/components/extension-input.js.map +1 -1
- package/dist/modes/interactive/components/extension-selector.d.ts +2 -0
- package/dist/modes/interactive/components/extension-selector.d.ts.map +1 -1
- package/dist/modes/interactive/components/extension-selector.js +8 -3
- package/dist/modes/interactive/components/extension-selector.js.map +1 -1
- package/dist/modes/interactive/components/first-time-setup.d.ts +25 -0
- package/dist/modes/interactive/components/first-time-setup.d.ts.map +1 -0
- package/dist/modes/interactive/components/first-time-setup.js +103 -0
- package/dist/modes/interactive/components/first-time-setup.js.map +1 -0
- package/dist/modes/interactive/components/footer.d.ts +4 -3
- package/dist/modes/interactive/components/footer.d.ts.map +1 -1
- package/dist/modes/interactive/components/footer.js +27 -7
- package/dist/modes/interactive/components/footer.js.map +1 -1
- package/dist/modes/interactive/components/index.d.ts +33 -31
- package/dist/modes/interactive/components/index.d.ts.map +1 -1
- package/dist/modes/interactive/components/index.js +2 -0
- package/dist/modes/interactive/components/index.js.map +1 -1
- package/dist/modes/interactive/components/keybinding-hints.d.ts +5 -0
- package/dist/modes/interactive/components/keybinding-hints.d.ts.map +1 -1
- package/dist/modes/interactive/components/keybinding-hints.js +19 -5
- package/dist/modes/interactive/components/keybinding-hints.js.map +1 -1
- package/dist/modes/interactive/components/login-dialog.d.ts +12 -2
- package/dist/modes/interactive/components/login-dialog.d.ts.map +1 -1
- package/dist/modes/interactive/components/login-dialog.js +45 -11
- package/dist/modes/interactive/components/login-dialog.js.map +1 -1
- package/dist/modes/interactive/components/model-selector.d.ts +2 -2
- package/dist/modes/interactive/components/model-selector.d.ts.map +1 -1
- package/dist/modes/interactive/components/model-selector.js +10 -6
- package/dist/modes/interactive/components/model-selector.js.map +1 -1
- package/dist/modes/interactive/components/oauth-selector.d.ts +18 -6
- package/dist/modes/interactive/components/oauth-selector.d.ts.map +1 -1
- package/dist/modes/interactive/components/oauth-selector.js +93 -25
- package/dist/modes/interactive/components/oauth-selector.js.map +1 -1
- package/dist/modes/interactive/components/scoped-models-selector.d.ts +5 -12
- package/dist/modes/interactive/components/scoped-models-selector.d.ts.map +1 -1
- package/dist/modes/interactive/components/scoped-models-selector.js +49 -31
- package/dist/modes/interactive/components/scoped-models-selector.js.map +1 -1
- package/dist/modes/interactive/components/session-selector.d.ts +2 -2
- package/dist/modes/interactive/components/session-selector.d.ts.map +1 -1
- package/dist/modes/interactive/components/session-selector.js +33 -14
- package/dist/modes/interactive/components/session-selector.js.map +1 -1
- package/dist/modes/interactive/components/settings-selector.d.ts +17 -0
- package/dist/modes/interactive/components/settings-selector.d.ts.map +1 -1
- package/dist/modes/interactive/components/settings-selector.js +301 -20
- package/dist/modes/interactive/components/settings-selector.js.map +1 -1
- package/dist/modes/interactive/components/skill-invocation-message.d.ts +1 -1
- package/dist/modes/interactive/components/skill-invocation-message.d.ts.map +1 -1
- package/dist/modes/interactive/components/skill-invocation-message.js.map +1 -1
- package/dist/modes/interactive/components/status-indicator.d.ts +28 -0
- package/dist/modes/interactive/components/status-indicator.d.ts.map +1 -0
- package/dist/modes/interactive/components/status-indicator.js +60 -0
- package/dist/modes/interactive/components/status-indicator.js.map +1 -0
- package/dist/modes/interactive/components/thinking-selector.d.ts.map +1 -1
- package/dist/modes/interactive/components/thinking-selector.js +1 -1
- package/dist/modes/interactive/components/thinking-selector.js.map +1 -1
- package/dist/modes/interactive/components/tool-execution.d.ts +6 -1
- package/dist/modes/interactive/components/tool-execution.d.ts.map +1 -1
- package/dist/modes/interactive/components/tool-execution.js +57 -14
- package/dist/modes/interactive/components/tool-execution.js.map +1 -1
- package/dist/modes/interactive/components/tree-selector.d.ts +1 -1
- package/dist/modes/interactive/components/tree-selector.d.ts.map +1 -1
- package/dist/modes/interactive/components/tree-selector.js +137 -13
- package/dist/modes/interactive/components/tree-selector.js.map +1 -1
- package/dist/modes/interactive/components/trust-selector.d.ts +23 -0
- package/dist/modes/interactive/components/trust-selector.d.ts.map +1 -0
- package/dist/modes/interactive/components/trust-selector.js +91 -0
- package/dist/modes/interactive/components/trust-selector.js.map +1 -0
- package/dist/modes/interactive/components/user-message-selector.d.ts +2 -2
- package/dist/modes/interactive/components/user-message-selector.d.ts.map +1 -1
- package/dist/modes/interactive/components/user-message-selector.js +8 -7
- package/dist/modes/interactive/components/user-message-selector.js.map +1 -1
- package/dist/modes/interactive/components/user-message.d.ts +6 -1
- package/dist/modes/interactive/components/user-message.d.ts.map +1 -1
- package/dist/modes/interactive/components/user-message.js +22 -8
- package/dist/modes/interactive/components/user-message.js.map +1 -1
- package/dist/modes/interactive/interactive-mode.d.ts +76 -19
- package/dist/modes/interactive/interactive-mode.d.ts.map +1 -1
- package/dist/modes/interactive/interactive-mode.js +1294 -494
- package/dist/modes/interactive/interactive-mode.js.map +1 -1
- package/dist/modes/interactive/model-search.d.ts +12 -0
- package/dist/modes/interactive/model-search.d.ts.map +1 -0
- package/dist/modes/interactive/model-search.js +15 -0
- package/dist/modes/interactive/model-search.js.map +1 -0
- package/dist/modes/interactive/theme/dark.json +5 -4
- package/dist/modes/interactive/theme/light.json +5 -4
- package/dist/modes/interactive/theme/theme-controller.d.ts +29 -0
- package/dist/modes/interactive/theme/theme-controller.d.ts.map +1 -0
- package/dist/modes/interactive/theme/theme-controller.js +102 -0
- package/dist/modes/interactive/theme/theme-controller.js.map +1 -0
- package/dist/modes/interactive/theme/theme-schema.json +2 -1
- package/dist/modes/interactive/theme/theme.d.ts +41 -3
- package/dist/modes/interactive/theme/theme.d.ts.map +1 -1
- package/dist/modes/interactive/theme/theme.js +183 -106
- package/dist/modes/interactive/theme/theme.js.map +1 -1
- package/dist/modes/print-mode.d.ts.map +1 -1
- package/dist/modes/print-mode.js +40 -20
- package/dist/modes/print-mode.js.map +1 -1
- package/dist/modes/rpc/rpc-client.d.ts +30 -5
- package/dist/modes/rpc/rpc-client.d.ts.map +1 -1
- package/dist/modes/rpc/rpc-client.js +87 -8
- package/dist/modes/rpc/rpc-client.js.map +1 -1
- package/dist/modes/rpc/rpc-mode.d.ts +2 -2
- package/dist/modes/rpc/rpc-mode.d.ts.map +1 -1
- package/dist/modes/rpc/rpc-mode.js +113 -31
- package/dist/modes/rpc/rpc-mode.js.map +1 -1
- package/dist/modes/rpc/rpc-types.d.ts +42 -4
- 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 +504 -25
- package/dist/package-manager-cli.js.map +1 -1
- package/dist/prompts/commands/brainstorm.md +148 -0
- package/dist/prompts/commands/map-codebase.md +14 -0
- package/dist/rpc-entry.d.ts +3 -0
- package/dist/rpc-entry.d.ts.map +1 -0
- package/dist/rpc-entry.js +10 -0
- package/dist/rpc-entry.js.map +1 -0
- package/dist/utils/ansi.d.ts +2 -0
- package/dist/utils/ansi.d.ts.map +1 -0
- package/dist/utils/ansi.js +52 -0
- package/dist/utils/ansi.js.map +1 -0
- package/dist/utils/changelog.d.ts +2 -1
- 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/dist/utils/child-process.d.ts +12 -5
- package/dist/utils/child-process.d.ts.map +1 -1
- package/dist/utils/child-process.js +33 -5
- package/dist/utils/child-process.js.map +1 -1
- package/dist/utils/clipboard-image.d.ts.map +1 -1
- package/dist/utils/clipboard-image.js +2 -2
- package/dist/utils/clipboard-image.js.map +1 -1
- package/dist/utils/clipboard-native.d.ts +3 -1
- package/dist/utils/clipboard-native.d.ts.map +1 -1
- package/dist/utils/clipboard-native.js +14 -8
- package/dist/utils/clipboard-native.js.map +1 -1
- package/dist/utils/clipboard.d.ts.map +1 -1
- package/dist/utils/clipboard.js +84 -45
- package/dist/utils/clipboard.js.map +1 -1
- package/dist/utils/deprecation.d.ts +4 -0
- package/dist/utils/deprecation.d.ts.map +1 -0
- package/dist/utils/deprecation.js +13 -0
- package/dist/utils/deprecation.js.map +1 -0
- package/dist/utils/exif-orientation.d.ts +1 -1
- package/dist/utils/exif-orientation.d.ts.map +1 -1
- package/dist/utils/exif-orientation.js.map +1 -1
- package/dist/utils/fs-watch.d.ts +5 -0
- package/dist/utils/fs-watch.d.ts.map +1 -0
- package/dist/utils/fs-watch.js +25 -0
- package/dist/utils/fs-watch.js.map +1 -0
- package/dist/utils/git.d.ts.map +1 -1
- package/dist/utils/git.js +54 -22
- package/dist/utils/git.js.map +1 -1
- package/dist/utils/html.d.ts +7 -0
- package/dist/utils/html.d.ts.map +1 -0
- package/dist/utils/html.js +40 -0
- package/dist/utils/html.js.map +1 -0
- package/dist/utils/image-convert.d.ts +1 -0
- package/dist/utils/image-convert.d.ts.map +1 -1
- package/dist/utils/image-convert.js +21 -15
- package/dist/utils/image-convert.js.map +1 -1
- package/dist/utils/image-process.d.ts +18 -0
- package/dist/utils/image-process.d.ts.map +1 -0
- package/dist/utils/image-process.js +83 -0
- package/dist/utils/image-process.js.map +1 -0
- package/dist/utils/image-resize-core.d.ts +30 -0
- package/dist/utils/image-resize-core.d.ts.map +1 -0
- package/dist/utils/image-resize-core.js +124 -0
- package/dist/utils/image-resize-core.js.map +1 -0
- package/dist/utils/image-resize-worker.d.ts +2 -0
- package/dist/utils/image-resize-worker.d.ts.map +1 -0
- package/dist/utils/image-resize-worker.js +31 -0
- package/dist/utils/image-resize-worker.js.map +1 -0
- package/dist/utils/image-resize.d.ts +7 -27
- package/dist/utils/image-resize.d.ts.map +1 -1
- package/dist/utils/image-resize.js +75 -115
- package/dist/utils/image-resize.js.map +1 -1
- package/dist/utils/json.d.ts +3 -0
- package/dist/utils/json.d.ts.map +1 -0
- package/dist/utils/json.js +7 -0
- package/dist/utils/json.js.map +1 -0
- package/dist/utils/mime.d.ts +1 -0
- package/dist/utils/mime.d.ts.map +1 -1
- package/dist/utils/mime.js +100 -16
- package/dist/utils/mime.js.map +1 -1
- package/dist/utils/open-browser.d.ts +9 -0
- package/dist/utils/open-browser.d.ts.map +1 -0
- package/dist/utils/open-browser.js +22 -0
- package/dist/utils/open-browser.js.map +1 -0
- package/dist/utils/paths.d.ts +25 -1
- package/dist/utils/paths.d.ts.map +1 -1
- package/dist/utils/paths.js +75 -2
- package/dist/utils/paths.js.map +1 -1
- package/dist/utils/pi-user-agent.d.ts +2 -0
- package/dist/utils/pi-user-agent.d.ts.map +1 -0
- package/dist/utils/pi-user-agent.js +5 -0
- package/dist/utils/pi-user-agent.js.map +1 -0
- package/dist/utils/shell.d.ts +11 -6
- package/dist/utils/shell.d.ts.map +1 -1
- package/dist/utils/shell.js +42 -26
- package/dist/utils/shell.js.map +1 -1
- package/dist/utils/syntax-highlight.d.ts +12 -0
- package/dist/utils/syntax-highlight.d.ts.map +1 -0
- package/dist/utils/syntax-highlight.js +118 -0
- package/dist/utils/syntax-highlight.js.map +1 -0
- package/dist/utils/tools-manager.d.ts.map +1 -1
- package/dist/utils/tools-manager.js +86 -10
- package/dist/utils/tools-manager.js.map +1 -1
- package/dist/utils/version-check.d.ts +15 -0
- package/dist/utils/version-check.d.ts.map +1 -0
- package/dist/utils/version-check.js +59 -0
- package/dist/utils/version-check.js.map +1 -0
- package/dist/utils/windows-self-update.d.ts +3 -0
- package/dist/utils/windows-self-update.d.ts.map +1 -0
- package/dist/utils/windows-self-update.js +77 -0
- package/dist/utils/windows-self-update.js.map +1 -0
- package/docs/compaction.md +12 -12
- package/docs/containerization.md +111 -0
- package/docs/custom-provider.md +187 -47
- package/docs/development.md +5 -5
- package/docs/docs.json +156 -0
- package/docs/extensions.md +520 -79
- package/docs/index.md +82 -0
- package/docs/json.md +4 -4
- package/docs/keybindings.md +24 -2
- package/docs/models.md +119 -17
- package/docs/packages.md +19 -11
- package/docs/prompt-templates.md +30 -2
- package/docs/providers.md +85 -23
- package/docs/quickstart.md +165 -0
- package/docs/rpc.md +99 -10
- package/docs/sdk.md +118 -50
- package/docs/security.md +55 -0
- package/docs/{session.md → session-format.md} +29 -19
- package/docs/sessions.md +145 -0
- package/docs/settings.md +71 -11
- package/docs/skills.md +16 -17
- package/docs/terminal-setup.md +44 -2
- package/docs/termux.md +4 -4
- package/docs/themes.md +3 -3
- package/docs/tmux.md +4 -2
- package/docs/tui.md +44 -4
- package/docs/usage.md +305 -0
- package/examples/extensions/README.md +1 -0
- package/examples/extensions/border-status-editor.ts +145 -0
- package/examples/extensions/built-in-tool-renderer.ts +3 -0
- package/examples/extensions/custom-compaction.ts +2 -1
- package/examples/extensions/custom-header.ts +1 -1
- package/examples/extensions/custom-provider-anthropic/index.ts +2 -2
- package/examples/extensions/custom-provider-anthropic/package-lock.json +2 -2
- package/examples/extensions/custom-provider-anthropic/package.json +2 -2
- package/examples/extensions/custom-provider-gitlab-duo/index.ts +63 -8
- package/examples/extensions/custom-provider-gitlab-duo/package.json +1 -1
- package/examples/extensions/custom-provider-gitlab-duo/test.ts +2 -2
- package/examples/extensions/doom-overlay/doom-component.ts +2 -2
- package/examples/extensions/doom-overlay/index.ts +1 -1
- package/examples/extensions/dynamic-resources/dynamic.json +1 -1
- package/examples/extensions/dynamic-tools.ts +2 -2
- package/examples/extensions/entry-renderer.ts +41 -0
- package/examples/extensions/git-merge-and-resolve.ts +115 -0
- package/examples/extensions/github-issue-autocomplete.ts +185 -0
- package/examples/extensions/gondolin/index.ts +531 -0
- package/examples/extensions/gondolin/package-lock.json +185 -0
- package/examples/extensions/gondolin/package.json +19 -0
- package/examples/extensions/handoff.ts +52 -14
- package/examples/extensions/input-transform-streaming.ts +39 -0
- package/examples/extensions/interactive-shell.ts +1 -1
- package/examples/extensions/notify.ts +2 -9
- package/examples/extensions/overlay-qa-tests.ts +240 -138
- package/examples/extensions/overlay-test.ts +7 -4
- package/examples/extensions/plan-mode/index.ts +87 -37
- package/examples/extensions/plan-mode/utils.ts +1 -1
- package/examples/extensions/preset.ts +46 -7
- package/examples/extensions/project-trust.ts +64 -0
- package/examples/extensions/prompt-customizer.ts +97 -0
- package/examples/extensions/provider-payload.ts +8 -4
- package/examples/extensions/qna.ts +3 -3
- package/examples/extensions/question.ts +34 -20
- package/examples/extensions/questionnaire.ts +43 -30
- package/examples/extensions/reload-runtime.ts +1 -1
- package/examples/extensions/sandbox/index.ts +6 -6
- package/examples/extensions/sandbox/package-lock.json +5 -5
- package/examples/extensions/sandbox/package.json +2 -2
- package/examples/extensions/shutdown-command.ts +1 -1
- package/examples/extensions/snake.ts +1 -1
- package/examples/extensions/space-invaders.ts +1 -1
- package/examples/extensions/structured-output.ts +65 -0
- package/examples/extensions/subagent/agents.ts +2 -2
- package/examples/extensions/subagent/index.ts +58 -29
- package/examples/extensions/summarize.ts +3 -2
- package/examples/extensions/tic-tac-toe.ts +1008 -0
- package/examples/extensions/titlebar-spinner.ts +2 -2
- package/examples/extensions/todo.ts +2 -2
- package/examples/extensions/tool-override.ts +1 -1
- package/examples/extensions/tools.ts +5 -0
- package/examples/extensions/truncated-tool.ts +1 -1
- package/examples/extensions/with-deps/index.ts +1 -1
- package/examples/extensions/with-deps/package-lock.json +2 -2
- package/examples/extensions/with-deps/package.json +3 -3
- package/examples/extensions/working-indicator.ts +123 -0
- package/examples/extensions/working-message-test.ts +25 -0
- package/examples/sdk/01-minimal.ts +14 -10
- package/examples/sdk/02-custom-model.ts +13 -9
- package/examples/sdk/03-custom-prompt.ts +32 -17
- package/examples/sdk/04-skills.ts +5 -2
- package/examples/sdk/05-tools.ts +23 -31
- package/examples/sdk/06-extensions.ts +14 -8
- package/examples/sdk/07-context-files.ts +5 -3
- package/examples/sdk/08-prompt-templates.ts +5 -2
- package/examples/sdk/09-api-keys-and-oauth.ts +8 -4
- package/examples/sdk/10-settings.ts +8 -6
- package/examples/sdk/11-sessions.ts +4 -0
- package/examples/sdk/12-full-control.ts +15 -19
- package/package.json +22 -16
- package/prompts/commands/brainstorm.md +148 -0
- package/prompts/commands/map-codebase.md +14 -0
package/docs/providers.md
CHANGED
|
@@ -15,36 +15,31 @@ Pi supports subscription-based providers via OAuth and API key providers via env
|
|
|
15
15
|
|
|
16
16
|
Use `/login` in interactive mode, then select a provider:
|
|
17
17
|
|
|
18
|
-
- Claude Pro/Max
|
|
19
18
|
- ChatGPT Plus/Pro (Codex)
|
|
19
|
+
- Claude Pro/Max
|
|
20
20
|
- GitHub Copilot
|
|
21
|
-
- Google Gemini CLI
|
|
22
|
-
- Google Antigravity
|
|
23
21
|
|
|
24
22
|
Use `/logout` to clear credentials. Tokens are stored in `~/.pi/agent/auth.json` and auto-refresh when expired.
|
|
25
23
|
|
|
26
|
-
###
|
|
24
|
+
### OpenAI Codex
|
|
27
25
|
|
|
28
|
-
-
|
|
29
|
-
-
|
|
26
|
+
- Requires ChatGPT Plus or Pro subscription
|
|
27
|
+
- Officially endorsed by OpenAI: [Codex for OSS](https://developers.openai.com/community/codex-for-oss)
|
|
30
28
|
|
|
31
|
-
###
|
|
29
|
+
### Claude Pro/Max
|
|
32
30
|
|
|
33
|
-
-
|
|
34
|
-
- **Antigravity**: Sandbox with Gemini 3, Claude, and GPT-OSS models
|
|
35
|
-
- Both free with any Google account, subject to rate limits
|
|
36
|
-
- For paid Cloud Code Assist: set `GOOGLE_CLOUD_PROJECT` env var
|
|
31
|
+
Anthropic subscription auth is active for Claude Pro/Max accounts. Third-party harness usage draws from [extra usage](https://claude.ai/settings/usage) and is billed per token, not against Claude plan limits.
|
|
37
32
|
|
|
38
|
-
###
|
|
33
|
+
### GitHub Copilot
|
|
39
34
|
|
|
40
|
-
-
|
|
41
|
-
-
|
|
35
|
+
- Press Enter for github.com, or enter your GitHub Enterprise Server domain
|
|
36
|
+
- If you get "model not supported", enable it in VS Code: Copilot Chat → model selector → select model → "Enable"
|
|
42
37
|
|
|
43
38
|
## API Keys
|
|
44
39
|
|
|
45
40
|
### Environment Variables or Auth File
|
|
46
41
|
|
|
47
|
-
|
|
42
|
+
Use `/login` in interactive mode and select a provider to store an API key in `auth.json`, or set credentials via environment variable:
|
|
48
43
|
|
|
49
44
|
```bash
|
|
50
45
|
export ANTHROPIC_API_KEY=sk-ant-...
|
|
@@ -54,24 +49,36 @@ pi
|
|
|
54
49
|
| Provider | Environment Variable | `auth.json` key |
|
|
55
50
|
|----------|----------------------|------------------|
|
|
56
51
|
| Anthropic | `ANTHROPIC_API_KEY` | `anthropic` |
|
|
52
|
+
| Ant Ling | `ANT_LING_API_KEY` | `ant-ling` |
|
|
57
53
|
| Azure OpenAI Responses | `AZURE_OPENAI_API_KEY` | `azure-openai-responses` |
|
|
58
54
|
| OpenAI | `OPENAI_API_KEY` | `openai` |
|
|
55
|
+
| DeepSeek | `DEEPSEEK_API_KEY` | `deepseek` |
|
|
56
|
+
| NVIDIA NIM | `NVIDIA_API_KEY` | `nvidia` |
|
|
59
57
|
| Google Gemini | `GEMINI_API_KEY` | `google` |
|
|
60
58
|
| Mistral | `MISTRAL_API_KEY` | `mistral` |
|
|
61
59
|
| Groq | `GROQ_API_KEY` | `groq` |
|
|
62
60
|
| Cerebras | `CEREBRAS_API_KEY` | `cerebras` |
|
|
61
|
+
| Cloudflare AI Gateway | `CLOUDFLARE_API_KEY` (+ `CLOUDFLARE_ACCOUNT_ID`, `CLOUDFLARE_GATEWAY_ID`) | `cloudflare-ai-gateway` |
|
|
62
|
+
| Cloudflare Workers AI | `CLOUDFLARE_API_KEY` (+ `CLOUDFLARE_ACCOUNT_ID`) | `cloudflare-workers-ai` |
|
|
63
63
|
| xAI | `XAI_API_KEY` | `xai` |
|
|
64
64
|
| OpenRouter | `OPENROUTER_API_KEY` | `openrouter` |
|
|
65
65
|
| Vercel AI Gateway | `AI_GATEWAY_API_KEY` | `vercel-ai-gateway` |
|
|
66
66
|
| ZAI | `ZAI_API_KEY` | `zai` |
|
|
67
|
+
| ZAI Coding Plan (China) | `ZAI_CODING_CN_API_KEY` | `zai-coding-cn` |
|
|
67
68
|
| OpenCode Zen | `OPENCODE_API_KEY` | `opencode` |
|
|
68
69
|
| OpenCode Go | `OPENCODE_API_KEY` | `opencode-go` |
|
|
69
70
|
| Hugging Face | `HF_TOKEN` | `huggingface` |
|
|
71
|
+
| Fireworks | `FIREWORKS_API_KEY` | `fireworks` |
|
|
72
|
+
| Together AI | `TOGETHER_API_KEY` | `together` |
|
|
70
73
|
| Kimi For Coding | `KIMI_API_KEY` | `kimi-coding` |
|
|
71
74
|
| MiniMax | `MINIMAX_API_KEY` | `minimax` |
|
|
72
75
|
| MiniMax (China) | `MINIMAX_CN_API_KEY` | `minimax-cn` |
|
|
76
|
+
| Xiaomi MiMo | `XIAOMI_API_KEY` | `xiaomi` |
|
|
77
|
+
| Xiaomi MiMo Token Plan (China) | `XIAOMI_TOKEN_PLAN_CN_API_KEY` | `xiaomi-token-plan-cn` |
|
|
78
|
+
| Xiaomi MiMo Token Plan (Amsterdam) | `XIAOMI_TOKEN_PLAN_AMS_API_KEY` | `xiaomi-token-plan-ams` |
|
|
79
|
+
| Xiaomi MiMo Token Plan (Singapore) | `XIAOMI_TOKEN_PLAN_SGP_API_KEY` | `xiaomi-token-plan-sgp` |
|
|
73
80
|
|
|
74
|
-
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/earendil-works/pi-mono/blob/main/packages/ai/src/env-api-keys.ts) in [`packages/ai/src/env-api-keys.ts`](https://github.com/earendil-works/pi-mono/blob/main/packages/ai/src/env-api-keys.ts).
|
|
75
82
|
|
|
76
83
|
#### Auth File
|
|
77
84
|
|
|
@@ -80,10 +87,18 @@ Store credentials in `~/.pi/agent/auth.json`:
|
|
|
80
87
|
```json
|
|
81
88
|
{
|
|
82
89
|
"anthropic": { "type": "api_key", "key": "sk-ant-..." },
|
|
90
|
+
"ant-ling": { "type": "api_key", "key": "..." },
|
|
83
91
|
"openai": { "type": "api_key", "key": "sk-..." },
|
|
92
|
+
"deepseek": { "type": "api_key", "key": "sk-..." },
|
|
93
|
+
"nvidia": { "type": "api_key", "key": "nvapi-..." },
|
|
84
94
|
"google": { "type": "api_key", "key": "..." },
|
|
85
95
|
"opencode": { "type": "api_key", "key": "..." },
|
|
86
|
-
"opencode-go": { "type": "api_key", "key": "..." }
|
|
96
|
+
"opencode-go": { "type": "api_key", "key": "..." },
|
|
97
|
+
"together": { "type": "api_key", "key": "..." },
|
|
98
|
+
"xiaomi": { "type": "api_key", "key": "..." },
|
|
99
|
+
"xiaomi-token-plan-cn": { "type": "api_key", "key": "..." },
|
|
100
|
+
"xiaomi-token-plan-ams": { "type": "api_key", "key": "..." },
|
|
101
|
+
"xiaomi-token-plan-sgp": { "type": "api_key", "key": "..." }
|
|
87
102
|
}
|
|
88
103
|
```
|
|
89
104
|
|
|
@@ -91,23 +106,31 @@ The file is created with `0600` permissions (user read/write only). Auth file cr
|
|
|
91
106
|
|
|
92
107
|
### Key Resolution
|
|
93
108
|
|
|
94
|
-
The `key` field supports
|
|
109
|
+
The `key` field supports command execution, environment interpolation, and literals:
|
|
95
110
|
|
|
96
|
-
- **Shell command:** `"!command"` executes and uses stdout (cached for process lifetime)
|
|
111
|
+
- **Shell command:** `"!command"` at the start executes the whole value as a command and uses stdout (cached for process lifetime)
|
|
97
112
|
```json
|
|
98
113
|
{ "type": "api_key", "key": "!security find-generic-password -ws 'anthropic'" }
|
|
99
114
|
{ "type": "api_key", "key": "!op read 'op://vault/item/credential'" }
|
|
100
115
|
```
|
|
101
|
-
- **Environment
|
|
116
|
+
- **Environment interpolation:** `"$ENV_VAR"` or `"${ENV_VAR}"` uses the value of the named variable. Interpolation works inside larger literals.
|
|
102
117
|
```json
|
|
103
|
-
{ "type": "api_key", "key": "MY_ANTHROPIC_KEY" }
|
|
118
|
+
{ "type": "api_key", "key": "$MY_ANTHROPIC_KEY" }
|
|
119
|
+
{ "type": "api_key", "key": "${KEY_PREFIX}_${KEY_SUFFIX}" }
|
|
120
|
+
```
|
|
121
|
+
`$FOO_BAR` is the variable `FOO_BAR`; use `${FOO}_BAR` when `BAR` is literal text. Missing environment variables make the value unresolved.
|
|
122
|
+
- **Escapes:** `"$$"` emits a literal `"$"`; `"$!"` emits a literal `"!"` without triggering command execution.
|
|
123
|
+
```json
|
|
124
|
+
{ "type": "api_key", "key": "$$literal-dollar-prefix" }
|
|
125
|
+
{ "type": "api_key", "key": "$!literal-bang-prefix" }
|
|
104
126
|
```
|
|
105
127
|
- **Literal value:** Used directly
|
|
106
128
|
```json
|
|
107
129
|
{ "type": "api_key", "key": "sk-ant-..." }
|
|
130
|
+
{ "type": "api_key", "key": "public" }
|
|
108
131
|
```
|
|
109
132
|
|
|
110
|
-
OAuth credentials are also stored here after `/login` and managed automatically.
|
|
133
|
+
Legacy uppercase env-var-like values such as `MY_API_KEY` are migrated to `$MY_API_KEY` on startup. OAuth credentials are also stored here after `/login` and managed automatically.
|
|
111
134
|
|
|
112
135
|
## Cloud Providers
|
|
113
136
|
|
|
@@ -115,7 +138,10 @@ OAuth credentials are also stored here after `/login` and managed automatically.
|
|
|
115
138
|
|
|
116
139
|
```bash
|
|
117
140
|
export AZURE_OPENAI_API_KEY=...
|
|
118
|
-
export AZURE_OPENAI_BASE_URL=https://your-resource.
|
|
141
|
+
export AZURE_OPENAI_BASE_URL=https://your-resource.ai.azure.com
|
|
142
|
+
# also supported: https://your-resource.cognitiveservices.azure.com
|
|
143
|
+
# also supported: https://your-resource.openai.azure.com
|
|
144
|
+
# root endpoints are auto-normalized to /openai/v1
|
|
119
145
|
# or use resource name instead of base URL
|
|
120
146
|
export AZURE_OPENAI_RESOURCE_NAME=your-resource
|
|
121
147
|
|
|
@@ -167,6 +193,42 @@ export AWS_BEDROCK_SKIP_AUTH=1
|
|
|
167
193
|
export AWS_BEDROCK_FORCE_HTTP1=1
|
|
168
194
|
```
|
|
169
195
|
|
|
196
|
+
### Cloudflare AI Gateway
|
|
197
|
+
|
|
198
|
+
`CLOUDFLARE_API_KEY` can be set via `/login`. The account ID and gateway slug must be set as environment variables.
|
|
199
|
+
|
|
200
|
+
```bash
|
|
201
|
+
export CLOUDFLARE_API_KEY=... # or use /login
|
|
202
|
+
export CLOUDFLARE_ACCOUNT_ID=...
|
|
203
|
+
export CLOUDFLARE_GATEWAY_ID=... # create at dash.cloudflare.com → AI → AI Gateway
|
|
204
|
+
pi --provider cloudflare-ai-gateway --model "claude-sonnet-4-5"
|
|
205
|
+
```
|
|
206
|
+
|
|
207
|
+
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`.
|
|
208
|
+
|
|
209
|
+
AI Gateway authentication uses `CLOUDFLARE_API_KEY` as `cf-aig-authorization`. Upstream authentication can be one of:
|
|
210
|
+
|
|
211
|
+
| Mode | Request auth | Upstream auth |
|
|
212
|
+
|------|--------------|---------------|
|
|
213
|
+
| Workers AI | Cloudflare token only | Cloudflare-native |
|
|
214
|
+
| Unified billing | Cloudflare token only | Cloudflare handles upstream auth and deducts credits |
|
|
215
|
+
| Stored BYOK | Cloudflare token only | Cloudflare injects provider keys stored in the AI Gateway dashboard |
|
|
216
|
+
| Inline BYOK | Cloudflare token plus upstream `Authorization` header | The request supplies the upstream provider key |
|
|
217
|
+
|
|
218
|
+
For normal pi 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.
|
|
219
|
+
|
|
220
|
+
### Cloudflare Workers AI
|
|
221
|
+
|
|
222
|
+
`CLOUDFLARE_API_KEY` can be set via `/login`. `CLOUDFLARE_ACCOUNT_ID` must be set as an environment variable.
|
|
223
|
+
|
|
224
|
+
```bash
|
|
225
|
+
export CLOUDFLARE_API_KEY=... # or use /login
|
|
226
|
+
export CLOUDFLARE_ACCOUNT_ID=...
|
|
227
|
+
pi --provider cloudflare-workers-ai --model "@cf/moonshotai/kimi-k2.6"
|
|
228
|
+
```
|
|
229
|
+
|
|
230
|
+
Pi automatically sets `x-session-affinity` for [prefix caching](https://developers.cloudflare.com/workers-ai/features/prompt-caching/) discounts.
|
|
231
|
+
|
|
170
232
|
### Google Vertex AI
|
|
171
233
|
|
|
172
234
|
Uses Application Default Credentials:
|
|
@@ -0,0 +1,165 @@
|
|
|
1
|
+
# Quickstart
|
|
2
|
+
|
|
3
|
+
This page gets you from install to a useful first pi session.
|
|
4
|
+
|
|
5
|
+
## Install
|
|
6
|
+
|
|
7
|
+
Pi is distributed as an npm package:
|
|
8
|
+
|
|
9
|
+
```bash
|
|
10
|
+
npm install -g --ignore-scripts @draht/coding-agent
|
|
11
|
+
```
|
|
12
|
+
|
|
13
|
+
`--ignore-scripts` disables dependency lifecycle scripts during install. Pi does not require install scripts for normal npm installs.
|
|
14
|
+
|
|
15
|
+
### Uninstall
|
|
16
|
+
|
|
17
|
+
Use the package manager that installed pi. The curl installer uses npm globally, so curl and npm installs are removed with npm:
|
|
18
|
+
|
|
19
|
+
```bash
|
|
20
|
+
# curl installer or npm install -g
|
|
21
|
+
npm uninstall -g @draht/coding-agent
|
|
22
|
+
|
|
23
|
+
# pnpm
|
|
24
|
+
pnpm remove -g @draht/coding-agent
|
|
25
|
+
|
|
26
|
+
# Yarn
|
|
27
|
+
yarn global remove @draht/coding-agent
|
|
28
|
+
|
|
29
|
+
# Bun
|
|
30
|
+
bun uninstall -g @draht/coding-agent
|
|
31
|
+
```
|
|
32
|
+
|
|
33
|
+
Uninstalling pi leaves settings, credentials, sessions, and installed pi packages in `~/.pi/agent/`.
|
|
34
|
+
|
|
35
|
+
Then start pi in the project directory you want it to work on:
|
|
36
|
+
|
|
37
|
+
```bash
|
|
38
|
+
cd /path/to/project
|
|
39
|
+
pi
|
|
40
|
+
```
|
|
41
|
+
|
|
42
|
+
## Authenticate
|
|
43
|
+
|
|
44
|
+
Pi can use subscription providers through `/login`, or API-key providers through environment variables or the auth file.
|
|
45
|
+
|
|
46
|
+
### Option 1: subscription login
|
|
47
|
+
|
|
48
|
+
Start pi and run:
|
|
49
|
+
|
|
50
|
+
```text
|
|
51
|
+
/login
|
|
52
|
+
```
|
|
53
|
+
|
|
54
|
+
Then select a provider. Built-in subscription logins include Claude Pro/Max, ChatGPT Plus/Pro (Codex), and GitHub Copilot.
|
|
55
|
+
|
|
56
|
+
### Option 2: API key
|
|
57
|
+
|
|
58
|
+
Set an API key before launching pi:
|
|
59
|
+
|
|
60
|
+
```bash
|
|
61
|
+
export ANTHROPIC_API_KEY=sk-ant-...
|
|
62
|
+
pi
|
|
63
|
+
```
|
|
64
|
+
|
|
65
|
+
You can also run `/login` and select an API-key provider to store the key in `~/.pi/agent/auth.json`.
|
|
66
|
+
|
|
67
|
+
See [Providers](providers.md) for all supported providers, environment variables, and cloud-provider setup.
|
|
68
|
+
|
|
69
|
+
## First session
|
|
70
|
+
|
|
71
|
+
Once pi starts, type a request and press Enter:
|
|
72
|
+
|
|
73
|
+
```text
|
|
74
|
+
Summarize this repository and tell me how to run its checks.
|
|
75
|
+
```
|
|
76
|
+
|
|
77
|
+
By default, pi gives the model four tools:
|
|
78
|
+
|
|
79
|
+
- `read` - read files
|
|
80
|
+
- `write` - create or overwrite files
|
|
81
|
+
- `edit` - patch files
|
|
82
|
+
- `bash` - run shell commands
|
|
83
|
+
|
|
84
|
+
Additional built-in read-only tools (`grep`, `find`, `ls`) are available through tool options. Pi runs in your current working directory and can modify files there. Use git or another checkpointing workflow if you want easy rollback.
|
|
85
|
+
|
|
86
|
+
## Give pi project instructions
|
|
87
|
+
|
|
88
|
+
Pi loads context files at startup. Add an `AGENTS.md` file to tell it how to work in a project:
|
|
89
|
+
|
|
90
|
+
```markdown
|
|
91
|
+
# Project Instructions
|
|
92
|
+
|
|
93
|
+
- Run `npm run check` after code changes.
|
|
94
|
+
- Do not run production migrations locally.
|
|
95
|
+
- Keep responses concise.
|
|
96
|
+
```
|
|
97
|
+
|
|
98
|
+
Pi loads:
|
|
99
|
+
|
|
100
|
+
- `~/.pi/agent/AGENTS.md` for global instructions
|
|
101
|
+
- `AGENTS.md` or `CLAUDE.md` from parent directories and the current directory
|
|
102
|
+
|
|
103
|
+
Restart pi, or run `/reload`, after changing context files.
|
|
104
|
+
|
|
105
|
+
## Common things to try
|
|
106
|
+
|
|
107
|
+
### Reference files
|
|
108
|
+
|
|
109
|
+
Type `@` in the editor to fuzzy-search files, or pass files on the command line:
|
|
110
|
+
|
|
111
|
+
```bash
|
|
112
|
+
pi @README.md "Summarize this"
|
|
113
|
+
pi @src/app.ts @src/app.test.ts "Review these together"
|
|
114
|
+
```
|
|
115
|
+
|
|
116
|
+
Images can be pasted with Ctrl+V (Alt+V on Windows) or dragged into supported terminals.
|
|
117
|
+
|
|
118
|
+
### Run shell commands
|
|
119
|
+
|
|
120
|
+
In interactive mode:
|
|
121
|
+
|
|
122
|
+
```text
|
|
123
|
+
!npm run lint
|
|
124
|
+
```
|
|
125
|
+
|
|
126
|
+
The command output is sent to the model. Use `!!command` to run a command without adding its output to the model context.
|
|
127
|
+
|
|
128
|
+
### Switch models
|
|
129
|
+
|
|
130
|
+
Use `/model` or Ctrl+L to choose a model. Use Shift+Tab to cycle thinking level. Use Ctrl+P / Shift+Ctrl+P to cycle through scoped models.
|
|
131
|
+
|
|
132
|
+
### Continue later
|
|
133
|
+
|
|
134
|
+
Sessions are saved automatically:
|
|
135
|
+
|
|
136
|
+
```bash
|
|
137
|
+
pi -c # Continue most recent session
|
|
138
|
+
pi -r # Browse previous sessions
|
|
139
|
+
pi --name "my task" # Set session display name at startup
|
|
140
|
+
pi --session <path|id> # Open a specific session
|
|
141
|
+
```
|
|
142
|
+
|
|
143
|
+
Inside pi, use `/resume`, `/new`, `/tree`, `/fork`, and `/clone` to manage sessions.
|
|
144
|
+
|
|
145
|
+
### Non-interactive mode
|
|
146
|
+
|
|
147
|
+
For one-shot prompts:
|
|
148
|
+
|
|
149
|
+
```bash
|
|
150
|
+
pi -p "Summarize this codebase"
|
|
151
|
+
cat README.md | pi -p "Summarize this text"
|
|
152
|
+
pi -p @screenshot.png "What's in this image?"
|
|
153
|
+
```
|
|
154
|
+
|
|
155
|
+
Use `--mode json` for JSON event output or `--mode rpc` for process integration.
|
|
156
|
+
|
|
157
|
+
## Next steps
|
|
158
|
+
|
|
159
|
+
- [Using Pi](usage.md) - interactive mode, slash commands, sessions, context files, and CLI reference.
|
|
160
|
+
- [Providers](providers.md) - authentication and model setup.
|
|
161
|
+
- [Settings](settings.md) - global and project configuration.
|
|
162
|
+
- [Keybindings](keybindings.md) - shortcuts and customization.
|
|
163
|
+
- [Pi Packages](packages.md) - install shared extensions, skills, prompts, and themes.
|
|
164
|
+
|
|
165
|
+
Platform notes: [Windows](windows.md), [Termux](termux.md), [tmux](tmux.md), [Terminal setup](terminal-setup.md), [Shell aliases](shell-aliases.md).
|
package/docs/rpc.md
CHANGED
|
@@ -13,6 +13,7 @@ pi --mode rpc [options]
|
|
|
13
13
|
Common options:
|
|
14
14
|
- `--provider <name>`: Set the LLM provider (anthropic, openai, google, etc.)
|
|
15
15
|
- `--model <pattern>`: Model pattern or ID (supports `provider/id` and optional `:<thinking>`)
|
|
16
|
+
- `--name <name>` / `-n <name>`: Set the session display name at startup
|
|
16
17
|
- `--no-session`: Disable session persistence
|
|
17
18
|
- `--session-dir <path>`: Custom session storage directory
|
|
18
19
|
|
|
@@ -41,7 +42,7 @@ In particular, Node `readline` is not protocol-compliant for RPC mode because it
|
|
|
41
42
|
|
|
42
43
|
#### prompt
|
|
43
44
|
|
|
44
|
-
Send a user prompt to the agent.
|
|
45
|
+
Send a user prompt to the agent. The command response is emitted after the prompt is accepted, queued, or handled. Events continue streaming asynchronously after acceptance.
|
|
45
46
|
|
|
46
47
|
```json
|
|
47
48
|
{"id": "req-1", "type": "prompt", "message": "Hello, world!"}
|
|
@@ -72,6 +73,8 @@ Response:
|
|
|
72
73
|
{"id": "req-1", "type": "response", "command": "prompt", "success": true}
|
|
73
74
|
```
|
|
74
75
|
|
|
76
|
+
`success: true` means the prompt was accepted, queued, or handled immediately. `success: false` means the prompt was rejected before acceptance. Failures after acceptance are reported through the normal event and message stream, not as a second `response` for the same request id.
|
|
77
|
+
|
|
75
78
|
The `images` field is optional. Each image uses `ImageContent` format: `{"type": "image", "data": "base64-encoded-data", "mimeType": "image/png"}`.
|
|
76
79
|
|
|
77
80
|
#### steer
|
|
@@ -464,13 +467,13 @@ The `bash` command executes immediately and returns a `BashResult`. Internally,
|
|
|
464
467
|
|
|
465
468
|
When the next `prompt` command is sent, all messages (including `BashExecutionMessage`) are transformed before being sent to the LLM. The `BashExecutionMessage` is converted to a `UserMessage` with this format:
|
|
466
469
|
|
|
467
|
-
|
|
470
|
+
````
|
|
468
471
|
Ran `ls -la`
|
|
469
|
-
|
|
472
|
+
```
|
|
470
473
|
total 48
|
|
471
474
|
drwxr-xr-x ...
|
|
472
|
-
\`\`\`
|
|
473
475
|
```
|
|
476
|
+
````
|
|
474
477
|
|
|
475
478
|
This means:
|
|
476
479
|
1. Bash output is included in the LLM context on the **next prompt**, not immediately
|
|
@@ -578,7 +581,7 @@ If an extension cancelled the switch:
|
|
|
578
581
|
|
|
579
582
|
#### fork
|
|
580
583
|
|
|
581
|
-
Create a new fork from a previous user message. Can be cancelled by a `session_before_fork` extension event handler. Returns the text of the message being forked from.
|
|
584
|
+
Create a new fork from a previous user message on the active branch. Can be cancelled by a `session_before_fork` extension event handler. Returns the text of the message being forked from.
|
|
582
585
|
|
|
583
586
|
```json
|
|
584
587
|
{"type": "fork", "entryId": "abc123"}
|
|
@@ -604,6 +607,34 @@ If an extension cancelled the fork:
|
|
|
604
607
|
}
|
|
605
608
|
```
|
|
606
609
|
|
|
610
|
+
#### clone
|
|
611
|
+
|
|
612
|
+
Duplicate the current active branch into a new session at the current position. Can be cancelled by a `session_before_fork` extension event handler.
|
|
613
|
+
|
|
614
|
+
```json
|
|
615
|
+
{"type": "clone"}
|
|
616
|
+
```
|
|
617
|
+
|
|
618
|
+
Response:
|
|
619
|
+
```json
|
|
620
|
+
{
|
|
621
|
+
"type": "response",
|
|
622
|
+
"command": "clone",
|
|
623
|
+
"success": true,
|
|
624
|
+
"data": {"cancelled": false}
|
|
625
|
+
}
|
|
626
|
+
```
|
|
627
|
+
|
|
628
|
+
If an extension cancelled the clone:
|
|
629
|
+
```json
|
|
630
|
+
{
|
|
631
|
+
"type": "response",
|
|
632
|
+
"command": "clone",
|
|
633
|
+
"success": true,
|
|
634
|
+
"data": {"cancelled": true}
|
|
635
|
+
}
|
|
636
|
+
```
|
|
637
|
+
|
|
607
638
|
#### get_fork_messages
|
|
608
639
|
|
|
609
640
|
Get user messages available for forking.
|
|
@@ -627,6 +658,64 @@ Response:
|
|
|
627
658
|
}
|
|
628
659
|
```
|
|
629
660
|
|
|
661
|
+
#### get_entries
|
|
662
|
+
|
|
663
|
+
Get all session entries in append order (excluding the session header). The session is an append-only tree of entries with stable ids, so an entry id works as a durable cursor: pass the last entry id you have seen as `since` to get only entries strictly after it, even across client restarts. Unlike `get_messages`, this includes pre-compaction history and abandoned branches.
|
|
664
|
+
|
|
665
|
+
```json
|
|
666
|
+
{"type": "get_entries"}
|
|
667
|
+
```
|
|
668
|
+
|
|
669
|
+
With a cursor:
|
|
670
|
+
```json
|
|
671
|
+
{"type": "get_entries", "since": "abc123"}
|
|
672
|
+
```
|
|
673
|
+
|
|
674
|
+
Response:
|
|
675
|
+
```json
|
|
676
|
+
{
|
|
677
|
+
"type": "response",
|
|
678
|
+
"command": "get_entries",
|
|
679
|
+
"success": true,
|
|
680
|
+
"data": {
|
|
681
|
+
"entries": [
|
|
682
|
+
{"type": "message", "id": "def456", "parentId": "abc123", "timestamp": "...", "message": {"role": "user", "...": "..."}}
|
|
683
|
+
],
|
|
684
|
+
"leafId": "def456"
|
|
685
|
+
}
|
|
686
|
+
}
|
|
687
|
+
```
|
|
688
|
+
|
|
689
|
+
`leafId` is the id of the current leaf entry (`null` for an empty session), so a client can tell in one round trip whether the active branch moved. If `since` does not match any entry id, the response is `success: false`.
|
|
690
|
+
|
|
691
|
+
#### get_tree
|
|
692
|
+
|
|
693
|
+
Get the session as a tree of entries. Each node is `{entry, children, label?, labelTimestamp?}`. A well-formed session has a single root; orphaned entries (broken parent chain) also appear as roots.
|
|
694
|
+
|
|
695
|
+
```json
|
|
696
|
+
{"type": "get_tree"}
|
|
697
|
+
```
|
|
698
|
+
|
|
699
|
+
Response:
|
|
700
|
+
```json
|
|
701
|
+
{
|
|
702
|
+
"type": "response",
|
|
703
|
+
"command": "get_tree",
|
|
704
|
+
"success": true,
|
|
705
|
+
"data": {
|
|
706
|
+
"tree": [
|
|
707
|
+
{
|
|
708
|
+
"entry": {"type": "message", "id": "abc123", "parentId": null, "...": "..."},
|
|
709
|
+
"children": [
|
|
710
|
+
{"entry": {"type": "message", "id": "def456", "parentId": "abc123", "...": "..."}, "children": []}
|
|
711
|
+
]
|
|
712
|
+
}
|
|
713
|
+
],
|
|
714
|
+
"leafId": "def456"
|
|
715
|
+
}
|
|
716
|
+
}
|
|
717
|
+
```
|
|
718
|
+
|
|
630
719
|
#### get_last_assistant_text
|
|
631
720
|
|
|
632
721
|
Get the text content of the last assistant message.
|
|
@@ -664,7 +753,7 @@ Response:
|
|
|
664
753
|
}
|
|
665
754
|
```
|
|
666
755
|
|
|
667
|
-
The current session name is available via `get_state` in the `sessionName` field.
|
|
756
|
+
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 `pi --mode rpc` process.
|
|
668
757
|
|
|
669
758
|
### Commands
|
|
670
759
|
|
|
@@ -964,7 +1053,7 @@ If a dialog method includes a `timeout` field, the agent-side will auto-resolve
|
|
|
964
1053
|
|
|
965
1054
|
Some `ExtensionUIContext` methods are not supported or degraded in RPC mode because they require direct TUI access:
|
|
966
1055
|
- `custom()` returns `undefined`
|
|
967
|
-
- `setWorkingMessage()`, `setFooter()`, `setHeader()`, `setEditorComponent()`, `setToolsExpanded()` are no-ops
|
|
1056
|
+
- `setWorkingMessage()`, `setWorkingIndicator()`, `setFooter()`, `setHeader()`, `setEditorComponent()`, `setToolsExpanded()` are no-ops
|
|
968
1057
|
- `getEditorText()` returns `""`
|
|
969
1058
|
- `getToolsExpanded()` returns `false`
|
|
970
1059
|
- `pasteToEditor()` delegates to `setEditorText()` (no paste/collapse handling)
|
|
@@ -972,7 +1061,7 @@ Some `ExtensionUIContext` methods are not supported or degraded in RPC mode beca
|
|
|
972
1061
|
- `getTheme()` returns `undefined`
|
|
973
1062
|
- `setTheme()` returns `{ success: false, error: "..." }`
|
|
974
1063
|
|
|
975
|
-
Note: `ctx.hasUI` is `true` in RPC mode because the dialog and fire-and-forget methods are functional via the extension UI sub-protocol.
|
|
1064
|
+
Note: `ctx.mode` is `"rpc"` and `ctx.hasUI` is `true` in RPC mode because the dialog and fire-and-forget methods are functional via the extension UI sub-protocol. Use `ctx.mode === "tui"` to guard TUI-specific features like `custom()` that require a real terminal.
|
|
976
1065
|
|
|
977
1066
|
### Extension UI Requests (stdout)
|
|
978
1067
|
|
|
@@ -1289,7 +1378,7 @@ import subprocess
|
|
|
1289
1378
|
import json
|
|
1290
1379
|
|
|
1291
1380
|
proc = subprocess.Popen(
|
|
1292
|
-
["
|
|
1381
|
+
["pi", "--mode", "rpc", "--no-session"],
|
|
1293
1382
|
stdin=subprocess.PIPE,
|
|
1294
1383
|
stdout=subprocess.PIPE,
|
|
1295
1384
|
text=True
|
|
@@ -1328,7 +1417,7 @@ For a complete example of handling the extension UI protocol, see [`examples/rpc
|
|
|
1328
1417
|
const { spawn } = require("child_process");
|
|
1329
1418
|
const { StringDecoder } = require("string_decoder");
|
|
1330
1419
|
|
|
1331
|
-
const agent = spawn("
|
|
1420
|
+
const agent = spawn("pi", ["--mode", "rpc", "--no-session"]);
|
|
1332
1421
|
|
|
1333
1422
|
function attachJsonlReader(stream, onLine) {
|
|
1334
1423
|
const decoder = new StringDecoder("utf8");
|