@d34dman/flowdrop 0.0.57 → 0.0.59

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (54) hide show
  1. package/README.md +9 -8
  2. package/dist/adapters/WorkflowAdapter.d.ts +2 -1
  3. package/dist/adapters/agentspec/AgentSpecAdapter.d.ts +4 -0
  4. package/dist/adapters/agentspec/AgentSpecAdapter.js +27 -22
  5. package/dist/adapters/agentspec/componentTypeDefaults.d.ts +73 -0
  6. package/dist/adapters/agentspec/componentTypeDefaults.js +238 -0
  7. package/dist/adapters/agentspec/{nodeTypeRegistry.d.ts → defaultNodeTypes.d.ts} +21 -30
  8. package/dist/adapters/agentspec/{nodeTypeRegistry.js → defaultNodeTypes.js} +31 -59
  9. package/dist/adapters/agentspec/index.d.ts +3 -1
  10. package/dist/adapters/agentspec/index.js +4 -2
  11. package/dist/components/App.svelte +57 -13
  12. package/dist/components/NodeSidebar.svelte +20 -8
  13. package/dist/components/NodeSidebar.svelte.d.ts +2 -1
  14. package/dist/components/WorkflowEditor.svelte +14 -13
  15. package/dist/components/form/FormMarkdownEditor.svelte +546 -422
  16. package/dist/components/form/FormMarkdownEditor.svelte.d.ts +2 -0
  17. package/dist/components/form/FormUISchemaRenderer.svelte +4 -8
  18. package/dist/components/form/types.d.ts +1 -1
  19. package/dist/components/nodes/WorkflowNode.svelte +1 -2
  20. package/dist/core/index.d.ts +13 -3
  21. package/dist/core/index.js +16 -3
  22. package/dist/form/code.js +6 -1
  23. package/dist/form/fieldRegistry.d.ts +79 -15
  24. package/dist/form/fieldRegistry.js +104 -49
  25. package/dist/form/full.d.ts +2 -2
  26. package/dist/form/full.js +2 -2
  27. package/dist/form/index.d.ts +3 -3
  28. package/dist/form/index.js +6 -2
  29. package/dist/form/markdown.d.ts +3 -3
  30. package/dist/form/markdown.js +8 -4
  31. package/dist/index.d.ts +2 -2
  32. package/dist/index.js +2 -2
  33. package/dist/registry/BaseRegistry.d.ts +92 -0
  34. package/dist/registry/BaseRegistry.js +124 -0
  35. package/dist/registry/builtinFormats.d.ts +23 -0
  36. package/dist/registry/builtinFormats.js +70 -0
  37. package/dist/registry/builtinNodes.js +4 -0
  38. package/dist/registry/index.d.ts +2 -1
  39. package/dist/registry/index.js +2 -0
  40. package/dist/registry/nodeComponentRegistry.d.ts +26 -57
  41. package/dist/registry/nodeComponentRegistry.js +29 -82
  42. package/dist/registry/workflowFormatRegistry.d.ts +122 -0
  43. package/dist/registry/workflowFormatRegistry.js +96 -0
  44. package/dist/schema/index.d.ts +23 -0
  45. package/dist/schema/index.js +23 -0
  46. package/dist/schemas/v1/workflow.schema.json +1078 -0
  47. package/dist/stores/portCoordinateStore.js +1 -4
  48. package/dist/stores/workflowStore.d.ts +3 -0
  49. package/dist/stores/workflowStore.js +3 -0
  50. package/dist/svelte-app.d.ts +4 -0
  51. package/dist/svelte-app.js +9 -1
  52. package/dist/types/index.d.ts +18 -0
  53. package/dist/types/index.js +4 -0
  54. package/package.json +20 -13
@@ -65,10 +65,7 @@ function computeNodePortCoordinates(node, internalNode) {
65
65
  const posAbs = internalNode.internals.positionAbsolute;
66
66
  const dataTypeLookup = buildPortDataTypeLookup(node);
67
67
  const coordinates = [];
68
- const allHandles = [
69
- ...(handleBounds.source ?? []),
70
- ...(handleBounds.target ?? [])
71
- ];
68
+ const allHandles = [...(handleBounds.source ?? []), ...(handleBounds.target ?? [])];
72
69
  for (const handle of allHandles) {
73
70
  if (!handle.id)
74
71
  continue;
@@ -86,7 +86,10 @@ export declare const workflowMetadata: import("svelte/store").Readable<{
86
86
  tags?: string[];
87
87
  versionId?: string;
88
88
  updateNumber?: number;
89
+ format?: import("../types").WorkflowFormat;
89
90
  }>;
91
+ /** Derived store for the current workflow format */
92
+ export declare const workflowFormat: import("svelte/store").Readable<import("../types").WorkflowFormat>;
90
93
  /**
91
94
  * Actions for updating the workflow
92
95
  *
@@ -7,6 +7,7 @@
7
7
  * @module stores/workflowStore
8
8
  */
9
9
  import { writable, derived, get } from 'svelte/store';
10
+ import { DEFAULT_WORKFLOW_FORMAT } from '../types/index.js';
10
11
  import { historyService } from '../services/historyService.js';
11
12
  // =========================================================================
12
13
  // Core Workflow Store
@@ -220,6 +221,8 @@ export const workflowMetadata = derived(workflowStore, ($workflow) => $workflow?
220
221
  versionId: `${Date.now()}-${Math.random().toString(36).substr(2, 9)}`,
221
222
  updateNumber: 0
222
223
  });
224
+ /** Derived store for the current workflow format */
225
+ export const workflowFormat = derived(workflowStore, ($workflow) => $workflow?.metadata?.format ?? DEFAULT_WORKFLOW_FORMAT);
223
226
  // =========================================================================
224
227
  // Helper Functions
225
228
  // =========================================================================
@@ -10,6 +10,8 @@ import type { Workflow, NodeMetadata, PortConfig, CategoryDefinition } from './t
10
10
  import type { EndpointConfig } from './config/endpoints.js';
11
11
  import type { AuthProvider } from './types/auth.js';
12
12
  import type { FlowDropEventHandlers, FlowDropFeatures } from './types/events.js';
13
+ import type { WorkflowFormatAdapter } from './registry/workflowFormatRegistry.js';
14
+ import './registry/builtinFormats.js';
13
15
  import type { PartialSettings } from './types/settings.js';
14
16
  declare global {
15
17
  interface Window {
@@ -73,6 +75,8 @@ export interface FlowDropMountOptions {
73
75
  settings?: PartialSettings;
74
76
  /** Custom storage key for localStorage drafts */
75
77
  draftStorageKey?: string;
78
+ /** Custom workflow format adapters to register */
79
+ formatAdapters?: WorkflowFormatAdapter[];
76
80
  }
77
81
  /**
78
82
  * Return type for mounted FlowDrop app
@@ -9,6 +9,8 @@
9
9
  import { mount, unmount } from 'svelte';
10
10
  import WorkflowEditor from './components/WorkflowEditor.svelte';
11
11
  import App from './components/App.svelte';
12
+ import { workflowFormatRegistry } from './registry/workflowFormatRegistry.js';
13
+ import './registry/builtinFormats.js';
12
14
  import { initializePortCompatibility } from './utils/connections.js';
13
15
  import { DEFAULT_PORT_CONFIG } from './config/defaultPortConfig.js';
14
16
  import { fetchPortConfig } from './services/portConfigApi.js';
@@ -43,7 +45,13 @@ import { initializeSettings } from './stores/settingsStore.js';
43
45
  * ```
44
46
  */
45
47
  export async function mountFlowDropApp(container, options = {}) {
46
- 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 } = options;
48
+ 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;
49
+ // Register custom format adapters before mounting
50
+ if (formatAdapters) {
51
+ for (const adapter of formatAdapters) {
52
+ workflowFormatRegistry.register(adapter);
53
+ }
54
+ }
47
55
  // Merge features with defaults
48
56
  const features = mergeFeatures(userFeatures);
49
57
  // Apply initial settings overrides and initialize theme
@@ -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.
@@ -550,6 +564,8 @@ export interface NodeMetadata {
550
564
  /** Default configuration values for this node type */
551
565
  config?: Record<string, unknown>;
552
566
  tags?: string[];
567
+ /** Workflow formats this node is compatible with. Omit = universal (all formats). */
568
+ formats?: WorkflowFormat[];
553
569
  /**
554
570
  * Admin/Edit configuration for nodes with dynamic or external configuration.
555
571
  * Used when the config schema cannot be determined at workflow load time
@@ -1106,6 +1122,8 @@ export interface Workflow {
1106
1122
  tags?: string[];
1107
1123
  versionId?: string;
1108
1124
  updateNumber?: number;
1125
+ /** Workflow format. Determines sidebar filtering and export behavior. */
1126
+ format?: WorkflowFormat;
1109
1127
  };
1110
1128
  }
1111
1129
  /**
@@ -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
package/package.json CHANGED
@@ -2,17 +2,17 @@
2
2
  "name": "@d34dman/flowdrop",
3
3
  "license": "MIT",
4
4
  "private": false,
5
- "version": "0.0.57",
5
+ "version": "0.0.59",
6
6
  "scripts": {
7
7
  "dev": "vite dev",
8
- "build": "vite build && npm run prepack",
8
+ "build": "vite build && pnpm run prepack",
9
9
  "build:drupal": "vite build --config vite.config.drupal.ts",
10
10
  "build:production": "vite build --config vite.config.production.ts",
11
11
  "watch:build:drupal": "npm-watch build:drupal",
12
12
  "watch:build:production": "npm-watch build:production",
13
13
  "watch:build": "npm-watch build",
14
14
  "preview": "vite preview",
15
- "prepare": "svelte-kit sync || echo '' && husky",
15
+ "prepare": "svelte-kit sync || echo ''",
16
16
  "prepack": "svelte-kit sync && svelte-package && publint",
17
17
  "check": "svelte-kit sync && svelte-check --tsconfig ./tsconfig.json",
18
18
  "check:watch": "svelte-kit sync && svelte-check --tsconfig ./tsconfig.json --watch",
@@ -24,15 +24,14 @@
24
24
  "test:e2e": "playwright test",
25
25
  "test:e2e:ui": "playwright test --ui",
26
26
  "test:e2e:debug": "playwright test --debug",
27
- "test:all": "npm run test && npm run test:e2e",
27
+ "test:all": "pnpm run test && pnpm run test:e2e",
28
28
  "format": "prettier --write .",
29
29
  "storybook": "storybook dev -p 6006",
30
30
  "build-storybook": "storybook build",
31
- "api:lint": "redocly lint api/openapi.yaml --config api/redocly.yaml",
32
- "api:bundle": "redocly bundle api/openapi.yaml -o api/bundled.yaml --config api/redocly.yaml",
33
- "api:watch": "nodemon --watch api --ext yaml --ignore api/bundled.yaml --exec 'npm run api:bundle'",
34
- "api:preview": "redocly preview-docs api/openapi.yaml --config api/redocly.yaml",
35
- "api:docs": "redocly build-docs api/bundled.yaml -o api-docs/index.html"
31
+ "schema:generate": "node scripts/generate-schema.mjs",
32
+ "schema:check": "node scripts/generate-schema.mjs --check",
33
+ "api:lint": "pnpm --dir ../../apps/api-docs run lint",
34
+ "api:bundle": "pnpm --dir ../../apps/api-docs run bundle"
36
35
  },
37
36
  "watch": {
38
37
  "build": {
@@ -134,7 +133,13 @@
134
133
  "default": "./dist/settings/index.js"
135
134
  },
136
135
  "./styles": "./dist/styles/base.css",
137
- "./styles/*": "./dist/styles/*"
136
+ "./styles/*": "./dist/styles/*",
137
+ "./schema": {
138
+ "default": "./dist/schemas/v1/workflow.schema.json"
139
+ },
140
+ "./schema/v1": {
141
+ "default": "./dist/schemas/v1/workflow.schema.json"
142
+ }
138
143
  },
139
144
  "peerDependencies": {
140
145
  "@iconify/svelte": "^5.0.0",
@@ -156,7 +161,6 @@
156
161
  "@eslint/js": "^9.18.0",
157
162
  "@iconify/svelte": "^5.0.0",
158
163
  "@playwright/test": "^1.49.1",
159
- "@redocly/cli": "^1.31.0",
160
164
  "@storybook/addon-docs": "^9.0.15",
161
165
  "@storybook/addon-svelte-csf": "^5.0.4",
162
166
  "@storybook/addon-vitest": "^9.0.15",
@@ -178,7 +182,6 @@
178
182
  "eslint-plugin-svelte": "^3.0.0",
179
183
  "globals": "^16.0.0",
180
184
  "happy-dom": "^20.0.11",
181
- "husky": "^9.1.7",
182
185
  "msw": "^2.12.7",
183
186
  "npm-watch": "^0.13.0",
184
187
  "picomatch": "^4.0.3",
@@ -208,12 +211,16 @@
208
211
  ],
209
212
  "dependencies": {
210
213
  "@codemirror/autocomplete": "^6.20.0",
214
+ "@codemirror/commands": "^6.10.2",
211
215
  "@codemirror/lang-json": "^6.0.2",
216
+ "@codemirror/lang-markdown": "^6.5.0",
217
+ "@codemirror/language": "^6.12.1",
212
218
  "@codemirror/lint": "^6.9.2",
219
+ "@codemirror/state": "^6.5.4",
213
220
  "@codemirror/theme-one-dark": "^6.1.3",
221
+ "@codemirror/view": "^6.39.14",
214
222
  "@xyflow/svelte": "~1.2",
215
223
  "codemirror": "^6.0.2",
216
- "easymde": "^2.20.0",
217
224
  "marked": "^16.1.1",
218
225
  "svelte-5-french-toast": "^2.0.6",
219
226
  "uuid": "^11.1.0"