@illli-studio/mory 0.1.3 → 0.1.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/README.md +1 -0
- package/package.json +1 -1
- package/src/cli.mjs +3 -1
- package/src/mcp.mjs +2 -1
package/README.md
CHANGED
package/package.json
CHANGED
package/src/cli.mjs
CHANGED
|
@@ -8,6 +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.4";
|
|
11
12
|
const repoRoot = resolve(packageRoot, "../..");
|
|
12
13
|
const dataDir = process.env.MORY_HOME || join(homedir(), ".mory");
|
|
13
14
|
const configPath = join(dataDir, "config.json");
|
|
@@ -103,7 +104,8 @@ async function importMemories(inputPath) {
|
|
|
103
104
|
|
|
104
105
|
const [command = "start", ...args] = process.argv.slice(2);
|
|
105
106
|
try {
|
|
106
|
-
if (command === "
|
|
107
|
+
if (command === "--version" || command === "-v" || command === "version") console.log(runtimeVersion);
|
|
108
|
+
else if (command === "init") { config(); console.log(`Initialized Mory at ${dataDir}`); }
|
|
107
109
|
else if (command === "start") await start(args.includes("--background") || args.includes("-d"));
|
|
108
110
|
else if (command === "stop") await stop();
|
|
109
111
|
else if (command === "export") await exportMemories(args[0]);
|
package/src/mcp.mjs
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
const protocolVersion = "2025-06-18";
|
|
2
|
+
const runtimeVersion = "0.1.4";
|
|
2
3
|
|
|
3
4
|
async function callApi(baseUrl, token, path, method = "POST", body) {
|
|
4
5
|
const response = await fetch(baseUrl.replace(/\/$/, "") + path, { method, headers: { authorization: `Bearer ${token}`, "content-type": "application/json" }, body: body === undefined ? undefined : JSON.stringify(body) });
|
|
@@ -17,7 +18,7 @@ const tools = [
|
|
|
17
18
|
];
|
|
18
19
|
|
|
19
20
|
async function handle(message, options) {
|
|
20
|
-
if (message.method === "initialize") return { protocolVersion, capabilities: { tools: {} }, serverInfo: { name: "mory", version:
|
|
21
|
+
if (message.method === "initialize") return { protocolVersion, capabilities: { tools: {} }, serverInfo: { name: "mory", version: runtimeVersion } };
|
|
21
22
|
if (message.method === "notifications/initialized") return null;
|
|
22
23
|
if (message.method === "tools/list") return { tools };
|
|
23
24
|
if (message.method !== "tools/call") return {};
|