@elaraai/e3 1.0.108 → 1.0.110

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 (101) hide show
  1. package/dist/src/environment-capture.d.ts +27 -57
  2. package/dist/src/environment-capture.d.ts.map +1 -1
  3. package/dist/src/environment-capture.js +86 -455
  4. package/dist/src/environment-capture.js.map +1 -1
  5. package/dist/src/environment-capture.spec.js +215 -5
  6. package/dist/src/environment-capture.spec.js.map +1 -1
  7. package/dist/src/environment-npm-lock.d.ts +77 -0
  8. package/dist/src/environment-npm-lock.d.ts.map +1 -0
  9. package/dist/src/environment-npm-lock.js +209 -0
  10. package/dist/src/environment-npm-lock.js.map +1 -0
  11. package/dist/src/environment-uv-lock.d.ts +312 -0
  12. package/dist/src/environment-uv-lock.d.ts.map +1 -0
  13. package/dist/src/environment-uv-lock.js +494 -0
  14. package/dist/src/environment-uv-lock.js.map +1 -0
  15. package/dist/src/export.d.ts.map +1 -1
  16. package/dist/src/export.js +25 -9
  17. package/dist/src/export.js.map +1 -1
  18. package/dist/src/export.spec.js +25 -3
  19. package/dist/src/export.spec.js.map +1 -1
  20. package/dist/src/function.d.ts +136 -57
  21. package/dist/src/function.d.ts.map +1 -1
  22. package/dist/src/function.js +47 -12
  23. package/dist/src/function.js.map +1 -1
  24. package/dist/src/function.spec.d.ts +3 -1
  25. package/dist/src/function.spec.d.ts.map +1 -1
  26. package/dist/src/function.spec.js +246 -3
  27. package/dist/src/function.spec.js.map +1 -1
  28. package/dist/src/index-input.d.ts +162 -0
  29. package/dist/src/index-input.d.ts.map +1 -0
  30. package/dist/src/index-input.js +216 -0
  31. package/dist/src/index-input.js.map +1 -0
  32. package/dist/src/index-input.spec.d.ts +6 -0
  33. package/dist/src/index-input.spec.d.ts.map +1 -0
  34. package/dist/src/index-input.spec.js +269 -0
  35. package/dist/src/index-input.spec.js.map +1 -0
  36. package/dist/src/index-read.d.ts +428 -0
  37. package/dist/src/index-read.d.ts.map +1 -0
  38. package/dist/src/index-read.js +747 -0
  39. package/dist/src/index-read.js.map +1 -0
  40. package/dist/src/index-read.spec.d.ts +6 -0
  41. package/dist/src/index-read.spec.d.ts.map +1 -0
  42. package/dist/src/index-read.spec.js +1447 -0
  43. package/dist/src/index-read.spec.js.map +1 -0
  44. package/dist/src/index.d.ts +12 -5
  45. package/dist/src/index.d.ts.map +1 -1
  46. package/dist/src/index.js +6 -3
  47. package/dist/src/index.js.map +1 -1
  48. package/dist/src/package.d.ts.map +1 -1
  49. package/dist/src/package.js +3 -4
  50. package/dist/src/package.js.map +1 -1
  51. package/dist/src/record-area.d.ts +12 -0
  52. package/dist/src/record-area.d.ts.map +1 -1
  53. package/dist/src/record-area.js +26 -0
  54. package/dist/src/record-area.js.map +1 -1
  55. package/dist/src/record-area.spec.js +4 -14
  56. package/dist/src/record-area.spec.js.map +1 -1
  57. package/dist/src/record-builders.d.ts +39 -14
  58. package/dist/src/record-builders.d.ts.map +1 -1
  59. package/dist/src/record-builders.js.map +1 -1
  60. package/dist/src/record-entries.spec.js +2 -15
  61. package/dist/src/record-entries.spec.js.map +1 -1
  62. package/dist/src/record-index.d.ts +11 -5
  63. package/dist/src/record-index.d.ts.map +1 -1
  64. package/dist/src/record-index.js.map +1 -1
  65. package/dist/src/record-interval.d.ts +7 -0
  66. package/dist/src/record-interval.d.ts.map +1 -1
  67. package/dist/src/record-interval.js +7 -0
  68. package/dist/src/record-interval.js.map +1 -1
  69. package/dist/src/record-nested-programs.d.ts +63 -511
  70. package/dist/src/record-nested-programs.d.ts.map +1 -1
  71. package/dist/src/record-nested-programs.js +403 -222
  72. package/dist/src/record-nested-programs.js.map +1 -1
  73. package/dist/src/record-nested.d.ts +60 -10
  74. package/dist/src/record-nested.d.ts.map +1 -1
  75. package/dist/src/record-nested.js +65 -23
  76. package/dist/src/record-nested.js.map +1 -1
  77. package/dist/src/record-nested.spec.js +113 -34
  78. package/dist/src/record-nested.spec.js.map +1 -1
  79. package/dist/src/record-series.spec.js +6 -31
  80. package/dist/src/record-series.spec.js.map +1 -1
  81. package/dist/src/record.d.ts +9 -0
  82. package/dist/src/record.d.ts.map +1 -1
  83. package/dist/src/record.js +14 -0
  84. package/dist/src/record.js.map +1 -1
  85. package/dist/src/runner.d.ts +14 -2
  86. package/dist/src/runner.d.ts.map +1 -1
  87. package/dist/src/runner.js +16 -4
  88. package/dist/src/runner.js.map +1 -1
  89. package/dist/src/stock-platforms.spec.js +7 -1
  90. package/dist/src/stock-platforms.spec.js.map +1 -1
  91. package/dist/src/task.d.ts +28 -16
  92. package/dist/src/task.d.ts.map +1 -1
  93. package/dist/src/task.js +33 -5
  94. package/dist/src/task.js.map +1 -1
  95. package/dist/src/test-helpers.d.ts +35 -0
  96. package/dist/src/test-helpers.d.ts.map +1 -0
  97. package/dist/src/test-helpers.js +56 -0
  98. package/dist/src/test-helpers.js.map +1 -0
  99. package/dist/src/types.d.ts +86 -13
  100. package/dist/src/types.d.ts.map +1 -1
  101. package/package.json +3 -3
@@ -2,6 +2,9 @@
2
2
  * Copyright (c) 2025 Elara AI Pty Ltd
3
3
  * Dual-licensed under AGPL-3.0 and commercial license. See LICENSE for details.
4
4
  */
5
+ import { type EnvironmentDecl } from './environment.js';
6
+ export { canonicalPythonName, pythonLeftOut, pythonLockSettings, pythonMemberSources, pythonRequires, pythonWorkspaceMember, readRequiredDistribution, type UvLock, type UvLockPackage } from './environment-uv-lock.js';
7
+ export { nodeWorkspaceMember } from './environment-npm-lock.js';
5
8
  /**
6
9
  * One environment-capture progress event (#311) — emitted after each member
7
10
  * artifact build (`uv build --sdist` / `npm pack`), so callers can surface
@@ -17,63 +20,18 @@ export interface CaptureEvent {
17
20
  }
18
21
  /** Capture progress callback (#311). */
19
22
  export type CaptureEventFn = (event: CaptureEvent) => void;
20
- import { type EnvironmentDecl } from './environment.js';
21
23
  /**
22
- * The local uv-workspace member a name refers to — the package a `{ custom }`
23
- * platform or an `East.importFunction(pkg, …)` names (#652) — resolved the
24
- * way {@link captureAutoEnvironment} resolves it: the governing `uv.lock`
25
- * above `anchorDir`, matched by PEP 503 canonical name, local sources only.
26
- *
27
- * @param name - The package name as referenced (import-style or canonical)
28
- * @param anchorDir - Directory the workspace is resolved from (the export cwd)
29
- * @param owner - The referencing task/function name, for error messages
30
- * @returns The member's directory and its `pyproject.toml` version, or null
31
- * when there is no uv workspace above `anchorDir` or the name is not a
32
- * local member (a registry package, a typo)
33
- */
34
- export declare function pythonWorkspaceMember(name: string, anchorDir: string, owner: string): {
35
- dir: string;
36
- version: string | null;
37
- } | null;
38
- /**
39
- * Where a python workspace member's code can come from (#1459): the governing
40
- * workspace's root — whose `uv.lock` and `pyproject.toml` pin everything else
41
- * — and the directories of the member and of every local package it depends
42
- * on, transitively, as {@link captureAutoEnvironment} walks them. What the
43
- * export cache keys a member's manifests on.
44
- *
45
- * Unlike the environment's walk this refuses nothing: a virtual package's
46
- * directory counts, and a registry or archive package is pinned by the lock.
47
- *
48
- * @param name - The package name as referenced (import-style or canonical)
49
- * @param anchorDir - Directory the workspace is resolved from (the export cwd)
50
- * @param owner - The referencing task/function name, for error messages
51
- * @returns The workspace root and the closure's directories, sorted, or null
52
- * when there is no uv workspace above `anchorDir` or the name is not a
53
- * local member
54
- */
55
- export declare function pythonMemberSources(name: string, anchorDir: string, owner: string): {
56
- root: string;
57
- dirs: string[];
58
- } | null;
59
- /**
60
- * The local npm-workspace member a name refers to — the package a `{ custom }`
61
- * platform or an `East.importFunction(pkg, …)` names (#652) — resolved the
62
- * way {@link captureAutoEnvironment} resolves it: the governing npm lockfile
63
- * above `anchorDir`, matched by `package.json` name, workspace members only
64
- * (never an installed dependency). The python twin is
65
- * {@link pythonWorkspaceMember}.
66
- *
67
- * @param name - The package name as referenced (`@scope/name` or bare)
68
- * @param anchorDir - Directory the workspace is resolved from (the export cwd)
69
- * @returns The member's directory and its `package.json` version, or null
70
- * when there is no npm workspace above `anchorDir` or the name is not a
71
- * local member (a registry package, a typo)
24
+ * The sdists an export built of each local python package, by the package's
25
+ * directory: built once in an export, however many environments it rides in.
26
+ * The environments of one declaration whose runners name different stock
27
+ * platforms differ in what they require, and share their members' builds, so
28
+ * one that names the same distributions is the same spec, byte for byte, even
29
+ * from a build backend whose sdists are not reproducible.
72
30
  */
73
- export declare function nodeWorkspaceMember(name: string, anchorDir: string): {
74
- dir: string;
75
- version: string | null;
76
- } | null;
31
+ export type BuiltSdists = Map<string, ReadonlyArray<{
32
+ filename: string;
33
+ hash: string;
34
+ }>>;
77
35
  /**
78
36
  * Derive an EnvironmentSpec from a task/function's RUNNER platform references,
79
37
  * for tasks that declare no explicit `environment`. Resolves each `{ custom }`
@@ -88,10 +46,16 @@ export declare function nodeWorkspaceMember(name: string, anchorDir: string): {
88
46
  * @param anchorDir - Directory the workspace is resolved from (the export cwd)
89
47
  * @param owner - The declaring task/function name, for error messages
90
48
  * @param addBlob - Stores a blob in the bundle's object store, returning its hash
49
+ * @param onEvent - Told each member's artifact as it is built
50
+ * @param platforms - The stock platform packages the runner names beside its
51
+ * custom ones (`east-py-std`): a python workspace member's environment
52
+ * installs their distributions too
53
+ * @param built - The sdists the export built already, which it adds to: each
54
+ * local python package is built once in an export ({@link BuiltSdists})
91
55
  * @returns The beast2-encoded EnvironmentSpec, or null when nothing local is
92
56
  * referenced (no workspace, or every platform is a registry/first-party package)
93
57
  */
94
- export declare function captureAutoEnvironment(runtime: string, customNames: string[], anchorDir: string, owner: string, addBlob: (data: Buffer) => string, onEvent?: CaptureEventFn): Uint8Array | null;
58
+ export declare function captureAutoEnvironment(runtime: string, customNames: string[], anchorDir: string, owner: string, addBlob: (data: Buffer) => string, onEvent?: CaptureEventFn, platforms?: readonly string[], built?: BuiltSdists): Uint8Array | null;
95
59
  /**
96
60
  * Resolves an environment declaration to an encoded {@link EnvironmentSpec}
97
61
  * at package export time.
@@ -104,8 +68,14 @@ export declare function captureAutoEnvironment(runtime: string, customNames: str
104
68
  * @param decl - The declaration to resolve
105
69
  * @param owner - The declaring task/function name, for error messages
106
70
  * @param addBlob - Stores a blob in the bundle's object store, returning its hash
71
+ * @param onEvent - Told each member's artifact as it is built
72
+ * @param platforms - The stock platform packages the declaring task's runner
73
+ * names (`east-py-std`): the environment of a python workspace's member
74
+ * installs their distributions too
75
+ * @param built - The sdists the export built already, which it adds to: each
76
+ * local python package is built once in an export ({@link BuiltSdists})
107
77
  * @returns The beast2-encoded EnvironmentSpec bytes
108
78
  * @throws {Error} if the project is missing its manifest/lockfile or the build fails
109
79
  */
110
- export declare function captureEnvironment(decl: EnvironmentDecl, owner: string, addBlob: (data: Buffer) => string, onEvent?: CaptureEventFn): Uint8Array;
80
+ export declare function captureEnvironment(decl: EnvironmentDecl, owner: string, addBlob: (data: Buffer) => string, onEvent?: CaptureEventFn, platforms?: readonly string[], built?: BuiltSdists): Uint8Array;
111
81
  //# sourceMappingURL=environment-capture.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"environment-capture.d.ts","sourceRoot":"","sources":["../../src/environment-capture.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAuBH;;;;GAIG;AACH,MAAM,WAAW,YAAY;IAC3B,wCAAwC;IACxC,MAAM,EAAE,MAAM,CAAC;IACf,iFAAiF;IACjF,IAAI,EAAE,MAAM,CAAC;IACb,qDAAqD;IACrD,KAAK,EAAE,MAAM,CAAC;CACf;AAED,wCAAwC;AACxC,MAAM,MAAM,cAAc,GAAG,CAAC,KAAK,EAAE,YAAY,KAAK,IAAI,CAAC;AAK3D,OAAO,EAA2B,KAAK,eAAe,EAAE,MAAM,kBAAkB,CAAC;AA4QjF;;;;;;;;;;;;GAYG;AACH,wBAAgB,qBAAqB,CAAC,IAAI,EAAE,MAAM,EAAE,SAAS,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,GAAG;IAAE,GAAG,EAAE,MAAM,CAAC;IAAC,OAAO,EAAE,MAAM,GAAG,IAAI,CAAA;CAAE,GAAG,IAAI,CAgBpI;AAED;;;;;;;;;;;;;;;;GAgBG;AACH,wBAAg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