@draht/coding-agent 2026.7.13 → 2026.9.5-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.
Files changed (614) hide show
  1. package/CHANGELOG.md +241 -0
  2. package/README.md +47 -2
  3. package/agents/debugger.md +12 -1
  4. package/agents/git-committer.md +1 -0
  5. package/agents/implementer.md +20 -0
  6. package/agents/investigator.md +75 -0
  7. package/agents/reviewer.md +7 -0
  8. package/agents/spec-reviewer.md +66 -0
  9. package/agents/verifier.md +4 -3
  10. package/bin/draht-tools.cjs +472 -41
  11. package/dist/agents/debugger.md +12 -1
  12. package/dist/agents/git-committer.md +1 -0
  13. package/dist/agents/implementer.md +20 -0
  14. package/dist/agents/investigator.md +75 -0
  15. package/dist/agents/reviewer.md +7 -0
  16. package/dist/agents/spec-reviewer.md +66 -0
  17. package/dist/agents/verifier.md +4 -3
  18. package/dist/bun/cli.js +2 -0
  19. package/dist/bun/cli.js.map +1 -1
  20. package/dist/cli/args.d.ts +10 -0
  21. package/dist/cli/args.d.ts.map +1 -1
  22. package/dist/cli/args.js +80 -3
  23. package/dist/cli/args.js.map +1 -1
  24. package/dist/cli/attach-mode.d.ts +61 -0
  25. package/dist/cli/attach-mode.d.ts.map +1 -1
  26. package/dist/cli/attach-mode.js +243 -5
  27. package/dist/cli/attach-mode.js.map +1 -1
  28. package/dist/cli/config-selector.js +1 -1
  29. package/dist/cli/config-selector.js.map +1 -1
  30. package/dist/cli/credential-print.d.ts +23 -0
  31. package/dist/cli/credential-print.d.ts.map +1 -0
  32. package/dist/cli/credential-print.js +117 -0
  33. package/dist/cli/credential-print.js.map +1 -0
  34. package/dist/cli/list-models.d.ts +2 -2
  35. package/dist/cli/list-models.d.ts.map +1 -1
  36. package/dist/cli/list-models.js +3 -3
  37. package/dist/cli/list-models.js.map +1 -1
  38. package/dist/cli/startup-ui.js +1 -1
  39. package/dist/cli/startup-ui.js.map +1 -1
  40. package/dist/config.d.ts +9 -0
  41. package/dist/config.d.ts.map +1 -1
  42. package/dist/config.js +31 -4
  43. package/dist/config.js.map +1 -1
  44. package/dist/core/agent-session-runtime.d.ts +17 -1
  45. package/dist/core/agent-session-runtime.d.ts.map +1 -1
  46. package/dist/core/agent-session-runtime.js +90 -30
  47. package/dist/core/agent-session-runtime.js.map +1 -1
  48. package/dist/core/agent-session-services.d.ts +4 -7
  49. package/dist/core/agent-session-services.d.ts.map +1 -1
  50. package/dist/core/agent-session-services.js +24 -9
  51. package/dist/core/agent-session-services.js.map +1 -1
  52. package/dist/core/agent-session.d.ts +87 -27
  53. package/dist/core/agent-session.d.ts.map +1 -1
  54. package/dist/core/agent-session.js +337 -154
  55. package/dist/core/agent-session.js.map +1 -1
  56. package/dist/core/auth-storage.d.ts +20 -104
  57. package/dist/core/auth-storage.d.ts.map +1 -1
  58. package/dist/core/auth-storage.js +104 -260
  59. package/dist/core/auth-storage.js.map +1 -1
  60. package/dist/core/builtins/checkpoints.d.ts +20 -0
  61. package/dist/core/builtins/checkpoints.d.ts.map +1 -0
  62. package/dist/core/builtins/checkpoints.js +161 -0
  63. package/dist/core/builtins/checkpoints.js.map +1 -0
  64. package/dist/core/builtins/duet.d.ts +26 -0
  65. package/dist/core/builtins/duet.d.ts.map +1 -0
  66. package/dist/core/builtins/duet.js +660 -0
  67. package/dist/core/builtins/duet.js.map +1 -0
  68. package/dist/core/builtins/index.d.ts.map +1 -1
  69. package/dist/core/builtins/index.js +7 -1
  70. package/dist/core/builtins/index.js.map +1 -1
  71. package/dist/core/builtins/subagent.d.ts +24 -4
  72. package/dist/core/builtins/subagent.d.ts.map +1 -1
  73. package/dist/core/builtins/subagent.js +278 -35
  74. package/dist/core/builtins/subagent.js.map +1 -1
  75. package/dist/core/cache-stats.d.ts +2 -2
  76. package/dist/core/cache-stats.d.ts.map +1 -1
  77. package/dist/core/cache-stats.js +1 -1
  78. package/dist/core/cache-stats.js.map +1 -1
  79. package/dist/core/checkpoints/checkpoint-cli.d.ts +17 -0
  80. package/dist/core/checkpoints/checkpoint-cli.d.ts.map +1 -0
  81. package/dist/core/checkpoints/checkpoint-cli.js +78 -0
  82. package/dist/core/checkpoints/checkpoint-cli.js.map +1 -0
  83. package/dist/core/checkpoints/checkpoint-manager.d.ts +294 -0
  84. package/dist/core/checkpoints/checkpoint-manager.d.ts.map +1 -0
  85. package/dist/core/checkpoints/checkpoint-manager.js +865 -0
  86. package/dist/core/checkpoints/checkpoint-manager.js.map +1 -0
  87. package/dist/core/checkpoints/rewind.d.ts +141 -0
  88. package/dist/core/checkpoints/rewind.d.ts.map +1 -0
  89. package/dist/core/checkpoints/rewind.js +246 -0
  90. package/dist/core/checkpoints/rewind.js.map +1 -0
  91. package/dist/core/compaction/branch-summarization.d.ts +9 -3
  92. package/dist/core/compaction/branch-summarization.d.ts.map +1 -1
  93. package/dist/core/compaction/branch-summarization.js +16 -14
  94. package/dist/core/compaction/branch-summarization.js.map +1 -1
  95. package/dist/core/compaction/compaction.d.ts +24 -3
  96. package/dist/core/compaction/compaction.d.ts.map +1 -1
  97. package/dist/core/compaction/compaction.js +96 -30
  98. package/dist/core/compaction/compaction.js.map +1 -1
  99. package/dist/core/compaction/utils.d.ts +1 -1
  100. package/dist/core/compaction/utils.d.ts.map +1 -1
  101. package/dist/core/compaction/utils.js +6 -17
  102. package/dist/core/compaction/utils.js.map +1 -1
  103. package/dist/core/context-windows.d.ts +7 -0
  104. package/dist/core/context-windows.d.ts.map +1 -0
  105. package/dist/core/context-windows.js +35 -0
  106. package/dist/core/context-windows.js.map +1 -0
  107. package/dist/core/extensions/index.d.ts +1 -1
  108. package/dist/core/extensions/index.d.ts.map +1 -1
  109. package/dist/core/extensions/index.js.map +1 -1
  110. package/dist/core/extensions/loader.d.ts.map +1 -1
  111. package/dist/core/extensions/loader.js +101 -23
  112. package/dist/core/extensions/loader.js.map +1 -1
  113. package/dist/core/extensions/runner.d.ts +19 -3
  114. package/dist/core/extensions/runner.d.ts.map +1 -1
  115. package/dist/core/extensions/runner.js +117 -2
  116. package/dist/core/extensions/runner.js.map +1 -1
  117. package/dist/core/extensions/types.d.ts +236 -9
  118. package/dist/core/extensions/types.d.ts.map +1 -1
  119. package/dist/core/extensions/types.js.map +1 -1
  120. package/dist/core/extensions/wrapper.d.ts.map +1 -1
  121. package/dist/core/extensions/wrapper.js +22 -3
  122. package/dist/core/extensions/wrapper.js.map +1 -1
  123. package/dist/core/footer-data-provider.d.ts +10 -0
  124. package/dist/core/footer-data-provider.d.ts.map +1 -1
  125. package/dist/core/footer-data-provider.js +1 -1
  126. package/dist/core/footer-data-provider.js.map +1 -1
  127. package/dist/core/http-dispatcher.d.ts.map +1 -1
  128. package/dist/core/http-dispatcher.js +7 -0
  129. package/dist/core/http-dispatcher.js.map +1 -1
  130. package/dist/core/index.d.ts +1 -1
  131. package/dist/core/index.d.ts.map +1 -1
  132. package/dist/core/index.js.map +1 -1
  133. package/dist/core/keybindings.d.ts +18 -3
  134. package/dist/core/keybindings.d.ts.map +1 -1
  135. package/dist/core/keybindings.js +12 -3
  136. package/dist/core/keybindings.js.map +1 -1
  137. package/dist/core/model-config.d.ts +542 -0
  138. package/dist/core/model-config.d.ts.map +1 -0
  139. package/dist/core/model-config.js +247 -0
  140. package/dist/core/model-config.js.map +1 -0
  141. package/dist/core/model-registry.d.ts +19 -124
  142. package/dist/core/model-registry.d.ts.map +1 -1
  143. package/dist/core/model-registry.js +56 -727
  144. package/dist/core/model-registry.js.map +1 -1
  145. package/dist/core/model-resolver.d.ts +7 -6
  146. package/dist/core/model-resolver.d.ts.map +1 -1
  147. package/dist/core/model-resolver.js +74 -27
  148. package/dist/core/model-resolver.js.map +1 -1
  149. package/dist/core/model-runtime.d.ts +89 -0
  150. package/dist/core/model-runtime.d.ts.map +1 -0
  151. package/dist/core/model-runtime.js +451 -0
  152. package/dist/core/model-runtime.js.map +1 -0
  153. package/dist/core/models-store.d.ts +17 -0
  154. package/dist/core/models-store.d.ts.map +1 -0
  155. package/dist/core/models-store.js +46 -0
  156. package/dist/core/models-store.js.map +1 -0
  157. package/dist/core/multi-agent/permission-gate.d.ts.map +1 -1
  158. package/dist/core/multi-agent/permission-gate.js +4 -3
  159. package/dist/core/multi-agent/permission-gate.js.map +1 -1
  160. package/dist/core/multi-agent/worktree.d.ts +2 -0
  161. package/dist/core/multi-agent/worktree.d.ts.map +1 -1
  162. package/dist/core/multi-agent/worktree.js +2 -2
  163. package/dist/core/multi-agent/worktree.js.map +1 -1
  164. package/dist/core/package-manager.d.ts +7 -1
  165. package/dist/core/package-manager.d.ts.map +1 -1
  166. package/dist/core/package-manager.js +41 -45
  167. package/dist/core/package-manager.js.map +1 -1
  168. package/dist/core/permission-relay/index.d.ts +19 -0
  169. package/dist/core/permission-relay/index.d.ts.map +1 -0
  170. package/dist/core/permission-relay/index.js +49 -0
  171. package/dist/core/permission-relay/index.js.map +1 -0
  172. package/dist/core/permission-relay/relay-ui-context.d.ts +39 -0
  173. package/dist/core/permission-relay/relay-ui-context.d.ts.map +1 -0
  174. package/dist/core/permission-relay/relay-ui-context.js +788 -0
  175. package/dist/core/permission-relay/relay-ui-context.js.map +1 -0
  176. package/dist/core/permission-relay/types.d.ts +222 -0
  177. package/dist/core/permission-relay/types.d.ts.map +1 -0
  178. package/dist/core/permission-relay/types.js +15 -0
  179. package/dist/core/permission-relay/types.js.map +1 -0
  180. package/dist/core/pi-manifest.d.ts +14 -0
  181. package/dist/core/pi-manifest.d.ts.map +1 -0
  182. package/dist/core/pi-manifest.js +35 -0
  183. package/dist/core/pi-manifest.js.map +1 -0
  184. package/dist/core/project-trust.js +2 -2
  185. package/dist/core/project-trust.js.map +1 -1
  186. package/dist/core/prompt-templates.d.ts +1 -0
  187. package/dist/core/prompt-templates.d.ts.map +1 -1
  188. package/dist/core/prompt-templates.js +4 -4
  189. package/dist/core/prompt-templates.js.map +1 -1
  190. package/dist/core/provider-composer.d.ts +55 -0
  191. package/dist/core/provider-composer.d.ts.map +1 -0
  192. package/dist/core/provider-composer.js +375 -0
  193. package/dist/core/provider-composer.js.map +1 -0
  194. package/dist/core/radius.d.ts +2 -0
  195. package/dist/core/radius.d.ts.map +1 -0
  196. package/dist/core/radius.js +2 -0
  197. package/dist/core/radius.js.map +1 -0
  198. package/dist/core/remote-catalog-provider.d.ts +5 -0
  199. package/dist/core/remote-catalog-provider.d.ts.map +1 -0
  200. package/dist/core/remote-catalog-provider.js +115 -0
  201. package/dist/core/remote-catalog-provider.js.map +1 -0
  202. package/dist/core/resource-loader.d.ts +36 -0
  203. package/dist/core/resource-loader.d.ts.map +1 -1
  204. package/dist/core/resource-loader.js +159 -27
  205. package/dist/core/resource-loader.js.map +1 -1
  206. package/dist/core/runtime-credentials.d.ts +15 -0
  207. package/dist/core/runtime-credentials.d.ts.map +1 -0
  208. package/dist/core/runtime-credentials.js +35 -0
  209. package/dist/core/runtime-credentials.js.map +1 -0
  210. package/dist/core/sandbox/bash-operations.d.ts +149 -0
  211. package/dist/core/sandbox/bash-operations.d.ts.map +1 -0
  212. package/dist/core/sandbox/bash-operations.js +163 -0
  213. package/dist/core/sandbox/bash-operations.js.map +1 -0
  214. package/dist/core/sandbox/env.d.ts +83 -0
  215. package/dist/core/sandbox/env.d.ts.map +1 -0
  216. package/dist/core/sandbox/env.js +123 -0
  217. package/dist/core/sandbox/env.js.map +1 -0
  218. package/dist/core/sandbox/executor.d.ts +104 -0
  219. package/dist/core/sandbox/executor.d.ts.map +1 -0
  220. package/dist/core/sandbox/executor.js +92 -0
  221. package/dist/core/sandbox/executor.js.map +1 -0
  222. package/dist/core/sandbox/index.d.ts +36 -0
  223. package/dist/core/sandbox/index.d.ts.map +1 -0
  224. package/dist/core/sandbox/index.js +36 -0
  225. package/dist/core/sandbox/index.js.map +1 -0
  226. package/dist/core/sandbox/linux.d.ts +121 -0
  227. package/dist/core/sandbox/linux.d.ts.map +1 -0
  228. package/dist/core/sandbox/linux.js +260 -0
  229. package/dist/core/sandbox/linux.js.map +1 -0
  230. package/dist/core/sandbox/policy.d.ts +142 -0
  231. package/dist/core/sandbox/policy.d.ts.map +1 -0
  232. package/dist/core/sandbox/policy.js +297 -0
  233. package/dist/core/sandbox/policy.js.map +1 -0
  234. package/dist/core/sandbox/real-path.d.ts +112 -0
  235. package/dist/core/sandbox/real-path.d.ts.map +1 -0
  236. package/dist/core/sandbox/real-path.js +158 -0
  237. package/dist/core/sandbox/real-path.js.map +1 -0
  238. package/dist/core/sandbox/seatbelt-profile.d.ts +95 -0
  239. package/dist/core/sandbox/seatbelt-profile.d.ts.map +1 -0
  240. package/dist/core/sandbox/seatbelt-profile.js +239 -0
  241. package/dist/core/sandbox/seatbelt-profile.js.map +1 -0
  242. package/dist/core/sandbox/seatbelt.d.ts +95 -0
  243. package/dist/core/sandbox/seatbelt.d.ts.map +1 -0
  244. package/dist/core/sandbox/seatbelt.js +154 -0
  245. package/dist/core/sandbox/seatbelt.js.map +1 -0
  246. package/dist/core/sandbox/self-test.d.ts +109 -0
  247. package/dist/core/sandbox/self-test.d.ts.map +1 -0
  248. package/dist/core/sandbox/self-test.js +369 -0
  249. package/dist/core/sandbox/self-test.js.map +1 -0
  250. package/dist/core/sandbox/spawn.d.ts +33 -0
  251. package/dist/core/sandbox/spawn.d.ts.map +1 -0
  252. package/dist/core/sandbox/spawn.js +87 -0
  253. package/dist/core/sandbox/spawn.js.map +1 -0
  254. package/dist/core/sdk.d.ts +3 -6
  255. package/dist/core/sdk.d.ts.map +1 -1
  256. package/dist/core/sdk.js +25 -22
  257. package/dist/core/sdk.js.map +1 -1
  258. package/dist/core/session-manager.d.ts +74 -7
  259. package/dist/core/session-manager.d.ts.map +1 -1
  260. package/dist/core/session-manager.js +169 -34
  261. package/dist/core/session-manager.js.map +1 -1
  262. package/dist/core/settings-manager.d.ts +22 -1
  263. package/dist/core/settings-manager.d.ts.map +1 -1
  264. package/dist/core/settings-manager.js +36 -16
  265. package/dist/core/settings-manager.js.map +1 -1
  266. package/dist/core/skills.d.ts +3 -1
  267. package/dist/core/skills.d.ts.map +1 -1
  268. package/dist/core/skills.js +19 -6
  269. package/dist/core/skills.js.map +1 -1
  270. package/dist/core/slash-commands.d.ts.map +1 -1
  271. package/dist/core/slash-commands.js +1 -0
  272. package/dist/core/slash-commands.js.map +1 -1
  273. package/dist/core/soak/soak-log.d.ts +298 -0
  274. package/dist/core/soak/soak-log.d.ts.map +1 -0
  275. package/dist/core/soak/soak-log.js +660 -0
  276. package/dist/core/soak/soak-log.js.map +1 -0
  277. package/dist/core/soak/soak-reader.d.ts +60 -0
  278. package/dist/core/soak/soak-reader.d.ts.map +1 -0
  279. package/dist/core/soak/soak-reader.js +106 -0
  280. package/dist/core/soak/soak-reader.js.map +1 -0
  281. package/dist/core/socket-server/discovery.d.ts +78 -1
  282. package/dist/core/socket-server/discovery.d.ts.map +1 -1
  283. package/dist/core/socket-server/discovery.js +356 -37
  284. package/dist/core/socket-server/discovery.js.map +1 -1
  285. package/dist/core/socket-server/index.d.ts +10 -4
  286. package/dist/core/socket-server/index.d.ts.map +1 -1
  287. package/dist/core/socket-server/index.js +6 -3
  288. package/dist/core/socket-server/index.js.map +1 -1
  289. package/dist/core/socket-server/permission-delivery.d.ts +125 -0
  290. package/dist/core/socket-server/permission-delivery.d.ts.map +1 -0
  291. package/dist/core/socket-server/permission-delivery.js +152 -0
  292. package/dist/core/socket-server/permission-delivery.js.map +1 -0
  293. package/dist/core/socket-server/permission-registry.d.ts +301 -0
  294. package/dist/core/socket-server/permission-registry.d.ts.map +1 -0
  295. package/dist/core/socket-server/permission-registry.js +410 -0
  296. package/dist/core/socket-server/permission-registry.js.map +1 -0
  297. package/dist/core/socket-server/permission-relay.d.ts +81 -0
  298. package/dist/core/socket-server/permission-relay.d.ts.map +1 -0
  299. package/dist/core/socket-server/permission-relay.js +528 -0
  300. package/dist/core/socket-server/permission-relay.js.map +1 -0
  301. package/dist/core/socket-server/safe-text.d.ts +83 -0
  302. package/dist/core/socket-server/safe-text.d.ts.map +1 -0
  303. package/dist/core/socket-server/safe-text.js +277 -0
  304. package/dist/core/socket-server/safe-text.js.map +1 -0
  305. package/dist/core/socket-server/session-integration.d.ts +65 -2
  306. package/dist/core/socket-server/session-integration.d.ts.map +1 -1
  307. package/dist/core/socket-server/session-integration.js +434 -32
  308. package/dist/core/socket-server/session-integration.js.map +1 -1
  309. package/dist/core/socket-server/socket-client.d.ts +21 -2
  310. package/dist/core/socket-server/socket-client.d.ts.map +1 -1
  311. package/dist/core/socket-server/socket-client.js +52 -1
  312. package/dist/core/socket-server/socket-client.js.map +1 -1
  313. package/dist/core/socket-server/socket-server.d.ts +152 -1
  314. package/dist/core/socket-server/socket-server.d.ts.map +1 -1
  315. package/dist/core/socket-server/socket-server.js +775 -26
  316. package/dist/core/socket-server/socket-server.js.map +1 -1
  317. package/dist/core/socket-server/types.d.ts +106 -2
  318. package/dist/core/socket-server/types.d.ts.map +1 -1
  319. package/dist/core/socket-server/types.js +13 -1
  320. package/dist/core/socket-server/types.js.map +1 -1
  321. package/dist/core/system-prompt.d.ts.map +1 -1
  322. package/dist/core/system-prompt.js +10 -21
  323. package/dist/core/system-prompt.js.map +1 -1
  324. package/dist/core/tools/bash.d.ts +3 -1
  325. package/dist/core/tools/bash.d.ts.map +1 -1
  326. package/dist/core/tools/bash.js +39 -7
  327. package/dist/core/tools/bash.js.map +1 -1
  328. package/dist/core/tools/edit.d.ts.map +1 -1
  329. package/dist/core/tools/edit.js +17 -2
  330. package/dist/core/tools/edit.js.map +1 -1
  331. package/dist/core/tools/find.d.ts +3 -0
  332. package/dist/core/tools/find.d.ts.map +1 -1
  333. package/dist/core/tools/find.js +11 -18
  334. package/dist/core/tools/find.js.map +1 -1
  335. package/dist/core/tools/read.js +1 -1
  336. package/dist/core/tools/read.js.map +1 -1
  337. package/dist/core/tools/tool-definition-wrapper.d.ts.map +1 -1
  338. package/dist/core/tools/tool-definition-wrapper.js +3 -1
  339. package/dist/core/tools/tool-definition-wrapper.js.map +1 -1
  340. package/dist/core/trust-manager.d.ts +6 -4
  341. package/dist/core/trust-manager.d.ts.map +1 -1
  342. package/dist/core/trust-manager.js +55 -21
  343. package/dist/core/trust-manager.js.map +1 -1
  344. package/dist/core/usage-totals.d.ts +19 -0
  345. package/dist/core/usage-totals.d.ts.map +1 -0
  346. package/dist/core/usage-totals.js +52 -0
  347. package/dist/core/usage-totals.js.map +1 -0
  348. package/dist/extensions/index.d.ts +3 -0
  349. package/dist/extensions/index.d.ts.map +1 -0
  350. package/dist/extensions/index.js +7 -0
  351. package/dist/extensions/index.js.map +1 -0
  352. package/dist/extensions/llama/client.d.ts +61 -0
  353. package/dist/extensions/llama/client.d.ts.map +1 -0
  354. package/dist/extensions/llama/client.js +300 -0
  355. package/dist/extensions/llama/client.js.map +1 -0
  356. package/dist/extensions/llama/huggingface.d.ts +23 -0
  357. package/dist/extensions/llama/huggingface.d.ts.map +1 -0
  358. package/dist/extensions/llama/huggingface.js +139 -0
  359. package/dist/extensions/llama/huggingface.js.map +1 -0
  360. package/dist/extensions/llama/index.d.ts +3 -0
  361. package/dist/extensions/llama/index.d.ts.map +1 -0
  362. package/dist/extensions/llama/index.js +208 -0
  363. package/dist/extensions/llama/index.js.map +1 -0
  364. package/dist/extensions/llama/provider.d.ts +10 -0
  365. package/dist/extensions/llama/provider.d.ts.map +1 -0
  366. package/dist/extensions/llama/provider.js +111 -0
  367. package/dist/extensions/llama/provider.js.map +1 -0
  368. package/dist/extensions/llama/ui.d.ts +42 -0
  369. package/dist/extensions/llama/ui.d.ts.map +1 -0
  370. package/dist/extensions/llama/ui.js +400 -0
  371. package/dist/extensions/llama/ui.js.map +1 -0
  372. package/dist/extensions/stub-provider/index.d.ts +9 -0
  373. package/dist/extensions/stub-provider/index.d.ts.map +1 -0
  374. package/dist/extensions/stub-provider/index.js +13 -0
  375. package/dist/extensions/stub-provider/index.js.map +1 -0
  376. package/dist/extensions/stub-provider/provider.d.ts +77 -0
  377. package/dist/extensions/stub-provider/provider.d.ts.map +1 -0
  378. package/dist/extensions/stub-provider/provider.js +193 -0
  379. package/dist/extensions/stub-provider/provider.js.map +1 -0
  380. package/dist/hooks/gsd/draht-quality-gate.js +3 -3
  381. package/dist/index.d.ts +4 -3
  382. package/dist/index.d.ts.map +1 -1
  383. package/dist/index.js +3 -3
  384. package/dist/index.js.map +1 -1
  385. package/dist/main.d.ts.map +1 -1
  386. package/dist/main.js +305 -61
  387. package/dist/main.js.map +1 -1
  388. package/dist/modes/interactive/components/assistant-message.d.ts.map +1 -1
  389. package/dist/modes/interactive/components/assistant-message.js +22 -10
  390. package/dist/modes/interactive/components/assistant-message.js.map +1 -1
  391. package/dist/modes/interactive/components/config-selector.d.ts.map +1 -1
  392. package/dist/modes/interactive/components/config-selector.js +3 -2
  393. package/dist/modes/interactive/components/config-selector.js.map +1 -1
  394. package/dist/modes/interactive/components/custom-editor.js +1 -1
  395. package/dist/modes/interactive/components/custom-editor.js.map +1 -1
  396. package/dist/modes/interactive/components/custom-message.d.ts +3 -1
  397. package/dist/modes/interactive/components/custom-message.d.ts.map +1 -1
  398. package/dist/modes/interactive/components/custom-message.js +9 -2
  399. package/dist/modes/interactive/components/custom-message.js.map +1 -1
  400. package/dist/modes/interactive/components/extension-editor.d.ts +1 -2
  401. package/dist/modes/interactive/components/extension-editor.d.ts.map +1 -1
  402. package/dist/modes/interactive/components/extension-editor.js +16 -46
  403. package/dist/modes/interactive/components/extension-editor.js.map +1 -1
  404. package/dist/modes/interactive/components/extension-selector.d.ts +49 -0
  405. package/dist/modes/interactive/components/extension-selector.d.ts.map +1 -1
  406. package/dist/modes/interactive/components/extension-selector.js +202 -5
  407. package/dist/modes/interactive/components/extension-selector.js.map +1 -1
  408. package/dist/modes/interactive/components/footer.d.ts.map +1 -1
  409. package/dist/modes/interactive/components/footer.js +24 -23
  410. package/dist/modes/interactive/components/footer.js.map +1 -1
  411. package/dist/modes/interactive/components/login-dialog.d.ts +5 -5
  412. package/dist/modes/interactive/components/login-dialog.d.ts.map +1 -1
  413. package/dist/modes/interactive/components/login-dialog.js +17 -8
  414. package/dist/modes/interactive/components/login-dialog.js.map +1 -1
  415. package/dist/modes/interactive/components/model-selector.d.ts +11 -4
  416. package/dist/modes/interactive/components/model-selector.d.ts.map +1 -1
  417. package/dist/modes/interactive/components/model-selector.js +74 -41
  418. package/dist/modes/interactive/components/model-selector.js.map +1 -1
  419. package/dist/modes/interactive/components/oauth-selector.d.ts +4 -4
  420. package/dist/modes/interactive/components/oauth-selector.d.ts.map +1 -1
  421. package/dist/modes/interactive/components/oauth-selector.js +14 -25
  422. package/dist/modes/interactive/components/oauth-selector.js.map +1 -1
  423. package/dist/modes/interactive/components/scoped-models-selector.d.ts.map +1 -1
  424. package/dist/modes/interactive/components/scoped-models-selector.js +22 -13
  425. package/dist/modes/interactive/components/scoped-models-selector.js.map +1 -1
  426. package/dist/modes/interactive/components/session-selector.d.ts.map +1 -1
  427. package/dist/modes/interactive/components/session-selector.js +10 -2
  428. package/dist/modes/interactive/components/session-selector.js.map +1 -1
  429. package/dist/modes/interactive/components/settings-selector.d.ts +2 -0
  430. package/dist/modes/interactive/components/settings-selector.d.ts.map +1 -1
  431. package/dist/modes/interactive/components/settings-selector.js +10 -0
  432. package/dist/modes/interactive/components/settings-selector.js.map +1 -1
  433. package/dist/modes/interactive/components/tool-execution.d.ts.map +1 -1
  434. package/dist/modes/interactive/components/tool-execution.js +10 -1
  435. package/dist/modes/interactive/components/tool-execution.js.map +1 -1
  436. package/dist/modes/interactive/components/tree-selector.d.ts +25 -2
  437. package/dist/modes/interactive/components/tree-selector.d.ts.map +1 -1
  438. package/dist/modes/interactive/components/tree-selector.js +68 -17
  439. package/dist/modes/interactive/components/tree-selector.js.map +1 -1
  440. package/dist/modes/interactive/external-editor.d.ts +12 -0
  441. package/dist/modes/interactive/external-editor.d.ts.map +1 -0
  442. package/dist/modes/interactive/external-editor.js +37 -0
  443. package/dist/modes/interactive/external-editor.js.map +1 -0
  444. package/dist/modes/interactive/interactive-mode.d.ts +107 -10
  445. package/dist/modes/interactive/interactive-mode.d.ts.map +1 -1
  446. package/dist/modes/interactive/interactive-mode.js +763 -285
  447. package/dist/modes/interactive/interactive-mode.js.map +1 -1
  448. package/dist/modes/rpc/rpc-client.d.ts +4 -0
  449. package/dist/modes/rpc/rpc-client.d.ts.map +1 -1
  450. package/dist/modes/rpc/rpc-client.js +7 -0
  451. package/dist/modes/rpc/rpc-client.js.map +1 -1
  452. package/dist/modes/rpc/rpc-mode.d.ts.map +1 -1
  453. package/dist/modes/rpc/rpc-mode.js +185 -9
  454. package/dist/modes/rpc/rpc-mode.js.map +1 -1
  455. package/dist/modes/rpc/rpc-types.d.ts +79 -1
  456. package/dist/modes/rpc/rpc-types.d.ts.map +1 -1
  457. package/dist/modes/rpc/rpc-types.js.map +1 -1
  458. package/dist/package-manager-cli.d.ts.map +1 -1
  459. package/dist/package-manager-cli.js +67 -5
  460. package/dist/package-manager-cli.js.map +1 -1
  461. package/dist/prompts/commands/atomic-commit.md +1 -12
  462. package/dist/prompts/commands/brainstorm.md +12 -15
  463. package/dist/prompts/commands/create-verification-skill.md +108 -0
  464. package/dist/prompts/commands/discuss-phase.md +3 -14
  465. package/dist/prompts/commands/execute-phase.md +3 -11
  466. package/dist/prompts/commands/fix.md +41 -18
  467. package/dist/prompts/commands/grill.md +66 -0
  468. package/dist/prompts/commands/init-project.md +5 -15
  469. package/dist/prompts/commands/map-codebase.md +1 -13
  470. package/dist/prompts/commands/new-project.md +5 -15
  471. package/dist/prompts/commands/next-milestone.md +1 -13
  472. package/dist/prompts/commands/orchestrate.md +1 -1
  473. package/dist/prompts/commands/pause-work.md +1 -13
  474. package/dist/prompts/commands/plan-phase.md +2 -11
  475. package/dist/prompts/commands/progress.md +0 -13
  476. package/dist/prompts/commands/quick.md +3 -11
  477. package/dist/prompts/commands/resolve-conflicts.md +71 -0
  478. package/dist/prompts/commands/resume-work.md +0 -13
  479. package/dist/prompts/commands/review.md +4 -13
  480. package/dist/prompts/commands/triage.md +159 -0
  481. package/dist/prompts/commands/verify-work.md +4 -14
  482. package/dist/prompts/commands/why.md +135 -0
  483. package/dist/skills/atomic-reasoning/SKILL.md +115 -0
  484. package/dist/skills/blast-radius/SKILL.md +55 -0
  485. package/dist/skills/epistemics/SKILL.md +99 -0
  486. package/dist/skills/hexagon-animation/SKILL.md +49 -0
  487. package/dist/skills/hexagon-animation/generate.mjs +81 -0
  488. package/dist/skills/hexagon-animation/template.html +361 -0
  489. package/dist/skills/typescript-discipline/SKILL.md +50 -0
  490. package/dist/skills/typescript-discipline/references/patterns.md +294 -0
  491. package/dist/skills/unslop/SKILL.md +101 -0
  492. package/dist/utils/canonical-path.d.ts +28 -0
  493. package/dist/utils/canonical-path.d.ts.map +1 -0
  494. package/dist/utils/canonical-path.js +90 -0
  495. package/dist/utils/canonical-path.js.map +1 -0
  496. package/dist/utils/child-process.d.ts +12 -1
  497. package/dist/utils/child-process.d.ts.map +1 -1
  498. package/dist/utils/child-process.js +25 -8
  499. package/dist/utils/child-process.js.map +1 -1
  500. package/dist/utils/clipboard-native.d.ts +1 -0
  501. package/dist/utils/clipboard-native.d.ts.map +1 -1
  502. package/dist/utils/clipboard-native.js.map +1 -1
  503. package/dist/utils/clipboard.d.ts +2 -0
  504. package/dist/utils/clipboard.d.ts.map +1 -1
  505. package/dist/utils/clipboard.js +53 -9
  506. package/dist/utils/clipboard.js.map +1 -1
  507. package/dist/utils/exif-orientation.d.ts.map +1 -1
  508. package/dist/utils/exif-orientation.js +2 -3
  509. package/dist/utils/exif-orientation.js.map +1 -1
  510. package/dist/utils/paths.d.ts +2 -7
  511. package/dist/utils/paths.d.ts.map +1 -1
  512. package/dist/utils/paths.js +13 -15
  513. package/dist/utils/paths.js.map +1 -1
  514. package/dist/utils/shell.d.ts.map +1 -1
  515. package/dist/utils/shell.js +6 -4
  516. package/dist/utils/shell.js.map +1 -1
  517. package/dist/utils/tools-manager.d.ts.map +1 -1
  518. package/dist/utils/tools-manager.js +3 -5
  519. package/dist/utils/tools-manager.js.map +1 -1
  520. package/dist/utils/version-check.d.ts.map +1 -1
  521. package/dist/utils/version-check.js +3 -1
  522. package/dist/utils/version-check.js.map +1 -1
  523. package/docs/attachable-sessions.md +79 -0
  524. package/docs/compaction.md +29 -24
  525. package/docs/containerization.md +23 -23
  526. package/docs/custom-provider.md +66 -32
  527. package/docs/development.md +9 -9
  528. package/docs/docs.json +6 -2
  529. package/docs/duet.md +42 -0
  530. package/docs/environment-variables.md +88 -0
  531. package/docs/extensions.md +278 -65
  532. package/docs/index.md +12 -10
  533. package/docs/json.md +12 -8
  534. package/docs/keybindings.md +8 -5
  535. package/docs/llama-cpp.md +99 -0
  536. package/docs/models.md +19 -8
  537. package/docs/packages.md +43 -42
  538. package/docs/prompt-templates.md +5 -4
  539. package/docs/providers.md +45 -11
  540. package/docs/quickstart.md +33 -33
  541. package/docs/rpc.md +190 -19
  542. package/docs/sdk.md +18 -15
  543. package/docs/security.md +18 -18
  544. package/docs/session-format.md +53 -15
  545. package/docs/sessions.md +17 -14
  546. package/docs/settings.md +26 -19
  547. package/docs/shell-aliases.md +2 -2
  548. package/docs/skills.md +12 -11
  549. package/docs/terminal-setup.md +12 -12
  550. package/docs/termux.md +6 -6
  551. package/docs/themes.md +11 -11
  552. package/docs/tmux.md +4 -4
  553. package/docs/tui.md +46 -31
  554. package/docs/usage.md +53 -63
  555. package/docs/windows.md +2 -2
  556. package/examples/extensions/custom-compaction.ts +4 -0
  557. package/examples/extensions/custom-provider-anthropic/index.ts +9 -3
  558. package/examples/extensions/custom-provider-anthropic/package.json +1 -1
  559. package/examples/extensions/custom-provider-gitlab-duo/package.json +1 -1
  560. package/examples/extensions/custom-provider-qwen-cli/package.json +1 -1
  561. package/examples/extensions/gondolin/package.json +2 -2
  562. package/examples/extensions/handoff.ts +9 -1
  563. package/examples/extensions/kimi-deferred-tools.ts +61 -0
  564. package/examples/extensions/message-renderer.ts +2 -2
  565. package/examples/extensions/overlay-qa-tests.ts +3 -3
  566. package/examples/extensions/sandbox/package.json +1 -1
  567. package/examples/extensions/summarize.ts +3 -0
  568. package/examples/extensions/with-deps/package.json +1 -1
  569. package/examples/sdk/02-custom-model.ts +5 -8
  570. package/examples/sdk/09-api-keys-and-oauth.ts +15 -31
  571. package/examples/sdk/12-full-control.ts +9 -12
  572. package/hooks/gsd/draht-quality-gate.js +3 -3
  573. package/package.json +14 -11
  574. package/prompts/commands/atomic-commit.md +1 -12
  575. package/prompts/commands/brainstorm.md +12 -15
  576. package/prompts/commands/create-verification-skill.md +108 -0
  577. package/prompts/commands/discuss-phase.md +3 -14
  578. package/prompts/commands/execute-phase.md +3 -11
  579. package/prompts/commands/fix.md +41 -18
  580. package/prompts/commands/grill.md +66 -0
  581. package/prompts/commands/init-project.md +5 -15
  582. package/prompts/commands/map-codebase.md +1 -13
  583. package/prompts/commands/new-project.md +5 -15
  584. package/prompts/commands/next-milestone.md +1 -13
  585. package/prompts/commands/orchestrate.md +1 -1
  586. package/prompts/commands/pause-work.md +1 -13
  587. package/prompts/commands/plan-phase.md +2 -11
  588. package/prompts/commands/progress.md +0 -13
  589. package/prompts/commands/quick.md +3 -11
  590. package/prompts/commands/resolve-conflicts.md +71 -0
  591. package/prompts/commands/resume-work.md +0 -13
  592. package/prompts/commands/review.md +4 -13
  593. package/prompts/commands/triage.md +159 -0
  594. package/prompts/commands/verify-work.md +4 -14
  595. package/prompts/commands/why.md +135 -0
  596. package/skills/atomic-reasoning/SKILL.md +115 -0
  597. package/skills/blast-radius/SKILL.md +55 -0
  598. package/skills/epistemics/SKILL.md +99 -0
  599. package/skills/hexagon-animation/SKILL.md +49 -0
  600. package/skills/hexagon-animation/generate.mjs +81 -0
  601. package/skills/hexagon-animation/template.html +361 -0
  602. package/skills/typescript-discipline/SKILL.md +50 -0
  603. package/skills/typescript-discipline/references/patterns.md +294 -0
  604. package/skills/unslop/SKILL.md +101 -0
  605. package/dist/core/provider-display-names.d.ts +0 -2
  606. package/dist/core/provider-display-names.d.ts.map +0 -1
  607. package/dist/core/provider-display-names.js +0 -36
  608. package/dist/core/provider-display-names.js.map +0 -1
  609. package/dist/prompts/agents/build.md +0 -86
  610. package/dist/prompts/agents/plan.md +0 -79
  611. package/dist/prompts/agents/verify.md +0 -69
  612. package/prompts/agents/build.md +0 -86
  613. package/prompts/agents/plan.md +0 -79
  614. package/prompts/agents/verify.md +0 -69
package/docs/themes.md CHANGED
@@ -1,4 +1,4 @@
1
- > pi can create themes. Ask it to build one for your setup.
1
+ > draht can create themes. Ask it to build one for your setup.
2
2
 
3
3
  # Themes
4
4
 
@@ -16,11 +16,11 @@ Themes are JSON files that define colors for the TUI.
16
16
 
17
17
  ## Locations
18
18
 
19
- Pi loads themes from:
19
+ draht loads themes from:
20
20
 
21
21
  - Built-in: `dark`, `light`
22
- - Global: `~/.pi/agent/themes/*.json`
23
- - Project: `.pi/themes/*.json` (only after the project is trusted)
22
+ - Global: `~/.draht/agent/themes/*.json`
23
+ - Project: `.draht/themes/*.json` (only after the project is trusted)
24
24
  - Packages: `themes/` directories or `pi.themes` entries in `package.json`
25
25
  - Settings: `themes` array with files or directories
26
26
  - CLI: `--theme <path>` (repeatable)
@@ -37,22 +37,22 @@ Select a theme via `/settings` or in `settings.json`:
37
37
  }
38
38
  ```
39
39
 
40
- On first run, pi detects your terminal background and defaults to `dark` or `light`.
40
+ On first run, draht detects your terminal background and defaults to `dark` or `light`.
41
41
 
42
42
  ## Creating a Custom Theme
43
43
 
44
44
  1. Create a theme file:
45
45
 
46
46
  ```bash
47
- mkdir -p ~/.pi/agent/themes
48
- vim ~/.pi/agent/themes/my-theme.json
47
+ mkdir -p ~/.draht/agent/themes
48
+ vim ~/.draht/agent/themes/my-theme.json
49
49
  ```
50
50
 
51
51
  2. Define the theme with all required colors (see [Color Tokens](#color-tokens)):
52
52
 
53
53
  ```json
54
54
  {
55
- "$schema": "https://raw.githubusercontent.com/earendil-works/pi/main/packages/coding-agent/src/modes/interactive/theme/theme-schema.json",
55
+ "$schema": "https://raw.githubusercontent.com/draht-dev/draht/main/packages/coding-agent/src/modes/interactive/theme/theme-schema.json",
56
56
  "name": "my-theme",
57
57
  "vars": {
58
58
  "primary": "#00aaff",
@@ -117,13 +117,13 @@ vim ~/.pi/agent/themes/my-theme.json
117
117
 
118
118
  3. Select the theme via `/settings`.
119
119
 
120
- **Hot reload:** When you edit the currently active custom theme file, pi reloads it automatically for immediate visual feedback.
120
+ **Hot reload:** When you edit the currently active custom theme file, draht reloads it automatically for immediate visual feedback.
121
121
 
122
122
  ## Theme Format
123
123
 
124
124
  ```json
125
125
  {
126
- "$schema": "https://raw.githubusercontent.com/earendil-works/pi/main/packages/coding-agent/src/modes/interactive/theme/theme-schema.json",
126
+ "$schema": "https://raw.githubusercontent.com/draht-dev/draht/main/packages/coding-agent/src/modes/interactive/theme/theme-schema.json",
127
127
  "name": "my-theme",
128
128
  "vars": {
129
129
  "blue": "#0066cc",
@@ -270,7 +270,7 @@ Four formats are supported:
270
270
 
271
271
  ### Terminal Compatibility
272
272
 
273
- Pi uses 24-bit RGB colors. Most modern terminals support this (iTerm2, Kitty, WezTerm, Windows Terminal, VS Code). For older terminals with only 256-color support, pi falls back to the nearest approximation.
273
+ draht uses 24-bit RGB colors. Most modern terminals support this (iTerm2, Kitty, WezTerm, Windows Terminal, VS Code). For older terminals with only 256-color support, draht falls back to the nearest approximation.
274
274
 
275
275
  Check truecolor support:
276
276
 
package/docs/tmux.md CHANGED
@@ -1,6 +1,6 @@
1
1
  # tmux Setup
2
2
 
3
- Pi works inside tmux, but tmux strips modifier information from certain keys by default. Without configuration, `Shift+Enter` and `Ctrl+Enter` are usually indistinguishable from plain `Enter`.
3
+ draht works inside tmux, but tmux strips modifier information from certain keys by default. Without configuration, `Shift+Enter` and `Ctrl+Enter` are usually indistinguishable from plain `Enter`.
4
4
 
5
5
  ## Recommended Configuration
6
6
 
@@ -18,7 +18,7 @@ tmux kill-server
18
18
  tmux
19
19
  ```
20
20
 
21
- Pi requests extended key reporting automatically when Kitty keyboard protocol is not available. With `extended-keys-format csi-u`, tmux forwards modified keys in CSI-u format, which is the most reliable configuration. The `extended-keys-format` option requires tmux 3.5 or later.
21
+ draht requests extended key reporting automatically when Kitty keyboard protocol is not available. With `extended-keys-format csi-u`, tmux forwards modified keys in CSI-u format, which is the most reliable configuration. The `extended-keys-format` option requires tmux 3.5 or later.
22
22
 
23
23
  ## Why `csi-u` Is Recommended
24
24
 
@@ -40,7 +40,7 @@ With `extended-keys-format csi-u`, the same keys are forwarded as:
40
40
  - `Ctrl+D` → `\x1b[100;5u`
41
41
  - `Ctrl+Enter` → `\x1b[13;5u`
42
42
 
43
- Pi supports both formats, but `csi-u` is the recommended tmux setup.
43
+ draht supports both formats, but `csi-u` is the recommended tmux setup.
44
44
 
45
45
  ## What This Fixes
46
46
 
@@ -60,4 +60,4 @@ This affects the default keybindings (`Enter` to submit, `Shift+Enter` for newli
60
60
  - tmux 3.5 or later for `extended-keys-format csi-u` (run `tmux -V` to check)
61
61
  - A terminal emulator that supports extended keys (Ghostty, Kitty, iTerm2, WezTerm, Windows Terminal)
62
62
 
63
- With tmux 3.2 through 3.4, omit `extended-keys-format csi-u`; Pi still supports tmux's default xterm `modifyOtherKeys` format.
63
+ With tmux 3.2 through 3.4, omit `extended-keys-format csi-u`; draht still supports tmux's default xterm `modifyOtherKeys` format.
package/docs/tui.md CHANGED
@@ -1,10 +1,10 @@
1
- > pi can create TUI components. Ask it to build one for your use case.
1
+ > draht can create TUI components. Ask it to build one for your use case.
2
2
 
3
3
  # TUI Components
4
4
 
5
5
  Extensions and custom tools can render custom TUI components for interactive user interfaces. This page covers the component system and available building blocks.
6
6
 
7
- **Source:** [`@draht/tui`](https://github.com/earendil-works/pi-mono/tree/main/packages/tui)
7
+ **Source:** [`@draht/tui`](https://github.com/draht-dev/draht/tree/main/packages/tui)
8
8
 
9
9
  ## Component Interface
10
10
 
@@ -52,7 +52,7 @@ When a `Focusable` component has focus, TUI:
52
52
  3. Positions the hardware terminal cursor at that location
53
53
  4. Shows the hardware cursor only when `showHardwareCursor` is enabled
54
54
 
55
- The cursor remains hidden by default. This keeps the fake cursor rendering, while still positioning the hardware cursor for terminals that track IME candidate windows with hidden cursors. Some terminals require a visible hardware cursor for IME positioning; enable it with `showHardwareCursor`, `setShowHardwareCursor(true)`, or `PI_HARDWARE_CURSOR=1`. The `Editor` and `Input` built-in components already implement this interface.
55
+ The cursor remains hidden by default. This keeps the fake cursor rendering, while still positioning the hardware cursor for terminals that track IME candidate windows with hidden cursors. Some terminals require a visible hardware cursor for IME positioning; enable it with `showHardwareCursor`, `setShowHardwareCursor(true)`, or `DRAHT_HARDWARE_CURSOR=1`. The `Editor` and `Input` built-in components already implement this interface.
56
56
 
57
57
  ### Container Components with Embedded Inputs
58
58
 
@@ -90,19 +90,32 @@ Without this propagation, typing with an IME (Chinese, Japanese, Korean, etc.) w
90
90
 
91
91
  ```typescript
92
92
  pi.on("session_start", async (_event, ctx) => {
93
- const handle = ctx.ui.custom(myComponent);
94
- // handle.requestRender() - trigger re-render
95
- // handle.close() - restore normal UI
93
+ const result = await ctx.ui.custom<string | null>((tui, theme, keybindings, done) =>
94
+ new MyComponent({
95
+ theme,
96
+ keybindings,
97
+ onChange: () => tui.requestRender(),
98
+ onSelect: (value) => done(value),
99
+ onCancel: () => done(null),
100
+ })
101
+ );
96
102
  });
97
103
  ```
98
104
 
99
- **In custom tools** via `pi.ui.custom()`:
105
+ **In custom tools** via `ctx.ui.custom()`:
100
106
 
101
107
  ```typescript
102
- async execute(toolCallId, params, onUpdate, ctx, signal) {
103
- const handle = pi.ui.custom(myComponent);
104
- // ...
105
- handle.close();
108
+ async execute(toolCallId, params, signal, onUpdate, ctx) {
109
+ const result = await ctx.ui.custom<string | null>((tui, theme, keybindings, done) =>
110
+ new MyComponent({
111
+ theme,
112
+ keybindings,
113
+ onChange: () => tui.requestRender(),
114
+ onSelect: (value) => done(value),
115
+ onCancel: () => done(null),
116
+ })
117
+ );
118
+ // Use result...
106
119
  }
107
120
  ```
108
121
 
@@ -374,24 +387,26 @@ Usage in an extension:
374
387
  ```typescript
375
388
  pi.registerCommand("pick", {
376
389
  description: "Pick an item",
377
- handler: async (args, ctx) => {
390
+ handler: async (_args, ctx) => {
378
391
  const items = ["Option A", "Option B", "Option C"];
379
- const selector = new MySelector(items);
380
-
381
- let handle: { close: () => void; requestRender: () => void };
382
-
383
- await new Promise<void>((resolve) => {
384
- selector.onSelect = (item) => {
385
- ctx.ui.notify(`Selected: ${item}`, "info");
386
- handle.close();
387
- resolve();
388
- };
389
- selector.onCancel = () => {
390
- handle.close();
391
- resolve();
392
+ const selected = await ctx.ui.custom<string | null>((tui, _theme, _keybindings, done) => {
393
+ const selector = new MySelector(items);
394
+ selector.onSelect = done;
395
+ selector.onCancel = () => done(null);
396
+
397
+ return {
398
+ render: (width) => selector.render(width),
399
+ handleInput: (data) => {
400
+ selector.handleInput(data);
401
+ tui.requestRender();
402
+ },
403
+ invalidate: () => selector.invalidate(),
392
404
  };
393
- handle = ctx.ui.custom(selector);
394
405
  });
406
+
407
+ if (selected !== null) {
408
+ ctx.ui.notify(`Selected: ${selected}`, "info");
409
+ }
395
410
  }
396
411
  });
397
412
  ```
@@ -486,7 +501,7 @@ class CachedComponent {
486
501
  }
487
502
  ```
488
503
 
489
- Call `invalidate()` when state changes, then `handle.requestRender()` to trigger re-render.
504
+ Call `invalidate()` when state changes, then use the injected `tui.requestRender()` to trigger re-render.
490
505
 
491
506
  ## Invalidation and Theme Changes
492
507
 
@@ -746,7 +761,7 @@ ctx.ui.setStatus("my-ext", undefined);
746
761
 
747
762
  ### Pattern 4b: Working Indicator Customization
748
763
 
749
- Customize the inline working indicator shown while pi is streaming a response.
764
+ Customize the inline working indicator shown while draht is streaming a response.
750
765
 
751
766
  ```typescript
752
767
  // Static indicator
@@ -766,7 +781,7 @@ ctx.ui.setWorkingIndicator({
766
781
  // Hide the indicator entirely
767
782
  ctx.ui.setWorkingIndicator({ frames: [] });
768
783
 
769
- // Restore pi's default spinner
784
+ // Restore draht's default spinner
770
785
  ctx.ui.setWorkingIndicator();
771
786
  ```
772
787
 
@@ -885,9 +900,9 @@ class VimEditor extends CustomEditor {
885
900
 
886
901
  export default function (pi: ExtensionAPI) {
887
902
  pi.on("session_start", (_event, ctx) => {
888
- // Factory receives theme and keybindings from the app
903
+ // Factory receives the TUI, theme, and keybindings from the app
889
904
  ctx.ui.setEditorComponent((tui, theme, keybindings) =>
890
- new VimEditor(theme, keybindings)
905
+ new VimEditor(tui, theme, keybindings)
891
906
  );
892
907
  });
893
908
  }
package/docs/usage.md CHANGED
@@ -1,4 +1,4 @@
1
- # Using Pi
1
+ # Using draht
2
2
 
3
3
  This page collects day-to-day usage details that do not fit on the quickstart page.
4
4
 
@@ -11,7 +11,7 @@ The interface has four main areas:
11
11
  - **Startup header** - shortcuts, loaded context files, prompt templates, skills, and extensions
12
12
  - **Messages** - user messages, assistant responses, tool calls, tool results, notifications, errors, and extension UI
13
13
  - **Editor** - where you type; border color indicates the current thinking level
14
- - **Footer** - working directory, session name, token/cache usage, cost, context usage, and current model
14
+ - **Footer** - working directory, session name, token/cache usage, cost, context usage, and current model. Totals include assistant responses, usage reported by tools, and summary generation.
15
15
 
16
16
  The editor can be replaced temporarily by built-in UI such as `/settings` or by custom extension UI.
17
17
 
@@ -22,6 +22,7 @@ The editor can be replaced temporarily by built-in UI such as `/settings` or by
22
22
  | File reference | Type `@` to fuzzy-search project files |
23
23
  | Path completion | Press Tab to complete paths |
24
24
  | Multi-line input | Shift+Enter, or Ctrl+Enter on Windows Terminal |
25
+ | Copy response | Ctrl+X copies the last assistant message; in `/tree`, it copies the selected message |
25
26
  | Images | Paste with Ctrl+V, Alt+V on Windows, or drag into the terminal |
26
27
  | Shell command | `!command` runs and sends output to the model |
27
28
  | Hidden shell command | `!!command` runs without sending output to the model |
@@ -36,6 +37,7 @@ Type `/` in the editor to open command completion. Extensions can register custo
36
37
  | Command | Description |
37
38
  |---------|-------------|
38
39
  | `/login`, `/logout` | Manage OAuth or API-key credentials |
40
+ | [`/llama`](llama-cpp.md) | Download, load, and unload llama.cpp router models |
39
41
  | `/model` | Switch models |
40
42
  | `/scoped-models` | Enable/disable models for Ctrl+P cycling |
41
43
  | `/settings` | Thinking level, theme, message delivery, transport |
@@ -53,7 +55,7 @@ Type `/` in the editor to open command completion. Extensions can register custo
53
55
  | `/reload` | Reload keybindings, extensions, skills, prompts, themes, and context files |
54
56
  | `/hotkeys` | Show all keyboard shortcuts |
55
57
  | `/changelog` | Display version history |
56
- | `/quit` | Quit pi |
58
+ | `/quit` | Quit draht |
57
59
 
58
60
  ## Message Queue
59
61
 
@@ -64,21 +66,21 @@ You can submit messages while the agent is still working:
64
66
  - **Escape** aborts and restores queued messages to the editor.
65
67
  - **Alt+Up** retrieves queued messages back to the editor.
66
68
 
67
- On Windows Terminal, Alt+Enter is fullscreen by default. Remap it as described in [Terminal setup](terminal-setup.md) if you want pi to receive the shortcut.
69
+ On Windows Terminal, Alt+Enter is fullscreen by default. Remap it as described in [Terminal setup](terminal-setup.md) if you want draht to receive the shortcut.
68
70
 
69
71
  Configure delivery in [Settings](settings.md) with `steeringMode` and `followUpMode`.
70
72
 
71
73
  ## Sessions
72
74
 
73
- Sessions are saved automatically to `~/.pi/agent/sessions/`, organized by working directory.
75
+ Sessions are saved automatically to `~/.draht/agent/sessions/`, organized by working directory.
74
76
 
75
77
  ```bash
76
- pi -c # Continue most recent session
77
- pi -r # Browse and select a session
78
- pi --no-session # Ephemeral mode; do not save
79
- pi --name "my task" # Set session display name at startup
80
- pi --session <path|id> # Use a specific session file or session ID
81
- pi --fork <path|id> # Fork a session into a new session file
78
+ draht -c # Continue most recent session
79
+ draht -r # Browse and select a session
80
+ draht --no-session # Ephemeral mode; do not save
81
+ draht --name "my task" # Set session display name at startup
82
+ draht --session <path|id> # Use a specific session file or session ID
83
+ draht --fork <path|id> # Fork a session into a new session file
82
84
  ```
83
85
 
84
86
  Useful session commands:
@@ -93,9 +95,9 @@ See [Sessions](sessions.md) and [Compaction](compaction.md) for details.
93
95
 
94
96
  ## Context Files
95
97
 
96
- Pi loads `AGENTS.md` or `CLAUDE.md` at startup from:
98
+ draht loads `AGENTS.md` or `CLAUDE.md` at startup from:
97
99
 
98
- - `~/.pi/agent/AGENTS.md` for global instructions
100
+ - `~/.draht/agent/AGENTS.md` for global instructions
99
101
  - parent directories, walking up from the current working directory
100
102
  - the current directory
101
103
 
@@ -105,24 +107,24 @@ Use context files for project conventions, commands, safety rules, and preferenc
105
107
 
106
108
  Replace the default system prompt with:
107
109
 
108
- - `.pi/SYSTEM.md` for a project
109
- - `~/.pi/agent/SYSTEM.md` globally
110
+ - `.draht/SYSTEM.md` for a project
111
+ - `~/.draht/agent/SYSTEM.md` globally
110
112
 
111
113
  Append to the default prompt without replacing it with `APPEND_SYSTEM.md` in either location.
112
114
 
113
115
  ### Project Trust
114
116
 
115
- On interactive startup, pi asks before trusting a project folder that contains project-local extensions or settings and has no saved decision for the folder or a parent folder in `~/.pi/agent/trust.json`. Trusting a project allows pi to load `.pi/settings.json` and `.pi` resources, install missing project packages, and execute project extensions.
117
+ On interactive startup, draht asks before trusting a project folder that contains project-local extensions or settings and has no saved decision for the folder or a parent folder in `~/.draht/agent/trust.json`. Trusting a project allows draht to load `.draht/settings.json` and `.draht` resources, install missing project packages, and execute project extensions.
116
118
 
117
- Before the trust decision, pi loads only context files, user/global extensions, and CLI `-e` extensions so they can handle the `project_trust` event. Project-local extensions, project package-managed extensions, and project settings are loaded only after the project is trusted. This split also applies when switching to a session from a different cwd whose trust has not been resolved in the current process.
119
+ Before the trust decision, draht loads only context files, user/global extensions, and CLI `-e` extensions so they can handle the `project_trust` event. Project-local extensions, project package-managed extensions, and project settings are loaded only after the project is trusted. This split also applies when switching to a session from a different cwd whose trust has not been resolved in the current process.
118
120
 
119
121
  Non-interactive modes (`-p`, `--mode json`, and `--mode rpc`) do not show a trust prompt. Without an applicable saved trust decision, they use `defaultProjectTrust` from global settings: `ask` (default) and `never` ignore trust-gated project inputs, while `always` trusts them. Pass `--approve`/`-a` or `--no-approve`/`-na` to override project trust for one run.
120
122
 
121
- If no extension or saved decision applies, `defaultProjectTrust` controls the fallback behavior. Set it to `"ask"`, `"always"`, or `"never"` in `~/.pi/agent/settings.json`, or change it with `/settings`.
123
+ If no extension or saved decision applies, `defaultProjectTrust` controls the fallback behavior. Set it to `"ask"`, `"always"`, or `"never"` in `~/.draht/agent/settings.json`, or change it with `/settings`.
122
124
 
123
- `pi config` and package commands use the same project trust flow. Pass `--approve` to trust project-local settings for one command or `--no-approve` to ignore them.
125
+ `draht config` and package commands use the same project trust flow. Pass `--approve` to trust project-local settings for one command or `--no-approve` to ignore them.
124
126
 
125
- Use `/trust` in interactive mode to save a project trust decision for future sessions, including trust for the immediate parent folder. It writes `~/.pi/agent/trust.json` only; the current session is not reloaded, so restart pi for changes to take effect.
127
+ Use `/trust` in interactive mode to save a project trust decision for future sessions, including trust for the immediate parent folder. It writes `~/.draht/agent/trust.json` only; the current session is not reloaded, so restart draht for changes to take effect.
126
128
 
127
129
 
128
130
  ## Exporting and Sharing Sessions
@@ -131,31 +133,32 @@ Use `/export [file]` to write a session to HTML.
131
133
 
132
134
  Use `/share` to upload a private GitHub gist with a shareable HTML link.
133
135
 
134
- If you use pi for open source work and want to publish sessions for model, prompt, tool, and evaluation research, see [`badlogic/pi-share-hf`](https://github.com/badlogic/pi-share-hf). It publishes sessions to Hugging Face datasets.
136
+ If you use draht for open source work and want to publish sessions for model, prompt, tool, and evaluation research, see [`badlogic/pi-share-hf`](https://github.com/badlogic/pi-share-hf). It publishes sessions to Hugging Face datasets.
135
137
 
136
138
  ## CLI Reference
137
139
 
138
140
  ```bash
139
- pi [options] [@files...] [messages...]
141
+ draht [options] [@files...] [messages...]
140
142
  ```
141
143
 
142
144
  ### Package Commands
143
145
 
144
146
  ```bash
145
- pi install <source> [-l] # Install package, -l for project-local
146
- pi remove <source> [-l] # Remove package
147
- pi uninstall <source> [-l] # Alias for remove
148
- pi update [source|self|pi] # Update pi and packages; reconcile pinned git refs
149
- pi update --extensions # Update packages only; reconcile pinned git refs
150
- pi update --self # Update pi only
151
- pi update --extension <src> # Update one package
152
- pi list # List installed packages
153
- pi config # Enable/disable package resources
147
+ draht install <source> [-l] # Install package, -l for project-local
148
+ draht remove <source> [-l] # Remove package
149
+ draht uninstall <source> [-l] # Alias for remove
150
+ draht update [source|self|pi] # Update draht and packages; reconcile pinned git refs
151
+ draht update --extensions # Update packages only; reconcile pinned git refs
152
+ draht update --models # Refresh model catalogs only
153
+ draht update --self # Update draht only
154
+ draht update --extension <src> # Update one package
155
+ draht list # List installed packages
156
+ draht config # Enable/disable package resources
154
157
  ```
155
158
 
156
- These commands manage pi packages, not the pi CLI installation. To uninstall pi itself, see [Quickstart](quickstart.md#uninstall). `pi config` and project package commands accept `--approve`/`--no-approve` to trust or ignore project-local settings for one command.
159
+ These commands manage draht packages, not the draht CLI installation. To uninstall draht itself, see [Quickstart](quickstart.md#uninstall). `draht config` and project package commands accept `--approve`/`--no-approve` to trust or ignore project-local settings for one command.
157
160
 
158
- See [Pi Packages](packages.md) for package sources and security notes.
161
+ See [draht Packages](packages.md) for package sources and security notes.
159
162
 
160
163
  ### Modes
161
164
 
@@ -167,10 +170,10 @@ See [Pi Packages](packages.md) for package sources and security notes.
167
170
  | `--mode rpc` | RPC mode over stdin/stdout; see [RPC mode](rpc.md) |
168
171
  | `--export <in> [out]` | Export a session to HTML |
169
172
 
170
- In print mode, pi also reads piped stdin and merges it into the initial prompt:
173
+ In print mode, draht also reads piped stdin and merges it into the initial prompt:
171
174
 
172
175
  ```bash
173
- cat README.md | pi -p "Summarize this text"
176
+ cat README.md | draht -p "Summarize this text"
174
177
  ```
175
178
 
176
179
  ### Model Options
@@ -224,7 +227,7 @@ Built-in tools: `read`, `bash`, `edit`, `write`, `grep`, `find`, `ls`.
224
227
  Combine `--no-*` with explicit flags to load exactly what you need, ignoring settings. Example:
225
228
 
226
229
  ```bash
227
- pi --no-extensions -e ./my-extension.ts
230
+ draht --no-extensions -e ./my-extension.ts
228
231
  ```
229
232
 
230
233
  ### Other Options
@@ -244,61 +247,48 @@ pi --no-extensions -e ./my-extension.ts
244
247
  Prefix files with `@` to include them in the message:
245
248
 
246
249
  ```bash
247
- pi @prompt.md "Answer this"
248
- pi -p @screenshot.png "What's in this image?"
249
- pi @code.ts @test.ts "Review these files"
250
+ draht @prompt.md "Answer this"
251
+ draht -p @screenshot.png "What's in this image?"
252
+ draht @code.ts @test.ts "Review these files"
250
253
  ```
251
254
 
252
255
  ### Examples
253
256
 
254
257
  ```bash
255
258
  # Interactive with initial prompt
256
- pi "List all .ts files in src/"
259
+ draht "List all .ts files in src/"
257
260
 
258
261
  # Non-interactive
259
- pi -p "Summarize this codebase"
262
+ draht -p "Summarize this codebase"
260
263
 
261
264
  # Non-interactive with piped stdin
262
- cat README.md | pi -p "Summarize this text"
265
+ cat README.md | draht -p "Summarize this text"
263
266
 
264
267
  # Named one-shot session
265
- pi --name "release audit" -p "Audit this repository"
268
+ draht --name "release audit" -p "Audit this repository"
266
269
 
267
270
  # Different model
268
- pi --provider openai --model gpt-4o "Help me refactor"
271
+ draht --provider openai --model gpt-4o "Help me refactor"
269
272
 
270
273
  # Model with provider prefix
271
- pi --model openai/gpt-4o "Help me refactor"
274
+ draht --model openai/gpt-4o "Help me refactor"
272
275
 
273
276
  # Model with thinking level shorthand
274
- pi --model sonnet:high "Solve this complex problem"
277
+ draht --model sonnet:high "Solve this complex problem"
275
278
 
276
279
  # Limit model cycling
277
- pi --models "claude-*,gpt-4o"
280
+ draht --models "claude-*,gpt-4o"
278
281
 
279
282
  # Read-only mode
280
- pi --tools read,grep,find,ls -p "Review the code"
283
+ draht --tools read,grep,find,ls -p "Review the code"
281
284
 
282
285
  # Disable one extension or built-in tool while keeping the rest available
283
- pi --exclude-tools ask_question
286
+ draht --exclude-tools ask_question
284
287
  ```
285
288
 
286
- ### Environment Variables
287
-
288
- | Variable | Description |
289
- |----------|-------------|
290
- | `PI_CODING_AGENT_DIR` | Override config directory; default is `~/.pi/agent` |
291
- | `PI_CODING_AGENT_SESSION_DIR` | Override session storage directory; overridden by `--session-dir` |
292
- | `PI_PACKAGE_DIR` | Override package directory, useful for Nix/Guix store paths |
293
- | `PI_OFFLINE` | Disable startup network operations, including update checks, package update checks, and install/update telemetry |
294
- | `PI_SKIP_VERSION_CHECK` | Skip the Pi version update check at startup. This prevents the `pi.dev` latest-version request |
295
- | `PI_TELEMETRY` | Override install/update telemetry and provider attribution headers: `1`/`true`/`yes` or `0`/`false`/`no`. This does not disable update checks |
296
- | `PI_CACHE_RETENTION` | Set to `long` for extended prompt cache where supported |
297
- | `VISUAL`, `EDITOR` | Fallback external editor for Ctrl+G when `externalEditor` is unset; defaults to Notepad on Windows and `nano` elsewhere |
298
-
299
289
  ## Design Principles
300
290
 
301
- Pi keeps the core small and pushes workflow-specific behavior into extensions, skills, prompt templates, and packages.
291
+ draht keeps the core small and pushes workflow-specific behavior into extensions, skills, prompt templates, and packages.
302
292
 
303
293
  It intentionally does not include built-in MCP, sub-agents, permission popups, plan mode, to-dos, or background bash. You can build or install those workflows as extensions or packages, or use external tools such as containers and tmux.
304
294
 
package/docs/windows.md CHANGED
@@ -1,8 +1,8 @@
1
1
  # Windows Setup
2
2
 
3
- Pi requires a bash shell on Windows. Checked locations (in order):
3
+ draht requires a bash shell on Windows. Checked locations (in order):
4
4
 
5
- 1. Custom path from `~/.pi/agent/settings.json`
5
+ 1. Custom path from `~/.draht/agent/settings.json`
6
6
  2. Git Bash (`C:\Program Files\Git\bin\bash.exe`)
7
7
  3. `bash.exe` on PATH (Cygwin, MSYS2, WSL)
8
8
 
@@ -13,6 +13,7 @@
13
13
  * pi --extension examples/extensions/custom-compaction.ts
14
14
  */
15
15
 
16
+ import { uuidv7 } from "@draht/ai";
16
17
  import { complete } from "@draht/ai/compat";
17
18
  import type { ExtensionAPI } from "@draht/coding-agent";
18
19
  import { convertToLlm, serializeConversation } from "@draht/coding-agent";
@@ -96,6 +97,8 @@ ${conversationText}
96
97
  env: auth.env,
97
98
  maxTokens: 8192,
98
99
  signal,
100
+ cacheRetention: "none",
101
+ sessionId: uuidv7(),
99
102
  },
100
103
  );
101
104
 
@@ -116,6 +119,7 @@ ${conversationText}
116
119
  summary,
117
120
  firstKeptEntryId,
118
121
  tokensBefore,
122
+ usage: response.usage,
119
123
  },
120
124
  };
121
125
  } catch (error) {
@@ -46,7 +46,7 @@ import {
46
46
  import type { ExtensionAPI } from "@draht/coding-agent";
47
47
 
48
48
  // =============================================================================
49
- // OAuth Implementation (copied from packages/ai/src/utils/oauth/anthropic.ts)
49
+ // OAuth implementation adapted for the legacy extension compatibility interface.
50
50
  // =============================================================================
51
51
 
52
52
  const decode = (s: string) => atob(s);
@@ -353,7 +353,7 @@ function streamCustomAnthropic(
353
353
  totalTokens: 0,
354
354
  cost: { input: 0, output: 0, cacheRead: 0, cacheWrite: 0, total: 0 },
355
355
  },
356
- stopReason: "stop",
356
+ stopReason: "pending",
357
357
  timestamp: Date.now(),
358
358
  };
359
359
 
@@ -546,8 +546,14 @@ function streamCustomAnthropic(
546
546
  if (options?.signal?.aborted) {
547
547
  throw new Error("Request was aborted");
548
548
  }
549
+ if (output.stopReason === "pending") {
550
+ throw new Error("Anthropic stream ended without a stop reason");
551
+ }
552
+ if (output.stopReason === "error" || output.stopReason === "aborted") {
553
+ throw new Error(output.errorMessage || "An unknown error occurred");
554
+ }
549
555
 
550
- stream.push({ type: "done", reason: output.stopReason as "stop" | "length" | "toolUse", message: output });
556
+ stream.push({ type: "done", reason: output.stopReason, message: output });
551
557
  stream.end();
552
558
  } catch (error) {
553
559
  for (const block of output.content) delete (block as any).index;
@@ -1,5 +1,5 @@
1
1
  {
2
- "name": "pi-extension-custom-provider-anthropic",
2
+ "name": "draht-extension-custom-provider-anthropic",
3
3
  "private": true,
4
4
  "version": "0.80.6",
5
5
  "type": "module",
@@ -1,5 +1,5 @@
1
1
  {
2
- "name": "pi-extension-custom-provider-gitlab-duo",
2
+ "name": "draht-extension-custom-provider-gitlab-duo",
3
3
  "private": true,
4
4
  "version": "0.80.6",
5
5
  "type": "module",
@@ -1,5 +1,5 @@
1
1
  {
2
- "name": "pi-extension-custom-provider-qwen-cli",
2
+ "name": "draht-extension-custom-provider-qwen-cli",
3
3
  "private": true,
4
4
  "version": "1.6.0",
5
5
  "type": "module",
@@ -1,5 +1,5 @@
1
1
  {
2
- "name": "pi-extension-gondolin",
2
+ "name": "draht-extension-gondolin",
3
3
  "private": true,
4
4
  "version": "0.80.3",
5
5
  "type": "module",
@@ -8,7 +8,7 @@
8
8
  "build": "echo 'nothing to build'",
9
9
  "check": "echo 'nothing to check'"
10
10
  },
11
- "pi": {
11
+ "draht": {
12
12
  "extensions": [
13
13
  "./index.ts"
14
14
  ]
@@ -13,6 +13,7 @@
13
13
  */
14
14
 
15
15
  import type { AgentMessage } from "@draht/agent-core";
16
+ import { uuidv7 } from "@draht/ai";
16
17
  import { complete, type Message } from "@draht/ai/compat";
17
18
  import type { ExtensionAPI, SessionEntry } from "@draht/coding-agent";
18
19
  import { BorderedLoader, convertToLlm, serializeConversation } from "@draht/coding-agent";
@@ -136,7 +137,14 @@ export default function (pi: ExtensionAPI) {
136
137
  const response = await complete(
137
138
  ctx.model!,
138
139
  { systemPrompt: SYSTEM_PROMPT, messages: [userMessage] },
139
- { apiKey: auth.apiKey, headers: auth.headers, env: auth.env, signal: loader.signal },
140
+ {
141
+ apiKey: auth.apiKey,
142
+ headers: auth.headers,
143
+ env: auth.env,
144
+ signal: loader.signal,
145
+ cacheRetention: "none",
146
+ sessionId: uuidv7(),
147
+ },
140
148
  );
141
149
 
142
150
  if (response.stopReason === "aborted") {