@lzehrung/codegraph 2.3.14 → 2.3.16
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 +1 -1
- package/codegraph-skill/codegraph/SKILL.md +11 -3
- package/dist/agent/query-index/workerPool.d.ts.map +1 -1
- package/dist/agent/query-index/workerPool.js +2 -0
- package/dist/agent/query-index/workerPool.js.map +1 -1
- package/dist/bin/cli.js +381 -174
- package/dist/bin/queryIndexWorker.js +30 -0
- package/dist/bin/rawQueryWorker.js +34 -0
- package/dist/cli/commandTable.d.ts.map +1 -1
- package/dist/cli/commandTable.js +14 -1
- package/dist/cli/commandTable.js.map +1 -1
- package/dist/cli/help.d.ts +4 -4
- package/dist/cli/help.d.ts.map +1 -1
- package/dist/cli/help.js +8 -7
- package/dist/cli/help.js.map +1 -1
- package/dist/cli/mcp.js +11 -6
- package/dist/cli/mcp.js.map +1 -1
- package/dist/cli/options.d.ts.map +1 -1
- package/dist/cli/options.js +3 -2
- package/dist/cli/options.js.map +1 -1
- package/dist/cli/orient.d.ts +6 -2
- package/dist/cli/orient.d.ts.map +1 -1
- package/dist/cli/orient.js +13 -1
- package/dist/cli/orient.js.map +1 -1
- package/dist/cli/progress.d.ts.map +1 -1
- package/dist/cli/progress.js +21 -7
- package/dist/cli/progress.js.map +1 -1
- package/dist/cli/server.d.ts.map +1 -1
- package/dist/cli/server.js +6 -2
- package/dist/cli/server.js.map +1 -1
- package/dist/indexer/build-index.d.ts.map +1 -1
- package/dist/indexer/build-index.js +148 -28
- package/dist/indexer/build-index.js.map +1 -1
- package/dist/indexer/types.d.ts +2 -0
- package/dist/indexer/types.d.ts.map +1 -1
- package/dist/mcp/handlers.d.ts +6 -1
- package/dist/mcp/handlers.d.ts.map +1 -1
- package/dist/mcp/handlers.js +13 -9
- package/dist/mcp/handlers.js.map +1 -1
- package/dist/mcp/protocol.d.ts.map +1 -1
- package/dist/mcp/protocol.js +1 -1
- package/dist/mcp/protocol.js.map +1 -1
- package/dist/native/runtime.d.ts.map +1 -1
- package/dist/native/runtime.js +2 -0
- package/dist/native/runtime.js.map +1 -1
- package/dist/sqlite/rawQueryWorkerPool.d.ts.map +1 -1
- package/dist/sqlite/rawQueryWorkerPool.js +10 -6
- package/dist/sqlite/rawQueryWorkerPool.js.map +1 -1
- package/dist/sqlite-driver.d.ts +1 -0
- package/dist/sqlite-driver.d.ts.map +1 -1
- package/dist/sqlite-driver.js +6 -0
- package/dist/sqlite-driver.js.map +1 -1
- package/dist/util/projectFiles.d.ts.map +1 -1
- package/dist/util/projectFiles.js +10 -1
- package/dist/util/projectFiles.js.map +1 -1
- package/dist/util/windowsProcessDrain.d.ts +23 -0
- package/dist/util/windowsProcessDrain.d.ts.map +1 -0
- package/dist/util/windowsProcessDrain.js +51 -0
- package/dist/util/windowsProcessDrain.js.map +1 -0
- package/dist/worker/nativeWorkerPool.d.ts.map +1 -1
- package/dist/worker/nativeWorkerPool.js +2 -0
- package/dist/worker/nativeWorkerPool.js.map +1 -1
- package/docs/mcp.md +9 -9
- package/package.json +3 -3
package/README.md
CHANGED
|
@@ -303,7 +303,7 @@ codegraph skill install --agent claude
|
|
|
303
303
|
codegraph skill install --agent cursor
|
|
304
304
|
```
|
|
305
305
|
|
|
306
|
-
See [Agent workflows](./docs/agent-workflows.md) for exploration strategy, warm sessions, streaming, review loops, and tool wrappers. Use `codegraph server start --root
|
|
306
|
+
See [Agent workflows](./docs/agent-workflows.md) for exploration strategy, warm sessions, streaming, review loops, and tool wrappers. Use `codegraph server start --root .` to share one local MCP HTTP server, then inspect or stop it with `codegraph server status --root . --json` and `codegraph server stop --root .`; lifecycle verification keeps its secret outside the project. See [MCP](./docs/mcp.md) for server and client configuration.
|
|
307
307
|
|
|
308
308
|
## Language support
|
|
309
309
|
|
|
@@ -134,7 +134,7 @@ Current-state commands validate the on-disk index automatically and default to t
|
|
|
134
134
|
- Repeated agent queries over one repo snapshot: prefer MCP so the index stays warm. MCP inputs are flat JSON objects and the server root is fixed at startup; send only fields in the mounted tool schema, never CLI flags such as `--root` or `--json`. Unknown tool fields are rejected as invalid parameters. If the first MCP call fails at startup or loses its transport, do not retry the same server; run `codegraph doctor`, use the equivalent CLI command for this session, and restart the agent client after package upgrades.
|
|
135
135
|
- Durable graph handoff: use `codegraph graph --root . ./src --json --output codegraph.json` rather than parsing display text. `graph --json` and `index --json` payloads include an `analysis` object (`mode`, `backend`, `label`, fallback counts); when `mode` is `mixed` or `reduced` the run used regex/graph-only extraction for some or all files, so treat symbol accuracy accordingly. Degraded runs also print a `Backend:` warning on stderr even without `--progress`.
|
|
136
136
|
- Search and inspect performance diagnosis: add `--report` for JSON on stderr or `--report-file <path>` for a file while keeping normal command output unchanged.
|
|
137
|
-
- Index discovery diagnosis: `--report` timing JSON can include `sourceDiscoveryMs` and `
|
|
137
|
+
- Index discovery diagnosis: `--report` timing JSON can include `sourceDiscoveryMs`, `metadataDiscoveryMs`, `gitListMs`, `filesystemScanMs`, and `cacheProbeMs` when those steps run.
|
|
138
138
|
|
|
139
139
|
### Human Graph Viewer
|
|
140
140
|
|
|
@@ -187,10 +187,18 @@ If MCP tools are available, prefer them over repeated CLI invocations. Use `expl
|
|
|
187
187
|
|
|
188
188
|
MCP `explore` defaults `includeSource` to `false` because source-bearing packets dominate an agent response; anchors and follow-ups identify the focused source request to make next. This intentionally differs from CLI `explore`, which includes source by default for human-readable output; pass `includeSource: true` to MCP when source is needed.
|
|
189
189
|
|
|
190
|
-
codegraph uses the official MCP SDK v2 to serve current 2026-07-28 clients while retaining compatibility with 2025-era clients. MCP protocol connections and HTTP protocol sessions keep separate transport state, but all share the server's one warm codegraph analysis session for the configured root.
|
|
190
|
+
codegraph uses the official MCP SDK v2 to serve current 2026-07-28 clients while retaining compatibility with 2025-era clients. MCP protocol connections and HTTP protocol sessions keep separate transport state, but all share the server's one warm codegraph analysis session for the configured root.
|
|
191
|
+
|
|
192
|
+
- `mcp serve` warms the base session cache during startup by default, so a cold discovery-and-build cost lands on server startup rather than the first `tools/call`.
|
|
193
|
+
- Pass `--no-warmup` to start lazily instead, or `--warmup-symbols` to also build the detailed symbol graph before serving.
|
|
194
|
+
- Tool schemas reject unknown fields; each protocol session caps tool concurrency at 4 with a retryable busy error.
|
|
195
|
+
- HTTP request bodies time out after 30 seconds; idle HTTP protocol sessions are evicted with a bounded session count.
|
|
196
|
+
- Cancellation responds to the caller promptly but retains the occupied slot until shared work settles, so abandoned calls cannot bypass that resource bound.
|
|
197
|
+
- Concurrent `refresh_index` calls serialize and honor each request's requested warmup mode.
|
|
198
|
+
|
|
191
199
|
On the first `tools/call`, codegraph can emit `notifications/message` and, when the request includes `_meta.progressToken`, `notifications/progress` before the final result. Stdio carries them inline, and modern Streamable HTTP clients that accept `text/event-stream` receive them as a stream until the terminal result frame.
|
|
192
200
|
HTTP enforces Host and Origin policies. A missing `Origin` is accepted for non-browser clients; unapproved, malformed, and opaque origins are rejected. This is not authentication: binding `--host` to a non-loopback address exposes an unauthenticated endpoint intended only for trusted networks or containers.
|
|
193
|
-
For a reusable local HTTP server, run `codegraph server start --root
|
|
201
|
+
For a reusable local HTTP server, run `codegraph server start --root .`, inspect it with `codegraph server status --root . --json`, and shut it down with `codegraph server stop --root .`. The lifecycle wrapper serializes project changes and writes `.codegraph/server.json` only after a challenged `/health` response proves the root, process, and startup time; its secret remains in the per-user Codegraph state directory, outside the project and separate from package files and compiler cache data. It defaults to `127.0.0.1:7331`, accepts `--startup-timeout-ms <1-86400000>` for warmups longer than 15 seconds, and writes startup diagnostics to `.codegraph/server.log`; add `--json` for `status: "started"`, registry fields, and update state.
|
|
194
202
|
For stdio lifecycle control, pass `--idle-timeout-ms <milliseconds>`; `0` disables the timer and the option is rejected with HTTP `--port` transport.
|
|
195
203
|
|
|
196
204
|
Use `refactor_plan` with flat `handle`, optional `renameTo`, independent optional `maxReferences`, `maxCallers`, and `maxHierarchy` bounds from 0 to 500, and optional `includeSource`. It reuses the configured server root and one session snapshot, returns portable targets and structured tool-call follow-ups even for exact internal review handles, exposes unsupported implementation sections in `sectionIssues`, preserves nested `rename.safe`, and never writes.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"workerPool.d.ts","sourceRoot":"","sources":["../../../src/agent/query-index/workerPool.ts"],"names":[],"mappings":"AAKA,OAAO,EAAyB,KAAK,sBAAsB,EAAE,MAAM,cAAc,CAAC;
|
|
1
|
+
{"version":3,"file":"workerPool.d.ts","sourceRoot":"","sources":["../../../src/agent/query-index/workerPool.ts"],"names":[],"mappings":"AAKA,OAAO,EAAyB,KAAK,sBAAsB,EAAE,MAAM,cAAc,CAAC;AAIlF,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,uBAAuB,CAAC;AAIlE;;;;;GAKG;AACH,eAAO,MAAM,4BAA4B,MAAM,CAAC;AAEhD;;;;;;GAMG;AACH,wBAAgB,oCAAoC,CAAC,SAAS,EAAE,MAAM,EAAE,WAAW,SAAyB,GAAG,OAAO,CAErH;AAMD,wBAAgB,2BAA2B,IAAI,MAAM,CAUpD;AACD,wBAAsB,+BAA+B,CACnD,WAAW,EAAE,MAAM,EACnB,KAAK,EAAE,SAAS,IAAI,CAAC,oBAAoB,EAAE,cAAc,GAAG,gBAAgB,CAAC,EAAE,GAC9E,OAAO,CAAC,sBAAsB,EAAE,GAAG,IAAI,CAAC,CAc1C;AAED,wBAAsB,8BAA8B,CAClD,WAAW,EAAE,MAAM,EACnB,KAAK,EAAE,SAAS,IAAI,CAAC,oBAAoB,EAAE,cAAc,GAAG,gBAAgB,CAAC,EAAE,GAC9E,OAAO,CAAC,sBAAsB,EAAE,GAAG,IAAI,CAAC,CA2C1C;AAED;;;;GAIG;AACH,wBAAsB,sBAAsB,CAC1C,WAAW,EAAE,MAAM,EACnB,KAAK,EAAE,SAAS,IAAI,CAAC,oBAAoB,EAAE,cAAc,GAAG,gBAAgB,CAAC,EAAE,GAC9E,OAAO,CAAC,sBAAsB,EAAE,GAAG,IAAI,CAAC,CAM1C"}
|
|
@@ -6,6 +6,7 @@ import { findPackageRoot } from "../../util/packageInfo.js";
|
|
|
6
6
|
import { prepareQueryIndexFile } from "./content.js";
|
|
7
7
|
import { resolveQueryIndexSourcePath } from "./paths.js";
|
|
8
8
|
import { resolveWorkerThreadCount } from "../../util/workerThreads.js";
|
|
9
|
+
import { markWindowsProcessDrainRequired } from "../../util/windowsProcessDrain.js";
|
|
9
10
|
const QUERY_INDEX_MAX_THREADS = 4;
|
|
10
11
|
/**
|
|
11
12
|
* Every worker thread imports the language registry before it can prepare its first file, so a
|
|
@@ -66,6 +67,7 @@ export async function prepareQueryIndexFilesInWorker(projectRoot, files) {
|
|
|
66
67
|
catch {
|
|
67
68
|
return await prepareQueryIndexFilesInProcess(projectRoot, files);
|
|
68
69
|
}
|
|
70
|
+
markWindowsProcessDrainRequired();
|
|
69
71
|
const pool = new Piscina({
|
|
70
72
|
filename: workerPath,
|
|
71
73
|
minThreads: 1,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"workerPool.js","sourceRoot":"","sources":["../../../src/agent/query-index/workerPool.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,SAAS,CAAC;AACzB,OAAO,IAAI,MAAM,WAAW,CAAC;AAC7B,OAAO,EAAE,aAAa,EAAE,MAAM,UAAU,CAAC;AACzC,OAAO,EAAE,OAAO,EAAE,MAAM,SAAS,CAAC;AAClC,OAAO,EAAE,eAAe,EAAE,MAAM,2BAA2B,CAAC;AAC5D,OAAO,EAAE,qBAAqB,EAA+B,MAAM,cAAc,CAAC;AAClF,OAAO,EAAE,2BAA2B,EAAE,MAAM,YAAY,CAAC;AACzD,OAAO,EAAE,wBAAwB,EAAE,MAAM,6BAA6B,CAAC;
|
|
1
|
+
{"version":3,"file":"workerPool.js","sourceRoot":"","sources":["../../../src/agent/query-index/workerPool.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,SAAS,CAAC;AACzB,OAAO,IAAI,MAAM,WAAW,CAAC;AAC7B,O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