@nanonets/graft 0.23.0 → 0.24.0

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 (287) 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/claude/format.d.ts +21 -0
  18. package/dist/claude/format.d.ts.map +1 -1
  19. package/dist/claude/format.js +46 -1
  20. package/dist/claude/format.js.map +1 -1
  21. package/dist/claude/hooks.d.ts +5 -9
  22. package/dist/claude/hooks.d.ts.map +1 -1
  23. package/dist/claude/hooks.js +71 -58
  24. package/dist/claude/hooks.js.map +1 -1
  25. package/dist/claude/init.js +3 -3
  26. package/dist/claude/init.js.map +1 -1
  27. package/dist/claude/note-signals.d.ts +28 -0
  28. package/dist/claude/note-signals.d.ts.map +1 -0
  29. package/dist/claude/note-signals.js +325 -0
  30. package/dist/claude/note-signals.js.map +1 -0
  31. package/dist/claude/shim-template.d.ts.map +1 -1
  32. package/dist/claude/shim-template.js +17 -6
  33. package/dist/claude/shim-template.js.map +1 -1
  34. package/dist/claude/skill-template.d.ts.map +1 -1
  35. package/dist/claude/skill-template.js +49 -18
  36. package/dist/claude/skill-template.js.map +1 -1
  37. package/dist/claude/state.d.ts +4 -3
  38. package/dist/claude/state.d.ts.map +1 -1
  39. package/dist/claude/state.js.map +1 -1
  40. package/dist/claude/sync-run.js +1 -1
  41. package/dist/claude/sync-run.js.map +1 -1
  42. package/dist/cli-picker.d.ts +12 -5
  43. package/dist/cli-picker.d.ts.map +1 -1
  44. package/dist/cli-picker.js +24 -8
  45. package/dist/cli-picker.js.map +1 -1
  46. package/dist/cli.d.ts +2 -0
  47. package/dist/cli.d.ts.map +1 -1
  48. package/dist/cli.js +149 -43
  49. package/dist/cli.js.map +1 -1
  50. package/dist/context/batches.d.ts +29 -0
  51. package/dist/context/batches.d.ts.map +1 -0
  52. package/dist/context/batches.js +130 -0
  53. package/dist/context/batches.js.map +1 -0
  54. package/dist/context/build.d.ts +7 -2
  55. package/dist/context/build.d.ts.map +1 -1
  56. package/dist/context/build.js +84 -50
  57. package/dist/context/build.js.map +1 -1
  58. package/dist/context/node-file.d.ts.map +1 -1
  59. package/dist/context/node-file.js +41 -4
  60. package/dist/context/node-file.js.map +1 -1
  61. package/dist/engine.d.ts +2 -0
  62. package/dist/engine.d.ts.map +1 -1
  63. package/dist/engine.js +1 -0
  64. package/dist/engine.js.map +1 -1
  65. package/dist/graph/cards.d.ts.map +1 -1
  66. package/dist/graph/cards.js +9 -4
  67. package/dist/graph/cards.js.map +1 -1
  68. package/dist/graph/enrich.d.ts.map +1 -1
  69. package/dist/graph/enrich.js +8 -3
  70. package/dist/graph/enrich.js.map +1 -1
  71. package/dist/graph/generic.d.ts.map +1 -1
  72. package/dist/graph/generic.js +207 -6
  73. package/dist/graph/generic.js.map +1 -1
  74. package/dist/graph/lsp/client.d.ts +18 -0
  75. package/dist/graph/lsp/client.d.ts.map +1 -1
  76. package/dist/graph/lsp/client.js +40 -2
  77. package/dist/graph/lsp/client.js.map +1 -1
  78. package/dist/graph/lsp/enrich.d.ts.map +1 -1
  79. package/dist/graph/lsp/enrich.js +9 -1
  80. package/dist/graph/lsp/enrich.js.map +1 -1
  81. package/dist/graph/lsp/registry.d.ts +7 -0
  82. package/dist/graph/lsp/registry.d.ts.map +1 -1
  83. package/dist/graph/lsp/registry.js +27 -2
  84. package/dist/graph/lsp/registry.js.map +1 -1
  85. package/dist/graph/queries/gleam.scm +51 -0
  86. package/dist/graph/resolve.d.ts.map +1 -1
  87. package/dist/graph/resolve.js +65 -3
  88. package/dist/graph/resolve.js.map +1 -1
  89. package/dist/graph/workspace-cli.d.ts +2 -0
  90. package/dist/graph/workspace-cli.d.ts.map +1 -1
  91. package/dist/graph/workspace-cli.js +1 -1
  92. package/dist/graph/workspace-cli.js.map +1 -1
  93. package/dist/init-guard.d.ts +11 -0
  94. package/dist/init-guard.d.ts.map +1 -0
  95. package/dist/init-guard.js +21 -0
  96. package/dist/init-guard.js.map +1 -0
  97. package/dist/mcp/tools.d.ts.map +1 -1
  98. package/dist/mcp/tools.js +2 -1
  99. package/dist/mcp/tools.js.map +1 -1
  100. package/dist/notes/branches.d.ts +7 -1
  101. package/dist/notes/branches.d.ts.map +1 -1
  102. package/dist/notes/branches.js +31 -3
  103. package/dist/notes/branches.js.map +1 -1
  104. package/dist/notes/cold-start.d.ts +12 -2
  105. package/dist/notes/cold-start.d.ts.map +1 -1
  106. package/dist/notes/cold-start.js +46 -5
  107. package/dist/notes/cold-start.js.map +1 -1
  108. package/dist/notes/credit.d.ts +37 -0
  109. package/dist/notes/credit.d.ts.map +1 -0
  110. package/dist/notes/credit.js +78 -0
  111. package/dist/notes/credit.js.map +1 -0
  112. package/dist/notes/find-notes.d.ts +17 -0
  113. package/dist/notes/find-notes.d.ts.map +1 -0
  114. package/dist/notes/find-notes.js +48 -0
  115. package/dist/notes/find-notes.js.map +1 -0
  116. package/dist/notes/flatten.d.ts +31 -0
  117. package/dist/notes/flatten.d.ts.map +1 -0
  118. package/dist/notes/flatten.js +73 -0
  119. package/dist/notes/flatten.js.map +1 -0
  120. package/dist/notes/git-facts.d.ts +7 -1
  121. package/dist/notes/git-facts.d.ts.map +1 -1
  122. package/dist/notes/git-facts.js +12 -2
  123. package/dist/notes/git-facts.js.map +1 -1
  124. package/dist/notes/home.d.ts +24 -6
  125. package/dist/notes/home.d.ts.map +1 -1
  126. package/dist/notes/home.js +82 -15
  127. package/dist/notes/home.js.map +1 -1
  128. package/dist/notes/learning-fields.d.ts +102 -0
  129. package/dist/notes/learning-fields.d.ts.map +1 -0
  130. package/dist/notes/learning-fields.js +214 -0
  131. package/dist/notes/learning-fields.js.map +1 -0
  132. package/dist/notes/memory-notes.d.ts +71 -0
  133. package/dist/notes/memory-notes.d.ts.map +1 -0
  134. package/dist/notes/memory-notes.js +239 -0
  135. package/dist/notes/memory-notes.js.map +1 -0
  136. package/dist/notes/note-gate.d.ts +42 -0
  137. package/dist/notes/note-gate.d.ts.map +1 -0
  138. package/dist/notes/note-gate.js +181 -0
  139. package/dist/notes/note-gate.js.map +1 -0
  140. package/dist/notes/notes.d.ts +29 -77
  141. package/dist/notes/notes.d.ts.map +1 -1
  142. package/dist/notes/notes.js +69 -228
  143. package/dist/notes/notes.js.map +1 -1
  144. package/dist/notes/pr-reviews.d.ts +35 -7
  145. package/dist/notes/pr-reviews.d.ts.map +1 -1
  146. package/dist/notes/pr-reviews.js +156 -46
  147. package/dist/notes/pr-reviews.js.map +1 -1
  148. package/dist/notes/secrets.d.ts +28 -0
  149. package/dist/notes/secrets.d.ts.map +1 -0
  150. package/dist/notes/secrets.js +362 -0
  151. package/dist/notes/secrets.js.map +1 -0
  152. package/dist/notes/session-cost.d.ts +2 -0
  153. package/dist/notes/session-cost.d.ts.map +1 -1
  154. package/dist/notes/session-cost.js +8 -3
  155. package/dist/notes/session-cost.js.map +1 -1
  156. package/dist/notes/targets.d.ts +37 -0
  157. package/dist/notes/targets.d.ts.map +1 -0
  158. package/dist/notes/targets.js +108 -0
  159. package/dist/notes/targets.js.map +1 -0
  160. package/dist/notes/team-check.d.ts +22 -0
  161. package/dist/notes/team-check.d.ts.map +1 -0
  162. package/dist/notes/team-check.js +130 -0
  163. package/dist/notes/team-check.js.map +1 -0
  164. package/dist/notes/trail-home.d.ts +3 -0
  165. package/dist/notes/trail-home.d.ts.map +1 -0
  166. package/dist/notes/trail-home.js +12 -0
  167. package/dist/notes/trail-home.js.map +1 -0
  168. package/dist/search/grep-cli.d.ts +5 -2
  169. package/dist/search/grep-cli.d.ts.map +1 -1
  170. package/dist/search/grep-cli.js +11 -4
  171. package/dist/search/grep-cli.js.map +1 -1
  172. package/dist/search/ignored-code.d.ts +9 -0
  173. package/dist/search/ignored-code.d.ts.map +1 -0
  174. package/dist/search/ignored-code.js +73 -0
  175. package/dist/search/ignored-code.js.map +1 -0
  176. package/dist/skills/answers-prompt.d.ts +13 -0
  177. package/dist/skills/answers-prompt.d.ts.map +1 -0
  178. package/dist/skills/answers-prompt.js +83 -0
  179. package/dist/skills/answers-prompt.js.map +1 -0
  180. package/dist/skills/never-save.d.ts +5 -0
  181. package/dist/skills/never-save.d.ts.map +1 -0
  182. package/dist/skills/never-save.js +158 -0
  183. package/dist/skills/never-save.js.map +1 -0
  184. package/dist/skills/params.d.ts +39 -0
  185. package/dist/skills/params.d.ts.map +1 -0
  186. package/dist/skills/params.js +275 -0
  187. package/dist/skills/params.js.map +1 -0
  188. package/dist/skills/ran-less.d.ts +5 -0
  189. package/dist/skills/ran-less.d.ts.map +1 -0
  190. package/dist/skills/ran-less.js +51 -0
  191. package/dist/skills/ran-less.js.map +1 -0
  192. package/dist/skills/risk-delta.d.ts +32 -0
  193. package/dist/skills/risk-delta.d.ts.map +1 -0
  194. package/dist/skills/risk-delta.js +56 -0
  195. package/dist/skills/risk-delta.js.map +1 -0
  196. package/dist/skills/risk.d.ts +73 -0
  197. package/dist/skills/risk.d.ts.map +1 -0
  198. package/dist/skills/risk.js +396 -0
  199. package/dist/skills/risk.js.map +1 -0
  200. package/dist/skills/types.d.ts +422 -0
  201. package/dist/skills/types.d.ts.map +1 -0
  202. package/dist/skills/types.js +2 -0
  203. package/dist/skills/types.js.map +1 -0
  204. package/dist/telemetry/contract.d.ts.map +1 -1
  205. package/dist/telemetry/contract.js +8 -6
  206. package/dist/telemetry/contract.js.map +1 -1
  207. package/dist/telemetry/notice.d.ts.map +1 -1
  208. package/dist/telemetry/notice.js +3 -1
  209. package/dist/telemetry/notice.js.map +1 -1
  210. package/dist/trace/check-reads.d.ts +36 -0
  211. package/dist/trace/check-reads.d.ts.map +1 -0
  212. package/dist/trace/check-reads.js +57 -0
  213. package/dist/trace/check-reads.js.map +1 -0
  214. package/dist/trace/host.d.ts +40 -0
  215. package/dist/trace/host.d.ts.map +1 -0
  216. package/dist/trace/host.js +84 -0
  217. package/dist/trace/host.js.map +1 -0
  218. package/dist/trace/redact.d.ts +8 -0
  219. package/dist/trace/redact.d.ts.map +1 -0
  220. package/dist/trace/redact.js +63 -0
  221. package/dist/trace/redact.js.map +1 -0
  222. package/dist/trace/seen-cache.d.ts +9 -0
  223. package/dist/trace/seen-cache.d.ts.map +1 -0
  224. package/dist/trace/seen-cache.js +46 -0
  225. package/dist/trace/seen-cache.js.map +1 -0
  226. package/dist/trace/shell-scan.d.ts +52 -0
  227. package/dist/trace/shell-scan.d.ts.map +1 -0
  228. package/dist/trace/shell-scan.js +318 -0
  229. package/dist/trace/shell-scan.js.map +1 -0
  230. package/dist/trace/shell-words.d.ts +91 -0
  231. package/dist/trace/shell-words.d.ts.map +1 -0
  232. package/dist/trace/shell-words.js +558 -0
  233. package/dist/trace/shell-words.js.map +1 -0
  234. package/dist/trace/shell.d.ts +91 -0
  235. package/dist/trace/shell.d.ts.map +1 -0
  236. package/dist/trace/shell.js +435 -0
  237. package/dist/trace/shell.js.map +1 -0
  238. package/dist/trace/state.d.ts +27 -0
  239. package/dist/trace/state.d.ts.map +1 -0
  240. package/dist/trace/state.js +98 -0
  241. package/dist/trace/state.js.map +1 -0
  242. package/dist/trace/tamper-code.d.ts +9 -0
  243. package/dist/trace/tamper-code.d.ts.map +1 -0
  244. package/dist/trace/tamper-code.js +174 -0
  245. package/dist/trace/tamper-code.js.map +1 -0
  246. package/dist/trace/tamper-git.d.ts +12 -0
  247. package/dist/trace/tamper-git.d.ts.map +1 -0
  248. package/dist/trace/tamper-git.js +77 -0
  249. package/dist/trace/tamper-git.js.map +1 -0
  250. package/dist/trace/types.d.ts +477 -0
  251. package/dist/trace/types.d.ts.map +1 -0
  252. package/dist/trace/types.js +12 -0
  253. package/dist/trace/types.js.map +1 -0
  254. package/dist/trace/walls-glob.d.ts +11 -0
  255. package/dist/trace/walls-glob.d.ts.map +1 -0
  256. package/dist/trace/walls-glob.js +264 -0
  257. package/dist/trace/walls-glob.js.map +1 -0
  258. package/dist/trace/walls-quoted.d.ts +25 -0
  259. package/dist/trace/walls-quoted.d.ts.map +1 -0
  260. package/dist/trace/walls-quoted.js +81 -0
  261. package/dist/trace/walls-quoted.js.map +1 -0
  262. package/dist/upkeep.d.ts +1 -1
  263. package/dist/upkeep.d.ts.map +1 -1
  264. package/dist/upkeep.js +4 -1
  265. package/dist/upkeep.js.map +1 -1
  266. package/dist/util/actions-folder.d.ts +2 -0
  267. package/dist/util/actions-folder.d.ts.map +1 -0
  268. package/dist/util/actions-folder.js +9 -0
  269. package/dist/util/actions-folder.js.map +1 -0
  270. package/dist/util/front-matter.d.ts +31 -4
  271. package/dist/util/front-matter.d.ts.map +1 -1
  272. package/dist/util/front-matter.js +95 -3
  273. package/dist/util/front-matter.js.map +1 -1
  274. package/dist/util/private-file.d.ts +14 -0
  275. package/dist/util/private-file.d.ts.map +1 -0
  276. package/dist/util/private-file.js +82 -0
  277. package/dist/util/private-file.js.map +1 -0
  278. package/dist/util/private-fs.d.ts +25 -0
  279. package/dist/util/private-fs.d.ts.map +1 -0
  280. package/dist/util/private-fs.js +253 -0
  281. package/dist/util/private-fs.js.map +1 -0
  282. package/dist/util/state.d.ts.map +1 -1
  283. package/dist/util/state.js +3 -0
  284. package/dist/util/state.js.map +1 -1
  285. package/dist/viewer/app.js +2 -2
  286. package/package.json +5 -5
  287. package/scripts/run-tests.mjs +14 -2
@@ -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,GAAG,MAAM,EAAE,MAAM,CAAC,CAAC,CAAC;AAE1G,4EAA4E;AAC5E,MAAM,MAAM,QAAQ,GAAG,MAAM,GAAG,MAAM,GAAG,UAAU,GAAG,MAAM,CAAC;AAE7D,MAAM,WAAW,OAAO;IACtB,kBAAkB;IAClB,EAAE,EAAE,MAAM,CAAC;IACX,EAAE,EAAE,MAAM,CAAC;IACX,6KAA6K;IAC7K,GAAG,EAAE,MAAM,GAAG,IAAI,CAAC;IACnB,8EAA8E;IAC9E,MAAM,CAAC,EAAE,OAAO,GAAG,SAAS,CAAC;IAC7B,gEAAgE;IAChE,GAAG,EAAE,MAAM,GAAG,IAAI,CAAC;IACnB,4JAA4J;IAC5J,GAAG,EAAE,MAAM,GAAG,IAAI,CAAC;IACnB,qFAAqF;IACrF,EAAE,EAAE,OA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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"}
@@ -0,0 +1,11 @@
1
+ /**
2
+ * A word as zsh would print it in its error: quotes gone, expansions as `.*`, glob characters literal. `glob` says
3
+ * whether the word holds an unquoted glob character (only those make zsh's error). Null for a word too long to read.
4
+ */
5
+ export declare function wordShape(w: string): {
6
+ re: RegExp;
7
+ glob: boolean;
8
+ } | null;
9
+ /** True when a zsh "no matches found" line in `ends` (not quoted) names a word of `command` that makes it a real wall. */
10
+ export declare function globWallTied(ends: string, command: string): boolean;
11
+ //# sourceMappingURL=walls-glob.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"walls-glob.d.ts","sourceRoot":"","sources":["../../src/trace/walls-glob.ts"],"names":[],"mappings":"AAmEA;;;GAGG;AACH,wBAAgB,SAAS,CAAC,CAAC,EAAE,MAAM,GAAG;IAAE,EAAE,EAAE,MAAM,CAAC;IAAC,IAAI,EAAE,OAAO,CAAA;CAAE,GAAG,IAAI,CAmDzE;AAuED,0HAA0H;AAC1H,wBAAgB,YAAY,CAAC,IAAI,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,GAAG,OAAO,CAYnE"}