@selesai/code 0.1.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/README.md +198 -0
- package/dist/agents/architect.md +216 -0
- package/dist/agents/builder.md +119 -0
- package/dist/agents/commentator.md +128 -0
- package/dist/agents/explorer.md +51 -0
- package/dist/agents/recapper.md +24 -0
- package/dist/bun/cli.d.ts +3 -0
- package/dist/bun/cli.d.ts.map +1 -0
- package/dist/bun/cli.js +9 -0
- package/dist/bun/cli.js.map +1 -0
- package/dist/bun/register-bedrock.d.ts +2 -0
- package/dist/bun/register-bedrock.d.ts.map +1 -0
- package/dist/bun/register-bedrock.js +4 -0
- package/dist/bun/register-bedrock.js.map +1 -0
- package/dist/bun/restore-sandbox-env.d.ts +17 -0
- package/dist/bun/restore-sandbox-env.d.ts.map +1 -0
- package/dist/bun/restore-sandbox-env.js +36 -0
- package/dist/bun/restore-sandbox-env.js.map +1 -0
- package/dist/cli/args.d.ts +57 -0
- package/dist/cli/args.d.ts.map +1 -0
- package/dist/cli/args.js +379 -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 +82 -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 +98 -0
- package/dist/cli/list-models.js.map +1 -0
- package/dist/cli/project-trust.d.ts +10 -0
- package/dist/cli/project-trust.d.ts.map +1 -0
- package/dist/cli/project-trust.js +48 -0
- package/dist/cli/project-trust.js.map +1 -0
- package/dist/cli/session-picker.d.ts +10 -0
- package/dist/cli/session-picker.d.ts.map +1 -0
- package/dist/cli/session-picker.js +36 -0
- package/dist/cli/session-picker.js.map +1 -0
- package/dist/cli/startup-ui.d.ts +23 -0
- package/dist/cli/startup-ui.d.ts.map +1 -0
- package/dist/cli/startup-ui.js +172 -0
- package/dist/cli/startup-ui.js.map +1 -0
- package/dist/cli.d.ts +3 -0
- package/dist/cli.d.ts.map +1 -0
- package/dist/cli.js +18 -0
- package/dist/cli.js.map +1 -0
- package/dist/config.d.ts +154 -0
- package/dist/config.d.ts.map +1 -0
- package/dist/config.js +579 -0
- package/dist/config.js.map +1 -0
- package/dist/core/agent-session-runtime.d.ts +119 -0
- package/dist/core/agent-session-runtime.d.ts.map +1 -0
- package/dist/core/agent-session-runtime.js +303 -0
- package/dist/core/agent-session-runtime.js.map +1 -0
- package/dist/core/agent-session-services.d.ts +88 -0
- package/dist/core/agent-session-services.d.ts.map +1 -0
- package/dist/core/agent-session-services.js +119 -0
- package/dist/core/agent-session-services.js.map +1 -0
- package/dist/core/agent-session.d.ts +607 -0
- package/dist/core/agent-session.d.ts.map +1 -0
- package/dist/core/agent-session.js +2552 -0
- package/dist/core/agent-session.js.map +1 -0
- package/dist/core/agents.d.ts +53 -0
- package/dist/core/agents.d.ts.map +1 -0
- package/dist/core/agents.js +238 -0
- package/dist/core/agents.js.map +1 -0
- package/dist/core/auth-guidance.d.ts +5 -0
- package/dist/core/auth-guidance.d.ts.map +1 -0
- package/dist/core/auth-guidance.js +21 -0
- package/dist/core/auth-guidance.js.map +1 -0
- package/dist/core/auth-storage.d.ts +140 -0
- package/dist/core/auth-storage.d.ts.map +1 -0
- package/dist/core/auth-storage.js +434 -0
- package/dist/core/auth-storage.js.map +1 -0
- package/dist/core/bash-executor.d.ts +32 -0
- package/dist/core/bash-executor.d.ts.map +1 -0
- package/dist/core/bash-executor.js +111 -0
- package/dist/core/bash-executor.js.map +1 -0
- package/dist/core/compaction/branch-summarization.d.ts +92 -0
- package/dist/core/compaction/branch-summarization.d.ts.map +1 -0
- package/dist/core/compaction/branch-summarization.js +249 -0
- package/dist/core/compaction/branch-summarization.js.map +1 -0
- package/dist/core/compaction/compaction.d.ts +122 -0
- package/dist/core/compaction/compaction.d.ts.map +1 -0
- package/dist/core/compaction/compaction.js +625 -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/experimental.d.ts +2 -0
- package/dist/core/experimental.d.ts.map +1 -0
- package/dist/core/experimental.js +4 -0
- package/dist/core/experimental.js.map +1 -0
- package/dist/core/export-html/ansi-to-html.d.ts +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 +226 -0
- package/dist/core/export-html/index.js.map +1 -0
- package/dist/core/export-html/template.css +1066 -0
- package/dist/core/export-html/template.html +55 -0
- package/dist/core/export-html/template.js +1864 -0
- package/dist/core/export-html/tool-renderer.d.ts +34 -0
- package/dist/core/export-html/tool-renderer.d.ts.map +1 -0
- package/dist/core/export-html/tool-renderer.js +108 -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 +78 -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 +23 -0
- package/dist/core/extensions/loader.d.ts.map +1 -0
- package/dist/core/extensions/loader.js +531 -0
- package/dist/core/extensions/loader.js.map +1 -0
- package/dist/core/extensions/runner.d.ts +166 -0
- package/dist/core/extensions/runner.d.ts.map +1 -0
- package/dist/core/extensions/runner.js +876 -0
- package/dist/core/extensions/runner.js.map +1 -0
- package/dist/core/extensions/types.d.ts +1209 -0
- package/dist/core/extensions/types.d.ts.map +1 -0
- package/dist/core/extensions/types.js +45 -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 +54 -0
- package/dist/core/footer-data-provider.d.ts.map +1 -0
- package/dist/core/footer-data-provider.js +338 -0
- package/dist/core/footer-data-provider.js.map +1 -0
- package/dist/core/http-dispatcher.d.ts +22 -0
- package/dist/core/http-dispatcher.d.ts.map +1 -0
- package/dist/core/http-dispatcher.js +64 -0
- package/dist/core/http-dispatcher.js.map +1 -0
- package/dist/core/index.d.ts +13 -0
- package/dist/core/index.d.ts.map +1 -0
- package/dist/core/index.js +13 -0
- package/dist/core/index.js.map +1 -0
- package/dist/core/keybindings.d.ts +353 -0
- package/dist/core/keybindings.d.ts.map +1 -0
- package/dist/core/keybindings.js +295 -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 +151 -0
- package/dist/core/model-registry.d.ts.map +1 -0
- package/dist/core/model-registry.js +750 -0
- package/dist/core/model-registry.js.map +1 -0
- package/dist/core/model-resolver.d.ts +111 -0
- package/dist/core/model-resolver.d.ts.map +1 -0
- package/dist/core/model-resolver.js +534 -0
- package/dist/core/model-resolver.js.map +1 -0
- package/dist/core/output-guard.d.ts +7 -0
- package/dist/core/output-guard.d.ts.map +1 -0
- package/dist/core/output-guard.js +89 -0
- package/dist/core/output-guard.js.map +1 -0
- package/dist/core/package-manager.d.ts +207 -0
- package/dist/core/package-manager.d.ts.map +1 -0
- package/dist/core/package-manager.js +2088 -0
- package/dist/core/package-manager.js.map +1 -0
- package/dist/core/project-trust.d.ts +15 -0
- package/dist/core/project-trust.d.ts.map +1 -0
- package/dist/core/project-trust.js +59 -0
- package/dist/core/project-trust.js.map +1 -0
- package/dist/core/prompt-templates.d.ts +53 -0
- package/dist/core/prompt-templates.d.ts.map +1 -0
- package/dist/core/prompt-templates.js +236 -0
- package/dist/core/prompt-templates.js.map +1 -0
- package/dist/core/provider-attribution.d.ts +4 -0
- package/dist/core/provider-attribution.d.ts.map +1 -0
- package/dist/core/provider-attribution.js +82 -0
- package/dist/core/provider-attribution.js.map +1 -0
- package/dist/core/provider-display-names.d.ts +2 -0
- package/dist/core/provider-display-names.d.ts.map +1 -0
- package/dist/core/provider-display-names.js +36 -0
- package/dist/core/provider-display-names.js.map +1 -0
- package/dist/core/resolve-config-value.d.ts +30 -0
- package/dist/core/resolve-config-value.d.ts.map +1 -0
- package/dist/core/resolve-config-value.js +247 -0
- package/dist/core/resolve-config-value.js.map +1 -0
- package/dist/core/resource-loader.d.ts +230 -0
- package/dist/core/resource-loader.d.ts.map +1 -0
- package/dist/core/resource-loader.js +861 -0
- package/dist/core/resource-loader.js.map +1 -0
- package/dist/core/sdk.d.ts +109 -0
- package/dist/core/sdk.d.ts.map +1 -0
- package/dist/core/sdk.js +267 -0
- package/dist/core/sdk.js.map +1 -0
- package/dist/core/session-cwd.d.ts +19 -0
- package/dist/core/session-cwd.d.ts.map +1 -0
- package/dist/core/session-cwd.js +38 -0
- package/dist/core/session-cwd.js.map +1 -0
- package/dist/core/session-manager.d.ts +332 -0
- package/dist/core/session-manager.d.ts.map +1 -0
- package/dist/core/session-manager.js +1230 -0
- package/dist/core/session-manager.js.map +1 -0
- package/dist/core/settings-manager.d.ts +286 -0
- package/dist/core/settings-manager.d.ts.map +1 -0
- package/dist/core/settings-manager.js +874 -0
- package/dist/core/settings-manager.js.map +1 -0
- package/dist/core/skills.d.ts +69 -0
- package/dist/core/skills.d.ts.map +1 -0
- package/dist/core/skills.js +387 -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 +26 -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 +31 -0
- package/dist/core/system-prompt.d.ts.map +1 -0
- package/dist/core/system-prompt.js +128 -0
- package/dist/core/system-prompt.js.map +1 -0
- package/dist/core/telemetry.d.ts +3 -0
- package/dist/core/telemetry.d.ts.map +1 -0
- package/dist/core/telemetry.js +9 -0
- package/dist/core/telemetry.js.map +1 -0
- package/dist/core/timings.d.ts +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 +68 -0
- package/dist/core/tools/bash.d.ts.map +1 -0
- package/dist/core/tools/bash.js +346 -0
- package/dist/core/tools/bash.js.map +1 -0
- package/dist/core/tools/edit-diff.d.ts +106 -0
- package/dist/core/tools/edit-diff.d.ts.map +1 -0
- package/dist/core/tools/edit-diff.js +424 -0
- package/dist/core/tools/edit-diff.js.map +1 -0
- package/dist/core/tools/edit.d.ts +51 -0
- package/dist/core/tools/edit.d.ts.map +1 -0
- package/dist/core/tools/edit.js +284 -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 +52 -0
- package/dist/core/tools/file-mutation-queue.js.map +1 -0
- package/dist/core/tools/find.d.ts +35 -0
- package/dist/core/tools/find.d.ts.map +1 -0
- package/dist/core/tools/find.js +305 -0
- package/dist/core/tools/find.js.map +1 -0
- package/dist/core/tools/grep.d.ts +37 -0
- package/dist/core/tools/grep.d.ts.map +1 -0
- package/dist/core/tools/grep.js +304 -0
- package/dist/core/tools/grep.js.map +1 -0
- package/dist/core/tools/index.d.ts +40 -0
- package/dist/core/tools/index.d.ts.map +1 -0
- package/dist/core/tools/index.js +112 -0
- package/dist/core/tools/index.js.map +1 -0
- package/dist/core/tools/ls.d.ts +37 -0
- package/dist/core/tools/ls.d.ts.map +1 -0
- package/dist/core/tools/ls.js +167 -0
- package/dist/core/tools/ls.js.map +1 -0
- package/dist/core/tools/output-accumulator.d.ts +52 -0
- package/dist/core/tools/output-accumulator.d.ts.map +1 -0
- package/dist/core/tools/output-accumulator.js +184 -0
- package/dist/core/tools/output-accumulator.js.map +1 -0
- package/dist/core/tools/path-utils.d.ts +10 -0
- package/dist/core/tools/path-utils.d.ts.map +1 -0
- package/dist/core/tools/path-utils.js +99 -0
- package/dist/core/tools/path-utils.js.map +1 -0
- package/dist/core/tools/read.d.ts +35 -0
- package/dist/core/tools/read.d.ts.map +1 -0
- package/dist/core/tools/read.js +289 -0
- package/dist/core/tools/read.js.map +1 -0
- package/dist/core/tools/render-utils.d.ts +24 -0
- package/dist/core/tools/render-utils.d.ts.map +1 -0
- package/dist/core/tools/render-utils.js +65 -0
- package/dist/core/tools/render-utils.js.map +1 -0
- package/dist/core/tools/tool-definition-wrapper.d.ts +14 -0
- package/dist/core/tools/tool-definition-wrapper.d.ts.map +1 -0
- package/dist/core/tools/tool-definition-wrapper.js +34 -0
- package/dist/core/tools/tool-definition-wrapper.js.map +1 -0
- package/dist/core/tools/truncate.d.ts +70 -0
- package/dist/core/tools/truncate.d.ts.map +1 -0
- package/dist/core/tools/truncate.js +215 -0
- package/dist/core/tools/truncate.js.map +1 -0
- package/dist/core/tools/write.d.ts +26 -0
- package/dist/core/tools/write.d.ts.map +1 -0
- package/dist/core/tools/write.js +197 -0
- package/dist/core/tools/write.js.map +1 -0
- package/dist/core/trust-manager.d.ts +36 -0
- package/dist/core/trust-manager.d.ts.map +1 -0
- package/dist/core/trust-manager.js +202 -0
- package/dist/core/trust-manager.js.map +1 -0
- package/dist/defaults/models.json +3 -0
- package/dist/defaults/settings.json +68 -0
- package/dist/extensions/copy-turn.ts +125 -0
- package/dist/extensions/gitignore-guard.ts +132 -0
- package/dist/extensions/hooks/claude-codex-hooks.json +44 -0
- package/dist/extensions/hooks/copilot-hooks.json +21 -0
- package/dist/extensions/hooks/ponytail-activate.js +91 -0
- package/dist/extensions/hooks/ponytail-config.js +122 -0
- package/dist/extensions/hooks/ponytail-instructions.js +94 -0
- package/dist/extensions/hooks/ponytail-mode-tracker.js +55 -0
- package/dist/extensions/hooks/ponytail-runtime.js +68 -0
- package/dist/extensions/hooks/ponytail-statusline.ps1 +21 -0
- package/dist/extensions/hooks/ponytail-statusline.sh +12 -0
- package/dist/extensions/hooks/ponytail-subagent.js +22 -0
- package/dist/extensions/package.json +19 -0
- package/dist/extensions/pi-extension/index.js +189 -0
- package/dist/extensions/pi-extension/package.json +8 -0
- package/dist/extensions/pi-extension/test/extension.test.js +167 -0
- package/dist/extensions/pi-extension/test/helpers.test.js +92 -0
- package/dist/extensions/pi-powerline-footer/CHANGELOG.md +516 -0
- package/dist/extensions/pi-powerline-footer/README.md +382 -0
- package/dist/extensions/pi-powerline-footer/banner.png +0 -0
- package/dist/extensions/pi-powerline-footer/bash-mode/completion.ts +556 -0
- package/dist/extensions/pi-powerline-footer/bash-mode/editor.ts +397 -0
- package/dist/extensions/pi-powerline-footer/bash-mode/history.ts +151 -0
- package/dist/extensions/pi-powerline-footer/bash-mode/shell-session.ts +286 -0
- package/dist/extensions/pi-powerline-footer/bash-mode/transcript.ts +108 -0
- package/dist/extensions/pi-powerline-footer/bash-mode/types.ts +59 -0
- package/dist/extensions/pi-powerline-footer/colors.ts +69 -0
- package/dist/extensions/pi-powerline-footer/context-usage.ts +41 -0
- package/dist/extensions/pi-powerline-footer/fixed-editor/cluster.ts +113 -0
- package/dist/extensions/pi-powerline-footer/fixed-editor/terminal-split.ts +1077 -0
- package/dist/extensions/pi-powerline-footer/git-status.ts +212 -0
- package/dist/extensions/pi-powerline-footer/icons.ts +181 -0
- package/dist/extensions/pi-powerline-footer/index.ts +2817 -0
- package/dist/extensions/pi-powerline-footer/package.json +46 -0
- package/dist/extensions/pi-powerline-footer/powerline-config.ts +182 -0
- package/dist/extensions/pi-powerline-footer/presets.ts +121 -0
- package/dist/extensions/pi-powerline-footer/render-scheduler.ts +24 -0
- package/dist/extensions/pi-powerline-footer/segments.ts +566 -0
- package/dist/extensions/pi-powerline-footer/separators.ts +57 -0
- package/dist/extensions/pi-powerline-footer/shortcuts.ts +47 -0
- package/dist/extensions/pi-powerline-footer/tests/bash-mode.test.ts +1503 -0
- package/dist/extensions/pi-powerline-footer/tests/context-usage.test.ts +38 -0
- package/dist/extensions/pi-powerline-footer/tests/custom-items.test.ts +135 -0
- package/dist/extensions/pi-powerline-footer/tests/editor-responsiveness.test.ts +180 -0
- package/dist/extensions/pi-powerline-footer/tests/fixed-editor.test.ts +1416 -0
- package/dist/extensions/pi-powerline-footer/tests/jump-shortcuts.test.ts +213 -0
- package/dist/extensions/pi-powerline-footer/tests/stash-shortcut.test.ts +32 -0
- package/dist/extensions/pi-powerline-footer/tests/thinking-segment.test.ts +61 -0
- package/dist/extensions/pi-powerline-footer/tests/working-vibes.test.ts +226 -0
- package/dist/extensions/pi-powerline-footer/theme.example.json +24 -0
- package/dist/extensions/pi-powerline-footer/theme.json +12 -0
- package/dist/extensions/pi-powerline-footer/theme.ts +227 -0
- package/dist/extensions/pi-powerline-footer/types.ts +191 -0
- package/dist/extensions/pi-powerline-footer/welcome-dismiss.ts +34 -0
- package/dist/extensions/pi-powerline-footer/welcome.ts +611 -0
- package/dist/extensions/pi-powerline-footer/working-vibes.ts +695 -0
- package/dist/extensions/prototype.ts +713 -0
- package/dist/extensions/question.ts +350 -0
- package/dist/extensions/rtk.ts +81 -0
- package/dist/extensions/tps-tracker.ts +280 -0
- package/dist/extensions/undo.ts +292 -0
- package/dist/index.d.ts +33 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +46 -0
- package/dist/index.js.map +1 -0
- package/dist/main.d.ts +12 -0
- package/dist/main.d.ts.map +1 -0
- package/dist/main.js +700 -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 +281 -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/assets/clankolas.png +0 -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 +20 -0
- package/dist/modes/interactive/components/assistant-message.d.ts.map +1 -0
- package/dist/modes/interactive/components/assistant-message.js +121 -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 +54 -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 +506 -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/earendil-announcement.d.ts +5 -0
- package/dist/modes/interactive/components/earendil-announcement.d.ts.map +1 -0
- package/dist/modes/interactive/components/earendil-announcement.js +40 -0
- package/dist/modes/interactive/components/earendil-announcement.js.map +1 -0
- package/dist/modes/interactive/components/extension-editor.d.ts +20 -0
- package/dist/modes/interactive/components/extension-editor.d.ts.map +1 -0
- package/dist/modes/interactive/components/extension-editor.js +119 -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 +26 -0
- package/dist/modes/interactive/components/extension-selector.d.ts.map +1 -0
- package/dist/modes/interactive/components/extension-selector.js +83 -0
- package/dist/modes/interactive/components/extension-selector.js.map +1 -0
- package/dist/modes/interactive/components/first-time-setup.d.ts +25 -0
- package/dist/modes/interactive/components/first-time-setup.d.ts.map +1 -0
- package/dist/modes/interactive/components/first-time-setup.js +103 -0
- package/dist/modes/interactive/components/first-time-setup.js.map +1 -0
- package/dist/modes/interactive/components/footer.d.ts +28 -0
- package/dist/modes/interactive/components/footer.d.ts.map +1 -0
- package/dist/modes/interactive/components/footer.js +221 -0
- package/dist/modes/interactive/components/footer.js.map +1 -0
- package/dist/modes/interactive/components/index.d.ts +34 -0
- package/dist/modes/interactive/components/index.d.ts.map +1 -0
- package/dist/modes/interactive/components/index.js +35 -0
- package/dist/modes/interactive/components/index.js.map +1 -0
- package/dist/modes/interactive/components/keybinding-hints.d.ts +13 -0
- package/dist/modes/interactive/components/keybinding-hints.d.ts.map +1 -0
- package/dist/modes/interactive/components/keybinding-hints.js +36 -0
- package/dist/modes/interactive/components/keybinding-hints.js.map +1 -0
- package/dist/modes/interactive/components/login-dialog.d.ts +52 -0
- package/dist/modes/interactive/components/login-dialog.d.ts.map +1 -0
- package/dist/modes/interactive/components/login-dialog.js +179 -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 +279 -0
- package/dist/modes/interactive/components/model-selector.js.map +1 -0
- package/dist/modes/interactive/components/oauth-selector.d.ts +31 -0
- package/dist/modes/interactive/components/oauth-selector.d.ts.map +1 -0
- package/dist/modes/interactive/components/oauth-selector.js +165 -0
- package/dist/modes/interactive/components/oauth-selector.js.map +1 -0
- package/dist/modes/interactive/components/scoped-models-selector.d.ts +42 -0
- package/dist/modes/interactive/components/scoped-models-selector.d.ts.map +1 -0
- package/dist/modes/interactive/components/scoped-models-selector.js +293 -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 +867 -0
- package/dist/modes/interactive/components/session-selector.js.map +1 -0
- package/dist/modes/interactive/components/settings-selector.d.ts +73 -0
- package/dist/modes/interactive/components/settings-selector.d.ts.map +1 -0
- package/dist/modes/interactive/components/settings-selector.js +570 -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 +63 -0
- package/dist/modes/interactive/components/tool-execution.d.ts.map +1 -0
- package/dist/modes/interactive/components/tool-execution.js +317 -0
- package/dist/modes/interactive/components/tool-execution.js.map +1 -0
- package/dist/modes/interactive/components/tree-selector.d.ts +89 -0
- package/dist/modes/interactive/components/tree-selector.d.ts.map +1 -0
- package/dist/modes/interactive/components/tree-selector.js +1208 -0
- package/dist/modes/interactive/components/tree-selector.js.map +1 -0
- package/dist/modes/interactive/components/trust-selector.d.ts +23 -0
- package/dist/modes/interactive/components/trust-selector.d.ts.map +1 -0
- package/dist/modes/interactive/components/trust-selector.js +91 -0
- package/dist/modes/interactive/components/trust-selector.js.map +1 -0
- package/dist/modes/interactive/components/user-message-selector.d.ts +30 -0
- package/dist/modes/interactive/components/user-message-selector.d.ts.map +1 -0
- package/dist/modes/interactive/components/user-message-selector.js +114 -0
- package/dist/modes/interactive/components/user-message-selector.js.map +1 -0
- package/dist/modes/interactive/components/user-message.d.ts +10 -0
- package/dist/modes/interactive/components/user-message.d.ts.map +1 -0
- package/dist/modes/interactive/components/user-message.js +29 -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 +381 -0
- package/dist/modes/interactive/interactive-mode.d.ts.map +1 -0
- package/dist/modes/interactive/interactive-mode.js +4802 -0
- package/dist/modes/interactive/interactive-mode.js.map +1 -0
- package/dist/modes/interactive/model-search.d.ts +12 -0
- package/dist/modes/interactive/model-search.d.ts.map +1 -0
- package/dist/modes/interactive/model-search.js +15 -0
- package/dist/modes/interactive/model-search.js.map +1 -0
- package/dist/modes/interactive/theme/dark.json +86 -0
- package/dist/modes/interactive/theme/light.json +85 -0
- package/dist/modes/interactive/theme/theme-controller.d.ts +29 -0
- package/dist/modes/interactive/theme/theme-controller.d.ts.map +1 -0
- package/dist/modes/interactive/theme/theme-controller.js +102 -0
- package/dist/modes/interactive/theme/theme-controller.js.map +1 -0
- package/dist/modes/interactive/theme/theme-schema.json +336 -0
- package/dist/modes/interactive/theme/theme.d.ts +119 -0
- package/dist/modes/interactive/theme/theme.d.ts.map +1 -0
- package/dist/modes/interactive/theme/theme.js +1056 -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 +132 -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 +227 -0
- package/dist/modes/rpc/rpc-client.d.ts.map +1 -0
- package/dist/modes/rpc/rpc-client.js +467 -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 +637 -0
- package/dist/modes/rpc/rpc-mode.js.map +1 -0
- package/dist/modes/rpc/rpc-types.d.ts +428 -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/package-manager-cli.d.ts +8 -0
- package/dist/package-manager-cli.d.ts.map +1 -0
- package/dist/package-manager-cli.js +659 -0
- package/dist/package-manager-cli.js.map +1 -0
- package/dist/skills/grill-me/SKILL.md +10 -0
- package/dist/skills/handoff/SKILL.md +15 -0
- package/dist/skills/implanger/SKILL.md +68 -0
- package/dist/skills/improve-codebase/REFERENCE.md +78 -0
- package/dist/skills/improve-codebase/SKILL.md +178 -0
- package/dist/skills/planger/SKILL.md +165 -0
- package/dist/skills/ponytail/SKILL.md +117 -0
- package/dist/skills/ponytail-audit/SKILL.md +41 -0
- package/dist/skills/ponytail-debt/SKILL.md +44 -0
- package/dist/skills/ponytail-gain/SKILL.md +50 -0
- package/dist/skills/ponytail-help/SKILL.md +69 -0
- package/dist/skills/ponytail-review/SKILL.md +57 -0
- package/dist/skills/selesai-default/SKILL.md +16 -0
- package/dist/themes/powerline-footer/theme.json +33 -0
- package/dist/utils/ansi.d.ts +2 -0
- package/dist/utils/ansi.d.ts.map +1 -0
- package/dist/utils/ansi.js +52 -0
- package/dist/utils/ansi.js.map +1 -0
- package/dist/utils/changelog.d.ts +22 -0
- package/dist/utils/changelog.d.ts.map +1 -0
- package/dist/utils/changelog.js +165 -0
- package/dist/utils/changelog.js.map +1 -0
- package/dist/utils/child-process.d.ts +18 -0
- package/dist/utils/child-process.d.ts.map +1 -0
- package/dist/utils/child-process.js +106 -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 +10 -0
- package/dist/utils/clipboard-native.d.ts.map +1 -0
- package/dist/utils/clipboard-native.js +20 -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 +117 -0
- package/dist/utils/clipboard.js.map +1 -0
- package/dist/utils/deprecation.d.ts +4 -0
- package/dist/utils/deprecation.d.ts.map +1 -0
- package/dist/utils/deprecation.js +13 -0
- package/dist/utils/deprecation.js.map +1 -0
- package/dist/utils/exif-orientation.d.ts +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/fs-watch.d.ts +5 -0
- package/dist/utils/fs-watch.d.ts.map +1 -0
- package/dist/utils/fs-watch.js +25 -0
- package/dist/utils/fs-watch.js.map +1 -0
- package/dist/utils/git.d.ts +26 -0
- package/dist/utils/git.d.ts.map +1 -0
- package/dist/utils/git.js +195 -0
- package/dist/utils/git.js.map +1 -0
- package/dist/utils/html.d.ts +7 -0
- package/dist/utils/html.d.ts.map +1 -0
- package/dist/utils/html.js +40 -0
- package/dist/utils/html.js.map +1 -0
- package/dist/utils/image-convert.d.ts +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-core.d.ts +30 -0
- package/dist/utils/image-resize-core.d.ts.map +1 -0
- package/dist/utils/image-resize-core.js +124 -0
- package/dist/utils/image-resize-core.js.map +1 -0
- package/dist/utils/image-resize-worker.d.ts +2 -0
- package/dist/utils/image-resize-worker.d.ts.map +1 -0
- package/dist/utils/image-resize-worker.js +31 -0
- package/dist/utils/image-resize-worker.js.map +1 -0
- package/dist/utils/image-resize.d.ts +16 -0
- package/dist/utils/image-resize.d.ts.map +1 -0
- package/dist/utils/image-resize.js +97 -0
- package/dist/utils/image-resize.js.map +1 -0
- package/dist/utils/json.d.ts +3 -0
- package/dist/utils/json.d.ts.map +1 -0
- package/dist/utils/json.js +7 -0
- package/dist/utils/json.js.map +1 -0
- package/dist/utils/mime.d.ts +3 -0
- package/dist/utils/mime.d.ts.map +1 -0
- package/dist/utils/mime.js +69 -0
- package/dist/utils/mime.js.map +1 -0
- package/dist/utils/open-browser.d.ts +9 -0
- package/dist/utils/open-browser.d.ts.map +1 -0
- package/dist/utils/open-browser.js +22 -0
- package/dist/utils/open-browser.js.map +1 -0
- package/dist/utils/paths.d.ts +31 -0
- package/dist/utils/paths.d.ts.map +1 -0
- package/dist/utils/paths.js +92 -0
- package/dist/utils/paths.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/pi-user-agent.d.ts +2 -0
- package/dist/utils/pi-user-agent.d.ts.map +1 -0
- package/dist/utils/pi-user-agent.js +5 -0
- package/dist/utils/pi-user-agent.js.map +1 -0
- package/dist/utils/shell.d.ts +31 -0
- package/dist/utils/shell.d.ts.map +1 -0
- package/dist/utils/shell.js +202 -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/syntax-highlight.d.ts +12 -0
- package/dist/utils/syntax-highlight.d.ts.map +1 -0
- package/dist/utils/syntax-highlight.js +118 -0
- package/dist/utils/syntax-highlight.js.map +1 -0
- package/dist/utils/tools-manager.d.ts +3 -0
- package/dist/utils/tools-manager.d.ts.map +1 -0
- package/dist/utils/tools-manager.js +328 -0
- package/dist/utils/tools-manager.js.map +1 -0
- package/dist/utils/version-check.d.ts +15 -0
- package/dist/utils/version-check.d.ts.map +1 -0
- package/dist/utils/version-check.js +52 -0
- package/dist/utils/version-check.js.map +1 -0
- package/dist/utils/windows-self-update.d.ts +3 -0
- package/dist/utils/windows-self-update.d.ts.map +1 -0
- package/dist/utils/windows-self-update.js +77 -0
- package/dist/utils/windows-self-update.js.map +1 -0
- package/docs/compaction.md +396 -0
- package/docs/containerization.md +111 -0
- package/docs/custom-provider.md +737 -0
- package/docs/development.md +71 -0
- package/docs/docs.json +156 -0
- package/docs/extensions.md +2681 -0
- package/docs/images/doom-extension.png +0 -0
- package/docs/images/exy.png +0 -0
- package/docs/images/interactive-mode.png +0 -0
- package/docs/images/tree-view.png +0 -0
- package/docs/index.md +82 -0
- package/docs/json.md +82 -0
- package/docs/keybindings.md +197 -0
- package/docs/models.md +495 -0
- package/docs/packages.md +227 -0
- package/docs/prompt-templates.md +95 -0
- package/docs/providers.md +274 -0
- package/docs/quickstart.md +165 -0
- package/docs/rpc.md +1412 -0
- package/docs/sdk.md +1143 -0
- package/docs/security.md +59 -0
- package/docs/session-format.md +412 -0
- package/docs/sessions.md +145 -0
- package/docs/settings.md +308 -0
- package/docs/shell-aliases.md +13 -0
- package/docs/skills.md +231 -0
- package/docs/terminal-setup.md +142 -0
- package/docs/termux.md +127 -0
- package/docs/themes.md +295 -0
- package/docs/tmux.md +63 -0
- package/docs/tui.md +927 -0
- package/docs/usage.md +308 -0
- package/docs/windows.md +17 -0
- package/examples/README.md +25 -0
- package/examples/extensions/README.md +211 -0
- package/examples/extensions/auto-commit-on-exit.ts +49 -0
- package/examples/extensions/bash-spawn-hook.ts +30 -0
- package/examples/extensions/bookmark.ts +50 -0
- package/examples/extensions/border-status-editor.ts +150 -0
- package/examples/extensions/built-in-tool-renderer.ts +249 -0
- package/examples/extensions/claude-rules.ts +86 -0
- package/examples/extensions/commands.ts +72 -0
- package/examples/extensions/confirm-destructive.ts +59 -0
- package/examples/extensions/custom-compaction.ts +127 -0
- package/examples/extensions/custom-footer.ts +64 -0
- package/examples/extensions/custom-header.ts +73 -0
- package/examples/extensions/custom-provider-anthropic/index.ts +604 -0
- package/examples/extensions/custom-provider-anthropic/package-lock.json +24 -0
- package/examples/extensions/custom-provider-anthropic/package.json +19 -0
- package/examples/extensions/custom-provider-gitlab-duo/index.ts +404 -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/git-merge-and-resolve.ts +115 -0
- package/examples/extensions/github-issue-autocomplete.ts +185 -0
- package/examples/extensions/gondolin/index.ts +531 -0
- package/examples/extensions/gondolin/package-lock.json +185 -0
- package/examples/extensions/gondolin/package.json +19 -0
- package/examples/extensions/handoff.ts +191 -0
- package/examples/extensions/hello.ts +26 -0
- package/examples/extensions/hidden-thinking-label.ts +53 -0
- package/examples/extensions/inline-bash.ts +94 -0
- package/examples/extensions/input-transform-streaming.ts +39 -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 +1450 -0
- package/examples/extensions/overlay-test.ts +153 -0
- package/examples/extensions/permission-gate.ts +34 -0
- package/examples/extensions/pirate.ts +47 -0
- package/examples/extensions/plan-mode/README.md +66 -0
- package/examples/extensions/plan-mode/index.ts +390 -0
- package/examples/extensions/plan-mode/utils.ts +168 -0
- package/examples/extensions/preset.ts +436 -0
- package/examples/extensions/project-trust.ts +64 -0
- package/examples/extensions/prompt-customizer.ts +97 -0
- package/examples/extensions/protected-paths.ts +30 -0
- package/examples/extensions/provider-payload.ts +18 -0
- package/examples/extensions/qna.ts +122 -0
- package/examples/extensions/question.ts +285 -0
- package/examples/extensions/questionnaire.ts +448 -0
- package/examples/extensions/rainbow-editor.ts +88 -0
- package/examples/extensions/reload-runtime.ts +37 -0
- package/examples/extensions/rpc-demo.ts +118 -0
- package/examples/extensions/sandbox/index.ts +321 -0
- package/examples/extensions/sandbox/package-lock.json +92 -0
- package/examples/extensions/sandbox/package.json +19 -0
- package/examples/extensions/send-user-message.ts +97 -0
- package/examples/extensions/session-name.ts +27 -0
- package/examples/extensions/shutdown-command.ts +63 -0
- package/examples/extensions/snake.ts +343 -0
- package/examples/extensions/space-invaders.ts +560 -0
- package/examples/extensions/ssh.ts +220 -0
- package/examples/extensions/status-line.ts +32 -0
- package/examples/extensions/structured-output.ts +65 -0
- package/examples/extensions/subagent/README.md +175 -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 +1015 -0
- package/examples/extensions/subagent/prompts/implement-and-review.md +10 -0
- package/examples/extensions/subagent/prompts/implement.md +10 -0
- package/examples/extensions/subagent/prompts/scout-and-plan.md +9 -0
- package/examples/extensions/summarize.ts +206 -0
- package/examples/extensions/system-prompt-header.ts +17 -0
- package/examples/extensions/tic-tac-toe.ts +1008 -0
- package/examples/extensions/timed-confirm.ts +70 -0
- package/examples/extensions/titlebar-spinner.ts +58 -0
- package/examples/extensions/todo.ts +297 -0
- package/examples/extensions/tool-override.ts +144 -0
- package/examples/extensions/tools.ts +146 -0
- package/examples/extensions/trigger-compact.ts +50 -0
- package/examples/extensions/truncated-tool.ts +195 -0
- package/examples/extensions/widget-placement.ts +9 -0
- package/examples/extensions/with-deps/index.ts +32 -0
- package/examples/extensions/with-deps/package-lock.json +31 -0
- package/examples/extensions/with-deps/package.json +22 -0
- package/examples/extensions/working-indicator.ts +123 -0
- package/examples/extensions/working-message-test.ts +25 -0
- package/examples/rpc-extension-ui.ts +632 -0
- package/examples/sdk/01-minimal.ts +26 -0
- package/examples/sdk/02-custom-model.ts +53 -0
- package/examples/sdk/03-custom-prompt.ts +75 -0
- package/examples/sdk/04-skills.ts +55 -0
- package/examples/sdk/05-tools.ts +48 -0
- package/examples/sdk/06-extensions.ts +99 -0
- package/examples/sdk/07-context-files.ts +47 -0
- package/examples/sdk/08-prompt-templates.ts +51 -0
- package/examples/sdk/09-api-keys-and-oauth.ts +52 -0
- package/examples/sdk/10-settings.ts +53 -0
- package/examples/sdk/11-sessions.ts +52 -0
- package/examples/sdk/12-full-control.ts +77 -0
- package/examples/sdk/13-session-runtime.ts +67 -0
- package/examples/sdk/README.md +144 -0
- package/package.json +65 -0
|
@@ -0,0 +1,695 @@
|
|
|
1
|
+
// working-vibes.ts
|
|
2
|
+
// AI-generated contextual working messages that match a user's preferred theme/vibe.
|
|
3
|
+
// Uses module-level state (matching powerline-footer pattern).
|
|
4
|
+
|
|
5
|
+
import { complete, type Context } from "@earendil-works/pi-ai";
|
|
6
|
+
import type { ExtensionContext } from "@earendil-works/pi-coding-agent";
|
|
7
|
+
import { existsSync, readFileSync, writeFileSync, mkdirSync } from "node:fs";
|
|
8
|
+
import { join, dirname } from "node:path";
|
|
9
|
+
import { homedir } from "node:os";
|
|
10
|
+
|
|
11
|
+
type VibeMode = "generate" | "file";
|
|
12
|
+
|
|
13
|
+
// ═══════════════════════════════════════════════════════════════════════════
|
|
14
|
+
// Constants
|
|
15
|
+
// ═══════════════════════════════════════════════════════════════════════════
|
|
16
|
+
|
|
17
|
+
const DEFAULT_MODEL = "openai-codex/gpt-5.4-mini";
|
|
18
|
+
|
|
19
|
+
const DEFAULT_PROMPT = `Generate a 2-4 word "{theme}" themed loading message ending in "...".
|
|
20
|
+
|
|
21
|
+
Task: {task}
|
|
22
|
+
|
|
23
|
+
Be creative and unexpected. Avoid obvious/clichéd phrases for this theme.
|
|
24
|
+
The message should hint at the task using theme vocabulary.
|
|
25
|
+
{exclude}
|
|
26
|
+
Output only the message, nothing else.`;
|
|
27
|
+
|
|
28
|
+
const BATCH_PROMPT = `Generate {count} unique 2-4 word loading messages for a "{theme}" theme.
|
|
29
|
+
Each message should end with "..."
|
|
30
|
+
Be creative, varied, and thematic. No duplicates.
|
|
31
|
+
Output one message per line, nothing else. No numbering, no bullets.`;
|
|
32
|
+
|
|
33
|
+
const VIBE_SYSTEM_PROMPT = "You generate short themed loading messages and reply with the requested text only.";
|
|
34
|
+
|
|
35
|
+
// ═══════════════════════════════════════════════════════════════════════════
|
|
36
|
+
// Types
|
|
37
|
+
// ═══════════════════════════════════════════════════════════════════════════
|
|
38
|
+
|
|
39
|
+
interface VibeConfig {
|
|
40
|
+
theme: string | null; // null = disabled
|
|
41
|
+
mode: VibeMode; // "generate" (on-demand) or "file" (pre-generated)
|
|
42
|
+
modelSpec: string; // default: "openai-codex/gpt-5.4-mini"
|
|
43
|
+
fallback: string; // default: "Working"
|
|
44
|
+
timeout: number; // default: 3000ms
|
|
45
|
+
refreshInterval: number; // default: 30000ms (30s)
|
|
46
|
+
promptTemplate: string; // template with {theme}, {task}, {exclude} placeholders
|
|
47
|
+
maxLength: number; // default: 65 chars
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
interface VibeGenContext {
|
|
51
|
+
theme: string;
|
|
52
|
+
userPrompt: string; // from event.prompt in before_agent_start
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
// ═══════════════════════════════════════════════════════════════════════════
|
|
56
|
+
// Module-level State
|
|
57
|
+
// ═══════════════════════════════════════════════════════════════════════════
|
|
58
|
+
|
|
59
|
+
let config: VibeConfig = loadConfig();
|
|
60
|
+
let extensionCtx: ExtensionContext | null = null;
|
|
61
|
+
let currentGeneration: AbortController | null = null;
|
|
62
|
+
let isStreaming = false;
|
|
63
|
+
let lastVibeTime = 0;
|
|
64
|
+
|
|
65
|
+
// File-based mode state
|
|
66
|
+
let vibeCache: string[] = []; // Cached vibes from file
|
|
67
|
+
let vibeCacheTheme: string | null = null; // Theme the cache is for
|
|
68
|
+
let vibeSeed = Date.now(); // Seed for deterministic shuffle
|
|
69
|
+
let vibeIndex = 0; // Current position in shuffled list
|
|
70
|
+
|
|
71
|
+
// Recent vibes tracking (to avoid repetition in generate mode)
|
|
72
|
+
const MAX_RECENT_VIBES = 5;
|
|
73
|
+
let recentVibes: string[] = [];
|
|
74
|
+
|
|
75
|
+
// ═══════════════════════════════════════════════════════════════════════════
|
|
76
|
+
// Configuration Management
|
|
77
|
+
// ═══════════════════════════════════════════════════════════════════════════
|
|
78
|
+
|
|
79
|
+
function getSettingsPath(): string {
|
|
80
|
+
const homeDir = process.env.HOME || process.env.USERPROFILE || homedir();
|
|
81
|
+
return join(homeDir, ".pi", "agent", "settings.json");
|
|
82
|
+
}
|
|
83
|
+
|
|
84
|
+
function isRecord(value: unknown): value is Record<string, unknown> {
|
|
85
|
+
return typeof value === "object" && value !== null && !Array.isArray(value);
|
|
86
|
+
}
|
|
87
|
+
|
|
88
|
+
function readSettingsForLoad(): Record<string, unknown> {
|
|
89
|
+
const settingsPath = getSettingsPath();
|
|
90
|
+
|
|
91
|
+
try {
|
|
92
|
+
if (!existsSync(settingsPath)) {
|
|
93
|
+
return {};
|
|
94
|
+
}
|
|
95
|
+
|
|
96
|
+
const parsed = JSON.parse(readFileSync(settingsPath, "utf-8"));
|
|
97
|
+
if (!isRecord(parsed)) {
|
|
98
|
+
console.debug(`[working-vibes] Ignoring non-object settings at ${settingsPath}`);
|
|
99
|
+
return {};
|
|
100
|
+
}
|
|
101
|
+
|
|
102
|
+
return parsed;
|
|
103
|
+
} catch (error) {
|
|
104
|
+
console.debug(`[working-vibes] Failed to load settings from ${settingsPath}:`, error);
|
|
105
|
+
return {};
|
|
106
|
+
}
|
|
107
|
+
}
|
|
108
|
+
|
|
109
|
+
function readSettingsForWrite(scope: string): Record<string, unknown> | null {
|
|
110
|
+
const settingsPath = getSettingsPath();
|
|
111
|
+
|
|
112
|
+
if (!existsSync(settingsPath)) {
|
|
113
|
+
return {};
|
|
114
|
+
}
|
|
115
|
+
|
|
116
|
+
try {
|
|
117
|
+
const parsed = JSON.parse(readFileSync(settingsPath, "utf-8"));
|
|
118
|
+
if (!isRecord(parsed)) {
|
|
119
|
+
console.debug(`[working-vibes] Refusing to write ${scope}: settings at ${settingsPath} is not an object`);
|
|
120
|
+
return null;
|
|
121
|
+
}
|
|
122
|
+
|
|
123
|
+
return parsed;
|
|
124
|
+
} catch (error) {
|
|
125
|
+
console.debug(`[working-vibes] Failed to parse settings while writing ${scope} at ${settingsPath}:`, error);
|
|
126
|
+
return null;
|
|
127
|
+
}
|
|
128
|
+
}
|
|
129
|
+
|
|
130
|
+
function persistSettings(settings: Record<string, unknown>, scope: string): boolean {
|
|
131
|
+
const settingsPath = getSettingsPath();
|
|
132
|
+
|
|
133
|
+
try {
|
|
134
|
+
mkdirSync(dirname(settingsPath), { recursive: true });
|
|
135
|
+
writeFileSync(settingsPath, JSON.stringify(settings, null, 2) + "\n");
|
|
136
|
+
return true;
|
|
137
|
+
} catch (error) {
|
|
138
|
+
console.debug(`[working-vibes] Failed to persist ${scope} to ${settingsPath}:`, error);
|
|
139
|
+
return false;
|
|
140
|
+
}
|
|
141
|
+
}
|
|
142
|
+
|
|
143
|
+
function loadConfig(): VibeConfig {
|
|
144
|
+
const settings = readSettingsForLoad();
|
|
145
|
+
|
|
146
|
+
// Handle "off" in settings.json (same as null/disabled)
|
|
147
|
+
const rawTheme = typeof settings.workingVibe === "string" ? settings.workingVibe : null;
|
|
148
|
+
const theme = rawTheme?.toLowerCase() === "off" ? null : rawTheme;
|
|
149
|
+
|
|
150
|
+
// Validate mode setting
|
|
151
|
+
const rawMode = settings.workingVibeMode;
|
|
152
|
+
const mode: VibeMode = rawMode === "file" || rawMode === "generate" ? rawMode : "generate";
|
|
153
|
+
|
|
154
|
+
const refreshSeconds =
|
|
155
|
+
typeof settings.workingVibeRefreshInterval === "number" && Number.isFinite(settings.workingVibeRefreshInterval)
|
|
156
|
+
? Math.max(0, settings.workingVibeRefreshInterval)
|
|
157
|
+
: 30;
|
|
158
|
+
|
|
159
|
+
const maxLength =
|
|
160
|
+
typeof settings.workingVibeMaxLength === "number" && Number.isFinite(settings.workingVibeMaxLength)
|
|
161
|
+
? Math.max(4, Math.floor(settings.workingVibeMaxLength))
|
|
162
|
+
: 65;
|
|
163
|
+
|
|
164
|
+
return {
|
|
165
|
+
theme,
|
|
166
|
+
mode,
|
|
167
|
+
modelSpec: typeof settings.workingVibeModel === "string" ? settings.workingVibeModel : DEFAULT_MODEL,
|
|
168
|
+
fallback: typeof settings.workingVibeFallback === "string" ? settings.workingVibeFallback : "Working",
|
|
169
|
+
timeout: 3000,
|
|
170
|
+
refreshInterval: refreshSeconds * 1000,
|
|
171
|
+
promptTemplate: typeof settings.workingVibePrompt === "string" ? settings.workingVibePrompt : DEFAULT_PROMPT,
|
|
172
|
+
maxLength,
|
|
173
|
+
};
|
|
174
|
+
}
|
|
175
|
+
|
|
176
|
+
function saveConfig(): boolean {
|
|
177
|
+
const settings = readSettingsForWrite("workingVibe");
|
|
178
|
+
if (!settings) {
|
|
179
|
+
return false;
|
|
180
|
+
}
|
|
181
|
+
|
|
182
|
+
if (config.theme === null) {
|
|
183
|
+
delete settings.workingVibe;
|
|
184
|
+
} else {
|
|
185
|
+
settings.workingVibe = config.theme;
|
|
186
|
+
}
|
|
187
|
+
|
|
188
|
+
return persistSettings(settings, "workingVibe");
|
|
189
|
+
}
|
|
190
|
+
|
|
191
|
+
function saveModelConfig(): boolean {
|
|
192
|
+
const settings = readSettingsForWrite("workingVibeModel");
|
|
193
|
+
if (!settings) {
|
|
194
|
+
return false;
|
|
195
|
+
}
|
|
196
|
+
|
|
197
|
+
if (config.modelSpec === DEFAULT_MODEL) {
|
|
198
|
+
delete settings.workingVibeModel;
|
|
199
|
+
} else {
|
|
200
|
+
settings.workingVibeModel = config.modelSpec;
|
|
201
|
+
}
|
|
202
|
+
|
|
203
|
+
return persistSettings(settings, "workingVibeModel");
|
|
204
|
+
}
|
|
205
|
+
|
|
206
|
+
// ═══════════════════════════════════════════════════════════════════════════
|
|
207
|
+
// File-Based Vibe Management
|
|
208
|
+
// ═══════════════════════════════════════════════════════════════════════════
|
|
209
|
+
|
|
210
|
+
function getVibesDir(): string {
|
|
211
|
+
const homeDir = process.env.HOME || process.env.USERPROFILE || homedir();
|
|
212
|
+
return join(homeDir, ".pi", "agent", "vibes");
|
|
213
|
+
}
|
|
214
|
+
|
|
215
|
+
function toVibeFileSlug(theme: string): string {
|
|
216
|
+
const slug = theme
|
|
217
|
+
.trim()
|
|
218
|
+
.toLowerCase()
|
|
219
|
+
.replace(/[^a-z0-9_-]+/g, "-")
|
|
220
|
+
.replace(/-+/g, "-")
|
|
221
|
+
.replace(/^[-_]+|[-_]+$/g, "");
|
|
222
|
+
|
|
223
|
+
return slug || "theme";
|
|
224
|
+
}
|
|
225
|
+
|
|
226
|
+
function getVibeFilePath(theme: string): string {
|
|
227
|
+
const filename = `${toVibeFileSlug(theme)}.txt`;
|
|
228
|
+
return join(getVibesDir(), filename);
|
|
229
|
+
}
|
|
230
|
+
|
|
231
|
+
function loadVibesFromFile(theme: string): string[] {
|
|
232
|
+
const filePath = getVibeFilePath(theme);
|
|
233
|
+
if (!existsSync(filePath)) return [];
|
|
234
|
+
|
|
235
|
+
try {
|
|
236
|
+
const content = readFileSync(filePath, "utf-8");
|
|
237
|
+
return content
|
|
238
|
+
.split("\n")
|
|
239
|
+
.map(line => line.trim())
|
|
240
|
+
.filter(line => line.length > 0 && line.endsWith("..."));
|
|
241
|
+
} catch (error) {
|
|
242
|
+
console.debug(`[working-vibes] Failed to load vibe file ${filePath}:`, error);
|
|
243
|
+
return [];
|
|
244
|
+
}
|
|
245
|
+
}
|
|
246
|
+
|
|
247
|
+
function saveVibesToFile(theme: string, vibes: string[]): void {
|
|
248
|
+
const vibesDir = getVibesDir();
|
|
249
|
+
const filePath = getVibeFilePath(theme);
|
|
250
|
+
|
|
251
|
+
// Ensure directory exists
|
|
252
|
+
if (!existsSync(vibesDir)) {
|
|
253
|
+
mkdirSync(vibesDir, { recursive: true });
|
|
254
|
+
}
|
|
255
|
+
|
|
256
|
+
writeFileSync(filePath, vibes.join("\n"));
|
|
257
|
+
}
|
|
258
|
+
|
|
259
|
+
// Mulberry32 PRNG - fast, deterministic, good distribution
|
|
260
|
+
function mulberry32(seed: number): () => number {
|
|
261
|
+
return function() {
|
|
262
|
+
let t = seed += 0x6D2B79F5;
|
|
263
|
+
t = Math.imul(t ^ t >>> 15, t | 1);
|
|
264
|
+
t ^= t + Math.imul(t ^ t >>> 7, t | 61);
|
|
265
|
+
return ((t ^ t >>> 14) >>> 0) / 4294967296;
|
|
266
|
+
};
|
|
267
|
+
}
|
|
268
|
+
|
|
269
|
+
// Get vibe at index using seeded shuffle (no-repeat until all used)
|
|
270
|
+
function getVibeAtIndex(vibes: string[], index: number, seed: number): string {
|
|
271
|
+
if (vibes.length === 0) return `${config.fallback}...`;
|
|
272
|
+
|
|
273
|
+
// For small lists or when we've cycled through, just use modulo
|
|
274
|
+
const effectiveIndex = index % vibes.length;
|
|
275
|
+
|
|
276
|
+
// Create deterministic shuffle using seed
|
|
277
|
+
const rng = mulberry32(seed);
|
|
278
|
+
const indices = Array.from({ length: vibes.length }, (_, i) => i);
|
|
279
|
+
|
|
280
|
+
// Fisher-Yates shuffle with seeded RNG
|
|
281
|
+
for (let i = indices.length - 1; i > 0; i--) {
|
|
282
|
+
const j = Math.floor(rng() * (i + 1));
|
|
283
|
+
[indices[i], indices[j]] = [indices[j], indices[i]];
|
|
284
|
+
}
|
|
285
|
+
|
|
286
|
+
return vibes[indices[effectiveIndex]];
|
|
287
|
+
}
|
|
288
|
+
|
|
289
|
+
function getNextVibeFromFile(): string {
|
|
290
|
+
if (!config.theme) return `${config.fallback}...`;
|
|
291
|
+
|
|
292
|
+
// Load/reload cache if theme changed
|
|
293
|
+
if (vibeCacheTheme !== config.theme) {
|
|
294
|
+
vibeCache = loadVibesFromFile(config.theme);
|
|
295
|
+
vibeCacheTheme = config.theme;
|
|
296
|
+
vibeSeed = Date.now(); // New seed for new theme
|
|
297
|
+
vibeIndex = 0;
|
|
298
|
+
}
|
|
299
|
+
|
|
300
|
+
if (vibeCache.length === 0) {
|
|
301
|
+
return `${config.fallback}...`;
|
|
302
|
+
}
|
|
303
|
+
|
|
304
|
+
const vibe = getVibeAtIndex(vibeCache, vibeIndex, vibeSeed);
|
|
305
|
+
vibeIndex++;
|
|
306
|
+
return vibe;
|
|
307
|
+
}
|
|
308
|
+
|
|
309
|
+
// ═══════════════════════════════════════════════════════════════════════════
|
|
310
|
+
// Prompt Building & Response Parsing (Pure Functions)
|
|
311
|
+
// ═══════════════════════════════════════════════════════════════════════════
|
|
312
|
+
|
|
313
|
+
function buildVibePrompt(ctx: VibeGenContext): string {
|
|
314
|
+
// Truncate user prompt to save tokens (most context in first 100 chars)
|
|
315
|
+
const task = ctx.userPrompt.slice(0, 100);
|
|
316
|
+
|
|
317
|
+
// Build exclusion list from recent vibes
|
|
318
|
+
const exclude = recentVibes.length > 0
|
|
319
|
+
? `Don't use: ${recentVibes.join(", ")}`
|
|
320
|
+
: "";
|
|
321
|
+
|
|
322
|
+
// Use configured template with variable substitution
|
|
323
|
+
return config.promptTemplate
|
|
324
|
+
.replace(/\{theme\}/g, ctx.theme)
|
|
325
|
+
.replace(/\{task\}/g, task)
|
|
326
|
+
.replace(/\{exclude\}/g, exclude);
|
|
327
|
+
}
|
|
328
|
+
|
|
329
|
+
function parseVibeResponse(response: string, fallback: string): string {
|
|
330
|
+
if (!response) return `${fallback}...`;
|
|
331
|
+
|
|
332
|
+
// Take only the first line (AI sometimes adds explanations)
|
|
333
|
+
let vibe = response.trim().split('\n')[0].trim();
|
|
334
|
+
|
|
335
|
+
// Remove quotes if model wrapped the response
|
|
336
|
+
vibe = vibe.replace(/^["']|["']$/g, "");
|
|
337
|
+
|
|
338
|
+
// Ensure ellipsis
|
|
339
|
+
if (!vibe.endsWith("...")) {
|
|
340
|
+
vibe = vibe.replace(/\.+$/, "") + "...";
|
|
341
|
+
}
|
|
342
|
+
|
|
343
|
+
// Enforce length limit (configurable, default 65 chars)
|
|
344
|
+
if (vibe.length > config.maxLength) {
|
|
345
|
+
vibe = vibe.slice(0, config.maxLength - 3) + "...";
|
|
346
|
+
}
|
|
347
|
+
|
|
348
|
+
// Final validation
|
|
349
|
+
if (!vibe || vibe === "...") {
|
|
350
|
+
return `${fallback}...`;
|
|
351
|
+
}
|
|
352
|
+
|
|
353
|
+
return vibe;
|
|
354
|
+
}
|
|
355
|
+
|
|
356
|
+
function buildAiContext(prompt: string): Context {
|
|
357
|
+
return {
|
|
358
|
+
systemPrompt: VIBE_SYSTEM_PROMPT,
|
|
359
|
+
messages: [{
|
|
360
|
+
role: "user",
|
|
361
|
+
content: [{ type: "text", text: prompt }],
|
|
362
|
+
timestamp: Date.now(),
|
|
363
|
+
}],
|
|
364
|
+
};
|
|
365
|
+
}
|
|
366
|
+
|
|
367
|
+
// ═══════════════════════════════════════════════════════════════════════════
|
|
368
|
+
// AI Generation
|
|
369
|
+
// ═══════════════════════════════════════════════════════════════════════════
|
|
370
|
+
|
|
371
|
+
async function generateVibe(
|
|
372
|
+
ctx: VibeGenContext,
|
|
373
|
+
signal: AbortSignal,
|
|
374
|
+
): Promise<string> {
|
|
375
|
+
if (!extensionCtx) {
|
|
376
|
+
return `${config.fallback}...`;
|
|
377
|
+
}
|
|
378
|
+
|
|
379
|
+
// Parse model spec (provider/modelId format, where modelId may contain slashes)
|
|
380
|
+
const slashIndex = config.modelSpec.indexOf("/");
|
|
381
|
+
if (slashIndex === -1) {
|
|
382
|
+
return `${config.fallback}...`;
|
|
383
|
+
}
|
|
384
|
+
const provider = config.modelSpec.slice(0, slashIndex);
|
|
385
|
+
const modelId = config.modelSpec.slice(slashIndex + 1);
|
|
386
|
+
if (!provider || !modelId) {
|
|
387
|
+
return `${config.fallback}...`;
|
|
388
|
+
}
|
|
389
|
+
|
|
390
|
+
// Resolve model from registry
|
|
391
|
+
const model = extensionCtx.modelRegistry.find(provider, modelId);
|
|
392
|
+
if (!model) {
|
|
393
|
+
console.debug(`[working-vibes] Model not found: ${config.modelSpec}`);
|
|
394
|
+
return `${config.fallback}...`;
|
|
395
|
+
}
|
|
396
|
+
|
|
397
|
+
// Get auth
|
|
398
|
+
const auth = await extensionCtx.modelRegistry.getApiKeyAndHeaders(model);
|
|
399
|
+
if (!auth.ok) {
|
|
400
|
+
console.debug(`[working-vibes] Auth failed for ${provider}: ${auth.error}`);
|
|
401
|
+
return `${config.fallback}...`;
|
|
402
|
+
}
|
|
403
|
+
|
|
404
|
+
const aiContext = buildAiContext(buildVibePrompt(ctx));
|
|
405
|
+
|
|
406
|
+
const response = await complete(model, aiContext, { apiKey: auth.apiKey, headers: auth.headers, signal });
|
|
407
|
+
|
|
408
|
+
const textContent = response.content.find(c => c.type === "text");
|
|
409
|
+
if (!textContent?.text && response.stopReason === "error" && response.errorMessage) {
|
|
410
|
+
console.debug(`[working-vibes] Vibe generation failed for ${config.modelSpec}: ${response.errorMessage}`);
|
|
411
|
+
}
|
|
412
|
+
return parseVibeResponse(textContent?.text || "", config.fallback);
|
|
413
|
+
}
|
|
414
|
+
|
|
415
|
+
function trackRecentVibe(vibe: string): void {
|
|
416
|
+
// Don't track fallback messages
|
|
417
|
+
if (vibe === `${config.fallback}...`) return;
|
|
418
|
+
|
|
419
|
+
// Add to front, remove duplicates
|
|
420
|
+
recentVibes = [vibe, ...recentVibes.filter(v => v !== vibe)].slice(0, MAX_RECENT_VIBES);
|
|
421
|
+
}
|
|
422
|
+
|
|
423
|
+
function updateVibeFromFile(setWorkingMessage: (msg?: string) => void): void {
|
|
424
|
+
setWorkingMessage(getNextVibeFromFile());
|
|
425
|
+
}
|
|
426
|
+
|
|
427
|
+
async function generateAndUpdate(
|
|
428
|
+
prompt: string,
|
|
429
|
+
setWorkingMessage: (msg?: string) => void,
|
|
430
|
+
): Promise<void> {
|
|
431
|
+
// File mode: instant, no API call
|
|
432
|
+
if (config.mode === "file") {
|
|
433
|
+
updateVibeFromFile(setWorkingMessage);
|
|
434
|
+
return;
|
|
435
|
+
}
|
|
436
|
+
|
|
437
|
+
// Generate mode: API call with abort handling
|
|
438
|
+
// Cancel any in-flight generation and create new controller
|
|
439
|
+
// Capture in local variable to avoid race condition with subsequent calls
|
|
440
|
+
const controller = new AbortController();
|
|
441
|
+
currentGeneration?.abort();
|
|
442
|
+
currentGeneration = controller;
|
|
443
|
+
|
|
444
|
+
// Create timeout signal (3 seconds)
|
|
445
|
+
const timeoutSignal = AbortSignal.timeout(config.timeout);
|
|
446
|
+
const combinedSignal = AbortSignal.any([
|
|
447
|
+
controller.signal,
|
|
448
|
+
timeoutSignal,
|
|
449
|
+
]);
|
|
450
|
+
|
|
451
|
+
try {
|
|
452
|
+
const vibe = await generateVibe(
|
|
453
|
+
{ theme: config.theme!, userPrompt: prompt },
|
|
454
|
+
combinedSignal,
|
|
455
|
+
);
|
|
456
|
+
|
|
457
|
+
// Only update if still streaming and THIS generation wasn't aborted
|
|
458
|
+
if (isStreaming && !controller.signal.aborted) {
|
|
459
|
+
trackRecentVibe(vibe);
|
|
460
|
+
setWorkingMessage(vibe);
|
|
461
|
+
}
|
|
462
|
+
} catch (error) {
|
|
463
|
+
// AbortError is expected on timeout/cancel - don't log as error
|
|
464
|
+
if (error instanceof Error && error.name === "AbortError") {
|
|
465
|
+
console.debug("[working-vibes] Generation aborted");
|
|
466
|
+
} else {
|
|
467
|
+
console.debug("[working-vibes] Generation failed:", error);
|
|
468
|
+
}
|
|
469
|
+
// Fallback already showing, no action needed
|
|
470
|
+
}
|
|
471
|
+
}
|
|
472
|
+
|
|
473
|
+
// ═══════════════════════════════════════════════════════════════════════════
|
|
474
|
+
// Exported Functions (called from index.ts)
|
|
475
|
+
// ═══════════════════════════════════════════════════════════════════════════
|
|
476
|
+
|
|
477
|
+
export function initVibeManager(ctx: ExtensionContext): void {
|
|
478
|
+
extensionCtx = ctx;
|
|
479
|
+
config = loadConfig(); // Refresh config in case settings changed
|
|
480
|
+
}
|
|
481
|
+
|
|
482
|
+
export function getVibeTheme(): string | null {
|
|
483
|
+
return config.theme;
|
|
484
|
+
}
|
|
485
|
+
|
|
486
|
+
export function setVibeTheme(theme: string | null): boolean {
|
|
487
|
+
config = { ...config, theme };
|
|
488
|
+
recentVibes = []; // Clear recent vibes on theme change
|
|
489
|
+
return saveConfig();
|
|
490
|
+
}
|
|
491
|
+
|
|
492
|
+
export function getVibeModel(): string {
|
|
493
|
+
return config.modelSpec;
|
|
494
|
+
}
|
|
495
|
+
|
|
496
|
+
export function setVibeModel(modelSpec: string): boolean {
|
|
497
|
+
config = { ...config, modelSpec };
|
|
498
|
+
return saveModelConfig();
|
|
499
|
+
}
|
|
500
|
+
|
|
501
|
+
export function onVibeBeforeAgentStart(
|
|
502
|
+
prompt: string,
|
|
503
|
+
setWorkingMessage: (msg?: string) => void,
|
|
504
|
+
): void {
|
|
505
|
+
// Skip if no theme configured or no extensionCtx
|
|
506
|
+
if (!config.theme || !extensionCtx) return;
|
|
507
|
+
|
|
508
|
+
// Queue themed placeholder BEFORE agent_start creates the loader
|
|
509
|
+
// This sets pendingWorkingMessage which is applied when loader is created
|
|
510
|
+
setWorkingMessage(`Channeling ${config.theme}...`);
|
|
511
|
+
|
|
512
|
+
// Mark vibe generation time for rate limiting
|
|
513
|
+
lastVibeTime = Date.now();
|
|
514
|
+
|
|
515
|
+
// Async: generate and update (fire-and-forget, don't await)
|
|
516
|
+
generateAndUpdate(prompt, setWorkingMessage);
|
|
517
|
+
}
|
|
518
|
+
|
|
519
|
+
export function onVibeAgentStart(): void {
|
|
520
|
+
isStreaming = true;
|
|
521
|
+
}
|
|
522
|
+
|
|
523
|
+
export function onVibeToolCall(
|
|
524
|
+
toolName: string,
|
|
525
|
+
toolInput: Record<string, unknown>,
|
|
526
|
+
setWorkingMessage: (msg?: string) => void,
|
|
527
|
+
agentContext?: string, // Optional: recent agent response text for richer context
|
|
528
|
+
): void {
|
|
529
|
+
// Skip if no theme, not streaming, or no extensionCtx
|
|
530
|
+
if (!config.theme || !extensionCtx || !isStreaming) return;
|
|
531
|
+
|
|
532
|
+
// Rate limit: skip if not enough time has passed
|
|
533
|
+
const now = Date.now();
|
|
534
|
+
if (now - lastVibeTime < config.refreshInterval) return;
|
|
535
|
+
|
|
536
|
+
// Prefer agent context if provided (richer, more contextual)
|
|
537
|
+
// Fall back to tool-based hint
|
|
538
|
+
let hint: string;
|
|
539
|
+
if (agentContext && agentContext.length > 10) {
|
|
540
|
+
// Use first ~150 chars of agent context
|
|
541
|
+
hint = agentContext.slice(0, 150);
|
|
542
|
+
} else {
|
|
543
|
+
// Build hint from tool name and input
|
|
544
|
+
hint = `using ${toolName} tool`;
|
|
545
|
+
if (toolName === "read" && toolInput.path) {
|
|
546
|
+
hint = `reading file: ${toolInput.path}`;
|
|
547
|
+
} else if (toolName === "write" && toolInput.path) {
|
|
548
|
+
hint = `writing file: ${toolInput.path}`;
|
|
549
|
+
} else if (toolName === "edit" && toolInput.path) {
|
|
550
|
+
hint = `editing file: ${toolInput.path}`;
|
|
551
|
+
} else if (toolName === "bash" && toolInput.command) {
|
|
552
|
+
const cmd = String(toolInput.command).slice(0, 40);
|
|
553
|
+
hint = `running command: ${cmd}`;
|
|
554
|
+
}
|
|
555
|
+
}
|
|
556
|
+
|
|
557
|
+
// Update time and generate new vibe
|
|
558
|
+
lastVibeTime = now;
|
|
559
|
+
generateAndUpdate(hint, setWorkingMessage);
|
|
560
|
+
}
|
|
561
|
+
|
|
562
|
+
export function onVibeAgentEnd(setWorkingMessage: (msg?: string) => void): void {
|
|
563
|
+
isStreaming = false;
|
|
564
|
+
// Cancel any in-flight generation
|
|
565
|
+
currentGeneration?.abort();
|
|
566
|
+
// Reset to pi's default working message
|
|
567
|
+
setWorkingMessage(undefined);
|
|
568
|
+
}
|
|
569
|
+
|
|
570
|
+
export function getVibeMode(): VibeMode {
|
|
571
|
+
return config.mode;
|
|
572
|
+
}
|
|
573
|
+
|
|
574
|
+
export function setVibeMode(mode: VibeMode): boolean {
|
|
575
|
+
config = { ...config, mode };
|
|
576
|
+
return saveModeConfig();
|
|
577
|
+
}
|
|
578
|
+
|
|
579
|
+
function saveModeConfig(): boolean {
|
|
580
|
+
const settings = readSettingsForWrite("workingVibeMode");
|
|
581
|
+
if (!settings) {
|
|
582
|
+
return false;
|
|
583
|
+
}
|
|
584
|
+
|
|
585
|
+
if (config.mode === "generate") {
|
|
586
|
+
delete settings.workingVibeMode;
|
|
587
|
+
} else {
|
|
588
|
+
settings.workingVibeMode = config.mode;
|
|
589
|
+
}
|
|
590
|
+
|
|
591
|
+
return persistSettings(settings, "workingVibeMode");
|
|
592
|
+
}
|
|
593
|
+
|
|
594
|
+
export function hasVibeFile(theme: string): boolean {
|
|
595
|
+
return existsSync(getVibeFilePath(theme));
|
|
596
|
+
}
|
|
597
|
+
|
|
598
|
+
export function getVibeFileCount(theme: string): number {
|
|
599
|
+
const vibes = loadVibesFromFile(theme);
|
|
600
|
+
return vibes.length;
|
|
601
|
+
}
|
|
602
|
+
|
|
603
|
+
export interface GenerateVibesResult {
|
|
604
|
+
success: boolean;
|
|
605
|
+
count: number;
|
|
606
|
+
filePath: string;
|
|
607
|
+
error?: string;
|
|
608
|
+
}
|
|
609
|
+
|
|
610
|
+
export async function generateVibesBatch(
|
|
611
|
+
theme: string,
|
|
612
|
+
count: number = 100,
|
|
613
|
+
): Promise<GenerateVibesResult> {
|
|
614
|
+
const filePath = getVibeFilePath(theme);
|
|
615
|
+
const safeCount = Number.isFinite(count) ? Math.min(Math.max(Math.floor(count), 1), 500) : 100;
|
|
616
|
+
|
|
617
|
+
if (!extensionCtx) {
|
|
618
|
+
return { success: false, count: 0, filePath, error: "Extension not initialized" };
|
|
619
|
+
}
|
|
620
|
+
|
|
621
|
+
// Parse model spec
|
|
622
|
+
const slashIndex = config.modelSpec.indexOf("/");
|
|
623
|
+
if (slashIndex === -1) {
|
|
624
|
+
return { success: false, count: 0, filePath, error: "Invalid model spec" };
|
|
625
|
+
}
|
|
626
|
+
const provider = config.modelSpec.slice(0, slashIndex);
|
|
627
|
+
const modelId = config.modelSpec.slice(slashIndex + 1);
|
|
628
|
+
|
|
629
|
+
// Resolve model
|
|
630
|
+
const model = extensionCtx.modelRegistry.find(provider, modelId);
|
|
631
|
+
if (!model) {
|
|
632
|
+
return { success: false, count: 0, filePath, error: `Model not found: ${config.modelSpec}` };
|
|
633
|
+
}
|
|
634
|
+
|
|
635
|
+
// Get auth
|
|
636
|
+
const auth = await extensionCtx.modelRegistry.getApiKeyAndHeaders(model);
|
|
637
|
+
if (!auth.ok) {
|
|
638
|
+
return { success: false, count: 0, filePath, error: auth.error };
|
|
639
|
+
}
|
|
640
|
+
|
|
641
|
+
// Build batch prompt
|
|
642
|
+
const prompt = BATCH_PROMPT
|
|
643
|
+
.replace(/\{theme\}/g, theme)
|
|
644
|
+
.replace(/\{count\}/g, String(safeCount));
|
|
645
|
+
|
|
646
|
+
const aiContext = buildAiContext(prompt);
|
|
647
|
+
|
|
648
|
+
try {
|
|
649
|
+
// Use longer timeout for batch generation (30 seconds)
|
|
650
|
+
const signal = AbortSignal.timeout(30000);
|
|
651
|
+
const response = await complete(model, aiContext, { apiKey: auth.apiKey, headers: auth.headers, signal });
|
|
652
|
+
|
|
653
|
+
const textContent = response.content.find(c => c.type === "text");
|
|
654
|
+
if (!textContent?.text) {
|
|
655
|
+
const error = response.stopReason === "error" && response.errorMessage
|
|
656
|
+
? response.errorMessage
|
|
657
|
+
: "Empty response from model";
|
|
658
|
+
return { success: false, count: 0, filePath, error };
|
|
659
|
+
}
|
|
660
|
+
|
|
661
|
+
// Parse response: one vibe per line
|
|
662
|
+
const vibes = textContent.text
|
|
663
|
+
.split("\n")
|
|
664
|
+
.map(line => line.trim())
|
|
665
|
+
.filter(line => line.length > 0)
|
|
666
|
+
.map(line => {
|
|
667
|
+
// Clean up each line
|
|
668
|
+
let vibe = line.replace(/^["'\d.\-)\s]+/, "").trim(); // Remove leading quotes, numbers, bullets
|
|
669
|
+
vibe = vibe.replace(/["']$/g, ""); // Remove trailing quotes
|
|
670
|
+
if (!vibe.endsWith("...")) {
|
|
671
|
+
vibe = vibe.replace(/\.+$/, "") + "...";
|
|
672
|
+
}
|
|
673
|
+
return vibe;
|
|
674
|
+
})
|
|
675
|
+
.filter(vibe => vibe.length > 3 && vibe !== "..."); // Filter invalid
|
|
676
|
+
|
|
677
|
+
if (vibes.length === 0) {
|
|
678
|
+
return { success: false, count: 0, filePath, error: "No valid vibes generated" };
|
|
679
|
+
}
|
|
680
|
+
|
|
681
|
+
// Save to file
|
|
682
|
+
saveVibesToFile(theme, vibes);
|
|
683
|
+
|
|
684
|
+
// Clear cache so next use loads fresh
|
|
685
|
+
if (vibeCacheTheme === theme) {
|
|
686
|
+
vibeCache = [];
|
|
687
|
+
vibeCacheTheme = null;
|
|
688
|
+
}
|
|
689
|
+
|
|
690
|
+
return { success: true, count: vibes.length, filePath };
|
|
691
|
+
} catch (error) {
|
|
692
|
+
const message = error instanceof Error ? error.message : "Unknown error";
|
|
693
|
+
return { success: false, count: 0, filePath, error: message };
|
|
694
|
+
}
|
|
695
|
+
}
|