@ruverd/julius 0.0.0-stage → 0.24.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +47 -0
- package/CREDITS.md +25 -0
- package/LICENSE +21 -0
- package/PROVENANCE.md +9 -0
- package/README.md +229 -2
- package/dist/ai/crux.d.ts +60 -0
- package/dist/ai/crux.d.ts.map +1 -0
- package/dist/ai/crux.js +141 -0
- package/dist/ai/crux.js.map +1 -0
- package/dist/ai/failure.d.ts +60 -0
- package/dist/ai/failure.d.ts.map +1 -0
- package/dist/ai/failure.js +86 -0
- package/dist/ai/failure.js.map +1 -0
- package/dist/ai/llm/anthropic.d.ts +37 -0
- package/dist/ai/llm/anthropic.d.ts.map +1 -0
- package/dist/ai/llm/anthropic.js +144 -0
- package/dist/ai/llm/anthropic.js.map +1 -0
- package/dist/ai/llm/factory.d.ts +28 -0
- package/dist/ai/llm/factory.d.ts.map +1 -0
- package/dist/ai/llm/factory.js +36 -0
- package/dist/ai/llm/factory.js.map +1 -0
- package/dist/ai/llm/litellm.d.ts +34 -0
- package/dist/ai/llm/litellm.d.ts.map +1 -0
- package/dist/ai/llm/litellm.js +45 -0
- package/dist/ai/llm/litellm.js.map +1 -0
- package/dist/ai/llm/openai.d.ts +44 -0
- package/dist/ai/llm/openai.d.ts.map +1 -0
- package/dist/ai/llm/openai.js +239 -0
- package/dist/ai/llm/openai.js.map +1 -0
- package/dist/ai/llm/orcarouter.d.ts +34 -0
- package/dist/ai/llm/orcarouter.d.ts.map +1 -0
- package/dist/ai/llm/orcarouter.js +45 -0
- package/dist/ai/llm/orcarouter.js.map +1 -0
- package/dist/ai/llm/recover-tool.d.ts +19 -0
- package/dist/ai/llm/recover-tool.d.ts.map +1 -0
- package/dist/ai/llm/recover-tool.js +109 -0
- package/dist/ai/llm/recover-tool.js.map +1 -0
- package/dist/ai/llm/types.d.ts +122 -0
- package/dist/ai/llm/types.d.ts.map +1 -0
- package/dist/ai/llm/types.js +33 -0
- package/dist/ai/llm/types.js.map +1 -0
- package/dist/ai/providers.d.ts +59 -0
- package/dist/ai/providers.d.ts.map +1 -0
- package/dist/ai/providers.js +54 -0
- package/dist/ai/providers.js.map +1 -0
- package/dist/ai/summarize.d.ts +25 -0
- package/dist/ai/summarize.d.ts.map +1 -0
- package/dist/ai/summarize.js +34 -0
- package/dist/ai/summarize.js.map +1 -0
- package/dist/ai/synthesize.d.ts +40 -0
- package/dist/ai/synthesize.d.ts.map +1 -0
- package/dist/ai/synthesize.js +131 -0
- package/dist/ai/synthesize.js.map +1 -0
- package/dist/app/checkout.d.ts +46 -0
- package/dist/app/checkout.d.ts.map +1 -0
- package/dist/app/checkout.js +223 -0
- package/dist/app/checkout.js.map +1 -0
- package/dist/app/events.d.ts +44 -0
- package/dist/app/events.d.ts.map +1 -0
- package/dist/app/events.js +64 -0
- package/dist/app/events.js.map +1 -0
- package/dist/app/identity.d.ts +54 -0
- package/dist/app/identity.d.ts.map +1 -0
- package/dist/app/identity.js +96 -0
- package/dist/app/identity.js.map +1 -0
- package/dist/app/main.d.ts +2 -0
- package/dist/app/main.d.ts.map +1 -0
- package/dist/app/main.js +62 -0
- package/dist/app/main.js.map +1 -0
- package/dist/app/pages.d.ts +56 -0
- package/dist/app/pages.d.ts.map +1 -0
- package/dist/app/pages.js +193 -0
- package/dist/app/pages.js.map +1 -0
- package/dist/app/queue.d.ts +40 -0
- package/dist/app/queue.d.ts.map +1 -0
- package/dist/app/queue.js +68 -0
- package/dist/app/queue.js.map +1 -0
- package/dist/app/review-process.d.ts +66 -0
- package/dist/app/review-process.d.ts.map +1 -0
- package/dist/app/review-process.js +200 -0
- package/dist/app/review-process.js.map +1 -0
- package/dist/app/review-worker.d.ts +2 -0
- package/dist/app/review-worker.d.ts.map +1 -0
- package/dist/app/review-worker.js +108 -0
- package/dist/app/review-worker.js.map +1 -0
- package/dist/app/review.d.ts +23 -0
- package/dist/app/review.d.ts.map +1 -0
- package/dist/app/review.js +142 -0
- package/dist/app/review.js.map +1 -0
- package/dist/app/server.d.ts +49 -0
- package/dist/app/server.d.ts.map +1 -0
- package/dist/app/server.js +123 -0
- package/dist/app/server.js.map +1 -0
- package/dist/ask/ask.d.ts +195 -0
- package/dist/ask/ask.d.ts.map +1 -0
- package/dist/ask/ask.js +1252 -0
- package/dist/ask/ask.js.map +1 -0
- package/dist/ask/file-rank.d.ts +72 -0
- package/dist/ask/file-rank.d.ts.map +1 -0
- package/dist/ask/file-rank.js +160 -0
- package/dist/ask/file-rank.js.map +1 -0
- package/dist/ask/file-selection.d.ts +22 -0
- package/dist/ask/file-selection.d.ts.map +1 -0
- package/dist/ask/file-selection.js +66 -0
- package/dist/ask/file-selection.js.map +1 -0
- package/dist/ask/fuse.d.ts +195 -0
- package/dist/ask/fuse.d.ts.map +1 -0
- package/dist/ask/fuse.js +344 -0
- package/dist/ask/fuse.js.map +1 -0
- package/dist/ask/graphrank.d.ts +61 -0
- package/dist/ask/graphrank.d.ts.map +1 -0
- package/dist/ask/graphrank.js +130 -0
- package/dist/ask/graphrank.js.map +1 -0
- package/dist/ask/index-file.d.ts +44 -0
- package/dist/ask/index-file.d.ts.map +1 -0
- package/dist/ask/index-file.js +128 -0
- package/dist/ask/index-file.js.map +1 -0
- package/dist/bin/julius.d.ts +3 -0
- package/dist/bin/julius.d.ts.map +1 -0
- package/dist/bin/julius.js +4 -0
- package/dist/bin/julius.js.map +1 -0
- package/dist/blast/blast-cli.d.ts +35 -0
- package/dist/blast/blast-cli.d.ts.map +1 -0
- package/dist/blast/blast-cli.js +155 -0
- package/dist/blast/blast-cli.js.map +1 -0
- package/dist/blast/blast.d.ts +128 -0
- package/dist/blast/blast.d.ts.map +1 -0
- package/dist/blast/blast.js +383 -0
- package/dist/blast/blast.js.map +1 -0
- package/dist/blast/diff.d.ts +53 -0
- package/dist/blast/diff.d.ts.map +1 -0
- package/dist/blast/diff.js +193 -0
- package/dist/blast/diff.js.map +1 -0
- package/dist/blast/evidence.d.ts +51 -0
- package/dist/blast/evidence.d.ts.map +1 -0
- package/dist/blast/evidence.js +162 -0
- package/dist/blast/evidence.js.map +1 -0
- package/dist/blast/modules.d.ts +33 -0
- package/dist/blast/modules.d.ts.map +1 -0
- package/dist/blast/modules.js +83 -0
- package/dist/blast/modules.js.map +1 -0
- package/dist/blast/name.d.ts +74 -0
- package/dist/blast/name.d.ts.map +1 -0
- package/dist/blast/name.js +269 -0
- package/dist/blast/name.js.map +1 -0
- package/dist/blast/owners.d.ts +85 -0
- package/dist/blast/owners.d.ts.map +1 -0
- package/dist/blast/owners.js +272 -0
- package/dist/blast/owners.js.map +1 -0
- package/dist/blast/render.d.ts +46 -0
- package/dist/blast/render.d.ts.map +1 -0
- package/dist/blast/render.js +422 -0
- package/dist/blast/render.js.map +1 -0
- package/dist/blast/viz.d.ts +37 -0
- package/dist/blast/viz.d.ts.map +1 -0
- package/dist/blast/viz.js +180 -0
- package/dist/blast/viz.js.map +1 -0
- package/dist/brand.d.ts +13 -0
- package/dist/brand.d.ts.map +1 -0
- package/dist/brand.js +43 -0
- package/dist/brand.js.map +1 -0
- package/dist/check/learning-edits.d.ts +9 -0
- package/dist/check/learning-edits.d.ts.map +1 -0
- package/dist/check/learning-edits.js +62 -0
- package/dist/check/learning-edits.js.map +1 -0
- package/dist/check/local-check.d.ts +104 -0
- package/dist/check/local-check.d.ts.map +1 -0
- package/dist/check/local-check.js +830 -0
- package/dist/check/local-check.js.map +1 -0
- package/dist/check/types.d.ts +31 -0
- package/dist/check/types.d.ts.map +1 -0
- package/dist/check/types.js +2 -0
- package/dist/check/types.js.map +1 -0
- package/dist/claude/build-progress.d.ts +29 -0
- package/dist/claude/build-progress.d.ts.map +1 -0
- package/dist/claude/build-progress.js +76 -0
- package/dist/claude/build-progress.js.map +1 -0
- package/dist/claude/format.d.ts +131 -0
- package/dist/claude/format.d.ts.map +1 -0
- package/dist/claude/format.js +328 -0
- package/dist/claude/format.js.map +1 -0
- package/dist/claude/hook-layers.d.ts +8 -0
- package/dist/claude/hook-layers.d.ts.map +1 -0
- package/dist/claude/hook-layers.js +74 -0
- package/dist/claude/hook-layers.js.map +1 -0
- package/dist/claude/hooks.d.ts +101 -0
- package/dist/claude/hooks.d.ts.map +1 -0
- package/dist/claude/hooks.js +849 -0
- package/dist/claude/hooks.js.map +1 -0
- package/dist/claude/init.d.ts +70 -0
- package/dist/claude/init.d.ts.map +1 -0
- package/dist/claude/init.js +207 -0
- package/dist/claude/init.js.map +1 -0
- package/dist/claude/note-signals.d.ts +28 -0
- package/dist/claude/note-signals.d.ts.map +1 -0
- package/dist/claude/note-signals.js +325 -0
- package/dist/claude/note-signals.js.map +1 -0
- package/dist/claude/paths.d.ts +9 -0
- package/dist/claude/paths.d.ts.map +1 -0
- package/dist/claude/paths.js +22 -0
- package/dist/claude/paths.js.map +1 -0
- package/dist/claude/session-metrics.d.ts +73 -0
- package/dist/claude/session-metrics.d.ts.map +1 -0
- package/dist/claude/session-metrics.js +209 -0
- package/dist/claude/session-metrics.js.map +1 -0
- package/dist/claude/settings-merge.d.ts +66 -0
- package/dist/claude/settings-merge.d.ts.map +1 -0
- package/dist/claude/settings-merge.js +249 -0
- package/dist/claude/settings-merge.js.map +1 -0
- package/dist/claude/shim-template.d.ts +18 -0
- package/dist/claude/shim-template.d.ts.map +1 -0
- package/dist/claude/shim-template.js +226 -0
- package/dist/claude/shim-template.js.map +1 -0
- package/dist/claude/skill-template.d.ts +12 -0
- package/dist/claude/skill-template.d.ts.map +1 -0
- package/dist/claude/skill-template.js +294 -0
- package/dist/claude/skill-template.js.map +1 -0
- package/dist/claude/state.d.ts +73 -0
- package/dist/claude/state.d.ts.map +1 -0
- package/dist/claude/state.js +33 -0
- package/dist/claude/state.js.map +1 -0
- package/dist/claude/stats.d.ts +5 -0
- package/dist/claude/stats.d.ts.map +1 -0
- package/dist/claude/stats.js +24 -0
- package/dist/claude/stats.js.map +1 -0
- package/dist/claude/statusline.d.ts +14 -0
- package/dist/claude/statusline.d.ts.map +1 -0
- package/dist/claude/statusline.js +45 -0
- package/dist/claude/statusline.js.map +1 -0
- package/dist/claude/sync-run.d.ts +3 -0
- package/dist/claude/sync-run.d.ts.map +1 -0
- package/dist/claude/sync-run.js +46 -0
- package/dist/claude/sync-run.js.map +1 -0
- package/dist/claude/tally.d.ts +50 -0
- package/dist/claude/tally.d.ts.map +1 -0
- package/dist/claude/tally.js +211 -0
- package/dist/claude/tally.js.map +1 -0
- package/dist/cli-epilogue.d.ts +12 -0
- package/dist/cli-epilogue.d.ts.map +1 -0
- package/dist/cli-epilogue.js +55 -0
- package/dist/cli-epilogue.js.map +1 -0
- package/dist/cli-meta.d.ts +45 -0
- package/dist/cli-meta.d.ts.map +1 -0
- package/dist/cli-meta.js +145 -0
- package/dist/cli-meta.js.map +1 -0
- package/dist/cli-picker.d.ts +129 -0
- package/dist/cli-picker.d.ts.map +1 -0
- package/dist/cli-picker.js +432 -0
- package/dist/cli-picker.js.map +1 -0
- package/dist/cli.d.ts +3 -0
- package/dist/cli.d.ts.map +1 -0
- package/dist/cli.js +2213 -0
- package/dist/cli.js.map +1 -0
- package/dist/cloud/diff.d.ts +20 -0
- package/dist/cloud/diff.d.ts.map +1 -0
- package/dist/cloud/diff.js +59 -0
- package/dist/cloud/diff.js.map +1 -0
- package/dist/cloud/nudge.d.ts +66 -0
- package/dist/cloud/nudge.d.ts.map +1 -0
- package/dist/cloud/nudge.js +268 -0
- package/dist/cloud/nudge.js.map +1 -0
- package/dist/cloud/workspace-sync.d.ts +58 -0
- package/dist/cloud/workspace-sync.d.ts.map +1 -0
- package/dist/cloud/workspace-sync.js +268 -0
- package/dist/cloud/workspace-sync.js.map +1 -0
- package/dist/cloud/workspace.d.ts +159 -0
- package/dist/cloud/workspace.d.ts.map +1 -0
- package/dist/cloud/workspace.js +134 -0
- package/dist/cloud/workspace.js.map +1 -0
- package/dist/context/build.d.ts +52 -0
- package/dist/context/build.d.ts.map +1 -0
- package/dist/context/build.js +362 -0
- package/dist/context/build.js.map +1 -0
- package/dist/context/check.d.ts +42 -0
- package/dist/context/check.d.ts.map +1 -0
- package/dist/context/check.js +162 -0
- package/dist/context/check.js.map +1 -0
- package/dist/context/map-dir.d.ts +4 -0
- package/dist/context/map-dir.d.ts.map +1 -0
- package/dist/context/map-dir.js +6 -0
- package/dist/context/map-dir.js.map +1 -0
- package/dist/context/node-file.d.ts +109 -0
- package/dist/context/node-file.d.ts.map +1 -0
- package/dist/context/node-file.js +362 -0
- package/dist/context/node-file.js.map +1 -0
- package/dist/context/price.d.ts +49 -0
- package/dist/context/price.d.ts.map +1 -0
- package/dist/context/price.js +83 -0
- package/dist/context/price.js.map +1 -0
- package/dist/context/savings.d.ts +26 -0
- package/dist/context/savings.d.ts.map +1 -0
- package/dist/context/savings.js +59 -0
- package/dist/context/savings.js.map +1 -0
- package/dist/economy/cli.d.ts +3 -0
- package/dist/economy/cli.d.ts.map +1 -0
- package/dist/economy/cli.js +52 -0
- package/dist/economy/cli.js.map +1 -0
- package/dist/economy/delivery.d.ts +49 -0
- package/dist/economy/delivery.d.ts.map +1 -0
- package/dist/economy/delivery.js +176 -0
- package/dist/economy/delivery.js.map +1 -0
- package/dist/economy/index.d.ts +68 -0
- package/dist/economy/index.d.ts.map +1 -0
- package/dist/economy/index.js +524 -0
- package/dist/economy/index.js.map +1 -0
- package/dist/engine.d.ts +83 -0
- package/dist/engine.d.ts.map +1 -0
- package/dist/engine.js +122 -0
- package/dist/engine.js.map +1 -0
- package/dist/evaluation/index.d.ts +41 -0
- package/dist/evaluation/index.d.ts.map +1 -0
- package/dist/evaluation/index.js +61 -0
- package/dist/evaluation/index.js.map +1 -0
- package/dist/graph/bindings.d.ts +64 -0
- package/dist/graph/bindings.d.ts.map +1 -0
- package/dist/graph/bindings.js +713 -0
- package/dist/graph/bindings.js.map +1 -0
- package/dist/graph/build.d.ts +88 -0
- package/dist/graph/build.d.ts.map +1 -0
- package/dist/graph/build.js +375 -0
- package/dist/graph/build.js.map +1 -0
- package/dist/graph/cards.d.ts +46 -0
- package/dist/graph/cards.d.ts.map +1 -0
- package/dist/graph/cards.js +280 -0
- package/dist/graph/cards.js.map +1 -0
- package/dist/graph/check.d.ts +25 -0
- package/dist/graph/check.d.ts.map +1 -0
- package/dist/graph/check.js +192 -0
- package/dist/graph/check.js.map +1 -0
- package/dist/graph/container.d.ts +63 -0
- package/dist/graph/container.d.ts.map +1 -0
- package/dist/graph/container.js +190 -0
- package/dist/graph/container.js.map +1 -0
- package/dist/graph/enrich.d.ts +62 -0
- package/dist/graph/enrich.d.ts.map +1 -0
- package/dist/graph/enrich.js +253 -0
- package/dist/graph/enrich.js.map +1 -0
- package/dist/graph/extract-cache.d.ts +101 -0
- package/dist/graph/extract-cache.d.ts.map +1 -0
- package/dist/graph/extract-cache.js +199 -0
- package/dist/graph/extract-cache.js.map +1 -0
- package/dist/graph/extract.d.ts +85 -0
- package/dist/graph/extract.d.ts.map +1 -0
- package/dist/graph/extract.js +2376 -0
- package/dist/graph/extract.js.map +1 -0
- package/dist/graph/fingerprint.d.ts +76 -0
- package/dist/graph/fingerprint.d.ts.map +1 -0
- package/dist/graph/fingerprint.js +160 -0
- package/dist/graph/fingerprint.js.map +1 -0
- package/dist/graph/generic.d.ts +74 -0
- package/dist/graph/generic.d.ts.map +1 -0
- package/dist/graph/generic.js +580 -0
- package/dist/graph/generic.js.map +1 -0
- package/dist/graph/invariants.d.ts +33 -0
- package/dist/graph/invariants.d.ts.map +1 -0
- package/dist/graph/invariants.js +52 -0
- package/dist/graph/invariants.js.map +1 -0
- package/dist/graph/load.d.ts +29 -0
- package/dist/graph/load.d.ts.map +1 -0
- package/dist/graph/load.js +97 -0
- package/dist/graph/load.js.map +1 -0
- package/dist/graph/lsp/client.d.ts +43 -0
- package/dist/graph/lsp/client.d.ts.map +1 -0
- package/dist/graph/lsp/client.js +179 -0
- package/dist/graph/lsp/client.js.map +1 -0
- package/dist/graph/lsp/enrich.d.ts +11 -0
- package/dist/graph/lsp/enrich.d.ts.map +1 -0
- package/dist/graph/lsp/enrich.js +155 -0
- package/dist/graph/lsp/enrich.js.map +1 -0
- package/dist/graph/lsp/registry.d.ts +15 -0
- package/dist/graph/lsp/registry.d.ts.map +1 -0
- package/dist/graph/lsp/registry.js +46 -0
- package/dist/graph/lsp/registry.js.map +1 -0
- package/dist/graph/map.d.ts +107 -0
- package/dist/graph/map.d.ts.map +1 -0
- package/dist/graph/map.js +239 -0
- package/dist/graph/map.js.map +1 -0
- package/dist/graph/native.d.ts +38 -0
- package/dist/graph/native.d.ts.map +1 -0
- package/dist/graph/native.js +169 -0
- package/dist/graph/native.js.map +1 -0
- package/dist/graph/queries/c.scm +13 -0
- package/dist/graph/queries/c_sharp.scm +19 -0
- package/dist/graph/queries/clojure.scm +58 -0
- package/dist/graph/queries/cpp.scm +23 -0
- package/dist/graph/queries/dart.scm +42 -0
- package/dist/graph/queries/elixir.scm +54 -0
- package/dist/graph/queries/java.scm +20 -0
- package/dist/graph/queries/kotlin.scm +43 -0
- package/dist/graph/queries/lua.scm +36 -0
- package/dist/graph/queries/nix.scm +32 -0
- package/dist/graph/queries/php.scm +40 -0
- package/dist/graph/queries/ruby.scm +65 -0
- package/dist/graph/queries/rust.scm +41 -0
- package/dist/graph/queries/scala.scm +66 -0
- package/dist/graph/queries/solidity.scm +43 -0
- package/dist/graph/queries/swift.scm +51 -0
- package/dist/graph/refresh.d.ts +49 -0
- package/dist/graph/refresh.d.ts.map +1 -0
- package/dist/graph/refresh.js +255 -0
- package/dist/graph/refresh.js.map +1 -0
- package/dist/graph/relations.d.ts +14 -0
- package/dist/graph/relations.d.ts.map +1 -0
- package/dist/graph/relations.js +8 -0
- package/dist/graph/relations.js.map +1 -0
- package/dist/graph/resolve.d.ts +17 -0
- package/dist/graph/resolve.d.ts.map +1 -0
- package/dist/graph/resolve.js +654 -0
- package/dist/graph/resolve.js.map +1 -0
- package/dist/graph/root.d.ts +11 -0
- package/dist/graph/root.d.ts.map +1 -0
- package/dist/graph/root.js +40 -0
- package/dist/graph/root.js.map +1 -0
- package/dist/graph/scopes.d.ts +42 -0
- package/dist/graph/scopes.d.ts.map +1 -0
- package/dist/graph/scopes.js +342 -0
- package/dist/graph/scopes.js.map +1 -0
- package/dist/graph/seed.d.ts +38 -0
- package/dist/graph/seed.d.ts.map +1 -0
- package/dist/graph/seed.js +226 -0
- package/dist/graph/seed.js.map +1 -0
- package/dist/graph/source-files.d.ts +40 -0
- package/dist/graph/source-files.d.ts.map +1 -0
- package/dist/graph/source-files.js +85 -0
- package/dist/graph/source-files.js.map +1 -0
- package/dist/graph/traverse-cli.d.ts +55 -0
- package/dist/graph/traverse-cli.d.ts.map +1 -0
- package/dist/graph/traverse-cli.js +189 -0
- package/dist/graph/traverse-cli.js.map +1 -0
- package/dist/graph/traverse.d.ts +112 -0
- package/dist/graph/traverse.d.ts.map +1 -0
- package/dist/graph/traverse.js +192 -0
- package/dist/graph/traverse.js.map +1 -0
- package/dist/graph/types.d.ts +78 -0
- package/dist/graph/types.d.ts.map +1 -0
- package/dist/graph/types.js +14 -0
- package/dist/graph/types.js.map +1 -0
- package/dist/graph/workspace-cli.d.ts +48 -0
- package/dist/graph/workspace-cli.d.ts.map +1 -0
- package/dist/graph/workspace-cli.js +102 -0
- package/dist/graph/workspace-cli.js.map +1 -0
- package/dist/graph/workspace.d.ts +135 -0
- package/dist/graph/workspace.d.ts.map +1 -0
- package/dist/graph/workspace.js +598 -0
- package/dist/graph/workspace.js.map +1 -0
- package/dist/graph/write.d.ts +13 -0
- package/dist/graph/write.d.ts.map +1 -0
- package/dist/graph/write.js +86 -0
- package/dist/graph/write.js.map +1 -0
- package/dist/hosts/antigravity.d.ts +8 -0
- package/dist/hosts/antigravity.d.ts.map +1 -0
- package/dist/hosts/antigravity.js +42 -0
- package/dist/hosts/antigravity.js.map +1 -0
- package/dist/hosts/claude-global.d.ts +36 -0
- package/dist/hosts/claude-global.d.ts.map +1 -0
- package/dist/hosts/claude-global.js +153 -0
- package/dist/hosts/claude-global.js.map +1 -0
- package/dist/hosts/codex-hooks.d.ts +11 -0
- package/dist/hosts/codex-hooks.d.ts.map +1 -0
- package/dist/hosts/codex-hooks.js +80 -0
- package/dist/hosts/codex-hooks.js.map +1 -0
- package/dist/hosts/config-write.d.ts +36 -0
- package/dist/hosts/config-write.d.ts.map +1 -0
- package/dist/hosts/config-write.js +64 -0
- package/dist/hosts/config-write.js.map +1 -0
- package/dist/hosts/cursor-hooks.d.ts +21 -0
- package/dist/hosts/cursor-hooks.d.ts.map +1 -0
- package/dist/hosts/cursor-hooks.js +103 -0
- package/dist/hosts/cursor-hooks.js.map +1 -0
- package/dist/hosts/init.d.ts +26 -0
- package/dist/hosts/init.d.ts.map +1 -0
- package/dist/hosts/init.js +82 -0
- package/dist/hosts/init.js.map +1 -0
- package/dist/hosts/install.d.ts +12 -0
- package/dist/hosts/install.d.ts.map +1 -0
- package/dist/hosts/install.js +347 -0
- package/dist/hosts/install.js.map +1 -0
- package/dist/hosts/instructions.d.ts +7 -0
- package/dist/hosts/instructions.d.ts.map +1 -0
- package/dist/hosts/instructions.js +71 -0
- package/dist/hosts/instructions.js.map +1 -0
- package/dist/hosts/investigation-instructions.d.ts +2 -0
- package/dist/hosts/investigation-instructions.d.ts.map +1 -0
- package/dist/hosts/investigation-instructions.js +2 -0
- package/dist/hosts/investigation-instructions.js.map +1 -0
- package/dist/hosts/mcp-config.d.ts +59 -0
- package/dist/hosts/mcp-config.d.ts.map +1 -0
- package/dist/hosts/mcp-config.js +229 -0
- package/dist/hosts/mcp-config.js.map +1 -0
- package/dist/hosts/plan.d.ts +32 -0
- package/dist/hosts/plan.d.ts.map +1 -0
- package/dist/hosts/plan.js +77 -0
- package/dist/hosts/plan.js.map +1 -0
- package/dist/hosts/registry.d.ts +35 -0
- package/dist/hosts/registry.d.ts.map +1 -0
- package/dist/hosts/registry.js +157 -0
- package/dist/hosts/registry.js.map +1 -0
- package/dist/hosts/retract.d.ts +47 -0
- package/dist/hosts/retract.d.ts.map +1 -0
- package/dist/hosts/retract.js +541 -0
- package/dist/hosts/retract.js.map +1 -0
- package/dist/hosts/sections.d.ts +46 -0
- package/dist/hosts/sections.d.ts.map +1 -0
- package/dist/hosts/sections.js +126 -0
- package/dist/hosts/sections.js.map +1 -0
- package/dist/index.d.ts +43 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +33 -0
- package/dist/index.js.map +1 -0
- package/dist/ingest/fs.d.ts +79 -0
- package/dist/ingest/fs.d.ts.map +1 -0
- package/dist/ingest/fs.js +307 -0
- package/dist/ingest/fs.js.map +1 -0
- package/dist/init-guard.d.ts +11 -0
- package/dist/init-guard.d.ts.map +1 -0
- package/dist/init-guard.js +21 -0
- package/dist/init-guard.js.map +1 -0
- package/dist/investigation/index.d.ts +57 -0
- package/dist/investigation/index.d.ts.map +1 -0
- package/dist/investigation/index.js +346 -0
- package/dist/investigation/index.js.map +1 -0
- package/dist/mcp/compact.d.ts +9 -0
- package/dist/mcp/compact.d.ts.map +1 -0
- package/dist/mcp/compact.js +133 -0
- package/dist/mcp/compact.js.map +1 -0
- package/dist/mcp/instructions.d.ts +5 -0
- package/dist/mcp/instructions.d.ts.map +1 -0
- package/dist/mcp/instructions.js +57 -0
- package/dist/mcp/instructions.js.map +1 -0
- package/dist/mcp/server.d.ts +7 -0
- package/dist/mcp/server.d.ts.map +1 -0
- package/dist/mcp/server.js +128 -0
- package/dist/mcp/server.js.map +1 -0
- package/dist/mcp/tool-names.d.ts +20 -0
- package/dist/mcp/tool-names.d.ts.map +1 -0
- package/dist/mcp/tool-names.js +36 -0
- package/dist/mcp/tool-names.js.map +1 -0
- package/dist/mcp/tools.d.ts +22 -0
- package/dist/mcp/tools.d.ts.map +1 -0
- package/dist/mcp/tools.js +300 -0
- package/dist/mcp/tools.js.map +1 -0
- package/dist/notes/ask-notes.d.ts +8 -0
- package/dist/notes/ask-notes.d.ts.map +1 -0
- package/dist/notes/ask-notes.js +19 -0
- package/dist/notes/ask-notes.js.map +1 -0
- package/dist/notes/branches.d.ts +102 -0
- package/dist/notes/branches.d.ts.map +1 -0
- package/dist/notes/branches.js +304 -0
- package/dist/notes/branches.js.map +1 -0
- package/dist/notes/cold-start.d.ts +177 -0
- package/dist/notes/cold-start.d.ts.map +1 -0
- package/dist/notes/cold-start.js +537 -0
- package/dist/notes/cold-start.js.map +1 -0
- package/dist/notes/edit-overlap.d.ts +62 -0
- package/dist/notes/edit-overlap.d.ts.map +1 -0
- package/dist/notes/edit-overlap.js +202 -0
- package/dist/notes/edit-overlap.js.map +1 -0
- package/dist/notes/git-facts.d.ts +21 -0
- package/dist/notes/git-facts.d.ts.map +1 -0
- package/dist/notes/git-facts.js +121 -0
- package/dist/notes/git-facts.js.map +1 -0
- package/dist/notes/home.d.ts +87 -0
- package/dist/notes/home.d.ts.map +1 -0
- package/dist/notes/home.js +430 -0
- package/dist/notes/home.js.map +1 -0
- package/dist/notes/learning-fields.d.ts +102 -0
- package/dist/notes/learning-fields.d.ts.map +1 -0
- package/dist/notes/learning-fields.js +217 -0
- package/dist/notes/learning-fields.js.map +1 -0
- package/dist/notes/note-gate.d.ts +42 -0
- package/dist/notes/note-gate.d.ts.map +1 -0
- package/dist/notes/note-gate.js +181 -0
- package/dist/notes/note-gate.js.map +1 -0
- package/dist/notes/notes.d.ts +214 -0
- package/dist/notes/notes.d.ts.map +1 -0
- package/dist/notes/notes.js +591 -0
- package/dist/notes/notes.js.map +1 -0
- package/dist/notes/pr-reviews.d.ts +108 -0
- package/dist/notes/pr-reviews.d.ts.map +1 -0
- package/dist/notes/pr-reviews.js +325 -0
- package/dist/notes/pr-reviews.js.map +1 -0
- package/dist/notes/repo-julius.d.ts +18 -0
- package/dist/notes/repo-julius.d.ts.map +1 -0
- package/dist/notes/repo-julius.js +111 -0
- package/dist/notes/repo-julius.js.map +1 -0
- package/dist/notes/session-cost.d.ts +35 -0
- package/dist/notes/session-cost.d.ts.map +1 -0
- package/dist/notes/session-cost.js +276 -0
- package/dist/notes/session-cost.js.map +1 -0
- package/dist/search/grep-cli.d.ts +37 -0
- package/dist/search/grep-cli.d.ts.map +1 -0
- package/dist/search/grep-cli.js +119 -0
- package/dist/search/grep-cli.js.map +1 -0
- package/dist/search/grep.d.ts +60 -0
- package/dist/search/grep.d.ts.map +1 -0
- package/dist/search/grep.js +176 -0
- package/dist/search/grep.js.map +1 -0
- package/dist/search/ignored-code.d.ts +9 -0
- package/dist/search/ignored-code.d.ts.map +1 -0
- package/dist/search/ignored-code.js +73 -0
- package/dist/search/ignored-code.js.map +1 -0
- package/dist/skills/skills.d.ts +118 -0
- package/dist/skills/skills.d.ts.map +1 -0
- package/dist/skills/skills.js +370 -0
- package/dist/skills/skills.js.map +1 -0
- package/dist/telemetry/contract.d.ts +103 -0
- package/dist/telemetry/contract.d.ts.map +1 -0
- package/dist/telemetry/contract.js +270 -0
- package/dist/telemetry/contract.js.map +1 -0
- package/dist/telemetry/flush.d.ts +21 -0
- package/dist/telemetry/flush.d.ts.map +1 -0
- package/dist/telemetry/flush.js +85 -0
- package/dist/telemetry/flush.js.map +1 -0
- package/dist/telemetry/gate.d.ts +30 -0
- package/dist/telemetry/gate.d.ts.map +1 -0
- package/dist/telemetry/gate.js +81 -0
- package/dist/telemetry/gate.js.map +1 -0
- package/dist/telemetry/identity.d.ts +40 -0
- package/dist/telemetry/identity.d.ts.map +1 -0
- package/dist/telemetry/identity.js +80 -0
- package/dist/telemetry/identity.js.map +1 -0
- package/dist/telemetry/index.d.ts +18 -0
- package/dist/telemetry/index.d.ts.map +1 -0
- package/dist/telemetry/index.js +16 -0
- package/dist/telemetry/index.js.map +1 -0
- package/dist/telemetry/key.d.ts +4 -0
- package/dist/telemetry/key.d.ts.map +1 -0
- package/dist/telemetry/key.js +4 -0
- package/dist/telemetry/key.js.map +1 -0
- package/dist/telemetry/notice.d.ts +19 -0
- package/dist/telemetry/notice.d.ts.map +1 -0
- package/dist/telemetry/notice.js +93 -0
- package/dist/telemetry/notice.js.map +1 -0
- package/dist/telemetry/queue.d.ts +35 -0
- package/dist/telemetry/queue.d.ts.map +1 -0
- package/dist/telemetry/queue.js +162 -0
- package/dist/telemetry/queue.js.map +1 -0
- package/dist/telemetry/send.d.ts +19 -0
- package/dist/telemetry/send.d.ts.map +1 -0
- package/dist/telemetry/send.js +84 -0
- package/dist/telemetry/send.js.map +1 -0
- package/dist/telemetry/sessions.d.ts +25 -0
- package/dist/telemetry/sessions.d.ts.map +1 -0
- package/dist/telemetry/sessions.js +104 -0
- package/dist/telemetry/sessions.js.map +1 -0
- package/dist/telemetry/track.d.ts +62 -0
- package/dist/telemetry/track.d.ts.map +1 -0
- package/dist/telemetry/track.js +142 -0
- package/dist/telemetry/track.js.map +1 -0
- package/dist/upkeep-run.d.ts +15 -0
- package/dist/upkeep-run.d.ts.map +1 -0
- package/dist/upkeep-run.js +71 -0
- package/dist/upkeep-run.js.map +1 -0
- package/dist/upkeep.d.ts +125 -0
- package/dist/upkeep.d.ts.map +1 -0
- package/dist/upkeep.js +255 -0
- package/dist/upkeep.js.map +1 -0
- package/dist/util/browser.d.ts +3 -0
- package/dist/util/browser.d.ts.map +1 -0
- package/dist/util/browser.js +14 -0
- package/dist/util/browser.js.map +1 -0
- package/dist/util/front-matter.d.ts +19 -0
- package/dist/util/front-matter.d.ts.map +1 -0
- package/dist/util/front-matter.js +21 -0
- package/dist/util/front-matter.js.map +1 -0
- package/dist/util/id.d.ts +7 -0
- package/dist/util/id.d.ts.map +1 -0
- package/dist/util/id.js +14 -0
- package/dist/util/id.js.map +1 -0
- package/dist/util/paths.d.ts +29 -0
- package/dist/util/paths.d.ts.map +1 -0
- package/dist/util/paths.js +71 -0
- package/dist/util/paths.js.map +1 -0
- package/dist/util/source.d.ts +4 -0
- package/dist/util/source.d.ts.map +1 -0
- package/dist/util/source.js +12 -0
- package/dist/util/source.js.map +1 -0
- package/dist/util/spinner.d.ts +15 -0
- package/dist/util/spinner.d.ts.map +1 -0
- package/dist/util/spinner.js +52 -0
- package/dist/util/spinner.js.map +1 -0
- package/dist/util/state.d.ts +100 -0
- package/dist/util/state.d.ts.map +1 -0
- package/dist/util/state.js +186 -0
- package/dist/util/state.js.map +1 -0
- package/dist/viewer/app.js +2 -0
- package/dist/viewer/index.html +49 -0
- package/dist/viewer/style.css +154 -0
- package/dist/viz/assemble.d.ts +83 -0
- package/dist/viz/assemble.d.ts.map +1 -0
- package/dist/viz/assemble.js +101 -0
- package/dist/viz/assemble.js.map +1 -0
- package/dist/viz/export.d.ts +39 -0
- package/dist/viz/export.d.ts.map +1 -0
- package/dist/viz/export.js +98 -0
- package/dist/viz/export.js.map +1 -0
- package/dist/viz/serve.d.ts +12 -0
- package/dist/viz/serve.d.ts.map +1 -0
- package/dist/viz/serve.js +129 -0
- package/dist/viz/serve.js.map +1 -0
- package/docs/assets/context-benchmark.svg +31 -0
- package/docs/assets/julius-hero.png +0 -0
- package/docs/upstream-changelog.md +785 -0
- package/package.json +138 -4
|
@@ -0,0 +1,217 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* What a learning says about itself beyond its title, author and date: a
|
|
3
|
+
* stable id, what kind of learning it is, who it is for, whether it still
|
|
4
|
+
* holds, and which older learning it replaces.
|
|
5
|
+
*
|
|
6
|
+
* A file written before these fields existed reads with defaults: its id
|
|
7
|
+
* comes from its file name (the same id a new file of that name is given),
|
|
8
|
+
* its status is active, and its scope comes from where it sits. A value a
|
|
9
|
+
* learning can't hold (an unknown kind, a malformed id, a line break in a
|
|
10
|
+
* repo key) is dropped rather than carried into what an agent reads.
|
|
11
|
+
*
|
|
12
|
+
* `replaces` means the newest wins: recall and `julius check` read only the
|
|
13
|
+
* live learnings (`liveLearnings`), never one a newer learning replaced.
|
|
14
|
+
*/
|
|
15
|
+
import { createHash } from "node:crypto";
|
|
16
|
+
const WALL_CLASSES = ["timeout-missing", "zsh-no-match", "git-https-auth", "docker-rootless", "npm-e401-eotp", "claude-not-logged-in", "enospc"];
|
|
17
|
+
function flatLine(value, max) {
|
|
18
|
+
if (typeof value !== "string")
|
|
19
|
+
return "";
|
|
20
|
+
const line = value.replace(/\s+/g, " ").trim();
|
|
21
|
+
return line.length <= max ? line : line.slice(0, max);
|
|
22
|
+
}
|
|
23
|
+
export const KINDS = ["preference", "guardrail", "decision", "lesson"];
|
|
24
|
+
export const SCOPES = ["personal", "repo", "team"];
|
|
25
|
+
export const STATUSES = ["active", "held", "replaced", "retired"];
|
|
26
|
+
export const SOURCES = ["person", "init-typed", "init-review", "error-class", "agent", "correction", "repair"];
|
|
27
|
+
export const CHECKS = ["no-timeout"];
|
|
28
|
+
export const ENFORCES = ["sure-fail"];
|
|
29
|
+
/**
|
|
30
|
+
* The wall catalog's classes at run time, in the catalog's order (trace/walls.ts). Equal to the WallClass type and
|
|
31
|
+
* to telemetry's wall_hit.class values; a test holds all three equal.
|
|
32
|
+
*/
|
|
33
|
+
/** A personal learning's `applies` when it holds in every repo, not just one. */
|
|
34
|
+
export const EVERY_REPO = "every repo";
|
|
35
|
+
/** The front-matter keys, in the order they're written. */
|
|
36
|
+
export const LEARNING_KEYS = ["id", "kind", "scope", "applies", "status", "replaces", "src", "skill", "check", "enforce", "wall", "evidence"];
|
|
37
|
+
/** `l-` and 6 to 16 lowercase hex digits. */
|
|
38
|
+
export const LEARNING_ID = /^l-[0-9a-f]{6,16}$/;
|
|
39
|
+
/** A repo key as `home.ts` makes them: `github.com/acme/api`, `local/…`. */
|
|
40
|
+
const REPO_KEY = /^[a-z0-9._-]+(?:\/[a-z0-9._-]+)*$/;
|
|
41
|
+
const EVIDENCE_MAX = 160;
|
|
42
|
+
/** A skill name as compile gives them (compile-words.ts NAME_RE, no `--`, no trailing `-`). Kept here so notes don't load compile. */
|
|
43
|
+
const SKILL_NAME = /^(?=[a-z0-9-]*[a-z])[a-z0-9][a-z0-9-]{1,47}$/;
|
|
44
|
+
function skillName(v) {
|
|
45
|
+
if (typeof v !== "string")
|
|
46
|
+
return undefined;
|
|
47
|
+
const s = v.trim().toLowerCase();
|
|
48
|
+
return SKILL_NAME.test(s) && !/--|-$/.test(s) ? s : undefined;
|
|
49
|
+
}
|
|
50
|
+
/** The file name in a path: after the last `/`, `\\` or a branch ref's `:`. */
|
|
51
|
+
export function learningFileName(path) {
|
|
52
|
+
return path.slice(Math.max(path.lastIndexOf("/"), path.lastIndexOf("\\"), path.lastIndexOf(":")) + 1);
|
|
53
|
+
}
|
|
54
|
+
/**
|
|
55
|
+
* The id of a learning file that doesn't say its own: `l-` and the first 6 hex
|
|
56
|
+
* digits of the file name's sha1. Files written before ids keep this one.
|
|
57
|
+
*/
|
|
58
|
+
export function learningId(fileName) {
|
|
59
|
+
return `l-${createHash("sha1").update(fileName).digest("hex").slice(0, 6)}`;
|
|
60
|
+
}
|
|
61
|
+
/**
|
|
62
|
+
* The id a new learning is written with: the first 8 hex digits of the same
|
|
63
|
+
* sha1, so a repo with hundreds of learnings doesn't hand two the same one.
|
|
64
|
+
* Its first 6 are the id the file would get if its id line were lost.
|
|
65
|
+
*/
|
|
66
|
+
export function newLearningId(fileName) {
|
|
67
|
+
return `l-${createHash("sha1").update(fileName).digest("hex").slice(0, 8)}`;
|
|
68
|
+
}
|
|
69
|
+
/** `v` as one of `allowed`, ignoring case and padding, or undefined. */
|
|
70
|
+
function oneOf(v, allowed) {
|
|
71
|
+
if (typeof v !== "string")
|
|
72
|
+
return undefined;
|
|
73
|
+
const s = v.trim().toLowerCase();
|
|
74
|
+
return allowed.includes(s) ? s : undefined;
|
|
75
|
+
}
|
|
76
|
+
/** A learning id, normalised, or undefined when `v` isn't one. */
|
|
77
|
+
export function asLearningId(v) {
|
|
78
|
+
if (typeof v !== "string")
|
|
79
|
+
return undefined;
|
|
80
|
+
const s = v.trim().toLowerCase();
|
|
81
|
+
return LEARNING_ID.test(s) ? s : undefined;
|
|
82
|
+
}
|
|
83
|
+
function appliesValue(v) {
|
|
84
|
+
if (typeof v !== "string")
|
|
85
|
+
return undefined;
|
|
86
|
+
const s = v.trim().toLowerCase();
|
|
87
|
+
if (s === EVERY_REPO)
|
|
88
|
+
return EVERY_REPO;
|
|
89
|
+
return s.length <= 200 && REPO_KEY.test(s) ? s : undefined;
|
|
90
|
+
}
|
|
91
|
+
/** The fields of a learning's front matter `d`, read from the file `fileName`, with defaults for what it lacks. */
|
|
92
|
+
export function readLearningFields(d, fileName) {
|
|
93
|
+
const out = { id: asLearningId(d.id) ?? learningId(fileName), status: oneOf(d.status, STATUSES) ?? "active" };
|
|
94
|
+
const kind = oneOf(d.kind, KINDS);
|
|
95
|
+
const scope = oneOf(d.scope, SCOPES);
|
|
96
|
+
const applies = appliesValue(d.applies);
|
|
97
|
+
const replaces = asLearningId(d.replaces);
|
|
98
|
+
const src = oneOf(d.src, SOURCES);
|
|
99
|
+
const skill = skillName(d.skill);
|
|
100
|
+
const check = oneOf(d.check, CHECKS);
|
|
101
|
+
const enforce = oneOf(d.enforce, ENFORCES);
|
|
102
|
+
const wall = oneOf(d.wall, WALL_CLASSES);
|
|
103
|
+
// One line, the way every field an agent reads is (flatten.ts).
|
|
104
|
+
const evidence = flatLine(d.evidence, EVIDENCE_MAX) || undefined;
|
|
105
|
+
if (kind)
|
|
106
|
+
out.kind = kind;
|
|
107
|
+
if (scope)
|
|
108
|
+
out.scope = scope;
|
|
109
|
+
if (applies)
|
|
110
|
+
out.applies = applies;
|
|
111
|
+
if (replaces && replaces !== out.id)
|
|
112
|
+
out.replaces = replaces;
|
|
113
|
+
if (src)
|
|
114
|
+
out.src = src;
|
|
115
|
+
if (skill)
|
|
116
|
+
out.skill = skill;
|
|
117
|
+
if (check)
|
|
118
|
+
out.check = check;
|
|
119
|
+
if (enforce)
|
|
120
|
+
out.enforce = enforce;
|
|
121
|
+
if (wall)
|
|
122
|
+
out.wall = wall;
|
|
123
|
+
if (evidence)
|
|
124
|
+
out.evidence = evidence;
|
|
125
|
+
return out;
|
|
126
|
+
}
|
|
127
|
+
/** Whether following `replaces` from `x` comes back round to the id `to`. */
|
|
128
|
+
function leadsTo(x, to, byId) {
|
|
129
|
+
const seen = new Set();
|
|
130
|
+
const todo = x.replaces ? [x.replaces] : [];
|
|
131
|
+
while (todo.length) {
|
|
132
|
+
const id = todo.pop();
|
|
133
|
+
if (id === to)
|
|
134
|
+
return true;
|
|
135
|
+
if (seen.has(id))
|
|
136
|
+
continue;
|
|
137
|
+
seen.add(id);
|
|
138
|
+
for (const n of byId.get(id) ?? [])
|
|
139
|
+
if (n.replaces)
|
|
140
|
+
todo.push(n.replaces);
|
|
141
|
+
}
|
|
142
|
+
return false;
|
|
143
|
+
}
|
|
144
|
+
function byIdOf(notes) {
|
|
145
|
+
const byId = new Map();
|
|
146
|
+
for (const n of notes)
|
|
147
|
+
byId.set(n.id, [...(byId.get(n.id) ?? []), n]);
|
|
148
|
+
return byId;
|
|
149
|
+
}
|
|
150
|
+
/**
|
|
151
|
+
* Whether `r` replaces `x`. Only a learning someone has seen through counts:
|
|
152
|
+
* not one on a teammate's unmerged branch, nor one held for a yes. A
|
|
153
|
+
* just-for-you learning never hides one the repo or team shares. The newest
|
|
154
|
+
* wins; on the same day the replacement does, and of learnings that replace
|
|
155
|
+
* each other in a circle (only a hand edit makes one), the later file name.
|
|
156
|
+
*/
|
|
157
|
+
function replaces(r, x, byId) {
|
|
158
|
+
if (r === x || r.replaces !== x.id || r.id === x.id)
|
|
159
|
+
return false;
|
|
160
|
+
if (r.ref || r.status === "held")
|
|
161
|
+
return false;
|
|
162
|
+
if (r.scope === "personal" && x.scope !== "personal")
|
|
163
|
+
return false;
|
|
164
|
+
if (r.date !== x.date)
|
|
165
|
+
return r.date > x.date;
|
|
166
|
+
return r.path > x.path || !leadsTo(x, r.id, byId);
|
|
167
|
+
}
|
|
168
|
+
/** Active and not replaced (the rule both lists below share). */
|
|
169
|
+
function stillHold(notes, counts) {
|
|
170
|
+
const byTarget = new Map();
|
|
171
|
+
for (const r of notes)
|
|
172
|
+
if (r.replaces)
|
|
173
|
+
byTarget.set(r.replaces, [...(byTarget.get(r.replaces) ?? []), r]);
|
|
174
|
+
const byId = byIdOf(notes);
|
|
175
|
+
return notes.filter((x) => (x.status ?? "active") === "active" && !(byTarget.get(x.id) ?? []).some((r) => replaces(r, x, byId) && counts(r, x)));
|
|
176
|
+
}
|
|
177
|
+
/**
|
|
178
|
+
* The learnings that still hold: active ones (a file without a status is
|
|
179
|
+
* active) that no newer learning replaces. Order is kept. `counts(r, x)` can
|
|
180
|
+
* turn a replacement down: `julius check` lets only one on the base branch
|
|
181
|
+
* hide a learning that is there.
|
|
182
|
+
*
|
|
183
|
+
* 1b (R47): never a `lesson`. Session start, recall, standing learnings and
|
|
184
|
+
* `julius check` all read through here, and a lesson loads only through
|
|
185
|
+
* `lastTimeText` once it has worked twice (`liveLessons`).
|
|
186
|
+
*/
|
|
187
|
+
export function liveLearnings(notes, counts = () => true) {
|
|
188
|
+
return stillHold(notes, counts).filter((x) => x.kind !== "lesson");
|
|
189
|
+
}
|
|
190
|
+
/** The lessons that still hold, by the same rule: what `lastTimeText`'s caller reads (4.10). */
|
|
191
|
+
export function liveLessons(notes) {
|
|
192
|
+
return stillHold(notes, () => true).filter((x) => x.kind === "lesson");
|
|
193
|
+
}
|
|
194
|
+
/** The learnings among `notes` that replace `x` by the rule above, newest first. */
|
|
195
|
+
export function replacementsOf(notes, x) {
|
|
196
|
+
const byId = byIdOf(notes);
|
|
197
|
+
return notes.filter((r) => replaces(r, x, byId)).sort((a, b) => (a.date === b.date ? b.path.localeCompare(a.path) : b.date.localeCompare(a.date)));
|
|
198
|
+
}
|
|
199
|
+
/**
|
|
200
|
+
* The learning `ref` names: by id, or by its file name (with or without `.md`,
|
|
201
|
+
* or a path ending in it). An id is copied from file to file by hand, so when
|
|
202
|
+
* two share one, the one in this checkout or on this machine comes before one
|
|
203
|
+
* on a teammate's branch.
|
|
204
|
+
*/
|
|
205
|
+
export function findLearning(notes, ref) {
|
|
206
|
+
const id = asLearningId(ref);
|
|
207
|
+
if (id) {
|
|
208
|
+
const named = notes.filter((n) => n.id === id);
|
|
209
|
+
return named.find((n) => !n.ref) ?? named[0];
|
|
210
|
+
}
|
|
211
|
+
const name = learningFileName(ref.trim());
|
|
212
|
+
if (!name)
|
|
213
|
+
return undefined;
|
|
214
|
+
const file = name.endsWith(".md") ? name : `${name}.md`;
|
|
215
|
+
return notes.find((n) => learningFileName(n.path) === file);
|
|
216
|
+
}
|
|
217
|
+
//# sourceMappingURL=learning-fields.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"learning-fields.js","sourceRoot":"","sources":["../../src/notes/learning-fields.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;GAaG;AACH,OAAO,EAAE,UAAU,EAAE,MAAM,aAAa,CAAC;AACzC,MAAM,YAAY,GAAG,CAAC,iBAAiB,EAAE,cAAc,EAAE,gBAAgB,EAAE,iBAAiB,EAAE,eAAe,EAAE,sBAAsB,EAAE,QAAQ,CAAU,CAAC;AAG1J,SAAS,QAAQ,CAAC,KAAc,EAAE,GAAW;IAC3C,IAAI,OAAO,KAAK,KAAK,QAAQ;QAAE,OAAO,EAAE,CAAC;IACzC,MAAM,IAAI,GAAG,KAAK,CAAC,OAAO,CAAC,MAAM,EAAE,GAAG,CAAC,CAAC,IAAI,EAAE,CAAC;IAC/C,OAAO,IAAI,CAAC,MAAM,IAAI,GAAG,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC,EAAE,GAAG,CAAC,CAAC;AACxD,CAAC;AAaD,MAAM,CAAC,MAAM,KAAK,GAA4B,CAAC,YAAY,EAAE,WAAW,EAAE,UAAU,EAAE,QAAQ,CAAC,CAAC;AAChG,MAAM,CAAC,MAAM,MAAM,GAAqB,CAAC,UAAU,EAAE,MAAM,EAAE,MAAM,CAAC,CAAC;AACrE,MAAM,CAAC,MAAM,QAAQ,GAA8B,CAAC,QAAQ,EAAE,MAAM,EAAE,UAAU,EAAE,SAAS,CAAC,CAAC;AAC7F,MAAM,CAAC,MAAM,OAAO,GAA8B,CAAC,QAAQ,EAAE,YAAY,EAA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AAG,IAAI,KAAK,CAAC;IACxD,OAAO,KAAK,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,gBAAgB,CAAC,CAAC,CAAC,IAAI,CAAC,KAAK,IAAI,CAAC,CAAC;AAC9D,CAAC"}
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
import { type Note } from "./notes.js";
|
|
2
|
+
/** Past this many words a learning gets skimmed: a warning, never a refusal. */
|
|
3
|
+
export declare const LONG_NOTE_WORDS = 250;
|
|
4
|
+
export interface GateInput {
|
|
5
|
+
title: string;
|
|
6
|
+
body: string;
|
|
7
|
+
/** Kept in ~/.julius for this person, not the team: only the status and repeat checks apply. */
|
|
8
|
+
personal: boolean;
|
|
9
|
+
/** Repo files the note names that exist (from `mentionedFiles`), relative to the checkout. */
|
|
10
|
+
files: string[];
|
|
11
|
+
/** Whether the note names a function, type or other symbol that's in the repo's code. */
|
|
12
|
+
namesSymbol: boolean;
|
|
13
|
+
/** What it will touch, for the repeat check. */
|
|
14
|
+
touches: string[];
|
|
15
|
+
/** The id of the learning it says it replaces (`--replaces`). */
|
|
16
|
+
replaces?: string;
|
|
17
|
+
}
|
|
18
|
+
export interface GateResult {
|
|
19
|
+
/** Why it can't be saved as it is, each with how to fix it. Empty: it passes. */
|
|
20
|
+
problems: string[];
|
|
21
|
+
warnings: string[];
|
|
22
|
+
}
|
|
23
|
+
/** The learning this one repeats: same files, and much the same title or text. */
|
|
24
|
+
export declare function repeatOf(input: Pick<GateInput, "title" | "body" | "touches" | "replaces" | "personal">, existing: Note[]): Note | null;
|
|
25
|
+
/** The checks, on a learning about to be saved. `existing`: the learnings already there. */
|
|
26
|
+
export declare function gateNote(input: GateInput, existing: Note[]): GateResult;
|
|
27
|
+
/** The names a note uses that might be symbols, most likely first: backticked, then code-shaped. At most `limit`. */
|
|
28
|
+
export declare function symbolCandidates(text: string, limit?: number): string[];
|
|
29
|
+
/**
|
|
30
|
+
* Whether any of `names` is in the repo's code: a whole-word `git grep` over
|
|
31
|
+
* tracked files, leaving out julius's own files and markdown, which would find
|
|
32
|
+
* the note's own words. Outside git, false: the files it names still count.
|
|
33
|
+
*/
|
|
34
|
+
export declare function namesRepoSymbol(repo: string, names: string[]): boolean;
|
|
35
|
+
/**
|
|
36
|
+
* Of `files` (relative to the checkout at `repo`), the ones git tracks. A
|
|
37
|
+
* learning's `touches:` lists these, plus files the session itself edited:
|
|
38
|
+
* an untracked file that was already lying around (a token, a scratch file)
|
|
39
|
+
* is never what a learning is about. Outside git, every file that exists.
|
|
40
|
+
*/
|
|
41
|
+
export declare function trackedFiles(repo: string, files: string[]): Set<string>;
|
|
42
|
+
//# sourceMappingURL=note-gate.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"note-gate.d.ts","sourceRoot":"","sources":["../../src/notes/note-gate.ts"],"names":[],"mappings":"AAgBA,OAAO,EAA4C,KAAK,IAAI,EAAE,MAAM,YAAY,CAAC;AAEjF,gFAAgF;AAChF,eAAO,MAAM,eAAe,MAAM,CAAC;AAEnC,MAAM,WAAW,SAAS;IACxB,KAAK,EAAE,MAAM,CAAC;IACd,IAAI,EAAE,MAAM,CAAC;IACb,gGAAgG;IAChG,QAAQ,EAAE,OAAO,CAAC;IAClB,8FAA8F;IAC9F,KAAK,EAAE,MAAM,EAAE,CAAC;IAChB,yFAAyF;IACzF,WAAW,EAAE,OAAO,CAAC;IACrB,gDAAgD;IAChD,OAAO,EAAE,MAAM,EAAE,CAAC;IAClB,iEAAiE;IACjE,QAAQ,CAAC,EAAE,MAAM,CAAC;CACnB;AAED,MAAM,WAAW,UAAU;IACzB,iFAAiF;IACjF,QAAQ,EAAE,MAAM,EAAE,CAAC;IACnB,QAAQ,EAAE,MAAM,EAAE,CAAC;CACpB;AAiED,kFAAkF;AAClF,wBAAgB,QAAQ,CAAC,KAAK,EAAE,IAAI,CAAC,SAAS,EAAE,OAAO,GAAG,MAAM,GAAG,SAAS,GAAG,UAAU,GAAG,UAAU,CAAC,EAAE,QAAQ,EAAE,IAAI,EAAE,GAAG,IAAI,GAAG,IAAI,CAYtI;AAED,4FAA4F;AAC5F,wBAAgB,QAAQ,CAAC,KAAK,EAAE,SAAS,EAAE,QAAQ,EAAE,IAAI,EAAE,GAAG,UAAU,CAsCvE;AAMD,qHAAqH;AACrH,wBAAgB,gBAAgB,CAAC,IAAI,EAAE,MAAM,EAAE,KAAK,SAAI,GAAG,MAAM,EAAE,CAUlE;AAED;;;;GAIG;AACH,wBAAgB,eAAe,CAAC,IAAI,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,EAAE,GAAG,OAAO,CActE;AAED;;;;;GAKG;AACH,wBAAgB,YAAY,CAAC,IAAI,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,EAAE,GAAG,GAAG,CAAC,MAAM,CAAC,CAQvE"}
|
|
@@ -0,0 +1,181 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* What `julius note` checks before it saves a learning for the team: that a
|
|
3
|
+
* teammate's Claude would act differently for reading it. A learning that
|
|
4
|
+
* names no code never reaches anyone (learnings arrive when Claude opens the
|
|
5
|
+
* files they name), one about setting julius up isn't about the repo, status
|
|
6
|
+
* ("PR is open") is wrong by next week, a decision without its reason can't be
|
|
7
|
+
* weighed, and a second copy of a learning buries the first.
|
|
8
|
+
*
|
|
9
|
+
* Each check that fails says how to fix it, and the agent saves again. A long
|
|
10
|
+
* learning only gets a warning. `--anyway` saves past the checks, for when
|
|
11
|
+
* one of them is wrong.
|
|
12
|
+
*/
|
|
13
|
+
import { execFileSync } from "node:child_process";
|
|
14
|
+
import { existsSync } from "node:fs";
|
|
15
|
+
import { join } from "node:path";
|
|
16
|
+
import { ownPath } from "./git-facts.js";
|
|
17
|
+
import { noteName, notePlace, SECTIONS, shortDate } from "./notes.js";
|
|
18
|
+
/** Past this many words a learning gets skimmed: a warning, never a refusal. */
|
|
19
|
+
export const LONG_NOTE_WORDS = 250;
|
|
20
|
+
/** Setting trail (or graft) up, said in a title or body. */
|
|
21
|
+
const SETUP_TALK = /\b(?:julius|trail|graft)\b[^.\n]{0,40}\b(?:init|setup|set up|install(?:ed|ing)?|hooks?|wiring|wired)\b|\b(?:setting up|set up|install(?:ed|ing)?|wiring)\b[^.\n]{0,20}\b(?:julius|trail|graft)\b/i;
|
|
22
|
+
/** Status: true when written, wrong a week later. */
|
|
23
|
+
const STATUS = [
|
|
24
|
+
/\b(?:PR|pull request|MR)\s*#?\d*\s+(?:is|was|got|has been|now)\s+(?:open|opened|merged|closed|approved|up|green|fixed|pushed)\b/i,
|
|
25
|
+
/\bnot (?:merged|pushed|released|published|deployed|reviewed) yet\b/i,
|
|
26
|
+
/\bpushed and not merged\b/i,
|
|
27
|
+
/\b(?:today|tomorrow|yesterday|tonight|this (?:morning|afternoon|evening|week))\b/i,
|
|
28
|
+
/\b(?:waiting on|blocked on|still open|awaiting review|in review)\b/i,
|
|
29
|
+
];
|
|
30
|
+
/** A reason: a cause, an error, a number, or a word that brings one. */
|
|
31
|
+
const WHY = /\b(?:because|since|so that|so|otherwise|or else|else|due to|caused?|causes|causing|means|meant|breaks?|broke|broken|fails?|failed|failing|errors?|exceptions?|crash(?:es|ed)?|hangs?|leaks?|slow(?:er)?|faster|cheaper|costs?|instead|to avoid|to keep|to stop|to prevent|in order to|unless|only if|rejects?|refuses?|blocks?|loses?|lost|drops?|wipes?|overwrites?|but|though|doubles?|twice|half|latency|memory|wrong|incorrect|missing|stale|races?|timeouts?|times out|deadlocks?|conflicts?|regress(?:es|ion)?|can't|cannot|won't|doesn't|don't|isn't|aren't|never)\b|\d|["“][^"”]{4,}["”]|→|=>/i;
|
|
32
|
+
const STOP = new Set("the and for with from that this what when where which into does how why are was were not but you your our out its it's can should would could about after before over under use using used fix find make".split(" "));
|
|
33
|
+
function words(s) {
|
|
34
|
+
return new Set(s.toLowerCase().split(/[^a-z0-9_]+/).filter((t) => t.length >= 3 && !STOP.has(t)));
|
|
35
|
+
}
|
|
36
|
+
function jaccard(a, b) {
|
|
37
|
+
if (!a.size || !b.size)
|
|
38
|
+
return 0;
|
|
39
|
+
let both = 0;
|
|
40
|
+
for (const t of a)
|
|
41
|
+
if (b.has(t))
|
|
42
|
+
both++;
|
|
43
|
+
return both / (a.size + b.size - both);
|
|
44
|
+
}
|
|
45
|
+
/** The body without fenced code, which quotes errors and commands rather than saying status. */
|
|
46
|
+
function prose(body) {
|
|
47
|
+
return body.replace(/```[\s\S]*?```/g, "");
|
|
48
|
+
}
|
|
49
|
+
/** The lines a reason belongs on: under Decided and Tried and ruled out, or the whole body when it has neither. */
|
|
50
|
+
function decisionLines(body) {
|
|
51
|
+
const lines = prose(body).split(/\r?\n/);
|
|
52
|
+
const wanted = new Set([SECTIONS[0].heading.toLowerCase(), SECTIONS[1].heading.toLowerCase()]);
|
|
53
|
+
const out = [];
|
|
54
|
+
let section = null;
|
|
55
|
+
let sawSection = false;
|
|
56
|
+
for (const raw of lines) {
|
|
57
|
+
const l = raw.trim();
|
|
58
|
+
const h = /^#{1,6}\s+(.*)$/.exec(l);
|
|
59
|
+
if (h) {
|
|
60
|
+
section = h[1].trim().toLowerCase();
|
|
61
|
+
if (wanted.has(section))
|
|
62
|
+
sawSection = true;
|
|
63
|
+
continue;
|
|
64
|
+
}
|
|
65
|
+
if (l && section && wanted.has(section))
|
|
66
|
+
out.push(l);
|
|
67
|
+
}
|
|
68
|
+
if (sawSection)
|
|
69
|
+
return out;
|
|
70
|
+
return lines.map((l) => l.trim()).filter((l) => l && !l.startsWith("#"));
|
|
71
|
+
}
|
|
72
|
+
function clip(s, n = 70) {
|
|
73
|
+
const t = s.trim().replace(/^[-*]\s+/, "");
|
|
74
|
+
return t.length > n ? `${t.slice(0, n - 1).trimEnd()}…` : t;
|
|
75
|
+
}
|
|
76
|
+
/** The learning this one repeats: same files, and much the same title or text. */
|
|
77
|
+
export function repeatOf(input, existing) {
|
|
78
|
+
const files = new Set(input.touches.map((t) => t.split("#")[0]));
|
|
79
|
+
const title = words(input.title);
|
|
80
|
+
const body = words(input.body);
|
|
81
|
+
for (const n of existing) {
|
|
82
|
+
if (input.replaces && n.id === input.replaces)
|
|
83
|
+
continue;
|
|
84
|
+
const shared = n.touches.some((t) => files.has(t.split("#")[0]));
|
|
85
|
+
const sameTitle = jaccard(title, words(n.title));
|
|
86
|
+
const sameBody = jaccard(body, words(n.body));
|
|
87
|
+
if (shared ? sameTitle >= 0.5 || sameBody >= 0.5 : (input.personal || !files.size) && sameTitle >= 0.6)
|
|
88
|
+
return n;
|
|
89
|
+
}
|
|
90
|
+
return null;
|
|
91
|
+
}
|
|
92
|
+
/** The checks, on a learning about to be saved. `existing`: the learnings already there. */
|
|
93
|
+
export function gateNote(input, existing) {
|
|
94
|
+
const problems = [];
|
|
95
|
+
const warnings = [];
|
|
96
|
+
const text = `${input.title}\n${prose(input.body)}`;
|
|
97
|
+
if (!input.personal) {
|
|
98
|
+
const code = input.files.filter((f) => !ownPath(f));
|
|
99
|
+
const onlyTrail = input.files.length > 0 && code.length === 0;
|
|
100
|
+
if (!code.length && !input.namesSymbol) {
|
|
101
|
+
problems.push(SETUP_TALK.test(text) || onlyTrail
|
|
102
|
+
? "It reads as a note about setting julius up, not this repo's code. Skip it, or keep it with --personal if it's about your machine."
|
|
103
|
+
: "It names no file or function in this repo. Name what it's about (`src/x.ts`, `parseConfig`), so a teammate's Claude gets it when it opens that file.");
|
|
104
|
+
}
|
|
105
|
+
}
|
|
106
|
+
for (const line of text.split(/\r?\n/)) {
|
|
107
|
+
if (STATUS.some((re) => re.test(line))) {
|
|
108
|
+
problems.push(`"${clip(line)}" is status: true today, wrong next week. Keep what stays true (the cause, the rule, the why) and put status in the PR.`);
|
|
109
|
+
break;
|
|
110
|
+
}
|
|
111
|
+
}
|
|
112
|
+
if (!input.personal && !decisionLines(input.body).some((l) => WHY.test(l))) {
|
|
113
|
+
problems.push('No line says why. Give each decision its reason: the cause, the error it hit, or the number that settled it ("because…", "otherwise…", "fails with…").');
|
|
114
|
+
}
|
|
115
|
+
const twin = repeatOf(input, existing);
|
|
116
|
+
if (twin) {
|
|
117
|
+
problems.push(`It repeats ${notePlace(twin)} ("${clip(twin.title, 50)}"${twin.author ? `, ${twin.author}` : ""}, ${shortDate(twin.date)}). If it updates that one, add --replaces ${noteName(twin)}: the old file stays as the record and yours is read instead. If it's different, say how in the title.`);
|
|
118
|
+
}
|
|
119
|
+
const count = input.body.split(/\s+/).filter(Boolean).length;
|
|
120
|
+
if (count > LONG_NOTE_WORDS)
|
|
121
|
+
warnings.push(`long: ${count} words. Long learnings get skimmed; cut it to the fact and the why.`);
|
|
122
|
+
return { problems, warnings };
|
|
123
|
+
}
|
|
124
|
+
/** `parseConfig`, `Client.Do`, `default_retry_max`, `retry()`: words in a note shaped like code. */
|
|
125
|
+
const BACKTICKED = /`([A-Za-z_$][\w$]*(?:(?:\.|::|#)[A-Za-z_$][\w$]*)*)(?:\(\))?`/g;
|
|
126
|
+
const CODE_SHAPED = /\b([a-z]+[A-Z][\w]*|[A-Z][a-z0-9]+[A-Z][\w]*|[a-z][a-z0-9]*_[a-z0-9_]+|[A-Za-z_]\w*(?=\(\)))\b/g;
|
|
127
|
+
/** The names a note uses that might be symbols, most likely first: backticked, then code-shaped. At most `limit`. */
|
|
128
|
+
export function symbolCandidates(text, limit = 8) {
|
|
129
|
+
const out = [];
|
|
130
|
+
const add = (s) => {
|
|
131
|
+
const name = s.split(/\.|::|#/).pop();
|
|
132
|
+
if (name.length < 3 || /\.[A-Za-z]{1,5}$/.test(s) || out.includes(name))
|
|
133
|
+
return;
|
|
134
|
+
out.push(name);
|
|
135
|
+
};
|
|
136
|
+
for (const m of text.matchAll(BACKTICKED))
|
|
137
|
+
add(m[1]);
|
|
138
|
+
for (const m of text.matchAll(CODE_SHAPED))
|
|
139
|
+
add(m[1]);
|
|
140
|
+
return out.slice(0, limit);
|
|
141
|
+
}
|
|
142
|
+
/**
|
|
143
|
+
* Whether any of `names` is in the repo's code: a whole-word `git grep` over
|
|
144
|
+
* tracked files, leaving out julius's own files and markdown, which would find
|
|
145
|
+
* the note's own words. Outside git, false: the files it names still count.
|
|
146
|
+
*/
|
|
147
|
+
export function namesRepoSymbol(repo, names) {
|
|
148
|
+
if (!names.length)
|
|
149
|
+
return false;
|
|
150
|
+
for (const name of names) {
|
|
151
|
+
try {
|
|
152
|
+
execFileSync("git", ["grep", "-q", "-w", "-F", "-e", name, "--", ".", ":(exclude).julius", ":(exclude).claude", ":(exclude)*.md"], {
|
|
153
|
+
cwd: repo,
|
|
154
|
+
stdio: "ignore",
|
|
155
|
+
});
|
|
156
|
+
return true;
|
|
157
|
+
}
|
|
158
|
+
catch {
|
|
159
|
+
/* not found, or not a repo */
|
|
160
|
+
}
|
|
161
|
+
}
|
|
162
|
+
return false;
|
|
163
|
+
}
|
|
164
|
+
/**
|
|
165
|
+
* Of `files` (relative to the checkout at `repo`), the ones git tracks. A
|
|
166
|
+
* learning's `touches:` lists these, plus files the session itself edited:
|
|
167
|
+
* an untracked file that was already lying around (a token, a scratch file)
|
|
168
|
+
* is never what a learning is about. Outside git, every file that exists.
|
|
169
|
+
*/
|
|
170
|
+
export function trackedFiles(repo, files) {
|
|
171
|
+
if (!files.length)
|
|
172
|
+
return new Set();
|
|
173
|
+
try {
|
|
174
|
+
const out = execFileSync("git", ["ls-files", "-z", "--", ...files], { cwd: repo, encoding: "utf8", stdio: ["ignore", "pipe", "ignore"] });
|
|
175
|
+
return new Set(out.split("\0").filter(Boolean));
|
|
176
|
+
}
|
|
177
|
+
catch {
|
|
178
|
+
return new Set(files.filter((f) => existsSync(join(repo, f))));
|
|
179
|
+
}
|
|
180
|
+
}
|
|
181
|
+
//# sourceMappingURL=note-gate.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"note-gate.js","sourceRoot":"","sources":["../../src/notes/note-gate.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;GAWG;AACH,OAAO,EAAE,YAAY,EAAE,MAAM,oBAAoB,CAAC;AAClD,OAAO,EAAE,UAAU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