@maxgfr/codeindex 2.18.0 → 2.19.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 CHANGED
@@ -244,7 +244,13 @@ exactly what it saw before.
244
244
 
245
245
  From `2025-03-26` every tool carries behaviour annotations — `readOnlyHint` on
246
246
  the 21 read tools, `destructiveHint`/`idempotentHint` on the five that write —
247
- which is what lets a host auto-approve reads and confirm only writes.
247
+ which is what lets a host auto-approve reads and confirm only writes. From
248
+ `2025-06-18`, the 15 tools whose result is always a JSON object also declare an
249
+ `outputSchema` and return `structuredContent`, so a client can validate and type
250
+ the result instead of re-parsing a string. The remaining tools return arrays,
251
+ argument-dependent shapes or plain text, which cannot yield a conforming
252
+ structured result without diverging from the text block — they are left
253
+ unschema'd rather than described inaccurately.
248
254
 
249
255
  Responses are capped (`--max-response-bytes`, default 1 MB). Under the cap
250
256
  nothing changes. Over it — where a whole-repo `graph` on a large monorepo runs
package/docs/MIGRATION.md CHANGED
@@ -366,6 +366,16 @@ which is where the 5s → 0.3s figures come from.
366
366
  silently ignored. If you drive this server programmatically with loosely
367
367
  typed arguments, a call that used to fall back to a default now errors —
368
368
  numeric strings (`"50"`) are still accepted.
369
+ - **outputSchema + structuredContent** on the 15 tools whose response is a JSON
370
+ object for every argument combination (scan_summary, graph, symbols, callers,
371
+ workspaces, churn, find_references, hotspots, coupling, embed_status, the
372
+ three symbolic edits, write_memory, delete_memory). Additive: `content` is
373
+ unchanged, `structuredContent` is added beside it, and both are gated on the
374
+ negotiated version. The other 11 tools deliberately have no schema — array
375
+ responses and argument-dependent shapes cannot produce a conforming object
376
+ without either diverging from `content` or breaking existing clients, and
377
+ repo_map/mermaid/read_memory are not JSON. structuredContent is also withheld
378
+ when the response was capped, since the truncation notice would not conform.
369
379
  - **New optional tool arguments**, all defaulting to today's behaviour:
370
380
  `find_symbol.maxResults`, `complexity.top`, `complexity.since` (risk mode
371
381
  previously dropped it), `mermaid.maxEdges`, `dead_code.limit`, `grep.scope`
@@ -374,6 +384,16 @@ which is where the 5s → 0.3s figures come from.
374
384
  - **Session cache is a 4-entry LRU**, not one entry, so alternating repos or
375
385
  scopes no longer forces a cold rebuild each call.
376
386
 
387
+ ### src/mcp.ts is now a facade over src/mcp/
388
+
389
+ The server split into `src/mcp/protocol.ts` (version negotiation, argument
390
+ validation, the response guard), `src/mcp/tools.ts` (tool definitions, metadata,
391
+ output schemas) and `src/mcp/session.ts` (the scan/artifacts LRU and the embed
392
+ memoization). `src/mcp.ts` keeps `callTool` + `runMcpServer` and **re-exports
393
+ every symbol that used to live there**, so imports from `"./mcp.js"` are
394
+ unaffected. New exports available either way: `TOOLS`, `TOOL_META`,
395
+ `OUTPUT_SCHEMAS`, `annotationsFor`, `toolsFor`, `structuredContentFor`.
396
+
377
397
  ### New CLI flags
378
398
 
379
399
  `--workers <n>` (index), `--index <dir>` and `--no-index-cache` (read commands),
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@maxgfr/codeindex",
3
- "version": "2.18.0",
3
+ "version": "2.19.1",
4
4
  "description": "Self-contained, deterministic repo-indexing engine: walk + language detection + symbol/import extraction (tree-sitter AST with regex fallback) + import resolution + typed cross-file link-graph + analytics. Ships as a single zero-dependency engine.mjs that consumer tools vendor.",
5
5
  "type": "module",
6
6
  "packageManager": "pnpm@10.33.0",
@@ -1,4 +1,4 @@
1
- declare const ENGINE_VERSION = "2.18.0";
1
+ declare const ENGINE_VERSION = "2.19.1";
2
2
  declare const SCHEMA_VERSION = 4;
3
3
  declare const EXTRACTOR_VERSION = 10;
4
4
  type FileKind = "code" | "doc" | "config" | "asset" | "other";
@@ -347,7 +347,7 @@ declare function extractAst(rel: string, ext: string, content: string, opts?: {
347
347
  imports?: boolean;
348
348
  }): AstResult | undefined;
349
349
 
350
- declare const DEFAULT_GRAMMARS_URL = "https://github.com/maxgfr/codeindex/releases/download/v2.18.0/grammars-2.18.0.tar.gz";
350
+ declare const DEFAULT_GRAMMARS_URL = "https://github.com/maxgfr/codeindex/releases/download/v2.19.1/grammars-2.19.1.tar.gz";
351
351
  interface GrammarsPullTarget {
352
352
  url: string;
353
353
  sha256Url?: string;