@draht/coding-agent 2026.3.11-1 → 2026.3.25-1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +45 -0
- package/README.md +45 -30
- package/bin/draht-tools.cjs +187 -32
- package/dist/bun/cli.d.ts +3 -0
- package/dist/bun/cli.d.ts.map +1 -0
- package/dist/bun/cli.js +7 -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/cli/args.d.ts +1 -0
- package/dist/cli/args.d.ts.map +1 -1
- package/dist/cli/args.js +11 -6
- package/dist/cli/args.js.map +1 -1
- package/dist/cli/file-processor.d.ts.map +1 -1
- package/dist/cli/file-processor.js +4 -0
- package/dist/cli/file-processor.js.map +1 -1
- 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/session-picker.d.ts.map +1 -1
- package/dist/cli/session-picker.js +2 -1
- package/dist/cli/session-picker.js.map +1 -1
- package/dist/cli.d.ts.map +1 -1
- package/dist/cli.js +1 -3
- package/dist/cli.js.map +1 -1
- package/dist/config.d.ts.map +1 -1
- package/dist/config.js +2 -2
- package/dist/config.js.map +1 -1
- package/dist/core/agent-session.d.ts +38 -5
- package/dist/core/agent-session.d.ts.map +1 -1
- package/dist/core/agent-session.js +201 -73
- package/dist/core/agent-session.js.map +1 -1
- package/dist/core/bash-executor.d.ts +6 -7
- package/dist/core/bash-executor.d.ts.map +1 -1
- package/dist/core/bash-executor.js +8 -107
- package/dist/core/bash-executor.js.map +1 -1
- package/dist/core/compaction/branch-summarization.d.ts.map +1 -1
- package/dist/core/compaction/branch-summarization.js +1 -0
- package/dist/core/compaction/branch-summarization.js.map +1 -1
- package/dist/core/compaction/compaction.d.ts.map +1 -1
- package/dist/core/compaction/compaction.js +2 -0
- package/dist/core/compaction/compaction.js.map +1 -1
- package/dist/core/exec.d.ts.map +1 -1
- package/dist/core/exec.js +7 -3
- package/dist/core/exec.js.map +1 -1
- package/dist/core/export-html/index.d.ts +2 -2
- package/dist/core/export-html/index.d.ts.map +1 -1
- package/dist/core/export-html/index.js +7 -6
- package/dist/core/export-html/index.js.map +1 -1
- package/dist/core/export-html/template.css +43 -13
- package/dist/core/export-html/template.html +1 -0
- package/dist/core/export-html/template.js +107 -0
- package/dist/core/export-html/tool-renderer.d.ts +2 -2
- package/dist/core/export-html/tool-renderer.d.ts.map +1 -1
- package/dist/core/export-html/tool-renderer.js +41 -16
- package/dist/core/export-html/tool-renderer.js.map +1 -1
- package/dist/core/extensions/index.d.ts +4 -3
- package/dist/core/extensions/index.d.ts.map +1 -1
- package/dist/core/extensions/index.js +1 -1
- package/dist/core/extensions/index.js.map +1 -1
- package/dist/core/extensions/loader.d.ts.map +1 -1
- package/dist/core/extensions/loader.js +16 -6
- package/dist/core/extensions/loader.js.map +1 -1
- package/dist/core/extensions/runner.d.ts +9 -9
- package/dist/core/extensions/runner.d.ts.map +1 -1
- package/dist/core/extensions/runner.js +89 -71
- package/dist/core/extensions/runner.js.map +1 -1
- package/dist/core/extensions/types.d.ts +49 -13
- package/dist/core/extensions/types.d.ts.map +1 -1
- package/dist/core/extensions/types.js.map +1 -1
- package/dist/core/extensions/wrapper.d.ts +4 -11
- package/dist/core/extensions/wrapper.d.ts.map +1 -1
- package/dist/core/extensions/wrapper.js +6 -86
- package/dist/core/extensions/wrapper.js.map +1 -1
- package/dist/core/footer-data-provider.d.ts +13 -1
- package/dist/core/footer-data-provider.d.ts.map +1 -1
- package/dist/core/footer-data-provider.js +155 -37
- package/dist/core/footer-data-provider.js.map +1 -1
- package/dist/core/index.d.ts +2 -1
- package/dist/core/index.d.ts.map +1 -1
- package/dist/core/index.js +2 -1
- package/dist/core/index.js.map +1 -1
- package/dist/core/keybindings.d.ts +270 -50
- package/dist/core/keybindings.d.ts.map +1 -1
- package/dist/core/keybindings.js +222 -134
- package/dist/core/keybindings.js.map +1 -1
- package/dist/core/model-registry.d.ts +1 -0
- package/dist/core/model-registry.d.ts.map +1 -1
- package/dist/core/model-registry.js +49 -23
- package/dist/core/model-registry.js.map +1 -1
- package/dist/core/model-resolver.d.ts +6 -0
- package/dist/core/model-resolver.d.ts.map +1 -1
- package/dist/core/model-resolver.js +41 -17
- package/dist/core/model-resolver.js.map +1 -1
- package/dist/core/output-guard.d.ts +6 -0
- package/dist/core/output-guard.d.ts.map +1 -0
- package/dist/core/output-guard.js +59 -0
- package/dist/core/output-guard.js.map +1 -0
- package/dist/core/package-manager.d.ts +22 -1
- package/dist/core/package-manager.d.ts.map +1 -1
- package/dist/core/package-manager.js +374 -54
- package/dist/core/package-manager.js.map +1 -1
- package/dist/core/prompt-templates.d.ts +2 -1
- package/dist/core/prompt-templates.d.ts.map +1 -1
- package/dist/core/prompt-templates.js +39 -39
- package/dist/core/prompt-templates.js.map +1 -1
- package/dist/core/resolve-config-value.d.ts.map +1 -1
- package/dist/core/resolve-config-value.js +43 -8
- package/dist/core/resolve-config-value.js.map +1 -1
- package/dist/core/resource-loader.d.ts +6 -7
- package/dist/core/resource-loader.d.ts.map +1 -1
- package/dist/core/resource-loader.js +141 -118
- package/dist/core/resource-loader.js.map +1 -1
- package/dist/core/sdk.d.ts +3 -3
- package/dist/core/sdk.d.ts.map +1 -1
- package/dist/core/sdk.js +4 -4
- package/dist/core/sdk.js.map +1 -1
- package/dist/core/session-manager.d.ts +6 -0
- package/dist/core/session-manager.d.ts.map +1 -1
- package/dist/core/session-manager.js +9 -10
- package/dist/core/session-manager.js.map +1 -1
- package/dist/core/settings-manager.d.ts +3 -0
- package/dist/core/settings-manager.d.ts.map +1 -1
- package/dist/core/settings-manager.js +8 -0
- package/dist/core/settings-manager.js.map +1 -1
- package/dist/core/skills.d.ts +5 -3
- package/dist/core/skills.d.ts.map +1 -1
- package/dist/core/skills.js +54 -9
- package/dist/core/skills.js.map +1 -1
- package/dist/core/slash-commands.d.ts +2 -3
- package/dist/core/slash-commands.d.ts.map +1 -1
- package/dist/core/slash-commands.js +3 -2
- package/dist/core/slash-commands.js.map +1 -1
- 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.map +1 -1
- package/dist/core/system-prompt.js +17 -60
- package/dist/core/system-prompt.js.map +1 -1
- package/dist/core/tools/bash.d.ts +24 -6
- package/dist/core/tools/bash.d.ts.map +1 -1
- package/dist/core/tools/bash.js +210 -110
- package/dist/core/tools/bash.js.map +1 -1
- package/dist/core/tools/edit-diff.d.ts.map +1 -1
- package/dist/core/tools/edit-diff.js +1 -0
- package/dist/core/tools/edit-diff.js.map +1 -1
- package/dist/core/tools/edit.d.ts +14 -2
- package/dist/core/tools/edit.d.ts.map +1 -1
- package/dist/core/tools/edit.js +95 -23
- package/dist/core/tools/edit.js.map +1 -1
- package/dist/core/tools/file-mutation-queue.d.ts +6 -0
- package/dist/core/tools/file-mutation-queue.d.ts.map +1 -0
- package/dist/core/tools/file-mutation-queue.js +37 -0
- package/dist/core/tools/file-mutation-queue.js.map +1 -0
- package/dist/core/tools/find.d.ts +11 -4
- package/dist/core/tools/find.d.ts.map +1 -1
- package/dist/core/tools/find.js +82 -30
- package/dist/core/tools/find.js.map +1 -1
- package/dist/core/tools/grep.d.ts +15 -4
- package/dist/core/tools/grep.d.ts.map +1 -1
- package/dist/core/tools/grep.js +83 -29
- package/dist/core/tools/grep.js.map +1 -1
- package/dist/core/tools/index.d.ts +58 -19
- package/dist/core/tools/index.d.ts.map +1 -1
- package/dist/core/tools/index.js +51 -26
- package/dist/core/tools/index.js.map +1 -1
- package/dist/core/tools/ls.d.ts +9 -3
- package/dist/core/tools/ls.d.ts.map +1 -1
- package/dist/core/tools/ls.js +67 -13
- package/dist/core/tools/ls.js.map +1 -1
- package/dist/core/tools/read.d.ts +10 -3
- package/dist/core/tools/read.d.ts.map +1 -1
- package/dist/core/tools/read.js +110 -51
- package/dist/core/tools/read.js.map +1 -1
- package/dist/core/tools/render-utils.d.ts +21 -0
- package/dist/core/tools/render-utils.d.ts.map +1 -0
- package/dist/core/tools/render-utils.js +49 -0
- package/dist/core/tools/render-utils.js.map +1 -0
- package/dist/core/tools/tool-definition-wrapper.d.ts +14 -0
- package/dist/core/tools/tool-definition-wrapper.d.ts.map +1 -0
- package/dist/core/tools/tool-definition-wrapper.js +30 -0
- package/dist/core/tools/tool-definition-wrapper.js.map +1 -0
- package/dist/core/tools/write.d.ts +9 -3
- package/dist/core/tools/write.d.ts.map +1 -1
- package/dist/core/tools/write.js +168 -30
- package/dist/core/tools/write.js.map +1 -1
- package/dist/gsd/domain.d.ts +5 -1
- package/dist/gsd/domain.d.ts.map +1 -1
- package/dist/gsd/domain.js +71 -1
- package/dist/gsd/domain.js.map +1 -1
- package/dist/gsd/git.d.ts.map +1 -1
- package/dist/gsd/git.js +18 -0
- package/dist/gsd/git.js.map +1 -1
- package/dist/gsd/index.d.ts +1 -0
- package/dist/gsd/index.d.ts.map +1 -1
- package/dist/gsd/index.js.map +1 -1
- package/dist/index.d.ts +5 -4
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +4 -3
- package/dist/index.js.map +1 -1
- package/dist/main.d.ts.map +1 -1
- package/dist/main.js +105 -226
- package/dist/main.js.map +1 -1
- package/dist/modes/interactive/components/bash-execution.d.ts +0 -1
- package/dist/modes/interactive/components/bash-execution.d.ts.map +1 -1
- package/dist/modes/interactive/components/bash-execution.js +22 -9
- package/dist/modes/interactive/components/bash-execution.js.map +1 -1
- package/dist/modes/interactive/components/bordered-loader.d.ts.map +1 -1
- package/dist/modes/interactive/components/bordered-loader.js +1 -1
- package/dist/modes/interactive/components/bordered-loader.js.map +1 -1
- package/dist/modes/interactive/components/branch-summary-message.d.ts.map +1 -1
- package/dist/modes/interactive/components/branch-summary-message.js +2 -2
- package/dist/modes/interactive/components/branch-summary-message.js.map +1 -1
- package/dist/modes/interactive/components/compaction-summary-message.d.ts.map +1 -1
- package/dist/modes/interactive/components/compaction-summary-message.js +2 -2
- package/dist/modes/interactive/components/compaction-summary-message.js.map +1 -1
- package/dist/modes/interactive/components/config-selector.d.ts.map +1 -1
- package/dist/modes/interactive/components/config-selector.js +8 -8
- package/dist/modes/interactive/components/config-selector.js.map +1 -1
- package/dist/modes/interactive/components/custom-editor.d.ts +3 -3
- package/dist/modes/interactive/components/custom-editor.d.ts.map +1 -1
- package/dist/modes/interactive/components/custom-editor.js +6 -6
- package/dist/modes/interactive/components/custom-editor.js.map +1 -1
- package/dist/modes/interactive/components/extension-editor.d.ts.map +1 -1
- package/dist/modes/interactive/components/extension-editor.js +9 -9
- package/dist/modes/interactive/components/extension-editor.js.map +1 -1
- package/dist/modes/interactive/components/extension-input.d.ts.map +1 -1
- package/dist/modes/interactive/components/extension-input.js +5 -5
- package/dist/modes/interactive/components/extension-input.js.map +1 -1
- package/dist/modes/interactive/components/extension-selector.d.ts.map +1 -1
- package/dist/modes/interactive/components/extension-selector.js +8 -8
- package/dist/modes/interactive/components/extension-selector.js.map +1 -1
- package/dist/modes/interactive/components/index.d.ts +1 -1
- package/dist/modes/interactive/components/index.d.ts.map +1 -1
- package/dist/modes/interactive/components/index.js +1 -1
- package/dist/modes/interactive/components/index.js.map +1 -1
- package/dist/modes/interactive/components/keybinding-hints.d.ts +3 -36
- package/dist/modes/interactive/components/keybinding-hints.d.ts.map +1 -1
- package/dist/modes/interactive/components/keybinding-hints.js +5 -44
- package/dist/modes/interactive/components/keybinding-hints.js.map +1 -1
- package/dist/modes/interactive/components/login-dialog.d.ts.map +1 -1
- package/dist/modes/interactive/components/login-dialog.js +6 -6
- package/dist/modes/interactive/components/login-dialog.js.map +1 -1
- package/dist/modes/interactive/components/model-selector.d.ts.map +1 -1
- package/dist/modes/interactive/components/model-selector.js +13 -9
- package/dist/modes/interactive/components/model-selector.js.map +1 -1
- package/dist/modes/interactive/components/oauth-selector.d.ts.map +1 -1
- package/dist/modes/interactive/components/oauth-selector.js +6 -6
- package/dist/modes/interactive/components/oauth-selector.js.map +1 -1
- package/dist/modes/interactive/components/scoped-models-selector.d.ts.map +1 -1
- package/dist/modes/interactive/components/scoped-models-selector.js +4 -4
- package/dist/modes/interactive/components/scoped-models-selector.js.map +1 -1
- package/dist/modes/interactive/components/session-selector.d.ts.map +1 -1
- package/dist/modes/interactive/components/session-selector.js +32 -35
- package/dist/modes/interactive/components/session-selector.js.map +1 -1
- package/dist/modes/interactive/components/settings-selector.d.ts.map +1 -1
- package/dist/modes/interactive/components/settings-selector.js +5 -1
- package/dist/modes/interactive/components/settings-selector.js.map +1 -1
- package/dist/modes/interactive/components/show-images-selector.d.ts.map +1 -1
- package/dist/modes/interactive/components/show-images-selector.js +5 -1
- package/dist/modes/interactive/components/show-images-selector.js.map +1 -1
- package/dist/modes/interactive/components/skill-invocation-message.d.ts.map +1 -1
- package/dist/modes/interactive/components/skill-invocation-message.js +2 -2
- package/dist/modes/interactive/components/skill-invocation-message.js.map +1 -1
- package/dist/modes/interactive/components/theme-selector.d.ts.map +1 -1
- package/dist/modes/interactive/components/theme-selector.js +5 -1
- package/dist/modes/interactive/components/theme-selector.js.map +1 -1
- package/dist/modes/interactive/components/thinking-selector.d.ts.map +1 -1
- package/dist/modes/interactive/components/thinking-selector.js +5 -1
- package/dist/modes/interactive/components/thinking-selector.js.map +1 -1
- package/dist/modes/interactive/components/tool-execution.d.ts +16 -34
- package/dist/modes/interactive/components/tool-execution.d.ts.map +1 -1
- package/dist/modes/interactive/components/tool-execution.js +128 -636
- package/dist/modes/interactive/components/tool-execution.js.map +1 -1
- package/dist/modes/interactive/components/tree-selector.d.ts.map +1 -1
- package/dist/modes/interactive/components/tree-selector.js +27 -16
- package/dist/modes/interactive/components/tree-selector.js.map +1 -1
- package/dist/modes/interactive/components/user-message-selector.d.ts.map +1 -1
- package/dist/modes/interactive/components/user-message-selector.js +6 -6
- package/dist/modes/interactive/components/user-message-selector.js.map +1 -1
- package/dist/modes/interactive/components/user-message.d.ts.map +1 -1
- package/dist/modes/interactive/components/user-message.js +2 -1
- package/dist/modes/interactive/components/user-message.js.map +1 -1
- package/dist/modes/interactive/interactive-mode.d.ts +7 -11
- package/dist/modes/interactive/interactive-mode.d.ts.map +1 -1
- package/dist/modes/interactive/interactive-mode.js +353 -212
- package/dist/modes/interactive/interactive-mode.js.map +1 -1
- package/dist/modes/interactive/theme/theme.d.ts +3 -0
- package/dist/modes/interactive/theme/theme.d.ts.map +1 -1
- package/dist/modes/interactive/theme/theme.js +63 -37
- package/dist/modes/interactive/theme/theme.js.map +1 -1
- package/dist/modes/print-mode.d.ts.map +1 -1
- package/dist/modes/print-mode.js +5 -11
- package/dist/modes/print-mode.js.map +1 -1
- package/dist/modes/rpc/rpc-mode.d.ts.map +1 -1
- package/dist/modes/rpc/rpc-mode.js +27 -17
- package/dist/modes/rpc/rpc-mode.js.map +1 -1
- package/dist/modes/rpc/rpc-types.d.ts +3 -4
- package/dist/modes/rpc/rpc-types.d.ts.map +1 -1
- package/dist/modes/rpc/rpc-types.js.map +1 -1
- package/dist/prompts/commands/execute-phase.md +2 -2
- package/dist/prompts/commands/fix.md +2 -2
- package/dist/prompts/commands/plan-phase.md +5 -1
- package/dist/prompts/commands/quick.md +5 -1
- package/dist/utils/changelog.d.ts +12 -0
- package/dist/utils/changelog.d.ts.map +1 -1
- package/dist/utils/changelog.js +25 -14
- package/dist/utils/changelog.js.map +1 -1
- package/dist/utils/child-process.d.ts +11 -0
- package/dist/utils/child-process.d.ts.map +1 -0
- package/dist/utils/child-process.js +78 -0
- package/dist/utils/child-process.js.map +1 -0
- package/dist/utils/clipboard-image.d.ts.map +1 -1
- package/dist/utils/clipboard-image.js +94 -11
- package/dist/utils/clipboard-image.js.map +1 -1
- package/dist/utils/clipboard-native.d.ts +1 -0
- package/dist/utils/clipboard-native.d.ts.map +1 -1
- package/dist/utils/clipboard-native.js.map +1 -1
- package/dist/utils/clipboard.d.ts +1 -1
- package/dist/utils/clipboard.d.ts.map +1 -1
- package/dist/utils/clipboard.js +27 -16
- package/dist/utils/clipboard.js.map +1 -1
- 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/image-convert.d.ts.map +1 -1
- package/dist/utils/image-convert.js +5 -1
- package/dist/utils/image-convert.js.map +1 -1
- package/dist/utils/image-resize.d.ts +5 -5
- package/dist/utils/image-resize.d.ts.map +1 -1
- package/dist/utils/image-resize.js +51 -95
- package/dist/utils/image-resize.js.map +1 -1
- package/dist/utils/notify.d.ts +12 -0
- package/dist/utils/notify.d.ts.map +1 -0
- package/dist/utils/notify.js +41 -0
- package/dist/utils/notify.js.map +1 -0
- package/dist/utils/tools-manager.d.ts.map +1 -1
- package/dist/utils/tools-manager.js +5 -4
- package/dist/utils/tools-manager.js.map +1 -1
- package/docs/custom-provider.md +6 -2
- package/docs/extensions.md +108 -21
- package/docs/keybindings.md +103 -112
- package/docs/models.md +39 -1
- package/docs/packages.md +9 -0
- package/docs/providers.md +7 -0
- package/docs/rpc.md +15 -6
- package/docs/sdk.md +2 -2
- package/docs/settings.md +9 -0
- package/docs/terminal-setup.md +11 -0
- package/docs/tui.md +2 -2
- package/examples/extensions/README.md +2 -2
- package/examples/extensions/antigravity-image-gen.ts +9 -6
- package/examples/extensions/built-in-tool-renderer.ts +8 -8
- package/examples/extensions/commands.ts +3 -3
- package/examples/extensions/custom-provider-gitlab-duo/test.ts +2 -2
- package/examples/extensions/minimal-mode.ts +14 -14
- package/examples/extensions/notify.ts +9 -2
- package/examples/extensions/preset.ts +2 -3
- package/examples/extensions/question.ts +2 -2
- package/examples/extensions/questionnaire.ts +2 -2
- package/examples/extensions/sandbox/index.ts +2 -3
- package/examples/extensions/subagent/index.ts +30 -8
- package/examples/extensions/titlebar-spinner.ts +2 -2
- package/examples/extensions/todo.ts +2 -2
- package/examples/extensions/tool-override.ts +10 -9
- package/examples/extensions/truncated-tool.ts +8 -5
- package/examples/sdk/04-skills.ts +8 -2
- package/examples/sdk/08-prompt-templates.ts +8 -2
- package/examples/sdk/12-full-control.ts +0 -1
- package/examples/sdk/README.md +1 -1
- package/package.json +4 -4
- package/prompts/commands/execute-phase.md +2 -2
- package/prompts/commands/fix.md +2 -2
- package/prompts/commands/plan-phase.md +5 -1
- package/prompts/commands/quick.md +5 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,50 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
+
## [2026.3.14] - 2026-03-14
|
|
4
|
+
|
|
5
|
+
### Added
|
|
6
|
+
|
|
7
|
+
- built-in terminal notification on agent turn end
|
|
8
|
+
|
|
9
|
+
### Changed
|
|
10
|
+
|
|
11
|
+
- fix(coding-agent): use getAgentDir() in example extensions (#2009)
|
|
12
|
+
- Export the structured mapping contract through the public GSD entrypoint
|
|
13
|
+
- Add typed extraction results to GSD domain mapping
|
|
14
|
+
- consolidate quality gate fixture helpers
|
|
15
|
+
- Cover strict-mode TypeScript error detection
|
|
16
|
+
- add TypeScript-error quality gate scenario
|
|
17
|
+
- Cover passing and failing test-suite outcomes
|
|
18
|
+
- add failing test-suite quality gate scenario
|
|
19
|
+
- Create a real-hook quality gate test harness
|
|
20
|
+
- add real quality gate hook harness test
|
|
21
|
+
- verify phase 21 lifecycle execution logs
|
|
22
|
+
- add failing phase 21 execution log verification test
|
|
23
|
+
- exercise phase 21 lifecycle task commit flow
|
|
24
|
+
- add failing phase 21 lifecycle commit flow test
|
|
25
|
+
- define mapCodebase structured extraction contract
|
|
26
|
+
- build phase 21 lifecycle workspace fixture
|
|
27
|
+
- add failing phase 21 lifecycle fixture test
|
|
28
|
+
- reduce duplicated domain fixture assertions
|
|
29
|
+
- Create a stable domain fixture codebase
|
|
30
|
+
- replace gsd structure checks with runtime loading coverage
|
|
31
|
+
- specify stable GSD domain fixture exports
|
|
32
|
+
- add gsd extension runtime loading spec
|
|
33
|
+
- extract reusable temp git repo setup steps
|
|
34
|
+
- Implement the shared git repo helper
|
|
35
|
+
- specify isolated temp git repo helper behavior
|
|
36
|
+
|
|
37
|
+
### Fixed
|
|
38
|
+
|
|
39
|
+
- add stdin support to all draht-tools write commands
|
|
40
|
+
- add cmux support to notify example extension
|
|
41
|
+
- add stdin support to create-quick-plan and fix plan prompts to pipe actual content
|
|
42
|
+
- use conventional commit prefixes instead of TDD annotations in prompt templates
|
|
43
|
+
- restore phase 21 verification baseline
|
|
44
|
+
- The draht-tools create-plan command now reads stdin content when piped
|
|
45
|
+
- handle date-based version suffixes in changelog parsing
|
|
46
|
+
- change default update instruction to bun add -g
|
|
47
|
+
|
|
3
48
|
## [2026.3.11] - 2026-03-11
|
|
4
49
|
|
|
5
50
|
### Added
|
package/README.md
CHANGED
|
@@ -7,7 +7,7 @@
|
|
|
7
7
|
|
|
8
8
|
Draht is a minimal terminal coding harness. Adapt it to your workflows, not the other way around, without having to fork and modify internals. Extend it with TypeScript [Extensions](#extensions), [Skills](#skills), [Prompt Templates](#prompt-templates), and [Themes](#themes). Put your extensions, skills, prompt templates, and themes in [Draht Packages](#draht-packages) and share them with others via npm or git.
|
|
9
9
|
|
|
10
|
-
Draht ships with powerful defaults but skips features like sub agents and plan mode. Instead, you can ask draht to build what you want or install a third party package that matches your workflow.
|
|
10
|
+
Draht ships with powerful defaults but skips features like sub agents and plan mode. Instead, you can ask draht to build what you want or install a third party draht package that matches your workflow.
|
|
11
11
|
|
|
12
12
|
Draht runs in four modes: interactive, print or JSON, RPC for process integration, and an SDK for embedding in your own apps.
|
|
13
13
|
|
|
@@ -65,7 +65,7 @@ Then just talk to draht. By default, draht gives the model four tools: `read`, `
|
|
|
65
65
|
|
|
66
66
|
## Providers & Models
|
|
67
67
|
|
|
68
|
-
For each built-in provider,draht maintains a list of tool-capable models, updated with every release. Authenticate via subscription (`/login`) or API key, then select any model from that provider via `/model` (or Ctrl+L).
|
|
68
|
+
For each built-in provider, draht maintains a list of tool-capable models, updated with every release. Authenticate via subscription (`/login`) or API key, then select any model from that provider via `/model` (or Ctrl+L).
|
|
69
69
|
|
|
70
70
|
**Subscriptions:**
|
|
71
71
|
- Anthropic Claude Pro/Max
|
|
@@ -145,10 +145,10 @@ Type `/` in the editor to trigger commands. [Extensions](#extensions) can regist
|
|
|
145
145
|
| `/copy` | Copy last assistant message to clipboard |
|
|
146
146
|
| `/export [file]` | Export session to HTML file |
|
|
147
147
|
| `/share` | Upload as private GitHub gist with shareable HTML link |
|
|
148
|
-
| `/reload` | Reload extensions, skills, prompts, context files (themes hot-reload automatically) |
|
|
148
|
+
| `/reload` | Reload keybindings, extensions, skills, prompts, and context files (themes hot-reload automatically) |
|
|
149
149
|
| `/hotkeys` | Show all keyboard shortcuts |
|
|
150
150
|
| `/changelog` | Display version history |
|
|
151
|
-
| `/quit`, `/exit` |
|
|
151
|
+
| `/quit`, `/exit` | Quit draht |
|
|
152
152
|
|
|
153
153
|
### Keyboard Shortcuts
|
|
154
154
|
|
|
@@ -172,12 +172,12 @@ See `/hotkeys` for the full list. Customize via `~/.draht/agent/keybindings.json
|
|
|
172
172
|
|
|
173
173
|
Submit messages while the agent is working:
|
|
174
174
|
|
|
175
|
-
- **Enter** queues a *steering* message, delivered after current
|
|
175
|
+
- **Enter** queues a *steering* message, delivered after the current assistant turn finishes executing its tool calls
|
|
176
176
|
- **Alt+Enter** queues a *follow-up* message, delivered only after the agent finishes all work
|
|
177
177
|
- **Escape** aborts and restores queued messages to editor
|
|
178
178
|
- **Alt+Up** retrieves queued messages back to editor
|
|
179
179
|
|
|
180
|
-
On Windows Terminal, `Alt+Enter` is fullscreen by default. Remap it in [docs/terminal-setup.md](docs/terminal-setup.md) so
|
|
180
|
+
On Windows Terminal, `Alt+Enter` is fullscreen by default. Remap it in [docs/terminal-setup.md](docs/terminal-setup.md) so draht can receive the follow-up shortcut.
|
|
181
181
|
|
|
182
182
|
Configure delivery in [settings](docs/settings.md): `steeringMode` and `followUpMode` can be `"one-at-a-time"` (default, waits for response) or `"all"` (delivers all queued at once). `transport` selects provider transport preference (`"sse"`, `"websocket"`, or `"auto"`) for providers that support multiple transports.
|
|
183
183
|
|
|
@@ -196,6 +196,7 @@ draht -c # Continue most recent session
|
|
|
196
196
|
draht -r # Browse and select from past sessions
|
|
197
197
|
draht --no-session # Ephemeral mode (don't save)
|
|
198
198
|
draht --session <path> # Use specific session file or ID
|
|
199
|
+
draht --fork <path> # Fork specific session file or ID into a new session
|
|
199
200
|
```
|
|
200
201
|
|
|
201
202
|
### Branching
|
|
@@ -210,6 +211,8 @@ draht --session <path> # Use specific session file or ID
|
|
|
210
211
|
|
|
211
212
|
**`/fork`** - Create a new session file from the current branch. Opens a selector, copies history up to the selected point, and places that message in the editor for modification.
|
|
212
213
|
|
|
214
|
+
**`--fork <path|id>`** - Fork an existing session file or partial session UUID directly from the CLI. This copies the full source session into a new session file in the current project.
|
|
215
|
+
|
|
213
216
|
### Compaction
|
|
214
217
|
|
|
215
218
|
Long sessions can exhaust context windows. Compaction summarizes older messages while keeping recent ones.
|
|
@@ -262,7 +265,7 @@ Review this code for bugs, security issues, and performance problems.
|
|
|
262
265
|
Focus on: {{focus}}
|
|
263
266
|
```
|
|
264
267
|
|
|
265
|
-
Place in `~/.draht/agent/prompts/`, `.draht/prompts/`, or a [
|
|
268
|
+
Place in `~/.draht/agent/prompts/`, `.draht/prompts/`, or a [draht package](#draht-packages) to share with others. See [docs/prompt-templates.md](docs/prompt-templates.md).
|
|
266
269
|
|
|
267
270
|
### Skills
|
|
268
271
|
|
|
@@ -278,19 +281,19 @@ Use this skill when the user asks about X.
|
|
|
278
281
|
2. Then that
|
|
279
282
|
```
|
|
280
283
|
|
|
281
|
-
Place in `~/.draht/agent/skills/`, `~/.agents/skills/`, `.draht/skills/`, or `.agents/skills/` (from `cwd` up through parent directories) or a [
|
|
284
|
+
Place in `~/.draht/agent/skills/`, `~/.agents/skills/`, `.draht/skills/`, or `.agents/skills/` (from `cwd` up through parent directories) or a [draht package](#draht-packages) to share with others. See [docs/skills.md](docs/skills.md).
|
|
282
285
|
|
|
283
286
|
### Extensions
|
|
284
287
|
|
|
285
288
|
<p align="center"><img src="docs/images/doom-extension.png" alt="Doom Extension" width="600"></p>
|
|
286
289
|
|
|
287
|
-
TypeScript modules that
|
|
290
|
+
TypeScript modules that extend draht with custom tools, commands, keyboard shortcuts, event handlers, and UI components.
|
|
288
291
|
|
|
289
292
|
```typescript
|
|
290
293
|
export default function (draht: ExtensionAPI) {
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
|
|
294
|
+
draht.registerTool({ name: "deploy", ... });
|
|
295
|
+
draht.registerCommand("stats", { ... });
|
|
296
|
+
draht.on("tool_call", async (event, ctx) => { ... });
|
|
294
297
|
}
|
|
295
298
|
```
|
|
296
299
|
|
|
@@ -304,17 +307,17 @@ export default function (draht: ExtensionAPI) {
|
|
|
304
307
|
- Git checkpointing and auto-commit
|
|
305
308
|
- SSH and sandbox execution
|
|
306
309
|
- MCP server integration
|
|
307
|
-
-
|
|
310
|
+
- Make draht look like Claude Code
|
|
308
311
|
- Games while waiting (yes, Doom runs)
|
|
309
312
|
- ...anything you can dream up
|
|
310
313
|
|
|
311
|
-
Place in `~/.draht/agent/extensions/`, `.draht/extensions/`, or a [
|
|
314
|
+
Place in `~/.draht/agent/extensions/`, `.draht/extensions/`, or a [draht package](#draht-packages) to share with others. See [docs/extensions.md](docs/extensions.md) and [examples/extensions/](examples/extensions/).
|
|
312
315
|
|
|
313
316
|
### Themes
|
|
314
317
|
|
|
315
|
-
Built-in: `dark`, `light`. Themes hot-reload: modify the active theme file
|
|
318
|
+
Built-in: `dark`, `light`. Themes hot-reload: modify the active theme file and draht immediately applies changes.
|
|
316
319
|
|
|
317
|
-
Place in `~/.draht/agent/themes/`, `.draht/themes/`, or a [
|
|
320
|
+
Place in `~/.draht/agent/themes/`, `.draht/themes/`, or a [draht package](#draht-packages) to share with others. See [docs/themes.md](docs/themes.md).
|
|
318
321
|
|
|
319
322
|
### Draht Packages
|
|
320
323
|
|
|
@@ -334,12 +337,13 @@ draht install https://github.com/user/repo@v1 # tag or commit
|
|
|
334
337
|
draht install ssh://git@github.com/user/repo
|
|
335
338
|
draht install ssh://git@github.com/user/repo@v1 # tag or commit
|
|
336
339
|
draht remove npm:@foo/draht-tools
|
|
340
|
+
draht uninstall npm:@foo/draht-tools # alias for remove
|
|
337
341
|
draht list
|
|
338
342
|
draht update # skips pinned packages
|
|
339
343
|
draht config # enable/disable extensions, skills, prompts, themes
|
|
340
344
|
```
|
|
341
345
|
|
|
342
|
-
Packages install to `~/.draht/agent/git/` (git) or global npm. Use `-l` for project-local installs (`.draht/git/`, `.draht/npm/`).
|
|
346
|
+
Packages install to `~/.draht/agent/git/` (git) or global npm. Use `-l` for project-local installs (`.draht/git/`, `.draht/npm/`). If you use a Node version manager and want package installs to reuse a stable npm context, set `npmCommand` in `settings.json`, for example `["mise", "exec", "node@20", "--", "npm"]`.
|
|
343
347
|
|
|
344
348
|
Create a package by adding a `draht` key to `package.json`:
|
|
345
349
|
|
|
@@ -356,7 +360,7 @@ Create a package by adding a `draht` key to `package.json`:
|
|
|
356
360
|
}
|
|
357
361
|
```
|
|
358
362
|
|
|
359
|
-
Without a `draht` manifest,
|
|
363
|
+
Without a `draht` manifest, pi auto-discovers from conventional directories (`extensions/`, `skills/`, `prompts/`, `themes/`).
|
|
360
364
|
|
|
361
365
|
See [docs/packages.md](docs/packages.md).
|
|
362
366
|
|
|
@@ -396,11 +400,11 @@ See [docs/rpc.md](docs/rpc.md) for the protocol.
|
|
|
396
400
|
|
|
397
401
|
## Philosophy
|
|
398
402
|
|
|
399
|
-
Draht is aggressively extensible so it doesn't have to dictate your workflow. Features that other tools bake in can be built with [extensions](#extensions), [skills](#skills), or installed from third-party [
|
|
403
|
+
Draht is aggressively extensible so it doesn't have to dictate your workflow. Features that other tools bake in can be built with [extensions](#extensions), [skills](#skills), or installed from third-party [draht packages](#draht-packages). This keeps the core minimal while letting you shape draht to fit how you work.
|
|
400
404
|
|
|
401
|
-
**No MCP.** Build CLI tools with READMEs (see [Skills](#skills)), or build an extension that adds MCP support.
|
|
405
|
+
**No MCP.** Build CLI tools with READMEs (see [Skills](#skills)), or build an extension that adds MCP support.
|
|
402
406
|
|
|
403
|
-
**No sub-agents.** There's many ways to do this.
|
|
407
|
+
**No sub-agents.** There's many ways to do this. Spawn draht instances via tmux, or build your own with [extensions](#extensions), or install a package that does it your way.
|
|
404
408
|
|
|
405
409
|
**No permission popups.** Run in a container, or build your own confirmation flow with [extensions](#extensions) inline with your environment and security requirements.
|
|
406
410
|
|
|
@@ -410,7 +414,7 @@ Draht is aggressively extensible so it doesn't have to dictate your workflow. Fe
|
|
|
410
414
|
|
|
411
415
|
**No background bash.** Use tmux. Full observability, direct interaction.
|
|
412
416
|
|
|
413
|
-
|
|
417
|
+
|
|
414
418
|
|
|
415
419
|
---
|
|
416
420
|
|
|
@@ -423,11 +427,12 @@ draht [options] [@files...] [messages...]
|
|
|
423
427
|
### Package Commands
|
|
424
428
|
|
|
425
429
|
```bash
|
|
426
|
-
draht install <source> [-l]
|
|
427
|
-
draht remove <source> [-l]
|
|
428
|
-
draht
|
|
429
|
-
draht
|
|
430
|
-
draht
|
|
430
|
+
draht install <source> [-l] # Install package, -l for project-local
|
|
431
|
+
draht remove <source> [-l] # Remove package
|
|
432
|
+
draht uninstall <source> [-l] # Alias for remove
|
|
433
|
+
draht update [source] # Update packages (skips pinned)
|
|
434
|
+
draht list # List installed packages
|
|
435
|
+
draht config # Enable/disable package resources
|
|
431
436
|
```
|
|
432
437
|
|
|
433
438
|
### Modes
|
|
@@ -440,6 +445,12 @@ draht config # Enable/disable package resources
|
|
|
440
445
|
| `--mode rpc` | RPC mode for process integration (see [docs/rpc.md](docs/rpc.md)) |
|
|
441
446
|
| `--export <in> [out]` | Export session to HTML |
|
|
442
447
|
|
|
448
|
+
In print mode, pi also reads piped stdin and merges it into the initial prompt:
|
|
449
|
+
|
|
450
|
+
```bash
|
|
451
|
+
cat README.md | draht -p "Summarize this text"
|
|
452
|
+
```
|
|
453
|
+
|
|
443
454
|
### Model Options
|
|
444
455
|
|
|
445
456
|
| Option | Description |
|
|
@@ -458,6 +469,7 @@ draht config # Enable/disable package resources
|
|
|
458
469
|
| `-c`, `--continue` | Continue most recent session |
|
|
459
470
|
| `-r`, `--resume` | Browse and select session |
|
|
460
471
|
| `--session <path>` | Use specific session file or partial UUID |
|
|
472
|
+
| `--fork <path>` | Fork specific session file or partial UUID into a new session |
|
|
461
473
|
| `--session-dir <dir>` | Custom session storage directory |
|
|
462
474
|
| `--no-session` | Ephemeral mode (don't save) |
|
|
463
475
|
|
|
@@ -514,6 +526,9 @@ draht "List all .ts files in src/"
|
|
|
514
526
|
# Non-interactive
|
|
515
527
|
draht -p "Summarize this codebase"
|
|
516
528
|
|
|
529
|
+
# Non-interactive with piped stdin
|
|
530
|
+
cat README.md | draht -p "Summarize this text"
|
|
531
|
+
|
|
517
532
|
# Different model
|
|
518
533
|
draht --provider openai --model gpt-4o "Help me refactor"
|
|
519
534
|
|
|
@@ -557,6 +572,6 @@ MIT
|
|
|
557
572
|
|
|
558
573
|
## See Also
|
|
559
574
|
|
|
560
|
-
- [@draht/ai](
|
|
561
|
-
- [@draht/agent-core](
|
|
562
|
-
- [@draht/tui](
|
|
575
|
+
- [@draht/ai](../ai): Core LLM toolkit
|
|
576
|
+
- [@draht/agent-core](../agent): Agent framework
|
|
577
|
+
- [@draht/tui](../tui): Terminal UI components
|
package/bin/draht-tools.cjs
CHANGED
|
@@ -305,7 +305,8 @@ commands["phase-info"] = function (n) {
|
|
|
305
305
|
};
|
|
306
306
|
|
|
307
307
|
// --- save-context ---
|
|
308
|
-
|
|
308
|
+
// Supports stdin: echo "content" | draht-tools save-context N
|
|
309
|
+
commands["save-context"] = async function (n, ...rest) {
|
|
309
310
|
const num = parseInt(n, 10);
|
|
310
311
|
if (!num) { console.error("Usage: draht-tools save-context N"); process.exit(1); }
|
|
311
312
|
|
|
@@ -314,7 +315,22 @@ commands["save-context"] = function (n, ...rest) {
|
|
|
314
315
|
ensureDir(dir);
|
|
315
316
|
|
|
316
317
|
const contextPath = path.join(dir, `${padNum(num)}-CONTEXT.md`);
|
|
317
|
-
|
|
318
|
+
|
|
319
|
+
// Check for stdin content (piped input)
|
|
320
|
+
let stdinContent = "";
|
|
321
|
+
if (!process.stdin.isTTY) {
|
|
322
|
+
stdinContent = await new Promise((resolve) => {
|
|
323
|
+
let data = "";
|
|
324
|
+
process.stdin.setEncoding("utf-8");
|
|
325
|
+
process.stdin.on("data", (chunk) => { data += chunk; });
|
|
326
|
+
process.stdin.on("end", () => { resolve(data.trim()); });
|
|
327
|
+
});
|
|
328
|
+
}
|
|
329
|
+
|
|
330
|
+
if (stdinContent) {
|
|
331
|
+
writeMd(contextPath, stdinContent);
|
|
332
|
+
console.log(`Created: ${contextPath}`);
|
|
333
|
+
} else if (fs.existsSync(contextPath)) {
|
|
318
334
|
console.log(`Context already exists at ${contextPath}`);
|
|
319
335
|
console.log("Edit it directly or pass content via stdin.");
|
|
320
336
|
} else {
|
|
@@ -372,7 +388,8 @@ commands["load-phase-context"] = function (n) {
|
|
|
372
388
|
};
|
|
373
389
|
|
|
374
390
|
// --- create-plan ---
|
|
375
|
-
|
|
391
|
+
// Supports stdin: echo "content" | draht-tools create-plan N P [title]
|
|
392
|
+
commands["create-plan"] = async function (n, p, ...titleWords) {
|
|
376
393
|
const phaseNum = parseInt(n, 10);
|
|
377
394
|
const planNum = parseInt(p, 10);
|
|
378
395
|
if (!phaseNum || !planNum) { console.error("Usage: draht-tools create-plan N P [title]"); process.exit(1); }
|
|
@@ -384,7 +401,24 @@ commands["create-plan"] = function (n, p, ...titleWords) {
|
|
|
384
401
|
const title = titleWords.join(" ") || `Plan ${planNum}`;
|
|
385
402
|
const planPath = path.join(dir, `${padNum(phaseNum)}-${padNum(planNum)}-PLAN.md`);
|
|
386
403
|
|
|
387
|
-
|
|
404
|
+
// Check for stdin content (piped input)
|
|
405
|
+
let stdinContent = "";
|
|
406
|
+
if (!process.stdin.isTTY) {
|
|
407
|
+
stdinContent = await new Promise((resolve) => {
|
|
408
|
+
let data = "";
|
|
409
|
+
process.stdin.setEncoding("utf-8");
|
|
410
|
+
process.stdin.on("data", (chunk) => { data += chunk; });
|
|
411
|
+
process.stdin.on("end", () => { resolve(data.trim()); });
|
|
412
|
+
});
|
|
413
|
+
}
|
|
414
|
+
|
|
415
|
+
let content;
|
|
416
|
+
if (stdinContent) {
|
|
417
|
+
// Use stdin content directly
|
|
418
|
+
content = stdinContent;
|
|
419
|
+
} else {
|
|
420
|
+
// Generate template
|
|
421
|
+
content = `---
|
|
388
422
|
phase: ${phaseNum}
|
|
389
423
|
plan: ${planNum}
|
|
390
424
|
depends_on: []
|
|
@@ -417,7 +451,9 @@ must_haves:
|
|
|
417
451
|
---
|
|
418
452
|
Created: ${timestamp()}
|
|
419
453
|
`;
|
|
420
|
-
|
|
454
|
+
}
|
|
455
|
+
|
|
456
|
+
writeMd(planPath, content);
|
|
421
457
|
console.log(`Created: ${planPath}`);
|
|
422
458
|
};
|
|
423
459
|
|
|
@@ -547,7 +583,8 @@ commands["commit-task"] = function (n, p, t, ...desc) {
|
|
|
547
583
|
};
|
|
548
584
|
|
|
549
585
|
// --- write-summary ---
|
|
550
|
-
|
|
586
|
+
// Supports stdin: echo "content" | draht-tools write-summary N P
|
|
587
|
+
commands["write-summary"] = async function (n, p) {
|
|
551
588
|
const phaseNum = parseInt(n, 10);
|
|
552
589
|
const planNum = parseInt(p, 10);
|
|
553
590
|
if (!phaseNum || !planNum) { console.error("Usage: draht-tools write-summary N P"); process.exit(1); }
|
|
@@ -556,8 +593,26 @@ commands["write-summary"] = function (n, p) {
|
|
|
556
593
|
if (!phaseDir) { console.error(`Phase ${phaseNum} not found`); process.exit(1); }
|
|
557
594
|
|
|
558
595
|
const summaryPath = path.join(phaseDir, `${padNum(phaseNum)}-${padNum(planNum)}-SUMMARY.md`);
|
|
559
|
-
|
|
560
|
-
|
|
596
|
+
|
|
597
|
+
// Check for stdin content (piped input)
|
|
598
|
+
let stdinContent = "";
|
|
599
|
+
if (!process.stdin.isTTY) {
|
|
600
|
+
stdinContent = await new Promise((resolve) => {
|
|
601
|
+
let data = "";
|
|
602
|
+
process.stdin.setEncoding("utf-8");
|
|
603
|
+
process.stdin.on("data", (chunk) => { data += chunk; });
|
|
604
|
+
process.stdin.on("end", () => { resolve(data.trim()); });
|
|
605
|
+
});
|
|
606
|
+
}
|
|
607
|
+
|
|
608
|
+
let content;
|
|
609
|
+
if (stdinContent) {
|
|
610
|
+
content = stdinContent;
|
|
611
|
+
} else {
|
|
612
|
+
content = `# Phase ${phaseNum}, Plan ${planNum} Summary\n\n## Completed Tasks\n| # | Task | Status | Commit |\n|---|------|--------|--------|\n| 1 | [task] | ✅ Done | [hash] |\n\n## Files Changed\n- [files]\n\n## Verification Results\n- [results]\n\n## Notes\n[deviations, decisions]\n\n---\nCompleted: ${timestamp()}\n`;
|
|
613
|
+
}
|
|
614
|
+
|
|
615
|
+
writeMd(summaryPath, content);
|
|
561
616
|
console.log(`Created: ${summaryPath}`);
|
|
562
617
|
};
|
|
563
618
|
|
|
@@ -628,17 +683,35 @@ commands["extract-deliverables"] = function (n) {
|
|
|
628
683
|
};
|
|
629
684
|
|
|
630
685
|
// --- create-fix-plan ---
|
|
631
|
-
|
|
686
|
+
// Supports stdin: echo "content" | draht-tools create-fix-plan N P [issue]
|
|
687
|
+
commands["create-fix-plan"] = async function (n, p, ...issueWords) {
|
|
632
688
|
const phaseNum = parseInt(n, 10);
|
|
633
689
|
const planNum = parseInt(p, 10);
|
|
634
690
|
if (!phaseNum || !planNum) { console.error("Usage: draht-tools create-fix-plan N P [issue]"); process.exit(1); }
|
|
635
691
|
|
|
636
692
|
const slug = getPhaseSlug(phaseNum) || `phase-${phaseNum}`;
|
|
637
693
|
const dir = planningPath("phases", `${padNum(phaseNum)}-${slug}`);
|
|
694
|
+
ensureDir(dir);
|
|
638
695
|
const issue = issueWords.join(" ") || "Fix identified issues";
|
|
639
696
|
|
|
640
697
|
const fixPath = path.join(dir, `${padNum(phaseNum)}-${padNum(planNum)}-FIX-PLAN.md`);
|
|
641
|
-
|
|
698
|
+
|
|
699
|
+
// Check for stdin content (piped input)
|
|
700
|
+
let stdinContent = "";
|
|
701
|
+
if (!process.stdin.isTTY) {
|
|
702
|
+
stdinContent = await new Promise((resolve) => {
|
|
703
|
+
let data = "";
|
|
704
|
+
process.stdin.setEncoding("utf-8");
|
|
705
|
+
process.stdin.on("data", (chunk) => { data += chunk; });
|
|
706
|
+
process.stdin.on("end", () => { resolve(data.trim()); });
|
|
707
|
+
});
|
|
708
|
+
}
|
|
709
|
+
|
|
710
|
+
let content;
|
|
711
|
+
if (stdinContent) {
|
|
712
|
+
content = stdinContent;
|
|
713
|
+
} else {
|
|
714
|
+
content = `---
|
|
642
715
|
gap_closure: true
|
|
643
716
|
fixes_plan: ${planNum}
|
|
644
717
|
issue: "${issue}"
|
|
@@ -662,12 +735,15 @@ ${issue}
|
|
|
662
735
|
---
|
|
663
736
|
Created: ${timestamp()}
|
|
664
737
|
`;
|
|
665
|
-
|
|
738
|
+
}
|
|
739
|
+
|
|
740
|
+
writeMd(fixPath, content);
|
|
666
741
|
console.log(`Created: ${fixPath}`);
|
|
667
742
|
};
|
|
668
743
|
|
|
669
744
|
// --- write-uat ---
|
|
670
|
-
|
|
745
|
+
// Supports stdin: echo "content" | draht-tools write-uat N
|
|
746
|
+
commands["write-uat"] = async function (n) {
|
|
671
747
|
const num = parseInt(n, 10);
|
|
672
748
|
if (!num) { console.error("Usage: draht-tools write-uat N"); process.exit(1); }
|
|
673
749
|
|
|
@@ -675,8 +751,26 @@ commands["write-uat"] = function (n) {
|
|
|
675
751
|
if (!phaseDir) { console.error(`Phase ${num} not found`); process.exit(1); }
|
|
676
752
|
|
|
677
753
|
const uatPath = path.join(phaseDir, `${padNum(num)}-UAT.md`);
|
|
678
|
-
|
|
679
|
-
|
|
754
|
+
|
|
755
|
+
// Check for stdin content (piped input)
|
|
756
|
+
let stdinContent = "";
|
|
757
|
+
if (!process.stdin.isTTY) {
|
|
758
|
+
stdinContent = await new Promise((resolve) => {
|
|
759
|
+
let data = "";
|
|
760
|
+
process.stdin.setEncoding("utf-8");
|
|
761
|
+
process.stdin.on("data", (chunk) => { data += chunk; });
|
|
762
|
+
process.stdin.on("end", () => { resolve(data.trim()); });
|
|
763
|
+
});
|
|
764
|
+
}
|
|
765
|
+
|
|
766
|
+
let content;
|
|
767
|
+
if (stdinContent) {
|
|
768
|
+
content = stdinContent;
|
|
769
|
+
} else {
|
|
770
|
+
content = `# Phase ${num} User Acceptance Testing\n\n## Test Date: ${dateStamp()}\n\n## Results\n| # | Deliverable | Status | Notes |\n|---|-------------|--------|-------|\n| 1 | [description] | ✅ Pass | |\n\n## Summary\n- Passed: X/Y\n- Failed: 0/Y\n- Skipped: 0/Y\n\n## Fix Plans Created\n(none)\n`;
|
|
771
|
+
}
|
|
772
|
+
|
|
773
|
+
writeMd(uatPath, content);
|
|
680
774
|
console.log(`Created: ${uatPath}`);
|
|
681
775
|
};
|
|
682
776
|
|
|
@@ -691,7 +785,8 @@ commands["next-quick-number"] = function () {
|
|
|
691
785
|
};
|
|
692
786
|
|
|
693
787
|
// --- create-quick-plan ---
|
|
694
|
-
|
|
788
|
+
// Supports stdin: echo "content" | draht-tools create-quick-plan NNN [desc]
|
|
789
|
+
commands["create-quick-plan"] = async function (n, ...descWords) {
|
|
695
790
|
const num = padNum(parseInt(n, 10), 3);
|
|
696
791
|
const desc = descWords.join(" ") || "Quick task";
|
|
697
792
|
const slug = slugify(desc);
|
|
@@ -699,13 +794,34 @@ commands["create-quick-plan"] = function (n, ...descWords) {
|
|
|
699
794
|
ensureDir(dir);
|
|
700
795
|
|
|
701
796
|
const planPath = path.join(dir, `${num}-PLAN.md`);
|
|
702
|
-
|
|
703
|
-
|
|
797
|
+
|
|
798
|
+
// Check for stdin content (piped input)
|
|
799
|
+
let stdinContent = "";
|
|
800
|
+
if (!process.stdin.isTTY) {
|
|
801
|
+
stdinContent = await new Promise((resolve) => {
|
|
802
|
+
let data = "";
|
|
803
|
+
process.stdin.setEncoding("utf-8");
|
|
804
|
+
process.stdin.on("data", (chunk) => { data += chunk; });
|
|
805
|
+
process.stdin.on("end", () => { resolve(data.trim()); });
|
|
806
|
+
});
|
|
807
|
+
}
|
|
808
|
+
|
|
809
|
+
let content;
|
|
810
|
+
if (stdinContent) {
|
|
811
|
+
// Use stdin content directly
|
|
812
|
+
content = stdinContent;
|
|
813
|
+
} else {
|
|
814
|
+
// Generate template
|
|
815
|
+
content = `# Quick Task ${num}: ${desc}\n\n## Tasks\n\n<task type="auto">\n <n>[Task]</n>\n <files>[files]</files>\n <action>[instructions]</action>\n <verify>[verify]</verify>\n <done>[done]</done>\n</task>\n\n---\nCreated: ${timestamp()}\n`;
|
|
816
|
+
}
|
|
817
|
+
|
|
818
|
+
writeMd(planPath, content);
|
|
704
819
|
console.log(`Created: ${planPath}`);
|
|
705
820
|
};
|
|
706
821
|
|
|
707
822
|
// --- write-quick-summary ---
|
|
708
|
-
|
|
823
|
+
// Supports stdin: echo "content" | draht-tools write-quick-summary NNN
|
|
824
|
+
commands["write-quick-summary"] = async function (n) {
|
|
709
825
|
const num = padNum(parseInt(n, 10), 3);
|
|
710
826
|
const dir = planningPath("quick");
|
|
711
827
|
if (!fs.existsSync(dir)) { console.error("No quick tasks directory"); process.exit(1); }
|
|
@@ -713,8 +829,26 @@ commands["write-quick-summary"] = function (n) {
|
|
|
713
829
|
if (!match) { console.error(`Quick task ${num} not found`); process.exit(1); }
|
|
714
830
|
|
|
715
831
|
const summaryPath = path.join(dir, match, `${num}-SUMMARY.md`);
|
|
716
|
-
|
|
717
|
-
|
|
832
|
+
|
|
833
|
+
// Check for stdin content (piped input)
|
|
834
|
+
let stdinContent = "";
|
|
835
|
+
if (!process.stdin.isTTY) {
|
|
836
|
+
stdinContent = await new Promise((resolve) => {
|
|
837
|
+
let data = "";
|
|
838
|
+
process.stdin.setEncoding("utf-8");
|
|
839
|
+
process.stdin.on("data", (chunk) => { data += chunk; });
|
|
840
|
+
process.stdin.on("end", () => { resolve(data.trim()); });
|
|
841
|
+
});
|
|
842
|
+
}
|
|
843
|
+
|
|
844
|
+
let content;
|
|
845
|
+
if (stdinContent) {
|
|
846
|
+
content = stdinContent;
|
|
847
|
+
} else {
|
|
848
|
+
content = `# Quick Task ${num} Summary\n\n## Tasks Completed\n| # | Task | Status | Commit |\n|---|------|--------|--------|\n| 1 | [task] | ✅ Done | [hash] |\n\n## Files Changed\n- [files]\n\n---\nCompleted: ${timestamp()}\n`;
|
|
849
|
+
}
|
|
850
|
+
|
|
851
|
+
writeMd(summaryPath, content);
|
|
718
852
|
console.log(`Created: ${summaryPath}`);
|
|
719
853
|
};
|
|
720
854
|
|
|
@@ -826,7 +960,8 @@ commands["commit-docs"] = function (...msg) {
|
|
|
826
960
|
};
|
|
827
961
|
|
|
828
962
|
// --- research-phase ---
|
|
829
|
-
|
|
963
|
+
// Supports stdin: echo "content" | draht-tools research-phase N
|
|
964
|
+
commands["research-phase"] = async function (n) {
|
|
830
965
|
const num = parseInt(n, 10);
|
|
831
966
|
if (!num) { console.error("Usage: draht-tools research-phase N"); process.exit(1); }
|
|
832
967
|
|
|
@@ -835,10 +970,28 @@ commands["research-phase"] = function (n) {
|
|
|
835
970
|
ensureDir(dir);
|
|
836
971
|
|
|
837
972
|
const resPath = path.join(dir, `${padNum(num)}-RESEARCH.md`);
|
|
838
|
-
|
|
839
|
-
|
|
973
|
+
|
|
974
|
+
// Check for stdin content (piped input)
|
|
975
|
+
let stdinContent = "";
|
|
976
|
+
if (!process.stdin.isTTY) {
|
|
977
|
+
stdinContent = await new Promise((resolve) => {
|
|
978
|
+
let data = "";
|
|
979
|
+
process.stdin.setEncoding("utf-8");
|
|
980
|
+
process.stdin.on("data", (chunk) => { data += chunk; });
|
|
981
|
+
process.stdin.on("end", () => { resolve(data.trim()); });
|
|
982
|
+
});
|
|
983
|
+
}
|
|
984
|
+
|
|
985
|
+
let content;
|
|
986
|
+
if (stdinContent) {
|
|
987
|
+
content = stdinContent;
|
|
988
|
+
} else {
|
|
989
|
+
content = `# Phase ${num} Research\n\nGenerated: ${timestamp()}\n\n## Best Practices\n[Fill in]\n\n## Patterns & Anti-Patterns\n[Fill in]\n\n## Library Recommendations\n[Fill in]\n\n## Edge Cases & Gotchas\n[Fill in]\n`;
|
|
990
|
+
}
|
|
991
|
+
|
|
992
|
+
writeMd(resPath, content);
|
|
840
993
|
console.log(`Created: ${resPath}`);
|
|
841
|
-
console.log("→ Fill in research findings, then plan the phase.");
|
|
994
|
+
if (!stdinContent) console.log("→ Fill in research findings, then plan the phase.");
|
|
842
995
|
};
|
|
843
996
|
|
|
844
997
|
// ============================================================================
|
|
@@ -902,11 +1055,13 @@ Version: 1.0.0
|
|
|
902
1055
|
// Dispatch
|
|
903
1056
|
const [cmd, ...args] = process.argv.slice(2);
|
|
904
1057
|
|
|
905
|
-
|
|
906
|
-
|
|
907
|
-
|
|
908
|
-
commands[cmd]
|
|
909
|
-
|
|
910
|
-
|
|
911
|
-
|
|
912
|
-
|
|
1058
|
+
(async () => {
|
|
1059
|
+
if (!cmd || cmd === "help" || cmd === "--help" || cmd === "-h") {
|
|
1060
|
+
commands.help();
|
|
1061
|
+
} else if (commands[cmd]) {
|
|
1062
|
+
await commands[cmd](...args);
|
|
1063
|
+
} else {
|
|
1064
|
+
console.error(`Unknown command: ${cmd}\nRun: draht-tools help`);
|
|
1065
|
+
process.exit(1);
|
|
1066
|
+
}
|
|
1067
|
+
})();
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"cli.d.ts","sourceRoot":"","sources":["../../src/bun/cli.ts"],"names":[],"mappings":"","sourcesContent":["#!/usr/bin/env node\nprocess.title = \"draht\";\nprocess.emitWarning = (() => {}) as typeof process.emitWarning;\n\nawait import(\"./register-bedrock.js\");\nawait import(\"../cli.js\");\n"]}
|
package/dist/bun/cli.js
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"cli.js","sourceRoot":"","sources":["../../src/bun/cli.ts"],"names":[],"mappings":";AACA,OAAO,CAAC,KAAK,GAAG,OAAO,CAAC;AACxB,OAAO,CAAC,WAAW,GAAG,CAAC,GAAG,EAAE,CAAC,EAAC,CAAC,CAA+B,CAAC;AAE/D,MAAM,MAAM,CAAC,uBAAuB,CAAC,CAAC;AACtC,MAAM,MAAM,CAAC,WAAW,CAAC,CAAC","sourcesContent":["#!/usr/bin/env node\nprocess.title = \"draht\";\nprocess.emitWarning = (() => {}) as typeof process.emitWarning;\n\nawait import(\"./register-bedrock.js\");\nawait import(\"../cli.js\");\n"]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"register-bedrock.d.ts","sourceRoot":"","sources":["../../src/bun/register-bedrock.ts"],"names":[],"mappings":"","sourcesContent":["import { setBedrockProviderModule } from \"@draht/ai\";\nimport { bedrockProviderModule } from \"@draht/ai/bedrock-provider\";\n\nsetBedrockProviderModule(bedrockProviderModule);\n"]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"register-bedrock.js","sourceRoot":"","sources":["../../src/bun/register-bedrock.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,wBAAwB,EAAE,MAAM,WAAW,CAAC;AACrD,OAAO,EAAE,qBAAqB,EAAE,MAAM,4BAA4B,CAAC;AAEnE,wBAAwB,CAAC,qBAAqB,CAAC,CAAC","sourcesContent":["import { setBedrockProviderModule } from \"@draht/ai\";\nimport { bedrockProviderModule } from \"@draht/ai/bedrock-provider\";\n\nsetBedrockProviderModule(bedrockProviderModule);\n"]}
|