@clawos-dev/clawd 0.2.194-beta.390.a17fa6d → 0.2.194-beta.391.a419f09

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 CHANGED
@@ -248,6 +248,7 @@ var init_events = __esm({
248
248
  SESSION_STATUS_VALUES = [
249
249
  "idle",
250
250
  "running",
251
+ "running-idle",
251
252
  "stopped",
252
253
  "error",
253
254
  "observing"
@@ -41781,13 +41782,23 @@ function pushEventToBuffer(state, event, deps) {
41781
41782
  effects.push({ kind: "persist-file", file: next.file });
41782
41783
  effects.push(sessionInfoFrame(next.file));
41783
41784
  }
41784
- if (isTurnEnd && next.subSessionMeta?.idleKillEnabled && next.procAlive && (next.status === "running" || next.status === "spawning")) {
41785
+ if (isTurnEnd && next.procAlive && (next.status === "running" || next.status === "spawning")) {
41785
41786
  next.status = "running-idle";
41786
41787
  effects.push({
41787
- kind: "schedule-idle-kill",
41788
- sessionId: next.file.sessionId,
41789
- ms: IDLE_KILL_DELAY_MS
41788
+ kind: "emit-frame",
41789
+ frame: {
41790
+ type: "session:status",
41791
+ sessionId: next.file.sessionId,
41792
+ status: "running-idle"
41793
+ }
41790
41794
  });
41795
+ if (next.subSessionMeta?.idleKillEnabled) {
41796
+ effects.push({
41797
+ kind: "schedule-idle-kill",
41798
+ sessionId: next.file.sessionId,
41799
+ ms: IDLE_KILL_DELAY_MS
41800
+ });
41801
+ }
41791
41802
  }
41792
41803
  return { state: next, effects };
41793
41804
  }
@@ -41814,6 +41825,12 @@ function applyCommand(state, command, deps) {
41814
41825
  if (next.status === "running-idle") {
41815
41826
  effects.push({ kind: "cancel-idle-kill", sessionId });
41816
41827
  next.status = next.procAlive ? "running" : "idle";
41828
+ if (next.procAlive) {
41829
+ effects.push({
41830
+ kind: "emit-frame",
41831
+ frame: { type: "session:status", sessionId, status: "running" }
41832
+ });
41833
+ }
41817
41834
  }
41818
41835
  if (!next.procAlive) {
41819
41836
  next.procAlive = true;
@@ -42815,10 +42832,11 @@ function compressFrameForWire(frame) {
42815
42832
  switch (status) {
42816
42833
  case "spawning":
42817
42834
  case "running":
42818
- // sub-session(persona)专属内部状态:进程仍活着等 idle-kill;wire 协议看到的是 'running'
42819
- case "running-idle":
42820
42835
  compressed = "running";
42821
42836
  break;
42837
+ case "running-idle":
42838
+ compressed = "running-idle";
42839
+ break;
42822
42840
  case "stopping":
42823
42841
  case "stopped":
42824
42842
  compressed = "stopped";
@@ -42843,8 +42861,9 @@ function compressStatus(status) {
42843
42861
  switch (status) {
42844
42862
  case "spawning":
42845
42863
  case "running":
42846
- case "running-idle":
42847
42864
  return "running";
42865
+ case "running-idle":
42866
+ return "running-idle";
42848
42867
  case "stopping":
42849
42868
  case "stopped":
42850
42869
  return "stopped";