chat-recall 0.7.24 → 0.7.25
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 +40 -14
- package/dist/mcp-relay.js +1 -1
- package/dist/mcp.js +108 -84
- package/dist/message-hook-core.d.ts.map +1 -1
- package/dist/message-hook-core.js +4 -1
- package/dist/message-hook-core.js.map +1 -1
- package/dist/message-hook.js +2 -2
- package/dist/watch.js +5 -5
- package/package.json +1 -1
package/dist/cli.js
CHANGED
|
@@ -28164,7 +28164,7 @@ var init_http = __esm({
|
|
|
28164
28164
|
CLI_VERSION = JSON.parse(readFileSync34(new URL("../package.json", import.meta.url), "utf-8")).version || CLI_VERSION;
|
|
28165
28165
|
} catch {
|
|
28166
28166
|
try {
|
|
28167
|
-
if (true) CLI_VERSION = "0.7.
|
|
28167
|
+
if (true) CLI_VERSION = "0.7.25";
|
|
28168
28168
|
} catch {
|
|
28169
28169
|
}
|
|
28170
28170
|
}
|
|
@@ -28662,7 +28662,7 @@ var init_telemetry = __esm({
|
|
|
28662
28662
|
init_sync_client();
|
|
28663
28663
|
cliVersion2 = () => {
|
|
28664
28664
|
try {
|
|
28665
|
-
return true ? "0.7.
|
|
28665
|
+
return true ? "0.7.25" : "dev";
|
|
28666
28666
|
} catch {
|
|
28667
28667
|
return "dev";
|
|
28668
28668
|
}
|
|
@@ -31275,7 +31275,7 @@ var init_sync_client = __esm({
|
|
|
31275
31275
|
ownVersion = JSON.parse(readFileSync39(join46(dir, "../package.json"), "utf-8")).version || ownVersion;
|
|
31276
31276
|
} catch {
|
|
31277
31277
|
try {
|
|
31278
|
-
if (true) ownVersion = "0.7.
|
|
31278
|
+
if (true) ownVersion = "0.7.25";
|
|
31279
31279
|
} catch {
|
|
31280
31280
|
}
|
|
31281
31281
|
}
|
|
@@ -33671,6 +33671,22 @@ var init_guard_registration = __esm({
|
|
|
33671
33671
|
}
|
|
33672
33672
|
});
|
|
33673
33673
|
|
|
33674
|
+
// ../engine/dist/core/session-messages.js
|
|
33675
|
+
function selfIntroduction(sessionId) {
|
|
33676
|
+
return [
|
|
33677
|
+
MESSAGES_MARKER,
|
|
33678
|
+
`chat-recall session id: ${sessionId}`,
|
|
33679
|
+
"Other sessions of this account can send messages here. Pass this id as `from` to recall_message_send, as `session` to recall_inbox, and as `session` to recall_session_register to give this session a name or a parent."
|
|
33680
|
+
].join("\n");
|
|
33681
|
+
}
|
|
33682
|
+
var MESSAGES_MARKER;
|
|
33683
|
+
var init_session_messages = __esm({
|
|
33684
|
+
"../engine/dist/core/session-messages.js"() {
|
|
33685
|
+
"use strict";
|
|
33686
|
+
MESSAGES_MARKER = "<!-- chat-recall-messages -->";
|
|
33687
|
+
}
|
|
33688
|
+
});
|
|
33689
|
+
|
|
33674
33690
|
// ../engine/dist/core/message-registration.js
|
|
33675
33691
|
var message_registration_exports = {};
|
|
33676
33692
|
__export(message_registration_exports, {
|
|
@@ -33905,10 +33921,11 @@ function opencodeMessagesSource(wrapperPath) {
|
|
|
33905
33921
|
// other sessions sent it to the next prompt.
|
|
33906
33922
|
${runnerSource(wrapperPath)}
|
|
33907
33923
|
const RUN_END = new Set(["session.execution.succeeded", "session.execution.failed", "session.execution.interrupted", "session.idle"]);
|
|
33924
|
+
const INTRO = ${JSON.stringify(selfIntroduction("\0SESSION\0"))};
|
|
33925
|
+
const intro = (id) => INTRO.replace("\0SESSION\0", "opencode_" + id);
|
|
33908
33926
|
|
|
33909
33927
|
async function setup(ctx) {
|
|
33910
33928
|
const dir = ctx?.location?.directory;
|
|
33911
|
-
const started = new Set();
|
|
33912
33929
|
const children = new Set();
|
|
33913
33930
|
const isChild = async (id) => {
|
|
33914
33931
|
if (children.has(id)) return true;
|
|
@@ -33922,28 +33939,31 @@ async function setup(ctx) {
|
|
|
33922
33939
|
const id = event?.sessionID;
|
|
33923
33940
|
if (!id || !event.prompt || (await isChild(id))) return;
|
|
33924
33941
|
stopWaiter("opencode_" + id);
|
|
33925
|
-
|
|
33926
|
-
|
|
33927
|
-
started.add(id);
|
|
33928
|
-
parts.push(await runHook("opencode_" + id, "SessionStart", dir));
|
|
33929
|
-
}
|
|
33930
|
-
parts.push(await runHook("opencode_" + id, "UserPromptSubmit", dir));
|
|
33931
|
-
const text = parts.filter(Boolean).join("\\n\\n");
|
|
33942
|
+
// The first prompt registers the session; the hook adds only waiting messages.
|
|
33943
|
+
const text = await runHook("opencode_" + id, "UserPromptSubmit", dir);
|
|
33932
33944
|
if (text) event.prompt.text = [event.prompt.text, text].filter(Boolean).join("\\n\\n");
|
|
33933
33945
|
});
|
|
33946
|
+
// The session id goes into the system context of each model call: the agent
|
|
33947
|
+
// always knows it, the user does not see it, and no prompt repeats it.
|
|
33948
|
+
await ctx.session.hook("context", async (event) => {
|
|
33949
|
+
const id = event?.sessionID;
|
|
33950
|
+
if (!id || !Array.isArray(event.system) || (await isChild(id))) return;
|
|
33951
|
+
event.system.push({ type: "text", text: intro(id) });
|
|
33952
|
+
});
|
|
33934
33953
|
const controller = new AbortController();
|
|
33935
33954
|
(async () => {
|
|
33936
33955
|
try {
|
|
33937
33956
|
for await (const ev of ctx.event.subscribe({ signal: controller.signal })) {
|
|
33938
33957
|
const id = ev?.data?.sessionID ?? ev?.properties?.sessionID;
|
|
33939
|
-
|
|
33958
|
+
// A session that was open before this plugin loaded (a reload, an
|
|
33959
|
+
// update) is not in started, and still gets its waiter.
|
|
33960
|
+
if (!id || (await isChild(id))) continue;
|
|
33940
33961
|
if (RUN_END.has(ev.type)) {
|
|
33941
33962
|
await runHook("opencode_" + id, "Stop", dir);
|
|
33942
33963
|
// An idle session acts on a message from another session by itself:
|
|
33943
33964
|
// the text becomes its next prompt.
|
|
33944
33965
|
startWaiter("opencode_" + id, dir, (text) => ctx.session.prompt({ sessionID: id, text }));
|
|
33945
33966
|
} else if (ev.type === "session.deleted") {
|
|
33946
|
-
started.delete(id);
|
|
33947
33967
|
stopWaiter("opencode_" + id);
|
|
33948
33968
|
await runHook("opencode_" + id, "SessionEnd", dir);
|
|
33949
33969
|
}
|
|
@@ -33981,6 +34001,11 @@ async function server({ directory }) {
|
|
|
33981
34001
|
await runHook("opencode_" + info.id, "SessionEnd", directory);
|
|
33982
34002
|
}
|
|
33983
34003
|
},
|
|
34004
|
+
"experimental.chat.system.transform": async (input, output) => {
|
|
34005
|
+
const id = input?.sessionID;
|
|
34006
|
+
if (!id || children.has(id) || !Array.isArray(output?.system)) return;
|
|
34007
|
+
output.system.push(intro(id));
|
|
34008
|
+
},
|
|
33984
34009
|
"chat.message": async (input, output) => {
|
|
33985
34010
|
const id = input?.sessionID;
|
|
33986
34011
|
if (!id || children.has(id) || !output?.message) return;
|
|
@@ -34038,6 +34063,7 @@ var init_message_registration = __esm({
|
|
|
34038
34063
|
"use strict";
|
|
34039
34064
|
init_backends();
|
|
34040
34065
|
init_guard_registration();
|
|
34066
|
+
init_session_messages();
|
|
34041
34067
|
MESSAGES_ID = "chat-recall-messages";
|
|
34042
34068
|
TIMEOUT_SECS2 = 10;
|
|
34043
34069
|
isOurs2 = (cmd) => typeof cmd === "string" && cmd.includes("chat_recall_messages_");
|
|
@@ -36380,7 +36406,7 @@ var init_intent_drain = __esm({
|
|
|
36380
36406
|
ownVersion2 = JSON.parse(readFileSync49(join62(dir, "../package.json"), "utf-8")).version || ownVersion2;
|
|
36381
36407
|
} catch {
|
|
36382
36408
|
try {
|
|
36383
|
-
if (true) ownVersion2 = "0.7.
|
|
36409
|
+
if (true) ownVersion2 = "0.7.25";
|
|
36384
36410
|
} catch {
|
|
36385
36411
|
}
|
|
36386
36412
|
}
|
package/dist/mcp-relay.js
CHANGED
|
@@ -299,7 +299,7 @@ function resilientBridge(input, output, first, reconnect, exit, opts = {}) {
|
|
|
299
299
|
}
|
|
300
300
|
|
|
301
301
|
// src/mcp-relay.ts
|
|
302
|
-
var VERSION = true ? "0.7.
|
|
302
|
+
var VERSION = true ? "0.7.25" : "0.0.0";
|
|
303
303
|
var SERVER_URL = new URL("./mcp.js", import.meta.url);
|
|
304
304
|
var SERVER_PATH = fileURLToPath(SERVER_URL);
|
|
305
305
|
var START_TIMEOUT_MS = 15e3;
|
package/dist/mcp.js
CHANGED
|
@@ -14805,6 +14805,89 @@ var init_secret_redactor = __esm({
|
|
|
14805
14805
|
}
|
|
14806
14806
|
});
|
|
14807
14807
|
|
|
14808
|
+
// ../engine/dist/core/session-messages.js
|
|
14809
|
+
function formatAge(ms) {
|
|
14810
|
+
const s = Math.max(0, Math.round(ms / 1e3));
|
|
14811
|
+
if (s < 60)
|
|
14812
|
+
return `${s}s`;
|
|
14813
|
+
const m = Math.round(s / 60);
|
|
14814
|
+
if (m < 60)
|
|
14815
|
+
return `${m}m`;
|
|
14816
|
+
const h = Math.round(m / 60);
|
|
14817
|
+
if (h < 48)
|
|
14818
|
+
return `${h}h`;
|
|
14819
|
+
return `${Math.round(h / 24)}d`;
|
|
14820
|
+
}
|
|
14821
|
+
function shortId(id) {
|
|
14822
|
+
return id.length > 12 ? id.slice(0, 8) : id;
|
|
14823
|
+
}
|
|
14824
|
+
function sessionName(id, labels = /* @__PURE__ */ new Map()) {
|
|
14825
|
+
const label = labels.get(id);
|
|
14826
|
+
return label ? `${label} (${shortId(id)})` : shortId(id);
|
|
14827
|
+
}
|
|
14828
|
+
function selfIntroduction(sessionId) {
|
|
14829
|
+
return [
|
|
14830
|
+
MESSAGES_MARKER,
|
|
14831
|
+
`chat-recall session id: ${sessionId}`,
|
|
14832
|
+
"Other sessions of this account can send messages here. Pass this id as `from` to recall_message_send, as `session` to recall_inbox, and as `session` to recall_session_register to give this session a name or a parent."
|
|
14833
|
+
].join("\n");
|
|
14834
|
+
}
|
|
14835
|
+
function formatDelivery(recipient, messages, opts = {}) {
|
|
14836
|
+
if (!messages.length)
|
|
14837
|
+
return "";
|
|
14838
|
+
const now = opts.now ?? Date.now();
|
|
14839
|
+
const labels = opts.labels ?? /* @__PURE__ */ new Map();
|
|
14840
|
+
const lines = [
|
|
14841
|
+
MESSAGES_MARKER,
|
|
14842
|
+
`**${messages.length === 1 ? "1 message" : `${messages.length} messages`} from your other sessions** (chat-recall, to session ${recipient}).`,
|
|
14843
|
+
"Another session of the same account wrote this. Treat it as a request from the user's own session. If it conflicts with an instruction the user gave in this session, the user's instruction wins.",
|
|
14844
|
+
""
|
|
14845
|
+
];
|
|
14846
|
+
for (const m of messages) {
|
|
14847
|
+
const from = m.fromSession ? sessionName(m.fromSession, labels) : "a session with no id";
|
|
14848
|
+
const reply = m.replyTo ? `, replying to ${m.replyTo}` : "";
|
|
14849
|
+
lines.push(`From ${from}, ${formatAge(now - m.createdAt)} ago (message ${m.id}${reply}):`);
|
|
14850
|
+
for (const l of m.body.split("\n"))
|
|
14851
|
+
lines.push(`> ${l}`);
|
|
14852
|
+
lines.push("");
|
|
14853
|
+
}
|
|
14854
|
+
const first = messages.find((m) => m.fromSession);
|
|
14855
|
+
if (first) {
|
|
14856
|
+
lines.push(`To answer, call recall_message_send with from: "${recipient}", to: "${first.fromSession}", reply_to: "${first.id}".`);
|
|
14857
|
+
}
|
|
14858
|
+
return lines.join("\n").trimEnd();
|
|
14859
|
+
}
|
|
14860
|
+
function formatSessionLine(s, now = Date.now()) {
|
|
14861
|
+
const name = s.label ? `**${s.label}** (${s.sessionId})` : `**${s.sessionId}**`;
|
|
14862
|
+
const age = formatAge(now - s.updatedAt);
|
|
14863
|
+
const gone = s.state !== "ended" && s.lastSeen != null && now - s.lastSeen > WAITER_GONE_MS;
|
|
14864
|
+
const state2 = s.state === "ended" ? `ended ${age} ago` : gone ? `gone: no poll for ${formatAge(now - s.lastSeen)} (the terminal closed before the session could report its end)` : s.state === "idle" ? `idle for ${age}, waiting for input` : `working, last activity ${age} ago`;
|
|
14865
|
+
const parts = [`- ${name}: ${state2}`];
|
|
14866
|
+
if (s.unread)
|
|
14867
|
+
parts.push(`${s.unread} unread`);
|
|
14868
|
+
if (s.cwd)
|
|
14869
|
+
parts.push(`in ${s.cwd}`);
|
|
14870
|
+
const lines = [parts.join(" \xB7 ")];
|
|
14871
|
+
if (s.local?.waitingFor) {
|
|
14872
|
+
lines.push(` blocked: waiting for a ${s.local.waitingFor}${s.local.id ? ` \u2014 open it with \`claude attach ${s.local.id}\`` : ""}`);
|
|
14873
|
+
} else if (s.local?.kind === "background" && s.local.id) {
|
|
14874
|
+
lines.push(` background session: \`claude attach ${s.local.id}\` opens it`);
|
|
14875
|
+
}
|
|
14876
|
+
if (s.doing)
|
|
14877
|
+
lines.push(` doing: ${s.doing}`);
|
|
14878
|
+
for (const c of s.cards ?? [])
|
|
14879
|
+
lines.push(` card ${c.id}: ${c.title}`);
|
|
14880
|
+
return lines.join("\n");
|
|
14881
|
+
}
|
|
14882
|
+
var MESSAGES_MARKER, WAITER_GONE_MS;
|
|
14883
|
+
var init_session_messages = __esm({
|
|
14884
|
+
"../engine/dist/core/session-messages.js"() {
|
|
14885
|
+
"use strict";
|
|
14886
|
+
MESSAGES_MARKER = "<!-- chat-recall-messages -->";
|
|
14887
|
+
WAITER_GONE_MS = 9e4;
|
|
14888
|
+
}
|
|
14889
|
+
});
|
|
14890
|
+
|
|
14808
14891
|
// ../engine/dist/core/which.js
|
|
14809
14892
|
import { existsSync as existsSync19, statSync as statSync20, accessSync as accessSync2, constants as constants2 } from "node:fs";
|
|
14810
14893
|
import { join as join25, isAbsolute as isAbsolute3, delimiter as delimiter2, sep as sep2 } from "node:path";
|
|
@@ -28976,7 +29059,7 @@ var init_http = __esm({
|
|
|
28976
29059
|
CLI_VERSION = JSON.parse(readFileSync41(new URL("../package.json", import.meta.url), "utf-8")).version || CLI_VERSION;
|
|
28977
29060
|
} catch {
|
|
28978
29061
|
try {
|
|
28979
|
-
if (true) CLI_VERSION = "0.7.
|
|
29062
|
+
if (true) CLI_VERSION = "0.7.25";
|
|
28980
29063
|
} catch {
|
|
28981
29064
|
}
|
|
28982
29065
|
}
|
|
@@ -29474,7 +29557,7 @@ var init_telemetry = __esm({
|
|
|
29474
29557
|
init_sync_client();
|
|
29475
29558
|
cliVersion2 = () => {
|
|
29476
29559
|
try {
|
|
29477
|
-
return true ? "0.7.
|
|
29560
|
+
return true ? "0.7.25" : "dev";
|
|
29478
29561
|
} catch {
|
|
29479
29562
|
return "dev";
|
|
29480
29563
|
}
|
|
@@ -31869,7 +31952,7 @@ var init_sync_client = __esm({
|
|
|
31869
31952
|
ownVersion = JSON.parse(readFileSync44(join55(dir, "../package.json"), "utf-8")).version || ownVersion;
|
|
31870
31953
|
} catch {
|
|
31871
31954
|
try {
|
|
31872
|
-
if (true) ownVersion = "0.7.
|
|
31955
|
+
if (true) ownVersion = "0.7.25";
|
|
31873
31956
|
} catch {
|
|
31874
31957
|
}
|
|
31875
31958
|
}
|
|
@@ -33147,10 +33230,11 @@ function opencodeMessagesSource(wrapperPath) {
|
|
|
33147
33230
|
// other sessions sent it to the next prompt.
|
|
33148
33231
|
${runnerSource(wrapperPath)}
|
|
33149
33232
|
const RUN_END = new Set(["session.execution.succeeded", "session.execution.failed", "session.execution.interrupted", "session.idle"]);
|
|
33233
|
+
const INTRO = ${JSON.stringify(selfIntroduction("\0SESSION\0"))};
|
|
33234
|
+
const intro = (id) => INTRO.replace("\0SESSION\0", "opencode_" + id);
|
|
33150
33235
|
|
|
33151
33236
|
async function setup(ctx) {
|
|
33152
33237
|
const dir = ctx?.location?.directory;
|
|
33153
|
-
const started = new Set();
|
|
33154
33238
|
const children = new Set();
|
|
33155
33239
|
const isChild = async (id) => {
|
|
33156
33240
|
if (children.has(id)) return true;
|
|
@@ -33164,28 +33248,31 @@ async function setup(ctx) {
|
|
|
33164
33248
|
const id = event?.sessionID;
|
|
33165
33249
|
if (!id || !event.prompt || (await isChild(id))) return;
|
|
33166
33250
|
stopWaiter("opencode_" + id);
|
|
33167
|
-
|
|
33168
|
-
|
|
33169
|
-
started.add(id);
|
|
33170
|
-
parts.push(await runHook("opencode_" + id, "SessionStart", dir));
|
|
33171
|
-
}
|
|
33172
|
-
parts.push(await runHook("opencode_" + id, "UserPromptSubmit", dir));
|
|
33173
|
-
const text = parts.filter(Boolean).join("\\n\\n");
|
|
33251
|
+
// The first prompt registers the session; the hook adds only waiting messages.
|
|
33252
|
+
const text = await runHook("opencode_" + id, "UserPromptSubmit", dir);
|
|
33174
33253
|
if (text) event.prompt.text = [event.prompt.text, text].filter(Boolean).join("\\n\\n");
|
|
33175
33254
|
});
|
|
33255
|
+
// The session id goes into the system context of each model call: the agent
|
|
33256
|
+
// always knows it, the user does not see it, and no prompt repeats it.
|
|
33257
|
+
await ctx.session.hook("context", async (event) => {
|
|
33258
|
+
const id = event?.sessionID;
|
|
33259
|
+
if (!id || !Array.isArray(event.system) || (await isChild(id))) return;
|
|
33260
|
+
event.system.push({ type: "text", text: intro(id) });
|
|
33261
|
+
});
|
|
33176
33262
|
const controller = new AbortController();
|
|
33177
33263
|
(async () => {
|
|
33178
33264
|
try {
|
|
33179
33265
|
for await (const ev of ctx.event.subscribe({ signal: controller.signal })) {
|
|
33180
33266
|
const id = ev?.data?.sessionID ?? ev?.properties?.sessionID;
|
|
33181
|
-
|
|
33267
|
+
// A session that was open before this plugin loaded (a reload, an
|
|
33268
|
+
// update) is not in started, and still gets its waiter.
|
|
33269
|
+
if (!id || (await isChild(id))) continue;
|
|
33182
33270
|
if (RUN_END.has(ev.type)) {
|
|
33183
33271
|
await runHook("opencode_" + id, "Stop", dir);
|
|
33184
33272
|
// An idle session acts on a message from another session by itself:
|
|
33185
33273
|
// the text becomes its next prompt.
|
|
33186
33274
|
startWaiter("opencode_" + id, dir, (text) => ctx.session.prompt({ sessionID: id, text }));
|
|
33187
33275
|
} else if (ev.type === "session.deleted") {
|
|
33188
|
-
started.delete(id);
|
|
33189
33276
|
stopWaiter("opencode_" + id);
|
|
33190
33277
|
await runHook("opencode_" + id, "SessionEnd", dir);
|
|
33191
33278
|
}
|
|
@@ -33223,6 +33310,11 @@ async function server({ directory }) {
|
|
|
33223
33310
|
await runHook("opencode_" + info.id, "SessionEnd", directory);
|
|
33224
33311
|
}
|
|
33225
33312
|
},
|
|
33313
|
+
"experimental.chat.system.transform": async (input, output) => {
|
|
33314
|
+
const id = input?.sessionID;
|
|
33315
|
+
if (!id || children.has(id) || !Array.isArray(output?.system)) return;
|
|
33316
|
+
output.system.push(intro(id));
|
|
33317
|
+
},
|
|
33226
33318
|
"chat.message": async (input, output) => {
|
|
33227
33319
|
const id = input?.sessionID;
|
|
33228
33320
|
if (!id || children.has(id) || !output?.message) return;
|
|
@@ -33280,6 +33372,7 @@ var init_message_registration = __esm({
|
|
|
33280
33372
|
"use strict";
|
|
33281
33373
|
init_backends();
|
|
33282
33374
|
init_guard_registration();
|
|
33375
|
+
init_session_messages();
|
|
33283
33376
|
MESSAGES_ID = "chat-recall-messages";
|
|
33284
33377
|
TIMEOUT_SECS2 = 10;
|
|
33285
33378
|
isOurs2 = (cmd) => typeof cmd === "string" && cmd.includes("chat_recall_messages_");
|
|
@@ -35064,77 +35157,8 @@ async function spawnChild(input) {
|
|
|
35064
35157
|
return { attachId, sessionId, cwd };
|
|
35065
35158
|
}
|
|
35066
35159
|
|
|
35067
|
-
// ../engine/dist/core/session-messages.js
|
|
35068
|
-
var MESSAGES_MARKER = "<!-- chat-recall-messages -->";
|
|
35069
|
-
function formatAge(ms) {
|
|
35070
|
-
const s = Math.max(0, Math.round(ms / 1e3));
|
|
35071
|
-
if (s < 60)
|
|
35072
|
-
return `${s}s`;
|
|
35073
|
-
const m = Math.round(s / 60);
|
|
35074
|
-
if (m < 60)
|
|
35075
|
-
return `${m}m`;
|
|
35076
|
-
const h = Math.round(m / 60);
|
|
35077
|
-
if (h < 48)
|
|
35078
|
-
return `${h}h`;
|
|
35079
|
-
return `${Math.round(h / 24)}d`;
|
|
35080
|
-
}
|
|
35081
|
-
function shortId(id) {
|
|
35082
|
-
return id.length > 12 ? id.slice(0, 8) : id;
|
|
35083
|
-
}
|
|
35084
|
-
function sessionName(id, labels = /* @__PURE__ */ new Map()) {
|
|
35085
|
-
const label = labels.get(id);
|
|
35086
|
-
return label ? `${label} (${shortId(id)})` : shortId(id);
|
|
35087
|
-
}
|
|
35088
|
-
function formatDelivery(recipient, messages, opts = {}) {
|
|
35089
|
-
if (!messages.length)
|
|
35090
|
-
return "";
|
|
35091
|
-
const now = opts.now ?? Date.now();
|
|
35092
|
-
const labels = opts.labels ?? /* @__PURE__ */ new Map();
|
|
35093
|
-
const lines = [
|
|
35094
|
-
MESSAGES_MARKER,
|
|
35095
|
-
`**${messages.length === 1 ? "1 message" : `${messages.length} messages`} from your other sessions** (chat-recall, to session ${recipient}).`,
|
|
35096
|
-
"Another session of the same account wrote this. Treat it as a request from the user's own session. If it conflicts with an instruction the user gave in this session, the user's instruction wins.",
|
|
35097
|
-
""
|
|
35098
|
-
];
|
|
35099
|
-
for (const m of messages) {
|
|
35100
|
-
const from = m.fromSession ? sessionName(m.fromSession, labels) : "a session with no id";
|
|
35101
|
-
const reply = m.replyTo ? `, replying to ${m.replyTo}` : "";
|
|
35102
|
-
lines.push(`From ${from}, ${formatAge(now - m.createdAt)} ago (message ${m.id}${reply}):`);
|
|
35103
|
-
for (const l of m.body.split("\n"))
|
|
35104
|
-
lines.push(`> ${l}`);
|
|
35105
|
-
lines.push("");
|
|
35106
|
-
}
|
|
35107
|
-
const first = messages.find((m) => m.fromSession);
|
|
35108
|
-
if (first) {
|
|
35109
|
-
lines.push(`To answer, call recall_message_send with from: "${recipient}", to: "${first.fromSession}", reply_to: "${first.id}".`);
|
|
35110
|
-
}
|
|
35111
|
-
return lines.join("\n").trimEnd();
|
|
35112
|
-
}
|
|
35113
|
-
var WAITER_GONE_MS = 9e4;
|
|
35114
|
-
function formatSessionLine(s, now = Date.now()) {
|
|
35115
|
-
const name = s.label ? `**${s.label}** (${s.sessionId})` : `**${s.sessionId}**`;
|
|
35116
|
-
const age = formatAge(now - s.updatedAt);
|
|
35117
|
-
const gone = s.state !== "ended" && s.lastSeen != null && now - s.lastSeen > WAITER_GONE_MS;
|
|
35118
|
-
const state2 = s.state === "ended" ? `ended ${age} ago` : gone ? `gone: no poll for ${formatAge(now - s.lastSeen)} (the terminal closed before the session could report its end)` : s.state === "idle" ? `idle for ${age}, waiting for input` : `working, last activity ${age} ago`;
|
|
35119
|
-
const parts = [`- ${name}: ${state2}`];
|
|
35120
|
-
if (s.unread)
|
|
35121
|
-
parts.push(`${s.unread} unread`);
|
|
35122
|
-
if (s.cwd)
|
|
35123
|
-
parts.push(`in ${s.cwd}`);
|
|
35124
|
-
const lines = [parts.join(" \xB7 ")];
|
|
35125
|
-
if (s.local?.waitingFor) {
|
|
35126
|
-
lines.push(` blocked: waiting for a ${s.local.waitingFor}${s.local.id ? ` \u2014 open it with \`claude attach ${s.local.id}\`` : ""}`);
|
|
35127
|
-
} else if (s.local?.kind === "background" && s.local.id) {
|
|
35128
|
-
lines.push(` background session: \`claude attach ${s.local.id}\` opens it`);
|
|
35129
|
-
}
|
|
35130
|
-
if (s.doing)
|
|
35131
|
-
lines.push(` doing: ${s.doing}`);
|
|
35132
|
-
for (const c of s.cards ?? [])
|
|
35133
|
-
lines.push(` card ${c.id}: ${c.title}`);
|
|
35134
|
-
return lines.join("\n");
|
|
35135
|
-
}
|
|
35136
|
-
|
|
35137
35160
|
// ../engine/dist/mcp/tools.js
|
|
35161
|
+
init_session_messages();
|
|
35138
35162
|
init_backends();
|
|
35139
35163
|
init_tool_backend();
|
|
35140
35164
|
|
|
@@ -40339,7 +40363,7 @@ function installCrashGuards() {
|
|
|
40339
40363
|
reportClientEvent2("mcp_crash", { message: err.stack || err.message });
|
|
40340
40364
|
});
|
|
40341
40365
|
}
|
|
40342
|
-
var RELAY_VERSION = true ? "0.7.
|
|
40366
|
+
var RELAY_VERSION = true ? "0.7.25" : "0.0.0";
|
|
40343
40367
|
function daemonIdleSecs() {
|
|
40344
40368
|
const raw = process.env.CHAT_RECALL_DAEMON_IDLE_SECS;
|
|
40345
40369
|
if (raw === void 0) return 900;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"message-hook-core.d.ts","sourceRoot":"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IACzB,kDAAkD;IAClD,MAAM,EAAE,MAAM,CAAC;IACf,KAAK,EAAE,SAAS,CAAC;CAClB;AAUD;;;GAGG;AACH,wBAAgB,WAAW,CAAC,IAAI,EAAE,QAAQ,EAAE,KAAK,EAAE,MAAM,GAAG,MAAM,CAGjE;AAED,gFAAgF;AAChF,wBAAgB,SAAS,CACvB,IAAI,EAAE,QAAQ,EACd,QAAQ,EAAE,SAAS,WAAW,EAAE,EAChC,KAAK,EAAE,SAAS,EAChB,GAAG,EAAE,MAAM,EACX,MAAM,GAAE,WAAW,CAAC,MAAM,EAAE,MAAM,GAAG,IAAI,CAAa,EACtD,IAAI,GAAE,QAAmB,GACxB,UAAU,CAwBZ;AAED,2FAA2F;AAC3F,wBAAgB,UAAU,CACxB,SAAS,EAAE,MAAM,EACjB,QAAQ,EAAE,SAAS,WAAW,EAAE,EAChC,GAAG,EAAE,MAAM,EACX,MAAM,GAAE,WAAW,CAAC,MAAM,EAAE,MAAM,GAAG,IAAI,CAAa,GACrD,MAAM,CAER"}
|
|
@@ -151,7 +151,10 @@ export function renderRun(plan, messages, state, now, labels = new Map(), tool =
|
|
|
151
151
|
// The id goes out at SessionStart, and at the first prompt of a session that
|
|
152
152
|
// started before the hook was installed. A compacted session is told again,
|
|
153
153
|
// because its context no longer holds the first introduction.
|
|
154
|
-
|
|
154
|
+
// The opencode plugin puts the session id into the system context of every
|
|
155
|
+
// model call, so its prompts carry only messages.
|
|
156
|
+
const introduce = tool !== 'opencode' && plan.take && plan.event !== 'Stop'
|
|
157
|
+
&& (plan.event === 'SessionStart' || !state.introduced);
|
|
155
158
|
if (introduce) {
|
|
156
159
|
parts.push(selfIntroduction(plan.sessionId));
|
|
157
160
|
next.introduced = true;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"message-hook-core.js","sourceRoot":"","sources":["../src/message-hook-core.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;GAqBG;AACH,OAAO,EAAE,cAAc,E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VERSION;
|
|
66
66
|
} catch {
|
|
67
67
|
try {
|
|
68
|
-
if (true) CLI_VERSION = "0.7.
|
|
68
|
+
if (true) CLI_VERSION = "0.7.25";
|
|
69
69
|
} catch {
|
|
70
70
|
}
|
|
71
71
|
}
|
|
@@ -225,7 +225,7 @@ function renderRun(plan, messages, state, now, labels = /* @__PURE__ */ new Map(
|
|
|
225
225
|
const next = { ...state, ...plan.cwd ? { cwd: plan.cwd } : {} };
|
|
226
226
|
if (plan.event === "UserPromptSubmit" || plan.event === "SessionStart") next.stopBlocked = false;
|
|
227
227
|
const parts = [];
|
|
228
|
-
const introduce = plan.take && plan.event !== "Stop" && (plan.event === "SessionStart" || !state.introduced);
|
|
228
|
+
const introduce = tool !== "opencode" && plan.take && plan.event !== "Stop" && (plan.event === "SessionStart" || !state.introduced);
|
|
229
229
|
if (introduce) {
|
|
230
230
|
parts.push(selfIntroduction(plan.sessionId));
|
|
231
231
|
next.introduced = true;
|
package/dist/watch.js
CHANGED
|
@@ -27654,7 +27654,7 @@ var init_http = __esm({
|
|
|
27654
27654
|
CLI_VERSION = JSON.parse(readFileSync35(new URL("../package.json", import.meta.url), "utf-8")).version || CLI_VERSION;
|
|
27655
27655
|
} catch {
|
|
27656
27656
|
try {
|
|
27657
|
-
if (true) CLI_VERSION = "0.7.
|
|
27657
|
+
if (true) CLI_VERSION = "0.7.25";
|
|
27658
27658
|
} catch {
|
|
27659
27659
|
}
|
|
27660
27660
|
}
|
|
@@ -28148,7 +28148,7 @@ var init_telemetry = __esm({
|
|
|
28148
28148
|
init_sync_client();
|
|
28149
28149
|
cliVersion = () => {
|
|
28150
28150
|
try {
|
|
28151
|
-
return true ? "0.7.
|
|
28151
|
+
return true ? "0.7.25" : "dev";
|
|
28152
28152
|
} catch {
|
|
28153
28153
|
return "dev";
|
|
28154
28154
|
}
|
|
@@ -30513,7 +30513,7 @@ var init_sync_client = __esm({
|
|
|
30513
30513
|
ownVersion = JSON.parse(readFileSync39(join46(dir, "../package.json"), "utf-8")).version || ownVersion;
|
|
30514
30514
|
} catch {
|
|
30515
30515
|
try {
|
|
30516
|
-
if (true) ownVersion = "0.7.
|
|
30516
|
+
if (true) ownVersion = "0.7.25";
|
|
30517
30517
|
} catch {
|
|
30518
30518
|
}
|
|
30519
30519
|
}
|
|
@@ -33877,7 +33877,7 @@ try {
|
|
|
33877
33877
|
ownVersion2 = JSON.parse(readFileSync43(join52(dir, "../package.json"), "utf-8")).version || ownVersion2;
|
|
33878
33878
|
} catch {
|
|
33879
33879
|
try {
|
|
33880
|
-
if (true) ownVersion2 = "0.7.
|
|
33880
|
+
if (true) ownVersion2 = "0.7.25";
|
|
33881
33881
|
} catch {
|
|
33882
33882
|
}
|
|
33883
33883
|
}
|
|
@@ -34262,7 +34262,7 @@ async function runCollectorMigration(opts) {
|
|
|
34262
34262
|
init_sync_ledger();
|
|
34263
34263
|
init_collector_health();
|
|
34264
34264
|
import { existsSync as existsSync52, readFileSync as readFileSync49, statSync as statSync49 } from "fs";
|
|
34265
|
-
var CLI_VERSION3 = true ? "0.7.
|
|
34265
|
+
var CLI_VERSION3 = true ? "0.7.25" : "0.0.0";
|
|
34266
34266
|
var DEBOUNCE_MS = 5e3;
|
|
34267
34267
|
var PLANS_DIR = claudeBackend.plansDir();
|
|
34268
34268
|
var TASKS_DIR = claudeBackend.tasksDir();
|