deskbuddy 0.2.0-beta.36 → 0.2.0-beta.37

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 CHANGED
@@ -13852,6 +13852,7 @@ function removeCodexRemote() {
13852
13852
  import { closeSync as closeSync8, openSync as openSync8, readdirSync as readdirSync9, readSync as readSync7, statSync as statSync11 } from "fs";
13853
13853
  import { dirname as dirname6, join as join22 } from "path";
13854
13854
  var INTERRUPT_TOOLS = ["claude_code", "qoder_cn", "qoder"];
13855
+ var CODEX_INTERRUPT_TOOL = "codex";
13855
13856
  function transcriptHome(tool) {
13856
13857
  if (tool === "claude_code") return claudeHome();
13857
13858
  if (tool === "qoder_cn") return dirname6(qoderCnSettingsPath());
@@ -13974,14 +13975,53 @@ function claudeTranscriptFile(sessionId, cwd, home = claudeHome()) {
13974
13975
  var INTERRUPT_SETTLE_MS = 2e3;
13975
13976
  var INTERRUPT_TOLERANCE_MS = 5e3;
13976
13977
  function shouldSettleInterrupt(st, markerAt, now) {
13977
- if (markerAt === null || !INTERRUPT_TOOLS.includes(st.tool)) return false;
13978
+ const codex = st.tool === CODEX_INTERRUPT_TOOL;
13979
+ if (markerAt === null || !INTERRUPT_TOOLS.includes(st.tool) && !codex) return false;
13978
13980
  if (st.state !== "watch" && st.state !== "ask_approval") return false;
13979
- if (st.interactive !== true && st.embedded !== true) return false;
13981
+ if (!codex && st.interactive !== true && st.embedded !== true) return false;
13980
13982
  if (now - markerAt < INTERRUPT_SETTLE_MS) return false;
13981
13983
  if (st.updatedAt > markerAt + INTERRUPT_TOLERANCE_MS) return false;
13982
13984
  if ((st.recent ?? []).some((r) => r.e === "UserPromptSubmit" && r.at > markerAt)) return false;
13983
13985
  return true;
13984
13986
  }
13987
+ function codexInterruptedAt(file) {
13988
+ let fd;
13989
+ try {
13990
+ const st = statSync11(file);
13991
+ const len = Math.min(st.size, TAIL);
13992
+ const buf = Buffer.alloc(len);
13993
+ fd = openSync8(file, "r");
13994
+ readSync7(fd, buf, 0, len, st.size - len);
13995
+ const lines3 = buf.toString("utf8").split("\n");
13996
+ for (let i = lines3.length - 1; i >= 0; i--) {
13997
+ const line = lines3[i];
13998
+ if (line.indexOf('"event_msg"') === -1) continue;
13999
+ let o;
14000
+ try {
14001
+ o = JSON.parse(line);
14002
+ } catch {
14003
+ continue;
14004
+ }
14005
+ if (!o || o.type !== "event_msg" || !o.payload) continue;
14006
+ const t = o.payload.type;
14007
+ if (t === "turn_aborted") {
14008
+ const at = typeof o.timestamp === "string" ? Date.parse(o.timestamp) : NaN;
14009
+ return Number.isFinite(at) ? at : st.mtimeMs;
14010
+ }
14011
+ if (t === "task_complete" || t === "turn_complete" || t === "task_started" || t === "turn_started" || t === "user_message") return null;
14012
+ }
14013
+ return null;
14014
+ } catch {
14015
+ return null;
14016
+ } finally {
14017
+ if (fd !== void 0) {
14018
+ try {
14019
+ closeSync8(fd);
14020
+ } catch {
14021
+ }
14022
+ }
14023
+ }
14024
+ }
13985
14025
 
13986
14026
  // src/daemon/qoderAppDb.ts
13987
14027
  import { execFile as execFile4 } from "child_process";
@@ -15752,7 +15792,7 @@ var Daemon = class {
15752
15792
  #settleInterrupted() {
15753
15793
  if (this.#stopped) return;
15754
15794
  const enabled = loadConfig().enabledTools;
15755
- const tools = INTERRUPT_TOOLS.filter((t) => enabled.includes(t));
15795
+ const tools = [...INTERRUPT_TOOLS, CODEX_INTERRUPT_TOOL].filter((t) => enabled.includes(t));
15756
15796
  if (tools.length === 0) return;
15757
15797
  const now = this.#deps.now();
15758
15798
  const alive = /* @__PURE__ */ new Set();
@@ -15760,7 +15800,7 @@ var Daemon = class {
15760
15800
  let changed = false;
15761
15801
  for (const st of this.#aliveStates(tool)) {
15762
15802
  alive.add(st.sessionId);
15763
- if (!BUSY_STATES3.has(st.state) || st.interactive !== true && st.embedded !== true) {
15803
+ if (!BUSY_STATES3.has(st.state) || tool !== CODEX_INTERRUPT_TOOL && st.interactive !== true && st.embedded !== true) {
15764
15804
  this.#transcriptSeen.delete(st.sessionId);
15765
15805
  continue;
15766
15806
  }
@@ -15772,16 +15812,16 @@ var Daemon = class {
15772
15812
  if (!file) continue;
15773
15813
  const sig = transcriptSig(file);
15774
15814
  if (sig && this.#transcriptSeen.get(st.sessionId) === sig) continue;
15775
- const at = interruptedAt(file);
15815
+ const at = tool === CODEX_INTERRUPT_TOOL ? codexInterruptedAt(file) : interruptedAt(file);
15776
15816
  if (sig && (at === null || now - at >= INTERRUPT_SETTLE_MS)) this.#transcriptSeen.set(st.sessionId, sig);
15777
15817
  if (at === null || !shouldSettleInterrupt(st, at, now)) continue;
15778
- if (this.#settleBusy(st.sessionId, tool, st.updatedAt, `\u5728\u7A97\u53E3\u91CC\u88AB\u6253\u65AD\uFF08${tool} \u4E0D\u53D1 Stop\uFF09`)) {
15818
+ if (this.#settleBusy(st.sessionId, tool, st.updatedAt, `${tool === CODEX_INTERRUPT_TOOL ? "\u88AB\u7528\u6237\u505C\u6B62" : "\u5728\u7A97\u53E3\u91CC\u88AB\u6253\u65AD"}\uFF08${tool} \u4E0D\u53D1 Stop\uFF09`)) {
15779
15819
  changed = true;
15780
15820
  this.#idleWindowAfterInterrupt(st.sessionId, tool, at);
15781
15821
  this.#coord.settleInterruptedWindows(st.sessionId, at);
15782
15822
  }
15783
15823
  }
15784
- if (changed) void this.#reportTool(tool);
15824
+ if (changed) void (tool === CODEX_INTERRUPT_TOOL ? this.#reportCodex() : this.#reportTool(tool));
15785
15825
  }
15786
15826
  for (const m of [this.#transcripts, this.#transcriptMiss, this.#transcriptSeen]) for (const k of [...m.keys()]) if (!alive.has(k)) m.delete(k);
15787
15827
  }
@@ -15802,7 +15842,7 @@ var Daemon = class {
15802
15842
  const missAt = this.#transcriptMiss.get(st.sessionId);
15803
15843
  if (missAt !== void 0 && now - missAt < TRANSCRIPT_MISS_TTL_MS) return null;
15804
15844
  const home = transcriptHome(st.tool);
15805
- const f = home ? claudeTranscriptFile(st.sessionId, st.cwd, home) : null;
15845
+ const f = st.tool === CODEX_INTERRUPT_TOOL ? findCodexRollout(codexHome(), st.sessionId, 7) : home ? claudeTranscriptFile(st.sessionId, st.cwd, home) : null;
15806
15846
  if (f) {
15807
15847
  this.#transcripts.set(st.sessionId, f);
15808
15848
  this.#transcriptMiss.delete(st.sessionId);
@@ -362,3 +362,21 @@
362
362
  2026-10-12T09:01:12.293Z [opencode] opencode 版本 读不出:带说明的拒绝不走新路由
363
363
  2026-10-12T09:01:12.293Z [opencode] opencode 版本不确定支持带说明的拒绝,设备上的反馈没有带给模型
364
364
  2026-10-12T09:01:14.613Z [opencode] 后台任务里的提问 que_r2 没法在设备上回答(后台任务不能提问,请在电脑上继续),已拒绝
365
+ 2026-10-12T10:52:32.632Z [opencode] 回填选择题失败:/question/{requestID}/reply status=404
366
+ 2026-10-12T10:52:37.625Z [opencode] opencode 版本 1.4.3:带说明的拒绝不走新路由
367
+ 2026-10-12T10:52:37.625Z [opencode] opencode 版本不确定支持带说明的拒绝,设备上的反馈没有带给模型
368
+ 2026-10-12T10:52:37.718Z [opencode] opencode 版本 读不出:带说明的拒绝不走新路由
369
+ 2026-10-12T10:52:37.719Z [opencode] opencode 版本不确定支持带说明的拒绝,设备上的反馈没有带给模型
370
+ 2026-10-12T10:52:40.546Z [opencode] 后台任务里的提问 que_r2 没法在设备上回答(后台任务不能提问,请在电脑上继续),已拒绝
371
+ 2026-10-12T10:56:52.376Z [opencode] 回填选择题失败:/question/{requestID}/reply status=404
372
+ 2026-10-12T10:56:57.350Z [opencode] opencode 版本 1.4.3:带说明的拒绝不走新路由
373
+ 2026-10-12T10:56:57.350Z [opencode] opencode 版本不确定支持带说明的拒绝,设备上的反馈没有带给模型
374
+ 2026-10-12T10:56:57.454Z [opencode] opencode 版本 读不出:带说明的拒绝不走新路由
375
+ 2026-10-12T10:56:57.454Z [opencode] opencode 版本不确定支持带说明的拒绝,设备上的反馈没有带给模型
376
+ 2026-10-12T10:56:59.731Z [opencode] 后台任务里的提问 que_r2 没法在设备上回答(后台任务不能提问,请在电脑上继续),已拒绝
377
+ 2026-10-12T11:00:08.567Z [opencode] 回填选择题失败:/question/{requestID}/reply status=404
378
+ 2026-10-12T11:00:13.510Z [opencode] opencode 版本 1.4.3:带说明的拒绝不走新路由
379
+ 2026-10-12T11:00:13.510Z [opencode] opencode 版本不确定支持带说明的拒绝,设备上的反馈没有带给模型
380
+ 2026-10-12T11:00:13.614Z [opencode] opencode 版本 读不出:带说明的拒绝不走新路由
381
+ 2026-10-12T11:00:13.614Z [opencode] opencode 版本不确定支持带说明的拒绝,设备上的反馈没有带给模型
382
+ 2026-10-12T11:00:15.993Z [opencode] 后台任务里的提问 que_r2 没法在设备上回答(后台任务不能提问,请在电脑上继续),已拒绝
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "deskbuddy",
3
- "version": "0.2.0-beta.36",
3
+ "version": "0.2.0-beta.37",
4
4
  "description": "把 Claude Code、Codex 等 AI 编码智能体每个会话窗口的状态,实时同步到桌面硬件屏幕",
5
5
  "keywords": [
6
6
  "ai",