@elaraai/e3-types 1.0.5 → 1.0.7

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/src/index.js CHANGED
@@ -30,8 +30,12 @@ export { TaskObjectType, } from './task.js';
30
30
  export { StructureType, PathSegmentType, TreePathType, treePath, pathToString, parsePath, parseDatasetPath, parsePackageRef, urlPathToTreePath,
31
31
  // Backwards compatibility
32
32
  DatasetSchemaType, } from './structure.js';
33
+ // Runner wire types (functions)
34
+ export { RunnerType, runnerToArgv, } from './runner.js';
35
+ // Function objects
36
+ export { FunctionObjectType, } from './function.js';
33
37
  // Package objects
34
- export { PackageDataType, PackageObjectType,
38
+ export { PackageDataType, PackageObjectType, decodePackageObject,
35
39
  // Backwards compatibility
36
40
  PackageDatasetsType,
37
41
  // Package transfer types
@@ -69,7 +73,9 @@ ExecutionHistoryStatusType, ExecutionListItemType,
69
73
  // Dataset List
70
74
  TreeKindType, ListEntryType,
71
75
  // Dataset Status Detail
72
- DatasetStatusDetailType, } from './api.js';
76
+ DatasetStatusDetailType,
77
+ // Function / one-shot execution
78
+ ExecuteLimitsType, DiagnosticType, ExecuteResultType, FunctionCallRequestType, FunctionSignatureType, OneShotRequestType, } from './api.js';
73
79
  // Dataflow execution state
74
80
  export { TaskStateType, DataflowGraphTaskType, DataflowGraphType, ExecutionEventType, DataflowExecutionStateType,
75
81
  // Dataflow run history
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH;;;;;;;;;;;;;;;;;GAiBG;AAEH,4BAA4B;AAC5B,OAAO,EACL,WAAW,EAEX,aAAa,EACb,OAAO,EACP,YAAY,GACb,MAAM,cAAc,CAAC;AAEtB,2DAA2D;AAC3D,OAAO,EACL,iBAAiB,EAEjB,cAAc,GAEf,MAAM,kBAAkB,CAAC;AAE1B,mBAAmB;AACnB,OAAO,EACL,cAAc,GAEf,MAA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AS,EACT,YAAY;AACZ,aAAa;AACb,oBAAoB,EACpB,aAAa,EACb,YAAY,EACZ,wBAAwB,EACxB,iBAAiB,EACjB,kBAAkB;AAClB,WAAW;AACX,mBAAmB,EACnB,eAAe,EACf,kBAAkB;AAClB,aAAa;AACb,0BAA0B,EAC1B,iBAAiB,EACjB,0BAA0B,EAC1B,0BAA0B;AAC1B,mBAAmB;AACnB,iBAAiB,EACjB,sBAAsB,EACtB,qBAAqB,EACrB,wBAAwB,EACxB,oBAAoB,EACpB,mBAAmB,EACnB,0BAA0B,EAC1B,cAAc,EACd,qBAAqB,EACrB,kBAAkB,EAClB,0BAA0B,EAC1B,yBAAyB;AACzB,QAAQ;AACR,gBAAgB,EAChB,eAAe;AACf,YAAY;AACZ,mBAAmB,EACnB,YAAY,EACZ,uBAAuB,EACvB,kBAAkB;AAClB,uBAAuB;AACvB,iBAAiB,EACjB,sBAAsB,EACtB,4BAA4B,EAC5B,6BAA6B;AAC7B,yBAAyB;AACzB,0BAA0B,EAC1B,qBAAqB;AACrB,eAAe;AACf,YAAY,EACZ,aAAa;AACb,wBAAwB;AACxB,uBAAuB;AACvB,gCAAgC;AAChC,iBAAiB,EACjB,cAAc,EACd,iBAAiB,EACjB,uBAAuB,EACvB,qBAAqB,EACrB,kBAAkB,GA0CnB,MAAM,UAAU,CAAC;AAElB,2BAA2B;AAC3B,OAAO,EAGL,aAAa,EAEb,qBAAqB,EAErB,iBAAiB,EAEjB,kBAAkB,EAElB,0BAA0B;AAE1B,uBAAuB;AACvB,qBAAqB,EAErB,uBAAuB,EAEvB,sBAAsB,EAEtB,eAAe,GAEhB,MAAM,eAAe,CAAC"}
@@ -246,9 +246,23 @@ export declare const PackageObjectType: StructType<{
246
246
  }>;
247
247
  }>>;
248
248
  }>;
249
+ /** Functions defined in this package: name -> FunctionObject hash.
250
+ * BEAST2 encodes struct fields positionally in declaration order, so this
251
+ * field MUST stay last — never insert between `tasks` and `data`. */
252
+ readonly functions: DictType<StringType, StringType>;
249
253
  }>;
250
254
  export type PackageObjectType = typeof PackageObjectType;
251
255
  export type PackageObject = ValueTypeOf<typeof PackageObjectType>;
256
+ /**
257
+ * Decode a `PackageObject` from BEAST2 bytes, tolerating the pre-`functions`
258
+ * wire format (dual-decode migration).
259
+ *
260
+ * Every package-read path — local AND cloud — must use this instead of
261
+ * `decodeBeast2For(PackageObjectType)` directly, so packages exported before
262
+ * the `functions` field existed keep decoding. Old bytes decode with
263
+ * `functions` defaulted to an empty map.
264
+ */
265
+ export declare function decodePackageObject(data: Uint8Array): PackageObject;
252
266
  export declare const PackageTransferInitRequestType: StructType<{
253
267
  readonly size: IntegerType;
254
268
  }>;
@@ -1 +1 @@
1
- {"version":3,"file":"package.d.ts","sourceRoot":"","sources":["../../src/package.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH;;;;;;;;;;GAUG;AAEH,OAAO,EAAE,UAAU,EAAE,UAAU,EAAE,WAAW,EAAE,WAAW,EAAE,QAAQ,EAAE,QAAQ,EAAE,WAAW,EAAE,MAAM,eAAe,CAAC;AAIlH;;;;;;;;;GASG;AACH,eAAO,MAAM,eAAe;IAC1B,gEAAgE;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;IAEhE,uEAAuE;;;;;;;;;;;EAEvE,CAAC;AACH,MAAM,MAAM,eAAe,GAAG,OAAO,eAAe,CAAC;AAErD,MAAM,MAAM,WAAW,GAAG,WAAW,CAAC,OAAO,eAAe,CAAC,CAAC;AAG9D,8CAA8C;AAC9C,eAAO,MAAM,mBAAmB;IAX9B,gEAAgE;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;IAEhE,uEAAuE;;;;;;;;;;;EASvB,CAAC;AACnD,0CAA0C;AAC1C,MAAM,MAAM,mBAAmB,GAAG,eAAe,CAAC;AAClD,0CAA0C;AAC1C,MAAM,MAAM,eAAe,GAAG,WAAW,CAAC;AAE1C;;;;;;;;;;;;;;;;;;;;;;;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computation with input/output paths (stored separately)
15
15
  */
16
- import { StructType, StringType, IntegerType, VariantType, NullType, DictType } from '@elaraai/east';
16
+ import { StructType, StringType, IntegerType, VariantType, NullType, DictType, decodeBeast2For } from '@elaraai/east';
17
17
  import { DatasetRefType } from './dataset-ref.js';
18
18
  import { StructureType } from './structure.js';
19
19
  /**
@@ -65,7 +65,45 @@ export const PackageObjectType = StructType({
65
65
  tasks: DictType(StringType, StringType),
66
66
  /** Data structure and initial values */
67
67
  data: PackageDataType,
68
+ /** Functions defined in this package: name -> FunctionObject hash.
69
+ * BEAST2 encodes struct fields positionally in declaration order, so this
70
+ * field MUST stay last — never insert between `tasks` and `data`. */
71
+ functions: DictType(StringType, StringType),
68
72
  });
73
+ /**
74
+ * The pre-`functions` package object wire shape, kept only so
75
+ * {@link decodePackageObject} can read packages exported before functions
76
+ * existed.
77
+ */
78
+ const LegacyPackageObjectType = StructType({
79
+ tasks: DictType(StringType, StringType),
80
+ data: PackageDataType,
81
+ });
82
+ const decodeCurrent = decodeBeast2For(PackageObjectType);
83
+ const decodeLegacy = decodeBeast2For(LegacyPackageObjectType);
84
+ /**
85
+ * Decode a `PackageObject` from BEAST2 bytes, tolerating the pre-`functions`
86
+ * wire format (dual-decode migration).
87
+ *
88
+ * Every package-read path — local AND cloud — must use this instead of
89
+ * `decodeBeast2For(PackageObjectType)` directly, so packages exported before
90
+ * the `functions` field existed keep decoding. Old bytes decode with
91
+ * `functions` defaulted to an empty map.
92
+ */
93
+ export function decodePackageObject(data) {
94
+ try {
95
+ return decodeCurrent(data);
96
+ }
97
+ catch (err) {
98
+ try {
99
+ const legacy = decodeLegacy(data);
100
+ return { tasks: legacy.tasks, data: legacy.data, functions: new Map() };
101
+ }
102
+ catch {
103
+ throw err; // neither shape — surface the current-format error
104
+ }
105
+ }
106
+ }
69
107
  // =============================================================================
70
108
  // Package Transfer Types
71
109
  // =============================================================================
@@ -1 +1 @@
1
- {"version":3,"file":"package.js","sourceRoot":"","sources":["../../src/package.ts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Q;CACpB,CAAC,CAAC;AAGH,MAAM,CAAC,MAAM,uBAAuB,GAAG,WAAW,CAAC;IACjD,UAAU,EAAE,yBAAyB;IACrC,SAAS,EAAE,uBAAuB;IAClC,MAAM,EAAE,UAAU,CAAC;QACjB,OAAO,EAAE,UAAU;KACpB,CAAC;CACH,CAAC,CAAC"}
@@ -0,0 +1,55 @@
1
+ /**
2
+ * Copyright (c) 2025 Elara AI Pty Ltd
3
+ * Dual-licensed under AGPL-3.0 and commercial license. See LICENSE for details.
4
+ */
5
+ /**
6
+ * Runner wire types for e3 functions.
7
+ *
8
+ * `RunnerType` is the wire image of the SDK's `Runner` union (minus its
9
+ * `custom` raw-argv runtime — see the security note below). It pins the
10
+ * executable to a known runtime for every tag, so a function call can never
11
+ * name its own executable; only platform flags vary.
12
+ *
13
+ * A `platforms` entry is just a `-p <name>` flag on the wire; the SDK's
14
+ * `Platform<Known> | { custom }` distinction is authoring sugar that
15
+ * collapses to a string.
16
+ */
17
+ import { VariantType, StructType, ArrayType, StringType, ValueTypeOf } from '@elaraai/east';
18
+ /**
19
+ * Wire representation of a runner — shared by tasks and functions
20
+ * (symmetric: both carry `runner: RunnerType`).
21
+ *
22
+ * The known-runtime tags name a runtime binary; `platforms` are passed as
23
+ * `-p` flags. `custom` carries a raw argv prefix: for functions it is the
24
+ * executed command (the standard `-i/-o/<ir>` suffix is appended, so the
25
+ * command must speak the runner CLI convention); for tasks it is routing
26
+ * metadata only — a task's `commandIr` remains authoritative for execution.
27
+ * Package authors can already execute arbitrary commands via custom tasks,
28
+ * so `custom` grants no capability that tasks don't have.
29
+ */
30
+ export declare const RunnerType: VariantType<{
31
+ readonly east_node: StructType<{
32
+ readonly platforms: ArrayType<StringType>;
33
+ }>;
34
+ readonly east_py: StructType<{
35
+ readonly platforms: ArrayType<StringType>;
36
+ }>;
37
+ readonly east_c: StructType<{
38
+ readonly platforms: ArrayType<StringType>;
39
+ }>;
40
+ readonly custom: StructType<{
41
+ readonly command: ArrayType<StringType>;
42
+ }>;
43
+ }>;
44
+ export type RunnerType = typeof RunnerType;
45
+ export type RunnerValue = ValueTypeOf<typeof RunnerType>;
46
+ /**
47
+ * Resolve a {@link RunnerType} value to the argv prefix (the wire-value
48
+ * analogue of the SDK's `runnerToCommand`). Lives in e3-types so both
49
+ * e3-core (local) and the cloud execution kernel import the one resolver.
50
+ *
51
+ * Variant tags use underscores (`east_node`) mapped to the binary name
52
+ * (`east-node`) here.
53
+ */
54
+ export declare function runnerToArgv(r: RunnerValue): string[];
55
+ //# sourceMappingURL=runner.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"runner.d.ts","sourceRoot":"","sources":["../../src/runner.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH;;;;;;;;;;;GAWG;AAEH,OAAO,EAAE,WAAW,EAAE,UAAU,EAAE,SAAS,EAAE,UAAU,EAAE,WAAW,EAAE,MAAM,eAAe,CAAC;AAE5F;;;;;;;;;;;GAWG;AACH,eAAO,MAAM,UAAU;;;;;;;;;;;;;EAKrB,CAAC;AACH,MAAM,MAAM,UAAU,GAAG,OAAO,UAAU,CAAC;AAE3C,MAAM,MAAM,WAAW,GAAG,WAAW,CAAC,OAAO,UAAU,CAAC,CAAC;AAMzD;;;;;;;GAOG;AACH,wBAAgB,YAAY,CAAC,CAAC,EAAE,WAAW,GAAG,MAAM,EAAE,CAOrD"}
@@ -0,0 +1,55 @@
1
+ /**
2
+ * Copyright (c) 2025 Elara AI Pty Ltd
3
+ * Dual-licensed under AGPL-3.0 and commercial license. See LICENSE for details.
4
+ */
5
+ /**
6
+ * Runner wire types for e3 functions.
7
+ *
8
+ * `RunnerType` is the wire image of the SDK's `Runner` union (minus its
9
+ * `custom` raw-argv runtime — see the security note below). It pins the
10
+ * executable to a known runtime for every tag, so a function call can never
11
+ * name its own executable; only platform flags vary.
12
+ *
13
+ * A `platforms` entry is just a `-p <name>` flag on the wire; the SDK's
14
+ * `Platform<Known> | { custom }` distinction is authoring sugar that
15
+ * collapses to a string.
16
+ */
17
+ import { VariantType, StructType, ArrayType, StringType } from '@elaraai/east';
18
+ /**
19
+ * Wire representation of a runner — shared by tasks and functions
20
+ * (symmetric: both carry `runner: RunnerType`).
21
+ *
22
+ * The known-runtime tags name a runtime binary; `platforms` are passed as
23
+ * `-p` flags. `custom` carries a raw argv prefix: for functions it is the
24
+ * executed command (the standard `-i/-o/<ir>` suffix is appended, so the
25
+ * command must speak the runner CLI convention); for tasks it is routing
26
+ * metadata only — a task's `commandIr` remains authoritative for execution.
27
+ * Package authors can already execute arbitrary commands via custom tasks,
28
+ * so `custom` grants no capability that tasks don't have.
29
+ */
30
+ export const RunnerType = VariantType({
31
+ east_node: StructType({ platforms: ArrayType(StringType) }),
32
+ east_py: StructType({ platforms: ArrayType(StringType) }),
33
+ east_c: StructType({ platforms: ArrayType(StringType) }),
34
+ custom: StructType({ command: ArrayType(StringType) }),
35
+ });
36
+ function flags(platforms) {
37
+ return platforms.flatMap((p) => ['-p', p]);
38
+ }
39
+ /**
40
+ * Resolve a {@link RunnerType} value to the argv prefix (the wire-value
41
+ * analogue of the SDK's `runnerToCommand`). Lives in e3-types so both
42
+ * e3-core (local) and the cloud execution kernel import the one resolver.
43
+ *
44
+ * Variant tags use underscores (`east_node`) mapped to the binary name
45
+ * (`east-node`) here.
46
+ */
47
+ export function runnerToArgv(r) {
48
+ switch (r.type) {
49
+ case 'east_node': return ['east-node', 'run', ...flags(r.value.platforms)];
50
+ case 'east_py': return ['east-py', 'run', ...flags(r.value.platforms)];
51
+ case 'east_c': return ['east-c', 'run', ...flags(r.value.platforms)];
52
+ case 'custom': return [...r.value.command];
53
+ }
54
+ }
55
+ //# sourceMappingURL=runner.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"runner.js","sourceRoot":"","sources":["../../src/runner.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH;;;;;;;;;;;GAWG;AAEH,OAAO,EAAE,WAAW,EAAE,UAAU,EAAE,SAAS,EAAE,UAAU,E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+64,28 @@ export declare const TaskObjectType: StructType<{
64
64
  readonly kind: OptionType<StringType>;
65
65
  /** Opaque extension metadata (beast2-encoded). Interpreted by the kind-specific consumer. */
66
66
  readonly metadata: OptionType<BlobType>;
67
+ /**
68
+ * The task's runner, as routing metadata (symmetric with
69
+ * FunctionObject.runner). For `custom` runners, `commandIr` remains
70
+ * authoritative for execution — the wire command is informational.
71
+ *
72
+ * NOTE: added as a hard cutover (no dual decoder) — packages exported by
73
+ * older SDKs must be re-exported.
74
+ */
75
+ readonly runner: import("@elaraai/east").VariantType<{
76
+ readonly east_node: StructType<{
77
+ readonly platforms: ArrayType<StringType>;
78
+ }>;
79
+ readonly east_py: StructType<{
80
+ readonly platforms: ArrayType<StringType>;
81
+ }>;
82
+ readonly east_c: StructType<{
83
+ readonly platforms: ArrayType<StringType>;
84
+ }>;
85
+ readonly custom: StructType<{
86
+ readonly command: ArrayType<StringType>;
87
+ }>;
88
+ }>;
67
89
  }>;
68
90
  export type TaskObjectType = typeof TaskObjectType;
69
91
  export type TaskObject = ValueTypeOf<typeof TaskObjectType>;
@@ -1 +1 @@
1
- {"version":3,"file":"task.d.ts","sourceRoot":"","sources":["../../src/task.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH;;;;;;;;;;;GAWG;AAEH,OAAO,EAAE,UAAU,EAAE,UAAU,EAAE,SAAS,EAAE,QAAQ,EAAE,UAAU,EAAE,WAAW,EAAE,MAAM,eAAe,CAAC;AAGrG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAiCG;AACH,eAAO,MAAM,cAAc;IACzB,kFAAkF;;IAElF,uEAAuE;;;;IAEvE,sEAAsE;;;;IAEtE,sFAAsF;;IAEtF,6FAA6F;;EAE7F,CAAC;AACH,MAAM,MAAM,cAAc,GAAG,OAAO,cAAc,CAAC;AAEnD,MAAM,MAAM,UAAU,GAAG,WAAW,CAAC,OAAO,cAAc,CAAC,CAAC"}
1
+ {"version":3,"file":"task.d.ts","sourceRoot":"","sources":["../../src/task.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH;;;;;;;;;;;GAWG;AAEH,OAAO,EAAE,UAAU,EAAE,UAAU,EAAE,SAAS,EAAE,QAAQ,EAAE,UAAU,EAAE,WAAW,EAAE,MAAM,eAAe,CAAC;AAIrG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAiCG;AACH,eAAO,MAAM,cAAc;IACzB,kFAAkF;;IAElF,uEAAuE;;;;IAEvE,sEAAsE;;;;IAEtE,sFAAsF;;IAEtF,6FAA6F;;IAE7F;;;;;;;OAOG;;;;;;;;;;;;;;;EAEH,CAAC;AACH,MAAM,MAAM,cAAc,GAAG,OAAO,cAAc,CAAC;AAEnD,MAAM,MAAM,UAAU,GAAG,WAAW,CAAC,OAAO,cAAc,CAAC,CAAC"}
package/dist/src/task.js CHANGED
@@ -16,6 +16,7 @@
16
16
  */
17
17
  import { StructType, StringType, ArrayType, BlobType, OptionType } from '@elaraai/east';
18
18
  import { TreePathType } from './structure.js';
19
+ import { RunnerType } from './runner.js';
19
20
  /**
20
21
  * Task object stored in the object store.
21
22
  *
@@ -61,5 +62,14 @@ export const TaskObjectType = StructType({
61
62
  kind: OptionType(StringType),
62
63
  /** Opaque extension metadata (beast2-encoded). Interpreted by the kind-specific consumer. */
63
64
  metadata: OptionType(BlobType),
65
+ /**
66
+ * The task's runner, as routing metadata (symmetric with
67
+ * FunctionObject.runner). For `custom` runners, `commandIr` remains
68
+ * authoritative for execution — the wire command is informational.
69
+ *
70
+ * NOTE: added as a hard cutover (no dual decoder) — packages exported by
71
+ * older SDKs must be re-exported.
72
+ */
73
+ runner: RunnerType,
64
74
  });
65
75
  //# sourceMappingURL=task.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"task.js","sourceRoot":"","sources":["../../src/task.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH;;;;;;;;;;;GAWG;AAEH,OAAO,EAAE,UAAU,EAAE,UAAU,EAAE,SAAS,EAAE,QAAQ,EAAE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-types",
3
- "version": "1.0.5",
3
+ "version": "1.0.7",
4
4
  "description": "Shared type definitions for e3 (East Execution Engine)",
5
5
  "type": "module",
6
6
  "main": "dist/src/index.js",
@@ -18,7 +18,7 @@
18
18
  "directory": "libs/e3/packages/e3-types"
19
19
  },
20
20
  "peerDependencies": {
21
- "@elaraai/east": "1.0.5"
21
+ "@elaraai/east": "1.0.7"
22
22
  },
23
23
  "devDependencies": {
24
24
  "@typescript-eslint/eslint-plugin": "^8.47.0",
package/src/api.ts CHANGED
@@ -35,6 +35,7 @@ import {
35
35
  } from '@elaraai/east';
36
36
 
37
37
  import { StructureType, TreePathType } from './structure.js';
38
+ import { RunnerType } from './runner.js';
38
39
 
39
40
  // =============================================================================
40
41
  // Error Types
@@ -723,6 +724,92 @@ export const DatasetStatusDetailType = StructType({
723
724
  size: OptionType(IntegerType),
724
725
  });
725
726
 
727
+ // =============================================================================
728
+ // Function / one-shot execution types
729
+ // =============================================================================
730
+ // Shared by the named-function path AND one-shot execution. The result of a
731
+ // call is an in-memory, bounded value returned inline — never promoted to a
732
+ // durable artifact.
733
+
734
+ /**
735
+ * Execution limits for a function/one-shot call.
736
+ *
737
+ * @property timeoutMs - Wall-clock limit; over it the call is killed and returns `timed_out`
738
+ * @property maxResultBytes - Inline result cap; over it the call returns `too_large`
739
+ * @property maxLogBytes - Per-stream stdout/stderr tail cap
740
+ */
741
+ export const ExecuteLimitsType = StructType({
742
+ timeoutMs: OptionType(IntegerType),
743
+ maxResultBytes: OptionType(IntegerType),
744
+ maxLogBytes: OptionType(IntegerType),
745
+ });
746
+
747
+ /**
748
+ * A diagnostic attached to an `invalid` call outcome.
749
+ */
750
+ export const DiagnosticType = StructType({
751
+ message: StringType,
752
+ filename: OptionType(StringType),
753
+ line: OptionType(IntegerType),
754
+ column: OptionType(IntegerType),
755
+ });
756
+
757
+ /**
758
+ * The terminal result of a function/one-shot call.
759
+ *
760
+ * - `success`: beast2-encoded result value; decode with the function's `outputType`
761
+ * - `failed`: process exited non-zero (see stderr)
762
+ * - `invalid`: signature/IR error; nothing ran
763
+ * - `too_large`: result over `maxResultBytes`; deploy a task and read it with `datasetGet`
764
+ * - `timed_out`: exceeded `timeoutMs` / the server's sync deadline guard
765
+ */
766
+ export const ExecuteResultType = StructType({
767
+ outcome: VariantType({
768
+ success: StructType({ value: BlobType }),
769
+ failed: StructType({ exitCode: IntegerType }),
770
+ invalid: StructType({ diagnostics: ArrayType(DiagnosticType) }),
771
+ too_large: StructType({ bytes: IntegerType, limit: IntegerType }),
772
+ timed_out: StructType({ ms: IntegerType }),
773
+ }),
774
+ stdout: StringType,
775
+ stderr: StringType,
776
+ stdoutTruncated: BooleanType,
777
+ stderrTruncated: BooleanType,
778
+ });
779
+
780
+ /** Named function call. Positional args, one beast2-encoded value per param. */
781
+ export const FunctionCallRequestType = StructType({
782
+ args: ArrayType(BlobType),
783
+ runner: OptionType(RunnerType), // optional override; only the known runtimes
784
+ limits: OptionType(ExecuteLimitsType),
785
+ });
786
+
787
+ /** A function signature, returned by `describe` so dynamic callers can encode args. */
788
+ export const FunctionSignatureType = StructType({
789
+ name: StringType,
790
+ inputTypes: ArrayType(EastTypeType),
791
+ outputType: EastTypeType,
792
+ runner: RunnerType,
793
+ });
794
+
795
+ /**
796
+ * One-shot execution request: run an anonymous function whose IR is supplied
797
+ * at call time, optionally bound to existing workspace datasets, returning
798
+ * the result inline and persisting nothing.
799
+ *
800
+ * SECURITY: one-shot evaluates a caller-supplied IR — remote code execution
801
+ * with the server's authority. Gate behind an elevated role.
802
+ */
803
+ export const OneShotRequestType = StructType({
804
+ bodyIr: BlobType, // anonymous EastIR, not deployed
805
+ args: ArrayType(VariantType({ // each arg: an inline value OR a live dataset
806
+ value: BlobType,
807
+ dataset: TreePathType, // workspace-scoped; resolved + pinned by content hash at launch
808
+ })),
809
+ runner: RunnerType,
810
+ limits: OptionType(ExecuteLimitsType),
811
+ });
812
+
726
813
  // =============================================================================
727
814
  // Value type aliases
728
815
  // =============================================================================
@@ -761,3 +848,9 @@ export type ExecutionListItem = ValueTypeOf<typeof ExecutionListItemType>;
761
848
  export type TreeKind = ValueTypeOf<typeof TreeKindType>;
762
849
  export type ListEntry = ValueTypeOf<typeof ListEntryType>;
763
850
  export type DatasetStatusDetail = ValueTypeOf<typeof DatasetStatusDetailType>;
851
+ export type ExecuteLimits = ValueTypeOf<typeof ExecuteLimitsType>;
852
+ export type Diagnostic = ValueTypeOf<typeof DiagnosticType>;
853
+ export type ExecuteResult = ValueTypeOf<typeof ExecuteResultType>;
854
+ export type FunctionCallRequest = ValueTypeOf<typeof FunctionCallRequestType>;
855
+ export type FunctionSignature = ValueTypeOf<typeof FunctionSignatureType>;
856
+ export type OneShotRequest = ValueTypeOf<typeof OneShotRequestType>;
@@ -0,0 +1,41 @@
1
+ /**
2
+ * Copyright (c) 2025 Elara AI Pty Ltd
3
+ * Dual-licensed under AGPL-3.0 and commercial license. See LICENSE for details.
4
+ */
5
+
6
+ /**
7
+ * Function object types for e3.
8
+ *
9
+ * An `e3.function` is a named, typed function stored in a package and
10
+ * invoked by name with argument values over the CLI and HTTP API. Unlike
11
+ * a task it is not wired to datasets, not part of the dataflow graph, and
12
+ * triggers no recomputation.
13
+ *
14
+ * The function object stores its signature explicitly so `describe` and
15
+ * arity/type validation work from the small function object without
16
+ * loading the IR bundle, and so dynamic callers (CLI literal parsing,
17
+ * non-TS clients) have the types they need to encode arguments.
18
+ */
19
+
20
+ import { StructType, StringType, ArrayType, EastTypeType, ValueTypeOf } from '@elaraai/east';
21
+ import { RunnerType } from './runner.js';
22
+
23
+ /**
24
+ * Function object stored in the object store, referenced by name from
25
+ * `PackageObject.functions`.
26
+ */
27
+ export const FunctionObjectType = StructType({
28
+ /** Hash of the encoded EastIR bundle (encodeEastIR), like a task's commandIr object. */
29
+ bodyIr: StringType,
30
+ /** Positional parameter types — the IR's signature, surfaced for arity/type
31
+ * validation and `describe` without decoding the whole IR. */
32
+ inputTypes: ArrayType(EastTypeType),
33
+ /** Return type — used to decode the result `value` blob client-side. */
34
+ outputType: EastTypeType,
35
+ /** Author-chosen runtime; resolved to argv by runnerToArgv. One of the known
36
+ * runtime tags — there is no raw-argv runner for functions. */
37
+ runner: RunnerType,
38
+ });
39
+ export type FunctionObjectType = typeof FunctionObjectType;
40
+
41
+ export type FunctionObject = ValueTypeOf<typeof FunctionObjectType>;
package/src/index.ts CHANGED
@@ -67,12 +67,26 @@ export {
67
67
  type DatasetSchema,
68
68
  } from './structure.js';
69
69
 
70
+ // Runner wire types (functions)
71
+ export {
72
+ RunnerType,
73
+ type RunnerValue,
74
+ runnerToArgv,
75
+ } from './runner.js';
76
+
77
+ // Function objects
78
+ export {
79
+ FunctionObjectType,
80
+ type FunctionObject,
81
+ } from './function.js';
82
+
70
83
  // Package objects
71
84
  export {
72
85
  PackageDataType,
73
86
  type PackageData,
74
87
  PackageObjectType,
75
88
  type PackageObject,
89
+ decodePackageObject,
76
90
  // Backwards compatibility
77
91
  PackageDatasetsType,
78
92
  type PackageDatasets,
@@ -203,6 +217,13 @@ export {
203
217
  ListEntryType,
204
218
  // Dataset Status Detail
205
219
  DatasetStatusDetailType,
220
+ // Function / one-shot execution
221
+ ExecuteLimitsType,
222
+ DiagnosticType,
223
+ ExecuteResultType,
224
+ FunctionCallRequestType,
225
+ FunctionSignatureType,
226
+ OneShotRequestType,
206
227
  // Type aliases
207
228
  type Error,
208
229
  type RepositoryStatus,
@@ -238,6 +259,12 @@ export {
238
259
  type TreeKind,
239
260
  type ListEntry,
240
261
  type DatasetStatusDetail,
262
+ type ExecuteLimits,
263
+ type Diagnostic,
264
+ type ExecuteResult,
265
+ type FunctionCallRequest,
266
+ type FunctionSignature,
267
+ type OneShotRequest,
241
268
  } from './api.js';
242
269
 
243
270
  // Dataflow execution state
package/src/package.ts CHANGED
@@ -15,7 +15,7 @@
15
15
  * - **Task**: A computation with input/output paths (stored separately)
16
16
  */
17
17
 
18
- import { StructType, StringType, IntegerType, VariantType, NullType, DictType, ValueTypeOf } from '@elaraai/east';
18
+ import { StructType, StringType, IntegerType, VariantType, NullType, DictType, ValueTypeOf, decodeBeast2For } from '@elaraai/east';
19
19
  import { DatasetRefType } from './dataset-ref.js';
20
20
  import { StructureType } from './structure.js';
21
21
 
@@ -77,11 +77,50 @@ export const PackageObjectType = StructType({
77
77
  tasks: DictType(StringType, StringType),
78
78
  /** Data structure and initial values */
79
79
  data: PackageDataType,
80
+ /** Functions defined in this package: name -> FunctionObject hash.
81
+ * BEAST2 encodes struct fields positionally in declaration order, so this
82
+ * field MUST stay last — never insert between `tasks` and `data`. */
83
+ functions: DictType(StringType, StringType),
80
84
  });
81
85
  export type PackageObjectType = typeof PackageObjectType;
82
86
 
83
87
  export type PackageObject = ValueTypeOf<typeof PackageObjectType>;
84
88
 
89
+ /**
90
+ * The pre-`functions` package object wire shape, kept only so
91
+ * {@link decodePackageObject} can read packages exported before functions
92
+ * existed.
93
+ */
94
+ const LegacyPackageObjectType = StructType({
95
+ tasks: DictType(StringType, StringType),
96
+ data: PackageDataType,
97
+ });
98
+
99
+ const decodeCurrent = decodeBeast2For(PackageObjectType);
100
+ const decodeLegacy = decodeBeast2For(LegacyPackageObjectType);
101
+
102
+ /**
103
+ * Decode a `PackageObject` from BEAST2 bytes, tolerating the pre-`functions`
104
+ * wire format (dual-decode migration).
105
+ *
106
+ * Every package-read path — local AND cloud — must use this instead of
107
+ * `decodeBeast2For(PackageObjectType)` directly, so packages exported before
108
+ * the `functions` field existed keep decoding. Old bytes decode with
109
+ * `functions` defaulted to an empty map.
110
+ */
111
+ export function decodePackageObject(data: Uint8Array): PackageObject {
112
+ try {
113
+ return decodeCurrent(data);
114
+ } catch (err) {
115
+ try {
116
+ const legacy = decodeLegacy(data);
117
+ return { tasks: legacy.tasks, data: legacy.data, functions: new Map() };
118
+ } catch {
119
+ throw err; // neither shape — surface the current-format error
120
+ }
121
+ }
122
+ }
123
+
85
124
  // =============================================================================
86
125
  // Package Transfer Types
87
126
  // =============================================================================