@ruverd/julius 0.0.0-stage → 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 (704) hide show
  1. package/CHANGELOG.md +31 -0
  2. package/CREDITS.md +25 -0
  3. package/LICENSE +21 -0
  4. package/PROVENANCE.md +9 -0
  5. package/README.md +225 -2
  6. package/dist/ai/crux.d.ts +60 -0
  7. package/dist/ai/crux.d.ts.map +1 -0
  8. package/dist/ai/crux.js +141 -0
  9. package/dist/ai/crux.js.map +1 -0
  10. package/dist/ai/failure.d.ts +60 -0
  11. package/dist/ai/failure.d.ts.map +1 -0
  12. package/dist/ai/failure.js +86 -0
  13. package/dist/ai/failure.js.map +1 -0
  14. package/dist/ai/llm/anthropic.d.ts +37 -0
  15. package/dist/ai/llm/anthropic.d.ts.map +1 -0
  16. package/dist/ai/llm/anthropic.js +144 -0
  17. package/dist/ai/llm/anthropic.js.map +1 -0
  18. package/dist/ai/llm/factory.d.ts +28 -0
  19. package/dist/ai/llm/factory.d.ts.map +1 -0
  20. package/dist/ai/llm/factory.js +36 -0
  21. package/dist/ai/llm/factory.js.map +1 -0
  22. package/dist/ai/llm/litellm.d.ts +34 -0
  23. package/dist/ai/llm/litellm.d.ts.map +1 -0
  24. package/dist/ai/llm/litellm.js +45 -0
  25. package/dist/ai/llm/litellm.js.map +1 -0
  26. package/dist/ai/llm/openai.d.ts +44 -0
  27. package/dist/ai/llm/openai.d.ts.map +1 -0
  28. package/dist/ai/llm/openai.js +239 -0
  29. package/dist/ai/llm/openai.js.map +1 -0
  30. package/dist/ai/llm/orcarouter.d.ts +34 -0
  31. package/dist/ai/llm/orcarouter.d.ts.map +1 -0
  32. package/dist/ai/llm/orcarouter.js +45 -0
  33. package/dist/ai/llm/orcarouter.js.map +1 -0
  34. package/dist/ai/llm/recover-tool.d.ts +19 -0
  35. package/dist/ai/llm/recover-tool.d.ts.map +1 -0
  36. package/dist/ai/llm/recover-tool.js +109 -0
  37. package/dist/ai/llm/recover-tool.js.map +1 -0
  38. package/dist/ai/llm/types.d.ts +122 -0
  39. package/dist/ai/llm/types.d.ts.map +1 -0
  40. package/dist/ai/llm/types.js +33 -0
  41. package/dist/ai/llm/types.js.map +1 -0
  42. package/dist/ai/providers.d.ts +59 -0
  43. package/dist/ai/providers.d.ts.map +1 -0
  44. package/dist/ai/providers.js +54 -0
  45. package/dist/ai/providers.js.map +1 -0
  46. package/dist/ai/summarize.d.ts +25 -0
  47. package/dist/ai/summarize.d.ts.map +1 -0
  48. package/dist/ai/summarize.js +34 -0
  49. package/dist/ai/summarize.js.map +1 -0
  50. package/dist/ai/synthesize.d.ts +40 -0
  51. package/dist/ai/synthesize.d.ts.map +1 -0
  52. package/dist/ai/synthesize.js +131 -0
  53. package/dist/ai/synthesize.js.map +1 -0
  54. package/dist/app/checkout.d.ts +46 -0
  55. package/dist/app/checkout.d.ts.map +1 -0
  56. package/dist/app/checkout.js +223 -0
  57. package/dist/app/checkout.js.map +1 -0
  58. package/dist/app/events.d.ts +44 -0
  59. package/dist/app/events.d.ts.map +1 -0
  60. package/dist/app/events.js +64 -0
  61. package/dist/app/events.js.map +1 -0
  62. package/dist/app/identity.d.ts +54 -0
  63. package/dist/app/identity.d.ts.map +1 -0
  64. package/dist/app/identity.js +96 -0
  65. package/dist/app/identity.js.map +1 -0
  66. package/dist/app/main.d.ts +2 -0
  67. package/dist/app/main.d.ts.map +1 -0
  68. package/dist/app/main.js +62 -0
  69. package/dist/app/main.js.map +1 -0
  70. package/dist/app/pages.d.ts +56 -0
  71. package/dist/app/pages.d.ts.map +1 -0
  72. package/dist/app/pages.js +193 -0
  73. package/dist/app/pages.js.map +1 -0
  74. package/dist/app/queue.d.ts +40 -0
  75. package/dist/app/queue.d.ts.map +1 -0
  76. package/dist/app/queue.js +68 -0
  77. package/dist/app/queue.js.map +1 -0
  78. package/dist/app/review-process.d.ts +66 -0
  79. package/dist/app/review-process.d.ts.map +1 -0
  80. package/dist/app/review-process.js +200 -0
  81. package/dist/app/review-process.js.map +1 -0
  82. package/dist/app/review-worker.d.ts +2 -0
  83. package/dist/app/review-worker.d.ts.map +1 -0
  84. package/dist/app/review-worker.js +108 -0
  85. package/dist/app/review-worker.js.map +1 -0
  86. package/dist/app/review.d.ts +23 -0
  87. package/dist/app/review.d.ts.map +1 -0
  88. package/dist/app/review.js +142 -0
  89. package/dist/app/review.js.map +1 -0
  90. package/dist/app/server.d.ts +49 -0
  91. package/dist/app/server.d.ts.map +1 -0
  92. package/dist/app/server.js +123 -0
  93. package/dist/app/server.js.map +1 -0
  94. package/dist/ask/ask.d.ts +195 -0
  95. package/dist/ask/ask.d.ts.map +1 -0
  96. package/dist/ask/ask.js +1252 -0
  97. package/dist/ask/ask.js.map +1 -0
  98. package/dist/ask/file-rank.d.ts +72 -0
  99. package/dist/ask/file-rank.d.ts.map +1 -0
  100. package/dist/ask/file-rank.js +160 -0
  101. package/dist/ask/file-rank.js.map +1 -0
  102. package/dist/ask/file-selection.d.ts +22 -0
  103. package/dist/ask/file-selection.d.ts.map +1 -0
  104. package/dist/ask/file-selection.js +66 -0
  105. package/dist/ask/file-selection.js.map +1 -0
  106. package/dist/ask/fuse.d.ts +195 -0
  107. package/dist/ask/fuse.d.ts.map +1 -0
  108. package/dist/ask/fuse.js +344 -0
  109. package/dist/ask/fuse.js.map +1 -0
  110. package/dist/ask/graphrank.d.ts +61 -0
  111. package/dist/ask/graphrank.d.ts.map +1 -0
  112. package/dist/ask/graphrank.js +130 -0
  113. package/dist/ask/graphrank.js.map +1 -0
  114. package/dist/ask/index-file.d.ts +44 -0
  115. package/dist/ask/index-file.d.ts.map +1 -0
  116. package/dist/ask/index-file.js +128 -0
  117. package/dist/ask/index-file.js.map +1 -0
  118. package/dist/bin/julius.d.ts +3 -0
  119. package/dist/bin/julius.d.ts.map +1 -0
  120. package/dist/bin/julius.js +4 -0
  121. package/dist/bin/julius.js.map +1 -0
  122. package/dist/blast/blast-cli.d.ts +35 -0
  123. package/dist/blast/blast-cli.d.ts.map +1 -0
  124. package/dist/blast/blast-cli.js +155 -0
  125. package/dist/blast/blast-cli.js.map +1 -0
  126. package/dist/blast/blast.d.ts +128 -0
  127. package/dist/blast/blast.d.ts.map +1 -0
  128. package/dist/blast/blast.js +383 -0
  129. package/dist/blast/blast.js.map +1 -0
  130. package/dist/blast/diff.d.ts +53 -0
  131. package/dist/blast/diff.d.ts.map +1 -0
  132. package/dist/blast/diff.js +193 -0
  133. package/dist/blast/diff.js.map +1 -0
  134. package/dist/blast/evidence.d.ts +51 -0
  135. package/dist/blast/evidence.d.ts.map +1 -0
  136. package/dist/blast/evidence.js +162 -0
  137. package/dist/blast/evidence.js.map +1 -0
  138. package/dist/blast/modules.d.ts +33 -0
  139. package/dist/blast/modules.d.ts.map +1 -0
  140. package/dist/blast/modules.js +83 -0
  141. package/dist/blast/modules.js.map +1 -0
  142. package/dist/blast/name.d.ts +74 -0
  143. package/dist/blast/name.d.ts.map +1 -0
  144. package/dist/blast/name.js +269 -0
  145. package/dist/blast/name.js.map +1 -0
  146. package/dist/blast/owners.d.ts +85 -0
  147. package/dist/blast/owners.d.ts.map +1 -0
  148. package/dist/blast/owners.js +272 -0
  149. package/dist/blast/owners.js.map +1 -0
  150. package/dist/blast/render.d.ts +46 -0
  151. package/dist/blast/render.d.ts.map +1 -0
  152. package/dist/blast/render.js +422 -0
  153. package/dist/blast/render.js.map +1 -0
  154. package/dist/blast/viz.d.ts +37 -0
  155. package/dist/blast/viz.d.ts.map +1 -0
  156. package/dist/blast/viz.js +180 -0
  157. package/dist/blast/viz.js.map +1 -0
  158. package/dist/brand.d.ts +13 -0
  159. package/dist/brand.d.ts.map +1 -0
  160. package/dist/brand.js +43 -0
  161. package/dist/brand.js.map +1 -0
  162. package/dist/check/learning-edits.d.ts +9 -0
  163. package/dist/check/learning-edits.d.ts.map +1 -0
  164. package/dist/check/learning-edits.js +62 -0
  165. package/dist/check/learning-edits.js.map +1 -0
  166. package/dist/check/local-check.d.ts +104 -0
  167. package/dist/check/local-check.d.ts.map +1 -0
  168. package/dist/check/local-check.js +830 -0
  169. package/dist/check/local-check.js.map +1 -0
  170. package/dist/check/types.d.ts +31 -0
  171. package/dist/check/types.d.ts.map +1 -0
  172. package/dist/check/types.js +2 -0
  173. package/dist/check/types.js.map +1 -0
  174. package/dist/claude/build-progress.d.ts +29 -0
  175. package/dist/claude/build-progress.d.ts.map +1 -0
  176. package/dist/claude/build-progress.js +76 -0
  177. package/dist/claude/build-progress.js.map +1 -0
  178. package/dist/claude/format.d.ts +131 -0
  179. package/dist/claude/format.d.ts.map +1 -0
  180. package/dist/claude/format.js +328 -0
  181. package/dist/claude/format.js.map +1 -0
  182. package/dist/claude/hook-layers.d.ts +8 -0
  183. package/dist/claude/hook-layers.d.ts.map +1 -0
  184. package/dist/claude/hook-layers.js +74 -0
  185. package/dist/claude/hook-layers.js.map +1 -0
  186. package/dist/claude/hooks.d.ts +101 -0
  187. package/dist/claude/hooks.d.ts.map +1 -0
  188. package/dist/claude/hooks.js +849 -0
  189. package/dist/claude/hooks.js.map +1 -0
  190. package/dist/claude/init.d.ts +70 -0
  191. package/dist/claude/init.d.ts.map +1 -0
  192. package/dist/claude/init.js +207 -0
  193. package/dist/claude/init.js.map +1 -0
  194. package/dist/claude/note-signals.d.ts +28 -0
  195. package/dist/claude/note-signals.d.ts.map +1 -0
  196. package/dist/claude/note-signals.js +325 -0
  197. package/dist/claude/note-signals.js.map +1 -0
  198. package/dist/claude/paths.d.ts +9 -0
  199. package/dist/claude/paths.d.ts.map +1 -0
  200. package/dist/claude/paths.js +22 -0
  201. package/dist/claude/paths.js.map +1 -0
  202. package/dist/claude/session-metrics.d.ts +73 -0
  203. package/dist/claude/session-metrics.d.ts.map +1 -0
  204. package/dist/claude/session-metrics.js +209 -0
  205. package/dist/claude/session-metrics.js.map +1 -0
  206. package/dist/claude/settings-merge.d.ts +66 -0
  207. package/dist/claude/settings-merge.d.ts.map +1 -0
  208. package/dist/claude/settings-merge.js +249 -0
  209. package/dist/claude/settings-merge.js.map +1 -0
  210. package/dist/claude/shim-template.d.ts +18 -0
  211. package/dist/claude/shim-template.d.ts.map +1 -0
  212. package/dist/claude/shim-template.js +226 -0
  213. package/dist/claude/shim-template.js.map +1 -0
  214. package/dist/claude/skill-template.d.ts +12 -0
  215. package/dist/claude/skill-template.d.ts.map +1 -0
  216. package/dist/claude/skill-template.js +294 -0
  217. package/dist/claude/skill-template.js.map +1 -0
  218. package/dist/claude/state.d.ts +73 -0
  219. package/dist/claude/state.d.ts.map +1 -0
  220. package/dist/claude/state.js +33 -0
  221. package/dist/claude/state.js.map +1 -0
  222. package/dist/claude/stats.d.ts +5 -0
  223. package/dist/claude/stats.d.ts.map +1 -0
  224. package/dist/claude/stats.js +24 -0
  225. package/dist/claude/stats.js.map +1 -0
  226. package/dist/claude/statusline.d.ts +14 -0
  227. package/dist/claude/statusline.d.ts.map +1 -0
  228. package/dist/claude/statusline.js +45 -0
  229. package/dist/claude/statusline.js.map +1 -0
  230. package/dist/claude/sync-run.d.ts +3 -0
  231. package/dist/claude/sync-run.d.ts.map +1 -0
  232. package/dist/claude/sync-run.js +46 -0
  233. package/dist/claude/sync-run.js.map +1 -0
  234. package/dist/claude/tally.d.ts +50 -0
  235. package/dist/claude/tally.d.ts.map +1 -0
  236. package/dist/claude/tally.js +211 -0
  237. package/dist/claude/tally.js.map +1 -0
  238. package/dist/cli-epilogue.d.ts +12 -0
  239. package/dist/cli-epilogue.d.ts.map +1 -0
  240. package/dist/cli-epilogue.js +55 -0
  241. package/dist/cli-epilogue.js.map +1 -0
  242. package/dist/cli-meta.d.ts +45 -0
  243. package/dist/cli-meta.d.ts.map +1 -0
  244. package/dist/cli-meta.js +145 -0
  245. package/dist/cli-meta.js.map +1 -0
  246. package/dist/cli-picker.d.ts +129 -0
  247. package/dist/cli-picker.d.ts.map +1 -0
  248. package/dist/cli-picker.js +432 -0
  249. package/dist/cli-picker.js.map +1 -0
  250. package/dist/cli.d.ts +3 -0
  251. package/dist/cli.d.ts.map +1 -0
  252. package/dist/cli.js +2213 -0
  253. package/dist/cli.js.map +1 -0
  254. package/dist/cloud/diff.d.ts +20 -0
  255. package/dist/cloud/diff.d.ts.map +1 -0
  256. package/dist/cloud/diff.js +59 -0
  257. package/dist/cloud/diff.js.map +1 -0
  258. package/dist/cloud/nudge.d.ts +66 -0
  259. package/dist/cloud/nudge.d.ts.map +1 -0
  260. package/dist/cloud/nudge.js +268 -0
  261. package/dist/cloud/nudge.js.map +1 -0
  262. package/dist/cloud/workspace-sync.d.ts +58 -0
  263. package/dist/cloud/workspace-sync.d.ts.map +1 -0
  264. package/dist/cloud/workspace-sync.js +268 -0
  265. package/dist/cloud/workspace-sync.js.map +1 -0
  266. package/dist/cloud/workspace.d.ts +159 -0
  267. package/dist/cloud/workspace.d.ts.map +1 -0
  268. package/dist/cloud/workspace.js +134 -0
  269. package/dist/cloud/workspace.js.map +1 -0
  270. package/dist/context/build.d.ts +52 -0
  271. package/dist/context/build.d.ts.map +1 -0
  272. package/dist/context/build.js +362 -0
  273. package/dist/context/build.js.map +1 -0
  274. package/dist/context/check.d.ts +42 -0
  275. package/dist/context/check.d.ts.map +1 -0
  276. package/dist/context/check.js +162 -0
  277. package/dist/context/check.js.map +1 -0
  278. package/dist/context/map-dir.d.ts +4 -0
  279. package/dist/context/map-dir.d.ts.map +1 -0
  280. package/dist/context/map-dir.js +6 -0
  281. package/dist/context/map-dir.js.map +1 -0
  282. package/dist/context/node-file.d.ts +109 -0
  283. package/dist/context/node-file.d.ts.map +1 -0
  284. package/dist/context/node-file.js +362 -0
  285. package/dist/context/node-file.js.map +1 -0
  286. package/dist/context/price.d.ts +49 -0
  287. package/dist/context/price.d.ts.map +1 -0
  288. package/dist/context/price.js +83 -0
  289. package/dist/context/price.js.map +1 -0
  290. package/dist/context/savings.d.ts +26 -0
  291. package/dist/context/savings.d.ts.map +1 -0
  292. package/dist/context/savings.js +59 -0
  293. package/dist/context/savings.js.map +1 -0
  294. package/dist/economy/cli.d.ts +3 -0
  295. package/dist/economy/cli.d.ts.map +1 -0
  296. package/dist/economy/cli.js +52 -0
  297. package/dist/economy/cli.js.map +1 -0
  298. package/dist/economy/delivery.d.ts +49 -0
  299. package/dist/economy/delivery.d.ts.map +1 -0
  300. package/dist/economy/delivery.js +176 -0
  301. package/dist/economy/delivery.js.map +1 -0
  302. package/dist/economy/index.d.ts +67 -0
  303. package/dist/economy/index.d.ts.map +1 -0
  304. package/dist/economy/index.js +519 -0
  305. package/dist/economy/index.js.map +1 -0
  306. package/dist/engine.d.ts +83 -0
  307. package/dist/engine.d.ts.map +1 -0
  308. package/dist/engine.js +122 -0
  309. package/dist/engine.js.map +1 -0
  310. package/dist/evaluation/index.d.ts +41 -0
  311. package/dist/evaluation/index.d.ts.map +1 -0
  312. package/dist/evaluation/index.js +61 -0
  313. package/dist/evaluation/index.js.map +1 -0
  314. package/dist/graph/bindings.d.ts +64 -0
  315. package/dist/graph/bindings.d.ts.map +1 -0
  316. package/dist/graph/bindings.js +713 -0
  317. package/dist/graph/bindings.js.map +1 -0
  318. package/dist/graph/build.d.ts +88 -0
  319. package/dist/graph/build.d.ts.map +1 -0
  320. package/dist/graph/build.js +375 -0
  321. package/dist/graph/build.js.map +1 -0
  322. package/dist/graph/cards.d.ts +46 -0
  323. package/dist/graph/cards.d.ts.map +1 -0
  324. package/dist/graph/cards.js +280 -0
  325. package/dist/graph/cards.js.map +1 -0
  326. package/dist/graph/check.d.ts +25 -0
  327. package/dist/graph/check.d.ts.map +1 -0
  328. package/dist/graph/check.js +192 -0
  329. package/dist/graph/check.js.map +1 -0
  330. package/dist/graph/container.d.ts +63 -0
  331. package/dist/graph/container.d.ts.map +1 -0
  332. package/dist/graph/container.js +190 -0
  333. package/dist/graph/container.js.map +1 -0
  334. package/dist/graph/enrich.d.ts +62 -0
  335. package/dist/graph/enrich.d.ts.map +1 -0
  336. package/dist/graph/enrich.js +253 -0
  337. package/dist/graph/enrich.js.map +1 -0
  338. package/dist/graph/extract-cache.d.ts +101 -0
  339. package/dist/graph/extract-cache.d.ts.map +1 -0
  340. package/dist/graph/extract-cache.js +199 -0
  341. package/dist/graph/extract-cache.js.map +1 -0
  342. package/dist/graph/extract.d.ts +85 -0
  343. package/dist/graph/extract.d.ts.map +1 -0
  344. package/dist/graph/extract.js +2376 -0
  345. package/dist/graph/extract.js.map +1 -0
  346. package/dist/graph/fingerprint.d.ts +76 -0
  347. package/dist/graph/fingerprint.d.ts.map +1 -0
  348. package/dist/graph/fingerprint.js +160 -0
  349. package/dist/graph/fingerprint.js.map +1 -0
  350. package/dist/graph/generic.d.ts +74 -0
  351. package/dist/graph/generic.d.ts.map +1 -0
  352. package/dist/graph/generic.js +580 -0
  353. package/dist/graph/generic.js.map +1 -0
  354. package/dist/graph/invariants.d.ts +33 -0
  355. package/dist/graph/invariants.d.ts.map +1 -0
  356. package/dist/graph/invariants.js +52 -0
  357. package/dist/graph/invariants.js.map +1 -0
  358. package/dist/graph/load.d.ts +29 -0
  359. package/dist/graph/load.d.ts.map +1 -0
  360. package/dist/graph/load.js +97 -0
  361. package/dist/graph/load.js.map +1 -0
  362. package/dist/graph/lsp/client.d.ts +43 -0
  363. package/dist/graph/lsp/client.d.ts.map +1 -0
  364. package/dist/graph/lsp/client.js +179 -0
  365. package/dist/graph/lsp/client.js.map +1 -0
  366. package/dist/graph/lsp/enrich.d.ts +11 -0
  367. package/dist/graph/lsp/enrich.d.ts.map +1 -0
  368. package/dist/graph/lsp/enrich.js +155 -0
  369. package/dist/graph/lsp/enrich.js.map +1 -0
  370. package/dist/graph/lsp/registry.d.ts +15 -0
  371. package/dist/graph/lsp/registry.d.ts.map +1 -0
  372. package/dist/graph/lsp/registry.js +46 -0
  373. package/dist/graph/lsp/registry.js.map +1 -0
  374. package/dist/graph/map.d.ts +107 -0
  375. package/dist/graph/map.d.ts.map +1 -0
  376. package/dist/graph/map.js +239 -0
  377. package/dist/graph/map.js.map +1 -0
  378. package/dist/graph/native.d.ts +38 -0
  379. package/dist/graph/native.d.ts.map +1 -0
  380. package/dist/graph/native.js +169 -0
  381. package/dist/graph/native.js.map +1 -0
  382. package/dist/graph/queries/c.scm +13 -0
  383. package/dist/graph/queries/c_sharp.scm +19 -0
  384. package/dist/graph/queries/clojure.scm +58 -0
  385. package/dist/graph/queries/cpp.scm +23 -0
  386. package/dist/graph/queries/dart.scm +42 -0
  387. package/dist/graph/queries/elixir.scm +54 -0
  388. package/dist/graph/queries/java.scm +20 -0
  389. package/dist/graph/queries/kotlin.scm +43 -0
  390. package/dist/graph/queries/lua.scm +36 -0
  391. package/dist/graph/queries/nix.scm +32 -0
  392. package/dist/graph/queries/php.scm +40 -0
  393. package/dist/graph/queries/ruby.scm +65 -0
  394. package/dist/graph/queries/rust.scm +41 -0
  395. package/dist/graph/queries/scala.scm +66 -0
  396. package/dist/graph/queries/solidity.scm +43 -0
  397. package/dist/graph/queries/swift.scm +51 -0
  398. package/dist/graph/refresh.d.ts +49 -0
  399. package/dist/graph/refresh.d.ts.map +1 -0
  400. package/dist/graph/refresh.js +255 -0
  401. package/dist/graph/refresh.js.map +1 -0
  402. package/dist/graph/relations.d.ts +14 -0
  403. package/dist/graph/relations.d.ts.map +1 -0
  404. package/dist/graph/relations.js +8 -0
  405. package/dist/graph/relations.js.map +1 -0
  406. package/dist/graph/resolve.d.ts +17 -0
  407. package/dist/graph/resolve.d.ts.map +1 -0
  408. package/dist/graph/resolve.js +654 -0
  409. package/dist/graph/resolve.js.map +1 -0
  410. package/dist/graph/root.d.ts +11 -0
  411. package/dist/graph/root.d.ts.map +1 -0
  412. package/dist/graph/root.js +40 -0
  413. package/dist/graph/root.js.map +1 -0
  414. package/dist/graph/scopes.d.ts +42 -0
  415. package/dist/graph/scopes.d.ts.map +1 -0
  416. package/dist/graph/scopes.js +342 -0
  417. package/dist/graph/scopes.js.map +1 -0
  418. package/dist/graph/seed.d.ts +38 -0
  419. package/dist/graph/seed.d.ts.map +1 -0
  420. package/dist/graph/seed.js +226 -0
  421. package/dist/graph/seed.js.map +1 -0
  422. package/dist/graph/source-files.d.ts +40 -0
  423. package/dist/graph/source-files.d.ts.map +1 -0
  424. package/dist/graph/source-files.js +85 -0
  425. package/dist/graph/source-files.js.map +1 -0
  426. package/dist/graph/traverse-cli.d.ts +55 -0
  427. package/dist/graph/traverse-cli.d.ts.map +1 -0
  428. package/dist/graph/traverse-cli.js +189 -0
  429. package/dist/graph/traverse-cli.js.map +1 -0
  430. package/dist/graph/traverse.d.ts +112 -0
  431. package/dist/graph/traverse.d.ts.map +1 -0
  432. package/dist/graph/traverse.js +192 -0
  433. package/dist/graph/traverse.js.map +1 -0
  434. package/dist/graph/types.d.ts +78 -0
  435. package/dist/graph/types.d.ts.map +1 -0
  436. package/dist/graph/types.js +14 -0
  437. package/dist/graph/types.js.map +1 -0
  438. package/dist/graph/workspace-cli.d.ts +48 -0
  439. package/dist/graph/workspace-cli.d.ts.map +1 -0
  440. package/dist/graph/workspace-cli.js +102 -0
  441. package/dist/graph/workspace-cli.js.map +1 -0
  442. package/dist/graph/workspace.d.ts +135 -0
  443. package/dist/graph/workspace.d.ts.map +1 -0
  444. package/dist/graph/workspace.js +598 -0
  445. package/dist/graph/workspace.js.map +1 -0
  446. package/dist/graph/write.d.ts +13 -0
  447. package/dist/graph/write.d.ts.map +1 -0
  448. package/dist/graph/write.js +86 -0
  449. package/dist/graph/write.js.map +1 -0
  450. package/dist/hosts/antigravity.d.ts +8 -0
  451. package/dist/hosts/antigravity.d.ts.map +1 -0
  452. package/dist/hosts/antigravity.js +42 -0
  453. package/dist/hosts/antigravity.js.map +1 -0
  454. package/dist/hosts/claude-global.d.ts +36 -0
  455. package/dist/hosts/claude-global.d.ts.map +1 -0
  456. package/dist/hosts/claude-global.js +153 -0
  457. package/dist/hosts/claude-global.js.map +1 -0
  458. package/dist/hosts/codex-hooks.d.ts +11 -0
  459. package/dist/hosts/codex-hooks.d.ts.map +1 -0
  460. package/dist/hosts/codex-hooks.js +80 -0
  461. package/dist/hosts/codex-hooks.js.map +1 -0
  462. package/dist/hosts/config-write.d.ts +36 -0
  463. package/dist/hosts/config-write.d.ts.map +1 -0
  464. package/dist/hosts/config-write.js +64 -0
  465. package/dist/hosts/config-write.js.map +1 -0
  466. package/dist/hosts/cursor-hooks.d.ts +21 -0
  467. package/dist/hosts/cursor-hooks.d.ts.map +1 -0
  468. package/dist/hosts/cursor-hooks.js +103 -0
  469. package/dist/hosts/cursor-hooks.js.map +1 -0
  470. package/dist/hosts/init.d.ts +26 -0
  471. package/dist/hosts/init.d.ts.map +1 -0
  472. package/dist/hosts/init.js +82 -0
  473. package/dist/hosts/init.js.map +1 -0
  474. package/dist/hosts/install.d.ts +12 -0
  475. package/dist/hosts/install.d.ts.map +1 -0
  476. package/dist/hosts/install.js +347 -0
  477. package/dist/hosts/install.js.map +1 -0
  478. package/dist/hosts/instructions.d.ts +7 -0
  479. package/dist/hosts/instructions.d.ts.map +1 -0
  480. package/dist/hosts/instructions.js +71 -0
  481. package/dist/hosts/instructions.js.map +1 -0
  482. package/dist/hosts/investigation-instructions.d.ts +2 -0
  483. package/dist/hosts/investigation-instructions.d.ts.map +1 -0
  484. package/dist/hosts/investigation-instructions.js +2 -0
  485. package/dist/hosts/investigation-instructions.js.map +1 -0
  486. package/dist/hosts/mcp-config.d.ts +59 -0
  487. package/dist/hosts/mcp-config.d.ts.map +1 -0
  488. package/dist/hosts/mcp-config.js +229 -0
  489. package/dist/hosts/mcp-config.js.map +1 -0
  490. package/dist/hosts/plan.d.ts +32 -0
  491. package/dist/hosts/plan.d.ts.map +1 -0
  492. package/dist/hosts/plan.js +77 -0
  493. package/dist/hosts/plan.js.map +1 -0
  494. package/dist/hosts/registry.d.ts +35 -0
  495. package/dist/hosts/registry.d.ts.map +1 -0
  496. package/dist/hosts/registry.js +157 -0
  497. package/dist/hosts/registry.js.map +1 -0
  498. package/dist/hosts/retract.d.ts +47 -0
  499. package/dist/hosts/retract.d.ts.map +1 -0
  500. package/dist/hosts/retract.js +541 -0
  501. package/dist/hosts/retract.js.map +1 -0
  502. package/dist/hosts/sections.d.ts +46 -0
  503. package/dist/hosts/sections.d.ts.map +1 -0
  504. package/dist/hosts/sections.js +126 -0
  505. package/dist/hosts/sections.js.map +1 -0
  506. package/dist/index.d.ts +43 -0
  507. package/dist/index.d.ts.map +1 -0
  508. package/dist/index.js +33 -0
  509. package/dist/index.js.map +1 -0
  510. package/dist/ingest/fs.d.ts +79 -0
  511. package/dist/ingest/fs.d.ts.map +1 -0
  512. package/dist/ingest/fs.js +307 -0
  513. package/dist/ingest/fs.js.map +1 -0
  514. package/dist/init-guard.d.ts +11 -0
  515. package/dist/init-guard.d.ts.map +1 -0
  516. package/dist/init-guard.js +21 -0
  517. package/dist/init-guard.js.map +1 -0
  518. package/dist/investigation/index.d.ts +57 -0
  519. package/dist/investigation/index.d.ts.map +1 -0
  520. package/dist/investigation/index.js +315 -0
  521. package/dist/investigation/index.js.map +1 -0
  522. package/dist/mcp/compact.d.ts +9 -0
  523. package/dist/mcp/compact.d.ts.map +1 -0
  524. package/dist/mcp/compact.js +133 -0
  525. package/dist/mcp/compact.js.map +1 -0
  526. package/dist/mcp/instructions.d.ts +5 -0
  527. package/dist/mcp/instructions.d.ts.map +1 -0
  528. package/dist/mcp/instructions.js +57 -0
  529. package/dist/mcp/instructions.js.map +1 -0
  530. package/dist/mcp/server.d.ts +7 -0
  531. package/dist/mcp/server.d.ts.map +1 -0
  532. package/dist/mcp/server.js +128 -0
  533. package/dist/mcp/server.js.map +1 -0
  534. package/dist/mcp/tool-names.d.ts +20 -0
  535. package/dist/mcp/tool-names.d.ts.map +1 -0
  536. package/dist/mcp/tool-names.js +36 -0
  537. package/dist/mcp/tool-names.js.map +1 -0
  538. package/dist/mcp/tools.d.ts +22 -0
  539. package/dist/mcp/tools.d.ts.map +1 -0
  540. package/dist/mcp/tools.js +300 -0
  541. package/dist/mcp/tools.js.map +1 -0
  542. package/dist/notes/ask-notes.d.ts +8 -0
  543. package/dist/notes/ask-notes.d.ts.map +1 -0
  544. package/dist/notes/ask-notes.js +19 -0
  545. package/dist/notes/ask-notes.js.map +1 -0
  546. package/dist/notes/branches.d.ts +102 -0
  547. package/dist/notes/branches.d.ts.map +1 -0
  548. package/dist/notes/branches.js +304 -0
  549. package/dist/notes/branches.js.map +1 -0
  550. package/dist/notes/cold-start.d.ts +177 -0
  551. package/dist/notes/cold-start.d.ts.map +1 -0
  552. package/dist/notes/cold-start.js +537 -0
  553. package/dist/notes/cold-start.js.map +1 -0
  554. package/dist/notes/edit-overlap.d.ts +62 -0
  555. package/dist/notes/edit-overlap.d.ts.map +1 -0
  556. package/dist/notes/edit-overlap.js +202 -0
  557. package/dist/notes/edit-overlap.js.map +1 -0
  558. package/dist/notes/git-facts.d.ts +21 -0
  559. package/dist/notes/git-facts.d.ts.map +1 -0
  560. package/dist/notes/git-facts.js +121 -0
  561. package/dist/notes/git-facts.js.map +1 -0
  562. package/dist/notes/home.d.ts +87 -0
  563. package/dist/notes/home.d.ts.map +1 -0
  564. package/dist/notes/home.js +430 -0
  565. package/dist/notes/home.js.map +1 -0
  566. package/dist/notes/learning-fields.d.ts +102 -0
  567. package/dist/notes/learning-fields.d.ts.map +1 -0
  568. package/dist/notes/learning-fields.js +217 -0
  569. package/dist/notes/learning-fields.js.map +1 -0
  570. package/dist/notes/note-gate.d.ts +42 -0
  571. package/dist/notes/note-gate.d.ts.map +1 -0
  572. package/dist/notes/note-gate.js +181 -0
  573. package/dist/notes/note-gate.js.map +1 -0
  574. package/dist/notes/notes.d.ts +214 -0
  575. package/dist/notes/notes.d.ts.map +1 -0
  576. package/dist/notes/notes.js +591 -0
  577. package/dist/notes/notes.js.map +1 -0
  578. package/dist/notes/pr-reviews.d.ts +108 -0
  579. package/dist/notes/pr-reviews.d.ts.map +1 -0
  580. package/dist/notes/pr-reviews.js +325 -0
  581. package/dist/notes/pr-reviews.js.map +1 -0
  582. package/dist/notes/repo-julius.d.ts +18 -0
  583. package/dist/notes/repo-julius.d.ts.map +1 -0
  584. package/dist/notes/repo-julius.js +111 -0
  585. package/dist/notes/repo-julius.js.map +1 -0
  586. package/dist/notes/session-cost.d.ts +35 -0
  587. package/dist/notes/session-cost.d.ts.map +1 -0
  588. package/dist/notes/session-cost.js +276 -0
  589. package/dist/notes/session-cost.js.map +1 -0
  590. package/dist/search/grep-cli.d.ts +35 -0
  591. package/dist/search/grep-cli.d.ts.map +1 -0
  592. package/dist/search/grep-cli.js +115 -0
  593. package/dist/search/grep-cli.js.map +1 -0
  594. package/dist/search/grep.d.ts +60 -0
  595. package/dist/search/grep.d.ts.map +1 -0
  596. package/dist/search/grep.js +176 -0
  597. package/dist/search/grep.js.map +1 -0
  598. package/dist/search/ignored-code.d.ts +9 -0
  599. package/dist/search/ignored-code.d.ts.map +1 -0
  600. package/dist/search/ignored-code.js +73 -0
  601. package/dist/search/ignored-code.js.map +1 -0
  602. package/dist/skills/skills.d.ts +118 -0
  603. package/dist/skills/skills.d.ts.map +1 -0
  604. package/dist/skills/skills.js +370 -0
  605. package/dist/skills/skills.js.map +1 -0
  606. package/dist/telemetry/contract.d.ts +103 -0
  607. package/dist/telemetry/contract.d.ts.map +1 -0
  608. package/dist/telemetry/contract.js +270 -0
  609. package/dist/telemetry/contract.js.map +1 -0
  610. package/dist/telemetry/flush.d.ts +21 -0
  611. package/dist/telemetry/flush.d.ts.map +1 -0
  612. package/dist/telemetry/flush.js +85 -0
  613. package/dist/telemetry/flush.js.map +1 -0
  614. package/dist/telemetry/gate.d.ts +30 -0
  615. package/dist/telemetry/gate.d.ts.map +1 -0
  616. package/dist/telemetry/gate.js +81 -0
  617. package/dist/telemetry/gate.js.map +1 -0
  618. package/dist/telemetry/identity.d.ts +40 -0
  619. package/dist/telemetry/identity.d.ts.map +1 -0
  620. package/dist/telemetry/identity.js +80 -0
  621. package/dist/telemetry/identity.js.map +1 -0
  622. package/dist/telemetry/index.d.ts +18 -0
  623. package/dist/telemetry/index.d.ts.map +1 -0
  624. package/dist/telemetry/index.js +16 -0
  625. package/dist/telemetry/index.js.map +1 -0
  626. package/dist/telemetry/key.d.ts +4 -0
  627. package/dist/telemetry/key.d.ts.map +1 -0
  628. package/dist/telemetry/key.js +4 -0
  629. package/dist/telemetry/key.js.map +1 -0
  630. package/dist/telemetry/notice.d.ts +19 -0
  631. package/dist/telemetry/notice.d.ts.map +1 -0
  632. package/dist/telemetry/notice.js +93 -0
  633. package/dist/telemetry/notice.js.map +1 -0
  634. package/dist/telemetry/queue.d.ts +35 -0
  635. package/dist/telemetry/queue.d.ts.map +1 -0
  636. package/dist/telemetry/queue.js +162 -0
  637. package/dist/telemetry/queue.js.map +1 -0
  638. package/dist/telemetry/send.d.ts +19 -0
  639. package/dist/telemetry/send.d.ts.map +1 -0
  640. package/dist/telemetry/send.js +84 -0
  641. package/dist/telemetry/send.js.map +1 -0
  642. package/dist/telemetry/sessions.d.ts +25 -0
  643. package/dist/telemetry/sessions.d.ts.map +1 -0
  644. package/dist/telemetry/sessions.js +104 -0
  645. package/dist/telemetry/sessions.js.map +1 -0
  646. package/dist/telemetry/track.d.ts +62 -0
  647. package/dist/telemetry/track.d.ts.map +1 -0
  648. package/dist/telemetry/track.js +142 -0
  649. package/dist/telemetry/track.js.map +1 -0
  650. package/dist/upkeep-run.d.ts +15 -0
  651. package/dist/upkeep-run.d.ts.map +1 -0
  652. package/dist/upkeep-run.js +71 -0
  653. package/dist/upkeep-run.js.map +1 -0
  654. package/dist/upkeep.d.ts +125 -0
  655. package/dist/upkeep.d.ts.map +1 -0
  656. package/dist/upkeep.js +255 -0
  657. package/dist/upkeep.js.map +1 -0
  658. package/dist/util/browser.d.ts +3 -0
  659. package/dist/util/browser.d.ts.map +1 -0
  660. package/dist/util/browser.js +14 -0
  661. package/dist/util/browser.js.map +1 -0
  662. package/dist/util/front-matter.d.ts +19 -0
  663. package/dist/util/front-matter.d.ts.map +1 -0
  664. package/dist/util/front-matter.js +21 -0
  665. package/dist/util/front-matter.js.map +1 -0
  666. package/dist/util/id.d.ts +7 -0
  667. package/dist/util/id.d.ts.map +1 -0
  668. package/dist/util/id.js +14 -0
  669. package/dist/util/id.js.map +1 -0
  670. package/dist/util/paths.d.ts +29 -0
  671. package/dist/util/paths.d.ts.map +1 -0
  672. package/dist/util/paths.js +71 -0
  673. package/dist/util/paths.js.map +1 -0
  674. package/dist/util/source.d.ts +4 -0
  675. package/dist/util/source.d.ts.map +1 -0
  676. package/dist/util/source.js +12 -0
  677. package/dist/util/source.js.map +1 -0
  678. package/dist/util/spinner.d.ts +15 -0
  679. package/dist/util/spinner.d.ts.map +1 -0
  680. package/dist/util/spinner.js +52 -0
  681. package/dist/util/spinner.js.map +1 -0
  682. package/dist/util/state.d.ts +100 -0
  683. package/dist/util/state.d.ts.map +1 -0
  684. package/dist/util/state.js +186 -0
  685. package/dist/util/state.js.map +1 -0
  686. package/dist/viewer/app.js +2 -0
  687. package/dist/viewer/index.html +49 -0
  688. package/dist/viewer/style.css +154 -0
  689. package/dist/viz/assemble.d.ts +83 -0
  690. package/dist/viz/assemble.d.ts.map +1 -0
  691. package/dist/viz/assemble.js +101 -0
  692. package/dist/viz/assemble.js.map +1 -0
  693. package/dist/viz/export.d.ts +39 -0
  694. package/dist/viz/export.d.ts.map +1 -0
  695. package/dist/viz/export.js +98 -0
  696. package/dist/viz/export.js.map +1 -0
  697. package/dist/viz/serve.d.ts +12 -0
  698. package/dist/viz/serve.d.ts.map +1 -0
  699. package/dist/viz/serve.js +129 -0
  700. package/dist/viz/serve.js.map +1 -0
  701. package/docs/assets/context-benchmark.svg +31 -0
  702. package/docs/assets/julius-hero.png +0 -0
  703. package/docs/upstream-changelog.md +785 -0
  704. package/package.json +138 -4
package/dist/upkeep.js ADDED
@@ -0,0 +1,255 @@
1
+ /**
2
+ * Self-maintenance: keeping an installed julius, and the wiring it wrote, current.
3
+ *
4
+ * Two independent kinds of staleness, both invisible to the user today:
5
+ *
6
+ * 1. **Binary staleness** — they installed once and never upgraded. `julius
7
+ * version` would tell them, but nobody runs it. So we keep a cached,
8
+ * machine-global registry answer and let every entry point surface a
9
+ * one-line nudge from it.
10
+ *
11
+ * 2. **Wiring staleness** — `julius init` copies hooks, shims, skill text and
12
+ * rule files INTO the repo. `npm i -g` replaces the binary but touches none
13
+ * of them, so a repo wired by 0.7 keeps 0.7's prompts and 0.7's hook
14
+ * timeouts forever (see the comment on `promptAskTimeout`, which exists
15
+ * only to work around exactly this). A version stamp written next to the
16
+ * graph lets any entry point notice the skew and re-run the writes.
17
+ *
18
+ * Everything here is fail-soft by construction: it runs inside hooks and inside
19
+ * the MCP server's boot path, where a throw is a broken session, and it must
20
+ * never block on the network — the registry is only ever read from cache, and
21
+ * the refresh happens in a detached child.
22
+ *
23
+ * Called from all three hosts' entry points so no editor is left out:
24
+ * • Claude Code — `session-start` hook (src/claude/hooks.ts)
25
+ * • Cursor/Codex — MCP server boot (src/mcp/server.ts), and any CLI command
26
+ */
27
+ import { existsSync, readFileSync } from 'node:fs';
28
+ import { spawn } from 'node:child_process';
29
+ import { join } from 'node:path';
30
+ import { homedir } from 'node:os';
31
+ import { readJson, writeJsonAtomic, cacheDir } from './util/state.js';
32
+ import { HOSTS, hostRelPath } from './hosts/registry.js';
33
+ import { markersFor } from './hosts/sections.js';
34
+ import { getNpmViewVersion, readCurrentVersion } from './cli-meta.js';
35
+ import { brand } from './brand.js';
36
+ import { juliusCliPath } from './claude/paths.js';
37
+ /**
38
+ * The version of the julius package this code was loaded from.
39
+ *
40
+ * Resolved from *this* module rather than the caller's: `readCurrentVersion`
41
+ * looks one level up from the module URL it's given, which lands on the package
42
+ * root for `dist/upkeep.js` but misses entirely for `dist/claude/hooks.js` and
43
+ * `dist/mcp/server.js`. Every caller asking here instead of passing its own
44
+ * `import.meta.url` is what keeps the hook and the MCP server from reading
45
+ * `0.0.0` and re-initing on every single session.
46
+ */
47
+ export function runningVersion() {
48
+ try {
49
+ return readCurrentVersion(import.meta.url);
50
+ }
51
+ catch {
52
+ return '0.0.0';
53
+ }
54
+ }
55
+ /** How long a registry answer is considered current. A day: julius ships far less
56
+ * often than that, and this is a nudge, not a security update. */
57
+ export const UPDATE_TTL_MS = 24 * 60 * 60 * 1000;
58
+ /* -------------------------------------------------------------------------- */
59
+ /* version comparison */
60
+ /* -------------------------------------------------------------------------- */
61
+ /** Numeric-dotted compare of the release part only (`1.2.3-beta.1` → `1.2.3`).
62
+ * Prerelease ordering doesn't matter here: the only question either caller asks
63
+ * is "is the thing on npm ahead of what's on disk", and a prerelease that
64
+ * compares equal simply produces no nudge. */
65
+ export function compareVersions(a, b) {
66
+ const parts = (v) => String(v).split('-')[0].split('.').map((n) => Number(n) || 0);
67
+ const pa = parts(a);
68
+ const pb = parts(b);
69
+ for (let i = 0; i < Math.max(pa.length, pb.length); i++) {
70
+ const d = (pa[i] ?? 0) - (pb[i] ?? 0);
71
+ if (d !== 0)
72
+ return d < 0 ? -1 : 1;
73
+ }
74
+ return 0;
75
+ }
76
+ export function isNewer(candidate, current) {
77
+ if (!candidate)
78
+ return false;
79
+ return compareVersions(candidate, current) > 0;
80
+ }
81
+ /** Machine-global, not per-repo: "what's the latest julius" is one fact, and a
82
+ * dev with twelve repos should cost the registry one request a day, not twelve. */
83
+ export function updateCachePath(home = homedir()) {
84
+ return join(home, '.julius', 'update-check.json');
85
+ }
86
+ export function readUpdateCache(home) {
87
+ return readJson(updateCachePath(home));
88
+ }
89
+ function writeUpdateCache(cache, home) {
90
+ try {
91
+ writeJsonAtomic(updateCachePath(home), cache);
92
+ }
93
+ catch { /* unwritable home — skip */ }
94
+ }
95
+ /**
96
+ * The `julius _update-check` command body: hit the registry, store the answer.
97
+ * Runs in a detached child so nothing user-facing ever waits on the network.
98
+ */
99
+ export function refreshUpdateCache(home, now = Date.now()) {
100
+ const res = getNpmViewVersion();
101
+ const cache = { latest: res.ok ? (res.version ?? null) : null, checkedAt: now };
102
+ writeUpdateCache(cache, home);
103
+ return cache;
104
+ }
105
+ /** True when the cached answer is missing or older than the TTL. */
106
+ export function needsRefresh(cache, now = Date.now()) {
107
+ return !cache || typeof cache.checkedAt !== 'number' || now - cache.checkedAt >= UPDATE_TTL_MS;
108
+ }
109
+ /**
110
+ * Kick off a background registry check if the cache has gone stale. Touches
111
+ * `checkedAt` first so concurrent callers (and a child that dies) don't spawn a
112
+ * fetch per invocation. Never waits, never throws.
113
+ *
114
+ * Only called from long-lived or already-slow contexts (a CLI command, MCP
115
+ * boot) — never from a hook, which reads the cache and nothing else.
116
+ */
117
+ export function maybeRefreshInBackground(home, now = Date.now(), env = process.env) {
118
+ if (env.JULIUS_UPDATE_CHECK !== '1')
119
+ return false;
120
+ const doNotTrack = env.DO_NOT_TRACK;
121
+ if (doNotTrack !== undefined && doNotTrack !== '' && doNotTrack !== '0')
122
+ return false;
123
+ const cache = readUpdateCache(home);
124
+ if (!needsRefresh(cache, now))
125
+ return false;
126
+ writeUpdateCache({ latest: cache?.latest ?? null, checkedAt: now }, home);
127
+ try {
128
+ const child = spawn(process.execPath, [juliusCliPath(), '_update-check'], {
129
+ detached: true,
130
+ stdio: 'ignore',
131
+ windowsHide: true,
132
+ });
133
+ child.unref();
134
+ return true;
135
+ }
136
+ catch {
137
+ return false; // no spawn (sandbox, ENOMEM) — the nudge just uses the old cache
138
+ }
139
+ }
140
+ /** One line, or nothing. Nothing is the common case — don't spend context on
141
+ * "you're up to date". */
142
+ export function formatUpdateNudge(current, latest) {
143
+ if (!isNewer(latest, current))
144
+ return null;
145
+ // `upgrade`, not a bare npm install: under julius it brings the julius command along.
146
+ return `⬆ ${brand()} ${current} → ${latest} available: run \`${brand()} upgrade\` (restart your agent after).`;
147
+ }
148
+ export const DEFAULT_WIRING_OPTS = { global: true, mcp: true, hooks: true, statusline: true };
149
+ /** An older stamp has no `opts`; a plain `julius init` wired everything. */
150
+ export function wiringOpts(stamp) {
151
+ return { ...DEFAULT_WIRING_OPTS, ...(stamp?.opts ?? {}) };
152
+ }
153
+ /** Under `julius/.cache/`, beside the other derived state: git-ignored, per-clone,
154
+ * and cheap to lose — a missing stamp just means one idempotent refresh. */
155
+ export function stampPath(repo) {
156
+ return join(cacheDir(repo), 'wiring-stamp.json');
157
+ }
158
+ export function readStamp(repo) {
159
+ return readJson(stampPath(repo));
160
+ }
161
+ export function writeStamp(repo, version, hosts, opts = {}, at = new Date().toISOString()) {
162
+ try {
163
+ writeJsonAtomic(stampPath(repo), {
164
+ version,
165
+ hosts: [...hosts].sort(),
166
+ opts: { ...DEFAULT_WIRING_OPTS, ...opts },
167
+ at,
168
+ });
169
+ }
170
+ catch { /* unwritable julius/ — a refresh will just be retried next session */ }
171
+ }
172
+ /**
173
+ * Which agents this repo is *already* wired for, read off disk rather than
174
+ * re-detected. Detection answers "which editors does this machine have"; for a
175
+ * refresh we need "which files did a previous init actually write" — otherwise
176
+ * installing Windsurf once would silently add julius rules to every repo.
177
+ */
178
+ export function wiredHostIds(repo) {
179
+ const ids = [];
180
+ if (existsSync(join(repo, '.julius', 'hook.cjs')) || ['julius'].some((n) => existsSync(join(repo, '.claude', 'helpers', `${n}-hooks.cjs`))))
181
+ ids.push('claude');
182
+ for (const host of HOSTS) {
183
+ // Under either name: a repo on julius has julius's files and blocks.
184
+ const wired = ['julius'].some((n) => {
185
+ const path = join(repo, hostRelPath(host, n));
186
+ if (!existsSync(path))
187
+ return false;
188
+ // A shared file (AGENTS.md, GEMINI.md) counts only if julius's fenced section
189
+ // is in it — the user may own the file for entirely unrelated reasons.
190
+ if (host.kind === 'section') {
191
+ try {
192
+ return readFileSync(path, 'utf8').includes(markersFor(n).start);
193
+ }
194
+ catch {
195
+ return false;
196
+ }
197
+ }
198
+ return true;
199
+ });
200
+ if (wired)
201
+ ids.push(host.id);
202
+ }
203
+ return ids;
204
+ }
205
+ /**
206
+ * Re-run init's writes when the stamp and the running binary disagree.
207
+ *
208
+ * Deliberately narrow: it refreshes the hosts already wired, replays the flags
209
+ * that init was given, never builds the graph (this runs at session start — a
210
+ * rebuild there would stall the agent's first turn), and no-ops when the repo has
211
+ * no julius wiring at all.
212
+ *
213
+ * `toJulius` says whether this repo should move from julius's wiring to julius's
214
+ * (see upkeep-run.ts). When it should, the refresh runs whatever the stamp says:
215
+ * the person installed julius, which is the signal, whether or not julius's own
216
+ * version moved.
217
+ */
218
+ export function reconcileWiring(repo, current, deps) {
219
+ try {
220
+ const stamp = readStamp(repo);
221
+ const toJulius = deps.toJulius?.(repo) ?? false;
222
+ if (stamp && stamp.version === current && !toJulius)
223
+ return null;
224
+ // The stamp is the record of *intent* (what the picker chose); disk is the
225
+ // fallback for repos wired before stamps existed. Union, not just disk:
226
+ // otherwise a host whose rule file went missing — deleted by hand, lost to a
227
+ // merge, or clobbered by another tool — is silently dropped from every future
228
+ // refresh, and that file is precisely what a refresh exists to restore.
229
+ const onDisk = (deps.wired ?? wiredHostIds)(repo);
230
+ const hosts = [...new Set([...(stamp?.hosts ?? []), ...onDisk])].sort();
231
+ if (hosts.length === 0)
232
+ return null; // never wired here — not our business
233
+ const opts = wiringOpts(stamp);
234
+ deps.rewrite(repo, hosts, opts, toJulius);
235
+ writeStamp(repo, current, hosts, opts);
236
+ return { from: stamp?.version ?? 'unwired', to: current, hosts, global: opts.global, ...(toJulius ? { switched: true } : {}) };
237
+ }
238
+ catch {
239
+ return null; // a refresh is an optimization; never fail the caller over it
240
+ }
241
+ }
242
+ export function formatWiringRefresh(r) {
243
+ if (!r)
244
+ return null;
245
+ // Said to the agent at session start, which is who can tell the person.
246
+ if (r.switched)
247
+ return (`[julius] julius is now julius, and this repo just moved to it: the same commands under the new name, plus learnings in .julius/learnings/ that the whole team shares. ` +
248
+ `julius is reading the user's past Claude sessions here in the background, and what it learns is there from the next session. ` +
249
+ `Tell the user this once, in a line at the end of your first reply, and that committing .julius/ and .claude/settings.json once moves their team over too.`);
250
+ // Name the out-of-repo writes explicitly: those are machine-wide and shared by
251
+ // every repo, so a user seeing this line should not have to guess what moved.
252
+ const scope = r.global && r.hosts.includes('agents') ? " (including this machine's ~/.codex config)" : '';
253
+ return `· julius refreshed this repo's agent wiring${scope} (written by ${r.from}, now ${r.to}): ${r.hosts.join(', ')}.`;
254
+ }
255
+ //# sourceMappingURL=upkeep.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"upkeep.js","sourceRoot":"","sources":["../src/upkeep.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;GAyBG;AACH,OAAO,EAAE,UAAU,EAAE,YAAY,EAAE,MAAM,SAAS,CAAC;AACnD,OAAO,EAAE,KAAK,EAAE,MAAM,oBAAoB,CAAC;AAC3C,OAAO,EAAE,IAAI,EAAE,MAAM,WAAW,CAAC;AACjC,OAAO,EAAE,OAAO,EAAE,MAAM,SAAS,CAAC;AAClC,OAAO,EAAE,QAAQ,EAAE,eAAe,EAAE,QAAQ,EAAE,MAAM,iBAAiB,CAAC;AACtE,OAAO,EAAE,KAAK,EAAE,WAAW,EAAE,MAAM,qBAAqB,CAAC;AACzD,OAAO,EAAE,UAAU,EAAE,MAAM,qBAAqB,CAAC;AACjD,OAAO,EAAE,iBAAiB,EAAE,kBAAkB,EAAE,MAAM,eAAe,CAAC;AACtE,OAAO,EAAE,KAAK,EAAE,MAAM,YAAY,CAAC;AACnC,OAAO,EAAE,aAAa,EAAE,MAAM,mBAAmB,CAAC;AAElD;;;;;;;;;GASG;AACH,MAAM,UAAU,cAAc;IAC5B,IAAI,CAAC;QAAC,OAAO,kBAAkB,CAAC,OAAO,IAAI,CAAC,GAAG,CAAC,CAAC;IAAC,CAAC;IAAC,MAAM,CAAC;QAAC,OAAO,OAAO,CAAC;IAAC,CAAC;AAC/E,CAAC;AAED;kEACkE;AAClE,MAAM,CAAC,MAAM,aAAa,GAAG,EAAE,GAAG,EAAE,GAAG,EAAE,GAAG,IAAI,CAAC;AAEjD,gFAAgF;AAChF,gFAAgF;AAChF,gFAAgF;AAEhF;;;8CAG8C;AAC9C,MAAM,UAAU,eAAe,CAAC,CAAS,EAAE,CAAS;IAClD,MAAM,KAAK,GAAG,CAAC,CAAS,EAAE,EAA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ourceMappingURL=browser.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"browser.d.ts","sourceRoot":"","sources":["../../src/util/browser.ts"],"names":[],"mappings":"AAEA,uFAAuF;AACvF,wBAAgB,WAAW,CAAC,GAAG,EAAE,MAAM,GAAG,IAAI,CAQ7C"}
@@ -0,0 +1,14 @@
1
+ import { spawn } from "node:child_process";
2
+ /** Open `url` in the default browser. Best-effort: the printed URL is the fallback. */
3
+ export function openBrowser(url) {
4
+ if (process.env.JULIUS_NO_BROWSER)
5
+ return;
6
+ const opener = process.platform === "darwin" ? "open" : process.platform === "win32" ? "start" : "xdg-open";
7
+ try {
8
+ spawn(opener, [url], { stdio: "ignore", detached: true, shell: process.platform === "win32" }).unref();
9
+ }
10
+ catch {
11
+ /* the printed URL is the fallback */
12
+ }
13
+ }
14
+ //# sourceMappingURL=browser.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"browser.js","sourceRoot":"","sources":["../../src/util/browser.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,EAAE,MAAM,oBAAoB,CAAC;AAE3C,uFAAuF;AACvF,MAAM,UAAU,WAAW,CAAC,GAAW;IACrC,IAAI,OAAO,CAAC,GAAG,CAAC,iBAAiB;QAAE,OAAO;IAC1C,MAAM,MAAM,GAAG,OAAO,CAAC,QAAQ,KAAK,QAAQ,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,OAAO,CAAC,QAAQ,KAAK,OAAO,CAAC,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,UAAU,CAAC;IAC5G,IAAI,CAAC;QACH,KAAK,CAAC,MAAM,EAAE,CAAC,GAAG,CAAC,EAAE,EAAE,KAAK,EAAE,QAAQ,EAAE,QAAQ,EAAE,IAAI,EAAE,KAAK,EAAE,OAAO,CAAC,QAAQ,KAAK,OAAO,EAAE,CAAC,CAAC,KAAK,EAAE,CAAC;IACzG,CAAC;IAAC,MAAM,CAAC;QACP,qCAAqC;IACvC,CAAC;AACH,CAAC"}
@@ -0,0 +1,19 @@
1
+ /**
2
+ * Front matter, YAML only.
3
+ *
4
+ * gray-matter picks its parser from the opening fence: `---js` or
5
+ * `---javascript` front matter is run through `eval`. Every file read here
6
+ * comes from a repo — a learning committed by a teammate or sitting on their
7
+ * pushed branch, a skill, a julius/ card — so a file that opened with `---js`
8
+ * would run its code on whoever reads it. Here those fences parse as empty
9
+ * front matter instead: nothing runs, and the file reads as having none (a
10
+ * learning without a title, a card without a slug), which every caller
11
+ * already skips.
12
+ */
13
+ import grayMatter from "gray-matter";
14
+ export type FrontMatterFile = grayMatter.GrayMatterFile<string>;
15
+ /** gray-matter's parse with YAML only, and its `stringify`, which writes YAML. */
16
+ export declare const matter: ((text: string) => FrontMatterFile) & {
17
+ stringify: typeof grayMatter.stringify;
18
+ };
19
+ //# sourceMappingURL=front-matter.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"front-matter.d.ts","sourceRoot":"","sources":["../../src/util/front-matter.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;GAWG;AACH,OAAO,UAAU,MAAM,aAAa,CAAC;AAErC,MAAM,MAAM,eAAe,GAAG,UAAU,CAAC,cAAc,CAAC,MAAM,CAAC,CAAC;AAMhE,kFAAkF;AAClF,eAAO,MAAM,MAAM,UAAwB,MAAM,KAAG,eAAe;;CAEjE,CAAC"}
@@ -0,0 +1,21 @@
1
+ /**
2
+ * Front matter, YAML only.
3
+ *
4
+ * gray-matter picks its parser from the opening fence: `---js` or
5
+ * `---javascript` front matter is run through `eval`. Every file read here
6
+ * comes from a repo — a learning committed by a teammate or sitting on their
7
+ * pushed branch, a skill, a julius/ card — so a file that opened with `---js`
8
+ * would run its code on whoever reads it. Here those fences parse as empty
9
+ * front matter instead: nothing runs, and the file reads as having none (a
10
+ * learning without a title, a card without a slug), which every caller
11
+ * already skips.
12
+ */
13
+ import grayMatter from "gray-matter";
14
+ const nothing = () => ({});
15
+ // gray-matter looks an engine up by the fence's own spelling, then by its alias.
16
+ const CODE_ENGINES = { js: nothing, javascript: nothing, coffee: nothing, coffeescript: nothing, cson: nothing };
17
+ /** gray-matter's parse with YAML only, and its `stringify`, which writes YAML. */
18
+ export const matter = Object.assign((text) => grayMatter(text, { engines: CODE_ENGINES }), {
19
+ stringify: grayMatter.stringify,
20
+ });
21
+ //# sourceMappingURL=front-matter.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"front-matter.js","sourceRoot":"","sources":["../../src/util/front-matter.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;GAWG;AACH,OAAO,UAAU,MAAM,aAAa,CAAC;AAIrC,MAAM,OAAO,GAAG,GAAW,EAAE,CAAC,CAAC,EAAE,CAAC,CAAC;AACnC,iFAAiF;AACjF,MAAM,YAAY,GAAG,EAAE,EAAE,EAAE,OAAO,EAAE,UAAU,EAAE,OAAO,EAAE,MAAM,EAAE,OAAO,EAAE,YAAY,EAAE,OAAO,EAAE,IAAI,EAAE,OAAO,EAAE,CAAC;AAEjH,kFAAkF;AAClF,MAAM,CAAC,MAAM,MAAM,GAAG,MAAM,CAAC,MAAM,CAAC,CAAC,IAAY,EAAmB,EAAE,CAAC,UAAU,CAAC,IAAI,EAAE,EAAE,OAAO,EAAE,YAAY,EAAE,CAAC,EAAE;IAClH,SAAS,EAAE,UAAU,CAAC,SAAS;CAChC,CAAC,CAAC"}
@@ -0,0 +1,7 @@
1
+ /** Generate a random unique id with a short type prefix, e.g. "node_ab12…". */
2
+ export declare function newId(prefix: string): string;
3
+ /** Stable content hash (sha256, hex) used for document dedup. */
4
+ export declare function contentHash(input: string): string;
5
+ /** Normalize a name/alias for case- and whitespace-insensitive matching. */
6
+ export declare function normalizeName(name: string): string;
7
+ //# sourceMappingURL=id.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"id.d.ts","sourceRoot":"","sources":["../../src/util/id.ts"],"names":[],"mappings":"AAEA,+EAA+E;AAC/E,wBAAgB,KAAK,CAAC,MAAM,EAAE,MAAM,GAAG,MAAM,CAE5C;AAED,iEAAiE;AACjE,wBAAgB,WAAW,CAAC,KAAK,EAAE,MAAM,GAAG,MAAM,CAEjD;AAED,4EAA4E;AAC5E,wBAAgB,aAAa,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM,CAElD"}
@@ -0,0 +1,14 @@
1
+ import { randomUUID, createHash } from "node:crypto";
2
+ /** Generate a random unique id with a short type prefix, e.g. "node_ab12…". */
3
+ export function newId(prefix) {
4
+ return `${prefix}_${randomUUID().replace(/-/g, "").slice(0, 20)}`;
5
+ }
6
+ /** Stable content hash (sha256, hex) used for document dedup. */
7
+ export function contentHash(input) {
8
+ return createHash("sha256").update(input).digest("hex");
9
+ }
10
+ /** Normalize a name/alias for case- and whitespace-insensitive matching. */
11
+ export function normalizeName(name) {
12
+ return name.trim().toLowerCase().replace(/\s+/g, " ");
13
+ }
14
+ //# sourceMappingURL=id.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"id.js","sourceRoot":"","sources":["../../src/util/id.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,UAAU,EAAE,MAAM,aAAa,CAAC;AAErD,+EAA+E;AAC/E,MAAM,UAAU,KAAK,CAAC,MAAc;IAClC,OAAO,GAAG,MAAM,IAAI,UAAU,EAAE,CAAC,OAAO,CAAC,IAAI,EAAE,EAAE,CAAC,CAAC,KAAK,CAAC,CAAC,EAAE,EAAE,CAAC,EAAE,CAAC;AACpE,CAAC;AAED,iEAAiE;AACjE,MAAM,UAAU,WAAW,CAAC,KAAa;IACvC,OAAO,UAAU,CAAC,QAAQ,CAAC,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC;AAC1D,CAAC;AAED,4EAA4E;AAC5E,MAAM,UAAU,aAAa,CAAC,IAAY;IACxC,OAAO,IAAI,CAAC,IAAI,EAAE,CAAC,WAAW,EAAE,CAAC,OAAO,CAAC,MAAM,EAAE,GAAG,CAAC,CAAC;AACxD,CAAC"}
@@ -0,0 +1,29 @@
1
+ /** Platform separators → `/`. Identity on posix. */
2
+ export declare function toPosixPath(p: string): string;
3
+ /**
4
+ * `relative(from, to)`, normalized to posix — the canonical form of every path
5
+ * julius stores. Use this rather than bare `relative` for anything that lands in
6
+ * the graph, a cache key, or a manifest. Bare `relative` is still right for
7
+ * text shown in the terminal, where a native separator is what the platform's
8
+ * users expect.
9
+ */
10
+ export declare function relPosix(from: string, to: string): string;
11
+ /**
12
+ * Trailing `/` off a repo-relative path, in linear time.
13
+ *
14
+ * The obvious `replace(/\/+$/, "")` is a polynomial-ReDoS shape — `\/+$` can begin
15
+ * matching at any point inside a run of slashes, so a path ending in many slashes
16
+ * and then anything else costs O(n²). CodeQL flags it (`js/polynomial-redos`), and
17
+ * rightly: these inputs are a `--dir` or `--in` value rather than anything
18
+ * attacker-controlled, but the ambiguity buys nothing and a loop is both faster
19
+ * and plainer.
20
+ */
21
+ export declare function stripTrailingSlashes(path: string): string;
22
+ /**
23
+ * Normalize a user-supplied path prefix (`--in`) so it can be compared against
24
+ * a stored `node.path`: posix separators, no leading `./`, no trailing
25
+ * separator. Windows users type — and their shell's tab-completion produces —
26
+ * `--in server\src\gpu`, so both separators have to reduce to the same prefix.
27
+ */
28
+ export declare function normalizePathPrefix(p: string): string;
29
+ //# sourceMappingURL=paths.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"paths.d.ts","sourceRoot":"","sources":["../../src/util/paths.ts"],"names":[],"mappings":"AA2BA,oDAAoD;AACpD,wBAAgB,WAAW,CAAC,CAAC,EAAE,MAAM,GAAG,MAAM,CAE7C;AAED;;;;;;GAMG;AACH,wBAAgB,QAAQ,CAAC,IAAI,EAAE,MAAM,EAAE,EAAE,EAAE,MAAM,GAAG,MAAM,CAEzD;AAED;;;;;;;;;GASG;AACH,wBAAgB,oBAAoB,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM,CAIzD;AAED;;;;;GAKG;AACH,wBAAgB,mBAAmB,CAAC,CAAC,EAAE,MAAM,GAAG,MAAM,CAMrD"}
@@ -0,0 +1,71 @@
1
+ /**
2
+ * Repo-relative paths, always posix.
3
+ *
4
+ * Every path julius stores — node ids, `node.path`, extract-cache keys, the
5
+ * freshness fingerprint, the card manifest — is repo-relative and separated by
6
+ * `/` on every platform. That is not cosmetic: the query layer parses these
7
+ * strings with `/` as the separator, and does it by hand rather than through
8
+ * `node:path`. `pathUnderPrefix` (`--in` scoping) tests
9
+ * `startsWith(`${prefix}/`)`, `map`'s `dirKey` splits on `/` to cluster by
10
+ * directory, `resolveSymbol` matches a filename query with
11
+ * `endsWith("/" + query)`. Hand any of them a `src\gate.ts` and none of them
12
+ * error — they match nothing, silently. On Windows that made every `--in`
13
+ * report "nothing indexed under …" and made `map` emit one single-file
14
+ * "directory" per file.
15
+ *
16
+ * So normalize once, here, where a path is *created*, instead of defensively at
17
+ * each consumer — a consumer that forgets is a silent wrong answer, and there
18
+ * are more consumers than producers.
19
+ *
20
+ * {@link toPosixPath} splits on the platform `sep`, never a literal `\`: a
21
+ * posix filename may legitimately contain a backslash, and splitting on `"\\"`
22
+ * would corrupt it. That also makes this module provably the identity function
23
+ * on posix, which is what guarantees an existing Mac/Linux graph is byte-identical
24
+ * across this change.
25
+ */
26
+ import { relative, sep } from "node:path";
27
+ /** Platform separators → `/`. Identity on posix. */
28
+ export function toPosixPath(p) {
29
+ return sep === "/" ? p : p.split(sep).join("/");
30
+ }
31
+ /**
32
+ * `relative(from, to)`, normalized to posix — the canonical form of every path
33
+ * julius stores. Use this rather than bare `relative` for anything that lands in
34
+ * the graph, a cache key, or a manifest. Bare `relative` is still right for
35
+ * text shown in the terminal, where a native separator is what the platform's
36
+ * users expect.
37
+ */
38
+ export function relPosix(from, to) {
39
+ return toPosixPath(relative(from, to));
40
+ }
41
+ /**
42
+ * Trailing `/` off a repo-relative path, in linear time.
43
+ *
44
+ * The obvious `replace(/\/+$/, "")` is a polynomial-ReDoS shape — `\/+$` can begin
45
+ * matching at any point inside a run of slashes, so a path ending in many slashes
46
+ * and then anything else costs O(n²). CodeQL flags it (`js/polynomial-redos`), and
47
+ * rightly: these inputs are a `--dir` or `--in` value rather than anything
48
+ * attacker-controlled, but the ambiguity buys nothing and a loop is both faster
49
+ * and plainer.
50
+ */
51
+ export function stripTrailingSlashes(path) {
52
+ let end = path.length;
53
+ while (end > 0 && path[end - 1] === "/")
54
+ end--;
55
+ return path.slice(0, end);
56
+ }
57
+ /**
58
+ * Normalize a user-supplied path prefix (`--in`) so it can be compared against
59
+ * a stored `node.path`: posix separators, no leading `./`, no trailing
60
+ * separator. Windows users type — and their shell's tab-completion produces —
61
+ * `--in server\src\gpu`, so both separators have to reduce to the same prefix.
62
+ */
63
+ export function normalizePathPrefix(p) {
64
+ let out = toPosixPath(p);
65
+ while (out.startsWith("./"))
66
+ out = out.slice(2);
67
+ // Trailing separators only; a bare "/" normalizes to "" (match everything),
68
+ // which is exactly how `pathUnderPrefix` reads an empty prefix.
69
+ return stripTrailingSlashes(out);
70
+ }
71
+ //# sourceMappingURL=paths.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"paths.js","sourceRoot":"","sources":["../../src/util/paths.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;GAwBG;AACH,OAAO,EAAE,QAAQ,EAAE,GAAG,EAAE,MAAM,WAAW,CAAC;AAE1C,oDAAoD;AACpD,MAAM,UAAU,WAAW,CAAC,CAAS;IACnC,OAAO,GAAG,KAAK,GAAG,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;AAClD,CAAC;AAED;;;;;;GAMG;AACH,MAAM,UAAU,QAAQ,CAAC,IAAY,EAAE,EAAU;IAC/C,OAAO,WAAW,CAAC,QAAQ,CAAC,IAAI,EAAE,EAAE,CAAC,CAAC,CAAC;AACzC,CAAC;AAED;;;;;;;;;GASG;AACH,MAAM,UAAU,oBAAoB,CAAC,IAAY;IAC/C,IAAI,GAAG,GAAG,IAAI,CAAC,MAAM,CAAC;IACtB,OAAO,GAAG,GAAG,CAAC,IAAI,IAAI,CAAC,GAAG,GAAG,CAAC,CAAC,KAAK,GAAG;QAAE,GAAG,EAAE,CAAC;IAC/C,OAAO,IAAI,CAAC,KAAK,CAAC,CAAC,EAAE,GAAG,CAAC,CAAC;AAC5B,CAAC;AAED;;;;;GAKG;AACH,MAAM,UAAU,mBAAmB,CAAC,CAAS;IAC3C,IAAI,GAAG,GAAG,WAAW,CAAC,CAAC,CAAC,CAAC;IACzB,OAAO,GAAG,CAAC,UAAU,CAAC,IAAI,CAAC;QAAE,GAAG,GAAG,GAAG,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC;IAChD,4EAA4E;IAC5E,gEAAgE;IAChE,OAAO,oBAAoB,CAAC,GAAG,CAAC,CAAC;AACnC,CAAC"}
@@ -0,0 +1,4 @@
1
+ /** Read source text, decoding Windows tooling's common UTF-16LE output. UTF-16BE
2
+ * is rare and unsupported by Node's built-in decoders, so callers silently skip it. */
3
+ export declare function readSourceFile(path: string): string | null;
4
+ //# sourceMappingURL=source.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"source.d.ts","sourceRoot":"","sources":["../../src/util/source.ts"],"names":[],"mappings":"AAEA;uFACuF;AACvF,wBAAgB,cAAc,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM,GAAG,IAAI,CAK1D"}
@@ -0,0 +1,12 @@
1
+ import { readFileSync } from "node:fs";
2
+ /** Read source text, decoding Windows tooling's common UTF-16LE output. UTF-16BE
3
+ * is rare and unsupported by Node's built-in decoders, so callers silently skip it. */
4
+ export function readSourceFile(path) {
5
+ const bytes = readFileSync(path);
6
+ if (bytes[0] === 0xfe && bytes[1] === 0xff)
7
+ return null;
8
+ if (bytes[0] === 0xff && bytes[1] === 0xfe)
9
+ return bytes.subarray(2).toString("utf16le");
10
+ return bytes.toString("utf8");
11
+ }
12
+ //# sourceMappingURL=source.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"source.js","sourceRoot":"","sources":["../../src/util/source.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,SAAS,CAAC;AAEvC;uFACuF;AACvF,MAAM,UAAU,cAAc,CAAC,IAAY;IACzC,MAAM,KAAK,GAAG,YAAY,CAAC,IAAI,CAAC,CAAC;IACjC,IAAI,KAAK,CAAC,CAAC,CAAC,KAAK,IAAI,IAAI,KAAK,CAAC,CAAC,CAAC,KAAK,IAAI;QAAE,OAAO,IAAI,CAAC;IACxD,IAAI,KAAK,CAAC,CAAC,CAAC,KAAK,IAAI,IAAI,KAAK,CAAC,CAAC,CAAC,KAAK,IAAI;QAAE,OAAO,KAAK,CAAC,QAAQ,CAAC,CAAC,CAAC,CAAC,QAAQ,CAAC,SAAS,CAAC,CAAC;IACzF,OAAO,KAAK,CAAC,QAAQ,CAAC,MAAM,CAAC,CAAC;AAChC,CAAC"}
@@ -0,0 +1,15 @@
1
+ export interface Spinner {
2
+ /** Change the text after the frame. */
3
+ update(text: string): void;
4
+ /** Print a finished line above the spinner, which keeps spinning below it. */
5
+ print(line: string): void;
6
+ /** Erase the line and stop. Safe to call more than once. */
7
+ stop(): void;
8
+ readonly active: boolean;
9
+ }
10
+ export declare function startSpinner(text: string, opts?: {
11
+ stream?: NodeJS.WriteStream;
12
+ enabled?: boolean;
13
+ intervalMs?: number;
14
+ }): Spinner;
15
+ //# sourceMappingURL=spinner.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"spinner.d.ts","sourceRoot":"","sources":["../../src/util/spinner.ts"],"names":[],"mappings":"AASA,MAAM,WAAW,OAAO;IACtB,uCAAuC;IACvC,MAAM,CAAC,IAAI,EAAE,MAAM,GAAG,IAAI,CAAC;IAC3B,8EAA8E;IAC9E,KAAK,CAAC,IAAI,EAAE,MAAM,GAAG,IAAI,CAAC;IAC1B,4DAA4D;IAC5D,IAAI,IAAI,IAAI,CAAC;IACb,QAAQ,CAAC,MAAM,EAAE,OAAO,CAAC;CAC1B;AAED,wBAAgB,YAAY,CAC1B,IAAI,EAAE,MAAM,EACZ,IAAI,GAAE;IAAE,MAAM,CAAC,EAAE,MAAM,CAAC,WAAW,CAAC;IAAC,OAAO,CAAC,EAAE,OAAO,CAAC;IAAC,UAAU,CAAC,EAAE,MAAM,CAAA;CAAO,GACjF,OAAO,CAwCT"}
@@ -0,0 +1,52 @@
1
+ /**
2
+ * One line that redraws in place while something runs, and is erased when it
3
+ * stops — so nothing interactive is left in the scrollback.
4
+ *
5
+ * Only on a TTY. Anywhere else every method is a no-op, and the caller prints
6
+ * whatever finished lines it wants a log to keep.
7
+ */
8
+ const FRAMES = ["⠋", "⠙", "⠹", "⠸", "⠼", "⠴", "⠦", "⠧", "⠇", "⠏"];
9
+ export function startSpinner(text, opts = {}) {
10
+ const out = opts.stream ?? process.stderr;
11
+ const enabled = opts.enabled ?? Boolean(out.isTTY);
12
+ if (!enabled) {
13
+ return { update() { }, print: (line) => out.write(`${line}\n`), stop() { }, active: false };
14
+ }
15
+ let current = text;
16
+ let frame = 0;
17
+ let stopped = false;
18
+ const width = () => Math.max(20, (out.columns || 100) - 1);
19
+ const draw = () => {
20
+ if (stopped)
21
+ return;
22
+ const line = `${FRAMES[frame % FRAMES.length]} ${current}`;
23
+ out.write(`\r\x1b[2K${line.length > width() ? line.slice(0, width()) : line}`);
24
+ frame++;
25
+ };
26
+ const clear = () => out.write("\r\x1b[2K");
27
+ draw();
28
+ const timer = setInterval(draw, opts.intervalMs ?? 80);
29
+ timer.unref?.();
30
+ return {
31
+ get active() {
32
+ return !stopped;
33
+ },
34
+ update(next) {
35
+ current = next;
36
+ draw();
37
+ },
38
+ print(line) {
39
+ clear();
40
+ out.write(`${line}\n`);
41
+ draw();
42
+ },
43
+ stop() {
44
+ if (stopped)
45
+ return;
46
+ stopped = true;
47
+ clearInterval(timer);
48
+ clear();
49
+ },
50
+ };
51
+ }
52
+ //# sourceMappingURL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