cc-claw 0.14.0 → 0.14.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/agents/mcp-server.js +16 -3
- package/dist/cli.js +44 -2
- package/package.json +1 -1
|
@@ -330,14 +330,15 @@ server.tool(
|
|
|
330
330
|
"cc_claw_memory",
|
|
331
331
|
`Persistent cross-backend memory. Use this instead of your native memory system. Actions:
|
|
332
332
|
\u2022 remember \u2014 Save a memory (tag + content). Persists across backends and sessions.
|
|
333
|
-
\u2022 recall \u2014 Search memories by query (FTS5). Returns
|
|
333
|
+
\u2022 recall \u2014 Search memories by query (FTS5). Returns explicitly tagged memories ranked by relevance.
|
|
334
334
|
\u2022 list \u2014 List recent memories.
|
|
335
335
|
\u2022 forget \u2014 Delete memories by keyword match or specific ID.
|
|
336
|
-
\u2022 history \u2014 Search conversation history by keyword.
|
|
336
|
+
\u2022 history \u2014 Search raw conversation history by keyword (message_log table).
|
|
337
|
+
\u2022 summaries \u2014 Search session summaries (episodic layer). Use this to find work done in past sessions, story drafts, analysis results, or anything captured in session summaries but not explicitly tagged.
|
|
337
338
|
|
|
338
339
|
IMPORTANT: Always use this tool for memories. Do NOT save to your own memory files.`,
|
|
339
340
|
{
|
|
340
|
-
action: z.enum(["remember", "recall", "list", "forget", "history"]).describe("Action to perform"),
|
|
341
|
+
action: z.enum(["remember", "recall", "list", "forget", "history", "summaries"]).describe("Action to perform"),
|
|
341
342
|
// remember params
|
|
342
343
|
tag: z.string().optional().describe("Memory tag / trigger phrase"),
|
|
343
344
|
content: z.string().optional().describe("Memory content to save"),
|
|
@@ -405,6 +406,18 @@ IMPORTANT: Always use this tool for memories. Do NOT save to your own memory fil
|
|
|
405
406
|
);
|
|
406
407
|
return ok(lines.join("\n\n"));
|
|
407
408
|
}
|
|
409
|
+
case "summaries": {
|
|
410
|
+
if (!params.query) return fail("summaries requires 'query'");
|
|
411
|
+
const result = await callApi("/api/memory/summaries", {
|
|
412
|
+
query: params.query,
|
|
413
|
+
limit: params.limit ?? 10
|
|
414
|
+
});
|
|
415
|
+
if (!result.results.length) return ok("No matching session summaries found.");
|
|
416
|
+
const lines = result.results.map(
|
|
417
|
+
(s) => `[${s.created_at?.slice(0, 10) ?? "?"}] ${s.summary.slice(0, 400)}`
|
|
418
|
+
);
|
|
419
|
+
return ok(lines.join("\n\n---\n\n"));
|
|
420
|
+
}
|
|
408
421
|
}
|
|
409
422
|
} catch (err) {
|
|
410
423
|
return fail(`cc_claw_memory.${params.action} failed: ${err instanceof Error ? err.message : String(err)}`);
|
package/dist/cli.js
CHANGED
|
@@ -72,7 +72,7 @@ var VERSION;
|
|
|
72
72
|
var init_version = __esm({
|
|
73
73
|
"src/version.ts"() {
|
|
74
74
|
"use strict";
|
|
75
|
-
VERSION = true ? "0.14.
|
|
75
|
+
VERSION = true ? "0.14.2" : (() => {
|
|
76
76
|
try {
|
|
77
77
|
return JSON.parse(readFileSync(join2(process.cwd(), "package.json"), "utf-8")).version ?? "unknown";
|
|
78
78
|
} catch {
|
|
@@ -8407,7 +8407,8 @@ function startDashboard() {
|
|
|
8407
8407
|
"/api/memory/recall",
|
|
8408
8408
|
"/api/memory/list",
|
|
8409
8409
|
"/api/memory/forget",
|
|
8410
|
-
"/api/memory/history"
|
|
8410
|
+
"/api/memory/history",
|
|
8411
|
+
"/api/memory/summaries"
|
|
8411
8412
|
]);
|
|
8412
8413
|
if (isSubAgentToken && !SUB_AGENT_ALLOWED_PATHS.has(url.pathname)) {
|
|
8413
8414
|
return jsonResponse(res, { error: "Forbidden: sub-agent tokens can only access designated endpoints" }, 403);
|
|
@@ -8915,6 +8916,17 @@ data: ${JSON.stringify(data)}
|
|
|
8915
8916
|
return jsonResponse(res, { error: errorMessage(err) }, 400);
|
|
8916
8917
|
}
|
|
8917
8918
|
}
|
|
8919
|
+
if (url.pathname === "/api/memory/summaries" && req.method === "POST") {
|
|
8920
|
+
try {
|
|
8921
|
+
const body = JSON.parse(await readBody(req));
|
|
8922
|
+
validateAgentIdentity(req, body);
|
|
8923
|
+
const { searchSessionSummaries: searchSessionSummaries2 } = await Promise.resolve().then(() => (init_store5(), store_exports5));
|
|
8924
|
+
const results = searchSessionSummaries2(body.query, body.limit ?? 10);
|
|
8925
|
+
return jsonResponse(res, { success: true, results });
|
|
8926
|
+
} catch (err) {
|
|
8927
|
+
return jsonResponse(res, { error: errorMessage(err) }, 400);
|
|
8928
|
+
}
|
|
8929
|
+
}
|
|
8918
8930
|
if (url.pathname === "/api/schedule/create" && req.method === "POST") {
|
|
8919
8931
|
try {
|
|
8920
8932
|
const body = JSON.parse(await readBody(req));
|
|
@@ -15208,9 +15220,21 @@ ${content}
|
|
|
15208
15220
|
await channel.sendText(chatId, `Error processing file: ${errorMessage(err)}`, { parseMode: "plain" });
|
|
15209
15221
|
}
|
|
15210
15222
|
}
|
|
15223
|
+
function buildContextPrefix(msg) {
|
|
15224
|
+
const parts = [];
|
|
15225
|
+
if (msg.forwardedFrom) {
|
|
15226
|
+
parts.push(`[Forwarded from: "${msg.forwardedFrom}"]`);
|
|
15227
|
+
}
|
|
15228
|
+
if (msg.replyToText) {
|
|
15229
|
+
parts.push(`[Replying to: "${msg.replyToText}"]`);
|
|
15230
|
+
}
|
|
15231
|
+
return parts.length > 0 ? parts.join("\n") + "\n\n" : "";
|
|
15232
|
+
}
|
|
15211
15233
|
async function handleText(msg, channel) {
|
|
15212
15234
|
const { chatId } = msg;
|
|
15213
15235
|
let { text } = msg;
|
|
15236
|
+
const contextPrefix = buildContextPrefix(msg);
|
|
15237
|
+
if (contextPrefix) text = contextPrefix + text;
|
|
15214
15238
|
if (hasActiveProfile(chatId)) {
|
|
15215
15239
|
await handleProfileText(chatId, text, channel);
|
|
15216
15240
|
return;
|
|
@@ -19192,6 +19216,12 @@ var init_telegram2 = __esm({
|
|
|
19192
19216
|
const messageId = ctx.message?.message_id?.toString() ?? "";
|
|
19193
19217
|
const senderName = ctx.from?.first_name ?? "User";
|
|
19194
19218
|
const chatTitle = ctx.chat?.title;
|
|
19219
|
+
const replyTo = ctx.message?.reply_to_message;
|
|
19220
|
+
const replyToRaw = replyTo ? replyTo.text ?? replyTo.caption ?? "" : "";
|
|
19221
|
+
const replyToText = replyToRaw ? replyToRaw.length > 300 ? replyToRaw.slice(0, 297) + "\u2026" : replyToRaw : void 0;
|
|
19222
|
+
const fwdOrigin = ctx.message?.forward_origin;
|
|
19223
|
+
const fwdFromChat = ctx.message?.forward_from_chat;
|
|
19224
|
+
const forwardedFrom = fwdOrigin?.chat?.title ?? fwdOrigin?.sender_chat?.title ?? fwdOrigin?.sender_user?.first_name ?? fwdOrigin?.sender_user_name ?? fwdFromChat?.title ?? void 0;
|
|
19195
19225
|
if (ctx.message?.voice) {
|
|
19196
19226
|
return {
|
|
19197
19227
|
chatId,
|
|
@@ -19203,6 +19233,8 @@ var init_telegram2 = __esm({
|
|
|
19203
19233
|
fileName: ctx.message.voice.file_id,
|
|
19204
19234
|
mimeType: "audio/ogg",
|
|
19205
19235
|
chatTitle,
|
|
19236
|
+
replyToText,
|
|
19237
|
+
forwardedFrom,
|
|
19206
19238
|
raw: ctx
|
|
19207
19239
|
};
|
|
19208
19240
|
}
|
|
@@ -19220,6 +19252,8 @@ var init_telegram2 = __esm({
|
|
|
19220
19252
|
fileName: largest.file_id,
|
|
19221
19253
|
mimeType: "image/jpeg",
|
|
19222
19254
|
chatTitle,
|
|
19255
|
+
replyToText,
|
|
19256
|
+
forwardedFrom,
|
|
19223
19257
|
raw: ctx
|
|
19224
19258
|
};
|
|
19225
19259
|
}
|
|
@@ -19235,6 +19269,8 @@ var init_telegram2 = __esm({
|
|
|
19235
19269
|
fileName: ctx.message.document.file_id,
|
|
19236
19270
|
mimeType: ctx.message.document.mime_type ?? "application/octet-stream",
|
|
19237
19271
|
chatTitle,
|
|
19272
|
+
replyToText,
|
|
19273
|
+
forwardedFrom,
|
|
19238
19274
|
raw: ctx
|
|
19239
19275
|
};
|
|
19240
19276
|
}
|
|
@@ -19259,6 +19295,8 @@ var init_telegram2 = __esm({
|
|
|
19259
19295
|
mimeType: video.mime_type ?? "video/mp4"
|
|
19260
19296
|
},
|
|
19261
19297
|
chatTitle,
|
|
19298
|
+
replyToText,
|
|
19299
|
+
forwardedFrom,
|
|
19262
19300
|
raw: ctx
|
|
19263
19301
|
};
|
|
19264
19302
|
}
|
|
@@ -19278,6 +19316,8 @@ var init_telegram2 = __esm({
|
|
|
19278
19316
|
command,
|
|
19279
19317
|
commandArgs,
|
|
19280
19318
|
chatTitle,
|
|
19319
|
+
replyToText,
|
|
19320
|
+
forwardedFrom,
|
|
19281
19321
|
raw: ctx
|
|
19282
19322
|
};
|
|
19283
19323
|
}
|
|
@@ -19289,6 +19329,8 @@ var init_telegram2 = __esm({
|
|
|
19289
19329
|
type: "text",
|
|
19290
19330
|
source: "telegram",
|
|
19291
19331
|
chatTitle,
|
|
19332
|
+
replyToText,
|
|
19333
|
+
forwardedFrom,
|
|
19292
19334
|
raw: ctx
|
|
19293
19335
|
};
|
|
19294
19336
|
}
|
package/package.json
CHANGED