cuemap-mcp 0.7.1 → 0.7.3
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/README.md +129 -17
- package/SKILL.md +647 -0
- package/build/index.js +743 -135
- package/build/job-status.js +44 -0
- package/build/recall-result.js +53 -0
- package/package.json +13 -6
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.evaluateJobStatus = evaluateJobStatus;
|
|
4
|
+
const TERMINAL_PHASES = new Set(["done", "idle"]);
|
|
5
|
+
function evaluateJobStatus(status, previouslyObservedActivity = false) {
|
|
6
|
+
const phase = String(status.phase || "").toLowerCase();
|
|
7
|
+
const writesCompleted = Number.isFinite(status.writes_completed)
|
|
8
|
+
? Math.max(0, status.writes_completed)
|
|
9
|
+
: 0;
|
|
10
|
+
const writesTotal = Number.isFinite(status.writes_total)
|
|
11
|
+
? Math.max(0, status.writes_total)
|
|
12
|
+
: 0;
|
|
13
|
+
const intentCompleted = Number.isFinite(status.intent_completed)
|
|
14
|
+
? Math.max(0, status.intent_completed || 0)
|
|
15
|
+
: 0;
|
|
16
|
+
const intentTotal = Number.isFinite(status.intent_total)
|
|
17
|
+
? Math.max(0, status.intent_total || 0)
|
|
18
|
+
: 0;
|
|
19
|
+
const intentFailed = Number.isFinite(status.intent_failed)
|
|
20
|
+
? Math.max(0, status.intent_failed || 0)
|
|
21
|
+
: 0;
|
|
22
|
+
const pendingWrites = Math.max(0, writesTotal - writesCompleted);
|
|
23
|
+
const pendingIntents = Math.max(0, intentTotal - intentCompleted - intentFailed);
|
|
24
|
+
const active = !TERMINAL_PHASES.has(phase) || pendingWrites > 0 || pendingIntents > 0;
|
|
25
|
+
const observedActivity = previouslyObservedActivity
|
|
26
|
+
|| active
|
|
27
|
+
|| writesCompleted > 0
|
|
28
|
+
|| writesTotal > 0
|
|
29
|
+
|| intentCompleted > 0
|
|
30
|
+
|| intentTotal > 0
|
|
31
|
+
|| intentFailed > 0;
|
|
32
|
+
return {
|
|
33
|
+
active,
|
|
34
|
+
observed_activity: observedActivity,
|
|
35
|
+
pending_writes: pendingWrites,
|
|
36
|
+
pending_intents: pendingIntents,
|
|
37
|
+
verified_complete: observedActivity
|
|
38
|
+
&& TERMINAL_PHASES.has(phase)
|
|
39
|
+
&& pendingWrites === 0
|
|
40
|
+
&& pendingIntents === 0
|
|
41
|
+
&& intentFailed === 0
|
|
42
|
+
&& status.intent_ready !== false,
|
|
43
|
+
};
|
|
44
|
+
}
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.memoryToolResult = memoryToolResult;
|
|
4
|
+
exports.recallToolResult = recallToolResult;
|
|
5
|
+
function isObject(value) {
|
|
6
|
+
return value !== null && typeof value === "object" && !Array.isArray(value);
|
|
7
|
+
}
|
|
8
|
+
function memoryToolResult(response) {
|
|
9
|
+
if (!isObject(response) || typeof response.content !== "string") {
|
|
10
|
+
throw new Error("Decoded memory content unavailable; update the CueMap engine to support GET /memories/:id?decoded=true");
|
|
11
|
+
}
|
|
12
|
+
return {
|
|
13
|
+
content: [{ type: "text", text: JSON.stringify(response, null, 2) }],
|
|
14
|
+
structuredContent: response,
|
|
15
|
+
};
|
|
16
|
+
}
|
|
17
|
+
/** Preserve engine envelopes (including per-project errors and diagnostics).
|
|
18
|
+
* IDs are only meaningful together with their owning project. */
|
|
19
|
+
function recallToolResult(response, fallbackProject, options = {}) {
|
|
20
|
+
if (!isObject(response) || !Array.isArray(response.results)) {
|
|
21
|
+
throw new Error("CueMap returned an invalid recall response: expected results array");
|
|
22
|
+
}
|
|
23
|
+
if (options.response_mode === "preview" && response.response_mode !== "preview") {
|
|
24
|
+
throw new Error("Preview responses require an updated CueMap engine");
|
|
25
|
+
}
|
|
26
|
+
function withEvidenceHandles(item, project) {
|
|
27
|
+
if (!isObject(item))
|
|
28
|
+
return item;
|
|
29
|
+
const owner = typeof item.project_id === "string" ? item.project_id : project;
|
|
30
|
+
if (Array.isArray(item.results)) {
|
|
31
|
+
return {
|
|
32
|
+
...item,
|
|
33
|
+
...(owner === undefined ? {} : { project_id: owner }),
|
|
34
|
+
results: item.results.map(result => withEvidenceHandles(result, owner)),
|
|
35
|
+
};
|
|
36
|
+
}
|
|
37
|
+
// Engine HTTP responses use id; some clients expose memory_id instead.
|
|
38
|
+
const id = item.memory_id ?? item.id;
|
|
39
|
+
const validId = typeof id === "number" && Number.isInteger(id)
|
|
40
|
+
&& id >= 0 && id <= 4_294_967_295;
|
|
41
|
+
return {
|
|
42
|
+
...item,
|
|
43
|
+
...(owner === undefined ? {} : { project_id: owner }),
|
|
44
|
+
...(validId ? { memory_id: id } : {}),
|
|
45
|
+
};
|
|
46
|
+
}
|
|
47
|
+
const structuredContent = withEvidenceHandles(response, fallbackProject);
|
|
48
|
+
return {
|
|
49
|
+
// The same evidence is available to text-only and structured MCP clients.
|
|
50
|
+
content: [{ type: "text", text: JSON.stringify(structuredContent, null, 2) }],
|
|
51
|
+
structuredContent,
|
|
52
|
+
};
|
|
53
|
+
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "cuemap-mcp",
|
|
3
|
-
"version": "0.7.
|
|
3
|
+
"version": "0.7.3",
|
|
4
4
|
"description": "MCP server for CueMap",
|
|
5
5
|
"main": "build/index.js",
|
|
6
6
|
"bin": {
|
|
@@ -9,12 +9,17 @@
|
|
|
9
9
|
"files": [
|
|
10
10
|
"build",
|
|
11
11
|
"README.md",
|
|
12
|
+
"SKILL.md",
|
|
12
13
|
"LICENSE"
|
|
13
14
|
],
|
|
14
15
|
"scripts": {
|
|
15
16
|
"build": "tsc",
|
|
17
|
+
"test": "npm run build && node scripts/run-tests.cjs",
|
|
18
|
+
"test:e2e": "npm run build && node scripts/run-e2e.cjs",
|
|
19
|
+
"test:pack": "node scripts/verify-packed-install.cjs",
|
|
16
20
|
"start": "node build/index.js",
|
|
17
|
-
"dev": "tsc --watch"
|
|
21
|
+
"dev": "tsc --watch",
|
|
22
|
+
"prepublishOnly": "npm test"
|
|
18
23
|
},
|
|
19
24
|
"keywords": [
|
|
20
25
|
"mcp",
|
|
@@ -32,7 +37,7 @@
|
|
|
32
37
|
"type": "commonjs",
|
|
33
38
|
"dependencies": {
|
|
34
39
|
"@modelcontextprotocol/sdk": "^1.27.1",
|
|
35
|
-
"cuemap": "
|
|
40
|
+
"cuemap": "0.7.3",
|
|
36
41
|
"zod": "^4.3.6"
|
|
37
42
|
},
|
|
38
43
|
"devDependencies": {
|
|
@@ -40,8 +45,10 @@
|
|
|
40
45
|
"typescript": "^5.9.3"
|
|
41
46
|
},
|
|
42
47
|
"optionalDependencies": {
|
|
43
|
-
"@cuemap-dev/engine-darwin-arm64": "
|
|
44
|
-
"@cuemap-dev/engine-darwin-x64": "
|
|
45
|
-
"@cuemap-dev/engine-linux-
|
|
48
|
+
"@cuemap-dev/engine-darwin-arm64": "0.7.3",
|
|
49
|
+
"@cuemap-dev/engine-darwin-x64": "0.7.3",
|
|
50
|
+
"@cuemap-dev/engine-linux-arm64": "0.7.3",
|
|
51
|
+
"@cuemap-dev/engine-linux-x64": "0.7.3",
|
|
52
|
+
"@cuemap-dev/engine-win32-x64": "0.7.3"
|
|
46
53
|
}
|
|
47
54
|
}
|