@draht/coding-agent 2026.3.2-2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +2866 -0
- package/README.md +566 -0
- package/bin/draht-tools.cjs +912 -0
- package/dist/cli/args.d.ts +48 -0
- package/dist/cli/args.d.ts.map +1 -0
- package/dist/cli/args.js +298 -0
- package/dist/cli/args.js.map +1 -0
- package/dist/cli/config-selector.d.ts +14 -0
- package/dist/cli/config-selector.d.ts.map +1 -0
- package/dist/cli/config-selector.js +31 -0
- package/dist/cli/config-selector.js.map +1 -0
- package/dist/cli/file-processor.d.ts +15 -0
- package/dist/cli/file-processor.d.ts.map +1 -0
- package/dist/cli/file-processor.js +79 -0
- package/dist/cli/file-processor.js.map +1 -0
- package/dist/cli/list-models.d.ts +9 -0
- package/dist/cli/list-models.d.ts.map +1 -0
- package/dist/cli/list-models.js +92 -0
- package/dist/cli/list-models.js.map +1 -0
- package/dist/cli/session-picker.d.ts +9 -0
- package/dist/cli/session-picker.d.ts.map +1 -0
- package/dist/cli/session-picker.js +34 -0
- package/dist/cli/session-picker.js.map +1 -0
- package/dist/cli.d.ts +3 -0
- package/dist/cli.d.ts.map +1 -0
- package/dist/cli.js +11 -0
- package/dist/cli.js.map +1 -0
- package/dist/config.d.ts +85 -0
- package/dist/config.d.ts.map +1 -0
- package/dist/config.js +235 -0
- package/dist/config.js.map +1 -0
- package/dist/core/agent-session.d.ts +571 -0
- package/dist/core/agent-session.d.ts.map +1 -0
- package/dist/core/agent-session.js +2343 -0
- package/dist/core/agent-session.js.map +1 -0
- package/dist/core/auth-storage.d.ts +129 -0
- package/dist/core/auth-storage.d.ts.map +1 -0
- package/dist/core/auth-storage.js +394 -0
- package/dist/core/auth-storage.js.map +1 -0
- package/dist/core/bash-executor.d.ts +47 -0
- package/dist/core/bash-executor.d.ts.map +1 -0
- package/dist/core/bash-executor.js +212 -0
- package/dist/core/bash-executor.js.map +1 -0
- package/dist/core/compaction/branch-summarization.d.ts +86 -0
- package/dist/core/compaction/branch-summarization.d.ts.map +1 -0
- package/dist/core/compaction/branch-summarization.js +242 -0
- package/dist/core/compaction/branch-summarization.js.map +1 -0
- package/dist/core/compaction/compaction.d.ts +121 -0
- package/dist/core/compaction/compaction.d.ts.map +1 -0
- package/dist/core/compaction/compaction.js +607 -0
- package/dist/core/compaction/compaction.js.map +1 -0
- package/dist/core/compaction/index.d.ts +7 -0
- package/dist/core/compaction/index.d.ts.map +1 -0
- package/dist/core/compaction/index.js +7 -0
- package/dist/core/compaction/index.js.map +1 -0
- package/dist/core/compaction/utils.d.ts +35 -0
- package/dist/core/compaction/utils.d.ts.map +1 -0
- package/dist/core/compaction/utils.js +138 -0
- package/dist/core/compaction/utils.js.map +1 -0
- package/dist/core/defaults.d.ts +3 -0
- package/dist/core/defaults.d.ts.map +1 -0
- package/dist/core/defaults.js +2 -0
- package/dist/core/defaults.js.map +1 -0
- package/dist/core/diagnostics.d.ts +15 -0
- package/dist/core/diagnostics.d.ts.map +1 -0
- package/dist/core/diagnostics.js +2 -0
- package/dist/core/diagnostics.js.map +1 -0
- package/dist/core/event-bus.d.ts +9 -0
- package/dist/core/event-bus.d.ts.map +1 -0
- package/dist/core/event-bus.js +25 -0
- package/dist/core/event-bus.js.map +1 -0
- package/dist/core/exec.d.ts +29 -0
- package/dist/core/exec.d.ts.map +1 -0
- package/dist/core/exec.js +71 -0
- package/dist/core/exec.js.map +1 -0
- package/dist/core/export-html/ansi-to-html.d.ts +22 -0
- package/dist/core/export-html/ansi-to-html.d.ts.map +1 -0
- package/dist/core/export-html/ansi-to-html.js +249 -0
- package/dist/core/export-html/ansi-to-html.js.map +1 -0
- package/dist/core/export-html/index.d.ts +34 -0
- package/dist/core/export-html/index.d.ts.map +1 -0
- package/dist/core/export-html/index.js +222 -0
- package/dist/core/export-html/index.js.map +1 -0
- package/dist/core/export-html/template.css +971 -0
- package/dist/core/export-html/template.html +54 -0
- package/dist/core/export-html/template.js +1586 -0
- package/dist/core/export-html/tool-renderer.d.ts +35 -0
- package/dist/core/export-html/tool-renderer.d.ts.map +1 -0
- package/dist/core/export-html/tool-renderer.js +57 -0
- package/dist/core/export-html/tool-renderer.js.map +1 -0
- package/dist/core/export-html/vendor/highlight.min.js +1213 -0
- package/dist/core/export-html/vendor/marked.min.js +6 -0
- package/dist/core/extensions/index.d.ts +11 -0
- package/dist/core/extensions/index.d.ts.map +1 -0
- package/dist/core/extensions/index.js +9 -0
- package/dist/core/extensions/index.js.map +1 -0
- package/dist/core/extensions/loader.d.ts +25 -0
- package/dist/core/extensions/loader.d.ts.map +1 -0
- package/dist/core/extensions/loader.js +415 -0
- package/dist/core/extensions/loader.js.map +1 -0
- package/dist/core/extensions/runner.d.ts +146 -0
- package/dist/core/extensions/runner.d.ts.map +1 -0
- package/dist/core/extensions/runner.js +645 -0
- package/dist/core/extensions/runner.js.map +1 -0
- package/dist/core/extensions/types.d.ts +1011 -0
- package/dist/core/extensions/types.d.ts.map +1 -0
- package/dist/core/extensions/types.js +35 -0
- package/dist/core/extensions/types.js.map +1 -0
- package/dist/core/extensions/wrapper.d.ts +27 -0
- package/dist/core/extensions/wrapper.d.ts.map +1 -0
- package/dist/core/extensions/wrapper.js +102 -0
- package/dist/core/extensions/wrapper.js.map +1 -0
- package/dist/core/footer-data-provider.d.ts +32 -0
- package/dist/core/footer-data-provider.d.ts.map +1 -0
- package/dist/core/footer-data-provider.js +134 -0
- package/dist/core/footer-data-provider.js.map +1 -0
- package/dist/core/index.d.ts +9 -0
- package/dist/core/index.d.ts.map +1 -0
- package/dist/core/index.js +9 -0
- package/dist/core/index.js.map +1 -0
- package/dist/core/keybindings.d.ts +55 -0
- package/dist/core/keybindings.d.ts.map +1 -0
- package/dist/core/keybindings.js +153 -0
- package/dist/core/keybindings.js.map +1 -0
- package/dist/core/messages.d.ts +77 -0
- package/dist/core/messages.d.ts.map +1 -0
- package/dist/core/messages.js +123 -0
- package/dist/core/messages.js.map +1 -0
- package/dist/core/model-registry.d.ts +112 -0
- package/dist/core/model-registry.d.ts.map +1 -0
- package/dist/core/model-registry.js +534 -0
- package/dist/core/model-registry.js.map +1 -0
- package/dist/core/model-resolver.d.ts +104 -0
- package/dist/core/model-resolver.d.ts.map +1 -0
- package/dist/core/model-resolver.js +432 -0
- package/dist/core/model-resolver.js.map +1 -0
- package/dist/core/package-manager.d.ts +151 -0
- package/dist/core/package-manager.d.ts.map +1 -0
- package/dist/core/package-manager.js +1447 -0
- package/dist/core/package-manager.js.map +1 -0
- package/dist/core/prompt-templates.d.ts +50 -0
- package/dist/core/prompt-templates.d.ts.map +1 -0
- package/dist/core/prompt-templates.js +268 -0
- package/dist/core/prompt-templates.js.map +1 -0
- package/dist/core/resolve-config-value.d.ts +17 -0
- package/dist/core/resolve-config-value.d.ts.map +1 -0
- package/dist/core/resolve-config-value.js +59 -0
- package/dist/core/resolve-config-value.js.map +1 -0
- package/dist/core/resource-loader.d.ts +184 -0
- package/dist/core/resource-loader.d.ts.map +1 -0
- package/dist/core/resource-loader.js +670 -0
- package/dist/core/resource-loader.js.map +1 -0
- package/dist/core/sdk.d.ts +90 -0
- package/dist/core/sdk.d.ts.map +1 -0
- package/dist/core/sdk.js +235 -0
- package/dist/core/sdk.js.map +1 -0
- package/dist/core/session-manager.d.ts +323 -0
- package/dist/core/session-manager.d.ts.map +1 -0
- package/dist/core/session-manager.js +1098 -0
- package/dist/core/session-manager.js.map +1 -0
- package/dist/core/settings-manager.d.ts +225 -0
- package/dist/core/settings-manager.d.ts.map +1 -0
- package/dist/core/settings-manager.js +653 -0
- package/dist/core/settings-manager.js.map +1 -0
- package/dist/core/skills.d.ts +58 -0
- package/dist/core/skills.d.ts.map +1 -0
- package/dist/core/skills.js +364 -0
- package/dist/core/skills.js.map +1 -0
- package/dist/core/slash-commands.d.ts +15 -0
- package/dist/core/slash-commands.d.ts.map +1 -0
- package/dist/core/slash-commands.js +22 -0
- package/dist/core/slash-commands.js.map +1 -0
- package/dist/core/system-prompt.d.ts +24 -0
- package/dist/core/system-prompt.d.ts.map +1 -0
- package/dist/core/system-prompt.js +137 -0
- package/dist/core/system-prompt.js.map +1 -0
- package/dist/core/timings.d.ts +7 -0
- package/dist/core/timings.d.ts.map +1 -0
- package/dist/core/timings.js +25 -0
- package/dist/core/timings.js.map +1 -0
- package/dist/core/tools/bash.d.ts +55 -0
- package/dist/core/tools/bash.d.ts.map +1 -0
- package/dist/core/tools/bash.js +242 -0
- package/dist/core/tools/bash.js.map +1 -0
- package/dist/core/tools/edit-diff.d.ts +63 -0
- package/dist/core/tools/edit-diff.d.ts.map +1 -0
- package/dist/core/tools/edit-diff.js +243 -0
- package/dist/core/tools/edit-diff.js.map +1 -0
- package/dist/core/tools/edit.d.ts +39 -0
- package/dist/core/tools/edit.d.ts.map +1 -0
- package/dist/core/tools/edit.js +146 -0
- package/dist/core/tools/edit.js.map +1 -0
- package/dist/core/tools/find.d.ts +39 -0
- package/dist/core/tools/find.d.ts.map +1 -0
- package/dist/core/tools/find.js +206 -0
- package/dist/core/tools/find.js.map +1 -0
- package/dist/core/tools/grep.d.ts +45 -0
- package/dist/core/tools/grep.d.ts.map +1 -0
- package/dist/core/tools/grep.js +239 -0
- package/dist/core/tools/grep.js.map +1 -0
- package/dist/core/tools/index.d.ts +73 -0
- package/dist/core/tools/index.d.ts.map +1 -0
- package/dist/core/tools/index.js +61 -0
- package/dist/core/tools/index.js.map +1 -0
- package/dist/core/tools/ls.d.ts +40 -0
- package/dist/core/tools/ls.d.ts.map +1 -0
- package/dist/core/tools/ls.js +118 -0
- package/dist/core/tools/ls.js.map +1 -0
- package/dist/core/tools/path-utils.d.ts +8 -0
- package/dist/core/tools/path-utils.d.ts.map +1 -0
- package/dist/core/tools/path-utils.js +81 -0
- package/dist/core/tools/path-utils.js.map +1 -0
- package/dist/core/tools/read.d.ts +39 -0
- package/dist/core/tools/read.d.ts.map +1 -0
- package/dist/core/tools/read.js +166 -0
- package/dist/core/tools/read.js.map +1 -0
- package/dist/core/tools/truncate.d.ts +70 -0
- package/dist/core/tools/truncate.d.ts.map +1 -0
- package/dist/core/tools/truncate.js +205 -0
- package/dist/core/tools/truncate.js.map +1 -0
- package/dist/core/tools/write.d.ts +29 -0
- package/dist/core/tools/write.d.ts.map +1 -0
- package/dist/core/tools/write.js +78 -0
- package/dist/core/tools/write.js.map +1 -0
- package/dist/extensions/gsd-commands.ts +338 -0
- package/dist/extensions/subagent.ts +312 -0
- package/dist/hooks/gsd/draht-post-phase.js +133 -0
- package/dist/hooks/gsd/draht-post-task.js +132 -0
- package/dist/hooks/gsd/draht-pre-execute.js +146 -0
- package/dist/hooks/gsd/draht-quality-gate.js +210 -0
- package/dist/index.d.ts +27 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +42 -0
- package/dist/index.js.map +1 -0
- package/dist/main.d.ts +8 -0
- package/dist/main.d.ts.map +1 -0
- package/dist/main.js +812 -0
- package/dist/main.js.map +1 -0
- package/dist/migrations.d.ts +33 -0
- package/dist/migrations.d.ts.map +1 -0
- package/dist/migrations.js +261 -0
- package/dist/migrations.js.map +1 -0
- package/dist/modes/index.d.ts +9 -0
- package/dist/modes/index.d.ts.map +1 -0
- package/dist/modes/index.js +8 -0
- package/dist/modes/index.js.map +1 -0
- package/dist/modes/interactive/components/armin.d.ts +34 -0
- package/dist/modes/interactive/components/armin.d.ts.map +1 -0
- package/dist/modes/interactive/components/armin.js +333 -0
- package/dist/modes/interactive/components/armin.js.map +1 -0
- package/dist/modes/interactive/components/assistant-message.d.ts +16 -0
- package/dist/modes/interactive/components/assistant-message.d.ts.map +1 -0
- package/dist/modes/interactive/components/assistant-message.js +96 -0
- package/dist/modes/interactive/components/assistant-message.js.map +1 -0
- package/dist/modes/interactive/components/bash-execution.d.ts +35 -0
- package/dist/modes/interactive/components/bash-execution.d.ts.map +1 -0
- package/dist/modes/interactive/components/bash-execution.js +162 -0
- package/dist/modes/interactive/components/bash-execution.js.map +1 -0
- package/dist/modes/interactive/components/bordered-loader.d.ts +16 -0
- package/dist/modes/interactive/components/bordered-loader.d.ts.map +1 -0
- package/dist/modes/interactive/components/bordered-loader.js +51 -0
- package/dist/modes/interactive/components/bordered-loader.js.map +1 -0
- package/dist/modes/interactive/components/branch-summary-message.d.ts +16 -0
- package/dist/modes/interactive/components/branch-summary-message.d.ts.map +1 -0
- package/dist/modes/interactive/components/branch-summary-message.js +44 -0
- package/dist/modes/interactive/components/branch-summary-message.js.map +1 -0
- package/dist/modes/interactive/components/compaction-summary-message.d.ts +16 -0
- package/dist/modes/interactive/components/compaction-summary-message.d.ts.map +1 -0
- package/dist/modes/interactive/components/compaction-summary-message.js +45 -0
- package/dist/modes/interactive/components/compaction-summary-message.js.map +1 -0
- package/dist/modes/interactive/components/config-selector.d.ts +71 -0
- package/dist/modes/interactive/components/config-selector.d.ts.map +1 -0
- package/dist/modes/interactive/components/config-selector.js +479 -0
- package/dist/modes/interactive/components/config-selector.js.map +1 -0
- package/dist/modes/interactive/components/countdown-timer.d.ts +14 -0
- package/dist/modes/interactive/components/countdown-timer.d.ts.map +1 -0
- package/dist/modes/interactive/components/countdown-timer.js +33 -0
- package/dist/modes/interactive/components/countdown-timer.js.map +1 -0
- package/dist/modes/interactive/components/custom-editor.d.ts +21 -0
- package/dist/modes/interactive/components/custom-editor.d.ts.map +1 -0
- package/dist/modes/interactive/components/custom-editor.js +70 -0
- package/dist/modes/interactive/components/custom-editor.js.map +1 -0
- package/dist/modes/interactive/components/custom-message.d.ts +20 -0
- package/dist/modes/interactive/components/custom-message.d.ts.map +1 -0
- package/dist/modes/interactive/components/custom-message.js +79 -0
- package/dist/modes/interactive/components/custom-message.js.map +1 -0
- package/dist/modes/interactive/components/daxnuts.d.ts +23 -0
- package/dist/modes/interactive/components/daxnuts.d.ts.map +1 -0
- package/dist/modes/interactive/components/daxnuts.js +140 -0
- package/dist/modes/interactive/components/daxnuts.js.map +1 -0
- package/dist/modes/interactive/components/diff.d.ts +12 -0
- package/dist/modes/interactive/components/diff.d.ts.map +1 -0
- package/dist/modes/interactive/components/diff.js +133 -0
- package/dist/modes/interactive/components/diff.js.map +1 -0
- package/dist/modes/interactive/components/dynamic-border.d.ts +15 -0
- package/dist/modes/interactive/components/dynamic-border.d.ts.map +1 -0
- package/dist/modes/interactive/components/dynamic-border.js +21 -0
- package/dist/modes/interactive/components/dynamic-border.js.map +1 -0
- package/dist/modes/interactive/components/extension-editor.d.ts +17 -0
- package/dist/modes/interactive/components/extension-editor.d.ts.map +1 -0
- package/dist/modes/interactive/components/extension-editor.js +102 -0
- package/dist/modes/interactive/components/extension-editor.js.map +1 -0
- package/dist/modes/interactive/components/extension-input.d.ts +23 -0
- package/dist/modes/interactive/components/extension-input.d.ts.map +1 -0
- package/dist/modes/interactive/components/extension-input.js +61 -0
- package/dist/modes/interactive/components/extension-input.js.map +1 -0
- package/dist/modes/interactive/components/extension-selector.d.ts +24 -0
- package/dist/modes/interactive/components/extension-selector.d.ts.map +1 -0
- package/dist/modes/interactive/components/extension-selector.js +78 -0
- package/dist/modes/interactive/components/extension-selector.js.map +1 -0
- package/dist/modes/interactive/components/footer.d.ts +26 -0
- package/dist/modes/interactive/components/footer.d.ts.map +1 -0
- package/dist/modes/interactive/components/footer.js +213 -0
- package/dist/modes/interactive/components/footer.js.map +1 -0
- package/dist/modes/interactive/components/index.d.ts +32 -0
- package/dist/modes/interactive/components/index.d.ts.map +1 -0
- package/dist/modes/interactive/components/index.js +33 -0
- package/dist/modes/interactive/components/index.js.map +1 -0
- package/dist/modes/interactive/components/keybinding-hints.d.ts +41 -0
- package/dist/modes/interactive/components/keybinding-hints.d.ts.map +1 -0
- package/dist/modes/interactive/components/keybinding-hints.js +61 -0
- package/dist/modes/interactive/components/keybinding-hints.js.map +1 -0
- package/dist/modes/interactive/components/login-dialog.d.ts +42 -0
- package/dist/modes/interactive/components/login-dialog.d.ts.map +1 -0
- package/dist/modes/interactive/components/login-dialog.js +145 -0
- package/dist/modes/interactive/components/login-dialog.js.map +1 -0
- package/dist/modes/interactive/components/model-selector.d.ts +47 -0
- package/dist/modes/interactive/components/model-selector.d.ts.map +1 -0
- package/dist/modes/interactive/components/model-selector.js +271 -0
- package/dist/modes/interactive/components/model-selector.js.map +1 -0
- package/dist/modes/interactive/components/oauth-selector.d.ts +19 -0
- package/dist/modes/interactive/components/oauth-selector.d.ts.map +1 -0
- package/dist/modes/interactive/components/oauth-selector.js +97 -0
- package/dist/modes/interactive/components/oauth-selector.js.map +1 -0
- package/dist/modes/interactive/components/scoped-models-selector.d.ts +49 -0
- package/dist/modes/interactive/components/scoped-models-selector.d.ts.map +1 -0
- package/dist/modes/interactive/components/scoped-models-selector.js +275 -0
- package/dist/modes/interactive/components/scoped-models-selector.js.map +1 -0
- package/dist/modes/interactive/components/session-selector-search.d.ts +23 -0
- package/dist/modes/interactive/components/session-selector-search.d.ts.map +1 -0
- package/dist/modes/interactive/components/session-selector-search.js +155 -0
- package/dist/modes/interactive/components/session-selector-search.js.map +1 -0
- package/dist/modes/interactive/components/session-selector.d.ts +95 -0
- package/dist/modes/interactive/components/session-selector.d.ts.map +1 -0
- package/dist/modes/interactive/components/session-selector.js +851 -0
- package/dist/modes/interactive/components/session-selector.js.map +1 -0
- package/dist/modes/interactive/components/settings-selector.d.ts +56 -0
- package/dist/modes/interactive/components/settings-selector.d.ts.map +1 -0
- package/dist/modes/interactive/components/settings-selector.js +287 -0
- package/dist/modes/interactive/components/settings-selector.js.map +1 -0
- package/dist/modes/interactive/components/show-images-selector.d.ts +10 -0
- package/dist/modes/interactive/components/show-images-selector.d.ts.map +1 -0
- package/dist/modes/interactive/components/show-images-selector.js +35 -0
- package/dist/modes/interactive/components/show-images-selector.js.map +1 -0
- package/dist/modes/interactive/components/skill-invocation-message.d.ts +17 -0
- package/dist/modes/interactive/components/skill-invocation-message.d.ts.map +1 -0
- package/dist/modes/interactive/components/skill-invocation-message.js +47 -0
- package/dist/modes/interactive/components/skill-invocation-message.js.map +1 -0
- package/dist/modes/interactive/components/theme-selector.d.ts +11 -0
- package/dist/modes/interactive/components/theme-selector.d.ts.map +1 -0
- package/dist/modes/interactive/components/theme-selector.js +46 -0
- package/dist/modes/interactive/components/theme-selector.js.map +1 -0
- package/dist/modes/interactive/components/thinking-selector.d.ts +11 -0
- package/dist/modes/interactive/components/thinking-selector.d.ts.map +1 -0
- package/dist/modes/interactive/components/thinking-selector.js +47 -0
- package/dist/modes/interactive/components/thinking-selector.js.map +1 -0
- package/dist/modes/interactive/components/tool-execution.d.ts +75 -0
- package/dist/modes/interactive/components/tool-execution.d.ts.map +1 -0
- package/dist/modes/interactive/components/tool-execution.js +752 -0
- package/dist/modes/interactive/components/tool-execution.js.map +1 -0
- package/dist/modes/interactive/components/tree-selector.d.ts +68 -0
- package/dist/modes/interactive/components/tree-selector.d.ts.map +1 -0
- package/dist/modes/interactive/components/tree-selector.js +934 -0
- package/dist/modes/interactive/components/tree-selector.js.map +1 -0
- package/dist/modes/interactive/components/user-message-selector.d.ts +30 -0
- package/dist/modes/interactive/components/user-message-selector.d.ts.map +1 -0
- package/dist/modes/interactive/components/user-message-selector.js +113 -0
- package/dist/modes/interactive/components/user-message-selector.js.map +1 -0
- package/dist/modes/interactive/components/user-message.d.ts +8 -0
- package/dist/modes/interactive/components/user-message.d.ts.map +1 -0
- package/dist/modes/interactive/components/user-message.js +16 -0
- package/dist/modes/interactive/components/user-message.js.map +1 -0
- package/dist/modes/interactive/components/visual-truncate.d.ts +24 -0
- package/dist/modes/interactive/components/visual-truncate.d.ts.map +1 -0
- package/dist/modes/interactive/components/visual-truncate.js +33 -0
- package/dist/modes/interactive/components/visual-truncate.js.map +1 -0
- package/dist/modes/interactive/interactive-mode.d.ts +315 -0
- package/dist/modes/interactive/interactive-mode.d.ts.map +1 -0
- package/dist/modes/interactive/interactive-mode.js +3719 -0
- package/dist/modes/interactive/interactive-mode.js.map +1 -0
- package/dist/modes/interactive/theme/dark.json +85 -0
- package/dist/modes/interactive/theme/light.json +84 -0
- package/dist/modes/interactive/theme/theme-schema.json +335 -0
- package/dist/modes/interactive/theme/theme.d.ts +78 -0
- package/dist/modes/interactive/theme/theme.d.ts.map +1 -0
- package/dist/modes/interactive/theme/theme.js +944 -0
- package/dist/modes/interactive/theme/theme.js.map +1 -0
- package/dist/modes/print-mode.d.ts +28 -0
- package/dist/modes/print-mode.d.ts.map +1 -0
- package/dist/modes/print-mode.js +101 -0
- package/dist/modes/print-mode.js.map +1 -0
- package/dist/modes/rpc/rpc-client.d.ts +217 -0
- package/dist/modes/rpc/rpc-client.d.ts.map +1 -0
- package/dist/modes/rpc/rpc-client.js +405 -0
- package/dist/modes/rpc/rpc-client.js.map +1 -0
- package/dist/modes/rpc/rpc-mode.d.ts +20 -0
- package/dist/modes/rpc/rpc-mode.d.ts.map +1 -0
- package/dist/modes/rpc/rpc-mode.js +511 -0
- package/dist/modes/rpc/rpc-mode.js.map +1 -0
- package/dist/modes/rpc/rpc-types.d.ts +409 -0
- package/dist/modes/rpc/rpc-types.d.ts.map +1 -0
- package/dist/modes/rpc/rpc-types.js +8 -0
- package/dist/modes/rpc/rpc-types.js.map +1 -0
- package/dist/prompts/agents/build.md +44 -0
- package/dist/prompts/agents/plan.md +39 -0
- package/dist/prompts/agents/verify.md +33 -0
- package/dist/prompts/commands/atomic-commit.md +39 -0
- package/dist/prompts/commands/discuss-phase.md +25 -0
- package/dist/prompts/commands/execute-phase.md +59 -0
- package/dist/prompts/commands/map-codebase.md +32 -0
- package/dist/prompts/commands/new-project.md +40 -0
- package/dist/prompts/commands/pause-work.md +12 -0
- package/dist/prompts/commands/plan-phase.md +61 -0
- package/dist/prompts/commands/progress.md +12 -0
- package/dist/prompts/commands/quick.md +19 -0
- package/dist/prompts/commands/resume-work.md +13 -0
- package/dist/prompts/commands/verify-work.md +27 -0
- package/dist/utils/changelog.d.ts +21 -0
- package/dist/utils/changelog.d.ts.map +1 -0
- package/dist/utils/changelog.js +87 -0
- package/dist/utils/changelog.js.map +1 -0
- package/dist/utils/clipboard-image.d.ts +11 -0
- package/dist/utils/clipboard-image.d.ts.map +1 -0
- package/dist/utils/clipboard-image.js +162 -0
- package/dist/utils/clipboard-image.js.map +1 -0
- package/dist/utils/clipboard-native.d.ts +7 -0
- package/dist/utils/clipboard-native.d.ts.map +1 -0
- package/dist/utils/clipboard-native.js +14 -0
- package/dist/utils/clipboard-native.js.map +1 -0
- package/dist/utils/clipboard.d.ts +2 -0
- package/dist/utils/clipboard.d.ts.map +1 -0
- package/dist/utils/clipboard.js +67 -0
- package/dist/utils/clipboard.js.map +1 -0
- package/dist/utils/frontmatter.d.ts +8 -0
- package/dist/utils/frontmatter.d.ts.map +1 -0
- package/dist/utils/frontmatter.js +26 -0
- package/dist/utils/frontmatter.js.map +1 -0
- package/dist/utils/git.d.ts +26 -0
- package/dist/utils/git.d.ts.map +1 -0
- package/dist/utils/git.js +163 -0
- package/dist/utils/git.js.map +1 -0
- package/dist/utils/image-convert.d.ts +9 -0
- package/dist/utils/image-convert.d.ts.map +1 -0
- package/dist/utils/image-convert.js +35 -0
- package/dist/utils/image-convert.js.map +1 -0
- package/dist/utils/image-resize.d.ts +36 -0
- package/dist/utils/image-resize.d.ts.map +1 -0
- package/dist/utils/image-resize.js +181 -0
- package/dist/utils/image-resize.js.map +1 -0
- package/dist/utils/mime.d.ts +2 -0
- package/dist/utils/mime.d.ts.map +1 -0
- package/dist/utils/mime.js +26 -0
- package/dist/utils/mime.js.map +1 -0
- package/dist/utils/photon.d.ts +21 -0
- package/dist/utils/photon.d.ts.map +1 -0
- package/dist/utils/photon.js +121 -0
- package/dist/utils/photon.js.map +1 -0
- package/dist/utils/shell.d.ts +26 -0
- package/dist/utils/shell.d.ts.map +1 -0
- package/dist/utils/shell.js +186 -0
- package/dist/utils/shell.js.map +1 -0
- package/dist/utils/sleep.d.ts +5 -0
- package/dist/utils/sleep.d.ts.map +1 -0
- package/dist/utils/sleep.js +17 -0
- package/dist/utils/sleep.js.map +1 -0
- package/dist/utils/tools-manager.d.ts +3 -0
- package/dist/utils/tools-manager.d.ts.map +1 -0
- package/dist/utils/tools-manager.js +251 -0
- package/dist/utils/tools-manager.js.map +1 -0
- package/docs/compaction.md +390 -0
- package/docs/custom-provider.md +580 -0
- package/docs/development.md +69 -0
- package/docs/extensions.md +1952 -0
- package/docs/images/doom-extension.png +0 -0
- package/docs/images/exy.png +0 -0
- package/docs/images/interactive-mode.png +0 -0
- package/docs/images/tree-view.png +0 -0
- package/docs/json.md +79 -0
- package/docs/keybindings.md +174 -0
- package/docs/models.md +293 -0
- package/docs/packages.md +209 -0
- package/docs/prompt-templates.md +67 -0
- package/docs/providers.md +186 -0
- package/docs/rpc.md +1317 -0
- package/docs/sdk.md +968 -0
- package/docs/session.md +412 -0
- package/docs/settings.md +223 -0
- package/docs/shell-aliases.md +13 -0
- package/docs/skills.md +231 -0
- package/docs/terminal-setup.md +70 -0
- package/docs/termux.md +127 -0
- package/docs/themes.md +295 -0
- package/docs/tree.md +219 -0
- package/docs/tui.md +887 -0
- package/docs/windows.md +17 -0
- package/examples/README.md +25 -0
- package/examples/extensions/README.md +204 -0
- package/examples/extensions/antigravity-image-gen.ts +413 -0
- package/examples/extensions/auto-commit-on-exit.ts +49 -0
- package/examples/extensions/bash-spawn-hook.ts +30 -0
- package/examples/extensions/bookmark.ts +50 -0
- package/examples/extensions/built-in-tool-renderer.ts +246 -0
- package/examples/extensions/claude-rules.ts +86 -0
- package/examples/extensions/commands.ts +72 -0
- package/examples/extensions/confirm-destructive.ts +59 -0
- package/examples/extensions/custom-compaction.ts +114 -0
- package/examples/extensions/custom-footer.ts +64 -0
- package/examples/extensions/custom-header.ts +73 -0
- package/examples/extensions/custom-provider-anthropic/index.ts +604 -0
- package/examples/extensions/custom-provider-anthropic/package-lock.json +24 -0
- package/examples/extensions/custom-provider-anthropic/package.json +19 -0
- package/examples/extensions/custom-provider-gitlab-duo/index.ts +349 -0
- package/examples/extensions/custom-provider-gitlab-duo/package.json +16 -0
- package/examples/extensions/custom-provider-gitlab-duo/test.ts +82 -0
- package/examples/extensions/custom-provider-qwen-cli/index.ts +345 -0
- package/examples/extensions/custom-provider-qwen-cli/package.json +16 -0
- package/examples/extensions/dirty-repo-guard.ts +56 -0
- package/examples/extensions/doom-overlay/README.md +46 -0
- package/examples/extensions/doom-overlay/doom/build/doom.js +21 -0
- package/examples/extensions/doom-overlay/doom/build/doom.wasm +0 -0
- package/examples/extensions/doom-overlay/doom/build.sh +152 -0
- package/examples/extensions/doom-overlay/doom/doomgeneric_pi.c +72 -0
- package/examples/extensions/doom-overlay/doom-component.ts +132 -0
- package/examples/extensions/doom-overlay/doom-engine.ts +173 -0
- package/examples/extensions/doom-overlay/doom-keys.ts +104 -0
- package/examples/extensions/doom-overlay/index.ts +74 -0
- package/examples/extensions/doom-overlay/wad-finder.ts +51 -0
- package/examples/extensions/dynamic-resources/SKILL.md +8 -0
- package/examples/extensions/dynamic-resources/dynamic.json +79 -0
- package/examples/extensions/dynamic-resources/dynamic.md +5 -0
- package/examples/extensions/dynamic-resources/index.ts +15 -0
- package/examples/extensions/event-bus.ts +43 -0
- package/examples/extensions/file-trigger.ts +41 -0
- package/examples/extensions/git-checkpoint.ts +53 -0
- package/examples/extensions/handoff.ts +150 -0
- package/examples/extensions/hello.ts +25 -0
- package/examples/extensions/inline-bash.ts +94 -0
- package/examples/extensions/input-transform.ts +43 -0
- package/examples/extensions/interactive-shell.ts +196 -0
- package/examples/extensions/mac-system-theme.ts +47 -0
- package/examples/extensions/message-renderer.ts +59 -0
- package/examples/extensions/minimal-mode.ts +426 -0
- package/examples/extensions/modal-editor.ts +85 -0
- package/examples/extensions/model-status.ts +31 -0
- package/examples/extensions/notify.ts +55 -0
- package/examples/extensions/overlay-qa-tests.ts +881 -0
- package/examples/extensions/overlay-test.ts +150 -0
- package/examples/extensions/permission-gate.ts +34 -0
- package/examples/extensions/pirate.ts +47 -0
- package/examples/extensions/plan-mode/README.md +65 -0
- package/examples/extensions/plan-mode/index.ts +340 -0
- package/examples/extensions/plan-mode/utils.ts +168 -0
- package/examples/extensions/preset.ts +398 -0
- package/examples/extensions/protected-paths.ts +30 -0
- package/examples/extensions/qna.ts +119 -0
- package/examples/extensions/question.ts +264 -0
- package/examples/extensions/questionnaire.ts +427 -0
- package/examples/extensions/rainbow-editor.ts +88 -0
- package/examples/extensions/reload-runtime.ts +37 -0
- package/examples/extensions/rpc-demo.ts +124 -0
- package/examples/extensions/sandbox/index.ts +318 -0
- package/examples/extensions/sandbox/package-lock.json +92 -0
- package/examples/extensions/sandbox/package.json +19 -0
- package/examples/extensions/send-user-message.ts +97 -0
- package/examples/extensions/session-name.ts +27 -0
- package/examples/extensions/shutdown-command.ts +63 -0
- package/examples/extensions/snake.ts +343 -0
- package/examples/extensions/space-invaders.ts +560 -0
- package/examples/extensions/ssh.ts +220 -0
- package/examples/extensions/sst-resource-manager.ts +203 -0
- package/examples/extensions/status-line.ts +40 -0
- package/examples/extensions/subagent/README.md +172 -0
- package/examples/extensions/subagent/agents/planner.md +37 -0
- package/examples/extensions/subagent/agents/reviewer.md +35 -0
- package/examples/extensions/subagent/agents/scout.md +50 -0
- package/examples/extensions/subagent/agents/worker.md +24 -0
- package/examples/extensions/subagent/agents.ts +126 -0
- package/examples/extensions/subagent/index.ts +964 -0
- package/examples/extensions/subagent/prompts/implement-and-review.md +10 -0
- package/examples/extensions/subagent/prompts/implement.md +10 -0
- package/examples/extensions/subagent/prompts/scout-and-plan.md +9 -0
- package/examples/extensions/summarize.ts +195 -0
- package/examples/extensions/system-prompt-header.ts +17 -0
- package/examples/extensions/timed-confirm.ts +70 -0
- package/examples/extensions/titlebar-spinner.ts +58 -0
- package/examples/extensions/todo.ts +299 -0
- package/examples/extensions/tool-override.ts +143 -0
- package/examples/extensions/tools.ts +146 -0
- package/examples/extensions/trigger-compact.ts +40 -0
- package/examples/extensions/truncated-tool.ts +192 -0
- package/examples/extensions/widget-placement.ts +17 -0
- package/examples/extensions/with-deps/index.ts +36 -0
- package/examples/extensions/with-deps/package-lock.json +31 -0
- package/examples/extensions/with-deps/package.json +22 -0
- package/examples/rpc-extension-ui.ts +632 -0
- package/examples/sdk/01-minimal.ts +22 -0
- package/examples/sdk/02-custom-model.ts +49 -0
- package/examples/sdk/03-custom-prompt.ts +55 -0
- package/examples/sdk/04-skills.ts +46 -0
- package/examples/sdk/05-tools.ts +56 -0
- package/examples/sdk/06-extensions.ts +88 -0
- package/examples/sdk/07-context-files.ts +40 -0
- package/examples/sdk/08-prompt-templates.ts +42 -0
- package/examples/sdk/09-api-keys-and-oauth.ts +48 -0
- package/examples/sdk/10-settings.ts +51 -0
- package/examples/sdk/11-sessions.ts +48 -0
- package/examples/sdk/12-full-control.ts +82 -0
- package/examples/sdk/README.md +144 -0
- package/extensions/gsd-commands.ts +338 -0
- package/extensions/subagent.ts +312 -0
- package/hooks/gsd/draht-post-phase.js +133 -0
- package/hooks/gsd/draht-post-task.js +132 -0
- package/hooks/gsd/draht-pre-execute.js +146 -0
- package/hooks/gsd/draht-quality-gate.js +210 -0
- package/package.json +105 -0
- package/prompts/agents/build.md +44 -0
- package/prompts/agents/plan.md +39 -0
- package/prompts/agents/verify.md +33 -0
- package/prompts/commands/atomic-commit.md +39 -0
- package/prompts/commands/discuss-phase.md +25 -0
- package/prompts/commands/execute-phase.md +59 -0
- package/prompts/commands/map-codebase.md +32 -0
- package/prompts/commands/new-project.md +40 -0
- package/prompts/commands/pause-work.md +12 -0
- package/prompts/commands/plan-phase.md +61 -0
- package/prompts/commands/progress.md +12 -0
- package/prompts/commands/quick.md +19 -0
- package/prompts/commands/resume-work.md +13 -0
- package/prompts/commands/verify-work.md +27 -0
|
@@ -0,0 +1,409 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* RPC protocol types for headless operation.
|
|
3
|
+
*
|
|
4
|
+
* Commands are sent as JSON lines on stdin.
|
|
5
|
+
* Responses and events are emitted as JSON lines on stdout.
|
|
6
|
+
*/
|
|
7
|
+
import type { AgentMessage, ThinkingLevel } from "@draht/agent-core";
|
|
8
|
+
import type { ImageContent, Model } from "@draht/ai";
|
|
9
|
+
import type { SessionStats } from "../../core/agent-session.js";
|
|
10
|
+
import type { BashResult } from "../../core/bash-executor.js";
|
|
11
|
+
import type { CompactionResult } from "../../core/compaction/index.js";
|
|
12
|
+
export type RpcCommand = {
|
|
13
|
+
id?: string;
|
|
14
|
+
type: "prompt";
|
|
15
|
+
message: string;
|
|
16
|
+
images?: ImageContent[];
|
|
17
|
+
streamingBehavior?: "steer" | "followUp";
|
|
18
|
+
} | {
|
|
19
|
+
id?: string;
|
|
20
|
+
type: "steer";
|
|
21
|
+
message: string;
|
|
22
|
+
images?: ImageContent[];
|
|
23
|
+
} | {
|
|
24
|
+
id?: string;
|
|
25
|
+
type: "follow_up";
|
|
26
|
+
message: string;
|
|
27
|
+
images?: ImageContent[];
|
|
28
|
+
} | {
|
|
29
|
+
id?: string;
|
|
30
|
+
type: "abort";
|
|
31
|
+
} | {
|
|
32
|
+
id?: string;
|
|
33
|
+
type: "new_session";
|
|
34
|
+
parentSession?: string;
|
|
35
|
+
} | {
|
|
36
|
+
id?: string;
|
|
37
|
+
type: "get_state";
|
|
38
|
+
} | {
|
|
39
|
+
id?: string;
|
|
40
|
+
type: "set_model";
|
|
41
|
+
provider: string;
|
|
42
|
+
modelId: string;
|
|
43
|
+
} | {
|
|
44
|
+
id?: string;
|
|
45
|
+
type: "cycle_model";
|
|
46
|
+
} | {
|
|
47
|
+
id?: string;
|
|
48
|
+
type: "get_available_models";
|
|
49
|
+
} | {
|
|
50
|
+
id?: string;
|
|
51
|
+
type: "set_thinking_level";
|
|
52
|
+
level: ThinkingLevel;
|
|
53
|
+
} | {
|
|
54
|
+
id?: string;
|
|
55
|
+
type: "cycle_thinking_level";
|
|
56
|
+
} | {
|
|
57
|
+
id?: string;
|
|
58
|
+
type: "set_steering_mode";
|
|
59
|
+
mode: "all" | "one-at-a-time";
|
|
60
|
+
} | {
|
|
61
|
+
id?: string;
|
|
62
|
+
type: "set_follow_up_mode";
|
|
63
|
+
mode: "all" | "one-at-a-time";
|
|
64
|
+
} | {
|
|
65
|
+
id?: string;
|
|
66
|
+
type: "compact";
|
|
67
|
+
customInstructions?: string;
|
|
68
|
+
} | {
|
|
69
|
+
id?: string;
|
|
70
|
+
type: "set_auto_compaction";
|
|
71
|
+
enabled: boolean;
|
|
72
|
+
} | {
|
|
73
|
+
id?: string;
|
|
74
|
+
type: "set_auto_retry";
|
|
75
|
+
enabled: boolean;
|
|
76
|
+
} | {
|
|
77
|
+
id?: string;
|
|
78
|
+
type: "abort_retry";
|
|
79
|
+
} | {
|
|
80
|
+
id?: string;
|
|
81
|
+
type: "bash";
|
|
82
|
+
command: string;
|
|
83
|
+
} | {
|
|
84
|
+
id?: string;
|
|
85
|
+
type: "abort_bash";
|
|
86
|
+
} | {
|
|
87
|
+
id?: string;
|
|
88
|
+
type: "get_session_stats";
|
|
89
|
+
} | {
|
|
90
|
+
id?: string;
|
|
91
|
+
type: "export_html";
|
|
92
|
+
outputPath?: string;
|
|
93
|
+
} | {
|
|
94
|
+
id?: string;
|
|
95
|
+
type: "switch_session";
|
|
96
|
+
sessionPath: string;
|
|
97
|
+
} | {
|
|
98
|
+
id?: string;
|
|
99
|
+
type: "fork";
|
|
100
|
+
entryId: string;
|
|
101
|
+
} | {
|
|
102
|
+
id?: string;
|
|
103
|
+
type: "get_fork_messages";
|
|
104
|
+
} | {
|
|
105
|
+
id?: string;
|
|
106
|
+
type: "get_last_assistant_text";
|
|
107
|
+
} | {
|
|
108
|
+
id?: string;
|
|
109
|
+
type: "set_session_name";
|
|
110
|
+
name: string;
|
|
111
|
+
} | {
|
|
112
|
+
id?: string;
|
|
113
|
+
type: "get_messages";
|
|
114
|
+
} | {
|
|
115
|
+
id?: string;
|
|
116
|
+
type: "get_commands";
|
|
117
|
+
};
|
|
118
|
+
/** A command available for invocation via prompt */
|
|
119
|
+
export interface RpcSlashCommand {
|
|
120
|
+
/** Command name (without leading slash) */
|
|
121
|
+
name: string;
|
|
122
|
+
/** Human-readable description */
|
|
123
|
+
description?: string;
|
|
124
|
+
/** What kind of command this is */
|
|
125
|
+
source: "extension" | "prompt" | "skill";
|
|
126
|
+
/** Where the command was loaded from (undefined for extensions) */
|
|
127
|
+
location?: "user" | "project" | "path";
|
|
128
|
+
/** File path to the command source */
|
|
129
|
+
path?: string;
|
|
130
|
+
}
|
|
131
|
+
export interface RpcSessionState {
|
|
132
|
+
model?: Model<any>;
|
|
133
|
+
thinkingLevel: ThinkingLevel;
|
|
134
|
+
isStreaming: boolean;
|
|
135
|
+
isCompacting: boolean;
|
|
136
|
+
steeringMode: "all" | "one-at-a-time";
|
|
137
|
+
followUpMode: "all" | "one-at-a-time";
|
|
138
|
+
sessionFile?: string;
|
|
139
|
+
sessionId: string;
|
|
140
|
+
sessionName?: string;
|
|
141
|
+
autoCompactionEnabled: boolean;
|
|
142
|
+
messageCount: number;
|
|
143
|
+
pendingMessageCount: number;
|
|
144
|
+
}
|
|
145
|
+
export type RpcResponse = {
|
|
146
|
+
id?: string;
|
|
147
|
+
type: "response";
|
|
148
|
+
command: "prompt";
|
|
149
|
+
success: true;
|
|
150
|
+
} | {
|
|
151
|
+
id?: string;
|
|
152
|
+
type: "response";
|
|
153
|
+
command: "steer";
|
|
154
|
+
success: true;
|
|
155
|
+
} | {
|
|
156
|
+
id?: string;
|
|
157
|
+
type: "response";
|
|
158
|
+
command: "follow_up";
|
|
159
|
+
success: true;
|
|
160
|
+
} | {
|
|
161
|
+
id?: string;
|
|
162
|
+
type: "response";
|
|
163
|
+
command: "abort";
|
|
164
|
+
success: true;
|
|
165
|
+
} | {
|
|
166
|
+
id?: string;
|
|
167
|
+
type: "response";
|
|
168
|
+
command: "new_session";
|
|
169
|
+
success: true;
|
|
170
|
+
data: {
|
|
171
|
+
cancelled: boolean;
|
|
172
|
+
};
|
|
173
|
+
} | {
|
|
174
|
+
id?: string;
|
|
175
|
+
type: "response";
|
|
176
|
+
command: "get_state";
|
|
177
|
+
success: true;
|
|
178
|
+
data: RpcSessionState;
|
|
179
|
+
} | {
|
|
180
|
+
id?: string;
|
|
181
|
+
type: "response";
|
|
182
|
+
command: "set_model";
|
|
183
|
+
success: true;
|
|
184
|
+
data: Model<any>;
|
|
185
|
+
} | {
|
|
186
|
+
id?: string;
|
|
187
|
+
type: "response";
|
|
188
|
+
command: "cycle_model";
|
|
189
|
+
success: true;
|
|
190
|
+
data: {
|
|
191
|
+
model: Model<any>;
|
|
192
|
+
thinkingLevel: ThinkingLevel;
|
|
193
|
+
isScoped: boolean;
|
|
194
|
+
} | null;
|
|
195
|
+
} | {
|
|
196
|
+
id?: string;
|
|
197
|
+
type: "response";
|
|
198
|
+
command: "get_available_models";
|
|
199
|
+
success: true;
|
|
200
|
+
data: {
|
|
201
|
+
models: Model<any>[];
|
|
202
|
+
};
|
|
203
|
+
} | {
|
|
204
|
+
id?: string;
|
|
205
|
+
type: "response";
|
|
206
|
+
command: "set_thinking_level";
|
|
207
|
+
success: true;
|
|
208
|
+
} | {
|
|
209
|
+
id?: string;
|
|
210
|
+
type: "response";
|
|
211
|
+
command: "cycle_thinking_level";
|
|
212
|
+
success: true;
|
|
213
|
+
data: {
|
|
214
|
+
level: ThinkingLevel;
|
|
215
|
+
} | null;
|
|
216
|
+
} | {
|
|
217
|
+
id?: string;
|
|
218
|
+
type: "response";
|
|
219
|
+
command: "set_steering_mode";
|
|
220
|
+
success: true;
|
|
221
|
+
} | {
|
|
222
|
+
id?: string;
|
|
223
|
+
type: "response";
|
|
224
|
+
command: "set_follow_up_mode";
|
|
225
|
+
success: true;
|
|
226
|
+
} | {
|
|
227
|
+
id?: string;
|
|
228
|
+
type: "response";
|
|
229
|
+
command: "compact";
|
|
230
|
+
success: true;
|
|
231
|
+
data: CompactionResult;
|
|
232
|
+
} | {
|
|
233
|
+
id?: string;
|
|
234
|
+
type: "response";
|
|
235
|
+
command: "set_auto_compaction";
|
|
236
|
+
success: true;
|
|
237
|
+
} | {
|
|
238
|
+
id?: string;
|
|
239
|
+
type: "response";
|
|
240
|
+
command: "set_auto_retry";
|
|
241
|
+
success: true;
|
|
242
|
+
} | {
|
|
243
|
+
id?: string;
|
|
244
|
+
type: "response";
|
|
245
|
+
command: "abort_retry";
|
|
246
|
+
success: true;
|
|
247
|
+
} | {
|
|
248
|
+
id?: string;
|
|
249
|
+
type: "response";
|
|
250
|
+
command: "bash";
|
|
251
|
+
success: true;
|
|
252
|
+
data: BashResult;
|
|
253
|
+
} | {
|
|
254
|
+
id?: string;
|
|
255
|
+
type: "response";
|
|
256
|
+
command: "abort_bash";
|
|
257
|
+
success: true;
|
|
258
|
+
} | {
|
|
259
|
+
id?: string;
|
|
260
|
+
type: "response";
|
|
261
|
+
command: "get_session_stats";
|
|
262
|
+
success: true;
|
|
263
|
+
data: SessionStats;
|
|
264
|
+
} | {
|
|
265
|
+
id?: string;
|
|
266
|
+
type: "response";
|
|
267
|
+
command: "export_html";
|
|
268
|
+
success: true;
|
|
269
|
+
data: {
|
|
270
|
+
path: string;
|
|
271
|
+
};
|
|
272
|
+
} | {
|
|
273
|
+
id?: string;
|
|
274
|
+
type: "response";
|
|
275
|
+
command: "switch_session";
|
|
276
|
+
success: true;
|
|
277
|
+
data: {
|
|
278
|
+
cancelled: boolean;
|
|
279
|
+
};
|
|
280
|
+
} | {
|
|
281
|
+
id?: string;
|
|
282
|
+
type: "response";
|
|
283
|
+
command: "fork";
|
|
284
|
+
success: true;
|
|
285
|
+
data: {
|
|
286
|
+
text: string;
|
|
287
|
+
cancelled: boolean;
|
|
288
|
+
};
|
|
289
|
+
} | {
|
|
290
|
+
id?: string;
|
|
291
|
+
type: "response";
|
|
292
|
+
command: "get_fork_messages";
|
|
293
|
+
success: true;
|
|
294
|
+
data: {
|
|
295
|
+
messages: Array<{
|
|
296
|
+
entryId: string;
|
|
297
|
+
text: string;
|
|
298
|
+
}>;
|
|
299
|
+
};
|
|
300
|
+
} | {
|
|
301
|
+
id?: string;
|
|
302
|
+
type: "response";
|
|
303
|
+
command: "get_last_assistant_text";
|
|
304
|
+
success: true;
|
|
305
|
+
data: {
|
|
306
|
+
text: string | null;
|
|
307
|
+
};
|
|
308
|
+
} | {
|
|
309
|
+
id?: string;
|
|
310
|
+
type: "response";
|
|
311
|
+
command: "set_session_name";
|
|
312
|
+
success: true;
|
|
313
|
+
} | {
|
|
314
|
+
id?: string;
|
|
315
|
+
type: "response";
|
|
316
|
+
command: "get_messages";
|
|
317
|
+
success: true;
|
|
318
|
+
data: {
|
|
319
|
+
messages: AgentMessage[];
|
|
320
|
+
};
|
|
321
|
+
} | {
|
|
322
|
+
id?: string;
|
|
323
|
+
type: "response";
|
|
324
|
+
command: "get_commands";
|
|
325
|
+
success: true;
|
|
326
|
+
data: {
|
|
327
|
+
commands: RpcSlashCommand[];
|
|
328
|
+
};
|
|
329
|
+
} | {
|
|
330
|
+
id?: string;
|
|
331
|
+
type: "response";
|
|
332
|
+
command: string;
|
|
333
|
+
success: false;
|
|
334
|
+
error: string;
|
|
335
|
+
};
|
|
336
|
+
/** Emitted when an extension needs user input */
|
|
337
|
+
export type RpcExtensionUIRequest = {
|
|
338
|
+
type: "extension_ui_request";
|
|
339
|
+
id: string;
|
|
340
|
+
method: "select";
|
|
341
|
+
title: string;
|
|
342
|
+
options: string[];
|
|
343
|
+
timeout?: number;
|
|
344
|
+
} | {
|
|
345
|
+
type: "extension_ui_request";
|
|
346
|
+
id: string;
|
|
347
|
+
method: "confirm";
|
|
348
|
+
title: string;
|
|
349
|
+
message: string;
|
|
350
|
+
timeout?: number;
|
|
351
|
+
} | {
|
|
352
|
+
type: "extension_ui_request";
|
|
353
|
+
id: string;
|
|
354
|
+
method: "input";
|
|
355
|
+
title: string;
|
|
356
|
+
placeholder?: string;
|
|
357
|
+
timeout?: number;
|
|
358
|
+
} | {
|
|
359
|
+
type: "extension_ui_request";
|
|
360
|
+
id: string;
|
|
361
|
+
method: "editor";
|
|
362
|
+
title: string;
|
|
363
|
+
prefill?: string;
|
|
364
|
+
} | {
|
|
365
|
+
type: "extension_ui_request";
|
|
366
|
+
id: string;
|
|
367
|
+
method: "notify";
|
|
368
|
+
message: string;
|
|
369
|
+
notifyType?: "info" | "warning" | "error";
|
|
370
|
+
} | {
|
|
371
|
+
type: "extension_ui_request";
|
|
372
|
+
id: string;
|
|
373
|
+
method: "setStatus";
|
|
374
|
+
statusKey: string;
|
|
375
|
+
statusText: string | undefined;
|
|
376
|
+
} | {
|
|
377
|
+
type: "extension_ui_request";
|
|
378
|
+
id: string;
|
|
379
|
+
method: "setWidget";
|
|
380
|
+
widgetKey: string;
|
|
381
|
+
widgetLines: string[] | undefined;
|
|
382
|
+
widgetPlacement?: "aboveEditor" | "belowEditor";
|
|
383
|
+
} | {
|
|
384
|
+
type: "extension_ui_request";
|
|
385
|
+
id: string;
|
|
386
|
+
method: "setTitle";
|
|
387
|
+
title: string;
|
|
388
|
+
} | {
|
|
389
|
+
type: "extension_ui_request";
|
|
390
|
+
id: string;
|
|
391
|
+
method: "set_editor_text";
|
|
392
|
+
text: string;
|
|
393
|
+
};
|
|
394
|
+
/** Response to an extension UI request */
|
|
395
|
+
export type RpcExtensionUIResponse = {
|
|
396
|
+
type: "extension_ui_response";
|
|
397
|
+
id: string;
|
|
398
|
+
value: string;
|
|
399
|
+
} | {
|
|
400
|
+
type: "extension_ui_response";
|
|
401
|
+
id: string;
|
|
402
|
+
confirmed: boolean;
|
|
403
|
+
} | {
|
|
404
|
+
type: "extension_ui_response";
|
|
405
|
+
id: string;
|
|
406
|
+
cancelled: true;
|
|
407
|
+
};
|
|
408
|
+
export type RpcCommandType = RpcCommand["type"];
|
|
409
|
+
//# sourceMappingURL=rpc-types.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"rpc-types.d.ts","sourceRoot":"","sources":["../../../src/modes/rpc/rpc-types.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,KAAK,EAAE,YAAY,EAAE,aAAa,EAAE,MAAM,mBAAmB,CAAC;AACrE,OAAO,KAAK,EAAE,YAAY,EAAE,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,uBAAuB,CAAC;IAAC,EAAE,EAAE,MAAM,CAAC;IAAC,SAAS,EAAE,OAAO,CAAA;CAAE,GACjE;IAAE,IAAI,EAAE,uBAAuB,CAAC;IAAC,EAAE,EAAE,MAAM,CAAC;IAAC,SAAS,EAAE,IAAI,CAAA;CAAE,CAAC;AAMlE,MAAM,MAAM,cAAc,GAAG,UAAU,CAAC,MAAM,CAAC,CAAC","sourcesContent":["/**\n * RPC protocol types for headless operation.\n *\n * Commands are sent as JSON lines on stdin.\n * Responses and events are emitted as JSON lines on stdout.\n */\n\nimport type { AgentMessage, ThinkingLevel } from \"@draht/agent-core\";\nimport type { ImageContent, Model } from \"@draht/ai\";\nimport type { SessionStats } from \"../../core/agent-session.js\";\nimport type { BashResult } from \"../../core/bash-executor.js\";\nimport type { CompactionResult } from \"../../core/compaction/index.js\";\n\n// ============================================================================\n// RPC Commands (stdin)\n// ============================================================================\n\nexport type RpcCommand =\n\t// Prompting\n\t| { id?: string; type: \"prompt\"; message: string; images?: ImageContent[]; streamingBehavior?: \"steer\" | \"followUp\" }\n\t| { id?: string; type: \"steer\"; message: string; images?: ImageContent[] }\n\t| { id?: string; type: \"follow_up\"; message: string; images?: ImageContent[] }\n\t| { id?: string; type: \"abort\" }\n\t| { id?: string; type: \"new_session\"; parentSession?: string }\n\n\t// State\n\t| { id?: string; type: \"get_state\" }\n\n\t// Model\n\t| { id?: string; type: \"set_model\"; provider: string; modelId: string }\n\t| { id?: string; type: \"cycle_model\" }\n\t| { id?: string; type: \"get_available_models\" }\n\n\t// Thinking\n\t| { id?: string; type: \"set_thinking_level\"; level: ThinkingLevel }\n\t| { id?: string; type: \"cycle_thinking_level\" }\n\n\t// Queue modes\n\t| { id?: string; type: \"set_steering_mode\"; mode: \"all\" | \"one-at-a-time\" }\n\t| { id?: string; type: \"set_follow_up_mode\"; mode: \"all\" | \"one-at-a-time\" }\n\n\t// Compaction\n\t| { id?: string; type: \"compact\"; customInstructions?: string }\n\t| { id?: string; type: \"set_auto_compaction\"; enabled: boolean }\n\n\t// Retry\n\t| { id?: string; type: \"set_auto_retry\"; enabled: boolean }\n\t| { id?: string; type: \"abort_retry\" }\n\n\t// Bash\n\t| { id?: string; type: \"bash\"; command: string }\n\t| { id?: string; type: \"abort_bash\" }\n\n\t// Session\n\t| { id?: string; type: \"get_session_stats\" }\n\t| { id?: string; type: \"export_html\"; outputPath?: string }\n\t| { id?: string; type: \"switch_session\"; sessionPath: string }\n\t| { id?: string; type: \"fork\"; entryId: string }\n\t| { id?: string; type: \"get_fork_messages\" }\n\t| { id?: string; type: \"get_last_assistant_text\" }\n\t| { id?: string; type: \"set_session_name\"; name: string }\n\n\t// Messages\n\t| { id?: string; type: \"get_messages\" }\n\n\t// Commands (available for invocation via prompt)\n\t| { id?: string; type: \"get_commands\" };\n\n// ============================================================================\n// RPC Slash Command (for get_commands response)\n// ============================================================================\n\n/** A command available for invocation via prompt */\nexport interface RpcSlashCommand {\n\t/** Command name (without leading slash) */\n\tname: string;\n\t/** Human-readable description */\n\tdescription?: string;\n\t/** What kind of command this is */\n\tsource: \"extension\" | \"prompt\" | \"skill\";\n\t/** Where the command was loaded from (undefined for extensions) */\n\tlocation?: \"user\" | \"project\" | \"path\";\n\t/** File path to the command source */\n\tpath?: string;\n}\n\n// ============================================================================\n// RPC State\n// ============================================================================\n\nexport interface RpcSessionState {\n\tmodel?: Model<any>;\n\tthinkingLevel: ThinkingLevel;\n\tisStreaming: boolean;\n\tisCompacting: boolean;\n\tsteeringMode: \"all\" | \"one-at-a-time\";\n\tfollowUpMode: \"all\" | \"one-at-a-time\";\n\tsessionFile?: string;\n\tsessionId: string;\n\tsessionName?: string;\n\tautoCompactionEnabled: boolean;\n\tmessageCount: number;\n\tpendingMessageCount: number;\n}\n\n// ============================================================================\n// RPC Responses (stdout)\n// ============================================================================\n\n// Success responses with data\nexport type RpcResponse =\n\t// Prompting (async - events follow)\n\t| { id?: string; type: \"response\"; command: \"prompt\"; success: true }\n\t| { id?: string; type: \"response\"; command: \"steer\"; success: true }\n\t| { id?: string; type: \"response\"; command: \"follow_up\"; success: true }\n\t| { id?: string; type: \"response\"; command: \"abort\"; success: true }\n\t| { id?: string; type: \"response\"; command: \"new_session\"; success: true; data: { cancelled: boolean } }\n\n\t// State\n\t| { id?: string; type: \"response\"; command: \"get_state\"; success: true; data: RpcSessionState }\n\n\t// Model\n\t| {\n\t\t\tid?: string;\n\t\t\ttype: \"response\";\n\t\t\tcommand: \"set_model\";\n\t\t\tsuccess: true;\n\t\t\tdata: Model<any>;\n\t }\n\t| {\n\t\t\tid?: string;\n\t\t\ttype: \"response\";\n\t\t\tcommand: \"cycle_model\";\n\t\t\tsuccess: true;\n\t\t\tdata: { model: Model<any>; thinkingLevel: ThinkingLevel; isScoped: boolean } | null;\n\t }\n\t| {\n\t\t\tid?: string;\n\t\t\ttype: \"response\";\n\t\t\tcommand: \"get_available_models\";\n\t\t\tsuccess: true;\n\t\t\tdata: { models: Model<any>[] };\n\t }\n\n\t// Thinking\n\t| { id?: string; type: \"response\"; command: \"set_thinking_level\"; success: true }\n\t| {\n\t\t\tid?: string;\n\t\t\ttype: \"response\";\n\t\t\tcommand: \"cycle_thinking_level\";\n\t\t\tsuccess: true;\n\t\t\tdata: { level: ThinkingLevel } | null;\n\t }\n\n\t// Queue modes\n\t| { id?: string; type: \"response\"; command: \"set_steering_mode\"; success: true }\n\t| { id?: string; type: \"response\"; command: \"set_follow_up_mode\"; success: true }\n\n\t// Compaction\n\t| { id?: string; type: \"response\"; command: \"compact\"; success: true; data: CompactionResult }\n\t| { id?: string; type: \"response\"; command: \"set_auto_compaction\"; success: true }\n\n\t// Retry\n\t| { id?: string; type: \"response\"; command: \"set_auto_retry\"; success: true }\n\t| { id?: string; type: \"response\"; command: \"abort_retry\"; success: true }\n\n\t// Bash\n\t| { id?: string; type: \"response\"; command: \"bash\"; success: true; data: BashResult }\n\t| { id?: string; type: \"response\"; command: \"abort_bash\"; success: true }\n\n\t// Session\n\t| { id?: string; type: \"response\"; command: \"get_session_stats\"; success: true; data: SessionStats }\n\t| { id?: string; type: \"response\"; command: \"export_html\"; success: true; data: { path: string } }\n\t| { id?: string; type: \"response\"; command: \"switch_session\"; success: true; data: { cancelled: boolean } }\n\t| { id?: string; type: \"response\"; command: \"fork\"; success: true; data: { text: string; cancelled: boolean } }\n\t| {\n\t\t\tid?: string;\n\t\t\ttype: \"response\";\n\t\t\tcommand: \"get_fork_messages\";\n\t\t\tsuccess: true;\n\t\t\tdata: { messages: Array<{ entryId: string; text: string }> };\n\t }\n\t| {\n\t\t\tid?: string;\n\t\t\ttype: \"response\";\n\t\t\tcommand: \"get_last_assistant_text\";\n\t\t\tsuccess: true;\n\t\t\tdata: { text: string | null };\n\t }\n\t| { id?: string; type: \"response\"; command: \"set_session_name\"; success: true }\n\n\t// Messages\n\t| { id?: string; type: \"response\"; command: \"get_messages\"; success: true; data: { messages: AgentMessage[] } }\n\n\t// Commands\n\t| {\n\t\t\tid?: string;\n\t\t\ttype: \"response\";\n\t\t\tcommand: \"get_commands\";\n\t\t\tsuccess: true;\n\t\t\tdata: { commands: RpcSlashCommand[] };\n\t }\n\n\t// Error response (any command can fail)\n\t| { id?: string; type: \"response\"; command: string; success: false; error: string };\n\n// ============================================================================\n// Extension UI Events (stdout)\n// ============================================================================\n\n/** Emitted when an extension needs user input */\nexport type RpcExtensionUIRequest =\n\t| { type: \"extension_ui_request\"; id: string; method: \"select\"; title: string; options: string[]; timeout?: number }\n\t| { type: \"extension_ui_request\"; id: string; method: \"confirm\"; title: string; message: string; timeout?: number }\n\t| {\n\t\t\ttype: \"extension_ui_request\";\n\t\t\tid: string;\n\t\t\tmethod: \"input\";\n\t\t\ttitle: string;\n\t\t\tplaceholder?: string;\n\t\t\ttimeout?: number;\n\t }\n\t| { type: \"extension_ui_request\"; id: string; method: \"editor\"; title: string; prefill?: string }\n\t| {\n\t\t\ttype: \"extension_ui_request\";\n\t\t\tid: string;\n\t\t\tmethod: \"notify\";\n\t\t\tmessage: string;\n\t\t\tnotifyType?: \"info\" | \"warning\" | \"error\";\n\t }\n\t| {\n\t\t\ttype: \"extension_ui_request\";\n\t\t\tid: string;\n\t\t\tmethod: \"setStatus\";\n\t\t\tstatusKey: string;\n\t\t\tstatusText: string | undefined;\n\t }\n\t| {\n\t\t\ttype: \"extension_ui_request\";\n\t\t\tid: string;\n\t\t\tmethod: \"setWidget\";\n\t\t\twidgetKey: string;\n\t\t\twidgetLines: string[] | undefined;\n\t\t\twidgetPlacement?: \"aboveEditor\" | \"belowEditor\";\n\t }\n\t| { type: \"extension_ui_request\"; id: string; method: \"setTitle\"; title: string }\n\t| { type: \"extension_ui_request\"; id: string; method: \"set_editor_text\"; text: string };\n\n// ============================================================================\n// Extension UI Commands (stdin)\n// ============================================================================\n\n/** Response to an extension UI request */\nexport type RpcExtensionUIResponse =\n\t| { type: \"extension_ui_response\"; id: string; value: string }\n\t| { type: \"extension_ui_response\"; id: string; confirmed: boolean }\n\t| { type: \"extension_ui_response\"; id: string; cancelled: true };\n\n// ============================================================================\n// Helper type for extracting command types\n// ============================================================================\n\nexport type RpcCommandType = RpcCommand[\"type\"];\n"]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"rpc-types.js","sourceRoot":"","sources":["../../../src/modes/rpc/rpc-types.ts"],"names":[],"mappings":"AAAA;;;;;GAKG","sourcesContent":["/**\n * RPC protocol types for headless operation.\n *\n * Commands are sent as JSON lines on stdin.\n * Responses and events are emitted as JSON lines on stdout.\n */\n\nimport type { AgentMessage, ThinkingLevel } from \"@draht/agent-core\";\nimport type { ImageContent, Model } from \"@draht/ai\";\nimport type { SessionStats } from \"../../core/agent-session.js\";\nimport type { BashResult } from \"../../core/bash-executor.js\";\nimport type { CompactionResult } from \"../../core/compaction/index.js\";\n\n// ============================================================================\n// RPC Commands (stdin)\n// ============================================================================\n\nexport type RpcCommand =\n\t// Prompting\n\t| { id?: string; type: \"prompt\"; message: string; images?: ImageContent[]; streamingBehavior?: \"steer\" | \"followUp\" }\n\t| { id?: string; type: \"steer\"; message: string; images?: ImageContent[] }\n\t| { id?: string; type: \"follow_up\"; message: string; images?: ImageContent[] }\n\t| { id?: string; type: \"abort\" }\n\t| { id?: string; type: \"new_session\"; parentSession?: string }\n\n\t// State\n\t| { id?: string; type: \"get_state\" }\n\n\t// Model\n\t| { id?: string; type: \"set_model\"; provider: string; modelId: string }\n\t| { id?: string; type: \"cycle_model\" }\n\t| { id?: string; type: \"get_available_models\" }\n\n\t// Thinking\n\t| { id?: string; type: \"set_thinking_level\"; level: ThinkingLevel }\n\t| { id?: string; type: \"cycle_thinking_level\" }\n\n\t// Queue modes\n\t| { id?: string; type: \"set_steering_mode\"; mode: \"all\" | \"one-at-a-time\" }\n\t| { id?: string; type: \"set_follow_up_mode\"; mode: \"all\" | \"one-at-a-time\" }\n\n\t// Compaction\n\t| { id?: string; type: \"compact\"; customInstructions?: string }\n\t| { id?: string; type: \"set_auto_compaction\"; enabled: boolean }\n\n\t// Retry\n\t| { id?: string; type: \"set_auto_retry\"; enabled: boolean }\n\t| { id?: string; type: \"abort_retry\" }\n\n\t// Bash\n\t| { id?: string; type: \"bash\"; command: string }\n\t| { id?: string; type: \"abort_bash\" }\n\n\t// Session\n\t| { id?: string; type: \"get_session_stats\" }\n\t| { id?: string; type: \"export_html\"; outputPath?: string }\n\t| { id?: string; type: \"switch_session\"; sessionPath: string }\n\t| { id?: string; type: \"fork\"; entryId: string }\n\t| { id?: string; type: \"get_fork_messages\" }\n\t| { id?: string; type: \"get_last_assistant_text\" }\n\t| { id?: string; type: \"set_session_name\"; name: string }\n\n\t// Messages\n\t| { id?: string; type: \"get_messages\" }\n\n\t// Commands (available for invocation via prompt)\n\t| { id?: string; type: \"get_commands\" };\n\n// ============================================================================\n// RPC Slash Command (for get_commands response)\n// ============================================================================\n\n/** A command available for invocation via prompt */\nexport interface RpcSlashCommand {\n\t/** Command name (without leading slash) */\n\tname: string;\n\t/** Human-readable description */\n\tdescription?: string;\n\t/** What kind of command this is */\n\tsource: \"extension\" | \"prompt\" | \"skill\";\n\t/** Where the command was loaded from (undefined for extensions) */\n\tlocation?: \"user\" | \"project\" | \"path\";\n\t/** File path to the command source */\n\tpath?: string;\n}\n\n// ============================================================================\n// RPC State\n// ============================================================================\n\nexport interface RpcSessionState {\n\tmodel?: Model<any>;\n\tthinkingLevel: ThinkingLevel;\n\tisStreaming: boolean;\n\tisCompacting: boolean;\n\tsteeringMode: \"all\" | \"one-at-a-time\";\n\tfollowUpMode: \"all\" | \"one-at-a-time\";\n\tsessionFile?: string;\n\tsessionId: string;\n\tsessionName?: string;\n\tautoCompactionEnabled: boolean;\n\tmessageCount: number;\n\tpendingMessageCount: number;\n}\n\n// ============================================================================\n// RPC Responses (stdout)\n// ============================================================================\n\n// Success responses with data\nexport type RpcResponse =\n\t// Prompting (async - events follow)\n\t| { id?: string; type: \"response\"; command: \"prompt\"; success: true }\n\t| { id?: string; type: \"response\"; command: \"steer\"; success: true }\n\t| { id?: string; type: \"response\"; command: \"follow_up\"; success: true }\n\t| { id?: string; type: \"response\"; command: \"abort\"; success: true }\n\t| { id?: string; type: \"response\"; command: \"new_session\"; success: true; data: { cancelled: boolean } }\n\n\t// State\n\t| { id?: string; type: \"response\"; command: \"get_state\"; success: true; data: RpcSessionState }\n\n\t// Model\n\t| {\n\t\t\tid?: string;\n\t\t\ttype: \"response\";\n\t\t\tcommand: \"set_model\";\n\t\t\tsuccess: true;\n\t\t\tdata: Model<any>;\n\t }\n\t| {\n\t\t\tid?: string;\n\t\t\ttype: \"response\";\n\t\t\tcommand: \"cycle_model\";\n\t\t\tsuccess: true;\n\t\t\tdata: { model: Model<any>; thinkingLevel: ThinkingLevel; isScoped: boolean } | null;\n\t }\n\t| {\n\t\t\tid?: string;\n\t\t\ttype: \"response\";\n\t\t\tcommand: \"get_available_models\";\n\t\t\tsuccess: true;\n\t\t\tdata: { models: Model<any>[] };\n\t }\n\n\t// Thinking\n\t| { id?: string; type: \"response\"; command: \"set_thinking_level\"; success: true }\n\t| {\n\t\t\tid?: string;\n\t\t\ttype: \"response\";\n\t\t\tcommand: \"cycle_thinking_level\";\n\t\t\tsuccess: true;\n\t\t\tdata: { level: ThinkingLevel } | null;\n\t }\n\n\t// Queue modes\n\t| { id?: string; type: \"response\"; command: \"set_steering_mode\"; success: true }\n\t| { id?: string; type: \"response\"; command: \"set_follow_up_mode\"; success: true }\n\n\t// Compaction\n\t| { id?: string; type: \"response\"; command: \"compact\"; success: true; data: CompactionResult }\n\t| { id?: string; type: \"response\"; command: \"set_auto_compaction\"; success: true }\n\n\t// Retry\n\t| { id?: string; type: \"response\"; command: \"set_auto_retry\"; success: true }\n\t| { id?: string; type: \"response\"; command: \"abort_retry\"; success: true }\n\n\t// Bash\n\t| { id?: string; type: \"response\"; command: \"bash\"; success: true; data: BashResult }\n\t| { id?: string; type: \"response\"; command: \"abort_bash\"; success: true }\n\n\t// Session\n\t| { id?: string; type: \"response\"; command: \"get_session_stats\"; success: true; data: SessionStats }\n\t| { id?: string; type: \"response\"; command: \"export_html\"; success: true; data: { path: string } }\n\t| { id?: string; type: \"response\"; command: \"switch_session\"; success: true; data: { cancelled: boolean } }\n\t| { id?: string; type: \"response\"; command: \"fork\"; success: true; data: { text: string; cancelled: boolean } }\n\t| {\n\t\t\tid?: string;\n\t\t\ttype: \"response\";\n\t\t\tcommand: \"get_fork_messages\";\n\t\t\tsuccess: true;\n\t\t\tdata: { messages: Array<{ entryId: string; text: string }> };\n\t }\n\t| {\n\t\t\tid?: string;\n\t\t\ttype: \"response\";\n\t\t\tcommand: \"get_last_assistant_text\";\n\t\t\tsuccess: true;\n\t\t\tdata: { text: string | null };\n\t }\n\t| { id?: string; type: \"response\"; command: \"set_session_name\"; success: true }\n\n\t// Messages\n\t| { id?: string; type: \"response\"; command: \"get_messages\"; success: true; data: { messages: AgentMessage[] } }\n\n\t// Commands\n\t| {\n\t\t\tid?: string;\n\t\t\ttype: \"response\";\n\t\t\tcommand: \"get_commands\";\n\t\t\tsuccess: true;\n\t\t\tdata: { commands: RpcSlashCommand[] };\n\t }\n\n\t// Error response (any command can fail)\n\t| { id?: string; type: \"response\"; command: string; success: false; error: string };\n\n// ============================================================================\n// Extension UI Events (stdout)\n// ============================================================================\n\n/** Emitted when an extension needs user input */\nexport type RpcExtensionUIRequest =\n\t| { type: \"extension_ui_request\"; id: string; method: \"select\"; title: string; options: string[]; timeout?: number }\n\t| { type: \"extension_ui_request\"; id: string; method: \"confirm\"; title: string; message: string; timeout?: number }\n\t| {\n\t\t\ttype: \"extension_ui_request\";\n\t\t\tid: string;\n\t\t\tmethod: \"input\";\n\t\t\ttitle: string;\n\t\t\tplaceholder?: string;\n\t\t\ttimeout?: number;\n\t }\n\t| { type: \"extension_ui_request\"; id: string; method: \"editor\"; title: string; prefill?: string }\n\t| {\n\t\t\ttype: \"extension_ui_request\";\n\t\t\tid: string;\n\t\t\tmethod: \"notify\";\n\t\t\tmessage: string;\n\t\t\tnotifyType?: \"info\" | \"warning\" | \"error\";\n\t }\n\t| {\n\t\t\ttype: \"extension_ui_request\";\n\t\t\tid: string;\n\t\t\tmethod: \"setStatus\";\n\t\t\tstatusKey: string;\n\t\t\tstatusText: string | undefined;\n\t }\n\t| {\n\t\t\ttype: \"extension_ui_request\";\n\t\t\tid: string;\n\t\t\tmethod: \"setWidget\";\n\t\t\twidgetKey: string;\n\t\t\twidgetLines: string[] | undefined;\n\t\t\twidgetPlacement?: \"aboveEditor\" | \"belowEditor\";\n\t }\n\t| { type: \"extension_ui_request\"; id: string; method: \"setTitle\"; title: string }\n\t| { type: \"extension_ui_request\"; id: string; method: \"set_editor_text\"; text: string };\n\n// ============================================================================\n// Extension UI Commands (stdin)\n// ============================================================================\n\n/** Response to an extension UI request */\nexport type RpcExtensionUIResponse =\n\t| { type: \"extension_ui_response\"; id: string; value: string }\n\t| { type: \"extension_ui_response\"; id: string; confirmed: boolean }\n\t| { type: \"extension_ui_response\"; id: string; cancelled: true };\n\n// ============================================================================\n// Helper type for extracting command types\n// ============================================================================\n\nexport type RpcCommandType = RpcCommand[\"type\"];\n"]}
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
# Draht Build Agent
|
|
2
|
+
|
|
3
|
+
You are an execution agent for the Get Shit Done methodology. Your job is to implement plans precisely.
|
|
4
|
+
|
|
5
|
+
## Core Rules
|
|
6
|
+
1. Read the plan FIRST — it is your instruction set
|
|
7
|
+
2. Execute tasks in order, one at a time
|
|
8
|
+
3. VERIFY each task before moving to the next
|
|
9
|
+
4. Commit after each task: `draht commit-task N P T "description"`
|
|
10
|
+
5. If verification fails, fix it before continuing
|
|
11
|
+
6. Never skip a verify step — that's how quality dies
|
|
12
|
+
|
|
13
|
+
## Tools Available
|
|
14
|
+
- `draht read-plan N P` — read the plan to execute
|
|
15
|
+
- `draht commit-task N P T "desc"` — atomic commit per task
|
|
16
|
+
- `draht write-summary N P` — write completion summary
|
|
17
|
+
- `draht verify-phase N` — check phase completion
|
|
18
|
+
- `draht update-state` — update STATE.md
|
|
19
|
+
|
|
20
|
+
## Process (TDD-First)
|
|
21
|
+
1. Read plan: `draht read-plan N P`
|
|
22
|
+
2. For each <task>:
|
|
23
|
+
a. Read the <test> block — write the test code FIRST (expect RED — tests should fail)
|
|
24
|
+
b. Read the <action> — implement to make tests GREEN
|
|
25
|
+
c. Read the <refactor> — clean up while keeping tests green
|
|
26
|
+
d. Run the <verify> step
|
|
27
|
+
e. If verify passes: `draht commit-task N P T "task name"`
|
|
28
|
+
f. If verify fails: fix and retry (max 3 attempts)
|
|
29
|
+
g. If a task has no <test> block, write a test anyway before implementing
|
|
30
|
+
3. After all tasks: `draht write-summary N P`
|
|
31
|
+
4. Fill in the summary with actual commits, files changed, notes
|
|
32
|
+
5. After all plans in phase: `draht verify-phase N`
|
|
33
|
+
|
|
34
|
+
## Checkpoint Handling
|
|
35
|
+
- `type="auto"` → execute silently
|
|
36
|
+
- `type="checkpoint:human-verify"` → STOP, show what was built, ask for confirmation
|
|
37
|
+
- `type="checkpoint:decision"` → STOP, present options, wait for choice
|
|
38
|
+
|
|
39
|
+
## On Failure
|
|
40
|
+
If a task fails 3 times:
|
|
41
|
+
1. Document what went wrong in the summary
|
|
42
|
+
2. Mark task as failed
|
|
43
|
+
3. Continue to next task (unless it depends on the failed one)
|
|
44
|
+
4. Note the failure for fix planning
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
# Draht Plan Agent
|
|
2
|
+
|
|
3
|
+
You are a planning agent for the Get Shit Done methodology. Your job is to create atomic, executable plans.
|
|
4
|
+
|
|
5
|
+
## Core Rules
|
|
6
|
+
1. Plans are prompts — they tell the executor EXACTLY what to build
|
|
7
|
+
2. Each task must be atomic (one clear action, one verify step)
|
|
8
|
+
3. Maximum 5 tasks per plan
|
|
9
|
+
4. Goal-backward: start from "what must be TRUE" not "what should we build"
|
|
10
|
+
5. Every task needs <verify> and <done> — no ambiguity
|
|
11
|
+
|
|
12
|
+
## Tools Available
|
|
13
|
+
- `draht load-phase-context N` — gather all context for a phase
|
|
14
|
+
- `draht create-plan N P "title"` — create plan template
|
|
15
|
+
- `draht validate-plans N` — check plans for completeness
|
|
16
|
+
- `draht research-phase N` — create research template
|
|
17
|
+
- `draht commit-docs "message"` — commit planning docs
|
|
18
|
+
|
|
19
|
+
## Process
|
|
20
|
+
1. Load all context: `draht load-phase-context N`
|
|
21
|
+
2. State the goal as an outcome
|
|
22
|
+
3. List 3-7 observable truths that must be TRUE
|
|
23
|
+
4. Map truths to files/endpoints/artifacts
|
|
24
|
+
5. Group into plans of 2-5 tasks each
|
|
25
|
+
6. Write plans using XML task format
|
|
26
|
+
7. Validate: `draht validate-plans N`
|
|
27
|
+
|
|
28
|
+
## XML Task Format
|
|
29
|
+
```xml
|
|
30
|
+
<task type="auto">
|
|
31
|
+
<n>Short task name</n>
|
|
32
|
+
<files>path/to/files</files>
|
|
33
|
+
<action>Precise instructions. No ambiguity.</action>
|
|
34
|
+
<verify>Command or check to verify</verify>
|
|
35
|
+
<done>What "done" looks like from user perspective</done>
|
|
36
|
+
</task>
|
|
37
|
+
```
|
|
38
|
+
|
|
39
|
+
Task types: auto, checkpoint:human-verify, checkpoint:decision
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
# Draht Verify Agent
|
|
2
|
+
|
|
3
|
+
You are a verification agent for the Get Shit Done methodology. Your job is to test completed work against acceptance criteria.
|
|
4
|
+
|
|
5
|
+
## Core Rules
|
|
6
|
+
1. Test from the USER's perspective, not the developer's
|
|
7
|
+
2. Every must_have and <done> must be verified
|
|
8
|
+
3. Be honest — if something doesn't work, say so
|
|
9
|
+
4. Create fix plans for failures, don't just report them
|
|
10
|
+
|
|
11
|
+
## Tools Available
|
|
12
|
+
- `draht extract-deliverables N` — list testable items
|
|
13
|
+
- `draht create-fix-plan N P "issue"` — create fix plan for failures
|
|
14
|
+
- `draht write-uat N` — create UAT report
|
|
15
|
+
- `draht update-state` — update STATE.md
|
|
16
|
+
|
|
17
|
+
## Process
|
|
18
|
+
1. Extract deliverables: `draht extract-deliverables N`
|
|
19
|
+
2. For each deliverable:
|
|
20
|
+
a. Explain what should be true
|
|
21
|
+
b. Test it (run commands, check files, verify behavior)
|
|
22
|
+
c. Record: pass / fail / partial
|
|
23
|
+
3. For failures:
|
|
24
|
+
a. Diagnose root cause
|
|
25
|
+
b. Create fix plan: `draht create-fix-plan N P "issue"`
|
|
26
|
+
4. Write UAT report: `draht write-uat N`
|
|
27
|
+
5. Update state: `draht update-state`
|
|
28
|
+
|
|
29
|
+
## Output
|
|
30
|
+
Always end with a clear summary:
|
|
31
|
+
- X/Y passed
|
|
32
|
+
- Fix plans created (if any)
|
|
33
|
+
- Recommended next action
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
---
|
|
2
|
+
description: "Analyze changes and create atomic commits"
|
|
3
|
+
---
|
|
4
|
+
|
|
5
|
+
# Git Atomic Commit Analysis
|
|
6
|
+
|
|
7
|
+
First, check the current status:
|
|
8
|
+
|
|
9
|
+
*! git status*
|
|
10
|
+
|
|
11
|
+
Now get the full diff of all changes:
|
|
12
|
+
|
|
13
|
+
*! git diff*
|
|
14
|
+
|
|
15
|
+
And staged changes:
|
|
16
|
+
|
|
17
|
+
*! git diff --cached*
|
|
18
|
+
|
|
19
|
+
Based on the changes shown above, analyze and group them into logical, ATOMIC commits. Each commit should:
|
|
20
|
+
|
|
21
|
+
1. Contain ONE logical change only
|
|
22
|
+
2. Be self-contained and complete
|
|
23
|
+
3. Not break the build if applied independently
|
|
24
|
+
|
|
25
|
+
For each group of changes you identify:
|
|
26
|
+
- List the specific files that belong together
|
|
27
|
+
- Generate a clear, descriptive commit message following conventional commits format
|
|
28
|
+
- Explain WHY these changes belong in one commit
|
|
29
|
+
|
|
30
|
+
Then provide the exact `git add` and `git commit` commands to execute for each atomic commit in the order they should be applied.
|
|
31
|
+
|
|
32
|
+
Format each commit message as:
|
|
33
|
+
type(scope): brief description
|
|
34
|
+
- Detailed explanation of what changed
|
|
35
|
+
- Why the change was necessary
|
|
36
|
+
|
|
37
|
+
|
|
38
|
+
Common types: feat, fix, refactor, docs, test, chore, style, perf
|
|
39
|
+
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
# /discuss-phase
|
|
2
|
+
|
|
3
|
+
Capture implementation decisions before planning a phase.
|
|
4
|
+
|
|
5
|
+
## Usage
|
|
6
|
+
```
|
|
7
|
+
/discuss-phase [N]
|
|
8
|
+
```
|
|
9
|
+
|
|
10
|
+
## Steps
|
|
11
|
+
1. Run `draht phase-info N` to load phase context
|
|
12
|
+
2. Identify gray areas based on what's being built
|
|
13
|
+
3. Present 1-2 questions at a time about preferences
|
|
14
|
+
4. If `.planning/DOMAIN.md` exists, load it and validate discovered terms against the glossary. Add any new domain terms found during discussion.
|
|
15
|
+
5. Record decisions with `draht save-context N`
|
|
16
|
+
6. Commit: `draht commit-docs "capture phase N context"`
|
|
17
|
+
|
|
18
|
+
## Gray Area Categories
|
|
19
|
+
- **Visual features** → Layout, density, interactions, empty states
|
|
20
|
+
- **APIs/CLIs** → Response format, error handling, auth
|
|
21
|
+
- **Data models** → Schema, relationships, validation
|
|
22
|
+
- **Content** → Structure, tone, depth, flow
|
|
23
|
+
- **Refactoring** → Grouping, naming, migration strategy
|
|
24
|
+
- **Testability** → What needs testing, test framework preference, coverage goals, integration vs unit boundaries
|
|
25
|
+
- **Domain boundaries** → What are the bounded contexts in play? Are there existing domain terms to respect? What aggregates/entities are involved?
|