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,51 @@
|
|
|
1
|
+
; Gleam tags for graft's generic breadth tier. Gleam v1 syntax: the pre-1.0
|
|
2
|
+
; `external fn` / `external type` declarations are gone, replaced by an
|
|
3
|
+
; `@external` attribute that parses as a sibling `attribute` node beside an
|
|
4
|
+
; ordinary `function` — so the rules below already cover it.
|
|
5
|
+
;
|
|
6
|
+
; Qualified calls (`list.map(…)`) are deliberately NOT captured here. The
|
|
7
|
+
; grammar gives only the bare label (`map`), and since EVERY stdlib call in
|
|
8
|
+
; Gleam is spelled that way, a bare-name edge collides with in-repo names
|
|
9
|
+
; constantly. generic.ts's Gleam pass re-reads those calls alongside the file's
|
|
10
|
+
; import table, where the qualifier can be tied to the module it names.
|
|
11
|
+
|
|
12
|
+
(function name: (identifier) @name) @definition.function
|
|
13
|
+
|
|
14
|
+
(constant name: (identifier) @name) @definition.constant
|
|
15
|
+
|
|
16
|
+
(type_definition
|
|
17
|
+
(type_name
|
|
18
|
+
name: (type_identifier) @name)) @definition.type
|
|
19
|
+
|
|
20
|
+
(type_alias
|
|
21
|
+
(type_name
|
|
22
|
+
name: (type_identifier) @name)) @definition.type
|
|
23
|
+
|
|
24
|
+
; A data constructor IS a function in Gleam — `Busy(since: 0)` applies it and
|
|
25
|
+
; `list.map(xs, Some)` passes it as a value. Capturing it keeps a custom type's
|
|
26
|
+
; variants findable by name and gives construction sites something to point at.
|
|
27
|
+
(data_constructor
|
|
28
|
+
name: (constructor_name) @name) @definition.function
|
|
29
|
+
|
|
30
|
+
(function_call
|
|
31
|
+
function: (identifier) @name) @reference.call
|
|
32
|
+
|
|
33
|
+
; Construction, record update and destructuring all name a constructor. The
|
|
34
|
+
; first two apply it; the third takes it apart, which is the same dependency on
|
|
35
|
+
; the same callable — the breadth tier records all three as call edges, so a
|
|
36
|
+
; type that is only ever matched on does not read as unused.
|
|
37
|
+
(record
|
|
38
|
+
name: (constructor_name) @name) @reference.call
|
|
39
|
+
|
|
40
|
+
(record_update
|
|
41
|
+
constructor: (constructor_name) @name) @reference.call
|
|
42
|
+
|
|
43
|
+
(record_pattern
|
|
44
|
+
name: (constructor_name) @name) @reference.call
|
|
45
|
+
|
|
46
|
+
; A type annotation is the only thing that ever names a Gleam type outside its
|
|
47
|
+
; own declaration, so without this a custom type is an orphan no matter how
|
|
48
|
+
; widely it is used. `type_name` (the declaration's own name) is a different node
|
|
49
|
+
; and is not matched here; builtins like `Int` resolve to nothing and drop.
|
|
50
|
+
(type
|
|
51
|
+
name: (type_identifier) @name) @reference.class
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
(class_declaration
|
|
2
|
+
name: (identifier) @name) @definition.class
|
|
3
|
+
|
|
4
|
+
(method_declaration
|
|
5
|
+
name: (identifier) @name) @definition.method
|
|
6
|
+
|
|
7
|
+
(method_invocation
|
|
8
|
+
name: (identifier) @name
|
|
9
|
+
arguments: (argument_list) @reference.call)
|
|
10
|
+
|
|
11
|
+
(interface_declaration
|
|
12
|
+
name: (identifier) @name) @definition.interface
|
|
13
|
+
|
|
14
|
+
(type_list
|
|
15
|
+
(type_identifier) @name) @reference.implementation
|
|
16
|
+
|
|
17
|
+
(object_creation_expression
|
|
18
|
+
type: (type_identifier) @name) @reference.class
|
|
19
|
+
|
|
20
|
+
(superclass (type_identifier) @name) @reference.class
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
; Classes
|
|
2
|
+
(class_declaration
|
|
3
|
+
(type_identifier) @name) @definition.class
|
|
4
|
+
|
|
5
|
+
; Objects
|
|
6
|
+
(object_declaration
|
|
7
|
+
(type_identifier) @name) @definition.class
|
|
8
|
+
|
|
9
|
+
; Functions (top-level and member)
|
|
10
|
+
(function_declaration
|
|
11
|
+
(simple_identifier) @name) @definition.function
|
|
12
|
+
|
|
13
|
+
; Properties
|
|
14
|
+
(property_declaration
|
|
15
|
+
(variable_declaration
|
|
16
|
+
(simple_identifier) @name)) @definition.constant
|
|
17
|
+
|
|
18
|
+
; Enum entries
|
|
19
|
+
(enum_entry
|
|
20
|
+
(simple_identifier) @name) @definition.constant
|
|
21
|
+
|
|
22
|
+
; Type aliases
|
|
23
|
+
(type_alias
|
|
24
|
+
(type_identifier) @name) @definition.type
|
|
25
|
+
|
|
26
|
+
; Companion objects (only named ones)
|
|
27
|
+
(companion_object
|
|
28
|
+
(type_identifier) @name) @definition.class
|
|
29
|
+
|
|
30
|
+
; Function calls
|
|
31
|
+
(call_expression
|
|
32
|
+
(simple_identifier) @name) @reference.call
|
|
33
|
+
|
|
34
|
+
; Method calls via navigation
|
|
35
|
+
(call_expression
|
|
36
|
+
(navigation_expression
|
|
37
|
+
(navigation_suffix
|
|
38
|
+
(simple_identifier) @name))) @reference.call
|
|
39
|
+
|
|
40
|
+
; Constructor invocations (class references)
|
|
41
|
+
(constructor_invocation
|
|
42
|
+
(user_type
|
|
43
|
+
(type_identifier) @name)) @reference.class
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
(function_declaration
|
|
2
|
+
name: [
|
|
3
|
+
(identifier) @name
|
|
4
|
+
(dot_index_expression
|
|
5
|
+
field: (identifier) @name)
|
|
6
|
+
]) @definition.function
|
|
7
|
+
|
|
8
|
+
(function_declaration
|
|
9
|
+
name: (method_index_expression
|
|
10
|
+
method: (identifier) @name)) @definition.method
|
|
11
|
+
|
|
12
|
+
(assignment_statement
|
|
13
|
+
(variable_list
|
|
14
|
+
.
|
|
15
|
+
name: [
|
|
16
|
+
(identifier) @name
|
|
17
|
+
(dot_index_expression
|
|
18
|
+
field: (identifier) @name)
|
|
19
|
+
])
|
|
20
|
+
(expression_list
|
|
21
|
+
.
|
|
22
|
+
value: (function_definition))) @definition.function
|
|
23
|
+
|
|
24
|
+
(table_constructor
|
|
25
|
+
(field
|
|
26
|
+
name: (identifier) @name
|
|
27
|
+
value: (function_definition))) @definition.function
|
|
28
|
+
|
|
29
|
+
(function_call
|
|
30
|
+
name: [
|
|
31
|
+
(identifier) @name
|
|
32
|
+
(dot_index_expression
|
|
33
|
+
field: (identifier) @name)
|
|
34
|
+
(method_index_expression
|
|
35
|
+
method: (identifier) @name)
|
|
36
|
+
]) @reference.call
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
; Nix tags — standard tree-sitter tags convention (@definition.<kind> + @name + @reference.call).
|
|
2
|
+
; Based on upstream tree-sitter-nix queries, extended for graft's breadth tier.
|
|
3
|
+
;
|
|
4
|
+
; Note: `binding` inside `let_expression` cannot have its children matched in
|
|
5
|
+
; tree-sitter queries (parse error), so let-bound variables are NOT captured as
|
|
6
|
+
; @definition. They are still searchable via the file node's residual body.
|
|
7
|
+
|
|
8
|
+
; Function definitions: `name = args: body` or `name = body` (where body is a function)
|
|
9
|
+
(binding
|
|
10
|
+
(attrpath (identifier) @name)
|
|
11
|
+
(function_expression) @definition.function)
|
|
12
|
+
|
|
13
|
+
; Inherit statements: `inherit (source) name1 name2`
|
|
14
|
+
(inherit
|
|
15
|
+
(inherited_attrs (identifier) @name @definition.constant))
|
|
16
|
+
|
|
17
|
+
; Function calls: `function arg` or `function arg1 arg2` (nested apply_expression)
|
|
18
|
+
; Matches e.g. `import ./path` when `import` is applied to arguments.
|
|
19
|
+
(apply_expression
|
|
20
|
+
function: (apply_expression
|
|
21
|
+
function: (variable_expression
|
|
22
|
+
name: (identifier) @name))) @reference.call
|
|
23
|
+
|
|
24
|
+
; Method/attribute calls: `builtins.map`, `pkgs.python3.withPackages`, etc.
|
|
25
|
+
(apply_expression
|
|
26
|
+
function: (select_expression
|
|
27
|
+
attrpath: (attrpath attr: (identifier) @name))) @reference.call
|
|
28
|
+
|
|
29
|
+
; Direct function application: `f arg`
|
|
30
|
+
(apply_expression
|
|
31
|
+
function: (variable_expression
|
|
32
|
+
name: (identifier) @name)) @reference.call
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
(namespace_definition
|
|
2
|
+
name: (namespace_name) @name) @definition.module
|
|
3
|
+
|
|
4
|
+
(interface_declaration
|
|
5
|
+
name: (name) @name) @definition.interface
|
|
6
|
+
|
|
7
|
+
(trait_declaration
|
|
8
|
+
name: (name) @name) @definition.interface
|
|
9
|
+
|
|
10
|
+
(class_declaration
|
|
11
|
+
name: (name) @name) @definition.class
|
|
12
|
+
|
|
13
|
+
(class_interface_clause [(name) (qualified_name)] @name) @reference.implementation
|
|
14
|
+
|
|
15
|
+
(property_declaration
|
|
16
|
+
(property_element (variable_name (name) @name))) @definition.field
|
|
17
|
+
|
|
18
|
+
(function_definition
|
|
19
|
+
name: (name) @name) @definition.function
|
|
20
|
+
|
|
21
|
+
(method_declaration
|
|
22
|
+
name: (name) @name) @definition.function
|
|
23
|
+
|
|
24
|
+
(object_creation_expression
|
|
25
|
+
[
|
|
26
|
+
(qualified_name (name) @name)
|
|
27
|
+
(variable_name (name) @name)
|
|
28
|
+
]) @reference.class
|
|
29
|
+
|
|
30
|
+
(function_call_expression
|
|
31
|
+
function: [
|
|
32
|
+
(qualified_name (name) @name)
|
|
33
|
+
(variable_name (name)) @name
|
|
34
|
+
]) @reference.call
|
|
35
|
+
|
|
36
|
+
(scoped_call_expression
|
|
37
|
+
name: (name) @name) @reference.call
|
|
38
|
+
|
|
39
|
+
(member_call_expression
|
|
40
|
+
name: (name) @name) @reference.call
|
|
@@ -0,0 +1,65 @@
|
|
|
1
|
+
; Method definitions
|
|
2
|
+
|
|
3
|
+
(
|
|
4
|
+
(comment)* @doc
|
|
5
|
+
.
|
|
6
|
+
[
|
|
7
|
+
(method
|
|
8
|
+
name: (_) @name) @definition.method
|
|
9
|
+
(singleton_method
|
|
10
|
+
name: (_) @name) @definition.method
|
|
11
|
+
]
|
|
12
|
+
(#strip! @doc "^#\\s*")
|
|
13
|
+
(#select-adjacent! @doc @definition.method)
|
|
14
|
+
)
|
|
15
|
+
|
|
16
|
+
(alias
|
|
17
|
+
name: (_) @name) @definition.method
|
|
18
|
+
|
|
19
|
+
(setter
|
|
20
|
+
(identifier) @ignore)
|
|
21
|
+
|
|
22
|
+
; Class definitions
|
|
23
|
+
|
|
24
|
+
(
|
|
25
|
+
(comment)* @doc
|
|
26
|
+
.
|
|
27
|
+
[
|
|
28
|
+
(class
|
|
29
|
+
name: [
|
|
30
|
+
(constant) @name
|
|
31
|
+
(scope_resolution
|
|
32
|
+
name: (_) @name)
|
|
33
|
+
]) @definition.class
|
|
34
|
+
(singleton_class
|
|
35
|
+
value: [
|
|
36
|
+
(constant) @name
|
|
37
|
+
(scope_resolution
|
|
38
|
+
name: (_) @name)
|
|
39
|
+
]) @definition.class
|
|
40
|
+
]
|
|
41
|
+
(#strip! @doc "^#\\s*")
|
|
42
|
+
(#select-adjacent! @doc @definition.class)
|
|
43
|
+
)
|
|
44
|
+
|
|
45
|
+
; Module definitions
|
|
46
|
+
|
|
47
|
+
(
|
|
48
|
+
(module
|
|
49
|
+
name: [
|
|
50
|
+
(constant) @name
|
|
51
|
+
(scope_resolution
|
|
52
|
+
name: (_) @name)
|
|
53
|
+
]) @definition.module
|
|
54
|
+
)
|
|
55
|
+
|
|
56
|
+
; Calls
|
|
57
|
+
; NB: only explicit call nodes — the upstream tags.scm also tags bare
|
|
58
|
+
; [(identifier)(constant)] as @reference.call gated by (#is-not? local), but that
|
|
59
|
+
; predicate needs the paired @local.* captures (from locals.scm, which graft does
|
|
60
|
+
; not load) to mean anything. Without them it's a no-op, so bare *variable reads*
|
|
61
|
+
; that share a name with a same-file/unique method become bogus `calls` edges
|
|
62
|
+
; (resolve.ts can't tell a var read from a zero-arg call). Dropped for precision —
|
|
63
|
+
; consistent with every other breadth-tier query (all use explicit call nodes).
|
|
64
|
+
|
|
65
|
+
(call method: (identifier) @name) @reference.call
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
; Rust tags — standard tree-sitter tags convention (@definition.<kind> + @name + @reference.call).
|
|
2
|
+
; Vendored for graft's generic breadth tier. Predicates like (#strip! ...) are
|
|
3
|
+
; sanitized out at load time by generic.ts.
|
|
4
|
+
|
|
5
|
+
(function_item (identifier) @name) @definition.function
|
|
6
|
+
|
|
7
|
+
(function_signature_item (identifier) @name) @definition.function
|
|
8
|
+
|
|
9
|
+
(struct_item (type_identifier) @name) @definition.struct
|
|
10
|
+
|
|
11
|
+
(enum_item (type_identifier) @name) @definition.enum
|
|
12
|
+
|
|
13
|
+
(union_item (type_identifier) @name) @definition.struct
|
|
14
|
+
|
|
15
|
+
(trait_item (type_identifier) @name) @definition.interface
|
|
16
|
+
|
|
17
|
+
(type_item (type_identifier) @name) @definition.type
|
|
18
|
+
|
|
19
|
+
(mod_item (identifier) @name) @definition.module
|
|
20
|
+
|
|
21
|
+
(macro_definition (identifier) @name) @definition.function
|
|
22
|
+
|
|
23
|
+
(const_item (identifier) @name) @definition.constant
|
|
24
|
+
|
|
25
|
+
(static_item (identifier) @name) @definition.constant
|
|
26
|
+
|
|
27
|
+
; associated functions / methods inside impl blocks are function_item too,
|
|
28
|
+
; already captured above; call sites below:
|
|
29
|
+
|
|
30
|
+
(call_expression
|
|
31
|
+
function: [
|
|
32
|
+
(identifier) @name
|
|
33
|
+
(field_expression field: (field_identifier) @name)
|
|
34
|
+
(scoped_identifier name: (identifier) @name)
|
|
35
|
+
]) @reference.call
|
|
36
|
+
|
|
37
|
+
(macro_invocation
|
|
38
|
+
macro: [
|
|
39
|
+
(identifier) @name
|
|
40
|
+
(scoped_identifier name: (identifier) @name)
|
|
41
|
+
]) @reference.call
|
|
@@ -0,0 +1,66 @@
|
|
|
1
|
+
; Definitions
|
|
2
|
+
|
|
3
|
+
(package_clause
|
|
4
|
+
name: (package_identifier) @name) @definition.module
|
|
5
|
+
|
|
6
|
+
(trait_definition
|
|
7
|
+
name: (identifier) @name) @definition.interface
|
|
8
|
+
|
|
9
|
+
(enum_definition
|
|
10
|
+
name: (identifier) @name) @definition.enum
|
|
11
|
+
|
|
12
|
+
(simple_enum_case
|
|
13
|
+
name: (identifier) @name) @definition.class
|
|
14
|
+
|
|
15
|
+
(full_enum_case
|
|
16
|
+
name: (identifier) @name) @definition.class
|
|
17
|
+
|
|
18
|
+
(class_definition
|
|
19
|
+
name: (identifier) @name) @definition.class
|
|
20
|
+
|
|
21
|
+
(object_definition
|
|
22
|
+
name: (identifier) @name) @definition.object
|
|
23
|
+
|
|
24
|
+
(function_definition
|
|
25
|
+
name: (identifier) @name) @definition.function
|
|
26
|
+
|
|
27
|
+
(val_definition
|
|
28
|
+
pattern: (identifier) @name) @definition.variable
|
|
29
|
+
|
|
30
|
+
(given_definition
|
|
31
|
+
name: (identifier) @name) @definition.variable
|
|
32
|
+
|
|
33
|
+
(var_definition
|
|
34
|
+
pattern: (identifier) @name) @definition.variable
|
|
35
|
+
|
|
36
|
+
(val_declaration
|
|
37
|
+
name: (identifier) @name) @definition.variable
|
|
38
|
+
|
|
39
|
+
(var_declaration
|
|
40
|
+
name: (identifier) @name) @definition.variable
|
|
41
|
+
|
|
42
|
+
(type_definition
|
|
43
|
+
name: (type_identifier) @name) @definition.type
|
|
44
|
+
|
|
45
|
+
(class_parameter
|
|
46
|
+
name: (identifier) @name) @definition.property
|
|
47
|
+
|
|
48
|
+
; References
|
|
49
|
+
|
|
50
|
+
(call_expression
|
|
51
|
+
(identifier) @name) @reference.call
|
|
52
|
+
|
|
53
|
+
(instance_expression
|
|
54
|
+
(type_identifier) @name) @reference.interface
|
|
55
|
+
|
|
56
|
+
(instance_expression
|
|
57
|
+
(generic_type
|
|
58
|
+
(type_identifier) @name)) @reference.interface
|
|
59
|
+
|
|
60
|
+
(extends_clause
|
|
61
|
+
(type_identifier) @name) @reference.class
|
|
62
|
+
|
|
63
|
+
(extends_clause
|
|
64
|
+
(generic_type
|
|
65
|
+
(type_identifier) @name)) @reference.class
|
|
66
|
+
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
;; Method and Function declarations
|
|
2
|
+
(contract_declaration (_
|
|
3
|
+
(function_definition
|
|
4
|
+
name: (identifier) @name) @definition.method))
|
|
5
|
+
|
|
6
|
+
(source_file
|
|
7
|
+
(function_definition
|
|
8
|
+
name: (identifier) @name) @definition.function)
|
|
9
|
+
|
|
10
|
+
;; Contract, struct, enum and interface declarations
|
|
11
|
+
(contract_declaration
|
|
12
|
+
name: (identifier) @name) @definition.class
|
|
13
|
+
|
|
14
|
+
(interface_declaration
|
|
15
|
+
name: (identifier) @name) @definition.interface
|
|
16
|
+
|
|
17
|
+
(library_declaration
|
|
18
|
+
name: (identifier) @name) @definition.interface
|
|
19
|
+
|
|
20
|
+
(struct_declaration name: (identifier) @name) @definition.class
|
|
21
|
+
(enum_declaration name: (identifier) @name) @definition.class
|
|
22
|
+
(event_definition name: (identifier) @name) @definition.class
|
|
23
|
+
|
|
24
|
+
;; Function calls
|
|
25
|
+
(call_expression (expression (identifier)) @name ) @reference.call
|
|
26
|
+
|
|
27
|
+
(call_expression
|
|
28
|
+
(expression (member_expression
|
|
29
|
+
property: (_) @name ))) @reference.call
|
|
30
|
+
|
|
31
|
+
;; Log emit
|
|
32
|
+
(emit_statement name: (_) @name) @reference.class
|
|
33
|
+
|
|
34
|
+
|
|
35
|
+
;; Inheritance
|
|
36
|
+
|
|
37
|
+
(inheritance_specifier
|
|
38
|
+
ancestor: (user_defined_type (_) @name . )) @reference.class
|
|
39
|
+
|
|
40
|
+
|
|
41
|
+
;; Imports ( note that unknown is not standardised )
|
|
42
|
+
(import_directive
|
|
43
|
+
import_name: (_) @name ) @reference.unknown
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
(class_declaration
|
|
2
|
+
name: (type_identifier) @name) @definition.class
|
|
3
|
+
|
|
4
|
+
(protocol_declaration
|
|
5
|
+
name: (type_identifier) @name) @definition.interface
|
|
6
|
+
|
|
7
|
+
(class_declaration
|
|
8
|
+
(class_body
|
|
9
|
+
[
|
|
10
|
+
(function_declaration
|
|
11
|
+
name: (simple_identifier) @name
|
|
12
|
+
)
|
|
13
|
+
(subscript_declaration
|
|
14
|
+
(parameter (simple_identifier) @name)
|
|
15
|
+
)
|
|
16
|
+
(init_declaration "init" @name)
|
|
17
|
+
(deinit_declaration "deinit" @name)
|
|
18
|
+
]
|
|
19
|
+
)
|
|
20
|
+
) @definition.method
|
|
21
|
+
|
|
22
|
+
(protocol_declaration
|
|
23
|
+
(protocol_body
|
|
24
|
+
[
|
|
25
|
+
(protocol_function_declaration
|
|
26
|
+
name: (simple_identifier) @name
|
|
27
|
+
)
|
|
28
|
+
(subscript_declaration
|
|
29
|
+
(parameter (simple_identifier) @name)
|
|
30
|
+
)
|
|
31
|
+
(init_declaration "init" @name)
|
|
32
|
+
]
|
|
33
|
+
)
|
|
34
|
+
) @definition.method
|
|
35
|
+
|
|
36
|
+
(class_declaration
|
|
37
|
+
(class_body
|
|
38
|
+
[
|
|
39
|
+
(property_declaration
|
|
40
|
+
(pattern (simple_identifier) @name)
|
|
41
|
+
)
|
|
42
|
+
]
|
|
43
|
+
)
|
|
44
|
+
) @definition.property
|
|
45
|
+
|
|
46
|
+
(property_declaration
|
|
47
|
+
(pattern (simple_identifier) @name)
|
|
48
|
+
) @definition.property
|
|
49
|
+
|
|
50
|
+
(function_declaration
|
|
51
|
+
name: (simple_identifier) @name) @definition.function
|
|
@@ -0,0 +1,106 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* `ensureFreshGraph` — the pre-query gate that keeps retrieval honest.
|
|
3
|
+
*
|
|
4
|
+
* A graph is a set of `file:line` spans for one working tree, so an answer drawn
|
|
5
|
+
* from it is only as honest as its freshness. That cannot be somebody else's job:
|
|
6
|
+
* an edit made outside the agent (your editor, a branch switch, a stash, a merge)
|
|
7
|
+
* sets no flag anywhere. So freshness lives in the query path: every retrieval
|
|
8
|
+
* call probes the working tree (`fingerprint.ts`, ~3ms) and, when something moved,
|
|
9
|
+
* repairs the structural graph. Properties worth keeping:
|
|
10
|
+
*
|
|
11
|
+
* - **$0 and offline.** Tier-1 only — never a summarizer, never `--deep`. Anything
|
|
12
|
+
* that runs without being asked must not spend money.
|
|
13
|
+
* - **Never fatal.** A failed refresh degrades to answering from the graph on
|
|
14
|
+
* disk. A query that works today must not start failing because a rebuild did.
|
|
15
|
+
* - **Never a stampede.** It takes the same `.cache/.sync.lock` a background build
|
|
16
|
+
* takes, so concurrent MCP calls and the rebuild they trigger can't pile up.
|
|
17
|
+
* - **Bounded.** Up to `DRIFT_INLINE_MAX` changed files are re-extracted before
|
|
18
|
+
* answering; more than that is handed to a background rebuild and the answer
|
|
19
|
+
* carries `[stale: N files changed, rebuilding in background]`. A branch switch
|
|
20
|
+
* never blocks a query.
|
|
21
|
+
* - **Writes only what a query reads** (`graphOnly`): the graph, the `ask` sidecar,
|
|
22
|
+
* the freshness record. Not the markdown cards, not `INDEX.md`, not `.gitignore`.
|
|
23
|
+
* Those belong to an explicit `trail build`, so retrieval stays cheap and a read
|
|
24
|
+
* stays a read. `stats.json` is left alone too.
|
|
25
|
+
* - **Lexical here, semantic elsewhere.** The inline repair updates the graph only.
|
|
26
|
+
* The vector index loads an ONNX model, so it refreshes in a detached process
|
|
27
|
+
* (`build-run.ts`) and never on the path that answers.
|
|
28
|
+
*
|
|
29
|
+
* One case is not drift but absence: inside a git worktree there is no graph at all,
|
|
30
|
+
* because `.trail/`/`graft/` is gitignored and so was never checked out. The gate
|
|
31
|
+
* covers that too — it copies the parent checkout's graph in (`./seed.ts`) and then
|
|
32
|
+
* treats the difference between the two checkouts as ordinary drift, which is
|
|
33
|
+
* exactly what it is.
|
|
34
|
+
*
|
|
35
|
+
* The other absence is a repo this machine never built: `trail init` ran somewhere
|
|
36
|
+
* else, or the clone is new. Its queries find no code and the agent goes back to
|
|
37
|
+
* grep for the rest of the session. So the first query there starts a full build in
|
|
38
|
+
* the background and waits a while for it (`buildMissingMap`).
|
|
39
|
+
*/
|
|
40
|
+
import { type Drift } from "./fingerprint.js";
|
|
41
|
+
/**
|
|
42
|
+
* Most files a query will re-extract before answering, instead of handing the
|
|
43
|
+
* rebuild to a background process.
|
|
44
|
+
*
|
|
45
|
+
* A constant, not a flag: a merge or an ordinary edit of a handful of files stays
|
|
46
|
+
* well under it and gets answered from a current graph; a branch switch or a fresh
|
|
47
|
+
* clone blows past it, and blocking that query to re-parse hundreds of files is
|
|
48
|
+
* exactly the cost this gate exists to avoid. See design decision 5.
|
|
49
|
+
*/
|
|
50
|
+
export declare const DRIFT_INLINE_MAX = 50;
|
|
51
|
+
export interface RefreshResult {
|
|
52
|
+
/** True when the graph on disk was rebuilt by this call. */
|
|
53
|
+
refreshed: boolean;
|
|
54
|
+
/** What the probe found, when it ran and found something. */
|
|
55
|
+
drift?: Drift;
|
|
56
|
+
/**
|
|
57
|
+
* How many files changed when the drift was too large to patch inline, so the
|
|
58
|
+
* rebuild went to the background and this answer is about the graph as it was.
|
|
59
|
+
*/
|
|
60
|
+
stale?: number;
|
|
61
|
+
/** One-line explanation for the agent/user, when there's something worth saying. */
|
|
62
|
+
note?: string;
|
|
63
|
+
}
|
|
64
|
+
export interface RefreshOptions {
|
|
65
|
+
contextDir?: string;
|
|
66
|
+
/** Skip everything (the `--no-refresh` flag). */
|
|
67
|
+
disabled?: boolean;
|
|
68
|
+
/** How long to wait for a first build of a repo on trail; 0 starts it and answers
|
|
69
|
+
* at once. Default `GRAFT_FIRST_BUILD_WAIT_MS`, else FIRST_BUILD_WAIT_MS. */
|
|
70
|
+
firstBuildWaitMs?: number;
|
|
71
|
+
}
|
|
72
|
+
/**
|
|
73
|
+
* Release the lock if this process is asked to die while holding it. Returns the
|
|
74
|
+
* un-hook.
|
|
75
|
+
*
|
|
76
|
+
* Not hypothetical: the Claude Code prompt hook runs `graft ask` with a timeout, and
|
|
77
|
+
* `execFileSync` enforces it with SIGTERM. Node's default disposition for SIGTERM is
|
|
78
|
+
* to exit without unwinding, so the `finally` below never runs and the lock outlives
|
|
79
|
+
* the process — after which the background sync is blocked and every query waits and
|
|
80
|
+
* then answers stale until the lock ages out. Ctrl-C on a CLI query is the same story
|
|
81
|
+
* with SIGINT.
|
|
82
|
+
*
|
|
83
|
+
* Adding a listener replaces that default disposition, so re-raise it explicitly
|
|
84
|
+
* afterwards: remove ourselves, then `process.kill(process.pid, sig)`, so the exit
|
|
85
|
+
* status still says "terminated by signal" for whoever is waiting on us.
|
|
86
|
+
*/
|
|
87
|
+
export declare function releaseOnSignal(cache: string): () => void;
|
|
88
|
+
/**
|
|
89
|
+
* Rebuild `root`'s structural graph if the working tree has moved since the last
|
|
90
|
+
* build. Cheap and side-effect-free when nothing changed, which is the usual case.
|
|
91
|
+
*
|
|
92
|
+
* `root` is the repository root (the same value the query itself is given), not
|
|
93
|
+
* the context dir.
|
|
94
|
+
*/
|
|
95
|
+
export declare function ensureFreshGraph(root: string, opts?: RefreshOptions): Promise<RefreshResult>;
|
|
96
|
+
/**
|
|
97
|
+
* Workspace variant: refresh each child repo's own graph (a workspace parent holds
|
|
98
|
+
* an index, never nodes). Children are independent, but they're refreshed in
|
|
99
|
+
* sequence — a fan-out of concurrent tree-sitter builds would spike CPU on the
|
|
100
|
+
* very path that's supposed to feel free.
|
|
101
|
+
*/
|
|
102
|
+
export declare function ensureFreshChildren(root: string, children: string[], opts?: RefreshOptions): Promise<RefreshResult>;
|
|
103
|
+
/** The one-line note a CLI/MCP surface prints when a refresh actually happened.
|
|
104
|
+
* Null when there's nothing to say (the overwhelmingly common case). */
|
|
105
|
+
export declare function refreshNote(r: RefreshResult): string | null;
|
|
106
|
+
//# sourceMappingURL=refresh.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"refresh.d.ts","sourceRoot":"","sources":["../../src/graph/refresh.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAsCG;AAaH,OAAO,EAAoD,KAAK,KAAK,EAAE,MAAM,kBAAkB,CAAC;AAMhG;;;;;;;;GAQG;AACH,eAAO,MAAM,gBAAgB,KAAK,CAAC;AAgBnC,MAAM,WAAW,aAAa;IAC5B,4DAA4D;IAC5D,SAAS,EAAE,OAAO,CAAC;IACnB,6DAA6D;IAC7D,KAAK,CAAC,EAAE,KAAK,CAAC;IACd;;;OAGG;IACH,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,oFAAoF;IACpF,IAAI,CAAC,EAAE,MAAM,CAAC;CACf;AAED,MAAM,WAAW,cAAc;IAC7B,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,iDAAiD;IACjD,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB;iFAC6E;IAC7E,gBAAgB,CAAC,EAAE,MAAM,CAAC;CAC3B;AAoID;;;;;;;;;;;;;;GAcG;AACH,wBAAgB,eAAe,CAAC,KAAK,EAAE,MAAM,GAAG,MAAM,IAAI,CAWzD;AAuCD;;;;;;GAMG;AACH,wBAAsB,gBAAgB,CAAC,IAAI,EAAE,MAAM,EAAE,IAAI,GAAE,cAAmB,GAAG,OAAO,CAAC,aAAa,CAAC,CA4FtG;AAED;;;;;GAKG;AACH,wBAAsB,mBAAmB,CACvC,IAAI,EAAE,MAAM,EACZ,QAAQ,EAAE,MAAM,EAAE,EAClB,IAAI,GAAE,cAAmB,GACxB,OAAO,CAAC,aAAa,CAAC,CA4BxB;AAED;wEACwE;AACxE,wBAAgB,WAAW,CAAC,CAAC,EAAE,aAAa,GAAG,MAAM,GAAG,IAAI,CAY3D"}
|