@aroman22/codegraph-vba 1.3.3

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.
Files changed (153) hide show
  1. package/README.md +855 -0
  2. package/dist/bin/codegraph.d.ts +26 -0
  3. package/dist/bin/command-supervision.d.ts +12 -0
  4. package/dist/bin/fatal-handler.d.ts +20 -0
  5. package/dist/bin/node-version-check.d.ts +37 -0
  6. package/dist/bin/uninstall.d.ts +14 -0
  7. package/dist/context/formatter.d.ts +30 -0
  8. package/dist/context/index.d.ts +119 -0
  9. package/dist/context/markers.d.ts +19 -0
  10. package/dist/db/index.d.ts +122 -0
  11. package/dist/db/migrations.d.ts +44 -0
  12. package/dist/db/queries.d.ts +402 -0
  13. package/dist/db/sqlite-adapter.d.ts +53 -0
  14. package/dist/directory.d.ts +179 -0
  15. package/dist/errors.d.ts +136 -0
  16. package/dist/extraction/astro-extractor.d.ts +79 -0
  17. package/dist/extraction/dfm-extractor.d.ts +31 -0
  18. package/dist/extraction/extraction-version.d.ts +25 -0
  19. package/dist/extraction/function-ref.d.ts +118 -0
  20. package/dist/extraction/generated-detection.d.ts +30 -0
  21. package/dist/extraction/grammars.d.ts +128 -0
  22. package/dist/extraction/index.d.ts +187 -0
  23. package/dist/extraction/languages/c-cpp.d.ts +12 -0
  24. package/dist/extraction/languages/csharp.d.ts +25 -0
  25. package/dist/extraction/languages/dart.d.ts +3 -0
  26. package/dist/extraction/languages/go.d.ts +3 -0
  27. package/dist/extraction/languages/index.d.ts +10 -0
  28. package/dist/extraction/languages/java.d.ts +3 -0
  29. package/dist/extraction/languages/javascript.d.ts +3 -0
  30. package/dist/extraction/languages/kotlin.d.ts +3 -0
  31. package/dist/extraction/languages/lua.d.ts +3 -0
  32. package/dist/extraction/languages/luau.d.ts +3 -0
  33. package/dist/extraction/languages/objc.d.ts +3 -0
  34. package/dist/extraction/languages/pascal.d.ts +3 -0
  35. package/dist/extraction/languages/php.d.ts +3 -0
  36. package/dist/extraction/languages/python.d.ts +3 -0
  37. package/dist/extraction/languages/r.d.ts +3 -0
  38. package/dist/extraction/languages/ruby.d.ts +3 -0
  39. package/dist/extraction/languages/rust.d.ts +3 -0
  40. package/dist/extraction/languages/scala.d.ts +3 -0
  41. package/dist/extraction/languages/swift.d.ts +3 -0
  42. package/dist/extraction/languages/typescript.d.ts +16 -0
  43. package/dist/extraction/liquid-extractor.d.ts +59 -0
  44. package/dist/extraction/mybatis-extractor.d.ts +48 -0
  45. package/dist/extraction/parse-pool.d.ts +126 -0
  46. package/dist/extraction/parse-worker.d.ts +8 -0
  47. package/dist/extraction/razor-extractor.d.ts +42 -0
  48. package/dist/extraction/sql-query-extractor.d.ts +25 -0
  49. package/dist/extraction/svelte-extractor.d.ts +56 -0
  50. package/dist/extraction/tree-sitter-helpers.d.ts +28 -0
  51. package/dist/extraction/tree-sitter-types.d.ts +239 -0
  52. package/dist/extraction/tree-sitter.d.ts +647 -0
  53. package/dist/extraction/vba-extractor.d.ts +394 -0
  54. package/dist/extraction/vba-form-extractor.d.ts +89 -0
  55. package/dist/extraction/vba-preprocess.d.ts +81 -0
  56. package/dist/extraction/vue-extractor.d.ts +51 -0
  57. package/dist/extraction/wasm-runtime-flags.d.ts +38 -0
  58. package/dist/graph/index.d.ts +8 -0
  59. package/dist/graph/queries.d.ts +106 -0
  60. package/dist/graph/traversal.d.ts +127 -0
  61. package/dist/index.d.ts +563 -0
  62. package/dist/installer/config-writer.d.ts +28 -0
  63. package/dist/installer/index.d.ts +100 -0
  64. package/dist/installer/instructions-template.d.ts +41 -0
  65. package/dist/installer/targets/antigravity.d.ts +57 -0
  66. package/dist/installer/targets/claude.d.ts +62 -0
  67. package/dist/installer/targets/codex.d.ts +18 -0
  68. package/dist/installer/targets/cursor.d.ts +35 -0
  69. package/dist/installer/targets/gemini.d.ts +26 -0
  70. package/dist/installer/targets/hermes.d.ts +18 -0
  71. package/dist/installer/targets/kiro.d.ts +27 -0
  72. package/dist/installer/targets/opencode.d.ts +38 -0
  73. package/dist/installer/targets/registry.d.ts +35 -0
  74. package/dist/installer/targets/shared.d.ts +101 -0
  75. package/dist/installer/targets/toml.d.ts +52 -0
  76. package/dist/installer/targets/types.d.ts +108 -0
  77. package/dist/mcp/daemon-manager.d.ts +42 -0
  78. package/dist/mcp/daemon-paths.d.ts +73 -0
  79. package/dist/mcp/daemon-registry.d.ts +47 -0
  80. package/dist/mcp/daemon.d.ts +258 -0
  81. package/dist/mcp/dynamic-boundaries.d.ts +41 -0
  82. package/dist/mcp/engine.d.ts +122 -0
  83. package/dist/mcp/index.d.ts +113 -0
  84. package/dist/mcp/liveness-watchdog.d.ts +18 -0
  85. package/dist/mcp/ppid-watchdog.d.ts +62 -0
  86. package/dist/mcp/proxy.d.ts +87 -0
  87. package/dist/mcp/query-pool.d.ts +94 -0
  88. package/dist/mcp/query-worker.d.ts +24 -0
  89. package/dist/mcp/server-instructions.d.ts +34 -0
  90. package/dist/mcp/session.d.ts +79 -0
  91. package/dist/mcp/stdin-teardown.d.ts +27 -0
  92. package/dist/mcp/tools.d.ts +591 -0
  93. package/dist/mcp/transport.d.ts +188 -0
  94. package/dist/mcp/version.d.ts +19 -0
  95. package/dist/project-config.d.ts +56 -0
  96. package/dist/reasoning/config.d.ts +45 -0
  97. package/dist/reasoning/credentials.d.ts +5 -0
  98. package/dist/reasoning/login.d.ts +21 -0
  99. package/dist/reasoning/reasoner.d.ts +43 -0
  100. package/dist/resolution/c-fnptr-synthesizer.d.ts +5 -0
  101. package/dist/resolution/callback-synthesizer.d.ts +15 -0
  102. package/dist/resolution/frameworks/astro.d.ts +9 -0
  103. package/dist/resolution/frameworks/cargo-workspace.d.ts +18 -0
  104. package/dist/resolution/frameworks/csharp.d.ts +8 -0
  105. package/dist/resolution/frameworks/drupal.d.ts +51 -0
  106. package/dist/resolution/frameworks/expo-modules.d.ts +3 -0
  107. package/dist/resolution/frameworks/express.d.ts +8 -0
  108. package/dist/resolution/frameworks/fabric.d.ts +3 -0
  109. package/dist/resolution/frameworks/go.d.ts +8 -0
  110. package/dist/resolution/frameworks/goframe.d.ts +41 -0
  111. package/dist/resolution/frameworks/index.d.ts +50 -0
  112. package/dist/resolution/frameworks/java.d.ts +8 -0
  113. package/dist/resolution/frameworks/laravel.d.ts +13 -0
  114. package/dist/resolution/frameworks/nestjs.d.ts +26 -0
  115. package/dist/resolution/frameworks/play.d.ts +19 -0
  116. package/dist/resolution/frameworks/python.d.ts +10 -0
  117. package/dist/resolution/frameworks/react-native.d.ts +3 -0
  118. package/dist/resolution/frameworks/react.d.ts +8 -0
  119. package/dist/resolution/frameworks/ruby.d.ts +8 -0
  120. package/dist/resolution/frameworks/rust.d.ts +8 -0
  121. package/dist/resolution/frameworks/svelte.d.ts +9 -0
  122. package/dist/resolution/frameworks/swift-objc.d.ts +37 -0
  123. package/dist/resolution/frameworks/swift.d.ts +10 -0
  124. package/dist/resolution/frameworks/vue.d.ts +9 -0
  125. package/dist/resolution/go-module.d.ts +26 -0
  126. package/dist/resolution/goframe-synthesizer.d.ts +28 -0
  127. package/dist/resolution/import-resolver.d.ts +78 -0
  128. package/dist/resolution/index.d.ts +196 -0
  129. package/dist/resolution/lru-cache.d.ts +24 -0
  130. package/dist/resolution/name-matcher.d.ts +93 -0
  131. package/dist/resolution/path-aliases.d.ts +68 -0
  132. package/dist/resolution/strip-comments.d.ts +27 -0
  133. package/dist/resolution/swift-objc-bridge.d.ts +134 -0
  134. package/dist/resolution/types.d.ts +233 -0
  135. package/dist/resolution/workspace-packages.d.ts +48 -0
  136. package/dist/search/query-parser.d.ts +57 -0
  137. package/dist/search/query-utils.d.ts +87 -0
  138. package/dist/sync/git-hooks.d.ts +45 -0
  139. package/dist/sync/index.d.ts +19 -0
  140. package/dist/sync/watch-policy.d.ts +48 -0
  141. package/dist/sync/watcher.d.ts +358 -0
  142. package/dist/sync/worktree.d.ts +54 -0
  143. package/dist/telemetry/index.d.ts +143 -0
  144. package/dist/types.d.ts +409 -0
  145. package/dist/ui/glyphs.d.ts +42 -0
  146. package/dist/ui/shimmer-progress.d.ts +11 -0
  147. package/dist/ui/shimmer-worker.d.ts +2 -0
  148. package/dist/ui/types.d.ts +17 -0
  149. package/dist/upgrade/index.d.ts +132 -0
  150. package/dist/utils.d.ts +224 -0
  151. package/npm-sdk.js +75 -0
  152. package/npm-shim.js +246 -0
  153. package/package.json +32 -0
@@ -0,0 +1,188 @@
1
+ /**
2
+ * MCP JSON-RPC Transports
3
+ *
4
+ * Two flavors share the same wire format (newline-delimited JSON-RPC 2.0):
5
+ *
6
+ * - `StdioTransport` — original transport; reads/writes the process's
7
+ * stdin/stdout. Used by direct-mode MCP servers.
8
+ * - `SocketTransport` — wraps a single `net.Socket`. Used by the shared-daemon
9
+ * architecture (see {@link ./daemon}) to multiplex multiple MCP clients onto
10
+ * one CodeGraph instance via per-connection sessions.
11
+ *
12
+ * Both implement {@link JsonRpcTransport} so the session-level protocol logic
13
+ * (initialize / tools/list / tools/call, plus server-initiated `roots/list`)
14
+ * is identical regardless of where the bytes come from.
15
+ */
16
+ import type { Socket } from 'net';
17
+ /**
18
+ * JSON-RPC 2.0 Request
19
+ */
20
+ export interface JsonRpcRequest {
21
+ jsonrpc: '2.0';
22
+ id: string | number;
23
+ method: string;
24
+ params?: unknown;
25
+ }
26
+ /**
27
+ * JSON-RPC 2.0 Response
28
+ */
29
+ export interface JsonRpcResponse {
30
+ jsonrpc: '2.0';
31
+ id: string | number | null;
32
+ result?: unknown;
33
+ error?: JsonRpcError;
34
+ }
35
+ /**
36
+ * JSON-RPC 2.0 Error
37
+ */
38
+ export interface JsonRpcError {
39
+ code: number;
40
+ message: string;
41
+ data?: unknown;
42
+ }
43
+ /**
44
+ * JSON-RPC 2.0 Notification (no id, no response expected)
45
+ */
46
+ export interface JsonRpcNotification {
47
+ jsonrpc: '2.0';
48
+ method: string;
49
+ params?: unknown;
50
+ }
51
+ export declare const ErrorCodes: {
52
+ readonly ParseError: -32700;
53
+ readonly InvalidRequest: -32600;
54
+ readonly MethodNotFound: -32601;
55
+ readonly InvalidParams: -32602;
56
+ readonly InternalError: -32603;
57
+ };
58
+ export type MessageHandler = (message: JsonRpcRequest | JsonRpcNotification) => Promise<void>;
59
+ /**
60
+ * Generic JSON-RPC transport interface — common surface for stdio and socket
61
+ * carriers. Anything below the session layer (initialize, tool dispatch, etc.)
62
+ * talks to this, not to a concrete transport class.
63
+ */
64
+ export interface JsonRpcTransport {
65
+ start(handler: MessageHandler): void;
66
+ stop(): void;
67
+ send(response: JsonRpcResponse): void;
68
+ notify(method: string, params?: unknown): void;
69
+ request(method: string, params?: unknown, timeoutMs?: number): Promise<unknown>;
70
+ sendResult(id: string | number, result: unknown): void;
71
+ sendError(id: string | number | null, code: number, message: string, data?: unknown): void;
72
+ }
73
+ /**
74
+ * Shared implementation of newline-delimited JSON-RPC 2.0 over any
75
+ * `Readable`/`Writable` stream pair. Stdio and socket transports both wrap
76
+ * this — the only difference between them is which streams get plugged in
77
+ * and how a "close" propagates back to the owning code.
78
+ */
79
+ declare abstract class LineBasedJsonRpcTransport implements JsonRpcTransport {
80
+ protected messageHandler: MessageHandler | null;
81
+ protected pending: Map<string | number, {
82
+ resolve: (value: unknown) => void;
83
+ reject: (error: Error) => void;
84
+ }>;
85
+ protected nextRequestId: number;
86
+ protected stopped: boolean;
87
+ abstract start(handler: MessageHandler): void;
88
+ protected abstract write(line: string): void;
89
+ protected abstract idPrefix(): string;
90
+ abstract stop(): void;
91
+ /**
92
+ * Send a server-initiated request to the client and await its response.
93
+ *
94
+ * MCP is bidirectional: the server can ask the client questions too. We use
95
+ * this for `roots/list` — the spec-blessed way to learn the workspace root
96
+ * when the client didn't pass one in `initialize` (see issue #196). Rejects
97
+ * on timeout so callers can fall back rather than hang forever.
98
+ */
99
+ request(method: string, params?: unknown, timeoutMs?: number): Promise<unknown>;
100
+ send(response: JsonRpcResponse): void;
101
+ notify(method: string, params?: unknown): void;
102
+ sendResult(id: string | number, result: unknown): void;
103
+ sendError(id: string | number | null, code: number, message: string, data?: unknown): void;
104
+ /**
105
+ * Fail any in-flight server-initiated requests so their awaiters don't hang.
106
+ * Called from `stop()` in subclasses.
107
+ */
108
+ protected rejectPending(reason: string): void;
109
+ /**
110
+ * Handle an incoming line of JSON. Both transports feed lines here.
111
+ */
112
+ protected handleLine(line: string): Promise<void>;
113
+ /**
114
+ * Resolve (or reject) the pending server-initiated request matching this
115
+ * response's id. Unknown ids are ignored — the client may echo something we
116
+ * never sent, or a request may have already timed out.
117
+ */
118
+ private handleResponse;
119
+ /**
120
+ * Check if message is a valid JSON-RPC 2.0 message
121
+ */
122
+ private isValidMessage;
123
+ }
124
+ export interface StdioTransportOptions {
125
+ /**
126
+ * If true, the transport calls `process.exit(0)` when stdin closes. Set to
127
+ * `false` in shared-daemon mode where the stdio "session" is just *one* of
128
+ * many clients — losing it shouldn't drag the daemon down. The default
129
+ * (true) matches the original single-process behavior callers rely on.
130
+ */
131
+ exitOnClose?: boolean;
132
+ /**
133
+ * Optional callback fired when the stdin stream closes. The daemon uses
134
+ * this to decrement its connected-clients refcount.
135
+ */
136
+ onClose?: () => void;
137
+ }
138
+ /**
139
+ * Stdio Transport for MCP
140
+ *
141
+ * Reads JSON-RPC messages from stdin and writes responses to stdout. Used by
142
+ * the direct (single-process) MCP server path, where the MCP host launches
143
+ * one server per session and talks to it over the child's stdio. Also used by
144
+ * shared-daemon mode for the launcher's session (with `exitOnClose: false`)
145
+ * so the daemon outlives its launcher.
146
+ */
147
+ export declare class StdioTransport extends LineBasedJsonRpcTransport {
148
+ private rl;
149
+ private opts;
150
+ constructor(opts?: StdioTransportOptions);
151
+ start(handler: MessageHandler): void;
152
+ stop(): void;
153
+ protected write(line: string): void;
154
+ protected idPrefix(): string;
155
+ }
156
+ /**
157
+ * Socket Transport for MCP daemon sessions.
158
+ *
159
+ * Wraps a single `net.Socket` (Unix domain socket on POSIX, named pipe on
160
+ * Windows). One instance per connected MCP client. Unlike {@link StdioTransport},
161
+ * `stop()` and stream-close *don't* call `process.exit` — a daemon-side session
162
+ * ending must not bring down the whole daemon.
163
+ */
164
+ export declare class SocketTransport extends LineBasedJsonRpcTransport {
165
+ private socket;
166
+ private prefix;
167
+ private buffer;
168
+ private closeHandlers;
169
+ constructor(socket: Socket, prefix?: string);
170
+ /**
171
+ * Register a callback fired exactly once when the socket closes (from either
172
+ * side). Used by the daemon to decrement its connected-clients refcount.
173
+ */
174
+ onClose(handler: () => void): void;
175
+ start(handler: MessageHandler): void;
176
+ stop(): void;
177
+ /**
178
+ * Write a one-shot line directly to the socket (no JSON-RPC framing applied
179
+ * by this class — caller produces the line). The daemon uses this for the
180
+ * hello/handshake line that precedes the JSON-RPC stream.
181
+ */
182
+ writeRaw(line: string): void;
183
+ protected write(line: string): void;
184
+ protected idPrefix(): string;
185
+ private handleSocketClose;
186
+ }
187
+ export {};
188
+ //# sourceMappingURL=transport.d.ts.map
@@ -0,0 +1,19 @@
1
+ /**
2
+ * Resolved package version, computed once at module load.
3
+ *
4
+ * The version string is the rendezvous datum between cooperating daemon and
5
+ * proxy processes: the daemon advertises its version in the hello line, and
6
+ * the proxy refuses to share IPC across a mismatch (falls back to direct
7
+ * mode). Keeping the resolution in one place avoids drift between the CLI
8
+ * `--version` output (which reads `package.json` directly) and the daemon
9
+ * handshake.
10
+ *
11
+ * Resolution strategy: read the bundled `package.json` two levels up from
12
+ * this file — same relative position whether we're loaded from `src/mcp/` or
13
+ * the `dist/mcp/` output, since `tsc` preserves the layout. If reading fails
14
+ * (e.g. the package was unpacked oddly), fall back to "0.0.0-unknown" — a
15
+ * sentinel that will never match a real version, so the proxy harmlessly
16
+ * falls back to direct mode.
17
+ */
18
+ export declare const CodeGraphPackageVersion: string;
19
+ //# sourceMappingURL=version.d.ts.map
@@ -0,0 +1,56 @@
1
+ import { Language } from './types';
2
+ /** Filename of the project-scoped config, resolved relative to the project root. */
3
+ export declare const PROJECT_CONFIG_FILENAME = "codegraph.json";
4
+ export interface ProjectConfig {
5
+ /** Map of custom file extension (`.foo`) to a supported language id. */
6
+ extensions?: Record<string, string>;
7
+ /**
8
+ * Gitignore-style patterns naming gitignored directories whose embedded git
9
+ * repositories should be indexed anyway — the explicit opt-in to override
10
+ * `.gitignore` for nested-repo discovery (#622, #699). Absent/empty (the
11
+ * default) means `.gitignore` is fully respected: gitignored embedded repos
12
+ * are never discovered or indexed (#970, #976).
13
+ */
14
+ includeIgnored?: string[];
15
+ /**
16
+ * Gitignore-style patterns for paths to keep OUT of the index — even when
17
+ * they are git-TRACKED, which `.gitignore` cannot do (#999). The escape hatch
18
+ * for a committed vendor/theme/SDK directory (e.g. a checked-in Metronic theme
19
+ * under `static/`) that bloats the graph and slows indexing but isn't really
20
+ * your code. Matched against project-root-relative paths, so a directory like
21
+ * `"static/"`, a double-star vendor glob, or `"assets/theme"` all work.
22
+ * Absent/empty (the default) excludes nothing beyond the built-in defaults
23
+ * and your `.gitignore`.
24
+ */
25
+ exclude?: string[];
26
+ }
27
+ /**
28
+ * Load the validated extension overrides for a project, mtime-cached.
29
+ *
30
+ * Returns a map of `.ext` → supported language id. The result merges on top of
31
+ * the built-in extension map at the point of use (see `detectLanguage` /
32
+ * `isSourceFile`), with these user mappings taking precedence. Returns an empty
33
+ * map when there is no `codegraph.json` (the zero-config default).
34
+ */
35
+ export declare function loadExtensionOverrides(rootDir: string): Record<string, Language>;
36
+ /**
37
+ * Load the validated `includeIgnored` patterns for a project, mtime-cached.
38
+ *
39
+ * These name gitignored directories whose embedded git repositories should be
40
+ * indexed despite `.gitignore` (#622, #699). An empty result — the zero-config
41
+ * default — means `.gitignore` is fully respected: gitignored embedded repos
42
+ * are never discovered or indexed (#970, #976).
43
+ */
44
+ export declare function loadIncludeIgnoredPatterns(rootDir: string): string[];
45
+ /**
46
+ * Load the validated `exclude` patterns for a project, mtime-cached.
47
+ *
48
+ * These name paths to keep OUT of the index even when git-tracked — the escape
49
+ * hatch for a committed vendor/theme/SDK directory `.gitignore` can't drop
50
+ * (#999). An empty result — the zero-config default — excludes nothing beyond
51
+ * the built-in defaults and the project's `.gitignore`.
52
+ */
53
+ export declare function loadExcludePatterns(rootDir: string): string[];
54
+ /** Test/maintenance hook: forget cached config (e.g. after rewriting it in a test). */
55
+ export declare function clearProjectConfigCache(): void;
56
+ //# sourceMappingURL=project-config.d.ts.map
@@ -0,0 +1,45 @@
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
@@ -0,0 +1,5 @@
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
@@ -0,0 +1,21 @@
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
@@ -0,0 +1,43 @@
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
@@ -0,0 +1,5 @@
1
+ import type { Edge } from '../types';
2
+ import type { QueryBuilder } from '../db/queries';
3
+ import type { ResolutionContext } from './types';
4
+ export declare function cFnPointerDispatchEdges(queries: QueryBuilder, ctx: ResolutionContext): Edge[];
5
+ //# sourceMappingURL=c-fnptr-synthesizer.d.ts.map
@@ -0,0 +1,15 @@
1
+ import type { QueryBuilder } from '../db/queries';
2
+ import type { ResolutionContext } from './types';
3
+ /**
4
+ * Synthesize dispatcher→callback edges (field observers + EventEmitters +
5
+ * React re-render + JSX children + Vue templates + SvelteKit load + RN event
6
+ * channel + Fabric native-impl + MyBatis Java↔XML + Gin middleware chain +
7
+ * Redux-thunk dispatch chain + object-literal registry dispatch + RTK Query
8
+ * generated-hook → endpoint + Pinia useStore().action() + Vuex string dispatch +
9
+ * Celery task .delay()/.apply_async() → task body + Spring publishEvent → @EventListener +
10
+ * MediatR Send/Publish → IRequestHandler/INotificationHandler +
11
+ * Sidekiq Worker.perform_async → #perform + Laravel event(new X) → listener handle).
12
+ * Returns the count added. Never throws into indexing — callers wrap in try/catch.
13
+ */
14
+ export declare function synthesizeCallbackEdges(queries: QueryBuilder, ctx: ResolutionContext): number;
15
+ //# sourceMappingURL=callback-synthesizer.d.ts.map
@@ -0,0 +1,9 @@
1
+ /**
2
+ * Astro Framework Resolver
3
+ *
4
+ * Handles Astro component references, the `Astro` global, `astro:*` virtual
5
+ * module imports, and Astro's `src/pages/` file-based routing.
6
+ */
7
+ import { FrameworkResolver } from '../types';
8
+ export declare const astroResolver: FrameworkResolver;
9
+ //# sourceMappingURL=astro.d.ts.map
@@ -0,0 +1,18 @@
1
+ /**
2
+ * Cargo Workspace Resolver Helper
3
+ *
4
+ * Parses a project's root Cargo.toml and member crate manifests to
5
+ * build a crate-name -> member-directory map. Used by the Rust
6
+ * resolver to resolve `use crate_name::...` references that point
7
+ * into workspace member crates.
8
+ */
9
+ import { ResolutionContext } from '../types';
10
+ /**
11
+ * Build a map from crate-name aliases to workspace member directory paths.
12
+ * Example: "mytool-core" and "mytool_core" -> "crates/mytool-core"
13
+ *
14
+ * Supports glob members (e.g. `members = ["crates/*"]`) via picomatch
15
+ * when the context exposes `listDirectories`.
16
+ */
17
+ export declare function getCargoWorkspaceCrateMap(context: ResolutionContext): Map<string, string>;
18
+ //# sourceMappingURL=cargo-workspace.d.ts.map
@@ -0,0 +1,8 @@
1
+ /**
2
+ * C# Framework Resolver
3
+ *
4
+ * Handles ASP.NET Core, ASP.NET MVC, and common C# patterns.
5
+ */
6
+ import { FrameworkResolver } from '../types';
7
+ export declare const aspnetResolver: FrameworkResolver;
8
+ //# sourceMappingURL=csharp.d.ts.map
@@ -0,0 +1,51 @@
1
+ /**
2
+ * Drupal Framework Resolver
3
+ *
4
+ * Supports Drupal 8/9/10/11 (Composer-based projects). Drupal 7 is not supported.
5
+ *
6
+ * ## What this resolver does
7
+ *
8
+ * 1. **Detection** — reads composer.json and checks for any `drupal/*` dependency in
9
+ * `require` or `require-dev`.
10
+ *
11
+ * 2. **Route extraction** — parses `*.routing.yml` files and emits `route` nodes for each
12
+ * Drupal route, with `references` edges to the `_controller`, `_form`, or entity handler
13
+ * class/method.
14
+ *
15
+ * 3. **Hook detection** — scans `.module`, `.install`, `.theme`, and `.inc` files for Drupal
16
+ * hook implementations. Two strategies are used:
17
+ * a. Docblock: `@Implements hook_X()` → precise, no false positives.
18
+ * b. Name pattern: function `{moduleName}_{hookSuffix}()` → catches hooks without
19
+ * docblocks but may produce false positives on helper functions.
20
+ * Detected hooks emit an `UnresolvedRef` from the implementing function node to the
21
+ * canonical `hook_X` name, linking implementations to the hook when `codegraph_callers`
22
+ * is invoked.
23
+ *
24
+ * ## Design decisions (review in future iterations)
25
+ *
26
+ * - Hook graph resolution (v1): hook references are stored as UnresolvedRef pointing to the
27
+ * canonical `hook_X` name. If Drupal core is indexed, these will resolve to core hook
28
+ * definitions. Without core, they remain unresolved but are still searchable via
29
+ * `codegraph_search("form_alter")`. Full hook-node creation (virtual nodes for every hook)
30
+ * is deferred to a future iteration.
31
+ *
32
+ * - Services / plugins (out of scope for v1): `*.services.yml` service definitions and plugin
33
+ * annotations (`@Block`, `@FormElement`, etc.) are not extracted. Add a TODO below when
34
+ * ready to implement.
35
+ *
36
+ * - Twig templates (out of scope for v1): `.twig` files are tracked as file nodes but no
37
+ * symbol extraction is performed (no tree-sitter Twig grammar). Implement when a Twig
38
+ * grammar WASM is available.
39
+ *
40
+ * ## TODOs for future iterations
41
+ *
42
+ * - TODO: Extract service definitions from `*.services.yml` files (class → service-id edges).
43
+ * - TODO: Extract plugin annotations (`@Block`, `@FormElement`, `@Field`, etc.) from PHP
44
+ * docblocks and emit plugin nodes with references to the annotated class.
45
+ * - TODO: Add Twig symbol extraction when a tree-sitter Twig grammar becomes available.
46
+ * - TODO: Improve hook resolution: create virtual `hook_*` nodes so `codegraph_callers`
47
+ * returns all implementations even when Drupal core is not indexed.
48
+ */
49
+ import { FrameworkResolver } from '../types';
50
+ export declare const drupalResolver: FrameworkResolver;
51
+ //# sourceMappingURL=drupal.d.ts.map
@@ -0,0 +1,3 @@
1
+ import { FrameworkResolver } from '../types';
2
+ export declare const expoModulesResolver: FrameworkResolver;
3
+ //# sourceMappingURL=expo-modules.d.ts.map
@@ -0,0 +1,8 @@
1
+ /**
2
+ * Express/Node.js Framework Resolver
3
+ *
4
+ * Handles Express and general Node.js patterns.
5
+ */
6
+ import { FrameworkResolver } from '../types';
7
+ export declare const expressResolver: FrameworkResolver;
8
+ //# sourceMappingURL=express.d.ts.map
@@ -0,0 +1,3 @@
1
+ import { FrameworkResolver } from '../types';
2
+ export declare const fabricViewResolver: FrameworkResolver;
3
+ //# sourceMappingURL=fabric.d.ts.map
@@ -0,0 +1,8 @@
1
+ /**
2
+ * Go Framework Resolver
3
+ *
4
+ * Handles Gin, Echo, Fiber, Chi, and standard library patterns.
5
+ */
6
+ import { FrameworkResolver } from '../types';
7
+ export declare const goResolver: FrameworkResolver;
8
+ //# sourceMappingURL=go.d.ts.map
@@ -0,0 +1,41 @@
1
+ /**
2
+ * GoFrame Framework Resolver (route metadata) — issue #747.
3
+ *
4
+ * GoFrame's "standard router" binds routes reflectively, so there is no literal
5
+ * path string at a `.GET("/x", handler)` call site and no static edge from a
6
+ * route to the controller method that serves it. The structural facts live in
7
+ * two places, joined only at runtime by GoFrame:
8
+ *
9
+ * // api/user/v1/user_sign_in.go — the route lives in a struct tag on the request type
10
+ * type SignInReq struct {
11
+ * g.Meta `path:"/user/sign-in" method:"post" tags:"UserService" summary:"…"`
12
+ * …
13
+ * }
14
+ * // internal/controller/user/user_v1_sign_in.go — the handler takes *that* request type
15
+ * func (c *ControllerV1) SignIn(ctx context.Context, req *v1.SignInReq) (res *v1.SignInRes, err error)
16
+ * // internal/cmd/cmd.go — reflective binding (no path, no handler name)
17
+ * group.Bind(user.NewV1())
18
+ *
19
+ * This resolver handles the FIRST half: it reads the `g.Meta` struct tag on a
20
+ * request type into a `route` node (`POST /user/sign-in`). The route → handler
21
+ * EDGE is the genuinely reflective part — the method name is NOT derivable from
22
+ * the request type (`DeptSearchReq` is served by `List`, `DeptAddReq` by `Add`),
23
+ * so the only reliable join is the request type appearing in the method's
24
+ * parameter signature. That whole-graph join is done by the companion
25
+ * `goframeRouteEdges` synthesizer, which reads the request type back out of the
26
+ * route node's qualifiedName.
27
+ *
28
+ * Honesty note: the route node carries the `g.Meta` path verbatim. The group
29
+ * prefix from `s.Group("/api", …)` / nested `group.Group("/v1", …)` is applied
30
+ * by reflective `Bind` at runtime and is deliberately NOT reconstructed here —
31
+ * the discriminating, structural part is the per-route path + method.
32
+ */
33
+ import { FrameworkResolver } from '../types';
34
+ /** Marker embedded in a route node's qualifiedName so the synthesizer can read
35
+ * back the request type to join on. The value after it is the package-qualified
36
+ * request type (`cash.ListReq`) — the package disambiguates the many identical
37
+ * bare names (`ListReq`, `GetReq`) a large app defines, one per module. Falls
38
+ * back to the bare type when no `package` declaration is found. */
39
+ export declare const GOFRAME_ROUTE_MARKER = "::goframe-route:";
40
+ export declare const goframeResolver: FrameworkResolver;
41
+ //# sourceMappingURL=goframe.d.ts.map
@@ -0,0 +1,50 @@
1
+ /**
2
+ * Framework Resolver Registry
3
+ *
4
+ * Manages framework-specific resolvers.
5
+ */
6
+ import { FrameworkResolver, ResolutionContext } from '../types';
7
+ import type { Language } from '../../types';
8
+ /**
9
+ * Get all framework resolvers
10
+ */
11
+ export declare function getAllFrameworkResolvers(): FrameworkResolver[];
12
+ /**
13
+ * Get a resolver by name
14
+ */
15
+ export declare function getFrameworkResolver(name: string): FrameworkResolver | undefined;
16
+ /**
17
+ * Detect which frameworks are used in a project
18
+ */
19
+ export declare function detectFrameworks(context: ResolutionContext): FrameworkResolver[];
20
+ /**
21
+ * Filter a list of detected frameworks down to ones that apply to a given language.
22
+ * Frameworks without an explicit `languages` list are treated as universal.
23
+ */
24
+ export declare function getApplicableFrameworks(detected: FrameworkResolver[], language: Language): FrameworkResolver[];
25
+ /**
26
+ * Register a custom framework resolver
27
+ */
28
+ export declare function registerFrameworkResolver(resolver: FrameworkResolver): void;
29
+ export { drupalResolver } from './drupal';
30
+ export { laravelResolver, FACADE_MAPPINGS } from './laravel';
31
+ export { expressResolver } from './express';
32
+ export { nestjsResolver } from './nestjs';
33
+ export { reactResolver } from './react';
34
+ export { svelteResolver } from './svelte';
35
+ export { vueResolver } from './vue';
36
+ export { astroResolver } from './astro';
37
+ export { djangoResolver, flaskResolver, fastapiResolver } from './python';
38
+ export { railsResolver } from './ruby';
39
+ export { springResolver } from './java';
40
+ export { playResolver } from './play';
41
+ export { goResolver } from './go';
42
+ export { goframeResolver } from './goframe';
43
+ export { rustResolver } from './rust';
44
+ export { aspnetResolver } from './csharp';
45
+ export { swiftUIResolver, uikitResolver, vaporResolver } from './swift';
46
+ export { swiftObjcBridgeResolver } from './swift-objc';
47
+ export { reactNativeBridgeResolver } from './react-native';
48
+ export { expoModulesResolver } from './expo-modules';
49
+ export { fabricViewResolver } from './fabric';
50
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1,8 @@
1
+ /**
2
+ * Java Framework Resolver
3
+ *
4
+ * Handles Spring Boot and general Java patterns.
5
+ */
6
+ import { FrameworkResolver } from '../types';
7
+ export declare const springResolver: FrameworkResolver;
8
+ //# sourceMappingURL=java.d.ts.map
@@ -0,0 +1,13 @@
1
+ /**
2
+ * Laravel Framework Resolver
3
+ *
4
+ * Handles Laravel-specific patterns for reference resolution.
5
+ */
6
+ import { FrameworkResolver } from '../types';
7
+ /**
8
+ * Laravel facade mappings to underlying classes
9
+ * Exported for potential use in facade resolution
10
+ */
11
+ export declare const FACADE_MAPPINGS: Record<string, string>;
12
+ export declare const laravelResolver: FrameworkResolver;
13
+ //# sourceMappingURL=laravel.d.ts.map