@sixb/server 0.1.21 → 0.1.22

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 (165) hide show
  1. package/dist/artifacts/frame.d.ts +5 -0
  2. package/dist/artifacts/frame.d.ts.map +1 -1
  3. package/dist/auth/browser-origin.d.ts +5 -1
  4. package/dist/auth/browser-origin.d.ts.map +1 -1
  5. package/dist/auth/experience.d.ts +1 -0
  6. package/dist/auth/experience.d.ts.map +1 -1
  7. package/dist/auth/public-routes.d.ts.map +1 -1
  8. package/dist/auth/responses.d.ts +1 -1
  9. package/dist/auth/responses.d.ts.map +1 -1
  10. package/dist/auth/scope.d.ts +19 -3
  11. package/dist/auth/scope.d.ts.map +1 -1
  12. package/dist/index.js +10093 -7553
  13. package/dist/index.js.map +51 -39
  14. package/dist/models/display.d.ts +27 -0
  15. package/dist/models/display.d.ts.map +1 -1
  16. package/dist/openapi/components.d.ts +14 -0
  17. package/dist/openapi/components.d.ts.map +1 -0
  18. package/dist/openapi/tags.d.ts +14 -2
  19. package/dist/openapi/tags.d.ts.map +1 -1
  20. package/dist/registerRoutes.d.ts.map +1 -1
  21. package/dist/routes/actions.d.ts +5 -5
  22. package/dist/routes/agent-api-gateway.d.ts.map +1 -1
  23. package/dist/routes/agent-approval-gate.d.ts +27 -0
  24. package/dist/routes/agent-approval-gate.d.ts.map +1 -0
  25. package/dist/routes/agent-approvals.d.ts +599 -0
  26. package/dist/routes/agent-approvals.d.ts.map +1 -0
  27. package/dist/routes/agent-children.d.ts +318 -0
  28. package/dist/routes/agent-children.d.ts.map +1 -0
  29. package/dist/routes/agent-memory.d.ts +267 -0
  30. package/dist/routes/agent-memory.d.ts.map +1 -0
  31. package/dist/routes/agents.d.ts +999 -80
  32. package/dist/routes/agents.d.ts.map +1 -1
  33. package/dist/routes/ai-accounting.d.ts.map +1 -1
  34. package/dist/routes/artifact-frames.d.ts +3 -3
  35. package/dist/routes/artifact-frames.d.ts.map +1 -1
  36. package/dist/routes/artifacts.d.ts +790 -134
  37. package/dist/routes/artifacts.d.ts.map +1 -1
  38. package/dist/routes/auth.d.ts +116 -10
  39. package/dist/routes/auth.d.ts.map +1 -1
  40. package/dist/routes/connector-connection-runs.d.ts +50 -50
  41. package/dist/routes/connectors.d.ts +2 -2
  42. package/dist/routes/datasets.d.ts +20 -20
  43. package/dist/routes/events.d.ts +4 -4
  44. package/dist/routes/files.d.ts +14 -14
  45. package/dist/routes/files.d.ts.map +1 -1
  46. package/dist/routes/links.d.ts +2 -2
  47. package/dist/routes/logs.d.ts +5 -5
  48. package/dist/routes/model-calls.d.ts +155 -0
  49. package/dist/routes/model-calls.d.ts.map +1 -0
  50. package/dist/routes/model-generations.d.ts +400 -0
  51. package/dist/routes/model-generations.d.ts.map +1 -0
  52. package/dist/routes/models.d.ts +434 -1
  53. package/dist/routes/models.d.ts.map +1 -1
  54. package/dist/routes/objects.d.ts +71 -40
  55. package/dist/routes/objects.d.ts.map +1 -1
  56. package/dist/routes/observed-agent-threads.d.ts +682 -0
  57. package/dist/routes/observed-agent-threads.d.ts.map +1 -0
  58. package/dist/routes/ontology.d.ts +66 -62
  59. package/dist/routes/ontology.d.ts.map +1 -1
  60. package/dist/routes/pipelines.d.ts +24 -24
  61. package/dist/routes/projections.d.ts +55 -55
  62. package/dist/routes/rules.d.ts +2 -2
  63. package/dist/routes/share-grants.d.ts +9 -9
  64. package/dist/routes/syncs.d.ts +46 -46
  65. package/dist/routes/users.d.ts +117 -0
  66. package/dist/routes/users.d.ts.map +1 -0
  67. package/dist/routes/webhook-runs.d.ts +1 -1
  68. package/dist/routes/workflows.d.ts +118 -52
  69. package/dist/routes/workflows.d.ts.map +1 -1
  70. package/dist/routes/ws/agents.d.ts +7 -2
  71. package/dist/routes/ws/agents.d.ts.map +1 -1
  72. package/dist/routes/ws/events.d.ts +6 -6
  73. package/dist/routes/ws/logs.d.ts +14 -14
  74. package/dist/schemas/actions.d.ts +15 -15
  75. package/dist/schemas/activity.d.ts +48 -28
  76. package/dist/schemas/activity.d.ts.map +1 -1
  77. package/dist/schemas/agent-approvals.d.ts +1091 -0
  78. package/dist/schemas/agent-approvals.d.ts.map +1 -0
  79. package/dist/schemas/agent-memory.d.ts +250 -0
  80. package/dist/schemas/agent-memory.d.ts.map +1 -0
  81. package/dist/schemas/agents.d.ts +5442 -369
  82. package/dist/schemas/agents.d.ts.map +1 -1
  83. package/dist/schemas/ai-accounting.d.ts +1290 -411
  84. package/dist/schemas/ai-accounting.d.ts.map +1 -1
  85. package/dist/schemas/ai-limits.d.ts +10 -10
  86. package/dist/schemas/ai-usage.d.ts +12 -0
  87. package/dist/schemas/ai-usage.d.ts.map +1 -1
  88. package/dist/schemas/artifacts.d.ts +650 -98
  89. package/dist/schemas/artifacts.d.ts.map +1 -1
  90. package/dist/schemas/auth.d.ts +119 -46
  91. package/dist/schemas/auth.d.ts.map +1 -1
  92. package/dist/schemas/connectors.d.ts +22 -22
  93. package/dist/schemas/datasets.d.ts +98 -98
  94. package/dist/schemas/event-payloads.d.ts +6 -6
  95. package/dist/schemas/events.d.ts +26 -26
  96. package/dist/schemas/events.d.ts.map +1 -1
  97. package/dist/schemas/files.d.ts +24 -24
  98. package/dist/schemas/links.d.ts +2 -2
  99. package/dist/schemas/logs.d.ts +32 -32
  100. package/dist/schemas/models.d.ts +8889 -10
  101. package/dist/schemas/models.d.ts.map +1 -1
  102. package/dist/schemas/objects.d.ts +48 -12
  103. package/dist/schemas/objects.d.ts.map +1 -1
  104. package/dist/schemas/ontology.d.ts +127 -104
  105. package/dist/schemas/ontology.d.ts.map +1 -1
  106. package/dist/schemas/pipelines.d.ts +132 -132
  107. package/dist/schemas/projections.d.ts +314 -314
  108. package/dist/schemas/rules.d.ts +4 -4
  109. package/dist/schemas/share-grants.d.ts +30 -30
  110. package/dist/schemas/syncs.d.ts +49 -49
  111. package/dist/schemas/users.d.ts +72 -0
  112. package/dist/schemas/users.d.ts.map +1 -0
  113. package/dist/schemas/webhook-runs.d.ts +6 -6
  114. package/dist/schemas/workflows.d.ts +701 -186
  115. package/dist/schemas/workflows.d.ts.map +1 -1
  116. package/dist/server.d.ts +1 -0
  117. package/dist/server.d.ts.map +1 -1
  118. package/dist/utils/http.d.ts.map +1 -1
  119. package/package.json +7 -7
  120. package/src/artifacts/frame.ts +6 -1
  121. package/src/auth/browser-origin.ts +8 -3
  122. package/src/auth/experience.ts +1 -1
  123. package/src/auth/guard.ts +2 -2
  124. package/src/auth/public-routes.ts +6 -0
  125. package/src/auth/responses.ts +7 -6
  126. package/src/auth/scope.ts +32 -3
  127. package/src/models/display.ts +61 -16
  128. package/src/openapi/components.ts +54 -0
  129. package/src/openapi/tags.ts +12 -0
  130. package/src/registerRoutes.ts +14 -0
  131. package/src/routes/agent-api-gateway.ts +115 -91
  132. package/src/routes/agent-approval-gate.ts +213 -0
  133. package/src/routes/agent-approvals.ts +299 -0
  134. package/src/routes/agent-children.ts +209 -0
  135. package/src/routes/agent-memory.ts +210 -0
  136. package/src/routes/agents.ts +363 -142
  137. package/src/routes/ai-accounting.ts +4 -0
  138. package/src/routes/artifact-frames.ts +14 -8
  139. package/src/routes/artifacts.ts +297 -22
  140. package/src/routes/auth.ts +306 -13
  141. package/src/routes/files.ts +6 -7
  142. package/src/routes/model-calls.ts +120 -0
  143. package/src/routes/model-generations.ts +245 -0
  144. package/src/routes/models.ts +116 -9
  145. package/src/routes/objects.ts +55 -61
  146. package/src/routes/observed-agent-threads.ts +253 -0
  147. package/src/routes/ontology.ts +1 -0
  148. package/src/routes/users.ts +73 -0
  149. package/src/routes/workflows.ts +6 -9
  150. package/src/routes/ws/agents.ts +10 -5
  151. package/src/schemas/activity.ts +2 -0
  152. package/src/schemas/agent-approvals.ts +129 -0
  153. package/src/schemas/agent-memory.ts +96 -0
  154. package/src/schemas/agents.ts +239 -0
  155. package/src/schemas/ai-accounting.ts +40 -4
  156. package/src/schemas/ai-usage.ts +10 -0
  157. package/src/schemas/artifacts.ts +91 -3
  158. package/src/schemas/auth.ts +25 -0
  159. package/src/schemas/models.ts +197 -1
  160. package/src/schemas/objects.ts +181 -0
  161. package/src/schemas/ontology.ts +1 -0
  162. package/src/schemas/users.ts +24 -0
  163. package/src/schemas/workflows.ts +2 -0
  164. package/src/server.ts +9 -10
  165. package/src/utils/http.ts +2 -0
@@ -0,0 +1,682 @@
1
+ import type { SixbHostView } from "@sixb/core";
2
+ import type { Elysia } from "elysia";
3
+ /**
4
+ * Any user's conversation, read-only, with `can.observe(agent.threads)`. These routes are apart
5
+ * from `/api/agent-threads`, which stay the owner's: nothing here writes, and a reader without the
6
+ * grant gets 403 rather than the owner routes' 404.
7
+ */
8
+ export declare function registerObservedAgentThreadRoutes(app: Elysia, host: SixbHostView): Elysia<"", {
9
+ decorator: {};
10
+ store: {};
11
+ derive: {};
12
+ resolve: {};
13
+ }, {
14
+ typebox: {};
15
+ error: {};
16
+ }, {
17
+ schema: {};
18
+ standaloneSchema: {};
19
+ macro: {};
20
+ macroFn: {};
21
+ parser: {};
22
+ response: {};
23
+ }, {
24
+ api: {
25
+ "observed-agent-threads": {
26
+ ":threadId": {
27
+ get: {
28
+ body: unknown;
29
+ params: {
30
+ threadId: string;
31
+ };
32
+ query: unknown;
33
+ headers: unknown;
34
+ response: {
35
+ 200: {
36
+ status: "active" | "archived";
37
+ projectId: string;
38
+ id: string;
39
+ kind: "conversation" | "subagent";
40
+ createdAt: string;
41
+ ownerPrincipal: {
42
+ id: string;
43
+ type: "user" | "serviceAccount" | "system";
44
+ };
45
+ owner: {
46
+ id: string;
47
+ type: "user" | "serviceAccount" | "system";
48
+ displayName?: string | undefined;
49
+ };
50
+ participants: {
51
+ principal: {
52
+ id: string;
53
+ type: "user";
54
+ displayName?: string | undefined;
55
+ };
56
+ addedAt: string;
57
+ addedBy: {
58
+ id: string;
59
+ type: "user" | "serviceAccount" | "system";
60
+ };
61
+ }[];
62
+ activeRunId: string | null;
63
+ messageCount: number;
64
+ updatedAt: string;
65
+ title?: string | undefined;
66
+ approvalMode?: "manual" | "accept-edits" | "auto" | undefined;
67
+ approvalModeSource?: "default" | "thread" | "fallback" | "run" | undefined;
68
+ sandboxState?: {
69
+ status: "unavailable" | "new" | "busy" | "ready" | "blocked";
70
+ name: string;
71
+ initialized: boolean;
72
+ } | undefined;
73
+ parent?: {
74
+ threadId: string;
75
+ key: string;
76
+ spawnedBy: string;
77
+ } | undefined;
78
+ sandboxParams?: Record<string, import("../schemas/common").JsonValue> | undefined;
79
+ lastMessageAt?: string | undefined;
80
+ };
81
+ 404: {
82
+ error: string;
83
+ };
84
+ 403: {
85
+ error: string;
86
+ };
87
+ 400: {
88
+ error: string;
89
+ };
90
+ 501: {
91
+ error: string;
92
+ };
93
+ 422: {
94
+ type: "validation";
95
+ on: string;
96
+ summary?: string;
97
+ message?: string;
98
+ found?: unknown;
99
+ property?: string;
100
+ expected?: string;
101
+ };
102
+ };
103
+ };
104
+ };
105
+ };
106
+ };
107
+ } & {
108
+ api: {
109
+ "observed-agent-threads": {
110
+ ":threadId": {
111
+ messages: {
112
+ get: {
113
+ body: unknown;
114
+ params: {
115
+ threadId: string;
116
+ };
117
+ query: {
118
+ limit?: string | undefined;
119
+ offset?: string | undefined;
120
+ order?: "asc" | "desc" | undefined;
121
+ role?: "user" | "system" | "assistant" | undefined;
122
+ };
123
+ headers: unknown;
124
+ response: {
125
+ 200: {
126
+ hasMore: boolean;
127
+ total: number;
128
+ messages: {
129
+ projectId: string;
130
+ id: string;
131
+ runId: string | null;
132
+ threadId: string;
133
+ createdAt: string;
134
+ parts: ({
135
+ origin: "ambient" | "explicit";
136
+ context: {
137
+ kind: "object";
138
+ ref: {
139
+ objectTypeId: string;
140
+ primaryId: string;
141
+ };
142
+ label?: string | undefined;
143
+ } | {
144
+ id: string;
145
+ kind: "app-state";
146
+ value: import("../schemas/common").JsonValue;
147
+ description: string;
148
+ label: string;
149
+ };
150
+ type: "context";
151
+ } | {
152
+ type: "text";
153
+ text: string;
154
+ providerMetadata?: import("../schemas/common").JsonValue | undefined;
155
+ } | {
156
+ type: "reasoning";
157
+ text: string;
158
+ providerMetadata?: import("../schemas/common").JsonValue | undefined;
159
+ } | {
160
+ type: "step-start";
161
+ } | {
162
+ type: "file";
163
+ fileRef: {
164
+ blobId: string;
165
+ digest: string;
166
+ sizeBytes: number;
167
+ fileName?: string | undefined;
168
+ mediaType?: string | undefined;
169
+ logicalPath?: string | undefined;
170
+ };
171
+ providerMetadata?: import("../schemas/common").JsonValue | undefined;
172
+ } | {
173
+ type: "provider-state";
174
+ providerId: string;
175
+ data: import("../schemas/common").JsonValue;
176
+ } | {
177
+ type: "tool-call";
178
+ input: import("../schemas/common").JsonValue;
179
+ output: import("../schemas/common").JsonValue;
180
+ toolCallId: string;
181
+ toolName: string;
182
+ state: "output-available";
183
+ providerMetadata?: import("../schemas/common").JsonValue | undefined;
184
+ dynamic?: boolean | undefined;
185
+ providerExecuted?: boolean | undefined;
186
+ } | {
187
+ type: "tool-call";
188
+ input: import("../schemas/common").JsonValue;
189
+ toolCallId: string;
190
+ toolName: string;
191
+ state: "output-error";
192
+ errorText: string;
193
+ providerMetadata?: import("../schemas/common").JsonValue | undefined;
194
+ dynamic?: boolean | undefined;
195
+ providerExecuted?: boolean | undefined;
196
+ } | {
197
+ type: "continuation";
198
+ } | {
199
+ status: "approved" | "denied" | "cancelled" | "superseded" | "expired";
200
+ type: "approval-outcome";
201
+ call: {
202
+ kind: "action";
203
+ actionId: string;
204
+ subject: {
205
+ kind: "none";
206
+ } | {
207
+ kind: "object";
208
+ objectTypeId: string;
209
+ primaryId: string;
210
+ };
211
+ } | {
212
+ kind: "workflow";
213
+ workflowId: string;
214
+ };
215
+ approvalId: string;
216
+ caller?: {
217
+ runId: string;
218
+ key: string;
219
+ continues?: true | undefined;
220
+ } | undefined;
221
+ outcome?: {
222
+ status: "succeeded" | "failed";
223
+ kind: "action-run";
224
+ runId: string;
225
+ error?: import("@sixb/core").ActionRunFailure<"validation" | "writeback" | "edits" | "effects" | "commit"> | undefined;
226
+ } | {
227
+ kind: "workflow-run";
228
+ runId: string;
229
+ queuedAt: string;
230
+ } | {
231
+ error: {
232
+ at: string;
233
+ code: "action.phase_failed" | "action.read_conflict" | "action.rejected" | "action.run_in_progress" | "action.timeout" | "agent.approval_authority_lost" | "agent.execution_failed" | "ai.usage_limit_exceeded" | "ai.usage_limit_unavailable" | "connector.adapter_invalid" | "connector.authorization_invalid" | "connector.authorization_required" | "connector.configuration_invalid" | "connector.credentials_unavailable" | "connector.not_found" | "connector.operation_conflict" | "connector.operation_in_progress" | "connector.provider_failed" | "connector.provider_unavailable" | "connector.replacement_required" | "connector.revocation_pending" | "dataset.not_found" | "dataset.version_incompatible" | "dataset.version_not_found" | "dataset.version_read_inconsistent" | "event.delivery_failed" | "internal.unexpected" | "queue.enqueue_failed" | "object.not_found" | "object.unique_violation" | "pipeline.step_failed" | "projection.definition_invalid" | "projection.execution_failed" | "projection.not_found" | "projection.run_already_terminal" | "projection.run_identity_mismatch" | "runtime.cancelled" | "runtime.stopping" | "vector.model_unavailable" | "vector.response_invalid" | "vector.outcome_unknown" | "storage.unavailable" | "sync.execution_failed" | "webhook.delivery_failed" | "webhook.delivery_rejected" | "workflow.node_failed";
234
+ message: string;
235
+ retryable: boolean;
236
+ details?: import("../schemas/common").JsonValue | undefined;
237
+ httpStatus?: number | undefined;
238
+ redacted?: true | undefined;
239
+ truncated?: true | undefined;
240
+ };
241
+ kind: "error";
242
+ } | undefined;
243
+ } | {
244
+ id: string;
245
+ kind: "message" | "answer";
246
+ type: "mail";
247
+ text: string;
248
+ from: "parent";
249
+ inReplyTo?: string | undefined;
250
+ afterAnswer?: true | undefined;
251
+ })[];
252
+ role: "user" | "system" | "assistant";
253
+ seq: number;
254
+ annotations: {
255
+ code: "step_limit_reached" | "output_limit_reached";
256
+ message: string;
257
+ severity: "error" | "warning";
258
+ scope: "run";
259
+ }[];
260
+ contentVersion: number;
261
+ completedAt?: string | undefined;
262
+ authorPrincipal?: {
263
+ id: string;
264
+ type: "user" | "serviceAccount" | "system";
265
+ } | undefined;
266
+ compaction?: {
267
+ createdAt: string;
268
+ checkpointId: string;
269
+ summary: string;
270
+ } | undefined;
271
+ metadata?: import("../schemas/common").JsonValue | undefined;
272
+ }[];
273
+ authors: {
274
+ id: string;
275
+ type: "user" | "serviceAccount" | "system";
276
+ displayName?: string | undefined;
277
+ }[];
278
+ };
279
+ 404: {
280
+ error: string;
281
+ };
282
+ 403: {
283
+ error: string;
284
+ };
285
+ 400: {
286
+ error: string;
287
+ };
288
+ 501: {
289
+ error: string;
290
+ };
291
+ 422: {
292
+ type: "validation";
293
+ on: string;
294
+ summary?: string;
295
+ message?: string;
296
+ found?: unknown;
297
+ property?: string;
298
+ expected?: string;
299
+ };
300
+ };
301
+ };
302
+ };
303
+ };
304
+ };
305
+ };
306
+ } & {
307
+ api: {
308
+ "observed-agent-threads": {
309
+ ":threadId": {
310
+ messages: {
311
+ ":messageId": {
312
+ files: {
313
+ content: {
314
+ get: {
315
+ body: unknown;
316
+ params: {
317
+ threadId: string;
318
+ messageId: string;
319
+ };
320
+ query: {
321
+ path: string;
322
+ disposition?: "inline" | "attachment" | undefined;
323
+ v?: string | undefined;
324
+ };
325
+ headers: unknown;
326
+ response: {
327
+ 200: Response | {
328
+ readonly error: string;
329
+ readonly code: import("@sixb/core").AgentRequestErrorCode;
330
+ } | {
331
+ error: string;
332
+ };
333
+ 422: {
334
+ type: "validation";
335
+ on: string;
336
+ summary?: string;
337
+ message?: string;
338
+ found?: unknown;
339
+ property?: string;
340
+ expected?: string;
341
+ };
342
+ };
343
+ };
344
+ };
345
+ };
346
+ };
347
+ };
348
+ };
349
+ };
350
+ };
351
+ } & {
352
+ api: {
353
+ "observed-agent-threads": {
354
+ ":threadId": {
355
+ runs: {
356
+ get: {
357
+ body: unknown;
358
+ params: {
359
+ threadId: string;
360
+ };
361
+ query: {
362
+ status?: "succeeded" | "failed" | "cancelled" | "queued" | "running" | undefined;
363
+ limit?: string | undefined;
364
+ offset?: string | undefined;
365
+ order?: "asc" | "desc" | undefined;
366
+ };
367
+ headers: unknown;
368
+ response: {
369
+ 200: {
370
+ runs: {
371
+ status: "succeeded" | "failed" | "cancelled" | "queued" | "running";
372
+ projectId: string;
373
+ id: string;
374
+ kind: "conversation" | "subagent";
375
+ threadId: string;
376
+ createdAt: string;
377
+ attempt: number;
378
+ triggerMessageId: string;
379
+ streamId: string;
380
+ error?: import("@sixb/core").SixbFailure<"agent.execution_failed" | "ai.usage_limit_exceeded" | "ai.usage_limit_unavailable" | "internal.unexpected" | "runtime.cancelled"> | undefined;
381
+ requestedBy?: {
382
+ id: string;
383
+ type: "user" | "serviceAccount";
384
+ } | undefined;
385
+ model?: {
386
+ modelId: string;
387
+ provider: string;
388
+ } | undefined;
389
+ modelId?: string | undefined;
390
+ startedAt?: string | undefined;
391
+ completedAt?: string | undefined;
392
+ approvalMode?: "manual" | "accept-edits" | "auto" | undefined;
393
+ tier?: "light" | "standard" | "heavy" | undefined;
394
+ reasoning?: "none" | "provider-default" | "minimal" | "low" | "medium" | "high" | "xhigh" | "max" | {
395
+ budgetTokens: number;
396
+ } | undefined;
397
+ usage?: {
398
+ reportingStatus: "partial" | "complete" | "unavailable";
399
+ inputTokens?: number | undefined;
400
+ outputTokens?: number | undefined;
401
+ totalTokens?: number | undefined;
402
+ uncachedInputTokens?: number | undefined;
403
+ cacheReadInputTokens?: number | undefined;
404
+ cacheWriteInputTokens?: number | undefined;
405
+ textOutputTokens?: number | undefined;
406
+ reasoningOutputTokens?: number | undefined;
407
+ audioDurationMs?: number | undefined;
408
+ imageOutputTokens?: number | undefined;
409
+ audioOutputTokens?: number | undefined;
410
+ outputImages?: number | undefined;
411
+ inputCharacters?: number | undefined;
412
+ } | undefined;
413
+ cost?: {
414
+ amounts: {
415
+ currency: string;
416
+ amountNanos: string;
417
+ }[];
418
+ ratedCallCount: number;
419
+ unpriceableCallCount: number;
420
+ unvaluedCallCount: number;
421
+ } | undefined;
422
+ finishReason?: "error" | "length" | "unknown" | "stop" | "content-filter" | "tool-calls" | "timeout" | "interrupted" | "awaiting_approval" | "awaiting_answer" | "other" | undefined;
423
+ parentRunId?: string | undefined;
424
+ diagnostics?: {
425
+ code: "step_limit_reached" | "output_limit_reached";
426
+ message: string;
427
+ severity: "error" | "warning";
428
+ scope: "run";
429
+ }[] | undefined;
430
+ }[];
431
+ hasMore: boolean;
432
+ total: number;
433
+ };
434
+ 404: {
435
+ error: string;
436
+ };
437
+ 403: {
438
+ error: string;
439
+ };
440
+ 400: {
441
+ error: string;
442
+ };
443
+ 501: {
444
+ error: string;
445
+ };
446
+ 422: {
447
+ type: "validation";
448
+ on: string;
449
+ summary?: string;
450
+ message?: string;
451
+ found?: unknown;
452
+ property?: string;
453
+ expected?: string;
454
+ };
455
+ };
456
+ };
457
+ };
458
+ };
459
+ };
460
+ };
461
+ } & {
462
+ api: {
463
+ "observed-agent-threads": {
464
+ ":threadId": {
465
+ children: {
466
+ get: {
467
+ body: unknown;
468
+ params: {
469
+ threadId: string;
470
+ };
471
+ query: {
472
+ runId?: string | undefined;
473
+ };
474
+ headers: unknown;
475
+ response: {
476
+ 200: {
477
+ children: {
478
+ status: "succeeded" | "failed" | "cancelled" | "queued" | "running";
479
+ projectId: string;
480
+ id: string;
481
+ model: {
482
+ modelId: string;
483
+ provider: string;
484
+ };
485
+ runs: {
486
+ status: "succeeded" | "failed" | "cancelled" | "queued" | "running";
487
+ id: string;
488
+ createdAt: string;
489
+ attempt: number;
490
+ parentRunId: string;
491
+ streamId: string;
492
+ error?: import("@sixb/core").SixbFailure<"agent.execution_failed" | "ai.usage_limit_exceeded" | "ai.usage_limit_unavailable" | "internal.unexpected" | "runtime.cancelled"> | undefined;
493
+ modelId?: string | undefined;
494
+ startedAt?: string | undefined;
495
+ completedAt?: string | undefined;
496
+ result?: {
497
+ text: string;
498
+ files?: {
499
+ path: string;
500
+ fileRef: {
501
+ blobId: string;
502
+ digest: string;
503
+ sizeBytes: number;
504
+ fileName?: string | undefined;
505
+ mediaType?: string | undefined;
506
+ logicalPath?: string | undefined;
507
+ };
508
+ }[] | undefined;
509
+ filesError?: string | undefined;
510
+ } | undefined;
511
+ usage?: {
512
+ reportingStatus: "partial" | "complete" | "unavailable";
513
+ inputTokens?: number | undefined;
514
+ outputTokens?: number | undefined;
515
+ totalTokens?: number | undefined;
516
+ uncachedInputTokens?: number | undefined;
517
+ cacheReadInputTokens?: number | undefined;
518
+ cacheWriteInputTokens?: number | undefined;
519
+ textOutputTokens?: number | undefined;
520
+ reasoningOutputTokens?: number | undefined;
521
+ audioDurationMs?: number | undefined;
522
+ imageOutputTokens?: number | undefined;
523
+ audioOutputTokens?: number | undefined;
524
+ outputImages?: number | undefined;
525
+ inputCharacters?: number | undefined;
526
+ } | undefined;
527
+ cost?: {
528
+ amounts: {
529
+ currency: string;
530
+ amountNanos: string;
531
+ }[];
532
+ ratedCallCount: number;
533
+ unpriceableCallCount: number;
534
+ unvaluedCallCount: number;
535
+ } | undefined;
536
+ finishReason?: "error" | "length" | "unknown" | "stop" | "content-filter" | "tool-calls" | "timeout" | "interrupted" | "awaiting_approval" | "awaiting_answer" | "other" | undefined;
537
+ }[];
538
+ threadId: string;
539
+ key: string;
540
+ createdAt: string;
541
+ spawnedBy: string;
542
+ activeRunId: string | null;
543
+ task: string;
544
+ handedFiles: {
545
+ path: string;
546
+ fileRef: {
547
+ blobId: string;
548
+ digest: string;
549
+ sizeBytes: number;
550
+ fileName?: string | undefined;
551
+ mediaType?: string | undefined;
552
+ logicalPath?: string | undefined;
553
+ };
554
+ }[];
555
+ error?: import("@sixb/core").SixbFailure<"agent.execution_failed" | "ai.usage_limit_exceeded" | "ai.usage_limit_unavailable" | "internal.unexpected" | "runtime.cancelled"> | undefined;
556
+ completedAt?: string | undefined;
557
+ tier?: "light" | "standard" | "heavy" | undefined;
558
+ reasoning?: "none" | "provider-default" | "minimal" | "low" | "medium" | "high" | "xhigh" | "max" | {
559
+ budgetTokens: number;
560
+ } | undefined;
561
+ usage?: {
562
+ reportingStatus: "partial" | "complete" | "unavailable";
563
+ inputTokens?: number | undefined;
564
+ outputTokens?: number | undefined;
565
+ totalTokens?: number | undefined;
566
+ uncachedInputTokens?: number | undefined;
567
+ cacheReadInputTokens?: number | undefined;
568
+ cacheWriteInputTokens?: number | undefined;
569
+ textOutputTokens?: number | undefined;
570
+ reasoningOutputTokens?: number | undefined;
571
+ audioDurationMs?: number | undefined;
572
+ imageOutputTokens?: number | undefined;
573
+ audioOutputTokens?: number | undefined;
574
+ outputImages?: number | undefined;
575
+ inputCharacters?: number | undefined;
576
+ } | undefined;
577
+ cost?: {
578
+ amounts: {
579
+ currency: string;
580
+ amountNanos: string;
581
+ }[];
582
+ ratedCallCount: number;
583
+ unpriceableCallCount: number;
584
+ unvaluedCallCount: number;
585
+ } | undefined;
586
+ finishReason?: "error" | "length" | "unknown" | "stop" | "content-filter" | "tool-calls" | "timeout" | "interrupted" | "awaiting_approval" | "awaiting_answer" | "other" | undefined;
587
+ awaiting?: {
588
+ type: "approval";
589
+ approvalIds: string[];
590
+ } | {
591
+ type: "resume";
592
+ } | {
593
+ type: "answer";
594
+ question: {
595
+ id: string;
596
+ text: string;
597
+ };
598
+ } | undefined;
599
+ ended?: {
600
+ reason: "superseded" | "expired" | "stopped" | "replaced";
601
+ } | undefined;
602
+ }[];
603
+ };
604
+ 404: {
605
+ error: string;
606
+ };
607
+ 403: {
608
+ error: string;
609
+ };
610
+ 400: {
611
+ error: string;
612
+ };
613
+ 501: {
614
+ error: string;
615
+ };
616
+ 422: {
617
+ type: "validation";
618
+ on: string;
619
+ summary?: string;
620
+ message?: string;
621
+ found?: unknown;
622
+ property?: string;
623
+ expected?: string;
624
+ };
625
+ };
626
+ };
627
+ };
628
+ };
629
+ };
630
+ };
631
+ } & {
632
+ api: {
633
+ "observed-agent-threads": {
634
+ ":threadId": {
635
+ "child-files": {
636
+ content: {
637
+ get: {
638
+ body: unknown;
639
+ params: {
640
+ threadId: string;
641
+ };
642
+ query: {
643
+ path: string;
644
+ run: string;
645
+ disposition?: "inline" | "attachment" | undefined;
646
+ v?: string | undefined;
647
+ };
648
+ headers: unknown;
649
+ response: {
650
+ 200: Response | {
651
+ readonly error: string;
652
+ };
653
+ 422: {
654
+ type: "validation";
655
+ on: string;
656
+ summary?: string;
657
+ message?: string;
658
+ found?: unknown;
659
+ property?: string;
660
+ expected?: string;
661
+ };
662
+ };
663
+ };
664
+ };
665
+ };
666
+ };
667
+ };
668
+ };
669
+ }, {
670
+ derive: {};
671
+ resolve: {};
672
+ schema: {};
673
+ standaloneSchema: {};
674
+ response: {};
675
+ }, {
676
+ derive: {};
677
+ resolve: {};
678
+ schema: {};
679
+ standaloneSchema: {};
680
+ response: {};
681
+ }>;
682
+ //# sourceMappingURL=observed-agent-threads.d.ts.map