@agentskit/doc-bridge 1.2.4 → 1.2.6

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/dist/index.d.ts CHANGED
@@ -1535,7 +1535,11 @@ type McpContext = {
1535
1535
  };
1536
1536
  declare const MCP_TOOLS: readonly [{
1537
1537
  readonly name: "handoff.resolve";
1538
- readonly description: "Resolve a package or ownership id to an AgentHandoff.";
1538
+ readonly title: "Resolve repository handoff";
1539
+ readonly description: "Resolve a package or ownership id to its deterministic AgentHandoff.";
1540
+ readonly annotations: {
1541
+ readonly readOnlyHint: true;
1542
+ };
1539
1543
  readonly inputSchema: {
1540
1544
  readonly type: "object";
1541
1545
  readonly properties: {
@@ -1551,7 +1555,11 @@ declare const MCP_TOOLS: readonly [{
1551
1555
  };
1552
1556
  }, {
1553
1557
  readonly name: "doc.search";
1554
- readonly description: "Search the deterministic doc-bridge index.";
1558
+ readonly title: "Search repository documentation";
1559
+ readonly description: "Search the deterministic Doc Bridge index for repository documentation.";
1560
+ readonly annotations: {
1561
+ readonly readOnlyHint: true;
1562
+ };
1555
1563
  readonly inputSchema: {
1556
1564
  readonly type: "object";
1557
1565
  readonly properties: {
@@ -1566,7 +1574,11 @@ declare const MCP_TOOLS: readonly [{
1566
1574
  };
1567
1575
  }, {
1568
1576
  readonly name: "doc.get";
1569
- readonly description: "Read an indexed agent documentation file by id or path.";
1577
+ readonly title: "Read indexed documentation";
1578
+ readonly description: "Read one indexed agent documentation file by id or indexed path.";
1579
+ readonly annotations: {
1580
+ readonly readOnlyHint: true;
1581
+ };
1570
1582
  readonly inputSchema: {
1571
1583
  readonly type: "object";
1572
1584
  readonly properties: {
@@ -1580,14 +1592,22 @@ declare const MCP_TOOLS: readonly [{
1580
1592
  };
1581
1593
  }, {
1582
1594
  readonly name: "gate.status";
1583
- readonly description: "Run the index-freshness gate.";
1595
+ readonly title: "Check documentation gates";
1596
+ readonly description: "Evaluate documentation gates without writing files.";
1597
+ readonly annotations: {
1598
+ readonly readOnlyHint: true;
1599
+ };
1584
1600
  readonly inputSchema: {
1585
1601
  readonly type: "object";
1586
1602
  readonly properties: {};
1587
1603
  };
1588
1604
  }, {
1589
1605
  readonly name: "retriever.query";
1590
- readonly description: "Return local doc-bridge retriever chunks for a query.";
1606
+ readonly title: "Retrieve documentation context";
1607
+ readonly description: "Return relevant local Doc Bridge index chunks for a query.";
1608
+ readonly annotations: {
1609
+ readonly readOnlyHint: true;
1610
+ };
1591
1611
  readonly inputSchema: {
1592
1612
  readonly type: "object";
1593
1613
  readonly properties: {
@@ -1602,21 +1622,33 @@ declare const MCP_TOOLS: readonly [{
1602
1622
  };
1603
1623
  }, {
1604
1624
  readonly name: "memory.classify";
1605
- readonly description: "Classify local memory candidates into agent/human/playbook/discard routes.";
1625
+ readonly title: "Classify memory candidates";
1626
+ readonly description: "Classify local memory candidates into agent, human, playbook, or discard routes.";
1627
+ readonly annotations: {
1628
+ readonly readOnlyHint: true;
1629
+ };
1606
1630
  readonly inputSchema: {
1607
1631
  readonly type: "object";
1608
1632
  readonly properties: {};
1609
1633
  };
1610
1634
  }, {
1611
1635
  readonly name: "memory.promoteDraft";
1612
- readonly description: "Build a safe draft promotion body for local memory candidates.";
1636
+ readonly title: "Draft memory promotion";
1637
+ readonly description: "Build a reviewable draft promotion body from local memory candidates without publishing it.";
1638
+ readonly annotations: {
1639
+ readonly readOnlyHint: true;
1640
+ };
1613
1641
  readonly inputSchema: {
1614
1642
  readonly type: "object";
1615
1643
  readonly properties: {};
1616
1644
  };
1617
1645
  }, {
1618
1646
  readonly name: "registry.topology";
1619
- readonly description: "Return the doc-curator registry topology.";
1647
+ readonly title: "Inspect registry topology";
1648
+ readonly description: "Return the static Doc Bridge curator and delegate topology.";
1649
+ readonly annotations: {
1650
+ readonly readOnlyHint: true;
1651
+ };
1620
1652
  readonly inputSchema: {
1621
1653
  readonly type: "object";
1622
1654
  readonly properties: {};
@@ -1813,7 +1845,7 @@ declare const chunksFromMarkdown: (property: string, raw: string, sourceUrl: str
1813
1845
  declare const loadFederatedChunks: (root: string, config: DocBridgeConfigV1, options?: FederatedRetrieverOptions) => Promise<DocBridgeRetrievedChunk[]>;
1814
1846
  declare const retrieveHybridChunks: (root: string, config: DocBridgeConfigV1, index: DocBridgeIndexV1, query: string, options?: FederatedRetrieverOptions) => Promise<DocBridgeRetrievedChunk[]>;
1815
1847
 
1816
- declare const PACKAGE_VERSION = "1.2.4";
1848
+ declare const PACKAGE_VERSION = "1.2.6";
1817
1849
 
1818
1850
  type FrontmatterValue = string | boolean | readonly string[];
1819
1851
  type FrontmatterData = Record<string, FrontmatterValue>;
package/dist/index.js CHANGED
@@ -1534,7 +1534,7 @@ var buildLookup = (config, packages, corpus, indexOutFile, humanDocs = {}, root
1534
1534
  };
1535
1535
 
1536
1536
  // src/version.ts
1537
- var PACKAGE_VERSION = "1.2.4";
1537
+ var PACKAGE_VERSION = "1.2.6";
1538
1538
 
1539
1539
  // src/index-builder/capabilities.ts
1540
1540
  var renderCapabilitiesJson = (config, index, paths) => {
@@ -3130,7 +3130,9 @@ var runQuery = (index, config, req) => {
3130
3130
  var MCP_TOOLS = [
3131
3131
  {
3132
3132
  name: "handoff.resolve",
3133
- description: "Resolve a package or ownership id to an AgentHandoff.",
3133
+ title: "Resolve repository handoff",
3134
+ description: "Resolve a package or ownership id to its deterministic AgentHandoff.",
3135
+ annotations: { readOnlyHint: true },
3134
3136
  inputSchema: {
3135
3137
  type: "object",
3136
3138
  properties: { id: { type: "string" }, kind: { type: "string", enum: ["package", "ownership"] } },
@@ -3139,7 +3141,9 @@ var MCP_TOOLS = [
3139
3141
  },
3140
3142
  {
3141
3143
  name: "doc.search",
3142
- description: "Search the deterministic doc-bridge index.",
3144
+ title: "Search repository documentation",
3145
+ description: "Search the deterministic Doc Bridge index for repository documentation.",
3146
+ annotations: { readOnlyHint: true },
3143
3147
  inputSchema: {
3144
3148
  type: "object",
3145
3149
  properties: { term: { type: "string" }, limit: { type: "number" } },
@@ -3148,7 +3152,9 @@ var MCP_TOOLS = [
3148
3152
  },
3149
3153
  {
3150
3154
  name: "doc.get",
3151
- description: "Read an indexed agent documentation file by id or path.",
3155
+ title: "Read indexed documentation",
3156
+ description: "Read one indexed agent documentation file by id or indexed path.",
3157
+ annotations: { readOnlyHint: true },
3152
3158
  inputSchema: {
3153
3159
  type: "object",
3154
3160
  properties: { id: { type: "string" }, path: { type: "string" } }
@@ -3156,12 +3162,16 @@ var MCP_TOOLS = [
3156
3162
  },
3157
3163
  {
3158
3164
  name: "gate.status",
3159
- description: "Run the index-freshness gate.",
3165
+ title: "Check documentation gates",
3166
+ description: "Evaluate documentation gates without writing files.",
3167
+ annotations: { readOnlyHint: true },
3160
3168
  inputSchema: { type: "object", properties: {} }
3161
3169
  },
3162
3170
  {
3163
3171
  name: "retriever.query",
3164
- description: "Return local doc-bridge retriever chunks for a query.",
3172
+ title: "Retrieve documentation context",
3173
+ description: "Return relevant local Doc Bridge index chunks for a query.",
3174
+ annotations: { readOnlyHint: true },
3165
3175
  inputSchema: {
3166
3176
  type: "object",
3167
3177
  properties: { query: { type: "string" }, limit: { type: "number" } },
@@ -3170,17 +3180,23 @@ var MCP_TOOLS = [
3170
3180
  },
3171
3181
  {
3172
3182
  name: "memory.classify",
3173
- description: "Classify local memory candidates into agent/human/playbook/discard routes.",
3183
+ title: "Classify memory candidates",
3184
+ description: "Classify local memory candidates into agent, human, playbook, or discard routes.",
3185
+ annotations: { readOnlyHint: true },
3174
3186
  inputSchema: { type: "object", properties: {} }
3175
3187
  },
3176
3188
  {
3177
3189
  name: "memory.promoteDraft",
3178
- description: "Build a safe draft promotion body for local memory candidates.",
3190
+ title: "Draft memory promotion",
3191
+ description: "Build a reviewable draft promotion body from local memory candidates without publishing it.",
3192
+ annotations: { readOnlyHint: true },
3179
3193
  inputSchema: { type: "object", properties: {} }
3180
3194
  },
3181
3195
  {
3182
3196
  name: "registry.topology",
3183
- description: "Return the doc-curator registry topology.",
3197
+ title: "Inspect registry topology",
3198
+ description: "Return the static Doc Bridge curator and delegate topology.",
3199
+ annotations: { readOnlyHint: true },
3184
3200
  inputSchema: { type: "object", properties: {} }
3185
3201
  }
3186
3202
  ];
@@ -3297,13 +3313,14 @@ var handleMcpRequest = (ctx, request) => {
3297
3313
  if (request.method?.startsWith("notifications/")) return void 0;
3298
3314
  throw new Error(`Unsupported MCP method "${request.method ?? ""}"`);
3299
3315
  };
3300
- var writeFrame = (payload) => {
3316
+ var writeFrame = (payload, framing) => {
3301
3317
  const body = JSON.stringify(payload);
3302
- process.stdout.write(`Content-Length: ${Buffer.byteLength(body)}\r
3318
+ process.stdout.write(framing === "json-line" ? `${body}
3319
+ ` : `Content-Length: ${Buffer.byteLength(body)}\r
3303
3320
  \r
3304
3321
  ${body}`);
3305
3322
  };
3306
- var respond = (ctx, request) => {
3323
+ var respond = (ctx, request, framing) => {
3307
3324
  if (request.id === void 0) {
3308
3325
  try {
3309
3326
  handleMcpRequest(ctx, request);
@@ -3313,13 +3330,13 @@ var respond = (ctx, request) => {
3313
3330
  }
3314
3331
  try {
3315
3332
  const result = handleMcpRequest(ctx, request);
3316
- writeFrame({ jsonrpc: "2.0", id: request.id, result: result ?? {} });
3333
+ writeFrame({ jsonrpc: "2.0", id: request.id, result: result ?? {} }, framing);
3317
3334
  } catch (error) {
3318
3335
  writeFrame({
3319
3336
  jsonrpc: "2.0",
3320
3337
  id: request.id,
3321
3338
  error: { code: -32e3, message: error instanceof Error ? error.message : String(error) }
3322
- });
3339
+ }, framing);
3323
3340
  }
3324
3341
  };
3325
3342
  var startMcpStdioServer = (ctx) => {
@@ -3327,21 +3344,34 @@ var startMcpStdioServer = (ctx) => {
3327
3344
  process.stdin.on("data", (chunk) => {
3328
3345
  buffer = Buffer.concat([buffer, chunk]);
3329
3346
  while (true) {
3330
- const headerEnd = buffer.indexOf("\r\n\r\n");
3331
- if (headerEnd === -1) return;
3332
- const header = buffer.subarray(0, headerEnd).toString("utf8");
3333
- const match = /content-length:\s*(\d+)/i.exec(header);
3334
- if (!match?.[1]) {
3335
- buffer = buffer.subarray(headerEnd + 4);
3347
+ if (/^content-length:/i.test(buffer.subarray(0, Math.min(buffer.length, 32)).toString("utf8"))) {
3348
+ const headerEnd = buffer.indexOf("\r\n\r\n");
3349
+ if (headerEnd === -1) return;
3350
+ const header = buffer.subarray(0, headerEnd).toString("utf8");
3351
+ const match = /content-length:\s*(\d+)/i.exec(header);
3352
+ if (!match?.[1]) {
3353
+ buffer = buffer.subarray(headerEnd + 4);
3354
+ continue;
3355
+ }
3356
+ const length = Number(match[1]);
3357
+ const bodyStart = headerEnd + 4;
3358
+ const bodyEnd = bodyStart + length;
3359
+ if (buffer.length < bodyEnd) return;
3360
+ const raw2 = buffer.subarray(bodyStart, bodyEnd).toString("utf8");
3361
+ buffer = buffer.subarray(bodyEnd);
3362
+ respond(ctx, JSON.parse(raw2), "content-length");
3336
3363
  continue;
3337
3364
  }
3338
- const length = Number(match[1]);
3339
- const bodyStart = headerEnd + 4;
3340
- const bodyEnd = bodyStart + length;
3341
- if (buffer.length < bodyEnd) return;
3342
- const raw = buffer.subarray(bodyStart, bodyEnd).toString("utf8");
3343
- buffer = buffer.subarray(bodyEnd);
3344
- respond(ctx, JSON.parse(raw));
3365
+ const lineEnd = buffer.indexOf("\n");
3366
+ if (lineEnd === -1) return;
3367
+ const raw = buffer.subarray(0, lineEnd).toString("utf8").trim();
3368
+ buffer = buffer.subarray(lineEnd + 1);
3369
+ if (!raw) continue;
3370
+ try {
3371
+ respond(ctx, JSON.parse(raw), "json-line");
3372
+ } catch {
3373
+ writeFrame({ jsonrpc: "2.0", id: null, error: { code: -32700, message: "Parse error" } }, "json-line");
3374
+ }
3345
3375
  }
3346
3376
  });
3347
3377
  process.stdin.resume();