@phi-code-admin/phi-code 0.74.3 → 0.75.0
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 +1186 -4
- package/README.md +478 -379
- package/dist/bun/cli.d.ts +3 -0
- package/dist/bun/cli.d.ts.map +1 -0
- package/dist/bun/cli.js +9 -0
- package/dist/bun/cli.js.map +1 -0
- package/dist/bun/register-bedrock.d.ts +2 -0
- package/dist/bun/register-bedrock.d.ts.map +1 -0
- package/dist/bun/register-bedrock.js +4 -0
- package/dist/bun/register-bedrock.js.map +1 -0
- package/dist/bun/restore-sandbox-env.d.ts +13 -0
- package/dist/bun/restore-sandbox-env.d.ts.map +1 -0
- package/dist/bun/restore-sandbox-env.js +32 -0
- package/dist/bun/restore-sandbox-env.js.map +1 -0
- package/dist/cli/args.d.ts +12 -7
- package/dist/cli/args.d.ts.map +1 -1
- package/dist/cli/args.js +87 -45
- package/dist/cli/args.js.map +1 -1
- package/dist/cli/config-selector.d.ts.map +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 +4 -0
- package/dist/cli/file-processor.js.map +1 -1
- package/dist/cli/initial-message.d.ts +18 -0
- package/dist/cli/initial-message.d.ts.map +1 -0
- package/dist/cli/initial-message.js +22 -0
- package/dist/cli/initial-message.js.map +1 -0
- 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/session-picker.d.ts.map +1 -1
- package/dist/cli/session-picker.js +2 -1
- package/dist/cli/session-picker.js.map +1 -1
- package/dist/cli.d.ts.map +1 -1
- package/dist/cli.js +9 -5
- package/dist/cli.js.map +1 -1
- package/dist/config.d.ts +24 -0
- package/dist/config.d.ts.map +1 -1
- package/dist/config.js +226 -30
- package/dist/config.js.map +1 -1
- package/dist/core/agent-session-runtime.d.ts +117 -0
- package/dist/core/agent-session-runtime.d.ts.map +1 -0
- package/dist/core/agent-session-runtime.js +300 -0
- package/dist/core/agent-session-runtime.js.map +1 -0
- package/dist/core/agent-session-services.d.ts +86 -0
- package/dist/core/agent-session-services.d.ts.map +1 -0
- package/dist/core/agent-session-services.js +117 -0
- package/dist/core/agent-session-services.js.map +1 -0
- package/dist/core/agent-session.d.ts +63 -82
- package/dist/core/agent-session.d.ts.map +1 -1
- package/dist/core/agent-session.js +674 -628
- package/dist/core/agent-session.js.map +1 -1
- package/dist/core/api-key-store.d.ts +87 -0
- package/dist/core/api-key-store.d.ts.map +1 -0
- package/dist/core/api-key-store.js +168 -0
- package/dist/core/api-key-store.js.map +1 -0
- 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 +12 -5
- package/dist/core/auth-storage.d.ts.map +1 -1
- package/dist/core/auth-storage.js +34 -8
- package/dist/core/auth-storage.js.map +1 -1
- package/dist/core/bash-executor.d.ts +0 -15
- package/dist/core/bash-executor.d.ts.map +1 -1
- package/dist/core/bash-executor.js +28 -129
- package/dist/core/bash-executor.js.map +1 -1
- package/dist/core/compaction/branch-summarization.d.ts +2 -0
- package/dist/core/compaction/branch-summarization.d.ts.map +1 -1
- package/dist/core/compaction/branch-summarization.js +3 -2
- package/dist/core/compaction/branch-summarization.js.map +1 -1
- package/dist/core/compaction/compaction.d.ts +4 -4
- package/dist/core/compaction/compaction.d.ts.map +1 -1
- package/dist/core/compaction/compaction.js +32 -27
- package/dist/core/compaction/compaction.js.map +1 -1
- package/dist/core/compaction/index.d.ts.map +1 -1
- package/dist/core/compaction/utils.d.ts.map +1 -1
- package/dist/core/compaction/utils.js.map +1 -1
- package/dist/core/config-watcher.d.ts +47 -0
- package/dist/core/config-watcher.d.ts.map +1 -0
- package/dist/core/config-watcher.js +135 -0
- package/dist/core/config-watcher.js.map +1 -0
- package/dist/core/default-models.json +80 -0
- package/dist/core/defaults.d.ts.map +1 -1
- package/dist/core/diagnostics.d.ts.map +1 -1
- package/dist/core/event-bus.d.ts.map +1 -1
- package/dist/core/event-bus.js.map +1 -1
- package/dist/core/exec.d.ts.map +1 -1
- package/dist/core/exec.js +7 -3
- package/dist/core/exec.js.map +1 -1
- 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 +7 -4
- package/dist/core/export-html/index.d.ts.map +1 -1
- package/dist/core/export-html/index.js +15 -13
- package/dist/core/export-html/index.js.map +1 -1
- package/dist/core/export-html/template.css +112 -17
- package/dist/core/export-html/template.html +1 -0
- package/dist/core/export-html/template.js +312 -64
- package/dist/core/export-html/tool-renderer.d.ts +9 -10
- package/dist/core/export-html/tool-renderer.d.ts.map +1 -1
- package/dist/core/export-html/tool-renderer.js +61 -16
- package/dist/core/export-html/tool-renderer.js.map +1 -1
- package/dist/core/extensions/index.d.ts +5 -4
- package/dist/core/extensions/index.d.ts.map +1 -1
- package/dist/core/extensions/index.js +2 -2
- package/dist/core/extensions/index.js.map +1 -1
- package/dist/core/extensions/loader.d.ts +0 -1
- package/dist/core/extensions/loader.d.ts.map +1 -1
- package/dist/core/extensions/loader.js +98 -18
- package/dist/core/extensions/loader.js.map +1 -1
- package/dist/core/extensions/runner.d.ts +27 -14
- package/dist/core/extensions/runner.d.ts.map +1 -1
- package/dist/core/extensions/runner.js +299 -115
- package/dist/core/extensions/runner.js.map +1 -1
- package/dist/core/extensions/types.d.ts +200 -44
- package/dist/core/extensions/types.d.ts.map +1 -1
- package/dist/core/extensions/types.js +10 -0
- package/dist/core/extensions/types.js.map +1 -1
- package/dist/core/extensions/wrapper.d.ts +4 -11
- package/dist/core/extensions/wrapper.d.ts.map +1 -1
- package/dist/core/extensions/wrapper.js +7 -87
- package/dist/core/extensions/wrapper.js.map +1 -1
- package/dist/core/footer-data-provider.d.ts +22 -2
- package/dist/core/footer-data-provider.d.ts.map +1 -1
- package/dist/core/footer-data-provider.js +225 -49
- package/dist/core/footer-data-provider.js.map +1 -1
- package/dist/core/index.d.ts +5 -2
- package/dist/core/index.d.ts.map +1 -1
- package/dist/core/index.js +5 -2
- package/dist/core/index.js.map +1 -1
- package/dist/core/keybindings.d.ts +348 -50
- package/dist/core/keybindings.d.ts.map +1 -1
- package/dist/core/keybindings.js +276 -132
- package/dist/core/keybindings.js.map +1 -1
- package/dist/core/messages.d.ts.map +1 -1
- package/dist/core/messages.js.map +1 -1
- package/dist/core/model-registry.d.ts +41 -5
- package/dist/core/model-registry.d.ts.map +1 -1
- package/dist/core/model-registry.js +316 -136
- package/dist/core/model-registry.js.map +1 -1
- package/dist/core/model-resolver.d.ts +6 -0
- package/dist/core/model-resolver.d.ts.map +1 -1
- package/dist/core/model-resolver.js +70 -37
- package/dist/core/model-resolver.js.map +1 -1
- package/dist/core/output-guard.d.ts +6 -0
- package/dist/core/output-guard.d.ts.map +1 -0
- package/dist/core/output-guard.js +59 -0
- package/dist/core/output-guard.js.map +1 -0
- package/dist/core/package-manager.d.ts +49 -7
- package/dist/core/package-manager.d.ts.map +1 -1
- package/dist/core/package-manager.js +655 -122
- package/dist/core/package-manager.js.map +1 -1
- package/dist/core/prompt-templates.d.ts +12 -10
- package/dist/core/prompt-templates.d.ts.map +1 -1
- package/dist/core/prompt-templates.js +37 -38
- package/dist/core/prompt-templates.js.map +1 -1
- 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 +33 -0
- package/dist/core/provider-display-names.js.map +1 -0
- package/dist/core/resolve-config-value.d.ts +6 -0
- package/dist/core/resolve-config-value.d.ts.map +1 -1
- package/dist/core/resolve-config-value.js +75 -8
- package/dist/core/resolve-config-value.js.map +1 -1
- package/dist/core/resource-loader.d.ts +18 -8
- package/dist/core/resource-loader.d.ts.map +1 -1
- package/dist/core/resource-loader.js +217 -123
- package/dist/core/resource-loader.js.map +1 -1
- package/dist/core/sdk.d.ts +25 -8
- package/dist/core/sdk.d.ts.map +1 -1
- package/dist/core/sdk.js +84 -37
- package/dist/core/sdk.js.map +1 -1
- package/dist/core/session-cwd.d.ts +19 -0
- package/dist/core/session-cwd.d.ts.map +1 -0
- package/dist/core/session-cwd.js +38 -0
- package/dist/core/session-cwd.js.map +1 -0
- package/dist/core/session-manager.d.ts +11 -1
- package/dist/core/session-manager.d.ts.map +1 -1
- package/dist/core/session-manager.js +42 -27
- package/dist/core/session-manager.js.map +1 -1
- package/dist/core/settings-manager.d.ts +34 -5
- package/dist/core/settings-manager.d.ts.map +1 -1
- package/dist/core/settings-manager.js +113 -13
- package/dist/core/settings-manager.js.map +1 -1
- package/dist/core/skills.d.ts +13 -11
- package/dist/core/skills.d.ts.map +1 -1
- package/dist/core/skills.js +59 -19
- package/dist/core/skills.js.map +1 -1
- package/dist/core/slash-commands.d.ts +2 -3
- package/dist/core/slash-commands.d.ts.map +1 -1
- package/dist/core/slash-commands.js +9 -6
- package/dist/core/slash-commands.js.map +1 -1
- package/dist/core/source-info.d.ts +18 -0
- package/dist/core/source-info.d.ts.map +1 -0
- package/dist/core/source-info.js +19 -0
- package/dist/core/source-info.js.map +1 -0
- package/dist/core/system-prompt.d.ts +3 -3
- package/dist/core/system-prompt.d.ts.map +1 -1
- package/dist/core/system-prompt.js +16 -55
- 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 +1 -0
- package/dist/core/timings.d.ts.map +1 -1
- package/dist/core/timings.js +6 -0
- package/dist/core/timings.js.map +1 -1
- package/dist/core/tools/bash.d.ts +27 -14
- package/dist/core/tools/bash.d.ts.map +1 -1
- package/dist/core/tools/bash.js +301 -208
- package/dist/core/tools/bash.js.map +1 -1
- package/dist/core/tools/edit-diff.d.ts +23 -1
- package/dist/core/tools/edit-diff.d.ts.map +1 -1
- package/dist/core/tools/edit-diff.js +154 -59
- package/dist/core/tools/edit-diff.js.map +1 -1
- package/dist/core/tools/edit.d.ts +22 -12
- package/dist/core/tools/edit.d.ts.map +1 -1
- package/dist/core/tools/edit.js +243 -65
- package/dist/core/tools/edit.js.map +1 -1
- package/dist/core/tools/file-mutation-queue.d.ts +6 -0
- package/dist/core/tools/file-mutation-queue.d.ts.map +1 -0
- package/dist/core/tools/file-mutation-queue.js +37 -0
- package/dist/core/tools/file-mutation-queue.js.map +1 -0
- package/dist/core/tools/find.d.ts +10 -14
- package/dist/core/tools/find.d.ts.map +1 -1
- package/dist/core/tools/find.js +202 -110
- package/dist/core/tools/find.js.map +1 -1
- package/dist/core/tools/grep.d.ts +14 -22
- package/dist/core/tools/grep.d.ts.map +1 -1
- package/dist/core/tools/grep.js +100 -35
- package/dist/core/tools/grep.js.map +1 -1
- package/dist/core/tools/index.d.ts +27 -60
- package/dist/core/tools/index.d.ts.map +1 -1
- package/dist/core/tools/index.js +96 -45
- package/dist/core/tools/index.js.map +1 -1
- package/dist/core/tools/ls.d.ts +8 -11
- package/dist/core/tools/ls.d.ts.map +1 -1
- package/dist/core/tools/ls.js +66 -15
- package/dist/core/tools/ls.js.map +1 -1
- package/dist/core/tools/output-accumulator.d.ts +50 -0
- package/dist/core/tools/output-accumulator.d.ts.map +1 -0
- package/dist/core/tools/output-accumulator.js +178 -0
- package/dist/core/tools/output-accumulator.js.map +1 -0
- package/dist/core/tools/path-utils.d.ts.map +1 -1
- package/dist/core/tools/path-utils.js +1 -1
- package/dist/core/tools/path-utils.js.map +1 -1
- package/dist/core/tools/read.d.ts +9 -13
- package/dist/core/tools/read.d.ts.map +1 -1
- package/dist/core/tools/read.js +175 -52
- package/dist/core/tools/read.js.map +1 -1
- package/dist/core/tools/render-utils.d.ts +21 -0
- package/dist/core/tools/render-utils.d.ts.map +1 -0
- package/dist/core/tools/render-utils.js +49 -0
- package/dist/core/tools/render-utils.js.map +1 -0
- package/dist/core/tools/tool-definition-wrapper.d.ts +14 -0
- package/dist/core/tools/tool-definition-wrapper.d.ts.map +1 -0
- package/dist/core/tools/tool-definition-wrapper.js +34 -0
- package/dist/core/tools/tool-definition-wrapper.js.map +1 -0
- package/dist/core/tools/truncate.d.ts.map +1 -1
- package/dist/core/tools/truncate.js.map +1 -1
- package/dist/core/tools/write.d.ts +8 -11
- package/dist/core/tools/write.d.ts.map +1 -1
- package/dist/core/tools/write.js +167 -32
- package/dist/core/tools/write.js.map +1 -1
- package/dist/index.d.ts +12 -9
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +12 -10
- 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 +326 -404
- 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 +24 -4
- package/dist/migrations.js.map +1 -1
- package/dist/modes/index.d.ts.map +1 -1
- package/dist/modes/interactive/components/armin.d.ts.map +1 -1
- package/dist/modes/interactive/components/armin.js +10 -6
- package/dist/modes/interactive/components/armin.js.map +1 -1
- 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 +32 -3
- package/dist/modes/interactive/components/assistant-message.js.map +1 -1
- package/dist/modes/interactive/components/bash-execution.d.ts +0 -1
- package/dist/modes/interactive/components/bash-execution.d.ts.map +1 -1
- package/dist/modes/interactive/components/bash-execution.js +31 -12
- 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 +7 -1
- package/dist/modes/interactive/components/bordered-loader.js.map +1 -1
- package/dist/modes/interactive/components/branch-summary-message.d.ts.map +1 -1
- package/dist/modes/interactive/components/branch-summary-message.js +5 -3
- package/dist/modes/interactive/components/branch-summary-message.js.map +1 -1
- package/dist/modes/interactive/components/compaction-summary-message.d.ts.map +1 -1
- package/dist/modes/interactive/components/compaction-summary-message.js +5 -3
- package/dist/modes/interactive/components/compaction-summary-message.js.map +1 -1
- package/dist/modes/interactive/components/config-selector.d.ts.map +1 -1
- package/dist/modes/interactive/components/config-selector.js +49 -16
- package/dist/modes/interactive/components/config-selector.js.map +1 -1
- package/dist/modes/interactive/components/countdown-timer.d.ts.map +1 -1
- package/dist/modes/interactive/components/countdown-timer.js +5 -0
- package/dist/modes/interactive/components/countdown-timer.js.map +1 -1
- package/dist/modes/interactive/components/custom-editor.d.ts +3 -3
- package/dist/modes/interactive/components/custom-editor.d.ts.map +1 -1
- package/dist/modes/interactive/components/custom-editor.js +14 -7
- package/dist/modes/interactive/components/custom-editor.js.map +1 -1
- package/dist/modes/interactive/components/custom-message.d.ts.map +1 -1
- package/dist/modes/interactive/components/custom-message.js +6 -1
- package/dist/modes/interactive/components/custom-message.js.map +1 -1
- package/dist/modes/interactive/components/daxnuts.d.ts.map +1 -1
- package/dist/modes/interactive/components/daxnuts.js +8 -6
- package/dist/modes/interactive/components/daxnuts.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/dynamic-border.d.ts.map +1 -1
- package/dist/modes/interactive/components/dynamic-border.js +1 -0
- package/dist/modes/interactive/components/dynamic-border.js.map +1 -1
- package/dist/modes/interactive/components/earendil-announcement.d.ts +5 -0
- package/dist/modes/interactive/components/earendil-announcement.d.ts.map +1 -0
- package/dist/modes/interactive/components/earendil-announcement.js +40 -0
- package/dist/modes/interactive/components/earendil-announcement.js.map +1 -0
- package/dist/modes/interactive/components/extension-editor.d.ts.map +1 -1
- package/dist/modes/interactive/components/extension-editor.js +16 -10
- 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 +13 -7
- package/dist/modes/interactive/components/extension-input.js.map +1 -1
- package/dist/modes/interactive/components/extension-selector.d.ts.map +1 -1
- package/dist/modes/interactive/components/extension-selector.js +18 -11
- package/dist/modes/interactive/components/extension-selector.js.map +1 -1
- package/dist/modes/interactive/components/footer.d.ts +1 -0
- package/dist/modes/interactive/components/footer.d.ts.map +1 -1
- package/dist/modes/interactive/components/footer.js +7 -2
- package/dist/modes/interactive/components/footer.js.map +1 -1
- package/dist/modes/interactive/components/index.d.ts +1 -1
- package/dist/modes/interactive/components/index.d.ts.map +1 -1
- package/dist/modes/interactive/components/index.js +1 -1
- package/dist/modes/interactive/components/index.js.map +1 -1
- package/dist/modes/interactive/components/keybinding-hints.d.ts +8 -36
- package/dist/modes/interactive/components/keybinding-hints.d.ts.map +1 -1
- package/dist/modes/interactive/components/keybinding-hints.js +23 -48
- package/dist/modes/interactive/components/keybinding-hints.js.map +1 -1
- package/dist/modes/interactive/components/login-dialog.d.ts +5 -1
- package/dist/modes/interactive/components/login-dialog.d.ts.map +1 -1
- package/dist/modes/interactive/components/login-dialog.js +35 -14
- package/dist/modes/interactive/components/login-dialog.js.map +1 -1
- package/dist/modes/interactive/components/model-selector.d.ts.map +1 -1
- package/dist/modes/interactive/components/model-selector.js +41 -22
- 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 +104 -31
- 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 +61 -42
- package/dist/modes/interactive/components/scoped-models-selector.js.map +1 -1
- package/dist/modes/interactive/components/session-selector-search.d.ts.map +1 -1
- package/dist/modes/interactive/components/session-selector-search.js.map +1 -1
- package/dist/modes/interactive/components/session-selector.d.ts +2 -1
- package/dist/modes/interactive/components/session-selector.d.ts.map +1 -1
- package/dist/modes/interactive/components/session-selector.js +109 -73
- package/dist/modes/interactive/components/session-selector.js.map +1 -1
- package/dist/modes/interactive/components/settings-selector.d.ts +9 -0
- package/dist/modes/interactive/components/settings-selector.d.ts.map +1 -1
- package/dist/modes/interactive/components/settings-selector.js +84 -4
- package/dist/modes/interactive/components/settings-selector.js.map +1 -1
- package/dist/modes/interactive/components/show-images-selector.d.ts.map +1 -1
- package/dist/modes/interactive/components/show-images-selector.js +6 -1
- package/dist/modes/interactive/components/show-images-selector.js.map +1 -1
- package/dist/modes/interactive/components/skill-invocation-message.d.ts.map +1 -1
- package/dist/modes/interactive/components/skill-invocation-message.js +5 -3
- package/dist/modes/interactive/components/skill-invocation-message.js.map +1 -1
- package/dist/modes/interactive/components/theme-selector.d.ts.map +1 -1
- package/dist/modes/interactive/components/theme-selector.js +7 -1
- package/dist/modes/interactive/components/theme-selector.js.map +1 -1
- package/dist/modes/interactive/components/thinking-selector.d.ts.map +1 -1
- package/dist/modes/interactive/components/thinking-selector.js +6 -1
- package/dist/modes/interactive/components/thinking-selector.js.map +1 -1
- package/dist/modes/interactive/components/tool-execution.d.ts +20 -34
- package/dist/modes/interactive/components/tool-execution.d.ts.map +1 -1
- package/dist/modes/interactive/components/tool-execution.js +158 -636
- package/dist/modes/interactive/components/tool-execution.js.map +1 -1
- package/dist/modes/interactive/components/tree-selector.d.ts +21 -2
- package/dist/modes/interactive/components/tree-selector.d.ts.map +1 -1
- package/dist/modes/interactive/components/tree-selector.js +224 -52
- package/dist/modes/interactive/components/tree-selector.js.map +1 -1
- 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 +20 -16
- package/dist/modes/interactive/components/user-message-selector.js.map +1 -1
- package/dist/modes/interactive/components/user-message.d.ts +1 -0
- package/dist/modes/interactive/components/user-message.d.ts.map +1 -1
- package/dist/modes/interactive/components/user-message.js +8 -6
- package/dist/modes/interactive/components/user-message.js.map +1 -1
- package/dist/modes/interactive/components/visual-truncate.d.ts.map +1 -1
- package/dist/modes/interactive/components/visual-truncate.js.map +1 -1
- package/dist/modes/interactive/interactive-mode.d.ts +67 -39
- package/dist/modes/interactive/interactive-mode.d.ts.map +1 -1
- package/dist/modes/interactive/interactive-mode.js +1556 -680
- package/dist/modes/interactive/interactive-mode.js.map +1 -1
- package/dist/modes/interactive/theme/dark.json +1 -1
- package/dist/modes/interactive/theme/light.json +1 -1
- package/dist/modes/interactive/theme/theme.d.ts +3 -0
- package/dist/modes/interactive/theme/theme.d.ts.map +1 -1
- package/dist/modes/interactive/theme/theme.js +101 -72
- package/dist/modes/interactive/theme/theme.js.map +1 -1
- package/dist/modes/print-mode.d.ts +2 -2
- package/dist/modes/print-mode.d.ts.map +1 -1
- package/dist/modes/print-mode.js +107 -77
- package/dist/modes/print-mode.js.map +1 -1
- package/dist/modes/rpc/jsonl.d.ts +17 -0
- package/dist/modes/rpc/jsonl.d.ts.map +1 -0
- package/dist/modes/rpc/jsonl.js +49 -0
- package/dist/modes/rpc/jsonl.js.map +1 -0
- package/dist/modes/rpc/rpc-client.d.ts +8 -1
- package/dist/modes/rpc/rpc-client.d.ts.map +1 -1
- package/dist/modes/rpc/rpc-client.js +22 -16
- 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 +184 -94
- package/dist/modes/rpc/rpc-mode.js.map +1 -1
- package/dist/modes/rpc/rpc-types.d.ts +14 -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 +4 -0
- package/dist/package-manager-cli.d.ts.map +1 -0
- package/dist/package-manager-cli.js +460 -0
- package/dist/package-manager-cli.js.map +1 -0
- package/dist/utils/changelog.d.ts.map +1 -1
- package/dist/utils/changelog.js.map +1 -1
- package/dist/utils/child-process.d.ts +12 -0
- package/dist/utils/child-process.d.ts.map +1 -0
- package/dist/utils/child-process.js +86 -0
- package/dist/utils/child-process.js.map +1 -0
- package/dist/utils/clipboard-image.d.ts.map +1 -1
- package/dist/utils/clipboard-image.js +94 -11
- package/dist/utils/clipboard-image.js.map +1 -1
- package/dist/utils/clipboard-native.d.ts +1 -0
- package/dist/utils/clipboard-native.d.ts.map +1 -1
- package/dist/utils/clipboard-native.js.map +1 -1
- package/dist/utils/clipboard.d.ts +1 -1
- package/dist/utils/clipboard.d.ts.map +1 -1
- package/dist/utils/clipboard.js +96 -46
- package/dist/utils/clipboard.js.map +1 -1
- package/dist/utils/exif-orientation.d.ts +5 -0
- package/dist/utils/exif-orientation.d.ts.map +1 -0
- package/dist/utils/exif-orientation.js +158 -0
- package/dist/utils/exif-orientation.js.map +1 -0
- package/dist/utils/frontmatter.d.ts.map +1 -1
- package/dist/utils/frontmatter.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.map +1 -1
- package/dist/utils/image-convert.d.ts.map +1 -1
- package/dist/utils/image-convert.js +5 -1
- package/dist/utils/image-convert.js.map +1 -1
- package/dist/utils/image-resize.d.ts +5 -5
- package/dist/utils/image-resize.d.ts.map +1 -1
- package/dist/utils/image-resize.js +51 -95
- package/dist/utils/image-resize.js.map +1 -1
- package/dist/utils/mime.d.ts.map +1 -1
- package/dist/utils/mime.js.map +1 -1
- package/dist/utils/paths.d.ts +16 -0
- package/dist/utils/paths.d.ts.map +1 -0
- package/dist/utils/paths.js +50 -0
- package/dist/utils/paths.js.map +1 -0
- package/dist/utils/photon.d.ts.map +1 -1
- package/dist/utils/photon.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 +10 -6
- package/dist/utils/shell.d.ts.map +1 -1
- package/dist/utils/shell.js +29 -25
- package/dist/utils/shell.js.map +1 -1
- package/dist/utils/sleep.d.ts.map +1 -1
- package/dist/utils/sleep.js.map +1 -1
- package/dist/utils/tools-manager.d.ts.map +1 -1
- package/dist/utils/tools-manager.js +11 -6
- package/dist/utils/tools-manager.js.map +1 -1
- package/dist/utils/version-check.d.ts +14 -0
- package/dist/utils/version-check.d.ts.map +1 -0
- package/dist/utils/version-check.js +77 -0
- package/dist/utils/version-check.js.map +1 -0
- package/docs/compaction.md +394 -0
- package/docs/custom-provider.md +646 -0
- package/docs/development.md +71 -0
- package/docs/docs.json +148 -0
- package/docs/extensions.md +2596 -0
- package/docs/images/doom-extension.png +0 -0
- package/docs/images/exy.png +0 -0
- package/docs/images/interactive-mode.png +0 -0
- package/docs/images/tree-view.png +0 -0
- package/docs/index.md +70 -0
- package/docs/json.md +82 -0
- package/docs/keybindings.md +197 -0
- package/docs/models.md +474 -0
- package/docs/packages.md +223 -0
- package/docs/prompt-templates.md +88 -0
- package/docs/providers.md +243 -0
- package/docs/quickstart.md +142 -0
- package/docs/rpc.md +1407 -0
- package/docs/sdk.md +1149 -0
- package/docs/session-format.md +412 -0
- package/docs/sessions.md +137 -0
- package/docs/settings.md +279 -0
- package/docs/shell-aliases.md +13 -0
- package/docs/skills.md +232 -0
- package/docs/terminal-setup.md +106 -0
- package/docs/termux.md +127 -0
- package/docs/themes.md +295 -0
- package/docs/tmux.md +61 -0
- package/docs/tui.md +918 -0
- package/docs/usage.md +277 -0
- package/docs/windows.md +17 -0
- package/examples/README.md +25 -0
- package/examples/extensions/README.md +208 -0
- package/examples/extensions/auto-commit-on-exit.ts +49 -0
- package/examples/extensions/bash-spawn-hook.ts +30 -0
- package/examples/extensions/bookmark.ts +50 -0
- package/examples/extensions/border-status-editor.ts +150 -0
- package/examples/extensions/built-in-tool-renderer.ts +249 -0
- package/examples/extensions/claude-rules.ts +86 -0
- package/examples/extensions/commands.ts +72 -0
- package/examples/extensions/confirm-destructive.ts +59 -0
- package/examples/extensions/custom-compaction.ts +127 -0
- package/examples/extensions/custom-footer.ts +64 -0
- package/examples/extensions/custom-header.ts +73 -0
- package/examples/extensions/custom-provider-anthropic/index.ts +604 -0
- package/examples/extensions/custom-provider-anthropic/package-lock.json +24 -0
- package/examples/extensions/custom-provider-anthropic/package.json +19 -0
- package/examples/extensions/custom-provider-gitlab-duo/index.ts +349 -0
- package/examples/extensions/custom-provider-gitlab-duo/package.json +16 -0
- package/examples/extensions/custom-provider-gitlab-duo/test.ts +82 -0
- package/examples/extensions/dirty-repo-guard.ts +56 -0
- package/examples/extensions/doom-overlay/README.md +46 -0
- package/examples/extensions/doom-overlay/doom/build/doom.js +21 -0
- package/examples/extensions/doom-overlay/doom/build/doom.wasm +0 -0
- package/examples/extensions/doom-overlay/doom/build.sh +152 -0
- package/examples/extensions/doom-overlay/doom/doomgeneric_pi.c +72 -0
- package/examples/extensions/doom-overlay/doom-component.ts +132 -0
- package/examples/extensions/doom-overlay/doom-engine.ts +173 -0
- package/examples/extensions/doom-overlay/doom-keys.ts +104 -0
- package/examples/extensions/doom-overlay/index.ts +74 -0
- package/examples/extensions/doom-overlay/wad-finder.ts +51 -0
- package/examples/extensions/dynamic-resources/SKILL.md +8 -0
- package/examples/extensions/dynamic-resources/dynamic.json +79 -0
- package/examples/extensions/dynamic-resources/dynamic.md +5 -0
- package/examples/extensions/dynamic-resources/index.ts +15 -0
- package/examples/extensions/dynamic-tools.ts +74 -0
- package/examples/extensions/event-bus.ts +43 -0
- package/examples/extensions/file-trigger.ts +41 -0
- package/examples/extensions/git-checkpoint.ts +53 -0
- package/examples/extensions/github-issue-autocomplete.ts +185 -0
- package/examples/extensions/handoff.ts +191 -0
- package/examples/extensions/hello.ts +26 -0
- package/examples/extensions/hidden-thinking-label.ts +53 -0
- package/examples/extensions/inline-bash.ts +94 -0
- package/examples/extensions/input-transform.ts +43 -0
- package/examples/extensions/interactive-shell.ts +196 -0
- package/examples/extensions/mac-system-theme.ts +47 -0
- package/examples/extensions/message-renderer.ts +59 -0
- package/examples/extensions/minimal-mode.ts +426 -0
- package/examples/extensions/modal-editor.ts +85 -0
- package/examples/extensions/model-status.ts +31 -0
- package/examples/extensions/notify.ts +55 -0
- package/examples/extensions/overlay-qa-tests.ts +1348 -0
- package/examples/extensions/overlay-test.ts +150 -0
- package/examples/extensions/permission-gate.ts +34 -0
- package/examples/extensions/pirate.ts +47 -0
- package/examples/extensions/plan-mode/README.md +65 -0
- package/examples/extensions/plan-mode/index.ts +340 -0
- package/examples/extensions/plan-mode/utils.ts +168 -0
- package/examples/extensions/preset.ts +430 -0
- package/examples/extensions/prompt-customizer.ts +97 -0
- package/examples/extensions/protected-paths.ts +30 -0
- package/examples/extensions/provider-payload.ts +18 -0
- package/examples/extensions/qna.ts +122 -0
- package/examples/extensions/question.ts +264 -0
- package/examples/extensions/questionnaire.ts +427 -0
- package/examples/extensions/rainbow-editor.ts +88 -0
- package/examples/extensions/reload-runtime.ts +37 -0
- package/examples/extensions/rpc-demo.ts +118 -0
- package/examples/extensions/sandbox/index.ts +321 -0
- package/examples/extensions/sandbox/package-lock.json +92 -0
- package/examples/extensions/sandbox/package.json +19 -0
- package/examples/extensions/send-user-message.ts +97 -0
- package/examples/extensions/session-name.ts +27 -0
- package/examples/extensions/shutdown-command.ts +63 -0
- package/examples/extensions/snake.ts +343 -0
- package/examples/extensions/space-invaders.ts +560 -0
- package/examples/extensions/ssh.ts +220 -0
- package/examples/extensions/status-line.ts +32 -0
- package/examples/extensions/structured-output.ts +65 -0
- package/examples/extensions/subagent/README.md +172 -0
- package/examples/extensions/subagent/agents/planner.md +37 -0
- package/examples/extensions/subagent/agents/reviewer.md +35 -0
- package/examples/extensions/subagent/agents/scout.md +50 -0
- package/examples/extensions/subagent/agents/worker.md +24 -0
- package/examples/extensions/subagent/agents.ts +126 -0
- package/examples/extensions/subagent/index.ts +987 -0
- package/examples/extensions/subagent/prompts/implement-and-review.md +10 -0
- package/examples/extensions/subagent/prompts/implement.md +10 -0
- package/examples/extensions/subagent/prompts/scout-and-plan.md +9 -0
- package/examples/extensions/summarize.ts +206 -0
- package/examples/extensions/system-prompt-header.ts +17 -0
- package/examples/extensions/tic-tac-toe.ts +1008 -0
- package/examples/extensions/timed-confirm.ts +70 -0
- package/examples/extensions/titlebar-spinner.ts +58 -0
- package/examples/extensions/todo.ts +297 -0
- package/examples/extensions/tool-override.ts +144 -0
- package/examples/extensions/tools.ts +141 -0
- package/examples/extensions/trigger-compact.ts +50 -0
- package/examples/extensions/truncated-tool.ts +195 -0
- package/examples/extensions/widget-placement.ts +9 -0
- package/examples/extensions/with-deps/index.ts +32 -0
- package/examples/extensions/with-deps/package-lock.json +31 -0
- package/examples/extensions/with-deps/package.json +22 -0
- package/examples/extensions/working-indicator.ts +123 -0
- package/examples/extensions/working-message-test.ts +25 -0
- package/examples/rpc-extension-ui.ts +632 -0
- package/examples/sdk/01-minimal.ts +22 -0
- package/examples/sdk/02-custom-model.ts +49 -0
- package/examples/sdk/03-custom-prompt.ts +62 -0
- package/examples/sdk/04-skills.ts +55 -0
- package/examples/sdk/05-tools.ts +44 -0
- package/examples/sdk/06-extensions.ts +90 -0
- package/examples/sdk/07-context-files.ts +42 -0
- package/examples/sdk/08-prompt-templates.ts +51 -0
- package/examples/sdk/09-api-keys-and-oauth.ts +48 -0
- package/examples/sdk/10-settings.ts +53 -0
- package/examples/sdk/11-sessions.ts +48 -0
- package/examples/sdk/12-full-control.ts +73 -0
- package/examples/sdk/13-session-runtime.ts +67 -0
- package/examples/sdk/README.md +147 -0
- package/extensions/phi/init.ts +15 -1
- package/extensions/phi/keys.ts +186 -0
- package/extensions/phi/providers/alibaba.ts +126 -0
- package/extensions/phi/providers/opencode-go.ts +204 -0
- package/extensions/phi/setup.ts +692 -0
- package/extensions/phi/smart-router.ts +8 -0
- package/package.json +17 -12
- package/scripts/copy-assets.sh +0 -0
- package/scripts/migrate-sessions.sh +0 -0
package/docs/models.md
ADDED
|
@@ -0,0 +1,474 @@
|
|
|
1
|
+
# Custom Models
|
|
2
|
+
|
|
3
|
+
Add custom providers and models (Ollama, vLLM, LM Studio, proxies) via `~/.pi/agent/models.json`.
|
|
4
|
+
|
|
5
|
+
## Table of Contents
|
|
6
|
+
|
|
7
|
+
- [Minimal Example](#minimal-example)
|
|
8
|
+
- [Full Example](#full-example)
|
|
9
|
+
- [Supported APIs](#supported-apis)
|
|
10
|
+
- [Provider Configuration](#provider-configuration)
|
|
11
|
+
- [Model Configuration](#model-configuration)
|
|
12
|
+
- [Overriding Built-in Providers](#overriding-built-in-providers)
|
|
13
|
+
- [Per-model Overrides](#per-model-overrides)
|
|
14
|
+
- [Anthropic Messages Compatibility](#anthropic-messages-compatibility)
|
|
15
|
+
- [OpenAI Compatibility](#openai-compatibility)
|
|
16
|
+
|
|
17
|
+
## Minimal Example
|
|
18
|
+
|
|
19
|
+
For local models (Ollama, LM Studio, vLLM), only `id` is required per model:
|
|
20
|
+
|
|
21
|
+
```json
|
|
22
|
+
{
|
|
23
|
+
"providers": {
|
|
24
|
+
"ollama": {
|
|
25
|
+
"baseUrl": "http://localhost:11434/v1",
|
|
26
|
+
"api": "openai-completions",
|
|
27
|
+
"apiKey": "ollama",
|
|
28
|
+
"models": [
|
|
29
|
+
{ "id": "llama3.1:8b" },
|
|
30
|
+
{ "id": "qwen2.5-coder:7b" }
|
|
31
|
+
]
|
|
32
|
+
}
|
|
33
|
+
}
|
|
34
|
+
}
|
|
35
|
+
```
|
|
36
|
+
|
|
37
|
+
The `apiKey` is required but Ollama ignores it, so any value works.
|
|
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 pi 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
|
+
|
|
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
|
+
|
|
43
|
+
```json
|
|
44
|
+
{
|
|
45
|
+
"providers": {
|
|
46
|
+
"ollama": {
|
|
47
|
+
"baseUrl": "http://localhost:11434/v1",
|
|
48
|
+
"api": "openai-completions",
|
|
49
|
+
"apiKey": "ollama",
|
|
50
|
+
"compat": {
|
|
51
|
+
"supportsDeveloperRole": false,
|
|
52
|
+
"supportsReasoningEffort": false
|
|
53
|
+
},
|
|
54
|
+
"models": [
|
|
55
|
+
{
|
|
56
|
+
"id": "gpt-oss:20b",
|
|
57
|
+
"reasoning": true
|
|
58
|
+
}
|
|
59
|
+
]
|
|
60
|
+
}
|
|
61
|
+
}
|
|
62
|
+
}
|
|
63
|
+
```
|
|
64
|
+
|
|
65
|
+
## Full Example
|
|
66
|
+
|
|
67
|
+
Override defaults when you need specific values:
|
|
68
|
+
|
|
69
|
+
```json
|
|
70
|
+
{
|
|
71
|
+
"providers": {
|
|
72
|
+
"ollama": {
|
|
73
|
+
"baseUrl": "http://localhost:11434/v1",
|
|
74
|
+
"api": "openai-completions",
|
|
75
|
+
"apiKey": "ollama",
|
|
76
|
+
"models": [
|
|
77
|
+
{
|
|
78
|
+
"id": "llama3.1:8b",
|
|
79
|
+
"name": "Llama 3.1 8B (Local)",
|
|
80
|
+
"reasoning": false,
|
|
81
|
+
"input": ["text"],
|
|
82
|
+
"contextWindow": 128000,
|
|
83
|
+
"maxTokens": 32000,
|
|
84
|
+
"cost": { "input": 0, "output": 0, "cacheRead": 0, "cacheWrite": 0 }
|
|
85
|
+
}
|
|
86
|
+
]
|
|
87
|
+
}
|
|
88
|
+
}
|
|
89
|
+
}
|
|
90
|
+
```
|
|
91
|
+
|
|
92
|
+
The file reloads each time you open `/model`. Edit during session; no restart needed.
|
|
93
|
+
|
|
94
|
+
## Google AI Studio Example
|
|
95
|
+
|
|
96
|
+
Use `google-generative-ai` with a `baseUrl` to add models from Google AI Studio, including custom Gemma 4 entries:
|
|
97
|
+
|
|
98
|
+
```json
|
|
99
|
+
{
|
|
100
|
+
"providers": {
|
|
101
|
+
"my-google": {
|
|
102
|
+
"baseUrl": "https://generativelanguage.googleapis.com/v1beta",
|
|
103
|
+
"api": "google-generative-ai",
|
|
104
|
+
"apiKey": "GEMINI_API_KEY",
|
|
105
|
+
"models": [
|
|
106
|
+
{
|
|
107
|
+
"id": "gemma-4-31b-it",
|
|
108
|
+
"name": "Gemma 4 31B",
|
|
109
|
+
"input": ["text", "image"],
|
|
110
|
+
"contextWindow": 262144,
|
|
111
|
+
"reasoning": true
|
|
112
|
+
}
|
|
113
|
+
]
|
|
114
|
+
}
|
|
115
|
+
}
|
|
116
|
+
}
|
|
117
|
+
```
|
|
118
|
+
|
|
119
|
+
The `baseUrl` is required when adding custom models to the `google-generative-ai` API type.
|
|
120
|
+
|
|
121
|
+
## Supported APIs
|
|
122
|
+
|
|
123
|
+
| API | Description |
|
|
124
|
+
|-----|-------------|
|
|
125
|
+
| `openai-completions` | OpenAI Chat Completions (most compatible) |
|
|
126
|
+
| `openai-responses` | OpenAI Responses API |
|
|
127
|
+
| `anthropic-messages` | Anthropic Messages API |
|
|
128
|
+
| `google-generative-ai` | Google Generative AI |
|
|
129
|
+
|
|
130
|
+
Set `api` at provider level (default for all models) or model level (override per model).
|
|
131
|
+
|
|
132
|
+
## Provider Configuration
|
|
133
|
+
|
|
134
|
+
| Field | Description |
|
|
135
|
+
|-------|-------------|
|
|
136
|
+
| `baseUrl` | API endpoint URL |
|
|
137
|
+
| `api` | API type (see above) |
|
|
138
|
+
| `apiKey` | API key (see value resolution below) |
|
|
139
|
+
| `headers` | Custom headers (see value resolution below) |
|
|
140
|
+
| `authHeader` | Set `true` to add `Authorization: Bearer <apiKey>` automatically |
|
|
141
|
+
| `models` | Array of model configurations |
|
|
142
|
+
| `modelOverrides` | Per-model overrides for built-in models on this provider |
|
|
143
|
+
|
|
144
|
+
### Value Resolution
|
|
145
|
+
|
|
146
|
+
The `apiKey` and `headers` fields support three formats:
|
|
147
|
+
|
|
148
|
+
- **Shell command:** `"!command"` executes and uses stdout
|
|
149
|
+
```json
|
|
150
|
+
"apiKey": "!security find-generic-password -ws 'anthropic'"
|
|
151
|
+
"apiKey": "!op read 'op://vault/item/credential'"
|
|
152
|
+
```
|
|
153
|
+
- **Environment variable:** Uses the value of the named variable
|
|
154
|
+
```json
|
|
155
|
+
"apiKey": "MY_API_KEY"
|
|
156
|
+
```
|
|
157
|
+
- **Literal value:** Used directly
|
|
158
|
+
```json
|
|
159
|
+
"apiKey": "sk-..."
|
|
160
|
+
```
|
|
161
|
+
|
|
162
|
+
For `models.json`, shell commands are resolved at request time. pi intentionally does not apply built-in TTL, stale reuse, or recovery logic for arbitrary commands. Different commands need different caching and failure strategies, and pi cannot infer the right one.
|
|
163
|
+
|
|
164
|
+
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.
|
|
165
|
+
|
|
166
|
+
`/model` availability checks use configured auth presence and do not execute shell commands.
|
|
167
|
+
|
|
168
|
+
### Custom Headers
|
|
169
|
+
|
|
170
|
+
```json
|
|
171
|
+
{
|
|
172
|
+
"providers": {
|
|
173
|
+
"custom-proxy": {
|
|
174
|
+
"baseUrl": "https://proxy.example.com/v1",
|
|
175
|
+
"apiKey": "MY_API_KEY",
|
|
176
|
+
"api": "anthropic-messages",
|
|
177
|
+
"headers": {
|
|
178
|
+
"x-portkey-api-key": "PORTKEY_API_KEY",
|
|
179
|
+
"x-secret": "!op read 'op://vault/item/secret'"
|
|
180
|
+
},
|
|
181
|
+
"models": [...]
|
|
182
|
+
}
|
|
183
|
+
}
|
|
184
|
+
}
|
|
185
|
+
```
|
|
186
|
+
|
|
187
|
+
## Model Configuration
|
|
188
|
+
|
|
189
|
+
| Field | Required | Default | Description |
|
|
190
|
+
|-------|----------|---------|-------------|
|
|
191
|
+
| `id` | Yes | — | Model identifier (passed to the API) |
|
|
192
|
+
| `name` | No | `id` | Human-readable model label. Used for matching (`--model` patterns) and shown in model details/status text. |
|
|
193
|
+
| `api` | No | provider's `api` | Override provider's API for this model |
|
|
194
|
+
| `reasoning` | No | `false` | Supports extended thinking |
|
|
195
|
+
| `thinkingLevelMap` | No | omitted | Maps pi thinking levels to provider values and marks unsupported levels (see below) |
|
|
196
|
+
| `input` | No | `["text"]` | Input types: `["text"]` or `["text", "image"]` |
|
|
197
|
+
| `contextWindow` | No | `128000` | Context window size in tokens |
|
|
198
|
+
| `maxTokens` | No | `16384` | Maximum output tokens |
|
|
199
|
+
| `cost` | No | all zeros | `{"input": 0, "output": 0, "cacheRead": 0, "cacheWrite": 0}` (per million tokens) |
|
|
200
|
+
| `compat` | No | provider `compat` | Provider compatibility overrides. Merged with provider-level `compat` when both are set. |
|
|
201
|
+
|
|
202
|
+
Current behavior:
|
|
203
|
+
- `/model` and `--list-models` list entries by model `id`.
|
|
204
|
+
- The configured `name` is used for model matching and detail/status text.
|
|
205
|
+
|
|
206
|
+
### Thinking Level Map
|
|
207
|
+
|
|
208
|
+
Use `thinkingLevelMap` on a model to describe model-specific thinking controls. Keys are pi thinking levels: `off`, `minimal`, `low`, `medium`, `high`, `xhigh`.
|
|
209
|
+
|
|
210
|
+
Values are tristate:
|
|
211
|
+
|
|
212
|
+
| Value | Meaning |
|
|
213
|
+
|-------|---------|
|
|
214
|
+
| omitted | Level is supported and uses the provider's default mapping |
|
|
215
|
+
| string | Level is supported and this value is sent to the provider |
|
|
216
|
+
| `null` | Level is unsupported and hidden/skipped/clamped away |
|
|
217
|
+
|
|
218
|
+
Example for a model that only supports off, high, and max reasoning:
|
|
219
|
+
|
|
220
|
+
```json
|
|
221
|
+
{
|
|
222
|
+
"id": "deepseek-v4-pro",
|
|
223
|
+
"reasoning": true,
|
|
224
|
+
"thinkingLevelMap": {
|
|
225
|
+
"minimal": null,
|
|
226
|
+
"low": null,
|
|
227
|
+
"medium": null,
|
|
228
|
+
"high": "high",
|
|
229
|
+
"xhigh": "max"
|
|
230
|
+
}
|
|
231
|
+
}
|
|
232
|
+
```
|
|
233
|
+
|
|
234
|
+
Example for a model where thinking cannot be disabled:
|
|
235
|
+
|
|
236
|
+
```json
|
|
237
|
+
{
|
|
238
|
+
"id": "always-thinking-model",
|
|
239
|
+
"reasoning": true,
|
|
240
|
+
"thinkingLevelMap": {
|
|
241
|
+
"off": null
|
|
242
|
+
}
|
|
243
|
+
}
|
|
244
|
+
```
|
|
245
|
+
|
|
246
|
+
Migration: older configs that used `compat.reasoningEffortMap` should move that mapping to model-level `thinkingLevelMap`. Use `null` for levels that should not appear in the UI.
|
|
247
|
+
|
|
248
|
+
## Overriding Built-in Providers
|
|
249
|
+
|
|
250
|
+
Route a built-in provider through a proxy without redefining models:
|
|
251
|
+
|
|
252
|
+
```json
|
|
253
|
+
{
|
|
254
|
+
"providers": {
|
|
255
|
+
"anthropic": {
|
|
256
|
+
"baseUrl": "https://my-proxy.example.com/v1"
|
|
257
|
+
}
|
|
258
|
+
}
|
|
259
|
+
}
|
|
260
|
+
```
|
|
261
|
+
|
|
262
|
+
All built-in Anthropic models remain available. Existing OAuth or API key auth continues to work.
|
|
263
|
+
|
|
264
|
+
To merge custom models into a built-in provider, include the `models` array:
|
|
265
|
+
|
|
266
|
+
```json
|
|
267
|
+
{
|
|
268
|
+
"providers": {
|
|
269
|
+
"anthropic": {
|
|
270
|
+
"baseUrl": "https://my-proxy.example.com/v1",
|
|
271
|
+
"apiKey": "ANTHROPIC_API_KEY",
|
|
272
|
+
"api": "anthropic-messages",
|
|
273
|
+
"models": [...]
|
|
274
|
+
}
|
|
275
|
+
}
|
|
276
|
+
}
|
|
277
|
+
```
|
|
278
|
+
|
|
279
|
+
Merge semantics:
|
|
280
|
+
- Built-in models are kept.
|
|
281
|
+
- Custom models are upserted by `id` within the provider.
|
|
282
|
+
- If a custom model `id` matches a built-in model `id`, the custom model replaces that built-in model.
|
|
283
|
+
- If a custom model `id` is new, it is added alongside built-in models.
|
|
284
|
+
|
|
285
|
+
## Per-model Overrides
|
|
286
|
+
|
|
287
|
+
Use `modelOverrides` to customize specific built-in models without replacing the provider's full model list.
|
|
288
|
+
|
|
289
|
+
```json
|
|
290
|
+
{
|
|
291
|
+
"providers": {
|
|
292
|
+
"openrouter": {
|
|
293
|
+
"modelOverrides": {
|
|
294
|
+
"anthropic/claude-sonnet-4": {
|
|
295
|
+
"name": "Claude Sonnet 4 (Bedrock Route)",
|
|
296
|
+
"compat": {
|
|
297
|
+
"openRouterRouting": {
|
|
298
|
+
"only": ["amazon-bedrock"]
|
|
299
|
+
}
|
|
300
|
+
}
|
|
301
|
+
}
|
|
302
|
+
}
|
|
303
|
+
}
|
|
304
|
+
}
|
|
305
|
+
}
|
|
306
|
+
```
|
|
307
|
+
|
|
308
|
+
`modelOverrides` supports these fields per model: `name`, `reasoning`, `input`, `cost` (partial), `contextWindow`, `maxTokens`, `headers`, `compat`.
|
|
309
|
+
|
|
310
|
+
Behavior notes:
|
|
311
|
+
- `modelOverrides` are applied to built-in provider models.
|
|
312
|
+
- Unknown model IDs are ignored.
|
|
313
|
+
- You can combine provider-level `baseUrl`/`headers` with `modelOverrides`.
|
|
314
|
+
- 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.
|
|
315
|
+
|
|
316
|
+
## Anthropic Messages Compatibility
|
|
317
|
+
|
|
318
|
+
For providers or proxies using `api: "anthropic-messages"`, use `compat.supportsEagerToolInputStreaming` to control Anthropic fine-grained tool streaming compatibility.
|
|
319
|
+
|
|
320
|
+
By default pi sends per-tool `eager_input_streaming: true`. If a proxy or Anthropic-compatible backend rejects that field, set `supportsEagerToolInputStreaming` to `false`. Pi will omit `tools[].eager_input_streaming` and send the legacy `fine-grained-tool-streaming-2025-05-14` beta header for tool-enabled requests instead.
|
|
321
|
+
|
|
322
|
+
```json
|
|
323
|
+
{
|
|
324
|
+
"providers": {
|
|
325
|
+
"anthropic-proxy": {
|
|
326
|
+
"baseUrl": "https://proxy.example.com",
|
|
327
|
+
"api": "anthropic-messages",
|
|
328
|
+
"apiKey": "ANTHROPIC_PROXY_KEY",
|
|
329
|
+
"compat": {
|
|
330
|
+
"supportsEagerToolInputStreaming": false,
|
|
331
|
+
"supportsLongCacheRetention": true
|
|
332
|
+
},
|
|
333
|
+
"models": [
|
|
334
|
+
{
|
|
335
|
+
"id": "claude-opus-4-7",
|
|
336
|
+
"reasoning": true,
|
|
337
|
+
"input": ["text", "image"]
|
|
338
|
+
}
|
|
339
|
+
]
|
|
340
|
+
}
|
|
341
|
+
}
|
|
342
|
+
}
|
|
343
|
+
```
|
|
344
|
+
|
|
345
|
+
| Field | Description |
|
|
346
|
+
|-------|-------------|
|
|
347
|
+
| `supportsEagerToolInputStreaming` | Whether the provider accepts per-tool `eager_input_streaming`. Default: `true`. Set to `false` to omit that field and use the legacy fine-grained tool streaming beta header on tool-enabled requests. |
|
|
348
|
+
| `supportsLongCacheRetention` | Whether the provider accepts Anthropic long cache retention (`cache_control.ttl: "1h"`) when cache retention is `long`. Default: `true`. |
|
|
349
|
+
|
|
350
|
+
## OpenAI Compatibility
|
|
351
|
+
|
|
352
|
+
For providers with partial OpenAI compatibility, use the `compat` field.
|
|
353
|
+
|
|
354
|
+
- Provider-level `compat` applies defaults to all models under that provider.
|
|
355
|
+
- Model-level `compat` overrides provider-level values for that model.
|
|
356
|
+
|
|
357
|
+
```json
|
|
358
|
+
{
|
|
359
|
+
"providers": {
|
|
360
|
+
"local-llm": {
|
|
361
|
+
"baseUrl": "http://localhost:8080/v1",
|
|
362
|
+
"api": "openai-completions",
|
|
363
|
+
"compat": {
|
|
364
|
+
"supportsUsageInStreaming": false,
|
|
365
|
+
"maxTokensField": "max_tokens"
|
|
366
|
+
},
|
|
367
|
+
"models": [...]
|
|
368
|
+
}
|
|
369
|
+
}
|
|
370
|
+
}
|
|
371
|
+
```
|
|
372
|
+
|
|
373
|
+
| Field | Description |
|
|
374
|
+
|-------|-------------|
|
|
375
|
+
| `supportsStore` | Provider supports `store` field |
|
|
376
|
+
| `supportsDeveloperRole` | Use `developer` vs `system` role |
|
|
377
|
+
| `supportsReasoningEffort` | Support for `reasoning_effort` parameter |
|
|
378
|
+
| `supportsUsageInStreaming` | Supports `stream_options: { include_usage: true }` (default: `true`) |
|
|
379
|
+
| `maxTokensField` | Use `max_completion_tokens` or `max_tokens` |
|
|
380
|
+
| `requiresToolResultName` | Include `name` on tool result messages |
|
|
381
|
+
| `requiresAssistantAfterToolResult` | Insert an assistant message before a user message after tool results |
|
|
382
|
+
| `requiresThinkingAsText` | Convert thinking blocks to plain text |
|
|
383
|
+
| `requiresReasoningContentOnAssistantMessages` | Include empty `reasoning_content` on all replayed assistant messages when reasoning is enabled |
|
|
384
|
+
| `thinkingFormat` | Use `reasoning_effort`, `openrouter`, `deepseek`, `together`, `zai`, `qwen`, or `qwen-chat-template` thinking parameters |
|
|
385
|
+
| `cacheControlFormat` | Use Anthropic-style `cache_control` markers on the system prompt, last tool definition, and last user/assistant text content. Currently only `anthropic` is supported. |
|
|
386
|
+
| `supportsStrictMode` | Include the `strict` field in tool definitions |
|
|
387
|
+
| `supportsLongCacheRetention` | Whether the provider accepts long cache retention when cache retention is `long`: `prompt_cache_retention: "24h"` for OpenAI prompt caching, or `cache_control.ttl: "1h"` when `cacheControlFormat` is `anthropic`. Default: `true`. |
|
|
388
|
+
| `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). |
|
|
389
|
+
| `vercelGatewayRouting` | Vercel AI Gateway routing config for provider selection (`only`, `order`) |
|
|
390
|
+
|
|
391
|
+
`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`.
|
|
392
|
+
|
|
393
|
+
`cacheControlFormat: "anthropic"` is for OpenAI-compatible providers that expose Anthropic-style prompt caching through `cache_control` markers on text content and tool definitions.
|
|
394
|
+
|
|
395
|
+
Example:
|
|
396
|
+
|
|
397
|
+
```json
|
|
398
|
+
{
|
|
399
|
+
"providers": {
|
|
400
|
+
"openrouter": {
|
|
401
|
+
"baseUrl": "https://openrouter.ai/api/v1",
|
|
402
|
+
"apiKey": "OPENROUTER_API_KEY",
|
|
403
|
+
"api": "openai-completions",
|
|
404
|
+
"models": [
|
|
405
|
+
{
|
|
406
|
+
"id": "openrouter/anthropic/claude-3.5-sonnet",
|
|
407
|
+
"name": "OpenRouter Claude 3.5 Sonnet",
|
|
408
|
+
"compat": {
|
|
409
|
+
"openRouterRouting": {
|
|
410
|
+
"allow_fallbacks": true,
|
|
411
|
+
"require_parameters": false,
|
|
412
|
+
"data_collection": "deny",
|
|
413
|
+
"zdr": true,
|
|
414
|
+
"enforce_distillable_text": false,
|
|
415
|
+
"order": ["anthropic", "amazon-bedrock", "google-vertex"],
|
|
416
|
+
"only": ["anthropic", "amazon-bedrock"],
|
|
417
|
+
"ignore": ["gmicloud", "friendli"],
|
|
418
|
+
"quantizations": ["fp16", "bf16"],
|
|
419
|
+
"sort": {
|
|
420
|
+
"by": "price",
|
|
421
|
+
"partition": "model"
|
|
422
|
+
},
|
|
423
|
+
"max_price": {
|
|
424
|
+
"prompt": 10,
|
|
425
|
+
"completion": 20
|
|
426
|
+
},
|
|
427
|
+
"preferred_min_throughput": {
|
|
428
|
+
"p50": 100,
|
|
429
|
+
"p90": 50
|
|
430
|
+
},
|
|
431
|
+
"preferred_max_latency": {
|
|
432
|
+
"p50": 1,
|
|
433
|
+
"p90": 3,
|
|
434
|
+
"p99": 5
|
|
435
|
+
}
|
|
436
|
+
}
|
|
437
|
+
}
|
|
438
|
+
}
|
|
439
|
+
]
|
|
440
|
+
}
|
|
441
|
+
}
|
|
442
|
+
}
|
|
443
|
+
```
|
|
444
|
+
|
|
445
|
+
Vercel AI Gateway example:
|
|
446
|
+
|
|
447
|
+
```json
|
|
448
|
+
{
|
|
449
|
+
"providers": {
|
|
450
|
+
"vercel-ai-gateway": {
|
|
451
|
+
"baseUrl": "https://ai-gateway.vercel.sh/v1",
|
|
452
|
+
"apiKey": "AI_GATEWAY_API_KEY",
|
|
453
|
+
"api": "openai-completions",
|
|
454
|
+
"models": [
|
|
455
|
+
{
|
|
456
|
+
"id": "moonshotai/kimi-k2.5",
|
|
457
|
+
"name": "Kimi K2.5 (Fireworks via Vercel)",
|
|
458
|
+
"reasoning": true,
|
|
459
|
+
"input": ["text", "image"],
|
|
460
|
+
"cost": { "input": 0.6, "output": 3, "cacheRead": 0, "cacheWrite": 0 },
|
|
461
|
+
"contextWindow": 262144,
|
|
462
|
+
"maxTokens": 262144,
|
|
463
|
+
"compat": {
|
|
464
|
+
"vercelGatewayRouting": {
|
|
465
|
+
"only": ["fireworks", "novita"],
|
|
466
|
+
"order": ["fireworks", "novita"]
|
|
467
|
+
}
|
|
468
|
+
}
|
|
469
|
+
}
|
|
470
|
+
]
|
|
471
|
+
}
|
|
472
|
+
}
|
|
473
|
+
}
|
|
474
|
+
```
|
package/docs/packages.md
ADDED
|
@@ -0,0 +1,223 @@
|
|
|
1
|
+
> pi can help you create pi packages. Ask it to bundle your extensions, skills, prompt templates, or themes.
|
|
2
|
+
|
|
3
|
+
# Pi Packages
|
|
4
|
+
|
|
5
|
+
Pi packages bundle extensions, skills, prompt templates, and themes so you can share them through npm or git. A package can declare resources in `package.json` under the `pi` key, or use conventional directories.
|
|
6
|
+
|
|
7
|
+
## Table of Contents
|
|
8
|
+
|
|
9
|
+
- [Install and Manage](#install-and-manage)
|
|
10
|
+
- [Package Sources](#package-sources)
|
|
11
|
+
- [Creating a Pi Package](#creating-a-pi-package)
|
|
12
|
+
- [Package Structure](#package-structure)
|
|
13
|
+
- [Dependencies](#dependencies)
|
|
14
|
+
- [Package Filtering](#package-filtering)
|
|
15
|
+
- [Enable and Disable Resources](#enable-and-disable-resources)
|
|
16
|
+
- [Scope and Deduplication](#scope-and-deduplication)
|
|
17
|
+
|
|
18
|
+
## Install and Manage
|
|
19
|
+
|
|
20
|
+
> **Security:** Pi packages run with full system access. Extensions execute arbitrary code, and skills can instruct the model to perform any action including running executables. Review source code before installing third-party packages.
|
|
21
|
+
|
|
22
|
+
```bash
|
|
23
|
+
pi install npm:@foo/bar@1.0.0
|
|
24
|
+
pi install git:github.com/user/repo@v1
|
|
25
|
+
pi install https://github.com/user/repo # raw URLs work too
|
|
26
|
+
pi install /absolute/path/to/package
|
|
27
|
+
pi install ./relative/path/to/package
|
|
28
|
+
|
|
29
|
+
pi remove npm:@foo/bar
|
|
30
|
+
pi list # show installed packages from settings
|
|
31
|
+
pi update # update pi and all non-pinned packages
|
|
32
|
+
pi update --extensions # update all non-pinned packages only
|
|
33
|
+
pi update --self # update pi only
|
|
34
|
+
pi update --self --force # reinstall pi even if current
|
|
35
|
+
pi update npm:@foo/bar # update one package
|
|
36
|
+
pi update --extension npm:@foo/bar
|
|
37
|
+
```
|
|
38
|
+
|
|
39
|
+
By default, `install` and `remove` write to global settings (`~/.pi/agent/settings.json`). Use `-l` to write to project settings (`.pi/settings.json`) instead. Project settings can be shared with your team, and pi installs any missing packages automatically on startup.
|
|
40
|
+
|
|
41
|
+
To try a package without installing it, use `--extension` or `-e`. This installs to a temporary directory for the current run only:
|
|
42
|
+
|
|
43
|
+
```bash
|
|
44
|
+
pi -e npm:@foo/bar
|
|
45
|
+
pi -e git:github.com/user/repo
|
|
46
|
+
```
|
|
47
|
+
|
|
48
|
+
## Package Sources
|
|
49
|
+
|
|
50
|
+
Pi accepts three source types in settings and `pi install`.
|
|
51
|
+
|
|
52
|
+
### npm
|
|
53
|
+
|
|
54
|
+
```
|
|
55
|
+
npm:@scope/pkg@1.2.3
|
|
56
|
+
npm:pkg
|
|
57
|
+
```
|
|
58
|
+
|
|
59
|
+
- Versioned specs are pinned and skipped by package updates (`pi update`, `pi update --extensions`).
|
|
60
|
+
- Global installs use `npm install -g`.
|
|
61
|
+
- Project installs go under `.pi/npm/`.
|
|
62
|
+
- Set `npmCommand` in `settings.json` to pin npm package lookup and install operations to a specific wrapper command such as `mise` or `asdf`.
|
|
63
|
+
|
|
64
|
+
Example:
|
|
65
|
+
|
|
66
|
+
```json
|
|
67
|
+
{
|
|
68
|
+
"npmCommand": ["mise", "exec", "node@20", "--", "npm"]
|
|
69
|
+
}
|
|
70
|
+
```
|
|
71
|
+
|
|
72
|
+
### git
|
|
73
|
+
|
|
74
|
+
```
|
|
75
|
+
git:github.com/user/repo@v1
|
|
76
|
+
git:git@github.com:user/repo@v1
|
|
77
|
+
https://github.com/user/repo@v1
|
|
78
|
+
ssh://git@github.com/user/repo@v1
|
|
79
|
+
```
|
|
80
|
+
|
|
81
|
+
- Without `git:` prefix, only protocol URLs are accepted (`https://`, `http://`, `ssh://`, `git://`).
|
|
82
|
+
- With `git:` prefix, shorthand formats are accepted, including `github.com/user/repo` and `git@github.com:user/repo`.
|
|
83
|
+
- HTTPS and SSH URLs are both supported.
|
|
84
|
+
- SSH URLs use your configured SSH keys automatically (respects `~/.ssh/config`).
|
|
85
|
+
- For non-interactive runs (for example CI), you can set `GIT_TERMINAL_PROMPT=0` to disable credential prompts and set `GIT_SSH_COMMAND` (for example `ssh -o BatchMode=yes -o ConnectTimeout=5`) to fail fast.
|
|
86
|
+
- Refs pin the package and skip package updates (`pi update`, `pi update --extensions`).
|
|
87
|
+
- Cloned to `~/.pi/agent/git/<host>/<path>` (global) or `.pi/git/<host>/<path>` (project).
|
|
88
|
+
- Runs `npm install` after clone or pull if `package.json` exists.
|
|
89
|
+
|
|
90
|
+
**SSH examples:**
|
|
91
|
+
```bash
|
|
92
|
+
# git@host:path shorthand (requires git: prefix)
|
|
93
|
+
pi install git:git@github.com:user/repo
|
|
94
|
+
|
|
95
|
+
# ssh:// protocol format
|
|
96
|
+
pi install ssh://git@github.com/user/repo
|
|
97
|
+
|
|
98
|
+
# With version ref
|
|
99
|
+
pi install git:git@github.com:user/repo@v1.0.0
|
|
100
|
+
```
|
|
101
|
+
|
|
102
|
+
### Local Paths
|
|
103
|
+
|
|
104
|
+
```
|
|
105
|
+
/absolute/path/to/package
|
|
106
|
+
./relative/path/to/package
|
|
107
|
+
```
|
|
108
|
+
|
|
109
|
+
Local paths point to files or directories on disk and are added to settings without copying. Relative paths are resolved against the settings file they appear in. If the path is a file, it loads as a single extension. If it is a directory, pi loads resources using package rules.
|
|
110
|
+
|
|
111
|
+
## Creating a Pi Package
|
|
112
|
+
|
|
113
|
+
Add a `pi` manifest to `package.json` or use conventional directories. Include the `pi-package` keyword for discoverability.
|
|
114
|
+
|
|
115
|
+
```json
|
|
116
|
+
{
|
|
117
|
+
"name": "my-package",
|
|
118
|
+
"keywords": ["pi-package"],
|
|
119
|
+
"pi": {
|
|
120
|
+
"extensions": ["./extensions"],
|
|
121
|
+
"skills": ["./skills"],
|
|
122
|
+
"prompts": ["./prompts"],
|
|
123
|
+
"themes": ["./themes"]
|
|
124
|
+
}
|
|
125
|
+
}
|
|
126
|
+
```
|
|
127
|
+
|
|
128
|
+
Paths are relative to the package root. Arrays support glob patterns and `!exclusions`.
|
|
129
|
+
|
|
130
|
+
### Gallery Metadata
|
|
131
|
+
|
|
132
|
+
The [package gallery](https://pi.dev/packages) displays packages tagged with `pi-package`. Add `video` or `image` fields to show a preview:
|
|
133
|
+
|
|
134
|
+
```json
|
|
135
|
+
{
|
|
136
|
+
"name": "my-package",
|
|
137
|
+
"keywords": ["pi-package"],
|
|
138
|
+
"pi": {
|
|
139
|
+
"extensions": ["./extensions"],
|
|
140
|
+
"video": "https://example.com/demo.mp4",
|
|
141
|
+
"image": "https://example.com/screenshot.png"
|
|
142
|
+
}
|
|
143
|
+
}
|
|
144
|
+
```
|
|
145
|
+
|
|
146
|
+
- **video**: MP4 only. On desktop, autoplays on hover. Clicking opens a fullscreen player.
|
|
147
|
+
- **image**: PNG, JPEG, GIF, or WebP. Displayed as a static preview.
|
|
148
|
+
|
|
149
|
+
If both are set, video takes precedence.
|
|
150
|
+
|
|
151
|
+
## Package Structure
|
|
152
|
+
|
|
153
|
+
### Convention Directories
|
|
154
|
+
|
|
155
|
+
If no `pi` manifest is present, pi auto-discovers resources from these directories:
|
|
156
|
+
|
|
157
|
+
- `extensions/` loads `.ts` and `.js` files
|
|
158
|
+
- `skills/` recursively finds `SKILL.md` folders and loads top-level `.md` files as skills
|
|
159
|
+
- `prompts/` loads `.md` files
|
|
160
|
+
- `themes/` loads `.json` files
|
|
161
|
+
|
|
162
|
+
## Dependencies
|
|
163
|
+
|
|
164
|
+
Third party runtime dependencies belong in `dependencies` in `package.json`. Dependencies that do not register extensions, skills, prompt templates, or themes also belong in `dependencies`. When pi installs a package from npm or git, it runs `npm install`, so those dependencies are installed automatically.
|
|
165
|
+
|
|
166
|
+
Pi bundles core packages for extensions and skills. If you import any of these, list them in `peerDependencies` with a `"*"` range and do not bundle them: `@earendil-works/pi-ai`, `@earendil-works/pi-agent-core`, `@earendil-works/pi-coding-agent`, `@earendil-works/pi-tui`, `typebox`.
|
|
167
|
+
|
|
168
|
+
Other pi packages must be bundled in your tarball. Add them to `dependencies` and `bundledDependencies`, then reference their resources through `node_modules/` paths. Pi loads packages with separate module roots, so separate installs do not collide or share modules.
|
|
169
|
+
|
|
170
|
+
Example:
|
|
171
|
+
|
|
172
|
+
```json
|
|
173
|
+
{
|
|
174
|
+
"dependencies": {
|
|
175
|
+
"shitty-extensions": "^1.0.1"
|
|
176
|
+
},
|
|
177
|
+
"bundledDependencies": ["shitty-extensions"],
|
|
178
|
+
"pi": {
|
|
179
|
+
"extensions": ["extensions", "node_modules/shitty-extensions/extensions"],
|
|
180
|
+
"skills": ["skills", "node_modules/shitty-extensions/skills"]
|
|
181
|
+
}
|
|
182
|
+
}
|
|
183
|
+
```
|
|
184
|
+
|
|
185
|
+
## Package Filtering
|
|
186
|
+
|
|
187
|
+
Filter what a package loads using the object form in settings:
|
|
188
|
+
|
|
189
|
+
```json
|
|
190
|
+
{
|
|
191
|
+
"packages": [
|
|
192
|
+
"npm:simple-pkg",
|
|
193
|
+
{
|
|
194
|
+
"source": "npm:my-package",
|
|
195
|
+
"extensions": ["extensions/*.ts", "!extensions/legacy.ts"],
|
|
196
|
+
"skills": [],
|
|
197
|
+
"prompts": ["prompts/review.md"],
|
|
198
|
+
"themes": ["+themes/legacy.json"]
|
|
199
|
+
}
|
|
200
|
+
]
|
|
201
|
+
}
|
|
202
|
+
```
|
|
203
|
+
|
|
204
|
+
`+path` and `-path` are exact paths relative to the package root.
|
|
205
|
+
|
|
206
|
+
- Omit a key to load all of that type.
|
|
207
|
+
- Use `[]` to load none of that type.
|
|
208
|
+
- `!pattern` excludes matches.
|
|
209
|
+
- `+path` force-includes an exact path.
|
|
210
|
+
- `-path` force-excludes an exact path.
|
|
211
|
+
- Filters layer on top of the manifest. They narrow down what is already allowed.
|
|
212
|
+
|
|
213
|
+
## Enable and Disable Resources
|
|
214
|
+
|
|
215
|
+
Use `pi config` to enable or disable extensions, skills, prompt templates, and themes from installed packages and local directories. Works for both global (`~/.pi/agent`) and project (`.pi/`) scopes.
|
|
216
|
+
|
|
217
|
+
## Scope and Deduplication
|
|
218
|
+
|
|
219
|
+
Packages can appear in both global and project settings. If the same package appears in both, the project entry wins. Identity is determined by:
|
|
220
|
+
|
|
221
|
+
- npm: package name
|
|
222
|
+
- git: repository URL without ref
|
|
223
|
+
- local: resolved absolute path
|