@flowdrop/flowdrop 1.15.0 → 2.0.0-beta.2

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 (235) hide show
  1. package/CHANGELOG.md +508 -0
  2. package/MIGRATION-2.0.md +629 -0
  3. package/README.md +23 -23
  4. package/dist/adapters/WorkflowAdapter.d.ts +1 -1
  5. package/dist/adapters/WorkflowAdapter.js +14 -8
  6. package/dist/adapters/agentspec/AgentSpecAdapter.js +7 -7
  7. package/dist/api/enhanced-client.js +6 -11
  8. package/dist/chat/batchFeedback.d.ts +39 -0
  9. package/dist/chat/batchFeedback.js +51 -0
  10. package/dist/commands/executor.js +15 -1
  11. package/dist/commands/storeIntegration.svelte.d.ts +4 -1
  12. package/dist/commands/storeIntegration.svelte.js +26 -21
  13. package/dist/commands/types.d.ts +2 -0
  14. package/dist/components/App.svelte +163 -192
  15. package/dist/components/App.svelte.d.ts +47 -8
  16. package/dist/components/ConfigForm.svelte +77 -49
  17. package/dist/components/ConfigModal.svelte +7 -2
  18. package/dist/components/ConnectionLine.svelte +4 -2
  19. package/dist/components/Navbar.svelte +61 -1
  20. package/dist/components/NodeSidebar.svelte +27 -45
  21. package/dist/components/NodeStatusOverlay.svelte +94 -6
  22. package/dist/components/NodeSwapPicker.svelte +10 -8
  23. package/dist/components/PipelineStatus.svelte +22 -68
  24. package/dist/components/PipelineStatus.svelte.d.ts +3 -0
  25. package/dist/components/PortCoordinateTracker.svelte +5 -6
  26. package/dist/components/SchemaForm.stories.svelte +1 -3
  27. package/dist/components/SchemaForm.svelte +22 -27
  28. package/dist/components/SchemaForm.svelte.d.ts +0 -8
  29. package/dist/components/SettingsModal.svelte +8 -3
  30. package/dist/components/SettingsPanel.svelte +20 -4
  31. package/dist/components/SwapMappingEditor.svelte +67 -49
  32. package/dist/components/SwapMappingEditor.svelte.d.ts +0 -2
  33. package/dist/components/UniversalNode.svelte +9 -7
  34. package/dist/components/WorkflowEditor.svelte +121 -111
  35. package/dist/components/WorkflowEditor.svelte.d.ts +21 -10
  36. package/dist/components/chat/AIChatPanel.svelte +98 -89
  37. package/dist/components/chat/AIChatPanel.svelte.d.ts +0 -4
  38. package/dist/components/chat/CommandPreview.svelte +2 -1
  39. package/dist/components/console/CommandConsole.svelte +7 -5
  40. package/dist/components/console/ConsoleAutocomplete.svelte +10 -11
  41. package/dist/components/console/ConsoleAutocomplete.svelte.d.ts +6 -0
  42. package/dist/components/console/ConsoleInput.svelte +15 -6
  43. package/dist/components/console/ConsoleOutput.svelte +2 -1
  44. package/dist/components/form/FormArray.svelte +5 -9
  45. package/dist/components/form/FormArray.svelte.d.ts +2 -1
  46. package/dist/components/form/FormAutocomplete.svelte +16 -15
  47. package/dist/components/form/FormField.svelte +4 -2
  48. package/dist/components/form/FormFieldLight.svelte +34 -3
  49. package/dist/components/form/FormFieldLight.svelte.d.ts +12 -0
  50. package/dist/components/form/FormMarkdownEditor.svelte +9 -4
  51. package/dist/components/form/FormRangeField.svelte +1 -0
  52. package/dist/components/form/FormTemplateEditor.svelte +11 -3
  53. package/dist/components/form/FormToggle.svelte +5 -12
  54. package/dist/components/form/FormToggle.svelte.d.ts +4 -2
  55. package/dist/components/form/FormUISchemaRenderer.svelte +3 -1
  56. package/dist/components/form/templateAutocomplete.js +1 -5
  57. package/dist/components/form/types.d.ts +1 -14
  58. package/dist/components/interrupt/FormPrompt.svelte +3 -2
  59. package/dist/components/interrupt/InterruptBubble.svelte +25 -17
  60. package/dist/components/interrupt/ReviewPrompt.svelte +10 -3
  61. package/dist/components/interrupt/TextInputPrompt.svelte +2 -1
  62. package/dist/components/layouts/MainLayout.svelte +20 -13
  63. package/dist/components/layouts/MainLayout.svelte.d.ts +4 -0
  64. package/dist/components/nodes/AtomNode.svelte +17 -5
  65. package/dist/components/nodes/GatewayNode.svelte +19 -10
  66. package/dist/components/nodes/IdeaNode.svelte +7 -0
  67. package/dist/components/nodes/SimpleNode.svelte +11 -6
  68. package/dist/components/nodes/SquareNode.svelte +15 -8
  69. package/dist/components/nodes/TerminalNode.svelte +9 -4
  70. package/dist/components/nodes/ToolNode.svelte +7 -1
  71. package/dist/components/nodes/WorkflowNode.svelte +16 -7
  72. package/dist/components/playground/ChatInput.svelte +11 -14
  73. package/dist/components/playground/ChatPanel.svelte +6 -49
  74. package/dist/components/playground/ChatPanel.svelte.d.ts +0 -14
  75. package/dist/components/playground/ControlPanel.svelte +134 -123
  76. package/dist/components/playground/ControlPanel.svelte.d.ts +3 -0
  77. package/dist/components/playground/ExecutionLogs.svelte +11 -9
  78. package/dist/components/playground/InputCollector.svelte +11 -9
  79. package/dist/components/playground/MessageStream.svelte +17 -23
  80. package/dist/components/playground/PipelineKanbanView.svelte +69 -8
  81. package/dist/components/playground/PipelineKanbanView.svelte.d.ts +2 -0
  82. package/dist/components/playground/PipelinePanel.svelte +31 -8
  83. package/dist/components/playground/PipelinePanel.svelte.d.ts +2 -0
  84. package/dist/components/playground/PipelineTableView.svelte +188 -44
  85. package/dist/components/playground/PipelineTableView.svelte.d.ts +2 -0
  86. package/dist/components/playground/Playground.svelte +154 -105
  87. package/dist/components/playground/Playground.svelte.d.ts +5 -0
  88. package/dist/components/playground/PlaygroundApp.svelte +11 -1
  89. package/dist/components/playground/PlaygroundApp.svelte.d.ts +6 -0
  90. package/dist/components/playground/PlaygroundModal.svelte +18 -3
  91. package/dist/components/playground/PlaygroundModal.svelte.d.ts +6 -0
  92. package/dist/components/playground/PlaygroundStudio.svelte +40 -32
  93. package/dist/components/playground/PlaygroundStudio.svelte.d.ts +6 -0
  94. package/dist/components/playground/SessionManager.svelte +9 -12
  95. package/dist/components/playground/pipelineViewUtils.svelte.d.ts +30 -1
  96. package/dist/components/playground/pipelineViewUtils.svelte.js +40 -3
  97. package/dist/config/endpoints.d.ts +23 -7
  98. package/dist/config/endpoints.js +30 -10
  99. package/dist/core/index.d.ts +5 -6
  100. package/dist/core/index.js +8 -12
  101. package/dist/display/index.d.ts +6 -3
  102. package/dist/display/index.js +7 -5
  103. package/dist/editor/index.d.ts +20 -21
  104. package/dist/editor/index.js +26 -36
  105. package/dist/form/code.d.ts +25 -15
  106. package/dist/form/code.js +44 -41
  107. package/dist/form/fieldRegistry.d.ts +17 -13
  108. package/dist/form/fieldRegistry.js +32 -12
  109. package/dist/form/full.d.ts +19 -14
  110. package/dist/form/full.js +26 -28
  111. package/dist/form/index.d.ts +3 -4
  112. package/dist/form/index.js +6 -5
  113. package/dist/form/markdown.d.ts +13 -8
  114. package/dist/form/markdown.js +22 -23
  115. package/dist/helpers/proximityConnect.d.ts +3 -2
  116. package/dist/helpers/proximityConnect.js +2 -5
  117. package/dist/helpers/workflowEditorHelper.d.ts +14 -5
  118. package/dist/helpers/workflowEditorHelper.js +28 -25
  119. package/dist/index.d.ts +28 -24
  120. package/dist/index.js +27 -50
  121. package/dist/messages/defaults.d.ts +2 -5
  122. package/dist/messages/defaults.js +3 -6
  123. package/dist/messages/index.d.ts +0 -1
  124. package/dist/messages/index.js +0 -1
  125. package/dist/mocks/app-forms.d.ts +6 -2
  126. package/dist/mocks/app-forms.js +11 -4
  127. package/dist/openapi/v1/openapi.yaml +3 -3
  128. package/dist/playground/index.d.ts +4 -5
  129. package/dist/playground/index.js +4 -32
  130. package/dist/playground/mount.d.ts +25 -0
  131. package/dist/playground/mount.js +50 -20
  132. package/dist/registry/{BaseRegistry.d.ts → BaseRegistry.svelte.d.ts} +22 -1
  133. package/dist/registry/{BaseRegistry.js → BaseRegistry.svelte.js} +37 -1
  134. package/dist/registry/builtinFormats.d.ts +9 -18
  135. package/dist/registry/builtinFormats.js +9 -39
  136. package/dist/registry/builtinNodeTypes.d.ts +53 -0
  137. package/dist/registry/builtinNodeTypes.js +67 -0
  138. package/dist/registry/builtinNodes.d.ts +2 -64
  139. package/dist/registry/builtinNodes.js +7 -103
  140. package/dist/registry/index.d.ts +3 -4
  141. package/dist/registry/index.js +4 -6
  142. package/dist/registry/nodeComponentRegistry.d.ts +182 -15
  143. package/dist/registry/nodeComponentRegistry.js +235 -17
  144. package/dist/registry/workflowFormatRegistry.d.ts +14 -9
  145. package/dist/registry/workflowFormatRegistry.js +24 -8
  146. package/dist/{schema → schemas}/index.d.ts +2 -2
  147. package/dist/{schema → schemas}/index.js +2 -2
  148. package/dist/schemas/v1/workflow.schema.json +3 -3
  149. package/dist/services/agentSpecExecutionService.d.ts +0 -2
  150. package/dist/services/agentSpecExecutionService.js +0 -3
  151. package/dist/services/apiVariableService.d.ts +2 -1
  152. package/dist/services/apiVariableService.js +16 -47
  153. package/dist/services/autoSaveService.d.ts +7 -0
  154. package/dist/services/autoSaveService.js +6 -4
  155. package/dist/services/categoriesApi.js +3 -6
  156. package/dist/services/chatService.d.ts +9 -4
  157. package/dist/services/chatService.js +23 -28
  158. package/dist/services/draftStorage.d.ts +129 -13
  159. package/dist/services/draftStorage.js +185 -37
  160. package/dist/services/dynamicSchemaService.d.ts +2 -1
  161. package/dist/services/dynamicSchemaService.js +5 -22
  162. package/dist/services/globalSave.d.ts +13 -12
  163. package/dist/services/globalSave.js +29 -51
  164. package/dist/services/historyService.d.ts +9 -3
  165. package/dist/services/historyService.js +9 -3
  166. package/dist/services/interruptService.d.ts +15 -9
  167. package/dist/services/interruptService.js +35 -37
  168. package/dist/services/nodeExecutionService.d.ts +18 -3
  169. package/dist/services/nodeExecutionService.js +71 -45
  170. package/dist/services/playgroundService.d.ts +16 -10
  171. package/dist/services/playgroundService.js +42 -43
  172. package/dist/services/portConfigApi.js +3 -6
  173. package/dist/services/settingsService.d.ts +9 -4
  174. package/dist/services/settingsService.js +23 -12
  175. package/dist/services/variableService.d.ts +2 -1
  176. package/dist/services/variableService.js +2 -2
  177. package/dist/services/workflowStorage.js +6 -6
  178. package/dist/stores/apiContext.d.ts +56 -0
  179. package/dist/stores/apiContext.js +80 -0
  180. package/dist/stores/categoriesStore.svelte.d.ts +28 -23
  181. package/dist/stores/categoriesStore.svelte.js +69 -64
  182. package/dist/stores/getInstance.svelte.d.ts +39 -0
  183. package/dist/stores/getInstance.svelte.js +65 -0
  184. package/dist/stores/historyStore.svelte.d.ts +77 -93
  185. package/dist/stores/historyStore.svelte.js +134 -160
  186. package/dist/stores/instanceContainer.svelte.d.ts +111 -0
  187. package/dist/stores/instanceContainer.svelte.js +114 -0
  188. package/dist/stores/interruptStore.svelte.d.ts +112 -82
  189. package/dist/stores/interruptStore.svelte.js +253 -226
  190. package/dist/stores/pipelinePanelStore.svelte.d.ts +27 -3
  191. package/dist/stores/pipelinePanelStore.svelte.js +61 -14
  192. package/dist/stores/playgroundStore.svelte.d.ts +169 -222
  193. package/dist/stores/playgroundStore.svelte.js +513 -580
  194. package/dist/stores/portCoordinateStore.svelte.d.ts +57 -51
  195. package/dist/stores/portCoordinateStore.svelte.js +109 -98
  196. package/dist/stores/settingsStore.svelte.d.ts +4 -1
  197. package/dist/stores/settingsStore.svelte.js +47 -12
  198. package/dist/stores/workflowStore.svelte.d.ts +178 -213
  199. package/dist/stores/workflowStore.svelte.js +449 -501
  200. package/dist/stories/EdgeDecorator.svelte +5 -2
  201. package/dist/stories/NodeDecorator.svelte +5 -3
  202. package/dist/svelte-app.d.ts +60 -10
  203. package/dist/svelte-app.js +159 -54
  204. package/dist/types/auth.d.ts +9 -51
  205. package/dist/types/auth.js +4 -54
  206. package/dist/types/events.d.ts +6 -3
  207. package/dist/types/index.d.ts +37 -5
  208. package/dist/types/index.js +0 -1
  209. package/dist/types/navbar.d.ts +7 -0
  210. package/dist/types/playground.d.ts +18 -3
  211. package/dist/types/settings.d.ts +13 -0
  212. package/dist/types/settings.js +1 -0
  213. package/dist/utils/colors.d.ts +47 -21
  214. package/dist/utils/colors.js +69 -68
  215. package/dist/utils/connections.d.ts +9 -15
  216. package/dist/utils/connections.js +13 -32
  217. package/dist/utils/duration.d.ts +13 -0
  218. package/dist/utils/duration.js +45 -0
  219. package/dist/utils/edgeStyling.js +9 -5
  220. package/dist/utils/fetchWithAuth.d.ts +36 -15
  221. package/dist/utils/fetchWithAuth.js +53 -23
  222. package/dist/utils/icons.d.ts +5 -2
  223. package/dist/utils/icons.js +6 -5
  224. package/dist/utils/nodeSwap.d.ts +6 -2
  225. package/dist/utils/nodeSwap.js +62 -126
  226. package/dist/utils/nodeTypes.d.ts +17 -8
  227. package/dist/utils/nodeTypes.js +27 -20
  228. package/dist/utils/performanceUtils.js +7 -0
  229. package/package.json +7 -5
  230. package/dist/messages/deprecation.d.ts +0 -20
  231. package/dist/messages/deprecation.js +0 -33
  232. package/dist/registry/plugin.d.ts +0 -215
  233. package/dist/registry/plugin.js +0 -249
  234. package/dist/services/api.d.ts +0 -129
  235. package/dist/services/api.js +0 -217
@@ -0,0 +1,114 @@
1
+ /**
2
+ * FlowDrop Instance Container
3
+ *
4
+ * Holds all per-instance state for one FlowDrop editor: workflow state,
5
+ * undo/redo history, playground sessions, interrupts, port coordinates,
6
+ * categories, and pipeline panel state. Creating one container per mount is
7
+ * what allows multiple FlowDrop editors to coexist on a single page.
8
+ *
9
+ * The container is provided to the component tree via Svelte context (see
10
+ * `getInstance.svelte.ts`). A lazily-created, browser-only default instance
11
+ * backs the legacy module-level store APIs so existing single-instance
12
+ * consumers keep working unchanged.
13
+ *
14
+ * @module stores/instanceContainer
15
+ */
16
+ import { HistoryService, historyService } from '../services/historyService.js';
17
+ import { WorkflowStore } from './workflowStore.svelte.js';
18
+ import { HistoryStore } from './historyStore.svelte.js';
19
+ import { PlaygroundStore } from './playgroundStore.svelte.js';
20
+ import { InterruptStore } from './interruptStore.svelte.js';
21
+ import { CategoriesStore } from './categoriesStore.svelte.js';
22
+ import { PortCoordinateStore } from './portCoordinateStore.svelte.js';
23
+ import { PipelinePanelStore } from './pipelinePanelStore.svelte.js';
24
+ import { ApiContext } from './apiContext.js';
25
+ import { PortCompatibilityChecker } from '../utils/connections.js';
26
+ import { DEFAULT_PORT_CONFIG } from '../config/defaultPortConfig.js';
27
+ import { NodeComponentRegistry } from '../registry/nodeComponentRegistry.js';
28
+ import { FieldComponentRegistry } from '../form/fieldRegistry.js';
29
+ import { WorkflowFormatRegistry } from '../registry/workflowFormatRegistry.js';
30
+ import { BUILTIN_NODE_COMPONENTS } from '../registry/builtinNodes.js';
31
+ import { getBuiltinFormatAdapters } from '../registry/builtinFormats.js';
32
+ /** Storage key prefix shared by the default instance and legacy consumers. */
33
+ export const DEFAULT_DRAFT_PREFIX = 'flowdrop:draft';
34
+ // Feeds auto-generated ids only (`fd-1`, `fd-2`, …) — cosmetic monotonicity.
35
+ // Incrementing across SSR requests is harmless; no state hangs off the value.
36
+ let instanceCounter = 0;
37
+ /**
38
+ * Create a fully wired FlowDrop instance.
39
+ *
40
+ * Creation order matters: history first, then stores that depend on it
41
+ * (constructor injection — no module-singleton imports).
42
+ */
43
+ export function createFlowDropInstance(options = {}) {
44
+ const isDefault = options.isDefault ?? false;
45
+ const id = options.id ?? (isDefault ? 'default' : `fd-${++instanceCounter}`);
46
+ // Every instance gets an id-scoped prefix — the default instance's 1.x bare
47
+ // keys are migrated on first read (see migrateLegacyDraftKey / PipelinePanelStore.init).
48
+ const storagePrefix = `${DEFAULT_DRAFT_PREFIX}:${id}`;
49
+ // The default instance reuses the exported singleton (public API via
50
+ // `@flowdrop/flowdrop/editor`) so external `historyService.undo()` etc.
51
+ // keep operating on the default editor's history stack.
52
+ const history = isDefault ? historyService : new HistoryService();
53
+ const workflow = new WorkflowStore(history);
54
+ const historyBindings = new HistoryStore(history);
55
+ // Default wiring: undo/redo restores into this instance's workflow store.
56
+ // WorkflowEditor overrides this with a richer callback while mounted.
57
+ historyBindings.setOnRestoreCallback((restored) => workflow.restoreFromHistory(restored));
58
+ const playground = new PlaygroundStore();
59
+ const cleanups = [
60
+ () => historyBindings.cleanup(),
61
+ () => historyBindings.setOnRestoreCallback(null),
62
+ () => workflow.setOnDirtyStateChange(null),
63
+ () => workflow.setOnWorkflowChange(null),
64
+ () => playground.dispose()
65
+ ];
66
+ return {
67
+ id,
68
+ storagePrefix,
69
+ isDefault,
70
+ history,
71
+ workflow,
72
+ historyBindings,
73
+ playground,
74
+ interrupts: new InterruptStore(),
75
+ api: new ApiContext(),
76
+ nodes: new NodeComponentRegistry({
77
+ registrations: BUILTIN_NODE_COMPONENTS,
78
+ defaultType: 'workflowNode'
79
+ }),
80
+ fields: new FieldComponentRegistry(),
81
+ formats: new WorkflowFormatRegistry(getBuiltinFormatAdapters()),
82
+ categories: new CategoriesStore(),
83
+ portCoordinates: new PortCoordinateStore(),
84
+ portCompatibility: new PortCompatibilityChecker(DEFAULT_PORT_CONFIG),
85
+ // The default instance keeps the legacy bare localStorage key.
86
+ pipelinePanel: new PipelinePanelStore(id),
87
+ destroy() {
88
+ while (cleanups.length > 0) {
89
+ cleanups.pop()?.();
90
+ }
91
+ }
92
+ };
93
+ }
94
+ // =========================================================================
95
+ // Default instance (backward compatibility)
96
+ // =========================================================================
97
+ let defaultInstance = null;
98
+ /**
99
+ * Get the page-default FlowDrop instance, creating it on first access.
100
+ *
101
+ * **Browser-only.** Reactive per-user state must never live at module scope
102
+ * on the server — a module-level default would leak between SvelteKit
103
+ * requests. Server renders must provide an instance via context instead
104
+ * (`<App>` and `<WorkflowEditor>` do this automatically).
105
+ */
106
+ export function getDefaultInstance() {
107
+ if (typeof window === 'undefined') {
108
+ throw new Error('[flowdrop] The default FlowDrop instance is browser-only to prevent ' +
109
+ 'cross-request state leakage during SSR. Render inside <App> or ' +
110
+ '<WorkflowEditor> (which provide an instance via context), or pass ' +
111
+ 'an explicit instance.');
112
+ }
113
+ return (defaultInstance ??= createFlowDropInstance({ isDefault: true }));
114
+ }
@@ -4,6 +4,9 @@
4
4
  * Rune-based reactive state for managing interrupt state using a lightweight state machine.
5
5
  * Ensures valid state transitions and prevents deadlocks.
6
6
  *
7
+ * The reactive state lives in the {@link InterruptStore} class — one per
8
+ * FlowDrop instance, resolved in components via `getInstance().interrupts`.
9
+ *
7
10
  * @module stores/interruptStore
8
11
  */
9
12
  import { SvelteMap } from 'svelte/reactivity';
@@ -17,46 +20,73 @@ export interface InterruptWithState extends Interrupt {
17
20
  machineState: InterruptState;
18
21
  }
19
22
  /**
20
- * Get the reactive interrupts map.
21
- * Use this in components within $derived() for reactivity.
22
- */
23
- export declare function getInterruptsMap(): SvelteMap<string, InterruptWithState>;
24
- /**
25
- * Get pending interrupt IDs (interrupts not in a terminal state)
26
- */
27
- export declare function getPendingInterruptIds(): string[];
28
- /**
29
- * Get pending interrupts array (interrupts not in a terminal state)
30
- */
31
- export declare function getPendingInterrupts(): InterruptWithState[];
32
- /**
33
- * Get count of pending interrupts
34
- */
35
- export declare function getPendingInterruptCount(): number;
36
- /**
37
- * Get resolved interrupts array
23
+ * Interrupt store actions for modifying state.
38
24
  */
39
- export declare function getResolvedInterrupts(): InterruptWithState[];
40
- /**
41
- * Check if any interrupt is currently submitting
42
- */
43
- export declare function getIsAnySubmitting(): boolean;
25
+ export interface InterruptStoreActions {
26
+ addInterrupt: (interrupt: Interrupt) => void;
27
+ addInterrupts: (interruptList: Interrupt[]) => void;
28
+ startSubmit: (interruptId: string, value: unknown) => TransitionResult;
29
+ startCancel: (interruptId: string) => TransitionResult;
30
+ submitSuccess: (interruptId: string) => TransitionResult;
31
+ submitFailure: (interruptId: string, error: string) => TransitionResult;
32
+ retry: (interruptId: string) => TransitionResult;
33
+ resetInterrupt: (interruptId: string) => TransitionResult;
34
+ resolveInterrupt: (interruptId: string, value: unknown) => void;
35
+ cancelInterrupt: (interruptId: string) => void;
36
+ removeInterrupt: (interruptId: string) => void;
37
+ clearSessionInterrupts: (sessionId: string) => void;
38
+ clearInterrupts: () => void;
39
+ reset: () => void;
40
+ }
44
41
  /**
45
- * Interrupt store actions for modifying state
42
+ * Per-instance interrupt state, managed via a lightweight state machine.
43
+ *
44
+ * Reads go through getter methods backed by a {@link SvelteMap}, so reading
45
+ * them inside a component template or `$derived` tracks reactively, exactly
46
+ * like the legacy module-level functions did.
46
47
  */
47
- export declare const interruptActions: {
48
+ export declare class InterruptStore {
49
+ #private;
50
+ /** Bound mutation facade — see {@link InterruptStoreActions}. */
51
+ readonly actions: InterruptStoreActions;
52
+ constructor();
53
+ /**
54
+ * Get the reactive interrupts map.
55
+ * Use this in components within $derived() for reactivity.
56
+ */
57
+ getMap(): SvelteMap<string, InterruptWithState>;
58
+ /**
59
+ * Get pending interrupt IDs (interrupts not in a terminal state)
60
+ */
61
+ getPendingIds(): string[];
62
+ /**
63
+ * Get pending interrupts array (interrupts not in a terminal state)
64
+ */
65
+ getPending(): InterruptWithState[];
66
+ /**
67
+ * Get count of pending interrupts
68
+ */
69
+ getPendingCount(): number;
70
+ /**
71
+ * Get resolved interrupts array
72
+ */
73
+ getResolved(): InterruptWithState[];
74
+ /**
75
+ * Check if any interrupt is currently submitting
76
+ */
77
+ getIsAnySubmitting(): boolean;
48
78
  /**
49
79
  * Add or update an interrupt in the store
50
80
  *
51
81
  * @param interrupt - The interrupt to add or update
52
82
  */
53
- addInterrupt: (interrupt: Interrupt) => void;
83
+ addInterrupt(interrupt: Interrupt): void;
54
84
  /**
55
85
  * Add multiple interrupts to the store
56
86
  *
57
87
  * @param interruptList - Array of interrupts to add
58
88
  */
59
- addInterrupts: (interruptList: Interrupt[]) => void;
89
+ addInterrupts(interruptList: Interrupt[]): void;
60
90
  /**
61
91
  * Start submitting an interrupt (user clicked submit)
62
92
  *
@@ -64,21 +94,21 @@ export declare const interruptActions: {
64
94
  * @param value - The value being submitted
65
95
  * @returns Transition result
66
96
  */
67
- startSubmit: (interruptId: string, value: unknown) => TransitionResult;
97
+ startSubmit(interruptId: string, value: unknown): TransitionResult;
68
98
  /**
69
99
  * Start cancelling an interrupt (user clicked cancel)
70
100
  *
71
101
  * @param interruptId - The interrupt ID
72
102
  * @returns Transition result
73
103
  */
74
- startCancel: (interruptId: string) => TransitionResult;
104
+ startCancel(interruptId: string): TransitionResult;
75
105
  /**
76
106
  * Mark submission as successful
77
107
  *
78
108
  * @param interruptId - The interrupt ID
79
109
  * @returns Transition result
80
110
  */
81
- submitSuccess: (interruptId: string) => TransitionResult;
111
+ submitSuccess(interruptId: string): TransitionResult;
82
112
  /**
83
113
  * Mark submission as failed
84
114
  *
@@ -86,94 +116,94 @@ export declare const interruptActions: {
86
116
  * @param error - Error message
87
117
  * @returns Transition result
88
118
  */
89
- submitFailure: (interruptId: string, error: string) => TransitionResult;
119
+ submitFailure(interruptId: string, error: string): TransitionResult;
90
120
  /**
91
121
  * Retry a failed submission
92
122
  *
93
123
  * @param interruptId - The interrupt ID
94
124
  * @returns Transition result
95
125
  */
96
- retry: (interruptId: string) => TransitionResult;
126
+ retry(interruptId: string): TransitionResult;
97
127
  /**
98
128
  * Reset an interrupt to idle state
99
129
  *
100
130
  * @param interruptId - The interrupt ID
101
131
  * @returns Transition result
102
132
  */
103
- resetInterrupt: (interruptId: string) => TransitionResult;
133
+ resetInterrupt(interruptId: string): TransitionResult;
104
134
  /**
105
135
  * Mark an interrupt as resolved with the user's response
106
136
  *
107
137
  * @param interruptId - The interrupt ID
108
138
  * @param value - The resolved value
109
139
  */
110
- resolveInterrupt: (interruptId: string, value: unknown) => void;
140
+ resolveInterrupt(interruptId: string, value: unknown): void;
111
141
  /**
112
142
  * Mark an interrupt as cancelled
113
143
  *
114
144
  * @param interruptId - The interrupt ID
115
145
  */
116
- cancelInterrupt: (interruptId: string) => void;
146
+ cancelInterrupt(interruptId: string): void;
117
147
  /**
118
148
  * Remove an interrupt from the store
119
149
  *
120
150
  * @param interruptId - The interrupt ID to remove
121
151
  */
122
- removeInterrupt: (interruptId: string) => void;
152
+ removeInterrupt(interruptId: string): void;
123
153
  /**
124
154
  * Clear all interrupts for a specific session
125
155
  *
126
156
  * @param sessionId - The session ID to clear interrupts for
127
157
  */
128
- clearSessionInterrupts: (sessionId: string) => void;
158
+ clearSessionInterrupts(sessionId: string): void;
129
159
  /**
130
160
  * Alias for clearSessionInterrupts
131
161
  */
132
- clearInterrupts: () => void;
162
+ clearInterrupts(): void;
133
163
  /**
134
164
  * Reset all interrupt state
135
165
  */
136
- reset: () => void;
137
- };
138
- /**
139
- * Get an interrupt by ID
140
- *
141
- * @param interruptId - The interrupt ID
142
- * @returns The interrupt or undefined
143
- */
144
- export declare function getInterrupt(interruptId: string): InterruptWithState | undefined;
145
- /**
146
- * Check if an interrupt is pending (not resolved or cancelled)
147
- *
148
- * @param interruptId - The interrupt ID
149
- * @returns True if the interrupt exists and is pending
150
- */
151
- export declare function isInterruptPending(interruptId: string): boolean;
152
- /**
153
- * Check if an interrupt is currently submitting
154
- *
155
- * @param interruptId - The interrupt ID
156
- * @returns True if the interrupt is being submitted
157
- */
158
- export declare function isInterruptSubmitting(interruptId: string): boolean;
159
- /**
160
- * Get the error for an interrupt
161
- *
162
- * @param interruptId - The interrupt ID
163
- * @returns The error message or undefined
164
- */
165
- export declare function getInterruptError(interruptId: string): string | undefined;
166
- /**
167
- * Get an interrupt by its associated message ID
168
- *
169
- * @param messageId - The message ID
170
- * @returns The interrupt or undefined
171
- */
172
- export declare function getInterruptByMessageId(messageId: string): InterruptWithState | undefined;
173
- /**
174
- * Check if an interrupt has an error
175
- *
176
- * @param interruptId - The interrupt ID
177
- * @returns True if the interrupt has an error
178
- */
179
- export declare function interruptHasError(interruptId: string): boolean;
166
+ reset(): void;
167
+ /**
168
+ * Get an interrupt by ID
169
+ *
170
+ * @param interruptId - The interrupt ID
171
+ * @returns The interrupt or undefined
172
+ */
173
+ getInterrupt(interruptId: string): InterruptWithState | undefined;
174
+ /**
175
+ * Check if an interrupt is pending (not resolved or cancelled)
176
+ *
177
+ * @param interruptId - The interrupt ID
178
+ * @returns True if the interrupt exists and is pending
179
+ */
180
+ isPending(interruptId: string): boolean;
181
+ /**
182
+ * Check if an interrupt is currently submitting
183
+ *
184
+ * @param interruptId - The interrupt ID
185
+ * @returns True if the interrupt is being submitted
186
+ */
187
+ isSubmitting(interruptId: string): boolean;
188
+ /**
189
+ * Get the error for an interrupt
190
+ *
191
+ * @param interruptId - The interrupt ID
192
+ * @returns The error message or undefined
193
+ */
194
+ getError(interruptId: string): string | undefined;
195
+ /**
196
+ * Get an interrupt by its associated message ID
197
+ *
198
+ * @param messageId - The message ID
199
+ * @returns The interrupt or undefined
200
+ */
201
+ getByMessageId(messageId: string): InterruptWithState | undefined;
202
+ /**
203
+ * Check if an interrupt has an error
204
+ *
205
+ * @param interruptId - The interrupt ID
206
+ * @returns True if the interrupt has an error
207
+ */
208
+ hasError(interruptId: string): boolean;
209
+ }