@pencil-agent/nano-pencil 0.0.1
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.
Potentially problematic release.
This version of @pencil-agent/nano-pencil might be problematic. Click here for more details.
- package/CHANGELOG.md +2839 -0
- package/README.md +72 -0
- package/dist/cli/args.d.ts +48 -0
- package/dist/cli/args.d.ts.map +1 -0
- package/dist/cli/args.js +298 -0
- package/dist/cli/args.js.map +1 -0
- package/dist/cli/config-selector.d.ts +14 -0
- package/dist/cli/config-selector.d.ts.map +1 -0
- package/dist/cli/config-selector.js +31 -0
- package/dist/cli/config-selector.js.map +1 -0
- package/dist/cli/file-processor.d.ts +15 -0
- package/dist/cli/file-processor.d.ts.map +1 -0
- package/dist/cli/file-processor.js +79 -0
- package/dist/cli/file-processor.js.map +1 -0
- package/dist/cli/list-models.d.ts +9 -0
- package/dist/cli/list-models.d.ts.map +1 -0
- package/dist/cli/list-models.js +92 -0
- package/dist/cli/list-models.js.map +1 -0
- package/dist/cli/session-picker.d.ts +9 -0
- package/dist/cli/session-picker.d.ts.map +1 -0
- package/dist/cli/session-picker.js +34 -0
- package/dist/cli/session-picker.js.map +1 -0
- package/dist/cli.d.ts +3 -0
- package/dist/cli.d.ts.map +1 -0
- package/dist/cli.js +11 -0
- package/dist/cli.js.map +1 -0
- package/dist/config.d.ts +68 -0
- package/dist/config.d.ts.map +1 -0
- package/dist/config.js +203 -0
- package/dist/config.js.map +1 -0
- package/dist/core/agent-session.d.ts +571 -0
- package/dist/core/agent-session.d.ts.map +1 -0
- package/dist/core/agent-session.js +2343 -0
- package/dist/core/agent-session.js.map +1 -0
- package/dist/core/auth-storage.d.ts +129 -0
- package/dist/core/auth-storage.d.ts.map +1 -0
- package/dist/core/auth-storage.js +394 -0
- package/dist/core/auth-storage.js.map +1 -0
- package/dist/core/bash-executor.d.ts +47 -0
- package/dist/core/bash-executor.d.ts.map +1 -0
- package/dist/core/bash-executor.js +212 -0
- package/dist/core/bash-executor.js.map +1 -0
- package/dist/core/compaction/branch-summarization.d.ts +86 -0
- package/dist/core/compaction/branch-summarization.d.ts.map +1 -0
- package/dist/core/compaction/branch-summarization.js +242 -0
- package/dist/core/compaction/branch-summarization.js.map +1 -0
- package/dist/core/compaction/compaction.d.ts +121 -0
- package/dist/core/compaction/compaction.d.ts.map +1 -0
- package/dist/core/compaction/compaction.js +607 -0
- package/dist/core/compaction/compaction.js.map +1 -0
- package/dist/core/compaction/index.d.ts +7 -0
- package/dist/core/compaction/index.d.ts.map +1 -0
- package/dist/core/compaction/index.js +7 -0
- package/dist/core/compaction/index.js.map +1 -0
- package/dist/core/compaction/utils.d.ts +35 -0
- package/dist/core/compaction/utils.d.ts.map +1 -0
- package/dist/core/compaction/utils.js +138 -0
- package/dist/core/compaction/utils.js.map +1 -0
- package/dist/core/defaults.d.ts +3 -0
- package/dist/core/defaults.d.ts.map +1 -0
- package/dist/core/defaults.js +2 -0
- package/dist/core/defaults.js.map +1 -0
- package/dist/core/diagnostics.d.ts +15 -0
- package/dist/core/diagnostics.d.ts.map +1 -0
- package/dist/core/diagnostics.js +2 -0
- package/dist/core/diagnostics.js.map +1 -0
- package/dist/core/event-bus.d.ts +9 -0
- package/dist/core/event-bus.d.ts.map +1 -0
- package/dist/core/event-bus.js +25 -0
- package/dist/core/event-bus.js.map +1 -0
- package/dist/core/exec.d.ts +29 -0
- package/dist/core/exec.d.ts.map +1 -0
- package/dist/core/exec.js +71 -0
- package/dist/core/exec.js.map +1 -0
- package/dist/core/export-html/ansi-to-html.d.ts +22 -0
- package/dist/core/export-html/ansi-to-html.d.ts.map +1 -0
- package/dist/core/export-html/ansi-to-html.js +249 -0
- package/dist/core/export-html/ansi-to-html.js.map +1 -0
- package/dist/core/export-html/index.d.ts +34 -0
- package/dist/core/export-html/index.d.ts.map +1 -0
- package/dist/core/export-html/index.js +222 -0
- package/dist/core/export-html/index.js.map +1 -0
- package/dist/core/export-html/template.css +971 -0
- package/dist/core/export-html/template.html +54 -0
- package/dist/core/export-html/template.js +1586 -0
- package/dist/core/export-html/tool-renderer.d.ts +35 -0
- package/dist/core/export-html/tool-renderer.d.ts.map +1 -0
- package/dist/core/export-html/tool-renderer.js +57 -0
- package/dist/core/export-html/tool-renderer.js.map +1 -0
- package/dist/core/export-html/vendor/highlight.min.js +1213 -0
- package/dist/core/export-html/vendor/marked.min.js +6 -0
- package/dist/core/extensions/index.d.ts +11 -0
- package/dist/core/extensions/index.d.ts.map +1 -0
- package/dist/core/extensions/index.js +9 -0
- package/dist/core/extensions/index.js.map +1 -0
- package/dist/core/extensions/loader.d.ts +25 -0
- package/dist/core/extensions/loader.d.ts.map +1 -0
- package/dist/core/extensions/loader.js +400 -0
- package/dist/core/extensions/loader.js.map +1 -0
- package/dist/core/extensions/runner.d.ts +146 -0
- package/dist/core/extensions/runner.d.ts.map +1 -0
- package/dist/core/extensions/runner.js +641 -0
- package/dist/core/extensions/runner.js.map +1 -0
- package/dist/core/extensions/types.d.ts +984 -0
- package/dist/core/extensions/types.d.ts.map +1 -0
- package/dist/core/extensions/types.js +35 -0
- package/dist/core/extensions/types.js.map +1 -0
- package/dist/core/extensions/wrapper.d.ts +27 -0
- package/dist/core/extensions/wrapper.d.ts.map +1 -0
- package/dist/core/extensions/wrapper.js +102 -0
- package/dist/core/extensions/wrapper.js.map +1 -0
- package/dist/core/footer-data-provider.d.ts +32 -0
- package/dist/core/footer-data-provider.d.ts.map +1 -0
- package/dist/core/footer-data-provider.js +134 -0
- package/dist/core/footer-data-provider.js.map +1 -0
- package/dist/core/index.d.ts +9 -0
- package/dist/core/index.d.ts.map +1 -0
- package/dist/core/index.js +9 -0
- package/dist/core/index.js.map +1 -0
- package/dist/core/keybindings.d.ts +55 -0
- package/dist/core/keybindings.d.ts.map +1 -0
- package/dist/core/keybindings.js +153 -0
- package/dist/core/keybindings.js.map +1 -0
- package/dist/core/messages.d.ts +77 -0
- package/dist/core/messages.d.ts.map +1 -0
- package/dist/core/messages.js +123 -0
- package/dist/core/messages.js.map +1 -0
- package/dist/core/model-registry.d.ts +110 -0
- package/dist/core/model-registry.d.ts.map +1 -0
- package/dist/core/model-registry.js +518 -0
- package/dist/core/model-registry.js.map +1 -0
- package/dist/core/model-resolver.d.ts +104 -0
- package/dist/core/model-resolver.d.ts.map +1 -0
- package/dist/core/model-resolver.js +432 -0
- package/dist/core/model-resolver.js.map +1 -0
- package/dist/core/package-manager.d.ts +151 -0
- package/dist/core/package-manager.d.ts.map +1 -0
- package/dist/core/package-manager.js +1447 -0
- package/dist/core/package-manager.js.map +1 -0
- package/dist/core/prompt-templates.d.ts +50 -0
- package/dist/core/prompt-templates.d.ts.map +1 -0
- package/dist/core/prompt-templates.js +251 -0
- package/dist/core/prompt-templates.js.map +1 -0
- package/dist/core/resolve-config-value.d.ts +17 -0
- package/dist/core/resolve-config-value.d.ts.map +1 -0
- package/dist/core/resolve-config-value.js +59 -0
- package/dist/core/resolve-config-value.js.map +1 -0
- package/dist/core/resource-loader.d.ts +184 -0
- package/dist/core/resource-loader.d.ts.map +1 -0
- package/dist/core/resource-loader.js +670 -0
- package/dist/core/resource-loader.js.map +1 -0
- package/dist/core/sdk.d.ts +90 -0
- package/dist/core/sdk.d.ts.map +1 -0
- package/dist/core/sdk.js +235 -0
- package/dist/core/sdk.js.map +1 -0
- package/dist/core/session-manager.d.ts +323 -0
- package/dist/core/session-manager.d.ts.map +1 -0
- package/dist/core/session-manager.js +1091 -0
- package/dist/core/session-manager.js.map +1 -0
- package/dist/core/settings-manager.d.ts +225 -0
- package/dist/core/settings-manager.d.ts.map +1 -0
- package/dist/core/settings-manager.js +653 -0
- package/dist/core/settings-manager.js.map +1 -0
- package/dist/core/skills.d.ts +58 -0
- package/dist/core/skills.d.ts.map +1 -0
- package/dist/core/skills.js +364 -0
- package/dist/core/skills.js.map +1 -0
- package/dist/core/slash-commands.d.ts +15 -0
- package/dist/core/slash-commands.d.ts.map +1 -0
- package/dist/core/slash-commands.js +22 -0
- package/dist/core/slash-commands.js.map +1 -0
- package/dist/core/system-prompt.d.ts +24 -0
- package/dist/core/system-prompt.d.ts.map +1 -0
- package/dist/core/system-prompt.js +137 -0
- package/dist/core/system-prompt.js.map +1 -0
- package/dist/core/timings.d.ts +7 -0
- package/dist/core/timings.d.ts.map +1 -0
- package/dist/core/timings.js +25 -0
- package/dist/core/timings.js.map +1 -0
- package/dist/core/tools/bash.d.ts +55 -0
- package/dist/core/tools/bash.d.ts.map +1 -0
- package/dist/core/tools/bash.js +242 -0
- package/dist/core/tools/bash.js.map +1 -0
- package/dist/core/tools/edit-diff.d.ts +63 -0
- package/dist/core/tools/edit-diff.d.ts.map +1 -0
- package/dist/core/tools/edit-diff.js +243 -0
- package/dist/core/tools/edit-diff.js.map +1 -0
- package/dist/core/tools/edit.d.ts +39 -0
- package/dist/core/tools/edit.d.ts.map +1 -0
- package/dist/core/tools/edit.js +146 -0
- package/dist/core/tools/edit.js.map +1 -0
- package/dist/core/tools/find.d.ts +39 -0
- package/dist/core/tools/find.d.ts.map +1 -0
- package/dist/core/tools/find.js +206 -0
- package/dist/core/tools/find.js.map +1 -0
- package/dist/core/tools/grep.d.ts +45 -0
- package/dist/core/tools/grep.d.ts.map +1 -0
- package/dist/core/tools/grep.js +239 -0
- package/dist/core/tools/grep.js.map +1 -0
- package/dist/core/tools/index.d.ts +73 -0
- package/dist/core/tools/index.d.ts.map +1 -0
- package/dist/core/tools/index.js +61 -0
- package/dist/core/tools/index.js.map +1 -0
- package/dist/core/tools/ls.d.ts +40 -0
- package/dist/core/tools/ls.d.ts.map +1 -0
- package/dist/core/tools/ls.js +118 -0
- package/dist/core/tools/ls.js.map +1 -0
- package/dist/core/tools/path-utils.d.ts +8 -0
- package/dist/core/tools/path-utils.d.ts.map +1 -0
- package/dist/core/tools/path-utils.js +81 -0
- package/dist/core/tools/path-utils.js.map +1 -0
- package/dist/core/tools/read.d.ts +39 -0
- package/dist/core/tools/read.d.ts.map +1 -0
- package/dist/core/tools/read.js +166 -0
- package/dist/core/tools/read.js.map +1 -0
- package/dist/core/tools/truncate.d.ts +70 -0
- package/dist/core/tools/truncate.d.ts.map +1 -0
- package/dist/core/tools/truncate.js +205 -0
- package/dist/core/tools/truncate.js.map +1 -0
- package/dist/core/tools/write.d.ts +29 -0
- package/dist/core/tools/write.d.ts.map +1 -0
- package/dist/core/tools/write.js +78 -0
- package/dist/core/tools/write.js.map +1 -0
- package/dist/index.d.ts +27 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +42 -0
- package/dist/index.js.map +1 -0
- package/dist/main.d.ts +8 -0
- package/dist/main.d.ts.map +1 -0
- package/dist/main.js +670 -0
- package/dist/main.js.map +1 -0
- package/dist/migrations.d.ts +33 -0
- package/dist/migrations.d.ts.map +1 -0
- package/dist/migrations.js +261 -0
- package/dist/migrations.js.map +1 -0
- package/dist/modes/index.d.ts +9 -0
- package/dist/modes/index.d.ts.map +1 -0
- package/dist/modes/index.js +8 -0
- package/dist/modes/index.js.map +1 -0
- package/dist/modes/interactive/components/armin.d.ts +34 -0
- package/dist/modes/interactive/components/armin.d.ts.map +1 -0
- package/dist/modes/interactive/components/armin.js +333 -0
- package/dist/modes/interactive/components/armin.js.map +1 -0
- package/dist/modes/interactive/components/assistant-message.d.ts +16 -0
- package/dist/modes/interactive/components/assistant-message.d.ts.map +1 -0
- package/dist/modes/interactive/components/assistant-message.js +96 -0
- package/dist/modes/interactive/components/assistant-message.js.map +1 -0
- package/dist/modes/interactive/components/bash-execution.d.ts +35 -0
- package/dist/modes/interactive/components/bash-execution.d.ts.map +1 -0
- package/dist/modes/interactive/components/bash-execution.js +162 -0
- package/dist/modes/interactive/components/bash-execution.js.map +1 -0
- package/dist/modes/interactive/components/bordered-loader.d.ts +16 -0
- package/dist/modes/interactive/components/bordered-loader.d.ts.map +1 -0
- package/dist/modes/interactive/components/bordered-loader.js +51 -0
- package/dist/modes/interactive/components/bordered-loader.js.map +1 -0
- package/dist/modes/interactive/components/branch-summary-message.d.ts +16 -0
- package/dist/modes/interactive/components/branch-summary-message.d.ts.map +1 -0
- package/dist/modes/interactive/components/branch-summary-message.js +44 -0
- package/dist/modes/interactive/components/branch-summary-message.js.map +1 -0
- package/dist/modes/interactive/components/compaction-summary-message.d.ts +16 -0
- package/dist/modes/interactive/components/compaction-summary-message.d.ts.map +1 -0
- package/dist/modes/interactive/components/compaction-summary-message.js +45 -0
- package/dist/modes/interactive/components/compaction-summary-message.js.map +1 -0
- package/dist/modes/interactive/components/config-selector.d.ts +71 -0
- package/dist/modes/interactive/components/config-selector.d.ts.map +1 -0
- package/dist/modes/interactive/components/config-selector.js +479 -0
- package/dist/modes/interactive/components/config-selector.js.map +1 -0
- package/dist/modes/interactive/components/countdown-timer.d.ts +14 -0
- package/dist/modes/interactive/components/countdown-timer.d.ts.map +1 -0
- package/dist/modes/interactive/components/countdown-timer.js +33 -0
- package/dist/modes/interactive/components/countdown-timer.js.map +1 -0
- package/dist/modes/interactive/components/custom-editor.d.ts +21 -0
- package/dist/modes/interactive/components/custom-editor.d.ts.map +1 -0
- package/dist/modes/interactive/components/custom-editor.js +70 -0
- package/dist/modes/interactive/components/custom-editor.js.map +1 -0
- package/dist/modes/interactive/components/custom-message.d.ts +20 -0
- package/dist/modes/interactive/components/custom-message.d.ts.map +1 -0
- package/dist/modes/interactive/components/custom-message.js +79 -0
- package/dist/modes/interactive/components/custom-message.js.map +1 -0
- package/dist/modes/interactive/components/daxnuts.d.ts +23 -0
- package/dist/modes/interactive/components/daxnuts.d.ts.map +1 -0
- package/dist/modes/interactive/components/daxnuts.js +140 -0
- package/dist/modes/interactive/components/daxnuts.js.map +1 -0
- package/dist/modes/interactive/components/diff.d.ts +12 -0
- package/dist/modes/interactive/components/diff.d.ts.map +1 -0
- package/dist/modes/interactive/components/diff.js +133 -0
- package/dist/modes/interactive/components/diff.js.map +1 -0
- package/dist/modes/interactive/components/dynamic-border.d.ts +15 -0
- package/dist/modes/interactive/components/dynamic-border.d.ts.map +1 -0
- package/dist/modes/interactive/components/dynamic-border.js +21 -0
- package/dist/modes/interactive/components/dynamic-border.js.map +1 -0
- package/dist/modes/interactive/components/extension-editor.d.ts +17 -0
- package/dist/modes/interactive/components/extension-editor.d.ts.map +1 -0
- package/dist/modes/interactive/components/extension-editor.js +102 -0
- package/dist/modes/interactive/components/extension-editor.js.map +1 -0
- package/dist/modes/interactive/components/extension-input.d.ts +23 -0
- package/dist/modes/interactive/components/extension-input.d.ts.map +1 -0
- package/dist/modes/interactive/components/extension-input.js +61 -0
- package/dist/modes/interactive/components/extension-input.js.map +1 -0
- package/dist/modes/interactive/components/extension-selector.d.ts +24 -0
- package/dist/modes/interactive/components/extension-selector.d.ts.map +1 -0
- package/dist/modes/interactive/components/extension-selector.js +78 -0
- package/dist/modes/interactive/components/extension-selector.js.map +1 -0
- package/dist/modes/interactive/components/footer.d.ts +26 -0
- package/dist/modes/interactive/components/footer.d.ts.map +1 -0
- package/dist/modes/interactive/components/footer.js +213 -0
- package/dist/modes/interactive/components/footer.js.map +1 -0
- package/dist/modes/interactive/components/index.d.ts +32 -0
- package/dist/modes/interactive/components/index.d.ts.map +1 -0
- package/dist/modes/interactive/components/index.js +33 -0
- package/dist/modes/interactive/components/index.js.map +1 -0
- package/dist/modes/interactive/components/keybinding-hints.d.ts +41 -0
- package/dist/modes/interactive/components/keybinding-hints.d.ts.map +1 -0
- package/dist/modes/interactive/components/keybinding-hints.js +61 -0
- package/dist/modes/interactive/components/keybinding-hints.js.map +1 -0
- package/dist/modes/interactive/components/login-dialog.d.ts +42 -0
- package/dist/modes/interactive/components/login-dialog.d.ts.map +1 -0
- package/dist/modes/interactive/components/login-dialog.js +145 -0
- package/dist/modes/interactive/components/login-dialog.js.map +1 -0
- package/dist/modes/interactive/components/model-selector.d.ts +47 -0
- package/dist/modes/interactive/components/model-selector.d.ts.map +1 -0
- package/dist/modes/interactive/components/model-selector.js +271 -0
- package/dist/modes/interactive/components/model-selector.js.map +1 -0
- package/dist/modes/interactive/components/oauth-selector.d.ts +19 -0
- package/dist/modes/interactive/components/oauth-selector.d.ts.map +1 -0
- package/dist/modes/interactive/components/oauth-selector.js +97 -0
- package/dist/modes/interactive/components/oauth-selector.js.map +1 -0
- package/dist/modes/interactive/components/scoped-models-selector.d.ts +49 -0
- package/dist/modes/interactive/components/scoped-models-selector.d.ts.map +1 -0
- package/dist/modes/interactive/components/scoped-models-selector.js +275 -0
- package/dist/modes/interactive/components/scoped-models-selector.js.map +1 -0
- package/dist/modes/interactive/components/session-selector-search.d.ts +23 -0
- package/dist/modes/interactive/components/session-selector-search.d.ts.map +1 -0
- package/dist/modes/interactive/components/session-selector-search.js +155 -0
- package/dist/modes/interactive/components/session-selector-search.js.map +1 -0
- package/dist/modes/interactive/components/session-selector.d.ts +95 -0
- package/dist/modes/interactive/components/session-selector.d.ts.map +1 -0
- package/dist/modes/interactive/components/session-selector.js +851 -0
- package/dist/modes/interactive/components/session-selector.js.map +1 -0
- package/dist/modes/interactive/components/settings-selector.d.ts +56 -0
- package/dist/modes/interactive/components/settings-selector.d.ts.map +1 -0
- package/dist/modes/interactive/components/settings-selector.js +287 -0
- package/dist/modes/interactive/components/settings-selector.js.map +1 -0
- package/dist/modes/interactive/components/show-images-selector.d.ts +10 -0
- package/dist/modes/interactive/components/show-images-selector.d.ts.map +1 -0
- package/dist/modes/interactive/components/show-images-selector.js +35 -0
- package/dist/modes/interactive/components/show-images-selector.js.map +1 -0
- package/dist/modes/interactive/components/skill-invocation-message.d.ts +17 -0
- package/dist/modes/interactive/components/skill-invocation-message.d.ts.map +1 -0
- package/dist/modes/interactive/components/skill-invocation-message.js +47 -0
- package/dist/modes/interactive/components/skill-invocation-message.js.map +1 -0
- package/dist/modes/interactive/components/theme-selector.d.ts +11 -0
- package/dist/modes/interactive/components/theme-selector.d.ts.map +1 -0
- package/dist/modes/interactive/components/theme-selector.js +46 -0
- package/dist/modes/interactive/components/theme-selector.js.map +1 -0
- package/dist/modes/interactive/components/thinking-selector.d.ts +11 -0
- package/dist/modes/interactive/components/thinking-selector.d.ts.map +1 -0
- package/dist/modes/interactive/components/thinking-selector.js +47 -0
- package/dist/modes/interactive/components/thinking-selector.js.map +1 -0
- package/dist/modes/interactive/components/tool-execution.d.ts +75 -0
- package/dist/modes/interactive/components/tool-execution.d.ts.map +1 -0
- package/dist/modes/interactive/components/tool-execution.js +752 -0
- package/dist/modes/interactive/components/tool-execution.js.map +1 -0
- package/dist/modes/interactive/components/tree-selector.d.ts +68 -0
- package/dist/modes/interactive/components/tree-selector.d.ts.map +1 -0
- package/dist/modes/interactive/components/tree-selector.js +934 -0
- package/dist/modes/interactive/components/tree-selector.js.map +1 -0
- package/dist/modes/interactive/components/user-message-selector.d.ts +30 -0
- package/dist/modes/interactive/components/user-message-selector.d.ts.map +1 -0
- package/dist/modes/interactive/components/user-message-selector.js +113 -0
- package/dist/modes/interactive/components/user-message-selector.js.map +1 -0
- package/dist/modes/interactive/components/user-message.d.ts +8 -0
- package/dist/modes/interactive/components/user-message.d.ts.map +1 -0
- package/dist/modes/interactive/components/user-message.js +16 -0
- package/dist/modes/interactive/components/user-message.js.map +1 -0
- package/dist/modes/interactive/components/visual-truncate.d.ts +24 -0
- package/dist/modes/interactive/components/visual-truncate.d.ts.map +1 -0
- package/dist/modes/interactive/components/visual-truncate.js +33 -0
- package/dist/modes/interactive/components/visual-truncate.js.map +1 -0
- package/dist/modes/interactive/interactive-mode.d.ts +315 -0
- package/dist/modes/interactive/interactive-mode.d.ts.map +1 -0
- package/dist/modes/interactive/interactive-mode.js +3714 -0
- package/dist/modes/interactive/interactive-mode.js.map +1 -0
- package/dist/modes/interactive/theme/dark.json +85 -0
- package/dist/modes/interactive/theme/light.json +84 -0
- package/dist/modes/interactive/theme/theme-schema.json +335 -0
- package/dist/modes/interactive/theme/theme.d.ts +78 -0
- package/dist/modes/interactive/theme/theme.d.ts.map +1 -0
- package/dist/modes/interactive/theme/theme.js +944 -0
- package/dist/modes/interactive/theme/theme.js.map +1 -0
- package/dist/modes/print-mode.d.ts +28 -0
- package/dist/modes/print-mode.d.ts.map +1 -0
- package/dist/modes/print-mode.js +101 -0
- package/dist/modes/print-mode.js.map +1 -0
- package/dist/modes/rpc/rpc-client.d.ts +217 -0
- package/dist/modes/rpc/rpc-client.d.ts.map +1 -0
- package/dist/modes/rpc/rpc-client.js +405 -0
- package/dist/modes/rpc/rpc-client.js.map +1 -0
- package/dist/modes/rpc/rpc-mode.d.ts +20 -0
- package/dist/modes/rpc/rpc-mode.d.ts.map +1 -0
- package/dist/modes/rpc/rpc-mode.js +511 -0
- package/dist/modes/rpc/rpc-mode.js.map +1 -0
- package/dist/modes/rpc/rpc-types.d.ts +409 -0
- package/dist/modes/rpc/rpc-types.d.ts.map +1 -0
- package/dist/modes/rpc/rpc-types.js +8 -0
- package/dist/modes/rpc/rpc-types.js.map +1 -0
- package/dist/nanopencil-defaults.d.ts +35 -0
- package/dist/nanopencil-defaults.d.ts.map +1 -0
- package/dist/nanopencil-defaults.js +66 -0
- package/dist/nanopencil-defaults.js.map +1 -0
- package/dist/utils/changelog.d.ts +21 -0
- package/dist/utils/changelog.d.ts.map +1 -0
- package/dist/utils/changelog.js +87 -0
- package/dist/utils/changelog.js.map +1 -0
- package/dist/utils/clipboard-image.d.ts +11 -0
- package/dist/utils/clipboard-image.d.ts.map +1 -0
- package/dist/utils/clipboard-image.js +162 -0
- package/dist/utils/clipboard-image.js.map +1 -0
- package/dist/utils/clipboard-native.d.ts +7 -0
- package/dist/utils/clipboard-native.d.ts.map +1 -0
- package/dist/utils/clipboard-native.js +14 -0
- package/dist/utils/clipboard-native.js.map +1 -0
- package/dist/utils/clipboard.d.ts +2 -0
- package/dist/utils/clipboard.d.ts.map +1 -0
- package/dist/utils/clipboard.js +67 -0
- package/dist/utils/clipboard.js.map +1 -0
- package/dist/utils/frontmatter.d.ts +8 -0
- package/dist/utils/frontmatter.d.ts.map +1 -0
- package/dist/utils/frontmatter.js +26 -0
- package/dist/utils/frontmatter.js.map +1 -0
- package/dist/utils/git.d.ts +26 -0
- package/dist/utils/git.d.ts.map +1 -0
- package/dist/utils/git.js +163 -0
- package/dist/utils/git.js.map +1 -0
- package/dist/utils/image-convert.d.ts +9 -0
- package/dist/utils/image-convert.d.ts.map +1 -0
- package/dist/utils/image-convert.js +35 -0
- package/dist/utils/image-convert.js.map +1 -0
- package/dist/utils/image-resize.d.ts +36 -0
- package/dist/utils/image-resize.d.ts.map +1 -0
- package/dist/utils/image-resize.js +181 -0
- package/dist/utils/image-resize.js.map +1 -0
- package/dist/utils/mime.d.ts +2 -0
- package/dist/utils/mime.d.ts.map +1 -0
- package/dist/utils/mime.js +26 -0
- package/dist/utils/mime.js.map +1 -0
- package/dist/utils/photon.d.ts +21 -0
- package/dist/utils/photon.d.ts.map +1 -0
- package/dist/utils/photon.js +121 -0
- package/dist/utils/photon.js.map +1 -0
- package/dist/utils/shell.d.ts +26 -0
- package/dist/utils/shell.d.ts.map +1 -0
- package/dist/utils/shell.js +186 -0
- package/dist/utils/shell.js.map +1 -0
- package/dist/utils/sleep.d.ts +5 -0
- package/dist/utils/sleep.d.ts.map +1 -0
- package/dist/utils/sleep.js +17 -0
- package/dist/utils/sleep.js.map +1 -0
- package/dist/utils/tools-manager.d.ts +3 -0
- package/dist/utils/tools-manager.d.ts.map +1 -0
- package/dist/utils/tools-manager.js +251 -0
- package/dist/utils/tools-manager.js.map +1 -0
- package/docs/compaction.md +390 -0
- package/docs/custom-provider.md +548 -0
- package/docs/development.md +69 -0
- package/docs/extensions.md +1935 -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/json.md +79 -0
- package/docs/keybindings.md +174 -0
- package/docs/models.md +293 -0
- package/docs/packages.md +209 -0
- package/docs/prompt-templates.md +67 -0
- package/docs/providers.md +186 -0
- package/docs/publish-npm.md +79 -0
- package/docs/rpc.md +1317 -0
- package/docs/sdk.md +968 -0
- package/docs/session.md +412 -0
- package/docs/settings.md +223 -0
- package/docs/shell-aliases.md +13 -0
- package/docs/skills.md +231 -0
- package/docs/terminal-setup.md +70 -0
- package/docs/termux.md +127 -0
- package/docs/themes.md +295 -0
- package/docs/tree.md +219 -0
- package/docs/tui.md +887 -0
- package/docs/windows.md +17 -0
- package/examples/README.md +25 -0
- package/examples/extensions/README.md +204 -0
- package/examples/extensions/antigravity-image-gen.ts +413 -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/built-in-tool-renderer.ts +246 -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 +114 -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/custom-provider-qwen-cli/index.ts +345 -0
- package/examples/extensions/custom-provider-qwen-cli/package.json +16 -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/event-bus.ts +43 -0
- package/examples/extensions/file-trigger.ts +41 -0
- package/examples/extensions/git-checkpoint.ts +53 -0
- package/examples/extensions/handoff.ts +150 -0
- package/examples/extensions/hello.ts +25 -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 +881 -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 +398 -0
- package/examples/extensions/protected-paths.ts +30 -0
- package/examples/extensions/qna.ts +119 -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 +124 -0
- package/examples/extensions/sandbox/index.ts +318 -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 +40 -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 +964 -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 +195 -0
- package/examples/extensions/system-prompt-header.ts +17 -0
- package/examples/extensions/timed-confirm.ts +70 -0
- package/examples/extensions/titlebar-spinner.ts +58 -0
- package/examples/extensions/todo.ts +299 -0
- package/examples/extensions/tool-override.ts +143 -0
- package/examples/extensions/tools.ts +146 -0
- package/examples/extensions/trigger-compact.ts +40 -0
- package/examples/extensions/truncated-tool.ts +192 -0
- package/examples/extensions/widget-placement.ts +17 -0
- package/examples/extensions/with-deps/index.ts +36 -0
- package/examples/extensions/with-deps/package-lock.json +31 -0
- package/examples/extensions/with-deps/package.json +22 -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 +55 -0
- package/examples/sdk/04-skills.ts +46 -0
- package/examples/sdk/05-tools.ts +56 -0
- package/examples/sdk/06-extensions.ts +88 -0
- package/examples/sdk/07-context-files.ts +40 -0
- package/examples/sdk/08-prompt-templates.ts +47 -0
- package/examples/sdk/09-api-keys-and-oauth.ts +48 -0
- package/examples/sdk/10-settings.ts +51 -0
- package/examples/sdk/11-sessions.ts +48 -0
- package/examples/sdk/12-full-control.ts +82 -0
- package/examples/sdk/README.md +144 -0
- package/package.json +103 -0
package/docs/packages.md
ADDED
|
@@ -0,0 +1,209 @@
|
|
|
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 all non-pinned packages
|
|
32
|
+
```
|
|
33
|
+
|
|
34
|
+
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.
|
|
35
|
+
|
|
36
|
+
To try a package without installing it, use `--extension` or `-e`. This installs to a temporary directory for the current run only:
|
|
37
|
+
|
|
38
|
+
```bash
|
|
39
|
+
pi -e npm:@foo/bar
|
|
40
|
+
pi -e git:github.com/user/repo
|
|
41
|
+
```
|
|
42
|
+
|
|
43
|
+
## Package Sources
|
|
44
|
+
|
|
45
|
+
Pi accepts three source types in settings and `pi install`.
|
|
46
|
+
|
|
47
|
+
### npm
|
|
48
|
+
|
|
49
|
+
```
|
|
50
|
+
npm:@scope/pkg@1.2.3
|
|
51
|
+
npm:pkg
|
|
52
|
+
```
|
|
53
|
+
|
|
54
|
+
- Versioned specs are pinned and skipped by `pi update`.
|
|
55
|
+
- Global installs use `npm install -g`.
|
|
56
|
+
- Project installs go under `.pi/npm/`.
|
|
57
|
+
|
|
58
|
+
### git
|
|
59
|
+
|
|
60
|
+
```
|
|
61
|
+
git:github.com/user/repo@v1
|
|
62
|
+
git:git@github.com:user/repo@v1
|
|
63
|
+
https://github.com/user/repo@v1
|
|
64
|
+
ssh://git@github.com/user/repo@v1
|
|
65
|
+
```
|
|
66
|
+
|
|
67
|
+
- Without `git:` prefix, only protocol URLs are accepted (`https://`, `http://`, `ssh://`, `git://`).
|
|
68
|
+
- With `git:` prefix, shorthand formats are accepted, including `github.com/user/repo` and `git@github.com:user/repo`.
|
|
69
|
+
- HTTPS and SSH URLs are both supported.
|
|
70
|
+
- SSH URLs use your configured SSH keys automatically (respects `~/.ssh/config`).
|
|
71
|
+
- 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.
|
|
72
|
+
- Refs pin the package and skip `pi update`.
|
|
73
|
+
- Cloned to `~/.pi/agent/git/<host>/<path>` (global) or `.pi/git/<host>/<path>` (project).
|
|
74
|
+
- Runs `npm install` after clone or pull if `package.json` exists.
|
|
75
|
+
|
|
76
|
+
**SSH examples:**
|
|
77
|
+
```bash
|
|
78
|
+
# git@host:path shorthand (requires git: prefix)
|
|
79
|
+
pi install git:git@github.com:user/repo
|
|
80
|
+
|
|
81
|
+
# ssh:// protocol format
|
|
82
|
+
pi install ssh://git@github.com/user/repo
|
|
83
|
+
|
|
84
|
+
# With version ref
|
|
85
|
+
pi install git:git@github.com:user/repo@v1.0.0
|
|
86
|
+
```
|
|
87
|
+
|
|
88
|
+
### Local Paths
|
|
89
|
+
|
|
90
|
+
```
|
|
91
|
+
/absolute/path/to/package
|
|
92
|
+
./relative/path/to/package
|
|
93
|
+
```
|
|
94
|
+
|
|
95
|
+
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.
|
|
96
|
+
|
|
97
|
+
## Creating a Pi Package
|
|
98
|
+
|
|
99
|
+
Add a `pi` manifest to `package.json` or use conventional directories. Include the `pi-package` keyword for discoverability.
|
|
100
|
+
|
|
101
|
+
```json
|
|
102
|
+
{
|
|
103
|
+
"name": "my-package",
|
|
104
|
+
"keywords": ["pi-package"],
|
|
105
|
+
"pi": {
|
|
106
|
+
"extensions": ["./extensions"],
|
|
107
|
+
"skills": ["./skills"],
|
|
108
|
+
"prompts": ["./prompts"],
|
|
109
|
+
"themes": ["./themes"]
|
|
110
|
+
}
|
|
111
|
+
}
|
|
112
|
+
```
|
|
113
|
+
|
|
114
|
+
Paths are relative to the package root. Arrays support glob patterns and `!exclusions`.
|
|
115
|
+
|
|
116
|
+
### Gallery Metadata
|
|
117
|
+
|
|
118
|
+
The [package gallery](https://shittycodingagent.ai/packages) displays packages tagged with `pi-package`. Add `video` or `image` fields to show a preview:
|
|
119
|
+
|
|
120
|
+
```json
|
|
121
|
+
{
|
|
122
|
+
"name": "my-package",
|
|
123
|
+
"keywords": ["pi-package"],
|
|
124
|
+
"pi": {
|
|
125
|
+
"extensions": ["./extensions"],
|
|
126
|
+
"video": "https://example.com/demo.mp4",
|
|
127
|
+
"image": "https://example.com/screenshot.png"
|
|
128
|
+
}
|
|
129
|
+
}
|
|
130
|
+
```
|
|
131
|
+
|
|
132
|
+
- **video**: MP4 only. On desktop, autoplays on hover. Clicking opens a fullscreen player.
|
|
133
|
+
- **image**: PNG, JPEG, GIF, or WebP. Displayed as a static preview.
|
|
134
|
+
|
|
135
|
+
If both are set, video takes precedence.
|
|
136
|
+
|
|
137
|
+
## Package Structure
|
|
138
|
+
|
|
139
|
+
### Convention Directories
|
|
140
|
+
|
|
141
|
+
If no `pi` manifest is present, pi auto-discovers resources from these directories:
|
|
142
|
+
|
|
143
|
+
- `extensions/` loads `.ts` and `.js` files
|
|
144
|
+
- `skills/` recursively finds `SKILL.md` folders and loads top-level `.md` files as skills
|
|
145
|
+
- `prompts/` loads `.md` files
|
|
146
|
+
- `themes/` loads `.json` files
|
|
147
|
+
|
|
148
|
+
## Dependencies
|
|
149
|
+
|
|
150
|
+
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.
|
|
151
|
+
|
|
152
|
+
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: `@mariozechner/pi-ai`, `@mariozechner/pi-agent-core`, `@mariozechner/pi-coding-agent`, `@mariozechner/pi-tui`, `@sinclair/typebox`.
|
|
153
|
+
|
|
154
|
+
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.
|
|
155
|
+
|
|
156
|
+
Example:
|
|
157
|
+
|
|
158
|
+
```json
|
|
159
|
+
{
|
|
160
|
+
"dependencies": {
|
|
161
|
+
"shitty-extensions": "^1.0.1"
|
|
162
|
+
},
|
|
163
|
+
"bundledDependencies": ["shitty-extensions"],
|
|
164
|
+
"pi": {
|
|
165
|
+
"extensions": ["extensions", "node_modules/shitty-extensions/extensions"],
|
|
166
|
+
"skills": ["skills", "node_modules/shitty-extensions/skills"]
|
|
167
|
+
}
|
|
168
|
+
}
|
|
169
|
+
```
|
|
170
|
+
|
|
171
|
+
## Package Filtering
|
|
172
|
+
|
|
173
|
+
Filter what a package loads using the object form in settings:
|
|
174
|
+
|
|
175
|
+
```json
|
|
176
|
+
{
|
|
177
|
+
"packages": [
|
|
178
|
+
"npm:simple-pkg",
|
|
179
|
+
{
|
|
180
|
+
"source": "npm:my-package",
|
|
181
|
+
"extensions": ["extensions/*.ts", "!extensions/legacy.ts"],
|
|
182
|
+
"skills": [],
|
|
183
|
+
"prompts": ["prompts/review.md"],
|
|
184
|
+
"themes": ["+themes/legacy.json"]
|
|
185
|
+
}
|
|
186
|
+
]
|
|
187
|
+
}
|
|
188
|
+
```
|
|
189
|
+
|
|
190
|
+
`+path` and `-path` are exact paths relative to the package root.
|
|
191
|
+
|
|
192
|
+
- Omit a key to load all of that type.
|
|
193
|
+
- Use `[]` to load none of that type.
|
|
194
|
+
- `!pattern` excludes matches.
|
|
195
|
+
- `+path` force-includes an exact path.
|
|
196
|
+
- `-path` force-excludes an exact path.
|
|
197
|
+
- Filters layer on top of the manifest. They narrow down what is already allowed.
|
|
198
|
+
|
|
199
|
+
## Enable and Disable Resources
|
|
200
|
+
|
|
201
|
+
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.
|
|
202
|
+
|
|
203
|
+
## Scope and Deduplication
|
|
204
|
+
|
|
205
|
+
Packages can appear in both global and project settings. If the same package appears in both, the project entry wins. Identity is determined by:
|
|
206
|
+
|
|
207
|
+
- npm: package name
|
|
208
|
+
- git: repository URL without ref
|
|
209
|
+
- local: resolved absolute path
|
|
@@ -0,0 +1,67 @@
|
|
|
1
|
+
> pi can create prompt templates. Ask it to build one for your workflow.
|
|
2
|
+
|
|
3
|
+
# Prompt Templates
|
|
4
|
+
|
|
5
|
+
Prompt templates are Markdown snippets that expand into full prompts. Type `/name` in the editor to invoke a template, where `name` is the filename without `.md`.
|
|
6
|
+
|
|
7
|
+
## Locations
|
|
8
|
+
|
|
9
|
+
Pi loads prompt templates from:
|
|
10
|
+
|
|
11
|
+
- Global: `~/.pi/agent/prompts/*.md`
|
|
12
|
+
- Project: `.pi/prompts/*.md`
|
|
13
|
+
- Packages: `prompts/` directories or `pi.prompts` entries in `package.json`
|
|
14
|
+
- Settings: `prompts` array with files or directories
|
|
15
|
+
- CLI: `--prompt-template <path>` (repeatable)
|
|
16
|
+
|
|
17
|
+
Disable discovery with `--no-prompt-templates`.
|
|
18
|
+
|
|
19
|
+
## Format
|
|
20
|
+
|
|
21
|
+
```markdown
|
|
22
|
+
---
|
|
23
|
+
description: Review staged git changes
|
|
24
|
+
---
|
|
25
|
+
Review the staged changes (`git diff --cached`). Focus on:
|
|
26
|
+
- Bugs and logic errors
|
|
27
|
+
- Security issues
|
|
28
|
+
- Error handling gaps
|
|
29
|
+
```
|
|
30
|
+
|
|
31
|
+
- The filename becomes the command name. `review.md` becomes `/review`.
|
|
32
|
+
- `description` is optional. If missing, the first non-empty line is used.
|
|
33
|
+
|
|
34
|
+
## Usage
|
|
35
|
+
|
|
36
|
+
Type `/` followed by the template name in the editor. Autocomplete shows available templates with descriptions.
|
|
37
|
+
|
|
38
|
+
```
|
|
39
|
+
/review # Expands review.md
|
|
40
|
+
/component Button # Expands with argument
|
|
41
|
+
/component Button "click handler" # Multiple arguments
|
|
42
|
+
```
|
|
43
|
+
|
|
44
|
+
## Arguments
|
|
45
|
+
|
|
46
|
+
Templates support positional arguments and simple slicing:
|
|
47
|
+
|
|
48
|
+
- `$1`, `$2`, ... positional args
|
|
49
|
+
- `$@` or `$ARGUMENTS` for all args joined
|
|
50
|
+
- `${@:N}` for args from the Nth position (1-indexed)
|
|
51
|
+
- `${@:N:L}` for `L` args starting at N
|
|
52
|
+
|
|
53
|
+
Example:
|
|
54
|
+
|
|
55
|
+
```markdown
|
|
56
|
+
---
|
|
57
|
+
description: Create a component
|
|
58
|
+
---
|
|
59
|
+
Create a React component named $1 with features: $@
|
|
60
|
+
```
|
|
61
|
+
|
|
62
|
+
Usage: `/component Button "onClick handler" "disabled support"`
|
|
63
|
+
|
|
64
|
+
## Loading Rules
|
|
65
|
+
|
|
66
|
+
- Template discovery in `prompts/` is non-recursive.
|
|
67
|
+
- If you want templates in subdirectories, add them explicitly via `prompts` settings or a package manifest.
|
|
@@ -0,0 +1,186 @@
|
|
|
1
|
+
# Providers
|
|
2
|
+
|
|
3
|
+
Pi supports subscription-based providers via OAuth and API key providers via environment variables or auth file. For each provider, pi knows all available models. The list is updated with every pi release.
|
|
4
|
+
|
|
5
|
+
## Table of Contents
|
|
6
|
+
|
|
7
|
+
- [Subscriptions](#subscriptions)
|
|
8
|
+
- [API Keys](#api-keys)
|
|
9
|
+
- [Auth File](#auth-file)
|
|
10
|
+
- [Cloud Providers](#cloud-providers)
|
|
11
|
+
- [Custom Providers](#custom-providers)
|
|
12
|
+
- [Resolution Order](#resolution-order)
|
|
13
|
+
|
|
14
|
+
## Subscriptions
|
|
15
|
+
|
|
16
|
+
Use `/login` in interactive mode, then select a provider:
|
|
17
|
+
|
|
18
|
+
- Claude Pro/Max
|
|
19
|
+
- ChatGPT Plus/Pro (Codex)
|
|
20
|
+
- GitHub Copilot
|
|
21
|
+
- Google Gemini CLI
|
|
22
|
+
- Google Antigravity
|
|
23
|
+
|
|
24
|
+
Use `/logout` to clear credentials. Tokens are stored in `~/.pi/agent/auth.json` and auto-refresh when expired.
|
|
25
|
+
|
|
26
|
+
### GitHub Copilot
|
|
27
|
+
|
|
28
|
+
- Press Enter for github.com, or enter your GitHub Enterprise Server domain
|
|
29
|
+
- If you get "model not supported", enable it in VS Code: Copilot Chat → model selector → select model → "Enable"
|
|
30
|
+
|
|
31
|
+
### Google Providers
|
|
32
|
+
|
|
33
|
+
- **Gemini CLI**: Standard Gemini models via Cloud Code Assist
|
|
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
|
|
37
|
+
|
|
38
|
+
### OpenAI Codex
|
|
39
|
+
|
|
40
|
+
- Requires ChatGPT Plus or Pro subscription
|
|
41
|
+
- Personal use only; for production, use the OpenAI Platform API
|
|
42
|
+
|
|
43
|
+
## API Keys
|
|
44
|
+
|
|
45
|
+
### Environment Variables or Auth File
|
|
46
|
+
|
|
47
|
+
Set via environment variable:
|
|
48
|
+
|
|
49
|
+
```bash
|
|
50
|
+
export ANTHROPIC_API_KEY=sk-ant-...
|
|
51
|
+
pi
|
|
52
|
+
```
|
|
53
|
+
|
|
54
|
+
| Provider | Environment Variable | `auth.json` key |
|
|
55
|
+
|----------|----------------------|------------------|
|
|
56
|
+
| Anthropic | `ANTHROPIC_API_KEY` | `anthropic` |
|
|
57
|
+
| Azure OpenAI Responses | `AZURE_OPENAI_API_KEY` | `azure-openai-responses` |
|
|
58
|
+
| OpenAI | `OPENAI_API_KEY` | `openai` |
|
|
59
|
+
| Google Gemini | `GEMINI_API_KEY` | `google` |
|
|
60
|
+
| Mistral | `MISTRAL_API_KEY` | `mistral` |
|
|
61
|
+
| Groq | `GROQ_API_KEY` | `groq` |
|
|
62
|
+
| Cerebras | `CEREBRAS_API_KEY` | `cerebras` |
|
|
63
|
+
| xAI | `XAI_API_KEY` | `xai` |
|
|
64
|
+
| OpenRouter | `OPENROUTER_API_KEY` | `openrouter` |
|
|
65
|
+
| Vercel AI Gateway | `AI_GATEWAY_API_KEY` | `vercel-ai-gateway` |
|
|
66
|
+
| ZAI | `ZAI_API_KEY` | `zai` |
|
|
67
|
+
| OpenCode Zen | `OPENCODE_API_KEY` | `opencode` |
|
|
68
|
+
| Hugging Face | `HF_TOKEN` | `huggingface` |
|
|
69
|
+
| Kimi For Coding | `KIMI_API_KEY` | `kimi-coding` |
|
|
70
|
+
| MiniMax | `MINIMAX_API_KEY` | `minimax` |
|
|
71
|
+
| MiniMax (China) | `MINIMAX_CN_API_KEY` | `minimax-cn` |
|
|
72
|
+
|
|
73
|
+
Reference for environment variables and `auth.json` keys: [`const envMap`](https://github.com/badlogic/pi-mono/blob/main/packages/ai/src/env-api-keys.ts) in [`packages/ai/src/env-api-keys.ts`](https://github.com/badlogic/pi-mono/blob/main/packages/ai/src/env-api-keys.ts).
|
|
74
|
+
|
|
75
|
+
#### Auth File
|
|
76
|
+
|
|
77
|
+
Store credentials in `~/.pi/agent/auth.json`:
|
|
78
|
+
|
|
79
|
+
```json
|
|
80
|
+
{
|
|
81
|
+
"anthropic": { "type": "api_key", "key": "sk-ant-..." },
|
|
82
|
+
"openai": { "type": "api_key", "key": "sk-..." },
|
|
83
|
+
"google": { "type": "api_key", "key": "..." },
|
|
84
|
+
"opencode": { "type": "api_key", "key": "..." }
|
|
85
|
+
}
|
|
86
|
+
```
|
|
87
|
+
|
|
88
|
+
The file is created with `0600` permissions (user read/write only). Auth file credentials take priority over environment variables.
|
|
89
|
+
|
|
90
|
+
### Key Resolution
|
|
91
|
+
|
|
92
|
+
The `key` field supports three formats:
|
|
93
|
+
|
|
94
|
+
- **Shell command:** `"!command"` executes and uses stdout (cached for process lifetime)
|
|
95
|
+
```json
|
|
96
|
+
{ "type": "api_key", "key": "!security find-generic-password -ws 'anthropic'" }
|
|
97
|
+
{ "type": "api_key", "key": "!op read 'op://vault/item/credential'" }
|
|
98
|
+
```
|
|
99
|
+
- **Environment variable:** Uses the value of the named variable
|
|
100
|
+
```json
|
|
101
|
+
{ "type": "api_key", "key": "MY_ANTHROPIC_KEY" }
|
|
102
|
+
```
|
|
103
|
+
- **Literal value:** Used directly
|
|
104
|
+
```json
|
|
105
|
+
{ "type": "api_key", "key": "sk-ant-..." }
|
|
106
|
+
```
|
|
107
|
+
|
|
108
|
+
OAuth credentials are also stored here after `/login` and managed automatically.
|
|
109
|
+
|
|
110
|
+
## Cloud Providers
|
|
111
|
+
|
|
112
|
+
### Azure OpenAI
|
|
113
|
+
|
|
114
|
+
```bash
|
|
115
|
+
export AZURE_OPENAI_API_KEY=...
|
|
116
|
+
export AZURE_OPENAI_BASE_URL=https://your-resource.openai.azure.com
|
|
117
|
+
# or use resource name instead of base URL
|
|
118
|
+
export AZURE_OPENAI_RESOURCE_NAME=your-resource
|
|
119
|
+
|
|
120
|
+
# Optional
|
|
121
|
+
export AZURE_OPENAI_API_VERSION=2024-02-01
|
|
122
|
+
export AZURE_OPENAI_DEPLOYMENT_NAME_MAP=gpt-4=my-gpt4,gpt-4o=my-gpt4o
|
|
123
|
+
```
|
|
124
|
+
|
|
125
|
+
### Amazon Bedrock
|
|
126
|
+
|
|
127
|
+
```bash
|
|
128
|
+
# Option 1: AWS Profile
|
|
129
|
+
export AWS_PROFILE=your-profile
|
|
130
|
+
|
|
131
|
+
# Option 2: IAM Keys
|
|
132
|
+
export AWS_ACCESS_KEY_ID=AKIA...
|
|
133
|
+
export AWS_SECRET_ACCESS_KEY=...
|
|
134
|
+
|
|
135
|
+
# Option 3: Bearer Token
|
|
136
|
+
export AWS_BEARER_TOKEN_BEDROCK=...
|
|
137
|
+
|
|
138
|
+
# Optional region (defaults to us-east-1)
|
|
139
|
+
export AWS_REGION=us-west-2
|
|
140
|
+
```
|
|
141
|
+
|
|
142
|
+
Also supports ECS task roles (`AWS_CONTAINER_CREDENTIALS_*`) and IRSA (`AWS_WEB_IDENTITY_TOKEN_FILE`).
|
|
143
|
+
|
|
144
|
+
```bash
|
|
145
|
+
pi --provider amazon-bedrock --model us.anthropic.claude-sonnet-4-20250514-v1:0
|
|
146
|
+
```
|
|
147
|
+
|
|
148
|
+
If you are connecting to a Bedrock API proxy, the following environment variables can be used:
|
|
149
|
+
|
|
150
|
+
```bash
|
|
151
|
+
# Set the URL for the Bedrock proxy (standard AWS SDK env var)
|
|
152
|
+
export AWS_ENDPOINT_URL_BEDROCK_RUNTIME=https://my.corp.proxy/bedrock
|
|
153
|
+
|
|
154
|
+
# Set if your proxy does not require authentication
|
|
155
|
+
export AWS_BEDROCK_SKIP_AUTH=1
|
|
156
|
+
|
|
157
|
+
# Set if your proxy only supports HTTP/1.1
|
|
158
|
+
export AWS_BEDROCK_FORCE_HTTP1=1
|
|
159
|
+
```
|
|
160
|
+
|
|
161
|
+
### Google Vertex AI
|
|
162
|
+
|
|
163
|
+
Uses Application Default Credentials:
|
|
164
|
+
|
|
165
|
+
```bash
|
|
166
|
+
gcloud auth application-default login
|
|
167
|
+
export GOOGLE_CLOUD_PROJECT=your-project
|
|
168
|
+
export GOOGLE_CLOUD_LOCATION=us-central1
|
|
169
|
+
```
|
|
170
|
+
|
|
171
|
+
Or set `GOOGLE_APPLICATION_CREDENTIALS` to a service account key file.
|
|
172
|
+
|
|
173
|
+
## Custom Providers
|
|
174
|
+
|
|
175
|
+
**Via models.json:** Add Ollama, LM Studio, vLLM, or any provider that speaks a supported API (OpenAI Completions, OpenAI Responses, Anthropic Messages, Google Generative AI). See [models.md](models.md).
|
|
176
|
+
|
|
177
|
+
**Via extensions:** For providers that need custom API implementations or OAuth flows, create an extension. See [custom-provider.md](custom-provider.md) and [examples/extensions/custom-provider-gitlab-duo](../examples/extensions/custom-provider-gitlab-duo/).
|
|
178
|
+
|
|
179
|
+
## Resolution Order
|
|
180
|
+
|
|
181
|
+
When resolving credentials for a provider:
|
|
182
|
+
|
|
183
|
+
1. CLI `--api-key` flag
|
|
184
|
+
2. `auth.json` entry (API key or OAuth token)
|
|
185
|
+
3. Environment variable
|
|
186
|
+
4. Custom provider keys from `models.json`
|
|
@@ -0,0 +1,79 @@
|
|
|
1
|
+
# 发布到 npm
|
|
2
|
+
|
|
3
|
+
本文说明如何将 NanoPencil 发布到 npm,使他人可通过 `npm install -g @pencil-agent/nano-pencil` 安装。
|
|
4
|
+
|
|
5
|
+
## 前置条件
|
|
6
|
+
|
|
7
|
+
1. **npm 账号**:在 [npmjs.com](https://www.npmjs.com/) 注册并登录。
|
|
8
|
+
2. **作用域 @pencil-agent**:
|
|
9
|
+
- 若使用组织:在 npm 上创建组织 [pencil-agent](https://www.npmjs.com/org/create),并确保你的账号在该组织内(或有发布权限)。
|
|
10
|
+
- 若使用个人作用域:可把包名改为 `@你的用户名/nano-pencil`,则无需创建组织。
|
|
11
|
+
3. **已配置 package.json**:包名 `@pencil-agent/nano-pencil`、`publishConfig.access: "public"`、`bin.nanopencil`、`piConfig` 等(见 [custom-cli-name.md](custom-cli-name.md))。
|
|
12
|
+
|
|
13
|
+
## 发布步骤
|
|
14
|
+
|
|
15
|
+
在仓库根目录安装依赖并构建(若为 monorepo):
|
|
16
|
+
|
|
17
|
+
```bash
|
|
18
|
+
npm install
|
|
19
|
+
npm run build
|
|
20
|
+
```
|
|
21
|
+
|
|
22
|
+
进入 coding-agent 包目录并发布:
|
|
23
|
+
|
|
24
|
+
```bash
|
|
25
|
+
cd packages/coding-agent
|
|
26
|
+
npm run build
|
|
27
|
+
npm publish
|
|
28
|
+
```
|
|
29
|
+
|
|
30
|
+
首次发布作用域包时,若未在 package.json 中设置 `"publishConfig": { "access": "public" }`,npm 会默认将 `@xxx/yyy` 视为私有;已配置 `access: "public"` 后,无需加 `--access public`。
|
|
31
|
+
|
|
32
|
+
## 发布后
|
|
33
|
+
|
|
34
|
+
用户可全局安装并直接使用:
|
|
35
|
+
|
|
36
|
+
```bash
|
|
37
|
+
npm install -g @pencil-agent/nano-pencil
|
|
38
|
+
nanopencil
|
|
39
|
+
```
|
|
40
|
+
|
|
41
|
+
配置目录为 `~/.nanopencil/agent/`(models.json、settings.json、auth.json 等),与官方 pi(`~/.pi`)互不干扰。
|
|
42
|
+
|
|
43
|
+
**当前发布版仅支持阿里云百炼 Coding Plan**:首次运行若无配置,会提示输入 API Key(sk-sp-...),并持久化到 `~/.nanopencil/agent/auth.json`,之后直接使用无需再输。非交互模式(管道/RPC)下若未配置会报错并提示先运行 `nanopencil` 配置 API Key。
|
|
44
|
+
|
|
45
|
+
## 若发布时报 403
|
|
46
|
+
|
|
47
|
+
若出现:
|
|
48
|
+
|
|
49
|
+
```
|
|
50
|
+
403 Forbidden - PUT ... @pencil-agent/nano-pencil - Two-factor authentication or granular access token with bypass 2fa enabled is required to publish packages.
|
|
51
|
+
```
|
|
52
|
+
|
|
53
|
+
此为 npm 账号安全策略,需在 npm 侧处理其一:
|
|
54
|
+
|
|
55
|
+
1. **开启 2FA 后发布**:在 [npm 账号设置](https://www.npmjs.com/settings/~/account) 中开启 2FA,执行 `npm login` 登录。**发布时必须带上一次性验证码**(验证器 App 中的 6 位数字),否则会 403:
|
|
56
|
+
```bash
|
|
57
|
+
cd packages/coding-agent
|
|
58
|
+
npm publish --access public --otp=123456
|
|
59
|
+
```
|
|
60
|
+
将 `123456` 换成你当前验证器上显示的 6 位数字(每次发布都要新码)。若在交互终端里执行且未加 `--otp`,npm 可能会提示输入 OTP。
|
|
61
|
+
|
|
62
|
+
2. **使用 Granular Access Token(Bypass 2FA)**:在 [Access Tokens](https://www.npmjs.com/settings/~/tokens) 创建 Token,勾选 Read and write、作用域 @pencil-agent、**Bypass 2FA**;在 `~/.npmrc` 中设置 `//registry.npmjs.org/:_authToken=<token>` 后执行 `npm publish --access public`(无需 OTP)。若仍 403,多为该选项未生效,建议改用上一条带 `--otp` 发布。
|
|
63
|
+
|
|
64
|
+
## 版本更新
|
|
65
|
+
|
|
66
|
+
修改版本号后再次发布:
|
|
67
|
+
|
|
68
|
+
```bash
|
|
69
|
+
cd packages/coding-agent
|
|
70
|
+
npm version patch # 或 minor / major
|
|
71
|
+
npm publish
|
|
72
|
+
```
|
|
73
|
+
|
|
74
|
+
建议在发布前在 CHANGELOG.md 中记录本次变更。
|
|
75
|
+
|
|
76
|
+
## 注意事项
|
|
77
|
+
|
|
78
|
+
- 本包依赖 `@mariozechner/pi-agent-core`、`@mariozechner/pi-ai`、`@mariozechner/pi-tui` 等,这些包需已在 npm 上存在(pi-mono 官方已发布),否则安装会失败。
|
|
79
|
+
- 若你 fork 后不再使用上述依赖,需在 package.json 中改为自己的包名或本地 workspace 依赖后再发布。
|