@clawos-dev/clawd 0.2.356 → 0.2.357
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 -2
- 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 = [];
|
|
@@ -60435,7 +60452,7 @@ function computeMethodAccess(args) {
|
|
|
60435
60452
|
}
|
|
60436
60453
|
|
|
60437
60454
|
// src/version.ts
|
|
60438
|
-
var version = "0.2.
|
|
60455
|
+
var version = "0.2.357".length > 0 ? "0.2.357" : "dev";
|
|
60439
60456
|
|
|
60440
60457
|
// src/cli-probe/probe.ts
|
|
60441
60458
|
var fs60 = __toESM(require("fs"), 1);
|