@clawos-dev/clawd 0.2.12-beta.11.e5ef950 → 0.2.12-beta.12.5f6e619
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.cjs +26 -4
- package/package.json +1 -1
package/dist/cli.cjs
CHANGED
|
@@ -12888,7 +12888,7 @@ function buildSpawnContext(file) {
|
|
|
12888
12888
|
}
|
|
12889
12889
|
function sessionInfoFrame(file) {
|
|
12890
12890
|
const frame = { type: "session:info", ...file };
|
|
12891
|
-
return { kind: "emit-frame", frame };
|
|
12891
|
+
return { kind: "emit-frame", frame, target: "all" };
|
|
12892
12892
|
}
|
|
12893
12893
|
function eqContextUsage(a, b) {
|
|
12894
12894
|
if (a === b) return true;
|
|
@@ -13096,7 +13096,8 @@ function applyCommand(state, command, deps) {
|
|
|
13096
13096
|
effects.push({ kind: "delete-file" });
|
|
13097
13097
|
effects.push({
|
|
13098
13098
|
kind: "emit-frame",
|
|
13099
|
-
frame: { type: "session:deleted", sessionId }
|
|
13099
|
+
frame: { type: "session:deleted", sessionId },
|
|
13100
|
+
target: "all"
|
|
13100
13101
|
});
|
|
13101
13102
|
return { state: next, effects };
|
|
13102
13103
|
}
|
|
@@ -13152,6 +13153,10 @@ function applyCommand(state, command, deps) {
|
|
|
13152
13153
|
next.seenUuids = [];
|
|
13153
13154
|
effects.push({ kind: "persist-file", file: nextFile });
|
|
13154
13155
|
effects.push(sessionInfoFrame(nextFile));
|
|
13156
|
+
effects.push({
|
|
13157
|
+
kind: "emit-frame",
|
|
13158
|
+
frame: { type: "session:cleared", sessionId }
|
|
13159
|
+
});
|
|
13155
13160
|
if (next.procAlive) {
|
|
13156
13161
|
effects.push({ kind: "kill", signal: "SIGKILL" });
|
|
13157
13162
|
}
|
|
@@ -13766,7 +13771,7 @@ var SessionManager = class {
|
|
|
13766
13771
|
return {
|
|
13767
13772
|
response: { sessionId: args.sessionId },
|
|
13768
13773
|
broadcast: [
|
|
13769
|
-
{ frame: { type: "session:deleted", sessionId: args.sessionId }, target: "
|
|
13774
|
+
{ frame: { type: "session:deleted", sessionId: args.sessionId }, target: "all" }
|
|
13770
13775
|
]
|
|
13771
13776
|
};
|
|
13772
13777
|
}
|
|
@@ -18033,6 +18038,10 @@ async function startDaemon(config) {
|
|
|
18033
18038
|
getAdapter,
|
|
18034
18039
|
historyReader: history,
|
|
18035
18040
|
broadcastFrame: (frame, target) => {
|
|
18041
|
+
if (target === "all") {
|
|
18042
|
+
transport?.broadcastAll(frame);
|
|
18043
|
+
return;
|
|
18044
|
+
}
|
|
18036
18045
|
const sid = frame.sessionId;
|
|
18037
18046
|
if (!sid) return;
|
|
18038
18047
|
if (target === "first-subscriber") {
|
|
@@ -18047,7 +18056,16 @@ async function startDaemon(config) {
|
|
|
18047
18056
|
onEvent: ({ sessionId, events }) => {
|
|
18048
18057
|
manager.feedObserverEvents(sessionId, events);
|
|
18049
18058
|
},
|
|
18050
|
-
onStatus: (sessionId, status) =>
|
|
18059
|
+
onStatus: (sessionId, status) => {
|
|
18060
|
+
const r = manager.getActive(sessionId);
|
|
18061
|
+
logger.info("observer.onStatus broadcast", {
|
|
18062
|
+
sessionId,
|
|
18063
|
+
status,
|
|
18064
|
+
hasRunner: !!r,
|
|
18065
|
+
runnerProcAlive: r ? r.getState().procAlive : null
|
|
18066
|
+
});
|
|
18067
|
+
transport?.broadcastToSession(sessionId, { type: "session:status", sessionId, status });
|
|
18068
|
+
},
|
|
18051
18069
|
// jsonl user 行的 real uuid 映射到 buffer 里 synth user_text,rewind 系列 RPC 在
|
|
18052
18070
|
// daemon 内部转译,UI 看到的始终是 events 流里的 synth uuid(详见 manager 注释)
|
|
18053
18071
|
onUserMessageObserved: (sessionId, realUuid, text) => {
|
|
@@ -18078,6 +18096,10 @@ async function startDaemon(config) {
|
|
|
18078
18096
|
client.send({ ...result.response, requestId });
|
|
18079
18097
|
}
|
|
18080
18098
|
for (const { frame: bf, target } of result.broadcast ?? []) {
|
|
18099
|
+
if (target === "all") {
|
|
18100
|
+
transport?.broadcastAll(bf);
|
|
18101
|
+
continue;
|
|
18102
|
+
}
|
|
18081
18103
|
const sid = bf.sessionId;
|
|
18082
18104
|
if (target === "first-subscriber" && sid) {
|
|
18083
18105
|
const handle = transport?.firstSubscriber(sid);
|
package/package.json
CHANGED