@aroman22/codegraph-vba 1.6.2 → 1.7.0
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 +5 -5
- package/dist/extraction/vba/calls.d.ts +6 -2
- package/dist/extraction/vba/controls.d.ts +17 -0
- package/dist/mcp/server-instructions.d.ts +1 -1
- package/dist/resolution/index.d.ts +12 -0
- package/dist/resolution/vba-runtime-objects.d.ts +40 -0
- package/dist/types.d.ts +33 -1
- package/dist/upgrade/index.d.ts +1 -1
- package/npm-shim.js +1 -1
- package/package.json +7 -7
package/README.md
CHANGED
|
@@ -51,11 +51,11 @@ This repository is a fork of [`colbymchenry/codegraph`](https://github.com/colby
|
|
|
51
51
|
|
|
52
52
|
**Why fork?** To add VBA / Access language support that does not exist upstream, so agents can navigate Microsoft Access projects managed by Dysflow the same way they navigate TypeScript or Python today. See the [VBA / Access + Dysflow integration](#vba--access--dysflow-integration) section below for the feature spec, the pattern table, and the hard invariants.
|
|
53
53
|
|
|
54
|
-
**The fork is published to npm as
|
|
54
|
+
**The fork is published to npm as `@aroman22/codegraph-vba`.** The upstream package `@colbymchenry/codegraph` does **not** have VBA / Access support — install `@aroman22/codegraph-vba` to get it:
|
|
55
55
|
|
|
56
56
|
```bash
|
|
57
57
|
# Option A — install from npm (easiest; gets you the codegraph-vba CLI on PATH):
|
|
58
|
-
npm i -g codegraph-vba
|
|
58
|
+
npm i -g @aroman22/codegraph-vba
|
|
59
59
|
# or with pnpm:
|
|
60
60
|
pnpm add -g codegraph-vba
|
|
61
61
|
# or the one-line OS installer (no Node required) — see Get Started below.
|
|
@@ -96,7 +96,7 @@ irm https://raw.githubusercontent.com/ardelperal/codegraph-vba/main/install.ps1
|
|
|
96
96
|
<summary><b>Already have Node? Use npm instead (works on any version)</b></summary>
|
|
97
97
|
|
|
98
98
|
```bash
|
|
99
|
-
npm i -g codegraph-vba
|
|
99
|
+
npm i -g @aroman22/codegraph-vba
|
|
100
100
|
```
|
|
101
101
|
|
|
102
102
|
<sub>CodeGraph bundles its own runtime — nothing to compile, no native build, works the same everywhere. The installer puts `codegraph-vba` on your PATH but **doesn't change your current shell** — open a new terminal before the next step so the command resolves.</sub>
|
|
@@ -470,7 +470,7 @@ That's it — your agent will use CodeGraph tools automatically when a `.codegra
|
|
|
470
470
|
|
|
471
471
|
**Install globally:**
|
|
472
472
|
```bash
|
|
473
|
-
npm i -g codegraph-vba
|
|
473
|
+
npm i -g @aroman22/codegraph-vba
|
|
474
474
|
```
|
|
475
475
|
|
|
476
476
|
**Add to `~/.claude.json`:**
|
|
@@ -837,7 +837,7 @@ Framework routing is validated the same way, on a canonical app per framework: E
|
|
|
837
837
|
|
|
838
838
|
**MCP hits `database is locked`** — current builds shouldn't: CodeGraph bundles its own Node runtime and uses Node's built-in `node:sqlite` in WAL mode, where concurrent reads never block on a writer. If you still see it:
|
|
839
839
|
|
|
840
|
-
- **You're on an old (pre-0.9) install.** Reinstall to get the bundled runtime — `curl -fsSL https://raw.githubusercontent.com/ardelperal/codegraph-vba/main/install.sh | sh` (macOS/Linux), `irm https://raw.githubusercontent.com/ardelperal/codegraph-vba/main/install.ps1 | iex` (Windows), or `npm i -g codegraph-vba@latest`.
|
|
840
|
+
- **You're on an old (pre-0.9) install.** Reinstall to get the bundled runtime — `curl -fsSL https://raw.githubusercontent.com/ardelperal/codegraph-vba/main/install.sh | sh` (macOS/Linux), `irm https://raw.githubusercontent.com/ardelperal/codegraph-vba/main/install.ps1 | iex` (Windows), or `npm i -g @aroman22/codegraph-vba@latest`.
|
|
841
841
|
- **`codegraph-vba status` shows `Journal:` other than `wal`** — WAL couldn't be enabled on this filesystem (common on network shares and WSL2 `/mnt`), so reads can block on writes. Move the project (with its `.codegraph-vba/` folder) onto a local disk.
|
|
842
842
|
|
|
843
843
|
**MCP server not connecting** — Your agent starts the server itself, so you don't launch it by hand. Make sure the project is initialized and indexed (`codegraph-vba status`) and that the path in your MCP config is correct. If it still won't connect, re-run `codegraph-vba install` to rewrite the config.
|
|
@@ -20,9 +20,13 @@ export declare function splitSingleLineIfClauses(line: string): string[];
|
|
|
20
20
|
export declare function detectStatementCall(line: string): string | null;
|
|
21
21
|
/**
|
|
22
22
|
* H1: emit a same-file `calls` edge for a statement-form Sub call to the
|
|
23
|
-
* already-emitted function node named `procName`.
|
|
23
|
+
* already-emitted function node named `procName`. Returns `true` when a
|
|
24
|
+
* `calls` edge was pushed, `false` when the call was silenced
|
|
25
|
+
* (blacklist / runtime / self-call / unresolvable). Round-3 (issue
|
|
26
|
+
* #108) needs that boolean so the call sweep can fall through to push
|
|
27
|
+
* an `unqualified-ident` unresolved reference.
|
|
24
28
|
*/
|
|
25
|
-
export declare function emitStatementCallEdge(ctx: VbaExtractorContext, caller: ProcInfo, procName: string, lineNum: number):
|
|
29
|
+
export declare function emitStatementCallEdge(ctx: VbaExtractorContext, caller: ProcInfo, procName: string, lineNum: number): boolean;
|
|
26
30
|
/**
|
|
27
31
|
* Fix 7: detect a qualified statement-form call — `Receiver.Member <args>`
|
|
28
32
|
* where `Receiver.Member` is NOT followed by `(`. Distinct from the paren
|
|
@@ -11,6 +11,15 @@ import { VbaExtractorContext, ProcInfo } from './context';
|
|
|
11
11
|
* `metadata.synthesizedBy: 'vba-me-control'`. Operates on the masked
|
|
12
12
|
* `callScanLine`. The +3 column offset skips the 3-char `Me.` / `Me!`
|
|
13
13
|
* prefix (both are 3 chars).
|
|
14
|
+
*
|
|
15
|
+
* Round-3 (issue #108): the `referenceKind` is keyed off the operator
|
|
16
|
+
* (`.` vs `!`) at the match position. The same-line `=` heuristic
|
|
17
|
+
* distinguishes reads from assignments: `x = Me.Name` → `property-get`,
|
|
18
|
+
* `Me.Name = "X"` → `property-set`. Cross-line property-set is out of
|
|
19
|
+
* scope; the `=` rule is satisfied when the assignment appears on the
|
|
20
|
+
* SAME line at any position AFTER the matched control name (allowing
|
|
21
|
+
* trailing `.Caption = value` chained assignments too — they still
|
|
22
|
+
* flow a write into the captured control identifier).
|
|
14
23
|
*/
|
|
15
24
|
export declare function scanMeControlReferences(ctx: VbaExtractorContext, line: string, from: ProcInfo, lineNum: number): void;
|
|
16
25
|
/**
|
|
@@ -19,6 +28,14 @@ export declare function scanMeControlReferences(ctx: VbaExtractorContext, line:
|
|
|
19
28
|
* emit ONE UnresolvedReference per match with `metadata.synthesizedBy
|
|
20
29
|
* = 'vba-forms-bang'`. Operates on the ORIGINAL (unmasked) line. The form
|
|
21
30
|
* identifier is unwrapped of surrounding `"` quotes and `[…]` brackets.
|
|
31
|
+
*
|
|
32
|
+
* Round-3 (issue #108): cross-form bang is always a property access
|
|
33
|
+
* (VBA semantics: there's no bang-call). The reference name is the FORM
|
|
34
|
+
* module — the resolver matches it against the indexed `Form_*` nodes
|
|
35
|
+
* downstream — so the kind is `'bang-get'` regardless of the read/write
|
|
36
|
+
* direction. A direct cross-form bang assignment
|
|
37
|
+
* (`Forms!FormX!Ctl = value`) is rare; round-3 emits `'bang-get'`
|
|
38
|
+
* uniformly and the resolvers do not care about access direction here.
|
|
22
39
|
*/
|
|
23
40
|
export declare function scanFormsBang(ctx: VbaExtractorContext, line: string, from: ProcInfo, lineNum: number): void;
|
|
24
41
|
//# sourceMappingURL=controls.d.ts.map
|
|
@@ -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";
|
|
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`, `declined-runtime`, `declined-ambiguous`, `declined-not-found`, so consumers can tell apart a runtime-object decline from a genuinely-missing callee at the SQL layer.\n";
|
|
21
21
|
/**
|
|
22
22
|
* Instructions variant sent when the server's own root has NO codegraph index.
|
|
23
23
|
*
|
|
@@ -7,6 +7,18 @@ import { UnresolvedReference, Edge } from '../types';
|
|
|
7
7
|
import { QueryBuilder } from '../db/queries';
|
|
8
8
|
import { UnresolvedRef, ResolvedRef, ResolutionResult } from './types';
|
|
9
9
|
import { type MaybeYield } from './cooperative-yield';
|
|
10
|
+
/**
|
|
11
|
+
* Outcome of resolving a single VBA call-stub (issue #110). Recorded on the
|
|
12
|
+
* stub's incoming `calls` edge as `metadata.repointDecision` for
|
|
13
|
+
* observability so a consumer can tell a runtime-object decline apart from a
|
|
14
|
+
* genuinely-missing callee:
|
|
15
|
+
* - `reponted-to-real` — a real user target was found; edge repointed (stub:false).
|
|
16
|
+
* - `declined-runtime` — receiver is a runtime object with no user shadow; kept stub:true.
|
|
17
|
+
* - `declined-ambiguous` — 2+ real candidates; can't safely pick one; kept stub:true.
|
|
18
|
+
* - `declined-not-found` — no real target and not a runtime object (genuine miss); kept stub:true.
|
|
19
|
+
* (The `reponted-to-real` spelling is the wire value consumers already key on.)
|
|
20
|
+
*/
|
|
21
|
+
export type RepointDecision = 'reponted-to-real' | 'declined-runtime' | 'declined-ambiguous' | 'declined-not-found';
|
|
10
22
|
export * from './types';
|
|
11
23
|
/**
|
|
12
24
|
* Reference Resolver
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Canonical list of VBA/Access runtime objects and singletons whose
|
|
3
|
+
* `Receiver.Member` calls are NEVER user-defined code — DAO, FileSystemObject
|
|
4
|
+
* (`fso`), intrinsic collections, error/debug intrinsics, and Access
|
|
5
|
+
* application singletons.
|
|
6
|
+
*
|
|
7
|
+
* Consumed by the post-extraction call-stub resolver
|
|
8
|
+
* (`ReferenceResolver.resolveVbaCallStubTarget`, see `./index.ts`) to DECLINE
|
|
9
|
+
* repointing a synthetic `calls` stub whose receiver is a runtime object and
|
|
10
|
+
* has no real user declaration in the project. Declining keeps the edge
|
|
11
|
+
* `stub:true`, so a consumer's `WHERE stub=true` guardrail returns GENUINE
|
|
12
|
+
* missing callees only, free of runtime-object noise (issue #110, supersedes
|
|
13
|
+
* #109).
|
|
14
|
+
*
|
|
15
|
+
* A user class or module that happens to share a runtime-object name (a
|
|
16
|
+
* "shadow" declaration, e.g. a user `.cls` literally named `DAO`) is still
|
|
17
|
+
* linked: the resolver runs its normal two-step name resolution FIRST and
|
|
18
|
+
* only falls back to this list when no real target exists, so a shadow
|
|
19
|
+
* declaration is repointed exactly like any other real symbol (FR-2.1).
|
|
20
|
+
*
|
|
21
|
+
* NOTE — this is complementary to, NOT a duplicate of, the VBA extractor's
|
|
22
|
+
* own `RUNTIME_RECEIVER_BLACKLIST` (`src/extraction/vba/constants.ts`). That
|
|
23
|
+
* set is case-sensitive PascalCase and suppresses stub SYNTHESIS for the
|
|
24
|
+
* common receivers at extraction time; this set is lowercased and catches the
|
|
25
|
+
* runtime-object stubs that still reached the graph (lowercase receivers,
|
|
26
|
+
* `Dim x As DAO.*` typed locals whose receiver survives as raw text, etc.).
|
|
27
|
+
* The extractor blacklist deliberately stays untouched (AC-4: `src/extraction`
|
|
28
|
+
* has 0 diff); the two layers are independent by design.
|
|
29
|
+
*
|
|
30
|
+
* Entries are lowercased so matching is case-insensitive against a stub's
|
|
31
|
+
* receiver.
|
|
32
|
+
*/
|
|
33
|
+
export declare const RUNTIME_OBJECTS: ReadonlySet<string>;
|
|
34
|
+
/**
|
|
35
|
+
* True iff `receiver` (any case) names a known VBA/Access runtime object.
|
|
36
|
+
* Leading/trailing brackets and surrounding whitespace are stripped
|
|
37
|
+
* defensively so a bracketed receiver (`[DAO]`) still matches.
|
|
38
|
+
*/
|
|
39
|
+
export declare function isRuntimeObject(receiver: string | null | undefined): boolean;
|
|
40
|
+
//# sourceMappingURL=vba-runtime-objects.d.ts.map
|
package/dist/types.d.ts
CHANGED
|
@@ -169,8 +169,40 @@ export interface ExtractionError {
|
|
|
169
169
|
* a function name used as a VALUE (callback registration, #756). It never
|
|
170
170
|
* becomes an edge kind: resolution maps it to a `references` edge targeting
|
|
171
171
|
* function/method nodes only (see `matchFunctionRef`).
|
|
172
|
+
*
|
|
173
|
+
* Round-3 (issue #108) extends the union with shape-based classifiers so
|
|
174
|
+
* the consumer can filter `unresolved_refs` by syntactic shape at the SQL
|
|
175
|
+
* layer. The legacy `EdgeKind` literal `'references'` is preserved as
|
|
176
|
+
* `references` here via `EdgeKind` — back-compat for any push site this
|
|
177
|
+
* round does not reclassify (e.g. the Implements emitter). New literals:
|
|
178
|
+
* - `call` paren-form `Name(...)` or statement-form Sub call
|
|
179
|
+
* - `qualified-call` `Receiver.Member(...)` (qualified-paren) or
|
|
180
|
+
* `Receiver.Member args` (qualified-statement)
|
|
181
|
+
* - `property-get` `Me.Name` (dot access, read)
|
|
182
|
+
* - `property-set` `Me.Name = value` (dot access, assignment)
|
|
183
|
+
* - `bang-get` `Me!SubCtl` (bang read) or
|
|
184
|
+
* `Forms!FormX!Ctl` / `Forms("FormX")!Ctl` (cross-form)
|
|
185
|
+
* - `bang-set` `Me!SubCtl = value` (bang assignment)
|
|
186
|
+
* - `unqualified-ident` bare identifier without `(` after; default for
|
|
187
|
+
* `HayErrorEnRiesgo`-style hits — Const-read takes
|
|
188
|
+
* priority via FR-3.1 disambiguation
|
|
189
|
+
* - `member-with` `.Member` inside a `With <receiver>` block
|
|
190
|
+
* - `dao-query` `DoCmd.OpenQuery "X"` argument
|
|
191
|
+
* `dao-field-get` / `dao-field-set` are deliberately deferred to round-4.
|
|
192
|
+
*/
|
|
193
|
+
export type ReferenceKind = EdgeKind | 'function_ref' | 'call' | 'qualified-call' | 'property-get' | 'property-set' | 'bang-get' | 'bang-set' | 'unqualified-ident' | 'member-with' | 'dao-query';
|
|
194
|
+
/**
|
|
195
|
+
* Runtime guard for whether a `ReferenceKind` literal is also an `EdgeKind`
|
|
196
|
+
* literal (i.e. the value flows from an unresolved-ref row straight onto the
|
|
197
|
+
* kind column of a resolved edge without remapping). Round-3 (issue #108)
|
|
198
|
+
* introduced shape-based classifier literals (`call`, `qualified-call`,
|
|
199
|
+
* `property-get`, …) that are valid as a `ReferenceKind` but are NOT valid
|
|
200
|
+
* edge kinds — edges still use the `calls`/`references` family of literals.
|
|
201
|
+
* The resolver uses this guard to fall back to `'references'` for the edge
|
|
202
|
+
* kind while keeping the shape preserved on the unresolved-ref row, so the
|
|
203
|
+
* consumer's SQL filter still works after resolution.
|
|
172
204
|
*/
|
|
173
|
-
export
|
|
205
|
+
export declare function isEdgeKindLiteral(value: ReferenceKind): value is EdgeKind;
|
|
174
206
|
/**
|
|
175
207
|
* A reference that couldn't be resolved during extraction
|
|
176
208
|
*/
|
package/dist/upgrade/index.d.ts
CHANGED
|
@@ -24,7 +24,7 @@
|
|
|
24
24
|
* conventional Windows self-update dance (rustup/nvm-windows do the same).
|
|
25
25
|
*/
|
|
26
26
|
export declare const REPO = "ardelperal/codegraph-vba";
|
|
27
|
-
export declare const NPM_PACKAGE = "codegraph-vba";
|
|
27
|
+
export declare const NPM_PACKAGE = "@aroman22/codegraph-vba";
|
|
28
28
|
export declare const INSTALL_SH_URL = "https://raw.githubusercontent.com/ardelperal/codegraph-vba/main/install.sh";
|
|
29
29
|
export type InstallMethod = {
|
|
30
30
|
kind: 'bundle';
|
package/npm-shim.js
CHANGED
|
@@ -267,7 +267,7 @@ function fail(reason) {
|
|
|
267
267
|
'A registry mirror (e.g. npmmirror/cnpm) that did not mirror the per-platform\n' +
|
|
268
268
|
'package is the usual cause. Fixes:\n' +
|
|
269
269
|
' - install from the official registry:\n' +
|
|
270
|
-
' npm i -g codegraph-vba --registry=https://registry.npmjs.org\n' +
|
|
270
|
+
' npm i -g @aroman22/codegraph-vba --registry=https://registry.npmjs.org\n' +
|
|
271
271
|
' - or use the standalone installer (no Node required):\n' +
|
|
272
272
|
' curl -fsSL https://raw.githubusercontent.com/' + REPO + '/main/install.sh | sh\n'
|
|
273
273
|
);
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@aroman22/codegraph-vba",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.7.0",
|
|
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.
|
|
19
|
-
"@aroman22/codegraph-vba-darwin-x64": "1.
|
|
20
|
-
"@aroman22/codegraph-vba-linux-arm64": "1.
|
|
21
|
-
"@aroman22/codegraph-vba-linux-x64": "1.
|
|
22
|
-
"@aroman22/codegraph-vba-win32-arm64": "1.
|
|
23
|
-
"@aroman22/codegraph-vba-win32-x64": "1.
|
|
18
|
+
"@aroman22/codegraph-vba-darwin-arm64": "1.7.0",
|
|
19
|
+
"@aroman22/codegraph-vba-darwin-x64": "1.7.0",
|
|
20
|
+
"@aroman22/codegraph-vba-linux-arm64": "1.7.0",
|
|
21
|
+
"@aroman22/codegraph-vba-linux-x64": "1.7.0",
|
|
22
|
+
"@aroman22/codegraph-vba-win32-arm64": "1.7.0",
|
|
23
|
+
"@aroman22/codegraph-vba-win32-x64": "1.7.0"
|
|
24
24
|
},
|
|
25
25
|
"files": [
|
|
26
26
|
"npm-shim.js",
|