@nanonets/graft 0.23.1 → 0.24.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 (650) hide show
  1. package/README.md +4 -4
  2. package/dist/ai/crux.d.ts +31 -3
  3. package/dist/ai/crux.d.ts.map +1 -1
  4. package/dist/ai/crux.js +88 -10
  5. package/dist/ai/crux.js.map +1 -1
  6. package/dist/ai/llm/openai.d.ts +101 -0
  7. package/dist/ai/llm/openai.d.ts.map +1 -1
  8. package/dist/ai/llm/openai.js +396 -6
  9. package/dist/ai/llm/openai.js.map +1 -1
  10. package/dist/ai/llm/recover-tool.d.ts +2 -0
  11. package/dist/ai/llm/recover-tool.d.ts.map +1 -1
  12. package/dist/ai/llm/recover-tool.js +1 -1
  13. package/dist/ai/llm/recover-tool.js.map +1 -1
  14. package/dist/ai/synthesize.d.ts.map +1 -1
  15. package/dist/ai/synthesize.js +100 -1
  16. package/dist/ai/synthesize.js.map +1 -1
  17. package/dist/ask/ask.d.ts +8 -0
  18. package/dist/ask/ask.d.ts.map +1 -1
  19. package/dist/ask/ask.js +33 -12
  20. package/dist/ask/ask.js.map +1 -1
  21. package/dist/claude/format.js +1 -1
  22. package/dist/claude/format.js.map +1 -1
  23. package/dist/claude/hook-io.d.ts +44 -0
  24. package/dist/claude/hook-io.d.ts.map +1 -0
  25. package/dist/claude/hook-io.js +144 -0
  26. package/dist/claude/hook-io.js.map +1 -0
  27. package/dist/claude/hooks.d.ts +0 -18
  28. package/dist/claude/hooks.d.ts.map +1 -1
  29. package/dist/claude/hooks.js +24 -77
  30. package/dist/claude/hooks.js.map +1 -1
  31. package/dist/claude/init.js +3 -3
  32. package/dist/claude/init.js.map +1 -1
  33. package/dist/claude/note-signals.d.ts +28 -0
  34. package/dist/claude/note-signals.d.ts.map +1 -0
  35. package/dist/claude/note-signals.js +325 -0
  36. package/dist/claude/note-signals.js.map +1 -0
  37. package/dist/claude/shim-template.d.ts.map +1 -1
  38. package/dist/claude/shim-template.js +10 -4
  39. package/dist/claude/shim-template.js.map +1 -1
  40. package/dist/claude/skill-template.d.ts.map +1 -1
  41. package/dist/claude/skill-template.js +49 -18
  42. package/dist/claude/skill-template.js.map +1 -1
  43. package/dist/claude/skills-hook-util.d.ts +25 -0
  44. package/dist/claude/skills-hook-util.d.ts.map +1 -0
  45. package/dist/claude/skills-hook-util.js +71 -0
  46. package/dist/claude/skills-hook-util.js.map +1 -0
  47. package/dist/claude/state.d.ts +4 -3
  48. package/dist/claude/state.d.ts.map +1 -1
  49. package/dist/claude/state.js.map +1 -1
  50. package/dist/claude/sync-run.js +1 -1
  51. package/dist/claude/sync-run.js.map +1 -1
  52. package/dist/cli-picker.d.ts +36 -5
  53. package/dist/cli-picker.d.ts.map +1 -1
  54. package/dist/cli-picker.js +60 -13
  55. package/dist/cli-picker.js.map +1 -1
  56. package/dist/cli.d.ts +2 -0
  57. package/dist/cli.d.ts.map +1 -1
  58. package/dist/cli.js +406 -64
  59. package/dist/cli.js.map +1 -1
  60. package/dist/cloud/lookup-activity.d.ts +16 -0
  61. package/dist/cloud/lookup-activity.d.ts.map +1 -0
  62. package/dist/cloud/lookup-activity.js +56 -0
  63. package/dist/cloud/lookup-activity.js.map +1 -0
  64. package/dist/cloud/nudge.d.ts.map +1 -1
  65. package/dist/cloud/nudge.js +3 -0
  66. package/dist/cloud/nudge.js.map +1 -1
  67. package/dist/cloud/onboarding.d.ts +237 -0
  68. package/dist/cloud/onboarding.d.ts.map +1 -0
  69. package/dist/cloud/onboarding.js +536 -0
  70. package/dist/cloud/onboarding.js.map +1 -0
  71. package/dist/cloud/pair.d.ts +76 -0
  72. package/dist/cloud/pair.d.ts.map +1 -0
  73. package/dist/cloud/pair.js +249 -0
  74. package/dist/cloud/pair.js.map +1 -0
  75. package/dist/cloud/workspace-sync.d.ts +10 -2
  76. package/dist/cloud/workspace-sync.d.ts.map +1 -1
  77. package/dist/cloud/workspace-sync.js +119 -7
  78. package/dist/cloud/workspace-sync.js.map +1 -1
  79. package/dist/cloud/workspace.d.ts +22 -1
  80. package/dist/cloud/workspace.d.ts.map +1 -1
  81. package/dist/cloud/workspace.js +16 -1
  82. package/dist/cloud/workspace.js.map +1 -1
  83. package/dist/context/batches.d.ts +29 -0
  84. package/dist/context/batches.d.ts.map +1 -0
  85. package/dist/context/batches.js +130 -0
  86. package/dist/context/batches.js.map +1 -0
  87. package/dist/context/build.d.ts +7 -2
  88. package/dist/context/build.d.ts.map +1 -1
  89. package/dist/context/build.js +84 -50
  90. package/dist/context/build.js.map +1 -1
  91. package/dist/context/node-file.d.ts.map +1 -1
  92. package/dist/context/node-file.js +41 -4
  93. package/dist/context/node-file.js.map +1 -1
  94. package/dist/engine.d.ts +2 -0
  95. package/dist/engine.d.ts.map +1 -1
  96. package/dist/engine.js +1 -0
  97. package/dist/engine.js.map +1 -1
  98. package/dist/graph/cards.d.ts.map +1 -1
  99. package/dist/graph/cards.js +9 -4
  100. package/dist/graph/cards.js.map +1 -1
  101. package/dist/graph/enrich.d.ts.map +1 -1
  102. package/dist/graph/enrich.js +8 -3
  103. package/dist/graph/enrich.js.map +1 -1
  104. package/dist/graph/generic.d.ts.map +1 -1
  105. package/dist/graph/generic.js +207 -6
  106. package/dist/graph/generic.js.map +1 -1
  107. package/dist/graph/lsp/client.d.ts +18 -0
  108. package/dist/graph/lsp/client.d.ts.map +1 -1
  109. package/dist/graph/lsp/client.js +40 -2
  110. package/dist/graph/lsp/client.js.map +1 -1
  111. package/dist/graph/lsp/enrich.d.ts.map +1 -1
  112. package/dist/graph/lsp/enrich.js +9 -1
  113. package/dist/graph/lsp/enrich.js.map +1 -1
  114. package/dist/graph/lsp/registry.d.ts +7 -0
  115. package/dist/graph/lsp/registry.d.ts.map +1 -1
  116. package/dist/graph/lsp/registry.js +27 -2
  117. package/dist/graph/lsp/registry.js.map +1 -1
  118. package/dist/graph/native.d.ts +2 -0
  119. package/dist/graph/native.d.ts.map +1 -1
  120. package/dist/graph/native.js +29 -4
  121. package/dist/graph/native.js.map +1 -1
  122. package/dist/graph/queries/gleam.scm +51 -0
  123. package/dist/graph/resolve.d.ts.map +1 -1
  124. package/dist/graph/resolve.js +65 -3
  125. package/dist/graph/resolve.js.map +1 -1
  126. package/dist/graph/workspace-cli.d.ts +2 -0
  127. package/dist/graph/workspace-cli.d.ts.map +1 -1
  128. package/dist/graph/workspace-cli.js +1 -1
  129. package/dist/graph/workspace-cli.js.map +1 -1
  130. package/dist/hosts/claude-global.d.ts +14 -0
  131. package/dist/hosts/claude-global.d.ts.map +1 -1
  132. package/dist/hosts/claude-global.js +38 -3
  133. package/dist/hosts/claude-global.js.map +1 -1
  134. package/dist/init/install-record.d.ts +21 -0
  135. package/dist/init/install-record.d.ts.map +1 -0
  136. package/dist/init/install-record.js +144 -0
  137. package/dist/init/install-record.js.map +1 -0
  138. package/dist/init/plain-file.d.ts +11 -0
  139. package/dist/init/plain-file.d.ts.map +1 -0
  140. package/dist/init/plain-file.js +80 -0
  141. package/dist/init/plain-file.js.map +1 -0
  142. package/dist/mcp/brains.d.ts +72 -0
  143. package/dist/mcp/brains.d.ts.map +1 -0
  144. package/dist/mcp/brains.js +220 -0
  145. package/dist/mcp/brains.js.map +1 -0
  146. package/dist/mcp/server.d.ts +3 -1
  147. package/dist/mcp/server.d.ts.map +1 -1
  148. package/dist/mcp/server.js +40 -5
  149. package/dist/mcp/server.js.map +1 -1
  150. package/dist/mcp/tools.d.ts.map +1 -1
  151. package/dist/mcp/tools.js +7 -2
  152. package/dist/mcp/tools.js.map +1 -1
  153. package/dist/notes/branches.d.ts +7 -1
  154. package/dist/notes/branches.d.ts.map +1 -1
  155. package/dist/notes/branches.js +31 -3
  156. package/dist/notes/branches.js.map +1 -1
  157. package/dist/notes/cold-start.d.ts +42 -3
  158. package/dist/notes/cold-start.d.ts.map +1 -1
  159. package/dist/notes/cold-start.js +144 -24
  160. package/dist/notes/cold-start.js.map +1 -1
  161. package/dist/notes/credit.d.ts +37 -0
  162. package/dist/notes/credit.d.ts.map +1 -0
  163. package/dist/notes/credit.js +78 -0
  164. package/dist/notes/credit.js.map +1 -0
  165. package/dist/notes/every-repo.d.ts +18 -0
  166. package/dist/notes/every-repo.d.ts.map +1 -0
  167. package/dist/notes/every-repo.js +86 -0
  168. package/dist/notes/every-repo.js.map +1 -0
  169. package/dist/notes/find-notes.d.ts +17 -0
  170. package/dist/notes/find-notes.d.ts.map +1 -0
  171. package/dist/notes/find-notes.js +48 -0
  172. package/dist/notes/find-notes.js.map +1 -0
  173. package/dist/notes/flatten.d.ts +31 -0
  174. package/dist/notes/flatten.d.ts.map +1 -0
  175. package/dist/notes/flatten.js +73 -0
  176. package/dist/notes/flatten.js.map +1 -0
  177. package/dist/notes/git-facts.d.ts +2 -0
  178. package/dist/notes/git-facts.d.ts.map +1 -1
  179. package/dist/notes/git-facts.js +6 -0
  180. package/dist/notes/git-facts.js.map +1 -1
  181. package/dist/notes/guardrails.d.ts +8 -0
  182. package/dist/notes/guardrails.d.ts.map +1 -0
  183. package/dist/notes/guardrails.js +38 -0
  184. package/dist/notes/guardrails.js.map +1 -0
  185. package/dist/notes/home.d.ts +24 -6
  186. package/dist/notes/home.d.ts.map +1 -1
  187. package/dist/notes/home.js +82 -15
  188. package/dist/notes/home.js.map +1 -1
  189. package/dist/notes/learning-fields.d.ts +102 -0
  190. package/dist/notes/learning-fields.d.ts.map +1 -0
  191. package/dist/notes/learning-fields.js +214 -0
  192. package/dist/notes/learning-fields.js.map +1 -0
  193. package/dist/notes/lesson-index.d.ts +13 -0
  194. package/dist/notes/lesson-index.d.ts.map +1 -0
  195. package/dist/notes/lesson-index.js +135 -0
  196. package/dist/notes/lesson-index.js.map +1 -0
  197. package/dist/notes/linked-learnings.d.ts +8 -0
  198. package/dist/notes/linked-learnings.d.ts.map +1 -0
  199. package/dist/notes/linked-learnings.js +113 -0
  200. package/dist/notes/linked-learnings.js.map +1 -0
  201. package/dist/notes/memory-notes.d.ts +71 -0
  202. package/dist/notes/memory-notes.d.ts.map +1 -0
  203. package/dist/notes/memory-notes.js +239 -0
  204. package/dist/notes/memory-notes.js.map +1 -0
  205. package/dist/notes/note-gate.d.ts +42 -0
  206. package/dist/notes/note-gate.d.ts.map +1 -0
  207. package/dist/notes/note-gate.js +181 -0
  208. package/dist/notes/note-gate.js.map +1 -0
  209. package/dist/notes/notes.d.ts +29 -85
  210. package/dist/notes/notes.d.ts.map +1 -1
  211. package/dist/notes/notes.js +69 -254
  212. package/dist/notes/notes.js.map +1 -1
  213. package/dist/notes/pr-reviews.d.ts +35 -7
  214. package/dist/notes/pr-reviews.d.ts.map +1 -1
  215. package/dist/notes/pr-reviews.js +156 -46
  216. package/dist/notes/pr-reviews.js.map +1 -1
  217. package/dist/notes/replace.d.ts +14 -0
  218. package/dist/notes/replace.d.ts.map +1 -0
  219. package/dist/notes/replace.js +38 -0
  220. package/dist/notes/replace.js.map +1 -0
  221. package/dist/notes/repo-notes-dir.d.ts +2 -0
  222. package/dist/notes/repo-notes-dir.d.ts.map +1 -0
  223. package/dist/notes/repo-notes-dir.js +16 -0
  224. package/dist/notes/repo-notes-dir.js.map +1 -0
  225. package/dist/notes/secrets.d.ts +28 -0
  226. package/dist/notes/secrets.d.ts.map +1 -0
  227. package/dist/notes/secrets.js +362 -0
  228. package/dist/notes/secrets.js.map +1 -0
  229. package/dist/notes/targets.d.ts +37 -0
  230. package/dist/notes/targets.d.ts.map +1 -0
  231. package/dist/notes/targets.js +108 -0
  232. package/dist/notes/targets.js.map +1 -0
  233. package/dist/notes/team-check.d.ts +22 -0
  234. package/dist/notes/team-check.d.ts.map +1 -0
  235. package/dist/notes/team-check.js +130 -0
  236. package/dist/notes/team-check.js.map +1 -0
  237. package/dist/notes/trail-home.d.ts +3 -0
  238. package/dist/notes/trail-home.d.ts.map +1 -0
  239. package/dist/notes/trail-home.js +12 -0
  240. package/dist/notes/trail-home.js.map +1 -0
  241. package/dist/skills/anchors-cli.d.ts +33 -0
  242. package/dist/skills/anchors-cli.d.ts.map +1 -0
  243. package/dist/skills/anchors-cli.js +274 -0
  244. package/dist/skills/anchors-cli.js.map +1 -0
  245. package/dist/skills/anchors-git.d.ts +29 -0
  246. package/dist/skills/anchors-git.d.ts.map +1 -0
  247. package/dist/skills/anchors-git.js +241 -0
  248. package/dist/skills/anchors-git.js.map +1 -0
  249. package/dist/skills/anchors-wide.d.ts +25 -0
  250. package/dist/skills/anchors-wide.d.ts.map +1 -0
  251. package/dist/skills/anchors-wide.js +481 -0
  252. package/dist/skills/anchors-wide.js.map +1 -0
  253. package/dist/skills/anchors.d.ts +32 -0
  254. package/dist/skills/anchors.d.ts.map +1 -0
  255. package/dist/skills/anchors.js +485 -0
  256. package/dist/skills/anchors.js.map +1 -0
  257. package/dist/skills/answers-prompt.d.ts +13 -0
  258. package/dist/skills/answers-prompt.d.ts.map +1 -0
  259. package/dist/skills/answers-prompt.js +83 -0
  260. package/dist/skills/answers-prompt.js.map +1 -0
  261. package/dist/skills/check-result.d.ts +26 -0
  262. package/dist/skills/check-result.d.ts.map +1 -0
  263. package/dist/skills/check-result.js +46 -0
  264. package/dist/skills/check-result.js.map +1 -0
  265. package/dist/skills/codex-sandbox.d.ts +6 -0
  266. package/dist/skills/codex-sandbox.d.ts.map +1 -0
  267. package/dist/skills/codex-sandbox.js +55 -0
  268. package/dist/skills/codex-sandbox.js.map +1 -0
  269. package/dist/skills/compile-split.d.ts +57 -0
  270. package/dist/skills/compile-split.d.ts.map +1 -0
  271. package/dist/skills/compile-split.js +532 -0
  272. package/dist/skills/compile-split.js.map +1 -0
  273. package/dist/skills/compile-version.d.ts +37 -0
  274. package/dist/skills/compile-version.d.ts.map +1 -0
  275. package/dist/skills/compile-version.js +56 -0
  276. package/dist/skills/compile-version.js.map +1 -0
  277. package/dist/skills/compile-waits.d.ts +12 -0
  278. package/dist/skills/compile-waits.d.ts.map +1 -0
  279. package/dist/skills/compile-waits.js +52 -0
  280. package/dist/skills/compile-waits.js.map +1 -0
  281. package/dist/skills/compile-words.d.ts +82 -0
  282. package/dist/skills/compile-words.d.ts.map +1 -0
  283. package/dist/skills/compile-words.js +385 -0
  284. package/dist/skills/compile-words.js.map +1 -0
  285. package/dist/skills/compile.d.ts +35 -0
  286. package/dist/skills/compile.d.ts.map +1 -0
  287. package/dist/skills/compile.js +488 -0
  288. package/dist/skills/compile.js.map +1 -0
  289. package/dist/skills/credit-facts.d.ts +8 -0
  290. package/dist/skills/credit-facts.d.ts.map +1 -0
  291. package/dist/skills/credit-facts.js +32 -0
  292. package/dist/skills/credit-facts.js.map +1 -0
  293. package/dist/skills/directive-words.d.ts +11 -0
  294. package/dist/skills/directive-words.d.ts.map +1 -0
  295. package/dist/skills/directive-words.js +33 -0
  296. package/dist/skills/directive-words.js.map +1 -0
  297. package/dist/skills/fidelity.d.ts +42 -0
  298. package/dist/skills/fidelity.d.ts.map +1 -0
  299. package/dist/skills/fidelity.js +138 -0
  300. package/dist/skills/fidelity.js.map +1 -0
  301. package/dist/skills/forget-notice.d.ts +44 -0
  302. package/dist/skills/forget-notice.d.ts.map +1 -0
  303. package/dist/skills/forget-notice.js +131 -0
  304. package/dist/skills/forget-notice.js.map +1 -0
  305. package/dist/skills/found-skill.d.ts +35 -0
  306. package/dist/skills/found-skill.d.ts.map +1 -0
  307. package/dist/skills/found-skill.js +66 -0
  308. package/dist/skills/found-skill.js.map +1 -0
  309. package/dist/skills/front-version.d.ts +12 -0
  310. package/dist/skills/front-version.d.ts.map +1 -0
  311. package/dist/skills/front-version.js +87 -0
  312. package/dist/skills/front-version.js.map +1 -0
  313. package/dist/skills/host-facts.d.ts +51 -0
  314. package/dist/skills/host-facts.d.ts.map +1 -0
  315. package/dist/skills/host-facts.js +134 -0
  316. package/dist/skills/host-facts.js.map +1 -0
  317. package/dist/skills/ledger.d.ts +43 -0
  318. package/dist/skills/ledger.d.ts.map +1 -0
  319. package/dist/skills/ledger.js +336 -0
  320. package/dist/skills/ledger.js.map +1 -0
  321. package/dist/skills/lessons.d.ts +60 -0
  322. package/dist/skills/lessons.d.ts.map +1 -0
  323. package/dist/skills/lessons.js +396 -0
  324. package/dist/skills/lessons.js.map +1 -0
  325. package/dist/skills/never-save.d.ts +5 -0
  326. package/dist/skills/never-save.d.ts.map +1 -0
  327. package/dist/skills/never-save.js +158 -0
  328. package/dist/skills/never-save.js.map +1 -0
  329. package/dist/skills/offer-answers.d.ts +20 -0
  330. package/dist/skills/offer-answers.d.ts.map +1 -0
  331. package/dist/skills/offer-answers.js +51 -0
  332. package/dist/skills/offer-answers.js.map +1 -0
  333. package/dist/skills/own-folder.d.ts +9 -0
  334. package/dist/skills/own-folder.d.ts.map +1 -0
  335. package/dist/skills/own-folder.js +36 -0
  336. package/dist/skills/own-folder.js.map +1 -0
  337. package/dist/skills/params.d.ts +39 -0
  338. package/dist/skills/params.d.ts.map +1 -0
  339. package/dist/skills/params.js +275 -0
  340. package/dist/skills/params.js.map +1 -0
  341. package/dist/skills/person.d.ts +34 -0
  342. package/dist/skills/person.d.ts.map +1 -0
  343. package/dist/skills/person.js +102 -0
  344. package/dist/skills/person.js.map +1 -0
  345. package/dist/skills/probe-clean.d.ts +9 -0
  346. package/dist/skills/probe-clean.d.ts.map +1 -0
  347. package/dist/skills/probe-clean.js +48 -0
  348. package/dist/skills/probe-clean.js.map +1 -0
  349. package/dist/skills/probes.d.ts +26 -0
  350. package/dist/skills/probes.d.ts.map +1 -0
  351. package/dist/skills/probes.js +225 -0
  352. package/dist/skills/probes.js.map +1 -0
  353. package/dist/skills/ran-less.d.ts +5 -0
  354. package/dist/skills/ran-less.d.ts.map +1 -0
  355. package/dist/skills/ran-less.js +51 -0
  356. package/dist/skills/ran-less.js.map +1 -0
  357. package/dist/skills/recall.d.ts +119 -0
  358. package/dist/skills/recall.d.ts.map +1 -0
  359. package/dist/skills/recall.js +370 -0
  360. package/dist/skills/recall.js.map +1 -0
  361. package/dist/skills/receipts.d.ts +44 -0
  362. package/dist/skills/receipts.d.ts.map +1 -0
  363. package/dist/skills/receipts.js +223 -0
  364. package/dist/skills/receipts.js.map +1 -0
  365. package/dist/skills/risk-delta.d.ts +32 -0
  366. package/dist/skills/risk-delta.d.ts.map +1 -0
  367. package/dist/skills/risk-delta.js +56 -0
  368. package/dist/skills/risk-delta.js.map +1 -0
  369. package/dist/skills/risk.d.ts +73 -0
  370. package/dist/skills/risk.d.ts.map +1 -0
  371. package/dist/skills/risk.js +396 -0
  372. package/dist/skills/risk.js.map +1 -0
  373. package/dist/skills/run-checkout.d.ts +4 -0
  374. package/dist/skills/run-checkout.d.ts.map +1 -0
  375. package/dist/skills/run-checkout.js +37 -0
  376. package/dist/skills/run-checkout.js.map +1 -0
  377. package/dist/skills/runblock.d.ts +45 -0
  378. package/dist/skills/runblock.d.ts.map +1 -0
  379. package/dist/skills/runblock.js +222 -0
  380. package/dist/skills/runblock.js.map +1 -0
  381. package/dist/skills/save-parse.d.ts +42 -0
  382. package/dist/skills/save-parse.d.ts.map +1 -0
  383. package/dist/skills/save-parse.js +172 -0
  384. package/dist/skills/save-parse.js.map +1 -0
  385. package/dist/skills/save-store.d.ts +12 -0
  386. package/dist/skills/save-store.d.ts.map +1 -0
  387. package/dist/skills/save-store.js +22 -0
  388. package/dist/skills/save-store.js.map +1 -0
  389. package/dist/skills/settings.d.ts +38 -0
  390. package/dist/skills/settings.d.ts.map +1 -0
  391. package/dist/skills/settings.js +133 -0
  392. package/dist/skills/settings.js.map +1 -0
  393. package/dist/skills/skill-diff.d.ts +40 -0
  394. package/dist/skills/skill-diff.d.ts.map +1 -0
  395. package/dist/skills/skill-diff.js +191 -0
  396. package/dist/skills/skill-diff.js.map +1 -0
  397. package/dist/skills/skill-file.d.ts +24 -0
  398. package/dist/skills/skill-file.d.ts.map +1 -0
  399. package/dist/skills/skill-file.js +97 -0
  400. package/dist/skills/skill-file.js.map +1 -0
  401. package/dist/skills/skill-rebuild.d.ts +27 -0
  402. package/dist/skills/skill-rebuild.d.ts.map +1 -0
  403. package/dist/skills/skill-rebuild.js +85 -0
  404. package/dist/skills/skill-rebuild.js.map +1 -0
  405. package/dist/skills/skillmd.d.ts +17 -0
  406. package/dist/skills/skillmd.d.ts.map +1 -0
  407. package/dist/skills/skillmd.js +219 -0
  408. package/dist/skills/skillmd.js.map +1 -0
  409. package/dist/skills/skills.d.ts +2 -0
  410. package/dist/skills/skills.d.ts.map +1 -1
  411. package/dist/skills/skills.js +1 -1
  412. package/dist/skills/skills.js.map +1 -1
  413. package/dist/skills/staleness.d.ts +27 -0
  414. package/dist/skills/staleness.d.ts.map +1 -0
  415. package/dist/skills/staleness.js +178 -0
  416. package/dist/skills/staleness.js.map +1 -0
  417. package/dist/skills/state.d.ts +36 -0
  418. package/dist/skills/state.d.ts.map +1 -0
  419. package/dist/skills/state.js +259 -0
  420. package/dist/skills/state.js.map +1 -0
  421. package/dist/skills/store-fs.d.ts +77 -0
  422. package/dist/skills/store-fs.d.ts.map +1 -0
  423. package/dist/skills/store-fs.js +194 -0
  424. package/dist/skills/store-fs.js.map +1 -0
  425. package/dist/skills/store-held.d.ts +44 -0
  426. package/dist/skills/store-held.d.ts.map +1 -0
  427. package/dist/skills/store-held.js +147 -0
  428. package/dist/skills/store-held.js.map +1 -0
  429. package/dist/skills/store.d.ts +73 -0
  430. package/dist/skills/store.d.ts.map +1 -0
  431. package/dist/skills/store.js +279 -0
  432. package/dist/skills/store.js.map +1 -0
  433. package/dist/skills/types.d.ts +422 -0
  434. package/dist/skills/types.d.ts.map +1 -0
  435. package/dist/skills/types.js +2 -0
  436. package/dist/skills/types.js.map +1 -0
  437. package/dist/skills/validate.d.ts +11 -0
  438. package/dist/skills/validate.d.ts.map +1 -0
  439. package/dist/skills/validate.js +112 -0
  440. package/dist/skills/validate.js.map +1 -0
  441. package/dist/skills/versions-fs.d.ts +45 -0
  442. package/dist/skills/versions-fs.d.ts.map +1 -0
  443. package/dist/skills/versions-fs.js +234 -0
  444. package/dist/skills/versions-fs.js.map +1 -0
  445. package/dist/skills/versions.d.ts +56 -0
  446. package/dist/skills/versions.d.ts.map +1 -0
  447. package/dist/skills/versions.js +351 -0
  448. package/dist/skills/versions.js.map +1 -0
  449. package/dist/telemetry/contract.d.ts.map +1 -1
  450. package/dist/telemetry/contract.js +8 -6
  451. package/dist/telemetry/contract.js.map +1 -1
  452. package/dist/telemetry/notice.d.ts.map +1 -1
  453. package/dist/telemetry/notice.js +3 -1
  454. package/dist/telemetry/notice.js.map +1 -1
  455. package/dist/trace/check-reads.d.ts +36 -0
  456. package/dist/trace/check-reads.d.ts.map +1 -0
  457. package/dist/trace/check-reads.js +57 -0
  458. package/dist/trace/check-reads.js.map +1 -0
  459. package/dist/trace/checks.d.ts +63 -0
  460. package/dist/trace/checks.d.ts.map +1 -0
  461. package/dist/trace/checks.js +487 -0
  462. package/dist/trace/checks.js.map +1 -0
  463. package/dist/trace/claude.d.ts +124 -0
  464. package/dist/trace/claude.d.ts.map +1 -0
  465. package/dist/trace/claude.js +303 -0
  466. package/dist/trace/claude.js.map +1 -0
  467. package/dist/trace/codex-exec.d.ts +22 -0
  468. package/dist/trace/codex-exec.d.ts.map +1 -0
  469. package/dist/trace/codex-exec.js +129 -0
  470. package/dist/trace/codex-exec.js.map +1 -0
  471. package/dist/trace/codex-meta.d.ts +23 -0
  472. package/dist/trace/codex-meta.d.ts.map +1 -0
  473. package/dist/trace/codex-meta.js +112 -0
  474. package/dist/trace/codex-meta.js.map +1 -0
  475. package/dist/trace/codex.d.ts +33 -0
  476. package/dist/trace/codex.d.ts.map +1 -0
  477. package/dist/trace/codex.js +485 -0
  478. package/dist/trace/codex.js.map +1 -0
  479. package/dist/trace/cursor.d.ts +16 -0
  480. package/dist/trace/cursor.d.ts.map +1 -0
  481. package/dist/trace/cursor.js +133 -0
  482. package/dist/trace/cursor.js.map +1 -0
  483. package/dist/trace/dialect.d.ts +43 -0
  484. package/dist/trace/dialect.d.ts.map +1 -0
  485. package/dist/trace/dialect.js +95 -0
  486. package/dist/trace/dialect.js.map +1 -0
  487. package/dist/trace/epochs.d.ts +10 -0
  488. package/dist/trace/epochs.d.ts.map +1 -0
  489. package/dist/trace/epochs.js +16 -0
  490. package/dist/trace/epochs.js.map +1 -0
  491. package/dist/trace/failure.d.ts +15 -0
  492. package/dist/trace/failure.d.ts.map +1 -0
  493. package/dist/trace/failure.js +69 -0
  494. package/dist/trace/failure.js.map +1 -0
  495. package/dist/trace/gate-file.d.ts +71 -0
  496. package/dist/trace/gate-file.d.ts.map +1 -0
  497. package/dist/trace/gate-file.js +329 -0
  498. package/dist/trace/gate-file.js.map +1 -0
  499. package/dist/trace/guard-fast.d.ts +22 -0
  500. package/dist/trace/guard-fast.d.ts.map +1 -0
  501. package/dist/trace/guard-fast.js +213 -0
  502. package/dist/trace/guard-fast.js.map +1 -0
  503. package/dist/trace/host.d.ts +40 -0
  504. package/dist/trace/host.d.ts.map +1 -0
  505. package/dist/trace/host.js +84 -0
  506. package/dist/trace/host.js.map +1 -0
  507. package/dist/trace/housekeeping.d.ts +5 -0
  508. package/dist/trace/housekeeping.d.ts.map +1 -0
  509. package/dist/trace/housekeeping.js +93 -0
  510. package/dist/trace/housekeeping.js.map +1 -0
  511. package/dist/trace/jobs.d.ts +52 -0
  512. package/dist/trace/jobs.d.ts.map +1 -0
  513. package/dist/trace/jobs.js +182 -0
  514. package/dist/trace/jobs.js.map +1 -0
  515. package/dist/trace/known-repo.d.ts +3 -0
  516. package/dist/trace/known-repo.d.ts.map +1 -0
  517. package/dist/trace/known-repo.js +55 -0
  518. package/dist/trace/known-repo.js.map +1 -0
  519. package/dist/trace/pool.d.ts +40 -0
  520. package/dist/trace/pool.d.ts.map +1 -0
  521. package/dist/trace/pool.js +154 -0
  522. package/dist/trace/pool.js.map +1 -0
  523. package/dist/trace/redact.d.ts +8 -0
  524. package/dist/trace/redact.d.ts.map +1 -0
  525. package/dist/trace/redact.js +63 -0
  526. package/dist/trace/redact.js.map +1 -0
  527. package/dist/trace/repairs.d.ts +27 -0
  528. package/dist/trace/repairs.d.ts.map +1 -0
  529. package/dist/trace/repairs.js +303 -0
  530. package/dist/trace/repairs.js.map +1 -0
  531. package/dist/trace/run-calls.d.ts +82 -0
  532. package/dist/trace/run-calls.d.ts.map +1 -0
  533. package/dist/trace/run-calls.js +331 -0
  534. package/dist/trace/run-calls.js.map +1 -0
  535. package/dist/trace/run-join.d.ts +20 -0
  536. package/dist/trace/run-join.d.ts.map +1 -0
  537. package/dist/trace/run-join.js +99 -0
  538. package/dist/trace/run-join.js.map +1 -0
  539. package/dist/trace/run-sheets.d.ts +26 -0
  540. package/dist/trace/run-sheets.d.ts.map +1 -0
  541. package/dist/trace/run-sheets.js +145 -0
  542. package/dist/trace/run-sheets.js.map +1 -0
  543. package/dist/trace/run-turns.d.ts +24 -0
  544. package/dist/trace/run-turns.d.ts.map +1 -0
  545. package/dist/trace/run-turns.js +67 -0
  546. package/dist/trace/run-turns.js.map +1 -0
  547. package/dist/trace/run-verdict.d.ts +24 -0
  548. package/dist/trace/run-verdict.d.ts.map +1 -0
  549. package/dist/trace/run-verdict.js +176 -0
  550. package/dist/trace/run-verdict.js.map +1 -0
  551. package/dist/trace/runs.d.ts +54 -0
  552. package/dist/trace/runs.d.ts.map +1 -0
  553. package/dist/trace/runs.js +501 -0
  554. package/dist/trace/runs.js.map +1 -0
  555. package/dist/trace/seen-cache.d.ts +9 -0
  556. package/dist/trace/seen-cache.d.ts.map +1 -0
  557. package/dist/trace/seen-cache.js +46 -0
  558. package/dist/trace/seen-cache.js.map +1 -0
  559. package/dist/trace/shell-scan.d.ts +52 -0
  560. package/dist/trace/shell-scan.d.ts.map +1 -0
  561. package/dist/trace/shell-scan.js +318 -0
  562. package/dist/trace/shell-scan.js.map +1 -0
  563. package/dist/trace/shell-words.d.ts +91 -0
  564. package/dist/trace/shell-words.d.ts.map +1 -0
  565. package/dist/trace/shell-words.js +558 -0
  566. package/dist/trace/shell-words.js.map +1 -0
  567. package/dist/trace/shell.d.ts +91 -0
  568. package/dist/trace/shell.d.ts.map +1 -0
  569. package/dist/trace/shell.js +435 -0
  570. package/dist/trace/shell.js.map +1 -0
  571. package/dist/trace/skill-session.d.ts +64 -0
  572. package/dist/trace/skill-session.d.ts.map +1 -0
  573. package/dist/trace/skill-session.js +232 -0
  574. package/dist/trace/skill-session.js.map +1 -0
  575. package/dist/trace/state.d.ts +27 -0
  576. package/dist/trace/state.d.ts.map +1 -0
  577. package/dist/trace/state.js +98 -0
  578. package/dist/trace/state.js.map +1 -0
  579. package/dist/trace/tamper-code.d.ts +9 -0
  580. package/dist/trace/tamper-code.d.ts.map +1 -0
  581. package/dist/trace/tamper-code.js +174 -0
  582. package/dist/trace/tamper-code.js.map +1 -0
  583. package/dist/trace/tamper-git.d.ts +12 -0
  584. package/dist/trace/tamper-git.d.ts.map +1 -0
  585. package/dist/trace/tamper-git.js +77 -0
  586. package/dist/trace/tamper-git.js.map +1 -0
  587. package/dist/trace/tamper.d.ts +12 -0
  588. package/dist/trace/tamper.d.ts.map +1 -0
  589. package/dist/trace/tamper.js +405 -0
  590. package/dist/trace/tamper.js.map +1 -0
  591. package/dist/trace/typed.d.ts +30 -0
  592. package/dist/trace/typed.d.ts.map +1 -0
  593. package/dist/trace/typed.js +132 -0
  594. package/dist/trace/typed.js.map +1 -0
  595. package/dist/trace/types.d.ts +477 -0
  596. package/dist/trace/types.d.ts.map +1 -0
  597. package/dist/trace/types.js +12 -0
  598. package/dist/trace/types.js.map +1 -0
  599. package/dist/trace/wall-state.d.ts +86 -0
  600. package/dist/trace/wall-state.d.ts.map +1 -0
  601. package/dist/trace/wall-state.js +279 -0
  602. package/dist/trace/wall-state.js.map +1 -0
  603. package/dist/trace/walls-glob.d.ts +11 -0
  604. package/dist/trace/walls-glob.d.ts.map +1 -0
  605. package/dist/trace/walls-glob.js +264 -0
  606. package/dist/trace/walls-glob.js.map +1 -0
  607. package/dist/trace/walls-quoted.d.ts +25 -0
  608. package/dist/trace/walls-quoted.d.ts.map +1 -0
  609. package/dist/trace/walls-quoted.js +81 -0
  610. package/dist/trace/walls-quoted.js.map +1 -0
  611. package/dist/trace/walls.d.ts +40 -0
  612. package/dist/trace/walls.d.ts.map +1 -0
  613. package/dist/trace/walls.js +318 -0
  614. package/dist/trace/walls.js.map +1 -0
  615. package/dist/upkeep.d.ts +1 -1
  616. package/dist/upkeep.d.ts.map +1 -1
  617. package/dist/upkeep.js +4 -1
  618. package/dist/upkeep.js.map +1 -1
  619. package/dist/util/actions-folder.d.ts +2 -0
  620. package/dist/util/actions-folder.d.ts.map +1 -0
  621. package/dist/util/actions-folder.js +9 -0
  622. package/dist/util/actions-folder.js.map +1 -0
  623. package/dist/util/front-matter.d.ts +31 -4
  624. package/dist/util/front-matter.d.ts.map +1 -1
  625. package/dist/util/front-matter.js +95 -3
  626. package/dist/util/front-matter.js.map +1 -1
  627. package/dist/util/private-file.d.ts +14 -0
  628. package/dist/util/private-file.d.ts.map +1 -0
  629. package/dist/util/private-file.js +82 -0
  630. package/dist/util/private-file.js.map +1 -0
  631. package/dist/util/private-fs.d.ts +25 -0
  632. package/dist/util/private-fs.d.ts.map +1 -0
  633. package/dist/util/private-fs.js +253 -0
  634. package/dist/util/private-fs.js.map +1 -0
  635. package/dist/util/state.d.ts.map +1 -1
  636. package/dist/util/state.js +3 -0
  637. package/dist/util/state.js.map +1 -1
  638. package/dist/vendor/tree-sitter-swift/LICENSE +21 -0
  639. package/dist/vendor/tree-sitter-swift/node-types.json +30694 -0
  640. package/dist/vendor/tree-sitter-swift/prebuilds/darwin-arm64/tree-sitter-swift.node +0 -0
  641. package/dist/vendor/tree-sitter-swift/prebuilds/darwin-x64/tree-sitter-swift.node +0 -0
  642. package/dist/vendor/tree-sitter-swift/prebuilds/linux-arm64/tree-sitter-swift.node +0 -0
  643. package/dist/vendor/tree-sitter-swift/prebuilds/linux-x64/tree-sitter-swift.node +0 -0
  644. package/dist/vendor/tree-sitter-swift/prebuilds/win32-arm64/tree-sitter-swift.node +0 -0
  645. package/dist/vendor/tree-sitter-swift/prebuilds/win32-x64/tree-sitter-swift.node +0 -0
  646. package/dist/viewer/app.js +2 -2
  647. package/package.json +10 -7
  648. package/scripts/run-tests.mjs +14 -2
  649. package/scripts/stamp-telemetry-key.mjs +8 -5
  650. package/scripts/vendor-grammars.mjs +35 -0
@@ -0,0 +1,132 @@
1
+ /**
2
+ * Every reader of what the person typed, for learned skills: a save request
3
+ * and the scope words in it, the answer to an offer, a correction, and the
4
+ * hash, the only form typed text is ever stored in.
5
+ *
6
+ * An answer is a closed list of whole-message forms. "ok now fix the lint
7
+ * errors" starts like a yes and is not one: a skill is saved only on a reply
8
+ * that says nothing else. So the answer reads the whole message: a quote, a
9
+ * pasted block, a second line with more in it or a question mark makes it
10
+ * not a yes. The other matchers read `askText`: pasted code, quoted lines and
11
+ * very long lines are not the person's words.
12
+ *
13
+ * Pure: no files, no clock.
14
+ */
15
+ import { createHash } from 'node:crypto';
16
+ import { ownText } from './claude.js';
17
+ import { askText, wordCount, MAX_ASK_WORDS, STATUS_OR_HISTORY } from './jobs.js';
18
+ /** The person's words in a UserPromptSubmit `prompt`: phase 0's ownText(raw); null when that gives ''. */
19
+ export function typedPrompt(raw) {
20
+ return ownText(String(raw ?? '')) || null;
21
+ }
22
+ /** 4.4: the spec's phrasings and the self-learning worktree's keep asks. A file (`skill.md`) or a "skill issue" is not a skill. */
23
+ export const SAVE_REQUEST = new RegExp([
24
+ String.raw `\b(?:save|keep|make|turn)\s+(?:this|that|it|these(?:\s+steps)?|what\s+(?:you\s+)?(?:just\s+)?did|the\s+steps)\s+(?:as|into)\s+(?:a\s+)?skill(?!\w|[.-]\w|\s+issues?\b)`,
25
+ String.raw `\b(?:save|keep)\s+(?:this|that|it|these\s+steps)\s+for\s+next\s+time\b`,
26
+ String.raw `\bmake\s+(?:a\s+)?skill\s+(?:out\s+of|from)\s+(?:this|that|it)\b`,
27
+ String.raw `\bremember\s+how\s+(?:to\s+do\s+(?:this|that)|you\s+did\s+(?:this|that))\b`,
28
+ ].join('|'), 'i');
29
+ /** A no before the verb, in the same clause: "don't save", "I don't want to save", "you shouldn't keep", "I'd rather not keep". */
30
+ export const NOT_SAVE = /\b(?:don'?t|do not|never|no need to|not|shouldn'?t|should not|won'?t|will not|wouldn'?t|would not|didn'?t|did not)\b[^,.;:!?\n]*?\b(?:sav\w*|keep\w*|kept|mak\w*|made|turn\w*|remember\w*)\b/i;
31
+ /** Asked, then taken back ("... actually no", "... ? nah", "never mind"), or not now ("not yet, ... later"). */
32
+ const TAKEN_BACK = /\b(?:actually,? no|no,? wait|wait,? no|never ?mind|on second thought|scratch that|forget (?:it|that)|just kidding)\b|\b(?:nah|nope|no|don'?t|later)\W*$|^\W*not (?:yet|now)\b/i;
33
+ /** Wondering, asking why or how, not asking for it. */
34
+ const WONDERING = /^\s*why\b|\bwhy (?:did|didn'?t|would|do|does|is|are)\b|\bwhat (?:happens|if)\b|(?<!remember )\bhow (?:do|does|would|can|could|should|to)\b|\bexplain (?:how|what|why)\b|\bshould (?:i|we)\b|\bwhether\b/i;
35
+ /** Asking whether the agent recalls a past run: "do you remember how...", "remember how you did this last time?". */
36
+ const RECALLING = /\b(?:do|did|can|could) (?:you|u) remember\b|\bremember how\b[^.?!\n]*\b(?:last time|before|yesterday|earlier)\b/i;
37
+ /**
38
+ * SAVE_REQUEST on 25 words or fewer, and not NOT_SAVE. Also not a status or history question ("did you
39
+ * save this as a skill?"), not taken back, not wondering, not recalling: a wrong yes here saves a skill
40
+ * nobody asked for, a wrong no only means the person says it plainly.
41
+ */
42
+ export function isSaveRequest(typed) {
43
+ const ask = askText(typed).replace(/[\u2018\u2019]/g, "'");
44
+ if (wordCount(ask) > MAX_ASK_WORDS || !SAVE_REQUEST.test(ask) || NOT_SAVE.test(ask))
45
+ return false;
46
+ return !STATUS_OR_HISTORY.test(ask) && !TAKEN_BACK.test(ask) && !WONDERING.test(ask) && !RECALLING.test(ask);
47
+ }
48
+ export function scopeWords(typed) {
49
+ const t = askText(typed).toLowerCase();
50
+ if (/\b(always|everywhere|every repo|all (my )?repos|on this (mac|machine|laptop))\b/.test(t))
51
+ return 'every repo';
52
+ if (/\bfor (the|my|our) team\b/.test(t))
53
+ return 'team';
54
+ if (/\bfor (the )?(whole )?repo\b/.test(t) || /\b(for|in) (this|the) repo\b.*\b(everyone|team|all of us)\b/.test(t))
55
+ return 'repo';
56
+ return 'this repo';
57
+ }
58
+ const YES = [
59
+ // "ok thanks" closes a turn more often than it agrees to anything: ok and okay take no thanks.
60
+ /^(y|yes|yeah|yep|yup|sure)( please| do it| go ahead| save it| keep it| keep them| thanks| thank you)?$/,
61
+ /^(ok|okay)( please| do it| go ahead| save it| keep it| keep them)?$/,
62
+ /^(go ahead|do it|please do|save it|keep it|keep them|save them|sounds good)( please)?$/,
63
+ /^(yes|yeah|sure|ok|okay),? (keep|save) (it|this|that|them)( as a skill)?( please)?$/,
64
+ // Seen in real answers: praise, then the verb. Never praise alone.
65
+ /^(looks good|looks great|looks right|perfect|great|nice),? (keep|save) (it|this|that|them)( as a skill)?( please)?$/,
66
+ ];
67
+ const SHOW = /^(show( me)?( it| the steps| the draft| first)?|let me see( it)?|what are the steps|see the steps|what'?s in it)( please)?$/;
68
+ const NO = [
69
+ /^(n|no|nope|nah|not now|no thanks|no thank you|don'?t|skip( it)?|never ?mind|pass)( thanks| thank you)?$/,
70
+ /^(no )?(don'?t|do not)( (save|keep) (it|this|that|them)( as a skill)?)?( thanks| thank you)?$/,
71
+ ];
72
+ const TRAILING_EMOJI = /[\s\p{Extended_Pictographic}\u{FE0F}\u{200D}\u{1F3FB}-\u{1F3FF}]+$/u;
73
+ /**
74
+ * The whole message as one answer: lowercased, outer punctuation and a trailing emoji gone, commas and
75
+ * spaces as single spaces. The whole message, not `askText`: a quote, a pasted block or a long line is
76
+ * more than an answer, so it can't be one.
77
+ */
78
+ function answerForm(typed) {
79
+ return String(typed ?? '').replace(/[\u2018\u2019]/g, "'").toLowerCase().trim()
80
+ .replace(TRAILING_EMOJI, '')
81
+ .replace(/^[\s.!?,;:]+|[\s.!?,;:]+$/g, '')
82
+ .replace(/\s*,\s*/g, ' ')
83
+ .replace(/\s+/g, ' ');
84
+ }
85
+ /** D116 item 3: the go-ahead phrases a run spans turns on, as the line's whole first clause. */
86
+ const GO_AHEAD = /^(?:y|yes|yeah|yep|yup|sure|ok|okay|k|continue|go on|go ahead|do it|proceed|carry on|keep going|please do|please continue|please proceed|sounds good)(?: please)?$/;
87
+ /**
88
+ * D116 item 3: the person said to go on: the line's first clause (up to `,` `:` `;` `.` `!` or a dash) is a
89
+ * go-ahead (yes, ok, continue, go on, do it, proceed), whatever follows it. Never a question.
90
+ */
91
+ export function isGoAhead(typed) {
92
+ const t = String(typed ?? '').replace(/[\u2018\u2019]/g, "'").toLowerCase().trim();
93
+ if (!t || /\?\s*$/.test(t))
94
+ return false;
95
+ const first = t.split(/\s*(?:[,:;.!]|\s-\s|\s\u2014\s|$)/)[0].replace(TRAILING_EMOJI, '').trim();
96
+ return GO_AHEAD.test(first.replace(/\s+/g, ' '));
97
+ }
98
+ /** 4.12. afterShow: the offer already got its one 'show me'. A yes is never a question. */
99
+ export function classifyAnswer(typed, afterShow) {
100
+ const t = answerForm(typed);
101
+ if (!t)
102
+ return 'other';
103
+ if (!String(typed).includes('?') && YES.some((re) => re.test(t)))
104
+ return 'yes';
105
+ if (!afterShow && SHOW.test(t))
106
+ return 'show';
107
+ if (NO.some((re) => re.test(t)))
108
+ return 'no';
109
+ if (isCorrection(askText(typed)))
110
+ return 'correction';
111
+ return 'other';
112
+ }
113
+ /* Ported from the self-learning worktree's detect.ts. */
114
+ const CORRECTION_START = /^(no[,.!\s]|nope\b|not like that|that'?s (wrong|not)|wrong\b|actually[,\s]|i (said|told you)|why did you|you (keep|always|again)|again[,!]|stop\b|please don'?t|don'?t\b|do not\b|never\b|(it|you) (didn'?t|did not|forgot to|never)\b)/i;
115
+ const AGAIN = /\b(i told you|i said|as i said|you keep \w+ing|every single time|again and again|yet again|(did|doing|broke|happened) (it|that|this) again|again\?)/i;
116
+ const OUTPUT_CORRECTION = /\b(should (be|use|go|live) \S+.{0,30}\bnot\b|it'?s actually|is wrong|that'?s not (right|how)|you (got|have) (it|that) wrong)\b/i;
117
+ const MAX_CORRECTION_CHARS = 400;
118
+ /**
119
+ * The person is correcting what the agent just did. Ported from the worktree's detect.ts `isCorrection`; D111 adds
120
+ * "it didn't X" and "you forgot to X" without a leading no (moment 4's forms, 4.14 step 2).
121
+ */
122
+ export function isCorrection(typed) {
123
+ // The person's own words: a quoted ('>') line or a fenced block is what they quoted, not their correction (b4 review).
124
+ const t = askText(String(typed ?? '')).replace(/[\u2018\u2019]/g, "'").trim();
125
+ return t.length <= MAX_CORRECTION_CHARS && (CORRECTION_START.test(t) || OUTPUT_CORRECTION.test(t) || AGAIN.test(t));
126
+ }
127
+ /** sha256 hex of the text NFC-normalised, trimmed, whitespace collapsed. The only form typed text is ever stored in. */
128
+ export function typedSha(typed) {
129
+ const t = String(typed ?? '').normalize('NFC').trim().replace(/\s+/g, ' ');
130
+ return createHash('sha256').update(t).digest('hex');
131
+ }
132
+ //# sourceMappingURL=typed.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"typed.js","sourceRoot":"","sources":["../../src/trace/typed.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;GAaG;AACH,OAAO,EAAE,UAAU,EAAE,MAAM,aAAa,CAAC;AACzC,OAAO,EAAE,OAAO,EAAE,MAAM,aAAa,CAAC;AACtC,OAAO,EAAE,OAAO,EAAE,SAAS,EAAE,aAAa,EAAE,iBAAiB,EAAE,MAAM,WAAW,CAAC;AAKjF,0GAA0G;AAC1G,MAAM,UAAU,WAAW,CAAC,GAAW;IACrC,OAAO,OAAO,CAAC,MAAM,CAAC,GAAG,IAAI,EAAE,CAAC,CAAC,IAAI,IAAI,CAAC;AAC5C,CAAC;AAED,mIAAmI;AACnI,MAAM,CAAC,MAAM,YAAY,GAAG,IAAI,MAAM,CACpC;IACE,MAAM,CAAC,GAAG,CAAA,wKAAwK;IAClL,MAAM,CAAC,GAAG,CAAA,wEAAwE;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I,CAAC,gBAAgB,CAAC,IAAI,CAAC,CAAC,CAAC,IAAI,iBAAiB,CAAC,IAAI,CAAC,CAAC,CAAC,IAAI,KAAK,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,CAAC;AACtH,CAAC;AAED,wHAAwH;AACxH,MAAM,UAAU,QAAQ,CAAC,KAAa;IACpC,MAAM,CAAC,GAAG,MAAM,CAAC,KAAK,IAAI,EAAE,CAAC,CAAC,SAAS,CAAC,KAAK,CAAC,CAAC,IAAI,EAAE,CAAC,OAAO,CAAC,MAAM,EAAE,GAAG,CAAC,CAAC;IAC3E,OAAO,UAAU,CAAC,QAAQ,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC;AACtD,CAAC"}
@@ -0,0 +1,477 @@
1
+ /**
2
+ * The shapes the trace layer folds a session into: runs of tool work that
3
+ * serve one typed ask, their calls, the checks that prove a job worked, and
4
+ * the per-session state the skills hooks keep under the `skills` key of
5
+ * `~/.trail/sessions/<id>.json`.
6
+ *
7
+ * Types only (a type import of skills/types.ts for the fold ops). Typed text never appears here: a run carries job words from a
8
+ * fixed vocabulary, parameter values of known shapes, counts, hashes of typed
9
+ * lines, and the commands that ran (secret-checked).
10
+ */
11
+ import type { FoldOp } from '../skills/types.js';
12
+ export type JobClass = 'release' | 'ship' | 'pr-green' | 'sweep' | 'run-local' | 'report' | 'tests';
13
+ export interface JobMatch {
14
+ job: JobClass;
15
+ /** Canonical vocabulary words that matched, e.g. ['push', 'beta', 'ff', 'prod']. Never raw text. */
16
+ words: string[];
17
+ }
18
+ /** Parameter values of known shapes found in a typed ask. Values only, never the text around them. */
19
+ export type PromptParams = Partial<Record<'version' | 'sha' | 'pr' | 'port' | 'branch' | 'date', string>>;
20
+ /** What a Bash call is, decided at fold time from its raw command (4.1). */
21
+ export type CallKind = 'step' | 'look' | 'plumbing' | 'work';
22
+ export interface RunCall {
23
+ /** tool_use id */
24
+ id: string;
25
+ at: string;
26
+ /** The command after redactSecrets (4.10). null when it held a secret that could not be named, or ran over 2,000 characters (then `parts` holds it piece by piece, D58c). */
27
+ cmd: string | null;
28
+ /** For a call with `parts`, the worst of its pieces' (refused over named). */
29
+ secret?: 'named' | 'refused';
30
+ /** Repo key of the effective folder (4.1); null outside git. */
31
+ key: string | null;
32
+ /** Effective folder (4.1), relative to that checkout's root ('' = root); null outside git. A sheet stores null for calls in another repo than the run's. */
33
+ cwd: string | null;
34
+ /** tool_input.run_in_background === true, or the command ends in a top-level `&`. */
35
+ bg: boolean;
36
+ /** !ok from the trace: is_error, or failure text in head or tail. */
37
+ failed: boolean;
38
+ /** The host's own error flag only. */
39
+ isError: boolean;
40
+ /** errorLine(result), cleanLine(.., 160). */
41
+ errorLine?: string;
42
+ /** Last 200 chars of the result, cleanLine'd. Kept for check-family calls, polls, `git rev-parse`, `git push` and publish calls only. */
43
+ tail?: string;
44
+ check?: CheckHit;
45
+ /** Raw command over 2,000 chars: never kept whole; its pieces are in `parts` (D58c). */
46
+ truncated?: boolean;
47
+ /** isMultiLine(raw command). */
48
+ multiLine?: boolean;
49
+ kind: CallKind;
50
+ /** Byte offsets of the tool_use line and the tool_result line, for the gate (4.9). -1 / null when unknown. */
51
+ src: {
52
+ use: number;
53
+ result: number | null;
54
+ };
55
+ /** The outcome came from a PostToolUse(Failure) mark because the transcript had no result yet (3.4). A later transcript result replaces it. */
56
+ fromMark?: true;
57
+ /** Only when the raw command ran over 2,000 characters (then `cmd` is null and `truncated` set): its top-level pieces in order (D58c). */
58
+ parts?: RunCallPart[];
59
+ /**
60
+ * Not a Bash call: a deployment status tool over MCP (D59b, `mcp__claude_ai_Vercel__get_deployment`). Then `cmd` is
61
+ * null, `kind` is 'look', `key`/`cwd` are null, and `check` is the deploy check its result gave. Never a step,
62
+ * never counted in `commands` or `failedCount`.
63
+ */
64
+ tool?: string;
65
+ /**
66
+ * D116 item 5: the call only fed keystrokes into a login (`... | script -q /dev/null npm login`): the service it logs
67
+ * in to. Then `cmd` is the login alone (`npm login`): what was fed is never kept, and compile drops the step.
68
+ */
69
+ loginFeed?: string;
70
+ }
71
+ /**
72
+ * One top-level piece of a call over 2,000 characters (D58c), as `splitTop` cuts it: a subshell, a loop or an `if`
73
+ * is one piece, a heredoc body belongs to the piece that opened it. The call's `id` and `src` are every piece's
74
+ * `from` (the save gate re-reads that one transcript line).
75
+ */
76
+ export interface RunCallPart {
77
+ /** Word for word what ran, after redactSecrets; null when it held a secret that could not be named, or is `long`. */
78
+ cmd: string | null;
79
+ /** The top-level separator after it; '' for the last. A newline reads as ';'. */
80
+ sep: '&&' | '||' | ';' | '|' | '&' | '';
81
+ /** 4.1 kinds for the piece alone; always 'work' when `long`. */
82
+ kind: CallKind;
83
+ secret?: 'named' | 'refused';
84
+ /** The piece ran over 2,000 characters (a heredoc body, an inline edit): a work marker, never a step, never kept. */
85
+ long?: true;
86
+ }
87
+ /** `push`: a `git push` whose output shows the remote ref moved (D56a); a step, like `tests` and `query`. */
88
+ export type CheckFamily = 'tests' | 'npm-view' | 'deploy' | 'gh-checks' | 'ls-remote' | 'query' | 'push';
89
+ export interface CheckHit {
90
+ family: CheckFamily;
91
+ passed: boolean;
92
+ facts: {
93
+ version?: string;
94
+ sha?: string;
95
+ state?: string;
96
+ pr?: string;
97
+ branch?: string;
98
+ remote?: string;
99
+ pkg?: string;
100
+ passedCount?: number;
101
+ };
102
+ }
103
+ export type RunEnd = 'done' | 'failure' | 'question' | 'open';
104
+ export interface RunState {
105
+ id: string;
106
+ epoch: number;
107
+ startedAt: string;
108
+ lastAt: string;
109
+ /** Repo key that most of the run's commands ran in (4.1). */
110
+ repoKey: string;
111
+ /** D93: the top of the checkout `repoKey` names, as the fold found it; absent when no call ran in it. */
112
+ checkout?: string;
113
+ /** gitBranch of its first step call; null when unknown. */
114
+ branch: string | null;
115
+ job: JobClass | null;
116
+ jobWords: string[];
117
+ promptParams: PromptParams;
118
+ /** Words both in the typed ask and in the kept commands (moment 1 cue words when job is null). */
119
+ sharedWords: string[];
120
+ typedCount: number;
121
+ toolCalls: number;
122
+ edits: number;
123
+ commands: number;
124
+ failedCount: number;
125
+ stepCalls: number;
126
+ /** Open run only, newest last, at most 200. Emptied when the run closes, after its sheet is written. */
127
+ calls: RunCall[];
128
+ closed: boolean;
129
+ /** Recomputed at every Stop while the run is open (4.2), kept when it closes. */
130
+ end: RunEnd;
131
+ /** Set when a run block was injected for this run (not "from scratch"). */
132
+ skillId?: string;
133
+ /** The run a compaction cut before it checked out, whose job this run continues (D59a). The agent started it with no typed ask. */
134
+ carriedFrom?: string;
135
+ /**
136
+ * D116 item 3: a go-ahead continued this run after a turn the agent ended in failure; this many calls had run then.
137
+ * Only a check at or after that call can check the run out.
138
+ */
139
+ failedTurn?: number;
140
+ sheet: 'none' | 'draft' | 'checked';
141
+ checkIndex: number | null;
142
+ poolNoted: boolean;
143
+ }
144
+ /** ~/.trail/runs/<id>.json. What compile copies from. */
145
+ export interface RunSheet {
146
+ v: 1;
147
+ id: string;
148
+ session: string;
149
+ repoKey: string;
150
+ /** D93: the checkout the run ran in (RunState.checkout). The save gate's halves read it, never their own cwd. */
151
+ checkout?: string;
152
+ branch: string | null;
153
+ host: string;
154
+ tier: 'A' | 'B' | 'C' | 'D';
155
+ epoch: number;
156
+ startedAt: string;
157
+ endedAt: string;
158
+ job: JobClass | null;
159
+ jobWords: string[];
160
+ sharedWords: string[];
161
+ promptParams: PromptParams;
162
+ calls: RunCall[];
163
+ /** Index into calls of the passing check that made it a checked success, or null. */
164
+ checkIndex: number | null;
165
+ checked: boolean;
166
+ end: RunEnd;
167
+ counts: {
168
+ commands: number;
169
+ failed: number;
170
+ toolCalls: number;
171
+ edits: number;
172
+ };
173
+ /** Absolute paths of helper scripts the run executed from scratch folders (4.5 step 7). */
174
+ helpers: string[];
175
+ /** The skill whose block drove this run, or null. */
176
+ skillId: string | null;
177
+ /** The run (and sheet) before the compaction that this one continues (D59a); its calls are the job's first part. */
178
+ carriedFrom?: string;
179
+ /** Set only by `joinCarriedSheet`: the earlier parts joined in, oldest first, and how many calls each brought (they come first). */
180
+ joined?: Array<{
181
+ id: string;
182
+ calls: number;
183
+ }>;
184
+ }
185
+ /** Phase 2: 'retire', the retire proposal's and drift's retire (4.10, classifyFor); 1a's classifyAnswer never gives it. */
186
+ export type TypedAnswer = 'yes' | 'no' | 'show' | 'correction' | 'retire' | 'other';
187
+ export type GatedKind = 'publish' | 'push-prod' | 'deploy' | 'merge' | 'migrate' | 'prune' | 'login';
188
+ export interface SkillInjection {
189
+ injId: string;
190
+ skillId: string;
191
+ name: string;
192
+ epoch: number;
193
+ at: string;
194
+ cue: 'job' | 'name' | 'check' | 'compact';
195
+ params: Record<string, string>;
196
+ /** Steps with params filled, in order (step n = index + 1). [] for a check cue. */
197
+ steps: string[];
198
+ gated: Array<{
199
+ step: number;
200
+ kind: GatedKind;
201
+ }>;
202
+ check: string | null;
203
+ /**
204
+ * D66: the skill's `metadata.check-tool` (e.g. 'get_deployment') when its check is a deploy status read over MCP,
205
+ * not a command. Credit then takes the check from that tool's result (READY passes). Absent for a command check.
206
+ */
207
+ checkTool?: string | null;
208
+ /**
209
+ * D106: the version a version check should show (the skill's `check-shows` is a `{version}` param, filled with a
210
+ * literal version). Credit passes the check only when it shows this version. Absent otherwise.
211
+ */
212
+ checkVersion?: string;
213
+ /**
214
+ * The ready probes (their text, from the skill's `ready` line) that failed when the block came in. Credit puts
215
+ * their forms in the use line; they never count against the skill (g4 open issue 4, D71 d). Absent when none failed.
216
+ */
217
+ readyFailed?: string[];
218
+ /** Set by the fold: the run of the first typed event at or after `at` minus 5 s. */
219
+ runId: string | null;
220
+ /** Its gated ask applies (3.3). Ends per 3.1 step 3, 3.2 step 7 and 3.5 step 5. */
221
+ live: boolean;
222
+ }
223
+ export type OfferChannel = 'stop' | 'notice' | 'post-tool';
224
+ export interface PendingOffer {
225
+ offerId: string;
226
+ moment: OfferMoment;
227
+ runId: string;
228
+ name: string;
229
+ key: string;
230
+ /**
231
+ * The 2 lines (4.12). 1b: null only for a 'correction' offer, rebuilt from the transcript (P17); every reader goes
232
+ * through offerLinesOf (b4, R12). Until then each 1a reader treats null as no offer: never shown, answered or saved.
233
+ */
234
+ lines: [string, string] | null;
235
+ channel: OfferChannel;
236
+ shownAt: string | null;
237
+ showMe: boolean;
238
+ /** Set by the prompt hook from the UserPromptSubmit payload: the person's yes, as a hash. */
239
+ yes: {
240
+ at: string;
241
+ typedSha: string;
242
+ } | null;
243
+ /** Set by the fold: the first typed events after shownAt (at most 2: a 'show' then the answer). */
244
+ typedAfter: Array<{
245
+ offset: number;
246
+ sha: string;
247
+ answer: TypedAnswer;
248
+ }>;
249
+ /** g5 review: `skillSha` of the skill the offer counted (offerDue). The gate saves only that skill on its yes. */
250
+ skillSha?: string;
251
+ /** D101: how often the job worked out from scratch (line 1's count), for Trail's own reason in the Stop and post-tool text. */
252
+ seen?: {
253
+ n: number;
254
+ unit: 'day' | 'time';
255
+ };
256
+ }
257
+ export interface CreditState {
258
+ useId: string;
259
+ injId: string;
260
+ skillId: string;
261
+ epoch: number;
262
+ runId: string | null;
263
+ stepsRan: number[];
264
+ failedStep: number | null;
265
+ check: 'passed' | 'failed' | 'none';
266
+ calls: number;
267
+ failed: number;
268
+ flushed: boolean;
269
+ promptsAfter: number;
270
+ }
271
+ /** The `skills` key of ~/.trail/sessions/<id>.json. The `trace` key beside it is the catch-up cursor (0.1). */
272
+ export interface SkillSessionState {
273
+ v: 1;
274
+ sessionHash: string;
275
+ host: string;
276
+ tier: 'A' | 'B' | 'C' | 'D';
277
+ /** GateCtx.learn when this state was made (0 rule 2). */
278
+ learn: boolean;
279
+ /** Repo keys in scope for recall: the cwd's key, plus child checkouts when cwd is not in git (3.1). */
280
+ scopeKeys: string[];
281
+ epoch: number;
282
+ /** SessionStart(compact) bumped the epoch before the fold met the compaction line (4.1). */
283
+ pendingBoundary: boolean;
284
+ /** At most 20, open run last. */
285
+ runs: RunState[];
286
+ pendingOffer: PendingOffer | null;
287
+ /** The one offer of this session is spent (an offer, an asked save, or the shim's install line, D27). */
288
+ offerUsed: boolean;
289
+ offerUsedBy: 'offer' | 'asked' | 'install-line' | null;
290
+ /** typed: set by the fold when it meets the typed line with this typedSha at or after `at` minus 5 s. */
291
+ saveRequest: {
292
+ runId: string;
293
+ at: string;
294
+ typedSha: string;
295
+ scope: 'this repo' | 'every repo' | 'repo' | 'team';
296
+ typed: {
297
+ offset: number;
298
+ sha: string;
299
+ } | null;
300
+ /** D73: `skillSha` of the skill compiled when the person asked. The gate saves only that skill; missing: refused. */
301
+ skillSha?: string;
302
+ /** The name Trail gave that skill (the add it told the agent to run). The gate keeps it under this name, or
303
+ * a numbered one when it was taken since; missing: refused. */
304
+ name?: string;
305
+ } | null;
306
+ /** All epochs this session, newest last, at most 20. */
307
+ injected: SkillInjection[];
308
+ /** Newest last, at most 10. */
309
+ credit: CreditState[];
310
+ /** The first call that wrote Trail's or the host's files (4.1), as '<tool> <path or program>'. Never cleared. */
311
+ tampered: string | null;
312
+ /**
313
+ * The run the last compaction cut mid-job, before it checked out (D59a): the next run the agent starts with no
314
+ * typed ask continues its job. Spent by that run; cleared by any typed line.
315
+ */
316
+ cut?: string;
317
+ /**
318
+ * D116 item 3: how the agent's last reply ended (4.3: failure first, then a question, else done), from the fold's
319
+ * last assistant text before a typed line or a call; cleared by a call, a typed line and a compaction. Never text.
320
+ */
321
+ replyEnd?: 'failure' | 'question' | 'done';
322
+ updatedAt: string;
323
+ /**
324
+ * What was already folded, so a block of history the transcript repeats, or a transcript read again from
325
+ * the top, folds once (D56d): 10 hex of sha256 per tool_use id, typed line and compaction line, concatenated,
326
+ * oldest first, at most 6,000. Never an id in the clear.
327
+ */
328
+ seen?: string;
329
+ }
330
+ /** The wall catalog's classes (spec 12). Closed: equal to telemetry's wall_hit.class values, in the catalog's order. */
331
+ export type WallClass = 'timeout-missing' | 'zsh-no-match' | 'git-https-auth' | 'docker-rootless' | 'npm-e401-eotp' | 'claude-not-logged-in' | 'enospc';
332
+ /** What changed between a failing call and the retry that worked (4.12). */
333
+ export type FixDeltaKind = 'env' | 'flag' | 'wrapper' | 'enable-step';
334
+ export interface FixDelta {
335
+ kind: FixDeltaKind;
336
+ /** env: the variable name; flag: the flag; wrapper: the program put in front; enable-step: that call's program. */
337
+ name: string;
338
+ /** The text as it ran, secret-checked and relativized ($HOME, repo-relative). Never a typed word. */
339
+ text: string;
340
+ /** The tool_use id that carried it. */
341
+ callId: string;
342
+ }
343
+ export interface RepairEvent {
344
+ cls: WallClass;
345
+ program: string;
346
+ failCallId: string;
347
+ /** The retry that worked. */
348
+ fixCallId: string;
349
+ /** Non-empty, else it is not a repair. */
350
+ delta: FixDelta[];
351
+ epoch: number;
352
+ runId: string | null;
353
+ at: string;
354
+ }
355
+ /** Phase 2: moment 5 'update', moment 6 'drift', and the retire proposal 'retire' (4.7 to 4.10). */
356
+ export type OfferMoment = 'repeated' | 'repaired' | 'correction' | 'update' | 'drift' | 'retire';
357
+ export interface RunCall {
358
+ /** Set by run-calls.ts makeCall (b2, R8): matchWall(result text, command, failed). Kept in run sheets as a class name only. */
359
+ wall?: WallClass;
360
+ /** The run's Edit/Write tool calls before this one, when any (b2 review): an edit between a failure and its retry may be the fix, so no repair. */
361
+ editsBefore?: number;
362
+ }
363
+ export interface RunState {
364
+ /** Filled at run close (4.12): at most 5 per run. The wall hits themselves are RunCall.wall. */
365
+ repairs?: RepairEvent[];
366
+ }
367
+ export interface PendingOffer {
368
+ /** b4: the repo the offer is for (its `offers.jsonl` line's `repo`). A correction's key names the skill, not the repo. */
369
+ repo?: string;
370
+ /** Moment 3. as 'lesson': lessonSha is the sha256 of the lesson text line 2 shows (R26). */
371
+ repair?: {
372
+ cls: WallClass;
373
+ program: string;
374
+ nth: number;
375
+ firstAt: string;
376
+ as: 'skill' | 'lesson';
377
+ delta: FixDelta[];
378
+ lessonSha?: string;
379
+ };
380
+ /** Moment 4: the person's correction line (offset and sha), the first new step that worked after it, the lesson as offered. */
381
+ correction?: {
382
+ skillId: string;
383
+ useId: string;
384
+ typed: {
385
+ offset: number;
386
+ sha: string;
387
+ };
388
+ fixCallId: string | null;
389
+ lessonSha: string;
390
+ /** b4: the fix command as the lesson holds it (params put back, relativized, risk-checked), or null: the agent's
391
+ * command, never the person's words, so line 2 is rebuilt from the typed line and this (P17). */
392
+ fix?: string | null;
393
+ };
394
+ }
395
+ export interface SkillInjection {
396
+ /** 8 hex of sha256 of the asks phrase that fired a 'job' cue; null for name, check, compact. Never the phrase (D71 b, R30). */
397
+ phraseSha?: string | null;
398
+ }
399
+ export interface CreditState {
400
+ /** Copied from the injection. */
401
+ phraseSha?: string | null;
402
+ /** creditWindow sets sha; the fold fills offset from an origin-human typed line only. */
403
+ corrected?: {
404
+ offset: number | null;
405
+ sha: string;
406
+ } | null;
407
+ }
408
+ export interface SkillSessionState {
409
+ lessonWatch?: {
410
+ skillId: string;
411
+ useId: string;
412
+ typedSha: string;
413
+ at: string;
414
+ } | null;
415
+ /** The correction that withdrew this session's offer: only the moment-4 offer for that same correction may use the freed slot (P18, R40). */
416
+ withdrewFor?: {
417
+ typedSha: string;
418
+ } | null;
419
+ /** Lines of sessions/<id>.denied.jsonl Stop has counted (3.5 step 5). */
420
+ deniedSeen?: number;
421
+ }
422
+ /** The facts of a Codex rollout's first line (`session_meta`, 4.15), read once. No text but `cwd`. c6's `codexMeta` returns it. */
423
+ export interface CodexMeta {
424
+ id: string;
425
+ originator: string | null;
426
+ source: string | null;
427
+ cliVersion: string | null;
428
+ cwd: string | null;
429
+ historyMode: 'legacy' | 'paginated' | null;
430
+ }
431
+ export interface PendingOffer {
432
+ /** Moments 5 and 6 (4.7, 4.8): the change shown, pinned to the file it was computed from and to the text it would write. */
433
+ fold?: {
434
+ op: FoldOp | 'replace';
435
+ skillId: string;
436
+ baseHash: string;
437
+ proposalSha: string;
438
+ handEdited: boolean;
439
+ splitName?: string;
440
+ lessonIds?: string[];
441
+ version: number;
442
+ };
443
+ /** The retire proposal and drift (4.9): the skill a 'retire' answer retires. */
444
+ retire?: {
445
+ skillId: string;
446
+ name: string;
447
+ };
448
+ }
449
+ export interface SkillSessionState {
450
+ /** c7: Codex only. The rollout's first line, read once (4.17), and the keyed hashes (HMAC with its own key file,
451
+ * state/typed-key, D138 (3); 16 hex, last 20) of prompts the prompt hook saw (P30, R7). Never a prompt. */
452
+ codex?: {
453
+ meta: CodexMeta | null;
454
+ typedShas: string[];
455
+ };
456
+ /** c8 (4.9): not-followed firings the prompt hook's settle wrote, for the next Stop's retire proposal. At most 4. */
457
+ firedLater?: Array<{
458
+ skillId: string;
459
+ name: string;
460
+ followed: boolean;
461
+ runId: string;
462
+ at: string;
463
+ }>;
464
+ }
465
+ /** Phase 2 c8 (D137): a gated step this session couldn't ask for was denied and handed to the person to run. */
466
+ export interface SkillInjection {
467
+ /** The gated steps handed to the person (from the gate file's marks): credit counts each as handed, not failed. */
468
+ handed?: Array<{
469
+ n: number;
470
+ at: string;
471
+ }>;
472
+ }
473
+ export interface RunState {
474
+ /** The newest hand-off of one of its block's gated steps: the person's next ask of the job continues this run. */
475
+ handedAt?: string;
476
+ }
477
+ //# sourceMappingURL=types.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../src/trace/types.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AAEH,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,oBAAoB,CAAC;AAEjD,MAAM,MAAM,QAAQ,GAAG,SAAS,GAAG,MAAM,GAAG,UAAU,GAAG,OAAO,GAAG,WAAW,GAAG,QAAQ,GAAG,OAAO,CAAC;AAEpG,MAAM,WAAW,QAAQ;IACvB,GAAG,EAAE,QAAQ,CAAC;IACd,oGAAoG;IACpG,KAAK,EAAE,MAAM,EAAE,CAAC;CACjB;AAED,sGAAsG;AACtG,MAAM,MAAM,YAAY,GAAG,OAAO,CAAC,MAAM,CAAC,SAAS,GAAG,KAAK,GAAG,IAAI,GAAG,MAAM,GAAG,QAAQ,G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O,CAAC;QACpG,SAAS,CAAC,EAAE,MAAM,CAAC;QAAC,SAAS,CAAC,EAAE,MAAM,EAAE,CAAC;QAAC,OAAO,EAAE,MAAM,CAAA;KAAE,CAAC;IACrE,gFAAgF;IAChF,MAAM,CAAC,EAAE;QAAE,OAAO,EAAE,MAAM,CAAC;QAAC,IAAI,EAAE,MAAM,CAAA;KAAE,CAAC;CAC5C;AAED,MAAM,WAAW,iBAAiB;IAChC;gHAC4G;IAC5G,KAAK,CAAC,EAAE;QAAE,IAAI,EAAE,SAAS,GAAG,IAAI,CAAC;QAAC,SAAS,EAAE,MAAM,EAAE,CAAA;KAAE,CAAC;IACxD,qHAAqH;IACrH,UAAU,CAAC,EAAE,KAAK,CAAC;QAAE,OAAO,EAAE,MAAM,CAAC;QAAC,IAAI,EAAE,MAAM,CAAC;QAAC,QAAQ,EAAE,OAAO,CAAC;QAAC,KAAK,EAAE,MAAM,CAAC;QAAC,EAAE,EAAE,MAAM,CAAA;KAAE,CAAC,CAAC;CACrG;AAED,gHAAgH;AAChH,MAAM,WAAW,cAAc;IAC7B,mHAAmH;IACnH,MAAM,CAAC,EAAE,KAAK,CAAC;QAAE,CAAC,EAAE,MAAM,CAAC;QAAC,EAAE,EAAE,MAAM,CAAA;KAAE,CAAC,CAAC;CAC3C;AACD,MAAM,WAAW,QAAQ;IACvB,kHAAkH;IAClH,QAAQ,CAAC,EAAE,MAAM,CAAC;CACnB"}
@@ -0,0 +1,12 @@
1
+ /**
2
+ * The shapes the trace layer folds a session into: runs of tool work that
3
+ * serve one typed ask, their calls, the checks that prove a job worked, and
4
+ * the per-session state the skills hooks keep under the `skills` key of
5
+ * `~/.trail/sessions/<id>.json`.
6
+ *
7
+ * Types only (a type import of skills/types.ts for the fold ops). Typed text never appears here: a run carries job words from a
8
+ * fixed vocabulary, parameter values of known shapes, counts, hashes of typed
9
+ * lines, and the commands that ran (secret-checked).
10
+ */
11
+ export {};
12
+ //# sourceMappingURL=types.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"types.js","sourceRoot":"","sources":["../../src/trace/types.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG"}