@ruverd/julius 0.0.0-stage → 0.24.1
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.
- package/CHANGELOG.md +47 -0
- package/CREDITS.md +25 -0
- package/LICENSE +21 -0
- package/PROVENANCE.md +9 -0
- package/README.md +229 -2
- package/dist/ai/crux.d.ts +60 -0
- package/dist/ai/crux.d.ts.map +1 -0
- package/dist/ai/crux.js +141 -0
- package/dist/ai/crux.js.map +1 -0
- package/dist/ai/failure.d.ts +60 -0
- package/dist/ai/failure.d.ts.map +1 -0
- package/dist/ai/failure.js +86 -0
- package/dist/ai/failure.js.map +1 -0
- package/dist/ai/llm/anthropic.d.ts +37 -0
- package/dist/ai/llm/anthropic.d.ts.map +1 -0
- package/dist/ai/llm/anthropic.js +144 -0
- package/dist/ai/llm/anthropic.js.map +1 -0
- package/dist/ai/llm/factory.d.ts +28 -0
- package/dist/ai/llm/factory.d.ts.map +1 -0
- package/dist/ai/llm/factory.js +36 -0
- package/dist/ai/llm/factory.js.map +1 -0
- package/dist/ai/llm/litellm.d.ts +34 -0
- package/dist/ai/llm/litellm.d.ts.map +1 -0
- package/dist/ai/llm/litellm.js +45 -0
- package/dist/ai/llm/litellm.js.map +1 -0
- package/dist/ai/llm/openai.d.ts +44 -0
- package/dist/ai/llm/openai.d.ts.map +1 -0
- package/dist/ai/llm/openai.js +239 -0
- package/dist/ai/llm/openai.js.map +1 -0
- package/dist/ai/llm/orcarouter.d.ts +34 -0
- package/dist/ai/llm/orcarouter.d.ts.map +1 -0
- package/dist/ai/llm/orcarouter.js +45 -0
- package/dist/ai/llm/orcarouter.js.map +1 -0
- package/dist/ai/llm/recover-tool.d.ts +19 -0
- package/dist/ai/llm/recover-tool.d.ts.map +1 -0
- package/dist/ai/llm/recover-tool.js +109 -0
- package/dist/ai/llm/recover-tool.js.map +1 -0
- package/dist/ai/llm/types.d.ts +122 -0
- package/dist/ai/llm/types.d.ts.map +1 -0
- package/dist/ai/llm/types.js +33 -0
- package/dist/ai/llm/types.js.map +1 -0
- package/dist/ai/providers.d.ts +59 -0
- package/dist/ai/providers.d.ts.map +1 -0
- package/dist/ai/providers.js +54 -0
- package/dist/ai/providers.js.map +1 -0
- package/dist/ai/summarize.d.ts +25 -0
- package/dist/ai/summarize.d.ts.map +1 -0
- package/dist/ai/summarize.js +34 -0
- package/dist/ai/summarize.js.map +1 -0
- package/dist/ai/synthesize.d.ts +40 -0
- package/dist/ai/synthesize.d.ts.map +1 -0
- package/dist/ai/synthesize.js +131 -0
- package/dist/ai/synthesize.js.map +1 -0
- package/dist/app/checkout.d.ts +46 -0
- package/dist/app/checkout.d.ts.map +1 -0
- package/dist/app/checkout.js +223 -0
- package/dist/app/checkout.js.map +1 -0
- package/dist/app/events.d.ts +44 -0
- package/dist/app/events.d.ts.map +1 -0
- package/dist/app/events.js +64 -0
- package/dist/app/events.js.map +1 -0
- package/dist/app/identity.d.ts +54 -0
- package/dist/app/identity.d.ts.map +1 -0
- package/dist/app/identity.js +96 -0
- package/dist/app/identity.js.map +1 -0
- package/dist/app/main.d.ts +2 -0
- package/dist/app/main.d.ts.map +1 -0
- package/dist/app/main.js +62 -0
- package/dist/app/main.js.map +1 -0
- package/dist/app/pages.d.ts +56 -0
- package/dist/app/pages.d.ts.map +1 -0
- package/dist/app/pages.js +193 -0
- package/dist/app/pages.js.map +1 -0
- package/dist/app/queue.d.ts +40 -0
- package/dist/app/queue.d.ts.map +1 -0
- package/dist/app/queue.js +68 -0
- package/dist/app/queue.js.map +1 -0
- package/dist/app/review-process.d.ts +66 -0
- package/dist/app/review-process.d.ts.map +1 -0
- package/dist/app/review-process.js +200 -0
- package/dist/app/review-process.js.map +1 -0
- package/dist/app/review-worker.d.ts +2 -0
- package/dist/app/review-worker.d.ts.map +1 -0
- package/dist/app/review-worker.js +108 -0
- package/dist/app/review-worker.js.map +1 -0
- package/dist/app/review.d.ts +23 -0
- package/dist/app/review.d.ts.map +1 -0
- package/dist/app/review.js +142 -0
- package/dist/app/review.js.map +1 -0
- package/dist/app/server.d.ts +49 -0
- package/dist/app/server.d.ts.map +1 -0
- package/dist/app/server.js +123 -0
- package/dist/app/server.js.map +1 -0
- package/dist/ask/ask.d.ts +195 -0
- package/dist/ask/ask.d.ts.map +1 -0
- package/dist/ask/ask.js +1252 -0
- package/dist/ask/ask.js.map +1 -0
- package/dist/ask/file-rank.d.ts +72 -0
- package/dist/ask/file-rank.d.ts.map +1 -0
- package/dist/ask/file-rank.js +160 -0
- package/dist/ask/file-rank.js.map +1 -0
- package/dist/ask/file-selection.d.ts +22 -0
- package/dist/ask/file-selection.d.ts.map +1 -0
- package/dist/ask/file-selection.js +66 -0
- package/dist/ask/file-selection.js.map +1 -0
- package/dist/ask/fuse.d.ts +195 -0
- package/dist/ask/fuse.d.ts.map +1 -0
- package/dist/ask/fuse.js +344 -0
- package/dist/ask/fuse.js.map +1 -0
- package/dist/ask/graphrank.d.ts +61 -0
- package/dist/ask/graphrank.d.ts.map +1 -0
- package/dist/ask/graphrank.js +130 -0
- package/dist/ask/graphrank.js.map +1 -0
- package/dist/ask/index-file.d.ts +44 -0
- package/dist/ask/index-file.d.ts.map +1 -0
- package/dist/ask/index-file.js +128 -0
- package/dist/ask/index-file.js.map +1 -0
- package/dist/bin/julius.d.ts +3 -0
- package/dist/bin/julius.d.ts.map +1 -0
- package/dist/bin/julius.js +4 -0
- package/dist/bin/julius.js.map +1 -0
- package/dist/blast/blast-cli.d.ts +35 -0
- package/dist/blast/blast-cli.d.ts.map +1 -0
- package/dist/blast/blast-cli.js +155 -0
- package/dist/blast/blast-cli.js.map +1 -0
- package/dist/blast/blast.d.ts +128 -0
- package/dist/blast/blast.d.ts.map +1 -0
- package/dist/blast/blast.js +383 -0
- package/dist/blast/blast.js.map +1 -0
- package/dist/blast/diff.d.ts +53 -0
- package/dist/blast/diff.d.ts.map +1 -0
- package/dist/blast/diff.js +193 -0
- package/dist/blast/diff.js.map +1 -0
- package/dist/blast/evidence.d.ts +51 -0
- package/dist/blast/evidence.d.ts.map +1 -0
- package/dist/blast/evidence.js +162 -0
- package/dist/blast/evidence.js.map +1 -0
- package/dist/blast/modules.d.ts +33 -0
- package/dist/blast/modules.d.ts.map +1 -0
- package/dist/blast/modules.js +83 -0
- package/dist/blast/modules.js.map +1 -0
- package/dist/blast/name.d.ts +74 -0
- package/dist/blast/name.d.ts.map +1 -0
- package/dist/blast/name.js +269 -0
- package/dist/blast/name.js.map +1 -0
- package/dist/blast/owners.d.ts +85 -0
- package/dist/blast/owners.d.ts.map +1 -0
- package/dist/blast/owners.js +272 -0
- package/dist/blast/owners.js.map +1 -0
- package/dist/blast/render.d.ts +46 -0
- package/dist/blast/render.d.ts.map +1 -0
- package/dist/blast/render.js +422 -0
- package/dist/blast/render.js.map +1 -0
- package/dist/blast/viz.d.ts +37 -0
- package/dist/blast/viz.d.ts.map +1 -0
- package/dist/blast/viz.js +180 -0
- package/dist/blast/viz.js.map +1 -0
- package/dist/brand.d.ts +13 -0
- package/dist/brand.d.ts.map +1 -0
- package/dist/brand.js +43 -0
- package/dist/brand.js.map +1 -0
- package/dist/check/learning-edits.d.ts +9 -0
- package/dist/check/learning-edits.d.ts.map +1 -0
- package/dist/check/learning-edits.js +62 -0
- package/dist/check/learning-edits.js.map +1 -0
- package/dist/check/local-check.d.ts +104 -0
- package/dist/check/local-check.d.ts.map +1 -0
- package/dist/check/local-check.js +830 -0
- package/dist/check/local-check.js.map +1 -0
- package/dist/check/types.d.ts +31 -0
- package/dist/check/types.d.ts.map +1 -0
- package/dist/check/types.js +2 -0
- package/dist/check/types.js.map +1 -0
- package/dist/claude/build-progress.d.ts +29 -0
- package/dist/claude/build-progress.d.ts.map +1 -0
- package/dist/claude/build-progress.js +76 -0
- package/dist/claude/build-progress.js.map +1 -0
- package/dist/claude/format.d.ts +131 -0
- package/dist/claude/format.d.ts.map +1 -0
- package/dist/claude/format.js +328 -0
- package/dist/claude/format.js.map +1 -0
- package/dist/claude/hook-layers.d.ts +8 -0
- package/dist/claude/hook-layers.d.ts.map +1 -0
- package/dist/claude/hook-layers.js +74 -0
- package/dist/claude/hook-layers.js.map +1 -0
- package/dist/claude/hooks.d.ts +101 -0
- package/dist/claude/hooks.d.ts.map +1 -0
- package/dist/claude/hooks.js +849 -0
- package/dist/claude/hooks.js.map +1 -0
- package/dist/claude/init.d.ts +70 -0
- package/dist/claude/init.d.ts.map +1 -0
- package/dist/claude/init.js +207 -0
- package/dist/claude/init.js.map +1 -0
- package/dist/claude/note-signals.d.ts +28 -0
- package/dist/claude/note-signals.d.ts.map +1 -0
- package/dist/claude/note-signals.js +325 -0
- package/dist/claude/note-signals.js.map +1 -0
- package/dist/claude/paths.d.ts +9 -0
- package/dist/claude/paths.d.ts.map +1 -0
- package/dist/claude/paths.js +22 -0
- package/dist/claude/paths.js.map +1 -0
- package/dist/claude/session-metrics.d.ts +73 -0
- package/dist/claude/session-metrics.d.ts.map +1 -0
- package/dist/claude/session-metrics.js +209 -0
- package/dist/claude/session-metrics.js.map +1 -0
- package/dist/claude/settings-merge.d.ts +66 -0
- package/dist/claude/settings-merge.d.ts.map +1 -0
- package/dist/claude/settings-merge.js +249 -0
- package/dist/claude/settings-merge.js.map +1 -0
- package/dist/claude/shim-template.d.ts +18 -0
- package/dist/claude/shim-template.d.ts.map +1 -0
- package/dist/claude/shim-template.js +226 -0
- package/dist/claude/shim-template.js.map +1 -0
- package/dist/claude/skill-template.d.ts +12 -0
- package/dist/claude/skill-template.d.ts.map +1 -0
- package/dist/claude/skill-template.js +294 -0
- package/dist/claude/skill-template.js.map +1 -0
- package/dist/claude/state.d.ts +73 -0
- package/dist/claude/state.d.ts.map +1 -0
- package/dist/claude/state.js +33 -0
- package/dist/claude/state.js.map +1 -0
- package/dist/claude/stats.d.ts +5 -0
- package/dist/claude/stats.d.ts.map +1 -0
- package/dist/claude/stats.js +24 -0
- package/dist/claude/stats.js.map +1 -0
- package/dist/claude/statusline.d.ts +14 -0
- package/dist/claude/statusline.d.ts.map +1 -0
- package/dist/claude/statusline.js +45 -0
- package/dist/claude/statusline.js.map +1 -0
- package/dist/claude/sync-run.d.ts +3 -0
- package/dist/claude/sync-run.d.ts.map +1 -0
- package/dist/claude/sync-run.js +46 -0
- package/dist/claude/sync-run.js.map +1 -0
- package/dist/claude/tally.d.ts +50 -0
- package/dist/claude/tally.d.ts.map +1 -0
- package/dist/claude/tally.js +211 -0
- package/dist/claude/tally.js.map +1 -0
- package/dist/cli-epilogue.d.ts +12 -0
- package/dist/cli-epilogue.d.ts.map +1 -0
- package/dist/cli-epilogue.js +55 -0
- package/dist/cli-epilogue.js.map +1 -0
- package/dist/cli-meta.d.ts +45 -0
- package/dist/cli-meta.d.ts.map +1 -0
- package/dist/cli-meta.js +145 -0
- package/dist/cli-meta.js.map +1 -0
- package/dist/cli-picker.d.ts +129 -0
- package/dist/cli-picker.d.ts.map +1 -0
- package/dist/cli-picker.js +432 -0
- package/dist/cli-picker.js.map +1 -0
- package/dist/cli.d.ts +3 -0
- package/dist/cli.d.ts.map +1 -0
- package/dist/cli.js +2213 -0
- package/dist/cli.js.map +1 -0
- package/dist/cloud/diff.d.ts +20 -0
- package/dist/cloud/diff.d.ts.map +1 -0
- package/dist/cloud/diff.js +59 -0
- package/dist/cloud/diff.js.map +1 -0
- package/dist/cloud/nudge.d.ts +66 -0
- package/dist/cloud/nudge.d.ts.map +1 -0
- package/dist/cloud/nudge.js +268 -0
- package/dist/cloud/nudge.js.map +1 -0
- package/dist/cloud/workspace-sync.d.ts +58 -0
- package/dist/cloud/workspace-sync.d.ts.map +1 -0
- package/dist/cloud/workspace-sync.js +268 -0
- package/dist/cloud/workspace-sync.js.map +1 -0
- package/dist/cloud/workspace.d.ts +159 -0
- package/dist/cloud/workspace.d.ts.map +1 -0
- package/dist/cloud/workspace.js +134 -0
- package/dist/cloud/workspace.js.map +1 -0
- package/dist/context/build.d.ts +52 -0
- package/dist/context/build.d.ts.map +1 -0
- package/dist/context/build.js +362 -0
- package/dist/context/build.js.map +1 -0
- package/dist/context/check.d.ts +42 -0
- package/dist/context/check.d.ts.map +1 -0
- package/dist/context/check.js +162 -0
- package/dist/context/check.js.map +1 -0
- package/dist/context/map-dir.d.ts +4 -0
- package/dist/context/map-dir.d.ts.map +1 -0
- package/dist/context/map-dir.js +6 -0
- package/dist/context/map-dir.js.map +1 -0
- package/dist/context/node-file.d.ts +109 -0
- package/dist/context/node-file.d.ts.map +1 -0
- package/dist/context/node-file.js +362 -0
- package/dist/context/node-file.js.map +1 -0
- package/dist/context/price.d.ts +49 -0
- package/dist/context/price.d.ts.map +1 -0
- package/dist/context/price.js +83 -0
- package/dist/context/price.js.map +1 -0
- package/dist/context/savings.d.ts +26 -0
- package/dist/context/savings.d.ts.map +1 -0
- package/dist/context/savings.js +59 -0
- package/dist/context/savings.js.map +1 -0
- package/dist/economy/cli.d.ts +3 -0
- package/dist/economy/cli.d.ts.map +1 -0
- package/dist/economy/cli.js +52 -0
- package/dist/economy/cli.js.map +1 -0
- package/dist/economy/delivery.d.ts +49 -0
- package/dist/economy/delivery.d.ts.map +1 -0
- package/dist/economy/delivery.js +176 -0
- package/dist/economy/delivery.js.map +1 -0
- package/dist/economy/index.d.ts +68 -0
- package/dist/economy/index.d.ts.map +1 -0
- package/dist/economy/index.js +524 -0
- package/dist/economy/index.js.map +1 -0
- package/dist/engine.d.ts +83 -0
- package/dist/engine.d.ts.map +1 -0
- package/dist/engine.js +122 -0
- package/dist/engine.js.map +1 -0
- package/dist/evaluation/index.d.ts +41 -0
- package/dist/evaluation/index.d.ts.map +1 -0
- package/dist/evaluation/index.js +61 -0
- package/dist/evaluation/index.js.map +1 -0
- package/dist/graph/bindings.d.ts +64 -0
- package/dist/graph/bindings.d.ts.map +1 -0
- package/dist/graph/bindings.js +713 -0
- package/dist/graph/bindings.js.map +1 -0
- package/dist/graph/build.d.ts +88 -0
- package/dist/graph/build.d.ts.map +1 -0
- package/dist/graph/build.js +375 -0
- package/dist/graph/build.js.map +1 -0
- package/dist/graph/cards.d.ts +46 -0
- package/dist/graph/cards.d.ts.map +1 -0
- package/dist/graph/cards.js +280 -0
- package/dist/graph/cards.js.map +1 -0
- package/dist/graph/check.d.ts +25 -0
- package/dist/graph/check.d.ts.map +1 -0
- package/dist/graph/check.js +192 -0
- package/dist/graph/check.js.map +1 -0
- package/dist/graph/container.d.ts +63 -0
- package/dist/graph/container.d.ts.map +1 -0
- package/dist/graph/container.js +190 -0
- package/dist/graph/container.js.map +1 -0
- package/dist/graph/enrich.d.ts +62 -0
- package/dist/graph/enrich.d.ts.map +1 -0
- package/dist/graph/enrich.js +253 -0
- package/dist/graph/enrich.js.map +1 -0
- package/dist/graph/extract-cache.d.ts +101 -0
- package/dist/graph/extract-cache.d.ts.map +1 -0
- package/dist/graph/extract-cache.js +199 -0
- package/dist/graph/extract-cache.js.map +1 -0
- package/dist/graph/extract.d.ts +85 -0
- package/dist/graph/extract.d.ts.map +1 -0
- package/dist/graph/extract.js +2376 -0
- package/dist/graph/extract.js.map +1 -0
- package/dist/graph/fingerprint.d.ts +76 -0
- package/dist/graph/fingerprint.d.ts.map +1 -0
- package/dist/graph/fingerprint.js +160 -0
- package/dist/graph/fingerprint.js.map +1 -0
- package/dist/graph/generic.d.ts +74 -0
- package/dist/graph/generic.d.ts.map +1 -0
- package/dist/graph/generic.js +580 -0
- package/dist/graph/generic.js.map +1 -0
- package/dist/graph/invariants.d.ts +33 -0
- package/dist/graph/invariants.d.ts.map +1 -0
- package/dist/graph/invariants.js +52 -0
- package/dist/graph/invariants.js.map +1 -0
- package/dist/graph/load.d.ts +29 -0
- package/dist/graph/load.d.ts.map +1 -0
- package/dist/graph/load.js +97 -0
- package/dist/graph/load.js.map +1 -0
- package/dist/graph/lsp/client.d.ts +43 -0
- package/dist/graph/lsp/client.d.ts.map +1 -0
- package/dist/graph/lsp/client.js +179 -0
- package/dist/graph/lsp/client.js.map +1 -0
- package/dist/graph/lsp/enrich.d.ts +11 -0
- package/dist/graph/lsp/enrich.d.ts.map +1 -0
- package/dist/graph/lsp/enrich.js +155 -0
- package/dist/graph/lsp/enrich.js.map +1 -0
- package/dist/graph/lsp/registry.d.ts +15 -0
- package/dist/graph/lsp/registry.d.ts.map +1 -0
- package/dist/graph/lsp/registry.js +46 -0
- package/dist/graph/lsp/registry.js.map +1 -0
- package/dist/graph/map.d.ts +107 -0
- package/dist/graph/map.d.ts.map +1 -0
- package/dist/graph/map.js +239 -0
- package/dist/graph/map.js.map +1 -0
- package/dist/graph/native.d.ts +38 -0
- package/dist/graph/native.d.ts.map +1 -0
- package/dist/graph/native.js +169 -0
- package/dist/graph/native.js.map +1 -0
- package/dist/graph/queries/c.scm +13 -0
- package/dist/graph/queries/c_sharp.scm +19 -0
- package/dist/graph/queries/clojure.scm +58 -0
- package/dist/graph/queries/cpp.scm +23 -0
- package/dist/graph/queries/dart.scm +42 -0
- package/dist/graph/queries/elixir.scm +54 -0
- package/dist/graph/queries/java.scm +20 -0
- package/dist/graph/queries/kotlin.scm +43 -0
- package/dist/graph/queries/lua.scm +36 -0
- package/dist/graph/queries/nix.scm +32 -0
- package/dist/graph/queries/php.scm +40 -0
- package/dist/graph/queries/ruby.scm +65 -0
- package/dist/graph/queries/rust.scm +41 -0
- package/dist/graph/queries/scala.scm +66 -0
- package/dist/graph/queries/solidity.scm +43 -0
- package/dist/graph/queries/swift.scm +51 -0
- package/dist/graph/refresh.d.ts +49 -0
- package/dist/graph/refresh.d.ts.map +1 -0
- package/dist/graph/refresh.js +255 -0
- package/dist/graph/refresh.js.map +1 -0
- package/dist/graph/relations.d.ts +14 -0
- package/dist/graph/relations.d.ts.map +1 -0
- package/dist/graph/relations.js +8 -0
- package/dist/graph/relations.js.map +1 -0
- package/dist/graph/resolve.d.ts +17 -0
- package/dist/graph/resolve.d.ts.map +1 -0
- package/dist/graph/resolve.js +654 -0
- package/dist/graph/resolve.js.map +1 -0
- package/dist/graph/root.d.ts +11 -0
- package/dist/graph/root.d.ts.map +1 -0
- package/dist/graph/root.js +40 -0
- package/dist/graph/root.js.map +1 -0
- package/dist/graph/scopes.d.ts +42 -0
- package/dist/graph/scopes.d.ts.map +1 -0
- package/dist/graph/scopes.js +342 -0
- package/dist/graph/scopes.js.map +1 -0
- package/dist/graph/seed.d.ts +38 -0
- package/dist/graph/seed.d.ts.map +1 -0
- package/dist/graph/seed.js +226 -0
- package/dist/graph/seed.js.map +1 -0
- package/dist/graph/source-files.d.ts +40 -0
- package/dist/graph/source-files.d.ts.map +1 -0
- package/dist/graph/source-files.js +85 -0
- package/dist/graph/source-files.js.map +1 -0
- package/dist/graph/traverse-cli.d.ts +55 -0
- package/dist/graph/traverse-cli.d.ts.map +1 -0
- package/dist/graph/traverse-cli.js +189 -0
- package/dist/graph/traverse-cli.js.map +1 -0
- package/dist/graph/traverse.d.ts +112 -0
- package/dist/graph/traverse.d.ts.map +1 -0
- package/dist/graph/traverse.js +192 -0
- package/dist/graph/traverse.js.map +1 -0
- package/dist/graph/types.d.ts +78 -0
- package/dist/graph/types.d.ts.map +1 -0
- package/dist/graph/types.js +14 -0
- package/dist/graph/types.js.map +1 -0
- package/dist/graph/workspace-cli.d.ts +48 -0
- package/dist/graph/workspace-cli.d.ts.map +1 -0
- package/dist/graph/workspace-cli.js +102 -0
- package/dist/graph/workspace-cli.js.map +1 -0
- package/dist/graph/workspace.d.ts +135 -0
- package/dist/graph/workspace.d.ts.map +1 -0
- package/dist/graph/workspace.js +598 -0
- package/dist/graph/workspace.js.map +1 -0
- package/dist/graph/write.d.ts +13 -0
- package/dist/graph/write.d.ts.map +1 -0
- package/dist/graph/write.js +86 -0
- package/dist/graph/write.js.map +1 -0
- package/dist/hosts/antigravity.d.ts +8 -0
- package/dist/hosts/antigravity.d.ts.map +1 -0
- package/dist/hosts/antigravity.js +42 -0
- package/dist/hosts/antigravity.js.map +1 -0
- package/dist/hosts/claude-global.d.ts +36 -0
- package/dist/hosts/claude-global.d.ts.map +1 -0
- package/dist/hosts/claude-global.js +153 -0
- package/dist/hosts/claude-global.js.map +1 -0
- package/dist/hosts/codex-hooks.d.ts +11 -0
- package/dist/hosts/codex-hooks.d.ts.map +1 -0
- package/dist/hosts/codex-hooks.js +80 -0
- package/dist/hosts/codex-hooks.js.map +1 -0
- package/dist/hosts/config-write.d.ts +36 -0
- package/dist/hosts/config-write.d.ts.map +1 -0
- package/dist/hosts/config-write.js +64 -0
- package/dist/hosts/config-write.js.map +1 -0
- package/dist/hosts/cursor-hooks.d.ts +21 -0
- package/dist/hosts/cursor-hooks.d.ts.map +1 -0
- package/dist/hosts/cursor-hooks.js +103 -0
- package/dist/hosts/cursor-hooks.js.map +1 -0
- package/dist/hosts/init.d.ts +26 -0
- package/dist/hosts/init.d.ts.map +1 -0
- package/dist/hosts/init.js +82 -0
- package/dist/hosts/init.js.map +1 -0
- package/dist/hosts/install.d.ts +12 -0
- package/dist/hosts/install.d.ts.map +1 -0
- package/dist/hosts/install.js +347 -0
- package/dist/hosts/install.js.map +1 -0
- package/dist/hosts/instructions.d.ts +7 -0
- package/dist/hosts/instructions.d.ts.map +1 -0
- package/dist/hosts/instructions.js +71 -0
- package/dist/hosts/instructions.js.map +1 -0
- package/dist/hosts/investigation-instructions.d.ts +2 -0
- package/dist/hosts/investigation-instructions.d.ts.map +1 -0
- package/dist/hosts/investigation-instructions.js +2 -0
- package/dist/hosts/investigation-instructions.js.map +1 -0
- package/dist/hosts/mcp-config.d.ts +59 -0
- package/dist/hosts/mcp-config.d.ts.map +1 -0
- package/dist/hosts/mcp-config.js +229 -0
- package/dist/hosts/mcp-config.js.map +1 -0
- package/dist/hosts/plan.d.ts +32 -0
- package/dist/hosts/plan.d.ts.map +1 -0
- package/dist/hosts/plan.js +77 -0
- package/dist/hosts/plan.js.map +1 -0
- package/dist/hosts/registry.d.ts +35 -0
- package/dist/hosts/registry.d.ts.map +1 -0
- package/dist/hosts/registry.js +157 -0
- package/dist/hosts/registry.js.map +1 -0
- package/dist/hosts/retract.d.ts +47 -0
- package/dist/hosts/retract.d.ts.map +1 -0
- package/dist/hosts/retract.js +541 -0
- package/dist/hosts/retract.js.map +1 -0
- package/dist/hosts/sections.d.ts +46 -0
- package/dist/hosts/sections.d.ts.map +1 -0
- package/dist/hosts/sections.js +126 -0
- package/dist/hosts/sections.js.map +1 -0
- package/dist/index.d.ts +43 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +33 -0
- package/dist/index.js.map +1 -0
- package/dist/ingest/fs.d.ts +79 -0
- package/dist/ingest/fs.d.ts.map +1 -0
- package/dist/ingest/fs.js +307 -0
- package/dist/ingest/fs.js.map +1 -0
- package/dist/init-guard.d.ts +11 -0
- package/dist/init-guard.d.ts.map +1 -0
- package/dist/init-guard.js +21 -0
- package/dist/init-guard.js.map +1 -0
- package/dist/investigation/index.d.ts +57 -0
- package/dist/investigation/index.d.ts.map +1 -0
- package/dist/investigation/index.js +346 -0
- package/dist/investigation/index.js.map +1 -0
- package/dist/mcp/compact.d.ts +9 -0
- package/dist/mcp/compact.d.ts.map +1 -0
- package/dist/mcp/compact.js +133 -0
- package/dist/mcp/compact.js.map +1 -0
- package/dist/mcp/instructions.d.ts +5 -0
- package/dist/mcp/instructions.d.ts.map +1 -0
- package/dist/mcp/instructions.js +57 -0
- package/dist/mcp/instructions.js.map +1 -0
- package/dist/mcp/server.d.ts +7 -0
- package/dist/mcp/server.d.ts.map +1 -0
- package/dist/mcp/server.js +128 -0
- package/dist/mcp/server.js.map +1 -0
- package/dist/mcp/tool-names.d.ts +20 -0
- package/dist/mcp/tool-names.d.ts.map +1 -0
- package/dist/mcp/tool-names.js +36 -0
- package/dist/mcp/tool-names.js.map +1 -0
- package/dist/mcp/tools.d.ts +22 -0
- package/dist/mcp/tools.d.ts.map +1 -0
- package/dist/mcp/tools.js +300 -0
- package/dist/mcp/tools.js.map +1 -0
- package/dist/notes/ask-notes.d.ts +8 -0
- package/dist/notes/ask-notes.d.ts.map +1 -0
- package/dist/notes/ask-notes.js +19 -0
- package/dist/notes/ask-notes.js.map +1 -0
- package/dist/notes/branches.d.ts +102 -0
- package/dist/notes/branches.d.ts.map +1 -0
- package/dist/notes/branches.js +304 -0
- package/dist/notes/branches.js.map +1 -0
- package/dist/notes/cold-start.d.ts +177 -0
- package/dist/notes/cold-start.d.ts.map +1 -0
- package/dist/notes/cold-start.js +537 -0
- package/dist/notes/cold-start.js.map +1 -0
- package/dist/notes/edit-overlap.d.ts +62 -0
- package/dist/notes/edit-overlap.d.ts.map +1 -0
- package/dist/notes/edit-overlap.js +202 -0
- package/dist/notes/edit-overlap.js.map +1 -0
- package/dist/notes/git-facts.d.ts +21 -0
- package/dist/notes/git-facts.d.ts.map +1 -0
- package/dist/notes/git-facts.js +121 -0
- package/dist/notes/git-facts.js.map +1 -0
- package/dist/notes/home.d.ts +87 -0
- package/dist/notes/home.d.ts.map +1 -0
- package/dist/notes/home.js +430 -0
- package/dist/notes/home.js.map +1 -0
- package/dist/notes/learning-fields.d.ts +102 -0
- package/dist/notes/learning-fields.d.ts.map +1 -0
- package/dist/notes/learning-fields.js +217 -0
- package/dist/notes/learning-fields.js.map +1 -0
- package/dist/notes/note-gate.d.ts +42 -0
- package/dist/notes/note-gate.d.ts.map +1 -0
- package/dist/notes/note-gate.js +181 -0
- package/dist/notes/note-gate.js.map +1 -0
- package/dist/notes/notes.d.ts +214 -0
- package/dist/notes/notes.d.ts.map +1 -0
- package/dist/notes/notes.js +591 -0
- package/dist/notes/notes.js.map +1 -0
- package/dist/notes/pr-reviews.d.ts +108 -0
- package/dist/notes/pr-reviews.d.ts.map +1 -0
- package/dist/notes/pr-reviews.js +325 -0
- package/dist/notes/pr-reviews.js.map +1 -0
- package/dist/notes/repo-julius.d.ts +18 -0
- package/dist/notes/repo-julius.d.ts.map +1 -0
- package/dist/notes/repo-julius.js +111 -0
- package/dist/notes/repo-julius.js.map +1 -0
- package/dist/notes/session-cost.d.ts +35 -0
- package/dist/notes/session-cost.d.ts.map +1 -0
- package/dist/notes/session-cost.js +276 -0
- package/dist/notes/session-cost.js.map +1 -0
- package/dist/search/grep-cli.d.ts +37 -0
- package/dist/search/grep-cli.d.ts.map +1 -0
- package/dist/search/grep-cli.js +119 -0
- package/dist/search/grep-cli.js.map +1 -0
- package/dist/search/grep.d.ts +60 -0
- package/dist/search/grep.d.ts.map +1 -0
- package/dist/search/grep.js +176 -0
- package/dist/search/grep.js.map +1 -0
- package/dist/search/ignored-code.d.ts +9 -0
- package/dist/search/ignored-code.d.ts.map +1 -0
- package/dist/search/ignored-code.js +73 -0
- package/dist/search/ignored-code.js.map +1 -0
- package/dist/skills/skills.d.ts +118 -0
- package/dist/skills/skills.d.ts.map +1 -0
- package/dist/skills/skills.js +370 -0
- package/dist/skills/skills.js.map +1 -0
- package/dist/telemetry/contract.d.ts +103 -0
- package/dist/telemetry/contract.d.ts.map +1 -0
- package/dist/telemetry/contract.js +270 -0
- package/dist/telemetry/contract.js.map +1 -0
- package/dist/telemetry/flush.d.ts +21 -0
- package/dist/telemetry/flush.d.ts.map +1 -0
- package/dist/telemetry/flush.js +85 -0
- package/dist/telemetry/flush.js.map +1 -0
- package/dist/telemetry/gate.d.ts +30 -0
- package/dist/telemetry/gate.d.ts.map +1 -0
- package/dist/telemetry/gate.js +81 -0
- package/dist/telemetry/gate.js.map +1 -0
- package/dist/telemetry/identity.d.ts +40 -0
- package/dist/telemetry/identity.d.ts.map +1 -0
- package/dist/telemetry/identity.js +80 -0
- package/dist/telemetry/identity.js.map +1 -0
- package/dist/telemetry/index.d.ts +18 -0
- package/dist/telemetry/index.d.ts.map +1 -0
- package/dist/telemetry/index.js +16 -0
- package/dist/telemetry/index.js.map +1 -0
- package/dist/telemetry/key.d.ts +4 -0
- package/dist/telemetry/key.d.ts.map +1 -0
- package/dist/telemetry/key.js +4 -0
- package/dist/telemetry/key.js.map +1 -0
- package/dist/telemetry/notice.d.ts +19 -0
- package/dist/telemetry/notice.d.ts.map +1 -0
- package/dist/telemetry/notice.js +93 -0
- package/dist/telemetry/notice.js.map +1 -0
- package/dist/telemetry/queue.d.ts +35 -0
- package/dist/telemetry/queue.d.ts.map +1 -0
- package/dist/telemetry/queue.js +162 -0
- package/dist/telemetry/queue.js.map +1 -0
- package/dist/telemetry/send.d.ts +19 -0
- package/dist/telemetry/send.d.ts.map +1 -0
- package/dist/telemetry/send.js +84 -0
- package/dist/telemetry/send.js.map +1 -0
- package/dist/telemetry/sessions.d.ts +25 -0
- package/dist/telemetry/sessions.d.ts.map +1 -0
- package/dist/telemetry/sessions.js +104 -0
- package/dist/telemetry/sessions.js.map +1 -0
- package/dist/telemetry/track.d.ts +62 -0
- package/dist/telemetry/track.d.ts.map +1 -0
- package/dist/telemetry/track.js +142 -0
- package/dist/telemetry/track.js.map +1 -0
- package/dist/upkeep-run.d.ts +15 -0
- package/dist/upkeep-run.d.ts.map +1 -0
- package/dist/upkeep-run.js +71 -0
- package/dist/upkeep-run.js.map +1 -0
- package/dist/upkeep.d.ts +125 -0
- package/dist/upkeep.d.ts.map +1 -0
- package/dist/upkeep.js +255 -0
- package/dist/upkeep.js.map +1 -0
- package/dist/util/browser.d.ts +3 -0
- package/dist/util/browser.d.ts.map +1 -0
- package/dist/util/browser.js +14 -0
- package/dist/util/browser.js.map +1 -0
- package/dist/util/front-matter.d.ts +19 -0
- package/dist/util/front-matter.d.ts.map +1 -0
- package/dist/util/front-matter.js +21 -0
- package/dist/util/front-matter.js.map +1 -0
- package/dist/util/id.d.ts +7 -0
- package/dist/util/id.d.ts.map +1 -0
- package/dist/util/id.js +14 -0
- package/dist/util/id.js.map +1 -0
- package/dist/util/paths.d.ts +29 -0
- package/dist/util/paths.d.ts.map +1 -0
- package/dist/util/paths.js +71 -0
- package/dist/util/paths.js.map +1 -0
- package/dist/util/source.d.ts +4 -0
- package/dist/util/source.d.ts.map +1 -0
- package/dist/util/source.js +12 -0
- package/dist/util/source.js.map +1 -0
- package/dist/util/spinner.d.ts +15 -0
- package/dist/util/spinner.d.ts.map +1 -0
- package/dist/util/spinner.js +52 -0
- package/dist/util/spinner.js.map +1 -0
- package/dist/util/state.d.ts +100 -0
- package/dist/util/state.d.ts.map +1 -0
- package/dist/util/state.js +186 -0
- package/dist/util/state.js.map +1 -0
- package/dist/viewer/app.js +2 -0
- package/dist/viewer/index.html +49 -0
- package/dist/viewer/style.css +154 -0
- package/dist/viz/assemble.d.ts +83 -0
- package/dist/viz/assemble.d.ts.map +1 -0
- package/dist/viz/assemble.js +101 -0
- package/dist/viz/assemble.js.map +1 -0
- package/dist/viz/export.d.ts +39 -0
- package/dist/viz/export.d.ts.map +1 -0
- package/dist/viz/export.js +98 -0
- package/dist/viz/export.js.map +1 -0
- package/dist/viz/serve.d.ts +12 -0
- package/dist/viz/serve.d.ts.map +1 -0
- package/dist/viz/serve.js +129 -0
- package/dist/viz/serve.js.map +1 -0
- package/docs/assets/context-benchmark.svg +31 -0
- package/docs/assets/julius-hero.png +0 -0
- package/docs/upstream-changelog.md +785 -0
- package/package.json +138 -4
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
import { type Drift } from "./fingerprint.js";
|
|
2
|
+
export interface RefreshResult {
|
|
3
|
+
/** True when the graph on disk was rebuilt by this call. */
|
|
4
|
+
refreshed: boolean;
|
|
5
|
+
/** What the probe found, when it ran and found something. */
|
|
6
|
+
drift?: Drift;
|
|
7
|
+
/** One-line explanation for the agent/user, when there's something worth saying. */
|
|
8
|
+
note?: string;
|
|
9
|
+
}
|
|
10
|
+
export interface RefreshOptions {
|
|
11
|
+
contextDir?: string;
|
|
12
|
+
/** Skip everything (the `--no-refresh` flag). */
|
|
13
|
+
disabled?: boolean;
|
|
14
|
+
}
|
|
15
|
+
/**
|
|
16
|
+
* Release the lock if this process is asked to die while holding it. Returns the
|
|
17
|
+
* un-hook.
|
|
18
|
+
*
|
|
19
|
+
* Not hypothetical: the Claude Code prompt hook runs `julius ask` with a timeout, and
|
|
20
|
+
* `execFileSync` enforces it with SIGTERM. Node's default disposition for SIGTERM is
|
|
21
|
+
* to exit without unwinding, so the `finally` below never runs and the lock outlives
|
|
22
|
+
* the process — after which the background sync is blocked and every query waits and
|
|
23
|
+
* then answers stale until the lock ages out. Ctrl-C on a CLI query is the same story
|
|
24
|
+
* with SIGINT.
|
|
25
|
+
*
|
|
26
|
+
* Adding a listener replaces that default disposition, so re-raise it explicitly
|
|
27
|
+
* afterwards: remove ourselves, then `process.kill(process.pid, sig)`, so the exit
|
|
28
|
+
* status still says "terminated by signal" for whoever is waiting on us.
|
|
29
|
+
*/
|
|
30
|
+
export declare function releaseOnSignal(cache: string): () => void;
|
|
31
|
+
/**
|
|
32
|
+
* Rebuild `root`'s structural graph if the working tree has moved since the last
|
|
33
|
+
* build. Cheap and side-effect-free when nothing changed, which is the usual case.
|
|
34
|
+
*
|
|
35
|
+
* `root` is the repository root (the same value the query itself is given), not
|
|
36
|
+
* the context dir.
|
|
37
|
+
*/
|
|
38
|
+
export declare function ensureFreshGraph(root: string, opts?: RefreshOptions): Promise<RefreshResult>;
|
|
39
|
+
/**
|
|
40
|
+
* Workspace variant: refresh each child repo's own graph (a workspace parent holds
|
|
41
|
+
* an index, never nodes). Children are independent, but they're refreshed in
|
|
42
|
+
* sequence — a fan-out of concurrent tree-sitter builds would spike CPU on the
|
|
43
|
+
* very path that's supposed to feel free.
|
|
44
|
+
*/
|
|
45
|
+
export declare function ensureFreshChildren(root: string, children: string[], opts?: RefreshOptions): Promise<RefreshResult>;
|
|
46
|
+
/** The one-line note a CLI/MCP surface prints when a refresh actually happened.
|
|
47
|
+
* Null when there's nothing to say (the overwhelmingly common case). */
|
|
48
|
+
export declare function refreshNote(r: RefreshResult): string | null;
|
|
49
|
+
//# sourceMappingURL=refresh.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"refresh.d.ts","sourceRoot":"","sources":["../../src/graph/refresh.ts"],"names":[],"mappings":"AAuCA,OAAO,EAAoD,KAAK,KAAK,EAAE,MAAM,kBAAkB,CAAC;AAYhG,MAAM,WAAW,aAAa;IAC5B,4DAA4D;IAC5D,SAAS,EAAE,OAAO,CAAC;IACnB,6DAA6D;IAC7D,KAAK,CAAC,EAAE,KAAK,CAAC;IACd,oFAAoF;IACpF,IAAI,CAAC,EAAE,MAAM,CAAC;CACf;AAED,MAAM,WAAW,cAAc;IAC7B,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,iDAAiD;IACjD,QAAQ,CAAC,EAAE,OAAO,CAAC;CACpB;AAcD;;;;;;;;;;;;;;GAcG;AACH,wBAAgB,eAAe,CAAC,KAAK,EAAE,MAAM,GAAG,MAAM,IAAI,CAWzD;AAuCD;;;;;;GAMG;AACH,wBAAsB,gBAAgB,CAAC,IAAI,EAAE,MAAM,EAAE,IAAI,GAAE,cAAmB,GAAG,OAAO,CAAC,aAAa,CAAC,CA6EtG;AAED;;;;;GAKG;AACH,wBAAsB,mBAAmB,CACvC,IAAI,EAAE,MAAM,EACZ,QAAQ,EAAE,MAAM,EAAE,EAClB,IAAI,GAAE,cAAmB,GACxB,OAAO,CAAC,aAAa,CAAC,CAsBxB;AAED;wEACwE;AACxE,wBAAgB,WAAW,CAAC,CAAC,EAAE,aAAa,GAAG,MAAM,GAAG,IAAI,CAQ3D"}
|
|
@@ -0,0 +1,255 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* `ensureFreshGraph` — the pre-query gate that keeps retrieval honest.
|
|
3
|
+
*
|
|
4
|
+
* Freshness used to be someone else's job: the Claude Code `Stop` hook spawned a
|
|
5
|
+
* background `julius build` *after* the turn ended, so every query an agent made
|
|
6
|
+
* between its first edit and the end of the turn answered from a graph that no
|
|
7
|
+
* longer matched the file it had just changed. Worse, an edit made outside the
|
|
8
|
+
* agent (your editor, a branch switch, a stash) set no `dirty` flag at all, so
|
|
9
|
+
* nothing ever triggered a resync.
|
|
10
|
+
*
|
|
11
|
+
* So freshness moves into the query path: every retrieval call probes the working
|
|
12
|
+
* tree (`fingerprint.ts`, ~3ms) and, when something moved, rebuilds the structural
|
|
13
|
+
* graph before answering. Properties worth keeping:
|
|
14
|
+
*
|
|
15
|
+
* - **$0 and offline.** Tier-1 only — never a summarizer, never `--deep`. Same
|
|
16
|
+
* money guard `claude/sync-run.ts` carries: auto-anything must not spend money.
|
|
17
|
+
* - **Never fatal.** A failed refresh degrades to answering from the graph on
|
|
18
|
+
* disk. A query that works today must not start failing because a rebuild did.
|
|
19
|
+
* - **Never a stampede.** It takes the same `julius/.cache/.sync.lock` the
|
|
20
|
+
* background sync uses, so concurrent MCP calls and the Stop hook can't pile up
|
|
21
|
+
* rebuilds on top of each other.
|
|
22
|
+
* - **Writes only what a query reads** (`graphOnly`): the graph, the `ask` sidecar,
|
|
23
|
+
* the freshness record. Not the markdown cards, not `INDEX.md`, not `.gitignore`.
|
|
24
|
+
* Those belong to an explicit `julius build` — which the `Stop` hook already runs
|
|
25
|
+
* at the end of a turn — so retrieval stays cheap and a read stays a read. It
|
|
26
|
+
* also leaves `stats.json` alone, so that same `Stop` hook still sees `dirty` and
|
|
27
|
+
* still rebuilds the passive surface.
|
|
28
|
+
*
|
|
29
|
+
* One case is not drift but absence: inside a git worktree there is no graph at all,
|
|
30
|
+
* because `julius/` is gitignored and so was never checked out. The gate covers that
|
|
31
|
+
* too — it copies the parent checkout's graph in (`./seed.ts`) and then treats the
|
|
32
|
+
* difference between the two checkouts as ordinary drift, which is exactly what it is.
|
|
33
|
+
*/
|
|
34
|
+
import { existsSync } from "node:fs";
|
|
35
|
+
import { join, resolve } from "node:path";
|
|
36
|
+
import { contextDirFor } from "../context/node-file.js";
|
|
37
|
+
import { acquireLockIn, releaseLockIn } from "../util/state.js";
|
|
38
|
+
import { CACHE_DIR } from "../context/node-file.js";
|
|
39
|
+
import { buildGraph } from "./build.js";
|
|
40
|
+
import { driftCount, isClean, probeDrift, readFingerprint } from "./fingerprint.js";
|
|
41
|
+
import { invalidateGraphCaches } from "./load.js";
|
|
42
|
+
import { seedGraph } from "./seed.js";
|
|
43
|
+
import { wiringPath } from "./write.js";
|
|
44
|
+
import { tag } from "../brand.js";
|
|
45
|
+
/** How long to wait for another process's in-flight rebuild before giving up and
|
|
46
|
+
* answering from the current graph. Long enough to ride out a small repo's build,
|
|
47
|
+
* short enough that a tool call never feels hung. */
|
|
48
|
+
const LOCK_WAIT_MS = 2000;
|
|
49
|
+
const LOCK_POLL_MS = 50;
|
|
50
|
+
const CLEAN = { refreshed: false };
|
|
51
|
+
/** Env kill switch, for CI or anyone who wants queries to never write. */
|
|
52
|
+
function envDisabled() {
|
|
53
|
+
const v = process.env.JULIUS_NO_REFRESH;
|
|
54
|
+
return v !== undefined && v !== "" && v !== "0" && v !== "false";
|
|
55
|
+
}
|
|
56
|
+
function sleep(ms) {
|
|
57
|
+
return new Promise((r) => setTimeout(r, ms));
|
|
58
|
+
}
|
|
59
|
+
/**
|
|
60
|
+
* Release the lock if this process is asked to die while holding it. Returns the
|
|
61
|
+
* un-hook.
|
|
62
|
+
*
|
|
63
|
+
* Not hypothetical: the Claude Code prompt hook runs `julius ask` with a timeout, and
|
|
64
|
+
* `execFileSync` enforces it with SIGTERM. Node's default disposition for SIGTERM is
|
|
65
|
+
* to exit without unwinding, so the `finally` below never runs and the lock outlives
|
|
66
|
+
* the process — after which the background sync is blocked and every query waits and
|
|
67
|
+
* then answers stale until the lock ages out. Ctrl-C on a CLI query is the same story
|
|
68
|
+
* with SIGINT.
|
|
69
|
+
*
|
|
70
|
+
* Adding a listener replaces that default disposition, so re-raise it explicitly
|
|
71
|
+
* afterwards: remove ourselves, then `process.kill(process.pid, sig)`, so the exit
|
|
72
|
+
* status still says "terminated by signal" for whoever is waiting on us.
|
|
73
|
+
*/
|
|
74
|
+
export function releaseOnSignal(cache) {
|
|
75
|
+
const signals = ["SIGTERM", "SIGINT"];
|
|
76
|
+
const onSignal = (sig) => {
|
|
77
|
+
releaseLockIn(cache);
|
|
78
|
+
for (const s of signals)
|
|
79
|
+
process.removeListener(s, onSignal);
|
|
80
|
+
process.kill(process.pid, sig);
|
|
81
|
+
};
|
|
82
|
+
for (const s of signals)
|
|
83
|
+
process.once(s, onSignal);
|
|
84
|
+
return () => {
|
|
85
|
+
for (const s of signals)
|
|
86
|
+
process.removeListener(s, onSignal);
|
|
87
|
+
};
|
|
88
|
+
}
|
|
89
|
+
/** Wait out someone else's rebuild, then take the lock. False when we couldn't. */
|
|
90
|
+
async function waitForLock(cache) {
|
|
91
|
+
const deadline = Date.now() + LOCK_WAIT_MS;
|
|
92
|
+
for (;;) {
|
|
93
|
+
if (acquireLockIn(cache))
|
|
94
|
+
return true;
|
|
95
|
+
if (Date.now() >= deadline)
|
|
96
|
+
return false;
|
|
97
|
+
await sleep(LOCK_POLL_MS);
|
|
98
|
+
}
|
|
99
|
+
}
|
|
100
|
+
/**
|
|
101
|
+
* Copy a parent checkout's graph in, holding the same lock a rebuild would.
|
|
102
|
+
*
|
|
103
|
+
* Two MCP tool calls in a fresh worktree arrive here at the same moment, and an 8 MB
|
|
104
|
+
* copy is long enough for both to start one. The loser waits, then finds the graph
|
|
105
|
+
* already there and reports nothing — which is why the caller re-checks the file
|
|
106
|
+
* rather than trusting this return value.
|
|
107
|
+
*/
|
|
108
|
+
async function seedUnderLock(dir, outDir, contextDir) {
|
|
109
|
+
const lockCache = join(outDir, CACHE_DIR);
|
|
110
|
+
// `busy` matters: with no graph on disk there is nothing to fall back to, so a
|
|
111
|
+
// caller that stayed silent here would emit the bare "no matching nodes" this whole
|
|
112
|
+
// mechanism exists to remove. Say what happened instead.
|
|
113
|
+
if (!(await waitForLock(lockCache)))
|
|
114
|
+
return { seeded: false, busy: true };
|
|
115
|
+
const unhook = releaseOnSignal(lockCache);
|
|
116
|
+
try {
|
|
117
|
+
return seedGraph(dir, { contextDir });
|
|
118
|
+
}
|
|
119
|
+
finally {
|
|
120
|
+
unhook();
|
|
121
|
+
releaseLockIn(lockCache);
|
|
122
|
+
}
|
|
123
|
+
}
|
|
124
|
+
/**
|
|
125
|
+
* Rebuild `root`'s structural graph if the working tree has moved since the last
|
|
126
|
+
* build. Cheap and side-effect-free when nothing changed, which is the usual case.
|
|
127
|
+
*
|
|
128
|
+
* `root` is the repository root (the same value the query itself is given), not
|
|
129
|
+
* the context dir.
|
|
130
|
+
*/
|
|
131
|
+
export async function ensureFreshGraph(root, opts = {}) {
|
|
132
|
+
if (opts.disabled || envDisabled())
|
|
133
|
+
return CLEAN;
|
|
134
|
+
try {
|
|
135
|
+
const dir = resolve(root);
|
|
136
|
+
const outDir = contextDirFor(dir, opts.contextDir);
|
|
137
|
+
let seededFrom;
|
|
138
|
+
if (!existsSync(wiringPath(outDir))) {
|
|
139
|
+
// One case has a graph to work with even though this checkout has none: a git
|
|
140
|
+
// worktree, whose parent checkout's `julius/` git could not check out. Copy it
|
|
141
|
+
// in and carry on — the drift below is then exactly the diff between the two
|
|
142
|
+
// checkouts, and repairing it is what makes the copied graph honest here.
|
|
143
|
+
const seed = await seedUnderLock(dir, outDir, opts.contextDir);
|
|
144
|
+
seededFrom = seed.from;
|
|
145
|
+
// Still nothing (not a worktree, parent never built, or a concurrent seed we
|
|
146
|
+
// lost the race for and which we now re-check for): the caller's own "no graph
|
|
147
|
+
// — run julius build" message is the right answer. Auto-building a whole repo
|
|
148
|
+
// under a query is a surprise, and it's the one case where the user hasn't
|
|
149
|
+
// opted into julius at all yet.
|
|
150
|
+
if (!existsSync(wiringPath(outDir))) {
|
|
151
|
+
return seed.busy
|
|
152
|
+
? { refreshed: false, note: "another process is still copying the graph into this worktree — retry the query in a moment" }
|
|
153
|
+
: CLEAN;
|
|
154
|
+
}
|
|
155
|
+
}
|
|
156
|
+
const seedNote = seededFrom ? `copied the graph from the main checkout (${seededFrom})` : undefined;
|
|
157
|
+
// null = no fingerprint at all: a graph built before this mechanism existed,
|
|
158
|
+
// or by a different extractor build. Rebuild once — that lays the fingerprint
|
|
159
|
+
// down, so it costs exactly one build, not one per query.
|
|
160
|
+
const drift = probeDrift(dir, outDir);
|
|
161
|
+
if (drift && isClean(drift))
|
|
162
|
+
return seedNote ? { refreshed: false, note: seedNote } : CLEAN;
|
|
163
|
+
// On the default layout this is `<root>/julius/.cache/.sync.lock`, the very file
|
|
164
|
+
// the Claude Code hooks lock — so this refresh and the background sync can
|
|
165
|
+
// never rebuild at the same time.
|
|
166
|
+
const lockCache = join(outDir, CACHE_DIR);
|
|
167
|
+
if (!(await waitForLock(lockCache))) {
|
|
168
|
+
const busy = "a graph rebuild is already in flight — answering from the current graph";
|
|
169
|
+
return {
|
|
170
|
+
refreshed: false,
|
|
171
|
+
drift: drift ?? undefined,
|
|
172
|
+
note: seedNote ? `${seedNote}; ${busy}` : busy,
|
|
173
|
+
};
|
|
174
|
+
}
|
|
175
|
+
const unhook = releaseOnSignal(lockCache);
|
|
176
|
+
try {
|
|
177
|
+
// We may have queued behind another process's rebuild for up to LOCK_WAIT_MS,
|
|
178
|
+
// and that rebuild very likely fixed the same drift we saw. Re-probe rather
|
|
179
|
+
// than rebuild on the strength of a stale observation: without this, four
|
|
180
|
+
// parallel MCP tool calls on one edited file produce four full rebuilds, three
|
|
181
|
+
// of them pure waste, and the last tool call pays for all of it. A null drift
|
|
182
|
+
// means "no fingerprint" and still has to build.
|
|
183
|
+
const now = drift ? probeDrift(dir, outDir) : null;
|
|
184
|
+
if (now && isClean(now)) {
|
|
185
|
+
invalidateGraphCaches(outDir);
|
|
186
|
+
return seedNote ? { refreshed: false, note: seedNote } : CLEAN;
|
|
187
|
+
}
|
|
188
|
+
// Tier-1 only: no summarizer, so no LLM call and no network, ever. And
|
|
189
|
+
// `graphOnly`: write the graph, the ask sidecar and the fingerprint, nothing
|
|
190
|
+
// else. The markdown projections under `julius/` stay the `Stop` hook's job —
|
|
191
|
+
// a query has no business rewriting the repo's `.gitignore` or churning every
|
|
192
|
+
// card's mtime, and skipping them is most of what keeps this cheap.
|
|
193
|
+
// A `--only-dir` build recorded its whitelist in the fingerprint; re-apply it
|
|
194
|
+
// here so an auto-rebuild keeps the same limited file set instead of silently
|
|
195
|
+
// widening to the whole tree.
|
|
196
|
+
const onlyDirs = readFingerprint(outDir)?.onlyDirs;
|
|
197
|
+
await buildGraph(dir, { contextDir: opts.contextDir, graphOnly: true, onlyDirs });
|
|
198
|
+
invalidateGraphCaches(outDir);
|
|
199
|
+
return { refreshed: true, drift: drift ?? undefined, note: seedNote };
|
|
200
|
+
}
|
|
201
|
+
finally {
|
|
202
|
+
unhook();
|
|
203
|
+
releaseLockIn(lockCache);
|
|
204
|
+
}
|
|
205
|
+
}
|
|
206
|
+
catch (err) {
|
|
207
|
+
// Answering from a slightly stale graph beats failing the query.
|
|
208
|
+
return { refreshed: false, note: `graph refresh skipped: ${err instanceof Error ? err.message : String(err)}` };
|
|
209
|
+
}
|
|
210
|
+
}
|
|
211
|
+
/**
|
|
212
|
+
* Workspace variant: refresh each child repo's own graph (a workspace parent holds
|
|
213
|
+
* an index, never nodes). Children are independent, but they're refreshed in
|
|
214
|
+
* sequence — a fan-out of concurrent tree-sitter builds would spike CPU on the
|
|
215
|
+
* very path that's supposed to feel free.
|
|
216
|
+
*/
|
|
217
|
+
export async function ensureFreshChildren(root, children, opts = {}) {
|
|
218
|
+
if (opts.disabled || envDisabled())
|
|
219
|
+
return CLEAN;
|
|
220
|
+
const refreshedIn = [];
|
|
221
|
+
let files = 0;
|
|
222
|
+
for (const child of children) {
|
|
223
|
+
// Deliberately NOT `opts`: `contextDirFor` returns an override verbatim and
|
|
224
|
+
// ignores the root it's handed, so forwarding the parent's `--dir` would point
|
|
225
|
+
// every child at the *parent's* context dir — which holds a workspace index and
|
|
226
|
+
// no wiring.json, so every child would silently be skipped. (And if it did hold
|
|
227
|
+
// one, each child would build into that single shared dir in turn, the last
|
|
228
|
+
// clobbering the rest.) A child's graph always lives in its own `<child>/julius`,
|
|
229
|
+
// which is exactly how `loadWorkspaceGraphs` reads them back.
|
|
230
|
+
const r = await ensureFreshGraph(resolve(root, child), { disabled: opts.disabled });
|
|
231
|
+
if (!r.refreshed)
|
|
232
|
+
continue;
|
|
233
|
+
refreshedIn.push(child);
|
|
234
|
+
files += r.drift ? driftCount(r.drift) : 0;
|
|
235
|
+
}
|
|
236
|
+
if (!refreshedIn.length)
|
|
237
|
+
return CLEAN;
|
|
238
|
+
return {
|
|
239
|
+
refreshed: true,
|
|
240
|
+
note: `refreshed ${refreshedIn.join(", ")} (${files || "?"} file${files === 1 ? "" : "s"} changed) before answering`,
|
|
241
|
+
};
|
|
242
|
+
}
|
|
243
|
+
/** The one-line note a CLI/MCP surface prints when a refresh actually happened.
|
|
244
|
+
* Null when there's nothing to say (the overwhelmingly common case). */
|
|
245
|
+
export function refreshNote(r) {
|
|
246
|
+
if (!r.refreshed)
|
|
247
|
+
return r.note ? `${tag()} ${r.note}` : null;
|
|
248
|
+
const n = r.drift ? driftCount(r.drift) : 0;
|
|
249
|
+
const built = `refreshed the graph (${n || "?"} file${n === 1 ? "" : "s"} changed) before answering`;
|
|
250
|
+
// Both facts, when a worktree was seeded *and* the copy needed repairing: the
|
|
251
|
+
// count is the interesting half (it's the branch diff), the provenance explains
|
|
252
|
+
// where a graph came from in a directory the user knows they never built.
|
|
253
|
+
return r.note ? `${tag()} ${built} — ${r.note}` : `${tag()} ${built}`;
|
|
254
|
+
}
|
|
255
|
+
//# sourceMappingURL=refresh.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"refresh.js","sourceRoot":"","sources":["../../src/graph/refresh.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAgCG;AACH,OAAO,EAAE,UAAU,EAAE,MAAM,SAAS,CAAC;AACrC,OAAO,EAAE,IAAI,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAC1C,OAAO,EAAE,aAAa,EAAE,MAAM,yBAAyB,CAAC;AACxD,OAAO,EAAE,aAAa,EAAE,aAAa,EAAE,MAAM,kBAAkB,CAAC;AAChE,OAAO,EAAE,SAAS,EAAE,MAAM,yBAAyB,CAAC;AACpD,OAAO,EAAE,UAAU,EAAE,MAAM,YAAY,CAAC;AACxC,OAAO,EAAE,UAAU,EAAE,OAAO,EAAE,UAA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I,CAAC,WAAW,CAAC,MAAM;QAAE,OAAO,KAAK,CAAC;IACtC,OAAO;QACL,SAAS,EAAE,IAAI;QACf,IAAI,EAAE,aAAa,WAAW,CAAC,IAAI,CAAC,IAAI,CAAC,KAAK,KAAK,IAAI,GAAG,QAAQ,KAAK,KAAK,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,GAAG,4BAA4B;KACrH,CAAC;AACJ,CAAC;AAED;wEACwE;AACxE,MAAM,UAAU,WAAW,CAAC,CAAgB;IAC1C,IAAI,CAAC,CAAC,CAAC,SAAS;QAAE,OAAO,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,GAAG,GAAG,EAAE,IAAI,CAAC,CAAC,IAAI,EAAE,CAAC,CAAC,CAAC,IAAI,CAAC;IAC9D,MAAM,CAAC,GAAG,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,UAAU,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;IAC5C,MAAM,KAAK,GAAG,wBAAwB,CAAC,IAAI,GAAG,QAAQ,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,GAAG,4BAA4B,CAAC;IACrG,8EAA8E;IAC9E,gFAAgF;IAChF,0EAA0E;IAC1E,OAAO,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,GAAG,GAAG,EAAE,IAAI,KAAK,MAAM,CAAC,CAAC,IAAI,EAAE,CAAC,CAAC,CAAC,GAAG,GAAG,EAAE,IAAI,KAAK,EAAE,CAAC;AACxE,CAAC"}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Edges that carry dependency meaning for a graph walk/rank: `calls`,
|
|
3
|
+
* `references`, `imports`, `implements`, `extends`. `contains` is deliberately
|
|
4
|
+
* excluded — a file "contains" every symbol defined in it, so walking it
|
|
5
|
+
* would make every same-file symbol a neighbour and let a file act as a false
|
|
6
|
+
* hub, flooding a walk that must stay confined to genuine dependency wiring.
|
|
7
|
+
*
|
|
8
|
+
* Shared by `traverse.ts` (callers/callees/impact edge walks), `graphrank.ts`
|
|
9
|
+
* (personalized PageRank), and `search/grep.ts` (in-degree ranking) so every
|
|
10
|
+
* surface agrees on what counts as a dependency edge.
|
|
11
|
+
*/
|
|
12
|
+
import type { Relation } from "./types.js";
|
|
13
|
+
export declare const WALK_RELATIONS: ReadonlySet<Relation>;
|
|
14
|
+
//# sourceMappingURL=relations.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"relations.d.ts","sourceRoot":"","sources":["../../src/graph/relations.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AACH,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,YAAY,CAAC;AAE3C,eAAO,MAAM,cAAc,EAAE,WAAW,CAAC,QAAQ,CAM/C,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"relations.js","sourceRoot":"","sources":["../../src/graph/relations.ts"],"names":[],"mappings":"AAaA,MAAM,CAAC,MAAM,cAAc,GAA0B,IAAI,GAAG,CAAW;IACrE,OAAO;IACP,YAAY;IACZ,SAAS;IACT,YAAY;IACZ,SAAS;CACV,CAAC,CAAC"}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import type { EdgeV1, NodeV1 } from "./types.js";
|
|
2
|
+
import { type RawEdge } from "./extract.js";
|
|
3
|
+
/** A Go module discovered in the repo: its `module` path from `go.mod` and the repo
|
|
4
|
+
* directory that `go.mod` lives in (posix, `.` for the repo root). A monorepo may hold
|
|
5
|
+
* several — e.g. `backend/go.mod`, `tools/go.mod`. */
|
|
6
|
+
export interface GoModule {
|
|
7
|
+
module: string;
|
|
8
|
+
dir: string;
|
|
9
|
+
}
|
|
10
|
+
export interface ResolveOptions {
|
|
11
|
+
/** The Go modules found in the repo. Enables mapping Go import package paths
|
|
12
|
+
* (`example.com/app/pkg/util`) to the in-repo directory they name, relative to the
|
|
13
|
+
* owning module's `go.mod` location. Empty/absent → Go imports stay external strings. */
|
|
14
|
+
goModules?: GoModule[];
|
|
15
|
+
}
|
|
16
|
+
export declare function resolveEdges(nodes: NodeV1[], rawEdges: RawEdge[], opts?: ResolveOptions): EdgeV1[];
|
|
17
|
+
//# sourceMappingURL=resolve.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"resolve.d.ts","sourceRoot":"","sources":["../../src/graph/resolve.ts"],"names":[],"mappings":"AAgBA,OAAO,KAAK,EAAE,MAAM,EAAQ,MAAM,EAAY,MAAM,YAAY,CAAC;AACjE,OAAO,EAAc,KAAK,OAAO,EAAE,MAAM,cAAc,CAAC;AAoExD;;sDAEsD;AACtD,MAAM,WAAW,QAAQ;IACvB,MAAM,EAAE,MAAM,CAAC;IACf,GAAG,EAAE,MAAM,CAAC;CACb;AAED,MAAM,WAAW,cAAc;IAC7B;;6FAEyF;IACzF,SAAS,CAAC,EAAE,QAAQ,EAAE,CAAC;CACxB;AAED,wBAAgB,YAAY,CAC1B,KAAK,EAAE,MAAM,EAAE,EACf,QAAQ,EAAE,OAAO,EAAE,EACnB,IAAI,GAAE,cAAmB,GACxB,MAAM,EAAE,CAwOV"}
|