@autohq/cli 0.1.264 → 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.
@@ -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: ConversationTextDeltaSchema,
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.264",
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: ConversationTextDeltaSchema2,
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
- projections.push({
24700
- role: "assistant",
24701
- kind: "message",
24702
- ...messageId ? { messageId } : {},
24703
- content: textContent(block.text)
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
  }
@@ -27440,6 +27501,28 @@ var SessionTurnRecordSchema = external_exports.object({
27440
27501
  updatedAt: external_exports.string().datetime()
27441
27502
  });
27442
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
+
27443
27526
  // ../../packages/schemas/src/singleton-refresh.ts
27444
27527
  var SINGLETON_RESPAWN_REASONS = ["refresh"];
27445
27528
  var SingletonRespawnReasonSchema = external_exports.enum(SINGLETON_RESPAWN_REASONS);
@@ -28282,7 +28365,7 @@ var AgentBridgeOutputBuffer = class {
28282
28365
  }
28283
28366
  };
28284
28367
  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 === "text" && delta.delta.type === "text";
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;
28286
28369
  }
28287
28370
  function coalesceDelta(pending, delta) {
28288
28371
  return {
@@ -28290,7 +28373,7 @@ function coalesceDelta(pending, delta) {
28290
28373
  delta: {
28291
28374
  ...pending.delta,
28292
28375
  delta: {
28293
- type: "text",
28376
+ type: pending.delta.delta.type,
28294
28377
  text: pending.delta.delta.text + delta.delta.text
28295
28378
  }
28296
28379
  }
@@ -28360,7 +28443,7 @@ var ClaudeCodeProjector = class {
28360
28443
  this.currentMessageId = null;
28361
28444
  return [];
28362
28445
  }
28363
- const delta = partialTextDeltaPayload(
28446
+ const delta = partialAssistantDeltaPayload(
28364
28447
  message,
28365
28448
  this.currentMessageId ?? UNKNOWN_MESSAGE_ID
28366
28449
  );
@@ -28426,27 +28509,25 @@ function anthropicMessageIdFromStreamStart(message) {
28426
28509
  const id = event.message.id;
28427
28510
  return typeof id === "string" && id.trim() ? id : null;
28428
28511
  }
28429
- function partialTextDeltaPayload(message, messageId) {
28512
+ function partialAssistantDeltaPayload(message, messageId) {
28430
28513
  const event = message.event;
28431
28514
  if (event.type !== "content_block_delta") {
28432
28515
  return null;
28433
28516
  }
28434
28517
  const delta = event.delta;
28435
- if (delta.type !== "text_delta") {
28436
- return null;
28437
- }
28438
- const text = delta.text;
28518
+ const text = delta.type === "text_delta" ? delta.text : delta.type === "thinking_delta" ? delta.thinking : "";
28439
28519
  if (text.length === 0) {
28440
28520
  return null;
28441
28521
  }
28442
28522
  const index = event.index;
28523
+ const type = delta.type === "thinking_delta" ? "reasoning" : "text";
28443
28524
  return {
28444
28525
  messageId,
28445
28526
  partId: typeof index === "number" ? String(index) : "0",
28446
28527
  role: "assistant",
28447
28528
  kind: "message",
28448
28529
  delta: {
28449
- type: "text",
28530
+ type,
28450
28531
  text
28451
28532
  }
28452
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: ConversationTextDeltaSchema,
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
- projections.push({
16032
- role: "assistant",
16033
- kind: "message",
16034
- ...messageId ? { messageId } : {},
16035
- content: textContent(block.text)
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 textPartIndex = parts.findIndex((part) => part.type === "text");
16673
- if (textPartIndex === -1) {
16674
- parts.push({ type: "text", text });
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[textPartIndex];
16677
- if (part?.type === "text") {
16678
- parts[textPartIndex] = {
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.type === "text" ? event.delta.text : "";
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"() {
@@ -19243,6 +19300,35 @@ var init_session_turns = __esm({
19243
19300
  }
19244
19301
  });
19245
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
+
19246
19332
  // ../../packages/schemas/src/singleton-refresh.ts
19247
19333
  var SINGLETON_RESPAWN_REASONS, SingletonRespawnReasonSchema, SingletonRespawnSchema, SingletonRefreshEventPayloadSchema;
19248
19334
  var init_singleton_refresh = __esm({
@@ -20067,6 +20153,7 @@ var init_src = __esm({
20067
20153
  init_session_introspection();
20068
20154
  init_session_turns();
20069
20155
  init_secrets();
20156
+ init_session_bindings();
20070
20157
  init_session_commands();
20071
20158
  init_setup();
20072
20159
  init_singleton_refresh();
@@ -22808,7 +22895,7 @@ var init_package = __esm({
22808
22895
  "package.json"() {
22809
22896
  package_default = {
22810
22897
  name: "@autohq/cli",
22811
- version: "0.1.264",
22898
+ version: "0.1.265",
22812
22899
  license: "SEE LICENSE IN README.md",
22813
22900
  publishConfig: {
22814
22901
  access: "public"
@@ -23461,7 +23548,7 @@ function createConversationStreamWriter(input) {
23461
23548
  }
23462
23549
  function formatConversationRealtimeEvent(event) {
23463
23550
  if (event.type === "conversation.delta") {
23464
- return `[${event.sequence}] assistant/message delta: ${event.delta.text}`;
23551
+ return `[${event.sequence}] assistant/message ${event.delta.type} delta: ${event.delta.text}`;
23465
23552
  }
23466
23553
  return formatConversationEntry(event);
23467
23554
  }
@@ -23470,6 +23557,9 @@ function formatConversationEntry(entry) {
23470
23557
  if (part.type === "text") {
23471
23558
  return part.text;
23472
23559
  }
23560
+ if (part.type === "reasoning") {
23561
+ return `Thinking: ${part.text}`;
23562
+ }
23473
23563
  if (part.type === "tool_call") {
23474
23564
  return `${part.name}(${JSON.stringify(part.input)})`;
23475
23565
  }
@@ -26413,7 +26503,7 @@ function questionAnswersFromResult(output) {
26413
26503
  return entries.length > 0 ? Object.fromEntries(entries) : null;
26414
26504
  }
26415
26505
  function entryText(entry) {
26416
- 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("");
26417
26507
  }
26418
26508
  function asRecord(input) {
26419
26509
  if (typeof input === "object" && input !== null && !Array.isArray(input)) {
@@ -27631,7 +27721,7 @@ function pendingQuestionRow(rows, answeredQuestionIds) {
27631
27721
  }
27632
27722
  function streamedCharCount(event) {
27633
27723
  if (event.type === "conversation.delta") {
27634
- return event.delta.type === "text" ? event.delta.text.length : 0;
27724
+ return event.delta.text.length;
27635
27725
  }
27636
27726
  if (event.kind === "tool_call" && event.status !== "in_progress") {
27637
27727
  return event.content.parts.filter((part) => part.type === "tool_call").reduce((total, part) => total + JSON.stringify(part.input).length, 0);
@@ -32438,6 +32528,10 @@ var ConversationTextContentPartSchema2 = external_exports.object({
32438
32528
  type: external_exports.literal("text"),
32439
32529
  text: external_exports.string()
32440
32530
  });
32531
+ var ConversationReasoningContentPartSchema2 = external_exports.object({
32532
+ type: external_exports.literal("reasoning"),
32533
+ text: external_exports.string()
32534
+ });
32441
32535
  var ConversationToolCallContentPartSchema2 = external_exports.object({
32442
32536
  type: external_exports.literal("tool_call"),
32443
32537
  toolCallId: external_exports.string().min(1).nullable(),
@@ -32468,6 +32562,7 @@ var ConversationQuestionContentPartSchema2 = external_exports.object({
32468
32562
  });
32469
32563
  var ConversationContentPartSchema2 = external_exports.discriminatedUnion("type", [
32470
32564
  ConversationTextContentPartSchema2,
32565
+ ConversationReasoningContentPartSchema2,
32471
32566
  ConversationToolCallContentPartSchema2,
32472
32567
  ConversationToolResultContentPartSchema2,
32473
32568
  ConversationQuestionContentPartSchema2
@@ -32479,6 +32574,14 @@ var ConversationTextDeltaSchema2 = external_exports.object({
32479
32574
  type: external_exports.literal("text"),
32480
32575
  text: external_exports.string()
32481
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
+ ]);
32482
32585
  var RUNTIME_BRIDGE_NAMESPACE = "/bridge";
32483
32586
  var RUNTIME_BRIDGE_SOCKET_PATH = "/runtime/socket.io";
32484
32587
  var RUNTIME_BRIDGE_BOOTSTRAP_EVENT = "bridge.bootstrap";
@@ -32641,7 +32744,7 @@ var RuntimeBridgeOutputDeltaEnvelopeSchema = external_exports.object({
32641
32744
  partId: external_exports.string().trim().min(1),
32642
32745
  role: external_exports.literal("assistant"),
32643
32746
  kind: external_exports.literal("message"),
32644
- delta: ConversationTextDeltaSchema2,
32747
+ delta: ConversationDeltaSchema2,
32645
32748
  createdAt: external_exports.string().datetime()
32646
32749
  }).strict();
32647
32750
  var RuntimeBridgeOutputEnvelopeSchema = external_exports.union([
@@ -33325,7 +33428,7 @@ var AgentBridgeOutputBuffer = class {
33325
33428
  }
33326
33429
  };
33327
33430
  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 === "text" && delta.delta.type === "text";
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;
33329
33432
  }
33330
33433
  function coalesceDelta(pending, delta) {
33331
33434
  return {
@@ -33333,7 +33436,7 @@ function coalesceDelta(pending, delta) {
33333
33436
  delta: {
33334
33437
  ...pending.delta,
33335
33438
  delta: {
33336
- type: "text",
33439
+ type: pending.delta.delta.type,
33337
33440
  text: pending.delta.delta.text + delta.delta.text
33338
33441
  }
33339
33442
  }
@@ -33404,7 +33507,7 @@ var ClaudeCodeProjector = class {
33404
33507
  this.currentMessageId = null;
33405
33508
  return [];
33406
33509
  }
33407
- const delta = partialTextDeltaPayload(
33510
+ const delta = partialAssistantDeltaPayload(
33408
33511
  message,
33409
33512
  this.currentMessageId ?? UNKNOWN_MESSAGE_ID
33410
33513
  );
@@ -33470,27 +33573,25 @@ function anthropicMessageIdFromStreamStart(message) {
33470
33573
  const id = event.message.id;
33471
33574
  return typeof id === "string" && id.trim() ? id : null;
33472
33575
  }
33473
- function partialTextDeltaPayload(message, messageId) {
33576
+ function partialAssistantDeltaPayload(message, messageId) {
33474
33577
  const event = message.event;
33475
33578
  if (event.type !== "content_block_delta") {
33476
33579
  return null;
33477
33580
  }
33478
33581
  const delta = event.delta;
33479
- if (delta.type !== "text_delta") {
33480
- return null;
33481
- }
33482
- const text = delta.text;
33582
+ const text = delta.type === "text_delta" ? delta.text : delta.type === "thinking_delta" ? delta.thinking : "";
33483
33583
  if (text.length === 0) {
33484
33584
  return null;
33485
33585
  }
33486
33586
  const index = event.index;
33587
+ const type = delta.type === "thinking_delta" ? "reasoning" : "text";
33487
33588
  return {
33488
33589
  messageId,
33489
33590
  partId: typeof index === "number" ? String(index) : "0",
33490
33591
  role: "assistant",
33491
33592
  kind: "message",
33492
33593
  delta: {
33493
- type: "text",
33594
+ type,
33494
33595
  text
33495
33596
  }
33496
33597
  };
@@ -39757,6 +39858,8 @@ function entryPreview(event, full) {
39757
39858
  switch (part.type) {
39758
39859
  case "text":
39759
39860
  return part.text;
39861
+ case "reasoning":
39862
+ return part.text;
39760
39863
  case "tool_call":
39761
39864
  return `${part.name} ${stringify5(part.input)}`;
39762
39865
  case "tool_result":
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@autohq/cli",
3
- "version": "0.1.264",
3
+ "version": "0.1.265",
4
4
  "license": "SEE LICENSE IN README.md",
5
5
  "publishConfig": {
6
6
  "access": "public"