@clawos-dev/clawd 0.2.356 → 0.2.358
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 +25 -7
- package/package.json +1 -1
package/dist/cli.cjs
CHANGED
|
@@ -14861,11 +14861,15 @@ function parseClaudeObjectInner(obj) {
|
|
|
14861
14861
|
}
|
|
14862
14862
|
if (type === "usage") return events;
|
|
14863
14863
|
if (type === "result") {
|
|
14864
|
+
const resultIsError = obj.is_error === true || typeof subtype === "string" && subtype.startsWith("error");
|
|
14864
14865
|
const ev = {
|
|
14865
14866
|
kind: "turn_end",
|
|
14866
|
-
reason: typeof subtype === "string" && subtype !== "success" ? "interrupted" : "completed"
|
|
14867
|
+
reason: resultIsError || typeof subtype === "string" && subtype !== "success" ? "interrupted" : "completed"
|
|
14867
14868
|
};
|
|
14868
14869
|
if (typeof obj.duration_ms === "number") ev.durationMs = obj.duration_ms;
|
|
14870
|
+
if (resultIsError) {
|
|
14871
|
+
events.push({ kind: "error", message: extractResultErrorMessage(obj, subtype) });
|
|
14872
|
+
}
|
|
14869
14873
|
events.push(ev);
|
|
14870
14874
|
return events;
|
|
14871
14875
|
}
|
|
@@ -14878,6 +14882,19 @@ function parseClaudeObjectInner(obj) {
|
|
|
14878
14882
|
}
|
|
14879
14883
|
return events;
|
|
14880
14884
|
}
|
|
14885
|
+
function extractResultErrorMessage(obj, subtype) {
|
|
14886
|
+
const errors = Array.isArray(obj.errors) ? obj.errors.filter((value) => typeof value === "string" && value.length > 0) : [];
|
|
14887
|
+
if (errors.length > 0) return errors.join("\n");
|
|
14888
|
+
for (const key of ["message", "error", "result"]) {
|
|
14889
|
+
const value = obj[key];
|
|
14890
|
+
if (typeof value === "string" && value.length > 0) return value;
|
|
14891
|
+
if (value && typeof value === "object") {
|
|
14892
|
+
const nestedMessage = value.message;
|
|
14893
|
+
if (typeof nestedMessage === "string" && nestedMessage.length > 0) return nestedMessage;
|
|
14894
|
+
}
|
|
14895
|
+
}
|
|
14896
|
+
return subtype ?? "claude result error";
|
|
14897
|
+
}
|
|
14881
14898
|
function extractStructuredPatch(raw) {
|
|
14882
14899
|
if (!Array.isArray(raw)) return void 0;
|
|
14883
14900
|
const hunks = [];
|
|
@@ -47411,8 +47428,8 @@ var SessionManager = class {
|
|
|
47411
47428
|
const file = {
|
|
47412
47429
|
sessionId,
|
|
47413
47430
|
cwd,
|
|
47414
|
-
// dispatch B session 跟随 persona 绑定的 tool(codex persona 用 codex spawn
|
|
47415
|
-
//
|
|
47431
|
+
// dispatch B session 跟随 persona 绑定的 tool(codex persona 用 codex spawn);
|
|
47432
|
+
// UI 手建路径另允许通过 session:create 显式覆盖。
|
|
47416
47433
|
tool: personaDefaults?.tool ?? "claude",
|
|
47417
47434
|
ownerPersonaId: args.targetPersona,
|
|
47418
47435
|
dispatchedFromSessionId: args.sourceSessionId,
|
|
@@ -58697,9 +58714,10 @@ function buildSessionHandlers(deps) {
|
|
|
58697
58714
|
if (!persona) {
|
|
58698
58715
|
throw new Error(`persona not found: ${args.ownerPersonaId}`);
|
|
58699
58716
|
}
|
|
58700
|
-
|
|
58701
|
-
|
|
58702
|
-
|
|
58717
|
+
const toolOverridden = args.tool !== void 0 && args.tool !== persona.tool;
|
|
58718
|
+
tool = args.tool ?? persona.tool;
|
|
58719
|
+
model = args.model ?? (toolOverridden ? void 0 : persona.model);
|
|
58720
|
+
effort = args.effort ?? (toolOverridden ? void 0 : persona.effort);
|
|
58703
58721
|
}
|
|
58704
58722
|
ensurePersonaAccess(ctx, args.ownerPersonaId, "send");
|
|
58705
58723
|
const creatorPrincipalId = ctx?.principal.id ?? ownerPrincipalId;
|
|
@@ -60435,7 +60453,7 @@ function computeMethodAccess(args) {
|
|
|
60435
60453
|
}
|
|
60436
60454
|
|
|
60437
60455
|
// src/version.ts
|
|
60438
|
-
var version = "0.2.
|
|
60456
|
+
var version = "0.2.358".length > 0 ? "0.2.358" : "dev";
|
|
60439
60457
|
|
|
60440
60458
|
// src/cli-probe/probe.ts
|
|
60441
60459
|
var fs60 = __toESM(require("fs"), 1);
|