@nanonets/graft 0.21.0 → 0.22.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 (348) hide show
  1. package/README.md +549 -315
  2. package/dist/app/review-process.d.ts.map +1 -1
  3. package/dist/app/review-process.js +6 -5
  4. package/dist/app/review-process.js.map +1 -1
  5. package/dist/app/sources.js +2 -2
  6. package/dist/app/sources.js.map +1 -1
  7. package/dist/ask/ask.d.ts +12 -6
  8. package/dist/ask/ask.d.ts.map +1 -1
  9. package/dist/ask/ask.js +28 -38
  10. package/dist/ask/ask.js.map +1 -1
  11. package/dist/bin/graft.d.ts +3 -0
  12. package/dist/bin/graft.d.ts.map +1 -0
  13. package/dist/bin/graft.js +8 -0
  14. package/dist/bin/graft.js.map +1 -0
  15. package/dist/bin/trail.d.ts +3 -0
  16. package/dist/bin/trail.d.ts.map +1 -0
  17. package/dist/bin/trail.js +6 -0
  18. package/dist/bin/trail.js.map +1 -0
  19. package/dist/blast/blast-cli.d.ts.map +1 -1
  20. package/dist/blast/blast-cli.js +2 -1
  21. package/dist/blast/blast-cli.js.map +1 -1
  22. package/dist/blast/render.d.ts.map +1 -1
  23. package/dist/blast/render.js +3 -2
  24. package/dist/blast/render.js.map +1 -1
  25. package/dist/brand.d.ts +97 -0
  26. package/dist/brand.d.ts.map +1 -0
  27. package/dist/brand.js +254 -0
  28. package/dist/brand.js.map +1 -0
  29. package/dist/check/local-check.d.ts +104 -0
  30. package/dist/check/local-check.d.ts.map +1 -0
  31. package/dist/check/local-check.js +830 -0
  32. package/dist/check/local-check.js.map +1 -0
  33. package/dist/check/types.d.ts +31 -0
  34. package/dist/check/types.d.ts.map +1 -0
  35. package/dist/check/types.js +2 -0
  36. package/dist/check/types.js.map +1 -0
  37. package/dist/claude/format.d.ts +44 -1
  38. package/dist/claude/format.d.ts.map +1 -1
  39. package/dist/claude/format.js +113 -19
  40. package/dist/claude/format.js.map +1 -1
  41. package/dist/claude/hook-layers.d.ts +8 -0
  42. package/dist/claude/hook-layers.d.ts.map +1 -0
  43. package/dist/claude/hook-layers.js +72 -0
  44. package/dist/claude/hook-layers.js.map +1 -0
  45. package/dist/claude/hooks.d.ts +34 -0
  46. package/dist/claude/hooks.d.ts.map +1 -1
  47. package/dist/claude/hooks.js +220 -12
  48. package/dist/claude/hooks.js.map +1 -1
  49. package/dist/claude/init.d.ts +12 -1
  50. package/dist/claude/init.d.ts.map +1 -1
  51. package/dist/claude/init.js +48 -19
  52. package/dist/claude/init.js.map +1 -1
  53. package/dist/claude/session-metrics.d.ts +1 -1
  54. package/dist/claude/session-metrics.d.ts.map +1 -1
  55. package/dist/claude/session-metrics.js +11 -8
  56. package/dist/claude/session-metrics.js.map +1 -1
  57. package/dist/claude/settings-merge.d.ts +1 -0
  58. package/dist/claude/settings-merge.d.ts.map +1 -1
  59. package/dist/claude/settings-merge.js +21 -18
  60. package/dist/claude/settings-merge.js.map +1 -1
  61. package/dist/claude/shim-template.d.ts +17 -2
  62. package/dist/claude/shim-template.d.ts.map +1 -1
  63. package/dist/claude/shim-template.js +116 -22
  64. package/dist/claude/shim-template.js.map +1 -1
  65. package/dist/claude/skill-template.d.ts +10 -1
  66. package/dist/claude/skill-template.d.ts.map +1 -1
  67. package/dist/claude/skill-template.js +132 -1
  68. package/dist/claude/skill-template.js.map +1 -1
  69. package/dist/claude/state.d.ts +8 -0
  70. package/dist/claude/state.d.ts.map +1 -1
  71. package/dist/claude/state.js.map +1 -1
  72. package/dist/claude/statusline.d.ts.map +1 -1
  73. package/dist/claude/statusline.js +4 -1
  74. package/dist/claude/statusline.js.map +1 -1
  75. package/dist/claude/tally.js +1 -1
  76. package/dist/claude/tally.js.map +1 -1
  77. package/dist/cli-epilogue.d.ts +0 -6
  78. package/dist/cli-epilogue.d.ts.map +1 -1
  79. package/dist/cli-epilogue.js +5 -4
  80. package/dist/cli-epilogue.js.map +1 -1
  81. package/dist/cli-meta.d.ts +8 -0
  82. package/dist/cli-meta.d.ts.map +1 -1
  83. package/dist/cli-meta.js +28 -8
  84. package/dist/cli-meta.js.map +1 -1
  85. package/dist/cli-picker.d.ts.map +1 -1
  86. package/dist/cli-picker.js +11 -7
  87. package/dist/cli-picker.js.map +1 -1
  88. package/dist/cli.d.ts +0 -5
  89. package/dist/cli.d.ts.map +1 -1
  90. package/dist/cli.js +1037 -595
  91. package/dist/cli.js.map +1 -1
  92. package/dist/cloud/diff.d.ts +18 -0
  93. package/dist/cloud/diff.d.ts.map +1 -0
  94. package/dist/cloud/diff.js +58 -0
  95. package/dist/cloud/diff.js.map +1 -0
  96. package/dist/cloud/nudge.d.ts +66 -0
  97. package/dist/cloud/nudge.d.ts.map +1 -0
  98. package/dist/cloud/nudge.js +269 -0
  99. package/dist/cloud/nudge.js.map +1 -0
  100. package/dist/cloud/workspace-sync.d.ts +58 -0
  101. package/dist/cloud/workspace-sync.d.ts.map +1 -0
  102. package/dist/cloud/workspace-sync.js +268 -0
  103. package/dist/cloud/workspace-sync.js.map +1 -0
  104. package/dist/cloud/workspace.d.ts +159 -0
  105. package/dist/cloud/workspace.d.ts.map +1 -0
  106. package/dist/cloud/workspace.js +134 -0
  107. package/dist/cloud/workspace.js.map +1 -0
  108. package/dist/context/check.d.ts +1 -1
  109. package/dist/context/check.d.ts.map +1 -1
  110. package/dist/context/check.js +9 -8
  111. package/dist/context/check.js.map +1 -1
  112. package/dist/context/node-file.js +1 -1
  113. package/dist/context/node-file.js.map +1 -1
  114. package/dist/context/savings.d.ts.map +1 -1
  115. package/dist/context/savings.js +10 -7
  116. package/dist/context/savings.js.map +1 -1
  117. package/dist/engine.d.ts.map +1 -1
  118. package/dist/engine.js +3 -1
  119. package/dist/engine.js.map +1 -1
  120. package/dist/graph/build.d.ts +30 -0
  121. package/dist/graph/build.d.ts.map +1 -1
  122. package/dist/graph/build.js +65 -19
  123. package/dist/graph/build.js.map +1 -1
  124. package/dist/graph/cards.d.ts.map +1 -1
  125. package/dist/graph/cards.js +4 -2
  126. package/dist/graph/cards.js.map +1 -1
  127. package/dist/graph/check.d.ts.map +1 -1
  128. package/dist/graph/check.js +17 -18
  129. package/dist/graph/check.js.map +1 -1
  130. package/dist/graph/container.d.ts.map +1 -1
  131. package/dist/graph/container.js +7 -2
  132. package/dist/graph/container.js.map +1 -1
  133. package/dist/graph/extract-cache.d.ts +4 -0
  134. package/dist/graph/extract-cache.d.ts.map +1 -1
  135. package/dist/graph/extract-cache.js.map +1 -1
  136. package/dist/graph/extract.d.ts +2 -0
  137. package/dist/graph/extract.d.ts.map +1 -1
  138. package/dist/graph/extract.js +5 -32
  139. package/dist/graph/extract.js.map +1 -1
  140. package/dist/graph/generic.d.ts +7 -1
  141. package/dist/graph/generic.d.ts.map +1 -1
  142. package/dist/graph/generic.js +48 -8
  143. package/dist/graph/generic.js.map +1 -1
  144. package/dist/graph/native.d.ts +38 -0
  145. package/dist/graph/native.d.ts.map +1 -0
  146. package/dist/graph/native.js +169 -0
  147. package/dist/graph/native.js.map +1 -0
  148. package/dist/graph/refresh.d.ts.map +1 -1
  149. package/dist/graph/refresh.js +3 -2
  150. package/dist/graph/refresh.js.map +1 -1
  151. package/dist/graph/traverse-cli.d.ts.map +1 -1
  152. package/dist/graph/traverse-cli.js +4 -3
  153. package/dist/graph/traverse-cli.js.map +1 -1
  154. package/dist/graph/workspace-cli.d.ts +2 -0
  155. package/dist/graph/workspace-cli.d.ts.map +1 -1
  156. package/dist/graph/workspace-cli.js +13 -1
  157. package/dist/graph/workspace-cli.js.map +1 -1
  158. package/dist/graph/workspace.d.ts.map +1 -1
  159. package/dist/graph/workspace.js +6 -5
  160. package/dist/graph/workspace.js.map +1 -1
  161. package/dist/hosts/antigravity.d.ts +10 -3
  162. package/dist/hosts/antigravity.d.ts.map +1 -1
  163. package/dist/hosts/antigravity.js +27 -10
  164. package/dist/hosts/antigravity.js.map +1 -1
  165. package/dist/hosts/claude-global.d.ts +27 -4
  166. package/dist/hosts/claude-global.d.ts.map +1 -1
  167. package/dist/hosts/claude-global.js +90 -9
  168. package/dist/hosts/claude-global.js.map +1 -1
  169. package/dist/hosts/codex-hooks.d.ts.map +1 -1
  170. package/dist/hosts/codex-hooks.js +1 -2
  171. package/dist/hosts/codex-hooks.js.map +1 -1
  172. package/dist/hosts/config-write.d.ts.map +1 -1
  173. package/dist/hosts/config-write.js +2 -1
  174. package/dist/hosts/config-write.js.map +1 -1
  175. package/dist/hosts/cursor-hooks.d.ts +5 -2
  176. package/dist/hosts/cursor-hooks.d.ts.map +1 -1
  177. package/dist/hosts/cursor-hooks.js +14 -9
  178. package/dist/hosts/cursor-hooks.js.map +1 -1
  179. package/dist/hosts/init.d.ts +3 -0
  180. package/dist/hosts/init.d.ts.map +1 -1
  181. package/dist/hosts/init.js +32 -10
  182. package/dist/hosts/init.js.map +1 -1
  183. package/dist/hosts/instructions.d.ts +9 -4
  184. package/dist/hosts/instructions.d.ts.map +1 -1
  185. package/dist/hosts/instructions.js +19 -16
  186. package/dist/hosts/instructions.js.map +1 -1
  187. package/dist/hosts/mcp-config.d.ts +19 -4
  188. package/dist/hosts/mcp-config.d.ts.map +1 -1
  189. package/dist/hosts/mcp-config.js +81 -30
  190. package/dist/hosts/mcp-config.js.map +1 -1
  191. package/dist/hosts/plan.d.ts.map +1 -1
  192. package/dist/hosts/plan.js +11 -9
  193. package/dist/hosts/plan.js.map +1 -1
  194. package/dist/hosts/registry.d.ts +25 -2
  195. package/dist/hosts/registry.d.ts.map +1 -1
  196. package/dist/hosts/registry.js +53 -0
  197. package/dist/hosts/registry.js.map +1 -1
  198. package/dist/hosts/retract.d.ts.map +1 -1
  199. package/dist/hosts/retract.js +73 -33
  200. package/dist/hosts/retract.js.map +1 -1
  201. package/dist/hosts/sections.d.ts +17 -1
  202. package/dist/hosts/sections.d.ts.map +1 -1
  203. package/dist/hosts/sections.js +52 -2
  204. package/dist/hosts/sections.js.map +1 -1
  205. package/dist/mcp/instructions.d.ts +1 -25
  206. package/dist/mcp/instructions.d.ts.map +1 -1
  207. package/dist/mcp/instructions.js +6 -4
  208. package/dist/mcp/instructions.js.map +1 -1
  209. package/dist/mcp/server.d.ts.map +1 -1
  210. package/dist/mcp/server.js +7 -3
  211. package/dist/mcp/server.js.map +1 -1
  212. package/dist/mcp/tool-names.d.ts +10 -3
  213. package/dist/mcp/tool-names.d.ts.map +1 -1
  214. package/dist/mcp/tool-names.js +13 -5
  215. package/dist/mcp/tool-names.js.map +1 -1
  216. package/dist/mcp/tools.d.ts.map +1 -1
  217. package/dist/mcp/tools.js +6 -5
  218. package/dist/mcp/tools.js.map +1 -1
  219. package/dist/notes/ask-notes.d.ts +8 -0
  220. package/dist/notes/ask-notes.d.ts.map +1 -0
  221. package/dist/notes/ask-notes.js +18 -0
  222. package/dist/notes/ask-notes.js.map +1 -0
  223. package/dist/notes/branches.d.ts +85 -0
  224. package/dist/notes/branches.d.ts.map +1 -0
  225. package/dist/notes/branches.js +238 -0
  226. package/dist/notes/branches.js.map +1 -0
  227. package/dist/notes/cold-start.d.ts +127 -0
  228. package/dist/notes/cold-start.d.ts.map +1 -0
  229. package/dist/notes/cold-start.js +476 -0
  230. package/dist/notes/cold-start.js.map +1 -0
  231. package/dist/notes/git-facts.d.ts +17 -0
  232. package/dist/notes/git-facts.d.ts.map +1 -0
  233. package/dist/notes/git-facts.js +117 -0
  234. package/dist/notes/git-facts.js.map +1 -0
  235. package/dist/notes/home.d.ts +87 -0
  236. package/dist/notes/home.d.ts.map +1 -0
  237. package/dist/notes/home.js +423 -0
  238. package/dist/notes/home.js.map +1 -0
  239. package/dist/notes/notes.d.ts +178 -0
  240. package/dist/notes/notes.d.ts.map +1 -0
  241. package/dist/notes/notes.js +498 -0
  242. package/dist/notes/notes.js.map +1 -0
  243. package/dist/notes/repo-trail.d.ts +16 -0
  244. package/dist/notes/repo-trail.d.ts.map +1 -0
  245. package/dist/notes/repo-trail.js +74 -0
  246. package/dist/notes/repo-trail.js.map +1 -0
  247. package/dist/notes/session-cost.d.ts +21 -0
  248. package/dist/notes/session-cost.d.ts.map +1 -0
  249. package/dist/notes/session-cost.js +162 -0
  250. package/dist/notes/session-cost.js.map +1 -0
  251. package/dist/search/grep-cli.d.ts.map +1 -1
  252. package/dist/search/grep-cli.js +4 -3
  253. package/dist/search/grep-cli.js.map +1 -1
  254. package/dist/skills/skills.d.ts +118 -0
  255. package/dist/skills/skills.d.ts.map +1 -0
  256. package/dist/skills/skills.js +370 -0
  257. package/dist/skills/skills.js.map +1 -0
  258. package/dist/telemetry/contract.d.ts +2 -14
  259. package/dist/telemetry/contract.d.ts.map +1 -1
  260. package/dist/telemetry/contract.js +39 -24
  261. package/dist/telemetry/contract.js.map +1 -1
  262. package/dist/telemetry/gate.d.ts.map +1 -1
  263. package/dist/telemetry/gate.js +2 -1
  264. package/dist/telemetry/gate.js.map +1 -1
  265. package/dist/telemetry/notice.d.ts +1 -1
  266. package/dist/telemetry/notice.d.ts.map +1 -1
  267. package/dist/telemetry/notice.js +6 -5
  268. package/dist/telemetry/notice.js.map +1 -1
  269. package/dist/telemetry/track.d.ts.map +1 -1
  270. package/dist/telemetry/track.js +5 -0
  271. package/dist/telemetry/track.js.map +1 -1
  272. package/dist/upkeep-run.d.ts +7 -0
  273. package/dist/upkeep-run.d.ts.map +1 -1
  274. package/dist/upkeep-run.js +52 -12
  275. package/dist/upkeep-run.js.map +1 -1
  276. package/dist/upkeep.d.ts +9 -19
  277. package/dist/upkeep.d.ts.map +1 -1
  278. package/dist/upkeep.js +38 -59
  279. package/dist/upkeep.js.map +1 -1
  280. package/dist/util/browser.d.ts +3 -0
  281. package/dist/util/browser.d.ts.map +1 -0
  282. package/dist/util/browser.js +14 -0
  283. package/dist/util/browser.js.map +1 -0
  284. package/dist/util/front-matter.d.ts +19 -0
  285. package/dist/util/front-matter.d.ts.map +1 -0
  286. package/dist/util/front-matter.js +21 -0
  287. package/dist/util/front-matter.js.map +1 -0
  288. package/dist/util/state.d.ts +1 -18
  289. package/dist/util/state.d.ts.map +1 -1
  290. package/dist/util/state.js +4 -2
  291. package/dist/util/state.js.map +1 -1
  292. package/dist/viz/assemble.js +1 -1
  293. package/dist/viz/assemble.js.map +1 -1
  294. package/dist/viz/serve.d.ts.map +1 -1
  295. package/dist/viz/serve.js +4 -3
  296. package/dist/viz/serve.js.map +1 -1
  297. package/package.json +7 -7
  298. package/scripts/pack-trail.mjs +53 -0
  299. package/scripts/postinstall.mjs +17 -2
  300. package/scripts/run-tests.mjs +4 -1
  301. package/dist/brain/attach.d.ts +0 -44
  302. package/dist/brain/attach.d.ts.map +0 -1
  303. package/dist/brain/attach.js +0 -63
  304. package/dist/brain/attach.js.map +0 -1
  305. package/dist/brain/claude-md.d.ts +0 -61
  306. package/dist/brain/claude-md.d.ts.map +0 -1
  307. package/dist/brain/claude-md.js +0 -171
  308. package/dist/brain/claude-md.js.map +0 -1
  309. package/dist/brain/connect.d.ts +0 -59
  310. package/dist/brain/connect.d.ts.map +0 -1
  311. package/dist/brain/connect.js +0 -80
  312. package/dist/brain/connect.js.map +0 -1
  313. package/dist/brain/context-files.d.ts +0 -79
  314. package/dist/brain/context-files.d.ts.map +0 -1
  315. package/dist/brain/context-files.js +0 -245
  316. package/dist/brain/context-files.js.map +0 -1
  317. package/dist/brain/link.d.ts +0 -106
  318. package/dist/brain/link.d.ts.map +0 -1
  319. package/dist/brain/link.js +0 -167
  320. package/dist/brain/link.js.map +0 -1
  321. package/dist/brain/pull.d.ts +0 -17
  322. package/dist/brain/pull.d.ts.map +0 -1
  323. package/dist/brain/pull.js +0 -172
  324. package/dist/brain/pull.js.map +0 -1
  325. package/dist/brain/push.d.ts +0 -155
  326. package/dist/brain/push.d.ts.map +0 -1
  327. package/dist/brain/push.js +0 -304
  328. package/dist/brain/push.js.map +0 -1
  329. package/dist/brain/signup.d.ts +0 -117
  330. package/dist/brain/signup.d.ts.map +0 -1
  331. package/dist/brain/signup.js +0 -276
  332. package/dist/brain/signup.js.map +0 -1
  333. package/dist/brain/upload.d.ts +0 -61
  334. package/dist/brain/upload.d.ts.map +0 -1
  335. package/dist/brain/upload.js +0 -210
  336. package/dist/brain/upload.js.map +0 -1
  337. package/dist/brain/watch.d.ts +0 -209
  338. package/dist/brain/watch.d.ts.map +0 -1
  339. package/dist/brain/watch.js +0 -396
  340. package/dist/brain/watch.js.map +0 -1
  341. package/dist/brain/wire.d.ts +0 -38
  342. package/dist/brain/wire.d.ts.map +0 -1
  343. package/dist/brain/wire.js +0 -133
  344. package/dist/brain/wire.js.map +0 -1
  345. package/dist/legacy-args.d.ts +0 -12
  346. package/dist/legacy-args.d.ts.map +0 -1
  347. package/dist/legacy-args.js +0 -31
  348. package/dist/legacy-args.js.map +0 -1
@@ -0,0 +1,87 @@
1
+ /** `~/.trail`, or `$TRAIL_HOME`. */
2
+ export declare function trailHome(env?: NodeJS.ProcessEnv, home?: string): string;
3
+ /** A path as people read it: `~/.trail/…` under the home folder, absolute otherwise. */
4
+ export declare function shownPath(p: string): string;
5
+ /** The nearest folder at or above `start` holding a `.git` (folder or file), or null outside git. */
6
+ export declare function checkoutRoot(start: string): string | null;
7
+ /** origin's url from a git config file's text, else the first remote's, else null. */
8
+ export declare function remoteUrl(config: string): string | null;
9
+ /**
10
+ * `git@github.com:NanoNets/Graft.git`, `https://user:tok@github.com/NanoNets/Graft`
11
+ * and `ssh://git@github.com:22/NanoNets/Graft.git` all → `github.com/nanonets/graft`.
12
+ * Null for a remote that is a path on this machine: those are keyed by path.
13
+ */
14
+ export declare function keyFromRemote(url: string): string | null;
15
+ export interface RepoPlace {
16
+ /** The top of the checkout the folder is in (a worktree's own top), or the folder itself outside git. */
17
+ checkout: string;
18
+ /** Inside a git checkout. */
19
+ git: boolean;
20
+ /** `github.com/nanonets/assign`, or `local/…`. */
21
+ key: string;
22
+ /** `<trail home>/repos/<key>`: where this repo's notes and takeaways are. */
23
+ dir: string;
24
+ }
25
+ /** Where the notes for the folder `start` live. Reads only; spawns nothing. */
26
+ export declare function repoPlace(start: string, env?: NodeJS.ProcessEnv): RepoPlace;
27
+ /**
28
+ * Where the notes for `start` are, following a repo whose key changed since
29
+ * they were written. For reads that can afford one git call (`ask`, not the
30
+ * statusline); a machine with no notes anywhere never spawns it.
31
+ */
32
+ export declare function findRepoPlace(start: string, env?: NodeJS.ProcessEnv): RepoPlace;
33
+ export declare const HOME_README = "# ~/.trail\n\nWhat Trail keeps on this machine. Learnings about the code are in each\nrepo's own .trail/learnings/, committed with the code; this folder holds\nthe rest, and none of it leaves this machine unless you share it.\n\n- repos/<repo>/notes/ personal learnings: about your setup or habits,\n not the code\n- repos/<repo>/skills/ corrections you taught your agent, per skill\n- repos/known.json the repos Trail has run in, which is the list a\n workspace's repo picker shows\n- cloud.json your Trail workspace, once you've connected one\n\n<repo> is the repo's remote (github.com/owner/name), so every clone and\nworktree of one repo shares its notes. Repos without a remote are under\nlocal/, by path.\n";
34
+ /**
35
+ * Make the folder for `start`'s repo, and return where it is. A repo seen for
36
+ * the first time under this key, whose first commit already has a folder (a
37
+ * renamed remote, a remote added later), is pointed at that folder.
38
+ */
39
+ export declare function ensureRepoHome(start: string, env?: NodeJS.ProcessEnv): {
40
+ place: RepoPlace;
41
+ created: boolean;
42
+ };
43
+ /**
44
+ * This machine's uploader id: random, made once, kept in `~/.trail/id`. Trail
45
+ * keys each person's uploaded notes by it, so one person's upload replaces
46
+ * their own notes and never a teammate's. It names no one.
47
+ */
48
+ export declare function uploaderId(env?: NodeJS.ProcessEnv): string;
49
+ /** The git checkouts directly inside a folder that isn't one: a workspace's repos. */
50
+ export declare function childCheckouts(dir: string): string[];
51
+ /**
52
+ * Every place whose notes bear on the folder `dir`: its repo's, or, for a
53
+ * folder outside git, its own and each child repo's. One per key, so two
54
+ * worktrees of one repo side by side don't list its notes twice.
55
+ */
56
+ export declare function notePlaces(dir: string, env?: NodeJS.ProcessEnv): RepoPlace[];
57
+ /** This repo keeps learnings: it has a committed `.trail/`, or `trail init` or a first learning made its folder in ~/.trail. */
58
+ export declare function keepsNotes(dir: string, env?: NodeJS.ProcessEnv): boolean;
59
+ /**
60
+ * How many learnings bear on `dir`, counted without reading them: the repo's
61
+ * `.trail/learnings/`, this machine's own, and the ones on teammates' pushed
62
+ * branches, one per file name. Spawns nothing: the statusline calls it.
63
+ */
64
+ export declare function noteCount(dir: string, env?: NodeJS.ProcessEnv): number;
65
+ export interface KnownRepo {
66
+ /** `github.com/hashicorp/go-retryablehttp`: the key notes are kept under. */
67
+ key: string;
68
+ /** `hashicorp/go-retryablehttp`: how people name it. */
69
+ name: string;
70
+ /** The checkout it was last seen in, on this machine. */
71
+ path: string;
72
+ /** When, epoch ms. */
73
+ seenAt: number;
74
+ }
75
+ /** `github.com/hashicorp/go-retryablehttp` → `hashicorp/go-retryablehttp`; a local key → its folder's name. */
76
+ export declare function repoName(key: string, checkout?: string): string;
77
+ /**
78
+ * Every repo Trail has run in on this machine, most recent first. This is the
79
+ * list a workspace's repo picker shows: Trail never searches the disk for repos.
80
+ */
81
+ export declare function knownRepos(env?: NodeJS.ProcessEnv): KnownRepo[];
82
+ /**
83
+ * Note that Trail ran in the repo at `dir`. Cheap enough for every command:
84
+ * it writes only for a repo that's new, moved, or not seen for a day.
85
+ */
86
+ export declare function rememberRepo(dir: string, env?: NodeJS.ProcessEnv, now?: number): void;
87
+ //# sourceMappingURL=home.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"home.d.ts","sourceRoot":"","sources":["../../src/notes/home.ts"],"names":[],"mappings":"AAwCA,oCAAoC;AACpC,wBAAgB,SAAS,CAAC,GAAG,GAAE,MAAM,CAAC,UAAwB,EAAE,IAAI,GAAE,MAAkB,GAAG,MAAM,CAEhG;AAED,wFAAwF;AACxF,wBAAgB,SAAS,CAAC,CAAC,EAAE,MAAM,GAAG,MAAM,CAK3C;AAMD,qGAAqG;AACrG,wBAAgB,YAAY,CAAC,KAAK,EAAE,MAAM,GAAG,MAAM,GAAG,IAAI,CAQzD;AA8CD,sFAAsF;AACtF,wBAAgB,SAAS,CAAC,MAAM,EAAE,MAAM,GAAG,MAAM,G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AM,EAAE,GAAG,GAAE,MAAM,CAAC,UAAwB,GAAG,MAAM,CAYnF;AAMD,MAAM,WAAW,SAAS;IACxB,6EAA6E;IAC7E,GAAG,EAAE,MAAM,CAAC;IACZ,wDAAwD;IACxD,IAAI,EAAE,MAAM,CAAC;IACb,yDAAyD;IACzD,IAAI,EAAE,MAAM,CAAC;IACb,sBAAsB;IACtB,MAAM,EAAE,MAAM,CAAC;CAChB;AAMD,+GAA+G;AAC/G,wBAAgB,QAAQ,CAAC,GAAG,EAAE,MAAM,EAAE,QAAQ,CAAC,EAAE,MAAM,GAAG,MAAM,CAI/D;AAED;;;GAGG;AACH,wBAAgB,UAAU,CAAC,GAAG,GAAE,MAAM,CAAC,UAAwB,GAAG,SAAS,EAAE,CAK5E;AAKD;;;GAGG;AACH,wBAAgB,YAAY,CAAC,GAAG,EAAE,MAAM,EAAE,GAAG,GAAE,MAAM,CAAC,UAAwB,EAAE,GAAG,SAAa,GAAG,IAAI,CAatG"}
@@ -0,0 +1,423 @@
1
+ /**
2
+ * Where a repo's personal learnings and takeaways live: on this machine, under
3
+ * `~/.trail/repos/<key>/`. (Learnings about the code itself go in the repo's
4
+ * committed `.trail/`, see repo-trail.ts.) Nothing here shows up in
5
+ * `git status` or in anyone's pull request, and nothing leaves the machine
6
+ * unless its owner shares it.
7
+ *
8
+ * The key names the repo, not the folder it happens to be checked out in, so
9
+ * every checkout of one repo reads and writes the same notes:
10
+ *
11
+ * - a linked worktree reads its main checkout's git config, so it gets the
12
+ * same key;
13
+ * - a checkout with a remote is keyed by it (`github.com/nanonets/assign`),
14
+ * so a second clone somewhere else finds the same notes;
15
+ * - a submodule, or any repo nested in another, is its own repo with its own
16
+ * key: the walk up stops at the nearest `.git`;
17
+ * - a subfolder of a monorepo is part of its repo;
18
+ * - a repo with no remote, and a folder outside git, are keyed by path.
19
+ *
20
+ * A folder outside git that holds repos (a workspace) has its own key for
21
+ * notes written there, and reads its child repos' notes too.
22
+ *
23
+ * A key can change under a repo: a remote renamed, or added for the first
24
+ * time. The first write under a new key looks for a folder already holding
25
+ * notes for a repo with the same first commit, and points the new key at it
26
+ * in `repos/index.json`, so the notes carry over instead of starting empty.
27
+ *
28
+ * Finding the key spawns no git, because hooks and the statusline call it on
29
+ * every turn: it reads `.git` and the repo's config file directly. Only that
30
+ * first write runs git, once, for the first commit.
31
+ */
32
+ import { execFileSync } from "node:child_process";
33
+ import { randomUUID } from "node:crypto";
34
+ import { existsSync, mkdirSync, readdirSync, readFileSync, statSync, writeFileSync } from "node:fs";
35
+ import { homedir } from "node:os";
36
+ import { basename, dirname, isAbsolute, join, relative, resolve, sep } from "node:path";
37
+ import { readJson, writeJsonAtomic } from "../util/state.js";
38
+ import { readBranchCache } from "./branches.js";
39
+ import { hasRepoTrail, learningFiles } from "./repo-trail.js";
40
+ /** `~/.trail`, or `$TRAIL_HOME`. */
41
+ export function trailHome(env = process.env, home = homedir()) {
42
+ return env.TRAIL_HOME ? resolve(env.TRAIL_HOME) : join(home, ".trail");
43
+ }
44
+ /** A path as people read it: `~/.trail/…` under the home folder, absolute otherwise. */
45
+ export function shownPath(p) {
46
+ if (!isAbsolute(p))
47
+ return p;
48
+ const home = homedir();
49
+ const rel = relative(home, p);
50
+ return rel && !rel.startsWith("..") && !isAbsolute(rel) ? `~/${rel.split(sep).join("/")}` : p.split(sep).join("/");
51
+ }
52
+ /* -------------------------------------------------------------------------- */
53
+ /* reading git without git */
54
+ /* -------------------------------------------------------------------------- */
55
+ /** The nearest folder at or above `start` holding a `.git` (folder or file), or null outside git. */
56
+ export function checkoutRoot(start) {
57
+ let dir = resolve(start);
58
+ for (;;) {
59
+ if (existsSync(join(dir, ".git")))
60
+ return dir;
61
+ const up = dirname(dir);
62
+ if (up === dir)
63
+ return null;
64
+ dir = up;
65
+ }
66
+ }
67
+ const GITDIR_KEY = "gitdir:";
68
+ /**
69
+ * A checkout's git dirs, from its `.git`. A folder: a main checkout. A file
70
+ * pointing at `<main>/.git/worktrees/<name>`: a linked worktree, whose
71
+ * `commondir` leads back to the main `.git`. A file pointing anywhere else
72
+ * (`<super>/.git/modules/<name>`): a submodule, which is a repo of its own.
73
+ */
74
+ function gitDirs(checkout) {
75
+ const dot = join(checkout, ".git");
76
+ try {
77
+ if (statSync(dot).isDirectory())
78
+ return { gitDir: dot, commonDir: dot };
79
+ // split/startsWith, not a regex: see mainWorktreeRoot in graph/seed.ts.
80
+ const line = readFileSync(dot, "utf8").split("\n").find((l) => l.startsWith(GITDIR_KEY));
81
+ const target = line?.slice(GITDIR_KEY.length).trim();
82
+ if (!target)
83
+ return null;
84
+ const gitDir = isAbsolute(target) ? target : resolve(checkout, target);
85
+ let commonDir = gitDir;
86
+ try {
87
+ const rel = readFileSync(join(gitDir, "commondir"), "utf8").trim();
88
+ if (rel)
89
+ commonDir = isAbsolute(rel) ? rel : resolve(gitDir, rel);
90
+ }
91
+ catch {
92
+ /* no commondir: a submodule, its own git dir */
93
+ }
94
+ return { gitDir, commonDir };
95
+ }
96
+ catch {
97
+ return null;
98
+ }
99
+ }
100
+ /** The main checkout behind a linked worktree; the checkout itself otherwise. */
101
+ function mainCheckout(checkout, dirs) {
102
+ if (!dirs || dirs.gitDir === dirs.commonDir)
103
+ return checkout;
104
+ if (basename(dirname(dirs.gitDir)) !== "worktrees" || basename(dirs.commonDir) !== ".git")
105
+ return checkout;
106
+ return dirname(dirs.commonDir);
107
+ }
108
+ /** origin's url from a git config file's text, else the first remote's, else null. */
109
+ export function remoteUrl(config) {
110
+ let section = "";
111
+ let first = null;
112
+ for (const raw of config.split("\n")) {
113
+ const line = raw.trim();
114
+ if (line.startsWith("[")) {
115
+ section = line;
116
+ continue;
117
+ }
118
+ if (!section.startsWith('[remote "'))
119
+ continue;
120
+ const eq = line.indexOf("=");
121
+ if (eq === -1 || line.slice(0, eq).trim().toLowerCase() !== "url")
122
+ continue;
123
+ const url = line.slice(eq + 1).trim();
124
+ if (!url)
125
+ continue;
126
+ if (section === '[remote "origin"]')
127
+ return url;
128
+ first ??= url;
129
+ }
130
+ return first;
131
+ }
132
+ /** One path segment of a key: lowercase, safe as a folder name, never `.` or `..`. */
133
+ function segment(s) {
134
+ const out = s.toLowerCase().replace(/[^a-z0-9._-]+/g, "-").replace(/^-+|-+$/g, "");
135
+ return /^\.+$/.test(out) ? "" : out;
136
+ }
137
+ /**
138
+ * `git@github.com:NanoNets/Graft.git`, `https://user:tok@github.com/NanoNets/Graft`
139
+ * and `ssh://git@github.com:22/NanoNets/Graft.git` all → `github.com/nanonets/graft`.
140
+ * Null for a remote that is a path on this machine: those are keyed by path.
141
+ */
142
+ export function keyFromRemote(url) {
143
+ const s = url.trim();
144
+ let host;
145
+ let path;
146
+ const scheme = s.indexOf("://");
147
+ if (scheme !== -1) {
148
+ if (s.slice(0, scheme).toLowerCase() === "file")
149
+ return null;
150
+ const rest = s.slice(scheme + 3);
151
+ const slash = rest.indexOf("/");
152
+ if (slash === -1)
153
+ return null;
154
+ host = rest.slice(0, slash);
155
+ path = rest.slice(slash + 1);
156
+ }
157
+ else {
158
+ const colon = s.indexOf(":");
159
+ // No colon, or a Windows drive letter: a local path.
160
+ if (colon <= 1 || s.slice(0, colon).includes("/"))
161
+ return null;
162
+ host = s.slice(0, colon);
163
+ path = s.slice(colon + 1);
164
+ }
165
+ host = segment(host.slice(host.lastIndexOf("@") + 1).replace(/:\d*$/, ""));
166
+ const parts = path
167
+ .replace(/\.git\/?$/i, "")
168
+ .split("/")
169
+ .map(segment)
170
+ .filter(Boolean);
171
+ if (!host || parts.length === 0)
172
+ return null;
173
+ return [host, ...parts].join("/");
174
+ }
175
+ /** `local/Users-priya-src-extract`: the key for a repo with no remote, or a folder outside git. */
176
+ function pathKey(dir) {
177
+ return `local/${segment(resolve(dir)) || "root"}`;
178
+ }
179
+ function indexPath(home) {
180
+ return join(home, "repos", "index.json");
181
+ }
182
+ function readIndex(home) {
183
+ const raw = readJson(indexPath(home));
184
+ return { aliases: raw?.aliases ?? {}, roots: raw?.roots ?? {} };
185
+ }
186
+ function keyDir(home, key) {
187
+ return join(home, "repos", ...key.split("/"));
188
+ }
189
+ /** Where the notes for the folder `start` live. Reads only; spawns nothing. */
190
+ export function repoPlace(start, env = process.env) {
191
+ const home = trailHome(env);
192
+ const top = checkoutRoot(start);
193
+ const dirs = top ? gitDirs(top) : null;
194
+ let url = null;
195
+ if (dirs) {
196
+ try {
197
+ url = remoteUrl(readFileSync(join(dirs.commonDir, "config"), "utf8"));
198
+ }
199
+ catch {
200
+ /* no config: keyed by path */
201
+ }
202
+ }
203
+ const checkout = top ?? resolve(start);
204
+ const fresh = (url && keyFromRemote(url)) || pathKey(top ? mainCheckout(top, dirs) : checkout);
205
+ const key = existsSync(keyDir(home, fresh)) ? fresh : (readIndex(home).aliases[fresh] ?? fresh);
206
+ return { checkout, git: top !== null, key, dir: keyDir(home, key) };
207
+ }
208
+ /** A repo's first commits (more than one after merging unrelated histories), sorted; [] without git or commits. */
209
+ function rootCommits(checkout) {
210
+ try {
211
+ const out = execFileSync("git", ["rev-list", "--max-parents=0", "HEAD"], {
212
+ cwd: checkout,
213
+ encoding: "utf8",
214
+ stdio: ["ignore", "pipe", "ignore"],
215
+ timeout: 5000,
216
+ });
217
+ return out.split("\n").map((l) => l.trim()).filter(Boolean).sort();
218
+ }
219
+ catch {
220
+ return [];
221
+ }
222
+ }
223
+ /**
224
+ * When `place`'s key has no folder yet but a repo with the same first commit
225
+ * does (its remote was renamed, or added after its first notes), point the
226
+ * key at that folder and return the place there. Runs git once, and only on a
227
+ * machine that already keeps notes for some repo; otherwise `place` as it was.
228
+ */
229
+ function followMovedRepo(home, place, index, roots) {
230
+ if (existsSync(place.dir))
231
+ return place;
232
+ const known = roots.map((r) => index.roots[r]).find((k) => !!k && k !== place.key && existsSync(keyDir(home, k)));
233
+ if (!known)
234
+ return place;
235
+ index.aliases[place.key] = known;
236
+ return { ...place, key: known, dir: keyDir(home, known) };
237
+ }
238
+ /**
239
+ * Where the notes for `start` are, following a repo whose key changed since
240
+ * they were written. For reads that can afford one git call (`ask`, not the
241
+ * statusline); a machine with no notes anywhere never spawns it.
242
+ */
243
+ export function findRepoPlace(start, env = process.env) {
244
+ const place = repoPlace(start, env);
245
+ if (existsSync(place.dir) || !place.git)
246
+ return place;
247
+ const home = trailHome(env);
248
+ const index = readIndex(home);
249
+ if (Object.keys(index.roots).length === 0)
250
+ return place;
251
+ const moved = followMovedRepo(home, place, index, rootCommits(place.checkout));
252
+ if (moved !== place)
253
+ writeJsonAtomic(indexPath(home), index);
254
+ return moved;
255
+ }
256
+ export const HOME_README = `# ~/.trail
257
+
258
+ What Trail keeps on this machine. Learnings about the code are in each
259
+ repo's own .trail/learnings/, committed with the code; this folder holds
260
+ the rest, and none of it leaves this machine unless you share it.
261
+
262
+ - repos/<repo>/notes/ personal learnings: about your setup or habits,
263
+ not the code
264
+ - repos/<repo>/skills/ corrections you taught your agent, per skill
265
+ - repos/known.json the repos Trail has run in, which is the list a
266
+ workspace's repo picker shows
267
+ - cloud.json your Trail workspace, once you've connected one
268
+
269
+ <repo> is the repo's remote (github.com/owner/name), so every clone and
270
+ worktree of one repo shares its notes. Repos without a remote are under
271
+ local/, by path.
272
+ `;
273
+ /**
274
+ * Make the folder for `start`'s repo, and return where it is. A repo seen for
275
+ * the first time under this key, whose first commit already has a folder (a
276
+ * renamed remote, a remote added later), is pointed at that folder.
277
+ */
278
+ export function ensureRepoHome(start, env = process.env) {
279
+ const home = trailHome(env);
280
+ const index = readIndex(home);
281
+ const before = JSON.stringify(index);
282
+ const fresh = repoPlace(start, env);
283
+ const roots = fresh.git ? rootCommits(fresh.checkout) : [];
284
+ const place = followMovedRepo(home, fresh, index, roots);
285
+ for (const r of roots)
286
+ index.roots[r] ??= place.key;
287
+ const created = !existsSync(place.dir);
288
+ mkdirSync(join(place.dir, "notes"), { recursive: true });
289
+ const readme = join(home, "README.md");
290
+ if (!existsSync(readme))
291
+ writeFileSync(readme, HOME_README);
292
+ if (JSON.stringify(index) !== before)
293
+ writeJsonAtomic(indexPath(home), index);
294
+ rememberRepo(start, env);
295
+ return { place, created };
296
+ }
297
+ /**
298
+ * This machine's uploader id: random, made once, kept in `~/.trail/id`. Trail
299
+ * keys each person's uploaded notes by it, so one person's upload replaces
300
+ * their own notes and never a teammate's. It names no one.
301
+ */
302
+ export function uploaderId(env = process.env) {
303
+ const file = join(trailHome(env), "id");
304
+ try {
305
+ const id = readFileSync(file, "utf8").trim();
306
+ if (id)
307
+ return id;
308
+ }
309
+ catch {
310
+ /* first time */
311
+ }
312
+ const id = randomUUID();
313
+ mkdirSync(trailHome(env), { recursive: true });
314
+ writeFileSync(file, `${id}\n`);
315
+ return id;
316
+ }
317
+ /* -------------------------------------------------------------------------- */
318
+ /* a folder, and the repos under it */
319
+ /* -------------------------------------------------------------------------- */
320
+ /** Most repos a workspace folder reads notes from. */
321
+ const MAX_CHILDREN = 64;
322
+ /** The git checkouts directly inside a folder that isn't one: a workspace's repos. */
323
+ export function childCheckouts(dir) {
324
+ let names;
325
+ try {
326
+ names = readdirSync(dir, { withFileTypes: true })
327
+ .filter((e) => e.isDirectory() && !e.name.startsWith("."))
328
+ .map((e) => e.name)
329
+ .sort();
330
+ }
331
+ catch {
332
+ return [];
333
+ }
334
+ return names
335
+ .map((n) => join(dir, n))
336
+ .filter((d) => existsSync(join(d, ".git")))
337
+ .slice(0, MAX_CHILDREN);
338
+ }
339
+ /**
340
+ * Every place whose notes bear on the folder `dir`: its repo's, or, for a
341
+ * folder outside git, its own and each child repo's. One per key, so two
342
+ * worktrees of one repo side by side don't list its notes twice.
343
+ */
344
+ export function notePlaces(dir, env = process.env) {
345
+ const here = repoPlace(dir, env);
346
+ const places = [here, ...(here.git ? [] : childCheckouts(here.checkout).map((c) => repoPlace(c, env)))];
347
+ const seen = new Set();
348
+ return places.filter((p) => !seen.has(p.key) && seen.add(p.key));
349
+ }
350
+ /** This repo keeps learnings: it has a committed `.trail/`, or `trail init` or a first learning made its folder in ~/.trail. */
351
+ export function keepsNotes(dir, env = process.env) {
352
+ return notePlaces(dir, env).some((p) => existsSync(p.dir) || (p.git && hasRepoTrail(p.checkout)));
353
+ }
354
+ /**
355
+ * How many learnings bear on `dir`, counted without reading them: the repo's
356
+ * `.trail/learnings/`, this machine's own, and the ones on teammates' pushed
357
+ * branches, one per file name. Spawns nothing: the statusline calls it.
358
+ */
359
+ export function noteCount(dir, env = process.env) {
360
+ const names = new Set();
361
+ for (const p of notePlaces(dir, env)) {
362
+ if (p.git)
363
+ for (const f of learningFiles(p.checkout))
364
+ names.add(f);
365
+ try {
366
+ for (const f of readdirSync(join(p.dir, "notes")))
367
+ if (f.endsWith(".md"))
368
+ names.add(f);
369
+ }
370
+ catch {
371
+ /* none */
372
+ }
373
+ if (p.git)
374
+ for (const b of readBranchCache(p.checkout)?.branches ?? [])
375
+ for (const l of b.learnings)
376
+ names.add(l.name);
377
+ }
378
+ return names.size;
379
+ }
380
+ function knownPath(home) {
381
+ return join(home, "repos", "known.json");
382
+ }
383
+ /** `github.com/hashicorp/go-retryablehttp` → `hashicorp/go-retryablehttp`; a local key → its folder's name. */
384
+ export function repoName(key, checkout) {
385
+ if (key.startsWith("local/"))
386
+ return basename(checkout ?? key);
387
+ const parts = key.split("/");
388
+ return parts.length > 2 ? parts.slice(1).join("/") : key;
389
+ }
390
+ /**
391
+ * Every repo Trail has run in on this machine, most recent first. This is the
392
+ * list a workspace's repo picker shows: Trail never searches the disk for repos.
393
+ */
394
+ export function knownRepos(env = process.env) {
395
+ const raw = readJson(knownPath(trailHome(env))) ?? {};
396
+ return Object.entries(raw)
397
+ .map(([key, r]) => ({ key, name: r.name, path: r.path, seenAt: r.seenAt }))
398
+ .sort((a, b) => b.seenAt - a.seenAt);
399
+ }
400
+ /** How long a sighting stays fresh before `rememberRepo` writes again. */
401
+ const SEEN_TTL_MS = 24 * 60 * 60 * 1000;
402
+ /**
403
+ * Note that Trail ran in the repo at `dir`. Cheap enough for every command:
404
+ * it writes only for a repo that's new, moved, or not seen for a day.
405
+ */
406
+ export function rememberRepo(dir, env = process.env, now = Date.now()) {
407
+ try {
408
+ const place = repoPlace(dir, env);
409
+ if (!place.git)
410
+ return;
411
+ const file = knownPath(trailHome(env));
412
+ const all = readJson(file) ?? {};
413
+ const prior = all[place.key];
414
+ if (prior && prior.path === place.checkout && now - prior.seenAt < SEEN_TTL_MS)
415
+ return;
416
+ all[place.key] = { name: repoName(place.key, place.checkout), path: place.checkout, seenAt: now };
417
+ writeJsonAtomic(file, all);
418
+ }
419
+ catch {
420
+ /* a missed sighting only shortens the picker's list */
421
+ }
422
+ }
423
+ //# sourceMappingURL=home.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"home.js","sourceRoot":"","sources":["../../src/notes/home.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA8BG;AACH,OAAO,EAAE,YAAY,EAAE,MAAM,oBAAoB,CAAC;AAClD,OAAO,EAAE,UAAU,EAAE,MAAM,aAAa,CAAC;AACzC,OAAO,EAAE,UAAU,EAAE,SAAS,EAAE,WAAW,EAAE,YAAY,EAAE,QAAQ,EAAE,aAAa,EAAE,MAAM,SAAS,CAAC;AACpG,OAAO,EAAE,OAAO,EAAE,MAAM,SAAS,CAAC;AAClC,OAAO,EAAE,QAAQ,EAAE,OAAO,EAAE,UAAU,EAAE,IAAI,EAAE,QAAQ,EAAE,OAAO,EAAE,GAAG,EAAE,MAAM,WAAW,CAAC;AACxF,OAAO,EAAE,QAAQ,EAAE,eAAe,EAAE,MAAM,kBAAkB,CAAC;AAC7D,OAAO,EAAE,eAAe,EAAE,MAAM,eAAe,CAAC;AAChD,OAAO,EAAE,YAAY,EAAE,aAAa,EAAE,MAAM,iBAAiB,CAAC;AAE9D,oCAAoC;AACpC,MAAM,UAAU,SAAS,CAAC,MAAyB,OAAO,CAAC,GAAG,EAAE,OAAe,OAAO,EAAE;IACtF,OAAO,GAAG,CAAC,UAAU,CAAC,CAAC,CAAC,OAAO,CAAC,GAAG,CAAC,UAAU,CAAC,CA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