@clawos-dev/clawd 0.2.93-beta.175.b162fd0 → 0.2.93
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 +31 -1
- package/package.json +1 -1
package/dist/cli.cjs
CHANGED
|
@@ -10559,6 +10559,20 @@ function withCommonFields(msg, o) {
|
|
|
10559
10559
|
if (typeof o.uuid === "string" && o.uuid.length > 0) msg.uuid = o.uuid;
|
|
10560
10560
|
return msg;
|
|
10561
10561
|
}
|
|
10562
|
+
function isRejectSentinelLine(obj) {
|
|
10563
|
+
if (!obj || typeof obj !== "object") return false;
|
|
10564
|
+
return typeof obj.toolUseResult === "string";
|
|
10565
|
+
}
|
|
10566
|
+
function isUserPlainTextLine(obj) {
|
|
10567
|
+
if (!obj || typeof obj !== "object") return false;
|
|
10568
|
+
const o = obj;
|
|
10569
|
+
if (o.type !== "user") return false;
|
|
10570
|
+
const message = o.message;
|
|
10571
|
+
const content = message?.content;
|
|
10572
|
+
if (!Array.isArray(content) || content.length !== 1) return false;
|
|
10573
|
+
const part = content[0];
|
|
10574
|
+
return part?.type === "text";
|
|
10575
|
+
}
|
|
10562
10576
|
function messageFromJsonl(obj) {
|
|
10563
10577
|
if (!obj || typeof obj !== "object") return null;
|
|
10564
10578
|
const o = obj;
|
|
@@ -10566,6 +10580,7 @@ function messageFromJsonl(obj) {
|
|
|
10566
10580
|
const ts = o.timestamp ?? o.ts;
|
|
10567
10581
|
if (type === "user" || type === "assistant") {
|
|
10568
10582
|
const message = o.message;
|
|
10583
|
+
if (type === "assistant" && message?.model === "<synthetic>") return null;
|
|
10569
10584
|
const content = message?.content;
|
|
10570
10585
|
const toolResultExtra = type === "user" ? extractToolResultExtraFromRaw(o.toolUseResult) : void 0;
|
|
10571
10586
|
const sourceToolAssistantUUID = type === "user" && typeof o.sourceToolAssistantUUID === "string" ? o.sourceToolAssistantUUID : void 0;
|
|
@@ -10879,7 +10894,11 @@ var init_claude_history = __esm({
|
|
|
10879
10894
|
);
|
|
10880
10895
|
const lines = readJsonlLines(file);
|
|
10881
10896
|
const messages = [];
|
|
10897
|
+
let prevIsRejectSentinel = false;
|
|
10882
10898
|
for (const line of lines) {
|
|
10899
|
+
const skipInterruptedMarker = prevIsRejectSentinel && isUserPlainTextLine(line);
|
|
10900
|
+
prevIsRejectSentinel = isRejectSentinelLine(line);
|
|
10901
|
+
if (skipInterruptedMarker) continue;
|
|
10883
10902
|
const msg = messageFromJsonl(line);
|
|
10884
10903
|
if (msg) messages.push(msg);
|
|
10885
10904
|
}
|
|
@@ -11305,6 +11324,7 @@ function parseClaudeObjectInner(obj) {
|
|
|
11305
11324
|
}
|
|
11306
11325
|
if (type === "assistant") {
|
|
11307
11326
|
const message = obj.message;
|
|
11327
|
+
if (message?.model === "<synthetic>") return events;
|
|
11308
11328
|
if (message) {
|
|
11309
11329
|
const mModel = message.model;
|
|
11310
11330
|
if (typeof mModel === "string" && mModel.length > 0) {
|
|
@@ -25970,7 +25990,8 @@ var SessionObserver = class {
|
|
|
25970
25990
|
pollTimer: null,
|
|
25971
25991
|
lastSize: size,
|
|
25972
25992
|
buf: "",
|
|
25973
|
-
adapter: args.adapter
|
|
25993
|
+
adapter: args.adapter,
|
|
25994
|
+
prevIsRejectSentinel: false
|
|
25974
25995
|
};
|
|
25975
25996
|
try {
|
|
25976
25997
|
import_node_fs14.default.mkdirSync(import_node_path15.default.dirname(filePath), { recursive: true });
|
|
@@ -26043,6 +26064,15 @@ var SessionObserver = class {
|
|
|
26043
26064
|
while ((newlineIndex = w2.buf.indexOf("\n")) >= 0) {
|
|
26044
26065
|
const line = w2.buf.slice(0, newlineIndex);
|
|
26045
26066
|
w2.buf = w2.buf.slice(newlineIndex + 1);
|
|
26067
|
+
let parsed = null;
|
|
26068
|
+
try {
|
|
26069
|
+
parsed = line.trim() ? JSON.parse(line) : null;
|
|
26070
|
+
} catch {
|
|
26071
|
+
parsed = null;
|
|
26072
|
+
}
|
|
26073
|
+
const skipAsMarker = w2.prevIsRejectSentinel && parsed !== null && isUserPlainTextLine(parsed);
|
|
26074
|
+
w2.prevIsRejectSentinel = parsed !== null ? isRejectSentinelLine(parsed) : false;
|
|
26075
|
+
if (skipAsMarker) continue;
|
|
26046
26076
|
const events = w2.adapter.parseLine(line);
|
|
26047
26077
|
this.maybeReportUserMessage(w2.sessionId, line);
|
|
26048
26078
|
if (events.length > 0) {
|
package/package.json
CHANGED