@autohq/cli 0.1.208 → 0.1.209

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.
@@ -19469,6 +19469,11 @@ var ConversationEntryStatusSchema = external_exports.enum([
19469
19469
  "completed",
19470
19470
  "failed"
19471
19471
  ]);
19472
+ var RuntimeTurnStatusSchema = external_exports.enum([
19473
+ "waiting_for_input",
19474
+ "completed",
19475
+ "failed"
19476
+ ]);
19472
19477
  var ConversationTextContentPartSchema = external_exports.object({
19473
19478
  type: external_exports.literal("text"),
19474
19479
  text: external_exports.string()
@@ -19622,7 +19627,7 @@ var RuntimeBridgeCommandDeliveryAcceptedSchema = external_exports.object({
19622
19627
  result: external_exports.enum(["injected", "duplicate"]),
19623
19628
  at: external_exports.string().datetime()
19624
19629
  }).strict();
19625
- var RuntimeBridgeOutputEntryEnvelopeSchema = external_exports.object({
19630
+ var RuntimeBridgeOutputEntryEnvelopeWireSchema = external_exports.object({
19626
19631
  type: external_exports.literal("conversation.entry"),
19627
19632
  sessionId: SessionIdSchema,
19628
19633
  runtimeId: RuntimeIdSchema,
@@ -19635,8 +19640,18 @@ var RuntimeBridgeOutputEntryEnvelopeSchema = external_exports.object({
19635
19640
  content: ConversationEntryContentSchema,
19636
19641
  createdAt: external_exports.string().datetime(),
19637
19642
  completedAt: external_exports.string().datetime().nullable(),
19638
- sessionStatusAfter: external_exports.enum(["awaiting", "failed"]).optional()
19643
+ turnStatus: RuntimeTurnStatusSchema.optional()
19639
19644
  }).strict();
19645
+ var LegacyRuntimeBridgeOutputEntryEnvelopeSchema = RuntimeBridgeOutputEntryEnvelopeWireSchema.omit({ turnStatus: true }).extend({
19646
+ sessionStatusAfter: external_exports.enum(["awaiting", "failed"])
19647
+ }).strict().transform(({ sessionStatusAfter, ...entry }) => ({
19648
+ ...entry,
19649
+ turnStatus: legacyRuntimeTurnStatus(entry, sessionStatusAfter)
19650
+ }));
19651
+ var RuntimeBridgeOutputEntryEnvelopeSchema = external_exports.union([
19652
+ RuntimeBridgeOutputEntryEnvelopeWireSchema,
19653
+ LegacyRuntimeBridgeOutputEntryEnvelopeSchema
19654
+ ]);
19640
19655
  var RuntimeBridgeOutputDeltaEnvelopeSchema = external_exports.object({
19641
19656
  type: external_exports.literal("conversation.delta"),
19642
19657
  sessionId: SessionIdSchema,
@@ -19650,10 +19665,16 @@ var RuntimeBridgeOutputDeltaEnvelopeSchema = external_exports.object({
19650
19665
  delta: ConversationTextDeltaSchema,
19651
19666
  createdAt: external_exports.string().datetime()
19652
19667
  }).strict();
19653
- var RuntimeBridgeOutputEnvelopeSchema = external_exports.discriminatedUnion("type", [
19668
+ var RuntimeBridgeOutputEnvelopeSchema = external_exports.union([
19654
19669
  RuntimeBridgeOutputEntryEnvelopeSchema,
19655
19670
  RuntimeBridgeOutputDeltaEnvelopeSchema
19656
19671
  ]);
19672
+ function legacyRuntimeTurnStatus(entry, sessionStatusAfter) {
19673
+ if (sessionStatusAfter === "failed" || entry.status === "failed") {
19674
+ return "failed";
19675
+ }
19676
+ return entry.kind === "question" ? "waiting_for_input" : "completed";
19677
+ }
19657
19678
  var RuntimeBridgeOutputAckSchema = external_exports.object({
19658
19679
  type: external_exports.literal("runtime.output.ack"),
19659
19680
  sessionId: SessionIdSchema,
@@ -22691,6 +22712,40 @@ var RunSummarySchema = external_exports.object({
22691
22712
  )
22692
22713
  });
22693
22714
 
22715
+ // ../../packages/schemas/src/session-turns.ts
22716
+ var SESSION_TURN_STATUSES = [
22717
+ "accepted",
22718
+ "in_progress",
22719
+ "waiting_for_input",
22720
+ "completed",
22721
+ "failed",
22722
+ "stale"
22723
+ ];
22724
+ var SESSION_TURN_FAILURE_SCOPES = ["turn", "session"];
22725
+ var SessionTurnStatusSchema = external_exports.enum(SESSION_TURN_STATUSES);
22726
+ var SessionTurnFailureScopeSchema = external_exports.enum(
22727
+ SESSION_TURN_FAILURE_SCOPES
22728
+ );
22729
+ var SessionTurnRecordSchema = external_exports.object({
22730
+ id: external_exports.string().trim().min(1),
22731
+ sessionId: SessionIdSchema2,
22732
+ commandId: SessionCommandIdSchema2,
22733
+ runtimeId: RuntimeIdSchema2.nullable(),
22734
+ bridgeLeaseId: RuntimeBridgeLeaseIdSchema2.nullable(),
22735
+ status: SessionTurnStatusSchema,
22736
+ failureScope: SessionTurnFailureScopeSchema.nullable(),
22737
+ lastOutputSeq: external_exports.number().int().positive().nullable(),
22738
+ acceptedAt: external_exports.string().datetime().nullable(),
22739
+ startedAt: external_exports.string().datetime().nullable(),
22740
+ lastProgressAt: external_exports.string().datetime().nullable(),
22741
+ completedAt: external_exports.string().datetime().nullable(),
22742
+ failedAt: external_exports.string().datetime().nullable(),
22743
+ staleAt: external_exports.string().datetime().nullable(),
22744
+ error: JsonValueSchema2.nullable(),
22745
+ createdAt: external_exports.string().datetime(),
22746
+ updatedAt: external_exports.string().datetime()
22747
+ });
22748
+
22694
22749
  // ../../packages/schemas/src/session-commands.ts
22695
22750
  var SESSION_COMMAND_KINDS = [
22696
22751
  "message",
@@ -26694,7 +26749,7 @@ Object.assign(lookup, {
26694
26749
  // package.json
26695
26750
  var package_default = {
26696
26751
  name: "@autohq/cli",
26697
- version: "0.1.208",
26752
+ version: "0.1.209",
26698
26753
  license: "SEE LICENSE IN README.md",
26699
26754
  publishConfig: {
26700
26755
  access: "public"
@@ -27118,7 +27173,7 @@ function buildOutputEnvelope(context, outputSeq, projection) {
27118
27173
  content: entry.content,
27119
27174
  createdAt,
27120
27175
  completedAt: entry.status === "in_progress" ? null : createdAt,
27121
- ...entry.sessionStatusAfter ? { sessionStatusAfter: entry.sessionStatusAfter } : {}
27176
+ ...entry.turnStatus ? { turnStatus: entry.turnStatus } : {}
27122
27177
  });
27123
27178
  }
27124
27179
  function isSuccessfulOutputAck(ack) {
@@ -27151,9 +27206,9 @@ var ClaudeCodeProjector = class {
27151
27206
  const outputs = parsed.projections.map(
27152
27207
  (entry) => ({
27153
27208
  type: "entry",
27154
- // A question entry means the SDK is parked on AskUserQuestion waiting
27155
- // for an operator answer, so the session transitions to awaiting input.
27156
- entry: entry.kind === "question" ? { ...entry, sessionStatusAfter: "awaiting" } : entry
27209
+ // A question means the delivered turn is parked on AskUserQuestion
27210
+ // waiting for an operator answer.
27211
+ entry: entry.kind === "question" ? { ...entry, turnStatus: "waiting_for_input" } : entry
27157
27212
  })
27158
27213
  );
27159
27214
  if (parsed.result) {
@@ -27163,14 +27218,13 @@ var ClaudeCodeProjector = class {
27163
27218
  }
27164
27219
  };
27165
27220
  function projectClaudeCodeResult(result) {
27166
- const failedButRecoverable = isRecoverableToolUseDiagnostic(result);
27167
27221
  return {
27168
27222
  type: "entry",
27169
27223
  entry: {
27170
27224
  role: "system",
27171
27225
  kind: "status",
27172
27226
  status: result.isError ? "failed" : "completed",
27173
- sessionStatusAfter: result.isError && !failedButRecoverable ? "failed" : "awaiting",
27227
+ turnStatus: result.isError ? "failed" : "completed",
27174
27228
  content: {
27175
27229
  parts: [
27176
27230
  {
@@ -27182,13 +27236,6 @@ function projectClaudeCodeResult(result) {
27182
27236
  }
27183
27237
  };
27184
27238
  }
27185
- function isRecoverableToolUseDiagnostic(result) {
27186
- if (!result.isError) {
27187
- return false;
27188
- }
27189
- const message = result.errorMessage ?? "";
27190
- return message.startsWith("[ede_diagnostic]") && message.includes("stop_reason=tool_use");
27191
- }
27192
27239
  function anthropicMessageIdFromStreamStart(message) {
27193
27240
  const event = message.event;
27194
27241
  if (event.type !== "message_start") {
package/dist/index.js CHANGED
@@ -18589,6 +18589,49 @@ var init_session_introspection = __esm({
18589
18589
  }
18590
18590
  });
18591
18591
 
18592
+ // ../../packages/schemas/src/session-turns.ts
18593
+ var SESSION_TURN_STATUSES, SESSION_TURN_FAILURE_SCOPES, SessionTurnStatusSchema, SessionTurnFailureScopeSchema, SessionTurnRecordSchema;
18594
+ var init_session_turns = __esm({
18595
+ "../../packages/schemas/src/session-turns.ts"() {
18596
+ "use strict";
18597
+ init_zod();
18598
+ init_ids();
18599
+ init_primitives();
18600
+ SESSION_TURN_STATUSES = [
18601
+ "accepted",
18602
+ "in_progress",
18603
+ "waiting_for_input",
18604
+ "completed",
18605
+ "failed",
18606
+ "stale"
18607
+ ];
18608
+ SESSION_TURN_FAILURE_SCOPES = ["turn", "session"];
18609
+ SessionTurnStatusSchema = external_exports.enum(SESSION_TURN_STATUSES);
18610
+ SessionTurnFailureScopeSchema = external_exports.enum(
18611
+ SESSION_TURN_FAILURE_SCOPES
18612
+ );
18613
+ SessionTurnRecordSchema = external_exports.object({
18614
+ id: external_exports.string().trim().min(1),
18615
+ sessionId: SessionIdSchema,
18616
+ commandId: SessionCommandIdSchema,
18617
+ runtimeId: RuntimeIdSchema.nullable(),
18618
+ bridgeLeaseId: RuntimeBridgeLeaseIdSchema.nullable(),
18619
+ status: SessionTurnStatusSchema,
18620
+ failureScope: SessionTurnFailureScopeSchema.nullable(),
18621
+ lastOutputSeq: external_exports.number().int().positive().nullable(),
18622
+ acceptedAt: external_exports.string().datetime().nullable(),
18623
+ startedAt: external_exports.string().datetime().nullable(),
18624
+ lastProgressAt: external_exports.string().datetime().nullable(),
18625
+ completedAt: external_exports.string().datetime().nullable(),
18626
+ failedAt: external_exports.string().datetime().nullable(),
18627
+ staleAt: external_exports.string().datetime().nullable(),
18628
+ error: JsonValueSchema.nullable(),
18629
+ createdAt: external_exports.string().datetime(),
18630
+ updatedAt: external_exports.string().datetime()
18631
+ });
18632
+ }
18633
+ });
18634
+
18592
18635
  // ../../packages/schemas/src/session-commands.ts
18593
18636
  var SESSION_COMMAND_KINDS, SESSION_DISPATCH_COMMAND_KINDS, SESSION_PERSISTED_COMMAND_KINDS, SESSION_LIFECYCLE_COMMAND_KINDS, SESSION_COMMAND_STATUSES, SESSION_DISPATCH_COMMAND_STATUSES, SessionCommandKindSchema, SessionPersistedCommandKindSchema, SessionDispatchCommandKindSchema, RunLifecycleCommandKindSchema, SessionCommandStatusSchema, SessionDispatchCommandStatusSchema, SessionCommandSenderSchema, MESSAGE_DELIVERY_MODES, MessageDeliveryModeSchema, TRIGGER_INJECTION_MODALITIES, TriggerInjectionModalitySchema, RunMessageCommandPayloadSchema, RunAnswerCommandPayloadSchema, RunLifecycleCommandPayloadSchema, SessionCommandPayloadSchema, CreateRunMessageCommandRequestSchema, CreateRunAnswerCommandRequestSchema, CreateRunLifecycleCommandRequestSchema, CreateSessionCommandRequestSchema, RunResolutionPolicySchema, AgentAddressedCommandTargetSchema, SessionCommandRecordBaseSchema, RunStartCommandPayloadSchema, RunStartWithMessageCommandPayloadSchema, SessionPersistedCommandPayloadSchema, SessionCommandRecordSchema, SessionDispatchMessageCommandPayloadSchema, SessionDispatchAnswerCommandPayloadSchema, SessionDispatchStopCommandPayloadSchema, SessionDispatchCommandPayloadSchema, SessionDispatchCommandRecordBaseSchema, SessionDispatchCommandRecordSchema;
18594
18637
  var init_session_commands = __esm({
@@ -19021,6 +19064,7 @@ var init_src = __esm({
19021
19064
  init_resources();
19022
19065
  init_session_diagnostics();
19023
19066
  init_session_introspection();
19067
+ init_session_turns();
19024
19068
  init_secrets();
19025
19069
  init_session_commands();
19026
19070
  init_setup();
@@ -21715,7 +21759,7 @@ var init_package = __esm({
21715
21759
  "package.json"() {
21716
21760
  package_default = {
21717
21761
  name: "@autohq/cli",
21718
- version: "0.1.208",
21762
+ version: "0.1.209",
21719
21763
  license: "SEE LICENSE IN README.md",
21720
21764
  publishConfig: {
21721
21765
  access: "public"
@@ -31121,6 +31165,11 @@ var ConversationEntryStatusSchema2 = external_exports.enum([
31121
31165
  "completed",
31122
31166
  "failed"
31123
31167
  ]);
31168
+ var RuntimeTurnStatusSchema = external_exports.enum([
31169
+ "waiting_for_input",
31170
+ "completed",
31171
+ "failed"
31172
+ ]);
31124
31173
  var ConversationTextContentPartSchema2 = external_exports.object({
31125
31174
  type: external_exports.literal("text"),
31126
31175
  text: external_exports.string()
@@ -31274,7 +31323,7 @@ var RuntimeBridgeCommandDeliveryAcceptedSchema = external_exports.object({
31274
31323
  result: external_exports.enum(["injected", "duplicate"]),
31275
31324
  at: external_exports.string().datetime()
31276
31325
  }).strict();
31277
- var RuntimeBridgeOutputEntryEnvelopeSchema = external_exports.object({
31326
+ var RuntimeBridgeOutputEntryEnvelopeWireSchema = external_exports.object({
31278
31327
  type: external_exports.literal("conversation.entry"),
31279
31328
  sessionId: SessionIdSchema2,
31280
31329
  runtimeId: RuntimeIdSchema2,
@@ -31287,8 +31336,18 @@ var RuntimeBridgeOutputEntryEnvelopeSchema = external_exports.object({
31287
31336
  content: ConversationEntryContentSchema2,
31288
31337
  createdAt: external_exports.string().datetime(),
31289
31338
  completedAt: external_exports.string().datetime().nullable(),
31290
- sessionStatusAfter: external_exports.enum(["awaiting", "failed"]).optional()
31339
+ turnStatus: RuntimeTurnStatusSchema.optional()
31291
31340
  }).strict();
31341
+ var LegacyRuntimeBridgeOutputEntryEnvelopeSchema = RuntimeBridgeOutputEntryEnvelopeWireSchema.omit({ turnStatus: true }).extend({
31342
+ sessionStatusAfter: external_exports.enum(["awaiting", "failed"])
31343
+ }).strict().transform(({ sessionStatusAfter, ...entry }) => ({
31344
+ ...entry,
31345
+ turnStatus: legacyRuntimeTurnStatus(entry, sessionStatusAfter)
31346
+ }));
31347
+ var RuntimeBridgeOutputEntryEnvelopeSchema = external_exports.union([
31348
+ RuntimeBridgeOutputEntryEnvelopeWireSchema,
31349
+ LegacyRuntimeBridgeOutputEntryEnvelopeSchema
31350
+ ]);
31292
31351
  var RuntimeBridgeOutputDeltaEnvelopeSchema = external_exports.object({
31293
31352
  type: external_exports.literal("conversation.delta"),
31294
31353
  sessionId: SessionIdSchema2,
@@ -31302,10 +31361,16 @@ var RuntimeBridgeOutputDeltaEnvelopeSchema = external_exports.object({
31302
31361
  delta: ConversationTextDeltaSchema2,
31303
31362
  createdAt: external_exports.string().datetime()
31304
31363
  }).strict();
31305
- var RuntimeBridgeOutputEnvelopeSchema = external_exports.discriminatedUnion("type", [
31364
+ var RuntimeBridgeOutputEnvelopeSchema = external_exports.union([
31306
31365
  RuntimeBridgeOutputEntryEnvelopeSchema,
31307
31366
  RuntimeBridgeOutputDeltaEnvelopeSchema
31308
31367
  ]);
31368
+ function legacyRuntimeTurnStatus(entry, sessionStatusAfter) {
31369
+ if (sessionStatusAfter === "failed" || entry.status === "failed") {
31370
+ return "failed";
31371
+ }
31372
+ return entry.kind === "question" ? "waiting_for_input" : "completed";
31373
+ }
31309
31374
  var RuntimeBridgeOutputAckSchema = external_exports.object({
31310
31375
  type: external_exports.literal("runtime.output.ack"),
31311
31376
  sessionId: SessionIdSchema2,
@@ -31772,7 +31837,7 @@ function buildOutputEnvelope(context, outputSeq, projection) {
31772
31837
  content: entry.content,
31773
31838
  createdAt,
31774
31839
  completedAt: entry.status === "in_progress" ? null : createdAt,
31775
- ...entry.sessionStatusAfter ? { sessionStatusAfter: entry.sessionStatusAfter } : {}
31840
+ ...entry.turnStatus ? { turnStatus: entry.turnStatus } : {}
31776
31841
  });
31777
31842
  }
31778
31843
  function isSuccessfulOutputAck(ack) {
@@ -31806,9 +31871,9 @@ var ClaudeCodeProjector = class {
31806
31871
  const outputs = parsed.projections.map(
31807
31872
  (entry) => ({
31808
31873
  type: "entry",
31809
- // A question entry means the SDK is parked on AskUserQuestion waiting
31810
- // for an operator answer, so the session transitions to awaiting input.
31811
- entry: entry.kind === "question" ? { ...entry, sessionStatusAfter: "awaiting" } : entry
31874
+ // A question means the delivered turn is parked on AskUserQuestion
31875
+ // waiting for an operator answer.
31876
+ entry: entry.kind === "question" ? { ...entry, turnStatus: "waiting_for_input" } : entry
31812
31877
  })
31813
31878
  );
31814
31879
  if (parsed.result) {
@@ -31818,14 +31883,13 @@ var ClaudeCodeProjector = class {
31818
31883
  }
31819
31884
  };
31820
31885
  function projectClaudeCodeResult(result) {
31821
- const failedButRecoverable = isRecoverableToolUseDiagnostic(result);
31822
31886
  return {
31823
31887
  type: "entry",
31824
31888
  entry: {
31825
31889
  role: "system",
31826
31890
  kind: "status",
31827
31891
  status: result.isError ? "failed" : "completed",
31828
- sessionStatusAfter: result.isError && !failedButRecoverable ? "failed" : "awaiting",
31892
+ turnStatus: result.isError ? "failed" : "completed",
31829
31893
  content: {
31830
31894
  parts: [
31831
31895
  {
@@ -31837,13 +31901,6 @@ function projectClaudeCodeResult(result) {
31837
31901
  }
31838
31902
  };
31839
31903
  }
31840
- function isRecoverableToolUseDiagnostic(result) {
31841
- if (!result.isError) {
31842
- return false;
31843
- }
31844
- const message = result.errorMessage ?? "";
31845
- return message.startsWith("[ede_diagnostic]") && message.includes("stop_reason=tool_use");
31846
- }
31847
31904
  function anthropicMessageIdFromStreamStart(message) {
31848
31905
  const event = message.event;
31849
31906
  if (event.type !== "message_start") {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@autohq/cli",
3
- "version": "0.1.208",
3
+ "version": "0.1.209",
4
4
  "license": "SEE LICENSE IN README.md",
5
5
  "publishConfig": {
6
6
  "access": "public"