@collective-intelligence/extensions-sdk 0.0.0-stage → 0.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (64) hide show
  1. package/README.md +1276 -2
  2. package/dist/components/agents.d.ts +155 -0
  3. package/dist/components/authoring-core.d.ts +253 -0
  4. package/dist/components/base.d.ts +25 -0
  5. package/dist/components/catalog.d.ts +21 -0
  6. package/dist/components/connections.d.ts +52 -0
  7. package/dist/components/connector-instances.d.ts +142 -0
  8. package/dist/components/connectors.d.ts +408 -0
  9. package/dist/components/dataset-parser-validation.d.ts +2 -0
  10. package/dist/components/dataset-parser.d.ts +74 -0
  11. package/dist/components/datasets.d.ts +356 -0
  12. package/dist/components/declaration.d.ts +12 -0
  13. package/dist/components/executable-authoring.d.ts +27 -0
  14. package/dist/components/external-app-gateway.d.ts +7 -0
  15. package/dist/components/external-application.d.ts +17 -0
  16. package/dist/components/fields.d.ts +34 -0
  17. package/dist/components/knowledge-remote-reference.d.ts +7 -0
  18. package/dist/components/knowledge.d.ts +188 -0
  19. package/dist/components/lifecycle.d.ts +7 -0
  20. package/dist/components/metadata-authoring.d.ts +66 -0
  21. package/dist/components/notification-channel-capabilities.d.ts +7 -0
  22. package/dist/components/remote-tool-collection.d.ts +3 -0
  23. package/dist/components/studio.d.ts +48 -0
  24. package/dist/components/templates.d.ts +50 -0
  25. package/dist/components/tools.d.ts +138 -0
  26. package/dist/components/workflow-editor.d.ts +28 -0
  27. package/dist/components/workflow-node-authoring.d.ts +4 -0
  28. package/dist/components/workflow-ports.d.ts +26 -0
  29. package/dist/components/workflow-results.d.ts +75 -0
  30. package/dist/components/workflow-rules.d.ts +20 -0
  31. package/dist/components/workflow-schema.d.ts +22 -0
  32. package/dist/components/workflows.d.ts +529 -0
  33. package/dist/foundation/json.d.ts +8 -0
  34. package/dist/foundation/string-order.d.ts +2 -0
  35. package/dist/gateway/declarations.d.ts +69 -0
  36. package/dist/gateway/operation-contract.d.ts +29 -0
  37. package/dist/hosted/contributions.d.ts +52 -0
  38. package/dist/index.d.ts +69 -0
  39. package/dist/index.js +1 -0
  40. package/dist/package/canonical.d.ts +9 -0
  41. package/dist/package/connector-readers.d.ts +171 -0
  42. package/dist/package/definition.d.ts +31 -0
  43. package/dist/package/dependencies.d.ts +10 -0
  44. package/dist/package/instance-readers.d.ts +4 -0
  45. package/dist/package/knowledge-readers.d.ts +137 -0
  46. package/dist/package/manifest.d.ts +42 -0
  47. package/dist/package/parse-manifest.d.ts +3 -0
  48. package/dist/package/policy-readers.d.ts +17 -0
  49. package/dist/package/presentation-readers.d.ts +61 -0
  50. package/dist/package/primitive-readers.d.ts +678 -0
  51. package/dist/package/readers.d.ts +230 -0
  52. package/dist/package/template-readers.d.ts +37 -0
  53. package/dist/package/workflow-readers.d.ts +167 -0
  54. package/dist/release/archive.d.ts +11 -0
  55. package/dist/release/manifest.d.ts +66 -0
  56. package/dist/release/paths.d.ts +5 -0
  57. package/dist/release/stored-manifest.d.ts +13 -0
  58. package/dist/schema/forms.d.ts +117 -0
  59. package/dist/schema/knowledge-record.d.ts +16 -0
  60. package/dist/schema/normalization.d.ts +7 -0
  61. package/dist/schema/profiles.d.ts +45 -0
  62. package/dist/schema/projection.d.ts +59 -0
  63. package/dist/schema/source.d.ts +65 -0
  64. package/package.json +46 -4
@@ -0,0 +1,356 @@
1
+ import type { JsonValue } from "../foundation/json.js";
2
+ import type { PackagePrimitiveBase } from "./base.js";
3
+ export type DatasetProviderResult<Value> = Readonly<{
4
+ status: "success";
5
+ value: Value;
6
+ }> | Readonly<{
7
+ status: "failure";
8
+ error: DatasetProviderError;
9
+ }>;
10
+ type ProviderResult<Value> = DatasetProviderResult<Value> | PromiseLike<DatasetProviderResult<Value>>;
11
+ /** Structural admission keeps host context owned by the executable SDK. */
12
+ export interface ManagedDatasetProviderImplementation {
13
+ readonly readiness: (input: ReadinessInput, context: never) => ProviderResult<Readiness>;
14
+ readonly datasetProvision: (input: DatasetProvisionInput, context: never) => ProviderResult<DatasetProvisionResult>;
15
+ readonly datasetIngest: (input: DatasetIngestInput, context: never) => ProviderResult<DatasetIngestResult>;
16
+ readonly datasetQuery: (input: QueryInput, context: never) => ProviderResult<DatasetResultPage>;
17
+ readonly datasetInspect: (input: DatasetInspectInput, context: never) => ProviderResult<DatasetInspectResult>;
18
+ readonly datasetDelete: (input: DatasetDeleteInput, context: never) => ProviderResult<DatasetDeleteResult>;
19
+ }
20
+ /** Structural admission keeps host context owned by the executable SDK. */
21
+ export interface ExternalDatasetProviderImplementation {
22
+ readonly readiness: (input: ReadinessInput, context: never) => ProviderResult<Readiness>;
23
+ readonly listSources: (input: ListSourcesInput, context: never) => ProviderResult<SourcePage>;
24
+ readonly discoverDefinition: (input: DiscoverDefinitionInput, context: never) => ProviderResult<DefinitionProposal>;
25
+ readonly datasetQuery: (input: QueryInput, context: never) => ProviderResult<DatasetResultPage>;
26
+ readonly datasetInspect: (input: DatasetInspectInput, context: never) => ProviderResult<DatasetInspectResult>;
27
+ }
28
+ export type DatasetScalarType = "boolean" | "string" | "int64" | "float64" | "decimal" | "date" | "timestamp" | "duration" | "json";
29
+ export type DatasetValue = Readonly<{
30
+ kind: "null";
31
+ }> | Readonly<{
32
+ kind: "boolean";
33
+ value: boolean;
34
+ }> | Readonly<{
35
+ kind: "string";
36
+ value: string;
37
+ }> | Readonly<{
38
+ kind: "int64";
39
+ value: string;
40
+ }> | Readonly<{
41
+ kind: "float64";
42
+ value: number;
43
+ }> | Readonly<{
44
+ kind: "decimal";
45
+ value: string;
46
+ }> | Readonly<{
47
+ kind: "date";
48
+ value: string;
49
+ }> | Readonly<{
50
+ kind: "timestamp";
51
+ value: string;
52
+ }> | Readonly<{
53
+ kind: "duration";
54
+ value: string;
55
+ }> | Readonly<{
56
+ kind: "json";
57
+ value: JsonValue;
58
+ }>;
59
+ export type DatasetPredicateOperator = "eq" | "ne" | "lt" | "lte" | "gt" | "gte" | "in" | "not_in" | "is_null" | "is_not_null" | "contains" | "starts_with";
60
+ export type DatasetAggregateOperation = "count" | "count_distinct" | "sum" | "min" | "max" | "avg";
61
+ export type DatasetBindingMode = "external" | "managed";
62
+ export type DatasetQueryIntent = "records" | "aggregate" | "time_series";
63
+ export type DatasetTimeBucket = "hour" | "day" | "week" | "month";
64
+ export type DatasetIngestMode = "append" | "upsert" | "replace";
65
+ export type DatasetPredicate = Readonly<{
66
+ kind: "predicate";
67
+ fieldId: string;
68
+ operator: DatasetPredicateOperator;
69
+ values: readonly DatasetValue[];
70
+ }>;
71
+ export type DatasetFilter = DatasetPredicate | Readonly<{
72
+ kind: "and" | "or";
73
+ filters: readonly DatasetFilter[];
74
+ }> | Readonly<{
75
+ kind: "not";
76
+ filter: DatasetFilter;
77
+ }>;
78
+ export type DatasetOrder = Readonly<{
79
+ fieldOrAlias: string;
80
+ direction: "asc" | "desc";
81
+ }>;
82
+ export type DatasetOperation = Readonly<{
83
+ kind: "records";
84
+ projection: readonly string[];
85
+ filter?: DatasetFilter;
86
+ orderBy: readonly DatasetOrder[];
87
+ cursor?: string;
88
+ }> | Readonly<{
89
+ kind: "aggregate";
90
+ filter?: DatasetFilter;
91
+ groupBy: readonly string[];
92
+ measures: readonly Readonly<{
93
+ alias: string;
94
+ operation: DatasetAggregateOperation;
95
+ fieldId?: string;
96
+ }>[];
97
+ orderBy: readonly DatasetOrder[];
98
+ cursor?: string;
99
+ }> | Readonly<{
100
+ kind: "time_series";
101
+ timeFieldId: string;
102
+ measure: Readonly<{
103
+ alias: string;
104
+ operation: DatasetAggregateOperation;
105
+ fieldId?: string;
106
+ }>;
107
+ bucket: DatasetTimeBucket;
108
+ order: "asc" | "desc";
109
+ filter?: DatasetFilter;
110
+ cursor?: string;
111
+ }>;
112
+ export type DatasetProviderCapabilities = Readonly<{
113
+ intents: readonly DatasetQueryIntent[];
114
+ predicates: readonly DatasetPredicateOperator[];
115
+ aggregates: readonly DatasetAggregateOperation[];
116
+ grouping: boolean;
117
+ ordering: boolean;
118
+ pagination: boolean;
119
+ definitionRefresh: boolean;
120
+ limits: Readonly<{
121
+ maxRows: number;
122
+ maxBytes: number;
123
+ timeoutMs: number;
124
+ maxPageRows: number;
125
+ }>;
126
+ }>;
127
+ export type SafeDiagnostic = Readonly<{
128
+ code: string;
129
+ message: string;
130
+ fieldId?: string;
131
+ }>;
132
+ export type ConnectorContext = Readonly<{
133
+ correlationId: string;
134
+ deadlineEpochMs: number;
135
+ }>;
136
+ export type DatasetSourceLocation = Readonly<{
137
+ segments: readonly [
138
+ Readonly<{
139
+ kind: "container";
140
+ opaqueId: string;
141
+ label: string;
142
+ }>,
143
+ ...Readonly<{
144
+ kind: "container" | "dataset";
145
+ opaqueId: string;
146
+ label: string;
147
+ }>[]
148
+ ];
149
+ }>;
150
+ export type Compatibility = Readonly<{
151
+ status: "compatible";
152
+ diagnostics: readonly SafeDiagnostic[];
153
+ }> | Readonly<{
154
+ status: "incompatible";
155
+ diagnostics: readonly [SafeDiagnostic, ...SafeDiagnostic[]];
156
+ }>;
157
+ export type DatasetSourceItem = Readonly<{
158
+ kind: "container" | "dataset";
159
+ location: DatasetSourceLocation;
160
+ label: string;
161
+ description?: string;
162
+ selectable: boolean;
163
+ compatibility: Compatibility;
164
+ }>;
165
+ export type DatasetHealth = Readonly<{
166
+ status: "unknown";
167
+ }> | Readonly<{
168
+ status: "healthy";
169
+ checkedAt: string;
170
+ }> | Readonly<{
171
+ status: "degraded" | "unavailable";
172
+ checkedAt: string;
173
+ diagnostics: readonly [SafeDiagnostic, ...SafeDiagnostic[]];
174
+ }>;
175
+ export type Readiness = Readonly<{
176
+ status: "ready";
177
+ capabilities: DatasetProviderCapabilities;
178
+ }> | Readonly<{
179
+ status: "not_ready";
180
+ diagnostics: readonly [SafeDiagnostic, ...SafeDiagnostic[]];
181
+ }>;
182
+ export type SourcePage = Readonly<{
183
+ items: readonly DatasetSourceItem[];
184
+ nextCursor?: string;
185
+ truncated: boolean;
186
+ }>;
187
+ export type DatasetDefinition = Readonly<{
188
+ version: 1;
189
+ fields: readonly Readonly<{
190
+ id: string;
191
+ name: string;
192
+ type: DatasetScalarType;
193
+ nullable: boolean;
194
+ semantic?: string;
195
+ }>[];
196
+ measures: readonly Readonly<{
197
+ id: string;
198
+ name: string;
199
+ resultType: DatasetScalarType;
200
+ }>[];
201
+ relationships: readonly Readonly<{
202
+ id: string;
203
+ fromFieldId: string;
204
+ toFieldId: string;
205
+ cardinality: "one_to_one" | "one_to_many" | "many_to_one" | "many_to_many";
206
+ }>[];
207
+ }>;
208
+ export type DefinitionProposal = Readonly<{
209
+ location: DatasetSourceLocation;
210
+ label: string;
211
+ definition: DatasetDefinition;
212
+ compatibility: Compatibility;
213
+ observedAt: string;
214
+ diagnostics: readonly SafeDiagnostic[];
215
+ }>;
216
+ export type ExternalDatasetBinding = Readonly<{
217
+ datasetId: string;
218
+ connectorFqn: string;
219
+ connectionId: string;
220
+ location: DatasetSourceLocation;
221
+ admittedRevisionId: string;
222
+ mode: "external";
223
+ health: DatasetHealth;
224
+ compatibility: Compatibility;
225
+ refresh: Readonly<{
226
+ status: "idle";
227
+ }> | Readonly<{
228
+ status: "running";
229
+ operationId: string;
230
+ }> | Readonly<{
231
+ status: "review_required";
232
+ proposalId: string;
233
+ }> | Readonly<{
234
+ status: "failed";
235
+ diagnostics: readonly [SafeDiagnostic, ...SafeDiagnostic[]];
236
+ }>;
237
+ createdAt: string;
238
+ updatedAt: string;
239
+ }>;
240
+ export type Bounds = Readonly<{
241
+ maxRows: number;
242
+ maxBytes: number;
243
+ timeoutMs: number;
244
+ }>;
245
+ export type ReadinessInput = ConnectorContext;
246
+ export type ListSourcesInput = ConnectorContext & Readonly<{
247
+ parent?: DatasetSourceLocation;
248
+ cursor?: string;
249
+ limit: number;
250
+ }>;
251
+ export type DiscoverDefinitionInput = ConnectorContext & Readonly<{
252
+ location: DatasetSourceLocation;
253
+ }>;
254
+ export type QueryInput = ConnectorContext & Readonly<{
255
+ location: DatasetSourceLocation;
256
+ definitionRevisionId: string;
257
+ definition: DatasetDefinition;
258
+ operation: DatasetOperation;
259
+ bounds: Bounds;
260
+ }>;
261
+ export type DatasetProvisionInput = ConnectorContext & Readonly<{
262
+ definitionRevisionId: string;
263
+ definition: DatasetDefinition;
264
+ templateFqn: string;
265
+ }>;
266
+ export type DatasetProvisionResult = Readonly<{
267
+ physicalLocator: string;
268
+ }>;
269
+ export type DatasetIngestInput = ConnectorContext & Readonly<{
270
+ definitionRevisionId: string;
271
+ definition: DatasetDefinition;
272
+ physicalLocator: string;
273
+ mode: DatasetIngestMode;
274
+ records: DatasetRecordPage;
275
+ }>;
276
+ export type DatasetIngestResult = Readonly<{
277
+ rowCount: number;
278
+ byteCount: number;
279
+ }>;
280
+ export type DatasetInspectInput = ConnectorContext & Readonly<{
281
+ definitionRevisionId: string;
282
+ physicalLocator?: string;
283
+ location?: DatasetSourceLocation;
284
+ }>;
285
+ export type DatasetInspectResult = Readonly<{
286
+ health: DatasetHealth;
287
+ }>;
288
+ export type DatasetDeleteInput = ConnectorContext & Readonly<{
289
+ definitionRevisionId: string;
290
+ physicalLocator: string;
291
+ }>;
292
+ export type DatasetDeleteResult = Readonly<{
293
+ status: "deleted";
294
+ }>;
295
+ export type DatasetRecordPage = Readonly<{
296
+ columns: readonly Readonly<{
297
+ fieldId: string;
298
+ type: DatasetScalarType;
299
+ }>[];
300
+ rows: readonly (readonly DatasetValue[])[];
301
+ nextCursor?: string;
302
+ rowCount: number;
303
+ byteCount: number;
304
+ observedAt: string;
305
+ }>;
306
+ export type DatasetResultPage = (Readonly<{
307
+ kind: "records";
308
+ }> & DatasetRecordPage) | Readonly<{
309
+ kind: "aggregate";
310
+ columns: readonly Readonly<{
311
+ alias: string;
312
+ type: DatasetScalarType;
313
+ }>[];
314
+ rows: readonly (readonly DatasetValue[])[];
315
+ nextCursor?: string;
316
+ rowCount: number;
317
+ byteCount: number;
318
+ observedAt: string;
319
+ }> | Readonly<{
320
+ kind: "time_series";
321
+ valueType: DatasetScalarType;
322
+ points: readonly Readonly<{
323
+ time: string;
324
+ value: DatasetValue;
325
+ }>[];
326
+ nextCursor?: string;
327
+ pointCount: number;
328
+ byteCount: number;
329
+ observedAt: string;
330
+ }>;
331
+ export type DatasetProviderError = Readonly<{
332
+ kind: "not_ready" | "incompatible_source" | "unsupported_operation" | "policy_not_pushable" | "invalid_cursor" | "timeout" | "permission_denied" | "provider_unavailable" | "provider_rejected" | "invalid_provider_response";
333
+ diagnostics: readonly SafeDiagnostic[];
334
+ }> | Readonly<{
335
+ kind: "limit_exceeded";
336
+ limit: "rows" | "bytes" | "timeout";
337
+ diagnostics: readonly SafeDiagnostic[];
338
+ }> | Readonly<{
339
+ kind: "throttled";
340
+ retryAfterMs?: number;
341
+ diagnostics: readonly SafeDiagnostic[];
342
+ }>;
343
+ export type ManagedDatasetProviderDeclaration = PackagePrimitiveBase<"managedDatasetProvider"> & Readonly<{
344
+ connectionTemplateFqns: readonly string[];
345
+ capabilities: DatasetProviderCapabilities;
346
+ }>;
347
+ export type ExternalDatasetProviderDeclaration = PackagePrimitiveBase<"externalDatasetProvider"> & Readonly<{
348
+ connectionTemplateFqns: readonly string[];
349
+ capabilities: DatasetProviderCapabilities;
350
+ /** Optional source-specific capabilities selected by an opaque location prefix. */
351
+ sourceCapabilities?: readonly Readonly<{
352
+ capabilities: DatasetProviderCapabilities;
353
+ datasetOpaqueIdPrefix: string;
354
+ }>[];
355
+ }>;
356
+ export {};
@@ -0,0 +1,12 @@
1
+ import type { AgentDeclaration, SkillDeclaration } from "./agents.js";
2
+ import type { DomainDeclaration, DomainTemplateDeclaration, SkillTemplateDeclaration } from "./catalog.js";
3
+ import type { KnowledgeConnectorInstanceDeclaration, DatasetConnectorInstanceDeclaration } from "./connector-instances.js";
4
+ import type { ConnectionDeclaration, DatasetParserDeclaration, ExternalDatasetProviderDeclaration, ManagedDatasetProviderDeclaration, EventListenerDeclaration, DocumentsConnectorDeclaration, KnowledgeConnectorDeclaration, KnowledgeConnectorOAuthDeclaration, KnowledgeEntityAdapterDeclaration, KnowledgeRelationAdapterDeclaration, OrganizationSsoDeclaration } from "./connectors.js";
5
+ import type { ExternalAppGatewayDeclaration } from "./external-app-gateway.js";
6
+ import type { ExternalApplicationDeclaration } from "./external-application.js";
7
+ import type { KnowledgeEntitySchemaDeclaration, KnowledgePolicyDeclaration, KnowledgeRelationSchemaDeclaration } from "./knowledge.js";
8
+ import type { StudioAppDeclaration, StudioComponentDeclaration } from "./studio.js";
9
+ import type { DatasetBlueprintDeclaration, DatasetTableTemplateDeclaration } from "./templates.js";
10
+ import type { FieldTransformerDeclaration, NotificationChannelDeclaration, RemoteToolCollectionDeclaration, ToolCollectionDeclaration, ToolDeclaration, ToolSettingsOptionsDeclaration } from "./tools.js";
11
+ import type { WorkflowDeclaration, WorkflowFieldCollectionDeclaration, WorkflowFieldDeclaration, WorkflowNodeCollectionDeclaration, WorkflowNodeDeclaration, WorkflowTemplateDeclaration } from "./workflows.js";
12
+ export type PackagePrimitiveDeclaration = KnowledgeConnectorInstanceDeclaration | DatasetConnectorInstanceDeclaration | AgentDeclaration | OrganizationSsoDeclaration | KnowledgeEntityAdapterDeclaration | ConnectionDeclaration | DatasetParserDeclaration | DatasetBlueprintDeclaration | DatasetTableTemplateDeclaration | ExternalDatasetProviderDeclaration | ManagedDatasetProviderDeclaration | DocumentsConnectorDeclaration | KnowledgeConnectorDeclaration | KnowledgeConnectorOAuthDeclaration | DomainDeclaration | DomainTemplateDeclaration | EventListenerDeclaration | ExternalApplicationDeclaration | ExternalAppGatewayDeclaration | FieldTransformerDeclaration | KnowledgeEntitySchemaDeclaration | KnowledgePolicyDeclaration | KnowledgeRelationSchemaDeclaration | NotificationChannelDeclaration | RemoteToolCollectionDeclaration | KnowledgeRelationAdapterDeclaration | SkillDeclaration | SkillTemplateDeclaration | StudioAppDeclaration | StudioComponentDeclaration | ToolCollectionDeclaration | ToolSettingsOptionsDeclaration | ToolDeclaration | WorkflowDeclaration | WorkflowFieldCollectionDeclaration | WorkflowFieldDeclaration | WorkflowNodeCollectionDeclaration | WorkflowNodeDeclaration | WorkflowTemplateDeclaration;
@@ -0,0 +1,27 @@
1
+ import type { JsonValue } from "../foundation/json.js";
2
+ import type { FormSchemaSource } from "../schema/forms.js";
3
+ import type { SchemaValue } from "../schema/source.js";
4
+ import type { ClassDeclaration, ClassDeclaredComponent, ConnectionClassDeclaration, ConnectionImplementation, EventListenerClassDeclaration, EventListenerImplementation, DocumentsConnectorClassDeclaration, DocumentsConnectorImplementation, FieldTransformerClassDeclaration, FieldTransformerImplementation, KnowledgeConnectorClassDeclaration, KnowledgeConnectorImplementation, KnowledgeConnectorOAuthClassDeclaration, KnowledgeConnectorOAuthImplementation, KnowledgeEntityAdapterClassDeclaration, KnowledgeEntityAdapterImplementation, KnowledgeRelationAdapterClassDeclaration, KnowledgeRelationAdapterImplementation, NotificationChannelClassDeclaration, NotificationChannelImplementation, ToolClassDeclaration, ToolImplementation, ToolSettingsOptionsClassDeclaration, ToolSettingsOptionsImplementation, WorkflowFieldClassDeclaration, WorkflowFieldImplementation, WorkflowFieldValue } from "./authoring-core.js";
5
+ import type { ConnectionDeclaration, DocumentsConnectorDeclaration, EventListenerDeclaration, KnowledgeConnectorDeclaration, KnowledgeConnectorOAuthDeclaration, KnowledgeEntityAdapterDeclaration, KnowledgeRelationAdapterDeclaration, OrganizationSsoDeclaration } from "./connectors.js";
6
+ import type { DatasetParserImplementation } from "./dataset-parser.js";
7
+ import type { FieldTransformerDeclaration, NotificationChannelDeclaration, ToolDeclaration, ToolSettingsOptionsDeclaration } from "./tools.js";
8
+ import type { WorkflowFieldDeclaration } from "./workflows.js";
9
+ /** Declares an executable component as a portable manifest plus owned class. */
10
+ export declare const declareTool: <InputSchema, OutputSchema, Constructor extends new () => ToolImplementation<SchemaValue<InputSchema>, SchemaValue<OutputSchema>>>(input: ToolClassDeclaration<InputSchema, OutputSchema, Constructor>) => ClassDeclaredComponent<ToolDeclaration, Constructor>;
11
+ export declare const declareConnection: <Schema extends FormSchemaSource, Constructor extends new () => ConnectionImplementation<SchemaValue<Schema>>>(input: ConnectionClassDeclaration<Schema, Constructor>) => ClassDeclaredComponent<ConnectionDeclaration, Constructor>;
12
+ export declare const declareDocumentsConnector: <Constructor extends new () => DocumentsConnectorImplementation>(input: DocumentsConnectorClassDeclaration<Constructor>) => ClassDeclaredComponent<DocumentsConnectorDeclaration, Constructor>;
13
+ export declare const declareKnowledgeConnector: <Schema extends FormSchemaSource, Constructor extends new () => KnowledgeConnectorImplementation>(input: KnowledgeConnectorClassDeclaration<Schema, Constructor> & (InstanceType<Constructor> extends DatasetParserImplementation ? never : unknown)) => ClassDeclaredComponent<KnowledgeConnectorDeclaration, Constructor>;
14
+ export declare const declareWorkflowField: <Schema, OptionValue extends JsonValue = WorkflowFieldValue<Schema>, Constructor extends new () => WorkflowFieldImplementation<WorkflowFieldValue<Schema>, OptionValue> = new () => WorkflowFieldImplementation<WorkflowFieldValue<Schema>, OptionValue>>(input: WorkflowFieldClassDeclaration<Schema, OptionValue, Constructor>) => ClassDeclaredComponent<WorkflowFieldDeclaration, Constructor>;
15
+ export declare const declareEventListener: <Constructor extends new () => EventListenerImplementation>(input: EventListenerClassDeclaration<Constructor>) => ClassDeclaredComponent<EventListenerDeclaration, Constructor>;
16
+ export declare const declareKnowledgeEntityAdapter: <Constructor extends new () => KnowledgeEntityAdapterImplementation>(input: KnowledgeEntityAdapterClassDeclaration<Constructor>) => ClassDeclaredComponent<KnowledgeEntityAdapterDeclaration, Constructor>;
17
+ export declare const declareKnowledgeConnectorOAuth: <Constructor extends new () => KnowledgeConnectorOAuthImplementation>(input: KnowledgeConnectorOAuthClassDeclaration<Constructor>) => ClassDeclaredComponent<KnowledgeConnectorOAuthDeclaration, Constructor>;
18
+ export declare const declareToolSettingsOptions: <Constructor extends new () => ToolSettingsOptionsImplementation>(input: ToolSettingsOptionsClassDeclaration<Constructor>) => ClassDeclaredComponent<ToolSettingsOptionsDeclaration, Constructor>;
19
+ export declare const declareKnowledgeRelationAdapter: <Constructor extends new () => KnowledgeRelationAdapterImplementation>(input: KnowledgeRelationAdapterClassDeclaration<Constructor>) => ClassDeclaredComponent<KnowledgeRelationAdapterDeclaration, Constructor>;
20
+ export declare const declareFieldTransformer: <Constructor extends new () => FieldTransformerImplementation>(input: FieldTransformerClassDeclaration<Constructor>) => ClassDeclaredComponent<FieldTransformerDeclaration, Constructor>;
21
+ export declare const declareNotificationChannel: <Schema extends FormSchemaSource, SetupSchema extends FormSchemaSource, Constructor extends new () => NotificationChannelImplementation>(input: NotificationChannelClassDeclaration<Schema, SetupSchema, Constructor>) => ClassDeclaredComponent<NotificationChannelDeclaration, Constructor>;
22
+ /** Structural admission keeps host APIs and frameworks outside the base SDK. */
23
+ export type OrganizationSsoImplementation = Readonly<{
24
+ authorizationUrl: (...input: never[]) => string | PromiseLike<string>;
25
+ exchangeCode: (...input: never[]) => object | PromiseLike<object>;
26
+ }>;
27
+ export declare const declareOrganizationSso: <Constructor extends new () => OrganizationSsoImplementation>(input: ClassDeclaration<OrganizationSsoDeclaration, Constructor>) => ClassDeclaredComponent<OrganizationSsoDeclaration, Constructor>;
@@ -0,0 +1,7 @@
1
+ import type { PortableOperationGatewayContract } from "../gateway/operation-contract.js";
2
+ import type { PackagePrimitiveBase } from "./base.js";
3
+ /** Package-owned Gateway admission boundary, with deployment inputs kept outside release contents. */
4
+ export type ExternalAppGatewayDeclaration = PackagePrimitiveBase<"externalAppGateway"> & Readonly<{
5
+ expectedContract: PortableOperationGatewayContract;
6
+ }>;
7
+ export declare const readExternalAppGateway: import("../package/readers.js").ReadValue<ExternalAppGatewayDeclaration>;
@@ -0,0 +1,17 @@
1
+ import type { PackagePrimitiveBase } from "./base.js";
2
+ import type { LifecycleOptions } from "./lifecycle.js";
3
+ export type ExternalApplicationType = "confidential" | "public";
4
+ /**
5
+ * Portable Public Application definition. Tokens and client secrets are never
6
+ * declared here; Dashboard rotate remains the credential path.
7
+ */
8
+ export type ExternalApplicationDeclaration = PackagePrimitiveBase<"externalApplication"> & Readonly<{
9
+ allowedOrigins: readonly string[];
10
+ applicationType: ExternalApplicationType;
11
+ audience: string;
12
+ lifecycle: LifecycleOptions;
13
+ postLogoutRedirectUris: readonly string[];
14
+ redirectUris: readonly string[];
15
+ scopes: readonly string[];
16
+ setupInstructions?: string;
17
+ }>;
@@ -0,0 +1,34 @@
1
+ import type { JsonObject, JsonValue } from "../foundation/json.js";
2
+ /** A named component of a composite package field. */
3
+ export type FieldPart = Readonly<{
4
+ dependsOn?: readonly (readonly string[])[];
5
+ fieldConfig?: JsonObject;
6
+ fieldFqn: string;
7
+ fieldVersion: string;
8
+ optionsFrom?: "parent" | "part";
9
+ path: readonly string[];
10
+ required?: boolean;
11
+ }>;
12
+ /** A group that contains a field option, such as a folder. */
13
+ export type FieldOptionGroup = Readonly<{
14
+ id: string;
15
+ label: string;
16
+ }>;
17
+ export type FieldOption<Value extends JsonValue = JsonValue> = Readonly<{
18
+ label: string;
19
+ /** Groups that contain the option, outermost first; tree pickers nest by it. */
20
+ path?: readonly FieldOptionGroup[];
21
+ value: Value;
22
+ }>;
23
+ /** A provider-authoritative page of field options. */
24
+ export type FieldOptionPage<Value extends JsonValue = JsonValue> = Readonly<{
25
+ nextCursor?: string;
26
+ options: readonly FieldOption<Value>[];
27
+ }>;
28
+ export type FieldOptionsInput<Config extends JsonObject = JsonObject> = Readonly<{
29
+ config?: Config;
30
+ cursor?: string;
31
+ dependencies: JsonObject;
32
+ limit: number;
33
+ search?: string;
34
+ }>;
@@ -0,0 +1,7 @@
1
+ /** Admit an `https://` template whose braces are only known placeholders. */
2
+ export declare const knowledgeRemoteReferenceUrlTemplate: (value: unknown, path: string) => string;
3
+ /**
4
+ * Render a connector's declared remote reference URL template for one remote
5
+ * ID, or `null` when any placeholder has no value for that ID.
6
+ */
7
+ export declare const renderKnowledgeRemoteReferenceUrl: (urlTemplate: string, remoteId: string) => string | null;
@@ -0,0 +1,188 @@
1
+ import type { JsonObject, JsonValue } from "../foundation/json.js";
2
+ import type { PackageSchemaProjection } from "../schema/projection.js";
3
+ import type { PackagePrimitiveBase } from "./base.js";
4
+ import type { CatalogTags } from "./catalog.js";
5
+ import type { LifecycleOptions } from "./lifecycle.js";
6
+ export type LocalizedFieldText = Readonly<{
7
+ fallbackLocale: string;
8
+ values: Readonly<Record<string, string>>;
9
+ }>;
10
+ export type KnowledgeFieldSemantics = Readonly<{
11
+ defaultSearch?: boolean;
12
+ embedded?: boolean;
13
+ faceted?: boolean;
14
+ indexContent?: boolean;
15
+ indexOverview?: boolean;
16
+ indexed?: boolean;
17
+ managedProjectionSource?: "organization_team" | "organization_user";
18
+ queryGuidance?: string;
19
+ unique?: boolean;
20
+ }>;
21
+ export type KnowledgeManagedProjection = Readonly<{
22
+ connectorPolicy: "allow" | "deny_schema";
23
+ genericMutationPolicy: "deny_managed_fields" | "deny_schema";
24
+ kind: "directory_person" | "directory_person_in_team" | "directory_team" | "directory_team_parent";
25
+ source: "organization_team" | "organization_team_hierarchy" | "organization_team_membership" | "organization_user";
26
+ }>;
27
+ export type KnowledgeFieldLocalization = Readonly<{
28
+ description?: LocalizedFieldText;
29
+ help?: LocalizedFieldText;
30
+ label?: LocalizedFieldText;
31
+ placeholder?: LocalizedFieldText;
32
+ }>;
33
+ export type KnowledgeFieldPresentation = Readonly<{
34
+ copyable?: boolean;
35
+ editor?: string;
36
+ editorOptions?: Readonly<{
37
+ accepts?: readonly string[];
38
+ allowCustomValues?: boolean;
39
+ autocomplete?: string;
40
+ clearable?: boolean;
41
+ falseLabel?: string;
42
+ multiple?: boolean;
43
+ options?: readonly Readonly<{
44
+ label: string;
45
+ value: string;
46
+ }>[];
47
+ rows?: number;
48
+ searchable?: boolean;
49
+ showButtons?: boolean;
50
+ spellcheck?: boolean;
51
+ step?: number;
52
+ trueLabel?: string;
53
+ }>;
54
+ emptyLabel?: string;
55
+ falseLabel?: string;
56
+ hidden?: boolean;
57
+ layout?: Readonly<{
58
+ column?: number;
59
+ labelPlacement?: "left" | "top";
60
+ order?: number;
61
+ row?: number;
62
+ width?: number | "full";
63
+ }>;
64
+ maxLines?: number;
65
+ readOnly?: boolean;
66
+ renderer?: string;
67
+ trueLabel?: string;
68
+ }>;
69
+ export type KnowledgeDisplayDefaults = Readonly<{
70
+ collections?: readonly string[];
71
+ details?: readonly string[];
72
+ }>;
73
+ /**
74
+ * Portable relation metadata retained inside an entity schema when a gateway
75
+ * projects references as fields rather than first-class relation edges.
76
+ */
77
+ export type EntityRelationField = Readonly<{
78
+ cardinality: "many" | "one";
79
+ field: string;
80
+ id: string;
81
+ nullable: boolean;
82
+ reference: "external_id";
83
+ targetEntityId: string;
84
+ targetSchemaFqn: string;
85
+ }>;
86
+ export type KnowledgeAutocompleteFieldReference = Readonly<{
87
+ field: string;
88
+ scope: "data" | "entity";
89
+ }>;
90
+ export type KnowledgeAutocompleteConfiguration = Readonly<{
91
+ autocompleteFields: readonly KnowledgeAutocompleteFieldReference[];
92
+ defaultAutocompleteFields: readonly KnowledgeAutocompleteFieldReference[];
93
+ }>;
94
+ export type KnowledgeEntitySchemaDeclaration = PackagePrimitiveBase<"knowledgeEntitySchema"> & Readonly<{
95
+ autocompleteConfiguration: KnowledgeAutocompleteConfiguration;
96
+ catalogTags?: CatalogTags;
97
+ defaultSyncDirection?: string;
98
+ deletionMode?: string;
99
+ displayDefaults?: KnowledgeDisplayDefaults;
100
+ displayNameExpression: string | null;
101
+ domainFqn: string;
102
+ embedEntities?: boolean;
103
+ embeddingConfig: JsonObject | null;
104
+ extendsSchemaFqn?: string;
105
+ fieldLocalization?: Readonly<Record<string, KnowledgeFieldLocalization>>;
106
+ fieldPresentation?: Readonly<Record<string, KnowledgeFieldPresentation>>;
107
+ fieldSemantics?: Readonly<Record<string, KnowledgeFieldSemantics>>;
108
+ lifecycle: LifecycleOptions;
109
+ localMutationPolicy?: "always" | "connector_backed" | "never";
110
+ managedProjection?: KnowledgeManagedProjection;
111
+ maxVersionsExpirationDays?: number | null;
112
+ persistFullFieldContributions: boolean;
113
+ relationFields?: readonly EntityRelationField[];
114
+ schema: PackageSchemaProjection;
115
+ syncable?: boolean;
116
+ usableAsDocumentScope: boolean;
117
+ versioned?: boolean;
118
+ versioningEnabled: boolean | null;
119
+ }>;
120
+ export type KnowledgeRelationSchemaDeclaration = PackagePrimitiveBase<"knowledgeRelationSchema"> & Readonly<{
121
+ catalogTags?: CatalogTags;
122
+ domainFqn: string;
123
+ /** Historical manifests may omit policy; new declarations require it. */
124
+ lifecycle?: LifecycleOptions;
125
+ localMutationPolicy?: "always" | "connector_backed" | "never";
126
+ managedProjection?: KnowledgeManagedProjection;
127
+ fieldLocalization?: Readonly<Record<string, KnowledgeFieldLocalization>>;
128
+ fieldPresentation?: Readonly<Record<string, KnowledgeFieldPresentation>>;
129
+ fieldSemantics?: Readonly<Record<string, KnowledgeFieldSemantics>>;
130
+ schema: PackageSchemaProjection;
131
+ sourceSchemaFqn: string;
132
+ targetSchemaFqn: string;
133
+ }>;
134
+ export type KnowledgePolicyDeclaration = PackagePrimitiveBase<"knowledgePolicy"> & Readonly<{
135
+ effect: "allow" | "deny";
136
+ /** Domain-attached policies target the domain FQN; schema policies target a schema FQN. */
137
+ targetKind: "entity_domain" | "entity_schema" | "relation_domain" | "relation_schema";
138
+ policyBody: KnowledgePolicyBody;
139
+ policyType: "filter" | "gate";
140
+ priority?: number;
141
+ targetFqn: string;
142
+ }>;
143
+ /** Exact native Knowledge AST; no additional predicates or source-specific targets. */
144
+ export type KnowledgePolicyRef = Readonly<{
145
+ kind: "literal";
146
+ value: JsonValue;
147
+ }> | Readonly<{
148
+ kind: "subject" | "resource";
149
+ path: readonly string[];
150
+ }>;
151
+ export type KnowledgePolicyPredicate = Readonly<{
152
+ op: "eq" | "neq" | "lt" | "lte" | "gt" | "gte";
153
+ left: KnowledgePolicyRef;
154
+ right: KnowledgePolicyRef;
155
+ }> | Readonly<{
156
+ op: "in";
157
+ value: KnowledgePolicyRef;
158
+ set: KnowledgePolicyRef;
159
+ }> | Readonly<{
160
+ op: "exists" | "is_null";
161
+ ref: KnowledgePolicyRef;
162
+ }> | Readonly<{
163
+ op: "contains" | "starts_with";
164
+ ref: KnowledgePolicyRef;
165
+ value: KnowledgePolicyRef;
166
+ }> | Readonly<{
167
+ op: "const";
168
+ value: boolean;
169
+ }> | Readonly<{
170
+ op: "not";
171
+ arg: KnowledgePolicyPredicate;
172
+ }> | Readonly<{
173
+ op: "and" | "or";
174
+ args: readonly KnowledgePolicyPredicate[];
175
+ }> | Readonly<{
176
+ op: "relation_exists";
177
+ relationSchemaId: string;
178
+ direction: "out" | "in";
179
+ }> | Readonly<{
180
+ op: "relation_field";
181
+ relationSchemaId: string;
182
+ direction: "out" | "in";
183
+ inner: KnowledgePolicyPredicate;
184
+ }>;
185
+ export type KnowledgePolicyBody = Readonly<{
186
+ subjectMatch: KnowledgePolicyPredicate;
187
+ rule?: KnowledgePolicyPredicate;
188
+ }>;
@@ -0,0 +1,7 @@
1
+ import type { JsonValue } from "../foundation/json.js";
2
+ export type LifecycleDeployMode = "init_only" | "upsert";
3
+ export type LifecycleOptions = Readonly<{
4
+ deployMode: LifecycleDeployMode;
5
+ readonly: boolean;
6
+ }>;
7
+ export declare const assertLifecycleOptions: (lifecycle: JsonValue, location: string) => LifecycleOptions;