@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
@@ -1 +1 @@
1
- {"version":3,"file":"skills.js","sourceRoot":"","sources":["../../src/core/skills.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,WAAW,EAAE,YAAY,EAAE,QAAQ,EAAE,MAAM,IAAI,CAAC;AACrE,OAAO,MAAM,MAAM,QAAQ,CAAC;AAC5B,OAAO,EAAE,QAAQ,EAAE,OAAO,EAAE,IAAI,EAAE,QAAQ,EAAE,OAAO,EAAE,GAAG,EAAE,MAAM,MAAM,CAAC;AACvE,OAAO,EAAE,eAAe,EAAE,WAAW,EAAE,MAAM,cAAc,CAAC;AAC5D,OAAO,EAAE,gBAAgB,EAAE,MAAM,yBAAyB,CAAC;AAC3D,OAAO,EAAE,gBAAgB,EAAE,WAAW,EAAE,MAAM,mBAAmB,CAAC;AAElE,OAAO,EAAE,yBAAyB,EAAmB,MAAM,kBAAkB,CAAC;AAE9E,+BAA+B;AAC/B,MAAM,eAAe,GAAG,EAAE,CAAC;AAE3B,sCAAsC;AACtC,MAAM,sBAAsB,GAAG,IAAI,CAAC;AAEpC,MAAM,iBAAiB,GAAG,CAAC,YAAY,EAAE,SAAS,EAAE,WAAW,CAAC,CAAC;AAIjE,SAAS,WAAW,CAAC,CAAS;IAC7B,OAAO,CAAC,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;AAC/B,CAAC;AAED,SAAS,mBAAmB,CAAC,IAAY,EAAE,MAAc;IACxD,MAAM,OAAO,GAAG,IAAI,CAAC,IAAI,EAAE,CAAC;IAC5B,IAAI,CAAC,OAAO;QAAE,OAAO,IAAI,CAAC;IAC1B,IAAI,OAAO,CAAC,UAAU,CAAC,GAAG,CAAC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AAE,IAAI,EAAE,SAAS,EAAE,OAAO,EAAE,mCAAmC,EAAE,IAAI,EAAE,YAAY,EAAE,CAAC,CAAC;YAC5G,CAAC;QACF,CAAC;QAAC,OAAO,KAAK,EAAE,CAAC;YAChB,MAAM,OAAO,GAAG,KAAK,YAAY,KAAK,CAAC,CAAC,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC,CAAC,2BAA2B,CAAC;YACrF,cAAc,CAAC,IAAI,CAAC,EAAE,IAAI,EAAE,SAAS,EAAE,OAAO,EAAE,IAAI,EAAE,YAAY,EAAE,CAAC,CAAC;QACvE,CAAC;IACF,CAAC;IAED,OAAO;QACN,MAAM,EAAE,KAAK,CAAC,IAAI,CAAC,QAAQ,CAAC,MAAM,EAAE,CAAC;QACrC,WAAW,EAAE,CAAC,GAAG,cAAc,EAAE,GAAG,oBAAoB,CAAC;KACzD,CAAC;AACH,CAAC","sourcesContent":["import { existsSync, readdirSync, readFileSync, statSync } from \"fs\";\nimport ignore from \"ignore\";\nimport { basename, dirname, join, relative, resolve, sep } from \"path\";\nimport { CONFIG_DIR_NAME, getAgentDir } from \"../config.ts\";\nimport { parseFrontmatter } from \"../utils/frontmatter.ts\";\nimport { canonicalizePath, resolvePath } from \"../utils/paths.ts\";\nimport type { ResourceDiagnostic } from \"./diagnostics.ts\";\nimport { createSyntheticSourceInfo, type SourceInfo } from \"./source-info.ts\";\n\n/** Max name length per spec */\nconst MAX_NAME_LENGTH = 64;\n\n/** Max description length per spec */\nconst MAX_DESCRIPTION_LENGTH = 1024;\n\nconst IGNORE_FILE_NAMES = [\".gitignore\", \".ignore\", \".fdignore\"];\n\ntype IgnoreMatcher = ReturnType<typeof ignore>;\n\nfunction toPosixPath(p: string): string {\n\treturn p.split(sep).join(\"/\");\n}\n\nfunction prefixIgnorePattern(line: string, prefix: string): string | null {\n\tconst trimmed = line.trim();\n\tif (!trimmed) return null;\n\tif (trimmed.startsWith(\"#\") && !trimmed.startsWith(\"\\\\#\")) return null;\n\n\tlet pattern = line;\n\tlet negated = false;\n\n\tif (pattern.startsWith(\"!\")) {\n\t\tnegated = true;\n\t\tpattern = pattern.slice(1);\n\t} else if (pattern.startsWith(\"\\\\!\")) {\n\t\tpattern = pattern.slice(1);\n\t}\n\n\tif (pattern.startsWith(\"/\")) {\n\t\tpattern = pattern.slice(1);\n\t}\n\n\tconst prefixed = prefix ? `${prefix}${pattern}` : pattern;\n\treturn negated ? `!${prefixed}` : prefixed;\n}\n\nfunction addIgnoreRules(ig: IgnoreMatcher, dir: string, rootDir: string): void {\n\tconst relativeDir = relative(rootDir, dir);\n\tconst prefix = relativeDir ? `${toPosixPath(relativeDir)}/` : \"\";\n\n\tfor (const filename of IGNORE_FILE_NAMES) {\n\t\tconst ignorePath = join(dir, filename);\n\t\tif (!existsSync(ignorePath)) continue;\n\t\ttry {\n\t\t\tconst content = readFileSync(ignorePath, \"utf-8\");\n\t\t\tconst patterns = content\n\t\t\t\t.split(/\\r?\\n/)\n\t\t\t\t.map((line) => prefixIgnorePattern(line, prefix))\n\t\t\t\t.filter((line): line is string => Boolean(line));\n\t\t\tif (patterns.length > 0) {\n\t\t\t\tig.add(patterns);\n\t\t\t}\n\t\t} catch {}\n\t}\n}\n\nexport interface SkillFrontmatter {\n\tname?: string;\n\tdescription?: string;\n\t\"disable-model-invocation\"?: boolean;\n\t[key: string]: unknown;\n}\n\nexport interface Skill {\n\tname: string;\n\tdescription: string;\n\tfilePath: string;\n\tbaseDir: string;\n\tsourceInfo: SourceInfo;\n\tdisableModelInvocation: boolean;\n}\n\nexport interface LoadSkillsResult {\n\tskills: Skill[];\n\tdiagnostics: ResourceDiagnostic[];\n}\n\n/**\n * Validate skill name per Agent Skills spec.\n * Returns array of validation error messages (empty if valid).\n */\nfunction validateName(name: string): string[] {\n\tconst errors: string[] = [];\n\n\tif (name.length > MAX_NAME_LENGTH) {\n\t\terrors.push(`name exceeds ${MAX_NAME_LENGTH} characters (${name.length})`);\n\t}\n\n\tif (!/^[a-z0-9-]+$/.test(name)) {\n\t\terrors.push(`name contains invalid characters (must be lowercase a-z, 0-9, hyphens only)`);\n\t}\n\n\tif (name.startsWith(\"-\") || name.endsWith(\"-\")) {\n\t\terrors.push(`name must not start or end with a hyphen`);\n\t}\n\n\tif (name.includes(\"--\")) {\n\t\terrors.push(`name must not contain consecutive hyphens`);\n\t}\n\n\treturn errors;\n}\n\n/**\n * Validate description per Agent Skills spec.\n */\nfunction validateDescription(description: string | undefined): string[] {\n\tconst errors: string[] = [];\n\n\tif (!description || description.trim() === \"\") {\n\t\terrors.push(\"description is required\");\n\t} else if (description.length > MAX_DESCRIPTION_LENGTH) {\n\t\terrors.push(`description exceeds ${MAX_DESCRIPTION_LENGTH} characters (${description.length})`);\n\t}\n\n\treturn errors;\n}\n\nexport interface LoadSkillsFromDirOptions {\n\t/** Directory to scan for skills */\n\tdir: string;\n\t/** Source identifier for these skills */\n\tsource: string;\n}\n\nfunction createSkillSourceInfo(filePath: string, baseDir: string, source: string): SourceInfo {\n\tswitch (source) {\n\t\tcase \"user\":\n\t\t\treturn createSyntheticSourceInfo(filePath, {\n\t\t\t\tsource: \"local\",\n\t\t\t\tscope: \"user\",\n\t\t\t\tbaseDir,\n\t\t\t});\n\t\tcase \"project\":\n\t\t\treturn createSyntheticSourceInfo(filePath, {\n\t\t\t\tsource: \"local\",\n\t\t\t\tscope: \"project\",\n\t\t\t\tbaseDir,\n\t\t\t});\n\t\tcase \"path\":\n\t\t\treturn createSyntheticSourceInfo(filePath, {\n\t\t\t\tsource: \"local\",\n\t\t\t\tbaseDir,\n\t\t\t});\n\t\tdefault:\n\t\t\treturn createSyntheticSourceInfo(filePath, { source, baseDir });\n\t}\n}\n\n/**\n * Load skills from a directory.\n *\n * Discovery rules:\n * - if a directory contains SKILL.md, treat it as a skill root and do not recurse further\n * - otherwise, load direct .md children in the root\n * - recurse into subdirectories to find SKILL.md\n */\nexport function loadSkillsFromDir(options: LoadSkillsFromDirOptions): LoadSkillsResult {\n\tconst { dir, source } = options;\n\treturn loadSkillsFromDirInternal(dir, source, true);\n}\n\nfunction loadSkillsFromDirInternal(\n\tdir: string,\n\tsource: string,\n\tincludeRootFiles: boolean,\n\tignoreMatcher?: IgnoreMatcher,\n\trootDir?: string,\n): LoadSkillsResult {\n\tconst skills: Skill[] = [];\n\tconst diagnostics: ResourceDiagnostic[] = [];\n\n\tif (!existsSync(dir)) {\n\t\treturn { skills, diagnostics };\n\t}\n\n\tconst root = rootDir ?? dir;\n\tconst ig = ignoreMatcher ?? ignore();\n\taddIgnoreRules(ig, dir, root);\n\n\ttry {\n\t\tconst entries = readdirSync(dir, { withFileTypes: true });\n\n\t\tfor (const entry of entries) {\n\t\t\tif (entry.name !== \"SKILL.md\") {\n\t\t\t\tcontinue;\n\t\t\t}\n\n\t\t\tconst fullPath = join(dir, entry.name);\n\n\t\t\tlet isFile = entry.isFile();\n\t\t\tif (entry.isSymbolicLink()) {\n\t\t\t\ttry {\n\t\t\t\t\tisFile = statSync(fullPath).isFile();\n\t\t\t\t} catch {\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tconst relPath = toPosixPath(relative(root, fullPath));\n\t\t\tif (!isFile || ig.ignores(relPath)) {\n\t\t\t\tcontinue;\n\t\t\t}\n\n\t\t\tconst result = loadSkillFromFile(fullPath, source);\n\t\t\tif (result.skill) {\n\t\t\t\tskills.push(result.skill);\n\t\t\t}\n\t\t\tdiagnostics.push(...result.diagnostics);\n\t\t\treturn { skills, diagnostics };\n\t\t}\n\n\t\tfor (const entry of entries) {\n\t\t\tif (entry.name.startsWith(\".\")) {\n\t\t\t\tcontinue;\n\t\t\t}\n\n\t\t\t// Skip node_modules to avoid scanning dependencies\n\t\t\tif (entry.name === \"node_modules\") {\n\t\t\t\tcontinue;\n\t\t\t}\n\n\t\t\tconst fullPath = join(dir, entry.name);\n\n\t\t\t// For symlinks, check if they point to a directory and follow them\n\t\t\tlet isDirectory = entry.isDirectory();\n\t\t\tlet isFile = entry.isFile();\n\t\t\tif (entry.isSymbolicLink()) {\n\t\t\t\ttry {\n\t\t\t\t\tconst stats = statSync(fullPath);\n\t\t\t\t\tisDirectory = stats.isDirectory();\n\t\t\t\t\tisFile = stats.isFile();\n\t\t\t\t} catch {\n\t\t\t\t\t// Broken symlink, skip it\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tconst relPath = toPosixPath(relative(root, fullPath));\n\t\t\tconst ignorePath = isDirectory ? `${relPath}/` : relPath;\n\t\t\tif (ig.ignores(ignorePath)) {\n\t\t\t\tcontinue;\n\t\t\t}\n\n\t\t\tif (isDirectory) {\n\t\t\t\tconst subResult = loadSkillsFromDirInternal(fullPath, source, false, ig, root);\n\t\t\t\tskills.push(...subResult.skills);\n\t\t\t\tdiagnostics.push(...subResult.diagnostics);\n\t\t\t\tcontinue;\n\t\t\t}\n\n\t\t\tif (!isFile || !includeRootFiles || !entry.name.endsWith(\".md\")) {\n\t\t\t\tcontinue;\n\t\t\t}\n\n\t\t\tconst result = loadSkillFromFile(fullPath, source);\n\t\t\tif (result.skill) {\n\t\t\t\tskills.push(result.skill);\n\t\t\t}\n\t\t\tdiagnostics.push(...result.diagnostics);\n\t\t}\n\t} catch {}\n\n\treturn { skills, diagnostics };\n}\n\nfunction loadSkillFromFile(\n\tfilePath: string,\n\tsource: string,\n): { skill: Skill | null; diagnostics: ResourceDiagnostic[] } {\n\tconst diagnostics: ResourceDiagnostic[] = [];\n\n\ttry {\n\t\tconst rawContent = readFileSync(filePath, \"utf-8\");\n\t\tconst { frontmatter } = parseFrontmatter<SkillFrontmatter>(rawContent);\n\t\tconst skillDir = dirname(filePath);\n\t\tconst parentDirName = basename(skillDir);\n\n\t\t// Validate description\n\t\tconst descErrors = validateDescription(frontmatter.description);\n\t\tfor (const error of descErrors) {\n\t\t\tdiagnostics.push({ type: \"warning\", message: error, path: filePath });\n\t\t}\n\n\t\t// Use name from frontmatter, or fall back to parent directory name\n\t\tconst name = frontmatter.name || parentDirName;\n\n\t\t// Validate name\n\t\tconst nameErrors = validateName(name);\n\t\tfor (const error of nameErrors) {\n\t\t\tdiagnostics.push({ type: \"warning\", message: error, path: filePath });\n\t\t}\n\n\t\t// Still load the skill even with warnings (unless description is completely missing)\n\t\tif (!frontmatter.description || frontmatter.description.trim() === \"\") {\n\t\t\treturn { skill: null, diagnostics };\n\t\t}\n\n\t\treturn {\n\t\t\tskill: {\n\t\t\t\tname,\n\t\t\t\tdescription: frontmatter.description,\n\t\t\t\tfilePath,\n\t\t\t\tbaseDir: skillDir,\n\t\t\t\tsourceInfo: createSkillSourceInfo(filePath, skillDir, source),\n\t\t\t\tdisableModelInvocation: frontmatter[\"disable-model-invocation\"] === true,\n\t\t\t},\n\t\t\tdiagnostics,\n\t\t};\n\t} catch (error) {\n\t\tconst message = error instanceof Error ? error.message : \"failed to parse skill file\";\n\t\tdiagnostics.push({ type: \"warning\", message, path: filePath });\n\t\treturn { skill: null, diagnostics };\n\t}\n}\n\n/**\n * Format skills for inclusion in a system prompt.\n * Uses XML format per Agent Skills standard.\n * See: https://agentskills.io/integrate-skills\n *\n * Skills with disableModelInvocation=true are excluded from the prompt\n * (they can only be invoked explicitly via /skill:name commands).\n */\nexport function formatSkillsForPrompt(skills: Skill[]): string {\n\tconst visibleSkills = skills.filter((s) => !s.disableModelInvocation);\n\n\tif (visibleSkills.length === 0) {\n\t\treturn \"\";\n\t}\n\n\tconst lines = [\n\t\t\"\\n\\nThe following skills provide specialized instructions for specific tasks.\",\n\t\t\"Use the read tool to load a skill's file when the task matches its description.\",\n\t\t\"When a skill file references a relative path, resolve it against the skill directory (parent of SKILL.md / dirname of the path) and use that absolute path in tool commands.\",\n\t\t\"\",\n\t\t\"<available_skills>\",\n\t];\n\n\tfor (const skill of visibleSkills) {\n\t\tlines.push(\" <skill>\");\n\t\tlines.push(` <name>${escapeXml(skill.name)}</name>`);\n\t\tlines.push(` <description>${escapeXml(skill.description)}</description>`);\n\t\tlines.push(` <location>${escapeXml(skill.filePath)}</location>`);\n\t\tlines.push(\" </skill>\");\n\t}\n\n\tlines.push(\"</available_skills>\");\n\n\treturn lines.join(\"\\n\");\n}\n\nfunction escapeXml(str: string): string {\n\treturn str\n\t\t.replace(/&/g, \"&amp;\")\n\t\t.replace(/</g, \"&lt;\")\n\t\t.replace(/>/g, \"&gt;\")\n\t\t.replace(/\"/g, \"&quot;\")\n\t\t.replace(/'/g, \"&apos;\");\n}\n\nexport interface LoadSkillsOptions {\n\t/** Working directory for project-local skills. */\n\tcwd: string;\n\t/** Agent config directory for global skills. */\n\tagentDir: string;\n\t/** Explicit skill paths (files or directories) */\n\tskillPaths: string[];\n\t/** Include default skills directories. */\n\tincludeDefaults: boolean;\n}\n\n/**\n * Load skills from all configured locations.\n * Returns skills and any validation diagnostics.\n */\nexport function loadSkills(options: LoadSkillsOptions): LoadSkillsResult {\n\tconst { agentDir, skillPaths, includeDefaults } = options;\n\n\t// Resolve agentDir - if not provided, use default from config\n\tconst resolvedCwd = resolvePath(options.cwd);\n\tconst resolvedAgentDir = resolvePath(agentDir ?? getAgentDir());\n\n\tconst skillMap = new Map<string, Skill>();\n\tconst realPathSet = new Set<string>();\n\tconst allDiagnostics: ResourceDiagnostic[] = [];\n\tconst collisionDiagnostics: ResourceDiagnostic[] = [];\n\n\tfunction addSkills(result: LoadSkillsResult) {\n\t\tallDiagnostics.push(...result.diagnostics);\n\t\tfor (const skill of result.skills) {\n\t\t\t// Resolve symlinks to detect duplicate files\n\t\t\tconst realPath = canonicalizePath(skill.filePath);\n\n\t\t\t// Skip silently if we've already loaded this exact file (via symlink)\n\t\t\tif (realPathSet.has(realPath)) {\n\t\t\t\tcontinue;\n\t\t\t}\n\n\t\t\tconst existing = skillMap.get(skill.name);\n\t\t\tif (existing) {\n\t\t\t\tcollisionDiagnostics.push({\n\t\t\t\t\ttype: \"collision\",\n\t\t\t\t\tmessage: `name \"${skill.name}\" collision`,\n\t\t\t\t\tpath: skill.filePath,\n\t\t\t\t\tcollision: {\n\t\t\t\t\t\tresourceType: \"skill\",\n\t\t\t\t\t\tname: skill.name,\n\t\t\t\t\t\twinnerPath: existing.filePath,\n\t\t\t\t\t\tloserPath: skill.filePath,\n\t\t\t\t\t},\n\t\t\t\t});\n\t\t\t} else {\n\t\t\t\tskillMap.set(skill.name, skill);\n\t\t\t\trealPathSet.add(realPath);\n\t\t\t}\n\t\t}\n\t}\n\n\tif (includeDefaults) {\n\t\taddSkills(loadSkillsFromDirInternal(join(resolvedAgentDir, \"skills\"), \"user\", true));\n\t\taddSkills(loadSkillsFromDirInternal(resolve(resolvedCwd, CONFIG_DIR_NAME, \"skills\"), \"project\", true));\n\t}\n\n\tconst userSkillsDir = join(resolvedAgentDir, \"skills\");\n\tconst projectSkillsDir = resolve(resolvedCwd, CONFIG_DIR_NAME, \"skills\");\n\n\tconst isUnderPath = (target: string, root: string): boolean => {\n\t\tconst normalizedRoot = resolve(root);\n\t\tif (target === normalizedRoot) {\n\t\t\treturn true;\n\t\t}\n\t\tconst prefix = normalizedRoot.endsWith(sep) ? normalizedRoot : `${normalizedRoot}${sep}`;\n\t\treturn target.startsWith(prefix);\n\t};\n\n\tconst getSource = (resolvedPath: string): \"user\" | \"project\" | \"path\" => {\n\t\tif (!includeDefaults) {\n\t\t\tif (isUnderPath(resolvedPath, userSkillsDir)) return \"user\";\n\t\t\tif (isUnderPath(resolvedPath, projectSkillsDir)) return \"project\";\n\t\t}\n\t\treturn \"path\";\n\t};\n\n\tfor (const rawPath of skillPaths) {\n\t\tconst resolvedPath = resolvePath(rawPath, resolvedCwd, { trim: true });\n\t\tif (!existsSync(resolvedPath)) {\n\t\t\tallDiagnostics.push({ type: \"warning\", message: \"skill path does not exist\", path: resolvedPath });\n\t\t\tcontinue;\n\t\t}\n\n\t\ttry {\n\t\t\tconst stats = statSync(resolvedPath);\n\t\t\tconst source = getSource(resolvedPath);\n\t\t\tif (stats.isDirectory()) {\n\t\t\t\taddSkills(loadSkillsFromDirInternal(resolvedPath, source, true));\n\t\t\t} else if (stats.isFile() && resolvedPath.endsWith(\".md\")) {\n\t\t\t\tconst result = loadSkillFromFile(resolvedPath, source);\n\t\t\t\tif (result.skill) {\n\t\t\t\t\taddSkills({ skills: [result.skill], diagnostics: result.diagnostics });\n\t\t\t\t} else {\n\t\t\t\t\tallDiagnostics.push(...result.diagnostics);\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\tallDiagnostics.push({ type: \"warning\", message: \"skill path is not a markdown file\", path: resolvedPath });\n\t\t\t}\n\t\t} catch (error) {\n\t\t\tconst message = error instanceof Error ? error.message : \"failed to read skill path\";\n\t\t\tallDiagnostics.push({ type: \"warning\", message, path: resolvedPath });\n\t\t}\n\t}\n\n\treturn {\n\t\tskills: Array.from(skillMap.values()),\n\t\tdiagnostics: [...allDiagnostics, ...collisionDiagnostics],\n\t};\n}\n"]}
1
+ {"version":3,"file":"skills.js","sourceRoot":"","sources":["../../src/core/skills.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,WAAW,EAAE,YAAY,EAAE,QAAQ,EAAE,MAAM,IAAI,CAAC;AACrE,OAAO,MAAM,MAAM,QAAQ,CAAC;AAC5B,OAAO,EAAE,QAAQ,EAAE,OAAO,EAAE,IAAI,EAAE,QAAQ,EAAE,OAAO,EAAE,GAAG,EAAE,MAAM,MAAM,CAAC;AACvE,OAAO,EAAE,eAAe,EAAE,WAAW,EAAE,mBAAmB,EAAE,MAAM,cAAc,CAAC;AACjF,OAAO,EAAE,cAAc,EAAE,MAAM,4BAA4B,CAAC;AAC5D,OAAO,EAAE,gBAAgB,EAAE,MAAM,yBAAyB,CAAC;AAC3D,OAAO,EAAE,WAAW,EAAE,MAAM,mBAAmB,CAAC;AAEhD,OAAO,EAAE,yBAAyB,EAAmB,MAAM,kBAAkB,CAAC;AAE9E,+BAA+B;AAC/B,MAAM,eAAe,GAAG,EAAE,CAAC;AAE3B,sCAAsC;AACtC,MAAM,sBAAsB,GAAG,IAAI,CAAC;AAEpC,MAAM,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AE,CAAC;QACrC,WAAW,EAAE,CAAC,GAAG,cAAc,EAAE,GAAG,oBAAoB,CAAC;KACzD,CAAC;AACH,CAAC","sourcesContent":["import { existsSync, readdirSync, readFileSync, statSync } from \"fs\";\nimport ignore from \"ignore\";\nimport { basename, dirname, join, relative, resolve, sep } from \"path\";\nimport { CONFIG_DIR_NAME, getAgentDir, getShippedSkillsDir } from \"../config.ts\";\nimport { comparablePath } from \"../utils/canonical-path.ts\";\nimport { parseFrontmatter } from \"../utils/frontmatter.ts\";\nimport { resolvePath } from \"../utils/paths.ts\";\nimport type { ResourceDiagnostic } from \"./diagnostics.ts\";\nimport { createSyntheticSourceInfo, type SourceInfo } from \"./source-info.ts\";\n\n/** Max name length per spec */\nconst MAX_NAME_LENGTH = 64;\n\n/** Max description length per spec */\nconst MAX_DESCRIPTION_LENGTH = 1024;\n\nconst IGNORE_FILE_NAMES = [\".gitignore\", \".ignore\", \".fdignore\"];\n\ntype IgnoreMatcher = ReturnType<typeof ignore>;\n\nfunction toPosixPath(p: string): string {\n\treturn p.split(sep).join(\"/\");\n}\n\nfunction prefixIgnorePattern(line: string, prefix: string): string | null {\n\tconst trimmed = line.trim();\n\tif (!trimmed) return null;\n\tif (trimmed.startsWith(\"#\") && !trimmed.startsWith(\"\\\\#\")) return null;\n\n\tlet pattern = line;\n\tlet negated = false;\n\n\tif (pattern.startsWith(\"!\")) {\n\t\tnegated = true;\n\t\tpattern = pattern.slice(1);\n\t} else if (pattern.startsWith(\"\\\\!\")) {\n\t\tpattern = pattern.slice(1);\n\t}\n\n\tif (pattern.startsWith(\"/\")) {\n\t\tpattern = pattern.slice(1);\n\t}\n\n\tconst prefixed = prefix ? `${prefix}${pattern}` : pattern;\n\treturn negated ? `!${prefixed}` : prefixed;\n}\n\nfunction addIgnoreRules(ig: IgnoreMatcher, dir: string, rootDir: string): void {\n\tconst relativeDir = relative(rootDir, dir);\n\tconst prefix = relativeDir ? `${toPosixPath(relativeDir)}/` : \"\";\n\n\tfor (const filename of IGNORE_FILE_NAMES) {\n\t\tconst ignorePath = join(dir, filename);\n\t\tif (!existsSync(ignorePath)) continue;\n\t\ttry {\n\t\t\tconst content = readFileSync(ignorePath, \"utf-8\");\n\t\t\tconst patterns = content\n\t\t\t\t.split(/\\r?\\n/)\n\t\t\t\t.map((line) => prefixIgnorePattern(line, prefix))\n\t\t\t\t.filter((line): line is string => Boolean(line));\n\t\t\tif (patterns.length > 0) {\n\t\t\t\tig.add(patterns);\n\t\t\t}\n\t\t} catch {}\n\t}\n}\n\nexport interface SkillFrontmatter {\n\tname?: string;\n\tdescription?: string;\n\t\"disable-model-invocation\"?: boolean;\n\t[key: string]: unknown;\n}\n\nexport interface Skill {\n\tname: string;\n\tdescription: string;\n\tfilePath: string;\n\tbaseDir: string;\n\tsourceInfo: SourceInfo;\n\tdisableModelInvocation: boolean;\n}\n\nexport interface LoadSkillsResult {\n\tskills: Skill[];\n\tdiagnostics: ResourceDiagnostic[];\n}\n\n/**\n * Validate skill name per Agent Skills spec.\n * Returns array of validation error messages (empty if valid).\n */\nfunction validateName(name: string): string[] {\n\tconst errors: string[] = [];\n\n\tif (name.length > MAX_NAME_LENGTH) {\n\t\terrors.push(`name exceeds ${MAX_NAME_LENGTH} characters (${name.length})`);\n\t}\n\n\tif (!/^[a-z0-9-]+$/.test(name)) {\n\t\terrors.push(`name contains invalid characters (must be lowercase a-z, 0-9, hyphens only)`);\n\t}\n\n\tif (name.startsWith(\"-\") || name.endsWith(\"-\")) {\n\t\terrors.push(`name must not start or end with a hyphen`);\n\t}\n\n\tif (name.includes(\"--\")) {\n\t\terrors.push(`name must not contain consecutive hyphens`);\n\t}\n\n\treturn errors;\n}\n\n/**\n * Validate description per Agent Skills spec.\n */\nfunction validateDescription(description: string | undefined): string[] {\n\tconst errors: string[] = [];\n\n\tif (!description || description.trim() === \"\") {\n\t\terrors.push(\"description is required\");\n\t} else if (description.length > MAX_DESCRIPTION_LENGTH) {\n\t\terrors.push(`description exceeds ${MAX_DESCRIPTION_LENGTH} characters (${description.length})`);\n\t}\n\n\treturn errors;\n}\n\nexport interface LoadSkillsFromDirOptions {\n\t/** Directory to scan for skills */\n\tdir: string;\n\t/** Source identifier for these skills */\n\tsource: string;\n}\n\nfunction createSkillSourceInfo(filePath: string, baseDir: string, source: string): SourceInfo {\n\tswitch (source) {\n\t\tcase \"builtin\":\n\t\t\treturn createSyntheticSourceInfo(filePath, {\n\t\t\t\tsource: \"builtin\",\n\t\t\t\tscope: \"user\",\n\t\t\t\tbaseDir,\n\t\t\t});\n\t\tcase \"user\":\n\t\t\treturn createSyntheticSourceInfo(filePath, {\n\t\t\t\tsource: \"local\",\n\t\t\t\tscope: \"user\",\n\t\t\t\tbaseDir,\n\t\t\t});\n\t\tcase \"project\":\n\t\t\treturn createSyntheticSourceInfo(filePath, {\n\t\t\t\tsource: \"local\",\n\t\t\t\tscope: \"project\",\n\t\t\t\tbaseDir,\n\t\t\t});\n\t\tcase \"path\":\n\t\t\treturn createSyntheticSourceInfo(filePath, {\n\t\t\t\tsource: \"local\",\n\t\t\t\tbaseDir,\n\t\t\t});\n\t\tdefault:\n\t\t\treturn createSyntheticSourceInfo(filePath, { source, baseDir });\n\t}\n}\n\n/**\n * Load skills from a directory.\n *\n * Discovery rules:\n * - if a directory contains SKILL.md, treat it as a skill root and do not recurse further\n * - otherwise, load direct .md children in the root\n * - recurse into subdirectories to find SKILL.md\n */\nexport function loadSkillsFromDir(options: LoadSkillsFromDirOptions): LoadSkillsResult {\n\tconst { dir, source } = options;\n\treturn loadSkillsFromDirInternal(dir, source, true);\n}\n\nfunction loadSkillsFromDirInternal(\n\tdir: string,\n\tsource: string,\n\tincludeRootFiles: boolean,\n\tignoreMatcher?: IgnoreMatcher,\n\trootDir?: string,\n): LoadSkillsResult {\n\tconst skills: Skill[] = [];\n\tconst diagnostics: ResourceDiagnostic[] = [];\n\n\tif (!existsSync(dir)) {\n\t\treturn { skills, diagnostics };\n\t}\n\n\tconst root = rootDir ?? dir;\n\tconst ig = ignoreMatcher ?? ignore();\n\taddIgnoreRules(ig, dir, root);\n\n\ttry {\n\t\tconst entries = readdirSync(dir, { withFileTypes: true });\n\n\t\tfor (const entry of entries) {\n\t\t\tif (entry.name !== \"SKILL.md\") {\n\t\t\t\tcontinue;\n\t\t\t}\n\n\t\t\tconst fullPath = join(dir, entry.name);\n\n\t\t\tlet isFile = entry.isFile();\n\t\t\tif (entry.isSymbolicLink()) {\n\t\t\t\ttry {\n\t\t\t\t\tisFile = statSync(fullPath).isFile();\n\t\t\t\t} catch {\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tconst relPath = toPosixPath(relative(root, fullPath));\n\t\t\tif (!isFile || ig.ignores(relPath)) {\n\t\t\t\tcontinue;\n\t\t\t}\n\n\t\t\tconst result = loadSkillFromFile(fullPath, source);\n\t\t\tif (result.skill) {\n\t\t\t\tskills.push(result.skill);\n\t\t\t}\n\t\t\tdiagnostics.push(...result.diagnostics);\n\t\t\treturn { skills, diagnostics };\n\t\t}\n\n\t\tfor (const entry of entries) {\n\t\t\tif (entry.name.startsWith(\".\")) {\n\t\t\t\tcontinue;\n\t\t\t}\n\n\t\t\t// Skip node_modules to avoid scanning dependencies\n\t\t\tif (entry.name === \"node_modules\") {\n\t\t\t\tcontinue;\n\t\t\t}\n\n\t\t\tconst fullPath = join(dir, entry.name);\n\n\t\t\t// For symlinks, check if they point to a directory and follow them\n\t\t\tlet isDirectory = entry.isDirectory();\n\t\t\tlet isFile = entry.isFile();\n\t\t\tif (entry.isSymbolicLink()) {\n\t\t\t\ttry {\n\t\t\t\t\tconst stats = statSync(fullPath);\n\t\t\t\t\tisDirectory = stats.isDirectory();\n\t\t\t\t\tisFile = stats.isFile();\n\t\t\t\t} catch {\n\t\t\t\t\t// Broken symlink, skip it\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tconst relPath = toPosixPath(relative(root, fullPath));\n\t\t\tconst ignorePath = isDirectory ? `${relPath}/` : relPath;\n\t\t\tif (ig.ignores(ignorePath)) {\n\t\t\t\tcontinue;\n\t\t\t}\n\n\t\t\tif (isDirectory) {\n\t\t\t\tconst subResult = loadSkillsFromDirInternal(fullPath, source, false, ig, root);\n\t\t\t\tskills.push(...subResult.skills);\n\t\t\t\tdiagnostics.push(...subResult.diagnostics);\n\t\t\t\tcontinue;\n\t\t\t}\n\n\t\t\tif (!isFile || !includeRootFiles || !entry.name.endsWith(\".md\")) {\n\t\t\t\tcontinue;\n\t\t\t}\n\n\t\t\tconst result = loadSkillFromFile(fullPath, source);\n\t\t\tif (result.skill) {\n\t\t\t\tskills.push(result.skill);\n\t\t\t}\n\t\t\tdiagnostics.push(...result.diagnostics);\n\t\t}\n\t} catch {}\n\n\treturn { skills, diagnostics };\n}\n\nfunction loadSkillFromFile(\n\tfilePath: string,\n\tsource: string,\n): { skill: Skill | null; diagnostics: ResourceDiagnostic[] } {\n\tconst diagnostics: ResourceDiagnostic[] = [];\n\n\ttry {\n\t\tconst rawContent = readFileSync(filePath, \"utf-8\");\n\t\tconst { frontmatter } = parseFrontmatter<SkillFrontmatter>(rawContent);\n\t\tconst skillDir = dirname(filePath);\n\t\tconst parentDirName = basename(skillDir);\n\n\t\t// Validate description\n\t\tconst descErrors = validateDescription(frontmatter.description);\n\t\tfor (const error of descErrors) {\n\t\t\tdiagnostics.push({ type: \"warning\", message: error, path: filePath });\n\t\t}\n\n\t\t// Use name from frontmatter, or fall back to parent directory name\n\t\tconst name = frontmatter.name || parentDirName;\n\n\t\t// Validate name\n\t\tconst nameErrors = validateName(name);\n\t\tfor (const error of nameErrors) {\n\t\t\tdiagnostics.push({ type: \"warning\", message: error, path: filePath });\n\t\t}\n\n\t\t// Still load the skill even with warnings (unless description is completely missing)\n\t\tif (!frontmatter.description || frontmatter.description.trim() === \"\") {\n\t\t\treturn { skill: null, diagnostics };\n\t\t}\n\n\t\treturn {\n\t\t\tskill: {\n\t\t\t\tname,\n\t\t\t\tdescription: frontmatter.description,\n\t\t\t\tfilePath,\n\t\t\t\tbaseDir: skillDir,\n\t\t\t\tsourceInfo: createSkillSourceInfo(filePath, skillDir, source),\n\t\t\t\tdisableModelInvocation: frontmatter[\"disable-model-invocation\"] === true,\n\t\t\t},\n\t\t\tdiagnostics,\n\t\t};\n\t} catch (error) {\n\t\tconst message = error instanceof Error ? error.message : \"failed to parse skill file\";\n\t\tdiagnostics.push({ type: \"warning\", message, path: filePath });\n\t\treturn { skill: null, diagnostics };\n\t}\n}\n\n/**\n * Format skills for inclusion in a system prompt.\n * Uses XML format per Agent Skills standard.\n * See: https://agentskills.io/integrate-skills\n *\n * Skills with disableModelInvocation=true are excluded from the prompt\n * (they can only be invoked explicitly via /skill:name commands).\n */\nexport function formatSkillsForPrompt(skills: Skill[], fileReadTool: \"read\" | \"bash\" = \"read\"): string {\n\tconst visibleSkills = skills.filter((s) => !s.disableModelInvocation);\n\n\tif (visibleSkills.length === 0) {\n\t\treturn \"\";\n\t}\n\n\tconst lines = [\n\t\t\"\\n\\nThe following skills provide specialized instructions for specific tasks.\",\n\t\tfileReadTool === \"read\"\n\t\t\t? \"Use the read tool to load a skill's file when the task matches its description.\"\n\t\t\t: \"Use bash to load a skill's file when the task matches its description.\",\n\t\t\"When a skill file references a relative path, resolve it against the skill directory (parent of SKILL.md / dirname of the path) and use that absolute path in tool commands.\",\n\t\t\"\",\n\t\t\"<available_skills>\",\n\t];\n\n\tfor (const skill of visibleSkills) {\n\t\tlines.push(\" <skill>\");\n\t\tlines.push(` <name>${escapeXml(skill.name)}</name>`);\n\t\tlines.push(` <description>${escapeXml(skill.description)}</description>`);\n\t\tlines.push(` <location>${escapeXml(skill.filePath)}</location>`);\n\t\tlines.push(\" </skill>\");\n\t}\n\n\tlines.push(\"</available_skills>\");\n\n\treturn lines.join(\"\\n\");\n}\n\nfunction escapeXml(str: string): string {\n\treturn str\n\t\t.replace(/&/g, \"&amp;\")\n\t\t.replace(/</g, \"&lt;\")\n\t\t.replace(/>/g, \"&gt;\")\n\t\t.replace(/\"/g, \"&quot;\")\n\t\t.replace(/'/g, \"&apos;\");\n}\n\nexport interface LoadSkillsOptions {\n\t/** Working directory for project-local skills. */\n\tcwd: string;\n\t/** Agent config directory for global skills. */\n\tagentDir: string;\n\t/** Explicit skill paths (files or directories) */\n\tskillPaths: string[];\n\t/** Include default skills directories. */\n\tincludeDefaults: boolean;\n\t/** Include skills shipped with the package (builtin skills). */\n\tincludeShipped?: boolean;\n}\n\n/**\n * Load skills from all configured locations.\n * Returns skills and any validation diagnostics.\n */\nexport function loadSkills(options: LoadSkillsOptions): LoadSkillsResult {\n\tconst { agentDir, skillPaths, includeDefaults, includeShipped } = options;\n\n\t// Resolve agentDir - if not provided, use default from config\n\tconst resolvedCwd = resolvePath(options.cwd);\n\tconst resolvedAgentDir = resolvePath(agentDir ?? getAgentDir());\n\n\tconst skillMap = new Map<string, Skill>();\n\tconst realPathSet = new Set<string>();\n\tconst allDiagnostics: ResourceDiagnostic[] = [];\n\tconst collisionDiagnostics: ResourceDiagnostic[] = [];\n\n\tfunction addSkills(result: LoadSkillsResult) {\n\t\tallDiagnostics.push(...result.diagnostics);\n\t\tfor (const skill of result.skills) {\n\t\t\t// Resolve symlinks to detect duplicate files\n\t\t\tconst realPath = comparablePath(skill.filePath);\n\n\t\t\t// Skip silently if we've already loaded this exact file (via symlink)\n\t\t\tif (realPathSet.has(realPath)) {\n\t\t\t\tcontinue;\n\t\t\t}\n\n\t\t\tconst existing = skillMap.get(skill.name);\n\t\t\tif (existing) {\n\t\t\t\tcollisionDiagnostics.push({\n\t\t\t\t\ttype: \"collision\",\n\t\t\t\t\tmessage: `name \"${skill.name}\" collision`,\n\t\t\t\t\tpath: skill.filePath,\n\t\t\t\t\tcollision: {\n\t\t\t\t\t\tresourceType: \"skill\",\n\t\t\t\t\t\tname: skill.name,\n\t\t\t\t\t\twinnerPath: existing.filePath,\n\t\t\t\t\t\tloserPath: skill.filePath,\n\t\t\t\t\t},\n\t\t\t\t});\n\t\t\t} else {\n\t\t\t\tskillMap.set(skill.name, skill);\n\t\t\t\trealPathSet.add(realPath);\n\t\t\t}\n\t\t}\n\t}\n\n\tif (includeDefaults) {\n\t\taddSkills(loadSkillsFromDirInternal(join(resolvedAgentDir, \"skills\"), \"user\", true));\n\t\taddSkills(loadSkillsFromDirInternal(resolve(resolvedCwd, CONFIG_DIR_NAME, \"skills\"), \"project\", true));\n\t}\n\n\tconst userSkillsDir = join(resolvedAgentDir, \"skills\");\n\tconst projectSkillsDir = resolve(resolvedCwd, CONFIG_DIR_NAME, \"skills\");\n\n\tconst isUnderPath = (target: string, root: string): boolean => {\n\t\tconst normalizedRoot = resolve(root);\n\t\tif (target === normalizedRoot) {\n\t\t\treturn true;\n\t\t}\n\t\tconst prefix = normalizedRoot.endsWith(sep) ? normalizedRoot : `${normalizedRoot}${sep}`;\n\t\treturn target.startsWith(prefix);\n\t};\n\n\tconst getSource = (resolvedPath: string): \"user\" | \"project\" | \"path\" => {\n\t\tif (!includeDefaults) {\n\t\t\tif (isUnderPath(resolvedPath, userSkillsDir)) return \"user\";\n\t\t\tif (isUnderPath(resolvedPath, projectSkillsDir)) return \"project\";\n\t\t}\n\t\treturn \"path\";\n\t};\n\n\tfor (const rawPath of skillPaths) {\n\t\tconst resolvedPath = resolvePath(rawPath, resolvedCwd, { trim: true });\n\t\tif (!existsSync(resolvedPath)) {\n\t\t\tallDiagnostics.push({ type: \"warning\", message: \"skill path does not exist\", path: resolvedPath });\n\t\t\tcontinue;\n\t\t}\n\n\t\ttry {\n\t\t\tconst stats = statSync(resolvedPath);\n\t\t\tconst source = getSource(resolvedPath);\n\t\t\tif (stats.isDirectory()) {\n\t\t\t\taddSkills(loadSkillsFromDirInternal(resolvedPath, source, true));\n\t\t\t} else if (stats.isFile() && resolvedPath.endsWith(\".md\")) {\n\t\t\t\tconst result = loadSkillFromFile(resolvedPath, source);\n\t\t\t\tif (result.skill) {\n\t\t\t\t\taddSkills({ skills: [result.skill], diagnostics: result.diagnostics });\n\t\t\t\t} else {\n\t\t\t\t\tallDiagnostics.push(...result.diagnostics);\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\tallDiagnostics.push({ type: \"warning\", message: \"skill path is not a markdown file\", path: resolvedPath });\n\t\t\t}\n\t\t} catch (error) {\n\t\t\tconst message = error instanceof Error ? error.message : \"failed to read skill path\";\n\t\t\tallDiagnostics.push({ type: \"warning\", message, path: resolvedPath });\n\t\t}\n\t}\n\n\t// Shipped (builtin) skills load last so user/project/CLI skills win name collisions.\n\tif (includeShipped) {\n\t\taddSkills(loadSkillsFromDirInternal(getShippedSkillsDir(), \"builtin\", false));\n\t}\n\n\treturn {\n\t\tskills: Array.from(skillMap.values()),\n\t\tdiagnostics: [...allDiagnostics, ...collisionDiagnostics],\n\t};\n}\n"]}
@@ -1 +1 @@
1
- {"version":3,"file":"slash-commands.d.ts","sourceRoot":"","sources":["../../src/core/slash-commands.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,kBAAkB,CAAC;AAEnD,MAAM,MAAM,kBAAkB,GAAG,WAAW,GAAG,QAAQ,GAAG,OAAO,CAAC;AAElE,MAAM,WAAW,gBAAgB;IAChC,IAAI,EAAE,MAAM,CAAC;IACb,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,MAAM,EAAE,kBAAkB,CAAC;IAC3B,UAAU,EAAE,UAAU,CAAC;CACvB;AAED,MAAM,WAAW,mBAAmB;IACnC,IAAI,EAAE,MAAM,CAAC;IACb,WAAW,EAAE,MAAM,CAAC;IACpB,YAAY,CAAC,EAAE,MAAM,CAAC;CACtB;AAED,eAAO,MAAM,sBAAsB,EAAE,aAAa,CAAC,mBAAmB,CAuBrE,CAAC"}
1
+ {"version":3,"file":"slash-commands.d.ts","sourceRoot":"","sources":["../../src/core/slash-commands.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,kBAAkB,CAAC;AAEnD,MAAM,MAAM,kBAAkB,GAAG,WAAW,GAAG,QAAQ,GAAG,OAAO,CAAC;AAElE,MAAM,WAAW,gBAAgB;IAChC,IAAI,EAAE,MAAM,CAAC;IACb,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,MAAM,EAAE,kBAAkB,CAAC;IAC3B,UAAU,EAAE,UAAU,CAAC;CACvB;AAED,MAAM,WAAW,mBAAmB;IACnC,IAAI,EAAE,MAAM,CAAC;IACb,WAAW,EAAE,MAAM,CAAC;IACpB,YAAY,CAAC,EAAE,MAAM,CAAC;CACtB;AAED,eAAO,MAAM,sBAAsB,EAAE,aAAa,CAAC,mBAAmB,CAwBrE,CAAC"}
@@ -14,6 +14,7 @@ export const BUILTIN_SLASH_COMMANDS = [
14
14
  { name: "fork", description: "Create a new fork from a previous user message" },
15
15
  { name: "clone", description: "Duplicate the current session at the current position" },
16
16
  { name: "tree", description: "Navigate session tree (switch branches)" },
17
+ { name: "rewind", description: "Rewind conversation and/or files to an earlier checkpoint" },
17
18
  { name: "trust", description: "Save project trust decision for future sessions" },
18
19
  { name: "login", description: "Configure provider authentication", argumentHint: "<provider>" },
19
20
  { name: "logout", description: "Remove provider authentication" },
@@ -1 +1 @@
1
- {"version":3,"file":"slash-commands.js","sourceRoot":"","sources":["../../src/core/slash-commands.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,cAAc,CAAC;AAkBxC,MAAM,CAAC,MAAM,sBAAsB,GAAuC;IACzE,EAAE,IAAI,EAAE,UAAU,EAAE,WAAW,EAAE,oBAAoB,EAAE;IACvD,EAAE,IAAI,EAAE,OAAO,EAAE,WAAW,EAAE,kCAAkC,EAAE,YAAY,EAAE,kBAAkB,EAAE;IACpG,EAAE,IAAI,EAAE,eAAe,EAAE,WAAW,EAAE,0CAA0C,EAAE;IAClF,EAAE,IAAI,EAAE,QAAQ,EAAE,WAAW,EAAE,8DAA8D,EAAE;IAC/F,EAAE,IAAI,EAAE,QAAQ,EAAE,WAAW,EAAE,+CAA+C,EAAE;IAChF,EAAE,IAAI,EAAE,OAAO,EAAE,WAAW,EAAE,uCAAuC,EAAE;IACvE,EAAE,IAAI,EAAE,MAAM,EAAE,WAAW,EAAE,sCAAsC,EAAE;IACrE,EAAE,IAAI,EAAE,MAAM,EAAE,WAAW,EAAE,0BAA0B,EAAE;IACzD,EAAE,IAAI,EAAE,SAAS,EAAE,WAAW,EAAE,6BAA6B,EAAE;IAC/D,EAAE,IAAI,EAAE,WAAW,EAAE,WAAW,EAAE,wBAAwB,EAAE;IAC5D,EAAE,IAAI,EAAE,SAAS,EAAE,WAAW,EAAE,6BAA6B,EAAE;IAC/D,EAAE,IAAI,EAAE,MAAM,EAAE,WAAW,EAAE,gDAAgD,EAAE;IAC/E,EAAE,IAAI,EAAE,OAAO,EAAE,WAAW,EAAE,uDAAuD,EAAE;IACvF,EAAE,IAAI,EAAE,MAAM,EAAE,WAAW,EAAE,yCAAyC,EAAE;IACxE,EAAE,IAAI,EAAE,OAAO,EAAE,WAAW,EAAE,iDAAiD,EAAE;IACjF,EAAE,IAAI,EAAE,OAAO,EAAE,WAAW,EAAE,mCAAmC,EAAE,YAAY,EAAE,YAAY,EAAE;IAC/F,EAAE,IAAI,EAAE,QAAQ,EAAE,WAAW,EAAE,gCAAgC,EAAE;IACjE,EAAE,IAAI,EAAE,KAAK,EAAE,WAAW,EAAE,qBAAqB,EAAE;IACnD,EAAE,IAAI,EAAE,SAAS,EAAE,WAAW,EAAE,sCAAsC,EAAE;IACxE,EAAE,IAAI,EAAE,QAAQ,EAAE,WAAW,EAAE,4BAA4B,EAAE;IAC7D,EAAE,IAAI,EAAE,QAAQ,EAAE,WAAW,EAAE,4EAA4E,EAAE;IAC7G,EAAE,IAAI,EAAE,MAAM,EAAE,WAAW,EAAE,QAAQ,QAAQ,EAAE,EAAE;CACjD,CAAC","sourcesContent":["import { APP_NAME } from \"../config.ts\";\nimport type { SourceInfo } from \"./source-info.ts\";\n\nexport type SlashCommandSource = \"extension\" | \"prompt\" | \"skill\";\n\nexport interface SlashCommandInfo {\n\tname: string;\n\tdescription?: string;\n\tsource: SlashCommandSource;\n\tsourceInfo: SourceInfo;\n}\n\nexport interface BuiltinSlashCommand {\n\tname: string;\n\tdescription: string;\n\targumentHint?: string;\n}\n\nexport const BUILTIN_SLASH_COMMANDS: ReadonlyArray<BuiltinSlashCommand> = [\n\t{ name: \"settings\", description: \"Open settings menu\" },\n\t{ name: \"model\", description: \"Select model (opens selector UI)\", argumentHint: \"<provider/model>\" },\n\t{ name: \"scoped-models\", description: \"Enable/disable models for Ctrl+P cycling\" },\n\t{ name: \"export\", description: \"Export session (HTML default, or specify path: .html/.jsonl)\" },\n\t{ name: \"import\", description: \"Import and resume a session from a JSONL file\" },\n\t{ name: \"share\", description: \"Share session as a secret GitHub gist\" },\n\t{ name: \"copy\", description: \"Copy last agent message to clipboard\" },\n\t{ name: \"name\", description: \"Set session display name\" },\n\t{ name: \"session\", description: \"Show session info and stats\" },\n\t{ name: \"changelog\", description: \"Show changelog entries\" },\n\t{ name: \"hotkeys\", description: \"Show all keyboard shortcuts\" },\n\t{ name: \"fork\", description: \"Create a new fork from a previous user message\" },\n\t{ name: \"clone\", description: \"Duplicate the current session at the current position\" },\n\t{ name: \"tree\", description: \"Navigate session tree (switch branches)\" },\n\t{ name: \"trust\", description: \"Save project trust decision for future sessions\" },\n\t{ name: \"login\", description: \"Configure provider authentication\", argumentHint: \"<provider>\" },\n\t{ name: \"logout\", description: \"Remove provider authentication\" },\n\t{ name: \"new\", description: \"Start a new session\" },\n\t{ name: \"compact\", description: \"Manually compact the session context\" },\n\t{ name: \"resume\", description: \"Resume a different session\" },\n\t{ name: \"reload\", description: \"Reload keybindings, extensions, skills, prompts, themes, and context files\" },\n\t{ name: \"quit\", description: `Quit ${APP_NAME}` },\n];\n"]}
1
+ {"version":3,"file":"slash-commands.js","sourceRoot":"","sources":["../../src/core/slash-commands.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,cAAc,CA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AE;IACjE,EAAE,IAAI,EAAE,KAAK,EAAE,WAAW,EAAE,qBAAqB,EAAE;IACnD,EAAE,IAAI,EAAE,SAAS,EAAE,WAAW,EAAE,sCAAsC,EAAE;IACxE,EAAE,IAAI,EAAE,QAAQ,EAAE,WAAW,EAAE,4BAA4B,EAAE;IAC7D,EAAE,IAAI,EAAE,QAAQ,EAAE,WAAW,EAAE,4EAA4E,EAAE;IAC7G,EAAE,IAAI,EAAE,MAAM,EAAE,WAAW,EAAE,QAAQ,QAAQ,EAAE,EAAE;CACjD,CAAC","sourcesContent":["import { APP_NAME } from \"../config.ts\";\nimport type { SourceInfo } from \"./source-info.ts\";\n\nexport type SlashCommandSource = \"extension\" | \"prompt\" | \"skill\";\n\nexport interface SlashCommandInfo {\n\tname: string;\n\tdescription?: string;\n\tsource: SlashCommandSource;\n\tsourceInfo: SourceInfo;\n}\n\nexport interface BuiltinSlashCommand {\n\tname: string;\n\tdescription: string;\n\targumentHint?: string;\n}\n\nexport const BUILTIN_SLASH_COMMANDS: ReadonlyArray<BuiltinSlashCommand> = [\n\t{ name: \"settings\", description: \"Open settings menu\" },\n\t{ name: \"model\", description: \"Select model (opens selector UI)\", argumentHint: \"<provider/model>\" },\n\t{ name: \"scoped-models\", description: \"Enable/disable models for Ctrl+P cycling\" },\n\t{ name: \"export\", description: \"Export session (HTML default, or specify path: .html/.jsonl)\" },\n\t{ name: \"import\", description: \"Import and resume a session from a JSONL file\" },\n\t{ name: \"share\", description: \"Share session as a secret GitHub gist\" },\n\t{ name: \"copy\", description: \"Copy last agent message to clipboard\" },\n\t{ name: \"name\", description: \"Set session display name\" },\n\t{ name: \"session\", description: \"Show session info and stats\" },\n\t{ name: \"changelog\", description: \"Show changelog entries\" },\n\t{ name: \"hotkeys\", description: \"Show all keyboard shortcuts\" },\n\t{ name: \"fork\", description: \"Create a new fork from a previous user message\" },\n\t{ name: \"clone\", description: \"Duplicate the current session at the current position\" },\n\t{ name: \"tree\", description: \"Navigate session tree (switch branches)\" },\n\t{ name: \"rewind\", description: \"Rewind conversation and/or files to an earlier checkpoint\" },\n\t{ name: \"trust\", description: \"Save project trust decision for future sessions\" },\n\t{ name: \"login\", description: \"Configure provider authentication\", argumentHint: \"<provider>\" },\n\t{ name: \"logout\", description: \"Remove provider authentication\" },\n\t{ name: \"new\", description: \"Start a new session\" },\n\t{ name: \"compact\", description: \"Manually compact the session context\" },\n\t{ name: \"resume\", description: \"Resume a different session\" },\n\t{ name: \"reload\", description: \"Reload keybindings, extensions, skills, prompts, themes, and context files\" },\n\t{ name: \"quit\", description: `Quit ${APP_NAME}` },\n];\n"]}
@@ -0,0 +1,298 @@
1
+ /**
2
+ * SOAK LOG — the append-only, rotating, restart-surviving JSONL that a long-run
3
+ * verdict reads back weeks later.
4
+ *
5
+ * ─────────────────────────────────────────────────────────────────────────────
6
+ * FILE FORMAT CONTRACT (v1)
7
+ * ─────────────────────────────────────────────────────────────────────────────
8
+ * This comment is the contract, not a description of this implementation. A
9
+ * second writer — the daemon half, which lives on the far side of a package
10
+ * boundary that forbids importing this package — must be implementable from
11
+ * this section alone. Do NOT export a shared module across that boundary; the
12
+ * two halves agree on these bytes and on nothing else.
13
+ *
14
+ * LOCATION
15
+ * <agentDir>/soak/ directory, mode 0700
16
+ * <agentDir>/soak/<stem>.jsonl the ACTIVE file, mode 0600
17
+ * <agentDir>/soak/<stem>-<gen>.jsonl a ROTATED generation, mode 0600
18
+ * <agentDir>/soak/<stem>.rotate.lock the rotation lock, mode 0600
19
+ *
20
+ * `<agentDir>` is the coding agent's config dir (honours DRAHT_CODING_AGENT_DIR).
21
+ * `<stem>` names the WRITING HALF, one file per half: "session" for a session
22
+ * process, "daemon" for the gateway/daemon process. The halves observe
23
+ * different events from different lifecycles; they are never interleaved into
24
+ * one file and are joined by `sessionId`/`wall` at verdict time.
25
+ * `<gen>` is `<compact-utc>-<pid>-<counter>` and is UNIQUE FOREVER — a
26
+ * generation name is never reused, so a rotation can never clobber evidence.
27
+ * Example: `session-20260822T114530123Z-40321-0.jsonl`.
28
+ *
29
+ * RECORDS
30
+ * One JSON object per line, UTF-8, terminated by "\n". No trailing commas, no
31
+ * pretty printing, no multi-line values. Every record carries:
32
+ * level "info" | "warn" | "error" (matches the gateway logger shape)
33
+ * timestamp ISO-8601 string (matches the gateway logger shape)
34
+ * event string (see SOAK_EVENTS)
35
+ * v 1 (this format version)
36
+ * wall Date.now() milliseconds
37
+ * mono performance.now() milliseconds
38
+ * uptimeMs process.uptime() * 1000
39
+ * pid writing process id
40
+ * rss process.memoryUsage().rss bytes
41
+ * plus whatever fields the event carries. The fields above are stamped LAST,
42
+ * after the event's own: a caller field that collides with one of them is
43
+ * dropped rather than honoured, because a record whose `pid` or `wall` came
44
+ * from a call site is a record the reader classifies as malformed and drops.
45
+ * `sessionId` is present on every
46
+ * record a session process writes; prompt/permission records additionally
47
+ * carry `requestId`, so this stream can be JOINED against the durable
48
+ * per-session permission rows without duplicating any decision here.
49
+ *
50
+ * All three clocks are recorded on every record on purpose. A frozen process
51
+ * (SIGSTOP/SIGCONT, and by extension a suspended host) shows up as a WALL-CLOCK
52
+ * GAP between consecutive heartbeats, not as divergence between the clocks —
53
+ * measured, all three advanced identically across a 2,677 ms stop. Recording
54
+ * all three costs nothing and leaves the question answerable if a real lid-close
55
+ * behaves differently.
56
+ *
57
+ * APPENDING
58
+ * One open("a", 0600) / write / close per record. NOT a held descriptor: this
59
+ * writer reports an fd gauge, and holding its own fd would perturb the metric
60
+ * it publishes. Concurrent appends from many processes are safe because each
61
+ * record is a single write() to an O_APPEND descriptor.
62
+ *
63
+ * NO fsync. Measured 4.0–4.7 ms per record under Node against 0.017–0.025 ms
64
+ * under Bun; on seams that fire per client attach and per prompt that is a
65
+ * hot-path cost, and it would give materially different guarantees on the
66
+ * runtime this product actually ships as (a Bun-compiled binary). The tolerated
67
+ * failure is the loss of the last few records on a hard power cut; the reader
68
+ * is torn-tail tolerant, so that loss costs one line, never the file.
69
+ *
70
+ * ROTATION (the part that loses data if done naively — measured)
71
+ * A two-slot `rename(f, f.1)` scheme under 8 concurrent writers lost 11,148 of
72
+ * 12,000 records. The scheme below lost ZERO across 8 generations. Implement
73
+ * EXACTLY this order:
74
+ * 1. after appending, fstat the descriptor you just wrote through: that
75
+ * yields both the size and the INODE you filled;
76
+ * 2. if size < maxFileBytes, stop;
77
+ * 3. open(lockPath, "wx", 0600). EEXIST means another writer is rotating:
78
+ * give up silently and let the next append retry. (A lock whose mtime is
79
+ * older than the stale window is debris and may be removed once.)
80
+ * 4. stat the active path again and COMPARE THE INODE against step 1. A
81
+ * different inode means another writer already rotated the file you
82
+ * filled: release the lock and stop. This comparison is the whole
83
+ * correctness argument — without it, two writers rotate in sequence and
84
+ * the second one renames away a fresh file that other writers are still
85
+ * appending to.
86
+ * 5. rename the active path to a UNIQUE generation name.
87
+ * 6. prune (see RETENTION), then append ONE `rotation` record to the new
88
+ * active file naming the generation just closed and everything pruned.
89
+ * 7. unlink the lock.
90
+ *
91
+ * A writer holding a descriptor across step 5 keeps writing into the renamed
92
+ * inode. That is not loss: the reader reads every generation, so those records
93
+ * are still found. It is why generation files may keep growing after rotation
94
+ * and why file order — not byte order across files — is the only ordering the
95
+ * reader promises.
96
+ *
97
+ * RETENTION
98
+ * Two gates, BOTH must permit a delete:
99
+ * • a byte cap over the directory (maxTotalBytes), and
100
+ * • a retention FLOOR: a generation whose newest write is younger than
101
+ * `retentionFloorMs` (default 14 days) is NEVER pruned, even when the byte
102
+ * cap says prune.
103
+ * A byte-only cap sized for a quiet week silently rotates away the first days
104
+ * of a busy one, and a multi-week soak verdict would destroy its own evidence.
105
+ * When the floor blocks a prune the log simply grows; that is the intended
106
+ * trade. Every prune is named in the `rotation` record written into the
107
+ * surviving file, so a gap in the evidence is VISIBLE rather than invisible.
108
+ *
109
+ * HARD RULES FOR ANY IMPLEMENTATION
110
+ * • NEVER write to stdout or stderr. Not a warning, not a stack trace. The TUI
111
+ * owns the terminal, and a default-on session's streams are asserted
112
+ * byte-identical to a feature-off run; one stray line breaks that.
113
+ * • NEVER throw into a caller. Every failure is swallowed; the last one is
114
+ * retained on the instance for a debugger to look at, and that is all.
115
+ * • The soak directory is OUTSIDE the session store on purpose, which is what
116
+ * exempts it from the byte-identity claim.
117
+ */
118
+ /** Format version stamped on every record as `v`. */
119
+ export declare const SOAK_FORMAT_VERSION = 1;
120
+ /** Directory under the agent dir that holds every soak file. */
121
+ export declare const SOAK_DIR_NAME = "soak";
122
+ /** File stem for the half a session process writes. */
123
+ export declare const SOAK_STEM_SESSION = "session";
124
+ /** File stem for the half the daemon writes (a separate implementation of this same contract). */
125
+ export declare const SOAK_STEM_DAEMON = "daemon";
126
+ /**
127
+ * Canonical event names. Kept as a frozen map rather than a union type so a call
128
+ * site can add a field — or a new event — without editing this file.
129
+ */
130
+ export declare const SOAK_EVENTS: Readonly<{
131
+ SOCKET_BIND: "socket_bind";
132
+ SOCKET_REBIND: "socket_rebind";
133
+ SOCKET_TEARDOWN: "socket_teardown";
134
+ CLIENT_ATTACH: "client_attach";
135
+ CLIENT_DETACH: "client_detach";
136
+ CLIENT_REJECTED: "client_rejected";
137
+ PROMPT_REJECTED: "prompt_rejected";
138
+ SOCKETS_REAPED: "sockets_reaped";
139
+ HEARTBEAT: "heartbeat";
140
+ ROTATION: "rotation";
141
+ }>;
142
+ /** Severity, matching the gateway logger's vocabulary so both streams parse the same way. */
143
+ export type SoakLevel = "info" | "warn" | "error";
144
+ /** Arbitrary caller-supplied fields. */
145
+ export type SoakFields = Record<string, unknown>;
146
+ /** One parsed record. The named fields are guaranteed by the contract; the rest are event-specific. */
147
+ export interface SoakRecord extends SoakFields {
148
+ level: SoakLevel;
149
+ timestamp: string;
150
+ event: string;
151
+ v: number;
152
+ wall: number;
153
+ mono: number;
154
+ uptimeMs: number;
155
+ pid: number;
156
+ rss?: number;
157
+ sessionId?: string;
158
+ requestId?: string;
159
+ }
160
+ /** Directory counts for the sockets dir, gathered with one readdir (1.12 ms for 553 entries). */
161
+ export interface SocketDirCounts {
162
+ sockCount: number;
163
+ lockCount: number;
164
+ }
165
+ export interface SoakLogOptions {
166
+ /** Soak directory. Defaults to `<agentDir>/soak`. */
167
+ dir?: string;
168
+ /** File stem naming the writing half. Defaults to `session`. */
169
+ stem?: string;
170
+ /** Rotate once the active file reaches this many bytes. */
171
+ maxFileBytes?: number;
172
+ /** Prune oldest generations once the directory exceeds this many bytes — subject to the retention floor. */
173
+ maxTotalBytes?: number;
174
+ /** Never prune a generation whose newest write is younger than this. */
175
+ retentionFloorMs?: number;
176
+ /** Heartbeat period used by {@link SoakLog.startHeartbeat}. */
177
+ heartbeatMs?: number;
178
+ /** Sockets directory used for the sock/lock gauges. Defaults to `<agentDir>/sockets`. */
179
+ socketsDir?: string;
180
+ /** Stamped on every record when set. */
181
+ sessionId?: string;
182
+ /** Live client count for the heartbeat, when the caller can supply one. */
183
+ clientCount?: () => number;
184
+ /** Injectable clock, for tests. */
185
+ now?: () => number;
186
+ /**
187
+ * TEST SEAM. Invoked under the rotation lock, immediately before the active
188
+ * path is re-stat'd — i.e. inside the exact window another process's rotation
189
+ * can land in.
190
+ *
191
+ * It exists because the inode re-check is otherwise UNFALSIFIABLE: the size
192
+ * guard one line below it hides the check under any load a test can generate
193
+ * (measured — dropping the inode comparison entirely left 8 processes x 1,500
194
+ * records byte-for-byte identical, same generation count). A guard no test can
195
+ * kill is a guard that will be deleted by someone who reads it as dead code, so
196
+ * the window is made addressable rather than left to chance. Undefined in
197
+ * production, where it costs one property read per rotation.
198
+ */
199
+ onRotateWindow?: () => void;
200
+ }
201
+ /** `process.memoryUsage().rss`, or 0 if the runtime refuses. Works under Node and Bun. */
202
+ export declare function currentRss(): number;
203
+ /**
204
+ * Milliseconds since this process started, from `process.uptime()`.
205
+ *
206
+ * The in-tree `time()` helper cannot supply this: it compiles itself out unless
207
+ * DRAHT_TIMING=1, so a soak run would carry no startup delta at all.
208
+ */
209
+ export declare function startupDeltaMs(): number;
210
+ /**
211
+ * Open descriptor gauge: open /dev/null, record the descriptor number POSIX hands
212
+ * back (always the lowest free one), close it. 0.04 ms, and it tracks fd growth
213
+ * exactly.
214
+ *
215
+ * Deliberately NOT `lsof` (176–200 ms, 4,000x more — and `lsof -p <pid> -U` ORs
216
+ * its selectors and returns every socket on the machine; the correct form is
217
+ * `lsof -a -p <pid> -U`). Deliberately NOT `process.getActiveResourcesInfo()`,
218
+ * which reports 20 under Node with 20 live listeners and 0 under Bun with the
219
+ * same 20 — and the shipped draht is a Bun-compiled binary.
220
+ */
221
+ export declare function fdGauge(): number;
222
+ /** Counts `.sock` and `.lock` entries with one readdir. Never `lsof`. */
223
+ export declare function socketDirCounts(socketsDir: string): SocketDirCounts;
224
+ /** Default soak directory for this process. */
225
+ export declare function getSoakDir(): string;
226
+ /**
227
+ * The rotating soak writer.
228
+ *
229
+ * Every public method swallows every failure — a soak log that can break a
230
+ * session is worse than no soak log — and NOTHING here writes to stdout or
231
+ * stderr under any condition.
232
+ */
233
+ export declare class SoakLog {
234
+ #private;
235
+ readonly dir: string;
236
+ readonly stem: string;
237
+ readonly activePath: string;
238
+ readonly lockPath: string;
239
+ /** Last swallowed failure, retained for a debugger. Never printed. */
240
+ lastError: unknown;
241
+ constructor(options?: SoakLogOptions);
242
+ /** Stamp every subsequent record with this session id. */
243
+ setSessionId(sessionId: string | undefined): void;
244
+ /** Supply a live client count for the heartbeat. */
245
+ setClientCountProvider(provider: (() => number) | undefined): void;
246
+ /**
247
+ * Append one record. This is the whole write API: a new event or a new field
248
+ * needs no change to this file.
249
+ *
250
+ * `fields` may therefore carry ANY name, including one the contract reserves.
251
+ * A collision loses: the contract's value is stamped over it. The one
252
+ * exception is `sessionId` on a writer that has none of its own — the daemon
253
+ * half writes about sessions it does not belong to — where the caller's value
254
+ * stands.
255
+ */
256
+ record(event: string, fields?: SoakFields, level?: SoakLevel): void;
257
+ /**
258
+ * Write one heartbeat now.
259
+ *
260
+ * Edge events cannot answer "how many days did this run", "did the host
261
+ * sleep", or "did fds grow" — only a periodic record can, so the heartbeat is
262
+ * part of the record set, not a nicety.
263
+ */
264
+ heartbeat(fields?: SoakFields): void;
265
+ /**
266
+ * Start the periodic heartbeat. The timer is `unref`'d, so it fires while the
267
+ * process is alive and does not by itself keep the process alive — the idiom
268
+ * the fleet route already uses. Idempotent.
269
+ */
270
+ startHeartbeat(intervalMs?: number): void;
271
+ /** Stop the periodic heartbeat. Idempotent. */
272
+ stopHeartbeat(): void;
273
+ }
274
+ /** One rotated generation on disk. */
275
+ export interface SoakGenerationFile {
276
+ name: string;
277
+ path: string;
278
+ size: number;
279
+ mtimeMs: number;
280
+ }
281
+ /**
282
+ * Every rotated generation for `stem`, oldest first.
283
+ *
284
+ * Ordered by the timestamp embedded in the NAME, not by mtime: a straggler
285
+ * writer still holding a descriptor keeps appending to a generation after it was
286
+ * renamed, which moves its mtime but not its place in the sequence.
287
+ */
288
+ export declare function listGenerationFiles(dir: string, stem: string): SoakGenerationFile[];
289
+ /**
290
+ * Process-wide soak log for the session half.
291
+ *
292
+ * Constructed lazily so importing this module costs nothing and creates no
293
+ * directory; the first record makes the directory.
294
+ */
295
+ export declare function getSoakLog(): SoakLog;
296
+ /** Replace the process-wide log (tests, and the daemon half if it ever shares a process). */
297
+ export declare function setSoakLog(log: SoakLog | undefined): void;
298
+ //# sourceMappingURL=soak-log.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"soak-log.d.ts","sourceRoot":"","sources":["../../../src/core/soak/soak-log.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAoHG;AAgBH,qDAAqD;AACrD,eAAO,MAAM,mBAAmB,IAAI,CAAC;AAErC,gEAAgE;AAChE,eAAO,MAAM,aAAa,SAAS,CAAC;AAEpC,uDAAuD;AACvD,eAAO,MAAM,iBAAiB,YAAY,CAAC;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