@collective-intelligence/extensions-sdk-frontend-react 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 +163 -2
- package/dist/dashboard.d.ts +1 -0
- package/dist/dashboard.js +0 -0
- package/dist/frontend/diagnostics.d.ts +30 -0
- package/dist/frontend/index.d.ts +27 -0
- package/dist/frontend/index.js +1 -0
- package/dist/index.d.ts +4 -0
- package/dist/index.js +1 -0
- package/dist/load-state.d.ts +42 -0
- package/dist/runtime/sort-values.d.ts +1 -0
- package/dist/runtime/type-guards.d.ts +10 -0
- package/dist/studio-declarations.d.ts +71 -0
- package/dist/studio.d.ts +4 -0
- package/dist/studio.js +1 -0
- package/dist/ui-react.d.ts +1 -0
- package/dist/ui-react.js +0 -0
- package/dist/workflow.d.ts +1 -0
- package/dist/workflow.js +1 -0
- package/dist/workflows/catalog.d.ts +39 -0
- package/dist/workflows/contracts.d.ts +358 -0
- package/dist/workflows/default-template-ui/actions/catalog-node-chart-block.d.ts +7 -0
- package/dist/workflows/default-template-ui/actions/catalog-node-details-editor.d.ts +4 -0
- package/dist/workflows/default-template-ui/actions/catalog-text.d.ts +4 -0
- package/dist/workflows/default-template-ui/actions/translations.d.ts +3 -0
- package/dist/workflows/default-template-ui/declarations.d.ts +33 -0
- package/dist/workflows/default-template-ui/renderers.d.ts +9 -0
- package/dist/workflows/default-template-ui/triggers/translations.d.ts +4 -0
- package/dist/workflows/default-template-ui/triggers/trigger-details-editor.d.ts +4 -0
- package/dist/workflows/default-template-ui/triggers/trigger-expression-environment.d.ts +4 -0
- package/dist/workflows/expression-editor/expression-editor.d.ts +15 -0
- package/dist/workflows/expression-editor/index.d.ts +3 -0
- package/dist/workflows/expression-editor/source-browser.d.ts +29 -0
- package/dist/workflows/expression-editor/syntax-help-drawer.d.ts +5 -0
- package/dist/workflows/expression-editor/translations.d.ts +8 -0
- package/dist/workflows/expressions/domain.d.ts +59 -0
- package/dist/workflows/expressions/typing.d.ts +28 -0
- package/dist/workflows/field-configuration-resolver.d.ts +5 -0
- package/dist/workflows/field-editor/expression-slots.d.ts +35 -0
- package/dist/workflows/field-editor/index.d.ts +2 -0
- package/dist/workflows/field-editor/translations.d.ts +7 -0
- package/dist/workflows/field-editor/workflow-field-frame.d.ts +53 -0
- package/dist/workflows/field-resolver.d.ts +5 -0
- package/dist/workflows/field-type-select/catalog.d.ts +22 -0
- package/dist/workflows/field-type-select/field-type-select.d.ts +18 -0
- package/dist/workflows/index.d.ts +26 -0
- package/dist/workflows/node-presentation/node-presentation.d.ts +9 -0
- package/dist/workflows/options.d.ts +28 -0
- package/dist/workflows/runtime/field-bindings.d.ts +21 -0
- package/dist/workflows/runtime/field-visibility.d.ts +7 -0
- package/dist/workflows/runtime/load-workflow-module.d.ts +4 -0
- package/dist/workflows/runtime/workflow-template-details.d.ts +4 -0
- package/dist/workflows/workflow-runtime/remote-options-select-field.d.ts +4 -0
- package/dist/workflows/workflow-runtime/translations.d.ts +5 -0
- package/dist/workflows/workflow-types.d.ts +156 -0
- package/package.json +101 -4
|
@@ -0,0 +1,358 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Dashboard-owned presentation contracts for workflow authoring.
|
|
3
|
+
*
|
|
4
|
+
* These contracts deliberately contain only JSON-compatible values. The
|
|
5
|
+
* Dashboard transport owns generated DTOs and adapts them at its boundary.
|
|
6
|
+
*/
|
|
7
|
+
import type { WorkflowEditorValueSource, WorkflowEditorVisibilityRule as DeclaredVisibilityRule, WorkflowTemplateKind } from "@collective-intelligence/extensions-sdk";
|
|
8
|
+
/**
|
|
9
|
+
* Keep the authoring model's JSON recursive type local to this package.
|
|
10
|
+
* Generated clients expose the same wire shape as a recursive index-signature
|
|
11
|
+
* alias, but referring to that alias here causes TypeScript to re-expand it
|
|
12
|
+
* through every dashboard presentation contract.
|
|
13
|
+
*/
|
|
14
|
+
export type JsonValue = null | boolean | number | string | JsonValue[] | {
|
|
15
|
+
[key: string]: JsonValue;
|
|
16
|
+
};
|
|
17
|
+
export type JsonObject = Record<string, JsonValue>;
|
|
18
|
+
export type WorkflowJsonSchema = JsonObject;
|
|
19
|
+
export interface FixedValue extends JsonObject {
|
|
20
|
+
mode: "fixed";
|
|
21
|
+
value: JsonValue;
|
|
22
|
+
}
|
|
23
|
+
export interface ExpressionValueEnvelopeInput extends JsonObject {
|
|
24
|
+
mode: "expression";
|
|
25
|
+
languageVersion: 1;
|
|
26
|
+
source: string;
|
|
27
|
+
}
|
|
28
|
+
export type WorkflowAuthoredValue = FixedValue | ExpressionValueEnvelopeInput;
|
|
29
|
+
export interface WorkflowAuthoredConditionComparison {
|
|
30
|
+
kind: "comparison";
|
|
31
|
+
left: WorkflowAuthoredValue;
|
|
32
|
+
operator: string;
|
|
33
|
+
right?: WorkflowAuthoredValue | null;
|
|
34
|
+
}
|
|
35
|
+
export interface WorkflowAuthoredConditionGroup {
|
|
36
|
+
conditions: WorkflowAuthoredCondition[];
|
|
37
|
+
kind: "group";
|
|
38
|
+
negated?: boolean;
|
|
39
|
+
operator: "and" | "or";
|
|
40
|
+
}
|
|
41
|
+
export type WorkflowAuthoredCondition = WorkflowAuthoredConditionComparison | WorkflowAuthoredConditionGroup;
|
|
42
|
+
export type WorkflowExpressionValueType = "any" | "array" | "boolean" | "datetime" | "null" | "number" | "object" | "string";
|
|
43
|
+
export interface WorkflowEditorSourceSelector {
|
|
44
|
+
kind: "same" | "previous" | "all" | "first" | "last" | "index" | "aggregate";
|
|
45
|
+
}
|
|
46
|
+
export interface WorkflowExpressionFunctionSignature {
|
|
47
|
+
name: string;
|
|
48
|
+
inputs: WorkflowExpressionValueType[];
|
|
49
|
+
result: WorkflowExpressionValueType;
|
|
50
|
+
minimumArgs: number;
|
|
51
|
+
maximumArgs: number;
|
|
52
|
+
example?: string;
|
|
53
|
+
}
|
|
54
|
+
export interface WorkflowExpressionLanguageManifest {
|
|
55
|
+
version: 1;
|
|
56
|
+
grammar: string;
|
|
57
|
+
interpolation: {
|
|
58
|
+
wholeValuePreservesType: boolean;
|
|
59
|
+
mixedTextReturns: WorkflowExpressionValueType;
|
|
60
|
+
};
|
|
61
|
+
selectors: WorkflowEditorSourceSelector[];
|
|
62
|
+
availabilityPolicies: ("required" | "nullable" | "default")[];
|
|
63
|
+
operators: string[];
|
|
64
|
+
functions: WorkflowExpressionFunctionSignature[];
|
|
65
|
+
pipes: string[];
|
|
66
|
+
ifExamples: string[];
|
|
67
|
+
comparators: WorkflowExpressionFunctionSignature[];
|
|
68
|
+
}
|
|
69
|
+
export type WorkflowEditorSourceAvailability = "guaranteed" | "conditional";
|
|
70
|
+
export interface WorkflowEditorSourceField {
|
|
71
|
+
id: string;
|
|
72
|
+
label: string;
|
|
73
|
+
path: (string | number)[];
|
|
74
|
+
schema: WorkflowJsonSchema;
|
|
75
|
+
availability: WorkflowEditorSourceAvailability;
|
|
76
|
+
children?: WorkflowEditorSourceField[];
|
|
77
|
+
}
|
|
78
|
+
export interface WorkflowEditorSource {
|
|
79
|
+
id: string;
|
|
80
|
+
kind: "workflow_input" | "node_output";
|
|
81
|
+
label: string;
|
|
82
|
+
schema: WorkflowJsonSchema;
|
|
83
|
+
availability?: WorkflowEditorSourceAvailability;
|
|
84
|
+
nodeKey?: string | null;
|
|
85
|
+
nodeId?: string | null;
|
|
86
|
+
portId?: string | null;
|
|
87
|
+
selectors?: WorkflowEditorSourceSelector[];
|
|
88
|
+
fields?: WorkflowEditorSourceField[];
|
|
89
|
+
}
|
|
90
|
+
export interface WorkflowEditorTargetCompatibility {
|
|
91
|
+
binding: {
|
|
92
|
+
target: "input_binding" | "parameter";
|
|
93
|
+
path: (string | number)[];
|
|
94
|
+
};
|
|
95
|
+
acceptsExpression: boolean;
|
|
96
|
+
targetSchema: WorkflowJsonSchema;
|
|
97
|
+
}
|
|
98
|
+
export interface WorkflowExpressionValidationDiagnostic {
|
|
99
|
+
code: string;
|
|
100
|
+
severity: "info" | "warning" | "error";
|
|
101
|
+
message: string;
|
|
102
|
+
span: {
|
|
103
|
+
start: number;
|
|
104
|
+
end: number;
|
|
105
|
+
};
|
|
106
|
+
remediation: string;
|
|
107
|
+
expectedSchema: WorkflowJsonSchema | null;
|
|
108
|
+
actualSchema: WorkflowJsonSchema | null;
|
|
109
|
+
}
|
|
110
|
+
export interface WorkflowExpressionValidationReference {
|
|
111
|
+
sourceId: string;
|
|
112
|
+
path: (string | number)[];
|
|
113
|
+
span: {
|
|
114
|
+
start: number;
|
|
115
|
+
end: number;
|
|
116
|
+
};
|
|
117
|
+
}
|
|
118
|
+
export interface WorkflowNodeEditorProjection {
|
|
119
|
+
availableSources?: WorkflowEditorSource[];
|
|
120
|
+
languageManifest: WorkflowExpressionLanguageManifest;
|
|
121
|
+
targetCompatibility?: WorkflowEditorTargetCompatibility[];
|
|
122
|
+
}
|
|
123
|
+
/** JSON-only authoring projections shared by Dashboard hosts and extensions. */
|
|
124
|
+
export interface WorkflowFieldProjection {
|
|
125
|
+
fieldConfig?: JsonObject;
|
|
126
|
+
fieldFqn: string;
|
|
127
|
+
fieldVersion: string;
|
|
128
|
+
path: string[];
|
|
129
|
+
}
|
|
130
|
+
export interface WorkflowBindingSource {
|
|
131
|
+
kind: string;
|
|
132
|
+
nodeId?: string | null;
|
|
133
|
+
portId?: string | null;
|
|
134
|
+
selection?: {
|
|
135
|
+
ancestry: string;
|
|
136
|
+
iteration: string;
|
|
137
|
+
} | null;
|
|
138
|
+
}
|
|
139
|
+
export type WorkflowBindingExpression = {
|
|
140
|
+
kind: "literal";
|
|
141
|
+
value: JsonValue;
|
|
142
|
+
} | {
|
|
143
|
+
kind: "ref";
|
|
144
|
+
onUnavailable: {
|
|
145
|
+
kind: "error" | "null" | "fallback";
|
|
146
|
+
value?: WorkflowBindingExpression | null;
|
|
147
|
+
};
|
|
148
|
+
path: (string | number)[];
|
|
149
|
+
source: WorkflowBindingSource;
|
|
150
|
+
span?: {
|
|
151
|
+
end: number;
|
|
152
|
+
start: number;
|
|
153
|
+
} | null;
|
|
154
|
+
} | {
|
|
155
|
+
fields: Record<string, WorkflowBindingExpression>;
|
|
156
|
+
kind: "object";
|
|
157
|
+
} | {
|
|
158
|
+
items: WorkflowBindingExpression[];
|
|
159
|
+
kind: "array";
|
|
160
|
+
} | {
|
|
161
|
+
args: WorkflowBindingExpression[];
|
|
162
|
+
kind: "operator";
|
|
163
|
+
op: string;
|
|
164
|
+
} | {
|
|
165
|
+
args: WorkflowBindingExpression[];
|
|
166
|
+
kind: "call";
|
|
167
|
+
name: string;
|
|
168
|
+
} | {
|
|
169
|
+
kind: "interpolation";
|
|
170
|
+
parts: WorkflowBindingExpression[];
|
|
171
|
+
span?: {
|
|
172
|
+
end: number;
|
|
173
|
+
start: number;
|
|
174
|
+
} | null;
|
|
175
|
+
};
|
|
176
|
+
export type WorkflowOutputBindingExpression = WorkflowBindingExpression;
|
|
177
|
+
export interface WorkflowOutputBinding {
|
|
178
|
+
key: string;
|
|
179
|
+
kind: "value" | "artifact";
|
|
180
|
+
value: WorkflowOutputBindingExpression;
|
|
181
|
+
}
|
|
182
|
+
export interface WorkflowOutputContract {
|
|
183
|
+
bindings: WorkflowOutputBinding[];
|
|
184
|
+
fieldProjections?: WorkflowFieldProjection[];
|
|
185
|
+
jsonSchema: JsonObject;
|
|
186
|
+
}
|
|
187
|
+
/** Chooses a port value schema from fixed structural node configuration. */
|
|
188
|
+
export type WorkflowPortSchemaResolution = {
|
|
189
|
+
configPath: (string | number)[];
|
|
190
|
+
variants: {
|
|
191
|
+
schema: WorkflowJsonSchema;
|
|
192
|
+
schemaInjections?: {
|
|
193
|
+
configPath: (string | number)[];
|
|
194
|
+
schemaPath: (string | number)[];
|
|
195
|
+
}[];
|
|
196
|
+
when: JsonValue;
|
|
197
|
+
}[];
|
|
198
|
+
};
|
|
199
|
+
/**
|
|
200
|
+
* One node port. Absent `maxConnections` means one connection and `null`
|
|
201
|
+
* means unbounded; absent allow-lists accept every peer template.
|
|
202
|
+
*/
|
|
203
|
+
export interface WorkflowPortContract {
|
|
204
|
+
key: string;
|
|
205
|
+
direction: "input" | "output";
|
|
206
|
+
allowedTemplateFqns?: string[] | null;
|
|
207
|
+
allowedTemplateKinds?: WorkflowTemplateKind[] | null;
|
|
208
|
+
maxConnections?: number | null;
|
|
209
|
+
minConnections?: number;
|
|
210
|
+
schemaResolution?: WorkflowPortSchemaResolution;
|
|
211
|
+
valueSchema?: WorkflowJsonSchema;
|
|
212
|
+
[key: string]: JsonValue | undefined;
|
|
213
|
+
}
|
|
214
|
+
/**
|
|
215
|
+
* Ports derived from a configured list: one per item at `configPath`, keyed
|
|
216
|
+
* by the item's `idPath`. `defaultIdPath` adds one more port whose id is that
|
|
217
|
+
* configuration value, falling back to its schema default.
|
|
218
|
+
*/
|
|
219
|
+
export interface WorkflowDynamicPortDeclaration {
|
|
220
|
+
configPath: string;
|
|
221
|
+
defaultIdPath?: string;
|
|
222
|
+
idPath: string;
|
|
223
|
+
requiredPath?: string;
|
|
224
|
+
schemaPath?: string;
|
|
225
|
+
}
|
|
226
|
+
export type WorkflowLocalizedText = {
|
|
227
|
+
kind: "literal";
|
|
228
|
+
text: string;
|
|
229
|
+
} | {
|
|
230
|
+
kind: "translation";
|
|
231
|
+
default: string;
|
|
232
|
+
};
|
|
233
|
+
export interface WorkflowFieldBinding {
|
|
234
|
+
target: "input_binding" | "parameter" | "setting" | "metadata";
|
|
235
|
+
path: (string | number)[];
|
|
236
|
+
}
|
|
237
|
+
export type WorkflowEditorOptionSource = {
|
|
238
|
+
kind: "static";
|
|
239
|
+
options: {
|
|
240
|
+
label: WorkflowLocalizedText;
|
|
241
|
+
value: JsonValue;
|
|
242
|
+
}[];
|
|
243
|
+
} | {
|
|
244
|
+
clearOnDependencyChange: boolean;
|
|
245
|
+
dependsOn: WorkflowFieldBinding[];
|
|
246
|
+
kind: "remote";
|
|
247
|
+
operationId: string;
|
|
248
|
+
searchable: boolean;
|
|
249
|
+
};
|
|
250
|
+
export interface WorkflowEditorVisibilityRule {
|
|
251
|
+
binding: WorkflowFieldBinding;
|
|
252
|
+
operator: DeclaredVisibilityRule["operator"];
|
|
253
|
+
value?: JsonValue;
|
|
254
|
+
}
|
|
255
|
+
export interface WorkflowFormField {
|
|
256
|
+
key: string;
|
|
257
|
+
binding: WorkflowFieldBinding;
|
|
258
|
+
label: WorkflowLocalizedText;
|
|
259
|
+
/**
|
|
260
|
+
* A projected SDK `WorkflowEditorWidget`. Kept open so hosted renderers
|
|
261
|
+
* built against this contract tolerate widgets added by a newer host.
|
|
262
|
+
*/
|
|
263
|
+
widget: string;
|
|
264
|
+
valueType: string;
|
|
265
|
+
fieldFqn?: string | null;
|
|
266
|
+
fieldVersion?: string | null;
|
|
267
|
+
fieldConfig?: JsonObject;
|
|
268
|
+
required?: boolean;
|
|
269
|
+
sensitive?: boolean;
|
|
270
|
+
readOnly?: boolean;
|
|
271
|
+
placeholder?: WorkflowLocalizedText | null;
|
|
272
|
+
valueSources?: WorkflowEditorValueSource[];
|
|
273
|
+
resolutionPhase?: string;
|
|
274
|
+
order?: number;
|
|
275
|
+
help?: WorkflowLocalizedText | null;
|
|
276
|
+
optionSource?: WorkflowEditorOptionSource;
|
|
277
|
+
visibleWhen?: WorkflowEditorVisibilityRule[];
|
|
278
|
+
}
|
|
279
|
+
export interface WorkflowEditorSection {
|
|
280
|
+
key: string;
|
|
281
|
+
label: JsonValue;
|
|
282
|
+
order?: number;
|
|
283
|
+
fields?: WorkflowFormField[];
|
|
284
|
+
}
|
|
285
|
+
export interface WorkflowTemplateContract {
|
|
286
|
+
kind?: string;
|
|
287
|
+
ports?: WorkflowPortContract[];
|
|
288
|
+
dynamicPorts?: {
|
|
289
|
+
input?: WorkflowDynamicPortDeclaration;
|
|
290
|
+
output?: WorkflowDynamicPortDeclaration;
|
|
291
|
+
};
|
|
292
|
+
inputSchema?: WorkflowJsonSchema;
|
|
293
|
+
outputSchema?: WorkflowJsonSchema;
|
|
294
|
+
configSchema?: WorkflowJsonSchema;
|
|
295
|
+
triggerInput?: {
|
|
296
|
+
schema: WorkflowJsonSchema;
|
|
297
|
+
languageManifest: WorkflowExpressionLanguageManifest;
|
|
298
|
+
};
|
|
299
|
+
editor?: {
|
|
300
|
+
form?: {
|
|
301
|
+
sections?: WorkflowEditorSection[];
|
|
302
|
+
};
|
|
303
|
+
};
|
|
304
|
+
field?: WorkflowFieldCatalogContract["field"];
|
|
305
|
+
collection?: WorkflowFieldCollectionCatalogContract["collection"];
|
|
306
|
+
}
|
|
307
|
+
export interface WorkflowFieldCatalogContract {
|
|
308
|
+
field: {
|
|
309
|
+
collectionFqn: string;
|
|
310
|
+
collectionVersion: string;
|
|
311
|
+
fqn: string;
|
|
312
|
+
version: string;
|
|
313
|
+
configSchema?: WorkflowJsonSchema;
|
|
314
|
+
valueSchema: WorkflowJsonSchema;
|
|
315
|
+
availableForInput?: boolean;
|
|
316
|
+
availableForOutput?: boolean;
|
|
317
|
+
packageFqn?: string;
|
|
318
|
+
defaultFor?: string[];
|
|
319
|
+
parts?: JsonValue[];
|
|
320
|
+
};
|
|
321
|
+
}
|
|
322
|
+
export interface WorkflowFieldCollectionCatalogContract {
|
|
323
|
+
collection: {
|
|
324
|
+
fqn: string;
|
|
325
|
+
version: string;
|
|
326
|
+
weight?: number;
|
|
327
|
+
packageFqn?: string;
|
|
328
|
+
};
|
|
329
|
+
}
|
|
330
|
+
export interface EffectiveWorkflowCatalogTemplate {
|
|
331
|
+
id: string;
|
|
332
|
+
kind: string;
|
|
333
|
+
fqn: string;
|
|
334
|
+
version: string;
|
|
335
|
+
packageFqn: string;
|
|
336
|
+
label: WorkflowLocalizedText;
|
|
337
|
+
description: WorkflowLocalizedText;
|
|
338
|
+
icon: string | null;
|
|
339
|
+
tags: string[];
|
|
340
|
+
aliases: string[];
|
|
341
|
+
order: number;
|
|
342
|
+
enabled: boolean;
|
|
343
|
+
state: string;
|
|
344
|
+
contract: WorkflowTemplateContract;
|
|
345
|
+
}
|
|
346
|
+
export interface EffectiveWorkflowCatalogCategory {
|
|
347
|
+
id: string;
|
|
348
|
+
key: string;
|
|
349
|
+
label: WorkflowLocalizedText;
|
|
350
|
+
description: WorkflowLocalizedText | null;
|
|
351
|
+
icon: string | null;
|
|
352
|
+
children?: EffectiveWorkflowCatalogCategory[];
|
|
353
|
+
templates?: EffectiveWorkflowCatalogTemplate[];
|
|
354
|
+
}
|
|
355
|
+
export interface EffectiveWorkflowCatalog {
|
|
356
|
+
categories: EffectiveWorkflowCatalogCategory[];
|
|
357
|
+
nodeCollections?: JsonValue[];
|
|
358
|
+
}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import type { WorkflowTemplateUiContext } from "../../workflow-types";
|
|
2
|
+
interface CatalogNodeChartBlockProps {
|
|
3
|
+
context: WorkflowTemplateUiContext;
|
|
4
|
+
accent: "sky" | "violet" | "emerald" | "slate";
|
|
5
|
+
}
|
|
6
|
+
export declare const CatalogNodeChartBlock: ({ context, accent }: CatalogNodeChartBlockProps) => import("react").JSX.Element;
|
|
7
|
+
export {};
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
export declare const defaultWorkflowTemplateDeclarations: readonly [Readonly<{
|
|
2
|
+
kind: "component";
|
|
3
|
+
target: import("@collective-intelligence/extensions-sdk-frontend").FrontendBinding;
|
|
4
|
+
implementation: Readonly<{
|
|
5
|
+
render: import("@collective-intelligence/extensions-sdk-frontend").FrontendModuleReference;
|
|
6
|
+
[role: string]: import("@collective-intelligence/extensions-sdk-frontend").FrontendModuleReference;
|
|
7
|
+
}>;
|
|
8
|
+
metadata: import("@collective-intelligence/extensions-sdk").JsonObject;
|
|
9
|
+
}>, Readonly<{
|
|
10
|
+
kind: "component";
|
|
11
|
+
target: import("@collective-intelligence/extensions-sdk-frontend").FrontendBinding;
|
|
12
|
+
implementation: Readonly<{
|
|
13
|
+
render: import("@collective-intelligence/extensions-sdk-frontend").FrontendModuleReference;
|
|
14
|
+
[role: string]: import("@collective-intelligence/extensions-sdk-frontend").FrontendModuleReference;
|
|
15
|
+
}>;
|
|
16
|
+
metadata: import("@collective-intelligence/extensions-sdk").JsonObject;
|
|
17
|
+
}>, Readonly<{
|
|
18
|
+
kind: "component";
|
|
19
|
+
target: import("@collective-intelligence/extensions-sdk-frontend").FrontendBinding;
|
|
20
|
+
implementation: Readonly<{
|
|
21
|
+
render: import("@collective-intelligence/extensions-sdk-frontend").FrontendModuleReference;
|
|
22
|
+
[role: string]: import("@collective-intelligence/extensions-sdk-frontend").FrontendModuleReference;
|
|
23
|
+
}>;
|
|
24
|
+
metadata: import("@collective-intelligence/extensions-sdk").JsonObject;
|
|
25
|
+
}>, Readonly<{
|
|
26
|
+
kind: "component";
|
|
27
|
+
target: import("@collective-intelligence/extensions-sdk-frontend").FrontendBinding;
|
|
28
|
+
implementation: Readonly<{
|
|
29
|
+
render: import("@collective-intelligence/extensions-sdk-frontend").FrontendModuleReference;
|
|
30
|
+
[role: string]: import("@collective-intelligence/extensions-sdk-frontend").FrontendModuleReference;
|
|
31
|
+
}>;
|
|
32
|
+
metadata: import("@collective-intelligence/extensions-sdk").JsonObject;
|
|
33
|
+
}>];
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import type { WorkflowTemplateUiContext } from "../workflow-types";
|
|
2
|
+
export declare const renderDefaultActionChart: (context: WorkflowTemplateUiContext) => import("react").JSX.Element;
|
|
3
|
+
export declare const renderDefaultActionDetails: (context: WorkflowTemplateUiContext) => import("react").JSX.Element;
|
|
4
|
+
export declare const renderDefaultTriggerChart: (context: WorkflowTemplateUiContext) => import("react").JSX.Element;
|
|
5
|
+
export declare const renderDefaultTriggerDetails: (context: WorkflowTemplateUiContext) => import("react").JSX.Element;
|
|
6
|
+
export declare const renderDefaultInputChart: (context: WorkflowTemplateUiContext) => import("react").JSX.Element;
|
|
7
|
+
export declare const renderDefaultInputDetails: (context: WorkflowTemplateUiContext) => import("react").JSX.Element;
|
|
8
|
+
export declare const renderDefaultOutputChart: (context: WorkflowTemplateUiContext) => import("react").JSX.Element;
|
|
9
|
+
export declare const renderDefaultOutputDetails: (context: WorkflowTemplateUiContext) => import("react").JSX.Element;
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import type { WorkflowTemplateContract } from "../../contracts";
|
|
2
|
+
import type { ExpressionEnvironment } from "../../expressions/domain";
|
|
3
|
+
/** Build the expression browser source tree for one trigger's event payload. */
|
|
4
|
+
export declare const triggerExpressionEnvironment: (contract: Pick<WorkflowTemplateContract, "triggerInput">) => ExpressionEnvironment | undefined;
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import type { WorkflowJsonSchema } from "../contracts";
|
|
2
|
+
import type { ExpressionEnvironment, ExpressionValidation } from "../expressions/domain";
|
|
3
|
+
export declare const expressionValidationErrorMessage: (cause: unknown) => string;
|
|
4
|
+
export declare const ExpressionEditor: ({ describedBy, environment, inputLabel, source, onChange, validate, multiline, readOnly, targetSchema }: {
|
|
5
|
+
describedBy?: string;
|
|
6
|
+
environment: ExpressionEnvironment;
|
|
7
|
+
inputLabel?: string;
|
|
8
|
+
source: string;
|
|
9
|
+
onChange: (source: string) => void;
|
|
10
|
+
validate?: (source: string, signal: AbortSignal) => Promise<ExpressionValidation>;
|
|
11
|
+
multiline?: boolean;
|
|
12
|
+
readOnly?: boolean;
|
|
13
|
+
/** Schema of the bound field; ranks suggestions and proposes fixing pipes. */
|
|
14
|
+
targetSchema?: WorkflowJsonSchema | undefined;
|
|
15
|
+
}) => import("react").JSX.Element;
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import type { WorkflowJsonSchema } from "../contracts";
|
|
2
|
+
import type { ExpressionEnvironment } from "../expressions/domain";
|
|
3
|
+
export interface ExpressionSourceOption {
|
|
4
|
+
id: string;
|
|
5
|
+
/** Section the option is listed under: one per upstream node output. */
|
|
6
|
+
group: Readonly<{
|
|
7
|
+
id: string;
|
|
8
|
+
label: string;
|
|
9
|
+
}>;
|
|
10
|
+
/** Full accessible label: source plus the dotted field path. */
|
|
11
|
+
label: string;
|
|
12
|
+
/** Row label: the option's own field name. */
|
|
13
|
+
name: string;
|
|
14
|
+
/** Dotted field path inside its source, e.g. `email.from.address`. */
|
|
15
|
+
pathLabel: string;
|
|
16
|
+
depth: number;
|
|
17
|
+
parentId: string | null;
|
|
18
|
+
/** Whether the option is an object with browsable nested fields. */
|
|
19
|
+
expandable: boolean;
|
|
20
|
+
/** Expression reference without delimiters, e.g. `trigger.email.subject`. */
|
|
21
|
+
reference: string;
|
|
22
|
+
insertion: string;
|
|
23
|
+
schema: WorkflowJsonSchema;
|
|
24
|
+
conditional: boolean;
|
|
25
|
+
selectors: string[];
|
|
26
|
+
}
|
|
27
|
+
export declare const expressionSourceOptions: (environment: ExpressionEnvironment) => ExpressionSourceOption[];
|
|
28
|
+
/** Human type label such as `string | null`, `object`, or `array of {address, name}`. */
|
|
29
|
+
export declare const schemaLabel: (schema: WorkflowJsonSchema) => string;
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import type { WorkflowExpressionLanguageManifest } from "../contracts";
|
|
2
|
+
/** Rendered in the assisted expression suggestion popover. */
|
|
3
|
+
export declare const ExpressionSyntaxReference: ({ manifest }: {
|
|
4
|
+
manifest: WorkflowExpressionLanguageManifest;
|
|
5
|
+
}) => import("react").JSX.Element;
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
export declare const expressionEditorTranslations: {
|
|
2
|
+
readonly applyPipes: (pipes: string) => string;
|
|
3
|
+
readonly expectedType: "Field expects";
|
|
4
|
+
readonly incompatibleType: "Incompatible type";
|
|
5
|
+
readonly insertWithPipes: "Insert with the pipes that make this value fit the field";
|
|
6
|
+
readonly validationFailed: (detail: string) => string;
|
|
7
|
+
readonly validationUnavailable: "We couldn't validate this expression right now. Check its syntax and referenced values, then try again.";
|
|
8
|
+
};
|
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
import type { ExpressionValueEnvelopeInput, FixedValue, JsonValue, WorkflowEditorSourceAvailability, WorkflowEditorSourceSelector, WorkflowEditorTargetCompatibility, WorkflowExpressionValidationDiagnostic, WorkflowExpressionValidationReference, WorkflowExpressionLanguageManifest, WorkflowJsonSchema, WorkflowNodeEditorProjection } from "../contracts";
|
|
2
|
+
export type AuthoredExpressionValue = FixedValue | ExpressionValueEnvelopeInput;
|
|
3
|
+
export type ExpressionMode = AuthoredExpressionValue["mode"];
|
|
4
|
+
export interface ExpressionDraft {
|
|
5
|
+
mode: ExpressionMode;
|
|
6
|
+
fixed: JsonValue;
|
|
7
|
+
expression: string;
|
|
8
|
+
}
|
|
9
|
+
export interface ExpressionSourceLeaf {
|
|
10
|
+
id: string;
|
|
11
|
+
sourceId: string;
|
|
12
|
+
label: string;
|
|
13
|
+
path: (string | number)[];
|
|
14
|
+
schema: WorkflowJsonSchema;
|
|
15
|
+
availability: WorkflowEditorSourceAvailability;
|
|
16
|
+
}
|
|
17
|
+
export interface ExpressionSourceBranch {
|
|
18
|
+
id: string;
|
|
19
|
+
sourceId: string;
|
|
20
|
+
label: string;
|
|
21
|
+
path: (string | number)[];
|
|
22
|
+
schema: WorkflowJsonSchema;
|
|
23
|
+
availability: WorkflowEditorSourceAvailability;
|
|
24
|
+
conditional: boolean;
|
|
25
|
+
selectors: WorkflowEditorSourceSelector["kind"][];
|
|
26
|
+
nodeKey?: string;
|
|
27
|
+
children: (ExpressionSourceBranch | ExpressionSourceLeaf)[];
|
|
28
|
+
}
|
|
29
|
+
export interface ExpressionEnvironment {
|
|
30
|
+
language: WorkflowExpressionLanguageManifest;
|
|
31
|
+
sources: ExpressionSourceBranch[];
|
|
32
|
+
compatibility: WorkflowEditorTargetCompatibility[];
|
|
33
|
+
}
|
|
34
|
+
export type ExpressionDiagnostic = Pick<WorkflowExpressionValidationDiagnostic, "code" | "severity" | "message" | "span" | "remediation"> & {
|
|
35
|
+
expectedSchema: WorkflowJsonSchema | null;
|
|
36
|
+
actualSchema: WorkflowJsonSchema | null;
|
|
37
|
+
};
|
|
38
|
+
export interface ExpressionValidation {
|
|
39
|
+
canonicalSource: string | null;
|
|
40
|
+
references: WorkflowExpressionValidationReference[];
|
|
41
|
+
diagnostics: ExpressionDiagnostic[];
|
|
42
|
+
inferredSchema: WorkflowJsonSchema;
|
|
43
|
+
}
|
|
44
|
+
export interface CursorInsertion {
|
|
45
|
+
source: string;
|
|
46
|
+
cursor: number;
|
|
47
|
+
}
|
|
48
|
+
export declare const createExpressionDraft: (value: AuthoredExpressionValue) => ExpressionDraft;
|
|
49
|
+
export declare const serializeExpressionDraft: (draft: ExpressionDraft) => AuthoredExpressionValue;
|
|
50
|
+
export declare const normalizeExpressionEnvironment: (projection: Pick<WorkflowNodeEditorProjection, "availableSources" | "languageManifest" | "targetCompatibility">) => ExpressionEnvironment;
|
|
51
|
+
export declare const normalizeExpressionValidation: (input: {
|
|
52
|
+
canonicalSource?: string | null;
|
|
53
|
+
diagnostics?: WorkflowExpressionValidationDiagnostic[];
|
|
54
|
+
inferredSchema: WorkflowJsonSchema;
|
|
55
|
+
references?: WorkflowExpressionValidationReference[];
|
|
56
|
+
}) => ExpressionValidation;
|
|
57
|
+
/** Whether a source schema can be bound to a target schema; mirrors the backend typing rules. */
|
|
58
|
+
export declare const isSchemaCompatible: (source: WorkflowJsonSchema, target: WorkflowJsonSchema) => boolean;
|
|
59
|
+
export declare const insertExpressionAtCursor: (source: string, cursor: number, insertion: string) => CursorInsertion;
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import type { WorkflowJsonSchema } from "../contracts";
|
|
2
|
+
/**
|
|
3
|
+
* Client-side mirror of the backend expression typing rules
|
|
4
|
+
* (apps/backend/src/domain/workflows/expression-typing.ts). It only ranks and
|
|
5
|
+
* labels suggestions; backend validation stays the authoritative diagnostic.
|
|
6
|
+
*/
|
|
7
|
+
type JsonType = "array" | "boolean" | "integer" | "null" | "number" | "object" | "string";
|
|
8
|
+
/** Every JSON type a value of this schema may have; `undefined` means unconstrained. */
|
|
9
|
+
export declare const schemaTypes: (schema: WorkflowJsonSchema) => ReadonlySet<JsonType> | undefined;
|
|
10
|
+
/** Item schema of every array branch. */
|
|
11
|
+
export declare const arrayItems: (schema: WorkflowJsonSchema) => WorkflowJsonSchema;
|
|
12
|
+
/** Whether every value described by `actual` satisfies the type shape of `expected`. */
|
|
13
|
+
export declare const schemaAssignable: (expected: WorkflowJsonSchema, actual: WorkflowJsonSchema) => boolean;
|
|
14
|
+
export type ExpressionCompatibility = {
|
|
15
|
+
status: "compatible" | "unknown" | "incompatible";
|
|
16
|
+
} | {
|
|
17
|
+
status: "fixable";
|
|
18
|
+
pipes: string;
|
|
19
|
+
};
|
|
20
|
+
/**
|
|
21
|
+
* Ranks a source for a target field: directly assignable, assignable after a
|
|
22
|
+
* suggested pipe chain (`| coalesce(...)` for nullable values, `| first` for
|
|
23
|
+
* arrays feeding a scalar), or incompatible.
|
|
24
|
+
*/
|
|
25
|
+
export declare const expressionCompatibility: (source: WorkflowJsonSchema, target?: WorkflowJsonSchema) => ExpressionCompatibility;
|
|
26
|
+
/** Human type label such as `string | null` or `array of {address, name}`. */
|
|
27
|
+
export declare const describeSchema: (schema: WorkflowJsonSchema) => string;
|
|
28
|
+
export {};
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
import type { JsonValue, WorkflowJsonSchema } from "../contracts";
|
|
2
|
+
import type { AuthoredExpressionValue, ExpressionEnvironment, ExpressionValidation } from "../expressions/domain";
|
|
3
|
+
interface FixedSlotControlProps {
|
|
4
|
+
describedBy?: string;
|
|
5
|
+
disabled: boolean;
|
|
6
|
+
onChange: (value: JsonValue) => void;
|
|
7
|
+
value: JsonValue;
|
|
8
|
+
}
|
|
9
|
+
export interface ExpressionSlotProps {
|
|
10
|
+
help?: string;
|
|
11
|
+
label: string;
|
|
12
|
+
onValueChange: (value: AuthoredExpressionValue) => void;
|
|
13
|
+
expressionEditor?: {
|
|
14
|
+
environment?: ExpressionEnvironment;
|
|
15
|
+
error?: string;
|
|
16
|
+
loading?: boolean;
|
|
17
|
+
validate?: (source: string, signal: AbortSignal) => Promise<ExpressionValidation>;
|
|
18
|
+
/** Bound field schema; ranks suggestions by type compatibility. */
|
|
19
|
+
targetSchema?: WorkflowJsonSchema;
|
|
20
|
+
};
|
|
21
|
+
readOnly?: boolean;
|
|
22
|
+
renderFixed: (props: FixedSlotControlProps) => React.ReactNode;
|
|
23
|
+
resetKey?: string | number;
|
|
24
|
+
slotId: string;
|
|
25
|
+
value: AuthoredExpressionValue;
|
|
26
|
+
}
|
|
27
|
+
/**
|
|
28
|
+
* The expression boundary for a value leaf inside a composite field. The
|
|
29
|
+
* owning composite keeps row identity, ordering, and structural siblings;
|
|
30
|
+
* this component only retains and commits the authored value envelope.
|
|
31
|
+
*/
|
|
32
|
+
export declare const ExpressionSlot: ({ help, label, onValueChange, expressionEditor, readOnly, renderFixed, resetKey, slotId, value }: ExpressionSlotProps) => import("react").JSX.Element;
|
|
33
|
+
/** Preserve existing authored envelopes while upgrading legacy fixed leaves. */
|
|
34
|
+
export declare const asExpressionSlotValue: (value: JsonValue) => AuthoredExpressionValue;
|
|
35
|
+
export {};
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
export declare const workflowFieldFrameTranslations: {
|
|
2
|
+
readonly expression: "Expression";
|
|
3
|
+
readonly expressionHelp: "Calculates a value from the data available when this step runs.";
|
|
4
|
+
readonly fixed: "Fixed";
|
|
5
|
+
readonly fixedHelp: "Uses the saved value as written.";
|
|
6
|
+
readonly modesHelp: "Fixed uses the saved value as written. Expression calculates a value from the data available when the step runs.";
|
|
7
|
+
};
|