@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,6 +1,6 @@
1
- import { type OntologySource, type Sixb } from "@sixb/core";
1
+ import { type SixbHostView } from "@sixb/core";
2
2
  import type { Elysia } from "elysia";
3
- export declare function registerWorkflowRoutes(app: Elysia, sixb: Sixb<readonly OntologySource[]>): Elysia<"", {
3
+ export declare function registerWorkflowRoutes(app: Elysia, host: SixbHostView): Elysia<"", {
4
4
  decorator: {};
5
5
  store: {};
6
6
  derive: {};
@@ -32,30 +32,30 @@ export declare function registerWorkflowRoutes(app: Elysia, sixb: Sixb<readonly
32
32
  scheduleId: string;
33
33
  }[];
34
34
  nodes: ({
35
- type: "step";
36
35
  id: string;
36
+ type: "step";
37
37
  output: Record<string, import("../schemas/common").JsonValue>;
38
38
  key: string;
39
39
  input: Record<string, import("../schemas/common").JsonValue>;
40
40
  } | {
41
+ id: string;
41
42
  type: "action";
42
43
  params: Record<string, import("../schemas/common").JsonValue>;
43
- id: string;
44
44
  key: string;
45
45
  objectTypeId?: string | undefined;
46
46
  } | {
47
+ id: string;
47
48
  response: Record<string, import("../schemas/common").JsonValue>;
48
49
  type: "intervention";
49
- id: string;
50
50
  key: string;
51
51
  input: Record<string, import("../schemas/common").JsonValue>;
52
52
  description?: string | undefined;
53
53
  } | {
54
- agentId: string;
55
- type: "agent";
56
54
  id: string;
55
+ type: "agent";
57
56
  output: Record<string, import("../schemas/common").JsonValue>;
58
57
  key: string;
58
+ agentId: string;
59
59
  input: Record<string, import("../schemas/common").JsonValue>;
60
60
  })[];
61
61
  latestRun: {
@@ -68,7 +68,7 @@ export declare function registerWorkflowRoutes(app: Elysia, sixb: Sixb<readonly
68
68
  principalType: "user" | "serviceAccount" | "system";
69
69
  principalId: string;
70
70
  };
71
- error?: string | undefined;
71
+ error?: import("@sixb/core").SixbFailure<"internal.unexpected" | "runtime.cancelled" | "workflow.node_failed"> | undefined;
72
72
  queuedAt?: string | undefined;
73
73
  finishedAt?: string | undefined;
74
74
  } | null;
@@ -106,30 +106,30 @@ export declare function registerWorkflowRoutes(app: Elysia, sixb: Sixb<readonly
106
106
  scheduleId: string;
107
107
  }[];
108
108
  nodes: ({
109
- type: "step";
110
109
  id: string;
110
+ type: "step";
111
111
  output: Record<string, import("../schemas/common").JsonValue>;
112
112
  key: string;
113
113
  input: Record<string, import("../schemas/common").JsonValue>;
114
114
  } | {
115
+ id: string;
115
116
  type: "action";
116
117
  params: Record<string, import("../schemas/common").JsonValue>;
117
- id: string;
118
118
  key: string;
119
119
  objectTypeId?: string | undefined;
120
120
  } | {
121
+ id: string;
121
122
  response: Record<string, import("../schemas/common").JsonValue>;
122
123
  type: "intervention";
123
- id: string;
124
124
  key: string;
125
125
  input: Record<string, import("../schemas/common").JsonValue>;
126
126
  description?: string | undefined;
127
127
  } | {
128
- agentId: string;
129
- type: "agent";
130
128
  id: string;
129
+ type: "agent";
131
130
  output: Record<string, import("../schemas/common").JsonValue>;
132
131
  key: string;
132
+ agentId: string;
133
133
  input: Record<string, import("../schemas/common").JsonValue>;
134
134
  })[];
135
135
  latestRun: {
@@ -142,7 +142,7 @@ export declare function registerWorkflowRoutes(app: Elysia, sixb: Sixb<readonly
142
142
  principalType: "user" | "serviceAccount" | "system";
143
143
  principalId: string;
144
144
  };
145
- error?: string | undefined;
145
+ error?: import("@sixb/core").SixbFailure<"internal.unexpected" | "runtime.cancelled" | "workflow.node_failed"> | undefined;
146
146
  queuedAt?: string | undefined;
147
147
  finishedAt?: string | undefined;
148
148
  } | null;
@@ -177,10 +177,10 @@ export declare function registerWorkflowRoutes(app: Elysia, sixb: Sixb<readonly
177
177
  order?: "asc" | "desc" | undefined;
178
178
  workflowId?: string | undefined;
179
179
  nodeRunId?: string | undefined;
180
+ workflowRunId?: string | undefined;
180
181
  nodeId?: string | undefined;
181
182
  nodeKey?: string | undefined;
182
183
  interventionId?: string | undefined;
183
- workflowRunId?: string | undefined;
184
184
  requestedAfter?: string | undefined;
185
185
  requestedBefore?: string | undefined;
186
186
  };
@@ -193,15 +193,15 @@ export declare function registerWorkflowRoutes(app: Elysia, sixb: Sixb<readonly
193
193
  status: "cancelled" | "expired" | "pending" | "submitted";
194
194
  projectId: string;
195
195
  id: string;
196
- input: Record<string, import("../schemas/common").JsonValue>;
197
196
  workflowId: string;
198
197
  nodeRunId: string;
198
+ workflowRunId: string;
199
+ input: Record<string, import("../schemas/common").JsonValue>;
199
200
  nodeIndex: number;
200
201
  nodeId: string;
201
202
  nodeKey: string;
202
203
  interventionId: string;
203
204
  requestedAt: string;
204
- workflowRunId: string;
205
205
  defaultResponse: Record<string, import("../schemas/common").JsonValue>;
206
206
  response?: Record<string, import("../schemas/common").JsonValue> | undefined;
207
207
  expiresAt?: string | undefined;
@@ -253,15 +253,15 @@ export declare function registerWorkflowRoutes(app: Elysia, sixb: Sixb<readonly
253
253
  status: "cancelled" | "expired" | "pending" | "submitted";
254
254
  projectId: string;
255
255
  id: string;
256
- input: Record<string, import("../schemas/common").JsonValue>;
257
256
  workflowId: string;
258
257
  nodeRunId: string;
258
+ workflowRunId: string;
259
+ input: Record<string, import("../schemas/common").JsonValue>;
259
260
  nodeIndex: number;
260
261
  nodeId: string;
261
262
  nodeKey: string;
262
263
  interventionId: string;
263
264
  requestedAt: string;
264
- workflowRunId: string;
265
265
  defaultResponse: Record<string, import("../schemas/common").JsonValue>;
266
266
  response?: Record<string, import("../schemas/common").JsonValue> | undefined;
267
267
  expiresAt?: string | undefined;
@@ -277,10 +277,10 @@ export declare function registerWorkflowRoutes(app: Elysia, sixb: Sixb<readonly
277
277
  principalId: string;
278
278
  } | undefined;
279
279
  };
280
- 400: {
280
+ 404: {
281
281
  error: string;
282
282
  };
283
- 404: {
283
+ 400: {
284
284
  error: string;
285
285
  };
286
286
  501: {
@@ -323,15 +323,15 @@ export declare function registerWorkflowRoutes(app: Elysia, sixb: Sixb<readonly
323
323
  status: "cancelled" | "expired" | "pending" | "submitted";
324
324
  projectId: string;
325
325
  id: string;
326
- input: Record<string, import("../schemas/common").JsonValue>;
327
326
  workflowId: string;
328
327
  nodeRunId: string;
328
+ workflowRunId: string;
329
+ input: Record<string, import("../schemas/common").JsonValue>;
329
330
  nodeIndex: number;
330
331
  nodeId: string;
331
332
  nodeKey: string;
332
333
  interventionId: string;
333
334
  requestedAt: string;
334
- workflowRunId: string;
335
335
  defaultResponse: Record<string, import("../schemas/common").JsonValue>;
336
336
  response?: Record<string, import("../schemas/common").JsonValue> | undefined;
337
337
  expiresAt?: string | undefined;
@@ -348,10 +348,10 @@ export declare function registerWorkflowRoutes(app: Elysia, sixb: Sixb<readonly
348
348
  } | undefined;
349
349
  };
350
350
  };
351
- 400: {
351
+ 404: {
352
352
  error: string;
353
353
  };
354
- 404: {
354
+ 400: {
355
355
  error: string;
356
356
  };
357
357
  501: {
@@ -363,15 +363,15 @@ export declare function registerWorkflowRoutes(app: Elysia, sixb: Sixb<readonly
363
363
  status: "cancelled" | "expired" | "pending" | "submitted";
364
364
  projectId: string;
365
365
  id: string;
366
- input: Record<string, import("../schemas/common").JsonValue>;
367
366
  workflowId: string;
368
367
  nodeRunId: string;
368
+ workflowRunId: string;
369
+ input: Record<string, import("../schemas/common").JsonValue>;
369
370
  nodeIndex: number;
370
371
  nodeId: string;
371
372
  nodeKey: string;
372
373
  interventionId: string;
373
374
  requestedAt: string;
374
- workflowRunId: string;
375
375
  defaultResponse: Record<string, import("../schemas/common").JsonValue>;
376
376
  response?: Record<string, import("../schemas/common").JsonValue> | undefined;
377
377
  expiresAt?: string | undefined;
@@ -421,15 +421,15 @@ export declare function registerWorkflowRoutes(app: Elysia, sixb: Sixb<readonly
421
421
  status: "cancelled" | "expired" | "pending" | "submitted";
422
422
  projectId: string;
423
423
  id: string;
424
- input: Record<string, import("../schemas/common").JsonValue>;
425
424
  workflowId: string;
426
425
  nodeRunId: string;
426
+ workflowRunId: string;
427
+ input: Record<string, import("../schemas/common").JsonValue>;
427
428
  nodeIndex: number;
428
429
  nodeId: string;
429
430
  nodeKey: string;
430
431
  interventionId: string;
431
432
  requestedAt: string;
432
- workflowRunId: string;
433
433
  defaultResponse: Record<string, import("../schemas/common").JsonValue>;
434
434
  response?: Record<string, import("../schemas/common").JsonValue> | undefined;
435
435
  expiresAt?: string | undefined;
@@ -446,10 +446,10 @@ export declare function registerWorkflowRoutes(app: Elysia, sixb: Sixb<readonly
446
446
  } | undefined;
447
447
  };
448
448
  };
449
- 400: {
449
+ 404: {
450
450
  error: string;
451
451
  };
452
- 404: {
452
+ 400: {
453
453
  error: string;
454
454
  };
455
455
  501: {
@@ -478,11 +478,11 @@ export declare function registerWorkflowRoutes(app: Elysia, sixb: Sixb<readonly
478
478
  params: {};
479
479
  query: {
480
480
  status?: "queued" | "running" | "succeeded" | "failed" | "cancelled" | "waiting" | undefined;
481
+ startedAfter?: string | undefined;
482
+ startedBefore?: string | undefined;
481
483
  limit?: string | undefined;
482
484
  offset?: string | undefined;
483
485
  order?: "asc" | "desc" | undefined;
484
- startedAfter?: string | undefined;
485
- startedBefore?: string | undefined;
486
486
  workflowId?: string | undefined;
487
487
  };
488
488
  headers: unknown;
@@ -498,7 +498,7 @@ export declare function registerWorkflowRoutes(app: Elysia, sixb: Sixb<readonly
498
498
  principalType: "user" | "serviceAccount" | "system";
499
499
  principalId: string;
500
500
  };
501
- error?: string | undefined;
501
+ error?: import("@sixb/core").SixbFailure<"internal.unexpected" | "runtime.cancelled" | "workflow.node_failed"> | undefined;
502
502
  queuedAt?: string | undefined;
503
503
  finishedAt?: string | undefined;
504
504
  }[];
@@ -542,13 +542,13 @@ export declare function registerWorkflowRoutes(app: Elysia, sixb: Sixb<readonly
542
542
  projectId: string;
543
543
  id: string;
544
544
  startedAt: string;
545
- input: Record<string, import("../schemas/common").JsonValue>;
546
545
  workflowId: string;
546
+ input: Record<string, import("../schemas/common").JsonValue>;
547
547
  requestedBy: {
548
548
  principalType: "user" | "serviceAccount" | "system";
549
549
  principalId: string;
550
550
  };
551
- error?: string | undefined;
551
+ error?: import("@sixb/core").SixbFailure<"internal.unexpected" | "runtime.cancelled" | "workflow.node_failed"> | undefined;
552
552
  queuedAt?: string | undefined;
553
553
  finishedAt?: string | undefined;
554
554
  output?: Record<string, import("../schemas/common").JsonValue> | undefined;
@@ -558,13 +558,14 @@ export declare function registerWorkflowRoutes(app: Elysia, sixb: Sixb<readonly
558
558
  projectId: string;
559
559
  id: string;
560
560
  startedAt: string;
561
- input: Record<string, import("../schemas/common").JsonValue>;
562
561
  workflowId: string;
562
+ workflowRunId: string;
563
+ input: Record<string, import("../schemas/common").JsonValue>;
563
564
  nodeIndex: number;
564
- nodeType: "action" | "agent" | "step" | "intervention";
565
+ nodeType: "agent" | "action" | "step" | "intervention";
565
566
  nodeId: string;
566
567
  nodeKey: string;
567
- workflowRunId: string;
568
+ error?: import("@sixb/core").SixbFailure<"internal.unexpected" | "runtime.cancelled" | "workflow.node_failed"> | undefined;
568
569
  agentExecution?: {
569
570
  status: "queued" | "running" | "succeeded" | "failed" | "cancelled";
570
571
  agentId: string;
@@ -572,18 +573,36 @@ export declare function registerWorkflowRoutes(app: Elysia, sixb: Sixb<readonly
572
573
  startedAt?: string | undefined;
573
574
  completedAt?: string | undefined;
574
575
  modelId?: string | undefined;
576
+ usage?: {
577
+ reportingStatus: "complete" | "partial" | "unavailable";
578
+ inputTokens?: number | undefined;
579
+ outputTokens?: number | undefined;
580
+ totalTokens?: number | undefined;
581
+ uncachedInputTokens?: number | undefined;
582
+ cacheReadInputTokens?: number | undefined;
583
+ cacheWriteInputTokens?: number | undefined;
584
+ textOutputTokens?: number | undefined;
585
+ reasoningOutputTokens?: number | undefined;
586
+ } | undefined;
587
+ cost?: {
588
+ amounts: {
589
+ currency: string;
590
+ amountNanos: string;
591
+ }[];
592
+ ratedCallCount: number;
593
+ unpriceableCallCount: number;
594
+ unvaluedCallCount: number;
595
+ } | undefined;
575
596
  finishReason?: string | undefined;
576
- usage?: Record<string, unknown> | undefined;
577
597
  } | undefined;
578
- error?: string | undefined;
579
598
  finishedAt?: string | undefined;
580
599
  output?: Record<string, import("../schemas/common").JsonValue> | undefined;
581
600
  }[];
582
601
  };
583
- 400: {
602
+ 404: {
584
603
  error: string;
585
604
  };
586
- 404: {
605
+ 400: {
587
606
  error: string;
588
607
  };
589
608
  501: {
@@ -622,27 +641,100 @@ export declare function registerWorkflowRoutes(app: Elysia, sixb: Sixb<readonly
622
641
  200: {
623
642
  status: "queued" | "running" | "succeeded" | "failed" | "cancelled";
624
643
  agentId: string;
625
- createdAt: string;
626
644
  attempt: number;
627
645
  nodeRunId: string;
646
+ createdAt: string;
628
647
  prompt: string;
629
- error?: string | undefined;
648
+ error?: import("@sixb/core").SixbFailure<"agent.execution_failed" | "internal.unexpected" | "runtime.cancelled"> | undefined;
630
649
  startedAt?: string | undefined;
631
650
  completedAt?: string | undefined;
632
- executionPrincipal?: {
633
- principalType: "user" | "serviceAccount" | "system";
634
- principalId: string;
635
- } | undefined;
636
651
  modelId?: string | undefined;
652
+ usage?: {
653
+ reportingStatus: "complete" | "partial" | "unavailable";
654
+ inputTokens?: number | undefined;
655
+ outputTokens?: number | undefined;
656
+ totalTokens?: number | undefined;
657
+ uncachedInputTokens?: number | undefined;
658
+ cacheReadInputTokens?: number | undefined;
659
+ cacheWriteInputTokens?: number | undefined;
660
+ textOutputTokens?: number | undefined;
661
+ reasoningOutputTokens?: number | undefined;
662
+ } | undefined;
663
+ cost?: {
664
+ amounts: {
665
+ currency: string;
666
+ amountNanos: string;
667
+ }[];
668
+ ratedCallCount: number;
669
+ unpriceableCallCount: number;
670
+ unvaluedCallCount: number;
671
+ } | undefined;
637
672
  finishReason?: string | undefined;
638
- usage?: Record<string, unknown> | undefined;
639
- diagnostics?: unknown[] | undefined;
640
- trace?: unknown[] | undefined;
673
+ diagnostics?: import("../schemas/common").JsonValue[] | undefined;
674
+ trace?: ({
675
+ origin: "ambient" | "explicit";
676
+ type: "context";
677
+ context: {
678
+ kind: "object";
679
+ ref: {
680
+ objectTypeId: string;
681
+ primaryId: string;
682
+ };
683
+ } | {
684
+ id: string;
685
+ kind: "app-state";
686
+ description: string;
687
+ value: import("../schemas/common").JsonValue;
688
+ label: string;
689
+ };
690
+ } | {
691
+ type: "text";
692
+ text: string;
693
+ providerMetadata?: import("../schemas/common").JsonValue | undefined;
694
+ } | {
695
+ type: "reasoning";
696
+ text: string;
697
+ providerMetadata?: import("../schemas/common").JsonValue | undefined;
698
+ } | {
699
+ type: "step-start";
700
+ } | {
701
+ type: "file";
702
+ fileRef: {
703
+ blobId: string;
704
+ digest: string;
705
+ sizeBytes: number;
706
+ fileName?: string | undefined;
707
+ mediaType?: string | undefined;
708
+ logicalPath?: string | undefined;
709
+ };
710
+ providerMetadata?: import("../schemas/common").JsonValue | undefined;
711
+ } | {
712
+ type: "tool-call";
713
+ output: import("../schemas/common").JsonValue;
714
+ toolCallId: string;
715
+ toolName: string;
716
+ input: import("../schemas/common").JsonValue;
717
+ state: "output-available";
718
+ providerMetadata?: import("../schemas/common").JsonValue | undefined;
719
+ dynamic?: boolean | undefined;
720
+ providerExecuted?: boolean | undefined;
721
+ } | {
722
+ type: "tool-call";
723
+ toolCallId: string;
724
+ toolName: string;
725
+ input: import("../schemas/common").JsonValue;
726
+ state: "output-error";
727
+ errorText: string;
728
+ providerMetadata?: import("../schemas/common").JsonValue | undefined;
729
+ dynamic?: boolean | undefined;
730
+ providerExecuted?: boolean | undefined;
731
+ })[] | undefined;
732
+ failurePhase?: "agent-loop" | "structured-finalizer" | undefined;
641
733
  };
642
- 400: {
734
+ 404: {
643
735
  error: string;
644
736
  };
645
- 404: {
737
+ 400: {
646
738
  error: string;
647
739
  };
648
740
  501: {
@@ -684,13 +776,13 @@ export declare function registerWorkflowRoutes(app: Elysia, sixb: Sixb<readonly
684
776
  projectId: string;
685
777
  id: string;
686
778
  startedAt: string;
687
- input: Record<string, import("../schemas/common").JsonValue>;
688
779
  workflowId: string;
780
+ input: Record<string, import("../schemas/common").JsonValue>;
689
781
  requestedBy: {
690
782
  principalType: "user" | "serviceAccount" | "system";
691
783
  principalId: string;
692
784
  };
693
- error?: string | undefined;
785
+ error?: import("@sixb/core").SixbFailure<"internal.unexpected" | "runtime.cancelled" | "workflow.node_failed"> | undefined;
694
786
  queuedAt?: string | undefined;
695
787
  finishedAt?: string | undefined;
696
788
  output?: Record<string, import("../schemas/common").JsonValue> | undefined;
@@ -700,13 +792,14 @@ export declare function registerWorkflowRoutes(app: Elysia, sixb: Sixb<readonly
700
792
  projectId: string;
701
793
  id: string;
702
794
  startedAt: string;
703
- input: Record<string, import("../schemas/common").JsonValue>;
704
795
  workflowId: string;
796
+ workflowRunId: string;
797
+ input: Record<string, import("../schemas/common").JsonValue>;
705
798
  nodeIndex: number;
706
- nodeType: "action" | "agent" | "step" | "intervention";
799
+ nodeType: "agent" | "action" | "step" | "intervention";
707
800
  nodeId: string;
708
801
  nodeKey: string;
709
- workflowRunId: string;
802
+ error?: import("@sixb/core").SixbFailure<"internal.unexpected" | "runtime.cancelled" | "workflow.node_failed"> | undefined;
710
803
  agentExecution?: {
711
804
  status: "queued" | "running" | "succeeded" | "failed" | "cancelled";
712
805
  agentId: string;
@@ -714,18 +807,36 @@ export declare function registerWorkflowRoutes(app: Elysia, sixb: Sixb<readonly
714
807
  startedAt?: string | undefined;
715
808
  completedAt?: string | undefined;
716
809
  modelId?: string | undefined;
810
+ usage?: {
811
+ reportingStatus: "complete" | "partial" | "unavailable";
812
+ inputTokens?: number | undefined;
813
+ outputTokens?: number | undefined;
814
+ totalTokens?: number | undefined;
815
+ uncachedInputTokens?: number | undefined;
816
+ cacheReadInputTokens?: number | undefined;
817
+ cacheWriteInputTokens?: number | undefined;
818
+ textOutputTokens?: number | undefined;
819
+ reasoningOutputTokens?: number | undefined;
820
+ } | undefined;
821
+ cost?: {
822
+ amounts: {
823
+ currency: string;
824
+ amountNanos: string;
825
+ }[];
826
+ ratedCallCount: number;
827
+ unpriceableCallCount: number;
828
+ unvaluedCallCount: number;
829
+ } | undefined;
717
830
  finishReason?: string | undefined;
718
- usage?: Record<string, unknown> | undefined;
719
831
  } | undefined;
720
- error?: string | undefined;
721
832
  finishedAt?: string | undefined;
722
833
  output?: Record<string, import("../schemas/common").JsonValue> | undefined;
723
834
  }[];
724
835
  };
725
- 400: {
836
+ 404: {
726
837
  error: string;
727
838
  };
728
- 404: {
839
+ 400: {
729
840
  error: string;
730
841
  };
731
842
  501: {
@@ -923,13 +1034,13 @@ export declare function registerWorkflowRoutes(app: Elysia, sixb: Sixb<readonly
923
1034
  jobId: string;
924
1035
  workflowId: string;
925
1036
  };
926
- 403: {
1037
+ 404: {
927
1038
  error: string;
928
1039
  };
929
- 400: {
1040
+ 403: {
930
1041
  error: string;
931
1042
  };
932
- 404: {
1043
+ 400: {
933
1044
  error: string;
934
1045
  };
935
1046
  501: {
@@ -1 +1 @@
1
- {"version":3,"file":"workflows.d.ts","sourceRoot":"","sources":["../../src/routes/workflows.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,KAAK,cAAc,EAGnB,KAAK,IAAI,EAGV,MAAM,YAAY,CAAA;AAcnB,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,QAAQ,CAAA;AA8gBpC,wBAAgB,sBAAsB,CAAC,GAAG,EAAE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;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAkxBrE"}
@@ -1,4 +1,6 @@
1
- import type { AuthorizationContext, OntologySource, Sixb } from "@sixb/core";
1
+ import type { OntologySource } from "@sixb/core";
2
+ import { type AgentRunActivityEvent } from "@sixb/core/agents/streams";
3
+ import type { Sixb } from "@sixb/core/internal/request-execution";
2
4
  import type { Elysia } from "elysia";
3
5
  import { z } from "zod";
4
6
  import type { SixbServer } from "../../server";
@@ -14,6 +16,12 @@ declare const AgentStreamMessageSchema: z.ZodUnion<[z.ZodObject<{
14
16
  type: "subscribe";
15
17
  runId: string;
16
18
  afterCursor?: string | undefined;
19
+ }>, z.ZodObject<{
20
+ type: z.ZodLiteral<"subscribe.activity">;
21
+ }, "strip", z.ZodTypeAny, {
22
+ type: "subscribe.activity";
23
+ }, {
24
+ type: "subscribe.activity";
17
25
  }>, z.ZodObject<{
18
26
  type: z.ZodLiteral<"replay">;
19
27
  runId: z.ZodString;
@@ -46,15 +54,13 @@ export declare function parseAgentStreamMessage(payload: unknown): {
46
54
  ok: false;
47
55
  error: string;
48
56
  };
49
- export declare function canAccessAgentRunStream(sixb: Sixb<readonly OntologySource[]>, input: {
50
- readonly runId: string;
51
- readonly authz: AuthorizationContext | null;
52
- }): Promise<{
57
+ export declare function canAccessAgentRunStream(sixb: Sixb<readonly OntologySource[]>, runId: string): Promise<{
53
58
  ok: true;
54
59
  } | {
55
60
  ok: false;
56
61
  message: string;
57
62
  }>;
63
+ export declare function canAccessAgentThreadActivity(sixb: Sixb<readonly OntologySource[]>, event: AgentRunActivityEvent): Promise<boolean>;
58
64
  export declare function registerAgentStreamRoutes(app: Elysia, server: SixbServer): Elysia<"", {
59
65
  decorator: {};
60
66
  store: {};
@@ -1 +1 @@
1
- {"version":3,"file":"agents.d.ts","sourceRoot":"","sources":["../../../src/routes/ws/agents.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,oBAAoB,EAAE,cAAc,EAAE,IAAI,EAAE,MAAM,YAAY,CAAA;AAG5E,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,QAAQ,CAAA;AACpC,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAA;AACvB,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,cAAc,CAAA;AA2B9C,QAAA,MAAM,wBAAwB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;IAA8D,CAAA;AAM5F,wBAAgB,uBAAuB,CAAC,OAAO,EAAE,OAAO,GACpD;IACE,EAAE,EAAE,IAAI,CAAA;IACR,IAAI,EAAE,CAAC,CAAC,KAAK,CAAC,OAAO,wBAAwB,CAAC,CAAA;CAC/C,GACD;IACE,EAAE,EAAE,KAAK,CAAA;IACT,KAAK,EAAE,MAAM,CAAA;CACd,CAcJ;AAED,wBAAsB,uBAAuB,CAC3C,IAAI,EAAE,IAAI,CAAC,SAAS,cAAc,EAAE,CAAC,EACrC,KAAK,EAAE;IACL,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAA;IACtB,QAAQ,CAAC,KAAK,EAAE,oBAAoB,GAAG,IAAI,CAAA;CAC5C,GACA,OAAO,CAAC;IAAE,EAAE,EAAE,IAAI,CAAA;CAAE,GAAG;IAAE,EAAE,EAAE,KAAK,CAAC;IAAC,OAAO,EAAE,MAAM,CAAA;CAAE,CAAC,CAwBxD;AAED,wBAAgB,yBAAyB,CAAC,GAAG,EAAE,MAAM,EAAE,MAAM,EAAE,UAAU;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;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