@aroman22/codegraph-vba 1.5.2 → 1.6.1
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 +11 -11
- package/dist/bin/codegraph.d.ts +1 -1
- package/dist/bin/command-supervision.d.ts +38 -1
- package/dist/db/index.d.ts +84 -5
- package/dist/db/migrations.d.ts +1 -1
- package/dist/db/queries.d.ts +116 -4
- package/dist/db/wal-valve.d.ts +106 -0
- package/dist/directory.d.ts +9 -5
- package/dist/extraction/cfml-extractor.d.ts +107 -0
- package/dist/extraction/grammars.d.ts +25 -1
- package/dist/extraction/index.d.ts +47 -2
- package/dist/extraction/languages/arkts.d.ts +3 -0
- package/dist/extraction/languages/c-cpp.d.ts +98 -0
- package/dist/extraction/languages/cfquery.d.ts +12 -0
- package/dist/extraction/languages/cfscript.d.ts +3 -0
- package/dist/extraction/languages/cobol.d.ts +33 -0
- package/dist/extraction/languages/erlang.d.ts +3 -0
- package/dist/extraction/languages/nix.d.ts +3 -0
- package/dist/extraction/languages/solidity.d.ts +3 -0
- package/dist/extraction/languages/terraform.d.ts +3 -0
- package/dist/extraction/languages/vbnet.d.ts +11 -0
- package/dist/extraction/mybatis-extractor.d.ts +30 -10
- package/dist/extraction/parse-pool.d.ts +28 -1
- package/dist/extraction/tree-sitter-types.d.ts +20 -1
- package/dist/extraction/tree-sitter.d.ts +60 -1
- package/dist/extraction/vba/call-sweep.d.ts +3 -0
- package/dist/extraction/vba/calls.d.ts +55 -0
- package/dist/extraction/vba/constants.d.ts +42 -0
- package/dist/extraction/vba/context.d.ts +175 -0
- package/dist/extraction/vba/controls.d.ts +24 -0
- package/dist/extraction/vba/declarations.d.ts +3 -0
- package/dist/extraction/vba/dims.d.ts +3 -0
- package/dist/extraction/vba/docmd.d.ts +16 -0
- package/dist/extraction/vba/enums-consts.d.ts +15 -0
- package/dist/extraction/vba/implements.d.ts +3 -0
- package/dist/extraction/vba/procedures.d.ts +3 -0
- package/dist/extraction/vba/sql-wrapper.d.ts +17 -0
- package/dist/extraction/vba/tempvars.d.ts +10 -0
- package/dist/extraction/vba/text-utils.d.ts +73 -0
- package/dist/extraction/vba-extractor.d.ts +3 -951
- package/dist/extraction/vba-preprocess.d.ts +1 -1
- package/dist/index.d.ts +81 -1
- package/dist/installer/index.d.ts +42 -0
- package/dist/mcp/daemon.d.ts +35 -3
- package/dist/mcp/early-ppid.d.ts +26 -0
- package/dist/mcp/liveness-watchdog.d.ts +18 -1
- package/dist/mcp/query-pool.d.ts +14 -0
- package/dist/mcp/session.d.ts +14 -0
- package/dist/mcp/startup-handshake.d.ts +44 -0
- package/dist/mcp/tools.d.ts +22 -0
- package/dist/project-config.d.ts +44 -0
- package/dist/resolution/c-fnptr-synthesizer.d.ts +2 -1
- package/dist/resolution/callback-synthesizer.d.ts +1 -1
- package/dist/resolution/cooperative-yield.d.ts +32 -0
- package/dist/resolution/frameworks/cics.d.ts +20 -0
- package/dist/resolution/frameworks/terraform.d.ts +38 -0
- package/dist/resolution/goframe-synthesizer.d.ts +2 -1
- package/dist/resolution/import-resolver.d.ts +7 -0
- package/dist/resolution/index.d.ts +64 -2
- package/dist/resolution/name-matcher.d.ts +22 -3
- package/dist/resolution/strip-comments.d.ts +1 -1
- package/dist/resolution/types.d.ts +29 -0
- package/dist/resolution/workspace-packages.d.ts +10 -0
- package/dist/search/identifier-segments.d.ts +60 -0
- package/dist/sync/watcher.d.ts +10 -5
- package/dist/sync/worktree.d.ts +9 -0
- package/dist/types.d.ts +25 -2
- package/dist/upgrade/index.d.ts +34 -2
- package/dist/upgrade/remove-binary.d.ts +87 -0
- package/dist/upgrade/update-check.d.ts +92 -0
- package/npm-shim.js +33 -4
- package/package.json +7 -7
- package/dist/reasoning/config.d.ts +0 -45
- package/dist/reasoning/credentials.d.ts +0 -5
- package/dist/reasoning/login.d.ts +0 -21
- package/dist/reasoning/reasoner.d.ts +0 -43
package/npm-shim.js
CHANGED
|
@@ -34,7 +34,7 @@ var path = require('path');
|
|
|
34
34
|
var target = process.platform + '-' + process.arch; // e.g. darwin-arm64, linux-x64
|
|
35
35
|
var pkg = '@aroman22/codegraph-vba-' + target;
|
|
36
36
|
var isWindows = process.platform === 'win32';
|
|
37
|
-
var REPO = 'ardelperal/codegraph';
|
|
37
|
+
var REPO = 'ardelperal/codegraph-vba';
|
|
38
38
|
|
|
39
39
|
main().catch(function (e) {
|
|
40
40
|
process.stderr.write('codegraph: ' + (e && e.message ? e.message : String(e)) + '\n');
|
|
@@ -45,7 +45,14 @@ async function main() {
|
|
|
45
45
|
// Happy path: the npm-installed optional dependency. Fall back to a download
|
|
46
46
|
// when the registry didn't deliver it.
|
|
47
47
|
var resolved = resolveInstalledBundle() || (await selfHealBundle());
|
|
48
|
-
|
|
48
|
+
// Thread the MCP host's pid (our parent) down to the bundled server so its
|
|
49
|
+
// orphan watchdog can poll the host directly. Without this, the server can
|
|
50
|
+
// only watch THIS shim — and a shim killed during the server's first ~100ms
|
|
51
|
+
// of startup used to leave the server orphaned forever (issue #1185). An
|
|
52
|
+
// already-set value (an outer launcher) wins.
|
|
53
|
+
var env = Object.assign({}, process.env);
|
|
54
|
+
if (!env.CODEGRAPH_HOST_PPID) env.CODEGRAPH_HOST_PPID = String(process.ppid);
|
|
55
|
+
var res = childProcess.spawnSync(resolved.command, resolved.args, { stdio: 'inherit', windowsHide: true, env: env });
|
|
49
56
|
if (res.error) {
|
|
50
57
|
process.stderr.write('codegraph: ' + res.error.message + '\n');
|
|
51
58
|
process.exit(1);
|
|
@@ -105,7 +112,7 @@ async function selfHealBundle() {
|
|
|
105
112
|
// Already downloaded by a previous run? Use it even when downloads are
|
|
106
113
|
// disabled — CODEGRAPH_NO_DOWNLOAD blocks fetching, not a cached bundle.
|
|
107
114
|
var cached = launcherIn(dest);
|
|
108
|
-
if (cached) return cached;
|
|
115
|
+
if (cached) { pruneOldBundles(bundlesDir, dest); return cached; }
|
|
109
116
|
|
|
110
117
|
if (process.env.CODEGRAPH_NO_DOWNLOAD) {
|
|
111
118
|
fail('the network fallback is disabled (CODEGRAPH_NO_DOWNLOAD is set).');
|
|
@@ -149,6 +156,7 @@ async function selfHealBundle() {
|
|
|
149
156
|
|
|
150
157
|
var ready = launcherIn(dest);
|
|
151
158
|
if (!ready) fail('downloaded bundle is missing its launcher under ' + dest + '.');
|
|
159
|
+
pruneOldBundles(bundlesDir, dest);
|
|
152
160
|
process.stderr.write('codegraph: bundle ready.\n');
|
|
153
161
|
return ready;
|
|
154
162
|
}
|
|
@@ -221,7 +229,7 @@ function extract(archive, destDir) {
|
|
|
221
229
|
var args = isWindows
|
|
222
230
|
? ['-xf', archive, '-C', destDir, '--strip-components=1']
|
|
223
231
|
: ['-xzf', archive, '-C', destDir, '--strip-components=1'];
|
|
224
|
-
var res = childProcess.spawnSync('tar', args, { stdio: 'ignore' });
|
|
232
|
+
var res = childProcess.spawnSync('tar', args, { stdio: 'ignore', windowsHide: true });
|
|
225
233
|
if (res.error) throw new Error('tar unavailable: ' + res.error.message);
|
|
226
234
|
if (res.status !== 0) throw new Error('tar exited ' + res.status);
|
|
227
235
|
}
|
|
@@ -230,6 +238,27 @@ function rmrf(p) {
|
|
|
230
238
|
try { fs.rmSync(p, { recursive: true, force: true }); } catch (e) { /* best effort */ }
|
|
231
239
|
}
|
|
232
240
|
|
|
241
|
+
// Drop sibling bundles for OTHER versions of this same platform target, keeping
|
|
242
|
+
// only keepDir. The self-heal cache otherwise accumulates a full ~50 MB bundle
|
|
243
|
+
// per version forever (issue #1074). Best-effort: a locked/busy dir (a
|
|
244
|
+
// concurrent run still mapping an older node.exe on Windows) just stays — rmrf
|
|
245
|
+
// already swallows its own errors, and the readdir is guarded — so cleanup can
|
|
246
|
+
// never break a working command. Only this target's "<target>-<version>" dirs
|
|
247
|
+
// are touched; other platforms' bundles and the ".dl-*" staging dirs are left
|
|
248
|
+
// alone.
|
|
249
|
+
function pruneOldBundles(bundlesDir, keepDir) {
|
|
250
|
+
var keep = path.basename(keepDir);
|
|
251
|
+
try {
|
|
252
|
+
var names = fs.readdirSync(bundlesDir);
|
|
253
|
+
for (var i = 0; i < names.length; i++) {
|
|
254
|
+
var name = names[i];
|
|
255
|
+
if (name === keep) continue;
|
|
256
|
+
if (name.indexOf(target + '-') !== 0) continue;
|
|
257
|
+
rmrf(path.join(bundlesDir, name));
|
|
258
|
+
}
|
|
259
|
+
} catch (e) { /* best effort — never break a working run over cleanup */ }
|
|
260
|
+
}
|
|
261
|
+
|
|
233
262
|
function fail(reason) {
|
|
234
263
|
process.stderr.write(
|
|
235
264
|
'codegraph: no prebuilt bundle for ' + target + '.\n' +
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@aroman22/codegraph-vba",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.6.1",
|
|
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.6.1",
|
|
19
|
+
"@aroman22/codegraph-vba-darwin-x64": "1.6.1",
|
|
20
|
+
"@aroman22/codegraph-vba-linux-arm64": "1.6.1",
|
|
21
|
+
"@aroman22/codegraph-vba-linux-x64": "1.6.1",
|
|
22
|
+
"@aroman22/codegraph-vba-win32-arm64": "1.6.1",
|
|
23
|
+
"@aroman22/codegraph-vba-win32-x64": "1.6.1"
|
|
24
24
|
},
|
|
25
25
|
"files": [
|
|
26
26
|
"npm-shim.js",
|
|
@@ -1,45 +0,0 @@
|
|
|
1
|
-
/** Managed tier ("CodeGraph AI") — the metered gateway used when logged in. */
|
|
2
|
-
export declare const MANAGED_DEFAULT_URL = "https://ai.getcodegraph.com/v1";
|
|
3
|
-
/** The gateway's public model id (it translates this to the upstream provider id). */
|
|
4
|
-
export declare const MANAGED_DEFAULT_MODEL = "openai/gpt-oss-120b";
|
|
5
|
-
export interface OffloadConfig {
|
|
6
|
-
/** Managed tier: route through CodeGraph AI (metered) with the logged-in org token. */
|
|
7
|
-
managed?: boolean;
|
|
8
|
-
/** OpenAI-compatible base URL ending in `/v1` (e.g. https://api.cerebras.ai/v1). */
|
|
9
|
-
url?: string;
|
|
10
|
-
/** Model id to request (default `gpt-oss-120b` BYO, `openai/gpt-oss-120b` managed). */
|
|
11
|
-
model?: string;
|
|
12
|
-
/** Name of the env var holding the provider API key (never persisted). BYO only. */
|
|
13
|
-
keyEnv?: string;
|
|
14
|
-
/** reasoning_effort: low | medium | high (default `low`). */
|
|
15
|
-
effort?: string;
|
|
16
|
-
/** Output style: plain | report (default `plain`). */
|
|
17
|
-
style?: string;
|
|
18
|
-
}
|
|
19
|
-
export interface ResolvedOffload {
|
|
20
|
-
/** True when the offload is usable (endpoint present; for managed, a token too). */
|
|
21
|
-
enabled: boolean;
|
|
22
|
-
/** Managed tier (CodeGraph AI, metered) vs BYO endpoint. */
|
|
23
|
-
managed: boolean;
|
|
24
|
-
url?: string;
|
|
25
|
-
model: string;
|
|
26
|
-
/** Resolved API key / org token (from env, the configured `keyEnv`, or login), if any. */
|
|
27
|
-
apiKey?: string;
|
|
28
|
-
/** Where the key/token came from (for `status` display) — never the secret itself. */
|
|
29
|
-
keySource?: string;
|
|
30
|
-
effort: string;
|
|
31
|
-
style: string;
|
|
32
|
-
timeoutMs: number;
|
|
33
|
-
maxTokens: number;
|
|
34
|
-
strip: boolean;
|
|
35
|
-
debug: boolean;
|
|
36
|
-
/** Where the endpoint came from — drives `codegraph offload status`. */
|
|
37
|
-
origin: 'env' | 'config' | 'none';
|
|
38
|
-
}
|
|
39
|
-
/** The persisted offload block (empty object if none). */
|
|
40
|
-
export declare function readOffloadConfig(): OffloadConfig;
|
|
41
|
-
/** Persist (or, with `null`, clear) the offload block, leaving other config keys intact. */
|
|
42
|
-
export declare function writeOffloadConfig(offload: OffloadConfig | null): void;
|
|
43
|
-
/** Merge the persisted config with `CODEGRAPH_OFFLOAD_*` env overrides (env wins). */
|
|
44
|
-
export declare function resolveOffload(env?: NodeJS.ProcessEnv): ResolvedOffload;
|
|
45
|
-
//# sourceMappingURL=config.d.ts.map
|
|
@@ -1,5 +0,0 @@
|
|
|
1
|
-
/** The stored managed-offload org token, if the machine is logged in. */
|
|
2
|
-
export declare function readOffloadToken(): string | undefined;
|
|
3
|
-
/** Persist (or, with `null`, clear) the managed-offload org token at `0600`. */
|
|
4
|
-
export declare function writeOffloadToken(token: string | null): void;
|
|
5
|
-
//# sourceMappingURL=credentials.d.ts.map
|
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
/** Dashboard base for the device-login endpoints; override for testing via CODEGRAPH_LOGIN_URL. */
|
|
2
|
-
export declare function loginBaseUrl(): string;
|
|
3
|
-
/** The dashboard's response to a device-authorization start request. */
|
|
4
|
-
export interface DeviceStart {
|
|
5
|
-
device_code: string;
|
|
6
|
-
user_code: string;
|
|
7
|
-
verification_uri: string;
|
|
8
|
-
/** Same URL with the code prefilled, for one-click open. */
|
|
9
|
-
verification_uri_complete?: string;
|
|
10
|
-
/** Seconds the CLI should wait between polls. */
|
|
11
|
-
interval?: number;
|
|
12
|
-
/** Seconds until the request expires. */
|
|
13
|
-
expires_in?: number;
|
|
14
|
-
}
|
|
15
|
-
/** Begin a device-authorization request. */
|
|
16
|
-
export declare function startDeviceLogin(): Promise<DeviceStart>;
|
|
17
|
-
/** Poll until the user approves in the browser; resolves with the org token. */
|
|
18
|
-
export declare function pollForToken(deviceCode: string, intervalSec: number, expiresInSec: number): Promise<string>;
|
|
19
|
-
/** Best-effort: open a URL in the default browser. Never throws — the URL is also printed. */
|
|
20
|
-
export declare function openBrowser(url: string): Promise<void>;
|
|
21
|
-
//# sourceMappingURL=login.d.ts.map
|
|
@@ -1,43 +0,0 @@
|
|
|
1
|
-
interface SynthArgs {
|
|
2
|
-
query: string;
|
|
3
|
-
context: string;
|
|
4
|
-
}
|
|
5
|
-
/** True when a reasoning offload endpoint is configured (env or `~/.codegraph/config.json`). */
|
|
6
|
-
export declare function isOffloadEnabled(): boolean;
|
|
7
|
-
export interface OffloadUsage {
|
|
8
|
-
plan?: string;
|
|
9
|
-
allowance?: number;
|
|
10
|
-
used?: number;
|
|
11
|
-
overage?: number;
|
|
12
|
-
remaining?: number;
|
|
13
|
-
periodEnd?: number;
|
|
14
|
-
unlimited?: boolean;
|
|
15
|
-
banned?: boolean;
|
|
16
|
-
tokensLast30?: number;
|
|
17
|
-
callsLast30?: number;
|
|
18
|
-
creditsLast30?: number;
|
|
19
|
-
models?: string[];
|
|
20
|
-
}
|
|
21
|
-
/**
|
|
22
|
-
* GET `/v1/usage` from the configured (managed) endpoint → the org's credit
|
|
23
|
-
* balance/usage, or null on any failure. Drives `codegraph offload status`.
|
|
24
|
-
*/
|
|
25
|
-
export declare function fetchUsage(): Promise<OffloadUsage | null>;
|
|
26
|
-
/**
|
|
27
|
-
* Strip sections of the explore output addressed to the AGENT (not useful to a
|
|
28
|
-
* reasoning model): the "Not shown above" pointer list, the completeness signal,
|
|
29
|
-
* the explore-budget note, the trimmed/truncation notices, and the redundant
|
|
30
|
-
* "## Exploration:/Found N symbols" header (the query is sent separately). Left
|
|
31
|
-
* in, some models regurgitate them ("We have 2 explore calls. Let's explore…")
|
|
32
|
-
* and they add noise. Source code, blast radius, relationships, and flow stay.
|
|
33
|
-
* Opt-in (`CODEGRAPH_OFFLOAD_STRIP=1`) — default off (it also removes the "Not
|
|
34
|
-
* shown above" pointers, which can be useful navigation).
|
|
35
|
-
*/
|
|
36
|
-
export declare function stripAgentDirectives(context: string): string;
|
|
37
|
-
/**
|
|
38
|
-
* Offload reasoning over the retrieved `context` to the configured model and
|
|
39
|
-
* return its synthesized answer, or null to signal "fall back to local source".
|
|
40
|
-
*/
|
|
41
|
-
export declare function synthesizeOffload({ query, context }: SynthArgs): Promise<string | null>;
|
|
42
|
-
export {};
|
|
43
|
-
//# sourceMappingURL=reasoner.d.ts.map
|