@clawos-dev/clawd 0.2.92 → 0.2.93-beta.174.78b779b
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
|
@@ -10554,6 +10554,20 @@ function withCommonFields(msg, o) {
|
|
|
10554
10554
|
if (typeof o.uuid === "string" && o.uuid.length > 0) msg.uuid = o.uuid;
|
|
10555
10555
|
return msg;
|
|
10556
10556
|
}
|
|
10557
|
+
function isRejectSentinelLine(obj) {
|
|
10558
|
+
if (!obj || typeof obj !== "object") return false;
|
|
10559
|
+
return typeof obj.toolUseResult === "string";
|
|
10560
|
+
}
|
|
10561
|
+
function isUserPlainTextLine(obj) {
|
|
10562
|
+
if (!obj || typeof obj !== "object") return false;
|
|
10563
|
+
const o = obj;
|
|
10564
|
+
if (o.type !== "user") return false;
|
|
10565
|
+
const message = o.message;
|
|
10566
|
+
const content = message?.content;
|
|
10567
|
+
if (!Array.isArray(content) || content.length !== 1) return false;
|
|
10568
|
+
const part = content[0];
|
|
10569
|
+
return part?.type === "text";
|
|
10570
|
+
}
|
|
10557
10571
|
function messageFromJsonl(obj) {
|
|
10558
10572
|
if (!obj || typeof obj !== "object") return null;
|
|
10559
10573
|
const o = obj;
|
|
@@ -10561,6 +10575,7 @@ function messageFromJsonl(obj) {
|
|
|
10561
10575
|
const ts = o.timestamp ?? o.ts;
|
|
10562
10576
|
if (type === "user" || type === "assistant") {
|
|
10563
10577
|
const message = o.message;
|
|
10578
|
+
if (type === "assistant" && message?.model === "<synthetic>") return null;
|
|
10564
10579
|
const content = message?.content;
|
|
10565
10580
|
const toolResultExtra = type === "user" ? extractToolResultExtraFromRaw(o.toolUseResult) : void 0;
|
|
10566
10581
|
const sourceToolAssistantUUID = type === "user" && typeof o.sourceToolAssistantUUID === "string" ? o.sourceToolAssistantUUID : void 0;
|
|
@@ -10874,7 +10889,11 @@ var init_claude_history = __esm({
|
|
|
10874
10889
|
);
|
|
10875
10890
|
const lines = readJsonlLines(file);
|
|
10876
10891
|
const messages = [];
|
|
10892
|
+
let prevIsRejectSentinel = false;
|
|
10877
10893
|
for (const line of lines) {
|
|
10894
|
+
const skipInterruptedMarker = prevIsRejectSentinel && isUserPlainTextLine(line);
|
|
10895
|
+
prevIsRejectSentinel = isRejectSentinelLine(line);
|
|
10896
|
+
if (skipInterruptedMarker) continue;
|
|
10878
10897
|
const msg = messageFromJsonl(line);
|
|
10879
10898
|
if (msg) messages.push(msg);
|
|
10880
10899
|
}
|
|
@@ -11300,6 +11319,7 @@ function parseClaudeObjectInner(obj) {
|
|
|
11300
11319
|
}
|
|
11301
11320
|
if (type === "assistant") {
|
|
11302
11321
|
const message = obj.message;
|
|
11322
|
+
if (message?.model === "<synthetic>") return events;
|
|
11303
11323
|
if (message) {
|
|
11304
11324
|
const mModel = message.model;
|
|
11305
11325
|
if (typeof mModel === "string" && mModel.length > 0) {
|
|
@@ -25864,7 +25884,8 @@ var SessionObserver = class {
|
|
|
25864
25884
|
pollTimer: null,
|
|
25865
25885
|
lastSize: size,
|
|
25866
25886
|
buf: "",
|
|
25867
|
-
adapter: args.adapter
|
|
25887
|
+
adapter: args.adapter,
|
|
25888
|
+
prevIsRejectSentinel: false
|
|
25868
25889
|
};
|
|
25869
25890
|
try {
|
|
25870
25891
|
import_node_fs14.default.mkdirSync(import_node_path15.default.dirname(filePath), { recursive: true });
|
|
@@ -25937,6 +25958,15 @@ var SessionObserver = class {
|
|
|
25937
25958
|
while ((newlineIndex = w2.buf.indexOf("\n")) >= 0) {
|
|
25938
25959
|
const line = w2.buf.slice(0, newlineIndex);
|
|
25939
25960
|
w2.buf = w2.buf.slice(newlineIndex + 1);
|
|
25961
|
+
let parsed = null;
|
|
25962
|
+
try {
|
|
25963
|
+
parsed = line.trim() ? JSON.parse(line) : null;
|
|
25964
|
+
} catch {
|
|
25965
|
+
parsed = null;
|
|
25966
|
+
}
|
|
25967
|
+
const skipAsMarker = w2.prevIsRejectSentinel && parsed !== null && isUserPlainTextLine(parsed);
|
|
25968
|
+
w2.prevIsRejectSentinel = parsed !== null ? isRejectSentinelLine(parsed) : false;
|
|
25969
|
+
if (skipAsMarker) continue;
|
|
25940
25970
|
const events = w2.adapter.parseLine(line);
|
|
25941
25971
|
this.maybeReportUserMessage(w2.sessionId, line);
|
|
25942
25972
|
if (events.length > 0) {
|
package/package.json
CHANGED