@flowdrop/flowdrop 1.0.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/LICENSE +21 -0
- package/README.md +252 -0
- package/dist/adapters/WorkflowAdapter.d.ts +167 -0
- package/dist/adapters/WorkflowAdapter.js +368 -0
- package/dist/adapters/agentspec/AgentSpecAdapter.d.ts +96 -0
- package/dist/adapters/agentspec/AgentSpecAdapter.js +626 -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/api/enhanced-client.d.ts +183 -0
- package/dist/api/enhanced-client.js +430 -0
- package/dist/components/App.svelte +981 -0
- package/dist/components/App.svelte.d.ts +54 -0
- package/dist/components/CanvasBanner.stories.svelte +29 -0
- package/dist/components/CanvasBanner.stories.svelte.d.ts +27 -0
- package/dist/components/CanvasBanner.svelte +57 -0
- package/dist/components/CanvasBanner.svelte.d.ts +8 -0
- package/dist/components/ConfigForm.svelte +1138 -0
- package/dist/components/ConfigForm.svelte.d.ts +44 -0
- package/dist/components/ConfigModal.svelte +188 -0
- package/dist/components/ConfigModal.svelte.d.ts +13 -0
- package/dist/components/ConfigPanel.stories.svelte +47 -0
- package/dist/components/ConfigPanel.stories.svelte.d.ts +27 -0
- package/dist/components/ConfigPanel.svelte +182 -0
- package/dist/components/ConfigPanel.svelte.d.ts +32 -0
- package/dist/components/ConnectionLine.svelte +32 -0
- package/dist/components/ConnectionLine.svelte.d.ts +3 -0
- package/dist/components/EdgeRefresher.svelte +41 -0
- package/dist/components/EdgeRefresher.svelte.d.ts +9 -0
- package/dist/components/FlowDropZone.svelte +83 -0
- package/dist/components/FlowDropZone.svelte.d.ts +13 -0
- package/dist/components/LoadingSpinner.stories.svelte +30 -0
- package/dist/components/LoadingSpinner.stories.svelte.d.ts +27 -0
- package/dist/components/LoadingSpinner.svelte +36 -0
- package/dist/components/LoadingSpinner.svelte.d.ts +8 -0
- package/dist/components/Logo.stories.svelte +22 -0
- package/dist/components/Logo.stories.svelte.d.ts +27 -0
- package/dist/components/Logo.svelte +102 -0
- package/dist/components/Logo.svelte.d.ts +26 -0
- package/dist/components/LogsSidebar.svelte +563 -0
- package/dist/components/LogsSidebar.svelte.d.ts +17 -0
- package/dist/components/MarkdownDisplay.stories.svelte +36 -0
- package/dist/components/MarkdownDisplay.stories.svelte.d.ts +27 -0
- package/dist/components/MarkdownDisplay.svelte +29 -0
- package/dist/components/MarkdownDisplay.svelte.d.ts +7 -0
- package/dist/components/Navbar.stories.svelte +53 -0
- package/dist/components/Navbar.stories.svelte.d.ts +27 -0
- package/dist/components/Navbar.svelte +726 -0
- package/dist/components/Navbar.svelte.d.ts +29 -0
- package/dist/components/NodeSidebar.svelte +762 -0
- package/dist/components/NodeSidebar.svelte.d.ts +9 -0
- package/dist/components/NodeStatusOverlay.stories.svelte +85 -0
- package/dist/components/NodeStatusOverlay.stories.svelte.d.ts +27 -0
- package/dist/components/NodeStatusOverlay.svelte +327 -0
- package/dist/components/NodeStatusOverlay.svelte.d.ts +11 -0
- package/dist/components/PipelineStatus.svelte +314 -0
- package/dist/components/PipelineStatus.svelte.d.ts +20 -0
- package/dist/components/PortCoordinateTracker.svelte +58 -0
- package/dist/components/PortCoordinateTracker.svelte.d.ts +12 -0
- package/dist/components/ReadOnlyDetails.svelte +170 -0
- package/dist/components/ReadOnlyDetails.svelte.d.ts +25 -0
- package/dist/components/SchemaForm.stories.svelte +116 -0
- package/dist/components/SchemaForm.stories.svelte.d.ts +27 -0
- package/dist/components/SchemaForm.svelte +536 -0
- package/dist/components/SchemaForm.svelte.d.ts +83 -0
- package/dist/components/SettingsModal.svelte +279 -0
- package/dist/components/SettingsModal.svelte.d.ts +23 -0
- package/dist/components/SettingsPanel.svelte +638 -0
- package/dist/components/SettingsPanel.svelte.d.ts +21 -0
- package/dist/components/StatusIcon.stories.svelte +60 -0
- package/dist/components/StatusIcon.stories.svelte.d.ts +27 -0
- package/dist/components/StatusIcon.svelte +119 -0
- package/dist/components/StatusIcon.svelte.d.ts +10 -0
- package/dist/components/StatusLabel.stories.svelte +17 -0
- package/dist/components/StatusLabel.stories.svelte.d.ts +27 -0
- package/dist/components/StatusLabel.svelte +33 -0
- package/dist/components/StatusLabel.svelte.d.ts +7 -0
- package/dist/components/ThemeToggle.stories.svelte +25 -0
- package/dist/components/ThemeToggle.stories.svelte.d.ts +27 -0
- package/dist/components/ThemeToggle.svelte +185 -0
- package/dist/components/ThemeToggle.svelte.d.ts +14 -0
- package/dist/components/UniversalNode.svelte +155 -0
- package/dist/components/UniversalNode.svelte.d.ts +15 -0
- package/dist/components/WorkflowEditor.svelte +1035 -0
- package/dist/components/WorkflowEditor.svelte.d.ts +23 -0
- package/dist/components/form/FormArray.svelte +1049 -0
- package/dist/components/form/FormArray.svelte.d.ts +22 -0
- package/dist/components/form/FormAutocomplete.svelte +1009 -0
- package/dist/components/form/FormAutocomplete.svelte.d.ts +25 -0
- package/dist/components/form/FormCheckboxGroup.stories.svelte +28 -0
- package/dist/components/form/FormCheckboxGroup.stories.svelte.d.ts +27 -0
- package/dist/components/form/FormCheckboxGroup.svelte +155 -0
- package/dist/components/form/FormCheckboxGroup.svelte.d.ts +17 -0
- package/dist/components/form/FormCodeEditor.svelte +458 -0
- package/dist/components/form/FormCodeEditor.svelte.d.ts +25 -0
- package/dist/components/form/FormField.svelte +417 -0
- package/dist/components/form/FormField.svelte.d.ts +29 -0
- package/dist/components/form/FormFieldLight.svelte +425 -0
- package/dist/components/form/FormFieldLight.svelte.d.ts +18 -0
- package/dist/components/form/FormFieldWrapper.stories.svelte +53 -0
- package/dist/components/form/FormFieldWrapper.stories.svelte.d.ts +27 -0
- package/dist/components/form/FormFieldWrapper.svelte +125 -0
- package/dist/components/form/FormFieldWrapper.svelte.d.ts +18 -0
- package/dist/components/form/FormFieldset.svelte +142 -0
- package/dist/components/form/FormFieldset.svelte.d.ts +11 -0
- package/dist/components/form/FormMarkdownEditor.svelte +752 -0
- package/dist/components/form/FormMarkdownEditor.svelte.d.ts +33 -0
- package/dist/components/form/FormNumberField.stories.svelte +36 -0
- package/dist/components/form/FormNumberField.stories.svelte.d.ts +27 -0
- package/dist/components/form/FormNumberField.svelte +112 -0
- package/dist/components/form/FormNumberField.svelte.d.ts +25 -0
- package/dist/components/form/FormRangeField.stories.svelte +31 -0
- package/dist/components/form/FormRangeField.stories.svelte.d.ts +27 -0
- package/dist/components/form/FormRangeField.svelte +246 -0
- package/dist/components/form/FormRangeField.svelte.d.ts +23 -0
- package/dist/components/form/FormSelect.stories.svelte +50 -0
- package/dist/components/form/FormSelect.stories.svelte.d.ts +27 -0
- package/dist/components/form/FormSelect.svelte +129 -0
- package/dist/components/form/FormSelect.svelte.d.ts +20 -0
- package/dist/components/form/FormTemplateEditor.svelte +825 -0
- package/dist/components/form/FormTemplateEditor.svelte.d.ts +41 -0
- package/dist/components/form/FormTextField.stories.svelte +30 -0
- package/dist/components/form/FormTextField.stories.svelte.d.ts +27 -0
- package/dist/components/form/FormTextField.svelte +91 -0
- package/dist/components/form/FormTextField.svelte.d.ts +19 -0
- package/dist/components/form/FormTextarea.stories.svelte +34 -0
- package/dist/components/form/FormTextarea.stories.svelte.d.ts +27 -0
- package/dist/components/form/FormTextarea.svelte +97 -0
- package/dist/components/form/FormTextarea.svelte.d.ts +21 -0
- package/dist/components/form/FormToggle.stories.svelte +30 -0
- package/dist/components/form/FormToggle.stories.svelte.d.ts +27 -0
- package/dist/components/form/FormToggle.svelte +126 -0
- package/dist/components/form/FormToggle.svelte.d.ts +19 -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 +50 -0
- package/dist/components/form/index.js +54 -0
- package/dist/components/form/templateAutocomplete.d.ts +29 -0
- package/dist/components/form/templateAutocomplete.js +254 -0
- package/dist/components/form/types.d.ts +485 -0
- package/dist/components/form/types.js +73 -0
- package/dist/components/interrupt/ChoicePrompt.stories.svelte +52 -0
- package/dist/components/interrupt/ChoicePrompt.stories.svelte.d.ts +27 -0
- package/dist/components/interrupt/ChoicePrompt.svelte +401 -0
- package/dist/components/interrupt/ChoicePrompt.svelte.d.ts +23 -0
- package/dist/components/interrupt/ConfirmationPrompt.stories.svelte +71 -0
- package/dist/components/interrupt/ConfirmationPrompt.stories.svelte.d.ts +27 -0
- package/dist/components/interrupt/ConfirmationPrompt.svelte +292 -0
- package/dist/components/interrupt/ConfirmationPrompt.svelte.d.ts +25 -0
- package/dist/components/interrupt/FormPrompt.svelte +236 -0
- package/dist/components/interrupt/FormPrompt.svelte.d.ts +23 -0
- package/dist/components/interrupt/InterruptBubble.svelte +601 -0
- package/dist/components/interrupt/InterruptBubble.svelte.d.ts +16 -0
- package/dist/components/interrupt/ReviewPrompt.stories.svelte +67 -0
- package/dist/components/interrupt/ReviewPrompt.stories.svelte.d.ts +27 -0
- package/dist/components/interrupt/ReviewPrompt.svelte +861 -0
- package/dist/components/interrupt/ReviewPrompt.svelte.d.ts +23 -0
- package/dist/components/interrupt/TextInputPrompt.stories.svelte +47 -0
- package/dist/components/interrupt/TextInputPrompt.stories.svelte.d.ts +27 -0
- package/dist/components/interrupt/TextInputPrompt.svelte +346 -0
- package/dist/components/interrupt/TextInputPrompt.svelte.d.ts +23 -0
- package/dist/components/interrupt/index.d.ts +13 -0
- package/dist/components/interrupt/index.js +15 -0
- package/dist/components/layouts/MainLayout.svelte +718 -0
- package/dist/components/layouts/MainLayout.svelte.d.ts +62 -0
- package/dist/components/nodes/GatewayNode.stories.svelte +108 -0
- package/dist/components/nodes/GatewayNode.stories.svelte.d.ts +26 -0
- package/dist/components/nodes/GatewayNode.svelte +591 -0
- package/dist/components/nodes/GatewayNode.svelte.d.ts +15 -0
- package/dist/components/nodes/IdeaNode.stories.svelte +52 -0
- package/dist/components/nodes/IdeaNode.stories.svelte.d.ts +26 -0
- package/dist/components/nodes/IdeaNode.svelte +455 -0
- package/dist/components/nodes/IdeaNode.svelte.d.ts +24 -0
- package/dist/components/nodes/NotesNode.stories.svelte +76 -0
- package/dist/components/nodes/NotesNode.stories.svelte.d.ts +26 -0
- package/dist/components/nodes/NotesNode.svelte +378 -0
- package/dist/components/nodes/NotesNode.svelte.d.ts +24 -0
- package/dist/components/nodes/SimpleNode.stories.svelte +159 -0
- package/dist/components/nodes/SimpleNode.stories.svelte.d.ts +26 -0
- package/dist/components/nodes/SimpleNode.svelte +451 -0
- package/dist/components/nodes/SimpleNode.svelte.d.ts +25 -0
- package/dist/components/nodes/SquareNode.stories.svelte +82 -0
- package/dist/components/nodes/SquareNode.stories.svelte.d.ts +26 -0
- package/dist/components/nodes/SquareNode.svelte +407 -0
- package/dist/components/nodes/SquareNode.svelte.d.ts +25 -0
- package/dist/components/nodes/TerminalNode.stories.svelte +25 -0
- package/dist/components/nodes/TerminalNode.stories.svelte.d.ts +26 -0
- package/dist/components/nodes/TerminalNode.svelte +690 -0
- package/dist/components/nodes/TerminalNode.svelte.d.ts +25 -0
- package/dist/components/nodes/ToolNode.stories.svelte +189 -0
- package/dist/components/nodes/ToolNode.stories.svelte.d.ts +26 -0
- package/dist/components/nodes/ToolNode.svelte +471 -0
- package/dist/components/nodes/ToolNode.svelte.d.ts +36 -0
- package/dist/components/nodes/WorkflowNode.stories.svelte +55 -0
- package/dist/components/nodes/WorkflowNode.stories.svelte.d.ts +26 -0
- package/dist/components/nodes/WorkflowNode.svelte +571 -0
- package/dist/components/nodes/WorkflowNode.svelte.d.ts +15 -0
- package/dist/components/playground/ChatPanel.svelte +905 -0
- package/dist/components/playground/ChatPanel.svelte.d.ts +46 -0
- package/dist/components/playground/ExecutionLogs.svelte +488 -0
- package/dist/components/playground/ExecutionLogs.svelte.d.ts +14 -0
- package/dist/components/playground/InputCollector.svelte +444 -0
- package/dist/components/playground/InputCollector.svelte.d.ts +16 -0
- package/dist/components/playground/MessageBubble.stories.svelte +62 -0
- package/dist/components/playground/MessageBubble.stories.svelte.d.ts +27 -0
- package/dist/components/playground/MessageBubble.svelte +633 -0
- package/dist/components/playground/MessageBubble.svelte.d.ts +24 -0
- package/dist/components/playground/Playground.svelte +1075 -0
- package/dist/components/playground/Playground.svelte.d.ts +25 -0
- package/dist/components/playground/PlaygroundModal.svelte +220 -0
- package/dist/components/playground/PlaygroundModal.svelte.d.ts +25 -0
- package/dist/components/playground/SessionManager.svelte +538 -0
- package/dist/components/playground/SessionManager.svelte.d.ts +20 -0
- package/dist/config/agentSpecEndpoints.d.ts +70 -0
- package/dist/config/agentSpecEndpoints.js +65 -0
- package/dist/config/constants.d.ts +43 -0
- package/dist/config/constants.js +31 -0
- package/dist/config/defaultCategories.d.ts +7 -0
- package/dist/config/defaultCategories.js +126 -0
- package/dist/config/defaultPortConfig.d.ts +6 -0
- package/dist/config/defaultPortConfig.js +201 -0
- package/dist/config/endpoints.d.ts +160 -0
- package/dist/config/endpoints.js +146 -0
- package/dist/config/runtimeConfig.d.ts +47 -0
- package/dist/config/runtimeConfig.js +80 -0
- package/dist/core/index.d.ts +75 -0
- package/dist/core/index.js +92 -0
- package/dist/display/index.d.ts +29 -0
- package/dist/display/index.js +36 -0
- package/dist/editor/index.d.ts +95 -0
- package/dist/editor/index.js +138 -0
- package/dist/form/code.d.ts +101 -0
- package/dist/form/code.js +168 -0
- package/dist/form/fieldRegistry.d.ts +169 -0
- package/dist/form/fieldRegistry.js +152 -0
- package/dist/form/full.d.ts +56 -0
- package/dist/form/full.js +80 -0
- package/dist/form/index.d.ts +77 -0
- package/dist/form/index.js +91 -0
- package/dist/form/markdown.d.ts +69 -0
- package/dist/form/markdown.js +103 -0
- package/dist/helpers/nodeLayoutHelper.d.ts +14 -0
- package/dist/helpers/nodeLayoutHelper.js +19 -0
- package/dist/helpers/proximityConnect.d.ts +94 -0
- package/dist/helpers/proximityConnect.js +314 -0
- package/dist/helpers/workflowEditorHelper.d.ts +183 -0
- package/dist/helpers/workflowEditorHelper.js +595 -0
- package/dist/index.d.ts +37 -0
- package/dist/index.js +64 -0
- package/dist/mocks/app-environment.d.ts +8 -0
- package/dist/mocks/app-environment.js +16 -0
- package/dist/mocks/app-forms.d.ts +2 -0
- package/dist/mocks/app-forms.js +22 -0
- package/dist/mocks/app-navigation.d.ts +5 -0
- package/dist/mocks/app-navigation.js +36 -0
- package/dist/mocks/app-stores.d.ts +14 -0
- package/dist/mocks/app-stores.js +26 -0
- package/dist/playground/index.d.ts +131 -0
- package/dist/playground/index.js +172 -0
- package/dist/playground/mount.d.ts +203 -0
- package/dist/playground/mount.js +235 -0
- 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.d.ts +77 -0
- package/dist/registry/builtinNodes.js +211 -0
- package/dist/registry/index.d.ts +8 -0
- package/dist/registry/index.js +12 -0
- package/dist/registry/nodeComponentRegistry.d.ts +276 -0
- package/dist/registry/nodeComponentRegistry.js +262 -0
- package/dist/registry/plugin.d.ts +215 -0
- package/dist/registry/plugin.js +249 -0
- 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/schemas/v1/workflow.schema.json +1078 -0
- package/dist/services/agentSpecExecutionService.d.ts +106 -0
- package/dist/services/agentSpecExecutionService.js +334 -0
- package/dist/services/api.d.ts +115 -0
- package/dist/services/api.js +214 -0
- package/dist/services/apiVariableService.d.ts +114 -0
- package/dist/services/apiVariableService.js +338 -0
- package/dist/services/autoSaveService.d.ts +112 -0
- package/dist/services/autoSaveService.js +227 -0
- package/dist/services/categoriesApi.d.ts +14 -0
- package/dist/services/categoriesApi.js +49 -0
- package/dist/services/draftStorage.d.ts +171 -0
- package/dist/services/draftStorage.js +299 -0
- package/dist/services/dynamicSchemaService.d.ts +108 -0
- package/dist/services/dynamicSchemaService.js +444 -0
- package/dist/services/globalSave.d.ts +69 -0
- package/dist/services/globalSave.js +248 -0
- package/dist/services/historyService.d.ts +208 -0
- package/dist/services/historyService.js +321 -0
- package/dist/services/interruptService.d.ts +133 -0
- package/dist/services/interruptService.js +280 -0
- package/dist/services/nodeExecutionService.d.ts +63 -0
- package/dist/services/nodeExecutionService.js +266 -0
- package/dist/services/playgroundService.d.ts +130 -0
- package/dist/services/playgroundService.js +321 -0
- package/dist/services/portConfigApi.d.ts +14 -0
- package/dist/services/portConfigApi.js +54 -0
- package/dist/services/settingsService.d.ts +92 -0
- package/dist/services/settingsService.js +196 -0
- package/dist/services/toastService.d.ts +156 -0
- package/dist/services/toastService.js +265 -0
- package/dist/services/variableService.d.ts +141 -0
- package/dist/services/variableService.js +463 -0
- package/dist/services/workflowStorage.d.ts +37 -0
- package/dist/services/workflowStorage.js +116 -0
- package/dist/settings/index.d.ts +25 -0
- package/dist/settings/index.js +33 -0
- package/dist/stores/categoriesStore.svelte.d.ts +32 -0
- package/dist/stores/categoriesStore.svelte.js +77 -0
- package/dist/stores/editorStateMachine.svelte.d.ts +42 -0
- package/dist/stores/editorStateMachine.svelte.js +132 -0
- package/dist/stores/historyStore.svelte.d.ts +136 -0
- package/dist/stores/historyStore.svelte.js +207 -0
- package/dist/stores/interruptStore.svelte.d.ts +179 -0
- package/dist/stores/interruptStore.svelte.js +346 -0
- package/dist/stores/playgroundStore.svelte.d.ts +230 -0
- package/dist/stores/playgroundStore.svelte.js +515 -0
- package/dist/stores/portCoordinateStore.svelte.d.ts +66 -0
- package/dist/stores/portCoordinateStore.svelte.js +186 -0
- package/dist/stores/settingsStore.svelte.d.ts +158 -0
- package/dist/stores/settingsStore.svelte.js +544 -0
- package/dist/stores/workflowStore.svelte.d.ts +260 -0
- package/dist/stores/workflowStore.svelte.js +649 -0
- package/dist/stories/CanvasDecorator.svelte +49 -0
- package/dist/stories/CanvasDecorator.svelte.d.ts +8 -0
- package/dist/stories/NodeDecorator.svelte +73 -0
- package/dist/stories/NodeDecorator.svelte.d.ts +8 -0
- package/dist/stories/utils.d.ts +93 -0
- package/dist/stories/utils.js +122 -0
- package/dist/styles/base.css +1300 -0
- package/dist/styles/toast.css +35 -0
- package/dist/styles/tokens.css +475 -0
- package/dist/svelte-app.d.ts +150 -0
- package/dist/svelte-app.js +295 -0
- package/dist/types/agentspec.d.ts +318 -0
- package/dist/types/agentspec.js +48 -0
- package/dist/types/auth.d.ts +263 -0
- package/dist/types/auth.js +229 -0
- package/dist/types/config.d.ts +151 -0
- package/dist/types/config.js +7 -0
- package/dist/types/events.d.ts +190 -0
- package/dist/types/events.js +30 -0
- package/dist/types/index.d.ts +1234 -0
- package/dist/types/index.js +27 -0
- package/dist/types/interrupt.d.ts +390 -0
- package/dist/types/interrupt.js +145 -0
- package/dist/types/interruptState.d.ts +211 -0
- package/dist/types/interruptState.js +308 -0
- package/dist/types/playground.d.ts +351 -0
- package/dist/types/playground.js +95 -0
- package/dist/types/settings.d.ts +189 -0
- package/dist/types/settings.js +97 -0
- package/dist/types/uischema.d.ts +144 -0
- package/dist/types/uischema.js +51 -0
- package/dist/utils/colors.d.ts +288 -0
- package/dist/utils/colors.js +548 -0
- package/dist/utils/config.d.ts +37 -0
- package/dist/utils/config.js +226 -0
- package/dist/utils/connections.d.ts +125 -0
- package/dist/utils/connections.js +414 -0
- package/dist/utils/errors.d.ts +28 -0
- package/dist/utils/errors.js +44 -0
- package/dist/utils/fetchWithAuth.d.ts +25 -0
- package/dist/utils/fetchWithAuth.js +34 -0
- package/dist/utils/handleIds.d.ts +35 -0
- package/dist/utils/handleIds.js +58 -0
- package/dist/utils/handlePositioning.d.ts +31 -0
- package/dist/utils/handlePositioning.js +35 -0
- package/dist/utils/icons.d.ts +106 -0
- package/dist/utils/icons.js +157 -0
- package/dist/utils/logger.d.ts +47 -0
- package/dist/utils/logger.js +72 -0
- package/dist/utils/nodeStatus.d.ts +53 -0
- package/dist/utils/nodeStatus.js +183 -0
- package/dist/utils/nodeTypes.d.ts +117 -0
- package/dist/utils/nodeTypes.js +244 -0
- package/dist/utils/nodeWrapper.d.ts +39 -0
- package/dist/utils/nodeWrapper.js +62 -0
- package/dist/utils/performanceUtils.d.ts +30 -0
- package/dist/utils/performanceUtils.js +108 -0
- package/dist/utils/sanitize.d.ts +19 -0
- package/dist/utils/sanitize.js +31 -0
- package/dist/utils/uischema.d.ts +52 -0
- package/dist/utils/uischema.js +88 -0
- package/dist/utils/validation.d.ts +29 -0
- package/dist/utils/validation.js +39 -0
- package/package.json +292 -0
|
@@ -0,0 +1,295 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Svelte App Wrapper for Framework Integration
|
|
3
|
+
*
|
|
4
|
+
* Provides mount/unmount functions for integrating FlowDrop into any web application.
|
|
5
|
+
* Particularly useful for integration with vanilla JS, Drupal, WordPress, or other frameworks.
|
|
6
|
+
*
|
|
7
|
+
* @module svelte-app
|
|
8
|
+
*/
|
|
9
|
+
import { mount, unmount } from 'svelte';
|
|
10
|
+
import WorkflowEditor from './components/WorkflowEditor.svelte';
|
|
11
|
+
import App from './components/App.svelte';
|
|
12
|
+
import { workflowFormatRegistry } from './registry/workflowFormatRegistry.js';
|
|
13
|
+
import './registry/builtinFormats.js';
|
|
14
|
+
import { initializePortCompatibility } from './utils/connections.js';
|
|
15
|
+
import { DEFAULT_PORT_CONFIG } from './config/defaultPortConfig.js';
|
|
16
|
+
import { fetchPortConfig } from './services/portConfigApi.js';
|
|
17
|
+
import { fetchCategories } from './services/categoriesApi.js';
|
|
18
|
+
import { initializeCategories } from './stores/categoriesStore.svelte.js';
|
|
19
|
+
import { isDirty, markAsSaved, getWorkflow as getWorkflowFromStore, setOnDirtyStateChange, setOnWorkflowChange } from './stores/workflowStore.svelte.js';
|
|
20
|
+
import { DraftAutoSaveManager, getDraftStorageKey } from './services/draftStorage.js';
|
|
21
|
+
import { mergeFeatures } from './types/events.js';
|
|
22
|
+
import { initializeSettings } from './stores/settingsStore.svelte.js';
|
|
23
|
+
import { logger } from './utils/logger.js';
|
|
24
|
+
import { globalSaveWorkflow, globalExportWorkflow } from './services/globalSave.js';
|
|
25
|
+
/**
|
|
26
|
+
* Mount the full FlowDrop App with navbar, sidebars, and workflow editor
|
|
27
|
+
*
|
|
28
|
+
* Use this for a complete workflow editing experience with all UI components.
|
|
29
|
+
*
|
|
30
|
+
* @param container - DOM element to mount the app into
|
|
31
|
+
* @param options - Configuration options for the app
|
|
32
|
+
* @returns Promise resolving to a MountedFlowDropApp instance
|
|
33
|
+
*
|
|
34
|
+
* @example
|
|
35
|
+
* ```typescript
|
|
36
|
+
* const app = await mountFlowDropApp(document.getElementById("editor"), {
|
|
37
|
+
* workflow: myWorkflow,
|
|
38
|
+
* endpointConfig: createEndpointConfig("/api/flowdrop"),
|
|
39
|
+
* authProvider: new CallbackAuthProvider({
|
|
40
|
+
* getToken: () => authService.getAccessToken()
|
|
41
|
+
* }),
|
|
42
|
+
* eventHandlers: {
|
|
43
|
+
* onDirtyStateChange: (isDirty) => updateSaveButton(isDirty),
|
|
44
|
+
* onAfterSave: () => showSuccess("Saved!")
|
|
45
|
+
* }
|
|
46
|
+
* });
|
|
47
|
+
* ```
|
|
48
|
+
*/
|
|
49
|
+
export async function mountFlowDropApp(container, options = {}) {
|
|
50
|
+
const { workflow, nodes, endpointConfig, portConfig, categories, height = '100vh', width = '100%', showNavbar = false, disableSidebar, lockWorkflow, readOnly, nodeStatuses, pipelineId, navbarTitle, navbarActions, showSettings, authProvider, eventHandlers, features: userFeatures, settings: initialSettings, draftStorageKey: customDraftKey, formatAdapters } = options;
|
|
51
|
+
// Register custom format adapters before mounting
|
|
52
|
+
if (formatAdapters) {
|
|
53
|
+
for (const adapter of formatAdapters) {
|
|
54
|
+
workflowFormatRegistry.register(adapter);
|
|
55
|
+
}
|
|
56
|
+
}
|
|
57
|
+
// Merge features with defaults
|
|
58
|
+
const features = mergeFeatures(userFeatures);
|
|
59
|
+
// Apply initial settings overrides and initialize theme
|
|
60
|
+
await initializeSettings({
|
|
61
|
+
defaults: initialSettings
|
|
62
|
+
});
|
|
63
|
+
// Create endpoint configuration
|
|
64
|
+
let config;
|
|
65
|
+
if (endpointConfig) {
|
|
66
|
+
// Merge with default configuration to ensure all required endpoints are present
|
|
67
|
+
const { defaultEndpointConfig } = await import('./config/endpoints.js');
|
|
68
|
+
config = {
|
|
69
|
+
...defaultEndpointConfig,
|
|
70
|
+
...endpointConfig,
|
|
71
|
+
endpoints: {
|
|
72
|
+
...defaultEndpointConfig.endpoints,
|
|
73
|
+
...endpointConfig.endpoints
|
|
74
|
+
}
|
|
75
|
+
};
|
|
76
|
+
}
|
|
77
|
+
else {
|
|
78
|
+
// Use default configuration if none provided
|
|
79
|
+
const { defaultEndpointConfig } = await import('./config/endpoints.js');
|
|
80
|
+
config = defaultEndpointConfig;
|
|
81
|
+
}
|
|
82
|
+
// Initialize port configuration
|
|
83
|
+
let finalPortConfig = portConfig;
|
|
84
|
+
if (!finalPortConfig && config) {
|
|
85
|
+
// Try to fetch port configuration from API
|
|
86
|
+
try {
|
|
87
|
+
finalPortConfig = await fetchPortConfig(config);
|
|
88
|
+
}
|
|
89
|
+
catch (error) {
|
|
90
|
+
logger.warn('Failed to fetch port config from API, using default:', error);
|
|
91
|
+
finalPortConfig = DEFAULT_PORT_CONFIG;
|
|
92
|
+
}
|
|
93
|
+
}
|
|
94
|
+
else if (!finalPortConfig) {
|
|
95
|
+
finalPortConfig = DEFAULT_PORT_CONFIG;
|
|
96
|
+
}
|
|
97
|
+
initializePortCompatibility(finalPortConfig);
|
|
98
|
+
// Initialize categories
|
|
99
|
+
if (categories) {
|
|
100
|
+
initializeCategories(categories);
|
|
101
|
+
}
|
|
102
|
+
else if (config) {
|
|
103
|
+
try {
|
|
104
|
+
const fetchedCategories = await fetchCategories(config);
|
|
105
|
+
initializeCategories(fetchedCategories);
|
|
106
|
+
}
|
|
107
|
+
catch (error) {
|
|
108
|
+
logger.warn('Failed to fetch categories from API, using defaults:', error);
|
|
109
|
+
}
|
|
110
|
+
}
|
|
111
|
+
// Set up event handler callbacks in the store
|
|
112
|
+
if (eventHandlers?.onDirtyStateChange) {
|
|
113
|
+
setOnDirtyStateChange(eventHandlers.onDirtyStateChange);
|
|
114
|
+
}
|
|
115
|
+
if (eventHandlers?.onWorkflowChange) {
|
|
116
|
+
setOnWorkflowChange(eventHandlers.onWorkflowChange);
|
|
117
|
+
}
|
|
118
|
+
// Create the Svelte App component with configuration
|
|
119
|
+
const svelteApp = mount(App, {
|
|
120
|
+
target: container,
|
|
121
|
+
props: {
|
|
122
|
+
workflow,
|
|
123
|
+
nodes,
|
|
124
|
+
height,
|
|
125
|
+
width,
|
|
126
|
+
showNavbar,
|
|
127
|
+
disableSidebar,
|
|
128
|
+
lockWorkflow,
|
|
129
|
+
readOnly,
|
|
130
|
+
nodeStatuses,
|
|
131
|
+
pipelineId,
|
|
132
|
+
navbarTitle,
|
|
133
|
+
navbarActions,
|
|
134
|
+
showSettings,
|
|
135
|
+
endpointConfig: config,
|
|
136
|
+
authProvider,
|
|
137
|
+
eventHandlers,
|
|
138
|
+
features
|
|
139
|
+
}
|
|
140
|
+
});
|
|
141
|
+
// Set up draft auto-save manager
|
|
142
|
+
let draftManager = null;
|
|
143
|
+
if (features.autoSaveDraft) {
|
|
144
|
+
const storageKey = getDraftStorageKey(workflow?.id, customDraftKey);
|
|
145
|
+
draftManager = new DraftAutoSaveManager({
|
|
146
|
+
storageKey,
|
|
147
|
+
interval: features.autoSaveDraftInterval,
|
|
148
|
+
enabled: features.autoSaveDraft,
|
|
149
|
+
getWorkflow: getWorkflowFromStore,
|
|
150
|
+
isDirty
|
|
151
|
+
});
|
|
152
|
+
draftManager.start();
|
|
153
|
+
}
|
|
154
|
+
// Store state for cleanup
|
|
155
|
+
const state = {
|
|
156
|
+
svelteApp,
|
|
157
|
+
draftManager,
|
|
158
|
+
eventHandlers: eventHandlers ?? null
|
|
159
|
+
};
|
|
160
|
+
// Create the mounted app interface
|
|
161
|
+
const mountedApp = {
|
|
162
|
+
destroy: () => {
|
|
163
|
+
// Call onBeforeUnmount if provided
|
|
164
|
+
if (state.eventHandlers?.onBeforeUnmount) {
|
|
165
|
+
const currentWorkflow = getWorkflowFromStore();
|
|
166
|
+
if (currentWorkflow) {
|
|
167
|
+
state.eventHandlers.onBeforeUnmount(currentWorkflow, isDirty());
|
|
168
|
+
}
|
|
169
|
+
}
|
|
170
|
+
// Stop draft manager
|
|
171
|
+
if (state.draftManager) {
|
|
172
|
+
// Save one final draft if dirty
|
|
173
|
+
if (isDirty()) {
|
|
174
|
+
state.draftManager.forceSave();
|
|
175
|
+
}
|
|
176
|
+
state.draftManager.stop();
|
|
177
|
+
}
|
|
178
|
+
// Clear event callbacks
|
|
179
|
+
setOnDirtyStateChange(null);
|
|
180
|
+
setOnWorkflowChange(null);
|
|
181
|
+
// Unmount Svelte app
|
|
182
|
+
unmount(state.svelteApp);
|
|
183
|
+
},
|
|
184
|
+
isDirty: () => isDirty(),
|
|
185
|
+
markAsSaved: () => {
|
|
186
|
+
markAsSaved();
|
|
187
|
+
// Also update draft manager
|
|
188
|
+
if (state.draftManager) {
|
|
189
|
+
state.draftManager.markAsSaved();
|
|
190
|
+
}
|
|
191
|
+
},
|
|
192
|
+
getWorkflow: () => getWorkflowFromStore(),
|
|
193
|
+
save: async () => {
|
|
194
|
+
await globalSaveWorkflow();
|
|
195
|
+
},
|
|
196
|
+
export: () => {
|
|
197
|
+
globalExportWorkflow();
|
|
198
|
+
}
|
|
199
|
+
};
|
|
200
|
+
return mountedApp;
|
|
201
|
+
}
|
|
202
|
+
/**
|
|
203
|
+
* Mount the WorkflowEditor component in a container
|
|
204
|
+
*
|
|
205
|
+
* Simpler alternative to mountFlowDropApp - only mounts the editor without navbar.
|
|
206
|
+
*
|
|
207
|
+
* @param container - DOM element to mount the editor into
|
|
208
|
+
* @param options - Configuration options
|
|
209
|
+
* @returns Promise resolving to a MountedFlowDropApp instance
|
|
210
|
+
*/
|
|
211
|
+
export async function mountWorkflowEditor(container, options = {}) {
|
|
212
|
+
const { nodes = [], endpointConfig, portConfig, categories } = options;
|
|
213
|
+
// Create endpoint configuration
|
|
214
|
+
let config;
|
|
215
|
+
if (endpointConfig) {
|
|
216
|
+
// Merge with default configuration to ensure all required endpoints are present
|
|
217
|
+
const { defaultEndpointConfig } = await import('./config/endpoints.js');
|
|
218
|
+
config = {
|
|
219
|
+
...defaultEndpointConfig,
|
|
220
|
+
...endpointConfig,
|
|
221
|
+
endpoints: {
|
|
222
|
+
...defaultEndpointConfig.endpoints,
|
|
223
|
+
...endpointConfig.endpoints
|
|
224
|
+
}
|
|
225
|
+
};
|
|
226
|
+
}
|
|
227
|
+
else {
|
|
228
|
+
// Use default configuration if none provided
|
|
229
|
+
const { defaultEndpointConfig } = await import('./config/endpoints.js');
|
|
230
|
+
config = defaultEndpointConfig;
|
|
231
|
+
}
|
|
232
|
+
// Initialize port configuration
|
|
233
|
+
let finalPortConfig = portConfig;
|
|
234
|
+
if (!finalPortConfig && config) {
|
|
235
|
+
// Try to fetch port configuration from API
|
|
236
|
+
try {
|
|
237
|
+
finalPortConfig = await fetchPortConfig(config);
|
|
238
|
+
}
|
|
239
|
+
catch (error) {
|
|
240
|
+
logger.warn('Failed to fetch port config from API, using default:', error);
|
|
241
|
+
finalPortConfig = DEFAULT_PORT_CONFIG;
|
|
242
|
+
}
|
|
243
|
+
}
|
|
244
|
+
else if (!finalPortConfig) {
|
|
245
|
+
finalPortConfig = DEFAULT_PORT_CONFIG;
|
|
246
|
+
}
|
|
247
|
+
initializePortCompatibility(finalPortConfig);
|
|
248
|
+
// Initialize categories
|
|
249
|
+
if (categories) {
|
|
250
|
+
initializeCategories(categories);
|
|
251
|
+
}
|
|
252
|
+
else if (config) {
|
|
253
|
+
try {
|
|
254
|
+
const fetchedCategories = await fetchCategories(config);
|
|
255
|
+
initializeCategories(fetchedCategories);
|
|
256
|
+
}
|
|
257
|
+
catch (error) {
|
|
258
|
+
logger.warn('Failed to fetch categories from API, using defaults:', error);
|
|
259
|
+
}
|
|
260
|
+
}
|
|
261
|
+
// Create the Svelte component
|
|
262
|
+
const svelteApp = mount(WorkflowEditor, {
|
|
263
|
+
target: container,
|
|
264
|
+
props: {
|
|
265
|
+
nodes,
|
|
266
|
+
endpointConfig: config
|
|
267
|
+
}
|
|
268
|
+
});
|
|
269
|
+
// Create the mounted app interface (simpler version)
|
|
270
|
+
const mountedApp = {
|
|
271
|
+
destroy: () => {
|
|
272
|
+
unmount(svelteApp);
|
|
273
|
+
},
|
|
274
|
+
isDirty: () => isDirty(),
|
|
275
|
+
markAsSaved: () => markAsSaved(),
|
|
276
|
+
getWorkflow: () => getWorkflowFromStore(),
|
|
277
|
+
save: async () => {
|
|
278
|
+
await globalSaveWorkflow();
|
|
279
|
+
},
|
|
280
|
+
export: () => {
|
|
281
|
+
globalExportWorkflow();
|
|
282
|
+
}
|
|
283
|
+
};
|
|
284
|
+
return mountedApp;
|
|
285
|
+
}
|
|
286
|
+
/**
|
|
287
|
+
* Unmount a FlowDrop app
|
|
288
|
+
*
|
|
289
|
+
* @param app - The mounted app to unmount
|
|
290
|
+
*/
|
|
291
|
+
export function unmountFlowDropApp(app) {
|
|
292
|
+
if (app && typeof app.destroy === 'function') {
|
|
293
|
+
app.destroy();
|
|
294
|
+
}
|
|
295
|
+
}
|
|
@@ -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
|
+
}
|