memory-pulse 0.1.0 → 0.1.2

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 (3) hide show
  1. package/README.md +4 -0
  2. package/package.json +31 -8
  3. package/server.mjs +13 -4
package/README.md CHANGED
@@ -1,5 +1,9 @@
1
1
  # memory-pulse
2
2
 
3
+ [![npm](https://img.shields.io/npm/v/memory-pulse)](https://www.npmjs.com/package/memory-pulse)
4
+ [![license](https://img.shields.io/badge/license-MIT-6366f1)](LICENSE)
5
+ [![MCP](https://img.shields.io/badge/MCP-server-a855f7)](https://github.com/t-crew/memory-pulse)
6
+
3
7
  Causal project memory for coding agents — built for the thing MCP memory
4
8
  servers usually get wrong: **the cost of having it installed.**
5
9
 
package/package.json CHANGED
@@ -1,14 +1,37 @@
1
1
  {
2
2
  "name": "memory-pulse",
3
- "version": "0.1.0",
3
+ "version": "0.1.2",
4
4
  "description": "Causal memory for coding agents that costs ~670 tokens, not your context window. Four MCP tools: re-enter a project, recall what caused what, record findings, run code against memory.",
5
5
  "type": "module",
6
- "bin": { "memory-pulse": "./server.mjs" },
7
- "files": ["server.mjs", "README.md", "LICENSE"],
8
- "scripts": { "test": "node --test test/*.test.js" },
9
- "keywords": ["mcp", "modelcontextprotocol", "memory", "claude-code", "codex", "agent-memory", "context", "token-savings"],
6
+ "bin": {
7
+ "memory-pulse": "server.mjs"
8
+ },
9
+ "files": [
10
+ "server.mjs",
11
+ "README.md",
12
+ "LICENSE"
13
+ ],
14
+ "scripts": {
15
+ "test": "node --test test/*.test.js"
16
+ },
17
+ "keywords": [
18
+ "mcp",
19
+ "modelcontextprotocol",
20
+ "memory",
21
+ "claude-code",
22
+ "codex",
23
+ "agent-memory",
24
+ "context",
25
+ "token-savings"
26
+ ],
10
27
  "author": "Travis Crew",
11
28
  "license": "MIT",
12
- "repository": { "type": "git", "url": "git+https://github.com/t-crew/memory-pulse.git" },
13
- "engines": { "node": ">=18" }
14
- }
29
+ "repository": {
30
+ "type": "git",
31
+ "url": "git+https://github.com/t-crew/memory-pulse.git"
32
+ },
33
+ "engines": {
34
+ "node": ">=18"
35
+ },
36
+ "mcpName": "io.github.t-crew/memory-pulse"
37
+ }
package/server.mjs CHANGED
@@ -20,8 +20,9 @@
20
20
  * MEMORY_PULSE_LEDGER override the ledger path (default: ./.memory-pulse/events.jsonl)
21
21
  */
22
22
  import readline from "node:readline";
23
- import { existsSync, mkdirSync, readFileSync, appendFileSync, writeFileSync } from "node:fs";
23
+ import { existsSync, mkdirSync, readFileSync, appendFileSync, writeFileSync, realpathSync } from "node:fs";
24
24
  import { dirname, isAbsolute, join } from "node:path";
25
+ import { fileURLToPath } from "node:url";
25
26
 
26
27
  const API = (process.env.MEMORY_PULSE_API ?? "https://memory-pulse.strategic-innovations.workers.dev").replace(/\/$/, "");
27
28
  const KEY = process.env.MEMORY_PULSE_KEY ?? null;
@@ -186,7 +187,7 @@ async function dispatch(msg) {
186
187
  return ok(id, {
187
188
  protocolVersion: SUPPORTED.includes(wanted) ? wanted : SUPPORTED[0],
188
189
  capabilities: { tools: {} },
189
- serverInfo: { name: "memory-pulse", version: "0.1.0" },
190
+ serverInfo: { name: "memory-pulse", version: "0.1.2" },
190
191
  });
191
192
  }
192
193
  if (method === "notifications/initialized" || method === "initialized") return;
@@ -204,8 +205,16 @@ async function dispatch(msg) {
204
205
  if (id !== undefined) fail(id, -32601, `method not found: ${method}`);
205
206
  }
206
207
 
207
- // Importable for tests; only run the transport when invoked as a binary.
208
- if (process.argv[1] && import.meta.url.endsWith(process.argv[1].split("/").pop())) {
208
+ // Importable for tests; the transport runs only when this file is the entry
209
+ // point. Compared by REALPATH, not by name: npm invokes the bin through a
210
+ // .bin/memory-pulse symlink, and a basename comparison silently failed there —
211
+ // the published package installed, exited 0, and served nothing. Found by
212
+ // running the stranger-install test against the real registry.
213
+ let isMain = false;
214
+ try {
215
+ isMain = Boolean(process.argv[1]) && realpathSync(process.argv[1]) === fileURLToPath(import.meta.url);
216
+ } catch { /* argv[1] missing or unreadable — we are being imported */ }
217
+ if (isMain) {
209
218
  process.stderr.write(`memory-pulse: ledger ${ledgerPath()} — api ${API}\n`);
210
219
  const rl = readline.createInterface({ input: process.stdin, terminal: false });
211
220
  // In-flight calls are drained before exit. Exiting the moment stdin closes