@clawos-dev/clawd 0.2.682 → 0.2.683
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
|
@@ -49158,6 +49158,14 @@ function encodeAllowWithInputControlResponse(requestId, updatedInput) {
|
|
|
49158
49158
|
}
|
|
49159
49159
|
var DEFAULT_WAIT_STOP_TIMEOUT_MS = 3e3;
|
|
49160
49160
|
var SUBAGENT_ACTIVE_WINDOW_MS = 3e5;
|
|
49161
|
+
function latestTurnId(state) {
|
|
49162
|
+
for (let index = state.buffer.length - 1; index >= 0; index--) {
|
|
49163
|
+
const event = state.buffer[index].event;
|
|
49164
|
+
if (event.turnId) return event.turnId;
|
|
49165
|
+
if (event.kind === "user_text") return void 0;
|
|
49166
|
+
}
|
|
49167
|
+
return void 0;
|
|
49168
|
+
}
|
|
49161
49169
|
var SessionRunner = class {
|
|
49162
49170
|
constructor(initial, hooks) {
|
|
49163
49171
|
this.hooks = hooks;
|
|
@@ -49410,20 +49418,11 @@ var SessionRunner = class {
|
|
|
49410
49418
|
}
|
|
49411
49419
|
lifecycleMetadata() {
|
|
49412
49420
|
const state = this.state;
|
|
49413
|
-
let turnId;
|
|
49414
|
-
for (let index = state.buffer.length - 1; index >= 0; index--) {
|
|
49415
|
-
const event = state.buffer[index].event;
|
|
49416
|
-
if (event.turnId) {
|
|
49417
|
-
turnId = event.turnId;
|
|
49418
|
-
break;
|
|
49419
|
-
}
|
|
49420
|
-
if (event.kind === "user_text") break;
|
|
49421
|
-
}
|
|
49422
49421
|
return {
|
|
49423
49422
|
sessionId: state.file.sessionId,
|
|
49424
49423
|
tool: state.file.tool,
|
|
49425
49424
|
toolSessionId: state.file.toolSessionId,
|
|
49426
|
-
turnId,
|
|
49425
|
+
turnId: latestTurnId(state),
|
|
49427
49426
|
status: state.status,
|
|
49428
49427
|
turnOpen: state.turnOpen,
|
|
49429
49428
|
procAlive: state.procAlive
|
|
@@ -50760,6 +50759,11 @@ var SessionManager = class {
|
|
|
50760
50759
|
const runner = this.runners.get(sessionId);
|
|
50761
50760
|
return runner?.getState() ?? null;
|
|
50762
50761
|
}
|
|
50762
|
+
/** Native id of the turn this daemon is running right now; null when no foreground turn is open. */
|
|
50763
|
+
openTurnId(sessionId) {
|
|
50764
|
+
const state = this.runners.get(sessionId)?.getState();
|
|
50765
|
+
return state?.turnOpen ? latestTurnId(state) ?? null : null;
|
|
50766
|
+
}
|
|
50763
50767
|
// 等真实 proc-exit 再 ack,避免调用方开始删除 worktree 时进程仍持文件锁;超时向上报错。
|
|
50764
50768
|
async stop(args) {
|
|
50765
50769
|
const file = this.findOwnedSession(args.sessionId);
|
|
@@ -73495,6 +73499,13 @@ function slimHistoryMessages(messages) {
|
|
|
73495
73499
|
return out;
|
|
73496
73500
|
});
|
|
73497
73501
|
}
|
|
73502
|
+
function markOpenTurnInProgress(page, openTurnId) {
|
|
73503
|
+
if (page.view !== "turns" || !openTurnId) return page;
|
|
73504
|
+
return {
|
|
73505
|
+
...page,
|
|
73506
|
+
data: page.data.map((turn) => turn.id === openTurnId && turn.status === "interrupted" ? { ...turn, status: "inProgress" } : turn)
|
|
73507
|
+
};
|
|
73508
|
+
}
|
|
73498
73509
|
function assertGuestPath(ctx, absPath, personaRoot, method, usersRoot) {
|
|
73499
73510
|
if (!ctx || ctx.principal.kind !== "guest" || !personaRoot) return;
|
|
73500
73511
|
const userWorkDir = usersRoot ? deriveUserWorkDir(ctx.principal.id, usersRoot) : void 0;
|
|
@@ -73563,6 +73574,7 @@ function buildHistoryHandlers(deps) {
|
|
|
73563
73574
|
if (args.view) {
|
|
73564
73575
|
const reader = getHistoryReader(f2.tool ?? "claude", f2.cloudEnvironment);
|
|
73565
73576
|
if (!reader.readPage) throw new Error("This engine does not support turn history paging");
|
|
73577
|
+
const openTurnId = manager.openTurnId(args.sessionId);
|
|
73566
73578
|
const page = await reader.readPage({
|
|
73567
73579
|
cwd: f2.cwd,
|
|
73568
73580
|
toolSessionId: f2.toolSessionId,
|
|
@@ -73572,7 +73584,7 @@ function buildHistoryHandlers(deps) {
|
|
|
73572
73584
|
turnId: args.turnId,
|
|
73573
73585
|
snapshotId: args.snapshotId
|
|
73574
73586
|
});
|
|
73575
|
-
return { response: { type: "history:read", ...page } };
|
|
73587
|
+
return { response: { type: "history:read", ...markOpenTurnInProgress(page, openTurnId) } };
|
|
73576
73588
|
}
|
|
73577
73589
|
let res;
|
|
73578
73590
|
try {
|
|
@@ -75338,7 +75350,7 @@ function computeMethodAccess(args) {
|
|
|
75338
75350
|
}
|
|
75339
75351
|
|
|
75340
75352
|
// src/version.ts
|
|
75341
|
-
var version = "0.2.
|
|
75353
|
+
var version = "0.2.683".length > 0 ? "0.2.683" : "dev";
|
|
75342
75354
|
|
|
75343
75355
|
// src/cli-probe/probe.ts
|
|
75344
75356
|
var fs86 = __toESM(require("fs"), 1);
|