@composable-os/sdk 0.0.0-stage → 0.1.0-beta.7

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 (72) hide show
  1. package/LICENSE +109 -0
  2. package/dist/automation-check.d.ts +38 -0
  3. package/dist/automation-check.js +454 -0
  4. package/dist/automation.d.ts +767 -0
  5. package/dist/automation.js +303 -0
  6. package/dist/behaviour.d.ts +3 -0
  7. package/dist/behaviour.js +153 -0
  8. package/dist/capacity.d.ts +51 -0
  9. package/dist/capacity.js +68 -0
  10. package/dist/contract.d.ts +706 -0
  11. package/dist/contract.js +42 -0
  12. package/dist/document.d.ts +165 -0
  13. package/dist/document.js +636 -0
  14. package/dist/field-types.d.ts +11 -0
  15. package/dist/field-types.js +93 -0
  16. package/dist/formula/ast.d.ts +67 -0
  17. package/dist/formula/ast.js +22 -0
  18. package/dist/formula/compile.d.ts +37 -0
  19. package/dist/formula/compile.js +379 -0
  20. package/dist/formula/index.d.ts +3 -0
  21. package/dist/formula/index.js +4 -0
  22. package/dist/formula/parser.d.ts +13 -0
  23. package/dist/formula/parser.js +365 -0
  24. package/dist/index.d.ts +17 -0
  25. package/dist/index.js +21 -0
  26. package/dist/manifest.d.ts +1131 -0
  27. package/dist/manifest.js +1229 -0
  28. package/dist/media.d.ts +9 -0
  29. package/dist/media.js +43 -0
  30. package/dist/permissions.d.ts +17 -0
  31. package/dist/permissions.js +44 -0
  32. package/dist/renamed.d.ts +16 -0
  33. package/dist/renamed.js +59 -0
  34. package/dist/rich-text-fixture.d.ts +121 -0
  35. package/dist/rich-text-fixture.js +67 -0
  36. package/dist/rich-text.d.ts +34 -0
  37. package/dist/rich-text.js +138 -0
  38. package/dist/runtime.d.ts +95 -0
  39. package/dist/runtime.js +312 -0
  40. package/dist/sellable.d.ts +103 -0
  41. package/dist/sellable.js +258 -0
  42. package/dist/slug.d.ts +11 -0
  43. package/dist/slug.js +23 -0
  44. package/dist/states.d.ts +64 -0
  45. package/dist/states.js +101 -0
  46. package/dist/testing.d.ts +151 -0
  47. package/dist/testing.js +670 -0
  48. package/package.json +34 -4
  49. package/src/automation-check.ts +534 -0
  50. package/src/automation.ts +743 -0
  51. package/src/behaviour.ts +215 -0
  52. package/src/capacity.ts +112 -0
  53. package/src/contract.ts +766 -0
  54. package/src/document.ts +788 -0
  55. package/src/field-types.ts +106 -0
  56. package/src/formula/ast.ts +72 -0
  57. package/src/formula/compile.ts +454 -0
  58. package/src/formula/index.ts +4 -0
  59. package/src/formula/parser.ts +417 -0
  60. package/src/index.ts +33 -0
  61. package/src/manifest.ts +1484 -0
  62. package/src/media.ts +46 -0
  63. package/src/permissions.ts +60 -0
  64. package/src/renamed.ts +63 -0
  65. package/src/rich-text-fixture.ts +68 -0
  66. package/src/rich-text.ts +173 -0
  67. package/src/runtime.ts +410 -0
  68. package/src/sellable.ts +396 -0
  69. package/src/slug.ts +25 -0
  70. package/src/states.ts +162 -0
  71. package/src/testing.ts +836 -0
  72. package/README.md +0 -3
@@ -0,0 +1,1131 @@
1
+ import { z } from "zod";
2
+ import { type Extension, type HostModuleName } from "./contract.ts";
3
+ import { type FieldTypeName } from "./field-types.ts";
4
+ import { type FormulaFieldRef } from "./formula/compile.ts";
5
+ export declare const EXTENSION_ID_RE: RegExp;
6
+ export declare const OBJECT_NAME_RE: RegExp;
7
+ export declare const FIELD_NAME_RE: RegExp;
8
+ export declare const TOOL_NAME_RE: RegExp;
9
+ /** Core objects extension fields can target, and which extension objects may not be named. */
10
+ export declare const CORE_OBJECT_NAMES: readonly ["person", "organisation", "activity", "task"];
11
+ /** Field names every record already has. */
12
+ export declare const RESERVED_FIELD_NAMES: Set<string>;
13
+ /** Operation prefixes no extension may be granted. */
14
+ export declare const FORBIDDEN_OPERATION_PREFIXES: readonly ["extension.", "policy.", "user.", "audit."];
15
+ /** Objects relations may point at. */
16
+ export declare const RELATION_CORE_TARGETS: readonly ["person", "organisation", "task"];
17
+ export declare const fieldManifestSchema: z.ZodObject<{
18
+ type: z.ZodEnum<{
19
+ number: "number";
20
+ boolean: "boolean";
21
+ text: "text";
22
+ longText: "longText";
23
+ currency: "currency";
24
+ percent: "percent";
25
+ date: "date";
26
+ datetime: "datetime";
27
+ select: "select";
28
+ multiSelect: "multiSelect";
29
+ relation: "relation";
30
+ user: "user";
31
+ email: "email";
32
+ phone: "phone";
33
+ url: "url";
34
+ formula: "formula";
35
+ document: "document";
36
+ timezone: "timezone";
37
+ richText: "richText";
38
+ slug: "slug";
39
+ image: "image";
40
+ }>;
41
+ label: z.ZodString;
42
+ description: z.ZodOptional<z.ZodString>;
43
+ track: z.ZodOptional<z.ZodLiteral<"timeline">>;
44
+ renamedFrom: z.ZodOptional<z.ZodString>;
45
+ required: z.ZodOptional<z.ZodBoolean>;
46
+ readOnly: z.ZodOptional<z.ZodBoolean>;
47
+ currency: z.ZodOptional<z.ZodString>;
48
+ options: z.ZodOptional<z.ZodArray<z.ZodObject<{
49
+ value: z.ZodString;
50
+ label: z.ZodString;
51
+ color: z.ZodOptional<z.ZodString>;
52
+ requires: z.ZodOptional<z.ZodArray<z.ZodString>>;
53
+ fixed: z.ZodOptional<z.ZodBoolean>;
54
+ }, z.core.$strip>>>;
55
+ editableOptions: z.ZodOptional<z.ZodBoolean>;
56
+ default: z.ZodOptional<z.ZodUnion<readonly [z.ZodString, z.ZodNumber, z.ZodBoolean]>>;
57
+ defaultSetting: z.ZodOptional<z.ZodString>;
58
+ to: z.ZodOptional<z.ZodString>;
59
+ many: z.ZodOptional<z.ZodBoolean>;
60
+ expression: z.ZodOptional<z.ZodString>;
61
+ min: z.ZodOptional<z.ZodNumber>;
62
+ max: z.ZodOptional<z.ZodNumber>;
63
+ step: z.ZodOptional<z.ZodNumber>;
64
+ schema: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
65
+ maxBytes: z.ZodOptional<z.ZodNumber>;
66
+ paths: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodObject<{
67
+ label: z.ZodString;
68
+ path: z.ZodString;
69
+ count: z.ZodOptional<z.ZodBoolean>;
70
+ description: z.ZodOptional<z.ZodString>;
71
+ }, z.core.$strict>>>;
72
+ }, z.core.$strip>;
73
+ export type FieldManifest = z.infer<typeof fieldManifestSchema>;
74
+ /** Whether `value` is a whole number of `step`s from `from` (with room for binary fractions). */
75
+ export declare function onStep(value: number, from: number, step: number): boolean;
76
+ /** Field names a publishable object's records get from the host (ADR 0446). */
77
+ export declare const PUBLISHED_FIELD_NAMES: readonly ["publishedVersion", "publishedAt", "publishState", "publishAt"];
78
+ export declare const stagesManifestSchema: z.ZodObject<{
79
+ field: z.ZodString;
80
+ stage: z.ZodObject<{
81
+ type: z.ZodString;
82
+ order: z.ZodString;
83
+ requiredFields: z.ZodOptional<z.ZodString>;
84
+ probability: z.ZodOptional<z.ZodString>;
85
+ group: z.ZodOptional<z.ZodString>;
86
+ }, z.core.$strip>;
87
+ group: z.ZodOptional<z.ZodString>;
88
+ probability: z.ZodOptional<z.ZodObject<{
89
+ field: z.ZodString;
90
+ overridden: z.ZodString;
91
+ }, z.core.$strip>>;
92
+ closedDate: z.ZodOptional<z.ZodString>;
93
+ status: z.ZodOptional<z.ZodString>;
94
+ defaultGroupSetting: z.ZodOptional<z.ZodString>;
95
+ requiredByType: z.ZodOptional<z.ZodRecord<z.ZodEnum<{
96
+ open: "open";
97
+ won: "won";
98
+ lost: "lost";
99
+ }> & z.core.$partial, z.ZodArray<z.ZodString>>>;
100
+ }, z.core.$strip>;
101
+ export type StagesManifest = z.infer<typeof stagesManifestSchema>;
102
+ export declare const objectManifestSchema: z.ZodObject<{
103
+ label: z.ZodString;
104
+ plural: z.ZodString;
105
+ icon: z.ZodOptional<z.ZodString>;
106
+ titleField: z.ZodString;
107
+ description: z.ZodOptional<z.ZodString>;
108
+ renamedFrom: z.ZodOptional<z.ZodString>;
109
+ fields: z.ZodRecord<z.ZodString, z.ZodObject<{
110
+ type: z.ZodEnum<{
111
+ number: "number";
112
+ boolean: "boolean";
113
+ text: "text";
114
+ longText: "longText";
115
+ currency: "currency";
116
+ percent: "percent";
117
+ date: "date";
118
+ datetime: "datetime";
119
+ select: "select";
120
+ multiSelect: "multiSelect";
121
+ relation: "relation";
122
+ user: "user";
123
+ email: "email";
124
+ phone: "phone";
125
+ url: "url";
126
+ formula: "formula";
127
+ document: "document";
128
+ timezone: "timezone";
129
+ richText: "richText";
130
+ slug: "slug";
131
+ image: "image";
132
+ }>;
133
+ label: z.ZodString;
134
+ description: z.ZodOptional<z.ZodString>;
135
+ track: z.ZodOptional<z.ZodLiteral<"timeline">>;
136
+ renamedFrom: z.ZodOptional<z.ZodString>;
137
+ required: z.ZodOptional<z.ZodBoolean>;
138
+ readOnly: z.ZodOptional<z.ZodBoolean>;
139
+ currency: z.ZodOptional<z.ZodString>;
140
+ options: z.ZodOptional<z.ZodArray<z.ZodObject<{
141
+ value: z.ZodString;
142
+ label: z.ZodString;
143
+ color: z.ZodOptional<z.ZodString>;
144
+ requires: z.ZodOptional<z.ZodArray<z.ZodString>>;
145
+ fixed: z.ZodOptional<z.ZodBoolean>;
146
+ }, z.core.$strip>>>;
147
+ editableOptions: z.ZodOptional<z.ZodBoolean>;
148
+ default: z.ZodOptional<z.ZodUnion<readonly [z.ZodString, z.ZodNumber, z.ZodBoolean]>>;
149
+ defaultSetting: z.ZodOptional<z.ZodString>;
150
+ to: z.ZodOptional<z.ZodString>;
151
+ many: z.ZodOptional<z.ZodBoolean>;
152
+ expression: z.ZodOptional<z.ZodString>;
153
+ min: z.ZodOptional<z.ZodNumber>;
154
+ max: z.ZodOptional<z.ZodNumber>;
155
+ step: z.ZodOptional<z.ZodNumber>;
156
+ schema: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
157
+ maxBytes: z.ZodOptional<z.ZodNumber>;
158
+ paths: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodObject<{
159
+ label: z.ZodString;
160
+ path: z.ZodString;
161
+ count: z.ZodOptional<z.ZodBoolean>;
162
+ description: z.ZodOptional<z.ZodString>;
163
+ }, z.core.$strict>>>;
164
+ }, z.core.$strip>>;
165
+ navigation: z.ZodOptional<z.ZodEnum<{
166
+ main: "main";
167
+ settings: "settings";
168
+ none: "none";
169
+ }>>;
170
+ indexes: z.ZodOptional<z.ZodArray<z.ZodArray<z.ZodString>>>;
171
+ timelineLinks: z.ZodOptional<z.ZodArray<z.ZodString>>;
172
+ stages: z.ZodOptional<z.ZodObject<{
173
+ field: z.ZodString;
174
+ stage: z.ZodObject<{
175
+ type: z.ZodString;
176
+ order: z.ZodString;
177
+ requiredFields: z.ZodOptional<z.ZodString>;
178
+ probability: z.ZodOptional<z.ZodString>;
179
+ group: z.ZodOptional<z.ZodString>;
180
+ }, z.core.$strip>;
181
+ group: z.ZodOptional<z.ZodString>;
182
+ probability: z.ZodOptional<z.ZodObject<{
183
+ field: z.ZodString;
184
+ overridden: z.ZodString;
185
+ }, z.core.$strip>>;
186
+ closedDate: z.ZodOptional<z.ZodString>;
187
+ status: z.ZodOptional<z.ZodString>;
188
+ defaultGroupSetting: z.ZodOptional<z.ZodString>;
189
+ requiredByType: z.ZodOptional<z.ZodRecord<z.ZodEnum<{
190
+ open: "open";
191
+ won: "won";
192
+ lost: "lost";
193
+ }> & z.core.$partial, z.ZodArray<z.ZodString>>>;
194
+ }, z.core.$strip>>;
195
+ capacity: z.ZodOptional<z.ZodObject<{
196
+ places: z.ZodString;
197
+ pool: z.ZodOptional<z.ZodString>;
198
+ show: z.ZodOptional<z.ZodEnum<{
199
+ exact: "exact";
200
+ low: "low";
201
+ availability: "availability";
202
+ }>>;
203
+ lowAt: z.ZodOptional<z.ZodNumber>;
204
+ releaseOnRefund: z.ZodOptional<z.ZodBoolean>;
205
+ }, z.core.$strict>>;
206
+ sellable: z.ZodOptional<z.ZodObject<{
207
+ price: z.ZodString;
208
+ currency: z.ZodOptional<z.ZodString>;
209
+ saleWindow: z.ZodOptional<z.ZodObject<{
210
+ from: z.ZodOptional<z.ZodString>;
211
+ until: z.ZodOptional<z.ZodString>;
212
+ }, z.core.$strict>>;
213
+ maxPerOrder: z.ZodOptional<z.ZodString>;
214
+ deposit: z.ZodOptional<z.ZodObject<{
215
+ amount: z.ZodOptional<z.ZodString>;
216
+ balanceDue: z.ZodOptional<z.ZodString>;
217
+ }, z.core.$strict>>;
218
+ grants: z.ZodOptional<z.ZodObject<{
219
+ object: z.ZodString;
220
+ set: z.ZodRecord<z.ZodString, z.ZodUnion<readonly [z.ZodEnum<{
221
+ item: "item";
222
+ order: "order";
223
+ "order.person": "order.person";
224
+ "order.email": "order.email";
225
+ line: "line";
226
+ "line.title": "line.title";
227
+ "line.unitPrice": "line.unitPrice";
228
+ code: "code";
229
+ }>, z.ZodString]>>;
230
+ void: z.ZodString;
231
+ }, z.core.$strict>>;
232
+ }, z.core.$strict>>;
233
+ states: z.ZodOptional<z.ZodObject<{
234
+ field: z.ZodString;
235
+ initial: z.ZodString;
236
+ moves: z.ZodArray<z.ZodObject<{
237
+ from: z.ZodUnion<readonly [z.ZodString, z.ZodArray<z.ZodString>]>;
238
+ to: z.ZodString;
239
+ by: z.ZodArray<z.ZodEnum<{
240
+ staff: "staff";
241
+ customer: "customer";
242
+ host: "host";
243
+ }>>;
244
+ requires: z.ZodOptional<z.ZodArray<z.ZodString>>;
245
+ final: z.ZodOptional<z.ZodBoolean>;
246
+ }, z.core.$strip>>;
247
+ }, z.core.$strip>>;
248
+ owner: z.ZodOptional<z.ZodString>;
249
+ customer: z.ZodOptional<z.ZodObject<{
250
+ field: z.ZodString;
251
+ read: z.ZodArray<z.ZodString>;
252
+ write: z.ZodArray<z.ZodString>;
253
+ }, z.core.$strict>>;
254
+ public: z.ZodOptional<z.ZodObject<{
255
+ read: z.ZodArray<z.ZodString>;
256
+ when: z.ZodOptional<z.ZodObject<{
257
+ via: z.ZodOptional<z.ZodString>;
258
+ field: z.ZodString;
259
+ in: z.ZodArray<z.ZodString>;
260
+ }, z.core.$strict>>;
261
+ }, z.core.$strict>>;
262
+ signedIn: z.ZodOptional<z.ZodObject<{
263
+ read: z.ZodArray<z.ZodString>;
264
+ when: z.ZodOptional<z.ZodObject<{
265
+ via: z.ZodOptional<z.ZodString>;
266
+ field: z.ZodString;
267
+ in: z.ZodArray<z.ZodString>;
268
+ }, z.core.$strict>>;
269
+ }, z.core.$strict>>;
270
+ customerVia: z.ZodOptional<z.ZodObject<{
271
+ from: z.ZodString;
272
+ field: z.ZodString;
273
+ read: z.ZodArray<z.ZodString>;
274
+ }, z.core.$strict>>;
275
+ publishable: z.ZodOptional<z.ZodObject<{
276
+ content: z.ZodArray<z.ZodString>;
277
+ slug: z.ZodOptional<z.ZodString>;
278
+ date: z.ZodOptional<z.ZodString>;
279
+ }, z.core.$strict>>;
280
+ navigationOrder: z.ZodOptional<z.ZodNumber>;
281
+ requireOneOf: z.ZodOptional<z.ZodArray<z.ZodArray<z.ZodString>>>;
282
+ titleDefault: z.ZodOptional<z.ZodObject<{
283
+ from: z.ZodArray<z.ZodString>;
284
+ suffix: z.ZodOptional<z.ZodString>;
285
+ }, z.core.$strip>>;
286
+ seed: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodRecord<z.ZodString, z.ZodUnknown>>>;
287
+ }, z.core.$strip>;
288
+ export type ObjectManifest = z.infer<typeof objectManifestSchema>;
289
+ export declare const recordActionManifestSchema: z.ZodObject<{
290
+ object: z.ZodString;
291
+ label: z.ZodString;
292
+ idInput: z.ZodString;
293
+ confirm: z.ZodOptional<z.ZodString>;
294
+ ask: z.ZodOptional<z.ZodObject<{
295
+ input: z.ZodString;
296
+ label: z.ZodString;
297
+ options: z.ZodArray<z.ZodObject<{
298
+ value: z.ZodString;
299
+ label: z.ZodString;
300
+ }, z.core.$strip>>;
301
+ }, z.core.$strip>>;
302
+ hideWhen: z.ZodOptional<z.ZodObject<{
303
+ field: z.ZodString;
304
+ values: z.ZodArray<z.ZodString>;
305
+ }, z.core.$strip>>;
306
+ }, z.core.$strip>;
307
+ export type RecordActionManifest = z.infer<typeof recordActionManifestSchema>;
308
+ export declare const toolManifestSchema: z.ZodObject<{
309
+ description: z.ZodString;
310
+ risk: z.ZodEnum<{
311
+ read: "read";
312
+ write: "write";
313
+ "bulk-write": "bulk-write";
314
+ destructive: "destructive";
315
+ }>;
316
+ recordAction: z.ZodOptional<z.ZodObject<{
317
+ object: z.ZodString;
318
+ label: z.ZodString;
319
+ idInput: z.ZodString;
320
+ confirm: z.ZodOptional<z.ZodString>;
321
+ ask: z.ZodOptional<z.ZodObject<{
322
+ input: z.ZodString;
323
+ label: z.ZodString;
324
+ options: z.ZodArray<z.ZodObject<{
325
+ value: z.ZodString;
326
+ label: z.ZodString;
327
+ }, z.core.$strip>>;
328
+ }, z.core.$strip>>;
329
+ hideWhen: z.ZodOptional<z.ZodObject<{
330
+ field: z.ZodString;
331
+ values: z.ZodArray<z.ZodString>;
332
+ }, z.core.$strip>>;
333
+ }, z.core.$strip>>;
334
+ audiences: z.ZodOptional<z.ZodArray<z.ZodEnum<{
335
+ staff: "staff";
336
+ customer: "customer";
337
+ public: "public";
338
+ }>>>;
339
+ customerFields: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodArray<z.ZodString>>>;
340
+ permission: z.ZodOptional<z.ZodString>;
341
+ inputSchema: z.ZodRecord<z.ZodString, z.ZodUnknown>;
342
+ outputSchema: z.ZodRecord<z.ZodString, z.ZodUnknown>;
343
+ }, z.core.$strip>;
344
+ export type ToolManifest = z.infer<typeof toolManifestSchema>;
345
+ /** A fixed staff role (ADR 0436): see `RoleSpec`. */
346
+ export declare const roleManifestSchema: z.ZodObject<{
347
+ label: z.ZodString;
348
+ description: z.ZodString;
349
+ permissions: z.ZodDefault<z.ZodArray<z.ZodString>>;
350
+ read: z.ZodDefault<z.ZodArray<z.ZodString>>;
351
+ }, z.core.$strip>;
352
+ export type RoleManifest = z.infer<typeof roleManifestSchema>;
353
+ /** A role's or a tool's permission: `<extension id>:<word>`. */
354
+ export declare const EXTENSION_PERMISSION_RE: RegExp;
355
+ export declare const viewManifestSchema: z.ZodObject<{
356
+ label: z.ZodString;
357
+ object: z.ZodString;
358
+ type: z.ZodOptional<z.ZodEnum<{
359
+ table: "table";
360
+ board: "board";
361
+ calendar: "calendar";
362
+ gallery: "gallery";
363
+ }>>;
364
+ filter: z.ZodOptional<z.ZodUnknown>;
365
+ sort: z.ZodOptional<z.ZodObject<{
366
+ field: z.ZodString;
367
+ direction: z.ZodDefault<z.ZodEnum<{
368
+ asc: "asc";
369
+ desc: "desc";
370
+ }>>;
371
+ }, z.core.$strip>>;
372
+ columns: z.ZodOptional<z.ZodArray<z.ZodString>>;
373
+ groupBy: z.ZodOptional<z.ZodString>;
374
+ sumField: z.ZodOptional<z.ZodString>;
375
+ dateField: z.ZodOptional<z.ZodString>;
376
+ mode: z.ZodOptional<z.ZodEnum<{
377
+ month: "month";
378
+ week: "week";
379
+ agenda: "agenda";
380
+ }>>;
381
+ imageField: z.ZodOptional<z.ZodString>;
382
+ cardFields: z.ZodOptional<z.ZodArray<z.ZodString>>;
383
+ }, z.core.$strip>;
384
+ export type ViewManifest = z.infer<typeof viewManifestSchema>;
385
+ export declare const recordViewManifestSchema: z.ZodObject<{
386
+ label: z.ZodString;
387
+ on: z.ZodString;
388
+ view: z.ZodObject<{
389
+ type: z.ZodEnum<{
390
+ table: "table";
391
+ board: "board";
392
+ calendar: "calendar";
393
+ gallery: "gallery";
394
+ }>;
395
+ object: z.ZodString;
396
+ relation: z.ZodString;
397
+ filter: z.ZodOptional<z.ZodUnknown>;
398
+ sort: z.ZodOptional<z.ZodObject<{
399
+ field: z.ZodString;
400
+ direction: z.ZodDefault<z.ZodEnum<{
401
+ asc: "asc";
402
+ desc: "desc";
403
+ }>>;
404
+ }, z.core.$strip>>;
405
+ columns: z.ZodOptional<z.ZodArray<z.ZodString>>;
406
+ groupBy: z.ZodOptional<z.ZodString>;
407
+ sumField: z.ZodOptional<z.ZodString>;
408
+ dateField: z.ZodOptional<z.ZodString>;
409
+ mode: z.ZodOptional<z.ZodEnum<{
410
+ month: "month";
411
+ week: "week";
412
+ agenda: "agenda";
413
+ }>>;
414
+ imageField: z.ZodOptional<z.ZodString>;
415
+ cardFields: z.ZodOptional<z.ZodArray<z.ZodString>>;
416
+ }, z.core.$strip>;
417
+ order: z.ZodDefault<z.ZodNumber>;
418
+ }, z.core.$strip>;
419
+ export type RecordViewManifest = z.infer<typeof recordViewManifestSchema>;
420
+ /**
421
+ * A dashboard an extension ships (stage 4b): read-only for everyone, listed beside the CRM's own
422
+ * Overview while the extension is active, copyable. `home` makes it the default Home. The host
423
+ * validates `filters` and `widgets` against its dashboard spec (ADR 0057) at check time.
424
+ */
425
+ export declare const dashboardManifestSchema: z.ZodObject<{
426
+ title: z.ZodString;
427
+ description: z.ZodOptional<z.ZodString>;
428
+ home: z.ZodOptional<z.ZodBoolean>;
429
+ filters: z.ZodDefault<z.ZodArray<z.ZodRecord<z.ZodString, z.ZodUnknown>>>;
430
+ widgets: z.ZodArray<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
431
+ }, z.core.$strip>;
432
+ export type DashboardManifest = z.infer<typeof dashboardManifestSchema>;
433
+ export declare const settingManifestSchema: z.ZodObject<{
434
+ type: z.ZodEnum<{
435
+ number: "number";
436
+ boolean: "boolean";
437
+ text: "text";
438
+ select: "select";
439
+ }>;
440
+ label: z.ZodString;
441
+ description: z.ZodOptional<z.ZodString>;
442
+ required: z.ZodOptional<z.ZodBoolean>;
443
+ default: z.ZodOptional<z.ZodUnion<readonly [z.ZodString, z.ZodNumber, z.ZodBoolean]>>;
444
+ min: z.ZodOptional<z.ZodNumber>;
445
+ max: z.ZodOptional<z.ZodNumber>;
446
+ options: z.ZodOptional<z.ZodArray<z.ZodObject<{
447
+ value: z.ZodString;
448
+ label: z.ZodString;
449
+ color: z.ZodOptional<z.ZodString>;
450
+ requires: z.ZodOptional<z.ZodArray<z.ZodString>>;
451
+ fixed: z.ZodOptional<z.ZodBoolean>;
452
+ }, z.core.$strip>>>;
453
+ }, z.core.$strip>;
454
+ export type SettingManifest = z.infer<typeof settingManifestSchema>;
455
+ export declare const permissionsManifestSchema: z.ZodObject<{
456
+ read: z.ZodDefault<z.ZodArray<z.ZodString>>;
457
+ write: z.ZodDefault<z.ZodArray<z.ZodString>>;
458
+ operations: z.ZodDefault<z.ZodArray<z.ZodString>>;
459
+ modules: z.ZodDefault<z.ZodArray<z.ZodEnum<{
460
+ email: "email";
461
+ ops: "ops";
462
+ storage: "storage";
463
+ log: "log";
464
+ ai: "ai";
465
+ google: "google";
466
+ microsoft: "microsoft";
467
+ slack: "slack";
468
+ "slack-post": "slack-post";
469
+ mcp: "mcp";
470
+ "email-send": "email-send";
471
+ zoominfo: "zoominfo";
472
+ websearch: "websearch";
473
+ webhook: "webhook";
474
+ fake: "fake";
475
+ }>>>;
476
+ }, z.core.$strip>;
477
+ export type PermissionsManifest = z.infer<typeof permissionsManifestSchema>;
478
+ export declare const manifestSchema: z.ZodObject<{
479
+ id: z.ZodString;
480
+ version: z.ZodString;
481
+ contractVersion: z.ZodNumber;
482
+ label: z.ZodOptional<z.ZodString>;
483
+ description: z.ZodOptional<z.ZodString>;
484
+ permissions: z.ZodDefault<z.ZodObject<{
485
+ read: z.ZodDefault<z.ZodArray<z.ZodString>>;
486
+ write: z.ZodDefault<z.ZodArray<z.ZodString>>;
487
+ operations: z.ZodDefault<z.ZodArray<z.ZodString>>;
488
+ modules: z.ZodDefault<z.ZodArray<z.ZodEnum<{
489
+ email: "email";
490
+ ops: "ops";
491
+ storage: "storage";
492
+ log: "log";
493
+ ai: "ai";
494
+ google: "google";
495
+ microsoft: "microsoft";
496
+ slack: "slack";
497
+ "slack-post": "slack-post";
498
+ mcp: "mcp";
499
+ "email-send": "email-send";
500
+ zoominfo: "zoominfo";
501
+ websearch: "websearch";
502
+ webhook: "webhook";
503
+ fake: "fake";
504
+ }>>>;
505
+ }, z.core.$strip>>;
506
+ objects: z.ZodDefault<z.ZodRecord<z.ZodString, z.ZodObject<{
507
+ label: z.ZodString;
508
+ plural: z.ZodString;
509
+ icon: z.ZodOptional<z.ZodString>;
510
+ titleField: z.ZodString;
511
+ description: z.ZodOptional<z.ZodString>;
512
+ renamedFrom: z.ZodOptional<z.ZodString>;
513
+ fields: z.ZodRecord<z.ZodString, z.ZodObject<{
514
+ type: z.ZodEnum<{
515
+ number: "number";
516
+ boolean: "boolean";
517
+ text: "text";
518
+ longText: "longText";
519
+ currency: "currency";
520
+ percent: "percent";
521
+ date: "date";
522
+ datetime: "datetime";
523
+ select: "select";
524
+ multiSelect: "multiSelect";
525
+ relation: "relation";
526
+ user: "user";
527
+ email: "email";
528
+ phone: "phone";
529
+ url: "url";
530
+ formula: "formula";
531
+ document: "document";
532
+ timezone: "timezone";
533
+ richText: "richText";
534
+ slug: "slug";
535
+ image: "image";
536
+ }>;
537
+ label: z.ZodString;
538
+ description: z.ZodOptional<z.ZodString>;
539
+ track: z.ZodOptional<z.ZodLiteral<"timeline">>;
540
+ renamedFrom: z.ZodOptional<z.ZodString>;
541
+ required: z.ZodOptional<z.ZodBoolean>;
542
+ readOnly: z.ZodOptional<z.ZodBoolean>;
543
+ currency: z.ZodOptional<z.ZodString>;
544
+ options: z.ZodOptional<z.ZodArray<z.ZodObject<{
545
+ value: z.ZodString;
546
+ label: z.ZodString;
547
+ color: z.ZodOptional<z.ZodString>;
548
+ requires: z.ZodOptional<z.ZodArray<z.ZodString>>;
549
+ fixed: z.ZodOptional<z.ZodBoolean>;
550
+ }, z.core.$strip>>>;
551
+ editableOptions: z.ZodOptional<z.ZodBoolean>;
552
+ default: z.ZodOptional<z.ZodUnion<readonly [z.ZodString, z.ZodNumber, z.ZodBoolean]>>;
553
+ defaultSetting: z.ZodOptional<z.ZodString>;
554
+ to: z.ZodOptional<z.ZodString>;
555
+ many: z.ZodOptional<z.ZodBoolean>;
556
+ expression: z.ZodOptional<z.ZodString>;
557
+ min: z.ZodOptional<z.ZodNumber>;
558
+ max: z.ZodOptional<z.ZodNumber>;
559
+ step: z.ZodOptional<z.ZodNumber>;
560
+ schema: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
561
+ maxBytes: z.ZodOptional<z.ZodNumber>;
562
+ paths: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodObject<{
563
+ label: z.ZodString;
564
+ path: z.ZodString;
565
+ count: z.ZodOptional<z.ZodBoolean>;
566
+ description: z.ZodOptional<z.ZodString>;
567
+ }, z.core.$strict>>>;
568
+ }, z.core.$strip>>;
569
+ navigation: z.ZodOptional<z.ZodEnum<{
570
+ main: "main";
571
+ settings: "settings";
572
+ none: "none";
573
+ }>>;
574
+ indexes: z.ZodOptional<z.ZodArray<z.ZodArray<z.ZodString>>>;
575
+ timelineLinks: z.ZodOptional<z.ZodArray<z.ZodString>>;
576
+ stages: z.ZodOptional<z.ZodObject<{
577
+ field: z.ZodString;
578
+ stage: z.ZodObject<{
579
+ type: z.ZodString;
580
+ order: z.ZodString;
581
+ requiredFields: z.ZodOptional<z.ZodString>;
582
+ probability: z.ZodOptional<z.ZodString>;
583
+ group: z.ZodOptional<z.ZodString>;
584
+ }, z.core.$strip>;
585
+ group: z.ZodOptional<z.ZodString>;
586
+ probability: z.ZodOptional<z.ZodObject<{
587
+ field: z.ZodString;
588
+ overridden: z.ZodString;
589
+ }, z.core.$strip>>;
590
+ closedDate: z.ZodOptional<z.ZodString>;
591
+ status: z.ZodOptional<z.ZodString>;
592
+ defaultGroupSetting: z.ZodOptional<z.ZodString>;
593
+ requiredByType: z.ZodOptional<z.ZodRecord<z.ZodEnum<{
594
+ open: "open";
595
+ won: "won";
596
+ lost: "lost";
597
+ }> & z.core.$partial, z.ZodArray<z.ZodString>>>;
598
+ }, z.core.$strip>>;
599
+ capacity: z.ZodOptional<z.ZodObject<{
600
+ places: z.ZodString;
601
+ pool: z.ZodOptional<z.ZodString>;
602
+ show: z.ZodOptional<z.ZodEnum<{
603
+ exact: "exact";
604
+ low: "low";
605
+ availability: "availability";
606
+ }>>;
607
+ lowAt: z.ZodOptional<z.ZodNumber>;
608
+ releaseOnRefund: z.ZodOptional<z.ZodBoolean>;
609
+ }, z.core.$strict>>;
610
+ sellable: z.ZodOptional<z.ZodObject<{
611
+ price: z.ZodString;
612
+ currency: z.ZodOptional<z.ZodString>;
613
+ saleWindow: z.ZodOptional<z.ZodObject<{
614
+ from: z.ZodOptional<z.ZodString>;
615
+ until: z.ZodOptional<z.ZodString>;
616
+ }, z.core.$strict>>;
617
+ maxPerOrder: z.ZodOptional<z.ZodString>;
618
+ deposit: z.ZodOptional<z.ZodObject<{
619
+ amount: z.ZodOptional<z.ZodString>;
620
+ balanceDue: z.ZodOptional<z.ZodString>;
621
+ }, z.core.$strict>>;
622
+ grants: z.ZodOptional<z.ZodObject<{
623
+ object: z.ZodString;
624
+ set: z.ZodRecord<z.ZodString, z.ZodUnion<readonly [z.ZodEnum<{
625
+ item: "item";
626
+ order: "order";
627
+ "order.person": "order.person";
628
+ "order.email": "order.email";
629
+ line: "line";
630
+ "line.title": "line.title";
631
+ "line.unitPrice": "line.unitPrice";
632
+ code: "code";
633
+ }>, z.ZodString]>>;
634
+ void: z.ZodString;
635
+ }, z.core.$strict>>;
636
+ }, z.core.$strict>>;
637
+ states: z.ZodOptional<z.ZodObject<{
638
+ field: z.ZodString;
639
+ initial: z.ZodString;
640
+ moves: z.ZodArray<z.ZodObject<{
641
+ from: z.ZodUnion<readonly [z.ZodString, z.ZodArray<z.ZodString>]>;
642
+ to: z.ZodString;
643
+ by: z.ZodArray<z.ZodEnum<{
644
+ staff: "staff";
645
+ customer: "customer";
646
+ host: "host";
647
+ }>>;
648
+ requires: z.ZodOptional<z.ZodArray<z.ZodString>>;
649
+ final: z.ZodOptional<z.ZodBoolean>;
650
+ }, z.core.$strip>>;
651
+ }, z.core.$strip>>;
652
+ owner: z.ZodOptional<z.ZodString>;
653
+ customer: z.ZodOptional<z.ZodObject<{
654
+ field: z.ZodString;
655
+ read: z.ZodArray<z.ZodString>;
656
+ write: z.ZodArray<z.ZodString>;
657
+ }, z.core.$strict>>;
658
+ public: z.ZodOptional<z.ZodObject<{
659
+ read: z.ZodArray<z.ZodString>;
660
+ when: z.ZodOptional<z.ZodObject<{
661
+ via: z.ZodOptional<z.ZodString>;
662
+ field: z.ZodString;
663
+ in: z.ZodArray<z.ZodString>;
664
+ }, z.core.$strict>>;
665
+ }, z.core.$strict>>;
666
+ signedIn: z.ZodOptional<z.ZodObject<{
667
+ read: z.ZodArray<z.ZodString>;
668
+ when: z.ZodOptional<z.ZodObject<{
669
+ via: z.ZodOptional<z.ZodString>;
670
+ field: z.ZodString;
671
+ in: z.ZodArray<z.ZodString>;
672
+ }, z.core.$strict>>;
673
+ }, z.core.$strict>>;
674
+ customerVia: z.ZodOptional<z.ZodObject<{
675
+ from: z.ZodString;
676
+ field: z.ZodString;
677
+ read: z.ZodArray<z.ZodString>;
678
+ }, z.core.$strict>>;
679
+ publishable: z.ZodOptional<z.ZodObject<{
680
+ content: z.ZodArray<z.ZodString>;
681
+ slug: z.ZodOptional<z.ZodString>;
682
+ date: z.ZodOptional<z.ZodString>;
683
+ }, z.core.$strict>>;
684
+ navigationOrder: z.ZodOptional<z.ZodNumber>;
685
+ requireOneOf: z.ZodOptional<z.ZodArray<z.ZodArray<z.ZodString>>>;
686
+ titleDefault: z.ZodOptional<z.ZodObject<{
687
+ from: z.ZodArray<z.ZodString>;
688
+ suffix: z.ZodOptional<z.ZodString>;
689
+ }, z.core.$strip>>;
690
+ seed: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodRecord<z.ZodString, z.ZodUnknown>>>;
691
+ }, z.core.$strip>>>;
692
+ fields: z.ZodDefault<z.ZodRecord<z.ZodString, z.ZodRecord<z.ZodString, z.ZodObject<{
693
+ type: z.ZodEnum<{
694
+ number: "number";
695
+ boolean: "boolean";
696
+ text: "text";
697
+ longText: "longText";
698
+ currency: "currency";
699
+ percent: "percent";
700
+ date: "date";
701
+ datetime: "datetime";
702
+ select: "select";
703
+ multiSelect: "multiSelect";
704
+ relation: "relation";
705
+ user: "user";
706
+ email: "email";
707
+ phone: "phone";
708
+ url: "url";
709
+ formula: "formula";
710
+ document: "document";
711
+ timezone: "timezone";
712
+ richText: "richText";
713
+ slug: "slug";
714
+ image: "image";
715
+ }>;
716
+ label: z.ZodString;
717
+ description: z.ZodOptional<z.ZodString>;
718
+ track: z.ZodOptional<z.ZodLiteral<"timeline">>;
719
+ renamedFrom: z.ZodOptional<z.ZodString>;
720
+ required: z.ZodOptional<z.ZodBoolean>;
721
+ readOnly: z.ZodOptional<z.ZodBoolean>;
722
+ currency: z.ZodOptional<z.ZodString>;
723
+ options: z.ZodOptional<z.ZodArray<z.ZodObject<{
724
+ value: z.ZodString;
725
+ label: z.ZodString;
726
+ color: z.ZodOptional<z.ZodString>;
727
+ requires: z.ZodOptional<z.ZodArray<z.ZodString>>;
728
+ fixed: z.ZodOptional<z.ZodBoolean>;
729
+ }, z.core.$strip>>>;
730
+ editableOptions: z.ZodOptional<z.ZodBoolean>;
731
+ default: z.ZodOptional<z.ZodUnion<readonly [z.ZodString, z.ZodNumber, z.ZodBoolean]>>;
732
+ defaultSetting: z.ZodOptional<z.ZodString>;
733
+ to: z.ZodOptional<z.ZodString>;
734
+ many: z.ZodOptional<z.ZodBoolean>;
735
+ expression: z.ZodOptional<z.ZodString>;
736
+ min: z.ZodOptional<z.ZodNumber>;
737
+ max: z.ZodOptional<z.ZodNumber>;
738
+ step: z.ZodOptional<z.ZodNumber>;
739
+ schema: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
740
+ maxBytes: z.ZodOptional<z.ZodNumber>;
741
+ paths: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodObject<{
742
+ label: z.ZodString;
743
+ path: z.ZodString;
744
+ count: z.ZodOptional<z.ZodBoolean>;
745
+ description: z.ZodOptional<z.ZodString>;
746
+ }, z.core.$strict>>>;
747
+ }, z.core.$strip>>>>;
748
+ views: z.ZodDefault<z.ZodRecord<z.ZodString, z.ZodObject<{
749
+ label: z.ZodString;
750
+ object: z.ZodString;
751
+ type: z.ZodOptional<z.ZodEnum<{
752
+ table: "table";
753
+ board: "board";
754
+ calendar: "calendar";
755
+ gallery: "gallery";
756
+ }>>;
757
+ filter: z.ZodOptional<z.ZodUnknown>;
758
+ sort: z.ZodOptional<z.ZodObject<{
759
+ field: z.ZodString;
760
+ direction: z.ZodDefault<z.ZodEnum<{
761
+ asc: "asc";
762
+ desc: "desc";
763
+ }>>;
764
+ }, z.core.$strip>>;
765
+ columns: z.ZodOptional<z.ZodArray<z.ZodString>>;
766
+ groupBy: z.ZodOptional<z.ZodString>;
767
+ sumField: z.ZodOptional<z.ZodString>;
768
+ dateField: z.ZodOptional<z.ZodString>;
769
+ mode: z.ZodOptional<z.ZodEnum<{
770
+ month: "month";
771
+ week: "week";
772
+ agenda: "agenda";
773
+ }>>;
774
+ imageField: z.ZodOptional<z.ZodString>;
775
+ cardFields: z.ZodOptional<z.ZodArray<z.ZodString>>;
776
+ }, z.core.$strip>>>;
777
+ recordTabs: z.ZodDefault<z.ZodRecord<z.ZodString, z.ZodObject<{
778
+ label: z.ZodString;
779
+ on: z.ZodString;
780
+ view: z.ZodObject<{
781
+ type: z.ZodEnum<{
782
+ table: "table";
783
+ board: "board";
784
+ calendar: "calendar";
785
+ gallery: "gallery";
786
+ }>;
787
+ object: z.ZodString;
788
+ relation: z.ZodString;
789
+ filter: z.ZodOptional<z.ZodUnknown>;
790
+ sort: z.ZodOptional<z.ZodObject<{
791
+ field: z.ZodString;
792
+ direction: z.ZodDefault<z.ZodEnum<{
793
+ asc: "asc";
794
+ desc: "desc";
795
+ }>>;
796
+ }, z.core.$strip>>;
797
+ columns: z.ZodOptional<z.ZodArray<z.ZodString>>;
798
+ groupBy: z.ZodOptional<z.ZodString>;
799
+ sumField: z.ZodOptional<z.ZodString>;
800
+ dateField: z.ZodOptional<z.ZodString>;
801
+ mode: z.ZodOptional<z.ZodEnum<{
802
+ month: "month";
803
+ week: "week";
804
+ agenda: "agenda";
805
+ }>>;
806
+ imageField: z.ZodOptional<z.ZodString>;
807
+ cardFields: z.ZodOptional<z.ZodArray<z.ZodString>>;
808
+ }, z.core.$strip>;
809
+ order: z.ZodDefault<z.ZodNumber>;
810
+ }, z.core.$strip>>>;
811
+ recordPanels: z.ZodDefault<z.ZodRecord<z.ZodString, z.ZodObject<{
812
+ label: z.ZodString;
813
+ on: z.ZodString;
814
+ view: z.ZodObject<{
815
+ type: z.ZodEnum<{
816
+ table: "table";
817
+ board: "board";
818
+ calendar: "calendar";
819
+ gallery: "gallery";
820
+ }>;
821
+ object: z.ZodString;
822
+ relation: z.ZodString;
823
+ filter: z.ZodOptional<z.ZodUnknown>;
824
+ sort: z.ZodOptional<z.ZodObject<{
825
+ field: z.ZodString;
826
+ direction: z.ZodDefault<z.ZodEnum<{
827
+ asc: "asc";
828
+ desc: "desc";
829
+ }>>;
830
+ }, z.core.$strip>>;
831
+ columns: z.ZodOptional<z.ZodArray<z.ZodString>>;
832
+ groupBy: z.ZodOptional<z.ZodString>;
833
+ sumField: z.ZodOptional<z.ZodString>;
834
+ dateField: z.ZodOptional<z.ZodString>;
835
+ mode: z.ZodOptional<z.ZodEnum<{
836
+ month: "month";
837
+ week: "week";
838
+ agenda: "agenda";
839
+ }>>;
840
+ imageField: z.ZodOptional<z.ZodString>;
841
+ cardFields: z.ZodOptional<z.ZodArray<z.ZodString>>;
842
+ }, z.core.$strip>;
843
+ order: z.ZodDefault<z.ZodNumber>;
844
+ }, z.core.$strip>>>;
845
+ settings: z.ZodDefault<z.ZodRecord<z.ZodString, z.ZodObject<{
846
+ type: z.ZodEnum<{
847
+ number: "number";
848
+ boolean: "boolean";
849
+ text: "text";
850
+ select: "select";
851
+ }>;
852
+ label: z.ZodString;
853
+ description: z.ZodOptional<z.ZodString>;
854
+ required: z.ZodOptional<z.ZodBoolean>;
855
+ default: z.ZodOptional<z.ZodUnion<readonly [z.ZodString, z.ZodNumber, z.ZodBoolean]>>;
856
+ min: z.ZodOptional<z.ZodNumber>;
857
+ max: z.ZodOptional<z.ZodNumber>;
858
+ options: z.ZodOptional<z.ZodArray<z.ZodObject<{
859
+ value: z.ZodString;
860
+ label: z.ZodString;
861
+ color: z.ZodOptional<z.ZodString>;
862
+ requires: z.ZodOptional<z.ZodArray<z.ZodString>>;
863
+ fixed: z.ZodOptional<z.ZodBoolean>;
864
+ }, z.core.$strip>>>;
865
+ }, z.core.$strip>>>;
866
+ dashboards: z.ZodDefault<z.ZodRecord<z.ZodString, z.ZodObject<{
867
+ title: z.ZodString;
868
+ description: z.ZodOptional<z.ZodString>;
869
+ home: z.ZodOptional<z.ZodBoolean>;
870
+ filters: z.ZodDefault<z.ZodArray<z.ZodRecord<z.ZodString, z.ZodUnknown>>>;
871
+ widgets: z.ZodArray<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
872
+ }, z.core.$strip>>>;
873
+ tools: z.ZodDefault<z.ZodRecord<z.ZodString, z.ZodObject<{
874
+ description: z.ZodString;
875
+ risk: z.ZodEnum<{
876
+ read: "read";
877
+ write: "write";
878
+ "bulk-write": "bulk-write";
879
+ destructive: "destructive";
880
+ }>;
881
+ recordAction: z.ZodOptional<z.ZodObject<{
882
+ object: z.ZodString;
883
+ label: z.ZodString;
884
+ idInput: z.ZodString;
885
+ confirm: z.ZodOptional<z.ZodString>;
886
+ ask: z.ZodOptional<z.ZodObject<{
887
+ input: z.ZodString;
888
+ label: z.ZodString;
889
+ options: z.ZodArray<z.ZodObject<{
890
+ value: z.ZodString;
891
+ label: z.ZodString;
892
+ }, z.core.$strip>>;
893
+ }, z.core.$strip>>;
894
+ hideWhen: z.ZodOptional<z.ZodObject<{
895
+ field: z.ZodString;
896
+ values: z.ZodArray<z.ZodString>;
897
+ }, z.core.$strip>>;
898
+ }, z.core.$strip>>;
899
+ audiences: z.ZodOptional<z.ZodArray<z.ZodEnum<{
900
+ staff: "staff";
901
+ customer: "customer";
902
+ public: "public";
903
+ }>>>;
904
+ customerFields: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodArray<z.ZodString>>>;
905
+ permission: z.ZodOptional<z.ZodString>;
906
+ inputSchema: z.ZodRecord<z.ZodString, z.ZodUnknown>;
907
+ outputSchema: z.ZodRecord<z.ZodString, z.ZodUnknown>;
908
+ }, z.core.$strip>>>;
909
+ automations: z.ZodDefault<z.ZodRecord<z.ZodString, z.ZodObject<{
910
+ label: z.ZodString;
911
+ description: z.ZodString;
912
+ trigger: z.ZodDiscriminatedUnion<[z.ZodObject<{
913
+ type: z.ZodLiteral<"record">;
914
+ object: z.ZodString;
915
+ on: z.ZodArray<z.ZodEnum<{
916
+ created: "created";
917
+ updated: "updated";
918
+ deleted: "deleted";
919
+ restored: "restored";
920
+ }>>;
921
+ includeBulk: z.ZodOptional<z.ZodBoolean>;
922
+ }, z.core.$strict>, z.ZodObject<{
923
+ type: z.ZodLiteral<"fieldChanged">;
924
+ object: z.ZodString;
925
+ field: z.ZodString;
926
+ from: z.ZodOptional<z.ZodUnion<readonly [z.ZodUnion<readonly [z.ZodString, z.ZodNumber, z.ZodBoolean, z.ZodNull]>, z.ZodObject<{
927
+ in: z.ZodArray<z.ZodUnion<readonly [z.ZodString, z.ZodNumber, z.ZodBoolean, z.ZodNull]>>;
928
+ }, z.core.$strict>, z.ZodObject<{
929
+ stageType: z.ZodEnum<{
930
+ open: "open";
931
+ won: "won";
932
+ lost: "lost";
933
+ }>;
934
+ }, z.core.$strict>]>>;
935
+ to: z.ZodOptional<z.ZodUnion<readonly [z.ZodUnion<readonly [z.ZodString, z.ZodNumber, z.ZodBoolean, z.ZodNull]>, z.ZodObject<{
936
+ in: z.ZodArray<z.ZodUnion<readonly [z.ZodString, z.ZodNumber, z.ZodBoolean, z.ZodNull]>>;
937
+ }, z.core.$strict>, z.ZodObject<{
938
+ stageType: z.ZodEnum<{
939
+ open: "open";
940
+ won: "won";
941
+ lost: "lost";
942
+ }>;
943
+ }, z.core.$strict>]>>;
944
+ includeBulk: z.ZodOptional<z.ZodBoolean>;
945
+ }, z.core.$strict>, z.ZodObject<{
946
+ type: z.ZodLiteral<"schedule">;
947
+ cron: z.ZodString;
948
+ }, z.core.$strict>, z.ZodObject<{
949
+ type: z.ZodLiteral<"dateRelative">;
950
+ object: z.ZodString;
951
+ field: z.ZodString;
952
+ offsetDays: z.ZodNumber;
953
+ zoneField: z.ZodOptional<z.ZodString>;
954
+ }, z.core.$strict>, z.ZodObject<{
955
+ type: z.ZodLiteral<"manual">;
956
+ object: z.ZodString;
957
+ label: z.ZodString;
958
+ bulk: z.ZodOptional<z.ZodBoolean>;
959
+ }, z.core.$strict>, z.ZodObject<{
960
+ type: z.ZodLiteral<"approvalDecided">;
961
+ decision: z.ZodOptional<z.ZodEnum<{
962
+ any: "any";
963
+ approved: "approved";
964
+ rejected: "rejected";
965
+ }>>;
966
+ operation: z.ZodOptional<z.ZodString>;
967
+ object: z.ZodOptional<z.ZodString>;
968
+ }, z.core.$strict>, z.ZodObject<{
969
+ type: z.ZodLiteral<"webhook">;
970
+ endpoint: z.ZodString;
971
+ events: z.ZodOptional<z.ZodArray<z.ZodString>>;
972
+ }, z.core.$strict>, z.ZodObject<{
973
+ type: z.ZodLiteral<"syncEvent">;
974
+ event: z.ZodEnum<{
975
+ "email.received": "email.received";
976
+ "email.sent": "email.sent";
977
+ "email.deleted": "email.deleted";
978
+ "meeting.scheduled": "meeting.scheduled";
979
+ "meeting.created": "meeting.created";
980
+ "meeting.updated": "meeting.updated";
981
+ "meeting.cancelled": "meeting.cancelled";
982
+ }>;
983
+ from: z.ZodOptional<z.ZodEnum<{
984
+ person: "person";
985
+ organisation: "organisation";
986
+ either: "either";
987
+ }>>;
988
+ }, z.core.$strict>], "type">;
989
+ conditions: z.ZodOptional<z.ZodType<import("./contract.ts").ViewFilter, unknown, z.core.$ZodTypeInternals<import("./contract.ts").ViewFilter, unknown>>>;
990
+ steps: z.ZodArray<z.ZodUnion<readonly [z.ZodObject<{
991
+ name: z.ZodString;
992
+ label: z.ZodOptional<z.ZodString>;
993
+ kind: z.ZodOptional<z.ZodLiteral<"do">>;
994
+ reads: z.ZodOptional<z.ZodArray<z.ZodString>>;
995
+ writes: z.ZodOptional<z.ZodArray<z.ZodObject<{
996
+ object: z.ZodString;
997
+ action: z.ZodOptional<z.ZodEnum<{
998
+ create: "create";
999
+ update: "update";
1000
+ delete: "delete";
1001
+ }>>;
1002
+ count: z.ZodOptional<z.ZodNumber>;
1003
+ titles: z.ZodOptional<z.ZodArray<z.ZodString>>;
1004
+ assignTo: z.ZodOptional<z.ZodUnion<readonly [z.ZodLiteral<"admins">, z.ZodLiteral<"actor">, z.ZodObject<{
1005
+ field: z.ZodString;
1006
+ }, z.core.$strict>, z.ZodObject<{
1007
+ managerOf: z.ZodString;
1008
+ }, z.core.$strict>, z.ZodObject<{
1009
+ userId: z.ZodString;
1010
+ }, z.core.$strict>]>>;
1011
+ linkedToTrigger: z.ZodOptional<z.ZodBoolean>;
1012
+ }, z.core.$strict>>>;
1013
+ notifies: z.ZodOptional<z.ZodArray<z.ZodObject<{
1014
+ to: z.ZodUnion<readonly [z.ZodLiteral<"admins">, z.ZodLiteral<"actor">, z.ZodObject<{
1015
+ field: z.ZodString;
1016
+ }, z.core.$strict>, z.ZodObject<{
1017
+ managerOf: z.ZodString;
1018
+ }, z.core.$strict>, z.ZodObject<{
1019
+ userId: z.ZodString;
1020
+ }, z.core.$strict>]>;
1021
+ message: z.ZodString;
1022
+ body: z.ZodOptional<z.ZodString>;
1023
+ }, z.core.$strict>>>;
1024
+ calls: z.ZodOptional<z.ZodArray<z.ZodString>>;
1025
+ }, z.core.$strict>, z.ZodObject<{
1026
+ name: z.ZodString;
1027
+ label: z.ZodOptional<z.ZodString>;
1028
+ kind: z.ZodLiteral<"sleep">;
1029
+ duration: z.ZodUnion<readonly [z.ZodNumber, z.ZodString]>;
1030
+ }, z.core.$strict>, z.ZodObject<{
1031
+ name: z.ZodString;
1032
+ label: z.ZodOptional<z.ZodString>;
1033
+ kind: z.ZodLiteral<"waitForEvent">;
1034
+ event: z.ZodString;
1035
+ timeout: z.ZodOptional<z.ZodUnion<readonly [z.ZodNumber, z.ZodString]>>;
1036
+ }, z.core.$strict>, z.ZodObject<{
1037
+ name: z.ZodString;
1038
+ label: z.ZodString;
1039
+ kind: z.ZodLiteral<"condition">;
1040
+ clause: z.ZodOptional<z.ZodString>;
1041
+ }, z.core.$strict>]>>;
1042
+ onRejected: z.ZodOptional<z.ZodUnion<readonly [z.ZodLiteral<"stop">, z.ZodLiteral<"continue">, z.ZodObject<{
1043
+ notify: z.ZodUnion<readonly [z.ZodLiteral<"admins">, z.ZodLiteral<"actor">, z.ZodObject<{
1044
+ field: z.ZodString;
1045
+ }, z.core.$strict>, z.ZodObject<{
1046
+ managerOf: z.ZodString;
1047
+ }, z.core.$strict>, z.ZodObject<{
1048
+ userId: z.ZodString;
1049
+ }, z.core.$strict>]>;
1050
+ message: z.ZodOptional<z.ZodString>;
1051
+ }, z.core.$strict>]>>;
1052
+ rails: z.ZodOptional<z.ZodObject<{
1053
+ maxRunsPerMinute: z.ZodOptional<z.ZodNumber>;
1054
+ maxWritesPerHour: z.ZodOptional<z.ZodNumber>;
1055
+ debounceSeconds: z.ZodOptional<z.ZodNumber>;
1056
+ }, z.core.$strict>>;
1057
+ connections: z.ZodOptional<z.ZodArray<z.ZodObject<{
1058
+ id: z.ZodString;
1059
+ gatekeeper: z.ZodEnum<{
1060
+ email: "email";
1061
+ google: "google";
1062
+ microsoft: "microsoft";
1063
+ slack: "slack";
1064
+ "slack-post": "slack-post";
1065
+ mcp: "mcp";
1066
+ "email-send": "email-send";
1067
+ zoominfo: "zoominfo";
1068
+ websearch: "websearch";
1069
+ webhook: "webhook";
1070
+ fake: "fake";
1071
+ }>;
1072
+ purpose: z.ZodString;
1073
+ }, z.core.$strict>>>;
1074
+ enabled: z.ZodOptional<z.ZodBoolean>;
1075
+ }, z.core.$strip>>>;
1076
+ roles: z.ZodDefault<z.ZodRecord<z.ZodString, z.ZodObject<{
1077
+ label: z.ZodString;
1078
+ description: z.ZodString;
1079
+ permissions: z.ZodDefault<z.ZodArray<z.ZodString>>;
1080
+ read: z.ZodDefault<z.ZodArray<z.ZodString>>;
1081
+ }, z.core.$strip>>>;
1082
+ grantable: z.ZodOptional<z.ZodArray<z.ZodString>>;
1083
+ }, z.core.$strip>;
1084
+ export type ExtensionManifest = z.infer<typeof manifestSchema>;
1085
+ /** One problem `check` found. `path` points into the manifest, e.g. `objects.project.fields.x`. */
1086
+ export interface ManifestIssue {
1087
+ code: "contract" | "formula_syntax" | "formula_type" | "formula_unknown_field" | "formula_unknown_function" | "formula_cycle" | "formula_too_complex";
1088
+ path: string;
1089
+ message: string;
1090
+ /** For formula issues: the character span in the expression. */
1091
+ span?: {
1092
+ start: number;
1093
+ end: number;
1094
+ };
1095
+ }
1096
+ /**
1097
+ * Turns a live extension into its JSON manifest. Tool schemas become JSON Schema. Runs wherever
1098
+ * the extension is loaded (the sandbox, or the testing harness).
1099
+ */
1100
+ export declare function toManifest(extension: Extension): ExtensionManifest;
1101
+ /**
1102
+ * Core fields formulas on core objects can read, by formula type. The host checks this list
1103
+ * against its field registry (packages/core/test/sdk-core-fields.test.ts), so the SDK and the
1104
+ * testing harness agree with the host without depending on it.
1105
+ */
1106
+ export declare const CORE_FORMULA_FIELDS: Record<(typeof CORE_OBJECT_NAMES)[number], Record<string, "text" | "number" | "boolean" | "date" | "datetime">>;
1107
+ export interface ValidateOptions {
1108
+ /**
1109
+ * Fields a formula on `object` may read, other than the extension's own fields on it: the
1110
+ * host supplies core and installed fields. Default: none.
1111
+ */
1112
+ baseFields?: (object: string) => Record<string, FormulaFieldRef>;
1113
+ /** Objects that exist outside this extension (`person`, `other.thing`). Default: core only. */
1114
+ knownObjects?: readonly string[];
1115
+ /**
1116
+ * Field types of objects outside this extension (installed extensions' objects), for the
1117
+ * automation checks; null when unknown (those checks are skipped). Core objects are built in.
1118
+ */
1119
+ objectFields?: (object: string) => Record<string, FieldTypeName> | null;
1120
+ }
1121
+ /** Formula environment for a set of field manifests (formula fields compile on demand). */
1122
+ export declare function formulaFields(fields: Record<string, FieldManifest>): Record<string, FormulaFieldRef>;
1123
+ /**
1124
+ * The contract check: structure (zod), names, references, permissions and formulas. Returns
1125
+ * every issue found (empty when the manifest is valid) and the parsed manifest when it parsed.
1126
+ */
1127
+ export declare function validateManifest(input: unknown, options?: ValidateOptions): {
1128
+ manifest: ExtensionManifest | null;
1129
+ issues: ManifestIssue[];
1130
+ };
1131
+ export declare function declaredModules(manifest: ExtensionManifest): HostModuleName[];