@executioncontrolprotocol/node 0.10.0
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 +36 -0
- package/dist/environment.d.ts +9 -0
- package/dist/environment.d.ts.map +1 -0
- package/dist/environment.js +21 -0
- package/dist/environment.js.map +1 -0
- package/dist/index.d.ts +7 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +7 -0
- package/dist/index.js.map +1 -0
- package/dist/runtime/builtin-node.d.ts +8 -0
- package/dist/runtime/builtin-node.d.ts.map +1 -0
- package/dist/runtime/builtin-node.js +19 -0
- package/dist/runtime/builtin-node.js.map +1 -0
- package/dist/runtime/node-executor.d.ts +8 -0
- package/dist/runtime/node-executor.d.ts.map +1 -0
- package/dist/runtime/node-executor.js +11 -0
- package/dist/runtime/node-executor.js.map +1 -0
- package/package.json +36 -0
package/README.md
ADDED
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
# @executioncontrolprotocol/node
|
|
2
|
+
|
|
3
|
+
**Node.js runtime host** for ECP: Node executor, process-env and secrets extensions, and re-exports of Node-only compile from `@executioncontrolprotocol/core`.
|
|
4
|
+
|
|
5
|
+
## vs `@executioncontrolprotocol/core`
|
|
6
|
+
|
|
7
|
+
| Package | Role |
|
|
8
|
+
| ------- | ---- |
|
|
9
|
+
| `@executioncontrolprotocol/core` | Runtime-agnostic API and in-memory engine |
|
|
10
|
+
| `@executioncontrolprotocol/node` | Node host: `@executioncontrolprotocol/node` runtime, `process.env`, secrets, `compileWorkflowSource` via `@executioncontrolprotocol/core/compile` |
|
|
11
|
+
|
|
12
|
+
Node apps and the CLI compose environments with `@executioncontrolprotocol/node`; they import compile/loaders from `@executioncontrolprotocol/core/compile` or `@executioncontrolprotocol/core/node`, not from the core main barrel.
|
|
13
|
+
|
|
14
|
+
## Typical usage
|
|
15
|
+
|
|
16
|
+
```ts
|
|
17
|
+
import { environment, extension, workflow, step } from "@executioncontrolprotocol/node"
|
|
18
|
+
import "@executioncontrolprotocol/core/testing"
|
|
19
|
+
|
|
20
|
+
const env = (await environment("dev")).withExtensions([
|
|
21
|
+
extension("@executioncontrolprotocol/test").with({}),
|
|
22
|
+
])
|
|
23
|
+
const ecp = await env.init()
|
|
24
|
+
await ecp.run(
|
|
25
|
+
workflow("Echo")
|
|
26
|
+
.run([step("@executioncontrolprotocol/test.echo", "Echo").with({ value: "hi" }).as("out")])
|
|
27
|
+
.toManifest()
|
|
28
|
+
)
|
|
29
|
+
```
|
|
30
|
+
|
|
31
|
+
## Related
|
|
32
|
+
|
|
33
|
+
- [`@executioncontrolprotocol/core`](../core/README.md) — core API and subpaths
|
|
34
|
+
- [`@executioncontrolprotocol/cli`](../cli/) — `ecp run`, `ecp compile`, etc. (uses `@executioncontrolprotocol/core/loaders` + `@executioncontrolprotocol/core/compile`)
|
|
35
|
+
|
|
36
|
+
See [AGENTS.md](../../AGENTS.md) for CLI commands and extension catalog rules.
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import type { Environment } from "@executioncontrolprotocol/core";
|
|
2
|
+
/** Register Node runtime and standard Node extensions. */
|
|
3
|
+
export declare function registerNodeDefaults(): Promise<void>;
|
|
4
|
+
/**
|
|
5
|
+
* Create a Node environment with `@executioncontrolprotocol/node` runtime pre-bound.
|
|
6
|
+
* @category Environment
|
|
7
|
+
*/
|
|
8
|
+
export declare function environment(id: string, label?: string): Promise<Environment>;
|
|
9
|
+
//# sourceMappingURL=environment.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"environment.d.ts","sourceRoot":"","sources":["../src/environment.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,gCAAgC,CAAA;AAMjE,0DAA0D;AAC1D,wBAAsB,oBAAoB,IAAI,OAAO,CAAC,IAAI,CAAC,CAK1D;AAED;;;GAGG;AACH,wBAAsB,WAAW,CAAC,EAAE,EAAE,MAAM,EAAE,KAAK,CAAC,EAAE,MAAM,GAAG,OAAO,CAAC,WAAW,CAAC,CAGlF"}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { environment as coreEnvironment, runtime } from "@executioncontrolprotocol/core";
|
|
2
|
+
import { registerStandardPolicies } from "@executioncontrolprotocol/policies";
|
|
3
|
+
import { NODE_RUNTIME_ID, registerNodeRuntime } from "./runtime/builtin-node.js";
|
|
4
|
+
import { registerProcessEnvExtension } from "@executioncontrolprotocol/process-env";
|
|
5
|
+
import { registerSecretsExtension } from "@executioncontrolprotocol/secrets";
|
|
6
|
+
/** Register Node runtime and standard Node extensions. */
|
|
7
|
+
export async function registerNodeDefaults() {
|
|
8
|
+
await registerNodeRuntime();
|
|
9
|
+
await registerSecretsExtension();
|
|
10
|
+
await registerProcessEnvExtension();
|
|
11
|
+
await registerStandardPolicies();
|
|
12
|
+
}
|
|
13
|
+
/**
|
|
14
|
+
* Create a Node environment with `@executioncontrolprotocol/node` runtime pre-bound.
|
|
15
|
+
* @category Environment
|
|
16
|
+
*/
|
|
17
|
+
export async function environment(id, label) {
|
|
18
|
+
await registerNodeDefaults();
|
|
19
|
+
return coreEnvironment(id, label).withRuntime(runtime(NODE_RUNTIME_ID, "Node Runtime"));
|
|
20
|
+
}
|
|
21
|
+
//# sourceMappingURL=environment.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"environment.js","sourceRoot":"","sources":["../src/environment.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,IAAI,eAAe,EAAE,OAAO,EAAE,MAAM,gCAAgC,CAAA;AAExF,OAAO,EAAE,wBAAwB,EAAE,MAAM,oCAAoC,CAAA;AAC7E,OAAO,EAAE,eAAe,EAAE,mBAAmB,EAAE,MAAM,2BAA2B,CAAA;AAChF,OAAO,EAAE,2BAA2B,EAAE,MAAM,uCAAuC,CAAA;AACnF,OAAO,EAAE,wBAAwB,EAAE,MAAM,mCAAmC,CAAA;AAE5E,0DAA0D;AAC1D,MAAM,CAAC,KAAK,UAAU,oBAAoB;IACxC,MAAM,mBAAmB,EAAE,CAAA;IAC3B,MAAM,wBAAwB,EAAE,CAAA;IAChC,MAAM,2BAA2B,EAAE,CAAA;IACnC,MAAM,wBAAwB,EAAE,CAAA;AAClC,CAAC;AAED;;;GAGG;AACH,MAAM,CAAC,KAAK,UAAU,WAAW,CAAC,EAAU,EAAE,KAAc;IAC1D,MAAM,oBAAoB,EAAE,CAAA;IAC5B,OAAO,eAAe,CAAC,EAAE,EAAE,KAAK,CAAC,CAAC,WAAW,CAAC,OAAO,CAAC,eAAe,EAAE,cAAc,CAAC,CAAC,CAAA;AACzF,CAAC"}
|
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
export { NODE_RUNTIME_ID, nodeRuntimeDefinition, NodeRuntimeExecutor, registerNodeRuntime, } from "./runtime/builtin-node.js";
|
|
2
|
+
export { processEnvExtension, registerProcessEnvExtension, } from "@executioncontrolprotocol/process-env";
|
|
3
|
+
export { secretsExtension, registerSecretsExtension, setMemorySecret, setSecretsProvider, setSecretsStore, resetSecretsStore, memorySecretsProvider, memorySecretsStore, createOsSecretsStore, redactSecret, type SecretsStore, } from "@executioncontrolprotocol/secrets";
|
|
4
|
+
export { registerNodeDefaults, environment } from "./environment.js";
|
|
5
|
+
export { workflow, step, ref, state, env, secrets, expr, parallel, branch, loop, extension, runtime, policy, defineExtension, defineRuntime, definePolicy, capability, capabilityFor, hook, Environment, Registry, globalRegistry, registerTestExtension, validateWorkflow, } from "@executioncontrolprotocol/core";
|
|
6
|
+
export { compileWorkflowSource, compileAndValidateWorkflowSource } from "@executioncontrolprotocol/core/compile";
|
|
7
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,eAAe,EACf,qBAAqB,EACrB,mBAAmB,EACnB,mBAAmB,GACpB,MAAM,2BAA2B,CAAA;AAElC,OAAO,EACL,mBAAmB,EACnB,2BAA2B,GAC5B,MAAM,uCAAuC,CAAA;AAE9C,OAAO,EACL,gBAAgB,EAChB,wBAAwB,EACxB,eAAe,EACf,kBAAkB,EAClB,eAAe,EACf,iBAAiB,EACjB,qBAAqB,EACrB,kBAAkB,EAClB,oBAAoB,EACpB,YAAY,EACZ,KAAK,YAAY,GAClB,MAAM,mCAAmC,CAAA;AAE1C,OAAO,EAAE,oBAAoB,EAAE,WAAW,EAAE,MAAM,kBAAkB,CAAA;AAEpE,OAAO,EACL,QAAQ,EACR,IAAI,EACJ,GAAG,EACH,KAAK,EACL,GAAG,EACH,OAAO,EACP,IAAI,EACJ,QAAQ,EACR,MAAM,EACN,IAAI,EACJ,SAAS,EACT,OAAO,EACP,MAAM,EACN,eAAe,EACf,aAAa,EACb,YAAY,EACZ,UAAU,EACV,aAAa,EACb,IAAI,EACJ,WAAW,EACX,QAAQ,EACR,cAAc,EACd,qBAAqB,EACrB,gBAAgB,GACjB,MAAM,gCAAgC,CAAA;AACvC,OAAO,EAAE,qBAAqB,EAAE,gCAAgC,EAAE,MAAM,wCAAwC,CAAA"}
|
package/dist/index.js
ADDED
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
export { NODE_RUNTIME_ID, nodeRuntimeDefinition, NodeRuntimeExecutor, registerNodeRuntime, } from "./runtime/builtin-node.js";
|
|
2
|
+
export { processEnvExtension, registerProcessEnvExtension, } from "@executioncontrolprotocol/process-env";
|
|
3
|
+
export { secretsExtension, registerSecretsExtension, setMemorySecret, setSecretsProvider, setSecretsStore, resetSecretsStore, memorySecretsProvider, memorySecretsStore, createOsSecretsStore, redactSecret, } from "@executioncontrolprotocol/secrets";
|
|
4
|
+
export { registerNodeDefaults, environment } from "./environment.js";
|
|
5
|
+
export { workflow, step, ref, state, env, secrets, expr, parallel, branch, loop, extension, runtime, policy, defineExtension, defineRuntime, definePolicy, capability, capabilityFor, hook, Environment, Registry, globalRegistry, registerTestExtension, validateWorkflow, } from "@executioncontrolprotocol/core";
|
|
6
|
+
export { compileWorkflowSource, compileAndValidateWorkflowSource } from "@executioncontrolprotocol/core/compile";
|
|
7
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,eAAe,EACf,qBAAqB,EACrB,mBAAmB,EACnB,mBAAmB,GACpB,MAAM,2BAA2B,CAAA;AAElC,OAAO,EACL,mBAAmB,EACnB,2BAA2B,GAC5B,MAAM,uCAAuC,CAAA;AAE9C,OAAO,EACL,gBAAgB,EAChB,wBAAwB,EACxB,eAAe,EACf,kBAAkB,EAClB,eAAe,EACf,iBAAiB,EACjB,qBAAqB,EACrB,kBAAkB,EAClB,oBAAoB,EACpB,YAAY,GAEb,MAAM,mCAAmC,CAAA;AAE1C,OAAO,EAAE,oBAAoB,EAAE,WAAW,EAAE,MAAM,kBAAkB,CAAA;AAEpE,OAAO,EACL,QAAQ,EACR,IAAI,EACJ,GAAG,EACH,KAAK,EACL,GAAG,EACH,OAAO,EACP,IAAI,EACJ,QAAQ,EACR,MAAM,EACN,IAAI,EACJ,SAAS,EACT,OAAO,EACP,MAAM,EACN,eAAe,EACf,aAAa,EACb,YAAY,EACZ,UAAU,EACV,aAAa,EACb,IAAI,EACJ,WAAW,EACX,QAAQ,EACR,cAAc,EACd,qBAAqB,EACrB,gBAAgB,GACjB,MAAM,gCAAgC,CAAA;AACvC,OAAO,EAAE,qBAAqB,EAAE,gCAAgC,EAAE,MAAM,wCAAwC,CAAA"}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
export { NodeRuntimeExecutor } from "./node-executor.js";
|
|
2
|
+
/** Node runtime id. @category Runtime */
|
|
3
|
+
export declare const NODE_RUNTIME_ID: "@executioncontrolprotocol/node";
|
|
4
|
+
/** Built-in Node runtime definition. @category Runtime */
|
|
5
|
+
export declare const nodeRuntimeDefinition: import("@executioncontrolprotocol/core").RuntimeDefinition;
|
|
6
|
+
/** Register `@executioncontrolprotocol/node` on the global registry. */
|
|
7
|
+
export declare function registerNodeRuntime(registry?: import("@executioncontrolprotocol/core").Registry): Promise<void>;
|
|
8
|
+
//# sourceMappingURL=builtin-node.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"builtin-node.d.ts","sourceRoot":"","sources":["../../src/runtime/builtin-node.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,mBAAmB,EAAE,MAAM,oBAAoB,CAAA;AAExD,yCAAyC;AACzC,eAAO,MAAM,eAAe,EAAG,gCAAyC,CAAA;AAExE,0DAA0D;AAC1D,eAAO,MAAM,qBAAqB,4DAIQ,CAAA;AAE1C,wEAAwE;AACxE,wBAAsB,mBAAmB,CAAC,QAAQ,oDAAiB,GAAG,OAAO,CAAC,IAAI,CAAC,CAIlF"}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { defineRuntime, globalRegistry } from "@executioncontrolprotocol/core";
|
|
2
|
+
import { z } from "zod";
|
|
3
|
+
import { NodeRuntimeExecutor } from "./node-executor.js";
|
|
4
|
+
export { NodeRuntimeExecutor } from "./node-executor.js";
|
|
5
|
+
/** Node runtime id. @category Runtime */
|
|
6
|
+
export const NODE_RUNTIME_ID = "@executioncontrolprotocol/node";
|
|
7
|
+
/** Built-in Node runtime definition. @category Runtime */
|
|
8
|
+
export const nodeRuntimeDefinition = defineRuntime("@executioncontrolprotocol", "node")
|
|
9
|
+
.withConfig({
|
|
10
|
+
maxConcurrency: z.number().optional(),
|
|
11
|
+
})
|
|
12
|
+
.withExecutor(new NodeRuntimeExecutor());
|
|
13
|
+
/** Register `@executioncontrolprotocol/node` on the global registry. */
|
|
14
|
+
export async function registerNodeRuntime(registry = globalRegistry) {
|
|
15
|
+
if (!registry.getRuntime(NODE_RUNTIME_ID)) {
|
|
16
|
+
await registry.registerRuntime(nodeRuntimeDefinition);
|
|
17
|
+
}
|
|
18
|
+
}
|
|
19
|
+
//# sourceMappingURL=builtin-node.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"builtin-node.js","sourceRoot":"","sources":["../../src/runtime/builtin-node.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,cAAc,EAAE,MAAM,gCAAgC,CAAA;AAC9E,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAA;AACvB,OAAO,EAAE,mBAAmB,EAAE,MAAM,oBAAoB,CAAA;AAExD,OAAO,EAAE,mBAAmB,EAAE,MAAM,oBAAoB,CAAA;AAExD,yCAAyC;AACzC,MAAM,CAAC,MAAM,eAAe,GAAG,gCAAyC,CAAA;AAExE,0DAA0D;AAC1D,MAAM,CAAC,MAAM,qBAAqB,GAAG,aAAa,CAAC,2BAA2B,EAAE,MAAM,CAAC;KACpF,UAAU,CAAC;IACV,cAAc,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE;CACtC,CAAC;KACD,YAAY,CAAC,IAAI,mBAAmB,EAAE,CAAC,CAAA;AAE1C,wEAAwE;AACxE,MAAM,CAAC,KAAK,UAAU,mBAAmB,CAAC,QAAQ,GAAG,cAAc;IACjE,IAAI,CAAC,QAAQ,CAAC,UAAU,CAAC,eAAe,CAAC,EAAE,CAAC;QAC1C,MAAM,QAAQ,CAAC,eAAe,CAAC,qBAAqB,CAAC,CAAA;IACvD,CAAC;AACH,CAAC"}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import type { RunResult, WorkflowManifest } from "@executioncontrolprotocol/types";
|
|
2
|
+
import type { RuntimeExecutionContext, RuntimeExecutor } from "@executioncontrolprotocol/core";
|
|
3
|
+
/** Node.js runtime executor (delegates to in-memory engine). @category Runtime */
|
|
4
|
+
export declare class NodeRuntimeExecutor implements RuntimeExecutor {
|
|
5
|
+
private readonly inner;
|
|
6
|
+
execute(manifest: WorkflowManifest, context: RuntimeExecutionContext): Promise<RunResult>;
|
|
7
|
+
}
|
|
8
|
+
//# sourceMappingURL=node-executor.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"node-executor.d.ts","sourceRoot":"","sources":["../../src/runtime/node-executor.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,SAAS,EAAE,gBAAgB,EAAE,MAAM,iCAAiC,CAAA;AAClF,OAAO,KAAK,EAAE,uBAAuB,EAAE,eAAe,EAAE,MAAM,gCAAgC,CAAA;AAE9F,kFAAkF;AAClF,qBAAa,mBAAoB,YAAW,eAAe;IACzD,OAAO,CAAC,QAAQ,CAAC,KAAK,CAAgC;IAEtD,OAAO,CACL,QAAQ,EAAE,gBAAgB,EAC1B,OAAO,EAAE,uBAAuB,GAC/B,OAAO,CAAC,SAAS,CAAC;CAMtB"}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { InMemoryRuntimeExecutor } from "@executioncontrolprotocol/core";
|
|
2
|
+
/** Node.js runtime executor (delegates to in-memory engine). @category Runtime */
|
|
3
|
+
export class NodeRuntimeExecutor {
|
|
4
|
+
inner = new InMemoryRuntimeExecutor();
|
|
5
|
+
execute(manifest, context) {
|
|
6
|
+
const maxConcurrency = context.maxConcurrency ??
|
|
7
|
+
context.bindings.runtime.config.maxConcurrency;
|
|
8
|
+
return this.inner.execute(manifest, { ...context, maxConcurrency });
|
|
9
|
+
}
|
|
10
|
+
}
|
|
11
|
+
//# sourceMappingURL=node-executor.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"node-executor.js","sourceRoot":"","sources":["../../src/runtime/node-executor.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,uBAAuB,EAAE,MAAM,gCAAgC,CAAA;AAIxE,kFAAkF;AAClF,MAAM,OAAO,mBAAmB;IACb,KAAK,GAAG,IAAI,uBAAuB,EAAE,CAAA;IAEtD,OAAO,CACL,QAA0B,EAC1B,OAAgC;QAEhC,MAAM,cAAc,GAClB,OAAO,CAAC,cAAc;YACrB,OAAO,CAAC,QAAQ,CAAC,OAAO,CAAC,MAAM,CAAC,cAAqC,CAAA;QACxE,OAAO,IAAI,CAAC,KAAK,CAAC,OAAO,CAAC,QAAQ,EAAE,EAAE,GAAG,OAAO,EAAE,cAAc,EAAE,CAAC,CAAA;IACrE,CAAC;CACF"}
|
package/package.json
ADDED
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@executioncontrolprotocol/node",
|
|
3
|
+
"version": "0.10.0",
|
|
4
|
+
"description": "ECP Node.js runtime and environment extensions",
|
|
5
|
+
"license": "Apache-2.0",
|
|
6
|
+
"type": "module",
|
|
7
|
+
"main": "./dist/index.js",
|
|
8
|
+
"types": "./dist/index.d.ts",
|
|
9
|
+
"exports": {
|
|
10
|
+
".": {
|
|
11
|
+
"types": "./dist/index.d.ts",
|
|
12
|
+
"import": "./dist/index.js"
|
|
13
|
+
}
|
|
14
|
+
},
|
|
15
|
+
"files": [
|
|
16
|
+
"dist",
|
|
17
|
+
"README.md"
|
|
18
|
+
],
|
|
19
|
+
"scripts": {
|
|
20
|
+
"build": "tsc -b"
|
|
21
|
+
},
|
|
22
|
+
"peerDependencies": {
|
|
23
|
+
"zod": "^3.24.0"
|
|
24
|
+
},
|
|
25
|
+
"dependencies": {
|
|
26
|
+
"@executioncontrolprotocol/core": "0.10.0",
|
|
27
|
+
"@executioncontrolprotocol/types": "0.10.0",
|
|
28
|
+
"@executioncontrolprotocol/policies": "0.10.0",
|
|
29
|
+
"@executioncontrolprotocol/secrets": "0.10.0",
|
|
30
|
+
"@executioncontrolprotocol/process-env": "0.10.0"
|
|
31
|
+
},
|
|
32
|
+
"devDependencies": {
|
|
33
|
+
"typescript": "^5.7.0",
|
|
34
|
+
"zod": "^3.24.0"
|
|
35
|
+
}
|
|
36
|
+
}
|