@sixb/server 0.1.1 → 0.1.3

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 (178) 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/experience.d.ts +33 -0
  7. package/dist/auth/experience.d.ts.map +1 -0
  8. package/dist/auth/guard.d.ts +3 -3
  9. package/dist/auth/guard.d.ts.map +1 -1
  10. package/dist/auth/public-routes.d.ts.map +1 -1
  11. package/dist/auth/scope.d.ts +13 -27
  12. package/dist/auth/scope.d.ts.map +1 -1
  13. package/dist/auth/session-cookies.d.ts +2 -2
  14. package/dist/auth/session-cookies.d.ts.map +1 -1
  15. package/dist/connectors/http.d.ts +16 -0
  16. package/dist/connectors/http.d.ts.map +1 -0
  17. package/dist/index.d.ts +1 -0
  18. package/dist/index.d.ts.map +1 -1
  19. package/dist/index.js +3903 -2760
  20. package/dist/index.js.map +58 -50
  21. package/dist/openapi/tags.d.ts +15 -3
  22. package/dist/openapi/tags.d.ts.map +1 -1
  23. package/dist/registerRoutes.d.ts +6 -2
  24. package/dist/registerRoutes.d.ts.map +1 -1
  25. package/dist/routes/action-runs.d.ts +21 -31
  26. package/dist/routes/action-runs.d.ts.map +1 -1
  27. package/dist/routes/actions.d.ts +12 -11
  28. package/dist/routes/actions.d.ts.map +1 -1
  29. package/dist/routes/agent-api-gateway.d.ts +2 -2
  30. package/dist/routes/agent-api-gateway.d.ts.map +1 -1
  31. package/dist/routes/agents.d.ts +230 -159
  32. package/dist/routes/agents.d.ts.map +1 -1
  33. package/dist/routes/ai-accounting.d.ts +31 -0
  34. package/dist/routes/ai-accounting.d.ts.map +1 -0
  35. package/dist/routes/auth.d.ts +149 -92
  36. package/dist/routes/auth.d.ts.map +1 -1
  37. package/dist/routes/connector-connection-runs.d.ts +794 -0
  38. package/dist/routes/connector-connection-runs.d.ts.map +1 -0
  39. package/dist/routes/connector-connections.d.ts +219 -0
  40. package/dist/routes/connector-connections.d.ts.map +1 -0
  41. package/dist/routes/connectors.d.ts +10 -4
  42. package/dist/routes/connectors.d.ts.map +1 -1
  43. package/dist/routes/datasets.d.ts +16 -12
  44. package/dist/routes/datasets.d.ts.map +1 -1
  45. package/dist/routes/events.d.ts +9 -9
  46. package/dist/routes/events.d.ts.map +1 -1
  47. package/dist/routes/files.d.ts +19 -18
  48. package/dist/routes/files.d.ts.map +1 -1
  49. package/dist/routes/links.d.ts +11 -11
  50. package/dist/routes/links.d.ts.map +1 -1
  51. package/dist/routes/logs.d.ts +5 -5
  52. package/dist/routes/logs.d.ts.map +1 -1
  53. package/dist/routes/objects.d.ts +37 -37
  54. package/dist/routes/objects.d.ts.map +1 -1
  55. package/dist/routes/ontology.d.ts +50 -50
  56. package/dist/routes/ontology.d.ts.map +1 -1
  57. package/dist/routes/pipelines.d.ts +28 -38
  58. package/dist/routes/pipelines.d.ts.map +1 -1
  59. package/dist/routes/project.d.ts +2 -2
  60. package/dist/routes/project.d.ts.map +1 -1
  61. package/dist/routes/projections.d.ts +145 -85
  62. package/dist/routes/projections.d.ts.map +1 -1
  63. package/dist/routes/rules.d.ts +6 -6
  64. package/dist/routes/rules.d.ts.map +1 -1
  65. package/dist/routes/status.d.ts +2 -2
  66. package/dist/routes/status.d.ts.map +1 -1
  67. package/dist/routes/syncs.d.ts +23 -28
  68. package/dist/routes/syncs.d.ts.map +1 -1
  69. package/dist/routes/telemetry.d.ts +9 -9
  70. package/dist/routes/telemetry.d.ts.map +1 -1
  71. package/dist/routes/webhook-runs.d.ts +9 -9
  72. package/dist/routes/webhook-runs.d.ts.map +1 -1
  73. package/dist/routes/webhooks.d.ts +2 -2
  74. package/dist/routes/webhooks.d.ts.map +1 -1
  75. package/dist/routes/workflows.d.ts +177 -66
  76. package/dist/routes/workflows.d.ts.map +1 -1
  77. package/dist/routes/ws/agents.d.ts +11 -5
  78. package/dist/routes/ws/agents.d.ts.map +1 -1
  79. package/dist/routes/ws/events.d.ts +8 -8
  80. package/dist/routes/ws/events.d.ts.map +1 -1
  81. package/dist/routes/ws/log-subscription-hub.d.ts +6 -3
  82. package/dist/routes/ws/log-subscription-hub.d.ts.map +1 -1
  83. package/dist/routes/ws/logs.d.ts +10 -10
  84. package/dist/routes/ws/logs.d.ts.map +1 -1
  85. package/dist/schemas/actions.d.ts +89 -194
  86. package/dist/schemas/actions.d.ts.map +1 -1
  87. package/dist/schemas/agents.d.ts +791 -471
  88. package/dist/schemas/agents.d.ts.map +1 -1
  89. package/dist/schemas/ai-accounting.d.ts +2393 -0
  90. package/dist/schemas/ai-accounting.d.ts.map +1 -0
  91. package/dist/schemas/ai-usage.d.ts +34 -0
  92. package/dist/schemas/ai-usage.d.ts.map +1 -0
  93. package/dist/schemas/auth.d.ts +102 -102
  94. package/dist/schemas/common.d.ts +37 -0
  95. package/dist/schemas/common.d.ts.map +1 -1
  96. package/dist/schemas/connectors.d.ts +713 -2
  97. package/dist/schemas/connectors.d.ts.map +1 -1
  98. package/dist/schemas/datasets.d.ts +2 -2
  99. package/dist/schemas/event-payloads.d.ts +12 -12
  100. package/dist/schemas/events.d.ts +40 -40
  101. package/dist/schemas/links.d.ts +2 -2
  102. package/dist/schemas/logs.d.ts +22 -22
  103. package/dist/schemas/objects.d.ts +10 -10
  104. package/dist/schemas/ontology.d.ts +118 -118
  105. package/dist/schemas/pipelines.d.ts +89 -184
  106. package/dist/schemas/pipelines.d.ts.map +1 -1
  107. package/dist/schemas/projections.d.ts +1030 -563
  108. package/dist/schemas/projections.d.ts.map +1 -1
  109. package/dist/schemas/rules.d.ts +6 -6
  110. package/dist/schemas/syncs.d.ts +65 -108
  111. package/dist/schemas/syncs.d.ts.map +1 -1
  112. package/dist/schemas/webhook-runs.d.ts +41 -41
  113. package/dist/schemas/webhook-runs.d.ts.map +1 -1
  114. package/dist/schemas/workflows.d.ts +1189 -185
  115. package/dist/schemas/workflows.d.ts.map +1 -1
  116. package/dist/server.d.ts +11 -6
  117. package/dist/server.d.ts.map +1 -1
  118. package/dist/utils/http.d.ts +2 -0
  119. package/dist/utils/http.d.ts.map +1 -1
  120. package/dist/utils/ws.d.ts +4 -3
  121. package/dist/utils/ws.d.ts.map +1 -1
  122. package/package.json +5 -5
  123. package/src/auth/access-token-boundary.ts +4 -4
  124. package/src/auth/application-access.ts +8 -9
  125. package/src/auth/connector-callback-cookie.ts +95 -0
  126. package/src/auth/experience.ts +190 -0
  127. package/src/auth/guard.ts +11 -11
  128. package/src/auth/public-routes.ts +20 -0
  129. package/src/auth/scope.ts +26 -36
  130. package/src/auth/session-cookies.ts +3 -3
  131. package/src/connectors/http.ts +110 -0
  132. package/src/index.ts +1 -0
  133. package/src/openapi/tags.ts +13 -1
  134. package/src/registerRoutes.ts +36 -23
  135. package/src/routes/action-runs.ts +39 -39
  136. package/src/routes/actions.ts +7 -13
  137. package/src/routes/agent-api-gateway.ts +41 -38
  138. package/src/routes/agents.ts +90 -200
  139. package/src/routes/ai-accounting.ts +166 -0
  140. package/src/routes/auth.ts +274 -122
  141. package/src/routes/connector-connection-runs.ts +346 -0
  142. package/src/routes/connector-connections.ts +135 -0
  143. package/src/routes/connectors.ts +24 -12
  144. package/src/routes/datasets.ts +55 -54
  145. package/src/routes/events.ts +5 -5
  146. package/src/routes/files.ts +22 -30
  147. package/src/routes/links.ts +31 -35
  148. package/src/routes/logs.ts +6 -11
  149. package/src/routes/objects.ts +51 -114
  150. package/src/routes/ontology.ts +27 -38
  151. package/src/routes/pipelines.ts +28 -62
  152. package/src/routes/project.ts +3 -3
  153. package/src/routes/projections.ts +44 -42
  154. package/src/routes/rules.ts +11 -25
  155. package/src/routes/status.ts +5 -5
  156. package/src/routes/syncs.ts +19 -45
  157. package/src/routes/telemetry.ts +18 -29
  158. package/src/routes/webhook-runs.ts +5 -5
  159. package/src/routes/webhooks.ts +259 -341
  160. package/src/routes/workflows.ts +242 -248
  161. package/src/routes/ws/agents.ts +196 -66
  162. package/src/routes/ws/events.ts +11 -10
  163. package/src/routes/ws/log-subscription-hub.ts +6 -12
  164. package/src/routes/ws/logs.ts +13 -5
  165. package/src/schemas/actions.ts +58 -25
  166. package/src/schemas/agents.ts +23 -23
  167. package/src/schemas/ai-accounting.ts +182 -0
  168. package/src/schemas/ai-usage.ts +16 -0
  169. package/src/schemas/common.ts +24 -0
  170. package/src/schemas/connectors.ts +164 -0
  171. package/src/schemas/pipelines.ts +23 -15
  172. package/src/schemas/projections.ts +23 -3
  173. package/src/schemas/syncs.ts +13 -8
  174. package/src/schemas/webhook-runs.ts +10 -5
  175. package/src/schemas/workflows.ts +23 -8
  176. package/src/server.ts +75 -26
  177. package/src/utils/http.ts +34 -6
  178. 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: {
@@ -116,12 +115,12 @@ export declare function registerAgentRoutes(app: Elysia, sixb: Sixb<readonly Ont
116
115
  threads: {
117
116
  status: "active" | "archived";
118
117
  projectId: string;
118
+ id: string;
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;
@@ -166,12 +165,12 @@ export declare function registerAgentRoutes(app: Elysia, sixb: Sixb<readonly Ont
166
165
  thread: {
167
166
  status: "active" | "archived";
168
167
  projectId: string;
168
+ id: string;
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;
@@ -182,28 +181,28 @@ export declare function registerAgentRoutes(app: Elysia, sixb: Sixb<readonly Ont
182
181
  } | {
183
182
  error: string;
184
183
  };
185
- 400: {
186
- error: string;
187
- };
188
184
  404: {
189
185
  error: string;
190
186
  };
191
- 501: {
187
+ 400: {
192
188
  error: string;
193
189
  };
194
190
  409: {
195
191
  error: string;
196
192
  };
193
+ 501: {
194
+ error: string;
195
+ };
197
196
  201: {
198
197
  thread: {
199
198
  status: "active" | "archived";
200
199
  projectId: string;
200
+ id: string;
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;
@@ -240,12 +239,12 @@ export declare function registerAgentRoutes(app: Elysia, sixb: Sixb<readonly Ont
240
239
  200: {
241
240
  status: "active" | "archived";
242
241
  projectId: string;
242
+ id: string;
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;
@@ -253,10 +252,10 @@ export declare function registerAgentRoutes(app: Elysia, sixb: Sixb<readonly Ont
253
252
  title?: string | undefined;
254
253
  lastMessageAt?: string | undefined;
255
254
  };
256
- 400: {
255
+ 404: {
257
256
  error: string;
258
257
  };
259
- 404: {
258
+ 400: {
260
259
  error: string;
261
260
  };
262
261
  501: {
@@ -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,16 +372,16 @@ 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
  }[];
381
380
  };
382
- 400: {
381
+ 404: {
383
382
  error: string;
384
383
  };
385
- 404: {
384
+ 400: {
386
385
  error: string;
387
386
  };
388
387
  501: {
@@ -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;
@@ -529,33 +528,42 @@ export declare function registerAgentRoutes(app: Elysia, sixb: Sixb<readonly Ont
529
528
  run: {
530
529
  status: "queued" | "running" | "succeeded" | "failed" | "cancelled";
531
530
  projectId: string;
532
- agentId: string;
533
531
  id: string;
532
+ agentId: string;
533
+ attempt: number;
534
534
  threadId: string;
535
535
  createdAt: string;
536
536
  triggerMessageId: string;
537
- requestedByPrincipal: {
538
- type: "user" | "serviceAccount" | "system";
539
- id: string;
540
- };
541
- 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";
548
- id: string;
549
- } | undefined;
550
541
  modelId?: string | undefined;
551
- finishReason?: "length" | "error" | "unknown" | "stop" | "content-filter" | "tool-calls" | "other" | undefined;
552
542
  usage?: {
543
+ reportingStatus: "complete" | "partial" | "unavailable";
553
544
  inputTokens?: number | undefined;
554
545
  outputTokens?: number | undefined;
555
546
  totalTokens?: number | undefined;
556
- reasoningTokens?: number | undefined;
557
- cachedInputTokens?: number | undefined;
547
+ uncachedInputTokens?: number | undefined;
548
+ cacheReadInputTokens?: number | undefined;
549
+ cacheWriteInputTokens?: number | undefined;
550
+ textOutputTokens?: number | undefined;
551
+ reasoningOutputTokens?: number | undefined;
552
+ } | undefined;
553
+ cost?: {
554
+ amounts: {
555
+ currency: string;
556
+ amountNanos: string;
557
+ }[];
558
+ ratedCallCount: number;
559
+ unpriceableCallCount: number;
560
+ unvaluedCallCount: number;
558
561
  } | undefined;
562
+ requestedBy?: {
563
+ id: string;
564
+ type: "user" | "serviceAccount";
565
+ } | undefined;
566
+ finishReason?: "error" | "length" | "unknown" | "stop" | "content-filter" | "tool-calls" | "timeout" | "other" | undefined;
559
567
  diagnostics?: {
560
568
  code: "output_file_limit_exceeded" | "output_file_too_large" | "output_budget_exhausted" | "output_collection_failed" | "output_file_changed" | "output_storage_failed";
561
569
  message: string;
@@ -567,52 +575,61 @@ export declare function registerAgentRoutes(app: Elysia, sixb: Sixb<readonly Ont
567
575
  } | {
568
576
  error: string;
569
577
  };
578
+ 404: {
579
+ error: string;
580
+ };
570
581
  403: {
571
582
  error: string;
572
583
  };
573
584
  400: {
574
585
  error: string;
575
586
  };
576
- 404: {
587
+ 409: {
577
588
  error: string;
578
589
  };
579
590
  501: {
580
591
  error: string;
581
592
  };
582
- 409: {
583
- error: string;
584
- };
585
593
  202: {
586
594
  run: {
587
595
  status: "queued" | "running" | "succeeded" | "failed" | "cancelled";
588
596
  projectId: string;
589
- agentId: string;
590
597
  id: string;
598
+ agentId: string;
599
+ attempt: number;
591
600
  threadId: string;
592
601
  createdAt: string;
593
602
  triggerMessageId: string;
594
- requestedByPrincipal: {
595
- type: "user" | "serviceAccount" | "system";
596
- id: string;
597
- };
598
- attempt: number;
599
603
  streamId: string;
600
- error?: string | undefined;
604
+ error?: import("@sixb/core").SixbFailure<"agent.execution_failed" | "internal.unexpected" | "runtime.cancelled"> | undefined;
601
605
  startedAt?: string | undefined;
602
606
  completedAt?: string | undefined;
603
- executionPrincipal?: {
604
- type: "user" | "serviceAccount" | "system";
605
- id: string;
606
- } | undefined;
607
607
  modelId?: string | undefined;
608
- finishReason?: "length" | "error" | "unknown" | "stop" | "content-filter" | "tool-calls" | "other" | undefined;
609
608
  usage?: {
609
+ reportingStatus: "complete" | "partial" | "unavailable";
610
610
  inputTokens?: number | undefined;
611
611
  outputTokens?: number | undefined;
612
612
  totalTokens?: number | undefined;
613
- reasoningTokens?: number | undefined;
614
- cachedInputTokens?: number | undefined;
613
+ uncachedInputTokens?: number | undefined;
614
+ cacheReadInputTokens?: number | undefined;
615
+ cacheWriteInputTokens?: number | undefined;
616
+ textOutputTokens?: number | undefined;
617
+ reasoningOutputTokens?: number | undefined;
618
+ } | undefined;
619
+ cost?: {
620
+ amounts: {
621
+ currency: string;
622
+ amountNanos: string;
623
+ }[];
624
+ ratedCallCount: number;
625
+ unpriceableCallCount: number;
626
+ unvaluedCallCount: number;
615
627
  } | undefined;
628
+ requestedBy?: {
629
+ id: string;
630
+ type: "user" | "serviceAccount";
631
+ } | undefined;
632
+ finishReason?: "error" | "length" | "unknown" | "stop" | "content-filter" | "tool-calls" | "timeout" | "other" | undefined;
616
633
  diagnostics?: {
617
634
  code: "output_file_limit_exceeded" | "output_file_too_large" | "output_budget_exhausted" | "output_collection_failed" | "output_file_changed" | "output_storage_failed";
618
635
  message: string;
@@ -656,33 +673,42 @@ export declare function registerAgentRoutes(app: Elysia, sixb: Sixb<readonly Ont
656
673
  run: {
657
674
  status: "queued" | "running" | "succeeded" | "failed" | "cancelled";
658
675
  projectId: string;
659
- agentId: string;
660
676
  id: string;
677
+ agentId: string;
678
+ attempt: number;
661
679
  threadId: string;
662
680
  createdAt: string;
663
681
  triggerMessageId: string;
664
- requestedByPrincipal: {
665
- type: "user" | "serviceAccount" | "system";
666
- id: string;
667
- };
668
- attempt: number;
669
682
  streamId: string;
670
- error?: string | undefined;
683
+ error?: import("@sixb/core").SixbFailure<"agent.execution_failed" | "internal.unexpected" | "runtime.cancelled"> | undefined;
671
684
  startedAt?: string | undefined;
672
685
  completedAt?: string | undefined;
673
- executionPrincipal?: {
674
- type: "user" | "serviceAccount" | "system";
675
- id: string;
676
- } | undefined;
677
686
  modelId?: string | undefined;
678
- finishReason?: "length" | "error" | "unknown" | "stop" | "content-filter" | "tool-calls" | "other" | undefined;
679
687
  usage?: {
688
+ reportingStatus: "complete" | "partial" | "unavailable";
680
689
  inputTokens?: number | undefined;
681
690
  outputTokens?: number | undefined;
682
691
  totalTokens?: number | undefined;
683
- reasoningTokens?: number | undefined;
684
- cachedInputTokens?: number | undefined;
692
+ uncachedInputTokens?: number | undefined;
693
+ cacheReadInputTokens?: number | undefined;
694
+ cacheWriteInputTokens?: number | undefined;
695
+ textOutputTokens?: number | undefined;
696
+ reasoningOutputTokens?: number | undefined;
697
+ } | undefined;
698
+ cost?: {
699
+ amounts: {
700
+ currency: string;
701
+ amountNanos: string;
702
+ }[];
703
+ ratedCallCount: number;
704
+ unpriceableCallCount: number;
705
+ unvaluedCallCount: number;
706
+ } | undefined;
707
+ requestedBy?: {
708
+ id: string;
709
+ type: "user" | "serviceAccount";
685
710
  } | undefined;
711
+ finishReason?: "error" | "length" | "unknown" | "stop" | "content-filter" | "tool-calls" | "timeout" | "other" | undefined;
686
712
  diagnostics?: {
687
713
  code: "output_file_limit_exceeded" | "output_file_too_large" | "output_budget_exhausted" | "output_collection_failed" | "output_file_changed" | "output_storage_failed";
688
714
  message: string;
@@ -694,49 +720,58 @@ export declare function registerAgentRoutes(app: Elysia, sixb: Sixb<readonly Ont
694
720
  } | {
695
721
  error: string;
696
722
  };
697
- 400: {
698
- error: string;
699
- };
700
723
  404: {
701
724
  error: string;
702
725
  };
703
- 501: {
726
+ 400: {
704
727
  error: string;
705
728
  };
706
729
  409: {
707
730
  error: string;
708
731
  };
732
+ 501: {
733
+ error: string;
734
+ };
709
735
  202: {
710
736
  run: {
711
737
  status: "queued" | "running" | "succeeded" | "failed" | "cancelled";
712
738
  projectId: string;
713
- agentId: string;
714
739
  id: string;
740
+ agentId: string;
741
+ attempt: number;
715
742
  threadId: string;
716
743
  createdAt: string;
717
744
  triggerMessageId: string;
718
- requestedByPrincipal: {
719
- type: "user" | "serviceAccount" | "system";
720
- id: string;
721
- };
722
- attempt: number;
723
745
  streamId: string;
724
- error?: string | undefined;
746
+ error?: import("@sixb/core").SixbFailure<"agent.execution_failed" | "internal.unexpected" | "runtime.cancelled"> | undefined;
725
747
  startedAt?: string | undefined;
726
748
  completedAt?: string | undefined;
727
- executionPrincipal?: {
728
- type: "user" | "serviceAccount" | "system";
729
- id: string;
730
- } | undefined;
731
749
  modelId?: string | undefined;
732
- finishReason?: "length" | "error" | "unknown" | "stop" | "content-filter" | "tool-calls" | "other" | undefined;
733
750
  usage?: {
751
+ reportingStatus: "complete" | "partial" | "unavailable";
734
752
  inputTokens?: number | undefined;
735
753
  outputTokens?: number | undefined;
736
754
  totalTokens?: number | undefined;
737
- reasoningTokens?: number | undefined;
738
- cachedInputTokens?: number | undefined;
755
+ uncachedInputTokens?: number | undefined;
756
+ cacheReadInputTokens?: number | undefined;
757
+ cacheWriteInputTokens?: number | undefined;
758
+ textOutputTokens?: number | undefined;
759
+ reasoningOutputTokens?: number | undefined;
760
+ } | undefined;
761
+ cost?: {
762
+ amounts: {
763
+ currency: string;
764
+ amountNanos: string;
765
+ }[];
766
+ ratedCallCount: number;
767
+ unpriceableCallCount: number;
768
+ unvaluedCallCount: number;
769
+ } | undefined;
770
+ requestedBy?: {
771
+ id: string;
772
+ type: "user" | "serviceAccount";
739
773
  } | undefined;
774
+ finishReason?: "error" | "length" | "unknown" | "stop" | "content-filter" | "tool-calls" | "timeout" | "other" | undefined;
740
775
  diagnostics?: {
741
776
  code: "output_file_limit_exceeded" | "output_file_too_large" | "output_budget_exhausted" | "output_collection_failed" | "output_file_changed" | "output_storage_failed";
742
777
  message: string;
@@ -781,33 +816,42 @@ export declare function registerAgentRoutes(app: Elysia, sixb: Sixb<readonly Ont
781
816
  run: {
782
817
  status: "queued" | "running" | "succeeded" | "failed" | "cancelled";
783
818
  projectId: string;
784
- agentId: string;
785
819
  id: string;
820
+ agentId: string;
821
+ attempt: number;
786
822
  threadId: string;
787
823
  createdAt: string;
788
824
  triggerMessageId: string;
789
- requestedByPrincipal: {
790
- type: "user" | "serviceAccount" | "system";
791
- id: string;
792
- };
793
- attempt: number;
794
825
  streamId: string;
795
- error?: string | undefined;
826
+ error?: import("@sixb/core").SixbFailure<"agent.execution_failed" | "internal.unexpected" | "runtime.cancelled"> | undefined;
796
827
  startedAt?: string | undefined;
797
828
  completedAt?: string | undefined;
798
- executionPrincipal?: {
799
- type: "user" | "serviceAccount" | "system";
800
- id: string;
801
- } | undefined;
802
829
  modelId?: string | undefined;
803
- finishReason?: "length" | "error" | "unknown" | "stop" | "content-filter" | "tool-calls" | "other" | undefined;
804
830
  usage?: {
831
+ reportingStatus: "complete" | "partial" | "unavailable";
805
832
  inputTokens?: number | undefined;
806
833
  outputTokens?: number | undefined;
807
834
  totalTokens?: number | undefined;
808
- reasoningTokens?: number | undefined;
809
- cachedInputTokens?: number | undefined;
835
+ uncachedInputTokens?: number | undefined;
836
+ cacheReadInputTokens?: number | undefined;
837
+ cacheWriteInputTokens?: number | undefined;
838
+ textOutputTokens?: number | undefined;
839
+ reasoningOutputTokens?: number | undefined;
810
840
  } | undefined;
841
+ cost?: {
842
+ amounts: {
843
+ currency: string;
844
+ amountNanos: string;
845
+ }[];
846
+ ratedCallCount: number;
847
+ unpriceableCallCount: number;
848
+ unvaluedCallCount: number;
849
+ } | undefined;
850
+ requestedBy?: {
851
+ id: string;
852
+ type: "user" | "serviceAccount";
853
+ } | undefined;
854
+ finishReason?: "error" | "length" | "unknown" | "stop" | "content-filter" | "tool-calls" | "timeout" | "other" | undefined;
811
855
  diagnostics?: {
812
856
  code: "output_file_limit_exceeded" | "output_file_too_large" | "output_budget_exhausted" | "output_collection_failed" | "output_file_changed" | "output_storage_failed";
813
857
  message: string;
@@ -819,49 +863,58 @@ export declare function registerAgentRoutes(app: Elysia, sixb: Sixb<readonly Ont
819
863
  } | {
820
864
  error: string;
821
865
  };
822
- 400: {
823
- error: string;
824
- };
825
866
  404: {
826
867
  error: string;
827
868
  };
828
- 501: {
869
+ 400: {
829
870
  error: string;
830
871
  };
831
872
  409: {
832
873
  error: string;
833
874
  };
875
+ 501: {
876
+ error: string;
877
+ };
834
878
  202: {
835
879
  run: {
836
880
  status: "queued" | "running" | "succeeded" | "failed" | "cancelled";
837
881
  projectId: string;
838
- agentId: string;
839
882
  id: string;
883
+ agentId: string;
884
+ attempt: number;
840
885
  threadId: string;
841
886
  createdAt: string;
842
887
  triggerMessageId: string;
843
- requestedByPrincipal: {
844
- type: "user" | "serviceAccount" | "system";
845
- id: string;
846
- };
847
- attempt: number;
848
888
  streamId: string;
849
- error?: string | undefined;
889
+ error?: import("@sixb/core").SixbFailure<"agent.execution_failed" | "internal.unexpected" | "runtime.cancelled"> | undefined;
850
890
  startedAt?: string | undefined;
851
891
  completedAt?: string | undefined;
852
- executionPrincipal?: {
853
- type: "user" | "serviceAccount" | "system";
854
- id: string;
855
- } | undefined;
856
892
  modelId?: string | undefined;
857
- finishReason?: "length" | "error" | "unknown" | "stop" | "content-filter" | "tool-calls" | "other" | undefined;
858
893
  usage?: {
894
+ reportingStatus: "complete" | "partial" | "unavailable";
859
895
  inputTokens?: number | undefined;
860
896
  outputTokens?: number | undefined;
861
897
  totalTokens?: number | undefined;
862
- reasoningTokens?: number | undefined;
863
- cachedInputTokens?: number | undefined;
898
+ uncachedInputTokens?: number | undefined;
899
+ cacheReadInputTokens?: number | undefined;
900
+ cacheWriteInputTokens?: number | undefined;
901
+ textOutputTokens?: number | undefined;
902
+ reasoningOutputTokens?: number | undefined;
903
+ } | undefined;
904
+ cost?: {
905
+ amounts: {
906
+ currency: string;
907
+ amountNanos: string;
908
+ }[];
909
+ ratedCallCount: number;
910
+ unpriceableCallCount: number;
911
+ unvaluedCallCount: number;
864
912
  } | undefined;
913
+ requestedBy?: {
914
+ id: string;
915
+ type: "user" | "serviceAccount";
916
+ } | undefined;
917
+ finishReason?: "error" | "length" | "unknown" | "stop" | "content-filter" | "tool-calls" | "timeout" | "other" | undefined;
865
918
  diagnostics?: {
866
919
  code: "output_file_limit_exceeded" | "output_file_too_large" | "output_budget_exhausted" | "output_collection_failed" | "output_file_changed" | "output_storage_failed";
867
920
  message: string;
@@ -910,33 +963,42 @@ export declare function registerAgentRoutes(app: Elysia, sixb: Sixb<readonly Ont
910
963
  runs: {
911
964
  status: "queued" | "running" | "succeeded" | "failed" | "cancelled";
912
965
  projectId: string;
913
- agentId: string;
914
966
  id: string;
967
+ agentId: string;
968
+ attempt: number;
915
969
  threadId: string;
916
970
  createdAt: string;
917
971
  triggerMessageId: string;
918
- requestedByPrincipal: {
919
- type: "user" | "serviceAccount" | "system";
920
- id: string;
921
- };
922
- attempt: number;
923
972
  streamId: string;
924
- error?: string | undefined;
973
+ error?: import("@sixb/core").SixbFailure<"agent.execution_failed" | "internal.unexpected" | "runtime.cancelled"> | undefined;
925
974
  startedAt?: string | undefined;
926
975
  completedAt?: string | undefined;
927
- executionPrincipal?: {
928
- type: "user" | "serviceAccount" | "system";
929
- id: string;
930
- } | undefined;
931
976
  modelId?: string | undefined;
932
- finishReason?: "length" | "error" | "unknown" | "stop" | "content-filter" | "tool-calls" | "other" | undefined;
933
977
  usage?: {
978
+ reportingStatus: "complete" | "partial" | "unavailable";
934
979
  inputTokens?: number | undefined;
935
980
  outputTokens?: number | undefined;
936
981
  totalTokens?: number | undefined;
937
- reasoningTokens?: number | undefined;
938
- cachedInputTokens?: number | undefined;
982
+ uncachedInputTokens?: number | undefined;
983
+ cacheReadInputTokens?: number | undefined;
984
+ cacheWriteInputTokens?: number | undefined;
985
+ textOutputTokens?: number | undefined;
986
+ reasoningOutputTokens?: number | undefined;
987
+ } | undefined;
988
+ cost?: {
989
+ amounts: {
990
+ currency: string;
991
+ amountNanos: string;
992
+ }[];
993
+ ratedCallCount: number;
994
+ unpriceableCallCount: number;
995
+ unvaluedCallCount: number;
996
+ } | undefined;
997
+ requestedBy?: {
998
+ id: string;
999
+ type: "user" | "serviceAccount";
939
1000
  } | undefined;
1001
+ finishReason?: "error" | "length" | "unknown" | "stop" | "content-filter" | "tool-calls" | "timeout" | "other" | undefined;
940
1002
  diagnostics?: {
941
1003
  code: "output_file_limit_exceeded" | "output_file_too_large" | "output_budget_exhausted" | "output_collection_failed" | "output_file_changed" | "output_storage_failed";
942
1004
  message: string;
@@ -948,10 +1010,10 @@ export declare function registerAgentRoutes(app: Elysia, sixb: Sixb<readonly Ont
948
1010
  hasMore: boolean;
949
1011
  total: number;
950
1012
  };
951
- 400: {
1013
+ 404: {
952
1014
  error: string;
953
1015
  };
954
- 404: {
1016
+ 400: {
955
1017
  error: string;
956
1018
  };
957
1019
  501: {
@@ -987,33 +1049,42 @@ export declare function registerAgentRoutes(app: Elysia, sixb: Sixb<readonly Ont
987
1049
  200: {
988
1050
  status: "queued" | "running" | "succeeded" | "failed" | "cancelled";
989
1051
  projectId: string;
990
- agentId: string;
991
1052
  id: string;
1053
+ agentId: string;
1054
+ attempt: number;
992
1055
  threadId: string;
993
1056
  createdAt: string;
994
1057
  triggerMessageId: string;
995
- requestedByPrincipal: {
996
- type: "user" | "serviceAccount" | "system";
997
- id: string;
998
- };
999
- attempt: number;
1000
1058
  streamId: string;
1001
- error?: string | undefined;
1059
+ error?: import("@sixb/core").SixbFailure<"agent.execution_failed" | "internal.unexpected" | "runtime.cancelled"> | undefined;
1002
1060
  startedAt?: string | undefined;
1003
1061
  completedAt?: string | undefined;
1004
- executionPrincipal?: {
1005
- type: "user" | "serviceAccount" | "system";
1006
- id: string;
1007
- } | undefined;
1008
1062
  modelId?: string | undefined;
1009
- finishReason?: "length" | "error" | "unknown" | "stop" | "content-filter" | "tool-calls" | "other" | undefined;
1010
1063
  usage?: {
1064
+ reportingStatus: "complete" | "partial" | "unavailable";
1011
1065
  inputTokens?: number | undefined;
1012
1066
  outputTokens?: number | undefined;
1013
1067
  totalTokens?: number | undefined;
1014
- reasoningTokens?: number | undefined;
1015
- cachedInputTokens?: number | undefined;
1068
+ uncachedInputTokens?: number | undefined;
1069
+ cacheReadInputTokens?: number | undefined;
1070
+ cacheWriteInputTokens?: number | undefined;
1071
+ textOutputTokens?: number | undefined;
1072
+ reasoningOutputTokens?: number | undefined;
1016
1073
  } | undefined;
1074
+ cost?: {
1075
+ amounts: {
1076
+ currency: string;
1077
+ amountNanos: string;
1078
+ }[];
1079
+ ratedCallCount: number;
1080
+ unpriceableCallCount: number;
1081
+ unvaluedCallCount: number;
1082
+ } | undefined;
1083
+ requestedBy?: {
1084
+ id: string;
1085
+ type: "user" | "serviceAccount";
1086
+ } | undefined;
1087
+ finishReason?: "error" | "length" | "unknown" | "stop" | "content-filter" | "tool-calls" | "timeout" | "other" | undefined;
1017
1088
  diagnostics?: {
1018
1089
  code: "output_file_limit_exceeded" | "output_file_too_large" | "output_budget_exhausted" | "output_collection_failed" | "output_file_changed" | "output_storage_failed";
1019
1090
  message: string;
@@ -1022,10 +1093,10 @@ export declare function registerAgentRoutes(app: Elysia, sixb: Sixb<readonly Ont
1022
1093
  path?: string | undefined;
1023
1094
  }[] | undefined;
1024
1095
  };
1025
- 400: {
1096
+ 404: {
1026
1097
  error: string;
1027
1098
  };
1028
- 404: {
1099
+ 400: {
1029
1100
  error: string;
1030
1101
  };
1031
1102
  501: {