@autohq/cli 0.1.264 → 0.1.266
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 +102 -20
- package/dist/index.js +142 -38
- 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.266",
|
|
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
|
}
|
|
@@ -26359,8 +26420,9 @@ var AgentApplySpecSchema = AgentSpecFieldsSchema.extend({
|
|
|
26359
26420
|
triggers: ApplyTriggersSchema.default([])
|
|
26360
26421
|
}).superRefine(validateRunnableConfig);
|
|
26361
26422
|
var AgentStatusSchema = external_exports.object({
|
|
26362
|
-
runCount: external_exports.number().int().nonnegative().default(0)
|
|
26363
|
-
|
|
26423
|
+
runCount: external_exports.number().int().nonnegative().default(0),
|
|
26424
|
+
lastActivityAt: external_exports.string().datetime().nullable().default(null)
|
|
26425
|
+
}).default({ runCount: 0, lastActivityAt: null });
|
|
26364
26426
|
var AgentResourceSchema = resourceEnvelopeSchema(
|
|
26365
26427
|
AgentSpecSchema
|
|
26366
26428
|
).extend({
|
|
@@ -27440,6 +27502,28 @@ var SessionTurnRecordSchema = external_exports.object({
|
|
|
27440
27502
|
updatedAt: external_exports.string().datetime()
|
|
27441
27503
|
});
|
|
27442
27504
|
|
|
27505
|
+
// ../../packages/schemas/src/session-bindings.ts
|
|
27506
|
+
var BINDING_TARGET_TYPES = [
|
|
27507
|
+
"github.pull_request",
|
|
27508
|
+
"slack.thread",
|
|
27509
|
+
"chat.message",
|
|
27510
|
+
"agent.singleton"
|
|
27511
|
+
];
|
|
27512
|
+
var SESSION_BINDING_SOURCES = [
|
|
27513
|
+
"trigger_spawn",
|
|
27514
|
+
"agent_tool",
|
|
27515
|
+
"chat_send",
|
|
27516
|
+
"system"
|
|
27517
|
+
];
|
|
27518
|
+
var SESSION_BINDING_STATUSES = ["active", "released"];
|
|
27519
|
+
var BindingTargetTypeSchema = external_exports.enum(BINDING_TARGET_TYPES);
|
|
27520
|
+
var SessionBindingSourceSchema = external_exports.enum(SESSION_BINDING_SOURCES);
|
|
27521
|
+
var SessionBindingStatusSchema = external_exports.enum(SESSION_BINDING_STATUSES);
|
|
27522
|
+
var BindingTargetSchema = external_exports.object({
|
|
27523
|
+
type: BindingTargetTypeSchema,
|
|
27524
|
+
externalId: external_exports.string().min(1)
|
|
27525
|
+
});
|
|
27526
|
+
|
|
27443
27527
|
// ../../packages/schemas/src/singleton-refresh.ts
|
|
27444
27528
|
var SINGLETON_RESPAWN_REASONS = ["refresh"];
|
|
27445
27529
|
var SingletonRespawnReasonSchema = external_exports.enum(SINGLETON_RESPAWN_REASONS);
|
|
@@ -28282,7 +28366,7 @@ var AgentBridgeOutputBuffer = class {
|
|
|
28282
28366
|
}
|
|
28283
28367
|
};
|
|
28284
28368
|
function canCoalesceDelta(pending, context, delta) {
|
|
28285
|
-
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 ===
|
|
28369
|
+
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;
|
|
28286
28370
|
}
|
|
28287
28371
|
function coalesceDelta(pending, delta) {
|
|
28288
28372
|
return {
|
|
@@ -28290,7 +28374,7 @@ function coalesceDelta(pending, delta) {
|
|
|
28290
28374
|
delta: {
|
|
28291
28375
|
...pending.delta,
|
|
28292
28376
|
delta: {
|
|
28293
|
-
type:
|
|
28377
|
+
type: pending.delta.delta.type,
|
|
28294
28378
|
text: pending.delta.delta.text + delta.delta.text
|
|
28295
28379
|
}
|
|
28296
28380
|
}
|
|
@@ -28360,7 +28444,7 @@ var ClaudeCodeProjector = class {
|
|
|
28360
28444
|
this.currentMessageId = null;
|
|
28361
28445
|
return [];
|
|
28362
28446
|
}
|
|
28363
|
-
const delta =
|
|
28447
|
+
const delta = partialAssistantDeltaPayload(
|
|
28364
28448
|
message,
|
|
28365
28449
|
this.currentMessageId ?? UNKNOWN_MESSAGE_ID
|
|
28366
28450
|
);
|
|
@@ -28426,27 +28510,25 @@ function anthropicMessageIdFromStreamStart(message) {
|
|
|
28426
28510
|
const id = event.message.id;
|
|
28427
28511
|
return typeof id === "string" && id.trim() ? id : null;
|
|
28428
28512
|
}
|
|
28429
|
-
function
|
|
28513
|
+
function partialAssistantDeltaPayload(message, messageId) {
|
|
28430
28514
|
const event = message.event;
|
|
28431
28515
|
if (event.type !== "content_block_delta") {
|
|
28432
28516
|
return null;
|
|
28433
28517
|
}
|
|
28434
28518
|
const delta = event.delta;
|
|
28435
|
-
|
|
28436
|
-
return null;
|
|
28437
|
-
}
|
|
28438
|
-
const text = delta.text;
|
|
28519
|
+
const text = delta.type === "text_delta" ? delta.text : delta.type === "thinking_delta" ? delta.thinking : "";
|
|
28439
28520
|
if (text.length === 0) {
|
|
28440
28521
|
return null;
|
|
28441
28522
|
}
|
|
28442
28523
|
const index = event.index;
|
|
28524
|
+
const type = delta.type === "thinking_delta" ? "reasoning" : "text";
|
|
28443
28525
|
return {
|
|
28444
28526
|
messageId,
|
|
28445
28527
|
partId: typeof index === "number" ? String(index) : "0",
|
|
28446
28528
|
role: "assistant",
|
|
28447
28529
|
kind: "message",
|
|
28448
28530
|
delta: {
|
|
28449
|
-
type
|
|
28531
|
+
type,
|
|
28450
28532
|
text
|
|
28451
28533
|
}
|
|
28452
28534
|
};
|
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"() {
|
|
@@ -18160,8 +18217,9 @@ var init_agents = __esm({
|
|
|
18160
18217
|
triggers: ApplyTriggersSchema.default([])
|
|
18161
18218
|
}).superRefine(validateRunnableConfig);
|
|
18162
18219
|
AgentStatusSchema = external_exports.object({
|
|
18163
|
-
runCount: external_exports.number().int().nonnegative().default(0)
|
|
18164
|
-
|
|
18220
|
+
runCount: external_exports.number().int().nonnegative().default(0),
|
|
18221
|
+
lastActivityAt: external_exports.string().datetime().nullable().default(null)
|
|
18222
|
+
}).default({ runCount: 0, lastActivityAt: null });
|
|
18165
18223
|
AgentResourceSchema = resourceEnvelopeSchema(
|
|
18166
18224
|
AgentSpecSchema
|
|
18167
18225
|
).extend({
|
|
@@ -19243,6 +19301,35 @@ var init_session_turns = __esm({
|
|
|
19243
19301
|
}
|
|
19244
19302
|
});
|
|
19245
19303
|
|
|
19304
|
+
// ../../packages/schemas/src/session-bindings.ts
|
|
19305
|
+
var BINDING_TARGET_TYPES, SESSION_BINDING_SOURCES, SESSION_BINDING_STATUSES, BindingTargetTypeSchema, SessionBindingSourceSchema, SessionBindingStatusSchema, BindingTargetSchema;
|
|
19306
|
+
var init_session_bindings = __esm({
|
|
19307
|
+
"../../packages/schemas/src/session-bindings.ts"() {
|
|
19308
|
+
"use strict";
|
|
19309
|
+
init_zod();
|
|
19310
|
+
BINDING_TARGET_TYPES = [
|
|
19311
|
+
"github.pull_request",
|
|
19312
|
+
"slack.thread",
|
|
19313
|
+
"chat.message",
|
|
19314
|
+
"agent.singleton"
|
|
19315
|
+
];
|
|
19316
|
+
SESSION_BINDING_SOURCES = [
|
|
19317
|
+
"trigger_spawn",
|
|
19318
|
+
"agent_tool",
|
|
19319
|
+
"chat_send",
|
|
19320
|
+
"system"
|
|
19321
|
+
];
|
|
19322
|
+
SESSION_BINDING_STATUSES = ["active", "released"];
|
|
19323
|
+
BindingTargetTypeSchema = external_exports.enum(BINDING_TARGET_TYPES);
|
|
19324
|
+
SessionBindingSourceSchema = external_exports.enum(SESSION_BINDING_SOURCES);
|
|
19325
|
+
SessionBindingStatusSchema = external_exports.enum(SESSION_BINDING_STATUSES);
|
|
19326
|
+
BindingTargetSchema = external_exports.object({
|
|
19327
|
+
type: BindingTargetTypeSchema,
|
|
19328
|
+
externalId: external_exports.string().min(1)
|
|
19329
|
+
});
|
|
19330
|
+
}
|
|
19331
|
+
});
|
|
19332
|
+
|
|
19246
19333
|
// ../../packages/schemas/src/singleton-refresh.ts
|
|
19247
19334
|
var SINGLETON_RESPAWN_REASONS, SingletonRespawnReasonSchema, SingletonRespawnSchema, SingletonRefreshEventPayloadSchema;
|
|
19248
19335
|
var init_singleton_refresh = __esm({
|
|
@@ -20067,6 +20154,7 @@ var init_src = __esm({
|
|
|
20067
20154
|
init_session_introspection();
|
|
20068
20155
|
init_session_turns();
|
|
20069
20156
|
init_secrets();
|
|
20157
|
+
init_session_bindings();
|
|
20070
20158
|
init_session_commands();
|
|
20071
20159
|
init_setup();
|
|
20072
20160
|
init_singleton_refresh();
|
|
@@ -22808,7 +22896,7 @@ var init_package = __esm({
|
|
|
22808
22896
|
"package.json"() {
|
|
22809
22897
|
package_default = {
|
|
22810
22898
|
name: "@autohq/cli",
|
|
22811
|
-
version: "0.1.
|
|
22899
|
+
version: "0.1.266",
|
|
22812
22900
|
license: "SEE LICENSE IN README.md",
|
|
22813
22901
|
publishConfig: {
|
|
22814
22902
|
access: "public"
|
|
@@ -23461,7 +23549,7 @@ function createConversationStreamWriter(input) {
|
|
|
23461
23549
|
}
|
|
23462
23550
|
function formatConversationRealtimeEvent(event) {
|
|
23463
23551
|
if (event.type === "conversation.delta") {
|
|
23464
|
-
return `[${event.sequence}] assistant/message delta: ${event.delta.text}`;
|
|
23552
|
+
return `[${event.sequence}] assistant/message ${event.delta.type} delta: ${event.delta.text}`;
|
|
23465
23553
|
}
|
|
23466
23554
|
return formatConversationEntry(event);
|
|
23467
23555
|
}
|
|
@@ -23470,6 +23558,9 @@ function formatConversationEntry(entry) {
|
|
|
23470
23558
|
if (part.type === "text") {
|
|
23471
23559
|
return part.text;
|
|
23472
23560
|
}
|
|
23561
|
+
if (part.type === "reasoning") {
|
|
23562
|
+
return `Thinking: ${part.text}`;
|
|
23563
|
+
}
|
|
23473
23564
|
if (part.type === "tool_call") {
|
|
23474
23565
|
return `${part.name}(${JSON.stringify(part.input)})`;
|
|
23475
23566
|
}
|
|
@@ -26413,7 +26504,7 @@ function questionAnswersFromResult(output) {
|
|
|
26413
26504
|
return entries.length > 0 ? Object.fromEntries(entries) : null;
|
|
26414
26505
|
}
|
|
26415
26506
|
function entryText(entry) {
|
|
26416
|
-
return entry.content.parts.filter((part) => part.type === "text").map((part) => part.text).join("");
|
|
26507
|
+
return entry.content.parts.filter((part) => part.type === "text" || part.type === "reasoning").map((part) => part.text).join("");
|
|
26417
26508
|
}
|
|
26418
26509
|
function asRecord(input) {
|
|
26419
26510
|
if (typeof input === "object" && input !== null && !Array.isArray(input)) {
|
|
@@ -27631,7 +27722,7 @@ function pendingQuestionRow(rows, answeredQuestionIds) {
|
|
|
27631
27722
|
}
|
|
27632
27723
|
function streamedCharCount(event) {
|
|
27633
27724
|
if (event.type === "conversation.delta") {
|
|
27634
|
-
return event.delta.
|
|
27725
|
+
return event.delta.text.length;
|
|
27635
27726
|
}
|
|
27636
27727
|
if (event.kind === "tool_call" && event.status !== "in_progress") {
|
|
27637
27728
|
return event.content.parts.filter((part) => part.type === "tool_call").reduce((total, part) => total + JSON.stringify(part.input).length, 0);
|
|
@@ -32438,6 +32529,10 @@ var ConversationTextContentPartSchema2 = external_exports.object({
|
|
|
32438
32529
|
type: external_exports.literal("text"),
|
|
32439
32530
|
text: external_exports.string()
|
|
32440
32531
|
});
|
|
32532
|
+
var ConversationReasoningContentPartSchema2 = external_exports.object({
|
|
32533
|
+
type: external_exports.literal("reasoning"),
|
|
32534
|
+
text: external_exports.string()
|
|
32535
|
+
});
|
|
32441
32536
|
var ConversationToolCallContentPartSchema2 = external_exports.object({
|
|
32442
32537
|
type: external_exports.literal("tool_call"),
|
|
32443
32538
|
toolCallId: external_exports.string().min(1).nullable(),
|
|
@@ -32468,6 +32563,7 @@ var ConversationQuestionContentPartSchema2 = external_exports.object({
|
|
|
32468
32563
|
});
|
|
32469
32564
|
var ConversationContentPartSchema2 = external_exports.discriminatedUnion("type", [
|
|
32470
32565
|
ConversationTextContentPartSchema2,
|
|
32566
|
+
ConversationReasoningContentPartSchema2,
|
|
32471
32567
|
ConversationToolCallContentPartSchema2,
|
|
32472
32568
|
ConversationToolResultContentPartSchema2,
|
|
32473
32569
|
ConversationQuestionContentPartSchema2
|
|
@@ -32479,6 +32575,14 @@ var ConversationTextDeltaSchema2 = external_exports.object({
|
|
|
32479
32575
|
type: external_exports.literal("text"),
|
|
32480
32576
|
text: external_exports.string()
|
|
32481
32577
|
});
|
|
32578
|
+
var ConversationReasoningDeltaSchema2 = external_exports.object({
|
|
32579
|
+
type: external_exports.literal("reasoning"),
|
|
32580
|
+
text: external_exports.string()
|
|
32581
|
+
});
|
|
32582
|
+
var ConversationDeltaSchema2 = external_exports.discriminatedUnion("type", [
|
|
32583
|
+
ConversationTextDeltaSchema2,
|
|
32584
|
+
ConversationReasoningDeltaSchema2
|
|
32585
|
+
]);
|
|
32482
32586
|
var RUNTIME_BRIDGE_NAMESPACE = "/bridge";
|
|
32483
32587
|
var RUNTIME_BRIDGE_SOCKET_PATH = "/runtime/socket.io";
|
|
32484
32588
|
var RUNTIME_BRIDGE_BOOTSTRAP_EVENT = "bridge.bootstrap";
|
|
@@ -32641,7 +32745,7 @@ var RuntimeBridgeOutputDeltaEnvelopeSchema = external_exports.object({
|
|
|
32641
32745
|
partId: external_exports.string().trim().min(1),
|
|
32642
32746
|
role: external_exports.literal("assistant"),
|
|
32643
32747
|
kind: external_exports.literal("message"),
|
|
32644
|
-
delta:
|
|
32748
|
+
delta: ConversationDeltaSchema2,
|
|
32645
32749
|
createdAt: external_exports.string().datetime()
|
|
32646
32750
|
}).strict();
|
|
32647
32751
|
var RuntimeBridgeOutputEnvelopeSchema = external_exports.union([
|
|
@@ -33325,7 +33429,7 @@ var AgentBridgeOutputBuffer = class {
|
|
|
33325
33429
|
}
|
|
33326
33430
|
};
|
|
33327
33431
|
function canCoalesceDelta(pending, context, delta) {
|
|
33328
|
-
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 ===
|
|
33432
|
+
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;
|
|
33329
33433
|
}
|
|
33330
33434
|
function coalesceDelta(pending, delta) {
|
|
33331
33435
|
return {
|
|
@@ -33333,7 +33437,7 @@ function coalesceDelta(pending, delta) {
|
|
|
33333
33437
|
delta: {
|
|
33334
33438
|
...pending.delta,
|
|
33335
33439
|
delta: {
|
|
33336
|
-
type:
|
|
33440
|
+
type: pending.delta.delta.type,
|
|
33337
33441
|
text: pending.delta.delta.text + delta.delta.text
|
|
33338
33442
|
}
|
|
33339
33443
|
}
|
|
@@ -33404,7 +33508,7 @@ var ClaudeCodeProjector = class {
|
|
|
33404
33508
|
this.currentMessageId = null;
|
|
33405
33509
|
return [];
|
|
33406
33510
|
}
|
|
33407
|
-
const delta =
|
|
33511
|
+
const delta = partialAssistantDeltaPayload(
|
|
33408
33512
|
message,
|
|
33409
33513
|
this.currentMessageId ?? UNKNOWN_MESSAGE_ID
|
|
33410
33514
|
);
|
|
@@ -33470,27 +33574,25 @@ function anthropicMessageIdFromStreamStart(message) {
|
|
|
33470
33574
|
const id = event.message.id;
|
|
33471
33575
|
return typeof id === "string" && id.trim() ? id : null;
|
|
33472
33576
|
}
|
|
33473
|
-
function
|
|
33577
|
+
function partialAssistantDeltaPayload(message, messageId) {
|
|
33474
33578
|
const event = message.event;
|
|
33475
33579
|
if (event.type !== "content_block_delta") {
|
|
33476
33580
|
return null;
|
|
33477
33581
|
}
|
|
33478
33582
|
const delta = event.delta;
|
|
33479
|
-
|
|
33480
|
-
return null;
|
|
33481
|
-
}
|
|
33482
|
-
const text = delta.text;
|
|
33583
|
+
const text = delta.type === "text_delta" ? delta.text : delta.type === "thinking_delta" ? delta.thinking : "";
|
|
33483
33584
|
if (text.length === 0) {
|
|
33484
33585
|
return null;
|
|
33485
33586
|
}
|
|
33486
33587
|
const index = event.index;
|
|
33588
|
+
const type = delta.type === "thinking_delta" ? "reasoning" : "text";
|
|
33487
33589
|
return {
|
|
33488
33590
|
messageId,
|
|
33489
33591
|
partId: typeof index === "number" ? String(index) : "0",
|
|
33490
33592
|
role: "assistant",
|
|
33491
33593
|
kind: "message",
|
|
33492
33594
|
delta: {
|
|
33493
|
-
type
|
|
33595
|
+
type,
|
|
33494
33596
|
text
|
|
33495
33597
|
}
|
|
33496
33598
|
};
|
|
@@ -39757,6 +39859,8 @@ function entryPreview(event, full) {
|
|
|
39757
39859
|
switch (part.type) {
|
|
39758
39860
|
case "text":
|
|
39759
39861
|
return part.text;
|
|
39862
|
+
case "reasoning":
|
|
39863
|
+
return part.text;
|
|
39760
39864
|
case "tool_call":
|
|
39761
39865
|
return `${part.name} ${stringify5(part.input)}`;
|
|
39762
39866
|
case "tool_result":
|