@clawos-dev/clawd 0.2.100 → 0.2.101-beta.192.2f41caf
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 +19 -33
- package/package.json +1 -1
package/dist/cli.cjs
CHANGED
|
@@ -31201,11 +31201,7 @@ function tryFlushPending(state, deps) {
|
|
|
31201
31201
|
const payload = deps.encodeStdin(text, { sessionId: state.file.sessionId });
|
|
31202
31202
|
return [{ kind: "write-stdin", payload }];
|
|
31203
31203
|
}
|
|
31204
|
-
function rgDbg(
|
|
31205
|
-
if (deps.logger) {
|
|
31206
|
-
deps.logger.debug(`[RG] ${event}`, info);
|
|
31207
|
-
return;
|
|
31208
|
-
}
|
|
31204
|
+
function rgDbg(event, info) {
|
|
31209
31205
|
console.debug(`[RG] ${event}`, info);
|
|
31210
31206
|
}
|
|
31211
31207
|
function resetReadyGate(next) {
|
|
@@ -31481,7 +31477,7 @@ function applyCommand(state, command, deps) {
|
|
|
31481
31477
|
const payload = deps.encodeStdin(command.text, { sessionId });
|
|
31482
31478
|
effects.push({ kind: "write-stdin", payload });
|
|
31483
31479
|
}
|
|
31484
|
-
rgDbg(
|
|
31480
|
+
rgDbg("send", {
|
|
31485
31481
|
sid: sessionId,
|
|
31486
31482
|
mode: deps.mode ?? "sdk",
|
|
31487
31483
|
procAliveBefore,
|
|
@@ -31853,13 +31849,13 @@ function reduceSession(state, input, deps) {
|
|
|
31853
31849
|
}
|
|
31854
31850
|
case "ready-detected": {
|
|
31855
31851
|
if (deps.mode !== "tui") {
|
|
31856
|
-
rgDbg(
|
|
31852
|
+
rgDbg("ready-input", { sid: state.file.sessionId, skipped: "non-tui-mode" });
|
|
31857
31853
|
return { state, effects: [] };
|
|
31858
31854
|
}
|
|
31859
31855
|
const next = cloneState(state);
|
|
31860
31856
|
next.readyForSend = true;
|
|
31861
31857
|
const flushEffects = tryFlushPending(next, deps);
|
|
31862
|
-
rgDbg(
|
|
31858
|
+
rgDbg("ready-input", {
|
|
31863
31859
|
sid: next.file.sessionId,
|
|
31864
31860
|
wroteStdin: flushEffects.length > 0,
|
|
31865
31861
|
readyAfter: next.readyForSend,
|
|
@@ -32032,9 +32028,7 @@ var SessionRunner = class {
|
|
|
32032
32028
|
ownerDisplayName: this.hooks.ownerDisplayName,
|
|
32033
32029
|
personaRoot: this.hooks.personaRoot,
|
|
32034
32030
|
// ReadyGate v2:透传 mode 让 reducer send / ready-detected 分支决定走暂存队列还是直写
|
|
32035
|
-
mode: this.hooks.mode
|
|
32036
|
-
// [RG-DBG] 注入 logger 让 reducer rgDbg 走 pino 进 clawd.log;定位完跟 rgDbg 一起删
|
|
32037
|
-
logger: this.hooks.logger
|
|
32031
|
+
mode: this.hooks.mode
|
|
32038
32032
|
};
|
|
32039
32033
|
const { state, effects } = reduceSession(this.state, inputMsg, deps);
|
|
32040
32034
|
this.state = state;
|
|
@@ -32213,7 +32207,7 @@ var SessionRunner = class {
|
|
|
32213
32207
|
this.doKill(effect.signal);
|
|
32214
32208
|
break;
|
|
32215
32209
|
case "write-stdin":
|
|
32216
|
-
|
|
32210
|
+
console.debug("[RG] write-stdin", {
|
|
32217
32211
|
procAlive: !!this.proc,
|
|
32218
32212
|
stdinWritable: !!this.proc?.stdin,
|
|
32219
32213
|
len: effect.payload.length,
|
|
@@ -33869,12 +33863,12 @@ var SessionManager = class {
|
|
|
33869
33863
|
*/
|
|
33870
33864
|
dispatchReadyDetected(toolSessionId) {
|
|
33871
33865
|
if (this.deps.mode !== "tui") {
|
|
33872
|
-
|
|
33866
|
+
console.debug("[RG] mgr-disp", { tsid: toolSessionId, skipped: "non-tui-mode" });
|
|
33873
33867
|
return;
|
|
33874
33868
|
}
|
|
33875
33869
|
const sid = this.sessionIdByToolSid(toolSessionId);
|
|
33876
33870
|
const runner = sid ? this.runners.get(sid) : void 0;
|
|
33877
|
-
|
|
33871
|
+
console.debug("[RG] mgr-disp", {
|
|
33878
33872
|
tsid: toolSessionId,
|
|
33879
33873
|
sid: sid ?? null,
|
|
33880
33874
|
runnerFound: !!runner
|
|
@@ -35003,19 +34997,20 @@ var PtyChildProcess = class extends import_node_events.EventEmitter {
|
|
|
35003
34997
|
if (match) {
|
|
35004
34998
|
const paste = match[1];
|
|
35005
34999
|
const enter = match[2];
|
|
35006
|
-
|
|
35000
|
+
console.debug("[RG] pty-paste", { pasteLen: paste.length, enterLen: enter.length });
|
|
35007
35001
|
pty.write(paste);
|
|
35008
35002
|
setTimeout(() => {
|
|
35009
35003
|
try {
|
|
35010
35004
|
pty.write(enter);
|
|
35011
|
-
|
|
35005
|
+
console.debug("[RG] pty-paste-enter", { wrote: "\\r", disposed: false });
|
|
35006
|
+
logger?.debug("pty bracketed paste submit \\r delayed", { tag, pid: this.pid });
|
|
35012
35007
|
} catch (err) {
|
|
35013
|
-
|
|
35008
|
+
console.debug("[RG] pty-paste-enter", { error: err.message });
|
|
35014
35009
|
logger?.warn("pty delayed \\r failed", { tag, error: err.message });
|
|
35015
35010
|
}
|
|
35016
|
-
},
|
|
35011
|
+
}, 120);
|
|
35017
35012
|
} else {
|
|
35018
|
-
|
|
35013
|
+
console.debug("[RG] pty-write-direct", { len: data.length });
|
|
35019
35014
|
pty.write(data);
|
|
35020
35015
|
}
|
|
35021
35016
|
};
|
|
@@ -35256,21 +35251,14 @@ function createReadyDetector(opts) {
|
|
|
35256
35251
|
quietTimer = null;
|
|
35257
35252
|
}
|
|
35258
35253
|
};
|
|
35259
|
-
const dbg = (info) => {
|
|
35260
|
-
if (opts.logger) {
|
|
35261
|
-
opts.logger.debug("[RG] det-state", info);
|
|
35262
|
-
return;
|
|
35263
|
-
}
|
|
35264
|
-
console.debug("[RG] det-state", info);
|
|
35265
|
-
};
|
|
35266
35254
|
const quietFire = () => {
|
|
35267
35255
|
quietTimer = null;
|
|
35268
35256
|
if (disposed) return;
|
|
35269
35257
|
if (!scanReadyFrame()) {
|
|
35270
|
-
|
|
35258
|
+
console.debug("[RG] det-state", { event: "quiet-fire-but-not-ready-anymore" });
|
|
35271
35259
|
return;
|
|
35272
35260
|
}
|
|
35273
|
-
|
|
35261
|
+
console.debug("[RG] det-state", { event: "quiet-fire \u2192 onReady" });
|
|
35274
35262
|
opts.onReady();
|
|
35275
35263
|
};
|
|
35276
35264
|
let prevReady = false;
|
|
@@ -35280,13 +35268,13 @@ function createReadyDetector(opts) {
|
|
|
35280
35268
|
if (!ready) {
|
|
35281
35269
|
clearQuiet();
|
|
35282
35270
|
if (prevReady) {
|
|
35283
|
-
|
|
35271
|
+
console.debug("[RG] det-state", { event: "ready \u2192 not-ready" });
|
|
35284
35272
|
prevReady = false;
|
|
35285
35273
|
}
|
|
35286
35274
|
return;
|
|
35287
35275
|
}
|
|
35288
35276
|
if (!prevReady) {
|
|
35289
|
-
|
|
35277
|
+
console.debug("[RG] det-state", { event: "not-ready \u2192 ready-candidate (quiet timer set)" });
|
|
35290
35278
|
prevReady = true;
|
|
35291
35279
|
}
|
|
35292
35280
|
clearQuiet();
|
|
@@ -35403,9 +35391,7 @@ var ClaudeTuiAdapter = class extends ClaudeAdapter {
|
|
|
35403
35391
|
if (!ctx.toolSessionId || !this.tuiOpts.onReady) return;
|
|
35404
35392
|
this.tuiLogger?.debug("ready-detected", { toolSessionId: ctx.toolSessionId });
|
|
35405
35393
|
this.tuiOpts.onReady(ctx.toolSessionId);
|
|
35406
|
-
}
|
|
35407
|
-
// [RG-DBG] 排查 ReadyGate 偶现卡输入用;定位完跟所有 [RG] 日志一起删
|
|
35408
|
-
logger: this.tuiLogger
|
|
35394
|
+
}
|
|
35409
35395
|
});
|
|
35410
35396
|
if (ctx.toolSessionId && this.tuiOpts.onDetectorRegister) {
|
|
35411
35397
|
this.tuiOpts.onDetectorRegister(ctx.toolSessionId, detector);
|
package/package.json
CHANGED