@autohq/cli 0.1.348 → 0.1.349
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/agent-bridge.js +49 -36
- package/dist/index.js +49 -36
- package/package.json +1 -1
package/dist/agent-bridge.js
CHANGED
|
@@ -23492,7 +23492,7 @@ Object.assign(lookup, {
|
|
|
23492
23492
|
// package.json
|
|
23493
23493
|
var package_default = {
|
|
23494
23494
|
name: "@autohq/cli",
|
|
23495
|
-
version: "0.1.
|
|
23495
|
+
version: "0.1.349",
|
|
23496
23496
|
license: "SEE LICENSE IN README.md",
|
|
23497
23497
|
publishConfig: {
|
|
23498
23498
|
access: "public"
|
|
@@ -45409,7 +45409,7 @@ var ClaudeCodeProjector = class {
|
|
|
45409
45409
|
if (message.type === "assistant" && !suppressStreamed) {
|
|
45410
45410
|
this.interruptMarkerSeen = false;
|
|
45411
45411
|
}
|
|
45412
|
-
const outputs = !suppressStreamed && message.type === "assistant" ? projectAssistantSnapshot(parsed.projections) : parsed.projections.flatMap((entry) => {
|
|
45412
|
+
const outputs = !suppressStreamed && message.type === "assistant" ? this.projectAssistantSnapshot(parsed.projections) : parsed.projections.flatMap((entry) => {
|
|
45413
45413
|
if (suppressStreamed && (entry.kind === "message" || entry.kind === "tool_call")) {
|
|
45414
45414
|
return [];
|
|
45415
45415
|
}
|
|
@@ -45543,6 +45543,53 @@ var ClaudeCodeProjector = class {
|
|
|
45543
45543
|
(index) => this.finishActiveToolInput(index)
|
|
45544
45544
|
);
|
|
45545
45545
|
}
|
|
45546
|
+
// A never-streamed assistant snapshot (an SDK-internal stream retry can
|
|
45547
|
+
// reissue the in-flight message under a fresh id, so suppression misses it;
|
|
45548
|
+
// pure snapshot delivery has no stream at all). Its content must respect the
|
|
45549
|
+
// one-UI-message-per-turn invariant: while the turn's message is open the
|
|
45550
|
+
// snapshot appends parts to it, and only a standalone snapshot may open —
|
|
45551
|
+
// and, when it awaits no tool results, close — a message of its own.
|
|
45552
|
+
// Emitting an unconditional start/finish here reset the downstream
|
|
45553
|
+
// assembler/part tracker mid-turn and froze the session's UI message
|
|
45554
|
+
// persistence for the rest of the turn (session_5d00e0a8, 2026-07-05).
|
|
45555
|
+
projectAssistantSnapshot(projections) {
|
|
45556
|
+
const messageChunks = this.assistantSnapshotMessageChunks(projections);
|
|
45557
|
+
const rest = projections.filter((projection) => !isAssistantMessageOrToolCall(projection)).flatMap((projection) => conversationProjectionToUiChunks(projection));
|
|
45558
|
+
const last = messageChunks.at(-1);
|
|
45559
|
+
if (last?.type === "ui_message_chunk" && last.chunk.type === "finish" && rest.length > 0) {
|
|
45560
|
+
return [...messageChunks.slice(0, -1), ...rest, last];
|
|
45561
|
+
}
|
|
45562
|
+
return [...messageChunks, ...rest];
|
|
45563
|
+
}
|
|
45564
|
+
assistantSnapshotMessageChunks(projections) {
|
|
45565
|
+
const messageProjection = projections.find(
|
|
45566
|
+
(projection) => projection.role === "assistant" && projection.kind === "message"
|
|
45567
|
+
);
|
|
45568
|
+
const toolCallProjections = projections.filter(
|
|
45569
|
+
(projection) => projection.role === "assistant" && projection.kind === "tool_call"
|
|
45570
|
+
);
|
|
45571
|
+
if (!messageProjection && toolCallProjections.length === 0) {
|
|
45572
|
+
return [];
|
|
45573
|
+
}
|
|
45574
|
+
const messageId = messageProjection?.messageId ?? toolCallProjections.find((projection) => projection.messageId)?.messageId ?? UNKNOWN_MESSAGE_ID;
|
|
45575
|
+
const standalone = this.activeResponseMessageId === null;
|
|
45576
|
+
const outputs = [
|
|
45577
|
+
...this.ensureResponseStarted(messageId)
|
|
45578
|
+
];
|
|
45579
|
+
if (messageProjection) {
|
|
45580
|
+
outputs.push(...messagePartChunks(messageProjection));
|
|
45581
|
+
}
|
|
45582
|
+
outputs.push(
|
|
45583
|
+
...toolCallProjections.flatMap(
|
|
45584
|
+
(projection) => toolCallChunks(projection)
|
|
45585
|
+
)
|
|
45586
|
+
);
|
|
45587
|
+
if (standalone && toolCallProjections.length === 0) {
|
|
45588
|
+
outputs.push(uiChunk({ type: "finish", finishReason: "stop" }));
|
|
45589
|
+
this.activeResponseMessageId = null;
|
|
45590
|
+
}
|
|
45591
|
+
return outputs;
|
|
45592
|
+
}
|
|
45546
45593
|
};
|
|
45547
45594
|
function projectClaudeCodeResult(result, options = {}) {
|
|
45548
45595
|
if (options.interrupted) {
|
|
@@ -45796,40 +45843,6 @@ function conversationProjectionToUiChunks(projection) {
|
|
|
45796
45843
|
}
|
|
45797
45844
|
];
|
|
45798
45845
|
}
|
|
45799
|
-
function projectAssistantSnapshot(projections) {
|
|
45800
|
-
const messageChunks = assistantSnapshotMessageChunks(projections);
|
|
45801
|
-
const rest = projections.filter((projection) => !isAssistantMessageOrToolCall(projection)).flatMap((projection) => conversationProjectionToUiChunks(projection));
|
|
45802
|
-
const last = messageChunks.at(-1);
|
|
45803
|
-
if (last?.type === "ui_message_chunk" && last.chunk.type === "finish" && rest.length > 0) {
|
|
45804
|
-
return [...messageChunks.slice(0, -1), ...rest, last];
|
|
45805
|
-
}
|
|
45806
|
-
return [...messageChunks, ...rest];
|
|
45807
|
-
}
|
|
45808
|
-
function assistantSnapshotMessageChunks(projections) {
|
|
45809
|
-
const messageProjection = projections.find(
|
|
45810
|
-
(projection) => projection.role === "assistant" && projection.kind === "message"
|
|
45811
|
-
);
|
|
45812
|
-
const toolCallProjections = projections.filter(
|
|
45813
|
-
(projection) => projection.role === "assistant" && projection.kind === "tool_call"
|
|
45814
|
-
);
|
|
45815
|
-
if (!messageProjection && toolCallProjections.length === 0) {
|
|
45816
|
-
return [];
|
|
45817
|
-
}
|
|
45818
|
-
const messageId = messageProjection?.messageId ?? toolCallProjections.find((projection) => projection.messageId)?.messageId ?? UNKNOWN_MESSAGE_ID;
|
|
45819
|
-
const outputs = [
|
|
45820
|
-
uiChunk({ type: "start", messageId })
|
|
45821
|
-
];
|
|
45822
|
-
if (messageProjection) {
|
|
45823
|
-
outputs.push(...messagePartChunks(messageProjection));
|
|
45824
|
-
}
|
|
45825
|
-
outputs.push(
|
|
45826
|
-
...toolCallProjections.flatMap((projection) => toolCallChunks(projection))
|
|
45827
|
-
);
|
|
45828
|
-
if (toolCallProjections.length === 0) {
|
|
45829
|
-
outputs.push(uiChunk({ type: "finish", finishReason: "stop" }));
|
|
45830
|
-
}
|
|
45831
|
-
return outputs;
|
|
45832
|
-
}
|
|
45833
45846
|
function isAssistantMessageOrToolCall(projection) {
|
|
45834
45847
|
return projection.role === "assistant" && (projection.kind === "message" || projection.kind === "tool_call");
|
|
45835
45848
|
}
|
package/dist/index.js
CHANGED
|
@@ -30534,7 +30534,7 @@ var init_package = __esm({
|
|
|
30534
30534
|
"package.json"() {
|
|
30535
30535
|
package_default = {
|
|
30536
30536
|
name: "@autohq/cli",
|
|
30537
|
-
version: "0.1.
|
|
30537
|
+
version: "0.1.349",
|
|
30538
30538
|
license: "SEE LICENSE IN README.md",
|
|
30539
30539
|
publishConfig: {
|
|
30540
30540
|
access: "public"
|
|
@@ -42642,7 +42642,7 @@ var ClaudeCodeProjector = class {
|
|
|
42642
42642
|
if (message.type === "assistant" && !suppressStreamed) {
|
|
42643
42643
|
this.interruptMarkerSeen = false;
|
|
42644
42644
|
}
|
|
42645
|
-
const outputs = !suppressStreamed && message.type === "assistant" ? projectAssistantSnapshot(parsed.projections) : parsed.projections.flatMap((entry) => {
|
|
42645
|
+
const outputs = !suppressStreamed && message.type === "assistant" ? this.projectAssistantSnapshot(parsed.projections) : parsed.projections.flatMap((entry) => {
|
|
42646
42646
|
if (suppressStreamed && (entry.kind === "message" || entry.kind === "tool_call")) {
|
|
42647
42647
|
return [];
|
|
42648
42648
|
}
|
|
@@ -42776,6 +42776,53 @@ var ClaudeCodeProjector = class {
|
|
|
42776
42776
|
(index) => this.finishActiveToolInput(index)
|
|
42777
42777
|
);
|
|
42778
42778
|
}
|
|
42779
|
+
// A never-streamed assistant snapshot (an SDK-internal stream retry can
|
|
42780
|
+
// reissue the in-flight message under a fresh id, so suppression misses it;
|
|
42781
|
+
// pure snapshot delivery has no stream at all). Its content must respect the
|
|
42782
|
+
// one-UI-message-per-turn invariant: while the turn's message is open the
|
|
42783
|
+
// snapshot appends parts to it, and only a standalone snapshot may open —
|
|
42784
|
+
// and, when it awaits no tool results, close — a message of its own.
|
|
42785
|
+
// Emitting an unconditional start/finish here reset the downstream
|
|
42786
|
+
// assembler/part tracker mid-turn and froze the session's UI message
|
|
42787
|
+
// persistence for the rest of the turn (session_5d00e0a8, 2026-07-05).
|
|
42788
|
+
projectAssistantSnapshot(projections) {
|
|
42789
|
+
const messageChunks = this.assistantSnapshotMessageChunks(projections);
|
|
42790
|
+
const rest = projections.filter((projection) => !isAssistantMessageOrToolCall(projection)).flatMap((projection) => conversationProjectionToUiChunks(projection));
|
|
42791
|
+
const last = messageChunks.at(-1);
|
|
42792
|
+
if (last?.type === "ui_message_chunk" && last.chunk.type === "finish" && rest.length > 0) {
|
|
42793
|
+
return [...messageChunks.slice(0, -1), ...rest, last];
|
|
42794
|
+
}
|
|
42795
|
+
return [...messageChunks, ...rest];
|
|
42796
|
+
}
|
|
42797
|
+
assistantSnapshotMessageChunks(projections) {
|
|
42798
|
+
const messageProjection = projections.find(
|
|
42799
|
+
(projection) => projection.role === "assistant" && projection.kind === "message"
|
|
42800
|
+
);
|
|
42801
|
+
const toolCallProjections = projections.filter(
|
|
42802
|
+
(projection) => projection.role === "assistant" && projection.kind === "tool_call"
|
|
42803
|
+
);
|
|
42804
|
+
if (!messageProjection && toolCallProjections.length === 0) {
|
|
42805
|
+
return [];
|
|
42806
|
+
}
|
|
42807
|
+
const messageId = messageProjection?.messageId ?? toolCallProjections.find((projection) => projection.messageId)?.messageId ?? UNKNOWN_MESSAGE_ID;
|
|
42808
|
+
const standalone = this.activeResponseMessageId === null;
|
|
42809
|
+
const outputs = [
|
|
42810
|
+
...this.ensureResponseStarted(messageId)
|
|
42811
|
+
];
|
|
42812
|
+
if (messageProjection) {
|
|
42813
|
+
outputs.push(...messagePartChunks(messageProjection));
|
|
42814
|
+
}
|
|
42815
|
+
outputs.push(
|
|
42816
|
+
...toolCallProjections.flatMap(
|
|
42817
|
+
(projection) => toolCallChunks(projection)
|
|
42818
|
+
)
|
|
42819
|
+
);
|
|
42820
|
+
if (standalone && toolCallProjections.length === 0) {
|
|
42821
|
+
outputs.push(uiChunk({ type: "finish", finishReason: "stop" }));
|
|
42822
|
+
this.activeResponseMessageId = null;
|
|
42823
|
+
}
|
|
42824
|
+
return outputs;
|
|
42825
|
+
}
|
|
42779
42826
|
};
|
|
42780
42827
|
function projectClaudeCodeResult(result, options = {}) {
|
|
42781
42828
|
if (options.interrupted) {
|
|
@@ -43029,40 +43076,6 @@ function conversationProjectionToUiChunks(projection) {
|
|
|
43029
43076
|
}
|
|
43030
43077
|
];
|
|
43031
43078
|
}
|
|
43032
|
-
function projectAssistantSnapshot(projections) {
|
|
43033
|
-
const messageChunks = assistantSnapshotMessageChunks(projections);
|
|
43034
|
-
const rest = projections.filter((projection) => !isAssistantMessageOrToolCall(projection)).flatMap((projection) => conversationProjectionToUiChunks(projection));
|
|
43035
|
-
const last = messageChunks.at(-1);
|
|
43036
|
-
if (last?.type === "ui_message_chunk" && last.chunk.type === "finish" && rest.length > 0) {
|
|
43037
|
-
return [...messageChunks.slice(0, -1), ...rest, last];
|
|
43038
|
-
}
|
|
43039
|
-
return [...messageChunks, ...rest];
|
|
43040
|
-
}
|
|
43041
|
-
function assistantSnapshotMessageChunks(projections) {
|
|
43042
|
-
const messageProjection = projections.find(
|
|
43043
|
-
(projection) => projection.role === "assistant" && projection.kind === "message"
|
|
43044
|
-
);
|
|
43045
|
-
const toolCallProjections = projections.filter(
|
|
43046
|
-
(projection) => projection.role === "assistant" && projection.kind === "tool_call"
|
|
43047
|
-
);
|
|
43048
|
-
if (!messageProjection && toolCallProjections.length === 0) {
|
|
43049
|
-
return [];
|
|
43050
|
-
}
|
|
43051
|
-
const messageId = messageProjection?.messageId ?? toolCallProjections.find((projection) => projection.messageId)?.messageId ?? UNKNOWN_MESSAGE_ID;
|
|
43052
|
-
const outputs = [
|
|
43053
|
-
uiChunk({ type: "start", messageId })
|
|
43054
|
-
];
|
|
43055
|
-
if (messageProjection) {
|
|
43056
|
-
outputs.push(...messagePartChunks(messageProjection));
|
|
43057
|
-
}
|
|
43058
|
-
outputs.push(
|
|
43059
|
-
...toolCallProjections.flatMap((projection) => toolCallChunks(projection))
|
|
43060
|
-
);
|
|
43061
|
-
if (toolCallProjections.length === 0) {
|
|
43062
|
-
outputs.push(uiChunk({ type: "finish", finishReason: "stop" }));
|
|
43063
|
-
}
|
|
43064
|
-
return outputs;
|
|
43065
|
-
}
|
|
43066
43079
|
function isAssistantMessageOrToolCall(projection) {
|
|
43067
43080
|
return projection.role === "assistant" && (projection.kind === "message" || projection.kind === "tool_call");
|
|
43068
43081
|
}
|