@pyxmate/memory 1.1.3 → 1.2.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/cli/pyx-mem.mjs +34 -8
- package/package.json +1 -1
package/dist/cli/pyx-mem.mjs
CHANGED
|
@@ -811,7 +811,7 @@ function createProxyServer(client, version, uploadLocalFile) {
|
|
|
811
811
|
return server;
|
|
812
812
|
}
|
|
813
813
|
async function runMcpProxyServer(opts) {
|
|
814
|
-
const version = opts.version ?? (true ? "1.
|
|
814
|
+
const version = opts.version ?? (true ? "1.2.0" : "0.0.0-dev");
|
|
815
815
|
const read = await opts.readCredentials();
|
|
816
816
|
if (!read.ok) {
|
|
817
817
|
const text = read.result.content.map((c) => c.type === "text" ? c.text : "").join(" ").trim();
|
|
@@ -828,7 +828,7 @@ async function runMcpProxyServer(opts) {
|
|
|
828
828
|
} catch (err) {
|
|
829
829
|
const msg = err instanceof Error ? err.message : String(err);
|
|
830
830
|
throw new Error(
|
|
831
|
-
`Could not reach the pyx-memory remote MCP at ${url.href}: ${msg}. Verify the endpoint and key with \`pyx-mem doctor\`, or run the bundled server with \`pyx-mem mcp\`.`
|
|
831
|
+
`Could not reach the pyx-memory remote MCP at ${url.href}: ${msg}. Verify the endpoint and key with \`pyx-mem doctor\`, or run the legacy bundled server with \`pyx-mem mcp --bundled\`.`
|
|
832
832
|
);
|
|
833
833
|
}
|
|
834
834
|
try {
|
|
@@ -1567,7 +1567,7 @@ var ALL_TOOL_NAMES = ALL_TOOLS.map((t) => t.name);
|
|
|
1567
1567
|
// src/mcp/server.ts
|
|
1568
1568
|
async function runMcpServer(opts) {
|
|
1569
1569
|
const fetchImpl = opts.fetchImpl ?? fetch;
|
|
1570
|
-
const version = opts.version ?? (true ? "1.
|
|
1570
|
+
const version = opts.version ?? (true ? "1.2.0" : "0.0.0-dev");
|
|
1571
1571
|
const server = new McpServer(
|
|
1572
1572
|
{ name: "pyx-memory", version },
|
|
1573
1573
|
{ instructions: PYX_MEMORY_INSTRUCTIONS, capabilities: { tools: {}, prompts: {} } }
|
|
@@ -1602,7 +1602,7 @@ async function mcpCommand(opts = {}) {
|
|
|
1602
1602
|
process.stdin.once("close", resolve4);
|
|
1603
1603
|
});
|
|
1604
1604
|
try {
|
|
1605
|
-
const run = opts.
|
|
1605
|
+
const run = opts.bundled ? runMcpServer({ readCredentials }) : runMcpProxyServer({ readCredentials });
|
|
1606
1606
|
await Promise.race([run, onStdinEnd]);
|
|
1607
1607
|
return EXIT.OK;
|
|
1608
1608
|
} catch (err) {
|
|
@@ -1611,6 +1611,14 @@ async function mcpCommand(opts = {}) {
|
|
|
1611
1611
|
return EXIT.USAGE;
|
|
1612
1612
|
}
|
|
1613
1613
|
}
|
|
1614
|
+
function resolveMcpMode(flags) {
|
|
1615
|
+
const remote = flags.remote === true;
|
|
1616
|
+
const bundled = flags.bundled === true;
|
|
1617
|
+
if (remote && bundled) {
|
|
1618
|
+
return { ok: false, error: "`--remote` and `--bundled` are mutually exclusive." };
|
|
1619
|
+
}
|
|
1620
|
+
return { ok: true, bundled, implicit: !remote && !bundled };
|
|
1621
|
+
}
|
|
1614
1622
|
|
|
1615
1623
|
// src/cli/commands/mcp-install.ts
|
|
1616
1624
|
import { spawnSync as nodeSpawnSync } from "child_process";
|
|
@@ -2297,9 +2305,11 @@ Commands:
|
|
|
2297
2305
|
logout Delete stored pyx-memory credentials.
|
|
2298
2306
|
doctor [--json] Diagnose keychain, credentials, backend, MCP startup.
|
|
2299
2307
|
scaffold [--name <dir>] Generate Docker, env, SDK, and memory design-guide starter files.
|
|
2300
|
-
mcp [--
|
|
2301
|
-
server so tools + instructions stay
|
|
2302
|
-
(zero-touch updates; key stays in the
|
|
2308
|
+
mcp [--bundled] Start the stdio MCP server. Default connects to the
|
|
2309
|
+
hosted server so tools + instructions stay
|
|
2310
|
+
server-owned (zero-touch updates; key stays in the
|
|
2311
|
+
keychain). --bundled runs the legacy in-package server
|
|
2312
|
+
(offline / version-pinned / host-local file ingest).
|
|
2303
2313
|
mcp install <target> [--scope user|local|project] [--remote]
|
|
2304
2314
|
Install pyx-memory MCP config for your AI agent.
|
|
2305
2315
|
--remote installs the hosted thin-proxy (zero-touch
|
|
@@ -2384,7 +2394,23 @@ function runMcpInstall(target, scope, remote) {
|
|
|
2384
2394
|
return handler({ scope, remote });
|
|
2385
2395
|
}
|
|
2386
2396
|
function runMcpCommand(parsed) {
|
|
2387
|
-
if (parsed.subcommand === void 0)
|
|
2397
|
+
if (parsed.subcommand === void 0) {
|
|
2398
|
+
const resolved = resolveMcpMode({
|
|
2399
|
+
remote: parsed.flags.remote === true,
|
|
2400
|
+
bundled: parsed.flags.bundled === true
|
|
2401
|
+
});
|
|
2402
|
+
if (!resolved.ok) {
|
|
2403
|
+
process.stderr.write(`Error: ${resolved.error}
|
|
2404
|
+
`);
|
|
2405
|
+
return EXIT.USAGE;
|
|
2406
|
+
}
|
|
2407
|
+
if (resolved.implicit) {
|
|
2408
|
+
process.stderr.write(
|
|
2409
|
+
"pyx-memory: `pyx-mem mcp` now connects to the hosted server (zero-touch \u2014 tools and instructions stay server-owned). Pass `--bundled` for the legacy in-package server.\n"
|
|
2410
|
+
);
|
|
2411
|
+
}
|
|
2412
|
+
return mcpCommand({ bundled: resolved.bundled });
|
|
2413
|
+
}
|
|
2388
2414
|
if (parsed.subcommand === "install") {
|
|
2389
2415
|
const target = parsed.positional[0];
|
|
2390
2416
|
const scope = typeof parsed.flags.scope === "string" ? parsed.flags.scope : void 0;
|