opencode-fractal-memory 0.3.0 → 0.4.0
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/mcp/server.js +7 -1
- package/dist/mcp-server.js +6 -1
- package/dist/tools/version.js +7 -1
- package/package.json +1 -1
package/dist/mcp/server.js
CHANGED
|
@@ -3,10 +3,16 @@ import { z } from "zod";
|
|
|
3
3
|
import { createSqliteMemoryStore } from "../storage/sqlite";
|
|
4
4
|
import { withMcpLogging, mcpLog } from "./logging";
|
|
5
5
|
import { nodeToPlain, ensureScope, resourceStats } from "./transform";
|
|
6
|
+
import { fileURLToPath } from "node:url";
|
|
7
|
+
import * as path from "node:path";
|
|
8
|
+
import * as fs from "node:fs";
|
|
9
|
+
const __filename = fileURLToPath(import.meta.url);
|
|
10
|
+
const __dirname = path.dirname(__filename);
|
|
11
|
+
const pkg = JSON.parse(fs.readFileSync(path.resolve(__dirname, "../../package.json"), "utf-8"));
|
|
6
12
|
let store;
|
|
7
13
|
export async function createMemoryMcpServer(projectDir, globalDbPath) {
|
|
8
14
|
store = createSqliteMemoryStore(projectDir, globalDbPath);
|
|
9
|
-
const server = new McpServer({ name: "opencode-fractal-memory", version:
|
|
15
|
+
const server = new McpServer({ name: "opencode-fractal-memory", version: pkg.version }, { capabilities: { tools: {}, resources: {} } });
|
|
10
16
|
server.registerTool("memory_search", {
|
|
11
17
|
description: "Search memory nodes by text, embedding similarity, or BM25 score",
|
|
12
18
|
inputSchema: {
|
package/dist/mcp-server.js
CHANGED
|
@@ -1,13 +1,18 @@
|
|
|
1
1
|
#!/usr/bin/env bun
|
|
2
2
|
import * as path from "node:path";
|
|
3
3
|
import * as os from "node:os";
|
|
4
|
+
import * as fs from "node:fs";
|
|
5
|
+
import { fileURLToPath } from "node:url";
|
|
4
6
|
import { StdioServerTransport } from "@modelcontextprotocol/sdk/server/stdio.js";
|
|
5
7
|
import { createMemoryMcpServer } from "./mcp/server";
|
|
6
8
|
import { mcpLog } from "./mcp/logging";
|
|
9
|
+
const __filename = fileURLToPath(import.meta.url);
|
|
10
|
+
const __dirname = path.dirname(__filename);
|
|
11
|
+
const pkg = JSON.parse(fs.readFileSync(path.resolve(__dirname, "../package.json"), "utf-8"));
|
|
7
12
|
const projectDir = process.env.MGMT_PROJECT_DIR || process.cwd();
|
|
8
13
|
const globalDbPath = path.join(os.homedir(), ".config", "opencode", "memory.db");
|
|
9
14
|
async function main() {
|
|
10
|
-
mcpLog("info", "MCP server starting", { name: "opencode-fractal-memory", version:
|
|
15
|
+
mcpLog("info", "MCP server starting", { name: "opencode-fractal-memory", version: pkg.version });
|
|
11
16
|
const server = await createMemoryMcpServer(projectDir, globalDbPath);
|
|
12
17
|
const transport = new StdioServerTransport();
|
|
13
18
|
await server.connect(transport);
|
package/dist/tools/version.js
CHANGED
|
@@ -1,6 +1,12 @@
|
|
|
1
1
|
import { tool } from "@opencode-ai/plugin";
|
|
2
2
|
import { wrapWithTracking } from "./shared";
|
|
3
|
-
|
|
3
|
+
import { fileURLToPath } from "node:url";
|
|
4
|
+
import * as path from "node:path";
|
|
5
|
+
import * as fs from "node:fs";
|
|
6
|
+
const __filename = fileURLToPath(import.meta.url);
|
|
7
|
+
const __dirname = path.dirname(__filename);
|
|
8
|
+
const pkg = JSON.parse(fs.readFileSync(path.resolve(__dirname, "../../package.json"), "utf-8"));
|
|
9
|
+
const VERSION = pkg.version;
|
|
4
10
|
export function MemoryVersion(store) {
|
|
5
11
|
const t = tool({
|
|
6
12
|
description: "Show the installed version of the Fractal Memory plugin.",
|