@ekanos/integration-schema 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,1771 @@
1
+ /**
2
+ * The canonical integration-definition contract: ONE zod schema and ONE set
3
+ * of inferred/hand-written types (F9). `@ekanos/sdk`'s `defineIntegration()`
4
+ * validates against this schema at authoring time; `@kit/integrations-core`'s
5
+ * `registerPartnerIntegration()` re-validates against the SAME schema at the
6
+ * host trust boundary (F3). Both packages depend on this one; it depends on
7
+ * neither, so there is no cycle and no hand-written structural twin.
8
+ *
9
+ * Dependency-pure (zod only): partner component refs are checked
10
+ * structurally via `ComponentReference`, so no React dependency leaks in.
11
+ */
12
+ import { z } from 'zod';
13
+ import type { IntegrationContext, StorageKeyDeclarationInput, StorageSchemas } from './capability-context.js';
14
+ import type { ComponentReference } from './component-reference.js';
15
+ import { type WorkspaceTargetDefinition } from './workspace-target.js';
16
+ type JsonPrimitive = string | number | boolean | null;
17
+ export type JsonValue = JsonPrimitive | JsonValue[] | {
18
+ [key: string]: JsonValue;
19
+ };
20
+ declare const capabilitySchema: z.ZodObject<{
21
+ label: z.ZodString;
22
+ description: z.ZodString;
23
+ icon: z.ZodOptional<z.ZodType<ComponentReference, z.ZodTypeDef, ComponentReference>>;
24
+ }, "strict", z.ZodTypeAny, {
25
+ description: string;
26
+ label: string;
27
+ icon?: ComponentReference | undefined;
28
+ }, {
29
+ description: string;
30
+ label: string;
31
+ icon?: ComponentReference | undefined;
32
+ }>;
33
+ declare const permissionSchema: z.ZodObject<{
34
+ label: z.ZodString;
35
+ detail: z.ZodString;
36
+ type: z.ZodEnum<["read", "write"]>;
37
+ }, "strict", z.ZodTypeAny, {
38
+ type: "read" | "write";
39
+ label: string;
40
+ detail: string;
41
+ }, {
42
+ type: "read" | "write";
43
+ label: string;
44
+ detail: string;
45
+ }>;
46
+ /**
47
+ * F7: authorable widget fields ONLY. Host-resolved fields (`productId`,
48
+ * `widgetConfigId`, `workspaceId`, `collapsed`, `isPinned`, `health`,
49
+ * `integrationMetadata`) are absent by design and rejected at runtime by
50
+ * `.strict()` — the type and the runtime agree. The host adapter maps this
51
+ * into the full `WidgetConfig`.
52
+ */
53
+ declare const widgetSchema: z.ZodObject<{
54
+ id: z.ZodString;
55
+ name: z.ZodString;
56
+ component: z.ZodType<ComponentReference, z.ZodTypeDef, ComponentReference>;
57
+ widgetState: z.ZodEnum<["active", "inactive", "disabled"]>;
58
+ gridSize: z.ZodOptional<z.ZodUnion<[z.ZodObject<{
59
+ cols: z.ZodNumber;
60
+ rows: z.ZodNumber;
61
+ }, "strict", z.ZodTypeAny, {
62
+ cols: number;
63
+ rows: number;
64
+ }, {
65
+ cols: number;
66
+ rows: number;
67
+ }>, z.ZodArray<z.ZodObject<{
68
+ cols: z.ZodNumber;
69
+ rows: z.ZodNumber;
70
+ }, "strict", z.ZodTypeAny, {
71
+ cols: number;
72
+ rows: number;
73
+ }, {
74
+ cols: number;
75
+ rows: number;
76
+ }>, "many">]>>;
77
+ gridPosition: z.ZodOptional<z.ZodObject<{
78
+ col: z.ZodNumber;
79
+ row: z.ZodNumber;
80
+ }, "strict", z.ZodTypeAny, {
81
+ col: number;
82
+ row: number;
83
+ }, {
84
+ col: number;
85
+ row: number;
86
+ }>>;
87
+ layouts: z.ZodOptional<z.ZodObject<{
88
+ lg: z.ZodOptional<z.ZodObject<{
89
+ x: z.ZodNumber;
90
+ y: z.ZodNumber;
91
+ w: z.ZodNumber;
92
+ h: z.ZodNumber;
93
+ maxHeight: z.ZodOptional<z.ZodNumber>;
94
+ }, "strict", z.ZodTypeAny, {
95
+ x: number;
96
+ y: number;
97
+ w: number;
98
+ h: number;
99
+ maxHeight?: number | undefined;
100
+ }, {
101
+ x: number;
102
+ y: number;
103
+ w: number;
104
+ h: number;
105
+ maxHeight?: number | undefined;
106
+ }>>;
107
+ md: z.ZodOptional<z.ZodObject<{
108
+ x: z.ZodNumber;
109
+ y: z.ZodNumber;
110
+ w: z.ZodNumber;
111
+ h: z.ZodNumber;
112
+ maxHeight: z.ZodOptional<z.ZodNumber>;
113
+ }, "strict", z.ZodTypeAny, {
114
+ x: number;
115
+ y: number;
116
+ w: number;
117
+ h: number;
118
+ maxHeight?: number | undefined;
119
+ }, {
120
+ x: number;
121
+ y: number;
122
+ w: number;
123
+ h: number;
124
+ maxHeight?: number | undefined;
125
+ }>>;
126
+ sm: z.ZodOptional<z.ZodObject<{
127
+ x: z.ZodNumber;
128
+ y: z.ZodNumber;
129
+ w: z.ZodNumber;
130
+ h: z.ZodNumber;
131
+ maxHeight: z.ZodOptional<z.ZodNumber>;
132
+ }, "strict", z.ZodTypeAny, {
133
+ x: number;
134
+ y: number;
135
+ w: number;
136
+ h: number;
137
+ maxHeight?: number | undefined;
138
+ }, {
139
+ x: number;
140
+ y: number;
141
+ w: number;
142
+ h: number;
143
+ maxHeight?: number | undefined;
144
+ }>>;
145
+ }, "strict", z.ZodTypeAny, {
146
+ lg?: {
147
+ x: number;
148
+ y: number;
149
+ w: number;
150
+ h: number;
151
+ maxHeight?: number | undefined;
152
+ } | undefined;
153
+ md?: {
154
+ x: number;
155
+ y: number;
156
+ w: number;
157
+ h: number;
158
+ maxHeight?: number | undefined;
159
+ } | undefined;
160
+ sm?: {
161
+ x: number;
162
+ y: number;
163
+ w: number;
164
+ h: number;
165
+ maxHeight?: number | undefined;
166
+ } | undefined;
167
+ }, {
168
+ lg?: {
169
+ x: number;
170
+ y: number;
171
+ w: number;
172
+ h: number;
173
+ maxHeight?: number | undefined;
174
+ } | undefined;
175
+ md?: {
176
+ x: number;
177
+ y: number;
178
+ w: number;
179
+ h: number;
180
+ maxHeight?: number | undefined;
181
+ } | undefined;
182
+ sm?: {
183
+ x: number;
184
+ y: number;
185
+ w: number;
186
+ h: number;
187
+ maxHeight?: number | undefined;
188
+ } | undefined;
189
+ }>>;
190
+ category: z.ZodOptional<z.ZodObject<{
191
+ id: z.ZodString;
192
+ name: z.ZodString;
193
+ slug: z.ZodString;
194
+ icon: z.ZodNullable<z.ZodString>;
195
+ }, "strict", z.ZodTypeAny, {
196
+ slug: string;
197
+ name: string;
198
+ icon: string | null;
199
+ id: string;
200
+ }, {
201
+ slug: string;
202
+ name: string;
203
+ icon: string | null;
204
+ id: string;
205
+ }>>;
206
+ isCollapsible: z.ZodOptional<z.ZodBoolean>;
207
+ isPinnable: z.ZodOptional<z.ZodBoolean>;
208
+ aiFooterEnabled: z.ZodOptional<z.ZodBoolean>;
209
+ }, "strict", z.ZodTypeAny, {
210
+ name: string;
211
+ id: string;
212
+ component: ComponentReference;
213
+ widgetState: "active" | "inactive" | "disabled";
214
+ gridSize?: {
215
+ cols: number;
216
+ rows: number;
217
+ } | {
218
+ cols: number;
219
+ rows: number;
220
+ }[] | undefined;
221
+ gridPosition?: {
222
+ col: number;
223
+ row: number;
224
+ } | undefined;
225
+ layouts?: {
226
+ lg?: {
227
+ x: number;
228
+ y: number;
229
+ w: number;
230
+ h: number;
231
+ maxHeight?: number | undefined;
232
+ } | undefined;
233
+ md?: {
234
+ x: number;
235
+ y: number;
236
+ w: number;
237
+ h: number;
238
+ maxHeight?: number | undefined;
239
+ } | undefined;
240
+ sm?: {
241
+ x: number;
242
+ y: number;
243
+ w: number;
244
+ h: number;
245
+ maxHeight?: number | undefined;
246
+ } | undefined;
247
+ } | undefined;
248
+ category?: {
249
+ slug: string;
250
+ name: string;
251
+ icon: string | null;
252
+ id: string;
253
+ } | undefined;
254
+ isCollapsible?: boolean | undefined;
255
+ isPinnable?: boolean | undefined;
256
+ aiFooterEnabled?: boolean | undefined;
257
+ }, {
258
+ name: string;
259
+ id: string;
260
+ component: ComponentReference;
261
+ widgetState: "active" | "inactive" | "disabled";
262
+ gridSize?: {
263
+ cols: number;
264
+ rows: number;
265
+ } | {
266
+ cols: number;
267
+ rows: number;
268
+ }[] | undefined;
269
+ gridPosition?: {
270
+ col: number;
271
+ row: number;
272
+ } | undefined;
273
+ layouts?: {
274
+ lg?: {
275
+ x: number;
276
+ y: number;
277
+ w: number;
278
+ h: number;
279
+ maxHeight?: number | undefined;
280
+ } | undefined;
281
+ md?: {
282
+ x: number;
283
+ y: number;
284
+ w: number;
285
+ h: number;
286
+ maxHeight?: number | undefined;
287
+ } | undefined;
288
+ sm?: {
289
+ x: number;
290
+ y: number;
291
+ w: number;
292
+ h: number;
293
+ maxHeight?: number | undefined;
294
+ } | undefined;
295
+ } | undefined;
296
+ category?: {
297
+ slug: string;
298
+ name: string;
299
+ icon: string | null;
300
+ id: string;
301
+ } | undefined;
302
+ isCollapsible?: boolean | undefined;
303
+ isPinnable?: boolean | undefined;
304
+ aiFooterEnabled?: boolean | undefined;
305
+ }>;
306
+ declare const toolParametersSchema: z.ZodObject<{
307
+ type: z.ZodLiteral<"object">;
308
+ properties: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodType<JsonValue, z.ZodTypeDef, JsonValue>>>;
309
+ required: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
310
+ additionalProperties: z.ZodOptional<z.ZodBoolean>;
311
+ }, "strict", z.ZodTypeAny, {
312
+ type: "object";
313
+ properties?: Record<string, JsonValue> | undefined;
314
+ required?: string[] | undefined;
315
+ additionalProperties?: boolean | undefined;
316
+ }, {
317
+ type: "object";
318
+ properties?: Record<string, JsonValue> | undefined;
319
+ required?: string[] | undefined;
320
+ additionalProperties?: boolean | undefined;
321
+ }>;
322
+ declare const toolClassificationProposalSchema: z.ZodObject<{
323
+ effect: z.ZodOptional<z.ZodEnum<["read", "write"]>>;
324
+ sensitivity: z.ZodOptional<z.ZodEnum<["public", "internal", "pii", "financial"]>>;
325
+ }, "strict", z.ZodTypeAny, {
326
+ effect?: "read" | "write" | undefined;
327
+ sensitivity?: "public" | "internal" | "pii" | "financial" | undefined;
328
+ }, {
329
+ effect?: "read" | "write" | undefined;
330
+ sensitivity?: "public" | "internal" | "pii" | "financial" | undefined;
331
+ }>;
332
+ declare const proposalsSchema: z.ZodObject<{
333
+ credentialModel: z.ZodOptional<z.ZodEnum<["account", "user", "source"]>>;
334
+ tools: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodObject<{
335
+ effect: z.ZodOptional<z.ZodEnum<["read", "write"]>>;
336
+ sensitivity: z.ZodOptional<z.ZodEnum<["public", "internal", "pii", "financial"]>>;
337
+ }, "strict", z.ZodTypeAny, {
338
+ effect?: "read" | "write" | undefined;
339
+ sensitivity?: "public" | "internal" | "pii" | "financial" | undefined;
340
+ }, {
341
+ effect?: "read" | "write" | undefined;
342
+ sensitivity?: "public" | "internal" | "pii" | "financial" | undefined;
343
+ }>>>;
344
+ }, "strict", z.ZodTypeAny, {
345
+ credentialModel?: "user" | "account" | "source" | undefined;
346
+ tools?: Record<string, {
347
+ effect?: "read" | "write" | undefined;
348
+ sensitivity?: "public" | "internal" | "pii" | "financial" | undefined;
349
+ }> | undefined;
350
+ }, {
351
+ credentialModel?: "user" | "account" | "source" | undefined;
352
+ tools?: Record<string, {
353
+ effect?: "read" | "write" | undefined;
354
+ sensitivity?: "public" | "internal" | "pii" | "financial" | undefined;
355
+ }> | undefined;
356
+ }>;
357
+ /**
358
+ * THE canonical schema. Strict everywhere: an unrecognized key is an error,
359
+ * which is what keeps host-assigned fields (productId, kind, trust tier,
360
+ * credentialModel, per-tool effect/sensitivity, host-resolved widget fields)
361
+ * structurally un-settable at runtime, not merely absent from the type.
362
+ */
363
+ export declare const IntegrationDefinitionSchema: z.ZodEffects<z.ZodObject<{
364
+ slug: z.ZodString;
365
+ name: z.ZodString;
366
+ description: z.ZodString;
367
+ version: z.ZodString;
368
+ capabilities: z.ZodOptional<z.ZodArray<z.ZodObject<{
369
+ label: z.ZodString;
370
+ description: z.ZodString;
371
+ icon: z.ZodOptional<z.ZodType<ComponentReference, z.ZodTypeDef, ComponentReference>>;
372
+ }, "strict", z.ZodTypeAny, {
373
+ description: string;
374
+ label: string;
375
+ icon?: ComponentReference | undefined;
376
+ }, {
377
+ description: string;
378
+ label: string;
379
+ icon?: ComponentReference | undefined;
380
+ }>, "many">>;
381
+ permissions: z.ZodOptional<z.ZodArray<z.ZodObject<{
382
+ label: z.ZodString;
383
+ detail: z.ZodString;
384
+ type: z.ZodEnum<["read", "write"]>;
385
+ }, "strict", z.ZodTypeAny, {
386
+ type: "read" | "write";
387
+ label: string;
388
+ detail: string;
389
+ }, {
390
+ type: "read" | "write";
391
+ label: string;
392
+ detail: string;
393
+ }>, "many">>;
394
+ components: z.ZodOptional<z.ZodObject<{
395
+ activationForm: z.ZodOptional<z.ZodType<ComponentReference, z.ZodTypeDef, ComponentReference>>;
396
+ marketplaceTile: z.ZodOptional<z.ZodType<ComponentReference, z.ZodTypeDef, ComponentReference>>;
397
+ widgets: z.ZodOptional<z.ZodArray<z.ZodObject<{
398
+ id: z.ZodString;
399
+ name: z.ZodString;
400
+ component: z.ZodType<ComponentReference, z.ZodTypeDef, ComponentReference>;
401
+ widgetState: z.ZodEnum<["active", "inactive", "disabled"]>;
402
+ gridSize: z.ZodOptional<z.ZodUnion<[z.ZodObject<{
403
+ cols: z.ZodNumber;
404
+ rows: z.ZodNumber;
405
+ }, "strict", z.ZodTypeAny, {
406
+ cols: number;
407
+ rows: number;
408
+ }, {
409
+ cols: number;
410
+ rows: number;
411
+ }>, z.ZodArray<z.ZodObject<{
412
+ cols: z.ZodNumber;
413
+ rows: z.ZodNumber;
414
+ }, "strict", z.ZodTypeAny, {
415
+ cols: number;
416
+ rows: number;
417
+ }, {
418
+ cols: number;
419
+ rows: number;
420
+ }>, "many">]>>;
421
+ gridPosition: z.ZodOptional<z.ZodObject<{
422
+ col: z.ZodNumber;
423
+ row: z.ZodNumber;
424
+ }, "strict", z.ZodTypeAny, {
425
+ col: number;
426
+ row: number;
427
+ }, {
428
+ col: number;
429
+ row: number;
430
+ }>>;
431
+ layouts: z.ZodOptional<z.ZodObject<{
432
+ lg: z.ZodOptional<z.ZodObject<{
433
+ x: z.ZodNumber;
434
+ y: z.ZodNumber;
435
+ w: z.ZodNumber;
436
+ h: z.ZodNumber;
437
+ maxHeight: z.ZodOptional<z.ZodNumber>;
438
+ }, "strict", z.ZodTypeAny, {
439
+ x: number;
440
+ y: number;
441
+ w: number;
442
+ h: number;
443
+ maxHeight?: number | undefined;
444
+ }, {
445
+ x: number;
446
+ y: number;
447
+ w: number;
448
+ h: number;
449
+ maxHeight?: number | undefined;
450
+ }>>;
451
+ md: z.ZodOptional<z.ZodObject<{
452
+ x: z.ZodNumber;
453
+ y: z.ZodNumber;
454
+ w: z.ZodNumber;
455
+ h: z.ZodNumber;
456
+ maxHeight: z.ZodOptional<z.ZodNumber>;
457
+ }, "strict", z.ZodTypeAny, {
458
+ x: number;
459
+ y: number;
460
+ w: number;
461
+ h: number;
462
+ maxHeight?: number | undefined;
463
+ }, {
464
+ x: number;
465
+ y: number;
466
+ w: number;
467
+ h: number;
468
+ maxHeight?: number | undefined;
469
+ }>>;
470
+ sm: z.ZodOptional<z.ZodObject<{
471
+ x: z.ZodNumber;
472
+ y: z.ZodNumber;
473
+ w: z.ZodNumber;
474
+ h: z.ZodNumber;
475
+ maxHeight: z.ZodOptional<z.ZodNumber>;
476
+ }, "strict", z.ZodTypeAny, {
477
+ x: number;
478
+ y: number;
479
+ w: number;
480
+ h: number;
481
+ maxHeight?: number | undefined;
482
+ }, {
483
+ x: number;
484
+ y: number;
485
+ w: number;
486
+ h: number;
487
+ maxHeight?: number | undefined;
488
+ }>>;
489
+ }, "strict", z.ZodTypeAny, {
490
+ lg?: {
491
+ x: number;
492
+ y: number;
493
+ w: number;
494
+ h: number;
495
+ maxHeight?: number | undefined;
496
+ } | undefined;
497
+ md?: {
498
+ x: number;
499
+ y: number;
500
+ w: number;
501
+ h: number;
502
+ maxHeight?: number | undefined;
503
+ } | undefined;
504
+ sm?: {
505
+ x: number;
506
+ y: number;
507
+ w: number;
508
+ h: number;
509
+ maxHeight?: number | undefined;
510
+ } | undefined;
511
+ }, {
512
+ lg?: {
513
+ x: number;
514
+ y: number;
515
+ w: number;
516
+ h: number;
517
+ maxHeight?: number | undefined;
518
+ } | undefined;
519
+ md?: {
520
+ x: number;
521
+ y: number;
522
+ w: number;
523
+ h: number;
524
+ maxHeight?: number | undefined;
525
+ } | undefined;
526
+ sm?: {
527
+ x: number;
528
+ y: number;
529
+ w: number;
530
+ h: number;
531
+ maxHeight?: number | undefined;
532
+ } | undefined;
533
+ }>>;
534
+ category: z.ZodOptional<z.ZodObject<{
535
+ id: z.ZodString;
536
+ name: z.ZodString;
537
+ slug: z.ZodString;
538
+ icon: z.ZodNullable<z.ZodString>;
539
+ }, "strict", z.ZodTypeAny, {
540
+ slug: string;
541
+ name: string;
542
+ icon: string | null;
543
+ id: string;
544
+ }, {
545
+ slug: string;
546
+ name: string;
547
+ icon: string | null;
548
+ id: string;
549
+ }>>;
550
+ isCollapsible: z.ZodOptional<z.ZodBoolean>;
551
+ isPinnable: z.ZodOptional<z.ZodBoolean>;
552
+ aiFooterEnabled: z.ZodOptional<z.ZodBoolean>;
553
+ }, "strict", z.ZodTypeAny, {
554
+ name: string;
555
+ id: string;
556
+ component: ComponentReference;
557
+ widgetState: "active" | "inactive" | "disabled";
558
+ gridSize?: {
559
+ cols: number;
560
+ rows: number;
561
+ } | {
562
+ cols: number;
563
+ rows: number;
564
+ }[] | undefined;
565
+ gridPosition?: {
566
+ col: number;
567
+ row: number;
568
+ } | undefined;
569
+ layouts?: {
570
+ lg?: {
571
+ x: number;
572
+ y: number;
573
+ w: number;
574
+ h: number;
575
+ maxHeight?: number | undefined;
576
+ } | undefined;
577
+ md?: {
578
+ x: number;
579
+ y: number;
580
+ w: number;
581
+ h: number;
582
+ maxHeight?: number | undefined;
583
+ } | undefined;
584
+ sm?: {
585
+ x: number;
586
+ y: number;
587
+ w: number;
588
+ h: number;
589
+ maxHeight?: number | undefined;
590
+ } | undefined;
591
+ } | undefined;
592
+ category?: {
593
+ slug: string;
594
+ name: string;
595
+ icon: string | null;
596
+ id: string;
597
+ } | undefined;
598
+ isCollapsible?: boolean | undefined;
599
+ isPinnable?: boolean | undefined;
600
+ aiFooterEnabled?: boolean | undefined;
601
+ }, {
602
+ name: string;
603
+ id: string;
604
+ component: ComponentReference;
605
+ widgetState: "active" | "inactive" | "disabled";
606
+ gridSize?: {
607
+ cols: number;
608
+ rows: number;
609
+ } | {
610
+ cols: number;
611
+ rows: number;
612
+ }[] | undefined;
613
+ gridPosition?: {
614
+ col: number;
615
+ row: number;
616
+ } | undefined;
617
+ layouts?: {
618
+ lg?: {
619
+ x: number;
620
+ y: number;
621
+ w: number;
622
+ h: number;
623
+ maxHeight?: number | undefined;
624
+ } | undefined;
625
+ md?: {
626
+ x: number;
627
+ y: number;
628
+ w: number;
629
+ h: number;
630
+ maxHeight?: number | undefined;
631
+ } | undefined;
632
+ sm?: {
633
+ x: number;
634
+ y: number;
635
+ w: number;
636
+ h: number;
637
+ maxHeight?: number | undefined;
638
+ } | undefined;
639
+ } | undefined;
640
+ category?: {
641
+ slug: string;
642
+ name: string;
643
+ icon: string | null;
644
+ id: string;
645
+ } | undefined;
646
+ isCollapsible?: boolean | undefined;
647
+ isPinnable?: boolean | undefined;
648
+ aiFooterEnabled?: boolean | undefined;
649
+ }>, "many">>;
650
+ }, "strict", z.ZodTypeAny, {
651
+ activationForm?: ComponentReference | undefined;
652
+ marketplaceTile?: ComponentReference | undefined;
653
+ widgets?: {
654
+ name: string;
655
+ id: string;
656
+ component: ComponentReference;
657
+ widgetState: "active" | "inactive" | "disabled";
658
+ gridSize?: {
659
+ cols: number;
660
+ rows: number;
661
+ } | {
662
+ cols: number;
663
+ rows: number;
664
+ }[] | undefined;
665
+ gridPosition?: {
666
+ col: number;
667
+ row: number;
668
+ } | undefined;
669
+ layouts?: {
670
+ lg?: {
671
+ x: number;
672
+ y: number;
673
+ w: number;
674
+ h: number;
675
+ maxHeight?: number | undefined;
676
+ } | undefined;
677
+ md?: {
678
+ x: number;
679
+ y: number;
680
+ w: number;
681
+ h: number;
682
+ maxHeight?: number | undefined;
683
+ } | undefined;
684
+ sm?: {
685
+ x: number;
686
+ y: number;
687
+ w: number;
688
+ h: number;
689
+ maxHeight?: number | undefined;
690
+ } | undefined;
691
+ } | undefined;
692
+ category?: {
693
+ slug: string;
694
+ name: string;
695
+ icon: string | null;
696
+ id: string;
697
+ } | undefined;
698
+ isCollapsible?: boolean | undefined;
699
+ isPinnable?: boolean | undefined;
700
+ aiFooterEnabled?: boolean | undefined;
701
+ }[] | undefined;
702
+ }, {
703
+ activationForm?: ComponentReference | undefined;
704
+ marketplaceTile?: ComponentReference | undefined;
705
+ widgets?: {
706
+ name: string;
707
+ id: string;
708
+ component: ComponentReference;
709
+ widgetState: "active" | "inactive" | "disabled";
710
+ gridSize?: {
711
+ cols: number;
712
+ rows: number;
713
+ } | {
714
+ cols: number;
715
+ rows: number;
716
+ }[] | undefined;
717
+ gridPosition?: {
718
+ col: number;
719
+ row: number;
720
+ } | undefined;
721
+ layouts?: {
722
+ lg?: {
723
+ x: number;
724
+ y: number;
725
+ w: number;
726
+ h: number;
727
+ maxHeight?: number | undefined;
728
+ } | undefined;
729
+ md?: {
730
+ x: number;
731
+ y: number;
732
+ w: number;
733
+ h: number;
734
+ maxHeight?: number | undefined;
735
+ } | undefined;
736
+ sm?: {
737
+ x: number;
738
+ y: number;
739
+ w: number;
740
+ h: number;
741
+ maxHeight?: number | undefined;
742
+ } | undefined;
743
+ } | undefined;
744
+ category?: {
745
+ slug: string;
746
+ name: string;
747
+ icon: string | null;
748
+ id: string;
749
+ } | undefined;
750
+ isCollapsible?: boolean | undefined;
751
+ isPinnable?: boolean | undefined;
752
+ aiFooterEnabled?: boolean | undefined;
753
+ }[] | undefined;
754
+ }>>;
755
+ workspaceTargets: z.ZodOptional<z.ZodEffects<z.ZodArray<z.ZodEffects<z.ZodObject<{
756
+ slug: z.ZodString;
757
+ name: z.ZodString;
758
+ icon: z.ZodOptional<z.ZodEffects<z.ZodString, string, string>>;
759
+ description: z.ZodOptional<z.ZodString>;
760
+ layout: z.ZodDefault<z.ZodEnum<["masonry", "two-column"]>>;
761
+ inheritsWidgets: z.ZodOptional<z.ZodBoolean>;
762
+ includedWidgetIds: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
763
+ }, "strict", z.ZodTypeAny, {
764
+ slug: string;
765
+ name: string;
766
+ layout: "masonry" | "two-column";
767
+ description?: string | undefined;
768
+ icon?: string | undefined;
769
+ inheritsWidgets?: boolean | undefined;
770
+ includedWidgetIds?: string[] | undefined;
771
+ }, {
772
+ slug: string;
773
+ name: string;
774
+ description?: string | undefined;
775
+ icon?: string | undefined;
776
+ layout?: "masonry" | "two-column" | undefined;
777
+ inheritsWidgets?: boolean | undefined;
778
+ includedWidgetIds?: string[] | undefined;
779
+ }>, {
780
+ slug: string;
781
+ name: string;
782
+ layout: "masonry" | "two-column";
783
+ description?: string | undefined;
784
+ icon?: string | undefined;
785
+ inheritsWidgets?: boolean | undefined;
786
+ includedWidgetIds?: string[] | undefined;
787
+ }, {
788
+ slug: string;
789
+ name: string;
790
+ description?: string | undefined;
791
+ icon?: string | undefined;
792
+ layout?: "masonry" | "two-column" | undefined;
793
+ inheritsWidgets?: boolean | undefined;
794
+ includedWidgetIds?: string[] | undefined;
795
+ }>, "many">, {
796
+ slug: string;
797
+ name: string;
798
+ layout: "masonry" | "two-column";
799
+ description?: string | undefined;
800
+ icon?: string | undefined;
801
+ inheritsWidgets?: boolean | undefined;
802
+ includedWidgetIds?: string[] | undefined;
803
+ }[], {
804
+ slug: string;
805
+ name: string;
806
+ description?: string | undefined;
807
+ icon?: string | undefined;
808
+ layout?: "masonry" | "two-column" | undefined;
809
+ inheritsWidgets?: boolean | undefined;
810
+ includedWidgetIds?: string[] | undefined;
811
+ }[]>>;
812
+ tools: z.ZodOptional<z.ZodArray<z.ZodObject<{
813
+ name: z.ZodString;
814
+ description: z.ZodString;
815
+ parameters: z.ZodOptional<z.ZodObject<{
816
+ type: z.ZodLiteral<"object">;
817
+ properties: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodType<JsonValue, z.ZodTypeDef, JsonValue>>>;
818
+ required: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
819
+ additionalProperties: z.ZodOptional<z.ZodBoolean>;
820
+ }, "strict", z.ZodTypeAny, {
821
+ type: "object";
822
+ properties?: Record<string, JsonValue> | undefined;
823
+ required?: string[] | undefined;
824
+ additionalProperties?: boolean | undefined;
825
+ }, {
826
+ type: "object";
827
+ properties?: Record<string, JsonValue> | undefined;
828
+ required?: string[] | undefined;
829
+ additionalProperties?: boolean | undefined;
830
+ }>>;
831
+ run: z.ZodType<(ctx: never, args: Record<string, unknown>) => Promise<unknown>, z.ZodTypeDef, (ctx: never, args: Record<string, unknown>) => Promise<unknown>>;
832
+ outputExample: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodType<JsonValue, z.ZodTypeDef, JsonValue>>>;
833
+ }, "strict", z.ZodTypeAny, {
834
+ description: string;
835
+ name: string;
836
+ run: (ctx: never, args: Record<string, unknown>) => Promise<unknown>;
837
+ parameters?: {
838
+ type: "object";
839
+ properties?: Record<string, JsonValue> | undefined;
840
+ required?: string[] | undefined;
841
+ additionalProperties?: boolean | undefined;
842
+ } | undefined;
843
+ outputExample?: Record<string, JsonValue> | undefined;
844
+ }, {
845
+ description: string;
846
+ name: string;
847
+ run: (ctx: never, args: Record<string, unknown>) => Promise<unknown>;
848
+ parameters?: {
849
+ type: "object";
850
+ properties?: Record<string, JsonValue> | undefined;
851
+ required?: string[] | undefined;
852
+ additionalProperties?: boolean | undefined;
853
+ } | undefined;
854
+ outputExample?: Record<string, JsonValue> | undefined;
855
+ }>, "many">>;
856
+ storage: z.ZodOptional<z.ZodObject<{
857
+ account: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodEffects<z.ZodType<StorageKeyDeclarationInput, z.ZodTypeDef, StorageKeyDeclarationInput>, StorageKeyDeclarationInput, StorageKeyDeclarationInput>>>;
858
+ user: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodEffects<z.ZodType<StorageKeyDeclarationInput, z.ZodTypeDef, StorageKeyDeclarationInput>, StorageKeyDeclarationInput, StorageKeyDeclarationInput>>>;
859
+ }, "strict", z.ZodTypeAny, {
860
+ user?: Record<string, StorageKeyDeclarationInput> | undefined;
861
+ account?: Record<string, StorageKeyDeclarationInput> | undefined;
862
+ }, {
863
+ user?: Record<string, StorageKeyDeclarationInput> | undefined;
864
+ account?: Record<string, StorageKeyDeclarationInput> | undefined;
865
+ }>>;
866
+ egress: z.ZodOptional<z.ZodArray<z.ZodEffects<z.ZodString, string, string>, "many">>;
867
+ webhooks: z.ZodOptional<z.ZodArray<z.ZodObject<{
868
+ id: z.ZodString;
869
+ description: z.ZodString;
870
+ payloadSchema: z.ZodType<z.ZodType<any, z.ZodTypeDef, any>, z.ZodTypeDef, z.ZodType<any, z.ZodTypeDef, any>>;
871
+ signature: z.ZodUnion<[z.ZodLiteral<"none">, z.ZodObject<{
872
+ header: z.ZodString;
873
+ secretName: z.ZodString;
874
+ }, "strict", z.ZodTypeAny, {
875
+ header: string;
876
+ secretName: string;
877
+ }, {
878
+ header: string;
879
+ secretName: string;
880
+ }>]>;
881
+ examplePayload: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodType<JsonValue, z.ZodTypeDef, JsonValue>>>;
882
+ handler: z.ZodType<(ctx: never, arg: never) => Promise<unknown>, z.ZodTypeDef, (ctx: never, arg: never) => Promise<unknown>>;
883
+ }, "strict", z.ZodTypeAny, {
884
+ description: string;
885
+ id: string;
886
+ payloadSchema: z.ZodType<any, z.ZodTypeDef, any>;
887
+ signature: "none" | {
888
+ header: string;
889
+ secretName: string;
890
+ };
891
+ handler: (ctx: never, arg: never) => Promise<unknown>;
892
+ examplePayload?: Record<string, JsonValue> | undefined;
893
+ }, {
894
+ description: string;
895
+ id: string;
896
+ payloadSchema: z.ZodType<any, z.ZodTypeDef, any>;
897
+ signature: "none" | {
898
+ header: string;
899
+ secretName: string;
900
+ };
901
+ handler: (ctx: never, arg: never) => Promise<unknown>;
902
+ examplePayload?: Record<string, JsonValue> | undefined;
903
+ }>, "many">>;
904
+ schedules: z.ZodOptional<z.ZodArray<z.ZodObject<{
905
+ id: z.ZodString;
906
+ description: z.ZodString;
907
+ cron: z.ZodString;
908
+ handler: z.ZodType<(ctx: never, arg: never) => Promise<unknown>, z.ZodTypeDef, (ctx: never, arg: never) => Promise<unknown>>;
909
+ }, "strict", z.ZodTypeAny, {
910
+ description: string;
911
+ id: string;
912
+ handler: (ctx: never, arg: never) => Promise<unknown>;
913
+ cron: string;
914
+ }, {
915
+ description: string;
916
+ id: string;
917
+ handler: (ctx: never, arg: never) => Promise<unknown>;
918
+ cron: string;
919
+ }>, "many">>;
920
+ oauth: z.ZodOptional<z.ZodObject<{
921
+ provider: z.ZodObject<{
922
+ authorizationUrl: z.ZodEffects<z.ZodString, string, string>;
923
+ tokenUrl: z.ZodEffects<z.ZodString, string, string>;
924
+ scopes: z.ZodArray<z.ZodString, "many">;
925
+ pkce: z.ZodOptional<z.ZodBoolean>;
926
+ }, "strict", z.ZodTypeAny, {
927
+ authorizationUrl: string;
928
+ tokenUrl: string;
929
+ scopes: string[];
930
+ pkce?: boolean | undefined;
931
+ }, {
932
+ authorizationUrl: string;
933
+ tokenUrl: string;
934
+ scopes: string[];
935
+ pkce?: boolean | undefined;
936
+ }>;
937
+ credentials: z.ZodObject<{
938
+ clientIdSecretName: z.ZodString;
939
+ clientSecretSecretName: z.ZodString;
940
+ }, "strict", z.ZodTypeAny, {
941
+ clientIdSecretName: string;
942
+ clientSecretSecretName: string;
943
+ }, {
944
+ clientIdSecretName: string;
945
+ clientSecretSecretName: string;
946
+ }>;
947
+ onTokens: z.ZodType<(ctx: never, arg: never) => Promise<unknown>, z.ZodTypeDef, (ctx: never, arg: never) => Promise<unknown>>;
948
+ }, "strict", z.ZodTypeAny, {
949
+ provider: {
950
+ authorizationUrl: string;
951
+ tokenUrl: string;
952
+ scopes: string[];
953
+ pkce?: boolean | undefined;
954
+ };
955
+ credentials: {
956
+ clientIdSecretName: string;
957
+ clientSecretSecretName: string;
958
+ };
959
+ onTokens: (ctx: never, arg: never) => Promise<unknown>;
960
+ }, {
961
+ provider: {
962
+ authorizationUrl: string;
963
+ tokenUrl: string;
964
+ scopes: string[];
965
+ pkce?: boolean | undefined;
966
+ };
967
+ credentials: {
968
+ clientIdSecretName: string;
969
+ clientSecretSecretName: string;
970
+ };
971
+ onTokens: (ctx: never, arg: never) => Promise<unknown>;
972
+ }>>;
973
+ proposes: z.ZodOptional<z.ZodObject<{
974
+ credentialModel: z.ZodOptional<z.ZodEnum<["account", "user", "source"]>>;
975
+ tools: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodObject<{
976
+ effect: z.ZodOptional<z.ZodEnum<["read", "write"]>>;
977
+ sensitivity: z.ZodOptional<z.ZodEnum<["public", "internal", "pii", "financial"]>>;
978
+ }, "strict", z.ZodTypeAny, {
979
+ effect?: "read" | "write" | undefined;
980
+ sensitivity?: "public" | "internal" | "pii" | "financial" | undefined;
981
+ }, {
982
+ effect?: "read" | "write" | undefined;
983
+ sensitivity?: "public" | "internal" | "pii" | "financial" | undefined;
984
+ }>>>;
985
+ }, "strict", z.ZodTypeAny, {
986
+ credentialModel?: "user" | "account" | "source" | undefined;
987
+ tools?: Record<string, {
988
+ effect?: "read" | "write" | undefined;
989
+ sensitivity?: "public" | "internal" | "pii" | "financial" | undefined;
990
+ }> | undefined;
991
+ }, {
992
+ credentialModel?: "user" | "account" | "source" | undefined;
993
+ tools?: Record<string, {
994
+ effect?: "read" | "write" | undefined;
995
+ sensitivity?: "public" | "internal" | "pii" | "financial" | undefined;
996
+ }> | undefined;
997
+ }>>;
998
+ }, "strict", z.ZodTypeAny, {
999
+ description: string;
1000
+ slug: string;
1001
+ name: string;
1002
+ version: string;
1003
+ tools?: {
1004
+ description: string;
1005
+ name: string;
1006
+ run: (ctx: never, args: Record<string, unknown>) => Promise<unknown>;
1007
+ parameters?: {
1008
+ type: "object";
1009
+ properties?: Record<string, JsonValue> | undefined;
1010
+ required?: string[] | undefined;
1011
+ additionalProperties?: boolean | undefined;
1012
+ } | undefined;
1013
+ outputExample?: Record<string, JsonValue> | undefined;
1014
+ }[] | undefined;
1015
+ capabilities?: {
1016
+ description: string;
1017
+ label: string;
1018
+ icon?: ComponentReference | undefined;
1019
+ }[] | undefined;
1020
+ permissions?: {
1021
+ type: "read" | "write";
1022
+ label: string;
1023
+ detail: string;
1024
+ }[] | undefined;
1025
+ components?: {
1026
+ activationForm?: ComponentReference | undefined;
1027
+ marketplaceTile?: ComponentReference | undefined;
1028
+ widgets?: {
1029
+ name: string;
1030
+ id: string;
1031
+ component: ComponentReference;
1032
+ widgetState: "active" | "inactive" | "disabled";
1033
+ gridSize?: {
1034
+ cols: number;
1035
+ rows: number;
1036
+ } | {
1037
+ cols: number;
1038
+ rows: number;
1039
+ }[] | undefined;
1040
+ gridPosition?: {
1041
+ col: number;
1042
+ row: number;
1043
+ } | undefined;
1044
+ layouts?: {
1045
+ lg?: {
1046
+ x: number;
1047
+ y: number;
1048
+ w: number;
1049
+ h: number;
1050
+ maxHeight?: number | undefined;
1051
+ } | undefined;
1052
+ md?: {
1053
+ x: number;
1054
+ y: number;
1055
+ w: number;
1056
+ h: number;
1057
+ maxHeight?: number | undefined;
1058
+ } | undefined;
1059
+ sm?: {
1060
+ x: number;
1061
+ y: number;
1062
+ w: number;
1063
+ h: number;
1064
+ maxHeight?: number | undefined;
1065
+ } | undefined;
1066
+ } | undefined;
1067
+ category?: {
1068
+ slug: string;
1069
+ name: string;
1070
+ icon: string | null;
1071
+ id: string;
1072
+ } | undefined;
1073
+ isCollapsible?: boolean | undefined;
1074
+ isPinnable?: boolean | undefined;
1075
+ aiFooterEnabled?: boolean | undefined;
1076
+ }[] | undefined;
1077
+ } | undefined;
1078
+ workspaceTargets?: {
1079
+ slug: string;
1080
+ name: string;
1081
+ layout: "masonry" | "two-column";
1082
+ description?: string | undefined;
1083
+ icon?: string | undefined;
1084
+ inheritsWidgets?: boolean | undefined;
1085
+ includedWidgetIds?: string[] | undefined;
1086
+ }[] | undefined;
1087
+ storage?: {
1088
+ user?: Record<string, StorageKeyDeclarationInput> | undefined;
1089
+ account?: Record<string, StorageKeyDeclarationInput> | undefined;
1090
+ } | undefined;
1091
+ egress?: string[] | undefined;
1092
+ webhooks?: {
1093
+ description: string;
1094
+ id: string;
1095
+ payloadSchema: z.ZodType<any, z.ZodTypeDef, any>;
1096
+ signature: "none" | {
1097
+ header: string;
1098
+ secretName: string;
1099
+ };
1100
+ handler: (ctx: never, arg: never) => Promise<unknown>;
1101
+ examplePayload?: Record<string, JsonValue> | undefined;
1102
+ }[] | undefined;
1103
+ schedules?: {
1104
+ description: string;
1105
+ id: string;
1106
+ handler: (ctx: never, arg: never) => Promise<unknown>;
1107
+ cron: string;
1108
+ }[] | undefined;
1109
+ oauth?: {
1110
+ provider: {
1111
+ authorizationUrl: string;
1112
+ tokenUrl: string;
1113
+ scopes: string[];
1114
+ pkce?: boolean | undefined;
1115
+ };
1116
+ credentials: {
1117
+ clientIdSecretName: string;
1118
+ clientSecretSecretName: string;
1119
+ };
1120
+ onTokens: (ctx: never, arg: never) => Promise<unknown>;
1121
+ } | undefined;
1122
+ proposes?: {
1123
+ credentialModel?: "user" | "account" | "source" | undefined;
1124
+ tools?: Record<string, {
1125
+ effect?: "read" | "write" | undefined;
1126
+ sensitivity?: "public" | "internal" | "pii" | "financial" | undefined;
1127
+ }> | undefined;
1128
+ } | undefined;
1129
+ }, {
1130
+ description: string;
1131
+ slug: string;
1132
+ name: string;
1133
+ version: string;
1134
+ tools?: {
1135
+ description: string;
1136
+ name: string;
1137
+ run: (ctx: never, args: Record<string, unknown>) => Promise<unknown>;
1138
+ parameters?: {
1139
+ type: "object";
1140
+ properties?: Record<string, JsonValue> | undefined;
1141
+ required?: string[] | undefined;
1142
+ additionalProperties?: boolean | undefined;
1143
+ } | undefined;
1144
+ outputExample?: Record<string, JsonValue> | undefined;
1145
+ }[] | undefined;
1146
+ capabilities?: {
1147
+ description: string;
1148
+ label: string;
1149
+ icon?: ComponentReference | undefined;
1150
+ }[] | undefined;
1151
+ permissions?: {
1152
+ type: "read" | "write";
1153
+ label: string;
1154
+ detail: string;
1155
+ }[] | undefined;
1156
+ components?: {
1157
+ activationForm?: ComponentReference | undefined;
1158
+ marketplaceTile?: ComponentReference | undefined;
1159
+ widgets?: {
1160
+ name: string;
1161
+ id: string;
1162
+ component: ComponentReference;
1163
+ widgetState: "active" | "inactive" | "disabled";
1164
+ gridSize?: {
1165
+ cols: number;
1166
+ rows: number;
1167
+ } | {
1168
+ cols: number;
1169
+ rows: number;
1170
+ }[] | undefined;
1171
+ gridPosition?: {
1172
+ col: number;
1173
+ row: number;
1174
+ } | undefined;
1175
+ layouts?: {
1176
+ lg?: {
1177
+ x: number;
1178
+ y: number;
1179
+ w: number;
1180
+ h: number;
1181
+ maxHeight?: number | undefined;
1182
+ } | undefined;
1183
+ md?: {
1184
+ x: number;
1185
+ y: number;
1186
+ w: number;
1187
+ h: number;
1188
+ maxHeight?: number | undefined;
1189
+ } | undefined;
1190
+ sm?: {
1191
+ x: number;
1192
+ y: number;
1193
+ w: number;
1194
+ h: number;
1195
+ maxHeight?: number | undefined;
1196
+ } | undefined;
1197
+ } | undefined;
1198
+ category?: {
1199
+ slug: string;
1200
+ name: string;
1201
+ icon: string | null;
1202
+ id: string;
1203
+ } | undefined;
1204
+ isCollapsible?: boolean | undefined;
1205
+ isPinnable?: boolean | undefined;
1206
+ aiFooterEnabled?: boolean | undefined;
1207
+ }[] | undefined;
1208
+ } | undefined;
1209
+ workspaceTargets?: {
1210
+ slug: string;
1211
+ name: string;
1212
+ description?: string | undefined;
1213
+ icon?: string | undefined;
1214
+ layout?: "masonry" | "two-column" | undefined;
1215
+ inheritsWidgets?: boolean | undefined;
1216
+ includedWidgetIds?: string[] | undefined;
1217
+ }[] | undefined;
1218
+ storage?: {
1219
+ user?: Record<string, StorageKeyDeclarationInput> | undefined;
1220
+ account?: Record<string, StorageKeyDeclarationInput> | undefined;
1221
+ } | undefined;
1222
+ egress?: string[] | undefined;
1223
+ webhooks?: {
1224
+ description: string;
1225
+ id: string;
1226
+ payloadSchema: z.ZodType<any, z.ZodTypeDef, any>;
1227
+ signature: "none" | {
1228
+ header: string;
1229
+ secretName: string;
1230
+ };
1231
+ handler: (ctx: never, arg: never) => Promise<unknown>;
1232
+ examplePayload?: Record<string, JsonValue> | undefined;
1233
+ }[] | undefined;
1234
+ schedules?: {
1235
+ description: string;
1236
+ id: string;
1237
+ handler: (ctx: never, arg: never) => Promise<unknown>;
1238
+ cron: string;
1239
+ }[] | undefined;
1240
+ oauth?: {
1241
+ provider: {
1242
+ authorizationUrl: string;
1243
+ tokenUrl: string;
1244
+ scopes: string[];
1245
+ pkce?: boolean | undefined;
1246
+ };
1247
+ credentials: {
1248
+ clientIdSecretName: string;
1249
+ clientSecretSecretName: string;
1250
+ };
1251
+ onTokens: (ctx: never, arg: never) => Promise<unknown>;
1252
+ } | undefined;
1253
+ proposes?: {
1254
+ credentialModel?: "user" | "account" | "source" | undefined;
1255
+ tools?: Record<string, {
1256
+ effect?: "read" | "write" | undefined;
1257
+ sensitivity?: "public" | "internal" | "pii" | "financial" | undefined;
1258
+ }> | undefined;
1259
+ } | undefined;
1260
+ }>, {
1261
+ description: string;
1262
+ slug: string;
1263
+ name: string;
1264
+ version: string;
1265
+ tools?: {
1266
+ description: string;
1267
+ name: string;
1268
+ run: (ctx: never, args: Record<string, unknown>) => Promise<unknown>;
1269
+ parameters?: {
1270
+ type: "object";
1271
+ properties?: Record<string, JsonValue> | undefined;
1272
+ required?: string[] | undefined;
1273
+ additionalProperties?: boolean | undefined;
1274
+ } | undefined;
1275
+ outputExample?: Record<string, JsonValue> | undefined;
1276
+ }[] | undefined;
1277
+ capabilities?: {
1278
+ description: string;
1279
+ label: string;
1280
+ icon?: ComponentReference | undefined;
1281
+ }[] | undefined;
1282
+ permissions?: {
1283
+ type: "read" | "write";
1284
+ label: string;
1285
+ detail: string;
1286
+ }[] | undefined;
1287
+ components?: {
1288
+ activationForm?: ComponentReference | undefined;
1289
+ marketplaceTile?: ComponentReference | undefined;
1290
+ widgets?: {
1291
+ name: string;
1292
+ id: string;
1293
+ component: ComponentReference;
1294
+ widgetState: "active" | "inactive" | "disabled";
1295
+ gridSize?: {
1296
+ cols: number;
1297
+ rows: number;
1298
+ } | {
1299
+ cols: number;
1300
+ rows: number;
1301
+ }[] | undefined;
1302
+ gridPosition?: {
1303
+ col: number;
1304
+ row: number;
1305
+ } | undefined;
1306
+ layouts?: {
1307
+ lg?: {
1308
+ x: number;
1309
+ y: number;
1310
+ w: number;
1311
+ h: number;
1312
+ maxHeight?: number | undefined;
1313
+ } | undefined;
1314
+ md?: {
1315
+ x: number;
1316
+ y: number;
1317
+ w: number;
1318
+ h: number;
1319
+ maxHeight?: number | undefined;
1320
+ } | undefined;
1321
+ sm?: {
1322
+ x: number;
1323
+ y: number;
1324
+ w: number;
1325
+ h: number;
1326
+ maxHeight?: number | undefined;
1327
+ } | undefined;
1328
+ } | undefined;
1329
+ category?: {
1330
+ slug: string;
1331
+ name: string;
1332
+ icon: string | null;
1333
+ id: string;
1334
+ } | undefined;
1335
+ isCollapsible?: boolean | undefined;
1336
+ isPinnable?: boolean | undefined;
1337
+ aiFooterEnabled?: boolean | undefined;
1338
+ }[] | undefined;
1339
+ } | undefined;
1340
+ workspaceTargets?: {
1341
+ slug: string;
1342
+ name: string;
1343
+ layout: "masonry" | "two-column";
1344
+ description?: string | undefined;
1345
+ icon?: string | undefined;
1346
+ inheritsWidgets?: boolean | undefined;
1347
+ includedWidgetIds?: string[] | undefined;
1348
+ }[] | undefined;
1349
+ storage?: {
1350
+ user?: Record<string, StorageKeyDeclarationInput> | undefined;
1351
+ account?: Record<string, StorageKeyDeclarationInput> | undefined;
1352
+ } | undefined;
1353
+ egress?: string[] | undefined;
1354
+ webhooks?: {
1355
+ description: string;
1356
+ id: string;
1357
+ payloadSchema: z.ZodType<any, z.ZodTypeDef, any>;
1358
+ signature: "none" | {
1359
+ header: string;
1360
+ secretName: string;
1361
+ };
1362
+ handler: (ctx: never, arg: never) => Promise<unknown>;
1363
+ examplePayload?: Record<string, JsonValue> | undefined;
1364
+ }[] | undefined;
1365
+ schedules?: {
1366
+ description: string;
1367
+ id: string;
1368
+ handler: (ctx: never, arg: never) => Promise<unknown>;
1369
+ cron: string;
1370
+ }[] | undefined;
1371
+ oauth?: {
1372
+ provider: {
1373
+ authorizationUrl: string;
1374
+ tokenUrl: string;
1375
+ scopes: string[];
1376
+ pkce?: boolean | undefined;
1377
+ };
1378
+ credentials: {
1379
+ clientIdSecretName: string;
1380
+ clientSecretSecretName: string;
1381
+ };
1382
+ onTokens: (ctx: never, arg: never) => Promise<unknown>;
1383
+ } | undefined;
1384
+ proposes?: {
1385
+ credentialModel?: "user" | "account" | "source" | undefined;
1386
+ tools?: Record<string, {
1387
+ effect?: "read" | "write" | undefined;
1388
+ sensitivity?: "public" | "internal" | "pii" | "financial" | undefined;
1389
+ }> | undefined;
1390
+ } | undefined;
1391
+ }, {
1392
+ description: string;
1393
+ slug: string;
1394
+ name: string;
1395
+ version: string;
1396
+ tools?: {
1397
+ description: string;
1398
+ name: string;
1399
+ run: (ctx: never, args: Record<string, unknown>) => Promise<unknown>;
1400
+ parameters?: {
1401
+ type: "object";
1402
+ properties?: Record<string, JsonValue> | undefined;
1403
+ required?: string[] | undefined;
1404
+ additionalProperties?: boolean | undefined;
1405
+ } | undefined;
1406
+ outputExample?: Record<string, JsonValue> | undefined;
1407
+ }[] | undefined;
1408
+ capabilities?: {
1409
+ description: string;
1410
+ label: string;
1411
+ icon?: ComponentReference | undefined;
1412
+ }[] | undefined;
1413
+ permissions?: {
1414
+ type: "read" | "write";
1415
+ label: string;
1416
+ detail: string;
1417
+ }[] | undefined;
1418
+ components?: {
1419
+ activationForm?: ComponentReference | undefined;
1420
+ marketplaceTile?: ComponentReference | undefined;
1421
+ widgets?: {
1422
+ name: string;
1423
+ id: string;
1424
+ component: ComponentReference;
1425
+ widgetState: "active" | "inactive" | "disabled";
1426
+ gridSize?: {
1427
+ cols: number;
1428
+ rows: number;
1429
+ } | {
1430
+ cols: number;
1431
+ rows: number;
1432
+ }[] | undefined;
1433
+ gridPosition?: {
1434
+ col: number;
1435
+ row: number;
1436
+ } | undefined;
1437
+ layouts?: {
1438
+ lg?: {
1439
+ x: number;
1440
+ y: number;
1441
+ w: number;
1442
+ h: number;
1443
+ maxHeight?: number | undefined;
1444
+ } | undefined;
1445
+ md?: {
1446
+ x: number;
1447
+ y: number;
1448
+ w: number;
1449
+ h: number;
1450
+ maxHeight?: number | undefined;
1451
+ } | undefined;
1452
+ sm?: {
1453
+ x: number;
1454
+ y: number;
1455
+ w: number;
1456
+ h: number;
1457
+ maxHeight?: number | undefined;
1458
+ } | undefined;
1459
+ } | undefined;
1460
+ category?: {
1461
+ slug: string;
1462
+ name: string;
1463
+ icon: string | null;
1464
+ id: string;
1465
+ } | undefined;
1466
+ isCollapsible?: boolean | undefined;
1467
+ isPinnable?: boolean | undefined;
1468
+ aiFooterEnabled?: boolean | undefined;
1469
+ }[] | undefined;
1470
+ } | undefined;
1471
+ workspaceTargets?: {
1472
+ slug: string;
1473
+ name: string;
1474
+ description?: string | undefined;
1475
+ icon?: string | undefined;
1476
+ layout?: "masonry" | "two-column" | undefined;
1477
+ inheritsWidgets?: boolean | undefined;
1478
+ includedWidgetIds?: string[] | undefined;
1479
+ }[] | undefined;
1480
+ storage?: {
1481
+ user?: Record<string, StorageKeyDeclarationInput> | undefined;
1482
+ account?: Record<string, StorageKeyDeclarationInput> | undefined;
1483
+ } | undefined;
1484
+ egress?: string[] | undefined;
1485
+ webhooks?: {
1486
+ description: string;
1487
+ id: string;
1488
+ payloadSchema: z.ZodType<any, z.ZodTypeDef, any>;
1489
+ signature: "none" | {
1490
+ header: string;
1491
+ secretName: string;
1492
+ };
1493
+ handler: (ctx: never, arg: never) => Promise<unknown>;
1494
+ examplePayload?: Record<string, JsonValue> | undefined;
1495
+ }[] | undefined;
1496
+ schedules?: {
1497
+ description: string;
1498
+ id: string;
1499
+ handler: (ctx: never, arg: never) => Promise<unknown>;
1500
+ cron: string;
1501
+ }[] | undefined;
1502
+ oauth?: {
1503
+ provider: {
1504
+ authorizationUrl: string;
1505
+ tokenUrl: string;
1506
+ scopes: string[];
1507
+ pkce?: boolean | undefined;
1508
+ };
1509
+ credentials: {
1510
+ clientIdSecretName: string;
1511
+ clientSecretSecretName: string;
1512
+ };
1513
+ onTokens: (ctx: never, arg: never) => Promise<unknown>;
1514
+ } | undefined;
1515
+ proposes?: {
1516
+ credentialModel?: "user" | "account" | "source" | undefined;
1517
+ tools?: Record<string, {
1518
+ effect?: "read" | "write" | undefined;
1519
+ sensitivity?: "public" | "internal" | "pii" | "financial" | undefined;
1520
+ }> | undefined;
1521
+ } | undefined;
1522
+ }>;
1523
+ export type ToolClassificationProposal = z.infer<typeof toolClassificationProposalSchema>;
1524
+ export type IntegrationProposals = z.infer<typeof proposalsSchema>;
1525
+ export type PartnerToolParameters = z.infer<typeof toolParametersSchema>;
1526
+ export type IntegrationCapabilityDeclaration = z.infer<typeof capabilitySchema>;
1527
+ export type IntegrationPermissionDeclaration = z.infer<typeof permissionSchema>;
1528
+ export type PartnerWidgetDeclaration = z.infer<typeof widgetSchema>;
1529
+ export interface PartnerToolModule<Schemas extends StorageSchemas = StorageSchemas> {
1530
+ name: string;
1531
+ description: string;
1532
+ parameters?: PartnerToolParameters;
1533
+ /**
1534
+ * Contravariant function property (F8): the declared `Schemas` generic
1535
+ * types `ctx.storage` for the author. The generic cannot survive the
1536
+ * by-value, monomorphic host registration boundary — the adapter erases it
1537
+ * — but nothing rests on it surviving: the host constructs `ctx` FROM the
1538
+ * definition's own `storage` schemas, and `ctx.storage` validates every
1539
+ * read/write against them at runtime regardless of the handler's
1540
+ * annotation. The static generic is DX; the runtime schema is the guard.
1541
+ */
1542
+ run: (ctx: IntegrationContext<Schemas>, args: Record<string, unknown>) => Promise<unknown>;
1543
+ outputExample?: Record<string, JsonValue>;
1544
+ }
1545
+ export interface IntegrationComponentDeclarations {
1546
+ activationForm?: ComponentReference;
1547
+ marketplaceTile?: ComponentReference;
1548
+ widgets?: PartnerWidgetDeclaration[];
1549
+ }
1550
+ /**
1551
+ * How the transport verifies a webhook delivery. `'none'` states explicitly
1552
+ * that the source is unsigned; otherwise the transport reads the named header
1553
+ * and verifies it against the named secret. Verification is the TRANSPORT's
1554
+ * job (the local harness logs it as skipped; the host ingress enforces it) —
1555
+ * never the partner handler's.
1556
+ */
1557
+ export type WebhookSignatureDeclaration = 'none' | {
1558
+ header: string;
1559
+ secretName: string;
1560
+ };
1561
+ /**
1562
+ * One delivery, as the handler receives it: transport-assigned id and receipt
1563
+ * time, the delivery headers, and the payload ALREADY parsed and validated
1564
+ * against the declaration's `payloadSchema`. A payload that fails the schema
1565
+ * never reaches the handler.
1566
+ */
1567
+ export interface WebhookEvent {
1568
+ id: string;
1569
+ /** ISO-8601 — when the transport accepted the delivery. */
1570
+ receivedAt: string;
1571
+ headers: Record<string, string>;
1572
+ /** The parsed, schema-validated payload (output of `payloadSchema`). */
1573
+ payload: unknown;
1574
+ }
1575
+ /**
1576
+ * What the handler tells the transport. `processed` acknowledges the event;
1577
+ * `ignored` acknowledges it as irrelevant (still a 2xx — the sender must not
1578
+ * retry). A handler that cannot process a valid event THROWS, which the
1579
+ * transport maps to a retryable failure.
1580
+ */
1581
+ export interface WebhookResult {
1582
+ status: 'processed' | 'ignored';
1583
+ detail?: string;
1584
+ }
1585
+ export interface PartnerWebhookDeclaration<Schemas extends StorageSchemas = StorageSchemas> {
1586
+ id: string;
1587
+ description: string;
1588
+ /** Validates every delivery before the handler runs. */
1589
+ payloadSchema: z.ZodType;
1590
+ signature: WebhookSignatureDeclaration;
1591
+ /**
1592
+ * A representative payload, JSON-compatible. Seeds the harness's payload
1593
+ * editor and documents the shape beside the schema.
1594
+ */
1595
+ examplePayload?: Record<string, JsonValue>;
1596
+ handler: (ctx: IntegrationContext<Schemas>, event: WebhookEvent) => Promise<WebhookResult>;
1597
+ }
1598
+ /**
1599
+ * One firing, as the handler receives it. `trigger` distinguishes the real
1600
+ * scheduler from a human pressing "Run now" (harness or admin) — handlers may
1601
+ * branch on it (e.g. skip idempotency windows for manual runs) but must be
1602
+ * safe under both.
1603
+ */
1604
+ export interface ScheduleInvocation {
1605
+ /** ISO-8601 — the tick this invocation stands for. */
1606
+ scheduledFor: string;
1607
+ /** ISO-8601 — when the handler actually started. */
1608
+ invokedAt: string;
1609
+ trigger: 'schedule' | 'manual';
1610
+ }
1611
+ /**
1612
+ * `completed` means the run did its work; `skipped` means it correctly did
1613
+ * nothing (not configured, nothing to do). A handler that fails THROWS, which
1614
+ * the transport records as a failed run.
1615
+ */
1616
+ export interface ScheduleResult {
1617
+ status: 'completed' | 'skipped';
1618
+ detail?: string;
1619
+ }
1620
+ export interface PartnerScheduleDeclaration<Schemas extends StorageSchemas = StorageSchemas> {
1621
+ id: string;
1622
+ description: string;
1623
+ /**
1624
+ * Standard 5-field cron (minute hour day-of-month month day-of-week),
1625
+ * validated by `defineIntegration()`. The schema package checks presence
1626
+ * only — full syntax validation is the SDK layer's job.
1627
+ */
1628
+ cron: string;
1629
+ handler: (ctx: IntegrationContext<Schemas>, invocation: ScheduleInvocation) => Promise<ScheduleResult>;
1630
+ }
1631
+ /**
1632
+ * The token set the transport hands `onTokens` after a code exchange (and
1633
+ * after each refresh). `raw` carries provider-specific extras verbatim.
1634
+ */
1635
+ export interface OAuthTokens {
1636
+ accessToken: string;
1637
+ refreshToken?: string;
1638
+ /** ISO-8601 expiry, when the provider reports one. */
1639
+ expiresAt?: string;
1640
+ scope?: string;
1641
+ tokenType?: string;
1642
+ raw?: Record<string, JsonValue>;
1643
+ }
1644
+ export interface OAuthProviderDeclaration {
1645
+ authorizationUrl: string;
1646
+ tokenUrl: string;
1647
+ scopes: string[];
1648
+ pkce?: boolean;
1649
+ }
1650
+ /**
1651
+ * The OAuth contract. The TRANSPORT owns the flow (authorize redirect, state,
1652
+ * callback, code exchange — localhost in the harness, hosted later); the
1653
+ * partner declares the provider endpoints, names the client-credential
1654
+ * secrets, and persists tokens in `onTokens` via `ctx.secrets` — so token
1655
+ * storage policy is the existing capability layer, nothing new.
1656
+ * `defineIntegration()` rejects the declaration unless both endpoint origins
1657
+ * are covered by the definition's `egress` list.
1658
+ */
1659
+ export interface PartnerOAuthDeclaration<Schemas extends StorageSchemas = StorageSchemas> {
1660
+ provider: OAuthProviderDeclaration;
1661
+ credentials: {
1662
+ clientIdSecretName: string;
1663
+ clientSecretSecretName: string;
1664
+ };
1665
+ onTokens: (ctx: IntegrationContext<Schemas>, tokens: OAuthTokens) => Promise<void>;
1666
+ }
1667
+ export interface IntegrationDefinition<Schemas extends StorageSchemas = StorageSchemas> {
1668
+ slug: string;
1669
+ name: string;
1670
+ description: string;
1671
+ version: string;
1672
+ capabilities?: IntegrationCapabilityDeclaration[];
1673
+ permissions?: IntegrationPermissionDeclaration[];
1674
+ components?: IntegrationComponentDeclarations;
1675
+ workspaceTargets?: WorkspaceTargetDefinition[];
1676
+ tools?: PartnerToolModule<Schemas>[];
1677
+ storage?: Schemas;
1678
+ egress?: string[];
1679
+ webhooks?: PartnerWebhookDeclaration<Schemas>[];
1680
+ schedules?: PartnerScheduleDeclaration<Schemas>[];
1681
+ oauth?: PartnerOAuthDeclaration<Schemas>;
1682
+ proposes?: IntegrationProposals;
1683
+ }
1684
+ /**
1685
+ * F4: reject accessor/proxy/class-instance/cyclic declaration containers
1686
+ * before parsing. An object with getters (or a proxy) can return validated
1687
+ * values during parse and different values later; a non-plain prototype can
1688
+ * smuggle mutable state past `z.object()`; a cycle would recurse into zod
1689
+ * rather than fail cleanly. We walk every CONTAINER (plain object / array),
1690
+ * and stop at legitimate leaves: functions (component refs, `run`) and zod
1691
+ * schemas (storage). Leaf detection happens BEFORE any own-property read, so
1692
+ * a `safeParse` getter cannot execute. Proxy detection is best-effort — the
1693
+ * re-parse at the host boundary (which materializes fresh values via zod) is
1694
+ * the real guard.
1695
+ *
1696
+ * Cycle detection tracks the ANCESTOR chain only (add on enter, remove on
1697
+ * exit): a genuine back-edge is a cycle, but the same object referenced from
1698
+ * two sibling branches (a DAG — e.g. a shallow-cloned widget sharing a
1699
+ * `layouts` object) is not, and must not be rejected.
1700
+ */
1701
+ export declare function assertPlainDeclaration(value: unknown, path?: string, ancestors?: WeakSet<object>): void;
1702
+ /**
1703
+ * Cycle-aware deep freeze (F4). Freezes plain objects and arrays; leaves zod
1704
+ * schemas (freezing breaks their internal caches) and functions alone.
1705
+ */
1706
+ export declare function deepFreezeDefinition(value: unknown): void;
1707
+ /**
1708
+ * The single validation entry point used by BOTH `defineIntegration()` (SDK,
1709
+ * authoring time) and `registerPartnerIntegration()` (core, host trust
1710
+ * boundary — F3). Rejects non-plain containers, then parses against the
1711
+ * canonical schema, and returns the SANITIZED `result.data` (fresh, plain,
1712
+ * strict-stripped — never the caller's original object). Throws an Error
1713
+ * whose message is a remediation instruction.
1714
+ */
1715
+ export declare function parseIntegrationDefinition(input: unknown): IntegrationDefinition;
1716
+ /**
1717
+ * THE canonical effective MCP tool name — the single source of truth for how
1718
+ * discovery keys a tool. Tool discovery namespaces each raw tool name with the
1719
+ * integration slug (`slug.replace(/-/g,'_')`), skipping the prefix when the
1720
+ * name already carries it. Two collision-free RAW pairs can therefore collapse
1721
+ * to the same EFFECTIVE name (`{slug:"foo",tool:"bar_baz"}` and
1722
+ * `{slug:"foo-bar",tool:"baz"}` both become `foo_bar_baz`), so collision
1723
+ * checking MUST compare effective names, and runtime discovery MUST throw on a
1724
+ * duplicate assignment. Both call this one helper
1725
+ * (`packages/agents/src/tools/tool-discovery.ts`).
1726
+ */
1727
+ export declare function getDiscoveredToolName(slug: string, rawName: string): string;
1728
+ /**
1729
+ * The metadata-only shape collision checking needs — no handlers, no schemas
1730
+ * (F8: collision validation must not force widening the tool handlers). A
1731
+ * full `IntegrationDefinition` is assignable to it.
1732
+ */
1733
+ export interface DefinitionCollisionInput {
1734
+ slug: string;
1735
+ components?: {
1736
+ widgets?: readonly {
1737
+ id: string;
1738
+ }[];
1739
+ } | null;
1740
+ tools?: readonly {
1741
+ name: string;
1742
+ }[] | null;
1743
+ }
1744
+ /**
1745
+ * First-party identifiers a partner definition must not collide with (F5).
1746
+ * Widget lookup matches on `widget.id` and the assistant's tool list is a
1747
+ * flat name-keyed map where a later registration overwrites an earlier one,
1748
+ * so a partner reusing a first-party id/name silently hijacks it. Sourced
1749
+ * from the reviewed registry inventory, not from executing partner handlers.
1750
+ */
1751
+ export interface FirstPartyInventory {
1752
+ slugs?: readonly string[];
1753
+ widgetIds?: readonly string[];
1754
+ /**
1755
+ * EFFECTIVE (discovery) tool names — `getDiscoveredToolName(slug, rawName)` —
1756
+ * NOT raw names, since discovery keys the flat registry by the effective name.
1757
+ */
1758
+ toolNames?: readonly string[];
1759
+ }
1760
+ /**
1761
+ * Detects cross-definition collisions (duplicate slugs, widget ids, tool
1762
+ * names across the partner set) AND collisions against the first-party
1763
+ * inventory, throwing one error listing EVERY collision.
1764
+ *
1765
+ * This is the build-time gate the host registry deliberately lacks:
1766
+ * `integrationRegistry.register()` keys by slug via `Map.set` and silently
1767
+ * OVERWRITES, and duplicate widget/tool ids resolve last- or
1768
+ * first-registration-wins by import order.
1769
+ */
1770
+ export declare function validateIntegrationDefinitions(definitions: readonly DefinitionCollisionInput[], firstParty?: FirstPartyInventory): void;
1771
+ export {};