@elqnt/workflow 2.1.0 → 2.1.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.
package/README.md ADDED
@@ -0,0 +1,235 @@
1
+ # @elqnt/workflow
2
+
3
+ Workflow definitions and execution for Eloquent platform. Provides models, API functions, and React hooks for building and managing workflows.
4
+
5
+ ## Installation
6
+
7
+ ```bash
8
+ pnpm add @elqnt/workflow
9
+ ```
10
+
11
+ ## Quick Start
12
+
13
+ ### Using React Hooks
14
+
15
+ ```typescript
16
+ import { useWorkflows, useWorkflowInstances } from "@elqnt/workflow/hooks";
17
+
18
+ function WorkflowManager() {
19
+ const { listWorkflows, createWorkflow, loading, error } = useWorkflows({
20
+ baseUrl: process.env.NEXT_PUBLIC_API_GATEWAY_URL!,
21
+ orgId: currentOrgId,
22
+ });
23
+
24
+ const { createInstance, executeNode } = useWorkflowInstances({
25
+ baseUrl: process.env.NEXT_PUBLIC_API_GATEWAY_URL!,
26
+ orgId: currentOrgId,
27
+ });
28
+
29
+ // List all workflows
30
+ const workflows = await listWorkflows();
31
+
32
+ // Create a new workflow instance and execute
33
+ const instance = await createInstance(workflowId, {
34
+ variables: { customerId: "123" },
35
+ autoExecute: true,
36
+ });
37
+ }
38
+ ```
39
+
40
+ ### Using API Functions Directly
41
+
42
+ ```typescript
43
+ import {
44
+ listWorkflowsApi,
45
+ createWorkflowApi,
46
+ createWorkflowInstanceApi,
47
+ } from "@elqnt/workflow/api";
48
+
49
+ const response = await listWorkflowsApi({
50
+ baseUrl: "https://api.elqnt.ai",
51
+ orgId: "org-uuid",
52
+ });
53
+
54
+ if (response.data) {
55
+ console.log("Workflows:", response.data.definitions);
56
+ }
57
+ ```
58
+
59
+ ## Exports
60
+
61
+ | Import Path | Description |
62
+ |-------------|-------------|
63
+ | `@elqnt/workflow` | All exports |
64
+ | `@elqnt/workflow/api` | Browser API functions |
65
+ | `@elqnt/workflow/hooks` | React hooks |
66
+ | `@elqnt/workflow/models` | TypeScript types (generated from Go via tygo) |
67
+
68
+ ## API Reference
69
+
70
+ ### API Functions (`@elqnt/workflow/api`)
71
+
72
+ #### Workflow Definitions
73
+
74
+ | Function | Description |
75
+ |----------|-------------|
76
+ | `listWorkflowsApi(options)` | List all workflow definitions |
77
+ | `getWorkflowApi(workflowId, options)` | Get a specific workflow |
78
+ | `createWorkflowApi(workflow, options)` | Create a new workflow |
79
+ | `updateWorkflowApi(workflowId, workflow, options)` | Update a workflow |
80
+ | `deleteWorkflowApi(workflowId, options)` | Delete a workflow |
81
+
82
+ #### Workflow Instances
83
+
84
+ | Function | Description |
85
+ |----------|-------------|
86
+ | `createWorkflowInstanceApi(definitionId, data, options)` | Create and optionally start an instance |
87
+ | `getWorkflowInstanceApi(instanceId, options)` | Get instance details |
88
+ | `listWorkflowInstancesApi(definitionId, options)` | List instances for a workflow |
89
+ | `updateWorkflowInstanceStatusApi(instanceId, status, options)` | Update instance status |
90
+ | `executeWorkflowNodeApi(instanceId, nodeId, input, options)` | Execute a specific node |
91
+ | `resumeWorkflowNodeApi(instanceId, nodeId, result, options)` | Resume a waiting node |
92
+ | `retryWorkflowNodeApi(instanceId, nodeId, options)` | Retry a failed node |
93
+
94
+ #### Workflow Templates
95
+
96
+ | Function | Description |
97
+ |----------|-------------|
98
+ | `listWorkflowTemplatesApi(options)` | List available templates |
99
+ | `getWorkflowTemplateApi(templateId, options)` | Get template details |
100
+ | `instantiateWorkflowTemplateApi(templateId, params, options)` | Create workflow from template |
101
+
102
+ ### React Hooks (`@elqnt/workflow/hooks`)
103
+
104
+ #### `useWorkflows(options)`
105
+
106
+ Hook for workflow definition CRUD operations.
107
+
108
+ ```typescript
109
+ const {
110
+ loading, // boolean - operation in progress
111
+ error, // string | null - error message
112
+ listWorkflows, // () => Promise<WorkflowDefinition[]>
113
+ getWorkflow, // (id) => Promise<WorkflowDefinition | null>
114
+ createWorkflow, // (workflow) => Promise<WorkflowDefinition | null>
115
+ updateWorkflow, // (id, workflow) => Promise<WorkflowDefinition | null>
116
+ deleteWorkflow, // (id) => Promise<boolean>
117
+ } = useWorkflows({ baseUrl, orgId });
118
+ ```
119
+
120
+ #### `useWorkflowInstances(options)`
121
+
122
+ Hook for workflow instance operations.
123
+
124
+ ```typescript
125
+ const {
126
+ loading,
127
+ error,
128
+ listInstances, // (definitionId, filters?) => Promise<WorkflowInstance[]>
129
+ getInstance, // (instanceId) => Promise<WorkflowInstance | null>
130
+ createInstance, // (definitionId, data?) => Promise<WorkflowInstance | null>
131
+ updateStatus, // (instanceId, status) => Promise<WorkflowInstance | null>
132
+ executeNode, // (instanceId, nodeId, input) => Promise<object | null>
133
+ resumeNode, // (instanceId, nodeId, result) => Promise<WorkflowInstance | null>
134
+ retryNode, // (instanceId, nodeId) => Promise<WorkflowInstance | null>
135
+ } = useWorkflowInstances({ baseUrl, orgId });
136
+ ```
137
+
138
+ #### `useWorkflowTemplates(options)`
139
+
140
+ Hook for workflow template operations.
141
+
142
+ ```typescript
143
+ const {
144
+ loading,
145
+ error,
146
+ listTemplates, // (category?) => Promise<WorkflowTemplate[]>
147
+ getTemplate, // (templateId) => Promise<WorkflowTemplate | null>
148
+ instantiateTemplate, // (templateId, params) => Promise<WorkflowDefinition | null>
149
+ } = useWorkflowTemplates({ baseUrl, orgId });
150
+ ```
151
+
152
+ ## Types (`@elqnt/workflow/models`)
153
+
154
+ Key types generated from Go via tygo:
155
+
156
+ ```typescript
157
+ import type {
158
+ // Definitions
159
+ WorkflowDefinition,
160
+ WorkflowNode,
161
+ WorkflowEdge,
162
+ WorkflowVariables,
163
+ NodeDefinition,
164
+
165
+ // Instances
166
+ WorkflowInstance,
167
+ InstanceState,
168
+ NodeState,
169
+ ExecutionContext,
170
+
171
+ // Status enums
172
+ InstanceStatus,
173
+ NodeStatus,
174
+ EdgeStatus,
175
+
176
+ // Node types
177
+ NodeType,
178
+ NodeSubType,
179
+ EdgeType,
180
+ WorkflowType,
181
+ } from "@elqnt/workflow/models";
182
+ ```
183
+
184
+ ### Instance Status
185
+
186
+ ```typescript
187
+ const InstanceStatusNew: InstanceStatus = "NEW";
188
+ const InstanceStatusRunning: InstanceStatus = "RUNNING";
189
+ const InstanceStatusWaiting: InstanceStatus = "WAITING";
190
+ const InstanceStatusPaused: InstanceStatus = "PAUSED";
191
+ const InstanceStatusCompleted: InstanceStatus = "COMPLETED";
192
+ const InstanceStatusFailed: InstanceStatus = "FAILED";
193
+ ```
194
+
195
+ ### Node Types
196
+
197
+ ```typescript
198
+ const NodeTypeTrigger: NodeType = "trigger";
199
+ const NodeTypeHumanAction: NodeType = "humanAction";
200
+ const NodeTypeAgent: NodeType = "agent";
201
+ const NodeTypeAction: NodeType = "action";
202
+ const NodeTypeLogic: NodeType = "logic";
203
+ const NodeTypeLoop: NodeType = "loop";
204
+ const NodeTypeDelay: NodeType = "delay";
205
+ const NodeTypeData: NodeType = "data";
206
+ // ... and more
207
+ ```
208
+
209
+ ### Workflow Definition Structure
210
+
211
+ ```typescript
212
+ interface WorkflowDefinition {
213
+ id?: string;
214
+ name: string; // Normalized: lowercase, dashes
215
+ title: string; // Display name
216
+ description: string;
217
+ type: WorkflowType; // "entity", "chat", "document", etc.
218
+ nodes: { [key: string]: WorkflowNode };
219
+ edges: WorkflowEdge[];
220
+ entryPoints: string[]; // Start node IDs
221
+ variables: WorkflowVariables;
222
+ permissions: WorkflowPermissions;
223
+ metadata: WorkflowMetadata;
224
+ }
225
+ ```
226
+
227
+ ## Peer Dependencies
228
+
229
+ - `@reduxjs/toolkit` ^2.0.0
230
+ - `react` ^18.0.0 || ^19.0.0
231
+ - `react-redux` ^9.0.0
232
+
233
+ ## License
234
+
235
+ Private - Eloquent Platform
@@ -1,6 +1,6 @@
1
1
  import { ApiClientOptions, ApiResponse } from '@elqnt/api-client';
2
2
  import { ResponseMetadata } from '@elqnt/types';
3
- import { L as ListWorkflowDefinitionsResponse, b as WorkflowDefinitionResponse, W as WorkflowDefinition, c as WorkflowInstanceResponse, d as ListWorkflowInstancesResponse } from '../workflow-vv0mDt57.mjs';
3
+ import { a as WorkflowDefinition, b as WorkflowDefinitionResponse, c as WorkflowInstanceResponse, L as ListWorkflowInstancesResponse, d as ListWorkflowDefinitionsResponse } from '../workflow-NznrS9yA.mjs';
4
4
 
5
5
  /**
6
6
  * Workflow API functions
@@ -1,6 +1,6 @@
1
1
  import { ApiClientOptions, ApiResponse } from '@elqnt/api-client';
2
2
  import { ResponseMetadata } from '@elqnt/types';
3
- import { L as ListWorkflowDefinitionsResponse, b as WorkflowDefinitionResponse, W as WorkflowDefinition, c as WorkflowInstanceResponse, d as ListWorkflowInstancesResponse } from '../workflow-vv0mDt57.js';
3
+ import { a as WorkflowDefinition, b as WorkflowDefinitionResponse, c as WorkflowInstanceResponse, L as ListWorkflowInstancesResponse, d as ListWorkflowDefinitionsResponse } from '../workflow-NznrS9yA.js';
4
4
 
5
5
  /**
6
6
  * Workflow API functions
@@ -1 +1 @@
1
- {"version":3,"sources":["/home/runner/work/eloquent-packages/eloquent-packages/packages/workflow/dist/api/index.js"],"names":[],"mappings":"AAAA,qFAAY;AACZ;AACE;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACF,uDAA6B;AAC7B;AACE;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACF,qkCAAC","file":"/home/runner/work/eloquent-packages/eloquent-packages/packages/workflow/dist/api/index.js"}
1
+ {"version":3,"sources":["/home/runner/work/eloquent/eloquent/packages/@elqnt/workflow/dist/api/index.js"],"names":[],"mappings":"AAAA,qFAAY;AACZ;AACE;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACF,uDAA6B;AAC7B;AACE;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACF,qkCAAC","file":"/home/runner/work/eloquent/eloquent/packages/@elqnt/workflow/dist/api/index.js"}
@@ -1 +1 @@
1
- {"version":3,"sources":["/home/runner/work/eloquent-packages/eloquent-packages/packages/workflow/dist/chunk-F5G2ALFS.js","../hooks/index.ts"],"names":[],"mappings":"AAAA,6rBAAY;AACZ;AACE;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACF,sDAA4B;AAC5B;AACA;ACXA,8BAAkE;AA6C3D,SAAS,YAAA,CAAa,OAAA,EAA8B;AACzD,EAAA,MAAM,CAAC,OAAA,EAAS,UAAU,EAAA,EAAI,6BAAA,KAAc,CAAA;AAC5C,EAAA,MAAM,CAAC,KAAA,EAAO,QAAQ,EAAA,EAAI,6BAAA,IAA4B,CAAA;AAEtD,EAAA,MAAM,WAAA,EAAa,2BAAA,OAAc,CAAA;AACjC,EAAA,8BAAA,CAAU,EAAA,GAAM;AACd,IAAA,UAAA,CAAW,QAAA,EAAU,OAAA;AAAA,EACvB,CAAA,EAAG,CAAC,OAAO,CAAC,CAAA;AAEZ,EAAA,MAAM,cAAA,EAAgB,gCAAA,MAAY,CAAA,EAAA,GAA2C;AAC3E,IAAA,UAAA,CAAW,IAAI,CAAA;AACf,IAAA,QAAA,CAAS,IAAI,CAAA;AACb,IAAA,IAAI;AACF,MAAA,MAAM,SAAA,EAAW,MAAM,+CAAA,UAAiB,CAAW,OAAO,CAAA;AAC1D,MAAA,GAAA,CAAI,QAAA,CAAS,KAAA,EAAO;AAClB,QAAA,QAAA,CAAS,QAAA,CAAS,KAAK,CAAA;AACvB,QAAA,OAAO,CAAC,CAAA;AAAA,MACV;AACA,MAAA,uBAAO,QAAA,mBAAS,IAAA,6BAAM,cAAA,GAAe,CAAC,CAAA;AAAA,IACxC,EAAA,MAAA,CAAS,GAAA,EAAK;AACZ,MAAA,MAAM,QAAA,EAAU,IAAA,WAAe,MAAA,EAAQ,GAAA,CAAI,QAAA,EAAU,0BAAA;AACrD,MAAA,QAAA,CAAS,OAAO,CAAA;AAChB,MAAA,OA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;AAAA,EACH,CAAA;AAEA,EAAA,OAAO,4BAAA;AAAA,IACL,CAAA,EAAA,GAAA,CAAO;AAAA,MACL,OAAA;AAAA,MACA,KAAA;AAAA,MACA,aAAA;AAAA,MACA,WAAA;AAAA,MACA;AAAA,IACF,CAAA,CAAA;AAAA,IACA,CAAC,OAAA,EAAS,KAAA,EAAO,aAAA,EAAe,WAAA,EAAa,mBAAmB;AAAA,EAClE,CAAA;AACF;ADrFA;AACA;AACE;AACA;AACA;AACF,8IAAC","file":"/home/runner/work/eloquent-packages/eloquent-packages/packages/workflow/dist/chunk-F5G2ALFS.js","sourcesContent":[null,"\"use client\";\n\n/**\n * Workflow hooks for React applications\n *\n * Provides React hooks for workflow operations with loading/error states.\n */\n\nimport { useState, useCallback, useMemo, useRef, useEffect } from \"react\";\nimport type { ApiClientOptions } from \"@elqnt/api-client\";\nimport type { WorkflowDefinition, WorkflowInstance } from \"../models\";\nimport {\n listWorkflowsApi,\n getWorkflowApi,\n createWorkflowApi,\n updateWorkflowApi,\n deleteWorkflowApi,\n listWorkflowInstancesApi,\n getWorkflowInstanceApi,\n createWorkflowInstanceApi,\n updateWorkflowInstanceStatusApi,\n executeWorkflowNodeApi,\n resumeWorkflowNodeApi,\n retryWorkflowNodeApi,\n listWorkflowTemplatesApi,\n getWorkflowTemplateApi,\n instantiateWorkflowTemplateApi,\n type WorkflowTemplate,\n} from \"../api\";\n\n// =============================================================================\n// TYPES\n// =============================================================================\n\nexport type UseWorkflowsOptions = ApiClientOptions;\n\n// =============================================================================\n// USE WORKFLOWS HOOK\n// =============================================================================\n\n/**\n * Hook for workflow definition CRUD operations\n *\n * @example\n * ```tsx\n * const { loading, error, listWorkflows, createWorkflow } = useWorkflows({\n * baseUrl: apiGatewayUrl,\n * orgId: selectedOrgId,\n * });\n *\n * const workflows = await listWorkflows();\n * ```\n */\nexport function useWorkflows(options: UseWorkflowsOptions) {\n const [loading, setLoading] = useState(false);\n const [error, setError] = useState<string | null>(null);\n\n const optionsRef = useRef(options);\n useEffect(() => {\n optionsRef.current = options;\n }, [options]);\n\n const listWorkflows = useCallback(async (): Promise<WorkflowDefinition[]> => {\n setLoading(true);\n setError(null);\n try {\n const response = await listWorkflowsApi(optionsRef.current);\n if (response.error) {\n setError(response.error);\n return [];\n }\n return response.data?.definitions || [];\n } catch (err) {\n const message = err instanceof Error ? err.message : \"Failed to load workflows\";\n setError(message);\n return [];\n } finally {\n setLoading(false);\n }\n }, []);\n\n const getWorkflow = useCallback(async (workflowId: string): Promise<WorkflowDefinition | null> => {\n setLoading(true);\n setError(null);\n try {\n const response = await getWorkflowApi(workflowId, optionsRef.current);\n if (response.error) {\n setError(response.error);\n return null;\n }\n return response.data?.definition || null;\n } catch (err) {\n const message = err instanceof Error ? err.message : \"Failed to get workflow\";\n setError(message);\n return null;\n } finally {\n setLoading(false);\n }\n }, []);\n\n const createWorkflow = useCallback(\n async (workflow: Partial<WorkflowDefinition>): Promise<WorkflowDefinition | null> => {\n setLoading(true);\n setError(null);\n try {\n const response = await createWorkflowApi(workflow, optionsRef.current);\n if (response.error) {\n setError(response.error);\n return null;\n }\n return response.data?.definition || null;\n } catch (err) {\n const message = err instanceof Error ? err.message : \"Failed to create workflow\";\n setError(message);\n return null;\n } finally {\n setLoading(false);\n }\n },\n []\n );\n\n const updateWorkflow = useCallback(\n async (workflowId: string, workflow: Partial<WorkflowDefinition>): Promise<WorkflowDefinition | null> => {\n setLoading(true);\n setError(null);\n try {\n const response = await updateWorkflowApi(workflowId, workflow, optionsRef.current);\n if (response.error) {\n setError(response.error);\n return null;\n }\n return response.data?.definition || null;\n } catch (err) {\n const message = err instanceof Error ? err.message : \"Failed to update workflow\";\n setError(message);\n return null;\n } finally {\n setLoading(false);\n }\n },\n []\n );\n\n const deleteWorkflow = useCallback(async (workflowId: string): Promise<boolean> => {\n setLoading(true);\n setError(null);\n try {\n const response = await deleteWorkflowApi(workflowId, optionsRef.current);\n if (response.error) {\n setError(response.error);\n return false;\n }\n return response.data?.success ?? true;\n } catch (err) {\n const message = err instanceof Error ? err.message : \"Failed to delete workflow\";\n setError(message);\n return false;\n } finally {\n setLoading(false);\n }\n }, []);\n\n return useMemo(\n () => ({\n loading,\n error,\n listWorkflows,\n getWorkflow,\n createWorkflow,\n updateWorkflow,\n deleteWorkflow,\n }),\n [loading, error, listWorkflows, getWorkflow, createWorkflow, updateWorkflow, deleteWorkflow]\n );\n}\n\n// =============================================================================\n// USE WORKFLOW INSTANCES HOOK\n// =============================================================================\n\n/**\n * Hook for workflow instance operations\n */\nexport function useWorkflowInstances(options: UseWorkflowsOptions) {\n const [loading, setLoading] = useState(false);\n const [error, setError] = useState<string | null>(null);\n\n const optionsRef = useRef(options);\n useEffect(() => {\n optionsRef.current = options;\n }, [options]);\n\n const listInstances = useCallback(\n async (\n definitionId: string,\n filters?: { userId?: string; status?: string }\n ): Promise<WorkflowInstance[]> => {\n setLoading(true);\n setError(null);\n try {\n const response = await listWorkflowInstancesApi(definitionId, {\n ...optionsRef.current,\n ...filters,\n });\n if (response.error) {\n setError(response.error);\n return [];\n }\n return response.data?.instances || [];\n } catch (err) {\n const message = err instanceof Error ? err.message : \"Failed to list instances\";\n setError(message);\n return [];\n } finally {\n setLoading(false);\n }\n },\n []\n );\n\n const getInstance = useCallback(async (instanceId: string): Promise<WorkflowInstance | null> => {\n setLoading(true);\n setError(null);\n try {\n const response = await getWorkflowInstanceApi(instanceId, optionsRef.current);\n if (response.error) {\n setError(response.error);\n return null;\n }\n return response.data?.instance || null;\n } catch (err) {\n const message = err instanceof Error ? err.message : \"Failed to get instance\";\n setError(message);\n return null;\n } finally {\n setLoading(false);\n }\n }, []);\n\n const createInstance = useCallback(\n async (\n definitionId: string,\n data?: { variables?: Record<string, unknown>; autoExecute?: boolean }\n ): Promise<WorkflowInstance | null> => {\n setLoading(true);\n setError(null);\n try {\n const response = await createWorkflowInstanceApi(definitionId, data || {}, optionsRef.current);\n if (response.error) {\n setError(response.error);\n return null;\n }\n return response.data?.instance || null;\n } catch (err) {\n const message = err instanceof Error ? err.message : \"Failed to create instance\";\n setError(message);\n return null;\n } finally {\n setLoading(false);\n }\n },\n []\n );\n\n const updateStatus = useCallback(\n async (instanceId: string, status: string): Promise<WorkflowInstance | null> => {\n setLoading(true);\n setError(null);\n try {\n const response = await updateWorkflowInstanceStatusApi(instanceId, status, optionsRef.current);\n if (response.error) {\n setError(response.error);\n return null;\n }\n return response.data?.instance || null;\n } catch (err) {\n const message = err instanceof Error ? err.message : \"Failed to update status\";\n setError(message);\n return null;\n } finally {\n setLoading(false);\n }\n },\n []\n );\n\n const executeNode = useCallback(\n async (\n instanceId: string,\n nodeId: string,\n input: Record<string, unknown>\n ): Promise<Record<string, unknown> | null> => {\n setLoading(true);\n setError(null);\n try {\n const response = await executeWorkflowNodeApi(instanceId, nodeId, input, optionsRef.current);\n if (response.error) {\n setError(response.error);\n return null;\n }\n return response.data?.output || null;\n } catch (err) {\n const message = err instanceof Error ? err.message : \"Failed to execute node\";\n setError(message);\n return null;\n } finally {\n setLoading(false);\n }\n },\n []\n );\n\n const resumeNode = useCallback(\n async (\n instanceId: string,\n nodeId: string,\n result: Record<string, unknown>\n ): Promise<WorkflowInstance | null> => {\n setLoading(true);\n setError(null);\n try {\n const response = await resumeWorkflowNodeApi(instanceId, nodeId, result, optionsRef.current);\n if (response.error) {\n setError(response.error);\n return null;\n }\n return response.data?.instance || null;\n } catch (err) {\n const message = err instanceof Error ? err.message : \"Failed to resume node\";\n setError(message);\n return null;\n } finally {\n setLoading(false);\n }\n },\n []\n );\n\n const retryNode = useCallback(\n async (instanceId: string, nodeId: string): Promise<WorkflowInstance | null> => {\n setLoading(true);\n setError(null);\n try {\n const response = await retryWorkflowNodeApi(instanceId, nodeId, optionsRef.current);\n if (response.error) {\n setError(response.error);\n return null;\n }\n return response.data?.instance || null;\n } catch (err) {\n const message = err instanceof Error ? err.message : \"Failed to retry node\";\n setError(message);\n return null;\n } finally {\n setLoading(false);\n }\n },\n []\n );\n\n return useMemo(\n () => ({\n loading,\n error,\n listInstances,\n getInstance,\n createInstance,\n updateStatus,\n executeNode,\n resumeNode,\n retryNode,\n }),\n [loading, error, listInstances, getInstance, createInstance, updateStatus, executeNode, resumeNode, retryNode]\n );\n}\n\n// =============================================================================\n// USE WORKFLOW TEMPLATES HOOK\n// =============================================================================\n\n/**\n * Hook for workflow template operations\n */\nexport function useWorkflowTemplates(options: UseWorkflowsOptions) {\n const [loading, setLoading] = useState(false);\n const [error, setError] = useState<string | null>(null);\n\n const optionsRef = useRef(options);\n useEffect(() => {\n optionsRef.current = options;\n }, [options]);\n\n const listTemplates = useCallback(async (category?: string): Promise<WorkflowTemplate[]> => {\n setLoading(true);\n setError(null);\n try {\n const response = await listWorkflowTemplatesApi({\n ...optionsRef.current,\n category,\n });\n if (response.error) {\n setError(response.error);\n return [];\n }\n return response.data?.templates || [];\n } catch (err) {\n const message = err instanceof Error ? err.message : \"Failed to list templates\";\n setError(message);\n return [];\n } finally {\n setLoading(false);\n }\n }, []);\n\n const getTemplate = useCallback(async (templateId: string): Promise<WorkflowTemplate | null> => {\n setLoading(true);\n setError(null);\n try {\n const response = await getWorkflowTemplateApi(templateId, optionsRef.current);\n if (response.error) {\n setError(response.error);\n return null;\n }\n return response.data?.template || null;\n } catch (err) {\n const message = err instanceof Error ? err.message : \"Failed to get template\";\n setError(message);\n return null;\n } finally {\n setLoading(false);\n }\n }, []);\n\n const instantiateTemplate = useCallback(\n async (\n templateId: string,\n params: { variables: Record<string, unknown>; title?: string }\n ): Promise<WorkflowDefinition | null> => {\n setLoading(true);\n setError(null);\n try {\n const response = await instantiateWorkflowTemplateApi(templateId, params, optionsRef.current);\n if (response.error) {\n setError(response.error);\n return null;\n }\n return response.data?.definition || null;\n } catch (err) {\n const message = err instanceof Error ? err.message : \"Failed to instantiate template\";\n setError(message);\n return null;\n } finally {\n setLoading(false);\n }\n },\n []\n );\n\n return useMemo(\n () => ({\n loading,\n error,\n listTemplates,\n getTemplate,\n instantiateTemplate,\n }),\n [loading, error, listTemplates, getTemplate, instantiateTemplate]\n );\n}\n"]}
1
+ {"version":3,"sources":["/home/runner/work/eloquent/eloquent/packages/@elqnt/workflow/dist/chunk-F5G2ALFS.js","../hooks/index.ts"],"names":[],"mappings":"AAAA,6rBAAY;AACZ;AACE;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACF,sDAA4B;AAC5B;AACA;ACXA,8BAAkE;AA6C3D,SAAS,YAAA,CAAa,OAAA,EAA8B;AACzD,EAAA,MAAM,CAAC,OAAA,EAAS,UAAU,EAAA,EAAI,6BAAA,KAAc,CAAA;AAC5C,EAAA,MAAM,CAAC,KAAA,EAAO,QAAQ,EAAA,EAAI,6BAAA,IAA4B,CAAA;AAEtD,EAAA,MAAM,WAAA,EAAa,2BAAA,OAAc,CAAA;AACjC,EAAA,8BAAA,CAAU,EAAA,GAAM;AACd,IAAA,UAAA,CAAW,QAAA,EAAU,OAAA;AAAA,EACvB,CAAA,EAAG,CAAC,OAAO,CAAC,CAAA;AAEZ,EAAA,MAAM,cAAA,EAAgB,gCAAA,MAAY,CAAA,EAAA,GAA2C;AAC3E,IAAA,UAAA,CAAW,IAAI,CAAA;AACf,IAAA,QAAA,CAAS,IAAI,CAAA;AACb,IAAA,IAAI;AACF,MAAA,MAAM,SAAA,EAAW,MAAM,+CAAA,UAAiB,CAAW,OAAO,CAAA;AAC1D,MAAA,GAAA,CAAI,QAAA,CAAS,KAAA,EAAO;AAClB,QAAA,QAAA,CAAS,QAAA,CAAS,KAAK,CAAA;AACvB,QAAA,OAAO,CAAC,CAAA;AAAA,MACV;AACA,MAAA,uBAAO,QAAA,mBAAS,IAAA,6BAAM,cAAA,GAAe,CAAC,CAAA;AAAA,IACxC,EAAA,MAAA,CAAS,GAAA,EAAK;AACZ,MAAA,MAAM,QAAA,EAAU,IAAA,WAAe,MAAA,EAAQ,GAAA,CAAI,QAAA,EAAU,0BAAA;AACrD,MAAA,QAAA,CAAS,O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ACF,CAAA;AAAA,IACA,CAAC;AAAA,EACH,CAAA;AAEA,EAAA,OAAO,4BAAA;AAAA,IACL,CAAA,EAAA,GAAA,CAAO;AAAA,MACL,OAAA;AAAA,MACA,KAAA;AAAA,MACA,aAAA;AAAA,MACA,WAAA;AAAA,MACA;AAAA,IACF,CAAA,CAAA;AAAA,IACA,CAAC,OAAA,EAAS,KAAA,EAAO,aAAA,EAAe,WAAA,EAAa,mBAAmB;AAAA,EAClE,CAAA;AACF;ADrFA;AACA;AACE;AACA;AACA;AACF,8IAAC","file":"/home/runner/work/eloquent/eloquent/packages/@elqnt/workflow/dist/chunk-F5G2ALFS.js","sourcesContent":[null,"\"use client\";\n\n/**\n * Workflow hooks for React applications\n *\n * Provides React hooks for workflow operations with loading/error states.\n */\n\nimport { useState, useCallback, useMemo, useRef, useEffect } from \"react\";\nimport type { ApiClientOptions } from \"@elqnt/api-client\";\nimport type { WorkflowDefinition, WorkflowInstance } from \"../models\";\nimport {\n listWorkflowsApi,\n getWorkflowApi,\n createWorkflowApi,\n updateWorkflowApi,\n deleteWorkflowApi,\n listWorkflowInstancesApi,\n getWorkflowInstanceApi,\n createWorkflowInstanceApi,\n updateWorkflowInstanceStatusApi,\n executeWorkflowNodeApi,\n resumeWorkflowNodeApi,\n retryWorkflowNodeApi,\n listWorkflowTemplatesApi,\n getWorkflowTemplateApi,\n instantiateWorkflowTemplateApi,\n type WorkflowTemplate,\n} from \"../api\";\n\n// =============================================================================\n// TYPES\n// =============================================================================\n\nexport type UseWorkflowsOptions = ApiClientOptions;\n\n// =============================================================================\n// USE WORKFLOWS HOOK\n// =============================================================================\n\n/**\n * Hook for workflow definition CRUD operations\n *\n * @example\n * ```tsx\n * const { loading, error, listWorkflows, createWorkflow } = useWorkflows({\n * baseUrl: apiGatewayUrl,\n * orgId: selectedOrgId,\n * });\n *\n * const workflows = await listWorkflows();\n * ```\n */\nexport function useWorkflows(options: UseWorkflowsOptions) {\n const [loading, setLoading] = useState(false);\n const [error, setError] = useState<string | null>(null);\n\n const optionsRef = useRef(options);\n useEffect(() => {\n optionsRef.current = options;\n }, [options]);\n\n const listWorkflows = useCallback(async (): Promise<WorkflowDefinition[]> => {\n setLoading(true);\n setError(null);\n try {\n const response = await listWorkflowsApi(optionsRef.current);\n if (response.error) {\n setError(response.error);\n return [];\n }\n return response.data?.definitions || [];\n } catch (err) {\n const message = err instanceof Error ? err.message : \"Failed to load workflows\";\n setError(message);\n return [];\n } finally {\n setLoading(false);\n }\n }, []);\n\n const getWorkflow = useCallback(async (workflowId: string): Promise<WorkflowDefinition | null> => {\n setLoading(true);\n setError(null);\n try {\n const response = await getWorkflowApi(workflowId, optionsRef.current);\n if (response.error) {\n setError(response.error);\n return null;\n }\n return response.data?.definition || null;\n } catch (err) {\n const message = err instanceof Error ? err.message : \"Failed to get workflow\";\n setError(message);\n return null;\n } finally {\n setLoading(false);\n }\n }, []);\n\n const createWorkflow = useCallback(\n async (workflow: Partial<WorkflowDefinition>): Promise<WorkflowDefinition | null> => {\n setLoading(true);\n setError(null);\n try {\n const response = await createWorkflowApi(workflow, optionsRef.current);\n if (response.error) {\n setError(response.error);\n return null;\n }\n return response.data?.definition || null;\n } catch (err) {\n const message = err instanceof Error ? err.message : \"Failed to create workflow\";\n setError(message);\n return null;\n } finally {\n setLoading(false);\n }\n },\n []\n );\n\n const updateWorkflow = useCallback(\n async (workflowId: string, workflow: Partial<WorkflowDefinition>): Promise<WorkflowDefinition | null> => {\n setLoading(true);\n setError(null);\n try {\n const response = await updateWorkflowApi(workflowId, workflow, optionsRef.current);\n if (response.error) {\n setError(response.error);\n return null;\n }\n return response.data?.definition || null;\n } catch (err) {\n const message = err instanceof Error ? err.message : \"Failed to update workflow\";\n setError(message);\n return null;\n } finally {\n setLoading(false);\n }\n },\n []\n );\n\n const deleteWorkflow = useCallback(async (workflowId: string): Promise<boolean> => {\n setLoading(true);\n setError(null);\n try {\n const response = await deleteWorkflowApi(workflowId, optionsRef.current);\n if (response.error) {\n setError(response.error);\n return false;\n }\n return response.data?.success ?? true;\n } catch (err) {\n const message = err instanceof Error ? err.message : \"Failed to delete workflow\";\n setError(message);\n return false;\n } finally {\n setLoading(false);\n }\n }, []);\n\n return useMemo(\n () => ({\n loading,\n error,\n listWorkflows,\n getWorkflow,\n createWorkflow,\n updateWorkflow,\n deleteWorkflow,\n }),\n [loading, error, listWorkflows, getWorkflow, createWorkflow, updateWorkflow, deleteWorkflow]\n );\n}\n\n// =============================================================================\n// USE WORKFLOW INSTANCES HOOK\n// =============================================================================\n\n/**\n * Hook for workflow instance operations\n */\nexport function useWorkflowInstances(options: UseWorkflowsOptions) {\n const [loading, setLoading] = useState(false);\n const [error, setError] = useState<string | null>(null);\n\n const optionsRef = useRef(options);\n useEffect(() => {\n optionsRef.current = options;\n }, [options]);\n\n const listInstances = useCallback(\n async (\n definitionId: string,\n filters?: { userId?: string; status?: string }\n ): Promise<WorkflowInstance[]> => {\n setLoading(true);\n setError(null);\n try {\n const response = await listWorkflowInstancesApi(definitionId, {\n ...optionsRef.current,\n ...filters,\n });\n if (response.error) {\n setError(response.error);\n return [];\n }\n return response.data?.instances || [];\n } catch (err) {\n const message = err instanceof Error ? err.message : \"Failed to list instances\";\n setError(message);\n return [];\n } finally {\n setLoading(false);\n }\n },\n []\n );\n\n const getInstance = useCallback(async (instanceId: string): Promise<WorkflowInstance | null> => {\n setLoading(true);\n setError(null);\n try {\n const response = await getWorkflowInstanceApi(instanceId, optionsRef.current);\n if (response.error) {\n setError(response.error);\n return null;\n }\n return response.data?.instance || null;\n } catch (err) {\n const message = err instanceof Error ? err.message : \"Failed to get instance\";\n setError(message);\n return null;\n } finally {\n setLoading(false);\n }\n }, []);\n\n const createInstance = useCallback(\n async (\n definitionId: string,\n data?: { variables?: Record<string, unknown>; autoExecute?: boolean }\n ): Promise<WorkflowInstance | null> => {\n setLoading(true);\n setError(null);\n try {\n const response = await createWorkflowInstanceApi(definitionId, data || {}, optionsRef.current);\n if (response.error) {\n setError(response.error);\n return null;\n }\n return response.data?.instance || null;\n } catch (err) {\n const message = err instanceof Error ? err.message : \"Failed to create instance\";\n setError(message);\n return null;\n } finally {\n setLoading(false);\n }\n },\n []\n );\n\n const updateStatus = useCallback(\n async (instanceId: string, status: string): Promise<WorkflowInstance | null> => {\n setLoading(true);\n setError(null);\n try {\n const response = await updateWorkflowInstanceStatusApi(instanceId, status, optionsRef.current);\n if (response.error) {\n setError(response.error);\n return null;\n }\n return response.data?.instance || null;\n } catch (err) {\n const message = err instanceof Error ? err.message : \"Failed to update status\";\n setError(message);\n return null;\n } finally {\n setLoading(false);\n }\n },\n []\n );\n\n const executeNode = useCallback(\n async (\n instanceId: string,\n nodeId: string,\n input: Record<string, unknown>\n ): Promise<Record<string, unknown> | null> => {\n setLoading(true);\n setError(null);\n try {\n const response = await executeWorkflowNodeApi(instanceId, nodeId, input, optionsRef.current);\n if (response.error) {\n setError(response.error);\n return null;\n }\n return response.data?.output || null;\n } catch (err) {\n const message = err instanceof Error ? err.message : \"Failed to execute node\";\n setError(message);\n return null;\n } finally {\n setLoading(false);\n }\n },\n []\n );\n\n const resumeNode = useCallback(\n async (\n instanceId: string,\n nodeId: string,\n result: Record<string, unknown>\n ): Promise<WorkflowInstance | null> => {\n setLoading(true);\n setError(null);\n try {\n const response = await resumeWorkflowNodeApi(instanceId, nodeId, result, optionsRef.current);\n if (response.error) {\n setError(response.error);\n return null;\n }\n return response.data?.instance || null;\n } catch (err) {\n const message = err instanceof Error ? err.message : \"Failed to resume node\";\n setError(message);\n return null;\n } finally {\n setLoading(false);\n }\n },\n []\n );\n\n const retryNode = useCallback(\n async (instanceId: string, nodeId: string): Promise<WorkflowInstance | null> => {\n setLoading(true);\n setError(null);\n try {\n const response = await retryWorkflowNodeApi(instanceId, nodeId, optionsRef.current);\n if (response.error) {\n setError(response.error);\n return null;\n }\n return response.data?.instance || null;\n } catch (err) {\n const message = err instanceof Error ? err.message : \"Failed to retry node\";\n setError(message);\n return null;\n } finally {\n setLoading(false);\n }\n },\n []\n );\n\n return useMemo(\n () => ({\n loading,\n error,\n listInstances,\n getInstance,\n createInstance,\n updateStatus,\n executeNode,\n resumeNode,\n retryNode,\n }),\n [loading, error, listInstances, getInstance, createInstance, updateStatus, executeNode, resumeNode, retryNode]\n );\n}\n\n// =============================================================================\n// USE WORKFLOW TEMPLATES HOOK\n// =============================================================================\n\n/**\n * Hook for workflow template operations\n */\nexport function useWorkflowTemplates(options: UseWorkflowsOptions) {\n const [loading, setLoading] = useState(false);\n const [error, setError] = useState<string | null>(null);\n\n const optionsRef = useRef(options);\n useEffect(() => {\n optionsRef.current = options;\n }, [options]);\n\n const listTemplates = useCallback(async (category?: string): Promise<WorkflowTemplate[]> => {\n setLoading(true);\n setError(null);\n try {\n const response = await listWorkflowTemplatesApi({\n ...optionsRef.current,\n category,\n });\n if (response.error) {\n setError(response.error);\n return [];\n }\n return response.data?.templates || [];\n } catch (err) {\n const message = err instanceof Error ? err.message : \"Failed to list templates\";\n setError(message);\n return [];\n } finally {\n setLoading(false);\n }\n }, []);\n\n const getTemplate = useCallback(async (templateId: string): Promise<WorkflowTemplate | null> => {\n setLoading(true);\n setError(null);\n try {\n const response = await getWorkflowTemplateApi(templateId, optionsRef.current);\n if (response.error) {\n setError(response.error);\n return null;\n }\n return response.data?.template || null;\n } catch (err) {\n const message = err instanceof Error ? err.message : \"Failed to get template\";\n setError(message);\n return null;\n } finally {\n setLoading(false);\n }\n }, []);\n\n const instantiateTemplate = useCallback(\n async (\n templateId: string,\n params: { variables: Record<string, unknown>; title?: string }\n ): Promise<WorkflowDefinition | null> => {\n setLoading(true);\n setError(null);\n try {\n const response = await instantiateWorkflowTemplateApi(templateId, params, optionsRef.current);\n if (response.error) {\n setError(response.error);\n return null;\n }\n return response.data?.definition || null;\n } catch (err) {\n const message = err instanceof Error ? err.message : \"Failed to instantiate template\";\n setError(message);\n return null;\n } finally {\n setLoading(false);\n }\n },\n []\n );\n\n return useMemo(\n () => ({\n loading,\n error,\n listTemplates,\n getTemplate,\n instantiateTemplate,\n }),\n [loading, error, listTemplates, getTemplate, instantiateTemplate]\n );\n}\n"]}
@@ -1 +1 @@
1
- {"version":3,"sources":["/home/runner/work/eloquent-packages/eloquent-packages/packages/workflow/dist/chunk-H24IF5AA.js","../models/workflow.ts","../models/subjects.ts"],"names":[],"mappings":"AAAA,qFAAY;AACZ;AACA;ACUO,IAAM,gBAAA,EAA4B,SAAA;AAClC,IAAM,oBAAA,EAAgC,aAAA;AACtC,IAAM,cAAA,EAA0B,OAAA;AAChC,IAAM,eAAA,EAA2B,QAAA;AACjC,IAAM,cAAA,EAA0B,OAAA;AAChC,IAAM,aAAA,EAAyB,MAAA;AAC/B,IAAM,iBAAA,EAA6B,UAAA;AACnC,IAAM,cAAA,EAA0B,OAAA;AAChC,IAAM,aAAA,EAAyB,MAAA;AAC/B,IAAM,oBAAA,EAAgC,aAAA;AACtC,IAAM,cAAA,EAA0B,OAAA;AAChC,IAAM,gBAAA,EAA4B,SAAA;AAClC,IAAM,eAAA,EAA2B,QAAA;AACjC,IAAM,mBAAA,EAA+B,YAAA;AACrC,IAAM,2BAAA,EAAuC,oBAAA;AAS7C,IAAM,wBAAA,EAAuC,cAAA;AAC7C,IAAM,sCAAA,EAAqD,4BAAA;AAC3D,IAAM,sCAAA,EAAqD,4BAAA;AAC3D,IAAM,sCAAA,EAAqD,4BAAA;AAC3D,IAAM,6BAAA,EAA4C,mBAAA;AAClD,IAAM,4BAAA,EAA2C,kBAAA;AACjD,IAAM,6BAAA,EAA4C,mBAAA;AAClD,IAAM,kCAAA,EAAiD,wBAAA;AAIvD,IAAM,6BAAA,EAA4C,mBAAA;AAClD,IAAM,+BAAA,EAA8C,qBAAA;AACpD,IAAM,gCAAA,EAA+C,sBAAA;AACrD,IAAM,iCAAA,EAAgD,uBAAA;AAItD,IAAM,qBAAA,EAAoC,WAAA;AAC1C,IAAM,+BAAA,EAA8C,qBAAA;AACpD,IAAM,+BAAA,EAA8C,qBAAA;AACpD,IAAM,8BA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AAC9B,IAAM,uBAAA,EAAyB,0BAAA;AAI/B,IAAM,wBAAA,EAA0B,2BAAA;AAChC,IAAM,qBAAA,EAAuB,wBAAA;AAC7B,IAAM,sBAAA,EAAwB,yBAAA;AAC9B,IAAM,sBAAA,EAAwB,yBAAA;AAC9B,IAAM,qBAAA,EAAuB,wBAAA;AAI7B,IAAM,yBAAA,EAA2B,4BAAA;AACjC,IAAM,2BAAA,EAA6B,8BAAA;AACnC,IAAM,wBAAA,EAA0B,2BAAA;AFkGvC;AACA;AACE;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACF,gkRAAC","file":"/home/runner/work/eloquent-packages/eloquent-packages/packages/workflow/dist/chunk-H24IF5AA.js","sourcesContent":[null,"// Code generated by tygo. DO NOT EDIT.\nimport { EntityFilterOperatorTS } from \"@elqnt/entity\";\nimport { JSONSchema, ResponseMetadata } from \"@elqnt/types\";\nimport { NodeSubTypeTS, WorkflowTypeTS, WorkflowNodeTypeTS, WorkflowNodeSubTypeTS, WorkflowEdgeTypeTS } from \"../schema/schemas\";\n\n//////////\n// source: constants.go\n\n/**\n * NodeType represents the primary type of a workflow node\n */\nexport type NodeType = string;\nexport const NodeTypeTrigger: NodeType = \"trigger\";\nexport const NodeTypeHumanAction: NodeType = \"humanAction\";\nexport const NodeTypeAgent: NodeType = \"agent\";\nexport const NodeTypeAction: NodeType = \"action\";\nexport const NodeTypeLogic: NodeType = \"logic\";\nexport const NodeTypeLoop: NodeType = \"loop\";\nexport const NodeTypeParallel: NodeType = \"parallel\";\nexport const NodeTypeDelay: NodeType = \"delay\";\nexport const NodeTypeData: NodeType = \"data\";\nexport const NodeTypeIntegration: NodeType = \"integration\";\nexport const NodeTypeTimer: NodeType = \"timer\";\nexport const NodeTypeSubflow: NodeType = \"subflow\";\nexport const NodeTypeCustom: NodeType = \"custom\";\nexport const NodeTypeAccounting: NodeType = \"accounting\";\nexport const NodeTypeDocumentExtraction: NodeType = \"documentExtraction\";\n/**\n * NodeSubType represents the subtype of a workflow node\n * All node subtypes are unified under this single type\n */\nexport type NodeSubType = string;\n/**\n * Trigger subtypes\n */\nexport const NodeSubTypeTriggerStart: NodeSubType = \"triggerStart\";\nexport const NodeSubTypeTriggerEntityRecordCreated: NodeSubType = \"triggerEntityRecordCreated\";\nexport const NodeSubTypeTriggerEntityRecordUpdated: NodeSubType = \"triggerEntityRecordUpdated\";\nexport const NodeSubTypeTriggerEntityRecordDeleted: NodeSubType = \"triggerEntityRecordDeleted\";\nexport const NodeSubTypeTriggerSLAWarning: NodeSubType = \"triggerSLAWarning\";\nexport const NodeSubTypeTriggerSLABreach: NodeSubType = \"triggerSLABreach\";\nexport const NodeSubTypeTriggerEscalation: NodeSubType = \"triggerEscalation\";\nexport const NodeSubTypeTriggerWebhookReceived: NodeSubType = \"triggerWebhookReceived\";\n/**\n * Human action subtypes\n */\nexport const NodeSubTypeHumanActionReview: NodeSubType = \"humanActionReview\"; // review means will be able to edit the fields and move to next node (no approval)\nexport const NodeSubTypeHumanActionApproval: NodeSubType = \"humanActionApproval\"; // approval means will be able to edit the fields and move to next node (with approval)\nexport const NodeSubTypeHumanActionDataEntry: NodeSubType = \"humanActionDataEntry\"; // data entry means will be able to fill the fields and move to next node (no approval)\nexport const NodeSubTypeHumanActionAssignment: NodeSubType = \"humanActionAssignment\"; // assignment means will be able to only assign the task to a user (no approval)\n/**\n * Agent subtypes\n */\nexport const NodeSubTypeAgentChat: NodeSubType = \"agentChat\";\nexport const NodeSubTypeAgentIntentDetector: NodeSubType = \"agentIntentDetector\";\nexport const NodeSubTypeAgentKnowledgeGraph: NodeSubType = \"agentKnowledgeGraph\";\nexport const NodeSubTypeAgentClientApiCall: NodeSubType = \"clientApiCall\";\nexport const NodeSubTypeAgentTransferToHuman: NodeSubType = \"agentTransferToHuman\";\nexport const NodeSubTypeAgentOpenTicket: NodeSubType = \"agentOpenTicket\";\nexport const NodeSubTypeAgentApiIntegration: NodeSubType = \"agentApiIntegration\";\nexport const NodeSubTypeAgentCustomResponse: NodeSubType = \"agentCustomResponse\";\nexport const NodeSubTypeAgentStructuredOutput: NodeSubType = \"agentStructuredOutput\"; // Generic structured output using OpenAI with dynamic input/output schemas\n/**\n * Action subtypes\n */\nexport const NodeSubTypeActionApiCall: NodeSubType = \"actionApiCall\";\nexport const NodeSubTypeActionDocumentExtraction: NodeSubType = \"actionDocumentExtraction\";\nexport const NodeSubTypeActionSendEmail: NodeSubType = \"actionSendEmail\";\nexport const NodeSubTypeActionSendSMS: NodeSubType = \"actionSendSMS\";\nexport const NodeSubTypeActionGenerateDocument: NodeSubType = \"actionGenerateDocument\";\nexport const NodeSubTypeActionProcessPayment: NodeSubType = \"actionProcessPayment\";\nexport const NodeSubTypeActionCreateEntityRecord: NodeSubType = \"actionCreateEntityRecord\";\nexport const NodeSubTypeActionUpdateEntityRecord: NodeSubType = \"actionUpdateEntityRecord\";\nexport const NodeSubTypeActionDeleteEntityRecord: NodeSubType = \"actionDeleteEntityRecord\";\nexport const NodeSubTypeActionMergeEntityRecords: NodeSubType = \"actionMergeEntityRecords\";\nexport const NodeSubTypeActionAssignSLAPolicy: NodeSubType = \"actionAssignSLAPolicy\";\nexport const NodeSubTypeActionChangeSLAStatus: NodeSubType = \"actionChangeSLAAssignmentStatus\";\nexport const NodeSubTypeActionEscalateSLA: NodeSubType = \"actionEscalateSLAAssignment\";\nexport const NodeSubTypeActionCSATSurvey: NodeSubType = \"actionCSATSurvey\";\nexport const NodeSubTypeActionSetVariables: NodeSubType = \"actionSetVariables\"; // Passthrough node that sets variables from config values\nexport const NodeSubTypeActionQueryEntityRecords: NodeSubType = \"actionQueryEntityRecords\"; // Query entity records with filters\nexport const NodeSubTypeActionNatsRequest: NodeSubType = \"actionNatsRequest\"; // Execute a NATS request-reply call\n/**\n * Logic subtypes\n */\nexport const NodeSubTypeLogicIf: NodeSubType = \"logicIf\";\nexport const NodeSubTypeLogicSwitch: NodeSubType = \"logicSwitch\";\nexport const NodeSubTypeLogicFor: NodeSubType = \"logicFor\";\nexport const NodeSubTypeLogicParallel: NodeSubType = \"logicParallel\";\n/**\n * Loop subtypes\n */\nexport const NodeSubTypeLoopData: NodeSubType = \"loopData\";\n/**\n * Delay subtypes\n */\nexport const NodeSubTypeDelay: NodeSubType = \"delay\";\n/**\n * Data subtypes\n */\nexport const NodeSubTypeDataFilter: NodeSubType = \"dataFilter\";\nexport const NodeSubTypeDataMap: NodeSubType = \"dataMap\";\nexport const NodeSubTypeDataCalculate: NodeSubType = \"dataCalculate\";\nexport const NodeSubTypeDataValidate: NodeSubType = \"dataValidate\";\n/**\n * Timer subtypes\n */\nexport const NodeSubTypeTimerDelay: NodeSubType = \"timerDelay\";\nexport const NodeSubTypeTimerSchedule: NodeSubType = \"timerSchedule\";\nexport const NodeSubTypeTimerBusinessHours: NodeSubType = \"timerBusinessHours\";\n/**\n * ExpressionType defines the type of expression evaluation to be used\n */\nexport type ExpressionType = string;\n/**\n * Simple filter-based expressions using predefined operators\n */\nexport const ExpressionTypeFilter: ExpressionType = \"filter\";\n/**\n * JavaScript-like expressions with full language features\n */\nexport const ExpressionTypeJavaScript: ExpressionType = \"javascript\";\n/**\n * Template expressions with variable interpolation\n */\nexport const ExpressionTypeTemplate: ExpressionType = \"template\";\n/**\n * Custom domain-specific language expressions\n */\nexport const ExpressionTypeDSL: ExpressionType = \"dsl\";\n/**\n * Complex rule-based expressions (e.g., business rules)\n */\nexport const ExpressionTypeRules: ExpressionType = \"rules\";\n/**\n * EdgeType defines the type and behavior of workflow edges\n */\nexport type EdgeType = string;\n/**\n * Standard flow between nodes\n */\nexport const EdgeTypeNormal: EdgeType = \"normal\";\n/**\n * Loop back to previous node\n */\nexport const EdgeTypeLoopBack: EdgeType = \"loopBack\";\n/**\n * Error handling path\n */\nexport const EdgeTypeError: EdgeType = \"error\";\n/**\n * Fallback/default path when no other conditions match\n */\nexport const EdgeTypeDefault: EdgeType = \"default\";\n/**\n * Path for parallel execution branch\n */\nexport const EdgeTypeParallel: EdgeType = \"parallel\";\n/**\n * Path for conditional branching\n */\nexport const EdgeTypeConditional: EdgeType = \"conditional\";\n/**\n * Path for merging parallel branches\n */\nexport const EdgeTypeMerge: EdgeType = \"merge\";\n/**\n * Compensating/rollback path\n */\nexport const EdgeTypeCompensation: EdgeType = \"compensation\";\n/**\n * Path for timeout/deadline handling\n */\nexport const EdgeTypeTimeout: EdgeType = \"timeout\";\nexport type WorkflowType = string;\nexport const WorkflowTypeEntity: WorkflowType = \"entity\";\nexport const WorkflowTypeDocument: WorkflowType = \"document\";\nexport const WorkflowTypeChat: WorkflowType = \"chat\";\nexport const WorkflowTypeAgent: WorkflowType = \"agent\";\nexport const WorkflowTypeProductivity: WorkflowType = \"productivity\";\n\n//////////\n// source: node-definitions.go\n\n/**\n * NodeDefinition is the design-time template for creating WorkflowNode instances.\n * This is the single source of truth for all node types in the workflow system.\n * Generated to TypeScript via schema-generator for use in the workflow designer UI.\n */\nexport interface NodeDefinition {\n type: NodeType;\n subType: NodeSubTypeTS;\n label: string;\n icon: string;\n description: string;\n category: string;\n config: JSONSchema;\n input: JSONSchema;\n output: JSONSchema;\n}\n/**\n * EdgeTypeDefinition defines metadata for an edge type\n */\nexport interface EdgeTypeDefinition {\n value: string;\n label: string;\n}\n/**\n * WorkflowTypeDefinition defines metadata for a workflow type\n */\nexport interface WorkflowTypeDefinition {\n value: string;\n label: string;\n}\n\n//////////\n// source: workflow-helper-models.go\n\nexport interface LogicPath {\n id: string;\n nodeId: string;\n condition: string; // \"true\"/\"false\" for if, value for switch\n priority: number /* int */; // For ordering multiple possible paths\n}\nexport interface Intent {\n id: string;\n nodeId: string;\n name: string;\n description: string;\n}\n\n//////////\n// source: workflows-base-models.go\n\nexport interface Metadata {\n createdBy: string;\n createdAt: string /* RFC3339 */;\n updatedBy?: string;\n updatedAt?: string /* RFC3339 */;\n isActive: boolean;\n version: number /* int */;\n}\nexport interface CreateWorkflowDefinitionRequest {\n definition: WorkflowDefinition;\n orgId: string;\n}\nexport interface UpdateWorkflowDefinitionRequest {\n definition: WorkflowDefinition;\n orgId: string;\n}\nexport interface WorkflowDefinitionResponse {\n definition: WorkflowDefinition;\n metadata: ResponseMetadata;\n}\nexport interface GetWorkflowDefinitionRequest {\n id?: string /* uuid */; // Lookup by ID\n name?: string; // Or lookup by name (normalized: lowercase, dashes)\n title?: string; // Or lookup by title (deprecated, use name)\n type?: string; // Optional: filter by type when looking up by name/title\n orgId: string;\n}\n/**\n * GetWorkflowDefinitionByTitleRequest is used for the legacy workflow.definition.get.by.title endpoint\n * Kept for backward compatibility - prefer using GetWorkflowDefinitionRequest with Name field\n */\nexport interface GetWorkflowDefinitionByTitleRequest {\n title: string;\n name?: string; // Preferred over Title\n type?: string; // Optional: filter by type\n orgId: string;\n}\nexport interface ListWorkflowDefinitionsRequest {\n orgId: string;\n status?: string; // Optional: active, inactive, etc\n}\nexport interface ListWorkflowDefinitionsResponse {\n definitions: WorkflowDefinition[];\n metadata: ResponseMetadata;\n}\nexport interface DeleteWorkflowDefinitionRequest {\n id: string;\n orgId: string;\n}\n/**\n * Workflow Definition models\n */\nexport interface WorkflowDefinition {\n /**\n * Core Identity\n */\n id?: string /* uuid */;\n name: string; // Normalized name: lowercase, spaces replaced with dashes (auto-generated from Title)\n title: string;\n description: string;\n type: WorkflowTypeTS; // entity, chat, document, etc.\n /**\n * Graph Structure\n */\n nodes: { [key: string]: WorkflowNode};\n edges: WorkflowEdge[];\n entryPoints: string[]; // List of start node IDs, currently only one\n /**\n * Data Management\n */\n variables: WorkflowVariables;\n constants?: { [key: string]: any};\n /**\n * Runtime Configuration\n */\n persistence?: PersistenceType;\n /**\n * Validation and Constraints\n */\n rules?: WorkflowRule[];\n permissions: WorkflowPermissions;\n /**\n * Metadata and Tracking\n */\n metadata: WorkflowMetadata;\n}\nexport interface WorkflowVariables {\n schema: JSONSchema;\n scope: { [key: string]: string}; // Variable visibility\n defaultValues: { [key: string]: any}; // Default values\n computed: { [key: string]: string}; // Expressions for computed variables\n}\nexport interface WorkflowRule {\n name: string;\n description: string;\n condition: string; // Expression\n action: string; // What to do if condition is met\n level: RuleLevel; // error, warning, info\n}\nexport type RuleLevel = string;\nexport const RuleLevelError: RuleLevel = \"error\";\nexport const RuleLevelWarning: RuleLevel = \"warning\";\nexport const RuleLevelInfo: RuleLevel = \"info\";\nexport interface WorkflowPermissions {\n roles: { [key: string]: string[]}; // Role-based permissions\n accessLevel: string; // public, private, restricted\n editableBy: string[]; // User/Role IDs\n viewableBy: string[]; // User/Role IDs\n}\nexport interface WorkflowMetadata {\n createdBy: string;\n createdAt: string /* RFC3339 */;\n updatedBy?: string;\n updatedAt?: string /* RFC3339 */;\n isActive: boolean;\n version: number /* int */;\n tags?: string[];\n category?: string;\n labels?: string[];\n}\nexport type PersistenceType = string;\nexport const PersistenceTypeEphemeral: PersistenceType = \"ephemeral\";\nexport const PersistenceTypePermanent: PersistenceType = \"permanent\";\n/**\n * todo: validate default values against schema\n */\nexport interface NodeInput {\n schema: JSONSchema;\n defaultValues?: { [key: string]: any};\n}\nexport interface NodeOutput {\n schema: JSONSchema;\n /**\n * Mapping map[string]string `json:\"mapping,omitempty\"`\n */\n values?: { [key: string]: any};\n}\nexport interface NodeConfig {\n schema: JSONSchema; // config schema, the ui must validate against this\n values: { [key: string]: any}; // actual config values\n promoteToVariables?: string[]; // output fields to promote to workflow-level variables\n}\nexport interface WorkflowNode {\n id: string;\n title: string;\n name: string; // ** normalized function name, for example: find_products **\n label?: string;\n description?: string;\n type: WorkflowNodeTypeTS;\n subType?: WorkflowNodeSubTypeTS;\n config: NodeConfig;\n settings: NodeSettings;\n input: NodeInput;\n output: NodeOutput;\n isStart: boolean;\n}\n/**\n * NodeSettings contains type-specific configuration\n */\nexport interface NodeSettings {\n /**\n * Shared configs\n */\n execution?: ExecutionConfig;\n retry?: RetryConfig;\n}\nexport interface ExecutionConfig {\n timeoutSeconds: number /* int */;\n priority: number /* int */;\n subject?: string;\n}\nexport interface RetryConfig {\n maxAttempts: number /* int */;\n initialDelay: any /* time.Duration */;\n maxDelay: any /* time.Duration */;\n backoffMultiplier: number /* float64 */;\n}\n/**\n * CacheConfig defines caching behavior for expression results\n */\nexport interface CacheConfig {\n enabled: boolean;\n ttl: any /* time.Duration */; // How long to cache\n key?: string; // Custom cache key\n tags?: string[];\n}\nexport interface ExpressionConfig {\n type: ExpressionType;\n expression: string;\n variables?: string[]; // Referenced variables\n timeout?: any /* time.Duration */; // Evaluation timeout\n cache?: CacheConfig; // Expression result caching\n}\n/**\n * Example usage in full edge structure\n */\nexport interface WorkflowEdge {\n id: string;\n fromNodeId: string;\n toNodeId: string;\n type: WorkflowEdgeTypeTS;\n label?: string;\n expression?: ExpressionConfig;\n priority: number /* int */;\n retry?: RetryConfig;\n timeout?: TimeoutConfig;\n properties?: { [key: string]: string};\n}\n/**\n * TimeoutConfig defines timeout behavior for nodes and edges\n */\nexport interface TimeoutConfig {\n duration: any /* time.Duration */; // How long to wait\n action: TimeoutAction; // What to do on timeout\n retryPolicy?: RetryConfig; // Optional retry on timeout\n}\nexport type TimeoutAction = string;\nexport const TimeoutActionFail: TimeoutAction = \"fail\"; // Mark as failed\nexport const TimeoutActionSkip: TimeoutAction = \"skip\"; // Skip and continue\nexport const TimeoutActionRetry: TimeoutAction = \"retry\"; // Attempt retry\nexport const TimeoutActionAlt: TimeoutAction = \"alt\"; // Take alternate path\nexport interface CreateWorkflowInstanceRequest {\n orgId: string;\n definitionId: string /* uuid */;\n variables: { [key: string]: any};\n autoExecute: boolean;\n}\nexport interface WorkflowInstanceResponse {\n instance?: WorkflowInstance;\n metadata: ResponseMetadata;\n}\nexport interface WorkflowInstanceExecuteNodeRequest {\n orgId: string;\n instanceId: string /* uuid */;\n nodeId: string;\n input: { [key: string]: any};\n}\nexport interface WorkflowInstanceResumeNodeRequest {\n orgId: string;\n instanceId: string /* uuid */;\n nodeId: string;\n result: { [key: string]: any};\n}\nexport interface WorkflowInstanceExecuteNodeLeanRequest {\n orgId: string;\n nodeDef: WorkflowNode;\n input: { [key: string]: any};\n}\nexport interface UpdateInstanceNodeMetadataRequest {\n orgId: string;\n instanceId: string /* uuid */;\n nodeId: string;\n metadataKey: string;\n payload: any;\n}\nexport interface GetWorkflowInstanceRequest {\n orgId: string;\n instanceId: string /* uuid */;\n}\n/**\n * GetInstanceByStateVariableRequest finds an instance by a variable stored in state.variables\n */\nexport interface GetInstanceByStateVariableRequest {\n orgId: string;\n definitionId: string /* uuid */;\n variableKey: string; // e.g., \"orgId\"\n variableValue: string; // e.g., \"019bf2bf-e713-7936-8a4d-daeb67742a4d\"\n}\nexport interface ListWorkflowInstancesRequest {\n orgId: string;\n definitionId: string /* uuid */;\n userId?: string; // Optional: filter by state.variables.userId\n status?: string; // Optional: filter by instance status\n}\nexport interface ListWorkflowInstancesResponse {\n instances: WorkflowInstance[];\n metadata: ResponseMetadata;\n}\nexport interface UpdateInstanceStatusRequest {\n orgId: string;\n instanceId: string /* uuid */;\n status: InstanceStatus;\n}\nexport interface RetryNodeRequest {\n orgId: string;\n instanceId: string /* uuid */;\n nodeId: string;\n}\nexport interface ListInstancesOptions {\n definitionId: string /* uuid */;\n userId?: string; // Optional: filter by state.variables.userId\n status: InstanceStatus;\n limit: number /* int */;\n offset: number /* int */;\n}\nexport interface InstanceState {\n variables: { [key: string]: any};\n constants: { [key: string]: any};\n nodeStates: { [key: string]: NodeState};\n edgeStates: { [key: string]: EdgeState};\n}\nexport interface ExecutionContext {\n currentNodes: string[];\n path: ExecutionPathEntry[];\n errors: ExecutionError[];\n}\n/**\n * Workflow Instance models\n */\nexport interface WorkflowInstance {\n id?: string /* uuid */;\n orgId?: string /* uuid */;\n definitionId: string /* uuid */;\n definitionName?: string; // Normalized name from definition (lowercase, dashes)\n title?: string;\n description?: string;\n type?: WorkflowType;\n definitionVersion: number /* int */;\n status: InstanceStatus;\n state: InstanceState;\n context: ExecutionContext;\n persistence?: PersistenceType;\n metadata: WorkflowMetadata;\n}\nexport interface NodeState {\n status: NodeStatus;\n input?: { [key: string]: any};\n output?: { [key: string]: any};\n /**\n * Variables map[string]interface{} `json:\"variables,omitempty\"`\n */\n error?: string;\n startTime?: string /* RFC3339 */;\n endTime?: string /* RFC3339 */;\n retryCount: number /* int */;\n nextRetryAt?: string /* RFC3339 */;\n}\nexport interface EdgeState {\n status: EdgeStatus;\n timestamp: string /* RFC3339 */;\n error?: string;\n}\nexport interface ExecutionPathEntry {\n nodeId: string;\n edgeId: string;\n type: string; // node_enter, node_exit, edge_traverse\n timestamp: string /* RFC3339 */;\n data?: { [key: string]: any};\n}\nexport interface ExecutionError {\n nodeId?: string;\n edgeId?: string;\n error: string;\n timestamp: string /* RFC3339 */;\n retryable: boolean;\n}\nexport type InstanceStatus = string;\nexport const InstanceStatusNew: InstanceStatus = \"NEW\";\nexport const InstanceStatusRunning: InstanceStatus = \"RUNNING\";\nexport const InstanceStatusWaiting: InstanceStatus = \"WAITING\";\nexport const InstanceStatusPaused: InstanceStatus = \"PAUSED\";\nexport const InstanceStatusCompleted: InstanceStatus = \"COMPLETED\";\nexport const InstanceStatusFailed: InstanceStatus = \"FAILED\";\nexport interface NodeInstance {\n nodeId: string;\n status: NodeStatus;\n input?: { [key: string]: any};\n output?: { [key: string]: any};\n error?: string;\n startTime?: string /* RFC3339 */;\n endTime?: string /* RFC3339 */;\n retryCount: number /* int */;\n nextRetryAt?: string /* RFC3339 */;\n}\nexport type NodeStatus = string;\nexport const NodeStatusPending: NodeStatus = \"PENDING\";\nexport const NodeStatusRunning: NodeStatus = \"RUNNING\";\nexport const NodeStatusCompleted: NodeStatus = \"COMPLETED\";\nexport const NodeStatusFailed: NodeStatus = \"FAILED\";\nexport const NodeStatusWaiting: NodeStatus = \"WAITING\";\nexport const NodeStatusSkipped: NodeStatus = \"SKIPPED\";\nexport type EdgeStatus = string;\nexport const EdgeStatusPending: EdgeStatus = \"PENDING\";\nexport const EdgeStatusCompleted: EdgeStatus = \"COMPLETED\";\nexport const EdgeStatusSkipped: EdgeStatus = \"SKIPPED\";\n/**\n * WorkflowDefinitionInfo holds summarized info about an active workflow definition\n * Used by schedulers and services that need to process workflows without full definition details\n */\nexport interface WorkflowDefinitionInfo {\n id: string; // Workflow definition ID\n orgId: string; // Organization ID\n title: string;\n type: string; // e.g., \"productivity\", \"entity\"\n category: string; // e.g., \"email\" (from metadata)\n isActive: boolean;\n createdBy: string; // User who created this workflow\n /**\n * User config from definition.variables.defaultValues (workflow-specific)\n */\n provider?: string; // e.g., \"google\" or \"microsoft\" for email workflows\n userEmail?: string; // User's email address\n userId?: string; // User ID who owns this workflow\n}\n","// Code generated by tygo. DO NOT EDIT.\n\n//////////\n// source: subjects.go\n\nexport const WorkflowDefinitionCreate = \"workflow.definition.create\";\nexport const WorkflowDefinitionCreated = \"workflow.definition.created\";\nexport const WorkflowDefinitionUpdate = \"workflow.definition.update\";\nexport const WorkflowDefinitionUpdated = \"workflow.definition.updated\";\nexport const WorkflowDefinitionGet = \"workflow.definition.get\";\nexport const WorkflowDefinitionGetServer = \"workflow.definition.get.server\";\nexport const WorkflowDefinitionGetByTitle = \"workflow.definition.get.by.title\";\nexport const WorkflowDefinitionList = \"workflow.definition.list\";\nexport const WorkflowDefinitionDelete = \"workflow.definition.delete\";\nexport const WorkflowDefinitionDeleted = \"workflow.definition.deleted\";\nexport const WorkflowInstanceCreate = \"workflow.instance.create\";\nexport const WorkflowInstanceExecuteNode = \"workflow.instance.execute.node\";\nexport const WorkflowInstanceResumeNode = \"workflow.instance.resume.node\";\nexport const WorkflowInstanceExecuteNodeServer = \"workflow.instance.execute.node.server\";\nexport const WorkflowInstanceResumeNodeServer = \"workflow.instance.resume.node.server\";\nexport const WorkflowInstanceExecuteNodeLean = \"workflow.instance.execute.node.lean\";\nexport const WorkflowInstanceExecuteNodeLeanServer = \"workflow.instance.execute.node.lean.server\";\nexport const WorkflowInstanceGet = \"workflow.instance.get\";\nexport const WorkflowInstanceGetByStateVariable = \"workflow.instance.get.by.state.variable\";\nexport const WorkflowInstanceList = \"workflow.instance.list\";\nexport const WorkflowInstanceUpdate = \"workflow.instance.update\";\nexport const WorkflowInstanceUpdated = \"workflow.instance.updated\";\nexport const WorkflowInstanceUpdateNodeMetadata = \"workflow.instance.update.node.metadata\";\n/**\n * Template management\n */\nexport const WorkflowTemplateList = \"workflow.template.list\";\nexport const WorkflowTemplateGet = \"workflow.template.get\";\nexport const WorkflowTemplateInstantiate = \"workflow.template.instantiate\";\n/**\n * Schedule management\n */\nexport const WorkflowScheduleCreate = \"workflow.schedule.create\";\nexport const WorkflowScheduleUpdate = \"workflow.schedule.update\";\nexport const WorkflowScheduleDelete = \"workflow.schedule.delete\";\nexport const WorkflowScheduleList = \"workflow.schedule.list\";\nexport const WorkflowSchedulePause = \"workflow.schedule.pause\";\nexport const WorkflowScheduleResume = \"workflow.schedule.resume\";\n/**\n * Trigger management\n */\nexport const WorkflowTriggerRegister = \"workflow.trigger.register\";\nexport const WorkflowTriggerPause = \"workflow.trigger.pause\";\nexport const WorkflowTriggerResume = \"workflow.trigger.resume\";\nexport const WorkflowTriggerStatus = \"workflow.trigger.status\";\nexport const WorkflowTriggerFired = \"workflow.trigger.fired\";\n/**\n * Execution events\n */\nexport const WorkflowExecutionStarted = \"workflow.execution.started\";\nexport const WorkflowExecutionCompleted = \"workflow.execution.completed\";\nexport const WorkflowExecutionFailed = \"workflow.execution.failed\";\n"]}
1
+ {"version":3,"sources":["/home/runner/work/eloquent/eloquent/packages/@elqnt/workflow/dist/chunk-H24IF5AA.js","../models/workflow.ts","../models/subjects.ts"],"names":[],"mappings":"AAAA,qFAAY;AACZ;AACA;ACUO,IAAM,gBAAA,EAA4B,SAAA;AAClC,IAAM,oBAAA,EAAgC,aAAA;AACtC,IAAM,cAAA,EAA0B,OAAA;AAChC,IAAM,eAAA,EAA2B,QAAA;AACjC,IAAM,cAAA,EAA0B,OAAA;AAChC,IAAM,aAAA,EAAyB,MAAA;AAC/B,IAAM,iBAAA,EAA6B,UAAA;AACnC,IAAM,cAAA,EAA0B,OAAA;AAChC,IAAM,aAAA,EAAyB,MAAA;AAC/B,IAAM,oBAAA,EAAgC,aAAA;AACtC,IAAM,cAAA,EAA0B,OAAA;AAChC,IAAM,gBAAA,EAA4B,SAAA;AAClC,IAAM,eAAA,EAA2B,QAAA;AACjC,IAAM,mBAAA,EAA+B,YAAA;AACrC,IAAM,2BAAA,EAAuC,oBAAA;AAS7C,IAAM,wBAAA,EAAuC,cAAA;AAC7C,IAAM,sCAAA,EAAqD,4BAAA;AAC3D,IAAM,sCAAA,EAAqD,4BAAA;AAC3D,IAAM,sCAAA,EAAqD,4BAAA;AAC3D,IAAM,6BAAA,EAA4C,mBAAA;AAClD,IAAM,4BAAA,EAA2C,kBAAA;AACjD,IAAM,6BAAA,EAA4C,mBAAA;AAClD,IAAM,kCAAA,EAAiD,wBAAA;AAIvD,IAAM,6BAAA,EAA4C,mBAAA;AAClD,IAAM,+BAAA,EAA8C,qBAAA;AACpD,IA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;AAIpC,IAAM,uBAAA,EAAyB,0BAAA;AAC/B,IAAM,uBAAA,EAAyB,0BAAA;AAC/B,IAAM,uBAAA,EAAyB,0BAAA;AAC/B,IAAM,qBAAA,EAAuB,wBAAA;AAC7B,IAAM,sBAAA,EAAwB,yBAAA;AAC9B,IAAM,uBAAA,EAAyB,0BAAA;AAI/B,IAAM,wBAAA,EAA0B,2BAAA;AAChC,IAAM,qBAAA,EAAuB,wBAAA;AAC7B,IAAM,sBAAA,EAAwB,yBAAA;AAC9B,IAAM,sBAAA,EAAwB,yBAAA;AAC9B,IAAM,qBAAA,EAAuB,wBAAA;AAI7B,IAAM,yBAAA,EAA2B,4BAAA;AACjC,IAAM,2BAAA,EAA6B,8BAAA;AACnC,IAAM,wBAAA,EAA0B,2BAAA;AFkGvC;AACA;AACE;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACF,gkRAAC","file":"/home/runner/work/eloquent/eloquent/packages/@elqnt/workflow/dist/chunk-H24IF5AA.js","sourcesContent":[null,"// Code generated by tygo. DO NOT EDIT.\nimport { EntityFilterOperatorTS } from \"@elqnt/entity\";\nimport { JSONSchema, ResponseMetadata } from \"@elqnt/types\";\nimport { NodeSubTypeTS, WorkflowTypeTS, WorkflowNodeTypeTS, WorkflowNodeSubTypeTS, WorkflowEdgeTypeTS } from \"../schema/schemas\";\n\n//////////\n// source: constants.go\n\n/**\n * NodeType represents the primary type of a workflow node\n */\nexport type NodeType = string;\nexport const NodeTypeTrigger: NodeType = \"trigger\";\nexport const NodeTypeHumanAction: NodeType = \"humanAction\";\nexport const NodeTypeAgent: NodeType = \"agent\";\nexport const NodeTypeAction: NodeType = \"action\";\nexport const NodeTypeLogic: NodeType = \"logic\";\nexport const NodeTypeLoop: NodeType = \"loop\";\nexport const NodeTypeParallel: NodeType = \"parallel\";\nexport const NodeTypeDelay: NodeType = \"delay\";\nexport const NodeTypeData: NodeType = \"data\";\nexport const NodeTypeIntegration: NodeType = \"integration\";\nexport const NodeTypeTimer: NodeType = \"timer\";\nexport const NodeTypeSubflow: NodeType = \"subflow\";\nexport const NodeTypeCustom: NodeType = \"custom\";\nexport const NodeTypeAccounting: NodeType = \"accounting\";\nexport const NodeTypeDocumentExtraction: NodeType = \"documentExtraction\";\n/**\n * NodeSubType represents the subtype of a workflow node\n * All node subtypes are unified under this single type\n */\nexport type NodeSubType = string;\n/**\n * Trigger subtypes\n */\nexport const NodeSubTypeTriggerStart: NodeSubType = \"triggerStart\";\nexport const NodeSubTypeTriggerEntityRecordCreated: NodeSubType = \"triggerEntityRecordCreated\";\nexport const NodeSubTypeTriggerEntityRecordUpdated: NodeSubType = \"triggerEntityRecordUpdated\";\nexport const NodeSubTypeTriggerEntityRecordDeleted: NodeSubType = \"triggerEntityRecordDeleted\";\nexport const NodeSubTypeTriggerSLAWarning: NodeSubType = \"triggerSLAWarning\";\nexport const NodeSubTypeTriggerSLABreach: NodeSubType = \"triggerSLABreach\";\nexport const NodeSubTypeTriggerEscalation: NodeSubType = \"triggerEscalation\";\nexport const NodeSubTypeTriggerWebhookReceived: NodeSubType = \"triggerWebhookReceived\";\n/**\n * Human action subtypes\n */\nexport const NodeSubTypeHumanActionReview: NodeSubType = \"humanActionReview\"; // review means will be able to edit the fields and move to next node (no approval)\nexport const NodeSubTypeHumanActionApproval: NodeSubType = \"humanActionApproval\"; // approval means will be able to edit the fields and move to next node (with approval)\nexport const NodeSubTypeHumanActionDataEntry: NodeSubType = \"humanActionDataEntry\"; // data entry means will be able to fill the fields and move to next node (no approval)\nexport const NodeSubTypeHumanActionAssignment: NodeSubType = \"humanActionAssignment\"; // assignment means will be able to only assign the task to a user (no approval)\n/**\n * Agent subtypes\n */\nexport const NodeSubTypeAgentChat: NodeSubType = \"agentChat\";\nexport const NodeSubTypeAgentIntentDetector: NodeSubType = \"agentIntentDetector\";\nexport const NodeSubTypeAgentKnowledgeGraph: NodeSubType = \"agentKnowledgeGraph\";\nexport const NodeSubTypeAgentClientApiCall: NodeSubType = \"clientApiCall\";\nexport const NodeSubTypeAgentTransferToHuman: NodeSubType = \"agentTransferToHuman\";\nexport const NodeSubTypeAgentOpenTicket: NodeSubType = \"agentOpenTicket\";\nexport const NodeSubTypeAgentApiIntegration: NodeSubType = \"agentApiIntegration\";\nexport const NodeSubTypeAgentCustomResponse: NodeSubType = \"agentCustomResponse\";\nexport const NodeSubTypeAgentStructuredOutput: NodeSubType = \"agentStructuredOutput\"; // Generic structured output using OpenAI with dynamic input/output schemas\n/**\n * Action subtypes\n */\nexport const NodeSubTypeActionApiCall: NodeSubType = \"actionApiCall\";\nexport const NodeSubTypeActionDocumentExtraction: NodeSubType = \"actionDocumentExtraction\";\nexport const NodeSubTypeActionSendEmail: NodeSubType = \"actionSendEmail\";\nexport const NodeSubTypeActionSendSMS: NodeSubType = \"actionSendSMS\";\nexport const NodeSubTypeActionGenerateDocument: NodeSubType = \"actionGenerateDocument\";\nexport const NodeSubTypeActionProcessPayment: NodeSubType = \"actionProcessPayment\";\nexport const NodeSubTypeActionCreateEntityRecord: NodeSubType = \"actionCreateEntityRecord\";\nexport const NodeSubTypeActionUpdateEntityRecord: NodeSubType = \"actionUpdateEntityRecord\";\nexport const NodeSubTypeActionDeleteEntityRecord: NodeSubType = \"actionDeleteEntityRecord\";\nexport const NodeSubTypeActionMergeEntityRecords: NodeSubType = \"actionMergeEntityRecords\";\nexport const NodeSubTypeActionAssignSLAPolicy: NodeSubType = \"actionAssignSLAPolicy\";\nexport const NodeSubTypeActionChangeSLAStatus: NodeSubType = \"actionChangeSLAAssignmentStatus\";\nexport const NodeSubTypeActionEscalateSLA: NodeSubType = \"actionEscalateSLAAssignment\";\nexport const NodeSubTypeActionCSATSurvey: NodeSubType = \"actionCSATSurvey\";\nexport const NodeSubTypeActionSetVariables: NodeSubType = \"actionSetVariables\"; // Passthrough node that sets variables from config values\nexport const NodeSubTypeActionQueryEntityRecords: NodeSubType = \"actionQueryEntityRecords\"; // Query entity records with filters\nexport const NodeSubTypeActionNatsRequest: NodeSubType = \"actionNatsRequest\"; // Execute a NATS request-reply call\n/**\n * Logic subtypes\n */\nexport const NodeSubTypeLogicIf: NodeSubType = \"logicIf\";\nexport const NodeSubTypeLogicSwitch: NodeSubType = \"logicSwitch\";\nexport const NodeSubTypeLogicFor: NodeSubType = \"logicFor\";\nexport const NodeSubTypeLogicParallel: NodeSubType = \"logicParallel\";\n/**\n * Loop subtypes\n */\nexport const NodeSubTypeLoopData: NodeSubType = \"loopData\";\n/**\n * Delay subtypes\n */\nexport const NodeSubTypeDelay: NodeSubType = \"delay\";\n/**\n * Data subtypes\n */\nexport const NodeSubTypeDataFilter: NodeSubType = \"dataFilter\";\nexport const NodeSubTypeDataMap: NodeSubType = \"dataMap\";\nexport const NodeSubTypeDataCalculate: NodeSubType = \"dataCalculate\";\nexport const NodeSubTypeDataValidate: NodeSubType = \"dataValidate\";\n/**\n * Timer subtypes\n */\nexport const NodeSubTypeTimerDelay: NodeSubType = \"timerDelay\";\nexport const NodeSubTypeTimerSchedule: NodeSubType = \"timerSchedule\";\nexport const NodeSubTypeTimerBusinessHours: NodeSubType = \"timerBusinessHours\";\n/**\n * ExpressionType defines the type of expression evaluation to be used\n */\nexport type ExpressionType = string;\n/**\n * Simple filter-based expressions using predefined operators\n */\nexport const ExpressionTypeFilter: ExpressionType = \"filter\";\n/**\n * JavaScript-like expressions with full language features\n */\nexport const ExpressionTypeJavaScript: ExpressionType = \"javascript\";\n/**\n * Template expressions with variable interpolation\n */\nexport const ExpressionTypeTemplate: ExpressionType = \"template\";\n/**\n * Custom domain-specific language expressions\n */\nexport const ExpressionTypeDSL: ExpressionType = \"dsl\";\n/**\n * Complex rule-based expressions (e.g., business rules)\n */\nexport const ExpressionTypeRules: ExpressionType = \"rules\";\n/**\n * EdgeType defines the type and behavior of workflow edges\n */\nexport type EdgeType = string;\n/**\n * Standard flow between nodes\n */\nexport const EdgeTypeNormal: EdgeType = \"normal\";\n/**\n * Loop back to previous node\n */\nexport const EdgeTypeLoopBack: EdgeType = \"loopBack\";\n/**\n * Error handling path\n */\nexport const EdgeTypeError: EdgeType = \"error\";\n/**\n * Fallback/default path when no other conditions match\n */\nexport const EdgeTypeDefault: EdgeType = \"default\";\n/**\n * Path for parallel execution branch\n */\nexport const EdgeTypeParallel: EdgeType = \"parallel\";\n/**\n * Path for conditional branching\n */\nexport const EdgeTypeConditional: EdgeType = \"conditional\";\n/**\n * Path for merging parallel branches\n */\nexport const EdgeTypeMerge: EdgeType = \"merge\";\n/**\n * Compensating/rollback path\n */\nexport const EdgeTypeCompensation: EdgeType = \"compensation\";\n/**\n * Path for timeout/deadline handling\n */\nexport const EdgeTypeTimeout: EdgeType = \"timeout\";\nexport type WorkflowType = string;\nexport const WorkflowTypeEntity: WorkflowType = \"entity\";\nexport const WorkflowTypeDocument: WorkflowType = \"document\";\nexport const WorkflowTypeChat: WorkflowType = \"chat\";\nexport const WorkflowTypeAgent: WorkflowType = \"agent\";\nexport const WorkflowTypeProductivity: WorkflowType = \"productivity\";\n\n//////////\n// source: node-definitions.go\n\n/**\n * NodeDefinition is the design-time template for creating WorkflowNode instances.\n * This is the single source of truth for all node types in the workflow system.\n * Generated to TypeScript via schema-generator for use in the workflow designer UI.\n */\nexport interface NodeDefinition {\n type: NodeType;\n subType: NodeSubTypeTS;\n label: string;\n icon: string;\n description: string;\n category: string;\n config: JSONSchema;\n input: JSONSchema;\n output: JSONSchema;\n}\n/**\n * EdgeTypeDefinition defines metadata for an edge type\n */\nexport interface EdgeTypeDefinition {\n value: string;\n label: string;\n}\n/**\n * WorkflowTypeDefinition defines metadata for a workflow type\n */\nexport interface WorkflowTypeDefinition {\n value: string;\n label: string;\n}\n\n//////////\n// source: workflow-helper-models.go\n\nexport interface LogicPath {\n id: string;\n nodeId: string;\n condition: string; // \"true\"/\"false\" for if, value for switch\n priority: number /* int */; // For ordering multiple possible paths\n}\nexport interface Intent {\n id: string;\n nodeId: string;\n name: string;\n description: string;\n}\n\n//////////\n// source: workflows-base-models.go\n\nexport interface Metadata {\n createdBy: string;\n createdAt: string /* RFC3339 */;\n updatedBy?: string;\n updatedAt?: string /* RFC3339 */;\n isActive: boolean;\n version: number /* int */;\n}\nexport interface CreateWorkflowDefinitionRequest {\n definition: WorkflowDefinition;\n orgId: string;\n}\nexport interface UpdateWorkflowDefinitionRequest {\n definition: WorkflowDefinition;\n orgId: string;\n}\nexport interface WorkflowDefinitionResponse {\n definition: WorkflowDefinition;\n metadata: ResponseMetadata;\n}\nexport interface GetWorkflowDefinitionRequest {\n id?: string /* uuid */; // Lookup by ID\n name?: string; // Or lookup by name (normalized: lowercase, dashes)\n title?: string; // Or lookup by title (deprecated, use name)\n type?: string; // Optional: filter by type when looking up by name/title\n orgId: string;\n}\n/**\n * GetWorkflowDefinitionByTitleRequest is used for the legacy workflow.definition.get.by.title endpoint\n * Kept for backward compatibility - prefer using GetWorkflowDefinitionRequest with Name field\n */\nexport interface GetWorkflowDefinitionByTitleRequest {\n title: string;\n name?: string; // Preferred over Title\n type?: string; // Optional: filter by type\n orgId: string;\n}\nexport interface ListWorkflowDefinitionsRequest {\n orgId: string;\n status?: string; // Optional: active, inactive, etc\n}\nexport interface ListWorkflowDefinitionsResponse {\n definitions: WorkflowDefinition[];\n metadata: ResponseMetadata;\n}\nexport interface DeleteWorkflowDefinitionRequest {\n id: string;\n orgId: string;\n}\n/**\n * Workflow Definition models\n */\nexport interface WorkflowDefinition {\n /**\n * Core Identity\n */\n id?: string /* uuid */;\n name: string; // Normalized name: lowercase, spaces replaced with dashes (auto-generated from Title)\n title: string;\n description: string;\n type: WorkflowTypeTS; // entity, chat, document, etc.\n /**\n * Graph Structure\n */\n nodes: { [key: string]: WorkflowNode};\n edges: WorkflowEdge[];\n entryPoints: string[]; // List of start node IDs, currently only one\n /**\n * Data Management\n */\n variables: WorkflowVariables;\n constants?: { [key: string]: any};\n /**\n * Runtime Configuration\n */\n persistence?: PersistenceType;\n /**\n * Validation and Constraints\n */\n rules?: WorkflowRule[];\n permissions: WorkflowPermissions;\n /**\n * Metadata and Tracking\n */\n metadata: WorkflowMetadata;\n}\nexport interface WorkflowVariables {\n schema: JSONSchema;\n scope: { [key: string]: string}; // Variable visibility\n defaultValues: { [key: string]: any}; // Default values\n computed: { [key: string]: string}; // Expressions for computed variables\n}\nexport interface WorkflowRule {\n name: string;\n description: string;\n condition: string; // Expression\n action: string; // What to do if condition is met\n level: RuleLevel; // error, warning, info\n}\nexport type RuleLevel = string;\nexport const RuleLevelError: RuleLevel = \"error\";\nexport const RuleLevelWarning: RuleLevel = \"warning\";\nexport const RuleLevelInfo: RuleLevel = \"info\";\nexport interface WorkflowPermissions {\n roles: { [key: string]: string[]}; // Role-based permissions\n accessLevel: string; // public, private, restricted\n editableBy: string[]; // User/Role IDs\n viewableBy: string[]; // User/Role IDs\n}\nexport interface WorkflowMetadata {\n createdBy: string;\n createdAt: string /* RFC3339 */;\n updatedBy?: string;\n updatedAt?: string /* RFC3339 */;\n isActive: boolean;\n version: number /* int */;\n tags?: string[];\n category?: string;\n labels?: string[];\n}\nexport type PersistenceType = string;\nexport const PersistenceTypeEphemeral: PersistenceType = \"ephemeral\";\nexport const PersistenceTypePermanent: PersistenceType = \"permanent\";\n/**\n * todo: validate default values against schema\n */\nexport interface NodeInput {\n schema: JSONSchema;\n defaultValues?: { [key: string]: any};\n}\nexport interface NodeOutput {\n schema: JSONSchema;\n /**\n * Mapping map[string]string `json:\"mapping,omitempty\"`\n */\n values?: { [key: string]: any};\n}\nexport interface NodeConfig {\n schema: JSONSchema; // config schema, the ui must validate against this\n values: { [key: string]: any}; // actual config values\n promoteToVariables?: string[]; // output fields to promote to workflow-level variables\n}\nexport interface WorkflowNode {\n id: string;\n title: string;\n name: string; // ** normalized function name, for example: find_products **\n label?: string;\n description?: string;\n type: WorkflowNodeTypeTS;\n subType?: WorkflowNodeSubTypeTS;\n config: NodeConfig;\n settings: NodeSettings;\n input: NodeInput;\n output: NodeOutput;\n isStart: boolean;\n}\n/**\n * NodeSettings contains type-specific configuration\n */\nexport interface NodeSettings {\n /**\n * Shared configs\n */\n execution?: ExecutionConfig;\n retry?: RetryConfig;\n}\nexport interface ExecutionConfig {\n timeoutSeconds: number /* int */;\n priority: number /* int */;\n subject?: string;\n}\nexport interface RetryConfig {\n maxAttempts: number /* int */;\n initialDelay: any /* time.Duration */;\n maxDelay: any /* time.Duration */;\n backoffMultiplier: number /* float64 */;\n}\n/**\n * CacheConfig defines caching behavior for expression results\n */\nexport interface CacheConfig {\n enabled: boolean;\n ttl: any /* time.Duration */; // How long to cache\n key?: string; // Custom cache key\n tags?: string[];\n}\nexport interface ExpressionConfig {\n type: ExpressionType;\n expression: string;\n variables?: string[]; // Referenced variables\n timeout?: any /* time.Duration */; // Evaluation timeout\n cache?: CacheConfig; // Expression result caching\n}\n/**\n * Example usage in full edge structure\n */\nexport interface WorkflowEdge {\n id: string;\n fromNodeId: string;\n toNodeId: string;\n type: WorkflowEdgeTypeTS;\n label?: string;\n expression?: ExpressionConfig;\n priority: number /* int */;\n retry?: RetryConfig;\n timeout?: TimeoutConfig;\n properties?: { [key: string]: string};\n}\n/**\n * TimeoutConfig defines timeout behavior for nodes and edges\n */\nexport interface TimeoutConfig {\n duration: any /* time.Duration */; // How long to wait\n action: TimeoutAction; // What to do on timeout\n retryPolicy?: RetryConfig; // Optional retry on timeout\n}\nexport type TimeoutAction = string;\nexport const TimeoutActionFail: TimeoutAction = \"fail\"; // Mark as failed\nexport const TimeoutActionSkip: TimeoutAction = \"skip\"; // Skip and continue\nexport const TimeoutActionRetry: TimeoutAction = \"retry\"; // Attempt retry\nexport const TimeoutActionAlt: TimeoutAction = \"alt\"; // Take alternate path\nexport interface CreateWorkflowInstanceRequest {\n orgId: string;\n definitionId: string /* uuid */;\n variables: { [key: string]: any};\n autoExecute: boolean;\n}\nexport interface WorkflowInstanceResponse {\n instance?: WorkflowInstance;\n metadata: ResponseMetadata;\n}\nexport interface WorkflowInstanceExecuteNodeRequest {\n orgId: string;\n instanceId: string /* uuid */;\n nodeId: string;\n input: { [key: string]: any};\n}\nexport interface WorkflowInstanceResumeNodeRequest {\n orgId: string;\n instanceId: string /* uuid */;\n nodeId: string;\n result: { [key: string]: any};\n}\nexport interface WorkflowInstanceExecuteNodeLeanRequest {\n orgId: string;\n nodeDef: WorkflowNode;\n input: { [key: string]: any};\n}\nexport interface UpdateInstanceNodeMetadataRequest {\n orgId: string;\n instanceId: string /* uuid */;\n nodeId: string;\n metadataKey: string;\n payload: any;\n}\nexport interface GetWorkflowInstanceRequest {\n orgId: string;\n instanceId: string /* uuid */;\n}\n/**\n * GetInstanceByStateVariableRequest finds an instance by a variable stored in state.variables\n */\nexport interface GetInstanceByStateVariableRequest {\n orgId: string;\n definitionId: string /* uuid */;\n variableKey: string; // e.g., \"orgId\"\n variableValue: string; // e.g., \"019bf2bf-e713-7936-8a4d-daeb67742a4d\"\n}\nexport interface ListWorkflowInstancesRequest {\n orgId: string;\n definitionId: string /* uuid */;\n userId?: string; // Optional: filter by state.variables.userId\n status?: string; // Optional: filter by instance status\n}\nexport interface ListWorkflowInstancesResponse {\n instances: WorkflowInstance[];\n metadata: ResponseMetadata;\n}\nexport interface UpdateInstanceStatusRequest {\n orgId: string;\n instanceId: string /* uuid */;\n status: InstanceStatus;\n}\nexport interface RetryNodeRequest {\n orgId: string;\n instanceId: string /* uuid */;\n nodeId: string;\n}\nexport interface ListInstancesOptions {\n definitionId: string /* uuid */;\n userId?: string; // Optional: filter by state.variables.userId\n status: InstanceStatus;\n limit: number /* int */;\n offset: number /* int */;\n}\nexport interface InstanceState {\n variables: { [key: string]: any};\n constants: { [key: string]: any};\n nodeStates: { [key: string]: NodeState};\n edgeStates: { [key: string]: EdgeState};\n}\nexport interface ExecutionContext {\n currentNodes: string[];\n path: ExecutionPathEntry[];\n errors: ExecutionError[];\n}\n/**\n * Workflow Instance models\n */\nexport interface WorkflowInstance {\n id?: string /* uuid */;\n orgId?: string /* uuid */;\n definitionId: string /* uuid */;\n definitionName?: string; // Normalized name from definition (lowercase, dashes)\n title?: string;\n description?: string;\n type?: WorkflowType;\n definitionVersion: number /* int */;\n status: InstanceStatus;\n state: InstanceState;\n context: ExecutionContext;\n persistence?: PersistenceType;\n metadata: WorkflowMetadata;\n}\nexport interface NodeState {\n status: NodeStatus;\n input?: { [key: string]: any};\n output?: { [key: string]: any};\n /**\n * Variables map[string]interface{} `json:\"variables,omitempty\"`\n */\n error?: string;\n startTime?: string /* RFC3339 */;\n endTime?: string /* RFC3339 */;\n retryCount: number /* int */;\n nextRetryAt?: string /* RFC3339 */;\n}\nexport interface EdgeState {\n status: EdgeStatus;\n timestamp: string /* RFC3339 */;\n error?: string;\n}\nexport interface ExecutionPathEntry {\n nodeId: string;\n edgeId: string;\n type: string; // node_enter, node_exit, edge_traverse\n timestamp: string /* RFC3339 */;\n data?: { [key: string]: any};\n}\nexport interface ExecutionError {\n nodeId?: string;\n edgeId?: string;\n error: string;\n timestamp: string /* RFC3339 */;\n retryable: boolean;\n}\nexport type InstanceStatus = string;\nexport const InstanceStatusNew: InstanceStatus = \"NEW\";\nexport const InstanceStatusRunning: InstanceStatus = \"RUNNING\";\nexport const InstanceStatusWaiting: InstanceStatus = \"WAITING\";\nexport const InstanceStatusPaused: InstanceStatus = \"PAUSED\";\nexport const InstanceStatusCompleted: InstanceStatus = \"COMPLETED\";\nexport const InstanceStatusFailed: InstanceStatus = \"FAILED\";\nexport interface NodeInstance {\n nodeId: string;\n status: NodeStatus;\n input?: { [key: string]: any};\n output?: { [key: string]: any};\n error?: string;\n startTime?: string /* RFC3339 */;\n endTime?: string /* RFC3339 */;\n retryCount: number /* int */;\n nextRetryAt?: string /* RFC3339 */;\n}\nexport type NodeStatus = string;\nexport const NodeStatusPending: NodeStatus = \"PENDING\";\nexport const NodeStatusRunning: NodeStatus = \"RUNNING\";\nexport const NodeStatusCompleted: NodeStatus = \"COMPLETED\";\nexport const NodeStatusFailed: NodeStatus = \"FAILED\";\nexport const NodeStatusWaiting: NodeStatus = \"WAITING\";\nexport const NodeStatusSkipped: NodeStatus = \"SKIPPED\";\nexport type EdgeStatus = string;\nexport const EdgeStatusPending: EdgeStatus = \"PENDING\";\nexport const EdgeStatusCompleted: EdgeStatus = \"COMPLETED\";\nexport const EdgeStatusSkipped: EdgeStatus = \"SKIPPED\";\n/**\n * WorkflowDefinitionInfo holds summarized info about an active workflow definition\n * Used by schedulers and services that need to process workflows without full definition details\n */\nexport interface WorkflowDefinitionInfo {\n id: string; // Workflow definition ID\n orgId: string; // Organization ID\n title: string;\n type: string; // e.g., \"productivity\", \"entity\"\n category: string; // e.g., \"email\" (from metadata)\n isActive: boolean;\n createdBy: string; // User who created this workflow\n /**\n * User config from definition.variables.defaultValues (workflow-specific)\n */\n provider?: string; // e.g., \"google\" or \"microsoft\" for email workflows\n userEmail?: string; // User's email address\n userId?: string; // User ID who owns this workflow\n}\n","// Code generated by tygo. DO NOT EDIT.\n\n//////////\n// source: subjects.go\n\nexport const WorkflowDefinitionCreate = \"workflow.definition.create\";\nexport const WorkflowDefinitionCreated = \"workflow.definition.created\";\nexport const WorkflowDefinitionUpdate = \"workflow.definition.update\";\nexport const WorkflowDefinitionUpdated = \"workflow.definition.updated\";\nexport const WorkflowDefinitionGet = \"workflow.definition.get\";\nexport const WorkflowDefinitionGetServer = \"workflow.definition.get.server\";\nexport const WorkflowDefinitionGetByTitle = \"workflow.definition.get.by.title\";\nexport const WorkflowDefinitionList = \"workflow.definition.list\";\nexport const WorkflowDefinitionDelete = \"workflow.definition.delete\";\nexport const WorkflowDefinitionDeleted = \"workflow.definition.deleted\";\nexport const WorkflowInstanceCreate = \"workflow.instance.create\";\nexport const WorkflowInstanceExecuteNode = \"workflow.instance.execute.node\";\nexport const WorkflowInstanceResumeNode = \"workflow.instance.resume.node\";\nexport const WorkflowInstanceExecuteNodeServer = \"workflow.instance.execute.node.server\";\nexport const WorkflowInstanceResumeNodeServer = \"workflow.instance.resume.node.server\";\nexport const WorkflowInstanceExecuteNodeLean = \"workflow.instance.execute.node.lean\";\nexport const WorkflowInstanceExecuteNodeLeanServer = \"workflow.instance.execute.node.lean.server\";\nexport const WorkflowInstanceGet = \"workflow.instance.get\";\nexport const WorkflowInstanceGetByStateVariable = \"workflow.instance.get.by.state.variable\";\nexport const WorkflowInstanceList = \"workflow.instance.list\";\nexport const WorkflowInstanceUpdate = \"workflow.instance.update\";\nexport const WorkflowInstanceUpdated = \"workflow.instance.updated\";\nexport const WorkflowInstanceUpdateNodeMetadata = \"workflow.instance.update.node.metadata\";\n/**\n * Template management\n */\nexport const WorkflowTemplateList = \"workflow.template.list\";\nexport const WorkflowTemplateGet = \"workflow.template.get\";\nexport const WorkflowTemplateInstantiate = \"workflow.template.instantiate\";\n/**\n * Schedule management\n */\nexport const WorkflowScheduleCreate = \"workflow.schedule.create\";\nexport const WorkflowScheduleUpdate = \"workflow.schedule.update\";\nexport const WorkflowScheduleDelete = \"workflow.schedule.delete\";\nexport const WorkflowScheduleList = \"workflow.schedule.list\";\nexport const WorkflowSchedulePause = \"workflow.schedule.pause\";\nexport const WorkflowScheduleResume = \"workflow.schedule.resume\";\n/**\n * Trigger management\n */\nexport const WorkflowTriggerRegister = \"workflow.trigger.register\";\nexport const WorkflowTriggerPause = \"workflow.trigger.pause\";\nexport const WorkflowTriggerResume = \"workflow.trigger.resume\";\nexport const WorkflowTriggerStatus = \"workflow.trigger.status\";\nexport const WorkflowTriggerFired = \"workflow.trigger.fired\";\n/**\n * Execution events\n */\nexport const WorkflowExecutionStarted = \"workflow.execution.started\";\nexport const WorkflowExecutionCompleted = \"workflow.execution.completed\";\nexport const WorkflowExecutionFailed = \"workflow.execution.failed\";\n"]}
@@ -1 +1 @@
1
- {"version":3,"sources":["/home/runner/work/eloquent-packages/eloquent-packages/packages/workflow/dist/chunk-JES2EBNO.js","../api/index.ts"],"names":[],"mappings":"AAAA,qFAAY;AACZ;AACA;ACKA,oDAAkC;AA+ClC,MAAA,SAAsB,gBAAA,CACpB,OAAA,EACuD;AACvD,EAAA,OAAO,wCAAA,mBAAkB,EAAqB,EAAE,MAAA,EAAQ,KAAA,EAAO,GAAG,QAAQ,CAAC,CAAA;AAC7E;AAEA,MAAA,SAAsB,cAAA,CACpB,UAAA,EACA,OAAA,EACkD;AAClD,EAAA,OAAO,wCAAA,CAAkB,kBAAA,EAAqB,UAAU,CAAA,CAAA;AAC1D;AAKsE;AACZ,EAAA;AAC1D;AAKE;AAEwD,EAAA;AAC1D;AAK0E;AAChB,EAAA;AAC1D;AAQE;AAG8C,EAAA;AACpC,IAAA;AACF,IAAA;AACH,IAAA;AACJ,EAAA;AACH;AAKkD;AACQ,EAAA;AAC1D;AAIE;AAEmC,EAAA;AACoB,EAAA;AACA,EAAA;AACnB,EAAA;AAC7B,EAAA;AACyC,IAAA;AAClB,IAAA;AAC9B,EAAA;AACF;AAIE;AAGwD,EAAA;AAC9C,IAAA;AACO,IAAA;AACZ,IAAA;AACJ,EAAA;AACH;AAKE;AAGwD,EAAA;AAC9C,IAAA;AACM,IAAA;AACX,IAAA;AACJ,EAAA;AACH;AAKE;AAGwD,EAAA;AAC9C,IAAA;AACO,IAAA;AACZ,IAAA;AACJ,EAAA;AACH;AAKE;AAEwD,EAAA;AAC9C,IAAA;AACD,IAAA;AACJ,IAAA;AACJ,EAAA;AACH;AAQuD;AAClB,EAAA;AACkB,EAAA;AACjB,EAAA;AAC7B,EAAA;AAC2C,IAAA;AACpB,IAAA;AAC9B,EAAA;AACF;AAKqD;AACK,EAAA;AAC1D;AAIE;AAGwD,EAAA;AAC9C,IAAA;AACF,IAAA;AACH,IAAA;AACJ,EAAA;AACH;AD3H2D;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA","file":"/home/runner/work/eloquent-packages/eloquent-packages/packages/workflow/dist/chunk-JES2EBNO.js","sourcesContent":[null,"/**\n * Workflow API functions\n *\n * Browser-side API client for workflow operations.\n * Uses @elqnt/api-client for HTTP requests with automatic token management.\n */\n\nimport { browserApiRequest } from \"@elqnt/api-client/browser\";\nimport type { ApiResponse, ApiClientOptions } from \"@elqnt/api-client\";\nimport type { ResponseMetadata } from \"@elqnt/types\";\nimport type {\n WorkflowDefinition,\n WorkflowInstance,\n ListWorkflowDefinitionsResponse,\n WorkflowDefinitionResponse,\n WorkflowInstanceResponse,\n ListWorkflowInstancesResponse,\n} from \"../models\";\n\n// =============================================================================\n// TYPES\n// =============================================================================\n\nexport interface WorkflowTemplate {\n id: string;\n name: string;\n title: string;\n description: string;\n category: string;\n variables: Array<{\n name: string;\n type: string;\n required: boolean;\n description?: string;\n }>;\n preview?: string;\n createdAt: string;\n updatedAt: string;\n}\n\nexport interface ListWorkflowTemplatesResponse {\n templates: WorkflowTemplate[];\n metadata: ResponseMetadata;\n}\n\nexport interface GetWorkflowTemplateResponse {\n template: WorkflowTemplate;\n metadata: ResponseMetadata;\n}\n\n// =============================================================================\n// WORKFLOW DEFINITIONS\n// =============================================================================\n\nexport async function listWorkflowsApi(\n options: ApiClientOptions\n): Promise<ApiResponse<ListWorkflowDefinitionsResponse>> {\n return browserApiRequest(\"/api/v1/workflows\", { method: \"GET\", ...options });\n}\n\nexport async function getWorkflowApi(\n workflowId: string,\n options: ApiClientOptions\n): Promise<ApiResponse<WorkflowDefinitionResponse>> {\n return browserApiRequest(`/api/v1/workflows/${workflowId}`, { method: \"GET\", ...options });\n}\n\nexport async function createWorkflowApi(\n workflow: Partial<WorkflowDefinition>,\n options: ApiClientOptions\n): Promise<ApiResponse<WorkflowDefinitionResponse & { id?: string }>> {\n return browserApiRequest(\"/api/v1/workflows\", { method: \"POST\", body: workflow, ...options });\n}\n\nexport async function updateWorkflowApi(\n workflowId: string,\n workflow: Partial<WorkflowDefinition>,\n options: ApiClientOptions\n): Promise<ApiResponse<WorkflowDefinitionResponse>> {\n return browserApiRequest(`/api/v1/workflows/${workflowId}`, { method: \"PUT\", body: workflow, ...options });\n}\n\nexport async function deleteWorkflowApi(\n workflowId: string,\n options: ApiClientOptions\n): Promise<ApiResponse<{ success: boolean; metadata: ResponseMetadata }>> {\n return browserApiRequest(`/api/v1/workflows/${workflowId}`, { method: \"DELETE\", ...options });\n}\n\n// =============================================================================\n// WORKFLOW INSTANCES\n// =============================================================================\n\nexport async function createWorkflowInstanceApi(\n definitionId: string,\n data: { variables?: Record<string, unknown>; autoExecute?: boolean },\n options: ApiClientOptions\n): Promise<ApiResponse<WorkflowInstanceResponse & { id?: string }>> {\n return browserApiRequest(`/api/v1/workflows/${definitionId}/instances`, {\n method: \"POST\",\n body: data,\n ...options,\n });\n}\n\nexport async function getWorkflowInstanceApi(\n instanceId: string,\n options: ApiClientOptions\n): Promise<ApiResponse<WorkflowInstanceResponse>> {\n return browserApiRequest(`/api/v1/workflows/instances/${instanceId}`, { method: \"GET\", ...options });\n}\n\nexport async function listWorkflowInstancesApi(\n definitionId: string,\n options: ApiClientOptions & { userId?: string; status?: string }\n): Promise<ApiResponse<ListWorkflowInstancesResponse>> {\n const params = new URLSearchParams();\n if (options.userId) params.set(\"userId\", options.userId);\n if (options.status) params.set(\"status\", options.status);\n const queryString = params.toString();\n return browserApiRequest(\n `/api/v1/workflows/${definitionId}/instances${queryString ? `?${queryString}` : \"\"}`,\n { method: \"GET\", ...options }\n );\n}\n\nexport async function updateWorkflowInstanceStatusApi(\n instanceId: string,\n status: string,\n options: ApiClientOptions\n): Promise<ApiResponse<WorkflowInstanceResponse>> {\n return browserApiRequest(`/api/v1/workflows/instances/${instanceId}/status`, {\n method: \"PUT\",\n body: { status },\n ...options,\n });\n}\n\nexport async function executeWorkflowNodeApi(\n instanceId: string,\n nodeId: string,\n input: Record<string, unknown>,\n options: ApiClientOptions\n): Promise<ApiResponse<{ success: boolean; output?: Record<string, unknown>; metadata: ResponseMetadata }>> {\n return browserApiRequest(`/api/v1/workflows/instances/${instanceId}/nodes/${nodeId}/execute`, {\n method: \"POST\",\n body: { input },\n ...options,\n });\n}\n\nexport async function resumeWorkflowNodeApi(\n instanceId: string,\n nodeId: string,\n result: Record<string, unknown>,\n options: ApiClientOptions\n): Promise<ApiResponse<WorkflowInstanceResponse>> {\n return browserApiRequest(`/api/v1/workflows/instances/${instanceId}/nodes/${nodeId}/resume`, {\n method: \"POST\",\n body: { result },\n ...options,\n });\n}\n\nexport async function retryWorkflowNodeApi(\n instanceId: string,\n nodeId: string,\n options: ApiClientOptions\n): Promise<ApiResponse<WorkflowInstanceResponse>> {\n return browserApiRequest(`/api/v1/workflows/instances/${instanceId}/nodes/${nodeId}/retry`, {\n method: \"POST\",\n body: {},\n ...options,\n });\n}\n\n// =============================================================================\n// WORKFLOW TEMPLATES\n// =============================================================================\n\nexport async function listWorkflowTemplatesApi(\n options: ApiClientOptions & { category?: string }\n): Promise<ApiResponse<ListWorkflowTemplatesResponse>> {\n const params = new URLSearchParams();\n if (options.category) params.set(\"category\", options.category);\n const queryString = params.toString();\n return browserApiRequest(\n `/api/v1/workflows/templates${queryString ? `?${queryString}` : \"\"}`,\n { method: \"GET\", ...options }\n );\n}\n\nexport async function getWorkflowTemplateApi(\n templateId: string,\n options: ApiClientOptions\n): Promise<ApiResponse<GetWorkflowTemplateResponse>> {\n return browserApiRequest(`/api/v1/workflows/templates/${templateId}`, { method: \"GET\", ...options });\n}\n\nexport async function instantiateWorkflowTemplateApi(\n templateId: string,\n params: { variables: Record<string, unknown>; title?: string },\n options: ApiClientOptions\n): Promise<ApiResponse<WorkflowDefinitionResponse>> {\n return browserApiRequest(`/api/v1/workflows/templates/${templateId}/instantiate`, {\n method: \"POST\",\n body: params,\n ...options,\n });\n}\n"]}
1
+ {"version":3,"sources":["/home/runner/work/eloquent/eloquent/packages/@elqnt/workflow/dist/chunk-JES2EBNO.js","../api/index.ts"],"names":[],"mappings":"AAAA,qFAAY;AACZ;AACA;ACKA,oDAAkC;AA+ClC,MAAA,SAAsB,gBAAA,CACpB,OAAA,EACuD;AACvD,EAAA,OAAO,wCAAA,mBAAkB,EAAqB,EAAE,MAAA,EAAQ,KAAA,EAAO,GAAG,QAAQ,CAAC,CAAA;AAC7E;AAEA,MAAA,SAAsB,cAAA,CACpB,UAAA,EACA,OAAA,EACkD;AAClD,EAAA,OAAO,wCAAA,CAAkB,kBAAA,EAAqB,UAAU,CAAA,CAAA;AAC1D;AAKsE;AACZ,EAAA;AAC1D;AAKE;AAEwD,EAAA;AAC1D;AAK0E;AAChB,EAAA;AAC1D;AAQE;AAG8C,EAAA;AACpC,IAAA;AACF,IAAA;AACH,IAAA;AACJ,EAAA;AACH;AAKkD;AACQ,EAAA;AAC1D;AAIE;AAEmC,EAAA;AACoB,EAAA;AACA,EAAA;AACnB,EAAA;AAC7B,EAAA;AACyC,IAAA;AAClB,IAAA;AAC9B,EAAA;AACF;AAIE;AAGwD,EAAA;AAC9C,IAAA;AACO,IAAA;AACZ,IAAA;AACJ,EAAA;AACH;AAKE;AAGwD,EAAA;AAC9C,IAAA;AACM,IAAA;AACX,IAAA;AACJ,EAAA;AACH;AAKE;AAGwD,EAAA;AAC9C,IAAA;AACO,IAAA;AACZ,IAAA;AACJ,EAAA;AACH;AAKE;AAEwD,EAAA;AAC9C,IAAA;AACD,IAAA;AACJ,IAAA;AACJ,EAAA;AACH;AAQuD;AAClB,EAAA;AACkB,EAAA;AACjB,EAAA;AAC7B,EAAA;AAC2C,IAAA;AACpB,IAAA;AAC9B,EAAA;AACF;AAKqD;AACK,EAAA;AAC1D;AAIE;AAGwD,EAAA;AAC9C,IAAA;AACF,IAAA;AACH,IAAA;AACJ,EAAA;AACH;AD3H2D;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA","file":"/home/runner/work/eloquent/eloquent/packages/@elqnt/workflow/dist/chunk-JES2EBNO.js","sourcesContent":[null,"/**\n * Workflow API functions\n *\n * Browser-side API client for workflow operations.\n * Uses @elqnt/api-client for HTTP requests with automatic token management.\n */\n\nimport { browserApiRequest } from \"@elqnt/api-client/browser\";\nimport type { ApiResponse, ApiClientOptions } from \"@elqnt/api-client\";\nimport type { ResponseMetadata } from \"@elqnt/types\";\nimport type {\n WorkflowDefinition,\n WorkflowInstance,\n ListWorkflowDefinitionsResponse,\n WorkflowDefinitionResponse,\n WorkflowInstanceResponse,\n ListWorkflowInstancesResponse,\n} from \"../models\";\n\n// =============================================================================\n// TYPES\n// =============================================================================\n\nexport interface WorkflowTemplate {\n id: string;\n name: string;\n title: string;\n description: string;\n category: string;\n variables: Array<{\n name: string;\n type: string;\n required: boolean;\n description?: string;\n }>;\n preview?: string;\n createdAt: string;\n updatedAt: string;\n}\n\nexport interface ListWorkflowTemplatesResponse {\n templates: WorkflowTemplate[];\n metadata: ResponseMetadata;\n}\n\nexport interface GetWorkflowTemplateResponse {\n template: WorkflowTemplate;\n metadata: ResponseMetadata;\n}\n\n// =============================================================================\n// WORKFLOW DEFINITIONS\n// =============================================================================\n\nexport async function listWorkflowsApi(\n options: ApiClientOptions\n): Promise<ApiResponse<ListWorkflowDefinitionsResponse>> {\n return browserApiRequest(\"/api/v1/workflows\", { method: \"GET\", ...options });\n}\n\nexport async function getWorkflowApi(\n workflowId: string,\n options: ApiClientOptions\n): Promise<ApiResponse<WorkflowDefinitionResponse>> {\n return browserApiRequest(`/api/v1/workflows/${workflowId}`, { method: \"GET\", ...options });\n}\n\nexport async function createWorkflowApi(\n workflow: Partial<WorkflowDefinition>,\n options: ApiClientOptions\n): Promise<ApiResponse<WorkflowDefinitionResponse & { id?: string }>> {\n return browserApiRequest(\"/api/v1/workflows\", { method: \"POST\", body: workflow, ...options });\n}\n\nexport async function updateWorkflowApi(\n workflowId: string,\n workflow: Partial<WorkflowDefinition>,\n options: ApiClientOptions\n): Promise<ApiResponse<WorkflowDefinitionResponse>> {\n return browserApiRequest(`/api/v1/workflows/${workflowId}`, { method: \"PUT\", body: workflow, ...options });\n}\n\nexport async function deleteWorkflowApi(\n workflowId: string,\n options: ApiClientOptions\n): Promise<ApiResponse<{ success: boolean; metadata: ResponseMetadata }>> {\n return browserApiRequest(`/api/v1/workflows/${workflowId}`, { method: \"DELETE\", ...options });\n}\n\n// =============================================================================\n// WORKFLOW INSTANCES\n// =============================================================================\n\nexport async function createWorkflowInstanceApi(\n definitionId: string,\n data: { variables?: Record<string, unknown>; autoExecute?: boolean },\n options: ApiClientOptions\n): Promise<ApiResponse<WorkflowInstanceResponse & { id?: string }>> {\n return browserApiRequest(`/api/v1/workflows/${definitionId}/instances`, {\n method: \"POST\",\n body: data,\n ...options,\n });\n}\n\nexport async function getWorkflowInstanceApi(\n instanceId: string,\n options: ApiClientOptions\n): Promise<ApiResponse<WorkflowInstanceResponse>> {\n return browserApiRequest(`/api/v1/workflows/instances/${instanceId}`, { method: \"GET\", ...options });\n}\n\nexport async function listWorkflowInstancesApi(\n definitionId: string,\n options: ApiClientOptions & { userId?: string; status?: string }\n): Promise<ApiResponse<ListWorkflowInstancesResponse>> {\n const params = new URLSearchParams();\n if (options.userId) params.set(\"userId\", options.userId);\n if (options.status) params.set(\"status\", options.status);\n const queryString = params.toString();\n return browserApiRequest(\n `/api/v1/workflows/${definitionId}/instances${queryString ? `?${queryString}` : \"\"}`,\n { method: \"GET\", ...options }\n );\n}\n\nexport async function updateWorkflowInstanceStatusApi(\n instanceId: string,\n status: string,\n options: ApiClientOptions\n): Promise<ApiResponse<WorkflowInstanceResponse>> {\n return browserApiRequest(`/api/v1/workflows/instances/${instanceId}/status`, {\n method: \"PUT\",\n body: { status },\n ...options,\n });\n}\n\nexport async function executeWorkflowNodeApi(\n instanceId: string,\n nodeId: string,\n input: Record<string, unknown>,\n options: ApiClientOptions\n): Promise<ApiResponse<{ success: boolean; output?: Record<string, unknown>; metadata: ResponseMetadata }>> {\n return browserApiRequest(`/api/v1/workflows/instances/${instanceId}/nodes/${nodeId}/execute`, {\n method: \"POST\",\n body: { input },\n ...options,\n });\n}\n\nexport async function resumeWorkflowNodeApi(\n instanceId: string,\n nodeId: string,\n result: Record<string, unknown>,\n options: ApiClientOptions\n): Promise<ApiResponse<WorkflowInstanceResponse>> {\n return browserApiRequest(`/api/v1/workflows/instances/${instanceId}/nodes/${nodeId}/resume`, {\n method: \"POST\",\n body: { result },\n ...options,\n });\n}\n\nexport async function retryWorkflowNodeApi(\n instanceId: string,\n nodeId: string,\n options: ApiClientOptions\n): Promise<ApiResponse<WorkflowInstanceResponse>> {\n return browserApiRequest(`/api/v1/workflows/instances/${instanceId}/nodes/${nodeId}/retry`, {\n method: \"POST\",\n body: {},\n ...options,\n });\n}\n\n// =============================================================================\n// WORKFLOW TEMPLATES\n// =============================================================================\n\nexport async function listWorkflowTemplatesApi(\n options: ApiClientOptions & { category?: string }\n): Promise<ApiResponse<ListWorkflowTemplatesResponse>> {\n const params = new URLSearchParams();\n if (options.category) params.set(\"category\", options.category);\n const queryString = params.toString();\n return browserApiRequest(\n `/api/v1/workflows/templates${queryString ? `?${queryString}` : \"\"}`,\n { method: \"GET\", ...options }\n );\n}\n\nexport async function getWorkflowTemplateApi(\n templateId: string,\n options: ApiClientOptions\n): Promise<ApiResponse<GetWorkflowTemplateResponse>> {\n return browserApiRequest(`/api/v1/workflows/templates/${templateId}`, { method: \"GET\", ...options });\n}\n\nexport async function instantiateWorkflowTemplateApi(\n templateId: string,\n params: { variables: Record<string, unknown>; title?: string },\n options: ApiClientOptions\n): Promise<ApiResponse<WorkflowDefinitionResponse>> {\n return browserApiRequest(`/api/v1/workflows/templates/${templateId}/instantiate`, {\n method: \"POST\",\n body: params,\n ...options,\n });\n}\n"]}
@@ -1,5 +1,5 @@
1
1
  import { ApiClientOptions } from '@elqnt/api-client';
2
- import { W as WorkflowDefinition, a as WorkflowInstance } from '../workflow-vv0mDt57.mjs';
2
+ import { W as WorkflowInstance, a as WorkflowDefinition } from '../workflow-NznrS9yA.mjs';
3
3
  import { WorkflowTemplate } from '../api/index.mjs';
4
4
  import '@elqnt/types';
5
5
 
@@ -1,5 +1,5 @@
1
1
  import { ApiClientOptions } from '@elqnt/api-client';
2
- import { W as WorkflowDefinition, a as WorkflowInstance } from '../workflow-vv0mDt57.js';
2
+ import { W as WorkflowInstance, a as WorkflowDefinition } from '../workflow-NznrS9yA.js';
3
3
  import { WorkflowTemplate } from '../api/index.js';
4
4
  import '@elqnt/types';
5
5
 
@@ -1 +1 @@
1
- {"version":3,"sources":["/home/runner/work/eloquent-packages/eloquent-packages/packages/workflow/dist/hooks/index.js"],"names":[],"mappings":"AAAA,qFAAY;AACZ,YAAY;AACZ;AACE;AACA;AACA;AACF,uDAA6B;AAC7B,gCAA6B;AAC7B;AACE;AACA;AACA;AACF,iMAAC","file":"/home/runner/work/eloquent-packages/eloquent-packages/packages/workflow/dist/hooks/index.js"}
1
+ {"version":3,"sources":["/home/runner/work/eloquent/eloquent/packages/@elqnt/workflow/dist/hooks/index.js"],"names":[],"mappings":"AAAA,qFAAY;AACZ,YAAY;AACZ;AACE;AACA;AACA;AACF,uDAA6B;AAC7B,gCAA6B;AAC7B;AACE;AACA;AACA;AACF,iMAAC","file":"/home/runner/work/eloquent/eloquent/packages/@elqnt/workflow/dist/hooks/index.js"}