@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,713 @@
|
|
|
1
|
+
import type {
|
|
2
|
+
ExtensionAPI,
|
|
3
|
+
ExtensionCommandContext,
|
|
4
|
+
ExtensionContext,
|
|
5
|
+
ToolDefinition,
|
|
6
|
+
} from "@earendil-works/pi-coding-agent";
|
|
7
|
+
import { Text } from "@earendil-works/pi-tui";
|
|
8
|
+
import { Type } from "typebox";
|
|
9
|
+
|
|
10
|
+
// ponytail: tool result content carries the full phase prompt for the model;
|
|
11
|
+
// renderResult shows only a short label so the user sees a clean progression
|
|
12
|
+
// (the long instructions are obfuscated from the TUI, not from the model).
|
|
13
|
+
|
|
14
|
+
// ponytail: tool-driven workflow loop. Agent advances phase by calling next_workflow_step
|
|
15
|
+
// (native structured tool call parsed by the framework — no text-marker narration hazard).
|
|
16
|
+
// end_workflow returns terminate:true to stop the agent loop and close the workflow.
|
|
17
|
+
|
|
18
|
+
type Phase =
|
|
19
|
+
| "grilling"
|
|
20
|
+
| "research"
|
|
21
|
+
| "plan"
|
|
22
|
+
| "reuse"
|
|
23
|
+
| "handoff"
|
|
24
|
+
| "loop"
|
|
25
|
+
| "audit";
|
|
26
|
+
|
|
27
|
+
const PHASE_ORDER: Phase[] = [
|
|
28
|
+
"grilling",
|
|
29
|
+
"research",
|
|
30
|
+
"plan",
|
|
31
|
+
"reuse",
|
|
32
|
+
"handoff",
|
|
33
|
+
"loop",
|
|
34
|
+
"audit",
|
|
35
|
+
];
|
|
36
|
+
const PHASE_STEP: Record<Phase, number> = {
|
|
37
|
+
grilling: 1,
|
|
38
|
+
research: 2,
|
|
39
|
+
plan: 3,
|
|
40
|
+
reuse: 4,
|
|
41
|
+
handoff: 5,
|
|
42
|
+
loop: 6,
|
|
43
|
+
audit: 7,
|
|
44
|
+
};
|
|
45
|
+
|
|
46
|
+
const STATUS_KEY = "prototype";
|
|
47
|
+
const ENTRY_TYPE = "prototype-phase";
|
|
48
|
+
|
|
49
|
+
const ARTIFACTS_BASE = "./.selesai/artifacts";
|
|
50
|
+
|
|
51
|
+
// ponytail: module-level state, one workflow at a time (same pattern as plan-mode).
|
|
52
|
+
let active = false;
|
|
53
|
+
let phase: Phase = "grilling";
|
|
54
|
+
let userPrompt = "";
|
|
55
|
+
// ponytail: 1 workflow = 1 folder. All workflow-generated docs go here for later review.
|
|
56
|
+
let artifactDir = "";
|
|
57
|
+
// ponytail: auto-advance arm. Re-armed on every phase change so the tool_result
|
|
58
|
+
// hook can fire once per phase when the expected artifact lands.
|
|
59
|
+
let autoArmed = false;
|
|
60
|
+
// ponytail: reentrancy guard. tool_result can fire while an advance is still
|
|
61
|
+
// resolving across async boundaries; a second write in the same turn must not
|
|
62
|
+
// start a second advancePhase that double-moves the phase forward.
|
|
63
|
+
let advancing = false;
|
|
64
|
+
|
|
65
|
+
const DEBUG = false;
|
|
66
|
+
function dbg(tag: string, data: Record<string, unknown>): void {
|
|
67
|
+
if (!DEBUG) return;
|
|
68
|
+
console.log(`[workflow] ${tag}`, data);
|
|
69
|
+
}
|
|
70
|
+
|
|
71
|
+
function slugify(s: string): string {
|
|
72
|
+
const slug = s
|
|
73
|
+
.toLowerCase()
|
|
74
|
+
.replace(/[^a-z0-9]+/g, "-")
|
|
75
|
+
.replace(/^-+|-+$/g, "")
|
|
76
|
+
.slice(0, 40);
|
|
77
|
+
return slug || "workflow";
|
|
78
|
+
}
|
|
79
|
+
|
|
80
|
+
function timestamp(): string {
|
|
81
|
+
const d = new Date();
|
|
82
|
+
const p = (n: number) => String(n).padStart(2, "0");
|
|
83
|
+
return `${d.getFullYear()}${p(d.getMonth() + 1)}${p(d.getDate())}-${p(d.getHours())}${p(d.getMinutes())}${p(d.getSeconds())}`;
|
|
84
|
+
}
|
|
85
|
+
|
|
86
|
+
function artifactPathFor(goal: string): string {
|
|
87
|
+
return `${ARTIFACTS_BASE}/${timestamp()}-${slugify(goal)}`;
|
|
88
|
+
}
|
|
89
|
+
|
|
90
|
+
function setPhase(pi: ExtensionAPI, p: Phase): void {
|
|
91
|
+
phase = p;
|
|
92
|
+
autoArmed = true;
|
|
93
|
+
// ponytail: persist userPrompt+artifactDir in every entry so session_start resume restores them.
|
|
94
|
+
pi.appendEntry(ENTRY_TYPE, {
|
|
95
|
+
mode: "prototype",
|
|
96
|
+
phase: p,
|
|
97
|
+
step: PHASE_STEP[p],
|
|
98
|
+
done: false,
|
|
99
|
+
userPrompt,
|
|
100
|
+
artifactDir,
|
|
101
|
+
});
|
|
102
|
+
}
|
|
103
|
+
|
|
104
|
+
function updateFooter(pi: ExtensionAPI, ctx: ExtensionContext): void {
|
|
105
|
+
if (!active) {
|
|
106
|
+
ctx.ui.setStatus(STATUS_KEY, undefined);
|
|
107
|
+
return;
|
|
108
|
+
}
|
|
109
|
+
const step = PHASE_STEP[phase];
|
|
110
|
+
ctx.ui.setStatus(
|
|
111
|
+
STATUS_KEY,
|
|
112
|
+
ctx.ui.theme.fg("warning", `● prototype · ${step}/7 ${phase}`),
|
|
113
|
+
);
|
|
114
|
+
}
|
|
115
|
+
|
|
116
|
+
// ponytail: each step has an expected artifact file that must exist before advancing.
|
|
117
|
+
// Without this gate the model can call next_step repeatedly without doing any work.
|
|
118
|
+
const PHASE_ARTIFACT: Partial<Record<Phase, string>> = {
|
|
119
|
+
grilling: "requirements.md",
|
|
120
|
+
research: "research.md",
|
|
121
|
+
plan: "plan.md",
|
|
122
|
+
reuse: "reuse.md",
|
|
123
|
+
handoff: "handoff.md",
|
|
124
|
+
loop: "loop-complete.md",
|
|
125
|
+
audit: "review.md",
|
|
126
|
+
};
|
|
127
|
+
|
|
128
|
+
async function phaseArtifactExists(
|
|
129
|
+
pi: ExtensionAPI,
|
|
130
|
+
p: Phase,
|
|
131
|
+
): Promise<boolean> {
|
|
132
|
+
const file = PHASE_ARTIFACT[p];
|
|
133
|
+
if (!file) return true;
|
|
134
|
+
try {
|
|
135
|
+
const result = await pi.exec("test", ["-f", `${artifactDir}/${file}`]);
|
|
136
|
+
return result.code === 0;
|
|
137
|
+
} catch {
|
|
138
|
+
return false;
|
|
139
|
+
}
|
|
140
|
+
}
|
|
141
|
+
|
|
142
|
+
function nextPhase(p: Phase): Phase | null {
|
|
143
|
+
const i = PHASE_ORDER.indexOf(p);
|
|
144
|
+
if (i < 0 || i >= PHASE_ORDER.length - 1) return null;
|
|
145
|
+
return PHASE_ORDER[i + 1];
|
|
146
|
+
}
|
|
147
|
+
|
|
148
|
+
type AdvanceOutcome =
|
|
149
|
+
| { status: "advanced"; phase: Phase; prompt: string; skipped?: Phase }
|
|
150
|
+
| { status: "blocked"; phase: Phase; missing: string }
|
|
151
|
+
| { status: "terminal"; phase: "audit"; missing?: string }
|
|
152
|
+
| { status: "idle"; phase: Phase };
|
|
153
|
+
|
|
154
|
+
// ponytail: shared phase-transition logic. Used by next_step (manual) and the
|
|
155
|
+
// tool_result auto-advance hook (so the workflow self-drives once an artifact
|
|
156
|
+
// lands instead of stalling for the model to remember to call next_step).
|
|
157
|
+
async function advancePhase(
|
|
158
|
+
pi: ExtensionAPI,
|
|
159
|
+
ctx: ExtensionContext,
|
|
160
|
+
): Promise<AdvanceOutcome> {
|
|
161
|
+
if (!active) return { status: "idle", phase };
|
|
162
|
+
const expected = PHASE_ARTIFACT[phase];
|
|
163
|
+
if (expected && !(await phaseArtifactExists(pi, phase))) {
|
|
164
|
+
return { status: "blocked", phase, missing: expected };
|
|
165
|
+
}
|
|
166
|
+
const next = nextPhase(phase);
|
|
167
|
+
if (!next) {
|
|
168
|
+
// audit terminal: need review.md + audit.md before closing.
|
|
169
|
+
const reviewExists = await phaseArtifactExists(pi, "audit");
|
|
170
|
+
let auditExists = true;
|
|
171
|
+
try {
|
|
172
|
+
auditExists =
|
|
173
|
+
(await pi.exec("test", ["-f", `${artifactDir}/audit.md`])).code === 0;
|
|
174
|
+
} catch {
|
|
175
|
+
auditExists = false;
|
|
176
|
+
}
|
|
177
|
+
if (!reviewExists || !auditExists) {
|
|
178
|
+
return {
|
|
179
|
+
status: "terminal",
|
|
180
|
+
phase: "audit",
|
|
181
|
+
missing: !reviewExists ? "review.md" : "audit.md",
|
|
182
|
+
};
|
|
183
|
+
}
|
|
184
|
+
return { status: "terminal", phase: "audit" };
|
|
185
|
+
}
|
|
186
|
+
// ponytail: empty-project cutoff — skip reuse if no git commits.
|
|
187
|
+
if (next === "reuse" && (await isEmptyProject(pi))) {
|
|
188
|
+
setPhase(pi, "handoff");
|
|
189
|
+
updateFooter(pi, ctx);
|
|
190
|
+
return {
|
|
191
|
+
status: "advanced",
|
|
192
|
+
phase: "handoff",
|
|
193
|
+
prompt: phasePrompt("handoff"),
|
|
194
|
+
skipped: "reuse",
|
|
195
|
+
};
|
|
196
|
+
}
|
|
197
|
+
setPhase(pi, next);
|
|
198
|
+
updateFooter(pi, ctx);
|
|
199
|
+
return { status: "advanced", phase: next, prompt: phasePrompt(next) };
|
|
200
|
+
}
|
|
201
|
+
|
|
202
|
+
// ponytail: close the workflow. Returns a result tuple for both the
|
|
203
|
+
// end_workflow tool and the auto-advance terminal path.
|
|
204
|
+
async function endWorkflow(
|
|
205
|
+
pi: ExtensionAPI,
|
|
206
|
+
ctx: ExtensionContext,
|
|
207
|
+
): Promise<{
|
|
208
|
+
ok: boolean;
|
|
209
|
+
text: string;
|
|
210
|
+
closed?: boolean;
|
|
211
|
+
artifactDir?: string;
|
|
212
|
+
phase?: Phase;
|
|
213
|
+
}> {
|
|
214
|
+
if (!active) {
|
|
215
|
+
return { ok: false, text: "No active prototype workflow to end." };
|
|
216
|
+
}
|
|
217
|
+
if (phase !== "audit") {
|
|
218
|
+
return {
|
|
219
|
+
ok: false,
|
|
220
|
+
text: `Cannot end workflow from phase ${phase}. end_workflow is only allowed from audit.`,
|
|
221
|
+
phase,
|
|
222
|
+
};
|
|
223
|
+
}
|
|
224
|
+
const reviewExists = await phaseArtifactExists(pi, "audit");
|
|
225
|
+
let auditExists = true;
|
|
226
|
+
try {
|
|
227
|
+
auditExists =
|
|
228
|
+
(await pi.exec("test", ["-f", `${artifactDir}/audit.md`])).code === 0;
|
|
229
|
+
} catch {
|
|
230
|
+
auditExists = false;
|
|
231
|
+
}
|
|
232
|
+
if (!reviewExists || !auditExists) {
|
|
233
|
+
return {
|
|
234
|
+
ok: false,
|
|
235
|
+
text: `Audit step is not complete. Write ${artifactDir}/review.md and ${artifactDir}/audit.md first.`,
|
|
236
|
+
phase,
|
|
237
|
+
};
|
|
238
|
+
}
|
|
239
|
+
active = false;
|
|
240
|
+
pi.appendEntry(ENTRY_TYPE, {
|
|
241
|
+
mode: "prototype",
|
|
242
|
+
phase,
|
|
243
|
+
step: PHASE_STEP[phase],
|
|
244
|
+
done: true,
|
|
245
|
+
userPrompt,
|
|
246
|
+
artifactDir,
|
|
247
|
+
});
|
|
248
|
+
updateFooter(pi, ctx);
|
|
249
|
+
ctx.ui.notify(
|
|
250
|
+
`Prototype workflow complete. Artifacts: ${artifactDir}`,
|
|
251
|
+
"info",
|
|
252
|
+
);
|
|
253
|
+
return {
|
|
254
|
+
ok: true,
|
|
255
|
+
closed: true,
|
|
256
|
+
phase,
|
|
257
|
+
artifactDir,
|
|
258
|
+
text: `Workflow ended and closed. It can no longer be used. Artifacts saved at ${artifactDir}.`,
|
|
259
|
+
};
|
|
260
|
+
}
|
|
261
|
+
|
|
262
|
+
// ponytail: phase prompts are purpose-driven, context-rich, and non-rigid.
|
|
263
|
+
// Each one states the phase's true goal + the accumulated context available,
|
|
264
|
+
// then leaves the AI free to craft its own approach (and its own sub-agent
|
|
265
|
+
// prompts) instead of following a fixed template. Research is optional; the
|
|
266
|
+
// agent decides whether to invoke it and signals a skip via research.md.
|
|
267
|
+
function phasePrompt(p: Phase): string {
|
|
268
|
+
switch (p) {
|
|
269
|
+
case "grilling":
|
|
270
|
+
return `You are entering the GRILLING phase of a prototype workflow.
|
|
271
|
+
|
|
272
|
+
User's initial request:
|
|
273
|
+
${userPrompt}
|
|
274
|
+
|
|
275
|
+
The purpose of this phase is NOT to start solving — it is to INTERVIEW the user until the requirements are unambiguous. You are the interviewer: drive the conversation. Ask focused clarifying questions ONE at a time, and adapt each question to what the user reveals. Dig into scope, constraints, success criteria, edge cases, and anything ambiguous. Use your own judgement to decide what still needs clarifying — do not follow a fixed checklist. Provide rich context in your questions so the user understands why each matters.
|
|
276
|
+
|
|
277
|
+
When you and the user have reached shared understanding, write a concise requirements summary to ${artifactDir}/requirements.md. The workflow advances automatically once requirements.md exists.`;
|
|
278
|
+
case "research":
|
|
279
|
+
return `You are entering the RESEARCH phase. This phase is OPTIONAL.
|
|
280
|
+
|
|
281
|
+
Research is only needed when the task depends on external knowledge that changes fast: libraries, frameworks, languages/SDKs, APIs, or alternative approaches you are not already confident about. Do NOT research things you already know well enough, and do not waste tokens on unnecessary lookups.
|
|
282
|
+
|
|
283
|
+
First decide: is research needed here?
|
|
284
|
+
- If YES: use web search tools (webfetch / web_search_exa) to gather current, authoritative information on the relevant libraries/frameworks/approaches, then synthesize actionable findings (versions, APIs, pitfalls, recommended approaches).
|
|
285
|
+
- If NO: skip real research.
|
|
286
|
+
|
|
287
|
+
Either way, write ${artifactDir}/research.md. If you skipped, state briefly WHY research was unnecessary so downstream phases know. If you researched, record findings the plan can rely on.
|
|
288
|
+
|
|
289
|
+
The workflow advances automatically once research.md exists.`;
|
|
290
|
+
case "plan":
|
|
291
|
+
return `You are entering the PLAN phase.
|
|
292
|
+
|
|
293
|
+
This plan is for the ACTUAL prototype/output the user wants — not a plan for research. Based on ${artifactDir}/requirements.md (and ${artifactDir}/research.md if it contains real research), produce the concrete build plan: what to build, how, in what order, which components, and what the finished prototype looks like.
|
|
294
|
+
|
|
295
|
+
If research was skipped, that is fine — proceed directly. You already understand the user's intent from grilling. Write the plan to ${artifactDir}/plan.md. Use the planger skill.
|
|
296
|
+
|
|
297
|
+
The workflow advances automatically once plan.md exists.`;
|
|
298
|
+
case "reuse":
|
|
299
|
+
return `You are entering the REUSE phase.
|
|
300
|
+
|
|
301
|
+
Purpose: explore the existing codebase for reusable components, patterns, and knowledge this prototype should build on, so you do not reinvent what already exists.
|
|
302
|
+
|
|
303
|
+
Spawn an EXPLORER SUB-AGENT to do the exploration. Use the task tool with subagent_type "explore". Do NOT send a generic exploration prompt — CRAFT a specific prompt tailored to THIS task: from ${artifactDir}/requirements.md and ${artifactDir}/plan.md, tell the explorer exactly which areas of the codebase, which patterns, and which dependencies are relevant. For example, if the user wants Tailwind, have the explorer determine how Tailwind is already set up and used here and what conventions to follow.
|
|
304
|
+
|
|
305
|
+
When the explorer returns, synthesize its findings into ${artifactDir}/reuse.md: what is reusable, where, and how the prototype should leverage it.
|
|
306
|
+
|
|
307
|
+
The workflow advances automatically once reuse.md exists.`;
|
|
308
|
+
case "handoff":
|
|
309
|
+
return `You are entering the HANDOFF phase.
|
|
310
|
+
|
|
311
|
+
Purpose: compile everything you have learned so far into a self-contained handoff document so the sub-agents in the loop phase can understand the full project context without re-grilling.
|
|
312
|
+
|
|
313
|
+
Draw from ALL prior phases:
|
|
314
|
+
- ${artifactDir}/requirements.md (grilling outcomes)
|
|
315
|
+
- ${artifactDir}/research.md (research, or the skip note)
|
|
316
|
+
- ${artifactDir}/plan.md (the build plan)
|
|
317
|
+
- ${artifactDir}/reuse.md (codebase exploration findings)
|
|
318
|
+
|
|
319
|
+
Write a coherent handoff to ${artifactDir}/handoff.md: the goal, the requirements, the relevant research, the plan, and the reusable assets discovered. Use the handoff skill.
|
|
320
|
+
|
|
321
|
+
The workflow advances automatically once handoff.md exists.`;
|
|
322
|
+
case "loop":
|
|
323
|
+
return `You are entering the LOOP (orchestration) phase. Your job is to DELEGATE the implementation to sub-agents — do not implement the code yourself.
|
|
324
|
+
|
|
325
|
+
Read ${artifactDir}/plan.md, ${artifactDir}/handoff.md, ${artifactDir}/research.md, and ${artifactDir}/reuse.md. Using that full context, GENERATE YOUR OWN delegation prompts (do not use a static template):
|
|
326
|
+
1. Dispatch ONE builder sub-agent (task tool, subagent_type "general") with a prompt YOU craft: give it the plan + handoff + any research/reuse context it needs, tailored to this specific task, and instruct it to implement every task in plan.md in order. All code changes go in the workspace, never in ${artifactDir}.
|
|
327
|
+
2. Dispatch ONE commentator sub-agent (same tool) to review the builder's diff against plan.md. Generate the review prompt YOURSELF based on what matters for this task.
|
|
328
|
+
3. If the commentator reports blocking issues, dispatch the builder again with the issues to fix, then re-run the commentator. Repeat until no issues.
|
|
329
|
+
4. Write ${artifactDir}/loop-complete.md with a one-line summary of the finished plan.
|
|
330
|
+
|
|
331
|
+
Generate the prompts with full awareness of the task — tailored, not generic. The workflow advances to audit automatically once loop-complete.md exists.`;
|
|
332
|
+
case "audit":
|
|
333
|
+
return `You are entering the AUDIT phase.
|
|
334
|
+
|
|
335
|
+
Purpose: review the changes made during the loop phase, then audit for over-engineering across the repo.
|
|
336
|
+
|
|
337
|
+
Review the full diff from this workflow. Run a code review (write to ${artifactDir}/review.md) covering correctness and adherence to the plan, then run a whole-repo over-engineering audit (write to ${artifactDir}/audit.md). Generate your own review approach based on what was actually built — do not follow a fixed checklist.
|
|
338
|
+
|
|
339
|
+
The workflow closes automatically once both review.md and audit.md exist.`;
|
|
340
|
+
default:
|
|
341
|
+
return "";
|
|
342
|
+
}
|
|
343
|
+
}
|
|
344
|
+
|
|
345
|
+
// ponytail: continuation abstraction. The agent is mid-turn (streaming) when
|
|
346
|
+
// the tool_result hook fires, so a bare sendUserMessage() throws
|
|
347
|
+
// "Agent is already processing. Specify streamingBehavior...". deliverAs:"followUp"
|
|
348
|
+
// is the framework-native continuation: it queues the next-phase prompt as a
|
|
349
|
+
// follow-up turn that fires automatically once the current turn ends. In idle
|
|
350
|
+
// state (e.g. session resume) it sends a direct turn.
|
|
351
|
+
function continueWorkflow(
|
|
352
|
+
pi: ExtensionAPI,
|
|
353
|
+
ctx: ExtensionContext,
|
|
354
|
+
prompt: string,
|
|
355
|
+
): void {
|
|
356
|
+
dbg("continuing agent", { phase, prompt: prompt.slice(0, 60) });
|
|
357
|
+
if (ctx.isIdle()) {
|
|
358
|
+
pi.sendUserMessage(prompt);
|
|
359
|
+
} else {
|
|
360
|
+
pi.sendUserMessage(prompt, { deliverAs: "followUp" });
|
|
361
|
+
}
|
|
362
|
+
}
|
|
363
|
+
|
|
364
|
+
async function beginWorkflow(
|
|
365
|
+
pi: ExtensionAPI,
|
|
366
|
+
ctx: ExtensionContext,
|
|
367
|
+
goal: string,
|
|
368
|
+
): Promise<string> {
|
|
369
|
+
userPrompt = goal.trim();
|
|
370
|
+
// ponytail: 1 workflow = 1 folder under ./.selesai/artifacts/. Timestamp prefix avoids collisions.
|
|
371
|
+
artifactDir = artifactPathFor(userPrompt);
|
|
372
|
+
await pi.exec("mkdir", ["-p", artifactDir]);
|
|
373
|
+
active = true;
|
|
374
|
+
setPhase(pi, "grilling");
|
|
375
|
+
updateFooter(pi, ctx);
|
|
376
|
+
return phasePrompt("grilling");
|
|
377
|
+
}
|
|
378
|
+
|
|
379
|
+
// ponytail: empty-project check during plan→reuse transition. Skip reuse if no git commits.
|
|
380
|
+
async function isEmptyProject(pi: ExtensionAPI): Promise<boolean> {
|
|
381
|
+
try {
|
|
382
|
+
const result = await pi.exec("git", ["log", "--oneline", "-1"]);
|
|
383
|
+
return result.code !== 0 || !result.stdout.trim();
|
|
384
|
+
} catch {
|
|
385
|
+
return false;
|
|
386
|
+
}
|
|
387
|
+
}
|
|
388
|
+
|
|
389
|
+
export default function prototypeExtension(pi: ExtensionAPI): void {
|
|
390
|
+
// start_workflow: begin a workflow from natural language ("start a prototype workflow to build X").
|
|
391
|
+
pi.registerTool({
|
|
392
|
+
name: "start_workflow",
|
|
393
|
+
label: "Start Workflow",
|
|
394
|
+
description:
|
|
395
|
+
"Start the prototype workflow for the given goal. Sets up grilling as the first phase and returns the grilling prompt. Do not call if a workflow is already active.",
|
|
396
|
+
promptSnippet:
|
|
397
|
+
"start_workflow(goal) - start the prototype workflow; goal is what the user wants to build.",
|
|
398
|
+
promptGuidelines: [
|
|
399
|
+
"Call start_workflow only when the user explicitly asks to start a prototype workflow and none is active.",
|
|
400
|
+
"Pass the user's full goal as the goal parameter.",
|
|
401
|
+
],
|
|
402
|
+
parameters: Type.Object({
|
|
403
|
+
goal: Type.String({
|
|
404
|
+
description:
|
|
405
|
+
"What the user wants the prototype to build or accomplish.",
|
|
406
|
+
}),
|
|
407
|
+
}),
|
|
408
|
+
async execute(_id, params, _signal, _onUpdate, ctx) {
|
|
409
|
+
if (active) {
|
|
410
|
+
return {
|
|
411
|
+
content: [
|
|
412
|
+
{
|
|
413
|
+
type: "text",
|
|
414
|
+
text: `A prototype workflow is already active (phase: ${phase}). Use next_step or end_workflow, not start_workflow.`,
|
|
415
|
+
},
|
|
416
|
+
],
|
|
417
|
+
details: { phase, alreadyActive: true },
|
|
418
|
+
};
|
|
419
|
+
}
|
|
420
|
+
const prompt = await beginWorkflow(pi, ctx, params.goal);
|
|
421
|
+
return {
|
|
422
|
+
content: [{ type: "text", text: `Workflow started. ${prompt}` }],
|
|
423
|
+
details: { phase: "grilling" },
|
|
424
|
+
};
|
|
425
|
+
},
|
|
426
|
+
renderResult(_result, _options, theme) {
|
|
427
|
+
return new Text(
|
|
428
|
+
theme.fg("warning", `● workflow started · 1/7 grilling`),
|
|
429
|
+
0,
|
|
430
|
+
0,
|
|
431
|
+
);
|
|
432
|
+
},
|
|
433
|
+
} satisfies ToolDefinition);
|
|
434
|
+
|
|
435
|
+
// next_step: advance the workflow one step; tool result drives the next step in the same run.
|
|
436
|
+
pi.registerTool({
|
|
437
|
+
name: "next_step",
|
|
438
|
+
label: "Next Step",
|
|
439
|
+
description:
|
|
440
|
+
"Advance the prototype workflow one step after the current step is complete. Returns the next step's instructions. Do not call until the current step is fully complete.",
|
|
441
|
+
promptSnippet:
|
|
442
|
+
"next_step() - advance the prototype workflow one step once the current step is done.",
|
|
443
|
+
promptGuidelines: [
|
|
444
|
+
"Call next_step only when the current workflow step is genuinely complete.",
|
|
445
|
+
"From the final step (audit), call end_workflow instead.",
|
|
446
|
+
],
|
|
447
|
+
parameters: Type.Object({}),
|
|
448
|
+
async execute(_id, _params, _signal, _onUpdate, ctx) {
|
|
449
|
+
if (!active) {
|
|
450
|
+
return {
|
|
451
|
+
content: [
|
|
452
|
+
{
|
|
453
|
+
type: "text",
|
|
454
|
+
text: "No active prototype workflow. Call start_workflow first.",
|
|
455
|
+
},
|
|
456
|
+
],
|
|
457
|
+
details: { active: false },
|
|
458
|
+
};
|
|
459
|
+
}
|
|
460
|
+
const out = await advancePhase(pi, ctx);
|
|
461
|
+
if (out.status === "idle") {
|
|
462
|
+
return {
|
|
463
|
+
content: [
|
|
464
|
+
{
|
|
465
|
+
type: "text",
|
|
466
|
+
text: "No active prototype workflow. Call start_workflow first.",
|
|
467
|
+
},
|
|
468
|
+
],
|
|
469
|
+
details: { active: false },
|
|
470
|
+
};
|
|
471
|
+
}
|
|
472
|
+
if (out.status === "blocked") {
|
|
473
|
+
return {
|
|
474
|
+
content: [
|
|
475
|
+
{
|
|
476
|
+
type: "text",
|
|
477
|
+
text: `Current step (${out.phase}) is not complete. Write ${artifactDir}/${out.missing} first, then call next_step again.`,
|
|
478
|
+
},
|
|
479
|
+
],
|
|
480
|
+
details: { phase: out.phase, blocked: out.missing },
|
|
481
|
+
};
|
|
482
|
+
}
|
|
483
|
+
if (out.status === "terminal") {
|
|
484
|
+
if (out.missing) {
|
|
485
|
+
return {
|
|
486
|
+
content: [
|
|
487
|
+
{
|
|
488
|
+
type: "text",
|
|
489
|
+
text: `Audit step is not complete. Write ${artifactDir}/${out.missing} first, then call end_workflow.`,
|
|
490
|
+
},
|
|
491
|
+
],
|
|
492
|
+
details: { phase: "audit", blocked: out.missing },
|
|
493
|
+
};
|
|
494
|
+
}
|
|
495
|
+
return {
|
|
496
|
+
content: [
|
|
497
|
+
{
|
|
498
|
+
type: "text",
|
|
499
|
+
text: `Already at the final phase (audit). Call end_workflow to close the workflow.`,
|
|
500
|
+
},
|
|
501
|
+
],
|
|
502
|
+
details: { phase: "audit" },
|
|
503
|
+
};
|
|
504
|
+
}
|
|
505
|
+
// advanced
|
|
506
|
+
const label = out.skipped
|
|
507
|
+
? `Phase advanced to ${out.phase} (skipped ${out.skipped}). ${out.prompt}`
|
|
508
|
+
: `Phase advanced to ${out.phase}. ${out.prompt}`;
|
|
509
|
+
return {
|
|
510
|
+
content: [{ type: "text", text: label }],
|
|
511
|
+
details: { phase: out.phase, skipped: out.skipped },
|
|
512
|
+
};
|
|
513
|
+
},
|
|
514
|
+
renderResult(result, _options, theme) {
|
|
515
|
+
const d = result.details as {
|
|
516
|
+
phase?: string;
|
|
517
|
+
skipped?: string;
|
|
518
|
+
active?: boolean;
|
|
519
|
+
blocked?: string;
|
|
520
|
+
};
|
|
521
|
+
if (d.active === false) {
|
|
522
|
+
return new Text(theme.fg("dim", "○ no active workflow"), 0, 0);
|
|
523
|
+
}
|
|
524
|
+
if (d.blocked) {
|
|
525
|
+
return new Text(
|
|
526
|
+
theme.fg("warning", `✋ ${d.phase} blocked · missing ${d.blocked}`),
|
|
527
|
+
0,
|
|
528
|
+
0,
|
|
529
|
+
);
|
|
530
|
+
}
|
|
531
|
+
const label = d.skipped
|
|
532
|
+
? `${PHASE_STEP[d.phase as Phase]}/7 ${d.phase} (skipped ${d.skipped})`
|
|
533
|
+
: `${PHASE_STEP[d.phase as Phase]}/7 ${d.phase}`;
|
|
534
|
+
return new Text(theme.fg("warning", `▲ ${label}`), 0, 0);
|
|
535
|
+
},
|
|
536
|
+
} satisfies ToolDefinition);
|
|
537
|
+
|
|
538
|
+
// end_workflow: close the workflow and stop the agent loop.
|
|
539
|
+
pi.registerTool({
|
|
540
|
+
name: "end_workflow",
|
|
541
|
+
label: "End Workflow",
|
|
542
|
+
description:
|
|
543
|
+
"Close the prototype workflow. Must be called when the final phase (audit) is complete. Marks the workflow finished and stops the agent loop.",
|
|
544
|
+
promptSnippet:
|
|
545
|
+
"end_workflow() - close the finished prototype workflow; no further phase transitions allowed.",
|
|
546
|
+
promptGuidelines: [
|
|
547
|
+
"Call end_workflow exactly once, from the audit phase, when both review and audit are complete.",
|
|
548
|
+
],
|
|
549
|
+
parameters: Type.Object({}),
|
|
550
|
+
async execute(_id, _params, _signal, _onUpdate, ctx) {
|
|
551
|
+
const r = await endWorkflow(pi, ctx);
|
|
552
|
+
if (!r.ok) {
|
|
553
|
+
return {
|
|
554
|
+
content: [{ type: "text", text: r.text }],
|
|
555
|
+
details: r.phase
|
|
556
|
+
? { phase: r.phase, blocked: "audit artifacts" }
|
|
557
|
+
: { active: false },
|
|
558
|
+
};
|
|
559
|
+
}
|
|
560
|
+
return {
|
|
561
|
+
content: [{ type: "text", text: r.text }],
|
|
562
|
+
details: { closed: true, phase: r.phase, artifactDir: r.artifactDir },
|
|
563
|
+
terminate: true,
|
|
564
|
+
};
|
|
565
|
+
},
|
|
566
|
+
renderResult(result, _options, theme) {
|
|
567
|
+
const d = result.details as { closed?: boolean; artifactDir?: string };
|
|
568
|
+
if (!d.closed) {
|
|
569
|
+
return new Text(theme.fg("dim", "○ no workflow to end"), 0, 0);
|
|
570
|
+
}
|
|
571
|
+
return new Text(
|
|
572
|
+
theme.fg("success", `✓ workflow closed · ${d.artifactDir}`),
|
|
573
|
+
0,
|
|
574
|
+
0,
|
|
575
|
+
);
|
|
576
|
+
},
|
|
577
|
+
} satisfies ToolDefinition);
|
|
578
|
+
|
|
579
|
+
// session_start: restore state from persisted entries.
|
|
580
|
+
pi.on("session_start", async (_event: any, ctx: ExtensionContext) => {
|
|
581
|
+
const entries = ctx.sessionManager.getEntries();
|
|
582
|
+
for (let i = entries.length - 1; i >= 0; i--) {
|
|
583
|
+
const e = entries[i] as { type: string; customType?: string; data?: any };
|
|
584
|
+
if (e.type === "custom" && e.customType === ENTRY_TYPE && e.data) {
|
|
585
|
+
if (e.data.done) {
|
|
586
|
+
active = false;
|
|
587
|
+
} else {
|
|
588
|
+
active = true;
|
|
589
|
+
phase = e.data.phase as Phase;
|
|
590
|
+
autoArmed = true;
|
|
591
|
+
userPrompt = e.data.userPrompt ?? "";
|
|
592
|
+
artifactDir = e.data.artifactDir ?? "";
|
|
593
|
+
}
|
|
594
|
+
updateFooter(pi, ctx);
|
|
595
|
+
break;
|
|
596
|
+
}
|
|
597
|
+
}
|
|
598
|
+
});
|
|
599
|
+
|
|
600
|
+
// ponytail: auto-advance. When a write/edit/bash tool finishes, check whether
|
|
601
|
+
// the current phase's expected artifact has landed. If so, advance the phase
|
|
602
|
+
// and queue the next phase prompt as a follow-up turn so the workflow keeps
|
|
603
|
+
// moving instead of stalling for the model to remember to call next_step.
|
|
604
|
+
// The gate in advancePhase prevents skipping phases even if the model also
|
|
605
|
+
// calls next_step manually. A bare sendUserMessage() cannot be used here:
|
|
606
|
+
// the agent is mid-turn (streaming) while tool_result fires, so prompt()
|
|
607
|
+
// would throw "Agent is already processing" without deliverAs:"followUp".
|
|
608
|
+
pi.on("tool_result", async (event: any, ctx: ExtensionContext) => {
|
|
609
|
+
if (advancing) return;
|
|
610
|
+
if (!active || !autoArmed) return;
|
|
611
|
+
if (
|
|
612
|
+
event.toolName !== "write" &&
|
|
613
|
+
event.toolName !== "edit" &&
|
|
614
|
+
event.toolName !== "bash"
|
|
615
|
+
)
|
|
616
|
+
return;
|
|
617
|
+
const expected = PHASE_ARTIFACT[phase];
|
|
618
|
+
if (!expected) return;
|
|
619
|
+
// Acquire the lock synchronously before any await so a concurrent
|
|
620
|
+
// tool_result in the same turn sees `advancing` true and bails out.
|
|
621
|
+
// Without this, both would pass the guard then each await their own
|
|
622
|
+
// phaseArtifactExists and both advance the phase.
|
|
623
|
+
advancing = true;
|
|
624
|
+
try {
|
|
625
|
+
if (!(await phaseArtifactExists(pi, phase))) return;
|
|
626
|
+
autoArmed = false;
|
|
627
|
+
dbg("artifact detected", { phase, artifactDir, expected });
|
|
628
|
+
const from = phase;
|
|
629
|
+
const out = await advancePhase(pi, ctx);
|
|
630
|
+
if (out.status === "advanced") {
|
|
631
|
+
dbg("advancing", { from, to: out.phase });
|
|
632
|
+
continueWorkflow(pi, ctx, out.prompt);
|
|
633
|
+
} else if (out.status === "terminal") {
|
|
634
|
+
if (out.missing) {
|
|
635
|
+
continueWorkflow(
|
|
636
|
+
pi,
|
|
637
|
+
ctx,
|
|
638
|
+
`Audit phase still needs ${artifactDir}/${out.missing}. Write it, then the workflow closes automatically.`,
|
|
639
|
+
);
|
|
640
|
+
} else {
|
|
641
|
+
// Both audit artifacts present — close the workflow directly.
|
|
642
|
+
await endWorkflow(pi, ctx);
|
|
643
|
+
}
|
|
644
|
+
}
|
|
645
|
+
// blocked / idle: nothing to inject.
|
|
646
|
+
} finally {
|
|
647
|
+
advancing = false;
|
|
648
|
+
}
|
|
649
|
+
});
|
|
650
|
+
|
|
651
|
+
// /prototype: human kickoff. If a workflow is active, ask whether to continue it
|
|
652
|
+
// or close it and start a new one. Otherwise start a new workflow from args.
|
|
653
|
+
pi.registerCommand("prototype", {
|
|
654
|
+
description:
|
|
655
|
+
"Run the prototype workflow (grill → research → plan → reuse → handoff → loop → audit)",
|
|
656
|
+
handler: async (args: string, ctx: ExtensionCommandContext) => {
|
|
657
|
+
if (!ctx.isIdle()) {
|
|
658
|
+
ctx.ui.notify(
|
|
659
|
+
"Agent is busy. Wait for it to finish before calling /prototype.",
|
|
660
|
+
"warning",
|
|
661
|
+
);
|
|
662
|
+
return;
|
|
663
|
+
}
|
|
664
|
+
|
|
665
|
+
// ponytail: when a workflow is already active, ask the user how to proceed.
|
|
666
|
+
if (active) {
|
|
667
|
+
let goal = args.trim();
|
|
668
|
+
const choice = ctx.hasUI
|
|
669
|
+
? await ctx.ui.select(
|
|
670
|
+
`Workflow already active (phase: ${phase}). What do you want to do?`,
|
|
671
|
+
[
|
|
672
|
+
`Continue current workflow at ${phase}`,
|
|
673
|
+
"Close current and start a new one",
|
|
674
|
+
],
|
|
675
|
+
)
|
|
676
|
+
: undefined;
|
|
677
|
+
if (choice === undefined) return; // cancelled or no UI
|
|
678
|
+
if (choice.startsWith("Continue")) {
|
|
679
|
+
continueWorkflow(pi, ctx, phasePrompt(phase));
|
|
680
|
+
return;
|
|
681
|
+
}
|
|
682
|
+
// Close + start new: require a goal before touching state.
|
|
683
|
+
if (!goal && ctx.hasUI) {
|
|
684
|
+
goal = (await ctx.ui.input("Goal for the new workflow:")) ?? "";
|
|
685
|
+
}
|
|
686
|
+
if (!goal.trim()) {
|
|
687
|
+
ctx.ui.notify(
|
|
688
|
+
"No goal provided. Keeping current workflow active.",
|
|
689
|
+
"warning",
|
|
690
|
+
);
|
|
691
|
+
return;
|
|
692
|
+
}
|
|
693
|
+
// ponytail: record old workflow as done, then beginWorkflow overwrites all state.
|
|
694
|
+
pi.appendEntry(ENTRY_TYPE, {
|
|
695
|
+
mode: "prototype",
|
|
696
|
+
phase,
|
|
697
|
+
step: PHASE_STEP[phase],
|
|
698
|
+
done: true,
|
|
699
|
+
userPrompt,
|
|
700
|
+
artifactDir,
|
|
701
|
+
});
|
|
702
|
+
ctx.ui.notify(`Closed workflow at ${artifactDir}.`, "info");
|
|
703
|
+
args = goal;
|
|
704
|
+
} else if (!args.trim()) {
|
|
705
|
+
ctx.ui.notify("Usage: /prototype <what to build>", "warning");
|
|
706
|
+
return;
|
|
707
|
+
}
|
|
708
|
+
|
|
709
|
+
const prompt = await beginWorkflow(pi, ctx, args);
|
|
710
|
+
pi.sendUserMessage(prompt);
|
|
711
|
+
},
|
|
712
|
+
});
|
|
713
|
+
}
|