trail-code 0.0.0-stage → 0.28.0-semantic.3
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/LICENSE +21 -0
- package/README.md +567 -2
- package/dist/ai/crux.d.ts +88 -0
- package/dist/ai/crux.d.ts.map +1 -0
- package/dist/ai/crux.js +219 -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 +145 -0
- package/dist/ai/llm/openai.d.ts.map +1 -0
- package/dist/ai/llm/openai.js +629 -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 +21 -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 +230 -0
- package/dist/ai/synthesize.js.map +1 -0
- package/dist/ask/ask.d.ts +199 -0
- package/dist/ask/ask.d.ts.map +1 -0
- package/dist/ask/ask.js +1291 -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/ask/semantic.d.ts +42 -0
- package/dist/ask/semantic.d.ts.map +1 -0
- package/dist/ask/semantic.js +293 -0
- package/dist/ask/semantic.js.map +1 -0
- package/dist/bin/graft.d.ts +3 -0
- package/dist/bin/graft.d.ts.map +1 -0
- package/dist/bin/graft.js +14 -0
- package/dist/bin/graft.js.map +1 -0
- package/dist/bin/trail.d.ts +3 -0
- package/dist/bin/trail.d.ts.map +1 -0
- package/dist/bin/trail.js +13 -0
- package/dist/bin/trail.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 +111 -0
- package/dist/brand.d.ts.map +1 -0
- package/dist/brand.js +282 -0
- package/dist/brand.js.map +1 -0
- package/dist/claude/build-progress.d.ts +30 -0
- package/dist/claude/build-progress.d.ts.map +1 -0
- package/dist/claude/build-progress.js +81 -0
- package/dist/claude/build-progress.js.map +1 -0
- package/dist/claude/hermes-skill-template.d.ts +16 -0
- package/dist/claude/hermes-skill-template.d.ts.map +1 -0
- package/dist/claude/hermes-skill-template.js +154 -0
- package/dist/claude/hermes-skill-template.js.map +1 -0
- package/dist/claude/init.d.ts +65 -0
- package/dist/claude/init.d.ts.map +1 -0
- package/dist/claude/init.js +258 -0
- package/dist/claude/init.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 +76 -0
- package/dist/claude/settings-merge.d.ts.map +1 -0
- package/dist/claude/settings-merge.js +283 -0
- package/dist/claude/settings-merge.js.map +1 -0
- package/dist/claude/skill-template.d.ts +13 -0
- package/dist/claude/skill-template.d.ts.map +1 -0
- package/dist/claude/skill-template.js +290 -0
- package/dist/claude/skill-template.js.map +1 -0
- package/dist/claude/state.d.ts +85 -0
- package/dist/claude/state.d.ts.map +1 -0
- package/dist/claude/state.js +88 -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/cli-epilogue.d.ts +12 -0
- package/dist/cli-epilogue.d.ts.map +1 -0
- package/dist/cli-epilogue.js +72 -0
- package/dist/cli-epilogue.js.map +1 -0
- package/dist/cli-meta.d.ts +82 -0
- package/dist/cli-meta.d.ts.map +1 -0
- package/dist/cli-meta.js +238 -0
- package/dist/cli-meta.js.map +1 -0
- package/dist/cli-picker.d.ts +139 -0
- package/dist/cli-picker.d.ts.map +1 -0
- package/dist/cli-picker.js +439 -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 +1638 -0
- package/dist/cli.js.map +1 -0
- package/dist/context/batches.d.ts +29 -0
- package/dist/context/batches.d.ts.map +1 -0
- package/dist/context/batches.js +130 -0
- package/dist/context/batches.js.map +1 -0
- package/dist/context/build.d.ts +57 -0
- package/dist/context/build.d.ts.map +1 -0
- package/dist/context/build.js +396 -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 +13 -0
- package/dist/context/map-dir.d.ts.map +1 -0
- package/dist/context/map-dir.js +81 -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 +390 -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 +67 -0
- package/dist/context/savings.d.ts.map +1 -0
- package/dist/context/savings.js +125 -0
- package/dist/context/savings.js.map +1 -0
- package/dist/engine.d.ts +85 -0
- package/dist/engine.d.ts.map +1 -0
- package/dist/engine.js +122 -0
- package/dist/engine.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-run.d.ts +25 -0
- package/dist/graph/build-run.d.ts.map +1 -0
- package/dist/graph/build-run.js +121 -0
- package/dist/graph/build-run.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 +386 -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 +191 -0
- package/dist/graph/container.js.map +1 -0
- package/dist/graph/depth-parser.d.ts +61 -0
- package/dist/graph/depth-parser.d.ts.map +1 -0
- package/dist/graph/depth-parser.js +153 -0
- package/dist/graph/depth-parser.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 +258 -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 +2377 -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 +773 -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 +61 -0
- package/dist/graph/lsp/client.d.ts.map +1 -0
- package/dist/graph/lsp/client.js +217 -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 +163 -0
- package/dist/graph/lsp/enrich.js.map +1 -0
- package/dist/graph/lsp/registry.d.ts +22 -0
- package/dist/graph/lsp/registry.d.ts.map +1 -0
- package/dist/graph/lsp/registry.js +71 -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/markdown.d.ts +22 -0
- package/dist/graph/markdown.d.ts.map +1 -0
- package/dist/graph/markdown.js +143 -0
- package/dist/graph/markdown.js.map +1 -0
- package/dist/graph/native.d.ts +46 -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/gleam.scm +51 -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 +106 -0
- package/dist/graph/refresh.d.ts.map +1 -0
- package/dist/graph/refresh.js +430 -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 +716 -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 +40 -0
- package/dist/graph/scopes.d.ts.map +1 -0
- package/dist/graph/scopes.js +383 -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 +229 -0
- package/dist/graph/seed.js.map +1 -0
- package/dist/graph/source-files.d.ts +46 -0
- package/dist/graph/source-files.d.ts.map +1 -0
- package/dist/graph/source-files.js +118 -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/wasm-runtime.d.ts +19 -0
- package/dist/graph/wasm-runtime.d.ts.map +1 -0
- package/dist/graph/wasm-runtime.js +38 -0
- package/dist/graph/wasm-runtime.js.map +1 -0
- package/dist/graph/workspace-cli.d.ts +56 -0
- package/dist/graph/workspace-cli.d.ts.map +1 -0
- package/dist/graph/workspace-cli.js +111 -0
- package/dist/graph/workspace-cli.js.map +1 -0
- package/dist/graph/workspace.d.ts +172 -0
- package/dist/graph/workspace.d.ts.map +1 -0
- package/dist/graph/workspace.js +714 -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 +14 -0
- package/dist/hosts/antigravity.d.ts.map +1 -0
- package/dist/hosts/antigravity.js +59 -0
- package/dist/hosts/antigravity.js.map +1 -0
- package/dist/hosts/auto.d.ts +37 -0
- package/dist/hosts/auto.d.ts.map +1 -0
- package/dist/hosts/auto.js +141 -0
- package/dist/hosts/auto.js.map +1 -0
- package/dist/hosts/claude-global.d.ts +72 -0
- package/dist/hosts/claude-global.d.ts.map +1 -0
- package/dist/hosts/claude-global.js +230 -0
- package/dist/hosts/claude-global.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/init.d.ts +28 -0
- package/dist/hosts/init.d.ts.map +1 -0
- package/dist/hosts/init.js +89 -0
- package/dist/hosts/init.js.map +1 -0
- package/dist/hosts/instructions.d.ts +14 -0
- package/dist/hosts/instructions.d.ts.map +1 -0
- package/dist/hosts/instructions.js +95 -0
- package/dist/hosts/instructions.js.map +1 -0
- package/dist/hosts/mcp-config.d.ts +78 -0
- package/dist/hosts/mcp-config.d.ts.map +1 -0
- package/dist/hosts/mcp-config.js +251 -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 +73 -0
- package/dist/hosts/plan.js.map +1 -0
- package/dist/hosts/registry.d.ts +41 -0
- package/dist/hosts/registry.d.ts.map +1 -0
- package/dist/hosts/registry.js +164 -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 +520 -0
- package/dist/hosts/retract.js.map +1 -0
- package/dist/hosts/sections.d.ts +47 -0
- package/dist/hosts/sections.d.ts.map +1 -0
- package/dist/hosts/sections.js +127 -0
- package/dist/hosts/sections.js.map +1 -0
- package/dist/index.d.ts +41 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +32 -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 +306 -0
- package/dist/ingest/fs.js.map +1 -0
- package/dist/init-guard.d.ts +16 -0
- package/dist/init-guard.d.ts.map +1 -0
- package/dist/init-guard.js +27 -0
- package/dist/init-guard.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 +64 -0
- package/dist/mcp/instructions.js.map +1 -0
- package/dist/mcp/kept-listing.d.ts +27 -0
- package/dist/mcp/kept-listing.d.ts.map +1 -0
- package/dist/mcp/kept-listing.js +63 -0
- package/dist/mcp/kept-listing.js.map +1 -0
- package/dist/mcp/server.d.ts +4 -0
- package/dist/mcp/server.d.ts.map +1 -0
- package/dist/mcp/server.js +147 -0
- package/dist/mcp/server.js.map +1 -0
- package/dist/mcp/tool-names.d.ts +27 -0
- package/dist/mcp/tool-names.d.ts.map +1 -0
- package/dist/mcp/tool-names.js +47 -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 +440 -0
- package/dist/mcp/tools.js.map +1 -0
- package/dist/node-version.d.ts +15 -0
- package/dist/node-version.d.ts.map +1 -0
- package/dist/node-version.js +23 -0
- package/dist/node-version.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 +143 -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/search/user-regexp.d.ts +26 -0
- package/dist/search/user-regexp.d.ts.map +1 -0
- package/dist/search/user-regexp.js +150 -0
- package/dist/search/user-regexp.js.map +1 -0
- package/dist/telemetry/contract.d.ts +117 -0
- package/dist/telemetry/contract.d.ts.map +1 -0
- package/dist/telemetry/contract.js +341 -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 +21 -0
- package/dist/telemetry/key.d.ts.map +1 -0
- package/dist/telemetry/key.js +49 -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 +143 -0
- package/dist/telemetry/track.js.map +1 -0
- package/dist/upkeep-run.d.ts +22 -0
- package/dist/upkeep-run.d.ts.map +1 -0
- package/dist/upkeep-run.js +85 -0
- package/dist/upkeep-run.js.map +1 -0
- package/dist/upkeep.d.ts +127 -0
- package/dist/upkeep.d.ts.map +1 -0
- package/dist/upkeep.js +252 -0
- package/dist/upkeep.js.map +1 -0
- package/dist/util/actions-folder.d.ts +2 -0
- package/dist/util/actions-folder.d.ts.map +1 -0
- package/dist/util/actions-folder.js +9 -0
- package/dist/util/actions-folder.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/child-process.d.ts +15 -0
- package/dist/util/child-process.d.ts.map +1 -0
- package/dist/util/child-process.js +15 -0
- package/dist/util/child-process.js.map +1 -0
- package/dist/util/front-matter.d.ts +46 -0
- package/dist/util/front-matter.d.ts.map +1 -0
- package/dist/util/front-matter.js +113 -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/private-file.d.ts +14 -0
- package/dist/util/private-file.d.ts.map +1 -0
- package/dist/util/private-file.js +82 -0
- package/dist/util/private-file.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 +120 -0
- package/dist/util/state.d.ts.map +1 -0
- package/dist/util/state.js +264 -0
- package/dist/util/state.js.map +1 -0
- package/dist/vendor/grammars/tree-sitter-go.LICENSE +21 -0
- package/dist/vendor/grammars/tree-sitter-go.wasm +0 -0
- package/dist/vendor/grammars/tree-sitter-java.LICENSE +21 -0
- package/dist/vendor/grammars/tree-sitter-java.wasm +0 -0
- package/dist/vendor/grammars/tree-sitter-kotlin.LICENSE +9 -0
- package/dist/vendor/grammars/tree-sitter-kotlin.wasm +0 -0
- package/dist/vendor/grammars/tree-sitter-php.LICENSE +22 -0
- package/dist/vendor/grammars/tree-sitter-php.wasm +0 -0
- package/dist/vendor/grammars/tree-sitter-python.LICENSE +21 -0
- package/dist/vendor/grammars/tree-sitter-python.wasm +0 -0
- package/dist/vendor/grammars/tree-sitter-r.LICENSE +9 -0
- package/dist/vendor/grammars/tree-sitter-r.wasm +0 -0
- package/dist/vendor/grammars/tree-sitter-swift.LICENSE +21 -0
- package/dist/vendor/grammars/tree-sitter-swift.wasm +0 -0
- package/dist/vendor/grammars/tree-sitter-tsx.wasm +0 -0
- package/dist/vendor/grammars/tree-sitter-typescript.LICENSE +21 -0
- package/dist/vendor/grammars/tree-sitter-typescript.wasm +0 -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 +13 -0
- package/dist/viz/serve.d.ts.map +1 -0
- package/dist/viz/serve.js +130 -0
- package/dist/viz/serve.js.map +1 -0
- package/package.json +115 -4
- package/scripts/build-grammar-wasm.mjs +112 -0
- package/scripts/build-viewer.mjs +44 -0
- package/scripts/graph-quality.mjs +117 -0
- package/scripts/pack-trail.mjs +53 -0
- package/scripts/postinstall.mjs +65 -0
- package/scripts/run-tests.mjs +72 -0
- package/scripts/stamp-telemetry-key.mjs +56 -0
- package/scripts/tally-audit.mjs +140 -0
- package/scripts/vendor-grammars.mjs +53 -0
|
@@ -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 graft's
|
|
4
|
+
// own CLI and sibling scripts relative to THIS file — not the project dir — is what makes the
|
|
5
|
+
// hooks work when graft is installed as a dependency in someone else's repo (where
|
|
6
|
+
// <projectDir>/dist/ does not exist). In graft's own repo it resolves to ./dist all the same.
|
|
7
|
+
const CLAUDE_DIR = dirname(fileURLToPath(import.meta.url));
|
|
8
|
+
/** Absolute path to the graft CLI (`<pkgRoot>/dist/cli.js`), resolved from this module. */
|
|
9
|
+
export function graftCliPath() {
|
|
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 graft
|
|
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,4FAA4F;AAC5F,8FAA8F;AAC9F,mFAAmF;AACnF,8FAA8F;AAC9F,MAAM,UAAU,GAAG,OAAO,CAAC,aAAa,CAAC,MAAM,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC,CAAC;AAE3D,2FAA2F;AAC3F,MAAM,UAAU,YAAY;IAC1B,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 = 'graft' | 'source';
|
|
4
|
+
/** An MCP-style tool name (server-prefixed), as opposed to a native Read/Shell.
|
|
5
|
+
* Used to hand graft 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 graft's MCP tools, across every host prefix.
|
|
10
|
+
* Anchored on the real name list (`graft_find_code`, its legacy aliases, …), not
|
|
11
|
+
* a loose `includes('graft')`: a third-party MCP tool whose name merely contains
|
|
12
|
+
* "graft" (or a repo working on graft itself) must not count as a graft read —
|
|
13
|
+
* the same care `commandInvokesGraft` takes for the CLI side. Strips the host
|
|
14
|
+
* prefix first (`mcp__graft__graft_find_code`, `MCP:graft_find_code`) by taking
|
|
15
|
+
* the last delimited segment. */
|
|
16
|
+
export declare function isGraftMcpTool(toolName: string): boolean;
|
|
17
|
+
/** Whether a shell command line invokes the CLI under either name (any of its install shapes). */
|
|
18
|
+
export declare function commandInvokesGraft(command: string): boolean;
|
|
19
|
+
/**
|
|
20
|
+
* Classify one tool use as a graft 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 `[graft] 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
|
+
/** 'graft' → graftReads++, '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 `graft 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,OAAO,GAAG,QAAQ,CAAC;AAc1C;;6EAE6E;AAC7E,wBAAgB,aAAa,CAAC,QAAQ,EAAE,MAAM,GAAG,OAAO,CAGvD;AAED;;;;;;;iCAOiC;AACjC,wBAAgB,cAAc,CAAC,QAAQ,EAAE,MAAM,GAAG,OAAO,CAIxD;AAED,kGAAkG;AAClG,wBAAgB,mBAAmB,CAAC,OAAO,EAAE,MAAM,GAAG,OAAO,CAQ5D;AAED;;;;GAIG;AACH,wBAAgB,eAAe,CAAC,QAAQ,CAAC,EAAE,MAAM,EAAE,OAAO,CAAC,EAAE,MAAM,GAAG,QAAQ,GAAG,IAAI,CAOpF;AAED;;yCAEyC;AACzC,wBAAgB,YAAY,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM,CAEjD;AAED,MAAM,WAAW,OAAO;IACtB,+EAA+E;IAC/E,IAAI,CAAC,EAAE,QAAQ,GAAG,IAAI,CAAC;IACvB,sFAAsF;IACtF,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB;0FACsF;IACtF,IAAI,CAAC,EAAE,SAAS,CAAC;CAClB;AAED;;;;;;;;;;;GAWG;AACH,wBAAgB,aAAa,CAAC,GAAG,EAAE,MAAM,EAAE,SAAS,EAAE,MAAM,EAAE,GAAG,EAAE,OAAO,GAAG,IAAI,CAehF;AAED,MAAM,WAAW,cAAe,SAAQ,YAAY;IAClD,EAAE,EAAE,MAAM,CAAC;CACZ;AAED;yEACyE;AACzE,wBAAgB,aAAa,CAAC,GAAG,EAAE,MAAM,GAAG,cAAc,GAAG,IAAI,CAWhE;AAED;;;;GAIG;AACH;;;;;;;;GAQG;AACH,wBAAgB,gBAAgB,CAAC,GAAG,EAAE,MAAM,GAAG,MAAM,GAAG,IAAI,CAO3D;AAED,wBAAgB,kBAAkB,CAAC,CAAC,EAAE,cAAc,GAAG,IAAI,GAAG,MAAM,CAwBnE"}
|
|
@@ -0,0 +1,209 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Session usage accounting, shared across every host (Claude Code, Cursor, and
|
|
3
|
+
* plain MCP). It answers the one question the README rests on: when an agent had
|
|
4
|
+
* both graft and grep in front of it, which did it reach for, and how much did
|
|
5
|
+
* that save?
|
|
6
|
+
*
|
|
7
|
+
* The counters (`graftReads`, `sourceReads`, `savedTokens`) already live on
|
|
8
|
+
* {@link SessionState}; before this module nothing ever incremented the first
|
|
9
|
+
* two, so `session_summary` telemetry shipped 0/0 for every session. Everything
|
|
10
|
+
* here is a pure classify + read-modify-write over `graft/.cache/session/`, so a
|
|
11
|
+
* host adapter is a few lines: parse its payload, call {@link recordToolUse}.
|
|
12
|
+
*
|
|
13
|
+
* Two payload shapes feed it, confirmed against the vendor docs rather than
|
|
14
|
+
* guessed (the matcher depends on getting the names right):
|
|
15
|
+
*
|
|
16
|
+
* - Claude Code `PostToolUse` — `{ tool_name, tool_input: { command }, tool_response }`.
|
|
17
|
+
* A graft retrieval prints a `[graft] tokens saved ≈ N` footer into
|
|
18
|
+
* `tool_response`, which is itself proof graft ran.
|
|
19
|
+
* - Cursor `postToolUse` — `{ tool_name, tool_input, tool_output, conversation_id }`
|
|
20
|
+
* (https://cursor.com/docs/hooks). `tool_output` is the JSON-stringified
|
|
21
|
+
* result; a Shell `graft …` call carries the same footer inside its stdout.
|
|
22
|
+
* - Cursor `afterMCPExecution` — `{ tool_name, tool_input, result_json, duration }`.
|
|
23
|
+
* Fires only for MCP tools, so a graft tool is recognised by its name and
|
|
24
|
+
* its savings read out of `result_json`.
|
|
25
|
+
*
|
|
26
|
+
* MCP tool names arrive host-prefixed in different shapes (`graft_find_code`,
|
|
27
|
+
* `MCP:graft_find_code`, `mcp__graft__graft_find_code`). {@link isGraftMcpTool}
|
|
28
|
+
* strips the prefix to the last delimited segment and checks it against the real
|
|
29
|
+
* name list (`GRAFT_MCP_TOOL_NAMES`), so a graft tool is recognised across every
|
|
30
|
+
* host format while a third-party tool that merely contains "graft" is not.
|
|
31
|
+
*/
|
|
32
|
+
import { statSync } from 'node:fs';
|
|
33
|
+
import { join } from 'node:path';
|
|
34
|
+
import { sumSavingsFooters } from '../context/savings.js';
|
|
35
|
+
import { dollarsSaved, formatDollars } from '../context/price.js';
|
|
36
|
+
import { readSession, writeSession, sessionDir, listSessionIds } from './state.js';
|
|
37
|
+
import { GRAFT_MCP_TOOL_NAMES } from '../mcp/tool-names.js';
|
|
38
|
+
import { brand, cmd } from '../brand.js';
|
|
39
|
+
/** Native tools that mean "the agent went to read source itself" — the grep/read
|
|
40
|
+
* path graft is meant to replace. These are the host tool NAMES (Claude Code and
|
|
41
|
+
* Cursor both use Read/Grep/Glob; Cursor adds Search); shell builtins like `ls`
|
|
42
|
+
* are commands, never tool names, so they belong to the Shell branch, not here.
|
|
43
|
+
* Compared lower-cased. */
|
|
44
|
+
const SOURCE_TOOLS = new Set(['read', 'grep', 'glob', 'search']);
|
|
45
|
+
/** The host's shell tool, whose `command` we then inspect for a graft invocation. */
|
|
46
|
+
function isShellTool(t) {
|
|
47
|
+
return t === 'bash' || t === 'shell';
|
|
48
|
+
}
|
|
49
|
+
/** An MCP-style tool name (server-prefixed), as opposed to a native Read/Shell.
|
|
50
|
+
* Used to hand graft MCP calls to the dedicated MCP hook so a host that fires
|
|
51
|
+
* BOTH a generic post-tool hook and an MCP hook can't double-count them. */
|
|
52
|
+
export function isMcpToolName(toolName) {
|
|
53
|
+
const t = toolName.toLowerCase();
|
|
54
|
+
return t.startsWith('mcp') || t.includes(':') || t.includes('__');
|
|
55
|
+
}
|
|
56
|
+
/**
|
|
57
|
+
* Whether a tool name is one of graft's MCP tools, across every host prefix.
|
|
58
|
+
* Anchored on the real name list (`graft_find_code`, its legacy aliases, …), not
|
|
59
|
+
* a loose `includes('graft')`: a third-party MCP tool whose name merely contains
|
|
60
|
+
* "graft" (or a repo working on graft itself) must not count as a graft read —
|
|
61
|
+
* the same care `commandInvokesGraft` takes for the CLI side. Strips the host
|
|
62
|
+
* prefix first (`mcp__graft__graft_find_code`, `MCP:graft_find_code`) by taking
|
|
63
|
+
* the last delimited segment. */
|
|
64
|
+
export function isGraftMcpTool(toolName) {
|
|
65
|
+
const t = toolName.toLowerCase();
|
|
66
|
+
const bare = t.split(/[:./]|__/).pop() ?? t;
|
|
67
|
+
return GRAFT_MCP_TOOL_NAMES.has(bare);
|
|
68
|
+
}
|
|
69
|
+
/** Whether a shell command line invokes the CLI under either name (any of its install shapes). */
|
|
70
|
+
export function commandInvokesGraft(command) {
|
|
71
|
+
const c = command.trim();
|
|
72
|
+
// running from a source checkout
|
|
73
|
+
if (/dist[/\\](cli|bin[/\\](trail|graft))\.js/.test(c))
|
|
74
|
+
return true;
|
|
75
|
+
// `graft …`, `graft-dev …`, `npx [-y] [@nanonets/]graft …`, and the same for
|
|
76
|
+
// `trail` / `@trailhq/trail-code`, at the start of the line or of a &&/;/| segment —
|
|
77
|
+
// not "mygraft" or a path that merely contains it.
|
|
78
|
+
return /(^|[|&;]\s*)(npx\s+(-y\s+)?(@nanonets\/|@trailhq\/)?)?(graft|trail)(-dev)?\b/i.test(c);
|
|
79
|
+
}
|
|
80
|
+
/**
|
|
81
|
+
* Classify one tool use as a graft retrieval, a source read, or neither
|
|
82
|
+
* (an edit, a task spawn, an unrelated shell command — no retrieval signal).
|
|
83
|
+
* `command` is the shell command line when `toolName` is the host's shell tool.
|
|
84
|
+
*/
|
|
85
|
+
export function classifyToolUse(toolName, command) {
|
|
86
|
+
const t = (toolName ?? '').toLowerCase();
|
|
87
|
+
if (!t)
|
|
88
|
+
return null;
|
|
89
|
+
if (isGraftMcpTool(t))
|
|
90
|
+
return 'graft';
|
|
91
|
+
if (SOURCE_TOOLS.has(t))
|
|
92
|
+
return 'source';
|
|
93
|
+
if (isShellTool(t) && command && commandInvokesGraft(command))
|
|
94
|
+
return 'graft';
|
|
95
|
+
return null;
|
|
96
|
+
}
|
|
97
|
+
/** Sum every `[graft] tokens saved ≈ N` footer in a blob of tool output. Thin
|
|
98
|
+
* alias over {@link sumSavingsFooters}, which lives next to the code that writes
|
|
99
|
+
* the footer so the two can't drift. */
|
|
100
|
+
export function parseSavings(blob) {
|
|
101
|
+
return sumSavingsFooters(blob);
|
|
102
|
+
}
|
|
103
|
+
/**
|
|
104
|
+
* Fold one tool use into a session's counters. A no-op when there is nothing to
|
|
105
|
+
* record (kind null and no savings), so a host can call it unconditionally after
|
|
106
|
+
* every tool without first checking whether the tool was interesting — the
|
|
107
|
+
* no-write path is what keeps it cheap on the Write/Edit/Task majority.
|
|
108
|
+
*
|
|
109
|
+
* Best-effort read-modify-write, not locked — mirroring `patchStats` in
|
|
110
|
+
* util/state.ts. Two tool-use hooks racing on the same session file can lose a
|
|
111
|
+
* count; that is acceptable for an episodic usage estimate (worst case is an
|
|
112
|
+
* undercount by one, never corruption thanks to the atomic write), and a lock
|
|
113
|
+
* here would contend with the build lock these hooks also touch.
|
|
114
|
+
*/
|
|
115
|
+
export function recordToolUse(dir, sessionId, use) {
|
|
116
|
+
const saved = use.savedTokens ?? 0;
|
|
117
|
+
if (!use.kind && saved <= 0)
|
|
118
|
+
return;
|
|
119
|
+
const id = sessionId || 'default';
|
|
120
|
+
const s = readSession(dir, id);
|
|
121
|
+
if (use.kind === 'graft')
|
|
122
|
+
s.graftReads = (s.graftReads ?? 0) + 1;
|
|
123
|
+
else if (use.kind === 'source')
|
|
124
|
+
s.sourceReads = (s.sourceReads ?? 0) + 1;
|
|
125
|
+
if (saved > 0)
|
|
126
|
+
s.savedTokens = (s.savedTokens ?? 0) + saved;
|
|
127
|
+
// A graft use owes a tally in this turn's reply; the Stop hook (countTallyTurn)
|
|
128
|
+
// resolves whether it got one and clears the flag. A flag, not a count — a turn
|
|
129
|
+
// with several graft calls is still one reply to the user.
|
|
130
|
+
if (use.kind === 'graft')
|
|
131
|
+
s.turnUsedGraft = true;
|
|
132
|
+
// Stamp the host once; the first tool use that lands owns the attribution.
|
|
133
|
+
if (use.host && !s.host)
|
|
134
|
+
s.host = use.host;
|
|
135
|
+
writeSession(dir, id, s);
|
|
136
|
+
}
|
|
137
|
+
/** The most-recently-touched session file for a repo, or null when none exist —
|
|
138
|
+
* what `graft stats` shows by default: the session you were just in. */
|
|
139
|
+
export function latestSession(dir) {
|
|
140
|
+
const sdir = sessionDir(dir);
|
|
141
|
+
let bestId = null;
|
|
142
|
+
let bestMtime = -Infinity;
|
|
143
|
+
for (const id of listSessionIds(dir)) {
|
|
144
|
+
let mtime;
|
|
145
|
+
try {
|
|
146
|
+
mtime = statSync(join(sdir, `${id}.json`)).mtimeMs;
|
|
147
|
+
}
|
|
148
|
+
catch {
|
|
149
|
+
continue;
|
|
150
|
+
}
|
|
151
|
+
if (mtime > bestMtime) {
|
|
152
|
+
bestMtime = mtime;
|
|
153
|
+
bestId = id;
|
|
154
|
+
}
|
|
155
|
+
}
|
|
156
|
+
if (bestId === null)
|
|
157
|
+
return null;
|
|
158
|
+
return { id: bestId, ...readSession(dir, bestId) };
|
|
159
|
+
}
|
|
160
|
+
/**
|
|
161
|
+
* A one-line-per-fact readout of a session's usage mix — Cursor has no
|
|
162
|
+
* statusline, so this is how you see the numbers the Claude Code bar would show.
|
|
163
|
+
* Reads local JSON only; sends nothing.
|
|
164
|
+
*/
|
|
165
|
+
/**
|
|
166
|
+
* What this repo's most recent session has actually been paying per million
|
|
167
|
+
* input tokens, or null when no turn has been billed yet.
|
|
168
|
+
*
|
|
169
|
+
* `latestSession` rather than a session id because the callers are CLI and MCP
|
|
170
|
+
* processes answering one query: they know the repo, never the host's session
|
|
171
|
+
* id. The rate belongs to the repo's current session, which is the one whose
|
|
172
|
+
* reply the number is about to appear in.
|
|
173
|
+
*/
|
|
174
|
+
export function sessionInputRate(dir) {
|
|
175
|
+
const s = latestSession(dir);
|
|
176
|
+
if (!s?.inputCostMicros || !s?.inputTokensBilled)
|
|
177
|
+
return null;
|
|
178
|
+
// Micro-dollars per token and dollars per million tokens are the same number:
|
|
179
|
+
// both divide by 1e6 once. Returned as $/Mtok because that is the unit the
|
|
180
|
+
// price table is written in and the one a reader can sanity-check against it.
|
|
181
|
+
return s.inputCostMicros / s.inputTokensBilled;
|
|
182
|
+
}
|
|
183
|
+
export function formatSessionStats(s) {
|
|
184
|
+
if (s === null) {
|
|
185
|
+
return `${cmd('graft stats')}: no session recorded yet. Use ${brand()} in an agent session, then look again.`;
|
|
186
|
+
}
|
|
187
|
+
const graft = s.graftReads ?? 0;
|
|
188
|
+
const source = s.sourceReads ?? 0;
|
|
189
|
+
const saved = s.savedTokens ?? 0;
|
|
190
|
+
const total = graft + source;
|
|
191
|
+
const mix = total === 0 ? 'no retrieval yet' : `${Math.round((graft / total) * 100)}% graft`;
|
|
192
|
+
const lines = [
|
|
193
|
+
`${cmd('graft stats')}: session ${s.id}`,
|
|
194
|
+
` graft reads: ${graft}`,
|
|
195
|
+
` source reads: ${source} (Read / Grep / Glob)`,
|
|
196
|
+
` mix: ${mix}`,
|
|
197
|
+
` tokens saved: ~${saved.toLocaleString()}`,
|
|
198
|
+
];
|
|
199
|
+
// Omitted, not zeroed, when no turn has been billed yet: a host whose hooks
|
|
200
|
+
// name no transcript can't know what a token costs here, and a made-up rate
|
|
201
|
+
// would be worse than the silence.
|
|
202
|
+
const usd = dollarsSaved(saved, s.inputCostMicros, s.inputTokensBilled);
|
|
203
|
+
if (usd !== null)
|
|
204
|
+
lines.push(` value saved: ~${formatDollars(usd)}`);
|
|
205
|
+
if (s.promptAsks)
|
|
206
|
+
lines.push(` prompts asked: ${s.promptAsks}`);
|
|
207
|
+
return lines.join('\n');
|
|
208
|
+
}
|
|
209
|
+
//# sourceMappingURL=session-metrics.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"session-metrics.js","sourceRoot":"","sources":["../../src/claude/session-metrics.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA8BG;AACH,OAAO,EAAE,QAAQ,EAAE,MAAM,SAAS,CAAC;AACnC,OAAO,EAAE,IAAI,EAAE,MAAM,WAAW,CAAC;AACjC,OAAO,EAAE,iBAAiB,EAAE,MAAM,uBAAuB,CAAC;AAC1D,OAAO,EAAE,YAAY,EAAE,aAAa,EAAE,MAAM,qBAAqB,CAAC;AAClE,OAAO,EAAE,WAAW,EAAE,YAAY,EAAE,UAAU,EAAE,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,KAAK,IAAI;QAAE,KAAK,CAAC,IAAI,CAAC,qBAAqB,aAAa,CAAC,GAAG,CAAC,EAAE,CAAC,CAAC;IACxE,IAAI,CAAC,CAAC,UAAU;QAAE,KAAK,CAAC,IAAI,CAAC,oBAAoB,CAAC,CAAC,UAAU,EAAE,CAAC,CAAC;IACjE,OAAO,KAAK,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;AAC1B,CAAC"}
|
|
@@ -0,0 +1,76 @@
|
|
|
1
|
+
type Json = Record<string, any>;
|
|
2
|
+
/**
|
|
3
|
+
* A hook command that exits 0 whatever happens to it (every event since D116 item 6; PreToolUse first, for this). Copilot CLI reads
|
|
4
|
+
* the repo's `.claude/settings.json` and denies the tool call when a
|
|
5
|
+
* PreToolUse hook exits non-zero, so a shim that can't be found (a host
|
|
6
|
+
* started in a subfolder without CLAUDE_PROJECT_DIR, the shim gone after an
|
|
7
|
+
* uninstall) or a missing node would deny every shell command. `|| exit 0`
|
|
8
|
+
* means the same in sh and Windows cmd. The hook's answer travels as JSON on
|
|
9
|
+
* stdout, never as an exit code, so nothing is lost by it.
|
|
10
|
+
*/
|
|
11
|
+
export declare function failOpen(command: string): string;
|
|
12
|
+
/** trail's committed hook, `.trail/hook.cjs`, run for one event. */
|
|
13
|
+
export declare function trailHookCmd(arg: string): string;
|
|
14
|
+
/**
|
|
15
|
+
* Is this allowlist entry one graft wrote?
|
|
16
|
+
*
|
|
17
|
+
* Scoped to the forms graft is actually invoked as — NOT any rule mentioning
|
|
18
|
+
* "graft". A user who allowlists their own `Bash(graft-mytool:*)` keeps it; only
|
|
19
|
+
* graft's own set is replaced, which is what lets a renamed entry disappear on
|
|
20
|
+
* upgrade instead of accumulating beside its replacement.
|
|
21
|
+
*/
|
|
22
|
+
export declare function isGraftAllowEntry(entry: unknown): boolean;
|
|
23
|
+
/** Is this footer regex graft's? It points at the card tree, which is graft's alone. */
|
|
24
|
+
export declare function isGraftFooterRegex(re: unknown): boolean;
|
|
25
|
+
/** True when init should write (or refresh) Graft's Claude Code statusLine. */
|
|
26
|
+
export declare function statuslineWanted(opts?: {
|
|
27
|
+
statusline?: boolean;
|
|
28
|
+
}): boolean;
|
|
29
|
+
export declare function mergeGraftSettings(existing: Json, opts?: {
|
|
30
|
+
statusline?: boolean;
|
|
31
|
+
name?: 'graft' | 'trail';
|
|
32
|
+
}): {
|
|
33
|
+
merged: Json;
|
|
34
|
+
warnings: string[];
|
|
35
|
+
};
|
|
36
|
+
/**
|
|
37
|
+
* The hook blocks alone, merged into a settings file, with the shims addressed by
|
|
38
|
+
* absolute path — `~/.claude/settings.json`, where a write reaches every project on
|
|
39
|
+
* the machine (see hosts/claude-global.ts for why that copy has to exist).
|
|
40
|
+
*
|
|
41
|
+
* Hooks only, deliberately. `mergeGraftSettings` also claims the statusline, the
|
|
42
|
+
* footer regex and a Bash allowlist, and each of those is a reasonable thing to
|
|
43
|
+
* accept for a repo you ran `graft init` in and an unreasonable thing to impose on
|
|
44
|
+
* every repo you ever open — a statusline especially, since a session allows exactly
|
|
45
|
+
* one and taking it globally would silently outrank the user's own. The hooks are the
|
|
46
|
+
* piece that has to be global, because they are what a worktree loses.
|
|
47
|
+
*
|
|
48
|
+
* Same idempotent shape as the repo merge: graft's prior entries are dropped before
|
|
49
|
+
* the current set is added, so re-running converges instead of stacking.
|
|
50
|
+
*/
|
|
51
|
+
export declare function mergeGraftHooks(existing: Json, helpers: string): {
|
|
52
|
+
merged: Json;
|
|
53
|
+
};
|
|
54
|
+
/**
|
|
55
|
+
* trail's part of the committed `.claude/settings.json`: one SessionStart entry
|
|
56
|
+
* running `.trail/hook.cjs`, and nothing else. For a teammate without trail it
|
|
57
|
+
* shows the learnings and offers trail; with trail it hands off to the install.
|
|
58
|
+
* Anything an older init put here (status line, the other hooks, allowlist,
|
|
59
|
+
* footer regex) comes out, so the file a team commits is the same on every machine.
|
|
60
|
+
*/
|
|
61
|
+
export declare function mergeTrailShared(existing: Json): Json;
|
|
62
|
+
/**
|
|
63
|
+
* trail's part of `.claude/settings.local.json`, the person's own: the status
|
|
64
|
+
* line, the footer regex and the allowlist, plus, when `~/.claude` doesn't carry
|
|
65
|
+
* them (`--no-global`), the hooks for every event but session start, which the
|
|
66
|
+
* shared file already runs once.
|
|
67
|
+
*/
|
|
68
|
+
export declare function mergeTrailLocal(existing: Json, opts?: {
|
|
69
|
+
statusline?: boolean;
|
|
70
|
+
hooks?: boolean;
|
|
71
|
+
}): {
|
|
72
|
+
merged: Json;
|
|
73
|
+
warnings: string[];
|
|
74
|
+
};
|
|
75
|
+
export {};
|
|
76
|
+
//# sourceMappingURL=settings-merge.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"settings-merge.d.ts","sourceRoot":"","sources":["../../src/claude/settings-merge.ts"],"names":[],"mappings":"AAEA,KAAK,IAAI,GAAG,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,CAAC;AAmChC;;;;;;;;GAQG;AACH,wBAAgB,QAAQ,CAAC,OAAO,EAAE,MAAM,GAAG,MAAM,CAEhD;AACD,oEAAoE;AACpE,wBAAgB,YAAY,CAAC,GAAG,EAAE,MAAM,GAAG,MAAM,CAEhD;AAsDD;;;;;;;GAOG;AACH,wBAAgB,iBAAiB,CAAC,KAAK,EAAE,OAAO,GAAG,OAAO,CAEzD;AAED,wFAAwF;AACxF,wBAAgB,kBAAkB,CAAC,EAAE,EAAE,OAAO,GAAG,OAAO,CAEvD;AAOD,+EAA+E;AAC/E,wBAAgB,gBAAgB,CAAC,IAAI,GAAE;IAAE,UAAU,CAAC,EAAE,OAAO,CAAA;CAAO,GAAG,OAAO,CAE7E;AA8BD,wBAAgB,kBAAkB,CAChC,QAAQ,EAAE,IAAI,EACd,IAAI,GAAE;IAAE,UAAU,CAAC,EAAE,OAAO,CAAC;IAAC,IAAI,CAAC,EAAE,OAAO,GAAG,OAAO,CAAA;CAAO,GAC5D;IAAE,MAAM,EAAE,IAAI,CAAC;IAAC,QAAQ,EAAE,MAAM,E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