@sixb/server 0.0.1

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 (216) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +123 -0
  3. package/dist/auth/access-token-boundary.d.ts +23 -0
  4. package/dist/auth/access-token-boundary.d.ts.map +1 -0
  5. package/dist/auth/application-access.d.ts +4 -0
  6. package/dist/auth/application-access.d.ts.map +1 -0
  7. package/dist/auth/browser-origin.d.ts +62 -0
  8. package/dist/auth/browser-origin.d.ts.map +1 -0
  9. package/dist/auth/csrf.d.ts +2 -0
  10. package/dist/auth/csrf.d.ts.map +1 -0
  11. package/dist/auth/guard.d.ts +35 -0
  12. package/dist/auth/guard.d.ts.map +1 -0
  13. package/dist/auth/public-routes.d.ts +8 -0
  14. package/dist/auth/public-routes.d.ts.map +1 -0
  15. package/dist/auth/responses.d.ts +11 -0
  16. package/dist/auth/responses.d.ts.map +1 -0
  17. package/dist/auth/return-to.d.ts +3 -0
  18. package/dist/auth/return-to.d.ts.map +1 -0
  19. package/dist/auth/scope.d.ts +43 -0
  20. package/dist/auth/scope.d.ts.map +1 -0
  21. package/dist/auth/session-activity.d.ts +4 -0
  22. package/dist/auth/session-activity.d.ts.map +1 -0
  23. package/dist/auth/session-cookies.d.ts +12 -0
  24. package/dist/auth/session-cookies.d.ts.map +1 -0
  25. package/dist/files/content.d.ts +141 -0
  26. package/dist/files/content.d.ts.map +1 -0
  27. package/dist/index.d.ts +3 -0
  28. package/dist/index.d.ts.map +1 -0
  29. package/dist/index.js +11522 -0
  30. package/dist/index.js.map +78 -0
  31. package/dist/openapi/security.d.ts +26 -0
  32. package/dist/openapi/security.d.ts.map +1 -0
  33. package/dist/openapi/tags.d.ts +151 -0
  34. package/dist/openapi/tags.d.ts.map +1 -0
  35. package/dist/registerRoutes.d.ts +31 -0
  36. package/dist/registerRoutes.d.ts.map +1 -0
  37. package/dist/routes/action-runs.d.ts +244 -0
  38. package/dist/routes/action-runs.d.ts.map +1 -0
  39. package/dist/routes/actions.d.ts +183 -0
  40. package/dist/routes/actions.d.ts.map +1 -0
  41. package/dist/routes/agent-api-gateway.d.ts +4 -0
  42. package/dist/routes/agent-api-gateway.d.ts.map +1 -0
  43. package/dist/routes/agents.d.ts +1061 -0
  44. package/dist/routes/agents.d.ts.map +1 -0
  45. package/dist/routes/auth.d.ts +1366 -0
  46. package/dist/routes/auth.d.ts.map +1 -0
  47. package/dist/routes/connectors.d.ts +108 -0
  48. package/dist/routes/connectors.d.ts.map +1 -0
  49. package/dist/routes/datasets.d.ts +339 -0
  50. package/dist/routes/datasets.d.ts.map +1 -0
  51. package/dist/routes/events.d.ts +116 -0
  52. package/dist/routes/events.d.ts.map +1 -0
  53. package/dist/routes/files.d.ts +340 -0
  54. package/dist/routes/files.d.ts.map +1 -0
  55. package/dist/routes/links.d.ts +175 -0
  56. package/dist/routes/links.d.ts.map +1 -0
  57. package/dist/routes/logs.d.ts +88 -0
  58. package/dist/routes/logs.d.ts.map +1 -0
  59. package/dist/routes/objects.d.ts +450 -0
  60. package/dist/routes/objects.d.ts.map +1 -0
  61. package/dist/routes/ontology.d.ts +240 -0
  62. package/dist/routes/ontology.d.ts.map +1 -0
  63. package/dist/routes/pipelines.d.ts +399 -0
  64. package/dist/routes/pipelines.d.ts.map +1 -0
  65. package/dist/routes/project.d.ts +56 -0
  66. package/dist/routes/project.d.ts.map +1 -0
  67. package/dist/routes/projections.d.ts +916 -0
  68. package/dist/routes/projections.d.ts.map +1 -0
  69. package/dist/routes/rules.d.ts +165 -0
  70. package/dist/routes/rules.d.ts.map +1 -0
  71. package/dist/routes/status.d.ts +81 -0
  72. package/dist/routes/status.d.ts.map +1 -0
  73. package/dist/routes/syncs.d.ts +294 -0
  74. package/dist/routes/syncs.d.ts.map +1 -0
  75. package/dist/routes/telemetry.d.ts +241 -0
  76. package/dist/routes/telemetry.d.ts.map +1 -0
  77. package/dist/routes/webhook-runs.d.ts +89 -0
  78. package/dist/routes/webhook-runs.d.ts.map +1 -0
  79. package/dist/routes/webhooks.d.ts +60 -0
  80. package/dist/routes/webhooks.d.ts.map +1 -0
  81. package/dist/routes/workflows.d.ts +973 -0
  82. package/dist/routes/workflows.d.ts.map +1 -0
  83. package/dist/routes/ws/agents.d.ts +99 -0
  84. package/dist/routes/ws/agents.d.ts.map +1 -0
  85. package/dist/routes/ws/events.d.ts +89 -0
  86. package/dist/routes/ws/events.d.ts.map +1 -0
  87. package/dist/routes/ws/index.d.ts +31 -0
  88. package/dist/routes/ws/index.d.ts.map +1 -0
  89. package/dist/routes/ws/log-subscription-hub.d.ts +47 -0
  90. package/dist/routes/ws/log-subscription-hub.d.ts.map +1 -0
  91. package/dist/routes/ws/logs.d.ts +110 -0
  92. package/dist/routes/ws/logs.d.ts.map +1 -0
  93. package/dist/schemas/actions.d.ts +644 -0
  94. package/dist/schemas/actions.d.ts.map +1 -0
  95. package/dist/schemas/agents.d.ts +3157 -0
  96. package/dist/schemas/agents.d.ts.map +1 -0
  97. package/dist/schemas/auth.d.ts +2023 -0
  98. package/dist/schemas/auth.d.ts.map +1 -0
  99. package/dist/schemas/common.d.ts +30 -0
  100. package/dist/schemas/common.d.ts.map +1 -0
  101. package/dist/schemas/connectors.d.ts +82 -0
  102. package/dist/schemas/connectors.d.ts.map +1 -0
  103. package/dist/schemas/datasets.d.ts +744 -0
  104. package/dist/schemas/datasets.d.ts.map +1 -0
  105. package/dist/schemas/event-payloads.d.ts +477 -0
  106. package/dist/schemas/event-payloads.d.ts.map +1 -0
  107. package/dist/schemas/events.d.ts +665 -0
  108. package/dist/schemas/events.d.ts.map +1 -0
  109. package/dist/schemas/files.d.ts +241 -0
  110. package/dist/schemas/files.d.ts.map +1 -0
  111. package/dist/schemas/links.d.ts +90 -0
  112. package/dist/schemas/links.d.ts.map +1 -0
  113. package/dist/schemas/logs.d.ts +231 -0
  114. package/dist/schemas/logs.d.ts.map +1 -0
  115. package/dist/schemas/objects.d.ts +288 -0
  116. package/dist/schemas/objects.d.ts.map +1 -0
  117. package/dist/schemas/ontology.d.ts +778 -0
  118. package/dist/schemas/ontology.d.ts.map +1 -0
  119. package/dist/schemas/pipelines.d.ts +1373 -0
  120. package/dist/schemas/pipelines.d.ts.map +1 -0
  121. package/dist/schemas/project.d.ts +9 -0
  122. package/dist/schemas/project.d.ts.map +1 -0
  123. package/dist/schemas/projections.d.ts +6992 -0
  124. package/dist/schemas/projections.d.ts.map +1 -0
  125. package/dist/schemas/rules.d.ts +204 -0
  126. package/dist/schemas/rules.d.ts.map +1 -0
  127. package/dist/schemas/status.d.ts +189 -0
  128. package/dist/schemas/status.d.ts.map +1 -0
  129. package/dist/schemas/syncs.d.ts +538 -0
  130. package/dist/schemas/syncs.d.ts.map +1 -0
  131. package/dist/schemas/telemetry.d.ts +265 -0
  132. package/dist/schemas/telemetry.d.ts.map +1 -0
  133. package/dist/schemas/webhook-runs.d.ts +169 -0
  134. package/dist/schemas/webhook-runs.d.ts.map +1 -0
  135. package/dist/schemas/workflows.d.ts +1720 -0
  136. package/dist/schemas/workflows.d.ts.map +1 -0
  137. package/dist/server.d.ts +64 -0
  138. package/dist/server.d.ts.map +1 -0
  139. package/dist/tsconfig.json +5 -0
  140. package/dist/utils/http.d.ts +23 -0
  141. package/dist/utils/http.d.ts.map +1 -0
  142. package/dist/utils/request-body.d.ts +15 -0
  143. package/dist/utils/request-body.d.ts.map +1 -0
  144. package/dist/utils/ws.d.ts +10 -0
  145. package/dist/utils/ws.d.ts.map +1 -0
  146. package/package.json +68 -0
  147. package/src/auth/access-token-boundary.ts +68 -0
  148. package/src/auth/application-access.ts +16 -0
  149. package/src/auth/browser-origin.ts +367 -0
  150. package/src/auth/csrf.ts +1 -0
  151. package/src/auth/guard.ts +169 -0
  152. package/src/auth/public-routes.ts +87 -0
  153. package/src/auth/responses.ts +54 -0
  154. package/src/auth/return-to.ts +21 -0
  155. package/src/auth/scope.ts +64 -0
  156. package/src/auth/session-activity.ts +19 -0
  157. package/src/auth/session-cookies.ts +43 -0
  158. package/src/files/content.ts +419 -0
  159. package/src/index.ts +2 -0
  160. package/src/openapi/security.ts +37 -0
  161. package/src/openapi/tags.ts +151 -0
  162. package/src/registerRoutes.ts +49 -0
  163. package/src/routes/action-runs.ts +238 -0
  164. package/src/routes/actions.ts +126 -0
  165. package/src/routes/agent-api-gateway.ts +260 -0
  166. package/src/routes/agents.ts +943 -0
  167. package/src/routes/auth.ts +2233 -0
  168. package/src/routes/connectors.ts +69 -0
  169. package/src/routes/datasets.ts +402 -0
  170. package/src/routes/events.ts +55 -0
  171. package/src/routes/files.ts +675 -0
  172. package/src/routes/links.ts +143 -0
  173. package/src/routes/logs.ts +65 -0
  174. package/src/routes/objects.ts +838 -0
  175. package/src/routes/ontology.ts +138 -0
  176. package/src/routes/pipelines.ts +332 -0
  177. package/src/routes/project.ts +16 -0
  178. package/src/routes/projections.ts +251 -0
  179. package/src/routes/rules.ts +124 -0
  180. package/src/routes/status.ts +53 -0
  181. package/src/routes/syncs.ts +243 -0
  182. package/src/routes/telemetry.ts +207 -0
  183. package/src/routes/webhook-runs.ts +81 -0
  184. package/src/routes/webhooks.ts +508 -0
  185. package/src/routes/workflows.ts +1333 -0
  186. package/src/routes/ws/agents.ts +301 -0
  187. package/src/routes/ws/events.ts +278 -0
  188. package/src/routes/ws/index.ts +12 -0
  189. package/src/routes/ws/log-subscription-hub.ts +375 -0
  190. package/src/routes/ws/logs.ts +117 -0
  191. package/src/schemas/actions.ts +123 -0
  192. package/src/schemas/agents.ts +293 -0
  193. package/src/schemas/auth.ts +317 -0
  194. package/src/schemas/common.ts +60 -0
  195. package/src/schemas/connectors.ts +21 -0
  196. package/src/schemas/datasets.ts +107 -0
  197. package/src/schemas/event-payloads.ts +79 -0
  198. package/src/schemas/events.ts +117 -0
  199. package/src/schemas/files.ts +82 -0
  200. package/src/schemas/links.ts +38 -0
  201. package/src/schemas/logs.ts +76 -0
  202. package/src/schemas/objects.ts +759 -0
  203. package/src/schemas/ontology.ts +77 -0
  204. package/src/schemas/pipelines.ts +150 -0
  205. package/src/schemas/project.ts +5 -0
  206. package/src/schemas/projections.ts +144 -0
  207. package/src/schemas/rules.ts +98 -0
  208. package/src/schemas/status.ts +51 -0
  209. package/src/schemas/syncs.ts +83 -0
  210. package/src/schemas/telemetry.ts +59 -0
  211. package/src/schemas/webhook-runs.ts +40 -0
  212. package/src/schemas/workflows.ts +229 -0
  213. package/src/server.ts +383 -0
  214. package/src/utils/http.ts +108 -0
  215. package/src/utils/request-body.ts +62 -0
  216. package/src/utils/ws.ts +59 -0
@@ -0,0 +1,1061 @@
1
+ import { type OntologySource, type Sixb } from "@sixb/core";
2
+ import { type AgentRunRecord } from "@sixb/core/storage";
3
+ import type { Elysia } from "elysia";
4
+ 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<"", {
7
+ decorator: {};
8
+ store: {};
9
+ derive: {};
10
+ resolve: {};
11
+ }, {
12
+ typebox: {};
13
+ error: {};
14
+ }, {
15
+ schema: {};
16
+ standaloneSchema: {};
17
+ macro: {};
18
+ macroFn: {};
19
+ parser: {};
20
+ response: {};
21
+ }, {
22
+ api: {
23
+ agents: {
24
+ get: {
25
+ body: unknown;
26
+ params: {};
27
+ query: unknown;
28
+ headers: unknown;
29
+ response: {
30
+ 200: {
31
+ name: string;
32
+ id: string;
33
+ groupIds: string[];
34
+ description?: string | undefined;
35
+ modelId?: string | undefined;
36
+ reasoning?: "none" | "provider-default" | "minimal" | "low" | "medium" | "high" | "xhigh" | undefined;
37
+ loop?: {
38
+ stopWhen?: {
39
+ maxSteps?: number | undefined;
40
+ } | undefined;
41
+ } | undefined;
42
+ }[];
43
+ 422: {
44
+ type: "validation";
45
+ on: string;
46
+ summary?: string;
47
+ message?: string;
48
+ found?: unknown;
49
+ property?: string;
50
+ expected?: string;
51
+ };
52
+ };
53
+ };
54
+ };
55
+ };
56
+ } & {
57
+ api: {
58
+ agents: {
59
+ ":agentId": {
60
+ get: {
61
+ body: unknown;
62
+ params: {
63
+ agentId: string;
64
+ };
65
+ query: unknown;
66
+ headers: unknown;
67
+ response: {
68
+ 200: {
69
+ name: string;
70
+ id: string;
71
+ groupIds: string[];
72
+ description?: string | undefined;
73
+ modelId?: string | undefined;
74
+ reasoning?: "none" | "provider-default" | "minimal" | "low" | "medium" | "high" | "xhigh" | undefined;
75
+ loop?: {
76
+ stopWhen?: {
77
+ maxSteps?: number | undefined;
78
+ } | undefined;
79
+ } | undefined;
80
+ };
81
+ 404: {
82
+ error: string;
83
+ };
84
+ 422: {
85
+ type: "validation";
86
+ on: string;
87
+ summary?: string;
88
+ message?: string;
89
+ found?: unknown;
90
+ property?: string;
91
+ expected?: string;
92
+ };
93
+ };
94
+ };
95
+ };
96
+ };
97
+ };
98
+ } & {
99
+ api: {
100
+ "agent-threads": {
101
+ get: {
102
+ body: unknown;
103
+ params: {};
104
+ query: {
105
+ status?: "active" | "archived" | undefined;
106
+ agentId?: string | undefined;
107
+ limit?: string | undefined;
108
+ offset?: string | undefined;
109
+ order?: "asc" | "desc" | undefined;
110
+ };
111
+ headers: unknown;
112
+ response: {
113
+ 200: {
114
+ hasMore: boolean;
115
+ total: number;
116
+ threads: {
117
+ status: "active" | "archived";
118
+ projectId: string;
119
+ ownerPrincipal: {
120
+ type: "serviceAccount" | "user" | "system";
121
+ id: string;
122
+ };
123
+ agentId: string;
124
+ id: string;
125
+ activeRunId: string | null;
126
+ messageCount: number;
127
+ createdAt: string;
128
+ updatedAt: string;
129
+ title?: string | undefined;
130
+ lastMessageAt?: string | undefined;
131
+ }[];
132
+ };
133
+ 400: {
134
+ error: string;
135
+ };
136
+ 501: {
137
+ error: string;
138
+ };
139
+ 422: {
140
+ type: "validation";
141
+ on: string;
142
+ summary?: string;
143
+ message?: string;
144
+ found?: unknown;
145
+ property?: string;
146
+ expected?: string;
147
+ };
148
+ };
149
+ };
150
+ };
151
+ };
152
+ } & {
153
+ api: {
154
+ "agent-threads": {
155
+ post: {
156
+ body: {
157
+ agentId: string;
158
+ title?: string | undefined;
159
+ threadId?: string | undefined;
160
+ };
161
+ params: {};
162
+ query: unknown;
163
+ headers: unknown;
164
+ response: {
165
+ 200: {
166
+ thread: {
167
+ status: "active" | "archived";
168
+ projectId: string;
169
+ ownerPrincipal: {
170
+ type: "serviceAccount" | "user" | "system";
171
+ id: string;
172
+ };
173
+ agentId: string;
174
+ id: string;
175
+ activeRunId: string | null;
176
+ messageCount: number;
177
+ createdAt: string;
178
+ updatedAt: string;
179
+ title?: string | undefined;
180
+ lastMessageAt?: string | undefined;
181
+ };
182
+ } | {
183
+ error: string;
184
+ };
185
+ 400: {
186
+ error: string;
187
+ };
188
+ 404: {
189
+ error: string;
190
+ };
191
+ 501: {
192
+ error: string;
193
+ };
194
+ 409: {
195
+ error: string;
196
+ };
197
+ 201: {
198
+ thread: {
199
+ status: "active" | "archived";
200
+ projectId: string;
201
+ ownerPrincipal: {
202
+ type: "serviceAccount" | "user" | "system";
203
+ id: string;
204
+ };
205
+ agentId: string;
206
+ id: string;
207
+ activeRunId: string | null;
208
+ messageCount: number;
209
+ createdAt: string;
210
+ updatedAt: string;
211
+ title?: string | undefined;
212
+ lastMessageAt?: string | undefined;
213
+ };
214
+ };
215
+ 422: {
216
+ type: "validation";
217
+ on: string;
218
+ summary?: string;
219
+ message?: string;
220
+ found?: unknown;
221
+ property?: string;
222
+ expected?: string;
223
+ };
224
+ };
225
+ };
226
+ };
227
+ };
228
+ } & {
229
+ api: {
230
+ "agent-threads": {
231
+ ":threadId": {
232
+ get: {
233
+ body: unknown;
234
+ params: {
235
+ threadId: string;
236
+ };
237
+ query: unknown;
238
+ headers: unknown;
239
+ response: {
240
+ 200: {
241
+ status: "active" | "archived";
242
+ projectId: string;
243
+ ownerPrincipal: {
244
+ type: "serviceAccount" | "user" | "system";
245
+ id: string;
246
+ };
247
+ agentId: string;
248
+ id: string;
249
+ activeRunId: string | null;
250
+ messageCount: number;
251
+ createdAt: string;
252
+ updatedAt: string;
253
+ title?: string | undefined;
254
+ lastMessageAt?: string | undefined;
255
+ };
256
+ 400: {
257
+ error: string;
258
+ };
259
+ 404: {
260
+ error: string;
261
+ };
262
+ 501: {
263
+ error: string;
264
+ };
265
+ 422: {
266
+ type: "validation";
267
+ on: string;
268
+ summary?: string;
269
+ message?: string;
270
+ found?: unknown;
271
+ property?: string;
272
+ expected?: string;
273
+ };
274
+ };
275
+ };
276
+ };
277
+ };
278
+ };
279
+ } & {
280
+ api: {
281
+ "agent-threads": {
282
+ ":threadId": {
283
+ messages: {
284
+ get: {
285
+ body: unknown;
286
+ params: {
287
+ threadId: string;
288
+ };
289
+ query: {
290
+ limit?: string | undefined;
291
+ offset?: string | undefined;
292
+ order?: "asc" | "desc" | undefined;
293
+ role?: "user" | "system" | "assistant" | undefined;
294
+ };
295
+ headers: unknown;
296
+ response: {
297
+ 200: {
298
+ hasMore: boolean;
299
+ total: number;
300
+ messages: {
301
+ projectId: string;
302
+ id: string;
303
+ runId: string | null;
304
+ parts: ({
305
+ origin: "ambient" | "explicit";
306
+ type: "context";
307
+ context: {
308
+ kind: "object";
309
+ ref: {
310
+ objectTypeId: string;
311
+ primaryId: string;
312
+ };
313
+ } | {
314
+ kind: "app-state";
315
+ description: string;
316
+ value: import("../schemas/common").JsonValue;
317
+ id: string;
318
+ label: string;
319
+ };
320
+ } | {
321
+ type: "text";
322
+ text: string;
323
+ providerMetadata?: import("../schemas/common").JsonValue | undefined;
324
+ } | {
325
+ type: "reasoning";
326
+ text: string;
327
+ providerMetadata?: import("../schemas/common").JsonValue | undefined;
328
+ } | {
329
+ type: "step-start";
330
+ } | {
331
+ type: "file";
332
+ fileRef: {
333
+ blobId: string;
334
+ digest: string;
335
+ sizeBytes: number;
336
+ fileName?: string | undefined;
337
+ mediaType?: string | undefined;
338
+ logicalPath?: string | undefined;
339
+ };
340
+ providerMetadata?: import("../schemas/common").JsonValue | undefined;
341
+ } | {
342
+ type: "tool-call";
343
+ output: import("../schemas/common").JsonValue;
344
+ toolCallId: string;
345
+ toolName: string;
346
+ input: import("../schemas/common").JsonValue;
347
+ state: "output-available";
348
+ providerMetadata?: import("../schemas/common").JsonValue | undefined;
349
+ dynamic?: boolean | undefined;
350
+ providerExecuted?: boolean | undefined;
351
+ } | {
352
+ type: "tool-call";
353
+ toolCallId: string;
354
+ toolName: string;
355
+ input: import("../schemas/common").JsonValue;
356
+ state: "output-error";
357
+ errorText: string;
358
+ providerMetadata?: import("../schemas/common").JsonValue | undefined;
359
+ dynamic?: boolean | undefined;
360
+ providerExecuted?: boolean | undefined;
361
+ })[];
362
+ threadId: string;
363
+ createdAt: string;
364
+ role: "user" | "system" | "assistant";
365
+ seq: number;
366
+ annotations: {
367
+ code: "output_file_limit_exceeded" | "output_file_too_large" | "output_budget_exhausted" | "output_collection_failed" | "output_file_changed" | "output_storage_failed";
368
+ message: string;
369
+ severity: "error" | "warning";
370
+ scope: "output";
371
+ path?: string | undefined;
372
+ }[];
373
+ contentVersion: number;
374
+ completedAt?: string | undefined;
375
+ authorPrincipal?: {
376
+ type: "serviceAccount" | "user" | "system";
377
+ id: string;
378
+ } | undefined;
379
+ metadata?: import("../schemas/common").JsonValue | undefined;
380
+ }[];
381
+ };
382
+ 400: {
383
+ error: string;
384
+ };
385
+ 404: {
386
+ error: string;
387
+ };
388
+ 501: {
389
+ error: string;
390
+ };
391
+ 422: {
392
+ type: "validation";
393
+ on: string;
394
+ summary?: string;
395
+ message?: string;
396
+ found?: unknown;
397
+ property?: string;
398
+ expected?: string;
399
+ };
400
+ };
401
+ };
402
+ };
403
+ };
404
+ };
405
+ };
406
+ } & {
407
+ api: {
408
+ "agent-threads": {
409
+ ":threadId": {
410
+ messages: {
411
+ ":messageId": {
412
+ files: {
413
+ content: {
414
+ get: {
415
+ body: unknown;
416
+ params: {
417
+ threadId: string;
418
+ messageId: string;
419
+ };
420
+ query: {
421
+ path: string;
422
+ disposition?: "inline" | "attachment" | undefined;
423
+ };
424
+ headers: unknown;
425
+ response: {
426
+ 200: Response | {
427
+ error: string;
428
+ };
429
+ 422: {
430
+ type: "validation";
431
+ on: string;
432
+ summary?: string;
433
+ message?: string;
434
+ found?: unknown;
435
+ property?: string;
436
+ expected?: string;
437
+ };
438
+ };
439
+ };
440
+ };
441
+ };
442
+ };
443
+ };
444
+ };
445
+ };
446
+ };
447
+ } & {
448
+ api: {
449
+ "agent-threads": {
450
+ ":threadId": {
451
+ messages: {
452
+ ":messageId": {
453
+ files: {
454
+ content: {
455
+ head: {
456
+ body: unknown;
457
+ params: {
458
+ threadId: string;
459
+ messageId: string;
460
+ };
461
+ query: {
462
+ path: string;
463
+ disposition?: "inline" | "attachment" | undefined;
464
+ };
465
+ headers: unknown;
466
+ response: {
467
+ 200: Response | {
468
+ error: string;
469
+ };
470
+ 422: {
471
+ type: "validation";
472
+ on: string;
473
+ summary?: string;
474
+ message?: string;
475
+ found?: unknown;
476
+ property?: string;
477
+ expected?: string;
478
+ };
479
+ };
480
+ };
481
+ };
482
+ };
483
+ };
484
+ };
485
+ };
486
+ };
487
+ };
488
+ } & {
489
+ api: {
490
+ "agent-threads": {
491
+ ":threadId": {
492
+ messages: {
493
+ post: {
494
+ body: {
495
+ text: string;
496
+ messageId?: string | undefined;
497
+ context?: {
498
+ origin: "ambient" | "explicit";
499
+ context: {
500
+ kind: "object";
501
+ ref: {
502
+ objectTypeId: string;
503
+ primaryId: string;
504
+ };
505
+ } | {
506
+ kind: "app-state";
507
+ description: string;
508
+ value: import("../schemas/common").JsonValue;
509
+ id: string;
510
+ label: string;
511
+ };
512
+ }[] | undefined;
513
+ attachments?: {
514
+ blobId: string;
515
+ digest: string;
516
+ sizeBytes: number;
517
+ fileName?: string | undefined;
518
+ mediaType?: string | undefined;
519
+ logicalPath?: string | undefined;
520
+ }[] | undefined;
521
+ };
522
+ params: {
523
+ threadId: string;
524
+ };
525
+ query: unknown;
526
+ headers: unknown;
527
+ response: {
528
+ 200: {
529
+ run: {
530
+ status: "queued" | "running" | "succeeded" | "failed" | "cancelled";
531
+ projectId: string;
532
+ agentId: string;
533
+ id: string;
534
+ threadId: string;
535
+ createdAt: string;
536
+ triggerMessageId: string;
537
+ requestedByPrincipal: {
538
+ type: "serviceAccount" | "user" | "system";
539
+ id: string;
540
+ };
541
+ attempt: number;
542
+ streamId: string;
543
+ error?: string | undefined;
544
+ startedAt?: string | undefined;
545
+ completedAt?: string | undefined;
546
+ executionPrincipal?: {
547
+ type: "serviceAccount" | "user" | "system";
548
+ id: string;
549
+ } | undefined;
550
+ modelId?: string | undefined;
551
+ finishReason?: "length" | "error" | "unknown" | "stop" | "content-filter" | "tool-calls" | "other" | undefined;
552
+ usage?: {
553
+ inputTokens?: number | undefined;
554
+ outputTokens?: number | undefined;
555
+ totalTokens?: number | undefined;
556
+ reasoningTokens?: number | undefined;
557
+ cachedInputTokens?: number | undefined;
558
+ } | undefined;
559
+ diagnostics?: {
560
+ code: "output_file_limit_exceeded" | "output_file_too_large" | "output_budget_exhausted" | "output_collection_failed" | "output_file_changed" | "output_storage_failed";
561
+ message: string;
562
+ severity: "error" | "warning";
563
+ scope: "output";
564
+ path?: string | undefined;
565
+ }[] | undefined;
566
+ };
567
+ } | {
568
+ error: string;
569
+ };
570
+ 403: {
571
+ error: string;
572
+ };
573
+ 400: {
574
+ error: string;
575
+ };
576
+ 404: {
577
+ error: string;
578
+ };
579
+ 501: {
580
+ error: string;
581
+ };
582
+ 409: {
583
+ error: string;
584
+ };
585
+ 202: {
586
+ run: {
587
+ status: "queued" | "running" | "succeeded" | "failed" | "cancelled";
588
+ projectId: string;
589
+ agentId: string;
590
+ id: string;
591
+ threadId: string;
592
+ createdAt: string;
593
+ triggerMessageId: string;
594
+ requestedByPrincipal: {
595
+ type: "serviceAccount" | "user" | "system";
596
+ id: string;
597
+ };
598
+ attempt: number;
599
+ streamId: string;
600
+ error?: string | undefined;
601
+ startedAt?: string | undefined;
602
+ completedAt?: string | undefined;
603
+ executionPrincipal?: {
604
+ type: "serviceAccount" | "user" | "system";
605
+ id: string;
606
+ } | undefined;
607
+ modelId?: string | undefined;
608
+ finishReason?: "length" | "error" | "unknown" | "stop" | "content-filter" | "tool-calls" | "other" | undefined;
609
+ usage?: {
610
+ inputTokens?: number | undefined;
611
+ outputTokens?: number | undefined;
612
+ totalTokens?: number | undefined;
613
+ reasoningTokens?: number | undefined;
614
+ cachedInputTokens?: number | undefined;
615
+ } | undefined;
616
+ diagnostics?: {
617
+ code: "output_file_limit_exceeded" | "output_file_too_large" | "output_budget_exhausted" | "output_collection_failed" | "output_file_changed" | "output_storage_failed";
618
+ message: string;
619
+ severity: "error" | "warning";
620
+ scope: "output";
621
+ path?: string | undefined;
622
+ }[] | undefined;
623
+ };
624
+ };
625
+ 422: {
626
+ type: "validation";
627
+ on: string;
628
+ summary?: string;
629
+ message?: string;
630
+ found?: unknown;
631
+ property?: string;
632
+ expected?: string;
633
+ };
634
+ };
635
+ };
636
+ };
637
+ };
638
+ };
639
+ };
640
+ } & {
641
+ api: {
642
+ "agent-threads": {
643
+ ":threadId": {
644
+ cancel: {
645
+ post: {
646
+ body: {
647
+ runId: string;
648
+ };
649
+ params: {
650
+ threadId: string;
651
+ };
652
+ query: unknown;
653
+ headers: unknown;
654
+ response: {
655
+ 200: {
656
+ run: {
657
+ status: "queued" | "running" | "succeeded" | "failed" | "cancelled";
658
+ projectId: string;
659
+ agentId: string;
660
+ id: string;
661
+ threadId: string;
662
+ createdAt: string;
663
+ triggerMessageId: string;
664
+ requestedByPrincipal: {
665
+ type: "serviceAccount" | "user" | "system";
666
+ id: string;
667
+ };
668
+ attempt: number;
669
+ streamId: string;
670
+ error?: string | undefined;
671
+ startedAt?: string | undefined;
672
+ completedAt?: string | undefined;
673
+ executionPrincipal?: {
674
+ type: "serviceAccount" | "user" | "system";
675
+ id: string;
676
+ } | undefined;
677
+ modelId?: string | undefined;
678
+ finishReason?: "length" | "error" | "unknown" | "stop" | "content-filter" | "tool-calls" | "other" | undefined;
679
+ usage?: {
680
+ inputTokens?: number | undefined;
681
+ outputTokens?: number | undefined;
682
+ totalTokens?: number | undefined;
683
+ reasoningTokens?: number | undefined;
684
+ cachedInputTokens?: number | undefined;
685
+ } | undefined;
686
+ diagnostics?: {
687
+ code: "output_file_limit_exceeded" | "output_file_too_large" | "output_budget_exhausted" | "output_collection_failed" | "output_file_changed" | "output_storage_failed";
688
+ message: string;
689
+ severity: "error" | "warning";
690
+ scope: "output";
691
+ path?: string | undefined;
692
+ }[] | undefined;
693
+ };
694
+ } | {
695
+ error: string;
696
+ };
697
+ 400: {
698
+ error: string;
699
+ };
700
+ 404: {
701
+ error: string;
702
+ };
703
+ 501: {
704
+ error: string;
705
+ };
706
+ 409: {
707
+ error: string;
708
+ };
709
+ 202: {
710
+ run: {
711
+ status: "queued" | "running" | "succeeded" | "failed" | "cancelled";
712
+ projectId: string;
713
+ agentId: string;
714
+ id: string;
715
+ threadId: string;
716
+ createdAt: string;
717
+ triggerMessageId: string;
718
+ requestedByPrincipal: {
719
+ type: "serviceAccount" | "user" | "system";
720
+ id: string;
721
+ };
722
+ attempt: number;
723
+ streamId: string;
724
+ error?: string | undefined;
725
+ startedAt?: string | undefined;
726
+ completedAt?: string | undefined;
727
+ executionPrincipal?: {
728
+ type: "serviceAccount" | "user" | "system";
729
+ id: string;
730
+ } | undefined;
731
+ modelId?: string | undefined;
732
+ finishReason?: "length" | "error" | "unknown" | "stop" | "content-filter" | "tool-calls" | "other" | undefined;
733
+ usage?: {
734
+ inputTokens?: number | undefined;
735
+ outputTokens?: number | undefined;
736
+ totalTokens?: number | undefined;
737
+ reasoningTokens?: number | undefined;
738
+ cachedInputTokens?: number | undefined;
739
+ } | undefined;
740
+ diagnostics?: {
741
+ code: "output_file_limit_exceeded" | "output_file_too_large" | "output_budget_exhausted" | "output_collection_failed" | "output_file_changed" | "output_storage_failed";
742
+ message: string;
743
+ severity: "error" | "warning";
744
+ scope: "output";
745
+ path?: string | undefined;
746
+ }[] | undefined;
747
+ };
748
+ };
749
+ 422: {
750
+ type: "validation";
751
+ on: string;
752
+ summary?: string;
753
+ message?: string;
754
+ found?: unknown;
755
+ property?: string;
756
+ expected?: string;
757
+ };
758
+ };
759
+ };
760
+ };
761
+ };
762
+ };
763
+ };
764
+ } & {
765
+ api: {
766
+ "agent-threads": {
767
+ ":threadId": {
768
+ runs: {
769
+ ":runId": {
770
+ retry: {
771
+ post: {
772
+ body: unknown;
773
+ params: {
774
+ runId: string;
775
+ threadId: string;
776
+ };
777
+ query: unknown;
778
+ headers: unknown;
779
+ response: {
780
+ 200: {
781
+ run: {
782
+ status: "queued" | "running" | "succeeded" | "failed" | "cancelled";
783
+ projectId: string;
784
+ agentId: string;
785
+ id: string;
786
+ threadId: string;
787
+ createdAt: string;
788
+ triggerMessageId: string;
789
+ requestedByPrincipal: {
790
+ type: "serviceAccount" | "user" | "system";
791
+ id: string;
792
+ };
793
+ attempt: number;
794
+ streamId: string;
795
+ error?: string | undefined;
796
+ startedAt?: string | undefined;
797
+ completedAt?: string | undefined;
798
+ executionPrincipal?: {
799
+ type: "serviceAccount" | "user" | "system";
800
+ id: string;
801
+ } | undefined;
802
+ modelId?: string | undefined;
803
+ finishReason?: "length" | "error" | "unknown" | "stop" | "content-filter" | "tool-calls" | "other" | undefined;
804
+ usage?: {
805
+ inputTokens?: number | undefined;
806
+ outputTokens?: number | undefined;
807
+ totalTokens?: number | undefined;
808
+ reasoningTokens?: number | undefined;
809
+ cachedInputTokens?: number | undefined;
810
+ } | undefined;
811
+ diagnostics?: {
812
+ code: "output_file_limit_exceeded" | "output_file_too_large" | "output_budget_exhausted" | "output_collection_failed" | "output_file_changed" | "output_storage_failed";
813
+ message: string;
814
+ severity: "error" | "warning";
815
+ scope: "output";
816
+ path?: string | undefined;
817
+ }[] | undefined;
818
+ };
819
+ } | {
820
+ error: string;
821
+ };
822
+ 400: {
823
+ error: string;
824
+ };
825
+ 404: {
826
+ error: string;
827
+ };
828
+ 501: {
829
+ error: string;
830
+ };
831
+ 409: {
832
+ error: string;
833
+ };
834
+ 202: {
835
+ run: {
836
+ status: "queued" | "running" | "succeeded" | "failed" | "cancelled";
837
+ projectId: string;
838
+ agentId: string;
839
+ id: string;
840
+ threadId: string;
841
+ createdAt: string;
842
+ triggerMessageId: string;
843
+ requestedByPrincipal: {
844
+ type: "serviceAccount" | "user" | "system";
845
+ id: string;
846
+ };
847
+ attempt: number;
848
+ streamId: string;
849
+ error?: string | undefined;
850
+ startedAt?: string | undefined;
851
+ completedAt?: string | undefined;
852
+ executionPrincipal?: {
853
+ type: "serviceAccount" | "user" | "system";
854
+ id: string;
855
+ } | undefined;
856
+ modelId?: string | undefined;
857
+ finishReason?: "length" | "error" | "unknown" | "stop" | "content-filter" | "tool-calls" | "other" | undefined;
858
+ usage?: {
859
+ inputTokens?: number | undefined;
860
+ outputTokens?: number | undefined;
861
+ totalTokens?: number | undefined;
862
+ reasoningTokens?: number | undefined;
863
+ cachedInputTokens?: number | undefined;
864
+ } | undefined;
865
+ diagnostics?: {
866
+ code: "output_file_limit_exceeded" | "output_file_too_large" | "output_budget_exhausted" | "output_collection_failed" | "output_file_changed" | "output_storage_failed";
867
+ message: string;
868
+ severity: "error" | "warning";
869
+ scope: "output";
870
+ path?: string | undefined;
871
+ }[] | undefined;
872
+ };
873
+ };
874
+ 422: {
875
+ type: "validation";
876
+ on: string;
877
+ summary?: string;
878
+ message?: string;
879
+ found?: unknown;
880
+ property?: string;
881
+ expected?: string;
882
+ };
883
+ };
884
+ };
885
+ };
886
+ };
887
+ };
888
+ };
889
+ };
890
+ };
891
+ } & {
892
+ api: {
893
+ "agent-threads": {
894
+ ":threadId": {
895
+ runs: {
896
+ get: {
897
+ body: unknown;
898
+ params: {
899
+ threadId: string;
900
+ };
901
+ query: {
902
+ status?: "queued" | "running" | "succeeded" | "failed" | "cancelled" | undefined;
903
+ limit?: string | undefined;
904
+ offset?: string | undefined;
905
+ order?: "asc" | "desc" | undefined;
906
+ };
907
+ headers: unknown;
908
+ response: {
909
+ 200: {
910
+ runs: {
911
+ status: "queued" | "running" | "succeeded" | "failed" | "cancelled";
912
+ projectId: string;
913
+ agentId: string;
914
+ id: string;
915
+ threadId: string;
916
+ createdAt: string;
917
+ triggerMessageId: string;
918
+ requestedByPrincipal: {
919
+ type: "serviceAccount" | "user" | "system";
920
+ id: string;
921
+ };
922
+ attempt: number;
923
+ streamId: string;
924
+ error?: string | undefined;
925
+ startedAt?: string | undefined;
926
+ completedAt?: string | undefined;
927
+ executionPrincipal?: {
928
+ type: "serviceAccount" | "user" | "system";
929
+ id: string;
930
+ } | undefined;
931
+ modelId?: string | undefined;
932
+ finishReason?: "length" | "error" | "unknown" | "stop" | "content-filter" | "tool-calls" | "other" | undefined;
933
+ usage?: {
934
+ inputTokens?: number | undefined;
935
+ outputTokens?: number | undefined;
936
+ totalTokens?: number | undefined;
937
+ reasoningTokens?: number | undefined;
938
+ cachedInputTokens?: number | undefined;
939
+ } | undefined;
940
+ diagnostics?: {
941
+ code: "output_file_limit_exceeded" | "output_file_too_large" | "output_budget_exhausted" | "output_collection_failed" | "output_file_changed" | "output_storage_failed";
942
+ message: string;
943
+ severity: "error" | "warning";
944
+ scope: "output";
945
+ path?: string | undefined;
946
+ }[] | undefined;
947
+ }[];
948
+ hasMore: boolean;
949
+ total: number;
950
+ };
951
+ 400: {
952
+ error: string;
953
+ };
954
+ 404: {
955
+ error: string;
956
+ };
957
+ 501: {
958
+ error: string;
959
+ };
960
+ 422: {
961
+ type: "validation";
962
+ on: string;
963
+ summary?: string;
964
+ message?: string;
965
+ found?: unknown;
966
+ property?: string;
967
+ expected?: string;
968
+ };
969
+ };
970
+ };
971
+ };
972
+ };
973
+ };
974
+ };
975
+ } & {
976
+ api: {
977
+ "agent-runs": {
978
+ ":runId": {
979
+ get: {
980
+ body: unknown;
981
+ params: {
982
+ runId: string;
983
+ };
984
+ query: unknown;
985
+ headers: unknown;
986
+ response: {
987
+ 200: {
988
+ status: "queued" | "running" | "succeeded" | "failed" | "cancelled";
989
+ projectId: string;
990
+ agentId: string;
991
+ id: string;
992
+ threadId: string;
993
+ createdAt: string;
994
+ triggerMessageId: string;
995
+ requestedByPrincipal: {
996
+ type: "serviceAccount" | "user" | "system";
997
+ id: string;
998
+ };
999
+ attempt: number;
1000
+ streamId: string;
1001
+ error?: string | undefined;
1002
+ startedAt?: string | undefined;
1003
+ completedAt?: string | undefined;
1004
+ executionPrincipal?: {
1005
+ type: "serviceAccount" | "user" | "system";
1006
+ id: string;
1007
+ } | undefined;
1008
+ modelId?: string | undefined;
1009
+ finishReason?: "length" | "error" | "unknown" | "stop" | "content-filter" | "tool-calls" | "other" | undefined;
1010
+ usage?: {
1011
+ inputTokens?: number | undefined;
1012
+ outputTokens?: number | undefined;
1013
+ totalTokens?: number | undefined;
1014
+ reasoningTokens?: number | undefined;
1015
+ cachedInputTokens?: number | undefined;
1016
+ } | undefined;
1017
+ diagnostics?: {
1018
+ code: "output_file_limit_exceeded" | "output_file_too_large" | "output_budget_exhausted" | "output_collection_failed" | "output_file_changed" | "output_storage_failed";
1019
+ message: string;
1020
+ severity: "error" | "warning";
1021
+ scope: "output";
1022
+ path?: string | undefined;
1023
+ }[] | undefined;
1024
+ };
1025
+ 400: {
1026
+ error: string;
1027
+ };
1028
+ 404: {
1029
+ error: string;
1030
+ };
1031
+ 501: {
1032
+ error: string;
1033
+ };
1034
+ 422: {
1035
+ type: "validation";
1036
+ on: string;
1037
+ summary?: string;
1038
+ message?: string;
1039
+ found?: unknown;
1040
+ property?: string;
1041
+ expected?: string;
1042
+ };
1043
+ };
1044
+ };
1045
+ };
1046
+ };
1047
+ };
1048
+ }, {
1049
+ derive: {};
1050
+ resolve: {};
1051
+ schema: {};
1052
+ standaloneSchema: {};
1053
+ response: {};
1054
+ }, {
1055
+ derive: {};
1056
+ resolve: {};
1057
+ schema: {};
1058
+ standaloneSchema: {};
1059
+ response: {};
1060
+ }>;
1061
+ //# sourceMappingURL=agents.d.ts.map