@autohq/cli 0.1.263 → 0.1.265
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 +112 -18
- package/dist/index.js +154 -36
- package/package.json +1 -1
package/dist/agent-bridge.js
CHANGED
|
@@ -19493,6 +19493,10 @@ var ConversationTextContentPartSchema = external_exports.object({
|
|
|
19493
19493
|
type: external_exports.literal("text"),
|
|
19494
19494
|
text: external_exports.string()
|
|
19495
19495
|
});
|
|
19496
|
+
var ConversationReasoningContentPartSchema = external_exports.object({
|
|
19497
|
+
type: external_exports.literal("reasoning"),
|
|
19498
|
+
text: external_exports.string()
|
|
19499
|
+
});
|
|
19496
19500
|
var ConversationToolCallContentPartSchema = external_exports.object({
|
|
19497
19501
|
type: external_exports.literal("tool_call"),
|
|
19498
19502
|
toolCallId: external_exports.string().min(1).nullable(),
|
|
@@ -19523,6 +19527,7 @@ var ConversationQuestionContentPartSchema = external_exports.object({
|
|
|
19523
19527
|
});
|
|
19524
19528
|
var ConversationContentPartSchema = external_exports.discriminatedUnion("type", [
|
|
19525
19529
|
ConversationTextContentPartSchema,
|
|
19530
|
+
ConversationReasoningContentPartSchema,
|
|
19526
19531
|
ConversationToolCallContentPartSchema,
|
|
19527
19532
|
ConversationToolResultContentPartSchema,
|
|
19528
19533
|
ConversationQuestionContentPartSchema
|
|
@@ -19534,6 +19539,14 @@ var ConversationTextDeltaSchema = external_exports.object({
|
|
|
19534
19539
|
type: external_exports.literal("text"),
|
|
19535
19540
|
text: external_exports.string()
|
|
19536
19541
|
});
|
|
19542
|
+
var ConversationReasoningDeltaSchema = external_exports.object({
|
|
19543
|
+
type: external_exports.literal("reasoning"),
|
|
19544
|
+
text: external_exports.string()
|
|
19545
|
+
});
|
|
19546
|
+
var ConversationDeltaSchema = external_exports.discriminatedUnion("type", [
|
|
19547
|
+
ConversationTextDeltaSchema,
|
|
19548
|
+
ConversationReasoningDeltaSchema
|
|
19549
|
+
]);
|
|
19537
19550
|
var RUNTIME_BRIDGE_NAMESPACE = "/bridge";
|
|
19538
19551
|
var RUNTIME_BRIDGE_SOCKET_PATH = "/runtime/socket.io";
|
|
19539
19552
|
var RUNTIME_BRIDGE_BOOTSTRAP_EVENT = "bridge.bootstrap";
|
|
@@ -19696,7 +19709,7 @@ var RuntimeBridgeOutputDeltaEnvelopeSchema = external_exports.object({
|
|
|
19696
19709
|
partId: external_exports.string().trim().min(1),
|
|
19697
19710
|
role: external_exports.literal("assistant"),
|
|
19698
19711
|
kind: external_exports.literal("message"),
|
|
19699
|
-
delta:
|
|
19712
|
+
delta: ConversationDeltaSchema,
|
|
19700
19713
|
createdAt: external_exports.string().datetime()
|
|
19701
19714
|
}).strict();
|
|
19702
19715
|
var RuntimeBridgeOutputEnvelopeSchema = external_exports.union([
|
|
@@ -23340,7 +23353,7 @@ Object.assign(lookup, {
|
|
|
23340
23353
|
// package.json
|
|
23341
23354
|
var package_default = {
|
|
23342
23355
|
name: "@autohq/cli",
|
|
23343
|
-
version: "0.1.
|
|
23356
|
+
version: "0.1.265",
|
|
23344
23357
|
license: "SEE LICENSE IN README.md",
|
|
23345
23358
|
publishConfig: {
|
|
23346
23359
|
access: "public"
|
|
@@ -24448,6 +24461,10 @@ var ConversationTextContentPartSchema2 = external_exports.object({
|
|
|
24448
24461
|
type: external_exports.literal("text"),
|
|
24449
24462
|
text: external_exports.string()
|
|
24450
24463
|
});
|
|
24464
|
+
var ConversationReasoningContentPartSchema2 = external_exports.object({
|
|
24465
|
+
type: external_exports.literal("reasoning"),
|
|
24466
|
+
text: external_exports.string()
|
|
24467
|
+
});
|
|
24451
24468
|
var ConversationToolCallContentPartSchema2 = external_exports.object({
|
|
24452
24469
|
type: external_exports.literal("tool_call"),
|
|
24453
24470
|
toolCallId: external_exports.string().min(1).nullable(),
|
|
@@ -24477,6 +24494,7 @@ var ConversationQuestionContentPartSchema2 = external_exports.object({
|
|
|
24477
24494
|
});
|
|
24478
24495
|
var ConversationContentPartSchema2 = external_exports.discriminatedUnion("type", [
|
|
24479
24496
|
ConversationTextContentPartSchema2,
|
|
24497
|
+
ConversationReasoningContentPartSchema2,
|
|
24480
24498
|
ConversationToolCallContentPartSchema2,
|
|
24481
24499
|
ConversationToolResultContentPartSchema2,
|
|
24482
24500
|
ConversationQuestionContentPartSchema2
|
|
@@ -24501,6 +24519,14 @@ var ConversationTextDeltaSchema2 = external_exports.object({
|
|
|
24501
24519
|
type: external_exports.literal("text"),
|
|
24502
24520
|
text: external_exports.string()
|
|
24503
24521
|
});
|
|
24522
|
+
var ConversationReasoningDeltaSchema2 = external_exports.object({
|
|
24523
|
+
type: external_exports.literal("reasoning"),
|
|
24524
|
+
text: external_exports.string()
|
|
24525
|
+
});
|
|
24526
|
+
var ConversationDeltaSchema2 = external_exports.discriminatedUnion("type", [
|
|
24527
|
+
ConversationTextDeltaSchema2,
|
|
24528
|
+
ConversationReasoningDeltaSchema2
|
|
24529
|
+
]);
|
|
24504
24530
|
var ConversationDeltaEventSchema = external_exports.object({
|
|
24505
24531
|
type: external_exports.literal("conversation.delta"),
|
|
24506
24532
|
id: external_exports.string().min(1),
|
|
@@ -24510,7 +24536,7 @@ var ConversationDeltaEventSchema = external_exports.object({
|
|
|
24510
24536
|
partId: external_exports.string().min(1),
|
|
24511
24537
|
role: external_exports.literal("assistant"),
|
|
24512
24538
|
kind: external_exports.literal("message"),
|
|
24513
|
-
delta:
|
|
24539
|
+
delta: ConversationDeltaSchema2,
|
|
24514
24540
|
createdAt: external_exports.string().datetime()
|
|
24515
24541
|
});
|
|
24516
24542
|
var ConversationRealtimeEventSchema = external_exports.discriminatedUnion("type", [
|
|
@@ -24530,6 +24556,10 @@ var ClaudeCodeToolUseBlockSchema = external_exports.object({
|
|
|
24530
24556
|
name: external_exports.string().optional(),
|
|
24531
24557
|
input: external_exports.unknown().optional()
|
|
24532
24558
|
}).passthrough();
|
|
24559
|
+
var ClaudeCodeThinkingBlockSchema = external_exports.object({
|
|
24560
|
+
type: external_exports.literal("thinking"),
|
|
24561
|
+
thinking: external_exports.string().default("")
|
|
24562
|
+
}).passthrough();
|
|
24533
24563
|
var ClaudeCodeToolResultBlockSchema = external_exports.object({
|
|
24534
24564
|
type: external_exports.literal("tool_result"),
|
|
24535
24565
|
tool_use_id: external_exports.string().optional(),
|
|
@@ -24538,6 +24568,7 @@ var ClaudeCodeToolResultBlockSchema = external_exports.object({
|
|
|
24538
24568
|
}).passthrough();
|
|
24539
24569
|
var ClaudeCodeAssistantContentBlockSchema = external_exports.discriminatedUnion("type", [
|
|
24540
24570
|
ClaudeCodeTextBlockSchema,
|
|
24571
|
+
ClaudeCodeThinkingBlockSchema,
|
|
24541
24572
|
ClaudeCodeToolUseBlockSchema
|
|
24542
24573
|
]);
|
|
24543
24574
|
var OptionalClaudeCodeAssistantContentBlockSchema = external_exports.unknown().transform((block) => {
|
|
@@ -24693,14 +24724,20 @@ function assistantContentProjections(message, messageId) {
|
|
|
24693
24724
|
if (!Array.isArray(content)) {
|
|
24694
24725
|
return [];
|
|
24695
24726
|
}
|
|
24727
|
+
const messageParts = [];
|
|
24696
24728
|
const projections = [];
|
|
24697
24729
|
for (const block of content) {
|
|
24698
24730
|
if (block.type === "text" && block.text.length > 0) {
|
|
24699
|
-
|
|
24700
|
-
|
|
24701
|
-
|
|
24702
|
-
|
|
24703
|
-
|
|
24731
|
+
messageParts.push({
|
|
24732
|
+
type: "text",
|
|
24733
|
+
text: block.text
|
|
24734
|
+
});
|
|
24735
|
+
continue;
|
|
24736
|
+
}
|
|
24737
|
+
if (block.type === "thinking" && block.thinking.length > 0) {
|
|
24738
|
+
messageParts.push({
|
|
24739
|
+
type: "reasoning",
|
|
24740
|
+
text: block.thinking
|
|
24704
24741
|
});
|
|
24705
24742
|
continue;
|
|
24706
24743
|
}
|
|
@@ -24713,7 +24750,6 @@ function assistantContentProjections(message, messageId) {
|
|
|
24713
24750
|
projections.push({
|
|
24714
24751
|
role: "assistant",
|
|
24715
24752
|
kind: "tool_call",
|
|
24716
|
-
...messageId ? { messageId } : {},
|
|
24717
24753
|
content: {
|
|
24718
24754
|
parts: [
|
|
24719
24755
|
{
|
|
@@ -24727,6 +24763,14 @@ function assistantContentProjections(message, messageId) {
|
|
|
24727
24763
|
});
|
|
24728
24764
|
}
|
|
24729
24765
|
}
|
|
24766
|
+
if (messageParts.length > 0) {
|
|
24767
|
+
projections.unshift({
|
|
24768
|
+
role: "assistant",
|
|
24769
|
+
kind: "message",
|
|
24770
|
+
...messageId ? { messageId } : {},
|
|
24771
|
+
content: { parts: messageParts }
|
|
24772
|
+
});
|
|
24773
|
+
}
|
|
24730
24774
|
return projections;
|
|
24731
24775
|
}
|
|
24732
24776
|
var AskUserQuestionInputSchema = external_exports.object({
|
|
@@ -24938,6 +24982,20 @@ function projectCodexItem(input) {
|
|
|
24938
24982
|
content: textContent2(item.text)
|
|
24939
24983
|
}
|
|
24940
24984
|
] : [];
|
|
24985
|
+
case "reasoning": {
|
|
24986
|
+
if (phase !== "completed") {
|
|
24987
|
+
return [];
|
|
24988
|
+
}
|
|
24989
|
+
const text = item.summary.map((line) => line.trim()).filter(Boolean).join("\n\n");
|
|
24990
|
+
return text.length > 0 ? [
|
|
24991
|
+
{
|
|
24992
|
+
role: "assistant",
|
|
24993
|
+
kind: "message",
|
|
24994
|
+
messageId: item.id,
|
|
24995
|
+
content: reasoningContent(text)
|
|
24996
|
+
}
|
|
24997
|
+
] : [];
|
|
24998
|
+
}
|
|
24941
24999
|
case "commandExecution":
|
|
24942
25000
|
return toolProjection({
|
|
24943
25001
|
phase,
|
|
@@ -25158,6 +25216,9 @@ function toolProjection(input) {
|
|
|
25158
25216
|
function textContent2(text) {
|
|
25159
25217
|
return { parts: [{ type: "text", text }] };
|
|
25160
25218
|
}
|
|
25219
|
+
function reasoningContent(text) {
|
|
25220
|
+
return { parts: [{ type: "reasoning", text }] };
|
|
25221
|
+
}
|
|
25161
25222
|
function isFailedStatus(status) {
|
|
25162
25223
|
return status === "failed" || status === "declined";
|
|
25163
25224
|
}
|
|
@@ -26134,6 +26195,17 @@ function templateField(guard) {
|
|
|
26134
26195
|
const field = external_exports.string().trim().min(1).max(2e4).optional();
|
|
26135
26196
|
return guard === "authoring" ? field.superRefine(refineNoPayloadPrefixedTemplateTokens) : field;
|
|
26136
26197
|
}
|
|
26198
|
+
function displayTitleField(guard) {
|
|
26199
|
+
const field = external_exports.union([
|
|
26200
|
+
external_exports.literal("infer"),
|
|
26201
|
+
external_exports.string().trim().min(1).max(2e4)
|
|
26202
|
+
]);
|
|
26203
|
+
return (guard === "authoring" ? field.superRefine((value2, context) => {
|
|
26204
|
+
if (value2 !== "infer") {
|
|
26205
|
+
refineNoPayloadPrefixedTemplateTokens(value2, context);
|
|
26206
|
+
}
|
|
26207
|
+
}) : field).optional();
|
|
26208
|
+
}
|
|
26137
26209
|
var TriggerChecksField = external_exports.array(
|
|
26138
26210
|
external_exports.object({
|
|
26139
26211
|
name: ResourceNameSchema,
|
|
@@ -26315,6 +26387,7 @@ var AgentSpecFieldsSchema = external_exports.object({
|
|
|
26315
26387
|
environment: ResourceNameSchema.optional(),
|
|
26316
26388
|
identity: external_exports.union([ResourceNameSchema, AgentIdentitySchema]).optional(),
|
|
26317
26389
|
initialPrompt: templateField("stored"),
|
|
26390
|
+
displayTitle: displayTitleField("stored"),
|
|
26318
26391
|
env: SecretEnvSchema.default({}),
|
|
26319
26392
|
mounts: external_exports.array(AgentMountSchema).default([]),
|
|
26320
26393
|
triggers: TriggersSchema.default([]),
|
|
@@ -26343,6 +26416,7 @@ var AgentSpecSchema = AgentSpecFieldsSchema.superRefine(
|
|
|
26343
26416
|
);
|
|
26344
26417
|
var AgentApplySpecSchema = AgentSpecFieldsSchema.extend({
|
|
26345
26418
|
initialPrompt: templateField("authoring"),
|
|
26419
|
+
displayTitle: displayTitleField("authoring"),
|
|
26346
26420
|
triggers: ApplyTriggersSchema.default([])
|
|
26347
26421
|
}).superRefine(validateRunnableConfig);
|
|
26348
26422
|
var AgentStatusSchema = external_exports.object({
|
|
@@ -27427,6 +27501,28 @@ var SessionTurnRecordSchema = external_exports.object({
|
|
|
27427
27501
|
updatedAt: external_exports.string().datetime()
|
|
27428
27502
|
});
|
|
27429
27503
|
|
|
27504
|
+
// ../../packages/schemas/src/session-bindings.ts
|
|
27505
|
+
var BINDING_TARGET_TYPES = [
|
|
27506
|
+
"github.pull_request",
|
|
27507
|
+
"slack.thread",
|
|
27508
|
+
"chat.message",
|
|
27509
|
+
"agent.singleton"
|
|
27510
|
+
];
|
|
27511
|
+
var SESSION_BINDING_SOURCES = [
|
|
27512
|
+
"trigger_spawn",
|
|
27513
|
+
"agent_tool",
|
|
27514
|
+
"chat_send",
|
|
27515
|
+
"system"
|
|
27516
|
+
];
|
|
27517
|
+
var SESSION_BINDING_STATUSES = ["active", "released"];
|
|
27518
|
+
var BindingTargetTypeSchema = external_exports.enum(BINDING_TARGET_TYPES);
|
|
27519
|
+
var SessionBindingSourceSchema = external_exports.enum(SESSION_BINDING_SOURCES);
|
|
27520
|
+
var SessionBindingStatusSchema = external_exports.enum(SESSION_BINDING_STATUSES);
|
|
27521
|
+
var BindingTargetSchema = external_exports.object({
|
|
27522
|
+
type: BindingTargetTypeSchema,
|
|
27523
|
+
externalId: external_exports.string().min(1)
|
|
27524
|
+
});
|
|
27525
|
+
|
|
27430
27526
|
// ../../packages/schemas/src/singleton-refresh.ts
|
|
27431
27527
|
var SINGLETON_RESPAWN_REASONS = ["refresh"];
|
|
27432
27528
|
var SingletonRespawnReasonSchema = external_exports.enum(SINGLETON_RESPAWN_REASONS);
|
|
@@ -28269,7 +28365,7 @@ var AgentBridgeOutputBuffer = class {
|
|
|
28269
28365
|
}
|
|
28270
28366
|
};
|
|
28271
28367
|
function canCoalesceDelta(pending, context, delta) {
|
|
28272
|
-
return pending.context.sessionId === context.sessionId && pending.context.runtimeId === context.runtimeId && pending.context.bridgeLeaseId === context.bridgeLeaseId && pending.delta.messageId === delta.messageId && pending.delta.partId === delta.partId && pending.delta.role === delta.role && pending.delta.kind === delta.kind && pending.delta.delta.type ===
|
|
28368
|
+
return pending.context.sessionId === context.sessionId && pending.context.runtimeId === context.runtimeId && pending.context.bridgeLeaseId === context.bridgeLeaseId && pending.delta.messageId === delta.messageId && pending.delta.partId === delta.partId && pending.delta.role === delta.role && pending.delta.kind === delta.kind && pending.delta.delta.type === delta.delta.type;
|
|
28273
28369
|
}
|
|
28274
28370
|
function coalesceDelta(pending, delta) {
|
|
28275
28371
|
return {
|
|
@@ -28277,7 +28373,7 @@ function coalesceDelta(pending, delta) {
|
|
|
28277
28373
|
delta: {
|
|
28278
28374
|
...pending.delta,
|
|
28279
28375
|
delta: {
|
|
28280
|
-
type:
|
|
28376
|
+
type: pending.delta.delta.type,
|
|
28281
28377
|
text: pending.delta.delta.text + delta.delta.text
|
|
28282
28378
|
}
|
|
28283
28379
|
}
|
|
@@ -28347,7 +28443,7 @@ var ClaudeCodeProjector = class {
|
|
|
28347
28443
|
this.currentMessageId = null;
|
|
28348
28444
|
return [];
|
|
28349
28445
|
}
|
|
28350
|
-
const delta =
|
|
28446
|
+
const delta = partialAssistantDeltaPayload(
|
|
28351
28447
|
message,
|
|
28352
28448
|
this.currentMessageId ?? UNKNOWN_MESSAGE_ID
|
|
28353
28449
|
);
|
|
@@ -28413,27 +28509,25 @@ function anthropicMessageIdFromStreamStart(message) {
|
|
|
28413
28509
|
const id = event.message.id;
|
|
28414
28510
|
return typeof id === "string" && id.trim() ? id : null;
|
|
28415
28511
|
}
|
|
28416
|
-
function
|
|
28512
|
+
function partialAssistantDeltaPayload(message, messageId) {
|
|
28417
28513
|
const event = message.event;
|
|
28418
28514
|
if (event.type !== "content_block_delta") {
|
|
28419
28515
|
return null;
|
|
28420
28516
|
}
|
|
28421
28517
|
const delta = event.delta;
|
|
28422
|
-
|
|
28423
|
-
return null;
|
|
28424
|
-
}
|
|
28425
|
-
const text = delta.text;
|
|
28518
|
+
const text = delta.type === "text_delta" ? delta.text : delta.type === "thinking_delta" ? delta.thinking : "";
|
|
28426
28519
|
if (text.length === 0) {
|
|
28427
28520
|
return null;
|
|
28428
28521
|
}
|
|
28429
28522
|
const index = event.index;
|
|
28523
|
+
const type = delta.type === "thinking_delta" ? "reasoning" : "text";
|
|
28430
28524
|
return {
|
|
28431
28525
|
messageId,
|
|
28432
28526
|
partId: typeof index === "number" ? String(index) : "0",
|
|
28433
28527
|
role: "assistant",
|
|
28434
28528
|
kind: "message",
|
|
28435
28529
|
delta: {
|
|
28436
|
-
type
|
|
28530
|
+
type,
|
|
28437
28531
|
text
|
|
28438
28532
|
}
|
|
28439
28533
|
};
|
package/dist/index.js
CHANGED
|
@@ -15840,7 +15840,7 @@ var init_chat = __esm({
|
|
|
15840
15840
|
});
|
|
15841
15841
|
|
|
15842
15842
|
// ../../packages/schemas/src/conversation.ts
|
|
15843
|
-
var CONVERSATION_ROLES, CONVERSATION_ENTRY_KINDS, CONVERSATION_ENTRY_STATUSES, UNKNOWN_MESSAGE_ID, ConversationRoleSchema, ConversationEntryKindSchema, ConversationEntryStatusSchema, ConversationTextContentPartSchema, ConversationToolCallContentPartSchema, ConversationToolResultContentPartSchema, ConversationQuestionOptionSchema, ConversationQuestionSchema, ConversationQuestionContentPartSchema, ConversationContentPartSchema, ConversationEntryContentSchema, ConversationEntryEventSchema, ConversationTextDeltaSchema, ConversationDeltaEventSchema, ConversationRealtimeEventSchema;
|
|
15843
|
+
var CONVERSATION_ROLES, CONVERSATION_ENTRY_KINDS, CONVERSATION_ENTRY_STATUSES, UNKNOWN_MESSAGE_ID, ConversationRoleSchema, ConversationEntryKindSchema, ConversationEntryStatusSchema, ConversationTextContentPartSchema, ConversationReasoningContentPartSchema, ConversationToolCallContentPartSchema, ConversationToolResultContentPartSchema, ConversationQuestionOptionSchema, ConversationQuestionSchema, ConversationQuestionContentPartSchema, ConversationContentPartSchema, ConversationEntryContentSchema, ConversationEntryEventSchema, ConversationTextDeltaSchema, ConversationReasoningDeltaSchema, ConversationDeltaSchema, ConversationDeltaEventSchema, ConversationRealtimeEventSchema;
|
|
15844
15844
|
var init_conversation = __esm({
|
|
15845
15845
|
"../../packages/schemas/src/conversation.ts"() {
|
|
15846
15846
|
"use strict";
|
|
@@ -15875,6 +15875,10 @@ var init_conversation = __esm({
|
|
|
15875
15875
|
type: external_exports.literal("text"),
|
|
15876
15876
|
text: external_exports.string()
|
|
15877
15877
|
});
|
|
15878
|
+
ConversationReasoningContentPartSchema = external_exports.object({
|
|
15879
|
+
type: external_exports.literal("reasoning"),
|
|
15880
|
+
text: external_exports.string()
|
|
15881
|
+
});
|
|
15878
15882
|
ConversationToolCallContentPartSchema = external_exports.object({
|
|
15879
15883
|
type: external_exports.literal("tool_call"),
|
|
15880
15884
|
toolCallId: external_exports.string().min(1).nullable(),
|
|
@@ -15904,6 +15908,7 @@ var init_conversation = __esm({
|
|
|
15904
15908
|
});
|
|
15905
15909
|
ConversationContentPartSchema = external_exports.discriminatedUnion("type", [
|
|
15906
15910
|
ConversationTextContentPartSchema,
|
|
15911
|
+
ConversationReasoningContentPartSchema,
|
|
15907
15912
|
ConversationToolCallContentPartSchema,
|
|
15908
15913
|
ConversationToolResultContentPartSchema,
|
|
15909
15914
|
ConversationQuestionContentPartSchema
|
|
@@ -15928,6 +15933,14 @@ var init_conversation = __esm({
|
|
|
15928
15933
|
type: external_exports.literal("text"),
|
|
15929
15934
|
text: external_exports.string()
|
|
15930
15935
|
});
|
|
15936
|
+
ConversationReasoningDeltaSchema = external_exports.object({
|
|
15937
|
+
type: external_exports.literal("reasoning"),
|
|
15938
|
+
text: external_exports.string()
|
|
15939
|
+
});
|
|
15940
|
+
ConversationDeltaSchema = external_exports.discriminatedUnion("type", [
|
|
15941
|
+
ConversationTextDeltaSchema,
|
|
15942
|
+
ConversationReasoningDeltaSchema
|
|
15943
|
+
]);
|
|
15931
15944
|
ConversationDeltaEventSchema = external_exports.object({
|
|
15932
15945
|
type: external_exports.literal("conversation.delta"),
|
|
15933
15946
|
id: external_exports.string().min(1),
|
|
@@ -15937,7 +15950,7 @@ var init_conversation = __esm({
|
|
|
15937
15950
|
partId: external_exports.string().min(1),
|
|
15938
15951
|
role: external_exports.literal("assistant"),
|
|
15939
15952
|
kind: external_exports.literal("message"),
|
|
15940
|
-
delta:
|
|
15953
|
+
delta: ConversationDeltaSchema,
|
|
15941
15954
|
createdAt: external_exports.string().datetime()
|
|
15942
15955
|
});
|
|
15943
15956
|
ConversationRealtimeEventSchema = external_exports.discriminatedUnion("type", [
|
|
@@ -16025,14 +16038,20 @@ function assistantContentProjections(message, messageId) {
|
|
|
16025
16038
|
if (!Array.isArray(content)) {
|
|
16026
16039
|
return [];
|
|
16027
16040
|
}
|
|
16041
|
+
const messageParts = [];
|
|
16028
16042
|
const projections = [];
|
|
16029
16043
|
for (const block of content) {
|
|
16030
16044
|
if (block.type === "text" && block.text.length > 0) {
|
|
16031
|
-
|
|
16032
|
-
|
|
16033
|
-
|
|
16034
|
-
|
|
16035
|
-
|
|
16045
|
+
messageParts.push({
|
|
16046
|
+
type: "text",
|
|
16047
|
+
text: block.text
|
|
16048
|
+
});
|
|
16049
|
+
continue;
|
|
16050
|
+
}
|
|
16051
|
+
if (block.type === "thinking" && block.thinking.length > 0) {
|
|
16052
|
+
messageParts.push({
|
|
16053
|
+
type: "reasoning",
|
|
16054
|
+
text: block.thinking
|
|
16036
16055
|
});
|
|
16037
16056
|
continue;
|
|
16038
16057
|
}
|
|
@@ -16045,7 +16064,6 @@ function assistantContentProjections(message, messageId) {
|
|
|
16045
16064
|
projections.push({
|
|
16046
16065
|
role: "assistant",
|
|
16047
16066
|
kind: "tool_call",
|
|
16048
|
-
...messageId ? { messageId } : {},
|
|
16049
16067
|
content: {
|
|
16050
16068
|
parts: [
|
|
16051
16069
|
{
|
|
@@ -16059,6 +16077,14 @@ function assistantContentProjections(message, messageId) {
|
|
|
16059
16077
|
});
|
|
16060
16078
|
}
|
|
16061
16079
|
}
|
|
16080
|
+
if (messageParts.length > 0) {
|
|
16081
|
+
projections.unshift({
|
|
16082
|
+
role: "assistant",
|
|
16083
|
+
kind: "message",
|
|
16084
|
+
...messageId ? { messageId } : {},
|
|
16085
|
+
content: { parts: messageParts }
|
|
16086
|
+
});
|
|
16087
|
+
}
|
|
16062
16088
|
return projections;
|
|
16063
16089
|
}
|
|
16064
16090
|
function questionProjection(block, messageId) {
|
|
@@ -16144,7 +16170,7 @@ function usdAmount(value) {
|
|
|
16144
16170
|
}
|
|
16145
16171
|
return value;
|
|
16146
16172
|
}
|
|
16147
|
-
var ASK_USER_QUESTION_TOOL_NAME, ClaudeCodeTextBlockSchema, ClaudeCodeToolUseBlockSchema, ClaudeCodeToolResultBlockSchema, ClaudeCodeAssistantContentBlockSchema, OptionalClaudeCodeAssistantContentBlockSchema, ClaudeCodeAssistantContentSchema, OptionalClaudeCodeToolResultBlockSchema, ClaudeCodeToolResultContentSchema, ClaudeCodeUserContentSchema, ClaudeCodeAssistantMessageSchema, ClaudeCodeUserMessageSchema, ClaudeCodeSystemRecordSchema, ClaudeCodeAssistantRecordSchema, ClaudeCodeUserRecordSchema, ClaudeCodeAggregateUsageSchema, ClaudeCodeModelUsageSchema, ClaudeCodeResultRecordSchema, ClaudeCodeSessionRecordSchema, ClaudeCodeStreamRecordSchema, AskUserQuestionInputSchema;
|
|
16173
|
+
var ASK_USER_QUESTION_TOOL_NAME, ClaudeCodeTextBlockSchema, ClaudeCodeToolUseBlockSchema, ClaudeCodeThinkingBlockSchema, ClaudeCodeToolResultBlockSchema, ClaudeCodeAssistantContentBlockSchema, OptionalClaudeCodeAssistantContentBlockSchema, ClaudeCodeAssistantContentSchema, OptionalClaudeCodeToolResultBlockSchema, ClaudeCodeToolResultContentSchema, ClaudeCodeUserContentSchema, ClaudeCodeAssistantMessageSchema, ClaudeCodeUserMessageSchema, ClaudeCodeSystemRecordSchema, ClaudeCodeAssistantRecordSchema, ClaudeCodeUserRecordSchema, ClaudeCodeAggregateUsageSchema, ClaudeCodeModelUsageSchema, ClaudeCodeResultRecordSchema, ClaudeCodeSessionRecordSchema, ClaudeCodeStreamRecordSchema, AskUserQuestionInputSchema;
|
|
16148
16174
|
var init_claude_code = __esm({
|
|
16149
16175
|
"../../packages/schemas/src/claude-code.ts"() {
|
|
16150
16176
|
"use strict";
|
|
@@ -16162,6 +16188,10 @@ var init_claude_code = __esm({
|
|
|
16162
16188
|
name: external_exports.string().optional(),
|
|
16163
16189
|
input: external_exports.unknown().optional()
|
|
16164
16190
|
}).passthrough();
|
|
16191
|
+
ClaudeCodeThinkingBlockSchema = external_exports.object({
|
|
16192
|
+
type: external_exports.literal("thinking"),
|
|
16193
|
+
thinking: external_exports.string().default("")
|
|
16194
|
+
}).passthrough();
|
|
16165
16195
|
ClaudeCodeToolResultBlockSchema = external_exports.object({
|
|
16166
16196
|
type: external_exports.literal("tool_result"),
|
|
16167
16197
|
tool_use_id: external_exports.string().optional(),
|
|
@@ -16170,6 +16200,7 @@ var init_claude_code = __esm({
|
|
|
16170
16200
|
}).passthrough();
|
|
16171
16201
|
ClaudeCodeAssistantContentBlockSchema = external_exports.discriminatedUnion("type", [
|
|
16172
16202
|
ClaudeCodeTextBlockSchema,
|
|
16203
|
+
ClaudeCodeThinkingBlockSchema,
|
|
16173
16204
|
ClaudeCodeToolUseBlockSchema
|
|
16174
16205
|
]);
|
|
16175
16206
|
OptionalClaudeCodeAssistantContentBlockSchema = external_exports.unknown().transform((block) => {
|
|
@@ -16286,6 +16317,20 @@ function projectCodexItem(input) {
|
|
|
16286
16317
|
content: textContent2(item.text)
|
|
16287
16318
|
}
|
|
16288
16319
|
] : [];
|
|
16320
|
+
case "reasoning": {
|
|
16321
|
+
if (phase !== "completed") {
|
|
16322
|
+
return [];
|
|
16323
|
+
}
|
|
16324
|
+
const text = item.summary.map((line) => line.trim()).filter(Boolean).join("\n\n");
|
|
16325
|
+
return text.length > 0 ? [
|
|
16326
|
+
{
|
|
16327
|
+
role: "assistant",
|
|
16328
|
+
kind: "message",
|
|
16329
|
+
messageId: item.id,
|
|
16330
|
+
content: reasoningContent(text)
|
|
16331
|
+
}
|
|
16332
|
+
] : [];
|
|
16333
|
+
}
|
|
16289
16334
|
case "commandExecution":
|
|
16290
16335
|
return toolProjection({
|
|
16291
16336
|
phase,
|
|
@@ -16504,6 +16549,9 @@ function toolProjection(input) {
|
|
|
16504
16549
|
function textContent2(text) {
|
|
16505
16550
|
return { parts: [{ type: "text", text }] };
|
|
16506
16551
|
}
|
|
16552
|
+
function reasoningContent(text) {
|
|
16553
|
+
return { parts: [{ type: "reasoning", text }] };
|
|
16554
|
+
}
|
|
16507
16555
|
function isFailedStatus(status) {
|
|
16508
16556
|
return status === "failed" || status === "declined";
|
|
16509
16557
|
}
|
|
@@ -16655,12 +16703,7 @@ function syntheticDeltaEntry(event) {
|
|
|
16655
16703
|
kind: event.kind,
|
|
16656
16704
|
status: "in_progress",
|
|
16657
16705
|
content: {
|
|
16658
|
-
parts: [
|
|
16659
|
-
{
|
|
16660
|
-
type: "text",
|
|
16661
|
-
text: textFromDelta(event)
|
|
16662
|
-
}
|
|
16663
|
-
]
|
|
16706
|
+
parts: [partFromDelta(event)]
|
|
16664
16707
|
},
|
|
16665
16708
|
createdAt: event.createdAt,
|
|
16666
16709
|
completedAt: null
|
|
@@ -16669,13 +16712,15 @@ function syntheticDeltaEntry(event) {
|
|
|
16669
16712
|
function appendDeltaToEntry(entry, event) {
|
|
16670
16713
|
const text = textFromDelta(event);
|
|
16671
16714
|
const parts = [...entry.content.parts];
|
|
16672
|
-
const
|
|
16673
|
-
|
|
16674
|
-
|
|
16715
|
+
const matchingPartIndex = parts.findIndex(
|
|
16716
|
+
(part) => part.type === event.delta.type
|
|
16717
|
+
);
|
|
16718
|
+
if (matchingPartIndex === -1) {
|
|
16719
|
+
parts.push(partFromDelta(event));
|
|
16675
16720
|
} else {
|
|
16676
|
-
const part = parts[
|
|
16677
|
-
if (part?.type === "text") {
|
|
16678
|
-
parts[
|
|
16721
|
+
const part = parts[matchingPartIndex];
|
|
16722
|
+
if (part?.type === "text" || part?.type === "reasoning") {
|
|
16723
|
+
parts[matchingPartIndex] = {
|
|
16679
16724
|
...part,
|
|
16680
16725
|
text: `${part.text}${text}`
|
|
16681
16726
|
};
|
|
@@ -16688,7 +16733,19 @@ function appendDeltaToEntry(entry, event) {
|
|
|
16688
16733
|
};
|
|
16689
16734
|
}
|
|
16690
16735
|
function textFromDelta(event) {
|
|
16691
|
-
return event.delta.
|
|
16736
|
+
return event.delta.text;
|
|
16737
|
+
}
|
|
16738
|
+
function partFromDelta(event) {
|
|
16739
|
+
if (event.delta.type === "reasoning") {
|
|
16740
|
+
return {
|
|
16741
|
+
type: "reasoning",
|
|
16742
|
+
text: event.delta.text
|
|
16743
|
+
};
|
|
16744
|
+
}
|
|
16745
|
+
return {
|
|
16746
|
+
type: "text",
|
|
16747
|
+
text: event.delta.text
|
|
16748
|
+
};
|
|
16692
16749
|
}
|
|
16693
16750
|
var init_conversation_reducer = __esm({
|
|
16694
16751
|
"../../packages/schemas/src/conversation-reducer.ts"() {
|
|
@@ -17685,6 +17742,17 @@ function templateField(guard) {
|
|
|
17685
17742
|
const field = external_exports.string().trim().min(1).max(2e4).optional();
|
|
17686
17743
|
return guard === "authoring" ? field.superRefine(refineNoPayloadPrefixedTemplateTokens) : field;
|
|
17687
17744
|
}
|
|
17745
|
+
function displayTitleField(guard) {
|
|
17746
|
+
const field = external_exports.union([
|
|
17747
|
+
external_exports.literal("infer"),
|
|
17748
|
+
external_exports.string().trim().min(1).max(2e4)
|
|
17749
|
+
]);
|
|
17750
|
+
return (guard === "authoring" ? field.superRefine((value, context) => {
|
|
17751
|
+
if (value !== "infer") {
|
|
17752
|
+
refineNoPayloadPrefixedTemplateTokens(value, context);
|
|
17753
|
+
}
|
|
17754
|
+
}) : field).optional();
|
|
17755
|
+
}
|
|
17688
17756
|
function triggerSharedFields(guard) {
|
|
17689
17757
|
return {
|
|
17690
17758
|
message: templateField(guard),
|
|
@@ -18132,6 +18200,7 @@ var init_agents = __esm({
|
|
|
18132
18200
|
environment: ResourceNameSchema.optional(),
|
|
18133
18201
|
identity: external_exports.union([ResourceNameSchema, AgentIdentitySchema]).optional(),
|
|
18134
18202
|
initialPrompt: templateField("stored"),
|
|
18203
|
+
displayTitle: displayTitleField("stored"),
|
|
18135
18204
|
env: SecretEnvSchema.default({}),
|
|
18136
18205
|
mounts: external_exports.array(AgentMountSchema).default([]),
|
|
18137
18206
|
triggers: TriggersSchema.default([]),
|
|
@@ -18144,6 +18213,7 @@ var init_agents = __esm({
|
|
|
18144
18213
|
);
|
|
18145
18214
|
AgentApplySpecSchema = AgentSpecFieldsSchema.extend({
|
|
18146
18215
|
initialPrompt: templateField("authoring"),
|
|
18216
|
+
displayTitle: displayTitleField("authoring"),
|
|
18147
18217
|
triggers: ApplyTriggersSchema.default([])
|
|
18148
18218
|
}).superRefine(validateRunnableConfig);
|
|
18149
18219
|
AgentStatusSchema = external_exports.object({
|
|
@@ -19230,6 +19300,35 @@ var init_session_turns = __esm({
|
|
|
19230
19300
|
}
|
|
19231
19301
|
});
|
|
19232
19302
|
|
|
19303
|
+
// ../../packages/schemas/src/session-bindings.ts
|
|
19304
|
+
var BINDING_TARGET_TYPES, SESSION_BINDING_SOURCES, SESSION_BINDING_STATUSES, BindingTargetTypeSchema, SessionBindingSourceSchema, SessionBindingStatusSchema, BindingTargetSchema;
|
|
19305
|
+
var init_session_bindings = __esm({
|
|
19306
|
+
"../../packages/schemas/src/session-bindings.ts"() {
|
|
19307
|
+
"use strict";
|
|
19308
|
+
init_zod();
|
|
19309
|
+
BINDING_TARGET_TYPES = [
|
|
19310
|
+
"github.pull_request",
|
|
19311
|
+
"slack.thread",
|
|
19312
|
+
"chat.message",
|
|
19313
|
+
"agent.singleton"
|
|
19314
|
+
];
|
|
19315
|
+
SESSION_BINDING_SOURCES = [
|
|
19316
|
+
"trigger_spawn",
|
|
19317
|
+
"agent_tool",
|
|
19318
|
+
"chat_send",
|
|
19319
|
+
"system"
|
|
19320
|
+
];
|
|
19321
|
+
SESSION_BINDING_STATUSES = ["active", "released"];
|
|
19322
|
+
BindingTargetTypeSchema = external_exports.enum(BINDING_TARGET_TYPES);
|
|
19323
|
+
SessionBindingSourceSchema = external_exports.enum(SESSION_BINDING_SOURCES);
|
|
19324
|
+
SessionBindingStatusSchema = external_exports.enum(SESSION_BINDING_STATUSES);
|
|
19325
|
+
BindingTargetSchema = external_exports.object({
|
|
19326
|
+
type: BindingTargetTypeSchema,
|
|
19327
|
+
externalId: external_exports.string().min(1)
|
|
19328
|
+
});
|
|
19329
|
+
}
|
|
19330
|
+
});
|
|
19331
|
+
|
|
19233
19332
|
// ../../packages/schemas/src/singleton-refresh.ts
|
|
19234
19333
|
var SINGLETON_RESPAWN_REASONS, SingletonRespawnReasonSchema, SingletonRespawnSchema, SingletonRefreshEventPayloadSchema;
|
|
19235
19334
|
var init_singleton_refresh = __esm({
|
|
@@ -20054,6 +20153,7 @@ var init_src = __esm({
|
|
|
20054
20153
|
init_session_introspection();
|
|
20055
20154
|
init_session_turns();
|
|
20056
20155
|
init_secrets();
|
|
20156
|
+
init_session_bindings();
|
|
20057
20157
|
init_session_commands();
|
|
20058
20158
|
init_setup();
|
|
20059
20159
|
init_singleton_refresh();
|
|
@@ -22795,7 +22895,7 @@ var init_package = __esm({
|
|
|
22795
22895
|
"package.json"() {
|
|
22796
22896
|
package_default = {
|
|
22797
22897
|
name: "@autohq/cli",
|
|
22798
|
-
version: "0.1.
|
|
22898
|
+
version: "0.1.265",
|
|
22799
22899
|
license: "SEE LICENSE IN README.md",
|
|
22800
22900
|
publishConfig: {
|
|
22801
22901
|
access: "public"
|
|
@@ -23411,6 +23511,7 @@ var init_authoring = __esm({
|
|
|
23411
23511
|
"environment",
|
|
23412
23512
|
"identity",
|
|
23413
23513
|
"initialPrompt",
|
|
23514
|
+
"displayTitle",
|
|
23414
23515
|
"env",
|
|
23415
23516
|
"mounts",
|
|
23416
23517
|
"triggers",
|
|
@@ -23447,7 +23548,7 @@ function createConversationStreamWriter(input) {
|
|
|
23447
23548
|
}
|
|
23448
23549
|
function formatConversationRealtimeEvent(event) {
|
|
23449
23550
|
if (event.type === "conversation.delta") {
|
|
23450
|
-
return `[${event.sequence}] assistant/message delta: ${event.delta.text}`;
|
|
23551
|
+
return `[${event.sequence}] assistant/message ${event.delta.type} delta: ${event.delta.text}`;
|
|
23451
23552
|
}
|
|
23452
23553
|
return formatConversationEntry(event);
|
|
23453
23554
|
}
|
|
@@ -23456,6 +23557,9 @@ function formatConversationEntry(entry) {
|
|
|
23456
23557
|
if (part.type === "text") {
|
|
23457
23558
|
return part.text;
|
|
23458
23559
|
}
|
|
23560
|
+
if (part.type === "reasoning") {
|
|
23561
|
+
return `Thinking: ${part.text}`;
|
|
23562
|
+
}
|
|
23459
23563
|
if (part.type === "tool_call") {
|
|
23460
23564
|
return `${part.name}(${JSON.stringify(part.input)})`;
|
|
23461
23565
|
}
|
|
@@ -24401,6 +24505,7 @@ var init_agent_fields = __esm({
|
|
|
24401
24505
|
environment: inlineEnvironmentField(),
|
|
24402
24506
|
identity: inlineIdentityField(),
|
|
24403
24507
|
initialPrompt: fileBackedStringField(),
|
|
24508
|
+
displayTitle: specField(),
|
|
24404
24509
|
env: specField(),
|
|
24405
24510
|
mounts: mountsField(),
|
|
24406
24511
|
triggers: triggersField(),
|
|
@@ -26398,7 +26503,7 @@ function questionAnswersFromResult(output) {
|
|
|
26398
26503
|
return entries.length > 0 ? Object.fromEntries(entries) : null;
|
|
26399
26504
|
}
|
|
26400
26505
|
function entryText(entry) {
|
|
26401
|
-
return entry.content.parts.filter((part) => part.type === "text").map((part) => part.text).join("");
|
|
26506
|
+
return entry.content.parts.filter((part) => part.type === "text" || part.type === "reasoning").map((part) => part.text).join("");
|
|
26402
26507
|
}
|
|
26403
26508
|
function asRecord(input) {
|
|
26404
26509
|
if (typeof input === "object" && input !== null && !Array.isArray(input)) {
|
|
@@ -27616,7 +27721,7 @@ function pendingQuestionRow(rows, answeredQuestionIds) {
|
|
|
27616
27721
|
}
|
|
27617
27722
|
function streamedCharCount(event) {
|
|
27618
27723
|
if (event.type === "conversation.delta") {
|
|
27619
|
-
return event.delta.
|
|
27724
|
+
return event.delta.text.length;
|
|
27620
27725
|
}
|
|
27621
27726
|
if (event.kind === "tool_call" && event.status !== "in_progress") {
|
|
27622
27727
|
return event.content.parts.filter((part) => part.type === "tool_call").reduce((total, part) => total + JSON.stringify(part.input).length, 0);
|
|
@@ -32423,6 +32528,10 @@ var ConversationTextContentPartSchema2 = external_exports.object({
|
|
|
32423
32528
|
type: external_exports.literal("text"),
|
|
32424
32529
|
text: external_exports.string()
|
|
32425
32530
|
});
|
|
32531
|
+
var ConversationReasoningContentPartSchema2 = external_exports.object({
|
|
32532
|
+
type: external_exports.literal("reasoning"),
|
|
32533
|
+
text: external_exports.string()
|
|
32534
|
+
});
|
|
32426
32535
|
var ConversationToolCallContentPartSchema2 = external_exports.object({
|
|
32427
32536
|
type: external_exports.literal("tool_call"),
|
|
32428
32537
|
toolCallId: external_exports.string().min(1).nullable(),
|
|
@@ -32453,6 +32562,7 @@ var ConversationQuestionContentPartSchema2 = external_exports.object({
|
|
|
32453
32562
|
});
|
|
32454
32563
|
var ConversationContentPartSchema2 = external_exports.discriminatedUnion("type", [
|
|
32455
32564
|
ConversationTextContentPartSchema2,
|
|
32565
|
+
ConversationReasoningContentPartSchema2,
|
|
32456
32566
|
ConversationToolCallContentPartSchema2,
|
|
32457
32567
|
ConversationToolResultContentPartSchema2,
|
|
32458
32568
|
ConversationQuestionContentPartSchema2
|
|
@@ -32464,6 +32574,14 @@ var ConversationTextDeltaSchema2 = external_exports.object({
|
|
|
32464
32574
|
type: external_exports.literal("text"),
|
|
32465
32575
|
text: external_exports.string()
|
|
32466
32576
|
});
|
|
32577
|
+
var ConversationReasoningDeltaSchema2 = external_exports.object({
|
|
32578
|
+
type: external_exports.literal("reasoning"),
|
|
32579
|
+
text: external_exports.string()
|
|
32580
|
+
});
|
|
32581
|
+
var ConversationDeltaSchema2 = external_exports.discriminatedUnion("type", [
|
|
32582
|
+
ConversationTextDeltaSchema2,
|
|
32583
|
+
ConversationReasoningDeltaSchema2
|
|
32584
|
+
]);
|
|
32467
32585
|
var RUNTIME_BRIDGE_NAMESPACE = "/bridge";
|
|
32468
32586
|
var RUNTIME_BRIDGE_SOCKET_PATH = "/runtime/socket.io";
|
|
32469
32587
|
var RUNTIME_BRIDGE_BOOTSTRAP_EVENT = "bridge.bootstrap";
|
|
@@ -32626,7 +32744,7 @@ var RuntimeBridgeOutputDeltaEnvelopeSchema = external_exports.object({
|
|
|
32626
32744
|
partId: external_exports.string().trim().min(1),
|
|
32627
32745
|
role: external_exports.literal("assistant"),
|
|
32628
32746
|
kind: external_exports.literal("message"),
|
|
32629
|
-
delta:
|
|
32747
|
+
delta: ConversationDeltaSchema2,
|
|
32630
32748
|
createdAt: external_exports.string().datetime()
|
|
32631
32749
|
}).strict();
|
|
32632
32750
|
var RuntimeBridgeOutputEnvelopeSchema = external_exports.union([
|
|
@@ -33310,7 +33428,7 @@ var AgentBridgeOutputBuffer = class {
|
|
|
33310
33428
|
}
|
|
33311
33429
|
};
|
|
33312
33430
|
function canCoalesceDelta(pending, context, delta) {
|
|
33313
|
-
return pending.context.sessionId === context.sessionId && pending.context.runtimeId === context.runtimeId && pending.context.bridgeLeaseId === context.bridgeLeaseId && pending.delta.messageId === delta.messageId && pending.delta.partId === delta.partId && pending.delta.role === delta.role && pending.delta.kind === delta.kind && pending.delta.delta.type ===
|
|
33431
|
+
return pending.context.sessionId === context.sessionId && pending.context.runtimeId === context.runtimeId && pending.context.bridgeLeaseId === context.bridgeLeaseId && pending.delta.messageId === delta.messageId && pending.delta.partId === delta.partId && pending.delta.role === delta.role && pending.delta.kind === delta.kind && pending.delta.delta.type === delta.delta.type;
|
|
33314
33432
|
}
|
|
33315
33433
|
function coalesceDelta(pending, delta) {
|
|
33316
33434
|
return {
|
|
@@ -33318,7 +33436,7 @@ function coalesceDelta(pending, delta) {
|
|
|
33318
33436
|
delta: {
|
|
33319
33437
|
...pending.delta,
|
|
33320
33438
|
delta: {
|
|
33321
|
-
type:
|
|
33439
|
+
type: pending.delta.delta.type,
|
|
33322
33440
|
text: pending.delta.delta.text + delta.delta.text
|
|
33323
33441
|
}
|
|
33324
33442
|
}
|
|
@@ -33389,7 +33507,7 @@ var ClaudeCodeProjector = class {
|
|
|
33389
33507
|
this.currentMessageId = null;
|
|
33390
33508
|
return [];
|
|
33391
33509
|
}
|
|
33392
|
-
const delta =
|
|
33510
|
+
const delta = partialAssistantDeltaPayload(
|
|
33393
33511
|
message,
|
|
33394
33512
|
this.currentMessageId ?? UNKNOWN_MESSAGE_ID
|
|
33395
33513
|
);
|
|
@@ -33455,27 +33573,25 @@ function anthropicMessageIdFromStreamStart(message) {
|
|
|
33455
33573
|
const id = event.message.id;
|
|
33456
33574
|
return typeof id === "string" && id.trim() ? id : null;
|
|
33457
33575
|
}
|
|
33458
|
-
function
|
|
33576
|
+
function partialAssistantDeltaPayload(message, messageId) {
|
|
33459
33577
|
const event = message.event;
|
|
33460
33578
|
if (event.type !== "content_block_delta") {
|
|
33461
33579
|
return null;
|
|
33462
33580
|
}
|
|
33463
33581
|
const delta = event.delta;
|
|
33464
|
-
|
|
33465
|
-
return null;
|
|
33466
|
-
}
|
|
33467
|
-
const text = delta.text;
|
|
33582
|
+
const text = delta.type === "text_delta" ? delta.text : delta.type === "thinking_delta" ? delta.thinking : "";
|
|
33468
33583
|
if (text.length === 0) {
|
|
33469
33584
|
return null;
|
|
33470
33585
|
}
|
|
33471
33586
|
const index = event.index;
|
|
33587
|
+
const type = delta.type === "thinking_delta" ? "reasoning" : "text";
|
|
33472
33588
|
return {
|
|
33473
33589
|
messageId,
|
|
33474
33590
|
partId: typeof index === "number" ? String(index) : "0",
|
|
33475
33591
|
role: "assistant",
|
|
33476
33592
|
kind: "message",
|
|
33477
33593
|
delta: {
|
|
33478
|
-
type
|
|
33594
|
+
type,
|
|
33479
33595
|
text
|
|
33480
33596
|
}
|
|
33481
33597
|
};
|
|
@@ -39742,6 +39858,8 @@ function entryPreview(event, full) {
|
|
|
39742
39858
|
switch (part.type) {
|
|
39743
39859
|
case "text":
|
|
39744
39860
|
return part.text;
|
|
39861
|
+
case "reasoning":
|
|
39862
|
+
return part.text;
|
|
39745
39863
|
case "tool_call":
|
|
39746
39864
|
return `${part.name} ${stringify5(part.input)}`;
|
|
39747
39865
|
case "tool_result":
|