@draht/coding-agent 2026.7.30 → 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 (459) hide show
  1. package/CHANGELOG.md +154 -0
  2. package/README.md +46 -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/cli/args.d.ts +10 -0
  19. package/dist/cli/args.d.ts.map +1 -1
  20. package/dist/cli/args.js +69 -2
  21. package/dist/cli/args.js.map +1 -1
  22. package/dist/cli/attach-mode.d.ts +61 -0
  23. package/dist/cli/attach-mode.d.ts.map +1 -1
  24. package/dist/cli/attach-mode.js +243 -5
  25. package/dist/cli/attach-mode.js.map +1 -1
  26. package/dist/cli/credential-print.d.ts +1 -1
  27. package/dist/cli/credential-print.d.ts.map +1 -1
  28. package/dist/cli/credential-print.js +5 -4
  29. package/dist/cli/credential-print.js.map +1 -1
  30. package/dist/config.d.ts +9 -0
  31. package/dist/config.d.ts.map +1 -1
  32. package/dist/config.js +31 -4
  33. package/dist/config.js.map +1 -1
  34. package/dist/core/agent-session-runtime.d.ts +17 -1
  35. package/dist/core/agent-session-runtime.d.ts.map +1 -1
  36. package/dist/core/agent-session-runtime.js +87 -30
  37. package/dist/core/agent-session-runtime.js.map +1 -1
  38. package/dist/core/agent-session-services.d.ts +1 -1
  39. package/dist/core/agent-session-services.d.ts.map +1 -1
  40. package/dist/core/agent-session-services.js +1 -0
  41. package/dist/core/agent-session-services.js.map +1 -1
  42. package/dist/core/agent-session.d.ts +35 -16
  43. package/dist/core/agent-session.d.ts.map +1 -1
  44. package/dist/core/agent-session.js +149 -64
  45. package/dist/core/agent-session.js.map +1 -1
  46. package/dist/core/auth-storage.d.ts +5 -1
  47. package/dist/core/auth-storage.d.ts.map +1 -1
  48. package/dist/core/auth-storage.js +72 -15
  49. package/dist/core/auth-storage.js.map +1 -1
  50. package/dist/core/builtins/checkpoints.d.ts +20 -0
  51. package/dist/core/builtins/checkpoints.d.ts.map +1 -0
  52. package/dist/core/builtins/checkpoints.js +161 -0
  53. package/dist/core/builtins/checkpoints.js.map +1 -0
  54. package/dist/core/builtins/duet.d.ts +26 -0
  55. package/dist/core/builtins/duet.d.ts.map +1 -0
  56. package/dist/core/builtins/duet.js +660 -0
  57. package/dist/core/builtins/duet.js.map +1 -0
  58. package/dist/core/builtins/index.d.ts.map +1 -1
  59. package/dist/core/builtins/index.js +7 -1
  60. package/dist/core/builtins/index.js.map +1 -1
  61. package/dist/core/builtins/subagent.d.ts +24 -4
  62. package/dist/core/builtins/subagent.d.ts.map +1 -1
  63. package/dist/core/builtins/subagent.js +278 -35
  64. package/dist/core/builtins/subagent.js.map +1 -1
  65. package/dist/core/checkpoints/checkpoint-cli.d.ts +17 -0
  66. package/dist/core/checkpoints/checkpoint-cli.d.ts.map +1 -0
  67. package/dist/core/checkpoints/checkpoint-cli.js +78 -0
  68. package/dist/core/checkpoints/checkpoint-cli.js.map +1 -0
  69. package/dist/core/checkpoints/checkpoint-manager.d.ts +294 -0
  70. package/dist/core/checkpoints/checkpoint-manager.d.ts.map +1 -0
  71. package/dist/core/checkpoints/checkpoint-manager.js +865 -0
  72. package/dist/core/checkpoints/checkpoint-manager.js.map +1 -0
  73. package/dist/core/checkpoints/rewind.d.ts +141 -0
  74. package/dist/core/checkpoints/rewind.d.ts.map +1 -0
  75. package/dist/core/checkpoints/rewind.js +246 -0
  76. package/dist/core/checkpoints/rewind.js.map +1 -0
  77. package/dist/core/compaction/branch-summarization.d.ts +1 -1
  78. package/dist/core/compaction/branch-summarization.d.ts.map +1 -1
  79. package/dist/core/compaction/branch-summarization.js +9 -4
  80. package/dist/core/compaction/branch-summarization.js.map +1 -1
  81. package/dist/core/compaction/compaction.d.ts +5 -0
  82. package/dist/core/compaction/compaction.d.ts.map +1 -1
  83. package/dist/core/compaction/compaction.js +25 -4
  84. package/dist/core/compaction/compaction.js.map +1 -1
  85. package/dist/core/extensions/index.d.ts +1 -1
  86. package/dist/core/extensions/index.d.ts.map +1 -1
  87. package/dist/core/extensions/index.js.map +1 -1
  88. package/dist/core/extensions/loader.d.ts.map +1 -1
  89. package/dist/core/extensions/loader.js +83 -20
  90. package/dist/core/extensions/loader.js.map +1 -1
  91. package/dist/core/extensions/runner.d.ts +13 -2
  92. package/dist/core/extensions/runner.d.ts.map +1 -1
  93. package/dist/core/extensions/runner.js +37 -2
  94. package/dist/core/extensions/runner.js.map +1 -1
  95. package/dist/core/extensions/types.d.ts +189 -6
  96. package/dist/core/extensions/types.d.ts.map +1 -1
  97. package/dist/core/extensions/types.js.map +1 -1
  98. package/dist/core/http-dispatcher.d.ts.map +1 -1
  99. package/dist/core/http-dispatcher.js +7 -0
  100. package/dist/core/http-dispatcher.js.map +1 -1
  101. package/dist/core/index.d.ts +1 -1
  102. package/dist/core/index.d.ts.map +1 -1
  103. package/dist/core/index.js.map +1 -1
  104. package/dist/core/keybindings.d.ts +5 -0
  105. package/dist/core/keybindings.d.ts.map +1 -1
  106. package/dist/core/keybindings.js +1 -0
  107. package/dist/core/keybindings.js.map +1 -1
  108. package/dist/core/model-registry.d.ts +3 -2
  109. package/dist/core/model-registry.d.ts.map +1 -1
  110. package/dist/core/model-registry.js +8 -8
  111. package/dist/core/model-registry.js.map +1 -1
  112. package/dist/core/model-resolver.d.ts.map +1 -1
  113. package/dist/core/model-resolver.js +34 -7
  114. package/dist/core/model-resolver.js.map +1 -1
  115. package/dist/core/model-runtime.d.ts +7 -1
  116. package/dist/core/model-runtime.d.ts.map +1 -1
  117. package/dist/core/model-runtime.js +30 -10
  118. package/dist/core/model-runtime.js.map +1 -1
  119. package/dist/core/multi-agent/permission-gate.d.ts.map +1 -1
  120. package/dist/core/multi-agent/permission-gate.js +4 -3
  121. package/dist/core/multi-agent/permission-gate.js.map +1 -1
  122. package/dist/core/multi-agent/worktree.d.ts +2 -0
  123. package/dist/core/multi-agent/worktree.d.ts.map +1 -1
  124. package/dist/core/multi-agent/worktree.js +2 -2
  125. package/dist/core/multi-agent/worktree.js.map +1 -1
  126. package/dist/core/package-manager.d.ts +7 -1
  127. package/dist/core/package-manager.d.ts.map +1 -1
  128. package/dist/core/package-manager.js +21 -44
  129. package/dist/core/package-manager.js.map +1 -1
  130. package/dist/core/permission-relay/index.d.ts +19 -0
  131. package/dist/core/permission-relay/index.d.ts.map +1 -0
  132. package/dist/core/permission-relay/index.js +49 -0
  133. package/dist/core/permission-relay/index.js.map +1 -0
  134. package/dist/core/permission-relay/relay-ui-context.d.ts +39 -0
  135. package/dist/core/permission-relay/relay-ui-context.d.ts.map +1 -0
  136. package/dist/core/permission-relay/relay-ui-context.js +788 -0
  137. package/dist/core/permission-relay/relay-ui-context.js.map +1 -0
  138. package/dist/core/permission-relay/types.d.ts +222 -0
  139. package/dist/core/permission-relay/types.d.ts.map +1 -0
  140. package/dist/core/permission-relay/types.js +15 -0
  141. package/dist/core/permission-relay/types.js.map +1 -0
  142. package/dist/core/pi-manifest.d.ts +14 -0
  143. package/dist/core/pi-manifest.d.ts.map +1 -0
  144. package/dist/core/pi-manifest.js +35 -0
  145. package/dist/core/pi-manifest.js.map +1 -0
  146. package/dist/core/project-trust.js +2 -2
  147. package/dist/core/project-trust.js.map +1 -1
  148. package/dist/core/resource-loader.d.ts +21 -0
  149. package/dist/core/resource-loader.d.ts.map +1 -1
  150. package/dist/core/resource-loader.js +101 -24
  151. package/dist/core/resource-loader.js.map +1 -1
  152. package/dist/core/sandbox/bash-operations.d.ts +149 -0
  153. package/dist/core/sandbox/bash-operations.d.ts.map +1 -0
  154. package/dist/core/sandbox/bash-operations.js +163 -0
  155. package/dist/core/sandbox/bash-operations.js.map +1 -0
  156. package/dist/core/sandbox/env.d.ts +83 -0
  157. package/dist/core/sandbox/env.d.ts.map +1 -0
  158. package/dist/core/sandbox/env.js +123 -0
  159. package/dist/core/sandbox/env.js.map +1 -0
  160. package/dist/core/sandbox/executor.d.ts +104 -0
  161. package/dist/core/sandbox/executor.d.ts.map +1 -0
  162. package/dist/core/sandbox/executor.js +92 -0
  163. package/dist/core/sandbox/executor.js.map +1 -0
  164. package/dist/core/sandbox/index.d.ts +36 -0
  165. package/dist/core/sandbox/index.d.ts.map +1 -0
  166. package/dist/core/sandbox/index.js +36 -0
  167. package/dist/core/sandbox/index.js.map +1 -0
  168. package/dist/core/sandbox/linux.d.ts +121 -0
  169. package/dist/core/sandbox/linux.d.ts.map +1 -0
  170. package/dist/core/sandbox/linux.js +260 -0
  171. package/dist/core/sandbox/linux.js.map +1 -0
  172. package/dist/core/sandbox/policy.d.ts +142 -0
  173. package/dist/core/sandbox/policy.d.ts.map +1 -0
  174. package/dist/core/sandbox/policy.js +297 -0
  175. package/dist/core/sandbox/policy.js.map +1 -0
  176. package/dist/core/sandbox/real-path.d.ts +112 -0
  177. package/dist/core/sandbox/real-path.d.ts.map +1 -0
  178. package/dist/core/sandbox/real-path.js +158 -0
  179. package/dist/core/sandbox/real-path.js.map +1 -0
  180. package/dist/core/sandbox/seatbelt-profile.d.ts +95 -0
  181. package/dist/core/sandbox/seatbelt-profile.d.ts.map +1 -0
  182. package/dist/core/sandbox/seatbelt-profile.js +239 -0
  183. package/dist/core/sandbox/seatbelt-profile.js.map +1 -0
  184. package/dist/core/sandbox/seatbelt.d.ts +95 -0
  185. package/dist/core/sandbox/seatbelt.d.ts.map +1 -0
  186. package/dist/core/sandbox/seatbelt.js +154 -0
  187. package/dist/core/sandbox/seatbelt.js.map +1 -0
  188. package/dist/core/sandbox/self-test.d.ts +109 -0
  189. package/dist/core/sandbox/self-test.d.ts.map +1 -0
  190. package/dist/core/sandbox/self-test.js +369 -0
  191. package/dist/core/sandbox/self-test.js.map +1 -0
  192. package/dist/core/sandbox/spawn.d.ts +33 -0
  193. package/dist/core/sandbox/spawn.d.ts.map +1 -0
  194. package/dist/core/sandbox/spawn.js +87 -0
  195. package/dist/core/sandbox/spawn.js.map +1 -0
  196. package/dist/core/sdk.d.ts.map +1 -1
  197. package/dist/core/sdk.js +3 -1
  198. package/dist/core/sdk.js.map +1 -1
  199. package/dist/core/session-manager.d.ts +60 -1
  200. package/dist/core/session-manager.d.ts.map +1 -1
  201. package/dist/core/session-manager.js +53 -6
  202. package/dist/core/session-manager.js.map +1 -1
  203. package/dist/core/settings-manager.d.ts +21 -0
  204. package/dist/core/settings-manager.d.ts.map +1 -1
  205. package/dist/core/settings-manager.js +36 -16
  206. package/dist/core/settings-manager.js.map +1 -1
  207. package/dist/core/skills.d.ts +3 -1
  208. package/dist/core/skills.d.ts.map +1 -1
  209. package/dist/core/skills.js +19 -6
  210. package/dist/core/skills.js.map +1 -1
  211. package/dist/core/slash-commands.d.ts.map +1 -1
  212. package/dist/core/slash-commands.js +1 -0
  213. package/dist/core/slash-commands.js.map +1 -1
  214. package/dist/core/soak/soak-log.d.ts +298 -0
  215. package/dist/core/soak/soak-log.d.ts.map +1 -0
  216. package/dist/core/soak/soak-log.js +660 -0
  217. package/dist/core/soak/soak-log.js.map +1 -0
  218. package/dist/core/soak/soak-reader.d.ts +60 -0
  219. package/dist/core/soak/soak-reader.d.ts.map +1 -0
  220. package/dist/core/soak/soak-reader.js +106 -0
  221. package/dist/core/soak/soak-reader.js.map +1 -0
  222. package/dist/core/socket-server/discovery.d.ts +78 -1
  223. package/dist/core/socket-server/discovery.d.ts.map +1 -1
  224. package/dist/core/socket-server/discovery.js +356 -37
  225. package/dist/core/socket-server/discovery.js.map +1 -1
  226. package/dist/core/socket-server/index.d.ts +10 -4
  227. package/dist/core/socket-server/index.d.ts.map +1 -1
  228. package/dist/core/socket-server/index.js +6 -3
  229. package/dist/core/socket-server/index.js.map +1 -1
  230. package/dist/core/socket-server/permission-delivery.d.ts +125 -0
  231. package/dist/core/socket-server/permission-delivery.d.ts.map +1 -0
  232. package/dist/core/socket-server/permission-delivery.js +152 -0
  233. package/dist/core/socket-server/permission-delivery.js.map +1 -0
  234. package/dist/core/socket-server/permission-registry.d.ts +301 -0
  235. package/dist/core/socket-server/permission-registry.d.ts.map +1 -0
  236. package/dist/core/socket-server/permission-registry.js +410 -0
  237. package/dist/core/socket-server/permission-registry.js.map +1 -0
  238. package/dist/core/socket-server/permission-relay.d.ts +81 -0
  239. package/dist/core/socket-server/permission-relay.d.ts.map +1 -0
  240. package/dist/core/socket-server/permission-relay.js +528 -0
  241. package/dist/core/socket-server/permission-relay.js.map +1 -0
  242. package/dist/core/socket-server/safe-text.d.ts +83 -0
  243. package/dist/core/socket-server/safe-text.d.ts.map +1 -0
  244. package/dist/core/socket-server/safe-text.js +277 -0
  245. package/dist/core/socket-server/safe-text.js.map +1 -0
  246. package/dist/core/socket-server/session-integration.d.ts +65 -2
  247. package/dist/core/socket-server/session-integration.d.ts.map +1 -1
  248. package/dist/core/socket-server/session-integration.js +434 -32
  249. package/dist/core/socket-server/session-integration.js.map +1 -1
  250. package/dist/core/socket-server/socket-client.d.ts +21 -2
  251. package/dist/core/socket-server/socket-client.d.ts.map +1 -1
  252. package/dist/core/socket-server/socket-client.js +52 -1
  253. package/dist/core/socket-server/socket-client.js.map +1 -1
  254. package/dist/core/socket-server/socket-server.d.ts +152 -1
  255. package/dist/core/socket-server/socket-server.d.ts.map +1 -1
  256. package/dist/core/socket-server/socket-server.js +775 -26
  257. package/dist/core/socket-server/socket-server.js.map +1 -1
  258. package/dist/core/socket-server/types.d.ts +106 -2
  259. package/dist/core/socket-server/types.d.ts.map +1 -1
  260. package/dist/core/socket-server/types.js +13 -1
  261. package/dist/core/socket-server/types.js.map +1 -1
  262. package/dist/core/system-prompt.d.ts.map +1 -1
  263. package/dist/core/system-prompt.js +8 -9
  264. package/dist/core/system-prompt.js.map +1 -1
  265. package/dist/core/tools/bash.d.ts +1 -1
  266. package/dist/core/tools/bash.d.ts.map +1 -1
  267. package/dist/core/tools/bash.js +5 -2
  268. package/dist/core/tools/bash.js.map +1 -1
  269. package/dist/core/tools/edit.d.ts.map +1 -1
  270. package/dist/core/tools/edit.js +17 -2
  271. package/dist/core/tools/edit.js.map +1 -1
  272. package/dist/core/tools/find.d.ts +3 -0
  273. package/dist/core/tools/find.d.ts.map +1 -1
  274. package/dist/core/tools/find.js +11 -18
  275. package/dist/core/tools/find.js.map +1 -1
  276. package/dist/core/trust-manager.d.ts +6 -4
  277. package/dist/core/trust-manager.d.ts.map +1 -1
  278. package/dist/core/trust-manager.js +55 -21
  279. package/dist/core/trust-manager.js.map +1 -1
  280. package/dist/extensions/index.d.ts.map +1 -1
  281. package/dist/extensions/index.js +5 -1
  282. package/dist/extensions/index.js.map +1 -1
  283. package/dist/extensions/llama/provider.d.ts.map +1 -1
  284. package/dist/extensions/llama/provider.js +5 -1
  285. package/dist/extensions/llama/provider.js.map +1 -1
  286. package/dist/extensions/stub-provider/index.d.ts +9 -0
  287. package/dist/extensions/stub-provider/index.d.ts.map +1 -0
  288. package/dist/extensions/stub-provider/index.js +13 -0
  289. package/dist/extensions/stub-provider/index.js.map +1 -0
  290. package/dist/extensions/stub-provider/provider.d.ts +77 -0
  291. package/dist/extensions/stub-provider/provider.d.ts.map +1 -0
  292. package/dist/extensions/stub-provider/provider.js +193 -0
  293. package/dist/extensions/stub-provider/provider.js.map +1 -0
  294. package/dist/hooks/gsd/draht-quality-gate.js +3 -3
  295. package/dist/index.d.ts +1 -1
  296. package/dist/index.d.ts.map +1 -1
  297. package/dist/index.js.map +1 -1
  298. package/dist/main.d.ts.map +1 -1
  299. package/dist/main.js +242 -45
  300. package/dist/main.js.map +1 -1
  301. package/dist/modes/interactive/components/config-selector.d.ts.map +1 -1
  302. package/dist/modes/interactive/components/config-selector.js +3 -2
  303. package/dist/modes/interactive/components/config-selector.js.map +1 -1
  304. package/dist/modes/interactive/components/extension-selector.d.ts +49 -0
  305. package/dist/modes/interactive/components/extension-selector.d.ts.map +1 -1
  306. package/dist/modes/interactive/components/extension-selector.js +202 -5
  307. package/dist/modes/interactive/components/extension-selector.js.map +1 -1
  308. package/dist/modes/interactive/components/session-selector.d.ts.map +1 -1
  309. package/dist/modes/interactive/components/session-selector.js +10 -2
  310. package/dist/modes/interactive/components/session-selector.js.map +1 -1
  311. package/dist/modes/interactive/components/settings-selector.d.ts +2 -0
  312. package/dist/modes/interactive/components/settings-selector.d.ts.map +1 -1
  313. package/dist/modes/interactive/components/settings-selector.js +10 -0
  314. package/dist/modes/interactive/components/settings-selector.js.map +1 -1
  315. package/dist/modes/interactive/components/tool-execution.d.ts.map +1 -1
  316. package/dist/modes/interactive/components/tool-execution.js +10 -1
  317. package/dist/modes/interactive/components/tool-execution.js.map +1 -1
  318. package/dist/modes/interactive/components/tree-selector.d.ts +20 -2
  319. package/dist/modes/interactive/components/tree-selector.d.ts.map +1 -1
  320. package/dist/modes/interactive/components/tree-selector.js +21 -5
  321. package/dist/modes/interactive/components/tree-selector.js.map +1 -1
  322. package/dist/modes/interactive/interactive-mode.d.ts +97 -3
  323. package/dist/modes/interactive/interactive-mode.d.ts.map +1 -1
  324. package/dist/modes/interactive/interactive-mode.js +394 -24
  325. package/dist/modes/interactive/interactive-mode.js.map +1 -1
  326. package/dist/modes/rpc/rpc-mode.d.ts.map +1 -1
  327. package/dist/modes/rpc/rpc-mode.js +165 -7
  328. package/dist/modes/rpc/rpc-mode.js.map +1 -1
  329. package/dist/modes/rpc/rpc-types.d.ts +68 -1
  330. package/dist/modes/rpc/rpc-types.d.ts.map +1 -1
  331. package/dist/modes/rpc/rpc-types.js.map +1 -1
  332. package/dist/prompts/commands/atomic-commit.md +1 -12
  333. package/dist/prompts/commands/brainstorm.md +12 -15
  334. package/dist/prompts/commands/create-verification-skill.md +108 -0
  335. package/dist/prompts/commands/discuss-phase.md +3 -14
  336. package/dist/prompts/commands/execute-phase.md +3 -11
  337. package/dist/prompts/commands/fix.md +41 -18
  338. package/dist/prompts/commands/grill.md +66 -0
  339. package/dist/prompts/commands/init-project.md +5 -15
  340. package/dist/prompts/commands/map-codebase.md +1 -13
  341. package/dist/prompts/commands/new-project.md +5 -15
  342. package/dist/prompts/commands/next-milestone.md +1 -13
  343. package/dist/prompts/commands/orchestrate.md +1 -1
  344. package/dist/prompts/commands/pause-work.md +1 -13
  345. package/dist/prompts/commands/plan-phase.md +2 -11
  346. package/dist/prompts/commands/progress.md +0 -13
  347. package/dist/prompts/commands/quick.md +3 -11
  348. package/dist/prompts/commands/resolve-conflicts.md +71 -0
  349. package/dist/prompts/commands/resume-work.md +0 -13
  350. package/dist/prompts/commands/review.md +4 -13
  351. package/dist/prompts/commands/triage.md +159 -0
  352. package/dist/prompts/commands/verify-work.md +4 -14
  353. package/dist/prompts/commands/why.md +135 -0
  354. package/dist/skills/atomic-reasoning/SKILL.md +115 -0
  355. package/dist/skills/blast-radius/SKILL.md +55 -0
  356. package/dist/skills/epistemics/SKILL.md +99 -0
  357. package/dist/skills/hexagon-animation/SKILL.md +49 -0
  358. package/dist/skills/hexagon-animation/generate.mjs +81 -0
  359. package/dist/skills/hexagon-animation/template.html +361 -0
  360. package/dist/skills/typescript-discipline/SKILL.md +50 -0
  361. package/dist/skills/typescript-discipline/references/patterns.md +294 -0
  362. package/dist/skills/unslop/SKILL.md +101 -0
  363. package/dist/utils/canonical-path.d.ts +28 -0
  364. package/dist/utils/canonical-path.d.ts.map +1 -0
  365. package/dist/utils/canonical-path.js +90 -0
  366. package/dist/utils/canonical-path.js.map +1 -0
  367. package/dist/utils/child-process.d.ts +12 -1
  368. package/dist/utils/child-process.d.ts.map +1 -1
  369. package/dist/utils/child-process.js +25 -8
  370. package/dist/utils/child-process.js.map +1 -1
  371. package/dist/utils/clipboard.d.ts +1 -1
  372. package/dist/utils/clipboard.d.ts.map +1 -1
  373. package/dist/utils/clipboard.js +22 -2
  374. package/dist/utils/clipboard.js.map +1 -1
  375. package/dist/utils/exif-orientation.d.ts.map +1 -1
  376. package/dist/utils/exif-orientation.js +2 -3
  377. package/dist/utils/exif-orientation.js.map +1 -1
  378. package/dist/utils/paths.d.ts +2 -7
  379. package/dist/utils/paths.d.ts.map +1 -1
  380. package/dist/utils/paths.js +13 -15
  381. package/dist/utils/paths.js.map +1 -1
  382. package/dist/utils/shell.d.ts.map +1 -1
  383. package/dist/utils/shell.js +6 -4
  384. package/dist/utils/shell.js.map +1 -1
  385. package/dist/utils/tools-manager.d.ts.map +1 -1
  386. package/dist/utils/tools-manager.js +3 -5
  387. package/dist/utils/tools-manager.js.map +1 -1
  388. package/docs/attachable-sessions.md +79 -0
  389. package/docs/compaction.md +21 -21
  390. package/docs/containerization.md +23 -23
  391. package/docs/custom-provider.md +16 -16
  392. package/docs/development.md +9 -9
  393. package/docs/docs.json +6 -2
  394. package/docs/duet.md +42 -0
  395. package/docs/extensions.md +58 -58
  396. package/docs/index.md +10 -10
  397. package/docs/json.md +7 -7
  398. package/docs/keybindings.md +6 -5
  399. package/docs/llama-cpp.md +6 -6
  400. package/docs/models.md +6 -6
  401. package/docs/packages.md +43 -43
  402. package/docs/prompt-templates.md +4 -4
  403. package/docs/providers.md +12 -12
  404. package/docs/quickstart.md +32 -32
  405. package/docs/rpc.md +83 -12
  406. package/docs/sdk.md +15 -15
  407. package/docs/security.md +18 -18
  408. package/docs/session-format.md +35 -13
  409. package/docs/sessions.md +17 -14
  410. package/docs/settings.md +25 -18
  411. package/docs/shell-aliases.md +2 -2
  412. package/docs/skills.md +12 -11
  413. package/docs/terminal-setup.md +12 -12
  414. package/docs/termux.md +6 -6
  415. package/docs/themes.md +11 -11
  416. package/docs/tmux.md +4 -4
  417. package/docs/tui.md +5 -5
  418. package/docs/usage.md +50 -50
  419. package/docs/windows.md +2 -2
  420. package/examples/extensions/overlay-qa-tests.ts +3 -3
  421. package/hooks/gsd/draht-quality-gate.js +3 -3
  422. package/package.json +11 -10
  423. package/prompts/commands/atomic-commit.md +1 -12
  424. package/prompts/commands/brainstorm.md +12 -15
  425. package/prompts/commands/create-verification-skill.md +108 -0
  426. package/prompts/commands/discuss-phase.md +3 -14
  427. package/prompts/commands/execute-phase.md +3 -11
  428. package/prompts/commands/fix.md +41 -18
  429. package/prompts/commands/grill.md +66 -0
  430. package/prompts/commands/init-project.md +5 -15
  431. package/prompts/commands/map-codebase.md +1 -13
  432. package/prompts/commands/new-project.md +5 -15
  433. package/prompts/commands/next-milestone.md +1 -13
  434. package/prompts/commands/orchestrate.md +1 -1
  435. package/prompts/commands/pause-work.md +1 -13
  436. package/prompts/commands/plan-phase.md +2 -11
  437. package/prompts/commands/progress.md +0 -13
  438. package/prompts/commands/quick.md +3 -11
  439. package/prompts/commands/resolve-conflicts.md +71 -0
  440. package/prompts/commands/resume-work.md +0 -13
  441. package/prompts/commands/review.md +4 -13
  442. package/prompts/commands/triage.md +159 -0
  443. package/prompts/commands/verify-work.md +4 -14
  444. package/prompts/commands/why.md +135 -0
  445. package/skills/atomic-reasoning/SKILL.md +115 -0
  446. package/skills/blast-radius/SKILL.md +55 -0
  447. package/skills/epistemics/SKILL.md +99 -0
  448. package/skills/hexagon-animation/SKILL.md +49 -0
  449. package/skills/hexagon-animation/generate.mjs +81 -0
  450. package/skills/hexagon-animation/template.html +361 -0
  451. package/skills/typescript-discipline/SKILL.md +50 -0
  452. package/skills/typescript-discipline/references/patterns.md +294 -0
  453. package/skills/unslop/SKILL.md +101 -0
  454. package/dist/prompts/agents/build.md +0 -86
  455. package/dist/prompts/agents/plan.md +0 -79
  456. package/dist/prompts/agents/verify.md +0 -69
  457. package/prompts/agents/build.md +0 -86
  458. package/prompts/agents/plan.md +0 -79
  459. package/prompts/agents/verify.md +0 -69
package/docs/rpc.md CHANGED
@@ -7,7 +7,7 @@ RPC mode enables headless operation of the coding agent via a JSON protocol over
7
7
  ## Starting RPC Mode
8
8
 
9
9
  ```bash
10
- pi --mode rpc [options]
10
+ draht --mode rpc [options]
11
11
  ```
12
12
 
13
13
  Common options:
@@ -786,7 +786,7 @@ Response:
786
786
  }
787
787
  ```
788
788
 
789
- The current session name is available via `get_state` in the `sessionName` field. To set the initial name when starting RPC mode, pass `--name <name>` or `-n <name>` to the `pi --mode rpc` process.
789
+ The current session name is available via `get_state` in the `sessionName` field. To set the initial name when starting RPC mode, pass `--name <name>` or `-n <name>` to the `draht --mode rpc` process.
790
790
 
791
791
  ### Commands
792
792
 
@@ -806,9 +806,9 @@ Response:
806
806
  "success": true,
807
807
  "data": {
808
808
  "commands": [
809
- {"name": "session-name", "description": "Set or clear session name", "source": "extension", "path": "/home/user/.pi/agent/extensions/session.ts"},
810
- {"name": "fix-tests", "description": "Fix failing tests", "source": "prompt", "location": "project", "path": "/home/user/myproject/.pi/agent/prompts/fix-tests.md"},
811
- {"name": "skill:brave-search", "description": "Web search via Brave API", "source": "skill", "location": "user", "path": "/home/user/.pi/agent/skills/brave-search/SKILL.md"}
809
+ {"name": "session-name", "description": "Set or clear session name", "source": "extension", "path": "/home/user/.draht/agent/extensions/session.ts"},
810
+ {"name": "fix-tests", "description": "Fix failing tests", "source": "prompt", "location": "project", "path": "/home/user/myproject/.draht/agent/prompts/fix-tests.md"},
811
+ {"name": "skill:brave-search", "description": "Web search via Brave API", "source": "skill", "location": "user", "path": "/home/user/.draht/agent/skills/brave-search/SKILL.md"}
812
812
  ]
813
813
  }
814
814
  }
@@ -822,8 +822,8 @@ Each command has:
822
822
  - `"prompt"`: Loaded from a prompt template `.md` file
823
823
  - `"skill"`: Loaded from a skill directory (name is prefixed with `skill:`)
824
824
  - `location`: Where it was loaded from (optional, not present for extensions):
825
- - `"user"`: User-level (`~/.pi/agent/`)
826
- - `"project"`: Project-level (`./.pi/agent/`)
825
+ - `"user"`: User-level (`~/.draht/agent/`)
826
+ - `"project"`: Project-level (`./.draht/agent/`)
827
827
  - `"path"`: Explicit path via CLI or settings
828
828
  - `path`: Absolute file path to the command source (optional)
829
829
 
@@ -881,7 +881,7 @@ Emitted when one low-level agent run completes. Contains all messages generated
881
881
 
882
882
  ### agent_settled
883
883
 
884
- Emitted after the full session-level run settles. At this point Pi will not continue automatically through retry, compaction retry, or queued follow-up messages.
884
+ Emitted after the full session-level run settles. At this point draht will not continue automatically through retry, compaction retry, or queued follow-up messages.
885
885
 
886
886
  ```json
887
887
  {"type": "agent_settled"}
@@ -1291,7 +1291,7 @@ Set the terminal window/tab title. Fire-and-forget.
1291
1291
  "type": "extension_ui_request",
1292
1292
  "id": "uuid-8",
1293
1293
  "method": "setTitle",
1294
- "title": "pi - my project"
1294
+ "title": "draht - my project"
1295
1295
  }
1296
1296
  ```
1297
1297
 
@@ -1310,7 +1310,7 @@ Set the text in the input editor. Fire-and-forget.
1310
1310
 
1311
1311
  ### Extension UI Responses (stdin)
1312
1312
 
1313
- Responses are sent for dialog methods only (`select`, `confirm`, `input`, `editor`). The `id` must match the request.
1313
+ Responses are sent for dialog methods only (`select`, `confirm`, `input`, `editor`). The `id` must match the request. An answer whose `id` matches no open dialog is silently dropped.
1314
1314
 
1315
1315
  #### Value response (select, input, editor)
1316
1316
 
@@ -1324,6 +1324,77 @@ Responses are sent for dialog methods only (`select`, `confirm`, `input`, `edito
1324
1324
  {"type": "extension_ui_response", "id": "uuid-2", "confirmed": true}
1325
1325
  ```
1326
1326
 
1327
+ #### Naming the option that was chosen (`optionId`)
1328
+
1329
+ A request may carry a `detail` object describing what is being decided. When it does, `detail.options`
1330
+ is the immutable set of options that request offered, each stating its own meaning:
1331
+
1332
+ ```json
1333
+ {
1334
+ "type": "extension_ui_request",
1335
+ "id": "uuid-2",
1336
+ "method": "confirm",
1337
+ "title": "Approve tool call?",
1338
+ "message": "bash wants to run a command",
1339
+ "detail": {
1340
+ "kind": "tool_permission",
1341
+ "toolCallId": "call-1",
1342
+ "toolName": "bash",
1343
+ "cwd": "/private/tmp/project",
1344
+ "command": "rm -rf build",
1345
+ "reason": "bash commands require approval by default",
1346
+ "options": [
1347
+ {"id": "approve", "label": "Yes", "decision": "approve"},
1348
+ {"id": "deny", "label": "No", "decision": "deny"}
1349
+ ]
1350
+ }
1351
+ }
1352
+ ```
1353
+
1354
+ An answer may name which of those options was chosen by adding `optionId`:
1355
+
1356
+ ```json
1357
+ {"type": "extension_ui_response", "id": "uuid-2", "confirmed": false, "optionId": "deny"}
1358
+ ```
1359
+
1360
+ Rules, all enforced by the agent:
1361
+
1362
+ - `optionId` is **optional**. Clients that only know yes/no keep sending `confirmed` alone and are
1363
+ unaffected.
1364
+ - When present, it **decides**: the named option's own `decision` (`"approve"` or `"deny"`) wins over
1365
+ `confirmed`, in both directions. `{"confirmed": true, "optionId": "deny"}` denies. Never infer an
1366
+ option's meaning from its position in the array, from the array's length, or from its id — read
1367
+ `decision`.
1368
+ - When present, it must be **one of the ids that this request offered**. An id nobody offered, an id
1369
+ that appears twice in the offered set, and a present-but-non-string value such as
1370
+ `{"optionId": 123}` are all refused (see below). A wrongly-typed `optionId` is *not* treated as
1371
+ absent.
1372
+ - When the matching request offered **no options** — any dialog raised without `detail`, such as
1373
+ `/rewind`'s "Restore files?" confirm or `/agent`'s picker — there is nothing to validate against,
1374
+ so `optionId` is ignored and the answer decides on `confirmed` / `value` as usual. A client may
1375
+ therefore attach `optionId` unconditionally without risk of stranding those dialogs.
1376
+
1377
+ #### Refused response (`command: "extension_ui_response"`)
1378
+
1379
+ A rejected `optionId` is reported on stdout as an ordinary failed-command response — note that
1380
+ `command` here is `"extension_ui_response"`, a value **no client ever sends as a command**. Clients
1381
+ that switch exhaustively on `command` must expect it:
1382
+
1383
+ ```json
1384
+ {
1385
+ "id": "uuid-2",
1386
+ "type": "response",
1387
+ "command": "extension_ui_response",
1388
+ "success": false,
1389
+ "error": "optionId \"not-an-option\" is not one of the options offered for this request; the request is still pending"
1390
+ }
1391
+ ```
1392
+
1393
+ The `id` is the **dialog request id**, not a command id. The refusal does **not** consume the
1394
+ request: the dialog is still open and still answerable, and a subsequent valid answer — with a good
1395
+ `optionId`, or with none at all — decides it. A client that receives this line should correct its
1396
+ answer and send it again; ignoring it leaves the agent waiting.
1397
+
1327
1398
  #### Cancellation response (any dialog)
1328
1399
 
1329
1400
  Dismiss any dialog method. The extension receives `undefined` (for select/input/editor) or `false` (for confirm).
@@ -1488,7 +1559,7 @@ import subprocess
1488
1559
  import json
1489
1560
 
1490
1561
  proc = subprocess.Popen(
1491
- ["pi", "--mode", "rpc", "--no-session"],
1562
+ ["draht", "--mode", "rpc", "--no-session"],
1492
1563
  stdin=subprocess.PIPE,
1493
1564
  stdout=subprocess.PIPE,
1494
1565
  text=True
@@ -1527,7 +1598,7 @@ For a complete example of handling the extension UI protocol, see [`examples/rpc
1527
1598
  const { spawn } = require("child_process");
1528
1599
  const { StringDecoder } = require("string_decoder");
1529
1600
 
1530
- const agent = spawn("pi", ["--mode", "rpc", "--no-session"]);
1601
+ const agent = spawn("draht", ["--mode", "rpc", "--no-session"]);
1531
1602
 
1532
1603
  function attachJsonlReader(stream, onLine) {
1533
1604
  const decoder = new StringDecoder("utf8");
package/docs/sdk.md CHANGED
@@ -1,8 +1,8 @@
1
- > pi can help you use the SDK. Ask it to build an integration for your use case.
1
+ > draht can help you use the SDK. Ask it to build an integration for your use case.
2
2
 
3
3
  # SDK
4
4
 
5
- The SDK provides programmatic access to pi's agent capabilities. Use it to embed pi in other applications, build custom interfaces, or integrate with automated workflows.
5
+ The SDK provides programmatic access to draht's agent capabilities. Use it to embed draht in other applications, build custom interfaces, or integrate with automated workflows.
6
6
 
7
7
  **Example use cases:**
8
8
  - Build a custom UI (web, desktop, mobile)
@@ -88,8 +88,8 @@ interface AgentSession {
88
88
  sessionId: string;
89
89
 
90
90
  // Model control
91
- setModel(model: Model): Promise<void>;
92
- setThinkingLevel(level: ThinkingLevel): void;
91
+ setModel(model: Model, options?: { persistDefault?: boolean }): Promise<void>;
92
+ setThinkingLevel(level: ThinkingLevel, options?: { persistDefault?: boolean }): void;
93
93
  cycleModel(): Promise<ModelCycleResult | undefined>;
94
94
  cycleThinkingLevel(): ThinkingLevel | undefined;
95
95
 
@@ -341,23 +341,23 @@ const { session } = await createAgentSession({
341
341
  cwd: process.cwd(), // default
342
342
 
343
343
  // Global config directory
344
- agentDir: "~/.pi/agent", // default (expands ~)
344
+ agentDir: "~/.draht/agent", // default (expands ~)
345
345
  });
346
346
  ```
347
347
 
348
348
  `cwd` is used by `DefaultResourceLoader` for:
349
- - Project extensions (`.pi/extensions/`)
349
+ - Project extensions (`.draht/extensions/`)
350
350
  - Project skills:
351
- - `.pi/skills/`
351
+ - `.draht/skills/`
352
352
  - `.agents/skills/` in `cwd` and ancestor directories (up to git repo root, or filesystem root when not in a repo)
353
- - Project prompts (`.pi/prompts/`)
353
+ - Project prompts (`.draht/prompts/`)
354
354
  - Context files (`AGENTS.md` walking up from cwd)
355
355
  - Session directory naming
356
356
 
357
357
  `agentDir` is used by `DefaultResourceLoader` for:
358
358
  - Global extensions (`extensions/`)
359
359
  - Global skills:
360
- - `skills/` under `agentDir` (for example `~/.pi/agent/skills/`)
360
+ - `skills/` under `agentDir` (for example `~/.draht/agent/skills/`)
361
361
  - `~/.agents/skills/`
362
362
  - Global prompts (`prompts/`)
363
363
  - Global context file (`AGENTS.md`)
@@ -447,7 +447,7 @@ API key resolution priority (handled by AuthStorage):
447
447
  ```typescript
448
448
  import { AuthStorage, ModelRegistry } from "@draht/coding-agent";
449
449
 
450
- // Default: uses ~/.pi/agent/auth.json and ~/.pi/agent/models.json
450
+ // Default: uses ~/.draht/agent/auth.json and ~/.draht/agent/models.json
451
451
  const authStorage = AuthStorage.create();
452
452
  const modelRegistry = ModelRegistry.create(authStorage);
453
453
 
@@ -503,7 +503,7 @@ Specify which built-in tools to enable:
503
503
  - `noTools: "builtin"` disables default built-ins while keeping extension and custom tools enabled
504
504
  - `excludeTools` disables specific built-in, extension, or custom tool names after any `tools` allowlist is applied
505
505
 
506
- The `edit` tool returns `details.diff` for Pi's TUI display and `details.patch` as a standard unified patch for SDK consumers.
506
+ The `edit` tool returns `details.diff` for draht's TUI display and `details.patch` as a standard unified patch for SDK consumers.
507
507
 
508
508
  ```typescript
509
509
  import { createAgentSession } from "@draht/coding-agent";
@@ -585,7 +585,7 @@ If you pass `tools`, include each custom or extension tool name you want enabled
585
585
 
586
586
  ### Extensions
587
587
 
588
- Extensions are loaded by the `ResourceLoader`. `DefaultResourceLoader` discovers extensions from `~/.pi/agent/extensions/`, `.pi/extensions/`, and settings.json extension sources.
588
+ Extensions are loaded by the `ResourceLoader`. `DefaultResourceLoader` discovers extensions from `~/.draht/agent/extensions/`, `.draht/extensions/`, and settings.json extension sources.
589
589
 
590
590
  ```typescript
591
591
  import { createAgentSession, DefaultResourceLoader } from "@draht/coding-agent";
@@ -864,8 +864,8 @@ const { session } = await createAgentSession({
864
864
  **Project-specific settings:**
865
865
 
866
866
  Settings load from two locations and merge:
867
- 1. Global: `~/.pi/agent/settings.json`
868
- 2. Project: `<cwd>/.pi/settings.json`
867
+ 1. Global: `~/.draht/agent/settings.json`
868
+ 2. Project: `<cwd>/.draht/settings.json`
869
869
 
870
870
  Project overrides global. Nested objects merge keys. Setters modify global settings by default.
871
871
 
@@ -1125,7 +1125,7 @@ See [RPC documentation](rpc.md) for the JSON protocol.
1125
1125
  For subprocess-based integration without building with the SDK, use the CLI directly:
1126
1126
 
1127
1127
  ```bash
1128
- pi --mode rpc --no-session
1128
+ draht --mode rpc --no-session
1129
1129
  ```
1130
1130
 
1131
1131
  See [RPC documentation](rpc.md) for the JSON protocol.
package/docs/security.md CHANGED
@@ -1,47 +1,47 @@
1
1
  # Security
2
2
 
3
- Pi is a local coding agent. It runs with the permissions of the user account that starts it, and it treats files writable by that user as inside the same local trust boundary.
3
+ draht is a local coding agent. It runs with the permissions of the user account that starts it, and it treats files writable by that user as inside the same local trust boundary.
4
4
 
5
5
  ## Project Trust
6
6
 
7
- Project trust controls whether pi loads project-local settings, resources, packages, and extensions. It is not a sandbox and it does not restrict what the model can ask tools to do after you start working in a directory.
7
+ Project trust controls whether draht loads project-local settings, resources, packages, and extensions. It is not a sandbox and it does not restrict what the model can ask tools to do after you start working in a directory.
8
8
 
9
- Pi considers a project to have trust inputs when it finds any of these from the current working directory:
9
+ draht considers a project to have trust inputs when it finds any of these from the current working directory:
10
10
 
11
- - `.pi/` in the current directory
11
+ - `.draht/` in the current directory
12
12
  - `.agents/skills` in the current directory or an ancestor directory
13
13
 
14
- When an interactive session starts in a project with configs in `.pi` or `.agents/skills` and no saved decision for the current directory or a parent directory, pi follows `defaultProjectTrust` from global settings. The default value is `"ask"`, which asks whether to trust the project when UI is available. Saved decisions are stored by canonical directory in `~/.pi/agent/trust.json`, and the closest saved decision on the current or parent path applies before the global default.
14
+ When an interactive session starts in a project with configs in `.draht` or `.agents/skills` and no saved decision for the current directory or a parent directory, draht follows `defaultProjectTrust` from global settings. The default value is `"ask"`, which asks whether to trust the project when UI is available. Saved decisions are stored by canonical directory in `~/.draht/agent/trust.json`, and the closest saved decision on the current or parent path applies before the global default.
15
15
 
16
- Trusting a project allows pi to load trust-gated project inputs, including:
16
+ Trusting a project allows draht to load trust-gated project inputs, including:
17
17
 
18
- - `.pi/settings.json`
19
- - `.pi` resources such as extensions, skills, prompt templates, themes, and system prompt files
18
+ - `.draht/settings.json`
19
+ - `.draht` resources such as extensions, skills, prompt templates, themes, and system prompt files
20
20
  - missing project packages configured through project settings
21
21
  - project-local extensions and project package-managed extensions
22
22
 
23
- Declining trust skips protected resources. `AGENTS.md` and `CLAUDE.md` context files are loaded regardless of project trust unless context loading is disabled. Before trust is resolved, pi only loads context files, user/global extensions, and CLI `-e` extensions. User/global and CLI extensions can handle the `project_trust` event; the first extension that returns a yes/no decision owns the decision.
23
+ Declining trust skips protected resources. `AGENTS.md` and `CLAUDE.md` context files are loaded regardless of project trust unless context loading is disabled. Before trust is resolved, draht only loads context files, user/global extensions, and CLI `-e` extensions. User/global and CLI extensions can handle the `project_trust` event; the first extension that returns a yes/no decision owns the decision.
24
24
 
25
25
  Non-interactive modes (`-p`, `--mode json`, and `--mode rpc`) do not show a trust prompt. Without an applicable saved trust decision, `defaultProjectTrust: "ask"` and `"never"` ignore such resources, while `"always"` trusts them. Use `--approve`/`-a` or `--no-approve`/`-na` to override project trust for one run.
26
26
 
27
27
  ## No Built-in Sandbox
28
28
 
29
- Pi does not include a built-in sandbox. Built-in tools can read files, write files, edit files, and run shell commands with the permissions of the pi process. Extensions are TypeScript modules that run with the same permissions. Package installs, shell commands, language servers, test commands, and other developer tools behave as ordinary local processes.
29
+ draht does not include a built-in sandbox. Built-in tools can read files, write files, edit files, and run shell commands with the permissions of the draht process. Extensions are TypeScript modules that run with the same permissions. Package installs, shell commands, language servers, test commands, and other developer tools behave as ordinary local processes.
30
30
 
31
- This is intentional. Pi is designed to operate on local source trees, invoke project toolchains, and integrate with the user's existing development environment. A partial in-process sandbox would be easy to misunderstand as a security boundary while still depending on the host shell, filesystem, package managers, credentials, and extension code. Real isolation needs to come from the operating system or a virtualization/container boundary.
31
+ This is intentional. draht is designed to operate on local source trees, invoke project toolchains, and integrate with the user's existing development environment. A partial in-process sandbox would be easy to misunderstand as a security boundary while still depending on the host shell, filesystem, package managers, credentials, and extension code. Real isolation needs to come from the operating system or a virtualization/container boundary.
32
32
 
33
- Project trust is only an input-loading guard. It prevents a repository from silently changing pi's settings or extensions before you approve it. It does not make untrusted code, untrusted prompts, or untrusted model output safe. Prompt injection from repository files, comments, documentation, context files, or build output is expected local-agent risk and cannot be reliably prevented by pi.
33
+ Project trust is only an input-loading guard. It prevents a repository from silently changing draht's settings or extensions before you approve it. It does not make untrusted code, untrusted prompts, or untrusted model output safe. Prompt injection from repository files, comments, documentation, context files, or build output is expected local-agent risk and cannot be reliably prevented by draht.
34
34
 
35
35
  ## Running Untrusted or Unmonitored Work
36
36
 
37
- For untrusted repositories, generated code you do not intend to monitor closely, or unattended automation, run pi in a contained environment. Use a container, VM, micro-VM, remote sandbox, or policy-controlled sandbox with only the files and credentials required for the task.
37
+ For untrusted repositories, generated code you do not intend to monitor closely, or unattended automation, run draht in a contained environment. Use a container, VM, micro-VM, remote sandbox, or policy-controlled sandbox with only the files and credentials required for the task.
38
38
 
39
39
  Common patterns are documented in [Containerization](containerization.md):
40
40
 
41
- - run the whole `pi` process inside OpenShell or Docker
42
- - run host pi while routing built-in tool execution into a Gondolin micro-VM
41
+ - run the whole `draht` process inside OpenShell or Docker
42
+ - run host draht while routing built-in tool execution into a Gondolin micro-VM
43
43
  - mount only the workspace paths the agent should access
44
- - avoid mounting host `~/.pi/agent` unless the container should access host sessions, settings, and credentials
44
+ - avoid mounting host `~/.draht/agent` unless the container should access host sessions, settings, and credentials
45
45
  - pass the minimum required API keys or use short-lived credentials
46
46
  - restrict network access when the task does not need it
47
47
  - review diffs and outputs before copying results back to trusted systems
@@ -50,6 +50,6 @@ If you bind-mount a host workspace read/write, writes from inside the container
50
50
 
51
51
  ## Reporting Security Issues
52
52
 
53
- To report a security issue, follow the repository [Security Policy](https://github.com/earendil-works/pi-mono/blob/main/SECURITY.md). Do not open a public issue for security-sensitive reports.
53
+ To report a security issue, follow the repository [Security Policy](https://github.com/draht-dev/draht/blob/main/SECURITY.md). Do not open a public issue for security-sensitive reports.
54
54
 
55
- Expected local-agent behavior, lack of a built-in sandbox, prompt injection from untrusted content, and behavior of user-installed extensions or skills are generally outside the security boundary unless the report demonstrates a real privilege-boundary bypass or shows how pi grants access that the local user did not already have.
55
+ Expected local-agent behavior, lack of a built-in sandbox, prompt injection from untrusted content, and behavior of user-installed extensions or skills are generally outside the security boundary unless the report demonstrates a real privilege-boundary bypass or shows how draht grants access that the local user did not already have.
@@ -5,16 +5,16 @@ Sessions are stored as JSONL (JSON Lines) files. Each line is a JSON object with
5
5
  ## File Location
6
6
 
7
7
  ```
8
- ~/.pi/agent/sessions/--<path>--/<timestamp>_<uuid>.jsonl
8
+ ~/.draht/agent/sessions/--<path>--/<timestamp>_<uuid>.jsonl
9
9
  ```
10
10
 
11
11
  Where `<path>` is the working directory with `/` replaced by `-`.
12
12
 
13
13
  ## Deleting Sessions
14
14
 
15
- Sessions can be removed by deleting their `.jsonl` files under `~/.pi/agent/sessions/`.
15
+ Sessions can be removed by deleting their `.jsonl` files under `~/.draht/agent/sessions/`.
16
16
 
17
- Pi also supports deleting sessions interactively from `/resume` (select a session and press `Ctrl+D`, then confirm). When available, pi uses the `trash` CLI to avoid permanent deletion.
17
+ draht also supports deleting sessions interactively from `/resume` (select a session and press `Ctrl+D`, then confirm). When available, draht uses the `trash` CLI to avoid permanent deletion.
18
18
 
19
19
  ## Session Version
20
20
 
@@ -28,11 +28,11 @@ Existing sessions are automatically migrated to the current version (v3) when lo
28
28
 
29
29
  ## Source Files
30
30
 
31
- Source on GitHub ([pi-mono](https://github.com/earendil-works/pi-mono)):
32
- - [`packages/coding-agent/src/core/session-manager.ts`](https://github.com/earendil-works/pi-mono/blob/main/packages/coding-agent/src/core/session-manager.ts) - Session entry types and SessionManager
33
- - [`packages/coding-agent/src/core/messages.ts`](https://github.com/earendil-works/pi-mono/blob/main/packages/coding-agent/src/core/messages.ts) - Extended message types (BashExecutionMessage, CustomMessage, etc.)
34
- - [`packages/ai/src/types.ts`](https://github.com/earendil-works/pi-mono/blob/main/packages/ai/src/types.ts) - Base message types (UserMessage, AssistantMessage, ToolResultMessage)
35
- - [`packages/agent/src/types.ts`](https://github.com/earendil-works/pi-mono/blob/main/packages/agent/src/types.ts) - AgentMessage union type
31
+ Source on GitHub ([draht](https://github.com/draht-dev/draht)):
32
+ - [`packages/coding-agent/src/core/session-manager.ts`](https://github.com/draht-dev/draht/blob/main/packages/coding-agent/src/core/session-manager.ts) - Session entry types and SessionManager
33
+ - [`packages/coding-agent/src/core/messages.ts`](https://github.com/draht-dev/draht/blob/main/packages/coding-agent/src/core/messages.ts) - Extended message types (BashExecutionMessage, CustomMessage, etc.)
34
+ - [`packages/ai/src/types.ts`](https://github.com/draht-dev/draht/blob/main/packages/ai/src/types.ts) - Base message types (UserMessage, AssistantMessage, ToolResultMessage)
35
+ - [`packages/agent/src/types.ts`](https://github.com/draht-dev/draht/blob/main/packages/agent/src/types.ts) - AgentMessage union type
36
36
 
37
37
  For TypeScript definitions in your project, inspect `node_modules/@draht/coding-agent/dist/` and `node_modules/@draht/ai/dist/`.
38
38
 
@@ -69,7 +69,7 @@ interface ToolCall {
69
69
  }
70
70
  ```
71
71
 
72
- ### Base Message Types (from pi-ai)
72
+ ### Base Message Types (from @draht/ai)
73
73
 
74
74
  ```typescript
75
75
  interface UserMessage {
@@ -117,9 +117,9 @@ interface Usage {
117
117
  }
118
118
  ```
119
119
 
120
- The exported pi-ai `StopReason` type also includes `"pending"`, but that value is reserved for partial messages in streaming events. Terminal `done`/`error` messages replace it with a completion reason before pi persists the assistant message, so `"pending"` should never appear in session JSONL.
120
+ The exported @draht/ai `StopReason` type also includes `"pending"`, but that value is reserved for partial messages in streaming events. Terminal `done`/`error` messages replace it with a completion reason before draht persists the assistant message, so `"pending"` should never appear in session JSONL.
121
121
 
122
- ### Extended Message Types (from pi-coding-agent)
122
+ ### Extended Message Types (from @draht/coding-agent)
123
123
 
124
124
  ```typescript
125
125
  interface BashExecutionMessage {
@@ -244,7 +244,7 @@ Optional fields:
244
244
  - `usage`: LLM usage from generating the summary; included in session token and cost totals
245
245
  - `retainedTail`: Materialized `AgentMessage[]` kept after compaction. This is optional only for backward compatibility with older sessions. Newer harness-generated compactions include it so we can rebuild context from this checkpoint without walking older entries before the compaction entry.
246
246
  - `details`: Implementation-specific data (e.g., `{ readFiles: string[], modifiedFiles: string[] }` for default, or custom data for extensions)
247
- - `fromHook`: `true` if generated by an extension, `false`/`undefined` if pi-generated (legacy field name)
247
+ - `fromHook`: `true` if generated by an extension, `false`/`undefined` if draht-generated (legacy field name)
248
248
  - `firstKeptEntryId`: for compatibility with old entry format.
249
249
 
250
250
  ### BranchSummaryEntry
@@ -258,7 +258,7 @@ Created when switching branches via `/tree` with an LLM generated summary of the
258
258
  Optional fields:
259
259
  - `usage`: LLM usage from generating the summary; included in session token and cost totals
260
260
  - `details`: File tracking data (`{ readFiles: string[], modifiedFiles: string[] }`) for default, or custom data for extensions
261
- - `fromHook`: `true` if generated by an extension, `false`/`undefined` if pi-generated (legacy field name)
261
+ - `fromHook`: `true` if generated by an extension, `false`/`undefined` if draht-generated (legacy field name)
262
262
 
263
263
  ### CustomEntry
264
264
 
@@ -303,6 +303,26 @@ Session metadata (e.g., user-defined display name). Set via `/name`, `--name` /
303
303
 
304
304
  The session name is displayed in the session selector (`/resume`) instead of the first message when set.
305
305
 
306
+ ### PermissionResolutionEntry
307
+
308
+ Audit record of a resolved tool-permission request: what was asked, which options were offered, what was decided, and which surface decided it. Does NOT participate in LLM context.
309
+
310
+ ```json
311
+ {"type":"permission_resolution","id":"l2m3n4o5","parentId":"k1l2m3n4","timestamp":"2024-12-03T14:40:02.000Z","requestId":"perm_01HV","toolCallId":"call_456","toolName":"bash","cwd":"/path/to/project","detail":{"command":"rm -rf build"},"offeredOptionIds":["approve","approve-always","deny"],"decision":"approved","chosenOptionId":"approve","decidedBy":{"surface":"attach","clientId":"client-7"},"requestedAt":"2024-12-03T14:40:00.000Z","deadline":"2024-12-03T14:45:00.000Z"}
312
+ ```
313
+
314
+ Fields:
315
+ - `requestId`: relay-scoped id of the permission request this resolves
316
+ - `cwd`: canonical (realpath) working directory the tool call was evaluated against
317
+ - `detail`: `{ command?, path?, operation? }` — the decisive part of the tool input
318
+ - `offeredOptionIds`: the immutable option set that was offered, in the order it was offered
319
+ - `decision`: `approved` | `denied` | `cancelled` | `expired`
320
+ - `chosenOptionId`: `null` when nothing was chosen (cancelled/expired)
321
+ - `decidedBy.surface`: `tui` | `attach` | `rpc` | `acp` | `system`; `clientId` is `null` for local/system decisions
322
+ - `deadline`: advisory expiry communicated with the ask, or `null`
323
+
324
+ This is a RECORD ONLY and must never be treated as answerable state: `createBranchedSession` copies path entries verbatim into a fork (so `requestId`/`toolCallId` can appear in more than one session), the entry becomes the leaf on reload (the next appended message parents off it), and the RPC `get_entries` command ships it verbatim to connected clients.
325
+
306
326
  ## Tree Structure
307
327
 
308
328
  Entries form a tree:
@@ -338,6 +358,7 @@ Entries form a tree:
338
358
  - `branch_summary` -> `branchSummary`
339
359
  - `custom_message` -> `CustomMessage`
340
360
  - `custom` -> no context message
361
+ - `permission_resolution` -> no context message
341
362
 
342
363
  This makes newer compactions act like self-contained checkpoints. `retainedTail` is optional only so older sessions that only store `firstKeptEntryId` continue to load correctly.
343
364
 
@@ -410,6 +431,7 @@ Key methods for working with sessions programmatically.
410
431
  - `appendCompaction(summary, firstKeptEntryId, tokensBefore, details?, fromHook?)` - Add compaction
411
432
  - `appendCustomEntry(customType, data?)` - Extension state (not in context)
412
433
  - `appendSessionInfo(name)` - Set session display name
434
+ - `appendPermissionResolution(resolution)` - Record a resolved permission request (not in context)
413
435
  - `appendCustomMessageEntry(customType, content, display, details?)` - Extension message (in context)
414
436
  - `appendLabelChange(targetId, label)` - Set/clear label
415
437
 
package/docs/sessions.md CHANGED
@@ -1,24 +1,27 @@
1
1
  # Sessions
2
2
 
3
- Pi saves conversations as sessions so you can continue work, branch from earlier turns, and revisit previous paths.
3
+ draht saves conversations as sessions so you can continue work, branch from earlier turns, and revisit previous paths.
4
4
 
5
5
  ## Session Storage
6
6
 
7
- Sessions auto-save to `~/.pi/agent/sessions/`, organized by working directory. Each session is a JSONL file with a tree structure.
7
+ Sessions auto-save to `~/.draht/agent/sessions/`, organized by working directory. Each session is a JSONL file with a tree structure.
8
8
 
9
9
  ```bash
10
- pi -c # Continue most recent session
11
- pi -r # Browse and select from past sessions
12
- pi --no-session # Ephemeral mode; do not save
13
- pi --name "my task" # Set session display name at startup
14
- pi --session <path|id> # Use a specific session file or partial session ID
15
- pi --fork <path|id> # Fork a session file or partial session ID into a new session
10
+ draht -c # Continue most recent session
11
+ draht -r # Browse and select from past sessions
12
+ draht --no-session # Ephemeral mode; do not save
13
+ draht --name "my task" # Set session display name at startup
14
+ draht --session <path|id> # Use a specific session file or partial session ID
15
+ draht --fork <path|id> # Fork a session file or partial session ID into a new session
16
16
  ```
17
17
 
18
18
  Use `/session` in interactive mode to see the current session file, session ID, message count, tokens, and cost.
19
19
 
20
20
  For the JSONL file format and SessionManager API, see [Session Format](session-format.md).
21
21
 
22
+ To expose a running session on a Unix socket and watch or drive it from another terminal, see
23
+ [Attachable Sessions](attachable-sessions.md) (`--attachable`, `--attach`, `--list-sessions`).
24
+
22
25
  ## Session Commands
23
26
 
24
27
  | Command | Description |
@@ -36,7 +39,7 @@ For the JSONL file format and SessionManager API, see [Session Format](session-f
36
39
 
37
40
  ## Resuming and Deleting Sessions
38
41
 
39
- `/resume` opens an interactive session picker for the current project. `pi -r` opens the same picker at startup.
42
+ `/resume` opens an interactive session picker for the current project. `draht -r` opens the same picker at startup.
40
43
 
41
44
  In the picker you can:
42
45
 
@@ -47,7 +50,7 @@ In the picker you can:
47
50
  - rename with Ctrl+R
48
51
  - delete with Ctrl+D, then confirm
49
52
 
50
- When available, pi uses the `trash` CLI for deletion instead of permanently removing files.
53
+ When available, draht uses the `trash` CLI for deletion instead of permanently removing files.
51
54
 
52
55
  ## Naming Sessions
53
56
 
@@ -60,11 +63,11 @@ Use `/name <name>` to set a human-readable session name:
60
63
  Set the name at startup with `--name` or `-n`:
61
64
 
62
65
  ```bash
63
- pi --name "Refactor auth module"
64
- pi --name "CI audit" -p "Review this build failure"
66
+ draht --name "Refactor auth module"
67
+ draht --name "CI audit" -p "Review this build failure"
65
68
  ```
66
69
 
67
- Named sessions are easier to find in `/resume` and `pi -r`.
70
+ Named sessions are easier to find in `/resume` and `draht -r`.
68
71
 
69
72
  ## Branching with `/tree`
70
73
 
@@ -128,7 +131,7 @@ Use `/tree` when you want to keep alternatives together. Use `/fork` or `/clone`
128
131
 
129
132
  ## Branch Summaries
130
133
 
131
- When `/tree` switches away from one branch to another, pi can summarize the abandoned branch and attach that summary at the new position. This preserves important context from the path you left without replaying the whole branch.
134
+ When `/tree` switches away from one branch to another, draht can summarize the abandoned branch and attach that summary at the new position. This preserves important context from the path you left without replaying the whole branch.
132
135
 
133
136
  When prompted, choose one of:
134
137