@elaraai/e3-types 1.0.76 → 1.0.78

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 (66) hide show
  1. package/dist/src/api.d.ts +25 -0
  2. package/dist/src/api.d.ts.map +1 -1
  3. package/dist/src/api.js +18 -0
  4. package/dist/src/api.js.map +1 -1
  5. package/dist/src/dataflow.d.ts +10 -6
  6. package/dist/src/dataflow.d.ts.map +1 -1
  7. package/dist/src/dataflow.js.map +1 -1
  8. package/dist/src/dataset-type.d.ts +71 -0
  9. package/dist/src/dataset-type.d.ts.map +1 -0
  10. package/dist/src/dataset-type.js +101 -0
  11. package/dist/src/dataset-type.js.map +1 -0
  12. package/dist/src/execution.d.ts +17 -0
  13. package/dist/src/execution.d.ts.map +1 -1
  14. package/dist/src/index.d.ts +8 -6
  15. package/dist/src/index.d.ts.map +1 -1
  16. package/dist/src/index.js +10 -5
  17. package/dist/src/index.js.map +1 -1
  18. package/dist/src/package.d.ts +33 -3
  19. package/dist/src/package.d.ts.map +1 -1
  20. package/dist/src/package.js +47 -8
  21. package/dist/src/package.js.map +1 -1
  22. package/dist/src/runner.d.ts +35 -9
  23. package/dist/src/runner.d.ts.map +1 -1
  24. package/dist/src/runner.js +46 -13
  25. package/dist/src/runner.js.map +1 -1
  26. package/dist/src/runner.spec.js +50 -1
  27. package/dist/src/runner.spec.js.map +1 -1
  28. package/dist/src/stream.d.ts +97 -0
  29. package/dist/src/stream.d.ts.map +1 -0
  30. package/dist/src/stream.js +134 -0
  31. package/dist/src/stream.js.map +1 -0
  32. package/dist/src/stream.spec.d.ts +6 -0
  33. package/dist/src/stream.spec.d.ts.map +1 -0
  34. package/dist/src/stream.spec.js +60 -0
  35. package/dist/src/stream.spec.js.map +1 -0
  36. package/dist/src/task.d.ts +198 -10
  37. package/dist/src/task.d.ts.map +1 -1
  38. package/dist/src/task.js +340 -11
  39. package/dist/src/task.js.map +1 -1
  40. package/dist/src/task.spec.d.ts +6 -0
  41. package/dist/src/task.spec.d.ts.map +1 -0
  42. package/dist/src/task.spec.js +169 -0
  43. package/dist/src/task.spec.js.map +1 -0
  44. package/dist/src/transfer.d.ts +70 -3
  45. package/dist/src/transfer.d.ts.map +1 -1
  46. package/dist/src/transfer.js +76 -3
  47. package/dist/src/transfer.js.map +1 -1
  48. package/dist/src/transfer.spec.d.ts +6 -0
  49. package/dist/src/transfer.spec.d.ts.map +1 -0
  50. package/dist/src/transfer.spec.js +75 -0
  51. package/dist/src/transfer.spec.js.map +1 -0
  52. package/package.json +2 -2
  53. package/src/api.ts +18 -0
  54. package/src/dataflow.ts +10 -6
  55. package/src/dataset-type.ts +134 -0
  56. package/src/execution.ts +18 -0
  57. package/src/index.ts +37 -0
  58. package/src/package.ts +50 -8
  59. package/src/runner.spec.ts +56 -1
  60. package/src/runner.ts +45 -13
  61. package/src/stream.spec.ts +88 -0
  62. package/src/stream.ts +170 -0
  63. package/src/task.spec.ts +208 -0
  64. package/src/task.ts +374 -13
  65. package/src/transfer.spec.ts +98 -0
  66. package/src/transfer.ts +84 -3
package/dist/src/index.js CHANGED
@@ -25,7 +25,9 @@ export { DataRefType, unassignedRef, nullRef, DataTreeType, } from './dataset.js
25
25
  // Per-dataset refs and version vectors (reactive dataflow)
26
26
  export { VersionVectorType, DatasetRefType, } from './dataset-ref.js';
27
27
  // Task definitions
28
- export { TaskObjectType, decodeTaskObject, TASK_KIND_PARTITION, TASK_KIND_STREAM, PartitionTaskMetadataType, encodePartitionTaskMetadata, decodePartitionTaskMetadata, StreamTaskMetadataType, encodeStreamTaskMetadata, decodeStreamTaskMetadata, } from './task.js';
28
+ export { TaskObjectType, decodeTaskObject, TASK_KIND_PARTITION, TASK_KIND_STREAM, TASK_KIND_MERGE, PartitionTaskMetadataType, encodePartitionTaskMetadata, decodePartitionTaskMetadata, StreamTaskMetadataType, encodeStreamTaskMetadata, decodeStreamTaskMetadata, PartitionPlanType, MergeRangePlanType, encodePartitionPlan, decodePartitionPlan, partitionProjectionShape, projectedKeyType, projectKey, } from './task.js';
29
+ // Stream and merge commands
30
+ export { streamCommandIr, mergeCommandIr, } from './stream.js';
29
31
  // Execution environments
30
32
  export { EnvironmentSpecType, PythonEnvironmentType, NodeEnvironmentType, ImageEnvironmentType, ToolsEnvironmentType, WorkspaceNodeEnvironmentType, environmentSpecObjectHashes, } from './environment.js';
31
33
  // Data structure and paths
@@ -33,13 +35,13 @@ export { StructureType, PathSegmentType, TreePathType, treePath, pathToString, p
33
35
  // Backwards compatibility
34
36
  DatasetSchemaType, } from './structure.js';
35
37
  // Runner wire types (functions)
36
- export { RunnerType, runnerToArgv, withRunnerVerbose, } from './runner.js';
38
+ export { RunnerType, runnerToArgv, withRunnerVerbose, withRunnerLifeline, } from './runner.js';
37
39
  // Function objects
38
40
  export { FunctionObjectType, decodeFunctionObject, } from './function.js';
39
41
  // Record objects
40
42
  export { RecordCommitType, MutationObjectType, RecordObjectType, } from './record.js';
41
43
  // Package objects
42
- export { PackageDataType, PackageObjectType, decodePackageObject,
44
+ export { PackageDataType, PackageObjectType, DatasetSourceWireType, decodePackageObject,
43
45
  // Backwards compatibility
44
46
  PackageDatasetsType,
45
47
  // Package transfer types
@@ -51,16 +53,19 @@ export { ExecutionStatusType, } from './execution.js';
51
53
  // Lock state
52
54
  export { LockOperationType, ProcessHolderType, LockStateType, } from './lock.js';
53
55
  // Dataset transfer types
54
- export { TransferUploadRequestType, TransferUploadResponseType, TransferDoneResponseType, } from './transfer.js';
56
+ export { TRANSFER_PROTOCOL_VERSION, transferPartCount, transferPartRange, TransferUploadRequestType, TransferUploadResponseType, TransferPartResponseType, TransferDoneResponseType, } from './transfer.js';
55
57
  // Dataset blob encoding — the ONE branch deciding segmentation, shared by the
56
58
  // store path (e3-core `datasetWrite`) and the package export path (e3 `export_`)
57
59
  export { isCollectionRoot, encodeDatasetBlob, } from './dataset-blob.js';
60
+ // The ONE declared-type-vs-wire-type check, shared by every door a value
61
+ // enters a dataset through (the export, the set, the adopt, the API)
62
+ export { checkDatasetType, datasetAddress, } from './dataset-type.js';
58
63
  // Wire format constants
59
64
  export { BEAST2_CONTENT_TYPE } from './constants.js';
60
65
  // API wire types (shared between e3-api-client and e3-api-server)
61
66
  export {
62
67
  // Error types
63
- WorkspaceNotFoundErrorType, WorkspaceNotDeployedErrorType, WorkspaceExistsErrorType, LockHolderType, WorkspaceLockedErrorType, PackageNotFoundErrorType, PackageExistsErrorType, PackageInvalidErrorType, DatasetNotFoundErrorType, TaskNotFoundErrorType, ExecutionNotFoundErrorType, ObjectNotFoundErrorType, DataflowErrorType, PermissionDeniedErrorType, InternalErrorType, RepositoryNotFoundErrorType, ErrorType, ResponseType,
68
+ WorkspaceNotFoundErrorType, WorkspaceNotDeployedErrorType, WorkspaceExistsErrorType, LockHolderType, WorkspaceLockedErrorType, PackageNotFoundErrorType, PackageExistsErrorType, PackageInvalidErrorType, DatasetNotFoundErrorType, TaskNotFoundErrorType, ExecutionNotFoundErrorType, ObjectNotFoundErrorType, DataflowErrorType, PermissionDeniedErrorType, InternalErrorType, RepositoryNotFoundErrorType, DatasetTypeMismatchErrorType, ErrorType, ResponseType,
64
69
  // Repository
65
70
  RepositoryStatusType, GcRequestType, GcResultType, AsyncOperationStatusType, GcStartResultType, GcStatusResultType,
66
71
  // Packages
@@ -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,EAEd,gBAAgB,EAChB,mBAAmB,EACnB,gBAAgB,EAChB,yBAAyB,EAEzB,2BAA2B,EAC3B,2BAA2B,E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BAAuB,EACvB,kBAAkB,EAClB,mBAAmB,EACnB,oBAAoB,EACpB,uBAAuB,GA+CxB,MAAM,UAAU,CAAC;AAElB,2BAA2B;AAC3B,OAAO,EAGL,aAAa,EAEb,qBAAqB,EAErB,iBAAiB,EAEjB,kBAAkB,EAGlB,0BAA0B;AAE1B,uBAAuB;AACvB,qBAAqB,EAErB,uBAAuB,EAEvB,sBAAsB,EAEtB,eAAe,GAEhB,MAAM,eAAe,CAAC"}
@@ -180,6 +180,28 @@ export type PackageDatasets = PackageData;
180
180
  * };
181
181
  * ```
182
182
  */
183
+ /**
184
+ * Where a dataset's initial value comes from, when it is not in the package.
185
+ *
186
+ * @remarks
187
+ * A package carries the DESCRIPTOR, never the bytes: `e3.input('table', T,
188
+ * variant('file', './TABLE.beast2'))` puts `{ file: { path } }` here and leaves
189
+ * the ref `unassigned`, and deploy resolves it — adopting the file into the
190
+ * object store by hash, so a new delivery under the same path is a new hash
191
+ * whose consumers re-run. An inline `variant('value', v)` needs no descriptor:
192
+ * its bytes are an object in the bundle like any other.
193
+ *
194
+ * A variant so that further source kinds can be appended later without a wire
195
+ * break; `file` is the only one today.
196
+ */
197
+ export declare const DatasetSourceWireType: VariantType<{
198
+ /** A path on the machine that DEPLOYS the package, resolved at deploy. */
199
+ readonly file: StructType<{
200
+ readonly path: StringType;
201
+ }>;
202
+ }>;
203
+ export type DatasetSourceWireType = typeof DatasetSourceWireType;
204
+ export type DatasetSourceWire = ValueTypeOf<typeof DatasetSourceWireType>;
183
205
  export declare const PackageObjectType: StructType<{
184
206
  /** Tasks defined in this package: name -> task object hash */
185
207
  readonly tasks: DictType<StringType, StringType>;
@@ -252,17 +274,25 @@ export declare const PackageObjectType: StructType<{
252
274
  * BEAST2 encodes struct fields positionally in declaration order, so new
253
275
  * fields MUST be appended LAST — never inserted between existing fields. */
254
276
  readonly records: DictType<StringType, StringType>;
277
+ /** Unresolved dataset sources: refPath (e.g. "inputs/table") -> descriptor.
278
+ * Appended LAST, per the positional rule above. */
279
+ readonly sources: DictType<StringType, VariantType<{
280
+ /** A path on the machine that DEPLOYS the package, resolved at deploy. */
281
+ readonly file: StructType<{
282
+ readonly path: StringType;
283
+ }>;
284
+ }>>;
255
285
  }>;
256
286
  export type PackageObjectType = typeof PackageObjectType;
257
287
  export type PackageObject = ValueTypeOf<typeof PackageObjectType>;
258
288
  /**
259
- * Decode a `PackageObject` from BEAST2 bytes, tolerating the two older wire
289
+ * Decode a `PackageObject` from BEAST2 bytes, tolerating the older wire
260
290
  * formats (dual-decode migration).
261
291
  *
262
292
  * Every package-read path — local AND cloud — must use this instead of
263
293
  * `decodeBeast2For(PackageObjectType)` directly, so packages exported before
264
- * the `records`/`functions` fields existed keep decoding. Older bytes decode
265
- * with the missing maps defaulted to empty.
294
+ * the `sources`/`records`/`functions` fields existed keep decoding. Older
295
+ * bytes decode with the missing maps defaulted to empty.
266
296
  */
267
297
  export declare function decodePackageObject(data: Uint8Array): PackageObject;
268
298
  export declare const PackageTransferInitRequestType: StructType<{
@@ -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,EAAmB,MAAM,eAAe,CAAC;AAInI;;;;;;;;;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;;;;;;;;;;;;;;;;;;;;;;;;;;;;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AAmB,GAAG,WAAW,CAAC,OAAO,uBAAuB,CAAC,CAAC;AAE9E,eAAO,MAAM,yBAAyB;;;;;;EAIpC,CAAC;AACH,MAAM,MAAM,qBAAqB,GAAG,WAAW,CAAC,OAAO,yBAAyB,CAAC,CAAC;AAElF,eAAO,MAAM,uBAAuB;;;;;;;;;;;;;;;;;EAMlC,CAAC;AACH,MAAM,MAAM,mBAAmB,GAAG,WAAW,CAAC,OAAO,uBAAuB,CAAC,CAAC;AAE9E,eAAO,MAAM,yBAAyB;;;;;;EAIpC,CAAC;AACH,MAAM,MAAM,qBAAqB,GAAG,WAAW,CAAC,OAAO,yBAAyB,CAAC,CAAC;AAElF,eAAO,MAAM,uBAAuB;;;;;;;;;;;;;;;EAMlC,CAAC;AACH,MAAM,MAAM,mBAAmB,GAAG,WAAW,CAAC,OAAO,uBAAuB,CAAC,CAAC"}
@@ -60,6 +60,24 @@ export const PackageDatasetsType = PackageDataType;
60
60
  * };
61
61
  * ```
62
62
  */
63
+ /**
64
+ * Where a dataset's initial value comes from, when it is not in the package.
65
+ *
66
+ * @remarks
67
+ * A package carries the DESCRIPTOR, never the bytes: `e3.input('table', T,
68
+ * variant('file', './TABLE.beast2'))` puts `{ file: { path } }` here and leaves
69
+ * the ref `unassigned`, and deploy resolves it — adopting the file into the
70
+ * object store by hash, so a new delivery under the same path is a new hash
71
+ * whose consumers re-run. An inline `variant('value', v)` needs no descriptor:
72
+ * its bytes are an object in the bundle like any other.
73
+ *
74
+ * A variant so that further source kinds can be appended later without a wire
75
+ * break; `file` is the only one today.
76
+ */
77
+ export const DatasetSourceWireType = VariantType({
78
+ /** A path on the machine that DEPLOYS the package, resolved at deploy. */
79
+ file: StructType({ path: StringType }),
80
+ });
63
81
  export const PackageObjectType = StructType({
64
82
  /** Tasks defined in this package: name -> task object hash */
65
83
  tasks: DictType(StringType, StringType),
@@ -71,6 +89,20 @@ export const PackageObjectType = StructType({
71
89
  * BEAST2 encodes struct fields positionally in declaration order, so new
72
90
  * fields MUST be appended LAST — never inserted between existing fields. */
73
91
  records: DictType(StringType, StringType),
92
+ /** Unresolved dataset sources: refPath (e.g. "inputs/table") -> descriptor.
93
+ * Appended LAST, per the positional rule above. */
94
+ sources: DictType(StringType, DatasetSourceWireType),
95
+ });
96
+ /**
97
+ * The pre-`sources` package object wire shape (tasks, data, functions,
98
+ * records), kept only so {@link decodePackageObject} can read packages exported
99
+ * before path-initialised inputs existed.
100
+ */
101
+ const RecordsEraPackageObjectType = StructType({
102
+ tasks: DictType(StringType, StringType),
103
+ data: PackageDataType,
104
+ functions: DictType(StringType, StringType),
105
+ records: DictType(StringType, StringType),
74
106
  });
75
107
  /**
76
108
  * The pre-`records` package object wire shape (tasks, data, functions), kept
@@ -92,16 +124,17 @@ const LegacyPackageObjectType = StructType({
92
124
  data: PackageDataType,
93
125
  });
94
126
  const decodeCurrent = decodeBeast2For(PackageObjectType);
127
+ const decodeRecordsEra = decodeBeast2For(RecordsEraPackageObjectType);
95
128
  const decodeFunctionsEra = decodeBeast2For(FunctionsEraPackageObjectType);
96
129
  const decodeLegacy = decodeBeast2For(LegacyPackageObjectType);
97
130
  /**
98
- * Decode a `PackageObject` from BEAST2 bytes, tolerating the two older wire
131
+ * Decode a `PackageObject` from BEAST2 bytes, tolerating the older wire
99
132
  * formats (dual-decode migration).
100
133
  *
101
134
  * Every package-read path — local AND cloud — must use this instead of
102
135
  * `decodeBeast2For(PackageObjectType)` directly, so packages exported before
103
- * the `records`/`functions` fields existed keep decoding. Older bytes decode
104
- * with the missing maps defaulted to empty.
136
+ * the `sources`/`records`/`functions` fields existed keep decoding. Older
137
+ * bytes decode with the missing maps defaulted to empty.
105
138
  */
106
139
  export function decodePackageObject(data) {
107
140
  try {
@@ -109,16 +142,22 @@ export function decodePackageObject(data) {
109
142
  }
110
143
  catch (err) {
111
144
  try {
112
- const fnEra = decodeFunctionsEra(data);
113
- return { tasks: fnEra.tasks, data: fnEra.data, functions: fnEra.functions, records: new Map() };
145
+ const recEra = decodeRecordsEra(data);
146
+ return { ...recEra, sources: new Map() };
114
147
  }
115
148
  catch {
116
149
  try {
117
- const legacy = decodeLegacy(data);
118
- return { tasks: legacy.tasks, data: legacy.data, functions: new Map(), records: new Map() };
150
+ const fnEra = decodeFunctionsEra(data);
151
+ return { tasks: fnEra.tasks, data: fnEra.data, functions: fnEra.functions, records: new Map(), sources: new Map() };
119
152
  }
120
153
  catch {
121
- throw err; // no known shape — surface the current-format error
154
+ try {
155
+ const legacy = decodeLegacy(data);
156
+ return { tasks: legacy.tasks, data: legacy.data, functions: new Map(), records: new Map(), sources: new Map() };
157
+ }
158
+ catch {
159
+ throw err; // no known shape — surface the current-format error
160
+ }
122
161
  }
123
162
  }
124
163
  }
@@ -1 +1 @@
1
- {"version":3,"file":"package.js","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,eAAe,EAAE,MAAM,eAAe,CAAC;AACnI,OAAO,EAAE,cAAc,EAAE,MAAM,kBAAkB,CAAC;AAClD,OAAO,EAAE,aAAa,EAAE,MAAM,gBAAgB,CAAC;AAE/C;;;;;;;;;GASG;AACH,MAAM,CAAC,MAAM,eAAe,GAAG,UAAU,CAAC;IACxC,gEAAgE;IAChE,SAAS,EAAE,aAAa;IACxB,uEAAuE;IACvE,IAAI,EAAE,QAAQ,CAAC,UAAU,EAAE,cAAc,CAAC;CAC3C,CAAC,CAAC;AAKH,gCAAgC;AAChC,8CAA8C;AAC9C,MAAM,CAAC,MAAM,mBAAmB,GAAG,eAAe,CAAC;AAMnD;;;;;;;;;;;;;;;;;;;;;;;;GAwBG;AACH,MAAM,CAAC,MAAM,iBAAiB,GAAG,UAAU,CAAC;IAC1C,8DAA8D;IAC9D,KAAK,EAAE,QAAQ,CAAC,UAAU,EAAE,UAAU,CAAC;IACvC,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
@@ -44,22 +44,31 @@ export declare const RunnerType: VariantType<{
44
44
  export type RunnerType = typeof RunnerType;
45
45
  export type RunnerValue = ValueTypeOf<typeof RunnerType>;
46
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.
47
+ * Resolve a {@link RunnerType} value to the argv prefix of one of its
48
+ * commands (the wire-value analogue of the SDK's `runnerToCommand`): `run`,
49
+ * the default — `[<bin>, 'run', -p…]` — or `merge`, the blob merge every
50
+ * stock runner ships — `[<bin>, 'merge', -p…]`, the fan-in of a partitioned
51
+ * task's keyed partials (issue #770). Lives in e3-types so both e3-core
52
+ * (local) and the cloud execution kernel import the one resolver.
50
53
  *
51
54
  * Variant tags use underscores (`east_node`) mapped to the binary name
52
- * (`east-node`) here.
55
+ * (`east-node`) here. A `custom` runner's command is its `run`; it has no
56
+ * merge command.
57
+ *
58
+ * @param r - the runner
59
+ * @param command - the runner command, `run` by default
60
+ * @returns the argv prefix
61
+ * @throws {Error} When `merge` is asked of a custom runner.
53
62
  */
54
- export declare function runnerToArgv(r: RunnerValue): string[];
63
+ export declare function runnerToArgv(r: RunnerValue, command?: 'run' | 'merge'): string[];
55
64
  /**
56
65
  * Insert the runner's `-v/--verbose` flag into a fully-built argv, for the
57
66
  * known runtimes only.
58
67
  *
59
- * All three known runners (`east-node`/`east-py`/`east-c run`) accept `-v`
60
- * among their options and print timing/perf detail to stderr; a `custom`
61
- * runner's argv is user-authored, so a flag is never spliced into it. A
62
- * known-runtime argv always starts `[<bin>, 'run', …]` (see
68
+ * All three known runners (`east-node`/`east-py`/`east-c`, `run` and `merge`)
69
+ * accept `-v` among their options and print timing/perf detail to stderr; a
70
+ * `custom` runner's argv is user-authored, so a flag is never spliced into
71
+ * it. A known-runtime argv always starts `[<bin>, <command>, …]` (see
63
72
  * {@link runnerToArgv} and the SDK's `runnerToCommand`), so `-v` goes at
64
73
  * index 2 — ahead of the `-p`/`-i`/`-o` flags and the trailing IR path.
65
74
  *
@@ -73,4 +82,21 @@ export declare function runnerToArgv(r: RunnerValue): string[];
73
82
  * @returns the argv, with `-v` inserted for known runtimes when verbose
74
83
  */
75
84
  export declare function withRunnerVerbose(runner: RunnerValue, args: string[], verbose?: boolean): string[];
85
+ /**
86
+ * Insert the runner's `--exit-with-parent` flag into a fully-built argv, for
87
+ * the known runtimes only — the stdin lifeline (issue #770).
88
+ *
89
+ * A stock runner given the flag and a stdin pipe its parent never writes to
90
+ * exits as soon as the pipe reaches end of file: when the parent dies. A
91
+ * `custom` runner's argv is user-authored, so the flag is never spliced into
92
+ * it, and it keeps an ignored stdin. Like {@link withRunnerVerbose} the flag
93
+ * goes at index 2, after `[<bin>, <command>]`, and is a pure runtime toggle
94
+ * applied just before spawn — never part of the task's `commandIr` or any
95
+ * hash.
96
+ *
97
+ * @param runner - the runner the argv was built for (gates the injection)
98
+ * @param args - the fully-built argv
99
+ * @returns the argv, with `--exit-with-parent` inserted for known runtimes
100
+ */
101
+ export declare function withRunnerLifeline(runner: RunnerValue, args: string[]): string[];
76
102
  //# sourceMappingURL=runner.d.ts.map
@@ -1 +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;AAED;;;;;;;;;;;;;;;;;;;GAmBG;AACH,wBAAgB,iBAAiB,CAAC,MAAM,EAAE,WAAW,EAAE,IAAI,EAAE,MAAM,EAAE,EAAE,OAAO,CAAC,EAAE,OAAO,GAAG,MAAM,EAAE,CAGlG"}
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;;;;;;;;;;;;;;;;GAgBG;AACH,wBAAgB,YAAY,CAAC,CAAC,EAAE,WAAW,EAAE,OAAO,GAAE,KAAK,GAAG,OAAe,GAAG,MAAM,EAAE,CASvF;AAED;;;;;;;;;;;;;;;;;;;GAmBG;AACH,wBAAgB,iBAAiB,CAAC,MAAM,EAAE,WAAW,EAAE,IAAI,EAAE,MAAM,EAAE,EAAE,OAAO,CAAC,EAAE,OAAO,GAAG,MAAM,EAAE,CAGlG;AAED;;;;;;;;;;;;;;;GAeG;AACH,wBAAgB,kBAAkB,CAAC,MAAM,EAAE,WAAW,EAAE,IAAI,EAAE,MAAM,EAAE,GAAG,MAAM,EAAE,CAGhF"}
@@ -37,29 +37,41 @@ function flags(platforms) {
37
37
  return platforms.flatMap((p) => ['-p', p]);
38
38
  }
39
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.
40
+ * Resolve a {@link RunnerType} value to the argv prefix of one of its
41
+ * commands (the wire-value analogue of the SDK's `runnerToCommand`): `run`,
42
+ * the default — `[<bin>, 'run', -p…]` — or `merge`, the blob merge every
43
+ * stock runner ships — `[<bin>, 'merge', -p…]`, the fan-in of a partitioned
44
+ * task's keyed partials (issue #770). Lives in e3-types so both e3-core
45
+ * (local) and the cloud execution kernel import the one resolver.
43
46
  *
44
47
  * Variant tags use underscores (`east_node`) mapped to the binary name
45
- * (`east-node`) here.
48
+ * (`east-node`) here. A `custom` runner's command is its `run`; it has no
49
+ * merge command.
50
+ *
51
+ * @param r - the runner
52
+ * @param command - the runner command, `run` by default
53
+ * @returns the argv prefix
54
+ * @throws {Error} When `merge` is asked of a custom runner.
46
55
  */
47
- export function runnerToArgv(r) {
56
+ export function runnerToArgv(r, command = 'run') {
48
57
  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];
58
+ case 'east_node': return ['east-node', command, ...flags(r.value.platforms)];
59
+ case 'east_py': return ['east-py', command, ...flags(r.value.platforms)];
60
+ case 'east_c': return ['east-c', command, ...flags(r.value.platforms)];
61
+ case 'custom':
62
+ if (command !== 'run')
63
+ throw new Error(`a custom runner has no ${command} command`);
64
+ return [...r.value.command];
53
65
  }
54
66
  }
55
67
  /**
56
68
  * Insert the runner's `-v/--verbose` flag into a fully-built argv, for the
57
69
  * known runtimes only.
58
70
  *
59
- * All three known runners (`east-node`/`east-py`/`east-c run`) accept `-v`
60
- * among their options and print timing/perf detail to stderr; a `custom`
61
- * runner's argv is user-authored, so a flag is never spliced into it. A
62
- * known-runtime argv always starts `[<bin>, 'run', …]` (see
71
+ * All three known runners (`east-node`/`east-py`/`east-c`, `run` and `merge`)
72
+ * accept `-v` among their options and print timing/perf detail to stderr; a
73
+ * `custom` runner's argv is user-authored, so a flag is never spliced into
74
+ * it. A known-runtime argv always starts `[<bin>, <command>, …]` (see
63
75
  * {@link runnerToArgv} and the SDK's `runnerToCommand`), so `-v` goes at
64
76
  * index 2 — ahead of the `-p`/`-i`/`-o` flags and the trailing IR path.
65
77
  *
@@ -77,4 +89,25 @@ export function withRunnerVerbose(runner, args, verbose) {
77
89
  return args;
78
90
  return [...args.slice(0, 2), '-v', ...args.slice(2)];
79
91
  }
92
+ /**
93
+ * Insert the runner's `--exit-with-parent` flag into a fully-built argv, for
94
+ * the known runtimes only — the stdin lifeline (issue #770).
95
+ *
96
+ * A stock runner given the flag and a stdin pipe its parent never writes to
97
+ * exits as soon as the pipe reaches end of file: when the parent dies. A
98
+ * `custom` runner's argv is user-authored, so the flag is never spliced into
99
+ * it, and it keeps an ignored stdin. Like {@link withRunnerVerbose} the flag
100
+ * goes at index 2, after `[<bin>, <command>]`, and is a pure runtime toggle
101
+ * applied just before spawn — never part of the task's `commandIr` or any
102
+ * hash.
103
+ *
104
+ * @param runner - the runner the argv was built for (gates the injection)
105
+ * @param args - the fully-built argv
106
+ * @returns the argv, with `--exit-with-parent` inserted for known runtimes
107
+ */
108
+ export function withRunnerLifeline(runner, args) {
109
+ if (runner.type === 'custom' || args.length < 2)
110
+ return args;
111
+ return [...args.slice(0, 2), '--exit-with-parent', ...args.slice(2)];
112
+ }
80
113
  //# sourceMappingURL=runner.js.map
@@ -1 +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,EAAe,MAAM,eAAe,CAAC;AAE5F;;;;;;;;;;;GAWG;AACH,MAAM,CAAC,MAAM,UAAU,GAAG,WAAW,CAAC;IACpC,SAAS,EAAE,UAAU,CAAC,EAAE,SAAS,EAAE,SAAS,CAAC,UAAU,CAAC,EAAE,CAAC;IAC3D,OAAO,EAAI,UAAU,CAAC,EAAE,SAA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import { runnerToArgv, withRunnerVerbose } from './runner.js';
18
+ import { runnerToArgv, withRunnerLifeline, withRunnerVerbose } from './runner.js';
19
19
  /** A realistic fully-built argv: runner prefix + the `-i`/`-o`/`<ir>` suffix. */
20
20
  function fullArgv(runner) {
21
21
  return [...runnerToArgv(runner), '-i', 'in.beast2', '-o', 'out.beast2', 'body.beast2'];
@@ -64,5 +64,54 @@ describe('withRunnerVerbose', () => {
64
64
  assert.deepStrictEqual(withRunnerVerbose(runner, ['east-node'], true), ['east-node']);
65
65
  assert.deepStrictEqual(withRunnerVerbose(runner, [], true), []);
66
66
  });
67
+ it('inserts -v after the merge subcommand too', () => {
68
+ const runner = variant('east_c', { platforms: ['east-c-std'] });
69
+ const args = [...runnerToArgv(runner, 'merge'), '--union', '-i', 'p0.beast2', '-o', 'out.beast2'];
70
+ assert.deepStrictEqual(withRunnerVerbose(runner, args, true).slice(0, 3), ['east-c', 'merge', '-v']);
71
+ });
72
+ });
73
+ describe('runnerToArgv', () => {
74
+ for (const [tag, runner, bin] of KNOWN) {
75
+ it(`resolves the run and merge commands of ${tag}`, () => {
76
+ assert.deepStrictEqual(runnerToArgv(runner).slice(0, 2), [bin, 'run']);
77
+ assert.deepStrictEqual(runnerToArgv(runner, 'run'), runnerToArgv(runner));
78
+ const merge = runnerToArgv(runner, 'merge');
79
+ assert.deepStrictEqual(merge.slice(0, 2), [bin, 'merge']);
80
+ // The platform flags follow either command unchanged.
81
+ assert.deepStrictEqual(merge.slice(2), runnerToArgv(runner).slice(2));
82
+ });
83
+ }
84
+ it('resolves a custom runner to its own command, and has no merge command for it', () => {
85
+ const runner = variant('custom', { command: ['uv', 'run', 'east-py', 'run'] });
86
+ assert.deepStrictEqual(runnerToArgv(runner), ['uv', 'run', 'east-py', 'run']);
87
+ assert.throws(() => runnerToArgv(runner, 'merge'), { message: 'a custom runner has no merge command' });
88
+ });
89
+ });
90
+ describe('withRunnerLifeline', () => {
91
+ for (const [tag, runner, bin] of KNOWN) {
92
+ it(`inserts --exit-with-parent after the subcommand for ${tag}, on run and merge`, () => {
93
+ const args = fullArgv(runner);
94
+ const out = withRunnerLifeline(runner, args);
95
+ assert.deepStrictEqual(out.slice(0, 3), [bin, 'run', '--exit-with-parent']);
96
+ assert.deepStrictEqual(out.slice(3), args.slice(2));
97
+ const merge = [...runnerToArgv(runner, 'merge'), '--union', '-i', 'p0.beast2', '-o', 'out.beast2'];
98
+ assert.deepStrictEqual(withRunnerLifeline(runner, merge).slice(0, 3), [bin, 'merge', '--exit-with-parent']);
99
+ // Composed with -v, both sit ahead of the flags, in either order.
100
+ assert.deepStrictEqual(withRunnerVerbose(runner, withRunnerLifeline(runner, args), true).slice(0, 4), [bin, 'run', '-v', '--exit-with-parent']);
101
+ });
102
+ }
103
+ it('never splices the flag into a custom runner, which keeps an ignored stdin', () => {
104
+ const runner = variant('custom', { command: ['uv', 'run', 'east-py', 'run'] });
105
+ const args = fullArgv(runner);
106
+ assert.deepStrictEqual(withRunnerLifeline(runner, args), args);
107
+ });
108
+ it('is a no-op on a degenerate argv and does not mutate its input', () => {
109
+ const runner = variant('east_c', { platforms: [] });
110
+ assert.deepStrictEqual(withRunnerLifeline(runner, ['east-c']), ['east-c']);
111
+ const args = fullArgv(runner);
112
+ const before = [...args];
113
+ withRunnerLifeline(runner, args);
114
+ assert.deepStrictEqual(args, before);
115
+ });
67
116
  });
68
117
  //# sourceMappingURL=runner.spec.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"runner.spec.js","sourceRoot":"","sources":["../../src/runner.spec.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH;;;;;;;;;GASG;AAEH,OAAO,EAAE,QAAQ,EAAE,EAAE,EAAE,MAAM,WAAW,CAAC;AACzC,OAAO,KAAK,MAAM,MAAM,aAAa,CAAC;AACtC,OAAO,EAAE,OAAO,EAAE,MAAM,eAAe,CAAC;AACxC,OAAO,EAAE,YAAY,EAAE,iBAAiB,EAAoB,MAAM,aAAa,CAAC;AAEhF,iFAAiF;AAC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SAAS,EAAE,KAAK,CAAC,EAAE,CAAC,CAAC;QAC5F,MAAM,IAAI,GAAG,QAAQ,CAAC,MAAM,CAAC,CAAC;QAC9B,MAAM,CAAC,eAAe,CAAC,kBAAkB,CAAC,MAAM,EAAE,IAAI,CAAC,EAAE,IAAI,CAAC,CAAC;IACjE,CAAC,CAAC,CAAC;IAEH,EAAE,CAAC,+DAA+D,EAAE,GAAG,EAAE;QACvE,MAAM,MAAM,GAAG,OAAO,CAAC,QAAQ,EAAE,EAAE,SAAS,EAAE,EAAE,EAAE,CAAC,CAAC;QACpD,MAAM,CAAC,eAAe,CAAC,kBAAkB,CAAC,MAAM,EAAE,CAAC,QAAQ,CAAC,CAAC,EAAE,CAAC,QAAQ,CAAC,CAAC,CAAC;QAC3E,MAAM,IAAI,GAAG,QAAQ,CAAC,MAAM,CAAC,CAAC;QAC9B,MAAM,MAAM,GAAG,CAAC,GAAG,IAAI,CAAC,CAAC;QACzB,kBAAkB,CAAC,MAAM,EAAE,IAAI,CAAC,CAAC;QACjC,MAAM,CAAC,eAAe,CAAC,IAAI,EAAE,MAAM,CAAC,CAAC;IACvC,CAAC,CAAC,CAAC;AACL,CAAC,CAAC,CAAC"}
@@ -0,0 +1,97 @@
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
+ * The stream and merge commands (issue #770) — the builders of every argv a
7
+ * stream execution spawns (an authored `streamTask`'s) and of the merge
8
+ * command a partitioned task's keyed fan-in runs per key range, both built
9
+ * at export time and carried in the package like any other command IR.
10
+ */
11
+ import { EastIR } from '@elaraai/east';
12
+ import { type RunnerValue } from './runner.js';
13
+ /**
14
+ * How a stream execution's emit sink treats equal keys: `none` — a duplicate
15
+ * is an error; `function` — the merge IR (wire input 1) folds adjacent equal
16
+ * Dict keys, passed to the runner as `--merge`; `union` — adjacent equal Set
17
+ * elements collapse to the first, `--union`.
18
+ */
19
+ export type StreamMergeMode = 'none' | 'function' | 'union';
20
+ /**
21
+ * The shape of a stream command.
22
+ *
23
+ * @remarks
24
+ * The wire inputs a stream execution stages are laid out `[body IR, merge IR
25
+ * (function mode only), ...-i inputs]`; `stream` names whether the first of
26
+ * the `-i` inputs is the one the runner opens lazily.
27
+ */
28
+ export interface StreamCommandSpec {
29
+ /** The output collection kind the emit sink writes. */
30
+ emit: 'array' | 'set' | 'dict';
31
+ /** How equal keys fold — see {@link StreamMergeMode}. */
32
+ merge: StreamMergeMode;
33
+ /** The `-i` input the runner feeds lazily: none, or the first. */
34
+ stream: 'none' | 'first';
35
+ }
36
+ /**
37
+ * Builds the command IR of a stream execution: `(input_paths, output_path)
38
+ * -> argv`.
39
+ *
40
+ * The argv is `[...runner, '--emit', <emit>, '--merge' <merge IR path> |
41
+ * '--union', '--stream' '0' when the first -i input streams, '-i' <path> for
42
+ * each -i input, '-o', <output>, <body IR path>]` — the body IR is wire
43
+ * input 0, the merge IR wire input 1 in function mode, and the `-i` inputs
44
+ * follow. Built with `East.function` exactly as a task command is.
45
+ *
46
+ * @param runner - the stock runner the execution spawns
47
+ * @param spec - the emit kind, the merge mode and the streamed input
48
+ * @returns the command IR
49
+ *
50
+ * @example
51
+ * ```ts
52
+ * import { variant } from '@elaraai/east';
53
+ *
54
+ * const command = streamCommandIr(variant('east_c', { platforms: [] }), { emit: 'dict', merge: 'function', stream: 'first' });
55
+ * command.compile([])(['body.beast2', 'merge.beast2', 'a.beast2'], 'out.beast2');
56
+ * // ['east-c', 'run', '--emit', 'dict', '--merge', 'merge.beast2', '--stream', '0',
57
+ * // '-i', 'a.beast2', '-o', 'out.beast2', 'body.beast2']
58
+ * ```
59
+ */
60
+ export declare function streamCommandIr(runner: RunnerValue, spec: StreamCommandSpec): EastIR<[string[], string], string[]>;
61
+ /**
62
+ * Builds the command IR of a merge execution — the runner's `merge` command
63
+ * over sorted partials of one Set or Dict type, within a key range:
64
+ * `(input_paths, output_path) -> argv`.
65
+ *
66
+ * The argv is `[...runner merge, '--merge' <merge IR path> | '--union',
67
+ * '--range' <range path>, '-i' <path> for each partial, '-o', <output>]`. In
68
+ * `function` mode wire input 0 is the merge IR `(K, V, V) -> V`, wire input
69
+ * 1 the key range and the partials follow; in `union` mode wire input 0 is
70
+ * the key range and every other wire input is a partial. The key range is a
71
+ * blob of `Struct{from: Option<K>, to: Option<K>}` over the output's key
72
+ * type: only the keys in `[from, to)` merge, each partial sought to the
73
+ * segment owning `from`, and an absent bound is open — a component that
74
+ * merges whole takes the open range. Equal keys across partials fold in
75
+ * input order, and the output is byte-identical to what the runner's emit
76
+ * sink writes for the same entries emitted ascending. A partitioned task's
77
+ * SDK writes this IR into its metadata at export, and the orchestrator runs
78
+ * it as an ordinary execution per key range of a group of partials.
79
+ *
80
+ * @param runner - the stock runner whose `merge` command runs
81
+ * @param mode - `function` (a Dict output, folded with the merge IR) or
82
+ * `union` (a Set output, the first of equal elements standing)
83
+ * @returns the command IR
84
+ * @throws {Error} When the runner is `custom` — it has no merge command.
85
+ *
86
+ * @example
87
+ * ```ts
88
+ * import { variant } from '@elaraai/east';
89
+ *
90
+ * const command = mergeCommandIr(variant('east_c', { platforms: [] }), 'function');
91
+ * command.compile([])(['merge.beast2', 'range.beast2', 'p0.beast2', 'p1.beast2'], 'out.beast2');
92
+ * // ['east-c', 'merge', '--merge', 'merge.beast2', '--range', 'range.beast2',
93
+ * // '-i', 'p0.beast2', '-i', 'p1.beast2', '-o', 'out.beast2']
94
+ * ```
95
+ */
96
+ export declare function mergeCommandIr(runner: RunnerValue, mode: 'function' | 'union'): EastIR<[string[], string], string[]>;
97
+ //# sourceMappingURL=stream.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"stream.d.ts","sourceRoot":"","sources":["../../src/stream.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH;;;;;GAKG;AAEH,OAAO,EAAmB,MAAM,EAAc,MAAM,eAAe,CAAC;AACpE,OAAO,EAAgB,KAAK,WAAW,EAAE,MAAM,aAAa,CAAC;AAE7D;;;;;GAKG;AACH,MAAM,MAAM,eAAe,GAAG,MAAM,GAAG,UAAU,GAAG,OAAO,CAAC;AAE5D;;;;;;;GAOG;AACH,MAAM,WAAW,iBAAiB;IAChC,uDAAuD;IACvD,IAAI,EAAE,OAAO,GAAG,KAAK,GAAG,MAAM,CAAC;IAC/B,yDAAyD;IACzD,KAAK,EAAE,eAAe,CAAC;IACvB,kEAAkE;IAClE,MAAM,EAAE,MAAM,GAAG,OAAO,CAAC;CAC1B;AAED;;;;;;;;;;;;;;;;;;;;;;;GAuBG;AACH,wBAAgB,eAAe,CAAC,MAAM,EAAE,WAAW,EAAE,IAAI,EAAE,iBAAiB,GAAG,MAAM,CAAC,CAAC,MAAM,EAAE,EAAE,MAAM,CAAC,EAAE,MAAM,EAAE,CAAC,CAqClH;AAED;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAkCG;AACH,wBAAgB,cAAc,CAAC,MAAM,EAAE,WAAW,EAAE,IAAI,EAAE,UAAU,GAAG,OAAO,GAAG,MAAM,CAAC,CAAC,MAAM,EAAE,EAAE,MAAM,CAAC,EAAE,MAAM,EAAE,CAAC,CA+BpH"}