@clawos-dev/clawd 0.2.457 → 0.2.458

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 +26 -3
  2. package/package.json +1 -1
package/dist/cli.cjs CHANGED
@@ -46240,9 +46240,19 @@ function reduceSessionInner(state, input, deps) {
46240
46240
  resetReadyGate(next);
46241
46241
  const queueEffects = [];
46242
46242
  clearQueuedSends(next, queueEffects);
46243
+ const eventEffects = [
46244
+ ...pushEventToBufferInPlace(next, { kind: "error", message: input.message }, deps),
46245
+ ...pushEventToBufferInPlace(next, { kind: "turn_end" }, deps)
46246
+ // 丢掉 turn_end 顺带产出的 append-turn-duration:那条 effect 会往用户真实的 CC
46247
+ // jsonl 追加一行 turn_duration(runner.ts case 'append-turn-duration',resume 场景
46248
+ // toolSessionId 已 stamp 时会真落盘)。它的用途是"SDK 模式 CC 不写 turn 边界、
46249
+ // daemon 补写",而这里 CC 根本没跑过这一轮——补边界等于往历史里插一个空 turn,
46250
+ // 且不可回滚。proc-exit 的 interrupted 注入走同一条路但语义不同:那边 turn 真发生过。
46251
+ ].filter((e) => e.kind !== "append-turn-duration");
46243
46252
  return {
46244
46253
  state: next,
46245
46254
  effects: [
46255
+ ...eventEffects,
46246
46256
  {
46247
46257
  kind: "emit-frame",
46248
46258
  frame: {
@@ -46429,6 +46439,15 @@ init_stdout_splitter();
46429
46439
  init_permission_stdio();
46430
46440
  init_claude_history();
46431
46441
 
46442
+ // src/tools/spawn-error.ts
46443
+ function describeSpawnError(err, fallbackBin, cwd, pathEnv = process.env.PATH) {
46444
+ const message = err instanceof Error ? err.message : String(err);
46445
+ const e = err;
46446
+ if (e?.code !== "ENOENT") return message;
46447
+ const bin = typeof e.path === "string" && e.path ? e.path : fallbackBin;
46448
+ return `\u8D77\u4E0D\u4E86 ${bin}\uFF1APATH \u91CC\u6CA1\u6709\u5B83\uFF0C\u6216\u5DE5\u4F5C\u76EE\u5F55\u4E0D\u5B58\u5728\u3002\u5DE5\u4F5C\u76EE\u5F55\uFF1A${cwd || "(\u672A\u77E5)"}\uFF5Cclawd \u770B\u5230\u7684 PATH\uFF1A${pathEnv || "(\u7A7A)"}`;
46449
+ }
46450
+
46432
46451
  // src/persona/mcp-secret-render.ts
46433
46452
  var import_node_fs7 = __toESM(require("fs"), 1);
46434
46453
  var import_node_path6 = __toESM(require("path"), 1);
@@ -47009,7 +47028,10 @@ var SessionRunner = class {
47009
47028
  if (this.proc !== proc) return;
47010
47029
  const message = err.message;
47011
47030
  this.hooks.logger?.error("claude spawn failed", { message });
47012
- this.input({ kind: "proc-error", message });
47031
+ this.input({
47032
+ kind: "proc-error",
47033
+ message: describeSpawnError(err, this.hooks.adapter.id, this.state.file.cwd)
47034
+ });
47013
47035
  });
47014
47036
  }
47015
47037
  /**
@@ -51770,7 +51792,8 @@ function createCodexSession(ctx, sink, deps = {}) {
51770
51792
  proc.on("error", (err) => {
51771
51793
  const message = err.message;
51772
51794
  deps.logger?.error("codex app-server spawn failed", { message });
51773
- sink.onError(`codex app-server spawn failed: ${message}`);
51795
+ const described = describeSpawnError(err, cmd, ctx.cwd);
51796
+ sink.onError(described === message ? `codex app-server spawn failed: ${message}` : described);
51774
51797
  });
51775
51798
  proc.on("exit", (code) => finish(code));
51776
51799
  const ready = (async () => {
@@ -63908,7 +63931,7 @@ function computeMethodAccess(args) {
63908
63931
  }
63909
63932
 
63910
63933
  // src/version.ts
63911
- var version = "0.2.457".length > 0 ? "0.2.457" : "dev";
63934
+ var version = "0.2.458".length > 0 ? "0.2.458" : "dev";
63912
63935
 
63913
63936
  // src/cli-probe/probe.ts
63914
63937
  var fs70 = __toESM(require("fs"), 1);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@clawos-dev/clawd",
3
- "version": "0.2.457",
3
+ "version": "0.2.458",
4
4
  "description": "Standalone clawd daemon — Claude Code (and future Codex) session server over WebSocket",
5
5
  "type": "module",
6
6
  "license": "MIT",