@colbymchenry/codegraph-win32-arm64 1.5.0 → 1.6.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/lib/dist/bin/codegraph.js +145 -29
- package/lib/dist/bin/codegraph.js.map +1 -1
- package/lib/dist/context/formatter.d.ts +7 -1
- package/lib/dist/context/formatter.d.ts.map +1 -1
- package/lib/dist/context/formatter.js +12 -6
- package/lib/dist/context/formatter.js.map +1 -1
- package/lib/dist/context/index.d.ts +12 -0
- package/lib/dist/context/index.d.ts.map +1 -1
- package/lib/dist/context/index.js +60 -14
- package/lib/dist/context/index.js.map +1 -1
- package/lib/dist/db/index.d.ts +37 -0
- package/lib/dist/db/index.d.ts.map +1 -1
- package/lib/dist/db/index.js +101 -1
- package/lib/dist/db/index.js.map +1 -1
- package/lib/dist/db/migrations.d.ts +1 -1
- package/lib/dist/db/migrations.d.ts.map +1 -1
- package/lib/dist/db/migrations.js +25 -1
- package/lib/dist/db/migrations.js.map +1 -1
- package/lib/dist/db/queries.d.ts +160 -3
- package/lib/dist/db/queries.d.ts.map +1 -1
- package/lib/dist/db/queries.js +400 -33
- package/lib/dist/db/queries.js.map +1 -1
- package/lib/dist/db/schema.sql +16 -3
- package/lib/dist/directory.d.ts +29 -0
- package/lib/dist/directory.d.ts.map +1 -1
- package/lib/dist/directory.js +52 -0
- package/lib/dist/directory.js.map +1 -1
- package/lib/dist/extraction/extraction-version.d.ts +1 -1
- package/lib/dist/extraction/extraction-version.js +1 -1
- package/lib/dist/extraction/function-ref.d.ts.map +1 -1
- package/lib/dist/extraction/function-ref.js +6 -0
- package/lib/dist/extraction/function-ref.js.map +1 -1
- package/lib/dist/extraction/generated-detection.d.ts +48 -12
- package/lib/dist/extraction/generated-detection.d.ts.map +1 -1
- package/lib/dist/extraction/generated-detection.js +176 -11
- package/lib/dist/extraction/generated-detection.js.map +1 -1
- package/lib/dist/extraction/grammars.d.ts.map +1 -1
- package/lib/dist/extraction/grammars.js +38 -2
- package/lib/dist/extraction/grammars.js.map +1 -1
- package/lib/dist/extraction/index.d.ts +106 -0
- package/lib/dist/extraction/index.d.ts.map +1 -1
- package/lib/dist/extraction/index.js +284 -53
- package/lib/dist/extraction/index.js.map +1 -1
- package/lib/dist/extraction/languages/c-cpp.d.ts.map +1 -1
- package/lib/dist/extraction/languages/c-cpp.js +19 -4
- package/lib/dist/extraction/languages/c-cpp.js.map +1 -1
- package/lib/dist/extraction/languages/erlang.d.ts.map +1 -1
- package/lib/dist/extraction/languages/erlang.js +58 -22
- package/lib/dist/extraction/languages/erlang.js.map +1 -1
- package/lib/dist/extraction/languages/objc.d.ts.map +1 -1
- package/lib/dist/extraction/languages/objc.js +4 -0
- package/lib/dist/extraction/languages/objc.js.map +1 -1
- package/lib/dist/extraction/languages/rust.d.ts +20 -0
- package/lib/dist/extraction/languages/rust.d.ts.map +1 -1
- package/lib/dist/extraction/languages/rust.js +47 -20
- package/lib/dist/extraction/languages/rust.js.map +1 -1
- package/lib/dist/extraction/parse-pool.d.ts +7 -0
- package/lib/dist/extraction/parse-pool.d.ts.map +1 -1
- package/lib/dist/extraction/parse-pool.js +20 -1
- package/lib/dist/extraction/parse-pool.js.map +1 -1
- package/lib/dist/extraction/tree-sitter-types.d.ts +2 -0
- package/lib/dist/extraction/tree-sitter-types.d.ts.map +1 -1
- package/lib/dist/extraction/tree-sitter.d.ts +5 -1
- package/lib/dist/extraction/tree-sitter.d.ts.map +1 -1
- package/lib/dist/extraction/tree-sitter.js +106 -50
- package/lib/dist/extraction/tree-sitter.js.map +1 -1
- package/lib/dist/graph/queries.d.ts.map +1 -1
- package/lib/dist/graph/queries.js +2 -0
- package/lib/dist/graph/queries.js.map +1 -1
- package/lib/dist/graph/traversal.js +1 -1
- package/lib/dist/graph/traversal.js.map +1 -1
- package/lib/dist/index.d.ts +22 -0
- package/lib/dist/index.d.ts.map +1 -1
- package/lib/dist/index.js +117 -1
- package/lib/dist/index.js.map +1 -1
- package/lib/dist/installer/index.d.ts +4 -3
- package/lib/dist/installer/index.d.ts.map +1 -1
- package/lib/dist/installer/index.js +8 -6
- package/lib/dist/installer/index.js.map +1 -1
- package/lib/dist/installer/targets/claude.d.ts.map +1 -1
- package/lib/dist/installer/targets/claude.js +37 -5
- package/lib/dist/installer/targets/claude.js.map +1 -1
- package/lib/dist/installer/targets/codex.d.ts +22 -8
- package/lib/dist/installer/targets/codex.d.ts.map +1 -1
- package/lib/dist/installer/targets/codex.js +65 -48
- package/lib/dist/installer/targets/codex.js.map +1 -1
- package/lib/dist/installer/targets/copilot-cli.d.ts +32 -0
- package/lib/dist/installer/targets/copilot-cli.d.ts.map +1 -0
- package/lib/dist/installer/targets/copilot-cli.js +209 -0
- package/lib/dist/installer/targets/copilot-cli.js.map +1 -0
- package/lib/dist/installer/targets/copilot-jetbrains.d.ts +42 -0
- package/lib/dist/installer/targets/copilot-jetbrains.d.ts.map +1 -0
- package/lib/dist/installer/targets/copilot-jetbrains.js +238 -0
- package/lib/dist/installer/targets/copilot-jetbrains.js.map +1 -0
- package/lib/dist/installer/targets/copilot-vscode.d.ts +47 -0
- package/lib/dist/installer/targets/copilot-vscode.d.ts.map +1 -0
- package/lib/dist/installer/targets/copilot-vscode.js +219 -0
- package/lib/dist/installer/targets/copilot-vscode.js.map +1 -0
- package/lib/dist/installer/targets/registry.d.ts.map +1 -1
- package/lib/dist/installer/targets/registry.js +6 -0
- package/lib/dist/installer/targets/registry.js.map +1 -1
- package/lib/dist/installer/targets/toml.d.ts +6 -5
- package/lib/dist/installer/targets/toml.d.ts.map +1 -1
- package/lib/dist/installer/targets/toml.js +99 -20
- package/lib/dist/installer/targets/toml.js.map +1 -1
- package/lib/dist/installer/targets/types.d.ts +5 -5
- package/lib/dist/installer/targets/types.d.ts.map +1 -1
- package/lib/dist/mcp/daemon-manager.d.ts +1 -1
- package/lib/dist/mcp/daemon-manager.d.ts.map +1 -1
- package/lib/dist/mcp/daemon-manager.js +1 -1
- package/lib/dist/mcp/daemon-manager.js.map +1 -1
- package/lib/dist/mcp/daemon-paths.d.ts +6 -0
- package/lib/dist/mcp/daemon-paths.d.ts.map +1 -1
- package/lib/dist/mcp/daemon-paths.js +54 -0
- package/lib/dist/mcp/daemon-paths.js.map +1 -1
- package/lib/dist/mcp/daemon-registry.d.ts +10 -0
- package/lib/dist/mcp/daemon-registry.d.ts.map +1 -1
- package/lib/dist/mcp/daemon-registry.js +51 -3
- package/lib/dist/mcp/daemon-registry.js.map +1 -1
- package/lib/dist/mcp/daemon.d.ts +9 -6
- package/lib/dist/mcp/daemon.d.ts.map +1 -1
- package/lib/dist/mcp/daemon.js +10 -8
- package/lib/dist/mcp/daemon.js.map +1 -1
- package/lib/dist/mcp/engine.d.ts +3 -0
- package/lib/dist/mcp/engine.d.ts.map +1 -1
- package/lib/dist/mcp/engine.js +45 -3
- package/lib/dist/mcp/engine.js.map +1 -1
- package/lib/dist/mcp/explore-dedup.d.ts +137 -0
- package/lib/dist/mcp/explore-dedup.d.ts.map +1 -0
- package/lib/dist/mcp/explore-dedup.js +236 -0
- package/lib/dist/mcp/explore-dedup.js.map +1 -0
- package/lib/dist/mcp/explore-diagnostics.d.ts +289 -0
- package/lib/dist/mcp/explore-diagnostics.d.ts.map +1 -0
- package/lib/dist/mcp/explore-diagnostics.js +558 -0
- package/lib/dist/mcp/explore-diagnostics.js.map +1 -0
- package/lib/dist/mcp/explore-session-state.d.ts +217 -0
- package/lib/dist/mcp/explore-session-state.d.ts.map +1 -0
- package/lib/dist/mcp/explore-session-state.js +322 -0
- package/lib/dist/mcp/explore-session-state.js.map +1 -0
- package/lib/dist/mcp/index.d.ts +24 -0
- package/lib/dist/mcp/index.d.ts.map +1 -1
- package/lib/dist/mcp/index.js +67 -6
- package/lib/dist/mcp/index.js.map +1 -1
- package/lib/dist/mcp/liveness-watchdog.d.ts.map +1 -1
- package/lib/dist/mcp/liveness-watchdog.js +3 -1
- package/lib/dist/mcp/liveness-watchdog.js.map +1 -1
- package/lib/dist/mcp/proxy.d.ts.map +1 -1
- package/lib/dist/mcp/proxy.js +6 -1
- package/lib/dist/mcp/proxy.js.map +1 -1
- package/lib/dist/mcp/server-instructions.d.ts +2 -2
- package/lib/dist/mcp/server-instructions.d.ts.map +1 -1
- package/lib/dist/mcp/server-instructions.js +8 -3
- package/lib/dist/mcp/server-instructions.js.map +1 -1
- package/lib/dist/mcp/session.d.ts +16 -0
- package/lib/dist/mcp/session.d.ts.map +1 -1
- package/lib/dist/mcp/session.js +36 -13
- package/lib/dist/mcp/session.js.map +1 -1
- package/lib/dist/mcp/tools.d.ts +276 -10
- package/lib/dist/mcp/tools.d.ts.map +1 -1
- package/lib/dist/mcp/tools.js +2402 -241
- package/lib/dist/mcp/tools.js.map +1 -1
- package/lib/dist/project-config.d.ts +23 -0
- package/lib/dist/project-config.d.ts.map +1 -1
- package/lib/dist/project-config.js +39 -2
- package/lib/dist/project-config.js.map +1 -1
- package/lib/dist/resolution/c-fnptr-synthesizer.d.ts.map +1 -1
- package/lib/dist/resolution/c-fnptr-synthesizer.js +21 -19
- package/lib/dist/resolution/c-fnptr-synthesizer.js.map +1 -1
- package/lib/dist/resolution/callback-synthesizer.d.ts.map +1 -1
- package/lib/dist/resolution/callback-synthesizer.js +39 -11
- package/lib/dist/resolution/callback-synthesizer.js.map +1 -1
- package/lib/dist/resolution/frameworks/swift.d.ts.map +1 -1
- package/lib/dist/resolution/frameworks/swift.js +11 -1
- package/lib/dist/resolution/frameworks/swift.js.map +1 -1
- package/lib/dist/resolution/import-resolver.d.ts.map +1 -1
- package/lib/dist/resolution/import-resolver.js +18 -2
- package/lib/dist/resolution/import-resolver.js.map +1 -1
- package/lib/dist/resolution/index.d.ts.map +1 -1
- package/lib/dist/resolution/index.js +15 -4
- package/lib/dist/resolution/index.js.map +1 -1
- package/lib/dist/resolution/name-matcher.d.ts +30 -0
- package/lib/dist/resolution/name-matcher.d.ts.map +1 -1
- package/lib/dist/resolution/name-matcher.js +295 -5
- package/lib/dist/resolution/name-matcher.js.map +1 -1
- package/lib/dist/resolution/path-aliases.d.ts +6 -4
- package/lib/dist/resolution/path-aliases.d.ts.map +1 -1
- package/lib/dist/resolution/path-aliases.js +125 -17
- package/lib/dist/resolution/path-aliases.js.map +1 -1
- package/lib/dist/search/identifier-segments.d.ts +10 -0
- package/lib/dist/search/identifier-segments.d.ts.map +1 -1
- package/lib/dist/search/identifier-segments.js +29 -0
- package/lib/dist/search/identifier-segments.js.map +1 -1
- package/lib/dist/search/query-paths.d.ts +57 -0
- package/lib/dist/search/query-paths.d.ts.map +1 -0
- package/lib/dist/search/query-paths.js +298 -0
- package/lib/dist/search/query-paths.js.map +1 -0
- package/lib/dist/search/query-utils.d.ts +1 -1
- package/lib/dist/search/query-utils.d.ts.map +1 -1
- package/lib/dist/search/query-utils.js +13 -3
- package/lib/dist/search/query-utils.js.map +1 -1
- package/lib/dist/sync/watcher.d.ts +22 -0
- package/lib/dist/sync/watcher.d.ts.map +1 -1
- package/lib/dist/sync/watcher.js +51 -5
- package/lib/dist/sync/watcher.js.map +1 -1
- package/lib/dist/types.d.ts +20 -1
- package/lib/dist/types.d.ts.map +1 -1
- package/lib/dist/types.js +1 -0
- package/lib/dist/types.js.map +1 -1
- package/lib/kernel/codegraph-kernel.node +0 -0
- package/lib/node_modules/.package-lock.json +1 -1
- package/lib/package.json +1 -1
- package/package.json +1 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"session.js","sourceRoot":"","sources":["../../src/mcp/session.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;GAYG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
|
1
|
+
{"version":3,"file":"session.js","sourceRoot":"","sources":["../../src/mcp/session.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;GAYG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAqCH,wDAMC;AAzCD,2CAA6B;AAC7B,2CAAgG;AAEhG,mCAAgC;AAChC,+DAA+F;AAC/F,u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AmB,EAAE;gBAAE,OAAO;QAChD,CAAC;QAED,kEAAkE;QAClE,mDAAmD;QACnD,MAAM,SAAS,GAAG,IAAI,IAAI,OAAO,CAAC,GAAG,EAAE,CAAC;QACxC,IAAI,CAAC,MAAM,CAAC,mBAAmB,CAAC,SAAS,CAAC,CAAC;IAC7C,CAAC;IAED;;;OAGG;IACK,KAAK,CAAC,aAAa;QACzB,IAAI,MAAM,GAAG,OAAO,CAAC,GAAG,EAAE,CAAC;QAC3B,IAAI,CAAC;YACH,MAAM,MAAM,GAAG,MAAM,IAAI,CAAC,SAAS,CAAC,OAAO,CAAC,YAAY,EAAE,SAAS,EAAE,qBAAqB,CAAC,CAAC;YAC5F,MAAM,QAAQ,GAAG,aAAa,CAAC,MAAM,CAAC,CAAC;YACvC,IAAI,QAAQ,EAAE,CAAC;gBACb,MAAM,GAAG,QAAQ,CAAC;YACpB,CAAC;iBAAM,CAAC;gBACN,OAAO,CAAC,MAAM,CAAC,KAAK,CAAC,oFAAoF,CAAC,CAAC;YAC7G,CAAC;QACH,CAAC;QAAC,OAAO,GAAG,EAAE,CAAC;YACb,MAAM,GAAG,GAAG,GAAG,YAAY,KAAK,CAAC,CAAC,CAAC,GAAG,CAAC,OAAO,CAAC,CAAC,CAAC,MAAM,CAAC,GAAG,CAAC,CAAC;YAC7D,OAAO,CAAC,MAAM,CAAC,KAAK,CAAC,8CAA8C,GAAG,mCAAmC,CAAC,CAAC;QAC7G,CAAC;QACD,MAAM,IAAI,CAAC,MAAM,CAAC,iBAAiB,CAAC,MAAM,CAAC,CAAC;IAC9C,CAAC;CACF;AA3QD,gCA2QC"}
|
package/lib/dist/mcp/tools.d.ts
CHANGED
|
@@ -5,7 +5,9 @@
|
|
|
5
5
|
*/
|
|
6
6
|
import type CodeGraph from '../index';
|
|
7
7
|
import type { QueryPool } from './query-pool';
|
|
8
|
+
export declare function __setLoadCodeGraphForTests(cls: typeof import('../index').default | null): void;
|
|
8
9
|
import type { PendingFile } from '../sync';
|
|
10
|
+
import { ExploreSessionState, type ExploreEmission } from './explore-session-state';
|
|
9
11
|
/**
|
|
10
12
|
* An expected, recoverable "codegraph can't serve this" condition — most
|
|
11
13
|
* importantly a project with no index. The dispatch catch converts these to
|
|
@@ -92,17 +94,181 @@ export interface ExploreOutputBudget {
|
|
|
92
94
|
includeCompletenessSignal: boolean;
|
|
93
95
|
/** Include the explore-budget reminder at the end. */
|
|
94
96
|
includeBudgetNote: boolean;
|
|
97
|
+
}
|
|
98
|
+
export declare function getExploreOutputBudget(fileCount: number): ExploreOutputBudget;
|
|
99
|
+
/**
|
|
100
|
+
* How strongly a match on a symbol of this kind corroborates that its FILE is
|
|
101
|
+
* what the query is about.
|
|
102
|
+
*
|
|
103
|
+
* 1.0 a callable or a type — the unit an architecture question is about
|
|
104
|
+
* ~0.5 a member of a type, or the file node itself (a path match, not a
|
|
105
|
+
* symbol match)
|
|
106
|
+
* ~0.3 a variable / constant — as often a name collision as a definition
|
|
107
|
+
* 0.15 a parameter — essentially never the subject of a question
|
|
108
|
+
*
|
|
109
|
+
* Unlisted kinds fall back to `DEFAULT_RELEVANCE_KIND_WEIGHT`, so a NodeKind
|
|
110
|
+
* added later is neither free nor fatal.
|
|
111
|
+
*/
|
|
112
|
+
export declare const RELEVANCE_KIND_WEIGHT: Readonly<Record<string, number>>;
|
|
113
|
+
export declare const EXPLORE_ALLOCATION: {
|
|
95
114
|
/**
|
|
96
|
-
*
|
|
97
|
-
*
|
|
98
|
-
*
|
|
99
|
-
*
|
|
100
|
-
*
|
|
101
|
-
*
|
|
115
|
+
* A file whose weight is under this fraction of the top file's gets no source.
|
|
116
|
+
*
|
|
117
|
+
* Calibrated between the two shapes the fixtures pin: the #1500 generated CRUD
|
|
118
|
+
* lands at 10–11% of the top weight (penalised twice — once into the score by
|
|
119
|
+
* `rankPenalty`, once again here) and must cliff; a genuinely peripheral but
|
|
120
|
+
* hand-written flow file — `payslip_builder.go`, the direct callee of the
|
|
121
|
+
* workflow entry — lands at 25% and must NOT. Everything in between is a
|
|
122
|
+
* judgement call the agent can undo for ~0 cost, because a cliffed file is
|
|
123
|
+
* still NAMED in the response and one follow-up explore fetches it.
|
|
124
|
+
*/
|
|
125
|
+
readonly CLIFF_FRACTION: 0.15;
|
|
126
|
+
/**
|
|
127
|
+
* Ceiling on the cliff, in the same units as `SCORE_FLOOR_MAX` — and for the
|
|
128
|
+
* same reason. A file whose weight clears a full-strength direct match is never
|
|
129
|
+
* incidental, so no amount of concentration elsewhere may zero it: one
|
|
130
|
+
* overwhelming top file (a 99-scoring god-file among score-10 peers) otherwise
|
|
131
|
+
* puts the cliff at 14.9 and silences every peer the score floor had just
|
|
132
|
+
* deliberately admitted. The cliff is a RELATIVE prune of weak evidence, not a
|
|
133
|
+
* second admission gate — the score floor already owns admission.
|
|
134
|
+
*/
|
|
135
|
+
readonly CLIFF_MAX: 10;
|
|
136
|
+
/**
|
|
137
|
+
* Floor on a useful reservation — every admitted file gets this much before
|
|
138
|
+
* the proportional split divides the rest. Under it a slice can't hold one
|
|
139
|
+
* complete method, and a fragment is strictly worse than a pointer: it forces
|
|
140
|
+
* the Read this tool exists to prevent.
|
|
141
|
+
*
|
|
142
|
+
* It is a FLOOR, not a second cliff. Cliffing the starved file instead
|
|
143
|
+
* cascades: removing the smallest raises everyone else's share by so little
|
|
144
|
+
* that the next-smallest starves too, and a query with two dominant files ate
|
|
145
|
+
* six legitimately-ranked peers one at a time. Concentration is the relative
|
|
146
|
+
* cliff's job; this only keeps a served file's slice usable.
|
|
102
147
|
*/
|
|
103
|
-
|
|
148
|
+
readonly MIN_CHARS: 700;
|
|
149
|
+
/**
|
|
150
|
+
* Safety valve, as a fraction of the envelope. Not the primary guard any more —
|
|
151
|
+
* the proportional split is — so this only has to stop a pathological
|
|
152
|
+
* single-file response.
|
|
153
|
+
*/
|
|
154
|
+
readonly MAX_SHARE: 0.7;
|
|
155
|
+
/**
|
|
156
|
+
* Markdown overhead charged per rendered file (header + fences + blank lines),
|
|
157
|
+
* matching the render loop's own `+ 200` accounting. Held out of the pool
|
|
158
|
+
* before the split so the reservations plus their overhead fit the envelope —
|
|
159
|
+
* without this the last file's reservation is always the one that doesn't fit.
|
|
160
|
+
*/
|
|
161
|
+
readonly FILE_OVERHEAD: 200;
|
|
162
|
+
/**
|
|
163
|
+
* Flow-spine files are weighted up and are exempt from the cliff. Clipping the
|
|
164
|
+
* spine causes the Read fallback (it IS the answer to a flow question);
|
|
165
|
+
* clipping a peripheral file does not. This makes the existing advisory spine
|
|
166
|
+
* handling — `hasSpine`, `SPINE_CEILING` — strict at the allocation layer.
|
|
167
|
+
*/
|
|
168
|
+
readonly SPINE_WEIGHT_BOOST: 2;
|
|
169
|
+
/**
|
|
170
|
+
* Slack allowed on the whole-file rule: a file a little over its reservation
|
|
171
|
+
* still ships WHOLE rather than as clusters, because slicing off that last
|
|
172
|
+
* sliver saves ~1% of the envelope and costs a Read — the trade the whole-file
|
|
173
|
+
* rule exists to refuse. Proportional (with an absolute ceiling) because a
|
|
174
|
+
* "sliver" is relative: a flat 800 is 15% of a 5K reservation but 31% of a 2.5K
|
|
175
|
+
* one, and at the small end that overshoot is exactly what the file below then
|
|
176
|
+
* loses.
|
|
177
|
+
*/
|
|
178
|
+
readonly WHOLE_FILE_GRACE_FRACTION: 0.15;
|
|
179
|
+
readonly WHOLE_FILE_GRACE_MAX: 800;
|
|
180
|
+
/**
|
|
181
|
+
* A reservation that already covers this fraction of a file BUYS THE WHOLE
|
|
182
|
+
* FILE (CG-21), even though the file is bigger than the reservation.
|
|
183
|
+
*
|
|
184
|
+
* The grace above is calibrated as a *sliver* — it only rescues a file that
|
|
185
|
+
* essentially fits. Below it there is a hole the render loop cannot fill:
|
|
186
|
+
* express's `lib/utils.js` (5,293 B) was the TOP-ranked file, reserved 3,870,
|
|
187
|
+
* declined the whole-file render at a 4,450 grace bound, and then spent 583 on
|
|
188
|
+
* a three-symbol cluster render. The other 3,287 chars of its reservation were
|
|
189
|
+
* neither redistributed nor delivered — the envelope shrank by a third against
|
|
190
|
+
* an unchanged budget and the agent Read the file back four times.
|
|
191
|
+
*
|
|
192
|
+
* So the rule is not "does the file fit the reservation" but "has the
|
|
193
|
+
* reservation already bought most of the file": at 0.6 the loop pays at most
|
|
194
|
+
* two-thirds of a reservation extra to avoid losing the whole thing, and it
|
|
195
|
+
* spends bytes it was going to spend anyway on a file that already earned
|
|
196
|
+
* them. Below the fraction the shortfall is real — the file is several times
|
|
197
|
+
* its reservation, clustering is the right answer, and the carry-forward
|
|
198
|
+
* (`reservedSoFar`/`sourceSpent` in the render loop) hands whatever it cannot
|
|
199
|
+
* spend to the next file down.
|
|
200
|
+
*/
|
|
201
|
+
readonly WHOLE_FILE_BUY_FRACTION: 0.6;
|
|
202
|
+
/**
|
|
203
|
+
* The buy rule's overshoot is funded from ONE pool for the whole response,
|
|
204
|
+
* sized as this fraction of the envelope — deliberately the same 15% as
|
|
205
|
+
* `WHOLE_FILE_GRACE_FRACTION`, one level up: the grace is a sliver of a
|
|
206
|
+
* FILE's reservation, this is a sliver of the RESPONSE's envelope.
|
|
207
|
+
*
|
|
208
|
+
* Per-file funding is the version that fails, and it fails the same way the
|
|
209
|
+
* bug being fixed does. The merit test is a RATIO, so wherever several files
|
|
210
|
+
* sit near it they all qualify, and N independent overshoots inflate the
|
|
211
|
+
* response until the render ceiling drops whatever is last. Measured on the
|
|
212
|
+
* #1500 payroll fixture: three files bought whole and `payslip_builder.go` —
|
|
213
|
+
* the file that computes the payslip the question asks about, rank #6 — was
|
|
214
|
+
* dropped entirely so three higher-ranked files could each ship their final
|
|
215
|
+
* sliver. A dropped section is strictly worse than a clustered one, so one
|
|
216
|
+
* shared pool, spent in rank order, is the bound that matters.
|
|
217
|
+
*/
|
|
218
|
+
readonly WHOLE_FILE_BUY_OVERSHOOT_FRACTION: 0.15;
|
|
219
|
+
};
|
|
220
|
+
/** One candidate file's allocation inputs, in final rank order. */
|
|
221
|
+
export interface ExploreAllocationCandidate {
|
|
222
|
+
path: string;
|
|
223
|
+
/** Post-`rankPenalty` relevance score from the ranking pass. */
|
|
224
|
+
score: number;
|
|
225
|
+
/**
|
|
226
|
+
* How much this file's BYTES are worth, independent of how well it matched.
|
|
227
|
+
* Ranking answers "is this file about the query"; allocation answers "will
|
|
228
|
+
* these bytes teach the agent anything". Generated CRUD can legitimately rank
|
|
229
|
+
* (it name-collides on every domain word) while its bytes stay mechanical
|
|
230
|
+
* boilerplate the agent gains nothing from reading — so `rankPenalty` is
|
|
231
|
+
* applied a SECOND time here. That is what finally sinks the #1500 generated
|
|
232
|
+
* layer below the cliff: it survived CG-10's single penalty because the sort's
|
|
233
|
+
* leading keys (entry-point, graph mass) are structural, and a big densely
|
|
234
|
+
* self-referential generated file scores well on both.
|
|
235
|
+
*/
|
|
236
|
+
worth: number;
|
|
237
|
+
/** Carries a symbol on the rendered flow spine. */
|
|
238
|
+
spine: boolean;
|
|
239
|
+
/**
|
|
240
|
+
* The query named this file by PATH (see query-paths.ts). Pinned files are
|
|
241
|
+
* never cliffed or trimmed, and weigh at least as much as the strongest
|
|
242
|
+
* candidate — the agent asked for the file itself, so starving it on text/
|
|
243
|
+
* graph scores (which a pure-path query doesn't produce) defeats the ask.
|
|
244
|
+
*/
|
|
245
|
+
pinned?: boolean;
|
|
104
246
|
}
|
|
105
|
-
export
|
|
247
|
+
export interface ExploreAllocation {
|
|
248
|
+
/** path → chars of source it may render. Only holds admitted files. */
|
|
249
|
+
allowances: Map<string, number>;
|
|
250
|
+
/** Files the cliff zeroed, in rank order — pointers, not bytes. */
|
|
251
|
+
cliffed: string[];
|
|
252
|
+
/** The weight threshold the cliff fired at (0 when nothing was cliffed). */
|
|
253
|
+
cliffAt: number;
|
|
254
|
+
/** Chars actually split among the admitted files. */
|
|
255
|
+
pool: number;
|
|
256
|
+
}
|
|
257
|
+
/**
|
|
258
|
+
* Split `budget.maxOutputChars` across ranked candidates in proportion to
|
|
259
|
+
* relevance, with a hard relative cliff.
|
|
260
|
+
*
|
|
261
|
+
* `candidates` must arrive in FINAL RANK ORDER — `maxFiles` is applied to the
|
|
262
|
+
* survivors of the cliff, in that order, so cliffing genuinely hands a slot to
|
|
263
|
+
* the next file down rather than leaving it unused.
|
|
264
|
+
*
|
|
265
|
+
* Tier invariant (`getExploreOutputBudget`): a larger tier must never allow less
|
|
266
|
+
* per file than a smaller one. It holds here by construction — every bound is a
|
|
267
|
+
* fraction of `maxOutputChars` or of `maxCharsPerFile`, both monotonic across
|
|
268
|
+
* tiers — except `MIN_CHARS`, which is an absolute floor and so identical at
|
|
269
|
+
* every tier.
|
|
270
|
+
*/
|
|
271
|
+
export declare function allocateExploreBudget(candidates: readonly ExploreAllocationCandidate[], budget: ExploreOutputBudget, maxFiles: number): ExploreAllocation;
|
|
106
272
|
/**
|
|
107
273
|
* Per-file staleness banner emitted at the top of a tool response when the
|
|
108
274
|
* file watcher has pending events for files referenced by the response.
|
|
@@ -179,6 +345,15 @@ export interface ToolResult {
|
|
|
179
345
|
text: string;
|
|
180
346
|
}>;
|
|
181
347
|
isError?: boolean;
|
|
348
|
+
/**
|
|
349
|
+
* INTERNAL side-channel (CG-17): what a `codegraph_explore` call actually put
|
|
350
|
+
* on the wire — files, line ranges, bytes. It rides the result because the
|
|
351
|
+
* call may have run on a query-pool worker, while the session state it feeds
|
|
352
|
+
* lives on the main thread. {@link ToolHandler.execute} records it and DELETES
|
|
353
|
+
* it, so nothing here ever reaches the client. Keyed by
|
|
354
|
+
* {@link EXPLORE_EMISSION_KEY}; the two must stay in sync.
|
|
355
|
+
*/
|
|
356
|
+
_cgExploreEmission?: ExploreEmission;
|
|
182
357
|
}
|
|
183
358
|
/**
|
|
184
359
|
* All CodeGraph MCP tools
|
|
@@ -207,6 +382,8 @@ export declare class ToolHandler {
|
|
|
207
382
|
private cg;
|
|
208
383
|
private projectCache;
|
|
209
384
|
private defaultProjectHint;
|
|
385
|
+
private knownSubprojects;
|
|
386
|
+
private knownSubprojectsBase;
|
|
210
387
|
private worktreeMismatchCache;
|
|
211
388
|
private catchUpGate;
|
|
212
389
|
private queryPool;
|
|
@@ -245,6 +422,14 @@ export declare class ToolHandler {
|
|
|
245
422
|
* Used only to make the "no default project" error actionable.
|
|
246
423
|
*/
|
|
247
424
|
setDefaultProjectHint(searchedPath: string): void;
|
|
425
|
+
/**
|
|
426
|
+
* Engine-only: record the indexed sub-projects the workspace down-scan saw
|
|
427
|
+
* when it could not adopt a default project (#1606/#1607). An empty list
|
|
428
|
+
* clears any previous note.
|
|
429
|
+
*/
|
|
430
|
+
setKnownSubprojects(roots: string[], base: string): void;
|
|
431
|
+
/** One message line naming the indexed sub-projects, or '' when none known. */
|
|
432
|
+
private formatKnownSubprojects;
|
|
248
433
|
/**
|
|
249
434
|
* Whether a default CodeGraph instance is available
|
|
250
435
|
*/
|
|
@@ -339,11 +524,65 @@ export declare class ToolHandler {
|
|
|
339
524
|
* Cost when nothing is pending — the common case — is one boolean check.
|
|
340
525
|
* No I/O, no parsing of markdown beyond a per-pending-file substring scan.
|
|
341
526
|
*/
|
|
527
|
+
private driftCache;
|
|
528
|
+
private static readonly DRIFT_TTL_MS;
|
|
529
|
+
/**
|
|
530
|
+
* On-disk drift check for a single indexed file (issue #1474). The code
|
|
531
|
+
* renderers slice CURRENT bytes at INDEXED line ranges; when the file
|
|
532
|
+
* changed after its last index sync those ranges can point at a DIFFERENT
|
|
533
|
+
* symbol's code — served under the requested name with `isError: false`.
|
|
534
|
+
* The watcher-based pending/degraded banners can't cover this for a
|
|
535
|
+
* project reached via `projectPath` (cross-project instances have no
|
|
536
|
+
* watcher, by construction), so freshness is verified here, at the point
|
|
537
|
+
* of emission, from data the index already stores.
|
|
538
|
+
*
|
|
539
|
+
* Cheap and precise: one stat() per file (size + mtime, the same
|
|
540
|
+
* comparison the sync fast path uses); only on a stat mismatch is the
|
|
541
|
+
* content hashed (sha256, matching extraction's `hashContent`) so a
|
|
542
|
+
* touch/checkout that rewrote identical bytes never false-positives.
|
|
543
|
+
* Results are memoized briefly so one response rendering the same file in
|
|
544
|
+
* several sections pays for the check once.
|
|
545
|
+
*
|
|
546
|
+
* Returns true when the on-disk file differs from what was indexed —
|
|
547
|
+
* i.e. indexed line ranges for it are NOT trustworthy. Any failure
|
|
548
|
+
* (missing files-table row, stat/read error) reports false: those cases
|
|
549
|
+
* are handled by the existing not-found paths, and a wrong "stale" flag
|
|
550
|
+
* would needlessly push the agent back to Read.
|
|
551
|
+
*/
|
|
552
|
+
private isFileStaleOnDisk;
|
|
342
553
|
private withStalenessNotice;
|
|
343
554
|
/**
|
|
344
|
-
* Execute a tool by name
|
|
555
|
+
* Execute a tool by name.
|
|
556
|
+
*
|
|
557
|
+
* `sessionState` is the CALLER's per-session explore history (CG-17). The
|
|
558
|
+
* daemon shares one ToolHandler across every connected session, so this state
|
|
559
|
+
* cannot live on the handler — each session owns one and hands it in, which is
|
|
560
|
+
* what keeps two sessions on one daemon from ever seeing each other's calls.
|
|
561
|
+
* Omit it (the CLI does) and explore behaves exactly as before, untracked.
|
|
562
|
+
*/
|
|
563
|
+
execute(toolName: string, args: Record<string, unknown>, sessionState?: ExploreSessionState): Promise<ToolResult>;
|
|
564
|
+
/**
|
|
565
|
+
* Attach the caller's session view to an explore call's args (CG-17), on a
|
|
566
|
+
* COPY so the caller's object is never mutated. Nothing else sees it: a
|
|
567
|
+
* non-explore tool, or a caller with no session state, gets the args
|
|
568
|
+
* unchanged and pays nothing.
|
|
569
|
+
*
|
|
570
|
+
* A client that spells the internal key itself is stripped rather than
|
|
571
|
+
* trusted — the view decides what source a later call may withhold, so it has
|
|
572
|
+
* to come from the server's own record, never from the wire.
|
|
573
|
+
*/
|
|
574
|
+
private withSessionView;
|
|
575
|
+
/**
|
|
576
|
+
* Record an explore call's emission into the caller's session state and strip
|
|
577
|
+
* it from the result (CG-17).
|
|
578
|
+
*
|
|
579
|
+
* Unconditional strip: the property is internal, so it comes off even when
|
|
580
|
+
* there is no session state to record it into (the CLI path) — that is what
|
|
581
|
+
* keeps the agent-facing response byte-identical. Recording is wrapped
|
|
582
|
+
* because a bookkeeping bug must never fail a tool call that already
|
|
583
|
+
* succeeded.
|
|
345
584
|
*/
|
|
346
|
-
|
|
585
|
+
private takeExploreEmission;
|
|
347
586
|
/**
|
|
348
587
|
* Run a single read tool to completion and return its raw {@link ToolResult},
|
|
349
588
|
* classifying expected failures the same way {@link execute}'s catch does so
|
|
@@ -463,6 +702,14 @@ export declare class ToolHandler {
|
|
|
463
702
|
* qualify so a leaf-only exploration stays clean.
|
|
464
703
|
*/
|
|
465
704
|
private buildBlastRadiusSection;
|
|
705
|
+
/**
|
|
706
|
+
* Test-coverage note for a blast-radius entry whose DIRECT callers include no
|
|
707
|
+
* test file. A helper called only by production code can still be exercised
|
|
708
|
+
* by tests further up the caller chain (#1475: 40% of directly-unflagged
|
|
709
|
+
* symbols had a test within 2-3 hops), so walk up to 2 more hops before
|
|
710
|
+
* claiming anything — and even then claim only what was measured.
|
|
711
|
+
*/
|
|
712
|
+
private indirectTestNote;
|
|
466
713
|
/**
|
|
467
714
|
* Graph-connectivity relevance via Random-Walk-with-Restart (personalized
|
|
468
715
|
* PageRank) from the query's matched SEED nodes over the call/reference graph.
|
|
@@ -492,6 +739,12 @@ export declare class ToolHandler {
|
|
|
492
739
|
* tax on small projects while earning its keep on large ones.
|
|
493
740
|
*/
|
|
494
741
|
private handleExplore;
|
|
742
|
+
/**
|
|
743
|
+
* An explore response plus the record of what it emitted (CG-17). The record
|
|
744
|
+
* rides the result only as far as {@link execute}, which files it into the
|
|
745
|
+
* calling session's state and deletes it — see {@link EXPLORE_EMISSION_KEY}.
|
|
746
|
+
*/
|
|
747
|
+
private exploreResult;
|
|
495
748
|
/**
|
|
496
749
|
* Handle codegraph_node
|
|
497
750
|
*/
|
|
@@ -512,6 +765,19 @@ export declare class ToolHandler {
|
|
|
512
765
|
private handleFileView;
|
|
513
766
|
/** Render one symbol: details + (optional) body/outline + its caller/callee trail. */
|
|
514
767
|
private renderNodeSection;
|
|
768
|
+
private static readonly STALE_WHOLE_FILE_MAX_LINES;
|
|
769
|
+
private static readonly STALE_WHOLE_FILE_MAX_CHARS;
|
|
770
|
+
/**
|
|
771
|
+
* codegraph_node render for a symbol whose file changed on disk after the
|
|
772
|
+
* last index sync (issue #1474). The indexed line range is no longer
|
|
773
|
+
* trustworthy, so no slice is emitted: a small file gets its full CURRENT
|
|
774
|
+
* source (Read-parity — sufficiency preserved, the agent still doesn't need
|
|
775
|
+
* Read); a large one gets an explicit notice steering to the tool's own
|
|
776
|
+
* file-read mode (or Read) — honest absence instead of confident wrongness.
|
|
777
|
+
* Location/signature stay (they're the index's answer) but are flagged as
|
|
778
|
+
* possibly shifted.
|
|
779
|
+
*/
|
|
780
|
+
private renderStaleNodeSection;
|
|
515
781
|
/**
|
|
516
782
|
* Build the "trail" for a symbol: its direct callees (what it calls) and
|
|
517
783
|
* callers (what calls it), each with file:line — so codegraph_node doubles as
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"tools.d.ts","sourceRoot":"","sources":["../../src/mcp/tools.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,KAAK,SAAS,MAAM,UAAU,CAAC;AACtC,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,cAAc,CAAC;AAe9C,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,SAAS,CAAC;
|
|
1
|
+
{"version":3,"file":"tools.d.ts","sourceRoot":"","sources":["../../src/mcp/tools.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,KAAK,SAAS,MAAM,UAAU,CAAC;AACtC,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,cAAc,CAAC;AAe9C,wBAAgB,0BAA0B,CAAC,GAAG,EAAE,cAAc,UAAU,EAAE,OAAO,GAAG,IAAI,GAAG,IAAI,CAE9F;AAOD,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,SAAS,CAAC;AAc3C,OAAO,EAGL,mBAAmB,EAGnB,KAAK,eAAe,EAGrB,MAAM,yBAAy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