@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
@@ -0,0 +1,33 @@
1
+ /**
2
+ * Claude Code session state. The shared `julius/.cache/` pieces (the statusline's
3
+ * `Stats` snapshot and the build lock) live in `../util/state.js` so the graph's
4
+ * pre-query auto-refresh can take the same lock; they are re-exported here so
5
+ * every existing import path keeps working.
6
+ */
7
+ import { readdirSync } from 'node:fs';
8
+ import { join } from 'node:path';
9
+ import { cacheDir, readJson, writeJsonAtomic } from '../util/state.js';
10
+ export { LOCK_STALE_MS, acquireLock, acquireLockIn, releaseLockIn, cacheDir, emptyStats, patchStats, readStats, releaseLock, resolveContextDir, writeJsonAtomic, writeStats, } from '../util/state.js';
11
+ function emptySession() {
12
+ return { lastQuery: null, perAgentQuery: {}, juliusReads: 0, sourceReads: 0, savedTokens: 0, injectedPointers: [], nudges: 0 };
13
+ }
14
+ /** The per-repo session directory holding one `<id>.json` per agent session. */
15
+ export function sessionDir(d) { return join(cacheDir(d), 'session'); }
16
+ function sessionPath(d, id) { return join(sessionDir(d), `${id}.json`); }
17
+ /** Every session id with a file on disk, or `[]` when none exist (never throws).
18
+ * Shared by the telemetry rollup and `julius stats` so they agree on the set. */
19
+ export function listSessionIds(d) {
20
+ try {
21
+ return readdirSync(sessionDir(d)).filter((f) => f.endsWith('.json')).map((f) => f.slice(0, -'.json'.length));
22
+ }
23
+ catch {
24
+ return [];
25
+ }
26
+ }
27
+ export function readSession(d, id) {
28
+ return readJson(sessionPath(d, id)) ?? emptySession();
29
+ }
30
+ export function writeSession(d, id, s) {
31
+ writeJsonAtomic(sessionPath(d, id), s);
32
+ }
33
+ //# sourceMappingURL=state.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"state.js","sourceRoot":"","sources":["../../src/claude/state.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AACH,OAAO,EAAE,WAAW,EAAE,MAAM,SAAS,CAAC;AACtC,OAAO,EAAE,IAAI,EAAE,MAAM,WAAW,CAAC;AACjC,OAAO,EAAE,QAAQ,EAAE,QAAQ,EAAE,eAAe,EAAE,MAAM,kBAAkB,CAAC;AAGvE,OAAO,EACL,aAAa,EACb,WAAW,EACX,aAAa,EACb,aAAa,EACb,QAAQ,EACR,UAAU,EACV,UAAU,EACV,SAAS,EACT,WAAW,EACX,iBAAiB,EACjB,eAAe,EACf,UAAU,GACX,MAAM,kBAAkB,CAAC;AAi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,5 @@
1
+ import type { GraphV1 } from '../graph/types.js';
2
+ import type { Stats } from './state.js';
3
+ export declare function readWiring(projectDir: string): GraphV1 | null;
4
+ export declare function computeStats(w: GraphV1): Pick<Stats, 'nodeCount' | 'edgeCount' | 'languages' | 'totalCount' | 'readyCount'>;
5
+ //# sourceMappingURL=stats.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"stats.d.ts","sourceRoot":"","sources":["../../src/claude/stats.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,mBAAmB,CAAC;AACjD,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,YAAY,CAAC;AAGxC,wBAAgB,UAAU,CAAC,UAAU,EAAE,MAAM,GAAG,OAAO,GAAG,IAAI,CAI7D;AAED,wBAAgB,YAAY,CAC1B,CAAC,EAAE,OAAO,GACT,IAAI,CAAC,KAAK,EAAE,WAAW,GAAG,WAAW,GAAG,WAAW,GAAG,YAAY,GAAG,YAAY,CAAC,CAWpF"}
@@ -0,0 +1,24 @@
1
+ import { readFileSync } from 'node:fs';
2
+ import { join } from 'node:path';
3
+ import { resolveContextDir } from '../util/state.js';
4
+ export function readWiring(projectDir) {
5
+ try {
6
+ return JSON.parse(readFileSync(join(resolveContextDir(projectDir), '.graph', 'wiring.json'), 'utf8'));
7
+ }
8
+ catch {
9
+ return null;
10
+ }
11
+ }
12
+ export function computeStats(w) {
13
+ const nodes = w.nodes ?? [];
14
+ const edges = w.edges ?? [];
15
+ const readyCount = nodes.filter((n) => n.summary_state === 'ready').length;
16
+ return {
17
+ nodeCount: w.meta?.nodeCount ?? nodes.length,
18
+ edgeCount: w.meta?.edgeCount ?? edges.length,
19
+ languages: w.meta?.languages ?? [],
20
+ totalCount: nodes.length,
21
+ readyCount,
22
+ };
23
+ }
24
+ //# sourceMappingURL=stats.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"stats.js","sourceRoot":"","sources":["../../src/claude/stats.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,SAAS,CAAC;AACvC,OAAO,EAAE,IAAI,EAAE,MAAM,WAAW,CAAC;AAGjC,OAAO,EAAE,iBAAiB,EAAE,MAAM,kBAAkB,CAAC;AAErD,MAAM,UAAU,UAAU,CAAC,UAAkB;IAC3C,IAAI,CAAC;QACH,OAAO,IAAI,CAAC,KAAK,CAAC,YAAY,CAAC,IAAI,CAAC,iBAAiB,CAAC,UAAU,CAAC,EAAE,QAAQ,EAAE,aAAa,CAAC,EAAE,MAAM,CAAC,CAAY,CAAC;IACnH,CAAC;IAAC,MAAM,CAAC;QAAC,OAAO,IAAI,CAAC;IAAC,CAAC;AAC1B,CAAC;AAED,MAAM,UAAU,YAAY,CAC1B,CAAU;IAEV,MAAM,KAAK,GAAG,CAAC,CAAC,KAAK,IAAI,EAAE,CAAC;IAC5B,MAAM,KAAK,GAAG,CAAC,CAAC,KAAK,IAAI,EAAE,CAAC;IAC5B,MAAM,UAAU,GAAG,KAAK,CAAC,MAAM,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,aAAa,KAAK,OAAO,CAAC,CAAC,MAAM,CAAC;IAC3E,OAAO;QACL,SAAS,EAAE,CAAC,CAAC,IAAI,EAAE,SAAS,IAAI,KAAK,CAAC,MAAM;QAC5C,SAAS,EAAE,CAAC,CAAC,IAAI,EAAE,SAAS,IAAI,KAAK,CAAC,MAAM;QAC5C,SAAS,EAAE,CAAC,CAAC,IAAI,EAAE,SAAS,IAAI,EAAE;QAClC,UAAU,EAAE,KAAK,CAAC,MAAM;QACxB,UAAU;KACX,CAAC;AACJ,CAAC"}
@@ -0,0 +1,14 @@
1
+ import { type Stats } from './state.js';
2
+ /**
3
+ * The statusline's fast path is the hook-maintained cache (julius/.cache/stats.json).
4
+ * When it's absent — a fresh checkout, or a plain `julius build` that doesn't write the
5
+ * cache — fall back to reading the graph itself (wiring.json) so the bar reflects reality
6
+ * immediately instead of showing "not built". An empty wiring.json is still a graph
7
+ * (docs-only repos legitimately have 0 nodes); "not built" is only when the artifact
8
+ * is missing. The graph carries no drift signal, so it reads as synced until the next
9
+ * edit repopulates the cache. Still a pure read (no subprocess): the cache is preferred
10
+ * because it carries live dirty/stale state.
11
+ */
12
+ export declare function resolveStats(dir: string): Stats | null;
13
+ export declare function main(): void;
14
+ //# sourceMappingURL=statusline.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"statusline.d.ts","sourceRoot":"","sources":["../../src/claude/statusline.ts"],"names":[],"mappings":"AAEA,OAAO,EAAsC,KAAK,KAAK,EAAE,MAAM,YAAY,CAAC;AAK5E;;;;;;;;;GASG;AACH,wBAAgB,YAAY,CAAC,GAAG,EAAE,MAAM,GAAG,KAAK,GAAG,IAAI,CAMtD;AAED,wBAAgB,IAAI,IAAI,IAAI,CAY3B"}
@@ -0,0 +1,45 @@
1
+ import { readFileSync } from 'node:fs';
2
+ import { renderStatusline, renderSubagent } from './format.js';
3
+ import { readStats, readSession, emptyStats } from './state.js';
4
+ import { readWiring, computeStats } from './stats.js';
5
+ import { adoptRepoBrand } from '../brand.js';
6
+ import { noteCount } from '../notes/home.js';
7
+ /**
8
+ * The statusline's fast path is the hook-maintained cache (julius/.cache/stats.json).
9
+ * When it's absent — a fresh checkout, or a plain `julius build` that doesn't write the
10
+ * cache — fall back to reading the graph itself (wiring.json) so the bar reflects reality
11
+ * immediately instead of showing "not built". An empty wiring.json is still a graph
12
+ * (docs-only repos legitimately have 0 nodes); "not built" is only when the artifact
13
+ * is missing. The graph carries no drift signal, so it reads as synced until the next
14
+ * edit repopulates the cache. Still a pure read (no subprocess): the cache is preferred
15
+ * because it carries live dirty/stale state.
16
+ */
17
+ export function resolveStats(dir) {
18
+ const cached = readStats(dir);
19
+ if (cached && cached.nodeCount > 0)
20
+ return cached;
21
+ const wiring = readWiring(dir);
22
+ if (wiring)
23
+ return { ...emptyStats(), ...computeStats(wiring) };
24
+ return null;
25
+ }
26
+ export function main() {
27
+ let input = {};
28
+ try {
29
+ input = JSON.parse(readFileSync(0, 'utf8'));
30
+ }
31
+ catch { /* no/invalid stdin */ }
32
+ const dir = process.env.CLAUDE_PROJECT_DIR || input.cwd || process.cwd();
33
+ adoptRepoBrand(dir);
34
+ const session = readSession(dir, input.session_id || 'default');
35
+ const agent = input?.agent?.name;
36
+ if (agent) {
37
+ process.stdout.write(renderSubagent(agent, session));
38
+ return;
39
+ }
40
+ const stats = resolveStats(dir);
41
+ const raw = input?.context_window?.used_percentage;
42
+ const ctxPct = typeof raw === 'number' ? Math.round(raw) : null;
43
+ process.stdout.write(renderStatusline(stats, session, { ctxPct, notes: noteCount(dir) }).join('\n'));
44
+ }
45
+ //# sourceMappingURL=statusline.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"statusline.js","sourceRoot":"","sources":["../../src/claude/statusline.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,SAAS,CAAC;AACvC,OAAO,EAAE,gBAAgB,EAAE,cAAc,EAAE,MAAM,aAAa,CAAC;AAC/D,OAAO,EAAE,SAAS,EAAE,WAAW,EAAE,UAAU,EAAc,MAAM,YAAY,CAAC;AAC5E,OAAO,EAAE,UAAU,EAAE,YAAY,EAAE,MAAM,YAAY,CAAC;AACtD,OAAO,EAAE,cAAc,EAAE,MAAM,aAAa,CAAC;AAC7C,OAAO,EAAE,SAAS,EAAE,MAAM,kBAAkB,CAAC;AAE7C;;;;;;;;;GASG;AACH,MAAM,UAAU,YAAY,CAAC,GAAW;IACtC,MAAM,MAAM,GAAG,SAAS,CAAC,GAAG,CAAC,CAAC;IAC9B,IAAI,MAAM,IAAI,MAAM,CAAC,SAAS,GAAG,CAAC;QAAE,OAAO,MAAM,CAAC;IAClD,MAAM,MAAM,GAAG,UAAU,CAAC,GAAG,CAAC,CAAC;IAC/B,IAAI,MAAM;QAAE,OAAO,EAAE,GAAG,UAAU,EAAE,EAAE,GAAG,YAAY,CAAC,MAAM,CAAC,EAAE,CAAC;IAChE,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//# sourceMappingURL=sync-run.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"sync-run.d.ts","sourceRoot":"","sources":["../../src/claude/sync-run.ts"],"names":[],"mappings":"AAkBA,wBAAgB,OAAO,CAAC,GAAG,EAAE,MAAM,EAAE,KAAK,GAAE,CAAC,CAAC,EAAE,MAAM,KAAK,IAAgB,GAAG,IAAI,CAcjF;AAED,wBAAgB,IAAI,IAAI,IAAI,CAG3B"}
@@ -0,0 +1,46 @@
1
+ import { execFileSync } from 'node:child_process';
2
+ import { pathToFileURL } from 'node:url';
3
+ import { readWiring, computeStats } from './stats.js';
4
+ import { patchStats, releaseLock, resolveContextDir } from './state.js';
5
+ import { juliusCliPath } from './paths.js';
6
+ /** MONEY GUARD: plain `julius build` only — structural, $0, offline. Never --deep. */
7
+ function realBuild(dir) {
8
+ // JULIUS_TEST_CLI is the same seam hooks.ts's juliusJson uses, so a test can
9
+ // point this at a stub and inspect the exact argv it was invoked with.
10
+ const cliPath = process.env.JULIUS_TEST_CLI ?? juliusCliPath();
11
+ const args = [cliPath, 'build', '.'];
12
+ // Mirrors `withContextDirArg` in hooks.ts: a no-op unless JULIUS_DIR is set, so an
13
+ // unconfigured repo's rebuild sees byte-identical argv to before this existed.
14
+ if (process.env.JULIUS_DIR)
15
+ args.push('--dir', resolveContextDir(dir));
16
+ execFileSync(process.execPath, args, { cwd: dir, stdio: 'ignore', timeout: 120000 });
17
+ }
18
+ export function runSync(dir, build = realBuild) {
19
+ try {
20
+ build(dir);
21
+ const w = readWiring(dir);
22
+ if (!w) {
23
+ patchStats(dir, { syncing: false });
24
+ return;
25
+ } // build ran but output unreadable — stay dirty, retry
26
+ patchStats(dir, {
27
+ dirty: false, staleCount: 0, syncing: false, syncedAt: new Date().toISOString(),
28
+ ...computeStats(w),
29
+ });
30
+ }
31
+ catch {
32
+ patchStats(dir, { syncing: false }); // leave dirty=true; retry next turn
33
+ }
34
+ finally {
35
+ releaseLock(dir);
36
+ }
37
+ }
38
+ export function main() {
39
+ const dir = process.argv[2];
40
+ if (dir)
41
+ runSync(dir);
42
+ }
43
+ // Run only when executed directly (node dist/claude/sync-run.js <dir>), not on import.
44
+ if (process.argv[1] && import.meta.url === pathToFileURL(process.argv[1]).href)
45
+ main();
46
+ //# sourceMappingURL=sync-run.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"sync-run.js","sourceRoot":"","sources":["../../src/claude/sync-run.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,oBAAoB,CAAC;AAClD,OAAO,EAAE,aAAa,EAAE,MAAM,UAAU,CAAC;AACzC,OAAO,EAAE,UAAU,EAAE,YAAY,EAAE,MAAM,YAAY,CAAC;AACtD,OAAO,EAAE,UAAU,EAAE,WAAW,EAAE,iBAAiB,EAAE,MAAM,YAAY,CAAC;AACxE,OAAO,EAAE,aAAa,EAAE,MAAM,YAAY,CAAC;AAE3C,sFAAsF;AACtF,SAAS,SAAS,CAAC,GAAW;IAC5B,6EAA6E;IAC7E,uEAAuE;IACvE,MAAM,OAAO,GAAG,OAAO,CAAC,GAAG,CAAC,eAAe,IAAI,aAAa,EAAE,CAAC;IAC/D,MAAM,IAAI,GAAG,CAAC,OAAO,EAAE,OAAO,EAAE,GAAG,CAAC,CAAC;IACrC,mFAAmF;IACnF,+EAA+E;IAC/E,IAAI,OAAO,CAAC,GAAG,CAAC,UAAU;QAAE,IAAI,CAAC,IAAI,CAAC,OAAO,EAAE,iBAAiB,CAAC,GAAG,CAAC,CAAC,CAAC;IACvE,YAAY,CAAC,OAAO,CAAC,QAAQ,EAAE,IAAI,EAAE,EAAE,GAAG,EAAE,GAAG,EAAE,KAAK,EAAE,QAAQ,EAAE,OAAO,EAAE,MAAM,EAAE,CAAC,CAAC;AACvF,CAAC;AAED,MAAM,UAAU,OAAO,CAAC,GAAW,EAAE,KAAK,GAAwB,SAAS;IACzE,IAAI,CAAC;QACH,KAAK,CAAC,GAAG,CAAC,CAAC;QACX,MAAM,CAAC,GAAG,UAAU,CAAC,GAAG,CAAC,CAAC;QAC1B,IAAI,CAAC,CAAC,EAAE,CAAC;YAAC,UAAU,CAAC,GAAG,EAAE,EAAE,OAAO,EAAE,KAAK,EAAE,CAAC,CAAC;YAAC,OAAO;QAAC,CAAC,CAAC,sDAAsD;QAC/G,UAAU,CAAC,GAAG,EAAE;YACd,KAAK,EAAE,KAAK,EAAE,UAAU,EAAE,CAAC,EAAE,OAAO,EAAE,KAAK,EAAE,QAAQ,EAAE,IAAI,IAAI,EAAE,CAAC,WAAW,EAAE;YAC/E,GAAG,YAAY,CAAC,CAAC,CAAC;SACnB,CAAC,CAAC;IACL,CAAC;IAAC,MAAM,CAAC;QACP,UAAU,CAAC,GAAG,EAAE,EAAE,OAAO,EAAE,KAAK,EAAE,CAAC,CAAC,CAAC,oCAAoC;IAC3E,CAAC;YAAS,CAAC;QACT,WAAW,CAAC,GAAG,CAAC,CAAC;IACnB,CAAC;AACH,CAAC;AAED,MAAM,UAAU,IAAI;IAClB,MAAM,GAAG,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;IAC5B,IAAI,GAAG;QAAE,OAAO,CAAC,GAAG,CAAC,CAAC;AACxB,CAAC;AAED,uFAAuF;AACvF,IAAI,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,IAAI,OAAO,IAAI,CAAC,GAAG,KAAK,aAAa,CAAC,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,CAAC,IAAI;IAAE,IAAI,EAAE,CAAC"}
@@ -0,0 +1,50 @@
1
+ /** Did this reply tell the user what julius saved? */
2
+ export declare function hasSavingsTally(text: string): boolean;
3
+ /** One turn's worth of assistant prose, plus the id of the entry it ended on. */
4
+ export interface AssistantTurn {
5
+ /** `uuid` of the last assistant entry, so the same reply is never counted twice. */
6
+ uuid: string;
7
+ /** Every text block the agent emitted since the last user prompt, joined. */
8
+ text: string;
9
+ }
10
+ /** What the last turn's input tokens cost, alongside how many there were. The
11
+ * pair is what a blended rate is made of; neither half means much alone. */
12
+ export interface TurnBilling {
13
+ /** `uuid` of the last assistant entry, so a repeated Stop can't bill a turn twice. */
14
+ uuid: string;
15
+ /** Micro-dollars this turn's input tokens cost, cache multipliers applied. */
16
+ costMicros: number;
17
+ /** Input tokens billed this turn, cached and fresh alike. */
18
+ tokens: number;
19
+ }
20
+ /**
21
+ * The assistant prose of the turn the transcript ends on, or null when it can't
22
+ * be read (no path — a host whose Stop hook doesn't name one — unreadable file,
23
+ * or a tail with no assistant text in it).
24
+ *
25
+ * Null is meaningfully different from "no tally found": a turn we cannot observe
26
+ * is left out of BOTH the numerator and the denominator by the caller, so a host
27
+ * that exposes no transcript reports no ratio rather than a ratio of zero.
28
+ *
29
+ * Sidechain entries (subagents) are skipped throughout — a subagent's own prose
30
+ * is never what the user read.
31
+ */
32
+ export declare function lastAssistantTurn(transcriptPath: unknown): AssistantTurn | null;
33
+ /**
34
+ * What the turn the transcript ends on cost in input tokens — the measured
35
+ * half of the dollar figure the statusline and the turn nudge report.
36
+ *
37
+ * Costed per API response, not per turn, so a turn that switched models is
38
+ * priced correctly rather than labelled with whichever model happened to go
39
+ * last. Responses are deduped by `message.id`: one response is written to the
40
+ * transcript as several entries (a `thinking` block and a `tool_use` block land
41
+ * on their own lines) and every one of them repeats the same `usage`, so
42
+ * summing the lines would bill the turn two or three times over.
43
+ *
44
+ * Null when there is nothing to bill — no transcript path (a host whose Stop
45
+ * hook names none), an unreadable file, a turn whose entries carry no `usage`,
46
+ * or a model with no price in {@link inputUsdPerMtok}. As everywhere in this
47
+ * file, null means "not observed", never "zero".
48
+ */
49
+ export declare function lastTurnBilling(transcriptPath: unknown): TurnBilling | null;
50
+ //# sourceMappingURL=tally.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"tally.d.ts","sourceRoot":"","sources":["../../src/claude/tally.ts"],"names":[],"mappings":"AA2CA,sDAAsD;AACtD,wBAAgB,eAAe,CAAC,IAAI,EAAE,MAAM,GAAG,OAAO,CAErD;AAED,iFAAiF;AACjF,MAAM,WAAW,aAAa;IAC5B,oFAAoF;IACpF,IAAI,EAAE,MAAM,CAAC;IACb,6EAA6E;IAC7E,IAAI,EAAE,MAAM,CAAC;CACd;AAED;4EAC4E;AAC5E,MAAM,WAAW,WAAW;IAC1B,sFAAsF;IACtF,IAAI,EAAE,MAAM,CAAC;IACb,8EAA8E;IAC9E,UAAU,EAAE,MAAM,CAAC;IACnB,6DAA6D;IAC7D,MAAM,EAAE,MAAM,CAAC;CAChB;AAuCD;;;;;;;;;;;GAWG;AACH,wBAAgB,iBAAiB,CAAC,cAAc,EAAE,OAAO,GAAG,aAAa,GAAG,IAAI,CA0B/E;AAED;;;;;;;;;;;;;;;GAeG;AACH,wBAAgB,eAAe,CAAC,cAAc,EAAE,OAAO,GAAG,WAAW,GAAG,IAAI,CA2C3E"}
@@ -0,0 +1,211 @@
1
+ /**
2
+ * Did the agent actually TELL the user what julius saved?
3
+ *
4
+ * `savedTokens` (state.ts) counts what julius *computed* — every
5
+ * `[julius] tokens saved ≈ N` footer the PostToolUse accumulator swept up. That
6
+ * number is real whether or not anyone sees it. This module measures the other
7
+ * half: whether the reply the user read closed with the one-line tally that
8
+ * SKILL.md and `savingsTurnNudge` (context/savings.ts) both ask for. A turn
9
+ * that saved 20k tokens in silence is a turn where the product did its job and
10
+ * got no credit for it, and the two are indistinguishable in the numbers we
11
+ * ship today.
12
+ *
13
+ * The assistant's own prose exists in exactly one place a hook can reach: the
14
+ * host's transcript JSONL, named on the Stop hook's stdin as `transcript_path`.
15
+ * So this reads that file — locally, at turn end, for a boolean. Nothing out of
16
+ * it is stored or sent; the session keeps a count and the telemetry contract
17
+ * carries that count as a bucket. See TELEMETRY.md.
18
+ *
19
+ * Only the tail is read. A transcript grows for the life of a session and can
20
+ * reach many megabytes, while the answer is always in its last few entries — a
21
+ * hook that read the whole file would get slower every turn for no extra signal.
22
+ */
23
+ import { closeSync, fstatSync, openSync, readSync } from 'node:fs';
24
+ import { turnInputCostMicros, turnInputTokens } from '../context/price.js';
25
+ /**
26
+ * How much of the transcript's end to read. Comfortably larger than any single
27
+ * turn's worth of entries, small enough that the read cost is flat as the
28
+ * session grows.
29
+ */
30
+ const TAIL_BYTES = 1024 * 1024;
31
+ /**
32
+ * The tally, as the agent is actually asked to write it: a "julius saved ~N
33
+ * tokens" claim in prose. Deliberately loose about the decoration around it —
34
+ * the 🌱, the "this turn", the "(3 calls)" suffix and the thousands separator
35
+ * are all optional in practice, and a metric that only counted the one exact
36
+ * phrasing from the example would measure the agent's formatting rather than
37
+ * whether the user was told. Anchored on "julius saved" + a number + "tokens" so
38
+ * ordinary prose about julius can't trip it.
39
+ */
40
+ const TALLY = /(?:julius)\s+saved\s*[~≈]?\s*[\d,.]+\s*[km]?\s*(?:tok|tokens)/i;
41
+ /** Did this reply tell the user what julius saved? */
42
+ export function hasSavingsTally(text) {
43
+ return TALLY.test(text);
44
+ }
45
+ /** Read the last {@link TAIL_BYTES} of a file as utf8, dropping the leading
46
+ * partial line a byte-offset read leaves behind. Returns '' on any I/O trouble —
47
+ * a hook never fails over a metric. */
48
+ function readTail(path) {
49
+ let fd;
50
+ try {
51
+ fd = openSync(path, 'r');
52
+ const size = fstatSync(fd).size;
53
+ const len = Math.min(size, TAIL_BYTES);
54
+ const buf = Buffer.allocUnsafe(len);
55
+ readSync(fd, buf, 0, len, size - len);
56
+ const raw = buf.toString('utf8');
57
+ return len < size ? raw.slice(raw.indexOf('\n') + 1) : raw;
58
+ }
59
+ catch {
60
+ return '';
61
+ }
62
+ finally {
63
+ if (fd !== undefined) {
64
+ try {
65
+ closeSync(fd);
66
+ }
67
+ catch { /* already gone */ }
68
+ }
69
+ }
70
+ }
71
+ /** Is this entry a user's own prompt, rather than a tool result wearing the
72
+ * `user` role? Tool results carry a `tool_result` part; a real prompt does not.
73
+ * The boundary matters because the tally can land in any text block of the turn,
74
+ * not only the last one. */
75
+ function isUserPrompt(entry) {
76
+ if (entry?.type !== 'user' || entry?.isMeta)
77
+ return false;
78
+ const content = entry?.message?.content;
79
+ if (typeof content === 'string')
80
+ return true;
81
+ return Array.isArray(content) && !content.some((p) => p?.type === 'tool_result');
82
+ }
83
+ function textOf(content) {
84
+ if (typeof content === 'string')
85
+ return content;
86
+ if (!Array.isArray(content))
87
+ return '';
88
+ return content.map((p) => (p?.type === 'text' ? String(p.text ?? '') : '')).join('\n');
89
+ }
90
+ /**
91
+ * The assistant prose of the turn the transcript ends on, or null when it can't
92
+ * be read (no path — a host whose Stop hook doesn't name one — unreadable file,
93
+ * or a tail with no assistant text in it).
94
+ *
95
+ * Null is meaningfully different from "no tally found": a turn we cannot observe
96
+ * is left out of BOTH the numerator and the denominator by the caller, so a host
97
+ * that exposes no transcript reports no ratio rather than a ratio of zero.
98
+ *
99
+ * Sidechain entries (subagents) are skipped throughout — a subagent's own prose
100
+ * is never what the user read.
101
+ */
102
+ export function lastAssistantTurn(transcriptPath) {
103
+ if (typeof transcriptPath !== 'string' || !transcriptPath)
104
+ return null;
105
+ const tail = readTail(transcriptPath);
106
+ if (!tail)
107
+ return null;
108
+ const entries = [];
109
+ for (const line of tail.split('\n')) {
110
+ if (!line.trim())
111
+ continue;
112
+ try {
113
+ entries.push(JSON.parse(line));
114
+ }
115
+ catch { /* clipped or partial line */ }
116
+ }
117
+ // Walk back to the turn boundary, collecting assistant text on the way.
118
+ const parts = [];
119
+ let uuid = null;
120
+ for (let i = entries.length - 1; i >= 0; i--) {
121
+ const e = entries[i];
122
+ if (e?.isSidechain)
123
+ continue;
124
+ if (isUserPrompt(e))
125
+ break;
126
+ if (e?.type !== 'assistant')
127
+ continue;
128
+ const text = textOf(e?.message?.content);
129
+ if (!text.trim())
130
+ continue;
131
+ if (uuid === null && typeof e?.uuid === 'string')
132
+ uuid = e.uuid;
133
+ parts.unshift(text);
134
+ }
135
+ if (uuid === null || parts.length === 0)
136
+ return null;
137
+ return { uuid, text: parts.join('\n') };
138
+ }
139
+ /**
140
+ * What the turn the transcript ends on cost in input tokens — the measured
141
+ * half of the dollar figure the statusline and the turn nudge report.
142
+ *
143
+ * Costed per API response, not per turn, so a turn that switched models is
144
+ * priced correctly rather than labelled with whichever model happened to go
145
+ * last. Responses are deduped by `message.id`: one response is written to the
146
+ * transcript as several entries (a `thinking` block and a `tool_use` block land
147
+ * on their own lines) and every one of them repeats the same `usage`, so
148
+ * summing the lines would bill the turn two or three times over.
149
+ *
150
+ * Null when there is nothing to bill — no transcript path (a host whose Stop
151
+ * hook names none), an unreadable file, a turn whose entries carry no `usage`,
152
+ * or a model with no price in {@link inputUsdPerMtok}. As everywhere in this
153
+ * file, null means "not observed", never "zero".
154
+ */
155
+ export function lastTurnBilling(transcriptPath) {
156
+ if (typeof transcriptPath !== 'string' || !transcriptPath)
157
+ return null;
158
+ const tail = readTail(transcriptPath);
159
+ if (!tail)
160
+ return null;
161
+ const entries = [];
162
+ for (const line of tail.split('\n')) {
163
+ if (!line.trim())
164
+ continue;
165
+ try {
166
+ entries.push(JSON.parse(line));
167
+ }
168
+ catch { /* clipped or partial line */ }
169
+ }
170
+ const seen = new Set();
171
+ let uuid = null;
172
+ let costMicros = 0;
173
+ let tokens = 0;
174
+ for (let i = entries.length - 1; i >= 0; i--) {
175
+ const e = entries[i];
176
+ if (e?.isSidechain)
177
+ continue;
178
+ if (isUserPrompt(e))
179
+ break;
180
+ if (e?.type !== 'assistant')
181
+ continue;
182
+ if (uuid === null && typeof e?.uuid === 'string')
183
+ uuid = e.uuid;
184
+ const msg = e?.message;
185
+ const id = msg?.id;
186
+ if (typeof id !== 'string' || seen.has(id))
187
+ continue;
188
+ const usage = msg?.usage;
189
+ if (!usage)
190
+ continue;
191
+ seen.add(id);
192
+ const turn = {
193
+ model: String(msg?.model ?? ''),
194
+ input: Number(usage.input_tokens) || 0,
195
+ cacheCreate: Number(usage.cache_creation_input_tokens) || 0,
196
+ cacheRead: Number(usage.cache_read_input_tokens) || 0,
197
+ };
198
+ const micros = turnInputCostMicros(turn);
199
+ // An unpriced model contributes neither cost nor tokens: leaving its tokens
200
+ // in the denominator alone would drag the blended rate toward zero and
201
+ // quietly under-report every saving after it.
202
+ if (micros === null)
203
+ continue;
204
+ costMicros += micros;
205
+ tokens += turnInputTokens(turn);
206
+ }
207
+ if (uuid === null || tokens === 0)
208
+ return null;
209
+ return { uuid, costMicros, tokens };
210
+ }
211
+ //# sourceMappingURL=tally.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"tally.js","sourceRoot":"","sources":["../../src/claude/tally.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;GAqBG;AACH,OAAO,EAAE,SAAS,EAAE,SAAS,EAAE,QAAQ,EAAE,QAAQ,EAAE,MAAM,SAAS,CAAC;AACnE,OAAO,EAAE,mBAAmB,EAAE,eAAe,EAAE,MAAM,qBAAqB,CAAC;AAE3E;;;;GAIG;AACH,MAAM,UAAU,GAAG,IAAI,GAAG,IAAI,CAAC;AAE/B;;;;;;;;GAQG;AACH,MAAM,KAAK,GAAG,gEAAgE,CAAC;AAE/E,sDAAsD;AACtD,MAAM,UAAU,eAAe,CAAC,IAAY;IAC1C,OAAO,KAAK,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;AAC1B,CAAC;AAqBD;;uCAEuC;AACvC,SAAS,QAAQ,CAAC,IAAY;IAC5B,IAAI,EAAsB,CAAC;IAC3B,IAAI,CAAC;QACH,EAAE,GAAG,QAAQ,CAAC,IAAI,EAAE,GAAG,CAAC,CAAC;QACzB,MAAM,IAAI,GAAG,SAAS,CAAC,EAAE,CAAC,CAAC,IAAI,CAAC;QAChC,MAAM,GAAG,GAAG,IAAI,CAAC,GAAG,CAAC,IAAI,EAAE,UAAU,CAAC,CAAC;QACvC,MAAM,GAAG,GAAG,MAAM,CAAC,WAAW,CAAC,GAAG,CAAC,CAAC;QACpC,QAAQ,CAAC,EAAE,EAAE,GAAG,EAAE,CAAC,EAAE,GAAG,EAAE,IAAI,GAAG,GAAG,CAAC,CAAC;QACtC,MAAM,GAAG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IAC/C,OAAO,EAAE,IAAI,EAAE,UAAU,EAAE,MAAM,EAAE,CAAC;AACtC,CAAC"}
@@ -0,0 +1,12 @@
1
+ export interface InitEpilogueOptions {
2
+ /** Whether a julius graph exists on disk (built by this run, or a prior one). */
3
+ graphBuilt: boolean;
4
+ /** Node count from the built graph — only meaningful when `graphBuilt`. */
5
+ nodes?: number;
6
+ /** Edge count from the built graph — only meaningful when `graphBuilt`. */
7
+ edges?: number;
8
+ }
9
+ /** Renders the `julius init` next-steps epilogue (no trailing newline — the
10
+ * caller's `console.error` adds the one trailing newline). */
11
+ export declare function formatInitEpilogue(opts: InitEpilogueOptions): string;
12
+ //# sourceMappingURL=cli-epilogue.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"cli-epilogue.d.ts","sourceRoot":"","sources":["../src/cli-epilogue.ts"],"names":[],"mappings":"AA0BA,MAAM,WAAW,mBAAmB;IAClC,iFAAiF;IACjF,UAAU,EAAE,OAAO,CAAC;IACpB,2EAA2E;IAC3E,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,2EAA2E;IAC3E,KAAK,CAAC,EAAE,MAAM,CAAC;CAChB;AAED;8DAC8D;AAC9D,wBAAgB,kBAAkB,CAAC,IAAI,EAAE,mBAAmB,GAAG,MAAM,CAyCpE"}
@@ -0,0 +1,55 @@
1
+ /**
2
+ * `julius init`'s closing epilogue: the ASCII wordmark + numbered next steps,
3
+ * printed to stderr after the per-file ✓/·/⚠ lines. Extracted out of cli.ts
4
+ * so the exact text — spacing is hand-aligned, not incidental — can be
5
+ * unit-tested without spawning the CLI.
6
+ */
7
+ import { brand, cmd } from "./brand.js";
8
+ // The widest line (index 4, tied with index 2 at 26 chars) gets the live
9
+ // node/edge stats appended, when a graph exists.
10
+ const WORDMARK_LINES = ["JULIUS", "", "", "", "", ""];
11
+ const STATS_LINE_INDEX = 4;
12
+ // Julius indigo, and a muted grey for the secondary stats suffix — only
13
+ // applied when stderr is a real TTY (tests spawn/call this without one, so
14
+ // existing plain-text assertions keep passing).
15
+ const indigo = (s) => `\x1b[38;2;84;111;255m${s}\x1b[0m`;
16
+ const muted = (s) => `\x1b[38;5;244m${s}\x1b[0m`;
17
+ /** Renders the `julius init` next-steps epilogue (no trailing newline — the
18
+ * caller's `console.error` adds the one trailing newline). */
19
+ export function formatInitEpilogue(opts) {
20
+ const { graphBuilt, nodes, edges } = opts;
21
+ const tty = Boolean(process.stderr.isTTY);
22
+ const wordmark = WORDMARK_LINES.map((l) => (tty ? indigo(l) : l));
23
+ if (graphBuilt && nodes !== undefined && edges !== undefined) {
24
+ const stats = ` ${nodes.toLocaleString("en-US")} nodes · ${edges.toLocaleString("en-US")} edges`;
25
+ wordmark[STATS_LINE_INDEX] += tty ? muted(stats) : stats;
26
+ }
27
+ const steps = [
28
+ ...(graphBuilt ? [] : [{ label: "build the graph", command: cmd("julius build") }]),
29
+ { label: "restart your agent", command: `a new session picks up ${brand()} automatically` },
30
+ {
31
+ label: "code as usual",
32
+ command: "ask your agent to fix a bug or explain a flow —",
33
+ extra: ["it now answers from the graph"],
34
+ },
35
+ {
36
+ label: "explore by hand",
37
+ command: `${cmd("julius ask")} "where is auth handled?" · ${cmd("julius callers")} <fn> · ${cmd("julius viz")}`,
38
+ },
39
+ ];
40
+ const indent = " ";
41
+ const gap = " ";
42
+ const labelWidth = Math.max(...steps.map((s, i) => `${i + 1}. ${s.label}`.length));
43
+ const columnWidth = indent.length + labelWidth + gap.length;
44
+ const stepLines = [];
45
+ steps.forEach((s, i) => {
46
+ const prefix = `${indent}${i + 1}. ${s.label}`;
47
+ stepLines.push(prefix.padEnd(columnWidth) + s.command);
48
+ for (const extra of s.extra ?? []) {
49
+ stepLines.push(" ".repeat(columnWidth) + extra);
50
+ }
51
+ });
52
+ const closing = `${indent}share it: git add .claude && git commit — teammates run \`${cmd("julius build")}\` for their own local graph`;
53
+ return [...wordmark, "", ...stepLines, "", closing].join("\n");
54
+ }
55
+ //# sourceMappingURL=cli-epilogue.js.map
@@ -0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C;QACvD,KAAK,MAAM,KAAK,IAAI,CAAC,CAAC,KAAK,IAAI,EAAE,EAAE,CAAC;YAClC,SAAS,CAAC,IAAI,CAAC,GAAG,CAAC,MAAM,CAAC,WAAW,CAAC,GAAG,KAAK,CAAC,CAAC;QAClD,CAAC;IACH,CAAC,CAAC,CAAC;IAEH,MAAM,OAAO,GAAG,GAAG,MAAM,6DAA6D,GAAG,CAAC,cAAc,CAAC,8BAA8B,CAAC;IAExI,OAAO,CAAC,GAAG,QAAQ,EAAE,EAAE,EAAE,GAAG,SAAS,EAAE,EAAE,EAAE,OAAO,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;AACjE,CAAC"}
@@ -0,0 +1,45 @@
1
+ /** Locates package.json relative to a module URL (works for both `dist/cli.js`
2
+ * running one level under the published package root, and `src/cli.ts` running
3
+ * one level under the repo root via tsx). */
4
+ export declare function resolvePackageJsonPath(moduleUrl: string): string;
5
+ /** Read the installed Julius package identity for explicit npm operations. */
6
+ export declare function readPackageName(moduleUrl: string): string;
7
+ /** Reads the version of the julius package this module was loaded from. */
8
+ export declare function readCurrentVersion(moduleUrl: string): string;
9
+ /** True when the running module lives under an npx cache dir (e.g.
10
+ * `~/.npm/_npx/<hash>/node_modules/...`) rather than a regular global install.
11
+ *
12
+ * Normalized first: `fileURLToPath` returns the *platform* separator, so on
13
+ * Windows the cache path is `…\_npx\…` and a bare `includes("/_npx/")` is always
14
+ * false — `julius upgrade` would then run `npm install -g` on top of an npx run.
15
+ * Same hardcoded-`/` mistake as #33; `src/util/paths.ts` exists for exactly this. */
16
+ export declare function isRunningViaNpx(moduleUrl: string): boolean;
17
+ export interface NpmViewResult {
18
+ ok: boolean;
19
+ version?: string;
20
+ }
21
+ /** `npm view <pkg> version`, offline-safe: any failure (no npm, no network,
22
+ * timeout) resolves to `{ ok: false }` rather than throwing. */
23
+ export declare function getNpmViewVersion(pkgName?: string, timeoutMs?: number): NpmViewResult;
24
+ /** Pure formatter for `julius version` — no I/O, easy to unit-test. */
25
+ export declare function formatVersionReport(current: string, latest: NpmViewResult): string;
26
+ /** Reads the version actually sitting in the global install, straight from
27
+ * disk — more reliable right after `npm install -g` than re-querying the
28
+ * registry (which just tells you what "latest" is, not what landed locally). */
29
+ export declare function readGlobalInstalledVersion(pkgName?: string): string | null;
30
+ export interface UpgradeResult {
31
+ /** True when `npm install -g` actually ran (false for the npx no-op path). */
32
+ ran: boolean;
33
+ ok: boolean;
34
+ /** Present when ran=true and the install failed. */
35
+ errorMessage?: string;
36
+ oldVersion?: string;
37
+ newVersion?: string;
38
+ }
39
+ /** Pure formatter for a finished upgrade — no I/O, easy to unit-test. */
40
+ export declare function formatUpgradeReport(result: UpgradeResult): string;
41
+ /** Runs `npm install -g @ruverd/julius@latest` (inheriting stdio so the user
42
+ * sees npm's own progress/errors), then re-reads the freshly installed
43
+ * version. No-ops with guidance when running via npx. */
44
+ export declare function runUpgrade(moduleUrl: string): UpgradeResult;
45
+ //# sourceMappingURL=cli-meta.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"cli-meta.d.ts","sourceRoot":"","sources":["../src/cli-meta.ts"],"names":[],"mappings":"AAaA;;6CAE6C;AAC7C,wBAAgB,sBAAsB,CAAC,SAAS,EAAE,MAAM,GAAG,MAAM,CAOhE;AAED,8EAA8E;AAC9E,wBAAgB,eAAe,CAAC,SAAS,EAAE,MAAM,GAAG,MAAM,CAOzD;AAID,2EAA2E;AAC3E,wBAAgB,kBAAkB,CAAC,SAAS,EAAE,MAAM,GAAG,MAAM,CAI5D;AAED;;;;;;qFAMqF;AACrF,wBAAgB,eAAe,CAAC,SAAS,EAAE,MAAM,GAAG,OAAO,CAE1D;AAED,MAAM,WAAW,aAAa;IAC5B,EAAE,EAAE,OAAO,CAAC;IACZ,OAAO,CAAC,EAAE,MAAM,CAAC;CAClB;AAED;gEACgE;AAChE,wBAAgB,iBAAiB,CAAC,OAAO,GAAE,MAAiB,EAAE,SAAS,SAAO,GAAG,aAAa,CAc7F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