@aroman22/codegraph-vba 1.7.0 → 1.7.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.
|
@@ -0,0 +1,84 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Daemon liveness watchdog — issue #116.
|
|
3
|
+
*
|
|
4
|
+
* The MCP server (or any long-lived host) registers project roots it serves.
|
|
5
|
+
* Every `intervalMs`, the watchdog checks each root's daemon (via the
|
|
6
|
+
* {@link listDaemons} discovery index + liveness probe). If a daemon that
|
|
7
|
+
* SHOULD exist is dead (kill -9, Stop-Process, crash, …), the watchdog
|
|
8
|
+
* respawns it with the same spawnDetachedDaemon recipe the launcher uses
|
|
9
|
+
* (`process.execPath` + `process.execArgv` + `scriptPath serve --mcp --path <root>`).
|
|
10
|
+
*
|
|
11
|
+
* Why a watchdog (vs. spawn-on-demand at MCP request time): the issue's repro
|
|
12
|
+
* is `Stop-Process -Id <pid>` while the MCP keeps serving — file edits are
|
|
13
|
+
* missed until the user manually runs `codegraph-vba sync`. The watchdog
|
|
14
|
+
* closes that gap in <intervalMs>.
|
|
15
|
+
*
|
|
16
|
+
* Spawned detaches (own session/process group) so closing the MCP process
|
|
17
|
+
* does not take the watchdog down with it.
|
|
18
|
+
*/
|
|
19
|
+
export interface DaemonWatchdogOptions {
|
|
20
|
+
/** Poll interval (ms). Default 30s. */
|
|
21
|
+
intervalMs?: number;
|
|
22
|
+
/** Override the path to the codegraph binary used to spawn the daemon. */
|
|
23
|
+
scriptPath?: string;
|
|
24
|
+
/** Override node executable used to spawn the daemon. */
|
|
25
|
+
nodePath?: string;
|
|
26
|
+
/**
|
|
27
|
+
* Override the spawn implementation. Used by tests; production callers
|
|
28
|
+
* leave this unset to use the real `child_process.spawn`.
|
|
29
|
+
*/
|
|
30
|
+
spawnFn?: (nodePath: string, args: string[], opts: {
|
|
31
|
+
detached: boolean;
|
|
32
|
+
env: NodeJS.ProcessEnv;
|
|
33
|
+
windowsHide?: boolean;
|
|
34
|
+
stdio?: 'ignore' | ['ignore', number, number];
|
|
35
|
+
}) => boolean;
|
|
36
|
+
}
|
|
37
|
+
/**
|
|
38
|
+
* Per-project daemon liveness watchdog. Registers roots; polls every
|
|
39
|
+
* `intervalMs`; respawns a daemon if the live one dies.
|
|
40
|
+
*/
|
|
41
|
+
export declare class DaemonWatchdog {
|
|
42
|
+
private readonly roots;
|
|
43
|
+
private interval;
|
|
44
|
+
private readonly intervalMs;
|
|
45
|
+
private readonly scriptPath;
|
|
46
|
+
private readonly nodePath;
|
|
47
|
+
private readonly spawnFn;
|
|
48
|
+
constructor(opts?: DaemonWatchdogOptions);
|
|
49
|
+
/** Watch a project root: if its daemon dies, respawn it. Idempotent. */
|
|
50
|
+
watch(root: string): void;
|
|
51
|
+
/** Stop watching a root. Idempotent. */
|
|
52
|
+
unwatch(root: string): void;
|
|
53
|
+
/** Number of roots currently being watched. */
|
|
54
|
+
size(): number;
|
|
55
|
+
/**
|
|
56
|
+
* Start the polling loop. No-op if already running. Detached from any caller;
|
|
57
|
+
* safe to call from a request handler.
|
|
58
|
+
*/
|
|
59
|
+
start(): void;
|
|
60
|
+
/** Stop the polling loop. Idempotent. */
|
|
61
|
+
stop(): void;
|
|
62
|
+
/**
|
|
63
|
+
* Run one round: for each watched root, check daemon liveness and respawn
|
|
64
|
+
* if missing. Exposed for tests + manual triggers.
|
|
65
|
+
*/
|
|
66
|
+
tick(): Promise<void>;
|
|
67
|
+
/**
|
|
68
|
+
* If no live daemon serves `root`, spawn one. Exposed for tests + manual
|
|
69
|
+
* triggers. Resolves to `true` if a daemon was spawned, `false` if one
|
|
70
|
+
* was already running or no `.codegraph/` is reachable from `root`.
|
|
71
|
+
*/
|
|
72
|
+
checkAndRespawn(root: string): Promise<boolean>;
|
|
73
|
+
/** Spawn a fresh daemon for `root`. Detached; safe to call from any context. */
|
|
74
|
+
spawn(root: string): boolean;
|
|
75
|
+
/**
|
|
76
|
+
* Wait for a daemon's socket to appear at one of the candidate paths under
|
|
77
|
+
* `root`. Used by callers that want a synchronous spawn-then-use flow; not
|
|
78
|
+
* required by the watchdog itself (which only needs liveness, not binding).
|
|
79
|
+
*/
|
|
80
|
+
waitForSocket(root: string, maxRetries?: number): Promise<boolean>;
|
|
81
|
+
/** True if a daemon's pid file at `root` points at a live process. */
|
|
82
|
+
hasLiveDaemon(root: string): boolean;
|
|
83
|
+
}
|
|
84
|
+
//# sourceMappingURL=daemon-watchdog.d.ts.map
|
package/dist/mcp/index.d.ts
CHANGED
|
@@ -17,7 +17,7 @@
|
|
|
17
17
|
* tools (node/search/callers/…) stay defined and are re-enablable via
|
|
18
18
|
* CODEGRAPH_MCP_TOOLS, but they are NOT listed to agents, so don't name them.
|
|
19
19
|
*/
|
|
20
|
-
export declare const SERVER_INSTRUCTIONS = "# Codegraph \u2014 code intelligence over an indexed knowledge graph\n\nCodegraph is a SQLite knowledge graph of every symbol, edge, and file in\nthe workspace \u2014 pre-computed structure you would otherwise re-derive by\nreading files (cached intelligence: thousands of parse/trace decisions you\ndon't pay to re-reason each run). Reads are sub-millisecond; the index lags\nwrites by ~1s through the file watcher. Reach for it BEFORE *and* while\nwriting or editing code \u2014 not just for questions: one call returns the\nverbatim source PLUS who calls it and what it affects, so you edit with the\nblast radius in view. More accurate context, in far fewer tokens and\nround-trips than reading files yourself.\n\n## One tool: codegraph_explore \u2014 use it instead of reading files\n\nThere is a single tool, `codegraph_explore`, and it is Read-equivalent. It\ntakes either a natural-language question or a bag of symbol/file names and\nreturns the **verbatim, line-numbered source** of the relevant symbols\ngrouped by file \u2014 the same `<n>\\t<line>` shape `Read` gives you, safe to\n`Edit` from \u2014 PLUS the call path among them (including dynamic-dispatch hops\nlike callbacks, React re-render, and JSX children that grep can't follow) and\na blast-radius summary of what depends on them.\n\nWhether you're answering \"how does X work\" or implementing a change (fixing a\nbug, adding a feature), call `codegraph_explore` before you Read. ONE call\nusually answers the whole question. Codegraph IS the pre-built search index \u2014\nso running your own grep + read loop, or delegating the lookup to a separate\nfile-reading sub-task/agent, repeats work codegraph already did and costs more\nfor the same answer. A direct codegraph answer is typically one to a few\ncalls; a grep/read exploration is dozens.\n\n## How to query\n\n- **Almost any question \u2014 \"how does X work\", architecture, a bug, \"what/where is X\", or surveying an area** \u2192 `codegraph_explore` with a natural-language question or the relevant names. ONE capped call returns the verbatim source grouped by file; most often the ONLY call you need.\n- **\"How does X reach/become Y? / the flow / the path from X to Y\"** \u2192 `codegraph_explore`, naming the symbols that span the flow (e.g. `mutateElement renderScene`) \u2014 it surfaces the call path among them, riding dynamic-dispatch hops, and returns their source.\n- **Reading or editing a file/symbol you can name** \u2192 put its name or file path in the `codegraph_explore` query \u2014 it returns that current line-numbered source (safe to `Edit` from) with the call path and blast radius attached, so you don't Read it separately. For an overloaded name it returns every matching definition's body in one call.\n- **Need more?** Call `codegraph_explore` again with more specific names \u2014 treat the source it returns as already Read.\n\n## Anti-patterns\n\n- **Trust codegraph's results \u2014 don't re-verify them with grep.** They come from a full AST parse; re-checking with grep is slower, less accurate, and wastes context.\n- **Don't grep or Read first** to find or understand indexed code \u2014 ONE `codegraph_explore` returns the relevant symbols' source together in a single round-trip. Reach for raw `Read`/`Grep` only to confirm a specific detail codegraph didn't cover, or for what codegraph doesn't index (configs, docs).\n- **Don't reconstruct a flow by hand** \u2014 name the endpoints in one `codegraph_explore` and it surfaces the path between them, dynamic-dispatch hops included.\n- **After editing, check the staleness banner.** When a tool response starts with \"\u26A0\uFE0F Some files referenced below were edited since the last index sync\u2026\", the listed files are pending re-index \u2014 Read those specific files for accurate content. Every file NOT in that banner is fresh, so still trust codegraph. A different, rarer banner \u2014 \"\u26A0\uFE0F CodeGraph auto-sync is DISABLED\u2026\" \u2014 means live watching stopped entirely (the whole index is frozen, not just a few files); until it's resolved, Read files directly to confirm anything that may have changed.\n\n## Limitations\n\n- If a tool reports a project isn't indexed (no `.codegraph/`), stop calling codegraph tools for that project for the rest of the session and use your built-in tools there instead. Indexing is the user's decision \u2014 mention they can run `codegraph init` if it comes up, but don't run it yourself.\n- Index lags file writes by ~1 second.\n- Cross-file resolution is best-effort name matching; ambiguous calls may return multiple candidates.\n- No live correctness validation \u2014 that's still the TypeScript compiler / test suite / linter's job. Codegraph supplements those with structural context they don't have.\n\n## Supported Languages\n\nThe indexer recognizes a fixed set of languages; if you ask about symbols in a\nfile with an unsupported extension, codegraph will report the project isn't\nindexed for that file and you should fall back to Read/Grep. The fork-specific\naddition beyond upstream codegraph is **VBA / Access** (Dysflow export\nformat):\n\n- **VBA / Access** - Dysflow exports Access/VBA source as `.bas`/`.cls`/\n `.form.txt`/`.report.txt`. Codegraph extracts `.bas`/`.cls` as `module`/\n `class`/`function` nodes with `calls`/`implements`/`references` edges\n (procedural-level; regex-based, not full AST). Cross-module calls, qualified\n `Dim As`, `WithEvents`, and SQL table references inside string literals\n emit synthesized edges tagged `metadata.synthesizedBy` (`vba-name-resolution`,\n `vba-withevents`, `vba-sql-table`). `.form.txt` and `.report.txt` are\n extracted as a `module` plus one `property` per Access control - **no**\n `function`/`sub`/`class` nodes come from form files; the canonical code\n lives in the sibling `.cls`, parsed by the same extractor on that file.\n Dysflow test manifests (`tests.*.json`) link each registered `Test_*`\n procedure to its manifest with a `references` edge tagged\n `vba-test-manifest` carrying the test name + tags, so `getCallers` of a\n production symbol reaches its covering test atoms with the manifest and tags\n to run.\n Pass `projectPath` to a codegraph index that includes VBA files.\n- **VBA unresolved refs carry syntactic shape** (v1.7+). `unresolved_refs.reference_kind` is no longer the literal string `\"references\"` \u2014 it reports what the syntactic shape actually was. Values: `call` (paren-form or statement-form call site), `qualified-call` (`obj.Foo(...)` with runtime receiver), `property-get` / `property-set` (`Me.Name`, `obj.Prop = value`), `bang-get` / `bang-set` (`Me!SubCtl`, `obj!Field = value`), `unqualified-ident` (bare identifier like `HayErrorEnRiesgo` in an `If` condition), `member-with` (`.Member` inside a `With` block), `dao-query` (`DoCmd.OpenQuery \"X\"` argument). The legacy value `references` is retained on any path the round did not reclassify, so older SQL filters that key on it keep working. To find real missing callees, filter `WHERE reference_kind IN ('call','qualified-call','unqualified-ident','member-with','bang-get')` \u2014 that set has <10% false positives (DAO-field accesses, form-property reads, and bang refs no longer pollute the bucket).\n- **Post-extraction stub resolver** (v1.7+). Edges with `metadata.synthesizedBy='vba-name-resolution'` start life pointing at a synthetic function node; the resolver at `src/resolution/index.ts:resolveVbaCallStubs` (invoked from `indexAll` and `sync`) walks them and repoints each `target` to the real `nodes.id` when one exists. Runtime-object calls (`DAO.*`, `fso.*`, `ListBox.*`, `Collection.*`, `err.*`, `VBA.*`, `Application.*`, `Screen.*`, `DoCmd.*`, `CurrentDb.*`, `Forms`, `Reports`, `Debug`, `Modules`, `References`, `CommandBars`, `SysCmd`, `CreateObject`, `GetObject`, `Fields`) are explicitly declined \u2014 they remain `stub:true` because they can never link to user code. Shadow user classes (e.g. a user class actually named `DAO` with an `Execute` method) are preserved and linked normally. Every stub edge carries `metadata.repointDecision` with one of `reponted-to-real
|
|
20
|
+
export declare const SERVER_INSTRUCTIONS = "# Codegraph \u2014 code intelligence over an indexed knowledge graph\n\nCodegraph is a SQLite knowledge graph of every symbol, edge, and file in\nthe workspace \u2014 pre-computed structure you would otherwise re-derive by\nreading files (cached intelligence: thousands of parse/trace decisions you\ndon't pay to re-reason each run). Reads are sub-millisecond; the index lags\nwrites by ~1s through the file watcher. Reach for it BEFORE *and* while\nwriting or editing code \u2014 not just for questions: one call returns the\nverbatim source PLUS who calls it and what it affects, so you edit with the\nblast radius in view. More accurate context, in far fewer tokens and\nround-trips than reading files yourself.\n\n## One tool: codegraph_explore \u2014 use it instead of reading files\n\nThere is a single tool, `codegraph_explore`, and it is Read-equivalent. It\ntakes either a natural-language question or a bag of symbol/file names and\nreturns the **verbatim, line-numbered source** of the relevant symbols\ngrouped by file \u2014 the same `<n>\\t<line>` shape `Read` gives you, safe to\n`Edit` from \u2014 PLUS the call path among them (including dynamic-dispatch hops\nlike callbacks, React re-render, and JSX children that grep can't follow) and\na blast-radius summary of what depends on them.\n\nWhether you're answering \"how does X work\" or implementing a change (fixing a\nbug, adding a feature), call `codegraph_explore` before you Read. ONE call\nusually answers the whole question. Codegraph IS the pre-built search index \u2014\nso running your own grep + read loop, or delegating the lookup to a separate\nfile-reading sub-task/agent, repeats work codegraph already did and costs more\nfor the same answer. A direct codegraph answer is typically one to a few\ncalls; a grep/read exploration is dozens.\n\n## How to query\n\n- **Almost any question \u2014 \"how does X work\", architecture, a bug, \"what/where is X\", or surveying an area** \u2192 `codegraph_explore` with a natural-language question or the relevant names. ONE capped call returns the verbatim source grouped by file; most often the ONLY call you need.\n- **\"How does X reach/become Y? / the flow / the path from X to Y\"** \u2192 `codegraph_explore`, naming the symbols that span the flow (e.g. `mutateElement renderScene`) \u2014 it surfaces the call path among them, riding dynamic-dispatch hops, and returns their source.\n- **Reading or editing a file/symbol you can name** \u2192 put its name or file path in the `codegraph_explore` query \u2014 it returns that current line-numbered source (safe to `Edit` from) with the call path and blast radius attached, so you don't Read it separately. For an overloaded name it returns every matching definition's body in one call.\n- **Need more?** Call `codegraph_explore` again with more specific names \u2014 treat the source it returns as already Read.\n\n## Anti-patterns\n\n- **Trust codegraph's results \u2014 don't re-verify them with grep.** They come from a full AST parse; re-checking with grep is slower, less accurate, and wastes context.\n- **Don't grep or Read first** to find or understand indexed code \u2014 ONE `codegraph_explore` returns the relevant symbols' source together in a single round-trip. Reach for raw `Read`/`Grep` only to confirm a specific detail codegraph didn't cover, or for what codegraph doesn't index (configs, docs).\n- **Don't reconstruct a flow by hand** \u2014 name the endpoints in one `codegraph_explore` and it surfaces the path between them, dynamic-dispatch hops included.\n- **After editing, check the staleness banner.** When a tool response starts with \"\u26A0\uFE0F Some files referenced below were edited since the last index sync\u2026\", the listed files are pending re-index \u2014 Read those specific files for accurate content. Every file NOT in that banner is fresh, so still trust codegraph. A different, rarer banner \u2014 \"\u26A0\uFE0F CodeGraph auto-sync is DISABLED\u2026\" \u2014 means live watching stopped entirely (the whole index is frozen, not just a few files); until it's resolved, Read files directly to confirm anything that may have changed.\n\n## Limitations\n\n- If a tool reports a project isn't indexed (no `.codegraph/`), stop calling codegraph tools for that project for the rest of the session and use your built-in tools there instead. Indexing is the user's decision \u2014 mention they can run `codegraph init` if it comes up, but don't run it yourself.\n- Index lags file writes by ~1 second.\n- Cross-file resolution is best-effort name matching; ambiguous calls may return multiple candidates.\n- No live correctness validation \u2014 that's still the TypeScript compiler / test suite / linter's job. Codegraph supplements those with structural context they don't have.\n\n## Supported Languages\n\nThe indexer recognizes a fixed set of languages; if you ask about symbols in a\nfile with an unsupported extension, codegraph will report the project isn't\nindexed for that file and you should fall back to Read/Grep. The fork-specific\naddition beyond upstream codegraph is **VBA / Access** (Dysflow export\nformat):\n\n- **VBA / Access** - Dysflow exports Access/VBA source as `.bas`/`.cls`/\n `.form.txt`/`.report.txt`. Codegraph extracts `.bas`/`.cls` as `module`/\n `class`/`function` nodes with `calls`/`implements`/`references` edges\n (procedural-level; regex-based, not full AST). Cross-module calls, qualified\n `Dim As`, `WithEvents`, and SQL table references inside string literals\n emit synthesized edges tagged `metadata.synthesizedBy` (`vba-name-resolution`,\n `vba-withevents`, `vba-sql-table`). `.form.txt` and `.report.txt` are\n extracted as a `module` plus one `property` per Access control - **no**\n `function`/`sub`/`class` nodes come from form files; the canonical code\n lives in the sibling `.cls`, parsed by the same extractor on that file.\n Dysflow test manifests (`tests.*.json`) link each registered `Test_*`\n procedure to its manifest with a `references` edge tagged\n `vba-test-manifest` carrying the test name + tags, so `getCallers` of a\n production symbol reaches its covering test atoms with the manifest and tags\n to run.\n Pass `projectPath` to a codegraph index that includes VBA files.\n- **VBA unresolved refs carry syntactic shape** (v1.7+). `unresolved_refs.reference_kind` is no longer the literal string `\"references\"` \u2014 it reports what the syntactic shape actually was. Values: `call` (paren-form or statement-form call site), `qualified-call` (`obj.Foo(...)` with runtime receiver), `property-get` / `property-set` (`Me.Name`, `obj.Prop = value`), `bang-get` / `bang-set` (`Me!SubCtl`, `obj!Field = value`), `unqualified-ident` (bare identifier like `HayErrorEnRiesgo` in an `If` condition), `member-with` (`.Member` inside a `With` block), `dao-query` (`DoCmd.OpenQuery \"X\"` argument). The legacy value `references` is retained on any path the round did not reclassify, so older SQL filters that key on it keep working. To find real missing callees, filter `WHERE reference_kind IN ('call','qualified-call','unqualified-ident','member-with','bang-get')` \u2014 that set has <10% false positives (DAO-field accesses, form-property reads, and bang refs no longer pollute the bucket).\n- **Post-extraction stub resolver** (v1.7+). Edges with `metadata.synthesizedBy='vba-name-resolution'` start life pointing at a synthetic function node; the resolver at `src/resolution/index.ts:resolveVbaCallStubs` (invoked from `indexAll` and `sync`) walks them and repoints each `target` to the real `nodes.id` when one exists. Runtime-object calls (`DAO.*`, `fso.*`, `ListBox.*`, `Collection.*`, `err.*`, `VBA.*`, `Application.*`, `Screen.*`, `DoCmd.*`, `CurrentDb.*`, `Forms`, `Reports`, `Debug`, `Modules`, `References`, `CommandBars`, `SysCmd`, `CreateObject`, `GetObject`, `Fields`) are explicitly declined \u2014 they remain `stub:true` because they can never link to user code. Shadow user classes (e.g. a user class actually named `DAO` with an `Execute` method) are preserved and linked normally. Every stub edge carries `metadata.repointDecision` with one of `reponted-to-real` (linked to a real `nodes.id`), `declined-runtime` (runtime object \u2014 never user code, filter OUT), `declined-ambiguous` (multiple real candidates \u2014 investigate), or `declined-not-found` (genuinely missing callee \u2014 this is the actionable signal). Consumers detecting \"missing callees\" MUST filter on `repointDecision='declined-not-found'`, NOT on the raw `stub=true` count \u2014 the raw count is dominated by runtime-object noise. See `docs/vba-stub-repoint-decision.md` for the full contract.\n";
|
|
21
21
|
/**
|
|
22
22
|
* Instructions variant sent when the server's own root has NO codegraph index.
|
|
23
23
|
*
|
package/dist/upgrade/index.d.ts
CHANGED
|
@@ -116,6 +116,22 @@ export interface UpgradeDeps {
|
|
|
116
116
|
warn: (msg: string) => void;
|
|
117
117
|
error: (msg: string) => void;
|
|
118
118
|
platform: NodeJS.Platform;
|
|
119
|
+
/**
|
|
120
|
+
* Override for the version read from the installed package.json. Used by
|
|
121
|
+
* the post-install verification: if npm reports success but the on-disk
|
|
122
|
+
* version differs from the target, the upgrade retries from the registry
|
|
123
|
+
* tarball URL. `null` simulates "could not read the file" (no retry, no
|
|
124
|
+
* warning); undefined falls back to actually reading the package.json.
|
|
125
|
+
* Tests set this to simulate the silent stale-install failure mode without
|
|
126
|
+
* touching the filesystem.
|
|
127
|
+
*/
|
|
128
|
+
installedPackageVersion?: string | null;
|
|
129
|
+
/**
|
|
130
|
+
* Override for the orphan-staging sweep count. Tests use this to verify
|
|
131
|
+
* pre-cleanup runs (and is skipped for non-global methods). undefined
|
|
132
|
+
* triggers a real `readdir` + `rm` against the global node_modules tree.
|
|
133
|
+
*/
|
|
134
|
+
orphanCleanupOverride?: () => number;
|
|
119
135
|
}
|
|
120
136
|
/** The honest, additive re-index reminder shown after a successful upgrade. */
|
|
121
137
|
export declare function reindexAdvisory(): string;
|
|
@@ -147,6 +163,54 @@ export declare function npmInvocation(platform: NodeJS.Platform, npmArgs: string
|
|
|
147
163
|
cmd: string;
|
|
148
164
|
args: string[];
|
|
149
165
|
};
|
|
166
|
+
/**
|
|
167
|
+
* Resolve the npm global root for the current install. The upgrade module is
|
|
168
|
+
* always running from inside its own install — `<root>/node_modules/@scope/pkg/
|
|
169
|
+
* dist/upgrade/index.js` on both Windows and Unix — so we can derive the root
|
|
170
|
+
* by walking up `__filename` to the first `node_modules` ancestor and taking
|
|
171
|
+
* its parent. No need to shell out to `npm root -g` (which would consume a
|
|
172
|
+
* capture slot in tests and is platform-dependent).
|
|
173
|
+
*
|
|
174
|
+
* Returns null when not running from a `node_modules` tree (e.g. source
|
|
175
|
+
* checkout, npx cache, bundle). Callers treat null as "no globals to scan".
|
|
176
|
+
*/
|
|
177
|
+
export declare function resolveNpmGlobalRoot(_deps?: UpgradeDeps): string | null;
|
|
178
|
+
/**
|
|
179
|
+
* Find npm orphan staging dirs in the global node_modules tree. An "orphan" is
|
|
180
|
+
* a directory matching `.codegraph-vba-<HASH>` or `.codegraph-vba-win32-<ARCH>`
|
|
181
|
+
* next to the live `@aroman22/codegraph-vba` install — npm creates these when
|
|
182
|
+
* it begins a global upgrade and the previous run was interrupted (EBUSY on
|
|
183
|
+
* node.exe, EPERM during cleanup, etc.). They block subsequent upgrades and
|
|
184
|
+
* can hold a partial copy of an older version that confuses `npm view`.
|
|
185
|
+
*
|
|
186
|
+
* Returns the list of absolute paths to remove. Pure so it's unit-tested with
|
|
187
|
+
* an injected fs.
|
|
188
|
+
*/
|
|
189
|
+
export declare function findOrphanStagings(globalRoot: string, exists?: (p: string) => boolean, readdir?: (p: string) => string[]): string[];
|
|
190
|
+
/**
|
|
191
|
+
* Remove orphan npm staging dirs from the global node_modules tree. Best-effort
|
|
192
|
+
* — failures are logged but never fatal to the upgrade (a leftover orphan is
|
|
193
|
+
* annoying; blocking the upgrade over it is worse). Exposed for tests.
|
|
194
|
+
*
|
|
195
|
+
* Returns the count successfully removed.
|
|
196
|
+
*/
|
|
197
|
+
export declare function cleanupOrphanStagings(deps: UpgradeDeps, opts?: {
|
|
198
|
+
rm?: (p: string) => boolean;
|
|
199
|
+
exists?: (p: string) => boolean;
|
|
200
|
+
readdir?: (p: string) => string[];
|
|
201
|
+
globalRoot?: string | null;
|
|
202
|
+
}): number;
|
|
203
|
+
/**
|
|
204
|
+
* Read the installed package.json and return its `version` field, or null if
|
|
205
|
+
* the file can't be read or parsed. Used by the post-install verification to
|
|
206
|
+
* catch silent stale-install failure modes (npm reports success but the
|
|
207
|
+
* on-disk version is older than the target). Exposed for tests.
|
|
208
|
+
*/
|
|
209
|
+
export declare function readInstalledPackageVersion(deps: UpgradeDeps, opts?: {
|
|
210
|
+
readFile?: (p: string) => string;
|
|
211
|
+
exists?: (p: string) => boolean;
|
|
212
|
+
globalRoot?: string | null;
|
|
213
|
+
}): string | null;
|
|
150
214
|
/**
|
|
151
215
|
* True if `cmd` resolves to an executable on PATH. A pure-Node PATH scan — NOT
|
|
152
216
|
* a spawned `command -v`/`which`: `command` is a shell builtin (no standalone
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@aroman22/codegraph-vba",
|
|
3
|
-
"version": "1.7.
|
|
3
|
+
"version": "1.7.2",
|
|
4
4
|
"description": "Local-first code intelligence for AI agents (MCP). Self-contained — bundles its own runtime.",
|
|
5
5
|
"bin": {
|
|
6
6
|
"codegraph-vba": "npm-shim.js"
|
|
@@ -15,12 +15,12 @@
|
|
|
15
15
|
"./package.json": "./package.json"
|
|
16
16
|
},
|
|
17
17
|
"optionalDependencies": {
|
|
18
|
-
"@aroman22/codegraph-vba-darwin-arm64": "1.7.
|
|
19
|
-
"@aroman22/codegraph-vba-darwin-x64": "1.7.
|
|
20
|
-
"@aroman22/codegraph-vba-linux-arm64": "1.7.
|
|
21
|
-
"@aroman22/codegraph-vba-linux-x64": "1.7.
|
|
22
|
-
"@aroman22/codegraph-vba-win32-arm64": "1.7.
|
|
23
|
-
"@aroman22/codegraph-vba-win32-x64": "1.7.
|
|
18
|
+
"@aroman22/codegraph-vba-darwin-arm64": "1.7.2",
|
|
19
|
+
"@aroman22/codegraph-vba-darwin-x64": "1.7.2",
|
|
20
|
+
"@aroman22/codegraph-vba-linux-arm64": "1.7.2",
|
|
21
|
+
"@aroman22/codegraph-vba-linux-x64": "1.7.2",
|
|
22
|
+
"@aroman22/codegraph-vba-win32-arm64": "1.7.2",
|
|
23
|
+
"@aroman22/codegraph-vba-win32-x64": "1.7.2"
|
|
24
24
|
},
|
|
25
25
|
"files": [
|
|
26
26
|
"npm-shim.js",
|