arkaik-mcp 0.8.0 → 0.8.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/dist/index.js +30 -3
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -20605,11 +20605,38 @@ function createRemoteStore(options) {
|
|
|
20605
20605
|
}
|
|
20606
20606
|
return body;
|
|
20607
20607
|
}
|
|
20608
|
+
const lastRead = /* @__PURE__ */ new Map();
|
|
20609
|
+
async function read(path) {
|
|
20610
|
+
const cached2 = lastRead.get(path);
|
|
20611
|
+
const res = await doFetch(`${projectPath}${path}`, {
|
|
20612
|
+
headers: {
|
|
20613
|
+
authorization: `Bearer ${options.token}`,
|
|
20614
|
+
...cached2 ? { "if-none-match": cached2.etag } : {}
|
|
20615
|
+
}
|
|
20616
|
+
});
|
|
20617
|
+
if (res.status === 304 && cached2) return JSON.parse(cached2.text);
|
|
20618
|
+
const text = await res.text();
|
|
20619
|
+
let body = null;
|
|
20620
|
+
try {
|
|
20621
|
+
body = JSON.parse(text);
|
|
20622
|
+
} catch {
|
|
20623
|
+
}
|
|
20624
|
+
if (!res.ok) {
|
|
20625
|
+
const err = new Error(describeFailure(res.status, body));
|
|
20626
|
+
err.status = res.status;
|
|
20627
|
+
err.body = body;
|
|
20628
|
+
throw err;
|
|
20629
|
+
}
|
|
20630
|
+
const etag = res.headers.get("etag");
|
|
20631
|
+
if (etag) lastRead.set(path, { etag, text });
|
|
20632
|
+
else lastRead.delete(path);
|
|
20633
|
+
return body;
|
|
20634
|
+
}
|
|
20608
20635
|
return {
|
|
20609
20636
|
async load() {
|
|
20610
20637
|
const [{ bundle }, { journal }] = await Promise.all([
|
|
20611
|
-
|
|
20612
|
-
|
|
20638
|
+
read(""),
|
|
20639
|
+
read("/journal")
|
|
20613
20640
|
]);
|
|
20614
20641
|
const nodes = bundle.nodes ?? [];
|
|
20615
20642
|
const edges = bundle.edges ?? [];
|
|
@@ -20771,7 +20798,7 @@ function resolveRemoteConfig(argv2, env, cwd) {
|
|
|
20771
20798
|
}
|
|
20772
20799
|
|
|
20773
20800
|
// src/index.ts
|
|
20774
|
-
var VERSION = "0.8.
|
|
20801
|
+
var VERSION = "0.8.1";
|
|
20775
20802
|
var argv = process.argv.slice(2);
|
|
20776
20803
|
if (argv.includes("--help") || argv.includes("-h")) {
|
|
20777
20804
|
process.stdout.write(
|
package/package.json
CHANGED