@loopbacktools/server 0.0.0-stage → 0.4.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (54) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +26 -2
  3. package/dist/package.json +57 -0
  4. package/dist/src/domain/ask.d.ts +78 -0
  5. package/dist/src/domain/ask.js +161 -0
  6. package/dist/src/domain/errors.d.ts +70 -0
  7. package/dist/src/domain/errors.js +57 -0
  8. package/dist/src/generated/app.gen.d.ts +2311 -0
  9. package/dist/src/generated/app.gen.js +400 -0
  10. package/dist/src/generated/runtime.gen.d.ts +357 -0
  11. package/dist/src/generated/runtime.gen.js +298 -0
  12. package/dist/src/generated/schemas.gen.d.ts +6416 -0
  13. package/dist/src/generated/schemas.gen.js +306 -0
  14. package/dist/src/generated/wire-contract.gen.d.ts +77 -0
  15. package/dist/src/generated/wire-contract.gen.js +3 -0
  16. package/dist/src/index.d.ts +11 -0
  17. package/dist/src/index.js +8 -0
  18. package/dist/src/loopback.d.ts +27 -0
  19. package/dist/src/loopback.js +16 -0
  20. package/dist/src/space/arguments.d.ts +8 -0
  21. package/dist/src/space/arguments.js +52 -0
  22. package/dist/src/space/migrations.d.ts +10 -0
  23. package/dist/src/space/migrations.js +106 -0
  24. package/dist/src/space/object.d.ts +30 -0
  25. package/dist/src/space/object.js +169 -0
  26. package/dist/src/space/operations.d.ts +149 -0
  27. package/dist/src/space/operations.js +568 -0
  28. package/dist/src/space/read.d.ts +8 -0
  29. package/dist/src/space/read.js +33 -0
  30. package/dist/src/space/rpc.d.ts +61 -0
  31. package/dist/src/space/rpc.js +96 -0
  32. package/dist/src/space/services.d.ts +41 -0
  33. package/dist/src/space/services.js +58 -0
  34. package/dist/src/space/store.d.ts +87 -0
  35. package/dist/src/space/store.js +276 -0
  36. package/dist/src/version.d.ts +2 -0
  37. package/dist/src/version.js +3 -0
  38. package/dist/src/worker/env.d.ts +19 -0
  39. package/dist/src/worker/env.js +3 -0
  40. package/dist/src/worker/files.d.ts +21 -0
  41. package/dist/src/worker/files.js +42 -0
  42. package/dist/src/worker/gate.d.ts +55 -0
  43. package/dist/src/worker/gate.js +83 -0
  44. package/dist/src/worker/http.d.ts +2092 -0
  45. package/dist/src/worker/http.js +291 -0
  46. package/dist/src/worker/jwt.d.ts +49 -0
  47. package/dist/src/worker/jwt.js +142 -0
  48. package/dist/src/worker/mcp.d.ts +15 -0
  49. package/dist/src/worker/mcp.js +401 -0
  50. package/dist/src/worker/run.d.ts +45 -0
  51. package/dist/src/worker/run.js +71 -0
  52. package/dist/src/worker/spaces.d.ts +24 -0
  53. package/dist/src/worker/spaces.js +64 -0
  54. package/package.json +51 -3
@@ -0,0 +1,2092 @@
1
+ import type { AppEnv } from "../generated/runtime.gen.ts";
2
+ import type { WorkerBindings } from "./env.ts";
3
+ import { type Access } from "./gate.ts";
4
+ import { type WorkerRuntime } from "./run.ts";
5
+ import { type InboxLink } from "./mcp.ts";
6
+ declare module "../generated/runtime.gen.ts" {
7
+ interface AppEnv {
8
+ readonly Bindings: WorkerBindings;
9
+ readonly Variables: {
10
+ readonly access: Access;
11
+ readonly requestId: string;
12
+ };
13
+ }
14
+ }
15
+ /**
16
+ * The Worker's surface: the contract's routes, the event socket, the document that describes them,
17
+ * and the MCP endpoint agents connect to.
18
+ */
19
+ export declare const makeApp: (runtimeOf: (env: WorkerBindings) => WorkerRuntime, inboxUrl: (link: InboxLink) => string) => import("hono/hono-base").HonoBase<AppEnv, import("hono/types").BlankSchema | import("hono/types").MergeSchemaPath<import("hono/types").MergeSchemaPath<{
20
+ "/": {
21
+ $get: {
22
+ output: {
23
+ code: string;
24
+ message: string;
25
+ };
26
+ outputFormat: "json";
27
+ status: 401;
28
+ input: {
29
+ query: {
30
+ before?: string;
31
+ limit?: string | string[];
32
+ };
33
+ };
34
+ } | {
35
+ output: {
36
+ items: ({
37
+ kind: "question";
38
+ prompt: {
39
+ question: string;
40
+ options: {
41
+ label: string;
42
+ description?: string | undefined;
43
+ }[];
44
+ multiple: boolean;
45
+ context?: string | undefined;
46
+ };
47
+ id: string;
48
+ status: "awaiting_agent" | "awaiting_human" | "closed";
49
+ waiting: boolean;
50
+ project?: string | undefined;
51
+ client?: string | undefined;
52
+ raisedBy?: {
53
+ id: string;
54
+ name?: string | undefined;
55
+ } | undefined;
56
+ thread: ({
57
+ author: "human";
58
+ reply: {
59
+ outcome: "answered";
60
+ selected: string[];
61
+ text?: string | undefined;
62
+ } | {
63
+ outcome: "approved";
64
+ note?: string | undefined;
65
+ } | {
66
+ outcome: "changes_requested";
67
+ feedback: string;
68
+ } | {
69
+ outcome: "follow_up";
70
+ question: string;
71
+ } | {
72
+ outcome: "dismissed";
73
+ } | {
74
+ outcome: "responded";
75
+ points: {
76
+ point: string;
77
+ text?: string | undefined;
78
+ resolved?: boolean | undefined;
79
+ }[];
80
+ };
81
+ by?: {
82
+ id: string;
83
+ name?: string | undefined;
84
+ } | undefined;
85
+ at: string;
86
+ } | {
87
+ author: "agent";
88
+ answer: string;
89
+ content?: ({
90
+ type: "markdown";
91
+ text: string;
92
+ } | {
93
+ type: "code";
94
+ code: string;
95
+ language?: string | undefined;
96
+ filename?: string | undefined;
97
+ } | {
98
+ type: "diff";
99
+ diff: string;
100
+ filename?: string | undefined;
101
+ } | {
102
+ type: "image";
103
+ uploadId: string;
104
+ caption?: string | undefined;
105
+ })[] | undefined;
106
+ point?: string | undefined;
107
+ points?: {
108
+ id: string;
109
+ title: string;
110
+ detail?: string | undefined;
111
+ content?: ({
112
+ type: "markdown";
113
+ text: string;
114
+ } | {
115
+ type: "code";
116
+ code: string;
117
+ language?: string | undefined;
118
+ filename?: string | undefined;
119
+ } | {
120
+ type: "diff";
121
+ diff: string;
122
+ filename?: string | undefined;
123
+ } | {
124
+ type: "image";
125
+ uploadId: string;
126
+ caption?: string | undefined;
127
+ })[] | undefined;
128
+ }[] | undefined;
129
+ at: string;
130
+ })[];
131
+ createdAt: string;
132
+ updatedAt: string;
133
+ closedAt?: string | undefined;
134
+ } | {
135
+ kind: "review";
136
+ prompt: {
137
+ title: string;
138
+ content: ({
139
+ type: "markdown";
140
+ text: string;
141
+ } | {
142
+ type: "code";
143
+ code: string;
144
+ language?: string | undefined;
145
+ filename?: string | undefined;
146
+ } | {
147
+ type: "diff";
148
+ diff: string;
149
+ filename?: string | undefined;
150
+ } | {
151
+ type: "image";
152
+ uploadId: string;
153
+ caption?: string | undefined;
154
+ })[];
155
+ summary?: string | undefined;
156
+ };
157
+ revises?: string | undefined;
158
+ id: string;
159
+ status: "awaiting_agent" | "awaiting_human" | "closed";
160
+ waiting: boolean;
161
+ project?: string | undefined;
162
+ client?: string | undefined;
163
+ raisedBy?: {
164
+ id: string;
165
+ name?: string | undefined;
166
+ } | undefined;
167
+ thread: ({
168
+ author: "human";
169
+ reply: {
170
+ outcome: "answered";
171
+ selected: string[];
172
+ text?: string | undefined;
173
+ } | {
174
+ outcome: "approved";
175
+ note?: string | undefined;
176
+ } | {
177
+ outcome: "changes_requested";
178
+ feedback: string;
179
+ } | {
180
+ outcome: "follow_up";
181
+ question: string;
182
+ } | {
183
+ outcome: "dismissed";
184
+ } | {
185
+ outcome: "responded";
186
+ points: {
187
+ point: string;
188
+ text?: string | undefined;
189
+ resolved?: boolean | undefined;
190
+ }[];
191
+ };
192
+ by?: {
193
+ id: string;
194
+ name?: string | undefined;
195
+ } | undefined;
196
+ at: string;
197
+ } | {
198
+ author: "agent";
199
+ answer: string;
200
+ content?: ({
201
+ type: "markdown";
202
+ text: string;
203
+ } | {
204
+ type: "code";
205
+ code: string;
206
+ language?: string | undefined;
207
+ filename?: string | undefined;
208
+ } | {
209
+ type: "diff";
210
+ diff: string;
211
+ filename?: string | undefined;
212
+ } | {
213
+ type: "image";
214
+ uploadId: string;
215
+ caption?: string | undefined;
216
+ })[] | undefined;
217
+ point?: string | undefined;
218
+ points?: {
219
+ id: string;
220
+ title: string;
221
+ detail?: string | undefined;
222
+ content?: ({
223
+ type: "markdown";
224
+ text: string;
225
+ } | {
226
+ type: "code";
227
+ code: string;
228
+ language?: string | undefined;
229
+ filename?: string | undefined;
230
+ } | {
231
+ type: "diff";
232
+ diff: string;
233
+ filename?: string | undefined;
234
+ } | {
235
+ type: "image";
236
+ uploadId: string;
237
+ caption?: string | undefined;
238
+ })[] | undefined;
239
+ }[] | undefined;
240
+ at: string;
241
+ })[];
242
+ createdAt: string;
243
+ updatedAt: string;
244
+ closedAt?: string | undefined;
245
+ } | {
246
+ kind: "briefing";
247
+ prompt: {
248
+ title: string;
249
+ summary?: string | undefined;
250
+ sections: {
251
+ title?: string | undefined;
252
+ points: {
253
+ id: string;
254
+ title: string;
255
+ detail?: string | undefined;
256
+ content?: ({
257
+ type: "markdown";
258
+ text: string;
259
+ } | {
260
+ type: "code";
261
+ code: string;
262
+ language?: string | undefined;
263
+ filename?: string | undefined;
264
+ } | {
265
+ type: "diff";
266
+ diff: string;
267
+ filename?: string | undefined;
268
+ } | {
269
+ type: "image";
270
+ uploadId: string;
271
+ caption?: string | undefined;
272
+ })[] | undefined;
273
+ }[];
274
+ }[];
275
+ };
276
+ id: string;
277
+ status: "awaiting_agent" | "awaiting_human" | "closed";
278
+ waiting: boolean;
279
+ project?: string | undefined;
280
+ client?: string | undefined;
281
+ raisedBy?: {
282
+ id: string;
283
+ name?: string | undefined;
284
+ } | undefined;
285
+ thread: ({
286
+ author: "human";
287
+ reply: {
288
+ outcome: "answered";
289
+ selected: string[];
290
+ text?: string | undefined;
291
+ } | {
292
+ outcome: "approved";
293
+ note?: string | undefined;
294
+ } | {
295
+ outcome: "changes_requested";
296
+ feedback: string;
297
+ } | {
298
+ outcome: "follow_up";
299
+ question: string;
300
+ } | {
301
+ outcome: "dismissed";
302
+ } | {
303
+ outcome: "responded";
304
+ points: {
305
+ point: string;
306
+ text?: string | undefined;
307
+ resolved?: boolean | undefined;
308
+ }[];
309
+ };
310
+ by?: {
311
+ id: string;
312
+ name?: string | undefined;
313
+ } | undefined;
314
+ at: string;
315
+ } | {
316
+ author: "agent";
317
+ answer: string;
318
+ content?: ({
319
+ type: "markdown";
320
+ text: string;
321
+ } | {
322
+ type: "code";
323
+ code: string;
324
+ language?: string | undefined;
325
+ filename?: string | undefined;
326
+ } | {
327
+ type: "diff";
328
+ diff: string;
329
+ filename?: string | undefined;
330
+ } | {
331
+ type: "image";
332
+ uploadId: string;
333
+ caption?: string | undefined;
334
+ })[] | undefined;
335
+ point?: string | undefined;
336
+ points?: {
337
+ id: string;
338
+ title: string;
339
+ detail?: string | undefined;
340
+ content?: ({
341
+ type: "markdown";
342
+ text: string;
343
+ } | {
344
+ type: "code";
345
+ code: string;
346
+ language?: string | undefined;
347
+ filename?: string | undefined;
348
+ } | {
349
+ type: "diff";
350
+ diff: string;
351
+ filename?: string | undefined;
352
+ } | {
353
+ type: "image";
354
+ uploadId: string;
355
+ caption?: string | undefined;
356
+ })[] | undefined;
357
+ }[] | undefined;
358
+ at: string;
359
+ })[];
360
+ createdAt: string;
361
+ updatedAt: string;
362
+ closedAt?: string | undefined;
363
+ })[];
364
+ nextBefore?: string | undefined;
365
+ };
366
+ outputFormat: "json";
367
+ status: 200;
368
+ input: {
369
+ query: {
370
+ before?: string;
371
+ limit?: string | string[];
372
+ };
373
+ };
374
+ };
375
+ };
376
+ } & {
377
+ "/:id": {
378
+ $get: {
379
+ output: {
380
+ code: string;
381
+ message: string;
382
+ };
383
+ outputFormat: "json";
384
+ status: 401;
385
+ input: {
386
+ param: {
387
+ id: string;
388
+ };
389
+ };
390
+ } | {
391
+ output: {
392
+ code: string;
393
+ message: string;
394
+ };
395
+ outputFormat: "json";
396
+ status: 404;
397
+ input: {
398
+ param: {
399
+ id: string;
400
+ };
401
+ };
402
+ } | {
403
+ output: {
404
+ kind: "question";
405
+ prompt: {
406
+ question: string;
407
+ options: {
408
+ label: string;
409
+ description?: string | undefined;
410
+ }[];
411
+ multiple: boolean;
412
+ context?: string | undefined;
413
+ };
414
+ id: string;
415
+ status: "awaiting_agent" | "awaiting_human" | "closed";
416
+ waiting: boolean;
417
+ project?: string | undefined;
418
+ client?: string | undefined;
419
+ raisedBy?: {
420
+ id: string;
421
+ name?: string | undefined;
422
+ } | undefined;
423
+ thread: ({
424
+ author: "human";
425
+ reply: {
426
+ outcome: "answered";
427
+ selected: string[];
428
+ text?: string | undefined;
429
+ } | {
430
+ outcome: "approved";
431
+ note?: string | undefined;
432
+ } | {
433
+ outcome: "changes_requested";
434
+ feedback: string;
435
+ } | {
436
+ outcome: "follow_up";
437
+ question: string;
438
+ } | {
439
+ outcome: "dismissed";
440
+ } | {
441
+ outcome: "responded";
442
+ points: {
443
+ point: string;
444
+ text?: string | undefined;
445
+ resolved?: boolean | undefined;
446
+ }[];
447
+ };
448
+ by?: {
449
+ id: string;
450
+ name?: string | undefined;
451
+ } | undefined;
452
+ at: string;
453
+ } | {
454
+ author: "agent";
455
+ answer: string;
456
+ content?: ({
457
+ type: "markdown";
458
+ text: string;
459
+ } | {
460
+ type: "code";
461
+ code: string;
462
+ language?: string | undefined;
463
+ filename?: string | undefined;
464
+ } | {
465
+ type: "diff";
466
+ diff: string;
467
+ filename?: string | undefined;
468
+ } | {
469
+ type: "image";
470
+ uploadId: string;
471
+ caption?: string | undefined;
472
+ })[] | undefined;
473
+ point?: string | undefined;
474
+ points?: {
475
+ id: string;
476
+ title: string;
477
+ detail?: string | undefined;
478
+ content?: ({
479
+ type: "markdown";
480
+ text: string;
481
+ } | {
482
+ type: "code";
483
+ code: string;
484
+ language?: string | undefined;
485
+ filename?: string | undefined;
486
+ } | {
487
+ type: "diff";
488
+ diff: string;
489
+ filename?: string | undefined;
490
+ } | {
491
+ type: "image";
492
+ uploadId: string;
493
+ caption?: string | undefined;
494
+ })[] | undefined;
495
+ }[] | undefined;
496
+ at: string;
497
+ })[];
498
+ createdAt: string;
499
+ updatedAt: string;
500
+ closedAt?: string | undefined;
501
+ } | {
502
+ kind: "review";
503
+ prompt: {
504
+ title: string;
505
+ content: ({
506
+ type: "markdown";
507
+ text: string;
508
+ } | {
509
+ type: "code";
510
+ code: string;
511
+ language?: string | undefined;
512
+ filename?: string | undefined;
513
+ } | {
514
+ type: "diff";
515
+ diff: string;
516
+ filename?: string | undefined;
517
+ } | {
518
+ type: "image";
519
+ uploadId: string;
520
+ caption?: string | undefined;
521
+ })[];
522
+ summary?: string | undefined;
523
+ };
524
+ revises?: string | undefined;
525
+ id: string;
526
+ status: "awaiting_agent" | "awaiting_human" | "closed";
527
+ waiting: boolean;
528
+ project?: string | undefined;
529
+ client?: string | undefined;
530
+ raisedBy?: {
531
+ id: string;
532
+ name?: string | undefined;
533
+ } | undefined;
534
+ thread: ({
535
+ author: "human";
536
+ reply: {
537
+ outcome: "answered";
538
+ selected: string[];
539
+ text?: string | undefined;
540
+ } | {
541
+ outcome: "approved";
542
+ note?: string | undefined;
543
+ } | {
544
+ outcome: "changes_requested";
545
+ feedback: string;
546
+ } | {
547
+ outcome: "follow_up";
548
+ question: string;
549
+ } | {
550
+ outcome: "dismissed";
551
+ } | {
552
+ outcome: "responded";
553
+ points: {
554
+ point: string;
555
+ text?: string | undefined;
556
+ resolved?: boolean | undefined;
557
+ }[];
558
+ };
559
+ by?: {
560
+ id: string;
561
+ name?: string | undefined;
562
+ } | undefined;
563
+ at: string;
564
+ } | {
565
+ author: "agent";
566
+ answer: string;
567
+ content?: ({
568
+ type: "markdown";
569
+ text: string;
570
+ } | {
571
+ type: "code";
572
+ code: string;
573
+ language?: string | undefined;
574
+ filename?: string | undefined;
575
+ } | {
576
+ type: "diff";
577
+ diff: string;
578
+ filename?: string | undefined;
579
+ } | {
580
+ type: "image";
581
+ uploadId: string;
582
+ caption?: string | undefined;
583
+ })[] | undefined;
584
+ point?: string | undefined;
585
+ points?: {
586
+ id: string;
587
+ title: string;
588
+ detail?: string | undefined;
589
+ content?: ({
590
+ type: "markdown";
591
+ text: string;
592
+ } | {
593
+ type: "code";
594
+ code: string;
595
+ language?: string | undefined;
596
+ filename?: string | undefined;
597
+ } | {
598
+ type: "diff";
599
+ diff: string;
600
+ filename?: string | undefined;
601
+ } | {
602
+ type: "image";
603
+ uploadId: string;
604
+ caption?: string | undefined;
605
+ })[] | undefined;
606
+ }[] | undefined;
607
+ at: string;
608
+ })[];
609
+ createdAt: string;
610
+ updatedAt: string;
611
+ closedAt?: string | undefined;
612
+ } | {
613
+ kind: "briefing";
614
+ prompt: {
615
+ title: string;
616
+ summary?: string | undefined;
617
+ sections: {
618
+ title?: string | undefined;
619
+ points: {
620
+ id: string;
621
+ title: string;
622
+ detail?: string | undefined;
623
+ content?: ({
624
+ type: "markdown";
625
+ text: string;
626
+ } | {
627
+ type: "code";
628
+ code: string;
629
+ language?: string | undefined;
630
+ filename?: string | undefined;
631
+ } | {
632
+ type: "diff";
633
+ diff: string;
634
+ filename?: string | undefined;
635
+ } | {
636
+ type: "image";
637
+ uploadId: string;
638
+ caption?: string | undefined;
639
+ })[] | undefined;
640
+ }[];
641
+ }[];
642
+ };
643
+ id: string;
644
+ status: "awaiting_agent" | "awaiting_human" | "closed";
645
+ waiting: boolean;
646
+ project?: string | undefined;
647
+ client?: string | undefined;
648
+ raisedBy?: {
649
+ id: string;
650
+ name?: string | undefined;
651
+ } | undefined;
652
+ thread: ({
653
+ author: "human";
654
+ reply: {
655
+ outcome: "answered";
656
+ selected: string[];
657
+ text?: string | undefined;
658
+ } | {
659
+ outcome: "approved";
660
+ note?: string | undefined;
661
+ } | {
662
+ outcome: "changes_requested";
663
+ feedback: string;
664
+ } | {
665
+ outcome: "follow_up";
666
+ question: string;
667
+ } | {
668
+ outcome: "dismissed";
669
+ } | {
670
+ outcome: "responded";
671
+ points: {
672
+ point: string;
673
+ text?: string | undefined;
674
+ resolved?: boolean | undefined;
675
+ }[];
676
+ };
677
+ by?: {
678
+ id: string;
679
+ name?: string | undefined;
680
+ } | undefined;
681
+ at: string;
682
+ } | {
683
+ author: "agent";
684
+ answer: string;
685
+ content?: ({
686
+ type: "markdown";
687
+ text: string;
688
+ } | {
689
+ type: "code";
690
+ code: string;
691
+ language?: string | undefined;
692
+ filename?: string | undefined;
693
+ } | {
694
+ type: "diff";
695
+ diff: string;
696
+ filename?: string | undefined;
697
+ } | {
698
+ type: "image";
699
+ uploadId: string;
700
+ caption?: string | undefined;
701
+ })[] | undefined;
702
+ point?: string | undefined;
703
+ points?: {
704
+ id: string;
705
+ title: string;
706
+ detail?: string | undefined;
707
+ content?: ({
708
+ type: "markdown";
709
+ text: string;
710
+ } | {
711
+ type: "code";
712
+ code: string;
713
+ language?: string | undefined;
714
+ filename?: string | undefined;
715
+ } | {
716
+ type: "diff";
717
+ diff: string;
718
+ filename?: string | undefined;
719
+ } | {
720
+ type: "image";
721
+ uploadId: string;
722
+ caption?: string | undefined;
723
+ })[] | undefined;
724
+ }[] | undefined;
725
+ at: string;
726
+ })[];
727
+ createdAt: string;
728
+ updatedAt: string;
729
+ closedAt?: string | undefined;
730
+ };
731
+ outputFormat: "json";
732
+ status: 200;
733
+ input: {
734
+ param: {
735
+ id: string;
736
+ };
737
+ };
738
+ };
739
+ };
740
+ } & {
741
+ "/:id/reply": {
742
+ $post: {
743
+ output: {
744
+ code: string;
745
+ message: string;
746
+ };
747
+ outputFormat: "json";
748
+ status: 401;
749
+ input: {
750
+ param: {
751
+ id: string;
752
+ };
753
+ } & {
754
+ json: {
755
+ outcome: "answered";
756
+ selected: string[];
757
+ text?: string;
758
+ } | {
759
+ outcome: "approved";
760
+ note?: string;
761
+ } | {
762
+ outcome: "changes_requested";
763
+ feedback: string;
764
+ } | {
765
+ outcome: "follow_up";
766
+ question: string;
767
+ } | {
768
+ outcome: "dismissed";
769
+ } | {
770
+ outcome: "responded";
771
+ points: {
772
+ point: string;
773
+ text?: string;
774
+ resolved?: boolean;
775
+ }[];
776
+ };
777
+ };
778
+ } | {
779
+ output: {
780
+ code: string;
781
+ message: string;
782
+ };
783
+ outputFormat: "json";
784
+ status: 404;
785
+ input: {
786
+ param: {
787
+ id: string;
788
+ };
789
+ } & {
790
+ json: {
791
+ outcome: "answered";
792
+ selected: string[];
793
+ text?: string;
794
+ } | {
795
+ outcome: "approved";
796
+ note?: string;
797
+ } | {
798
+ outcome: "changes_requested";
799
+ feedback: string;
800
+ } | {
801
+ outcome: "follow_up";
802
+ question: string;
803
+ } | {
804
+ outcome: "dismissed";
805
+ } | {
806
+ outcome: "responded";
807
+ points: {
808
+ point: string;
809
+ text?: string;
810
+ resolved?: boolean;
811
+ }[];
812
+ };
813
+ };
814
+ } | {
815
+ output: {
816
+ code: string;
817
+ message: string;
818
+ };
819
+ outputFormat: "json";
820
+ status: 409;
821
+ input: {
822
+ param: {
823
+ id: string;
824
+ };
825
+ } & {
826
+ json: {
827
+ outcome: "answered";
828
+ selected: string[];
829
+ text?: string;
830
+ } | {
831
+ outcome: "approved";
832
+ note?: string;
833
+ } | {
834
+ outcome: "changes_requested";
835
+ feedback: string;
836
+ } | {
837
+ outcome: "follow_up";
838
+ question: string;
839
+ } | {
840
+ outcome: "dismissed";
841
+ } | {
842
+ outcome: "responded";
843
+ points: {
844
+ point: string;
845
+ text?: string;
846
+ resolved?: boolean;
847
+ }[];
848
+ };
849
+ };
850
+ } | {
851
+ output: {
852
+ code: string;
853
+ message: string;
854
+ };
855
+ outputFormat: "json";
856
+ status: 422;
857
+ input: {
858
+ param: {
859
+ id: string;
860
+ };
861
+ } & {
862
+ json: {
863
+ outcome: "answered";
864
+ selected: string[];
865
+ text?: string;
866
+ } | {
867
+ outcome: "approved";
868
+ note?: string;
869
+ } | {
870
+ outcome: "changes_requested";
871
+ feedback: string;
872
+ } | {
873
+ outcome: "follow_up";
874
+ question: string;
875
+ } | {
876
+ outcome: "dismissed";
877
+ } | {
878
+ outcome: "responded";
879
+ points: {
880
+ point: string;
881
+ text?: string;
882
+ resolved?: boolean;
883
+ }[];
884
+ };
885
+ };
886
+ } | {
887
+ output: {
888
+ kind: "question";
889
+ prompt: {
890
+ question: string;
891
+ options: {
892
+ label: string;
893
+ description?: string | undefined;
894
+ }[];
895
+ multiple: boolean;
896
+ context?: string | undefined;
897
+ };
898
+ id: string;
899
+ status: "awaiting_agent" | "awaiting_human" | "closed";
900
+ waiting: boolean;
901
+ project?: string | undefined;
902
+ client?: string | undefined;
903
+ raisedBy?: {
904
+ id: string;
905
+ name?: string | undefined;
906
+ } | undefined;
907
+ thread: ({
908
+ author: "human";
909
+ reply: {
910
+ outcome: "answered";
911
+ selected: string[];
912
+ text?: string | undefined;
913
+ } | {
914
+ outcome: "approved";
915
+ note?: string | undefined;
916
+ } | {
917
+ outcome: "changes_requested";
918
+ feedback: string;
919
+ } | {
920
+ outcome: "follow_up";
921
+ question: string;
922
+ } | {
923
+ outcome: "dismissed";
924
+ } | {
925
+ outcome: "responded";
926
+ points: {
927
+ point: string;
928
+ text?: string | undefined;
929
+ resolved?: boolean | undefined;
930
+ }[];
931
+ };
932
+ by?: {
933
+ id: string;
934
+ name?: string | undefined;
935
+ } | undefined;
936
+ at: string;
937
+ } | {
938
+ author: "agent";
939
+ answer: string;
940
+ content?: ({
941
+ type: "markdown";
942
+ text: string;
943
+ } | {
944
+ type: "code";
945
+ code: string;
946
+ language?: string | undefined;
947
+ filename?: string | undefined;
948
+ } | {
949
+ type: "diff";
950
+ diff: string;
951
+ filename?: string | undefined;
952
+ } | {
953
+ type: "image";
954
+ uploadId: string;
955
+ caption?: string | undefined;
956
+ })[] | undefined;
957
+ point?: string | undefined;
958
+ points?: {
959
+ id: string;
960
+ title: string;
961
+ detail?: string | undefined;
962
+ content?: ({
963
+ type: "markdown";
964
+ text: string;
965
+ } | {
966
+ type: "code";
967
+ code: string;
968
+ language?: string | undefined;
969
+ filename?: string | undefined;
970
+ } | {
971
+ type: "diff";
972
+ diff: string;
973
+ filename?: string | undefined;
974
+ } | {
975
+ type: "image";
976
+ uploadId: string;
977
+ caption?: string | undefined;
978
+ })[] | undefined;
979
+ }[] | undefined;
980
+ at: string;
981
+ })[];
982
+ createdAt: string;
983
+ updatedAt: string;
984
+ closedAt?: string | undefined;
985
+ } | {
986
+ kind: "review";
987
+ prompt: {
988
+ title: string;
989
+ content: ({
990
+ type: "markdown";
991
+ text: string;
992
+ } | {
993
+ type: "code";
994
+ code: string;
995
+ language?: string | undefined;
996
+ filename?: string | undefined;
997
+ } | {
998
+ type: "diff";
999
+ diff: string;
1000
+ filename?: string | undefined;
1001
+ } | {
1002
+ type: "image";
1003
+ uploadId: string;
1004
+ caption?: string | undefined;
1005
+ })[];
1006
+ summary?: string | undefined;
1007
+ };
1008
+ revises?: string | undefined;
1009
+ id: string;
1010
+ status: "awaiting_agent" | "awaiting_human" | "closed";
1011
+ waiting: boolean;
1012
+ project?: string | undefined;
1013
+ client?: string | undefined;
1014
+ raisedBy?: {
1015
+ id: string;
1016
+ name?: string | undefined;
1017
+ } | undefined;
1018
+ thread: ({
1019
+ author: "human";
1020
+ reply: {
1021
+ outcome: "answered";
1022
+ selected: string[];
1023
+ text?: string | undefined;
1024
+ } | {
1025
+ outcome: "approved";
1026
+ note?: string | undefined;
1027
+ } | {
1028
+ outcome: "changes_requested";
1029
+ feedback: string;
1030
+ } | {
1031
+ outcome: "follow_up";
1032
+ question: string;
1033
+ } | {
1034
+ outcome: "dismissed";
1035
+ } | {
1036
+ outcome: "responded";
1037
+ points: {
1038
+ point: string;
1039
+ text?: string | undefined;
1040
+ resolved?: boolean | undefined;
1041
+ }[];
1042
+ };
1043
+ by?: {
1044
+ id: string;
1045
+ name?: string | undefined;
1046
+ } | undefined;
1047
+ at: string;
1048
+ } | {
1049
+ author: "agent";
1050
+ answer: string;
1051
+ content?: ({
1052
+ type: "markdown";
1053
+ text: string;
1054
+ } | {
1055
+ type: "code";
1056
+ code: string;
1057
+ language?: string | undefined;
1058
+ filename?: string | undefined;
1059
+ } | {
1060
+ type: "diff";
1061
+ diff: string;
1062
+ filename?: string | undefined;
1063
+ } | {
1064
+ type: "image";
1065
+ uploadId: string;
1066
+ caption?: string | undefined;
1067
+ })[] | undefined;
1068
+ point?: string | undefined;
1069
+ points?: {
1070
+ id: string;
1071
+ title: string;
1072
+ detail?: string | undefined;
1073
+ content?: ({
1074
+ type: "markdown";
1075
+ text: string;
1076
+ } | {
1077
+ type: "code";
1078
+ code: string;
1079
+ language?: string | undefined;
1080
+ filename?: string | undefined;
1081
+ } | {
1082
+ type: "diff";
1083
+ diff: string;
1084
+ filename?: string | undefined;
1085
+ } | {
1086
+ type: "image";
1087
+ uploadId: string;
1088
+ caption?: string | undefined;
1089
+ })[] | undefined;
1090
+ }[] | undefined;
1091
+ at: string;
1092
+ })[];
1093
+ createdAt: string;
1094
+ updatedAt: string;
1095
+ closedAt?: string | undefined;
1096
+ } | {
1097
+ kind: "briefing";
1098
+ prompt: {
1099
+ title: string;
1100
+ summary?: string | undefined;
1101
+ sections: {
1102
+ title?: string | undefined;
1103
+ points: {
1104
+ id: string;
1105
+ title: string;
1106
+ detail?: string | undefined;
1107
+ content?: ({
1108
+ type: "markdown";
1109
+ text: string;
1110
+ } | {
1111
+ type: "code";
1112
+ code: string;
1113
+ language?: string | undefined;
1114
+ filename?: string | undefined;
1115
+ } | {
1116
+ type: "diff";
1117
+ diff: string;
1118
+ filename?: string | undefined;
1119
+ } | {
1120
+ type: "image";
1121
+ uploadId: string;
1122
+ caption?: string | undefined;
1123
+ })[] | undefined;
1124
+ }[];
1125
+ }[];
1126
+ };
1127
+ id: string;
1128
+ status: "awaiting_agent" | "awaiting_human" | "closed";
1129
+ waiting: boolean;
1130
+ project?: string | undefined;
1131
+ client?: string | undefined;
1132
+ raisedBy?: {
1133
+ id: string;
1134
+ name?: string | undefined;
1135
+ } | undefined;
1136
+ thread: ({
1137
+ author: "human";
1138
+ reply: {
1139
+ outcome: "answered";
1140
+ selected: string[];
1141
+ text?: string | undefined;
1142
+ } | {
1143
+ outcome: "approved";
1144
+ note?: string | undefined;
1145
+ } | {
1146
+ outcome: "changes_requested";
1147
+ feedback: string;
1148
+ } | {
1149
+ outcome: "follow_up";
1150
+ question: string;
1151
+ } | {
1152
+ outcome: "dismissed";
1153
+ } | {
1154
+ outcome: "responded";
1155
+ points: {
1156
+ point: string;
1157
+ text?: string | undefined;
1158
+ resolved?: boolean | undefined;
1159
+ }[];
1160
+ };
1161
+ by?: {
1162
+ id: string;
1163
+ name?: string | undefined;
1164
+ } | undefined;
1165
+ at: string;
1166
+ } | {
1167
+ author: "agent";
1168
+ answer: string;
1169
+ content?: ({
1170
+ type: "markdown";
1171
+ text: string;
1172
+ } | {
1173
+ type: "code";
1174
+ code: string;
1175
+ language?: string | undefined;
1176
+ filename?: string | undefined;
1177
+ } | {
1178
+ type: "diff";
1179
+ diff: string;
1180
+ filename?: string | undefined;
1181
+ } | {
1182
+ type: "image";
1183
+ uploadId: string;
1184
+ caption?: string | undefined;
1185
+ })[] | undefined;
1186
+ point?: string | undefined;
1187
+ points?: {
1188
+ id: string;
1189
+ title: string;
1190
+ detail?: string | undefined;
1191
+ content?: ({
1192
+ type: "markdown";
1193
+ text: string;
1194
+ } | {
1195
+ type: "code";
1196
+ code: string;
1197
+ language?: string | undefined;
1198
+ filename?: string | undefined;
1199
+ } | {
1200
+ type: "diff";
1201
+ diff: string;
1202
+ filename?: string | undefined;
1203
+ } | {
1204
+ type: "image";
1205
+ uploadId: string;
1206
+ caption?: string | undefined;
1207
+ })[] | undefined;
1208
+ }[] | undefined;
1209
+ at: string;
1210
+ })[];
1211
+ createdAt: string;
1212
+ updatedAt: string;
1213
+ closedAt?: string | undefined;
1214
+ };
1215
+ outputFormat: "json";
1216
+ status: 200;
1217
+ input: {
1218
+ param: {
1219
+ id: string;
1220
+ };
1221
+ } & {
1222
+ json: {
1223
+ outcome: "answered";
1224
+ selected: string[];
1225
+ text?: string;
1226
+ } | {
1227
+ outcome: "approved";
1228
+ note?: string;
1229
+ } | {
1230
+ outcome: "changes_requested";
1231
+ feedback: string;
1232
+ } | {
1233
+ outcome: "follow_up";
1234
+ question: string;
1235
+ } | {
1236
+ outcome: "dismissed";
1237
+ } | {
1238
+ outcome: "responded";
1239
+ points: {
1240
+ point: string;
1241
+ text?: string;
1242
+ resolved?: boolean;
1243
+ }[];
1244
+ };
1245
+ };
1246
+ };
1247
+ };
1248
+ }, "/asks"> | ({
1249
+ "/whoami": {
1250
+ $get: {
1251
+ output: {
1252
+ space: string;
1253
+ actor: {
1254
+ id: string;
1255
+ name?: string | undefined;
1256
+ };
1257
+ };
1258
+ outputFormat: "json";
1259
+ status: 200;
1260
+ input: {};
1261
+ } | {
1262
+ output: {
1263
+ code: string;
1264
+ message: string;
1265
+ };
1266
+ outputFormat: "json";
1267
+ status: 401;
1268
+ input: {};
1269
+ };
1270
+ };
1271
+ } & {
1272
+ "/events/tickets": {
1273
+ $post: {
1274
+ output: {
1275
+ code: string;
1276
+ message: string;
1277
+ };
1278
+ outputFormat: "json";
1279
+ status: 401;
1280
+ input: {};
1281
+ } | {
1282
+ output: {
1283
+ ticket: string;
1284
+ expiresAt: string;
1285
+ };
1286
+ outputFormat: "json";
1287
+ status: 201;
1288
+ input: {};
1289
+ };
1290
+ };
1291
+ } & {
1292
+ "/snapshot": {
1293
+ $get: {
1294
+ output: {
1295
+ code: string;
1296
+ message: string;
1297
+ };
1298
+ outputFormat: "json";
1299
+ status: 401;
1300
+ input: {};
1301
+ } | {
1302
+ output: {
1303
+ open: ({
1304
+ kind: "question";
1305
+ prompt: {
1306
+ question: string;
1307
+ options: {
1308
+ label: string;
1309
+ description?: string | undefined;
1310
+ }[];
1311
+ multiple: boolean;
1312
+ context?: string | undefined;
1313
+ };
1314
+ id: string;
1315
+ status: "awaiting_agent" | "awaiting_human" | "closed";
1316
+ waiting: boolean;
1317
+ project?: string | undefined;
1318
+ client?: string | undefined;
1319
+ raisedBy?: {
1320
+ id: string;
1321
+ name?: string | undefined;
1322
+ } | undefined;
1323
+ thread: ({
1324
+ author: "human";
1325
+ reply: {
1326
+ outcome: "answered";
1327
+ selected: string[];
1328
+ text?: string | undefined;
1329
+ } | {
1330
+ outcome: "approved";
1331
+ note?: string | undefined;
1332
+ } | {
1333
+ outcome: "changes_requested";
1334
+ feedback: string;
1335
+ } | {
1336
+ outcome: "follow_up";
1337
+ question: string;
1338
+ } | {
1339
+ outcome: "dismissed";
1340
+ } | {
1341
+ outcome: "responded";
1342
+ points: {
1343
+ point: string;
1344
+ text?: string | undefined;
1345
+ resolved?: boolean | undefined;
1346
+ }[];
1347
+ };
1348
+ by?: {
1349
+ id: string;
1350
+ name?: string | undefined;
1351
+ } | undefined;
1352
+ at: string;
1353
+ } | {
1354
+ author: "agent";
1355
+ answer: string;
1356
+ content?: ({
1357
+ type: "markdown";
1358
+ text: string;
1359
+ } | {
1360
+ type: "code";
1361
+ code: string;
1362
+ language?: string | undefined;
1363
+ filename?: string | undefined;
1364
+ } | {
1365
+ type: "diff";
1366
+ diff: string;
1367
+ filename?: string | undefined;
1368
+ } | {
1369
+ type: "image";
1370
+ uploadId: string;
1371
+ caption?: string | undefined;
1372
+ })[] | undefined;
1373
+ point?: string | undefined;
1374
+ points?: {
1375
+ id: string;
1376
+ title: string;
1377
+ detail?: string | undefined;
1378
+ content?: ({
1379
+ type: "markdown";
1380
+ text: string;
1381
+ } | {
1382
+ type: "code";
1383
+ code: string;
1384
+ language?: string | undefined;
1385
+ filename?: string | undefined;
1386
+ } | {
1387
+ type: "diff";
1388
+ diff: string;
1389
+ filename?: string | undefined;
1390
+ } | {
1391
+ type: "image";
1392
+ uploadId: string;
1393
+ caption?: string | undefined;
1394
+ })[] | undefined;
1395
+ }[] | undefined;
1396
+ at: string;
1397
+ })[];
1398
+ createdAt: string;
1399
+ updatedAt: string;
1400
+ closedAt?: string | undefined;
1401
+ } | {
1402
+ kind: "review";
1403
+ prompt: {
1404
+ title: string;
1405
+ content: ({
1406
+ type: "markdown";
1407
+ text: string;
1408
+ } | {
1409
+ type: "code";
1410
+ code: string;
1411
+ language?: string | undefined;
1412
+ filename?: string | undefined;
1413
+ } | {
1414
+ type: "diff";
1415
+ diff: string;
1416
+ filename?: string | undefined;
1417
+ } | {
1418
+ type: "image";
1419
+ uploadId: string;
1420
+ caption?: string | undefined;
1421
+ })[];
1422
+ summary?: string | undefined;
1423
+ };
1424
+ revises?: string | undefined;
1425
+ id: string;
1426
+ status: "awaiting_agent" | "awaiting_human" | "closed";
1427
+ waiting: boolean;
1428
+ project?: string | undefined;
1429
+ client?: string | undefined;
1430
+ raisedBy?: {
1431
+ id: string;
1432
+ name?: string | undefined;
1433
+ } | undefined;
1434
+ thread: ({
1435
+ author: "human";
1436
+ reply: {
1437
+ outcome: "answered";
1438
+ selected: string[];
1439
+ text?: string | undefined;
1440
+ } | {
1441
+ outcome: "approved";
1442
+ note?: string | undefined;
1443
+ } | {
1444
+ outcome: "changes_requested";
1445
+ feedback: string;
1446
+ } | {
1447
+ outcome: "follow_up";
1448
+ question: string;
1449
+ } | {
1450
+ outcome: "dismissed";
1451
+ } | {
1452
+ outcome: "responded";
1453
+ points: {
1454
+ point: string;
1455
+ text?: string | undefined;
1456
+ resolved?: boolean | undefined;
1457
+ }[];
1458
+ };
1459
+ by?: {
1460
+ id: string;
1461
+ name?: string | undefined;
1462
+ } | undefined;
1463
+ at: string;
1464
+ } | {
1465
+ author: "agent";
1466
+ answer: string;
1467
+ content?: ({
1468
+ type: "markdown";
1469
+ text: string;
1470
+ } | {
1471
+ type: "code";
1472
+ code: string;
1473
+ language?: string | undefined;
1474
+ filename?: string | undefined;
1475
+ } | {
1476
+ type: "diff";
1477
+ diff: string;
1478
+ filename?: string | undefined;
1479
+ } | {
1480
+ type: "image";
1481
+ uploadId: string;
1482
+ caption?: string | undefined;
1483
+ })[] | undefined;
1484
+ point?: string | undefined;
1485
+ points?: {
1486
+ id: string;
1487
+ title: string;
1488
+ detail?: string | undefined;
1489
+ content?: ({
1490
+ type: "markdown";
1491
+ text: string;
1492
+ } | {
1493
+ type: "code";
1494
+ code: string;
1495
+ language?: string | undefined;
1496
+ filename?: string | undefined;
1497
+ } | {
1498
+ type: "diff";
1499
+ diff: string;
1500
+ filename?: string | undefined;
1501
+ } | {
1502
+ type: "image";
1503
+ uploadId: string;
1504
+ caption?: string | undefined;
1505
+ })[] | undefined;
1506
+ }[] | undefined;
1507
+ at: string;
1508
+ })[];
1509
+ createdAt: string;
1510
+ updatedAt: string;
1511
+ closedAt?: string | undefined;
1512
+ } | {
1513
+ kind: "briefing";
1514
+ prompt: {
1515
+ title: string;
1516
+ summary?: string | undefined;
1517
+ sections: {
1518
+ title?: string | undefined;
1519
+ points: {
1520
+ id: string;
1521
+ title: string;
1522
+ detail?: string | undefined;
1523
+ content?: ({
1524
+ type: "markdown";
1525
+ text: string;
1526
+ } | {
1527
+ type: "code";
1528
+ code: string;
1529
+ language?: string | undefined;
1530
+ filename?: string | undefined;
1531
+ } | {
1532
+ type: "diff";
1533
+ diff: string;
1534
+ filename?: string | undefined;
1535
+ } | {
1536
+ type: "image";
1537
+ uploadId: string;
1538
+ caption?: string | undefined;
1539
+ })[] | undefined;
1540
+ }[];
1541
+ }[];
1542
+ };
1543
+ id: string;
1544
+ status: "awaiting_agent" | "awaiting_human" | "closed";
1545
+ waiting: boolean;
1546
+ project?: string | undefined;
1547
+ client?: string | undefined;
1548
+ raisedBy?: {
1549
+ id: string;
1550
+ name?: string | undefined;
1551
+ } | undefined;
1552
+ thread: ({
1553
+ author: "human";
1554
+ reply: {
1555
+ outcome: "answered";
1556
+ selected: string[];
1557
+ text?: string | undefined;
1558
+ } | {
1559
+ outcome: "approved";
1560
+ note?: string | undefined;
1561
+ } | {
1562
+ outcome: "changes_requested";
1563
+ feedback: string;
1564
+ } | {
1565
+ outcome: "follow_up";
1566
+ question: string;
1567
+ } | {
1568
+ outcome: "dismissed";
1569
+ } | {
1570
+ outcome: "responded";
1571
+ points: {
1572
+ point: string;
1573
+ text?: string | undefined;
1574
+ resolved?: boolean | undefined;
1575
+ }[];
1576
+ };
1577
+ by?: {
1578
+ id: string;
1579
+ name?: string | undefined;
1580
+ } | undefined;
1581
+ at: string;
1582
+ } | {
1583
+ author: "agent";
1584
+ answer: string;
1585
+ content?: ({
1586
+ type: "markdown";
1587
+ text: string;
1588
+ } | {
1589
+ type: "code";
1590
+ code: string;
1591
+ language?: string | undefined;
1592
+ filename?: string | undefined;
1593
+ } | {
1594
+ type: "diff";
1595
+ diff: string;
1596
+ filename?: string | undefined;
1597
+ } | {
1598
+ type: "image";
1599
+ uploadId: string;
1600
+ caption?: string | undefined;
1601
+ })[] | undefined;
1602
+ point?: string | undefined;
1603
+ points?: {
1604
+ id: string;
1605
+ title: string;
1606
+ detail?: string | undefined;
1607
+ content?: ({
1608
+ type: "markdown";
1609
+ text: string;
1610
+ } | {
1611
+ type: "code";
1612
+ code: string;
1613
+ language?: string | undefined;
1614
+ filename?: string | undefined;
1615
+ } | {
1616
+ type: "diff";
1617
+ diff: string;
1618
+ filename?: string | undefined;
1619
+ } | {
1620
+ type: "image";
1621
+ uploadId: string;
1622
+ caption?: string | undefined;
1623
+ })[] | undefined;
1624
+ }[] | undefined;
1625
+ at: string;
1626
+ })[];
1627
+ createdAt: string;
1628
+ updatedAt: string;
1629
+ closedAt?: string | undefined;
1630
+ })[];
1631
+ recent: ({
1632
+ kind: "question";
1633
+ prompt: {
1634
+ question: string;
1635
+ options: {
1636
+ label: string;
1637
+ description?: string | undefined;
1638
+ }[];
1639
+ multiple: boolean;
1640
+ context?: string | undefined;
1641
+ };
1642
+ id: string;
1643
+ status: "awaiting_agent" | "awaiting_human" | "closed";
1644
+ waiting: boolean;
1645
+ project?: string | undefined;
1646
+ client?: string | undefined;
1647
+ raisedBy?: {
1648
+ id: string;
1649
+ name?: string | undefined;
1650
+ } | undefined;
1651
+ thread: ({
1652
+ author: "human";
1653
+ reply: {
1654
+ outcome: "answered";
1655
+ selected: string[];
1656
+ text?: string | undefined;
1657
+ } | {
1658
+ outcome: "approved";
1659
+ note?: string | undefined;
1660
+ } | {
1661
+ outcome: "changes_requested";
1662
+ feedback: string;
1663
+ } | {
1664
+ outcome: "follow_up";
1665
+ question: string;
1666
+ } | {
1667
+ outcome: "dismissed";
1668
+ } | {
1669
+ outcome: "responded";
1670
+ points: {
1671
+ point: string;
1672
+ text?: string | undefined;
1673
+ resolved?: boolean | undefined;
1674
+ }[];
1675
+ };
1676
+ by?: {
1677
+ id: string;
1678
+ name?: string | undefined;
1679
+ } | undefined;
1680
+ at: string;
1681
+ } | {
1682
+ author: "agent";
1683
+ answer: string;
1684
+ content?: ({
1685
+ type: "markdown";
1686
+ text: string;
1687
+ } | {
1688
+ type: "code";
1689
+ code: string;
1690
+ language?: string | undefined;
1691
+ filename?: string | undefined;
1692
+ } | {
1693
+ type: "diff";
1694
+ diff: string;
1695
+ filename?: string | undefined;
1696
+ } | {
1697
+ type: "image";
1698
+ uploadId: string;
1699
+ caption?: string | undefined;
1700
+ })[] | undefined;
1701
+ point?: string | undefined;
1702
+ points?: {
1703
+ id: string;
1704
+ title: string;
1705
+ detail?: string | undefined;
1706
+ content?: ({
1707
+ type: "markdown";
1708
+ text: string;
1709
+ } | {
1710
+ type: "code";
1711
+ code: string;
1712
+ language?: string | undefined;
1713
+ filename?: string | undefined;
1714
+ } | {
1715
+ type: "diff";
1716
+ diff: string;
1717
+ filename?: string | undefined;
1718
+ } | {
1719
+ type: "image";
1720
+ uploadId: string;
1721
+ caption?: string | undefined;
1722
+ })[] | undefined;
1723
+ }[] | undefined;
1724
+ at: string;
1725
+ })[];
1726
+ createdAt: string;
1727
+ updatedAt: string;
1728
+ closedAt?: string | undefined;
1729
+ } | {
1730
+ kind: "review";
1731
+ prompt: {
1732
+ title: string;
1733
+ content: ({
1734
+ type: "markdown";
1735
+ text: string;
1736
+ } | {
1737
+ type: "code";
1738
+ code: string;
1739
+ language?: string | undefined;
1740
+ filename?: string | undefined;
1741
+ } | {
1742
+ type: "diff";
1743
+ diff: string;
1744
+ filename?: string | undefined;
1745
+ } | {
1746
+ type: "image";
1747
+ uploadId: string;
1748
+ caption?: string | undefined;
1749
+ })[];
1750
+ summary?: string | undefined;
1751
+ };
1752
+ revises?: string | undefined;
1753
+ id: string;
1754
+ status: "awaiting_agent" | "awaiting_human" | "closed";
1755
+ waiting: boolean;
1756
+ project?: string | undefined;
1757
+ client?: string | undefined;
1758
+ raisedBy?: {
1759
+ id: string;
1760
+ name?: string | undefined;
1761
+ } | undefined;
1762
+ thread: ({
1763
+ author: "human";
1764
+ reply: {
1765
+ outcome: "answered";
1766
+ selected: string[];
1767
+ text?: string | undefined;
1768
+ } | {
1769
+ outcome: "approved";
1770
+ note?: string | undefined;
1771
+ } | {
1772
+ outcome: "changes_requested";
1773
+ feedback: string;
1774
+ } | {
1775
+ outcome: "follow_up";
1776
+ question: string;
1777
+ } | {
1778
+ outcome: "dismissed";
1779
+ } | {
1780
+ outcome: "responded";
1781
+ points: {
1782
+ point: string;
1783
+ text?: string | undefined;
1784
+ resolved?: boolean | undefined;
1785
+ }[];
1786
+ };
1787
+ by?: {
1788
+ id: string;
1789
+ name?: string | undefined;
1790
+ } | undefined;
1791
+ at: string;
1792
+ } | {
1793
+ author: "agent";
1794
+ answer: string;
1795
+ content?: ({
1796
+ type: "markdown";
1797
+ text: string;
1798
+ } | {
1799
+ type: "code";
1800
+ code: string;
1801
+ language?: string | undefined;
1802
+ filename?: string | undefined;
1803
+ } | {
1804
+ type: "diff";
1805
+ diff: string;
1806
+ filename?: string | undefined;
1807
+ } | {
1808
+ type: "image";
1809
+ uploadId: string;
1810
+ caption?: string | undefined;
1811
+ })[] | undefined;
1812
+ point?: string | undefined;
1813
+ points?: {
1814
+ id: string;
1815
+ title: string;
1816
+ detail?: string | undefined;
1817
+ content?: ({
1818
+ type: "markdown";
1819
+ text: string;
1820
+ } | {
1821
+ type: "code";
1822
+ code: string;
1823
+ language?: string | undefined;
1824
+ filename?: string | undefined;
1825
+ } | {
1826
+ type: "diff";
1827
+ diff: string;
1828
+ filename?: string | undefined;
1829
+ } | {
1830
+ type: "image";
1831
+ uploadId: string;
1832
+ caption?: string | undefined;
1833
+ })[] | undefined;
1834
+ }[] | undefined;
1835
+ at: string;
1836
+ })[];
1837
+ createdAt: string;
1838
+ updatedAt: string;
1839
+ closedAt?: string | undefined;
1840
+ } | {
1841
+ kind: "briefing";
1842
+ prompt: {
1843
+ title: string;
1844
+ summary?: string | undefined;
1845
+ sections: {
1846
+ title?: string | undefined;
1847
+ points: {
1848
+ id: string;
1849
+ title: string;
1850
+ detail?: string | undefined;
1851
+ content?: ({
1852
+ type: "markdown";
1853
+ text: string;
1854
+ } | {
1855
+ type: "code";
1856
+ code: string;
1857
+ language?: string | undefined;
1858
+ filename?: string | undefined;
1859
+ } | {
1860
+ type: "diff";
1861
+ diff: string;
1862
+ filename?: string | undefined;
1863
+ } | {
1864
+ type: "image";
1865
+ uploadId: string;
1866
+ caption?: string | undefined;
1867
+ })[] | undefined;
1868
+ }[];
1869
+ }[];
1870
+ };
1871
+ id: string;
1872
+ status: "awaiting_agent" | "awaiting_human" | "closed";
1873
+ waiting: boolean;
1874
+ project?: string | undefined;
1875
+ client?: string | undefined;
1876
+ raisedBy?: {
1877
+ id: string;
1878
+ name?: string | undefined;
1879
+ } | undefined;
1880
+ thread: ({
1881
+ author: "human";
1882
+ reply: {
1883
+ outcome: "answered";
1884
+ selected: string[];
1885
+ text?: string | undefined;
1886
+ } | {
1887
+ outcome: "approved";
1888
+ note?: string | undefined;
1889
+ } | {
1890
+ outcome: "changes_requested";
1891
+ feedback: string;
1892
+ } | {
1893
+ outcome: "follow_up";
1894
+ question: string;
1895
+ } | {
1896
+ outcome: "dismissed";
1897
+ } | {
1898
+ outcome: "responded";
1899
+ points: {
1900
+ point: string;
1901
+ text?: string | undefined;
1902
+ resolved?: boolean | undefined;
1903
+ }[];
1904
+ };
1905
+ by?: {
1906
+ id: string;
1907
+ name?: string | undefined;
1908
+ } | undefined;
1909
+ at: string;
1910
+ } | {
1911
+ author: "agent";
1912
+ answer: string;
1913
+ content?: ({
1914
+ type: "markdown";
1915
+ text: string;
1916
+ } | {
1917
+ type: "code";
1918
+ code: string;
1919
+ language?: string | undefined;
1920
+ filename?: string | undefined;
1921
+ } | {
1922
+ type: "diff";
1923
+ diff: string;
1924
+ filename?: string | undefined;
1925
+ } | {
1926
+ type: "image";
1927
+ uploadId: string;
1928
+ caption?: string | undefined;
1929
+ })[] | undefined;
1930
+ point?: string | undefined;
1931
+ points?: {
1932
+ id: string;
1933
+ title: string;
1934
+ detail?: string | undefined;
1935
+ content?: ({
1936
+ type: "markdown";
1937
+ text: string;
1938
+ } | {
1939
+ type: "code";
1940
+ code: string;
1941
+ language?: string | undefined;
1942
+ filename?: string | undefined;
1943
+ } | {
1944
+ type: "diff";
1945
+ diff: string;
1946
+ filename?: string | undefined;
1947
+ } | {
1948
+ type: "image";
1949
+ uploadId: string;
1950
+ caption?: string | undefined;
1951
+ })[] | undefined;
1952
+ }[] | undefined;
1953
+ at: string;
1954
+ })[];
1955
+ createdAt: string;
1956
+ updatedAt: string;
1957
+ closedAt?: string | undefined;
1958
+ })[];
1959
+ };
1960
+ outputFormat: "json";
1961
+ status: 200;
1962
+ input: {};
1963
+ };
1964
+ };
1965
+ } & {
1966
+ "/files/:uploadId": {
1967
+ $get: {
1968
+ output: {
1969
+ code: string;
1970
+ message: string;
1971
+ };
1972
+ outputFormat: "json";
1973
+ status: 401;
1974
+ input: {
1975
+ param: {
1976
+ uploadId: string;
1977
+ };
1978
+ };
1979
+ } | {
1980
+ output: {
1981
+ code: string;
1982
+ message: string;
1983
+ };
1984
+ outputFormat: "json";
1985
+ status: 404;
1986
+ input: {
1987
+ param: {
1988
+ uploadId: string;
1989
+ };
1990
+ };
1991
+ } | {
1992
+ output: ArrayBuffer | ReadableStream<Uint8Array<ArrayBufferLike>> | Uint8Array<ArrayBuffer>;
1993
+ outputFormat: "body";
1994
+ status: 200;
1995
+ input: {
1996
+ param: {
1997
+ uploadId: string;
1998
+ };
1999
+ };
2000
+ };
2001
+ };
2002
+ } & {
2003
+ "/uploads/:spaceId/:token": {
2004
+ $put: {
2005
+ output: {
2006
+ code: string;
2007
+ message: string;
2008
+ };
2009
+ outputFormat: "json";
2010
+ status: 404;
2011
+ input: {
2012
+ param: {
2013
+ spaceId: string;
2014
+ token: string;
2015
+ };
2016
+ } & {
2017
+ header: {
2018
+ "Content-Type": string;
2019
+ };
2020
+ };
2021
+ } | {
2022
+ output: {
2023
+ code: string;
2024
+ message: string;
2025
+ };
2026
+ outputFormat: "json";
2027
+ status: 410;
2028
+ input: {
2029
+ param: {
2030
+ spaceId: string;
2031
+ token: string;
2032
+ };
2033
+ } & {
2034
+ header: {
2035
+ "Content-Type": string;
2036
+ };
2037
+ };
2038
+ } | {
2039
+ output: {
2040
+ code: string;
2041
+ message: string;
2042
+ };
2043
+ outputFormat: "json";
2044
+ status: 413;
2045
+ input: {
2046
+ param: {
2047
+ spaceId: string;
2048
+ token: string;
2049
+ };
2050
+ } & {
2051
+ header: {
2052
+ "Content-Type": string;
2053
+ };
2054
+ };
2055
+ } | {
2056
+ output: {
2057
+ code: string;
2058
+ message: string;
2059
+ };
2060
+ outputFormat: "json";
2061
+ status: 422;
2062
+ input: {
2063
+ param: {
2064
+ spaceId: string;
2065
+ token: string;
2066
+ };
2067
+ } & {
2068
+ header: {
2069
+ "Content-Type": string;
2070
+ };
2071
+ };
2072
+ } | {
2073
+ output: {
2074
+ uploadId: string;
2075
+ contentType: "image/gif" | "image/jpeg" | "image/png" | "image/webp";
2076
+ size: number;
2077
+ };
2078
+ outputFormat: "json";
2079
+ status: 201;
2080
+ input: {
2081
+ param: {
2082
+ spaceId: string;
2083
+ token: string;
2084
+ };
2085
+ } & {
2086
+ header: {
2087
+ "Content-Type": string;
2088
+ };
2089
+ };
2090
+ };
2091
+ };
2092
+ }), "/api/v1">, "/", "/">;