@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.
- package/CHANGELOG.md +31 -0
- package/CREDITS.md +25 -0
- package/LICENSE +21 -0
- package/PROVENANCE.md +9 -0
- package/README.md +225 -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 +67 -0
- package/dist/economy/index.d.ts.map +1 -0
- package/dist/economy/index.js +519 -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 +315 -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 +35 -0
- package/dist/search/grep-cli.d.ts.map +1 -0
- package/dist/search/grep-cli.js +115 -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,112 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Pure graph-traversal core shared by `julius callers` (its `--direction`/
|
|
3
|
+
* `--depth` flags), the MCP `julius_trace_calls` tool, and `ask`'s structural
|
|
4
|
+
* intent path.
|
|
5
|
+
*
|
|
6
|
+
* Centralizes the symbol-resolution contract (bare name, qualified id-suffix,
|
|
7
|
+
* last-segment fallback, `--in` narrowing) so all surfaces agree on what a
|
|
8
|
+
* query like `Cache.get` or `hashstructure.Hash` means, and the direction-aware
|
|
9
|
+
* (incoming/outgoing) depth-1 and BFS edge walks over the wiring graph.
|
|
10
|
+
*
|
|
11
|
+
* No I/O here: callers pass in an already-loaded `GraphV1` (via
|
|
12
|
+
* `loadGraphCached`), which keeps this module trivially unit-testable against
|
|
13
|
+
* hand-built fixture graphs.
|
|
14
|
+
*/
|
|
15
|
+
import type { GraphV1, NodeV1, Relation } from "./types.js";
|
|
16
|
+
/** Which way to walk the wiring graph: `in` = incoming edges (who points at
|
|
17
|
+
* the symbol — callers / blast radius), `out` = outgoing edges (what the symbol
|
|
18
|
+
* points at — callees). */
|
|
19
|
+
export type Direction = "in" | "out";
|
|
20
|
+
/** A resolved symbol-search hit. Reserved for future disambiguation metadata
|
|
21
|
+
* (e.g. why a query matched); today it wraps the node 1:1. */
|
|
22
|
+
export interface SymbolMatch {
|
|
23
|
+
node: NodeV1;
|
|
24
|
+
}
|
|
25
|
+
export interface ResolveSymbolOptions {
|
|
26
|
+
/** Narrow candidates to nodes at or under this repo-relative path prefix —
|
|
27
|
+
* the same segment-aware rule `ask --in` and `grep --in` use, so `--in` means
|
|
28
|
+
* one thing across every command. Normalized here, so either separator works. */
|
|
29
|
+
in?: string;
|
|
30
|
+
}
|
|
31
|
+
/**
|
|
32
|
+
* Resolve a query string to every matching node in the graph.
|
|
33
|
+
*
|
|
34
|
+
* Matching, in order:
|
|
35
|
+
* 1. Non-file nodes whose `name` equals the query case-insensitively, OR
|
|
36
|
+
* whose `id` ends with `#<query>` or `.<query>` case-insensitively — this
|
|
37
|
+
* is what makes a qualified name like `Cache.get` resolve against an id
|
|
38
|
+
* like `src/cache.ts#Cache.get`.
|
|
39
|
+
* 2. If that yields nothing and the query contains a `.`, retry with just
|
|
40
|
+
* the last dot-segment as a bare name (`hashstructure.Hash` → `Hash`) —
|
|
41
|
+
* covers package-qualified names (e.g. Go) whose id never contains the
|
|
42
|
+
* package prefix.
|
|
43
|
+
* 3. If *that* still yields nothing and the query looks like a filename
|
|
44
|
+
* (contains `.`, no `#`), fall back to `kind: 'file'` nodes matched by
|
|
45
|
+
* name or path.
|
|
46
|
+
*
|
|
47
|
+
* `opts.in` then filters whichever candidate set was produced, by path
|
|
48
|
+
* substring. Multiple matches are not an error — every match is returned.
|
|
49
|
+
*/
|
|
50
|
+
export declare function resolveSymbol(graph: GraphV1, query: string, opts?: ResolveSymbolOptions): NodeV1[];
|
|
51
|
+
/** One traversed edge. `node` is null when the edge's other endpoint isn't a
|
|
52
|
+
* real node in the graph (e.g. an unresolved import module string) — such
|
|
53
|
+
* hits are kept, labeled by the raw id, rather than dropped. */
|
|
54
|
+
export interface EdgeHit {
|
|
55
|
+
node: NodeV1 | null;
|
|
56
|
+
id: string;
|
|
57
|
+
relation: Relation;
|
|
58
|
+
depth: number;
|
|
59
|
+
}
|
|
60
|
+
/** Depth-1: nodes with a walk-relation edge whose target is `symbol`. */
|
|
61
|
+
export declare function callersOf(graph: GraphV1, symbol: NodeV1): EdgeHit[];
|
|
62
|
+
/** Depth-1: walk-relation edges whose source is `symbol`. */
|
|
63
|
+
export declare function calleesOf(graph: GraphV1, symbol: NodeV1): EdgeHit[];
|
|
64
|
+
/**
|
|
65
|
+
* BFS over INCOMING walk-relation edges from `symbol`, up to `maxDepth` hops
|
|
66
|
+
* — "who breaks if this changes". Each reached node is deduped by id and
|
|
67
|
+
* reported once, at the depth it was first reached (a diamond-shaped
|
|
68
|
+
* dependency graph counts its convergence node exactly once).
|
|
69
|
+
*/
|
|
70
|
+
export declare function impactOf(graph: GraphV1, symbol: NodeV1, maxDepth?: number): EdgeHit[];
|
|
71
|
+
/**
|
|
72
|
+
* BFS over walk-relation edges from *multiple* seed nodes at once, in the given
|
|
73
|
+
* `direction` (`in` = incoming, the default — "who breaks if this changes";
|
|
74
|
+
* `out` = outgoing — "what this reaches"). The multi-seed generalization of
|
|
75
|
+
* {@link impactOf} (`impactOf(g, n, d)` is exactly `impactOfMany(g, [n], d)`).
|
|
76
|
+
* Used when one logical unit spans several graph node ids — e.g. a file plus
|
|
77
|
+
* every symbol defined in it, since a `calls`/`references`/etc. edge from
|
|
78
|
+
* another file always targets the SYMBOL id, never the FILE id, so walking the
|
|
79
|
+
* file node alone misses dependents that call into it rather than merely
|
|
80
|
+
* importing it.
|
|
81
|
+
*
|
|
82
|
+
* Every seed is pre-marked visited (so a seed can never appear as its own
|
|
83
|
+
* hit, and an edge between two seeds is never reported), then the walk
|
|
84
|
+
* proceeds exactly like `impactOf`'s: each reached node deduped by id and
|
|
85
|
+
* reported once, at the depth it was first reached from *any* seed.
|
|
86
|
+
*/
|
|
87
|
+
export declare function impactOfMany(graph: GraphV1, seeds: NodeV1[], maxDepth?: number, direction?: Direction): EdgeHit[];
|
|
88
|
+
/**
|
|
89
|
+
* `impactOf`, generalized for a `kind: 'file'` seed: aggregates the BFS over
|
|
90
|
+
* the file node AND every symbol node defined in that file (via
|
|
91
|
+
* {@link impactOfMany} — dedup by id, min depth, seeds excluded). Fixes a file
|
|
92
|
+
* query silently dropping dependents that `calls`/`references`/etc. into a
|
|
93
|
+
* symbol the file defines, rather than merely `imports`-ing the file itself —
|
|
94
|
+
* see this module's header and `impactOfMany`'s doc for why. Symbol-kind
|
|
95
|
+
* queries keep using plain `impactOf`; this is only for file-kind matches.
|
|
96
|
+
*/
|
|
97
|
+
export declare function impactOfFile(graph: GraphV1, fileNode: NodeV1, maxDepth?: number, direction?: Direction): EdgeHit[];
|
|
98
|
+
/**
|
|
99
|
+
* The single entry point behind `julius callers` and the MCP `julius_trace_calls`
|
|
100
|
+
* tool, covering all of what were once three commands:
|
|
101
|
+
* - `direction:in, depth:1` → callers (who calls/references this)
|
|
102
|
+
* - `direction:out, depth:1` → callees (what this calls/references)
|
|
103
|
+
* - `direction:in, depth>1` → blast radius (transitive dependents)
|
|
104
|
+
* - `direction:out, depth>1` → transitive dependencies
|
|
105
|
+
*
|
|
106
|
+
* Depth 1 uses the plain single-hop scan ({@link callersOf}/{@link calleesOf})
|
|
107
|
+
* so `julius callers <symbol>` output is unchanged. Depth >1 runs the BFS, and
|
|
108
|
+
* for a `kind: 'file'` seed aggregates over the symbols the file defines (see
|
|
109
|
+
* {@link impactOfMany}) so file-level dependents aren't silently dropped.
|
|
110
|
+
*/
|
|
111
|
+
export declare function edgeWalk(graph: GraphV1, node: NodeV1, direction: Direction, depth: number): EdgeHit[];
|
|
112
|
+
//# sourceMappingURL=traverse.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"traverse.d.ts","sourceRoot":"","sources":["../../src/graph/traverse.ts"],"names":[],"mappings":"AAAA;;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OAAO,EAAE,QAAQ,EAAE,MAAM,EAAE,QAAQ,SAAI,EAAE,SAAS,GAAE,SAAgB,GAAG,OAAO,EAAE,CAEnH;AAED;;;;;;;;;;;;GAYG;AACH,wBAAgB,QAAQ,CAAC,KAAK,EAAE,OAAO,EAAE,IAAI,EAAE,MAAM,EAAE,SAAS,EAAE,SAAS,EAAE,KAAK,EAAE,MAAM,GAAG,OAAO,EAAE,CAIrG"}
|
|
@@ -0,0 +1,192 @@
|
|
|
1
|
+
import { WALK_RELATIONS } from "./relations.js";
|
|
2
|
+
import { assertPrefixIndexed, pathUnderPrefix } from "./scopes.js";
|
|
3
|
+
import { normalizePathPrefix } from "../util/paths.js";
|
|
4
|
+
/**
|
|
5
|
+
* Resolve a query string to every matching node in the graph.
|
|
6
|
+
*
|
|
7
|
+
* Matching, in order:
|
|
8
|
+
* 1. Non-file nodes whose `name` equals the query case-insensitively, OR
|
|
9
|
+
* whose `id` ends with `#<query>` or `.<query>` case-insensitively — this
|
|
10
|
+
* is what makes a qualified name like `Cache.get` resolve against an id
|
|
11
|
+
* like `src/cache.ts#Cache.get`.
|
|
12
|
+
* 2. If that yields nothing and the query contains a `.`, retry with just
|
|
13
|
+
* the last dot-segment as a bare name (`hashstructure.Hash` → `Hash`) —
|
|
14
|
+
* covers package-qualified names (e.g. Go) whose id never contains the
|
|
15
|
+
* package prefix.
|
|
16
|
+
* 3. If *that* still yields nothing and the query looks like a filename
|
|
17
|
+
* (contains `.`, no `#`), fall back to `kind: 'file'` nodes matched by
|
|
18
|
+
* name or path.
|
|
19
|
+
*
|
|
20
|
+
* `opts.in` then filters whichever candidate set was produced, by path
|
|
21
|
+
* substring. Multiple matches are not an error — every match is returned.
|
|
22
|
+
*/
|
|
23
|
+
export function resolveSymbol(graph, query, opts = {}) {
|
|
24
|
+
const lowerQuery = query.toLowerCase();
|
|
25
|
+
const looksLikeFilename = query.includes(".") && !query.includes("#");
|
|
26
|
+
let matches = symbolMatches(graph.nodes, lowerQuery);
|
|
27
|
+
if (matches.length === 0 && query.includes(".")) {
|
|
28
|
+
const lastSegment = query.slice(query.lastIndexOf(".") + 1).toLowerCase();
|
|
29
|
+
if (lastSegment) {
|
|
30
|
+
matches = graph.nodes.filter((n) => n.kind !== "file" && n.name.toLowerCase() === lastSegment);
|
|
31
|
+
}
|
|
32
|
+
}
|
|
33
|
+
if (matches.length === 0 && looksLikeFilename) {
|
|
34
|
+
matches = graph.nodes.filter((n) => n.kind === "file" &&
|
|
35
|
+
(n.name.toLowerCase() === lowerQuery ||
|
|
36
|
+
n.path.toLowerCase() === lowerQuery ||
|
|
37
|
+
n.path.toLowerCase().endsWith("/" + lowerQuery)));
|
|
38
|
+
}
|
|
39
|
+
if (opts.in) {
|
|
40
|
+
const prefix = normalizePathPrefix(opts.in);
|
|
41
|
+
assertPrefixIndexed(graph, prefix);
|
|
42
|
+
matches = matches.filter((n) => pathUnderPrefix(n.path, prefix));
|
|
43
|
+
}
|
|
44
|
+
return matches;
|
|
45
|
+
}
|
|
46
|
+
/** Strips extract.ts's mint-time disambiguation ordinals (`~2`, `~3`, ...)
|
|
47
|
+
* from segment ends in a dotted id-tail — the same shape extract.ts mints
|
|
48
|
+
* when a document-order duplicate definition would otherwise collide with an
|
|
49
|
+
* already-minted id (see extract.ts's mint-time uniqueness comment). Without
|
|
50
|
+
* this, a qualified query like `C.m` only ever matches the bare id (`#C.m`),
|
|
51
|
+
* silently hiding the `~2` duplicate from callers/ask/MCP lookups. The
|
|
52
|
+
* ordinal can land on any segment, not just the tail (a reopened class shows
|
|
53
|
+
* up as `C~2.m`), so this strips at every segment boundary (`.` or end of
|
|
54
|
+
* string), not just the very end of the string. */
|
|
55
|
+
function stripOrdinals(idTail) {
|
|
56
|
+
return idTail.replace(/~\d+(?=\.|$)/g, "");
|
|
57
|
+
}
|
|
58
|
+
function symbolMatches(nodes, lowerQuery) {
|
|
59
|
+
const suffixHash = "#" + lowerQuery;
|
|
60
|
+
const suffixDot = "." + lowerQuery;
|
|
61
|
+
return nodes.filter((n) => {
|
|
62
|
+
if (n.kind === "file")
|
|
63
|
+
return false;
|
|
64
|
+
if (n.name.toLowerCase() === lowerQuery)
|
|
65
|
+
return true;
|
|
66
|
+
const lowerId = n.id.toLowerCase();
|
|
67
|
+
const hashIdx = lowerId.indexOf("#");
|
|
68
|
+
const candidateId = hashIdx === -1 ? lowerId : lowerId.slice(0, hashIdx + 1) + stripOrdinals(lowerId.slice(hashIdx + 1));
|
|
69
|
+
return candidateId.endsWith(suffixHash) || candidateId.endsWith(suffixDot);
|
|
70
|
+
});
|
|
71
|
+
}
|
|
72
|
+
/** Depth-1: nodes with a walk-relation edge whose target is `symbol`. */
|
|
73
|
+
export function callersOf(graph, symbol) {
|
|
74
|
+
const byId = new Map(graph.nodes.map((n) => [n.id, n]));
|
|
75
|
+
const hits = [];
|
|
76
|
+
for (const e of graph.edges) {
|
|
77
|
+
if (!WALK_RELATIONS.has(e.relation) || e.target !== symbol.id)
|
|
78
|
+
continue;
|
|
79
|
+
hits.push({ node: byId.get(e.source) ?? null, id: e.source, relation: e.relation, depth: 1 });
|
|
80
|
+
}
|
|
81
|
+
return hits;
|
|
82
|
+
}
|
|
83
|
+
/** Depth-1: walk-relation edges whose source is `symbol`. */
|
|
84
|
+
export function calleesOf(graph, symbol) {
|
|
85
|
+
const byId = new Map(graph.nodes.map((n) => [n.id, n]));
|
|
86
|
+
const hits = [];
|
|
87
|
+
for (const e of graph.edges) {
|
|
88
|
+
if (!WALK_RELATIONS.has(e.relation) || e.source !== symbol.id)
|
|
89
|
+
continue;
|
|
90
|
+
hits.push({ node: byId.get(e.target) ?? null, id: e.target, relation: e.relation, depth: 1 });
|
|
91
|
+
}
|
|
92
|
+
return hits;
|
|
93
|
+
}
|
|
94
|
+
/**
|
|
95
|
+
* BFS over INCOMING walk-relation edges from `symbol`, up to `maxDepth` hops
|
|
96
|
+
* — "who breaks if this changes". Each reached node is deduped by id and
|
|
97
|
+
* reported once, at the depth it was first reached (a diamond-shaped
|
|
98
|
+
* dependency graph counts its convergence node exactly once).
|
|
99
|
+
*/
|
|
100
|
+
export function impactOf(graph, symbol, maxDepth = 2) {
|
|
101
|
+
return impactOfMany(graph, [symbol], maxDepth);
|
|
102
|
+
}
|
|
103
|
+
/**
|
|
104
|
+
* BFS over walk-relation edges from *multiple* seed nodes at once, in the given
|
|
105
|
+
* `direction` (`in` = incoming, the default — "who breaks if this changes";
|
|
106
|
+
* `out` = outgoing — "what this reaches"). The multi-seed generalization of
|
|
107
|
+
* {@link impactOf} (`impactOf(g, n, d)` is exactly `impactOfMany(g, [n], d)`).
|
|
108
|
+
* Used when one logical unit spans several graph node ids — e.g. a file plus
|
|
109
|
+
* every symbol defined in it, since a `calls`/`references`/etc. edge from
|
|
110
|
+
* another file always targets the SYMBOL id, never the FILE id, so walking the
|
|
111
|
+
* file node alone misses dependents that call into it rather than merely
|
|
112
|
+
* importing it.
|
|
113
|
+
*
|
|
114
|
+
* Every seed is pre-marked visited (so a seed can never appear as its own
|
|
115
|
+
* hit, and an edge between two seeds is never reported), then the walk
|
|
116
|
+
* proceeds exactly like `impactOf`'s: each reached node deduped by id and
|
|
117
|
+
* reported once, at the depth it was first reached from *any* seed.
|
|
118
|
+
*/
|
|
119
|
+
export function impactOfMany(graph, seeds, maxDepth = 2, direction = "in") {
|
|
120
|
+
const byId = new Map(graph.nodes.map((n) => [n.id, n]));
|
|
121
|
+
// Adjacency keyed for the walk direction, restricted to walk relations:
|
|
122
|
+
// 'in' → key = edge.target, neighbour = edge.source (who points AT key)
|
|
123
|
+
// 'out' → key = edge.source, neighbour = edge.target (what key points TO)
|
|
124
|
+
const adj = new Map();
|
|
125
|
+
for (const e of graph.edges) {
|
|
126
|
+
if (!WALK_RELATIONS.has(e.relation))
|
|
127
|
+
continue;
|
|
128
|
+
const key = direction === "in" ? e.target : e.source;
|
|
129
|
+
const other = direction === "in" ? e.source : e.target;
|
|
130
|
+
const entry = { other, relation: e.relation };
|
|
131
|
+
const arr = adj.get(key);
|
|
132
|
+
if (arr)
|
|
133
|
+
arr.push(entry);
|
|
134
|
+
else
|
|
135
|
+
adj.set(key, [entry]);
|
|
136
|
+
}
|
|
137
|
+
const visited = new Set(seeds.map((s) => s.id));
|
|
138
|
+
const hits = [];
|
|
139
|
+
let frontier = [...visited];
|
|
140
|
+
for (let depth = 1; depth <= maxDepth && frontier.length > 0; depth++) {
|
|
141
|
+
const next = [];
|
|
142
|
+
for (const current of frontier) {
|
|
143
|
+
for (const { other, relation } of adj.get(current) ?? []) {
|
|
144
|
+
if (visited.has(other))
|
|
145
|
+
continue;
|
|
146
|
+
visited.add(other);
|
|
147
|
+
hits.push({ node: byId.get(other) ?? null, id: other, relation, depth });
|
|
148
|
+
next.push(other);
|
|
149
|
+
}
|
|
150
|
+
}
|
|
151
|
+
frontier = next;
|
|
152
|
+
}
|
|
153
|
+
return hits;
|
|
154
|
+
}
|
|
155
|
+
/** Every non-file node whose `path` equals `fileNode.path` — the symbols
|
|
156
|
+
* defined in that file. */
|
|
157
|
+
function symbolsInFile(graph, fileNode) {
|
|
158
|
+
return graph.nodes.filter((n) => n.kind !== "file" && n.path === fileNode.path);
|
|
159
|
+
}
|
|
160
|
+
/**
|
|
161
|
+
* `impactOf`, generalized for a `kind: 'file'` seed: aggregates the BFS over
|
|
162
|
+
* the file node AND every symbol node defined in that file (via
|
|
163
|
+
* {@link impactOfMany} — dedup by id, min depth, seeds excluded). Fixes a file
|
|
164
|
+
* query silently dropping dependents that `calls`/`references`/etc. into a
|
|
165
|
+
* symbol the file defines, rather than merely `imports`-ing the file itself —
|
|
166
|
+
* see this module's header and `impactOfMany`'s doc for why. Symbol-kind
|
|
167
|
+
* queries keep using plain `impactOf`; this is only for file-kind matches.
|
|
168
|
+
*/
|
|
169
|
+
export function impactOfFile(graph, fileNode, maxDepth = 2, direction = "in") {
|
|
170
|
+
return impactOfMany(graph, [fileNode, ...symbolsInFile(graph, fileNode)], maxDepth, direction);
|
|
171
|
+
}
|
|
172
|
+
/**
|
|
173
|
+
* The single entry point behind `julius callers` and the MCP `julius_trace_calls`
|
|
174
|
+
* tool, covering all of what were once three commands:
|
|
175
|
+
* - `direction:in, depth:1` → callers (who calls/references this)
|
|
176
|
+
* - `direction:out, depth:1` → callees (what this calls/references)
|
|
177
|
+
* - `direction:in, depth>1` → blast radius (transitive dependents)
|
|
178
|
+
* - `direction:out, depth>1` → transitive dependencies
|
|
179
|
+
*
|
|
180
|
+
* Depth 1 uses the plain single-hop scan ({@link callersOf}/{@link calleesOf})
|
|
181
|
+
* so `julius callers <symbol>` output is unchanged. Depth >1 runs the BFS, and
|
|
182
|
+
* for a `kind: 'file'` seed aggregates over the symbols the file defines (see
|
|
183
|
+
* {@link impactOfMany}) so file-level dependents aren't silently dropped.
|
|
184
|
+
*/
|
|
185
|
+
export function edgeWalk(graph, node, direction, depth) {
|
|
186
|
+
if (depth <= 1)
|
|
187
|
+
return direction === "in" ? callersOf(graph, node) : calleesOf(graph, node);
|
|
188
|
+
if (node.kind === "file")
|
|
189
|
+
return impactOfFile(graph, node, depth, direction);
|
|
190
|
+
return impactOfMany(graph, [node], depth, direction);
|
|
191
|
+
}
|
|
192
|
+
//# sourceMappingURL=traverse.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"traverse.js","sourceRoot":"","sources":["../../src/graph/traverse.ts"],"names":[],"mappings":"AAeA,OAAO,EAAE,cAAc,EAAE,MAAM,gBAAgB,CAAC;AAChD,OAAO,EAAE,mBAAmB,EAAE,eAAe,EAAE,MAAM,aAAa,CAAC;AACnE,OAAO,EAAE,mBAAmB,EAAE,MAAM,kBAAkB,CAAC;AAoBvD;;;;;;;;;;;;;;;;;;GAkBG;AACH,MAAM,UAAU,aAAa,CAAC,KAAc,EAAE,KAAa,EAAE,IAAI,GAAyB,EAAE;IAC1F,MAAM,UAAU,GAAG,KAAK,CAAC,WAAW,EAAE,CAAC;IACvC,MAAM,iBAAiB,GAAG,KAAK,CAAC,QAAQ,CAAC,GAAG,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C,CAAC,CAAC,IAAI,KAAK,MAAM,IAAI,CAAC,CAAC,IAAI,KAAK,QAAQ,CAAC,IAAI,CAAC,CAAC;AAClF,CAAC;AAED;;;;;;;;GAQG;AACH,MAAM,UAAU,YAAY,CAAC,KAAc,EAAE,QAAgB,EAAE,QAAQ,GAAG,CAAC,EAAE,SAAS,GAAc,IAAI;IACtG,OAAO,YAAY,CAAC,KAAK,EAAE,CAAC,QAAQ,EAAE,GAAG,aAAa,CAAC,KAAK,EAAE,QAAQ,CAAC,CAAC,EAAE,QAAQ,EAAE,SAAS,CAAC,CAAC;AACjG,CAAC;AAED;;;;;;;;;;;;GAYG;AACH,MAAM,UAAU,QAAQ,CAAC,KAAc,EAAE,IAAY,EAAE,SAAoB,EAAE,KAAa;IACxF,IAAI,KAAK,IAAI,CAAC;QAAE,OAAO,SAAS,KAAK,IAAI,CAAC,CAAC,CAAC,SAAS,CAAC,KAAK,EAAE,IAAI,CAAC,CAAC,CAAC,CAAC,SAAS,CAAC,KAAK,EAAE,IAAI,CAAC,CAAC;IAC5F,IAAI,IAAI,CAAC,IAAI,KAAK,MAAM;QAAE,OAAO,YAAY,CAAC,KAAK,EAAE,IAAI,EAAE,KAAK,EAAE,SAAS,CAAC,CAAC;IAC7E,OAAO,YAAY,CAAC,KAAK,EAAE,CAAC,IAAI,CAAC,EAAE,KAAK,EAAE,SAAS,CAAC,CAAC;AACvD,CAAC"}
|
|
@@ -0,0 +1,78 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* `graph.json` — the code graph schema (v1).
|
|
3
|
+
*
|
|
4
|
+
* One node per definition (file, class, function, method, interface, type, enum),
|
|
5
|
+
* wired by edges (contains, imports, calls, ...). Field names follow the LSP
|
|
6
|
+
* vocabulary (`name`, `kind`, ...) rather than any one tool's conventions.
|
|
7
|
+
*
|
|
8
|
+
* Two tiers of data live on a node:
|
|
9
|
+
* - Tier-1 (deterministic, $0): everything from the AST. Rebuilt on every run.
|
|
10
|
+
* - Tier-2 (one LLM call, cached on `body_hash`): `summary` + `crux`.
|
|
11
|
+
* M1 populates Tier-1 only; Tier-2 fields ship as `pending`/null.
|
|
12
|
+
*/
|
|
13
|
+
/** What a node represents. LSP SymbolKind, narrowed to what our extractors produce. */
|
|
14
|
+
export type Kind = "file" | "class" | "function" | "method" | "interface" | "type" | "enum" | "struct" | "trait" | "module" | "constant" | "variable";
|
|
15
|
+
/** How confident we are an edge is true, best-first. The hand-written AST
|
|
16
|
+
* resolver assigns `extracted`/`inferred`; the opt-in LSP enrichment pass
|
|
17
|
+
* (`julius build --lsp`) can promote an edge to compiler-grade `lsp_resolved`
|
|
18
|
+
* (an exact server-confirmed target) or `lsp_dispatch` (an interface/virtual
|
|
19
|
+
* candidate). Order matters: consumers that rank by provenance treat earlier
|
|
20
|
+
* values as stronger. */
|
|
21
|
+
export type Confidence = "lsp_resolved" | "lsp_dispatch" | "extracted" | "inferred";
|
|
22
|
+
/** Whether the LLM meaning-layer has been computed for a node. */
|
|
23
|
+
export type SummaryState = "pending" | "ready" | "stale";
|
|
24
|
+
/** The LLM-chosen business-logic excerpt. `code` is the source of truth; `span`
|
|
25
|
+
* is a best-effort pointer that may drift and is never used to re-slice. */
|
|
26
|
+
export interface Crux {
|
|
27
|
+
code: string;
|
|
28
|
+
span: string;
|
|
29
|
+
}
|
|
30
|
+
export interface NodeV1 {
|
|
31
|
+
id: string;
|
|
32
|
+
name: string;
|
|
33
|
+
kind: Kind;
|
|
34
|
+
owner?: string;
|
|
35
|
+
path: string;
|
|
36
|
+
span: string;
|
|
37
|
+
signature: string | null;
|
|
38
|
+
exported: boolean;
|
|
39
|
+
origin: "ast" | "generic";
|
|
40
|
+
body_hash: string;
|
|
41
|
+
chars?: number;
|
|
42
|
+
body_text?: string;
|
|
43
|
+
arity?: number;
|
|
44
|
+
variadic?: boolean;
|
|
45
|
+
summary_state: SummaryState;
|
|
46
|
+
summary: string | null;
|
|
47
|
+
crux: Crux | null;
|
|
48
|
+
}
|
|
49
|
+
export type Relation = "contains" | "calls" | "imports" | "references" | "implements" | "extends";
|
|
50
|
+
export interface EdgeV1 {
|
|
51
|
+
source: string;
|
|
52
|
+
target: string;
|
|
53
|
+
relation: Relation;
|
|
54
|
+
confidence: Confidence;
|
|
55
|
+
}
|
|
56
|
+
/** A ranking scope: a sub-project discovered by project-marker files (`package.json`,
|
|
57
|
+
* `go.mod`, ...). `prefix` is a posix path relative to the graph root ("" = root scope);
|
|
58
|
+
* `label` is the same value without a trailing slash (also "" for root); `markers` lists
|
|
59
|
+
* which marker file(s) were found in that directory. See `src/graph/scopes.ts`. */
|
|
60
|
+
export interface ScopeV1 {
|
|
61
|
+
prefix: string;
|
|
62
|
+
label: string;
|
|
63
|
+
markers: string[];
|
|
64
|
+
}
|
|
65
|
+
export interface GraphV1 {
|
|
66
|
+
meta: {
|
|
67
|
+
version: 1;
|
|
68
|
+
nodeCount: number;
|
|
69
|
+
edgeCount: number;
|
|
70
|
+
languages: string[];
|
|
71
|
+
/** Ranking scopes: posix path prefixes relative to the graph root, "" = root scope.
|
|
72
|
+
* Absent (old graphs) ≡ [{ prefix: "", label: "" }]. Sorted by prefix length desc. */
|
|
73
|
+
scopes?: ScopeV1[];
|
|
74
|
+
};
|
|
75
|
+
nodes: NodeV1[];
|
|
76
|
+
edges: EdgeV1[];
|
|
77
|
+
}
|
|
78
|
+
//# sourceMappingURL=types.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../src/graph/types.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;GAWG;AAEH,uFAAuF;AACvF,MAAM,MAAM,IAAI,GACZ,MAAM,GACN,OAAO,GACP,UAAU,GACV,QAAQ,GACR,WAAW,GACX,MAAM,GACN,MAAM,GACN,QAAQ,GACR,OAAO,GAMP,QAAQ,GACR,UAAU,GACV,UAAU,CAAC;AAEf;;;;;yBAKyB;AACzB,MAAM,MAAM,UAAU,GAAG,cAAc,GAAG,cAAc,GAAG,W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AW,OAAO;IACtB,IAAI,EAAE;QACJ,OAAO,EAAE,CAAC,CAAC;QACX,SAAS,EAAE,MAAM,CAAC;QAClB,SAAS,EAAE,MAAM,CAAC;QAClB,SAAS,EAAE,MAAM,EAAE,CAAC;QACpB;8FACsF;QACtF,MAAM,CAAC,EAAE,OAAO,EAAE,CAAC;KACpB,CAAC;IACF,KAAK,EAAE,MAAM,EAAE,CAAC;IAChB,KAAK,EAAE,MAAM,EAAE,CAAC;CACjB"}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* `graph.json` — the code graph schema (v1).
|
|
3
|
+
*
|
|
4
|
+
* One node per definition (file, class, function, method, interface, type, enum),
|
|
5
|
+
* wired by edges (contains, imports, calls, ...). Field names follow the LSP
|
|
6
|
+
* vocabulary (`name`, `kind`, ...) rather than any one tool's conventions.
|
|
7
|
+
*
|
|
8
|
+
* Two tiers of data live on a node:
|
|
9
|
+
* - Tier-1 (deterministic, $0): everything from the AST. Rebuilt on every run.
|
|
10
|
+
* - Tier-2 (one LLM call, cached on `body_hash`): `summary` + `crux`.
|
|
11
|
+
* M1 populates Tier-1 only; Tier-2 fields ship as `pending`/null.
|
|
12
|
+
*/
|
|
13
|
+
export {};
|
|
14
|
+
//# sourceMappingURL=types.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.js","sourceRoot":"","sources":["../../src/graph/types.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;GAWG"}
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
import type { EngineConfig } from "../ai/providers.js";
|
|
2
|
+
import type { Direction } from "./traverse.js";
|
|
3
|
+
export interface WorkspaceBuildOptions {
|
|
4
|
+
deep: boolean;
|
|
5
|
+
extensions?: string[];
|
|
6
|
+
concurrency?: number;
|
|
7
|
+
/** Provider/model/key config for child builds — WITHOUT any contextDir
|
|
8
|
+
* override, so each child writes to its own `<child>/julius/`. */
|
|
9
|
+
childConfig: EngineConfig;
|
|
10
|
+
override?: string;
|
|
11
|
+
/** The CLI's `--include-dir` override, if any. Persisted into EACH CHILD's
|
|
12
|
+
* own state (not the parent's) before that child builds: children are
|
|
13
|
+
* independent repos with their own local settings and can later be rebuilt
|
|
14
|
+
* directly without seeing the parent invocation's flags. */
|
|
15
|
+
includeDirs?: string[];
|
|
16
|
+
/** An explicit CLI submodule choice to persist into every child repo. */
|
|
17
|
+
followSubmodules?: boolean;
|
|
18
|
+
/** An explicit CLI nested-clone choice to persist into every child repo. */
|
|
19
|
+
followNestedRepos?: boolean;
|
|
20
|
+
/** The npm package this runs from, for the fix in the native-parser notice. */
|
|
21
|
+
packageName?: string;
|
|
22
|
+
}
|
|
23
|
+
/** Build every git child into its own committable `julius/`, then replace the
|
|
24
|
+
* parent's `julius/` with `workspace.json`. Prints the one-time split warning
|
|
25
|
+
* first when migrating away from a mega-graph. */
|
|
26
|
+
export declare function runWorkspaceBuild(root: string, opts: WorkspaceBuildOptions): Promise<void>;
|
|
27
|
+
export declare function runWorkspaceAsk(root: string, override: string | undefined, query: string, opts: {
|
|
28
|
+
limit?: number;
|
|
29
|
+
source?: boolean;
|
|
30
|
+
full?: boolean;
|
|
31
|
+
in?: string;
|
|
32
|
+
json?: boolean;
|
|
33
|
+
}): void;
|
|
34
|
+
export declare function runWorkspaceGrep(root: string, override: string | undefined, pattern: string, opts: {
|
|
35
|
+
ignoreCase?: boolean;
|
|
36
|
+
fixed?: boolean;
|
|
37
|
+
json?: boolean;
|
|
38
|
+
}): void;
|
|
39
|
+
export declare function runWorkspaceMap(root: string, override: string | undefined, opts: {
|
|
40
|
+
maxDirs?: number;
|
|
41
|
+
}): void;
|
|
42
|
+
export declare function runWorkspaceCheck(root: string, override?: string): Promise<void>;
|
|
43
|
+
export declare function runWorkspaceCallers(root: string, override: string | undefined, symbol: string, opts: {
|
|
44
|
+
direction?: Direction;
|
|
45
|
+
depth?: number;
|
|
46
|
+
in?: string;
|
|
47
|
+
}): void;
|
|
48
|
+
//# s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S,EAC5B,OAAO,EAAE,MAAM,EACf,IAAI,EAAE;IAAE,UAAU,CAAC,EAAE,OAAO,CAAC;IAAC,KAAK,CAAC,EAAE,OAAO,CAAC;IAAC,IAAI,CAAC,EAAE,OAAO,CAAA;CAAE,GAC9D,IAAI,CAYN;AAED,wBAAgB,eAAe,CAC7B,IAAI,EAAE,MAAM,EACZ,QAAQ,EAAE,MAAM,GAAG,SAAS,EAC5B,IAAI,EAAE;IAAE,OAAO,CAAC,EAAE,MAAM,CAAA;CAAE,GACzB,IAAI,CAEN;AAED,wBAAsB,iBAAiB,CAAC,IAAI,EAAE,MAAM,EAAE,QAAQ,CAAC,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC,CAItF;AAED,wBAAgB,mBAAmB,CACjC,IAAI,EAAE,MAAM,EACZ,QAAQ,EAAE,MAAM,GAAG,SAAS,EAC5B,MAAM,EAAE,MAAM,EACd,IAAI,EAAE;IAAE,SAAS,CAAC,EAAE,SAAS,CAAC;IAAC,KAAK,CAAC,EAAE,MAAM,CAAC;IAAC,EAAE,CAAC,EAAE,MAAM,CAAA;CAAE,GAC3D,IAAI,CAON"}
|
|
@@ -0,0 +1,102 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* CLI print/exit wrappers + per-child build orchestration for workspace
|
|
3
|
+
* federation. Kept out of both `cli.ts` (so routing there stays a one-liner
|
|
4
|
+
* per command) and `workspace.ts` (so the core stays free of process/exit and
|
|
5
|
+
* engine dependencies). The federated command bodies live in `workspace.ts`;
|
|
6
|
+
* this file only renders them and wires the child builds through the engine.
|
|
7
|
+
*/
|
|
8
|
+
import { Julius } from "../engine.js";
|
|
9
|
+
import { contextDirFor, ensureGitignored } from "../context/node-file.js";
|
|
10
|
+
import { patchBuildConfig } from "../util/state.js";
|
|
11
|
+
import { brand, cmd, PACKAGE_FOR } from "../brand.js";
|
|
12
|
+
import { nativeFallbackNotice } from "./native.js";
|
|
13
|
+
import { formatAsk } from "../ask/ask.js";
|
|
14
|
+
import { federateAsk, federateCallers, federateCheck, federateGrep, federateMap, formatGrepResult, migrationNote, splitWorkspace, zeroHitNote, } from "./workspace.js";
|
|
15
|
+
/** Build every git child into its own committable `julius/`, then replace the
|
|
16
|
+
* parent's `julius/` with `workspace.json`. Prints the one-time split warning
|
|
17
|
+
* first when migrating away from a mega-graph. */
|
|
18
|
+
export async function runWorkspaceBuild(root, opts) {
|
|
19
|
+
// Native grammars load once per process, so the children share one answer:
|
|
20
|
+
// collected here and printed once at the end, not once per repo.
|
|
21
|
+
const fellBack = { languages: new Set(), packages: new Set() };
|
|
22
|
+
const buildChild = async (childDir, childName) => {
|
|
23
|
+
// Persisted BEFORE the child build itself runs, same as the single-repo
|
|
24
|
+
// path in cli.ts, so this build and every later no-flag child build agree.
|
|
25
|
+
const childConfigPatch = {};
|
|
26
|
+
if (opts.includeDirs && opts.includeDirs.length > 0) {
|
|
27
|
+
childConfigPatch.includeDirs = opts.includeDirs;
|
|
28
|
+
}
|
|
29
|
+
if (opts.followSubmodules !== undefined) {
|
|
30
|
+
childConfigPatch.followSubmodules = opts.followSubmodules;
|
|
31
|
+
}
|
|
32
|
+
if (opts.followNestedRepos !== undefined) {
|
|
33
|
+
childConfigPatch.followNestedRepos = opts.followNestedRepos;
|
|
34
|
+
}
|
|
35
|
+
if (Object.keys(childConfigPatch).length > 0) {
|
|
36
|
+
patchBuildConfig(childDir, childConfigPatch);
|
|
37
|
+
}
|
|
38
|
+
const engine = new Julius({ ...opts.childConfig, contextDir: undefined });
|
|
39
|
+
if (opts.deep)
|
|
40
|
+
await engine.init(childDir, { extensions: opts.extensions });
|
|
41
|
+
const g = await engine.graph(childDir, { llm: opts.deep, concurrency: opts.concurrency });
|
|
42
|
+
console.log(`✓ ${childName}/: ${g.nodes} nodes, ${g.edges} edges, ${g.cards} cards [${g.languages.join(", ")}]`);
|
|
43
|
+
for (const e of g.errors)
|
|
44
|
+
console.error(`✗ ${childName}/: ${e}`);
|
|
45
|
+
for (const l of g.nativeFallback?.languages ?? [])
|
|
46
|
+
fellBack.languages.add(l);
|
|
47
|
+
for (const p of g.nativeFallback?.packages ?? [])
|
|
48
|
+
fellBack.packages.add(p);
|
|
49
|
+
};
|
|
50
|
+
const { children } = await splitWorkspace(root, opts.override, buildChild, ({ children, migrated }) => {
|
|
51
|
+
if (migrated)
|
|
52
|
+
console.error(migrationNote(children));
|
|
53
|
+
console.error(`building ${children.length} workspace repos: ${children.join(", ")}`);
|
|
54
|
+
});
|
|
55
|
+
// Each child self-ignored during its own build; the parent's federation
|
|
56
|
+
// index (julius/workspace.json) is written outside buildGraph, so ignore it here too.
|
|
57
|
+
ensureGitignored(root, contextDirFor(root, opts.override));
|
|
58
|
+
console.log(`✓ workspace: ${children.length} repos federated → julius/workspace.json`);
|
|
59
|
+
console.log(` julius/ is git-ignored — each teammate runs \`${cmd("julius build")}\` to regenerate it locally.`);
|
|
60
|
+
const notice = nativeFallbackNotice({ languages: [...fellBack.languages].sort(), packages: [...fellBack.packages].sort() }, opts.packageName ?? PACKAGE_FOR[brand()]);
|
|
61
|
+
if (notice)
|
|
62
|
+
console.error(notice);
|
|
63
|
+
}
|
|
64
|
+
export function runWorkspaceAsk(root, override, query, opts) {
|
|
65
|
+
const r = federateAsk(root, override, query, { limit: opts.limit, source: opts.source, full: opts.full, in: opts.in });
|
|
66
|
+
if (opts.json)
|
|
67
|
+
console.log(JSON.stringify(r, null, 2));
|
|
68
|
+
else
|
|
69
|
+
process.stdout.write(formatAsk(r));
|
|
70
|
+
}
|
|
71
|
+
export function runWorkspaceGrep(root, override, pattern, opts) {
|
|
72
|
+
const { result, coverage } = federateGrep(root, override, pattern, { ignoreCase: opts.ignoreCase, fixed: opts.fixed });
|
|
73
|
+
if (opts.json) {
|
|
74
|
+
console.log(JSON.stringify(result, null, 2));
|
|
75
|
+
return;
|
|
76
|
+
}
|
|
77
|
+
if (result.totalHits === 0) {
|
|
78
|
+
console.error(coverage ? `${zeroHitNote(result)}\n${coverage}` : zeroHitNote(result));
|
|
79
|
+
return;
|
|
80
|
+
}
|
|
81
|
+
process.stdout.write(formatGrepResult(result));
|
|
82
|
+
if (coverage)
|
|
83
|
+
console.log(coverage);
|
|
84
|
+
}
|
|
85
|
+
export function runWorkspaceMap(root, override, opts) {
|
|
86
|
+
process.stdout.write(federateMap(root, override, { maxDirs: opts.maxDirs }));
|
|
87
|
+
}
|
|
88
|
+
export async function runWorkspaceCheck(root, override) {
|
|
89
|
+
const { text, ok } = await federateCheck(root, override);
|
|
90
|
+
process.stdout.write(text);
|
|
91
|
+
if (!ok)
|
|
92
|
+
process.exit(1);
|
|
93
|
+
}
|
|
94
|
+
export function runWorkspaceCallers(root, override, symbol, opts) {
|
|
95
|
+
const { text, found } = federateCallers(root, override, symbol, opts);
|
|
96
|
+
if (!found) {
|
|
97
|
+
console.error(`✗ ${text}`);
|
|
98
|
+
process.exit(1);
|
|
99
|
+
}
|
|
100
|
+
process.stdout.write(text + "\n");
|
|
101
|
+
}
|
|
102
|
+
//# sourceMappingURL=workspace-cli.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"workspace-cli.js","sourceRoot":"","sources":["../../src/graph/workspace-cli.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AACH,OAAO,EAAE,MAAM,EAAE,MAAM,cAAc,CAAC;AACtC,OAAO,EAAE,aAAa,EAAE,gBAAgB,EAAE,MAAM,yBAAyB,CAAC;AAC1E,OAAO,EAAE,gBAAgB,EAAoB,MAAM,kBAAkB,CAAC;AACtE,OAAO,EAAE,KAAK,EAAE,GAAG,EAAE,WAAW,EAAE,MAAM,aAAa,CAAC;AACtD,OAAO,EAAE,oBAAoB,EAAE,MAAM,aAAa,CAAC;AAEnD,OAAO,EAAE,SAAS,EAAE,MAAM,eAAe,CAAC;AAE1C,OAAO,EACL,WAAW,EACX,eAAe,EACf,aAAa,EACb,YAAY,EACZ,WAAW,EACX,gBAAgB,EAChB,aAAa,EACb,cAAc,EACd,WAAW,GACZ,MAAM,g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