@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.
- package/README.md +1276 -2
- package/dist/components/agents.d.ts +155 -0
- package/dist/components/authoring-core.d.ts +253 -0
- package/dist/components/base.d.ts +25 -0
- package/dist/components/catalog.d.ts +21 -0
- package/dist/components/connections.d.ts +52 -0
- package/dist/components/connector-instances.d.ts +142 -0
- package/dist/components/connectors.d.ts +408 -0
- package/dist/components/dataset-parser-validation.d.ts +2 -0
- package/dist/components/dataset-parser.d.ts +74 -0
- package/dist/components/datasets.d.ts +356 -0
- package/dist/components/declaration.d.ts +12 -0
- package/dist/components/executable-authoring.d.ts +27 -0
- package/dist/components/external-app-gateway.d.ts +7 -0
- package/dist/components/external-application.d.ts +17 -0
- package/dist/components/fields.d.ts +34 -0
- package/dist/components/knowledge-remote-reference.d.ts +7 -0
- package/dist/components/knowledge.d.ts +188 -0
- package/dist/components/lifecycle.d.ts +7 -0
- package/dist/components/metadata-authoring.d.ts +66 -0
- package/dist/components/notification-channel-capabilities.d.ts +7 -0
- package/dist/components/remote-tool-collection.d.ts +3 -0
- package/dist/components/studio.d.ts +48 -0
- package/dist/components/templates.d.ts +50 -0
- package/dist/components/tools.d.ts +138 -0
- package/dist/components/workflow-editor.d.ts +28 -0
- package/dist/components/workflow-node-authoring.d.ts +4 -0
- package/dist/components/workflow-ports.d.ts +26 -0
- package/dist/components/workflow-results.d.ts +75 -0
- package/dist/components/workflow-rules.d.ts +20 -0
- package/dist/components/workflow-schema.d.ts +22 -0
- package/dist/components/workflows.d.ts +529 -0
- package/dist/foundation/json.d.ts +8 -0
- package/dist/foundation/string-order.d.ts +2 -0
- package/dist/gateway/declarations.d.ts +69 -0
- package/dist/gateway/operation-contract.d.ts +29 -0
- package/dist/hosted/contributions.d.ts +52 -0
- package/dist/index.d.ts +69 -0
- package/dist/index.js +1 -0
- package/dist/package/canonical.d.ts +9 -0
- package/dist/package/connector-readers.d.ts +171 -0
- package/dist/package/definition.d.ts +31 -0
- package/dist/package/dependencies.d.ts +10 -0
- package/dist/package/instance-readers.d.ts +4 -0
- package/dist/package/knowledge-readers.d.ts +137 -0
- package/dist/package/manifest.d.ts +42 -0
- package/dist/package/parse-manifest.d.ts +3 -0
- package/dist/package/policy-readers.d.ts +17 -0
- package/dist/package/presentation-readers.d.ts +61 -0
- package/dist/package/primitive-readers.d.ts +678 -0
- package/dist/package/readers.d.ts +230 -0
- package/dist/package/template-readers.d.ts +37 -0
- package/dist/package/workflow-readers.d.ts +167 -0
- package/dist/release/archive.d.ts +11 -0
- package/dist/release/manifest.d.ts +66 -0
- package/dist/release/paths.d.ts +5 -0
- package/dist/release/stored-manifest.d.ts +13 -0
- package/dist/schema/forms.d.ts +117 -0
- package/dist/schema/knowledge-record.d.ts +16 -0
- package/dist/schema/normalization.d.ts +7 -0
- package/dist/schema/profiles.d.ts +45 -0
- package/dist/schema/projection.d.ts +59 -0
- package/dist/schema/source.d.ts +65 -0
- package/package.json +46 -4
|
@@ -0,0 +1,529 @@
|
|
|
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 { LocalizedFieldText } from "./knowledge.js";
|
|
6
|
+
import type { LifecycleOptions } from "./lifecycle.js";
|
|
7
|
+
export type WorkflowNodeDeclaration = PackagePrimitiveBase<"workflowNode"> & Readonly<{
|
|
8
|
+
nodeKind: "action" | "input" | "output" | "trigger";
|
|
9
|
+
presentation?: Readonly<{
|
|
10
|
+
categoryPath?: readonly string[];
|
|
11
|
+
tags?: readonly string[];
|
|
12
|
+
}>;
|
|
13
|
+
/**
|
|
14
|
+
* Portable authoring metadata for the workflow editor. The JSON envelope
|
|
15
|
+
* remains manifest-safe, while these named fields prevent consumers from
|
|
16
|
+
* treating a node declaration as an unowned bag of values.
|
|
17
|
+
*/
|
|
18
|
+
contract: WorkflowNodeContract;
|
|
19
|
+
}>;
|
|
20
|
+
export type WorkflowFieldBindingDeclaration = Readonly<{
|
|
21
|
+
path: readonly (number | string)[];
|
|
22
|
+
target: "input_binding" | "parameter";
|
|
23
|
+
}>;
|
|
24
|
+
/** Editor widgets a host renders for one workflow editor field. */
|
|
25
|
+
export declare const WorkflowEditorWidgets: readonly ["checkbox", "code", "condition_builder", "credential_selector", "key_value", "list", "mapping_builder", "multi_select", "number", "resource_selector", "schedule_builder", "schema_builder", "select", "text", "textarea"];
|
|
26
|
+
export type WorkflowEditorWidget = (typeof WorkflowEditorWidgets)[number];
|
|
27
|
+
export type WorkflowEditorValueSource = "expression" | "fixed" | "literal" | "mapping" | "model" | "system";
|
|
28
|
+
export type WorkflowEditorOption = Readonly<{
|
|
29
|
+
label: LocalizedFieldText;
|
|
30
|
+
value: JsonValue;
|
|
31
|
+
}>;
|
|
32
|
+
export type WorkflowEditorOptionSource = Readonly<{
|
|
33
|
+
kind: "static";
|
|
34
|
+
options: readonly WorkflowEditorOption[];
|
|
35
|
+
}> | Readonly<{
|
|
36
|
+
clearOnDependencyChange: boolean;
|
|
37
|
+
dependsOn: readonly WorkflowFieldBindingDeclaration[];
|
|
38
|
+
kind: "remote";
|
|
39
|
+
operationId: string;
|
|
40
|
+
searchable: boolean;
|
|
41
|
+
}>;
|
|
42
|
+
export type WorkflowEditorVisibilityRule = Readonly<{
|
|
43
|
+
binding: WorkflowFieldBindingDeclaration;
|
|
44
|
+
operator: "equals" | "in" | "is_not_set" | "is_set" | "not_equals";
|
|
45
|
+
value?: JsonValue;
|
|
46
|
+
}>;
|
|
47
|
+
export type WorkflowEditorFieldDeclaration = Readonly<{
|
|
48
|
+
binding: WorkflowFieldBindingDeclaration;
|
|
49
|
+
fieldConfig?: JsonObject;
|
|
50
|
+
fieldFqn?: string;
|
|
51
|
+
fieldVersion?: string;
|
|
52
|
+
help?: LocalizedFieldText;
|
|
53
|
+
label?: LocalizedFieldText;
|
|
54
|
+
optionSource?: WorkflowEditorOptionSource;
|
|
55
|
+
order?: number;
|
|
56
|
+
placeholder?: LocalizedFieldText;
|
|
57
|
+
readOnly?: boolean;
|
|
58
|
+
required?: boolean;
|
|
59
|
+
resolutionPhase: "runtime" | "structural";
|
|
60
|
+
sensitive?: boolean;
|
|
61
|
+
valueSources: readonly WorkflowEditorValueSource[];
|
|
62
|
+
visibleWhen?: readonly WorkflowEditorVisibilityRule[];
|
|
63
|
+
widget?: WorkflowEditorWidget;
|
|
64
|
+
}>;
|
|
65
|
+
export type WorkflowEditorSectionDeclaration = Readonly<{
|
|
66
|
+
fields?: readonly WorkflowEditorFieldDeclaration[];
|
|
67
|
+
id?: string;
|
|
68
|
+
order?: number;
|
|
69
|
+
title?: string;
|
|
70
|
+
}>;
|
|
71
|
+
export type WorkflowEditorDeclaration = Readonly<{
|
|
72
|
+
form?: Readonly<{
|
|
73
|
+
sections?: readonly WorkflowEditorSectionDeclaration[];
|
|
74
|
+
}>;
|
|
75
|
+
}>;
|
|
76
|
+
/**
|
|
77
|
+
* Authoring overrides for one derived editor field, keyed by its binding.
|
|
78
|
+
* Every omitted attribute keeps the value derived from the node schemas.
|
|
79
|
+
*/
|
|
80
|
+
export type WorkflowEditorFieldOverride = Readonly<{
|
|
81
|
+
binding: WorkflowFieldBindingDeclaration;
|
|
82
|
+
}> & Partial<Omit<WorkflowEditorFieldDeclaration, "binding">>;
|
|
83
|
+
/** Places overridden fields in a section; `parameters` is the default one. */
|
|
84
|
+
export type WorkflowEditorSectionOverride = Readonly<{
|
|
85
|
+
fields?: readonly WorkflowEditorFieldOverride[];
|
|
86
|
+
id: string;
|
|
87
|
+
order?: number;
|
|
88
|
+
title?: string;
|
|
89
|
+
}>;
|
|
90
|
+
export type WorkflowEditorOverrides = Readonly<{
|
|
91
|
+
sections?: readonly WorkflowEditorSectionOverride[];
|
|
92
|
+
}>;
|
|
93
|
+
/** Template kinds a port may accept connections from or deliver to. */
|
|
94
|
+
export declare const WorkflowTemplateKinds: readonly ["action_node", "input_node", "output_node", "trigger_node"];
|
|
95
|
+
export type WorkflowTemplateKind = (typeof WorkflowTemplateKinds)[number];
|
|
96
|
+
export type WorkflowPortSchemaInjection = Readonly<{
|
|
97
|
+
configPath: readonly (number | string)[];
|
|
98
|
+
schemaPath: readonly (number | string)[];
|
|
99
|
+
}>;
|
|
100
|
+
/** Chooses a port value schema from fixed structural node configuration. */
|
|
101
|
+
export type WorkflowPortSchemaResolution<Schema = PackageSchemaProjection> = Readonly<{
|
|
102
|
+
configPath: readonly (number | string)[];
|
|
103
|
+
variants: readonly Readonly<{
|
|
104
|
+
schema: Schema;
|
|
105
|
+
schemaInjections?: readonly WorkflowPortSchemaInjection[];
|
|
106
|
+
when: JsonValue;
|
|
107
|
+
}>[];
|
|
108
|
+
}>;
|
|
109
|
+
export type WorkflowNodePortDeclaration = Readonly<{
|
|
110
|
+
allowedTemplateFqns?: readonly string[];
|
|
111
|
+
allowedTemplateKinds?: readonly WorkflowTemplateKind[];
|
|
112
|
+
direction: "input" | "output";
|
|
113
|
+
key: string;
|
|
114
|
+
/** Absent means one connection; null means unbounded. */
|
|
115
|
+
maxConnections?: number | null;
|
|
116
|
+
minConnections?: number;
|
|
117
|
+
schemaResolution?: WorkflowPortSchemaResolution;
|
|
118
|
+
valueSchema: PackageSchemaProjection;
|
|
119
|
+
}>;
|
|
120
|
+
/**
|
|
121
|
+
* Ports derived from a configured list: one per item at `configPath`, keyed
|
|
122
|
+
* by the item's `idPath`. `defaultIdPath` names a configuration value that
|
|
123
|
+
* adds one more port with the same rules, its id falling back to that
|
|
124
|
+
* value's schema default when unset.
|
|
125
|
+
*/
|
|
126
|
+
export type WorkflowDynamicPortDeclaration = Readonly<{
|
|
127
|
+
configPath: string;
|
|
128
|
+
defaultIdPath?: string;
|
|
129
|
+
idPath: string;
|
|
130
|
+
requiredPath?: string;
|
|
131
|
+
schemaPath?: string;
|
|
132
|
+
}>;
|
|
133
|
+
export type WorkflowNodeInstancePolicy = Readonly<{
|
|
134
|
+
maxInstances?: number;
|
|
135
|
+
minInstances?: number;
|
|
136
|
+
onWorkflowCreate?: boolean;
|
|
137
|
+
}>;
|
|
138
|
+
/** Copies a value from trigger configuration into an event selector. */
|
|
139
|
+
export type WorkflowEventSelectorProjection = Readonly<{
|
|
140
|
+
sourcePath: readonly (number | string)[];
|
|
141
|
+
targetPath: readonly (number | string)[];
|
|
142
|
+
required?: boolean;
|
|
143
|
+
}> | Readonly<{
|
|
144
|
+
targetPath: readonly (number | string)[];
|
|
145
|
+
value: JsonValue;
|
|
146
|
+
}>;
|
|
147
|
+
/** Portable instructions for binding an event trigger to a listener. */
|
|
148
|
+
export type WorkflowEventIngressDeclaration = Readonly<{
|
|
149
|
+
acquisitionMode: string;
|
|
150
|
+
/** Authored path copied into the host's callback admission index. */
|
|
151
|
+
callbackPathPath?: readonly (number | string)[];
|
|
152
|
+
connectionIdPath?: readonly (number | string)[];
|
|
153
|
+
eventKind: string;
|
|
154
|
+
listener: Readonly<{
|
|
155
|
+
fqn: string;
|
|
156
|
+
version: string;
|
|
157
|
+
}>;
|
|
158
|
+
requiredConfigPaths?: readonly (readonly (number | string)[])[];
|
|
159
|
+
requiredListener?: boolean;
|
|
160
|
+
selector: readonly WorkflowEventSelectorProjection[];
|
|
161
|
+
}>;
|
|
162
|
+
/**
|
|
163
|
+
* Host-implemented publication lifecycles a manual trigger may select through
|
|
164
|
+
* `lifecycleAdapterId`. Values are persisted identities; never rename them.
|
|
165
|
+
*/
|
|
166
|
+
export declare const WorkflowTriggerLifecycleAdapterIds: Readonly<{
|
|
167
|
+
readonly externalApplication: "builtin.core.workflows.lifecycle.external-application";
|
|
168
|
+
readonly mcpOperation: "builtin.core.workflows.lifecycle.mcp-operation";
|
|
169
|
+
}>;
|
|
170
|
+
/** A trigger's activation category, independent of its package identity. */
|
|
171
|
+
export type WorkflowTriggerActivationDeclaration = Readonly<{
|
|
172
|
+
eventIngress: WorkflowEventIngressDeclaration;
|
|
173
|
+
kind: "event";
|
|
174
|
+
}> | Readonly<{
|
|
175
|
+
invocationRole?: "application" | "user";
|
|
176
|
+
kind: "manual";
|
|
177
|
+
lifecycleAdapterId?: string;
|
|
178
|
+
triggerRefPath?: readonly (number | string)[];
|
|
179
|
+
}> | Readonly<{
|
|
180
|
+
kind: "schedule";
|
|
181
|
+
}>;
|
|
182
|
+
/** Authored node paths used to persist a reusable Workflow dependency. */
|
|
183
|
+
export type WorkflowReusableDependencyDeclaration = Readonly<{
|
|
184
|
+
inputContractPath: readonly (number | string)[];
|
|
185
|
+
modePath?: readonly (number | string)[];
|
|
186
|
+
targetWorkflowIdPath: readonly (number | string)[];
|
|
187
|
+
}>;
|
|
188
|
+
export type WorkflowNodeExecutionContract = Readonly<{
|
|
189
|
+
itemModes?: readonly ("all_items" | "each_item" | "single")[];
|
|
190
|
+
mainOutputPort?: string;
|
|
191
|
+
resumable?: boolean;
|
|
192
|
+
sideEffect: "external" | "none" | "read" | "write";
|
|
193
|
+
testable?: boolean;
|
|
194
|
+
}>;
|
|
195
|
+
/** A value a trigger hands back to its caller, e.g. a webhook response. */
|
|
196
|
+
export type WorkflowOutputChannelDeclaration<Schema = PackageSchemaProjection> = Readonly<{
|
|
197
|
+
adapterId: string;
|
|
198
|
+
cardinality: "many" | "one";
|
|
199
|
+
deliveryMode: "asynchronous" | "synchronous";
|
|
200
|
+
key: string;
|
|
201
|
+
required: boolean;
|
|
202
|
+
valueSchema: Schema;
|
|
203
|
+
}>;
|
|
204
|
+
/** One named, credential-free connection selector owned by a node. */
|
|
205
|
+
export type WorkflowConnectionRequirementDeclaration = Readonly<{
|
|
206
|
+
cardinality: "many" | "one";
|
|
207
|
+
connectionTemplateFqns: readonly string[];
|
|
208
|
+
key: string;
|
|
209
|
+
required: boolean;
|
|
210
|
+
selector: Readonly<{
|
|
211
|
+
path: readonly (number | string)[];
|
|
212
|
+
target: "parameter";
|
|
213
|
+
}>;
|
|
214
|
+
}>;
|
|
215
|
+
/** JSON-only workflow contract with typed editor-bearing declaration fields. */
|
|
216
|
+
export type WorkflowNodeContract = Readonly<{
|
|
217
|
+
capabilityComposition?: Readonly<{
|
|
218
|
+
capability: string;
|
|
219
|
+
fragments: readonly string[];
|
|
220
|
+
selector: Readonly<{
|
|
221
|
+
path: readonly (number | string)[];
|
|
222
|
+
target: "parameter";
|
|
223
|
+
}>;
|
|
224
|
+
}>;
|
|
225
|
+
configSchema?: PackageSchemaProjection;
|
|
226
|
+
connectionRequirements?: readonly WorkflowConnectionRequirementDeclaration[];
|
|
227
|
+
dynamicPorts?: Readonly<{
|
|
228
|
+
input?: WorkflowDynamicPortDeclaration;
|
|
229
|
+
output?: WorkflowDynamicPortDeclaration;
|
|
230
|
+
}>;
|
|
231
|
+
editor?: WorkflowEditorDeclaration;
|
|
232
|
+
execution?: WorkflowNodeExecutionContract;
|
|
233
|
+
implementationId: string;
|
|
234
|
+
inputSchema?: PackageSchemaProjection;
|
|
235
|
+
instancePolicy?: WorkflowNodeInstancePolicy;
|
|
236
|
+
nodeCollectionFqn?: string;
|
|
237
|
+
nodeCollectionVersion?: string;
|
|
238
|
+
outputChannels?: readonly WorkflowOutputChannelDeclaration[];
|
|
239
|
+
outputSchema?: PackageSchemaProjection;
|
|
240
|
+
ports?: readonly WorkflowNodePortDeclaration[];
|
|
241
|
+
reusableDependency?: WorkflowReusableDependencyDeclaration;
|
|
242
|
+
triggerActivation?: WorkflowTriggerActivationDeclaration;
|
|
243
|
+
}>;
|
|
244
|
+
export type WorkflowFieldContract = Readonly<{
|
|
245
|
+
availableForInput?: boolean;
|
|
246
|
+
availableForOutput?: boolean;
|
|
247
|
+
clearOnDependencyChange?: boolean;
|
|
248
|
+
optionDependencies?: readonly Readonly<{
|
|
249
|
+
path: readonly (number | string)[];
|
|
250
|
+
target: "parameter" | "part" | "value";
|
|
251
|
+
}>[];
|
|
252
|
+
valueSchema?: PackageSchemaProjection;
|
|
253
|
+
}>;
|
|
254
|
+
export type WorkflowFieldDeclaration = PackagePrimitiveBase<"workflowField"> & Readonly<{
|
|
255
|
+
collectionFqn: string;
|
|
256
|
+
collectionVersion: string;
|
|
257
|
+
contract: WorkflowFieldContract;
|
|
258
|
+
presentation?: Readonly<{
|
|
259
|
+
placeholder?: string;
|
|
260
|
+
widget?: string;
|
|
261
|
+
}>;
|
|
262
|
+
}>;
|
|
263
|
+
export type WorkflowFieldCollectionDeclaration = PackagePrimitiveBase<"workflowFieldCollection"> & Readonly<{
|
|
264
|
+
contract: Readonly<{
|
|
265
|
+
weight: number;
|
|
266
|
+
}>;
|
|
267
|
+
presentation?: Readonly<{
|
|
268
|
+
categoryPath: readonly string[];
|
|
269
|
+
label: LocalizedFieldText;
|
|
270
|
+
}>;
|
|
271
|
+
}>;
|
|
272
|
+
export type WorkflowNodeCollectionDeclaration = PackagePrimitiveBase<"workflowNodeCollection"> & Readonly<{
|
|
273
|
+
contract: Readonly<{
|
|
274
|
+
collection?: Readonly<{
|
|
275
|
+
parentFqn: string;
|
|
276
|
+
parentVersion: string;
|
|
277
|
+
weight: number;
|
|
278
|
+
}>;
|
|
279
|
+
}>;
|
|
280
|
+
presentation?: Readonly<{
|
|
281
|
+
categoryPath: readonly string[];
|
|
282
|
+
}>;
|
|
283
|
+
}>;
|
|
284
|
+
export type WorkflowBindingSpan = Readonly<{
|
|
285
|
+
end: number;
|
|
286
|
+
start: number;
|
|
287
|
+
}>;
|
|
288
|
+
export type WorkflowBindingSource = Readonly<{
|
|
289
|
+
kind: "input" | "loop_index" | "loop_item" | "merge_output" | "node_output" | "port_arrival" | "run" | "scope" | "trigger";
|
|
290
|
+
mergeId?: string | null;
|
|
291
|
+
nodeId?: string | null;
|
|
292
|
+
portId?: string | null;
|
|
293
|
+
selection?: Readonly<{
|
|
294
|
+
ancestry: "nearest_dominating_ancestor";
|
|
295
|
+
iteration: "aggregate" | "previous_iteration" | "same_iteration";
|
|
296
|
+
}> | null;
|
|
297
|
+
}>;
|
|
298
|
+
export type WorkflowBindingExpression = Readonly<{
|
|
299
|
+
kind: "literal";
|
|
300
|
+
value: JsonValue;
|
|
301
|
+
}> | Readonly<{
|
|
302
|
+
kind: "ref";
|
|
303
|
+
onUnavailable: Readonly<{
|
|
304
|
+
kind: "error" | "fallback" | "null";
|
|
305
|
+
value?: WorkflowBindingExpression | null;
|
|
306
|
+
}>;
|
|
307
|
+
path: readonly (number | string)[];
|
|
308
|
+
source: WorkflowBindingSource;
|
|
309
|
+
span?: WorkflowBindingSpan | null;
|
|
310
|
+
}> | Readonly<{
|
|
311
|
+
fields: Readonly<Record<string, WorkflowBindingExpression>>;
|
|
312
|
+
kind: "object";
|
|
313
|
+
}> | Readonly<{
|
|
314
|
+
items: readonly WorkflowBindingExpression[];
|
|
315
|
+
kind: "array";
|
|
316
|
+
}> | Readonly<{
|
|
317
|
+
args: readonly WorkflowBindingExpression[];
|
|
318
|
+
kind: "operator";
|
|
319
|
+
op: string;
|
|
320
|
+
}> | Readonly<{
|
|
321
|
+
args: readonly WorkflowBindingExpression[];
|
|
322
|
+
kind: "call";
|
|
323
|
+
name: string;
|
|
324
|
+
}> | Readonly<{
|
|
325
|
+
kind: "interpolation";
|
|
326
|
+
parts: readonly WorkflowBindingExpression[];
|
|
327
|
+
span?: WorkflowBindingSpan | null;
|
|
328
|
+
}>;
|
|
329
|
+
export type WorkflowAuthoredValue = Readonly<{
|
|
330
|
+
mode: "fixed";
|
|
331
|
+
value: JsonValue;
|
|
332
|
+
}> | Readonly<{
|
|
333
|
+
compiled?: WorkflowBindingExpression | null;
|
|
334
|
+
languageVersion: 1;
|
|
335
|
+
mode: "expression";
|
|
336
|
+
source: string;
|
|
337
|
+
}>;
|
|
338
|
+
export type WorkflowNodeExecutionSettings = Readonly<{
|
|
339
|
+
dryRun?: Readonly<{
|
|
340
|
+
mode: "allow" | "block_side_effects";
|
|
341
|
+
}>;
|
|
342
|
+
idempotencyKey?: WorkflowBindingExpression | null;
|
|
343
|
+
onError?: Readonly<{
|
|
344
|
+
mode: "continue" | "fail_run";
|
|
345
|
+
}>;
|
|
346
|
+
retry?: Readonly<{
|
|
347
|
+
backoffMs?: number | null;
|
|
348
|
+
maxAttempts?: number | null;
|
|
349
|
+
mode: "disabled" | "exponential" | "fixed";
|
|
350
|
+
}>;
|
|
351
|
+
timeoutMs?: number | null;
|
|
352
|
+
}>;
|
|
353
|
+
export type WorkflowAuthoringFieldProjection = Readonly<{
|
|
354
|
+
fieldConfig?: JsonObject;
|
|
355
|
+
fieldFqn: string;
|
|
356
|
+
fieldVersion: string;
|
|
357
|
+
path: readonly string[];
|
|
358
|
+
}>;
|
|
359
|
+
export type WorkflowAuthoringInputContract = Readonly<{
|
|
360
|
+
fieldProjections?: readonly WorkflowAuthoringFieldProjection[];
|
|
361
|
+
jsonSchema: JsonObject;
|
|
362
|
+
}>;
|
|
363
|
+
export type WorkflowAuthoringOutputBinding = Readonly<{
|
|
364
|
+
key: string;
|
|
365
|
+
kind: "artifact" | "value";
|
|
366
|
+
value: WorkflowBindingExpression;
|
|
367
|
+
}>;
|
|
368
|
+
export type WorkflowAuthoringOutputContract = WorkflowAuthoringInputContract & Readonly<{
|
|
369
|
+
bindings: readonly WorkflowAuthoringOutputBinding[];
|
|
370
|
+
}>;
|
|
371
|
+
export type WorkflowAuthoringTemplateRef = Readonly<{
|
|
372
|
+
templateFqn: string;
|
|
373
|
+
templateVersion: string;
|
|
374
|
+
}>;
|
|
375
|
+
export type WorkflowAuthoringNode = WorkflowAuthoringTemplateRef & Readonly<{
|
|
376
|
+
config: Readonly<Record<string, WorkflowAuthoredValue>>;
|
|
377
|
+
extensions?: JsonObject;
|
|
378
|
+
id: string;
|
|
379
|
+
inputs: Readonly<Record<string, WorkflowAuthoredValue>>;
|
|
380
|
+
metadata: JsonObject;
|
|
381
|
+
settings: WorkflowNodeExecutionSettings;
|
|
382
|
+
uid?: string;
|
|
383
|
+
}>;
|
|
384
|
+
export type WorkflowTriggerInvocation = Readonly<{
|
|
385
|
+
mode: "attach" | "await_result" | "detach";
|
|
386
|
+
timeoutMs?: number | null;
|
|
387
|
+
}>;
|
|
388
|
+
export type WorkflowAuthoringTriggerBinding = Readonly<{
|
|
389
|
+
overridePolicy: "caller_may_override" | "locked";
|
|
390
|
+
value: WorkflowAuthoredValue;
|
|
391
|
+
}>;
|
|
392
|
+
export type WorkflowAuthoringTrigger = WorkflowAuthoringTemplateRef & Readonly<{
|
|
393
|
+
config: JsonObject;
|
|
394
|
+
id: string;
|
|
395
|
+
inputBindings: Readonly<Record<string, WorkflowAuthoringTriggerBinding>>;
|
|
396
|
+
invocation: WorkflowTriggerInvocation;
|
|
397
|
+
metadata: JsonObject;
|
|
398
|
+
settings: JsonObject;
|
|
399
|
+
}>;
|
|
400
|
+
export type WorkflowAuthoringInputEndpoint = Readonly<{
|
|
401
|
+
kind: "input_node";
|
|
402
|
+
portId: string;
|
|
403
|
+
}>;
|
|
404
|
+
export type WorkflowAuthoringActionEndpoint = Readonly<{
|
|
405
|
+
kind: "action_node";
|
|
406
|
+
nodeId: string;
|
|
407
|
+
portId: string;
|
|
408
|
+
}>;
|
|
409
|
+
export type WorkflowAuthoringTriggerEndpoint = Readonly<{
|
|
410
|
+
kind: "trigger_node";
|
|
411
|
+
portId: string;
|
|
412
|
+
triggerId: string;
|
|
413
|
+
}>;
|
|
414
|
+
export type WorkflowAuthoringOutputEndpoint = Readonly<{
|
|
415
|
+
kind: "output_node";
|
|
416
|
+
portId: string;
|
|
417
|
+
}>;
|
|
418
|
+
export type WorkflowAuthoringEdgeSource = WorkflowAuthoringActionEndpoint | WorkflowAuthoringInputEndpoint | WorkflowAuthoringTriggerEndpoint;
|
|
419
|
+
export type WorkflowAuthoringEdgeTarget = WorkflowAuthoringActionEndpoint | WorkflowAuthoringInputEndpoint | WorkflowAuthoringOutputEndpoint;
|
|
420
|
+
export type WorkflowAuthoringEdge = Readonly<{
|
|
421
|
+
id: string;
|
|
422
|
+
source: WorkflowAuthoringEdgeSource;
|
|
423
|
+
target: WorkflowAuthoringEdgeTarget;
|
|
424
|
+
}>;
|
|
425
|
+
export type WorkflowAuthoringDefinition = Readonly<{
|
|
426
|
+
edges: readonly WorkflowAuthoringEdge[];
|
|
427
|
+
inputBoundary: WorkflowAuthoringTemplateRef;
|
|
428
|
+
inputContract: WorkflowAuthoringInputContract;
|
|
429
|
+
metadata: JsonObject;
|
|
430
|
+
nodes: readonly WorkflowAuthoringNode[];
|
|
431
|
+
outputBoundary: WorkflowAuthoringTemplateRef;
|
|
432
|
+
outputContract: WorkflowAuthoringOutputContract;
|
|
433
|
+
triggers: readonly WorkflowAuthoringTrigger[];
|
|
434
|
+
version: 1;
|
|
435
|
+
}>;
|
|
436
|
+
export type WorkflowDeclaration = PackagePrimitiveBase<"workflow"> & Readonly<{
|
|
437
|
+
definition: WorkflowAuthoringDefinition;
|
|
438
|
+
lifecycle: LifecycleOptions;
|
|
439
|
+
name: string;
|
|
440
|
+
slug: string;
|
|
441
|
+
}>;
|
|
442
|
+
export type WorkflowTemplateDeclaration = PackagePrimitiveBase<"workflowTemplate"> & Readonly<{
|
|
443
|
+
catalogTags?: CatalogTags;
|
|
444
|
+
category: string;
|
|
445
|
+
definition: WorkflowTemplateGraphDefinition;
|
|
446
|
+
lifecycle: LifecycleOptions;
|
|
447
|
+
name: string;
|
|
448
|
+
requiredSkills: readonly string[];
|
|
449
|
+
requiredTools: readonly string[];
|
|
450
|
+
skillSlots: readonly string[];
|
|
451
|
+
slug: string;
|
|
452
|
+
uiLayout: WorkflowTemplateUiLayout | null;
|
|
453
|
+
}>;
|
|
454
|
+
export type WorkflowTemplateGraphSchemaContract = Readonly<{
|
|
455
|
+
bindings?: readonly Readonly<{
|
|
456
|
+
extensions: JsonObject;
|
|
457
|
+
}>[];
|
|
458
|
+
fieldProjections: readonly Readonly<{
|
|
459
|
+
source: readonly (number | string)[];
|
|
460
|
+
target: readonly (number | string)[];
|
|
461
|
+
}>[];
|
|
462
|
+
schema: PackageSchemaProjection;
|
|
463
|
+
}>;
|
|
464
|
+
export type WorkflowTemplateGraphDefinition = Readonly<{
|
|
465
|
+
edges: readonly Readonly<{
|
|
466
|
+
id: string;
|
|
467
|
+
source: string;
|
|
468
|
+
target: string;
|
|
469
|
+
extensions?: JsonObject;
|
|
470
|
+
}>[];
|
|
471
|
+
inputBoundary: Readonly<{
|
|
472
|
+
templateFqn: string;
|
|
473
|
+
templateVersion: string;
|
|
474
|
+
}>;
|
|
475
|
+
inputContract: WorkflowTemplateGraphSchemaContract;
|
|
476
|
+
metadata: Readonly<{
|
|
477
|
+
description: string | null;
|
|
478
|
+
tags: readonly string[];
|
|
479
|
+
templateSource: string | null;
|
|
480
|
+
}>;
|
|
481
|
+
nodes: readonly Readonly<{
|
|
482
|
+
id: string;
|
|
483
|
+
templateFqn: string;
|
|
484
|
+
templateVersion: string;
|
|
485
|
+
extensions?: JsonObject;
|
|
486
|
+
}>[];
|
|
487
|
+
outputBoundary: Readonly<{
|
|
488
|
+
templateFqn: string;
|
|
489
|
+
templateVersion: string;
|
|
490
|
+
}>;
|
|
491
|
+
outputContract: WorkflowTemplateGraphSchemaContract;
|
|
492
|
+
triggers: readonly Readonly<{
|
|
493
|
+
config: Readonly<{
|
|
494
|
+
extensions?: JsonObject;
|
|
495
|
+
}>;
|
|
496
|
+
id: string;
|
|
497
|
+
inputBindings: Readonly<Record<string, string>>;
|
|
498
|
+
invocation: Readonly<{
|
|
499
|
+
mode: "attach" | "detach";
|
|
500
|
+
timeoutMs: number | null;
|
|
501
|
+
}>;
|
|
502
|
+
metadata: Readonly<{
|
|
503
|
+
fieldDisplayValues: Readonly<Record<string, string>>;
|
|
504
|
+
}>;
|
|
505
|
+
settings: Readonly<{
|
|
506
|
+
enabled: boolean;
|
|
507
|
+
}>;
|
|
508
|
+
templateFqn: string;
|
|
509
|
+
templateVersion: string;
|
|
510
|
+
}>[];
|
|
511
|
+
version: 1;
|
|
512
|
+
}>;
|
|
513
|
+
export type WorkflowTemplateUiLayout = Readonly<{
|
|
514
|
+
edges: Readonly<Record<string, Readonly<{
|
|
515
|
+
extensions?: JsonObject;
|
|
516
|
+
}>>>;
|
|
517
|
+
nodes: Readonly<Record<string, Readonly<{
|
|
518
|
+
position?: Readonly<{
|
|
519
|
+
x: number;
|
|
520
|
+
y: number;
|
|
521
|
+
}>;
|
|
522
|
+
}>>>;
|
|
523
|
+
version: 1;
|
|
524
|
+
viewport: Readonly<{
|
|
525
|
+
x: number;
|
|
526
|
+
y: number;
|
|
527
|
+
zoom: number;
|
|
528
|
+
}> | null;
|
|
529
|
+
}>;
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
export type JsonPrimitive = boolean | null | number | string;
|
|
2
|
+
export type JsonValue = JsonObject | JsonPrimitive | readonly JsonValue[];
|
|
3
|
+
export interface JsonObject {
|
|
4
|
+
readonly [key: string]: JsonValue;
|
|
5
|
+
}
|
|
6
|
+
/** Produces the stable JSON representation persisted and fingerprinted by CI. */
|
|
7
|
+
export declare const canonicalJson: <Value>(value: Value, ..._typeEvidence: readonly Value[]) => string;
|
|
8
|
+
export declare const parseJsonObject: (source: string) => JsonObject;
|
|
@@ -0,0 +1,69 @@
|
|
|
1
|
+
import type { PackageSchemaProjection } from "../schema/projection.js";
|
|
2
|
+
/** Closed public principal vocabulary accepted by a gateway operation. */
|
|
3
|
+
export type PortableOperationPrincipalKind = "detached_user" | "service_principal";
|
|
4
|
+
/** Explicit delegated-subject requirement reviewed with an operation. */
|
|
5
|
+
export type PortableOperationDelegatedSubjectPolicy = "allowed" | "forbidden" | "required";
|
|
6
|
+
/** Fully materialized authorization policy for one exposed operation. */
|
|
7
|
+
export type PortableOperationAuthorization = Readonly<{
|
|
8
|
+
delegatedSubject: PortableOperationDelegatedSubjectPolicy;
|
|
9
|
+
organization: "required";
|
|
10
|
+
principalKinds: readonly PortableOperationPrincipalKind[];
|
|
11
|
+
scopes: readonly string[];
|
|
12
|
+
}>;
|
|
13
|
+
/** Observable side-effect class reviewed before an operation becomes a tool. */
|
|
14
|
+
export type PortableOperationEffect = "external_side_effect" | "read" | "write";
|
|
15
|
+
/** The replay guarantee supplied by the operation implementation. */
|
|
16
|
+
export type PortableOperationIdempotency = "idempotent" | "requires_key" | "safe";
|
|
17
|
+
/** Explicit, bounded retry permission for callers of the operation. */
|
|
18
|
+
export type PortableOperationRetryPolicy = Readonly<{
|
|
19
|
+
mode: "never";
|
|
20
|
+
}> | Readonly<{
|
|
21
|
+
maxAttempts: number;
|
|
22
|
+
mode: "idempotent_only";
|
|
23
|
+
}>;
|
|
24
|
+
/** Execution lifecycle and maximum wall-clock duration. */
|
|
25
|
+
export type PortableOperationExecutionPolicy = Readonly<{
|
|
26
|
+
mode: "synchronous";
|
|
27
|
+
timeoutMs: number;
|
|
28
|
+
}>;
|
|
29
|
+
/** Per-invocation transport bounds. */
|
|
30
|
+
export type PortableOperationLimits = Readonly<{
|
|
31
|
+
maxRequestBytes: number;
|
|
32
|
+
maxResponseBytes: number;
|
|
33
|
+
}>;
|
|
34
|
+
/**
|
|
35
|
+
* Complete JSON-only operation contract reviewed by a host. Executable
|
|
36
|
+
* handlers remain in a server runtime sidecar and never enter this descriptor.
|
|
37
|
+
*/
|
|
38
|
+
export type PortableOperationDeclaration = Readonly<{
|
|
39
|
+
authorization: PortableOperationAuthorization;
|
|
40
|
+
description: string;
|
|
41
|
+
effects: PortableOperationEffect;
|
|
42
|
+
execution: PortableOperationExecutionPolicy;
|
|
43
|
+
id: string;
|
|
44
|
+
idempotency: PortableOperationIdempotency;
|
|
45
|
+
input: PackageSchemaProjection;
|
|
46
|
+
limits: PortableOperationLimits;
|
|
47
|
+
output: PackageSchemaProjection;
|
|
48
|
+
retry: PortableOperationRetryPolicy;
|
|
49
|
+
title: string;
|
|
50
|
+
version: string;
|
|
51
|
+
}>;
|
|
52
|
+
/** One catalog and identity namespace for an ordered operation list. */
|
|
53
|
+
export type OperationDomainDeclaration<Operation extends PortableOperationDeclaration = PortableOperationDeclaration> = Readonly<{
|
|
54
|
+
description?: string;
|
|
55
|
+
displayOrder?: number;
|
|
56
|
+
icon?: string;
|
|
57
|
+
id: string;
|
|
58
|
+
operations: readonly Operation[];
|
|
59
|
+
tags?: readonly string[];
|
|
60
|
+
title: string;
|
|
61
|
+
}>;
|
|
62
|
+
/**
|
|
63
|
+
* Smallest shared JSON-only declaration set used as input to a gateway
|
|
64
|
+
* manifest. Identity, protocol versions, policy, and hashes belong to the
|
|
65
|
+
* server gateway that consumes it.
|
|
66
|
+
*/
|
|
67
|
+
export type PortableGatewayDeclarations<Operation extends PortableOperationDeclaration = PortableOperationDeclaration> = Readonly<{
|
|
68
|
+
operationDomains: readonly OperationDomainDeclaration<Operation>[];
|
|
69
|
+
}>;
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import type { ReadValue, Fields } from "../package/readers.js";
|
|
2
|
+
import type { OperationDomainDeclaration, PortableOperationDeclaration } from "./declarations.js";
|
|
3
|
+
export type PortableOperationGatewayContract = Readonly<{
|
|
4
|
+
capabilities: Readonly<{
|
|
5
|
+
resources: false;
|
|
6
|
+
}>;
|
|
7
|
+
datasets: readonly never[];
|
|
8
|
+
id: string;
|
|
9
|
+
knowledge: readonly never[];
|
|
10
|
+
operationDomains: readonly OperationDomainDeclaration<PortableOperationDeclaration & Readonly<{
|
|
11
|
+
canonicalReference: string;
|
|
12
|
+
}>>[];
|
|
13
|
+
organizationBinding: Readonly<{
|
|
14
|
+
mode: "installed_organization";
|
|
15
|
+
}>;
|
|
16
|
+
protocolVersion: "2";
|
|
17
|
+
version: string;
|
|
18
|
+
}>;
|
|
19
|
+
export type OperationGatewayContractInput = Readonly<{
|
|
20
|
+
id: string;
|
|
21
|
+
operationDomains: readonly OperationDomainDeclaration[];
|
|
22
|
+
version: string;
|
|
23
|
+
}>;
|
|
24
|
+
/** Closed JSON contracts reject runtime callbacks, deployment data and unreviewed capabilities. */
|
|
25
|
+
export declare const closedGatewayObject: <A extends object>(fields: Fields<A>) => ReadValue<A>;
|
|
26
|
+
/** Complete deterministic handler-free structural manifest; callers derive SHA-256/revision from canonicalJson. */
|
|
27
|
+
export declare const buildOperationGatewayContract: (input: OperationGatewayContractInput) => PortableOperationGatewayContract;
|
|
28
|
+
/** Untrusted serialized admission rechecks derived references and canonical domain/operation order. */
|
|
29
|
+
export declare const readOperationGatewayContract: ReadValue<PortableOperationGatewayContract>;
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
export declare const HOSTS: readonly ["backend", "dashboard", "studio"];
|
|
2
|
+
export declare const FRONTEND_CATALOG_CONTRACT: "frontend-catalog/v1";
|
|
3
|
+
export declare const FRONTEND_CATALOG_EXPORT_NAME: "loadFrontendCatalog";
|
|
4
|
+
export type ExtensionHost = (typeof HOSTS)[number];
|
|
5
|
+
/** Where a backend contribution runs: pooled Workers or one Worker per job. */
|
|
6
|
+
export declare const BACKEND_EXECUTION_LANES: readonly ["interactive", "job"];
|
|
7
|
+
export type BackendExecutionLane = (typeof BACKEND_EXECUTION_LANES)[number];
|
|
8
|
+
export type HostedContributionSourceIdentity = Readonly<{
|
|
9
|
+
developmentSessionId: string;
|
|
10
|
+
kind: "development_session";
|
|
11
|
+
localManifestRevision: number;
|
|
12
|
+
}> | Readonly<{
|
|
13
|
+
extensionReleaseDigest: string;
|
|
14
|
+
kind: "extension_release";
|
|
15
|
+
}>;
|
|
16
|
+
/** JSON-only identity and loader metadata shared by every Extension Host. */
|
|
17
|
+
type HostedContributionManifestBase = Readonly<{
|
|
18
|
+
compatibility?: Readonly<Record<string, string>>;
|
|
19
|
+
fqn: string;
|
|
20
|
+
}>;
|
|
21
|
+
export type BackendHostedContributionManifest = HostedContributionManifestBase & Readonly<{
|
|
22
|
+
contract?: string;
|
|
23
|
+
execution?: BackendExecutionLane;
|
|
24
|
+
exportName: string;
|
|
25
|
+
host: "backend";
|
|
26
|
+
}>;
|
|
27
|
+
export type FrontendCatalogContract = typeof FRONTEND_CATALOG_CONTRACT;
|
|
28
|
+
export type FrontendCatalogExportName = typeof FRONTEND_CATALOG_EXPORT_NAME;
|
|
29
|
+
export type FrontendExtensionHost = Exclude<ExtensionHost, "backend">;
|
|
30
|
+
export type FrontendCatalogContributionManifest = HostedContributionManifestBase & Readonly<{
|
|
31
|
+
contract: FrontendCatalogContract;
|
|
32
|
+
exportName: FrontendCatalogExportName;
|
|
33
|
+
host: FrontendExtensionHost;
|
|
34
|
+
}>;
|
|
35
|
+
/** JSON-only identity and loader metadata shared by every Extension Host. */
|
|
36
|
+
export type HostedContributionManifest = BackendHostedContributionManifest | FrontendCatalogContributionManifest;
|
|
37
|
+
/** A lazy Host contribution whose loader is excluded from canonical manifests. */
|
|
38
|
+
export type HostedContributionDeclaration<Module extends object = object, Manifest extends HostedContributionManifest = HostedContributionManifest> = Readonly<{
|
|
39
|
+
load: () => PromiseLike<Module>;
|
|
40
|
+
manifest: Manifest;
|
|
41
|
+
}>;
|
|
42
|
+
export type HostedContributionInput<Module extends object> = HostedContributionManifest & Readonly<{
|
|
43
|
+
load: () => PromiseLike<Module>;
|
|
44
|
+
}>;
|
|
45
|
+
/** Declares a lazy contribution without importing a Host implementation. */
|
|
46
|
+
export declare function declareHostedContribution<Module extends object>(input: BackendHostedContributionManifest & Readonly<{
|
|
47
|
+
load: () => PromiseLike<Module>;
|
|
48
|
+
}>): HostedContributionDeclaration<Module, BackendHostedContributionManifest>;
|
|
49
|
+
export declare function declareHostedContribution<Module extends object>(input: FrontendCatalogContributionManifest & Readonly<{
|
|
50
|
+
load: () => PromiseLike<Module>;
|
|
51
|
+
}>): HostedContributionDeclaration<Module, FrontendCatalogContributionManifest>;
|
|
52
|
+
export {};
|