@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,100 @@
1
+ export interface Stats {
2
+ nodeCount: number;
3
+ edgeCount: number;
4
+ languages: string[];
5
+ totalCount: number;
6
+ readyCount: number;
7
+ staleCount: number;
8
+ dirty: boolean;
9
+ syncing: boolean;
10
+ syncedAt: string | null;
11
+ lastFile: string | null;
12
+ }
13
+ export declare const LOCK_STALE_MS = 300000;
14
+ export declare function emptyStats(): Stats;
15
+ /**
16
+ * Where the pieces this module manages (the stats cache, the sync lock,
17
+ * per-session state, the upkeep stamp) actually live when no caller-supplied
18
+ * override is available. The Claude Code hooks, `sync-run`, the statusline,
19
+ * and `upkeep` all resolve a bare project dir and never see an explicit
20
+ * `--dir` — unlike a direct CLI invocation, which threads one through
21
+ * `contextDirFor` (`context/node-file.ts`). This mirrors that same override
22
+ * precedence for those entry points: `JULIUS_DIR` wins over the default
23
+ * `<projectDir>/julius`, the same env var `resolveConfig` already honors for
24
+ * the `--deep` LLM path. A relative `JULIUS_DIR` resolves against `projectDir`
25
+ * so it holds regardless of the caller's cwd.
26
+ */
27
+ export declare function resolveContextDir(projectDir: string): string;
28
+ export declare function cacheDir(projectDir: string): string;
29
+ export declare function readJson<T>(p: string): T | null;
30
+ /**
31
+ * Write JSON to `p` via a scratch file and a rename, so a concurrent reader sees
32
+ * either the whole old file or the whole new one — never a truncated prefix. The
33
+ * pid in the temp name keeps two concurrent writers off each other's scratch file.
34
+ *
35
+ * `compact` drops the indentation, for the caches only a machine ever opens —
36
+ * it's ~30% of the bytes on a big, deep object.
37
+ *
38
+ * A failed write takes its scratch file with it. Every CLI invocation is a new pid,
39
+ * so the names never collide and never get reused: leaving them behind means a repo
40
+ * that fails this write repeatedly (ENOSPC, or a Windows indexer holding the target
41
+ * open) accumulates one full-size file per attempt, and nothing in julius ever lists
42
+ * `.cache/` to clean them up.
43
+ */
44
+ export declare function writeJsonAtomic(p: string, value: unknown, compact?: boolean, mode?: number): void;
45
+ export declare function readStats(d: string): Stats | null;
46
+ export declare function writeStats(d: string, s: Stats): void;
47
+ /**
48
+ * Persisted per-repo build configuration. Explicit CLI choices live here so
49
+ * later no-flag builds and automatic refreshes enumerate the same file set.
50
+ * Missing fields always retain backwards-compatible defaults.
51
+ */
52
+ export interface BuildConfig {
53
+ /** SKIP_DIRS names to include in this repo's walks, persisted so a LATER
54
+ * no-flag build — and the fingerprint/refresh path, which never sees CLI
55
+ * flags at all — behave identically to the invocation that set it. */
56
+ includeDirs?: string[];
57
+ /** Whether initialized Git submodules (gitlinks) are folded into this repo's
58
+ * graph. Absent/false keeps the historical boundary at the superproject. */
59
+ followSubmodules?: boolean;
60
+ /** Whether nested Git clones the index does not track — how manifest-driven
61
+ * multi-repo tools check dependencies out, and how an ad-hoc local clone lands
62
+ * in the tree — are folded into this repo's graph. Deliberately SEPARATE from
63
+ * `followSubmodules`: a submodule is a dependency the parent pins, a nested
64
+ * clone is invisible to the parent's index and may equally be a scratch
65
+ * checkout someone parked in the tree. Absent/false keeps the historical
66
+ * boundary. */
67
+ followNestedRepos?: boolean;
68
+ }
69
+ /** Local, Git-ignored repository configuration. Kept outside generated
70
+ * `julius/` output so deleting/replacing that cache, workspace federation, and
71
+ * custom `--dir` builds cannot erase or redirect the persisted choice. */
72
+ export declare const BUILD_CONFIG_DIR = ".julius";
73
+ export declare function buildConfigPath(d: string): string;
74
+ export declare function readBuildConfig(d: string): BuildConfig | null;
75
+ export declare function writeBuildConfig(d: string, c: BuildConfig): void;
76
+ /** Merge explicit CLI choices into the existing local config, so updating one
77
+ * persisted build option cannot erase another. */
78
+ export declare function patchBuildConfig(d: string, patch: BuildConfig): void;
79
+ /** The persisted `--include-dir` override for repo `d`, as a Set — `undefined`
80
+ * when nothing was ever persisted (or the persisted list is empty), which every
81
+ * `shouldSkipDir`/`walkDir` caller treats as "today's default behavior". Shared
82
+ * by every walkDir-driven entry point (source-files.ts, scopes.ts) so a build,
83
+ * a later no-flag rebuild, and the hooks/refresh path all agree. */
84
+ export declare function readIncludeDirs(d: string): Set<string> | undefined;
85
+ /** Missing and explicit false both retain the backwards-compatible default. */
86
+ export declare function readFollowSubmodules(d: string): boolean;
87
+ /** Missing and explicit false both retain the backwards-compatible default. */
88
+ export declare function readFollowNestedRepos(d: string): boolean;
89
+ export declare function patchStats(d: string, patch: Partial<Stats>): Stats;
90
+ export declare function acquireLock(d: string): boolean;
91
+ export declare function releaseLock(d: string): void;
92
+ /**
93
+ * The lock, addressed by cache dir rather than project dir. For the default layout
94
+ * `<root>/julius/.cache` these are the same file, which is the point: the Claude Code
95
+ * hooks lock by project dir and the graph's auto-refresh locks by the context dir it
96
+ * is actually writing, and the two must collide so they can't rebuild at once.
97
+ */
98
+ export declare function acquireLockIn(cache: string): boolean;
99
+ export declare function releaseLockIn(cache: string): void;
100
+ //# sourceMappingURL=state.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"state.d.ts","sourceRoot":"","sources":["../../src/util/state.ts"],"names":[],"mappings":"AAgBA,MAAM,WAAW,KAAK;IACpB,SAAS,EAAE,MAAM,CAAC;IAAC,SAAS,EAAE,MAAM,CAAC;IAAC,SAAS,EAAE,MAAM,EAAE,CAAC;IAC1D,UAAU,EAAE,MAAM,CAAC;IAAC,UAAU,EAAE,MAAM,CAAC;IACvC,UAAU,EAAE,MAAM,CAAC;IAAC,KAAK,EAAE,OAAO,CAAC;IAAC,OAAO,EAAE,OAAO,CAAC;IACrD,QAAQ,EAAE,MAAM,GAAG,IAAI,CAAC;IAAC,QAAQ,EAAE,MAAM,GAAG,IAAI,CAAC;CAClD;AAED,eAAO,MAAM,aAAa,SAAS,CAAC;AAEpC,wBAAgB,UAAU,IAAI,KAAK,CAGlC;AAID;;;;;;;;;;;GAWG;AACH,wBAAgB,iBAAiB,CAAC,UAAU,EAAE,MAAM,GAAG,MAAM,CAI5D;AAED,wBAAgB,QAAQ,CAAC,UAAU,EAAE,MAAM,GAAG,MAAM,CAA0D;AAG9G,wBAAgB,QAAQ,CAAC,CAAC,EAAE,CAAC,EAAE,MAAM,GAAG,CAAC,GAAG,IAAI,CAE/C;AACD;;;;;;;;;;;;;GAaG;AACH,wBAAgB,eAAe,CAAC,CAAC,EAAE,MAAM,EAAE,KAAK,EAAE,OAAO,EAAE,OAAO,UAAQ,EAAE,IAAI,CAAC,EAAE,MAAM,GAAG,IAAI,CAY/F;AAED,wBAAgB,SAAS,CAAC,CAAC,EAAE,MAAM,GAAG,KAAK,GAAG,IAAI,CAA0C;AAC5F,wBAAgB,UAAU,CAAC,CAAC,EAAE,MAAM,EAAE,CAAC,EAAE,KAAK,GAAG,IAAI,CAAsC;AAE3F;;;;GAIG;AACH,MAAM,WAAW,WAAW;IAC1B;;0EAEsE;IACtE,WAAW,CAAC,EAAE,MAAM,EAAE,CAAC;IACvB;gFAC4E;IAC5E,gBAAgB,CAAC,EAAE,OAAO,CAAC;IAC3B;;;;;;mBAMe;IACf,iBAAiB,CAAC,EAAE,OAAO,CAAC;CAC7B;AAED;;0EAE0E;AAC1E,eAAO,MAAM,gBAAgB,YAAY,CAAC;AAE1C,wBAAgB,eAAe,CAAC,CAAC,EAAE,MAAM,GAAG,MAAM,CAAqD;AAUvG,wBAAgB,eAAe,CAAC,CAAC,EAAE,MAAM,GAAG,WAAW,GAAG,IAAI,CAAsD;AACpH,wBAAgB,gBAAgB,CAAC,CAAC,EAAE,MAAM,EAAE,CAAC,EAAE,WAAW,GAAG,IAAI,CAGhE;AAED;kDACkD;AAClD,wBAAgB,gBAAgB,CAAC,CAAC,EAAE,MAAM,EAAE,KAAK,EAAE,WAAW,GAAG,IAAI,CAEpE;AAED;;;;oEAIoE;AACpE,wBAAgB,eAAe,CAAC,CAAC,EAAE,MAAM,GAAG,GAAG,CAAC,MAAM,CAAC,GAAG,SAAS,CAGlE;AAED,+EAA+E;AAC/E,wBAAgB,oBAAoB,CAAC,CAAC,EAAE,MAAM,GAAG,OAAO,CAEvD;AAED,+EAA+E;AAC/E,wBAAgB,qBAAqB,CAAC,CAAC,EAAE,MAAM,GAAG,OAAO,CAExD;AAGD,wBAAgB,UAAU,CAAC,CAAC,EAAE,MAAM,EAAE,KAAK,EAAE,OAAO,CAAC,KAAK,CAAC,GAAG,KAAK,CAIlE;AAED,wBAAgB,WAAW,CAAC,CAAC,EAAE,MAAM,GAAG,OAAO,CAE9C;AACD,wBAAgB,WAAW,CAAC,CAAC,EAAE,MAAM,GAAG,IAAI,CAE3C;AAED;;;;;GAKG;AACH,wBAAgB,aAAa,CAAC,KAAK,EAAE,MAAM,GAAG,OAAO,CAgBpD;AACD,wBAAgB,aAAa,CAAC,KAAK,EAAE,MAAM,GAAG,IAAI,CAEjD"}
@@ -0,0 +1,186 @@
1
+ /**
2
+ * The `julius/.cache/` sidecar state: the statusline's stats snapshot and the
3
+ * build lock that serializes rebuilds.
4
+ *
5
+ * Lives in `util/` rather than `claude/` because two very different callers need
6
+ * it: the Claude Code hooks (which flip `dirty` on an edit and clear it after a
7
+ * background sync) and the graph's own pre-query auto-refresh
8
+ * (`graph/refresh.ts`), which must take the same lock so the two never rebuild
9
+ * on top of each other. `claude/state.ts` re-exports all of this, so nothing
10
+ * outside had to change when it moved.
11
+ */
12
+ import { readFileSync, writeFileSync, mkdirSync, renameSync, rmSync, statSync } from 'node:fs';
13
+ import { join, dirname, isAbsolute } from 'node:path';
14
+ import { mapDirFor } from '../context/map-dir.js';
15
+ import { ignoreInJuliusDir } from '../notes/repo-julius.js';
16
+ export const LOCK_STALE_MS = 300000;
17
+ export function emptyStats() {
18
+ return { nodeCount: 0, edgeCount: 0, languages: [], totalCount: 0, readyCount: 0,
19
+ staleCount: 0, dirty: false, syncing: false, syncedAt: null, lastFile: null };
20
+ }
21
+ const LOCK_FILE = '.sync.lock';
22
+ /**
23
+ * Where the pieces this module manages (the stats cache, the sync lock,
24
+ * per-session state, the upkeep stamp) actually live when no caller-supplied
25
+ * override is available. The Claude Code hooks, `sync-run`, the statusline,
26
+ * and `upkeep` all resolve a bare project dir and never see an explicit
27
+ * `--dir` — unlike a direct CLI invocation, which threads one through
28
+ * `contextDirFor` (`context/node-file.ts`). This mirrors that same override
29
+ * precedence for those entry points: `JULIUS_DIR` wins over the default
30
+ * `<projectDir>/julius`, the same env var `resolveConfig` already honors for
31
+ * the `--deep` LLM path. A relative `JULIUS_DIR` resolves against `projectDir`
32
+ * so it holds regardless of the caller's cwd.
33
+ */
34
+ export function resolveContextDir(projectDir) {
35
+ const override = process.env.JULIUS_DIR;
36
+ if (!override)
37
+ return mapDirFor(projectDir);
38
+ return isAbsolute(override) ? override : join(projectDir, override);
39
+ }
40
+ export function cacheDir(projectDir) { return join(resolveContextDir(projectDir), '.cache'); }
41
+ function statsPath(d) { return join(cacheDir(d), 'stats.json'); }
42
+ export function readJson(p) {
43
+ try {
44
+ return JSON.parse(readFileSync(p, 'utf8'));
45
+ }
46
+ catch {
47
+ return null;
48
+ }
49
+ }
50
+ /**
51
+ * Write JSON to `p` via a scratch file and a rename, so a concurrent reader sees
52
+ * either the whole old file or the whole new one — never a truncated prefix. The
53
+ * pid in the temp name keeps two concurrent writers off each other's scratch file.
54
+ *
55
+ * `compact` drops the indentation, for the caches only a machine ever opens —
56
+ * it's ~30% of the bytes on a big, deep object.
57
+ *
58
+ * A failed write takes its scratch file with it. Every CLI invocation is a new pid,
59
+ * so the names never collide and never get reused: leaving them behind means a repo
60
+ * that fails this write repeatedly (ENOSPC, or a Windows indexer holding the target
61
+ * open) accumulates one full-size file per attempt, and nothing in julius ever lists
62
+ * `.cache/` to clean them up.
63
+ */
64
+ export function writeJsonAtomic(p, value, compact = false, mode) {
65
+ mkdirSync(dirname(p), { recursive: true });
66
+ const tmp = `${p}.${process.pid}.tmp`;
67
+ try {
68
+ // `mode` applies to the new file before it's renamed into place, so a
69
+ // secret is never readable by others even for a moment.
70
+ writeFileSync(tmp, compact ? JSON.stringify(value) : JSON.stringify(value, null, 2), mode === undefined ? undefined : { mode });
71
+ renameSync(tmp, p);
72
+ }
73
+ catch (e) {
74
+ try {
75
+ rmSync(tmp, { force: true });
76
+ }
77
+ catch { /* nothing more we can do */ }
78
+ throw e;
79
+ }
80
+ }
81
+ export function readStats(d) { return readJson(statsPath(d)); }
82
+ export function writeStats(d, s) { writeJsonAtomic(statsPath(d), s); }
83
+ /** Local, Git-ignored repository configuration. Kept outside generated
84
+ * `julius/` output so deleting/replacing that cache, workspace federation, and
85
+ * custom `--dir` builds cannot erase or redirect the persisted choice. */
86
+ export const BUILD_CONFIG_DIR = '.julius';
87
+ export function buildConfigPath(d) { return join(d, BUILD_CONFIG_DIR, 'config.json'); }
88
+ /** Keep local build configuration out of Git without coupling it to the
89
+ * generated graph directory. Best-effort, matching graph-cache ignore setup. */
90
+ function ensureBuildConfigIgnored(d) {
91
+ const noGitignore = process.env.JULIUS_NO_GITIGNORE;
92
+ if (noGitignore && noGitignore !== '0' && noGitignore !== 'false')
93
+ return;
94
+ try {
95
+ ignoreInJuliusDir(d, 'config.json');
96
+ }
97
+ catch { /* best-effort */ }
98
+ }
99
+ export function readBuildConfig(d) { return readJson(buildConfigPath(d)); }
100
+ export function writeBuildConfig(d, c) {
101
+ ensureBuildConfigIgnored(d);
102
+ writeJsonAtomic(buildConfigPath(d), c);
103
+ }
104
+ /** Merge explicit CLI choices into the existing local config, so updating one
105
+ * persisted build option cannot erase another. */
106
+ export function patchBuildConfig(d, patch) {
107
+ writeBuildConfig(d, { ...(readBuildConfig(d) ?? {}), ...patch });
108
+ }
109
+ /** The persisted `--include-dir` override for repo `d`, as a Set — `undefined`
110
+ * when nothing was ever persisted (or the persisted list is empty), which every
111
+ * `shouldSkipDir`/`walkDir` caller treats as "today's default behavior". Shared
112
+ * by every walkDir-driven entry point (source-files.ts, scopes.ts) so a build,
113
+ * a later no-flag rebuild, and the hooks/refresh path all agree. */
114
+ export function readIncludeDirs(d) {
115
+ const dirs = readBuildConfig(d)?.includeDirs;
116
+ return dirs && dirs.length ? new Set(dirs) : undefined;
117
+ }
118
+ /** Missing and explicit false both retain the backwards-compatible default. */
119
+ export function readFollowSubmodules(d) {
120
+ return readBuildConfig(d)?.followSubmodules === true;
121
+ }
122
+ /** Missing and explicit false both retain the backwards-compatible default. */
123
+ export function readFollowNestedRepos(d) {
124
+ return readBuildConfig(d)?.followNestedRepos === true;
125
+ }
126
+ // Best-effort read-modify-write; not atomic across concurrent processes, but acceptable
127
+ // for episodic hook writes (worst case is a lost update, not corruption).
128
+ export function patchStats(d, patch) {
129
+ const next = { ...(readStats(d) ?? emptyStats()), ...patch };
130
+ writeStats(d, next);
131
+ return next;
132
+ }
133
+ export function acquireLock(d) {
134
+ return acquireLockIn(cacheDir(d));
135
+ }
136
+ export function releaseLock(d) {
137
+ releaseLockIn(cacheDir(d));
138
+ }
139
+ /**
140
+ * The lock, addressed by cache dir rather than project dir. For the default layout
141
+ * `<root>/julius/.cache` these are the same file, which is the point: the Claude Code
142
+ * hooks lock by project dir and the graph's auto-refresh locks by the context dir it
143
+ * is actually writing, and the two must collide so they can't rebuild at once.
144
+ */
145
+ export function acquireLockIn(cache) {
146
+ const p = join(cache, LOCK_FILE);
147
+ mkdirSync(cache, { recursive: true });
148
+ const payload = JSON.stringify({ pid: process.pid, at: new Date().toISOString() });
149
+ try {
150
+ writeFileSync(p, payload, { flag: 'wx' }); // atomic exclusive create
151
+ return true;
152
+ }
153
+ catch (e) {
154
+ if (e?.code !== 'EEXIST')
155
+ throw e;
156
+ let stale;
157
+ try {
158
+ stale = Date.now() - statSync(p).mtimeMs >= LOCK_STALE_MS;
159
+ }
160
+ catch {
161
+ stale = true;
162
+ }
163
+ if (!stale)
164
+ return false;
165
+ try {
166
+ rmSync(p);
167
+ }
168
+ catch { /* another process reclaimed it */ }
169
+ try {
170
+ writeFileSync(p, payload, { flag: 'wx' });
171
+ return true;
172
+ }
173
+ catch (e2) {
174
+ if (e2?.code === 'EEXIST')
175
+ return false;
176
+ throw e2;
177
+ }
178
+ }
179
+ }
180
+ export function releaseLockIn(cache) {
181
+ try {
182
+ rmSync(join(cache, LOCK_FILE));
183
+ }
184
+ catch { /* already gone */ }
185
+ }
186
+ //# sourceMappingURL=state.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"state.js","sourceRoot":"","sources":["../../src/util/state.ts"],"names":[],"mappings":"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"}
@@ -0,0 +1,2 @@
1
+ var mt={part_of:"structure",contains:"structure",uses:"dependency",depends_on:"dependency",calls:"dependency",imports:"dependency",produces:"dependency",configures:"dependency",validates:"dependency",extends:"contract",implements:"contract",references:"association"};function Y(e){return mt[e]??"association"}var $e={structure:85,dependency:145,contract:150,association:185};function ee(e){return Y(e)==="structure"?"part of":e==="calls"||e==="uses"||e==="depends_on"||e==="imports"?"uses":e.replace(/_/g," ")}var Le={"part of":"where does this live? (contains, part of)",uses:"what breaks if the target changes? (calls, uses, depends on, imports)",produces:"where does this output come from?",configures:"what changes its behavior without a code change?",validates:"what checks or judges this? (tests, drift checks, scoring)",extends:"what contract must this honor? (inheritance)",implements:"what contract must this honor? (interface)",references:"mentioned but never called \u2014 possible dead coupling"},gt={system:"--sys",concept:"--con",file:"--fil",api:"--api",changed:"--fil",affected:"--sys"},vt={file:"--k-file",class:"--k-class",function:"--k-fn",method:"--k-method",interface:"--k-iface",type:"--k-type",enum:"--k-enum"};function j(e,t){return(e==="code"?vt:gt)[t]??"--edge"}function k(e){return getComputedStyle(document.documentElement).getPropertyValue(e).trim()}var F=globalThis.__JULIUS_DATA__;async function Se(){return F?.contextGraph?F.contextGraph:await(await fetch("/api/context-graph")).json()}async function Te(){let e;if(F){if(!F.codeGraph)return null;e=F.codeGraph}else{let i=await fetch("/api/code-graph");if(!i.ok)return null;e=await i.json()}let t=e.nodes.map(i=>({id:i.id,name:i.name,type:i.kind,summary:i.summary??i.signature??"",sources:[`${i.path} \xB7 ${i.span}`]})),n=new Set(t.map(i=>i.id)),r=e.edges.filter(i=>n.has(i.source)&&n.has(i.target)).map(i=>({source:i.source,target:i.target,relation:i.relation,confidence:i.confidence}));return{meta:{nodeCount:t.length,edgeCount:r.length},nodes:t,edges:r}}function Ae(e){if(F)return;let t=new EventSource("/events");t.onmessage=n=>{n.data==="change"&&e()}}function ce(e,t){var n,r=1;e==null&&(e=0),t==null&&(t=0);function i(){var o,a=n.length,h,d=0,s=0;for(o=0;o<a;++o)h=n[o],d+=h.x,s+=h.y;for(d=(d/a-e)*r,s=(s/a-t)*r,o=0;o<a;++o)h=n[o],h.x-=d,h.y-=s}return i.initialize=function(o){n=o},i.x=function(o){return arguments.length?(e=+o,i):e},i.y=function(o){return arguments.length?(t=+o,i):t},i.strength=function(o){return arguments.length?(r=+o,i):r},i}function Ve(e){let t=+this._x.call(null,e),n=+this._y.call(null,e);return Ge(this.cover(t,n),t,n,e)}function Ge(e,t,n,r){if(isNaN(t)||isNaN(n))return e;var i,o=e._root,a={data:r},h=e._x0,d=e._y0,s=e._x1,l=e._y1,g,c,f,v,p,u,m,y;if(!o)return e._root=a,e;for(;o.length;)if((p=t>=(g=(h+s)/2))?h=g:s=g,(u=n>=(c=(d+l)/2))?d=c:l=c,i=o,!(o=o[m=u<<1|p]))return i[m]=a,e;if(f=+e._x.call(null,o.data),v=+e._y.call(null,o.data),t===f&&n===v)return a.next=o,i?i[m]=a:e._root=a,e;do i=i?i[m]=new Array(4):e._root=new Array(4),(p=t>=(g=(h+s)/2))?h=g:s=g,(u=n>=(c=(d+l)/2))?d=c:l=c;while((m=u<<1|p)===(y=(v>=c)<<1|f>=g));return i[y]=o,i[m]=a,e}function ze(e){var t,n,r=e.length,i,o,a=new Array(r),h=new Array(r),d=1/0,s=1/0,l=-1/0,g=-1/0;for(n=0;n<r;++n)isNaN(i=+this._x.call(null,t=e[n]))||isNaN(o=+this._y.call(null,t))||(a[n]=i,h[n]=o,i<d&&(d=i),i>l&&(l=i),o<s&&(s=o),o>g&&(g=o));if(d>l||s>g)return this;for(this.cover(d,s).cover(l,g),n=0;n<r;++n)Ge(this,a[n],h[n],e[n]);return this}function De(e,t){if(isNaN(e=+e)||isNaN(t=+t))return this;var n=this._x0,r=this._y0,i=this._x1,o=this._y1;if(isNaN(n))i=(n=Math.floor(e))+1,o=(r=Math.floor(t))+1;else{for(var a=i-n||1,h=this._root,d,s;n>e||e>=i||r>t||t>=o;)switch(s=(t<r)<<1|e<n,d=new Array(4),d[s]=h,h=d,a*=2,s){case 0:i=n+a,o=r+a;break;case 1:n=i-a,o=r+a;break;case 2:i=n+a,r=o-a;break;case 3:n=i-a,r=o-a;break}this._root&&this._root.length&&(this._root=h)}return this._x0=n,this._y0=r,this._x1=i,this._y1=o,this}function He(){var e=[];return this.visit(function(t){if(!t.length)do e.push(t.data);while(t=t.next)}),e}function Ie(e){return arguments.length?this.cover(+e[0][0],+e[0][1]).cover(+e[1][0],+e[1][1]):isNaN(this._x0)?void 0:[[this._x0,this._y0],[this._x1,this._y1]]}function L(e,t,n,r,i){this.node=e,this.x0=t,this.y0=n,this.x1=r,this.y1=i}function Oe(e,t,n){var r,i=this._x0,o=this._y0,a,h,d,s,l=this._x1,g=this._y1,c=[],f=this._root,v,p;for(f&&c.push(new L(f,i,o,l,g)),n==null?n=1/0:(i=e-n,o=t-n,l=e+n,g=t+n,n*=n);v=c.pop();)if(!(!(f=v.node)||(a=v.x0)>l||(h=v.y0)>g||(d=v.x1)<i||(s=v.y1)<o))if(f.length){var u=(a+d)/2,m=(h+s)/2;c.push(new L(f[3],u,m,d,s),new L(f[2],a,m,u,s),new L(f[1],u,h,d,m),new L(f[0],a,h,u,m)),(p=(t>=m)<<1|e>=u)&&(v=c[c.length-1],c[c.length-1]=c[c.length-1-p],c[c.length-1-p]=v)}else{var y=e-+this._x.call(null,f.data),b=t-+this._y.call(null,f.data),x=y*y+b*b;if(x<n){var M=Math.sqrt(n=x);i=e-M,o=t-M,l=e+M,g=t+M,r=f.data}}return r}function je(e){if(isNaN(l=+this._x.call(null,e))||isNaN(g=+this._y.call(null,e)))return this;var t,n=this._root,r,i,o,a=this._x0,h=this._y0,d=this._x1,s=this._y1,l,g,c,f,v,p,u,m;if(!n)return this;if(n.length)for(;;){if((v=l>=(c=(a+d)/2))?a=c:d=c,(p=g>=(f=(h+s)/2))?h=f:s=f,t=n,!(n=n[u=p<<1|v]))return this;if(!n.length)break;(t[u+1&3]||t[u+2&3]||t[u+3&3])&&(r=t,m=u)}for(;n.data!==e;)if(i=n,!(n=n.next))return this;return(o=n.next)&&delete n.next,i?(o?i.next=o:delete i.next,this):t?(o?t[u]=o:delete t[u],(n=t[0]||t[1]||t[2]||t[3])&&n===(t[3]||t[2]||t[1]||t[0])&&!n.length&&(r?r[m]=n:this._root=n),this):(this._root=o,this)}function Re(e){for(var t=0,n=e.length;t<n;++t)this.remove(e[t]);return this}function Be(){return this._root}function Pe(){var e=0;return this.visit(function(t){if(!t.length)do++e;while(t=t.next)}),e}function We(e){var t=[],n,r=this._root,i,o,a,h,d;for(r&&t.push(new L(r,this._x0,this._y0,this._x1,this._y1));n=t.pop();)if(!e(r=n.node,o=n.x0,a=n.y0,h=n.x1,d=n.y1)&&r.length){var s=(o+h)/2,l=(a+d)/2;(i=r[3])&&t.push(new L(i,s,l,h,d)),(i=r[2])&&t.push(new L(i,o,l,s,d)),(i=r[1])&&t.push(new L(i,s,a,h,l)),(i=r[0])&&t.push(new L(i,o,a,s,l))}return this}function Fe(e){var t=[],n=[],r;for(this._root&&t.push(new L(this._root,this._x0,this._y0,this._x1,this._y1));r=t.pop();){var i=r.node;if(i.length){var o,a=r.x0,h=r.y0,d=r.x1,s=r.y1,l=(a+d)/2,g=(h+s)/2;(o=i[0])&&t.push(new L(o,a,h,l,g)),(o=i[1])&&t.push(new L(o,l,h,d,g)),(o=i[2])&&t.push(new L(o,a,g,l,s)),(o=i[3])&&t.push(new L(o,l,g,d,s))}n.push(r)}for(;r=n.pop();)e(r.node,r.x0,r.y0,r.x1,r.y1);return this}function Ye(e){return e[0]}function Xe(e){return arguments.length?(this._x=e,this):this._x}function qe(e){return e[1]}function Ke(e){return arguments.length?(this._y=e,this):this._y}function R(e,t,n){var r=new de(t??Ye,n??qe,NaN,NaN,NaN,NaN);return e==null?r:r.addAll(e)}function de(e,t,n,r,i,o){this._x=e,this._y=t,this._x0=n,this._y0=r,this._x1=i,this._y1=o,this._root=void 0}function Qe(e){for(var t={data:e.data},n=t;e=e.next;)n=n.next={data:e.data};return t}var A=R.prototype=de.prototype;A.copy=function(){var e=new de(this._x,this._y,this._x0,this._y0,this._x1,this._y1),t=this._root,n,r;if(!t)return e;if(!t.length)return e._root=Qe(t),e;for(n=[{source:t,target:e._root=new Array(4)}];t=n.pop();)for(var i=0;i<4;++i)(r=t.source[i])&&(r.length?n.push({source:r,target:t.target[i]=new Array(4)}):t.target[i]=Qe(r));return e};A.add=Ve;A.addAll=ze;A.cover=De;A.data=He;A.extent=Ie;A.find=Oe;A.remove=je;A.removeAll=Re;A.root=Be;A.size=Pe;A.visit=We;A.visitAfter=Fe;A.x=Xe;A.y=Ke;function D(e){return function(){return e}}function z(e){return(e()-.5)*1e-6}function yt(e){return e.x+e.vx}function xt(e){return e.y+e.vy}function ue(e){var t,n,r,i=1,o=1;typeof e!="function"&&(e=D(e==null?1:+e));function a(){for(var s,l=t.length,g,c,f,v,p,u,m=0;m<o;++m)for(g=R(t,yt,xt).visitAfter(h),s=0;s<l;++s)c=t[s],p=n[c.index],u=p*p,f=c.x+c.vx,v=c.y+c.vy,g.visit(y);function y(b,x,M,T,V){var C=b.data,G=b.r,$=p+G;if(C){if(C.index>c.index){var I=f-C.x-C.vx,O=v-C.y-C.vy,H=I*I+O*O;H<$*$&&(I===0&&(I=z(r),H+=I*I),O===0&&(O=z(r),H+=O*O),H=($-(H=Math.sqrt(H)))/H*i,c.vx+=(I*=H)*($=(G*=G)/(u+G)),c.vy+=(O*=H)*$,C.vx-=I*($=1-$),C.vy-=O*$)}return}return x>f+$||T<f-$||M>v+$||V<v-$}}function h(s){if(s.data)return s.r=n[s.data.index];for(var l=s.r=0;l<4;++l)s[l]&&s[l].r>s.r&&(s.r=s[l].r)}function d(){if(t){var s,l=t.length,g;for(n=new Array(l),s=0;s<l;++s)g=t[s],n[g.index]=+e(g,s,t)}}return a.initialize=function(s,l){t=s,r=l,d()},a.iterations=function(s){return arguments.length?(o=+s,a):o},a.strength=function(s){return arguments.length?(i=+s,a):i},a.radius=function(s){return arguments.length?(e=typeof s=="function"?s:D(+s),d(),a):e},a}function wt(e){return e.index}function Ue(e,t){var n=e.get(t);if(!n)throw new Error("node not found: "+t);return n}function fe(e){var t=wt,n=g,r,i=D(30),o,a,h,d,s,l=1;e==null&&(e=[]);function g(u){return 1/Math.min(h[u.source.index],h[u.target.index])}function c(u){for(var m=0,y=e.length;m<l;++m)for(var b=0,x,M,T,V,C,G,$;b<y;++b)x=e[b],M=x.source,T=x.target,V=T.x+T.vx-M.x-M.vx||z(s),C=T.y+T.vy-M.y-M.vy||z(s),G=Math.sqrt(V*V+C*C),G=(G-o[b])/G*u*r[b],V*=G,C*=G,T.vx-=V*($=d[b]),T.vy-=C*$,M.vx+=V*($=1-$),M.vy+=C*$}function f(){if(a){var u,m=a.length,y=e.length,b=new Map(a.map((M,T)=>[t(M,T,a),M])),x;for(u=0,h=new Array(m);u<y;++u)x=e[u],x.index=u,typeof x.source!="object"&&(x.source=Ue(b,x.source)),typeof x.target!="object"&&(x.target=Ue(b,x.target)),h[x.source.index]=(h[x.source.index]||0)+1,h[x.target.index]=(h[x.target.index]||0)+1;for(u=0,d=new Array(y);u<y;++u)x=e[u],d[u]=h[x.source.index]/(h[x.source.index]+h[x.target.index]);r=new Array(y),v(),o=new Array(y),p()}}function v(){if(a)for(var u=0,m=e.length;u<m;++u)r[u]=+n(e[u],u,e)}function p(){if(a)for(var u=0,m=e.length;u<m;++u)o[u]=+i(e[u],u,e)}return c.initialize=function(u,m){a=u,s=m,f()},c.links=function(u){return arguments.length?(e=u,f(),c):e},c.id=function(u){return arguments.length?(t=u,c):t},c.iterations=function(u){return arguments.length?(l=+u,c):l},c.strength=function(u){return arguments.length?(n=typeof u=="function"?u:D(+u),v(),c):n},c.distance=function(u){return arguments.length?(i=typeof u=="function"?u:D(+u),p(),c):i},c}var bt={value:()=>{}};function Je(){for(var e=0,t=arguments.length,n={},r;e<t;++e){if(!(r=arguments[e]+"")||r in n||/[\s.]/.test(r))throw new Error("illegal type: "+r);n[r]=[]}return new te(n)}function te(e){this._=e}function kt(e,t){return e.trim().split(/^|\s+/).map(function(n){var r="",i=n.indexOf(".");if(i>=0&&(r=n.slice(i+1),n=n.slice(0,i)),n&&!t.hasOwnProperty(n))throw new Error("unknown type: "+n);return{type:n,name:r}})}te.prototype=Je.prototype={constructor:te,on:function(e,t){var n=this._,r=kt(e+"",n),i,o=-1,a=r.length;if(arguments.length<2){for(;++o<a;)if((i=(e=r[o]).type)&&(i=_t(n[i],e.name)))return i;return}if(t!=null&&typeof t!="function")throw new Error("invalid callback: "+t);for(;++o<a;)if(i=(e=r[o]).type)n[i]=Ze(n[i],e.name,t);else if(t==null)for(i in n)n[i]=Ze(n[i],e.name,null);return this},copy:function(){var e={},t=this._;for(var n in t)e[n]=t[n].slice();return new te(e)},call:function(e,t){if((i=arguments.length-2)>0)for(var n=new Array(i),r=0,i,o;r<i;++r)n[r]=arguments[r+2];if(!this._.hasOwnProperty(e))throw new Error("unknown type: "+e);for(o=this._[e],r=0,i=o.length;r<i;++r)o[r].value.apply(t,n)},apply:function(e,t,n){if(!this._.hasOwnProperty(e))throw new Error("unknown type: "+e);for(var r=this._[e],i=0,o=r.length;i<o;++i)r[i].value.apply(t,n)}};function _t(e,t){for(var n=0,r=e.length,i;n<r;++n)if((i=e[n]).name===t)return i.value}function Ze(e,t,n){for(var r=0,i=e.length;r<i;++r)if(e[r].name===t){e[r]=bt,e=e.slice(0,r).concat(e.slice(r+1));break}return n!=null&&e.push({name:t,value:n}),e}var he=Je;var X=0,Q=0,K=0,tt=1e3,ne,U,ie=0,B=0,re=0,Z=typeof performance=="object"&&performance.now?performance:Date,nt=typeof window=="object"&&window.requestAnimationFrame?window.requestAnimationFrame.bind(window):function(e){setTimeout(e,17)};function ge(){return B||(nt(Et),B=Z.now()+re)}function Et(){B=0}function pe(){this._call=this._time=this._next=null}pe.prototype=oe.prototype={constructor:pe,restart:function(e,t,n){if(typeof e!="function")throw new TypeError("callback is not a function");n=(n==null?ge():+n)+(t==null?0:+t),!this._next&&U!==this&&(U?U._next=this:ne=this,U=this),this._call=e,this._time=n,me()},stop:function(){this._call&&(this._call=null,this._time=1/0,me())}};function oe(e,t,n){var r=new pe;return r.restart(e,t,n),r}function it(){ge(),++X;for(var e=ne,t;e;)(t=B-e._time)>=0&&e._call.call(void 0,t),e=e._next;--X}function et(){B=(ie=Z.now())+re,X=Q=0;try{it()}finally{X=0,Nt(),B=0}}function Mt(){var e=Z.now(),t=e-ie;t>tt&&(re-=t,ie=e)}function Nt(){for(var e,t=ne,n,r=1/0;t;)t._call?(r>t._time&&(r=t._time),e=t,t=t._next):(n=t._next,t._next=null,t=e?e._next=n:ne=n);U=e,me(r)}function me(e){if(!X){Q&&(Q=clearTimeout(Q));var t=e-B;t>24?(e<1/0&&(Q=setTimeout(et,e-Z.now()-re)),K&&(K=clearInterval(K))):(K||(ie=Z.now(),K=setInterval(Mt,tt)),X=1,nt(et))}}function rt(){let e=1;return()=>(e=(1664525*e+1013904223)%4294967296)/4294967296}function ot(e){return e.x}function st(e){return e.y}var Ct=10,$t=Math.PI*(3-Math.sqrt(5));function ve(e){var t,n=1,r=.001,i=1-Math.pow(r,1/300),o=0,a=.6,h=new Map,d=oe(g),s=he("tick","end"),l=rt();e==null&&(e=[]);function g(){c(),s.call("tick",t),n<r&&(d.stop(),s.call("end",t))}function c(p){var u,m=e.length,y;p===void 0&&(p=1);for(var b=0;b<p;++b)for(n+=(o-n)*i,h.forEach(function(x){x(n)}),u=0;u<m;++u)y=e[u],y.fx==null?y.x+=y.vx*=a:(y.x=y.fx,y.vx=0),y.fy==null?y.y+=y.vy*=a:(y.y=y.fy,y.vy=0);return t}function f(){for(var p=0,u=e.length,m;p<u;++p){if(m=e[p],m.index=p,m.fx!=null&&(m.x=m.fx),m.fy!=null&&(m.y=m.fy),isNaN(m.x)||isNaN(m.y)){var y=Ct*Math.sqrt(.5+p),b=p*$t;m.x=y*Math.cos(b),m.y=y*Math.sin(b)}(isNaN(m.vx)||isNaN(m.vy))&&(m.vx=m.vy=0)}}function v(p){return p.initialize&&p.initialize(e,l),p}return f(),t={tick:c,restart:function(){return d.restart(g),t},stop:function(){return d.stop(),t},nodes:function(p){return arguments.length?(e=p,f(),h.forEach(v),t):e},alpha:function(p){return arguments.length?(n=+p,t):n},alphaMin:function(p){return arguments.length?(r=+p,t):r},alphaDecay:function(p){return arguments.length?(i=+p,t):+i},alphaTarget:function(p){return arguments.length?(o=+p,t):o},velocityDecay:function(p){return arguments.length?(a=1-p,t):1-a},randomSource:function(p){return arguments.length?(l=p,h.forEach(v),t):l},force:function(p,u){return arguments.length>1?(u==null?h.delete(p):h.set(p,v(u)),t):h.get(p)},find:function(p,u,m){var y=0,b=e.length,x,M,T,V,C;for(m==null?m=1/0:m*=m,y=0;y<b;++y)V=e[y],x=p-V.x,M=u-V.y,T=x*x+M*M,T<m&&(C=V,m=T);return C},on:function(p,u){return arguments.length>1?(s.on(p,u),t):s.on(p)}}}function ye(){var e,t,n,r,i=D(-30),o,a=1,h=1/0,d=.81;function s(f){var v,p=e.length,u=R(e,ot,st).visitAfter(g);for(r=f,v=0;v<p;++v)t=e[v],u.visit(c)}function l(){if(e){var f,v=e.length,p;for(o=new Array(v),f=0;f<v;++f)p=e[f],o[p.index]=+i(p,f,e)}}function g(f){var v=0,p,u,m=0,y,b,x;if(f.length){for(y=b=x=0;x<4;++x)(p=f[x])&&(u=Math.abs(p.value))&&(v+=p.value,m+=u,y+=u*p.x,b+=u*p.y);f.x=y/m,f.y=b/m}else{p=f,p.x=p.data.x,p.y=p.data.y;do v+=o[p.data.index];while(p=p.next)}f.value=v}function c(f,v,p,u){if(!f.value)return!0;var m=f.x-t.x,y=f.y-t.y,b=u-v,x=m*m+y*y;if(b*b/d<x)return x<h&&(m===0&&(m=z(n),x+=m*m),y===0&&(y=z(n),x+=y*y),x<a&&(x=Math.sqrt(a*x)),t.vx+=m*f.value*r/x,t.vy+=y*f.value*r/x),!0;if(f.length||x>=h)return;(f.data!==t||f.next)&&(m===0&&(m=z(n),x+=m*m),y===0&&(y=z(n),x+=y*y),x<a&&(x=Math.sqrt(a*x)));do f.data!==t&&(b=o[f.data.index]*r/x,t.vx+=m*b,t.vy+=y*b);while(f=f.next)}return s.initialize=function(f,v){e=f,n=v,l()},s.strength=function(f){return arguments.length?(i=typeof f=="function"?f:D(+f),l(),s):i},s.distanceMin=function(f){return arguments.length?(a=f*f,s):Math.sqrt(a)},s.distanceMax=function(f){return arguments.length?(h=f*f,s):Math.sqrt(h)},s.theta=function(f){return arguments.length?(d=f*f,s):Math.sqrt(d)},s}function S(e){return e.replace(/&/g,"&amp;").replace(/</g,"&lt;")}function Lt(e){let t=e.lines.map(n=>`<div class="ev-l ${n.sign==="+"?"add":n.sign==="-"?"del":"ctx"}"><span class="ev-n">${n.n??""}</span><span class="ev-s">${n.sign===" "?"":n.sign}</span><span class="ev-t">${S(n.text)}</span></div>`).join("");return`<div class="ev"><div class="ev-h mono">${S(e.label)}${e.note?` <span class="ev-note">${S(e.note)}</span>`:""}</div><div class="ev-b mono">${t}</div>`+(e.more?`<div class="ev-more">+ ${e.more} more lines</div>`:"")+"</div>"}function xe(e){let t=e.split(/[\s._-]+/).filter(Boolean);return(t.length>=2?t[0][0]+t[1][0]:(t[0]??"?").slice(0,2)).toUpperCase()}function St(e,t=Date.now()){let n=Date.parse(`${e}T00:00:00Z`);if(!Number.isFinite(n))return e;let r=Math.max(0,Math.round((t-n)/864e5));if(r<1)return"today";if(r===1)return"yesterday";if(r<31)return`${r}d ago`;let i=Math.round(r/30);return i<24?`${i}mo ago`:`${Math.round(r/365)}y ago`}function Tt(e){let t=e.map(i=>{let o=i.handle?`@${S(i.handle)}`:S(i.name),a=i.handle?"own-name mono":"own-name";return`<div class="own"><span class="av">${S(xe(i.handle??i.name))}</span><span class="own-txt"><span class="${a}">${o}</span><span class="own-why">${i.commits} commit${i.commits===1?"":"s"} here \xB7 last ${S(St(i.last))}</span></span></div>`}).join(""),n=e.filter(i=>!i.handle),r=n.length?`<div class="own-note">\u26A0 ${S(n.map(i=>i.name).join(", "))} ${n.length===1?"has":"have"} no GitHub handle in their commit email.</div>`:"";return`<div class="owners">${t}${r}</div>`}function at(e,t,n,r,i){if(!r||!t){e.innerHTML='<div class="empty">Select a node to view details</div>';return}let o=t.nodes.find(c=>c.id===r);if(!o){e.innerHTML='<div class="empty">Select a node to view details</div>';return}let a=k(j(n,o.type)),h=c=>t.nodes.find(f=>f.id===c)?.name??c,d=t.edges.filter(c=>c.source===r),s=t.edges.filter(c=>c.target===r),l=`<span class="d-type"><span class="sw" style="background:${a}"></span>${S(o.type)}</span>`;if(l+=`<h3>${S(o.name)}</h3>`,o.summary&&(l+=`<p class="summary">${S(o.summary)}</p>`),o.owners?.length&&(l+=`<div class="d-label"><span class="dot" style="background:var(--con)"></span>Who knows this \xB7 ${o.owners.length}</div>`,l+=Tt(o.owners)),o.evidence?.length){l+=`<div class="d-label">Code \xB7 ${o.evidence.length}</div>`;for(let f of o.evidence)l+=Lt(f);let c=o.sources.length-o.evidence.length;c>0&&(l+=`<div class="src mono">+ ${c} more, not shown</div>`)}else if(o.sources.length){l+=`<div class="d-label">Sources \xB7 ${o.sources.length}</div>`;for(let c of o.sources)l+=`<div class="src mono">${S(c)}</div>`}let g=(c,f,v,p)=>{if(c.length){l+=`<div class="d-label"><span class="dot" style="background:${f}"></span>${v} \xB7 ${c.length}</div>`;for(let u of c)l+=`<button class="lnk" data-go="${S(p(u))}"><span class="rel">${S(u.relation.replace(/_/g," "))}</span> <span class="to">${S(h(p(u)))}</span>`+(u.description?`<div class="desc">${S(u.description)}</div>`:"")+"</button>"}};g(d,k("--fil"),"Depends on",c=>c.target),g(s,k("--accent"),"Depended on by",c=>c.source),e.innerHTML=l,e.querySelectorAll("[data-go]").forEach(c=>{c.addEventListener("click",()=>i(c.dataset.go))})}var At="http://www.w3.org/2000/svg",Vt=2;function N(e,t){let n=document.createElementNS(At,e);for(let[r,i]of Object.entries(t))n.setAttribute(r,String(i));return n}function Gt(e){let t=e.owners??[];if(t.length===0)return null;let n=t.slice(0,Vt),r=t.length-n.length,i=[...n.map(a=>xe(a.handle??a.name)),...r>0?[`+${r}`]:[]],o=N("g",{"pointer-events":"none"});return i.forEach((a,h)=>{let d=e.r*.72+h*13,s=-e.r*.72+h*8;o.appendChild(N("circle",{cx:d,cy:s,r:8,fill:k("--panel"),stroke:k("--con"),"stroke-width":1.2}));let l=N("text",{x:d,y:s+3,"text-anchor":"middle","font-size":7.5,"font-weight":700,fill:k("--con")});l.textContent=a;let g=N("title",{});g.textContent=t.map(c=>`${c.handle?`@${c.handle}`:c.name} \u2014 ${c.commits} commits`).join(`
2
+ `),o.append(l,g)}),o}var se=class{svg;defs;viewport;sim=null;nodes=[];edges=[];edgeEls=[];nodeEls=[];view={x:0,y:0,k:1};tab="context";selected=null;query="";hiddenRels={};hiddenTypes={};showOwners=!0;onSelect=()=>{};constructor(t){this.svg=t,this.buildChrome(),this.bindPanZoom()}buildChrome(){this.svg.textContent="",this.defs=N("defs",{}),this.svg.appendChild(this.defs),this.viewport=N("g",{}),this.svg.appendChild(this.viewport),this.svg.addEventListener("click",()=>this.select(null))}ensureMarkers(){this.defs.textContent="";let t=N("marker",{id:"arr",viewBox:"0 0 10 10",refX:8,refY:5,markerWidth:4.5,markerHeight:4.5,orient:"auto-start-reverse"});t.appendChild(N("path",{d:"M2,1.5L8.5,5L2,8.5",fill:"none",stroke:k("--edge"),"stroke-width":1.8,"stroke-linecap":"round","stroke-linejoin":"round",opacity:.75}));let n=N("marker",{id:"arrH",viewBox:"0 0 12 12",refX:10,refY:6,markerWidth:6.5,markerHeight:6.5,orient:"auto-start-reverse"});n.appendChild(N("path",{d:"M1.5,1.5L10.5,6L1.5,10.5z",fill:k("--canvas"),stroke:k("--edge"),"stroke-width":1.4}));let r=N("marker",{id:"arrOut",viewBox:"0 0 10 10",refX:8,refY:5,markerWidth:5,markerHeight:5,orient:"auto-start-reverse"});r.appendChild(N("path",{d:"M1,1L9,5L1,9z",fill:k("--fil")}));let i=N("marker",{id:"arrIn",viewBox:"0 0 10 10",refX:8,refY:5,markerWidth:5,markerHeight:5,orient:"auto-start-reverse"});i.appendChild(N("path",{d:"M1,1L9,5L1,9z",fill:k("--accent")}));for(let o of[t,n,r,i])this.defs.appendChild(o)}setData(t,n){this.tab=n;let r=new Map(this.nodes.map(d=>[d.id,d])),i={};for(let d of t.edges)i[d.source]=(i[d.source]??0)+1,i[d.target]=(i[d.target]??0)+1;let o=this.svg.clientWidth||800,a=this.svg.clientHeight||600;this.nodes=t.nodes.map((d,s)=>{let l=r.get(d.id),g=s/Math.max(1,t.nodes.length)*Math.PI*2,c=i[d.id]??0;return{id:d.id,name:d.name,type:d.type,owners:d.owners,deg:c,r:11+Math.min(13,c*2.6),x:l?.x??o/2+Math.cos(g)*Math.min(o,a)/4,y:l?.y??a/2+Math.sin(g)*Math.min(o,a)/4,vx:l?.vx??0,vy:l?.vy??0}});let h=new Map(this.nodes.map(d=>[d.id,d]));this.edges=t.edges.map(d=>({source:h.get(d.source),target:h.get(d.target),relation:d.relation,description:d.description,confidence:d.confidence})).filter(d=>d.source&&d.target),this.sim?.stop(),this.sim=ve(this.nodes).force("charge",ye().strength(-220)).force("link",fe(this.edges).distance(d=>$e[Y(d.relation)]).strength(.5)).force("center",ce(o/2,a/2)).force("collide",ue().radius(d=>d.r+6)).on("tick",()=>this.tick()),this.buildElements(),this.restyle()}buildElements(){this.ensureMarkers(),this.viewport.textContent="",this.edgeEls=this.edges.map(t=>{let n=N("path",{fill:"none","stroke-linecap":"round"}),r=N("title",{});r.textContent=t.relation.replace(/_/g," ")+(t.description?` \u2014 ${t.description}`:""),n.appendChild(r);let i=N("text",{"text-anchor":"middle","font-size":9.5,"font-weight":700,"stroke-width":3,"paint-order":"stroke",display:"none"});return i.textContent=t.relation.replace(/_/g," "),this.viewport.appendChild(n),this.viewport.appendChild(i),{path:n,label:i,edge:t}}),this.nodeEls=this.nodes.map(t=>{let n=N("g",{cursor:"pointer"}),r=N("circle",{fill:"none","stroke-width":1.6,opacity:0,r:t.r+5}),i=N("circle",{r:t.r,opacity:.92}),o=N("text",{y:t.r+15,"text-anchor":"middle","font-size":11.5,"font-weight":600});o.textContent=t.name;let a=Gt(t);return n.append(r,i,o),a&&n.appendChild(a),n.addEventListener("click",h=>{h.stopPropagation(),this.select(t.id)}),this.bindDrag(n,t),this.viewport.appendChild(n),{group:n,circle:i,ring:r,label:o,badges:a,node:t}})}tick(){for(let{path:t,label:n,edge:r}of this.edgeEls){let i=r.source,o=r.target,a=(o.x??0)-(i.x??0),h=(o.y??0)-(i.y??0),d=Math.sqrt(a*a+h*h)||1,s=a/d,l=h/d,g=(i.x??0)+s*(i.r+2),c=(i.y??0)+l*(i.r+2),f=(o.x??0)-s*(o.r+6),v=(o.y??0)-l*(o.r+6),p=(g+f)/2-l*10,u=(c+v)/2+s*10;t.setAttribute("d",`M${g},${c} Q${p},${u} ${f},${v}`),n.setAttribute("x",String((g+f)/2-l*14)),n.setAttribute("y",String((c+v)/2+s*14))}for(let{group:t,node:n}of this.nodeEls)t.setAttribute("transform",`translate(${n.x??0},${n.y??0})`)}restyle(){this.ensureMarkers();let t=new Set;if(this.selected)for(let i of this.edges)i.source.id===this.selected&&t.add(i.target.id),i.target.id===this.selected&&t.add(i.source.id);let n=this.query.toLowerCase(),r=i=>!this.hiddenTypes[i.type];for(let{path:i,label:o,edge:a}of this.edgeEls){let h=r(a.source)&&r(a.target)&&!this.hiddenRels[ee(a.relation)];if(i.style.display=h?"":"none",o.setAttribute("display","none"),!h)continue;let d=Y(a.relation),s=k("--edge"),l=1.3,g="none",c=.5,f="url(#arr)";d==="structure"?(l=2.4,c=.32,f="none"):d==="dependency"?(l=1.5,c=.55):d==="contract"?(c=.55,f="url(#arrH)"):(g="2 5",l=1.2,c=.28,f="none"),a.confidence==="inferred"&&(g="5 4"),n&&(c=.12);let v=this.selected?a.source.id===this.selected?"out":a.target.id===this.selected?"in":"far":"none";v==="out"?(s=k("--fil"),c=.95,l+=.7,f="url(#arrOut)"):v==="in"?(s=k("--accent"),c=.95,l+=.7,f="url(#arrIn)"):v==="far"&&(c=.06),i.setAttribute("stroke",s),i.setAttribute("stroke-width",String(l)),i.setAttribute("stroke-dasharray",g),i.setAttribute("opacity",String(c)),f==="none"?i.removeAttribute("marker-end"):i.setAttribute("marker-end",f),(v==="out"||v==="in")&&(o.removeAttribute("display"),o.setAttribute("fill",s),o.setAttribute("stroke",k("--canvas")))}for(let{group:i,circle:o,ring:a,label:h,badges:d,node:s}of this.nodeEls){let l=r(s);if(i.style.display=l?"":"none",!l)continue;let c=!n||s.name.toLowerCase().includes(n)?1:.22;this.selected&&s.id!==this.selected&&!t.has(s.id)&&(c=Math.min(c,.2)),i.setAttribute("opacity",String(c));let f=k(j(this.tab,s.type));o.setAttribute("fill",f),a.setAttribute("stroke",f),a.setAttribute("opacity",s.id===this.selected?"0.55":"0"),h.setAttribute("fill",k("--ink")),d&&(d.style.display=this.showOwners?"":"none")}}select(t){this.selected=t,this.restyle(),this.onSelect(t)}focus(t){let n=this.nodes.find(o=>o.id===t);if(!n)return;let r=this.svg.clientWidth,i=this.svg.clientHeight;this.view.k=Math.max(this.view.k,1.4),this.view.x=r/2-(n.x??0)*this.view.k,this.view.y=i/2-(n.y??0)*this.view.k,this.applyView(),this.select(t)}firstMatch(){let t=this.query.toLowerCase();return this.nodes.find(n=>!this.hiddenTypes[n.type]&&n.name.toLowerCase().includes(t))}applyView(){this.viewport.setAttribute("transform",`translate(${this.view.x},${this.view.y}) scale(${this.view.k})`)}zoomBy(t){let n=this.svg.clientWidth/2,r=this.svg.clientHeight/2,i=Math.max(.35,Math.min(3,this.view.k*t));this.view.x=n-(n-this.view.x)*(i/this.view.k),this.view.y=r-(r-this.view.y)*(i/this.view.k),this.view.k=i,this.applyView()}resetView(){this.view={x:0,y:0,k:1},this.applyView()}reheat(){this.sim?.alpha(.6).restart()}bindDrag(t,n){t.addEventListener("pointerdown",r=>{r.stopPropagation(),t.setPointerCapture(r.pointerId);let i=a=>{let h=this.svg.getBoundingClientRect();n.fx=(a.clientX-h.left-this.view.x)/this.view.k,n.fy=(a.clientY-h.top-this.view.y)/this.view.k,this.sim?.alphaTarget(.25).restart()},o=()=>{n.fx=null,n.fy=null,this.sim?.alphaTarget(0),t.removeEventListener("pointermove",i),t.removeEventListener("pointerup",o)};t.addEventListener("pointermove",i),t.addEventListener("pointerup",o)})}bindPanZoom(){let t=null;this.svg.addEventListener("pointerdown",n=>{t={x:n.clientX-this.view.x,y:n.clientY-this.view.y}}),this.svg.addEventListener("pointermove",n=>{t&&(this.view.x=n.clientX-t.x,this.view.y=n.clientY-t.y,this.applyView())}),window.addEventListener("pointerup",()=>{t=null}),this.svg.addEventListener("wheel",n=>{n.preventDefault();let r=this.svg.getBoundingClientRect(),i=n.clientX-r.left,o=n.clientY-r.top,a=Math.max(.35,Math.min(3,this.view.k*Math.exp(-n.deltaY*.0016)));this.view.x=i-(i-this.view.x)*(a/this.view.k),this.view.y=o-(o-this.view.y)*(a/this.view.k),this.view.k=a,this.applyView()},{passive:!1})}};function we(e){return e.replace(/&/g,"&amp;").replace(/</g,"&lt;")}function q(e,t,n,r,i){let o=s=>t.edges.filter(l=>l.relation==="contains"&&l.source===s).map(l=>t.nodes.find(g=>g.id===l.target)).filter(l=>!!l),a=s=>{let l=o(s);return l.length+l.reduce((g,c)=>g+a(c.id),0)},h=t.nodes.filter(s=>s.type==="file"),d=s=>{let l=o(s.id),g=r[s.id]!==!1,c=`<button class="tree-row${g?" open":""}${n===s.id?" sel":""}" data-id="${we(s.id)}" data-haskids="${l.length?1:0}"><span class="chev">${l.length?"\u25B6":""}</span><span class="k" style="background:${k(j("code",s.type))}"></span><span class="t${s.type==="file"?" mono":""}">${we(s.name)}</span><span class="badge">${l.length?a(s.id)+" sym":we(s.type)}</span></button>`;return l.length&&g&&(c+=`<div class="tree-kids">${l.map(d).join("")}</div>`),c};e.innerHTML='<div class="tree-tools"><button data-tool="expand">Expand all</button><button data-tool="collapse">Collapse all</button></div>'+h.map(d).join(""),e.querySelectorAll(".tree-row").forEach(s=>{s.addEventListener("click",()=>{let l=s.dataset.id;s.dataset.haskids==="1"&&(r[l]=r[l]===!1,q(e,t,l,r,i)),i(l)})}),e.querySelector('[data-tool="expand"]')?.addEventListener("click",()=>{for(let s of Object.keys(r))delete r[s];q(e,t,n,r,i)}),e.querySelector('[data-tool="collapse"]')?.addEventListener("click",()=>{for(let s of t.nodes)r[s.id]=!1;q(e,t,n,r,i)})}var _=e=>document.getElementById(e),E={tab:"context",context:null,code:null,outlineOpen:{}},w=new se(_("graphSvg"));function J(){return E.tab==="context"?E.context:E.code}function Ee(){return E.tab==="code"||E.tab==="outline"?"code":"context"}function Me(){let e=_("edgeChips");e.innerHTML='<span class="cap">Edges</span>';let t=J();if(!t)return;let n=new Map;for(let i of t.edges){let o=ee(i.relation);n.set(o,(n.get(o)??0)+1)}let r=[...n.keys()].sort((i,o)=>{let a=h=>h==="part of"?0:h==="uses"?1:2;return a(i)-a(o)||i.localeCompare(o)});for(let i of r){let o=document.createElement("button");o.type="button",o.className="echip"+(w.hiddenRels[i]?"":" on"),o.innerHTML=`${zt(i)} ${i} <span style="opacity:.55">${n.get(i)}</span>`,o.title=(Le[i]??`"${i}" edges`)+" \u2014 click to "+(w.hiddenRels[i]?"show":"hide"),o.addEventListener("click",()=>{w.hiddenRels[i]=!w.hiddenRels[i],Me(),w.restyle(),Ne()}),e.appendChild(o)}}function zt(e){let t=e==="part of"?"structure":e==="uses"?"dependency":Y(e.replace(/ /g,"_"));return{structure:'<svg width="20" height="8" aria-hidden="true"><line x1="1" y1="4" x2="19" y2="4" stroke="currentColor" stroke-width="3" opacity=".5"/></svg>',dependency:'<svg width="20" height="8" aria-hidden="true"><line x1="1" y1="4" x2="14" y2="4" stroke="currentColor" stroke-width="1.6"/><path d="M14,1 L19,4 L14,7 z" fill="currentColor"/></svg>',contract:'<svg width="20" height="8" aria-hidden="true"><line x1="1" y1="4" x2="13" y2="4" stroke="currentColor" stroke-width="1.4"/><path d="M13,1 L19,4 L13,7 z" fill="none" stroke="currentColor" stroke-width="1.2"/></svg>',association:'<svg width="20" height="8" aria-hidden="true"><line x1="1" y1="4" x2="19" y2="4" stroke="currentColor" stroke-width="1.4" stroke-dasharray="2 4" opacity=".7"/></svg>'}[t]}function ae(){let e=_("legend");e.innerHTML="";let t=J();if(!t)return;let n=new Map;for(let i of t.nodes)n.set(i.type,(n.get(i.type)??0)+1);for(let[i,o]of n){let a=document.createElement("button");a.type="button",a.className="lchip"+(w.hiddenTypes[i]?" off":""),a.innerHTML=`<span class="sw" style="background:${k(j(Ee(),i))}"></span>${i} <span style="color:var(--muted);font-weight:500">${o}</span>`,a.addEventListener("click",()=>{w.hiddenTypes[i]=!w.hiddenTypes[i],ae(),w.restyle(),Ne()}),e.appendChild(a)}if(t.nodes.some(i=>i.owners?.length)){let i=document.createElement("button");i.type="button",i.className="lchip lchip-people"+(w.showOwners?"":" off"),i.innerHTML=`<span class="sw" style="background:${k("--con")}"></span>people`,i.title="Show who has worked on each area",i.addEventListener("click",()=>{w.showOwners=!w.showOwners,ae(),w.restyle()}),e.appendChild(i)}}function Ne(){let e=J();if(!e){_("lcount").textContent="";return}let t=e.nodes.filter(n=>!w.hiddenTypes[n.type]).length;_("lcount").textContent=`${t} / ${e.nodes.length} nodes shown`}function Dt(){let e=_("counts");if(E.tab==="outline"&&E.code){let t=E.code.nodes.filter(n=>n.type==="file").length;e.textContent=`${t} files \xB7 ${E.code.nodes.length} symbols`}else{let t=J();e.textContent=t?`${t.meta.nodeCount} nodes \xB7 ${t.meta.edgeCount} links`:""}}function P(e){at(_("detail"),E.tab==="context"?E.context:E.code,Ee(),e,t=>{E.tab==="outline"?(P(t),q(_("tree"),E.code,t,E.outlineOpen,P)):w.focus(t)})}w.onSelect=e=>P(e);function dt(e){E.tab=e,document.querySelectorAll(".tab").forEach(r=>{r.setAttribute("aria-selected",r.dataset.tab===e?"true":"false")});let t=e==="outline";_("canvasWrap").hidden=t,_("outlineView").hidden=!t,w.hiddenRels={},w.hiddenTypes={},w.selected=null,P(null);let n=_("graphEmpty");if(e==="outline")E.code?q(_("tree"),E.code,null,E.outlineOpen,P):(_("outlineView").hidden=!0,_("canvasWrap").hidden=!1,lt('No code graph yet \u2014 run <code>julius graph</code> to generate <span class="mono">graph.json</span>.'));else{let r=J();!r||r.nodes.length===0?lt(r?.meta.emptyNote?Ht(r.meta.emptyNote):e==="code"?'No code graph yet \u2014 run <code>julius graph</code> to generate <span class="mono">graph.json</span>.':"No context graph \u2014 run <code>julius init</code> first."):(n.hidden=!0,w.resetView(),w.setData(r,Ee()),w.reheat())}Me(),ae(),Ne(),Dt()}function Ht(e){return e.replace(/&/g,"&amp;").replace(/</g,"&lt;")}function lt(e){let t=_("graphEmpty");t.innerHTML=e,t.hidden=!1}document.querySelectorAll(".tab").forEach(e=>{e.addEventListener("click",()=>dt(e.dataset.tab))});var ke=_("search");ke.addEventListener("input",()=>{w.query=ke.value.trim(),w.restyle()});ke.addEventListener("keydown",e=>{if(e.key==="Enter"&&w.query){let t=w.firstMatch();t&&w.focus(t.id)}});_("zin").addEventListener("click",()=>w.zoomBy(1.25));_("zout").addEventListener("click",()=>w.zoomBy(1/1.25));_("zreset").addEventListener("click",()=>w.resetView());var ut="julius-viz-theme",ct=localStorage.getItem(ut);ct&&document.documentElement.setAttribute("data-theme",ct);_("themeBtn").addEventListener("click",()=>{let e=document.documentElement,t=e.getAttribute("data-theme"),n=window.matchMedia("(prefers-color-scheme: dark)").matches,i=(t?t==="dark":n)?"light":"dark";e.setAttribute("data-theme",i),localStorage.setItem(ut,i),w.restyle(),Me(),ae(),P(w.selected)});var ft="julius-viz-detail-w",_e=220,It=document.documentElement,Ot=e=>Math.min(Math.max(_e,Math.round(window.innerWidth*.6)),Math.max(_e,Math.round(e)));function Ce(e,t=!0){let n=Ot(e);It.style.setProperty("--detail-w",`${n}px`),t&&localStorage.setItem(ft,String(n))}var be=Number(localStorage.getItem(ft));Number.isFinite(be)&&be>=_e&&Ce(be,!1);var W=_("detailResizer"),le=!1;W.addEventListener("pointerdown",e=>{let t=e;le=!0,W.setPointerCapture(t.pointerId),document.body.style.cursor="col-resize",e.preventDefault()});W.addEventListener("pointermove",e=>{le&&Ce(window.innerWidth-e.clientX)});var ht=e=>{if(le){le=!1,document.body.style.cursor="";try{W.releasePointerCapture(e.pointerId)}catch{}w.reheat()}};W.addEventListener("pointerup",ht);W.addEventListener("pointercancel",ht);W.addEventListener("keydown",e=>{let t=e;if(t.key!=="ArrowLeft"&&t.key!=="ArrowRight")return;let n=t.shiftKey?40:16,r=_("detail").getBoundingClientRect().width;Ce(r+(t.key==="ArrowLeft"?n:-n)),w.reheat(),e.preventDefault()});async function pt(){let[e,t]=await Promise.all([Se(),Te()]);E.context=e,E.code=t;let n=[e.meta.repoName,e.meta.subtitle].filter(Boolean).join(" \xB7 ");_("repoName").textContent=n,document.title=`julius viz \u2014 ${n}`;let r=e.meta.tabs;r&&document.querySelectorAll(".tab").forEach(o=>{o.hidden=!r.includes(o.dataset.tab)});let i=e.meta.defaultTab;dt(i&&i!==E.tab?i:E.tab)}Ae(()=>{let e=w.selected;pt().then(()=>{e&&(w.selected=e,w.restyle(),P(e))})});pt();
@@ -0,0 +1,49 @@
1
+ <!doctype html>
2
+ <html lang="en">
3
+ <head>
4
+ <meta charset="utf-8">
5
+ <meta name="viewport" content="width=device-width, initial-scale=1">
6
+ <title>julius viz</title>
7
+ <link rel="stylesheet" href="/style.css">
8
+ </head>
9
+ <body>
10
+ <header class="appbar">
11
+ <div class="brand"><b>julius</b><span id="repoName"></span></div>
12
+ <div class="counts" id="counts"></div>
13
+ <nav class="tabs" role="tablist" id="tabs">
14
+ <button class="tab" role="tab" aria-selected="true" data-tab="context">Context</button>
15
+ <button class="tab" role="tab" aria-selected="false" data-tab="code">Code</button>
16
+ <button class="tab" role="tab" aria-selected="false" data-tab="outline">Outline</button>
17
+ </nav>
18
+ <div class="searchbox">
19
+ <svg width="13" height="13" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2.4" aria-hidden="true"><circle cx="11" cy="11" r="7"/><path d="M21 21l-4.3-4.3"/></svg>
20
+ <input id="search" type="search" placeholder="Search nodes…" aria-label="Search nodes">
21
+ </div>
22
+ <button class="iconbtn" id="themeBtn" title="Toggle theme" aria-label="Toggle theme">
23
+ <svg width="14" height="14" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" aria-hidden="true"><path d="M21 12.8A9 9 0 1 1 11.2 3 7 7 0 0 0 21 12.8z"/></svg>
24
+ </button>
25
+ </header>
26
+
27
+ <main class="stage" id="stage">
28
+ <div class="canvas-wrap" id="canvasWrap">
29
+ <svg class="graph" id="graphSvg" role="img" aria-label="Force-directed graph"></svg>
30
+ <div class="edgestyle" id="edgeChips"><span class="cap">Edges</span></div>
31
+ <div class="lcount" id="lcount"></div>
32
+ <div class="legend" id="legend"></div>
33
+ <div class="zoomctl">
34
+ <button class="iconbtn" id="zin" aria-label="Zoom in">+</button>
35
+ <button class="iconbtn" id="zout" aria-label="Zoom out">−</button>
36
+ <button class="iconbtn" id="zreset" aria-label="Reset view">⟲</button>
37
+ </div>
38
+ <div class="emptytab" id="graphEmpty" hidden></div>
39
+ </div>
40
+ <div class="outline" id="outlineView" hidden>
41
+ <div class="tree" id="tree"></div>
42
+ </div>
43
+ <div class="resizer" id="detailResizer" role="separator" aria-orientation="vertical" aria-label="Resize details panel" tabindex="0" title="Drag to resize"></div>
44
+ <aside class="detail" id="detail"><div class="empty">Select a node to view details</div></aside>
45
+ </main>
46
+
47
+ <script type="module" src="/app.js"></script>
48
+ </body>
49
+ </html>
@@ -0,0 +1,154 @@
1
+ /* julius viz — design tokens + app styles.
2
+ Visual reference of record: docs/superpowers/specs/2026-07-15-julius-viz-design.md */
3
+ :root{
4
+ --bg:#F4F6F6; --panel:#FFFFFF; --panel2:#FBFCFC; --ink:#17191B; --muted:#6B7278;
5
+ --border:#E2E6E7; --border2:#EDF0F1; --accent:#546FFF; --accent-ink:#546FFF;
6
+ --chip:#F0F3F3;
7
+ --sys:#4A7DF0; --con:#A06BDB; --fil:#D98E2B; --api:#C95CB8;
8
+ --k-file:#D98E2B; --k-class:#4A7DF0; --k-fn:#4F86C6; --k-method:#3AA7C9; --k-iface:#A06BDB; --k-type:#C95CB8; --k-enum:#B69B3D;
9
+ --edge:#9AA4A9; --canvas:#F8FAFA;
10
+ }
11
+ @media (prefers-color-scheme: dark){
12
+ :root{
13
+ --bg:#0E1012; --panel:#15181B; --panel2:#111417; --ink:#E7E9EA; --muted:#8B9298;
14
+ --border:#252B30; --border2:#1D2226; --accent:#7B8FFF; --accent-ink:#7B8FFF;
15
+ --chip:#1C2125;
16
+ --sys:#6B94F5; --con:#B487E0; --fil:#E0A04A; --api:#D183C9;
17
+ --k-file:#E0A04A; --k-class:#6B94F5; --k-fn:#7EAEDD; --k-method:#56B9D8; --k-iface:#B487E0; --k-type:#D183C9; --k-enum:#D4BB5E;
18
+ --edge:#4A545B; --canvas:#101315;
19
+ }
20
+ }
21
+ :root[data-theme="dark"]{
22
+ --bg:#0E1012; --panel:#15181B; --panel2:#111417; --ink:#E7E9EA; --muted:#8B9298;
23
+ --border:#252B30; --border2:#1D2226; --accent:#7B8FFF; --accent-ink:#7B8FFF;
24
+ --chip:#1C2125;
25
+ --sys:#6B94F5; --con:#B487E0; --fil:#E0A04A; --api:#D183C9;
26
+ --k-file:#E0A04A; --k-class:#6B94F5; --k-fn:#7EAEDD; --k-method:#56B9D8; --k-iface:#B487E0; --k-type:#D183C9; --k-enum:#D4BB5E;
27
+ --edge:#4A545B; --canvas:#101315;
28
+ }
29
+ :root[data-theme="light"]{
30
+ --bg:#F4F6F6; --panel:#FFFFFF; --panel2:#FBFCFC; --ink:#17191B; --muted:#6B7278;
31
+ --border:#E2E6E7; --border2:#EDF0F1; --accent:#546FFF; --accent-ink:#546FFF;
32
+ --chip:#F0F3F3;
33
+ --sys:#4A7DF0; --con:#A06BDB; --fil:#D98E2B; --api:#C95CB8;
34
+ --k-file:#D98E2B; --k-class:#4A7DF0; --k-fn:#4F86C6; --k-method:#3AA7C9; --k-iface:#A06BDB; --k-type:#C95CB8; --k-enum:#B69B3D;
35
+ --edge:#9AA4A9; --canvas:#F8FAFA;
36
+ }
37
+
38
+ *{box-sizing:border-box}
39
+ [hidden]{display:none !important}
40
+ html,body{margin:0;padding:0;height:100%}
41
+ body{
42
+ display:flex;flex-direction:column;
43
+ background:var(--bg);color:var(--ink);
44
+ font-family:"Avenir Next","Segoe UI",system-ui,-apple-system,sans-serif;
45
+ font-size:15px;line-height:1.55;-webkit-font-smoothing:antialiased;
46
+ }
47
+ .mono{font-family:ui-monospace,"SF Mono",SFMono-Regular,Menlo,Consolas,monospace}
48
+ button:focus-visible,input:focus-visible,.tree-row:focus-visible{outline:2px solid var(--accent);outline-offset:2px}
49
+
50
+ .appbar{display:flex;align-items:center;gap:14px;padding:10px 16px;border-bottom:1px solid var(--border);background:var(--panel);flex:none}
51
+ .brand{display:flex;align-items:baseline;gap:8px;flex:none}
52
+ .brand b{font-weight:700;letter-spacing:-.01em}
53
+ .brand span{color:var(--muted);font-size:13px}
54
+ .counts{color:var(--muted);font-size:12.5px;font-variant-numeric:tabular-nums;flex:none}
55
+ .tabs{display:flex;background:var(--chip);border-radius:9px;padding:3px;gap:2px;margin-left:auto;flex:none}
56
+ .tab{border:0;background:transparent;color:var(--muted);font:inherit;font-size:13px;font-weight:600;padding:5px 14px;border-radius:7px;cursor:pointer}
57
+ .tab:hover{color:var(--ink)}
58
+ .tab[aria-selected="true"]{background:var(--panel);color:var(--ink);box-shadow:0 1px 3px rgba(0,0,0,.12)}
59
+ .searchbox{position:relative;flex:none}
60
+ .searchbox input{width:190px;padding:6px 10px 6px 30px;border:1px solid var(--border);border-radius:8px;background:var(--panel2);color:var(--ink);font:inherit;font-size:13px;outline:none}
61
+ .searchbox input:focus{border-color:var(--accent)}
62
+ .searchbox svg{position:absolute;left:9px;top:50%;transform:translateY(-50%);opacity:.45}
63
+ .iconbtn{border:1px solid var(--border);background:var(--panel2);color:var(--ink);border-radius:8px;width:32px;height:32px;cursor:pointer;display:grid;place-items:center;flex:none;font:inherit;font-size:14px}
64
+ .iconbtn:hover{border-color:var(--muted)}
65
+
66
+ .stage{display:flex;flex:1;min-height:0;background:var(--canvas)}
67
+ .canvas-wrap{position:relative;flex:1;min-width:0}
68
+ svg.graph{display:block;width:100%;height:100%;cursor:grab}
69
+ svg.graph:active{cursor:grabbing}
70
+
71
+ .edgestyle{position:absolute;top:12px;left:14px;display:flex;align-items:center;gap:5px;flex-wrap:wrap;max-width:75%}
72
+ .edgestyle .cap{font-size:10px;letter-spacing:.12em;text-transform:uppercase;color:var(--muted);font-weight:700;margin-right:3px}
73
+ .echip{display:inline-flex;align-items:center;gap:5px;border:1px solid var(--border);background:var(--panel);color:var(--muted);border-radius:16px;padding:3px 10px;font:inherit;font-size:11.5px;font-weight:600;cursor:pointer}
74
+ .echip:hover{color:var(--ink)}
75
+ .echip.on{color:var(--ink)}
76
+ .echip:not(.on){opacity:.45}
77
+
78
+ .legend{position:absolute;left:14px;bottom:14px;display:flex;gap:6px;flex-wrap:wrap;max-width:70%}
79
+ .lchip{display:flex;align-items:center;gap:6px;font-size:12px;font-weight:600;color:var(--ink);background:var(--panel);border:1px solid var(--border);border-radius:20px;padding:4px 11px;cursor:pointer;user-select:none;font-family:inherit}
80
+ .lchip .sw{width:9px;height:9px;border-radius:50%}
81
+ .lchip.off{opacity:.38}
82
+ .lcount{position:absolute;left:14px;bottom:52px;font-size:11.5px;color:var(--muted);font-variant-numeric:tabular-nums}
83
+ .zoomctl{position:absolute;right:14px;bottom:14px;display:flex;flex-direction:column;gap:6px}
84
+ .zoomctl .iconbtn{background:var(--panel)}
85
+
86
+ .resizer{flex:none;width:9px;margin:0 -4px;z-index:6;cursor:col-resize;position:relative;touch-action:none}
87
+ .resizer::before{content:"";position:absolute;top:0;bottom:0;left:4px;width:1px;background:var(--border)}
88
+ .resizer:hover::before,.resizer:focus-visible::before{left:3px;width:3px;background:var(--accent)}
89
+ .resizer:focus-visible{outline:none}
90
+ .detail{width:var(--detail-w,300px);flex:none;border-left:1px solid var(--border);background:var(--panel);overflow-y:auto;padding:18px 18px 24px}
91
+ .detail .empty{color:var(--muted);font-size:13.5px;text-align:center;margin-top:200px}
92
+ .d-type{display:inline-flex;align-items:center;gap:6px;font-size:11px;letter-spacing:.1em;text-transform:uppercase;font-weight:700;padding:3px 10px;border-radius:20px;background:var(--chip)}
93
+ .d-type .sw{width:8px;height:8px;border-radius:50%}
94
+ .detail h3{margin:10px 0 6px;font-size:17px;letter-spacing:-.01em}
95
+ .detail p.summary{font-size:13.5px;color:var(--ink);margin:0 0 16px;white-space:pre-line}
96
+ .d-label{font-size:10.5px;letter-spacing:.13em;text-transform:uppercase;color:var(--muted);font-weight:700;margin:16px 0 7px;display:flex;align-items:center;gap:5px}
97
+ .d-label .dot{display:inline-block;width:7px;height:7px;border-radius:50%}
98
+ .src{font-size:12px;color:var(--muted);padding:3px 0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
99
+ .lnk{display:block;width:100%;text-align:left;border:1px solid var(--border2);background:var(--panel2);border-radius:8px;padding:7px 10px;margin-bottom:6px;cursor:pointer;font:inherit;color:var(--ink)}
100
+ .lnk:hover{border-color:var(--accent)}
101
+ .lnk .rel{font-size:10.5px;letter-spacing:.09em;text-transform:uppercase;color:var(--accent-ink);font-weight:700}
102
+ .lnk .to{font-size:13px;font-weight:600}
103
+ .lnk .desc{font-size:12px;color:var(--muted)}
104
+
105
+ .outline{flex:1;display:flex;min-width:0}
106
+ .tree{flex:1;overflow-y:auto;padding:14px 8px 20px 14px;background:var(--panel)}
107
+ .tree-tools{display:flex;gap:14px;font-size:12.5px;color:var(--muted);padding:2px 8px 10px}
108
+ .tree-tools button{border:0;background:none;color:var(--accent-ink);font:inherit;font-size:12.5px;cursor:pointer;padding:0}
109
+ .tree-row{display:flex;align-items:center;gap:7px;padding:4px 8px;border-radius:7px;cursor:pointer;border:0;background:none;width:100%;text-align:left;font:inherit;color:var(--ink)}
110
+ .tree-row:hover{background:var(--chip)}
111
+ .tree-row.sel{background:var(--chip)}
112
+ .tree-row .chev{width:14px;flex:none;color:var(--muted);font-size:10px;transition:transform .12s}
113
+ .tree-row.open .chev{transform:rotate(90deg)}
114
+ .tree-row .k{width:9px;height:9px;border-radius:3px;flex:none}
115
+ .tree-row .t{overflow:hidden;text-overflow:ellipsis;white-space:nowrap;font-size:13.5px}
116
+ .tree-row .badge{margin-left:auto;font-size:11px;color:var(--muted);font-variant-numeric:tabular-nums;flex:none}
117
+ .tree-kids{margin-left:19px;border-left:1px solid var(--border2);padding-left:4px}
118
+
119
+ .emptytab{position:absolute;inset:0;display:grid;place-items:center;color:var(--muted);font-size:14px;text-align:center;padding:30px;background:var(--canvas)}
120
+ .emptytab code{background:var(--chip);padding:2px 8px;border-radius:6px;font-family:ui-monospace,"SF Mono",Menlo,Consolas,monospace;font-size:.9em}
121
+
122
+ @media (prefers-reduced-motion:reduce){ .tree-row .chev{transition:none} }
123
+ @media (max-width:760px){ .detail,.resizer{display:none} .searchbox input{width:120px} .counts{display:none} }
124
+ /* Evidence blocks: a snippet under a node, so a panel shows the change rather
125
+ than a line number the reader has to go and look up. */
126
+ .ev{margin:7px 0 11px;border:1px solid var(--line);border-radius:7px;overflow:hidden}
127
+ .ev-h{font-size:11px;padding:5px 8px;background:var(--chip);color:var(--fg);border-bottom:1px solid var(--line);overflow-wrap:anywhere}
128
+ .ev-note{color:var(--muted);font-style:italic}
129
+ .ev-b{font-size:11.5px;padding:4px 0;overflow-x:auto}
130
+ .ev-l{display:flex;gap:8px;padding:1px 8px}
131
+ .ev-n{color:var(--muted);opacity:.65;min-width:2.6em;text-align:right;user-select:none;flex:none}
132
+ .ev-s{width:.7em;user-select:none;flex:none}
133
+ /* Wrapped, not scrolled: the panel is ~280px and a diff line is longer than
134
+ that, so a horizontal scrollbar per hunk would hide the half that matters. */
135
+ .ev-t{flex:1;white-space:pre-wrap;overflow-wrap:anywhere}
136
+ .ev-l.add{background:color-mix(in srgb,var(--ok,#2E9E6B) 11%,transparent)}
137
+ .ev-l.del{background:color-mix(in srgb,var(--warn,#D9534F) 10%,transparent)}
138
+ .ev-l.add .ev-s{color:var(--ok,#2E9E6B)}
139
+ .ev-l.del .ev-s{color:var(--warn,#D9534F)}
140
+ .ev-more{font-size:11px;color:var(--muted);padding:3px 9px 5px}
141
+
142
+ /* ---- contributors: who has worked on an area (blast --export-viz) ---- */
143
+ .lchip.lchip-people{border-color:var(--con);color:var(--con)}
144
+ .owners{display:flex;flex-direction:column;gap:2px;margin:6px 0 2px}
145
+ .own{display:flex;align-items:center;gap:9px;padding:6px 8px;border-radius:7px;background:var(--panel2);border:1px solid var(--border2)}
146
+ .av{
147
+ width:25px;height:25px;border-radius:50%;flex:none;display:grid;place-items:center;
148
+ font-family:ui-monospace,"SF Mono",SFMono-Regular,Menlo,Consolas,monospace;
149
+ font-size:10px;font-weight:700;color:var(--con);background:var(--chip);border:1px solid var(--con);
150
+ }
151
+ .own-txt{display:flex;flex-direction:column;min-width:0;gap:1px}
152
+ .own-name{font-size:12.5px;font-weight:600;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
153
+ .own-why{font-size:11px;color:var(--muted);font-variant-numeric:tabular-nums}
154
+ .own-note{font-size:11px;color:var(--muted);padding:3px 8px 0;line-height:1.45}