@sixb/server 0.2.4 → 0.2.6

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.
Files changed (90) hide show
  1. package/dist/index.d.ts +1 -1
  2. package/dist/index.d.ts.map +1 -1
  3. package/dist/index.js +877 -89
  4. package/dist/index.js.map +26 -25
  5. package/dist/live/room.d.ts +2 -0
  6. package/dist/live/room.d.ts.map +1 -1
  7. package/dist/registerRoutes.d.ts +1 -0
  8. package/dist/registerRoutes.d.ts.map +1 -1
  9. package/dist/routes/agent-approvals.d.ts +22 -0
  10. package/dist/routes/agent-approvals.d.ts.map +1 -1
  11. package/dist/routes/agent-computers.d.ts +36 -0
  12. package/dist/routes/agent-computers.d.ts.map +1 -1
  13. package/dist/routes/agent-runners.d.ts +5 -1
  14. package/dist/routes/agent-runners.d.ts.map +1 -1
  15. package/dist/routes/agent-thread-reads.d.ts +82 -0
  16. package/dist/routes/agent-thread-reads.d.ts.map +1 -0
  17. package/dist/routes/agents.d.ts +1760 -86
  18. package/dist/routes/agents.d.ts.map +1 -1
  19. package/dist/routes/ai-accounting.d.ts.map +1 -1
  20. package/dist/routes/artifact-frames.d.ts +3 -3
  21. package/dist/routes/artifact-frames.d.ts.map +1 -1
  22. package/dist/routes/artifacts.d.ts +287 -21
  23. package/dist/routes/artifacts.d.ts.map +1 -1
  24. package/dist/routes/auth.d.ts +7 -7
  25. package/dist/routes/events.d.ts +4 -4
  26. package/dist/routes/links.d.ts +8 -0
  27. package/dist/routes/links.d.ts.map +1 -1
  28. package/dist/routes/model-generations.d.ts +6 -0
  29. package/dist/routes/model-generations.d.ts.map +1 -1
  30. package/dist/routes/objects.d.ts +8 -0
  31. package/dist/routes/objects.d.ts.map +1 -1
  32. package/dist/routes/observed-agent-threads.d.ts +22 -0
  33. package/dist/routes/observed-agent-threads.d.ts.map +1 -1
  34. package/dist/routes/projections.d.ts +2 -0
  35. package/dist/routes/projections.d.ts.map +1 -1
  36. package/dist/routes/status.d.ts +4 -1
  37. package/dist/routes/status.d.ts.map +1 -1
  38. package/dist/routes/syncs.d.ts +175 -12
  39. package/dist/routes/syncs.d.ts.map +1 -1
  40. package/dist/routes/workflows.d.ts +6 -6
  41. package/dist/routes/ws/agents.d.ts.map +1 -1
  42. package/dist/routes/ws/events.d.ts +6 -6
  43. package/dist/schemas/activity.d.ts +4 -4
  44. package/dist/schemas/agents.d.ts +7697 -262
  45. package/dist/schemas/agents.d.ts.map +1 -1
  46. package/dist/schemas/ai-accounting.d.ts +3 -0
  47. package/dist/schemas/ai-accounting.d.ts.map +1 -1
  48. package/dist/schemas/artifacts.d.ts +676 -36
  49. package/dist/schemas/artifacts.d.ts.map +1 -1
  50. package/dist/schemas/auth.d.ts +8 -8
  51. package/dist/schemas/common.d.ts.map +1 -1
  52. package/dist/schemas/events.d.ts +36 -24
  53. package/dist/schemas/events.d.ts.map +1 -1
  54. package/dist/schemas/lineage.d.ts +112 -0
  55. package/dist/schemas/lineage.d.ts.map +1 -1
  56. package/dist/schemas/models.d.ts +46 -0
  57. package/dist/schemas/models.d.ts.map +1 -1
  58. package/dist/schemas/projections.d.ts +11 -0
  59. package/dist/schemas/projections.d.ts.map +1 -1
  60. package/dist/schemas/syncs.d.ts +724 -25
  61. package/dist/schemas/syncs.d.ts.map +1 -1
  62. package/dist/schemas/workflows.d.ts +22 -22
  63. package/dist/server.d.ts +16 -1
  64. package/dist/server.d.ts.map +1 -1
  65. package/package.json +5 -5
  66. package/src/index.ts +6 -1
  67. package/src/live/README.md +9 -6
  68. package/src/live/room.ts +16 -8
  69. package/src/registerRoutes.ts +4 -1
  70. package/src/routes/agent-computers.ts +7 -6
  71. package/src/routes/agent-runners.ts +15 -4
  72. package/src/routes/agent-thread-reads.ts +67 -0
  73. package/src/routes/agents.ts +331 -20
  74. package/src/routes/ai-accounting.ts +1 -0
  75. package/src/routes/artifact-frames.ts +22 -9
  76. package/src/routes/artifacts.ts +124 -3
  77. package/src/routes/model-generations.ts +1 -1
  78. package/src/routes/observed-agent-threads.ts +3 -4
  79. package/src/routes/status.ts +18 -1
  80. package/src/routes/syncs.ts +135 -8
  81. package/src/routes/ws/agents.ts +43 -3
  82. package/src/schemas/agents.ts +148 -12
  83. package/src/schemas/ai-accounting.ts +12 -0
  84. package/src/schemas/artifacts.ts +66 -1
  85. package/src/schemas/common.ts +15 -9
  86. package/src/schemas/events.ts +1 -0
  87. package/src/schemas/models.ts +10 -0
  88. package/src/schemas/projections.ts +1 -0
  89. package/src/schemas/syncs.ts +63 -1
  90. package/src/server.ts +208 -14
@@ -1,9 +1,9 @@
1
1
  import { type AgentRequestErrorCode, type AgentRunView, type AgentThreadView, type SixbHostView } from "@sixb/core";
2
- import { type AgentBackgroundCommandRef, type AgentStorage, type AgentThreadRecord, type Principal } from "@sixb/core/storage";
2
+ import { type AgentBackgroundCommandRef, type AgentInboxItemRecord, type AgentStorage, type AgentThreadRecord, type Principal } from "@sixb/core/storage";
3
3
  import type { Elysia } from "elysia";
4
4
  import { z } from "zod";
5
5
  import { requireRequestSixb } from "../auth/scope";
6
- import { AgentMessagesQuerySchema, AgentRunSchema, AgentThreadSchema } from "../schemas/agents";
6
+ import { AgentInboxItemSchema, AgentMessagesQuerySchema, AgentRunSchema, AgentThreadSchema } from "../schemas/agents";
7
7
  import { handleRouteError } from "../utils/http";
8
8
  /**
9
9
  * Threads as the API returns them to `viewer`, their owner and participants named by their
@@ -13,7 +13,14 @@ export declare function serializeThreads(host: SixbHostView, threads: readonly A
13
13
  export declare function serializeThread(host: SixbHostView, thread: AgentThreadView, viewer: Principal): Promise<ReturnType<typeof AgentThreadSchema.parse>>;
14
14
  /** Whether a reported background command is the one `ref` names: by its start, as ids repeat. */
15
15
  export declare function sameBackgroundCommand(command: AgentBackgroundCommandRef, ref: AgentBackgroundCommandRef): boolean;
16
- export declare function serializeAgentRun(run: AgentRunView): ReturnType<typeof AgentRunSchema.parse>;
16
+ export declare function serializeAgentInboxItem(item: AgentInboxItemRecord): ReturnType<typeof AgentInboxItemSchema.parse>;
17
+ /**
18
+ * A run as the API returns it. `ownerReads`: its thread's owner reads it, and alone sees the folder
19
+ * on their computer it runs in, as with the thread's own `computer`.
20
+ */
21
+ export declare function serializeAgentRun(run: AgentRunView, { ownerReads }?: {
22
+ readonly ownerReads?: boolean;
23
+ }): ReturnType<typeof AgentRunSchema.parse>;
17
24
  export declare function handleAgentRouteError(error: unknown, set: {
18
25
  status?: number | string;
19
26
  headers?: unknown;
@@ -237,6 +244,13 @@ export declare function serializeThreadRead(host: SixbHostView, sixb: ReturnType
237
244
  activeRunId: string | null;
238
245
  messageCount: number;
239
246
  updatedAt: string;
247
+ read?: {
248
+ threadId: string;
249
+ throughSeq: number;
250
+ headSeq: number;
251
+ unread: number;
252
+ readAt?: string | undefined;
253
+ } | undefined;
240
254
  title?: string | undefined;
241
255
  computer?: {
242
256
  id: string;
@@ -268,6 +282,17 @@ export declare function serializeThreadRead(host: SixbHostView, sixb: ReturnType
268
282
  }[] | undefined;
269
283
  movedAt?: string | undefined;
270
284
  lastMessageAt?: string | undefined;
285
+ lastRun?: {
286
+ status: "succeeded" | "failed" | "cancelled" | "running" | "queued";
287
+ id: string;
288
+ requestedBy?: {
289
+ id: string;
290
+ type: "user" | "serviceAccount";
291
+ } | undefined;
292
+ completedAt?: string | undefined;
293
+ finishReason?: "error" | "length" | "unknown" | "stop" | "content-filter" | "tool-calls" | "timeout" | "interrupted" | "awaiting_approval" | "awaiting_answer" | "other" | undefined;
294
+ errorCode?: "agent.context_limit_exceeded" | "agent.execution_failed" | "agent.step_limit_reached" | "ai.usage_limit_exceeded" | "ai.usage_limit_unavailable" | "internal.unexpected" | "runtime.cancelled" | undefined;
295
+ } | undefined;
271
296
  }>;
272
297
  export declare function registerAgentRoutes(app: Elysia, host: SixbHostView): Elysia<"", {
273
298
  decorator: {};
@@ -364,6 +389,13 @@ export declare function registerAgentRoutes(app: Elysia, host: SixbHostView): El
364
389
  activeRunId: string | null;
365
390
  messageCount: number;
366
391
  updatedAt: string;
392
+ read?: {
393
+ threadId: string;
394
+ throughSeq: number;
395
+ headSeq: number;
396
+ unread: number;
397
+ readAt?: string | undefined;
398
+ } | undefined;
367
399
  title?: string | undefined;
368
400
  approvalMode?: "manual" | "accept-edits" | "auto" | undefined;
369
401
  approvalModeSource?: "default" | "thread" | "fallback" | "run" | undefined;
@@ -397,6 +429,17 @@ export declare function registerAgentRoutes(app: Elysia, host: SixbHostView): El
397
429
  }[] | undefined;
398
430
  movedAt?: string | undefined;
399
431
  lastMessageAt?: string | undefined;
432
+ lastRun?: {
433
+ status: "succeeded" | "failed" | "cancelled" | "running" | "queued";
434
+ id: string;
435
+ requestedBy?: {
436
+ id: string;
437
+ type: "user" | "serviceAccount";
438
+ } | undefined;
439
+ completedAt?: string | undefined;
440
+ finishReason?: "error" | "length" | "unknown" | "stop" | "content-filter" | "tool-calls" | "timeout" | "interrupted" | "awaiting_approval" | "awaiting_answer" | "other" | undefined;
441
+ errorCode?: "agent.context_limit_exceeded" | "agent.execution_failed" | "agent.step_limit_reached" | "ai.usage_limit_exceeded" | "ai.usage_limit_unavailable" | "internal.unexpected" | "runtime.cancelled" | undefined;
442
+ } | undefined;
400
443
  }[];
401
444
  };
402
445
  400: {
@@ -468,6 +511,13 @@ export declare function registerAgentRoutes(app: Elysia, host: SixbHostView): El
468
511
  activeRunId: string | null;
469
512
  messageCount: number;
470
513
  updatedAt: string;
514
+ read?: {
515
+ threadId: string;
516
+ throughSeq: number;
517
+ headSeq: number;
518
+ unread: number;
519
+ readAt?: string | undefined;
520
+ } | undefined;
471
521
  title?: string | undefined;
472
522
  approvalMode?: "manual" | "accept-edits" | "auto" | undefined;
473
523
  approvalModeSource?: "default" | "thread" | "fallback" | "run" | undefined;
@@ -501,6 +551,17 @@ export declare function registerAgentRoutes(app: Elysia, host: SixbHostView): El
501
551
  }[] | undefined;
502
552
  movedAt?: string | undefined;
503
553
  lastMessageAt?: string | undefined;
554
+ lastRun?: {
555
+ status: "succeeded" | "failed" | "cancelled" | "running" | "queued";
556
+ id: string;
557
+ requestedBy?: {
558
+ id: string;
559
+ type: "user" | "serviceAccount";
560
+ } | undefined;
561
+ completedAt?: string | undefined;
562
+ finishReason?: "error" | "length" | "unknown" | "stop" | "content-filter" | "tool-calls" | "timeout" | "interrupted" | "awaiting_approval" | "awaiting_answer" | "other" | undefined;
563
+ errorCode?: "agent.context_limit_exceeded" | "agent.execution_failed" | "agent.step_limit_reached" | "ai.usage_limit_exceeded" | "ai.usage_limit_unavailable" | "internal.unexpected" | "runtime.cancelled" | undefined;
564
+ } | undefined;
504
565
  };
505
566
  } | {
506
567
  readonly error: string;
@@ -551,6 +612,13 @@ export declare function registerAgentRoutes(app: Elysia, host: SixbHostView): El
551
612
  activeRunId: string | null;
552
613
  messageCount: number;
553
614
  updatedAt: string;
615
+ read?: {
616
+ threadId: string;
617
+ throughSeq: number;
618
+ headSeq: number;
619
+ unread: number;
620
+ readAt?: string | undefined;
621
+ } | undefined;
554
622
  title?: string | undefined;
555
623
  approvalMode?: "manual" | "accept-edits" | "auto" | undefined;
556
624
  approvalModeSource?: "default" | "thread" | "fallback" | "run" | undefined;
@@ -584,6 +652,17 @@ export declare function registerAgentRoutes(app: Elysia, host: SixbHostView): El
584
652
  }[] | undefined;
585
653
  movedAt?: string | undefined;
586
654
  lastMessageAt?: string | undefined;
655
+ lastRun?: {
656
+ status: "succeeded" | "failed" | "cancelled" | "running" | "queued";
657
+ id: string;
658
+ requestedBy?: {
659
+ id: string;
660
+ type: "user" | "serviceAccount";
661
+ } | undefined;
662
+ completedAt?: string | undefined;
663
+ finishReason?: "error" | "length" | "unknown" | "stop" | "content-filter" | "tool-calls" | "timeout" | "interrupted" | "awaiting_approval" | "awaiting_answer" | "other" | undefined;
664
+ errorCode?: "agent.context_limit_exceeded" | "agent.execution_failed" | "agent.step_limit_reached" | "ai.usage_limit_exceeded" | "ai.usage_limit_unavailable" | "internal.unexpected" | "runtime.cancelled" | undefined;
665
+ } | undefined;
587
666
  };
588
667
  };
589
668
  422: {
@@ -641,6 +720,13 @@ export declare function registerAgentRoutes(app: Elysia, host: SixbHostView): El
641
720
  activeRunId: string | null;
642
721
  messageCount: number;
643
722
  updatedAt: string;
723
+ read?: {
724
+ threadId: string;
725
+ throughSeq: number;
726
+ headSeq: number;
727
+ unread: number;
728
+ readAt?: string | undefined;
729
+ } | undefined;
644
730
  title?: string | undefined;
645
731
  approvalMode?: "manual" | "accept-edits" | "auto" | undefined;
646
732
  approvalModeSource?: "default" | "thread" | "fallback" | "run" | undefined;
@@ -674,6 +760,17 @@ export declare function registerAgentRoutes(app: Elysia, host: SixbHostView): El
674
760
  }[] | undefined;
675
761
  movedAt?: string | undefined;
676
762
  lastMessageAt?: string | undefined;
763
+ lastRun?: {
764
+ status: "succeeded" | "failed" | "cancelled" | "running" | "queued";
765
+ id: string;
766
+ requestedBy?: {
767
+ id: string;
768
+ type: "user" | "serviceAccount";
769
+ } | undefined;
770
+ completedAt?: string | undefined;
771
+ finishReason?: "error" | "length" | "unknown" | "stop" | "content-filter" | "tool-calls" | "timeout" | "interrupted" | "awaiting_approval" | "awaiting_answer" | "other" | undefined;
772
+ errorCode?: "agent.context_limit_exceeded" | "agent.execution_failed" | "agent.step_limit_reached" | "ai.usage_limit_exceeded" | "ai.usage_limit_unavailable" | "internal.unexpected" | "runtime.cancelled" | undefined;
773
+ } | undefined;
677
774
  };
678
775
  404: {
679
776
  error: string;
@@ -748,6 +845,13 @@ export declare function registerAgentRoutes(app: Elysia, host: SixbHostView): El
748
845
  activeRunId: string | null;
749
846
  messageCount: number;
750
847
  updatedAt: string;
848
+ read?: {
849
+ threadId: string;
850
+ throughSeq: number;
851
+ headSeq: number;
852
+ unread: number;
853
+ readAt?: string | undefined;
854
+ } | undefined;
751
855
  title?: string | undefined;
752
856
  approvalMode?: "manual" | "accept-edits" | "auto" | undefined;
753
857
  approvalModeSource?: "default" | "thread" | "fallback" | "run" | undefined;
@@ -781,6 +885,17 @@ export declare function registerAgentRoutes(app: Elysia, host: SixbHostView): El
781
885
  }[] | undefined;
782
886
  movedAt?: string | undefined;
783
887
  lastMessageAt?: string | undefined;
888
+ lastRun?: {
889
+ status: "succeeded" | "failed" | "cancelled" | "running" | "queued";
890
+ id: string;
891
+ requestedBy?: {
892
+ id: string;
893
+ type: "user" | "serviceAccount";
894
+ } | undefined;
895
+ completedAt?: string | undefined;
896
+ finishReason?: "error" | "length" | "unknown" | "stop" | "content-filter" | "tool-calls" | "timeout" | "interrupted" | "awaiting_approval" | "awaiting_answer" | "other" | undefined;
897
+ errorCode?: "agent.context_limit_exceeded" | "agent.execution_failed" | "agent.step_limit_reached" | "ai.usage_limit_exceeded" | "ai.usage_limit_unavailable" | "internal.unexpected" | "runtime.cancelled" | undefined;
898
+ } | undefined;
784
899
  };
785
900
  404: {
786
901
  error: string;
@@ -909,6 +1024,13 @@ export declare function registerAgentRoutes(app: Elysia, host: SixbHostView): El
909
1024
  activeRunId: string | null;
910
1025
  messageCount: number;
911
1026
  updatedAt: string;
1027
+ read?: {
1028
+ threadId: string;
1029
+ throughSeq: number;
1030
+ headSeq: number;
1031
+ unread: number;
1032
+ readAt?: string | undefined;
1033
+ } | undefined;
912
1034
  title?: string | undefined;
913
1035
  approvalMode?: "manual" | "accept-edits" | "auto" | undefined;
914
1036
  approvalModeSource?: "default" | "thread" | "fallback" | "run" | undefined;
@@ -942,6 +1064,17 @@ export declare function registerAgentRoutes(app: Elysia, host: SixbHostView): El
942
1064
  }[] | undefined;
943
1065
  movedAt?: string | undefined;
944
1066
  lastMessageAt?: string | undefined;
1067
+ lastRun?: {
1068
+ status: "succeeded" | "failed" | "cancelled" | "running" | "queued";
1069
+ id: string;
1070
+ requestedBy?: {
1071
+ id: string;
1072
+ type: "user" | "serviceAccount";
1073
+ } | undefined;
1074
+ completedAt?: string | undefined;
1075
+ finishReason?: "error" | "length" | "unknown" | "stop" | "content-filter" | "tool-calls" | "timeout" | "interrupted" | "awaiting_approval" | "awaiting_answer" | "other" | undefined;
1076
+ errorCode?: "agent.context_limit_exceeded" | "agent.execution_failed" | "agent.step_limit_reached" | "ai.usage_limit_exceeded" | "ai.usage_limit_unavailable" | "internal.unexpected" | "runtime.cancelled" | undefined;
1077
+ } | undefined;
945
1078
  };
946
1079
  } | {
947
1080
  readonly error: string;
@@ -994,6 +1127,13 @@ export declare function registerAgentRoutes(app: Elysia, host: SixbHostView): El
994
1127
  activeRunId: string | null;
995
1128
  messageCount: number;
996
1129
  updatedAt: string;
1130
+ read?: {
1131
+ threadId: string;
1132
+ throughSeq: number;
1133
+ headSeq: number;
1134
+ unread: number;
1135
+ readAt?: string | undefined;
1136
+ } | undefined;
997
1137
  title?: string | undefined;
998
1138
  approvalMode?: "manual" | "accept-edits" | "auto" | undefined;
999
1139
  approvalModeSource?: "default" | "thread" | "fallback" | "run" | undefined;
@@ -1027,6 +1167,17 @@ export declare function registerAgentRoutes(app: Elysia, host: SixbHostView): El
1027
1167
  }[] | undefined;
1028
1168
  movedAt?: string | undefined;
1029
1169
  lastMessageAt?: string | undefined;
1170
+ lastRun?: {
1171
+ status: "succeeded" | "failed" | "cancelled" | "running" | "queued";
1172
+ id: string;
1173
+ requestedBy?: {
1174
+ id: string;
1175
+ type: "user" | "serviceAccount";
1176
+ } | undefined;
1177
+ completedAt?: string | undefined;
1178
+ finishReason?: "error" | "length" | "unknown" | "stop" | "content-filter" | "tool-calls" | "timeout" | "interrupted" | "awaiting_approval" | "awaiting_answer" | "other" | undefined;
1179
+ errorCode?: "agent.context_limit_exceeded" | "agent.execution_failed" | "agent.step_limit_reached" | "ai.usage_limit_exceeded" | "ai.usage_limit_unavailable" | "internal.unexpected" | "runtime.cancelled" | undefined;
1180
+ } | undefined;
1030
1181
  };
1031
1182
  };
1032
1183
  422: {
@@ -1090,6 +1241,141 @@ export declare function registerAgentRoutes(app: Elysia, host: SixbHostView): El
1090
1241
  activeRunId: string | null;
1091
1242
  messageCount: number;
1092
1243
  updatedAt: string;
1244
+ read?: {
1245
+ threadId: string;
1246
+ throughSeq: number;
1247
+ headSeq: number;
1248
+ unread: number;
1249
+ readAt?: string | undefined;
1250
+ } | undefined;
1251
+ title?: string | undefined;
1252
+ approvalMode?: "manual" | "accept-edits" | "auto" | undefined;
1253
+ approvalModeSource?: "default" | "thread" | "fallback" | "run" | undefined;
1254
+ computer?: {
1255
+ id: string;
1256
+ name: string;
1257
+ folder: string;
1258
+ online: boolean;
1259
+ } | undefined;
1260
+ runsOn?: "computer" | undefined;
1261
+ sandboxState?: {
1262
+ status: "unavailable" | "new" | "busy" | "ready" | "blocked";
1263
+ name: string;
1264
+ initialized: boolean;
1265
+ } | undefined;
1266
+ parent?: {
1267
+ threadId: string;
1268
+ key: string;
1269
+ spawnedBy: string;
1270
+ } | undefined;
1271
+ sandboxParams?: Record<string, import("../schemas/common").JsonValue> | undefined;
1272
+ backgroundCommands?: {
1273
+ status: "running" | "exited" | "stopped";
1274
+ id: string;
1275
+ startedAt: string;
1276
+ threadId: string;
1277
+ command: string;
1278
+ exitCode?: number | undefined;
1279
+ endedAt?: string | undefined;
1280
+ stopping?: boolean | undefined;
1281
+ }[] | undefined;
1282
+ movedAt?: string | undefined;
1283
+ lastMessageAt?: string | undefined;
1284
+ lastRun?: {
1285
+ status: "succeeded" | "failed" | "cancelled" | "running" | "queued";
1286
+ id: string;
1287
+ requestedBy?: {
1288
+ id: string;
1289
+ type: "user" | "serviceAccount";
1290
+ } | undefined;
1291
+ completedAt?: string | undefined;
1292
+ finishReason?: "error" | "length" | "unknown" | "stop" | "content-filter" | "tool-calls" | "timeout" | "interrupted" | "awaiting_approval" | "awaiting_answer" | "other" | undefined;
1293
+ errorCode?: "agent.context_limit_exceeded" | "agent.execution_failed" | "agent.step_limit_reached" | "ai.usage_limit_exceeded" | "ai.usage_limit_unavailable" | "internal.unexpected" | "runtime.cancelled" | undefined;
1294
+ } | undefined;
1295
+ };
1296
+ 404: {
1297
+ error: string;
1298
+ };
1299
+ 403: {
1300
+ error: string;
1301
+ code?: string | undefined;
1302
+ };
1303
+ 409: {
1304
+ error: string;
1305
+ code?: string | undefined;
1306
+ };
1307
+ 400: {
1308
+ error: string;
1309
+ };
1310
+ 422: {
1311
+ type: "validation";
1312
+ on: string;
1313
+ summary?: string;
1314
+ message?: string;
1315
+ found?: unknown;
1316
+ property?: string;
1317
+ expected?: string;
1318
+ };
1319
+ };
1320
+ };
1321
+ };
1322
+ };
1323
+ };
1324
+ };
1325
+ };
1326
+ } & {
1327
+ api: {
1328
+ "agent-threads": {
1329
+ ":threadId": {
1330
+ sandbox: {
1331
+ restore: {
1332
+ post: {
1333
+ body: {
1334
+ expectedSandboxName: string;
1335
+ };
1336
+ params: {
1337
+ threadId: string;
1338
+ };
1339
+ query: unknown;
1340
+ headers: unknown;
1341
+ response: {
1342
+ 200: {
1343
+ status: "active" | "archived";
1344
+ projectId: string;
1345
+ id: string;
1346
+ kind: "conversation" | "subagent";
1347
+ createdAt: string;
1348
+ ownerPrincipal: {
1349
+ id: string;
1350
+ type: "user" | "serviceAccount" | "system";
1351
+ };
1352
+ owner: {
1353
+ id: string;
1354
+ type: "user" | "serviceAccount" | "system";
1355
+ displayName?: string | undefined;
1356
+ };
1357
+ participants: {
1358
+ principal: {
1359
+ id: string;
1360
+ type: "user";
1361
+ displayName?: string | undefined;
1362
+ };
1363
+ addedAt: string;
1364
+ addedBy: {
1365
+ id: string;
1366
+ type: "user" | "serviceAccount" | "system";
1367
+ };
1368
+ }[];
1369
+ activeRunId: string | null;
1370
+ messageCount: number;
1371
+ updatedAt: string;
1372
+ read?: {
1373
+ threadId: string;
1374
+ throughSeq: number;
1375
+ headSeq: number;
1376
+ unread: number;
1377
+ readAt?: string | undefined;
1378
+ } | undefined;
1093
1379
  title?: string | undefined;
1094
1380
  approvalMode?: "manual" | "accept-edits" | "auto" | undefined;
1095
1381
  approvalModeSource?: "default" | "thread" | "fallback" | "run" | undefined;
@@ -1123,6 +1409,17 @@ export declare function registerAgentRoutes(app: Elysia, host: SixbHostView): El
1123
1409
  }[] | undefined;
1124
1410
  movedAt?: string | undefined;
1125
1411
  lastMessageAt?: string | undefined;
1412
+ lastRun?: {
1413
+ status: "succeeded" | "failed" | "cancelled" | "running" | "queued";
1414
+ id: string;
1415
+ requestedBy?: {
1416
+ id: string;
1417
+ type: "user" | "serviceAccount";
1418
+ } | undefined;
1419
+ completedAt?: string | undefined;
1420
+ finishReason?: "error" | "length" | "unknown" | "stop" | "content-filter" | "tool-calls" | "timeout" | "interrupted" | "awaiting_approval" | "awaiting_answer" | "other" | undefined;
1421
+ errorCode?: "agent.context_limit_exceeded" | "agent.execution_failed" | "agent.step_limit_reached" | "ai.usage_limit_exceeded" | "ai.usage_limit_unavailable" | "internal.unexpected" | "runtime.cancelled" | undefined;
1422
+ } | undefined;
1126
1423
  };
1127
1424
  404: {
1128
1425
  error: string;
@@ -1491,6 +1788,7 @@ export declare function registerAgentRoutes(app: Elysia, host: SixbHostView): El
1491
1788
  } | undefined;
1492
1789
  messageId?: string | undefined;
1493
1790
  continue?: true | undefined;
1791
+ delivery?: "auto" | "steer" | "queue" | "send_now" | undefined;
1494
1792
  };
1495
1793
  params: {
1496
1794
  threadId: string;
@@ -1499,7 +1797,7 @@ export declare function registerAgentRoutes(app: Elysia, host: SixbHostView): El
1499
1797
  headers: unknown;
1500
1798
  response: {
1501
1799
  200: {
1502
- run: {
1800
+ run?: {
1503
1801
  status: "succeeded" | "failed" | "cancelled" | "running" | "queued";
1504
1802
  projectId: string;
1505
1803
  id: string;
@@ -1553,6 +1851,10 @@ export declare function registerAgentRoutes(app: Elysia, host: SixbHostView): El
1553
1851
  } | undefined;
1554
1852
  finishReason?: "error" | "length" | "unknown" | "stop" | "content-filter" | "tool-calls" | "timeout" | "interrupted" | "awaiting_approval" | "awaiting_answer" | "other" | undefined;
1555
1853
  parentRunId?: string | undefined;
1854
+ computer?: {
1855
+ id: string;
1856
+ folder: string;
1857
+ } | undefined;
1556
1858
  runsOn?: "computer" | undefined;
1557
1859
  diagnostics?: {
1558
1860
  code: "step_limit_reached" | "output_limit_reached";
@@ -1560,83 +1862,243 @@ export declare function registerAgentRoutes(app: Elysia, host: SixbHostView): El
1560
1862
  severity: "error" | "warning";
1561
1863
  scope: "run";
1562
1864
  }[] | undefined;
1563
- };
1564
- } | {
1565
- readonly error: string;
1566
- readonly code: AgentRequestErrorCode;
1567
- } | {
1568
- error: string;
1569
- };
1570
- 404: {
1571
- error: string;
1572
- };
1573
- 403: {
1574
- error: string;
1575
- code?: string | undefined;
1576
- };
1577
- 409: {
1578
- error: string;
1579
- code?: string | undefined;
1580
- };
1581
- 400: {
1582
- error: string;
1583
- code?: string | undefined;
1584
- };
1585
- 429: {
1586
- error: string;
1587
- code: "ai.usage_limit_exceeded" | "ai.usage_limit_unavailable";
1588
- details?: import("../schemas/common").JsonValue | undefined;
1589
- };
1590
- 501: {
1591
- error: string;
1592
- };
1593
- 202: {
1594
- run: {
1595
- status: "succeeded" | "failed" | "cancelled" | "running" | "queued";
1865
+ } | undefined;
1866
+ item?: {
1596
1867
  projectId: string;
1597
1868
  id: string;
1598
- kind: "conversation" | "subagent";
1869
+ mode: "steer" | "queue";
1599
1870
  threadId: string;
1600
1871
  createdAt: string;
1601
- attempt: number;
1602
- triggerMessageId: string;
1603
- streamId: string;
1604
- error?: import("@sixb/core").SixbFailure<"agent.context_limit_exceeded" | "agent.execution_failed" | "agent.step_limit_reached" | "ai.usage_limit_exceeded" | "ai.usage_limit_unavailable" | "internal.unexpected" | "runtime.cancelled"> | undefined;
1605
- model?: {
1606
- modelId: string;
1607
- provider: string;
1608
- } | undefined;
1609
- requestedBy?: {
1610
- id: string;
1611
- type: "user" | "serviceAccount";
1612
- } | undefined;
1613
- modelId?: string | undefined;
1614
- startedAt?: string | undefined;
1615
- completedAt?: string | undefined;
1616
- approvalMode?: "manual" | "accept-edits" | "auto" | undefined;
1617
- tier?: "light" | "standard" | "heavy" | undefined;
1618
- reasoning?: "none" | "provider-default" | "minimal" | "low" | "medium" | "high" | "xhigh" | "max" | {
1619
- budgetTokens: number;
1620
- } | undefined;
1621
- usage?: {
1622
- reportingStatus: "partial" | "complete" | "unavailable";
1623
- inputTokens?: number | undefined;
1624
- outputTokens?: number | undefined;
1625
- totalTokens?: number | undefined;
1626
- uncachedInputTokens?: number | undefined;
1627
- cacheReadInputTokens?: number | undefined;
1628
- cacheWriteInputTokens?: number | undefined;
1629
- textOutputTokens?: number | undefined;
1630
- reasoningOutputTokens?: number | undefined;
1631
- audioDurationMs?: number | undefined;
1632
- imageOutputTokens?: number | undefined;
1633
- audioOutputTokens?: number | undefined;
1634
- outputImages?: number | undefined;
1635
- inputCharacters?: number | undefined;
1636
- } | undefined;
1637
- cost?: {
1638
- amounts: {
1639
- currency: string;
1872
+ parts: ({
1873
+ origin: "ambient" | "explicit";
1874
+ context: {
1875
+ kind: "object";
1876
+ ref: {
1877
+ objectTypeId: string;
1878
+ primaryId: string;
1879
+ };
1880
+ label?: string | undefined;
1881
+ } | {
1882
+ id: string;
1883
+ kind: "app-state";
1884
+ value: import("../schemas/common").JsonValue;
1885
+ description: string;
1886
+ label: string;
1887
+ };
1888
+ type: "context";
1889
+ } | {
1890
+ type: "text";
1891
+ text: string;
1892
+ providerMetadata?: import("../schemas/common").JsonValue | undefined;
1893
+ } | {
1894
+ type: "reasoning";
1895
+ text: string;
1896
+ providerMetadata?: import("../schemas/common").JsonValue | undefined;
1897
+ } | {
1898
+ type: "step-start";
1899
+ } | {
1900
+ type: "file";
1901
+ fileRef: {
1902
+ blobId: string;
1903
+ digest: string;
1904
+ sizeBytes: number;
1905
+ fileName?: string | undefined;
1906
+ mediaType?: string | undefined;
1907
+ logicalPath?: string | undefined;
1908
+ };
1909
+ providerMetadata?: import("../schemas/common").JsonValue | undefined;
1910
+ } | {
1911
+ type: "provider-state";
1912
+ providerId: string;
1913
+ data: import("../schemas/common").JsonValue;
1914
+ } | {
1915
+ type: "tool-call";
1916
+ input: import("../schemas/common").JsonValue;
1917
+ output: import("../schemas/common").JsonValue;
1918
+ toolCallId: string;
1919
+ toolName: string;
1920
+ state: "output-available";
1921
+ providerMetadata?: import("../schemas/common").JsonValue | undefined;
1922
+ dynamic?: boolean | undefined;
1923
+ providerExecuted?: boolean | undefined;
1924
+ outputFile?: {
1925
+ path: string;
1926
+ fileRef: {
1927
+ blobId: string;
1928
+ digest: string;
1929
+ sizeBytes: number;
1930
+ fileName?: string | undefined;
1931
+ mediaType?: string | undefined;
1932
+ logicalPath?: string | undefined;
1933
+ };
1934
+ } | undefined;
1935
+ } | {
1936
+ type: "tool-call";
1937
+ input: import("../schemas/common").JsonValue;
1938
+ toolCallId: string;
1939
+ toolName: string;
1940
+ state: "output-error";
1941
+ errorText: string;
1942
+ providerMetadata?: import("../schemas/common").JsonValue | undefined;
1943
+ dynamic?: boolean | undefined;
1944
+ providerExecuted?: boolean | undefined;
1945
+ } | {
1946
+ type: "continuation";
1947
+ } | {
1948
+ status: "approved" | "denied" | "cancelled" | "superseded" | "expired";
1949
+ type: "approval-outcome";
1950
+ call: {
1951
+ kind: "action";
1952
+ actionId: string;
1953
+ subject: {
1954
+ kind: "none";
1955
+ } | {
1956
+ kind: "object";
1957
+ objectTypeId: string;
1958
+ primaryId: string;
1959
+ };
1960
+ } | {
1961
+ kind: "workflow";
1962
+ workflowId: string;
1963
+ };
1964
+ approvalId: string;
1965
+ caller?: {
1966
+ runId: string;
1967
+ key: string;
1968
+ continues?: true | undefined;
1969
+ } | undefined;
1970
+ outcome?: {
1971
+ status: "succeeded" | "failed";
1972
+ kind: "action-run";
1973
+ runId: string;
1974
+ error?: import("@sixb/core").ActionRunFailure<"validation" | "writeback" | "edits" | "effects" | "commit"> | undefined;
1975
+ } | {
1976
+ kind: "workflow-run";
1977
+ runId: string;
1978
+ queuedAt: string;
1979
+ } | {
1980
+ error: {
1981
+ at: string;
1982
+ code: "action.phase_failed" | "action.read_conflict" | "action.rejected" | "action.run_in_progress" | "action.timeout" | "agent.approval_authority_lost" | "agent.context_limit_exceeded" | "agent.execution_failed" | "agent.step_limit_reached" | "ai.usage_limit_exceeded" | "ai.usage_limit_unavailable" | "connector.adapter_invalid" | "connector.authorization_invalid" | "connector.authorization_required" | "connector.configuration_invalid" | "connector.credentials_unavailable" | "connector.not_found" | "connector.operation_conflict" | "connector.operation_in_progress" | "connector.provider_failed" | "connector.provider_unavailable" | "connector.replacement_required" | "connector.revocation_pending" | "dataset.change_refused" | "dataset.not_found" | "dataset.version_incompatible" | "dataset.version_not_found" | "dataset.version_read_inconsistent" | "event.delivery_failed" | "internal.unexpected" | "queue.enqueue_failed" | "object.not_found" | "object.unique_violation" | "pipeline.step_failed" | "projection.definition_invalid" | "projection.execution_failed" | "projection.not_found" | "projection.run_already_terminal" | "projection.run_identity_mismatch" | "runtime.cancelled" | "runtime.stopping" | "vector.model_unavailable" | "vector.response_invalid" | "vector.outcome_unknown" | "storage.unavailable" | "sync.execution_failed" | "webhook.delivery_failed" | "webhook.delivery_rejected" | "workflow.node_failed";
1983
+ message: string;
1984
+ retryable: boolean;
1985
+ details?: import("../schemas/common").JsonValue | undefined;
1986
+ httpStatus?: number | undefined;
1987
+ redacted?: true | undefined;
1988
+ truncated?: true | undefined;
1989
+ };
1990
+ kind: "error";
1991
+ } | undefined;
1992
+ } | {
1993
+ id: string;
1994
+ kind: "message" | "answer";
1995
+ type: "mail";
1996
+ text: string;
1997
+ from: "parent";
1998
+ inReplyTo?: string | undefined;
1999
+ afterAnswer?: true | undefined;
2000
+ })[];
2001
+ messageId: string;
2002
+ updatedAt: string;
2003
+ authorPrincipal: {
2004
+ id: string;
2005
+ type: "user" | "serviceAccount" | "system";
2006
+ };
2007
+ seq: number;
2008
+ locale?: string | undefined;
2009
+ timeZone?: string | undefined;
2010
+ spec?: {
2011
+ model?: {
2012
+ modelId: string;
2013
+ provider: string;
2014
+ } | undefined;
2015
+ approvalMode?: "manual" | "accept-edits" | "auto" | undefined;
2016
+ reasoning?: "none" | "provider-default" | "minimal" | "low" | "medium" | "high" | "xhigh" | "max" | {
2017
+ budgetTokens: number;
2018
+ } | undefined;
2019
+ } | undefined;
2020
+ immediate?: boolean | undefined;
2021
+ replacesMessageId?: string | undefined;
2022
+ } | undefined;
2023
+ } | {
2024
+ readonly error: string;
2025
+ readonly code: AgentRequestErrorCode;
2026
+ } | {
2027
+ readonly error: string;
2028
+ readonly code: "invalid_state" | "inbox_limit";
2029
+ } | {
2030
+ error: string;
2031
+ };
2032
+ 404: {
2033
+ error: string;
2034
+ };
2035
+ 403: {
2036
+ error: string;
2037
+ code?: string | undefined;
2038
+ };
2039
+ 409: {
2040
+ error: string;
2041
+ code?: string | undefined;
2042
+ };
2043
+ 400: {
2044
+ error: string;
2045
+ code?: string | undefined;
2046
+ };
2047
+ 429: {
2048
+ error: string;
2049
+ code: "ai.usage_limit_exceeded" | "ai.usage_limit_unavailable";
2050
+ details?: import("../schemas/common").JsonValue | undefined;
2051
+ };
2052
+ 501: {
2053
+ error: string;
2054
+ };
2055
+ 202: {
2056
+ run?: {
2057
+ status: "succeeded" | "failed" | "cancelled" | "running" | "queued";
2058
+ projectId: string;
2059
+ id: string;
2060
+ kind: "conversation" | "subagent";
2061
+ threadId: string;
2062
+ createdAt: string;
2063
+ attempt: number;
2064
+ triggerMessageId: string;
2065
+ streamId: string;
2066
+ error?: import("@sixb/core").SixbFailure<"agent.context_limit_exceeded" | "agent.execution_failed" | "agent.step_limit_reached" | "ai.usage_limit_exceeded" | "ai.usage_limit_unavailable" | "internal.unexpected" | "runtime.cancelled"> | undefined;
2067
+ model?: {
2068
+ modelId: string;
2069
+ provider: string;
2070
+ } | undefined;
2071
+ requestedBy?: {
2072
+ id: string;
2073
+ type: "user" | "serviceAccount";
2074
+ } | undefined;
2075
+ modelId?: string | undefined;
2076
+ startedAt?: string | undefined;
2077
+ completedAt?: string | undefined;
2078
+ approvalMode?: "manual" | "accept-edits" | "auto" | undefined;
2079
+ tier?: "light" | "standard" | "heavy" | undefined;
2080
+ reasoning?: "none" | "provider-default" | "minimal" | "low" | "medium" | "high" | "xhigh" | "max" | {
2081
+ budgetTokens: number;
2082
+ } | undefined;
2083
+ usage?: {
2084
+ reportingStatus: "partial" | "complete" | "unavailable";
2085
+ inputTokens?: number | undefined;
2086
+ outputTokens?: number | undefined;
2087
+ totalTokens?: number | undefined;
2088
+ uncachedInputTokens?: number | undefined;
2089
+ cacheReadInputTokens?: number | undefined;
2090
+ cacheWriteInputTokens?: number | undefined;
2091
+ textOutputTokens?: number | undefined;
2092
+ reasoningOutputTokens?: number | undefined;
2093
+ audioDurationMs?: number | undefined;
2094
+ imageOutputTokens?: number | undefined;
2095
+ audioOutputTokens?: number | undefined;
2096
+ outputImages?: number | undefined;
2097
+ inputCharacters?: number | undefined;
2098
+ } | undefined;
2099
+ cost?: {
2100
+ amounts: {
2101
+ currency: string;
1640
2102
  amountNanos: string;
1641
2103
  }[];
1642
2104
  ratedCallCount: number;
@@ -1645,6 +2107,10 @@ export declare function registerAgentRoutes(app: Elysia, host: SixbHostView): El
1645
2107
  } | undefined;
1646
2108
  finishReason?: "error" | "length" | "unknown" | "stop" | "content-filter" | "tool-calls" | "timeout" | "interrupted" | "awaiting_approval" | "awaiting_answer" | "other" | undefined;
1647
2109
  parentRunId?: string | undefined;
2110
+ computer?: {
2111
+ id: string;
2112
+ folder: string;
2113
+ } | undefined;
1648
2114
  runsOn?: "computer" | undefined;
1649
2115
  diagnostics?: {
1650
2116
  code: "step_limit_reached" | "output_limit_reached";
@@ -1652,16 +2118,1192 @@ export declare function registerAgentRoutes(app: Elysia, host: SixbHostView): El
1652
2118
  severity: "error" | "warning";
1653
2119
  scope: "run";
1654
2120
  }[] | undefined;
2121
+ } | undefined;
2122
+ item?: {
2123
+ projectId: string;
2124
+ id: string;
2125
+ mode: "steer" | "queue";
2126
+ threadId: string;
2127
+ createdAt: string;
2128
+ parts: ({
2129
+ origin: "ambient" | "explicit";
2130
+ context: {
2131
+ kind: "object";
2132
+ ref: {
2133
+ objectTypeId: string;
2134
+ primaryId: string;
2135
+ };
2136
+ label?: string | undefined;
2137
+ } | {
2138
+ id: string;
2139
+ kind: "app-state";
2140
+ value: import("../schemas/common").JsonValue;
2141
+ description: string;
2142
+ label: string;
2143
+ };
2144
+ type: "context";
2145
+ } | {
2146
+ type: "text";
2147
+ text: string;
2148
+ providerMetadata?: import("../schemas/common").JsonValue | undefined;
2149
+ } | {
2150
+ type: "reasoning";
2151
+ text: string;
2152
+ providerMetadata?: import("../schemas/common").JsonValue | undefined;
2153
+ } | {
2154
+ type: "step-start";
2155
+ } | {
2156
+ type: "file";
2157
+ fileRef: {
2158
+ blobId: string;
2159
+ digest: string;
2160
+ sizeBytes: number;
2161
+ fileName?: string | undefined;
2162
+ mediaType?: string | undefined;
2163
+ logicalPath?: string | undefined;
2164
+ };
2165
+ providerMetadata?: import("../schemas/common").JsonValue | undefined;
2166
+ } | {
2167
+ type: "provider-state";
2168
+ providerId: string;
2169
+ data: import("../schemas/common").JsonValue;
2170
+ } | {
2171
+ type: "tool-call";
2172
+ input: import("../schemas/common").JsonValue;
2173
+ output: import("../schemas/common").JsonValue;
2174
+ toolCallId: string;
2175
+ toolName: string;
2176
+ state: "output-available";
2177
+ providerMetadata?: import("../schemas/common").JsonValue | undefined;
2178
+ dynamic?: boolean | undefined;
2179
+ providerExecuted?: boolean | undefined;
2180
+ outputFile?: {
2181
+ path: string;
2182
+ fileRef: {
2183
+ blobId: string;
2184
+ digest: string;
2185
+ sizeBytes: number;
2186
+ fileName?: string | undefined;
2187
+ mediaType?: string | undefined;
2188
+ logicalPath?: string | undefined;
2189
+ };
2190
+ } | undefined;
2191
+ } | {
2192
+ type: "tool-call";
2193
+ input: import("../schemas/common").JsonValue;
2194
+ toolCallId: string;
2195
+ toolName: string;
2196
+ state: "output-error";
2197
+ errorText: string;
2198
+ providerMetadata?: import("../schemas/common").JsonValue | undefined;
2199
+ dynamic?: boolean | undefined;
2200
+ providerExecuted?: boolean | undefined;
2201
+ } | {
2202
+ type: "continuation";
2203
+ } | {
2204
+ status: "approved" | "denied" | "cancelled" | "superseded" | "expired";
2205
+ type: "approval-outcome";
2206
+ call: {
2207
+ kind: "action";
2208
+ actionId: string;
2209
+ subject: {
2210
+ kind: "none";
2211
+ } | {
2212
+ kind: "object";
2213
+ objectTypeId: string;
2214
+ primaryId: string;
2215
+ };
2216
+ } | {
2217
+ kind: "workflow";
2218
+ workflowId: string;
2219
+ };
2220
+ approvalId: string;
2221
+ caller?: {
2222
+ runId: string;
2223
+ key: string;
2224
+ continues?: true | undefined;
2225
+ } | undefined;
2226
+ outcome?: {
2227
+ status: "succeeded" | "failed";
2228
+ kind: "action-run";
2229
+ runId: string;
2230
+ error?: import("@sixb/core").ActionRunFailure<"validation" | "writeback" | "edits" | "effects" | "commit"> | undefined;
2231
+ } | {
2232
+ kind: "workflow-run";
2233
+ runId: string;
2234
+ queuedAt: string;
2235
+ } | {
2236
+ error: {
2237
+ at: string;
2238
+ code: "action.phase_failed" | "action.read_conflict" | "action.rejected" | "action.run_in_progress" | "action.timeout" | "agent.approval_authority_lost" | "agent.context_limit_exceeded" | "agent.execution_failed" | "agent.step_limit_reached" | "ai.usage_limit_exceeded" | "ai.usage_limit_unavailable" | "connector.adapter_invalid" | "connector.authorization_invalid" | "connector.authorization_required" | "connector.configuration_invalid" | "connector.credentials_unavailable" | "connector.not_found" | "connector.operation_conflict" | "connector.operation_in_progress" | "connector.provider_failed" | "connector.provider_unavailable" | "connector.replacement_required" | "connector.revocation_pending" | "dataset.change_refused" | "dataset.not_found" | "dataset.version_incompatible" | "dataset.version_not_found" | "dataset.version_read_inconsistent" | "event.delivery_failed" | "internal.unexpected" | "queue.enqueue_failed" | "object.not_found" | "object.unique_violation" | "pipeline.step_failed" | "projection.definition_invalid" | "projection.execution_failed" | "projection.not_found" | "projection.run_already_terminal" | "projection.run_identity_mismatch" | "runtime.cancelled" | "runtime.stopping" | "vector.model_unavailable" | "vector.response_invalid" | "vector.outcome_unknown" | "storage.unavailable" | "sync.execution_failed" | "webhook.delivery_failed" | "webhook.delivery_rejected" | "workflow.node_failed";
2239
+ message: string;
2240
+ retryable: boolean;
2241
+ details?: import("../schemas/common").JsonValue | undefined;
2242
+ httpStatus?: number | undefined;
2243
+ redacted?: true | undefined;
2244
+ truncated?: true | undefined;
2245
+ };
2246
+ kind: "error";
2247
+ } | undefined;
2248
+ } | {
2249
+ id: string;
2250
+ kind: "message" | "answer";
2251
+ type: "mail";
2252
+ text: string;
2253
+ from: "parent";
2254
+ inReplyTo?: string | undefined;
2255
+ afterAnswer?: true | undefined;
2256
+ })[];
2257
+ messageId: string;
2258
+ updatedAt: string;
2259
+ authorPrincipal: {
2260
+ id: string;
2261
+ type: "user" | "serviceAccount" | "system";
2262
+ };
2263
+ seq: number;
2264
+ locale?: string | undefined;
2265
+ timeZone?: string | undefined;
2266
+ spec?: {
2267
+ model?: {
2268
+ modelId: string;
2269
+ provider: string;
2270
+ } | undefined;
2271
+ approvalMode?: "manual" | "accept-edits" | "auto" | undefined;
2272
+ reasoning?: "none" | "provider-default" | "minimal" | "low" | "medium" | "high" | "xhigh" | "max" | {
2273
+ budgetTokens: number;
2274
+ } | undefined;
2275
+ } | undefined;
2276
+ immediate?: boolean | undefined;
2277
+ replacesMessageId?: string | undefined;
2278
+ } | undefined;
2279
+ };
2280
+ 422: {
2281
+ type: "validation";
2282
+ on: string;
2283
+ summary?: string;
2284
+ message?: string;
2285
+ found?: unknown;
2286
+ property?: string;
2287
+ expected?: string;
2288
+ };
2289
+ };
2290
+ };
2291
+ };
2292
+ };
2293
+ };
2294
+ };
2295
+ } & {
2296
+ api: {
2297
+ "agent-threads": {
2298
+ ":threadId": {
2299
+ inbox: {
2300
+ get: {
2301
+ body: unknown;
2302
+ params: {
2303
+ threadId: string;
2304
+ };
2305
+ query: unknown;
2306
+ headers: unknown;
2307
+ response: {
2308
+ 200: {
2309
+ items: {
2310
+ projectId: string;
2311
+ id: string;
2312
+ mode: "steer" | "queue";
2313
+ threadId: string;
2314
+ createdAt: string;
2315
+ parts: ({
2316
+ origin: "ambient" | "explicit";
2317
+ context: {
2318
+ kind: "object";
2319
+ ref: {
2320
+ objectTypeId: string;
2321
+ primaryId: string;
2322
+ };
2323
+ label?: string | undefined;
2324
+ } | {
2325
+ id: string;
2326
+ kind: "app-state";
2327
+ value: import("../schemas/common").JsonValue;
2328
+ description: string;
2329
+ label: string;
2330
+ };
2331
+ type: "context";
2332
+ } | {
2333
+ type: "text";
2334
+ text: string;
2335
+ providerMetadata?: import("../schemas/common").JsonValue | undefined;
2336
+ } | {
2337
+ type: "reasoning";
2338
+ text: string;
2339
+ providerMetadata?: import("../schemas/common").JsonValue | undefined;
2340
+ } | {
2341
+ type: "step-start";
2342
+ } | {
2343
+ type: "file";
2344
+ fileRef: {
2345
+ blobId: string;
2346
+ digest: string;
2347
+ sizeBytes: number;
2348
+ fileName?: string | undefined;
2349
+ mediaType?: string | undefined;
2350
+ logicalPath?: string | undefined;
2351
+ };
2352
+ providerMetadata?: import("../schemas/common").JsonValue | undefined;
2353
+ } | {
2354
+ type: "provider-state";
2355
+ providerId: string;
2356
+ data: import("../schemas/common").JsonValue;
2357
+ } | {
2358
+ type: "tool-call";
2359
+ input: import("../schemas/common").JsonValue;
2360
+ output: import("../schemas/common").JsonValue;
2361
+ toolCallId: string;
2362
+ toolName: string;
2363
+ state: "output-available";
2364
+ providerMetadata?: import("../schemas/common").JsonValue | undefined;
2365
+ dynamic?: boolean | undefined;
2366
+ providerExecuted?: boolean | undefined;
2367
+ outputFile?: {
2368
+ path: string;
2369
+ fileRef: {
2370
+ blobId: string;
2371
+ digest: string;
2372
+ sizeBytes: number;
2373
+ fileName?: string | undefined;
2374
+ mediaType?: string | undefined;
2375
+ logicalPath?: string | undefined;
2376
+ };
2377
+ } | undefined;
2378
+ } | {
2379
+ type: "tool-call";
2380
+ input: import("../schemas/common").JsonValue;
2381
+ toolCallId: string;
2382
+ toolName: string;
2383
+ state: "output-error";
2384
+ errorText: string;
2385
+ providerMetadata?: import("../schemas/common").JsonValue | undefined;
2386
+ dynamic?: boolean | undefined;
2387
+ providerExecuted?: boolean | undefined;
2388
+ } | {
2389
+ type: "continuation";
2390
+ } | {
2391
+ status: "approved" | "denied" | "cancelled" | "superseded" | "expired";
2392
+ type: "approval-outcome";
2393
+ call: {
2394
+ kind: "action";
2395
+ actionId: string;
2396
+ subject: {
2397
+ kind: "none";
2398
+ } | {
2399
+ kind: "object";
2400
+ objectTypeId: string;
2401
+ primaryId: string;
2402
+ };
2403
+ } | {
2404
+ kind: "workflow";
2405
+ workflowId: string;
2406
+ };
2407
+ approvalId: string;
2408
+ caller?: {
2409
+ runId: string;
2410
+ key: string;
2411
+ continues?: true | undefined;
2412
+ } | undefined;
2413
+ outcome?: {
2414
+ status: "succeeded" | "failed";
2415
+ kind: "action-run";
2416
+ runId: string;
2417
+ error?: import("@sixb/core").ActionRunFailure<"validation" | "writeback" | "edits" | "effects" | "commit"> | undefined;
2418
+ } | {
2419
+ kind: "workflow-run";
2420
+ runId: string;
2421
+ queuedAt: string;
2422
+ } | {
2423
+ error: {
2424
+ at: string;
2425
+ code: "action.phase_failed" | "action.read_conflict" | "action.rejected" | "action.run_in_progress" | "action.timeout" | "agent.approval_authority_lost" | "agent.context_limit_exceeded" | "agent.execution_failed" | "agent.step_limit_reached" | "ai.usage_limit_exceeded" | "ai.usage_limit_unavailable" | "connector.adapter_invalid" | "connector.authorization_invalid" | "connector.authorization_required" | "connector.configuration_invalid" | "connector.credentials_unavailable" | "connector.not_found" | "connector.operation_conflict" | "connector.operation_in_progress" | "connector.provider_failed" | "connector.provider_unavailable" | "connector.replacement_required" | "connector.revocation_pending" | "dataset.change_refused" | "dataset.not_found" | "dataset.version_incompatible" | "dataset.version_not_found" | "dataset.version_read_inconsistent" | "event.delivery_failed" | "internal.unexpected" | "queue.enqueue_failed" | "object.not_found" | "object.unique_violation" | "pipeline.step_failed" | "projection.definition_invalid" | "projection.execution_failed" | "projection.not_found" | "projection.run_already_terminal" | "projection.run_identity_mismatch" | "runtime.cancelled" | "runtime.stopping" | "vector.model_unavailable" | "vector.response_invalid" | "vector.outcome_unknown" | "storage.unavailable" | "sync.execution_failed" | "webhook.delivery_failed" | "webhook.delivery_rejected" | "workflow.node_failed";
2426
+ message: string;
2427
+ retryable: boolean;
2428
+ details?: import("../schemas/common").JsonValue | undefined;
2429
+ httpStatus?: number | undefined;
2430
+ redacted?: true | undefined;
2431
+ truncated?: true | undefined;
2432
+ };
2433
+ kind: "error";
2434
+ } | undefined;
2435
+ } | {
2436
+ id: string;
2437
+ kind: "message" | "answer";
2438
+ type: "mail";
2439
+ text: string;
2440
+ from: "parent";
2441
+ inReplyTo?: string | undefined;
2442
+ afterAnswer?: true | undefined;
2443
+ })[];
2444
+ messageId: string;
2445
+ updatedAt: string;
2446
+ authorPrincipal: {
2447
+ id: string;
2448
+ type: "user" | "serviceAccount" | "system";
2449
+ };
2450
+ seq: number;
2451
+ locale?: string | undefined;
2452
+ timeZone?: string | undefined;
2453
+ spec?: {
2454
+ model?: {
2455
+ modelId: string;
2456
+ provider: string;
2457
+ } | undefined;
2458
+ approvalMode?: "manual" | "accept-edits" | "auto" | undefined;
2459
+ reasoning?: "none" | "provider-default" | "minimal" | "low" | "medium" | "high" | "xhigh" | "max" | {
2460
+ budgetTokens: number;
2461
+ } | undefined;
2462
+ } | undefined;
2463
+ immediate?: boolean | undefined;
2464
+ replacesMessageId?: string | undefined;
2465
+ }[];
2466
+ };
2467
+ 404: {
2468
+ error: string;
2469
+ };
2470
+ 400: {
2471
+ error: string;
2472
+ code?: string | undefined;
2473
+ };
2474
+ 501: {
2475
+ error: string;
2476
+ };
2477
+ 422: {
2478
+ type: "validation";
2479
+ on: string;
2480
+ summary?: string;
2481
+ message?: string;
2482
+ found?: unknown;
2483
+ property?: string;
2484
+ expected?: string;
2485
+ };
2486
+ };
2487
+ };
2488
+ };
2489
+ };
2490
+ };
2491
+ };
2492
+ } & {
2493
+ api: {
2494
+ "agent-threads": {
2495
+ ":threadId": {
2496
+ inbox: {
2497
+ ":itemId": {
2498
+ patch: {
2499
+ body: {
2500
+ model?: {
2501
+ modelId: string;
2502
+ provider: string;
2503
+ } | undefined;
2504
+ text?: string | undefined;
2505
+ approvalMode?: "manual" | "accept-edits" | "auto" | undefined;
2506
+ reasoning?: "none" | "provider-default" | "minimal" | "low" | "medium" | "high" | "xhigh" | "max" | {
2507
+ budgetTokens: number;
2508
+ } | undefined;
2509
+ delivery?: "steer" | "queue" | undefined;
2510
+ immediate?: true | undefined;
2511
+ };
2512
+ params: {
2513
+ threadId: string;
2514
+ itemId: string;
2515
+ };
2516
+ query: unknown;
2517
+ headers: unknown;
2518
+ response: {
2519
+ 200: {
2520
+ item: {
2521
+ projectId: string;
2522
+ id: string;
2523
+ mode: "steer" | "queue";
2524
+ threadId: string;
2525
+ createdAt: string;
2526
+ parts: ({
2527
+ origin: "ambient" | "explicit";
2528
+ context: {
2529
+ kind: "object";
2530
+ ref: {
2531
+ objectTypeId: string;
2532
+ primaryId: string;
2533
+ };
2534
+ label?: string | undefined;
2535
+ } | {
2536
+ id: string;
2537
+ kind: "app-state";
2538
+ value: import("../schemas/common").JsonValue;
2539
+ description: string;
2540
+ label: string;
2541
+ };
2542
+ type: "context";
2543
+ } | {
2544
+ type: "text";
2545
+ text: string;
2546
+ providerMetadata?: import("../schemas/common").JsonValue | undefined;
2547
+ } | {
2548
+ type: "reasoning";
2549
+ text: string;
2550
+ providerMetadata?: import("../schemas/common").JsonValue | undefined;
2551
+ } | {
2552
+ type: "step-start";
2553
+ } | {
2554
+ type: "file";
2555
+ fileRef: {
2556
+ blobId: string;
2557
+ digest: string;
2558
+ sizeBytes: number;
2559
+ fileName?: string | undefined;
2560
+ mediaType?: string | undefined;
2561
+ logicalPath?: string | undefined;
2562
+ };
2563
+ providerMetadata?: import("../schemas/common").JsonValue | undefined;
2564
+ } | {
2565
+ type: "provider-state";
2566
+ providerId: string;
2567
+ data: import("../schemas/common").JsonValue;
2568
+ } | {
2569
+ type: "tool-call";
2570
+ input: import("../schemas/common").JsonValue;
2571
+ output: import("../schemas/common").JsonValue;
2572
+ toolCallId: string;
2573
+ toolName: string;
2574
+ state: "output-available";
2575
+ providerMetadata?: import("../schemas/common").JsonValue | undefined;
2576
+ dynamic?: boolean | undefined;
2577
+ providerExecuted?: boolean | undefined;
2578
+ outputFile?: {
2579
+ path: string;
2580
+ fileRef: {
2581
+ blobId: string;
2582
+ digest: string;
2583
+ sizeBytes: number;
2584
+ fileName?: string | undefined;
2585
+ mediaType?: string | undefined;
2586
+ logicalPath?: string | undefined;
2587
+ };
2588
+ } | undefined;
2589
+ } | {
2590
+ type: "tool-call";
2591
+ input: import("../schemas/common").JsonValue;
2592
+ toolCallId: string;
2593
+ toolName: string;
2594
+ state: "output-error";
2595
+ errorText: string;
2596
+ providerMetadata?: import("../schemas/common").JsonValue | undefined;
2597
+ dynamic?: boolean | undefined;
2598
+ providerExecuted?: boolean | undefined;
2599
+ } | {
2600
+ type: "continuation";
2601
+ } | {
2602
+ status: "approved" | "denied" | "cancelled" | "superseded" | "expired";
2603
+ type: "approval-outcome";
2604
+ call: {
2605
+ kind: "action";
2606
+ actionId: string;
2607
+ subject: {
2608
+ kind: "none";
2609
+ } | {
2610
+ kind: "object";
2611
+ objectTypeId: string;
2612
+ primaryId: string;
2613
+ };
2614
+ } | {
2615
+ kind: "workflow";
2616
+ workflowId: string;
2617
+ };
2618
+ approvalId: string;
2619
+ caller?: {
2620
+ runId: string;
2621
+ key: string;
2622
+ continues?: true | undefined;
2623
+ } | undefined;
2624
+ outcome?: {
2625
+ status: "succeeded" | "failed";
2626
+ kind: "action-run";
2627
+ runId: string;
2628
+ error?: import("@sixb/core").ActionRunFailure<"validation" | "writeback" | "edits" | "effects" | "commit"> | undefined;
2629
+ } | {
2630
+ kind: "workflow-run";
2631
+ runId: string;
2632
+ queuedAt: string;
2633
+ } | {
2634
+ error: {
2635
+ at: string;
2636
+ code: "action.phase_failed" | "action.read_conflict" | "action.rejected" | "action.run_in_progress" | "action.timeout" | "agent.approval_authority_lost" | "agent.context_limit_exceeded" | "agent.execution_failed" | "agent.step_limit_reached" | "ai.usage_limit_exceeded" | "ai.usage_limit_unavailable" | "connector.adapter_invalid" | "connector.authorization_invalid" | "connector.authorization_required" | "connector.configuration_invalid" | "connector.credentials_unavailable" | "connector.not_found" | "connector.operation_conflict" | "connector.operation_in_progress" | "connector.provider_failed" | "connector.provider_unavailable" | "connector.replacement_required" | "connector.revocation_pending" | "dataset.change_refused" | "dataset.not_found" | "dataset.version_incompatible" | "dataset.version_not_found" | "dataset.version_read_inconsistent" | "event.delivery_failed" | "internal.unexpected" | "queue.enqueue_failed" | "object.not_found" | "object.unique_violation" | "pipeline.step_failed" | "projection.definition_invalid" | "projection.execution_failed" | "projection.not_found" | "projection.run_already_terminal" | "projection.run_identity_mismatch" | "runtime.cancelled" | "runtime.stopping" | "vector.model_unavailable" | "vector.response_invalid" | "vector.outcome_unknown" | "storage.unavailable" | "sync.execution_failed" | "webhook.delivery_failed" | "webhook.delivery_rejected" | "workflow.node_failed";
2637
+ message: string;
2638
+ retryable: boolean;
2639
+ details?: import("../schemas/common").JsonValue | undefined;
2640
+ httpStatus?: number | undefined;
2641
+ redacted?: true | undefined;
2642
+ truncated?: true | undefined;
2643
+ };
2644
+ kind: "error";
2645
+ } | undefined;
2646
+ } | {
2647
+ id: string;
2648
+ kind: "message" | "answer";
2649
+ type: "mail";
2650
+ text: string;
2651
+ from: "parent";
2652
+ inReplyTo?: string | undefined;
2653
+ afterAnswer?: true | undefined;
2654
+ })[];
2655
+ messageId: string;
2656
+ updatedAt: string;
2657
+ authorPrincipal: {
2658
+ id: string;
2659
+ type: "user" | "serviceAccount" | "system";
2660
+ };
2661
+ seq: number;
2662
+ locale?: string | undefined;
2663
+ timeZone?: string | undefined;
2664
+ spec?: {
2665
+ model?: {
2666
+ modelId: string;
2667
+ provider: string;
2668
+ } | undefined;
2669
+ approvalMode?: "manual" | "accept-edits" | "auto" | undefined;
2670
+ reasoning?: "none" | "provider-default" | "minimal" | "low" | "medium" | "high" | "xhigh" | "max" | {
2671
+ budgetTokens: number;
2672
+ } | undefined;
2673
+ } | undefined;
2674
+ immediate?: boolean | undefined;
2675
+ replacesMessageId?: string | undefined;
2676
+ };
2677
+ };
2678
+ 404: {
2679
+ error: string;
2680
+ };
2681
+ 403: {
2682
+ error: string;
2683
+ code?: string | undefined;
2684
+ };
2685
+ 409: {
2686
+ error: string;
2687
+ code?: string | undefined;
2688
+ };
2689
+ 400: {
2690
+ error: string;
2691
+ code?: string | undefined;
2692
+ };
2693
+ 501: {
2694
+ error: string;
2695
+ };
2696
+ 422: {
2697
+ type: "validation";
2698
+ on: string;
2699
+ summary?: string;
2700
+ message?: string;
2701
+ found?: unknown;
2702
+ property?: string;
2703
+ expected?: string;
2704
+ };
2705
+ };
2706
+ };
2707
+ };
2708
+ };
2709
+ };
2710
+ };
2711
+ };
2712
+ } & {
2713
+ api: {
2714
+ "agent-threads": {
2715
+ ":threadId": {
2716
+ inbox: {
2717
+ ":itemId": {
2718
+ delete: {
2719
+ body: unknown;
2720
+ params: {
2721
+ threadId: string;
2722
+ itemId: string;
2723
+ };
2724
+ query: unknown;
2725
+ headers: unknown;
2726
+ response: {
2727
+ 404: {
2728
+ error: string;
2729
+ };
2730
+ 403: {
2731
+ error: string;
2732
+ code?: string | undefined;
2733
+ };
2734
+ 409: {
2735
+ error: string;
2736
+ code?: string | undefined;
2737
+ };
2738
+ 400: {
2739
+ error: string;
2740
+ code?: string | undefined;
2741
+ };
2742
+ 501: {
2743
+ error: string;
2744
+ };
2745
+ 204: void;
2746
+ 422: {
2747
+ type: "validation";
2748
+ on: string;
2749
+ summary?: string;
2750
+ message?: string;
2751
+ found?: unknown;
2752
+ property?: string;
2753
+ expected?: string;
2754
+ };
2755
+ };
2756
+ };
2757
+ };
2758
+ };
2759
+ };
2760
+ };
2761
+ };
2762
+ } & {
2763
+ api: {
2764
+ "agent-threads": {
2765
+ ":threadId": {
2766
+ messages: {
2767
+ ":messageId": {
2768
+ edit: {
2769
+ post: {
2770
+ body: {
2771
+ model?: {
2772
+ modelId: string;
2773
+ provider: string;
2774
+ } | undefined;
2775
+ locale?: string | undefined;
2776
+ timeZone?: string | undefined;
2777
+ context?: {
2778
+ origin: "ambient" | "explicit";
2779
+ context: {
2780
+ kind: "object";
2781
+ ref: {
2782
+ objectTypeId: string;
2783
+ primaryId: string;
2784
+ };
2785
+ label?: string | undefined;
2786
+ } | {
2787
+ id: string;
2788
+ kind: "app-state";
2789
+ value: import("../schemas/common").JsonValue;
2790
+ description: string;
2791
+ label: string;
2792
+ };
2793
+ }[] | undefined;
2794
+ text?: string | undefined;
2795
+ approvalMode?: "manual" | "accept-edits" | "auto" | undefined;
2796
+ attachments?: {
2797
+ blobId: string;
2798
+ digest: string;
2799
+ sizeBytes: number;
2800
+ fileName?: string | undefined;
2801
+ mediaType?: string | undefined;
2802
+ logicalPath?: string | undefined;
2803
+ }[] | undefined;
2804
+ reasoning?: "none" | "provider-default" | "minimal" | "low" | "medium" | "high" | "xhigh" | "max" | {
2805
+ budgetTokens: number;
2806
+ } | undefined;
2807
+ nextMessageId?: string | undefined;
2808
+ };
2809
+ params: {
2810
+ threadId: string;
2811
+ messageId: string;
2812
+ };
2813
+ query: unknown;
2814
+ headers: unknown;
2815
+ response: {
2816
+ 200: {
2817
+ run?: {
2818
+ status: "succeeded" | "failed" | "cancelled" | "running" | "queued";
2819
+ projectId: string;
2820
+ id: string;
2821
+ kind: "conversation" | "subagent";
2822
+ threadId: string;
2823
+ createdAt: string;
2824
+ attempt: number;
2825
+ triggerMessageId: string;
2826
+ streamId: string;
2827
+ error?: import("@sixb/core").SixbFailure<"agent.context_limit_exceeded" | "agent.execution_failed" | "agent.step_limit_reached" | "ai.usage_limit_exceeded" | "ai.usage_limit_unavailable" | "internal.unexpected" | "runtime.cancelled"> | undefined;
2828
+ model?: {
2829
+ modelId: string;
2830
+ provider: string;
2831
+ } | undefined;
2832
+ requestedBy?: {
2833
+ id: string;
2834
+ type: "user" | "serviceAccount";
2835
+ } | undefined;
2836
+ modelId?: string | undefined;
2837
+ startedAt?: string | undefined;
2838
+ completedAt?: string | undefined;
2839
+ approvalMode?: "manual" | "accept-edits" | "auto" | undefined;
2840
+ tier?: "light" | "standard" | "heavy" | undefined;
2841
+ reasoning?: "none" | "provider-default" | "minimal" | "low" | "medium" | "high" | "xhigh" | "max" | {
2842
+ budgetTokens: number;
2843
+ } | undefined;
2844
+ usage?: {
2845
+ reportingStatus: "partial" | "complete" | "unavailable";
2846
+ inputTokens?: number | undefined;
2847
+ outputTokens?: number | undefined;
2848
+ totalTokens?: number | undefined;
2849
+ uncachedInputTokens?: number | undefined;
2850
+ cacheReadInputTokens?: number | undefined;
2851
+ cacheWriteInputTokens?: number | undefined;
2852
+ textOutputTokens?: number | undefined;
2853
+ reasoningOutputTokens?: number | undefined;
2854
+ audioDurationMs?: number | undefined;
2855
+ imageOutputTokens?: number | undefined;
2856
+ audioOutputTokens?: number | undefined;
2857
+ outputImages?: number | undefined;
2858
+ inputCharacters?: number | undefined;
2859
+ } | undefined;
2860
+ cost?: {
2861
+ amounts: {
2862
+ currency: string;
2863
+ amountNanos: string;
2864
+ }[];
2865
+ ratedCallCount: number;
2866
+ unpriceableCallCount: number;
2867
+ unvaluedCallCount: number;
2868
+ } | undefined;
2869
+ finishReason?: "error" | "length" | "unknown" | "stop" | "content-filter" | "tool-calls" | "timeout" | "interrupted" | "awaiting_approval" | "awaiting_answer" | "other" | undefined;
2870
+ parentRunId?: string | undefined;
2871
+ computer?: {
2872
+ id: string;
2873
+ folder: string;
2874
+ } | undefined;
2875
+ runsOn?: "computer" | undefined;
2876
+ diagnostics?: {
2877
+ code: "step_limit_reached" | "output_limit_reached";
2878
+ message: string;
2879
+ severity: "error" | "warning";
2880
+ scope: "run";
2881
+ }[] | undefined;
2882
+ } | undefined;
2883
+ item?: {
2884
+ projectId: string;
2885
+ id: string;
2886
+ mode: "steer" | "queue";
2887
+ threadId: string;
2888
+ createdAt: string;
2889
+ parts: ({
2890
+ origin: "ambient" | "explicit";
2891
+ context: {
2892
+ kind: "object";
2893
+ ref: {
2894
+ objectTypeId: string;
2895
+ primaryId: string;
2896
+ };
2897
+ label?: string | undefined;
2898
+ } | {
2899
+ id: string;
2900
+ kind: "app-state";
2901
+ value: import("../schemas/common").JsonValue;
2902
+ description: string;
2903
+ label: string;
2904
+ };
2905
+ type: "context";
2906
+ } | {
2907
+ type: "text";
2908
+ text: string;
2909
+ providerMetadata?: import("../schemas/common").JsonValue | undefined;
2910
+ } | {
2911
+ type: "reasoning";
2912
+ text: string;
2913
+ providerMetadata?: import("../schemas/common").JsonValue | undefined;
2914
+ } | {
2915
+ type: "step-start";
2916
+ } | {
2917
+ type: "file";
2918
+ fileRef: {
2919
+ blobId: string;
2920
+ digest: string;
2921
+ sizeBytes: number;
2922
+ fileName?: string | undefined;
2923
+ mediaType?: string | undefined;
2924
+ logicalPath?: string | undefined;
2925
+ };
2926
+ providerMetadata?: import("../schemas/common").JsonValue | undefined;
2927
+ } | {
2928
+ type: "provider-state";
2929
+ providerId: string;
2930
+ data: import("../schemas/common").JsonValue;
2931
+ } | {
2932
+ type: "tool-call";
2933
+ input: import("../schemas/common").JsonValue;
2934
+ output: import("../schemas/common").JsonValue;
2935
+ toolCallId: string;
2936
+ toolName: string;
2937
+ state: "output-available";
2938
+ providerMetadata?: import("../schemas/common").JsonValue | undefined;
2939
+ dynamic?: boolean | undefined;
2940
+ providerExecuted?: boolean | undefined;
2941
+ outputFile?: {
2942
+ path: string;
2943
+ fileRef: {
2944
+ blobId: string;
2945
+ digest: string;
2946
+ sizeBytes: number;
2947
+ fileName?: string | undefined;
2948
+ mediaType?: string | undefined;
2949
+ logicalPath?: string | undefined;
2950
+ };
2951
+ } | undefined;
2952
+ } | {
2953
+ type: "tool-call";
2954
+ input: import("../schemas/common").JsonValue;
2955
+ toolCallId: string;
2956
+ toolName: string;
2957
+ state: "output-error";
2958
+ errorText: string;
2959
+ providerMetadata?: import("../schemas/common").JsonValue | undefined;
2960
+ dynamic?: boolean | undefined;
2961
+ providerExecuted?: boolean | undefined;
2962
+ } | {
2963
+ type: "continuation";
2964
+ } | {
2965
+ status: "approved" | "denied" | "cancelled" | "superseded" | "expired";
2966
+ type: "approval-outcome";
2967
+ call: {
2968
+ kind: "action";
2969
+ actionId: string;
2970
+ subject: {
2971
+ kind: "none";
2972
+ } | {
2973
+ kind: "object";
2974
+ objectTypeId: string;
2975
+ primaryId: string;
2976
+ };
2977
+ } | {
2978
+ kind: "workflow";
2979
+ workflowId: string;
2980
+ };
2981
+ approvalId: string;
2982
+ caller?: {
2983
+ runId: string;
2984
+ key: string;
2985
+ continues?: true | undefined;
2986
+ } | undefined;
2987
+ outcome?: {
2988
+ status: "succeeded" | "failed";
2989
+ kind: "action-run";
2990
+ runId: string;
2991
+ error?: import("@sixb/core").ActionRunFailure<"validation" | "writeback" | "edits" | "effects" | "commit"> | undefined;
2992
+ } | {
2993
+ kind: "workflow-run";
2994
+ runId: string;
2995
+ queuedAt: string;
2996
+ } | {
2997
+ error: {
2998
+ at: string;
2999
+ code: "action.phase_failed" | "action.read_conflict" | "action.rejected" | "action.run_in_progress" | "action.timeout" | "agent.approval_authority_lost" | "agent.context_limit_exceeded" | "agent.execution_failed" | "agent.step_limit_reached" | "ai.usage_limit_exceeded" | "ai.usage_limit_unavailable" | "connector.adapter_invalid" | "connector.authorization_invalid" | "connector.authorization_required" | "connector.configuration_invalid" | "connector.credentials_unavailable" | "connector.not_found" | "connector.operation_conflict" | "connector.operation_in_progress" | "connector.provider_failed" | "connector.provider_unavailable" | "connector.replacement_required" | "connector.revocation_pending" | "dataset.change_refused" | "dataset.not_found" | "dataset.version_incompatible" | "dataset.version_not_found" | "dataset.version_read_inconsistent" | "event.delivery_failed" | "internal.unexpected" | "queue.enqueue_failed" | "object.not_found" | "object.unique_violation" | "pipeline.step_failed" | "projection.definition_invalid" | "projection.execution_failed" | "projection.not_found" | "projection.run_already_terminal" | "projection.run_identity_mismatch" | "runtime.cancelled" | "runtime.stopping" | "vector.model_unavailable" | "vector.response_invalid" | "vector.outcome_unknown" | "storage.unavailable" | "sync.execution_failed" | "webhook.delivery_failed" | "webhook.delivery_rejected" | "workflow.node_failed";
3000
+ message: string;
3001
+ retryable: boolean;
3002
+ details?: import("../schemas/common").JsonValue | undefined;
3003
+ httpStatus?: number | undefined;
3004
+ redacted?: true | undefined;
3005
+ truncated?: true | undefined;
3006
+ };
3007
+ kind: "error";
3008
+ } | undefined;
3009
+ } | {
3010
+ id: string;
3011
+ kind: "message" | "answer";
3012
+ type: "mail";
3013
+ text: string;
3014
+ from: "parent";
3015
+ inReplyTo?: string | undefined;
3016
+ afterAnswer?: true | undefined;
3017
+ })[];
3018
+ messageId: string;
3019
+ updatedAt: string;
3020
+ authorPrincipal: {
3021
+ id: string;
3022
+ type: "user" | "serviceAccount" | "system";
3023
+ };
3024
+ seq: number;
3025
+ locale?: string | undefined;
3026
+ timeZone?: string | undefined;
3027
+ spec?: {
3028
+ model?: {
3029
+ modelId: string;
3030
+ provider: string;
3031
+ } | undefined;
3032
+ approvalMode?: "manual" | "accept-edits" | "auto" | undefined;
3033
+ reasoning?: "none" | "provider-default" | "minimal" | "low" | "medium" | "high" | "xhigh" | "max" | {
3034
+ budgetTokens: number;
3035
+ } | undefined;
3036
+ } | undefined;
3037
+ immediate?: boolean | undefined;
3038
+ replacesMessageId?: string | undefined;
3039
+ } | undefined;
3040
+ } | {
3041
+ readonly error: string;
3042
+ readonly code: AgentRequestErrorCode;
3043
+ } | {
3044
+ readonly error: string;
3045
+ readonly code: "invalid_state" | "inbox_limit";
3046
+ } | {
3047
+ error: string;
3048
+ };
3049
+ 404: {
3050
+ error: string;
3051
+ };
3052
+ 403: {
3053
+ error: string;
3054
+ code?: string | undefined;
3055
+ };
3056
+ 409: {
3057
+ error: string;
3058
+ code?: string | undefined;
3059
+ };
3060
+ 400: {
3061
+ error: string;
3062
+ code?: string | undefined;
3063
+ };
3064
+ 429: {
3065
+ error: string;
3066
+ code: "ai.usage_limit_exceeded" | "ai.usage_limit_unavailable";
3067
+ details?: import("../schemas/common").JsonValue | undefined;
3068
+ };
3069
+ 501: {
3070
+ error: string;
3071
+ };
3072
+ 202: {
3073
+ run?: {
3074
+ status: "succeeded" | "failed" | "cancelled" | "running" | "queued";
3075
+ projectId: string;
3076
+ id: string;
3077
+ kind: "conversation" | "subagent";
3078
+ threadId: string;
3079
+ createdAt: string;
3080
+ attempt: number;
3081
+ triggerMessageId: string;
3082
+ streamId: string;
3083
+ error?: import("@sixb/core").SixbFailure<"agent.context_limit_exceeded" | "agent.execution_failed" | "agent.step_limit_reached" | "ai.usage_limit_exceeded" | "ai.usage_limit_unavailable" | "internal.unexpected" | "runtime.cancelled"> | undefined;
3084
+ model?: {
3085
+ modelId: string;
3086
+ provider: string;
3087
+ } | undefined;
3088
+ requestedBy?: {
3089
+ id: string;
3090
+ type: "user" | "serviceAccount";
3091
+ } | undefined;
3092
+ modelId?: string | undefined;
3093
+ startedAt?: string | undefined;
3094
+ completedAt?: string | undefined;
3095
+ approvalMode?: "manual" | "accept-edits" | "auto" | undefined;
3096
+ tier?: "light" | "standard" | "heavy" | undefined;
3097
+ reasoning?: "none" | "provider-default" | "minimal" | "low" | "medium" | "high" | "xhigh" | "max" | {
3098
+ budgetTokens: number;
3099
+ } | undefined;
3100
+ usage?: {
3101
+ reportingStatus: "partial" | "complete" | "unavailable";
3102
+ inputTokens?: number | undefined;
3103
+ outputTokens?: number | undefined;
3104
+ totalTokens?: number | undefined;
3105
+ uncachedInputTokens?: number | undefined;
3106
+ cacheReadInputTokens?: number | undefined;
3107
+ cacheWriteInputTokens?: number | undefined;
3108
+ textOutputTokens?: number | undefined;
3109
+ reasoningOutputTokens?: number | undefined;
3110
+ audioDurationMs?: number | undefined;
3111
+ imageOutputTokens?: number | undefined;
3112
+ audioOutputTokens?: number | undefined;
3113
+ outputImages?: number | undefined;
3114
+ inputCharacters?: number | undefined;
3115
+ } | undefined;
3116
+ cost?: {
3117
+ amounts: {
3118
+ currency: string;
3119
+ amountNanos: string;
3120
+ }[];
3121
+ ratedCallCount: number;
3122
+ unpriceableCallCount: number;
3123
+ unvaluedCallCount: number;
3124
+ } | undefined;
3125
+ finishReason?: "error" | "length" | "unknown" | "stop" | "content-filter" | "tool-calls" | "timeout" | "interrupted" | "awaiting_approval" | "awaiting_answer" | "other" | undefined;
3126
+ parentRunId?: string | undefined;
3127
+ computer?: {
3128
+ id: string;
3129
+ folder: string;
3130
+ } | undefined;
3131
+ runsOn?: "computer" | undefined;
3132
+ diagnostics?: {
3133
+ code: "step_limit_reached" | "output_limit_reached";
3134
+ message: string;
3135
+ severity: "error" | "warning";
3136
+ scope: "run";
3137
+ }[] | undefined;
3138
+ } | undefined;
3139
+ item?: {
3140
+ projectId: string;
3141
+ id: string;
3142
+ mode: "steer" | "queue";
3143
+ threadId: string;
3144
+ createdAt: string;
3145
+ parts: ({
3146
+ origin: "ambient" | "explicit";
3147
+ context: {
3148
+ kind: "object";
3149
+ ref: {
3150
+ objectTypeId: string;
3151
+ primaryId: string;
3152
+ };
3153
+ label?: string | undefined;
3154
+ } | {
3155
+ id: string;
3156
+ kind: "app-state";
3157
+ value: import("../schemas/common").JsonValue;
3158
+ description: string;
3159
+ label: string;
3160
+ };
3161
+ type: "context";
3162
+ } | {
3163
+ type: "text";
3164
+ text: string;
3165
+ providerMetadata?: import("../schemas/common").JsonValue | undefined;
3166
+ } | {
3167
+ type: "reasoning";
3168
+ text: string;
3169
+ providerMetadata?: import("../schemas/common").JsonValue | undefined;
3170
+ } | {
3171
+ type: "step-start";
3172
+ } | {
3173
+ type: "file";
3174
+ fileRef: {
3175
+ blobId: string;
3176
+ digest: string;
3177
+ sizeBytes: number;
3178
+ fileName?: string | undefined;
3179
+ mediaType?: string | undefined;
3180
+ logicalPath?: string | undefined;
3181
+ };
3182
+ providerMetadata?: import("../schemas/common").JsonValue | undefined;
3183
+ } | {
3184
+ type: "provider-state";
3185
+ providerId: string;
3186
+ data: import("../schemas/common").JsonValue;
3187
+ } | {
3188
+ type: "tool-call";
3189
+ input: import("../schemas/common").JsonValue;
3190
+ output: import("../schemas/common").JsonValue;
3191
+ toolCallId: string;
3192
+ toolName: string;
3193
+ state: "output-available";
3194
+ providerMetadata?: import("../schemas/common").JsonValue | undefined;
3195
+ dynamic?: boolean | undefined;
3196
+ providerExecuted?: boolean | undefined;
3197
+ outputFile?: {
3198
+ path: string;
3199
+ fileRef: {
3200
+ blobId: string;
3201
+ digest: string;
3202
+ sizeBytes: number;
3203
+ fileName?: string | undefined;
3204
+ mediaType?: string | undefined;
3205
+ logicalPath?: string | undefined;
3206
+ };
3207
+ } | undefined;
3208
+ } | {
3209
+ type: "tool-call";
3210
+ input: import("../schemas/common").JsonValue;
3211
+ toolCallId: string;
3212
+ toolName: string;
3213
+ state: "output-error";
3214
+ errorText: string;
3215
+ providerMetadata?: import("../schemas/common").JsonValue | undefined;
3216
+ dynamic?: boolean | undefined;
3217
+ providerExecuted?: boolean | undefined;
3218
+ } | {
3219
+ type: "continuation";
3220
+ } | {
3221
+ status: "approved" | "denied" | "cancelled" | "superseded" | "expired";
3222
+ type: "approval-outcome";
3223
+ call: {
3224
+ kind: "action";
3225
+ actionId: string;
3226
+ subject: {
3227
+ kind: "none";
3228
+ } | {
3229
+ kind: "object";
3230
+ objectTypeId: string;
3231
+ primaryId: string;
3232
+ };
3233
+ } | {
3234
+ kind: "workflow";
3235
+ workflowId: string;
3236
+ };
3237
+ approvalId: string;
3238
+ caller?: {
3239
+ runId: string;
3240
+ key: string;
3241
+ continues?: true | undefined;
3242
+ } | undefined;
3243
+ outcome?: {
3244
+ status: "succeeded" | "failed";
3245
+ kind: "action-run";
3246
+ runId: string;
3247
+ error?: import("@sixb/core").ActionRunFailure<"validation" | "writeback" | "edits" | "effects" | "commit"> | undefined;
3248
+ } | {
3249
+ kind: "workflow-run";
3250
+ runId: string;
3251
+ queuedAt: string;
3252
+ } | {
3253
+ error: {
3254
+ at: string;
3255
+ code: "action.phase_failed" | "action.read_conflict" | "action.rejected" | "action.run_in_progress" | "action.timeout" | "agent.approval_authority_lost" | "agent.context_limit_exceeded" | "agent.execution_failed" | "agent.step_limit_reached" | "ai.usage_limit_exceeded" | "ai.usage_limit_unavailable" | "connector.adapter_invalid" | "connector.authorization_invalid" | "connector.authorization_required" | "connector.configuration_invalid" | "connector.credentials_unavailable" | "connector.not_found" | "connector.operation_conflict" | "connector.operation_in_progress" | "connector.provider_failed" | "connector.provider_unavailable" | "connector.replacement_required" | "connector.revocation_pending" | "dataset.change_refused" | "dataset.not_found" | "dataset.version_incompatible" | "dataset.version_not_found" | "dataset.version_read_inconsistent" | "event.delivery_failed" | "internal.unexpected" | "queue.enqueue_failed" | "object.not_found" | "object.unique_violation" | "pipeline.step_failed" | "projection.definition_invalid" | "projection.execution_failed" | "projection.not_found" | "projection.run_already_terminal" | "projection.run_identity_mismatch" | "runtime.cancelled" | "runtime.stopping" | "vector.model_unavailable" | "vector.response_invalid" | "vector.outcome_unknown" | "storage.unavailable" | "sync.execution_failed" | "webhook.delivery_failed" | "webhook.delivery_rejected" | "workflow.node_failed";
3256
+ message: string;
3257
+ retryable: boolean;
3258
+ details?: import("../schemas/common").JsonValue | undefined;
3259
+ httpStatus?: number | undefined;
3260
+ redacted?: true | undefined;
3261
+ truncated?: true | undefined;
3262
+ };
3263
+ kind: "error";
3264
+ } | undefined;
3265
+ } | {
3266
+ id: string;
3267
+ kind: "message" | "answer";
3268
+ type: "mail";
3269
+ text: string;
3270
+ from: "parent";
3271
+ inReplyTo?: string | undefined;
3272
+ afterAnswer?: true | undefined;
3273
+ })[];
3274
+ messageId: string;
3275
+ updatedAt: string;
3276
+ authorPrincipal: {
3277
+ id: string;
3278
+ type: "user" | "serviceAccount" | "system";
3279
+ };
3280
+ seq: number;
3281
+ locale?: string | undefined;
3282
+ timeZone?: string | undefined;
3283
+ spec?: {
3284
+ model?: {
3285
+ modelId: string;
3286
+ provider: string;
3287
+ } | undefined;
3288
+ approvalMode?: "manual" | "accept-edits" | "auto" | undefined;
3289
+ reasoning?: "none" | "provider-default" | "minimal" | "low" | "medium" | "high" | "xhigh" | "max" | {
3290
+ budgetTokens: number;
3291
+ } | undefined;
3292
+ } | undefined;
3293
+ immediate?: boolean | undefined;
3294
+ replacesMessageId?: string | undefined;
3295
+ } | undefined;
3296
+ };
3297
+ 422: {
3298
+ type: "validation";
3299
+ on: string;
3300
+ summary?: string;
3301
+ message?: string;
3302
+ found?: unknown;
3303
+ property?: string;
3304
+ expected?: string;
3305
+ };
1655
3306
  };
1656
- };
1657
- 422: {
1658
- type: "validation";
1659
- on: string;
1660
- summary?: string;
1661
- message?: string;
1662
- found?: unknown;
1663
- property?: string;
1664
- expected?: string;
1665
3307
  };
1666
3308
  };
1667
3309
  };
@@ -1739,6 +3381,10 @@ export declare function registerAgentRoutes(app: Elysia, host: SixbHostView): El
1739
3381
  } | undefined;
1740
3382
  finishReason?: "error" | "length" | "unknown" | "stop" | "content-filter" | "tool-calls" | "timeout" | "interrupted" | "awaiting_approval" | "awaiting_answer" | "other" | undefined;
1741
3383
  parentRunId?: string | undefined;
3384
+ computer?: {
3385
+ id: string;
3386
+ folder: string;
3387
+ } | undefined;
1742
3388
  runsOn?: "computer" | undefined;
1743
3389
  diagnostics?: {
1744
3390
  code: "step_limit_reached" | "output_limit_reached";
@@ -1826,6 +3472,10 @@ export declare function registerAgentRoutes(app: Elysia, host: SixbHostView): El
1826
3472
  } | undefined;
1827
3473
  finishReason?: "error" | "length" | "unknown" | "stop" | "content-filter" | "tool-calls" | "timeout" | "interrupted" | "awaiting_approval" | "awaiting_answer" | "other" | undefined;
1828
3474
  parentRunId?: string | undefined;
3475
+ computer?: {
3476
+ id: string;
3477
+ folder: string;
3478
+ } | undefined;
1829
3479
  runsOn?: "computer" | undefined;
1830
3480
  diagnostics?: {
1831
3481
  code: "step_limit_reached" | "output_limit_reached";
@@ -1921,6 +3571,10 @@ export declare function registerAgentRoutes(app: Elysia, host: SixbHostView): El
1921
3571
  } | undefined;
1922
3572
  finishReason?: "error" | "length" | "unknown" | "stop" | "content-filter" | "tool-calls" | "timeout" | "interrupted" | "awaiting_approval" | "awaiting_answer" | "other" | undefined;
1923
3573
  parentRunId?: string | undefined;
3574
+ computer?: {
3575
+ id: string;
3576
+ folder: string;
3577
+ } | undefined;
1924
3578
  runsOn?: "computer" | undefined;
1925
3579
  diagnostics?: {
1926
3580
  code: "step_limit_reached" | "output_limit_reached";
@@ -2013,6 +3667,10 @@ export declare function registerAgentRoutes(app: Elysia, host: SixbHostView): El
2013
3667
  } | undefined;
2014
3668
  finishReason?: "error" | "length" | "unknown" | "stop" | "content-filter" | "tool-calls" | "timeout" | "interrupted" | "awaiting_approval" | "awaiting_answer" | "other" | undefined;
2015
3669
  parentRunId?: string | undefined;
3670
+ computer?: {
3671
+ id: string;
3672
+ folder: string;
3673
+ } | undefined;
2016
3674
  runsOn?: "computer" | undefined;
2017
3675
  diagnostics?: {
2018
3676
  code: "step_limit_reached" | "output_limit_reached";
@@ -2181,6 +3839,10 @@ export declare function registerAgentRoutes(app: Elysia, host: SixbHostView): El
2181
3839
  } | undefined;
2182
3840
  finishReason?: "error" | "length" | "unknown" | "stop" | "content-filter" | "tool-calls" | "timeout" | "interrupted" | "awaiting_approval" | "awaiting_answer" | "other" | undefined;
2183
3841
  parentRunId?: string | undefined;
3842
+ computer?: {
3843
+ id: string;
3844
+ folder: string;
3845
+ } | undefined;
2184
3846
  runsOn?: "computer" | undefined;
2185
3847
  diagnostics?: {
2186
3848
  code: "step_limit_reached" | "output_limit_reached";
@@ -2282,6 +3944,10 @@ export declare function registerAgentRoutes(app: Elysia, host: SixbHostView): El
2282
3944
  } | undefined;
2283
3945
  finishReason?: "error" | "length" | "unknown" | "stop" | "content-filter" | "tool-calls" | "timeout" | "interrupted" | "awaiting_approval" | "awaiting_answer" | "other" | undefined;
2284
3946
  parentRunId?: string | undefined;
3947
+ computer?: {
3948
+ id: string;
3949
+ folder: string;
3950
+ } | undefined;
2285
3951
  runsOn?: "computer" | undefined;
2286
3952
  diagnostics?: {
2287
3953
  code: "step_limit_reached" | "output_limit_reached";
@@ -2381,6 +4047,10 @@ export declare function registerAgentRoutes(app: Elysia, host: SixbHostView): El
2381
4047
  } | undefined;
2382
4048
  finishReason?: "error" | "length" | "unknown" | "stop" | "content-filter" | "tool-calls" | "timeout" | "interrupted" | "awaiting_approval" | "awaiting_answer" | "other" | undefined;
2383
4049
  parentRunId?: string | undefined;
4050
+ computer?: {
4051
+ id: string;
4052
+ folder: string;
4053
+ } | undefined;
2384
4054
  runsOn?: "computer" | undefined;
2385
4055
  diagnostics?: {
2386
4056
  code: "step_limit_reached" | "output_limit_reached";
@@ -2468,6 +4138,10 @@ export declare function registerAgentRoutes(app: Elysia, host: SixbHostView): El
2468
4138
  } | undefined;
2469
4139
  finishReason?: "error" | "length" | "unknown" | "stop" | "content-filter" | "tool-calls" | "timeout" | "interrupted" | "awaiting_approval" | "awaiting_answer" | "other" | undefined;
2470
4140
  parentRunId?: string | undefined;
4141
+ computer?: {
4142
+ id: string;
4143
+ folder: string;
4144
+ } | undefined;
2471
4145
  runsOn?: "computer" | undefined;
2472
4146
  diagnostics?: {
2473
4147
  code: "step_limit_reached" | "output_limit_reached";