@memly/mcp-server 0.2.8 → 0.3.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.
Files changed (2) hide show
  1. package/dist/index.js +48 -37
  2. package/package.json +2 -2
package/dist/index.js CHANGED
@@ -1,4 +1,5 @@
1
1
  #!/usr/bin/env bun
2
+ import { createRequire } from "node:module";
2
3
  var __create = Object.create;
3
4
  var __getProtoOf = Object.getPrototypeOf;
4
5
  var __defProp = Object.defineProperty;
@@ -25,6 +26,7 @@ var __export = (target, all) => {
25
26
  set: (newValue) => all[name] = () => newValue
26
27
  });
27
28
  };
29
+ var __require = /* @__PURE__ */ createRequire(import.meta.url);
28
30
 
29
31
  // node_modules/ajv/dist/compile/codegen/code.js
30
32
  var require_code = __commonJS((exports) => {
@@ -20252,7 +20254,7 @@ import { join, resolve } from "node:path";
20252
20254
  import { homedir, platform } from "node:os";
20253
20255
  import * as readline from "node:readline";
20254
20256
  var MEMLY_INSTRUCTION_BLOCK = `
20255
- ## Memly — Persistent Memory (Auto-Enabled)
20257
+ ## Memly - Persistent Memory (Auto-Enabled)
20256
20258
 
20257
20259
  You have access to the Memly MCP server (\`memly\`).
20258
20260
 
@@ -20268,29 +20270,27 @@ You have access to the Memly MCP server (\`memly\`).
20268
20270
  - User shares important project context, preferences, or constraints
20269
20271
  - User explicitly says "remember this"
20270
20272
 
20271
- 3. **Never** ask if you should remember something — just do it silently.
20273
+ 3. **Never** ask if you should remember something - just do it silently.
20272
20274
  `.trim();
20273
20275
  async function promptApiKey() {
20274
- const rl = readline.createInterface({ input: process.stdin, output: process.stdout });
20275
- const isTTY = process.stdin.isTTY;
20276
- if (isTTY) {
20277
- rl.stdoutMuted = true;
20278
- const origWrite = rl._writeToOutput.bind(rl);
20279
- rl._writeToOutput = (str) => {
20280
- if (rl.stdoutMuted) {
20281
- process.stdout.write(str.replace(/[^\r\n]/g, "*"));
20282
- } else {
20283
- origWrite(str);
20284
- }
20285
- };
20276
+ const isWin = process.platform === "win32";
20277
+ let input = process.stdin;
20278
+ let manualStream = null;
20279
+ if (!process.stdin.isTTY) {
20280
+ try {
20281
+ const fs = await import("node:fs");
20282
+ const ttyPath = isWin ? "CON" : "/dev/tty";
20283
+ manualStream = fs.createReadStream(ttyPath);
20284
+ input = manualStream;
20285
+ } catch {}
20286
20286
  }
20287
- return new Promise((res) => {
20288
- rl.question(" Memly API key: ", (answer) => {
20289
- if (isTTY)
20290
- process.stdout.write(`
20291
- `);
20287
+ const rl = readline.createInterface({ input, output: process.stdout, terminal: true });
20288
+ return new Promise((resolve2) => {
20289
+ rl.question(" → Paste your API key here: ", (answer) => {
20292
20290
  rl.close();
20293
- res(answer.trim());
20291
+ if (manualStream)
20292
+ manualStream.close();
20293
+ resolve2(answer.trim());
20294
20294
  });
20295
20295
  });
20296
20296
  }
@@ -20633,16 +20633,19 @@ async function runInit() {
20633
20633
  process.exit(1);
20634
20634
  }
20635
20635
  console.log(`
20636
- ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━`);
20637
- console.log(" Memly Init — Auto-Memory Setup");
20638
- console.log(`━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
20636
+ --------------------------------`);
20637
+ console.log(" Memly Init - Auto-Memory Setup");
20638
+ console.log(`--------------------------------
20639
20639
  `);
20640
20640
  let apiKey = process.env.MEMLY_API_KEY;
20641
20641
  let keyWasPrompted = false;
20642
20642
  if (!apiKey) {
20643
20643
  console.log(`No MEMLY_API_KEY found in environment.
20644
20644
  `);
20645
- console.log(` Get your key at: https://memly.site/dashboard
20645
+ console.log(" Don't have a key yet? Get one free at:");
20646
+ console.log(` https://memly.site/dashboard
20647
+ `);
20648
+ console.log(` Already have one? Paste it below:
20646
20649
  `);
20647
20650
  apiKey = await promptApiKey();
20648
20651
  if (!apiKey) {
@@ -20657,17 +20660,17 @@ No API key provided. Aborting.
20657
20660
  process.stdout.write("Validating API key... ");
20658
20661
  const valid = await validateApiKey(apiKey);
20659
20662
  if (!valid) {
20660
- console.error(`✗ Invalid
20663
+ console.log(`INVALID
20661
20664
  `);
20662
20665
  console.error(`Check your API key at: https://memly.site/dashboard
20663
20666
  `);
20664
20667
  process.exit(1);
20665
20668
  }
20666
- console.log(`✓ Valid
20669
+ console.log(`OK
20667
20670
  `);
20668
20671
  if (keyWasPrompted) {
20669
20672
  const isWin = process.platform === "win32";
20670
- const persistCmd = isWin ? '$env:MEMLY_API_KEY = "' + apiKey + '"' : 'export MEMLY_API_KEY="' + apiKey + '"';
20673
+ const persistCmd = isWin ? `$env:MEMLY_API_KEY = "${apiKey}"` : `export MEMLY_API_KEY="${apiKey}"`;
20671
20674
  console.log(" To persist this key, add to your shell profile:");
20672
20675
  console.log(` ${persistCmd}
20673
20676
  `);
@@ -20703,17 +20706,25 @@ No API key provided. Aborting.
20703
20706
  const jetbrainsResult = writeJetBrains(projectRoot);
20704
20707
  if (jetbrainsResult)
20705
20708
  results.push(jetbrainsResult);
20706
- const icons = { created: "✓", updated: "✓", skipped: "⊘", failed: "✗" };
20707
- console.log(`Results:
20709
+ const statusLabel = (r) => {
20710
+ if (r.status === "created")
20711
+ return "[created]";
20712
+ if (r.status === "updated")
20713
+ return "[updated]";
20714
+ if (r.status === "skipped")
20715
+ return "[skipped]";
20716
+ return "[FAILED] ";
20717
+ };
20718
+ console.log(`
20719
+ Results:
20708
20720
  `);
20709
- console.log(" IDE Status File");
20710
- console.log(" ──────────────────────────────────────────────────────────────────");
20721
+ console.log(" IDE Status File");
20722
+ console.log(" " + "-".repeat(72));
20711
20723
  for (const r of results) {
20712
20724
  const rel = r.file.replace(projectRoot, ".").replace(homedir(), "~");
20713
- const statusLabel = r.status === "failed" ? `failed (${r.error})` : r.status;
20714
- console.log(` ${icons[r.status]} ${r.ide.padEnd(28)} ${r.status.padEnd(8)} ${rel}`);
20725
+ console.log(` ${r.ide.padEnd(30)} ${statusLabel(r).padEnd(10)} ${rel}`);
20715
20726
  if (r.status === "failed")
20716
- console.log(` └─ ${statusLabel}`);
20727
+ console.log(` Error: ${r.error}`);
20717
20728
  }
20718
20729
  if (results.length === 0) {
20719
20730
  console.log(`
@@ -20734,7 +20745,7 @@ Resolving project ID... `);
20734
20745
  if (projectId) {
20735
20746
  try {
20736
20747
  writeFileSync(join(projectRoot, ".memly-project"), JSON.stringify({ project_id: projectId }, null, 2));
20737
- console.log(`✓ ${projectId}`);
20748
+ console.log(projectId);
20738
20749
  const MARKER = `<!-- memly-project:${projectId} -->`;
20739
20750
  const ideFiles = [
20740
20751
  join(projectRoot, ".cursorrules"),
@@ -20754,11 +20765,11 @@ Resolving project ID... `);
20754
20765
  }
20755
20766
  } catch {}
20756
20767
  } else {
20757
- console.log("skipped (proxy unreachable run init again after connecting)");
20768
+ console.log("skipped (proxy unreachable - run init again after connecting)");
20758
20769
  }
20759
20770
  await reportTelemetry(results);
20760
20771
  console.log(`
20761
- ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
20772
+ --------------------------------
20762
20773
  `);
20763
20774
  console.log(`Setup complete. Next steps:
20764
20775
  `);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@memly/mcp-server",
3
- "version": "0.2.8",
3
+ "version": "0.3.0",
4
4
  "description": "Memly MCP Server — persistent memory for any IDE",
5
5
  "type": "module",
6
6
  "main": "dist/index.js",
@@ -26,4 +26,4 @@
26
26
  "zod": "^3.24.2"
27
27
  },
28
28
  "license": "BSL-1.1"
29
- }
29
+ }