@lenylvt/pi-coding-agent 0.64.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 +3331 -0
- package/README.md +48 -0
- package/dist/bun/cli.d.ts +3 -0
- package/dist/bun/cli.d.ts.map +1 -0
- package/dist/bun/cli.js +5 -0
- package/dist/bun/cli.js.map +1 -0
- package/dist/cli/args.d.ts +49 -0
- package/dist/cli/args.d.ts.map +1 -0
- package/dist/cli/args.js +292 -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 +83 -0
- package/dist/cli/file-processor.js.map +1 -0
- 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 +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 +35 -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 +14 -0
- package/dist/cli.js.map +1 -0
- package/dist/config.d.ts +69 -0
- package/dist/config.d.ts.map +1 -0
- package/dist/config.js +178 -0
- package/dist/config.js.map +1 -0
- package/dist/core/agent-session.d.ts +622 -0
- package/dist/core/agent-session.d.ts.map +1 -0
- package/dist/core/agent-session.js +2688 -0
- package/dist/core/agent-session.js.map +1 -0
- package/dist/core/auth-storage.d.ts +132 -0
- package/dist/core/auth-storage.d.ts.map +1 -0
- package/dist/core/auth-storage.js +422 -0
- package/dist/core/auth-storage.js.map +1 -0
- package/dist/core/bash-executor.d.ts +46 -0
- package/dist/core/bash-executor.d.ts.map +1 -0
- package/dist/core/bash-executor.js +113 -0
- package/dist/core/bash-executor.js.map +1 -0
- package/dist/core/compaction/branch-summarization.d.ts +88 -0
- package/dist/core/compaction/branch-summarization.d.ts.map +1 -0
- package/dist/core/compaction/branch-summarization.js +243 -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 +613 -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 +38 -0
- package/dist/core/compaction/utils.d.ts.map +1 -0
- package/dist/core/compaction/utils.js +153 -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 +75 -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 +37 -0
- package/dist/core/export-html/index.d.ts.map +1 -0
- package/dist/core/export-html/index.js +224 -0
- package/dist/core/export-html/index.js.map +1 -0
- package/dist/core/export-html/template.css +1001 -0
- package/dist/core/export-html/template.html +55 -0
- package/dist/core/export-html/template.js +1690 -0
- package/dist/core/export-html/tool-renderer.d.ts +38 -0
- package/dist/core/export-html/tool-renderer.d.ts.map +1 -0
- package/dist/core/export-html/tool-renderer.js +95 -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 +12 -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 +436 -0
- package/dist/core/extensions/loader.js.map +1 -0
- package/dist/core/extensions/runner.d.ts +148 -0
- package/dist/core/extensions/runner.d.ts.map +1 -0
- package/dist/core/extensions/runner.js +700 -0
- package/dist/core/extensions/runner.js.map +1 -0
- package/dist/core/extensions/types.d.ts +1085 -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 +20 -0
- package/dist/core/extensions/wrapper.d.ts.map +1 -0
- package/dist/core/extensions/wrapper.js +22 -0
- package/dist/core/extensions/wrapper.js.map +1 -0
- package/dist/core/footer-data-provider.d.ts +44 -0
- package/dist/core/footer-data-provider.d.ts.map +1 -0
- package/dist/core/footer-data-provider.js +252 -0
- package/dist/core/footer-data-provider.js.map +1 -0
- package/dist/core/index.d.ts +10 -0
- package/dist/core/index.d.ts.map +1 -0
- package/dist/core/index.js +10 -0
- package/dist/core/index.js.map +1 -0
- package/dist/core/keybindings.d.ts +275 -0
- package/dist/core/keybindings.d.ts.map +1 -0
- package/dist/core/keybindings.js +241 -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 +132 -0
- package/dist/core/model-registry.d.ts.map +1 -0
- package/dist/core/model-registry.js +565 -0
- package/dist/core/model-registry.js.map +1 -0
- package/dist/core/model-resolver.d.ts +110 -0
- package/dist/core/model-resolver.d.ts.map +1 -0
- package/dist/core/model-resolver.js +464 -0
- package/dist/core/model-resolver.js.map +1 -0
- 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 +172 -0
- package/dist/core/package-manager.d.ts.map +1 -0
- package/dist/core/package-manager.js +1801 -0
- package/dist/core/package-manager.js.map +1 -0
- package/dist/core/prompt-templates.d.ts +51 -0
- package/dist/core/prompt-templates.d.ts.map +1 -0
- package/dist/core/prompt-templates.js +249 -0
- package/dist/core/prompt-templates.js.map +1 -0
- package/dist/core/resolve-config-value.d.ts +23 -0
- package/dist/core/resolve-config-value.d.ts.map +1 -0
- package/dist/core/resolve-config-value.js +126 -0
- package/dist/core/resolve-config-value.js.map +1 -0
- package/dist/core/resource-loader.d.ts +185 -0
- package/dist/core/resource-loader.d.ts.map +1 -0
- package/dist/core/resource-loader.js +698 -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 +233 -0
- package/dist/core/sdk.js.map +1 -0
- package/dist/core/self-update.d.ts +3 -0
- package/dist/core/self-update.d.ts.map +1 -0
- package/dist/core/self-update.js +46 -0
- package/dist/core/self-update.js.map +1 -0
- package/dist/core/session-manager.d.ts +329 -0
- package/dist/core/session-manager.d.ts.map +1 -0
- package/dist/core/session-manager.js +1097 -0
- package/dist/core/session-manager.js.map +1 -0
- package/dist/core/settings-manager.d.ts +237 -0
- package/dist/core/settings-manager.d.ts.map +1 -0
- package/dist/core/settings-manager.js +708 -0
- package/dist/core/settings-manager.js.map +1 -0
- package/dist/core/skills.d.ts +60 -0
- package/dist/core/skills.d.ts.map +1 -0
- package/dist/core/skills.js +409 -0
- package/dist/core/skills.js.map +1 -0
- package/dist/core/slash-commands.d.ts +14 -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/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 +28 -0
- package/dist/core/system-prompt.d.ts.map +1 -0
- package/dist/core/system-prompt.js +116 -0
- package/dist/core/system-prompt.js.map +1 -0
- package/dist/core/timings.d.ts +8 -0
- package/dist/core/timings.d.ts.map +1 -0
- package/dist/core/timings.js +31 -0
- package/dist/core/timings.js.map +1 -0
- package/dist/core/tools/bash.d.ts +73 -0
- package/dist/core/tools/bash.d.ts.map +1 -0
- package/dist/core/tools/bash.js +342 -0
- package/dist/core/tools/bash.js.map +1 -0
- package/dist/core/tools/edit-diff.d.ts +85 -0
- package/dist/core/tools/edit-diff.d.ts.map +1 -0
- package/dist/core/tools/edit-diff.js +337 -0
- package/dist/core/tools/edit-diff.js.map +1 -0
- package/dist/core/tools/edit.d.ts +53 -0
- package/dist/core/tools/edit.d.ts.map +1 -0
- package/dist/core/tools/edit.js +196 -0
- package/dist/core/tools/edit.js.map +1 -0
- 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 +46 -0
- package/dist/core/tools/find.d.ts.map +1 -0
- package/dist/core/tools/find.js +258 -0
- package/dist/core/tools/find.js.map +1 -0
- package/dist/core/tools/grep.d.ts +56 -0
- package/dist/core/tools/grep.d.ts.map +1 -0
- package/dist/core/tools/grep.js +293 -0
- package/dist/core/tools/grep.js.map +1 -0
- package/dist/core/tools/index.d.ts +115 -0
- package/dist/core/tools/index.d.ts.map +1 -0
- package/dist/core/tools/index.js +86 -0
- package/dist/core/tools/index.js.map +1 -0
- package/dist/core/tools/ls.d.ts +46 -0
- package/dist/core/tools/ls.d.ts.map +1 -0
- package/dist/core/tools/ls.js +172 -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 +46 -0
- package/dist/core/tools/read.d.ts.map +1 -0
- package/dist/core/tools/read.js +225 -0
- package/dist/core/tools/read.js.map +1 -0
- 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 +32 -0
- package/dist/core/tools/tool-definition-wrapper.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 +35 -0
- package/dist/core/tools/write.d.ts.map +1 -0
- package/dist/core/tools/write.js +216 -0
- package/dist/core/tools/write.js.map +1 -0
- package/dist/core/version-check.d.ts +2 -0
- package/dist/core/version-check.d.ts.map +1 -0
- package/dist/core/version-check.js +73 -0
- package/dist/core/version-check.js.map +1 -0
- package/dist/index.d.ts +28 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +43 -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 +811 -0
- package/dist/main.js.map +1 -0
- package/dist/migrations.d.ts +32 -0
- package/dist/migrations.d.ts.map +1 -0
- package/dist/migrations.js +258 -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 +18 -0
- package/dist/modes/interactive/components/assistant-message.d.ts.map +1 -0
- package/dist/modes/interactive/components/assistant-message.js +107 -0
- package/dist/modes/interactive/components/assistant-message.js.map +1 -0
- package/dist/modes/interactive/components/bash-execution.d.ts +34 -0
- package/dist/modes/interactive/components/bash-execution.d.ts.map +1 -0
- package/dist/modes/interactive/components/bash-execution.js +175 -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/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 +20 -0
- package/dist/modes/interactive/components/extension-editor.d.ts.map +1 -0
- package/dist/modes/interactive/components/extension-editor.js +111 -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 +198 -0
- package/dist/modes/interactive/components/footer.js.map +1 -0
- package/dist/modes/interactive/components/index.d.ts +31 -0
- package/dist/modes/interactive/components/index.d.ts.map +1 -0
- package/dist/modes/interactive/components/index.js +32 -0
- package/dist/modes/interactive/components/index.js.map +1 -0
- package/dist/modes/interactive/components/keybinding-hints.d.ts +8 -0
- package/dist/modes/interactive/components/keybinding-hints.d.ts.map +1 -0
- package/dist/modes/interactive/components/keybinding-hints.js +22 -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 +275 -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 +848 -0
- package/dist/modes/interactive/components/session-selector.js.map +1 -0
- package/dist/modes/interactive/components/settings-selector.d.ts +58 -0
- package/dist/modes/interactive/components/settings-selector.d.ts.map +1 -0
- package/dist/modes/interactive/components/settings-selector.js +301 -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 +39 -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 +50 -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 +51 -0
- package/dist/modes/interactive/components/thinking-selector.js.map +1 -0
- package/dist/modes/interactive/components/tool-execution.d.ts +58 -0
- package/dist/modes/interactive/components/tool-execution.d.ts.map +1 -0
- package/dist/modes/interactive/components/tool-execution.js +274 -0
- package/dist/modes/interactive/components/tool-execution.js.map +1 -0
- package/dist/modes/interactive/components/tree-selector.d.ts +87 -0
- package/dist/modes/interactive/components/tree-selector.d.ts.map +1 -0
- package/dist/modes/interactive/components/tree-selector.js +1051 -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 +9 -0
- package/dist/modes/interactive/components/user-message.d.ts.map +1 -0
- package/dist/modes/interactive/components/user-message.js +28 -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 +311 -0
- package/dist/modes/interactive/interactive-mode.d.ts.map +1 -0
- package/dist/modes/interactive/interactive-mode.js +3798 -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 +81 -0
- package/dist/modes/interactive/theme/theme.d.ts.map +1 -0
- package/dist/modes/interactive/theme/theme.js +975 -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 +107 -0
- package/dist/modes/print-mode.js.map +1 -0
- 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 +217 -0
- package/dist/modes/rpc/rpc-client.d.ts.map +1 -0
- package/dist/modes/rpc/rpc-client.js +401 -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 +522 -0
- package/dist/modes/rpc/rpc-mode.js.map +1 -0
- package/dist/modes/rpc/rpc-types.d.ts +408 -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/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/child-process.d.ts +11 -0
- package/dist/utils/child-process.d.ts.map +1 -0
- package/dist/utils/child-process.js +78 -0
- package/dist/utils/child-process.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 +245 -0
- package/dist/utils/clipboard-image.js.map +1 -0
- package/dist/utils/clipboard-native.d.ts +8 -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 +78 -0
- package/dist/utils/clipboard.js.map +1 -0
- 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 +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 +39 -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 +137 -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 +252 -0
- package/dist/utils/tools-manager.js.map +1 -0
- package/docs/compaction.md +394 -0
- package/docs/custom-provider.md +327 -0
- package/docs/extensions.md +2229 -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 +82 -0
- package/docs/keybindings.md +173 -0
- package/docs/models.md +197 -0
- package/docs/packages.md +218 -0
- package/docs/prompt-templates.md +67 -0
- package/docs/providers.md +98 -0
- package/docs/release.md +40 -0
- package/docs/rpc.md +1377 -0
- package/docs/sdk.md +971 -0
- package/docs/session.md +412 -0
- package/docs/settings.md +149 -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/tree.md +228 -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/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 +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.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/handoff.ts +153 -0
- package/examples/extensions/hello.ts +25 -0
- package/examples/extensions/hidden-thinking-label.ts +57 -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 +166 -0
- package/examples/extensions/preset.ts +397 -0
- package/examples/extensions/protected-paths.ts +30 -0
- package/examples/extensions/provider-payload.ts +14 -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 +124 -0
- package/examples/extensions/sandbox/index.ts +321 -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 +986 -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/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 +144 -0
- package/examples/extensions/tools.ts +146 -0
- package/examples/extensions/trigger-compact.ts +50 -0
- package/examples/extensions/truncated-tool.ts +195 -0
- package/examples/extensions/widget-placement.ts +17 -0
- package/examples/extensions/with-deps/index.ts +32 -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 +52 -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 +48 -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 +81 -0
- package/examples/sdk/README.md +144 -0
- package/package.json +95 -0
- package/src/bun/cli.ts +5 -0
- package/src/cli/args.ts +309 -0
- package/src/cli/config-selector.ts +52 -0
- package/src/cli/file-processor.ts +100 -0
- package/src/cli/initial-message.ts +43 -0
- package/src/cli/list-models.ts +104 -0
- package/src/cli/session-picker.ts +52 -0
- package/src/cli.ts +16 -0
- package/src/config.ts +214 -0
- package/src/core/agent-session.ts +3279 -0
- package/src/core/auth-storage.ts +488 -0
- package/src/core/bash-executor.ts +158 -0
- package/src/core/compaction/branch-summarization.ts +355 -0
- package/src/core/compaction/compaction.ts +823 -0
- package/src/core/compaction/index.ts +7 -0
- package/src/core/compaction/utils.ts +170 -0
- package/src/core/defaults.ts +3 -0
- package/src/core/diagnostics.ts +15 -0
- package/src/core/event-bus.ts +33 -0
- package/src/core/exec.ts +107 -0
- package/src/core/export-html/ansi-to-html.ts +258 -0
- package/src/core/export-html/index.ts +314 -0
- package/src/core/export-html/template.css +1001 -0
- package/src/core/export-html/template.html +55 -0
- package/src/core/export-html/template.js +1690 -0
- package/src/core/export-html/tool-renderer.ts +156 -0
- package/src/core/export-html/vendor/highlight.min.js +1213 -0
- package/src/core/export-html/vendor/marked.min.js +6 -0
- package/src/core/extensions/index.ts +168 -0
- package/src/core/extensions/loader.ts +557 -0
- package/src/core/extensions/runner.ts +915 -0
- package/src/core/extensions/types.ts +1461 -0
- package/src/core/extensions/wrapper.ts +27 -0
- package/src/core/footer-data-provider.ts +273 -0
- package/src/core/index.ts +61 -0
- package/src/core/keybindings.ts +302 -0
- package/src/core/messages.ts +195 -0
- package/src/core/model-registry.ts +766 -0
- package/src/core/model-resolver.ts +606 -0
- package/src/core/output-guard.ts +74 -0
- package/src/core/package-manager.ts +2222 -0
- package/src/core/prompt-templates.ts +294 -0
- package/src/core/resolve-config-value.ts +142 -0
- package/src/core/resource-loader.ts +886 -0
- package/src/core/sdk.ts +360 -0
- package/src/core/self-update.ts +57 -0
- package/src/core/session-manager.ts +1410 -0
- package/src/core/settings-manager.ts +973 -0
- package/src/core/skills.ts +508 -0
- package/src/core/slash-commands.ts +37 -0
- package/src/core/source-info.ts +40 -0
- package/src/core/system-prompt.ts +168 -0
- package/src/core/timings.ts +31 -0
- package/src/core/tools/bash.ts +431 -0
- package/src/core/tools/edit-diff.ts +445 -0
- package/src/core/tools/edit.ts +307 -0
- package/src/core/tools/file-mutation-queue.ts +39 -0
- package/src/core/tools/find.ts +314 -0
- package/src/core/tools/grep.ts +375 -0
- package/src/core/tools/index.ts +193 -0
- package/src/core/tools/ls.ts +233 -0
- package/src/core/tools/path-utils.ts +94 -0
- package/src/core/tools/read.ts +269 -0
- package/src/core/tools/render-utils.ts +64 -0
- package/src/core/tools/tool-definition-wrapper.ts +43 -0
- package/src/core/tools/truncate.ts +265 -0
- package/src/core/tools/write.ts +285 -0
- package/src/core/version-check.ts +85 -0
- package/src/index.ts +348 -0
- package/src/main.ts +958 -0
- package/src/migrations.ts +290 -0
- package/src/modes/index.ts +9 -0
- package/src/modes/interactive/components/armin.ts +382 -0
- package/src/modes/interactive/components/assistant-message.ts +130 -0
- package/src/modes/interactive/components/bash-execution.ts +218 -0
- package/src/modes/interactive/components/bordered-loader.ts +66 -0
- package/src/modes/interactive/components/branch-summary-message.ts +58 -0
- package/src/modes/interactive/components/compaction-summary-message.ts +59 -0
- package/src/modes/interactive/components/config-selector.ts +592 -0
- package/src/modes/interactive/components/countdown-timer.ts +38 -0
- package/src/modes/interactive/components/custom-editor.ts +80 -0
- package/src/modes/interactive/components/custom-message.ts +99 -0
- package/src/modes/interactive/components/diff.ts +147 -0
- package/src/modes/interactive/components/dynamic-border.ts +25 -0
- package/src/modes/interactive/components/extension-editor.ts +147 -0
- package/src/modes/interactive/components/extension-input.ts +87 -0
- package/src/modes/interactive/components/extension-selector.ts +107 -0
- package/src/modes/interactive/components/footer.ts +216 -0
- package/src/modes/interactive/components/index.ts +31 -0
- package/src/modes/interactive/components/keybinding-hints.ts +24 -0
- package/src/modes/interactive/components/login-dialog.ts +178 -0
- package/src/modes/interactive/components/model-selector.ts +328 -0
- package/src/modes/interactive/components/oauth-selector.ts +121 -0
- package/src/modes/interactive/components/scoped-models-selector.ts +346 -0
- package/src/modes/interactive/components/session-selector-search.ts +194 -0
- package/src/modes/interactive/components/session-selector.ts +1010 -0
- package/src/modes/interactive/components/settings-selector.ts +432 -0
- package/src/modes/interactive/components/show-images-selector.ts +50 -0
- package/src/modes/interactive/components/skill-invocation-message.ts +55 -0
- package/src/modes/interactive/components/theme-selector.ts +67 -0
- package/src/modes/interactive/components/thinking-selector.ts +74 -0
- package/src/modes/interactive/components/tool-execution.ts +328 -0
- package/src/modes/interactive/components/tree-selector.ts +1197 -0
- package/src/modes/interactive/components/user-message-selector.ts +143 -0
- package/src/modes/interactive/components/user-message.ts +33 -0
- package/src/modes/interactive/components/visual-truncate.ts +50 -0
- package/src/modes/interactive/interactive-mode.ts +4501 -0
- package/src/modes/interactive/theme/dark.json +85 -0
- package/src/modes/interactive/theme/light.json +84 -0
- package/src/modes/interactive/theme/theme-schema.json +335 -0
- package/src/modes/interactive/theme/theme.ts +1137 -0
- package/src/modes/print-mode.ts +131 -0
- package/src/modes/rpc/jsonl.ts +58 -0
- package/src/modes/rpc/rpc-client.ts +505 -0
- package/src/modes/rpc/rpc-mode.ts +654 -0
- package/src/modes/rpc/rpc-types.ts +262 -0
- package/src/utils/changelog.ts +99 -0
- package/src/utils/child-process.ts +86 -0
- package/src/utils/clipboard-image.ts +300 -0
- package/src/utils/clipboard-native.ts +22 -0
- package/src/utils/clipboard.ts +81 -0
- package/src/utils/exif-orientation.ts +183 -0
- package/src/utils/frontmatter.ts +39 -0
- package/src/utils/git.ts +192 -0
- package/src/utils/image-convert.ts +41 -0
- package/src/utils/image-resize.ts +176 -0
- package/src/utils/mime.ts +30 -0
- package/src/utils/photon.ts +139 -0
- package/src/utils/shell.ts +202 -0
- package/src/utils/sleep.ts +18 -0
- package/src/utils/tools-manager.ts +287 -0
|
@@ -0,0 +1,508 @@
|
|
|
1
|
+
import { existsSync, readdirSync, readFileSync, realpathSync, statSync } from "fs";
|
|
2
|
+
import ignore from "ignore";
|
|
3
|
+
import { homedir } from "os";
|
|
4
|
+
import { basename, dirname, isAbsolute, join, relative, resolve, sep } from "path";
|
|
5
|
+
import { CONFIG_DIR_NAME, getAgentDir } from "../config.js";
|
|
6
|
+
import { parseFrontmatter } from "../utils/frontmatter.js";
|
|
7
|
+
import type { ResourceDiagnostic } from "./diagnostics.js";
|
|
8
|
+
import { createSyntheticSourceInfo, type SourceInfo } from "./source-info.js";
|
|
9
|
+
|
|
10
|
+
/** Max name length per spec */
|
|
11
|
+
const MAX_NAME_LENGTH = 64;
|
|
12
|
+
|
|
13
|
+
/** Max description length per spec */
|
|
14
|
+
const MAX_DESCRIPTION_LENGTH = 1024;
|
|
15
|
+
|
|
16
|
+
const IGNORE_FILE_NAMES = [".gitignore", ".ignore", ".fdignore"];
|
|
17
|
+
|
|
18
|
+
type IgnoreMatcher = ReturnType<typeof ignore>;
|
|
19
|
+
|
|
20
|
+
function toPosixPath(p: string): string {
|
|
21
|
+
return p.split(sep).join("/");
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
function prefixIgnorePattern(line: string, prefix: string): string | null {
|
|
25
|
+
const trimmed = line.trim();
|
|
26
|
+
if (!trimmed) return null;
|
|
27
|
+
if (trimmed.startsWith("#") && !trimmed.startsWith("\\#")) return null;
|
|
28
|
+
|
|
29
|
+
let pattern = line;
|
|
30
|
+
let negated = false;
|
|
31
|
+
|
|
32
|
+
if (pattern.startsWith("!")) {
|
|
33
|
+
negated = true;
|
|
34
|
+
pattern = pattern.slice(1);
|
|
35
|
+
} else if (pattern.startsWith("\\!")) {
|
|
36
|
+
pattern = pattern.slice(1);
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
if (pattern.startsWith("/")) {
|
|
40
|
+
pattern = pattern.slice(1);
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
const prefixed = prefix ? `${prefix}${pattern}` : pattern;
|
|
44
|
+
return negated ? `!${prefixed}` : prefixed;
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
function addIgnoreRules(ig: IgnoreMatcher, dir: string, rootDir: string): void {
|
|
48
|
+
const relativeDir = relative(rootDir, dir);
|
|
49
|
+
const prefix = relativeDir ? `${toPosixPath(relativeDir)}/` : "";
|
|
50
|
+
|
|
51
|
+
for (const filename of IGNORE_FILE_NAMES) {
|
|
52
|
+
const ignorePath = join(dir, filename);
|
|
53
|
+
if (!existsSync(ignorePath)) continue;
|
|
54
|
+
try {
|
|
55
|
+
const content = readFileSync(ignorePath, "utf-8");
|
|
56
|
+
const patterns = content
|
|
57
|
+
.split(/\r?\n/)
|
|
58
|
+
.map((line) => prefixIgnorePattern(line, prefix))
|
|
59
|
+
.filter((line): line is string => Boolean(line));
|
|
60
|
+
if (patterns.length > 0) {
|
|
61
|
+
ig.add(patterns);
|
|
62
|
+
}
|
|
63
|
+
} catch {}
|
|
64
|
+
}
|
|
65
|
+
}
|
|
66
|
+
|
|
67
|
+
export interface SkillFrontmatter {
|
|
68
|
+
name?: string;
|
|
69
|
+
description?: string;
|
|
70
|
+
"disable-model-invocation"?: boolean;
|
|
71
|
+
[key: string]: unknown;
|
|
72
|
+
}
|
|
73
|
+
|
|
74
|
+
export interface Skill {
|
|
75
|
+
name: string;
|
|
76
|
+
description: string;
|
|
77
|
+
filePath: string;
|
|
78
|
+
baseDir: string;
|
|
79
|
+
sourceInfo: SourceInfo;
|
|
80
|
+
disableModelInvocation: boolean;
|
|
81
|
+
}
|
|
82
|
+
|
|
83
|
+
export interface LoadSkillsResult {
|
|
84
|
+
skills: Skill[];
|
|
85
|
+
diagnostics: ResourceDiagnostic[];
|
|
86
|
+
}
|
|
87
|
+
|
|
88
|
+
/**
|
|
89
|
+
* Validate skill name per Agent Skills spec.
|
|
90
|
+
* Returns array of validation error messages (empty if valid).
|
|
91
|
+
*/
|
|
92
|
+
function validateName(name: string, parentDirName: string): string[] {
|
|
93
|
+
const errors: string[] = [];
|
|
94
|
+
|
|
95
|
+
if (name !== parentDirName) {
|
|
96
|
+
errors.push(`name "${name}" does not match parent directory "${parentDirName}"`);
|
|
97
|
+
}
|
|
98
|
+
|
|
99
|
+
if (name.length > MAX_NAME_LENGTH) {
|
|
100
|
+
errors.push(`name exceeds ${MAX_NAME_LENGTH} characters (${name.length})`);
|
|
101
|
+
}
|
|
102
|
+
|
|
103
|
+
if (!/^[a-z0-9-]+$/.test(name)) {
|
|
104
|
+
errors.push(`name contains invalid characters (must be lowercase a-z, 0-9, hyphens only)`);
|
|
105
|
+
}
|
|
106
|
+
|
|
107
|
+
if (name.startsWith("-") || name.endsWith("-")) {
|
|
108
|
+
errors.push(`name must not start or end with a hyphen`);
|
|
109
|
+
}
|
|
110
|
+
|
|
111
|
+
if (name.includes("--")) {
|
|
112
|
+
errors.push(`name must not contain consecutive hyphens`);
|
|
113
|
+
}
|
|
114
|
+
|
|
115
|
+
return errors;
|
|
116
|
+
}
|
|
117
|
+
|
|
118
|
+
/**
|
|
119
|
+
* Validate description per Agent Skills spec.
|
|
120
|
+
*/
|
|
121
|
+
function validateDescription(description: string | undefined): string[] {
|
|
122
|
+
const errors: string[] = [];
|
|
123
|
+
|
|
124
|
+
if (!description || description.trim() === "") {
|
|
125
|
+
errors.push("description is required");
|
|
126
|
+
} else if (description.length > MAX_DESCRIPTION_LENGTH) {
|
|
127
|
+
errors.push(`description exceeds ${MAX_DESCRIPTION_LENGTH} characters (${description.length})`);
|
|
128
|
+
}
|
|
129
|
+
|
|
130
|
+
return errors;
|
|
131
|
+
}
|
|
132
|
+
|
|
133
|
+
export interface LoadSkillsFromDirOptions {
|
|
134
|
+
/** Directory to scan for skills */
|
|
135
|
+
dir: string;
|
|
136
|
+
/** Source identifier for these skills */
|
|
137
|
+
source: string;
|
|
138
|
+
}
|
|
139
|
+
|
|
140
|
+
function createSkillSourceInfo(filePath: string, baseDir: string, source: string): SourceInfo {
|
|
141
|
+
switch (source) {
|
|
142
|
+
case "user":
|
|
143
|
+
return createSyntheticSourceInfo(filePath, {
|
|
144
|
+
source: "local",
|
|
145
|
+
scope: "user",
|
|
146
|
+
baseDir,
|
|
147
|
+
});
|
|
148
|
+
case "project":
|
|
149
|
+
return createSyntheticSourceInfo(filePath, {
|
|
150
|
+
source: "local",
|
|
151
|
+
scope: "project",
|
|
152
|
+
baseDir,
|
|
153
|
+
});
|
|
154
|
+
case "path":
|
|
155
|
+
return createSyntheticSourceInfo(filePath, {
|
|
156
|
+
source: "local",
|
|
157
|
+
baseDir,
|
|
158
|
+
});
|
|
159
|
+
default:
|
|
160
|
+
return createSyntheticSourceInfo(filePath, { source, baseDir });
|
|
161
|
+
}
|
|
162
|
+
}
|
|
163
|
+
|
|
164
|
+
/**
|
|
165
|
+
* Load skills from a directory.
|
|
166
|
+
*
|
|
167
|
+
* Discovery rules:
|
|
168
|
+
* - if a directory contains SKILL.md, treat it as a skill root and do not recurse further
|
|
169
|
+
* - otherwise, load direct .md children in the root
|
|
170
|
+
* - recurse into subdirectories to find SKILL.md
|
|
171
|
+
*/
|
|
172
|
+
export function loadSkillsFromDir(options: LoadSkillsFromDirOptions): LoadSkillsResult {
|
|
173
|
+
const { dir, source } = options;
|
|
174
|
+
return loadSkillsFromDirInternal(dir, source, true);
|
|
175
|
+
}
|
|
176
|
+
|
|
177
|
+
function loadSkillsFromDirInternal(
|
|
178
|
+
dir: string,
|
|
179
|
+
source: string,
|
|
180
|
+
includeRootFiles: boolean,
|
|
181
|
+
ignoreMatcher?: IgnoreMatcher,
|
|
182
|
+
rootDir?: string,
|
|
183
|
+
): LoadSkillsResult {
|
|
184
|
+
const skills: Skill[] = [];
|
|
185
|
+
const diagnostics: ResourceDiagnostic[] = [];
|
|
186
|
+
|
|
187
|
+
if (!existsSync(dir)) {
|
|
188
|
+
return { skills, diagnostics };
|
|
189
|
+
}
|
|
190
|
+
|
|
191
|
+
const root = rootDir ?? dir;
|
|
192
|
+
const ig = ignoreMatcher ?? ignore();
|
|
193
|
+
addIgnoreRules(ig, dir, root);
|
|
194
|
+
|
|
195
|
+
try {
|
|
196
|
+
const entries = readdirSync(dir, { withFileTypes: true });
|
|
197
|
+
|
|
198
|
+
for (const entry of entries) {
|
|
199
|
+
if (entry.name !== "SKILL.md") {
|
|
200
|
+
continue;
|
|
201
|
+
}
|
|
202
|
+
|
|
203
|
+
const fullPath = join(dir, entry.name);
|
|
204
|
+
|
|
205
|
+
let isFile = entry.isFile();
|
|
206
|
+
if (entry.isSymbolicLink()) {
|
|
207
|
+
try {
|
|
208
|
+
isFile = statSync(fullPath).isFile();
|
|
209
|
+
} catch {
|
|
210
|
+
continue;
|
|
211
|
+
}
|
|
212
|
+
}
|
|
213
|
+
|
|
214
|
+
const relPath = toPosixPath(relative(root, fullPath));
|
|
215
|
+
if (!isFile || ig.ignores(relPath)) {
|
|
216
|
+
continue;
|
|
217
|
+
}
|
|
218
|
+
|
|
219
|
+
const result = loadSkillFromFile(fullPath, source);
|
|
220
|
+
if (result.skill) {
|
|
221
|
+
skills.push(result.skill);
|
|
222
|
+
}
|
|
223
|
+
diagnostics.push(...result.diagnostics);
|
|
224
|
+
return { skills, diagnostics };
|
|
225
|
+
}
|
|
226
|
+
|
|
227
|
+
for (const entry of entries) {
|
|
228
|
+
if (entry.name.startsWith(".")) {
|
|
229
|
+
continue;
|
|
230
|
+
}
|
|
231
|
+
|
|
232
|
+
// Skip node_modules to avoid scanning dependencies
|
|
233
|
+
if (entry.name === "node_modules") {
|
|
234
|
+
continue;
|
|
235
|
+
}
|
|
236
|
+
|
|
237
|
+
const fullPath = join(dir, entry.name);
|
|
238
|
+
|
|
239
|
+
// For symlinks, check if they point to a directory and follow them
|
|
240
|
+
let isDirectory = entry.isDirectory();
|
|
241
|
+
let isFile = entry.isFile();
|
|
242
|
+
if (entry.isSymbolicLink()) {
|
|
243
|
+
try {
|
|
244
|
+
const stats = statSync(fullPath);
|
|
245
|
+
isDirectory = stats.isDirectory();
|
|
246
|
+
isFile = stats.isFile();
|
|
247
|
+
} catch {
|
|
248
|
+
// Broken symlink, skip it
|
|
249
|
+
continue;
|
|
250
|
+
}
|
|
251
|
+
}
|
|
252
|
+
|
|
253
|
+
const relPath = toPosixPath(relative(root, fullPath));
|
|
254
|
+
const ignorePath = isDirectory ? `${relPath}/` : relPath;
|
|
255
|
+
if (ig.ignores(ignorePath)) {
|
|
256
|
+
continue;
|
|
257
|
+
}
|
|
258
|
+
|
|
259
|
+
if (isDirectory) {
|
|
260
|
+
const subResult = loadSkillsFromDirInternal(fullPath, source, false, ig, root);
|
|
261
|
+
skills.push(...subResult.skills);
|
|
262
|
+
diagnostics.push(...subResult.diagnostics);
|
|
263
|
+
continue;
|
|
264
|
+
}
|
|
265
|
+
|
|
266
|
+
if (!isFile || !includeRootFiles || !entry.name.endsWith(".md")) {
|
|
267
|
+
continue;
|
|
268
|
+
}
|
|
269
|
+
|
|
270
|
+
const result = loadSkillFromFile(fullPath, source);
|
|
271
|
+
if (result.skill) {
|
|
272
|
+
skills.push(result.skill);
|
|
273
|
+
}
|
|
274
|
+
diagnostics.push(...result.diagnostics);
|
|
275
|
+
}
|
|
276
|
+
} catch {}
|
|
277
|
+
|
|
278
|
+
return { skills, diagnostics };
|
|
279
|
+
}
|
|
280
|
+
|
|
281
|
+
function loadSkillFromFile(
|
|
282
|
+
filePath: string,
|
|
283
|
+
source: string,
|
|
284
|
+
): { skill: Skill | null; diagnostics: ResourceDiagnostic[] } {
|
|
285
|
+
const diagnostics: ResourceDiagnostic[] = [];
|
|
286
|
+
|
|
287
|
+
try {
|
|
288
|
+
const rawContent = readFileSync(filePath, "utf-8");
|
|
289
|
+
const { frontmatter } = parseFrontmatter<SkillFrontmatter>(rawContent);
|
|
290
|
+
const skillDir = dirname(filePath);
|
|
291
|
+
const parentDirName = basename(skillDir);
|
|
292
|
+
|
|
293
|
+
// Validate description
|
|
294
|
+
const descErrors = validateDescription(frontmatter.description);
|
|
295
|
+
for (const error of descErrors) {
|
|
296
|
+
diagnostics.push({ type: "warning", message: error, path: filePath });
|
|
297
|
+
}
|
|
298
|
+
|
|
299
|
+
// Use name from frontmatter, or fall back to parent directory name
|
|
300
|
+
const name = frontmatter.name || parentDirName;
|
|
301
|
+
|
|
302
|
+
// Validate name
|
|
303
|
+
const nameErrors = validateName(name, parentDirName);
|
|
304
|
+
for (const error of nameErrors) {
|
|
305
|
+
diagnostics.push({ type: "warning", message: error, path: filePath });
|
|
306
|
+
}
|
|
307
|
+
|
|
308
|
+
// Still load the skill even with warnings (unless description is completely missing)
|
|
309
|
+
if (!frontmatter.description || frontmatter.description.trim() === "") {
|
|
310
|
+
return { skill: null, diagnostics };
|
|
311
|
+
}
|
|
312
|
+
|
|
313
|
+
return {
|
|
314
|
+
skill: {
|
|
315
|
+
name,
|
|
316
|
+
description: frontmatter.description,
|
|
317
|
+
filePath,
|
|
318
|
+
baseDir: skillDir,
|
|
319
|
+
sourceInfo: createSkillSourceInfo(filePath, skillDir, source),
|
|
320
|
+
disableModelInvocation: frontmatter["disable-model-invocation"] === true,
|
|
321
|
+
},
|
|
322
|
+
diagnostics,
|
|
323
|
+
};
|
|
324
|
+
} catch (error) {
|
|
325
|
+
const message = error instanceof Error ? error.message : "failed to parse skill file";
|
|
326
|
+
diagnostics.push({ type: "warning", message, path: filePath });
|
|
327
|
+
return { skill: null, diagnostics };
|
|
328
|
+
}
|
|
329
|
+
}
|
|
330
|
+
|
|
331
|
+
/**
|
|
332
|
+
* Format skills for inclusion in a system prompt.
|
|
333
|
+
* Uses XML format per Agent Skills standard.
|
|
334
|
+
* See: https://agentskills.io/integrate-skills
|
|
335
|
+
*
|
|
336
|
+
* Skills with disableModelInvocation=true are excluded from the prompt
|
|
337
|
+
* (they can only be invoked explicitly via /skill:name commands).
|
|
338
|
+
*/
|
|
339
|
+
export function formatSkillsForPrompt(skills: Skill[]): string {
|
|
340
|
+
const visibleSkills = skills.filter((s) => !s.disableModelInvocation);
|
|
341
|
+
|
|
342
|
+
if (visibleSkills.length === 0) {
|
|
343
|
+
return "";
|
|
344
|
+
}
|
|
345
|
+
|
|
346
|
+
const lines = [
|
|
347
|
+
"\n\nThe following skills provide specialized instructions for specific tasks.",
|
|
348
|
+
"Use the read tool to load a skill's file when the task matches its description.",
|
|
349
|
+
"When a skill file references a relative path, resolve it against the skill directory (parent of SKILL.md / dirname of the path) and use that absolute path in tool commands.",
|
|
350
|
+
"",
|
|
351
|
+
"<available_skills>",
|
|
352
|
+
];
|
|
353
|
+
|
|
354
|
+
for (const skill of visibleSkills) {
|
|
355
|
+
lines.push(" <skill>");
|
|
356
|
+
lines.push(` <name>${escapeXml(skill.name)}</name>`);
|
|
357
|
+
lines.push(` <description>${escapeXml(skill.description)}</description>`);
|
|
358
|
+
lines.push(` <location>${escapeXml(skill.filePath)}</location>`);
|
|
359
|
+
lines.push(" </skill>");
|
|
360
|
+
}
|
|
361
|
+
|
|
362
|
+
lines.push("</available_skills>");
|
|
363
|
+
|
|
364
|
+
return lines.join("\n");
|
|
365
|
+
}
|
|
366
|
+
|
|
367
|
+
function escapeXml(str: string): string {
|
|
368
|
+
return str
|
|
369
|
+
.replace(/&/g, "&")
|
|
370
|
+
.replace(/</g, "<")
|
|
371
|
+
.replace(/>/g, ">")
|
|
372
|
+
.replace(/"/g, """)
|
|
373
|
+
.replace(/'/g, "'");
|
|
374
|
+
}
|
|
375
|
+
|
|
376
|
+
export interface LoadSkillsOptions {
|
|
377
|
+
/** Working directory for project-local skills. Default: process.cwd() */
|
|
378
|
+
cwd?: string;
|
|
379
|
+
/** Agent config directory for global skills. Default: ~/.pi/agent */
|
|
380
|
+
agentDir?: string;
|
|
381
|
+
/** Explicit skill paths (files or directories) */
|
|
382
|
+
skillPaths?: string[];
|
|
383
|
+
/** Include default skills directories. Default: true */
|
|
384
|
+
includeDefaults?: boolean;
|
|
385
|
+
}
|
|
386
|
+
|
|
387
|
+
function normalizePath(input: string): string {
|
|
388
|
+
const trimmed = input.trim();
|
|
389
|
+
if (trimmed === "~") return homedir();
|
|
390
|
+
if (trimmed.startsWith("~/")) return join(homedir(), trimmed.slice(2));
|
|
391
|
+
if (trimmed.startsWith("~")) return join(homedir(), trimmed.slice(1));
|
|
392
|
+
return trimmed;
|
|
393
|
+
}
|
|
394
|
+
|
|
395
|
+
function resolveSkillPath(p: string, cwd: string): string {
|
|
396
|
+
const normalized = normalizePath(p);
|
|
397
|
+
return isAbsolute(normalized) ? normalized : resolve(cwd, normalized);
|
|
398
|
+
}
|
|
399
|
+
|
|
400
|
+
/**
|
|
401
|
+
* Load skills from all configured locations.
|
|
402
|
+
* Returns skills and any validation diagnostics.
|
|
403
|
+
*/
|
|
404
|
+
export function loadSkills(options: LoadSkillsOptions = {}): LoadSkillsResult {
|
|
405
|
+
const { cwd = process.cwd(), agentDir, skillPaths = [], includeDefaults = true } = options;
|
|
406
|
+
|
|
407
|
+
// Resolve agentDir - if not provided, use default from config
|
|
408
|
+
const resolvedAgentDir = agentDir ?? getAgentDir();
|
|
409
|
+
|
|
410
|
+
const skillMap = new Map<string, Skill>();
|
|
411
|
+
const realPathSet = new Set<string>();
|
|
412
|
+
const allDiagnostics: ResourceDiagnostic[] = [];
|
|
413
|
+
const collisionDiagnostics: ResourceDiagnostic[] = [];
|
|
414
|
+
|
|
415
|
+
function addSkills(result: LoadSkillsResult) {
|
|
416
|
+
allDiagnostics.push(...result.diagnostics);
|
|
417
|
+
for (const skill of result.skills) {
|
|
418
|
+
// Resolve symlinks to detect duplicate files
|
|
419
|
+
let realPath: string;
|
|
420
|
+
try {
|
|
421
|
+
realPath = realpathSync(skill.filePath);
|
|
422
|
+
} catch {
|
|
423
|
+
realPath = skill.filePath;
|
|
424
|
+
}
|
|
425
|
+
|
|
426
|
+
// Skip silently if we've already loaded this exact file (via symlink)
|
|
427
|
+
if (realPathSet.has(realPath)) {
|
|
428
|
+
continue;
|
|
429
|
+
}
|
|
430
|
+
|
|
431
|
+
const existing = skillMap.get(skill.name);
|
|
432
|
+
if (existing) {
|
|
433
|
+
collisionDiagnostics.push({
|
|
434
|
+
type: "collision",
|
|
435
|
+
message: `name "${skill.name}" collision`,
|
|
436
|
+
path: skill.filePath,
|
|
437
|
+
collision: {
|
|
438
|
+
resourceType: "skill",
|
|
439
|
+
name: skill.name,
|
|
440
|
+
winnerPath: existing.filePath,
|
|
441
|
+
loserPath: skill.filePath,
|
|
442
|
+
},
|
|
443
|
+
});
|
|
444
|
+
} else {
|
|
445
|
+
skillMap.set(skill.name, skill);
|
|
446
|
+
realPathSet.add(realPath);
|
|
447
|
+
}
|
|
448
|
+
}
|
|
449
|
+
}
|
|
450
|
+
|
|
451
|
+
if (includeDefaults) {
|
|
452
|
+
addSkills(loadSkillsFromDirInternal(join(resolvedAgentDir, "skills"), "user", true));
|
|
453
|
+
addSkills(loadSkillsFromDirInternal(resolve(cwd, CONFIG_DIR_NAME, "skills"), "project", true));
|
|
454
|
+
}
|
|
455
|
+
|
|
456
|
+
const userSkillsDir = join(resolvedAgentDir, "skills");
|
|
457
|
+
const projectSkillsDir = resolve(cwd, CONFIG_DIR_NAME, "skills");
|
|
458
|
+
|
|
459
|
+
const isUnderPath = (target: string, root: string): boolean => {
|
|
460
|
+
const normalizedRoot = resolve(root);
|
|
461
|
+
if (target === normalizedRoot) {
|
|
462
|
+
return true;
|
|
463
|
+
}
|
|
464
|
+
const prefix = normalizedRoot.endsWith(sep) ? normalizedRoot : `${normalizedRoot}${sep}`;
|
|
465
|
+
return target.startsWith(prefix);
|
|
466
|
+
};
|
|
467
|
+
|
|
468
|
+
const getSource = (resolvedPath: string): "user" | "project" | "path" => {
|
|
469
|
+
if (!includeDefaults) {
|
|
470
|
+
if (isUnderPath(resolvedPath, userSkillsDir)) return "user";
|
|
471
|
+
if (isUnderPath(resolvedPath, projectSkillsDir)) return "project";
|
|
472
|
+
}
|
|
473
|
+
return "path";
|
|
474
|
+
};
|
|
475
|
+
|
|
476
|
+
for (const rawPath of skillPaths) {
|
|
477
|
+
const resolvedPath = resolveSkillPath(rawPath, cwd);
|
|
478
|
+
if (!existsSync(resolvedPath)) {
|
|
479
|
+
allDiagnostics.push({ type: "warning", message: "skill path does not exist", path: resolvedPath });
|
|
480
|
+
continue;
|
|
481
|
+
}
|
|
482
|
+
|
|
483
|
+
try {
|
|
484
|
+
const stats = statSync(resolvedPath);
|
|
485
|
+
const source = getSource(resolvedPath);
|
|
486
|
+
if (stats.isDirectory()) {
|
|
487
|
+
addSkills(loadSkillsFromDirInternal(resolvedPath, source, true));
|
|
488
|
+
} else if (stats.isFile() && resolvedPath.endsWith(".md")) {
|
|
489
|
+
const result = loadSkillFromFile(resolvedPath, source);
|
|
490
|
+
if (result.skill) {
|
|
491
|
+
addSkills({ skills: [result.skill], diagnostics: result.diagnostics });
|
|
492
|
+
} else {
|
|
493
|
+
allDiagnostics.push(...result.diagnostics);
|
|
494
|
+
}
|
|
495
|
+
} else {
|
|
496
|
+
allDiagnostics.push({ type: "warning", message: "skill path is not a markdown file", path: resolvedPath });
|
|
497
|
+
}
|
|
498
|
+
} catch (error) {
|
|
499
|
+
const message = error instanceof Error ? error.message : "failed to read skill path";
|
|
500
|
+
allDiagnostics.push({ type: "warning", message, path: resolvedPath });
|
|
501
|
+
}
|
|
502
|
+
}
|
|
503
|
+
|
|
504
|
+
return {
|
|
505
|
+
skills: Array.from(skillMap.values()),
|
|
506
|
+
diagnostics: [...allDiagnostics, ...collisionDiagnostics],
|
|
507
|
+
};
|
|
508
|
+
}
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
import type { SourceInfo } from "./source-info.js";
|
|
2
|
+
|
|
3
|
+
export type SlashCommandSource = "extension" | "prompt" | "skill";
|
|
4
|
+
|
|
5
|
+
export interface SlashCommandInfo {
|
|
6
|
+
name: string;
|
|
7
|
+
description?: string;
|
|
8
|
+
source: SlashCommandSource;
|
|
9
|
+
sourceInfo: SourceInfo;
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
export interface BuiltinSlashCommand {
|
|
13
|
+
name: string;
|
|
14
|
+
description: string;
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
export const BUILTIN_SLASH_COMMANDS: ReadonlyArray<BuiltinSlashCommand> = [
|
|
18
|
+
{ name: "settings", description: "Open settings menu" },
|
|
19
|
+
{ name: "model", description: "Select model (opens selector UI)" },
|
|
20
|
+
{ name: "scoped-models", description: "Enable/disable models for Ctrl+P cycling" },
|
|
21
|
+
{ name: "export", description: "Export session (HTML default, or specify path: .html/.jsonl)" },
|
|
22
|
+
{ name: "import", description: "Import and resume a session from a JSONL file" },
|
|
23
|
+
{ name: "copy", description: "Copy last agent message to clipboard" },
|
|
24
|
+
{ name: "name", description: "Set session display name" },
|
|
25
|
+
{ name: "session", description: "Show session info and stats" },
|
|
26
|
+
{ name: "changelog", description: "Show changelog entries" },
|
|
27
|
+
{ name: "hotkeys", description: "Show all keyboard shortcuts" },
|
|
28
|
+
{ name: "fork", description: "Create a new fork from a previous message" },
|
|
29
|
+
{ name: "tree", description: "Navigate session tree (switch branches)" },
|
|
30
|
+
{ name: "login", description: "Login with OAuth provider" },
|
|
31
|
+
{ name: "logout", description: "Logout from OAuth provider" },
|
|
32
|
+
{ name: "new", description: "Start a new session" },
|
|
33
|
+
{ name: "compact", description: "Manually compact the session context" },
|
|
34
|
+
{ name: "resume", description: "Resume a different session" },
|
|
35
|
+
{ name: "reload", description: "Reload keybindings, extensions, skills, prompts, and themes" },
|
|
36
|
+
{ name: "quit", description: "Quit pi" },
|
|
37
|
+
];
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
import type { PathMetadata } from "./package-manager.js";
|
|
2
|
+
|
|
3
|
+
export type SourceScope = "user" | "project" | "temporary";
|
|
4
|
+
export type SourceOrigin = "package" | "top-level";
|
|
5
|
+
|
|
6
|
+
export interface SourceInfo {
|
|
7
|
+
path: string;
|
|
8
|
+
source: string;
|
|
9
|
+
scope: SourceScope;
|
|
10
|
+
origin: SourceOrigin;
|
|
11
|
+
baseDir?: string;
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
export function createSourceInfo(path: string, metadata: PathMetadata): SourceInfo {
|
|
15
|
+
return {
|
|
16
|
+
path,
|
|
17
|
+
source: metadata.source,
|
|
18
|
+
scope: metadata.scope,
|
|
19
|
+
origin: metadata.origin,
|
|
20
|
+
baseDir: metadata.baseDir,
|
|
21
|
+
};
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
export function createSyntheticSourceInfo(
|
|
25
|
+
path: string,
|
|
26
|
+
options: {
|
|
27
|
+
source: string;
|
|
28
|
+
scope?: SourceScope;
|
|
29
|
+
origin?: SourceOrigin;
|
|
30
|
+
baseDir?: string;
|
|
31
|
+
},
|
|
32
|
+
): SourceInfo {
|
|
33
|
+
return {
|
|
34
|
+
path,
|
|
35
|
+
source: options.source,
|
|
36
|
+
scope: options.scope ?? "temporary",
|
|
37
|
+
origin: options.origin ?? "top-level",
|
|
38
|
+
baseDir: options.baseDir,
|
|
39
|
+
};
|
|
40
|
+
}
|