@quolu/lattice 0.1.0 → 0.12.2
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/README.md +87 -4
- package/bin/lattice-bridge.mjs +87 -0
- package/bin/lattice-dashboard.mjs +70 -0
- package/bin/lattice-mcp.mjs +9 -9
- package/bin/lattice.mjs +61 -8
- package/docs/bridge-setup.md +87 -0
- package/docs/schemas/lattice.plan_create_input.v1.schema.json +56 -0
- package/docs/schemas/lattice.plan_create_input.v2.schema.json +72 -0
- package/docs/schemas/lattice.plan_create_input.v3.schema.json +81 -0
- package/package.json +19 -7
- package/sensor/dist/bin/command-supervision.d.ts +1 -1
- package/sensor/dist/bin/command-supervision.js +4 -4
- package/sensor/dist/bin/command-supervision.js.map +1 -1
- package/sensor/dist/bin/fatal-handler.js +2 -2
- package/sensor/dist/bin/fatal-handler.js.map +1 -1
- package/sensor/dist/bin/{codegraph.js → lattice-sensor.js} +207 -328
- package/sensor/dist/bin/node-version-check.d.ts +7 -5
- package/sensor/dist/bin/node-version-check.d.ts.map +1 -1
- package/sensor/dist/bin/node-version-check.js +19 -14
- package/sensor/dist/bin/node-version-check.js.map +1 -1
- package/sensor/dist/context/index.d.ts +1 -1
- package/sensor/dist/context/index.js +6 -6
- package/sensor/dist/context/index.js.map +1 -1
- package/sensor/dist/db/index.d.ts +5 -5
- package/sensor/dist/db/index.d.ts.map +1 -1
- package/sensor/dist/db/index.js +7 -7
- package/sensor/dist/db/index.js.map +1 -1
- package/sensor/dist/db/migrations.js +1 -1
- package/sensor/dist/db/migrations.js.map +1 -1
- package/sensor/dist/db/queries.d.ts +1 -1
- package/sensor/dist/db/queries.js +5 -5
- package/sensor/dist/db/queries.js.map +1 -1
- package/sensor/dist/db/schema.sql +2 -2
- package/sensor/dist/db/sqlite-adapter.d.ts +2 -2
- package/sensor/dist/db/sqlite-adapter.js +3 -3
- package/sensor/dist/db/sqlite-adapter.js.map +1 -1
- package/sensor/dist/db/wal-valve.d.ts +1 -1
- package/sensor/dist/db/wal-valve.d.ts.map +1 -1
- package/sensor/dist/db/wal-valve.js +2 -2
- package/sensor/dist/db/wal-valve.js.map +1 -1
- package/sensor/dist/directory.d.ts +27 -63
- package/sensor/dist/directory.d.ts.map +1 -1
- package/sensor/dist/directory.js +78 -134
- package/sensor/dist/directory.js.map +1 -1
- package/sensor/dist/errors.d.ts +15 -15
- package/sensor/dist/errors.d.ts.map +1 -1
- package/sensor/dist/errors.js +21 -21
- package/sensor/dist/errors.js.map +1 -1
- package/sensor/dist/extraction/dynamic-import.d.ts +1 -1
- package/sensor/dist/extraction/dynamic-import.js +1 -1
- package/sensor/dist/extraction/extraction-version.d.ts +1 -1
- package/sensor/dist/extraction/extraction-version.js +1 -1
- package/sensor/dist/extraction/generated-detection.d.ts +1 -1
- package/sensor/dist/extraction/generated-detection.js +1 -1
- package/sensor/dist/extraction/grammars.d.ts +3 -3
- package/sensor/dist/extraction/grammars.js +5 -5
- package/sensor/dist/extraction/grammars.js.map +1 -1
- package/sensor/dist/extraction/index.d.ts +6 -6
- package/sensor/dist/extraction/index.js +50 -50
- package/sensor/dist/extraction/index.js.map +1 -1
- package/sensor/dist/extraction/kernel/decode.d.ts +1 -1
- package/sensor/dist/extraction/kernel/decode.js +1 -1
- package/sensor/dist/extraction/kernel/index.d.ts +3 -3
- package/sensor/dist/extraction/kernel/index.js +6 -6
- package/sensor/dist/extraction/kernel/index.js.map +1 -1
- package/sensor/dist/extraction/kernel/layout.d.ts +1 -1
- package/sensor/dist/extraction/kernel/layout.js +1 -1
- package/sensor/dist/extraction/kernel/loader.d.ts +6 -6
- package/sensor/dist/extraction/kernel/loader.js +13 -13
- package/sensor/dist/extraction/kernel/loader.js.map +1 -1
- package/sensor/dist/extraction/languages/cfquery.d.ts +1 -1
- package/sensor/dist/extraction/languages/cfquery.js +1 -1
- package/sensor/dist/extraction/languages/lua.d.ts +11 -0
- package/sensor/dist/extraction/languages/lua.d.ts.map +1 -1
- package/sensor/dist/extraction/languages/lua.js +1 -0
- package/sensor/dist/extraction/languages/lua.js.map +1 -1
- package/sensor/dist/extraction/parse-pool.d.ts +5 -5
- package/sensor/dist/extraction/parse-pool.d.ts.map +1 -1
- package/sensor/dist/extraction/parse-pool.js +4 -4
- package/sensor/dist/extraction/parse-worker.js +1 -1
- package/sensor/dist/extraction/parse-worker.js.map +1 -1
- package/sensor/dist/extraction/store-writer.d.ts +1 -1
- package/sensor/dist/extraction/store-writer.js +1 -1
- package/sensor/dist/extraction/svelte-extractor.d.ts +1 -1
- package/sensor/dist/extraction/svelte-extractor.js +1 -1
- package/sensor/dist/extraction/tree-sitter-helpers.js +1 -1
- package/sensor/dist/extraction/tree-sitter.d.ts +2 -2
- package/sensor/dist/extraction/tree-sitter.d.ts.map +1 -1
- package/sensor/dist/extraction/tree-sitter.js +71 -4
- package/sensor/dist/extraction/tree-sitter.js.map +1 -1
- package/sensor/dist/extraction/wasm-runtime-flags.d.ts +2 -2
- package/sensor/dist/extraction/wasm-runtime-flags.d.ts.map +1 -1
- package/sensor/dist/extraction/wasm-runtime-flags.js +5 -5
- package/sensor/dist/extraction/wasm-runtime-flags.js.map +1 -1
- package/sensor/dist/index.d.ts +36 -36
- package/sensor/dist/index.d.ts.map +1 -1
- package/sensor/dist/index.js +71 -71
- package/sensor/dist/index.js.map +1 -1
- package/sensor/dist/mcp/daemon-manager.js +1 -1
- package/sensor/dist/mcp/daemon-paths.d.ts +3 -3
- package/sensor/dist/mcp/daemon-paths.js +7 -7
- package/sensor/dist/mcp/daemon-paths.js.map +1 -1
- package/sensor/dist/mcp/daemon-registry.d.ts +2 -2
- package/sensor/dist/mcp/daemon-registry.js +5 -5
- package/sensor/dist/mcp/daemon.d.ts +7 -7
- package/sensor/dist/mcp/daemon.d.ts.map +1 -1
- package/sensor/dist/mcp/daemon.js +21 -21
- package/sensor/dist/mcp/daemon.js.map +1 -1
- package/sensor/dist/mcp/dynamic-boundaries.js +1 -1
- package/sensor/dist/mcp/engine.d.ts +9 -9
- package/sensor/dist/mcp/engine.d.ts.map +1 -1
- package/sensor/dist/mcp/engine.js +44 -44
- package/sensor/dist/mcp/engine.js.map +1 -1
- package/sensor/dist/mcp/index.d.ts +14 -14
- package/sensor/dist/mcp/index.d.ts.map +1 -1
- package/sensor/dist/mcp/index.js +41 -41
- package/sensor/dist/mcp/index.js.map +1 -1
- package/sensor/dist/mcp/liveness-watchdog.js +7 -7
- package/sensor/dist/mcp/liveness-watchdog.js.map +1 -1
- package/sensor/dist/mcp/ppid-watchdog.d.ts +3 -3
- package/sensor/dist/mcp/ppid-watchdog.js +2 -2
- package/sensor/dist/mcp/proxy.d.ts.map +1 -1
- package/sensor/dist/mcp/proxy.js +37 -37
- package/sensor/dist/mcp/proxy.js.map +1 -1
- package/sensor/dist/mcp/query-pool.d.ts +3 -3
- package/sensor/dist/mcp/query-pool.js +7 -7
- package/sensor/dist/mcp/query-pool.js.map +1 -1
- package/sensor/dist/mcp/query-worker.d.ts +2 -2
- package/sensor/dist/mcp/query-worker.js +7 -7
- package/sensor/dist/mcp/query-worker.js.map +1 -1
- package/sensor/dist/mcp/server-instructions.d.ts +10 -12
- package/sensor/dist/mcp/server-instructions.d.ts.map +1 -1
- package/sensor/dist/mcp/server-instructions.js +39 -37
- package/sensor/dist/mcp/server-instructions.js.map +1 -1
- package/sensor/dist/mcp/session.d.ts +2 -2
- package/sensor/dist/mcp/session.js +18 -18
- package/sensor/dist/mcp/session.js.map +1 -1
- package/sensor/dist/mcp/startup-handshake.d.ts +3 -3
- package/sensor/dist/mcp/startup-handshake.d.ts.map +1 -1
- package/sensor/dist/mcp/startup-handshake.js +3 -3
- package/sensor/dist/mcp/startup-handshake.js.map +1 -1
- package/sensor/dist/mcp/tools.d.ts +53 -53
- package/sensor/dist/mcp/tools.d.ts.map +1 -1
- package/sensor/dist/mcp/tools.js +180 -216
- package/sensor/dist/mcp/tools.js.map +1 -1
- package/sensor/dist/mcp/transport.d.ts +1 -1
- package/sensor/dist/mcp/transport.js +6 -6
- package/sensor/dist/mcp/transport.js.map +1 -1
- package/sensor/dist/mcp/version.d.ts +2 -2
- package/sensor/dist/mcp/version.d.ts.map +1 -1
- package/sensor/dist/mcp/version.js +3 -3
- package/sensor/dist/mcp/version.js.map +1 -1
- package/sensor/dist/project-config.d.ts +6 -6
- package/sensor/dist/project-config.d.ts.map +1 -1
- package/sensor/dist/project-config.js +10 -10
- package/sensor/dist/project-config.js.map +1 -1
- package/sensor/dist/resolution/callback-synthesizer.js +4 -4
- package/sensor/dist/resolution/callback-synthesizer.js.map +1 -1
- package/sensor/dist/resolution/frameworks/drupal.d.ts +3 -3
- package/sensor/dist/resolution/frameworks/drupal.js +3 -3
- package/sensor/dist/resolution/frameworks/fabric.js +1 -1
- package/sensor/dist/resolution/frameworks/fabric.js.map +1 -1
- package/sensor/dist/resolution/frameworks/java.js +1 -1
- package/sensor/dist/resolution/frameworks/java.js.map +1 -1
- package/sensor/dist/resolution/frameworks/svelte.js +1 -1
- package/sensor/dist/resolution/frameworks/svelte.js.map +1 -1
- package/sensor/dist/resolution/goframe-synthesizer.d.ts +1 -1
- package/sensor/dist/resolution/goframe-synthesizer.js +1 -1
- package/sensor/dist/resolution/index.d.ts +1 -1
- package/sensor/dist/resolution/index.js +9 -9
- package/sensor/dist/resolution/index.js.map +1 -1
- package/sensor/dist/resolution/name-matcher.js +2 -2
- package/sensor/dist/resolution/name-matcher.js.map +1 -1
- package/sensor/dist/resolution/resolver-pool.d.ts +2 -2
- package/sensor/dist/resolution/resolver-pool.js +4 -4
- package/sensor/dist/resolution/resolver-pool.js.map +1 -1
- package/sensor/dist/resolution/resolver-worker.js +2 -2
- package/sensor/dist/resolution/resolver-worker.js.map +1 -1
- package/sensor/dist/resolution/workspace-packages.js +1 -1
- package/sensor/dist/resolution/workspace-packages.js.map +1 -1
- package/sensor/dist/search/identifier-segments.d.ts +1 -1
- package/sensor/dist/search/identifier-segments.js +1 -1
- package/sensor/dist/search/query-utils.d.ts +1 -0
- package/sensor/dist/search/query-utils.d.ts.map +1 -1
- package/sensor/dist/search/query-utils.js +10 -3
- package/sensor/dist/search/query-utils.js.map +1 -1
- package/sensor/dist/sync/git-hooks.d.ts +9 -9
- package/sensor/dist/sync/git-hooks.d.ts.map +1 -1
- package/sensor/dist/sync/git-hooks.js +15 -15
- package/sensor/dist/sync/git-hooks.js.map +1 -1
- package/sensor/dist/sync/watch-policy.d.ts +2 -2
- package/sensor/dist/sync/watch-policy.js +5 -5
- package/sensor/dist/sync/watch-policy.js.map +1 -1
- package/sensor/dist/sync/watcher.d.ts +2 -2
- package/sensor/dist/sync/watcher.d.ts.map +1 -1
- package/sensor/dist/sync/watcher.js +16 -16
- package/sensor/dist/sync/watcher.js.map +1 -1
- package/sensor/dist/sync/worktree.d.ts +5 -5
- package/sensor/dist/sync/worktree.d.ts.map +1 -1
- package/sensor/dist/sync/worktree.js +9 -9
- package/sensor/dist/sync/worktree.js.map +1 -1
- package/sensor/dist/telemetry/index.d.ts +8 -8
- package/sensor/dist/telemetry/index.d.ts.map +1 -1
- package/sensor/dist/telemetry/index.js +16 -16
- package/sensor/dist/telemetry/index.js.map +1 -1
- package/sensor/dist/types.d.ts +2 -2
- package/sensor/dist/types.js +1 -1
- package/sensor/dist/ui/color.d.ts +2 -2
- package/sensor/dist/ui/color.js +2 -2
- package/sensor/dist/ui/glyphs.d.ts +3 -3
- package/sensor/dist/ui/glyphs.js +7 -7
- package/sensor/dist/ui/glyphs.js.map +1 -1
- package/sensor/dist/utils.d.ts +4 -4
- package/sensor/dist/utils.js +8 -8
- package/sensor/dist/utils.js.map +1 -1
- package/sensor/package.json +8 -13
- package/src/artifact-contracts.mjs +2 -2
- package/src/boundary-compiler.mjs +28 -28
- package/src/boundary-observation-compiler-v2.mjs +10 -10
- package/src/bounded-seam.mjs +144 -0
- package/src/bridge-cli.mjs +227 -0
- package/src/bridge-config.mjs +346 -0
- package/src/bridge-daemon.mjs +328 -0
- package/src/bridge-launch-agent.mjs +311 -0
- package/src/bridge-server.mjs +309 -0
- package/src/cli-help.mjs +163 -0
- package/src/control-compiler.mjs +30 -30
- package/src/dag-chain.mjs +261 -0
- package/src/factory-diagnostics.mjs +8 -7
- package/src/hash-chain.mjs +76 -0
- package/src/node-version-guard.mjs +5 -4
- package/src/project-cli.mjs +392 -0
- package/src/project-identity.mjs +71 -0
- package/src/rc1-evidence-bundle.mjs +16 -16
- package/src/rc1-v4-campaign.mjs +15 -14
- package/src/rc1-v5-artifact-set.mjs +2 -2
- package/src/rc1-v5-campaign.mjs +15 -14
- package/src/rc1-v6-artifact-set.mjs +18 -18
- package/src/rc1-v6-campaign.mjs +16 -16
- package/src/rc1-v6-causal-binding.mjs +16 -14
- package/src/rc1-v6-measurement.mjs +20 -38
- package/src/rc2-artifact-set.mjs +45 -40
- package/src/rc2-campaign.mjs +48 -66
- package/src/rc2-delivery-policy-front-end.mjs +30 -30
- package/src/rc2-rc1-transfer-front-end.mjs +5 -5
- package/src/rc3-actual-dogfood.mjs +6 -6
- package/src/rc3-dogfood-scaffold.mjs +12 -7
- package/src/rc3-scripted-campaign.mjs +75 -21
- package/src/rc4-stage1-dogfood.mjs +24 -7
- package/src/runtime-cli.mjs +2424 -45
- package/src/runtime-contracts.mjs +7 -7
- package/src/runtime-control-store.mjs +547 -0
- package/src/runtime-controller-protocol.mjs +517 -0
- package/src/runtime-direct-os-observer.mjs +284 -0
- package/src/runtime-engine.mjs +2 -2
- package/src/runtime-errors.mjs +1 -1
- package/src/runtime-event-store.mjs +15 -43
- package/src/runtime-front-end.mjs +26 -26
- package/src/runtime-gate-store.mjs +477 -0
- package/src/runtime-hold-recompile.mjs +214 -23
- package/src/runtime-lifecycle-lock.mjs +290 -0
- package/src/runtime-managed-supervisor.mjs +1276 -0
- package/src/runtime-multi-epoch-store.mjs +761 -0
- package/src/runtime-projection.mjs +62 -0
- package/src/seam-transform.mjs +38 -38
- package/src/{codegraph-adapter.mjs → sensor-adapter.mjs} +7 -7
- package/src/sensor-cli.mjs +107 -0
- package/src/sensor-runtime.mjs +48 -0
- package/src/timestamp-contract.mjs +8 -0
- package/src/todo-chain.mjs +178 -0
- package/src/todo-cli.mjs +1032 -0
- package/src/todo-contracts.mjs +501 -0
- package/src/todo-dashboard-registry.mjs +318 -0
- package/src/todo-gantt-html.mjs +416 -0
- package/src/todo-gantt-layout.mjs +603 -0
- package/src/todo-gantt-live.mjs +269 -0
- package/src/todo-gantt-presentation.mjs +217 -0
- package/src/todo-gantt-svg.mjs +249 -0
- package/src/todo-markdown-renderer.mjs +260 -0
- package/src/todo-migration.mjs +260 -0
- package/src/todo-narrative-anchor.mjs +130 -0
- package/src/todo-revision.mjs +425 -0
- package/src/todo-status.mjs +340 -0
- package/src/todo-store.mjs +3451 -0
- package/src/treatment-compiler.mjs +28 -28
- package/src/treatment-runner.mjs +42 -44
- package/sensor/dist/bin/codegraph.d.ts +0 -26
- package/sensor/dist/bin/codegraph.d.ts.map +0 -1
- package/sensor/dist/bin/codegraph.js.map +0 -1
- package/sensor/dist/bin/uninstall.d.ts +0 -14
- package/sensor/dist/bin/uninstall.d.ts.map +0 -1
- package/sensor/dist/bin/uninstall.js +0 -36
- package/sensor/dist/bin/uninstall.js.map +0 -1
- package/sensor/dist/installer/beta-signup.d.ts +0 -54
- package/sensor/dist/installer/beta-signup.d.ts.map +0 -1
- package/sensor/dist/installer/beta-signup.js +0 -178
- package/sensor/dist/installer/beta-signup.js.map +0 -1
- package/sensor/dist/installer/config-writer.d.ts +0 -28
- package/sensor/dist/installer/config-writer.d.ts.map +0 -1
- package/sensor/dist/installer/config-writer.js +0 -91
- package/sensor/dist/installer/config-writer.js.map +0 -1
- package/sensor/dist/installer/index.d.ts +0 -142
- package/sensor/dist/installer/index.d.ts.map +0 -1
- package/sensor/dist/installer/index.js +0 -622
- package/sensor/dist/installer/index.js.map +0 -1
- package/sensor/dist/installer/instructions-template.d.ts +0 -41
- package/sensor/dist/installer/instructions-template.d.ts.map +0 -1
- package/sensor/dist/installer/instructions-template.js +0 -53
- package/sensor/dist/installer/instructions-template.js.map +0 -1
- package/sensor/dist/installer/targets/antigravity.d.ts +0 -57
- package/sensor/dist/installer/targets/antigravity.d.ts.map +0 -1
- package/sensor/dist/installer/targets/antigravity.js +0 -308
- package/sensor/dist/installer/targets/antigravity.js.map +0 -1
- package/sensor/dist/installer/targets/claude.d.ts +0 -62
- package/sensor/dist/installer/targets/claude.d.ts.map +0 -1
- package/sensor/dist/installer/targets/claude.js +0 -454
- package/sensor/dist/installer/targets/claude.js.map +0 -1
- package/sensor/dist/installer/targets/codex.d.ts +0 -18
- package/sensor/dist/installer/targets/codex.d.ts.map +0 -1
- package/sensor/dist/installer/targets/codex.js +0 -185
- package/sensor/dist/installer/targets/codex.js.map +0 -1
- package/sensor/dist/installer/targets/cursor.d.ts +0 -35
- package/sensor/dist/installer/targets/cursor.d.ts.map +0 -1
- package/sensor/dist/installer/targets/cursor.js +0 -254
- package/sensor/dist/installer/targets/cursor.js.map +0 -1
- package/sensor/dist/installer/targets/gemini.d.ts +0 -26
- package/sensor/dist/installer/targets/gemini.d.ts.map +0 -1
- package/sensor/dist/installer/targets/gemini.js +0 -165
- package/sensor/dist/installer/targets/gemini.js.map +0 -1
- package/sensor/dist/installer/targets/hermes.d.ts +0 -18
- package/sensor/dist/installer/targets/hermes.d.ts.map +0 -1
- package/sensor/dist/installer/targets/hermes.js +0 -359
- package/sensor/dist/installer/targets/hermes.js.map +0 -1
- package/sensor/dist/installer/targets/kiro.d.ts +0 -27
- package/sensor/dist/installer/targets/kiro.d.ts.map +0 -1
- package/sensor/dist/installer/targets/kiro.js +0 -178
- package/sensor/dist/installer/targets/kiro.js.map +0 -1
- package/sensor/dist/installer/targets/opencode.d.ts +0 -38
- package/sensor/dist/installer/targets/opencode.d.ts.map +0 -1
- package/sensor/dist/installer/targets/opencode.js +0 -288
- package/sensor/dist/installer/targets/opencode.js.map +0 -1
- package/sensor/dist/installer/targets/registry.d.ts +0 -35
- package/sensor/dist/installer/targets/registry.d.ts.map +0 -1
- package/sensor/dist/installer/targets/registry.js +0 -91
- package/sensor/dist/installer/targets/registry.js.map +0 -1
- package/sensor/dist/installer/targets/shared.d.ts +0 -101
- package/sensor/dist/installer/targets/shared.d.ts.map +0 -1
- package/sensor/dist/installer/targets/shared.js +0 -264
- package/sensor/dist/installer/targets/shared.js.map +0 -1
- package/sensor/dist/installer/targets/toml.d.ts +0 -52
- package/sensor/dist/installer/targets/toml.d.ts.map +0 -1
- package/sensor/dist/installer/targets/toml.js +0 -147
- package/sensor/dist/installer/targets/toml.js.map +0 -1
- package/sensor/dist/installer/targets/types.d.ts +0 -108
- package/sensor/dist/installer/targets/types.d.ts.map +0 -1
- package/sensor/dist/installer/targets/types.js +0 -16
- package/sensor/dist/installer/targets/types.js.map +0 -1
- package/sensor/dist/upgrade/index.d.ts +0 -171
- package/sensor/dist/upgrade/index.d.ts.map +0 -1
- package/sensor/dist/upgrade/index.js +0 -659
- package/sensor/dist/upgrade/index.js.map +0 -1
- package/sensor/dist/upgrade/remove-binary.d.ts +0 -87
- package/sensor/dist/upgrade/remove-binary.d.ts.map +0 -1
- package/sensor/dist/upgrade/remove-binary.js +0 -289
- package/sensor/dist/upgrade/remove-binary.js.map +0 -1
- package/sensor/dist/upgrade/update-check.d.ts +0 -92
- package/sensor/dist/upgrade/update-check.d.ts.map +0 -1
- package/sensor/dist/upgrade/update-check.js +0 -258
- package/sensor/dist/upgrade/update-check.js.map +0 -1
- package/src/bootstrap.mjs +0 -88
|
@@ -1,27 +1,27 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
"use strict";
|
|
3
3
|
/**
|
|
4
|
-
*
|
|
4
|
+
* LatticeSensor CLI
|
|
5
5
|
*
|
|
6
|
-
* Command-line interface for
|
|
6
|
+
* Command-line interface for LatticeSensor code intelligence.
|
|
7
7
|
*
|
|
8
8
|
* Usage:
|
|
9
|
-
*
|
|
10
|
-
*
|
|
11
|
-
*
|
|
12
|
-
*
|
|
13
|
-
*
|
|
14
|
-
*
|
|
15
|
-
*
|
|
16
|
-
*
|
|
17
|
-
*
|
|
18
|
-
*
|
|
19
|
-
*
|
|
20
|
-
*
|
|
21
|
-
*
|
|
22
|
-
*
|
|
23
|
-
*
|
|
24
|
-
*
|
|
9
|
+
* lattice sensor Refuse: no standalone installer
|
|
10
|
+
* lattice sensor install Refuse: host wiring is owned by dotagents
|
|
11
|
+
* lattice sensor uninstall Refuse: retirement is owned by dotagents
|
|
12
|
+
* lattice sensor init [path] Initialize LatticeSensor in a project
|
|
13
|
+
* lattice sensor uninit [path] Remove LatticeSensor from a project
|
|
14
|
+
* lattice sensor index [path] Index all files in the project
|
|
15
|
+
* lattice sensor sync [path] Sync changes since last index
|
|
16
|
+
* lattice sensor status [path] Show index status
|
|
17
|
+
* lattice sensor query <search> Search for symbols
|
|
18
|
+
* lattice sensor files [options] Show project file structure
|
|
19
|
+
* lattice sensor context <task> Build context for a task
|
|
20
|
+
* lattice sensor callers <symbol> Find what calls a function/method
|
|
21
|
+
* lattice sensor callees <symbol> Find what a function/method calls
|
|
22
|
+
* lattice sensor impact <symbol> Analyze what code is affected by changing a symbol
|
|
23
|
+
* lattice sensor affected [files] Find test files affected by changes
|
|
24
|
+
* lattice sensor upgrade [version] Update LatticeSensor to the latest release
|
|
25
25
|
*/
|
|
26
26
|
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
27
27
|
if (k2 === undefined) k2 = k;
|
|
@@ -75,6 +75,7 @@ const path = __importStar(require("path"));
|
|
|
75
75
|
const fs = __importStar(require("fs"));
|
|
76
76
|
const directory_1 = require("../directory");
|
|
77
77
|
const identifier_segments_1 = require("../search/identifier-segments");
|
|
78
|
+
const query_utils_1 = require("../search/query-utils");
|
|
78
79
|
const worktree_1 = require("../sync/worktree");
|
|
79
80
|
const shimmer_progress_1 = require("../ui/shimmer-progress");
|
|
80
81
|
const glyphs_1 = require("../ui/glyphs");
|
|
@@ -88,18 +89,18 @@ const telemetry_1 = require("../telemetry");
|
|
|
88
89
|
// Decided once, before `--color`/`--no-color` are stripped from argv below
|
|
89
90
|
// (#1281). Piped/redirected stdout, NO_COLOR, or --no-color -> plain output.
|
|
90
91
|
const COLORS_ENABLED = (0, color_1.ansiColorsEnabled)();
|
|
91
|
-
// Lazy-load heavy modules (
|
|
92
|
-
async function
|
|
92
|
+
// Lazy-load heavy modules (LatticeSensor, runInstaller) to keep CLI startup fast.
|
|
93
|
+
async function loadLatticeSensor() {
|
|
93
94
|
try {
|
|
94
95
|
return await Promise.resolve().then(() => __importStar(require('../index')));
|
|
95
96
|
}
|
|
96
97
|
catch (err) {
|
|
97
98
|
const msg = err instanceof Error ? err.message : String(err);
|
|
98
99
|
const [red, reset] = COLORS_ENABLED ? ['\x1b[31m', '\x1b[0m'] : ['', ''];
|
|
99
|
-
console.error(`${red}${(0, glyphs_1.getGlyphs)().err}${reset} Failed to load
|
|
100
|
+
console.error(`${red}${(0, glyphs_1.getGlyphs)().err}${reset} Failed to load LatticeSensor modules.`);
|
|
100
101
|
console.error(`\n Node: ${process.version} Platform: ${process.platform} ${process.arch}`);
|
|
101
102
|
console.error(`\n Error: ${msg}`);
|
|
102
|
-
console.error('\n
|
|
103
|
+
console.error('\n Reinstall the owning package with: npm install -g @quolu/lattice@latest\n');
|
|
103
104
|
process.exit(1);
|
|
104
105
|
}
|
|
105
106
|
}
|
|
@@ -107,7 +108,7 @@ async function loadCodeGraph() {
|
|
|
107
108
|
// which fails for ESM-only packages. This bypasses the transformation.
|
|
108
109
|
// eslint-disable-next-line @typescript-eslint/no-implied-eval
|
|
109
110
|
const importESM = new Function('specifier', 'return import(specifier)');
|
|
110
|
-
// Block
|
|
111
|
+
// Block LatticeSensor on Node.js 25.x — V8's turboshaft WASM JIT has a Zone
|
|
111
112
|
// allocator bug that reliably crashes when compiling tree-sitter
|
|
112
113
|
// grammars (see #54, #81, #140). The previous behaviour was a soft
|
|
113
114
|
// console.warn that scrolls off-screen before the OOM crash 30 seconds
|
|
@@ -116,19 +117,19 @@ const importESM = new Function('specifier', 'return import(specifier)');
|
|
|
116
117
|
// who patched V8 themselves or want to test a future fix.
|
|
117
118
|
const nodeVersion = process.versions.node;
|
|
118
119
|
const nodeMajor = parseInt(nodeVersion.split('.')[0] ?? '0', 10);
|
|
119
|
-
if (
|
|
120
|
+
if ((0, node_version_check_1.isNode25Affected)(nodeMajor)) {
|
|
120
121
|
process.stderr.write((0, node_version_check_1.buildNode25BlockBanner)(nodeVersion) + '\n');
|
|
121
|
-
if (!process.env.
|
|
122
|
+
if (!process.env.LATTICE_SENSOR_ALLOW_UNSAFE_NODE) {
|
|
122
123
|
process.exit(1);
|
|
123
124
|
}
|
|
124
125
|
// Override active — banner shown for visibility, continuing.
|
|
125
126
|
}
|
|
126
127
|
// Enforce the supported Node floor. `engines` in package.json only *warns* on
|
|
127
128
|
// install (unless engine-strict), so hard-block here to actually keep users off
|
|
128
|
-
// unsupported versions. Mirrors the 25
|
|
129
|
+
// unsupported versions. Mirrors the Node 25 block above. See package.json `engines`.
|
|
129
130
|
if (nodeMajor < node_version_check_1.MIN_NODE_MAJOR) {
|
|
130
131
|
process.stderr.write((0, node_version_check_1.buildNodeTooOldBanner)(nodeVersion) + '\n');
|
|
131
|
-
if (!process.env.
|
|
132
|
+
if (!process.env.LATTICE_SENSOR_ALLOW_UNSAFE_NODE) {
|
|
132
133
|
process.exit(1);
|
|
133
134
|
}
|
|
134
135
|
// Override active — banner shown for visibility, continuing.
|
|
@@ -145,12 +146,10 @@ if (nodeMajor < node_version_check_1.MIN_NODE_MAJOR) {
|
|
|
145
146
|
// CPU core with no recovery (#799, #850). Installed before the command branch
|
|
146
147
|
// so it also covers a synchronous throw during startup. See ./fatal-handler.
|
|
147
148
|
(0, fatal_handler_1.installFatalHandlers)();
|
|
148
|
-
//
|
|
149
|
+
// The absorbed sensor has no standalone installer. Lattice owns host wiring.
|
|
149
150
|
if (process.argv.length === 2) {
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
process.exit(1);
|
|
153
|
-
});
|
|
151
|
+
console.error('Lattice sensor requires an explicit command. Use `lattice sensor init|sync [path] --json`.');
|
|
152
|
+
process.exit(2);
|
|
154
153
|
}
|
|
155
154
|
else {
|
|
156
155
|
// Normal CLI flow
|
|
@@ -164,8 +163,8 @@ function main() {
|
|
|
164
163
|
// `--version` and `-V`; intercept the spellings it can't — lowercase `-v` and
|
|
165
164
|
// single-dash `-version` — before any parsing. (commander's version short flag
|
|
166
165
|
// is the capital `-V`, and its parser rejects a multi-character single-dash
|
|
167
|
-
// flag.) The bare `
|
|
168
|
-
// the affordance also shows up in `
|
|
166
|
+
// flag.) The bare `lattice sensor version` subcommand is registered further down so
|
|
167
|
+
// the affordance also shows up in `lattice sensor --help`.
|
|
169
168
|
const firstArg = process.argv[2];
|
|
170
169
|
if (firstArg === '-v' || firstArg === '-version') {
|
|
171
170
|
console.log(packageJson.version);
|
|
@@ -215,7 +214,7 @@ function main() {
|
|
|
215
214
|
gray: (s) => `${colors.gray}${s}${colors.reset}`,
|
|
216
215
|
};
|
|
217
216
|
program
|
|
218
|
-
.name('
|
|
217
|
+
.name('lattice-sensor')
|
|
219
218
|
.description('Code intelligence and knowledge graph for any codebase')
|
|
220
219
|
.version(packageJson.version)
|
|
221
220
|
// Parsed manually before commander runs (any argv position works); declared
|
|
@@ -234,7 +233,7 @@ function main() {
|
|
|
234
233
|
program.hook('preAction', (_thisCommand, actionCommand) => {
|
|
235
234
|
try {
|
|
236
235
|
// The detached daemon re-invokes `serve --mcp` internally — not a user action.
|
|
237
|
-
if (process.env.
|
|
236
|
+
if (process.env.LATTICE_SENSOR_DAEMON_INTERNAL)
|
|
238
237
|
return;
|
|
239
238
|
const name = actionCommand.name();
|
|
240
239
|
if (name === 'telemetry')
|
|
@@ -252,17 +251,17 @@ function main() {
|
|
|
252
251
|
// =============================================================================
|
|
253
252
|
/**
|
|
254
253
|
* Resolve project path from argument or current directory
|
|
255
|
-
* Walks up parent directories to find nearest initialized
|
|
256
|
-
* (must have .
|
|
254
|
+
* Walks up parent directories to find nearest initialized LatticeSensor project
|
|
255
|
+
* (must have .lattice/sensor/sensor.db, not just .lattice/sensor/lessons.db)
|
|
257
256
|
*/
|
|
258
257
|
function resolveProjectPath(pathArg) {
|
|
259
258
|
const absolutePath = path.resolve(pathArg || process.cwd());
|
|
260
|
-
// If exact path is initialized (has
|
|
259
|
+
// If exact path is initialized (has sensor.db), use it
|
|
261
260
|
if ((0, directory_1.isInitialized)(absolutePath)) {
|
|
262
261
|
return absolutePath;
|
|
263
262
|
}
|
|
264
|
-
// Walk up to find nearest parent with
|
|
265
|
-
// Note:
|
|
263
|
+
// Walk up to find nearest parent with LatticeSensor initialized
|
|
264
|
+
// Note: findNearestLatticeSensorRoot finds any .lattice/sensor folder, but we need one with sensor.db
|
|
266
265
|
let current = absolutePath;
|
|
267
266
|
const root = path.parse(current).root;
|
|
268
267
|
while (current !== root) {
|
|
@@ -421,14 +420,14 @@ function main() {
|
|
|
421
420
|
clack.note(breakdown, 'Error breakdown');
|
|
422
421
|
if (projectPath) {
|
|
423
422
|
writeErrorLog(projectPath, result.errors);
|
|
424
|
-
clack.log.info('See .
|
|
423
|
+
clack.log.info('See .lattice/sensor/errors.log for details');
|
|
425
424
|
}
|
|
426
425
|
if (result.filesIndexed > 0) {
|
|
427
426
|
clack.log.info(`The index is fully usable ${(0, glyphs_1.getGlyphs)().dash} only the failed files are missing.`);
|
|
428
427
|
}
|
|
429
428
|
}
|
|
430
429
|
else if (projectPath) {
|
|
431
|
-
const logPath = path.join((0, directory_1.
|
|
430
|
+
const logPath = path.join((0, directory_1.getLatticeSensorDir)(projectPath), 'errors.log');
|
|
432
431
|
if (fs.existsSync(logPath)) {
|
|
433
432
|
fs.unlinkSync(logPath);
|
|
434
433
|
}
|
|
@@ -440,7 +439,7 @@ function main() {
|
|
|
440
439
|
* gitignores its child repos" layout (#1156), where `init` at the parent
|
|
441
440
|
* correctly indexes ~nothing while `init` inside each child works — name those
|
|
442
441
|
* repos and offer to index them. An interactive terminal gets a yes/no prompt
|
|
443
|
-
* that writes `includeIgnored` to
|
|
442
|
+
* that writes `includeIgnored` to lattice-sensor.json and re-indexes; a
|
|
444
443
|
* non-interactive run just prints the one-line opt-in snippet. The caller gates
|
|
445
444
|
* this on `nodesCreated === 0`, so a project that DID index real content is
|
|
446
445
|
* never nagged about the gitignored reference clones it deliberately keeps out
|
|
@@ -497,10 +496,10 @@ function main() {
|
|
|
497
496
|
return result;
|
|
498
497
|
}
|
|
499
498
|
/**
|
|
500
|
-
* Write detailed error log to .
|
|
499
|
+
* Write detailed error log to .lattice/sensor/errors.log
|
|
501
500
|
*/
|
|
502
501
|
function writeErrorLog(projectPath, errors) {
|
|
503
|
-
const cgDir = (0, directory_1.
|
|
502
|
+
const cgDir = (0, directory_1.getLatticeSensorDir)(projectPath);
|
|
504
503
|
if (!fs.existsSync(cgDir))
|
|
505
504
|
return;
|
|
506
505
|
const logPath = path.join(cgDir, 'errors.log');
|
|
@@ -523,7 +522,7 @@ function main() {
|
|
|
523
522
|
}
|
|
524
523
|
}
|
|
525
524
|
const lines = [
|
|
526
|
-
`
|
|
525
|
+
`LatticeSensor Error Log - ${new Date().toISOString()}`,
|
|
527
526
|
`${errorsByFile.size} files with errors`,
|
|
528
527
|
'',
|
|
529
528
|
];
|
|
@@ -550,18 +549,18 @@ function main() {
|
|
|
550
549
|
// Commands
|
|
551
550
|
// =============================================================================
|
|
552
551
|
/**
|
|
553
|
-
*
|
|
552
|
+
* lattice sensor init [path]
|
|
554
553
|
*/
|
|
555
554
|
program
|
|
556
555
|
.command('init [path]')
|
|
557
|
-
.description('Initialize
|
|
556
|
+
.description('Initialize LatticeSensor in a project directory and build the initial index')
|
|
558
557
|
.option('-i, --index', 'Deprecated: indexing now runs by default; flag accepted for backward compatibility')
|
|
559
558
|
.option('-f, --force', 'Initialize even if the path looks like your home directory or a filesystem root')
|
|
560
559
|
.option('-v, --verbose', 'Show detailed worker lifecycle and memory info')
|
|
561
560
|
.action(async (pathArg, options) => {
|
|
562
561
|
const projectPath = path.resolve(pathArg || process.cwd());
|
|
563
562
|
const clack = await importESM('@clack/prompts');
|
|
564
|
-
clack.intro('Initializing
|
|
563
|
+
clack.intro('Initializing LatticeSensor');
|
|
565
564
|
try {
|
|
566
565
|
// Refuse to index your home directory / a filesystem root — it pulls in
|
|
567
566
|
// caches, other projects, and your whole tree (a multi-GB index + watcher
|
|
@@ -576,17 +575,12 @@ function main() {
|
|
|
576
575
|
}
|
|
577
576
|
if ((0, directory_1.isInitialized)(projectPath)) {
|
|
578
577
|
clack.log.warn(`Already initialized in ${projectPath}`);
|
|
579
|
-
clack.log.info('Use "
|
|
580
|
-
try {
|
|
581
|
-
const { offerWatchFallback } = await Promise.resolve().then(() => __importStar(require('../installer')));
|
|
582
|
-
await offerWatchFallback(clack, projectPath);
|
|
583
|
-
}
|
|
584
|
-
catch { /* non-fatal */ }
|
|
578
|
+
clack.log.info('Use "lattice sensor init" to re-index or "lattice sensor sync" to update');
|
|
585
579
|
clack.outro('');
|
|
586
580
|
return;
|
|
587
581
|
}
|
|
588
|
-
const { default:
|
|
589
|
-
const cg = await
|
|
582
|
+
const { default: LatticeSensor, getDatabasePath } = await loadLatticeSensor();
|
|
583
|
+
const cg = await LatticeSensor.init(projectPath, { index: false });
|
|
590
584
|
clack.log.success(`Initialized in ${projectPath}`);
|
|
591
585
|
// Indexing runs by default now. The legacy -i/--index flag is still
|
|
592
586
|
// accepted (so existing muscle memory and scripts don't break) but is a
|
|
@@ -622,11 +616,6 @@ function main() {
|
|
|
622
616
|
if (result.nodesCreated === 0) {
|
|
623
617
|
await offerIndexIgnoredRepos(clack, projectPath, runIndex, { interactive: true });
|
|
624
618
|
}
|
|
625
|
-
try {
|
|
626
|
-
const { offerWatchFallback } = await Promise.resolve().then(() => __importStar(require('../installer')));
|
|
627
|
-
await offerWatchFallback(clack, projectPath);
|
|
628
|
-
}
|
|
629
|
-
catch { /* non-fatal */ }
|
|
630
619
|
clack.outro('Done');
|
|
631
620
|
cg.destroy();
|
|
632
621
|
}
|
|
@@ -636,17 +625,17 @@ function main() {
|
|
|
636
625
|
}
|
|
637
626
|
});
|
|
638
627
|
/**
|
|
639
|
-
*
|
|
628
|
+
* lattice sensor uninit [path]
|
|
640
629
|
*/
|
|
641
630
|
program
|
|
642
631
|
.command('uninit [path]')
|
|
643
|
-
.description('Remove
|
|
632
|
+
.description('Remove LatticeSensor from a project (deletes .lattice/sensor/ directory)')
|
|
644
633
|
.option('-f, --force', 'Skip confirmation prompt')
|
|
645
634
|
.action(async (pathArg, options) => {
|
|
646
635
|
const projectPath = resolveProjectPath(pathArg);
|
|
647
636
|
try {
|
|
648
637
|
if (!(0, directory_1.isInitialized)(projectPath)) {
|
|
649
|
-
warn(`
|
|
638
|
+
warn(`LatticeSensor is not initialized in ${projectPath}`);
|
|
650
639
|
return;
|
|
651
640
|
}
|
|
652
641
|
if (!options.force) {
|
|
@@ -654,7 +643,7 @@ function main() {
|
|
|
654
643
|
const readline = await Promise.resolve().then(() => __importStar(require('readline')));
|
|
655
644
|
const rl = readline.createInterface({ input: process.stdin, output: process.stdout });
|
|
656
645
|
const answer = await new Promise((resolve) => {
|
|
657
|
-
rl.question(chalk.yellow(`${(0, glyphs_1.getGlyphs)().warn} This will permanently delete all
|
|
646
|
+
rl.question(chalk.yellow(`${(0, glyphs_1.getGlyphs)().warn} This will permanently delete all LatticeSensor data. Continue? (y/N) `), resolve);
|
|
658
647
|
});
|
|
659
648
|
rl.close();
|
|
660
649
|
if (answer.toLowerCase() !== 'y') {
|
|
@@ -662,8 +651,8 @@ function main() {
|
|
|
662
651
|
return;
|
|
663
652
|
}
|
|
664
653
|
}
|
|
665
|
-
const { default:
|
|
666
|
-
const cg =
|
|
654
|
+
const { default: LatticeSensor } = await loadLatticeSensor();
|
|
655
|
+
const cg = LatticeSensor.openSync(projectPath);
|
|
667
656
|
cg.uninitialize();
|
|
668
657
|
// Clean up any git sync hooks we installed (no-op if none / not a repo).
|
|
669
658
|
try {
|
|
@@ -674,7 +663,7 @@ function main() {
|
|
|
674
663
|
}
|
|
675
664
|
}
|
|
676
665
|
catch { /* non-fatal */ }
|
|
677
|
-
success(`Removed
|
|
666
|
+
success(`Removed LatticeSensor from ${projectPath}`);
|
|
678
667
|
// Churn signal — and flush now, since after an uninit there may be no
|
|
679
668
|
// "next run" to deliver it.
|
|
680
669
|
try {
|
|
@@ -689,7 +678,7 @@ function main() {
|
|
|
689
678
|
}
|
|
690
679
|
});
|
|
691
680
|
/**
|
|
692
|
-
*
|
|
681
|
+
* lattice sensor index [path]
|
|
693
682
|
*/
|
|
694
683
|
program
|
|
695
684
|
.command('index [path]')
|
|
@@ -708,13 +697,13 @@ function main() {
|
|
|
708
697
|
process.exit(1);
|
|
709
698
|
}
|
|
710
699
|
if (!(0, directory_1.isInitialized)(projectPath)) {
|
|
711
|
-
error(`
|
|
712
|
-
info('Run "
|
|
700
|
+
error(`LatticeSensor not initialized in ${projectPath}`);
|
|
701
|
+
info('Run "lattice sensor init" first');
|
|
713
702
|
process.exit(1);
|
|
714
703
|
}
|
|
715
|
-
const { default:
|
|
704
|
+
const { default: LatticeSensor, getDatabasePath } = await loadLatticeSensor();
|
|
716
705
|
// `index` is a FULL re-index — identical to a fresh `init`. RECREATE the
|
|
717
|
-
// database from scratch (discard .
|
|
706
|
+
// database from scratch (discard .lattice/sensor/sensor.db + its WAL) rather
|
|
718
707
|
// than opening the old graph and DELETE-ing every row. The clear-then-index
|
|
719
708
|
// approach reported "0 nodes" without the clear (#874); the recreate keeps
|
|
720
709
|
// that fixed AND avoids the failure mode where, on a large or pre-fix
|
|
@@ -722,7 +711,7 @@ function main() {
|
|
|
722
711
|
// enough to trip the liveness watchdog before scanning even began (#1067).
|
|
723
712
|
// recreate() hands back a fresh, empty instance — no clear() needed. For
|
|
724
713
|
// fast incremental updates use `sync`.
|
|
725
|
-
const cg = await
|
|
714
|
+
const cg = await LatticeSensor.recreate(projectPath);
|
|
726
715
|
// Supervise the indexer: self-terminate if orphaned (parent shim killed)
|
|
727
716
|
// or if the main thread wedges — neither was guarded on this path (#999).
|
|
728
717
|
// The DB + WAL paths let the liveness watchdog tell a slow store on
|
|
@@ -777,7 +766,7 @@ function main() {
|
|
|
777
766
|
}
|
|
778
767
|
});
|
|
779
768
|
/**
|
|
780
|
-
*
|
|
769
|
+
* lattice sensor sync [path]
|
|
781
770
|
*/
|
|
782
771
|
program
|
|
783
772
|
.command('sync [path]')
|
|
@@ -788,19 +777,19 @@ function main() {
|
|
|
788
777
|
try {
|
|
789
778
|
if (!(0, directory_1.isInitialized)(projectPath)) {
|
|
790
779
|
if (!options.quiet) {
|
|
791
|
-
error(`
|
|
780
|
+
error(`LatticeSensor not initialized in ${projectPath}`);
|
|
792
781
|
}
|
|
793
782
|
process.exit(1);
|
|
794
783
|
}
|
|
795
|
-
const { default:
|
|
796
|
-
const cg = await
|
|
784
|
+
const { default: LatticeSensor } = await loadLatticeSensor();
|
|
785
|
+
const cg = await LatticeSensor.open(projectPath);
|
|
797
786
|
if (options.quiet) {
|
|
798
787
|
await cg.sync();
|
|
799
788
|
cg.destroy();
|
|
800
789
|
return;
|
|
801
790
|
}
|
|
802
791
|
const clack = await importESM('@clack/prompts');
|
|
803
|
-
clack.intro('Syncing
|
|
792
|
+
clack.intro('Syncing LatticeSensor');
|
|
804
793
|
process.stdout.write(`${colors.dim}${(0, glyphs_1.getGlyphs)().rail}${colors.reset}\n`);
|
|
805
794
|
const progress = (0, shimmer_progress_1.createShimmerProgress)();
|
|
806
795
|
const result = await cg.sync({
|
|
@@ -833,7 +822,7 @@ function main() {
|
|
|
833
822
|
}
|
|
834
823
|
});
|
|
835
824
|
/**
|
|
836
|
-
*
|
|
825
|
+
* lattice sensor status [path]
|
|
837
826
|
*/
|
|
838
827
|
program
|
|
839
828
|
.command('status [path]')
|
|
@@ -853,19 +842,19 @@ function main() {
|
|
|
853
842
|
initialized: false,
|
|
854
843
|
version: packageJson.version,
|
|
855
844
|
projectPath,
|
|
856
|
-
indexPath: (0, directory_1.
|
|
845
|
+
indexPath: (0, directory_1.getLatticeSensorDir)(projectPath),
|
|
857
846
|
lastIndexed: null,
|
|
858
847
|
}));
|
|
859
848
|
return;
|
|
860
849
|
}
|
|
861
|
-
console.log(chalk.bold('\
|
|
850
|
+
console.log(chalk.bold('\nLatticeSensor Status\n'));
|
|
862
851
|
info(`Project: ${projectPath}`);
|
|
863
852
|
warn('Not initialized');
|
|
864
|
-
info('Run "
|
|
853
|
+
info('Run "lattice sensor init" to initialize');
|
|
865
854
|
return;
|
|
866
855
|
}
|
|
867
|
-
const { default:
|
|
868
|
-
const cg = await
|
|
856
|
+
const { default: LatticeSensor } = await loadLatticeSensor();
|
|
857
|
+
const cg = await LatticeSensor.open(projectPath);
|
|
869
858
|
const stats = cg.getStats();
|
|
870
859
|
const changes = cg.getChangedFiles();
|
|
871
860
|
const backend = cg.getBackend();
|
|
@@ -883,7 +872,7 @@ function main() {
|
|
|
883
872
|
initialized: true,
|
|
884
873
|
version: packageJson.version,
|
|
885
874
|
projectPath,
|
|
886
|
-
indexPath: (0, directory_1.
|
|
875
|
+
indexPath: (0, directory_1.getLatticeSensorDir)(projectPath),
|
|
887
876
|
lastIndexed: lastIndexedMs != null ? new Date(lastIndexedMs).toISOString() : null,
|
|
888
877
|
fileCount: stats.fileCount,
|
|
889
878
|
nodeCount: stats.nodeCount,
|
|
@@ -919,23 +908,23 @@ function main() {
|
|
|
919
908
|
cg.destroy();
|
|
920
909
|
return;
|
|
921
910
|
}
|
|
922
|
-
console.log(chalk.bold('\
|
|
911
|
+
console.log(chalk.bold('\nLatticeSensor Status\n'));
|
|
923
912
|
// Project info
|
|
924
913
|
console.log(chalk.cyan('Project:'), projectPath);
|
|
925
914
|
if (worktreeMismatch) {
|
|
926
915
|
warn((0, worktree_1.worktreeMismatchWarning)(worktreeMismatch));
|
|
927
916
|
}
|
|
928
917
|
if (indexState === 'indexing') {
|
|
929
|
-
warn('The last index run never finished (killed mid-index?) — the index is truncated. Re-run "
|
|
918
|
+
warn('The last index run never finished (killed mid-index?) — the index is truncated. Re-run "lattice sensor index".');
|
|
930
919
|
}
|
|
931
920
|
else if (indexState === 'partial') {
|
|
932
|
-
warn('The last index run silently dropped files — the index is partial. Re-run "
|
|
921
|
+
warn('The last index run silently dropped files — the index is partial. Re-run "lattice sensor index".');
|
|
933
922
|
}
|
|
934
923
|
else if (indexState === 'failed') {
|
|
935
|
-
warn('The last index run failed — results may be incomplete. Re-run "
|
|
924
|
+
warn('The last index run failed — results may be incomplete. Re-run "lattice sensor index".');
|
|
936
925
|
}
|
|
937
926
|
if (pendingRefs > 0) {
|
|
938
|
-
warn(`${formatNumber(pendingRefs)} references from an interrupted run are awaiting resolution — some callers/impact edges are missing. Run "
|
|
927
|
+
warn(`${formatNumber(pendingRefs)} references from an interrupted run are awaiting resolution — some callers/impact edges are missing. Run "lattice sensor sync" to resolve them.`);
|
|
939
928
|
}
|
|
940
929
|
console.log();
|
|
941
930
|
// Index stats
|
|
@@ -988,7 +977,7 @@ function main() {
|
|
|
988
977
|
if (changes.removed.length > 0) {
|
|
989
978
|
console.log(` Removed: ${changes.removed.length} files`);
|
|
990
979
|
}
|
|
991
|
-
info('Run "
|
|
980
|
+
info('Run "lattice sensor sync" to update the index');
|
|
992
981
|
}
|
|
993
982
|
else {
|
|
994
983
|
success('Index is up to date');
|
|
@@ -999,7 +988,7 @@ function main() {
|
|
|
999
988
|
if (reindexRecommended) {
|
|
1000
989
|
const builtWith = buildInfo.version ? `v${buildInfo.version.replace(/^v/, '')}` : 'an earlier version';
|
|
1001
990
|
warn(`Index was built by ${builtWith}; re-index to pick up this engine's improvements.`);
|
|
1002
|
-
info('Run "
|
|
991
|
+
info('Run "lattice sensor index" (full rebuild) or "lattice sensor sync"');
|
|
1003
992
|
console.log();
|
|
1004
993
|
}
|
|
1005
994
|
cg.destroy();
|
|
@@ -1010,7 +999,7 @@ function main() {
|
|
|
1010
999
|
}
|
|
1011
1000
|
});
|
|
1012
1001
|
/**
|
|
1013
|
-
*
|
|
1002
|
+
* lattice sensor query <search>
|
|
1014
1003
|
*/
|
|
1015
1004
|
program
|
|
1016
1005
|
.command('query <search>')
|
|
@@ -1023,11 +1012,11 @@ function main() {
|
|
|
1023
1012
|
const projectPath = resolveProjectPath(options.path);
|
|
1024
1013
|
try {
|
|
1025
1014
|
if (!(0, directory_1.isInitialized)(projectPath)) {
|
|
1026
|
-
error(`
|
|
1015
|
+
error(`LatticeSensor not initialized in ${projectPath}`);
|
|
1027
1016
|
process.exit(1);
|
|
1028
1017
|
}
|
|
1029
|
-
const { default:
|
|
1030
|
-
const cg = await
|
|
1018
|
+
const { default: LatticeSensor } = await loadLatticeSensor();
|
|
1019
|
+
const cg = await LatticeSensor.open(projectPath);
|
|
1031
1020
|
const limit = parseInt(options.limit || '10', 10);
|
|
1032
1021
|
const rawResults = cg.searchNodes(search, {
|
|
1033
1022
|
limit,
|
|
@@ -1077,9 +1066,9 @@ function main() {
|
|
|
1077
1066
|
}
|
|
1078
1067
|
});
|
|
1079
1068
|
/**
|
|
1080
|
-
*
|
|
1069
|
+
* lattice sensor explore <query...>
|
|
1081
1070
|
*
|
|
1082
|
-
* The CLI face of the MCP
|
|
1071
|
+
* The CLI face of the MCP lattice_sensor_explore tool — same handler, same
|
|
1083
1072
|
* output (source of the relevant symbols grouped by file + the call path
|
|
1084
1073
|
* among them). Exists so agents WITHOUT the MCP tools — Task-tool
|
|
1085
1074
|
* subagents (which don't inherit MCP tools, #704) and non-MCP harnesses —
|
|
@@ -1087,24 +1076,24 @@ function main() {
|
|
|
1087
1076
|
*/
|
|
1088
1077
|
program
|
|
1089
1078
|
.command('explore <query...>')
|
|
1090
|
-
.description('Explore an area: relevant symbols\' source + call paths in one shot (same output as the
|
|
1079
|
+
.description('Explore an area: relevant symbols\' source + call paths in one shot (same output as the lattice_sensor_explore MCP tool)')
|
|
1091
1080
|
.option('-p, --path <path>', 'Project path')
|
|
1092
1081
|
.option('--max-files <number>', 'Maximum number of files to include source from')
|
|
1093
1082
|
.action(async (queryParts, options) => {
|
|
1094
1083
|
const projectPath = resolveProjectPath(options.path);
|
|
1095
1084
|
try {
|
|
1096
1085
|
if (!(0, directory_1.isInitialized)(projectPath)) {
|
|
1097
|
-
error(`
|
|
1086
|
+
error(`LatticeSensor isn't available here — no .lattice/sensor/ index exists in ${projectPath}. If you are an AI agent: continue with your usual tools; indexing is the user's decision, do not run it yourself. (The project owner can enable LatticeSensor with 'lattice sensor init'.)`);
|
|
1098
1087
|
process.exit(1);
|
|
1099
1088
|
}
|
|
1100
|
-
const { default:
|
|
1101
|
-
const cg = await
|
|
1089
|
+
const { default: LatticeSensor } = await loadLatticeSensor();
|
|
1090
|
+
const cg = await LatticeSensor.open(projectPath);
|
|
1102
1091
|
const { ToolHandler } = await Promise.resolve().then(() => __importStar(require('../mcp/tools')));
|
|
1103
1092
|
const handler = new ToolHandler(cg);
|
|
1104
1093
|
const args = { query: queryParts.join(' ') };
|
|
1105
1094
|
if (options.maxFiles)
|
|
1106
1095
|
args.maxFiles = parseInt(options.maxFiles, 10);
|
|
1107
|
-
const result = await handler.execute('
|
|
1096
|
+
const result = await handler.execute('lattice_sensor_explore', args);
|
|
1108
1097
|
console.log(result.content[0]?.text ?? '');
|
|
1109
1098
|
cg.destroy();
|
|
1110
1099
|
if (result.isError)
|
|
@@ -1116,13 +1105,13 @@ function main() {
|
|
|
1116
1105
|
}
|
|
1117
1106
|
});
|
|
1118
1107
|
/**
|
|
1119
|
-
*
|
|
1108
|
+
* lattice sensor prompt-hook (hidden)
|
|
1120
1109
|
*
|
|
1121
1110
|
* A Claude Code `UserPromptSubmit` hook entry point. Reads `{prompt, cwd}` JSON
|
|
1122
|
-
* on stdin; for a structural/flow/impact prompt it runs `
|
|
1111
|
+
* on stdin; for a structural/flow/impact prompt it runs `lattice_sensor_explore` on
|
|
1123
1112
|
* the indexed project and prints the result to stdout, which Claude injects into
|
|
1124
1113
|
* the agent's context — so the agent's reflex grep/read has nothing left to find
|
|
1125
|
-
* and reliably uses
|
|
1114
|
+
* and reliably uses LatticeSensor (the adoption problem). Installed by the installer
|
|
1126
1115
|
* into Claude's settings.json (opt-in, default-yes).
|
|
1127
1116
|
*
|
|
1128
1117
|
* LOAD-BEARING: this must NEVER break the user's prompt. Every failure path —
|
|
@@ -1131,12 +1120,12 @@ function main() {
|
|
|
1131
1120
|
*/
|
|
1132
1121
|
program
|
|
1133
1122
|
.command('prompt-hook', { hidden: true })
|
|
1134
|
-
.description('Claude UserPromptSubmit hook: inject
|
|
1123
|
+
.description('Claude UserPromptSubmit hook: inject LatticeSensor context for structural prompts (reads {prompt,cwd} JSON on stdin)')
|
|
1135
1124
|
.action(async () => {
|
|
1136
1125
|
try {
|
|
1137
1126
|
// Kill-switch: lets a user disable the nudge without uninstalling /
|
|
1138
1127
|
// editing settings.json (CI, low-power machines, personal preference).
|
|
1139
|
-
if (process.env.
|
|
1128
|
+
if (process.env.LATTICE_SENSOR_NO_PROMPT_HOOK === '1' || process.env.LATTICE_SENSOR_PROMPT_HOOK === '0')
|
|
1140
1129
|
return;
|
|
1141
1130
|
if (process.stdin.isTTY)
|
|
1142
1131
|
return; // invoked by hand, no piped payload
|
|
@@ -1197,12 +1186,12 @@ function main() {
|
|
|
1197
1186
|
return;
|
|
1198
1187
|
} // nothing reachable — the agent's normal tools apply
|
|
1199
1188
|
// A "pass projectPath" line for indexed sub-projects we did NOT front-load.
|
|
1200
|
-
// Follow-up
|
|
1189
|
+
// Follow-up lattice_sensor_explore calls against a sub-project (cwd isn't its
|
|
1201
1190
|
// index root) need an explicit projectPath, so spell it out.
|
|
1202
1191
|
const nudge = (projects, lead) => `${lead}\n${projects.map((p) => ` - projectPath: "${p}"`).join('\n')}\n`;
|
|
1203
1192
|
if (plan.exploreRoot) {
|
|
1204
|
-
const { default:
|
|
1205
|
-
const cg = await
|
|
1193
|
+
const { default: LatticeSensor } = await loadLatticeSensor();
|
|
1194
|
+
const cg = await LatticeSensor.open(plan.exploreRoot);
|
|
1206
1195
|
try {
|
|
1207
1196
|
const others = plan.nudgeProjects.length
|
|
1208
1197
|
? `\n${nudge(plan.nudgeProjects, 'Other indexed projects in this workspace — pass projectPath to query them:')}`
|
|
@@ -1215,17 +1204,17 @@ function main() {
|
|
|
1215
1204
|
if (keyworded || tokenVerified) {
|
|
1216
1205
|
const { ToolHandler } = await Promise.resolve().then(() => __importStar(require('../mcp/tools')));
|
|
1217
1206
|
const handler = new ToolHandler(cg);
|
|
1218
|
-
const result = await handler.execute('
|
|
1207
|
+
const result = await handler.execute('lattice_sensor_explore', { query: prompt });
|
|
1219
1208
|
const text = result.content[0]?.text ?? '';
|
|
1220
1209
|
if (!result.isError && text.trim()) {
|
|
1221
1210
|
// Cap the injection so a large-repo explore can't flood the prompt.
|
|
1222
1211
|
const MAX = 16000;
|
|
1223
|
-
const body = text.length > MAX ? `${text.slice(0, MAX)}\n…(truncated; call
|
|
1212
|
+
const body = text.length > MAX ? `${text.slice(0, MAX)}\n…(truncated; call lattice_sensor_explore for the rest)` : text;
|
|
1224
1213
|
// For a front-loaded SUB-project, a follow-up explore needs its path.
|
|
1225
1214
|
const more = plan.viaSubScan
|
|
1226
|
-
? `call
|
|
1227
|
-
: 'call
|
|
1228
|
-
process.stdout.write(`<
|
|
1215
|
+
? `call lattice_sensor_explore with projectPath: "${plan.exploreRoot}" for more`
|
|
1216
|
+
: 'call lattice_sensor_explore for more';
|
|
1217
|
+
process.stdout.write(`<lattice_sensor_context note="Structural context from LatticeSensor for this prompt — treat returned source as already read; ${more}.">\n${body}${others}\n</lattice_sensor_context>\n`);
|
|
1229
1218
|
gate(keyworded ? 'high-keyword' : 'high-token');
|
|
1230
1219
|
}
|
|
1231
1220
|
else {
|
|
@@ -1264,11 +1253,11 @@ function main() {
|
|
|
1264
1253
|
.join('\n');
|
|
1265
1254
|
const exampleQuery = related.slice(0, 3).map((m) => m.name).join(' ');
|
|
1266
1255
|
const projectHint = plan.viaSubScan ? ` with projectPath: "${plan.exploreRoot}"` : '';
|
|
1267
|
-
process.stdout.write(`<
|
|
1268
|
-
`This project's
|
|
1269
|
-
`Call
|
|
1256
|
+
process.stdout.write(`<lattice_sensor_context note="LatticeSensor found indexed symbols matching this prompt — query the graph before searching files.">\n` +
|
|
1257
|
+
`This project's LatticeSensor index contains symbols matching this request:\n${lines}\n` +
|
|
1258
|
+
`Call lattice_sensor_explore ONCE${projectHint} with the relevant names in one query (e.g. "${exampleQuery}") ` +
|
|
1270
1259
|
`to get their source, call paths, and blast radius — cheaper and more complete than Read/Grep.\n${others}` +
|
|
1271
|
-
`</
|
|
1260
|
+
`</lattice_sensor_context>\n`);
|
|
1272
1261
|
gate('medium-segment');
|
|
1273
1262
|
}
|
|
1274
1263
|
finally {
|
|
@@ -1278,9 +1267,9 @@ function main() {
|
|
|
1278
1267
|
else {
|
|
1279
1268
|
// Several indexed sub-projects, none a clear match — don't guess; tell
|
|
1280
1269
|
// the agent they exist and how to query one.
|
|
1281
|
-
process.stdout.write(`<
|
|
1282
|
-
nudge(plan.nudgeProjects, "This workspace's
|
|
1283
|
-
`</
|
|
1270
|
+
process.stdout.write(`<lattice_sensor_context note="LatticeSensor is available for this workspace's indexed sub-projects — query one by passing projectPath to lattice_sensor_explore.">\n` +
|
|
1271
|
+
nudge(plan.nudgeProjects, "This workspace's LatticeSensor indexes live in sub-projects. To use LatticeSensor, call lattice_sensor_explore with the projectPath of the relevant one:") +
|
|
1272
|
+
`</lattice_sensor_context>\n`);
|
|
1284
1273
|
gate('nudge-projects');
|
|
1285
1274
|
}
|
|
1286
1275
|
}
|
|
@@ -1289,18 +1278,18 @@ function main() {
|
|
|
1289
1278
|
}
|
|
1290
1279
|
});
|
|
1291
1280
|
/**
|
|
1292
|
-
*
|
|
1281
|
+
* lattice sensor node [name]
|
|
1293
1282
|
*
|
|
1294
|
-
* The CLI face of the MCP
|
|
1283
|
+
* The CLI face of the MCP lattice_sensor_node tool: one symbol's source +
|
|
1295
1284
|
* caller/callee trail, or a whole file with line numbers + dependents
|
|
1296
1285
|
* (Read-parity). Same subagent/non-MCP rationale as `explore`.
|
|
1297
1286
|
*
|
|
1298
1287
|
* `name` is OPTIONAL because `--file` (file-read mode) carries no symbol —
|
|
1299
|
-
* a required `<name>` made `
|
|
1288
|
+
* a required `<name>` made `lattice sensor node -f <file>` unreachable (#1044).
|
|
1300
1289
|
*/
|
|
1301
1290
|
program
|
|
1302
1291
|
.command('node [name]')
|
|
1303
|
-
.description('One symbol\'s source + caller/callee trail, or read a file with line numbers + dependents (same output as the
|
|
1292
|
+
.description('One symbol\'s source + caller/callee trail, or read a file with line numbers + dependents (same output as the lattice_sensor_node MCP tool)')
|
|
1304
1293
|
.option('-p, --path <path>', 'Project path')
|
|
1305
1294
|
.option('-f, --file <file>', 'Treat as file mode (or disambiguate a symbol to this file)')
|
|
1306
1295
|
.option('--offset <number>', 'File mode: 1-based start line')
|
|
@@ -1308,20 +1297,20 @@ function main() {
|
|
|
1308
1297
|
.option('--symbols-only', 'File mode: just the symbol map + dependents')
|
|
1309
1298
|
.action(async (name, options) => {
|
|
1310
1299
|
// Need a symbol (positional) OR a file (--file / a path-like positional).
|
|
1311
|
-
// With [name] optional, a bare `
|
|
1300
|
+
// With [name] optional, a bare `lattice sensor node` reaches here with neither
|
|
1312
1301
|
// and must be told what to pass, rather than crashing downstream.
|
|
1313
1302
|
if (!name && !options.file) {
|
|
1314
|
-
error("Pass a symbol name (e.g. '
|
|
1303
|
+
error("Pass a symbol name (e.g. 'lattice sensor node parseToken') or a file (e.g. 'lattice sensor node -f src/auth.ts', or 'lattice sensor node src/auth.ts').");
|
|
1315
1304
|
process.exit(1);
|
|
1316
1305
|
}
|
|
1317
1306
|
const projectPath = resolveProjectPath(options.path);
|
|
1318
1307
|
try {
|
|
1319
1308
|
if (!(0, directory_1.isInitialized)(projectPath)) {
|
|
1320
|
-
error(`
|
|
1309
|
+
error(`LatticeSensor isn't available here — no .lattice/sensor/ index exists in ${projectPath}. If you are an AI agent: continue with your usual tools; indexing is the user's decision, do not run it yourself. (The project owner can enable LatticeSensor with 'lattice sensor init'.)`);
|
|
1321
1310
|
process.exit(1);
|
|
1322
1311
|
}
|
|
1323
|
-
const { default:
|
|
1324
|
-
const cg = await
|
|
1312
|
+
const { default: LatticeSensor } = await loadLatticeSensor();
|
|
1313
|
+
const cg = await LatticeSensor.open(projectPath);
|
|
1325
1314
|
const { ToolHandler } = await Promise.resolve().then(() => __importStar(require('../mcp/tools')));
|
|
1326
1315
|
const handler = new ToolHandler(cg);
|
|
1327
1316
|
// A name with a path separator is a file read; otherwise a symbol
|
|
@@ -1354,7 +1343,7 @@ function main() {
|
|
|
1354
1343
|
args.limit = parseInt(options.limit, 10);
|
|
1355
1344
|
if (options.symbolsOnly)
|
|
1356
1345
|
args.symbolsOnly = true;
|
|
1357
|
-
const result = await handler.execute('
|
|
1346
|
+
const result = await handler.execute('lattice_sensor_node', args);
|
|
1358
1347
|
console.log(result.content[0]?.text ?? '');
|
|
1359
1348
|
cg.destroy();
|
|
1360
1349
|
if (result.isError)
|
|
@@ -1366,7 +1355,7 @@ function main() {
|
|
|
1366
1355
|
}
|
|
1367
1356
|
});
|
|
1368
1357
|
/**
|
|
1369
|
-
*
|
|
1358
|
+
* lattice sensor files [path]
|
|
1370
1359
|
*/
|
|
1371
1360
|
program
|
|
1372
1361
|
.command('files')
|
|
@@ -1382,14 +1371,14 @@ function main() {
|
|
|
1382
1371
|
const projectPath = resolveProjectPath(options.path);
|
|
1383
1372
|
try {
|
|
1384
1373
|
if (!(0, directory_1.isInitialized)(projectPath)) {
|
|
1385
|
-
error(`
|
|
1374
|
+
error(`LatticeSensor not initialized in ${projectPath}`);
|
|
1386
1375
|
process.exit(1);
|
|
1387
1376
|
}
|
|
1388
|
-
const { default:
|
|
1389
|
-
const cg = await
|
|
1377
|
+
const { default: LatticeSensor } = await loadLatticeSensor();
|
|
1378
|
+
const cg = await LatticeSensor.open(projectPath);
|
|
1390
1379
|
let files = cg.getFiles();
|
|
1391
1380
|
if (files.length === 0) {
|
|
1392
|
-
info('No files indexed. Run "
|
|
1381
|
+
info('No files indexed. Run "lattice sensor index" first.');
|
|
1393
1382
|
cg.destroy();
|
|
1394
1383
|
return;
|
|
1395
1384
|
}
|
|
@@ -1474,9 +1463,9 @@ function main() {
|
|
|
1474
1463
|
});
|
|
1475
1464
|
/**
|
|
1476
1465
|
* Normalize a user-supplied file path to the project-relative, forward-slash
|
|
1477
|
-
* form
|
|
1466
|
+
* form LatticeSensor stores in the index. Accepts an absolute path, a `./`-prefixed
|
|
1478
1467
|
* path, or Windows back-slashes; an empty string when the input is blank. Used
|
|
1479
|
-
* by `
|
|
1468
|
+
* by `lattice sensor affected` so `./src/x.ts`, `/abs/repo/src/x.ts`, and
|
|
1480
1469
|
* `src/x.ts` all match the same indexed file. (#825)
|
|
1481
1470
|
*/
|
|
1482
1471
|
function normalizeIndexPath(filePath, projectPath) {
|
|
@@ -1553,20 +1542,20 @@ function main() {
|
|
|
1553
1542
|
renderNode(root, '', true, 0);
|
|
1554
1543
|
}
|
|
1555
1544
|
/**
|
|
1556
|
-
*
|
|
1545
|
+
* lattice sensor daemon — interactive manager for the background daemons. Arrow keys
|
|
1557
1546
|
* to pick one (the current project's daemon floats to the top, auto-selected),
|
|
1558
1547
|
* enter to stop it. Falls back to a plain list when output isn't a TTY.
|
|
1559
1548
|
*/
|
|
1560
1549
|
program
|
|
1561
1550
|
.command('daemon')
|
|
1562
1551
|
.aliases(['daemons'])
|
|
1563
|
-
.description('Manage running
|
|
1552
|
+
.description('Manage running LatticeSensor background daemons — pick one and press enter to stop it')
|
|
1564
1553
|
.action(async () => {
|
|
1565
1554
|
const { listDaemons, stopDaemonAt, stopAllDaemons } = await Promise.resolve().then(() => __importStar(require('../mcp/daemon-registry')));
|
|
1566
1555
|
const { runDaemonPicker } = await Promise.resolve().then(() => __importStar(require('../mcp/daemon-manager')));
|
|
1567
1556
|
const daemons = listDaemons();
|
|
1568
1557
|
if (daemons.length === 0) {
|
|
1569
|
-
info('No
|
|
1558
|
+
info('No LatticeSensor daemons running.');
|
|
1570
1559
|
return;
|
|
1571
1560
|
}
|
|
1572
1561
|
// No TTY (piped / CI / non-interactive) — can't do arrow-key selection, so
|
|
@@ -1579,7 +1568,7 @@ function main() {
|
|
|
1579
1568
|
}
|
|
1580
1569
|
// The current project's daemon floats to the top and is pre-selected.
|
|
1581
1570
|
let cwdRoot = null;
|
|
1582
|
-
const found = (0, directory_1.
|
|
1571
|
+
const found = (0, directory_1.findNearestLatticeSensorRoot)(process.cwd());
|
|
1583
1572
|
if (found) {
|
|
1584
1573
|
try {
|
|
1585
1574
|
cwdRoot = fs.realpathSync(found);
|
|
@@ -1589,7 +1578,7 @@ function main() {
|
|
|
1589
1578
|
}
|
|
1590
1579
|
}
|
|
1591
1580
|
const clack = await importESM('@clack/prompts');
|
|
1592
|
-
clack.intro('
|
|
1581
|
+
clack.intro('LatticeSensor daemons');
|
|
1593
1582
|
await runDaemonPicker({
|
|
1594
1583
|
list: listDaemons,
|
|
1595
1584
|
stop: stopDaemonAt,
|
|
@@ -1603,7 +1592,7 @@ function main() {
|
|
|
1603
1592
|
});
|
|
1604
1593
|
});
|
|
1605
1594
|
/**
|
|
1606
|
-
*
|
|
1595
|
+
* lattice sensor serve
|
|
1607
1596
|
*/
|
|
1608
1597
|
program
|
|
1609
1598
|
// Hidden from `--help`: this is the stdio entry point an AI agent launches
|
|
@@ -1612,7 +1601,7 @@ function main() {
|
|
|
1612
1601
|
// invoked — hiding only removes it from the listing. See the interactive-TTY
|
|
1613
1602
|
// guard below, which explains this to anyone who runs it by hand.
|
|
1614
1603
|
.command('serve', { hidden: true })
|
|
1615
|
-
.description('Start
|
|
1604
|
+
.description('Start LatticeSensor as an MCP server for AI assistants')
|
|
1616
1605
|
.option('-p, --path <path>', 'Project path (optional for MCP mode, uses rootUri from client)')
|
|
1617
1606
|
.option('--mcp', 'Run as MCP server (stdio transport)')
|
|
1618
1607
|
.option('--no-watch', 'Disable the file watcher (no auto-sync; useful on slow filesystems like WSL2 /mnt drives)')
|
|
@@ -1621,7 +1610,7 @@ function main() {
|
|
|
1621
1610
|
// Commander sets watch=false when --no-watch is passed. Route it through
|
|
1622
1611
|
// the same env-var chokepoint the watcher and MCP server already honor.
|
|
1623
1612
|
if (options.watch === false) {
|
|
1624
|
-
process.env.
|
|
1613
|
+
process.env.LATTICE_SENSOR_NO_WATCH = '1';
|
|
1625
1614
|
}
|
|
1626
1615
|
try {
|
|
1627
1616
|
if (options.mcp) {
|
|
@@ -1631,13 +1620,13 @@ function main() {
|
|
|
1631
1620
|
// stdin is an interactive TTY, explain instead of hanging. The agent's
|
|
1632
1621
|
// pipe and the detached daemon both have a non-TTY stdin, so this only
|
|
1633
1622
|
// ever fires for a person who typed it.
|
|
1634
|
-
if (process.stdin.isTTY && !process.env.
|
|
1635
|
-
console.error(chalk.bold('\
|
|
1623
|
+
if (process.stdin.isTTY && !process.env.LATTICE_SENSOR_DAEMON_INTERNAL) {
|
|
1624
|
+
console.error(chalk.bold('\nLatticeSensor MCP server\n'));
|
|
1636
1625
|
console.error("This is the MCP server your AI agent (Claude Code, Cursor, Codex, opencode, …)");
|
|
1637
1626
|
console.error("starts automatically — you don't run it yourself.");
|
|
1638
|
-
console.error(`\nIt's already wired up by ${chalk.cyan('
|
|
1639
|
-
console.error(` ${chalk.cyan('
|
|
1640
|
-
console.error(` ${chalk.cyan('
|
|
1627
|
+
console.error(`\nIt's already wired up by ${chalk.cyan('lattice sensor install')}. To check on things:`);
|
|
1628
|
+
console.error(` ${chalk.cyan('lattice sensor status')} ${chalk.dim('— is this project indexed and healthy?')}`);
|
|
1629
|
+
console.error(` ${chalk.cyan('lattice sensor daemon')} ${chalk.dim('— list or stop background MCP servers')}`);
|
|
1641
1630
|
console.error(chalk.dim('\n(Running it directly only does something when an MCP client drives it over stdin.)'));
|
|
1642
1631
|
return;
|
|
1643
1632
|
}
|
|
@@ -1650,28 +1639,28 @@ function main() {
|
|
|
1650
1639
|
else {
|
|
1651
1640
|
// Default: show info about MCP mode.
|
|
1652
1641
|
// Use stderr so stdout stays clean for any piped/stdio usage.
|
|
1653
|
-
console.error(chalk.bold('\
|
|
1642
|
+
console.error(chalk.bold('\nLatticeSensor MCP Server\n'));
|
|
1654
1643
|
console.error(chalk.blue((0, glyphs_1.getGlyphs)().info) + ' Use --mcp flag to start the MCP server');
|
|
1655
1644
|
console.error('\nTo use with Claude Code, add to your MCP configuration:');
|
|
1656
1645
|
console.error(chalk.dim(`
|
|
1657
1646
|
{
|
|
1658
1647
|
"mcpServers": {
|
|
1659
|
-
"
|
|
1660
|
-
"command": "
|
|
1648
|
+
"lattice-sensor": {
|
|
1649
|
+
"command": "lattice-sensor",
|
|
1661
1650
|
"args": ["serve", "--mcp"]
|
|
1662
1651
|
}
|
|
1663
1652
|
}
|
|
1664
1653
|
}
|
|
1665
1654
|
`));
|
|
1666
1655
|
console.error('Available tools:');
|
|
1667
|
-
console.error(chalk.cyan('
|
|
1668
|
-
console.error(chalk.cyan('
|
|
1669
|
-
console.error(chalk.cyan('
|
|
1670
|
-
console.error(chalk.cyan('
|
|
1671
|
-
console.error(chalk.cyan('
|
|
1672
|
-
console.error(chalk.cyan('
|
|
1673
|
-
console.error(chalk.cyan('
|
|
1674
|
-
console.error(chalk.cyan('
|
|
1656
|
+
console.error(chalk.cyan(' lattice_sensor_explore') + ' - Primary: source of the relevant symbols for any question');
|
|
1657
|
+
console.error(chalk.cyan(' lattice_sensor_search') + ' - Search for code symbols');
|
|
1658
|
+
console.error(chalk.cyan(' lattice_sensor_callers') + ' - Find callers of a symbol');
|
|
1659
|
+
console.error(chalk.cyan(' lattice_sensor_callees') + ' - Find what a symbol calls');
|
|
1660
|
+
console.error(chalk.cyan(' lattice_sensor_impact') + ' - Analyze impact of changes');
|
|
1661
|
+
console.error(chalk.cyan(' lattice_sensor_node') + ' - Get symbol details');
|
|
1662
|
+
console.error(chalk.cyan(' lattice_sensor_files') + ' - Get project file structure');
|
|
1663
|
+
console.error(chalk.cyan(' lattice_sensor_status') + ' - Get index status');
|
|
1675
1664
|
}
|
|
1676
1665
|
}
|
|
1677
1666
|
catch (err) {
|
|
@@ -1680,7 +1669,7 @@ function main() {
|
|
|
1680
1669
|
}
|
|
1681
1670
|
});
|
|
1682
1671
|
/**
|
|
1683
|
-
*
|
|
1672
|
+
* lattice sensor unlock [path]
|
|
1684
1673
|
*/
|
|
1685
1674
|
program
|
|
1686
1675
|
.command('unlock [path]')
|
|
@@ -1689,10 +1678,10 @@ function main() {
|
|
|
1689
1678
|
const projectPath = resolveProjectPath(pathArg);
|
|
1690
1679
|
try {
|
|
1691
1680
|
if (!(0, directory_1.isInitialized)(projectPath)) {
|
|
1692
|
-
error(`
|
|
1681
|
+
error(`LatticeSensor not initialized in ${projectPath}`);
|
|
1693
1682
|
return;
|
|
1694
1683
|
}
|
|
1695
|
-
const lockPath = path.join((0, directory_1.
|
|
1684
|
+
const lockPath = path.join((0, directory_1.getLatticeSensorDir)(projectPath), 'sensor.lock');
|
|
1696
1685
|
if (!fs.existsSync(lockPath)) {
|
|
1697
1686
|
info(`No lock file found ${(0, glyphs_1.getGlyphs)().dash} nothing to do`);
|
|
1698
1687
|
return;
|
|
@@ -1706,9 +1695,9 @@ function main() {
|
|
|
1706
1695
|
}
|
|
1707
1696
|
});
|
|
1708
1697
|
/**
|
|
1709
|
-
*
|
|
1698
|
+
* lattice sensor callers <symbol>
|
|
1710
1699
|
*
|
|
1711
|
-
* CLI parity with the MCP graph tools (
|
|
1700
|
+
* CLI parity with the MCP graph tools (lattice_sensor_callers/callees/impact) so the
|
|
1712
1701
|
* traversal queries work in scripts, CI, and git hooks without a running MCP
|
|
1713
1702
|
* server.
|
|
1714
1703
|
*/
|
|
@@ -1722,11 +1711,11 @@ function main() {
|
|
|
1722
1711
|
const projectPath = resolveProjectPath(options.path);
|
|
1723
1712
|
try {
|
|
1724
1713
|
if (!(0, directory_1.isInitialized)(projectPath)) {
|
|
1725
|
-
error(`
|
|
1714
|
+
error(`LatticeSensor not initialized in ${projectPath}`);
|
|
1726
1715
|
process.exit(1);
|
|
1727
1716
|
}
|
|
1728
|
-
const { default:
|
|
1729
|
-
const cg = await
|
|
1717
|
+
const { default: LatticeSensor } = await loadLatticeSensor();
|
|
1718
|
+
const cg = await LatticeSensor.open(projectPath);
|
|
1730
1719
|
const limit = parseInt(options.limit || '20', 10);
|
|
1731
1720
|
const matches = cg.searchNodes(symbol, { limit: 50 });
|
|
1732
1721
|
if (matches.length === 0) {
|
|
@@ -1781,7 +1770,7 @@ function main() {
|
|
|
1781
1770
|
}
|
|
1782
1771
|
});
|
|
1783
1772
|
/**
|
|
1784
|
-
*
|
|
1773
|
+
* lattice sensor callees <symbol>
|
|
1785
1774
|
*/
|
|
1786
1775
|
program
|
|
1787
1776
|
.command('callees <symbol>')
|
|
@@ -1793,11 +1782,11 @@ function main() {
|
|
|
1793
1782
|
const projectPath = resolveProjectPath(options.path);
|
|
1794
1783
|
try {
|
|
1795
1784
|
if (!(0, directory_1.isInitialized)(projectPath)) {
|
|
1796
|
-
error(`
|
|
1785
|
+
error(`LatticeSensor not initialized in ${projectPath}`);
|
|
1797
1786
|
process.exit(1);
|
|
1798
1787
|
}
|
|
1799
|
-
const { default:
|
|
1800
|
-
const cg = await
|
|
1788
|
+
const { default: LatticeSensor } = await loadLatticeSensor();
|
|
1789
|
+
const cg = await LatticeSensor.open(projectPath);
|
|
1801
1790
|
const limit = parseInt(options.limit || '20', 10);
|
|
1802
1791
|
const matches = cg.searchNodes(symbol, { limit: 50 });
|
|
1803
1792
|
if (matches.length === 0) {
|
|
@@ -1851,7 +1840,7 @@ function main() {
|
|
|
1851
1840
|
}
|
|
1852
1841
|
});
|
|
1853
1842
|
/**
|
|
1854
|
-
*
|
|
1843
|
+
* lattice sensor impact <symbol>
|
|
1855
1844
|
*/
|
|
1856
1845
|
program
|
|
1857
1846
|
.command('impact <symbol>')
|
|
@@ -1863,11 +1852,11 @@ function main() {
|
|
|
1863
1852
|
const projectPath = resolveProjectPath(options.path);
|
|
1864
1853
|
try {
|
|
1865
1854
|
if (!(0, directory_1.isInitialized)(projectPath)) {
|
|
1866
|
-
error(`
|
|
1855
|
+
error(`LatticeSensor not initialized in ${projectPath}`);
|
|
1867
1856
|
process.exit(1);
|
|
1868
1857
|
}
|
|
1869
|
-
const { default:
|
|
1870
|
-
const cg = await
|
|
1858
|
+
const { default: LatticeSensor } = await loadLatticeSensor();
|
|
1859
|
+
const cg = await LatticeSensor.open(projectPath);
|
|
1871
1860
|
const depth = Math.min(Math.max(parseInt(options.depth || '2', 10), 1), 10);
|
|
1872
1861
|
const matches = cg.searchNodes(symbol, { limit: 50 });
|
|
1873
1862
|
if (matches.length === 0) {
|
|
@@ -1941,14 +1930,14 @@ function main() {
|
|
|
1941
1930
|
}
|
|
1942
1931
|
});
|
|
1943
1932
|
/**
|
|
1944
|
-
*
|
|
1933
|
+
* lattice sensor affected [files...]
|
|
1945
1934
|
*
|
|
1946
1935
|
* Find test files affected by the given source files.
|
|
1947
1936
|
* Traces dependency edges transitively to find test files that depend on changed code.
|
|
1948
1937
|
*
|
|
1949
1938
|
* Usage:
|
|
1950
|
-
* git diff --name-only |
|
|
1951
|
-
*
|
|
1939
|
+
* git diff --name-only | lattice sensor affected --stdin
|
|
1940
|
+
* lattice sensor affected src/lib/components/Editor.svelte src/routes/+page.svelte
|
|
1952
1941
|
*/
|
|
1953
1942
|
program
|
|
1954
1943
|
.command('affected [files...]')
|
|
@@ -1963,7 +1952,7 @@ function main() {
|
|
|
1963
1952
|
const projectPath = resolveProjectPath(options.path);
|
|
1964
1953
|
try {
|
|
1965
1954
|
if (!(0, directory_1.isInitialized)(projectPath)) {
|
|
1966
|
-
error(`
|
|
1955
|
+
error(`LatticeSensor not initialized in ${projectPath}`);
|
|
1967
1956
|
process.exit(1);
|
|
1968
1957
|
}
|
|
1969
1958
|
// Collect changed files from args or stdin
|
|
@@ -1985,18 +1974,9 @@ function main() {
|
|
|
1985
1974
|
info('No files provided. Use file arguments or --stdin.');
|
|
1986
1975
|
process.exit(0);
|
|
1987
1976
|
}
|
|
1988
|
-
const { default:
|
|
1989
|
-
const cg = await
|
|
1977
|
+
const { default: LatticeSensor } = await loadLatticeSensor();
|
|
1978
|
+
const cg = await LatticeSensor.open(projectPath);
|
|
1990
1979
|
const maxDepth = parseInt(options.depth || '5', 10);
|
|
1991
|
-
// Common test file patterns
|
|
1992
|
-
const defaultTestPatterns = [
|
|
1993
|
-
/\.spec\./,
|
|
1994
|
-
/\.test\./,
|
|
1995
|
-
/\/__tests__\//,
|
|
1996
|
-
/\/tests?\//,
|
|
1997
|
-
/\/e2e\//,
|
|
1998
|
-
/\/spec\//,
|
|
1999
|
-
];
|
|
2000
1980
|
// Custom filter pattern
|
|
2001
1981
|
let customFilter = null;
|
|
2002
1982
|
if (options.filter) {
|
|
@@ -2008,17 +1988,17 @@ function main() {
|
|
|
2008
1988
|
.replace(/\*/g, '[^/]*');
|
|
2009
1989
|
customFilter = new RegExp(regex);
|
|
2010
1990
|
}
|
|
2011
|
-
function
|
|
1991
|
+
function matchesTestFile(filePath) {
|
|
2012
1992
|
if (customFilter)
|
|
2013
1993
|
return customFilter.test(filePath);
|
|
2014
|
-
return
|
|
1994
|
+
return (0, query_utils_1.isRunnableTestFile)(filePath);
|
|
2015
1995
|
}
|
|
2016
1996
|
// BFS to find all transitive dependents of changed files, filtered to test files
|
|
2017
1997
|
const affectedTests = new Set();
|
|
2018
1998
|
const allDependents = new Set();
|
|
2019
1999
|
for (const file of changedFiles) {
|
|
2020
2000
|
// If the changed file is itself a test file, include it
|
|
2021
|
-
if (
|
|
2001
|
+
if (matchesTestFile(file)) {
|
|
2022
2002
|
affectedTests.add(file);
|
|
2023
2003
|
continue;
|
|
2024
2004
|
}
|
|
@@ -2036,7 +2016,7 @@ function main() {
|
|
|
2036
2016
|
continue;
|
|
2037
2017
|
visited.add(dep);
|
|
2038
2018
|
allDependents.add(dep);
|
|
2039
|
-
if (
|
|
2019
|
+
if (matchesTestFile(dep)) {
|
|
2040
2020
|
affectedTests.add(dep);
|
|
2041
2021
|
}
|
|
2042
2022
|
else {
|
|
@@ -2078,127 +2058,26 @@ function main() {
|
|
|
2078
2058
|
}
|
|
2079
2059
|
});
|
|
2080
2060
|
/**
|
|
2081
|
-
*
|
|
2061
|
+
* Standalone install/uninstall retired by ADR 0059.
|
|
2062
|
+
* Host wiring and retirement are owned by dotagents; this internal sensor
|
|
2063
|
+
* cannot register or remove MCP servers or packages.
|
|
2082
2064
|
*/
|
|
2083
2065
|
program
|
|
2084
|
-
.command(
|
|
2085
|
-
.description(
|
|
2086
|
-
.
|
|
2087
|
-
|
|
2088
|
-
.
|
|
2089
|
-
.option('--no-permissions', 'Skip writing the auto-allow permissions list (Claude Code only)')
|
|
2090
|
-
.option('--print-config <id>', 'Print MCP config snippet for the named agent and exit (no file writes)')
|
|
2091
|
-
.option('--refresh', 'Rewrite what previous installs configured, for already-configured agents only (never adds new ones). Run automatically by `codegraph upgrade`')
|
|
2092
|
-
.action(async (opts) => {
|
|
2093
|
-
if (opts.printConfig) {
|
|
2094
|
-
const { getTarget, listTargetIds } = await Promise.resolve().then(() => __importStar(require('../installer/targets/registry')));
|
|
2095
|
-
const target = getTarget(opts.printConfig);
|
|
2096
|
-
if (!target) {
|
|
2097
|
-
const known = listTargetIds().join(', ');
|
|
2098
|
-
error(`Unknown target "${opts.printConfig}". Known: ${known}.`);
|
|
2099
|
-
process.exit(1);
|
|
2100
|
-
}
|
|
2101
|
-
const loc = (opts.location === 'local' ? 'local' : 'global');
|
|
2102
|
-
process.stdout.write(target.printConfig(loc));
|
|
2103
|
-
return;
|
|
2104
|
-
}
|
|
2105
|
-
// --refresh: non-interactive sweep that re-writes what previous
|
|
2106
|
-
// installs configured (instructions section, MCP entry, legacy-hook
|
|
2107
|
-
// cleanups) for already-configured agents, so those surfaces match
|
|
2108
|
-
// THIS binary's templates. Skips everything else — never a first
|
|
2109
|
-
// install, never touches permissions or the prompt hook. Sweeps both
|
|
2110
|
-
// locations unless --location narrows it.
|
|
2111
|
-
if (opts.refresh) {
|
|
2112
|
-
const { refreshTargets } = await Promise.resolve().then(() => __importStar(require('../installer')));
|
|
2113
|
-
const { ALL_TARGETS } = await Promise.resolve().then(() => __importStar(require('../installer/targets/registry')));
|
|
2114
|
-
if (opts.location && opts.location !== 'global' && opts.location !== 'local') {
|
|
2115
|
-
error(`--location must be "global" or "local" (got "${opts.location}").`);
|
|
2116
|
-
process.exit(1);
|
|
2117
|
-
}
|
|
2118
|
-
const locs = opts.location
|
|
2119
|
-
? [opts.location]
|
|
2120
|
-
: ['global', 'local'];
|
|
2121
|
-
let changed = 0;
|
|
2122
|
-
for (const loc of locs) {
|
|
2123
|
-
for (const report of refreshTargets(ALL_TARGETS, loc)) {
|
|
2124
|
-
for (const p of report.changedPaths) {
|
|
2125
|
-
changed += 1;
|
|
2126
|
-
console.log(` ${report.displayName}: refreshed ${p}`);
|
|
2127
|
-
}
|
|
2128
|
-
}
|
|
2129
|
-
}
|
|
2130
|
-
if (changed === 0) {
|
|
2131
|
-
console.log('All configured agent surfaces are already current.');
|
|
2132
|
-
}
|
|
2133
|
-
return;
|
|
2134
|
-
}
|
|
2135
|
-
const { runInstallerWithOptions } = await Promise.resolve().then(() => __importStar(require('../installer')));
|
|
2136
|
-
if (opts.location && opts.location !== 'global' && opts.location !== 'local') {
|
|
2137
|
-
error(`--location must be "global" or "local" (got "${opts.location}").`);
|
|
2138
|
-
process.exit(1);
|
|
2139
|
-
}
|
|
2140
|
-
try {
|
|
2141
|
-
// Commander's `--no-permissions` makes `opts.permissions === false`;
|
|
2142
|
-
// omitting the flag leaves it `true` (the positive-form default).
|
|
2143
|
-
// We MUST treat the default-true as "user did not override — let
|
|
2144
|
-
// the orchestrator prompt" and only forward an explicit `false`
|
|
2145
|
-
// (or `true` when --yes implies it). Otherwise the auto-allow
|
|
2146
|
-
// prompt is silently skipped on every interactive run.
|
|
2147
|
-
const explicitNoPermissions = opts.permissions === false;
|
|
2148
|
-
const autoAllow = explicitNoPermissions
|
|
2149
|
-
? false
|
|
2150
|
-
: opts.yes
|
|
2151
|
-
? true
|
|
2152
|
-
: undefined;
|
|
2153
|
-
await runInstallerWithOptions({
|
|
2154
|
-
target: opts.target,
|
|
2155
|
-
location: opts.location,
|
|
2156
|
-
autoAllow,
|
|
2157
|
-
yes: opts.yes,
|
|
2158
|
-
});
|
|
2159
|
-
}
|
|
2160
|
-
catch (err) {
|
|
2161
|
-
error(err instanceof Error ? err.message : String(err));
|
|
2162
|
-
process.exit(1);
|
|
2163
|
-
}
|
|
2066
|
+
.command("install")
|
|
2067
|
+
.description("Retired: use the dotagents Lattice host wiring")
|
|
2068
|
+
.action(() => {
|
|
2069
|
+
error("Retired: Lattice sensor does not install independent MCP wiring.");
|
|
2070
|
+
process.exit(1);
|
|
2164
2071
|
});
|
|
2165
|
-
/**
|
|
2166
|
-
* codegraph uninstall
|
|
2167
|
-
*
|
|
2168
|
-
* Inverse of `install`. Removes the codegraph MCP server entry,
|
|
2169
|
-
* instructions block, and permissions from every agent (or a
|
|
2170
|
-
* `--target` subset). Prompts global-vs-local when not given. Does NOT
|
|
2171
|
-
* delete the `.codegraph/` index — that's `codegraph uninit`.
|
|
2172
|
-
*/
|
|
2173
2072
|
program
|
|
2174
|
-
.command(
|
|
2175
|
-
.description(
|
|
2176
|
-
.
|
|
2177
|
-
|
|
2178
|
-
.
|
|
2179
|
-
.option('--keep-cli', 'Remove agent configs only — leave the codegraph CLI installed')
|
|
2180
|
-
.action(async (opts) => {
|
|
2181
|
-
const { runUninstaller } = await Promise.resolve().then(() => __importStar(require('../installer')));
|
|
2182
|
-
if (opts.location && opts.location !== 'global' && opts.location !== 'local') {
|
|
2183
|
-
error(`--location must be "global" or "local" (got "${opts.location}").`);
|
|
2184
|
-
process.exit(1);
|
|
2185
|
-
}
|
|
2186
|
-
try {
|
|
2187
|
-
await runUninstaller({
|
|
2188
|
-
target: opts.target,
|
|
2189
|
-
location: opts.location,
|
|
2190
|
-
yes: opts.yes,
|
|
2191
|
-
keepCli: opts.keepCli,
|
|
2192
|
-
cliFilename: __filename,
|
|
2193
|
-
});
|
|
2194
|
-
}
|
|
2195
|
-
catch (err) {
|
|
2196
|
-
error(err instanceof Error ? err.message : String(err));
|
|
2197
|
-
process.exit(1);
|
|
2198
|
-
}
|
|
2073
|
+
.command("uninstall")
|
|
2074
|
+
.description("Retired: use the dotagents Lattice sensor retirement transaction")
|
|
2075
|
+
.action(() => {
|
|
2076
|
+
error("Retired: use the dotagents host cutover transaction.");
|
|
2077
|
+
process.exit(1);
|
|
2199
2078
|
});
|
|
2200
2079
|
/**
|
|
2201
|
-
*
|
|
2080
|
+
* lattice sensor telemetry [on|off|status]
|
|
2202
2081
|
*/
|
|
2203
2082
|
program
|
|
2204
2083
|
.command('telemetry [action]')
|
|
@@ -2214,7 +2093,7 @@ function main() {
|
|
|
2214
2093
|
success('Telemetry disabled. Buffered, unsent data was deleted.');
|
|
2215
2094
|
}
|
|
2216
2095
|
const effective = t.getStatus();
|
|
2217
|
-
if (effective.decidedBy === 'DO_NOT_TRACK' || effective.decidedBy === '
|
|
2096
|
+
if (effective.decidedBy === 'DO_NOT_TRACK' || effective.decidedBy === 'LATTICE_SENSOR_TELEMETRY') {
|
|
2218
2097
|
warn(`The ${effective.decidedBy} environment variable overrides this choice — ` +
|
|
2219
2098
|
`effective state right now: ${effective.enabled ? 'enabled' : 'disabled'}.`);
|
|
2220
2099
|
}
|
|
@@ -2227,7 +2106,7 @@ function main() {
|
|
|
2227
2106
|
const s = t.getStatus();
|
|
2228
2107
|
const decidedBy = {
|
|
2229
2108
|
DO_NOT_TRACK: 'DO_NOT_TRACK environment variable',
|
|
2230
|
-
|
|
2109
|
+
LATTICE_SENSOR_TELEMETRY: 'LATTICE_SENSOR_TELEMETRY environment variable',
|
|
2231
2110
|
config: 'your saved choice',
|
|
2232
2111
|
default: 'default',
|
|
2233
2112
|
};
|
|
@@ -2237,12 +2116,12 @@ function main() {
|
|
|
2237
2116
|
console.log(chalk.dim(`\nExactly what is collected (and never collected): ${telemetry_1.TELEMETRY_DOCS}\n`));
|
|
2238
2117
|
});
|
|
2239
2118
|
/**
|
|
2240
|
-
*
|
|
2119
|
+
* lattice sensor upgrade [version]
|
|
2241
2120
|
*
|
|
2242
2121
|
* ADR 0049 Decision 4: upstream's self-update path (bundle install.sh/.ps1
|
|
2243
2122
|
* download, npm reinstall, GitHub release resolution) is disabled for
|
|
2244
2123
|
* Lattice — running it would silently overwrite this fork's ADR 0047/0048
|
|
2245
|
-
* improvements with an upstream
|
|
2124
|
+
* improvements with an upstream LatticeSensor build and reach
|
|
2246
2125
|
* raw.githubusercontent.com / api.github.com / GitHub release assets, which
|
|
2247
2126
|
* the MCP surface contract forbids. The command stays registered (so it
|
|
2248
2127
|
* doesn't look unrecognized) but refuses to run and points at Lattice's own
|
|
@@ -2250,30 +2129,30 @@ function main() {
|
|
|
2250
2129
|
*/
|
|
2251
2130
|
program
|
|
2252
2131
|
.command('upgrade [version]')
|
|
2253
|
-
.description('Disabled on Lattice — see the Lattice release channel instead of upstream
|
|
2132
|
+
.description('Disabled on Lattice — see the Lattice release channel instead of upstream LatticeSensor')
|
|
2254
2133
|
.option('--check', 'Check whether an update is available without installing')
|
|
2255
2134
|
.option('-f, --force', 'Reinstall even if already on the target version')
|
|
2256
2135
|
.action(async () => {
|
|
2257
|
-
error('Disabled: `
|
|
2136
|
+
error('Disabled: `lattice sensor upgrade` self-updates from the upstream LatticeSensor project ' +
|
|
2258
2137
|
'(GitHub releases / npm), which would overwrite Lattice sensor\'s own fork changes. ' +
|
|
2259
2138
|
'Update Lattice through its own release channel instead.');
|
|
2260
2139
|
process.exit(1);
|
|
2261
2140
|
});
|
|
2262
2141
|
/**
|
|
2263
|
-
*
|
|
2142
|
+
* lattice sensor version
|
|
2264
2143
|
*
|
|
2265
2144
|
* The bare-noun form of `--version`. commander already provides `--version`
|
|
2266
2145
|
* and `-V`, and the `-v` / `-version` spellings are intercepted before parse
|
|
2267
|
-
* (see top of main). This subcommand makes `
|
|
2268
|
-
* the version affordance in `
|
|
2146
|
+
* (see top of main). This subcommand makes `lattice sensor version` work and lists
|
|
2147
|
+
* the version affordance in `lattice sensor --help`.
|
|
2269
2148
|
*/
|
|
2270
2149
|
program
|
|
2271
2150
|
.command('version')
|
|
2272
|
-
.description('Print the installed
|
|
2151
|
+
.description('Print the installed LatticeSensor version (also: -v, --version)')
|
|
2273
2152
|
.action(() => {
|
|
2274
2153
|
console.log(packageJson.version);
|
|
2275
2154
|
});
|
|
2276
2155
|
// Parse and run
|
|
2277
2156
|
program.parse();
|
|
2278
2157
|
} // end main()
|
|
2279
|
-
//# sourceMappingURL=
|
|
2158
|
+
//# sourceMappingURL=lattice-sensor.js.map
|