@platforma-sdk/block-tools 2.17.7 → 2.17.9

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/cli.mjs CHANGED
@@ -1,18 +1,18 @@
1
1
  import { Ct as e, G as t, It as n, M as r, Nt as i, Qt as a, X as o, Y as s, Zt as c, _ as l, _t as u, n as d, p as f, q as ee, w as p, wt as te, yt as ne } from "./config-C07cYptA.mjs";
2
2
  import { Command as m, Option as h } from "commander";
3
3
  import g from "node:path";
4
- import _ from "node:fs";
5
- import { BlockPackManifest as re, StableChannel as ie, overrideDescriptionVersion as ae, overrideManifestVersion as oe } from "@milaboratories/pl-model-middle-layer";
6
- import { assertDockerPushIntent as se, createBuilder as ce, defaults as le, envs as v, util as y } from "@platforma-sdk/package-builder-lib";
4
+ import _, { globSync as re, statSync as ie } from "node:fs";
5
+ import { BlockPackManifest as ae, StableChannel as oe, overrideDescriptionVersion as se, overrideManifestVersion as ce } from "@milaboratories/pl-model-middle-layer";
6
+ import { assertDockerPushIntent as le, createBuilder as ue, defaults as de, envs as v, util as y } from "@platforma-sdk/package-builder-lib";
7
7
  import { ConsoleLoggerAdapter as b } from "@milaboratories/ts-helpers";
8
- import ue, { isMap as de, isSeq as fe, parse as pe, parseDocument as me, stringify as he } from "yaml";
9
- import { setTimeout as ge } from "node:timers/promises";
10
- import * as _e from "node:os";
11
- import { confirm as ve, input as ye, select as be } from "@inquirer/prompts";
12
- import { spawnSync as xe } from "node:child_process";
13
- import { ECRPUBLICClient as Se, GetAuthorizationTokenCommand as Ce } from "@aws-sdk/client-ecr-public";
8
+ import fe, { isMap as pe, isSeq as me, parse as he, parseDocument as ge, stringify as _e } from "yaml";
9
+ import { setTimeout as ve } from "node:timers/promises";
10
+ import * as ye from "node:os";
11
+ import { confirm as be, input as xe, select as Se } from "@inquirer/prompts";
12
+ import { spawnSync as Ce } from "node:child_process";
13
+ import { ECRPUBLICClient as we, GetAuthorizationTokenCommand as Te } from "@aws-sdk/client-ecr-public";
14
14
  // src/cmd/build-meta.ts
15
- function we() {
15
+ function Ee() {
16
16
  let e = new m("build-meta").description("Extracts meta information from blocks package.json and outputs meta.json with embedded binary and textual information linked from the meta section.");
17
17
  return e.option("-i, --modulePath <path>", "input module path", "."), e.requiredOption("-o, --destination <path>", "output meta.json file"), e.action(async (e) => {
18
18
  let t = g.resolve(e.modulePath), r = await ne(t), a = await i(await n(r.meta, t));
@@ -20,7 +20,7 @@ function we() {
20
20
  }), e;
21
21
  }
22
22
  // src/cmd/build-model.ts
23
- async function Te(e) {
23
+ async function De(e) {
24
24
  try {
25
25
  return await _.promises.readFile(e, "utf8");
26
26
  } catch (e) {
@@ -28,7 +28,7 @@ async function Te(e) {
28
28
  throw e;
29
29
  }
30
30
  }
31
- function Ee() {
31
+ function Oe() {
32
32
  let e = new m("build-model").description("Extracts and outputs block model JSON from pre-built block model module");
33
33
  return e.option("-i, --modulePath <path>", "input module path", "."), e.option("-b, --sourceBundle <path>", "bundled model code to embed into the model for callback-based rendering to work", "./dist/bundle.js"), e.option("-o, --destination <path>", "output model file", "./dist/model.json"), e.action(async (e) => {
34
34
  let t = g.resolve(e.modulePath), { model: n, platforma: r } = c(t);
@@ -36,7 +36,7 @@ function Ee() {
36
36
  let { config: i } = n;
37
37
  if (!i) throw Error("Malformed \"model\" object, check it is created with \"BlockModel\" and \".done()\" is executed as the call in the chain.");
38
38
  if (!("outputs" in i) || !("sections" in i)) throw Error("\"config\" has unexpected structure");
39
- let a = await Te(e.sourceBundle);
39
+ let a = await De(e.sourceBundle);
40
40
  a !== void 0 && (i.code = {
41
41
  type: "plain",
42
42
  content: a
@@ -44,7 +44,7 @@ function Ee() {
44
44
  }), e;
45
45
  }
46
46
  // src/cmd/build-kind-manifest.ts
47
- function De() {
47
+ function ke() {
48
48
  let t = new m("build-kind-manifest").description("Writes the block-kind dist manifest (identity + src source-hash) from a pre-built kind bundle");
49
49
  return t.option("-i, --modulePath <path>", "kind package dir (contains package.json, src/, dist/)", "."), t.option("-s, --srcDir <path>", "source dir hashed into sourceHash, relative to modulePath", "src"), t.option("-o, --dst <path>", "output dir with the compiled bundle, relative to modulePath", "dist"), t.action(async (t) => {
50
50
  await e({
@@ -55,7 +55,7 @@ function De() {
55
55
  }), t;
56
56
  }
57
57
  // src/cmd/pack.ts
58
- function Oe() {
58
+ function Ae() {
59
59
  let e = new m("pack").description("Builds block pack and outputs a block pack manifest consolidating all references assets into a single folder");
60
60
  return e.option("-i, --modulePath <path>", "input module path", "."), e.option("-o, --destinationPath <path>", "output folder", "./block-pack"), e.action(async (e) => {
61
61
  let t = await u(g.resolve(e.modulePath));
@@ -63,20 +63,20 @@ function Oe() {
63
63
  }), e;
64
64
  }
65
65
  // src/cmd/publish.ts
66
- function ke(e, t) {
66
+ function je(e, t) {
67
67
  let n = { ...e };
68
- for (let e in t) n[e] = t[e] && typeof t[e] == "object" && !Array.isArray(t[e]) && n[e] && typeof n[e] == "object" && !Array.isArray(n[e]) ? ke(n[e], t[e]) : t[e];
68
+ for (let e in t) n[e] = t[e] && typeof t[e] == "object" && !Array.isArray(t[e]) && n[e] && typeof n[e] == "object" && !Array.isArray(n[e]) ? je(n[e], t[e]) : t[e];
69
69
  return n;
70
70
  }
71
- function Ae() {
71
+ function Me() {
72
72
  let e = new m("publish").description("Publishes the block package and refreshes the registry (for v2 block-pack schema)");
73
73
  return e.addOption(new h("-r, --registry <address>", "full address of the registry").env("PL_REGISTRY").makeOptionMandatory()), e.addOption(new h("--registry-serve-url <url>", "CDN serve URL written into block-pack/published.json (npm-consumed blocks)").env("PL_REGISTRY_SERVE_URL").makeOptionMandatory()), e.option("-m, --manifest <path>", "manifest file path", `./block-pack/${r}`), e.option("-v, --version-override <path>", "override package version"), e.addOption(new h("--refresh", "refresh repository after adding the package").default(!0).env("PL_REGISTRY_REFRESH")), e.option("--no-refresh", "do not refresh repository after adding the package"), e.addOption(new h("--unstable", "do not add the published package to stable channel").default(!1).env("PL_PUBLISH_UNSTABLE")), e.action(async (e) => {
74
- let t = new b(), n = g.resolve(e.manifest), r = JSON.parse(await _.promises.readFile(n, { encoding: "utf-8" })), i = re.parse(r);
75
- i = ke(r, i);
74
+ let t = new b(), n = g.resolve(e.manifest), r = JSON.parse(await _.promises.readFile(n, { encoding: "utf-8" })), i = ae.parse(r);
75
+ i = je(r, i);
76
76
  let a = g.dirname(n), c = g.dirname(a);
77
- t.info(`Manifest root = ${a}`), t.info(`Facade root = ${c}`), e.versionOverride && (i = oe(i, e.versionOverride));
77
+ t.info(`Manifest root = ${a}`), t.info(`Facade root = ${c}`), e.versionOverride && (i = ce(i, e.versionOverride));
78
78
  let u = l(e.registry), d = new p(u, t);
79
- await o(d, i, c, async (e) => Buffer.from(await _.promises.readFile(g.resolve(a, e)))), e.unstable || (t.info(`Adding package to ${ie} channel...`), await d.addPackageToChannel(i.description.id, ie));
79
+ await o(d, i, c, async (e) => Buffer.from(await _.promises.readFile(g.resolve(a, e)))), e.unstable || (t.info(`Adding package to ${oe} channel...`), await d.addPackageToChannel(i.description.id, oe));
80
80
  let f = ee({
81
81
  registryUrl: e.registryServeUrl,
82
82
  id: i.description.id
@@ -85,7 +85,7 @@ function Ae() {
85
85
  }), e;
86
86
  }
87
87
  // src/cmd/refresh-registry.ts
88
- function je() {
88
+ function Ne() {
89
89
  let e = new m("refresh-registry").description("Refresh overview files based on published but not proecessed artefacts");
90
90
  return e.addOption(new h("-r, --registry <address>", "full address of the registry").env("PL_REGISTRY").makeOptionMandatory()), e.addOption(new h("-m, --mode <mode>", "refresh mode (allowed valiues: \"force\", \"normal\", \"dry-run\")").choices([
91
91
  "force",
@@ -97,17 +97,17 @@ function je() {
97
97
  }), e;
98
98
  }
99
99
  // src/cmd/mark-stable.ts
100
- function Me() {
100
+ function Pe() {
101
101
  let e = new m("mark-stable").description("Mark target block stable");
102
- return e.option("-i, --modulePath <path>", "input module path", "."), e.addOption(new h("-c, --channel <channel name>", "custom channel").default(ie).hideHelp()), e.option("-v, --version-override <path>", "override package version"), e.addOption(new h("-r, --registry <address>", "full address of the registry").env("PL_REGISTRY").makeOptionMandatory()), e.addOption(new h("--refresh", "refresh repository after adding the package").default(!0).env("PL_REGISTRY_REFRESH")), e.option("--no-refresh", "do not refresh repository after adding the package"), e.option("--unmark", "reverses meaning of this command, flag can be used to remove \"stable\" flag from the package", !1), e.action(async (e) => {
102
+ return e.option("-i, --modulePath <path>", "input module path", "."), e.addOption(new h("-c, --channel <channel name>", "custom channel").default(oe).hideHelp()), e.option("-v, --version-override <path>", "override package version"), e.addOption(new h("-r, --registry <address>", "full address of the registry").env("PL_REGISTRY").makeOptionMandatory()), e.addOption(new h("--refresh", "refresh repository after adding the package").default(!0).env("PL_REGISTRY_REFRESH")), e.option("--no-refresh", "do not refresh repository after adding the package"), e.option("--unmark", "reverses meaning of this command, flag can be used to remove \"stable\" flag from the package", !1), e.action(async (e) => {
103
103
  let t = await ne(g.resolve(e.modulePath));
104
- e.versionOverride && (t = ae(t, e.versionOverride));
104
+ e.versionOverride && (t = se(t, e.versionOverride));
105
105
  let n = l(e.registry), r = new p(n, new b());
106
106
  e.unmark ? await r.removePackageFromChannel(t.id, e.channel) : await r.addPackageToChannel(t.id, e.channel), e.refresh && await r.updateIfNeeded();
107
107
  }), e;
108
108
  }
109
109
  // src/structure/engine/fs/node.ts
110
- var Ne = class {
110
+ var Fe = class {
111
111
  root;
112
112
  constructor(e) {
113
113
  this.root = e;
@@ -172,7 +172,7 @@ var Ne = class {
172
172
  force: !0
173
173
  });
174
174
  }
175
- }, Pe = class {
175
+ }, Ie = class {
176
176
  root;
177
177
  constructor(e) {
178
178
  this.root = e;
@@ -187,54 +187,54 @@ var Ne = class {
187
187
  return _.readFileSync(g.resolve(this.root, "text", e), "utf-8");
188
188
  }
189
189
  };
190
- function Fe(e, t) {
190
+ function Le(e, t) {
191
191
  return e.replace(/\$\{([A-Za-z_][A-Za-z0-9_]*)\}/g, (e, n) => t[n] ?? `\${${n}}`);
192
192
  }
193
193
  // src/structure/engine/flatten.ts
194
- var Ie = ["default", "init"];
195
- function Le(e, t) {
194
+ var Re = ["default", "init"];
195
+ function ze(e, t) {
196
196
  if (!e) return t;
197
197
  if (!t) return e;
198
198
  let n = e.endsWith("/") ? e.slice(0, -1) : e, r = t.startsWith("/") ? t.slice(1) : t;
199
199
  return r ? `${n}/${r}` : n;
200
200
  }
201
- function Re(e, t) {
201
+ function Be(e, t) {
202
202
  return e.filter((e) => e.scope === t).slice().sort((e, t) => e.path.localeCompare(t.path));
203
203
  }
204
- function ze(e, t) {
204
+ function Ve(e, t) {
205
205
  let n = [];
206
206
  function r(e, i, a, o, s) {
207
207
  if (e.kind === "scope") {
208
- let n = Re(t.modules, e.scope);
208
+ let n = Be(t.modules, e.scope);
209
209
  for (let t of n) for (let n of e.children) r(n, e.scope, t.path, o, s);
210
210
  } else if (e.kind === "when") {
211
211
  let t = o.concat(e.trigger);
212
212
  for (let n of e.children) r(n, i, a, t, s);
213
213
  } else if (e.kind === "mode") for (let t of e.children) r(t, i, a, o, e.modes);
214
214
  else {
215
- if (i === void 0 || a === void 0) throw Error(`flatten: leaf '${Ve(e)}' is not inside a scope() frame`);
215
+ if (i === void 0 || a === void 0) throw Error(`flatten: leaf '${Ue(e)}' is not inside a scope() frame`);
216
216
  e.kind === "rename" ? n.push({
217
217
  leaf: e,
218
218
  scope: i,
219
219
  modulePath: a,
220
- resolvedPath: Le(a, e.from),
221
- resolvedTo: Le(a, e.to),
220
+ resolvedPath: ze(a, e.from),
221
+ resolvedTo: ze(a, e.to),
222
222
  triggers: o,
223
223
  modes: s
224
224
  }) : n.push({
225
225
  leaf: e,
226
226
  scope: i,
227
227
  modulePath: a,
228
- resolvedPath: Le(a, Be(e)),
228
+ resolvedPath: ze(a, He(e)),
229
229
  triggers: o,
230
230
  modes: s
231
231
  });
232
232
  }
233
233
  }
234
- for (let t of e.children) r(t, void 0, void 0, [], Ie);
234
+ for (let t of e.children) r(t, void 0, void 0, [], Re);
235
235
  return n;
236
236
  }
237
- function Be(e) {
237
+ function He(e) {
238
238
  switch (e.kind) {
239
239
  case "fixed":
240
240
  case "managed":
@@ -244,45 +244,45 @@ function Be(e) {
244
244
  case "rename": return e.from;
245
245
  }
246
246
  }
247
- function Ve(e) {
247
+ function Ue(e) {
248
248
  return e.kind === "rename" ? `rename ${e.from} -> ${e.to}` : `${e.kind} ${e.path}`;
249
249
  }
250
250
  // src/structure/engine/glob.ts
251
- var He = /[.+^${}()|[\]\\]/g;
252
- function Ue(e) {
251
+ var We = /[.+^${}()|[\]\\]/g;
252
+ function Ge(e) {
253
253
  let t = "";
254
254
  for (let n = 0; n < e.length; n++) {
255
255
  let r = e[n];
256
- r === "*" ? e[n + 1] === "*" ? (n++, e[n + 1] === "/" ? (n++, t += "(?:.*/)?") : t += ".*") : t += "[^/]*" : t += r === "?" ? "[^/]" : r.replace(He, "\\$&");
256
+ r === "*" ? e[n + 1] === "*" ? (n++, e[n + 1] === "/" ? (n++, t += "(?:.*/)?") : t += ".*") : t += "[^/]*" : t += r === "?" ? "[^/]" : r.replace(We, "\\$&");
257
257
  }
258
258
  return RegExp(`^${t}$`);
259
259
  }
260
- function We(e, t) {
261
- return Ue(e).test(t);
260
+ function Ke(e, t) {
261
+ return Ge(e).test(t);
262
262
  }
263
263
  // src/structure/engine/builders.ts
264
- var x, Ge;
265
- function Ke(e) {
264
+ var x, qe;
265
+ function Je(e) {
266
266
  if (!x) throw Error(`${e}() called outside defineStructure(). Builders must run inside the lambda passed to defineStructure(...).`);
267
267
  return x;
268
268
  }
269
- function qe(e, t) {
270
- let n = Ke(e);
269
+ function Ye(e, t) {
270
+ let n = Je(e);
271
271
  n.stack[n.stack.length - 1].push(t);
272
272
  }
273
- function Je(e, t) {
274
- let n = Ge;
275
- Ge = e;
273
+ function Xe(e, t) {
274
+ let n = qe;
275
+ qe = e;
276
276
  try {
277
277
  return t();
278
278
  } finally {
279
- Ge = n;
279
+ qe = n;
280
280
  }
281
281
  }
282
- function Ye() {
283
- return Ge;
282
+ function Ze() {
283
+ return qe;
284
284
  }
285
- function Xe(e) {
285
+ function Qe(e) {
286
286
  if (x) throw Error("defineStructure() cannot be called from inside another defineStructure().");
287
287
  let t = [], n = {
288
288
  root: t,
@@ -293,12 +293,12 @@ function Xe(e) {
293
293
  try {
294
294
  if (e(), n.stack.length !== 1) throw Error(`defineStructure: builder body left ${n.stack.length - 1} unclosed group frame(s)`);
295
295
  let r = { children: t };
296
- return Ze(r), r;
296
+ return $e(r), r;
297
297
  } finally {
298
298
  x = void 0;
299
299
  }
300
300
  }
301
- function Ze(e) {
301
+ function $e(e) {
302
302
  let t = /* @__PURE__ */ new Map();
303
303
  function n(e, r) {
304
304
  if (e.kind === "scope") {
@@ -322,7 +322,7 @@ function Ze(e) {
322
322
  }
323
323
  }
324
324
  function S(e, t) {
325
- let n = Ke("scope");
325
+ let n = Je("scope");
326
326
  if (n.inScope) throw Error("scope() cannot nest. Already inside a scope.");
327
327
  let r = {
328
328
  kind: "scope",
@@ -336,18 +336,18 @@ function S(e, t) {
336
336
  n.stack.pop(), n.inScope = !1;
337
337
  }
338
338
  }
339
- var Qe;
340
- function $e(e) {
341
- Qe = e;
339
+ var et;
340
+ function tt(e) {
341
+ et = e;
342
342
  }
343
343
  function C(e, t, n) {
344
- et(e, t), n && et((t) => !e(t), n);
344
+ nt(e, t), n && nt((t) => !e(t), n);
345
345
  }
346
- function et(e, t) {
347
- if (x) tt(e, t);
348
- else if (!(Qe?.(e, t) ?? !1)) throw Error("when() called outside defineStructure() and outside any managed(...) body. Place this call inside one of the two.");
346
+ function nt(e, t) {
347
+ if (x) rt(e, t);
348
+ else if (!(et?.(e, t) ?? !1)) throw Error("when() called outside defineStructure() and outside any managed(...) body. Place this call inside one of the two.");
349
349
  }
350
- function tt(e, t) {
350
+ function rt(e, t) {
351
351
  let n = x, r = {
352
352
  kind: "when",
353
353
  trigger: e,
@@ -363,8 +363,8 @@ function tt(e, t) {
363
363
  function w(e) {
364
364
  return (t) => t.filesMatch(e);
365
365
  }
366
- function nt(e, t, n) {
367
- let r = Ke(e), i = {
366
+ function it(e, t, n) {
367
+ let r = Je(e), i = {
368
368
  kind: "mode",
369
369
  modes: t,
370
370
  children: []
@@ -376,18 +376,18 @@ function nt(e, t, n) {
376
376
  r.stack.pop();
377
377
  }
378
378
  }
379
- function rt(e) {
380
- nt("onInitOrUpdate", ["init", "updateDeps"], e);
379
+ function at(e) {
380
+ it("onInitOrUpdate", ["init", "updateDeps"], e);
381
381
  }
382
382
  function T(e, t) {
383
- qe("fixed", {
383
+ Ye("fixed", {
384
384
  kind: "fixed",
385
385
  path: e,
386
386
  content: t
387
387
  });
388
388
  }
389
389
  function E(e, t, n) {
390
- qe("managed", {
390
+ Ye("managed", {
391
391
  kind: "managed",
392
392
  path: e,
393
393
  initial: t,
@@ -395,21 +395,21 @@ function E(e, t, n) {
395
395
  });
396
396
  }
397
397
  function D(e, t) {
398
- qe("scaffold", {
398
+ Ye("scaffold", {
399
399
  kind: "scaffold",
400
400
  path: e,
401
401
  initial: t
402
402
  });
403
403
  }
404
404
  function O(e, t) {
405
- qe("seed", {
405
+ Ye("seed", {
406
406
  kind: "seed",
407
407
  path: e,
408
408
  initial: t
409
409
  });
410
410
  }
411
411
  function k(e) {
412
- qe("remove", {
412
+ Ye("remove", {
413
413
  kind: "remove",
414
414
  path: e
415
415
  });
@@ -420,13 +420,13 @@ function A(e) {
420
420
  path: e
421
421
  };
422
422
  }
423
- function it(e) {
423
+ function ot(e) {
424
424
  return {
425
425
  kind: "binary",
426
426
  path: e
427
427
  };
428
428
  }
429
- function at(e) {
429
+ function st(e) {
430
430
  return {
431
431
  kind: "text",
432
432
  value: e
@@ -446,29 +446,29 @@ function M(e) {
446
446
  };
447
447
  }
448
448
  // src/structure/engine/parsers/json.ts
449
- var ot = /* @__PURE__ */ a(t());
450
- function st(e) {
449
+ var ct = /* @__PURE__ */ a(t());
450
+ function lt(e) {
451
451
  return JSON.parse(e);
452
452
  }
453
- var ct = 100, lt = 2;
454
- function ut(e) {
455
- return e.length === 0 ? "[]" : "[" + e.map(dt).join(", ") + "]";
453
+ var ut = 100, dt = 2;
454
+ function ft(e) {
455
+ return e.length === 0 ? "[]" : "[" + e.map(pt).join(", ") + "]";
456
456
  }
457
- function dt(e) {
458
- if (Array.isArray(e)) return ut(e);
457
+ function pt(e) {
458
+ if (Array.isArray(e)) return ft(e);
459
459
  if (N(e)) {
460
460
  let t = Object.entries(e);
461
- return t.length === 0 ? "{}" : "{ " + t.map(([e, t]) => `${JSON.stringify(e)}: ${dt(t)}`).join(", ") + " }";
461
+ return t.length === 0 ? "{}" : "{ " + t.map(([e, t]) => `${JSON.stringify(e)}: ${pt(t)}`).join(", ") + " }";
462
462
  }
463
463
  return JSON.stringify(e);
464
464
  }
465
- function ft(e, t, n, r) {
466
- let i = t + lt, a = " ".repeat(i);
465
+ function mt(e, t, n, r) {
466
+ let i = t + dt, a = " ".repeat(i);
467
467
  if (Array.isArray(e)) {
468
- let o = ut(e);
469
- if (n + o.length + r <= ct) return o;
468
+ let o = ft(e);
469
+ if (n + o.length + r <= ut) return o;
470
470
  let s = e.length - 1;
471
- return "[\n" + e.map((e, t) => a + ft(e, i, i, t === s ? 0 : 1)).join(",\n") + "\n" + " ".repeat(t) + "]";
471
+ return "[\n" + e.map((e, t) => a + mt(e, i, i, t === s ? 0 : 1)).join(",\n") + "\n" + " ".repeat(t) + "]";
472
472
  }
473
473
  if (N(e)) {
474
474
  let n = Object.entries(e);
@@ -476,30 +476,30 @@ function ft(e, t, n, r) {
476
476
  let r = n.length - 1;
477
477
  return "{\n" + n.map(([e, t], n) => {
478
478
  let o = `${a}${JSON.stringify(e)}: `;
479
- return o + ft(t, i, o.length, n === r ? 0 : 1);
479
+ return o + mt(t, i, o.length, n === r ? 0 : 1);
480
480
  }).join(",\n") + "\n" + " ".repeat(t) + "}";
481
481
  }
482
482
  return JSON.stringify(e);
483
483
  }
484
- function pt(e, t) {
485
- return t?.collapse ? ft(JSON.parse(JSON.stringify(e ?? null)), 0, 0, 0) + "\n" : JSON.stringify(e, null, 2) + "\n";
484
+ function ht(e, t) {
485
+ return t?.collapse ? mt(JSON.parse(JSON.stringify(e ?? null)), 0, 0, 0) + "\n" : JSON.stringify(e, null, 2) + "\n";
486
486
  }
487
- function mt(e) {
487
+ function gt(e) {
488
488
  return e === "" || e === void 0 ? [] : e.split(".");
489
489
  }
490
490
  function N(e) {
491
491
  return typeof e == "object" && !!e && !Array.isArray(e);
492
492
  }
493
- function ht(e, t) {
494
- let n = mt(t), r = e;
493
+ function _t(e, t) {
494
+ let n = gt(t), r = e;
495
495
  for (let e of n) {
496
496
  if (!N(r)) return;
497
497
  r = r[e];
498
498
  }
499
499
  return r;
500
500
  }
501
- function gt(e, t) {
502
- let n = mt(t);
501
+ function vt(e, t) {
502
+ let n = gt(t);
503
503
  if (n.length === 0) return !0;
504
504
  let r = e;
505
505
  for (let e = 0; e < n.length - 1; e++) {
@@ -508,8 +508,8 @@ function gt(e, t) {
508
508
  }
509
509
  return N(r) ? n[n.length - 1] in r : !1;
510
510
  }
511
- function _t(e, t, n) {
512
- let r = mt(t);
511
+ function yt(e, t, n) {
512
+ let r = gt(t);
513
513
  if (r.length === 0) throw Error("setAtPath: jsonPath must be non-empty");
514
514
  let i = e;
515
515
  for (let e = 0; e < r.length - 1; e++) {
@@ -522,8 +522,8 @@ function _t(e, t, n) {
522
522
  }
523
523
  i[r[r.length - 1]] = n;
524
524
  }
525
- function vt(e, t) {
526
- let n = mt(t);
525
+ function bt(e, t) {
526
+ let n = gt(t);
527
527
  if (n.length === 0) throw Error("deleteAtPath: jsonPath must be non-empty");
528
528
  let r = e;
529
529
  for (let e = 0; e < n.length - 1; e++) {
@@ -532,7 +532,7 @@ function vt(e, t) {
532
532
  }
533
533
  N(r) && delete r[n[n.length - 1]];
534
534
  }
535
- function yt(e, t) {
535
+ function xt(e, t) {
536
536
  let n = new Set(t), r = Object.keys(e), i = /* @__PURE__ */ new Map();
537
537
  i.set("", []);
538
538
  let a = "";
@@ -546,69 +546,69 @@ function yt(e, t) {
546
546
  return o;
547
547
  }
548
548
  // src/structure/engine/parsers/lines.ts
549
- function bt(e) {
549
+ function St(e) {
550
550
  let t = e.split("\n");
551
551
  return t.length > 0 && t[t.length - 1] === "" && t.pop(), t;
552
552
  }
553
- function xt(e) {
553
+ function Ct(e) {
554
554
  return e.join("\n") + "\n";
555
555
  }
556
- function St(e) {
556
+ function wt(e) {
557
557
  return e.replace(/(^|\s)#.*$/, "$1").trim();
558
558
  }
559
- function Ct(e, t) {
560
- let n = St(e);
559
+ function Tt(e, t) {
560
+ let n = wt(e);
561
561
  return n !== "" && n === t.trim();
562
562
  }
563
- function wt(e, t) {
564
- for (let n of e) if (Ct(n, t)) return !0;
563
+ function Et(e, t) {
564
+ for (let n of e) if (Tt(n, t)) return !0;
565
565
  return !1;
566
566
  }
567
567
  // src/structure/engine/content-rules.ts
568
- function Tt(e, t) {
568
+ function Dt(e, t) {
569
569
  return e === "sdk:" ? t ? "workspace:*" : "catalog:" : e;
570
570
  }
571
- var Et = [
571
+ var Ot = [
572
572
  "dependencies",
573
573
  "devDependencies",
574
574
  "peerDependencies",
575
575
  "optionalDependencies"
576
576
  ];
577
- function Dt(e, t) {
578
- if (L(e)) for (let n of Et) {
577
+ function kt(e, t) {
578
+ if (L(e)) for (let n of Ot) {
579
579
  let r = e[n];
580
580
  if (L(r)) for (let e of Object.keys(r)) r[e] === "sdk:" && (r[e] = t ? "workspace:*" : "catalog:");
581
581
  }
582
582
  }
583
583
  var P;
584
- function Ot(e) {
584
+ function At(e) {
585
585
  if (!P) throw Error(`${e}() only valid inside a managed(...) body. Move this call inside managed(path, initial, () => {...}).`);
586
586
  return P;
587
587
  }
588
588
  function F(e) {
589
- let t = Ot(e);
589
+ let t = At(e);
590
590
  if (t.kind !== "json") throw Error(`${e}() requires a JSON-managed body; got '${t.kind}'.`);
591
591
  return t;
592
592
  }
593
593
  function I(e) {
594
- let t = Ot(e);
594
+ let t = At(e);
595
595
  if (t.kind !== "yaml") throw Error(`${e}() requires a YAML-managed body; got '${t.kind}'.`);
596
596
  return t;
597
597
  }
598
- function kt(e) {
599
- let t = Ot(e);
598
+ function jt(e) {
599
+ let t = At(e);
600
600
  if (t.kind !== "lines") throw Error(`${e}() requires a lines-managed body; got '${t.kind}'.`);
601
601
  return t;
602
602
  }
603
- function At(e, t) {
604
- let n = e.ctx ?? Ye();
603
+ function Mt(e, t) {
604
+ let n = e.ctx ?? Ze();
605
605
  if (!n) throw Error(`${t}() needs a RunContext but none is active. Pass { ctx } via the with-managed-* helper or run inside engine.run(...).`);
606
606
  return n;
607
607
  }
608
608
  function L(e) {
609
609
  return typeof e == "object" && !!e && !Array.isArray(e);
610
610
  }
611
- function jt(e, t, n = {}) {
611
+ function Nt(e, t, n = {}) {
612
612
  if (P) throw Error("Nested managed(...) body — engine bug.");
613
613
  P = {
614
614
  kind: "json",
@@ -622,7 +622,7 @@ function jt(e, t, n = {}) {
622
622
  P = void 0;
623
623
  }
624
624
  }
625
- function Mt(e, t, n = {}) {
625
+ function Pt(e, t, n = {}) {
626
626
  if (P) throw Error("Nested managed(...) body — engine bug.");
627
627
  P = {
628
628
  kind: "yaml",
@@ -638,7 +638,7 @@ function Mt(e, t, n = {}) {
638
638
  P = void 0;
639
639
  }
640
640
  }
641
- function Nt(e, t, n = {}) {
641
+ function Ft(e, t, n = {}) {
642
642
  if (P) throw Error("Nested managed(...) body — engine bug.");
643
643
  P = {
644
644
  kind: "lines",
@@ -652,30 +652,30 @@ function Nt(e, t, n = {}) {
652
652
  P = void 0;
653
653
  }
654
654
  }
655
- $e((e, t) => {
655
+ tt((e, t) => {
656
656
  if (!P) return !1;
657
657
  let n = P.triggerContext;
658
658
  if (!n) throw Error("when() inside a managed(...) body requires a triggerContext. The runner supplies it via the `triggerContext` opt to with-managed-*; ensure your test/test helper passes one.");
659
659
  return e(n) && t(), !0;
660
660
  });
661
661
  function R(e, t) {
662
- _t(F("ensureField").obj, e, t);
662
+ yt(F("ensureField").obj, e, t);
663
663
  }
664
664
  function z(e, t) {
665
665
  let n = F("removeField").obj;
666
- gt(n, e) && (!t || t(ht(n, e))) && vt(n, e);
666
+ vt(n, e) && (!t || t(_t(n, e))) && bt(n, e);
667
667
  }
668
- function Pt(e, t) {
668
+ function It(e, t) {
669
669
  let n = F("requireField").obj;
670
- if (!gt(n, e)) throw Error(t ?? `requireField: missing field '${e}'`);
670
+ if (!vt(n, e)) throw Error(t ?? `requireField: missing field '${e}'`);
671
671
  }
672
- function Ft(e, t) {
673
- if (gt(F("forbidField").obj, e)) throw Error(t);
672
+ function Lt(e, t) {
673
+ if (vt(F("forbidField").obj, e)) throw Error(t);
674
674
  }
675
- function It(e, t) {
676
- let n = F("ensureFieldEntries").obj, r = gt(n, e) ? ht(n, e) : void 0, i = L(r) ? r : {};
675
+ function Rt(e, t) {
676
+ let n = F("ensureFieldEntries").obj, r = vt(n, e) ? _t(n, e) : void 0, i = L(r) ? r : {};
677
677
  for (let [e, n] of Object.entries(t)) i[e] = n;
678
- L(r) || _t(n, e, i);
678
+ L(r) || yt(n, e, i);
679
679
  }
680
680
  function B(e, t) {
681
681
  R(`scripts.${e}`, t);
@@ -683,15 +683,15 @@ function B(e, t) {
683
683
  function V(e) {
684
684
  z(`scripts.${e}`);
685
685
  }
686
- var Lt = [
686
+ var zt = [
687
687
  "dependencies",
688
688
  "devDependencies",
689
689
  "peerDependencies",
690
690
  "optionalDependencies"
691
691
  ];
692
- function Rt(e, t, n, r) {
693
- let i = F(e), a = i.obj, o = n === "sdk:" ? Tt(n, At(i, e).isSdkInternal) : n;
694
- for (let e of Lt) {
692
+ function Bt(e, t, n, r) {
693
+ let i = F(e), a = i.obj, o = n === "sdk:" ? Dt(n, Mt(i, e).isSdkInternal) : n;
694
+ for (let e of zt) {
695
695
  if (e === r) continue;
696
696
  let n = a[e];
697
697
  L(n) && t in n && delete n[t];
@@ -699,18 +699,18 @@ function Rt(e, t, n, r) {
699
699
  let s = a[r], c = L(s) ? s : {};
700
700
  c[t] = o, L(s) || (a[r] = c);
701
701
  }
702
- function zt(e, t) {
703
- Rt("ensureDep", e, t, "dependencies");
702
+ function Vt(e, t) {
703
+ Bt("ensureDep", e, t, "dependencies");
704
704
  }
705
705
  function H(e, t) {
706
- Rt("ensureDevDep", e, t, "devDependencies");
706
+ Bt("ensureDevDep", e, t, "devDependencies");
707
707
  }
708
- function Bt(e, t) {
709
- Rt("ensurePeerDep", e, t, "peerDependencies");
708
+ function Ht(e, t) {
709
+ Bt("ensurePeerDep", e, t, "peerDependencies");
710
710
  }
711
711
  function U(e) {
712
712
  let t = F("removeDep").obj;
713
- for (let n of Lt) {
713
+ for (let n of zt) {
714
714
  let r = t[n];
715
715
  L(r) && e in r && delete r[e];
716
716
  }
@@ -718,139 +718,139 @@ function U(e) {
718
718
  function W(e) {
719
719
  for (let [t, n] of Object.entries(e)) H(t, n);
720
720
  }
721
- function Vt(e) {
722
- for (let [t, n] of Object.entries(e)) Bt(t, n);
723
- }
724
- function Ht(e, t, n) {
725
- let r = At(F(e), e);
726
- for (let i of r.modules) i.scope === t && Rt(e, i.name, "workspace:*", n);
727
- }
728
721
  function Ut(e) {
729
- Ht("ensureWorkspaceScopeDeps", e, "dependencies");
722
+ for (let [t, n] of Object.entries(e)) Ht(t, n);
730
723
  }
731
- function Wt(e) {
732
- Ht("ensureWorkspaceScopeDevDeps", e, "devDependencies");
724
+ function Wt(e, t, n) {
725
+ let r = Mt(F(e), e);
726
+ for (let i of r.modules) i.scope === t && Bt(e, i.name, "workspace:*", n);
733
727
  }
734
728
  function Gt(e) {
729
+ Wt("ensureWorkspaceScopeDeps", e, "dependencies");
730
+ }
731
+ function Kt(e) {
732
+ Wt("ensureWorkspaceScopeDevDeps", e, "devDependencies");
733
+ }
734
+ function qt(e) {
735
735
  let t = F("pruneKeysMatching").obj;
736
736
  for (let n of Object.keys(t)) e(n, t[n]) && delete t[n];
737
737
  }
738
- function Kt(e, t) {
739
- let n = yt(e, t);
738
+ function Jt(e, t) {
739
+ let n = xt(e, t);
740
740
  for (let t of Object.keys(e)) delete e[t];
741
741
  for (let t of Object.keys(n)) e[t] = n[t];
742
742
  }
743
743
  function G(e) {
744
- Kt(F("enforceFieldOrder").obj, e);
744
+ Jt(F("enforceFieldOrder").obj, e);
745
745
  }
746
- function qt(e, t) {
746
+ function Yt(e, t) {
747
747
  let n = Object.keys(e).sort(), r = {};
748
748
  for (let t of n) r[t] = e[t];
749
749
  for (let t of Object.keys(e)) delete e[t];
750
- for (let i of n) e[i] = r[i], t && L(e[i]) && qt(e[i], !0);
750
+ for (let i of n) e[i] = r[i], t && L(e[i]) && Yt(e[i], !0);
751
751
  }
752
752
  function K(e = "", t = {}) {
753
753
  let n = t.recursive ?? !1;
754
754
  if (e === "" && !n) return;
755
755
  let r = F("enforceAlphabeticalOrder").obj;
756
756
  if (e === "") {
757
- qt(r, !0);
757
+ Yt(r, !0);
758
758
  return;
759
759
  }
760
- let i = ht(r, e);
761
- L(i) && qt(i, n);
760
+ let i = _t(r, e);
761
+ L(i) && Yt(i, n);
762
762
  }
763
- function Jt(e, t) {
763
+ function Xt(e, t) {
764
764
  let n = F("transformAt").obj;
765
- _t(n, e, t(ht(n, e)));
765
+ yt(n, e, t(_t(n, e)));
766
766
  }
767
- function Yt() {
768
- let e = I("ensureWorkspaceModulePaths"), t = At(e, "ensureWorkspaceModulePaths").modules.filter((e) => e.path !== "").map((e) => e.path).sort(), n = e.doc.toJSON()?.packages;
767
+ function Zt() {
768
+ let e = I("ensureWorkspaceModulePaths"), t = Mt(e, "ensureWorkspaceModulePaths").modules.filter((e) => e.path !== "").map((e) => e.path).sort(), n = e.doc.toJSON()?.packages;
769
769
  Array.isArray(n) && n.length === t.length && n.every((e, n) => e === t[n]) || e.doc.setIn(["packages"], t);
770
770
  }
771
- function Xt(e, t) {
771
+ function Qt(e, t) {
772
772
  let n = e.doc.getIn(["catalog", t]);
773
773
  return typeof n == "string" ? n : void 0;
774
774
  }
775
- function Zt(e, t) {
775
+ function $t(e, t) {
776
776
  let n = I("ensureCatalogVersion");
777
- Xt(n, e) === void 0 && n.doc.setIn(["catalog", e], t);
777
+ Qt(n, e) === void 0 && n.doc.setIn(["catalog", e], t);
778
778
  }
779
- function Qt(e) {
779
+ function en(e) {
780
780
  let t = I("ensureCatalogLatest");
781
781
  if (!t.getLatestVersion) return;
782
782
  let n = t.getLatestVersion(e);
783
- n !== void 0 && Xt(t, e) !== n && t.doc.setIn(["catalog", e], n);
783
+ n !== void 0 && Qt(t, e) !== n && t.doc.setIn(["catalog", e], n);
784
784
  }
785
- function $t(e, t) {
785
+ function tn(e, t) {
786
786
  let n = I("pinCatalogToDependencyOf");
787
787
  if (!n.getDerivedDependencyPin) return;
788
788
  let r = n.getDerivedDependencyPin(e);
789
- r !== void 0 && Xt(n, e) !== r && n.doc.setIn(["catalog", e], r);
789
+ r !== void 0 && Qt(n, e) !== r && n.doc.setIn(["catalog", e], r);
790
790
  }
791
- function en(e, t) {
792
- let n = I("ensureCatalogAtLeast"), r = Xt(n, e), i = (0, ot.minVersion)(t), a = r !== void 0 && (0, ot.validRange)(r) !== null ? (0, ot.minVersion)(r) : null;
793
- (r === void 0 || i !== null && a !== null && !(0, ot.gte)(a, i)) && n.doc.setIn(["catalog", e], t);
791
+ function nn(e, t) {
792
+ let n = I("ensureCatalogAtLeast"), r = Qt(n, e), i = (0, ct.minVersion)(t), a = r !== void 0 && (0, ct.validRange)(r) !== null ? (0, ct.minVersion)(r) : null;
793
+ (r === void 0 || i !== null && a !== null && !(0, ct.gte)(a, i)) && n.doc.setIn(["catalog", e], t);
794
794
  }
795
- function tn(e) {
795
+ function rn(e) {
796
796
  let t = I("ensureCatalogAbsent");
797
797
  t.doc.hasIn(["catalog", e]) && t.doc.deleteIn(["catalog", e]);
798
798
  }
799
- function nn(e, t, { keepExisting: n = !1 } = {}) {
799
+ function an(e, t, { keepExisting: n = !1 } = {}) {
800
800
  let r = I("ensureWorkspaceMapEntries");
801
- de(r.doc.get(e)) || r.doc.delete(e);
801
+ pe(r.doc.get(e)) || r.doc.delete(e);
802
802
  let i = Object.entries(t).filter(([t, i]) => n ? !r.doc.hasIn([e, t]) : r.doc.getIn([e, t]) !== i);
803
803
  for (let [t, n] of i) r.doc.setIn([e, t], n);
804
804
  }
805
- function rn(e, t) {
805
+ function on(e, t) {
806
806
  let n = I("ensureWorkspaceListItems"), r = n.doc.toJSON()?.[e], i = new Set(Array.isArray(r) ? r : []), a = t.filter((e) => !i.has(e));
807
807
  if (a.length !== 0) {
808
- if (!fe(n.doc.get(e))) n.doc.set(e, a);
808
+ if (!me(n.doc.get(e))) n.doc.set(e, a);
809
809
  else for (let t of a) n.doc.addIn([e], t);
810
810
  }
811
811
  }
812
- function an(e) {
813
- let t = kt("ensureGitignoreEntries");
814
- for (let n of e) wt(t.lines, n) || t.lines.push(n);
812
+ function sn(e) {
813
+ let t = jt("ensureGitignoreEntries");
814
+ for (let n of e) Et(t.lines, n) || t.lines.push(n);
815
815
  }
816
816
  // src/structure/engine/parsers/yaml.ts
817
- function on(e) {
818
- return me(e);
817
+ function cn(e) {
818
+ return ge(e);
819
819
  }
820
- function sn(e) {
820
+ function ln(e) {
821
821
  return e.toString();
822
822
  }
823
- var cn = ".structure";
824
- function ln(e) {
823
+ var un = ".structure";
824
+ function dn(e) {
825
825
  if (!e.exists(".structure")) return { version: 0 };
826
826
  try {
827
- let t = JSON.parse(e.read(cn));
827
+ let t = JSON.parse(e.read(un));
828
828
  return { version: typeof t?.version == "number" ? t.version : 0 };
829
829
  } catch {
830
830
  return { version: 0 };
831
831
  }
832
832
  }
833
- function un(e, t = 0) {
834
- if (e < t) throw new dn(e, t);
833
+ function fn(e, t = 0) {
834
+ if (e < t) throw new pn(e, t);
835
835
  }
836
- var dn = class extends Error {
836
+ var pn = class extends Error {
837
837
  version;
838
838
  floor;
839
839
  constructor(e, t) {
840
840
  super(`Block .structure version is ${e}, below floor ${t}. Bootstrap via the legacy-migration skill, then re-run.`), this.version = e, this.floor = t, this.name = "StructureVersionFloorError";
841
841
  }
842
842
  };
843
- function fn(e, t) {
844
- e.write(cn, JSON.stringify(t));
843
+ function mn(e, t) {
844
+ e.write(un, JSON.stringify(t));
845
845
  }
846
846
  // src/structure/engine/runner.ts
847
- var pn = class extends Error {
847
+ var hn = class extends Error {
848
848
  failing;
849
849
  constructor(e) {
850
850
  super(`Post-run recheck: rule set not idempotent. Failing item: ${e.primitive} '${e.path}' (scope=${e.scope}, action=${e.action}). Engine bug.`), this.failing = e, this.name = "RecheckError";
851
851
  }
852
852
  };
853
- function mn(e, t, n, r) {
853
+ function gn(e, t, n, r) {
854
854
  switch (e.kind) {
855
855
  case "text": return e.value;
856
856
  case "file":
@@ -858,45 +858,45 @@ function mn(e, t, n, r) {
858
858
  return n.staticRead(e.path);
859
859
  case "tpl":
860
860
  if (!n) throw Error(`tpl('${e.path}'): no TemplateProvider configured. Pass opts.templates to engine.run(...).`);
861
- return Fe(n.textRead(e.path), typeof e.vars == "function" ? e.vars(r) : e.vars);
861
+ return Le(n.textRead(e.path), typeof e.vars == "function" ? e.vars(r) : e.vars);
862
862
  case "generate": {
863
863
  let n = e.fn(r);
864
- if (t.endsWith(".json")) return Dt(n, r.isSdkInternal), pt(n, { collapse: !t.endsWith("package.json") });
865
- if (t.endsWith(".yaml") || t.endsWith(".yml")) return he(n);
864
+ if (t.endsWith(".json")) return kt(n, r.isSdkInternal), ht(n, { collapse: !t.endsWith("package.json") });
865
+ if (t.endsWith(".yaml") || t.endsWith(".yml")) return _e(n);
866
866
  if (typeof n != "string") throw Error(`generate() for '${t}' must return a string for non-JSON/YAML files; got ${typeof n}`);
867
867
  return n;
868
868
  }
869
869
  case "binary": throw Error(`binary('${e.path}') cannot be resolved to a string; it is only valid inside seed()/scaffold(), which copy it verbatim via fs.writeBinary.`);
870
870
  }
871
871
  }
872
- function hn(e, t, n, r, i) {
872
+ function _n(e, t, n, r, i) {
873
873
  if (n.kind === "binary") {
874
874
  if (!r) throw Error(`binary('${n.path}'): no TemplateProvider configured. Pass opts.templates to engine.run(...).`);
875
875
  e.writeBinary(t, r.staticReadBinary(n.path));
876
- } else e.write(t, mn(n, t, r, i));
876
+ } else e.write(t, gn(n, t, r, i));
877
877
  }
878
- function gn(e, t, n, r, i, a) {
878
+ function vn(e, t, n, r, i, a) {
879
879
  let o = e.split("/").pop() ?? e;
880
880
  if (e.endsWith(".json")) {
881
- let i = st(t);
881
+ let i = lt(t);
882
882
  if (typeof i != "object" || !i || Array.isArray(i)) throw Error(`managed: parsed value at '${e}' is not a JSON object`);
883
- return jt(i, n, { triggerContext: r }), pt(i, { collapse: o !== "package.json" });
883
+ return Nt(i, n, { triggerContext: r }), ht(i, { collapse: o !== "package.json" });
884
884
  }
885
885
  if (e.endsWith(".yaml") || e.endsWith(".yml")) {
886
- let e = on(t);
887
- return Mt(e, n, {
886
+ let e = cn(t);
887
+ return Pt(e, n, {
888
888
  triggerContext: r,
889
889
  getLatestVersion: i,
890
890
  getDerivedDependencyPin: a
891
- }), sn(e);
891
+ }), ln(e);
892
892
  }
893
893
  if (o === ".gitignore" || o.endsWith(".gitignore")) {
894
- let e = bt(t);
895
- return Nt(e, n, { triggerContext: r }), xt(e);
894
+ let e = St(t);
895
+ return Ft(e, n, { triggerContext: r }), Ct(e);
896
896
  }
897
897
  throw Error(`managed('${e}'): unsupported file kind. Only .json, .yaml, .yml, .gitignore are dispatched.`);
898
898
  }
899
- function _n(e) {
899
+ function yn(e) {
900
900
  let t = e.list(""), n = /* @__PURE__ */ new Set();
901
901
  for (let e of t) {
902
902
  n.add(e);
@@ -905,37 +905,37 @@ function _n(e) {
905
905
  }
906
906
  return n;
907
907
  }
908
- function vn(e, t) {
908
+ function bn(e, t) {
909
909
  let n = t === "" ? t : t.endsWith("/") ? t.slice(0, -1) : t;
910
910
  return e.has(n);
911
911
  }
912
- function yn(e, t, n) {
912
+ function xn(e, t, n) {
913
913
  return {
914
914
  ctx: t,
915
915
  version: t.version,
916
- pathExists: (t) => vn(e, t),
917
- pathMissing: (t) => !vn(e, t),
916
+ pathExists: (t) => bn(e, t),
917
+ pathMissing: (t) => !bn(e, t),
918
918
  filesMatch: (t) => {
919
919
  let r = n ? `${n}/${t}` : t;
920
- for (let t of e) if (We(r, t)) return !0;
920
+ for (let t of e) if (Ke(r, t)) return !0;
921
921
  return !1;
922
922
  }
923
923
  };
924
924
  }
925
- function bn(e, t) {
925
+ function Sn(e, t) {
926
926
  for (let n of e.triggers) if (!n(t)) return !1;
927
927
  return !0;
928
928
  }
929
- function xn(e, t) {
929
+ function Cn(e, t) {
930
930
  return t ? "init" : e.updateDepsOnly ? "updateDeps" : "default";
931
931
  }
932
- function Sn(e, t) {
932
+ function wn(e, t) {
933
933
  return e.filter((e) => e.modes.includes(t));
934
934
  }
935
- function Cn(e, t, n, r, i, a) {
935
+ function Tn(e, t, n, r, i, a) {
936
936
  let o = e.leaf;
937
937
  if (o.kind === "fixed") {
938
- let i = mn(o.content, e.resolvedPath, r, a);
938
+ let i = gn(o.content, e.resolvedPath, r, a);
939
939
  return t.exists(e.resolvedPath) ? t.read(e.resolvedPath) === i ? void 0 : (n || t.write(e.resolvedPath, i), {
940
940
  scope: e.scope,
941
941
  path: e.resolvedPath,
@@ -948,13 +948,13 @@ function Cn(e, t, n, r, i, a) {
948
948
  action: "create"
949
949
  });
950
950
  }
951
- if (o.kind === "scaffold") return t.exists(e.resolvedPath) ? void 0 : (n || hn(t, e.resolvedPath, o.initial, r, a), {
951
+ if (o.kind === "scaffold") return t.exists(e.resolvedPath) ? void 0 : (n || _n(t, e.resolvedPath, o.initial, r, a), {
952
952
  scope: e.scope,
953
953
  path: e.resolvedPath,
954
954
  primitive: "scaffold",
955
955
  action: "create"
956
956
  });
957
- if (o.kind === "seed") return !i || t.exists(e.resolvedPath) ? void 0 : (n || hn(t, e.resolvedPath, o.initial, r, a), {
957
+ if (o.kind === "seed") return !i || t.exists(e.resolvedPath) ? void 0 : (n || _n(t, e.resolvedPath, o.initial, r, a), {
958
958
  scope: e.scope,
959
959
  path: e.resolvedPath,
960
960
  primitive: "seed",
@@ -977,11 +977,11 @@ function Cn(e, t, n, r, i, a) {
977
977
  });
978
978
  }
979
979
  }
980
- function wn(e, t, n, r, i, a, o, s) {
980
+ function En(e, t, n, r, i, a, o, s) {
981
981
  if (e.leaf.kind !== "managed") return;
982
982
  let c = e.leaf, l = e.resolvedPath, u = t.exists(l), d, f = !1;
983
- u ? d = t.read(l) : (d = mn(c.initial, l, i, s), f = !0);
984
- let ee = gn(l, d, c.body, r, a, o);
983
+ u ? d = t.read(l) : (d = gn(c.initial, l, i, s), f = !0);
984
+ let ee = vn(l, d, c.body, r, a, o);
985
985
  if (f) return n || t.write(l, ee), {
986
986
  scope: e.scope,
987
987
  path: l,
@@ -995,39 +995,39 @@ function wn(e, t, n, r, i, a, o, s) {
995
995
  action: "update"
996
996
  };
997
997
  }
998
- function Tn(e, t, n, r, i, a, o, s) {
999
- let c = Sn(e, xn(n, a)), l = [], u = _n(t);
998
+ function Dn(e, t, n, r, i, a, o, s) {
999
+ let c = wn(e, Cn(n, a)), l = [], u = yn(t);
1000
1000
  for (let e of c) {
1001
- if (e.leaf.kind === "managed" || !bn(e, yn(u, n, e.modulePath))) continue;
1002
- let o = Cn(e, t, r, i, a, n);
1001
+ if (e.leaf.kind === "managed" || !Sn(e, xn(u, n, e.modulePath))) continue;
1002
+ let o = Tn(e, t, r, i, a, n);
1003
1003
  o && l.push(o);
1004
1004
  }
1005
- let d = _n(t);
1005
+ let d = yn(t);
1006
1006
  for (let e of c) {
1007
1007
  if (e.leaf.kind !== "managed") continue;
1008
- let a = yn(d, n, e.modulePath);
1009
- if (!bn(e, a)) continue;
1010
- let c = wn(e, t, r, a, i, o, s, n);
1008
+ let a = xn(d, n, e.modulePath);
1009
+ if (!Sn(e, a)) continue;
1010
+ let c = En(e, t, r, a, i, o, s, n);
1011
1011
  c && l.push(c);
1012
1012
  }
1013
1013
  return l;
1014
1014
  }
1015
- function En(e, t, n, r = {}) {
1016
- return Je(n, () => {
1017
- let i = ze(e, n), a = !!r.initMode, o = Tn(i, t, n, n.dryRun, r.templates, a, r.registryLookup, r.derivedPinLookup);
1015
+ function On(e, t, n, r = {}) {
1016
+ return Xe(n, () => {
1017
+ let i = Ve(e, n), a = !!r.initMode, o = Dn(i, t, n, n.dryRun, r.templates, a, r.registryLookup, r.derivedPinLookup);
1018
1018
  if (!n.dryRun && !n.updateDepsOnly && !a) {
1019
- fn(t, { version: 3 });
1019
+ mn(t, { version: 3 });
1020
1020
  let i = {
1021
1021
  ...r.rediscover ? r.rediscover(t) : n,
1022
1022
  dryRun: !0
1023
- }, a = Tn(ze(e, i), t, i, !0, r.templates, !1, r.registryLookup, r.derivedPinLookup).filter((e) => e.path !== cn);
1024
- if (a.length > 0) throw new pn(a[0]);
1023
+ }, a = Dn(Ve(e, i), t, i, !0, r.templates, !1, r.registryLookup, r.derivedPinLookup).filter((e) => e.path !== un);
1024
+ if (a.length > 0) throw new hn(a[0]);
1025
1025
  }
1026
- return a && !n.dryRun && fn(t, { version: 3 }), { changes: o };
1026
+ return a && !n.dryRun && mn(t, { version: 3 }), { changes: o };
1027
1027
  });
1028
1028
  }
1029
1029
  // src/structure/engine/discovery.ts
1030
- var Dn = [
1030
+ var kn = [
1031
1031
  "root",
1032
1032
  "block",
1033
1033
  "model",
@@ -1036,13 +1036,13 @@ var Dn = [
1036
1036
  "test",
1037
1037
  "software",
1038
1038
  "kind"
1039
- ], On = class extends Error {
1039
+ ], An = class extends Error {
1040
1040
  path;
1041
1041
  constructor(e, t) {
1042
1042
  super(e), this.path = t, this.name = "DiscoveryError";
1043
1043
  }
1044
1044
  };
1045
- function kn(e) {
1045
+ function jn(e) {
1046
1046
  let t = /* @__PURE__ */ new Set();
1047
1047
  for (let n of [
1048
1048
  e.dependencies,
@@ -1052,18 +1052,18 @@ function kn(e) {
1052
1052
  ]) if (n) for (let e of Object.keys(n)) t.add(e);
1053
1053
  return t;
1054
1054
  }
1055
- function An(e) {
1055
+ function Mn(e) {
1056
1056
  return e === "" || e === ".";
1057
1057
  }
1058
- function jn(e) {
1058
+ function Nn(e) {
1059
1059
  let t = e.pkg["block-scope"];
1060
1060
  if (typeof t == "string") {
1061
- if (!Dn.includes(t)) throw new On(`package.json "block-scope" must be one of ${Dn.join(", ")}, got '${t}'`, e.path);
1061
+ if (!kn.includes(t)) throw new An(`package.json "block-scope" must be one of ${kn.join(", ")}, got '${t}'`, e.path);
1062
1062
  return t;
1063
1063
  }
1064
- if (An(e.path)) return "root";
1064
+ if (Mn(e.path)) return "root";
1065
1065
  if (e.pkg.block !== void 0) return "block";
1066
- let n = kn(e.pkg);
1066
+ let n = jn(e.pkg);
1067
1067
  if (n.has("@platforma-sdk/block-kind")) return "kind";
1068
1068
  if (e.pkg["block-software"] !== void 0) return "software";
1069
1069
  if (n.has("@platforma-sdk/package-builder")) {
@@ -1074,15 +1074,15 @@ function jn(e) {
1074
1074
  if (n.has("@platforma-sdk/model") && e.pkg.main) return "model";
1075
1075
  if (n.has("@platforma-sdk/test")) return "test";
1076
1076
  }
1077
- function Mn(e) {
1077
+ function Pn(e) {
1078
1078
  let t = [];
1079
1079
  for (let n of e) {
1080
- let e = jn(n);
1081
- if (!e) throw new On(`Unclassified workspace package at '${n.path}'. Add a top-level "block-scope" string to its package.json.`, n.path);
1080
+ let e = Nn(n);
1081
+ if (!e) throw new An(`Unclassified workspace package at '${n.path}'. Add a top-level "block-scope" string to its package.json.`, n.path);
1082
1082
  t.push({
1083
1083
  scope: e,
1084
1084
  name: n.pkg.name ?? n.path,
1085
- path: An(n.path) ? "" : n.path
1085
+ path: Mn(n.path) ? "" : n.path
1086
1086
  });
1087
1087
  }
1088
1088
  return t;
@@ -1091,21 +1091,21 @@ function Mn(e) {
1091
1091
  function q(e, t) {
1092
1092
  return e.modules.filter((e) => e.scope === t);
1093
1093
  }
1094
- function Nn(e, t) {
1094
+ function Fn(e, t) {
1095
1095
  let n = q(e, t);
1096
1096
  if (n.length === 0) throw Error(`findModule: expected one '${t}' module, found none`);
1097
1097
  if (n.length > 1) throw Error(`findModule: expected exactly one '${t}' module, found ${n.length}`);
1098
1098
  return n[0];
1099
1099
  }
1100
- function Pn(e, t) {
1101
- return { [Nn(e, t).name]: "workspace:*" };
1100
+ function In(e, t) {
1101
+ return { [Fn(e, t).name]: "workspace:*" };
1102
1102
  }
1103
1103
  function J(e, t) {
1104
1104
  let n = {};
1105
1105
  for (let r of q(e, t)) n[r.name] = "workspace:*";
1106
1106
  return n;
1107
1107
  }
1108
- function Fn(e) {
1108
+ function Ln(e) {
1109
1109
  let t = e.facadeName, n = [
1110
1110
  {
1111
1111
  scope: "root",
@@ -1149,7 +1149,7 @@ function Fn(e) {
1149
1149
  path: "software"
1150
1150
  }), n;
1151
1151
  }
1152
- function In(e) {
1152
+ function Rn(e) {
1153
1153
  return {
1154
1154
  isSdkInternal: e.isSdkInternal ?? !1,
1155
1155
  updateDepsOnly: e.updateDepsOnly ?? !1,
@@ -1165,36 +1165,36 @@ var Y = class extends Error {
1165
1165
  super(e), this.name = "StructureCliError";
1166
1166
  }
1167
1167
  };
1168
- function Ln(e, t) {
1168
+ function zn(e, t) {
1169
1169
  return e === "" ? t : `${e}/${t}`;
1170
1170
  }
1171
- function Rn(e, t) {
1171
+ function Bn(e, t) {
1172
1172
  try {
1173
1173
  return JSON.parse(e.read(t));
1174
1174
  } catch {
1175
1175
  return;
1176
1176
  }
1177
1177
  }
1178
- function zn(e) {
1178
+ function Vn(e) {
1179
1179
  if (e.includes("*")) throw new Y(`pnpm-workspace.yaml 'packages:' entry '${e}' contains a glob. The structurer requires literal package paths — replace the glob with one entry per package directory.`);
1180
1180
  let t = e.replace(/^\.\//, "").replace(/\/$/, "");
1181
1181
  return t === "." ? "" : t;
1182
1182
  }
1183
- function Bn(e) {
1183
+ function Hn(e) {
1184
1184
  let t;
1185
1185
  try {
1186
1186
  t = e.read("pnpm-workspace.yaml");
1187
1187
  } catch {
1188
1188
  throw new Y("No pnpm-workspace.yaml found. This directory is empty or unrecognisable as a block — run 'block-tools structure init' instead, or pass --sdk-internal for an in-monorepo block.");
1189
1189
  }
1190
- let n = pe(t) ?? {}, r = Array.isArray(n.packages) ? n.packages : [], i = /* @__PURE__ */ new Set([""]);
1190
+ let n = he(t) ?? {}, r = Array.isArray(n.packages) ? n.packages : [], i = /* @__PURE__ */ new Set([""]);
1191
1191
  for (let t of r) {
1192
- let n = zn(t);
1192
+ let n = Vn(t);
1193
1193
  (n === "" || e.exists(n)) && i.add(n);
1194
1194
  }
1195
1195
  let a = [];
1196
1196
  for (let t of i) {
1197
- let n = Rn(e, Ln(t, "package.json"));
1197
+ let n = Bn(e, zn(t, "package.json"));
1198
1198
  n && a.push({
1199
1199
  path: t,
1200
1200
  pkg: n
@@ -1202,7 +1202,7 @@ function Bn(e) {
1202
1202
  }
1203
1203
  return a;
1204
1204
  }
1205
- function Vn(e) {
1205
+ function Un(e) {
1206
1206
  let t = [], n = /* @__PURE__ */ new Set([
1207
1207
  "node_modules",
1208
1208
  ".turbo",
@@ -1214,7 +1214,7 @@ function Vn(e) {
1214
1214
  let o = e.listDir(i);
1215
1215
  for (let s of o) {
1216
1216
  if (!s.isDirectory || n.has(s.name)) continue;
1217
- let o = Ln(i, s.name), c = Rn(e, Ln(o, "package.json"));
1217
+ let o = zn(i, s.name), c = Bn(e, zn(o, "package.json"));
1218
1218
  c && t.push({
1219
1219
  path: o,
1220
1220
  pkg: c
@@ -1223,7 +1223,7 @@ function Vn(e) {
1223
1223
  }
1224
1224
  return r("", 1), t;
1225
1225
  }
1226
- function Hn(e) {
1226
+ function Wn(e) {
1227
1227
  let t = e.indexOf("/");
1228
1228
  if (!e.startsWith("@") || t < 0) throw new Y(`Cannot parse block name '${e}': expected '@npm-org/org-scope.short-name'.`);
1229
1229
  let n = e.slice(0, t), r = e.slice(t + 1), i = r.indexOf(".");
@@ -1236,19 +1236,19 @@ function Hn(e) {
1236
1236
  shortName: r.slice(i + 1)
1237
1237
  };
1238
1238
  }
1239
- function Un(e) {
1240
- let { fs: t, isSdkInternal: n } = e, r = n ? Vn(t) : Bn(t);
1239
+ function Gn(e) {
1240
+ let { fs: t, isSdkInternal: n } = e, r = n ? Un(t) : Hn(t);
1241
1241
  if (r.length === 0) throw new Y("No workspace packages found. Run 'block-tools structure init' to scaffold a block.");
1242
- let i = Mn(r), a = ln(t);
1243
- un(a.version, 0);
1242
+ let i = Pn(r), a = dn(t);
1243
+ fn(a.version, 0);
1244
1244
  let o = i.find((e) => e.scope === "block") ?? i.find((e) => e.scope === "root");
1245
1245
  if (!o) throw new Y("Could not find a 'block' (or root-as-block) package to derive BlockVars from.");
1246
- let s = o.name.replace(/\.block$/, ""), c = Hn(s);
1246
+ let s = o.name.replace(/\.block$/, ""), c = Wn(s);
1247
1247
  return i.some((e) => e.scope === "kind") || i.push({
1248
1248
  scope: "kind",
1249
1249
  name: `${s}.kind`,
1250
1250
  path: "kind"
1251
- }), In({
1251
+ }), Rn({
1252
1252
  isSdkInternal: n,
1253
1253
  updateDepsOnly: e.updateDepsOnly ?? !1,
1254
1254
  modules: i,
@@ -1282,42 +1282,40 @@ var X = [
1282
1282
  "block-software"
1283
1283
  ], Z = "1.0.0";
1284
1284
  function Q() {
1285
- Jt("version", (e) => typeof e == "string" && e.length > 0 ? e : Z);
1285
+ Xt("version", (e) => typeof e == "string" && e.length > 0 ? e : Z);
1286
1286
  }
1287
1287
  // src/structure/rules/shared/toolchain.ts
1288
- var Wn = "24.22.1", Gn = {
1288
+ var Kn = "24.22.1", qn = {
1289
1289
  name: "node",
1290
- version: Wn,
1290
+ version: Kn,
1291
1291
  onFail: "download"
1292
- }, Kn = "pnpm@12.16.1+sha512.091d1dee7927575661b25dab3c2ae31cafc1c54d6b71ed6a6600cf0c1cb10434a447eae14015f1b23e2e6bedeed79df94a932e2164d2832280dce3fb32f656d1", qn = "~2.11.10", Jn = [
1292
+ }, Jn = "pnpm@12.16.1+sha512.091d1dee7927575661b25dab3c2ae31cafc1c54d6b71ed6a6600cf0c1cb10434a447eae14015f1b23e2e6bedeed79df94a932e2164d2832280dce3fb32f656d1", Yn = "~2.11.10", Xn = [
1293
1293
  "@milaboratories/*",
1294
1294
  "@platforma-sdk/*",
1295
1295
  "@platforma-open/*"
1296
- ], Yn = { "@milaboratories/pframes-rs-node": !0 }, Xn = {
1296
+ ], Zn = { "@milaboratories/pframes-rs-node": !0 }, Qn = {
1297
1297
  "@milaboratories/tengo-tester": !1,
1298
- "cpu-features": !1,
1299
1298
  esbuild: !1,
1300
- protobufjs: !1,
1301
- ssh2: !1
1302
- }, Zn = {
1303
- "build:dev-local": "env PL_BUILD_CHANNEL=dev PL_BUILD_VARIANT=all PL_BUILD_LOCATION=local turbo run build",
1304
- "build:dev-remote": "env PL_BUILD_CHANNEL=dev PL_BUILD_VARIANT=all PL_BUILD_LOCATION=remote turbo run build",
1305
- "build:dev-no-software": "env PL_BUILD_CHANNEL=dev PL_BUILD_VARIANT=none turbo run build",
1306
- "build:dev-binary-existing": "env PL_BUILD_CHANNEL=dev PL_BUILD_USE_PUBLISHED=true turbo run build",
1307
- "build:release": "env PL_BUILD_CHANNEL=release PL_BUILD_VARIANT=all PL_BUILD_LOCATION=remote turbo run build"
1308
- }, Qn = {
1309
- test: "env PL_BUILD_CHANNEL=dev PL_BUILD_VARIANT=binary PL_BUILD_LOCATION=local turbo run test --concurrency 1",
1310
- "test:dry-run": "env PL_BUILD_CHANNEL=dev PL_BUILD_VARIANT=binary PL_BUILD_LOCATION=local turbo run test --dry-run=json"
1299
+ protobufjs: !1
1300
+ }, $n = {
1301
+ "build:dev-local": "cross-env PL_BUILD_CHANNEL=dev PL_BUILD_VARIANT=all PL_BUILD_LOCATION=local turbo run build",
1302
+ "build:dev-remote": "cross-env PL_BUILD_CHANNEL=dev PL_BUILD_VARIANT=all PL_BUILD_LOCATION=remote turbo run build",
1303
+ "build:dev-no-software": "cross-env PL_BUILD_CHANNEL=dev PL_BUILD_VARIANT=none turbo run build",
1304
+ "build:dev-binary-existing": "cross-env PL_BUILD_CHANNEL=dev PL_BUILD_USE_PUBLISHED=true turbo run build",
1305
+ "build:release": "cross-env PL_BUILD_CHANNEL=release PL_BUILD_VARIANT=all PL_BUILD_LOCATION=remote turbo run build"
1306
+ }, er = {
1307
+ test: "cross-env PL_BUILD_CHANNEL=dev PL_BUILD_VARIANT=binary PL_BUILD_LOCATION=local turbo run test --concurrency 1",
1308
+ "test:dry-run": "cross-env PL_BUILD_CHANNEL=dev PL_BUILD_VARIANT=binary PL_BUILD_LOCATION=local turbo run test --dry-run=json"
1311
1309
  };
1312
- function $n() {
1310
+ function tr() {
1313
1311
  return {
1314
1312
  version: Z,
1315
1313
  private: !0,
1316
1314
  scripts: {
1317
1315
  fmt: "turbo run fmt",
1318
1316
  check: "turbo run check",
1319
- ...Zn,
1320
- ...Qn,
1317
+ ...$n,
1318
+ ...er,
1321
1319
  "mark-stable": "turbo run mark-stable",
1322
1320
  "do-pack": "turbo run do-pack",
1323
1321
  watch: "turbo watch build",
@@ -1334,32 +1332,37 @@ function $n() {
1334
1332
  "@changesets/cli": "catalog:",
1335
1333
  "@milaboratories/ts-builder": "sdk:",
1336
1334
  "@platforma-sdk/block-tools": "sdk:",
1335
+ "cross-env": "catalog:",
1337
1336
  shx: "catalog:",
1338
1337
  turbo: "catalog:"
1339
1338
  }
1340
1339
  };
1341
1340
  }
1342
- function er() {
1343
- R("packageManager", Kn), R("devEngines.runtime", Gn), z("pnpm", (e) => e === null || typeof e == "object" && Object.values(e).every((e) => typeof e == "object" && !!e && Object.keys(e).length === 0)), Ft("pnpm", "pnpm 11+ ignores the \"pnpm\" field in package.json. Move its settings to pnpm-workspace.yaml: overrides as is, onlyBuiltDependencies as allowBuilds true, neverBuiltDependencies as allowBuilds false."), z("name"), B("fmt", "turbo run fmt"), B("check", "turbo run check");
1344
- for (let [e, t] of Object.entries(Zn)) B(e, t);
1345
- for (let [e, t] of Object.entries(Qn)) B(e, t);
1341
+ function nr() {
1342
+ R("packageManager", Jn), R("devEngines.runtime", qn), z("pnpm", (e) => e === null || typeof e == "object" && Object.values(e).every((e) => typeof e == "object" && !!e && Object.keys(e).length === 0)), Lt("pnpm", "pnpm 11+ ignores the \"pnpm\" field in package.json. Move its settings to pnpm-workspace.yaml: overrides as is, onlyBuiltDependencies as allowBuilds true, neverBuiltDependencies as allowBuilds false.");
1343
+ }
1344
+ function rr() {
1345
+ nr(), z("name"), B("fmt", "turbo run fmt"), B("check", "turbo run check");
1346
+ for (let [e, t] of Object.entries($n)) B(e, t);
1347
+ for (let [e, t] of Object.entries(er)) B(e, t);
1346
1348
  V("build"), V("build:dev"), B("mark-stable", "turbo run mark-stable"), B("do-pack", "turbo run do-pack"), B("watch", "turbo watch build"), B("changeset", "changeset"), B("version-packages", "changeset version"), B("update-sdk", "block-tools structure refresh --update-deps-only"), V("update"), B("upgrade-sdk", "block-tools structure refresh --update-deps-only && pnpm i && block-tools structure refresh && pnpm i && pnpm fmt"), W({
1347
1349
  "@changesets/cli": "catalog:",
1348
1350
  "@milaboratories/ts-builder": "sdk:",
1349
1351
  "@platforma-sdk/block-tools": "sdk:",
1352
+ "cross-env": "catalog:",
1350
1353
  shx: "catalog:",
1351
1354
  turbo: "catalog:"
1352
- }), Vt({
1355
+ }), Ut({
1353
1356
  oxlint: "*",
1354
1357
  oxfmt: "*"
1355
- }), Gt((e, t) => {
1358
+ }), qt((e, t) => {
1356
1359
  if (!/^(\/\/|--)/.test(e) || typeof t != "object" || !t) return !1;
1357
1360
  let n = t;
1358
1361
  return n.pnpm !== void 0 || n.overrides !== void 0;
1359
1362
  }), K("dependencies"), K("devDependencies"), K("peerDependencies"), K("optionalDependencies"), G([...X]);
1360
1363
  }
1361
1364
  // src/structure/rules/root-turbo-json.ts
1362
- var tr = "https://turbo.build/schema.json", nr = ["tsconfig.json"], rr = {
1365
+ var ir = "https://turbo.build/schema.json", ar = ["tsconfig.json"], or = {
1363
1366
  fmt: { cache: !1 },
1364
1367
  check: {
1365
1368
  dependsOn: ["^build"],
@@ -1408,94 +1411,94 @@ var tr = "https://turbo.build/schema.json", nr = ["tsconfig.json"], rr = {
1408
1411
  cache: !1
1409
1412
  }
1410
1413
  };
1411
- function ir() {
1414
+ function sr() {
1412
1415
  return {
1413
- $schema: tr,
1414
- globalDependencies: nr,
1415
- tasks: { ...rr }
1416
+ $schema: ir,
1417
+ globalDependencies: ar,
1418
+ tasks: { ...or }
1416
1419
  };
1417
1420
  }
1418
- function ar() {
1419
- R("$schema", tr), R("globalDependencies", nr), It("tasks", rr), z("tasks.build:dev"), G([
1421
+ function cr() {
1422
+ R("$schema", ir), R("globalDependencies", ar), Rt("tasks", or), z("tasks.build:dev"), G([
1420
1423
  "$schema",
1421
1424
  "globalDependencies",
1422
1425
  "tasks"
1423
1426
  ]);
1424
1427
  }
1425
1428
  // src/structure/engine/registry-client.ts
1426
- var or = 2, sr = 500, cr = 3e4;
1427
- function lr(e) {
1429
+ var lr = 2, ur = 500, dr = 3e4;
1430
+ function fr(e) {
1428
1431
  if (!e) return null;
1429
1432
  let t = Number(e);
1430
1433
  if (Number.isFinite(t) && t > 0) return t * 1e3;
1431
1434
  let n = Date.parse(e);
1432
1435
  return Number.isNaN(n) ? null : Math.max(0, n - Date.now());
1433
1436
  }
1434
- async function ur(e) {
1437
+ async function pr(e) {
1435
1438
  for (let t = 1;; t++) {
1436
1439
  let n;
1437
1440
  try {
1438
- n = await fetch(e, { signal: AbortSignal.timeout(cr) });
1441
+ n = await fetch(e, { signal: AbortSignal.timeout(dr) });
1439
1442
  } catch (e) {
1440
- if (t > or) throw e;
1441
- let n = sr * 2 ** (t - 1) * (.8 + .4 * Math.random());
1442
- await ge(n);
1443
+ if (t > lr) throw e;
1444
+ let n = ur * 2 ** (t - 1) * (.8 + .4 * Math.random());
1445
+ await ve(n);
1443
1446
  continue;
1444
1447
  }
1445
1448
  if (n.ok) return n;
1446
- if (!(n.status === 429 || n.status >= 500) || t > or) throw Error(`registry returned HTTP ${n.status}`);
1447
- let r = lr(n.headers.get("retry-after"));
1449
+ if (!(n.status === 429 || n.status >= 500) || t > lr) throw Error(`registry returned HTTP ${n.status}`);
1450
+ let r = fr(n.headers.get("retry-after"));
1448
1451
  if (r != null) {
1449
- await ge(r);
1452
+ await ve(r);
1450
1453
  continue;
1451
1454
  }
1452
- let i = sr * 2 ** (t - 1) * (.8 + .4 * Math.random());
1453
- await ge(i);
1455
+ let i = ur * 2 ** (t - 1) * (.8 + .4 * Math.random());
1456
+ await ve(i);
1454
1457
  }
1455
1458
  }
1456
- function dr() {
1459
+ function mr() {
1457
1460
  return {
1458
1461
  async getLatestVersion(e) {
1459
- let t = (await (await ur(`https://registry.npmjs.org/-/package/${e}/dist-tags`)).json()).latest;
1462
+ let t = (await (await pr(`https://registry.npmjs.org/-/package/${e}/dist-tags`)).json()).latest;
1460
1463
  if (!t) throw Error("no 'latest' dist-tag in registry response");
1461
1464
  return t;
1462
1465
  },
1463
1466
  async getDeclaredDependency(e, t, n) {
1464
- let r = await (await ur(`https://registry.npmjs.org/${e}/${t}`)).json();
1467
+ let r = await (await pr(`https://registry.npmjs.org/${e}/${t}`)).json();
1465
1468
  return r.dependencies?.[n] ?? r.peerDependencies?.[n];
1466
1469
  }
1467
1470
  };
1468
1471
  }
1469
- async function fr(e, t) {
1472
+ async function hr(e, t) {
1470
1473
  let n = await Promise.all(t.map(async (t) => [t, await e.getLatestVersion(t)]));
1471
1474
  return new Map(n);
1472
1475
  }
1473
- function pr(e) {
1476
+ function gr(e) {
1474
1477
  return (t) => e.get(t);
1475
1478
  }
1476
- var mr = [/^@platforma-sdk\//, /^@milaboratories\//];
1477
- function hr(e) {
1478
- return mr.some((t) => t.test(e));
1479
+ var _r = [/^@platforma-sdk\//, /^@milaboratories\//];
1480
+ function vr(e) {
1481
+ return _r.some((t) => t.test(e));
1479
1482
  }
1480
- async function gr(e, t = dr()) {
1481
- return e.length === 0 ? () => void 0 : pr(await fr(t, e));
1483
+ async function yr(e, t = mr()) {
1484
+ return e.length === 0 ? () => void 0 : gr(await hr(t, e));
1482
1485
  }
1483
- function _r(e) {
1486
+ function br(e) {
1484
1487
  return /^\d+\.\d+\.\d+(?:[-+][0-9A-Za-z.-]+)?$/.test(e);
1485
1488
  }
1486
- async function vr(e, t = dr()) {
1489
+ async function xr(e, t = mr()) {
1487
1490
  if (e.length === 0) return () => void 0;
1488
1491
  let n = await Promise.all(e.map(async (e) => {
1489
1492
  let n = await t.getDeclaredDependency(e.of, e.ofVersion ?? "latest", e.entry);
1490
1493
  if (n === void 0) throw Error(`derived catalog pin '${e.entry}': package '${e.of}'${e.ofVersion ? `@${e.ofVersion}` : " (latest)"} declares no dependency '${e.entry}'. A derived pin requires the source to declare the dep as an exact version.`);
1491
- if (!_r(n)) throw Error(`derived catalog pin '${e.entry}': package '${e.of}'${e.ofVersion ? `@${e.ofVersion}` : " (latest)"} declares '${e.entry}: ${n}', which is not an exact version. A derived pin requires an exact ('x.y.z') source dependency so the catalog can pin to it precisely.`);
1494
+ if (!br(n)) throw Error(`derived catalog pin '${e.entry}': package '${e.of}'${e.ofVersion ? `@${e.ofVersion}` : " (latest)"} declares '${e.entry}: ${n}', which is not an exact version. A derived pin requires an exact ('x.y.z') source dependency so the catalog can pin to it precisely.`);
1492
1495
  return [e.entry, n];
1493
1496
  })), r = new Map(n);
1494
1497
  return (e) => r.get(e);
1495
1498
  }
1496
1499
  // src/structure/rules/shared/retired-deps.ts
1497
1500
  // @vitejs/plugin-vue — bundled by ts-builder's internal vite config.
1498
- var yr = [
1501
+ var Sr = [
1499
1502
  "vite",
1500
1503
  "tsup",
1501
1504
  "vue-tsc",
@@ -1503,11 +1506,11 @@ var yr = [
1503
1506
  "vite-plugin-dts",
1504
1507
  "@platforma-sdk/eslint-config"
1505
1508
  ];
1506
- function br() {
1507
- for (let e of yr) U(e);
1509
+ function Cr() {
1510
+ for (let e of Sr) U(e);
1508
1511
  }
1509
1512
  // src/structure/rules/root-pnpm-workspace.ts
1510
- var xr = [
1513
+ var wr = [
1511
1514
  "@platforma-sdk/model",
1512
1515
  "@platforma-sdk/ui-vue",
1513
1516
  "@platforma-sdk/workflow-tengo",
@@ -1519,35 +1522,41 @@ var xr = [
1519
1522
  "@platforma-sdk/package-builder",
1520
1523
  "@milaboratories/ts-builder",
1521
1524
  "@milaboratories/ts-configs"
1522
- ], Sr = "0.0.0-init-must-fetch";
1523
- for (let e of xr) if (!hr(e)) throw Error(`SDK_CATALOG_PACKAGES entry '${e}' matches no catalog bump pattern; its placeholder would never be resolved to npm latest on init. Add it to CATALOG_BUMP_PATTERNS or move it to the infra floor.`);
1524
- var Cr = {
1525
- turbo: qn,
1525
+ ], Tr = "0.0.0-init-must-fetch";
1526
+ for (let e of wr) if (!vr(e)) throw Error(`SDK_CATALOG_PACKAGES entry '${e}' matches no catalog bump pattern; its placeholder would never be resolved to npm latest on init. Add it to CATALOG_BUMP_PATTERNS or move it to the infra floor.`);
1527
+ var Er = {
1528
+ turbo: Yn,
1526
1529
  shx: "~0.4.0",
1530
+ "cross-env": "~10.1.0",
1527
1531
  "@changesets/cli": "~2.29.8",
1528
1532
  vitest: "~4.0.18",
1529
1533
  typescript: "~5.9.3"
1530
- }, wr = [{
1534
+ }, Dr = [{
1531
1535
  entry: "vue",
1532
1536
  of: "@platforma-sdk/ui-vue"
1533
1537
  }, {
1534
1538
  entry: "@milaboratories/helpers",
1535
1539
  of: "@platforma-sdk/model"
1536
- }], Tr = "@platforma-open/milaboratories.runenv-python-3", Er = "1.8.2";
1537
- function Dr(e) {
1540
+ }], Or = "@platforma-open/milaboratories.runenv-python-3", kr = "1.8.2";
1541
+ function Ar(e) {
1538
1542
  let t = e.modules.filter((e) => e.path !== "").map((e) => e.path).sort(), n = {};
1539
- for (let e of xr) n[e] = Sr;
1540
- return Object.assign(n, Cr), e.modules.some((e) => e.scope === "software") && (n[Tr] = Er), {
1543
+ for (let e of wr) n[e] = Tr;
1544
+ return Object.assign(n, Er), e.modules.some((e) => e.scope === "software") && (n[Or] = kr), {
1541
1545
  packages: t,
1542
1546
  catalog: n
1543
1547
  };
1544
1548
  }
1545
- function Or() {
1546
- Yt(), rn("minimumReleaseAgeExclude", Jn), nn("allowBuilds", Xn, { keepExisting: !0 }), nn("allowBuilds", Yn), en("turbo", qn);
1547
- for (let e of yr) tn(e);
1549
+ function jr() {
1550
+ on("minimumReleaseAgeExclude", Xn), an("allowBuilds", Qn, { keepExisting: !0 }), an("allowBuilds", Zn);
1551
+ for (let [e, t] of Object.entries(Er)) $t(e, t);
1552
+ nn("turbo", Yn);
1553
+ }
1554
+ function Mr() {
1555
+ Zt(), jr();
1556
+ for (let e of Sr) rn(e);
1548
1557
  }
1549
1558
  // src/structure/rules/root-gitignore.ts
1550
- var kr = [
1559
+ var Nr = [
1551
1560
  ".test_auth.json",
1552
1561
  "node_modules/",
1553
1562
  "dist/",
@@ -1562,30 +1571,30 @@ var kr = [
1562
1571
  ".vscode/sftp.json",
1563
1572
  "test-dry-run.json"
1564
1573
  ];
1565
- function Ar() {
1566
- an(kr);
1574
+ function Pr() {
1575
+ sn(Nr);
1567
1576
  }
1568
1577
  // src/structure/rules/root-changeset-config.ts
1569
- var jr = "---\n---\n\nInitial release.\n";
1570
- function Mr(e) {
1578
+ var Fr = "---\n---\n\nInitial release.\n";
1579
+ function Ir(e) {
1571
1580
  return {
1572
1581
  $schema: "https://unpkg.com/@changesets/config@3.1.1/schema.json",
1573
- changelog: Pr,
1582
+ changelog: Rr,
1574
1583
  commit: !1,
1575
- fixed: [Br(e)],
1584
+ fixed: [Wr(e)],
1576
1585
  linked: [],
1577
- access: Fr,
1578
- baseBranch: Ir,
1579
- updateInternalDependencies: Lr,
1586
+ access: zr,
1587
+ baseBranch: Br,
1588
+ updateInternalDependencies: Vr,
1580
1589
  ignore: []
1581
1590
  };
1582
1591
  }
1583
- function Nr(e) {
1584
- R("changelog", Pr), R("commit", !1), R("access", Fr), R("baseBranch", Ir), R("updateInternalDependencies", Lr);
1585
- let t = Br(e);
1586
- Jt("fixed", (e) => Vr(e, t)), G(Rr);
1592
+ function Lr(e) {
1593
+ R("changelog", Rr), R("commit", !1), R("access", zr), R("baseBranch", Br), R("updateInternalDependencies", Vr);
1594
+ let t = Wr(e);
1595
+ Xt("fixed", (e) => Gr(e, t)), G(Hr);
1587
1596
  }
1588
- var Pr = "@changesets/cli/changelog", Fr = "restricted", Ir = "main", Lr = "patch", Rr = [
1597
+ var Rr = "@changesets/cli/changelog", zr = "restricted", Br = "main", Vr = "patch", Hr = [
1589
1598
  "$schema",
1590
1599
  "changelog",
1591
1600
  "commit",
@@ -1595,66 +1604,66 @@ var Pr = "@changesets/cli/changelog", Fr = "restricted", Ir = "main", Lr = "patc
1595
1604
  "baseBranch",
1596
1605
  "updateInternalDependencies",
1597
1606
  "ignore"
1598
- ], zr = [
1607
+ ], Ur = [
1599
1608
  "block",
1600
1609
  "model",
1601
1610
  "ui",
1602
1611
  "workflow"
1603
1612
  ];
1604
- function Br(e) {
1605
- return zr.flatMap((t) => q(e, t).map((e) => e.name));
1613
+ function Wr(e) {
1614
+ return Ur.flatMap((t) => q(e, t).map((e) => e.name));
1606
1615
  }
1607
- function Vr(e, t) {
1608
- let n = new Set(t), r = Array.isArray(e) ? e.filter(Hr) : [], i = r.findIndex((e) => e.some((e) => n.has(e))), a = [];
1616
+ function Gr(e, t) {
1617
+ let n = new Set(t), r = Array.isArray(e) ? e.filter(Kr) : [], i = r.findIndex((e) => e.some((e) => n.has(e))), a = [];
1609
1618
  return r.forEach((e, r) => {
1610
1619
  let o = e.filter((e) => !n.has(e));
1611
1620
  r === i ? a.push([...t, ...o]) : o.length > 0 && a.push(o);
1612
1621
  }), i === -1 && a.push(t), a;
1613
1622
  }
1614
- function Hr(e) {
1623
+ function Kr(e) {
1615
1624
  return Array.isArray(e) && e.every((e) => typeof e == "string");
1616
1625
  }
1617
1626
  // src/structure/rules/root.ts
1618
- function Ur() {
1627
+ function qr() {
1619
1628
  S("root", () => {
1620
1629
  C(({ ctx: e }) => !e.isSdkInternal, () => {
1621
- E("turbo.json", M(() => ir()), () => {
1622
- ar();
1623
- }), T(".vscode/settings.json", A("root/.vscode/settings.json")), E("package.json", M(() => $n()), () => {
1624
- er();
1625
- }), E("pnpm-workspace.yaml", M((e) => Dr(e)), () => {
1626
- Or();
1630
+ E("turbo.json", M(() => sr()), () => {
1631
+ cr();
1632
+ }), T(".vscode/settings.json", A("root/.vscode/settings.json")), E("package.json", M(() => tr()), () => {
1633
+ rr();
1634
+ }), E("pnpm-workspace.yaml", M((e) => Ar(e)), () => {
1635
+ Mr();
1627
1636
  }), E(".gitignore", A("root/gitignore"), () => {
1628
- Ar();
1629
- }), E(".changeset/config.json", M((e) => Mr(e)), (e) => {
1630
- Nr(e);
1631
- }), O(".changeset/scaffold.md", at(jr));
1637
+ Pr();
1638
+ }), E(".changeset/config.json", M((e) => Ir(e)), (e) => {
1639
+ Lr(e);
1640
+ }), O(".changeset/scaffold.md", st(Fr));
1632
1641
  });
1633
1642
  });
1634
1643
  }
1635
1644
  // src/structure/rules/root-ci.ts
1636
- function Wr(e) {
1645
+ function Jr(e) {
1637
1646
  return e.split(/[-_]+/).filter((e) => e.length > 0).map((e) => e.charAt(0).toUpperCase() + e.slice(1)).join(" ");
1638
1647
  }
1639
- function Gr() {
1648
+ function Yr() {
1640
1649
  S("root", () => {
1641
1650
  C(({ ctx: e }) => !e.isSdkInternal, () => {
1642
1651
  T(".github/workflows/build.yaml", j("workflows/build.tpl.yaml", (e) => {
1643
1652
  let t = e.blockVars.shortName;
1644
1653
  return {
1645
- appName: `Block: ${Wr(t)}`,
1654
+ appName: `Block: ${Jr(t)}`,
1646
1655
  appNameSlug: `block-${t}`,
1647
- nodeVersion: Wn
1656
+ nodeVersion: Kn
1648
1657
  };
1649
1658
  })), T(".github/workflows/mark-stable.yaml", j("workflows/mark-stable.tpl.yaml", (e) => ({
1650
- appName: `Block: ${Wr(e.blockVars.shortName)} - Mark Stable`,
1651
- nodeVersion: Wn
1659
+ appName: `Block: ${Jr(e.blockVars.shortName)} - Mark Stable`,
1660
+ nodeVersion: Kn
1652
1661
  })));
1653
1662
  });
1654
1663
  });
1655
1664
  }
1656
1665
  // src/structure/rules/block-package-json.ts
1657
- var Kr = {
1666
+ var Xr = {
1658
1667
  "@platforma-open": {
1659
1668
  s3: "s3://milab-euce1-prod-pkgs-s3-block-registry/pub/releases/?region=eu-central-1",
1660
1669
  serveUrl: "https://blocks.pl-open.science"
@@ -1663,45 +1672,45 @@ var Kr = {
1663
1672
  s3: "s3://milab-euce1-prod-pkgs-s3-block-registry/pub/releases/?region=eu-central-1",
1664
1673
  serveUrl: "https://block.registry.platforma.bio/releases"
1665
1674
  }
1666
- }, qr = {
1675
+ }, Zr = {
1667
1676
  s3: "s3://milab-euce1-prod-pkgs-s3-block-registry/pub/releases/?region=eu-central-1",
1668
1677
  serveUrl: "https://blocks.pl-open.science"
1669
- }, Jr = {
1678
+ }, Qr = {
1670
1679
  s3: "s3://milab-euce1-prod-pkgs-s3-block-registry/aux/dev/?region=eu-central-1",
1671
1680
  serveUrl: "https://aux-blocks.pl-open.science"
1672
1681
  };
1673
- function Yr(e, t) {
1674
- let n = t ? Jr : Kr[e] ?? qr;
1682
+ function $r(e, t) {
1683
+ let n = t ? Qr : Xr[e] ?? Zr;
1675
1684
  return `block-tools publish -r ${n.s3} --registry-serve-url ${n.serveUrl}`;
1676
1685
  }
1677
- function Xr(e) {
1686
+ function ei(e) {
1678
1687
  let t = {};
1679
1688
  for (let n of q(e, "workflow")) t.workflow = `${n.name}/dist/tengo/tpl/main.plj.gz`;
1680
1689
  for (let n of q(e, "model")) t.model = `${n.name}/dist/model.json`;
1681
1690
  for (let n of q(e, "ui")) t.ui = `${n.name}/dist`;
1682
1691
  return t;
1683
1692
  }
1684
- function Zr(e, t) {
1693
+ function ti(e, t) {
1685
1694
  return {
1686
1695
  build: "ts-builder build --target block-facade && block-tools pack",
1687
1696
  check: "ts-builder type-check --target block-facade",
1688
- prepublishOnly: Yr(e, t),
1697
+ prepublishOnly: $r(e, t),
1689
1698
  "do-pack": "shx rm -f package.tgz && pnpm pack && shx mv *.tgz package.tgz"
1690
1699
  };
1691
1700
  }
1692
- var Qr = {
1701
+ var ni = {
1693
1702
  "@milaboratories/ts-builder": "sdk:",
1694
1703
  "@milaboratories/ts-configs": "sdk:",
1695
1704
  "@platforma-sdk/block-tools": "sdk:",
1696
1705
  "@platforma-sdk/model": "sdk:",
1697
1706
  shx: "catalog:",
1698
1707
  typescript: "catalog:"
1699
- }, $r = { ".": {
1708
+ }, ri = { ".": {
1700
1709
  sources: "./src/index.ts",
1701
1710
  types: "./dist/index.d.ts",
1702
1711
  default: "./dist/index.js"
1703
1712
  } };
1704
- function ei(e) {
1713
+ function ii(e) {
1705
1714
  if (Object.keys(e.components).length === 0) throw Error("block.components is empty — no workflow/model/ui module was discovered");
1706
1715
  let t = e.meta, n = [
1707
1716
  ["block.meta.title", t.title],
@@ -1713,15 +1722,15 @@ function ei(e) {
1713
1722
  ];
1714
1723
  for (let [e, t] of n) if (typeof t != "string" || t === "") throw Error(`required block field '${e}' is empty`);
1715
1724
  }
1716
- function ti(e) {
1725
+ function ai(e) {
1717
1726
  let t = e.blockVars, n = {
1718
- ...Qr,
1727
+ ...ni,
1719
1728
  ...J(e, "model"),
1720
1729
  ...J(e, "ui"),
1721
1730
  ...J(e, "workflow"),
1722
1731
  ...J(e, "kind")
1723
1732
  }, r = {
1724
- components: Xr(e),
1733
+ components: ei(e),
1725
1734
  meta: {
1726
1735
  title: t.shortName,
1727
1736
  description: `${t.shortName} block`,
@@ -1733,7 +1742,7 @@ function ti(e) {
1733
1742
  }
1734
1743
  }
1735
1744
  };
1736
- return ei(r), {
1745
+ return ii(r), {
1737
1746
  name: `${t.facadeName}.block`,
1738
1747
  version: Z,
1739
1748
  type: "module",
@@ -1741,41 +1750,41 @@ function ti(e) {
1741
1750
  main: "./dist/index.js",
1742
1751
  module: "./dist/index.js",
1743
1752
  types: "./dist/index.d.ts",
1744
- exports: $r,
1745
- scripts: Zr(t.npmOrg, e.isSdkInternal),
1753
+ exports: ri,
1754
+ scripts: ti(t.npmOrg, e.isSdkInternal),
1746
1755
  dependencies: {},
1747
1756
  devDependencies: n,
1748
1757
  block: r
1749
1758
  };
1750
1759
  }
1751
- function ni(e) {
1760
+ function oi(e) {
1752
1761
  let t = e.blockVars, n = q(e, "kind");
1753
1762
  if (n.length !== 1) throw Error(n.length === 0 ? `block '${t.facadeName}' declares no kind — every block must have a sibling kind/ package` : `block '${t.facadeName}' declares ${n.length} kinds; exactly one is required`);
1754
- R("type", "module"), R("files", ["dist", "block-pack"]), R("main", "./dist/index.js"), R("module", "./dist/index.js"), R("types", "./dist/index.d.ts"), R("exports", $r);
1755
- let r = Zr(t.npmOrg, e.isSdkInternal);
1763
+ R("type", "module"), R("files", ["dist", "block-pack"]), R("main", "./dist/index.js"), R("module", "./dist/index.js"), R("types", "./dist/index.d.ts"), R("exports", ri);
1764
+ let r = ti(t.npmOrg, e.isSdkInternal);
1756
1765
  for (let [e, t] of Object.entries(r)) B(e, t);
1757
- Wt("model"), Wt("ui"), Wt("workflow"), Wt("kind"), H("@milaboratories/ts-builder", "sdk:"), H("@milaboratories/ts-configs", "sdk:"), H("@platforma-sdk/block-tools", "sdk:"), H("@platforma-sdk/model", "sdk:"), H("shx", "catalog:"), H("typescript", "catalog:"), R("block.components", Xr(e)), Pt("version", "facade package.json must carry a 'version' (the facade publishes)"), K("dependencies"), K("devDependencies"), K("peerDependencies"), K("optionalDependencies"), G([...X]);
1766
+ Kt("model"), Kt("ui"), Kt("workflow"), Kt("kind"), H("@milaboratories/ts-builder", "sdk:"), H("@milaboratories/ts-configs", "sdk:"), H("@platforma-sdk/block-tools", "sdk:"), H("@platforma-sdk/model", "sdk:"), H("shx", "catalog:"), H("typescript", "catalog:"), R("block.components", ei(e)), It("version", "facade package.json must carry a 'version' (the facade publishes)"), K("dependencies"), K("devDependencies"), K("peerDependencies"), K("optionalDependencies"), G([...X]);
1758
1767
  }
1759
1768
  // src/structure/rules/shared/pascal-case.ts
1760
- function ri(e) {
1769
+ function si(e) {
1761
1770
  let t = e.split(/[^A-Za-z0-9]+/).filter((e) => e.length > 0).map((e) => e.charAt(0).toUpperCase() + e.slice(1)).join("");
1762
1771
  return /^[0-9]/.test(t) ? `_${t}` : t;
1763
1772
  }
1764
1773
  // src/structure/rules/block.ts
1765
- function ii() {
1774
+ function ci() {
1766
1775
  S("block", () => {
1767
1776
  k("index.js"), k("index.d.ts"), T("src/index.ts", j("block/src/index.tpl.ts", (e) => ({
1768
1777
  facadeName: e.blockVars.facadeName,
1769
- pascalName: ri(e.blockVars.shortName)
1770
- }))), T("src/AGENTS.ts", A("block/src/AGENTS.ts")), D("src/block-extra.ts", A("block/src/block-extra.ts")), D("src/agents-extra.ts", A("block/src/agents-extra.ts")), T("tsconfig.json", A("block/tsconfig.json")), O("logos/block-logo.png", it("block/logos/block-logo.png")), O("logos/organization-logo.png", it("block/logos/organization-logo.png")), E("package.json", M((e) => ti(e)), (e) => {
1771
- ni(e);
1778
+ pascalName: si(e.blockVars.shortName)
1779
+ }))), T("src/AGENTS.ts", A("block/src/AGENTS.ts")), D("src/block-extra.ts", A("block/src/block-extra.ts")), D("src/agents-extra.ts", A("block/src/agents-extra.ts")), T("tsconfig.json", A("block/tsconfig.json")), O("logos/block-logo.png", ot("block/logos/block-logo.png")), O("logos/organization-logo.png", ot("block/logos/organization-logo.png")), E("package.json", M((e) => ai(e)), (e) => {
1780
+ oi(e);
1772
1781
  });
1773
1782
  });
1774
1783
  }
1775
1784
  // src/structure/rules/shared/colocated-tests.ts
1776
- var $ = "src/**/*.test.ts", ai = "src/**/*.test.tengo";
1785
+ var $ = "src/**/*.test.ts", li = "src/**/*.test.tengo";
1777
1786
  // src/structure/rules/model-package-json.ts
1778
- function oi(e) {
1787
+ function ui(e) {
1779
1788
  return {
1780
1789
  name: `${e.blockVars.facadeName}.model`,
1781
1790
  version: Z,
@@ -1813,7 +1822,7 @@ function oi(e) {
1813
1822
  }
1814
1823
  };
1815
1824
  }
1816
- function si() {
1825
+ function di() {
1817
1826
  Q(), R("private", !0), R("type", "module"), R("main", "dist/index.cjs"), R("module", "dist/index.js"), R("types", "dist/index.d.ts"), R("exports", {
1818
1827
  ".": {
1819
1828
  types: "./dist/index.d.ts",
@@ -1821,34 +1830,34 @@ function si() {
1821
1830
  import: "./dist/index.js"
1822
1831
  },
1823
1832
  "./dist/*": "./dist/*"
1824
- }), B("fmt", "ts-builder format"), B("watch", "ts-builder build --target block-model --watch"), B("build", "ts-builder build --target block-model && block-tools build-model"), B("check", "ts-builder check --target block-model"), zt("@platforma-sdk/model", "sdk:"), Ut("kind"), W({
1833
+ }), B("fmt", "ts-builder format"), B("watch", "ts-builder build --target block-model --watch"), B("build", "ts-builder build --target block-model && block-tools build-model"), B("check", "ts-builder check --target block-model"), Vt("@platforma-sdk/model", "sdk:"), Gt("kind"), W({
1825
1834
  "@milaboratories/ts-builder": "sdk:",
1826
1835
  "@milaboratories/ts-configs": "sdk:",
1827
1836
  "@platforma-sdk/block-tools": "sdk:"
1828
- }), Vt({
1837
+ }), Ut({
1829
1838
  "@types/node": "*",
1830
1839
  typescript: "*"
1831
1840
  }), C(({ ctx: e }) => !e.isSdkInternal, () => C(w($), () => {
1832
1841
  B("test", "vitest run --passWithNoTests"), H("vitest", "catalog:"), H("@types/node", "*");
1833
- }, () => U("vitest"))), br(), z("tsup"), V("lint"), K("dependencies"), K("devDependencies"), K("peerDependencies"), K("optionalDependencies"), G([...X]);
1842
+ }, () => U("vitest"))), Cr(), z("tsup"), V("lint"), K("dependencies"), K("devDependencies"), K("peerDependencies"), K("optionalDependencies"), G([...X]);
1834
1843
  }
1835
1844
  // src/structure/rules/model.ts
1836
- function ci() {
1845
+ function fi() {
1837
1846
  S("model", () => {
1838
- C(w($), () => T("tsconfig.json", A("model/tsconfig.node.json")), () => T("tsconfig.json", A("model/tsconfig.json"))), T(".oxlintrc.json", A("model/.oxlintrc.json")), T(".oxfmtrc.json", A("model/.oxfmtrc.json")), O("src/index.ts", j("model/src/index.tpl.ts", (e) => ({ kindPkg: `${e.blockVars.facadeName}.kind` }))), E("package.json", M((e) => oi(e)), () => {
1839
- si();
1847
+ C(w($), () => T("tsconfig.json", A("model/tsconfig.node.json")), () => T("tsconfig.json", A("model/tsconfig.json"))), T(".oxlintrc.json", A("model/.oxlintrc.json")), T(".oxfmtrc.json", A("model/.oxfmtrc.json")), O("src/index.ts", j("model/src/index.tpl.ts", (e) => ({ kindPkg: `${e.blockVars.facadeName}.kind` }))), E("package.json", M((e) => ui(e)), () => {
1848
+ di();
1840
1849
  });
1841
1850
  });
1842
1851
  }
1843
1852
  // src/structure/rules/kind-package-json.ts
1844
- var li = { ".": {
1853
+ var pi = { ".": {
1845
1854
  types: "./dist/index.d.ts",
1846
1855
  sources: "./src/index.ts",
1847
1856
  import: "./dist/index.js",
1848
1857
  require: "./dist/index.cjs",
1849
1858
  default: "./dist/index.js"
1850
1859
  } };
1851
- function ui(e) {
1860
+ function mi(e) {
1852
1861
  return {
1853
1862
  name: `${e.blockVars.facadeName}.kind`,
1854
1863
  version: Z,
@@ -1857,7 +1866,7 @@ function ui(e) {
1857
1866
  main: "./dist/index.cjs",
1858
1867
  module: "./dist/index.js",
1859
1868
  types: "./dist/index.d.ts",
1860
- exports: li,
1869
+ exports: pi,
1861
1870
  scripts: {
1862
1871
  fmt: "ts-builder format",
1863
1872
  watch: "ts-builder build --target block-kind --watch",
@@ -1876,26 +1885,26 @@ function ui(e) {
1876
1885
  }
1877
1886
  };
1878
1887
  }
1879
- function di() {
1880
- Q(), R("private", !0), R("type", "module"), R("main", "./dist/index.cjs"), R("module", "./dist/index.js"), R("types", "./dist/index.d.ts"), R("exports", li), B("fmt", "ts-builder format"), B("watch", "ts-builder build --target block-kind --watch"), B("build", "ts-builder build --target block-kind && block-tools build-kind-manifest"), B("check", "ts-builder check --target block-kind"), V("lint"), zt("@platforma-sdk/block-kind", "sdk:"), W({
1888
+ function hi() {
1889
+ Q(), R("private", !0), R("type", "module"), R("main", "./dist/index.cjs"), R("module", "./dist/index.js"), R("types", "./dist/index.d.ts"), R("exports", pi), B("fmt", "ts-builder format"), B("watch", "ts-builder build --target block-kind --watch"), B("build", "ts-builder build --target block-kind && block-tools build-kind-manifest"), B("check", "ts-builder check --target block-kind"), V("lint"), Vt("@platforma-sdk/block-kind", "sdk:"), W({
1881
1890
  "@milaboratories/ts-builder": "sdk:",
1882
1891
  "@milaboratories/ts-configs": "sdk:",
1883
1892
  "@platforma-sdk/block-tools": "sdk:"
1884
- }), Vt({
1893
+ }), Ut({
1885
1894
  "@types/node": "*",
1886
1895
  typescript: "*"
1887
1896
  }), K("dependencies"), K("devDependencies"), K("peerDependencies"), K("optionalDependencies"), G([...X]);
1888
1897
  }
1889
1898
  // src/structure/rules/kind.ts
1890
- function fi() {
1899
+ function gi() {
1891
1900
  S("kind", () => {
1892
- T("tsconfig.json", A("kind/tsconfig.json")), T(".oxlintrc.json", A("kind/.oxlintrc.json")), T(".oxfmtrc.json", A("kind/.oxfmtrc.json")), D("src/index.ts", A("kind/src/index.ts")), E("package.json", M((e) => ui(e)), () => {
1893
- di();
1901
+ T("tsconfig.json", A("kind/tsconfig.json")), T(".oxlintrc.json", A("kind/.oxlintrc.json")), T(".oxfmtrc.json", A("kind/.oxfmtrc.json")), D("src/index.ts", A("kind/src/index.ts")), E("package.json", M((e) => mi(e)), () => {
1902
+ hi();
1894
1903
  });
1895
1904
  });
1896
1905
  }
1897
1906
  // src/structure/rules/ui-package-json.ts
1898
- function pi(e) {
1907
+ function _i(e) {
1899
1908
  return {
1900
1909
  name: `${e.blockVars.facadeName}.ui`,
1901
1910
  version: Z,
@@ -1911,7 +1920,7 @@ function pi(e) {
1911
1920
  dependencies: {
1912
1921
  "@platforma-sdk/ui-vue": "sdk:",
1913
1922
  vue: "catalog:",
1914
- ...Pn(e, "model")
1923
+ ...In(e, "model")
1915
1924
  },
1916
1925
  devDependencies: {
1917
1926
  "@milaboratories/ts-builder": "sdk:",
@@ -1923,11 +1932,11 @@ function pi(e) {
1923
1932
  }
1924
1933
  };
1925
1934
  }
1926
- function mi() {
1927
- Q(), R("private", !0), R("type", "module"), B("fmt", "ts-builder format"), B("dev", "ts-builder serve --target block-ui"), B("watch", "ts-builder build --target block-ui --watch"), B("build", "ts-builder build --target block-ui"), B("check", "ts-builder check --target block-ui"), zt("@platforma-sdk/ui-vue", "sdk:"), zt("vue", "catalog:"), Ut("model"), W({
1935
+ function vi() {
1936
+ Q(), R("private", !0), R("type", "module"), B("fmt", "ts-builder format"), B("dev", "ts-builder serve --target block-ui"), B("watch", "ts-builder build --target block-ui --watch"), B("build", "ts-builder build --target block-ui"), B("check", "ts-builder check --target block-ui"), Vt("@platforma-sdk/ui-vue", "sdk:"), Vt("vue", "catalog:"), Gt("model"), W({
1928
1937
  "@milaboratories/ts-builder": "sdk:",
1929
1938
  "@milaboratories/ts-configs": "sdk:"
1930
- }), br(), V("preview"), V("lint"), Vt({
1939
+ }), Cr(), V("preview"), V("lint"), Ut({
1931
1940
  "@types/node": "*",
1932
1941
  typescript: "*"
1933
1942
  }), C(({ ctx: e }) => !e.isSdkInternal, () => C(w($), () => {
@@ -1935,15 +1944,15 @@ function mi() {
1935
1944
  }, () => U("vitest"))), K("dependencies"), K("devDependencies"), K("peerDependencies"), K("optionalDependencies"), G([...X]);
1936
1945
  }
1937
1946
  // src/structure/rules/ui.ts
1938
- function hi() {
1947
+ function yi() {
1939
1948
  S("ui", () => {
1940
- C(w($), () => T("tsconfig.json", A("ui/tsconfig.node.json")), () => T("tsconfig.json", A("ui/tsconfig.json"))), T(".oxlintrc.json", A("ui/.oxlintrc.json")), T(".oxfmtrc.json", A("ui/.oxfmtrc.json")), D("index.html", A("ui/index.html")), O("src/main.ts", A("ui/src/main.ts")), O("src/app.ts", j("ui/src/app.tpl.ts", (e) => ({ modelPkg: `${e.blockVars.facadeName}.model` }))), O("src/MainPage.vue", j("ui/src/MainPage.tpl.vue", (e) => ({ shortName: e.blockVars.shortName }))), E("package.json", M((e) => pi(e)), () => {
1941
- mi();
1949
+ C(w($), () => T("tsconfig.json", A("ui/tsconfig.node.json")), () => T("tsconfig.json", A("ui/tsconfig.json"))), T(".oxlintrc.json", A("ui/.oxlintrc.json")), T(".oxfmtrc.json", A("ui/.oxfmtrc.json")), D("index.html", A("ui/index.html")), O("src/main.ts", A("ui/src/main.ts")), O("src/app.ts", j("ui/src/app.tpl.ts", (e) => ({ modelPkg: `${e.blockVars.facadeName}.model` }))), O("src/MainPage.vue", j("ui/src/MainPage.tpl.vue", (e) => ({ shortName: e.blockVars.shortName }))), E("package.json", M((e) => _i(e)), () => {
1950
+ vi();
1942
1951
  });
1943
1952
  });
1944
1953
  }
1945
1954
  // src/structure/rules/workflow-package-json.ts
1946
- function gi(e) {
1955
+ function bi(e) {
1947
1956
  return {
1948
1957
  name: `${e.blockVars.facadeName}.workflow`,
1949
1958
  version: Z,
@@ -1965,31 +1974,31 @@ function gi(e) {
1965
1974
  }
1966
1975
  };
1967
1976
  }
1968
- function _i() {
1977
+ function xi() {
1969
1978
  Q(), R("private", !0), R("type", "module"), B("build", "shx rm -rf dist && pl-tengo build"), B("check", "pl-tengo imports && pl-tengo check"), B("format", "/usr/bin/env emacs --script ./format.el || echo 'No emacs.'"), C(({ ctx: e }) => !e.isSdkInternal, () => C(w($), () => {
1970
- C(w(ai), () => B("test", "pl-tengo test && vitest run --passWithNoTests"), () => B("test", "vitest run --passWithNoTests")), W({ vitest: "catalog:" });
1979
+ C(w(li), () => B("test", "pl-tengo test && vitest run --passWithNoTests"), () => B("test", "vitest run --passWithNoTests")), W({ vitest: "catalog:" });
1971
1980
  }, () => {
1972
- C(w(ai), () => B("test", "pl-tengo test")), U("vitest");
1973
- })), zt("@platforma-sdk/workflow-tengo", "sdk:"), Ut("software"), W({
1981
+ C(w(li), () => B("test", "pl-tengo test")), U("vitest");
1982
+ })), Vt("@platforma-sdk/workflow-tengo", "sdk:"), Gt("software"), W({
1974
1983
  "@platforma-sdk/tengo-builder": "sdk:",
1975
1984
  "@platforma-sdk/test": "sdk:",
1976
1985
  shx: "catalog:"
1977
- }), br(), K("dependencies"), K("devDependencies"), K("peerDependencies"), K("optionalDependencies"), G([...X]);
1986
+ }), Cr(), K("dependencies"), K("devDependencies"), K("peerDependencies"), K("optionalDependencies"), G([...X]);
1978
1987
  }
1979
1988
  // src/structure/rules/workflow.ts
1980
- function vi() {
1989
+ function Si() {
1981
1990
  S("workflow", () => {
1982
1991
  T("format.el", A("workflow/format.el")), C(({ ctx: e }) => !e.isSdkInternal, () => C(w($), () => {
1983
1992
  T("tsconfig.json", A("workflow/tsconfig.json")), D("vitest.config.mts", A("workflow/vitest.config.mts"));
1984
1993
  }, () => {
1985
1994
  k("tsconfig.json"), k("vitest.config.mts");
1986
- })), k("index.js"), k("index.d.ts"), O("src/main.tpl.tengo", j("workflow/src/main.tpl.tengo", (e) => ({ shortName: e.blockVars.shortName }))), E("package.json", M((e) => gi(e)), () => {
1987
- _i();
1995
+ })), k("index.js"), k("index.d.ts"), O("src/main.tpl.tengo", j("workflow/src/main.tpl.tengo", (e) => ({ shortName: e.blockVars.shortName }))), E("package.json", M((e) => bi(e)), () => {
1996
+ xi();
1988
1997
  });
1989
1998
  });
1990
1999
  }
1991
2000
  // src/structure/rules/test-package-json.ts
1992
- function yi(e) {
2001
+ function Ci(e) {
1993
2002
  return {
1994
2003
  name: `${e.blockVars.facadeName}.test`,
1995
2004
  version: Z,
@@ -2009,25 +2018,25 @@ function yi(e) {
2009
2018
  }
2010
2019
  };
2011
2020
  }
2012
- function bi() {
2021
+ function wi() {
2013
2022
  Q(), R("private", !0), R("type", "module"), B("fmt", "ts-builder format"), B("check", "ts-builder check --target block-test"), B("test", "vitest run --passWithNoTests"), V("lint"), W({
2014
2023
  "@platforma-sdk/test": "sdk:",
2015
2024
  "@milaboratories/ts-builder": "sdk:",
2016
2025
  "@milaboratories/ts-configs": "sdk:",
2017
2026
  vitest: "catalog:"
2018
- }), Vt({ typescript: "*" }), U("@types/node"), br(), K("dependencies"), K("devDependencies"), K("peerDependencies"), K("optionalDependencies"), G([...X]);
2027
+ }), Ut({ typescript: "*" }), U("@types/node"), Cr(), K("dependencies"), K("devDependencies"), K("peerDependencies"), K("optionalDependencies"), G([...X]);
2019
2028
  }
2020
2029
  // src/structure/rules/test.ts
2021
- function xi() {
2030
+ function Ti() {
2022
2031
  S("test", () => {
2023
- T("tsconfig.json", A("test/tsconfig.json")), T(".oxlintrc.json", A("test/.oxlintrc.json")), T(".oxfmtrc.json", A("test/.oxfmtrc.json")), D("vitest.config.mts", A("test/vitest.config.mts")), O("src/demo.test.ts", at("import { expect, test } from \"vitest\";\n\ntest(\"scaffolded block sanity check\", () => {\n expect(true).toBe(true);\n});\n")), E("package.json", M((e) => yi(e)), () => {
2024
- bi();
2032
+ T("tsconfig.json", A("test/tsconfig.json")), T(".oxlintrc.json", A("test/.oxlintrc.json")), T(".oxfmtrc.json", A("test/.oxfmtrc.json")), D("vitest.config.mts", A("test/vitest.config.mts")), O("src/demo.test.ts", st("import { expect, test } from \"vitest\";\n\ntest(\"scaffolded block sanity check\", () => {\n expect(true).toBe(true);\n});\n")), E("package.json", M((e) => Ci(e)), () => {
2033
+ wi();
2025
2034
  });
2026
2035
  });
2027
2036
  }
2028
2037
  // src/structure/rules/software-package-json.ts
2029
- var Si = "block-tools software build", Ci = "shx rm -f *.tgz && block-tools software build && pnpm pack && shx mv platforma-open*.tgz package.tgz";
2030
- function wi() {
2038
+ var Ei = "block-tools software build", Di = "shx rm -f *.tgz && block-tools software build && pnpm pack && shx mv platforma-open*.tgz package.tgz";
2039
+ function Oi() {
2031
2040
  return { entrypoints: { main: { binary: {
2032
2041
  artifact: {
2033
2042
  type: "python",
@@ -2042,7 +2051,7 @@ function wi() {
2042
2051
  cmd: ["python", "{pkg}/main.py"]
2043
2052
  } } } };
2044
2053
  }
2045
- function Ti(e) {
2054
+ function ki(e) {
2046
2055
  return {
2047
2056
  name: `${e.blockVars.facadeName}.software`,
2048
2057
  version: Z,
@@ -2050,31 +2059,31 @@ function Ti(e) {
2050
2059
  description: "Block Software",
2051
2060
  files: ["./dist/**/*"],
2052
2061
  scripts: {
2053
- build: Si,
2054
- "do-pack": Ci,
2062
+ build: Ei,
2063
+ "do-pack": Di,
2055
2064
  changeset: "changeset",
2056
2065
  "version-packages": "changeset version"
2057
2066
  },
2058
- "block-software": wi(),
2067
+ "block-software": Oi(),
2059
2068
  devDependencies: {
2060
2069
  "@platforma-open/milaboratories.runenv-python-3": "catalog:",
2061
2070
  "@platforma-sdk/block-tools": "sdk:"
2062
2071
  }
2063
2072
  };
2064
2073
  }
2065
- function Ei() {
2066
- z("private"), Q(), R("type", "module"), R("files", ["./dist/**/*"]), B("build", Si), B("do-pack", Ci), V("prepublishOnly"), B("changeset", "changeset"), B("version-packages", "changeset version"), H("@platforma-open/milaboratories.runenv-python-3", "catalog:"), H("@platforma-sdk/block-tools", "sdk:"), U("@platforma-sdk/package-builder"), K("dependencies"), K("devDependencies"), K("peerDependencies"), K("optionalDependencies"), G([...X]);
2074
+ function Ai() {
2075
+ z("private"), Q(), R("type", "module"), R("files", ["./dist/**/*"]), B("build", Ei), B("do-pack", Di), V("prepublishOnly"), B("changeset", "changeset"), B("version-packages", "changeset version"), H("@platforma-open/milaboratories.runenv-python-3", "catalog:"), H("@platforma-sdk/block-tools", "sdk:"), U("@platforma-sdk/package-builder"), K("dependencies"), K("devDependencies"), K("peerDependencies"), K("optionalDependencies"), G([...X]);
2067
2076
  }
2068
2077
  // src/structure/rules/software.ts
2069
- var Di = "import sys\n\nprint(\"Hello from Python, \" + sys.argv[1] + \"!\")\n", Oi = "# No dependencies specified for this script\n";
2070
- function ki() {
2078
+ var ji = "import sys\n\nprint(\"Hello from Python, \" + sys.argv[1] + \"!\")\n", Mi = "# No dependencies specified for this script\n";
2079
+ function Ni() {
2071
2080
  S("software", () => {
2072
- O("src/main.py", at(Di)), O("src/requirements.txt", at(Oi)), E("package.json", M((e) => Ti(e)), () => {
2073
- Ei();
2081
+ O("src/main.py", st(ji)), O("src/requirements.txt", st(Mi)), E("package.json", M((e) => ki(e)), () => {
2082
+ Ai();
2074
2083
  });
2075
2084
  });
2076
2085
  }
2077
- function Ai() {
2086
+ function Pi() {
2078
2087
  S("model", () => {
2079
2088
  k("eslint.config.mjs"), k("vite.config.mts");
2080
2089
  }), S("ui", () => {
@@ -2082,48 +2091,49 @@ function Ai() {
2082
2091
  }), S("test", () => {
2083
2092
  k("eslint.config.mjs");
2084
2093
  }), S("root", () => {
2085
- k(".prettierrc"), E("package.json", M(() => $n()), () => {
2094
+ k(".prettierrc"), E("package.json", M(() => tr()), () => {
2086
2095
  V("pretty"), U("@platforma-sdk/blocks-deps-updater");
2087
2096
  });
2088
2097
  });
2089
2098
  }
2090
2099
  // src/structure/rules/root-catalog-bump.ts
2091
- function ji() {
2092
- rt(() => {
2100
+ function Fi() {
2101
+ at(() => {
2093
2102
  S("root", () => {
2094
2103
  C(({ ctx: e }) => !e.isSdkInternal, () => {
2095
- E("pnpm-workspace.yaml", M((e) => Dr(e)), (e) => {
2096
- for (let e of xr) Qt(e);
2097
- for (let e of wr) $t(e.entry, {
2104
+ E("package.json", M(() => tr()), () => {
2105
+ nr(), G([...X]);
2106
+ }), E("pnpm-workspace.yaml", M((e) => Ar(e)), (e) => {
2107
+ for (let e of wr) en(e);
2108
+ for (let e of Dr) tn(e.entry, {
2098
2109
  of: e.of,
2099
2110
  ofVersion: e.ofVersion
2100
2111
  });
2101
- for (let [e, t] of Object.entries(Cr)) Zt(e, t);
2102
- e.modules.some((e) => e.scope === "software") && Zt(Tr, Er);
2112
+ e.modules.some((e) => e.scope === "software") && $t(Or, kr), jr();
2103
2113
  });
2104
2114
  });
2105
2115
  });
2106
2116
  });
2107
2117
  }
2108
2118
  // src/structure/structure-definition.ts
2109
- var Mi = Xe(() => {
2110
- Ur(), Gr(), ii(), ci(), fi(), hi(), vi(), xi(), ki(), Ai(), ji();
2119
+ var Ii = Qe(() => {
2120
+ qr(), Yr(), ci(), fi(), gi(), yi(), Si(), Ti(), Ni(), Pi(), Fi();
2111
2121
  });
2112
2122
  // src/structure/cli/run-structure.ts
2113
- async function Ni() {
2114
- return gr(xr.filter(hr));
2123
+ async function Li() {
2124
+ return yr(wr.filter(vr));
2115
2125
  }
2116
- async function Pi(e) {
2117
- let t = g.resolve(e.blockPath), n = e.mode === "check", r = new Ne(t), i = new Pe(e.templatesRoot), a = En(Mi, r, Un({
2126
+ async function Ri(e) {
2127
+ let t = g.resolve(e.blockPath), n = e.mode === "check", r = new Fe(t), i = new Ie(e.templatesRoot), a = On(Ii, r, Gn({
2118
2128
  fs: r,
2119
2129
  isSdkInternal: e.isSdkInternal,
2120
2130
  updateDepsOnly: e.updateDepsOnly,
2121
2131
  dryRun: n
2122
2132
  }), {
2123
2133
  templates: i,
2124
- registryLookup: e.updateDepsOnly ? await Ni() : void 0,
2125
- derivedPinLookup: e.updateDepsOnly ? await vr(wr) : void 0,
2126
- rediscover: () => Un({
2134
+ registryLookup: e.updateDepsOnly ? await Li() : void 0,
2135
+ derivedPinLookup: e.updateDepsOnly ? await xr(Dr) : void 0,
2136
+ rediscover: () => Gn({
2127
2137
  fs: r,
2128
2138
  isSdkInternal: e.isSdkInternal,
2129
2139
  updateDepsOnly: !1,
@@ -2135,15 +2145,19 @@ async function Pi(e) {
2135
2145
  changes: a.changes
2136
2146
  };
2137
2147
  }
2138
- function Fi(e, t) {
2148
+ function zi(e) {
2149
+ let t = e.flatMap((e) => /[*?[]/.test(e) ? re(e).filter((e) => ie(e, { throwIfNoEntry: !1 })?.isDirectory() === !0).map((e) => e.split(g.sep).join("/")).sort() : [e]);
2150
+ return [...new Set(t)];
2151
+ }
2152
+ function Bi(e, t) {
2139
2153
  if (t.length === 0) return ` ${e}: up to date (0 changes)`;
2140
2154
  let n = t.map((e) => ` ${e.action.padEnd(6)} ${e.primitive.padEnd(8)} ${e.path} [${e.scope}]`);
2141
2155
  return ` ${e}: ${t.length} change(s)\n${n.join("\n")}`;
2142
2156
  }
2143
2157
  // src/cmd/structure/refresh.ts
2144
- async function Ii(e) {
2158
+ async function Vi(e) {
2145
2159
  for (let t of e.paths) {
2146
- let n = await Pi({
2160
+ let n = await Ri({
2147
2161
  blockPath: t,
2148
2162
  isSdkInternal: e.isSdkInternal,
2149
2163
  updateDepsOnly: e.updateDepsOnly,
@@ -2151,14 +2165,14 @@ async function Ii(e) {
2151
2165
  templatesRoot: e.templatesRoot,
2152
2166
  log: (t) => e.logger.info(t)
2153
2167
  });
2154
- e.logger.info(Fi(t, n.changes));
2168
+ e.logger.info(Bi(t, n.changes));
2155
2169
  }
2156
2170
  }
2157
- function Li(e) {
2158
- let t = new m("refresh").description("Bring block(s) up to date with the canonical structure. Applies rules, writes files, bumps .structure version. Default mode is offline; --update-deps-only fires only catalog-bump rules (network).");
2159
- return t.argument("[paths...]", "block path(s); defaults to the current directory"), t.option("--sdk-internal", "block(s) live inside the SDK monorepo; skip root-scope rules"), t.option("--update-deps-only", "fire ONLY catalog-bump rules (npm network). Follow with `pnpm install` then a plain refresh."), t.action(async (t, n) => {
2160
- let r = t.length > 0 ? t : ["."], i = g.join(e, "src", "structure", "templates");
2161
- await Ii({
2171
+ function Hi(e) {
2172
+ let t = new m("refresh").description("Bring block(s) up to date with the canonical structure. Applies rules, writes files, bumps .structure version. Default mode is offline; --update-deps-only updates the catalog versions and the pnpm and Node toolchain (network).");
2173
+ return t.argument("[paths...]", "block path(s); defaults to the current directory"), t.option("--sdk-internal", "block(s) live inside the SDK monorepo; skip root-scope rules"), t.option("--update-deps-only", "update ONLY the catalog versions and the pnpm and Node toolchain (npm network). Follow with `pnpm install` then a plain refresh."), t.action(async (t, n) => {
2174
+ let r = t.length > 0 ? zi(t) : ["."], i = g.join(e, "src", "structure", "templates");
2175
+ await Vi({
2162
2176
  paths: r,
2163
2177
  isSdkInternal: !!n.sdkInternal,
2164
2178
  updateDepsOnly: !!n.updateDepsOnly,
@@ -2168,11 +2182,11 @@ function Li(e) {
2168
2182
  }), t;
2169
2183
  }
2170
2184
  // src/cmd/update-deps.ts
2171
- function Ri(e) {
2185
+ function Ui(e) {
2172
2186
  let t = new m("update-deps").description("[DEPRECATED] Use `block-tools structure refresh --update-deps-only`. This alias delegates to it.");
2173
2187
  return t.action(async () => {
2174
2188
  let t = new b();
2175
- t.warn("`block-tools update-deps` is deprecated and will be removed in a future release. Use `block-tools structure refresh --update-deps-only` instead. Delegating now."), await Ii({
2189
+ t.warn("`block-tools update-deps` is deprecated and will be removed in a future release. Use `block-tools structure refresh --update-deps-only` instead. Delegating now."), await Vi({
2176
2190
  paths: ["."],
2177
2191
  isSdkInternal: !1,
2178
2192
  updateDepsOnly: !0,
@@ -2182,7 +2196,7 @@ function Ri(e) {
2182
2196
  }), t;
2183
2197
  }
2184
2198
  // src/cmd/list-overview-snapshots.ts
2185
- function zi() {
2199
+ function Wi() {
2186
2200
  let e = new m("list-overview-snapshots").description("List all available global overview snapshots in the registry");
2187
2201
  return e.addOption(new h("-r, --registry <address>", "full address of the registry").env("PL_REGISTRY").makeOptionMandatory()), e.option("--json", "output in JSON format", !1), e.action(async (e) => {
2188
2202
  let t = new b(), n = l(e.registry), r = await new p(n, t).listGlobalOverviewSnapshots();
@@ -2195,7 +2209,7 @@ function zi() {
2195
2209
  }), e;
2196
2210
  }
2197
2211
  // src/cmd/restore-overview-from-snapshot.ts
2198
- function Bi() {
2212
+ function Gi() {
2199
2213
  let e = new m("restore-overview-from-snapshot").description("Restore global overview from a snapshot");
2200
2214
  return e.addOption(new h("-r, --registry <address>", "full address of the registry").env("PL_REGISTRY").makeOptionMandatory()), e.requiredOption("-s, --snapshot <timestamp>", "snapshot timestamp ID to restore from"), e.option("--skip-confirmation", "skip confirmation prompt (use with caution)", !1), e.action(async (e) => {
2201
2215
  let t = new b(), n = l(e.registry), r = new p(n, t), i = await r.listGlobalOverviewSnapshots();
@@ -2220,7 +2234,7 @@ function Bi() {
2220
2234
  }), e;
2221
2235
  }
2222
2236
  // src/registry_v1/flags.ts
2223
- function Vi(e) {
2237
+ function Ki(e) {
2224
2238
  let t = e.match(/(?<destName>[^/\\]+)=(?<src>.*)/);
2225
2239
  if (t) {
2226
2240
  let { src: e, destName: n } = t.groups;
@@ -2234,25 +2248,25 @@ function Vi(e) {
2234
2248
  destName: g.basename(e)
2235
2249
  };
2236
2250
  }
2237
- function Hi(e, t) {
2238
- return new h(e, t).argParser((e, t) => [...t ?? [], Vi(e)]).default([]);
2251
+ function qi(e, t) {
2252
+ return new h(e, t).argParser((e, t) => [...t ?? [], Ki(e)]).default([]);
2239
2253
  }
2240
2254
  // src/cmd/upload-package-v1.ts
2241
- var Ui = [
2255
+ var Ji = [
2242
2256
  "registry",
2243
2257
  "organization",
2244
2258
  "package",
2245
2259
  "version"
2246
2260
  ];
2247
- function Wi() {
2261
+ function Yi() {
2248
2262
  let e = new m("upload-package-v1").description("Uploads V1 package and refreshes the registry");
2249
- return e.addOption(new h("-r, --registry <address|alias>", "full address of the registry or alias from .pl.reg").env("PL_REGISTRY")), e.addOption(new h("-o, --organization <organization>", "target organisation").env("PL_PACKAGE_ORGANIZATION")), e.addOption(new h("-p, --package <package>", "target package").env("PL_PACKAGE_NAME")), e.addOption(new h("-v, --version <version>", "target version").env("PL_PACKAGE_VERSION")), e.option("-m, --meta <path>", "json file containing meta information to associate with tha package"), e.addOption(Hi("-f, --file <file>", "package files")), e.addOption(new h("--refresh", "refresh repository after adding the package").default(!0).env("PL_REGISTRY_REFRESH")), e.option("--no-refresh", "do not refresh repository after adding the package"), e.action(async (e) => {
2263
+ return e.addOption(new h("-r, --registry <address|alias>", "full address of the registry or alias from .pl.reg").env("PL_REGISTRY")), e.addOption(new h("-o, --organization <organization>", "target organisation").env("PL_PACKAGE_ORGANIZATION")), e.addOption(new h("-p, --package <package>", "target package").env("PL_PACKAGE_NAME")), e.addOption(new h("-v, --version <version>", "target version").env("PL_PACKAGE_VERSION")), e.option("-m, --meta <path>", "json file containing meta information to associate with tha package"), e.addOption(qi("-f, --file <file>", "package files")), e.addOption(new h("--refresh", "refresh repository after adding the package").default(!0).env("PL_REGISTRY_REFRESH")), e.option("--no-refresh", "do not refresh repository after adding the package"), e.action(async (e) => {
2250
2264
  let t = new b(), n = f.parse({});
2251
- for (let t of Ui) e[t] && (n[t] = e[t]);
2252
- e.meta && (e.meta.endsWith(".json") ? n.meta = JSON.parse(await _.promises.readFile(e.meta, { encoding: "utf-8" })) : e.meta.endsWith(".yaml") && (n.meta = ue.parse(await _.promises.readFile(e.meta, { encoding: "utf-8" }))));
2265
+ for (let t of Ji) e[t] && (n[t] = e[t]);
2266
+ e.meta && (e.meta.endsWith(".json") ? n.meta = JSON.parse(await _.promises.readFile(e.meta, { encoding: "utf-8" })) : e.meta.endsWith(".yaml") && (n.meta = fe.parse(await _.promises.readFile(e.meta, { encoding: "utf-8" }))));
2253
2267
  for (let t of e.file) n.files[t.destName] = t.src;
2254
2268
  let r = await d(n);
2255
- t.info(ue.stringify(r.conf));
2269
+ t.info(fe.stringify(r.conf));
2256
2270
  let i = r.createRegistry(t), a = r.fullPackageName, o = i.constructNewPackage(a);
2257
2271
  for (let [e, n] of Object.entries(r.conf.files)) {
2258
2272
  t.info(`Uploading ${n} -> ${e} ...`);
@@ -2263,12 +2277,12 @@ function Wi() {
2263
2277
  }), e;
2264
2278
  }
2265
2279
  // src/cmd/structure/check.ts
2266
- function Gi(e) {
2280
+ function Xi(e) {
2267
2281
  let t = new m("check").description("Check block(s) against the canonical structure (read-only). Exits non-zero if any diff would land — used as the CI gate.");
2268
2282
  return t.argument("[paths...]", "block path(s); defaults to the current directory"), t.option("--sdk-internal", "block(s) live inside the SDK monorepo; skip root-scope rules"), t.action(async (t, n) => {
2269
- let r = new b(), i = t.length > 0 ? t : ["."], a = g.join(e, "src", "structure", "templates"), o = !1;
2283
+ let r = new b(), i = t.length > 0 ? zi(t) : ["."], a = g.join(e, "src", "structure", "templates"), o = !1;
2270
2284
  for (let e of i) {
2271
- let t = await Pi({
2285
+ let t = await Ri({
2272
2286
  blockPath: e,
2273
2287
  isSdkInternal: !!n.sdkInternal,
2274
2288
  updateDepsOnly: !1,
@@ -2276,40 +2290,40 @@ function Gi(e) {
2276
2290
  templatesRoot: a,
2277
2291
  log: (e) => r.info(e)
2278
2292
  });
2279
- r.info(Fi(e, t.changes)), t.changes.length > 0 && (o = !0);
2293
+ r.info(Bi(e, t.changes)), t.changes.length > 0 && (o = !0);
2280
2294
  }
2281
2295
  if (o) throw Error("Structure check failed: one or more blocks are out of date. Run `structure refresh`.");
2282
2296
  }), t;
2283
2297
  }
2284
2298
  // src/structure/init-block-constructor.ts
2285
- var Ki = ["python"], qi = class extends Error {
2299
+ var Zi = ["python"], Qi = class extends Error {
2286
2300
  constructor(e) {
2287
2301
  super(`Missing required flag --${e} in --non-interactive mode. Supply every BlockVars flag, or drop --non-interactive to be prompted.`), this.name = "InitFlagError";
2288
2302
  }
2289
2303
  };
2290
- async function Ji(e, t, n, r) {
2304
+ async function $i(e, t, n, r) {
2291
2305
  if (e !== void 0 && e !== "") return e;
2292
- if (n) throw new qi(t);
2306
+ if (n) throw new Qi(t);
2293
2307
  return r();
2294
2308
  }
2295
- async function Yi(e) {
2296
- let t = await Ji(e.npmOrg, "npm-org", e.nonInteractive, () => ye({
2309
+ async function ea(e) {
2310
+ let t = await $i(e.npmOrg, "npm-org", e.nonInteractive, () => xe({
2297
2311
  message: "npm org (e.g. @platforma-open):",
2298
2312
  default: "@platforma-open"
2299
- })), n = await Ji(e.orgScope, "org-scope", e.nonInteractive, () => ye({ message: "org scope (e.g. my-org):" })), r = await Ji(e.shortName, "short-name", e.nonInteractive, () => ye({ message: "block short name (e.g. mixcr-clonotyping):" })), i;
2300
- i = e.withSoftware === void 0 ? !e.nonInteractive && await ve({
2313
+ })), n = await $i(e.orgScope, "org-scope", e.nonInteractive, () => xe({ message: "org scope (e.g. my-org):" })), r = await $i(e.shortName, "short-name", e.nonInteractive, () => xe({ message: "block short name (e.g. mixcr-clonotyping):" })), i;
2314
+ i = e.withSoftware === void 0 ? !e.nonInteractive && await be({
2301
2315
  message: "Include a software module?",
2302
2316
  default: !1
2303
2317
  }) : e.withSoftware;
2304
2318
  let a;
2305
2319
  if (i) {
2306
- if (a = await Ji(e.platform, "platform", e.nonInteractive, () => be({
2320
+ if (a = await $i(e.platform, "platform", e.nonInteractive, () => Se({
2307
2321
  message: "Software platform:",
2308
- choices: Ki.map((e) => ({
2322
+ choices: Zi.map((e) => ({
2309
2323
  name: e,
2310
2324
  value: e
2311
2325
  }))
2312
- })), !Ki.includes(a)) throw Error(`Unsupported --platform '${a}'. Only ${Ki.join(", ")} ${Ki.length === 1 ? "is" : "are"} supported at v1.`);
2326
+ })), !Zi.includes(a)) throw Error(`Unsupported --platform '${a}'. Only ${Zi.join(", ")} ${Zi.length === 1 ? "is" : "are"} supported at v1.`);
2313
2327
  } else if (e.platform) throw Error("--platform was given but software is disabled (--no-software).");
2314
2328
  return {
2315
2329
  facadeName: `${t}/${n}.${r}`,
@@ -2320,20 +2334,20 @@ async function Yi(e) {
2320
2334
  softwarePlatform: a
2321
2335
  };
2322
2336
  }
2323
- async function Xi(e) {
2324
- let t = e.vars, n = Fn(t), r = new Ne(e.blockPath), i = new Pe(e.templatesRoot), a = In({
2337
+ async function ta(e) {
2338
+ let t = e.vars, n = Ln(t), r = new Fe(e.blockPath), i = new Ie(e.templatesRoot), a = Rn({
2325
2339
  blockVars: t,
2326
2340
  modules: n,
2327
2341
  isSdkInternal: !1,
2328
2342
  version: 3,
2329
2343
  dryRun: !1
2330
- }), o = xr.filter(hr), s, c;
2344
+ }), o = wr.filter(vr), s, c;
2331
2345
  try {
2332
- s = await gr(o), c = await vr(wr);
2346
+ s = await yr(o), c = await xr(Dr);
2333
2347
  } catch (e) {
2334
2348
  throw Error(`init requires network access to resolve SDK catalog versions from npm, but the registry lookup failed: ${e instanceof Error ? e.message : String(e)}`);
2335
2349
  }
2336
- return En(Mi, r, a, {
2350
+ return On(Ii, r, a, {
2337
2351
  templates: i,
2338
2352
  initMode: !0,
2339
2353
  registryLookup: s,
@@ -2341,12 +2355,12 @@ async function Xi(e) {
2341
2355
  }), e.log(`Initialised block '${t.facadeName}'${t.softwarePlatform ? ` (software: ${t.softwarePlatform})` : " (no software)"} at ${e.blockPath}`), t;
2342
2356
  }
2343
2357
  // src/cmd/structure/init.ts
2344
- function Zi(e) {
2358
+ function na(e) {
2345
2359
  let t = new m("init").description("Scaffold a fresh Platforma block from the canonical structure. Missing flags are prompted unless --non-interactive.");
2346
- return t.argument("[path]", "target directory (default: <short-name> under the current directory)"), t.option("--npm-org <org>", "npm org, e.g. @platforma-open"), t.option("--org-scope <scope>", "org scope, e.g. my-org"), t.option("--short-name <name>", "block short name, e.g. mixcr-clonotyping"), t.option("--with-software", "include a software module"), t.option("--no-software", "omit the software module"), t.addOption(new h("--platform <platform>", "software platform (single-valued)").choices([...Ki])), t.option("--non-interactive", "error on any missing flag instead of prompting"), t.action(async (t, n) => {
2360
+ return t.argument("[path]", "target directory (default: <short-name> under the current directory)"), t.option("--npm-org <org>", "npm org, e.g. @platforma-open"), t.option("--org-scope <scope>", "org scope, e.g. my-org"), t.option("--short-name <name>", "block short name, e.g. mixcr-clonotyping"), t.option("--with-software", "include a software module"), t.option("--no-software", "omit the software module"), t.addOption(new h("--platform <platform>", "software platform (single-valued)").choices([...Zi])), t.option("--non-interactive", "error on any missing flag instead of prompting"), t.action(async (t, n) => {
2347
2361
  let r = new b(), i = n.withSoftware === !0, a = n.software === !1;
2348
2362
  if (i && a) throw Error("--with-software and --no-software are mutually exclusive.");
2349
- let o = i ? !0 : !a && void 0, s = await Yi({
2363
+ let o = i ? !0 : !a && void 0, s = await ea({
2350
2364
  npmOrg: n.npmOrg,
2351
2365
  orgScope: n.orgScope,
2352
2366
  shortName: n.shortName,
@@ -2354,7 +2368,7 @@ function Zi(e) {
2354
2368
  platform: n.platform,
2355
2369
  nonInteractive: n.nonInteractive
2356
2370
  });
2357
- await Xi({
2371
+ await ta({
2358
2372
  vars: s,
2359
2373
  blockPath: t ? g.resolve(t) : g.resolve(process.cwd(), s.shortName),
2360
2374
  templatesRoot: g.join(e, "src", "structure", "templates"),
@@ -2363,13 +2377,13 @@ function Zi(e) {
2363
2377
  }), t;
2364
2378
  }
2365
2379
  // src/cmd/software/knobs.ts
2366
- var Qi = ["dev", "release"], $i = [
2380
+ var ra = ["dev", "release"], ia = [
2367
2381
  "docker",
2368
2382
  "binary",
2369
2383
  "all",
2370
2384
  "none"
2371
- ], ea = ["local", "remote"];
2372
- function ta(e) {
2385
+ ], aa = ["local", "remote"];
2386
+ function oa(e) {
2373
2387
  if (e.usePublished) {
2374
2388
  if (e.variant === "docker" || e.variant === "all") throw y.CLIError(`--use-published is binary-only and cannot be combined with --variant ${e.variant}`);
2375
2389
  return { kind: "binary-existing" };
@@ -2382,33 +2396,33 @@ function ta(e) {
2382
2396
  };
2383
2397
  }
2384
2398
  // src/cmd/software/ecr-login.ts
2385
- var na = "public.ecr.aws", ra = "us-east-1";
2386
- function ia(e) {
2399
+ var sa = "public.ecr.aws", ca = "us-east-1";
2400
+ function la(e) {
2387
2401
  if (process.env.AWS_ACCESS_KEY_ID || process.env.AWS_PROFILE) return;
2388
- let t = process.env.PL_AWS_PROFILE ?? le.AWS_DEV_PROFILE;
2402
+ let t = process.env.PL_AWS_PROFILE ?? de.AWS_DEV_PROFILE;
2389
2403
  process.env.AWS_PROFILE = t, e?.debug(`Using AWS profile '${t}' for dev push credentials`);
2390
2404
  }
2391
- function aa(e) {
2405
+ function ua(e) {
2392
2406
  return new URL(`https://${e}`).hostname;
2393
2407
  }
2394
- function oa() {
2395
- return ` aws sso login --profile ${process.env.AWS_PROFILE ?? process.env.PL_AWS_PROFILE ?? le.AWS_DEV_PROFILE}`;
2408
+ function da() {
2409
+ return ` aws sso login --profile ${process.env.AWS_PROFILE ?? process.env.PL_AWS_PROFILE ?? de.AWS_DEV_PROFILE}`;
2396
2410
  }
2397
- async function sa(e, t) {
2398
- let n = aa(e);
2399
- if (n !== na) throw y.CLIError(`automatic docker login is only supported for '${na}', not '${n}'.\nLog in manually, or drop the ecr:// scheme from the push target to opt out.`);
2411
+ async function fa(e, t) {
2412
+ let n = ua(e);
2413
+ if (n !== sa) throw y.CLIError(`automatic docker login is only supported for '${sa}', not '${n}'.\nLog in manually, or drop the ecr:// scheme from the push target to opt out.`);
2400
2414
  t?.info(`Logging in to ECR registry '${n}'...`);
2401
2415
  let r, i;
2402
2416
  try {
2403
- let e = (await new Se({ region: ra }).send(new Ce({}))).authorizationData?.authorizationToken;
2417
+ let e = (await new we({ region: ca }).send(new Te({}))).authorizationData?.authorizationToken;
2404
2418
  if (!e) throw Error("empty authorization token");
2405
2419
  let t = Buffer.from(e, "base64").toString("utf8"), n = t.indexOf(":");
2406
2420
  if (n < 0) throw Error("malformed authorization token (no ':' separator)");
2407
2421
  r = t.slice(0, n), i = t.slice(n + 1);
2408
2422
  } catch (e) {
2409
- throw y.CLIError(`failed to obtain an ECR login token for '${n}': ${e instanceof Error ? e.message : String(e)}\nYour AWS/SSO session is likely expired or absent — log in and retry:\n` + oa());
2423
+ throw y.CLIError(`failed to obtain an ECR login token for '${n}': ${e instanceof Error ? e.message : String(e)}\nYour AWS/SSO session is likely expired or absent — log in and retry:\n` + da());
2410
2424
  }
2411
- let a = xe("docker", [
2425
+ let a = Ce("docker", [
2412
2426
  "login",
2413
2427
  "--username",
2414
2428
  r,
@@ -2423,15 +2437,15 @@ async function sa(e, t) {
2423
2437
  ],
2424
2438
  env: {
2425
2439
  ...process.env,
2426
- HOME: process.env.HOME || _e.homedir()
2440
+ HOME: process.env.HOME || ye.homedir()
2427
2441
  }
2428
2442
  });
2429
2443
  if (a.error || a.status !== 0) throw y.CLIError(`'docker login ${n}' failed`);
2430
2444
  }
2431
2445
  // src/cmd/software/run-build.ts
2432
- async function ca(e) {
2446
+ async function pa(e) {
2433
2447
  let { core: t, scenario: n, options: r = {}, logger: i } = e, a = r.ids;
2434
- t.buildMode = ua(n), la(n) || t.assertDockerCoverage();
2448
+ t.buildMode = ha(n), ma(n) || t.assertDockerCoverage();
2435
2449
  let o = () => t.buildSoftwareArchives({
2436
2450
  ids: a,
2437
2451
  forceBuild: !!r.force,
@@ -2456,12 +2470,12 @@ async function ca(e) {
2456
2470
  });
2457
2471
  break;
2458
2472
  case "target": {
2459
- let { channel: e, variant: s, location: c } = n, l = s !== "binary", u = s !== "docker", d = c === "remote", f = pa(e, r);
2473
+ let { channel: e, variant: s, location: c } = n, l = s !== "binary", u = s !== "docker", d = c === "remote", f = va(e, r);
2460
2474
  l && t.buildDockerImages({
2461
2475
  ids: a,
2462
2476
  registry: f.pull,
2463
2477
  strictPlatformMatching: v.isCI()
2464
- }), u && await o(), d && e === "dev" && (l || u) && ia(i), l && d && (f.autoLogin && f.push && await sa(f.push, i), t.publishDockerImages({
2478
+ }), u && await o(), d && e === "dev" && (l || u) && la(i), l && d && (f.autoLogin && f.push && await fa(f.push, i), t.publishDockerImages({
2465
2479
  ids: a,
2466
2480
  pushTo: f.push,
2467
2481
  strictPlatformMatching: v.isCI()
@@ -2476,44 +2490,44 @@ async function ca(e) {
2476
2490
  t.buildSwJsonFiles({
2477
2491
  packageIds: a,
2478
2492
  noSoftware: n.kind === "no-software",
2479
- skipDockerCoverage: la(n)
2493
+ skipDockerCoverage: ma(n)
2480
2494
  });
2481
2495
  }
2482
- function la(e) {
2496
+ function ma(e) {
2483
2497
  return e.kind === "no-software" || e.kind === "binary-existing";
2484
2498
  }
2485
- function ua(e) {
2499
+ function ha(e) {
2486
2500
  return e.kind !== "target" || e.channel === "release" ? "release" : e.variant !== "docker" && e.location === "remote" ? "dev-remote" : "dev-local";
2487
2501
  }
2488
- function da(e) {
2502
+ function ga(e) {
2489
2503
  if (!e.includes("://")) return e;
2490
2504
  let t = new URL(e);
2491
2505
  return t.host + t.pathname;
2492
2506
  }
2493
- function fa(e) {
2507
+ function _a(e) {
2494
2508
  return {
2495
- registry: da(e),
2509
+ registry: ga(e),
2496
2510
  autoLogin: e.startsWith("ecr://")
2497
2511
  };
2498
2512
  }
2499
- function pa(e, t) {
2500
- let n = e === "dev", r = process.env[n ? v.PL_DEV_DOCKER_PUSH_URL : v.PL_RELEASE_DOCKER_PUSH_URL], i = process.env[n ? v.PL_DEV_DOCKER_PULL_URL : v.PL_RELEASE_DOCKER_PULL_URL], a = t.dockerPushTo ?? r ?? (n ? le.DEV_DOCKER_PUSH_TARGET : void 0), o = a ? fa(a) : {
2513
+ function va(e, t) {
2514
+ let n = e === "dev", r = process.env[n ? v.PL_DEV_DOCKER_PUSH_URL : v.PL_RELEASE_DOCKER_PUSH_URL], i = process.env[n ? v.PL_DEV_DOCKER_PULL_URL : v.PL_RELEASE_DOCKER_PULL_URL], a = t.dockerPushTo ?? r ?? (n ? de.DEV_DOCKER_PUSH_TARGET : void 0), o = a ? _a(a) : {
2501
2515
  registry: void 0,
2502
2516
  autoLogin: !1
2503
- }, s = t.dockerRegistry ?? i ?? (n ? a : le.DOCKER_REGISTRY);
2517
+ }, s = t.dockerRegistry ?? i ?? (n ? a : de.DOCKER_REGISTRY);
2504
2518
  return {
2505
- pull: s ? da(s) : void 0,
2519
+ pull: s ? ga(s) : void 0,
2506
2520
  push: o.registry,
2507
2521
  autoLogin: o.autoLogin
2508
2522
  };
2509
2523
  }
2510
2524
  // src/cmd/software/env.ts
2511
- var ma = "PL_BUILD_CHANNEL", ha = "PL_BUILD_VARIANT", ga = "PL_BUILD_LOCATION", _a = "PL_BUILD_USE_PUBLISHED";
2525
+ var ya = "PL_BUILD_CHANNEL", ba = "PL_BUILD_VARIANT", xa = "PL_BUILD_LOCATION", Sa = "PL_BUILD_USE_PUBLISHED";
2512
2526
  v.PL_DOCKER_REGISTRY_PUSH_TO, v.PL_DEV_DOCKER_PUSH_URL, v.PL_DEV_DOCKER_PULL_URL, v.PL_DEV_BINARY_UPLOAD_URL, v.PL_RELEASE_DOCKER_PUSH_URL, v.PL_RELEASE_DOCKER_PULL_URL, v.PL_RELEASE_BINARY_UPLOAD_URL;
2513
2527
  // src/cmd/software/build.ts
2514
- function va() {
2528
+ function Ca() {
2515
2529
  let e = new m("build").description("Build a software module for a target and write its .sw.json descriptor (build + push in one pass)");
2516
- return e.addOption(new h("--channel <channel>", "registry channel to build for").choices([...Qi]).env(ma)), e.addOption(new h("--variant <variant>", "artifact kind to build (default: all declared)").choices([...$i]).env(ha)), e.addOption(new h("--location <location>", "where the artifact lands (local = no push)").choices([...ea]).env(ga)), e.addOption(new h("--use-published", "do not build or push; emit a descriptor pointing at the already-published release artifact").env(_a)), e.addOption(new h("--log-level <level>", "logging level").choices([
2530
+ return e.addOption(new h("--channel <channel>", "registry channel to build for").choices([...ra]).env(ya)), e.addOption(new h("--variant <variant>", "artifact kind to build (default: all declared)").choices([...ia]).env(ba)), e.addOption(new h("--location <location>", "where the artifact lands (local = no push)").choices([...aa]).env(xa)), e.addOption(new h("--use-published", "do not build or push; emit a descriptor pointing at the already-published release artifact").env(Sa)), e.addOption(new h("--log-level <level>", "logging level").choices([
2517
2531
  "error",
2518
2532
  "warn",
2519
2533
  "info",
@@ -2521,12 +2535,12 @@ function va() {
2521
2535
  ]).default("info")), e.addOption(new h("--package-root <path>", "path to directory with package.json file")), e.addOption(new h("--force", "force action, ignoring automatic safety checks").default(!1)), e.addOption(new h("--version <value>", "override package version (ignore package.json)")), e.addOption(new h("--platform <os-arch>", "{os}-{arch} pair; no effect on cross-platform packages").choices([...y.AllPlatforms]).env(v.PL_PKG_OS)), e.addOption(new h("--all-platforms", "build for all supported platforms").default(!1)), e.addOption(new h("--full-dir-hash", "hash file contents (not metadata) for the dev content hash").env(v.PL_PKG_FULL_HASH).default(!1)), e.addOption(new h("--package-id <id...>", "act only on selected packages")), e.addOption(new h("--content-root <path>", "override software content root").env(v.PL_PKG_CONTENT_ROOT)), e.addOption(new h("--storage-url <url>", "override binary upload registry URL").env(v.PL_PKG_STORAGE_URL)), e.addOption(new h("--docker-registry <registry>", "docker pull registry embedded in the descriptor").env(v.PL_DOCKER_REGISTRY)), e.addOption(new h("--docker-push-to <registry>", "alternative registry for docker push").env(v.PL_DOCKER_REGISTRY_PUSH_TO)), e.addOption(new h("--docker-build", "build docker images").env(v.PL_DOCKER_BUILD).default(!1)), e.addOption(new h("--docker-no-build", "do not build docker images").env(v.PL_DOCKER_NO_BUILD).default(!1)), e.addOption(new h("--docker-autopush", "push docker images after build").env(v.PL_DOCKER_AUTOPUSH).default(!1)), e.addOption(new h("--docker-no-autopush", "do not push docker images").env(v.PL_DOCKER_NO_AUTOPUSH).default(!1)), e.addOption(new h("--conda-build", "build conda environment before packing").env(v.PL_CONDA_BUILD).default(!1)), e.addOption(new h("--conda-no-build", "do not build conda environment").env(v.PL_CONDA_NO_BUILD).default(!1)), e.action(async (e) => {
2522
2536
  let t = y.createLogger(e.logLevel);
2523
2537
  try {
2524
- let n = ta({
2538
+ let n = oa({
2525
2539
  channel: e.channel,
2526
2540
  variant: e.variant,
2527
2541
  location: e.location,
2528
2542
  usePublished: !!e.usePublished
2529
- }), r = ce(t, { packageRoot: e.packageRoot });
2543
+ }), r = ue(t, { packageRoot: e.packageRoot });
2530
2544
  r.version = e.version, r.targetPlatform = e.platform, r.allPlatforms = !!e.allPlatforms, r.fullDirHash = !!e.fullDirHash;
2531
2545
  let i = y.shouldDoAction({
2532
2546
  default: v.isCI(),
@@ -2537,12 +2551,12 @@ function va() {
2537
2551
  enable: e.dockerAutopush,
2538
2552
  disable: e.dockerNoAutopush
2539
2553
  });
2540
- n.kind === "bare" && se({
2554
+ n.kind === "bare" && le({
2541
2555
  buildDocker: i,
2542
2556
  pushDocker: a,
2543
2557
  pushDisabledExplicitly: !!e.dockerNoAutopush,
2544
2558
  dockerPackageCount: r.selectedDockerPackages(e.packageId).length
2545
- }), await ca({
2559
+ }), await pa({
2546
2560
  core: r,
2547
2561
  scenario: n,
2548
2562
  logger: t,
@@ -2568,20 +2582,20 @@ function va() {
2568
2582
  }), e;
2569
2583
  }
2570
2584
  // src/cmd/software/index.ts
2571
- function ya() {
2585
+ function wa() {
2572
2586
  let e = new m("software").description("Build and publish a block's software modules");
2573
- return e.addCommand(va()), e;
2587
+ return e.addCommand(Ca()), e;
2574
2588
  }
2575
2589
  // src/cli.ts
2576
- function ba(e = process.cwd()) {
2590
+ function Ta(e = process.cwd()) {
2577
2591
  let t = new m();
2578
- t.name("block-tools").description("Utility to manipulate Platforma Blocks and Block Registry"), t.addCommand(we()), t.addCommand(Ee()), t.addCommand(De()), t.addCommand(Oe()), t.addCommand(Ae()), t.addCommand(je()), t.addCommand(Me()), t.addCommand(Ri(e)), t.addCommand(zi()), t.addCommand(Bi()), t.addCommand(Wi()), t.addCommand(ya());
2592
+ t.name("block-tools").description("Utility to manipulate Platforma Blocks and Block Registry"), t.addCommand(Ee()), t.addCommand(Oe()), t.addCommand(ke()), t.addCommand(Ae()), t.addCommand(Me()), t.addCommand(Ne()), t.addCommand(Pe()), t.addCommand(Ui(e)), t.addCommand(Wi()), t.addCommand(Gi()), t.addCommand(Yi()), t.addCommand(wa());
2579
2593
  let n = new m("structure").description("Manage block scaffolding against the canonical structure (check / init / refresh)");
2580
- return n.addCommand(Gi(e)), n.addCommand(Zi(e)), n.addCommand(Li(e)), t.addCommand(n), t;
2594
+ return n.addCommand(Xi(e)), n.addCommand(na(e)), n.addCommand(Hi(e)), t.addCommand(n), t;
2581
2595
  }
2582
- async function xa(e, t) {
2583
- await ba(t).parseAsync(e);
2596
+ async function Ea(e, t) {
2597
+ await Ta(t).parseAsync(e);
2584
2598
  }
2585
- export { ba as buildProgram, xa as run };
2599
+ export { Ta as buildProgram, Ea as run };
2586
2600
 
2587
2601
  //# sourceMappingURL=cli.mjs.map