@memoraone/mcp 0.1.53 → 0.1.55
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/cli.cjs +229 -45
- package/dist/daemon.cjs +42 -10
- package/dist/gateway.cjs +14035 -0
- package/dist/index.cjs +44 -10
- package/package.json +1 -1
package/dist/index.cjs
CHANGED
|
@@ -30,11 +30,10 @@ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: tru
|
|
|
30
30
|
// src/index.ts
|
|
31
31
|
var index_exports = {};
|
|
32
32
|
__export(index_exports, {
|
|
33
|
+
createMemoraMcpServer: () => createMemoraMcpServer,
|
|
33
34
|
main: () => main
|
|
34
35
|
});
|
|
35
36
|
module.exports = __toCommonJS(index_exports);
|
|
36
|
-
var import_mcp = require("@modelcontextprotocol/sdk/server/mcp.js");
|
|
37
|
-
var import_types = require("@modelcontextprotocol/sdk/types.js");
|
|
38
37
|
var import_stdio = require("@modelcontextprotocol/sdk/server/stdio.js");
|
|
39
38
|
|
|
40
39
|
// src/config.ts
|
|
@@ -297,6 +296,10 @@ var config2 = {
|
|
|
297
296
|
heartbeatIntervalMs: Number.parseInt(parsed.data.MEMORAONE_HEARTBEAT_INTERVAL_MS ?? "1000", 10)
|
|
298
297
|
};
|
|
299
298
|
|
|
299
|
+
// src/memoraMcpServer.ts
|
|
300
|
+
var import_mcp = require("@modelcontextprotocol/sdk/server/mcp.js");
|
|
301
|
+
var import_types = require("@modelcontextprotocol/sdk/types.js");
|
|
302
|
+
|
|
300
303
|
// src/client/memoraClient.ts
|
|
301
304
|
var crypto2 = __toESM(require("crypto"), 1);
|
|
302
305
|
|
|
@@ -1694,7 +1697,10 @@ async function reconcileResolvedBindingWithDisk(cached, options = {}) {
|
|
|
1694
1697
|
);
|
|
1695
1698
|
}
|
|
1696
1699
|
const workspaceRoot = path11.resolve(record.workspaceRoot);
|
|
1697
|
-
const identity = await captureRootFilesystemIdentity(
|
|
1700
|
+
const identity = await captureRootFilesystemIdentity(
|
|
1701
|
+
workspaceRoot,
|
|
1702
|
+
options.identityDeps
|
|
1703
|
+
);
|
|
1698
1704
|
if (!identitiesMatch(record.filesystemIdentity, identity)) {
|
|
1699
1705
|
throw new ReconnectRequiredError(
|
|
1700
1706
|
"[memoraone-mcp] Workspace filesystem identity changed. Run: memoraone-mcp connect <code>"
|
|
@@ -12259,7 +12265,7 @@ function inferIdeType(params, options = {}) {
|
|
|
12259
12265
|
return void 0;
|
|
12260
12266
|
}
|
|
12261
12267
|
|
|
12262
|
-
// src/
|
|
12268
|
+
// src/memoraMcpServer.ts
|
|
12263
12269
|
var notInitializedResult = {
|
|
12264
12270
|
content: [
|
|
12265
12271
|
{
|
|
@@ -12344,7 +12350,7 @@ function registerToolWithWorklog(server, runtime, sessionContext, toolName, desc
|
|
|
12344
12350
|
});
|
|
12345
12351
|
server.tool(toolName, description, schema, wrapped);
|
|
12346
12352
|
}
|
|
12347
|
-
|
|
12353
|
+
function createMemoraMcpServer(opts = {}) {
|
|
12348
12354
|
let bindingReadyResolve = null;
|
|
12349
12355
|
let bindingReadyReject = null;
|
|
12350
12356
|
const bindingReady = new Promise((resolve42, reject) => {
|
|
@@ -12377,7 +12383,10 @@ async function main(opts = {}) {
|
|
|
12377
12383
|
"[memoraone-mcp][init-debug] Workspace resolution strategy: daemonBindingHint (bridge pre-resolved, reconciled from disk)"
|
|
12378
12384
|
);
|
|
12379
12385
|
}
|
|
12380
|
-
const reconciled = await reconcileResolvedBindingWithDisk(
|
|
12386
|
+
const reconciled = await reconcileResolvedBindingWithDisk(
|
|
12387
|
+
opts.daemonBindingHint,
|
|
12388
|
+
opts.bindingResolveOptions ?? {}
|
|
12389
|
+
);
|
|
12381
12390
|
runtime.bindingCacheRefreshed = reconciled.cacheRefreshed;
|
|
12382
12391
|
if (reconciled.cacheRefreshed) {
|
|
12383
12392
|
console.error(
|
|
@@ -12830,11 +12839,35 @@ async function main(opts = {}) {
|
|
|
12830
12839
|
if (devMode) {
|
|
12831
12840
|
console.error("[memoraone-mcp] Starting MCP server with", registeredToolNames.length, "tools");
|
|
12832
12841
|
}
|
|
12833
|
-
|
|
12842
|
+
return {
|
|
12843
|
+
server,
|
|
12844
|
+
runtime,
|
|
12845
|
+
sessionContext,
|
|
12846
|
+
sessionLabel,
|
|
12847
|
+
bindingReady,
|
|
12848
|
+
getWorkspaceRoot: () => workspaceRoot
|
|
12849
|
+
};
|
|
12850
|
+
}
|
|
12851
|
+
|
|
12852
|
+
// src/index.ts
|
|
12853
|
+
async function main(opts = {}) {
|
|
12854
|
+
const {
|
|
12855
|
+
transport: customTransport,
|
|
12856
|
+
sessionSocket,
|
|
12857
|
+
...serverOpts
|
|
12858
|
+
} = opts;
|
|
12859
|
+
const {
|
|
12860
|
+
server,
|
|
12861
|
+
runtime,
|
|
12862
|
+
sessionLabel,
|
|
12863
|
+
bindingReady
|
|
12864
|
+
} = createMemoraMcpServer(serverOpts);
|
|
12865
|
+
const devMode = Boolean(config2.devMode);
|
|
12866
|
+
const transport = customTransport ?? new import_stdio.StdioServerTransport();
|
|
12834
12867
|
await server.connect(transport);
|
|
12835
12868
|
const activeClient = await bindingReady;
|
|
12836
12869
|
let ownedHeartbeat = null;
|
|
12837
|
-
const daemonSession = Boolean(
|
|
12870
|
+
const daemonSession = Boolean(sessionSocket);
|
|
12838
12871
|
if (activeClient) {
|
|
12839
12872
|
if (config2.heartbeatEnabled && daemonSession) {
|
|
12840
12873
|
console.error(
|
|
@@ -12881,9 +12914,9 @@ async function main(opts = {}) {
|
|
|
12881
12914
|
if (devMode) {
|
|
12882
12915
|
console.error("[memoraone-mcp] MCP server ready");
|
|
12883
12916
|
}
|
|
12884
|
-
if (
|
|
12917
|
+
if (sessionSocket) {
|
|
12885
12918
|
await new Promise((resolve42) => {
|
|
12886
|
-
|
|
12919
|
+
sessionSocket.once("close", () => {
|
|
12887
12920
|
shutdown("session closed", false);
|
|
12888
12921
|
resolve42();
|
|
12889
12922
|
});
|
|
@@ -12892,5 +12925,6 @@ async function main(opts = {}) {
|
|
|
12892
12925
|
}
|
|
12893
12926
|
// Annotate the CommonJS export names for ESM import in node:
|
|
12894
12927
|
0 && (module.exports = {
|
|
12928
|
+
createMemoraMcpServer,
|
|
12895
12929
|
main
|
|
12896
12930
|
});
|