@vibgrate/cli 2026.814.2 → 2026.817.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/DOCS.md +61 -0
- package/README.md +1 -0
- package/dist/agent-UQC7QN77.js +27 -0
- package/dist/{agent-5ANHRYEI.js.map → agent-UQC7QN77.js.map} +1 -1
- package/dist/{approvals-T2KXPJLV.js → approvals-ASPJQUZK.js} +6 -5
- package/dist/{approvals-T2KXPJLV.js.map → approvals-ASPJQUZK.js.map} +1 -1
- package/dist/baseline-FIV6PR2M.js +9 -0
- package/dist/{baseline-WVD6P5IO.js.map → baseline-FIV6PR2M.js.map} +1 -1
- package/dist/{chunk-FOW5IF73.js → chunk-2FEB5KJS.js} +11 -34
- package/dist/chunk-2FEB5KJS.js.map +1 -0
- package/dist/{chunk-WQLZSVNF.js → chunk-3FMRFECC.js} +7 -6
- package/dist/chunk-3FMRFECC.js.map +1 -0
- package/dist/{chunk-7QDHQLUS.js → chunk-3H3SVJUY.js} +13 -11
- package/dist/chunk-3H3SVJUY.js.map +1 -0
- package/dist/{chunk-REIGWTTH.js → chunk-3HNPVXUK.js} +3 -3
- package/dist/{chunk-REIGWTTH.js.map → chunk-3HNPVXUK.js.map} +1 -1
- package/dist/{chunk-YQNTIBKS.js → chunk-3NJUOIZQ.js} +6 -6
- package/dist/{chunk-YQNTIBKS.js.map → chunk-3NJUOIZQ.js.map} +1 -1
- package/dist/{chunk-BH54SLGZ.js → chunk-5OL2TSHK.js} +4 -4
- package/dist/{chunk-BH54SLGZ.js.map → chunk-5OL2TSHK.js.map} +1 -1
- package/dist/{chunk-TFAXW7VM.js → chunk-6K3XK7C5.js} +69 -976
- package/dist/chunk-6K3XK7C5.js.map +1 -0
- package/dist/{chunk-N3XFY3PX.js → chunk-74UBGF4P.js} +3 -3
- package/dist/{chunk-N3XFY3PX.js.map → chunk-74UBGF4P.js.map} +1 -1
- package/dist/{chunk-X76VPOYH.js → chunk-AXZZ5CCG.js} +4 -4
- package/dist/{chunk-X76VPOYH.js.map → chunk-AXZZ5CCG.js.map} +1 -1
- package/dist/{chunk-5GLQNMTI.js → chunk-C3LMWZKF.js} +6 -6
- package/dist/{chunk-5GLQNMTI.js.map → chunk-C3LMWZKF.js.map} +1 -1
- package/dist/{chunk-WWGLVF7D.js → chunk-DVW3SVCW.js} +9 -8
- package/dist/chunk-DVW3SVCW.js.map +1 -0
- package/dist/{chunk-TNROG5CO.js → chunk-E2FAQREZ.js} +1739 -116
- package/dist/chunk-E2FAQREZ.js.map +1 -0
- package/dist/{chunk-7NMXE6KG.js → chunk-EXV4QSAD.js} +4 -4
- package/dist/{chunk-7NMXE6KG.js.map → chunk-EXV4QSAD.js.map} +1 -1
- package/dist/{chunk-3LSG7Z4I.js → chunk-EZ7UC5Y5.js} +25 -4
- package/dist/chunk-EZ7UC5Y5.js.map +1 -0
- package/dist/{chunk-OWSFZQOP.js → chunk-FJG5AXKZ.js} +3 -3
- package/dist/{chunk-OWSFZQOP.js.map → chunk-FJG5AXKZ.js.map} +1 -1
- package/dist/{chunk-NKFXXP6W.js → chunk-GOGMS3ST.js} +8 -6
- package/dist/chunk-GOGMS3ST.js.map +1 -0
- package/dist/{chunk-WHJMS7XC.js → chunk-I5LP55B6.js} +3 -3
- package/dist/{chunk-WHJMS7XC.js.map → chunk-I5LP55B6.js.map} +1 -1
- package/dist/{chunk-IHXNOY3R.js → chunk-K6DXETMC.js} +12 -12
- package/dist/{chunk-IHXNOY3R.js.map → chunk-K6DXETMC.js.map} +1 -1
- package/dist/{chunk-DSUGC7F5.js → chunk-KJT2R6WW.js} +4 -4
- package/dist/{chunk-DSUGC7F5.js.map → chunk-KJT2R6WW.js.map} +1 -1
- package/dist/chunk-KNGAZDGF.js +467 -0
- package/dist/chunk-KNGAZDGF.js.map +1 -0
- package/dist/{chunk-JCN6MSXQ.js → chunk-LHKQGVRF.js} +17 -29
- package/dist/chunk-LHKQGVRF.js.map +1 -0
- package/dist/{chunk-YNV5M3JW.js → chunk-M7IO3DXH.js} +9 -8
- package/dist/chunk-M7IO3DXH.js.map +1 -0
- package/dist/chunk-MS6V5XKB.js +33 -0
- package/dist/chunk-MS6V5XKB.js.map +1 -0
- package/dist/{chunk-2U37PFB2.js → chunk-MVPRPSXU.js} +7 -4
- package/dist/chunk-MVPRPSXU.js.map +1 -0
- package/dist/{chunk-DT4KIVRI.js → chunk-NG4KIJW6.js} +34 -2
- package/dist/chunk-NG4KIJW6.js.map +1 -0
- package/dist/{chunk-IHLLWBZU.js → chunk-O2DL2Q55.js} +6 -6
- package/dist/{chunk-IHLLWBZU.js.map → chunk-O2DL2Q55.js.map} +1 -1
- package/dist/chunk-O3LABX6I.js +43 -0
- package/dist/chunk-O3LABX6I.js.map +1 -0
- package/dist/chunk-OZ3IFXRD.js +22 -0
- package/dist/chunk-OZ3IFXRD.js.map +1 -0
- package/dist/chunk-PRG2ULPK.js +6 -0
- package/dist/{chunk-2H2U3DC7.js.map → chunk-PRG2ULPK.js.map} +1 -1
- package/dist/{chunk-TVDYEHIM.js → chunk-Q3M6K3HY.js} +3 -3
- package/dist/{chunk-TVDYEHIM.js.map → chunk-Q3M6K3HY.js.map} +1 -1
- package/dist/{chunk-KGPX4EUN.js → chunk-Q4G2BWE3.js} +4 -4
- package/dist/{chunk-KGPX4EUN.js.map → chunk-Q4G2BWE3.js.map} +1 -1
- package/dist/chunk-T7RSQ5WD.js +227 -0
- package/dist/chunk-T7RSQ5WD.js.map +1 -0
- package/dist/{chunk-54RGT2T5.js → chunk-TVDMNIUT.js} +3 -3
- package/dist/{chunk-54RGT2T5.js.map → chunk-TVDMNIUT.js.map} +1 -1
- package/dist/{chunk-N6ZMZ5AI.js → chunk-WAKP7SK7.js} +4922 -1011
- package/dist/chunk-WAKP7SK7.js.map +1 -0
- package/dist/{chunk-75LJM5XD.js → chunk-WVMOGIPC.js} +9 -43
- package/dist/chunk-WVMOGIPC.js.map +1 -0
- package/dist/{chunk-UTNNGKKX.js → chunk-XLXJC7H3.js} +142 -14
- package/dist/chunk-XLXJC7H3.js.map +1 -0
- package/dist/cli.js +1727 -1127
- package/dist/cli.js.map +1 -1
- package/dist/daemon-FPTRHO5N.js +26 -0
- package/dist/daemon-FPTRHO5N.js.map +1 -0
- package/dist/embed-worker-main.js +5 -4
- package/dist/embed-worker-main.js.map +1 -1
- package/dist/ensure-map-342G2IV3.js +33 -0
- package/dist/{ensure-map-HQ7A5NDL.js.map → ensure-map-342G2IV3.js.map} +1 -1
- package/dist/{fs-NTQUFCXV.js → fs-TLPOWC2D.js} +3 -3
- package/dist/fs-TLPOWC2D.js.map +1 -0
- package/dist/graph-backend-RNWQBT3P.js +15 -0
- package/dist/{graph-backend-W2TNTMY7.js.map → graph-backend-RNWQBT3P.js.map} +1 -1
- package/dist/index.d.ts +28 -6
- package/dist/index.js +21 -18
- package/dist/index.js.map +1 -1
- package/dist/{interactive-EW2VJ3BZ.js → interactive-SR7TMF6M.js} +36 -33
- package/dist/interactive-SR7TMF6M.js.map +1 -0
- package/dist/load-AYFECIQB.js +11 -0
- package/dist/{load-64RK5O6C.js.map → load-AYFECIQB.js.map} +1 -1
- package/dist/local-runtime-6SNWKSA7.js +6 -0
- package/dist/{local-runtime-2ED33KK6.js.map → local-runtime-6SNWKSA7.js.map} +1 -1
- package/dist/model-manager-SXHZ5VD4.js +10 -0
- package/dist/{model-manager-GJ2YSTSK.js.map → model-manager-SXHZ5VD4.js.map} +1 -1
- package/dist/parse-worker.d.ts +1 -1
- package/dist/parse-worker.js +5 -2
- package/dist/parse-worker.js.map +1 -1
- package/dist/{run-outcome-6QNQIHPV.js → run-outcome-YQQJG3LW.js} +7 -6
- package/dist/run-outcome-YQQJG3LW.js.map +1 -0
- package/dist/runtime-session-CNJ4DAV5.js +22 -0
- package/dist/{runtime-session-RJHH3KMF.js.map → runtime-session-CNJ4DAV5.js.map} +1 -1
- package/dist/session-H34HUV2Y.js +17 -0
- package/dist/{session-4BGYASOH.js.map → session-H34HUV2Y.js.map} +1 -1
- package/dist/{stream-json-GY5N7WZT.js → stream-json-55YDNAFX.js} +18 -17
- package/dist/stream-json-55YDNAFX.js.map +1 -0
- package/dist/{types-DLH-Ritr.d.ts → types-DHqH0XIE.d.ts} +68 -6
- package/dist/version-WSE3QOPK.js +4 -0
- package/dist/{version-DPAMQW6M.js.map → version-WSE3QOPK.js.map} +1 -1
- package/dist/{vg-mcp-bridge-IGHJKKSL.js → vg-mcp-bridge-2CNLHNEL.js} +13 -12
- package/dist/vg-mcp-bridge-2CNLHNEL.js.map +1 -0
- package/dist/{vgd-ORPA5C2K.js → vgd-URUZQORN.js} +10 -9
- package/dist/vgd-URUZQORN.js.map +1 -0
- package/grammars/tree-sitter-hcl.wasm +0 -0
- package/package.json +9 -8
- package/dist/agent-5ANHRYEI.js +0 -26
- package/dist/baseline-WVD6P5IO.js +0 -9
- package/dist/chunk-2H2U3DC7.js +0 -6
- package/dist/chunk-2U37PFB2.js.map +0 -1
- package/dist/chunk-3LSG7Z4I.js.map +0 -1
- package/dist/chunk-75LJM5XD.js.map +0 -1
- package/dist/chunk-7QDHQLUS.js.map +0 -1
- package/dist/chunk-DT4KIVRI.js.map +0 -1
- package/dist/chunk-FOW5IF73.js.map +0 -1
- package/dist/chunk-JCN6MSXQ.js.map +0 -1
- package/dist/chunk-N6ZMZ5AI.js.map +0 -1
- package/dist/chunk-NKFXXP6W.js.map +0 -1
- package/dist/chunk-RXP66R2E.js +0 -39
- package/dist/chunk-RXP66R2E.js.map +0 -1
- package/dist/chunk-TFAXW7VM.js.map +0 -1
- package/dist/chunk-TNROG5CO.js.map +0 -1
- package/dist/chunk-UTNNGKKX.js.map +0 -1
- package/dist/chunk-WQLZSVNF.js.map +0 -1
- package/dist/chunk-WWGLVF7D.js.map +0 -1
- package/dist/chunk-YNV5M3JW.js.map +0 -1
- package/dist/ensure-map-HQ7A5NDL.js +0 -30
- package/dist/fs-NTQUFCXV.js.map +0 -1
- package/dist/graph-backend-W2TNTMY7.js +0 -14
- package/dist/interactive-EW2VJ3BZ.js.map +0 -1
- package/dist/load-64RK5O6C.js +0 -10
- package/dist/local-runtime-2ED33KK6.js +0 -6
- package/dist/model-manager-GJ2YSTSK.js +0 -10
- package/dist/run-outcome-6QNQIHPV.js.map +0 -1
- package/dist/runtime-session-RJHH3KMF.js +0 -21
- package/dist/session-4BGYASOH.js +0 -16
- package/dist/stream-json-GY5N7WZT.js.map +0 -1
- package/dist/version-DPAMQW6M.js +0 -4
- package/dist/vg-mcp-bridge-IGHJKKSL.js.map +0 -1
- package/dist/vgd-ORPA5C2K.js.map +0 -1
|
@@ -1,12 +1,31 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* The `vg-graph/1.
|
|
2
|
+
* The `vg-graph/1.1` on-disk schema.
|
|
3
3
|
*
|
|
4
4
|
* This is vg's own open schema (VG-PACKAGE-AND-SCHEMA.md §4) — informed by good
|
|
5
5
|
* ideas (content-hashed ids, epistemic typing of facts) but standalone and
|
|
6
6
|
* self-contained. Every collection is deterministically serialized
|
|
7
7
|
* (sorted keys, stable element order). These TypeScript shapes are normative.
|
|
8
|
+
*
|
|
9
|
+
* ## Version history
|
|
10
|
+
*
|
|
11
|
+
* - `vg-graph/1.0` — code-only vocabulary.
|
|
12
|
+
* - `vg-graph/1.1` — **additive**: toolchain node kinds (`resource`, `workload`,
|
|
13
|
+
* `job`, `step`, `image`, `chart`) and toolchain edge kinds (`depends_on`,
|
|
14
|
+
* `provisions`, `deploys`, `triggers`, `exposes`, `mounts`, `builds_from`),
|
|
15
|
+
* produced by `engine/toolchain/`. Nothing was removed or renamed, so a 1.0
|
|
16
|
+
* reader that tolerates unknown kinds reads a 1.1 graph correctly; readers
|
|
17
|
+
* that hard-match the version string need widening (see
|
|
18
|
+
* `SUPPORTED_SCHEMA_VERSIONS`).
|
|
19
|
+
*/
|
|
20
|
+
declare const SCHEMA_VERSION: "vg-graph/1.1";
|
|
21
|
+
/**
|
|
22
|
+
* Schema versions a reader should accept. The toolchain vocabulary added in 1.1
|
|
23
|
+
* is purely additive, so a 1.0 artifact still loads — only the newer kinds are
|
|
24
|
+
* absent from it. Readers must prefer this over an equality check on
|
|
25
|
+
* {@link SCHEMA_VERSION}, which rejects perfectly readable older graphs.
|
|
8
26
|
*/
|
|
9
|
-
declare const
|
|
27
|
+
declare const SUPPORTED_SCHEMA_VERSIONS: readonly ["vg-graph/1.0", "vg-graph/1.1"];
|
|
28
|
+
type SupportedSchemaVersion = (typeof SUPPORTED_SCHEMA_VERSIONS)[number];
|
|
10
29
|
type ResolverKind = 'scip' | 'stackgraph' | 'tsc' | 'heuristic';
|
|
11
30
|
/** Coarse, honest resolution tier for an edge (see engine/epistemic.ts). */
|
|
12
31
|
type EpistemicTier = 'observed' | 'name-matched' | 'declared';
|
|
@@ -54,7 +73,19 @@ interface GraphMeta {
|
|
|
54
73
|
}
|
|
55
74
|
type NodeKind = 'file' | 'module' | 'package' | 'class' | 'interface' | 'function' | 'method' | 'property' | 'test' | 'route' | 'component'
|
|
56
75
|
/** Documentation / config text ingested for semantic ask (markdown, txt, env examples). */
|
|
57
|
-
| 'document' | 'external'
|
|
76
|
+
| 'document' | 'external'
|
|
77
|
+
/** A declared infrastructure object: Terraform resource/data, K8s object, Compose service. */
|
|
78
|
+
| 'resource'
|
|
79
|
+
/** A deployable unit that runs containers (Deployment, StatefulSet, DaemonSet, Job, CronJob). */
|
|
80
|
+
| 'workload'
|
|
81
|
+
/** A CI job (GitHub Actions job, GitLab CI job). */
|
|
82
|
+
| 'job'
|
|
83
|
+
/** A single step within a CI job. */
|
|
84
|
+
| 'step'
|
|
85
|
+
/** A container image reference (`ghcr.io/acme/web:1.2.3`) or a Dockerfile build stage. */
|
|
86
|
+
| 'image'
|
|
87
|
+
/** A Helm chart (from `Chart.yaml`). */
|
|
88
|
+
| 'chart';
|
|
58
89
|
interface Span {
|
|
59
90
|
start: number;
|
|
60
91
|
end: number;
|
|
@@ -84,7 +115,21 @@ interface GraphNode {
|
|
|
84
115
|
coverage?: number;
|
|
85
116
|
changeCoupling?: string[];
|
|
86
117
|
}
|
|
87
|
-
type EdgeKind = 'call' | 'import' | 'contains' | 'extends' | 'implements' | 'references' | 'test' | 'coverage'
|
|
118
|
+
type EdgeKind = 'call' | 'import' | 'contains' | 'extends' | 'implements' | 'references' | 'test' | 'coverage'
|
|
119
|
+
/** Declared ordering/reference dependency (Terraform `depends_on` + interpolation, Compose `depends_on`, CI `needs`). */
|
|
120
|
+
| 'depends_on'
|
|
121
|
+
/** An IaC declaration creates infrastructure (Terraform module → resource, chart → workload). */
|
|
122
|
+
| 'provisions'
|
|
123
|
+
/** A CI job or IaC declaration puts a workload/image into an environment. */
|
|
124
|
+
| 'deploys'
|
|
125
|
+
/** An event or upstream job causes a workflow/job to run. */
|
|
126
|
+
| 'triggers'
|
|
127
|
+
/** A workload/service publishes a port or endpoint. */
|
|
128
|
+
| 'exposes'
|
|
129
|
+
/** A workload/service consumes a volume, config map, or secret *by reference*. */
|
|
130
|
+
| 'mounts'
|
|
131
|
+
/** A build stage or workload is derived from a container image. */
|
|
132
|
+
| 'builds_from';
|
|
88
133
|
interface GraphEdge {
|
|
89
134
|
id: string;
|
|
90
135
|
kind: EdgeKind;
|
|
@@ -159,7 +204,13 @@ interface GraphSummaries {
|
|
|
159
204
|
hubs: HubBlastSummary[];
|
|
160
205
|
}
|
|
161
206
|
interface VgGraph {
|
|
162
|
-
|
|
207
|
+
/**
|
|
208
|
+
* The schema this artifact was written against. A freshly built graph always
|
|
209
|
+
* carries {@link SCHEMA_VERSION}; a graph *loaded* from disk may carry any
|
|
210
|
+
* member of {@link SUPPORTED_SCHEMA_VERSIONS}, since older artifacts stay
|
|
211
|
+
* readable (the 1.1 additions are additive).
|
|
212
|
+
*/
|
|
213
|
+
schemaVersion: SupportedSchemaVersion;
|
|
163
214
|
generatedAt: string;
|
|
164
215
|
provenance: Provenance;
|
|
165
216
|
meta: GraphMeta;
|
|
@@ -232,8 +283,19 @@ interface FileParse {
|
|
|
232
283
|
* Empty/absent for languages with no namespace query.
|
|
233
284
|
*/
|
|
234
285
|
namespaces?: string[];
|
|
286
|
+
/**
|
|
287
|
+
* Architecture role hits extracted from the same tree as defs/calls.
|
|
288
|
+
* Omit when none (absent ≠ []).
|
|
289
|
+
*/
|
|
290
|
+
roles?: Array<{
|
|
291
|
+
role: 'controller' | 'service' | 'repository' | 'entity' | 'handler' | 'router';
|
|
292
|
+
layer: 'routing' | 'middleware' | 'services' | 'domain' | 'data-access' | 'infrastructure' | 'presentation' | 'config' | 'testing' | 'shared';
|
|
293
|
+
confidence: number;
|
|
294
|
+
signal: string;
|
|
295
|
+
packId: string;
|
|
296
|
+
}>;
|
|
235
297
|
/** Non-fatal issues (e.g. a query that failed to compile for this grammar). */
|
|
236
298
|
warnings?: string[];
|
|
237
299
|
}
|
|
238
300
|
|
|
239
|
-
export { type Area as A, type Centrality as C, type DerivedBy as D, type EdgeKind as E, type FileParse as F, type GraphNode as G, type HubBlastSummary as H, type NodeKind as N, type Provenance as P, type ResolverKind as R, SCHEMA_VERSION as S, type Toolchain as T, type Unknown as U, type VgGraph as V, type GraphEdge as a, type Fact as b, type GroundingKind as c, type GroundingEdge as d, type AnalysisTier as e, type EpistemicTier as f, type FactConfidence as g, type FactKind as h, type GraphMeta as i, type GraphSummaries as j, type Span as
|
|
301
|
+
export { type Area as A, type Centrality as C, type DerivedBy as D, type EdgeKind as E, type FileParse as F, type GraphNode as G, type HubBlastSummary as H, type NodeKind as N, type Provenance as P, type ResolverKind as R, SCHEMA_VERSION as S, type Toolchain as T, type Unknown as U, type VgGraph as V, type GraphEdge as a, type Fact as b, type GroundingKind as c, type GroundingEdge as d, type AnalysisTier as e, type EpistemicTier as f, type FactConfidence as g, type FactKind as h, type GraphMeta as i, type GraphSummaries as j, SUPPORTED_SCHEMA_VERSIONS as k, type Span as l, type SupportedSchemaVersion as m };
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":[],"names":[],"mappings":"","file":"version-
|
|
1
|
+
{"version":3,"sources":[],"names":[],"mappings":"","file":"version-WSE3QOPK.js"}
|
|
@@ -1,19 +1,20 @@
|
|
|
1
|
-
import { TOOLS } from './chunk-
|
|
1
|
+
import { TOOLS } from './chunk-DVW3SVCW.js';
|
|
2
2
|
import './chunk-HTLDXEHW.js';
|
|
3
|
-
import './chunk-
|
|
4
|
-
import './chunk-
|
|
3
|
+
import './chunk-WAKP7SK7.js';
|
|
4
|
+
import './chunk-3H3SVJUY.js';
|
|
5
5
|
import './chunk-J7LKEB2R.js';
|
|
6
|
-
import './chunk-
|
|
6
|
+
import './chunk-Q4G2BWE3.js';
|
|
7
7
|
import './chunk-CQDUBAQY.js';
|
|
8
8
|
import './chunk-OV4KGXPD.js';
|
|
9
9
|
import './chunk-5I4VSBWQ.js';
|
|
10
|
-
import './chunk-
|
|
10
|
+
import './chunk-NG4KIJW6.js';
|
|
11
11
|
import './chunk-CRAMOEBE.js';
|
|
12
|
-
import './chunk-
|
|
13
|
-
import './chunk-
|
|
14
|
-
import './chunk-
|
|
15
|
-
import './chunk-
|
|
16
|
-
import './chunk-
|
|
12
|
+
import './chunk-T7RSQ5WD.js';
|
|
13
|
+
import './chunk-AXZZ5CCG.js';
|
|
14
|
+
import './chunk-WVMOGIPC.js';
|
|
15
|
+
import './chunk-MVPRPSXU.js';
|
|
16
|
+
import './chunk-O3LABX6I.js';
|
|
17
|
+
import './chunk-PRG2ULPK.js';
|
|
17
18
|
import './chunk-BWPBB45M.js';
|
|
18
19
|
import './chunk-JFGYT6BI.js';
|
|
19
20
|
import './chunk-BPF3YX2U.js';
|
|
@@ -76,5 +77,5 @@ function vgMcpToolNames() {
|
|
|
76
77
|
}
|
|
77
78
|
|
|
78
79
|
export { VG_MCP_SERVER_ID, createVgBuiltinMcpTools, mergeExternalToolsets, vgMcpToolNames };
|
|
79
|
-
//# sourceMappingURL=vg-mcp-bridge-
|
|
80
|
-
//# sourceMappingURL=vg-mcp-bridge-
|
|
80
|
+
//# sourceMappingURL=vg-mcp-brid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AAI,CAAA,CAAE,CAAA;AAC1C","file":"vg-mcp-bridge-2CNLHNEL.js","sourcesContent":["/**\n * Always-on bridge from local `vg serve` (Vibgrate AI Context) tools into the\n * VG Code agent tool list.\n *\n * External project MCP servers (`.mcp.json`, etc.) remain optional. The tools\n * shipped by the installed `vg` CLI — `search_symbols`, `query_graph`,\n * `impact_of`, `library_docs`, … — are available on every run without spawning\n * a separate MCP process: same handlers as stdio `vg serve`, in-process over\n * the session graph.\n *\n * Namespaced as `mcp__vibgrate__<tool>` so they sit next to third-party\n * `mcp__<server>__*` tools without collisions.\n */\n\nimport { TOOLS, type VgTool } from '../mcp/tools.js';\nimport type { VgGraph } from '../schema.js';\nimport type { ToolCall, ToolSpec } from './types.js';\nimport type { ToolResult } from './tools.js';\n\nexport const VG_MCP_SERVER_ID = 'vibgrate' as const;\nconst NS = `mcp__${VG_MCP_SERVER_ID}__`;\n\nexport type ExternalToolset = {\n specs: ToolSpec[];\n owns: (name: string) => boolean;\n execute: (call: ToolCall, live?: { graph: VgGraph }) => Promise<ToolResult>;\n};\n\nexport interface VgBuiltinMcpOptions {\n /** Live graph accessor (session overlay may refresh symbols mid-run). */\n getGraph: () => VgGraph;\n root: string;\n /** Air-gap: no network in library/docs/embedder paths. */\n local?: boolean;\n}\n\n/** In-process toolset matching the local `vg serve` MCP surface. */\nexport function createVgBuiltinMcpTools(opts: VgBuiltinMcpOptions): ExternalToolset {\n const byName = new Map<string, VgTool>();\n for (const t of TOOLS) byName.set(`${NS}${t.name}`, t);\n\n const specs: ToolSpec[] = TOOLS.map((t) => ({\n name: `${NS}${t.name}`,\n description: `[${VG_MCP_SERVER_ID}] ${t.description}`,\n parameters: t.inputSchema && typeof t.inputSchema === 'object' ? t.inputSchema : { type: 'object', properties: {} },\n })).sort((a, b) => a.name.localeCompare(b.name));\n\n return {\n specs,\n owns: (name) => byName.has(name),\n async execute(call, live) {\n const tool = byName.get(call.name);\n if (!tool) return { content: `unknown MCP tool ${call.name}`, mutated: false };\n try {\n const graph = live?.graph ?? opts.getGraph();\n const raw = await tool.handler(graph, call.arguments ?? {}, {\n root: opts.root,\n local: opts.local,\n dedup: false,\n });\n const text = typeof raw === 'string' ? raw : JSON.stringify(raw, null, 2);\n return { content: text.slice(0, 12_000), mutated: false };\n } catch (e) {\n return { content: `MCP tool ${call.name} failed: ${(e as Error).message}`, mutated: false };\n }\n },\n };\n}\n\n/** Merge toolsets; later sets win on name clashes. */\nexport function mergeExternalToolsets(...sets: Array<ExternalToolset | undefined | null>): ExternalToolset | undefined {\n const active = sets.filter((s): s is ExternalToolset => !!s && s.specs.length > 0);\n if (active.length === 0) return undefined;\n if (active.length === 1) return active[0];\n\n const byName = new Map<string, { set: ExternalToolset; spec: ToolSpec }>();\n for (const set of active) {\n for (const spec of set.specs) byName.set(spec.name, { set, spec });\n }\n const specs = [...byName.values()].map((v) => v.spec).sort((a, b) => a.name.localeCompare(b.name));\n return {\n specs,\n owns: (name) => active.some((s) => s.owns(name)),\n async execute(call, live) {\n for (let i = active.length - 1; i >= 0; i--) {\n if (active[i]!.owns(call.name)) return active[i]!.execute(call, live);\n }\n return { content: `unknown external tool ${call.name}`, mutated: false };\n },\n };\n}\n\n/** Namespaced vibgrate tool names for tests / prompts. */\nexport function vgMcpToolNames(): string[] {\n return TOOLS.map((t) => `${NS}${t.name}`);\n}\n"]}
|
|
@@ -1,20 +1,21 @@
|
|
|
1
|
-
export { ActiveGraphCache, BranchGraphSession, DEFAULT_ACTIVE_GRAPH_IDLE_MS, VGD_PROTOCOL_VERSION, WorkspaceRegistry, parseRequest, startVgdServer } from './chunk-
|
|
1
|
+
export { ActiveGraphCache, BranchGraphSession, DEFAULT_ACTIVE_GRAPH_IDLE_MS, VGD_PROTOCOL_VERSION, WorkspaceRegistry, parseRequest, startVgdServer } from './chunk-GOGMS3ST.js';
|
|
2
2
|
export { createHostExecutionEnv, detectSandboxCapabilities, detectSecurityCapabilities, firejailArgv, resolveExecutionEnv, selectSandboxBackend } from './chunk-IS7VTH2Q.js';
|
|
3
3
|
import './chunk-3LOWJSAF.js';
|
|
4
4
|
export { vgdIsRunning, vgdPidPath, vgdRequest, vgdSocketPath } from './chunk-RBIRXQR6.js';
|
|
5
5
|
import './chunk-5HYCB55P.js';
|
|
6
6
|
export { MODEL_EXECUTION_PROFILE_SCHEMA_VERSION, defaultModelExecutionProfile, mergeModelExecutionProfile, resolveModelExecutionProfile } from './chunk-IZDH67DX.js';
|
|
7
7
|
import './chunk-J7LKEB2R.js';
|
|
8
|
-
import './chunk-
|
|
9
|
-
import './chunk-
|
|
8
|
+
import './chunk-Q4G2BWE3.js';
|
|
9
|
+
import './chunk-3FMRFECC.js';
|
|
10
10
|
export { FEDERATION_SCHEMA_VERSION, federationFromWorkspaceRoots, federationPath, highConfidenceBridges, loadFederation, loadOrDiscoverFederation, writeFederationFile } from './chunk-5I4VSBWQ.js';
|
|
11
|
-
import './chunk-
|
|
12
|
-
import './chunk-
|
|
13
|
-
import './chunk-
|
|
14
|
-
import './chunk-
|
|
11
|
+
import './chunk-AXZZ5CCG.js';
|
|
12
|
+
import './chunk-WVMOGIPC.js';
|
|
13
|
+
import './chunk-MVPRPSXU.js';
|
|
14
|
+
import './chunk-O3LABX6I.js';
|
|
15
|
+
import './chunk-PRG2ULPK.js';
|
|
15
16
|
import './chunk-BWPBB45M.js';
|
|
16
17
|
import './chunk-JFGYT6BI.js';
|
|
17
18
|
export { activeGraphSlotKey, branchGraphSnapshotId, detectGitRef } from './chunk-BPF3YX2U.js';
|
|
18
19
|
import './chunk-Z6ZWNWWR.js';
|
|
19
|
-
//# sourceMappingURL=vgd-
|
|
20
|
-
//# sourceMappingURL=vgd-
|
|
20
|
+
//# sourceMappingURL=vgd-URUZQORN.js.map
|
|
21
|
+
//# sourceMappingURL=vgd-URUZQORN.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":[],"names":[],"mappings":"","file":"vgd-URUZQORN.js"}
|
|
Binary file
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@vibgrate/cli",
|
|
3
|
-
"version": "2026.
|
|
3
|
+
"version": "2026.817.2",
|
|
4
4
|
"description": "vg — local codebase intelligence CLI + MCP server for AI coding agents: deterministic code graph, drift reporting, and version-correct library docs (Apache-2.0)",
|
|
5
5
|
"//mcpName": "Official MCP registry ownership proof: the registry fetches the published npm package and requires this field to match the com.vibgrate/ai-context server entry (see docs/marketing/mcp-registry/README.md). Must ship in the published @vibgrate/cli package.json.",
|
|
6
6
|
"mcpName": "com.vibgrate/ai-context",
|
|
@@ -79,7 +79,7 @@
|
|
|
79
79
|
"chalk": "^6.0.0",
|
|
80
80
|
"commander": "^15.0.0",
|
|
81
81
|
"fast-xml-parser": "^5.10.1",
|
|
82
|
-
"gpt-tokenizer": "^
|
|
82
|
+
"gpt-tokenizer": "^4.0.0",
|
|
83
83
|
"graphology": "^0.26.0",
|
|
84
84
|
"graphology-communities-louvain": "^2.0.2",
|
|
85
85
|
"graphology-metrics": "^2.4.0",
|
|
@@ -88,7 +88,7 @@
|
|
|
88
88
|
"ignore": "^7.0.6",
|
|
89
89
|
"msgpackr": "^2.0.4",
|
|
90
90
|
"semver": "^7.8.5",
|
|
91
|
-
"smol-toml": "^1.
|
|
91
|
+
"smol-toml": "^1.8.0",
|
|
92
92
|
"tinypool": "^2.1.0",
|
|
93
93
|
"tree-sitter-wasms": "^0.1.13",
|
|
94
94
|
"typescript": "^6.0.0",
|
|
@@ -101,14 +101,15 @@
|
|
|
101
101
|
"tar": "^7.5.19"
|
|
102
102
|
},
|
|
103
103
|
"devDependencies": {
|
|
104
|
-
"@
|
|
104
|
+
"@tree-sitter-grammars/tree-sitter-hcl": "1.2.0",
|
|
105
|
+
"@types/node": "^26.2.0",
|
|
105
106
|
"@types/semver": "^7.8.0",
|
|
106
|
-
"@typescript-eslint/eslint-plugin": "^8.
|
|
107
|
-
"@typescript-eslint/parser": "^8.
|
|
108
|
-
"eslint": "^10.8.
|
|
107
|
+
"@typescript-eslint/eslint-plugin": "^8.67.0",
|
|
108
|
+
"@typescript-eslint/parser": "^8.67.0",
|
|
109
|
+
"eslint": "^10.8.1",
|
|
109
110
|
"graphology-types": "^0.24.8",
|
|
110
111
|
"tsup": "^8.0.0",
|
|
111
|
-
"tsx": "^4.23.
|
|
112
|
+
"tsx": "^4.23.12",
|
|
112
113
|
"vitest": "^4.1.10"
|
|
113
114
|
},
|
|
114
115
|
"engines": {
|
package/dist/agent-5ANHRYEI.js
DELETED
|
@@ -1,26 +0,0 @@
|
|
|
1
|
-
export { CONTEXT_POLICY_VERSION, DISCOVERY_TOOLS, MUTATION_TOOLS, compact, compactWithModel, runAgent } from './chunk-IHXNOY3R.js';
|
|
2
|
-
import './chunk-543E6WDJ.js';
|
|
3
|
-
import './chunk-TVDYEHIM.js';
|
|
4
|
-
import './chunk-54RGT2T5.js';
|
|
5
|
-
import './chunk-RBIRXQR6.js';
|
|
6
|
-
import './chunk-5HYCB55P.js';
|
|
7
|
-
import './chunk-N3XFY3PX.js';
|
|
8
|
-
import './chunk-REIGWTTH.js';
|
|
9
|
-
import './chunk-VIWZ4QT7.js';
|
|
10
|
-
import './chunk-7QDHQLUS.js';
|
|
11
|
-
import './chunk-J7LKEB2R.js';
|
|
12
|
-
export { summarizeCapsule } from './chunk-DSUGC7F5.js';
|
|
13
|
-
import './chunk-KGPX4EUN.js';
|
|
14
|
-
import './chunk-3LSG7Z4I.js';
|
|
15
|
-
import './chunk-UTNNGKKX.js';
|
|
16
|
-
import './chunk-RXP66R2E.js';
|
|
17
|
-
import './chunk-X76VPOYH.js';
|
|
18
|
-
import './chunk-2U37PFB2.js';
|
|
19
|
-
import './chunk-75LJM5XD.js';
|
|
20
|
-
import './chunk-2H2U3DC7.js';
|
|
21
|
-
import './chunk-BWPBB45M.js';
|
|
22
|
-
import './chunk-JFGYT6BI.js';
|
|
23
|
-
import './chunk-BPF3YX2U.js';
|
|
24
|
-
import './chunk-Z6ZWNWWR.js';
|
|
25
|
-
//# sourceMappingURL=agent-5ANHRYEI.js.map
|
|
26
|
-
//# sourceMappingURL=agent-5ANHRYEI.js.map
|
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
export { baselineCommand, runBaseline } from './chunk-TFAXW7VM.js';
|
|
2
|
-
import './chunk-N6ZMZ5AI.js';
|
|
3
|
-
import './chunk-DT4KIVRI.js';
|
|
4
|
-
import './chunk-CRAMOEBE.js';
|
|
5
|
-
import './chunk-RXP66R2E.js';
|
|
6
|
-
import './chunk-2H2U3DC7.js';
|
|
7
|
-
import './chunk-Z6ZWNWWR.js';
|
|
8
|
-
//# sourceMappingURL=baseline-WVD6P5IO.js.map
|
|
9
|
-
//# sourceMappingURL=baseline-WVD6P5IO.js.map
|
package/dist/chunk-2H2U3DC7.js
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/engine/cache.ts"],"names":[],"mappings":";;;;AAoBA,IAAM,aAAA,GAAgB,kBAAA;AA0Bf,SAAS,SAAS,IAAA,EAAsB;AAC7C,EAAA,OAAY,IAAA,CAAA,IAAA,CAAK,IAAA,EAAM,WAAA,EAAa,OAAO,CAAA;AAC7C;AAEA,SAAS,UAAU,IAAA,EAAsB;AACvC,EAAA,OAAY,IAAA,CAAA,IAAA,CAAK,QAAA,CAAS,IAAI,CAAA,EAAG,kBAAkB,CAAA;AACrD;AAEO,SAAS,SAAA,CACd,MACA,IAAA,EACY;AACZ,EAAA,MAAM,IAAA,GAAO,UAAU,IAAI,CAAA;AAC3B,EAAA,IAAI,IAAA,GAAkB;AAAA,IACpB,OAAA,EAAS,aAAA;AAAA,IACT,aAAa,IAAA,CAAK,WAAA;AAAA,IAClB,UAAU,IAAA,CAAK,QAAA;AAAA,IACf,SAAS;AAAC,GACZ;AAEA,EAAA,IAAI,CAAC,IAAA,CAAK,QAAA,IAAe,EAAA,CAAA,UAAA,CAAW,IAAI,CAAA,EAAG;AACzC,IAAA,IAAI;AACF,MAAA,M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,QACZ,KAAA;AAAA,QACA,SAAS,IAAA,EAAM,OAAA;AAAA,QACf,MAAM,IAAA,EAAM;AAAA,OACd;AAAA,IACF,CAAA;AAAA,IACA,MAAM,WAAA,EAAa;AACjB,MAAA,KAAA,MAAW,GAAA,IAAO,MAAA,CAAO,IAAA,CAAK,IAAA,CAAK,OAAO,CAAA,EAAG;AAC3C,QAAA,IAAI,CAAC,YAAY,GAAA,CAAI,GAAG,GAAG,OAAO,IAAA,CAAK,QAAQ,GAAG,CAAA;AAAA,MACpD;AAAA,IACF,CAAA;AAAA,IACA,IAAA,GAAO;AACL,MAAG,aAAU,QAAA,CAAS,IAAI,GAAG,EAAE,SAAA,EAAW,MAAM,CAAA;AAChD,MAAG,EAAA,CAAA,aAAA,CAAc,IAAA,EAAM,eAAA,CAAgB,IAAA,EAAM,CAAC,CAAC,CAAA;AAAA,IACjD;AAAA,GACF;AACF","file":"chunk-2U37PFB2.js","sourcesContent":["import * as fs from 'node:fs';\nimport * as path from 'node:path';\nimport { stableStringify } from './serialize.js';\nimport type { FileParse } from './types.js';\n\n/**\n * Incremental parse cache. Maps a file's content hash to its parsed\n * symbol/edge tables, so a rebuild re-parses only files whose content actually\n * changed (VG-DEVELOPMENT-PLAN Phase 0.4). Lives under `.vibgrate/cache/` and is\n * gitignored — never part of the committed artifact.\n *\n * The cache is a pure performance optimisation: a reused FileParse is identical\n * to a freshly-parsed one (parsing is pure over content), so the graph is\n * byte-identical whether or not the cache was warm. CI-enforced by the\n * mutation-corpus identity gate (incremental-identity.test.ts): warm\n * incremental rebuild ≡ cold full rebuild, byte for byte, across\n * edit/add/delete/rename/touch mutations and the production refresh path.\n */\n\n// Bumped to /4: optional mtime+size fingerprint for stat-skip fast path.\nconst CACHE_VERSION = 'vg-parse-cache/4';\n\ninterface CacheEntry {\n hash: string;\n mtimeMs?: number;\n size?: number;\n parse: FileParse;\n}\n\ninterface CacheFile {\n version: string;\n toolVersion: string;\n grammars: string;\n entries: Record<string, CacheEntry>;\n}\n\nexport interface ParseCache {\n get(rel: string, hash: string): FileParse | undefined;\n /** Fast path: mtime+size match → reuse parse without re-reading bytes. */\n getByStat(rel: string, mtimeMs: number, size: number): { parse: FileParse; hash: string } | undefined;\n set(rel: string, parse: FileParse, stat?: { mtimeMs: number; size: number }): void;\n /** Drop entries for files no longer present. */\n prune(currentRels: Set<string>): void;\n save(): void;\n}\n\nexport function cacheDir(root: string): string {\n return path.join(root, '.vibgrate', 'cache');\n}\n\nfunction cachePath(root: string): string {\n return path.join(cacheDir(root), 'parse-cache.json');\n}\n\nexport function loadCache(\n root: string,\n opts: { toolVersion: string; grammars: string; disabled?: boolean },\n): ParseCache {\n const file = cachePath(root);\n let data: CacheFile = {\n version: CACHE_VERSION,\n toolVersion: opts.toolVersion,\n grammars: opts.grammars,\n entries: {},\n };\n\n if (!opts.disabled && fs.existsSync(file)) {\n try {\n const loaded = JSON.parse(fs.readFileSync(file, 'utf8')) as CacheFile;\n // Accept v3 → v4 (stat fields optional).\n if (\n (loaded.version === CACHE_VERSION || loaded.version === 'vg-parse-cache/3') &&\n loaded.toolVersion === opts.toolVersion &&\n loaded.grammars === opts.grammars &&\n loaded.entries\n ) {\n data = { ...loaded, version: CACHE_VERSION };\n }\n } catch {\n /* corrupt cache — start fresh */\n }\n }\n\n return {\n get(rel, hash) {\n const entry = data.entries[rel];\n return entry && entry.hash === hash ? entry.parse : undefined;\n },\n getByStat(rel, mtimeMs, size) {\n const entry = data.entries[rel];\n if (!entry) return undefined;\n if (entry.mtimeMs === mtimeMs && entry.size === size && entry.parse) {\n return { parse: entry.parse, hash: entry.hash };\n }\n return undefined;\n },\n set(rel, parse, stat) {\n data.entries[rel] = {\n hash: parse.hash,\n parse,\n mtimeMs: stat?.mtimeMs,\n size: stat?.size,\n };\n },\n prune(currentRels) {\n for (const rel of Object.keys(data.entries)) {\n if (!currentRels.has(rel)) delete data.entries[rel];\n }\n },\n save() {\n fs.mkdirSync(cacheDir(root), { recursive: true });\n fs.writeFileSync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,YAAA,CAAa,OAAO,CAAC,CAAA;AAAA,EAClD,CAAA,CAAA,MAAQ;AACN,IAAA,OAAO,KAAA;AAAA,EACT;AACF;AASO,SAAS,qBAAqB,OAAA,EAA0B;AAC7D,EAAA,OAAO,WAAA,CAAY,OAAO,CAAA,IAAK,CAAC,qBAAqB,OAAO,CAAA;AAC9D;AAUO,SAAS,qBAAqB,KAAA,EAAgD;AACnF,EAAA,IAAI,CAAC,KAAA,IAAS,MAAA,KAAW,MAAA,EAAW,OAAO,MAAA;AAC3C,EAAA,MAAM,SAAS,KAAA,IAAS,WAAA;AAExB,EAAA,MAAM,EAAA,GAAK,OAAO,IAAI,CAAA;AACtB,EAAA,IAAI,MAAA;AACJ,EAAA,IAAI,EAAA,IAAM,oBAAA,CAAqB,EAAE,CAAA,EAAG;AAClC,IAAA,MAAA,GAAS,IAAA;AAAA,EACX,CAAA,MAAO;AACL,IAAA,MAAM,QAAA,GAAW,OAAO,UAAU,CAAA;AAClC,IAAA,MAAA,GAAS,QAAA,IAAY,oBAAA,CAAqB,QAAQ,CAAA,GAAI,UAAA,GAAa,cAAA;AAAA,EACrE;AAEA,EAAA,IAAI,CAAC,OAAO,MAAA,GAAS,MAAA;AACrB,EAAA,OAAO,MAAA;AACT;AAxHA,IA4Ba,cAAA,CAAA,CAqET;AAjGJ,IAAA,mBAAA,GAAA,KAAA,CAAA;AAAA,EAAA,4BAAA,GAAA;AA4BO,IAAM,cAAA,GAAiB,mBAAA;AAAA,EAAA;AAAA,CAAA","file":"chunk-3LSG7Z4I.js","sourcesContent":["import * as fs from 'node:fs';\nimport { execFileSync } from 'node:child_process';\n\n/**\n * How the user should re-invoke this CLI in a \"next step\" hint.\n *\n * A user who ran `npx @vibgrate/cli scan` has no *persistent* `vg` (or\n * `vibgrate`) on PATH, so a hint like `vg install` or `vg login` would fail for\n * them once the run ends. We answer the practical question \"what will actually\n * run this CLI for this user again?\" by checking whether an *installed* copy of\n * our binary is reachable on PATH:\n *\n * installed `vg` → `vg` (the normal installed case)\n * installed `vibgrate` → `vibgrate` (alias present, `vg` shadowed)\n * neither → `npx @vibgrate/cli` (npx / not installed globally)\n *\n * \"Installed\" is the key qualifier: `npx` prepends its own throwaway\n * `_npx/<hash>/node_modules/.bin` to PATH for the run, so `which vg` finds a `vg`\n * that is genuinely ours yet gone the moment the process exits. That ephemeral\n * binary is excluded (see {@link isEphemeralNpxBinary}) so npx users get the npx\n * form, not a `vg` they can't call again.\n *\n * This is deliberately the same ladder `detectServeLaunch` uses for the MCP\n * launch command — the underlying question (\"is an installed `vg` ours?\") is\n * identical.\n */\n\n/** The npx form that always works without a global install. */\nexport const NPX_INVOCATION = 'npx @vibgrate/cli';\n\n/**\n * Locate `cmd` on PATH, returning its resolved path or null. Best-effort: a\n * missing command or an unavailable `which`/`where` both yield null.\n */\nexport function whichOnPath(cmd: string): string | null {\n try {\n const out = execFileSync(process.platform === 'win32' ? 'where' : 'which', [cmd], {\n encoding: 'utf8',\n stdio: ['ignore', 'pipe', 'ignore'],\n })\n .trim()\n .split(/\\r?\\n/)[0];\n return out || null;\n } catch {\n return null;\n }\n}\n\n/**\n * Does this PATH entry launch *this* package? Symlink installs resolve into a\n * `…/@vibgrate/cli/…` directory; script shims (pnpm/bun/yarn, Windows .cmd)\n * reference the package path in their first bytes. Best-effort: unreadable or\n * unrecognisable entries count as foreign, which only makes callers pick a safer\n * fallback.\n */\nexport function isOwnBinary(binPath: string): boolean {\n try {\n const real = fs.realpathSync(binPath);\n if (/[\\\\/]@vibgrate[\\\\/]cli[\\\\/]/.test(real)) return true;\n const head = fs.readFileSync(real, { encoding: 'utf8' }).slice(0, 2048);\n return head.includes('@vibgrate/cli') || head.includes('vibgrate');\n } catch {\n return false;\n }\n}\n\n/**\n * Is this resolved binary an *ephemeral* npx-cache entry rather than a persistent\n * install? `npx @vibgrate/cli …` unpacks the package into an npm `_npx/<hash>/`\n * cache directory and prepends its `node_modules/.bin` to PATH for the duration\n * of the run — so `which vg` finds a `vg` that is *ours* yet vanishes the instant\n * the process exits. Treating that as an installed `vg` is exactly what made the\n * post-scan hints tell npx users to run `vg login`/`vg push`, commands they have\n * no `vg` on PATH for. npm's cache segment is `_npx` on every platform; we test\n * the raw PATH entry and its realpath (symlink shims resolve into the same tree).\n */\nexport function isEphemeralNpxBinary(binPath: string): boolean {\n const NPX_SEGMENT = /[\\\\/]_npx[\\\\/]/;\n if (NPX_SEGMENT.test(binPath)) return true;\n try {\n return NPX_SEGMENT.test(fs.realpathSync(binPath));\n } catch {\n return false;\n }\n}\n\n/**\n * Does this PATH entry launch *this* CLI in a way that will still work after the\n * current process exits? True only for a persistent install of our package — an\n * ephemeral npx-cache binary does not count, because the user cannot re-invoke it\n * by name. This is the predicate \"next step\" hints and the MCP launch command\n * must use, not {@link isOwnBinary} alone.\n */\nexport function isInstalledOwnBinary(binPath: string): boolean {\n return isOwnBinary(binPath) && !isEphemeralNpxBinary(binPath);\n}\n\nlet cached: string | undefined;\n\n/**\n * The command prefix a user should type to re-run this CLI (see module doc).\n * Memoized per-process: PATH does not change mid-run, and each call would\n * otherwise spawn `which`. Pass `which` to override lookup in tests, which also\n * bypasses the cache.\n */\nexport function resolveCliInvocation(which?: (cmd: string) => string | null): string {\n if (!which && cached !== undefined) return cached;\n const lookup = which ?? whichOnPath;\n\n const vg = lookup('vg');\n let result: string;\n if (vg && isInstalledOwnBinary(vg)) {\n result = 'vg';\n } else {\n const vibgrate = lookup('vibgrate');\n result = vibgrate && isInstalledOwnBinary(vibgrate) ? 'vibgrate' : NPX_INVOCATION;\n }\n\n if (!which) cached = result;\n return result;\n}\n\n/** Reset the memoized invocation. Test-only. */\nexport function resetCliInvocationCache(): void {\n cached = undefined;\n}\n"]}
|