@collective-intelligence/external-apps-server-sdk 0.1.35 → 0.1.37

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.
@@ -1,5 +1,7 @@
1
1
  // Generated by dts-bundle-generator v9.5.1
2
2
 
3
+ import { Bounds, ConnectorContext, ConsumerProfileDiagnostic, ConsumerProfileId, DatasetAggregateOperation, DatasetDefinition, DatasetFilter, DatasetOperation, DatasetOrder, DatasetPredicate, DatasetPredicateOperator, DatasetProviderCapabilities, DatasetProviderError, DatasetProviderResult, DatasetQueryIntent, DatasetRecordPage, DatasetResultPage, DatasetScalarType, DatasetSourceLocation, DatasetTimeBucket, DatasetValue, DynamicFormAiFillConfig, FieldUiSchema, FieldValidationRule, FieldVisibilityRule, FormLayout, FormMarkdownBlock, FormMetadata, FormSection, FormSectionItem, FormStep, JsonObject, JsonPrimitive, JsonSchemaDocument, JsonValue, OperationDomainDeclaration, PackageSchemaProjection, PlainFormWidget, PortableOperationAuthorization, PortableOperationDeclaration, PortableOperationDelegatedSubjectPolicy, PortableOperationEffect, PortableOperationExecutionPolicy, PortableOperationIdempotency, PortableOperationLimits, PortableOperationPrincipalKind, PortableOperationRetryPolicy, ProjectionFidelity, QueryInput, SafeDiagnostic, SelectFormWidget, SelectOptions, StructuredFileBrowserOptions, StructuredFileUploadOptions, VisibilityCondition } from '@collective-intelligence/extensions-sdk';
4
+ import { EntityCreateInput, EntityDeleteInput, EntityListQuery, EntityMemberValue, EntityOperation, EntityOperationResult, EntityPage, EntityRequest, EntityUpdateInput, EntityUploadInput, EntityUploadSlot, IdempotencyKey, PortableResourceSchema, ResourceCapabilities, ResourceCreateInput, ResourceCreateRequest, ResourceCursor, ResourceDefinition, ResourceError, ResourceErrorCode, ResourceFilter, ResourceGetRequest, ResourceId, ResourceIdentityField, ResourceJsonValue, ResourceLifecycleInput, ResourceLifecycleRequest, ResourceListQuery, ResourceListRequest, ResourceListResult, ResourceMutationInput, ResourcePagination, ResourcePaginationMode, ResourceRecord, ResourceRecordId, ResourceResult, ResourceRevision, ResourceSort, ResourceTransportRequest, ResourceUpdateRequest } from '@collective-intelligence/external-apps-client-sdk/resources';
3
5
  import * as Effect from 'effect/Effect';
4
6
  import * as Schema from 'effect/Schema';
5
7
 
@@ -33,277 +35,6 @@ export type EntityInvocationContext = Readonly<{
33
35
  scopes: readonly string[];
34
36
  user: ApplicationUserIdentity;
35
37
  }>;
36
- export type ResourceJsonValue = null | boolean | number | string | readonly ResourceJsonValue[] | Readonly<{
37
- [key: string]: ResourceJsonValue;
38
- }>;
39
- /** Opaque wire identity. Callers must not infer or concatenate its internals. */
40
- export type ResourceId = string;
41
- export type ResourceRecordId = ResourceId;
42
- /** Opaque concurrency token independent from source timestamps. */
43
- export type ResourceRevision = string;
44
- /** Opaque pagination position issued and consumed only by a resource adapter. */
45
- export type ResourceCursor = string;
46
- export type IdempotencyKey = string;
47
- export type ResourceIdentityField = Readonly<{
48
- name: string;
49
- type: "number" | "string";
50
- }>;
51
- export type ResourceCapabilities = Readonly<{
52
- create?: boolean;
53
- /** Common entity deletion is always soft deletion. */
54
- delete?: boolean;
55
- get?: boolean;
56
- hardDelete?: boolean;
57
- includeDeleted?: boolean;
58
- restore?: boolean;
59
- search: true;
60
- softDelete?: boolean;
61
- update?: boolean;
62
- /** File uploads for the File fields of a common entity resource. */
63
- upload?: boolean;
64
- }>;
65
- export type ResourcePaginationMode = "cursor" | "page";
66
- export type PortableResourceSchema = Readonly<Record<string, ResourceJsonValue>>;
67
- export type ResourceDefinition<Entity, Create = Entity, Update = Partial<Entity>> = Readonly<{
68
- capabilities: ResourceCapabilities;
69
- concurrency: "revision";
70
- id: string;
71
- identity: Readonly<{
72
- fields: readonly [
73
- ResourceIdentityField,
74
- ...ResourceIdentityField[]
75
- ];
76
- }>;
77
- query: Readonly<{
78
- filterableFields: readonly string[];
79
- pagination: Readonly<{
80
- modes: readonly ResourcePaginationMode[];
81
- }>;
82
- sortableFields: readonly string[];
83
- textSearchFields?: readonly string[];
84
- }>;
85
- schemas: Readonly<{
86
- create?: PortableResourceSchema;
87
- entity: PortableResourceSchema;
88
- update?: PortableResourceSchema;
89
- }>;
90
- version: string;
91
- /** Portable UI metadata; required/enum/nullability remain in schemas. */
92
- metadata?: Readonly<Record<string, ResourceJsonValue>>;
93
- /** Type-only slots keep definition values portable and serializable. */
94
- readonly __types?: Readonly<{
95
- create: Create;
96
- entity: Entity;
97
- update: Update;
98
- }>;
99
- }>;
100
- export type FilterValue = ResourceJsonValue | readonly ResourceJsonValue[];
101
- /**
102
- * A filter predicate. `field` names a declared filterable field, or a path
103
- * through at most three fields that hold Entity References to a field of
104
- * the last target, such as `company.industry` or
105
- * `contacts.company.parent.industry`. On a field that holds Entity
106
- * References, `is_empty` means no reference. User fields accept identity
107
- * predicates for one ID and `contains_any`, `contains_all`, `contains_none`
108
- * for multiple IDs, plus empty/not-empty aliases. CI validates operators
109
- * against the actual field semantic; UUID shape alone does not declare User.
110
- */
111
- export type ResourceFilter = Readonly<{
112
- field: string;
113
- operator: "contains" | "contains_all" | "contains_any" | "contains_none" | "ends_with" | "eq" | "gt" | "gte" | "in" | "lt" | "lte" | "ne" | "not_in" | "starts_with";
114
- value: FilterValue;
115
- }> | Readonly<{
116
- field: string;
117
- operator: "is_empty" | "is_not_empty" | "is_not_null" | "is_null";
118
- }> | Readonly<{
119
- filters: readonly ResourceFilter[];
120
- operator: "and" | "or";
121
- }> | Readonly<{
122
- filter: ResourceFilter;
123
- operator: "not";
124
- }>;
125
- export type ResourceSort = Readonly<{
126
- direction: "asc" | "desc";
127
- field: string;
128
- }>;
129
- export type ResourcePagination = Readonly<{
130
- mode: "cursor";
131
- cursor?: ResourceCursor;
132
- limit: number;
133
- }> | Readonly<{
134
- mode: "page";
135
- page: number;
136
- pageSize: number;
137
- }>;
138
- export type ResourceListQuery = Readonly<{
139
- filter?: ResourceFilter;
140
- /**
141
- * Include Paths, such as `["company", "contacts.company"]`: relation
142
- * fields whose records each item carries in `included`.
143
- */
144
- include?: readonly string[];
145
- includeDeleted?: boolean;
146
- pagination: ResourcePagination;
147
- sort?: readonly ResourceSort[];
148
- textSearch?: string;
149
- }>;
150
- export type ResourceRecord<Entity> = Readonly<{
151
- deletedAt?: string;
152
- id: ResourceRecordId;
153
- /**
154
- * The records of the read's Include Paths by relation field key: one
155
- * record, or the records of a `many` field in reference order. Untyped:
156
- * the target schemas are CI's.
157
- */
158
- included?: Readonly<Record<string, ResourceJsonValue>>;
159
- revision: ResourceRevision;
160
- /** The keys whose included records were cut to the first 100. */
161
- truncated?: readonly string[];
162
- value: Entity;
163
- }>;
164
- export type ResourceListResult<Entity> = Readonly<{
165
- items: readonly ResourceRecord<Entity>[];
166
- nextCursor?: ResourceCursor;
167
- pagination: "cursor";
168
- }> | Readonly<{
169
- items: readonly ResourceRecord<Entity>[];
170
- page: number;
171
- pageSize: number;
172
- pagination: "page";
173
- totalItems: number;
174
- totalPages: number;
175
- }>;
176
- export type ResourceErrorCode = "capability_not_supported" | "conflict" | "forbidden" | "internal" | "invalid_request" | "not_found" | "rate_limited" | "transport_error" | "unauthenticated" | "unavailable" |
177
- /** The CI Organization storage can not take a presigned File upload. */
178
- "upload_not_supported";
179
- export type ResourceError = Readonly<{
180
- code: ResourceErrorCode;
181
- /** Client-observed dispatch outcome; uncertainty never proves rollback. */
182
- outcome?: "not_dispatched" | "rejected" | "uncertain";
183
- details?: Readonly<Record<string, ResourceJsonValue>>;
184
- message: string;
185
- retryable: boolean;
186
- }>;
187
- export type ResourceResult<Value> = Readonly<{
188
- correlationId: string;
189
- ok: true;
190
- value: Value;
191
- }> | Readonly<{
192
- correlationId: string;
193
- error: ResourceError;
194
- ok: false;
195
- }>;
196
- export type ResourceListRequest = Readonly<{
197
- operation: "list";
198
- query: ResourceListQuery;
199
- requestId: string;
200
- resourceId: string;
201
- }>;
202
- export type ResourceGetRequest = Readonly<{
203
- id: ResourceRecordId;
204
- includeDeleted?: boolean;
205
- operation: "get";
206
- requestId: string;
207
- resourceId: string;
208
- }>;
209
- export type ResourceCreateRequest<Create> = Readonly<{
210
- idempotencyKey: IdempotencyKey;
211
- operation: "create";
212
- requestId: string;
213
- resourceId: string;
214
- value: Create;
215
- }>;
216
- export type ResourceUpdateRequest<Update> = Readonly<{
217
- expectedRevision: ResourceRevision;
218
- id: ResourceRecordId;
219
- idempotencyKey?: IdempotencyKey;
220
- operation: "update";
221
- requestId: string;
222
- resourceId: string;
223
- value: Update;
224
- }>;
225
- export type ResourceLifecycleRequest = Readonly<{
226
- expectedRevision: ResourceRevision;
227
- id: ResourceRecordId;
228
- idempotencyKey?: IdempotencyKey;
229
- operation: "hard_delete" | "restore" | "soft_delete";
230
- requestId: string;
231
- resourceId: string;
232
- }>;
233
- export type ResourceTransportRequest = ResourceCreateRequest<unknown> | ResourceGetRequest | ResourceLifecycleRequest | ResourceListRequest | ResourceUpdateRequest<unknown>;
234
- export type ResourceMutationInput<Value> = Readonly<{
235
- expectedRevision: ResourceRevision;
236
- id: ResourceRecordId;
237
- idempotencyKey?: IdempotencyKey;
238
- value: Value;
239
- }>;
240
- export type ResourceLifecycleInput = Readonly<{
241
- expectedRevision: ResourceRevision;
242
- id: ResourceRecordId;
243
- idempotencyKey?: IdempotencyKey;
244
- }>;
245
- export type ResourceCreateInput<Value> = Readonly<{
246
- idempotencyKey: IdempotencyKey;
247
- value: Value;
248
- }>;
249
- /** Common entity operations. Generic resource lifecycle/cursor APIs remain separate. */
250
- export type EntityOperation = "list_members" | "list" | "get" | "create" | "update" | "delete" | "upload";
251
- export type EntityListQuery = Omit<ResourceListQuery, "pagination" | "includeDeleted"> & Readonly<{
252
- pagination: Extract<ResourcePagination, {
253
- mode: "page";
254
- }>;
255
- }>;
256
- export type EntityPage<Value> = Extract<ResourceListResult<Value>, {
257
- pagination: "page";
258
- }>;
259
- /** Member schemas are resolved by CI, independently of the parent resource. */
260
- export type EntityMemberValue = Readonly<Record<string, ResourceJsonValue>>;
261
- export type EntityCreateInput<Value> = ResourceCreateInput<Value>;
262
- export type EntityUpdateInput<Patch> = ResourceMutationInput<Patch> & Readonly<{
263
- idempotencyKey: IdempotencyKey;
264
- }>;
265
- export type EntityDeleteInput = ResourceLifecycleInput & Readonly<{
266
- idempotencyKey: IdempotencyKey;
267
- }>;
268
- /** A File upload request for one File field of the entity schema. */
269
- export type EntityUploadInput = Readonly<{
270
- field: string;
271
- filename: string;
272
- mimeType: string;
273
- }>;
274
- /** PUT the file bytes to `url` with `headers`; then write `{ upload: uploadId }`. */
275
- export type EntityUploadSlot = Readonly<{
276
- headers: Readonly<Record<string, string>>;
277
- method: "PUT";
278
- uploadId: string;
279
- url: string;
280
- }>;
281
- export type EntityRequestIdentity = Readonly<{
282
- requestId: string;
283
- resourceId: string;
284
- }>;
285
- export type EntityRequest<Create = unknown, Patch = unknown> = EntityRequestIdentity & (Readonly<{
286
- operation: "list";
287
- query: EntityListQuery;
288
- }> | Readonly<{
289
- operation: "list_members";
290
- parentId: ResourceRecordId;
291
- field: string;
292
- query: EntityListQuery;
293
- }> | Readonly<{
294
- operation: "get";
295
- id: ResourceRecordId;
296
- include?: readonly string[];
297
- }> | (Readonly<{
298
- operation: "create";
299
- }> & EntityCreateInput<Create>) | (Readonly<{
300
- operation: "update";
301
- }> & EntityUpdateInput<Patch>) | (Readonly<{
302
- operation: "delete";
303
- }> & EntityDeleteInput) | (Readonly<{
304
- operation: "upload";
305
- }> & EntityUploadInput));
306
- export type EntityOperationResult<Value, Operation extends EntityOperation> = Operation extends "list_members" ? EntityPage<EntityMemberValue> : Operation extends "list" ? EntityPage<Value> : Operation extends "upload" ? EntityUploadSlot : ResourceRecord<Value>;
307
38
  export type PrincipalKind = "detached_user" | "service_principal";
308
39
  export type DelegatedSubjectPolicy = "allowed" | "forbidden" | "required";
309
40
  export type AuthorizationRequirement = Readonly<{
@@ -423,509 +154,6 @@ export type ResourceHttpHandlerOptions<Value = unknown, Create = Value, Patch =
423
154
  authorize: (request: Request, operation: ResourceTransportRequest["operation"] | EntityOperation) => Promise<EntityInvocationContext | Response>;
424
155
  maxBodyBytes?: number;
425
156
  }>;
426
- export type JsonPrimitive = boolean | null | number | string;
427
- export type JsonValue = JsonObject | JsonPrimitive | readonly JsonValue[];
428
- export interface JsonObject {
429
- readonly [key: string]: JsonValue;
430
- }
431
- declare const Draft202012Dialect: "https://json-schema.org/draft/2020-12/schema";
432
- /** JSON-compatible Draft 2020-12 vocabulary used for portable manifests. */
433
- export type JsonSchemaDocument = JsonObject & Readonly<{
434
- $anchor?: string;
435
- $comment?: string;
436
- $defs?: Readonly<Record<string, JsonSchemaDocument>>;
437
- $dynamicAnchor?: string;
438
- $dynamicRef?: string;
439
- $id?: string;
440
- $ref?: string;
441
- $schema?: typeof Draft202012Dialect;
442
- additionalProperties?: boolean | JsonSchemaDocument;
443
- allOf?: readonly JsonSchemaDocument[];
444
- anyOf?: readonly JsonSchemaDocument[];
445
- const?: JsonValue;
446
- contains?: JsonSchemaDocument;
447
- default?: JsonValue;
448
- dependentRequired?: Readonly<Record<string, readonly string[]>>;
449
- description?: string;
450
- else?: JsonSchemaDocument;
451
- enum?: readonly JsonValue[];
452
- exclusiveMaximum?: number;
453
- exclusiveMinimum?: number;
454
- format?: string;
455
- if?: JsonSchemaDocument;
456
- items?: JsonSchemaDocument;
457
- maxItems?: number;
458
- maxLength?: number;
459
- maxProperties?: number;
460
- maximum?: number;
461
- minItems?: number;
462
- minLength?: number;
463
- minProperties?: number;
464
- minimum?: number;
465
- multipleOf?: number;
466
- not?: JsonSchemaDocument;
467
- oneOf?: readonly JsonSchemaDocument[];
468
- pattern?: string;
469
- patternProperties?: Readonly<Record<string, JsonSchemaDocument>>;
470
- prefixItems?: readonly JsonSchemaDocument[];
471
- properties?: Readonly<Record<string, JsonSchemaDocument>>;
472
- required?: readonly string[];
473
- then?: JsonSchemaDocument;
474
- title?: string;
475
- type?: "array" | "boolean" | "integer" | "null" | "number" | "object" | "string" | readonly ("array" | "boolean" | "integer" | "null" | "number" | "object" | "string")[];
476
- unevaluatedItems?: boolean | JsonSchemaDocument;
477
- unevaluatedProperties?: boolean | JsonSchemaDocument;
478
- uniqueItems?: boolean;
479
- }>;
480
- export type ProjectionFidelity = "exact" | "structural";
481
- export type PackageSchemaProjection = Readonly<{
482
- dialect: typeof Draft202012Dialect;
483
- document: JsonSchemaDocument;
484
- fidelity: ProjectionFidelity;
485
- }>;
486
- export type FormLayout = "stacked" | "two_column";
487
- declare const plainFormWidgets: readonly [
488
- "checkbox",
489
- "color",
490
- "date",
491
- "date_range",
492
- "datetime",
493
- "email",
494
- "file",
495
- "hidden",
496
- "number",
497
- "password",
498
- "structured_file_preview",
499
- "switch",
500
- "text",
501
- "textarea",
502
- "user_multi_select",
503
- "user_select",
504
- "variable_references"
505
- ];
506
- export type PlainFormWidget = (typeof plainFormWidgets)[number];
507
- declare const selectFormWidgets: readonly [
508
- "folders_explorer",
509
- "multi_select",
510
- "radio",
511
- "select"
512
- ];
513
- export type SelectFormWidget = (typeof selectFormWidgets)[number];
514
- export type FieldValidationRule = Readonly<{
515
- type: "required";
516
- code?: string;
517
- message?: string;
518
- }> | Readonly<{
519
- type: "min_length" | "max_length" | "min" | "max";
520
- value: number;
521
- code?: string;
522
- message?: string;
523
- }> | Readonly<{
524
- type: "pattern";
525
- value: string;
526
- code?: string;
527
- message?: string;
528
- }> | Readonly<{
529
- type: "integer" | "json" | "non_empty_array";
530
- code?: string;
531
- message?: string;
532
- }>;
533
- export type SelectOption = Readonly<{
534
- value: string;
535
- label?: string;
536
- locked?: boolean;
537
- }>;
538
- export type DynamicFormAiFillConfig = Readonly<{
539
- prompt: string;
540
- buttonLabel?: string;
541
- retryable?: boolean;
542
- }>;
543
- /**
544
- * Package-owned, serializable select-control options. The renderer may add
545
- * runtime-only resolution metadata separately, but package declarations use
546
- * only this protocol.
547
- */
548
- export type SelectOptions<Field extends string = string> = Readonly<{
549
- options?: readonly (string | SelectOption)[];
550
- allowCustom?: boolean;
551
- searchable?: boolean;
552
- allowClear?: boolean;
553
- dataSource?: string;
554
- dependencies?: readonly Field[];
555
- submit?: boolean;
556
- readonlyOnUpdate?: boolean;
557
- preventSaveWhenEmpty?: boolean;
558
- selectionMetadataField?: Field;
559
- aiFill?: DynamicFormAiFillConfig;
560
- }>;
561
- /** Options of the upload control for a manual structured-file source. */
562
- export type StructuredFileUploadOptions<Field extends string = string> = Readonly<{
563
- /** Field that receives the format inferred from the uploaded file. */
564
- formatField?: Field;
565
- }>;
566
- /** Options of the browser that picks a file from a connected source. */
567
- export type StructuredFileBrowserOptions<Field extends string = string> = Readonly<{
568
- /** The source contribution that lists the files and its connection slot. */
569
- contribution: Readonly<{
570
- componentFqn: string;
571
- connectionSlot: string;
572
- }>;
573
- label?: string;
574
- /** Field that receives the format of the picked file. */
575
- formatField?: Field;
576
- }>;
577
- export type VisibilityCondition<Field extends string = string> = Readonly<{
578
- field: Field;
579
- equals?: JsonValue;
580
- notEquals?: JsonValue;
581
- in?: readonly JsonValue[];
582
- notIn?: readonly JsonValue[];
583
- isSet?: boolean;
584
- isNotSet?: boolean;
585
- }>;
586
- export type FieldVisibilityRule<Field extends string = string> = Readonly<{
587
- visibleWhen: VisibilityCondition<Field> | readonly VisibilityCondition<Field>[];
588
- logic?: "and" | "or";
589
- }>;
590
- export type FieldUiBase = Readonly<{
591
- "ui:placeholder"?: string;
592
- "ui:help"?: string;
593
- "ui:disabled"?: boolean;
594
- "ui:readonly"?: boolean;
595
- "ui:order"?: number;
596
- "ui:suggestedName"?: string;
597
- "ui:validation"?: readonly FieldValidationRule[];
598
- }>;
599
- export type PlainFieldUi = FieldUiBase & Readonly<{
600
- "ui:widget": PlainFormWidget;
601
- "ui:options"?: never;
602
- }>;
603
- /**
604
- * Without a widget the renderer infers one from the field schema, and the
605
- * select options apply to the inferred control.
606
- */
607
- export type SelectFieldUi<Field extends string = string> = FieldUiBase & Readonly<{
608
- "ui:widget"?: SelectFormWidget;
609
- "ui:options"?: SelectOptions<Field>;
610
- }>;
611
- export type StructuredFileUploadFieldUi<Field extends string = string> = FieldUiBase & Readonly<{
612
- "ui:widget": "structured_file_upload";
613
- "ui:options"?: StructuredFileUploadOptions<Field>;
614
- }>;
615
- export type StructuredFileBrowserFieldUi<Field extends string = string> = FieldUiBase & Readonly<{
616
- "ui:widget": "structured_file_browser";
617
- "ui:options": StructuredFileBrowserOptions<Field>;
618
- }>;
619
- /** Presentation of one field; `ui:widget` selects the options contract. */
620
- export type FieldUiSchema<Field extends string = string> = PlainFieldUi | SelectFieldUi<Field> | StructuredFileUploadFieldUi<Field> | StructuredFileBrowserFieldUi<Field>;
621
- export type FormMarkdownBlock = Readonly<{
622
- md: string;
623
- }>;
624
- export type FormSectionItem<Field extends string = string> = Field | FormMarkdownBlock;
625
- export type FormSection<Field extends string = string> = Readonly<{
626
- title?: string | null;
627
- description?: string | null;
628
- items: readonly FormSectionItem<Field>[];
629
- layout?: FormLayout | null;
630
- }>;
631
- export type FormStep<Field extends string = string> = Readonly<{
632
- id: string;
633
- title: string;
634
- description?: string | null;
635
- includeInBasicInfo?: boolean | null;
636
- items: readonly FormSectionItem<Field>[];
637
- visibility?: FieldVisibilityRule<Field> | null;
638
- }>;
639
- export type FormMetadata<Field extends string> = Readonly<{
640
- createSteps?: readonly FormStep<Field>[];
641
- layout?: FormLayout;
642
- uiSchema?: Partial<Record<Field, FieldUiSchema<Field>>>;
643
- updateSections?: readonly FormSection<Field>[];
644
- visibility?: Partial<Record<Field, FieldVisibilityRule<Field>>>;
645
- }>;
646
- export type DatasetProviderResult<Value> = Readonly<{
647
- status: "success";
648
- value: Value;
649
- }> | Readonly<{
650
- status: "failure";
651
- error: DatasetProviderError;
652
- }>;
653
- export type DatasetScalarType = "boolean" | "string" | "int64" | "float64" | "decimal" | "date" | "timestamp" | "duration" | "json";
654
- export type DatasetValue = Readonly<{
655
- kind: "null";
656
- }> | Readonly<{
657
- kind: "boolean";
658
- value: boolean;
659
- }> | Readonly<{
660
- kind: "string";
661
- value: string;
662
- }> | Readonly<{
663
- kind: "int64";
664
- value: string;
665
- }> | Readonly<{
666
- kind: "float64";
667
- value: number;
668
- }> | Readonly<{
669
- kind: "decimal";
670
- value: string;
671
- }> | Readonly<{
672
- kind: "date";
673
- value: string;
674
- }> | Readonly<{
675
- kind: "timestamp";
676
- value: string;
677
- }> | Readonly<{
678
- kind: "duration";
679
- value: string;
680
- }> | Readonly<{
681
- kind: "json";
682
- value: JsonValue;
683
- }>;
684
- export type DatasetPredicateOperator = "eq" | "ne" | "lt" | "lte" | "gt" | "gte" | "in" | "not_in" | "is_null" | "is_not_null" | "contains" | "starts_with";
685
- export type DatasetAggregateOperation = "count" | "count_distinct" | "sum" | "min" | "max" | "avg";
686
- export type DatasetQueryIntent = "records" | "aggregate" | "time_series";
687
- export type DatasetTimeBucket = "hour" | "day" | "week" | "month";
688
- export type DatasetPredicate = Readonly<{
689
- kind: "predicate";
690
- fieldId: string;
691
- operator: DatasetPredicateOperator;
692
- values: readonly DatasetValue[];
693
- }>;
694
- export type DatasetFilter = DatasetPredicate | Readonly<{
695
- kind: "and" | "or";
696
- filters: readonly DatasetFilter[];
697
- }> | Readonly<{
698
- kind: "not";
699
- filter: DatasetFilter;
700
- }>;
701
- export type DatasetOrder = Readonly<{
702
- fieldOrAlias: string;
703
- direction: "asc" | "desc";
704
- }>;
705
- export type DatasetOperation = Readonly<{
706
- kind: "records";
707
- projection: readonly string[];
708
- filter?: DatasetFilter;
709
- orderBy: readonly DatasetOrder[];
710
- cursor?: string;
711
- }> | Readonly<{
712
- kind: "aggregate";
713
- filter?: DatasetFilter;
714
- groupBy: readonly string[];
715
- measures: readonly Readonly<{
716
- alias: string;
717
- operation: DatasetAggregateOperation;
718
- fieldId?: string;
719
- }>[];
720
- orderBy: readonly DatasetOrder[];
721
- cursor?: string;
722
- }> | Readonly<{
723
- kind: "time_series";
724
- timeFieldId: string;
725
- measure: Readonly<{
726
- alias: string;
727
- operation: DatasetAggregateOperation;
728
- fieldId?: string;
729
- }>;
730
- bucket: DatasetTimeBucket;
731
- order: "asc" | "desc";
732
- filter?: DatasetFilter;
733
- cursor?: string;
734
- }>;
735
- export type DatasetProviderCapabilities = Readonly<{
736
- intents: readonly DatasetQueryIntent[];
737
- predicates: readonly DatasetPredicateOperator[];
738
- aggregates: readonly DatasetAggregateOperation[];
739
- grouping: boolean;
740
- ordering: boolean;
741
- pagination: boolean;
742
- definitionRefresh: boolean;
743
- limits: Readonly<{
744
- maxRows: number;
745
- maxBytes: number;
746
- timeoutMs: number;
747
- maxPageRows: number;
748
- }>;
749
- }>;
750
- export type SafeDiagnostic = Readonly<{
751
- code: string;
752
- message: string;
753
- fieldId?: string;
754
- }>;
755
- export type ConnectorContext = Readonly<{
756
- correlationId: string;
757
- deadlineEpochMs: number;
758
- }>;
759
- export type DatasetSourceLocation = Readonly<{
760
- segments: readonly [
761
- Readonly<{
762
- kind: "container";
763
- opaqueId: string;
764
- label: string;
765
- }>,
766
- ...Readonly<{
767
- kind: "container" | "dataset";
768
- opaqueId: string;
769
- label: string;
770
- }>[]
771
- ];
772
- }>;
773
- export type DatasetDefinition = Readonly<{
774
- version: 1;
775
- fields: readonly Readonly<{
776
- id: string;
777
- name: string;
778
- type: DatasetScalarType;
779
- nullable: boolean;
780
- semantic?: string;
781
- }>[];
782
- measures: readonly Readonly<{
783
- id: string;
784
- name: string;
785
- resultType: DatasetScalarType;
786
- }>[];
787
- relationships: readonly Readonly<{
788
- id: string;
789
- fromFieldId: string;
790
- toFieldId: string;
791
- cardinality: "one_to_one" | "one_to_many" | "many_to_one" | "many_to_many";
792
- }>[];
793
- }>;
794
- export type Bounds = Readonly<{
795
- maxRows: number;
796
- maxBytes: number;
797
- timeoutMs: number;
798
- }>;
799
- export type QueryInput = ConnectorContext & Readonly<{
800
- location: DatasetSourceLocation;
801
- definitionRevisionId: string;
802
- definition: DatasetDefinition;
803
- operation: DatasetOperation;
804
- bounds: Bounds;
805
- }>;
806
- export type DatasetRecordPage = Readonly<{
807
- columns: readonly Readonly<{
808
- fieldId: string;
809
- type: DatasetScalarType;
810
- }>[];
811
- rows: readonly (readonly DatasetValue[])[];
812
- nextCursor?: string;
813
- rowCount: number;
814
- byteCount: number;
815
- observedAt: string;
816
- }>;
817
- export type DatasetResultPage = (Readonly<{
818
- kind: "records";
819
- }> & DatasetRecordPage) | Readonly<{
820
- kind: "aggregate";
821
- columns: readonly Readonly<{
822
- alias: string;
823
- type: DatasetScalarType;
824
- }>[];
825
- rows: readonly (readonly DatasetValue[])[];
826
- nextCursor?: string;
827
- rowCount: number;
828
- byteCount: number;
829
- observedAt: string;
830
- }> | Readonly<{
831
- kind: "time_series";
832
- valueType: DatasetScalarType;
833
- points: readonly Readonly<{
834
- time: string;
835
- value: DatasetValue;
836
- }>[];
837
- nextCursor?: string;
838
- pointCount: number;
839
- byteCount: number;
840
- observedAt: string;
841
- }>;
842
- export type DatasetProviderError = Readonly<{
843
- kind: "not_ready" | "incompatible_source" | "unsupported_operation" | "policy_not_pushable" | "invalid_cursor" | "timeout" | "permission_denied" | "provider_unavailable" | "provider_rejected" | "invalid_provider_response";
844
- diagnostics: readonly SafeDiagnostic[];
845
- }> | Readonly<{
846
- kind: "limit_exceeded";
847
- limit: "rows" | "bytes" | "timeout";
848
- diagnostics: readonly SafeDiagnostic[];
849
- }> | Readonly<{
850
- kind: "throttled";
851
- retryAfterMs?: number;
852
- diagnostics: readonly SafeDiagnostic[];
853
- }>;
854
- /** Closed public principal vocabulary accepted by a gateway operation. */
855
- export type PortableOperationPrincipalKind = "detached_user" | "service_principal";
856
- /** Explicit delegated-subject requirement reviewed with an operation. */
857
- export type PortableOperationDelegatedSubjectPolicy = "allowed" | "forbidden" | "required";
858
- /** Fully materialized authorization policy for one exposed operation. */
859
- export type PortableOperationAuthorization = Readonly<{
860
- delegatedSubject: PortableOperationDelegatedSubjectPolicy;
861
- organization: "required";
862
- principalKinds: readonly PortableOperationPrincipalKind[];
863
- scopes: readonly string[];
864
- }>;
865
- /** Observable side-effect class reviewed before an operation becomes a tool. */
866
- export type PortableOperationEffect = "external_side_effect" | "read" | "write";
867
- /** The replay guarantee supplied by the operation implementation. */
868
- export type PortableOperationIdempotency = "idempotent" | "requires_key" | "safe";
869
- /** Explicit, bounded retry permission for callers of the operation. */
870
- export type PortableOperationRetryPolicy = Readonly<{
871
- mode: "never";
872
- }> | Readonly<{
873
- maxAttempts: number;
874
- mode: "idempotent_only";
875
- }>;
876
- /** Execution lifecycle and maximum wall-clock duration. */
877
- export type PortableOperationExecutionPolicy = Readonly<{
878
- mode: "synchronous";
879
- timeoutMs: number;
880
- }>;
881
- /** Per-invocation transport bounds. */
882
- export type PortableOperationLimits = Readonly<{
883
- maxRequestBytes: number;
884
- maxResponseBytes: number;
885
- }>;
886
- /**
887
- * Complete JSON-only operation contract reviewed by a host. Executable
888
- * handlers remain in a server runtime sidecar and never enter this descriptor.
889
- */
890
- export type PortableOperationDeclaration = Readonly<{
891
- authorization: PortableOperationAuthorization;
892
- description: string;
893
- effects: PortableOperationEffect;
894
- execution: PortableOperationExecutionPolicy;
895
- id: string;
896
- idempotency: PortableOperationIdempotency;
897
- input: PackageSchemaProjection;
898
- limits: PortableOperationLimits;
899
- output: PackageSchemaProjection;
900
- retry: PortableOperationRetryPolicy;
901
- title: string;
902
- version: string;
903
- }>;
904
- /** One catalog and identity namespace for an ordered operation list. */
905
- export type OperationDomainDeclaration<Operation extends PortableOperationDeclaration = PortableOperationDeclaration> = Readonly<{
906
- description?: string;
907
- displayOrder?: number;
908
- icon?: string;
909
- id: string;
910
- operations: readonly Operation[];
911
- tags?: readonly string[];
912
- title: string;
913
- }>;
914
- declare const ConsumerProfileIds: readonly [
915
- "runtime_json",
916
- "ai_function_input",
917
- "interactive_form",
918
- "workflow_value",
919
- "studio_props",
920
- "knowledge_record"
921
- ];
922
- export type ConsumerProfileId = (typeof ConsumerProfileIds)[number];
923
- export type ConsumerProfileDiagnostic = Readonly<{
924
- code: "fidelity_not_supported" | "invalid_default" | "invalid_root" | "recursive_reference" | "remote_reference" | "unknown_vocabulary" | "unsupported_keyword";
925
- location: string;
926
- profile: ConsumerProfileId;
927
- reason: string;
928
- }>;
929
157
  /**
930
158
  * Runtime dispatch validates the declared input schema before invoking a
931
159
  * handler. The bivariant call signature lets domains retain heterogeneous,
@@ -1109,14 +337,109 @@ export declare const createGatewayEffectHandler: (kernel: GatewayRuntimeKernel)
1109
337
  export declare const createResourceEffectHandler: <E, R, Value = unknown, Create = Value, Patch = Partial<Value>>(options: ResourceEffectHandlerOptions<E, R, Value, Create, Patch>) => (request: Request) => import("effect/Effect").Effect<Response, E | GatewayEffectRuntimeError, R>;
1110
338
  export declare const DateTimeString: import("effect/Schema").String;
1111
339
  declare const GatewayEffectRuntimeError$1: typeof GatewayEffectRuntimeError;
1112
- export declare const jsonSchema: (schema: import("effect/Schema").Top) => JsonSchemaDocument;
1113
- export declare const projectResourceSchema: (schema: import("effect/Schema").Top, metadata?: FormMetadata<string>) => ResourceSchemaProjection;
340
+ export declare const jsonSchema: (schema: import("effect/Schema").Top) => import("@collective-intelligence/extensions-sdk").JsonSchemaDocument;
341
+ export declare const projectResourceSchema: (schema: import("effect/Schema").Top, metadata?: import("@collective-intelligence/extensions-sdk").FormMetadata<string>) => ResourceSchemaProjection;
1114
342
  export declare const makeEffectCrudResource: <Entity, Create = Entity, Update = Partial<Entity>, Error = never, Requirements = never>(options: EffectCrudResourceOptions<Entity, Create, Update, Error, Requirements>) => import("effect/Effect").Effect<CrudResource<Entity, Create, Update>, Error, Requirements>;
1115
343
  export declare const UuidV7: import("effect/Schema").String;
1116
344
  type GatewayEffectRuntimeError$1 = GatewayEffectRuntimeError;
1117
345
 
1118
346
  export {
347
+ Bounds,
348
+ ConnectorContext,
349
+ ConsumerProfileDiagnostic,
350
+ ConsumerProfileId,
351
+ DatasetAggregateOperation,
352
+ DatasetDefinition,
353
+ DatasetFilter,
354
+ DatasetOperation,
355
+ DatasetOrder,
356
+ DatasetPredicate,
357
+ DatasetPredicateOperator,
358
+ DatasetProviderCapabilities,
359
+ DatasetProviderError,
360
+ DatasetProviderResult,
361
+ DatasetQueryIntent,
362
+ DatasetRecordPage,
363
+ DatasetResultPage,
364
+ DatasetScalarType,
365
+ DatasetSourceLocation,
366
+ DatasetTimeBucket,
367
+ DatasetValue,
368
+ DynamicFormAiFillConfig,
369
+ EntityCreateInput,
370
+ EntityDeleteInput,
371
+ EntityListQuery,
372
+ EntityMemberValue,
373
+ EntityOperation,
374
+ EntityOperationResult,
375
+ EntityPage,
376
+ EntityRequest,
377
+ EntityUpdateInput,
378
+ EntityUploadInput,
379
+ EntityUploadSlot,
380
+ FieldUiSchema,
381
+ FieldValidationRule,
382
+ FieldVisibilityRule,
383
+ FormLayout,
384
+ FormMarkdownBlock,
385
+ FormMetadata,
386
+ FormSection,
387
+ FormSectionItem,
388
+ FormStep,
1119
389
  GatewayEffectRuntimeError$1 as GatewayEffectRuntimeError,
390
+ IdempotencyKey,
391
+ JsonObject,
392
+ JsonPrimitive,
393
+ JsonSchemaDocument,
394
+ JsonValue,
395
+ OperationDomainDeclaration,
396
+ PackageSchemaProjection,
397
+ PlainFormWidget,
398
+ PortableOperationAuthorization,
399
+ PortableOperationDeclaration,
400
+ PortableOperationDelegatedSubjectPolicy,
401
+ PortableOperationEffect,
402
+ PortableOperationExecutionPolicy,
403
+ PortableOperationIdempotency,
404
+ PortableOperationLimits,
405
+ PortableOperationPrincipalKind,
406
+ PortableOperationRetryPolicy,
407
+ PortableResourceSchema,
408
+ ProjectionFidelity,
409
+ QueryInput,
410
+ ResourceCapabilities,
411
+ ResourceCreateInput,
412
+ ResourceCreateRequest,
413
+ ResourceCursor,
414
+ ResourceDefinition,
415
+ ResourceError,
416
+ ResourceErrorCode,
417
+ ResourceFilter,
418
+ ResourceGetRequest,
419
+ ResourceId,
420
+ ResourceIdentityField,
421
+ ResourceJsonValue,
422
+ ResourceLifecycleInput,
423
+ ResourceLifecycleRequest,
424
+ ResourceListQuery,
425
+ ResourceListRequest,
426
+ ResourceListResult,
427
+ ResourceMutationInput,
428
+ ResourcePagination,
429
+ ResourcePaginationMode,
430
+ ResourceRecord,
431
+ ResourceRecordId,
432
+ ResourceResult,
433
+ ResourceRevision,
434
+ ResourceSort,
435
+ ResourceTransportRequest,
436
+ ResourceUpdateRequest,
437
+ SafeDiagnostic,
438
+ SelectFormWidget,
439
+ SelectOptions,
440
+ StructuredFileBrowserOptions,
441
+ StructuredFileUploadOptions,
442
+ VisibilityCondition,
1120
443
  };
1121
444
 
1122
445
  export {};