memory-pulse 0.1.0 → 0.1.1
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/package.json +29 -7
- package/server.mjs +12 -3
package/package.json
CHANGED
|
@@ -1,14 +1,36 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "memory-pulse",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.1",
|
|
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": {
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
"
|
|
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": {
|
|
13
|
-
|
|
29
|
+
"repository": {
|
|
30
|
+
"type": "git",
|
|
31
|
+
"url": "git+https://github.com/t-crew/memory-pulse.git"
|
|
32
|
+
},
|
|
33
|
+
"engines": {
|
|
34
|
+
"node": ">=18"
|
|
35
|
+
}
|
|
14
36
|
}
|
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;
|
|
@@ -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;
|
|
208
|
-
|
|
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
|