@2kw/ai-mcp-server 7.2.1 → 7.3.0-dev.10

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.
@@ -96,7 +96,7 @@ function connectorApproval(i) {
96
96
  /**
97
97
  * Output item types the envelope decodes, or that never hold a run: text, reasoning and finished
98
98
  * connector calls. A pause on anything else is named.
99
- * `backbone:tool_image` is an image a finished `ViewImage` call attached (#1244): it never holds a run.
99
+ * `backbone:tool_image` is an image a finished `ViewImage` call or a connector call attached (#1244, #844): it never holds a run.
100
100
  */
101
101
  const DECODED_ITEM_TYPES = new Set([
102
102
  "message",
@@ -236,6 +236,37 @@ export function register(server, client) {
236
236
  };
237
237
  }
238
238
  });
239
+ // ── bulk_rerun_extractions ──────────────────────────────────────────────
240
+ server.tool("2kw_bulk_rerun_extractions", "Queue re-runs of up to 100 extractions, selected either by extractionIds or by a filter (status, schemaVersionId, search) — not both. Each eligible extraction becomes a new PENDING extraction; poll it with 2kw_get_extraction. Extractions still running, vision-only, or whose schema version was deleted are reported as SKIPPED with a reason; unknown IDs as NOT_FOUND.", {
241
+ extractionIds: z.array(z.string()).max(100).optional().describe("Extraction IDs to re-run"),
242
+ status: z
243
+ .enum(["PENDING", "PROCESSING", "COMPLETED", "FAILED"])
244
+ .optional()
245
+ .describe("Re-run extractions with this status, e.g. FAILED"),
246
+ schemaVersionId: z.string().optional().describe("Re-run extractions of this schema version"),
247
+ search: z.string().optional().describe("Re-run extractions whose model contains this text"),
248
+ }, async ({ extractionIds, status, schemaVersionId, search }) => {
249
+ try {
250
+ const { data } = await client.POST("/v1/extractions/rerun", {
251
+ body: { ids: extractionIds, status, schemaVersionId, search },
252
+ });
253
+ const lines = (data?.results ?? []).map((r) => `${r.extractionId}: ${r.outcome}${r.rerunId ? ` -> ${r.rerunId}` : ""}${r.reason ? ` (${r.reason})` : ""}`);
254
+ return {
255
+ content: [
256
+ {
257
+ type: "text",
258
+ text: `Queued ${data?.queued ?? 0}, skipped ${data?.skipped ?? 0}\n${lines.join("\n")}`,
259
+ },
260
+ ],
261
+ };
262
+ }
263
+ catch (error) {
264
+ return {
265
+ content: [{ type: "text", text: formatErrorForMcp(error) }],
266
+ isError: true,
267
+ };
268
+ }
269
+ });
239
270
  }
240
271
  function formatExtractionResult(extraction) {
241
272
  const parts = [];
@@ -37,6 +37,8 @@ const TEXT_SEARCH_LANGUAGES = [
37
37
  "turkish",
38
38
  "yiddish",
39
39
  ];
40
+ const textSearchLanguagesMatchTheApi = true;
41
+ void textSearchLanguagesMatchTheApi;
40
42
  /**
41
43
  * Fields shared by knowledge-base create and update — the backend treats
42
44
  * every one of these as mandatory on both requests (name, slug,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@2kw/ai-mcp-server",
3
- "version": "7.2.1",
3
+ "version": "7.3.0-dev.10",
4
4
  "description": "MCP server for 2kw.ai — EU-hosted AI platform: OpenAI-compatible LLM gateway, schema-driven document extraction, transcription, agents with a knowledge base, and cost observability. 199 tools for Claude Code, Cursor, and Windsurf.",
5
5
  "mcpName": "ai.2kw/mcp-server",
6
6
  "keywords": [