@prom.codes/memory-mcp 0.10.1 → 0.10.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.
- package/dist/bin.js +29 -8
- package/package.json +1 -1
package/dist/bin.js
CHANGED
|
@@ -194,9 +194,6 @@ function isHomeOrFilesystemRoot(root) {
|
|
|
194
194
|
return false;
|
|
195
195
|
}
|
|
196
196
|
|
|
197
|
-
// ../shared/dist/index.js
|
|
198
|
-
var PROMETHEUS_VERSION = "0.1.0";
|
|
199
|
-
|
|
200
197
|
// dist/composition.js
|
|
201
198
|
import { createHash } from "node:crypto";
|
|
202
199
|
import { homedir as homedir3 } from "node:os";
|
|
@@ -2933,14 +2930,16 @@ var setupInput = {
|
|
|
2933
2930
|
runtimes: z.array(runtimeEnum).min(1).optional()
|
|
2934
2931
|
};
|
|
2935
2932
|
var emptyInput = {};
|
|
2936
|
-
function registerTools(server,
|
|
2937
|
-
const
|
|
2938
|
-
const mirrorToFiles = !deps.rootIsHomeOrFsRoot;
|
|
2933
|
+
function registerTools(server, source) {
|
|
2934
|
+
const ready = typeof source === "function" ? source : () => Promise.resolve(source);
|
|
2939
2935
|
server.registerTool("read", {
|
|
2940
2936
|
title: "Recall agent memory",
|
|
2941
2937
|
description: "Read agent memory for this project along the scope chain (project \u2192 workspace \u2192 tenant \u2192 system; narrowest scope wins). Syncs `.prometheus/memories/*.md` first, then returns the resolved records plus a prompt-ready `woven` markdown block (token-capped). Call this at the START of a session or task to recall what earlier sessions learned.",
|
|
2942
2938
|
inputSchema: readInput
|
|
2943
2939
|
}, async (args) => {
|
|
2940
|
+
const deps = await ready();
|
|
2941
|
+
const { backend, workspaceRoot, projectId, projectName } = deps;
|
|
2942
|
+
const mirrorToFiles = !deps.rootIsHomeOrFsRoot;
|
|
2944
2943
|
const limit = clampLimit(args.limit, DEFAULT_READ_LIMIT);
|
|
2945
2944
|
const synced = mirrorToFiles ? await syncProjectFiles(backend, { projectId, workspaceRoot }) : 0;
|
|
2946
2945
|
const records = await backend.read({
|
|
@@ -2961,6 +2960,9 @@ function registerTools(server, deps) {
|
|
|
2961
2960
|
description: "Upsert one memory record (identity: scope+type+key). Use type `semantic` for durable facts, `procedural` for how-to knowledge, `episodic` for session events, `working` for short-lived notes. Default scope `project` also mirrors the value to `.prometheus/memories/<key>.md` (git-versioned, human-editable). Values matching the secret deny-list are rejected. Call this whenever the user states a durable preference, decision, or correction worth remembering.",
|
|
2962
2961
|
inputSchema: writeInput
|
|
2963
2962
|
}, async (args) => {
|
|
2963
|
+
const deps = await ready();
|
|
2964
|
+
const { backend, workspaceRoot, projectId } = deps;
|
|
2965
|
+
const mirrorToFiles = !deps.rootIsHomeOrFsRoot;
|
|
2964
2966
|
assertValueSize(args.value);
|
|
2965
2967
|
assertNoSecrets(`${args.key}
|
|
2966
2968
|
${args.value}`);
|
|
@@ -2988,6 +2990,7 @@ ${args.value}`);
|
|
|
2988
2990
|
description: "Session-end consolidation: `plan`/`outcome` become one episodic record (key = sessionId), `facts` become semantic upserts, `procedures` become procedural upserts. Secret-bearing payloads are rejected. Call this at the END of a session to persist what was learned.",
|
|
2989
2991
|
inputSchema: captureInput
|
|
2990
2992
|
}, async (args) => {
|
|
2993
|
+
const { backend, projectId, extractor } = await ready();
|
|
2991
2994
|
const texts = [
|
|
2992
2995
|
args.plan ?? "",
|
|
2993
2996
|
args.outcome ?? "",
|
|
@@ -3051,6 +3054,9 @@ ${f.value}`);
|
|
|
3051
3054
|
description: "Full-text search (FTS5) over memory keys and values within this project's scope chain, ranked by relevance. Returns matching records plus a highlighted snippet per hit. Use this when memory_read's recall is not specific enough. Does not bump useCount.",
|
|
3052
3055
|
inputSchema: searchInput
|
|
3053
3056
|
}, async (args) => {
|
|
3057
|
+
const deps = await ready();
|
|
3058
|
+
const { backend, workspaceRoot, projectId } = deps;
|
|
3059
|
+
const mirrorToFiles = !deps.rootIsHomeOrFsRoot;
|
|
3054
3060
|
const limit = clampLimit(args.limit, 20);
|
|
3055
3061
|
if (mirrorToFiles)
|
|
3056
3062
|
await syncProjectFiles(backend, { projectId, workspaceRoot });
|
|
@@ -3074,6 +3080,7 @@ ${f.value}`);
|
|
|
3074
3080
|
description: "Flat listing of this project's memory records without scope resolution \u2014 inspection/debug surface. Optional filters: scope, type, keyContains (case-insensitive substring).",
|
|
3075
3081
|
inputSchema: listInput
|
|
3076
3082
|
}, async (args) => {
|
|
3083
|
+
const { backend, projectId, projectName, dbPath } = await ready();
|
|
3077
3084
|
const limit = clampLimit(args.limit, DEFAULT_READ_LIMIT);
|
|
3078
3085
|
const records = await backend.list({
|
|
3079
3086
|
projectId,
|
|
@@ -3094,6 +3101,9 @@ ${f.value}`);
|
|
|
3094
3101
|
description: "Delete one memory record by identity (scope+type+key). For project-scoped semantic records the mirrored `.prometheus/memories/<key>.md` file is removed as well. Returns whether a record/file was actually removed.",
|
|
3095
3102
|
inputSchema: deleteInput
|
|
3096
3103
|
}, async (args) => {
|
|
3104
|
+
const deps = await ready();
|
|
3105
|
+
const { backend, workspaceRoot, projectId } = deps;
|
|
3106
|
+
const mirrorToFiles = !deps.rootIsHomeOrFsRoot;
|
|
3097
3107
|
const scope = args.scope;
|
|
3098
3108
|
const removed = await backend.delete({
|
|
3099
3109
|
projectId,
|
|
@@ -3113,6 +3123,9 @@ ${f.value}`);
|
|
|
3113
3123
|
description: "Idempotently install the Prometheus memory-protocol rule block into agent runtime configs in this workspace: CLAUDE.md (claude-code), .cursor/rules/prometheus-memory.mdc (cursor), .augment/rules/prometheus-memory.md (augment), AGENTS.md (agents). Without `runtimes` it auto-detects which runtimes are present (fallback: agents). Only the marked block is written \u2014 existing content is never touched. Re-running updates the block in place.",
|
|
3114
3124
|
inputSchema: setupInput
|
|
3115
3125
|
}, async (args) => {
|
|
3126
|
+
const deps = await ready();
|
|
3127
|
+
const { workspaceRoot } = deps;
|
|
3128
|
+
const mirrorToFiles = !deps.rootIsHomeOrFsRoot;
|
|
3116
3129
|
if (!mirrorToFiles) {
|
|
3117
3130
|
return textResult({
|
|
3118
3131
|
workspaceRoot,
|
|
@@ -3132,6 +3145,9 @@ ${f.value}`);
|
|
|
3132
3145
|
description: "Health check for this project's agent memory. Reports the resolved workspace root, project id, DB path, how many records are stored (total + by scope), the embedding provider with a zero-cost key-reachability probe, and which quality levers are active (rerank / rewrite / temporal). CALL THIS to confirm where memory is stored, how much is there, and whether the API key works.",
|
|
3133
3146
|
inputSchema: emptyInput
|
|
3134
3147
|
}, async () => {
|
|
3148
|
+
const deps = await ready();
|
|
3149
|
+
const { backend, workspaceRoot, projectId, projectName, dbPath } = deps;
|
|
3150
|
+
const mirrorToFiles = !deps.rootIsHomeOrFsRoot;
|
|
3135
3151
|
const stats = await backend.stats(projectId);
|
|
3136
3152
|
let embeddingsReachable = null;
|
|
3137
3153
|
let embeddingsError = null;
|
|
@@ -3179,7 +3195,7 @@ ${f.value}`);
|
|
|
3179
3195
|
// dist/server.js
|
|
3180
3196
|
var SERVER_IDENTITY = {
|
|
3181
3197
|
name: "prometheus-memory-mcp",
|
|
3182
|
-
version:
|
|
3198
|
+
version: "0.10.2",
|
|
3183
3199
|
title: "prom.codes Memory"
|
|
3184
3200
|
};
|
|
3185
3201
|
var SERVER_INSTRUCTIONS = "Persistent agent memory for this workspace \u2014 USE IT PROACTIVELY; the user will not tell you to. Protocol:\n1. ONE-TIME: if this workspace has no Prometheus memory rule yet, call memory_setup now (idempotent) so the protocol is installed into the runtime rule files and survives future sessions. (The server also auto-installs it on startup when a project rule file already exists \u2014 memory_setup covers the rest.)\n2. SESSION START: before any non-trivial task, call memory_read to recall facts, decisions and procedures from earlier sessions.\n3. DURING WORK: when the user states a durable preference, decision, correction or project fact, store it with memory_write (semantic for facts, procedural for how-tos) \u2014 without being asked.\n4. LOOK-UP: use memory_search for keyword recall when memory_read is not specific enough.\n5. SESSION END: consolidate what was learned with memory_capture.\nCall memory_status anytime to check what is stored and whether the rule is installed. Never store secrets, API keys or credentials \u2014 such writes are rejected.";
|
|
@@ -3201,6 +3217,11 @@ async function main() {
|
|
|
3201
3217
|
instructions: SERVER_INSTRUCTIONS
|
|
3202
3218
|
});
|
|
3203
3219
|
let composed = null;
|
|
3220
|
+
let composedResolve;
|
|
3221
|
+
const composedReady = new Promise((res) => {
|
|
3222
|
+
composedResolve = res;
|
|
3223
|
+
});
|
|
3224
|
+
registerTools(server, () => composedReady);
|
|
3204
3225
|
const shutdown = async (signal) => {
|
|
3205
3226
|
process.stderr.write(`prometheus-memory-mcp: received ${signal}, shutting down
|
|
3206
3227
|
`);
|
|
@@ -3234,7 +3255,7 @@ async function main() {
|
|
|
3234
3255
|
}).catch(() => {
|
|
3235
3256
|
});
|
|
3236
3257
|
}
|
|
3237
|
-
|
|
3258
|
+
composedResolve(composed);
|
|
3238
3259
|
};
|
|
3239
3260
|
if (eagerVia !== null) {
|
|
3240
3261
|
boot(void 0, eagerVia);
|