@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
package/dist/upkeep.js
ADDED
|
@@ -0,0 +1,255 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Self-maintenance: keeping an installed julius, and the wiring it wrote, current.
|
|
3
|
+
*
|
|
4
|
+
* Two independent kinds of staleness, both invisible to the user today:
|
|
5
|
+
*
|
|
6
|
+
* 1. **Binary staleness** — they installed once and never upgraded. `julius
|
|
7
|
+
* version` would tell them, but nobody runs it. So we keep a cached,
|
|
8
|
+
* machine-global registry answer and let every entry point surface a
|
|
9
|
+
* one-line nudge from it.
|
|
10
|
+
*
|
|
11
|
+
* 2. **Wiring staleness** — `julius init` copies hooks, shims, skill text and
|
|
12
|
+
* rule files INTO the repo. `npm i -g` replaces the binary but touches none
|
|
13
|
+
* of them, so a repo wired by 0.7 keeps 0.7's prompts and 0.7's hook
|
|
14
|
+
* timeouts forever (see the comment on `promptAskTimeout`, which exists
|
|
15
|
+
* only to work around exactly this). A version stamp written next to the
|
|
16
|
+
* graph lets any entry point notice the skew and re-run the writes.
|
|
17
|
+
*
|
|
18
|
+
* Everything here is fail-soft by construction: it runs inside hooks and inside
|
|
19
|
+
* the MCP server's boot path, where a throw is a broken session, and it must
|
|
20
|
+
* never block on the network — the registry is only ever read from cache, and
|
|
21
|
+
* the refresh happens in a detached child.
|
|
22
|
+
*
|
|
23
|
+
* Called from all three hosts' entry points so no editor is left out:
|
|
24
|
+
* • Claude Code — `session-start` hook (src/claude/hooks.ts)
|
|
25
|
+
* • Cursor/Codex — MCP server boot (src/mcp/server.ts), and any CLI command
|
|
26
|
+
*/
|
|
27
|
+
import { existsSync, readFileSync } from 'node:fs';
|
|
28
|
+
import { spawn } from 'node:child_process';
|
|
29
|
+
import { join } from 'node:path';
|
|
30
|
+
import { homedir } from 'node:os';
|
|
31
|
+
import { readJson, writeJsonAtomic, cacheDir } from './util/state.js';
|
|
32
|
+
import { HOSTS, hostRelPath } from './hosts/registry.js';
|
|
33
|
+
import { markersFor } from './hosts/sections.js';
|
|
34
|
+
import { getNpmViewVersion, readCurrentVersion } from './cli-meta.js';
|
|
35
|
+
import { brand } from './brand.js';
|
|
36
|
+
import { juliusCliPath } from './claude/paths.js';
|
|
37
|
+
/**
|
|
38
|
+
* The version of the julius package this code was loaded from.
|
|
39
|
+
*
|
|
40
|
+
* Resolved from *this* module rather than the caller's: `readCurrentVersion`
|
|
41
|
+
* looks one level up from the module URL it's given, which lands on the package
|
|
42
|
+
* root for `dist/upkeep.js` but misses entirely for `dist/claude/hooks.js` and
|
|
43
|
+
* `dist/mcp/server.js`. Every caller asking here instead of passing its own
|
|
44
|
+
* `import.meta.url` is what keeps the hook and the MCP server from reading
|
|
45
|
+
* `0.0.0` and re-initing on every single session.
|
|
46
|
+
*/
|
|
47
|
+
export function runningVersion() {
|
|
48
|
+
try {
|
|
49
|
+
return readCurrentVersion(import.meta.url);
|
|
50
|
+
}
|
|
51
|
+
catch {
|
|
52
|
+
return '0.0.0';
|
|
53
|
+
}
|
|
54
|
+
}
|
|
55
|
+
/** How long a registry answer is considered current. A day: julius ships far less
|
|
56
|
+
* often than that, and this is a nudge, not a security update. */
|
|
57
|
+
export const UPDATE_TTL_MS = 24 * 60 * 60 * 1000;
|
|
58
|
+
/* -------------------------------------------------------------------------- */
|
|
59
|
+
/* version comparison */
|
|
60
|
+
/* -------------------------------------------------------------------------- */
|
|
61
|
+
/** Numeric-dotted compare of the release part only (`1.2.3-beta.1` → `1.2.3`).
|
|
62
|
+
* Prerelease ordering doesn't matter here: the only question either caller asks
|
|
63
|
+
* is "is the thing on npm ahead of what's on disk", and a prerelease that
|
|
64
|
+
* compares equal simply produces no nudge. */
|
|
65
|
+
export function compareVersions(a, b) {
|
|
66
|
+
const parts = (v) => String(v).split('-')[0].split('.').map((n) => Number(n) || 0);
|
|
67
|
+
const pa = parts(a);
|
|
68
|
+
const pb = parts(b);
|
|
69
|
+
for (let i = 0; i < Math.max(pa.length, pb.length); i++) {
|
|
70
|
+
const d = (pa[i] ?? 0) - (pb[i] ?? 0);
|
|
71
|
+
if (d !== 0)
|
|
72
|
+
return d < 0 ? -1 : 1;
|
|
73
|
+
}
|
|
74
|
+
return 0;
|
|
75
|
+
}
|
|
76
|
+
export function isNewer(candidate, current) {
|
|
77
|
+
if (!candidate)
|
|
78
|
+
return false;
|
|
79
|
+
return compareVersions(candidate, current) > 0;
|
|
80
|
+
}
|
|
81
|
+
/** Machine-global, not per-repo: "what's the latest julius" is one fact, and a
|
|
82
|
+
* dev with twelve repos should cost the registry one request a day, not twelve. */
|
|
83
|
+
export function updateCachePath(home = homedir()) {
|
|
84
|
+
return join(home, '.julius', 'update-check.json');
|
|
85
|
+
}
|
|
86
|
+
export function readUpdateCache(home) {
|
|
87
|
+
return readJson(updateCachePath(home));
|
|
88
|
+
}
|
|
89
|
+
function writeUpdateCache(cache, home) {
|
|
90
|
+
try {
|
|
91
|
+
writeJsonAtomic(updateCachePath(home), cache);
|
|
92
|
+
}
|
|
93
|
+
catch { /* unwritable home — skip */ }
|
|
94
|
+
}
|
|
95
|
+
/**
|
|
96
|
+
* The `julius _update-check` command body: hit the registry, store the answer.
|
|
97
|
+
* Runs in a detached child so nothing user-facing ever waits on the network.
|
|
98
|
+
*/
|
|
99
|
+
export function refreshUpdateCache(home, now = Date.now()) {
|
|
100
|
+
const res = getNpmViewVersion();
|
|
101
|
+
const cache = { latest: res.ok ? (res.version ?? null) : null, checkedAt: now };
|
|
102
|
+
writeUpdateCache(cache, home);
|
|
103
|
+
return cache;
|
|
104
|
+
}
|
|
105
|
+
/** True when the cached answer is missing or older than the TTL. */
|
|
106
|
+
export function needsRefresh(cache, now = Date.now()) {
|
|
107
|
+
return !cache || typeof cache.checkedAt !== 'number' || now - cache.checkedAt >= UPDATE_TTL_MS;
|
|
108
|
+
}
|
|
109
|
+
/**
|
|
110
|
+
* Kick off a background registry check if the cache has gone stale. Touches
|
|
111
|
+
* `checkedAt` first so concurrent callers (and a child that dies) don't spawn a
|
|
112
|
+
* fetch per invocation. Never waits, never throws.
|
|
113
|
+
*
|
|
114
|
+
* Only called from long-lived or already-slow contexts (a CLI command, MCP
|
|
115
|
+
* boot) — never from a hook, which reads the cache and nothing else.
|
|
116
|
+
*/
|
|
117
|
+
export function maybeRefreshInBackground(home, now = Date.now(), env = process.env) {
|
|
118
|
+
if (env.JULIUS_UPDATE_CHECK !== '1')
|
|
119
|
+
return false;
|
|
120
|
+
const doNotTrack = env.DO_NOT_TRACK;
|
|
121
|
+
if (doNotTrack !== undefined && doNotTrack !== '' && doNotTrack !== '0')
|
|
122
|
+
return false;
|
|
123
|
+
const cache = readUpdateCache(home);
|
|
124
|
+
if (!needsRefresh(cache, now))
|
|
125
|
+
return false;
|
|
126
|
+
writeUpdateCache({ latest: cache?.latest ?? null, checkedAt: now }, home);
|
|
127
|
+
try {
|
|
128
|
+
const child = spawn(process.execPath, [juliusCliPath(), '_update-check'], {
|
|
129
|
+
detached: true,
|
|
130
|
+
stdio: 'ignore',
|
|
131
|
+
windowsHide: true,
|
|
132
|
+
});
|
|
133
|
+
child.unref();
|
|
134
|
+
return true;
|
|
135
|
+
}
|
|
136
|
+
catch {
|
|
137
|
+
return false; // no spawn (sandbox, ENOMEM) — the nudge just uses the old cache
|
|
138
|
+
}
|
|
139
|
+
}
|
|
140
|
+
/** One line, or nothing. Nothing is the common case — don't spend context on
|
|
141
|
+
* "you're up to date". */
|
|
142
|
+
export function formatUpdateNudge(current, latest) {
|
|
143
|
+
if (!isNewer(latest, current))
|
|
144
|
+
return null;
|
|
145
|
+
// `upgrade`, not a bare npm install: under julius it brings the julius command along.
|
|
146
|
+
return `⬆ ${brand()} ${current} → ${latest} available: run \`${brand()} upgrade\` (restart your agent after).`;
|
|
147
|
+
}
|
|
148
|
+
export const DEFAULT_WIRING_OPTS = { global: true, mcp: true, hooks: true, statusline: true };
|
|
149
|
+
/** An older stamp has no `opts`; a plain `julius init` wired everything. */
|
|
150
|
+
export function wiringOpts(stamp) {
|
|
151
|
+
return { ...DEFAULT_WIRING_OPTS, ...(stamp?.opts ?? {}) };
|
|
152
|
+
}
|
|
153
|
+
/** Under `julius/.cache/`, beside the other derived state: git-ignored, per-clone,
|
|
154
|
+
* and cheap to lose — a missing stamp just means one idempotent refresh. */
|
|
155
|
+
export function stampPath(repo) {
|
|
156
|
+
return join(cacheDir(repo), 'wiring-stamp.json');
|
|
157
|
+
}
|
|
158
|
+
export function readStamp(repo) {
|
|
159
|
+
return readJson(stampPath(repo));
|
|
160
|
+
}
|
|
161
|
+
export function writeStamp(repo, version, hosts, opts = {}, at = new Date().toISOString()) {
|
|
162
|
+
try {
|
|
163
|
+
writeJsonAtomic(stampPath(repo), {
|
|
164
|
+
version,
|
|
165
|
+
hosts: [...hosts].sort(),
|
|
166
|
+
opts: { ...DEFAULT_WIRING_OPTS, ...opts },
|
|
167
|
+
at,
|
|
168
|
+
});
|
|
169
|
+
}
|
|
170
|
+
catch { /* unwritable julius/ — a refresh will just be retried next session */ }
|
|
171
|
+
}
|
|
172
|
+
/**
|
|
173
|
+
* Which agents this repo is *already* wired for, read off disk rather than
|
|
174
|
+
* re-detected. Detection answers "which editors does this machine have"; for a
|
|
175
|
+
* refresh we need "which files did a previous init actually write" — otherwise
|
|
176
|
+
* installing Windsurf once would silently add julius rules to every repo.
|
|
177
|
+
*/
|
|
178
|
+
export function wiredHostIds(repo) {
|
|
179
|
+
const ids = [];
|
|
180
|
+
if (existsSync(join(repo, '.julius', 'hook.cjs')) || ['julius'].some((n) => existsSync(join(repo, '.claude', 'helpers', `${n}-hooks.cjs`))))
|
|
181
|
+
ids.push('claude');
|
|
182
|
+
for (const host of HOSTS) {
|
|
183
|
+
// Under either name: a repo on julius has julius's files and blocks.
|
|
184
|
+
const wired = ['julius'].some((n) => {
|
|
185
|
+
const path = join(repo, hostRelPath(host, n));
|
|
186
|
+
if (!existsSync(path))
|
|
187
|
+
return false;
|
|
188
|
+
// A shared file (AGENTS.md, GEMINI.md) counts only if julius's fenced section
|
|
189
|
+
// is in it — the user may own the file for entirely unrelated reasons.
|
|
190
|
+
if (host.kind === 'section') {
|
|
191
|
+
try {
|
|
192
|
+
return readFileSync(path, 'utf8').includes(markersFor(n).start);
|
|
193
|
+
}
|
|
194
|
+
catch {
|
|
195
|
+
return false;
|
|
196
|
+
}
|
|
197
|
+
}
|
|
198
|
+
return true;
|
|
199
|
+
});
|
|
200
|
+
if (wired)
|
|
201
|
+
ids.push(host.id);
|
|
202
|
+
}
|
|
203
|
+
return ids;
|
|
204
|
+
}
|
|
205
|
+
/**
|
|
206
|
+
* Re-run init's writes when the stamp and the running binary disagree.
|
|
207
|
+
*
|
|
208
|
+
* Deliberately narrow: it refreshes the hosts already wired, replays the flags
|
|
209
|
+
* that init was given, never builds the graph (this runs at session start — a
|
|
210
|
+
* rebuild there would stall the agent's first turn), and no-ops when the repo has
|
|
211
|
+
* no julius wiring at all.
|
|
212
|
+
*
|
|
213
|
+
* `toJulius` says whether this repo should move from julius's wiring to julius's
|
|
214
|
+
* (see upkeep-run.ts). When it should, the refresh runs whatever the stamp says:
|
|
215
|
+
* the person installed julius, which is the signal, whether or not julius's own
|
|
216
|
+
* version moved.
|
|
217
|
+
*/
|
|
218
|
+
export function reconcileWiring(repo, current, deps) {
|
|
219
|
+
try {
|
|
220
|
+
const stamp = readStamp(repo);
|
|
221
|
+
const toJulius = deps.toJulius?.(repo) ?? false;
|
|
222
|
+
if (stamp && stamp.version === current && !toJulius)
|
|
223
|
+
return null;
|
|
224
|
+
// The stamp is the record of *intent* (what the picker chose); disk is the
|
|
225
|
+
// fallback for repos wired before stamps existed. Union, not just disk:
|
|
226
|
+
// otherwise a host whose rule file went missing — deleted by hand, lost to a
|
|
227
|
+
// merge, or clobbered by another tool — is silently dropped from every future
|
|
228
|
+
// refresh, and that file is precisely what a refresh exists to restore.
|
|
229
|
+
const onDisk = (deps.wired ?? wiredHostIds)(repo);
|
|
230
|
+
const hosts = [...new Set([...(stamp?.hosts ?? []), ...onDisk])].sort();
|
|
231
|
+
if (hosts.length === 0)
|
|
232
|
+
return null; // never wired here — not our business
|
|
233
|
+
const opts = wiringOpts(stamp);
|
|
234
|
+
deps.rewrite(repo, hosts, opts, toJulius);
|
|
235
|
+
writeStamp(repo, current, hosts, opts);
|
|
236
|
+
return { from: stamp?.version ?? 'unwired', to: current, hosts, global: opts.global, ...(toJulius ? { switched: true } : {}) };
|
|
237
|
+
}
|
|
238
|
+
catch {
|
|
239
|
+
return null; // a refresh is an optimization; never fail the caller over it
|
|
240
|
+
}
|
|
241
|
+
}
|
|
242
|
+
export function formatWiringRefresh(r) {
|
|
243
|
+
if (!r)
|
|
244
|
+
return null;
|
|
245
|
+
// Said to the agent at session start, which is who can tell the person.
|
|
246
|
+
if (r.switched)
|
|
247
|
+
return (`[julius] julius is now julius, and this repo just moved to it: the same commands under the new name, plus learnings in .julius/learnings/ that the whole team shares. ` +
|
|
248
|
+
`julius is reading the user's past Claude sessions here in the background, and what it learns is there from the next session. ` +
|
|
249
|
+
`Tell the user this once, in a line at the end of your first reply, and that committing .julius/ and .claude/settings.json once moves their team over too.`);
|
|
250
|
+
// Name the out-of-repo writes explicitly: those are machine-wide and shared by
|
|
251
|
+
// every repo, so a user seeing this line should not have to guess what moved.
|
|
252
|
+
const scope = r.global && r.hosts.includes('agents') ? " (including this machine's ~/.codex config)" : '';
|
|
253
|
+
return `· julius refreshed this repo's agent wiring${scope} (written by ${r.from}, now ${r.to}): ${r.hosts.join(', ')}.`;
|
|
254
|
+
}
|
|
255
|
+
//# sourceMappingURL=upkeep.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"upkeep.js","sourceRoot":"","sources":["../src/upkeep.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;GAyBG;AACH,OAAO,EAAE,UAAU,EAAE,YAAY,EAAE,MAAM,SAAS,CAAC;AACnD,OAAO,EAAE,KAAK,EAAE,MAAM,oBAAoB,CAAC;AAC3C,OAAO,EAAE,IAAI,EAAE,MAAM,WAAW,CAAC;AACjC,OAAO,EAAE,OAAO,EAAE,MAAM,SAAS,CAAC;AAClC,OAAO,EAAE,QAAQ,EAAE,eAAe,EAAE,QAAQ,EAAE,MAAM,iBAAiB,CAAC;AACtE,OAAO,EAAE,KAAK,EAAE,WAAW,EAAE,MAAM,qBAAqB,CAAC;AACzD,OAAO,EAAE,UAAU,EAAE,MAAM,qBAAqB,CAAC;AACjD,OAAO,EAAE,iBAAiB,EAAE,kBAAkB,EAAE,MAAM,eAAe,CAAC;AACtE,OAAO,EAAE,KAAK,EAAE,MAAM,YAAY,CAAC;AACnC,OAAO,EAAE,aAAa,EAAE,MAAM,mBAAmB,CAAC;AAElD;;;;;;;;;GASG;AACH,MAAM,UAAU,cAAc;IAC5B,IAAI,CAAC;QAAC,OAAO,kBAAkB,CAAC,OAAO,IAAI,CAAC,GAAG,CAAC,CAAC;IAAC,CAAC;IAAC,MAAM,CAAC;QAAC,OAAO,OAAO,CAAC;IAAC,CAAC;AAC/E,CAAC;AAED;kEACkE;AAClE,MAAM,CAAC,MAAM,aAAa,GAAG,EAAE,GAAG,EAAE,GAAG,EAAE,GAAG,IAAI,CA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,KAAK,CAAC,IAAI,CAAC,IAAI,CAAC,GAAG,CAAC;AAC3H,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"browser.d.ts","sourceRoot":"","sources":["../../src/util/browser.ts"],"names":[],"mappings":"AAEA,uFAAuF;AACvF,wBAAgB,WAAW,CAAC,GAAG,EAAE,MAAM,GAAG,IAAI,CAQ7C"}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { spawn } from "node:child_process";
|
|
2
|
+
/** Open `url` in the default browser. Best-effort: the printed URL is the fallback. */
|
|
3
|
+
export function openBrowser(url) {
|
|
4
|
+
if (process.env.JULIUS_NO_BROWSER)
|
|
5
|
+
return;
|
|
6
|
+
const opener = process.platform === "darwin" ? "open" : process.platform === "win32" ? "start" : "xdg-open";
|
|
7
|
+
try {
|
|
8
|
+
spawn(opener, [url], { stdio: "ignore", detached: true, shell: process.platform === "win32" }).unref();
|
|
9
|
+
}
|
|
10
|
+
catch {
|
|
11
|
+
/* the printed URL is the fallback */
|
|
12
|
+
}
|
|
13
|
+
}
|
|
14
|
+
//# sourceMappingURL=browser.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"browser.js","sourceRoot":"","sources":["../../src/util/browser.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,EAAE,MAAM,oBAAoB,CAAC;AAE3C,uFAAuF;AACvF,MAAM,UAAU,WAAW,CAAC,GAAW;IACrC,IAAI,OAAO,CAAC,GAAG,CAAC,iBAAiB;QAAE,OAAO;IAC1C,MAAM,MAAM,GAAG,OAAO,CAAC,QAAQ,KAAK,QAAQ,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,OAAO,CAAC,QAAQ,KAAK,OAAO,CAAC,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,UAAU,CAAC;IAC5G,IAAI,CAAC;QACH,KAAK,CAAC,MAAM,EAAE,CAAC,GAAG,CAAC,EAAE,EAAE,KAAK,EAAE,QAAQ,EAAE,QAAQ,EAAE,IAAI,EAAE,KAAK,EAAE,OAAO,CAAC,QAAQ,KAAK,OAAO,EAAE,CAAC,CAAC,KAAK,EAAE,CAAC;IACzG,CAAC;IAAC,MAAM,CAAC;QACP,qCAAqC;IACvC,CAAC;AACH,CAAC"}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Front matter, YAML only.
|
|
3
|
+
*
|
|
4
|
+
* gray-matter picks its parser from the opening fence: `---js` or
|
|
5
|
+
* `---javascript` front matter is run through `eval`. Every file read here
|
|
6
|
+
* comes from a repo — a learning committed by a teammate or sitting on their
|
|
7
|
+
* pushed branch, a skill, a julius/ card — so a file that opened with `---js`
|
|
8
|
+
* would run its code on whoever reads it. Here those fences parse as empty
|
|
9
|
+
* front matter instead: nothing runs, and the file reads as having none (a
|
|
10
|
+
* learning without a title, a card without a slug), which every caller
|
|
11
|
+
* already skips.
|
|
12
|
+
*/
|
|
13
|
+
import grayMatter from "gray-matter";
|
|
14
|
+
export type FrontMatterFile = grayMatter.GrayMatterFile<string>;
|
|
15
|
+
/** gray-matter's parse with YAML only, and its `stringify`, which writes YAML. */
|
|
16
|
+
export declare const matter: ((text: string) => FrontMatterFile) & {
|
|
17
|
+
stringify: typeof grayMatter.stringify;
|
|
18
|
+
};
|
|
19
|
+
//# sourceMappingURL=front-matter.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"front-matter.d.ts","sourceRoot":"","sources":["../../src/util/front-matter.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;GAWG;AACH,OAAO,UAAU,MAAM,aAAa,CAAC;AAErC,MAAM,MAAM,eAAe,GAAG,UAAU,CAAC,cAAc,CAAC,MAAM,CAAC,CAAC;AAMhE,kFAAkF;AAClF,eAAO,MAAM,MAAM,UAAwB,MAAM,KAAG,eAAe;;CAEjE,CAAC"}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Front matter, YAML only.
|
|
3
|
+
*
|
|
4
|
+
* gray-matter picks its parser from the opening fence: `---js` or
|
|
5
|
+
* `---javascript` front matter is run through `eval`. Every file read here
|
|
6
|
+
* comes from a repo — a learning committed by a teammate or sitting on their
|
|
7
|
+
* pushed branch, a skill, a julius/ card — so a file that opened with `---js`
|
|
8
|
+
* would run its code on whoever reads it. Here those fences parse as empty
|
|
9
|
+
* front matter instead: nothing runs, and the file reads as having none (a
|
|
10
|
+
* learning without a title, a card without a slug), which every caller
|
|
11
|
+
* already skips.
|
|
12
|
+
*/
|
|
13
|
+
import grayMatter from "gray-matter";
|
|
14
|
+
const nothing = () => ({});
|
|
15
|
+
// gray-matter looks an engine up by the fence's own spelling, then by its alias.
|
|
16
|
+
const CODE_ENGINES = { js: nothing, javascript: nothing, coffee: nothing, coffeescript: nothing, cson: nothing };
|
|
17
|
+
/** gray-matter's parse with YAML only, and its `stringify`, which writes YAML. */
|
|
18
|
+
export const matter = Object.assign((text) => grayMatter(text, { engines: CODE_ENGINES }), {
|
|
19
|
+
stringify: grayMatter.stringify,
|
|
20
|
+
});
|
|
21
|
+
//# sourceMappingURL=front-matter.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"front-matter.js","sourceRoot":"","sources":["../../src/util/front-matter.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;GAWG;AACH,OAAO,UAAU,MAAM,aAAa,CAAC;AAIrC,MAAM,OAAO,GAAG,GAAW,EAAE,CAAC,CAAC,EAAE,CAAC,CAAC;AACnC,iFAAiF;AACjF,MAAM,YAAY,GAAG,EAAE,EAAE,EAAE,OAAO,EAAE,UAAU,EAAE,OAAO,EAAE,MAAM,EAAE,OAAO,EAAE,YAAY,EAAE,OAAO,EAAE,IAAI,EAAE,OAAO,EAAE,CAAC;AAEjH,kFAAkF;AAClF,MAAM,CAAC,MAAM,MAAM,GAAG,MAAM,CAAC,MAAM,CAAC,CAAC,IAAY,EAAmB,EAAE,CAAC,UAAU,CAAC,IAAI,EAAE,EAAE,OAAO,EAAE,YAAY,EAAE,CAAC,EAAE;IAClH,SAAS,EAAE,UAAU,CAAC,SAAS;CAChC,CAAC,CAAC"}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
/** Generate a random unique id with a short type prefix, e.g. "node_ab12…". */
|
|
2
|
+
export declare function newId(prefix: string): string;
|
|
3
|
+
/** Stable content hash (sha256, hex) used for document dedup. */
|
|
4
|
+
export declare function contentHash(input: string): string;
|
|
5
|
+
/** Normalize a name/alias for case- and whitespace-insensitive matching. */
|
|
6
|
+
export declare function normalizeName(name: string): string;
|
|
7
|
+
//# sourceMappingURL=id.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"id.d.ts","sourceRoot":"","sources":["../../src/util/id.ts"],"names":[],"mappings":"AAEA,+EAA+E;AAC/E,wBAAgB,KAAK,CAAC,MAAM,EAAE,MAAM,GAAG,MAAM,CAE5C;AAED,iEAAiE;AACjE,wBAAgB,WAAW,CAAC,KAAK,EAAE,MAAM,GAAG,MAAM,CAEjD;AAED,4EAA4E;AAC5E,wBAAgB,aAAa,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM,CAElD"}
|
package/dist/util/id.js
ADDED
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { randomUUID, createHash } from "node:crypto";
|
|
2
|
+
/** Generate a random unique id with a short type prefix, e.g. "node_ab12…". */
|
|
3
|
+
export function newId(prefix) {
|
|
4
|
+
return `${prefix}_${randomUUID().replace(/-/g, "").slice(0, 20)}`;
|
|
5
|
+
}
|
|
6
|
+
/** Stable content hash (sha256, hex) used for document dedup. */
|
|
7
|
+
export function contentHash(input) {
|
|
8
|
+
return createHash("sha256").update(input).digest("hex");
|
|
9
|
+
}
|
|
10
|
+
/** Normalize a name/alias for case- and whitespace-insensitive matching. */
|
|
11
|
+
export function normalizeName(name) {
|
|
12
|
+
return name.trim().toLowerCase().replace(/\s+/g, " ");
|
|
13
|
+
}
|
|
14
|
+
//# sourceMappingURL=id.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"id.js","sourceRoot":"","sources":["../../src/util/id.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,UAAU,EAAE,MAAM,aAAa,CAAC;AAErD,+EAA+E;AAC/E,MAAM,UAAU,KAAK,CAAC,MAAc;IAClC,OAAO,GAAG,MAAM,IAAI,UAAU,EAAE,CAAC,OAAO,CAAC,IAAI,EAAE,EAAE,CAAC,CAAC,KAAK,CAAC,CAAC,EAAE,EAAE,CAAC,EAAE,CAAC;AACpE,CAAC;AAED,iEAAiE;AACjE,MAAM,UAAU,WAAW,CAAC,KAAa;IACvC,OAAO,UAAU,CAAC,QAAQ,CAAC,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC;AAC1D,CAAC;AAED,4EAA4E;AAC5E,MAAM,UAAU,aAAa,CAAC,IAAY;IACxC,OAAO,IAAI,CAAC,IAAI,EAAE,CAAC,WAAW,EAAE,CAAC,OAAO,CAAC,MAAM,EAAE,GAAG,CAAC,CAAC;AACxD,CAAC"}
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
/** Platform separators → `/`. Identity on posix. */
|
|
2
|
+
export declare function toPosixPath(p: string): string;
|
|
3
|
+
/**
|
|
4
|
+
* `relative(from, to)`, normalized to posix — the canonical form of every path
|
|
5
|
+
* julius stores. Use this rather than bare `relative` for anything that lands in
|
|
6
|
+
* the graph, a cache key, or a manifest. Bare `relative` is still right for
|
|
7
|
+
* text shown in the terminal, where a native separator is what the platform's
|
|
8
|
+
* users expect.
|
|
9
|
+
*/
|
|
10
|
+
export declare function relPosix(from: string, to: string): string;
|
|
11
|
+
/**
|
|
12
|
+
* Trailing `/` off a repo-relative path, in linear time.
|
|
13
|
+
*
|
|
14
|
+
* The obvious `replace(/\/+$/, "")` is a polynomial-ReDoS shape — `\/+$` can begin
|
|
15
|
+
* matching at any point inside a run of slashes, so a path ending in many slashes
|
|
16
|
+
* and then anything else costs O(n²). CodeQL flags it (`js/polynomial-redos`), and
|
|
17
|
+
* rightly: these inputs are a `--dir` or `--in` value rather than anything
|
|
18
|
+
* attacker-controlled, but the ambiguity buys nothing and a loop is both faster
|
|
19
|
+
* and plainer.
|
|
20
|
+
*/
|
|
21
|
+
export declare function stripTrailingSlashes(path: string): string;
|
|
22
|
+
/**
|
|
23
|
+
* Normalize a user-supplied path prefix (`--in`) so it can be compared against
|
|
24
|
+
* a stored `node.path`: posix separators, no leading `./`, no trailing
|
|
25
|
+
* separator. Windows users type — and their shell's tab-completion produces —
|
|
26
|
+
* `--in server\src\gpu`, so both separators have to reduce to the same prefix.
|
|
27
|
+
*/
|
|
28
|
+
export declare function normalizePathPrefix(p: string): string;
|
|
29
|
+
//# sourceMappingURL=paths.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"paths.d.ts","sourceRoot":"","sources":["../../src/util/paths.ts"],"names":[],"mappings":"AA2BA,oDAAoD;AACpD,wBAAgB,WAAW,CAAC,CAAC,EAAE,MAAM,GAAG,MAAM,CAE7C;AAED;;;;;;GAMG;AACH,wBAAgB,QAAQ,CAAC,IAAI,EAAE,MAAM,EAAE,EAAE,EAAE,MAAM,GAAG,MAAM,CAEzD;AAED;;;;;;;;;GASG;AACH,wBAAgB,oBAAoB,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM,CAIzD;AAED;;;;;GAKG;AACH,wBAAgB,mBAAmB,CAAC,CAAC,EAAE,MAAM,GAAG,MAAM,CAMrD"}
|
|
@@ -0,0 +1,71 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Repo-relative paths, always posix.
|
|
3
|
+
*
|
|
4
|
+
* Every path julius stores — node ids, `node.path`, extract-cache keys, the
|
|
5
|
+
* freshness fingerprint, the card manifest — is repo-relative and separated by
|
|
6
|
+
* `/` on every platform. That is not cosmetic: the query layer parses these
|
|
7
|
+
* strings with `/` as the separator, and does it by hand rather than through
|
|
8
|
+
* `node:path`. `pathUnderPrefix` (`--in` scoping) tests
|
|
9
|
+
* `startsWith(`${prefix}/`)`, `map`'s `dirKey` splits on `/` to cluster by
|
|
10
|
+
* directory, `resolveSymbol` matches a filename query with
|
|
11
|
+
* `endsWith("/" + query)`. Hand any of them a `src\gate.ts` and none of them
|
|
12
|
+
* error — they match nothing, silently. On Windows that made every `--in`
|
|
13
|
+
* report "nothing indexed under …" and made `map` emit one single-file
|
|
14
|
+
* "directory" per file.
|
|
15
|
+
*
|
|
16
|
+
* So normalize once, here, where a path is *created*, instead of defensively at
|
|
17
|
+
* each consumer — a consumer that forgets is a silent wrong answer, and there
|
|
18
|
+
* are more consumers than producers.
|
|
19
|
+
*
|
|
20
|
+
* {@link toPosixPath} splits on the platform `sep`, never a literal `\`: a
|
|
21
|
+
* posix filename may legitimately contain a backslash, and splitting on `"\\"`
|
|
22
|
+
* would corrupt it. That also makes this module provably the identity function
|
|
23
|
+
* on posix, which is what guarantees an existing Mac/Linux graph is byte-identical
|
|
24
|
+
* across this change.
|
|
25
|
+
*/
|
|
26
|
+
import { relative, sep } from "node:path";
|
|
27
|
+
/** Platform separators → `/`. Identity on posix. */
|
|
28
|
+
export function toPosixPath(p) {
|
|
29
|
+
return sep === "/" ? p : p.split(sep).join("/");
|
|
30
|
+
}
|
|
31
|
+
/**
|
|
32
|
+
* `relative(from, to)`, normalized to posix — the canonical form of every path
|
|
33
|
+
* julius stores. Use this rather than bare `relative` for anything that lands in
|
|
34
|
+
* the graph, a cache key, or a manifest. Bare `relative` is still right for
|
|
35
|
+
* text shown in the terminal, where a native separator is what the platform's
|
|
36
|
+
* users expect.
|
|
37
|
+
*/
|
|
38
|
+
export function relPosix(from, to) {
|
|
39
|
+
return toPosixPath(relative(from, to));
|
|
40
|
+
}
|
|
41
|
+
/**
|
|
42
|
+
* Trailing `/` off a repo-relative path, in linear time.
|
|
43
|
+
*
|
|
44
|
+
* The obvious `replace(/\/+$/, "")` is a polynomial-ReDoS shape — `\/+$` can begin
|
|
45
|
+
* matching at any point inside a run of slashes, so a path ending in many slashes
|
|
46
|
+
* and then anything else costs O(n²). CodeQL flags it (`js/polynomial-redos`), and
|
|
47
|
+
* rightly: these inputs are a `--dir` or `--in` value rather than anything
|
|
48
|
+
* attacker-controlled, but the ambiguity buys nothing and a loop is both faster
|
|
49
|
+
* and plainer.
|
|
50
|
+
*/
|
|
51
|
+
export function stripTrailingSlashes(path) {
|
|
52
|
+
let end = path.length;
|
|
53
|
+
while (end > 0 && path[end - 1] === "/")
|
|
54
|
+
end--;
|
|
55
|
+
return path.slice(0, end);
|
|
56
|
+
}
|
|
57
|
+
/**
|
|
58
|
+
* Normalize a user-supplied path prefix (`--in`) so it can be compared against
|
|
59
|
+
* a stored `node.path`: posix separators, no leading `./`, no trailing
|
|
60
|
+
* separator. Windows users type — and their shell's tab-completion produces —
|
|
61
|
+
* `--in server\src\gpu`, so both separators have to reduce to the same prefix.
|
|
62
|
+
*/
|
|
63
|
+
export function normalizePathPrefix(p) {
|
|
64
|
+
let out = toPosixPath(p);
|
|
65
|
+
while (out.startsWith("./"))
|
|
66
|
+
out = out.slice(2);
|
|
67
|
+
// Trailing separators only; a bare "/" normalizes to "" (match everything),
|
|
68
|
+
// which is exactly how `pathUnderPrefix` reads an empty prefix.
|
|
69
|
+
return stripTrailingSlashes(out);
|
|
70
|
+
}
|
|
71
|
+
//# sourceMappingURL=paths.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"paths.js","sourceRoot":"","sources":["../../src/util/paths.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;GAwBG;AACH,OAAO,EAAE,QAAQ,EAAE,GAAG,EAAE,MAAM,WAAW,CAAC;AAE1C,oDAAoD;AACpD,MAAM,UAAU,WAAW,CAAC,CAAS;IACnC,OAAO,GAAG,KAAK,GAAG,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;AAClD,CAAC;AAED;;;;;;GAMG;AACH,MAAM,UAAU,QAAQ,CAAC,IAAY,EAAE,EAAU;IAC/C,OAAO,WAAW,CAAC,QAAQ,CAAC,IAAI,EAAE,EAAE,CAAC,CAAC,CAAC;AACzC,CAAC;AAED;;;;;;;;;GASG;AACH,MAAM,UAAU,oBAAoB,CAAC,IAAY;IAC/C,IAAI,GAAG,GAAG,IAAI,CAAC,MAAM,CAAC;IACtB,OAAO,GAAG,GAAG,CAAC,IAAI,IAAI,CAAC,GAAG,GAAG,CAAC,CAAC,KAAK,GAAG;QAAE,GAAG,EAAE,CAAC;IAC/C,OAAO,IAAI,CAAC,KAAK,CAAC,CAAC,EAAE,GAAG,CAAC,CAAC;AAC5B,CAAC;AAED;;;;;GAKG;AACH,MAAM,UAAU,mBAAmB,CAAC,CAAS;IAC3C,IAAI,GAAG,GAAG,WAAW,CAAC,CAAC,CAAC,CAAC;IACzB,OAAO,GAAG,CAAC,UAAU,CAAC,IAAI,CAAC;QAAE,GAAG,GAAG,GAAG,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC;IAChD,4EAA4E;IAC5E,gEAAgE;IAChE,OAAO,oBAAoB,CAAC,GAAG,CAAC,CAAC;AACnC,CAAC"}
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
/** Read source text, decoding Windows tooling's common UTF-16LE output. UTF-16BE
|
|
2
|
+
* is rare and unsupported by Node's built-in decoders, so callers silently skip it. */
|
|
3
|
+
export declare function readSourceFile(path: string): string | null;
|
|
4
|
+
//# sourceMappingURL=source.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"source.d.ts","sourceRoot":"","sources":["../../src/util/source.ts"],"names":[],"mappings":"AAEA;uFACuF;AACvF,wBAAgB,cAAc,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM,GAAG,IAAI,CAK1D"}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { readFileSync } from "node:fs";
|
|
2
|
+
/** Read source text, decoding Windows tooling's common UTF-16LE output. UTF-16BE
|
|
3
|
+
* is rare and unsupported by Node's built-in decoders, so callers silently skip it. */
|
|
4
|
+
export function readSourceFile(path) {
|
|
5
|
+
const bytes = readFileSync(path);
|
|
6
|
+
if (bytes[0] === 0xfe && bytes[1] === 0xff)
|
|
7
|
+
return null;
|
|
8
|
+
if (bytes[0] === 0xff && bytes[1] === 0xfe)
|
|
9
|
+
return bytes.subarray(2).toString("utf16le");
|
|
10
|
+
return bytes.toString("utf8");
|
|
11
|
+
}
|
|
12
|
+
//# sourceMappingURL=source.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"source.js","sourceRoot":"","sources":["../../src/util/source.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,SAAS,CAAC;AAEvC;uFACuF;AACvF,MAAM,UAAU,cAAc,CAAC,IAAY;IACzC,MAAM,KAAK,GAAG,YAAY,CAAC,IAAI,CAAC,CAAC;IACjC,IAAI,KAAK,CAAC,CAAC,CAAC,KAAK,IAAI,IAAI,KAAK,CAAC,CAAC,CAAC,KAAK,IAAI;QAAE,OAAO,IAAI,CAAC;IACxD,IAAI,KAAK,CAAC,CAAC,CAAC,KAAK,IAAI,IAAI,KAAK,CAAC,CAAC,CAAC,KAAK,IAAI;QAAE,OAAO,KAAK,CAAC,QAAQ,CAAC,CAAC,CAAC,CAAC,QAAQ,CAAC,SAAS,CAAC,CAAC;IACzF,OAAO,KAAK,CAAC,QAAQ,CAAC,MAAM,CAAC,CAAC;AAChC,CAAC"}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
export interface Spinner {
|
|
2
|
+
/** Change the text after the frame. */
|
|
3
|
+
update(text: string): void;
|
|
4
|
+
/** Print a finished line above the spinner, which keeps spinning below it. */
|
|
5
|
+
print(line: string): void;
|
|
6
|
+
/** Erase the line and stop. Safe to call more than once. */
|
|
7
|
+
stop(): void;
|
|
8
|
+
readonly active: boolean;
|
|
9
|
+
}
|
|
10
|
+
export declare function startSpinner(text: string, opts?: {
|
|
11
|
+
stream?: NodeJS.WriteStream;
|
|
12
|
+
enabled?: boolean;
|
|
13
|
+
intervalMs?: number;
|
|
14
|
+
}): Spinner;
|
|
15
|
+
//# sourceMappingURL=spinner.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"spinner.d.ts","sourceRoot":"","sources":["../../src/util/spinner.ts"],"names":[],"mappings":"AASA,MAAM,WAAW,OAAO;IACtB,uCAAuC;IACvC,MAAM,CAAC,IAAI,EAAE,MAAM,GAAG,IAAI,CAAC;IAC3B,8EAA8E;IAC9E,KAAK,CAAC,IAAI,EAAE,MAAM,GAAG,IAAI,CAAC;IAC1B,4DAA4D;IAC5D,IAAI,IAAI,IAAI,CAAC;IACb,QAAQ,CAAC,MAAM,EAAE,OAAO,CAAC;CAC1B;AAED,wBAAgB,YAAY,CAC1B,IAAI,EAAE,MAAM,EACZ,IAAI,GAAE;IAAE,MAAM,CAAC,EAAE,MAAM,CAAC,WAAW,CAAC;IAAC,OAAO,CAAC,EAAE,OAAO,CAAC;IAAC,UAAU,CAAC,EAAE,MAAM,CAAA;CAAO,GACjF,OAAO,CAwCT"}
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* One line that redraws in place while something runs, and is erased when it
|
|
3
|
+
* stops — so nothing interactive is left in the scrollback.
|
|
4
|
+
*
|
|
5
|
+
* Only on a TTY. Anywhere else every method is a no-op, and the caller prints
|
|
6
|
+
* whatever finished lines it wants a log to keep.
|
|
7
|
+
*/
|
|
8
|
+
const FRAMES = ["⠋", "⠙", "⠹", "⠸", "⠼", "⠴", "⠦", "⠧", "⠇", "⠏"];
|
|
9
|
+
export function startSpinner(text, opts = {}) {
|
|
10
|
+
const out = opts.stream ?? process.stderr;
|
|
11
|
+
const enabled = opts.enabled ?? Boolean(out.isTTY);
|
|
12
|
+
if (!enabled) {
|
|
13
|
+
return { update() { }, print: (line) => out.write(`${line}\n`), stop() { }, active: false };
|
|
14
|
+
}
|
|
15
|
+
let current = text;
|
|
16
|
+
let frame = 0;
|
|
17
|
+
let stopped = false;
|
|
18
|
+
const width = () => Math.max(20, (out.columns || 100) - 1);
|
|
19
|
+
const draw = () => {
|
|
20
|
+
if (stopped)
|
|
21
|
+
return;
|
|
22
|
+
const line = `${FRAMES[frame % FRAMES.length]} ${current}`;
|
|
23
|
+
out.write(`\r\x1b[2K${line.length > width() ? line.slice(0, width()) : line}`);
|
|
24
|
+
frame++;
|
|
25
|
+
};
|
|
26
|
+
const clear = () => out.write("\r\x1b[2K");
|
|
27
|
+
draw();
|
|
28
|
+
const timer = setInterval(draw, opts.intervalMs ?? 80);
|
|
29
|
+
timer.unref?.();
|
|
30
|
+
return {
|
|
31
|
+
get active() {
|
|
32
|
+
return !stopped;
|
|
33
|
+
},
|
|
34
|
+
update(next) {
|
|
35
|
+
current = next;
|
|
36
|
+
draw();
|
|
37
|
+
},
|
|
38
|
+
print(line) {
|
|
39
|
+
clear();
|
|
40
|
+
out.write(`${line}\n`);
|
|
41
|
+
draw();
|
|
42
|
+
},
|
|
43
|
+
stop() {
|
|
44
|
+
if (stopped)
|
|
45
|
+
return;
|
|
46
|
+
stopped = true;
|
|
47
|
+
clearInterval(timer);
|
|
48
|
+
clear();
|
|
49
|
+
},
|
|
50
|
+
};
|
|
51
|
+
}
|
|
52
|
+
//# sourceMappingURL=spinner.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"spinner.js","sourceRoot":"","sources":["../../src/util/spinner.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AACH,MAAM,MAAM,GAAG,CAAC,GAAG,EAAE,GAAG,EAAE,GAAG,EAAE,GAAG,EAAE,GAAG,EAAE,GAAG,EAAE,GAAG,EAAE,GAAG,EAAE,GAAG,EAAE,GAAG,CAAC,CAAC;AAY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