@elaraai/create-e3 1.0.76 → 1.0.77

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@elaraai/create-e3",
3
- "version": "1.0.76",
3
+ "version": "1.0.77",
4
4
  "description": "Scaffold a new e3 project (BSL-1.1, Node + Python, durable execution): npm create @elaraai/e3",
5
5
  "type": "module",
6
6
  "bin": {
@@ -1,5 +1,5 @@
1
1
  import e3 from "@elaraai/e3";
2
- import { East, ArrayType, FloatType } from "@elaraai/east";
2
+ import { East, ArrayType, FloatType, variant } from "@elaraai/east";
3
3
 
4
4
  // A C tool captured via `environment: { tools }`. Unlike python/node packages,
5
5
  // e3 does NOT auto-derive a tools environment — you attach the prebuilt binary
@@ -9,7 +9,7 @@ import { East, ArrayType, FloatType } from "@elaraai/east";
9
9
  // This example passes a value through the tool unchanged (the scaffold binary is
10
10
  // a passthrough). Replace src/__PACKAGE_NAME__.c with real native logic — embed
11
11
  // east-c to decode / compute / encode the BEAST2 dataset files.
12
- const __PACKAGE_IDENT___values = e3.input("__PACKAGE_IDENT___values", ArrayType(FloatType), [1.0, 2.0, 3.0]);
12
+ const __PACKAGE_IDENT___values = e3.input("__PACKAGE_IDENT___values", ArrayType(FloatType), variant("value", [1.0, 2.0, 3.0]));
13
13
 
14
14
  export const __PACKAGE_IDENT___task = e3.customTask(
15
15
  "__PACKAGE_IDENT___tool",
@@ -1,5 +1,5 @@
1
1
  import e3 from "@elaraai/e3";
2
- import { East, ArrayType, IntegerType, FloatType, FunctionType } from "@elaraai/east";
2
+ import { East, ArrayType, IntegerType, FloatType, FunctionType, variant } from "@elaraai/east";
3
3
 
4
4
  // Two ways of crossing the package boundary into packages/node/__PACKAGE_NAME__
5
5
  // (@__PROJECT_NAME__/__PACKAGE_NAME__):
@@ -23,9 +23,9 @@ const scale = East.importFunction(
23
23
  FunctionType([ArrayType(FloatType), FloatType], ArrayType(FloatType)),
24
24
  );
25
25
 
26
- const value = e3.input("__PACKAGE_IDENT___value", IntegerType, 21n);
27
- const factor = e3.input("__PACKAGE_IDENT___factor", FloatType, 2.0);
28
- const series = e3.input("__PACKAGE_IDENT___series", ArrayType(FloatType), [1.0, 2.0, 3.0]);
26
+ const value = e3.input("__PACKAGE_IDENT___value", IntegerType, variant("value", 21n));
27
+ const factor = e3.input("__PACKAGE_IDENT___factor", FloatType, variant("value", 2.0));
28
+ const series = e3.input("__PACKAGE_IDENT___series", ArrayType(FloatType), variant("value", [1.0, 2.0, 3.0]));
29
29
 
30
30
  // No `environment` — e3 derives it from the `{ custom: "@__PROJECT_NAME__/__PACKAGE_NAME__" }`
31
31
  // platform reference below, capturing packages/node/__PACKAGE_NAME__'s npm
@@ -1,5 +1,5 @@
1
1
  import e3 from "@elaraai/e3";
2
- import { East, ArrayType, FloatType, FunctionType } from "@elaraai/east";
2
+ import { East, ArrayType, FloatType, FunctionType, variant } from "@elaraai/east";
3
3
 
4
4
  // Two ways of crossing the language boundary into packages/python/__PACKAGE_NAME__:
5
5
  //
@@ -21,8 +21,8 @@ const scale = East.importFunction(
21
21
  FunctionType([ArrayType(FloatType), FloatType], ArrayType(FloatType)),
22
22
  );
23
23
 
24
- const values = e3.input("__PACKAGE_IDENT___values", ArrayType(FloatType), [1.0, 2.0, 3.0]);
25
- const factor = e3.input("__PACKAGE_IDENT___factor", FloatType, 2.0);
24
+ const values = e3.input("__PACKAGE_IDENT___values", ArrayType(FloatType), variant("value", [1.0, 2.0, 3.0]));
25
+ const factor = e3.input("__PACKAGE_IDENT___factor", FloatType, variant("value", 2.0));
26
26
 
27
27
  // No `environment` needed: e3 derives it from the `{ custom: "__PACKAGE_NAME__" }`
28
28
  // platform reference below — at export it captures packages/python/__PACKAGE_NAME__'s
@@ -1,13 +1,13 @@
1
1
  import e3 from "@elaraai/e3";
2
- import { East, ArrayType, FloatType, IntegerType } from "@elaraai/east";
2
+ import { East, ArrayType, FloatType, IntegerType, variant } from "@elaraai/east";
3
3
 
4
4
  import { examplePython } from "./platform_module.js";
5
5
  import { exampleNode } from "./platform/index.js";
6
6
 
7
7
  // In East a decision is a typed task over inputs. This one recommends how many
8
8
  // units to reorder to bring stock up to its target level — never negative.
9
- export const onHandInput = e3.input("on_hand", IntegerType, 12n);
10
- export const targetInput = e3.input("reorder_to", IntegerType, 50n);
9
+ export const onHandInput = e3.input("on_hand", IntegerType, variant("value", 12n));
10
+ export const targetInput = e3.input("reorder_to", IntegerType, variant("value", 50n));
11
11
 
12
12
  export const reorderFn = East.function(
13
13
  [IntegerType, IntegerType],
@@ -24,7 +24,7 @@ export const reorderQty = e3.task("reorder_qty", [onHandInput, targetInput], reo
24
24
  // `{ custom: "platform_module" }` loads the project's own package, resolved from
25
25
  // <project>/.venv after `uv sync`. Replace `example_python`
26
26
  // (platform_module/example.py) with your own.
27
- export const exampleValuesInput = e3.input("example_values", ArrayType(FloatType), [1.0, 2.0, 3.0, 4.0, 5.0]);
27
+ export const exampleValuesInput = e3.input("example_values", ArrayType(FloatType), variant("value", [1.0, 2.0, 3.0, 4.0, 5.0]));
28
28
 
29
29
  export const examplePythonFn = East.function(
30
30
  [ArrayType(FloatType)],
@@ -41,7 +41,7 @@ export const examplePythonTask = e3.task("example_python", [exampleValuesInput],
41
41
  // An example project-owned TS-East platform function on the east-node runtime.
42
42
  // `{ custom: "@elaraai/__PROJECT_NAME__" }` loads this package's own `./platform`
43
43
  // export. Replace `exampleNode` (src/platform/example.ts) with your own.
44
- export const exampleFactorInput = e3.input("example_factor", FloatType, 1.5);
44
+ export const exampleFactorInput = e3.input("example_factor", FloatType, variant("value", 1.5));
45
45
 
46
46
  export const exampleNodeFn = East.function(
47
47
  [IntegerType, FloatType],
@@ -1,12 +1,12 @@
1
1
  import e3 from "@elaraai/e3";
2
- import { East, FloatType, IntegerType } from "@elaraai/east";
2
+ import { East, FloatType, IntegerType, variant } from "@elaraai/east";
3
3
 
4
4
  import { exampleNode } from "./platform/index.js";
5
5
 
6
6
  // In East a decision is a typed task over inputs. This one recommends how many
7
7
  // units to reorder to bring stock up to its target level — never negative.
8
- export const onHandInput = e3.input("on_hand", IntegerType, 12n);
9
- export const targetInput = e3.input("reorder_to", IntegerType, 50n);
8
+ export const onHandInput = e3.input("on_hand", IntegerType, variant("value", 12n));
9
+ export const targetInput = e3.input("reorder_to", IntegerType, variant("value", 50n));
10
10
 
11
11
  export const reorderFn = East.function(
12
12
  [IntegerType, IntegerType],
@@ -22,7 +22,7 @@ export const reorderQty = e3.task("reorder_qty", [onHandInput, targetInput], reo
22
22
  // An example project-owned TS-East platform function on the east-node runtime.
23
23
  // `{ custom: "@elaraai/__PROJECT_NAME__" }` loads this package's own `./platform`
24
24
  // export. Replace `exampleNode` (src/platform/example.ts) with your own.
25
- export const exampleFactorInput = e3.input("example_factor", FloatType, 1.5);
25
+ export const exampleFactorInput = e3.input("example_factor", FloatType, variant("value", 1.5));
26
26
 
27
27
  export const exampleNodeFn = East.function(
28
28
  [IntegerType, FloatType],
@@ -1,10 +1,10 @@
1
1
  import e3 from "@elaraai/e3";
2
- import { East, IntegerType } from "@elaraai/east";
2
+ import { East, IntegerType, variant } from "@elaraai/east";
3
3
 
4
4
  // In East a decision is a typed task over inputs. This one recommends how many
5
5
  // units to reorder to bring stock up to its target level — never negative.
6
- export const onHandInput = e3.input("on_hand", IntegerType, 12n);
7
- export const targetInput = e3.input("reorder_to", IntegerType, 50n);
6
+ export const onHandInput = e3.input("on_hand", IntegerType, variant("value", 12n));
7
+ export const targetInput = e3.input("reorder_to", IntegerType, variant("value", 50n));
8
8
 
9
9
  export const reorderFn = East.function(
10
10
  [IntegerType, IntegerType],
@@ -1,5 +1,5 @@
1
1
  import e3 from "@elaraai/e3";
2
- import { East, ArrayType, FloatType, IntegerType } from "@elaraai/east";
2
+ import { East, ArrayType, FloatType, IntegerType, variant } from "@elaraai/east";
3
3
 
4
4
  import { surface } from "./ui/index.js";
5
5
  import { examplePython } from "./platform_module.js";
@@ -7,8 +7,8 @@ import { exampleNode } from "./platform/index.js";
7
7
 
8
8
  // In East a decision is a typed task over inputs. This one recommends how many
9
9
  // units to reorder to bring stock up to its target level — never negative.
10
- export const onHandInput = e3.input("on_hand", IntegerType, 12n);
11
- export const targetInput = e3.input("reorder_to", IntegerType, 50n);
10
+ export const onHandInput = e3.input("on_hand", IntegerType, variant("value", 12n));
11
+ export const targetInput = e3.input("reorder_to", IntegerType, variant("value", 50n));
12
12
 
13
13
  export const reorderFn = East.function(
14
14
  [IntegerType, IntegerType],
@@ -25,7 +25,7 @@ export const reorderQty = e3.task("reorder_qty", [onHandInput, targetInput], reo
25
25
  // `{ custom: "platform_module" }` loads the project's own package, resolved from
26
26
  // <project>/.venv after `uv sync`. Replace `example_python`
27
27
  // (platform_module/example.py) with your own.
28
- export const exampleValuesInput = e3.input("example_values", ArrayType(FloatType), [1.0, 2.0, 3.0, 4.0, 5.0]);
28
+ export const exampleValuesInput = e3.input("example_values", ArrayType(FloatType), variant("value", [1.0, 2.0, 3.0, 4.0, 5.0]));
29
29
 
30
30
  export const examplePythonFn = East.function(
31
31
  [ArrayType(FloatType)],
@@ -42,7 +42,7 @@ export const examplePythonTask = e3.task("example_python", [exampleValuesInput],
42
42
  // An example project-owned TS-East platform function on the east-node runtime.
43
43
  // `{ custom: "@elaraai/__PROJECT_NAME__" }` loads this package's own `./platform`
44
44
  // export. Replace `exampleNode` (src/platform/example.ts) with your own.
45
- export const exampleFactorInput = e3.input("example_factor", FloatType, 1.5);
45
+ export const exampleFactorInput = e3.input("example_factor", FloatType, variant("value", 1.5));
46
46
 
47
47
  export const exampleNodeFn = East.function(
48
48
  [IntegerType, FloatType],
@@ -1,13 +1,13 @@
1
1
  import e3 from "@elaraai/e3";
2
- import { East, FloatType, IntegerType } from "@elaraai/east";
2
+ import { East, FloatType, IntegerType, variant } from "@elaraai/east";
3
3
 
4
4
  import { surface } from "./ui/index.js";
5
5
  import { exampleNode } from "./platform/index.js";
6
6
 
7
7
  // In East a decision is a typed task over inputs. This one recommends how many
8
8
  // units to reorder to bring stock up to its target level — never negative.
9
- export const onHandInput = e3.input("on_hand", IntegerType, 12n);
10
- export const targetInput = e3.input("reorder_to", IntegerType, 50n);
9
+ export const onHandInput = e3.input("on_hand", IntegerType, variant("value", 12n));
10
+ export const targetInput = e3.input("reorder_to", IntegerType, variant("value", 50n));
11
11
 
12
12
  export const reorderFn = East.function(
13
13
  [IntegerType, IntegerType],
@@ -23,7 +23,7 @@ export const reorderQty = e3.task("reorder_qty", [onHandInput, targetInput], reo
23
23
  // An example project-owned TS-East platform function on the east-node runtime.
24
24
  // `{ custom: "@elaraai/__PROJECT_NAME__" }` loads this package's own `./platform`
25
25
  // export. Replace `exampleNode` (src/platform/example.ts) with your own.
26
- export const exampleFactorInput = e3.input("example_factor", FloatType, 1.5);
26
+ export const exampleFactorInput = e3.input("example_factor", FloatType, variant("value", 1.5));
27
27
 
28
28
  export const exampleNodeFn = East.function(
29
29
  [IntegerType, FloatType],
@@ -1,12 +1,12 @@
1
1
  import e3 from "@elaraai/e3";
2
- import { East, IntegerType } from "@elaraai/east";
2
+ import { East, IntegerType, variant } from "@elaraai/east";
3
3
 
4
4
  import { surface } from "./ui/index.js";
5
5
 
6
6
  // In East a decision is a typed task over inputs. This one recommends how many
7
7
  // units to reorder to bring stock up to its target level — never negative.
8
- export const onHandInput = e3.input("on_hand", IntegerType, 12n);
9
- export const targetInput = e3.input("reorder_to", IntegerType, 50n);
8
+ export const onHandInput = e3.input("on_hand", IntegerType, variant("value", 12n));
9
+ export const targetInput = e3.input("reorder_to", IntegerType, variant("value", 50n));
10
10
 
11
11
  export const reorderFn = East.function(
12
12
  [IntegerType, IntegerType],