@runnee/sdk 0.0.0-stage → 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,1388 @@
1
+ // Generated public schemas only. No interpreter.
2
+ export const contracts = {
3
+ schemas: {
4
+ Error: {
5
+ type: 'object',
6
+ properties: {
7
+ statusCode: {
8
+ type: 'integer',
9
+ },
10
+ message: {
11
+ anyOf: [
12
+ {
13
+ type: 'string',
14
+ },
15
+ {
16
+ type: 'array',
17
+ items: {
18
+ type: 'string',
19
+ },
20
+ },
21
+ ],
22
+ },
23
+ error: {
24
+ type: 'string',
25
+ },
26
+ code: {
27
+ type: 'string',
28
+ },
29
+ },
30
+ required: [],
31
+ additionalProperties: true,
32
+ },
33
+ ExecuteRequest: {
34
+ type: 'object',
35
+ properties: {
36
+ code: {
37
+ type: 'string',
38
+ minLength: 1,
39
+ maxLength: 6000,
40
+ },
41
+ mode: {
42
+ type: 'string',
43
+ enum: ['dry-run', 'live'],
44
+ },
45
+ event: {
46
+ type: 'object',
47
+ additionalProperties: true,
48
+ description: 'JSON execution input, at most 8 KiB encoded. Available as ctx.input.',
49
+ },
50
+ retainSource: {
51
+ type: 'boolean',
52
+ },
53
+ scriptName: {
54
+ type: 'string',
55
+ maxLength: 80,
56
+ },
57
+ secretNames: {
58
+ type: 'array',
59
+ items: {
60
+ type: 'string',
61
+ pattern: '^[A-Z][A-Z0-9_]{0,63}$',
62
+ },
63
+ maxItems: 16,
64
+ uniqueItems: true,
65
+ description: 'Explicit secret grant; requires secrets:use in addition to scripts:execute. Policies are enforced server-side.',
66
+ },
67
+ scriptId: {
68
+ type: 'string',
69
+ format: 'uuid',
70
+ },
71
+ },
72
+ required: ['code'],
73
+ additionalProperties: false,
74
+ },
75
+ Diagnostic: {
76
+ type: 'object',
77
+ properties: {
78
+ code: {
79
+ type: 'string',
80
+ },
81
+ message: {
82
+ type: 'string',
83
+ },
84
+ line: {
85
+ type: 'integer',
86
+ },
87
+ column: {
88
+ type: 'integer',
89
+ },
90
+ filename: {
91
+ type: 'string',
92
+ },
93
+ snippet: {
94
+ type: 'string',
95
+ },
96
+ },
97
+ required: ['message'],
98
+ additionalProperties: true,
99
+ },
100
+ Timings: {
101
+ type: 'object',
102
+ additionalProperties: {
103
+ type: 'number',
104
+ },
105
+ },
106
+ ExecutionResult: {
107
+ type: 'object',
108
+ properties: {
109
+ durationMs: {
110
+ type: 'number',
111
+ },
112
+ instructions: {
113
+ type: 'integer',
114
+ },
115
+ returnValue: {},
116
+ replies: {
117
+ type: 'object',
118
+ properties: {
119
+ count: {
120
+ type: 'integer',
121
+ },
122
+ lastPayload: {},
123
+ },
124
+ required: ['count'],
125
+ additionalProperties: false,
126
+ },
127
+ counters: {
128
+ type: 'object',
129
+ properties: {
130
+ dbOps: {
131
+ type: 'integer',
132
+ },
133
+ httpCalls: {
134
+ type: 'integer',
135
+ },
136
+ },
137
+ required: ['dbOps', 'httpCalls'],
138
+ additionalProperties: false,
139
+ },
140
+ explain: {
141
+ type: 'object',
142
+ additionalProperties: true,
143
+ description: 'JSON execution input, at most 8 KiB encoded. Available as ctx.input.',
144
+ },
145
+ },
146
+ required: ['durationMs', 'instructions', 'replies'],
147
+ additionalProperties: false,
148
+ },
149
+ ExecuteResponse: {
150
+ type: 'object',
151
+ properties: {
152
+ success: {
153
+ type: 'boolean',
154
+ },
155
+ mocked: {
156
+ type: 'boolean',
157
+ },
158
+ error: {
159
+ $ref: '#/components/schemas/Diagnostic',
160
+ },
161
+ executionResult: {
162
+ $ref: '#/components/schemas/ExecutionResult',
163
+ },
164
+ replies: {
165
+ type: 'array',
166
+ items: {},
167
+ },
168
+ metrics: {
169
+ type: 'object',
170
+ additionalProperties: true,
171
+ description: 'JSON execution input, at most 8 KiB encoded. Available as ctx.input.',
172
+ },
173
+ telemetryRecorded: {
174
+ type: 'boolean',
175
+ },
176
+ executionId: {
177
+ anyOf: [
178
+ {
179
+ type: 'string',
180
+ },
181
+ {
182
+ type: 'null',
183
+ },
184
+ ],
185
+ },
186
+ replayed: {
187
+ type: 'boolean',
188
+ },
189
+ originalResultOmitted: {
190
+ type: 'boolean',
191
+ },
192
+ },
193
+ required: ['success'],
194
+ additionalProperties: true,
195
+ },
196
+ Policy: {
197
+ type: 'object',
198
+ additionalProperties: true,
199
+ description: 'JSON execution input, at most 8 KiB encoded. Available as ctx.input.',
200
+ },
201
+ Execution: {
202
+ type: 'object',
203
+ properties: {
204
+ id: {
205
+ type: 'string',
206
+ },
207
+ scriptName: {
208
+ anyOf: [
209
+ {
210
+ type: 'string',
211
+ },
212
+ {
213
+ type: 'null',
214
+ },
215
+ ],
216
+ },
217
+ mode: {
218
+ type: 'string',
219
+ },
220
+ status: {
221
+ type: 'string',
222
+ },
223
+ durationMs: {
224
+ type: 'number',
225
+ },
226
+ instructionsUsed: {
227
+ type: 'integer',
228
+ },
229
+ errorCode: {
230
+ anyOf: [
231
+ {
232
+ type: 'string',
233
+ },
234
+ {
235
+ type: 'null',
236
+ },
237
+ ],
238
+ },
239
+ httpCalls: {
240
+ type: 'integer',
241
+ },
242
+ dbOps: {
243
+ type: 'integer',
244
+ },
245
+ errorMessage: {
246
+ anyOf: [
247
+ {
248
+ type: 'string',
249
+ },
250
+ {
251
+ type: 'null',
252
+ },
253
+ ],
254
+ },
255
+ hasSource: {
256
+ type: 'boolean',
257
+ },
258
+ timings: {
259
+ $ref: '#/components/schemas/Timings',
260
+ },
261
+ createdAt: {
262
+ type: 'string',
263
+ format: 'date-time',
264
+ },
265
+ expiresAt: {
266
+ type: 'string',
267
+ format: 'date-time',
268
+ },
269
+ },
270
+ required: ['id', 'mode', 'status', 'durationMs', 'instructionsUsed', 'createdAt'],
271
+ additionalProperties: true,
272
+ },
273
+ ExecutionDetail: {
274
+ type: 'object',
275
+ properties: {
276
+ id: {
277
+ type: 'string',
278
+ },
279
+ scriptName: {
280
+ anyOf: [
281
+ {
282
+ type: 'string',
283
+ },
284
+ {
285
+ type: 'null',
286
+ },
287
+ ],
288
+ },
289
+ mode: {
290
+ type: 'string',
291
+ },
292
+ status: {
293
+ type: 'string',
294
+ },
295
+ durationMs: {
296
+ type: 'number',
297
+ },
298
+ instructionsUsed: {
299
+ type: 'integer',
300
+ },
301
+ errorCode: {
302
+ anyOf: [
303
+ {
304
+ type: 'string',
305
+ },
306
+ {
307
+ type: 'null',
308
+ },
309
+ ],
310
+ },
311
+ httpCalls: {
312
+ type: 'integer',
313
+ },
314
+ dbOps: {
315
+ type: 'integer',
316
+ },
317
+ errorMessage: {
318
+ anyOf: [
319
+ {
320
+ type: 'string',
321
+ },
322
+ {
323
+ type: 'null',
324
+ },
325
+ ],
326
+ },
327
+ hasSource: {
328
+ type: 'boolean',
329
+ },
330
+ timings: {
331
+ $ref: '#/components/schemas/Timings',
332
+ },
333
+ createdAt: {
334
+ type: 'string',
335
+ format: 'date-time',
336
+ },
337
+ expiresAt: {
338
+ type: 'string',
339
+ format: 'date-time',
340
+ },
341
+ sourceCode: {
342
+ anyOf: [
343
+ {
344
+ type: 'string',
345
+ },
346
+ {
347
+ type: 'null',
348
+ },
349
+ ],
350
+ },
351
+ outputPreview: {
352
+ anyOf: [
353
+ {
354
+ type: 'string',
355
+ },
356
+ {
357
+ type: 'null',
358
+ },
359
+ ],
360
+ },
361
+ },
362
+ required: ['id', 'mode', 'status', 'durationMs', 'instructionsUsed', 'createdAt'],
363
+ additionalProperties: true,
364
+ },
365
+ ExecutionPage: {
366
+ type: 'object',
367
+ properties: {
368
+ items: {
369
+ type: 'array',
370
+ items: {
371
+ $ref: '#/components/schemas/Execution',
372
+ },
373
+ },
374
+ nextCursor: {
375
+ anyOf: [
376
+ {
377
+ type: 'string',
378
+ },
379
+ {
380
+ type: 'null',
381
+ },
382
+ ],
383
+ },
384
+ policy: {
385
+ $ref: '#/components/schemas/Policy',
386
+ },
387
+ },
388
+ required: ['items', 'nextCursor', 'policy'],
389
+ additionalProperties: false,
390
+ },
391
+ Script: {
392
+ type: 'object',
393
+ properties: {
394
+ id: {
395
+ type: 'string',
396
+ format: 'uuid',
397
+ },
398
+ name: {
399
+ type: 'string',
400
+ },
401
+ currentVersion: {
402
+ type: 'integer',
403
+ },
404
+ createdAt: {
405
+ type: 'string',
406
+ format: 'date-time',
407
+ },
408
+ updatedAt: {
409
+ type: 'string',
410
+ format: 'date-time',
411
+ },
412
+ },
413
+ required: ['id', 'name', 'currentVersion', 'createdAt', 'updatedAt'],
414
+ additionalProperties: false,
415
+ },
416
+ ScriptDetail: {
417
+ type: 'object',
418
+ properties: {
419
+ id: {
420
+ type: 'string',
421
+ format: 'uuid',
422
+ },
423
+ name: {
424
+ type: 'string',
425
+ },
426
+ currentVersion: {
427
+ type: 'integer',
428
+ },
429
+ createdAt: {
430
+ type: 'string',
431
+ format: 'date-time',
432
+ },
433
+ updatedAt: {
434
+ type: 'string',
435
+ format: 'date-time',
436
+ },
437
+ code: {
438
+ type: 'string',
439
+ },
440
+ versions: {
441
+ type: 'array',
442
+ items: {
443
+ type: 'object',
444
+ properties: {
445
+ version: {
446
+ type: 'integer',
447
+ },
448
+ createdAt: {
449
+ type: 'string',
450
+ format: 'date-time',
451
+ },
452
+ bytes: {
453
+ type: 'integer',
454
+ },
455
+ },
456
+ required: ['version', 'createdAt', 'bytes'],
457
+ additionalProperties: false,
458
+ },
459
+ },
460
+ },
461
+ required: ['id', 'name', 'currentVersion', 'createdAt', 'updatedAt', 'code', 'versions'],
462
+ additionalProperties: true,
463
+ },
464
+ ScriptList: {
465
+ type: 'object',
466
+ properties: {
467
+ items: {
468
+ type: 'array',
469
+ items: {
470
+ $ref: '#/components/schemas/Script',
471
+ },
472
+ },
473
+ policy: {
474
+ $ref: '#/components/schemas/Policy',
475
+ },
476
+ },
477
+ required: ['items', 'policy'],
478
+ additionalProperties: false,
479
+ },
480
+ ScriptCreate: {
481
+ type: 'object',
482
+ properties: {
483
+ name: {
484
+ type: 'string',
485
+ minLength: 1,
486
+ maxLength: 80,
487
+ pattern: '\\S',
488
+ },
489
+ code: {
490
+ type: 'string',
491
+ minLength: 1,
492
+ maxLength: 6000,
493
+ },
494
+ },
495
+ required: ['name', 'code'],
496
+ additionalProperties: false,
497
+ },
498
+ ScriptUpdate: {
499
+ type: 'object',
500
+ properties: {
501
+ name: {
502
+ type: 'string',
503
+ minLength: 1,
504
+ maxLength: 80,
505
+ pattern: '\\S',
506
+ },
507
+ code: {
508
+ type: 'string',
509
+ minLength: 1,
510
+ maxLength: 6000,
511
+ },
512
+ expectedVersion: {
513
+ type: 'integer',
514
+ minimum: 1,
515
+ maximum: 2147483646,
516
+ },
517
+ },
518
+ required: ['name', 'code', 'expectedVersion'],
519
+ additionalProperties: false,
520
+ },
521
+ ScriptRestore: {
522
+ type: 'object',
523
+ properties: {
524
+ version: {
525
+ type: 'integer',
526
+ minimum: 1,
527
+ maximum: 2147483646,
528
+ },
529
+ expectedVersion: {
530
+ type: 'integer',
531
+ minimum: 1,
532
+ maximum: 2147483646,
533
+ },
534
+ },
535
+ required: ['version', 'expectedVersion'],
536
+ additionalProperties: false,
537
+ },
538
+ ScriptVersion: {
539
+ type: 'object',
540
+ properties: {
541
+ version: {
542
+ type: 'integer',
543
+ },
544
+ code: {
545
+ type: 'string',
546
+ },
547
+ createdAt: {
548
+ type: 'string',
549
+ format: 'date-time',
550
+ },
551
+ },
552
+ required: ['version', 'code', 'createdAt'],
553
+ additionalProperties: false,
554
+ },
555
+ Deleted: {
556
+ type: 'object',
557
+ properties: {
558
+ deleted: {
559
+ type: 'boolean',
560
+ },
561
+ },
562
+ required: ['deleted'],
563
+ additionalProperties: false,
564
+ },
565
+ Storage: {
566
+ type: 'object',
567
+ properties: {
568
+ policy: {
569
+ $ref: '#/components/schemas/Policy',
570
+ },
571
+ history: {
572
+ type: 'object',
573
+ properties: {
574
+ count: {
575
+ type: 'integer',
576
+ },
577
+ bytes: {
578
+ type: 'integer',
579
+ },
580
+ },
581
+ required: ['count', 'bytes'],
582
+ additionalProperties: false,
583
+ },
584
+ scripts: {
585
+ type: 'object',
586
+ properties: {
587
+ count: {
588
+ type: 'integer',
589
+ },
590
+ versions: {
591
+ type: 'integer',
592
+ },
593
+ bytes: {
594
+ type: 'integer',
595
+ },
596
+ },
597
+ required: ['count', 'versions', 'bytes'],
598
+ additionalProperties: false,
599
+ },
600
+ },
601
+ required: ['policy', 'history', 'scripts'],
602
+ additionalProperties: false,
603
+ },
604
+ Secret: {
605
+ type: 'object',
606
+ properties: {
607
+ name: {
608
+ type: 'string',
609
+ pattern: '^[A-Z][A-Z0-9_]{0,63}$',
610
+ },
611
+ allowInline: {
612
+ type: 'boolean',
613
+ },
614
+ scriptIds: {
615
+ type: 'array',
616
+ items: {
617
+ type: 'string',
618
+ format: 'uuid',
619
+ },
620
+ },
621
+ version: {
622
+ type: 'integer',
623
+ },
624
+ createdAt: {
625
+ type: 'string',
626
+ format: 'date-time',
627
+ },
628
+ updatedAt: {
629
+ type: 'string',
630
+ format: 'date-time',
631
+ },
632
+ },
633
+ required: ['name', 'allowInline', 'scriptIds', 'version', 'createdAt', 'updatedAt'],
634
+ additionalProperties: false,
635
+ },
636
+ SecretList: {
637
+ type: 'object',
638
+ properties: {
639
+ items: {
640
+ type: 'array',
641
+ items: {
642
+ $ref: '#/components/schemas/Secret',
643
+ },
644
+ },
645
+ },
646
+ required: ['items'],
647
+ additionalProperties: false,
648
+ },
649
+ SecretCreate: {
650
+ type: 'object',
651
+ properties: {
652
+ name: {
653
+ type: 'string',
654
+ pattern: '^[A-Z][A-Z0-9_]{0,63}$',
655
+ },
656
+ value: {
657
+ type: 'string',
658
+ minLength: 8,
659
+ maxLength: 4096,
660
+ writeOnly: true,
661
+ description: 'Write-only credential: 8–4096 UTF-8 bytes; never returned. No null characters or malformed Unicode.',
662
+ },
663
+ allowInline: {
664
+ type: 'boolean',
665
+ default: false,
666
+ },
667
+ scriptIds: {
668
+ type: 'array',
669
+ items: {
670
+ type: 'string',
671
+ format: 'uuid',
672
+ },
673
+ maxItems: 10,
674
+ uniqueItems: true,
675
+ },
676
+ },
677
+ required: ['name', 'value'],
678
+ additionalProperties: false,
679
+ },
680
+ SecretUpdate: {
681
+ type: 'object',
682
+ properties: {
683
+ value: {
684
+ type: 'string',
685
+ minLength: 8,
686
+ maxLength: 4096,
687
+ writeOnly: true,
688
+ description: 'Write-only credential: 8–4096 UTF-8 bytes; never returned. No null characters or malformed Unicode.',
689
+ },
690
+ allowInline: {
691
+ type: 'boolean',
692
+ },
693
+ scriptIds: {
694
+ type: 'array',
695
+ items: {
696
+ type: 'string',
697
+ format: 'uuid',
698
+ },
699
+ maxItems: 10,
700
+ uniqueItems: true,
701
+ },
702
+ },
703
+ required: [],
704
+ additionalProperties: false,
705
+ minProperties: 1,
706
+ },
707
+ SandboxLimits: {
708
+ type: 'object',
709
+ properties: {
710
+ timeoutMs: {
711
+ type: 'integer',
712
+ },
713
+ maxInstructions: {
714
+ type: 'integer',
715
+ },
716
+ maxMemoryMb: {
717
+ type: 'integer',
718
+ },
719
+ },
720
+ required: ['timeoutMs', 'maxInstructions', 'maxMemoryMb'],
721
+ additionalProperties: false,
722
+ },
723
+ Sandbox: {
724
+ type: 'object',
725
+ properties: {
726
+ plan: {
727
+ type: 'string',
728
+ },
729
+ configurable: {
730
+ type: 'boolean',
731
+ },
732
+ limits: {
733
+ $ref: '#/components/schemas/SandboxLimits',
734
+ },
735
+ defaults: {
736
+ $ref: '#/components/schemas/SandboxLimits',
737
+ },
738
+ maxLimits: {
739
+ $ref: '#/components/schemas/SandboxLimits',
740
+ },
741
+ },
742
+ required: ['plan', 'configurable', 'limits', 'defaults', 'maxLimits'],
743
+ additionalProperties: false,
744
+ },
745
+ Plan: {
746
+ type: 'object',
747
+ properties: {
748
+ id: {
749
+ type: 'string',
750
+ },
751
+ configurable: {
752
+ type: 'boolean',
753
+ },
754
+ limits: {
755
+ $ref: '#/components/schemas/SandboxLimits',
756
+ },
757
+ maxLimits: {
758
+ $ref: '#/components/schemas/SandboxLimits',
759
+ },
760
+ name: {
761
+ type: 'string',
762
+ },
763
+ monthlyUsd: {
764
+ anyOf: [
765
+ {
766
+ type: 'number',
767
+ },
768
+ {
769
+ type: 'null',
770
+ },
771
+ ],
772
+ },
773
+ yearlyMonthlyUsd: {
774
+ anyOf: [
775
+ {
776
+ type: 'number',
777
+ },
778
+ {
779
+ type: 'null',
780
+ },
781
+ ],
782
+ },
783
+ usageUsdPer1k: {
784
+ type: 'number',
785
+ },
786
+ executionsPerMonth: {
787
+ anyOf: [
788
+ {
789
+ type: 'integer',
790
+ },
791
+ {
792
+ type: 'null',
793
+ },
794
+ ],
795
+ },
796
+ timeoutMs: {
797
+ type: 'integer',
798
+ },
799
+ features: {
800
+ type: 'array',
801
+ items: {
802
+ type: 'string',
803
+ },
804
+ },
805
+ },
806
+ required: ['id', 'name', 'limits', 'executionsPerMonth'],
807
+ additionalProperties: true,
808
+ },
809
+ Plans: {
810
+ type: 'object',
811
+ properties: {
812
+ configured: {
813
+ type: 'boolean',
814
+ },
815
+ plans: {
816
+ type: 'array',
817
+ items: {
818
+ $ref: '#/components/schemas/Plan',
819
+ },
820
+ },
821
+ },
822
+ required: ['configured', 'plans'],
823
+ additionalProperties: false,
824
+ },
825
+ BillingStatus: {
826
+ type: 'object',
827
+ properties: {
828
+ configured: {
829
+ type: 'boolean',
830
+ },
831
+ plan: {
832
+ $ref: '#/components/schemas/Plan',
833
+ },
834
+ subscription: {
835
+ anyOf: [
836
+ {
837
+ type: 'object',
838
+ properties: {
839
+ status: {
840
+ type: 'string',
841
+ },
842
+ interval: {
843
+ anyOf: [
844
+ {
845
+ type: 'string',
846
+ },
847
+ {
848
+ type: 'null',
849
+ },
850
+ ],
851
+ },
852
+ currentPeriodEnd: {
853
+ anyOf: [
854
+ {
855
+ type: 'string',
856
+ format: 'date-time',
857
+ },
858
+ {
859
+ type: 'null',
860
+ },
861
+ ],
862
+ },
863
+ cancelAtPeriodEnd: {
864
+ type: 'boolean',
865
+ },
866
+ hasCustomer: {
867
+ type: 'boolean',
868
+ },
869
+ },
870
+ required: [],
871
+ additionalProperties: true,
872
+ },
873
+ {
874
+ type: 'null',
875
+ },
876
+ ],
877
+ },
878
+ usage: {
879
+ type: 'object',
880
+ properties: {
881
+ executions: {
882
+ type: 'integer',
883
+ },
884
+ limit: {
885
+ anyOf: [
886
+ {
887
+ type: 'integer',
888
+ },
889
+ {
890
+ type: 'null',
891
+ },
892
+ ],
893
+ },
894
+ resetsAt: {
895
+ type: 'string',
896
+ format: 'date-time',
897
+ },
898
+ },
899
+ required: ['executions', 'limit', 'resetsAt'],
900
+ additionalProperties: false,
901
+ },
902
+ },
903
+ required: ['configured', 'plan', 'subscription', 'usage'],
904
+ additionalProperties: false,
905
+ },
906
+ UsageSummary: {
907
+ type: 'object',
908
+ properties: {
909
+ windowDays: {
910
+ type: 'integer',
911
+ },
912
+ totalExecutions: {
913
+ type: 'integer',
914
+ },
915
+ successfulExecutions: {
916
+ type: 'integer',
917
+ },
918
+ failedExecutions: {
919
+ type: 'integer',
920
+ },
921
+ averageDurationMs: {
922
+ type: 'number',
923
+ },
924
+ latest: {
925
+ type: 'array',
926
+ items: {
927
+ type: 'object',
928
+ additionalProperties: true,
929
+ description: 'JSON execution input, at most 8 KiB encoded. Available as ctx.input.',
930
+ },
931
+ },
932
+ },
933
+ required: [
934
+ 'windowDays',
935
+ 'totalExecutions',
936
+ 'successfulExecutions',
937
+ 'failedExecutions',
938
+ 'averageDurationMs',
939
+ 'latest',
940
+ ],
941
+ additionalProperties: false,
942
+ },
943
+ UsageHistory: {
944
+ type: 'object',
945
+ properties: {
946
+ days: {
947
+ type: 'integer',
948
+ },
949
+ total: {
950
+ type: 'integer',
951
+ },
952
+ success: {
953
+ type: 'integer',
954
+ },
955
+ failed: {
956
+ type: 'integer',
957
+ },
958
+ successRate: {
959
+ type: 'number',
960
+ },
961
+ daily: {
962
+ type: 'array',
963
+ items: {
964
+ type: 'object',
965
+ properties: {
966
+ date: {
967
+ type: 'string',
968
+ },
969
+ total: {
970
+ type: 'integer',
971
+ },
972
+ success: {
973
+ type: 'integer',
974
+ },
975
+ failed: {
976
+ type: 'integer',
977
+ },
978
+ avgDurationMs: {
979
+ type: 'number',
980
+ },
981
+ },
982
+ required: ['date', 'total', 'success', 'failed', 'avgDurationMs'],
983
+ additionalProperties: false,
984
+ },
985
+ },
986
+ topScripts: {
987
+ type: 'array',
988
+ items: {
989
+ type: 'object',
990
+ properties: {
991
+ name: {
992
+ type: 'string',
993
+ },
994
+ count: {
995
+ type: 'integer',
996
+ },
997
+ },
998
+ required: ['name', 'count'],
999
+ additionalProperties: false,
1000
+ },
1001
+ },
1002
+ topScriptsSample: {
1003
+ type: 'object',
1004
+ properties: {
1005
+ days: {
1006
+ type: 'integer',
1007
+ },
1008
+ limit: {
1009
+ type: 'integer',
1010
+ },
1011
+ },
1012
+ required: ['days', 'limit'],
1013
+ additionalProperties: false,
1014
+ },
1015
+ apiKeys: {
1016
+ type: 'object',
1017
+ properties: {
1018
+ active: {
1019
+ type: 'integer',
1020
+ },
1021
+ lastUsedAt: {
1022
+ anyOf: [
1023
+ {
1024
+ type: 'string',
1025
+ format: 'date-time',
1026
+ },
1027
+ {
1028
+ type: 'null',
1029
+ },
1030
+ ],
1031
+ },
1032
+ },
1033
+ required: ['active', 'lastUsedAt'],
1034
+ additionalProperties: false,
1035
+ },
1036
+ },
1037
+ required: [
1038
+ 'days',
1039
+ 'total',
1040
+ 'success',
1041
+ 'failed',
1042
+ 'successRate',
1043
+ 'daily',
1044
+ 'topScripts',
1045
+ 'topScriptsSample',
1046
+ 'apiKeys',
1047
+ ],
1048
+ additionalProperties: false,
1049
+ },
1050
+ TelemetryExecution: {
1051
+ type: 'object',
1052
+ properties: {
1053
+ scriptName: {
1054
+ type: 'string',
1055
+ maxLength: 200,
1056
+ },
1057
+ mode: {
1058
+ type: 'string',
1059
+ maxLength: 40,
1060
+ },
1061
+ status: {
1062
+ type: 'string',
1063
+ maxLength: 40,
1064
+ },
1065
+ durationMs: {
1066
+ type: 'integer',
1067
+ minimum: 0,
1068
+ maximum: 86400000,
1069
+ },
1070
+ instructionsUsed: {
1071
+ type: 'integer',
1072
+ minimum: 0,
1073
+ },
1074
+ memoryUsageKb: {
1075
+ type: 'integer',
1076
+ minimum: 0,
1077
+ },
1078
+ errorCode: {
1079
+ type: 'string',
1080
+ maxLength: 100,
1081
+ },
1082
+ metadata: {
1083
+ type: 'object',
1084
+ additionalProperties: true,
1085
+ description: 'JSON execution input, at most 8 KiB encoded. Available as ctx.input.',
1086
+ },
1087
+ },
1088
+ required: ['status', 'durationMs', 'instructionsUsed'],
1089
+ additionalProperties: false,
1090
+ },
1091
+ TelemetryEvent: {
1092
+ type: 'object',
1093
+ properties: {
1094
+ eventName: {
1095
+ type: 'string',
1096
+ maxLength: 80,
1097
+ },
1098
+ pagePath: {
1099
+ type: 'string',
1100
+ maxLength: 300,
1101
+ },
1102
+ sessionId: {
1103
+ type: 'string',
1104
+ maxLength: 100,
1105
+ },
1106
+ fingerprintHash: {
1107
+ type: 'string',
1108
+ maxLength: 128,
1109
+ },
1110
+ properties: {
1111
+ type: 'object',
1112
+ additionalProperties: {
1113
+ anyOf: [
1114
+ {
1115
+ type: 'string',
1116
+ },
1117
+ {
1118
+ type: 'number',
1119
+ },
1120
+ {
1121
+ type: 'boolean',
1122
+ },
1123
+ {
1124
+ type: 'null',
1125
+ },
1126
+ ],
1127
+ },
1128
+ },
1129
+ },
1130
+ required: ['eventName'],
1131
+ additionalProperties: false,
1132
+ },
1133
+ TelemetryRecorded: {
1134
+ anyOf: [
1135
+ {
1136
+ type: 'object',
1137
+ additionalProperties: true,
1138
+ description: 'JSON execution input, at most 8 KiB encoded. Available as ctx.input.',
1139
+ },
1140
+ {
1141
+ type: 'string',
1142
+ },
1143
+ {
1144
+ type: 'null',
1145
+ },
1146
+ ],
1147
+ },
1148
+ Accepted: {
1149
+ type: 'object',
1150
+ properties: {
1151
+ accepted: {
1152
+ type: 'boolean',
1153
+ },
1154
+ },
1155
+ required: ['accepted'],
1156
+ additionalProperties: false,
1157
+ },
1158
+ Health: {
1159
+ type: 'object',
1160
+ properties: {
1161
+ status: {
1162
+ type: 'string',
1163
+ enum: ['operational', 'degraded'],
1164
+ },
1165
+ timestamp: {
1166
+ type: 'string',
1167
+ format: 'date-time',
1168
+ },
1169
+ services: {
1170
+ type: 'array',
1171
+ items: {
1172
+ type: 'object',
1173
+ properties: {
1174
+ id: {
1175
+ type: 'string',
1176
+ },
1177
+ name: {
1178
+ type: 'string',
1179
+ },
1180
+ status: {
1181
+ type: 'string',
1182
+ enum: ['operational', 'degraded'],
1183
+ },
1184
+ },
1185
+ required: ['id', 'name', 'status'],
1186
+ additionalProperties: false,
1187
+ },
1188
+ },
1189
+ },
1190
+ required: ['status', 'timestamp', 'services'],
1191
+ additionalProperties: false,
1192
+ },
1193
+ },
1194
+ operations: [
1195
+ {
1196
+ id: 'execute',
1197
+ method: 'POST',
1198
+ path: '/api/runtime/execute',
1199
+ request: 'ExecuteRequest',
1200
+ response: 'ExecuteResponse',
1201
+ scope: 'scripts:execute',
1202
+ },
1203
+ {
1204
+ id: 'executions.list',
1205
+ method: 'GET',
1206
+ path: '/api/workspace/history',
1207
+ request: null,
1208
+ response: 'ExecutionPage',
1209
+ scope: 'executions:read',
1210
+ },
1211
+ {
1212
+ id: 'executions.get',
1213
+ method: 'GET',
1214
+ path: '/api/workspace/history/{id}',
1215
+ request: null,
1216
+ response: 'ExecutionDetail',
1217
+ scope: 'executions:read',
1218
+ },
1219
+ {
1220
+ id: 'scripts.list',
1221
+ method: 'GET',
1222
+ path: '/api/workspace/scripts',
1223
+ request: null,
1224
+ response: 'ScriptList',
1225
+ scope: 'scripts:read',
1226
+ },
1227
+ {
1228
+ id: 'scripts.create',
1229
+ method: 'POST',
1230
+ path: '/api/workspace/scripts',
1231
+ request: 'ScriptCreate',
1232
+ response: 'Script',
1233
+ scope: 'scripts:write',
1234
+ },
1235
+ {
1236
+ id: 'scripts.get',
1237
+ method: 'GET',
1238
+ path: '/api/workspace/scripts/{id}',
1239
+ request: null,
1240
+ response: 'ScriptDetail',
1241
+ scope: 'scripts:read',
1242
+ },
1243
+ {
1244
+ id: 'scripts.update',
1245
+ method: 'PATCH',
1246
+ path: '/api/workspace/scripts/{id}',
1247
+ request: 'ScriptUpdate',
1248
+ response: 'Script',
1249
+ scope: 'scripts:write',
1250
+ },
1251
+ {
1252
+ id: 'scripts.delete',
1253
+ method: 'DELETE',
1254
+ path: '/api/workspace/scripts/{id}',
1255
+ request: null,
1256
+ response: 'Deleted',
1257
+ scope: 'scripts:write',
1258
+ },
1259
+ {
1260
+ id: 'scripts.getVersion',
1261
+ method: 'GET',
1262
+ path: '/api/workspace/scripts/{id}/versions/{version}',
1263
+ request: null,
1264
+ response: 'ScriptVersion',
1265
+ scope: 'scripts:read',
1266
+ },
1267
+ {
1268
+ id: 'scripts.restore',
1269
+ method: 'POST',
1270
+ path: '/api/workspace/scripts/{id}/restore',
1271
+ request: 'ScriptRestore',
1272
+ response: 'Script',
1273
+ scope: 'scripts:write',
1274
+ },
1275
+ {
1276
+ id: 'scripts.storage',
1277
+ method: 'GET',
1278
+ path: '/api/workspace/storage',
1279
+ request: null,
1280
+ response: 'Storage',
1281
+ scope: 'scripts:read',
1282
+ },
1283
+ {
1284
+ id: 'secrets.list',
1285
+ method: 'GET',
1286
+ path: '/api/secrets',
1287
+ request: null,
1288
+ response: 'SecretList',
1289
+ scope: 'secrets:read',
1290
+ },
1291
+ {
1292
+ id: 'secrets.create',
1293
+ method: 'POST',
1294
+ path: '/api/secrets',
1295
+ request: 'SecretCreate',
1296
+ response: 'Secret',
1297
+ scope: 'secrets:write',
1298
+ },
1299
+ {
1300
+ id: 'secrets.get',
1301
+ method: 'GET',
1302
+ path: '/api/secrets/{name}',
1303
+ request: null,
1304
+ response: 'Secret',
1305
+ scope: 'secrets:read',
1306
+ },
1307
+ {
1308
+ id: 'secrets.update',
1309
+ method: 'PATCH',
1310
+ path: '/api/secrets/{name}',
1311
+ request: 'SecretUpdate',
1312
+ response: 'Secret',
1313
+ scope: 'secrets:write',
1314
+ },
1315
+ {
1316
+ id: 'secrets.delete',
1317
+ method: 'DELETE',
1318
+ path: '/api/secrets/{name}',
1319
+ request: null,
1320
+ response: 'Deleted',
1321
+ scope: 'secrets:write',
1322
+ },
1323
+ {
1324
+ id: 'usage.get',
1325
+ method: 'GET',
1326
+ path: '/api/billing/status',
1327
+ request: null,
1328
+ response: 'BillingStatus',
1329
+ scope: 'usage:read',
1330
+ },
1331
+ {
1332
+ id: 'usage.summary',
1333
+ method: 'GET',
1334
+ path: '/api/telemetry/summary',
1335
+ request: null,
1336
+ response: 'UsageSummary',
1337
+ scope: 'usage:read',
1338
+ },
1339
+ {
1340
+ id: 'usage.history',
1341
+ method: 'GET',
1342
+ path: '/api/telemetry/usage',
1343
+ request: null,
1344
+ response: 'UsageHistory',
1345
+ scope: 'usage:read',
1346
+ },
1347
+ {
1348
+ id: 'sandbox.get',
1349
+ method: 'GET',
1350
+ path: '/api/billing/sandbox',
1351
+ request: null,
1352
+ response: 'Sandbox',
1353
+ scope: 'scripts:read',
1354
+ },
1355
+ {
1356
+ id: 'billing.plans',
1357
+ method: 'GET',
1358
+ path: '/api/billing/plans',
1359
+ request: null,
1360
+ response: 'Plans',
1361
+ scope: null,
1362
+ },
1363
+ {
1364
+ id: 'telemetry.recordExecution',
1365
+ method: 'POST',
1366
+ path: '/api/telemetry/executions',
1367
+ request: 'TelemetryExecution',
1368
+ response: 'TelemetryRecorded',
1369
+ scope: 'telemetry:write',
1370
+ },
1371
+ {
1372
+ id: 'telemetry.recordEvent',
1373
+ method: 'POST',
1374
+ path: '/api/telemetry/events',
1375
+ request: 'TelemetryEvent',
1376
+ response: 'Accepted',
1377
+ scope: 'telemetry:write',
1378
+ },
1379
+ {
1380
+ id: 'health.get',
1381
+ method: 'GET',
1382
+ path: '/api/health',
1383
+ request: null,
1384
+ response: 'Health',
1385
+ scope: null,
1386
+ },
1387
+ ],
1388
+ };