@appsoftwareltd/etherpk-mcp 0.19.3 → 0.19.4
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/main.js +17 -4
- package/dist/main.js.map +1 -1
- package/package.json +6 -6
package/dist/main.js
CHANGED
|
@@ -714,7 +714,7 @@ function looksLikeAgentSetupCode(value) {
|
|
|
714
714
|
}
|
|
715
715
|
var package_default = {
|
|
716
716
|
name: "@appsoftwareltd/etherpk-mcp",
|
|
717
|
-
version: "0.19.
|
|
717
|
+
version: "0.19.4",
|
|
718
718
|
license: "Elastic-2.0",
|
|
719
719
|
description: "EtherPK Headless Client: an MCP server over a synced knowledge graph, run beside the agent on the user's own machine.",
|
|
720
720
|
type: "module",
|
|
@@ -1688,6 +1688,13 @@ var SyncApiError = class extends Error {
|
|
|
1688
1688
|
this.connectionKind = connectionKind;
|
|
1689
1689
|
}
|
|
1690
1690
|
};
|
|
1691
|
+
/**
|
|
1692
|
+
* A write names its type even with no body: a built SvelteKit server refuses a cross-origin write
|
|
1693
|
+
* that names none before the route runs, and a browser reports that as "Failed to fetch".
|
|
1694
|
+
*/
|
|
1695
|
+
function contentTypeHeader(method = "GET") {
|
|
1696
|
+
return method === "GET" ? {} : { "Content-Type": "application/json" };
|
|
1697
|
+
}
|
|
1691
1698
|
function createSyncApi(deps) {
|
|
1692
1699
|
const f = deps.fetch ?? fetch;
|
|
1693
1700
|
const base = deps.baseUrl.replace(/\/$/, "");
|
|
@@ -1697,7 +1704,7 @@ function createSyncApi(deps) {
|
|
|
1697
1704
|
...init,
|
|
1698
1705
|
headers: {
|
|
1699
1706
|
Authorization: `Bearer ${token}`,
|
|
1700
|
-
...init?.
|
|
1707
|
+
...contentTypeHeader(init?.method),
|
|
1701
1708
|
...init?.headers
|
|
1702
1709
|
}
|
|
1703
1710
|
});
|
|
@@ -2762,7 +2769,10 @@ async function revokeHeldToken(call) {
|
|
|
2762
2769
|
try {
|
|
2763
2770
|
return (await (call.fetch ?? fetch)(`${base(call.syncServer)}/api/v1/sync/tokens/current`, {
|
|
2764
2771
|
method: "DELETE",
|
|
2765
|
-
headers: {
|
|
2772
|
+
headers: {
|
|
2773
|
+
"content-type": "application/json",
|
|
2774
|
+
authorization: `Bearer ${call.token}`
|
|
2775
|
+
}
|
|
2766
2776
|
})).ok;
|
|
2767
2777
|
} catch {
|
|
2768
2778
|
return false;
|
|
@@ -27309,7 +27319,10 @@ function api(deps) {
|
|
|
27309
27319
|
return {
|
|
27310
27320
|
f: deps.fetch ?? fetch,
|
|
27311
27321
|
base: deps.baseUrl.replace(/\/$/, ""),
|
|
27312
|
-
headers: async () => ({
|
|
27322
|
+
headers: async () => ({
|
|
27323
|
+
"x-sync-token": await deps.syncToken(),
|
|
27324
|
+
"Content-Type": "application/json"
|
|
27325
|
+
})
|
|
27313
27326
|
};
|
|
27314
27327
|
}
|
|
27315
27328
|
/**
|