@cogitator-ai/tetsu 0.1.0

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.
@@ -0,0 +1,804 @@
1
+ import type { Message } from '@cogitator-ai/types';
2
+ import type { z } from 'zod';
3
+ import type { CogitatorDeps } from './types.js';
4
+ /**
5
+ * The Cogitator HTTP API as a Tetsu controller.
6
+ *
7
+ * Mount it like any controller, usually under a group:
8
+ *
9
+ * @example
10
+ * ```ts
11
+ * const app = createApp({
12
+ * routes: [
13
+ * group('/cogitator', { children: [cogitatorController({ cogitator, agents: { chat } })] }),
14
+ * docs({ info: { title: 'Agents', version: '1.0.0' } }),
15
+ * ],
16
+ * });
17
+ *
18
+ * Bun.serve({ ...app, port: 3000 });
19
+ * ```
20
+ */
21
+ export declare const cogitatorController: (deps: CogitatorDeps) => {
22
+ socket?: import("@tetsujs/core").WsDef<`/${string}`, {
23
+ readonly message: z.ZodDiscriminatedUnion<[z.ZodObject<{
24
+ type: z.ZodLiteral<"ping">;
25
+ id: z.ZodOptional<z.ZodString>;
26
+ }, z.core.$strip>, z.ZodObject<{
27
+ type: z.ZodLiteral<"stop">;
28
+ id: z.ZodOptional<z.ZodString>;
29
+ }, z.core.$strip>, z.ZodObject<{
30
+ type: z.ZodLiteral<"run">;
31
+ id: z.ZodOptional<z.ZodString>;
32
+ payload: z.ZodObject<{
33
+ type: z.ZodEnum<{
34
+ agent: "agent";
35
+ workflow: "workflow";
36
+ swarm: "swarm";
37
+ }>;
38
+ name: z.ZodString;
39
+ input: z.ZodString;
40
+ context: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
41
+ threadId: z.ZodOptional<z.ZodString>;
42
+ }, z.core.$strip>;
43
+ }, z.core.$strip>], "type">;
44
+ }, {
45
+ readonly beforeParse: readonly [import("@tetsujs/core").Hook<"beforeParse", import("@tetsujs/core").BaseCtx & {
46
+ readonly params: {
47
+ [x: string]: string;
48
+ };
49
+ }, Pick<import("./auth.js").CallerFields, "cogitatorAuth">>];
50
+ }> | undefined;
51
+ health: import("@tetsujs/core").RouteDef<"/health", {
52
+ readonly response: z.ZodObject<{
53
+ status: z.ZodLiteral<"ok">;
54
+ uptime: z.ZodNumber;
55
+ timestamp: z.ZodNumber;
56
+ }, z.core.$strip>;
57
+ }, {
58
+ readonly onError: readonly [import("@tetsujs/core").Hook<"onError", import("@tetsujs/core").BaseCtx & {
59
+ readonly error: unknown;
60
+ }, unknown>];
61
+ }, undefined, "GET", {
62
+ status: "ok";
63
+ uptime: number;
64
+ timestamp: number;
65
+ }, false>;
66
+ ready: import("@tetsujs/core").RouteDef<"/ready", {
67
+ readonly response: z.ZodObject<{
68
+ status: z.ZodLiteral<"ok">;
69
+ }, z.core.$strip>;
70
+ }, {
71
+ readonly onError: readonly [import("@tetsujs/core").Hook<"onError", import("@tetsujs/core").BaseCtx & {
72
+ readonly error: unknown;
73
+ }, unknown>];
74
+ }, undefined, "GET", {
75
+ status: "ok";
76
+ }, false>;
77
+ listAgents: import("@tetsujs/core").RouteDef<"/agents", {
78
+ readonly response: z.ZodObject<{
79
+ agents: z.ZodArray<z.ZodObject<{
80
+ name: z.ZodString;
81
+ description: z.ZodOptional<z.ZodString>;
82
+ tools: z.ZodArray<z.ZodString>;
83
+ }, z.core.$strip>>;
84
+ }, z.core.$strip>;
85
+ }, {
86
+ readonly beforeParse: readonly [import("@tetsujs/core").Hook<"beforeParse", import("@tetsujs/core").BaseCtx & {
87
+ readonly params: {
88
+ [x: string]: string;
89
+ };
90
+ }, Pick<import("./auth.js").CallerFields, "cogitatorAuth">>];
91
+ readonly onError: readonly [import("@tetsujs/core").Hook<"onError", import("@tetsujs/core").BaseCtx & {
92
+ readonly error: unknown;
93
+ }, unknown>];
94
+ }, undefined, "GET", {
95
+ agents: {
96
+ name: string;
97
+ tools: string[];
98
+ description?: string | undefined;
99
+ }[];
100
+ }, false>;
101
+ runAgent: import("@tetsujs/core").RouteDef<"/agents/:name/run", {
102
+ readonly params: z.ZodObject<{
103
+ name: z.ZodString;
104
+ }, z.core.$strip>;
105
+ readonly body: z.ZodObject<{
106
+ input: z.ZodString;
107
+ context: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
108
+ threadId: z.ZodOptional<z.ZodString>;
109
+ }, z.core.$strip>;
110
+ readonly response: {
111
+ readonly 200: z.ZodObject<{
112
+ output: z.ZodString;
113
+ structured: z.ZodOptional<z.ZodUnknown>;
114
+ threadId: z.ZodString;
115
+ usage: z.ZodObject<{
116
+ inputTokens: z.ZodNumber;
117
+ outputTokens: z.ZodNumber;
118
+ totalTokens: z.ZodNumber;
119
+ }, z.core.$strip>;
120
+ toolCalls: z.ZodArray<z.ZodObject<{
121
+ id: z.ZodString;
122
+ name: z.ZodString;
123
+ arguments: z.ZodRecord<z.ZodString, z.ZodUnknown>;
124
+ }, z.core.$strip>>;
125
+ }, z.core.$strip>;
126
+ readonly 403: z.ZodObject<{
127
+ status: z.ZodNumber;
128
+ message: z.ZodString;
129
+ error: z.ZodLiteral<"THREAD_FORBIDDEN">;
130
+ }, z.core.$strip>;
131
+ readonly 404: z.ZodObject<{
132
+ status: z.ZodNumber;
133
+ message: z.ZodString;
134
+ error: z.ZodEnum<{
135
+ [x: string]: string;
136
+ }>;
137
+ }, z.core.$strip>;
138
+ readonly 400: z.ZodObject<{
139
+ status: z.ZodNumber;
140
+ message: z.ZodString;
141
+ error: z.ZodEnum<{
142
+ [x: string]: string;
143
+ }>;
144
+ }, z.core.$strip>;
145
+ readonly 409: z.ZodObject<{
146
+ status: z.ZodNumber;
147
+ message: z.ZodString;
148
+ error: z.ZodEnum<{
149
+ [x: string]: string;
150
+ }>;
151
+ }, z.core.$strip>;
152
+ readonly 429: z.ZodObject<{
153
+ status: z.ZodNumber;
154
+ message: z.ZodString;
155
+ error: z.ZodEnum<{
156
+ [x: string]: string;
157
+ }>;
158
+ }, z.core.$strip>;
159
+ readonly 500: z.ZodObject<{
160
+ status: z.ZodNumber;
161
+ message: z.ZodString;
162
+ error: z.ZodEnum<{
163
+ [x: string]: string;
164
+ }>;
165
+ }, z.core.$strip>;
166
+ readonly 502: z.ZodObject<{
167
+ status: z.ZodNumber;
168
+ message: z.ZodString;
169
+ error: z.ZodEnum<{
170
+ [x: string]: string;
171
+ }>;
172
+ }, z.core.$strip>;
173
+ readonly 503: z.ZodObject<{
174
+ status: z.ZodNumber;
175
+ message: z.ZodString;
176
+ error: z.ZodEnum<{
177
+ [x: string]: string;
178
+ }>;
179
+ }, z.core.$strip>;
180
+ readonly 504: z.ZodObject<{
181
+ status: z.ZodNumber;
182
+ message: z.ZodString;
183
+ error: z.ZodEnum<{
184
+ [x: string]: string;
185
+ }>;
186
+ }, z.core.$strip>;
187
+ readonly 507: z.ZodObject<{
188
+ status: z.ZodNumber;
189
+ message: z.ZodString;
190
+ error: z.ZodEnum<{
191
+ [x: string]: string;
192
+ }>;
193
+ }, z.core.$strip>;
194
+ };
195
+ }, {
196
+ readonly beforeParse: readonly [import("@tetsujs/core").Hook<"beforeParse", import("@tetsujs/core").BaseCtx & {
197
+ readonly params: {
198
+ [x: string]: string;
199
+ };
200
+ }, Pick<import("./auth.js").CallerFields, "cogitatorAuth">>];
201
+ readonly onError: readonly [import("@tetsujs/core").Hook<"onError", import("@tetsujs/core").BaseCtx & {
202
+ readonly error: unknown;
203
+ }, unknown>];
204
+ }, undefined, "POST", Promise<{
205
+ output: string;
206
+ threadId: string;
207
+ usage: {
208
+ inputTokens: number;
209
+ outputTokens: number;
210
+ totalTokens: number;
211
+ };
212
+ toolCalls: {
213
+ id: string;
214
+ name: string;
215
+ arguments: Record<string, unknown>;
216
+ }[];
217
+ structured?: unknown;
218
+ }>, false>;
219
+ streamAgent: import("@tetsujs/core").RouteDef<"/agents/:name/stream", {
220
+ readonly params: z.ZodObject<{
221
+ name: z.ZodString;
222
+ }, z.core.$strip>;
223
+ readonly body: z.ZodObject<{
224
+ input: z.ZodString;
225
+ context: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
226
+ threadId: z.ZodOptional<z.ZodString>;
227
+ }, z.core.$strip>;
228
+ readonly response: {
229
+ readonly 403: z.ZodObject<{
230
+ status: z.ZodNumber;
231
+ message: z.ZodString;
232
+ error: z.ZodLiteral<"THREAD_FORBIDDEN">;
233
+ }, z.core.$strip>;
234
+ readonly 404: z.ZodObject<{
235
+ status: z.ZodNumber;
236
+ message: z.ZodString;
237
+ error: z.ZodLiteral<"AGENT_NOT_FOUND">;
238
+ }, z.core.$strip>;
239
+ };
240
+ }, {
241
+ readonly beforeParse: readonly [import("@tetsujs/core").Hook<"beforeParse", import("@tetsujs/core").BaseCtx & {
242
+ readonly params: {
243
+ [x: string]: string;
244
+ };
245
+ }, Pick<import("./auth.js").CallerFields, "cogitatorAuth">>];
246
+ readonly onError: readonly [import("@tetsujs/core").Hook<"onError", import("@tetsujs/core").BaseCtx & {
247
+ readonly error: unknown;
248
+ }, unknown>];
249
+ }, undefined, "POST", Promise<Response>, false>;
250
+ getThread: import("@tetsujs/core").RouteDef<"/threads/:id", {
251
+ readonly params: z.ZodObject<{
252
+ id: z.ZodString;
253
+ }, z.core.$strip>;
254
+ readonly response: {
255
+ readonly 200: z.ZodObject<{
256
+ id: z.ZodString;
257
+ messages: z.ZodArray<z.ZodObject<{
258
+ role: z.ZodEnum<{
259
+ user: "user";
260
+ assistant: "assistant";
261
+ system: "system";
262
+ tool: "tool";
263
+ }>;
264
+ content: z.ZodUnion<readonly [z.ZodString, z.ZodArray<z.ZodUnion<readonly [z.ZodObject<{
265
+ type: z.ZodLiteral<"text">;
266
+ text: z.ZodString;
267
+ }, z.core.$strip>, z.ZodObject<{
268
+ type: z.ZodLiteral<"image_url">;
269
+ image_url: z.ZodObject<{
270
+ url: z.ZodString;
271
+ detail: z.ZodOptional<z.ZodEnum<{
272
+ auto: "auto";
273
+ low: "low";
274
+ high: "high";
275
+ }>>;
276
+ }, z.core.$strip>;
277
+ }, z.core.$strip>, z.ZodObject<{
278
+ type: z.ZodLiteral<"image_base64">;
279
+ image_base64: z.ZodObject<{
280
+ data: z.ZodString;
281
+ media_type: z.ZodString;
282
+ }, z.core.$strip>;
283
+ }, z.core.$strip>]>>]>;
284
+ name: z.ZodOptional<z.ZodString>;
285
+ toolCallId: z.ZodOptional<z.ZodString>;
286
+ toolCalls: z.ZodOptional<z.ZodArray<z.ZodObject<{
287
+ id: z.ZodString;
288
+ name: z.ZodString;
289
+ arguments: z.ZodRecord<z.ZodString, z.ZodUnknown>;
290
+ }, z.core.$strip>>>;
291
+ }, z.core.$strip>>;
292
+ createdAt: z.ZodNumber;
293
+ updatedAt: z.ZodNumber;
294
+ }, z.core.$strip>;
295
+ readonly 403: z.ZodObject<{
296
+ status: z.ZodNumber;
297
+ message: z.ZodString;
298
+ error: z.ZodLiteral<"THREAD_FORBIDDEN">;
299
+ }, z.core.$strip>;
300
+ readonly 503: z.ZodObject<{
301
+ status: z.ZodNumber;
302
+ message: z.ZodString;
303
+ error: z.ZodLiteral<"MEMORY_NOT_CONFIGURED">;
304
+ }, z.core.$strip>;
305
+ };
306
+ }, {
307
+ readonly beforeParse: readonly [import("@tetsujs/core").Hook<"beforeParse", import("@tetsujs/core").BaseCtx & {
308
+ readonly params: {
309
+ [x: string]: string;
310
+ };
311
+ }, Pick<import("./auth.js").CallerFields, "cogitatorAuth">>];
312
+ readonly onError: readonly [import("@tetsujs/core").Hook<"onError", import("@tetsujs/core").BaseCtx & {
313
+ readonly error: unknown;
314
+ }, unknown>];
315
+ }, undefined, "GET", Promise<{
316
+ id: string;
317
+ messages: Message[];
318
+ createdAt: number;
319
+ updatedAt: number;
320
+ }>, false>;
321
+ addThreadMessage: import("@tetsujs/core").RouteDef<"/threads/:id/messages", {
322
+ readonly params: z.ZodObject<{
323
+ id: z.ZodString;
324
+ }, z.core.$strip>;
325
+ readonly body: z.ZodObject<{
326
+ role: z.ZodEnum<{
327
+ user: "user";
328
+ assistant: "assistant";
329
+ system: "system";
330
+ }>;
331
+ content: z.ZodString;
332
+ metadata: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
333
+ }, z.core.$strip>;
334
+ readonly response: {
335
+ readonly 201: z.ZodObject<{
336
+ success: z.ZodLiteral<true>;
337
+ }, z.core.$strip>;
338
+ readonly 403: z.ZodObject<{
339
+ status: z.ZodNumber;
340
+ message: z.ZodString;
341
+ error: z.ZodLiteral<"THREAD_FORBIDDEN">;
342
+ }, z.core.$strip>;
343
+ readonly 503: z.ZodObject<{
344
+ status: z.ZodNumber;
345
+ message: z.ZodString;
346
+ error: z.ZodLiteral<"MEMORY_NOT_CONFIGURED">;
347
+ }, z.core.$strip>;
348
+ };
349
+ }, {
350
+ readonly beforeParse: readonly [import("@tetsujs/core").Hook<"beforeParse", import("@tetsujs/core").BaseCtx & {
351
+ readonly params: {
352
+ [x: string]: string;
353
+ };
354
+ }, Pick<import("./auth.js").CallerFields, "cogitatorAuth">>];
355
+ readonly onError: readonly [import("@tetsujs/core").Hook<"onError", import("@tetsujs/core").BaseCtx & {
356
+ readonly error: unknown;
357
+ }, unknown>];
358
+ }, undefined, "POST", Promise<{
359
+ success: true;
360
+ }>, false>;
361
+ deleteThread: import("@tetsujs/core").RouteDef<"/threads/:id", {
362
+ readonly params: z.ZodObject<{
363
+ id: z.ZodString;
364
+ }, z.core.$strip>;
365
+ readonly response: {
366
+ readonly 204: null;
367
+ readonly 403: z.ZodObject<{
368
+ status: z.ZodNumber;
369
+ message: z.ZodString;
370
+ error: z.ZodLiteral<"THREAD_FORBIDDEN">;
371
+ }, z.core.$strip>;
372
+ readonly 503: z.ZodObject<{
373
+ status: z.ZodNumber;
374
+ message: z.ZodString;
375
+ error: z.ZodLiteral<"MEMORY_NOT_CONFIGURED">;
376
+ }, z.core.$strip>;
377
+ };
378
+ }, {
379
+ readonly beforeParse: readonly [import("@tetsujs/core").Hook<"beforeParse", import("@tetsujs/core").BaseCtx & {
380
+ readonly params: {
381
+ [x: string]: string;
382
+ };
383
+ }, Pick<import("./auth.js").CallerFields, "cogitatorAuth">>];
384
+ readonly onError: readonly [import("@tetsujs/core").Hook<"onError", import("@tetsujs/core").BaseCtx & {
385
+ readonly error: unknown;
386
+ }, unknown>];
387
+ }, undefined, "DELETE", Promise<void>, false>;
388
+ listTools: import("@tetsujs/core").RouteDef<"/tools", {
389
+ readonly response: z.ZodObject<{
390
+ tools: z.ZodArray<z.ZodObject<{
391
+ name: z.ZodString;
392
+ description: z.ZodOptional<z.ZodString>;
393
+ parameters: z.ZodRecord<z.ZodString, z.ZodUnknown>;
394
+ }, z.core.$strip>>;
395
+ }, z.core.$strip>;
396
+ }, {
397
+ readonly beforeParse: readonly [import("@tetsujs/core").Hook<"beforeParse", import("@tetsujs/core").BaseCtx & {
398
+ readonly params: {
399
+ [x: string]: string;
400
+ };
401
+ }, Pick<import("./auth.js").CallerFields, "cogitatorAuth">>];
402
+ readonly onError: readonly [import("@tetsujs/core").Hook<"onError", import("@tetsujs/core").BaseCtx & {
403
+ readonly error: unknown;
404
+ }, unknown>];
405
+ }, undefined, "GET", {
406
+ tools: {
407
+ name: string;
408
+ parameters: Record<string, unknown>;
409
+ description?: string | undefined;
410
+ }[];
411
+ }, false>;
412
+ listWorkflows: import("@tetsujs/core").RouteDef<"/workflows", {
413
+ readonly response: z.ZodObject<{
414
+ workflows: z.ZodArray<z.ZodObject<{
415
+ name: z.ZodString;
416
+ entryPoint: z.ZodString;
417
+ nodes: z.ZodArray<z.ZodString>;
418
+ }, z.core.$strip>>;
419
+ }, z.core.$strip>;
420
+ }, {
421
+ readonly beforeParse: readonly [import("@tetsujs/core").Hook<"beforeParse", import("@tetsujs/core").BaseCtx & {
422
+ readonly params: {
423
+ [x: string]: string;
424
+ };
425
+ }, Pick<import("./auth.js").CallerFields, "cogitatorAuth">>];
426
+ readonly onError: readonly [import("@tetsujs/core").Hook<"onError", import("@tetsujs/core").BaseCtx & {
427
+ readonly error: unknown;
428
+ }, unknown>];
429
+ }, undefined, "GET", {
430
+ workflows: {
431
+ name: string;
432
+ entryPoint: string;
433
+ nodes: string[];
434
+ }[];
435
+ }, false>;
436
+ runWorkflow: import("@tetsujs/core").RouteDef<"/workflows/:name/run", {
437
+ readonly params: z.ZodObject<{
438
+ name: z.ZodString;
439
+ }, z.core.$strip>;
440
+ readonly body: z.ZodObject<{
441
+ input: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
442
+ options: z.ZodOptional<z.ZodObject<{
443
+ maxConcurrency: z.ZodOptional<z.ZodNumber>;
444
+ maxIterations: z.ZodOptional<z.ZodNumber>;
445
+ checkpoint: z.ZodOptional<z.ZodBoolean>;
446
+ }, z.core.$strip>>;
447
+ }, z.core.$strip>;
448
+ readonly response: {
449
+ readonly 200: z.ZodObject<{
450
+ workflowId: z.ZodString;
451
+ workflowName: z.ZodString;
452
+ state: z.ZodRecord<z.ZodString, z.ZodUnknown>;
453
+ duration: z.ZodNumber;
454
+ nodeResults: z.ZodRecord<z.ZodString, z.ZodObject<{
455
+ output: z.ZodUnknown;
456
+ duration: z.ZodNumber;
457
+ }, z.core.$strip>>;
458
+ }, z.core.$strip>;
459
+ readonly 404: z.ZodObject<{
460
+ status: z.ZodNumber;
461
+ message: z.ZodString;
462
+ error: z.ZodEnum<{
463
+ [x: string]: string;
464
+ }>;
465
+ }, z.core.$strip>;
466
+ readonly 501: z.ZodObject<{
467
+ status: z.ZodNumber;
468
+ message: z.ZodString;
469
+ error: z.ZodEnum<{
470
+ [x: string]: string;
471
+ }>;
472
+ }, z.core.$strip>;
473
+ readonly 400: z.ZodObject<{
474
+ status: z.ZodNumber;
475
+ message: z.ZodString;
476
+ error: z.ZodEnum<{
477
+ [x: string]: string;
478
+ }>;
479
+ }, z.core.$strip>;
480
+ readonly 409: z.ZodObject<{
481
+ status: z.ZodNumber;
482
+ message: z.ZodString;
483
+ error: z.ZodEnum<{
484
+ [x: string]: string;
485
+ }>;
486
+ }, z.core.$strip>;
487
+ readonly 429: z.ZodObject<{
488
+ status: z.ZodNumber;
489
+ message: z.ZodString;
490
+ error: z.ZodEnum<{
491
+ [x: string]: string;
492
+ }>;
493
+ }, z.core.$strip>;
494
+ readonly 500: z.ZodObject<{
495
+ status: z.ZodNumber;
496
+ message: z.ZodString;
497
+ error: z.ZodEnum<{
498
+ [x: string]: string;
499
+ }>;
500
+ }, z.core.$strip>;
501
+ readonly 502: z.ZodObject<{
502
+ status: z.ZodNumber;
503
+ message: z.ZodString;
504
+ error: z.ZodEnum<{
505
+ [x: string]: string;
506
+ }>;
507
+ }, z.core.$strip>;
508
+ readonly 503: z.ZodObject<{
509
+ status: z.ZodNumber;
510
+ message: z.ZodString;
511
+ error: z.ZodEnum<{
512
+ [x: string]: string;
513
+ }>;
514
+ }, z.core.$strip>;
515
+ readonly 504: z.ZodObject<{
516
+ status: z.ZodNumber;
517
+ message: z.ZodString;
518
+ error: z.ZodEnum<{
519
+ [x: string]: string;
520
+ }>;
521
+ }, z.core.$strip>;
522
+ readonly 507: z.ZodObject<{
523
+ status: z.ZodNumber;
524
+ message: z.ZodString;
525
+ error: z.ZodEnum<{
526
+ [x: string]: string;
527
+ }>;
528
+ }, z.core.$strip>;
529
+ };
530
+ }, {
531
+ readonly beforeParse: readonly [import("@tetsujs/core").Hook<"beforeParse", import("@tetsujs/core").BaseCtx & {
532
+ readonly params: {
533
+ [x: string]: string;
534
+ };
535
+ }, Pick<import("./auth.js").CallerFields, "cogitatorAuth">>];
536
+ readonly onError: readonly [import("@tetsujs/core").Hook<"onError", import("@tetsujs/core").BaseCtx & {
537
+ readonly error: unknown;
538
+ }, unknown>];
539
+ }, undefined, "POST", Promise<{
540
+ workflowId: string;
541
+ workflowName: string;
542
+ state: Record<string, unknown>;
543
+ duration: number;
544
+ nodeResults: Record<string, {
545
+ output: unknown;
546
+ duration: number;
547
+ }>;
548
+ }>, false>;
549
+ streamWorkflow: import("@tetsujs/core").RouteDef<"/workflows/:name/stream", {
550
+ readonly params: z.ZodObject<{
551
+ name: z.ZodString;
552
+ }, z.core.$strip>;
553
+ readonly body: z.ZodObject<{
554
+ input: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
555
+ options: z.ZodOptional<z.ZodObject<{
556
+ maxConcurrency: z.ZodOptional<z.ZodNumber>;
557
+ maxIterations: z.ZodOptional<z.ZodNumber>;
558
+ checkpoint: z.ZodOptional<z.ZodBoolean>;
559
+ }, z.core.$strip>>;
560
+ }, z.core.$strip>;
561
+ readonly response: {
562
+ readonly 404: z.ZodObject<{
563
+ status: z.ZodNumber;
564
+ message: z.ZodString;
565
+ error: z.ZodLiteral<"WORKFLOW_NOT_FOUND">;
566
+ }, z.core.$strip>;
567
+ };
568
+ }, {
569
+ readonly beforeParse: readonly [import("@tetsujs/core").Hook<"beforeParse", import("@tetsujs/core").BaseCtx & {
570
+ readonly params: {
571
+ [x: string]: string;
572
+ };
573
+ }, Pick<import("./auth.js").CallerFields, "cogitatorAuth">>];
574
+ readonly onError: readonly [import("@tetsujs/core").Hook<"onError", import("@tetsujs/core").BaseCtx & {
575
+ readonly error: unknown;
576
+ }, unknown>];
577
+ }, undefined, "POST", Response, false>;
578
+ listSwarms: import("@tetsujs/core").RouteDef<"/swarms", {
579
+ readonly response: z.ZodObject<{
580
+ swarms: z.ZodArray<z.ZodObject<{
581
+ name: z.ZodString;
582
+ strategy: z.ZodString;
583
+ agents: z.ZodArray<z.ZodString>;
584
+ }, z.core.$strip>>;
585
+ }, z.core.$strip>;
586
+ }, {
587
+ readonly beforeParse: readonly [import("@tetsujs/core").Hook<"beforeParse", import("@tetsujs/core").BaseCtx & {
588
+ readonly params: {
589
+ [x: string]: string;
590
+ };
591
+ }, Pick<import("./auth.js").CallerFields, "cogitatorAuth">>];
592
+ readonly onError: readonly [import("@tetsujs/core").Hook<"onError", import("@tetsujs/core").BaseCtx & {
593
+ readonly error: unknown;
594
+ }, unknown>];
595
+ }, undefined, "GET", {
596
+ swarms: {
597
+ name: string;
598
+ strategy: string;
599
+ agents: string[];
600
+ }[];
601
+ }, false>;
602
+ runSwarm: import("@tetsujs/core").RouteDef<"/swarms/:name/run", {
603
+ readonly params: z.ZodObject<{
604
+ name: z.ZodString;
605
+ }, z.core.$strip>;
606
+ readonly body: z.ZodObject<{
607
+ input: z.ZodString;
608
+ context: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
609
+ threadId: z.ZodOptional<z.ZodString>;
610
+ timeout: z.ZodOptional<z.ZodNumber>;
611
+ }, z.core.$strip>;
612
+ readonly response: {
613
+ readonly 200: z.ZodObject<{
614
+ swarmId: z.ZodString;
615
+ swarmName: z.ZodString;
616
+ strategy: z.ZodString;
617
+ output: z.ZodUnknown;
618
+ agentResults: z.ZodRecord<z.ZodString, z.ZodObject<{
619
+ output: z.ZodString;
620
+ usage: z.ZodObject<{
621
+ inputTokens: z.ZodNumber;
622
+ outputTokens: z.ZodNumber;
623
+ totalTokens: z.ZodNumber;
624
+ cost: z.ZodNumber;
625
+ duration: z.ZodNumber;
626
+ }, z.core.$strip>;
627
+ }, z.core.$strip>>;
628
+ usage: z.ZodObject<{
629
+ totalTokens: z.ZodNumber;
630
+ totalCost: z.ZodNumber;
631
+ elapsedTime: z.ZodNumber;
632
+ }, z.core.$strip>;
633
+ }, z.core.$strip>;
634
+ readonly 403: z.ZodObject<{
635
+ status: z.ZodNumber;
636
+ message: z.ZodString;
637
+ error: z.ZodLiteral<"THREAD_FORBIDDEN">;
638
+ }, z.core.$strip>;
639
+ readonly 404: z.ZodObject<{
640
+ status: z.ZodNumber;
641
+ message: z.ZodString;
642
+ error: z.ZodEnum<{
643
+ [x: string]: string;
644
+ }>;
645
+ }, z.core.$strip>;
646
+ readonly 501: z.ZodObject<{
647
+ status: z.ZodNumber;
648
+ message: z.ZodString;
649
+ error: z.ZodEnum<{
650
+ [x: string]: string;
651
+ }>;
652
+ }, z.core.$strip>;
653
+ readonly 400: z.ZodObject<{
654
+ status: z.ZodNumber;
655
+ message: z.ZodString;
656
+ error: z.ZodEnum<{
657
+ [x: string]: string;
658
+ }>;
659
+ }, z.core.$strip>;
660
+ readonly 409: z.ZodObject<{
661
+ status: z.ZodNumber;
662
+ message: z.ZodString;
663
+ error: z.ZodEnum<{
664
+ [x: string]: string;
665
+ }>;
666
+ }, z.core.$strip>;
667
+ readonly 429: z.ZodObject<{
668
+ status: z.ZodNumber;
669
+ message: z.ZodString;
670
+ error: z.ZodEnum<{
671
+ [x: string]: string;
672
+ }>;
673
+ }, z.core.$strip>;
674
+ readonly 500: z.ZodObject<{
675
+ status: z.ZodNumber;
676
+ message: z.ZodString;
677
+ error: z.ZodEnum<{
678
+ [x: string]: string;
679
+ }>;
680
+ }, z.core.$strip>;
681
+ readonly 502: z.ZodObject<{
682
+ status: z.ZodNumber;
683
+ message: z.ZodString;
684
+ error: z.ZodEnum<{
685
+ [x: string]: string;
686
+ }>;
687
+ }, z.core.$strip>;
688
+ readonly 503: z.ZodObject<{
689
+ status: z.ZodNumber;
690
+ message: z.ZodString;
691
+ error: z.ZodEnum<{
692
+ [x: string]: string;
693
+ }>;
694
+ }, z.core.$strip>;
695
+ readonly 504: z.ZodObject<{
696
+ status: z.ZodNumber;
697
+ message: z.ZodString;
698
+ error: z.ZodEnum<{
699
+ [x: string]: string;
700
+ }>;
701
+ }, z.core.$strip>;
702
+ readonly 507: z.ZodObject<{
703
+ status: z.ZodNumber;
704
+ message: z.ZodString;
705
+ error: z.ZodEnum<{
706
+ [x: string]: string;
707
+ }>;
708
+ }, z.core.$strip>;
709
+ };
710
+ }, {
711
+ readonly beforeParse: readonly [import("@tetsujs/core").Hook<"beforeParse", import("@tetsujs/core").BaseCtx & {
712
+ readonly params: {
713
+ [x: string]: string;
714
+ };
715
+ }, Pick<import("./auth.js").CallerFields, "cogitatorAuth">>];
716
+ readonly onError: readonly [import("@tetsujs/core").Hook<"onError", import("@tetsujs/core").BaseCtx & {
717
+ readonly error: unknown;
718
+ }, unknown>];
719
+ }, undefined, "POST", Promise<{
720
+ swarmId: string;
721
+ swarmName: string;
722
+ strategy: string;
723
+ output: unknown;
724
+ agentResults: Record<string, {
725
+ output: string;
726
+ usage: {
727
+ inputTokens: number;
728
+ outputTokens: number;
729
+ totalTokens: number;
730
+ cost: number;
731
+ duration: number;
732
+ };
733
+ }>;
734
+ usage: {
735
+ totalTokens: number;
736
+ totalCost: number;
737
+ elapsedTime: number;
738
+ };
739
+ }>, false>;
740
+ streamSwarm: import("@tetsujs/core").RouteDef<"/swarms/:name/stream", {
741
+ readonly params: z.ZodObject<{
742
+ name: z.ZodString;
743
+ }, z.core.$strip>;
744
+ readonly body: z.ZodObject<{
745
+ input: z.ZodString;
746
+ context: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
747
+ threadId: z.ZodOptional<z.ZodString>;
748
+ timeout: z.ZodOptional<z.ZodNumber>;
749
+ }, z.core.$strip>;
750
+ readonly response: {
751
+ readonly 403: z.ZodObject<{
752
+ status: z.ZodNumber;
753
+ message: z.ZodString;
754
+ error: z.ZodLiteral<"THREAD_FORBIDDEN">;
755
+ }, z.core.$strip>;
756
+ readonly 404: z.ZodObject<{
757
+ status: z.ZodNumber;
758
+ message: z.ZodString;
759
+ error: z.ZodLiteral<"SWARM_NOT_FOUND">;
760
+ }, z.core.$strip>;
761
+ };
762
+ }, {
763
+ readonly beforeParse: readonly [import("@tetsujs/core").Hook<"beforeParse", import("@tetsujs/core").BaseCtx & {
764
+ readonly params: {
765
+ [x: string]: string;
766
+ };
767
+ }, Pick<import("./auth.js").CallerFields, "cogitatorAuth">>];
768
+ readonly onError: readonly [import("@tetsujs/core").Hook<"onError", import("@tetsujs/core").BaseCtx & {
769
+ readonly error: unknown;
770
+ }, unknown>];
771
+ }, undefined, "POST", Promise<Response>, false>;
772
+ getBlackboard: import("@tetsujs/core").RouteDef<"/swarms/:name/blackboard", {
773
+ readonly params: z.ZodObject<{
774
+ name: z.ZodString;
775
+ }, z.core.$strip>;
776
+ readonly response: {
777
+ readonly 200: z.ZodObject<{
778
+ sections: z.ZodRecord<z.ZodString, z.ZodUnknown>;
779
+ }, z.core.$strip>;
780
+ readonly 404: z.ZodObject<{
781
+ status: z.ZodNumber;
782
+ message: z.ZodString;
783
+ error: z.ZodLiteral<"SWARM_NOT_FOUND">;
784
+ }, z.core.$strip>;
785
+ readonly 409: z.ZodObject<{
786
+ status: z.ZodNumber;
787
+ message: z.ZodString;
788
+ error: z.ZodLiteral<"BLACKBOARD_DISABLED">;
789
+ }, z.core.$strip>;
790
+ };
791
+ }, {
792
+ readonly beforeParse: readonly [import("@tetsujs/core").Hook<"beforeParse", import("@tetsujs/core").BaseCtx & {
793
+ readonly params: {
794
+ [x: string]: string;
795
+ };
796
+ }, Pick<import("./auth.js").CallerFields, "cogitatorAuth">>];
797
+ readonly onError: readonly [import("@tetsujs/core").Hook<"onError", import("@tetsujs/core").BaseCtx & {
798
+ readonly error: unknown;
799
+ }, unknown>];
800
+ }, undefined, "GET", {
801
+ sections: Record<string, unknown>;
802
+ }, false>;
803
+ };
804
+ //# sourceMappingURL=controller.d.ts.map