@sixb/server 0.1.21 → 0.1.23

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,400 @@
1
+ import type { SixbHostView } from "@sixb/core";
2
+ import type { Elysia } from "elysia";
3
+ /**
4
+ * Call the project's models directly. Each route makes the same runtime call project code does, in
5
+ * the request's execution, so accounting, AI limits and the files record apply unchanged. Calls
6
+ * need `can.run(project.models)`.
7
+ */
8
+ export declare function registerModelGenerationRoutes(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
+ models: {
26
+ language: {
27
+ generations: {
28
+ post: {
29
+ body: {
30
+ prompt: string;
31
+ model?: {
32
+ modelId: string;
33
+ provider: string;
34
+ } | "light" | "standard" | "heavy" | undefined;
35
+ reasoning?: "none" | "provider-default" | "minimal" | "low" | "medium" | "high" | "xhigh" | "max" | {
36
+ budgetTokens: number;
37
+ } | undefined;
38
+ instructions?: string | undefined;
39
+ maxOutputTokens?: number | undefined;
40
+ };
41
+ params: {};
42
+ query: unknown;
43
+ headers: unknown;
44
+ response: {
45
+ 200: {
46
+ text: string;
47
+ model: {
48
+ modelId: string;
49
+ provider: string;
50
+ };
51
+ callId: string;
52
+ usage: {
53
+ inputTokens?: number | undefined;
54
+ outputTokens?: number | undefined;
55
+ uncachedInputTokens?: number | undefined;
56
+ cacheReadInputTokens?: number | undefined;
57
+ cacheWriteInputTokens?: number | undefined;
58
+ textOutputTokens?: number | undefined;
59
+ reasoningOutputTokens?: number | undefined;
60
+ audioDurationMs?: number | undefined;
61
+ imageOutputTokens?: number | undefined;
62
+ audioOutputTokens?: number | undefined;
63
+ outputImages?: number | undefined;
64
+ inputCharacters?: number | undefined;
65
+ };
66
+ cost: {
67
+ status: "reported" | "rated" | "unpriceable";
68
+ reason?: string | undefined;
69
+ money?: {
70
+ currency: "USD";
71
+ amountNanos: string;
72
+ } | undefined;
73
+ };
74
+ finishReason: string;
75
+ };
76
+ 404: {
77
+ error: string;
78
+ };
79
+ 403: {
80
+ error: string;
81
+ };
82
+ 502: {
83
+ error: string;
84
+ };
85
+ 400: {
86
+ error: string;
87
+ };
88
+ 429: {
89
+ error: string;
90
+ code: "ai.usage_limit_exceeded" | "ai.usage_limit_unavailable";
91
+ details?: import("../schemas/common").JsonValue | undefined;
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
+ } & {
109
+ api: {
110
+ models: {
111
+ image: {
112
+ generations: {
113
+ post: {
114
+ body: {
115
+ prompt: string;
116
+ model?: {
117
+ modelId: string;
118
+ provider: string;
119
+ } | undefined;
120
+ size?: string | undefined;
121
+ quality?: string | undefined;
122
+ style?: string | undefined;
123
+ images?: {
124
+ blobId: string;
125
+ digest: string;
126
+ sizeBytes: number;
127
+ fileName?: string | undefined;
128
+ mediaType?: string | undefined;
129
+ logicalPath?: string | undefined;
130
+ }[] | undefined;
131
+ n?: number | undefined;
132
+ aspectRatio?: string | undefined;
133
+ seed?: number | undefined;
134
+ };
135
+ params: {};
136
+ query: unknown;
137
+ headers: unknown;
138
+ response: {
139
+ 200: {
140
+ model: {
141
+ modelId: string;
142
+ provider: string;
143
+ };
144
+ callId: string;
145
+ files: {
146
+ blobId: string;
147
+ digest: string;
148
+ sizeBytes: number;
149
+ fileName?: string | undefined;
150
+ mediaType?: string | undefined;
151
+ logicalPath?: string | undefined;
152
+ }[];
153
+ usage: {
154
+ inputTokens?: number | undefined;
155
+ outputTokens?: number | undefined;
156
+ uncachedInputTokens?: number | undefined;
157
+ cacheReadInputTokens?: number | undefined;
158
+ cacheWriteInputTokens?: number | undefined;
159
+ textOutputTokens?: number | undefined;
160
+ reasoningOutputTokens?: number | undefined;
161
+ audioDurationMs?: number | undefined;
162
+ imageOutputTokens?: number | undefined;
163
+ audioOutputTokens?: number | undefined;
164
+ outputImages?: number | undefined;
165
+ inputCharacters?: number | undefined;
166
+ };
167
+ cost: {
168
+ status: "reported" | "rated" | "unpriceable";
169
+ reason?: string | undefined;
170
+ money?: {
171
+ currency: "USD";
172
+ amountNanos: string;
173
+ } | undefined;
174
+ };
175
+ warnings: string[];
176
+ };
177
+ 404: {
178
+ error: string;
179
+ };
180
+ 403: {
181
+ error: string;
182
+ };
183
+ 502: {
184
+ error: string;
185
+ };
186
+ 400: {
187
+ error: string;
188
+ };
189
+ 429: {
190
+ error: string;
191
+ code: "ai.usage_limit_exceeded" | "ai.usage_limit_unavailable";
192
+ details?: import("../schemas/common").JsonValue | undefined;
193
+ };
194
+ 422: {
195
+ type: "validation";
196
+ on: string;
197
+ summary?: string;
198
+ message?: string;
199
+ found?: unknown;
200
+ property?: string;
201
+ expected?: string;
202
+ };
203
+ };
204
+ };
205
+ };
206
+ };
207
+ };
208
+ };
209
+ } & {
210
+ api: {
211
+ models: {
212
+ audio: {
213
+ speech: {
214
+ post: {
215
+ body: {
216
+ text: string;
217
+ model?: {
218
+ modelId: string;
219
+ provider: string;
220
+ } | undefined;
221
+ mediaType?: string | undefined;
222
+ instructions?: string | undefined;
223
+ language?: string | undefined;
224
+ voice?: string | undefined;
225
+ speed?: number | undefined;
226
+ };
227
+ params: {};
228
+ query: unknown;
229
+ headers: unknown;
230
+ response: {
231
+ 200: {
232
+ model: {
233
+ modelId: string;
234
+ provider: string;
235
+ };
236
+ callId: string;
237
+ files: {
238
+ blobId: string;
239
+ digest: string;
240
+ sizeBytes: number;
241
+ fileName?: string | undefined;
242
+ mediaType?: string | undefined;
243
+ logicalPath?: string | undefined;
244
+ }[];
245
+ usage: {
246
+ inputTokens?: number | undefined;
247
+ outputTokens?: number | undefined;
248
+ uncachedInputTokens?: number | undefined;
249
+ cacheReadInputTokens?: number | undefined;
250
+ cacheWriteInputTokens?: number | undefined;
251
+ textOutputTokens?: number | undefined;
252
+ reasoningOutputTokens?: number | undefined;
253
+ audioDurationMs?: number | undefined;
254
+ imageOutputTokens?: number | undefined;
255
+ audioOutputTokens?: number | undefined;
256
+ outputImages?: number | undefined;
257
+ inputCharacters?: number | undefined;
258
+ };
259
+ cost: {
260
+ status: "reported" | "rated" | "unpriceable";
261
+ reason?: string | undefined;
262
+ money?: {
263
+ currency: "USD";
264
+ amountNanos: string;
265
+ } | undefined;
266
+ };
267
+ warnings: string[];
268
+ };
269
+ 404: {
270
+ error: string;
271
+ };
272
+ 403: {
273
+ error: string;
274
+ };
275
+ 502: {
276
+ error: string;
277
+ };
278
+ 400: {
279
+ error: string;
280
+ };
281
+ 429: {
282
+ error: string;
283
+ code: "ai.usage_limit_exceeded" | "ai.usage_limit_unavailable";
284
+ details?: import("../schemas/common").JsonValue | undefined;
285
+ };
286
+ 422: {
287
+ type: "validation";
288
+ on: string;
289
+ summary?: string;
290
+ message?: string;
291
+ found?: unknown;
292
+ property?: string;
293
+ expected?: string;
294
+ };
295
+ };
296
+ };
297
+ };
298
+ };
299
+ };
300
+ };
301
+ } & {
302
+ api: {
303
+ models: {
304
+ audio: {
305
+ transcriptions: {
306
+ post: {
307
+ body: {
308
+ audio: {
309
+ blobId: string;
310
+ digest: string;
311
+ sizeBytes: number;
312
+ fileName?: string | undefined;
313
+ mediaType?: string | undefined;
314
+ logicalPath?: string | undefined;
315
+ };
316
+ model?: {
317
+ modelId: string;
318
+ provider: string;
319
+ } | undefined;
320
+ };
321
+ params: {};
322
+ query: unknown;
323
+ headers: unknown;
324
+ response: {
325
+ 200: {
326
+ text: string;
327
+ model: {
328
+ modelId: string;
329
+ provider: string;
330
+ };
331
+ callId: string;
332
+ usage: {
333
+ inputTokens?: number | undefined;
334
+ outputTokens?: number | undefined;
335
+ uncachedInputTokens?: number | undefined;
336
+ cacheReadInputTokens?: number | undefined;
337
+ cacheWriteInputTokens?: number | undefined;
338
+ textOutputTokens?: number | undefined;
339
+ reasoningOutputTokens?: number | undefined;
340
+ audioDurationMs?: number | undefined;
341
+ imageOutputTokens?: number | undefined;
342
+ audioOutputTokens?: number | undefined;
343
+ outputImages?: number | undefined;
344
+ inputCharacters?: number | undefined;
345
+ };
346
+ cost: {
347
+ status: "reported" | "rated" | "unpriceable";
348
+ reason?: string | undefined;
349
+ money?: {
350
+ currency: "USD";
351
+ amountNanos: string;
352
+ } | undefined;
353
+ };
354
+ };
355
+ 404: {
356
+ error: string;
357
+ };
358
+ 403: {
359
+ error: string;
360
+ };
361
+ 502: {
362
+ error: string;
363
+ };
364
+ 400: {
365
+ error: string;
366
+ };
367
+ 429: {
368
+ error: string;
369
+ code: "ai.usage_limit_exceeded" | "ai.usage_limit_unavailable";
370
+ details?: import("../schemas/common").JsonValue | undefined;
371
+ };
372
+ 422: {
373
+ type: "validation";
374
+ on: string;
375
+ summary?: string;
376
+ message?: string;
377
+ found?: unknown;
378
+ property?: string;
379
+ expected?: string;
380
+ };
381
+ };
382
+ };
383
+ };
384
+ };
385
+ };
386
+ };
387
+ }, {
388
+ derive: {};
389
+ resolve: {};
390
+ schema: {};
391
+ standaloneSchema: {};
392
+ response: {};
393
+ }, {
394
+ derive: {};
395
+ resolve: {};
396
+ schema: {};
397
+ standaloneSchema: {};
398
+ response: {};
399
+ }>;
400
+ //# sourceMappingURL=model-generations.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"model-generations.d.ts","sourceRoot":"","sources":["../../src/routes/model-generations.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAA2C,YAAY,EAAE,MAAM,YAAY,CAAA;AAUvF,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,QAAQ,CAAA;AAiHpC;;;;GAIG;AACH,wBAAgB,6BAA6B,CAAC,GAAG,EAAE,MAAM,EAAE,IAAI,EAAE,YAAY;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAoH5E"}