@clawos-dev/clawd 0.2.12-beta.10.686d33a → 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.
Files changed (2) hide show
  1. package/dist/cli.cjs +22 -7
  2. 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: "broadcast" }
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,12 +18056,14 @@ async function startDaemon(config) {
18047
18056
  onEvent: ({ sessionId, events }) => {
18048
18057
  manager.feedObserverEvents(sessionId, events);
18049
18058
  },
18050
- // observer 的状态只在"observer-only"(外部 cc CLI 在跑、daemon 没自管这个 session)模式下作为 wire 信号推。
18051
- // daemon 自管 cc 时 reducer 自己会推权威的 'running' / 'stopped',observer 再叠一层 'observing' 会
18052
- // 在 cc 已 turn_end 后偶现 spinner 卡住(procAlive 判断把 'observing' 当成活动)
18053
18059
  onStatus: (sessionId, status) => {
18054
18060
  const r = manager.getActive(sessionId);
18055
- if (r && r.getState().procAlive) return;
18061
+ logger.info("observer.onStatus broadcast", {
18062
+ sessionId,
18063
+ status,
18064
+ hasRunner: !!r,
18065
+ runnerProcAlive: r ? r.getState().procAlive : null
18066
+ });
18056
18067
  transport?.broadcastToSession(sessionId, { type: "session:status", sessionId, status });
18057
18068
  },
18058
18069
  // jsonl user 行的 real uuid 映射到 buffer 里 synth user_text,rewind 系列 RPC 在
@@ -18085,6 +18096,10 @@ async function startDaemon(config) {
18085
18096
  client.send({ ...result.response, requestId });
18086
18097
  }
18087
18098
  for (const { frame: bf, target } of result.broadcast ?? []) {
18099
+ if (target === "all") {
18100
+ transport?.broadcastAll(bf);
18101
+ continue;
18102
+ }
18088
18103
  const sid = bf.sessionId;
18089
18104
  if (target === "first-subscriber" && sid) {
18090
18105
  const handle = transport?.firstSubscriber(sid);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@clawos-dev/clawd",
3
- "version": "0.2.12-beta.10.686d33a",
3
+ "version": "0.2.12-beta.12.5f6e619",
4
4
  "description": "Standalone clawd daemon — Claude Code (and future Codex) session server over WebSocket",
5
5
  "type": "module",
6
6
  "license": "MIT",