@revoengine/sdk 1.0.0 → 1.0.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.
package/README.md CHANGED
@@ -1,7 +1,7 @@
1
1
  # @revoengine/sdk
2
2
 
3
3
  Official Node.js SDK for RevoEngine. It provides the modern `api`, `utils`,
4
- `storage`, and `agents` namespaces plus the `batch` controller in both
4
+ `storage`, and `agents` namespaces, top-level `execute()`, and the `batch` controller in both
5
5
  Revo-hosted `CUSTOM_NODEJS` components and standalone Node.js applications.
6
6
 
7
7
  Requirements: Node.js 22 or newer.
@@ -13,14 +13,14 @@ Requirements: Node.js 22 or newer.
13
13
  | Revo-hosted `CUSTOM_NODEJS` | Export `async function init(runtime)` | Revo injects an execution-bound runtime; user code receives no API key. |
14
14
  | Standalone Node.js | Create `new RevoClient(options)` | Supply a RevoEngine API key explicitly or through an environment variable. |
15
15
 
16
- Both modes expose the same `api`, `utils`, `storage`, `agents`, and `batch`
16
+ Both modes expose the same `api`, `utils`, `storage`, `agents`, `execute`, and `batch`
17
17
  properties, but return types reflect where the work happens:
18
18
 
19
19
  | Call kind | Revo-hosted | Standalone |
20
20
  | --- | --- | --- |
21
21
  | Execution snapshot, cache, debug, and logging | Synchronous | Throws synchronously because no execution context exists |
22
22
  | Current user and instance | Synchronous injected snapshot | Asynchronous lazy `/api/v1/me` discovery |
23
- | Remote `api`, `storage`, and `agents` calls | Asynchronous | Asynchronous |
23
+ | Remote `api`, `storage`, `agents`, and `execute()` calls | Asynchronous | Asynchronous |
24
24
  | Local `utils` and `batch.configure()` | Synchronous unless the utility is inherently asynchronous | Same |
25
25
 
26
26
  ## Installation
@@ -31,7 +31,7 @@ Standalone applications install the SDK normally:
31
31
  npm install @revoengine/sdk
32
32
  ```
33
33
 
34
- New Revo-hosted components receive `@revoengine/sdk: "1.0.0"` and a JSDoc
34
+ New Revo-hosted components receive the exact platform-supported SDK version and a JSDoc
35
35
  `RevoRuntime` type import in their generated starter files.
36
36
  RevoEngine pins that version again in the deployment package and injects the
37
37
  runtime into the component entrypoint. Component code does not construct a
@@ -43,7 +43,7 @@ The relevant generated `package.json` fields are:
43
43
  {
44
44
  "type": "module",
45
45
  "dependencies": {
46
- "@revoengine/sdk": "1.0.0"
46
+ "@revoengine/sdk": "1.0.1"
47
47
  }
48
48
  }
49
49
  ```
@@ -64,7 +64,7 @@ separate initialization method.
64
64
  ```js
65
65
  /** @param {import('@revoengine/sdk').RevoRuntime} runtime */
66
66
  export async function init(runtime) {
67
- const { api, utils, storage, agents, batch } = runtime;
67
+ const { api, utils, storage, agents, execute, batch } = runtime;
68
68
  const { data: rows, next } = await api.getDatabaseData('Sales', {
69
69
  fields: ['saleId', 'customerId', 'total', 'createdAt'],
70
70
  sort: ['-createdAt'],
@@ -186,6 +186,77 @@ console.log(result.data);
186
186
 
187
187
  There is no `init()` or connection method.
188
188
 
189
+ ## Execute active low-code libraries
190
+
191
+ `execute(code, options)` runs one transient JavaScript or TypeScript component inside
192
+ RevoEngine. The source has the normal low-code `api` and active tenant `libs.*`
193
+ surface. Library functions and source never move into the Node.js process; only the
194
+ JSON-serializable request and execution result cross the runtime transport.
195
+
196
+ Revo-hosted `CUSTOM_NODEJS`:
197
+
198
+ ```js
199
+ /** @param {import('@revoengine/sdk').RevoRuntime} runtime */
200
+ export async function init(runtime) {
201
+ const customerId = runtime.api.input('customerId');
202
+ const execution = await runtime.execute(
203
+ `
204
+ const customerId = api.input('customerId');
205
+ const customer = await libs.Customers.Queries.get(customerId);
206
+ const balance = await libs.Billing.Balance.current(customerId);
207
+ return { customer, balance };
208
+ `,
209
+ {
210
+ inputs: { customerId },
211
+ timeoutMs: 10_000,
212
+ },
213
+ );
214
+
215
+ return execution.results;
216
+ }
217
+ ```
218
+
219
+ Standalone Node.js:
220
+
221
+ ```ts
222
+ import { RevoClient } from '@revoengine/sdk';
223
+
224
+ const revo = new RevoClient({
225
+ apiKey: process.env.REVO_API_KEY,
226
+ executionDefaults: {
227
+ timeoutMs: 60_000,
228
+ memory: 256,
229
+ },
230
+ });
231
+
232
+ type CustomerSummary = {
233
+ customerId: string;
234
+ name: string;
235
+ balance: number;
236
+ };
237
+
238
+ const execution = await revo.execute<CustomerSummary>(
239
+ `
240
+ const customerId = api.input('customerId');
241
+ return libs.Customers.Summary.build(customerId);
242
+ `,
243
+ {
244
+ inputs: { customerId: 'customer-1' },
245
+ timeoutMs: 10_000,
246
+ },
247
+ );
248
+
249
+ console.log(execution.results);
250
+ ```
251
+
252
+ JavaScript is selected with `language: 'javascript'`; TypeScript is the default.
253
+ The default timeout is 60 seconds. Standalone `executionDefaults` set reusable
254
+ language, timeout, or memory defaults, and per-call options override them.
255
+ One `execute()` call creates one isolated execution. Put related `libs.*`
256
+ operations in the same source when they belong to one workflow. Concurrent separate
257
+ calls still use the SDK's automatic JSON-RPC batching but execute in separate isolates.
258
+ Low-code runtime batches are not retried because source can perform writes.
259
+
189
260
  ### Environment configuration
190
261
 
191
262
  ```ts
@@ -216,6 +287,11 @@ const revo = new RevoClient({
216
287
  baseUrl: 'https://api.revoengine.com',
217
288
  apiKey,
218
289
  requestTimeoutMs: 30_000,
290
+ executionDefaults: {
291
+ language: 'typescript',
292
+ timeoutMs: 60_000,
293
+ memory: 256,
294
+ },
219
295
  batch: {
220
296
  failureMode: 'independent',
221
297
  maxCalls: 16,
@@ -267,7 +343,7 @@ mutations. If transport is interrupted after dispatch, unresolved calls reject
267
343
  with `RevoTransportError` and `indeterminate: true`.
268
344
 
269
345
  Batching is not a transaction. `api.transactionDatabaseData` is intentionally
270
- not part of SDK 1.0.0.
346
+ not part of the SDK.
271
347
 
272
348
  ## Local utils
273
349
 
@@ -628,12 +704,12 @@ Common subclasses include:
628
704
  - `RevoProtocolError`
629
705
  - `RevoTransportError`
630
706
 
631
- ## SDK 1.0 compatibility notes
707
+ ## SDK compatibility notes
632
708
 
633
709
  - Node.js 22 or newer is required.
634
710
  - The package provides ESM, CommonJS, and TypeScript declarations.
635
711
  - The package has no runtime dependencies.
636
- - No package-level `api`, `utils`, `storage`, or `agents` singleton is exported.
712
+ - No package-level `api`, `utils`, `storage`, `agents`, or `execute` singleton is exported.
637
713
  - Deprecated low-code methods and aliases are excluded.
638
- - `api.transactionDatabaseData` is excluded from 1.0.0.
714
+ - `api.transactionDatabaseData` is excluded.
639
715
  - Runtime batches are non-transactional and are not retried automatically.
@@ -1,9 +1,9 @@
1
1
  import * as node_worker_threads from 'node:worker_threads';
2
2
 
3
- declare const SDK_VERSION: "1.0.0";
3
+ declare const SDK_VERSION: "1.0.1";
4
4
  declare const PROTOCOL_VERSION: 1;
5
- declare const CONTRACT_REVISION: "a88e3ddff38d91762aa4c771955343e986039cebb04e4347fd257bd96f65bf5c";
6
- type RuntimeSurfaceName = 'api' | 'storage' | 'agents';
5
+ declare const CONTRACT_REVISION: "b2e2a42372000367b1038ad4ea435ece2199434c9a229d525647f80647fee90b";
6
+ type RuntimeSurfaceName = 'api' | 'storage' | 'agents' | 'lowCode';
7
7
 
8
8
  // AUTO-GENERATED FILE. DO NOT EDIT DIRECTLY.
9
9
  // Sources: api.swagger-contracts.generated.d.ts, api.public.d.ts
@@ -2578,7 +2578,27 @@ interface RevoUtils {
2578
2578
  rsaSign(privateKey: string, payload: string, passphrase?: string): string;
2579
2579
  rsaVerify(publicKey: string, payload: string, signature: string): boolean;
2580
2580
  }
2581
+ /**
2582
+ * Source language for an ad-hoc low-code execution.
2583
+ */
2584
+ type LowCodeLanguage = 'javascript' | 'typescript';
2585
+ interface LowCodeExecuteOptions {
2586
+ /** Defaults to TypeScript. */
2587
+ language?: LowCodeLanguage;
2588
+ /** Input exposed through api.input() inside the low-code execution. */
2589
+ inputs?: any;
2590
+ /** Maximum execution time in milliseconds. Defaults to 60 seconds. */
2591
+ timeoutMs?: number;
2592
+ /** Optional isolate memory limit in MB. */
2593
+ memory?: number;
2594
+ }
2595
+ interface RevoLowCode {
2596
+ execute<T = LooseObject<any>>(code: string, options?: LowCodeExecuteOptions): Promise<ComponentExecuteResult<T>>;
2597
+ }
2581
2598
 
2599
+ type RevoExecute = RevoLowCode['execute'];
2600
+ type RevoExecuteOptions = NonNullable<Parameters<RevoExecute>[1]>;
2601
+ type RevoExecutionDefaults = Omit<RevoExecuteOptions, 'inputs'>;
2582
2602
  type StandaloneProfileMethod = 'currentUser' | 'getCurrentInstance' | 'getInstanceDetails';
2583
2603
  type AsyncMethod<Method> = Method extends (...args: infer Args) => infer Result ? (...args: Args) => Promise<Awaited<Result>> : never;
2584
2604
  /**
@@ -2602,6 +2622,7 @@ interface RevoClientOptions {
2602
2622
  fetch?: typeof fetch;
2603
2623
  requestTimeoutMs?: number;
2604
2624
  batch?: RevoBatchOptions;
2625
+ executionDefaults?: RevoExecutionDefaults;
2605
2626
  }
2606
2627
  interface RevoBatchLimits {
2607
2628
  maxCalls: number;
@@ -2663,6 +2684,7 @@ interface RevoRuntime {
2663
2684
  readonly utils: RevoUtils;
2664
2685
  readonly storage: RevoStorage;
2665
2686
  readonly agents: RevoAgents;
2687
+ readonly execute: RevoExecute;
2666
2688
  readonly batch: RevoBatchController;
2667
2689
  }
2668
2690
  interface HostedRuntimeBootstrap {
@@ -2680,6 +2702,7 @@ interface HostedRuntimeBootstrap {
2680
2702
  deadlineMs?: number;
2681
2703
  legacyApi?: Readonly<Record<string, unknown>>;
2682
2704
  batch?: RevoBatchOptions;
2705
+ executionDefaults?: RevoExecutionDefaults;
2683
2706
  }
2684
2707
  interface RevoRuntimeBridgeRequest {
2685
2708
  type: 'revo-runtime-call';
@@ -2757,4 +2780,4 @@ declare class RevoHttpResponseError extends RevoError {
2757
2780
  constructor(statusCode: number, body?: unknown);
2758
2781
  }
2759
2782
 
2760
- export { type RuntimeCall as A, type BatchFailureMode as B, CONTRACT_REVISION as C, type RuntimeCallResult as D, type SerializedRevoError as E, type HostedRuntimeBootstrap as H, PROTOCOL_VERSION as P, type RevoRuntime as R, SDK_VERSION as S, RevoExecutionExit as a, RevoHttpResponseError as b, type RevoRuntimeBridgeRequest as c, type RevoRuntimeBridgeResponse as d, type RevoRuntimeBridgeTransportError as e, type RevoStandaloneApi as f, type RevoUtils as g, type RevoStorage as h, type RevoAgents as i, type RevoBatchController as j, type RevoClientOptions as k, type RevoApi as l, RevoAuthenticationError as m, RevoBatchConfigurationError as n, RevoBatchLimitError as o, type RevoBatchLimits as p, type RevoBatchOptions as q, RevoConfigurationError as r, RevoError as s, RevoPermissionDeniedError as t, RevoProtocolError as u, RevoRemoteError as v, RevoRuntimeContextUnavailableError as w, RevoTransportError as x, type RuntimeBatchRequest as y, type RuntimeBatchResponse as z };
2783
+ export { RevoTransportError as A, type BatchFailureMode as B, CONTRACT_REVISION as C, type RuntimeBatchRequest as D, type RuntimeBatchResponse as E, type RuntimeCall as F, type RuntimeCallResult as G, type HostedRuntimeBootstrap as H, type SerializedRevoError as I, PROTOCOL_VERSION as P, type RevoRuntime as R, SDK_VERSION as S, RevoExecutionExit as a, RevoHttpResponseError as b, type RevoRuntimeBridgeRequest as c, type RevoRuntimeBridgeResponse as d, type RevoRuntimeBridgeTransportError as e, type RevoStandaloneApi as f, type RevoUtils as g, type RevoStorage as h, type RevoAgents as i, type RevoExecute as j, type RevoBatchController as k, type RevoClientOptions as l, type RevoApi as m, RevoAuthenticationError as n, RevoBatchConfigurationError as o, RevoBatchLimitError as p, type RevoBatchLimits as q, type RevoBatchOptions as r, RevoConfigurationError as s, RevoError as t, type RevoExecuteOptions as u, type RevoExecutionDefaults as v, RevoPermissionDeniedError as w, RevoProtocolError as x, RevoRemoteError as y, RevoRuntimeContextUnavailableError as z };
@@ -1,9 +1,9 @@
1
1
  import * as node_worker_threads from 'node:worker_threads';
2
2
 
3
- declare const SDK_VERSION: "1.0.0";
3
+ declare const SDK_VERSION: "1.0.1";
4
4
  declare const PROTOCOL_VERSION: 1;
5
- declare const CONTRACT_REVISION: "a88e3ddff38d91762aa4c771955343e986039cebb04e4347fd257bd96f65bf5c";
6
- type RuntimeSurfaceName = 'api' | 'storage' | 'agents';
5
+ declare const CONTRACT_REVISION: "b2e2a42372000367b1038ad4ea435ece2199434c9a229d525647f80647fee90b";
6
+ type RuntimeSurfaceName = 'api' | 'storage' | 'agents' | 'lowCode';
7
7
 
8
8
  // AUTO-GENERATED FILE. DO NOT EDIT DIRECTLY.
9
9
  // Sources: api.swagger-contracts.generated.d.ts, api.public.d.ts
@@ -2578,7 +2578,27 @@ interface RevoUtils {
2578
2578
  rsaSign(privateKey: string, payload: string, passphrase?: string): string;
2579
2579
  rsaVerify(publicKey: string, payload: string, signature: string): boolean;
2580
2580
  }
2581
+ /**
2582
+ * Source language for an ad-hoc low-code execution.
2583
+ */
2584
+ type LowCodeLanguage = 'javascript' | 'typescript';
2585
+ interface LowCodeExecuteOptions {
2586
+ /** Defaults to TypeScript. */
2587
+ language?: LowCodeLanguage;
2588
+ /** Input exposed through api.input() inside the low-code execution. */
2589
+ inputs?: any;
2590
+ /** Maximum execution time in milliseconds. Defaults to 60 seconds. */
2591
+ timeoutMs?: number;
2592
+ /** Optional isolate memory limit in MB. */
2593
+ memory?: number;
2594
+ }
2595
+ interface RevoLowCode {
2596
+ execute<T = LooseObject<any>>(code: string, options?: LowCodeExecuteOptions): Promise<ComponentExecuteResult<T>>;
2597
+ }
2581
2598
 
2599
+ type RevoExecute = RevoLowCode['execute'];
2600
+ type RevoExecuteOptions = NonNullable<Parameters<RevoExecute>[1]>;
2601
+ type RevoExecutionDefaults = Omit<RevoExecuteOptions, 'inputs'>;
2582
2602
  type StandaloneProfileMethod = 'currentUser' | 'getCurrentInstance' | 'getInstanceDetails';
2583
2603
  type AsyncMethod<Method> = Method extends (...args: infer Args) => infer Result ? (...args: Args) => Promise<Awaited<Result>> : never;
2584
2604
  /**
@@ -2602,6 +2622,7 @@ interface RevoClientOptions {
2602
2622
  fetch?: typeof fetch;
2603
2623
  requestTimeoutMs?: number;
2604
2624
  batch?: RevoBatchOptions;
2625
+ executionDefaults?: RevoExecutionDefaults;
2605
2626
  }
2606
2627
  interface RevoBatchLimits {
2607
2628
  maxCalls: number;
@@ -2663,6 +2684,7 @@ interface RevoRuntime {
2663
2684
  readonly utils: RevoUtils;
2664
2685
  readonly storage: RevoStorage;
2665
2686
  readonly agents: RevoAgents;
2687
+ readonly execute: RevoExecute;
2666
2688
  readonly batch: RevoBatchController;
2667
2689
  }
2668
2690
  interface HostedRuntimeBootstrap {
@@ -2680,6 +2702,7 @@ interface HostedRuntimeBootstrap {
2680
2702
  deadlineMs?: number;
2681
2703
  legacyApi?: Readonly<Record<string, unknown>>;
2682
2704
  batch?: RevoBatchOptions;
2705
+ executionDefaults?: RevoExecutionDefaults;
2683
2706
  }
2684
2707
  interface RevoRuntimeBridgeRequest {
2685
2708
  type: 'revo-runtime-call';
@@ -2757,4 +2780,4 @@ declare class RevoHttpResponseError extends RevoError {
2757
2780
  constructor(statusCode: number, body?: unknown);
2758
2781
  }
2759
2782
 
2760
- export { type RuntimeCall as A, type BatchFailureMode as B, CONTRACT_REVISION as C, type RuntimeCallResult as D, type SerializedRevoError as E, type HostedRuntimeBootstrap as H, PROTOCOL_VERSION as P, type RevoRuntime as R, SDK_VERSION as S, RevoExecutionExit as a, RevoHttpResponseError as b, type RevoRuntimeBridgeRequest as c, type RevoRuntimeBridgeResponse as d, type RevoRuntimeBridgeTransportError as e, type RevoStandaloneApi as f, type RevoUtils as g, type RevoStorage as h, type RevoAgents as i, type RevoBatchController as j, type RevoClientOptions as k, type RevoApi as l, RevoAuthenticationError as m, RevoBatchConfigurationError as n, RevoBatchLimitError as o, type RevoBatchLimits as p, type RevoBatchOptions as q, RevoConfigurationError as r, RevoError as s, RevoPermissionDeniedError as t, RevoProtocolError as u, RevoRemoteError as v, RevoRuntimeContextUnavailableError as w, RevoTransportError as x, type RuntimeBatchRequest as y, type RuntimeBatchResponse as z };
2783
+ export { RevoTransportError as A, type BatchFailureMode as B, CONTRACT_REVISION as C, type RuntimeBatchRequest as D, type RuntimeBatchResponse as E, type RuntimeCall as F, type RuntimeCallResult as G, type HostedRuntimeBootstrap as H, type SerializedRevoError as I, PROTOCOL_VERSION as P, type RevoRuntime as R, SDK_VERSION as S, RevoExecutionExit as a, RevoHttpResponseError as b, type RevoRuntimeBridgeRequest as c, type RevoRuntimeBridgeResponse as d, type RevoRuntimeBridgeTransportError as e, type RevoStandaloneApi as f, type RevoUtils as g, type RevoStorage as h, type RevoAgents as i, type RevoExecute as j, type RevoBatchController as k, type RevoClientOptions as l, type RevoApi as m, RevoAuthenticationError as n, RevoBatchConfigurationError as o, RevoBatchLimitError as p, type RevoBatchLimits as q, type RevoBatchOptions as r, RevoConfigurationError as s, RevoError as t, type RevoExecuteOptions as u, type RevoExecutionDefaults as v, RevoPermissionDeniedError as w, RevoProtocolError as x, RevoRemoteError as y, RevoRuntimeContextUnavailableError as z };
package/dist/hosted.cjs CHANGED
@@ -4375,12 +4375,12 @@ module.exports = __toCommonJS(hosted_exports);
4375
4375
 
4376
4376
  // src/generated/public-sdk.contract.ts
4377
4377
  var PUBLIC_SDK_PROTOCOL_VERSION = 1;
4378
- var PUBLIC_SDK_CONTRACT_REVISION = "a88e3ddff38d91762aa4c771955343e986039cebb04e4347fd257bd96f65bf5c";
4378
+ var PUBLIC_SDK_CONTRACT_REVISION = "b2e2a42372000367b1038ad4ea435ece2199434c9a229d525647f80647fee90b";
4379
4379
  var publicSdkContract = {
4380
4380
  "protocolVersion": 1,
4381
- "generatorRevision": 5,
4381
+ "generatorRevision": 6,
4382
4382
  "wireFormatRevision": 2,
4383
- "typeDefinitionsHash": "dfa20a5850eee53a8666c95e9034423fe2906ea68adaf19e8e53100bf62114c1",
4383
+ "typeDefinitionsHash": "f0f31ac175ccd67ac7cd299dd297df486d902be3f77182efa3b9c838309e7d3e",
4384
4384
  "wireSchemas": {
4385
4385
  "definitions": {
4386
4386
  "AgentCreateInput_adfabfb0f10c": {
@@ -5720,6 +5720,39 @@ var publicSdkContract = {
5720
5720
  "kind": "string"
5721
5721
  }
5722
5722
  },
5723
+ "LowCodeExecuteOptions_b90fc023cb6b": {
5724
+ "kind": "object",
5725
+ "properties": {
5726
+ "inputs": {
5727
+ "optional": true,
5728
+ "schema": {
5729
+ "kind": "any"
5730
+ }
5731
+ },
5732
+ "language": {
5733
+ "optional": true,
5734
+ "schema": {
5735
+ "kind": "ref",
5736
+ "ref": "Schema_d58cff33616d"
5737
+ }
5738
+ },
5739
+ "memory": {
5740
+ "optional": true,
5741
+ "schema": {
5742
+ "kind": "ref",
5743
+ "ref": "Schema_dc4b6520055b"
5744
+ }
5745
+ },
5746
+ "timeoutMs": {
5747
+ "optional": true,
5748
+ "schema": {
5749
+ "kind": "ref",
5750
+ "ref": "Schema_dc4b6520055b"
5751
+ }
5752
+ }
5753
+ },
5754
+ "additionalProperties": false
5755
+ },
5723
5756
  "Omit_e0bcf002c3d5": {
5724
5757
  "kind": "object",
5725
5758
  "properties": {
@@ -6229,6 +6262,18 @@ var publicSdkContract = {
6229
6262
  }
6230
6263
  ]
6231
6264
  },
6265
+ "Schema_10228e5c840c": {
6266
+ "kind": "union",
6267
+ "anyOf": [
6268
+ {
6269
+ "kind": "ref",
6270
+ "ref": "LowCodeExecuteOptions_b90fc023cb6b"
6271
+ },
6272
+ {
6273
+ "kind": "undefined"
6274
+ }
6275
+ ]
6276
+ },
6232
6277
  "Schema_108101eef1da": {
6233
6278
  "kind": "object",
6234
6279
  "properties": {
@@ -9004,6 +9049,22 @@ var publicSdkContract = {
9004
9049
  "ref": "Schema_ae3179dbff58"
9005
9050
  }
9006
9051
  },
9052
+ "Schema_d58cff33616d": {
9053
+ "kind": "union",
9054
+ "anyOf": [
9055
+ {
9056
+ "kind": "literal",
9057
+ "value": "javascript"
9058
+ },
9059
+ {
9060
+ "kind": "literal",
9061
+ "value": "typescript"
9062
+ },
9063
+ {
9064
+ "kind": "undefined"
9065
+ }
9066
+ ]
9067
+ },
9007
9068
  "Schema_d5998e1bdd9b": {
9008
9069
  "kind": "union",
9009
9070
  "anyOf": [
@@ -17206,13 +17267,47 @@ var publicSdkContract = {
17206
17267
  ],
17207
17268
  "signatureHash": "c851afec157e2dd9dce9d7b6a9a736b2953ba6412b2697d2db5eb959d0d676c8"
17208
17269
  }
17270
+ ],
17271
+ "lowCode": [
17272
+ {
17273
+ "name": "execute",
17274
+ "mode": "remote",
17275
+ "overloads": [
17276
+ {
17277
+ "minArgs": 1,
17278
+ "maxArgs": 2,
17279
+ "parameters": [
17280
+ {
17281
+ "name": "code",
17282
+ "optional": false,
17283
+ "rest": false,
17284
+ "type": "string",
17285
+ "wireSchema": {
17286
+ "kind": "string"
17287
+ }
17288
+ },
17289
+ {
17290
+ "name": "options",
17291
+ "optional": true,
17292
+ "rest": false,
17293
+ "type": "LowCodeExecuteOptions",
17294
+ "wireSchema": {
17295
+ "kind": "ref",
17296
+ "ref": "Schema_10228e5c840c"
17297
+ }
17298
+ }
17299
+ ]
17300
+ }
17301
+ ],
17302
+ "signatureHash": "5ccc1664071c855d49e7a12bfb3ead64decc64151e44a9351246b28d9eb41862"
17303
+ }
17209
17304
  ]
17210
17305
  },
17211
- "contractRevision": "a88e3ddff38d91762aa4c771955343e986039cebb04e4347fd257bd96f65bf5c"
17306
+ "contractRevision": "b2e2a42372000367b1038ad4ea435ece2199434c9a229d525647f80647fee90b"
17212
17307
  };
17213
17308
 
17214
17309
  // src/contracts.ts
17215
- var SDK_VERSION = "1.0.0";
17310
+ var SDK_VERSION = "1.0.1";
17216
17311
  var PROTOCOL_VERSION = PUBLIC_SDK_PROTOCOL_VERSION;
17217
17312
  var CONTRACT_REVISION = PUBLIC_SDK_CONTRACT_REVISION;
17218
17313
  function namesByMode(surface, mode) {
@@ -17222,11 +17317,13 @@ var API_REMOTE_METHODS = Object.freeze(namesByMode("api", "remote"));
17222
17317
  var API_CONTEXT_METHODS = Object.freeze(namesByMode("api", "context"));
17223
17318
  var STORAGE_REMOTE_METHODS = Object.freeze(namesByMode("storage", "remote"));
17224
17319
  var AGENT_REMOTE_METHODS = Object.freeze(namesByMode("agents", "remote"));
17320
+ var LOW_CODE_REMOTE_METHODS = Object.freeze(namesByMode("lowCode", "remote"));
17225
17321
  var UTILS_LOCAL_METHODS = Object.freeze(namesByMode("utils", "local"));
17226
17322
  var REMOTE_METHODS = Object.freeze({
17227
17323
  api: new Set(API_REMOTE_METHODS),
17228
17324
  storage: new Set(STORAGE_REMOTE_METHODS),
17229
- agents: new Set(AGENT_REMOTE_METHODS)
17325
+ agents: new Set(AGENT_REMOTE_METHODS),
17326
+ lowCode: new Set(LOW_CODE_REMOTE_METHODS)
17230
17327
  });
17231
17328
 
17232
17329
  // src/errors.ts
@@ -19160,6 +19257,21 @@ function standaloneContext(transport) {
19160
19257
  throw new RevoRuntimeContextUnavailableError(method);
19161
19258
  };
19162
19259
  }
19260
+ var DEFAULT_EXECUTION_OPTIONS = Object.freeze({
19261
+ language: "typescript",
19262
+ timeoutMs: 6e4
19263
+ });
19264
+ function executeFunction(batcher, defaults = {}) {
19265
+ const configuredDefaults = Object.freeze({
19266
+ ...DEFAULT_EXECUTION_OPTIONS,
19267
+ ...defaults
19268
+ });
19269
+ return ((code, options = {}) => batcher.enqueue(
19270
+ "lowCode",
19271
+ "execute",
19272
+ [code, { ...configuredDefaults, ...options }]
19273
+ ));
19274
+ }
19163
19275
  function createRuntime(transport, options = {}) {
19164
19276
  const hostedState = options.hosted ? { debug: options.hosted.debug ?? false } : void 0;
19165
19277
  const batcher = new RuntimeBatcher(
@@ -19183,6 +19295,10 @@ function createRuntime(transport, options = {}) {
19183
19295
  AGENT_REMOTE_METHODS,
19184
19296
  batcher
19185
19297
  )),
19298
+ execute: executeFunction(
19299
+ batcher,
19300
+ options.executionDefaults ?? options.hosted?.executionDefaults
19301
+ ),
19186
19302
  batch: batcher.controller()
19187
19303
  };
19188
19304
  return Object.freeze(runtime);