@platforma-sdk/package-builder-lib 1.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (134) hide show
  1. package/assets/conda-dockerfile.template +45 -0
  2. package/assets/python-dockerfile.template +22 -0
  3. package/dist/_virtual/_rolldown/runtime.cjs +33 -0
  4. package/dist/_virtual/_rolldown/runtime.js +13 -0
  5. package/dist/core/archive.cjs +52 -0
  6. package/dist/core/archive.cjs.map +1 -0
  7. package/dist/core/archive.js +47 -0
  8. package/dist/core/archive.js.map +1 -0
  9. package/dist/core/conda/builder.cjs +226 -0
  10. package/dist/core/conda/builder.cjs.map +1 -0
  11. package/dist/core/conda/builder.js +220 -0
  12. package/dist/core/conda/builder.js.map +1 -0
  13. package/dist/core/conda/validate-spec.cjs +76 -0
  14. package/dist/core/conda/validate-spec.cjs.map +1 -0
  15. package/dist/core/conda/validate-spec.js +73 -0
  16. package/dist/core/conda/validate-spec.js.map +1 -0
  17. package/dist/core/core.cjs +403 -0
  18. package/dist/core/core.cjs.map +1 -0
  19. package/dist/core/core.d.ts +82 -0
  20. package/dist/core/core.d.ts.map +1 -0
  21. package/dist/core/core.js +397 -0
  22. package/dist/core/core.js.map +1 -0
  23. package/dist/core/docker-conda.cjs +75 -0
  24. package/dist/core/docker-conda.cjs.map +1 -0
  25. package/dist/core/docker-conda.js +71 -0
  26. package/dist/core/docker-conda.js.map +1 -0
  27. package/dist/core/docker-python.cjs +147 -0
  28. package/dist/core/docker-python.cjs.map +1 -0
  29. package/dist/core/docker-python.js +144 -0
  30. package/dist/core/docker-python.js.map +1 -0
  31. package/dist/core/docker.cjs +223 -0
  32. package/dist/core/docker.cjs.map +1 -0
  33. package/dist/core/docker.js +207 -0
  34. package/dist/core/docker.js.map +1 -0
  35. package/dist/core/envs.cjs +58 -0
  36. package/dist/core/envs.cjs.map +1 -0
  37. package/dist/core/envs.d.ts +26 -0
  38. package/dist/core/envs.d.ts.map +1 -0
  39. package/dist/core/envs.js +51 -0
  40. package/dist/core/envs.js.map +1 -0
  41. package/dist/core/package-info.cjs +450 -0
  42. package/dist/core/package-info.cjs.map +1 -0
  43. package/dist/core/package-info.d.ts +57 -0
  44. package/dist/core/package-info.d.ts.map +1 -0
  45. package/dist/core/package-info.js +447 -0
  46. package/dist/core/package-info.js.map +1 -0
  47. package/dist/core/paths.cjs +15 -0
  48. package/dist/core/paths.cjs.map +1 -0
  49. package/dist/core/paths.js +14 -0
  50. package/dist/core/paths.js.map +1 -0
  51. package/dist/core/resolver.cjs +99 -0
  52. package/dist/core/resolver.cjs.map +1 -0
  53. package/dist/core/resolver.js +95 -0
  54. package/dist/core/resolver.js.map +1 -0
  55. package/dist/core/schemas/artifacts.cjs +136 -0
  56. package/dist/core/schemas/artifacts.cjs.map +1 -0
  57. package/dist/core/schemas/artifacts.d.ts +280 -0
  58. package/dist/core/schemas/artifacts.d.ts.map +1 -0
  59. package/dist/core/schemas/artifacts.js +122 -0
  60. package/dist/core/schemas/artifacts.js.map +1 -0
  61. package/dist/core/schemas/entrypoints.cjs +43 -0
  62. package/dist/core/schemas/entrypoints.cjs.map +1 -0
  63. package/dist/core/schemas/entrypoints.d.ts +32 -0
  64. package/dist/core/schemas/entrypoints.d.ts.map +1 -0
  65. package/dist/core/schemas/entrypoints.js +41 -0
  66. package/dist/core/schemas/entrypoints.js.map +1 -0
  67. package/dist/core/schemas/sw-json.cjs +111 -0
  68. package/dist/core/schemas/sw-json.cjs.map +1 -0
  69. package/dist/core/schemas/sw-json.js +110 -0
  70. package/dist/core/schemas/sw-json.js.map +1 -0
  71. package/dist/core/storage.cjs +86 -0
  72. package/dist/core/storage.cjs.map +1 -0
  73. package/dist/core/storage.js +83 -0
  74. package/dist/core/storage.js.map +1 -0
  75. package/dist/core/sw-json-render.cjs +327 -0
  76. package/dist/core/sw-json-render.cjs.map +1 -0
  77. package/dist/core/sw-json-render.js +322 -0
  78. package/dist/core/sw-json-render.js.map +1 -0
  79. package/dist/core/util.cjs +313 -0
  80. package/dist/core/util.cjs.map +1 -0
  81. package/dist/core/util.d.ts +66 -0
  82. package/dist/core/util.d.ts.map +1 -0
  83. package/dist/core/util.js +281 -0
  84. package/dist/core/util.js.map +1 -0
  85. package/dist/defaults.cjs +54 -0
  86. package/dist/defaults.cjs.map +1 -0
  87. package/dist/defaults.d.ts +21 -0
  88. package/dist/defaults.d.ts.map +1 -0
  89. package/dist/defaults.js +37 -0
  90. package/dist/defaults.js.map +1 -0
  91. package/dist/index.cjs +31 -0
  92. package/dist/index.cjs.map +1 -0
  93. package/dist/index.d.ts +20 -0
  94. package/dist/index.d.ts.map +1 -0
  95. package/dist/index.js +12 -0
  96. package/dist/index.js.map +1 -0
  97. package/package.json +56 -0
  98. package/src/__test__/Dockerfile +1 -0
  99. package/src/__test__/docker.test.ts +67 -0
  100. package/src/__test__/package.json +39 -0
  101. package/src/__test__/python-example/main.py +1 -0
  102. package/src/__test__/python-example/requirements.txt +0 -0
  103. package/src/__test__/vite.config.mts +7 -0
  104. package/src/core/__tests__/docker-conda.test.ts +145 -0
  105. package/src/core/__tests__/docker-entrypoint-generation.test.ts +119 -0
  106. package/src/core/__tests__/docker-python.test.ts +374 -0
  107. package/src/core/__tests__/publish-docker-images.test.ts +309 -0
  108. package/src/core/archive.ts +102 -0
  109. package/src/core/conda/builder.test.ts +71 -0
  110. package/src/core/conda/builder.ts +384 -0
  111. package/src/core/conda/validate-spec.test.ts +213 -0
  112. package/src/core/conda/validate-spec.ts +107 -0
  113. package/src/core/core.ts +835 -0
  114. package/src/core/docker-conda.ts +149 -0
  115. package/src/core/docker-python.ts +283 -0
  116. package/src/core/docker.ts +300 -0
  117. package/src/core/envs.ts +31 -0
  118. package/src/core/package-info.test.ts +82 -0
  119. package/src/core/package-info.ts +843 -0
  120. package/src/core/paths.ts +16 -0
  121. package/src/core/resolver.ts +195 -0
  122. package/src/core/schemas/artifacts.test.ts +72 -0
  123. package/src/core/schemas/artifacts.ts +279 -0
  124. package/src/core/schemas/entrypoints.test.ts +171 -0
  125. package/src/core/schemas/entrypoints.ts +150 -0
  126. package/src/core/schemas/sw-json.ts +216 -0
  127. package/src/core/schemas/test-artifacts.ts +362 -0
  128. package/src/core/storage.ts +125 -0
  129. package/src/core/sw-json-render.test.ts +215 -0
  130. package/src/core/sw-json-render.ts +682 -0
  131. package/src/core/util.ts +390 -0
  132. package/src/defaults.ts +38 -0
  133. package/src/index.ts +31 -0
  134. package/src/requirements.txt +1 -0
@@ -0,0 +1,280 @@
1
+ import { z } from "zod/v4";
2
+
3
+ //#region src/core/schemas/artifacts.d.ts
4
+ declare const artifactTypes: readonly ["asset", "environment", "binary", "java", "python", "R", "docker", "conda"];
5
+ type artifactType = (typeof artifactTypes)[number];
6
+ declare const registrySchema: z.ZodObject<{
7
+ name: z.ZodString;
8
+ downloadURL: z.ZodOptional<z.ZodString>;
9
+ storageURL: z.ZodOptional<z.ZodString>;
10
+ }, z.core.$strict>;
11
+ type registry = z.infer<typeof registrySchema>;
12
+ declare const assetSchema: z.ZodObject<{
13
+ version: z.ZodOptional<z.ZodString>;
14
+ name: z.ZodOptional<z.ZodString>;
15
+ registry: z.ZodDefault<z.ZodUnion<readonly [z.ZodString, z.ZodObject<{
16
+ name: z.ZodString;
17
+ downloadURL: z.ZodOptional<z.ZodString>;
18
+ storageURL: z.ZodOptional<z.ZodString>;
19
+ }, z.core.$strict>]>>;
20
+ root: z.ZodString;
21
+ type: z.ZodLiteral<"asset">;
22
+ }, z.core.$strict>;
23
+ type assetType = z.infer<typeof assetSchema>;
24
+ declare const environmentSchema: z.ZodObject<{
25
+ version: z.ZodOptional<z.ZodString>;
26
+ name: z.ZodOptional<z.ZodString>;
27
+ registry: z.ZodDefault<z.ZodUnion<readonly [z.ZodString, z.ZodObject<{
28
+ name: z.ZodString;
29
+ downloadURL: z.ZodOptional<z.ZodString>;
30
+ storageURL: z.ZodOptional<z.ZodString>;
31
+ }, z.core.$strict>]>>;
32
+ roots: z.ZodRecord<z.ZodEnum<{
33
+ "linux-x64": "linux-x64";
34
+ "linux-aarch64": "linux-aarch64";
35
+ "macosx-x64": "macosx-x64";
36
+ "macosx-aarch64": "macosx-aarch64";
37
+ "windows-x64": "windows-x64";
38
+ "windows-aarch64": "windows-aarch64";
39
+ }> & z.core.$partial, z.ZodString>;
40
+ type: z.ZodLiteral<"environment">;
41
+ runtime: z.ZodEnum<{
42
+ java: "java";
43
+ python: "python";
44
+ R: "R";
45
+ }>;
46
+ "r-version": z.ZodOptional<z.ZodString>;
47
+ "python-version": z.ZodOptional<z.ZodString>;
48
+ "java-version": z.ZodOptional<z.ZodString>;
49
+ envVars: z.ZodOptional<z.ZodArray<z.ZodString>>;
50
+ binDir: z.ZodString;
51
+ }, z.core.$strip>;
52
+ type environmentType = z.infer<typeof environmentSchema>;
53
+ declare const binarySchema: z.ZodObject<{
54
+ version: z.ZodOptional<z.ZodString>;
55
+ name: z.ZodOptional<z.ZodString>;
56
+ registry: z.ZodDefault<z.ZodUnion<readonly [z.ZodString, z.ZodObject<{
57
+ name: z.ZodString;
58
+ downloadURL: z.ZodOptional<z.ZodString>;
59
+ storageURL: z.ZodOptional<z.ZodString>;
60
+ }, z.core.$strict>]>>;
61
+ roots: z.ZodRecord<z.ZodEnum<{
62
+ "linux-x64": "linux-x64";
63
+ "linux-aarch64": "linux-aarch64";
64
+ "macosx-x64": "macosx-x64";
65
+ "macosx-aarch64": "macosx-aarch64";
66
+ "windows-x64": "windows-x64";
67
+ "windows-aarch64": "windows-aarch64";
68
+ }> & z.core.$partial, z.ZodString>;
69
+ type: z.ZodLiteral<"binary">;
70
+ }, z.core.$strip>;
71
+ type binaryType = z.infer<typeof binarySchema>;
72
+ declare const javaSchema: z.ZodObject<{
73
+ version: z.ZodOptional<z.ZodString>;
74
+ name: z.ZodOptional<z.ZodString>;
75
+ registry: z.ZodDefault<z.ZodUnion<readonly [z.ZodString, z.ZodObject<{
76
+ name: z.ZodString;
77
+ downloadURL: z.ZodOptional<z.ZodString>;
78
+ storageURL: z.ZodOptional<z.ZodString>;
79
+ }, z.core.$strict>]>>;
80
+ root: z.ZodString;
81
+ type: z.ZodLiteral<"java">;
82
+ environment: z.ZodString;
83
+ }, z.core.$strip>;
84
+ type javaType = z.infer<typeof javaSchema>;
85
+ declare const pythonSchema: z.ZodObject<{
86
+ version: z.ZodOptional<z.ZodString>;
87
+ name: z.ZodOptional<z.ZodString>;
88
+ registry: z.ZodDefault<z.ZodUnion<readonly [z.ZodString, z.ZodObject<{
89
+ name: z.ZodString;
90
+ downloadURL: z.ZodOptional<z.ZodString>;
91
+ storageURL: z.ZodOptional<z.ZodString>;
92
+ }, z.core.$strict>]>>;
93
+ root: z.ZodString;
94
+ "docker-registry": z.ZodDefault<z.ZodString>;
95
+ pkg: z.ZodDefault<z.ZodString>;
96
+ type: z.ZodLiteral<"python">;
97
+ environment: z.ZodString;
98
+ dependencies: z.ZodOptional<z.ZodDiscriminatedUnion<[z.ZodObject<{
99
+ toolset: z.ZodLiteral<"pip">;
100
+ requirements: z.ZodString;
101
+ }, z.core.$strict>]>>;
102
+ }, z.core.$strip>;
103
+ type pythonType = z.infer<typeof pythonSchema>;
104
+ declare const rSchema: z.ZodObject<{
105
+ version: z.ZodOptional<z.ZodString>;
106
+ name: z.ZodOptional<z.ZodString>;
107
+ registry: z.ZodDefault<z.ZodUnion<readonly [z.ZodString, z.ZodObject<{
108
+ name: z.ZodString;
109
+ downloadURL: z.ZodOptional<z.ZodString>;
110
+ storageURL: z.ZodOptional<z.ZodString>;
111
+ }, z.core.$strict>]>>;
112
+ root: z.ZodString;
113
+ type: z.ZodLiteral<"R">;
114
+ environment: z.ZodString;
115
+ }, z.core.$strip>;
116
+ type rType = z.infer<typeof rSchema>;
117
+ declare const condaSchema: z.ZodObject<{
118
+ version: z.ZodOptional<z.ZodString>;
119
+ name: z.ZodOptional<z.ZodString>;
120
+ registry: z.ZodDefault<z.ZodUnion<readonly [z.ZodString, z.ZodObject<{
121
+ name: z.ZodString;
122
+ downloadURL: z.ZodOptional<z.ZodString>;
123
+ storageURL: z.ZodOptional<z.ZodString>;
124
+ }, z.core.$strict>]>>;
125
+ roots: z.ZodRecord<z.ZodEnum<{
126
+ "linux-x64": "linux-x64";
127
+ "linux-aarch64": "linux-aarch64";
128
+ "macosx-x64": "macosx-x64";
129
+ "macosx-aarch64": "macosx-aarch64";
130
+ "windows-x64": "windows-x64";
131
+ "windows-aarch64": "windows-aarch64";
132
+ }> & z.core.$partial, z.ZodString>;
133
+ "docker-registry": z.ZodDefault<z.ZodString>;
134
+ pkg: z.ZodDefault<z.ZodString>;
135
+ type: z.ZodLiteral<"conda">;
136
+ "micromamba-version": z.ZodDefault<z.ZodString>;
137
+ "conda-root-dir": z.ZodDefault<z.ZodString>;
138
+ spec: z.ZodDefault<z.ZodString>;
139
+ }, z.core.$strip>;
140
+ type condaType = z.infer<typeof condaSchema>;
141
+ declare const dockerSchema: z.ZodObject<{
142
+ type: z.ZodLiteral<"docker">;
143
+ registry: z.ZodDefault<z.ZodString>;
144
+ context: z.ZodString;
145
+ dockerfile: z.ZodDefault<z.ZodString>;
146
+ pkg: z.ZodDefault<z.ZodString>;
147
+ }, z.core.$strip>;
148
+ type dockerType = z.infer<typeof dockerSchema>;
149
+ declare const anyArtifactSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
150
+ version: z.ZodOptional<z.ZodString>;
151
+ name: z.ZodOptional<z.ZodString>;
152
+ registry: z.ZodDefault<z.ZodUnion<readonly [z.ZodString, z.ZodObject<{
153
+ name: z.ZodString;
154
+ downloadURL: z.ZodOptional<z.ZodString>;
155
+ storageURL: z.ZodOptional<z.ZodString>;
156
+ }, z.core.$strict>]>>;
157
+ root: z.ZodString;
158
+ type: z.ZodLiteral<"asset">;
159
+ }, z.core.$strict>, z.ZodObject<{
160
+ version: z.ZodOptional<z.ZodString>;
161
+ name: z.ZodOptional<z.ZodString>;
162
+ registry: z.ZodDefault<z.ZodUnion<readonly [z.ZodString, z.ZodObject<{
163
+ name: z.ZodString;
164
+ downloadURL: z.ZodOptional<z.ZodString>;
165
+ storageURL: z.ZodOptional<z.ZodString>;
166
+ }, z.core.$strict>]>>;
167
+ roots: z.ZodRecord<z.ZodEnum<{
168
+ "linux-x64": "linux-x64";
169
+ "linux-aarch64": "linux-aarch64";
170
+ "macosx-x64": "macosx-x64";
171
+ "macosx-aarch64": "macosx-aarch64";
172
+ "windows-x64": "windows-x64";
173
+ "windows-aarch64": "windows-aarch64";
174
+ }> & z.core.$partial, z.ZodString>;
175
+ type: z.ZodLiteral<"environment">;
176
+ runtime: z.ZodEnum<{
177
+ java: "java";
178
+ python: "python";
179
+ R: "R";
180
+ }>;
181
+ "r-version": z.ZodOptional<z.ZodString>;
182
+ "python-version": z.ZodOptional<z.ZodString>;
183
+ "java-version": z.ZodOptional<z.ZodString>;
184
+ envVars: z.ZodOptional<z.ZodArray<z.ZodString>>;
185
+ binDir: z.ZodString;
186
+ }, z.core.$strip>, z.ZodObject<{
187
+ version: z.ZodOptional<z.ZodString>;
188
+ name: z.ZodOptional<z.ZodString>;
189
+ registry: z.ZodDefault<z.ZodUnion<readonly [z.ZodString, z.ZodObject<{
190
+ name: z.ZodString;
191
+ downloadURL: z.ZodOptional<z.ZodString>;
192
+ storageURL: z.ZodOptional<z.ZodString>;
193
+ }, z.core.$strict>]>>;
194
+ roots: z.ZodRecord<z.ZodEnum<{
195
+ "linux-x64": "linux-x64";
196
+ "linux-aarch64": "linux-aarch64";
197
+ "macosx-x64": "macosx-x64";
198
+ "macosx-aarch64": "macosx-aarch64";
199
+ "windows-x64": "windows-x64";
200
+ "windows-aarch64": "windows-aarch64";
201
+ }> & z.core.$partial, z.ZodString>;
202
+ type: z.ZodLiteral<"binary">;
203
+ }, z.core.$strip>, z.ZodObject<{
204
+ version: z.ZodOptional<z.ZodString>;
205
+ name: z.ZodOptional<z.ZodString>;
206
+ registry: z.ZodDefault<z.ZodUnion<readonly [z.ZodString, z.ZodObject<{
207
+ name: z.ZodString;
208
+ downloadURL: z.ZodOptional<z.ZodString>;
209
+ storageURL: z.ZodOptional<z.ZodString>;
210
+ }, z.core.$strict>]>>;
211
+ root: z.ZodString;
212
+ type: z.ZodLiteral<"java">;
213
+ environment: z.ZodString;
214
+ }, z.core.$strip>, z.ZodObject<{
215
+ version: z.ZodOptional<z.ZodString>;
216
+ name: z.ZodOptional<z.ZodString>;
217
+ registry: z.ZodDefault<z.ZodUnion<readonly [z.ZodString, z.ZodObject<{
218
+ name: z.ZodString;
219
+ downloadURL: z.ZodOptional<z.ZodString>;
220
+ storageURL: z.ZodOptional<z.ZodString>;
221
+ }, z.core.$strict>]>>;
222
+ root: z.ZodString;
223
+ "docker-registry": z.ZodDefault<z.ZodString>;
224
+ pkg: z.ZodDefault<z.ZodString>;
225
+ type: z.ZodLiteral<"python">;
226
+ environment: z.ZodString;
227
+ dependencies: z.ZodOptional<z.ZodDiscriminatedUnion<[z.ZodObject<{
228
+ toolset: z.ZodLiteral<"pip">;
229
+ requirements: z.ZodString;
230
+ }, z.core.$strict>]>>;
231
+ }, z.core.$strip>, z.ZodObject<{
232
+ version: z.ZodOptional<z.ZodString>;
233
+ name: z.ZodOptional<z.ZodString>;
234
+ registry: z.ZodDefault<z.ZodUnion<readonly [z.ZodString, z.ZodObject<{
235
+ name: z.ZodString;
236
+ downloadURL: z.ZodOptional<z.ZodString>;
237
+ storageURL: z.ZodOptional<z.ZodString>;
238
+ }, z.core.$strict>]>>;
239
+ root: z.ZodString;
240
+ type: z.ZodLiteral<"R">;
241
+ environment: z.ZodString;
242
+ }, z.core.$strip>, z.ZodObject<{
243
+ version: z.ZodOptional<z.ZodString>;
244
+ name: z.ZodOptional<z.ZodString>;
245
+ registry: z.ZodDefault<z.ZodUnion<readonly [z.ZodString, z.ZodObject<{
246
+ name: z.ZodString;
247
+ downloadURL: z.ZodOptional<z.ZodString>;
248
+ storageURL: z.ZodOptional<z.ZodString>;
249
+ }, z.core.$strict>]>>;
250
+ roots: z.ZodRecord<z.ZodEnum<{
251
+ "linux-x64": "linux-x64";
252
+ "linux-aarch64": "linux-aarch64";
253
+ "macosx-x64": "macosx-x64";
254
+ "macosx-aarch64": "macosx-aarch64";
255
+ "windows-x64": "windows-x64";
256
+ "windows-aarch64": "windows-aarch64";
257
+ }> & z.core.$partial, z.ZodString>;
258
+ "docker-registry": z.ZodDefault<z.ZodString>;
259
+ pkg: z.ZodDefault<z.ZodString>;
260
+ type: z.ZodLiteral<"conda">;
261
+ "micromamba-version": z.ZodDefault<z.ZodString>;
262
+ "conda-root-dir": z.ZodDefault<z.ZodString>;
263
+ spec: z.ZodDefault<z.ZodString>;
264
+ }, z.core.$strip>, z.ZodObject<{
265
+ type: z.ZodLiteral<"docker">;
266
+ registry: z.ZodDefault<z.ZodString>;
267
+ context: z.ZodString;
268
+ dockerfile: z.ZodDefault<z.ZodString>;
269
+ pkg: z.ZodDefault<z.ZodString>;
270
+ }, z.core.$strip>]>;
271
+ type anyArtifactType = z.infer<typeof anyArtifactSchema>;
272
+ type withType<Typ, Orig> = Orig & {
273
+ type: Typ;
274
+ };
275
+ type withId<T> = T & {
276
+ id: string;
277
+ };
278
+ //#endregion
279
+ export { anyArtifactType, artifactType, assetType, binaryType, condaType, dockerType, environmentType, javaType, pythonType, rType, registry, withId, withType };
280
+ //# sourceMappingURL=artifacts.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"artifacts.d.ts","names":[],"sources":["../../../src/core/schemas/artifacts.ts"],"mappings":";;;cAKa,aAAA;AAAA,KAUD,YAAA,WAAuB,aAAA;AAAA,cA+BtB,cAAA,EAAc,CAAA,CAAA,SAAA;;;;;KAKf,QAAA,GAAW,CAAA,CAAE,KAAA,QAAa,cAAA;AAAA,cA6EzB,WAAA,EAAW,CAAA,CAAA,SAAA;;;;;;;;;;;KAIZ,SAAA,GAAY,CAAA,CAAE,KAAA,QAAa,WAAA;AAAA,cAE1B,iBAAA,EAAiB,CAAA,CAAA,SAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;KA6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DOCKERFILE, DOCKER_PLACEHOLDER_PKG, DOCKER_REGISTRY } from "../../defaults.js";
2
+ import { AllPlatforms } from "../util.js";
3
+ import { z } from "zod/v4";
4
+ //#region src/core/schemas/artifacts.ts
5
+ const artifactTypes = [
6
+ "asset",
7
+ "environment",
8
+ "binary",
9
+ "java",
10
+ "python",
11
+ "R",
12
+ "docker",
13
+ "conda"
14
+ ];
15
+ const archiveArtifactTypes = [
16
+ "asset",
17
+ "environment",
18
+ "binary",
19
+ "java",
20
+ "python",
21
+ "R",
22
+ "conda"
23
+ ];
24
+ const crossplatformTypes = [
25
+ "asset",
26
+ "java",
27
+ "python",
28
+ "R"
29
+ ];
30
+ const dockerAutogenTypes = ["python", "conda"];
31
+ function isBuildable(aType) {
32
+ return artifactTypes.includes(aType);
33
+ }
34
+ function isCrossPlatform(aType) {
35
+ return crossplatformTypes.includes(aType);
36
+ }
37
+ const runEnvironmentTypes = [
38
+ "java",
39
+ "python",
40
+ "R"
41
+ ];
42
+ const registrySchema = z.strictObject({
43
+ name: z.string(),
44
+ downloadURL: z.string().optional(),
45
+ storageURL: z.string().optional()
46
+ });
47
+ const registryOrRef = z.union([z.string(), registrySchema]);
48
+ const archiveRulesSchema = z.object({
49
+ registry: registryOrRef.default({
50
+ name: BIN_REGISTRY_NAME,
51
+ downloadURL: BIN_REGISTRY_DOWNLOAD_URL
52
+ }),
53
+ name: z.string().optional(),
54
+ version: z.string().optional(),
55
+ root: z.string("package archive content directory is required"),
56
+ roots: z.partialRecord(z.enum(AllPlatforms), z.string("path to package archive content directory cannot be empty").min(1), { error: (iss) => {
57
+ if (iss.input === void 0) return "list of supported platforms is required: { <platform>: <dir> }\nsupported platforms:\n " + AllPlatforms.join("\n ");
58
+ return null;
59
+ } }).refine((val) => Object.keys(val).length > 0, { message: "specify at least one platform supported by this software in format: { <platform>: <dir> }\nsupported platforms:\n " + AllPlatforms.join("\n ") }).describe("please, provide settings only for supported platforms: " + AllPlatforms.join(", "))
60
+ });
61
+ const dockerRulesSchema = z.object({
62
+ ["docker-registry"]: z.string("python software is also automatically shipped as docker image. Docker registry cannot be empty").min(1).default(DOCKER_REGISTRY).describe("registry to use for pushing autogenerated docker image"),
63
+ pkg: z.string().default(DOCKER_PLACEHOLDER_PKG).describe("{pkg} placeholder value to be used in \"cmd\" and arguments (for docker autogeneration)")
64
+ });
65
+ const artifactIDSchema = z.string().regex(/:/, { message: "tengo artifact ID must have <npmPackage>:<artifactName> format, e.g @milaboratory/runenv-java-corretto:21.2.0.4.1" }).describe("ID of tengo build artifact");
66
+ const assetSchema = archiveRulesSchema.omit({ roots: true }).extend({ type: z.literal("asset") }).strict();
67
+ const environmentSchema = archiveRulesSchema.omit({ root: true }).extend({
68
+ type: z.literal("environment"),
69
+ runtime: z.enum(runEnvironmentTypes).describe("type of runtime this run environment provides: 'java', 'python' and so on"),
70
+ ["r-version"]: z.string().optional(),
71
+ ["python-version"]: z.string().optional(),
72
+ ["java-version"]: z.string().optional(),
73
+ envVars: z.array(z.string().regex(/=/, "environment variable should be specified in format: <var-name>=<var-value>, i.e.: MY_ENV=value")).optional(),
74
+ binDir: z.string().describe("path to 'bin' directory to be added to PATH when software uses this run environment")
75
+ });
76
+ const binarySchema = archiveRulesSchema.omit({ root: true }).extend({ type: z.literal("binary") });
77
+ const javaSchema = archiveRulesSchema.omit({ roots: true }).extend({
78
+ type: z.literal("java"),
79
+ environment: artifactIDSchema
80
+ });
81
+ const pipToolsetSchema = z.strictObject({
82
+ toolset: z.literal("pip"),
83
+ requirements: z.string().describe("path to requrements.txt inside package archive")
84
+ });
85
+ const pythonToolsetSchema = z.discriminatedUnion("toolset", [pipToolsetSchema]);
86
+ const pythonSchema = archiveRulesSchema.omit({ roots: true }).extend(dockerRulesSchema.shape).extend({
87
+ type: z.literal("python"),
88
+ environment: artifactIDSchema,
89
+ dependencies: pythonToolsetSchema.optional()
90
+ });
91
+ const rSchema = archiveRulesSchema.omit({ roots: true }).extend({
92
+ type: z.literal("R"),
93
+ environment: artifactIDSchema
94
+ });
95
+ const condaSchema = archiveRulesSchema.omit({ root: true }).extend(dockerRulesSchema.shape).extend({
96
+ type: z.literal("conda"),
97
+ ["micromamba-version"]: z.string().default(CONDA_MICROMAMBA_VERSION).describe("version of micromamba to be used to operate with conda environments"),
98
+ ["conda-root-dir"]: z.string().default(CONDA_DATA_LOCATION).describe("root directory of conda environment inside package root"),
99
+ spec: z.string().default(CONDA_SOURCE_ENV_SPEC_FILE).describe(`path to conda environment yaml specification relative to package.json`)
100
+ });
101
+ const dockerSchema = z.object({
102
+ type: z.literal("docker"),
103
+ registry: z.string().default(DOCKER_REGISTRY).describe("registry+repository URL to use for pulling this image"),
104
+ context: z.string().refine((val) => val !== "./" && val !== ".", { message: "Context cannot be \"./\" or \".\" - use absolute path or relative path without \"./\" prefix" }).describe("relative path to context directory from folder where command is executed or absolute path to context folder (cannot be \"./\" or \".\")"),
105
+ dockerfile: z.string().default(DOCKER_DOCKERFILE).describe("relative path to 'Dockerfile' file from folder where command is executed or absolute path to the file"),
106
+ pkg: z.string().default(DOCKER_PLACEHOLDER_PKG).describe("{pkg} placeholder value to be used in \"cmd\" and arguments")
107
+ });
108
+ const anyArtifactSchema = z.discriminatedUnion("type", [
109
+ assetSchema,
110
+ environmentSchema,
111
+ binarySchema,
112
+ javaSchema,
113
+ pythonSchema,
114
+ rSchema,
115
+ condaSchema,
116
+ dockerSchema
117
+ ]);
118
+ const artifactIndexSchema = z.record(z.string(), anyArtifactSchema);
119
+ //#endregion
120
+ export { archiveArtifactTypes, artifactIndexSchema, assetSchema, binarySchema, condaSchema, dockerAutogenTypes, dockerSchema, environmentSchema, isBuildable, isCrossPlatform, javaSchema, pythonSchema, rSchema, runEnvironmentTypes };
121
+
122
+ //# sourceMappingURL=artifacts.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"artifacts.js","names":["defaults.BIN_REGISTRY_NAME","defaults.BIN_REGISTRY_DOWNLOAD_URL","util.AllPlatforms","defaults.DOCKER_REGISTRY","defaults.DOCKER_PLACEHOLDER_PKG","defaults.CONDA_MICROMAMBA_VERSION","defaults.CONDA_DATA_LOCATION","defaults.CONDA_SOURCE_ENV_SPEC_FILE","defaults.DOCKER_DOCKERFILE"],"sources":["../../../src/core/schemas/artifacts.ts"],"sourcesContent":["import { z } from \"zod/v4\";\nimport * as defaults from \"../../defaults\";\nimport * as util from \"../util\";\n\n// All known artifact types\nexport const artifactTypes = [\n \"asset\",\n \"environment\",\n \"binary\",\n \"java\",\n \"python\",\n \"R\",\n \"docker\",\n \"conda\",\n] as const;\nexport type artifactType = (typeof artifactTypes)[number];\n\n// TODO: change these to type definitions, not arrays. This will simplify type narrowing logic throughout the code.\nexport const archiveArtifactTypes: artifactType[] = [\n \"asset\",\n \"environment\",\n \"binary\",\n \"java\",\n \"python\",\n \"R\",\n \"conda\",\n] as const;\nexport const crossplatformTypes: artifactType[] = [\"asset\", \"java\", \"python\", \"R\"] as const;\nexport const dockerAutogenTypes: artifactType[] = [\"python\", \"conda\"] as const;\nexport const dockerArchitectures: util.ArchType[] = [\"x64\"] as const;\n\nexport function isBuildable(aType: artifactType): boolean {\n // All known artifact types are buildable. No exceptions so far.\n return artifactTypes.includes(aType);\n}\n\nexport function isCrossPlatform(aType: artifactType): boolean {\n return crossplatformTypes.includes(aType);\n}\n\nexport const runEnvironmentTypes = [\"java\", \"python\", \"R\"] as const;\nexport type runEnvironmentType = (typeof runEnvironmentTypes)[number];\n\nexport const pythonToolsets = [\"pip\"] as const;\nexport type pythonToolsetName = (typeof pythonToolsets)[number];\n\nexport const registrySchema = z.strictObject({\n name: z.string(),\n downloadURL: z.string().optional(),\n storageURL: z.string().optional(),\n});\nexport type registry = z.infer<typeof registrySchema>;\n\nexport const registryOrRef = z.union([z.string(), registrySchema]);\n\n// common fields for all buildable artifacts\n// TODO: create new type for binary packages\nconst archiveRulesSchema = z.object({\n registry: registryOrRef.default({\n name: defaults.BIN_REGISTRY_NAME,\n downloadURL: defaults.BIN_REGISTRY_DOWNLOAD_URL,\n }),\n\n name: z.string().optional(),\n version: z.string().optional(),\n\n root: z.string(\"package archive content directory is required\"),\n roots: z\n .partialRecord(\n z.enum(\n util.AllPlatforms as [\n (typeof util.AllPlatforms)[number],\n ...(typeof util.AllPlatforms)[number][],\n ],\n ),\n z.string(\"path to package archive content directory cannot be empty\").min(1),\n {\n error: (iss) => {\n if (iss.input === undefined) {\n return (\n \"list of supported platforms is required: { <platform>: <dir> }\\n\" +\n \"supported platforms:\\n \" +\n util.AllPlatforms.join(\"\\n \")\n );\n }\n return null;\n },\n },\n )\n .refine((val) => Object.keys(val).length > 0, {\n message:\n \"specify at least one platform supported by this software in format: { <platform>: <dir> }\\n\" +\n \"supported platforms:\\n \" +\n util.AllPlatforms.join(\"\\n \"),\n })\n .describe(\n \"please, provide settings only for supported platforms: \" + util.AllPlatforms.join(\", \"),\n ),\n});\nexport type archiveRules = z.infer<typeof archiveRulesSchema>;\n\nconst dockerRulesSchema = z.object({\n [\"docker-registry\"]: z\n .string(\n \"python software is also automatically shipped as docker image. Docker registry cannot be empty\",\n )\n .min(1)\n .default(defaults.DOCKER_REGISTRY)\n .describe(\"registry to use for pushing autogenerated docker image\"),\n\n pkg: z\n .string()\n .default(defaults.DOCKER_PLACEHOLDER_PKG)\n .describe(\n '{pkg} placeholder value to be used in \"cmd\" and arguments (for docker autogeneration)',\n ),\n});\n\nexport const artifactIDSchema = z\n .string()\n .regex(/:/, {\n message:\n \"tengo artifact ID must have <npmPackage>:<artifactName> format, e.g @milaboratory/runenv-java-corretto:21.2.0.4.1\",\n })\n .describe(\"ID of tengo build artifact\");\n\nexport type artifactIDString = z.infer<typeof artifactIDSchema>;\n\nexport const assetSchema = archiveRulesSchema\n .omit({ roots: true })\n .extend({ type: z.literal(\"asset\") })\n .strict();\nexport type assetType = z.infer<typeof assetSchema>;\n\nexport const environmentSchema = archiveRulesSchema.omit({ root: true }).extend({\n type: z.literal(\"environment\"),\n\n runtime: z\n .enum(runEnvironmentTypes)\n .describe(\"type of runtime this run environment provides: 'java', 'python' and so on\"),\n\n [\"r-version\"]: z.string().optional(),\n [\"python-version\"]: z.string().optional(),\n [\"java-version\"]: z.string().optional(),\n\n envVars: z\n .array(\n z\n .string()\n .regex(\n /=/,\n \"environment variable should be specified in format: <var-name>=<var-value>, i.e.: MY_ENV=value\",\n ),\n )\n .optional(),\n\n binDir: z\n .string()\n .describe(\n \"path to 'bin' directory to be added to PATH when software uses this run environment\",\n ),\n});\n\nexport type environmentType = z.infer<typeof environmentSchema>;\n\nexport const binarySchema = archiveRulesSchema.omit({ root: true }).extend({\n type: z.literal(\"binary\"),\n});\nexport type binaryType = z.infer<typeof binarySchema>;\n\nexport const javaSchema = archiveRulesSchema.omit({ roots: true }).extend({\n type: z.literal(\"java\"),\n environment: artifactIDSchema,\n});\nexport type javaType = z.infer<typeof javaSchema>;\n\nconst pipToolsetSchema = z.strictObject({\n toolset: z.literal(\"pip\"),\n requirements: z.string().describe(\"path to requrements.txt inside package archive\"),\n});\n\nexport const pythonToolsetSchema = z.discriminatedUnion(\"toolset\", [pipToolsetSchema]);\n\nexport const pythonSchema = archiveRulesSchema\n .omit({ roots: true })\n .extend(dockerRulesSchema.shape)\n .extend({\n type: z.literal(\"python\"),\n\n environment: artifactIDSchema,\n dependencies: pythonToolsetSchema.optional(),\n });\nexport type pythonType = z.infer<typeof pythonSchema>;\n\nexport const rSchema = archiveRulesSchema.omit({ roots: true }).extend({\n type: z.literal(\"R\"),\n environment: artifactIDSchema,\n});\nexport type rType = z.infer<typeof rSchema>;\n\nexport const condaSchema = archiveRulesSchema\n .omit({ root: true })\n .extend(dockerRulesSchema.shape)\n .extend({\n type: z.literal(\"conda\"),\n\n [\"micromamba-version\"]: z\n .string()\n .default(defaults.CONDA_MICROMAMBA_VERSION)\n .describe(\"version of micromamba to be used to operate with conda environments\"),\n [\"conda-root-dir\"]: z\n .string()\n .default(defaults.CONDA_DATA_LOCATION)\n .describe(\"root directory of conda environment inside package root\"),\n\n spec: z\n .string()\n .default(defaults.CONDA_SOURCE_ENV_SPEC_FILE)\n .describe(`path to conda environment yaml specification relative to package.json`),\n });\nexport type condaType = z.infer<typeof condaSchema>;\n\nexport const dockerSchema = z.object({\n type: z.literal(\"docker\"),\n\n registry: z\n .string()\n .default(defaults.DOCKER_REGISTRY)\n .describe(\"registry+repository URL to use for pulling this image\"),\n\n // build from custom Dockerfile\n context: z\n .string()\n .refine((val) => val !== \"./\" && val !== \".\", {\n message:\n 'Context cannot be \"./\" or \".\" - use absolute path or relative path without \"./\" prefix',\n })\n .describe(\n 'relative path to context directory from folder where command is executed or absolute path to context folder (cannot be \"./\" or \".\")',\n ),\n\n dockerfile: z\n .string()\n .default(defaults.DOCKER_DOCKERFILE)\n .describe(\n \"relative path to 'Dockerfile' file from folder where command is executed or absolute path to the file\",\n ),\n\n pkg: z\n .string()\n .default(defaults.DOCKER_PLACEHOLDER_PKG)\n .describe('{pkg} placeholder value to be used in \"cmd\" and arguments'),\n\n // import existing image\n // entrypoint: z\n // .array(z.string())\n // .optional()\n // .describe('replace image\\'s ENTRYPOINT with this value when running container'),\n});\nexport type dockerType = z.infer<typeof dockerSchema>;\n\nexport const anyArtifactSchema = z.discriminatedUnion(\"type\", [\n assetSchema,\n environmentSchema,\n binarySchema,\n javaSchema,\n pythonSchema,\n rSchema,\n condaSchema,\n dockerSchema,\n]);\n\nexport type anyArtifactType = z.infer<typeof anyArtifactSchema>;\n\nexport const artifactIndexSchema = z.record(z.string(), anyArtifactSchema);\nexport type artifactIndexType = z.infer<typeof artifactIndexSchema>;\n\nexport type withType<Typ, Orig> = Orig & { type: Typ };\nexport type withId<T> = T & { id: string };\n"],"mappings":";;;;AAKA,MAAa,gBAAgB;CAC3B;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACD;AAID,MAAa,uBAAuC;CAClD;CACA;CACA;CACA;CACA;CACA;CACA;CACD;AACD,MAAa,qBAAqC;CAAC;CAAS;CAAQ;CAAU;CAAI;AAClF,MAAa,qBAAqC,C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EAAE,QAAQ,IAAI;CACpB,aAAa;CACd,CAAC;AAGF,MAAa,cAAc,mBACxB,KAAK,EAAE,MAAM,MAAM,CAAC,CACpB,OAAO,kBAAkB,MAAM,CAC/B,OAAO;CACN,MAAM,EAAE,QAAQ,QAAQ;EAEvB,uBAAuB,EACrB,QAAQ,CACR,QAAQC,yBAAkC,CAC1C,SAAS,sEAAsE;EACjF,mBAAmB,EACjB,QAAQ,CACR,QAAQC,oBAA6B,CACrC,SAAS,0DAA0D;CAEtE,MAAM,EACH,QAAQ,CACR,QAAQC,2BAAoC,CAC5C,SAAS,wEAAwE;CACrF,CAAC;AAGJ,MAAa,eAAe,EAAE,OAAO;CACnC,MAAM,EAAE,QAAQ,SAAS;CAEzB,UAAU,EACP,QAAQ,CACR,QAAQJ,gBAAyB,CACjC,SAAS,wDAAwD;CAGpE,SAAS,EACN,QAAQ,CACR,QAAQ,QAAQ,QAAQ,QAAQ,QAAQ,KAAK,EAC5C,SACE,gGACH,CAAC,CACD,SACC,0IACD;CAEH,YAAY,EACT,QAAQ,CACR,QAAQK,kBAA2B,CACnC,SACC,wGACD;CAEH,KAAK,EACF,QAAQ,CACR,QAAQJ,uBAAgC,CACxC,SAAS,8DAA4D;CAOzE,CAAC;AAGF,MAAa,oBAAoB,EAAE,mBAAmB,QAAQ;CAC5D;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACD,CAAC;AAIF,MAAa,sBAAsB,EAAE,OAAO,EAAE,QAAQ,EAAE,kBAAkB"}
@@ -0,0 +1,43 @@
1
+ require("../../_virtual/_rolldown/runtime.cjs");
2
+ const require_util = require("../util.cjs");
3
+ const require_artifacts = require("./artifacts.cjs");
4
+ let zod_v4 = require("zod/v4");
5
+ //#region src/core/schemas/entrypoints.ts
6
+ const envVarsSchema = zod_v4.z.array(zod_v4.z.string().regex(/=/, "full environment variable specification is required: <var-name>=<var-value>, e.g.: IS_CI=yes"));
7
+ const EnyrypointReferencePattern = /^(?<fullName>(?:(?<scope>@[a-z0-9-.]+)\/)?(?<name>[a-z0-9-.]+))\/(?<path>.*)$/;
8
+ const referenceSchema = zod_v4.z.string().regex(EnyrypointReferencePattern, "entrypoint reference must contain full package name and path to the file inside");
9
+ const orRef = (schema) => zod_v4.z.union([zod_v4.z.string("not a reference to artifact").describe("reference to artifact in \"artifacts\" section"), schema]);
10
+ const softwareOptionsSchema = zod_v4.z.strictObject({
11
+ cmd: zod_v4.z.array(zod_v4.z.string("command artument must be a string")).min(1, { error: "at least one argument is required" }).refine((cmd) => cmd[0].trim() != "", { error: "first cmd argument must be non-empty string" }).describe("command to run for this entrypoint. This command will be appended by <args> set inside workflow"),
12
+ envVars: envVarsSchema.optional().describe("list of environment variables to be set for this entrypoint")
13
+ });
14
+ const environmentOptionsSchema = zod_v4.z.strictObject({
15
+ artifact: orRef(require_artifacts.environmentSchema.omit({ type: true })),
16
+ envVars: envVarsSchema.optional().describe("list of environment variables to be set for any command inside this run environment")
17
+ });
18
+ const entrypointSchema = zod_v4.z.strictObject({
19
+ reference: referenceSchema.optional(),
20
+ asset: orRef(require_artifacts.assetSchema.omit({ type: true })).optional(),
21
+ environment: environmentOptionsSchema.optional(),
22
+ binary: zod_v4.z.union([
23
+ softwareOptionsSchema.extend({ artifact: orRef(require_artifacts.binarySchema) }),
24
+ softwareOptionsSchema.extend({ artifact: orRef(require_artifacts.javaSchema) }),
25
+ softwareOptionsSchema.extend({ artifact: orRef(require_artifacts.pythonSchema) }),
26
+ softwareOptionsSchema.extend({ artifact: orRef(require_artifacts.rSchema) })
27
+ ]).optional(),
28
+ conda: softwareOptionsSchema.extend({ artifact: orRef(require_artifacts.condaSchema.omit({ type: true })) }).optional(),
29
+ docker: softwareOptionsSchema.extend({ artifact: orRef(require_artifacts.dockerSchema.omit({ type: true })) }).optional()
30
+ }).refine((data) => {
31
+ const n = require_util.toInt(data.reference) + require_util.toInt(data.asset && !data.docker) + require_util.toInt(data.binary || data.binary && data.docker) + require_util.toInt(data.conda || data.conda && data.docker) + require_util.toInt(data.environment && !data.docker);
32
+ if (n === 0) return Boolean(data.docker);
33
+ return n === 1;
34
+ }, {
35
+ message: "entrypoint cannot point to several packages at once: choose 'reference', 'asset', 'binary', 'environment' or 'docker'",
36
+ path: ["reference | asset | binary | environment | docker"]
37
+ });
38
+ const entrypointListSchema = zod_v4.z.record(zod_v4.z.string().regex(/[-_a-z0-9.]/).describe("name of entrypoint descriptor, client should import to use this entrypoint (assets.importSoftware)"), entrypointSchema);
39
+ //#endregion
40
+ exports.EnyrypointReferencePattern = EnyrypointReferencePattern;
41
+ exports.entrypointListSchema = entrypointListSchema;
42
+
43
+ //# sourceMappingURL=entrypoints.cjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"entrypoints.cjs","names":["z"],"sources":["../../../src/core/schemas/entrypoints.ts"],"sourcesContent":["import { z } from \"zod/v4\";\nimport * as artifacts from \"./artifacts\";\nimport * as util from \"../util\";\n\nconst envVarsSchema = z.array(\n z\n .string()\n .regex(\n /=/,\n \"full environment variable specification is required: <var-name>=<var-value>, e.g.: IS_CI=yes\",\n ),\n);\n\nexport const EnyrypointReferencePattern =\n /^(?<fullName>(?:(?<scope>@[a-z0-9-.]+)\\/)?(?<name>[a-z0-9-.]+))\\/(?<path>.*)$/;\n\nexport const referenceSchema = z\n .string()\n .regex(\n EnyrypointReferencePattern,\n \"entrypoint reference must contain full package name and path to the file inside\",\n );\n\nconst orRef = <T extends z.ZodTypeAny>(schema: T) =>\n z.union([\n z\n .string(\"not a reference to artifact\")\n .describe('reference to artifact in \"artifacts\" section'),\n schema,\n ]);\n\n// Common options for all software packages: everything that can be run on backend side.\nexport const softwareOptionsSchema = z.strictObject({\n cmd: z\n .array(z.string(\"command artument must be a string\"))\n .min(1, { error: \"at least one argument is required\" })\n .refine((cmd) => cmd[0].trim() != \"\", { error: \"first cmd argument must be non-empty string\" })\n .describe(\n \"command to run for this entrypoint. This command will be appended by <args> set inside workflow\",\n ),\n envVars: envVarsSchema\n .optional()\n .describe(\"list of environment variables to be set for this entrypoint\"),\n});\nexport type softwareOptionsType = z.infer<typeof softwareOptionsSchema>;\n\nexport const environmentOptionsSchema = z.strictObject({\n artifact: orRef(artifacts.environmentSchema.omit({ type: true })),\n envVars: envVarsSchema\n .optional()\n .describe(\n \"list of environment variables to be set for any command inside this run environment\",\n ),\n});\n\n// Full schema of single entrypoint in block-software.entrypoints\nexport const entrypointSchema = z\n .strictObject({\n reference: referenceSchema.optional(),\n asset: orRef(artifacts.assetSchema.omit({ type: true })).optional(),\n environment: environmentOptionsSchema.optional(),\n\n binary: z\n .union([\n softwareOptionsSchema.extend({ artifact: orRef(artifacts.binarySchema) }),\n softwareOptionsSchema.extend({ artifact: orRef(artifacts.javaSchema) }),\n softwareOptionsSchema.extend({ artifact: orRef(artifacts.pythonSchema) }),\n softwareOptionsSchema.extend({ artifact: orRef(artifacts.rSchema) }),\n ])\n .optional(), // TODO: reduce nesting: put java, python and r to the level of binary, like conda.\n\n conda: softwareOptionsSchema\n .extend({ artifact: orRef(artifacts.condaSchema.omit({ type: true })) })\n .optional(),\n docker: softwareOptionsSchema\n .extend({ artifact: orRef(artifacts.dockerSchema.omit({ type: true })) })\n .optional(),\n })\n .refine(\n (data) => {\n const n =\n util.toInt(data.reference) +\n util.toInt(data.asset && !data.docker) + // no docker for assets\n util.toInt(data.binary || (data.binary && data.docker)) + // allow both docker and binary to be set in single entrypoint\n util.toInt(data.conda || (data.conda && data.docker)) + // allow both docker and conda to be set in single entrypoint\n util.toInt(data.environment && !data.docker); // no docker for environments\n\n if (n === 0) {\n return Boolean(data.docker); // allow separate docker entrypoints (without binary/conda/...)\n }\n\n return n === 1;\n },\n {\n message:\n \"entrypoint cannot point to several packages at once: choose 'reference', 'asset', 'binary', 'environment' or 'docker'\",\n path: [\"reference | asset | binary | environment | docker\"],\n },\n );\nexport type entrypointType = z.infer<typeof entrypointSchema>;\n\n// Full block-software.entrypoints list schema\nexport const entrypointListSchema = z.record(\n z\n .string()\n .regex(/[-_a-z0-9.]/)\n .describe(\n \"name of entrypoint descriptor, client should import to use this entrypoint (assets.importSoftware)\",\n ),\n entrypointSchema,\n);\nexport type entrypointListType = z.infer<typeof entrypointListSchema>;\n\nexport interface ReferenceEntrypoint {\n type: \"reference\";\n name: string;\n reference: string;\n}\n\nexport interface AssetEntrypoint {\n type: \"asset\";\n name: string;\n artifact: artifacts.withId<artifacts.assetType>;\n}\n\nexport interface SoftwareEntrypoint {\n type: \"software\";\n name: string;\n artifact: artifacts.withId<\n | artifacts.binaryType\n | artifacts.condaType\n | artifacts.javaType\n | artifacts.pythonType\n | artifacts.rType\n | artifacts.dockerType\n >;\n cmd: string[];\n env: string[];\n}\n\nexport interface EnvironmentEntrypoint {\n type: \"environment\";\n name: string;\n artifact: artifacts.withId<artifacts.environmentType>;\n env: string[];\n}\n\nexport type PackageEntrypoint = AssetEntrypoint | SoftwareEntrypoint | EnvironmentEntrypoint;\nexport type Entrypoint = ReferenceEntrypoint | PackageEntrypoint;\nexport type EntrypointType = Extract<Entrypoint, { type: string }>[\"type\"];\n"],"mappings":";;;;;AAIA,MAAM,gBAAgBA,OAAAA,EAAE,MACtBA,OAAAA,EACG,QAAQ,CACR,MACC,KACA,+FACD,CACJ;AAED,MAAa,6BACX;AAEF,MAAa,kBAAkBA,OAAAA,EAC5B,QAAQ,CACR,MACC,4BACA,kFACD;AAEH,MAAM,SAAiC,WACrCA,OAAAA,EAAE,MAAM,CACNA,OAAAA,EACG,OAAO,8BAA8B,CACrC,SAAS,iDAA+C,EAC3D,OACD,CAAC;AAGJ,MAAa,wBAAwBA,OAAAA,EAAE,aAAa;CAClD,KAAKA,OAAAA,EACF,MAAMA,OAAAA,EAAE,OAAO,oCAAoC,CAAC,CACpD,IAAI,GAAG,EAAE,OAAO,qCAAqC,CAAC,CACtD,QAAQ,QAAQ,IAAI,GAAG,MAAM,IAAI,IAAI,EAAE,OAAO,+CAA+C,CAAC,CAC9F,SACC,kGACD;CACH,SAAS,cACN,UAAU,CACV,SAAS,8DAA8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,QAAO,MAAM;GAEf;CACE,SACE;CACF,MAAM,CAAC,oDAAoD;CAC5D,CACF;AAIH,MAAa,uBAAuBA,OAAAA,EAAE,OACpCA,OAAAA,EACG,QAAQ,CACR,MAAM,cAAc,CACpB,SACC,qGACD,EACH,iBACD"}
@@ -0,0 +1,32 @@
1
+ import { assetType, binaryType, condaType, dockerType, environmentType, javaType, pythonType, rType, withId } from "./artifacts.js";
2
+ import { z } from "zod/v4";
3
+
4
+ //#region src/core/schemas/entrypoints.d.ts
5
+ interface ReferenceEntrypoint {
6
+ type: "reference";
7
+ name: string;
8
+ reference: string;
9
+ }
10
+ interface AssetEntrypoint {
11
+ type: "asset";
12
+ name: string;
13
+ artifact: withId<assetType>;
14
+ }
15
+ interface SoftwareEntrypoint {
16
+ type: "software";
17
+ name: string;
18
+ artifact: withId<binaryType | condaType | javaType | pythonType | rType | dockerType>;
19
+ cmd: string[];
20
+ env: string[];
21
+ }
22
+ interface EnvironmentEntrypoint {
23
+ type: "environment";
24
+ name: string;
25
+ artifact: withId<environmentType>;
26
+ env: string[];
27
+ }
28
+ type PackageEntrypoint = AssetEntrypoint | SoftwareEntrypoint | EnvironmentEntrypoint;
29
+ type Entrypoint = ReferenceEntrypoint | PackageEntrypoint;
30
+ //#endregion
31
+ export { Entrypoint, ReferenceEntrypoint };
32
+ //# sourceMappingURL=entrypoints.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"entrypoints.d.ts","names":[],"sources":["../../../src/core/schemas/entrypoints.ts"],"mappings":";;;;UAiHiB,mBAAA;EACf,IAAA;EACA,IAAA;EACA,SAAA;AAAA;AAAA,UAGe,eAAA;EACf,IAAA;EACA,IAAA;EACA,QAAA,EAAU,MAAA,CAAiB,SAAA;AAAA;AAAA,UAGZ,kBAAA;EACf,IAAA;EACA,IAAA;EACA,QAAA,EAAU,MAAA,CACN,UAAA,GACA,SAAA,GACA,QAAA,GACA,UAAA,GACA,KAAA,GACA,UAAA;EAEJ,GAAA;EACA,GAAA;AAAA;AAAA,UAGe,qBAAA;EACf,IAAA;EACA,IAAA;EACA,QAAA,EAAU,MAAA,CAAiB,eAAA;EAC3B,GAAA;AAAA;AAAA,KAGU,iBAAA,GAAoB,eAAA,GAAkB,kBAAA,GAAqB,qBAAA;AAAA,KAC3D,UAAA,GAAa,mBAAA,GAAsB,iBAAA"}
@@ -0,0 +1,41 @@
1
+ import { toInt } from "../util.js";
2
+ import { assetSchema, binarySchema, condaSchema, dockerSchema, environmentSchema, javaSchema, pythonSchema, rSchema } from "./artifacts.js";
3
+ import { z } from "zod/v4";
4
+ //#region src/core/schemas/entrypoints.ts
5
+ const envVarsSchema = z.array(z.string().regex(/=/, "full environment variable specification is required: <var-name>=<var-value>, e.g.: IS_CI=yes"));
6
+ const EnyrypointReferencePattern = /^(?<fullName>(?:(?<scope>@[a-z0-9-.]+)\/)?(?<name>[a-z0-9-.]+))\/(?<path>.*)$/;
7
+ const referenceSchema = z.string().regex(EnyrypointReferencePattern, "entrypoint reference must contain full package name and path to the file inside");
8
+ const orRef = (schema) => z.union([z.string("not a reference to artifact").describe("reference to artifact in \"artifacts\" section"), schema]);
9
+ const softwareOptionsSchema = z.strictObject({
10
+ cmd: z.array(z.string("command artument must be a string")).min(1, { error: "at least one argument is required" }).refine((cmd) => cmd[0].trim() != "", { error: "first cmd argument must be non-empty string" }).describe("command to run for this entrypoint. This command will be appended by <args> set inside workflow"),
11
+ envVars: envVarsSchema.optional().describe("list of environment variables to be set for this entrypoint")
12
+ });
13
+ const environmentOptionsSchema = z.strictObject({
14
+ artifact: orRef(environmentSchema.omit({ type: true })),
15
+ envVars: envVarsSchema.optional().describe("list of environment variables to be set for any command inside this run environment")
16
+ });
17
+ const entrypointSchema = z.strictObject({
18
+ reference: referenceSchema.optional(),
19
+ asset: orRef(assetSchema.omit({ type: true })).optional(),
20
+ environment: environmentOptionsSchema.optional(),
21
+ binary: z.union([
22
+ softwareOptionsSchema.extend({ artifact: orRef(binarySchema) }),
23
+ softwareOptionsSchema.extend({ artifact: orRef(javaSchema) }),
24
+ softwareOptionsSchema.extend({ artifact: orRef(pythonSchema) }),
25
+ softwareOptionsSchema.extend({ artifact: orRef(rSchema) })
26
+ ]).optional(),
27
+ conda: softwareOptionsSchema.extend({ artifact: orRef(condaSchema.omit({ type: true })) }).optional(),
28
+ docker: softwareOptionsSchema.extend({ artifact: orRef(dockerSchema.omit({ type: true })) }).optional()
29
+ }).refine((data) => {
30
+ const n = toInt(data.reference) + toInt(data.asset && !data.docker) + toInt(data.binary || data.binary && data.docker) + toInt(data.conda || data.conda && data.docker) + toInt(data.environment && !data.docker);
31
+ if (n === 0) return Boolean(data.docker);
32
+ return n === 1;
33
+ }, {
34
+ message: "entrypoint cannot point to several packages at once: choose 'reference', 'asset', 'binary', 'environment' or 'docker'",
35
+ path: ["reference | asset | binary | environment | docker"]
36
+ });
37
+ const entrypointListSchema = z.record(z.string().regex(/[-_a-z0-9.]/).describe("name of entrypoint descriptor, client should import to use this entrypoint (assets.importSoftware)"), entrypointSchema);
38
+ //#endregion
39
+ export { EnyrypointReferencePattern, entrypointListSchema };
40
+
41
+ //# sourceMappingURL=entrypoints.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"entrypoints.js","names":["artifacts.binarySchema","artifacts.javaSchema","artifacts.pythonSchema","artifacts.rSchema","util.toInt"],"sources":["../../../src/core/schemas/entrypoints.ts"],"sourcesContent":["import { z } from \"zod/v4\";\nimport * as artifacts from \"./artifacts\";\nimport * as util from \"../util\";\n\nconst envVarsSchema = z.array(\n z\n .string()\n .regex(\n /=/,\n \"full environment variable specification is required: <var-name>=<var-value>, e.g.: IS_CI=yes\",\n ),\n);\n\nexport const EnyrypointReferencePattern =\n /^(?<fullName>(?:(?<scope>@[a-z0-9-.]+)\\/)?(?<name>[a-z0-9-.]+))\\/(?<path>.*)$/;\n\nexport const referenceSchema = z\n .string()\n .regex(\n EnyrypointReferencePattern,\n \"entrypoint reference must contain full package name and path to the file inside\",\n );\n\nconst orRef = <T extends z.ZodTypeAny>(schema: T) =>\n z.union([\n z\n .string(\"not a reference to artifact\")\n .describe('reference to artifact in \"artifacts\" section'),\n schema,\n ]);\n\n// Common options for all software packages: everything that can be run on backend side.\nexport const softwareOptionsSchema = z.strictObject({\n cmd: z\n .array(z.string(\"command artument must be a string\"))\n .min(1, { error: \"at least one argument is required\" })\n .refine((cmd) => cmd[0].trim() != \"\", { error: \"first cmd argument must be non-empty string\" })\n .describe(\n \"command to run for this entrypoint. This command will be appended by <args> set inside workflow\",\n ),\n envVars: envVarsSchema\n .optional()\n .describe(\"list of environment variables to be set for this entrypoint\"),\n});\nexport type softwareOptionsType = z.infer<typeof softwareOptionsSchema>;\n\nexport const environmentOptionsSchema = z.strictObject({\n artifact: orRef(artifacts.environmentSchema.omit({ type: true })),\n envVars: envVarsSchema\n .optional()\n .describe(\n \"list of environment variables to be set for any command inside this run environment\",\n ),\n});\n\n// Full schema of single entrypoint in block-software.entrypoints\nexport const entrypointSchema = z\n .strictObject({\n reference: referenceSchema.optional(),\n asset: orRef(artifacts.assetSchema.omit({ type: true })).optional(),\n environment: environmentOptionsSchema.optional(),\n\n binary: z\n .union([\n softwareOptionsSchema.extend({ artifact: orRef(artifacts.binarySchema) }),\n softwareOptionsSchema.extend({ artifact: orRef(artifacts.javaSchema) }),\n softwareOptionsSchema.extend({ artifact: orRef(artifacts.pythonSchema) }),\n softwareOptionsSchema.extend({ artifact: orRef(artifacts.rSchema) }),\n ])\n .optional(), // TODO: reduce nesting: put java, python and r to the level of binary, like conda.\n\n conda: softwareOptionsSchema\n .extend({ artifact: orRef(artifacts.condaSchema.omit({ type: true })) })\n .optional(),\n docker: softwareOptionsSchema\n .extend({ artifact: orRef(artifacts.dockerSchema.omit({ type: true })) })\n .optional(),\n })\n .refine(\n (data) => {\n const n =\n util.toInt(data.reference) +\n util.toInt(data.asset && !data.docker) + // no docker for assets\n util.toInt(data.binary || (data.binary && data.docker)) + // allow both docker and binary to be set in single entrypoint\n util.toInt(data.conda || (data.conda && data.docker)) + // allow both docker and conda to be set in single entrypoint\n util.toInt(data.environment && !data.docker); // no docker for environments\n\n if (n === 0) {\n return Boolean(data.docker); // allow separate docker entrypoints (without binary/conda/...)\n }\n\n return n === 1;\n },\n {\n message:\n \"entrypoint cannot point to several packages at once: choose 'reference', 'asset', 'binary', 'environment' or 'docker'\",\n path: [\"reference | asset | binary | environment | docker\"],\n },\n );\nexport type entrypointType = z.infer<typeof entrypointSchema>;\n\n// Full block-software.entrypoints list schema\nexport const entrypointListSchema = z.record(\n z\n .string()\n .regex(/[-_a-z0-9.]/)\n .describe(\n \"name of entrypoint descriptor, client should import to use this entrypoint (assets.importSoftware)\",\n ),\n entrypointSchema,\n);\nexport type entrypointListType = z.infer<typeof entrypointListSchema>;\n\nexport interface ReferenceEntrypoint {\n type: \"reference\";\n name: string;\n reference: string;\n}\n\nexport interface AssetEntrypoint {\n type: \"asset\";\n name: string;\n artifact: artifacts.withId<artifacts.assetType>;\n}\n\nexport interface SoftwareEntrypoint {\n type: \"software\";\n name: string;\n artifact: artifacts.withId<\n | artifacts.binaryType\n | artifacts.condaType\n | artifacts.javaType\n | artifacts.pythonType\n | artifacts.rType\n | artifacts.dockerType\n >;\n cmd: string[];\n env: string[];\n}\n\nexport interface EnvironmentEntrypoint {\n type: \"environment\";\n name: string;\n artifact: artifacts.withId<artifacts.environmentType>;\n env: string[];\n}\n\nexport type PackageEntrypoint = AssetEntrypoint | SoftwareEntrypoint | EnvironmentEntrypoint;\nexport type Entrypoint = ReferenceEntrypoint | PackageEntrypoint;\nexport type EntrypointType = Extract<Entrypoint, { type: string }>[\"type\"];\n"],"mappings":";;;;AAIA,MAAM,gBAAgB,EAAE,MACtB,EACG,QAAQ,CACR,MACC,KACA,+FACD,CACJ;AAED,MAAa,6BACX;AAEF,MAAa,kBAAkB,EAC5B,QAAQ,CACR,MACC,4BACA,kFACD;AAEH,MAAM,SAAiC,WACrC,EAAE,MAAM,CACN,EACG,OAAO,8BAA8B,CACrC,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