@aborruso/ckan-mcp-server 0.4.131 → 0.4.132
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/LOG.md +17 -1
- package/dist/index.js +30 -5
- package/package.json +1 -1
package/LOG.md
CHANGED
|
@@ -1,10 +1,26 @@
|
|
|
1
1
|
# LOG
|
|
2
2
|
|
|
3
|
+
## 2026-10-27
|
|
4
|
+
|
|
5
|
+
### v0.4.132
|
|
6
|
+
|
|
7
|
+
Ships #565: worker telemetry logs returned search results. Tests 601 passed. Smoke 16/17: the MQA case times out because data.europa.eu `/api/mqa/cache/datasets/{id}` (and its successor `/resources/{id}`) hang for every dataset id tried, while `/global`, `/countries`, `/catalogues/dati-gov-it` answer in 0.2 s; released anyway on the user's decision. The official spec (`openapi.yaml` 6.0.1-SNAPSHOT) marks `/datasets/{id}` deprecated, alias of `/resources/{id}`: switching is a separate change.
|
|
8
|
+
|
|
9
|
+
### Worker telemetry: returned search results
|
|
10
|
+
|
|
11
|
+
`ckan_package_search` and `ckan_find_relevant_datasets` now record the datasets they return (ids and names in rank order, max 20), the total count (zero included) and the start offset. The worker adds them to its log line (`result_count`, `result_start`, `result_ids`, `result_names`), and the archiver carries them, plus `fq` and `sort`, into `data/worker_events_flat.jsonl`. Goal: query → result pairs for search fine-tuning. No session id exists (stateless worker): a later `package_show` on an id in `result_ids` links to the search. Side channel keyed by the per-request `McpServer` (`src/utils/search-telemetry.ts`), so concurrent requests cannot mix. Checked with `wrangler dev` on dati.gov.it, zero-result case included.
|
|
12
|
+
|
|
13
|
+
## 2026-10-26
|
|
14
|
+
|
|
15
|
+
### Update Worker Telemetry: DuckDB pinned to v2.0.0
|
|
16
|
+
|
|
17
|
+
The workflow had failed twice a day since 2026-10-21: DuckDB v2.0.0 (released that day) renamed the CLI asset from `duckdb_cli-linux-amd64.zip` to `duckdb-cli-linux-amd64.tar.gz`, so `releases/latest/download/...zip` returned 404. Now downloads the v2.0.0 tarball explicitly (pinned, so a future rename does not break it again). Checked locally: `scripts/worker_daily_stats.sh` with v2.0.0 and v1.5.6 in UTC gives output identical to the committed `data/worker_daily_calls.jsonl`. Note: v2.0.0 reads `...Z` timestamps as `TIMESTAMPTZ`, so `::TIMESTAMP` follows the machine time zone; on the UTC runner nothing changes, on a non-UTC machine the daily counts shift.
|
|
18
|
+
|
|
3
19
|
## 2026-10-22
|
|
4
20
|
|
|
5
21
|
### v0.4.131
|
|
6
22
|
|
|
7
|
-
Ships #563: Anubis challenge retry with an honest User-Agent (#7). Tests 595 passed, smoke 17/17.
|
|
23
|
+
Ships #563: Anubis challenge retry with an honest User-Agent (#7). Tests 595 passed, smoke 17/17. Live on npm (with provenance; the registry took ~5 min to serve it after the CI publish), the MCP Registry (`isLatest`), the Worker (`/health` 0.4.131) and the GitHub release (DXT + skill attached).
|
|
8
24
|
|
|
9
25
|
### Anubis-fronted portals: retry once with an honest User-Agent (#7)
|
|
10
26
|
|
package/dist/index.js
CHANGED
|
@@ -1122,6 +1122,23 @@ async function makeCkanRequest(serverUrl, action, params = {}, opts = {}) {
|
|
|
1122
1122
|
}
|
|
1123
1123
|
}
|
|
1124
1124
|
|
|
1125
|
+
// src/utils/search-telemetry.ts
|
|
1126
|
+
var SEARCH_TELEMETRY_MAX_RESULTS = 20;
|
|
1127
|
+
var MAX_FIELD_LENGTH = 100;
|
|
1128
|
+
var lastResults = /* @__PURE__ */ new WeakMap();
|
|
1129
|
+
function recordSearchResults(server, count, start, datasets, replyText) {
|
|
1130
|
+
const shown = datasets.filter(
|
|
1131
|
+
(d) => d.id && replyText.includes(d.id) || d.name && replyText.includes(d.name)
|
|
1132
|
+
);
|
|
1133
|
+
const kept = shown.slice(0, SEARCH_TELEMETRY_MAX_RESULTS);
|
|
1134
|
+
lastResults.set(server, {
|
|
1135
|
+
result_count: count,
|
|
1136
|
+
result_start: start,
|
|
1137
|
+
result_ids: kept.map((d) => String(d.id ?? "").slice(0, MAX_FIELD_LENGTH)),
|
|
1138
|
+
result_names: kept.map((d) => String(d.name || d.id || "").slice(0, MAX_FIELD_LENGTH))
|
|
1139
|
+
});
|
|
1140
|
+
}
|
|
1141
|
+
|
|
1125
1142
|
// src/utils/formatting.ts
|
|
1126
1143
|
function truncateText(text, limit = CHARACTER_LIMIT) {
|
|
1127
1144
|
if (text.length <= limit) {
|
|
@@ -2248,8 +2265,10 @@ Typical workflow: ckan_status_show (check locale) \u2192 ckan_package_search (qu
|
|
|
2248
2265
|
params.server_url,
|
|
2249
2266
|
effectiveQuery !== params.q ? effectiveQuery : void 0
|
|
2250
2267
|
);
|
|
2268
|
+
const text2 = truncateJson(compact);
|
|
2269
|
+
recordSearchResults(server, result.count ?? 0, effectiveStart, result.results ?? [], text2);
|
|
2251
2270
|
return {
|
|
2252
|
-
content: [{ type: "text", text:
|
|
2271
|
+
content: [{ type: "text", text: text2 }]
|
|
2253
2272
|
};
|
|
2254
2273
|
}
|
|
2255
2274
|
let hvdNote = "";
|
|
@@ -2379,8 +2398,10 @@ Note: showing top ${sorted.length} only. Use \`response_format: json\` for full
|
|
|
2379
2398
|
`;
|
|
2380
2399
|
}
|
|
2381
2400
|
}
|
|
2401
|
+
const text = truncateText(addDemoFooter(markdown));
|
|
2402
|
+
recordSearchResults(server, result.count ?? 0, effectiveStart, result.results ?? [], text);
|
|
2382
2403
|
return {
|
|
2383
|
-
content: [{ type: "text", text
|
|
2404
|
+
content: [{ type: "text", text }]
|
|
2384
2405
|
};
|
|
2385
2406
|
} catch (error) {
|
|
2386
2407
|
return {
|
|
@@ -2508,7 +2529,9 @@ Typical workflow: ckan_find_relevant_datasets \u2192 ckan_package_show (inspect
|
|
|
2508
2529
|
results: top
|
|
2509
2530
|
};
|
|
2510
2531
|
if (params.response_format === "json" /* JSON */) {
|
|
2511
|
-
|
|
2532
|
+
const jsonResult = jsonToolResult(payload);
|
|
2533
|
+
recordSearchResults(server, payload.total_results, 0, top, jsonResult.content[0].text);
|
|
2534
|
+
return jsonResult;
|
|
2512
2535
|
}
|
|
2513
2536
|
let markdown = `# Relevant CKAN Datasets
|
|
2514
2537
|
|
|
@@ -2584,8 +2607,10 @@ Typical workflow: ckan_find_relevant_datasets \u2192 ckan_package_show (inspect
|
|
|
2584
2607
|
`;
|
|
2585
2608
|
});
|
|
2586
2609
|
}
|
|
2610
|
+
const text = truncateText(addDemoFooter(markdown));
|
|
2611
|
+
recordSearchResults(server, payload.total_results, 0, top, text);
|
|
2587
2612
|
return {
|
|
2588
|
-
content: [{ type: "text", text
|
|
2613
|
+
content: [{ type: "text", text }]
|
|
2589
2614
|
};
|
|
2590
2615
|
} catch (error) {
|
|
2591
2616
|
return {
|
|
@@ -6117,7 +6142,7 @@ var registerAllPrompts = (server) => {
|
|
|
6117
6142
|
function createServer() {
|
|
6118
6143
|
return new McpServer({
|
|
6119
6144
|
name: "ckan-mcp-server",
|
|
6120
|
-
version: "0.4.
|
|
6145
|
+
version: "0.4.132"
|
|
6121
6146
|
});
|
|
6122
6147
|
}
|
|
6123
6148
|
function registerAll(server) {
|