@illli-studio/mory 0.1.4 → 0.1.6
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/bundle/server.mjs +1 -1
- package/bundle/web/assets/{index-CJ5unMda.js → index-CEbRwYQi.js} +10 -10
- package/bundle/web/index.html +1 -1
- package/client/index.d.ts +4 -0
- package/client/index.js +1 -0
- package/package.json +1 -1
- package/src/cli.mjs +1 -1
- package/src/mcp.mjs +3 -1
package/bundle/web/index.html
CHANGED
|
@@ -7,7 +7,7 @@
|
|
|
7
7
|
<link rel="icon" type="image/svg+xml" href="/mory-logo-premium.svg" />
|
|
8
8
|
<link rel="apple-touch-icon" href="/mory-logo-premium.svg" />
|
|
9
9
|
<title>Mory</title>
|
|
10
|
-
<script type="module" crossorigin src="/assets/index-
|
|
10
|
+
<script type="module" crossorigin src="/assets/index-CEbRwYQi.js"></script>
|
|
11
11
|
<link rel="stylesheet" crossorigin href="/assets/index-BAhB-d6Z.css">
|
|
12
12
|
</head>
|
|
13
13
|
<body>
|
package/client/index.d.ts
CHANGED
|
@@ -43,6 +43,10 @@ export declare class MoryClient {
|
|
|
43
43
|
duplicateCount: number;
|
|
44
44
|
}>;
|
|
45
45
|
get(id: string): Promise<Record<string, unknown>>;
|
|
46
|
+
update(id: string, input: Partial<RememberInput> & {
|
|
47
|
+
title?: string;
|
|
48
|
+
tags?: string[];
|
|
49
|
+
}): Promise<Record<string, unknown>>;
|
|
46
50
|
forget(id: string): Promise<{
|
|
47
51
|
ok: boolean;
|
|
48
52
|
}>;
|
package/client/index.js
CHANGED
|
@@ -12,5 +12,6 @@ export class MoryClient {
|
|
|
12
12
|
export() { return this.request("/v1/export", { method: "GET" }); }
|
|
13
13
|
import(memories) { return this.request("/v1/import", { method: "POST", body: JSON.stringify({ memories }) }); }
|
|
14
14
|
get(id) { return this.request(`/v1/memories/${encodeURIComponent(id)}`, { method: "GET" }); }
|
|
15
|
+
update(id, input) { return this.request(`/v1/memories/${encodeURIComponent(id)}`, { method: "PATCH", body: JSON.stringify(input) }); }
|
|
15
16
|
forget(id) { return this.request(`/v1/memories/${encodeURIComponent(id)}`, { method: "DELETE" }); }
|
|
16
17
|
}
|
package/package.json
CHANGED
package/src/cli.mjs
CHANGED
|
@@ -8,7 +8,7 @@ import { fileURLToPath } from "node:url";
|
|
|
8
8
|
import { runMcp } from "./mcp.mjs";
|
|
9
9
|
|
|
10
10
|
const packageRoot = resolve(fileURLToPath(new URL("..", import.meta.url)));
|
|
11
|
-
const runtimeVersion = "0.1.
|
|
11
|
+
const runtimeVersion = "0.1.6";
|
|
12
12
|
const repoRoot = resolve(packageRoot, "../..");
|
|
13
13
|
const dataDir = process.env.MORY_HOME || join(homedir(), ".mory");
|
|
14
14
|
const configPath = join(dataDir, "config.json");
|
package/src/mcp.mjs
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
const protocolVersion = "2025-06-18";
|
|
2
|
-
const runtimeVersion = "0.1.
|
|
2
|
+
const runtimeVersion = "0.1.6";
|
|
3
3
|
|
|
4
4
|
async function callApi(baseUrl, token, path, method = "POST", body) {
|
|
5
5
|
const response = await fetch(baseUrl.replace(/\/$/, "") + path, { method, headers: { authorization: `Bearer ${token}`, "content-type": "application/json" }, body: body === undefined ? undefined : JSON.stringify(body) });
|
|
@@ -14,6 +14,7 @@ const tools = [
|
|
|
14
14
|
{ name: "mory_context", description: "Retrieve relevant memory as prompt-ready context.", inputSchema: { type: "object", properties: { query: { type: "string" }, projectId: { type: "string" }, limit: { type: "number" } }, required: ["query"] } },
|
|
15
15
|
{ name: "mory_get", description: "Get one local Mory memory by id.", inputSchema: { type: "object", properties: { memoryId: { type: "string" } }, required: ["memoryId"] } },
|
|
16
16
|
{ name: "mory_list", description: "List recent local Mory memories.", inputSchema: { type: "object", properties: { projectId: { type: "string" }, limit: { type: "number" } } } },
|
|
17
|
+
{ name: "mory_update", description: "Update the content or metadata of an existing local Mory memory.", inputSchema: { type: "object", properties: { memoryId: { type: "string" }, text: { type: "string" }, title: { type: "string" }, kind: { type: "string" }, tags: { type: "array", items: { type: "string" } }, metadata: { type: "object" } }, required: ["memoryId"] } },
|
|
17
18
|
{ name: "mory_forget", description: "Delete a memory by id using Mory's tombstone deletion.", inputSchema: { type: "object", properties: { memoryId: { type: "string" } }, required: ["memoryId"] } }
|
|
18
19
|
];
|
|
19
20
|
|
|
@@ -29,6 +30,7 @@ async function handle(message, options) {
|
|
|
29
30
|
else if (name === "mory_context") result = await callApi(options.baseUrl, options.token, "/v1/context", "POST", { query: input.query, limit: input.limit || 12, scope: input.projectId ? { projectId: input.projectId } : {} });
|
|
30
31
|
else if (name === "mory_get") result = await callApi(options.baseUrl, options.token, `/v1/memories/${encodeURIComponent(input.memoryId)}`, "GET");
|
|
31
32
|
else if (name === "mory_list") result = await callApi(options.baseUrl, options.token, `/v1/memories?limit=${encodeURIComponent(input.limit || 20)}${input.projectId ? `&projectId=${encodeURIComponent(input.projectId)}` : ""}`, "GET");
|
|
33
|
+
else if (name === "mory_update") result = await callApi(options.baseUrl, options.token, `/v1/memories/${encodeURIComponent(input.memoryId)}`, "PATCH", { text: input.text, title: input.title, kind: input.kind, tags: input.tags, metadata: input.metadata });
|
|
32
34
|
else if (name === "mory_forget") result = await callApi(options.baseUrl, options.token, `/v1/memories/${encodeURIComponent(input.memoryId)}`, "DELETE");
|
|
33
35
|
else throw new Error(`Unknown tool: ${name}`);
|
|
34
36
|
return { content: [{ type: "text", text: JSON.stringify(result, null, 2) }] };
|