@sixb/server 0.1.1 → 0.1.2

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 (166) hide show
  1. package/README.md +3 -3
  2. package/dist/auth/application-access.d.ts +2 -2
  3. package/dist/auth/application-access.d.ts.map +1 -1
  4. package/dist/auth/connector-callback-cookie.d.ts +12 -0
  5. package/dist/auth/connector-callback-cookie.d.ts.map +1 -0
  6. package/dist/auth/guard.d.ts +3 -3
  7. package/dist/auth/guard.d.ts.map +1 -1
  8. package/dist/auth/public-routes.d.ts.map +1 -1
  9. package/dist/auth/scope.d.ts +13 -27
  10. package/dist/auth/scope.d.ts.map +1 -1
  11. package/dist/auth/session-cookies.d.ts +2 -2
  12. package/dist/auth/session-cookies.d.ts.map +1 -1
  13. package/dist/connectors/http.d.ts +16 -0
  14. package/dist/connectors/http.d.ts.map +1 -0
  15. package/dist/index.js +3293 -2704
  16. package/dist/index.js.map +55 -50
  17. package/dist/openapi/tags.d.ts +11 -3
  18. package/dist/openapi/tags.d.ts.map +1 -1
  19. package/dist/registerRoutes.d.ts +6 -2
  20. package/dist/registerRoutes.d.ts.map +1 -1
  21. package/dist/routes/action-runs.d.ts +21 -31
  22. package/dist/routes/action-runs.d.ts.map +1 -1
  23. package/dist/routes/actions.d.ts +9 -8
  24. package/dist/routes/actions.d.ts.map +1 -1
  25. package/dist/routes/agent-api-gateway.d.ts +2 -2
  26. package/dist/routes/agent-api-gateway.d.ts.map +1 -1
  27. package/dist/routes/agents.d.ts +130 -131
  28. package/dist/routes/agents.d.ts.map +1 -1
  29. package/dist/routes/auth.d.ts +84 -84
  30. package/dist/routes/auth.d.ts.map +1 -1
  31. package/dist/routes/connector-connection-runs.d.ts +794 -0
  32. package/dist/routes/connector-connection-runs.d.ts.map +1 -0
  33. package/dist/routes/connector-connections.d.ts +219 -0
  34. package/dist/routes/connector-connections.d.ts.map +1 -0
  35. package/dist/routes/connectors.d.ts +10 -4
  36. package/dist/routes/connectors.d.ts.map +1 -1
  37. package/dist/routes/datasets.d.ts +8 -4
  38. package/dist/routes/datasets.d.ts.map +1 -1
  39. package/dist/routes/events.d.ts +8 -8
  40. package/dist/routes/events.d.ts.map +1 -1
  41. package/dist/routes/files.d.ts +11 -10
  42. package/dist/routes/files.d.ts.map +1 -1
  43. package/dist/routes/links.d.ts +2 -2
  44. package/dist/routes/links.d.ts.map +1 -1
  45. package/dist/routes/logs.d.ts +5 -5
  46. package/dist/routes/logs.d.ts.map +1 -1
  47. package/dist/routes/objects.d.ts +34 -34
  48. package/dist/routes/objects.d.ts.map +1 -1
  49. package/dist/routes/ontology.d.ts +50 -50
  50. package/dist/routes/ontology.d.ts.map +1 -1
  51. package/dist/routes/pipelines.d.ts +24 -34
  52. package/dist/routes/pipelines.d.ts.map +1 -1
  53. package/dist/routes/project.d.ts +2 -2
  54. package/dist/routes/project.d.ts.map +1 -1
  55. package/dist/routes/projections.d.ts +131 -83
  56. package/dist/routes/projections.d.ts.map +1 -1
  57. package/dist/routes/rules.d.ts +6 -6
  58. package/dist/routes/rules.d.ts.map +1 -1
  59. package/dist/routes/status.d.ts +2 -2
  60. package/dist/routes/status.d.ts.map +1 -1
  61. package/dist/routes/syncs.d.ts +20 -25
  62. package/dist/routes/syncs.d.ts.map +1 -1
  63. package/dist/routes/telemetry.d.ts +2 -2
  64. package/dist/routes/telemetry.d.ts.map +1 -1
  65. package/dist/routes/webhook-runs.d.ts +9 -9
  66. package/dist/routes/webhook-runs.d.ts.map +1 -1
  67. package/dist/routes/webhooks.d.ts +2 -2
  68. package/dist/routes/webhooks.d.ts.map +1 -1
  69. package/dist/routes/workflows.d.ts +74 -48
  70. package/dist/routes/workflows.d.ts.map +1 -1
  71. package/dist/routes/ws/agents.d.ts +11 -5
  72. package/dist/routes/ws/agents.d.ts.map +1 -1
  73. package/dist/routes/ws/events.d.ts +8 -8
  74. package/dist/routes/ws/events.d.ts.map +1 -1
  75. package/dist/routes/ws/log-subscription-hub.d.ts +6 -3
  76. package/dist/routes/ws/log-subscription-hub.d.ts.map +1 -1
  77. package/dist/routes/ws/logs.d.ts +10 -10
  78. package/dist/routes/ws/logs.d.ts.map +1 -1
  79. package/dist/schemas/actions.d.ts +97 -202
  80. package/dist/schemas/actions.d.ts.map +1 -1
  81. package/dist/schemas/agents.d.ts +442 -439
  82. package/dist/schemas/agents.d.ts.map +1 -1
  83. package/dist/schemas/ai-usage.d.ts +34 -0
  84. package/dist/schemas/ai-usage.d.ts.map +1 -0
  85. package/dist/schemas/auth.d.ts +142 -142
  86. package/dist/schemas/common.d.ts +37 -0
  87. package/dist/schemas/common.d.ts.map +1 -1
  88. package/dist/schemas/connectors.d.ts +713 -2
  89. package/dist/schemas/connectors.d.ts.map +1 -1
  90. package/dist/schemas/datasets.d.ts +2 -2
  91. package/dist/schemas/event-payloads.d.ts +6 -6
  92. package/dist/schemas/events.d.ts +34 -34
  93. package/dist/schemas/logs.d.ts +22 -22
  94. package/dist/schemas/objects.d.ts +10 -10
  95. package/dist/schemas/ontology.d.ts +118 -118
  96. package/dist/schemas/pipelines.d.ts +95 -190
  97. package/dist/schemas/pipelines.d.ts.map +1 -1
  98. package/dist/schemas/projections.d.ts +918 -563
  99. package/dist/schemas/projections.d.ts.map +1 -1
  100. package/dist/schemas/rules.d.ts +6 -6
  101. package/dist/schemas/status.d.ts +2 -2
  102. package/dist/schemas/syncs.d.ts +65 -108
  103. package/dist/schemas/syncs.d.ts.map +1 -1
  104. package/dist/schemas/webhook-runs.d.ts +41 -41
  105. package/dist/schemas/webhook-runs.d.ts.map +1 -1
  106. package/dist/schemas/workflows.d.ts +516 -183
  107. package/dist/schemas/workflows.d.ts.map +1 -1
  108. package/dist/server.d.ts +6 -6
  109. package/dist/server.d.ts.map +1 -1
  110. package/dist/utils/http.d.ts +2 -0
  111. package/dist/utils/http.d.ts.map +1 -1
  112. package/dist/utils/ws.d.ts +4 -3
  113. package/dist/utils/ws.d.ts.map +1 -1
  114. package/package.json +4 -4
  115. package/src/auth/access-token-boundary.ts +4 -4
  116. package/src/auth/application-access.ts +8 -9
  117. package/src/auth/connector-callback-cookie.ts +95 -0
  118. package/src/auth/guard.ts +11 -11
  119. package/src/auth/public-routes.ts +13 -0
  120. package/src/auth/scope.ts +26 -36
  121. package/src/auth/session-cookies.ts +3 -3
  122. package/src/connectors/http.ts +110 -0
  123. package/src/openapi/tags.ts +9 -1
  124. package/src/registerRoutes.ts +34 -23
  125. package/src/routes/action-runs.ts +39 -39
  126. package/src/routes/actions.ts +7 -13
  127. package/src/routes/agent-api-gateway.ts +41 -38
  128. package/src/routes/agents.ts +89 -200
  129. package/src/routes/auth.ts +87 -91
  130. package/src/routes/connector-connection-runs.ts +346 -0
  131. package/src/routes/connector-connections.ts +135 -0
  132. package/src/routes/connectors.ts +24 -12
  133. package/src/routes/datasets.ts +55 -54
  134. package/src/routes/events.ts +5 -5
  135. package/src/routes/files.ts +22 -30
  136. package/src/routes/links.ts +31 -35
  137. package/src/routes/logs.ts +6 -11
  138. package/src/routes/objects.ts +51 -114
  139. package/src/routes/ontology.ts +27 -38
  140. package/src/routes/pipelines.ts +28 -62
  141. package/src/routes/project.ts +3 -3
  142. package/src/routes/projections.ts +26 -38
  143. package/src/routes/rules.ts +11 -25
  144. package/src/routes/status.ts +5 -5
  145. package/src/routes/syncs.ts +19 -45
  146. package/src/routes/telemetry.ts +18 -29
  147. package/src/routes/webhook-runs.ts +5 -5
  148. package/src/routes/webhooks.ts +259 -341
  149. package/src/routes/workflows.ts +226 -248
  150. package/src/routes/ws/agents.ts +196 -66
  151. package/src/routes/ws/events.ts +11 -10
  152. package/src/routes/ws/log-subscription-hub.ts +6 -12
  153. package/src/routes/ws/logs.ts +13 -5
  154. package/src/schemas/actions.ts +58 -25
  155. package/src/schemas/agents.ts +19 -14
  156. package/src/schemas/ai-usage.ts +16 -0
  157. package/src/schemas/common.ts +24 -0
  158. package/src/schemas/connectors.ts +164 -0
  159. package/src/schemas/pipelines.ts +23 -15
  160. package/src/schemas/projections.ts +17 -3
  161. package/src/schemas/syncs.ts +13 -8
  162. package/src/schemas/webhook-runs.ts +10 -5
  163. package/src/schemas/workflows.ts +16 -6
  164. package/src/server.ts +65 -26
  165. package/src/utils/http.ts +34 -6
  166. package/src/utils/ws.ts +10 -5
@@ -1,9 +1,8 @@
1
- import { type OntologySource, type Sixb } from "@sixb/core";
2
- import { type AgentRunRecord } from "@sixb/core/storage";
1
+ import { type AgentRunView, type SixbHostView } from "@sixb/core";
3
2
  import type { Elysia } from "elysia";
4
3
  import { AgentRunSchema } from "../schemas/agents";
5
- export declare function serializeAgentRun(run: AgentRunRecord): ReturnType<typeof AgentRunSchema.parse>;
6
- export declare function registerAgentRoutes(app: Elysia, sixb: Sixb<readonly OntologySource[]>): Elysia<"", {
4
+ export declare function serializeAgentRun(run: AgentRunView): ReturnType<typeof AgentRunSchema.parse>;
5
+ export declare function registerAgentRoutes(app: Elysia, host: SixbHostView): Elysia<"", {
7
6
  decorator: {};
8
7
  store: {};
9
8
  derive: {};
@@ -28,8 +27,8 @@ export declare function registerAgentRoutes(app: Elysia, sixb: Sixb<readonly Ont
28
27
  headers: unknown;
29
28
  response: {
30
29
  200: {
31
- name: string;
32
30
  id: string;
31
+ name: string;
33
32
  groupIds: string[];
34
33
  description?: string | undefined;
35
34
  modelId?: string | undefined;
@@ -66,8 +65,8 @@ export declare function registerAgentRoutes(app: Elysia, sixb: Sixb<readonly Ont
66
65
  headers: unknown;
67
66
  response: {
68
67
  200: {
69
- name: string;
70
68
  id: string;
69
+ name: string;
71
70
  groupIds: string[];
72
71
  description?: string | undefined;
73
72
  modelId?: string | undefined;
@@ -103,10 +102,10 @@ export declare function registerAgentRoutes(app: Elysia, sixb: Sixb<readonly Ont
103
102
  params: {};
104
103
  query: {
105
104
  status?: "active" | "archived" | undefined;
106
- agentId?: string | undefined;
107
105
  limit?: string | undefined;
108
106
  offset?: string | undefined;
109
107
  order?: "asc" | "desc" | undefined;
108
+ agentId?: string | undefined;
110
109
  };
111
110
  headers: unknown;
112
111
  response: {
@@ -114,14 +113,14 @@ export declare function registerAgentRoutes(app: Elysia, sixb: Sixb<readonly Ont
114
113
  hasMore: boolean;
115
114
  total: number;
116
115
  threads: {
117
- status: "active" | "archived";
118
116
  projectId: string;
117
+ id: string;
118
+ status: "active" | "archived";
119
+ agentId: string;
119
120
  ownerPrincipal: {
120
- type: "user" | "serviceAccount" | "system";
121
121
  id: string;
122
+ type: "user" | "serviceAccount" | "system";
122
123
  };
123
- agentId: string;
124
- id: string;
125
124
  activeRunId: string | null;
126
125
  messageCount: number;
127
126
  createdAt: string;
@@ -164,14 +163,14 @@ export declare function registerAgentRoutes(app: Elysia, sixb: Sixb<readonly Ont
164
163
  response: {
165
164
  200: {
166
165
  thread: {
167
- status: "active" | "archived";
168
166
  projectId: string;
167
+ id: string;
168
+ status: "active" | "archived";
169
+ agentId: string;
169
170
  ownerPrincipal: {
170
- type: "user" | "serviceAccount" | "system";
171
171
  id: string;
172
+ type: "user" | "serviceAccount" | "system";
172
173
  };
173
- agentId: string;
174
- id: string;
175
174
  activeRunId: string | null;
176
175
  messageCount: number;
177
176
  createdAt: string;
@@ -188,22 +187,22 @@ export declare function registerAgentRoutes(app: Elysia, sixb: Sixb<readonly Ont
188
187
  404: {
189
188
  error: string;
190
189
  };
191
- 501: {
190
+ 409: {
192
191
  error: string;
193
192
  };
194
- 409: {
193
+ 501: {
195
194
  error: string;
196
195
  };
197
196
  201: {
198
197
  thread: {
199
- status: "active" | "archived";
200
198
  projectId: string;
199
+ id: string;
200
+ status: "active" | "archived";
201
+ agentId: string;
201
202
  ownerPrincipal: {
202
- type: "user" | "serviceAccount" | "system";
203
203
  id: string;
204
+ type: "user" | "serviceAccount" | "system";
204
205
  };
205
- agentId: string;
206
- id: string;
207
206
  activeRunId: string | null;
208
207
  messageCount: number;
209
208
  createdAt: string;
@@ -238,14 +237,14 @@ export declare function registerAgentRoutes(app: Elysia, sixb: Sixb<readonly Ont
238
237
  headers: unknown;
239
238
  response: {
240
239
  200: {
241
- status: "active" | "archived";
242
240
  projectId: string;
241
+ id: string;
242
+ status: "active" | "archived";
243
+ agentId: string;
243
244
  ownerPrincipal: {
244
- type: "user" | "serviceAccount" | "system";
245
245
  id: string;
246
+ type: "user" | "serviceAccount" | "system";
246
247
  };
247
- agentId: string;
248
- id: string;
249
248
  activeRunId: string | null;
250
249
  messageCount: number;
251
250
  createdAt: string;
@@ -311,10 +310,10 @@ export declare function registerAgentRoutes(app: Elysia, sixb: Sixb<readonly Ont
311
310
  primaryId: string;
312
311
  };
313
312
  } | {
313
+ id: string;
314
314
  kind: "app-state";
315
315
  description: string;
316
316
  value: import("../schemas/common").JsonValue;
317
- id: string;
318
317
  label: string;
319
318
  };
320
319
  } | {
@@ -373,8 +372,8 @@ export declare function registerAgentRoutes(app: Elysia, sixb: Sixb<readonly Ont
373
372
  contentVersion: number;
374
373
  completedAt?: string | undefined;
375
374
  authorPrincipal?: {
376
- type: "user" | "serviceAccount" | "system";
377
375
  id: string;
376
+ type: "user" | "serviceAccount" | "system";
378
377
  } | undefined;
379
378
  metadata?: import("../schemas/common").JsonValue | undefined;
380
379
  }[];
@@ -493,7 +492,6 @@ export declare function registerAgentRoutes(app: Elysia, sixb: Sixb<readonly Ont
493
492
  post: {
494
493
  body: {
495
494
  text: string;
496
- messageId?: string | undefined;
497
495
  context?: {
498
496
  origin: "ambient" | "explicit";
499
497
  context: {
@@ -503,13 +501,14 @@ export declare function registerAgentRoutes(app: Elysia, sixb: Sixb<readonly Ont
503
501
  primaryId: string;
504
502
  };
505
503
  } | {
504
+ id: string;
506
505
  kind: "app-state";
507
506
  description: string;
508
507
  value: import("../schemas/common").JsonValue;
509
- id: string;
510
508
  label: string;
511
509
  };
512
510
  }[] | undefined;
511
+ messageId?: string | undefined;
513
512
  attachments?: {
514
513
  blobId: string;
515
514
  digest: string;
@@ -527,34 +526,34 @@ export declare function registerAgentRoutes(app: Elysia, sixb: Sixb<readonly Ont
527
526
  response: {
528
527
  200: {
529
528
  run: {
530
- status: "queued" | "running" | "succeeded" | "failed" | "cancelled";
531
529
  projectId: string;
532
- agentId: string;
533
530
  id: string;
531
+ status: "queued" | "running" | "succeeded" | "failed" | "cancelled";
532
+ agentId: string;
534
533
  threadId: string;
535
534
  createdAt: string;
536
535
  triggerMessageId: string;
537
- requestedByPrincipal: {
538
- type: "user" | "serviceAccount" | "system";
539
- id: string;
540
- };
541
536
  attempt: number;
542
537
  streamId: string;
543
- error?: string | undefined;
538
+ error?: import("@sixb/core").SixbFailure<"agent.execution_failed" | "internal.unexpected" | "runtime.cancelled"> | undefined;
544
539
  startedAt?: string | undefined;
545
540
  completedAt?: string | undefined;
546
- executionPrincipal?: {
547
- type: "user" | "serviceAccount" | "system";
541
+ modelId?: string | undefined;
542
+ requestedBy?: {
548
543
  id: string;
544
+ type: "user" | "serviceAccount";
549
545
  } | undefined;
550
- modelId?: string | undefined;
551
546
  finishReason?: "length" | "error" | "unknown" | "stop" | "content-filter" | "tool-calls" | "other" | undefined;
552
547
  usage?: {
548
+ reportingStatus: "complete" | "partial" | "unavailable";
553
549
  inputTokens?: number | undefined;
554
550
  outputTokens?: number | undefined;
555
551
  totalTokens?: number | undefined;
556
- reasoningTokens?: number | undefined;
557
- cachedInputTokens?: number | undefined;
552
+ uncachedInputTokens?: number | undefined;
553
+ cacheReadInputTokens?: number | undefined;
554
+ cacheWriteInputTokens?: number | undefined;
555
+ textOutputTokens?: number | undefined;
556
+ reasoningOutputTokens?: number | undefined;
558
557
  } | undefined;
559
558
  diagnostics?: {
560
559
  code: "output_file_limit_exceeded" | "output_file_too_large" | "output_budget_exhausted" | "output_collection_failed" | "output_file_changed" | "output_storage_failed";
@@ -576,42 +575,42 @@ export declare function registerAgentRoutes(app: Elysia, sixb: Sixb<readonly Ont
576
575
  404: {
577
576
  error: string;
578
577
  };
579
- 501: {
578
+ 409: {
580
579
  error: string;
581
580
  };
582
- 409: {
581
+ 501: {
583
582
  error: string;
584
583
  };
585
584
  202: {
586
585
  run: {
587
- status: "queued" | "running" | "succeeded" | "failed" | "cancelled";
588
586
  projectId: string;
589
- agentId: string;
590
587
  id: string;
588
+ status: "queued" | "running" | "succeeded" | "failed" | "cancelled";
589
+ agentId: string;
591
590
  threadId: string;
592
591
  createdAt: string;
593
592
  triggerMessageId: string;
594
- requestedByPrincipal: {
595
- type: "user" | "serviceAccount" | "system";
596
- id: string;
597
- };
598
593
  attempt: number;
599
594
  streamId: string;
600
- error?: string | undefined;
595
+ error?: import("@sixb/core").SixbFailure<"agent.execution_failed" | "internal.unexpected" | "runtime.cancelled"> | undefined;
601
596
  startedAt?: string | undefined;
602
597
  completedAt?: string | undefined;
603
- executionPrincipal?: {
604
- type: "user" | "serviceAccount" | "system";
598
+ modelId?: string | undefined;
599
+ requestedBy?: {
605
600
  id: string;
601
+ type: "user" | "serviceAccount";
606
602
  } | undefined;
607
- modelId?: string | undefined;
608
603
  finishReason?: "length" | "error" | "unknown" | "stop" | "content-filter" | "tool-calls" | "other" | undefined;
609
604
  usage?: {
605
+ reportingStatus: "complete" | "partial" | "unavailable";
610
606
  inputTokens?: number | undefined;
611
607
  outputTokens?: number | undefined;
612
608
  totalTokens?: number | undefined;
613
- reasoningTokens?: number | undefined;
614
- cachedInputTokens?: number | undefined;
609
+ uncachedInputTokens?: number | undefined;
610
+ cacheReadInputTokens?: number | undefined;
611
+ cacheWriteInputTokens?: number | undefined;
612
+ textOutputTokens?: number | undefined;
613
+ reasoningOutputTokens?: number | undefined;
615
614
  } | undefined;
616
615
  diagnostics?: {
617
616
  code: "output_file_limit_exceeded" | "output_file_too_large" | "output_budget_exhausted" | "output_collection_failed" | "output_file_changed" | "output_storage_failed";
@@ -654,34 +653,34 @@ export declare function registerAgentRoutes(app: Elysia, sixb: Sixb<readonly Ont
654
653
  response: {
655
654
  200: {
656
655
  run: {
657
- status: "queued" | "running" | "succeeded" | "failed" | "cancelled";
658
656
  projectId: string;
659
- agentId: string;
660
657
  id: string;
658
+ status: "queued" | "running" | "succeeded" | "failed" | "cancelled";
659
+ agentId: string;
661
660
  threadId: string;
662
661
  createdAt: string;
663
662
  triggerMessageId: string;
664
- requestedByPrincipal: {
665
- type: "user" | "serviceAccount" | "system";
666
- id: string;
667
- };
668
663
  attempt: number;
669
664
  streamId: string;
670
- error?: string | undefined;
665
+ error?: import("@sixb/core").SixbFailure<"agent.execution_failed" | "internal.unexpected" | "runtime.cancelled"> | undefined;
671
666
  startedAt?: string | undefined;
672
667
  completedAt?: string | undefined;
673
- executionPrincipal?: {
674
- type: "user" | "serviceAccount" | "system";
668
+ modelId?: string | undefined;
669
+ requestedBy?: {
675
670
  id: string;
671
+ type: "user" | "serviceAccount";
676
672
  } | undefined;
677
- modelId?: string | undefined;
678
673
  finishReason?: "length" | "error" | "unknown" | "stop" | "content-filter" | "tool-calls" | "other" | undefined;
679
674
  usage?: {
675
+ reportingStatus: "complete" | "partial" | "unavailable";
680
676
  inputTokens?: number | undefined;
681
677
  outputTokens?: number | undefined;
682
678
  totalTokens?: number | undefined;
683
- reasoningTokens?: number | undefined;
684
- cachedInputTokens?: number | undefined;
679
+ uncachedInputTokens?: number | undefined;
680
+ cacheReadInputTokens?: number | undefined;
681
+ cacheWriteInputTokens?: number | undefined;
682
+ textOutputTokens?: number | undefined;
683
+ reasoningOutputTokens?: number | undefined;
685
684
  } | undefined;
686
685
  diagnostics?: {
687
686
  code: "output_file_limit_exceeded" | "output_file_too_large" | "output_budget_exhausted" | "output_collection_failed" | "output_file_changed" | "output_storage_failed";
@@ -700,42 +699,42 @@ export declare function registerAgentRoutes(app: Elysia, sixb: Sixb<readonly Ont
700
699
  404: {
701
700
  error: string;
702
701
  };
703
- 501: {
702
+ 409: {
704
703
  error: string;
705
704
  };
706
- 409: {
705
+ 501: {
707
706
  error: string;
708
707
  };
709
708
  202: {
710
709
  run: {
711
- status: "queued" | "running" | "succeeded" | "failed" | "cancelled";
712
710
  projectId: string;
713
- agentId: string;
714
711
  id: string;
712
+ status: "queued" | "running" | "succeeded" | "failed" | "cancelled";
713
+ agentId: string;
715
714
  threadId: string;
716
715
  createdAt: string;
717
716
  triggerMessageId: string;
718
- requestedByPrincipal: {
719
- type: "user" | "serviceAccount" | "system";
720
- id: string;
721
- };
722
717
  attempt: number;
723
718
  streamId: string;
724
- error?: string | undefined;
719
+ error?: import("@sixb/core").SixbFailure<"agent.execution_failed" | "internal.unexpected" | "runtime.cancelled"> | undefined;
725
720
  startedAt?: string | undefined;
726
721
  completedAt?: string | undefined;
727
- executionPrincipal?: {
728
- type: "user" | "serviceAccount" | "system";
722
+ modelId?: string | undefined;
723
+ requestedBy?: {
729
724
  id: string;
725
+ type: "user" | "serviceAccount";
730
726
  } | undefined;
731
- modelId?: string | undefined;
732
727
  finishReason?: "length" | "error" | "unknown" | "stop" | "content-filter" | "tool-calls" | "other" | undefined;
733
728
  usage?: {
729
+ reportingStatus: "complete" | "partial" | "unavailable";
734
730
  inputTokens?: number | undefined;
735
731
  outputTokens?: number | undefined;
736
732
  totalTokens?: number | undefined;
737
- reasoningTokens?: number | undefined;
738
- cachedInputTokens?: number | undefined;
733
+ uncachedInputTokens?: number | undefined;
734
+ cacheReadInputTokens?: number | undefined;
735
+ cacheWriteInputTokens?: number | undefined;
736
+ textOutputTokens?: number | undefined;
737
+ reasoningOutputTokens?: number | undefined;
739
738
  } | undefined;
740
739
  diagnostics?: {
741
740
  code: "output_file_limit_exceeded" | "output_file_too_large" | "output_budget_exhausted" | "output_collection_failed" | "output_file_changed" | "output_storage_failed";
@@ -779,34 +778,34 @@ export declare function registerAgentRoutes(app: Elysia, sixb: Sixb<readonly Ont
779
778
  response: {
780
779
  200: {
781
780
  run: {
782
- status: "queued" | "running" | "succeeded" | "failed" | "cancelled";
783
781
  projectId: string;
784
- agentId: string;
785
782
  id: string;
783
+ status: "queued" | "running" | "succeeded" | "failed" | "cancelled";
784
+ agentId: string;
786
785
  threadId: string;
787
786
  createdAt: string;
788
787
  triggerMessageId: string;
789
- requestedByPrincipal: {
790
- type: "user" | "serviceAccount" | "system";
791
- id: string;
792
- };
793
788
  attempt: number;
794
789
  streamId: string;
795
- error?: string | undefined;
790
+ error?: import("@sixb/core").SixbFailure<"agent.execution_failed" | "internal.unexpected" | "runtime.cancelled"> | undefined;
796
791
  startedAt?: string | undefined;
797
792
  completedAt?: string | undefined;
798
- executionPrincipal?: {
799
- type: "user" | "serviceAccount" | "system";
793
+ modelId?: string | undefined;
794
+ requestedBy?: {
800
795
  id: string;
796
+ type: "user" | "serviceAccount";
801
797
  } | undefined;
802
- modelId?: string | undefined;
803
798
  finishReason?: "length" | "error" | "unknown" | "stop" | "content-filter" | "tool-calls" | "other" | undefined;
804
799
  usage?: {
800
+ reportingStatus: "complete" | "partial" | "unavailable";
805
801
  inputTokens?: number | undefined;
806
802
  outputTokens?: number | undefined;
807
803
  totalTokens?: number | undefined;
808
- reasoningTokens?: number | undefined;
809
- cachedInputTokens?: number | undefined;
804
+ uncachedInputTokens?: number | undefined;
805
+ cacheReadInputTokens?: number | undefined;
806
+ cacheWriteInputTokens?: number | undefined;
807
+ textOutputTokens?: number | undefined;
808
+ reasoningOutputTokens?: number | undefined;
810
809
  } | undefined;
811
810
  diagnostics?: {
812
811
  code: "output_file_limit_exceeded" | "output_file_too_large" | "output_budget_exhausted" | "output_collection_failed" | "output_file_changed" | "output_storage_failed";
@@ -825,42 +824,42 @@ export declare function registerAgentRoutes(app: Elysia, sixb: Sixb<readonly Ont
825
824
  404: {
826
825
  error: string;
827
826
  };
828
- 501: {
827
+ 409: {
829
828
  error: string;
830
829
  };
831
- 409: {
830
+ 501: {
832
831
  error: string;
833
832
  };
834
833
  202: {
835
834
  run: {
836
- status: "queued" | "running" | "succeeded" | "failed" | "cancelled";
837
835
  projectId: string;
838
- agentId: string;
839
836
  id: string;
837
+ status: "queued" | "running" | "succeeded" | "failed" | "cancelled";
838
+ agentId: string;
840
839
  threadId: string;
841
840
  createdAt: string;
842
841
  triggerMessageId: string;
843
- requestedByPrincipal: {
844
- type: "user" | "serviceAccount" | "system";
845
- id: string;
846
- };
847
842
  attempt: number;
848
843
  streamId: string;
849
- error?: string | undefined;
844
+ error?: import("@sixb/core").SixbFailure<"agent.execution_failed" | "internal.unexpected" | "runtime.cancelled"> | undefined;
850
845
  startedAt?: string | undefined;
851
846
  completedAt?: string | undefined;
852
- executionPrincipal?: {
853
- type: "user" | "serviceAccount" | "system";
847
+ modelId?: string | undefined;
848
+ requestedBy?: {
854
849
  id: string;
850
+ type: "user" | "serviceAccount";
855
851
  } | undefined;
856
- modelId?: string | undefined;
857
852
  finishReason?: "length" | "error" | "unknown" | "stop" | "content-filter" | "tool-calls" | "other" | undefined;
858
853
  usage?: {
854
+ reportingStatus: "complete" | "partial" | "unavailable";
859
855
  inputTokens?: number | undefined;
860
856
  outputTokens?: number | undefined;
861
857
  totalTokens?: number | undefined;
862
- reasoningTokens?: number | undefined;
863
- cachedInputTokens?: number | undefined;
858
+ uncachedInputTokens?: number | undefined;
859
+ cacheReadInputTokens?: number | undefined;
860
+ cacheWriteInputTokens?: number | undefined;
861
+ textOutputTokens?: number | undefined;
862
+ reasoningOutputTokens?: number | undefined;
864
863
  } | undefined;
865
864
  diagnostics?: {
866
865
  code: "output_file_limit_exceeded" | "output_file_too_large" | "output_budget_exhausted" | "output_collection_failed" | "output_file_changed" | "output_storage_failed";
@@ -908,34 +907,34 @@ export declare function registerAgentRoutes(app: Elysia, sixb: Sixb<readonly Ont
908
907
  response: {
909
908
  200: {
910
909
  runs: {
911
- status: "queued" | "running" | "succeeded" | "failed" | "cancelled";
912
910
  projectId: string;
913
- agentId: string;
914
911
  id: string;
912
+ status: "queued" | "running" | "succeeded" | "failed" | "cancelled";
913
+ agentId: string;
915
914
  threadId: string;
916
915
  createdAt: string;
917
916
  triggerMessageId: string;
918
- requestedByPrincipal: {
919
- type: "user" | "serviceAccount" | "system";
920
- id: string;
921
- };
922
917
  attempt: number;
923
918
  streamId: string;
924
- error?: string | undefined;
919
+ error?: import("@sixb/core").SixbFailure<"agent.execution_failed" | "internal.unexpected" | "runtime.cancelled"> | undefined;
925
920
  startedAt?: string | undefined;
926
921
  completedAt?: string | undefined;
927
- executionPrincipal?: {
928
- type: "user" | "serviceAccount" | "system";
922
+ modelId?: string | undefined;
923
+ requestedBy?: {
929
924
  id: string;
925
+ type: "user" | "serviceAccount";
930
926
  } | undefined;
931
- modelId?: string | undefined;
932
927
  finishReason?: "length" | "error" | "unknown" | "stop" | "content-filter" | "tool-calls" | "other" | undefined;
933
928
  usage?: {
929
+ reportingStatus: "complete" | "partial" | "unavailable";
934
930
  inputTokens?: number | undefined;
935
931
  outputTokens?: number | undefined;
936
932
  totalTokens?: number | undefined;
937
- reasoningTokens?: number | undefined;
938
- cachedInputTokens?: number | undefined;
933
+ uncachedInputTokens?: number | undefined;
934
+ cacheReadInputTokens?: number | undefined;
935
+ cacheWriteInputTokens?: number | undefined;
936
+ textOutputTokens?: number | undefined;
937
+ reasoningOutputTokens?: number | undefined;
939
938
  } | undefined;
940
939
  diagnostics?: {
941
940
  code: "output_file_limit_exceeded" | "output_file_too_large" | "output_budget_exhausted" | "output_collection_failed" | "output_file_changed" | "output_storage_failed";
@@ -985,34 +984,34 @@ export declare function registerAgentRoutes(app: Elysia, sixb: Sixb<readonly Ont
985
984
  headers: unknown;
986
985
  response: {
987
986
  200: {
988
- status: "queued" | "running" | "succeeded" | "failed" | "cancelled";
989
987
  projectId: string;
990
- agentId: string;
991
988
  id: string;
989
+ status: "queued" | "running" | "succeeded" | "failed" | "cancelled";
990
+ agentId: string;
992
991
  threadId: string;
993
992
  createdAt: string;
994
993
  triggerMessageId: string;
995
- requestedByPrincipal: {
996
- type: "user" | "serviceAccount" | "system";
997
- id: string;
998
- };
999
994
  attempt: number;
1000
995
  streamId: string;
1001
- error?: string | undefined;
996
+ error?: import("@sixb/core").SixbFailure<"agent.execution_failed" | "internal.unexpected" | "runtime.cancelled"> | undefined;
1002
997
  startedAt?: string | undefined;
1003
998
  completedAt?: string | undefined;
1004
- executionPrincipal?: {
1005
- type: "user" | "serviceAccount" | "system";
999
+ modelId?: string | undefined;
1000
+ requestedBy?: {
1006
1001
  id: string;
1002
+ type: "user" | "serviceAccount";
1007
1003
  } | undefined;
1008
- modelId?: string | undefined;
1009
1004
  finishReason?: "length" | "error" | "unknown" | "stop" | "content-filter" | "tool-calls" | "other" | undefined;
1010
1005
  usage?: {
1006
+ reportingStatus: "complete" | "partial" | "unavailable";
1011
1007
  inputTokens?: number | undefined;
1012
1008
  outputTokens?: number | undefined;
1013
1009
  totalTokens?: number | undefined;
1014
- reasoningTokens?: number | undefined;
1015
- cachedInputTokens?: number | undefined;
1010
+ uncachedInputTokens?: number | undefined;
1011
+ cacheReadInputTokens?: number | undefined;
1012
+ cacheWriteInputTokens?: number | undefined;
1013
+ textOutputTokens?: number | undefined;
1014
+ reasoningOutputTokens?: number | undefined;
1016
1015
  } | undefined;
1017
1016
  diagnostics?: {
1018
1017
  code: "output_file_limit_exceeded" | "output_file_too_large" | "output_budget_exhausted" | "output_collection_failed" | "output_file_changed" | "output_storage_failed";
@@ -1 +1 @@
1
- {"version":3,"file":"agents.d.ts","sourceRoot":"","sources":["../../src/routes/agents.ts"],"names":[],"mappings":"AAAA,OAAO,EAKL,KAAK,cAAc,EAGnB,KAAK,IAAI,EAEV,MAAM,YAAY,CAAA;AASnB,OAAO,EAGL,KAAK,cAAc,EAIpB,MAAM,oBAAoB,CAAA;AAC3B,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,QAAQ,CAAA;AAYpC,OAAO,EAUL,cAAc,EAYf,MAAM,mBAAmB,CAAA;AAkE1B,wBAAgB,iBAAiB,CAAC,GAAG,EAAE,cAAc,GAAG,UAAU,CAAC,OAAO,cAAc,CAAC,KAAK,CAAC,CAqB9F;AAkKD,wBAAgB,mBAAmB,CAAC,GAAG,EAAE,MAAM,EAAE,IAAI,EAAE,IAAI,CAAC,SAAS,cAAc,EAAE,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;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