@d34dman/flowdrop 0.0.56 → 0.0.58
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 +4 -4
- package/dist/adapters/WorkflowAdapter.d.ts +2 -1
- package/dist/adapters/agentspec/AgentSpecAdapter.d.ts +96 -0
- package/dist/adapters/agentspec/AgentSpecAdapter.js +663 -0
- package/dist/adapters/agentspec/agentAdapter.d.ts +59 -0
- package/dist/adapters/agentspec/agentAdapter.js +91 -0
- package/dist/adapters/agentspec/autoLayout.d.ts +34 -0
- package/dist/adapters/agentspec/autoLayout.js +127 -0
- package/dist/adapters/agentspec/componentTypeDefaults.d.ts +73 -0
- package/dist/adapters/agentspec/componentTypeDefaults.js +238 -0
- package/dist/adapters/agentspec/defaultNodeTypes.d.ts +53 -0
- package/dist/adapters/agentspec/defaultNodeTypes.js +561 -0
- package/dist/adapters/agentspec/index.d.ts +37 -0
- package/dist/adapters/agentspec/index.js +39 -0
- package/dist/adapters/agentspec/validator.d.ts +34 -0
- package/dist/adapters/agentspec/validator.js +169 -0
- package/dist/components/App.svelte +57 -13
- package/dist/components/ConfigForm.svelte +46 -12
- package/dist/components/ConfigForm.svelte.d.ts +8 -0
- package/dist/components/NodeSidebar.svelte +20 -8
- package/dist/components/NodeSidebar.svelte.d.ts +2 -1
- package/dist/components/SchemaForm.svelte +34 -12
- package/dist/components/SchemaForm.svelte.d.ts +8 -0
- package/dist/components/WorkflowEditor.svelte +14 -13
- package/dist/components/form/FormFieldset.svelte +142 -0
- package/dist/components/form/FormFieldset.svelte.d.ts +11 -0
- package/dist/components/form/FormMarkdownEditor.svelte +546 -422
- package/dist/components/form/FormMarkdownEditor.svelte.d.ts +2 -0
- package/dist/components/form/FormUISchemaRenderer.svelte +136 -0
- package/dist/components/form/FormUISchemaRenderer.svelte.d.ts +32 -0
- package/dist/components/form/index.d.ts +2 -0
- package/dist/components/form/index.js +3 -0
- package/dist/components/form/types.d.ts +1 -1
- package/dist/components/nodes/WorkflowNode.svelte +1 -2
- package/dist/config/agentSpecEndpoints.d.ts +70 -0
- package/dist/config/agentSpecEndpoints.js +65 -0
- package/dist/config/endpoints.d.ts +6 -0
- package/dist/core/index.d.ts +29 -3
- package/dist/core/index.js +31 -1
- package/dist/form/code.js +6 -1
- package/dist/form/fieldRegistry.d.ts +79 -15
- package/dist/form/fieldRegistry.js +104 -49
- package/dist/form/full.d.ts +2 -2
- package/dist/form/full.js +2 -2
- package/dist/form/index.d.ts +5 -3
- package/dist/form/index.js +9 -2
- package/dist/form/markdown.d.ts +3 -3
- package/dist/form/markdown.js +8 -4
- package/dist/helpers/workflowEditorHelper.d.ts +24 -0
- package/dist/helpers/workflowEditorHelper.js +55 -0
- package/dist/index.d.ts +2 -2
- package/dist/index.js +2 -2
- package/dist/registry/BaseRegistry.d.ts +92 -0
- package/dist/registry/BaseRegistry.js +124 -0
- package/dist/registry/builtinFormats.d.ts +23 -0
- package/dist/registry/builtinFormats.js +70 -0
- package/dist/registry/builtinNodes.js +4 -0
- package/dist/registry/index.d.ts +2 -1
- package/dist/registry/index.js +2 -0
- package/dist/registry/nodeComponentRegistry.d.ts +26 -57
- package/dist/registry/nodeComponentRegistry.js +29 -82
- package/dist/registry/workflowFormatRegistry.d.ts +122 -0
- package/dist/registry/workflowFormatRegistry.js +96 -0
- package/dist/schema/index.d.ts +23 -0
- package/dist/schema/index.js +23 -0
- package/dist/services/agentSpecExecutionService.d.ts +106 -0
- package/dist/services/agentSpecExecutionService.js +333 -0
- package/dist/stores/portCoordinateStore.js +1 -4
- package/dist/stores/workflowStore.d.ts +3 -0
- package/dist/stores/workflowStore.js +3 -0
- package/dist/svelte-app.d.ts +4 -0
- package/dist/svelte-app.js +9 -1
- package/dist/types/agentspec.d.ts +318 -0
- package/dist/types/agentspec.js +48 -0
- package/dist/types/events.d.ts +28 -1
- package/dist/types/index.d.ts +31 -0
- package/dist/types/index.js +5 -0
- package/dist/types/uischema.d.ts +144 -0
- package/dist/types/uischema.js +51 -0
- package/dist/utils/uischema.d.ts +52 -0
- package/dist/utils/uischema.js +88 -0
- package/package.json +231 -225
- package/schemas/v1/workflow.schema.json +952 -0
|
@@ -0,0 +1,318 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Open Agent Specification (Agent Spec) TypeScript Types
|
|
3
|
+
*
|
|
4
|
+
* Type definitions mirroring Oracle's Open Agent Spec format.
|
|
5
|
+
* Used for bidirectional conversion between FlowDrop and Agent Spec.
|
|
6
|
+
*
|
|
7
|
+
* @see https://github.com/oracle/agent-spec
|
|
8
|
+
* @see https://oracle.github.io/agent-spec/
|
|
9
|
+
*/
|
|
10
|
+
/** Agent Spec node component_type discriminator values */
|
|
11
|
+
export type AgentSpecNodeComponentType = 'start_node' | 'end_node' | 'llm_node' | 'api_node' | 'agent_node' | 'flow_node' | 'map_node' | 'branching_node' | 'tool_node';
|
|
12
|
+
/** Agent Spec tool component_type discriminator values */
|
|
13
|
+
export type AgentSpecToolComponentType = 'server_tool' | 'client_tool' | 'remote_tool';
|
|
14
|
+
/** All Agent Spec component_type values */
|
|
15
|
+
export type AgentSpecComponentType = 'agent' | 'flow' | AgentSpecNodeComponentType | AgentSpecToolComponentType | 'llm_config';
|
|
16
|
+
/**
|
|
17
|
+
* Agent Spec Property — JSON Schema-based input/output definition.
|
|
18
|
+
*
|
|
19
|
+
* Uses JSON Schema types and structure for describing data shape.
|
|
20
|
+
* Placeholder syntax `{{variable_name}}` generates implicit input properties.
|
|
21
|
+
*/
|
|
22
|
+
export interface AgentSpecProperty {
|
|
23
|
+
/** Property name (used as identifier in edges and templates) */
|
|
24
|
+
title: string;
|
|
25
|
+
/** JSON Schema type */
|
|
26
|
+
type: string;
|
|
27
|
+
/** Human-readable description */
|
|
28
|
+
description?: string;
|
|
29
|
+
/** Default value */
|
|
30
|
+
default?: unknown;
|
|
31
|
+
/** Allowed values (JSON Schema enum) */
|
|
32
|
+
enum?: unknown[];
|
|
33
|
+
/** Array item schema */
|
|
34
|
+
items?: AgentSpecProperty;
|
|
35
|
+
/** Object property schemas */
|
|
36
|
+
properties?: Record<string, AgentSpecProperty>;
|
|
37
|
+
/** Required properties (for object types) */
|
|
38
|
+
required?: string[];
|
|
39
|
+
/** Additional JSON Schema fields */
|
|
40
|
+
[key: string]: unknown;
|
|
41
|
+
}
|
|
42
|
+
/** Base interface for all Agent Spec nodes */
|
|
43
|
+
export interface AgentSpecNodeBase {
|
|
44
|
+
/** Discriminator for node type */
|
|
45
|
+
component_type: AgentSpecNodeComponentType;
|
|
46
|
+
/** Node name (used as identifier in edges) */
|
|
47
|
+
name: string;
|
|
48
|
+
/** Human-readable description */
|
|
49
|
+
description?: string;
|
|
50
|
+
/** Input properties */
|
|
51
|
+
inputs?: AgentSpecProperty[];
|
|
52
|
+
/** Output properties */
|
|
53
|
+
outputs?: AgentSpecProperty[];
|
|
54
|
+
/** Extension metadata (includes FlowDrop-specific data for round-trip) */
|
|
55
|
+
metadata?: Record<string, unknown>;
|
|
56
|
+
}
|
|
57
|
+
/** Graph entry point */
|
|
58
|
+
export interface AgentSpecStartNode extends AgentSpecNodeBase {
|
|
59
|
+
component_type: 'start_node';
|
|
60
|
+
}
|
|
61
|
+
/** Graph exit point */
|
|
62
|
+
export interface AgentSpecEndNode extends AgentSpecNodeBase {
|
|
63
|
+
component_type: 'end_node';
|
|
64
|
+
}
|
|
65
|
+
/** LLM text generation node */
|
|
66
|
+
export interface AgentSpecLLMNode extends AgentSpecNodeBase {
|
|
67
|
+
component_type: 'llm_node';
|
|
68
|
+
/** LLM configuration (inline or $component_ref string) */
|
|
69
|
+
llm_config?: AgentSpecLLMConfig | string;
|
|
70
|
+
/** System prompt template (supports {{variable}} syntax) */
|
|
71
|
+
system_prompt?: string;
|
|
72
|
+
/** User prompt template (supports {{variable}} syntax) */
|
|
73
|
+
prompt_template?: string;
|
|
74
|
+
/** Output JSON Schema for structured output */
|
|
75
|
+
output_schema?: Record<string, unknown>;
|
|
76
|
+
}
|
|
77
|
+
/** API call node */
|
|
78
|
+
export interface AgentSpecAPINode extends AgentSpecNodeBase {
|
|
79
|
+
component_type: 'api_node';
|
|
80
|
+
/** API endpoint URL */
|
|
81
|
+
endpoint?: string;
|
|
82
|
+
/** HTTP method */
|
|
83
|
+
method?: string;
|
|
84
|
+
/** Request headers */
|
|
85
|
+
headers?: Record<string, string>;
|
|
86
|
+
/** Request body template */
|
|
87
|
+
body?: Record<string, unknown>;
|
|
88
|
+
}
|
|
89
|
+
/** Multi-round agent conversation node */
|
|
90
|
+
export interface AgentSpecAgentNode extends AgentSpecNodeBase {
|
|
91
|
+
component_type: 'agent_node';
|
|
92
|
+
/** Agent reference ($component_ref or inline) */
|
|
93
|
+
agent?: AgentSpecAgent | string;
|
|
94
|
+
}
|
|
95
|
+
/** Nested flow execution node */
|
|
96
|
+
export interface AgentSpecFlowNode extends AgentSpecNodeBase {
|
|
97
|
+
component_type: 'flow_node';
|
|
98
|
+
/** Flow reference ($component_ref or inline) */
|
|
99
|
+
flow?: AgentSpecFlow | string;
|
|
100
|
+
}
|
|
101
|
+
/** Map-reduce operation node */
|
|
102
|
+
export interface AgentSpecMapNode extends AgentSpecNodeBase {
|
|
103
|
+
component_type: 'map_node';
|
|
104
|
+
/** Input collection property name */
|
|
105
|
+
input_collection?: string;
|
|
106
|
+
/** Output collection property name */
|
|
107
|
+
output_collection?: string;
|
|
108
|
+
/** Flow or node to execute per item ($component_ref or inline) */
|
|
109
|
+
map_flow?: AgentSpecFlow | string;
|
|
110
|
+
}
|
|
111
|
+
/** Conditional routing node */
|
|
112
|
+
export interface AgentSpecBranchingNode extends AgentSpecNodeBase {
|
|
113
|
+
component_type: 'branching_node';
|
|
114
|
+
/** Branch definitions with conditions */
|
|
115
|
+
branches: AgentSpecBranch[];
|
|
116
|
+
}
|
|
117
|
+
/** Tool execution node */
|
|
118
|
+
export interface AgentSpecToolNode extends AgentSpecNodeBase {
|
|
119
|
+
component_type: 'tool_node';
|
|
120
|
+
/** Tool reference ($component_ref or inline) */
|
|
121
|
+
tool?: AgentSpecTool | string;
|
|
122
|
+
}
|
|
123
|
+
/** Union of all Agent Spec node types */
|
|
124
|
+
export type AgentSpecNode = AgentSpecStartNode | AgentSpecEndNode | AgentSpecLLMNode | AgentSpecAPINode | AgentSpecAgentNode | AgentSpecFlowNode | AgentSpecMapNode | AgentSpecBranchingNode | AgentSpecToolNode;
|
|
125
|
+
/** Branch definition for BranchingNode */
|
|
126
|
+
export interface AgentSpecBranch {
|
|
127
|
+
/** Branch name (used as from_branch in ControlFlowEdge) */
|
|
128
|
+
name: string;
|
|
129
|
+
/** Condition expression for this branch */
|
|
130
|
+
condition?: string;
|
|
131
|
+
/** Human-readable description */
|
|
132
|
+
description?: string;
|
|
133
|
+
}
|
|
134
|
+
/**
|
|
135
|
+
* Control Flow Edge — defines execution order between nodes.
|
|
136
|
+
*
|
|
137
|
+
* Multiple control flow connections from the same branch are prohibited.
|
|
138
|
+
*/
|
|
139
|
+
export interface AgentSpecControlFlowEdge {
|
|
140
|
+
/** Edge name (identifier) */
|
|
141
|
+
name: string;
|
|
142
|
+
/** Source node name */
|
|
143
|
+
from_node: string;
|
|
144
|
+
/** Target node name */
|
|
145
|
+
to_node: string;
|
|
146
|
+
/** Source branch name (null/undefined = default "next" branch) */
|
|
147
|
+
from_branch?: string | null;
|
|
148
|
+
}
|
|
149
|
+
/**
|
|
150
|
+
* Data Flow Edge — routes data between node outputs and inputs.
|
|
151
|
+
*
|
|
152
|
+
* Maps a specific output property of a source node to a specific
|
|
153
|
+
* input property of a destination node.
|
|
154
|
+
*/
|
|
155
|
+
export interface AgentSpecDataFlowEdge {
|
|
156
|
+
/** Edge name (identifier) */
|
|
157
|
+
name: string;
|
|
158
|
+
/** Source node name */
|
|
159
|
+
source_node: string;
|
|
160
|
+
/** Source output property title */
|
|
161
|
+
source_output: string;
|
|
162
|
+
/** Destination node name */
|
|
163
|
+
destination_node: string;
|
|
164
|
+
/** Destination input property title */
|
|
165
|
+
destination_input: string;
|
|
166
|
+
}
|
|
167
|
+
/**
|
|
168
|
+
* Agent Spec Flow — a directed, potentially cyclic graph of nodes.
|
|
169
|
+
*
|
|
170
|
+
* Flows function as "subroutines" encapsulating repeatable processes.
|
|
171
|
+
* They separate control-flow (execution order) from data-flow (data routing).
|
|
172
|
+
*/
|
|
173
|
+
export interface AgentSpecFlow {
|
|
174
|
+
component_type: 'flow';
|
|
175
|
+
/** Flow name */
|
|
176
|
+
name: string;
|
|
177
|
+
/** Human-readable description */
|
|
178
|
+
description?: string;
|
|
179
|
+
/** Reference to the StartNode name */
|
|
180
|
+
start_node: string;
|
|
181
|
+
/** All nodes in the flow */
|
|
182
|
+
nodes: AgentSpecNode[];
|
|
183
|
+
/** Execution order edges */
|
|
184
|
+
control_flow_connections: AgentSpecControlFlowEdge[];
|
|
185
|
+
/**
|
|
186
|
+
* Data routing edges.
|
|
187
|
+
* When null, data flows by matching input/output property names
|
|
188
|
+
* across connected nodes (name-based variable access).
|
|
189
|
+
*/
|
|
190
|
+
data_flow_connections?: AgentSpecDataFlowEdge[] | null;
|
|
191
|
+
/** Extension metadata */
|
|
192
|
+
metadata?: Record<string, unknown>;
|
|
193
|
+
}
|
|
194
|
+
/** Base interface for Agent Spec tools */
|
|
195
|
+
export interface AgentSpecToolBase {
|
|
196
|
+
component_type: AgentSpecToolComponentType;
|
|
197
|
+
/** Tool name */
|
|
198
|
+
name: string;
|
|
199
|
+
/** Human-readable description */
|
|
200
|
+
description?: string;
|
|
201
|
+
/** Input parameters */
|
|
202
|
+
inputs?: AgentSpecProperty[];
|
|
203
|
+
/** Output parameters */
|
|
204
|
+
outputs?: AgentSpecProperty[];
|
|
205
|
+
/** Extension metadata */
|
|
206
|
+
metadata?: Record<string, unknown>;
|
|
207
|
+
}
|
|
208
|
+
/** Tool executed in the same runtime environment */
|
|
209
|
+
export interface AgentSpecServerTool extends AgentSpecToolBase {
|
|
210
|
+
component_type: 'server_tool';
|
|
211
|
+
/** Function name or module path */
|
|
212
|
+
function_name?: string;
|
|
213
|
+
}
|
|
214
|
+
/** Tool executed by the client, results returned to runtime */
|
|
215
|
+
export interface AgentSpecClientTool extends AgentSpecToolBase {
|
|
216
|
+
component_type: 'client_tool';
|
|
217
|
+
}
|
|
218
|
+
/** Tool triggered via RPC/REST calls */
|
|
219
|
+
export interface AgentSpecRemoteTool extends AgentSpecToolBase {
|
|
220
|
+
component_type: 'remote_tool';
|
|
221
|
+
/** Remote endpoint URL */
|
|
222
|
+
endpoint?: string;
|
|
223
|
+
/** HTTP method */
|
|
224
|
+
method?: string;
|
|
225
|
+
/** Request headers */
|
|
226
|
+
headers?: Record<string, string>;
|
|
227
|
+
}
|
|
228
|
+
/** Union of all Agent Spec tool types */
|
|
229
|
+
export type AgentSpecTool = AgentSpecServerTool | AgentSpecClientTool | AgentSpecRemoteTool;
|
|
230
|
+
/** LLM model configuration */
|
|
231
|
+
export interface AgentSpecLLMConfig {
|
|
232
|
+
component_type: 'llm_config';
|
|
233
|
+
/** Configuration name */
|
|
234
|
+
name: string;
|
|
235
|
+
/** Model identifier (e.g., "gpt-4o", "claude-sonnet-4-5-20250929") */
|
|
236
|
+
model_id: string;
|
|
237
|
+
/** Provider name (e.g., "openai", "anthropic") */
|
|
238
|
+
provider?: string;
|
|
239
|
+
/** API endpoint URL */
|
|
240
|
+
url?: string;
|
|
241
|
+
/** Generation parameters (temperature, max_tokens, etc.) */
|
|
242
|
+
parameters?: Record<string, unknown>;
|
|
243
|
+
/** Extension metadata */
|
|
244
|
+
metadata?: Record<string, unknown>;
|
|
245
|
+
}
|
|
246
|
+
/**
|
|
247
|
+
* Agent Spec Agent — top-level conversational AI system.
|
|
248
|
+
*
|
|
249
|
+
* Serves as the entry point and holds shared resources like
|
|
250
|
+
* tools, memory, and LLM configuration.
|
|
251
|
+
*/
|
|
252
|
+
export interface AgentSpecAgent {
|
|
253
|
+
component_type: 'agent';
|
|
254
|
+
/** Agent name */
|
|
255
|
+
name: string;
|
|
256
|
+
/** Human-readable description */
|
|
257
|
+
description?: string;
|
|
258
|
+
/** Agent inputs */
|
|
259
|
+
inputs?: AgentSpecProperty[];
|
|
260
|
+
/** Agent outputs */
|
|
261
|
+
outputs?: AgentSpecProperty[];
|
|
262
|
+
/** Available tools (inline or $component_ref strings) */
|
|
263
|
+
tools?: (AgentSpecTool | string)[];
|
|
264
|
+
/** LLM configuration (inline or $component_ref string) */
|
|
265
|
+
llm_config?: AgentSpecLLMConfig | string;
|
|
266
|
+
/** System prompt template */
|
|
267
|
+
system_prompt?: string;
|
|
268
|
+
/** Extension metadata */
|
|
269
|
+
metadata?: Record<string, unknown>;
|
|
270
|
+
}
|
|
271
|
+
/**
|
|
272
|
+
* Top-level Agent Spec document.
|
|
273
|
+
*
|
|
274
|
+
* Contains a flow and/or agent definition along with shared
|
|
275
|
+
* tool and LLM configuration declarations.
|
|
276
|
+
*/
|
|
277
|
+
export interface AgentSpecDocument {
|
|
278
|
+
/** Agent definition */
|
|
279
|
+
agent?: AgentSpecAgent;
|
|
280
|
+
/** Flow definition */
|
|
281
|
+
flow?: AgentSpecFlow;
|
|
282
|
+
/** Shared tool declarations */
|
|
283
|
+
tools?: AgentSpecTool[];
|
|
284
|
+
/** Shared LLM configurations */
|
|
285
|
+
llm_configs?: AgentSpecLLMConfig[];
|
|
286
|
+
/** Document-level metadata */
|
|
287
|
+
metadata?: Record<string, unknown>;
|
|
288
|
+
}
|
|
289
|
+
/** Prefix for component references in Agent Spec */
|
|
290
|
+
export declare const COMPONENT_REF_PREFIX = "$component_ref:";
|
|
291
|
+
/**
|
|
292
|
+
* Check if a value is a component reference string.
|
|
293
|
+
*
|
|
294
|
+
* @example
|
|
295
|
+
* ```typescript
|
|
296
|
+
* isComponentRef("$component_ref:my_tool") // true
|
|
297
|
+
* isComponentRef("just a string") // false
|
|
298
|
+
* ```
|
|
299
|
+
*/
|
|
300
|
+
export declare function isComponentRef(value: unknown): value is string;
|
|
301
|
+
/**
|
|
302
|
+
* Extract the component ID from a component reference string.
|
|
303
|
+
*
|
|
304
|
+
* @example
|
|
305
|
+
* ```typescript
|
|
306
|
+
* extractComponentRefId("$component_ref:my_tool") // "my_tool"
|
|
307
|
+
* ```
|
|
308
|
+
*/
|
|
309
|
+
export declare function extractComponentRefId(ref: string): string;
|
|
310
|
+
/**
|
|
311
|
+
* Create a component reference string.
|
|
312
|
+
*
|
|
313
|
+
* @example
|
|
314
|
+
* ```typescript
|
|
315
|
+
* createComponentRef("my_tool") // "$component_ref:my_tool"
|
|
316
|
+
* ```
|
|
317
|
+
*/
|
|
318
|
+
export declare function createComponentRef(componentId: string): string;
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Open Agent Specification (Agent Spec) TypeScript Types
|
|
3
|
+
*
|
|
4
|
+
* Type definitions mirroring Oracle's Open Agent Spec format.
|
|
5
|
+
* Used for bidirectional conversion between FlowDrop and Agent Spec.
|
|
6
|
+
*
|
|
7
|
+
* @see https://github.com/oracle/agent-spec
|
|
8
|
+
* @see https://oracle.github.io/agent-spec/
|
|
9
|
+
*/
|
|
10
|
+
// ============================================================================
|
|
11
|
+
// Component Reference
|
|
12
|
+
// ============================================================================
|
|
13
|
+
/** Prefix for component references in Agent Spec */
|
|
14
|
+
export const COMPONENT_REF_PREFIX = '$component_ref:';
|
|
15
|
+
/**
|
|
16
|
+
* Check if a value is a component reference string.
|
|
17
|
+
*
|
|
18
|
+
* @example
|
|
19
|
+
* ```typescript
|
|
20
|
+
* isComponentRef("$component_ref:my_tool") // true
|
|
21
|
+
* isComponentRef("just a string") // false
|
|
22
|
+
* ```
|
|
23
|
+
*/
|
|
24
|
+
export function isComponentRef(value) {
|
|
25
|
+
return typeof value === 'string' && value.startsWith(COMPONENT_REF_PREFIX);
|
|
26
|
+
}
|
|
27
|
+
/**
|
|
28
|
+
* Extract the component ID from a component reference string.
|
|
29
|
+
*
|
|
30
|
+
* @example
|
|
31
|
+
* ```typescript
|
|
32
|
+
* extractComponentRefId("$component_ref:my_tool") // "my_tool"
|
|
33
|
+
* ```
|
|
34
|
+
*/
|
|
35
|
+
export function extractComponentRefId(ref) {
|
|
36
|
+
return ref.slice(COMPONENT_REF_PREFIX.length);
|
|
37
|
+
}
|
|
38
|
+
/**
|
|
39
|
+
* Create a component reference string.
|
|
40
|
+
*
|
|
41
|
+
* @example
|
|
42
|
+
* ```typescript
|
|
43
|
+
* createComponentRef("my_tool") // "$component_ref:my_tool"
|
|
44
|
+
* ```
|
|
45
|
+
*/
|
|
46
|
+
export function createComponentRef(componentId) {
|
|
47
|
+
return `${COMPONENT_REF_PREFIX}${componentId}`;
|
|
48
|
+
}
|
package/dist/types/events.d.ts
CHANGED
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
*
|
|
7
7
|
* @module types/events
|
|
8
8
|
*/
|
|
9
|
-
import type { Workflow } from './index.js';
|
|
9
|
+
import type { Workflow, NodeExecutionInfo } from './index.js';
|
|
10
10
|
/**
|
|
11
11
|
* Types of workflow changes
|
|
12
12
|
*
|
|
@@ -113,6 +113,33 @@ export interface FlowDropEventHandlers {
|
|
|
113
113
|
* @returns true to suppress default error handling, false/void to show default toast
|
|
114
114
|
*/
|
|
115
115
|
onApiError?: (error: Error, operation: string) => boolean | void;
|
|
116
|
+
/**
|
|
117
|
+
* Called when an Agent Spec execution starts
|
|
118
|
+
*
|
|
119
|
+
* @param executionId - The runtime execution ID
|
|
120
|
+
*/
|
|
121
|
+
onAgentSpecExecutionStarted?: (executionId: string) => void;
|
|
122
|
+
/**
|
|
123
|
+
* Called when an Agent Spec execution completes successfully
|
|
124
|
+
*
|
|
125
|
+
* @param executionId - The runtime execution ID
|
|
126
|
+
* @param results - Execution results from the runtime
|
|
127
|
+
*/
|
|
128
|
+
onAgentSpecExecutionCompleted?: (executionId: string, results: Record<string, unknown>) => void;
|
|
129
|
+
/**
|
|
130
|
+
* Called when an Agent Spec execution fails
|
|
131
|
+
*
|
|
132
|
+
* @param executionId - The runtime execution ID
|
|
133
|
+
* @param error - The error that occurred
|
|
134
|
+
*/
|
|
135
|
+
onAgentSpecExecutionFailed?: (executionId: string, error: Error) => void;
|
|
136
|
+
/**
|
|
137
|
+
* Called when a node's execution status is updated during Agent Spec execution
|
|
138
|
+
*
|
|
139
|
+
* @param nodeId - The FlowDrop node ID
|
|
140
|
+
* @param status - Updated execution info
|
|
141
|
+
*/
|
|
142
|
+
onAgentSpecNodeStatusUpdate?: (nodeId: string, status: NodeExecutionInfo) => void;
|
|
116
143
|
}
|
|
117
144
|
/**
|
|
118
145
|
* Feature flags for FlowDrop
|
package/dist/types/index.d.ts
CHANGED
|
@@ -24,6 +24,20 @@ export type BuiltinNodeCategory = 'triggers' | 'inputs' | 'outputs' | 'prompts'
|
|
|
24
24
|
* ```
|
|
25
25
|
*/
|
|
26
26
|
export type NodeCategory = BuiltinNodeCategory | (string & Record<never, never>);
|
|
27
|
+
/**
|
|
28
|
+
* Built-in workflow format identifiers that ship with FlowDrop.
|
|
29
|
+
*/
|
|
30
|
+
export type BuiltinWorkflowFormat = 'flowdrop' | 'agentspec';
|
|
31
|
+
/**
|
|
32
|
+
* Workflow format identifier.
|
|
33
|
+
* Determines sidebar node filtering and export behavior.
|
|
34
|
+
* Includes built-in formats plus any custom string for third-party adapters.
|
|
35
|
+
*/
|
|
36
|
+
export type WorkflowFormat = BuiltinWorkflowFormat | (string & Record<never, never>);
|
|
37
|
+
/**
|
|
38
|
+
* Default workflow format used when none is specified.
|
|
39
|
+
*/
|
|
40
|
+
export declare const DEFAULT_WORKFLOW_FORMAT: WorkflowFormat;
|
|
27
41
|
/**
|
|
28
42
|
* Category definition with metadata for display and organization.
|
|
29
43
|
* Fetched from the `/categories` API endpoint or provided as defaults.
|
|
@@ -536,9 +550,22 @@ export interface NodeMetadata {
|
|
|
536
550
|
inputs: NodePort[];
|
|
537
551
|
outputs: NodePort[];
|
|
538
552
|
configSchema?: ConfigSchema;
|
|
553
|
+
/**
|
|
554
|
+
* Optional UI Schema that controls how configSchema fields are
|
|
555
|
+
* arranged, grouped, and displayed in the configuration form.
|
|
556
|
+
*
|
|
557
|
+
* When not provided, fields render in flat order (backward compatible).
|
|
558
|
+
* Uses JSON Forms-inspired format with VerticalLayout, Group, and Control elements.
|
|
559
|
+
*
|
|
560
|
+
* @see UISchemaElement for the element type definitions
|
|
561
|
+
* @see https://jsonforms.io/docs/uischema
|
|
562
|
+
*/
|
|
563
|
+
uiSchema?: import('./uischema.js').UISchemaElement;
|
|
539
564
|
/** Default configuration values for this node type */
|
|
540
565
|
config?: Record<string, unknown>;
|
|
541
566
|
tags?: string[];
|
|
567
|
+
/** Workflow formats this node is compatible with. Omit = universal (all formats). */
|
|
568
|
+
formats?: WorkflowFormat[];
|
|
542
569
|
/**
|
|
543
570
|
* Admin/Edit configuration for nodes with dynamic or external configuration.
|
|
544
571
|
* Used when the config schema cannot be determined at workflow load time
|
|
@@ -1095,6 +1122,8 @@ export interface Workflow {
|
|
|
1095
1122
|
tags?: string[];
|
|
1096
1123
|
versionId?: string;
|
|
1097
1124
|
updateNumber?: number;
|
|
1125
|
+
/** Workflow format. Determines sidebar filtering and export behavior. */
|
|
1126
|
+
format?: WorkflowFormat;
|
|
1098
1127
|
};
|
|
1099
1128
|
}
|
|
1100
1129
|
/**
|
|
@@ -1199,3 +1228,5 @@ export type { AuthProvider, StaticAuthConfig, CallbackAuthConfig } from './auth.
|
|
|
1199
1228
|
export { StaticAuthProvider, CallbackAuthProvider, NoAuthProvider } from './auth.js';
|
|
1200
1229
|
export type { FlowDropSettings, ThemeSettings, EditorSettings, UISettings, BehaviorSettings, ApiSettings, ThemePreference, ResolvedTheme, SettingsCategory, PartialSettings, SyncStatus, SettingsStoreState, SettingsChangeEvent, SettingsChangeCallback } from './settings.js';
|
|
1201
1230
|
export { DEFAULT_SETTINGS, DEFAULT_THEME_SETTINGS, DEFAULT_EDITOR_SETTINGS, DEFAULT_UI_SETTINGS, DEFAULT_BEHAVIOR_SETTINGS, DEFAULT_API_SETTINGS, SETTINGS_CATEGORIES, SETTINGS_CATEGORY_LABELS, SETTINGS_CATEGORY_ICONS, SETTINGS_STORAGE_KEY } from './settings.js';
|
|
1231
|
+
export type { UISchemaElementType, UISchemaElementBase, UISchemaControl, UISchemaVerticalLayout, UISchemaGroup, UISchemaElement } from './uischema.js';
|
|
1232
|
+
export { isUISchemaControl, isUISchemaVerticalLayout, isUISchemaGroup } from './uischema.js';
|
package/dist/types/index.js
CHANGED
|
@@ -2,6 +2,10 @@
|
|
|
2
2
|
* Core types for the Workflow Library
|
|
3
3
|
*/
|
|
4
4
|
import { ConnectionLineType } from '@xyflow/svelte';
|
|
5
|
+
/**
|
|
6
|
+
* Default workflow format used when none is specified.
|
|
7
|
+
*/
|
|
8
|
+
export const DEFAULT_WORKFLOW_FORMAT = 'flowdrop';
|
|
5
9
|
/**
|
|
6
10
|
* Convert a DynamicPort to a NodePort
|
|
7
11
|
* @param port - The dynamic port configuration
|
|
@@ -20,3 +24,4 @@ export function dynamicPortToNodePort(port, portType) {
|
|
|
20
24
|
}
|
|
21
25
|
export { StaticAuthProvider, CallbackAuthProvider, NoAuthProvider } from './auth.js';
|
|
22
26
|
export { DEFAULT_SETTINGS, DEFAULT_THEME_SETTINGS, DEFAULT_EDITOR_SETTINGS, DEFAULT_UI_SETTINGS, DEFAULT_BEHAVIOR_SETTINGS, DEFAULT_API_SETTINGS, SETTINGS_CATEGORIES, SETTINGS_CATEGORY_LABELS, SETTINGS_CATEGORY_ICONS, SETTINGS_STORAGE_KEY } from './settings.js';
|
|
27
|
+
export { isUISchemaControl, isUISchemaVerticalLayout, isUISchemaGroup } from './uischema.js';
|
|
@@ -0,0 +1,144 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* UISchema Types for FlowDrop Form Layout
|
|
3
|
+
*
|
|
4
|
+
* Inspired by JSON Forms (EclipseSource) UISchema specification.
|
|
5
|
+
* Controls how form fields are arranged, grouped, and displayed
|
|
6
|
+
* without modifying the underlying data schema (ConfigSchema).
|
|
7
|
+
*
|
|
8
|
+
* The UISchema is a separate concern from the data schema:
|
|
9
|
+
* - ConfigSchema defines what data is valid (validation)
|
|
10
|
+
* - UISchema defines how the form is rendered (presentation)
|
|
11
|
+
*
|
|
12
|
+
* @see https://jsonforms.io/docs/uischema
|
|
13
|
+
*
|
|
14
|
+
* @example
|
|
15
|
+
* ```json
|
|
16
|
+
* {
|
|
17
|
+
* "type": "VerticalLayout",
|
|
18
|
+
* "elements": [
|
|
19
|
+
* { "type": "Control", "scope": "#/properties/model" },
|
|
20
|
+
* {
|
|
21
|
+
* "type": "Group",
|
|
22
|
+
* "label": "Advanced Settings",
|
|
23
|
+
* "collapsible": true,
|
|
24
|
+
* "defaultOpen": false,
|
|
25
|
+
* "elements": [
|
|
26
|
+
* { "type": "Control", "scope": "#/properties/temperature" },
|
|
27
|
+
* { "type": "Control", "scope": "#/properties/maxTokens" }
|
|
28
|
+
* ]
|
|
29
|
+
* }
|
|
30
|
+
* ]
|
|
31
|
+
* }
|
|
32
|
+
* ```
|
|
33
|
+
*/
|
|
34
|
+
/**
|
|
35
|
+
* Supported UISchema element types.
|
|
36
|
+
* Designed for future extension with HorizontalLayout, Categorization, etc.
|
|
37
|
+
*/
|
|
38
|
+
export type UISchemaElementType = 'VerticalLayout' | 'Group' | 'Control';
|
|
39
|
+
/**
|
|
40
|
+
* Base interface for all UISchema elements.
|
|
41
|
+
*/
|
|
42
|
+
export interface UISchemaElementBase {
|
|
43
|
+
/** Discriminator for the element type */
|
|
44
|
+
type: UISchemaElementType;
|
|
45
|
+
}
|
|
46
|
+
/**
|
|
47
|
+
* Control element - references a single field in the data schema.
|
|
48
|
+
* Uses JSON Pointer syntax for the scope path.
|
|
49
|
+
*
|
|
50
|
+
* @example
|
|
51
|
+
* ```json
|
|
52
|
+
* { "type": "Control", "scope": "#/properties/temperature" }
|
|
53
|
+
* ```
|
|
54
|
+
*/
|
|
55
|
+
export interface UISchemaControl extends UISchemaElementBase {
|
|
56
|
+
type: 'Control';
|
|
57
|
+
/**
|
|
58
|
+
* JSON Pointer to the property in the data schema.
|
|
59
|
+
* Must follow the format: #/properties/<fieldName>
|
|
60
|
+
*/
|
|
61
|
+
scope: string;
|
|
62
|
+
/**
|
|
63
|
+
* Optional label override. If not provided, the field's
|
|
64
|
+
* schema title or key is used.
|
|
65
|
+
*/
|
|
66
|
+
label?: string;
|
|
67
|
+
}
|
|
68
|
+
/**
|
|
69
|
+
* Layout container that arranges its child elements vertically.
|
|
70
|
+
* Can be used as root element or nested inside groups.
|
|
71
|
+
*
|
|
72
|
+
* @example
|
|
73
|
+
* ```json
|
|
74
|
+
* {
|
|
75
|
+
* "type": "VerticalLayout",
|
|
76
|
+
* "elements": [
|
|
77
|
+
* { "type": "Control", "scope": "#/properties/name" },
|
|
78
|
+
* { "type": "Control", "scope": "#/properties/email" }
|
|
79
|
+
* ]
|
|
80
|
+
* }
|
|
81
|
+
* ```
|
|
82
|
+
*/
|
|
83
|
+
export interface UISchemaVerticalLayout extends UISchemaElementBase {
|
|
84
|
+
type: 'VerticalLayout';
|
|
85
|
+
/** Child elements to render vertically */
|
|
86
|
+
elements: UISchemaElement[];
|
|
87
|
+
}
|
|
88
|
+
/**
|
|
89
|
+
* Group element - renders a fieldset with a label and optional collapsible behavior.
|
|
90
|
+
* Extends the JSON Forms Group with FlowDrop-specific collapse options.
|
|
91
|
+
*
|
|
92
|
+
* @example
|
|
93
|
+
* ```json
|
|
94
|
+
* {
|
|
95
|
+
* "type": "Group",
|
|
96
|
+
* "label": "Advanced Settings",
|
|
97
|
+
* "description": "Fine-tuning parameters",
|
|
98
|
+
* "collapsible": true,
|
|
99
|
+
* "defaultOpen": false,
|
|
100
|
+
* "elements": [
|
|
101
|
+
* { "type": "Control", "scope": "#/properties/temperature" },
|
|
102
|
+
* { "type": "Control", "scope": "#/properties/maxTokens" }
|
|
103
|
+
* ]
|
|
104
|
+
* }
|
|
105
|
+
* ```
|
|
106
|
+
*/
|
|
107
|
+
export interface UISchemaGroup extends UISchemaElementBase {
|
|
108
|
+
type: 'Group';
|
|
109
|
+
/** Display label for the fieldset legend / summary */
|
|
110
|
+
label: string;
|
|
111
|
+
/** Child elements within the group */
|
|
112
|
+
elements: UISchemaElement[];
|
|
113
|
+
/** Optional description displayed below the label */
|
|
114
|
+
description?: string;
|
|
115
|
+
/**
|
|
116
|
+
* Whether the group can be collapsed.
|
|
117
|
+
* When true, renders as `<details>/<summary>`.
|
|
118
|
+
* @default true
|
|
119
|
+
*/
|
|
120
|
+
collapsible?: boolean;
|
|
121
|
+
/**
|
|
122
|
+
* Whether the group is initially open (expanded).
|
|
123
|
+
* Only relevant when collapsible is true.
|
|
124
|
+
* @default true
|
|
125
|
+
*/
|
|
126
|
+
defaultOpen?: boolean;
|
|
127
|
+
}
|
|
128
|
+
/**
|
|
129
|
+
* Union type of all supported UISchema elements.
|
|
130
|
+
* This is the recursive type used in elements arrays.
|
|
131
|
+
*/
|
|
132
|
+
export type UISchemaElement = UISchemaControl | UISchemaVerticalLayout | UISchemaGroup;
|
|
133
|
+
/**
|
|
134
|
+
* Type guard: checks if element is a Control
|
|
135
|
+
*/
|
|
136
|
+
export declare function isUISchemaControl(element: UISchemaElement): element is UISchemaControl;
|
|
137
|
+
/**
|
|
138
|
+
* Type guard: checks if element is a VerticalLayout
|
|
139
|
+
*/
|
|
140
|
+
export declare function isUISchemaVerticalLayout(element: UISchemaElement): element is UISchemaVerticalLayout;
|
|
141
|
+
/**
|
|
142
|
+
* Type guard: checks if element is a Group
|
|
143
|
+
*/
|
|
144
|
+
export declare function isUISchemaGroup(element: UISchemaElement): element is UISchemaGroup;
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* UISchema Types for FlowDrop Form Layout
|
|
3
|
+
*
|
|
4
|
+
* Inspired by JSON Forms (EclipseSource) UISchema specification.
|
|
5
|
+
* Controls how form fields are arranged, grouped, and displayed
|
|
6
|
+
* without modifying the underlying data schema (ConfigSchema).
|
|
7
|
+
*
|
|
8
|
+
* The UISchema is a separate concern from the data schema:
|
|
9
|
+
* - ConfigSchema defines what data is valid (validation)
|
|
10
|
+
* - UISchema defines how the form is rendered (presentation)
|
|
11
|
+
*
|
|
12
|
+
* @see https://jsonforms.io/docs/uischema
|
|
13
|
+
*
|
|
14
|
+
* @example
|
|
15
|
+
* ```json
|
|
16
|
+
* {
|
|
17
|
+
* "type": "VerticalLayout",
|
|
18
|
+
* "elements": [
|
|
19
|
+
* { "type": "Control", "scope": "#/properties/model" },
|
|
20
|
+
* {
|
|
21
|
+
* "type": "Group",
|
|
22
|
+
* "label": "Advanced Settings",
|
|
23
|
+
* "collapsible": true,
|
|
24
|
+
* "defaultOpen": false,
|
|
25
|
+
* "elements": [
|
|
26
|
+
* { "type": "Control", "scope": "#/properties/temperature" },
|
|
27
|
+
* { "type": "Control", "scope": "#/properties/maxTokens" }
|
|
28
|
+
* ]
|
|
29
|
+
* }
|
|
30
|
+
* ]
|
|
31
|
+
* }
|
|
32
|
+
* ```
|
|
33
|
+
*/
|
|
34
|
+
/**
|
|
35
|
+
* Type guard: checks if element is a Control
|
|
36
|
+
*/
|
|
37
|
+
export function isUISchemaControl(element) {
|
|
38
|
+
return element.type === 'Control';
|
|
39
|
+
}
|
|
40
|
+
/**
|
|
41
|
+
* Type guard: checks if element is a VerticalLayout
|
|
42
|
+
*/
|
|
43
|
+
export function isUISchemaVerticalLayout(element) {
|
|
44
|
+
return element.type === 'VerticalLayout';
|
|
45
|
+
}
|
|
46
|
+
/**
|
|
47
|
+
* Type guard: checks if element is a Group
|
|
48
|
+
*/
|
|
49
|
+
export function isUISchemaGroup(element) {
|
|
50
|
+
return element.type === 'Group';
|
|
51
|
+
}
|