chat-recall 0.7.8 โ 0.7.10
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/cli.js +198 -42
- package/dist/cli.js.map +1 -1
- package/dist/derived.d.ts.map +1 -1
- package/dist/derived.js +2 -5
- package/dist/derived.js.map +1 -1
- package/dist/escalate.d.ts +2 -0
- package/dist/escalate.d.ts.map +1 -1
- package/dist/escalate.js +2 -1
- package/dist/escalate.js.map +1 -1
- package/dist/mcp-relay.js +1 -1
- package/dist/mcp.js +6821 -6565
- package/dist/scan-worker.js +109 -8
- package/dist/sync-client.d.ts.map +1 -1
- package/dist/sync-client.js +9 -7
- package/dist/sync-client.js.map +1 -1
- package/dist/watch.js +177 -39
- package/package.json +1 -1
- package/skills/chat-recall/SKILL.md +1 -1
- package/skills/chat-recall-find/SKILL.md +4 -2
- package/skills/chat-recall-resume/SKILL.md +3 -1
package/dist/scan-worker.js
CHANGED
|
@@ -5203,6 +5203,69 @@ var init_banners = __esm({
|
|
|
5203
5203
|
}
|
|
5204
5204
|
});
|
|
5205
5205
|
|
|
5206
|
+
// ../engine/dist/core/claude-prompt-origin.js
|
|
5207
|
+
function originFromText(text) {
|
|
5208
|
+
const head = text.trimStart();
|
|
5209
|
+
for (const [prefix, origin] of INJECTED_PREFIXES) {
|
|
5210
|
+
if (head.startsWith(prefix))
|
|
5211
|
+
return origin;
|
|
5212
|
+
}
|
|
5213
|
+
return "human";
|
|
5214
|
+
}
|
|
5215
|
+
function declaredOrigin(value) {
|
|
5216
|
+
if (!value || typeof value !== "object")
|
|
5217
|
+
return void 0;
|
|
5218
|
+
const kind = value.kind;
|
|
5219
|
+
return typeof kind === "string" && kind ? kind : void 0;
|
|
5220
|
+
}
|
|
5221
|
+
function userRecordOrigin(obj, text) {
|
|
5222
|
+
if (obj.isSidechain === true)
|
|
5223
|
+
return "subagent";
|
|
5224
|
+
const declared = declaredOrigin(obj.origin);
|
|
5225
|
+
if (declared && declared !== "human")
|
|
5226
|
+
return declared;
|
|
5227
|
+
if (obj.isMeta === true)
|
|
5228
|
+
return "meta";
|
|
5229
|
+
if (declared === "human")
|
|
5230
|
+
return "human";
|
|
5231
|
+
return originFromText(text);
|
|
5232
|
+
}
|
|
5233
|
+
function queuedCommandPrompt(obj) {
|
|
5234
|
+
if (obj.type !== "attachment")
|
|
5235
|
+
return null;
|
|
5236
|
+
const att = obj.attachment;
|
|
5237
|
+
if (!att || att.type !== "queued_command")
|
|
5238
|
+
return null;
|
|
5239
|
+
const text = promptText(att.prompt);
|
|
5240
|
+
if (!text)
|
|
5241
|
+
return null;
|
|
5242
|
+
if (obj.isSidechain === true)
|
|
5243
|
+
return { text, origin: "subagent" };
|
|
5244
|
+
const declared = declaredOrigin(att.origin);
|
|
5245
|
+
if (declared)
|
|
5246
|
+
return { text, origin: declared };
|
|
5247
|
+
return { text, origin: att.humanTurn === true ? "human" : originFromText(text) };
|
|
5248
|
+
}
|
|
5249
|
+
function promptText(prompt) {
|
|
5250
|
+
if (typeof prompt === "string")
|
|
5251
|
+
return prompt;
|
|
5252
|
+
if (!Array.isArray(prompt))
|
|
5253
|
+
return "";
|
|
5254
|
+
return prompt.filter((b) => !!b && typeof b === "object" && b.type === "text" && typeof b.text === "string").map((b) => b.text).join("\n");
|
|
5255
|
+
}
|
|
5256
|
+
var INJECTED_PREFIXES;
|
|
5257
|
+
var init_claude_prompt_origin = __esm({
|
|
5258
|
+
"../engine/dist/core/claude-prompt-origin.js"() {
|
|
5259
|
+
"use strict";
|
|
5260
|
+
INJECTED_PREFIXES = [
|
|
5261
|
+
["<task-notification", "task-notification"],
|
|
5262
|
+
["<agent-message", "peer"],
|
|
5263
|
+
["Another Claude session sent a message:", "peer"],
|
|
5264
|
+
["Stop hook feedback:", "hook"]
|
|
5265
|
+
];
|
|
5266
|
+
}
|
|
5267
|
+
});
|
|
5268
|
+
|
|
5206
5269
|
// ../engine/dist/core/home-approval.js
|
|
5207
5270
|
import { existsSync as existsSync2, readdirSync, realpathSync } from "fs";
|
|
5208
5271
|
import { homedir as homedir2 } from "os";
|
|
@@ -5581,10 +5644,15 @@ function summarizeMarkers(marked) {
|
|
|
5581
5644
|
}
|
|
5582
5645
|
return counts;
|
|
5583
5646
|
}
|
|
5584
|
-
|
|
5647
|
+
function markersFromTurns(sessionId, turns) {
|
|
5648
|
+
const prompts = turns.filter((t) => t.kind === "user" && t.text).map((t) => ({ line: t.line, ts: t.ts, tsIso: t.tsIso, ...markPrompt(t.text) }));
|
|
5649
|
+
return { v: MARKERS_VERSION, sessionId, prompts, summary: summarizeMarkers(prompts) };
|
|
5650
|
+
}
|
|
5651
|
+
var PROFANITY, PROFANITY_LOOSE, APPROVAL_HEAD, NEG_HEAD, QUESTION_HEAD, DIRECTIVE_HEAD, CLARIFY_PHRASES, FRUSTRATED_PHRASES, MARKERS_VERSION;
|
|
5585
5652
|
var init_session_sentiment = __esm({
|
|
5586
5653
|
"../engine/dist/core/session-sentiment.js"() {
|
|
5587
5654
|
"use strict";
|
|
5655
|
+
init_claude_prompt_origin();
|
|
5588
5656
|
PROFANITY = /\b(fuck(?:ing|er|ed)?|shit|ffs|wtf|bullshit|crap|damn(?:it)?|hell)\b/i;
|
|
5589
5657
|
PROFANITY_LOOSE = /\b(fu[ckj]+(?:ing|er|ed|c?k)?|fukc|fucj|sht|fk|wt[ft])\b/i;
|
|
5590
5658
|
APPROVAL_HEAD = /^(?:yes|y|ok(?:ay)?|sure|alright|fine|i\s*approve|approved|go\s*(?:on|ahead)|do\s*it|continue|please\s*do|sounds?\s*good|let'?s\s*go|ship\s*it|๐|โ+)\b/i;
|
|
@@ -5593,6 +5661,7 @@ var init_session_sentiment = __esm({
|
|
|
5593
5661
|
DIRECTIVE_HEAD = /^(?:please\s+)?(?:use|implement|build|make|add|create|fix|remove|delete|update|refactor|run|deploy|push|merge|test|check|investigate|find|search|show|list|generate|set\s+up|ensure)\b/i;
|
|
5594
5662
|
CLARIFY_PHRASES = /\b(?:wdym|what do you mean|explain|clarify|what is|what's|huh\??|i don'?t understand)\b/i;
|
|
5595
5663
|
FRUSTRATED_PHRASES = /\b(?:why (?:the )?(?:fuck|hell)|wtf|are you (?:kidding|serious)|stop slacking|stop making|why did you|why didn'?t you|i (?:fucking )?(?:asked|told you)|are you (?:listening|even)|come\s*on|just\s+do)\b/i;
|
|
5664
|
+
MARKERS_VERSION = 2;
|
|
5596
5665
|
}
|
|
5597
5666
|
});
|
|
5598
5667
|
|
|
@@ -9630,6 +9699,7 @@ var init_claude = __esm({
|
|
|
9630
9699
|
init_first_prompt();
|
|
9631
9700
|
init_tail_read();
|
|
9632
9701
|
init_project_dir_name();
|
|
9702
|
+
init_claude_prompt_origin();
|
|
9633
9703
|
init_generic_engine();
|
|
9634
9704
|
UUID_RE = /^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/i;
|
|
9635
9705
|
ClaudeBackend = class {
|
|
@@ -9937,6 +10007,15 @@ var init_claude = __esm({
|
|
|
9937
10007
|
}
|
|
9938
10008
|
appendEventsFromText(events, raw, mtime, startLine) {
|
|
9939
10009
|
let lineNum = startLine;
|
|
10010
|
+
const queued = /* @__PURE__ */ new Map();
|
|
10011
|
+
const superseded = /* @__PURE__ */ new Set();
|
|
10012
|
+
const pushPrompt = (e) => {
|
|
10013
|
+
const pending = queued.get(e.text);
|
|
10014
|
+
const earlier = pending?.shift();
|
|
10015
|
+
if (earlier)
|
|
10016
|
+
superseded.add(earlier);
|
|
10017
|
+
events.push(e);
|
|
10018
|
+
};
|
|
9940
10019
|
{
|
|
9941
10020
|
for (const line of raw.split("\n")) {
|
|
9942
10021
|
lineNum++;
|
|
@@ -9952,13 +10031,26 @@ var init_claude = __esm({
|
|
|
9952
10031
|
const ts = tsIso ? Date.parse(tsIso) || mtime : mtime;
|
|
9953
10032
|
if (obj.type === "queue-operation") {
|
|
9954
10033
|
if (obj.operation === "enqueue" && typeof obj.content === "string") {
|
|
9955
|
-
const
|
|
9956
|
-
if (
|
|
9957
|
-
|
|
10034
|
+
const text = stripReminders(obj.content);
|
|
10035
|
+
if (text && originFromText(text) === "human") {
|
|
10036
|
+
const e = { kind: "user", ts, tsIso, line: lineNum, text };
|
|
10037
|
+
events.push(e);
|
|
10038
|
+
const list = queued.get(text);
|
|
10039
|
+
if (list)
|
|
10040
|
+
list.push(e);
|
|
10041
|
+
else
|
|
10042
|
+
queued.set(text, [e]);
|
|
9958
10043
|
}
|
|
9959
10044
|
}
|
|
9960
10045
|
continue;
|
|
9961
10046
|
}
|
|
10047
|
+
const delivered = queuedCommandPrompt(obj);
|
|
10048
|
+
if (delivered) {
|
|
10049
|
+
const text = stripReminders(delivered.text);
|
|
10050
|
+
if (text && delivered.origin === "human")
|
|
10051
|
+
pushPrompt({ kind: "user", ts, tsIso, line: lineNum, text });
|
|
10052
|
+
continue;
|
|
10053
|
+
}
|
|
9962
10054
|
if (obj.type === "user") {
|
|
9963
10055
|
const msg = obj.message;
|
|
9964
10056
|
const content = msg?.content;
|
|
@@ -9993,8 +10085,9 @@ var init_claude = __esm({
|
|
|
9993
10085
|
}
|
|
9994
10086
|
}
|
|
9995
10087
|
const spoken = stripReminders(text);
|
|
9996
|
-
if (spoken)
|
|
9997
|
-
|
|
10088
|
+
if (spoken && userRecordOrigin(obj, spoken) === "human") {
|
|
10089
|
+
pushPrompt({ kind: "user", ts, tsIso, line: lineNum, text: spoken });
|
|
10090
|
+
}
|
|
9998
10091
|
for (const tr of toolResults) {
|
|
9999
10092
|
events.push({
|
|
10000
10093
|
kind: "tool_result",
|
|
@@ -10043,6 +10136,13 @@ var init_claude = __esm({
|
|
|
10043
10136
|
}
|
|
10044
10137
|
}
|
|
10045
10138
|
}
|
|
10139
|
+
if (superseded.size > 0) {
|
|
10140
|
+
let w = 0;
|
|
10141
|
+
for (const e of events)
|
|
10142
|
+
if (!superseded.has(e))
|
|
10143
|
+
events[w++] = e;
|
|
10144
|
+
events.length = w;
|
|
10145
|
+
}
|
|
10046
10146
|
return lineNum;
|
|
10047
10147
|
}
|
|
10048
10148
|
// โโ Per-session operations โ all delegate to the generic engine โ
|
|
@@ -10239,6 +10339,7 @@ var init_session = __esm({
|
|
|
10239
10339
|
"../engine/dist/parsers/session.js"() {
|
|
10240
10340
|
"use strict";
|
|
10241
10341
|
init_banners();
|
|
10342
|
+
init_claude_prompt_origin();
|
|
10242
10343
|
init_claude();
|
|
10243
10344
|
init_tool_paths();
|
|
10244
10345
|
init_project_dir_name();
|
|
@@ -10252,6 +10353,7 @@ var init_claude2 = __esm({
|
|
|
10252
10353
|
"../engine/dist/transcript/claude.js"() {
|
|
10253
10354
|
"use strict";
|
|
10254
10355
|
init_logger();
|
|
10356
|
+
init_claude_prompt_origin();
|
|
10255
10357
|
log2 = createLogger("transcript-claude");
|
|
10256
10358
|
}
|
|
10257
10359
|
});
|
|
@@ -10915,8 +11017,7 @@ function collectDerivedRows(ref, mtime, count, maxRowBytes) {
|
|
|
10915
11017
|
if (fullOutcome.found) data = fullOutcome.commits;
|
|
10916
11018
|
} else if (kind === "markers") {
|
|
10917
11019
|
const turns = extractTurnsAny(id, { maxTurns: 5e4 });
|
|
10918
|
-
|
|
10919
|
-
data = { sessionId: id, prompts, summary: summarizeMarkers(prompts) };
|
|
11020
|
+
data = markersFromTurns(id, turns.turns);
|
|
10920
11021
|
}
|
|
10921
11022
|
} catch {
|
|
10922
11023
|
data = null;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"sync-client.d.ts","sourceRoot":"","sources":["../src/sync-client.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"sync-client.d.ts","sourceRoot":"","sources":["../src/sync-client.ts"],"names":[],"mappings":"AA0CA,OAAO,EAAoF,KAAK,WAAW,EAAE,KAAK,cAAc,EAAE,MAAM,4CAA4C,CAAC;AAUrL,OAAO,EAA+B,KAAK,UAAU,EAAE,MAAM,0CAA0C,CAAC;AA2ExG,yDAAyD;AACzD,wBAAgB,YA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AAS,EAAE,MAAM,CAAC;IAAC,QAAQ,EAAE,iBAAiB,CAAC,UAAU,CAAC,CAAC;IAAC,KAAK,EAAE,MAAM,CAAA;CAAE,GAAG,IAAI,CAAC,CAgFlJ;AAED;;;;;;GAMG;AACH;;;;;;;;GAQG;AACH;;;;yCAIyC;AACzC,MAAM,WAAW,QAAQ;IAAG,OAAO,EAAE,gBAAgB,GAAG,QAAQ,GAAG,WAAW,CAAA;CAAE;AAEhF,wBAAgB,UAAU,CAAC,CAAC,EAAE,UAAU,GAAG,QAAQ,GAAG,CAAC,IAAI,QAAQ,CAElE;AAED,wBAAsB,eAAe,CAAC,IAAI,GAAE;IAAE,KAAK,CAAC,EAAE,MAAM,GAAG,SAAS,CAAA;CAAO,GAAG,OAAO,CAAC,UAAU,GAAG,QAAQ,CAAC,CA4C/G"}
|
package/dist/sync-client.js
CHANGED
|
@@ -31,6 +31,7 @@
|
|
|
31
31
|
* server owns them.
|
|
32
32
|
*/
|
|
33
33
|
import { join, dirname, basename } from 'node:path';
|
|
34
|
+
import { isPersonMessage } from '@chat-recall/engine/core/claude-prompt-origin.js';
|
|
34
35
|
import { envCredentials } from '@chat-recall/engine/core/credentials-env.js';
|
|
35
36
|
import { readFileSync, writeFileSync, mkdirSync, mkdtempSync, rmSync, chmodSync, unlinkSync, readdirSync, statSync } from 'node:fs';
|
|
36
37
|
import { tmpdir, hostname } from 'node:os';
|
|
@@ -1715,7 +1716,8 @@ async function syncToTargetInScope(cred, opts = {}) {
|
|
|
1715
1716
|
// corpus runs for a long time, and "0 of 15,724" is the difference between a
|
|
1716
1717
|
// user waiting and a user assuming it is broken.
|
|
1717
1718
|
const walkStartedAt = Date.now();
|
|
1718
|
-
|
|
1719
|
+
const firstWalk = (ledger ?? getSyncedRows(base)).size === 0;
|
|
1720
|
+
reportWalkProgress({ done: 0, total: slice.length, startedAt: walkStartedAt, complete: false, first: firstWalk });
|
|
1719
1721
|
walkProgressForUpload = { done: 0, total: slice.length, complete: false };
|
|
1720
1722
|
let traceN = 0;
|
|
1721
1723
|
// โโ KEEP THE EVENT LOOP ALIVE โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
|
|
@@ -1771,7 +1773,7 @@ async function syncToTargetInScope(cred, opts = {}) {
|
|
|
1771
1773
|
// holding done === total with complete:false forever, and the UI read that
|
|
1772
1774
|
// as "syncing 99%" until something else happened to sync.
|
|
1773
1775
|
const walkDone = considered >= slice.length;
|
|
1774
|
-
reportWalkProgress({ done: considered, total: slice.length, startedAt: walkStartedAt, complete: walkDone });
|
|
1776
|
+
reportWalkProgress({ done: considered, total: slice.length, startedAt: walkStartedAt, complete: walkDone, first: firstWalk });
|
|
1775
1777
|
walkProgressForUpload = { done: considered, total: slice.length, complete: walkDone };
|
|
1776
1778
|
if (trace && ++traceN % 500 === 0)
|
|
1777
1779
|
trace(`walk ${traceN}/${slice.length} ยท at ${ref.prefixedId}`);
|
|
@@ -2214,7 +2216,7 @@ async function syncToTargetInScope(cred, opts = {}) {
|
|
|
2214
2216
|
// showing a frozen "8,400 of 15,724" forever โ and it is also how a reader
|
|
2215
2217
|
// tells a finished walk from a daemon that died mid-walk, which is the state
|
|
2216
2218
|
// an in-progress value left behind means.
|
|
2217
|
-
reportWalkProgress({ done: slice.length, total: slice.length, startedAt: walkStartedAt, complete: true });
|
|
2219
|
+
reportWalkProgress({ done: slice.length, total: slice.length, startedAt: walkStartedAt, complete: true, first: firstWalk });
|
|
2218
2220
|
walkProgressForUpload = { done: slice.length, total: slice.length, complete: true };
|
|
2219
2221
|
return {
|
|
2220
2222
|
uploaded: convBatch.sent + appendResults.uploaded, skipped, redactions,
|
|
@@ -2460,7 +2462,7 @@ export async function buildConversationSync(ref, mtime, opts = {}) {
|
|
|
2460
2462
|
// "sessions" were these internal calls; indexing them buries the real
|
|
2461
2463
|
// conversation list. Anchored to the first user message so a real chat that
|
|
2462
2464
|
// merely quotes the prompt is not dropped.
|
|
2463
|
-
const firstUser = textMessages.find(
|
|
2465
|
+
const firstUser = textMessages.find(isPersonMessage);
|
|
2464
2466
|
if (isInternalToolPrompt(firstUser?.content))
|
|
2465
2467
|
return null;
|
|
2466
2468
|
// Trim payload bodies (tool inputs/results, thinking โ raw replay never
|
|
@@ -2476,7 +2478,7 @@ export async function buildConversationSync(ref, mtime, opts = {}) {
|
|
|
2476
2478
|
const meta = { messageCount: textMessages.length };
|
|
2477
2479
|
// Single-prompt invocations (batch/bot runs) carry a flag so the UI can
|
|
2478
2480
|
// badge them and lists can de-emphasize them.
|
|
2479
|
-
if (textMessages.filter(
|
|
2481
|
+
if (textMessages.filter(isPersonMessage).length <= 1)
|
|
2480
2482
|
meta.oneShot = true;
|
|
2481
2483
|
// Real project path: the cwd read live from inside the transcript wins over
|
|
2482
2484
|
// the decoded dir name (`chat-recall` โ `chat/recall` mangling).
|
|
@@ -2683,7 +2685,7 @@ export async function buildConversationSync(ref, mtime, opts = {}) {
|
|
|
2683
2685
|
envelope,
|
|
2684
2686
|
raw_b64,
|
|
2685
2687
|
raw_size,
|
|
2686
|
-
first_prompt: envTexts.find(
|
|
2688
|
+
first_prompt: envTexts.find(isPersonMessage)?.content?.slice(0, 200),
|
|
2687
2689
|
// Byte offset this FULL sync is synced THROUGH (file size at build time,
|
|
2688
2690
|
// or the end of the bounded tail for an oversized session). The server
|
|
2689
2691
|
// stores it as the envelope's `o`; the ledger records the SAME value
|
|
@@ -2760,7 +2762,7 @@ export async function buildConversationTail(ref, fromOffset, opts = {}) {
|
|
|
2760
2762
|
}
|
|
2761
2763
|
// Skip chat-recall's OWN internal prompts in the tail (same gate as the
|
|
2762
2764
|
// full builder). A tail that is ONLY an internal prompt ships nothing.
|
|
2763
|
-
const firstUser = textMessages.find(
|
|
2765
|
+
const firstUser = textMessages.find(isPersonMessage);
|
|
2764
2766
|
if (isInternalToolPrompt(firstUser?.content))
|
|
2765
2767
|
return null;
|
|
2766
2768
|
// Trim + redact the tail envelope only (not the whole transcript).
|