@clawos-dev/clawd 0.2.595 → 0.2.597
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
|
@@ -51818,13 +51818,22 @@ function parseCodexRolloutMeta(firstLine) {
|
|
|
51818
51818
|
return obj ? metaFrom(obj) : null;
|
|
51819
51819
|
}
|
|
51820
51820
|
function firstUserMessageText(text) {
|
|
51821
|
+
let responseText;
|
|
51821
51822
|
for (const line of text.split("\n")) {
|
|
51822
51823
|
const obj = parseLine(line);
|
|
51823
|
-
if (!obj
|
|
51824
|
+
if (!obj) continue;
|
|
51824
51825
|
const p3 = rec(obj.payload);
|
|
51825
|
-
if (p3?.type === "user_message") return str(p3.message);
|
|
51826
|
+
if (obj.type === "event_msg" && p3?.type === "user_message") return str(p3.message);
|
|
51827
|
+
if (!responseText && obj.type === "response_item" && p3?.type === "message" && p3.role === "user" && hasContentKind(p3, "user.text")) responseText = outputText(p3.content) || void 0;
|
|
51826
51828
|
}
|
|
51827
|
-
return
|
|
51829
|
+
return responseText;
|
|
51830
|
+
}
|
|
51831
|
+
function hasContentKind(payload, kind) {
|
|
51832
|
+
const kinds = rec(payload.internal_chat_message_metadata_passthrough)?.content_item_kinds;
|
|
51833
|
+
return Array.isArray(kinds) && kinds.includes(kind);
|
|
51834
|
+
}
|
|
51835
|
+
function messageTurnId(payload) {
|
|
51836
|
+
return str(rec(payload.internal_chat_message_metadata_passthrough)?.turn_id);
|
|
51828
51837
|
}
|
|
51829
51838
|
function outputText(output) {
|
|
51830
51839
|
if (typeof output === "string") return output;
|
|
@@ -51852,8 +51861,21 @@ function functionCallInput(name, rawArgs) {
|
|
|
51852
51861
|
}
|
|
51853
51862
|
function parseCodexRollout(text) {
|
|
51854
51863
|
const out = { meta: null, messages: [], subagents: [], turns: [] };
|
|
51864
|
+
const lines = text.split("\n");
|
|
51855
51865
|
const collabCallIds = /* @__PURE__ */ new Set();
|
|
51856
|
-
|
|
51866
|
+
const eventTexts = /* @__PURE__ */ new Set();
|
|
51867
|
+
let eventTurnId;
|
|
51868
|
+
for (const line of lines) {
|
|
51869
|
+
const obj = parseLine(line);
|
|
51870
|
+
const p3 = obj && rec(obj.payload);
|
|
51871
|
+
if (!p3 || obj?.type !== "event_msg") continue;
|
|
51872
|
+
if (p3.type === "task_started") eventTurnId = str(p3.turn_id);
|
|
51873
|
+
if (p3.type === "user_message" || p3.type === "agent_message") {
|
|
51874
|
+
const body = str(p3.message);
|
|
51875
|
+
if (body) eventTexts.add(JSON.stringify([eventTurnId, p3.type === "user_message" ? "user" : "assistant", body]));
|
|
51876
|
+
}
|
|
51877
|
+
}
|
|
51878
|
+
for (const line of lines) {
|
|
51857
51879
|
const obj = parseLine(line);
|
|
51858
51880
|
if (!obj) continue;
|
|
51859
51881
|
const ts = str(obj.timestamp);
|
|
@@ -51921,6 +51943,15 @@ function parseCodexRollout(text) {
|
|
|
51921
51943
|
}
|
|
51922
51944
|
if (obj.type === "response_item") {
|
|
51923
51945
|
switch (p3.type) {
|
|
51946
|
+
case "message": {
|
|
51947
|
+
const role = str(p3.role);
|
|
51948
|
+
if (role !== "user" && role !== "assistant") break;
|
|
51949
|
+
if (role === "user" ? !hasContentKind(p3, "user.text") : !Array.isArray(rec(p3.internal_chat_message_metadata_passthrough)?.content_item_kinds)) break;
|
|
51950
|
+
const body = outputText(p3.content);
|
|
51951
|
+
if (!body || eventTexts.has(JSON.stringify([messageTurnId(p3), role, body]))) break;
|
|
51952
|
+
out.messages.push({ kind: role === "user" ? "user-text" : "assistant-text", text: body, raw: obj, ...ts ? { ts } : {} });
|
|
51953
|
+
break;
|
|
51954
|
+
}
|
|
51924
51955
|
case "function_call": {
|
|
51925
51956
|
const callId = str(p3.call_id);
|
|
51926
51957
|
const name = str(p3.name);
|
|
@@ -72875,7 +72906,7 @@ function computeMethodAccess(args) {
|
|
|
72875
72906
|
}
|
|
72876
72907
|
|
|
72877
72908
|
// src/version.ts
|
|
72878
|
-
var version = "0.2.
|
|
72909
|
+
var version = "0.2.597".length > 0 ? "0.2.597" : "dev";
|
|
72879
72910
|
|
|
72880
72911
|
// src/cli-probe/probe.ts
|
|
72881
72912
|
var fs83 = __toESM(require("fs"), 1);
|