@sixb/server 0.1.20 → 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 (179) hide show
  1. package/dist/artifacts/frame.d.ts +18 -0
  2. package/dist/artifacts/frame.d.ts.map +1 -0
  3. package/dist/auth/browser-origin.d.ts +10 -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/files/content.d.ts +2 -3
  13. package/dist/files/content.d.ts.map +1 -1
  14. package/dist/index.js +10636 -7071
  15. package/dist/index.js.map +56 -38
  16. package/dist/models/display.d.ts +27 -0
  17. package/dist/models/display.d.ts.map +1 -1
  18. package/dist/openapi/components.d.ts +14 -0
  19. package/dist/openapi/components.d.ts.map +1 -0
  20. package/dist/openapi/tags.d.ts +22 -2
  21. package/dist/openapi/tags.d.ts.map +1 -1
  22. package/dist/registerRoutes.d.ts +3 -0
  23. package/dist/registerRoutes.d.ts.map +1 -1
  24. package/dist/routes/actions.d.ts +5 -5
  25. package/dist/routes/activity.d.ts +35 -0
  26. package/dist/routes/activity.d.ts.map +1 -0
  27. package/dist/routes/agent-api-gateway.d.ts.map +1 -1
  28. package/dist/routes/agent-approval-gate.d.ts +27 -0
  29. package/dist/routes/agent-approval-gate.d.ts.map +1 -0
  30. package/dist/routes/agent-approvals.d.ts +599 -0
  31. package/dist/routes/agent-approvals.d.ts.map +1 -0
  32. package/dist/routes/agent-children.d.ts +318 -0
  33. package/dist/routes/agent-children.d.ts.map +1 -0
  34. package/dist/routes/agent-memory.d.ts +267 -0
  35. package/dist/routes/agent-memory.d.ts.map +1 -0
  36. package/dist/routes/agents.d.ts +1008 -98
  37. package/dist/routes/agents.d.ts.map +1 -1
  38. package/dist/routes/ai-accounting.d.ts.map +1 -1
  39. package/dist/routes/artifact-frames.d.ts +98 -0
  40. package/dist/routes/artifact-frames.d.ts.map +1 -0
  41. package/dist/routes/artifacts.d.ts +1508 -0
  42. package/dist/routes/artifacts.d.ts.map +1 -0
  43. package/dist/routes/auth.d.ts +117 -11
  44. package/dist/routes/auth.d.ts.map +1 -1
  45. package/dist/routes/connector-connection-runs.d.ts +84 -84
  46. package/dist/routes/connector-connections.d.ts +2 -2
  47. package/dist/routes/connectors.d.ts +2 -2
  48. package/dist/routes/datasets.d.ts +27 -27
  49. package/dist/routes/events.d.ts +5 -5
  50. package/dist/routes/files.d.ts +14 -14
  51. package/dist/routes/files.d.ts.map +1 -1
  52. package/dist/routes/links.d.ts +2 -2
  53. package/dist/routes/logs.d.ts +5 -5
  54. package/dist/routes/model-calls.d.ts +155 -0
  55. package/dist/routes/model-calls.d.ts.map +1 -0
  56. package/dist/routes/model-generations.d.ts +400 -0
  57. package/dist/routes/model-generations.d.ts.map +1 -0
  58. package/dist/routes/models.d.ts +434 -1
  59. package/dist/routes/models.d.ts.map +1 -1
  60. package/dist/routes/objects.d.ts +71 -40
  61. package/dist/routes/objects.d.ts.map +1 -1
  62. package/dist/routes/observed-agent-threads.d.ts +682 -0
  63. package/dist/routes/observed-agent-threads.d.ts.map +1 -0
  64. package/dist/routes/ontology.d.ts +66 -62
  65. package/dist/routes/ontology.d.ts.map +1 -1
  66. package/dist/routes/pipelines.d.ts +53 -53
  67. package/dist/routes/projections.d.ts +63 -63
  68. package/dist/routes/rules.d.ts +2 -2
  69. package/dist/routes/share-grants.d.ts +4 -4
  70. package/dist/routes/syncs.d.ts +18 -18
  71. package/dist/routes/users.d.ts +117 -0
  72. package/dist/routes/users.d.ts.map +1 -0
  73. package/dist/routes/webhook-runs.d.ts +1 -1
  74. package/dist/routes/workflows.d.ts +142 -76
  75. package/dist/routes/workflows.d.ts.map +1 -1
  76. package/dist/routes/ws/agents.d.ts +7 -2
  77. package/dist/routes/ws/agents.d.ts.map +1 -1
  78. package/dist/routes/ws/events.d.ts +6 -6
  79. package/dist/routes/ws/events.d.ts.map +1 -1
  80. package/dist/routes/ws/logs.d.ts +14 -14
  81. package/dist/routes/ws/subscription-hub.d.ts +8 -3
  82. package/dist/routes/ws/subscription-hub.d.ts.map +1 -1
  83. package/dist/schemas/actions.d.ts +15 -15
  84. package/dist/schemas/activity.d.ts +1298 -0
  85. package/dist/schemas/activity.d.ts.map +1 -0
  86. package/dist/schemas/agent-approvals.d.ts +1091 -0
  87. package/dist/schemas/agent-approvals.d.ts.map +1 -0
  88. package/dist/schemas/agent-memory.d.ts +250 -0
  89. package/dist/schemas/agent-memory.d.ts.map +1 -0
  90. package/dist/schemas/agents.d.ts +5485 -460
  91. package/dist/schemas/agents.d.ts.map +1 -1
  92. package/dist/schemas/ai-accounting.d.ts +1315 -436
  93. package/dist/schemas/ai-accounting.d.ts.map +1 -1
  94. package/dist/schemas/ai-limits.d.ts +36 -36
  95. package/dist/schemas/ai-usage.d.ts +12 -0
  96. package/dist/schemas/ai-usage.d.ts.map +1 -1
  97. package/dist/schemas/artifacts.d.ts +1857 -0
  98. package/dist/schemas/artifacts.d.ts.map +1 -0
  99. package/dist/schemas/auth.d.ts +125 -52
  100. package/dist/schemas/auth.d.ts.map +1 -1
  101. package/dist/schemas/connectors.d.ts +42 -42
  102. package/dist/schemas/datasets.d.ts +108 -108
  103. package/dist/schemas/event-payloads.d.ts +6 -6
  104. package/dist/schemas/events.d.ts +32 -32
  105. package/dist/schemas/events.d.ts.map +1 -1
  106. package/dist/schemas/files.d.ts +24 -24
  107. package/dist/schemas/links.d.ts +2 -2
  108. package/dist/schemas/logs.d.ts +32 -32
  109. package/dist/schemas/models.d.ts +8889 -10
  110. package/dist/schemas/models.d.ts.map +1 -1
  111. package/dist/schemas/objects.d.ts +48 -12
  112. package/dist/schemas/objects.d.ts.map +1 -1
  113. package/dist/schemas/ontology.d.ts +127 -104
  114. package/dist/schemas/ontology.d.ts.map +1 -1
  115. package/dist/schemas/pipelines.d.ts +166 -166
  116. package/dist/schemas/projections.d.ts +346 -346
  117. package/dist/schemas/rules.d.ts +4 -4
  118. package/dist/schemas/share-grants.d.ts +14 -14
  119. package/dist/schemas/syncs.d.ts +40 -40
  120. package/dist/schemas/users.d.ts +72 -0
  121. package/dist/schemas/users.d.ts.map +1 -0
  122. package/dist/schemas/webhook-runs.d.ts +6 -6
  123. package/dist/schemas/workflows.d.ts +769 -254
  124. package/dist/schemas/workflows.d.ts.map +1 -1
  125. package/dist/server.d.ts +1 -0
  126. package/dist/server.d.ts.map +1 -1
  127. package/dist/utils/http.d.ts.map +1 -1
  128. package/package.json +7 -7
  129. package/src/artifacts/frame.ts +51 -0
  130. package/src/auth/browser-origin.ts +20 -5
  131. package/src/auth/experience.ts +1 -1
  132. package/src/auth/guard.ts +2 -2
  133. package/src/auth/public-routes.ts +16 -0
  134. package/src/auth/responses.ts +7 -6
  135. package/src/auth/scope.ts +32 -3
  136. package/src/files/content.ts +9 -13
  137. package/src/models/display.ts +61 -16
  138. package/src/openapi/components.ts +54 -0
  139. package/src/openapi/tags.ts +20 -0
  140. package/src/registerRoutes.ts +23 -0
  141. package/src/routes/activity.ts +327 -0
  142. package/src/routes/agent-api-gateway.ts +115 -91
  143. package/src/routes/agent-approval-gate.ts +213 -0
  144. package/src/routes/agent-approvals.ts +299 -0
  145. package/src/routes/agent-children.ts +209 -0
  146. package/src/routes/agent-memory.ts +210 -0
  147. package/src/routes/agents.ts +364 -143
  148. package/src/routes/ai-accounting.ts +4 -0
  149. package/src/routes/artifact-frames.ts +144 -0
  150. package/src/routes/artifacts.ts +717 -0
  151. package/src/routes/auth.ts +306 -13
  152. package/src/routes/file-downloads.ts +1 -3
  153. package/src/routes/files.ts +6 -7
  154. package/src/routes/model-calls.ts +120 -0
  155. package/src/routes/model-generations.ts +245 -0
  156. package/src/routes/models.ts +116 -9
  157. package/src/routes/objects.ts +55 -61
  158. package/src/routes/observed-agent-threads.ts +253 -0
  159. package/src/routes/ontology.ts +1 -0
  160. package/src/routes/users.ts +73 -0
  161. package/src/routes/workflows.ts +6 -9
  162. package/src/routes/ws/agents.ts +10 -5
  163. package/src/routes/ws/events.ts +3 -2
  164. package/src/routes/ws/subscription-hub.ts +53 -20
  165. package/src/schemas/activity.ts +287 -0
  166. package/src/schemas/agent-approvals.ts +129 -0
  167. package/src/schemas/agent-memory.ts +96 -0
  168. package/src/schemas/agents.ts +240 -2
  169. package/src/schemas/ai-accounting.ts +40 -4
  170. package/src/schemas/ai-usage.ts +10 -0
  171. package/src/schemas/artifacts.ts +246 -0
  172. package/src/schemas/auth.ts +25 -0
  173. package/src/schemas/models.ts +197 -1
  174. package/src/schemas/objects.ts +181 -0
  175. package/src/schemas/ontology.ts +1 -0
  176. package/src/schemas/users.ts +24 -0
  177. package/src/schemas/workflows.ts +2 -0
  178. package/src/server.ts +34 -19
  179. package/src/utils/http.ts +2 -0
@@ -1,7 +1,190 @@
1
- import { type AgentRequestErrorCode, type AgentRunView, type SixbHostView } from "@sixb/core";
1
+ import { type AgentRequestErrorCode, type AgentRunView, type AgentThreadView, type SixbHostView } from "@sixb/core";
2
+ import { type AgentStorage, type AgentThreadRecord, type Principal } from "@sixb/core/storage";
2
3
  import type { Elysia } from "elysia";
3
- import { AgentRunSchema } from "../schemas/agents";
4
+ import { z } from "zod";
5
+ import { AgentMessagesQuerySchema, AgentRunSchema, AgentThreadSchema } from "../schemas/agents";
6
+ import { handleRouteError } from "../utils/http";
7
+ /** Threads as the API returns them, their owner and participants named by their accounts. */
8
+ export declare function serializeThreads(host: SixbHostView, threads: readonly AgentThreadView[]): Promise<ReturnType<typeof AgentThreadSchema.parse>[]>;
9
+ export declare function serializeThread(host: SixbHostView, thread: AgentThreadView): Promise<ReturnType<typeof AgentThreadSchema.parse>>;
4
10
  export declare function serializeAgentRun(run: AgentRunView): ReturnType<typeof AgentRunSchema.parse>;
11
+ export declare function handleAgentRouteError(error: unknown, set: {
12
+ status?: number | string;
13
+ headers?: unknown;
14
+ }): ReturnType<typeof handleRouteError> | {
15
+ readonly error: string;
16
+ readonly code: AgentRequestErrorCode;
17
+ };
18
+ export declare function agentMessageFileContentResponse(host: SixbHostView, context: {
19
+ readonly params: {
20
+ readonly threadId: string;
21
+ readonly messageId: string;
22
+ };
23
+ readonly query: unknown;
24
+ readonly request: Request;
25
+ readonly set: {
26
+ status?: number | string;
27
+ };
28
+ }, options?: {
29
+ readonly head?: boolean;
30
+ /** Who may read the thread. Default: its owner, or the Agent run working in it. */
31
+ readonly readThread?: () => Promise<Pick<AgentThreadRecord, "id"> | null>;
32
+ }): Promise<Response | {
33
+ error: string;
34
+ }>;
35
+ /** A page of a thread's messages, with their runs' diagnostics and compactions, and authors. */
36
+ export declare function readThreadMessages(host: SixbHostView, storage: AgentStorage, thread: AgentThreadRecord, query: z.infer<typeof AgentMessagesQuerySchema>): Promise<{
37
+ messages: {
38
+ projectId: string;
39
+ id: string;
40
+ runId: string | null;
41
+ threadId: string;
42
+ createdAt: string;
43
+ parts: ({
44
+ origin: "ambient" | "explicit";
45
+ context: {
46
+ kind: "object";
47
+ ref: {
48
+ objectTypeId: string;
49
+ primaryId: string;
50
+ };
51
+ label?: string | undefined;
52
+ } | {
53
+ id: string;
54
+ kind: "app-state";
55
+ value: import("../schemas/common").JsonValue;
56
+ description: string;
57
+ label: string;
58
+ };
59
+ type: "context";
60
+ } | {
61
+ type: "text";
62
+ text: string;
63
+ providerMetadata?: import("../schemas/common").JsonValue | undefined;
64
+ } | {
65
+ type: "reasoning";
66
+ text: string;
67
+ providerMetadata?: import("../schemas/common").JsonValue | undefined;
68
+ } | {
69
+ type: "step-start";
70
+ } | {
71
+ type: "file";
72
+ fileRef: {
73
+ blobId: string;
74
+ digest: string;
75
+ sizeBytes: number;
76
+ fileName?: string | undefined;
77
+ mediaType?: string | undefined;
78
+ logicalPath?: string | undefined;
79
+ };
80
+ providerMetadata?: import("../schemas/common").JsonValue | undefined;
81
+ } | {
82
+ type: "provider-state";
83
+ providerId: string;
84
+ data: import("../schemas/common").JsonValue;
85
+ } | {
86
+ type: "tool-call";
87
+ input: import("../schemas/common").JsonValue;
88
+ output: import("../schemas/common").JsonValue;
89
+ toolCallId: string;
90
+ toolName: string;
91
+ state: "output-available";
92
+ providerMetadata?: import("../schemas/common").JsonValue | undefined;
93
+ dynamic?: boolean | undefined;
94
+ providerExecuted?: boolean | undefined;
95
+ } | {
96
+ type: "tool-call";
97
+ input: import("../schemas/common").JsonValue;
98
+ toolCallId: string;
99
+ toolName: string;
100
+ state: "output-error";
101
+ errorText: string;
102
+ providerMetadata?: import("../schemas/common").JsonValue | undefined;
103
+ dynamic?: boolean | undefined;
104
+ providerExecuted?: boolean | undefined;
105
+ } | {
106
+ type: "continuation";
107
+ } | {
108
+ status: "approved" | "denied" | "cancelled" | "superseded" | "expired";
109
+ type: "approval-outcome";
110
+ call: {
111
+ kind: "action";
112
+ actionId: string;
113
+ subject: {
114
+ kind: "none";
115
+ } | {
116
+ kind: "object";
117
+ objectTypeId: string;
118
+ primaryId: string;
119
+ };
120
+ } | {
121
+ kind: "workflow";
122
+ workflowId: string;
123
+ };
124
+ approvalId: string;
125
+ caller?: {
126
+ runId: string;
127
+ key: string;
128
+ continues?: true | undefined;
129
+ } | undefined;
130
+ outcome?: {
131
+ status: "succeeded" | "failed";
132
+ kind: "action-run";
133
+ runId: string;
134
+ error?: import("@sixb/core").ActionRunFailure<"validation" | "writeback" | "edits" | "effects" | "commit"> | undefined;
135
+ } | {
136
+ kind: "workflow-run";
137
+ runId: string;
138
+ queuedAt: string;
139
+ } | {
140
+ error: {
141
+ at: string;
142
+ 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";
143
+ message: string;
144
+ retryable: boolean;
145
+ details?: import("../schemas/common").JsonValue | undefined;
146
+ httpStatus?: number | undefined;
147
+ redacted?: true | undefined;
148
+ truncated?: true | undefined;
149
+ };
150
+ kind: "error";
151
+ } | undefined;
152
+ } | {
153
+ id: string;
154
+ kind: "message" | "answer";
155
+ type: "mail";
156
+ text: string;
157
+ from: "parent";
158
+ inReplyTo?: string | undefined;
159
+ afterAnswer?: true | undefined;
160
+ })[];
161
+ role: "user" | "system" | "assistant";
162
+ seq: number;
163
+ annotations: {
164
+ code: "step_limit_reached" | "output_limit_reached";
165
+ message: string;
166
+ severity: "error" | "warning";
167
+ scope: "run";
168
+ }[];
169
+ contentVersion: number;
170
+ completedAt?: string | undefined;
171
+ authorPrincipal?: {
172
+ id: string;
173
+ type: "user" | "serviceAccount" | "system";
174
+ } | undefined;
175
+ compaction?: {
176
+ createdAt: string;
177
+ checkpointId: string;
178
+ summary: string;
179
+ } | undefined;
180
+ metadata?: import("../schemas/common").JsonValue | undefined;
181
+ }[];
182
+ authors: (Principal & {
183
+ readonly displayName?: string;
184
+ })[];
185
+ hasMore: boolean;
186
+ total: number;
187
+ }>;
5
188
  export declare function registerAgentRoutes(app: Elysia, host: SixbHostView): Elysia<"", {
6
189
  decorator: {};
7
190
  store: {};
@@ -60,6 +243,7 @@ export declare function registerAgentRoutes(app: Elysia, host: SixbHostView): El
60
243
  limit?: string | undefined;
61
244
  offset?: string | undefined;
62
245
  order?: "asc" | "desc" | undefined;
246
+ sharedWithMe?: "true" | "false" | undefined;
63
247
  };
64
248
  headers: unknown;
65
249
  response: {
@@ -70,20 +254,45 @@ export declare function registerAgentRoutes(app: Elysia, host: SixbHostView): El
70
254
  status: "active" | "archived";
71
255
  projectId: string;
72
256
  id: string;
257
+ kind: "conversation" | "subagent";
258
+ createdAt: string;
73
259
  ownerPrincipal: {
74
260
  id: string;
75
261
  type: "user" | "serviceAccount" | "system";
76
262
  };
263
+ owner: {
264
+ id: string;
265
+ type: "user" | "serviceAccount" | "system";
266
+ displayName?: string | undefined;
267
+ };
268
+ participants: {
269
+ principal: {
270
+ id: string;
271
+ type: "user";
272
+ displayName?: string | undefined;
273
+ };
274
+ addedAt: string;
275
+ addedBy: {
276
+ id: string;
277
+ type: "user" | "serviceAccount" | "system";
278
+ };
279
+ }[];
77
280
  activeRunId: string | null;
78
281
  messageCount: number;
79
- createdAt: string;
80
282
  updatedAt: string;
81
283
  title?: string | undefined;
284
+ approvalMode?: "manual" | "accept-edits" | "auto" | undefined;
285
+ approvalModeSource?: "default" | "thread" | "fallback" | "run" | undefined;
82
286
  sandboxState?: {
83
287
  status: "unavailable" | "new" | "busy" | "ready" | "blocked";
84
288
  name: string;
85
289
  initialized: boolean;
86
290
  } | undefined;
291
+ parent?: {
292
+ threadId: string;
293
+ key: string;
294
+ spawnedBy: string;
295
+ } | undefined;
87
296
  sandboxParams?: Record<string, import("../schemas/common").JsonValue> | undefined;
88
297
  lastMessageAt?: string | undefined;
89
298
  }[];
@@ -125,20 +334,45 @@ export declare function registerAgentRoutes(app: Elysia, host: SixbHostView): El
125
334
  status: "active" | "archived";
126
335
  projectId: string;
127
336
  id: string;
337
+ kind: "conversation" | "subagent";
338
+ createdAt: string;
128
339
  ownerPrincipal: {
129
340
  id: string;
130
341
  type: "user" | "serviceAccount" | "system";
131
342
  };
343
+ owner: {
344
+ id: string;
345
+ type: "user" | "serviceAccount" | "system";
346
+ displayName?: string | undefined;
347
+ };
348
+ participants: {
349
+ principal: {
350
+ id: string;
351
+ type: "user";
352
+ displayName?: string | undefined;
353
+ };
354
+ addedAt: string;
355
+ addedBy: {
356
+ id: string;
357
+ type: "user" | "serviceAccount" | "system";
358
+ };
359
+ }[];
132
360
  activeRunId: string | null;
133
361
  messageCount: number;
134
- createdAt: string;
135
362
  updatedAt: string;
136
363
  title?: string | undefined;
364
+ approvalMode?: "manual" | "accept-edits" | "auto" | undefined;
365
+ approvalModeSource?: "default" | "thread" | "fallback" | "run" | undefined;
137
366
  sandboxState?: {
138
367
  status: "unavailable" | "new" | "busy" | "ready" | "blocked";
139
368
  name: string;
140
369
  initialized: boolean;
141
370
  } | undefined;
371
+ parent?: {
372
+ threadId: string;
373
+ key: string;
374
+ spawnedBy: string;
375
+ } | undefined;
142
376
  sandboxParams?: Record<string, import("../schemas/common").JsonValue> | undefined;
143
377
  lastMessageAt?: string | undefined;
144
378
  };
@@ -165,20 +399,45 @@ export declare function registerAgentRoutes(app: Elysia, host: SixbHostView): El
165
399
  status: "active" | "archived";
166
400
  projectId: string;
167
401
  id: string;
402
+ kind: "conversation" | "subagent";
403
+ createdAt: string;
168
404
  ownerPrincipal: {
169
405
  id: string;
170
406
  type: "user" | "serviceAccount" | "system";
171
407
  };
408
+ owner: {
409
+ id: string;
410
+ type: "user" | "serviceAccount" | "system";
411
+ displayName?: string | undefined;
412
+ };
413
+ participants: {
414
+ principal: {
415
+ id: string;
416
+ type: "user";
417
+ displayName?: string | undefined;
418
+ };
419
+ addedAt: string;
420
+ addedBy: {
421
+ id: string;
422
+ type: "user" | "serviceAccount" | "system";
423
+ };
424
+ }[];
172
425
  activeRunId: string | null;
173
426
  messageCount: number;
174
- createdAt: string;
175
427
  updatedAt: string;
176
428
  title?: string | undefined;
429
+ approvalMode?: "manual" | "accept-edits" | "auto" | undefined;
430
+ approvalModeSource?: "default" | "thread" | "fallback" | "run" | undefined;
177
431
  sandboxState?: {
178
432
  status: "unavailable" | "new" | "busy" | "ready" | "blocked";
179
433
  name: string;
180
434
  initialized: boolean;
181
435
  } | undefined;
436
+ parent?: {
437
+ threadId: string;
438
+ key: string;
439
+ spawnedBy: string;
440
+ } | undefined;
182
441
  sandboxParams?: Record<string, import("../schemas/common").JsonValue> | undefined;
183
442
  lastMessageAt?: string | undefined;
184
443
  };
@@ -212,20 +471,45 @@ export declare function registerAgentRoutes(app: Elysia, host: SixbHostView): El
212
471
  status: "active" | "archived";
213
472
  projectId: string;
214
473
  id: string;
474
+ kind: "conversation" | "subagent";
475
+ createdAt: string;
215
476
  ownerPrincipal: {
216
477
  id: string;
217
478
  type: "user" | "serviceAccount" | "system";
218
479
  };
480
+ owner: {
481
+ id: string;
482
+ type: "user" | "serviceAccount" | "system";
483
+ displayName?: string | undefined;
484
+ };
485
+ participants: {
486
+ principal: {
487
+ id: string;
488
+ type: "user";
489
+ displayName?: string | undefined;
490
+ };
491
+ addedAt: string;
492
+ addedBy: {
493
+ id: string;
494
+ type: "user" | "serviceAccount" | "system";
495
+ };
496
+ }[];
219
497
  activeRunId: string | null;
220
498
  messageCount: number;
221
- createdAt: string;
222
499
  updatedAt: string;
223
500
  title?: string | undefined;
501
+ approvalMode?: "manual" | "accept-edits" | "auto" | undefined;
502
+ approvalModeSource?: "default" | "thread" | "fallback" | "run" | undefined;
224
503
  sandboxState?: {
225
504
  status: "unavailable" | "new" | "busy" | "ready" | "blocked";
226
505
  name: string;
227
506
  initialized: boolean;
228
507
  } | undefined;
508
+ parent?: {
509
+ threadId: string;
510
+ key: string;
511
+ spawnedBy: string;
512
+ } | undefined;
229
513
  sandboxParams?: Record<string, import("../schemas/common").JsonValue> | undefined;
230
514
  lastMessageAt?: string | undefined;
231
515
  };
@@ -252,6 +536,298 @@ export declare function registerAgentRoutes(app: Elysia, host: SixbHostView): El
252
536
  };
253
537
  };
254
538
  };
539
+ } & {
540
+ api: {
541
+ "agent-threads": {
542
+ ":threadId": {
543
+ participants: {
544
+ post: {
545
+ body: {
546
+ users: ({
547
+ id: string;
548
+ type: "user";
549
+ } | {
550
+ email: string;
551
+ })[];
552
+ };
553
+ params: {
554
+ threadId: string;
555
+ };
556
+ query: unknown;
557
+ headers: unknown;
558
+ response: {
559
+ 200: {
560
+ status: "active" | "archived";
561
+ projectId: string;
562
+ id: string;
563
+ kind: "conversation" | "subagent";
564
+ createdAt: string;
565
+ ownerPrincipal: {
566
+ id: string;
567
+ type: "user" | "serviceAccount" | "system";
568
+ };
569
+ owner: {
570
+ id: string;
571
+ type: "user" | "serviceAccount" | "system";
572
+ displayName?: string | undefined;
573
+ };
574
+ participants: {
575
+ principal: {
576
+ id: string;
577
+ type: "user";
578
+ displayName?: string | undefined;
579
+ };
580
+ addedAt: string;
581
+ addedBy: {
582
+ id: string;
583
+ type: "user" | "serviceAccount" | "system";
584
+ };
585
+ }[];
586
+ activeRunId: string | null;
587
+ messageCount: number;
588
+ updatedAt: string;
589
+ title?: string | undefined;
590
+ approvalMode?: "manual" | "accept-edits" | "auto" | undefined;
591
+ approvalModeSource?: "default" | "thread" | "fallback" | "run" | undefined;
592
+ sandboxState?: {
593
+ status: "unavailable" | "new" | "busy" | "ready" | "blocked";
594
+ name: string;
595
+ initialized: boolean;
596
+ } | undefined;
597
+ parent?: {
598
+ threadId: string;
599
+ key: string;
600
+ spawnedBy: string;
601
+ } | undefined;
602
+ sandboxParams?: Record<string, import("../schemas/common").JsonValue> | undefined;
603
+ lastMessageAt?: string | undefined;
604
+ };
605
+ 404: {
606
+ error: string;
607
+ };
608
+ 403: {
609
+ error: string;
610
+ code?: string | undefined;
611
+ };
612
+ 409: {
613
+ error: string;
614
+ code?: string | undefined;
615
+ };
616
+ 400: {
617
+ error: string;
618
+ code?: string | undefined;
619
+ };
620
+ 501: {
621
+ error: string;
622
+ };
623
+ 422: {
624
+ type: "validation";
625
+ on: string;
626
+ summary?: string;
627
+ message?: string;
628
+ found?: unknown;
629
+ property?: string;
630
+ expected?: string;
631
+ };
632
+ };
633
+ };
634
+ };
635
+ };
636
+ };
637
+ };
638
+ } & {
639
+ api: {
640
+ "agent-threads": {
641
+ ":threadId": {
642
+ participants: {
643
+ ":userId": {
644
+ delete: {
645
+ body: unknown;
646
+ params: {
647
+ threadId: string;
648
+ userId: string;
649
+ };
650
+ query: unknown;
651
+ headers: unknown;
652
+ response: {
653
+ 404: {
654
+ error: string;
655
+ };
656
+ 403: {
657
+ error: string;
658
+ code?: string | undefined;
659
+ };
660
+ 409: {
661
+ error: string;
662
+ code?: string | undefined;
663
+ };
664
+ 400: {
665
+ error: string;
666
+ code?: string | undefined;
667
+ };
668
+ 501: {
669
+ error: string;
670
+ };
671
+ 204: void;
672
+ 422: {
673
+ type: "validation";
674
+ on: string;
675
+ summary?: string;
676
+ message?: string;
677
+ found?: unknown;
678
+ property?: string;
679
+ expected?: string;
680
+ };
681
+ };
682
+ };
683
+ };
684
+ };
685
+ };
686
+ };
687
+ };
688
+ } & {
689
+ api: {
690
+ "agent-threads": {
691
+ ":threadId": {
692
+ fork: {
693
+ post: {
694
+ body: unknown;
695
+ params: {
696
+ threadId: string;
697
+ };
698
+ query: unknown;
699
+ headers: unknown;
700
+ response: {
701
+ 200: {
702
+ thread: {
703
+ status: "active" | "archived";
704
+ projectId: string;
705
+ id: string;
706
+ kind: "conversation" | "subagent";
707
+ createdAt: string;
708
+ ownerPrincipal: {
709
+ id: string;
710
+ type: "user" | "serviceAccount" | "system";
711
+ };
712
+ owner: {
713
+ id: string;
714
+ type: "user" | "serviceAccount" | "system";
715
+ displayName?: string | undefined;
716
+ };
717
+ participants: {
718
+ principal: {
719
+ id: string;
720
+ type: "user";
721
+ displayName?: string | undefined;
722
+ };
723
+ addedAt: string;
724
+ addedBy: {
725
+ id: string;
726
+ type: "user" | "serviceAccount" | "system";
727
+ };
728
+ }[];
729
+ activeRunId: string | null;
730
+ messageCount: number;
731
+ updatedAt: string;
732
+ title?: string | undefined;
733
+ approvalMode?: "manual" | "accept-edits" | "auto" | undefined;
734
+ approvalModeSource?: "default" | "thread" | "fallback" | "run" | undefined;
735
+ sandboxState?: {
736
+ status: "unavailable" | "new" | "busy" | "ready" | "blocked";
737
+ name: string;
738
+ initialized: boolean;
739
+ } | undefined;
740
+ parent?: {
741
+ threadId: string;
742
+ key: string;
743
+ spawnedBy: string;
744
+ } | undefined;
745
+ sandboxParams?: Record<string, import("../schemas/common").JsonValue> | undefined;
746
+ lastMessageAt?: string | undefined;
747
+ };
748
+ } | {
749
+ readonly error: string;
750
+ readonly code: AgentRequestErrorCode;
751
+ } | {
752
+ error: string;
753
+ };
754
+ 404: {
755
+ error: string;
756
+ };
757
+ 409: {
758
+ error: string;
759
+ code?: string | undefined;
760
+ };
761
+ 400: {
762
+ error: string;
763
+ code?: string | undefined;
764
+ };
765
+ 501: {
766
+ error: string;
767
+ };
768
+ 201: {
769
+ thread: {
770
+ status: "active" | "archived";
771
+ projectId: string;
772
+ id: string;
773
+ kind: "conversation" | "subagent";
774
+ createdAt: string;
775
+ ownerPrincipal: {
776
+ id: string;
777
+ type: "user" | "serviceAccount" | "system";
778
+ };
779
+ owner: {
780
+ id: string;
781
+ type: "user" | "serviceAccount" | "system";
782
+ displayName?: string | undefined;
783
+ };
784
+ participants: {
785
+ principal: {
786
+ id: string;
787
+ type: "user";
788
+ displayName?: string | undefined;
789
+ };
790
+ addedAt: string;
791
+ addedBy: {
792
+ id: string;
793
+ type: "user" | "serviceAccount" | "system";
794
+ };
795
+ }[];
796
+ activeRunId: string | null;
797
+ messageCount: number;
798
+ updatedAt: string;
799
+ title?: string | undefined;
800
+ approvalMode?: "manual" | "accept-edits" | "auto" | undefined;
801
+ approvalModeSource?: "default" | "thread" | "fallback" | "run" | undefined;
802
+ sandboxState?: {
803
+ status: "unavailable" | "new" | "busy" | "ready" | "blocked";
804
+ name: string;
805
+ initialized: boolean;
806
+ } | undefined;
807
+ parent?: {
808
+ threadId: string;
809
+ key: string;
810
+ spawnedBy: string;
811
+ } | undefined;
812
+ sandboxParams?: Record<string, import("../schemas/common").JsonValue> | undefined;
813
+ lastMessageAt?: string | undefined;
814
+ };
815
+ };
816
+ 422: {
817
+ type: "validation";
818
+ on: string;
819
+ summary?: string;
820
+ message?: string;
821
+ found?: unknown;
822
+ property?: string;
823
+ expected?: string;
824
+ };
825
+ };
826
+ };
827
+ };
828
+ };
829
+ };
830
+ };
255
831
  } & {
256
832
  api: {
257
833
  "agent-threads": {
@@ -272,28 +848,58 @@ export declare function registerAgentRoutes(app: Elysia, host: SixbHostView): El
272
848
  status: "active" | "archived";
273
849
  projectId: string;
274
850
  id: string;
851
+ kind: "conversation" | "subagent";
852
+ createdAt: string;
275
853
  ownerPrincipal: {
276
854
  id: string;
277
855
  type: "user" | "serviceAccount" | "system";
278
856
  };
857
+ owner: {
858
+ id: string;
859
+ type: "user" | "serviceAccount" | "system";
860
+ displayName?: string | undefined;
861
+ };
862
+ participants: {
863
+ principal: {
864
+ id: string;
865
+ type: "user";
866
+ displayName?: string | undefined;
867
+ };
868
+ addedAt: string;
869
+ addedBy: {
870
+ id: string;
871
+ type: "user" | "serviceAccount" | "system";
872
+ };
873
+ }[];
279
874
  activeRunId: string | null;
280
875
  messageCount: number;
281
- createdAt: string;
282
876
  updatedAt: string;
283
877
  title?: string | undefined;
878
+ approvalMode?: "manual" | "accept-edits" | "auto" | undefined;
879
+ approvalModeSource?: "default" | "thread" | "fallback" | "run" | undefined;
284
880
  sandboxState?: {
285
881
  status: "unavailable" | "new" | "busy" | "ready" | "blocked";
286
882
  name: string;
287
883
  initialized: boolean;
288
884
  } | undefined;
885
+ parent?: {
886
+ threadId: string;
887
+ key: string;
888
+ spawnedBy: string;
889
+ } | undefined;
289
890
  sandboxParams?: Record<string, import("../schemas/common").JsonValue> | undefined;
290
891
  lastMessageAt?: string | undefined;
291
892
  };
292
893
  404: {
293
894
  error: string;
294
895
  };
896
+ 403: {
897
+ error: string;
898
+ code?: string | undefined;
899
+ };
295
900
  409: {
296
901
  error: string;
902
+ code?: string | undefined;
297
903
  };
298
904
  400: {
299
905
  error: string;
@@ -339,6 +945,8 @@ export declare function registerAgentRoutes(app: Elysia, host: SixbHostView): El
339
945
  projectId: string;
340
946
  id: string;
341
947
  runId: string | null;
948
+ threadId: string;
949
+ createdAt: string;
342
950
  parts: ({
343
951
  origin: "ambient" | "explicit";
344
952
  context: {
@@ -351,8 +959,8 @@ export declare function registerAgentRoutes(app: Elysia, host: SixbHostView): El
351
959
  } | {
352
960
  id: string;
353
961
  kind: "app-state";
354
- description: string;
355
962
  value: import("../schemas/common").JsonValue;
963
+ description: string;
356
964
  label: string;
357
965
  };
358
966
  type: "context";
@@ -383,8 +991,8 @@ export declare function registerAgentRoutes(app: Elysia, host: SixbHostView): El
383
991
  data: import("../schemas/common").JsonValue;
384
992
  } | {
385
993
  type: "tool-call";
386
- output: import("../schemas/common").JsonValue;
387
994
  input: import("../schemas/common").JsonValue;
995
+ output: import("../schemas/common").JsonValue;
388
996
  toolCallId: string;
389
997
  toolName: string;
390
998
  state: "output-available";
@@ -402,18 +1010,68 @@ export declare function registerAgentRoutes(app: Elysia, host: SixbHostView): El
402
1010
  dynamic?: boolean | undefined;
403
1011
  providerExecuted?: boolean | undefined;
404
1012
  } | {
405
- type: "continuation";
1013
+ type: "continuation";
1014
+ } | {
1015
+ status: "approved" | "denied" | "cancelled" | "superseded" | "expired";
1016
+ type: "approval-outcome";
1017
+ call: {
1018
+ kind: "action";
1019
+ actionId: string;
1020
+ subject: {
1021
+ kind: "none";
1022
+ } | {
1023
+ kind: "object";
1024
+ objectTypeId: string;
1025
+ primaryId: string;
1026
+ };
1027
+ } | {
1028
+ kind: "workflow";
1029
+ workflowId: string;
1030
+ };
1031
+ approvalId: string;
1032
+ caller?: {
1033
+ runId: string;
1034
+ key: string;
1035
+ continues?: true | undefined;
1036
+ } | undefined;
1037
+ outcome?: {
1038
+ status: "succeeded" | "failed";
1039
+ kind: "action-run";
1040
+ runId: string;
1041
+ error?: import("@sixb/core").ActionRunFailure<"validation" | "writeback" | "edits" | "effects" | "commit"> | undefined;
1042
+ } | {
1043
+ kind: "workflow-run";
1044
+ runId: string;
1045
+ queuedAt: string;
1046
+ } | {
1047
+ error: {
1048
+ at: string;
1049
+ 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";
1050
+ message: string;
1051
+ retryable: boolean;
1052
+ details?: import("../schemas/common").JsonValue | undefined;
1053
+ httpStatus?: number | undefined;
1054
+ redacted?: true | undefined;
1055
+ truncated?: true | undefined;
1056
+ };
1057
+ kind: "error";
1058
+ } | undefined;
1059
+ } | {
1060
+ id: string;
1061
+ kind: "message" | "answer";
1062
+ type: "mail";
1063
+ text: string;
1064
+ from: "parent";
1065
+ inReplyTo?: string | undefined;
1066
+ afterAnswer?: true | undefined;
406
1067
  })[];
407
- threadId: string;
408
- createdAt: string;
409
1068
  role: "user" | "system" | "assistant";
410
1069
  seq: number;
411
1070
  annotations: {
412
- code: "output_file_limit_exceeded" | "output_file_too_large" | "output_budget_exhausted" | "output_collection_failed" | "output_file_changed" | "output_storage_failed" | "step_limit_reached";
1071
+ code: "step_limit_reached" | "output_limit_reached";
413
1072
  message: string;
414
1073
  severity: "error" | "warning";
415
- scope: "output" | "run";
416
- path?: string | undefined;
1074
+ scope: "run";
417
1075
  }[];
418
1076
  contentVersion: number;
419
1077
  completedAt?: string | undefined;
@@ -422,12 +1080,17 @@ export declare function registerAgentRoutes(app: Elysia, host: SixbHostView): El
422
1080
  type: "user" | "serviceAccount" | "system";
423
1081
  } | undefined;
424
1082
  compaction?: {
425
- summary: string;
426
1083
  createdAt: string;
427
1084
  checkpointId: string;
1085
+ summary: string;
428
1086
  } | undefined;
429
1087
  metadata?: import("../schemas/common").JsonValue | undefined;
430
1088
  }[];
1089
+ authors: {
1090
+ id: string;
1091
+ type: "user" | "serviceAccount" | "system";
1092
+ displayName?: string | undefined;
1093
+ }[];
431
1094
  };
432
1095
  404: {
433
1096
  error: string;
@@ -558,8 +1221,8 @@ export declare function registerAgentRoutes(app: Elysia, host: SixbHostView): El
558
1221
  } | {
559
1222
  id: string;
560
1223
  kind: "app-state";
561
- description: string;
562
1224
  value: import("../schemas/common").JsonValue;
1225
+ description: string;
563
1226
  label: string;
564
1227
  };
565
1228
  }[] | undefined;
@@ -568,6 +1231,7 @@ export declare function registerAgentRoutes(app: Elysia, host: SixbHostView): El
568
1231
  modelId: string;
569
1232
  provider: string;
570
1233
  } | undefined;
1234
+ approvalMode?: "manual" | "accept-edits" | "auto" | undefined;
571
1235
  attachments?: {
572
1236
  blobId: string;
573
1237
  digest: string;
@@ -590,15 +1254,20 @@ export declare function registerAgentRoutes(app: Elysia, host: SixbHostView): El
590
1254
  response: {
591
1255
  200: {
592
1256
  run: {
593
- status: "succeeded" | "failed" | "queued" | "running" | "cancelled";
1257
+ status: "succeeded" | "failed" | "cancelled" | "queued" | "running";
594
1258
  projectId: string;
595
1259
  id: string;
596
- attempt: number;
1260
+ kind: "conversation" | "subagent";
597
1261
  threadId: string;
598
1262
  createdAt: string;
1263
+ attempt: number;
599
1264
  triggerMessageId: string;
600
1265
  streamId: string;
601
1266
  error?: import("@sixb/core").SixbFailure<"agent.execution_failed" | "ai.usage_limit_exceeded" | "ai.usage_limit_unavailable" | "internal.unexpected" | "runtime.cancelled"> | undefined;
1267
+ requestedBy?: {
1268
+ id: string;
1269
+ type: "user" | "serviceAccount";
1270
+ } | undefined;
602
1271
  model?: {
603
1272
  modelId: string;
604
1273
  provider: string;
@@ -606,6 +1275,8 @@ export declare function registerAgentRoutes(app: Elysia, host: SixbHostView): El
606
1275
  modelId?: string | undefined;
607
1276
  startedAt?: string | undefined;
608
1277
  completedAt?: string | undefined;
1278
+ approvalMode?: "manual" | "accept-edits" | "auto" | undefined;
1279
+ tier?: "light" | "standard" | "heavy" | undefined;
609
1280
  reasoning?: "none" | "provider-default" | "minimal" | "low" | "medium" | "high" | "xhigh" | "max" | {
610
1281
  budgetTokens: number;
611
1282
  } | undefined;
@@ -620,6 +1291,10 @@ export declare function registerAgentRoutes(app: Elysia, host: SixbHostView): El
620
1291
  textOutputTokens?: number | undefined;
621
1292
  reasoningOutputTokens?: number | undefined;
622
1293
  audioDurationMs?: number | undefined;
1294
+ imageOutputTokens?: number | undefined;
1295
+ audioOutputTokens?: number | undefined;
1296
+ outputImages?: number | undefined;
1297
+ inputCharacters?: number | undefined;
623
1298
  } | undefined;
624
1299
  cost?: {
625
1300
  amounts: {
@@ -630,17 +1305,13 @@ export declare function registerAgentRoutes(app: Elysia, host: SixbHostView): El
630
1305
  unpriceableCallCount: number;
631
1306
  unvaluedCallCount: number;
632
1307
  } | undefined;
633
- requestedBy?: {
634
- id: string;
635
- type: "user" | "serviceAccount";
636
- } | undefined;
637
- finishReason?: "error" | "length" | "unknown" | "stop" | "content-filter" | "tool-calls" | "timeout" | "interrupted" | "other" | undefined;
1308
+ finishReason?: "error" | "length" | "unknown" | "stop" | "content-filter" | "tool-calls" | "timeout" | "interrupted" | "awaiting_approval" | "awaiting_answer" | "other" | undefined;
1309
+ parentRunId?: string | undefined;
638
1310
  diagnostics?: {
639
- code: "output_file_limit_exceeded" | "output_file_too_large" | "output_budget_exhausted" | "output_collection_failed" | "output_file_changed" | "output_storage_failed" | "step_limit_reached";
1311
+ code: "step_limit_reached" | "output_limit_reached";
640
1312
  message: string;
641
1313
  severity: "error" | "warning";
642
- scope: "output" | "run";
643
- path?: string | undefined;
1314
+ scope: "run";
644
1315
  }[] | undefined;
645
1316
  };
646
1317
  } | {
@@ -657,6 +1328,7 @@ export declare function registerAgentRoutes(app: Elysia, host: SixbHostView): El
657
1328
  };
658
1329
  409: {
659
1330
  error: string;
1331
+ code?: string | undefined;
660
1332
  };
661
1333
  400: {
662
1334
  error: string;
@@ -672,15 +1344,20 @@ export declare function registerAgentRoutes(app: Elysia, host: SixbHostView): El
672
1344
  };
673
1345
  202: {
674
1346
  run: {
675
- status: "succeeded" | "failed" | "queued" | "running" | "cancelled";
1347
+ status: "succeeded" | "failed" | "cancelled" | "queued" | "running";
676
1348
  projectId: string;
677
1349
  id: string;
678
- attempt: number;
1350
+ kind: "conversation" | "subagent";
679
1351
  threadId: string;
680
1352
  createdAt: string;
1353
+ attempt: number;
681
1354
  triggerMessageId: string;
682
1355
  streamId: string;
683
1356
  error?: import("@sixb/core").SixbFailure<"agent.execution_failed" | "ai.usage_limit_exceeded" | "ai.usage_limit_unavailable" | "internal.unexpected" | "runtime.cancelled"> | undefined;
1357
+ requestedBy?: {
1358
+ id: string;
1359
+ type: "user" | "serviceAccount";
1360
+ } | undefined;
684
1361
  model?: {
685
1362
  modelId: string;
686
1363
  provider: string;
@@ -688,6 +1365,8 @@ export declare function registerAgentRoutes(app: Elysia, host: SixbHostView): El
688
1365
  modelId?: string | undefined;
689
1366
  startedAt?: string | undefined;
690
1367
  completedAt?: string | undefined;
1368
+ approvalMode?: "manual" | "accept-edits" | "auto" | undefined;
1369
+ tier?: "light" | "standard" | "heavy" | undefined;
691
1370
  reasoning?: "none" | "provider-default" | "minimal" | "low" | "medium" | "high" | "xhigh" | "max" | {
692
1371
  budgetTokens: number;
693
1372
  } | undefined;
@@ -702,6 +1381,10 @@ export declare function registerAgentRoutes(app: Elysia, host: SixbHostView): El
702
1381
  textOutputTokens?: number | undefined;
703
1382
  reasoningOutputTokens?: number | undefined;
704
1383
  audioDurationMs?: number | undefined;
1384
+ imageOutputTokens?: number | undefined;
1385
+ audioOutputTokens?: number | undefined;
1386
+ outputImages?: number | undefined;
1387
+ inputCharacters?: number | undefined;
705
1388
  } | undefined;
706
1389
  cost?: {
707
1390
  amounts: {
@@ -712,17 +1395,13 @@ export declare function registerAgentRoutes(app: Elysia, host: SixbHostView): El
712
1395
  unpriceableCallCount: number;
713
1396
  unvaluedCallCount: number;
714
1397
  } | undefined;
715
- requestedBy?: {
716
- id: string;
717
- type: "user" | "serviceAccount";
718
- } | undefined;
719
- finishReason?: "error" | "length" | "unknown" | "stop" | "content-filter" | "tool-calls" | "timeout" | "interrupted" | "other" | undefined;
1398
+ finishReason?: "error" | "length" | "unknown" | "stop" | "content-filter" | "tool-calls" | "timeout" | "interrupted" | "awaiting_approval" | "awaiting_answer" | "other" | undefined;
1399
+ parentRunId?: string | undefined;
720
1400
  diagnostics?: {
721
- code: "output_file_limit_exceeded" | "output_file_too_large" | "output_budget_exhausted" | "output_collection_failed" | "output_file_changed" | "output_storage_failed" | "step_limit_reached";
1401
+ code: "step_limit_reached" | "output_limit_reached";
722
1402
  message: string;
723
1403
  severity: "error" | "warning";
724
- scope: "output" | "run";
725
- path?: string | undefined;
1404
+ scope: "run";
726
1405
  }[] | undefined;
727
1406
  };
728
1407
  };
@@ -758,15 +1437,20 @@ export declare function registerAgentRoutes(app: Elysia, host: SixbHostView): El
758
1437
  response: {
759
1438
  200: {
760
1439
  run: {
761
- status: "succeeded" | "failed" | "queued" | "running" | "cancelled";
1440
+ status: "succeeded" | "failed" | "cancelled" | "queued" | "running";
762
1441
  projectId: string;
763
1442
  id: string;
764
- attempt: number;
1443
+ kind: "conversation" | "subagent";
765
1444
  threadId: string;
766
1445
  createdAt: string;
1446
+ attempt: number;
767
1447
  triggerMessageId: string;
768
1448
  streamId: string;
769
1449
  error?: import("@sixb/core").SixbFailure<"agent.execution_failed" | "ai.usage_limit_exceeded" | "ai.usage_limit_unavailable" | "internal.unexpected" | "runtime.cancelled"> | undefined;
1450
+ requestedBy?: {
1451
+ id: string;
1452
+ type: "user" | "serviceAccount";
1453
+ } | undefined;
770
1454
  model?: {
771
1455
  modelId: string;
772
1456
  provider: string;
@@ -774,6 +1458,8 @@ export declare function registerAgentRoutes(app: Elysia, host: SixbHostView): El
774
1458
  modelId?: string | undefined;
775
1459
  startedAt?: string | undefined;
776
1460
  completedAt?: string | undefined;
1461
+ approvalMode?: "manual" | "accept-edits" | "auto" | undefined;
1462
+ tier?: "light" | "standard" | "heavy" | undefined;
777
1463
  reasoning?: "none" | "provider-default" | "minimal" | "low" | "medium" | "high" | "xhigh" | "max" | {
778
1464
  budgetTokens: number;
779
1465
  } | undefined;
@@ -788,6 +1474,10 @@ export declare function registerAgentRoutes(app: Elysia, host: SixbHostView): El
788
1474
  textOutputTokens?: number | undefined;
789
1475
  reasoningOutputTokens?: number | undefined;
790
1476
  audioDurationMs?: number | undefined;
1477
+ imageOutputTokens?: number | undefined;
1478
+ audioOutputTokens?: number | undefined;
1479
+ outputImages?: number | undefined;
1480
+ inputCharacters?: number | undefined;
791
1481
  } | undefined;
792
1482
  cost?: {
793
1483
  amounts: {
@@ -798,17 +1488,13 @@ export declare function registerAgentRoutes(app: Elysia, host: SixbHostView): El
798
1488
  unpriceableCallCount: number;
799
1489
  unvaluedCallCount: number;
800
1490
  } | undefined;
801
- requestedBy?: {
802
- id: string;
803
- type: "user" | "serviceAccount";
804
- } | undefined;
805
- finishReason?: "error" | "length" | "unknown" | "stop" | "content-filter" | "tool-calls" | "timeout" | "interrupted" | "other" | undefined;
1491
+ finishReason?: "error" | "length" | "unknown" | "stop" | "content-filter" | "tool-calls" | "timeout" | "interrupted" | "awaiting_approval" | "awaiting_answer" | "other" | undefined;
1492
+ parentRunId?: string | undefined;
806
1493
  diagnostics?: {
807
- code: "output_file_limit_exceeded" | "output_file_too_large" | "output_budget_exhausted" | "output_collection_failed" | "output_file_changed" | "output_storage_failed" | "step_limit_reached";
1494
+ code: "step_limit_reached" | "output_limit_reached";
808
1495
  message: string;
809
1496
  severity: "error" | "warning";
810
- scope: "output" | "run";
811
- path?: string | undefined;
1497
+ scope: "run";
812
1498
  }[] | undefined;
813
1499
  };
814
1500
  } | {
@@ -820,26 +1506,37 @@ export declare function registerAgentRoutes(app: Elysia, host: SixbHostView): El
820
1506
  404: {
821
1507
  error: string;
822
1508
  };
1509
+ 403: {
1510
+ error: string;
1511
+ code?: string | undefined;
1512
+ };
823
1513
  409: {
824
1514
  error: string;
1515
+ code?: string | undefined;
825
1516
  };
826
1517
  400: {
827
1518
  error: string;
1519
+ code?: string | undefined;
828
1520
  };
829
1521
  501: {
830
1522
  error: string;
831
1523
  };
832
1524
  202: {
833
1525
  run: {
834
- status: "succeeded" | "failed" | "queued" | "running" | "cancelled";
1526
+ status: "succeeded" | "failed" | "cancelled" | "queued" | "running";
835
1527
  projectId: string;
836
1528
  id: string;
837
- attempt: number;
1529
+ kind: "conversation" | "subagent";
838
1530
  threadId: string;
839
1531
  createdAt: string;
1532
+ attempt: number;
840
1533
  triggerMessageId: string;
841
1534
  streamId: string;
842
1535
  error?: import("@sixb/core").SixbFailure<"agent.execution_failed" | "ai.usage_limit_exceeded" | "ai.usage_limit_unavailable" | "internal.unexpected" | "runtime.cancelled"> | undefined;
1536
+ requestedBy?: {
1537
+ id: string;
1538
+ type: "user" | "serviceAccount";
1539
+ } | undefined;
843
1540
  model?: {
844
1541
  modelId: string;
845
1542
  provider: string;
@@ -847,6 +1544,8 @@ export declare function registerAgentRoutes(app: Elysia, host: SixbHostView): El
847
1544
  modelId?: string | undefined;
848
1545
  startedAt?: string | undefined;
849
1546
  completedAt?: string | undefined;
1547
+ approvalMode?: "manual" | "accept-edits" | "auto" | undefined;
1548
+ tier?: "light" | "standard" | "heavy" | undefined;
850
1549
  reasoning?: "none" | "provider-default" | "minimal" | "low" | "medium" | "high" | "xhigh" | "max" | {
851
1550
  budgetTokens: number;
852
1551
  } | undefined;
@@ -861,6 +1560,10 @@ export declare function registerAgentRoutes(app: Elysia, host: SixbHostView): El
861
1560
  textOutputTokens?: number | undefined;
862
1561
  reasoningOutputTokens?: number | undefined;
863
1562
  audioDurationMs?: number | undefined;
1563
+ imageOutputTokens?: number | undefined;
1564
+ audioOutputTokens?: number | undefined;
1565
+ outputImages?: number | undefined;
1566
+ inputCharacters?: number | undefined;
864
1567
  } | undefined;
865
1568
  cost?: {
866
1569
  amounts: {
@@ -871,17 +1574,13 @@ export declare function registerAgentRoutes(app: Elysia, host: SixbHostView): El
871
1574
  unpriceableCallCount: number;
872
1575
  unvaluedCallCount: number;
873
1576
  } | undefined;
874
- requestedBy?: {
875
- id: string;
876
- type: "user" | "serviceAccount";
877
- } | undefined;
878
- finishReason?: "error" | "length" | "unknown" | "stop" | "content-filter" | "tool-calls" | "timeout" | "interrupted" | "other" | undefined;
1577
+ finishReason?: "error" | "length" | "unknown" | "stop" | "content-filter" | "tool-calls" | "timeout" | "interrupted" | "awaiting_approval" | "awaiting_answer" | "other" | undefined;
1578
+ parentRunId?: string | undefined;
879
1579
  diagnostics?: {
880
- code: "output_file_limit_exceeded" | "output_file_too_large" | "output_budget_exhausted" | "output_collection_failed" | "output_file_changed" | "output_storage_failed" | "step_limit_reached";
1580
+ code: "step_limit_reached" | "output_limit_reached";
881
1581
  message: string;
882
1582
  severity: "error" | "warning";
883
- scope: "output" | "run";
884
- path?: string | undefined;
1583
+ scope: "run";
885
1584
  }[] | undefined;
886
1585
  };
887
1586
  };
@@ -918,15 +1617,20 @@ export declare function registerAgentRoutes(app: Elysia, host: SixbHostView): El
918
1617
  response: {
919
1618
  200: {
920
1619
  run: {
921
- status: "succeeded" | "failed" | "queued" | "running" | "cancelled";
1620
+ status: "succeeded" | "failed" | "cancelled" | "queued" | "running";
922
1621
  projectId: string;
923
1622
  id: string;
924
- attempt: number;
1623
+ kind: "conversation" | "subagent";
925
1624
  threadId: string;
926
1625
  createdAt: string;
1626
+ attempt: number;
927
1627
  triggerMessageId: string;
928
1628
  streamId: string;
929
1629
  error?: import("@sixb/core").SixbFailure<"agent.execution_failed" | "ai.usage_limit_exceeded" | "ai.usage_limit_unavailable" | "internal.unexpected" | "runtime.cancelled"> | undefined;
1630
+ requestedBy?: {
1631
+ id: string;
1632
+ type: "user" | "serviceAccount";
1633
+ } | undefined;
930
1634
  model?: {
931
1635
  modelId: string;
932
1636
  provider: string;
@@ -934,6 +1638,8 @@ export declare function registerAgentRoutes(app: Elysia, host: SixbHostView): El
934
1638
  modelId?: string | undefined;
935
1639
  startedAt?: string | undefined;
936
1640
  completedAt?: string | undefined;
1641
+ approvalMode?: "manual" | "accept-edits" | "auto" | undefined;
1642
+ tier?: "light" | "standard" | "heavy" | undefined;
937
1643
  reasoning?: "none" | "provider-default" | "minimal" | "low" | "medium" | "high" | "xhigh" | "max" | {
938
1644
  budgetTokens: number;
939
1645
  } | undefined;
@@ -948,6 +1654,10 @@ export declare function registerAgentRoutes(app: Elysia, host: SixbHostView): El
948
1654
  textOutputTokens?: number | undefined;
949
1655
  reasoningOutputTokens?: number | undefined;
950
1656
  audioDurationMs?: number | undefined;
1657
+ imageOutputTokens?: number | undefined;
1658
+ audioOutputTokens?: number | undefined;
1659
+ outputImages?: number | undefined;
1660
+ inputCharacters?: number | undefined;
951
1661
  } | undefined;
952
1662
  cost?: {
953
1663
  amounts: {
@@ -958,17 +1668,13 @@ export declare function registerAgentRoutes(app: Elysia, host: SixbHostView): El
958
1668
  unpriceableCallCount: number;
959
1669
  unvaluedCallCount: number;
960
1670
  } | undefined;
961
- requestedBy?: {
962
- id: string;
963
- type: "user" | "serviceAccount";
964
- } | undefined;
965
- finishReason?: "error" | "length" | "unknown" | "stop" | "content-filter" | "tool-calls" | "timeout" | "interrupted" | "other" | undefined;
1671
+ finishReason?: "error" | "length" | "unknown" | "stop" | "content-filter" | "tool-calls" | "timeout" | "interrupted" | "awaiting_approval" | "awaiting_answer" | "other" | undefined;
1672
+ parentRunId?: string | undefined;
966
1673
  diagnostics?: {
967
- code: "output_file_limit_exceeded" | "output_file_too_large" | "output_budget_exhausted" | "output_collection_failed" | "output_file_changed" | "output_storage_failed" | "step_limit_reached";
1674
+ code: "step_limit_reached" | "output_limit_reached";
968
1675
  message: string;
969
1676
  severity: "error" | "warning";
970
- scope: "output" | "run";
971
- path?: string | undefined;
1677
+ scope: "run";
972
1678
  }[] | undefined;
973
1679
  };
974
1680
  } | {
@@ -980,11 +1686,17 @@ export declare function registerAgentRoutes(app: Elysia, host: SixbHostView): El
980
1686
  404: {
981
1687
  error: string;
982
1688
  };
1689
+ 403: {
1690
+ error: string;
1691
+ code?: string | undefined;
1692
+ };
983
1693
  409: {
984
1694
  error: string;
1695
+ code?: string | undefined;
985
1696
  };
986
1697
  400: {
987
1698
  error: string;
1699
+ code?: string | undefined;
988
1700
  };
989
1701
  429: {
990
1702
  error: string;
@@ -996,15 +1708,20 @@ export declare function registerAgentRoutes(app: Elysia, host: SixbHostView): El
996
1708
  };
997
1709
  202: {
998
1710
  run: {
999
- status: "succeeded" | "failed" | "queued" | "running" | "cancelled";
1711
+ status: "succeeded" | "failed" | "cancelled" | "queued" | "running";
1000
1712
  projectId: string;
1001
1713
  id: string;
1002
- attempt: number;
1714
+ kind: "conversation" | "subagent";
1003
1715
  threadId: string;
1004
1716
  createdAt: string;
1717
+ attempt: number;
1005
1718
  triggerMessageId: string;
1006
1719
  streamId: string;
1007
1720
  error?: import("@sixb/core").SixbFailure<"agent.execution_failed" | "ai.usage_limit_exceeded" | "ai.usage_limit_unavailable" | "internal.unexpected" | "runtime.cancelled"> | undefined;
1721
+ requestedBy?: {
1722
+ id: string;
1723
+ type: "user" | "serviceAccount";
1724
+ } | undefined;
1008
1725
  model?: {
1009
1726
  modelId: string;
1010
1727
  provider: string;
@@ -1012,6 +1729,8 @@ export declare function registerAgentRoutes(app: Elysia, host: SixbHostView): El
1012
1729
  modelId?: string | undefined;
1013
1730
  startedAt?: string | undefined;
1014
1731
  completedAt?: string | undefined;
1732
+ approvalMode?: "manual" | "accept-edits" | "auto" | undefined;
1733
+ tier?: "light" | "standard" | "heavy" | undefined;
1015
1734
  reasoning?: "none" | "provider-default" | "minimal" | "low" | "medium" | "high" | "xhigh" | "max" | {
1016
1735
  budgetTokens: number;
1017
1736
  } | undefined;
@@ -1026,6 +1745,10 @@ export declare function registerAgentRoutes(app: Elysia, host: SixbHostView): El
1026
1745
  textOutputTokens?: number | undefined;
1027
1746
  reasoningOutputTokens?: number | undefined;
1028
1747
  audioDurationMs?: number | undefined;
1748
+ imageOutputTokens?: number | undefined;
1749
+ audioOutputTokens?: number | undefined;
1750
+ outputImages?: number | undefined;
1751
+ inputCharacters?: number | undefined;
1029
1752
  } | undefined;
1030
1753
  cost?: {
1031
1754
  amounts: {
@@ -1036,17 +1759,13 @@ export declare function registerAgentRoutes(app: Elysia, host: SixbHostView): El
1036
1759
  unpriceableCallCount: number;
1037
1760
  unvaluedCallCount: number;
1038
1761
  } | undefined;
1039
- requestedBy?: {
1040
- id: string;
1041
- type: "user" | "serviceAccount";
1042
- } | undefined;
1043
- finishReason?: "error" | "length" | "unknown" | "stop" | "content-filter" | "tool-calls" | "timeout" | "interrupted" | "other" | undefined;
1762
+ finishReason?: "error" | "length" | "unknown" | "stop" | "content-filter" | "tool-calls" | "timeout" | "interrupted" | "awaiting_approval" | "awaiting_answer" | "other" | undefined;
1763
+ parentRunId?: string | undefined;
1044
1764
  diagnostics?: {
1045
- code: "output_file_limit_exceeded" | "output_file_too_large" | "output_budget_exhausted" | "output_collection_failed" | "output_file_changed" | "output_storage_failed" | "step_limit_reached";
1765
+ code: "step_limit_reached" | "output_limit_reached";
1046
1766
  message: string;
1047
1767
  severity: "error" | "warning";
1048
- scope: "output" | "run";
1049
- path?: string | undefined;
1768
+ scope: "run";
1050
1769
  }[] | undefined;
1051
1770
  };
1052
1771
  };
@@ -1078,7 +1797,7 @@ export declare function registerAgentRoutes(app: Elysia, host: SixbHostView): El
1078
1797
  threadId: string;
1079
1798
  };
1080
1799
  query: {
1081
- status?: "succeeded" | "failed" | "queued" | "running" | "cancelled" | undefined;
1800
+ status?: "succeeded" | "failed" | "cancelled" | "queued" | "running" | undefined;
1082
1801
  limit?: string | undefined;
1083
1802
  offset?: string | undefined;
1084
1803
  order?: "asc" | "desc" | undefined;
@@ -1087,15 +1806,20 @@ export declare function registerAgentRoutes(app: Elysia, host: SixbHostView): El
1087
1806
  response: {
1088
1807
  200: {
1089
1808
  runs: {
1090
- status: "succeeded" | "failed" | "queued" | "running" | "cancelled";
1809
+ status: "succeeded" | "failed" | "cancelled" | "queued" | "running";
1091
1810
  projectId: string;
1092
1811
  id: string;
1093
- attempt: number;
1812
+ kind: "conversation" | "subagent";
1094
1813
  threadId: string;
1095
1814
  createdAt: string;
1815
+ attempt: number;
1096
1816
  triggerMessageId: string;
1097
1817
  streamId: string;
1098
1818
  error?: import("@sixb/core").SixbFailure<"agent.execution_failed" | "ai.usage_limit_exceeded" | "ai.usage_limit_unavailable" | "internal.unexpected" | "runtime.cancelled"> | undefined;
1819
+ requestedBy?: {
1820
+ id: string;
1821
+ type: "user" | "serviceAccount";
1822
+ } | undefined;
1099
1823
  model?: {
1100
1824
  modelId: string;
1101
1825
  provider: string;
@@ -1103,6 +1827,8 @@ export declare function registerAgentRoutes(app: Elysia, host: SixbHostView): El
1103
1827
  modelId?: string | undefined;
1104
1828
  startedAt?: string | undefined;
1105
1829
  completedAt?: string | undefined;
1830
+ approvalMode?: "manual" | "accept-edits" | "auto" | undefined;
1831
+ tier?: "light" | "standard" | "heavy" | undefined;
1106
1832
  reasoning?: "none" | "provider-default" | "minimal" | "low" | "medium" | "high" | "xhigh" | "max" | {
1107
1833
  budgetTokens: number;
1108
1834
  } | undefined;
@@ -1117,6 +1843,10 @@ export declare function registerAgentRoutes(app: Elysia, host: SixbHostView): El
1117
1843
  textOutputTokens?: number | undefined;
1118
1844
  reasoningOutputTokens?: number | undefined;
1119
1845
  audioDurationMs?: number | undefined;
1846
+ imageOutputTokens?: number | undefined;
1847
+ audioOutputTokens?: number | undefined;
1848
+ outputImages?: number | undefined;
1849
+ inputCharacters?: number | undefined;
1120
1850
  } | undefined;
1121
1851
  cost?: {
1122
1852
  amounts: {
@@ -1127,17 +1857,13 @@ export declare function registerAgentRoutes(app: Elysia, host: SixbHostView): El
1127
1857
  unpriceableCallCount: number;
1128
1858
  unvaluedCallCount: number;
1129
1859
  } | undefined;
1130
- requestedBy?: {
1131
- id: string;
1132
- type: "user" | "serviceAccount";
1133
- } | undefined;
1134
- finishReason?: "error" | "length" | "unknown" | "stop" | "content-filter" | "tool-calls" | "timeout" | "interrupted" | "other" | undefined;
1860
+ finishReason?: "error" | "length" | "unknown" | "stop" | "content-filter" | "tool-calls" | "timeout" | "interrupted" | "awaiting_approval" | "awaiting_answer" | "other" | undefined;
1861
+ parentRunId?: string | undefined;
1135
1862
  diagnostics?: {
1136
- code: "output_file_limit_exceeded" | "output_file_too_large" | "output_budget_exhausted" | "output_collection_failed" | "output_file_changed" | "output_storage_failed" | "step_limit_reached";
1863
+ code: "step_limit_reached" | "output_limit_reached";
1137
1864
  message: string;
1138
1865
  severity: "error" | "warning";
1139
- scope: "output" | "run";
1140
- path?: string | undefined;
1866
+ scope: "run";
1141
1867
  }[] | undefined;
1142
1868
  }[];
1143
1869
  hasMore: boolean;
@@ -1180,15 +1906,20 @@ export declare function registerAgentRoutes(app: Elysia, host: SixbHostView): El
1180
1906
  headers: unknown;
1181
1907
  response: {
1182
1908
  200: {
1183
- status: "succeeded" | "failed" | "queued" | "running" | "cancelled";
1909
+ status: "succeeded" | "failed" | "cancelled" | "queued" | "running";
1184
1910
  projectId: string;
1185
1911
  id: string;
1186
- attempt: number;
1912
+ kind: "conversation" | "subagent";
1187
1913
  threadId: string;
1188
1914
  createdAt: string;
1915
+ attempt: number;
1189
1916
  triggerMessageId: string;
1190
1917
  streamId: string;
1191
1918
  error?: import("@sixb/core").SixbFailure<"agent.execution_failed" | "ai.usage_limit_exceeded" | "ai.usage_limit_unavailable" | "internal.unexpected" | "runtime.cancelled"> | undefined;
1919
+ requestedBy?: {
1920
+ id: string;
1921
+ type: "user" | "serviceAccount";
1922
+ } | undefined;
1192
1923
  model?: {
1193
1924
  modelId: string;
1194
1925
  provider: string;
@@ -1196,6 +1927,8 @@ export declare function registerAgentRoutes(app: Elysia, host: SixbHostView): El
1196
1927
  modelId?: string | undefined;
1197
1928
  startedAt?: string | undefined;
1198
1929
  completedAt?: string | undefined;
1930
+ approvalMode?: "manual" | "accept-edits" | "auto" | undefined;
1931
+ tier?: "light" | "standard" | "heavy" | undefined;
1199
1932
  reasoning?: "none" | "provider-default" | "minimal" | "low" | "medium" | "high" | "xhigh" | "max" | {
1200
1933
  budgetTokens: number;
1201
1934
  } | undefined;
@@ -1210,6 +1943,10 @@ export declare function registerAgentRoutes(app: Elysia, host: SixbHostView): El
1210
1943
  textOutputTokens?: number | undefined;
1211
1944
  reasoningOutputTokens?: number | undefined;
1212
1945
  audioDurationMs?: number | undefined;
1946
+ imageOutputTokens?: number | undefined;
1947
+ audioOutputTokens?: number | undefined;
1948
+ outputImages?: number | undefined;
1949
+ inputCharacters?: number | undefined;
1213
1950
  } | undefined;
1214
1951
  cost?: {
1215
1952
  amounts: {
@@ -1220,17 +1957,13 @@ export declare function registerAgentRoutes(app: Elysia, host: SixbHostView): El
1220
1957
  unpriceableCallCount: number;
1221
1958
  unvaluedCallCount: number;
1222
1959
  } | undefined;
1223
- requestedBy?: {
1224
- id: string;
1225
- type: "user" | "serviceAccount";
1226
- } | undefined;
1227
- finishReason?: "error" | "length" | "unknown" | "stop" | "content-filter" | "tool-calls" | "timeout" | "interrupted" | "other" | undefined;
1960
+ finishReason?: "error" | "length" | "unknown" | "stop" | "content-filter" | "tool-calls" | "timeout" | "interrupted" | "awaiting_approval" | "awaiting_answer" | "other" | undefined;
1961
+ parentRunId?: string | undefined;
1228
1962
  diagnostics?: {
1229
- code: "output_file_limit_exceeded" | "output_file_too_large" | "output_budget_exhausted" | "output_collection_failed" | "output_file_changed" | "output_storage_failed" | "step_limit_reached";
1963
+ code: "step_limit_reached" | "output_limit_reached";
1230
1964
  message: string;
1231
1965
  severity: "error" | "warning";
1232
- scope: "output" | "run";
1233
- path?: string | undefined;
1966
+ scope: "run";
1234
1967
  }[] | undefined;
1235
1968
  };
1236
1969
  404: {
@@ -1256,6 +1989,183 @@ export declare function registerAgentRoutes(app: Elysia, host: SixbHostView): El
1256
1989
  };
1257
1990
  };
1258
1991
  };
1992
+ } & {
1993
+ api: {
1994
+ "agent-runs": {
1995
+ ":runId": {
1996
+ cancel: {
1997
+ post: {
1998
+ body: unknown;
1999
+ params: {
2000
+ runId: string;
2001
+ };
2002
+ query: unknown;
2003
+ headers: unknown;
2004
+ response: {
2005
+ 200: {
2006
+ run: {
2007
+ status: "succeeded" | "failed" | "cancelled" | "queued" | "running";
2008
+ projectId: string;
2009
+ id: string;
2010
+ kind: "conversation" | "subagent";
2011
+ threadId: string;
2012
+ createdAt: string;
2013
+ attempt: number;
2014
+ triggerMessageId: string;
2015
+ streamId: string;
2016
+ error?: import("@sixb/core").SixbFailure<"agent.execution_failed" | "ai.usage_limit_exceeded" | "ai.usage_limit_unavailable" | "internal.unexpected" | "runtime.cancelled"> | undefined;
2017
+ requestedBy?: {
2018
+ id: string;
2019
+ type: "user" | "serviceAccount";
2020
+ } | undefined;
2021
+ model?: {
2022
+ modelId: string;
2023
+ provider: string;
2024
+ } | undefined;
2025
+ modelId?: string | undefined;
2026
+ startedAt?: string | undefined;
2027
+ completedAt?: string | undefined;
2028
+ approvalMode?: "manual" | "accept-edits" | "auto" | undefined;
2029
+ tier?: "light" | "standard" | "heavy" | undefined;
2030
+ reasoning?: "none" | "provider-default" | "minimal" | "low" | "medium" | "high" | "xhigh" | "max" | {
2031
+ budgetTokens: number;
2032
+ } | undefined;
2033
+ usage?: {
2034
+ reportingStatus: "partial" | "complete" | "unavailable";
2035
+ inputTokens?: number | undefined;
2036
+ outputTokens?: number | undefined;
2037
+ totalTokens?: number | undefined;
2038
+ uncachedInputTokens?: number | undefined;
2039
+ cacheReadInputTokens?: number | undefined;
2040
+ cacheWriteInputTokens?: number | undefined;
2041
+ textOutputTokens?: number | undefined;
2042
+ reasoningOutputTokens?: number | undefined;
2043
+ audioDurationMs?: number | undefined;
2044
+ imageOutputTokens?: number | undefined;
2045
+ audioOutputTokens?: number | undefined;
2046
+ outputImages?: number | undefined;
2047
+ inputCharacters?: number | undefined;
2048
+ } | undefined;
2049
+ cost?: {
2050
+ amounts: {
2051
+ currency: string;
2052
+ amountNanos: string;
2053
+ }[];
2054
+ ratedCallCount: number;
2055
+ unpriceableCallCount: number;
2056
+ unvaluedCallCount: number;
2057
+ } | undefined;
2058
+ finishReason?: "error" | "length" | "unknown" | "stop" | "content-filter" | "tool-calls" | "timeout" | "interrupted" | "awaiting_approval" | "awaiting_answer" | "other" | undefined;
2059
+ parentRunId?: string | undefined;
2060
+ diagnostics?: {
2061
+ code: "step_limit_reached" | "output_limit_reached";
2062
+ message: string;
2063
+ severity: "error" | "warning";
2064
+ scope: "run";
2065
+ }[] | undefined;
2066
+ };
2067
+ } | {
2068
+ readonly error: string;
2069
+ readonly code: AgentRequestErrorCode;
2070
+ } | {
2071
+ error: string;
2072
+ };
2073
+ 404: {
2074
+ error: string;
2075
+ };
2076
+ 403: {
2077
+ error: string;
2078
+ code?: string | undefined;
2079
+ };
2080
+ 409: {
2081
+ error: string;
2082
+ code?: string | undefined;
2083
+ };
2084
+ 400: {
2085
+ error: string;
2086
+ code?: string | undefined;
2087
+ };
2088
+ 501: {
2089
+ error: string;
2090
+ };
2091
+ 202: {
2092
+ run: {
2093
+ status: "succeeded" | "failed" | "cancelled" | "queued" | "running";
2094
+ projectId: string;
2095
+ id: string;
2096
+ kind: "conversation" | "subagent";
2097
+ threadId: string;
2098
+ createdAt: string;
2099
+ attempt: number;
2100
+ triggerMessageId: string;
2101
+ streamId: string;
2102
+ error?: import("@sixb/core").SixbFailure<"agent.execution_failed" | "ai.usage_limit_exceeded" | "ai.usage_limit_unavailable" | "internal.unexpected" | "runtime.cancelled"> | undefined;
2103
+ requestedBy?: {
2104
+ id: string;
2105
+ type: "user" | "serviceAccount";
2106
+ } | undefined;
2107
+ model?: {
2108
+ modelId: string;
2109
+ provider: string;
2110
+ } | undefined;
2111
+ modelId?: string | undefined;
2112
+ startedAt?: string | undefined;
2113
+ completedAt?: string | undefined;
2114
+ approvalMode?: "manual" | "accept-edits" | "auto" | undefined;
2115
+ tier?: "light" | "standard" | "heavy" | undefined;
2116
+ reasoning?: "none" | "provider-default" | "minimal" | "low" | "medium" | "high" | "xhigh" | "max" | {
2117
+ budgetTokens: number;
2118
+ } | undefined;
2119
+ usage?: {
2120
+ reportingStatus: "partial" | "complete" | "unavailable";
2121
+ inputTokens?: number | undefined;
2122
+ outputTokens?: number | undefined;
2123
+ totalTokens?: number | undefined;
2124
+ uncachedInputTokens?: number | undefined;
2125
+ cacheReadInputTokens?: number | undefined;
2126
+ cacheWriteInputTokens?: number | undefined;
2127
+ textOutputTokens?: number | undefined;
2128
+ reasoningOutputTokens?: number | undefined;
2129
+ audioDurationMs?: number | undefined;
2130
+ imageOutputTokens?: number | undefined;
2131
+ audioOutputTokens?: number | undefined;
2132
+ outputImages?: number | undefined;
2133
+ inputCharacters?: number | undefined;
2134
+ } | undefined;
2135
+ cost?: {
2136
+ amounts: {
2137
+ currency: string;
2138
+ amountNanos: string;
2139
+ }[];
2140
+ ratedCallCount: number;
2141
+ unpriceableCallCount: number;
2142
+ unvaluedCallCount: number;
2143
+ } | undefined;
2144
+ finishReason?: "error" | "length" | "unknown" | "stop" | "content-filter" | "tool-calls" | "timeout" | "interrupted" | "awaiting_approval" | "awaiting_answer" | "other" | undefined;
2145
+ parentRunId?: string | undefined;
2146
+ diagnostics?: {
2147
+ code: "step_limit_reached" | "output_limit_reached";
2148
+ message: string;
2149
+ severity: "error" | "warning";
2150
+ scope: "run";
2151
+ }[] | undefined;
2152
+ };
2153
+ };
2154
+ 422: {
2155
+ type: "validation";
2156
+ on: string;
2157
+ summary?: string;
2158
+ message?: string;
2159
+ found?: unknown;
2160
+ property?: string;
2161
+ expected?: string;
2162
+ };
2163
+ };
2164
+ };
2165
+ };
2166
+ };
2167
+ };
2168
+ };
1259
2169
  }, {
1260
2170
  derive: {};
1261
2171
  resolve: {};