@ruverd/julius 0.0.0-stage → 0.24.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +31 -0
- package/CREDITS.md +25 -0
- package/LICENSE +21 -0
- package/PROVENANCE.md +9 -0
- package/README.md +225 -2
- package/dist/ai/crux.d.ts +60 -0
- package/dist/ai/crux.d.ts.map +1 -0
- package/dist/ai/crux.js +141 -0
- package/dist/ai/crux.js.map +1 -0
- package/dist/ai/failure.d.ts +60 -0
- package/dist/ai/failure.d.ts.map +1 -0
- package/dist/ai/failure.js +86 -0
- package/dist/ai/failure.js.map +1 -0
- package/dist/ai/llm/anthropic.d.ts +37 -0
- package/dist/ai/llm/anthropic.d.ts.map +1 -0
- package/dist/ai/llm/anthropic.js +144 -0
- package/dist/ai/llm/anthropic.js.map +1 -0
- package/dist/ai/llm/factory.d.ts +28 -0
- package/dist/ai/llm/factory.d.ts.map +1 -0
- package/dist/ai/llm/factory.js +36 -0
- package/dist/ai/llm/factory.js.map +1 -0
- package/dist/ai/llm/litellm.d.ts +34 -0
- package/dist/ai/llm/litellm.d.ts.map +1 -0
- package/dist/ai/llm/litellm.js +45 -0
- package/dist/ai/llm/litellm.js.map +1 -0
- package/dist/ai/llm/openai.d.ts +44 -0
- package/dist/ai/llm/openai.d.ts.map +1 -0
- package/dist/ai/llm/openai.js +239 -0
- package/dist/ai/llm/openai.js.map +1 -0
- package/dist/ai/llm/orcarouter.d.ts +34 -0
- package/dist/ai/llm/orcarouter.d.ts.map +1 -0
- package/dist/ai/llm/orcarouter.js +45 -0
- package/dist/ai/llm/orcarouter.js.map +1 -0
- package/dist/ai/llm/recover-tool.d.ts +19 -0
- package/dist/ai/llm/recover-tool.d.ts.map +1 -0
- package/dist/ai/llm/recover-tool.js +109 -0
- package/dist/ai/llm/recover-tool.js.map +1 -0
- package/dist/ai/llm/types.d.ts +122 -0
- package/dist/ai/llm/types.d.ts.map +1 -0
- package/dist/ai/llm/types.js +33 -0
- package/dist/ai/llm/types.js.map +1 -0
- package/dist/ai/providers.d.ts +59 -0
- package/dist/ai/providers.d.ts.map +1 -0
- package/dist/ai/providers.js +54 -0
- package/dist/ai/providers.js.map +1 -0
- package/dist/ai/summarize.d.ts +25 -0
- package/dist/ai/summarize.d.ts.map +1 -0
- package/dist/ai/summarize.js +34 -0
- package/dist/ai/summarize.js.map +1 -0
- package/dist/ai/synthesize.d.ts +40 -0
- package/dist/ai/synthesize.d.ts.map +1 -0
- package/dist/ai/synthesize.js +131 -0
- package/dist/ai/synthesize.js.map +1 -0
- package/dist/app/checkout.d.ts +46 -0
- package/dist/app/checkout.d.ts.map +1 -0
- package/dist/app/checkout.js +223 -0
- package/dist/app/checkout.js.map +1 -0
- package/dist/app/events.d.ts +44 -0
- package/dist/app/events.d.ts.map +1 -0
- package/dist/app/events.js +64 -0
- package/dist/app/events.js.map +1 -0
- package/dist/app/identity.d.ts +54 -0
- package/dist/app/identity.d.ts.map +1 -0
- package/dist/app/identity.js +96 -0
- package/dist/app/identity.js.map +1 -0
- package/dist/app/main.d.ts +2 -0
- package/dist/app/main.d.ts.map +1 -0
- package/dist/app/main.js +62 -0
- package/dist/app/main.js.map +1 -0
- package/dist/app/pages.d.ts +56 -0
- package/dist/app/pages.d.ts.map +1 -0
- package/dist/app/pages.js +193 -0
- package/dist/app/pages.js.map +1 -0
- package/dist/app/queue.d.ts +40 -0
- package/dist/app/queue.d.ts.map +1 -0
- package/dist/app/queue.js +68 -0
- package/dist/app/queue.js.map +1 -0
- package/dist/app/review-process.d.ts +66 -0
- package/dist/app/review-process.d.ts.map +1 -0
- package/dist/app/review-process.js +200 -0
- package/dist/app/review-process.js.map +1 -0
- package/dist/app/review-worker.d.ts +2 -0
- package/dist/app/review-worker.d.ts.map +1 -0
- package/dist/app/review-worker.js +108 -0
- package/dist/app/review-worker.js.map +1 -0
- package/dist/app/review.d.ts +23 -0
- package/dist/app/review.d.ts.map +1 -0
- package/dist/app/review.js +142 -0
- package/dist/app/review.js.map +1 -0
- package/dist/app/server.d.ts +49 -0
- package/dist/app/server.d.ts.map +1 -0
- package/dist/app/server.js +123 -0
- package/dist/app/server.js.map +1 -0
- package/dist/ask/ask.d.ts +195 -0
- package/dist/ask/ask.d.ts.map +1 -0
- package/dist/ask/ask.js +1252 -0
- package/dist/ask/ask.js.map +1 -0
- package/dist/ask/file-rank.d.ts +72 -0
- package/dist/ask/file-rank.d.ts.map +1 -0
- package/dist/ask/file-rank.js +160 -0
- package/dist/ask/file-rank.js.map +1 -0
- package/dist/ask/file-selection.d.ts +22 -0
- package/dist/ask/file-selection.d.ts.map +1 -0
- package/dist/ask/file-selection.js +66 -0
- package/dist/ask/file-selection.js.map +1 -0
- package/dist/ask/fuse.d.ts +195 -0
- package/dist/ask/fuse.d.ts.map +1 -0
- package/dist/ask/fuse.js +344 -0
- package/dist/ask/fuse.js.map +1 -0
- package/dist/ask/graphrank.d.ts +61 -0
- package/dist/ask/graphrank.d.ts.map +1 -0
- package/dist/ask/graphrank.js +130 -0
- package/dist/ask/graphrank.js.map +1 -0
- package/dist/ask/index-file.d.ts +44 -0
- package/dist/ask/index-file.d.ts.map +1 -0
- package/dist/ask/index-file.js +128 -0
- package/dist/ask/index-file.js.map +1 -0
- package/dist/bin/julius.d.ts +3 -0
- package/dist/bin/julius.d.ts.map +1 -0
- package/dist/bin/julius.js +4 -0
- package/dist/bin/julius.js.map +1 -0
- package/dist/blast/blast-cli.d.ts +35 -0
- package/dist/blast/blast-cli.d.ts.map +1 -0
- package/dist/blast/blast-cli.js +155 -0
- package/dist/blast/blast-cli.js.map +1 -0
- package/dist/blast/blast.d.ts +128 -0
- package/dist/blast/blast.d.ts.map +1 -0
- package/dist/blast/blast.js +383 -0
- package/dist/blast/blast.js.map +1 -0
- package/dist/blast/diff.d.ts +53 -0
- package/dist/blast/diff.d.ts.map +1 -0
- package/dist/blast/diff.js +193 -0
- package/dist/blast/diff.js.map +1 -0
- package/dist/blast/evidence.d.ts +51 -0
- package/dist/blast/evidence.d.ts.map +1 -0
- package/dist/blast/evidence.js +162 -0
- package/dist/blast/evidence.js.map +1 -0
- package/dist/blast/modules.d.ts +33 -0
- package/dist/blast/modules.d.ts.map +1 -0
- package/dist/blast/modules.js +83 -0
- package/dist/blast/modules.js.map +1 -0
- package/dist/blast/name.d.ts +74 -0
- package/dist/blast/name.d.ts.map +1 -0
- package/dist/blast/name.js +269 -0
- package/dist/blast/name.js.map +1 -0
- package/dist/blast/owners.d.ts +85 -0
- package/dist/blast/owners.d.ts.map +1 -0
- package/dist/blast/owners.js +272 -0
- package/dist/blast/owners.js.map +1 -0
- package/dist/blast/render.d.ts +46 -0
- package/dist/blast/render.d.ts.map +1 -0
- package/dist/blast/render.js +422 -0
- package/dist/blast/render.js.map +1 -0
- package/dist/blast/viz.d.ts +37 -0
- package/dist/blast/viz.d.ts.map +1 -0
- package/dist/blast/viz.js +180 -0
- package/dist/blast/viz.js.map +1 -0
- package/dist/brand.d.ts +13 -0
- package/dist/brand.d.ts.map +1 -0
- package/dist/brand.js +43 -0
- package/dist/brand.js.map +1 -0
- package/dist/check/learning-edits.d.ts +9 -0
- package/dist/check/learning-edits.d.ts.map +1 -0
- package/dist/check/learning-edits.js +62 -0
- package/dist/check/learning-edits.js.map +1 -0
- package/dist/check/local-check.d.ts +104 -0
- package/dist/check/local-check.d.ts.map +1 -0
- package/dist/check/local-check.js +830 -0
- package/dist/check/local-check.js.map +1 -0
- package/dist/check/types.d.ts +31 -0
- package/dist/check/types.d.ts.map +1 -0
- package/dist/check/types.js +2 -0
- package/dist/check/types.js.map +1 -0
- package/dist/claude/build-progress.d.ts +29 -0
- package/dist/claude/build-progress.d.ts.map +1 -0
- package/dist/claude/build-progress.js +76 -0
- package/dist/claude/build-progress.js.map +1 -0
- package/dist/claude/format.d.ts +131 -0
- package/dist/claude/format.d.ts.map +1 -0
- package/dist/claude/format.js +328 -0
- package/dist/claude/format.js.map +1 -0
- package/dist/claude/hook-layers.d.ts +8 -0
- package/dist/claude/hook-layers.d.ts.map +1 -0
- package/dist/claude/hook-layers.js +74 -0
- package/dist/claude/hook-layers.js.map +1 -0
- package/dist/claude/hooks.d.ts +101 -0
- package/dist/claude/hooks.d.ts.map +1 -0
- package/dist/claude/hooks.js +849 -0
- package/dist/claude/hooks.js.map +1 -0
- package/dist/claude/init.d.ts +70 -0
- package/dist/claude/init.d.ts.map +1 -0
- package/dist/claude/init.js +207 -0
- package/dist/claude/init.js.map +1 -0
- package/dist/claude/note-signals.d.ts +28 -0
- package/dist/claude/note-signals.d.ts.map +1 -0
- package/dist/claude/note-signals.js +325 -0
- package/dist/claude/note-signals.js.map +1 -0
- package/dist/claude/paths.d.ts +9 -0
- package/dist/claude/paths.d.ts.map +1 -0
- package/dist/claude/paths.js +22 -0
- package/dist/claude/paths.js.map +1 -0
- package/dist/claude/session-metrics.d.ts +73 -0
- package/dist/claude/session-metrics.d.ts.map +1 -0
- package/dist/claude/session-metrics.js +209 -0
- package/dist/claude/session-metrics.js.map +1 -0
- package/dist/claude/settings-merge.d.ts +66 -0
- package/dist/claude/settings-merge.d.ts.map +1 -0
- package/dist/claude/settings-merge.js +249 -0
- package/dist/claude/settings-merge.js.map +1 -0
- package/dist/claude/shim-template.d.ts +18 -0
- package/dist/claude/shim-template.d.ts.map +1 -0
- package/dist/claude/shim-template.js +226 -0
- package/dist/claude/shim-template.js.map +1 -0
- package/dist/claude/skill-template.d.ts +12 -0
- package/dist/claude/skill-template.d.ts.map +1 -0
- package/dist/claude/skill-template.js +294 -0
- package/dist/claude/skill-template.js.map +1 -0
- package/dist/claude/state.d.ts +73 -0
- package/dist/claude/state.d.ts.map +1 -0
- package/dist/claude/state.js +33 -0
- package/dist/claude/state.js.map +1 -0
- package/dist/claude/stats.d.ts +5 -0
- package/dist/claude/stats.d.ts.map +1 -0
- package/dist/claude/stats.js +24 -0
- package/dist/claude/stats.js.map +1 -0
- package/dist/claude/statusline.d.ts +14 -0
- package/dist/claude/statusline.d.ts.map +1 -0
- package/dist/claude/statusline.js +45 -0
- package/dist/claude/statusline.js.map +1 -0
- package/dist/claude/sync-run.d.ts +3 -0
- package/dist/claude/sync-run.d.ts.map +1 -0
- package/dist/claude/sync-run.js +46 -0
- package/dist/claude/sync-run.js.map +1 -0
- package/dist/claude/tally.d.ts +50 -0
- package/dist/claude/tally.d.ts.map +1 -0
- package/dist/claude/tally.js +211 -0
- package/dist/claude/tally.js.map +1 -0
- package/dist/cli-epilogue.d.ts +12 -0
- package/dist/cli-epilogue.d.ts.map +1 -0
- package/dist/cli-epilogue.js +55 -0
- package/dist/cli-epilogue.js.map +1 -0
- package/dist/cli-meta.d.ts +45 -0
- package/dist/cli-meta.d.ts.map +1 -0
- package/dist/cli-meta.js +145 -0
- package/dist/cli-meta.js.map +1 -0
- package/dist/cli-picker.d.ts +129 -0
- package/dist/cli-picker.d.ts.map +1 -0
- package/dist/cli-picker.js +432 -0
- package/dist/cli-picker.js.map +1 -0
- package/dist/cli.d.ts +3 -0
- package/dist/cli.d.ts.map +1 -0
- package/dist/cli.js +2213 -0
- package/dist/cli.js.map +1 -0
- package/dist/cloud/diff.d.ts +20 -0
- package/dist/cloud/diff.d.ts.map +1 -0
- package/dist/cloud/diff.js +59 -0
- package/dist/cloud/diff.js.map +1 -0
- package/dist/cloud/nudge.d.ts +66 -0
- package/dist/cloud/nudge.d.ts.map +1 -0
- package/dist/cloud/nudge.js +268 -0
- package/dist/cloud/nudge.js.map +1 -0
- package/dist/cloud/workspace-sync.d.ts +58 -0
- package/dist/cloud/workspace-sync.d.ts.map +1 -0
- package/dist/cloud/workspace-sync.js +268 -0
- package/dist/cloud/workspace-sync.js.map +1 -0
- package/dist/cloud/workspace.d.ts +159 -0
- package/dist/cloud/workspace.d.ts.map +1 -0
- package/dist/cloud/workspace.js +134 -0
- package/dist/cloud/workspace.js.map +1 -0
- package/dist/context/build.d.ts +52 -0
- package/dist/context/build.d.ts.map +1 -0
- package/dist/context/build.js +362 -0
- package/dist/context/build.js.map +1 -0
- package/dist/context/check.d.ts +42 -0
- package/dist/context/check.d.ts.map +1 -0
- package/dist/context/check.js +162 -0
- package/dist/context/check.js.map +1 -0
- package/dist/context/map-dir.d.ts +4 -0
- package/dist/context/map-dir.d.ts.map +1 -0
- package/dist/context/map-dir.js +6 -0
- package/dist/context/map-dir.js.map +1 -0
- package/dist/context/node-file.d.ts +109 -0
- package/dist/context/node-file.d.ts.map +1 -0
- package/dist/context/node-file.js +362 -0
- package/dist/context/node-file.js.map +1 -0
- package/dist/context/price.d.ts +49 -0
- package/dist/context/price.d.ts.map +1 -0
- package/dist/context/price.js +83 -0
- package/dist/context/price.js.map +1 -0
- package/dist/context/savings.d.ts +26 -0
- package/dist/context/savings.d.ts.map +1 -0
- package/dist/context/savings.js +59 -0
- package/dist/context/savings.js.map +1 -0
- package/dist/economy/cli.d.ts +3 -0
- package/dist/economy/cli.d.ts.map +1 -0
- package/dist/economy/cli.js +52 -0
- package/dist/economy/cli.js.map +1 -0
- package/dist/economy/delivery.d.ts +49 -0
- package/dist/economy/delivery.d.ts.map +1 -0
- package/dist/economy/delivery.js +176 -0
- package/dist/economy/delivery.js.map +1 -0
- package/dist/economy/index.d.ts +67 -0
- package/dist/economy/index.d.ts.map +1 -0
- package/dist/economy/index.js +519 -0
- package/dist/economy/index.js.map +1 -0
- package/dist/engine.d.ts +83 -0
- package/dist/engine.d.ts.map +1 -0
- package/dist/engine.js +122 -0
- package/dist/engine.js.map +1 -0
- package/dist/evaluation/index.d.ts +41 -0
- package/dist/evaluation/index.d.ts.map +1 -0
- package/dist/evaluation/index.js +61 -0
- package/dist/evaluation/index.js.map +1 -0
- package/dist/graph/bindings.d.ts +64 -0
- package/dist/graph/bindings.d.ts.map +1 -0
- package/dist/graph/bindings.js +713 -0
- package/dist/graph/bindings.js.map +1 -0
- package/dist/graph/build.d.ts +88 -0
- package/dist/graph/build.d.ts.map +1 -0
- package/dist/graph/build.js +375 -0
- package/dist/graph/build.js.map +1 -0
- package/dist/graph/cards.d.ts +46 -0
- package/dist/graph/cards.d.ts.map +1 -0
- package/dist/graph/cards.js +280 -0
- package/dist/graph/cards.js.map +1 -0
- package/dist/graph/check.d.ts +25 -0
- package/dist/graph/check.d.ts.map +1 -0
- package/dist/graph/check.js +192 -0
- package/dist/graph/check.js.map +1 -0
- package/dist/graph/container.d.ts +63 -0
- package/dist/graph/container.d.ts.map +1 -0
- package/dist/graph/container.js +190 -0
- package/dist/graph/container.js.map +1 -0
- package/dist/graph/enrich.d.ts +62 -0
- package/dist/graph/enrich.d.ts.map +1 -0
- package/dist/graph/enrich.js +253 -0
- package/dist/graph/enrich.js.map +1 -0
- package/dist/graph/extract-cache.d.ts +101 -0
- package/dist/graph/extract-cache.d.ts.map +1 -0
- package/dist/graph/extract-cache.js +199 -0
- package/dist/graph/extract-cache.js.map +1 -0
- package/dist/graph/extract.d.ts +85 -0
- package/dist/graph/extract.d.ts.map +1 -0
- package/dist/graph/extract.js +2376 -0
- package/dist/graph/extract.js.map +1 -0
- package/dist/graph/fingerprint.d.ts +76 -0
- package/dist/graph/fingerprint.d.ts.map +1 -0
- package/dist/graph/fingerprint.js +160 -0
- package/dist/graph/fingerprint.js.map +1 -0
- package/dist/graph/generic.d.ts +74 -0
- package/dist/graph/generic.d.ts.map +1 -0
- package/dist/graph/generic.js +580 -0
- package/dist/graph/generic.js.map +1 -0
- package/dist/graph/invariants.d.ts +33 -0
- package/dist/graph/invariants.d.ts.map +1 -0
- package/dist/graph/invariants.js +52 -0
- package/dist/graph/invariants.js.map +1 -0
- package/dist/graph/load.d.ts +29 -0
- package/dist/graph/load.d.ts.map +1 -0
- package/dist/graph/load.js +97 -0
- package/dist/graph/load.js.map +1 -0
- package/dist/graph/lsp/client.d.ts +43 -0
- package/dist/graph/lsp/client.d.ts.map +1 -0
- package/dist/graph/lsp/client.js +179 -0
- package/dist/graph/lsp/client.js.map +1 -0
- package/dist/graph/lsp/enrich.d.ts +11 -0
- package/dist/graph/lsp/enrich.d.ts.map +1 -0
- package/dist/graph/lsp/enrich.js +155 -0
- package/dist/graph/lsp/enrich.js.map +1 -0
- package/dist/graph/lsp/registry.d.ts +15 -0
- package/dist/graph/lsp/registry.d.ts.map +1 -0
- package/dist/graph/lsp/registry.js +46 -0
- package/dist/graph/lsp/registry.js.map +1 -0
- package/dist/graph/map.d.ts +107 -0
- package/dist/graph/map.d.ts.map +1 -0
- package/dist/graph/map.js +239 -0
- package/dist/graph/map.js.map +1 -0
- package/dist/graph/native.d.ts +38 -0
- package/dist/graph/native.d.ts.map +1 -0
- package/dist/graph/native.js +169 -0
- package/dist/graph/native.js.map +1 -0
- package/dist/graph/queries/c.scm +13 -0
- package/dist/graph/queries/c_sharp.scm +19 -0
- package/dist/graph/queries/clojure.scm +58 -0
- package/dist/graph/queries/cpp.scm +23 -0
- package/dist/graph/queries/dart.scm +42 -0
- package/dist/graph/queries/elixir.scm +54 -0
- package/dist/graph/queries/java.scm +20 -0
- package/dist/graph/queries/kotlin.scm +43 -0
- package/dist/graph/queries/lua.scm +36 -0
- package/dist/graph/queries/nix.scm +32 -0
- package/dist/graph/queries/php.scm +40 -0
- package/dist/graph/queries/ruby.scm +65 -0
- package/dist/graph/queries/rust.scm +41 -0
- package/dist/graph/queries/scala.scm +66 -0
- package/dist/graph/queries/solidity.scm +43 -0
- package/dist/graph/queries/swift.scm +51 -0
- package/dist/graph/refresh.d.ts +49 -0
- package/dist/graph/refresh.d.ts.map +1 -0
- package/dist/graph/refresh.js +255 -0
- package/dist/graph/refresh.js.map +1 -0
- package/dist/graph/relations.d.ts +14 -0
- package/dist/graph/relations.d.ts.map +1 -0
- package/dist/graph/relations.js +8 -0
- package/dist/graph/relations.js.map +1 -0
- package/dist/graph/resolve.d.ts +17 -0
- package/dist/graph/resolve.d.ts.map +1 -0
- package/dist/graph/resolve.js +654 -0
- package/dist/graph/resolve.js.map +1 -0
- package/dist/graph/root.d.ts +11 -0
- package/dist/graph/root.d.ts.map +1 -0
- package/dist/graph/root.js +40 -0
- package/dist/graph/root.js.map +1 -0
- package/dist/graph/scopes.d.ts +42 -0
- package/dist/graph/scopes.d.ts.map +1 -0
- package/dist/graph/scopes.js +342 -0
- package/dist/graph/scopes.js.map +1 -0
- package/dist/graph/seed.d.ts +38 -0
- package/dist/graph/seed.d.ts.map +1 -0
- package/dist/graph/seed.js +226 -0
- package/dist/graph/seed.js.map +1 -0
- package/dist/graph/source-files.d.ts +40 -0
- package/dist/graph/source-files.d.ts.map +1 -0
- package/dist/graph/source-files.js +85 -0
- package/dist/graph/source-files.js.map +1 -0
- package/dist/graph/traverse-cli.d.ts +55 -0
- package/dist/graph/traverse-cli.d.ts.map +1 -0
- package/dist/graph/traverse-cli.js +189 -0
- package/dist/graph/traverse-cli.js.map +1 -0
- package/dist/graph/traverse.d.ts +112 -0
- package/dist/graph/traverse.d.ts.map +1 -0
- package/dist/graph/traverse.js +192 -0
- package/dist/graph/traverse.js.map +1 -0
- package/dist/graph/types.d.ts +78 -0
- package/dist/graph/types.d.ts.map +1 -0
- package/dist/graph/types.js +14 -0
- package/dist/graph/types.js.map +1 -0
- package/dist/graph/workspace-cli.d.ts +48 -0
- package/dist/graph/workspace-cli.d.ts.map +1 -0
- package/dist/graph/workspace-cli.js +102 -0
- package/dist/graph/workspace-cli.js.map +1 -0
- package/dist/graph/workspace.d.ts +135 -0
- package/dist/graph/workspace.d.ts.map +1 -0
- package/dist/graph/workspace.js +598 -0
- package/dist/graph/workspace.js.map +1 -0
- package/dist/graph/write.d.ts +13 -0
- package/dist/graph/write.d.ts.map +1 -0
- package/dist/graph/write.js +86 -0
- package/dist/graph/write.js.map +1 -0
- package/dist/hosts/antigravity.d.ts +8 -0
- package/dist/hosts/antigravity.d.ts.map +1 -0
- package/dist/hosts/antigravity.js +42 -0
- package/dist/hosts/antigravity.js.map +1 -0
- package/dist/hosts/claude-global.d.ts +36 -0
- package/dist/hosts/claude-global.d.ts.map +1 -0
- package/dist/hosts/claude-global.js +153 -0
- package/dist/hosts/claude-global.js.map +1 -0
- package/dist/hosts/codex-hooks.d.ts +11 -0
- package/dist/hosts/codex-hooks.d.ts.map +1 -0
- package/dist/hosts/codex-hooks.js +80 -0
- package/dist/hosts/codex-hooks.js.map +1 -0
- package/dist/hosts/config-write.d.ts +36 -0
- package/dist/hosts/config-write.d.ts.map +1 -0
- package/dist/hosts/config-write.js +64 -0
- package/dist/hosts/config-write.js.map +1 -0
- package/dist/hosts/cursor-hooks.d.ts +21 -0
- package/dist/hosts/cursor-hooks.d.ts.map +1 -0
- package/dist/hosts/cursor-hooks.js +103 -0
- package/dist/hosts/cursor-hooks.js.map +1 -0
- package/dist/hosts/init.d.ts +26 -0
- package/dist/hosts/init.d.ts.map +1 -0
- package/dist/hosts/init.js +82 -0
- package/dist/hosts/init.js.map +1 -0
- package/dist/hosts/install.d.ts +12 -0
- package/dist/hosts/install.d.ts.map +1 -0
- package/dist/hosts/install.js +347 -0
- package/dist/hosts/install.js.map +1 -0
- package/dist/hosts/instructions.d.ts +7 -0
- package/dist/hosts/instructions.d.ts.map +1 -0
- package/dist/hosts/instructions.js +71 -0
- package/dist/hosts/instructions.js.map +1 -0
- package/dist/hosts/investigation-instructions.d.ts +2 -0
- package/dist/hosts/investigation-instructions.d.ts.map +1 -0
- package/dist/hosts/investigation-instructions.js +2 -0
- package/dist/hosts/investigation-instructions.js.map +1 -0
- package/dist/hosts/mcp-config.d.ts +59 -0
- package/dist/hosts/mcp-config.d.ts.map +1 -0
- package/dist/hosts/mcp-config.js +229 -0
- package/dist/hosts/mcp-config.js.map +1 -0
- package/dist/hosts/plan.d.ts +32 -0
- package/dist/hosts/plan.d.ts.map +1 -0
- package/dist/hosts/plan.js +77 -0
- package/dist/hosts/plan.js.map +1 -0
- package/dist/hosts/registry.d.ts +35 -0
- package/dist/hosts/registry.d.ts.map +1 -0
- package/dist/hosts/registry.js +157 -0
- package/dist/hosts/registry.js.map +1 -0
- package/dist/hosts/retract.d.ts +47 -0
- package/dist/hosts/retract.d.ts.map +1 -0
- package/dist/hosts/retract.js +541 -0
- package/dist/hosts/retract.js.map +1 -0
- package/dist/hosts/sections.d.ts +46 -0
- package/dist/hosts/sections.d.ts.map +1 -0
- package/dist/hosts/sections.js +126 -0
- package/dist/hosts/sections.js.map +1 -0
- package/dist/index.d.ts +43 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +33 -0
- package/dist/index.js.map +1 -0
- package/dist/ingest/fs.d.ts +79 -0
- package/dist/ingest/fs.d.ts.map +1 -0
- package/dist/ingest/fs.js +307 -0
- package/dist/ingest/fs.js.map +1 -0
- package/dist/init-guard.d.ts +11 -0
- package/dist/init-guard.d.ts.map +1 -0
- package/dist/init-guard.js +21 -0
- package/dist/init-guard.js.map +1 -0
- package/dist/investigation/index.d.ts +57 -0
- package/dist/investigation/index.d.ts.map +1 -0
- package/dist/investigation/index.js +315 -0
- package/dist/investigation/index.js.map +1 -0
- package/dist/mcp/compact.d.ts +9 -0
- package/dist/mcp/compact.d.ts.map +1 -0
- package/dist/mcp/compact.js +133 -0
- package/dist/mcp/compact.js.map +1 -0
- package/dist/mcp/instructions.d.ts +5 -0
- package/dist/mcp/instructions.d.ts.map +1 -0
- package/dist/mcp/instructions.js +57 -0
- package/dist/mcp/instructions.js.map +1 -0
- package/dist/mcp/server.d.ts +7 -0
- package/dist/mcp/server.d.ts.map +1 -0
- package/dist/mcp/server.js +128 -0
- package/dist/mcp/server.js.map +1 -0
- package/dist/mcp/tool-names.d.ts +20 -0
- package/dist/mcp/tool-names.d.ts.map +1 -0
- package/dist/mcp/tool-names.js +36 -0
- package/dist/mcp/tool-names.js.map +1 -0
- package/dist/mcp/tools.d.ts +22 -0
- package/dist/mcp/tools.d.ts.map +1 -0
- package/dist/mcp/tools.js +300 -0
- package/dist/mcp/tools.js.map +1 -0
- package/dist/notes/ask-notes.d.ts +8 -0
- package/dist/notes/ask-notes.d.ts.map +1 -0
- package/dist/notes/ask-notes.js +19 -0
- package/dist/notes/ask-notes.js.map +1 -0
- package/dist/notes/branches.d.ts +102 -0
- package/dist/notes/branches.d.ts.map +1 -0
- package/dist/notes/branches.js +304 -0
- package/dist/notes/branches.js.map +1 -0
- package/dist/notes/cold-start.d.ts +177 -0
- package/dist/notes/cold-start.d.ts.map +1 -0
- package/dist/notes/cold-start.js +537 -0
- package/dist/notes/cold-start.js.map +1 -0
- package/dist/notes/edit-overlap.d.ts +62 -0
- package/dist/notes/edit-overlap.d.ts.map +1 -0
- package/dist/notes/edit-overlap.js +202 -0
- package/dist/notes/edit-overlap.js.map +1 -0
- package/dist/notes/git-facts.d.ts +21 -0
- package/dist/notes/git-facts.d.ts.map +1 -0
- package/dist/notes/git-facts.js +121 -0
- package/dist/notes/git-facts.js.map +1 -0
- package/dist/notes/home.d.ts +87 -0
- package/dist/notes/home.d.ts.map +1 -0
- package/dist/notes/home.js +430 -0
- package/dist/notes/home.js.map +1 -0
- package/dist/notes/learning-fields.d.ts +102 -0
- package/dist/notes/learning-fields.d.ts.map +1 -0
- package/dist/notes/learning-fields.js +217 -0
- package/dist/notes/learning-fields.js.map +1 -0
- package/dist/notes/note-gate.d.ts +42 -0
- package/dist/notes/note-gate.d.ts.map +1 -0
- package/dist/notes/note-gate.js +181 -0
- package/dist/notes/note-gate.js.map +1 -0
- package/dist/notes/notes.d.ts +214 -0
- package/dist/notes/notes.d.ts.map +1 -0
- package/dist/notes/notes.js +591 -0
- package/dist/notes/notes.js.map +1 -0
- package/dist/notes/pr-reviews.d.ts +108 -0
- package/dist/notes/pr-reviews.d.ts.map +1 -0
- package/dist/notes/pr-reviews.js +325 -0
- package/dist/notes/pr-reviews.js.map +1 -0
- package/dist/notes/repo-julius.d.ts +18 -0
- package/dist/notes/repo-julius.d.ts.map +1 -0
- package/dist/notes/repo-julius.js +111 -0
- package/dist/notes/repo-julius.js.map +1 -0
- package/dist/notes/session-cost.d.ts +35 -0
- package/dist/notes/session-cost.d.ts.map +1 -0
- package/dist/notes/session-cost.js +276 -0
- package/dist/notes/session-cost.js.map +1 -0
- package/dist/search/grep-cli.d.ts +35 -0
- package/dist/search/grep-cli.d.ts.map +1 -0
- package/dist/search/grep-cli.js +115 -0
- package/dist/search/grep-cli.js.map +1 -0
- package/dist/search/grep.d.ts +60 -0
- package/dist/search/grep.d.ts.map +1 -0
- package/dist/search/grep.js +176 -0
- package/dist/search/grep.js.map +1 -0
- package/dist/search/ignored-code.d.ts +9 -0
- package/dist/search/ignored-code.d.ts.map +1 -0
- package/dist/search/ignored-code.js +73 -0
- package/dist/search/ignored-code.js.map +1 -0
- package/dist/skills/skills.d.ts +118 -0
- package/dist/skills/skills.d.ts.map +1 -0
- package/dist/skills/skills.js +370 -0
- package/dist/skills/skills.js.map +1 -0
- package/dist/telemetry/contract.d.ts +103 -0
- package/dist/telemetry/contract.d.ts.map +1 -0
- package/dist/telemetry/contract.js +270 -0
- package/dist/telemetry/contract.js.map +1 -0
- package/dist/telemetry/flush.d.ts +21 -0
- package/dist/telemetry/flush.d.ts.map +1 -0
- package/dist/telemetry/flush.js +85 -0
- package/dist/telemetry/flush.js.map +1 -0
- package/dist/telemetry/gate.d.ts +30 -0
- package/dist/telemetry/gate.d.ts.map +1 -0
- package/dist/telemetry/gate.js +81 -0
- package/dist/telemetry/gate.js.map +1 -0
- package/dist/telemetry/identity.d.ts +40 -0
- package/dist/telemetry/identity.d.ts.map +1 -0
- package/dist/telemetry/identity.js +80 -0
- package/dist/telemetry/identity.js.map +1 -0
- package/dist/telemetry/index.d.ts +18 -0
- package/dist/telemetry/index.d.ts.map +1 -0
- package/dist/telemetry/index.js +16 -0
- package/dist/telemetry/index.js.map +1 -0
- package/dist/telemetry/key.d.ts +4 -0
- package/dist/telemetry/key.d.ts.map +1 -0
- package/dist/telemetry/key.js +4 -0
- package/dist/telemetry/key.js.map +1 -0
- package/dist/telemetry/notice.d.ts +19 -0
- package/dist/telemetry/notice.d.ts.map +1 -0
- package/dist/telemetry/notice.js +93 -0
- package/dist/telemetry/notice.js.map +1 -0
- package/dist/telemetry/queue.d.ts +35 -0
- package/dist/telemetry/queue.d.ts.map +1 -0
- package/dist/telemetry/queue.js +162 -0
- package/dist/telemetry/queue.js.map +1 -0
- package/dist/telemetry/send.d.ts +19 -0
- package/dist/telemetry/send.d.ts.map +1 -0
- package/dist/telemetry/send.js +84 -0
- package/dist/telemetry/send.js.map +1 -0
- package/dist/telemetry/sessions.d.ts +25 -0
- package/dist/telemetry/sessions.d.ts.map +1 -0
- package/dist/telemetry/sessions.js +104 -0
- package/dist/telemetry/sessions.js.map +1 -0
- package/dist/telemetry/track.d.ts +62 -0
- package/dist/telemetry/track.d.ts.map +1 -0
- package/dist/telemetry/track.js +142 -0
- package/dist/telemetry/track.js.map +1 -0
- package/dist/upkeep-run.d.ts +15 -0
- package/dist/upkeep-run.d.ts.map +1 -0
- package/dist/upkeep-run.js +71 -0
- package/dist/upkeep-run.js.map +1 -0
- package/dist/upkeep.d.ts +125 -0
- package/dist/upkeep.d.ts.map +1 -0
- package/dist/upkeep.js +255 -0
- package/dist/upkeep.js.map +1 -0
- package/dist/util/browser.d.ts +3 -0
- package/dist/util/browser.d.ts.map +1 -0
- package/dist/util/browser.js +14 -0
- package/dist/util/browser.js.map +1 -0
- package/dist/util/front-matter.d.ts +19 -0
- package/dist/util/front-matter.d.ts.map +1 -0
- package/dist/util/front-matter.js +21 -0
- package/dist/util/front-matter.js.map +1 -0
- package/dist/util/id.d.ts +7 -0
- package/dist/util/id.d.ts.map +1 -0
- package/dist/util/id.js +14 -0
- package/dist/util/id.js.map +1 -0
- package/dist/util/paths.d.ts +29 -0
- package/dist/util/paths.d.ts.map +1 -0
- package/dist/util/paths.js +71 -0
- package/dist/util/paths.js.map +1 -0
- package/dist/util/source.d.ts +4 -0
- package/dist/util/source.d.ts.map +1 -0
- package/dist/util/source.js +12 -0
- package/dist/util/source.js.map +1 -0
- package/dist/util/spinner.d.ts +15 -0
- package/dist/util/spinner.d.ts.map +1 -0
- package/dist/util/spinner.js +52 -0
- package/dist/util/spinner.js.map +1 -0
- package/dist/util/state.d.ts +100 -0
- package/dist/util/state.d.ts.map +1 -0
- package/dist/util/state.js +186 -0
- package/dist/util/state.js.map +1 -0
- package/dist/viewer/app.js +2 -0
- package/dist/viewer/index.html +49 -0
- package/dist/viewer/style.css +154 -0
- package/dist/viz/assemble.d.ts +83 -0
- package/dist/viz/assemble.d.ts.map +1 -0
- package/dist/viz/assemble.js +101 -0
- package/dist/viz/assemble.js.map +1 -0
- package/dist/viz/export.d.ts +39 -0
- package/dist/viz/export.d.ts.map +1 -0
- package/dist/viz/export.js +98 -0
- package/dist/viz/export.js.map +1 -0
- package/dist/viz/serve.d.ts +12 -0
- package/dist/viz/serve.d.ts.map +1 -0
- package/dist/viz/serve.js +129 -0
- package/dist/viz/serve.js.map +1 -0
- package/docs/assets/context-benchmark.svg +31 -0
- package/docs/assets/julius-hero.png +0 -0
- package/docs/upstream-changelog.md +785 -0
- package/package.json +138 -4
|
@@ -0,0 +1,325 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* When the Stop hook asks for a learning: on a sign in the transcript that the
|
|
3
|
+
* session found something the code won't tell the next person, not on a count
|
|
4
|
+
* of tool calls. A count fired on the first busy turn of a session, which is
|
|
5
|
+
* usually setting things up, and the learnings it got were about that.
|
|
6
|
+
*
|
|
7
|
+
* The signs, best first:
|
|
8
|
+
* - `fixed`: a test or build command failed, then passed after an edit;
|
|
9
|
+
* - `corrected`: the person corrected the agent ("no, …", "we use …"), and the
|
|
10
|
+
* agent went on to change code;
|
|
11
|
+
* - `undone`: an edit was undone (`git restore`, `git revert`, …);
|
|
12
|
+
* - `chose`: the person picked one of the options the agent offered, and the
|
|
13
|
+
* agent went on to change code;
|
|
14
|
+
* - `shipped`: `git commit`, `git push` or `gh pr create` after code edits;
|
|
15
|
+
* - `explored`: one turn took NOTE_WORTHY_READING tokens of reading to answer,
|
|
16
|
+
* with no edit needed: where a feature lives, why a bug happens.
|
|
17
|
+
*
|
|
18
|
+
* Only what happened since the session's last saved learning counts, so each
|
|
19
|
+
* learning starts the count over. Work on julius's own files (`.julius/`,
|
|
20
|
+
* `.claude/`, AGENTS.md …) is never a sign: that's setup, not the repo's code.
|
|
21
|
+
*
|
|
22
|
+
* Pure, for tests: `noteSignals` takes the transcript's JSONL.
|
|
23
|
+
*/
|
|
24
|
+
import { existsSync } from 'node:fs';
|
|
25
|
+
import { isAbsolute, relative, resolve, sep } from 'node:path';
|
|
26
|
+
import { ownPath } from '../notes/git-facts.js';
|
|
27
|
+
import { NOTE_CALL } from '../notes/session-cost.js';
|
|
28
|
+
/** Most times the Stop hook asks for a learning in one session. */
|
|
29
|
+
export const NOTE_ASKS_PER_SESSION = 3;
|
|
30
|
+
/**
|
|
31
|
+
* Reading in one turn, in tokens, before it counts as digging worth a learning:
|
|
32
|
+
* what trail's answers stood in for, plus the repo files and search results the
|
|
33
|
+
* agent read itself. trail answers most questions in one or two calls, so
|
|
34
|
+
* finding where something lives never needed an edit to be worth saving.
|
|
35
|
+
*/
|
|
36
|
+
export const NOTE_WORTHY_READING = 30_000;
|
|
37
|
+
/** The reading a trail answer stood in for, from its `[julius] tokens saved ≈ N` line. A reused learning's own line doesn't count: that digging was done before. */
|
|
38
|
+
const TRAIL_SAVED = /\[(?:graft|trail|julius)\] tokens saved ≈ ([\d,]+)/g;
|
|
39
|
+
/** Claude Code's tools that read the repo. */
|
|
40
|
+
const READ_TOOLS = new Set(['Read', 'Grep', 'Glob']);
|
|
41
|
+
/** Claude Code's tools that change a file. */
|
|
42
|
+
const EDIT_TOOLS = new Set(['Edit', 'MultiEdit', 'Write', 'NotebookEdit']);
|
|
43
|
+
/**
|
|
44
|
+
* A shell command that writes files: an in-place `sed`/`perl`, a redirect or
|
|
45
|
+
* `tee` into a file, a patch, or a script that opens one for writing. Agents
|
|
46
|
+
* often edit this way (a `python3 - <<EOF` that rewrites a file), and a fix
|
|
47
|
+
* made so is still a fix.
|
|
48
|
+
*/
|
|
49
|
+
const BASH_WRITE = /\bsed\s+(?:-[a-zA-Z]+\s+)*-i|\bperl\s+-[a-z]*i|\btee\s|(?:^|[^>&0-9])>>?\s*[\w./~-]+\.\w+|\bgit\s+apply\b|\bapply_patch\b|\bopen\([^)]*,\s*['"][wa]|\.write_text\(|\bwriteFileSync\(/m;
|
|
50
|
+
/** File names in a command, by their extension. */
|
|
51
|
+
const FILE_WORD = /[\w./-]+\.(?:go|tsx?|jsx?|mjs|cjs|py|rb|rs|java|kt|swift|cs|php|c|h|cc|cpp|hpp|scala|sql|ya?ml|json|toml|sh|css|scss|vue|svelte)\b/g;
|
|
52
|
+
/** `cd <dir> &&` at the start of a command: where its relative paths start. */
|
|
53
|
+
const LEADING_CD = /^\s*cd\s+(["']?)([^"'&;|]+?)\1\s*(?:&&|;)/;
|
|
54
|
+
/**
|
|
55
|
+
* A test, build or type check, as typed: `npm test`, `go test`, `pytest`,
|
|
56
|
+
* `npx tsc`, `make`. The match is the command's name for itself, so two runs
|
|
57
|
+
* of `go test` with different flags are the same check.
|
|
58
|
+
*/
|
|
59
|
+
const CHECK = /(?:^|[;&|(]\s*|\s)((?:npx\s+|bunx\s+|pnpm\s+exec\s+)?(?:(?:npm|pnpm|yarn|bun)\s+(?:run\s+)?(?:test|build|lint|typecheck|check)(?::[\w-]+)?|go\s+(?:test|build|vet)|cargo\s+(?:test|build|check|clippy)|python3?\s+-m\s+(?:pytest|unittest)|pytest|tsc|jest|vitest|mocha|rspec|node\s+--test|deno\s+test|swift\s+(?:test|build)|dotnet\s+(?:test|build)|mix\s+test|mvn\s+[\w:-]*(?:test|verify|package)|\.?\/?gradlew?\s+[\w:-]*(?:test|build)|make(?:\s+(?!-)[\w-]+)?|eslint|ruff|golangci-lint))(?=$|[\s;&|)])/;
|
|
60
|
+
/** Output that says a check failed even when a pipe (`| tail`) hid its exit code. */
|
|
61
|
+
const FAILED_OUTPUT = /\b\d+ (?:failed|failing)\b|^FAIL\b|\bFAILED\b|^# fail [1-9]|\bpanic:|Traceback \(most recent|\berror TS\d+|npm ERR!|\bBUILD FAILED\b|\bcompilation failed\b|^error(?:\[E\d+\])?:/m;
|
|
62
|
+
const ZERO_FAILED = /\b0 (?:failed|failing)\b|^# fail 0\b/m;
|
|
63
|
+
const UNDO = /\bgit\s+(?:restore|revert|reset\s+--hard|checkout\s+(?:\S+\s+)?--\s)/;
|
|
64
|
+
const SHIP = /\b(git\s+commit|git\s+push|gh\s+pr\s+create)\b/;
|
|
65
|
+
/** Commands that set tools up rather than work on the repo. */
|
|
66
|
+
const SETUP = /(?:^|[\s;&|])(?:julius|trail|graft|npx\s+(?:-y\s+)?@(?:trailhq|nanonets|ruverd)\/[\w-]+)\s+(?:init|upgrade)\b|(?:npm|pnpm|yarn|bun)\s+(?:i|install|add|uninstall)\b|\bbrew\s+install\b|\bpip3?\s+install\b/;
|
|
67
|
+
/** The person correcting the agent: at the start of their message, or a rule stated in it. */
|
|
68
|
+
const CORRECTION_LEAD = /^\s*(?:no|nope|nah|wrong|actually|don't|dont|do not|never|stop|not (?:that|this|like that|quite)|that's (?:not|wrong)|that is (?:not|wrong))\b[\s,.!:;-]/i;
|
|
69
|
+
const CORRECTION_RULE = /\b(?:instead of|instead,|use \S+ instead|we (?:always |usually |never )?(?:use|do|don't|keep|put|run)\b|not like that|that's not how|should(?:n't| not) (?:be|use)|you (?:forgot|missed|broke)\b)/i;
|
|
70
|
+
/** A clarification, not a correction: "no, I mean the other file". */
|
|
71
|
+
const CLARIFY = /\bi mean(?:t)?\b|\bi was (?:just )?asking\b|\bjust asking\b/i;
|
|
72
|
+
/** The person picking one of the options the agent offered. */
|
|
73
|
+
const PICK = /^\s*(?:(?:option|choice|plan)\s*)?(?:[1-9]|[a-d])\s*[.)!]?\s*(?:please|pls)?\s*$|^\s*(?:let'?s |go with |use |pick |do |take |yes,? )?(?:the )?(?:first|second|third|last|1st|2nd|3rd|(?:option|choice|plan)\s*[a-d1-9])\b|^\s*go with\b/i;
|
|
74
|
+
const OPTION_LINE = /^\s*(?:\d+[.)]|[A-D][.)]|[-*]\s+\*\*(?:option|choice)|(?:option|choice)\s+[A-D1-9]\b)/gim;
|
|
75
|
+
function textOf(content) {
|
|
76
|
+
if (typeof content === 'string')
|
|
77
|
+
return content;
|
|
78
|
+
if (Array.isArray(content))
|
|
79
|
+
return content.map((c) => (typeof c?.text === 'string' ? c.text : '')).join('\n');
|
|
80
|
+
return '';
|
|
81
|
+
}
|
|
82
|
+
/** What the person typed, or null: tool results, hook feedback and system lines aren't typed. */
|
|
83
|
+
function typed(e) {
|
|
84
|
+
if (e?.type !== 'user' || e?.isMeta)
|
|
85
|
+
return null;
|
|
86
|
+
const content = e?.message?.content;
|
|
87
|
+
const text = typeof content === 'string'
|
|
88
|
+
? content
|
|
89
|
+
: Array.isArray(content) && content.some((b) => b?.type === 'text')
|
|
90
|
+
? content.filter((b) => b?.type === 'text').map((b) => String(b.text ?? '')).join('\n')
|
|
91
|
+
: null;
|
|
92
|
+
if (text === null)
|
|
93
|
+
return null;
|
|
94
|
+
const t = text.trim();
|
|
95
|
+
if (!t || t.startsWith('<') || t.startsWith('[Request interrupted') || t.startsWith('Caveat:') || /^Stop hook feedback/i.test(t))
|
|
96
|
+
return null;
|
|
97
|
+
return t;
|
|
98
|
+
}
|
|
99
|
+
/** `"no, use a worktree for…"`: the first line, short, safe inside double quotes. */
|
|
100
|
+
export function quoted(s, n = 60) {
|
|
101
|
+
const line = s.split('\n')[0].trim().replace(/"/g, "'");
|
|
102
|
+
return line.length > n ? `${line.slice(0, n - 1).trimEnd()}…` : line;
|
|
103
|
+
}
|
|
104
|
+
/**
|
|
105
|
+
* Every sign since the session's last saved learning, best first. `repo` is
|
|
106
|
+
* the folder the session works in, to tell its code from trail's files and
|
|
107
|
+
* from files outside it.
|
|
108
|
+
*/
|
|
109
|
+
export function noteSignals(jsonl, repo) {
|
|
110
|
+
const tools = [];
|
|
111
|
+
const results = new Map();
|
|
112
|
+
const prompts = [];
|
|
113
|
+
const said = [];
|
|
114
|
+
let at = 0;
|
|
115
|
+
let agentSpoke = false;
|
|
116
|
+
/** Where the turn that just ended began: the person's last message. */
|
|
117
|
+
let turn = null;
|
|
118
|
+
for (const line of jsonl.split('\n')) {
|
|
119
|
+
if (!line.trim())
|
|
120
|
+
continue;
|
|
121
|
+
let e;
|
|
122
|
+
try {
|
|
123
|
+
e = JSON.parse(line);
|
|
124
|
+
}
|
|
125
|
+
catch {
|
|
126
|
+
continue;
|
|
127
|
+
}
|
|
128
|
+
at++;
|
|
129
|
+
const uuid = typeof e?.uuid === 'string' ? e.uuid : `#${at}`;
|
|
130
|
+
const content = e?.message?.content;
|
|
131
|
+
const blocks = Array.isArray(content) ? content : [];
|
|
132
|
+
if (e?.type === 'assistant') {
|
|
133
|
+
for (const b of blocks) {
|
|
134
|
+
if (b?.type === 'tool_use')
|
|
135
|
+
tools.push({ at, uuid, name: String(b.name ?? ''), input: b.input ?? {}, id: String(b.id ?? ''), cwd: typeof e.cwd === 'string' ? e.cwd : undefined });
|
|
136
|
+
else if (b?.type === 'text' && typeof b.text === 'string')
|
|
137
|
+
said.push({ at, uuid, text: b.text });
|
|
138
|
+
}
|
|
139
|
+
if (blocks.length)
|
|
140
|
+
agentSpoke = true;
|
|
141
|
+
continue;
|
|
142
|
+
}
|
|
143
|
+
for (const b of blocks) {
|
|
144
|
+
if (b?.type === 'tool_result')
|
|
145
|
+
results.set(String(b.tool_use_id ?? ''), { error: b.is_error === true, text: textOf(b.content) });
|
|
146
|
+
}
|
|
147
|
+
const t = typed(e);
|
|
148
|
+
if (t !== null)
|
|
149
|
+
turn = { at, uuid, text: t };
|
|
150
|
+
// The session's first message can't correct anything.
|
|
151
|
+
if (t !== null && agentSpoke)
|
|
152
|
+
prompts.push({ at, uuid, text: t });
|
|
153
|
+
}
|
|
154
|
+
// Start after the last learning that was saved (a note the gate turned away doesn't count).
|
|
155
|
+
let from = 0;
|
|
156
|
+
for (const t of tools) {
|
|
157
|
+
const cmd = typeof t.input?.command === 'string' ? t.input.command : '';
|
|
158
|
+
if (t.name === 'Bash' && NOTE_CALL.test(cmd) && results.get(t.id)?.error !== true)
|
|
159
|
+
from = t.at;
|
|
160
|
+
}
|
|
161
|
+
const since = (xs) => xs.filter((x) => x.at > from);
|
|
162
|
+
const work = since(tools);
|
|
163
|
+
const inRepo = (file) => {
|
|
164
|
+
if (typeof file !== 'string' || !file)
|
|
165
|
+
return null;
|
|
166
|
+
const rel = isAbsolute(file) ? relative(repo, file) : file;
|
|
167
|
+
if (!rel || rel.startsWith('..') || isAbsolute(rel))
|
|
168
|
+
return null;
|
|
169
|
+
const p = rel.split(sep).join('/');
|
|
170
|
+
return ownPath(p) ? null : p;
|
|
171
|
+
};
|
|
172
|
+
const bash = (t) => (t.name === 'Bash' && typeof t.input?.command === 'string' ? t.input.command : null);
|
|
173
|
+
/** The repo file a shell command wrote, '' when it wrote one this can't name, null when it wrote none. */
|
|
174
|
+
const shellEdit = (t) => {
|
|
175
|
+
const c = bash(t);
|
|
176
|
+
if (!c || !BASH_WRITE.test(c) || results.get(t.id)?.error)
|
|
177
|
+
return null;
|
|
178
|
+
const cd = LEADING_CD.exec(c)?.[2]?.trim();
|
|
179
|
+
const base = cd ? resolve(t.cwd ?? repo, cd) : (t.cwd ?? repo);
|
|
180
|
+
let ownOnly = false;
|
|
181
|
+
for (const w of c.match(FILE_WORD) ?? []) {
|
|
182
|
+
for (const at of isAbsolute(w) ? [w] : [resolve(base, w), resolve(repo, w)]) {
|
|
183
|
+
if (!existsSync(at))
|
|
184
|
+
continue;
|
|
185
|
+
const p = inRepo(at);
|
|
186
|
+
if (p)
|
|
187
|
+
return p;
|
|
188
|
+
ownOnly = true;
|
|
189
|
+
}
|
|
190
|
+
}
|
|
191
|
+
// Writing only julius's own files (settings, learnings) is setup, not a fix.
|
|
192
|
+
return ownOnly ? null : '';
|
|
193
|
+
};
|
|
194
|
+
const codeEdit = (t) => (EDIT_TOOLS.has(t.name) ? inRepo(t.input?.file_path ?? t.input?.notebook_path) : shellEdit(t));
|
|
195
|
+
/** Work on the repo after `at`: a code edit, or a command that isn't setting tools up. */
|
|
196
|
+
const setupOnly = (c) => c.split(/&&|\|\||;/).every((part) => !part.trim() || SETUP.test(` ${part.trim()} `) || NOTE_CALL.test(part));
|
|
197
|
+
const workedAfter = (when) => work.some((t) => t.at > when && (codeEdit(t) !== null || ((c) => c !== null && !setupOnly(c))(bash(t))));
|
|
198
|
+
const out = [];
|
|
199
|
+
// fixed: the same check failed, then passed after an edit to the code.
|
|
200
|
+
const checks = work
|
|
201
|
+
.map((t) => {
|
|
202
|
+
const c = bash(t);
|
|
203
|
+
const m = c ? CHECK.exec(c) : null;
|
|
204
|
+
const r = results.get(t.id);
|
|
205
|
+
if (!m || !r)
|
|
206
|
+
return null;
|
|
207
|
+
const failed = r.error || (FAILED_OUTPUT.test(r.text) && !ZERO_FAILED.test(r.text));
|
|
208
|
+
return { t, name: m[1].replace(/\s+/g, ' ').trim(), failed };
|
|
209
|
+
})
|
|
210
|
+
.filter((x) => x !== null);
|
|
211
|
+
for (let i = checks.length - 1; i >= 0; i--) {
|
|
212
|
+
const pass = checks[i];
|
|
213
|
+
if (pass.failed)
|
|
214
|
+
continue;
|
|
215
|
+
const fails = checks.slice(0, i).filter((c) => c.failed && c.name === pass.name);
|
|
216
|
+
if (!fails.length)
|
|
217
|
+
continue;
|
|
218
|
+
const firstFail = fails[0].t.at;
|
|
219
|
+
const edits = work.filter((t) => t.at > firstFail && t.at < pass.t.at).map(codeEdit).filter((f) => f !== null);
|
|
220
|
+
if (!edits.length)
|
|
221
|
+
continue;
|
|
222
|
+
const times = fails.length === 1 ? 'once' : `${fails.length} times`;
|
|
223
|
+
const file = [...edits].reverse().find((f) => f !== '');
|
|
224
|
+
out.push({ kind: 'fixed', key: `fixed:${pass.t.uuid}`, what: `${pass.name} failed ${times}, then passed after your change${file ? ` to ${file}` : ''}.` });
|
|
225
|
+
break;
|
|
226
|
+
}
|
|
227
|
+
// corrected: the person set the agent straight, and it went on to change things.
|
|
228
|
+
for (const p of since(prompts).reverse()) {
|
|
229
|
+
if (CLARIFY.test(p.text) || !(CORRECTION_LEAD.test(p.text) || CORRECTION_RULE.test(p.text)))
|
|
230
|
+
continue;
|
|
231
|
+
if (!workedAfter(p.at))
|
|
232
|
+
continue;
|
|
233
|
+
out.push({ kind: 'corrected', key: `corrected:${p.uuid}`, what: `The user corrected you ("${quoted(p.text)}").` });
|
|
234
|
+
break;
|
|
235
|
+
}
|
|
236
|
+
// undone: an edit thrown away, which is an approach ruled out.
|
|
237
|
+
for (const t of [...work].reverse()) {
|
|
238
|
+
const c = bash(t);
|
|
239
|
+
if (!c || !UNDO.test(c) || results.get(t.id)?.error)
|
|
240
|
+
continue;
|
|
241
|
+
const paths = c.split(/\s+/).filter((w) => /[/.]/.test(w) && !w.startsWith('-') && !/^(?:HEAD|origin)\b/.test(w));
|
|
242
|
+
if (paths.length && paths.every((w) => ownPath(w.replace(/^\.\//, ''))))
|
|
243
|
+
continue;
|
|
244
|
+
out.push({ kind: 'undone', key: `undone:${t.uuid}`, what: `You undid a change (\`${quoted(c, 50)}\`).` });
|
|
245
|
+
break;
|
|
246
|
+
}
|
|
247
|
+
// chose: the person picked one of the agent's options, and it built that one.
|
|
248
|
+
const picked = () => {
|
|
249
|
+
for (const t of [...work].reverse()) {
|
|
250
|
+
if (t.name !== 'AskUserQuestion')
|
|
251
|
+
continue;
|
|
252
|
+
const r = results.get(t.id);
|
|
253
|
+
if (!r || r.error || !workedAfter(t.at))
|
|
254
|
+
continue;
|
|
255
|
+
const answer = r.text.replace(/^[^:]*answered[^:]*:\s*/i, '');
|
|
256
|
+
return { kind: 'chose', key: `chose:${t.uuid}`, what: `The user picked one of your options ("${quoted(answer)}").` };
|
|
257
|
+
}
|
|
258
|
+
for (const p of since(prompts).reverse()) {
|
|
259
|
+
if (p.text.length > 80 || !PICK.test(p.text))
|
|
260
|
+
continue;
|
|
261
|
+
const offer = [...said].reverse().find((s) => s.at < p.at);
|
|
262
|
+
if (!offer || !offer.text.includes('?') || (offer.text.match(OPTION_LINE) ?? []).length < 2)
|
|
263
|
+
continue;
|
|
264
|
+
if (!workedAfter(p.at))
|
|
265
|
+
continue;
|
|
266
|
+
return { kind: 'chose', key: `chose:${p.uuid}`, what: `The user picked one of your options ("${quoted(p.text)}").` };
|
|
267
|
+
}
|
|
268
|
+
return null;
|
|
269
|
+
};
|
|
270
|
+
const choice = picked();
|
|
271
|
+
if (choice)
|
|
272
|
+
out.push(choice);
|
|
273
|
+
// shipped: the work went into a commit, a push or a PR with no learning beside it.
|
|
274
|
+
if (work.some((t) => codeEdit(t) !== null)) {
|
|
275
|
+
for (const t of [...work].reverse()) {
|
|
276
|
+
const c = bash(t);
|
|
277
|
+
const m = c ? SHIP.exec(c) : null;
|
|
278
|
+
if (!m || results.get(t.id)?.error)
|
|
279
|
+
continue;
|
|
280
|
+
const verb = m[1].startsWith('gh') ? 'opened a PR for' : m[1].endsWith('push') ? 'pushed' : 'committed';
|
|
281
|
+
out.push({ kind: 'shipped', key: `shipped:${t.uuid}`, what: `You ${verb} this work, and no learning went with it.` });
|
|
282
|
+
break;
|
|
283
|
+
}
|
|
284
|
+
}
|
|
285
|
+
// explored: this turn read a lot to find its answer. Asked once a turn, and never for reading julius's own files.
|
|
286
|
+
const start = Math.max(from, turn?.at ?? 0);
|
|
287
|
+
let reading = 0;
|
|
288
|
+
for (const t of work) {
|
|
289
|
+
if (t.at <= start)
|
|
290
|
+
continue;
|
|
291
|
+
const r = results.get(t.id);
|
|
292
|
+
if (!r || r.error)
|
|
293
|
+
continue;
|
|
294
|
+
for (const m of r.text.matchAll(TRAIL_SAVED))
|
|
295
|
+
reading += Number(m[1].replace(/,/g, '')) || 0;
|
|
296
|
+
if (!READ_TOOLS.has(t.name))
|
|
297
|
+
continue;
|
|
298
|
+
if (t.name === 'Read' && inRepo(t.input?.file_path) === null)
|
|
299
|
+
continue;
|
|
300
|
+
reading += Math.round(r.text.length / 4);
|
|
301
|
+
}
|
|
302
|
+
if (reading >= NOTE_WORTHY_READING) {
|
|
303
|
+
out.push({ kind: 'explored', key: `explored:${turn?.uuid ?? `#${start}`}`, what: `This turn took about ${Math.round(reading / 1000)}k tokens of reading to work out.` });
|
|
304
|
+
}
|
|
305
|
+
return out;
|
|
306
|
+
}
|
|
307
|
+
const SAVE = '`julius note --title "<the fact, not the task>"`';
|
|
308
|
+
const CLOSE = 'Sections: ## Decided, ## Tried and ruled out, ## Watch out. A summary, never a transcript, nothing secret. Then finish as trail\'s output asks.';
|
|
309
|
+
/** What the agent is told: the sign first, since Claude Code folds long hook output to its first lines. */
|
|
310
|
+
export function noteAsk(s) {
|
|
311
|
+
const skip = 'Nothing worth keeping? Say so and stop.';
|
|
312
|
+
const first = s.kind === 'fixed'
|
|
313
|
+
? `${s.what} If the cause isn't obvious from the diff, save it: ${SAVE}, naming the file and the why. ${skip}`
|
|
314
|
+
: s.kind === 'corrected'
|
|
315
|
+
? `${s.what} Save the rule so nobody has to say it again: ${SAVE}, naming the file it's about; add --personal if it's about how this person likes to work. ${skip}`
|
|
316
|
+
: s.kind === 'undone'
|
|
317
|
+
? `${s.what} If you dropped an approach, save why under ## Tried and ruled out: ${SAVE}, naming the file. ${skip}`
|
|
318
|
+
: s.kind === 'chose'
|
|
319
|
+
? `${s.what} If the choice matters to the next person, save it under ## Decided, with the options you dropped and why under ## Tried and ruled out: ${SAVE}. ${skip}`
|
|
320
|
+
: s.kind === 'explored'
|
|
321
|
+
? `${s.what} If it found where something lives or why it works the way it does, and the code won't say so plainly, save it: ${SAVE}, naming the files. ${skip}`
|
|
322
|
+
: `${s.what} If the session found what the diff won't tell the next person (a cause, a dropped approach, a rule), save it now so it ships with the change: ${SAVE}. ${skip}`;
|
|
323
|
+
return `[julius] ${first}\n${CLOSE}`;
|
|
324
|
+
}
|
|
325
|
+
//# sourceMappingURL=note-signals.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"note-signals.js","sourceRoot":"","sources":["../../src/claude/note-signals.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;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iD,IAAI,6FAA6F,IAAI,EAAE;YACnK,CAAC,CAAC,CAAC,CAAC,IAAI,KAAK,QAAQ;gBACnB,CAAC,CAAC,GAAG,CAAC,CAAC,IAAI,uEAAuE,IAAI,sBAAsB,IAAI,EAAE;gBAClH,CAAC,CAAC,CAAC,CAAC,IAAI,KAAK,OAAO;oBAClB,CAAC,CAAC,GAAG,CAAC,CAAC,IAAI,2IAA2I,IAAI,KAAK,IAAI,EAAE;oBACrK,CAAC,CAAC,CAAC,CAAC,IAAI,KAAK,UAAU;wBACrB,CAAC,CAAC,GAAG,CAAC,CAAC,IAAI,mHAAmH,IAAI,uBAAuB,IAAI,EAAE;wBAC/J,CAAC,CAAC,GAAG,CAAC,CAAC,IAAI,kJAAkJ,IAAI,KAAK,IAAI,EAAE,CAAC;IACzL,OAAO,YAAY,KAAK,KAAK,KAAK,EAAE,CAAC;AACvC,CAAC"}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
/** Absolute path to the julius CLI (`<pkgRoot>/dist/cli.js`), resolved from this module. */
|
|
2
|
+
export declare function juliusCliPath(): string;
|
|
3
|
+
/** Absolute path to this package's `dist/claude` dir. Baked into the generated shims at
|
|
4
|
+
* init time as their primary resolution candidate, so the statusline/hooks find julius
|
|
5
|
+
* without runtime guesswork — correct regardless of how Node was installed. */
|
|
6
|
+
export declare function claudeDistDir(): string;
|
|
7
|
+
/** Absolute path to a sibling script in the claude dir (e.g. `sync-run.js`). */
|
|
8
|
+
export declare function claudeScriptPath(name: string): string;
|
|
9
|
+
//# sourceMappingURL=paths.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"paths.d.ts","sourceRoot":"","sources":["../../src/claude/paths.ts"],"names":[],"mappings":"AASA,4FAA4F;AAC5F,wBAAgB,aAAa,IAAI,MAAM,CAEtC;AAED;;+EAE+E;AAC/E,wBAAgB,aAAa,IAAI,MAAM,CAEtC;AAED,gFAAgF;AAChF,wBAAgB,gBAAgB,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM,CAErD"}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import { fileURLToPath } from 'node:url';
|
|
2
|
+
import { dirname, join } from 'node:path';
|
|
3
|
+
// This module ships inside the package at <pkgRoot>/dist/claude/paths.js. Resolving julius's
|
|
4
|
+
// own CLI and sibling scripts relative to THIS file — not the project dir — is what makes the
|
|
5
|
+
// hooks work when julius is installed as a dependency in someone else's repo (where
|
|
6
|
+
// <projectDir>/dist/ does not exist). In julius's own repo it resolves to ./dist all the same.
|
|
7
|
+
const CLAUDE_DIR = dirname(fileURLToPath(import.meta.url));
|
|
8
|
+
/** Absolute path to the julius CLI (`<pkgRoot>/dist/cli.js`), resolved from this module. */
|
|
9
|
+
export function juliusCliPath() {
|
|
10
|
+
return join(CLAUDE_DIR, '..', 'cli.js');
|
|
11
|
+
}
|
|
12
|
+
/** Absolute path to this package's `dist/claude` dir. Baked into the generated shims at
|
|
13
|
+
* init time as their primary resolution candidate, so the statusline/hooks find julius
|
|
14
|
+
* without runtime guesswork — correct regardless of how Node was installed. */
|
|
15
|
+
export function claudeDistDir() {
|
|
16
|
+
return CLAUDE_DIR;
|
|
17
|
+
}
|
|
18
|
+
/** Absolute path to a sibling script in the claude dir (e.g. `sync-run.js`). */
|
|
19
|
+
export function claudeScriptPath(name) {
|
|
20
|
+
return join(CLAUDE_DIR, name);
|
|
21
|
+
}
|
|
22
|
+
//# sourceMappingURL=paths.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"paths.js","sourceRoot":"","sources":["../../src/claude/paths.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,UAAU,CAAC;AACzC,OAAO,EAAE,OAAO,EAAE,IAAI,EAAE,MAAM,WAAW,CAAC;AAE1C,6FAA6F;AAC7F,8FAA8F;AAC9F,oFAAoF;AACpF,+FAA+F;AAC/F,MAAM,UAAU,GAAG,OAAO,CAAC,aAAa,CAAC,OAAO,IAAI,CAAC,GAAG,CAAC,CAAC,CAAC;AAE3D,4FAA4F;AAC5F,MAAM,UAAU,aAAa;IAC3B,OAAO,IAAI,CAAC,UAAU,EAAE,IAAI,EAAE,QAAQ,CAAC,CAAC;AAC1C,CAAC;AAED;;+EAE+E;AAC/E,MAAM,UAAU,aAAa;IAC3B,OAAO,UAAU,CAAC;AACpB,CAAC;AAED,gFAAgF;AAChF,MAAM,UAAU,gBAAgB,CAAC,IAAY;IAC3C,OAAO,IAAI,CAAC,UAAU,EAAE,IAAI,CAAC,CAAC;AAChC,CAAC"}
|
|
@@ -0,0 +1,73 @@
|
|
|
1
|
+
import { type SessionState } from './state.js';
|
|
2
|
+
import type { AgentHost } from '../telemetry/contract.js';
|
|
3
|
+
export type ToolKind = 'julius' | 'source';
|
|
4
|
+
/** An MCP-style tool name (server-prefixed), as opposed to a native Read/Shell.
|
|
5
|
+
* Used to hand julius MCP calls to the dedicated MCP hook so a host that fires
|
|
6
|
+
* BOTH a generic post-tool hook and an MCP hook can't double-count them. */
|
|
7
|
+
export declare function isMcpToolName(toolName: string): boolean;
|
|
8
|
+
/**
|
|
9
|
+
* Whether a tool name is one of julius's MCP tools, across every host prefix.
|
|
10
|
+
* Anchored on the real name list (`julius_find_code`, its legacy aliases, …), not
|
|
11
|
+
* a loose `includes('julius')`: a third-party MCP tool whose name merely contains
|
|
12
|
+
* "julius" (or a repo working on julius itself) must not count as a julius read —
|
|
13
|
+
* the same care `commandInvokesJulius` takes for the CLI side. Strips the host
|
|
14
|
+
* prefix first (`mcp__julius__julius_find_code`, `MCP:julius_find_code`) by taking
|
|
15
|
+
* the last delimited segment. */
|
|
16
|
+
export declare function isJuliusMcpTool(toolName: string): boolean;
|
|
17
|
+
/** Whether a shell command line invokes the CLI under either name (any of its install shapes). */
|
|
18
|
+
export declare function commandInvokesJulius(command: string): boolean;
|
|
19
|
+
/**
|
|
20
|
+
* Classify one tool use as a julius retrieval, a source read, or neither
|
|
21
|
+
* (an edit, a task spawn, an unrelated shell command — no retrieval signal).
|
|
22
|
+
* `command` is the shell command line when `toolName` is the host's shell tool.
|
|
23
|
+
*/
|
|
24
|
+
export declare function classifyToolUse(toolName?: string, command?: string): ToolKind | null;
|
|
25
|
+
/** Sum every `[julius] tokens saved ≈ N` footer in a blob of tool output. Thin
|
|
26
|
+
* alias over {@link sumSavingsFooters}, which lives next to the code that writes
|
|
27
|
+
* the footer so the two can't drift. */
|
|
28
|
+
export declare function parseSavings(blob: string): number;
|
|
29
|
+
export interface ToolUse {
|
|
30
|
+
/** 'julius' → juliusReads++, 'source' → sourceReads++, null/absent → neither. */
|
|
31
|
+
kind?: ToolKind | null;
|
|
32
|
+
/** Tokens the retrieval saved, parsed from its footer. Added to the running total. */
|
|
33
|
+
savedTokens?: number;
|
|
34
|
+
/** The host recording this use. Stamped on the session file (once) so the
|
|
35
|
+
* `session_summary` is attributed correctly no matter which host later flushes it. */
|
|
36
|
+
host?: AgentHost;
|
|
37
|
+
}
|
|
38
|
+
/**
|
|
39
|
+
* Fold one tool use into a session's counters. A no-op when there is nothing to
|
|
40
|
+
* record (kind null and no savings), so a host can call it unconditionally after
|
|
41
|
+
* every tool without first checking whether the tool was interesting — the
|
|
42
|
+
* no-write path is what keeps it cheap on the Write/Edit/Task majority.
|
|
43
|
+
*
|
|
44
|
+
* Best-effort read-modify-write, not locked — mirroring `patchStats` in
|
|
45
|
+
* util/state.ts. Two tool-use hooks racing on the same session file can lose a
|
|
46
|
+
* count; that is acceptable for an episodic usage estimate (worst case is an
|
|
47
|
+
* undercount by one, never corruption thanks to the atomic write), and a lock
|
|
48
|
+
* here would contend with the build lock these hooks also touch.
|
|
49
|
+
*/
|
|
50
|
+
export declare function recordToolUse(dir: string, sessionId: string, use: ToolUse): void;
|
|
51
|
+
export interface SessionSummary extends SessionState {
|
|
52
|
+
id: string;
|
|
53
|
+
}
|
|
54
|
+
/** The most-recently-touched session file for a repo, or null when none exist —
|
|
55
|
+
* what `julius stats` shows by default: the session you were just in. */
|
|
56
|
+
export declare function latestSession(dir: string): SessionSummary | null;
|
|
57
|
+
/**
|
|
58
|
+
* A one-line-per-fact readout of a session's usage mix — Cursor has no
|
|
59
|
+
* statusline, so this is how you see the numbers the Claude Code bar would show.
|
|
60
|
+
* Reads local JSON only; sends nothing.
|
|
61
|
+
*/
|
|
62
|
+
/**
|
|
63
|
+
* What this repo's most recent session has actually been paying per million
|
|
64
|
+
* input tokens, or null when no turn has been billed yet.
|
|
65
|
+
*
|
|
66
|
+
* `latestSession` rather than a session id because the callers are CLI and MCP
|
|
67
|
+
* processes answering one query: they know the repo, never the host's session
|
|
68
|
+
* id. The rate belongs to the repo's current session, which is the one whose
|
|
69
|
+
* reply the number is about to appear in.
|
|
70
|
+
*/
|
|
71
|
+
export declare function sessionInputRate(dir: string): number | null;
|
|
72
|
+
export declare function formatSessionStats(s: SessionSummary | null): string;
|
|
73
|
+
//# sourceMappingURL=session-metrics.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"session-metrics.d.ts","sourceRoot":"","sources":["../../src/claude/session-metrics.ts"],"names":[],"mappings":"AAmCA,OAAO,EAAyD,KAAK,YAAY,EAAE,MAAM,YAAY,CAAC;AACtG,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,0BAA0B,CAAC;AAI1D,MAAM,MAAM,QAAQ,GAAG,QAAQ,GAAG,QAAQ,CAAC;AAc3C;;6EAE6E;AAC7E,wBAAgB,aAAa,CAAC,QAAQ,EAAE,MAAM,GAAG,OAAO,CAGvD;AAED;;;;;;;iCAOiC;AACjC,wBAAgB,eAAe,CAAC,QAAQ,EAAE,MAAM,GAAG,OAAO,CAIzD;AAED,kGAAkG;AAClG,wBAAgB,oBAAoB,CAAC,OAAO,EAAE,MAAM,GAAG,OAAO,CAQ7D;AAED;;;;GAIG;AACH,wBAAgB,eAAe,CAAC,QAAQ,CAAC,EAAE,MAAM,EAAE,OAAO,CAAC,EAAE,MAAM,GAAG,QAAQ,GAAG,IAAI,C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