@n8n/expression-runtime 0.30.0 → 0.31.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (122) hide show
  1. package/README.md +4 -0
  2. package/dist/bundle/runtime.esm.js +17 -17
  3. package/dist/bundle/runtime.esm.js.map +4 -4
  4. package/dist/bundle/runtime.iife.js +17 -17
  5. package/dist/bundle/runtime.iife.js.map +4 -4
  6. package/dist/cjs/bridge/host-functions.d.ts +74 -0
  7. package/dist/cjs/bridge/host-functions.d.ts.map +1 -0
  8. package/dist/cjs/bridge/host-functions.js +336 -0
  9. package/dist/cjs/bridge/host-functions.js.map +1 -0
  10. package/dist/cjs/bridge/isolated-vm-bridge.d.ts +24 -150
  11. package/dist/cjs/bridge/isolated-vm-bridge.d.ts.map +1 -1
  12. package/dist/cjs/bridge/isolated-vm-bridge.js +130 -429
  13. package/dist/cjs/bridge/isolated-vm-bridge.js.map +1 -1
  14. package/dist/cjs/bridge/quickjs-bridge.d.ts +21 -6
  15. package/dist/cjs/bridge/quickjs-bridge.d.ts.map +1 -1
  16. package/dist/cjs/bridge/quickjs-bridge.js +377 -402
  17. package/dist/cjs/bridge/quickjs-bridge.js.map +1 -1
  18. package/dist/cjs/build.tsbuildinfo +1 -1
  19. package/dist/cjs/evaluator/expression-evaluator.d.ts +17 -0
  20. package/dist/cjs/evaluator/expression-evaluator.d.ts.map +1 -1
  21. package/dist/cjs/evaluator/expression-evaluator.js +61 -1
  22. package/dist/cjs/evaluator/expression-evaluator.js.map +1 -1
  23. package/dist/cjs/extensions/array-extensions.d.ts.map +1 -1
  24. package/dist/cjs/extensions/array-extensions.js +7 -15
  25. package/dist/cjs/extensions/array-extensions.js.map +1 -1
  26. package/dist/cjs/extensions/function-extensions.d.ts +2 -0
  27. package/dist/cjs/extensions/function-extensions.d.ts.map +1 -1
  28. package/dist/cjs/extensions/function-extensions.js +13 -10
  29. package/dist/cjs/extensions/function-extensions.js.map +1 -1
  30. package/dist/cjs/extensions/object-extensions.d.ts.map +1 -1
  31. package/dist/cjs/extensions/object-extensions.js +3 -11
  32. package/dist/cjs/extensions/object-extensions.js.map +1 -1
  33. package/dist/cjs/extensions/utils.d.ts +1 -0
  34. package/dist/cjs/extensions/utils.d.ts.map +1 -1
  35. package/dist/cjs/extensions/utils.js +10 -0
  36. package/dist/cjs/extensions/utils.js.map +1 -1
  37. package/dist/cjs/observability/metrics.d.ts +12 -0
  38. package/dist/cjs/observability/metrics.d.ts.map +1 -1
  39. package/dist/cjs/observability/metrics.js +12 -0
  40. package/dist/cjs/observability/metrics.js.map +1 -1
  41. package/dist/cjs/runtime/lazy-proxy.d.ts +2 -0
  42. package/dist/cjs/runtime/lazy-proxy.d.ts.map +1 -1
  43. package/dist/cjs/runtime/lazy-proxy.js +29 -15
  44. package/dist/cjs/runtime/lazy-proxy.js.map +1 -1
  45. package/dist/cjs/runtime/luxon-transfer.d.ts +62 -0
  46. package/dist/cjs/runtime/luxon-transfer.d.ts.map +1 -0
  47. package/dist/cjs/runtime/luxon-transfer.js +200 -0
  48. package/dist/cjs/runtime/luxon-transfer.js.map +1 -0
  49. package/dist/cjs/runtime/serialize.d.ts +7 -7
  50. package/dist/cjs/runtime/serialize.d.ts.map +1 -1
  51. package/dist/cjs/runtime/serialize.js +42 -30
  52. package/dist/cjs/runtime/serialize.js.map +1 -1
  53. package/dist/cjs/runtime/transfer.d.ts +77 -0
  54. package/dist/cjs/runtime/transfer.d.ts.map +1 -0
  55. package/dist/cjs/runtime/transfer.js +183 -0
  56. package/dist/cjs/runtime/transfer.js.map +1 -0
  57. package/dist/cjs/types/bridge.d.ts +16 -0
  58. package/dist/cjs/types/bridge.d.ts.map +1 -1
  59. package/dist/cjs/types/bridge.js +1 -0
  60. package/dist/cjs/types/bridge.js.map +1 -1
  61. package/dist/cjs/types/evaluator.d.ts +9 -0
  62. package/dist/cjs/types/evaluator.d.ts.map +1 -1
  63. package/dist/cjs/types/evaluator.js.map +1 -1
  64. package/dist/esm/bridge/host-functions.d.ts +74 -0
  65. package/dist/esm/bridge/host-functions.d.ts.map +1 -0
  66. package/dist/esm/bridge/host-functions.js +328 -0
  67. package/dist/esm/bridge/host-functions.js.map +1 -0
  68. package/dist/esm/bridge/isolated-vm-bridge.d.ts +24 -150
  69. package/dist/esm/bridge/isolated-vm-bridge.d.ts.map +1 -1
  70. package/dist/esm/bridge/isolated-vm-bridge.js +126 -425
  71. package/dist/esm/bridge/isolated-vm-bridge.js.map +1 -1
  72. package/dist/esm/bridge/quickjs-bridge.d.ts +21 -6
  73. package/dist/esm/bridge/quickjs-bridge.d.ts.map +1 -1
  74. package/dist/esm/bridge/quickjs-bridge.js +368 -393
  75. package/dist/esm/bridge/quickjs-bridge.js.map +1 -1
  76. package/dist/esm/build.tsbuildinfo +1 -1
  77. package/dist/esm/evaluator/expression-evaluator.d.ts +17 -0
  78. package/dist/esm/evaluator/expression-evaluator.d.ts.map +1 -1
  79. package/dist/esm/evaluator/expression-evaluator.js +61 -1
  80. package/dist/esm/evaluator/expression-evaluator.js.map +1 -1
  81. package/dist/esm/extensions/array-extensions.d.ts.map +1 -1
  82. package/dist/esm/extensions/array-extensions.js +1 -9
  83. package/dist/esm/extensions/array-extensions.js.map +1 -1
  84. package/dist/esm/extensions/function-extensions.d.ts +2 -0
  85. package/dist/esm/extensions/function-extensions.d.ts.map +1 -1
  86. package/dist/esm/extensions/function-extensions.js +12 -9
  87. package/dist/esm/extensions/function-extensions.js.map +1 -1
  88. package/dist/esm/extensions/object-extensions.d.ts.map +1 -1
  89. package/dist/esm/extensions/object-extensions.js +1 -9
  90. package/dist/esm/extensions/object-extensions.js.map +1 -1
  91. package/dist/esm/extensions/utils.d.ts +1 -0
  92. package/dist/esm/extensions/utils.d.ts.map +1 -1
  93. package/dist/esm/extensions/utils.js +9 -0
  94. package/dist/esm/extensions/utils.js.map +1 -1
  95. package/dist/esm/observability/metrics.d.ts +12 -0
  96. package/dist/esm/observability/metrics.d.ts.map +1 -1
  97. package/dist/esm/observability/metrics.js +12 -0
  98. package/dist/esm/observability/metrics.js.map +1 -1
  99. package/dist/esm/runtime/lazy-proxy.d.ts +2 -0
  100. package/dist/esm/runtime/lazy-proxy.d.ts.map +1 -1
  101. package/dist/esm/runtime/lazy-proxy.js +29 -15
  102. package/dist/esm/runtime/lazy-proxy.js.map +1 -1
  103. package/dist/esm/runtime/luxon-transfer.d.ts +62 -0
  104. package/dist/esm/runtime/luxon-transfer.d.ts.map +1 -0
  105. package/dist/esm/runtime/luxon-transfer.js +183 -0
  106. package/dist/esm/runtime/luxon-transfer.js.map +1 -0
  107. package/dist/esm/runtime/serialize.d.ts +7 -7
  108. package/dist/esm/runtime/serialize.d.ts.map +1 -1
  109. package/dist/esm/runtime/serialize.js +42 -30
  110. package/dist/esm/runtime/serialize.js.map +1 -1
  111. package/dist/esm/runtime/transfer.d.ts +77 -0
  112. package/dist/esm/runtime/transfer.d.ts.map +1 -0
  113. package/dist/esm/runtime/transfer.js +173 -0
  114. package/dist/esm/runtime/transfer.js.map +1 -0
  115. package/dist/esm/types/bridge.d.ts +16 -0
  116. package/dist/esm/types/bridge.d.ts.map +1 -1
  117. package/dist/esm/types/bridge.js +1 -0
  118. package/dist/esm/types/bridge.js.map +1 -1
  119. package/dist/esm/types/evaluator.d.ts +9 -0
  120. package/dist/esm/types/evaluator.d.ts.map +1 -1
  121. package/dist/esm/types/evaluator.js.map +1 -1
  122. package/package.json +6 -6
@@ -0,0 +1,328 @@
1
+ import { bridgeMessageSchema } from './bridge-messages';
2
+ // ============================================================================
3
+ // Host-side functions shared by the expression bridges.
4
+ //
5
+ // Both IsolatedVmBridge and QuickJsBridge expose the same three host
6
+ // callbacks to the guest — getValueAtPath, getArrayElement, callHost — plus
7
+ // the error-sentinel helpers and bundle loader around them. The logic is
8
+ // engine-agnostic: each bridge wraps these pure functions in its own
9
+ // callback mechanism (ivm.Callback / vm.newFunction) and marshals the
10
+ // plain, JSON-shaped return values across its own boundary.
11
+ // ============================================================================
12
+ /** Check if a value is an error sentinel returned by serializeError. */
13
+ export function isErrorSentinel(value) {
14
+ return (typeof value === 'object' &&
15
+ value !== null &&
16
+ value.__isError === true);
17
+ }
18
+ /**
19
+ * Serialize an error into a transferable metadata object.
20
+ *
21
+ * Host-side callbacks (getValueAtPath, etc.) catch errors and return this
22
+ * sentinel instead of letting the error cross the boundary (which strips
23
+ * custom class identity and properties). The guest-side proxy detects
24
+ * __isError and throws the sentinel; the host reconstructs a real Error
25
+ * after it round-trips back (see reconstructError).
26
+ */
27
+ export function serializeError(err) {
28
+ if (err instanceof Error) {
29
+ const extra = Object.fromEntries(Object.entries(err).filter(([key]) => key !== 'name' && key !== 'message' && key !== 'stack'));
30
+ return {
31
+ __isError: true,
32
+ name: err.name,
33
+ message: err.message,
34
+ stack: err.stack,
35
+ extra,
36
+ };
37
+ }
38
+ return { __isError: true, name: 'Error', message: String(err), extra: {} };
39
+ }
40
+ /**
41
+ * Reconstruct an error from a serialized error sentinel.
42
+ *
43
+ * Restores the name, stack, and custom properties that would otherwise be
44
+ * lost crossing the guest boundary.
45
+ */
46
+ export function reconstructError(data) {
47
+ const error = new Error(data.message);
48
+ error.name = data.name || 'Error';
49
+ if (data.stack) {
50
+ error.stack = data.stack;
51
+ }
52
+ // Restore custom properties transferred across the boundary
53
+ if (data.extra) {
54
+ Object.assign(error, data.extra);
55
+ }
56
+ return error;
57
+ }
58
+ /**
59
+ * Navigate the data object by path and return metadata or a primitive value.
60
+ *
61
+ * Used by createDeepLazyProxy when accessing properties. Returns metadata
62
+ * markers for arrays and objects, or the primitive value directly.
63
+ *
64
+ * Special-case: paths starting with ['$item', index] call data.$item(index)
65
+ * to get the sub-proxy for that item, then continue navigating the rest;
66
+ * likewise ['$', nodeName] calls data.$(nodeName).
67
+ *
68
+ * Function-typed values are returned as `undefined` — every callable on
69
+ * the host data surface (`$('Foo').first()`, `$items()`, `$fromAI()`,
70
+ * `$evaluateExpression()`, `$getPairedItem()`) is wired guest-side via
71
+ * the typed-RPC dispatcher (`callHost`). No expression form should
72
+ * reach a function through this path (invariant:
73
+ * __tests__/host-fn-shadowing.test.ts).
74
+ */
75
+ export function getValueAtPath(data, pathArr) {
76
+ let value = data;
77
+ let startIndex = 0;
78
+ const itemFn = data.$item;
79
+ if (pathArr.length >= 2 && pathArr[0] === '$item' && typeof itemFn === 'function') {
80
+ const itemIndex = parseInt(pathArr[1], 10);
81
+ if (!isNaN(itemIndex)) {
82
+ value = itemFn(itemIndex);
83
+ startIndex = 2;
84
+ }
85
+ }
86
+ else {
87
+ const dollarFn = data.$;
88
+ if (pathArr.length >= 2 && pathArr[0] === '$' && typeof dollarFn === 'function') {
89
+ value = dollarFn(pathArr[1]);
90
+ startIndex = 2;
91
+ }
92
+ }
93
+ for (let i = startIndex; i < pathArr.length; i++) {
94
+ value = value?.[pathArr[i]];
95
+ if (value === undefined || value === null) {
96
+ return value;
97
+ }
98
+ }
99
+ // Functions are not reachable via the lazy-proxy data path —
100
+ // every callable on the host data surface routes through the
101
+ // typed-RPC dispatcher. Return undefined so any residual
102
+ // access surfaces as missing rather than as a stale metadata
103
+ // marker the runtime no longer knows how to interpret.
104
+ if (typeof value === 'function') {
105
+ return undefined;
106
+ }
107
+ // Handle arrays - always lazy, only transfer length
108
+ if (Array.isArray(value)) {
109
+ return {
110
+ __isArray: true,
111
+ __length: value.length,
112
+ __data: null,
113
+ };
114
+ }
115
+ // Dates have no enumerable own keys; pass through instead of
116
+ // marshaling as an empty object.
117
+ if (value instanceof Date) {
118
+ return value;
119
+ }
120
+ // Handle objects - return metadata with keys
121
+ if (value !== null && typeof value === 'object') {
122
+ return {
123
+ __isObject: true,
124
+ __keys: Object.keys(value),
125
+ };
126
+ }
127
+ // Primitive value
128
+ return value;
129
+ }
130
+ /**
131
+ * Get an array element at an index, navigating to the array by path first
132
+ * (same `$`/`$item` special-casing as getValueAtPath).
133
+ *
134
+ * Used by the array proxy when accessing numeric indices.
135
+ */
136
+ export function getArrayElement(data, pathArr, index) {
137
+ let arr = data;
138
+ let startIndex = 0;
139
+ const itemFn = data.$item;
140
+ if (pathArr.length >= 2 && pathArr[0] === '$item' && typeof itemFn === 'function') {
141
+ const itemIndex = parseInt(pathArr[1], 10);
142
+ if (!isNaN(itemIndex)) {
143
+ arr = itemFn(itemIndex);
144
+ startIndex = 2;
145
+ }
146
+ }
147
+ else {
148
+ const dollarFn = data.$;
149
+ if (pathArr.length >= 2 && pathArr[0] === '$' && typeof dollarFn === 'function') {
150
+ arr = dollarFn(pathArr[1]);
151
+ startIndex = 2;
152
+ }
153
+ }
154
+ for (let i = startIndex; i < pathArr.length; i++) {
155
+ arr = arr?.[pathArr[i]];
156
+ if (arr === undefined || arr === null) {
157
+ return undefined;
158
+ }
159
+ }
160
+ if (!Array.isArray(arr)) {
161
+ return undefined;
162
+ }
163
+ // Only genuine array indices are reachable; anything else (e.g.
164
+ // 'constructor', '__lookupGetter__') would read off the prototype
165
+ // chain and could leak a host function reference across the boundary.
166
+ if (!Number.isInteger(index) || index < 0) {
167
+ return undefined;
168
+ }
169
+ const element = arr[index];
170
+ // Functions are never reachable through the data surface — mirror the
171
+ // guard in getValueAtPath so a host callable can't cross the boundary
172
+ // (invariant: __tests__/host-fn-shadowing.test.ts).
173
+ if (typeof element === 'function') {
174
+ return undefined;
175
+ }
176
+ // Dates have no enumerable own keys; pass through instead of
177
+ // marshaling as an empty object.
178
+ if (element instanceof Date) {
179
+ return element;
180
+ }
181
+ // If element is object/array, return metadata
182
+ if (element !== null && typeof element === 'object') {
183
+ if (Array.isArray(element)) {
184
+ return {
185
+ __isArray: true,
186
+ __length: element.length,
187
+ __data: null,
188
+ };
189
+ }
190
+ return {
191
+ __isObject: true,
192
+ __keys: Object.keys(element),
193
+ };
194
+ }
195
+ // Primitive element
196
+ return element;
197
+ }
198
+ /**
199
+ * Host-side dispatcher for the typed-RPC `callHost` channel.
200
+ *
201
+ * The guest sends one envelope per typed RPC invocation:
202
+ * `callHost({ type: 'getNodeFirst', nodeName, branchIndex?, runIndex? })`
203
+ *
204
+ * Inputs cross a trust boundary, so the dispatcher parses every envelope
205
+ * with the host-side zod schema (`bridgeMessageSchema`) before any
206
+ * dispatch happens. Anything that deviates from the declared shape —
207
+ * unknown `type`, missing required fields, extra unexpected fields,
208
+ * wrong field types — fails the parse and throws; the calling bridge
209
+ * catches and returns an error sentinel to the guest.
210
+ *
211
+ * After parsing, `switch (msg.type)` dispatches with a fully narrowed
212
+ * message type. The operation set is exactly the cases in this switch;
213
+ * the `type` field selects a static branch in source, not a property
214
+ * lookup on a runtime object. Each case reads a fixed literal property
215
+ * name off the host-side data proxy — the guest cannot influence which
216
+ * property is dereferenced.
217
+ *
218
+ * Return-value note: cases must return plain, structured-clone-able,
219
+ * JSON-shaped data. Each bridge marshals the result across its own
220
+ * boundary (structured clone for isolated-vm, sentinel-wrapped JSON
221
+ * round-trip for QuickJS), so engine objects or other non-cloneable
222
+ * values must not be returned.
223
+ */
224
+ export function dispatchHostCall(rawMsg, data) {
225
+ const msg = bridgeMessageSchema.parse(rawMsg);
226
+ switch (msg.type) {
227
+ // The `$('Foo').{first,last,all}` typed RPCs.
228
+ //
229
+ // Eliminating `data.$` as a host-callable entirely would require
230
+ // reaching the `WorkflowDataProxy` internals (e.g.
231
+ // `getNodeExecutionOrPinnedData`) rather than the public `$()` API;
232
+ // that's a follow-up.
233
+ //
234
+ // `data.$` is a host-wired function (`WorkflowDataProxy`'s `$`). If it
235
+ // ever isn't, optional chaining short-circuits to `undefined` — the
236
+ // same observable result the runtime's `E()` handler produces from any
237
+ // thrown error here.
238
+ case 'getNodeFirst':
239
+ return data.$?.(msg.nodeName)?.first?.(msg.branchIndex, msg.runIndex);
240
+ case 'getNodeLast':
241
+ return data.$?.(msg.nodeName)?.last?.(msg.branchIndex, msg.runIndex);
242
+ case 'getNodeAll':
243
+ return data.$?.(msg.nodeName)?.all?.(msg.branchIndex, msg.runIndex);
244
+ // The `$input.{first,last,all}` typed RPCs.
245
+ //
246
+ // Each reads a fixed literal property name off `data.$input` (the
247
+ // host's `WorkflowDataProxy` input proxy). The host enforces zero
248
+ // arguments on these methods — the schemas have no fields besides
249
+ // `type`, so the guest cannot pass anything that would trigger the
250
+ // "should have no arguments" error path on the host side.
251
+ case 'getInputFirst':
252
+ return data.$input?.first?.();
253
+ case 'getInputLast':
254
+ return data.$input?.last?.();
255
+ case 'getInputAll':
256
+ return data.$input?.all?.();
257
+ // `$items(nodeName?, outputIndex?, runIndex?)` — the global accessor
258
+ // for a node's execution data. Reads the literal `$items` property
259
+ // off `data` (host-wired by `WorkflowDataProxy`) and forwards the
260
+ // validated args verbatim. The host applies its own defaults when
261
+ // fields are `undefined`.
262
+ case 'getItems':
263
+ return data.$items?.(msg.nodeName, msg.outputIndex, msg.runIndex);
264
+ // `$fromAI(name, description?, type?, defaultValue?)` and its
265
+ // `$fromAi` / `$fromai` aliases. Reads the literal `$fromAI` property
266
+ // off `data` (host-wired) and forwards the args. The host validates
267
+ // `name` (required + regex) and applies its own resolution / fallback
268
+ // logic, so empty / invalid names surface as the host's structured
269
+ // `ExpressionError` rather than a generic zod parse error.
270
+ //
271
+ // Note: `msg.valueType` maps to the host's third positional parameter
272
+ // (`_type` in `WorkflowDataProxy.handleFromAi`). The bridge protocol
273
+ // renames it to avoid collision with the `type` discriminator on the
274
+ // envelope — the host parameter currently goes unused, but if it ever
275
+ // gains a name (`type`), this mapping should stay explicit.
276
+ case 'fromAi':
277
+ return data.$fromAI?.(msg.name, msg.description, msg.valueType, msg.defaultValue);
278
+ // The `$('Foo').pairedItem(itemIndex?)` / `.itemMatching(...)` /
279
+ // `.item` cluster. Three separate typed RPCs, each reading exactly one
280
+ // literal property off the host node proxy.
281
+ //
282
+ // The split is load-bearing: the host's `pairedItemMethod` closure
283
+ // captures which property name the proxy `get` trap saw, and uses
284
+ // that to pick the right error message (e.g. "Missing item index for
285
+ // .itemMatching()") and to decide between method-call vs getter
286
+ // semantics for `.item`. Reading the matching property here lets
287
+ // those host-side branches fire exactly as they do in the legacy
288
+ // engine; no in-guest validation needed.
289
+ case 'getNodePairedItem':
290
+ return data.$?.(msg.nodeName)?.pairedItem?.(msg.itemIndex);
291
+ case 'getNodeItemMatching':
292
+ return data.$?.(msg.nodeName)?.itemMatching?.(msg.itemIndex);
293
+ case 'getNodeItem':
294
+ // `.item` is a host getter — accessing it invokes the resolver and
295
+ // returns the value immediately. Optional chaining only short-
296
+ // circuits on null/undefined; the getter still fires on access.
297
+ return data.$?.(msg.nodeName)?.item;
298
+ // `$evaluateExpression(expression, itemIndex?)`. Forwards the string
299
+ // to the host's nested-evaluation helper, which re-enters the
300
+ // expression engine on the inner expression. Under the VM engine this
301
+ // round-trips through the bridge again on a fresh evaluation cycle,
302
+ // which is the same shape the legacy engine supports.
303
+ case 'evaluateExpression':
304
+ return data.$evaluateExpression?.(msg.expression, msg.itemIndex);
305
+ // `$getPairedItem(destinationNodeName, incomingSourceData,
306
+ // initialPairedItem)`. Forwards directly to the host binding, which
307
+ // walks the paired-item ancestry chain back to the named upstream
308
+ // node and returns the matching execution item.
309
+ //
310
+ // The two trailing host parameters — `usedMethodName` and
311
+ // `nodeBeforeLast` — are deliberately not part of the wire protocol:
312
+ // the host's default for `usedMethodName` is already `$getPairedItem`,
313
+ // and `nodeBeforeLast` is an internal recursion argument the host sets
314
+ // during traversal.
315
+ case 'getPairedItem':
316
+ return data.$getPairedItem?.(msg.destinationNodeName, msg.incomingSourceData, msg.initialPairedItem);
317
+ default: {
318
+ // Unreachable at runtime — zod rejects unknown `type` values
319
+ // before the switch. The `never` assignment is the compile-time
320
+ // guard: a new schema added to `bridgeMessageSchema` without a
321
+ // matching case here becomes a type error.
322
+ const exhaustive = msg;
323
+ void exhaustive;
324
+ throw new Error('Unhandled bridge message');
325
+ }
326
+ }
327
+ }
328
+ //# sourceMappingURL=host-functions.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"host-functions.js","sourceRoot":"","sources":["../../../src/bridge/host-functions.ts"],"names":[],"mappings":"AAEA,OAAO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  * @throws {Error} If context not initialized or bundle loading fails
44
44
  */
45
45
  private loadVendorLibraries;
46
- /**
47
- * Verify the proxy system loaded correctly.
48
- *
49
- * The proxy system is loaded as part of the runtime bundle in loadVendorLibraries().
50
- * This method verifies all required components are available.
51
- *
52
- * @private
53
- * @throws {Error} If context not initialized or proxy system verification fails
54
- */
55
- private verifyProxySystem;
56
46
  /**
57
47
  * Inject the E() error handler into the isolate context.
58
48
  *
@@ -77,17 +67,20 @@ export declare class IsolatedVmBridge implements RuntimeBridge {
77
67
  * @throws {Error} If context not initialized
78
68
  */
79
69
  private injectErrorHandler;
70
+ /**
71
+ * Synchronous variant of initialize(): the same steps through isolated-vm's
72
+ * sync APIs, for on-demand creation inside the synchronous evaluate() path
73
+ * (lazy acquisition with an exhausted pool). Blocks the event loop for the
74
+ * duration of one isolate setup — pool warmup should stay on the async
75
+ * initialize().
76
+ */
77
+ initializeSync(): void;
80
78
  /**
81
79
  * Create an ivm.Callback for getting value/metadata at a path.
82
80
  *
83
- * Used by createDeepLazyProxy when accessing properties. Returns metadata
84
- * markers for arrays and objects, or the primitive value directly.
85
- *
86
- * Function-typed values are returned as `undefined` — every callable on
87
- * the host data surface (`$('Foo').first()`, `$items()`, `$fromAI()`,
88
- * `$evaluateExpression()`, `$getPairedItem()`) is wired in-isolate via
89
- * the typed-RPC dispatcher (`callHost`). No expression form should
90
- * reach a function through this path.
81
+ * Thin wrapper around the shared getValueAtPath (see host-functions.ts
82
+ * for navigation and guard semantics); errors are caught and returned
83
+ * as sentinels instead of crossing the isolate boundary.
91
84
  *
92
85
  * @param data - Current workflow data to use for callback responses
93
86
  * @private
@@ -96,144 +89,32 @@ export declare class IsolatedVmBridge implements RuntimeBridge {
96
89
  /**
97
90
  * Create an ivm.Callback for getting array elements at an index.
98
91
  *
99
- * Used by array proxy when accessing numeric indices.
92
+ * Thin wrapper around the shared getArrayElement (see host-functions.ts
93
+ * for navigation and guard semantics); errors are caught and returned
94
+ * as sentinels instead of crossing the isolate boundary.
100
95
  *
101
96
  * @param data - Current workflow data to use for callback responses
102
97
  * @private
103
98
  */
104
99
  private createGetArrayElementRef;
105
100
  /**
106
- * Create the single typed-RPC dispatcher.
107
- *
108
- * The isolate sends one envelope per typed RPC invocation:
109
- * `callHost({ type: 'getNodeFirst', nodeName, branchIndex?, runIndex? })`
101
+ * Create the ivm.Callback for the typed-RPC `callHost` channel.
110
102
  *
111
- * Inputs cross a trust boundary, so the dispatcher parses every envelope
112
- * with the host-side zod schema (`bridgeMessageSchema`) before any
113
- * dispatch happens. Anything that deviates from the declared shape —
114
- * unknown `type`, missing required fields, extra unexpected fields,
115
- * wrong field types — fails the parse and an error sentinel is returned
116
- * to the caller.
103
+ * Thin wrapper around the shared dispatchHostCall (see host-functions.ts
104
+ * for envelope validation and per-message rationale); errors — including
105
+ * zod parse failures — are caught and returned as sentinels instead of
106
+ * crossing the isolate boundary.
117
107
  *
118
- * After parsing, `switch (msg.type)` dispatches to a private handler with
119
- * a fully narrowed message type. The operation set is exactly the cases
120
- * in this switch; the `type` field selects a static branch in source,
121
- * not a property lookup on a runtime object.
122
- *
123
- * Return-value note: handlers must return plain, structured-clone-able
124
- * data. Results cross into the isolate through an ivm.Callback, which copies
125
- * them via the structured-clone algorithm — return JSON-shaped values, not
126
- * isolated-vm objects (`Reference`/`ExternalCopy`) or other non-cloneable
127
- * values.
108
+ * Return-value note: the dispatcher returns plain, structured-clone-able
109
+ * data. Results cross into the isolate through an ivm.Callback, which
110
+ * copies them via the structured-clone algorithm — JSON-shaped values,
111
+ * not isolated-vm objects (`Reference`/`ExternalCopy`) or other
112
+ * non-cloneable values.
128
113
  *
129
114
  * @param data - Current workflow data
130
115
  * @private
131
116
  */
132
117
  private createCallHostRef;
133
- /**
134
- * Handlers for the `$('Foo').{first,last,all}` typed RPCs.
135
- *
136
- * Each handler reads a fixed literal property name off the host-side node
137
- * proxy — the isolate cannot influence which property is dereferenced.
138
- * Eliminating `data.$` as a host-callable entirely would require reaching
139
- * the `WorkflowDataProxy` internals (e.g. `getNodeExecutionOrPinnedData`)
140
- * rather than the public `$()` API; that's a follow-up.
141
- *
142
- * `data.$` is a host-wired function (`WorkflowDataProxy`'s `$`). If it
143
- * ever isn't, optional chaining short-circuits to `undefined` — the same
144
- * observable result the runtime's `E()` handler produces from any thrown
145
- * error here.
146
- *
147
- * @private
148
- */
149
- private handleGetNodeFirst;
150
- private handleGetNodeLast;
151
- private handleGetNodeAll;
152
- /**
153
- * Handlers for the `$input.{first,last,all}` typed RPCs.
154
- *
155
- * Each reads a fixed literal property name off `data.$input` (the host's
156
- * `WorkflowDataProxy` input proxy). The host enforces zero arguments on
157
- * these methods — the schemas have no fields besides `type`, so the
158
- * isolate cannot pass anything that would trigger the "should have no
159
- * arguments" error path on the host side.
160
- *
161
- * @private
162
- */
163
- private handleGetInputFirst;
164
- private handleGetInputLast;
165
- private handleGetInputAll;
166
- /**
167
- * Handler for `$items(nodeName?, outputIndex?, runIndex?)` — the
168
- * global accessor for a node's execution data. Reads the literal
169
- * `$items` property off `data` (host-wired by `WorkflowDataProxy`)
170
- * and forwards the validated args verbatim. The host applies its own
171
- * defaults when fields are `undefined`.
172
- *
173
- * @private
174
- */
175
- private handleGetItems;
176
- /**
177
- * Handler for `$fromAI(name, description?, type?, defaultValue?)` and its
178
- * `$fromAi` / `$fromai` aliases. Reads the literal `$fromAI` property
179
- * off `data` (host-wired) and forwards the args. The host validates
180
- * `name` (required + regex) and applies its own resolution / fallback
181
- * logic, so empty / invalid names surface as the host's structured
182
- * `ExpressionError` rather than a generic zod parse error.
183
- *
184
- * Note: `msg.valueType` maps to the host's third positional parameter
185
- * (`_type` in `WorkflowDataProxy.handleFromAi`). The bridge protocol
186
- * renames it to avoid collision with the `type` discriminator on the
187
- * envelope — the host parameter currently goes unused, but if it ever
188
- * gains a name (`type`), this mapping should stay explicit.
189
- *
190
- * @private
191
- */
192
- private handleFromAi;
193
- /**
194
- * Handlers for the `$('Foo').pairedItem(itemIndex?)` / `.itemMatching(...)` /
195
- * `.item` cluster. Three separate typed RPCs, each reading exactly one
196
- * literal property off the host node proxy.
197
- *
198
- * The split is load-bearing: the host's `pairedItemMethod` closure
199
- * captures which property name the proxy `get` trap saw, and uses
200
- * that to pick the right error message (e.g. "Missing item index for
201
- * .itemMatching()") and to decide between method-call vs getter
202
- * semantics for `.item`. Reading the matching property here lets
203
- * those host-side branches fire exactly as they do in the legacy
204
- * engine; no in-isolate validation needed.
205
- *
206
- * @private
207
- */
208
- private handleGetNodePairedItem;
209
- private handleGetNodeItemMatching;
210
- private handleGetNodeItem;
211
- /**
212
- * Handler for `$evaluateExpression(expression, itemIndex?)`. Forwards
213
- * the string to the host's nested-evaluation helper, which re-enters
214
- * the expression engine on the inner expression. Under the VM engine
215
- * this round-trips through the bridge again as a new evaluation on the
216
- * enclosing call's time budget, which is the same shape the legacy
217
- * engine supports.
218
- *
219
- * @private
220
- */
221
- private handleEvaluateExpression;
222
- /**
223
- * Handler for `$getPairedItem(destinationNodeName, incomingSourceData,
224
- * initialPairedItem)`. Forwards directly to the host binding, which
225
- * walks the paired-item ancestry chain back to the named upstream node
226
- * and returns the matching execution item.
227
- *
228
- * The two trailing host parameters — `usedMethodName` and
229
- * `nodeBeforeLast` — are deliberately not part of the wire protocol:
230
- * the host's default for `usedMethodName` is already `$getPairedItem`,
231
- * and `nodeBeforeLast` is an internal recursion argument the host sets
232
- * during traversal.
233
- *
234
- * @private
235
- */
236
- private handleGetPairedItem;
237
118
  /**
238
119
  * Execute JavaScript code in the isolated context.
239
120
  *
@@ -260,13 +141,6 @@ export declare class IsolatedVmBridge implements RuntimeBridge {
260
141
  * ran on — reporting "timed out after 137ms" would misstate the limit.
261
142
  */
262
143
  private timeoutError;
263
- /**
264
- * Reconstruct an error from serialized isolate data.
265
- *
266
- * Maps error names back to their host-side classes and restores
267
- * custom properties that would otherwise be lost crossing the boundary.
268
- */
269
- private reconstructError;
270
144
  /**
271
145
  * Dispose of the isolate and free resources.
272
146
  *
@@ -1 +1 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