@decaf-ts/integrations 0.10.5 → 0.10.8
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/dist/integrations.cjs +1 -1
- package/lib/cjs/graph/engine/catalog/GraphBuiltInRegistrations.cjs +12 -73
- package/lib/cjs/graph/engine/catalog/GraphBuiltInRegistrations.cjs.map +1 -1
- package/lib/cjs/graph/engine/execution/GraphExecutionContext.cjs +5 -1
- package/lib/cjs/graph/engine/execution/GraphExecutionContext.cjs.map +1 -1
- package/lib/cjs/graph/engine/execution/GraphExecutionEngine.cjs +66 -1
- package/lib/cjs/graph/engine/execution/GraphExecutionEngine.cjs.map +1 -1
- package/lib/cjs/graph/engine/execution/GraphExecutionFrame.cjs +16 -0
- package/lib/cjs/graph/engine/execution/GraphExecutionFrame.cjs.map +1 -1
- package/lib/cjs/graph/engine/execution/index.cjs +0 -4
- package/lib/cjs/graph/engine/execution/index.cjs.map +1 -1
- package/lib/cjs/graph/engine/index.cjs +0 -7
- package/lib/cjs/graph/engine/index.cjs.map +1 -1
- package/lib/cjs/graph/engine/loops/index.cjs +0 -3
- package/lib/cjs/graph/engine/loops/index.cjs.map +1 -1
- package/lib/cjs/graph/engine/validation/GraphLooseNodeValidation.cjs +36 -0
- package/lib/cjs/graph/engine/validation/GraphLooseNodeValidation.cjs.map +1 -0
- package/lib/cjs/graph/engine/validation/GraphParameterValidator.cjs +36 -3
- package/lib/cjs/graph/engine/validation/GraphParameterValidator.cjs.map +1 -1
- package/lib/cjs/graph/engine/validation/GraphWorkflowDocumentValidator.cjs +32 -1
- package/lib/cjs/graph/engine/validation/GraphWorkflowDocumentValidator.cjs.map +1 -1
- package/lib/cjs/graph/engine/validation/index.cjs +1 -0
- package/lib/cjs/graph/engine/validation/index.cjs.map +1 -1
- package/lib/cjs/graph/nodes/agents/agent.cjs +118 -0
- package/lib/cjs/graph/nodes/agents/agent.cjs.map +1 -0
- package/lib/cjs/graph/nodes/base.cjs +61 -0
- package/lib/cjs/graph/nodes/base.cjs.map +1 -0
- package/lib/cjs/graph/nodes/boundary/input-value.cjs +59 -0
- package/lib/cjs/graph/nodes/boundary/input-value.cjs.map +1 -0
- package/lib/cjs/graph/nodes/flow-control/break.cjs +71 -0
- package/lib/cjs/graph/nodes/flow-control/break.cjs.map +1 -0
- package/lib/cjs/graph/nodes/flow-control/error-boundary.cjs +72 -0
- package/lib/cjs/graph/nodes/flow-control/error-boundary.cjs.map +1 -0
- package/lib/cjs/graph/nodes/flow-control/human-approval.cjs +80 -0
- package/lib/cjs/graph/nodes/flow-control/human-approval.cjs.map +1 -0
- package/lib/cjs/graph/nodes/flow-control/if.cjs +82 -0
- package/lib/cjs/graph/nodes/flow-control/if.cjs.map +1 -0
- package/lib/cjs/graph/nodes/flow-control/parallel.cjs +69 -0
- package/lib/cjs/graph/nodes/flow-control/parallel.cjs.map +1 -0
- package/lib/cjs/graph/nodes/flow-control/switch.cjs +190 -0
- package/lib/cjs/graph/nodes/flow-control/switch.cjs.map +1 -0
- package/lib/cjs/graph/nodes/index.cjs +162 -0
- package/lib/cjs/graph/nodes/index.cjs.map +1 -0
- package/lib/cjs/graph/nodes/loops/foreach.cjs +189 -0
- package/lib/cjs/graph/nodes/loops/foreach.cjs.map +1 -0
- package/lib/cjs/graph/nodes/loops/loop-metadata.cjs +48 -0
- package/lib/cjs/graph/nodes/loops/loop-metadata.cjs.map +1 -0
- package/lib/cjs/graph/nodes/loops/until.cjs +136 -0
- package/lib/cjs/graph/nodes/loops/until.cjs.map +1 -0
- package/lib/cjs/graph/nodes/loops/while.cjs +133 -0
- package/lib/cjs/graph/nodes/loops/while.cjs.map +1 -0
- package/lib/cjs/graph/nodes/manifests.cjs +342 -0
- package/lib/cjs/graph/nodes/manifests.cjs.map +1 -0
- package/lib/cjs/graph/nodes/triggers/chat.cjs +82 -0
- package/lib/cjs/graph/nodes/triggers/chat.cjs.map +1 -0
- package/lib/cjs/graph/nodes/triggers/event.cjs +63 -0
- package/lib/cjs/graph/nodes/triggers/event.cjs.map +1 -0
- package/lib/cjs/graph/nodes/triggers/form.cjs +64 -0
- package/lib/cjs/graph/nodes/triggers/form.cjs.map +1 -0
- package/lib/cjs/graph/nodes/triggers/manual.cjs +65 -0
- package/lib/cjs/graph/nodes/triggers/manual.cjs.map +1 -0
- package/lib/cjs/graph/nodes/triggers/schedule.cjs +65 -0
- package/lib/cjs/graph/nodes/triggers/schedule.cjs.map +1 -0
- package/lib/cjs/graph/nodes/triggers/webhook.cjs +67 -0
- package/lib/cjs/graph/nodes/triggers/webhook.cjs.map +1 -0
- package/lib/cjs/graph/nodes/utility/code.cjs +139 -0
- package/lib/cjs/graph/nodes/utility/code.cjs.map +1 -0
- package/lib/cjs/graph/nodes/utility/delay.cjs +66 -0
- package/lib/cjs/graph/nodes/utility/delay.cjs.map +1 -0
- package/lib/cjs/graph/nodes/utility/log.cjs +70 -0
- package/lib/cjs/graph/nodes/utility/log.cjs.map +1 -0
- package/lib/cjs/graph/nodes/utility/map.cjs +69 -0
- package/lib/cjs/graph/nodes/utility/map.cjs.map +1 -0
- package/lib/cjs/graph/nodes/utility/merge.cjs +67 -0
- package/lib/cjs/graph/nodes/utility/merge.cjs.map +1 -0
- package/lib/cjs/graph/nodes/utility/return.cjs +69 -0
- package/lib/cjs/graph/nodes/utility/return.cjs.map +1 -0
- package/lib/cjs/graph/nodes/utility/utility-log.cjs +77 -0
- package/lib/cjs/graph/nodes/utility/utility-log.cjs.map +1 -0
- package/lib/cjs/index.cjs +3 -3
- package/lib/cjs/nest/graph/GraphExecutorRegistryFactory.cjs +8 -4
- package/lib/cjs/nest/graph/GraphExecutorRegistryFactory.cjs.map +1 -1
- package/lib/cjs/nest/graph/GraphWorkflowBoundaryValidation.cjs +2 -0
- package/lib/cjs/nest/graph/GraphWorkflowBoundaryValidation.cjs.map +1 -1
- package/lib/cjs/nest/graph/GraphWorkflowService.cjs +1 -13
- package/lib/cjs/nest/graph/GraphWorkflowService.cjs.map +1 -1
- package/lib/esm/graph/engine/catalog/GraphBuiltInRegistrations.js +11 -72
- package/lib/esm/graph/engine/catalog/GraphBuiltInRegistrations.js.map +1 -1
- package/lib/esm/graph/engine/execution/GraphExecutionContext.js +5 -1
- package/lib/esm/graph/engine/execution/GraphExecutionContext.js.map +1 -1
- package/lib/esm/graph/engine/execution/GraphExecutionEngine.js +66 -1
- package/lib/esm/graph/engine/execution/GraphExecutionEngine.js.map +1 -1
- package/lib/esm/graph/engine/execution/GraphExecutionFrame.js +16 -0
- package/lib/esm/graph/engine/execution/GraphExecutionFrame.js.map +1 -1
- package/lib/esm/graph/engine/execution/index.js +0 -4
- package/lib/esm/graph/engine/execution/index.js.map +1 -1
- package/lib/esm/graph/engine/index.js +0 -7
- package/lib/esm/graph/engine/index.js.map +1 -1
- package/lib/esm/graph/engine/loops/index.js +0 -3
- package/lib/esm/graph/engine/loops/index.js.map +1 -1
- package/lib/esm/graph/engine/validation/GraphLooseNodeValidation.js +32 -0
- package/lib/esm/graph/engine/validation/GraphLooseNodeValidation.js.map +1 -0
- package/lib/esm/graph/engine/validation/GraphParameterValidator.js +36 -3
- package/lib/esm/graph/engine/validation/GraphParameterValidator.js.map +1 -1
- package/lib/esm/graph/engine/validation/GraphWorkflowDocumentValidator.js +32 -1
- package/lib/esm/graph/engine/validation/GraphWorkflowDocumentValidator.js.map +1 -1
- package/lib/esm/graph/engine/validation/index.js +1 -0
- package/lib/esm/graph/engine/validation/index.js.map +1 -1
- package/lib/esm/graph/nodes/agents/agent.js +109 -0
- package/lib/esm/graph/nodes/agents/agent.js.map +1 -0
- package/lib/esm/graph/nodes/base.js +56 -0
- package/lib/esm/graph/nodes/base.js.map +1 -0
- package/lib/esm/graph/nodes/boundary/input-value.js +50 -0
- package/lib/esm/graph/nodes/boundary/input-value.js.map +1 -0
- package/lib/esm/graph/nodes/flow-control/break.js +62 -0
- package/lib/esm/graph/nodes/flow-control/break.js.map +1 -0
- package/lib/esm/graph/nodes/flow-control/error-boundary.js +63 -0
- package/lib/esm/graph/nodes/flow-control/error-boundary.js.map +1 -0
- package/lib/esm/graph/nodes/flow-control/human-approval.js +71 -0
- package/lib/esm/graph/nodes/flow-control/human-approval.js.map +1 -0
- package/lib/esm/graph/nodes/flow-control/if.js +73 -0
- package/lib/esm/graph/nodes/flow-control/if.js.map +1 -0
- package/lib/esm/graph/nodes/flow-control/parallel.js +60 -0
- package/lib/esm/graph/nodes/flow-control/parallel.js.map +1 -0
- package/lib/esm/graph/nodes/flow-control/switch.js +181 -0
- package/lib/esm/graph/nodes/flow-control/switch.js.map +1 -0
- package/lib/esm/graph/nodes/index.js +144 -0
- package/lib/esm/graph/nodes/index.js.map +1 -0
- package/lib/esm/graph/nodes/loops/foreach.js +180 -0
- package/lib/esm/graph/nodes/loops/foreach.js.map +1 -0
- package/lib/esm/graph/nodes/loops/loop-metadata.js +44 -0
- package/lib/esm/graph/nodes/loops/loop-metadata.js.map +1 -0
- package/lib/esm/graph/nodes/loops/until.js +127 -0
- package/lib/esm/graph/nodes/loops/until.js.map +1 -0
- package/lib/esm/graph/nodes/loops/while.js +124 -0
- package/lib/esm/graph/nodes/loops/while.js.map +1 -0
- package/lib/esm/graph/nodes/manifests.js +338 -0
- package/lib/esm/graph/nodes/manifests.js.map +1 -0
- package/lib/esm/graph/nodes/triggers/chat.js +73 -0
- package/lib/esm/graph/nodes/triggers/chat.js.map +1 -0
- package/lib/esm/graph/nodes/triggers/event.js +54 -0
- package/lib/esm/graph/nodes/triggers/event.js.map +1 -0
- package/lib/esm/graph/nodes/triggers/form.js +55 -0
- package/lib/esm/graph/nodes/triggers/form.js.map +1 -0
- package/lib/esm/graph/nodes/triggers/manual.js +56 -0
- package/lib/esm/graph/nodes/triggers/manual.js.map +1 -0
- package/lib/esm/graph/nodes/triggers/schedule.js +56 -0
- package/lib/esm/graph/nodes/triggers/schedule.js.map +1 -0
- package/lib/esm/graph/nodes/triggers/webhook.js +58 -0
- package/lib/esm/graph/nodes/triggers/webhook.js.map +1 -0
- package/lib/esm/graph/nodes/utility/code.js +130 -0
- package/lib/esm/graph/nodes/utility/code.js.map +1 -0
- package/lib/esm/graph/nodes/utility/delay.js +57 -0
- package/lib/esm/graph/nodes/utility/delay.js.map +1 -0
- package/lib/esm/graph/nodes/utility/log.js +61 -0
- package/lib/esm/graph/nodes/utility/log.js.map +1 -0
- package/lib/esm/graph/nodes/utility/map.js +60 -0
- package/lib/esm/graph/nodes/utility/map.js.map +1 -0
- package/lib/esm/graph/nodes/utility/merge.js +58 -0
- package/lib/esm/graph/nodes/utility/merge.js.map +1 -0
- package/lib/esm/graph/nodes/utility/return.js +60 -0
- package/lib/esm/graph/nodes/utility/return.js.map +1 -0
- package/lib/esm/graph/nodes/utility/utility-log.js +68 -0
- package/lib/esm/graph/nodes/utility/utility-log.js.map +1 -0
- package/lib/esm/index.js +3 -3
- package/lib/esm/nest/graph/GraphExecutorRegistryFactory.js +8 -4
- package/lib/esm/nest/graph/GraphExecutorRegistryFactory.js.map +1 -1
- package/lib/esm/nest/graph/GraphWorkflowBoundaryValidation.js +2 -0
- package/lib/esm/nest/graph/GraphWorkflowBoundaryValidation.js.map +1 -1
- package/lib/esm/nest/graph/GraphWorkflowService.js +2 -14
- package/lib/esm/nest/graph/GraphWorkflowService.js.map +1 -1
- package/lib/types/graph/engine/catalog/GraphBuiltInRegistrations.d.cts +4 -7
- package/lib/types/graph/engine/catalog/GraphBuiltInRegistrations.d.mts +4 -7
- package/lib/types/graph/engine/execution/GraphExecutionContext.d.cts +6 -1
- package/lib/types/graph/engine/execution/GraphExecutionContext.d.mts +6 -1
- package/lib/types/graph/engine/execution/GraphExecutionEngine.d.cts +27 -0
- package/lib/types/graph/engine/execution/GraphExecutionEngine.d.mts +27 -0
- package/lib/types/graph/engine/execution/GraphExecutionFrame.d.cts +12 -0
- package/lib/types/graph/engine/execution/GraphExecutionFrame.d.mts +12 -0
- package/lib/types/graph/engine/execution/index.d.cts +0 -4
- package/lib/types/graph/engine/execution/index.d.mts +0 -4
- package/lib/types/graph/engine/index.d.cts +0 -7
- package/lib/types/graph/engine/index.d.mts +0 -7
- package/lib/types/graph/engine/loops/index.d.cts +0 -3
- package/lib/types/graph/engine/loops/index.d.mts +0 -3
- package/lib/types/graph/engine/validation/GraphLooseNodeValidation.d.cts +21 -0
- package/lib/types/graph/engine/validation/GraphLooseNodeValidation.d.mts +21 -0
- package/lib/types/graph/engine/validation/GraphParameterValidator.d.cts +25 -1
- package/lib/types/graph/engine/validation/GraphParameterValidator.d.mts +25 -1
- package/lib/types/graph/engine/validation/index.d.cts +1 -0
- package/lib/types/graph/engine/validation/index.d.mts +1 -0
- package/lib/types/graph/nodes/agents/agent.d.cts +31 -0
- package/lib/types/graph/nodes/agents/agent.d.mts +31 -0
- package/lib/types/graph/nodes/base.d.cts +58 -0
- package/lib/types/graph/nodes/base.d.mts +58 -0
- package/lib/types/graph/nodes/boundary/input-value.d.cts +6 -0
- package/lib/types/graph/nodes/boundary/input-value.d.mts +6 -0
- package/lib/types/graph/nodes/flow-control/break.d.cts +8 -0
- package/lib/types/graph/nodes/flow-control/break.d.mts +8 -0
- package/lib/types/graph/nodes/flow-control/error-boundary.d.cts +8 -0
- package/lib/types/graph/nodes/flow-control/error-boundary.d.mts +8 -0
- package/lib/types/graph/nodes/flow-control/human-approval.d.cts +8 -0
- package/lib/types/graph/nodes/flow-control/human-approval.d.mts +8 -0
- package/lib/types/graph/nodes/flow-control/if.d.cts +8 -0
- package/lib/types/graph/nodes/flow-control/if.d.mts +8 -0
- package/lib/types/graph/nodes/flow-control/parallel.d.cts +7 -0
- package/lib/types/graph/nodes/flow-control/parallel.d.mts +7 -0
- package/lib/types/graph/nodes/flow-control/switch.d.cts +23 -0
- package/lib/types/graph/nodes/flow-control/switch.d.mts +23 -0
- package/lib/types/graph/nodes/index.d.cts +93 -0
- package/lib/types/graph/nodes/index.d.mts +93 -0
- package/lib/types/graph/nodes/loops/foreach.d.cts +11 -0
- package/lib/types/graph/nodes/loops/foreach.d.mts +11 -0
- package/lib/types/graph/nodes/loops/loop-metadata.d.cts +20 -0
- package/lib/types/graph/nodes/loops/loop-metadata.d.mts +20 -0
- package/lib/types/graph/nodes/loops/until.d.cts +8 -0
- package/lib/types/graph/nodes/loops/until.d.mts +8 -0
- package/lib/types/graph/nodes/loops/while.d.cts +8 -0
- package/lib/types/graph/nodes/loops/while.d.mts +8 -0
- package/lib/types/graph/nodes/manifests.d.cts +62 -0
- package/lib/types/graph/nodes/manifests.d.mts +62 -0
- package/lib/types/graph/nodes/triggers/chat.d.cts +8 -0
- package/lib/types/graph/nodes/triggers/chat.d.mts +8 -0
- package/lib/types/graph/nodes/triggers/event.d.cts +6 -0
- package/lib/types/graph/nodes/triggers/event.d.mts +6 -0
- package/lib/types/graph/nodes/triggers/form.d.cts +6 -0
- package/lib/types/graph/nodes/triggers/form.d.mts +6 -0
- package/lib/types/graph/nodes/triggers/manual.d.cts +6 -0
- package/lib/types/graph/nodes/triggers/manual.d.mts +6 -0
- package/lib/types/graph/nodes/triggers/schedule.d.cts +6 -0
- package/lib/types/graph/nodes/triggers/schedule.d.mts +6 -0
- package/lib/types/graph/nodes/triggers/webhook.d.cts +6 -0
- package/lib/types/graph/nodes/triggers/webhook.d.mts +6 -0
- package/lib/types/graph/nodes/utility/code.d.cts +36 -0
- package/lib/types/graph/nodes/utility/code.d.mts +36 -0
- package/lib/types/graph/nodes/utility/delay.d.cts +7 -0
- package/lib/types/graph/nodes/utility/delay.d.mts +7 -0
- package/lib/types/graph/nodes/utility/log.d.cts +8 -0
- package/lib/types/graph/nodes/utility/log.d.mts +8 -0
- package/lib/types/graph/nodes/utility/map.d.cts +7 -0
- package/lib/types/graph/nodes/utility/map.d.mts +7 -0
- package/lib/types/graph/nodes/utility/merge.d.cts +7 -0
- package/lib/types/graph/nodes/utility/merge.d.mts +7 -0
- package/lib/types/graph/nodes/utility/return.d.cts +7 -0
- package/lib/types/graph/nodes/utility/return.d.mts +7 -0
- package/lib/types/graph/nodes/utility/utility-log.d.cts +10 -0
- package/lib/types/graph/nodes/utility/utility-log.d.mts +10 -0
- package/lib/types/index.d.cts +2 -2
- package/lib/types/index.d.mts +2 -2
- package/lib/types/nest/graph/GraphExecutorRegistryFactory.d.cts +5 -3
- package/lib/types/nest/graph/GraphExecutorRegistryFactory.d.mts +5 -3
- package/package.json +1 -1
- package/lib/cjs/graph/engine/execution/BreakGraphNodeExecutor.cjs +0 -24
- package/lib/cjs/graph/engine/execution/BreakGraphNodeExecutor.cjs.map +0 -1
- package/lib/cjs/graph/engine/execution/CodeGraphNodeExecutor.cjs +0 -103
- package/lib/cjs/graph/engine/execution/CodeGraphNodeExecutor.cjs.map +0 -1
- package/lib/cjs/graph/engine/execution/LogGraphNodeExecutor.cjs +0 -47
- package/lib/cjs/graph/engine/execution/LogGraphNodeExecutor.cjs.map +0 -1
- package/lib/cjs/graph/engine/execution/SwitchGraphNodeExecutor.cjs +0 -121
- package/lib/cjs/graph/engine/execution/SwitchGraphNodeExecutor.cjs.map +0 -1
- package/lib/cjs/graph/engine/loops/ForeachGraphNodeExecutor.cjs +0 -146
- package/lib/cjs/graph/engine/loops/ForeachGraphNodeExecutor.cjs.map +0 -1
- package/lib/cjs/graph/engine/loops/UntilGraphNodeExecutor.cjs +0 -102
- package/lib/cjs/graph/engine/loops/UntilGraphNodeExecutor.cjs.map +0 -1
- package/lib/cjs/graph/engine/loops/WhileGraphNodeExecutor.cjs +0 -103
- package/lib/cjs/graph/engine/loops/WhileGraphNodeExecutor.cjs.map +0 -1
- package/lib/esm/graph/engine/execution/BreakGraphNodeExecutor.js +0 -19
- package/lib/esm/graph/engine/execution/BreakGraphNodeExecutor.js.map +0 -1
- package/lib/esm/graph/engine/execution/CodeGraphNodeExecutor.js +0 -98
- package/lib/esm/graph/engine/execution/CodeGraphNodeExecutor.js.map +0 -1
- package/lib/esm/graph/engine/execution/LogGraphNodeExecutor.js +0 -42
- package/lib/esm/graph/engine/execution/LogGraphNodeExecutor.js.map +0 -1
- package/lib/esm/graph/engine/execution/SwitchGraphNodeExecutor.js +0 -116
- package/lib/esm/graph/engine/execution/SwitchGraphNodeExecutor.js.map +0 -1
- package/lib/esm/graph/engine/loops/ForeachGraphNodeExecutor.js +0 -141
- package/lib/esm/graph/engine/loops/ForeachGraphNodeExecutor.js.map +0 -1
- package/lib/esm/graph/engine/loops/UntilGraphNodeExecutor.js +0 -97
- package/lib/esm/graph/engine/loops/UntilGraphNodeExecutor.js.map +0 -1
- package/lib/esm/graph/engine/loops/WhileGraphNodeExecutor.js +0 -98
- package/lib/esm/graph/engine/loops/WhileGraphNodeExecutor.js.map +0 -1
- package/lib/types/graph/engine/execution/BreakGraphNodeExecutor.d.cts +0 -22
- package/lib/types/graph/engine/execution/BreakGraphNodeExecutor.d.mts +0 -22
- package/lib/types/graph/engine/execution/CodeGraphNodeExecutor.d.cts +0 -65
- package/lib/types/graph/engine/execution/CodeGraphNodeExecutor.d.mts +0 -65
- package/lib/types/graph/engine/execution/LogGraphNodeExecutor.d.cts +0 -25
- package/lib/types/graph/engine/execution/LogGraphNodeExecutor.d.mts +0 -25
- package/lib/types/graph/engine/execution/SwitchGraphNodeExecutor.d.cts +0 -43
- package/lib/types/graph/engine/execution/SwitchGraphNodeExecutor.d.mts +0 -43
- package/lib/types/graph/engine/loops/ForeachGraphNodeExecutor.d.cts +0 -35
- package/lib/types/graph/engine/loops/ForeachGraphNodeExecutor.d.mts +0 -35
- package/lib/types/graph/engine/loops/UntilGraphNodeExecutor.d.cts +0 -22
- package/lib/types/graph/engine/loops/UntilGraphNodeExecutor.d.mts +0 -22
- package/lib/types/graph/engine/loops/WhileGraphNodeExecutor.d.cts +0 -26
- package/lib/types/graph/engine/loops/WhileGraphNodeExecutor.d.mts +0 -26
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @module integrations/graph/nodes/utility/code
|
|
3
|
+
* @summary Code utility node declaration (ALFRED-5 §7, DECAF-32 §22.4).
|
|
4
|
+
* @description Code — sandboxed JS/TS code execution. The class's own
|
|
5
|
+
* `static execute` is the only implementation of the kind, derived by
|
|
6
|
+
* `GraphBuiltInRegistrations`, and reaches the pluggable `CodeSandboxEvaluator`
|
|
7
|
+
* through `GraphExecutionContext.engine`.
|
|
8
|
+
* The default `IsolatedVmCodeSandboxEvaluator` (backed by `isolated-vm`)
|
|
9
|
+
* enforces the Code Node restrictions: no imports, no requires, pure
|
|
10
|
+
* functions only. The sandbox context exposes `$input`, `$vars`, `$item`,
|
|
11
|
+
* `$index`, `$node`, and `$output` as data variables. TypeScript is
|
|
12
|
+
* supported via transpilation.
|
|
13
|
+
*
|
|
14
|
+
* The `@input` on `CodeNode.input` is a schema group — the nested
|
|
15
|
+
* model's `@input` ports are spliced into the parent unprefixed. `code` has
|
|
16
|
+
* `@input` + `@uielement("code-editor")`, so it appears as a port AND in the
|
|
17
|
+
* CRUD modal (the only visible field). `data` has `@input` + `@hidden()` but
|
|
18
|
+
* no `@uielement`, so it is a canvas-only port (for edge connections from
|
|
19
|
+
* workflow input badges) but never appears in the CRUD modal. `language` has
|
|
20
|
+
* no `@input` and no `@uielement`, so it is neither a port nor rendered — it
|
|
21
|
+
* defaults to `"javascript"`.
|
|
22
|
+
*/
|
|
23
|
+
import { Model } from "@decaf-ts/decorator-validation";
|
|
24
|
+
import { GraphNode } from "../base.d.mts";
|
|
25
|
+
import type { GraphExecutionContext } from "../../engine/execution/GraphExecutionContext.d.mts";
|
|
26
|
+
import type { GraphExecutionValues, GraphNodeExecutionRequest } from "../../engine/types.d.mts";
|
|
27
|
+
export declare class CodeInputSchema extends Model {
|
|
28
|
+
language: string;
|
|
29
|
+
code: string;
|
|
30
|
+
data?: unknown;
|
|
31
|
+
}
|
|
32
|
+
export declare class CodeNode extends GraphNode {
|
|
33
|
+
static execute(request: GraphNodeExecutionRequest, context: GraphExecutionContext): Promise<GraphExecutionValues>;
|
|
34
|
+
input: CodeInputSchema;
|
|
35
|
+
result: unknown;
|
|
36
|
+
}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { GraphNode } from "../base.d.cts";
|
|
2
|
+
import type { GraphExecutionValues, GraphNodeExecutionRequest } from "../../engine/types.d.cts";
|
|
3
|
+
export declare class DelayFlowNode extends GraphNode {
|
|
4
|
+
static execute(request: GraphNodeExecutionRequest): GraphExecutionValues;
|
|
5
|
+
value: unknown;
|
|
6
|
+
valueOut: unknown;
|
|
7
|
+
}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { GraphNode } from "../base.d.mts";
|
|
2
|
+
import type { GraphExecutionValues, GraphNodeExecutionRequest } from "../../engine/types.d.mts";
|
|
3
|
+
export declare class DelayFlowNode extends GraphNode {
|
|
4
|
+
static execute(request: GraphNodeExecutionRequest): GraphExecutionValues;
|
|
5
|
+
value: unknown;
|
|
6
|
+
valueOut: unknown;
|
|
7
|
+
}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import type { GraphExecutionContext } from "../../engine/execution/GraphExecutionContext.d.cts";
|
|
2
|
+
import type { GraphExecutionValues, GraphNodeExecutionRequest } from "../../engine/types.d.cts";
|
|
3
|
+
import { GraphNode } from "../base.d.cts";
|
|
4
|
+
export declare class LogFlowNode extends GraphNode {
|
|
5
|
+
static execute(request: GraphNodeExecutionRequest, context: GraphExecutionContext): GraphExecutionValues;
|
|
6
|
+
value: unknown;
|
|
7
|
+
logged: unknown;
|
|
8
|
+
}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import type { GraphExecutionContext } from "../../engine/execution/GraphExecutionContext.d.mts";
|
|
2
|
+
import type { GraphExecutionValues, GraphNodeExecutionRequest } from "../../engine/types.d.mts";
|
|
3
|
+
import { GraphNode } from "../base.d.mts";
|
|
4
|
+
export declare class LogFlowNode extends GraphNode {
|
|
5
|
+
static execute(request: GraphNodeExecutionRequest, context: GraphExecutionContext): GraphExecutionValues;
|
|
6
|
+
value: unknown;
|
|
7
|
+
logged: unknown;
|
|
8
|
+
}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { GraphNode } from "../base.d.cts";
|
|
2
|
+
import type { GraphExecutionValues, GraphNodeExecutionRequest } from "../../engine/types.d.cts";
|
|
3
|
+
export declare class MapNode extends GraphNode {
|
|
4
|
+
static execute(request: GraphNodeExecutionRequest): GraphExecutionValues;
|
|
5
|
+
value: unknown;
|
|
6
|
+
result: unknown;
|
|
7
|
+
}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { GraphNode } from "../base.d.mts";
|
|
2
|
+
import type { GraphExecutionValues, GraphNodeExecutionRequest } from "../../engine/types.d.mts";
|
|
3
|
+
export declare class MapNode extends GraphNode {
|
|
4
|
+
static execute(request: GraphNodeExecutionRequest): GraphExecutionValues;
|
|
5
|
+
value: unknown;
|
|
6
|
+
result: unknown;
|
|
7
|
+
}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { GraphNode } from "../base.d.cts";
|
|
2
|
+
import type { GraphExecutionValues, GraphNodeExecutionRequest } from "../../engine/types.d.cts";
|
|
3
|
+
export declare class MergeFlowNode extends GraphNode {
|
|
4
|
+
static execute(request: GraphNodeExecutionRequest): GraphExecutionValues;
|
|
5
|
+
values: unknown[];
|
|
6
|
+
merged: unknown;
|
|
7
|
+
}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { GraphNode } from "../base.d.mts";
|
|
2
|
+
import type { GraphExecutionValues, GraphNodeExecutionRequest } from "../../engine/types.d.mts";
|
|
3
|
+
export declare class MergeFlowNode extends GraphNode {
|
|
4
|
+
static execute(request: GraphNodeExecutionRequest): GraphExecutionValues;
|
|
5
|
+
values: unknown[];
|
|
6
|
+
merged: unknown;
|
|
7
|
+
}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { GraphNode } from "../base.d.cts";
|
|
2
|
+
import type { GraphExecutionValues, GraphNodeExecutionRequest } from "../../engine/types.d.cts";
|
|
3
|
+
export declare class ReturnFlowNode extends GraphNode {
|
|
4
|
+
static execute(request: GraphNodeExecutionRequest): GraphExecutionValues;
|
|
5
|
+
value: unknown;
|
|
6
|
+
result: unknown;
|
|
7
|
+
}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { GraphNode } from "../base.d.mts";
|
|
2
|
+
import type { GraphExecutionValues, GraphNodeExecutionRequest } from "../../engine/types.d.mts";
|
|
3
|
+
export declare class ReturnFlowNode extends GraphNode {
|
|
4
|
+
static execute(request: GraphNodeExecutionRequest): GraphExecutionValues;
|
|
5
|
+
value: unknown;
|
|
6
|
+
result: unknown;
|
|
7
|
+
}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import type { LogNodeLevel } from "@decaf-ts/ui-decorators/graph";
|
|
2
|
+
import type { GraphExecutionContext } from "../../engine/execution/GraphExecutionContext.d.cts";
|
|
3
|
+
import type { GraphExecutionValues, GraphNodeExecutionRequest } from "../../engine/types.d.cts";
|
|
4
|
+
import { GraphNode } from "../base.d.cts";
|
|
5
|
+
export declare class UtilityLogNode extends GraphNode {
|
|
6
|
+
static execute(request: GraphNodeExecutionRequest, context: GraphExecutionContext): GraphExecutionValues;
|
|
7
|
+
value: unknown;
|
|
8
|
+
level: LogNodeLevel;
|
|
9
|
+
logged: unknown;
|
|
10
|
+
}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import type { LogNodeLevel } from "@decaf-ts/ui-decorators/graph";
|
|
2
|
+
import type { GraphExecutionContext } from "../../engine/execution/GraphExecutionContext.d.mts";
|
|
3
|
+
import type { GraphExecutionValues, GraphNodeExecutionRequest } from "../../engine/types.d.mts";
|
|
4
|
+
import { GraphNode } from "../base.d.mts";
|
|
5
|
+
export declare class UtilityLogNode extends GraphNode {
|
|
6
|
+
static execute(request: GraphNodeExecutionRequest, context: GraphExecutionContext): GraphExecutionValues;
|
|
7
|
+
value: unknown;
|
|
8
|
+
level: LogNodeLevel;
|
|
9
|
+
logged: unknown;
|
|
10
|
+
}
|
package/lib/types/index.d.cts
CHANGED
|
@@ -7,6 +7,6 @@ export * from "./utils.d.cts";
|
|
|
7
7
|
export * from "./namespaces/index.d.cts";
|
|
8
8
|
export * from "./feature-flags/index.d.cts";
|
|
9
9
|
export declare const VERSION: string;
|
|
10
|
-
export declare const COMMIT = "
|
|
11
|
-
export declare const FULL_VERSION = "0.10.
|
|
10
|
+
export declare const COMMIT = "9f5df0a";
|
|
11
|
+
export declare const FULL_VERSION = "0.10.7-9f5df0a";
|
|
12
12
|
export declare const PACKAGE_NAME: string;
|
package/lib/types/index.d.mts
CHANGED
|
@@ -7,6 +7,6 @@ export * from "./utils.d.mts";
|
|
|
7
7
|
export * from "./namespaces/index.d.mts";
|
|
8
8
|
export * from "./feature-flags/index.d.mts";
|
|
9
9
|
export declare const VERSION: string;
|
|
10
|
-
export declare const COMMIT = "
|
|
11
|
-
export declare const FULL_VERSION = "0.10.
|
|
10
|
+
export declare const COMMIT = "9f5df0a";
|
|
11
|
+
export declare const FULL_VERSION = "0.10.7-9f5df0a";
|
|
12
12
|
export declare const PACKAGE_NAME: string;
|
|
@@ -40,10 +40,12 @@ export declare function createGraphExecutorRegistry(extra?: Record<string, Graph
|
|
|
40
40
|
* engine-bound executors.
|
|
41
41
|
*
|
|
42
42
|
* @param catalogue - The catalogue receiving the registrations.
|
|
43
|
-
* @param
|
|
44
|
-
*
|
|
43
|
+
* @param _engine - Retained for call-site compatibility; node classes now
|
|
44
|
+
* reach the engine through `GraphExecutionContext.engine`, so no executor
|
|
45
|
+
* needs an engine back-reference.
|
|
46
|
+
* @returns The catalogue with the built-in registrations applied.
|
|
45
47
|
*/
|
|
46
|
-
export declare function registerEngineBoundGraphNodes(catalogue: GraphNodeCatalogue,
|
|
48
|
+
export declare function registerEngineBoundGraphNodes(catalogue: GraphNodeCatalogue, _engine: GraphExecutionEngine): GraphNodeCatalogue;
|
|
47
49
|
/**
|
|
48
50
|
* Builds a `GraphExecutionEngineConfig` populated with all built-in
|
|
49
51
|
* registrations including loop executors that need a back-reference to the
|
|
@@ -40,10 +40,12 @@ export declare function createGraphExecutorRegistry(extra?: Record<string, Graph
|
|
|
40
40
|
* engine-bound executors.
|
|
41
41
|
*
|
|
42
42
|
* @param catalogue - The catalogue receiving the registrations.
|
|
43
|
-
* @param
|
|
44
|
-
*
|
|
43
|
+
* @param _engine - Retained for call-site compatibility; node classes now
|
|
44
|
+
* reach the engine through `GraphExecutionContext.engine`, so no executor
|
|
45
|
+
* needs an engine back-reference.
|
|
46
|
+
* @returns The catalogue with the built-in registrations applied.
|
|
45
47
|
*/
|
|
46
|
-
export declare function registerEngineBoundGraphNodes(catalogue: GraphNodeCatalogue,
|
|
48
|
+
export declare function registerEngineBoundGraphNodes(catalogue: GraphNodeCatalogue, _engine: GraphExecutionEngine): GraphNodeCatalogue;
|
|
47
49
|
/**
|
|
48
50
|
* Builds a `GraphExecutionEngineConfig` populated with all built-in
|
|
49
51
|
* registrations including loop executors that need a back-reference to the
|
package/package.json
CHANGED
|
@@ -1,24 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.BreakGraphNodeExecutor = void 0;
|
|
4
|
-
const GraphBreakSignal_js_1 = require("./../errors/GraphBreakSignal.cjs");
|
|
5
|
-
/**
|
|
6
|
-
* Executor for `core.flow.break` nodes.
|
|
7
|
-
*
|
|
8
|
-
* Reads the optional `value` input port and throws a {@link GraphBreakSignal}
|
|
9
|
-
* carrying it. The enclosing loop executor (`core.loop.foreach`,
|
|
10
|
-
* `core.loop.while`, `core.loop.until`) catches the signal, stops iterating,
|
|
11
|
-
* and returns the results collected so far (plus the carried value as the
|
|
12
|
-
* final partial result).
|
|
13
|
-
*/
|
|
14
|
-
class BreakGraphNodeExecutor {
|
|
15
|
-
async execute(request,
|
|
16
|
-
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
17
|
-
_context) {
|
|
18
|
-
const value = request.inputs["value"];
|
|
19
|
-
throw new GraphBreakSignal_js_1.GraphBreakSignal(value);
|
|
20
|
-
}
|
|
21
|
-
}
|
|
22
|
-
exports.BreakGraphNodeExecutor = BreakGraphNodeExecutor;
|
|
23
|
-
//# sourceMappingURL=BreakGraphNodeExecutor.js.map
|
|
24
|
-
//# sourceMappingURL=BreakGraphNodeExecutor.cjs.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"graph/engine/execution/BreakGraphNodeExecutor.cjs","sourceRoot":"","sources":["graph/engine/execution/BreakGraphNodeExecutor.js"],"names":[],"mappings":";;;AAAA,yEAAmE;AACnE;;;;;;;;GAQG;AACH,MAAa,sBAAsB;IAC/B,KAAK,CAAC,OAAO,CAAC,OAAO;IACrB,6DAA6D;IAC7D,QAAQ;QACJ,MAAM,KAAK,GAAG,OAAO,CAAC,MAAM,CAAC,OAAO,CAAC,CAAC;QACtC,MAAM,IAAI,sCAAgB,CAAC,KAAK,CAAC,CAAC;IACtC,CAAC;CACJ;AAPD,wDAOC;AACD,kDAAkD"}
|
|
@@ -1,103 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.CodeGraphNodeExecutor = void 0;
|
|
4
|
-
const GraphExecutionError_js_1 = require("./../errors/GraphExecutionError.cjs");
|
|
5
|
-
const GraphInputError_js_1 = require("./../errors/GraphInputError.cjs");
|
|
6
|
-
/**
|
|
7
|
-
* Reads the Code node metadata from the canonical node instance (DECAF-50):
|
|
8
|
-
* configuration lives in the instance `parameters` with `metadata` as the
|
|
9
|
-
* legacy fallback (the §4.18 transition compiler mirrors legacy
|
|
10
|
-
* `graph.metadata` bags into instance metadata).
|
|
11
|
-
*/
|
|
12
|
-
function readCodeMetadata(context) {
|
|
13
|
-
const parameters = context.node.parameters;
|
|
14
|
-
const metadata = context.node.metadata;
|
|
15
|
-
const source = { ...(metadata ?? {}), ...parameters };
|
|
16
|
-
return source;
|
|
17
|
-
}
|
|
18
|
-
/**
|
|
19
|
-
* Executor for `core.flow.code` nodes.
|
|
20
|
-
*
|
|
21
|
-
* The Code Node runs user-authored JS/TS in a restricted sandbox. The engine
|
|
22
|
-
* does not implement the sandbox directly (§22.4); instead it delegates to the
|
|
23
|
-
* pluggable {@link CodeSandboxEvaluator} registered on the engine config. When
|
|
24
|
-
* no evaluator is registered, the executor throws
|
|
25
|
-
* `GRAPH_CODE_SANDBOX_NOT_CONFIGURED`.
|
|
26
|
-
*
|
|
27
|
-
* The code is read from the `code` input port (spliced from
|
|
28
|
-
* {@link CodeInputSchema}). The language is hardcoded to `"javascript"` for
|
|
29
|
-
* now (the `language` field on `CodeInputSchema` has no `@input` so it is not
|
|
30
|
-
* a port and not wired). The timeout is read from `graph.metadata.timeoutMs`.
|
|
31
|
-
*
|
|
32
|
-
* The sandbox context exposes:
|
|
33
|
-
* - `$input` — the full input values object (all resolved port values).
|
|
34
|
-
* - `$vars` — workflow variables (sourced from `context.metadata.vars`).
|
|
35
|
-
* - `$item` / `$index` — current loop item and index.
|
|
36
|
-
* - `$node` — outputs of upstream nodes.
|
|
37
|
-
* - `$output` — the current draft output.
|
|
38
|
-
*
|
|
39
|
-
* The evaluator's return value is forwarded verbatim on the `result` output
|
|
40
|
-
* port.
|
|
41
|
-
*/
|
|
42
|
-
class CodeGraphNodeExecutor {
|
|
43
|
-
/**
|
|
44
|
-
* @param engine - The graph execution engine (or any object exposing the
|
|
45
|
-
* optional `codeSandboxEvaluator`). This mirrors the pattern used by
|
|
46
|
-
* {@link SwitchGraphNodeExecutor} for code conditions.
|
|
47
|
-
*/
|
|
48
|
-
constructor(engine) {
|
|
49
|
-
this.engine = engine;
|
|
50
|
-
}
|
|
51
|
-
async execute(request, context) {
|
|
52
|
-
const meta = readCodeMetadata(context);
|
|
53
|
-
const input = request.inputs;
|
|
54
|
-
const code = input["code"] ?? meta.defaultCode;
|
|
55
|
-
if (!code || typeof code !== "string" || code.trim().length === 0) {
|
|
56
|
-
throw new GraphInputError_js_1.GraphInputError("Code node has no code to execute (input.code is empty)", { input });
|
|
57
|
-
}
|
|
58
|
-
const evaluator = this.engine?.codeSandboxEvaluator;
|
|
59
|
-
if (!evaluator) {
|
|
60
|
-
throw new GraphExecutionError_js_1.GraphExecutionError("Code node execution requires a CodeSandboxEvaluator to be registered in GraphExecutionEngineConfig.codeSandboxEvaluator", "GRAPH_CODE_SANDBOX_NOT_CONFIGURED", { code });
|
|
61
|
-
}
|
|
62
|
-
const sandboxContext = this.buildSandboxContext(input, context);
|
|
63
|
-
await context.log("Executing code node", {
|
|
64
|
-
language: "javascript",
|
|
65
|
-
length: code.length,
|
|
66
|
-
timeoutMs: meta.timeoutMs,
|
|
67
|
-
});
|
|
68
|
-
const result = await evaluator.evaluate(sandboxContext);
|
|
69
|
-
await context.log("Code node executed", { hasResult: result !== undefined });
|
|
70
|
-
return { result };
|
|
71
|
-
}
|
|
72
|
-
/**
|
|
73
|
-
* Builds the {@link CodeSandboxContext} from the executor input and the
|
|
74
|
-
* graph execution context.
|
|
75
|
-
*
|
|
76
|
-
* The `$input` value is the full input values object so the code can access
|
|
77
|
-
* every resolved port value (including `code` itself via `$input.code`).
|
|
78
|
-
*
|
|
79
|
-
* The `$vars`, `$item`, `$index`, `$node`, and `$output` values are sourced
|
|
80
|
-
* from `context.metadata` — the engine (or a wrapping loop executor) may
|
|
81
|
-
* populate these when the Code node runs inside a loop body or a workflow
|
|
82
|
-
* with variables.
|
|
83
|
-
*/
|
|
84
|
-
buildSandboxContext(input, context) {
|
|
85
|
-
const md = context.metadata;
|
|
86
|
-
const meta = readCodeMetadata(context);
|
|
87
|
-
const code = input["code"] ?? meta.defaultCode ?? "";
|
|
88
|
-
return {
|
|
89
|
-
code,
|
|
90
|
-
language: "javascript",
|
|
91
|
-
input: input,
|
|
92
|
-
vars: md?.vars ?? undefined,
|
|
93
|
-
item: md?.item,
|
|
94
|
-
index: md?.index,
|
|
95
|
-
nodes: md?.nodes ??
|
|
96
|
-
undefined,
|
|
97
|
-
logger: context.logger,
|
|
98
|
-
};
|
|
99
|
-
}
|
|
100
|
-
}
|
|
101
|
-
exports.CodeGraphNodeExecutor = CodeGraphNodeExecutor;
|
|
102
|
-
//# sourceMappingURL=CodeGraphNodeExecutor.js.map
|
|
103
|
-
//# sourceMappingURL=CodeGraphNodeExecutor.cjs.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"graph/engine/execution/CodeGraphNodeExecutor.cjs","sourceRoot":"","sources":["graph/engine/execution/CodeGraphNodeExecutor.js"],"names":[],"mappings":";;;AAAA,+EAAyE;AACzE,uEAAiE;AACjE;;;;;GAKG;AACH,SAAS,gBAAgB,CAAC,OAAO;IAC7B,MAAM,UAAU,GAAG,OAAO,CAAC,IAAI,CAAC,UAAU,CAAC;IAC3C,MAAM,QAAQ,GAAG,OAAO,CAAC,IAAI,CAAC,QAAQ,CAAC;IACvC,MAAM,MAAM,GAAG,EAAE,GAAG,CAAC,QAAQ,IAAI,EAAE,CAAC,EAAE,GAAG,UAAU,EAAE,CAAC;IACtD,OAAO,MAAM,CAAC;AAClB,CAAC;AACD;;;;;;;;;;;;;;;;;;;;;;;GAuBG;AACH,MAAa,qBAAqB;IAC9B;;;;OAIG;IACH,YAAY,MAAM;QACd,IAAI,CAAC,MAAM,GAAG,MAAM,CAAC;IACzB,CAAC;IACD,KAAK,CAAC,OAAO,CAAC,OAAO,EAAE,OAAO;QAC1B,MAAM,IAAI,GAAG,gBAAgB,CAAC,OAAO,CAAC,CAAC;QACvC,MAAM,KAAK,GAAG,OAAO,CAAC,MAAM,CAAC;QAC7B,MAAM,IAAI,GAAG,KAAK,CAAC,MAAM,CAAC,IAAI,IAAI,CAAC,WAAW,CAAC;QAC/C,IAAI,CAAC,IAAI,IAAI,OAAO,IAAI,KAAK,QAAQ,IAAI,IAAI,CAAC,IAAI,EAAE,CAAC,MAAM,KAAK,CAAC,EAAE,CAAC;YAChE,MAAM,IAAI,oCAAe,CAAC,wDAAwD,EAAE,EAAE,KAAK,EAAE,CAAC,CAAC;QACnG,CAAC;QACD,MAAM,SAAS,GAAG,IAA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iDAAiD"}
|
|
@@ -1,47 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.LogGraphNodeExecutor = void 0;
|
|
4
|
-
/**
|
|
5
|
-
* Resolves the log level for a Log node execution.
|
|
6
|
-
*
|
|
7
|
-
* The level is read from the canonical node instance configuration
|
|
8
|
-
* (`parameters.level`, with instance `metadata.level` as the legacy
|
|
9
|
-
* fallback); defaults to `info` when unset.
|
|
10
|
-
*/
|
|
11
|
-
function logLevelOf(context) {
|
|
12
|
-
const parameters = context.node.parameters;
|
|
13
|
-
const metadata = context.node.metadata;
|
|
14
|
-
const candidate = (parameters.level ?? metadata?.["level"]);
|
|
15
|
-
return candidate || "info";
|
|
16
|
-
}
|
|
17
|
-
/**
|
|
18
|
-
* Executor for `core.utility.log` / `core.flow.log` nodes.
|
|
19
|
-
*
|
|
20
|
-
* Reads the `value` input port, logs it through `context.logger` at the
|
|
21
|
-
* configured level, and returns it unchanged on the `logged` output port.
|
|
22
|
-
*/
|
|
23
|
-
class LogGraphNodeExecutor {
|
|
24
|
-
/**
|
|
25
|
-
* Logs the `value` input through the run's `ctx.logger` and forwards it
|
|
26
|
-
* unchanged on the `logged` output port.
|
|
27
|
-
*
|
|
28
|
-
* The level is read from the node's UI config (`node.props.level`, see
|
|
29
|
-
* {@link logLevelOf}) and defaults to `info`. The emitted log line carries
|
|
30
|
-
* the DECAF-48 run attributes and streams over `graph.run.log` through the
|
|
31
|
-
* shared `ctx.logger` path (DECAF-48 Req-1).
|
|
32
|
-
*
|
|
33
|
-
* @param request - The node execution request (expects the `value` input).
|
|
34
|
-
* @param context - The run-scoped execution context exposing `ctx.logger`.
|
|
35
|
-
* @returns The node's output values keyed by port name (the `logged` port).
|
|
36
|
-
*/
|
|
37
|
-
async execute(request, context) {
|
|
38
|
-
const value = request.inputs["value"];
|
|
39
|
-
const level = logLevelOf(context);
|
|
40
|
-
const logger = context.logger;
|
|
41
|
-
logger[level]("Log node", { value });
|
|
42
|
-
return { logged: value };
|
|
43
|
-
}
|
|
44
|
-
}
|
|
45
|
-
exports.LogGraphNodeExecutor = LogGraphNodeExecutor;
|
|
46
|
-
//# sourceMappingURL=LogGraphNodeExecutor.js.map
|
|
47
|
-
//# sourceMappingURL=LogGraphNodeExecutor.cjs.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"graph/engine/execution/LogGraphNodeExecutor.cjs","sourceRoot":"","sources":["graph/engine/execution/LogGraphNodeExecutor.js"],"names":[],"mappings":";;;AAAA;;;;;;GAMG;AACH,SAAS,UAAU,CAAC,OAAO;IACvB,MAAM,UAAU,GAAG,OAAO,CAAC,IAAI,CAAC,UAAU,CAAC;IAC3C,MAAM,QAAQ,GAAG,OAAO,CAAC,IAAI,CAAC,QAAQ,CAAC;IACvC,MAAM,SAAS,GAAG,CAAC,UAAU,CAAC,KAAK,IAAI,QAAQ,EAAE,CAAC,OAAO,CAAC,CAAC,CAAC;IAC5D,OAAO,SAAS,IAAI,MAAM,CAAC;AAC/B,CAAC;AACD;;;;;GAKG;AACH,MAAa,oBAAoB;IAC7B;;;;;;;;;;;;OAYG;IACH,KAAK,CAAC,OAAO,CAAC,OAAO,EAAE,OAAO;QAC1B,MAAM,KAAK,GAAG,OAAO,CAAC,MAAM,CAAC,OAAO,CAAC,CAAC;QACtC,MAAM,KAAK,GAAG,UAAU,CAAC,OAAO,CAAC,CAAC;QAClC,MAAM,MAAM,GAAG,OAAO,CAAC,MAAM,CAAC;QAC9B,MAAM,CAAC,KAAK,CAAC,CAAC,UAAU,EAAE,EAAE,KAAK,EAAE,CAAC,CAAC;QACrC,OAAO,EAAE,MAAM,EAAE,KAAK,EAAE,CAAC;IAC7B,CAAC;CACJ;AArBD,oDAqBC;AACD,gDAAgD"}
|
|
@@ -1,121 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.SwitchGraphNodeExecutor = void 0;
|
|
4
|
-
const GraphExecutionError_js_1 = require("./../errors/GraphExecutionError.cjs");
|
|
5
|
-
const ConditionExpressionEvaluator_js_1 = require("./../loops/ConditionExpressionEvaluator.cjs");
|
|
6
|
-
/**
|
|
7
|
-
* Reads the Switch metadata from the canonical node instance (DECAF-50):
|
|
8
|
-
* configuration lives in the instance `parameters` (`switch` key) with
|
|
9
|
-
* instance `metadata` as the legacy fallback (the §4.18 transition compiler
|
|
10
|
-
* mirrors legacy `graph.metadata.switch` into instance metadata). When
|
|
11
|
-
* absent, falls back to an empty default with the `default` port enabled.
|
|
12
|
-
*/
|
|
13
|
-
function readSwitchMetadata(context) {
|
|
14
|
-
const parameters = context.node.parameters;
|
|
15
|
-
const metadata = context.node.metadata;
|
|
16
|
-
const raw = parameters["switch"] ?? metadata?.["switch"];
|
|
17
|
-
const switchMeta = raw;
|
|
18
|
-
if (!switchMeta || !Array.isArray(switchMeta.cases)) {
|
|
19
|
-
return { cases: [], defaultPort: "default", hasDefault: false };
|
|
20
|
-
}
|
|
21
|
-
return {
|
|
22
|
-
cases: switchMeta.cases,
|
|
23
|
-
defaultPort: switchMeta.defaultPort ?? "default",
|
|
24
|
-
hasDefault: switchMeta.hasDefault === true,
|
|
25
|
-
};
|
|
26
|
-
}
|
|
27
|
-
/**
|
|
28
|
-
* Detects whether a condition is a `CodeCondition` (has `type: "code"`).
|
|
29
|
-
*/
|
|
30
|
-
function isCodeCondition(cond) {
|
|
31
|
-
return (typeof cond === "object" &&
|
|
32
|
-
cond !== null &&
|
|
33
|
-
"type" in cond &&
|
|
34
|
-
cond.type === "code");
|
|
35
|
-
}
|
|
36
|
-
/**
|
|
37
|
-
* Detects whether a condition is a `ConditionExpression` (has `op` field).
|
|
38
|
-
*/
|
|
39
|
-
function isConditionExpression(cond) {
|
|
40
|
-
return (typeof cond === "object" &&
|
|
41
|
-
cond !== null &&
|
|
42
|
-
"op" in cond &&
|
|
43
|
-
typeof cond.op === "string");
|
|
44
|
-
}
|
|
45
|
-
/**
|
|
46
|
-
* Executor for `core.flow.switch` nodes.
|
|
47
|
-
*
|
|
48
|
-
* Evaluates each case's condition in order and routes the input to the
|
|
49
|
-
* first matching case's output port. When no case matches:
|
|
50
|
-
* - If `hasDefault` is `true`, routes to the `default` output port.
|
|
51
|
-
* - If `hasDefault` is `false` (the default), throws `GRAPH_SWITCH_NO_MATCH`.
|
|
52
|
-
*
|
|
53
|
-
* Condition evaluation:
|
|
54
|
-
* - `ConditionExpression` — evaluated via {@link ConditionExpressionEvaluator}.
|
|
55
|
-
* - `CodeCondition` — evaluated via the pluggable {@link CodeSandboxEvaluator}
|
|
56
|
-
* from the engine's config. Throws `GRAPH_CODE_SANDBOX_NOT_CONFIGURED`
|
|
57
|
-
* when no evaluator is registered.
|
|
58
|
-
*/
|
|
59
|
-
class SwitchGraphNodeExecutor {
|
|
60
|
-
constructor(engine) {
|
|
61
|
-
this.engine = engine;
|
|
62
|
-
this.expressionEvaluator = new ConditionExpressionEvaluator_js_1.ConditionExpressionEvaluator();
|
|
63
|
-
}
|
|
64
|
-
async execute(request, context) {
|
|
65
|
-
const meta = readSwitchMetadata(context);
|
|
66
|
-
const input = request.inputs;
|
|
67
|
-
const inputValue = input["value"] ?? input;
|
|
68
|
-
for (const switchCase of meta.cases) {
|
|
69
|
-
const matches = await this.evaluateCondition(switchCase.condition, inputValue, input, context);
|
|
70
|
-
if (matches) {
|
|
71
|
-
return { [switchCase.outputPort]: inputValue };
|
|
72
|
-
}
|
|
73
|
-
}
|
|
74
|
-
// No case matched — route to the default port when it is enabled.
|
|
75
|
-
if (meta.hasDefault !== true) {
|
|
76
|
-
throw new GraphExecutionError_js_1.GraphExecutionError("No switch case matched and default port is not enabled", "GRAPH_SWITCH_NO_MATCH", { cases: meta.cases.map((c) => c.id) });
|
|
77
|
-
}
|
|
78
|
-
const defaultPort = meta.defaultPort ?? "default";
|
|
79
|
-
return { [defaultPort]: inputValue };
|
|
80
|
-
}
|
|
81
|
-
/**
|
|
82
|
-
* Evaluates a single switch case condition.
|
|
83
|
-
*/
|
|
84
|
-
async evaluateCondition(condition, inputValue, fullInput, context) {
|
|
85
|
-
if (isCodeCondition(condition)) {
|
|
86
|
-
return this.evaluateCodeCondition(condition, fullInput, context);
|
|
87
|
-
}
|
|
88
|
-
if (isConditionExpression(condition)) {
|
|
89
|
-
return this.expressionEvaluator.evaluate(condition, inputValue);
|
|
90
|
-
}
|
|
91
|
-
throw new GraphExecutionError_js_1.GraphExecutionError("Unknown switch case condition type — must be ConditionExpression (op) or CodeCondition (type: 'code')", "GRAPH_UNKNOWN_SWITCH_CONDITION", { condition });
|
|
92
|
-
}
|
|
93
|
-
/**
|
|
94
|
-
* Evaluates a code condition via the pluggable sandbox evaluator.
|
|
95
|
-
*/
|
|
96
|
-
async evaluateCodeCondition(condition, input, context) {
|
|
97
|
-
const evaluator = this.engine?.codeSandboxEvaluator;
|
|
98
|
-
if (!evaluator) {
|
|
99
|
-
throw new GraphExecutionError_js_1.GraphExecutionError("Code conditions require a CodeSandboxEvaluator to be registered in GraphExecutionEngineConfig.codeSandboxEvaluator", "GRAPH_CODE_SANDBOX_NOT_CONFIGURED", { code: condition.code });
|
|
100
|
-
}
|
|
101
|
-
await context.log(`Evaluating code condition`, {
|
|
102
|
-
language: condition.language ?? "javascript",
|
|
103
|
-
});
|
|
104
|
-
const md = context.metadata;
|
|
105
|
-
const result = await evaluator.evaluate({
|
|
106
|
-
code: condition.code,
|
|
107
|
-
language: condition.language,
|
|
108
|
-
input,
|
|
109
|
-
vars: md?.vars ?? undefined,
|
|
110
|
-
item: md?.item,
|
|
111
|
-
index: md?.index,
|
|
112
|
-
nodes: md?.nodes ??
|
|
113
|
-
undefined,
|
|
114
|
-
logger: context.logger,
|
|
115
|
-
});
|
|
116
|
-
return !!result;
|
|
117
|
-
}
|
|
118
|
-
}
|
|
119
|
-
exports.SwitchGraphNodeExecutor = SwitchGraphNodeExecutor;
|
|
120
|
-
//# sourceMappingURL=SwitchGraphNodeExecutor.js.map
|
|
121
|
-
//# sourceMappingURL=SwitchGraphNodeExecutor.cjs.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"graph/engine/execution/SwitchGraphNodeExecutor.cjs","sourceRoot":"","sources":["graph/engine/execution/SwitchGraphNodeExecutor.js"],"names":[],"mappings":";;;AAAA,+EAAyE;AACzE,gGAA0F;AAC1F;;;;;;GAMG;AACH,SAAS,kBAAkB,CAAC,OAAO;IAC/B,MAAM,UAAU,GAAG,OAAO,CAAC,IAAI,CAAC,UAAU,CAAC;IAC3C,MAAM,QAAQ,GAAG,OAAO,CAAC,IAAI,CAAC,QAAQ,CAAC;IACvC,MAAM,GAAG,GAAG,UAAU,CAAC,QAAQ,CAAC,IAAI,QAAQ,EAAE,CAAC,QAAQ,CAAC,CAAC;IACzD,MAAM,UAAU,GAAG,GAAG,CAAC;IACvB,IAAI,CAAC,UAAU,IAAI,CAAC,KAAK,CAAC,OAAO,CAAC,UAAU,CAAC,KAAK,CAAC,EAAE,CAAC;QAClD,OAAO,EAAE,KAAK,EAAE,EAAE,EAAE,WAAW,EAAE,SAAS,EAAE,UAAU,EAAE,KAAK,EAAE,CAAC;IACpE,CAAC;IACD,OAAO;QACH,KAAK,EAAE,UAAU,CAAC,KAAK;QACvB,WAAW,EAAE,UAAU,CAAC,WAAW,IAAI,SAAS;QAChD,UAAU,EAAE,UAAU,CAAC,UAAU,KAAK,IAAI;KAC7C,CAAC;AACN,CAAC;AACD;;GAEG;AACH,SAAS,eAAe,CAAC,IAAI;IACzB,OAAO,CAAC,OAAO,IAAI,KAAK,QAAQ;QAC5B,IAAI,KAAK,IAAI;QACb,MAAM,IAAI,IAAI;QACd,IAAI,CAAC,IAAI,KAAK,MAAM,CAAC,CAAC;AAC9B,CAAC;AACD;;GAEG;AACH,SAAS,qBAAqB,CAAC,IAAI;IAC/B,OAAO,CAAC,OAAO,IAAI,KAAK,QAAQ;QAC5B,IAAI,KAAK,IAAI;QACb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