@platforma-sdk/block-tools 2.17.9 → 2.18.1

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,134 +1,134 @@
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
- import { Command as m, Option as h } from "commander";
3
- import g from "node:path";
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
- import { ConsoleLoggerAdapter as b } from "@milaboratories/ts-helpers";
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";
1
+ import { $t as e, J as t, K as n, Lt as r, N as i, Pt as a, Qt as o, T as s, Tt as c, X as l, Z as u, bt as d, n as f, p as ee, v as te, vt as ne, wt as re } from "./config-BusBoNIz.mjs";
2
+ import { Command as p, Option as m } from "commander";
3
+ import h from "node:path";
4
+ import g, { globSync as ie, statSync as ae } from "node:fs";
5
+ import { BlockPackManifest as oe, StableChannel as se, overrideDescriptionVersion as ce, overrideManifestVersion as le } from "@milaboratories/pl-model-middle-layer";
6
+ import { assertDockerPushIntent as ue, createBuilder as de, defaults as fe, envs as _, util as v } from "@platforma-sdk/package-builder-lib";
7
+ import { ConsoleLoggerAdapter as y } from "@milaboratories/ts-helpers";
8
+ import pe, { isMap as me, isSeq as he, parse as ge, parseDocument as _e, stringify as ve } from "yaml";
9
+ import { setTimeout as ye } from "node:timers/promises";
10
+ import * as be from "node:os";
11
+ import { confirm as xe, input as Se, select as Ce } from "@inquirer/prompts";
12
+ import { spawnSync as we } from "node:child_process";
13
+ import { ECRPUBLICClient as Te, GetAuthorizationTokenCommand as Ee } from "@aws-sdk/client-ecr-public";
14
14
  // src/cmd/build-meta.ts
15
- function Ee() {
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.");
15
+ function De() {
16
+ let e = new p("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
- let t = g.resolve(e.modulePath), r = await ne(t), a = await i(await n(r.meta, t));
19
- await _.promises.writeFile(g.resolve(e.destination), JSON.stringify(a));
18
+ let t = h.resolve(e.modulePath), n = await d(t), i = await a(await r(n.meta, t));
19
+ await g.promises.writeFile(h.resolve(e.destination), JSON.stringify(i));
20
20
  }), e;
21
21
  }
22
22
  // src/cmd/build-model.ts
23
- async function De(e) {
23
+ async function Oe(e) {
24
24
  try {
25
- return await _.promises.readFile(e, "utf8");
25
+ return await g.promises.readFile(e, "utf8");
26
26
  } catch (e) {
27
27
  if (e instanceof Error && "code" in e && e.code === "ENOENT") return;
28
28
  throw e;
29
29
  }
30
30
  }
31
- function Oe() {
32
- let e = new m("build-model").description("Extracts and outputs block model JSON from pre-built block model module");
31
+ function ke() {
32
+ let e = new p("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
- let t = g.resolve(e.modulePath), { model: n, platforma: r } = c(t);
34
+ let t = h.resolve(e.modulePath), { model: n, platforma: r } = o(t);
35
35
  if (n ||= r, !n) throw Error("\"model\" export not found");
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 De(e.sourceBundle);
39
+ let a = await Oe(e.sourceBundle);
40
40
  a !== void 0 && (i.code = {
41
41
  type: "plain",
42
42
  content: a
43
- }), await _.promises.writeFile(g.resolve(e.destination), JSON.stringify(i));
43
+ }), await g.promises.writeFile(h.resolve(e.destination), JSON.stringify(i));
44
44
  }), e;
45
45
  }
46
46
  // src/cmd/build-kind-manifest.ts
47
- function ke() {
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
- 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
- await e({
51
- modulePath: t.modulePath,
52
- srcDir: t.srcDir,
53
- dst: t.dst
47
+ function Ae() {
48
+ let e = new p("build-kind-manifest").description("Writes the block-kind dist manifest (identity + src source-hash) from a pre-built kind bundle");
49
+ return e.option("-i, --modulePath <path>", "kind package dir (contains package.json, src/, dist/)", "."), e.option("-s, --srcDir <path>", "source dir hashed into sourceHash, relative to modulePath", "src"), e.option("-o, --dst <path>", "output dir with the compiled bundle, relative to modulePath", "dist"), e.action(async (e) => {
50
+ await re({
51
+ modulePath: e.modulePath,
52
+ srcDir: e.srcDir,
53
+ dst: e.dst
54
54
  });
55
- }), t;
55
+ }), e;
56
56
  }
57
57
  // src/cmd/pack.ts
58
- function Ae() {
59
- let e = new m("pack").description("Builds block pack and outputs a block pack manifest consolidating all references assets into a single folder");
58
+ function je() {
59
+ let e = new p("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
- let t = await u(g.resolve(e.modulePath));
62
- await te(t, g.resolve(e.destinationPath));
61
+ let t = await ne(h.resolve(e.modulePath));
62
+ await c(t, h.resolve(e.destinationPath));
63
63
  }), e;
64
64
  }
65
65
  // src/cmd/publish.ts
66
- function je(e, t) {
66
+ function Me(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]) ? je(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]) ? Me(n[e], t[e]) : t[e];
69
69
  return n;
70
70
  }
71
- function Me() {
72
- let e = new m("publish").description("Publishes the block package and refreshes the registry (for v2 block-pack schema)");
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 = ae.parse(r);
75
- i = je(r, i);
76
- let a = g.dirname(n), c = g.dirname(a);
77
- t.info(`Manifest root = ${a}`), t.info(`Facade root = ${c}`), e.versionOverride && (i = ce(i, e.versionOverride));
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 ${oe} channel...`), await d.addPackageToChannel(i.description.id, oe));
80
- let f = ee({
71
+ function Ne() {
72
+ let e = new p("publish").description("Publishes the block package and refreshes the registry (for v2 block-pack schema)");
73
+ return e.addOption(new m("-r, --registry <address>", "full address of the registry").env("PL_REGISTRY").makeOptionMandatory()), e.addOption(new m("--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/${i}`), e.option("-v, --version-override <path>", "override package version"), e.addOption(new m("--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 m("--unstable", "do not add the published package to stable channel").default(!1).env("PL_PUBLISH_UNSTABLE")), e.action(async (e) => {
74
+ let n = new y(), r = h.resolve(e.manifest), i = JSON.parse(await g.promises.readFile(r, { encoding: "utf-8" })), a = oe.parse(i);
75
+ a = Me(i, a);
76
+ let o = h.dirname(r), c = h.dirname(o);
77
+ n.info(`Manifest root = ${o}`), n.info(`Facade root = ${c}`), e.versionOverride && (a = le(a, e.versionOverride));
78
+ let d = te(e.registry), f = new s(d, n);
79
+ await u(f, a, c, async (e) => Buffer.from(await g.promises.readFile(h.resolve(o, e)))), e.unstable || (n.info(`Adding package to ${se} channel...`), await f.addPackageToChannel(a.description.id, se));
80
+ let ee = t({
81
81
  registryUrl: e.registryServeUrl,
82
- id: i.description.id
82
+ id: a.description.id
83
83
  });
84
- await s(a, f), t.info(`Wrote published coordinates to ${g.resolve(a, "published.json")}`), e.refresh && await d.updateIfNeeded();
84
+ await l(o, ee), n.info(`Wrote published coordinates to ${h.resolve(o, "published.json")}`), e.refresh && await f.updateIfNeeded();
85
85
  }), e;
86
86
  }
87
87
  // src/cmd/refresh-registry.ts
88
- function Ne() {
89
- let e = new m("refresh-registry").description("Refresh overview files based on published but not proecessed artefacts");
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([
88
+ function Pe() {
89
+ let e = new p("refresh-registry").description("Refresh overview files based on published but not proecessed artefacts");
90
+ return e.addOption(new m("-r, --registry <address>", "full address of the registry").env("PL_REGISTRY").makeOptionMandatory()), e.addOption(new m("-m, --mode <mode>", "refresh mode (allowed valiues: \"force\", \"normal\", \"dry-run\")").choices([
91
91
  "force",
92
92
  "normal",
93
93
  "dry-run"
94
94
  ]).env("PL_REGISTRY_REFRESH_DRY_RUN").default("normal")), e.action(async (e) => {
95
- let t = l(e.registry);
96
- await new p(t, new b()).updateIfNeeded(e.mode);
95
+ let t = te(e.registry);
96
+ await new s(t, new y()).updateIfNeeded(e.mode);
97
97
  }), e;
98
98
  }
99
99
  // src/cmd/mark-stable.ts
100
- function Pe() {
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(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
- let t = await ne(g.resolve(e.modulePath));
104
- e.versionOverride && (t = se(t, e.versionOverride));
105
- let n = l(e.registry), r = new p(n, new b());
100
+ function Fe() {
101
+ let e = new p("mark-stable").description("Mark target block stable");
102
+ return e.option("-i, --modulePath <path>", "input module path", "."), e.addOption(new m("-c, --channel <channel name>", "custom channel").default(se).hideHelp()), e.option("-v, --version-override <path>", "override package version"), e.addOption(new m("-r, --registry <address>", "full address of the registry").env("PL_REGISTRY").makeOptionMandatory()), e.addOption(new m("--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
+ let t = await d(h.resolve(e.modulePath));
104
+ e.versionOverride && (t = ce(t, e.versionOverride));
105
+ let n = te(e.registry), r = new s(n, new y());
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 Fe = class {
110
+ var Ie = class {
111
111
  root;
112
112
  constructor(e) {
113
113
  this.root = e;
114
114
  }
115
115
  abs(e) {
116
- return g.resolve(this.root, e);
116
+ return h.resolve(this.root, e);
117
117
  }
118
118
  read(e) {
119
- return _.readFileSync(this.abs(e), "utf-8");
119
+ return g.readFileSync(this.abs(e), "utf-8");
120
120
  }
121
121
  write(e, t) {
122
122
  let n = this.abs(e);
123
- _.mkdirSync(g.dirname(n), { recursive: !0 }), _.writeFileSync(n, t, "utf-8");
123
+ g.mkdirSync(h.dirname(n), { recursive: !0 }), g.writeFileSync(n, t, "utf-8");
124
124
  }
125
125
  writeBinary(e, t) {
126
126
  let n = this.abs(e);
127
- _.mkdirSync(g.dirname(n), { recursive: !0 }), _.writeFileSync(n, t);
127
+ g.mkdirSync(h.dirname(n), { recursive: !0 }), g.writeFileSync(n, t);
128
128
  }
129
129
  exists(e) {
130
130
  try {
131
- return _.statSync(this.abs(e)), !0;
131
+ return g.statSync(this.abs(e)), !0;
132
132
  } catch {
133
133
  return !1;
134
134
  }
@@ -136,15 +136,15 @@ var Fe = class {
136
136
  list(e) {
137
137
  let t = this.abs(e);
138
138
  try {
139
- if (!_.statSync(t).isDirectory()) return [];
139
+ if (!g.statSync(t).isDirectory()) return [];
140
140
  } catch {
141
141
  return [];
142
142
  }
143
143
  let n = [];
144
144
  function r(e, t) {
145
- let i = _.readdirSync(t, { withFileTypes: !0 });
145
+ let i = g.readdirSync(t, { withFileTypes: !0 });
146
146
  for (let a of i) {
147
- let i = e ? `${e}/${a.name}` : a.name, o = g.join(t, a.name);
147
+ let i = e ? `${e}/${a.name}` : a.name, o = h.join(t, a.name);
148
148
  a.isDirectory() ? r(i, o) : a.isFile() && n.push(i);
149
149
  }
150
150
  }
@@ -153,7 +153,7 @@ var Fe = class {
153
153
  listDir(e) {
154
154
  let t = this.abs(e), n;
155
155
  try {
156
- n = _.readdirSync(t, { withFileTypes: !0 });
156
+ n = g.readdirSync(t, { withFileTypes: !0 });
157
157
  } catch {
158
158
  return [];
159
159
  }
@@ -164,77 +164,77 @@ var Fe = class {
164
164
  }
165
165
  move(e, t) {
166
166
  let n = this.abs(e), r = this.abs(t);
167
- _.mkdirSync(g.dirname(r), { recursive: !0 }), _.renameSync(n, r);
167
+ g.mkdirSync(h.dirname(r), { recursive: !0 }), g.renameSync(n, r);
168
168
  }
169
169
  delete(e) {
170
- _.rmSync(this.abs(e), {
170
+ g.rmSync(this.abs(e), {
171
171
  recursive: !0,
172
172
  force: !0
173
173
  });
174
174
  }
175
- }, Ie = class {
175
+ }, Le = class {
176
176
  root;
177
177
  constructor(e) {
178
178
  this.root = e;
179
179
  }
180
180
  staticRead(e) {
181
- return _.readFileSync(g.resolve(this.root, "static", e), "utf-8");
181
+ return g.readFileSync(h.resolve(this.root, "static", e), "utf-8");
182
182
  }
183
183
  staticReadBinary(e) {
184
- return _.readFileSync(g.resolve(this.root, "static", e));
184
+ return g.readFileSync(h.resolve(this.root, "static", e));
185
185
  }
186
186
  textRead(e) {
187
- return _.readFileSync(g.resolve(this.root, "text", e), "utf-8");
187
+ return g.readFileSync(h.resolve(this.root, "text", e), "utf-8");
188
188
  }
189
189
  };
190
- function Le(e, t) {
190
+ function Re(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 Re = ["default", "init"];
195
- function ze(e, t) {
194
+ var ze = ["default", "init"];
195
+ function Be(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 Be(e, t) {
201
+ function Ve(e, t) {
202
202
  return e.filter((e) => e.scope === t).slice().sort((e, t) => e.path.localeCompare(t.path));
203
203
  }
204
- function Ve(e, t) {
204
+ function He(e, t) {
205
205
  let n = [];
206
206
  function r(e, i, a, o, s) {
207
207
  if (e.kind === "scope") {
208
- let n = Be(t.modules, e.scope);
208
+ let n = Ve(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 '${Ue(e)}' is not inside a scope() frame`);
215
+ if (i === void 0 || a === void 0) throw Error(`flatten: leaf '${We(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: ze(a, e.from),
221
- resolvedTo: ze(a, e.to),
220
+ resolvedPath: Be(a, e.from),
221
+ resolvedTo: Be(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: ze(a, He(e)),
228
+ resolvedPath: Be(a, Ue(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, [], Re);
234
+ for (let t of e.children) r(t, void 0, void 0, [], ze);
235
235
  return n;
236
236
  }
237
- function He(e) {
237
+ function Ue(e) {
238
238
  switch (e.kind) {
239
239
  case "fixed":
240
240
  case "managed":
@@ -244,61 +244,61 @@ function He(e) {
244
244
  case "rename": return e.from;
245
245
  }
246
246
  }
247
- function Ue(e) {
247
+ function We(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 We = /[.+^${}()|[\]\\]/g;
252
- function Ge(e) {
251
+ var Ge = /[.+^${}()|[\]\\]/g;
252
+ function Ke(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(We, "\\$&");
256
+ r === "*" ? e[n + 1] === "*" ? (n++, e[n + 1] === "/" ? (n++, t += "(?:.*/)?") : t += ".*") : t += "[^/]*" : t += r === "?" ? "[^/]" : r.replace(Ge, "\\$&");
257
257
  }
258
258
  return RegExp(`^${t}$`);
259
259
  }
260
- function Ke(e, t) {
261
- return Ge(e).test(t);
260
+ function qe(e, t) {
261
+ return Ke(e).test(t);
262
262
  }
263
263
  // src/structure/engine/builders.ts
264
- var x, qe;
265
- function Je(e) {
266
- if (!x) throw Error(`${e}() called outside defineStructure(). Builders must run inside the lambda passed to defineStructure(...).`);
267
- return x;
264
+ var b, Je;
265
+ function Ye(e) {
266
+ if (!b) throw Error(`${e}() called outside defineStructure(). Builders must run inside the lambda passed to defineStructure(...).`);
267
+ return b;
268
268
  }
269
- function Ye(e, t) {
270
- let n = Je(e);
269
+ function Xe(e, t) {
270
+ let n = Ye(e);
271
271
  n.stack[n.stack.length - 1].push(t);
272
272
  }
273
- function Xe(e, t) {
274
- let n = qe;
275
- qe = e;
273
+ function Ze(e, t) {
274
+ let n = Je;
275
+ Je = e;
276
276
  try {
277
277
  return t();
278
278
  } finally {
279
- qe = n;
279
+ Je = n;
280
280
  }
281
281
  }
282
- function Ze() {
283
- return qe;
282
+ function Qe() {
283
+ return Je;
284
284
  }
285
- function Qe(e) {
286
- if (x) throw Error("defineStructure() cannot be called from inside another defineStructure().");
285
+ function $e(e) {
286
+ if (b) throw Error("defineStructure() cannot be called from inside another defineStructure().");
287
287
  let t = [], n = {
288
288
  root: t,
289
289
  stack: [t],
290
290
  inScope: !1
291
291
  };
292
- x = n;
292
+ b = n;
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 $e(r), r;
296
+ return et(r), r;
297
297
  } finally {
298
- x = void 0;
298
+ b = void 0;
299
299
  }
300
300
  }
301
- function $e(e) {
301
+ function et(e) {
302
302
  let t = /* @__PURE__ */ new Map();
303
303
  function n(e, r) {
304
304
  if (e.kind === "scope") {
@@ -321,8 +321,8 @@ function $e(e) {
321
321
  throw Error(`defineStructure validation: path '${t}' under scope '${e}' is declared as both seed and ${n}. Seeds are block-author territory (written once at init, untouched thereafter); engine-managed primitives (fixed/managed/scaffold) rewrite on every refresh. The two contracts cannot coexist on the same path.`);
322
322
  }
323
323
  }
324
- function S(e, t) {
325
- let n = Je("scope");
324
+ function x(e, t) {
325
+ let n = Ye("scope");
326
326
  if (n.inScope) throw Error("scope() cannot nest. Already inside a scope.");
327
327
  let r = {
328
328
  kind: "scope",
@@ -336,19 +336,19 @@ function S(e, t) {
336
336
  n.stack.pop(), n.inScope = !1;
337
337
  }
338
338
  }
339
- var et;
340
- function tt(e) {
341
- et = e;
339
+ var tt;
340
+ function nt(e) {
341
+ tt = e;
342
342
  }
343
- function C(e, t, n) {
344
- nt(e, t), n && nt((t) => !e(t), n);
345
- }
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.");
343
+ function S(e, t, n) {
344
+ rt(e, t), n && rt((t) => !e(t), n);
349
345
  }
350
346
  function rt(e, t) {
351
- let n = x, r = {
347
+ if (b) it(e, t);
348
+ else if (!(tt?.(e, t) ?? !1)) throw Error("when() called outside defineStructure() and outside any managed(...) body. Place this call inside one of the two.");
349
+ }
350
+ function it(e, t) {
351
+ let n = b, r = {
352
352
  kind: "when",
353
353
  trigger: e,
354
354
  children: []
@@ -360,11 +360,11 @@ function rt(e, t) {
360
360
  n.stack.pop();
361
361
  }
362
362
  }
363
- function w(e) {
363
+ function C(e) {
364
364
  return (t) => t.filesMatch(e);
365
365
  }
366
- function it(e, t, n) {
367
- let r = Je(e), i = {
366
+ function at(e, t, n) {
367
+ let r = Ye(e), i = {
368
368
  kind: "mode",
369
369
  modes: t,
370
370
  children: []
@@ -376,140 +376,140 @@ function it(e, t, n) {
376
376
  r.stack.pop();
377
377
  }
378
378
  }
379
- function at(e) {
380
- it("onInitOrUpdate", ["init", "updateDeps"], e);
379
+ function ot(e) {
380
+ at("onInitOrUpdate", ["init", "updateDeps"], e);
381
381
  }
382
- function T(e, t) {
383
- Ye("fixed", {
382
+ function w(e, t) {
383
+ Xe("fixed", {
384
384
  kind: "fixed",
385
385
  path: e,
386
386
  content: t
387
387
  });
388
388
  }
389
- function E(e, t, n) {
390
- Ye("managed", {
389
+ function T(e, t, n) {
390
+ Xe("managed", {
391
391
  kind: "managed",
392
392
  path: e,
393
393
  initial: t,
394
394
  body: n
395
395
  });
396
396
  }
397
- function D(e, t) {
398
- Ye("scaffold", {
397
+ function E(e, t) {
398
+ Xe("scaffold", {
399
399
  kind: "scaffold",
400
400
  path: e,
401
401
  initial: t
402
402
  });
403
403
  }
404
- function O(e, t) {
405
- Ye("seed", {
404
+ function D(e, t) {
405
+ Xe("seed", {
406
406
  kind: "seed",
407
407
  path: e,
408
408
  initial: t
409
409
  });
410
410
  }
411
- function k(e) {
412
- Ye("remove", {
411
+ function O(e) {
412
+ Xe("remove", {
413
413
  kind: "remove",
414
414
  path: e
415
415
  });
416
416
  }
417
- function A(e) {
417
+ function k(e) {
418
418
  return {
419
419
  kind: "file",
420
420
  path: e
421
421
  };
422
422
  }
423
- function ot(e) {
423
+ function st(e) {
424
424
  return {
425
425
  kind: "binary",
426
426
  path: e
427
427
  };
428
428
  }
429
- function st(e) {
429
+ function ct(e) {
430
430
  return {
431
431
  kind: "text",
432
432
  value: e
433
433
  };
434
434
  }
435
- function j(e, t) {
435
+ function A(e, t) {
436
436
  return {
437
437
  kind: "tpl",
438
438
  path: e,
439
439
  vars: t
440
440
  };
441
441
  }
442
- function M(e) {
442
+ function j(e) {
443
443
  return {
444
444
  kind: "generate",
445
445
  fn: e
446
446
  };
447
447
  }
448
448
  // src/structure/engine/parsers/json.ts
449
- var ct = /* @__PURE__ */ a(t());
450
- function lt(e) {
449
+ var lt = /* @__PURE__ */ e(n());
450
+ function ut(e) {
451
451
  return JSON.parse(e);
452
452
  }
453
- var ut = 100, dt = 2;
454
- function ft(e) {
455
- return e.length === 0 ? "[]" : "[" + e.map(pt).join(", ") + "]";
456
- }
453
+ var dt = 100, ft = 2;
457
454
  function pt(e) {
458
- if (Array.isArray(e)) return ft(e);
459
- if (N(e)) {
455
+ return e.length === 0 ? "[]" : "[" + e.map(mt).join(", ") + "]";
456
+ }
457
+ function mt(e) {
458
+ if (Array.isArray(e)) return pt(e);
459
+ if (M(e)) {
460
460
  let t = Object.entries(e);
461
- return t.length === 0 ? "{}" : "{ " + t.map(([e, t]) => `${JSON.stringify(e)}: ${pt(t)}`).join(", ") + " }";
461
+ return t.length === 0 ? "{}" : "{ " + t.map(([e, t]) => `${JSON.stringify(e)}: ${mt(t)}`).join(", ") + " }";
462
462
  }
463
463
  return JSON.stringify(e);
464
464
  }
465
- function mt(e, t, n, r) {
466
- let i = t + dt, a = " ".repeat(i);
465
+ function ht(e, t, n, r) {
466
+ let i = t + ft, a = " ".repeat(i);
467
467
  if (Array.isArray(e)) {
468
- let o = ft(e);
469
- if (n + o.length + r <= ut) return o;
468
+ let o = pt(e);
469
+ if (n + o.length + r <= dt) return o;
470
470
  let s = e.length - 1;
471
- return "[\n" + e.map((e, t) => a + mt(e, i, i, t === s ? 0 : 1)).join(",\n") + "\n" + " ".repeat(t) + "]";
471
+ return "[\n" + e.map((e, t) => a + ht(e, i, i, t === s ? 0 : 1)).join(",\n") + "\n" + " ".repeat(t) + "]";
472
472
  }
473
- if (N(e)) {
473
+ if (M(e)) {
474
474
  let n = Object.entries(e);
475
475
  if (n.length === 0) return "{}";
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 + mt(t, i, o.length, n === r ? 0 : 1);
479
+ return o + ht(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 ht(e, t) {
485
- return t?.collapse ? mt(JSON.parse(JSON.stringify(e ?? null)), 0, 0, 0) + "\n" : JSON.stringify(e, null, 2) + "\n";
484
+ function gt(e, t) {
485
+ return t?.collapse ? ht(JSON.parse(JSON.stringify(e ?? null)), 0, 0, 0) + "\n" : JSON.stringify(e, null, 2) + "\n";
486
486
  }
487
- function gt(e) {
487
+ function _t(e) {
488
488
  return e === "" || e === void 0 ? [] : e.split(".");
489
489
  }
490
- function N(e) {
490
+ function M(e) {
491
491
  return typeof e == "object" && !!e && !Array.isArray(e);
492
492
  }
493
- function _t(e, t) {
494
- let n = gt(t), r = e;
493
+ function vt(e, t) {
494
+ let n = _t(t), r = e;
495
495
  for (let e of n) {
496
- if (!N(r)) return;
496
+ if (!M(r)) return;
497
497
  r = r[e];
498
498
  }
499
499
  return r;
500
500
  }
501
- function vt(e, t) {
502
- let n = gt(t);
501
+ function yt(e, t) {
502
+ let n = _t(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++) {
506
- if (!N(r)) return !1;
506
+ if (!M(r)) return !1;
507
507
  r = r[n[e]];
508
508
  }
509
- return N(r) ? n[n.length - 1] in r : !1;
509
+ return M(r) ? n[n.length - 1] in r : !1;
510
510
  }
511
- function yt(e, t, n) {
512
- let r = gt(t);
511
+ function bt(e, t, n) {
512
+ let r = _t(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++) {
@@ -517,22 +517,22 @@ function yt(e, t, n) {
517
517
  if (n === void 0) {
518
518
  let e = {};
519
519
  i[t] = e, i = e;
520
- } else if (N(n)) i = n;
520
+ } else if (M(n)) i = n;
521
521
  else throw Error(`setAtPath: cannot descend into non-object at '${r.slice(0, e + 1).join(".")}'`);
522
522
  }
523
523
  i[r[r.length - 1]] = n;
524
524
  }
525
- function bt(e, t) {
526
- let n = gt(t);
525
+ function xt(e, t) {
526
+ let n = _t(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++) {
530
- if (!N(r)) return;
530
+ if (!M(r)) return;
531
531
  r = r[n[e]];
532
532
  }
533
- N(r) && delete r[n[n.length - 1]];
533
+ M(r) && delete r[n[n.length - 1]];
534
534
  }
535
- function xt(e, t) {
535
+ function St(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,71 +546,71 @@ function xt(e, t) {
546
546
  return o;
547
547
  }
548
548
  // src/structure/engine/parsers/lines.ts
549
- function St(e) {
549
+ function Ct(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 Ct(e) {
553
+ function wt(e) {
554
554
  return e.join("\n") + "\n";
555
555
  }
556
- function wt(e) {
556
+ function Tt(e) {
557
557
  return e.replace(/(^|\s)#.*$/, "$1").trim();
558
558
  }
559
- function Tt(e, t) {
560
- let n = wt(e);
559
+ function Et(e, t) {
560
+ let n = Tt(e);
561
561
  return n !== "" && n === t.trim();
562
562
  }
563
- function Et(e, t) {
564
- for (let n of e) if (Tt(n, t)) return !0;
563
+ function Dt(e, t) {
564
+ for (let n of e) if (Et(n, t)) return !0;
565
565
  return !1;
566
566
  }
567
567
  // src/structure/engine/content-rules.ts
568
- function Dt(e, t) {
568
+ function Ot(e, t) {
569
569
  return e === "sdk:" ? t ? "workspace:*" : "catalog:" : e;
570
570
  }
571
- var Ot = [
571
+ var kt = [
572
572
  "dependencies",
573
573
  "devDependencies",
574
574
  "peerDependencies",
575
575
  "optionalDependencies"
576
576
  ];
577
- function kt(e, t) {
578
- if (L(e)) for (let n of Ot) {
577
+ function At(e, t) {
578
+ if (I(e)) for (let n of kt) {
579
579
  let r = e[n];
580
- if (L(r)) for (let e of Object.keys(r)) r[e] === "sdk:" && (r[e] = t ? "workspace:*" : "catalog:");
580
+ if (I(r)) for (let e of Object.keys(r)) r[e] === "sdk:" && (r[e] = t ? "workspace:*" : "catalog:");
581
581
  }
582
582
  }
583
- var P;
584
- function At(e) {
585
- if (!P) throw Error(`${e}() only valid inside a managed(...) body. Move this call inside managed(path, initial, () => {...}).`);
586
- return P;
583
+ var N;
584
+ function jt(e) {
585
+ if (!N) throw Error(`${e}() only valid inside a managed(...) body. Move this call inside managed(path, initial, () => {...}).`);
586
+ return N;
587
587
  }
588
- function F(e) {
589
- let t = At(e);
588
+ function P(e) {
589
+ let t = jt(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
- function I(e) {
594
- let t = At(e);
593
+ function F(e) {
594
+ let t = jt(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 jt(e) {
599
- let t = At(e);
598
+ function Mt(e) {
599
+ let t = jt(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 Mt(e, t) {
604
- let n = e.ctx ?? Ze();
603
+ function Nt(e, t) {
604
+ let n = e.ctx ?? Qe();
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
- function L(e) {
608
+ function I(e) {
609
609
  return typeof e == "object" && !!e && !Array.isArray(e);
610
610
  }
611
- function Nt(e, t, n = {}) {
612
- if (P) throw Error("Nested managed(...) body — engine bug.");
613
- P = {
611
+ function Pt(e, t, n = {}) {
612
+ if (N) throw Error("Nested managed(...) body — engine bug.");
613
+ N = {
614
614
  kind: "json",
615
615
  obj: e,
616
616
  ctx: n.ctx,
@@ -619,12 +619,12 @@ function Nt(e, t, n = {}) {
619
619
  try {
620
620
  return t(n.ctx ?? n.triggerContext?.ctx), e;
621
621
  } finally {
622
- P = void 0;
622
+ N = void 0;
623
623
  }
624
624
  }
625
- function Pt(e, t, n = {}) {
626
- if (P) throw Error("Nested managed(...) body — engine bug.");
627
- P = {
625
+ function Ft(e, t, n = {}) {
626
+ if (N) throw Error("Nested managed(...) body — engine bug.");
627
+ N = {
628
628
  kind: "yaml",
629
629
  doc: e,
630
630
  ctx: n.ctx,
@@ -635,12 +635,12 @@ function Pt(e, t, n = {}) {
635
635
  try {
636
636
  return t(n.ctx ?? n.triggerContext?.ctx), e;
637
637
  } finally {
638
- P = void 0;
638
+ N = void 0;
639
639
  }
640
640
  }
641
- function Ft(e, t, n = {}) {
642
- if (P) throw Error("Nested managed(...) body — engine bug.");
643
- P = {
641
+ function It(e, t, n = {}) {
642
+ if (N) throw Error("Nested managed(...) body — engine bug.");
643
+ N = {
644
644
  kind: "lines",
645
645
  lines: e,
646
646
  ctx: n.ctx,
@@ -649,81 +649,81 @@ function Ft(e, t, n = {}) {
649
649
  try {
650
650
  return t(n.ctx ?? n.triggerContext?.ctx), e;
651
651
  } finally {
652
- P = void 0;
652
+ N = void 0;
653
653
  }
654
654
  }
655
- tt((e, t) => {
656
- if (!P) return !1;
657
- let n = P.triggerContext;
655
+ nt((e, t) => {
656
+ if (!N) return !1;
657
+ let n = N.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
- function R(e, t) {
662
- yt(F("ensureField").obj, e, t);
663
- }
664
- function z(e, t) {
665
- let n = F("removeField").obj;
666
- vt(n, e) && (!t || t(_t(n, e))) && bt(n, e);
661
+ function L(e, t) {
662
+ bt(P("ensureField").obj, e, t);
667
663
  }
668
- function It(e, t) {
669
- let n = F("requireField").obj;
670
- if (!vt(n, e)) throw Error(t ?? `requireField: missing field '${e}'`);
664
+ function R(e, t) {
665
+ let n = P("removeField").obj;
666
+ yt(n, e) && (!t || t(vt(n, e))) && xt(n, e);
671
667
  }
672
668
  function Lt(e, t) {
673
- if (vt(F("forbidField").obj, e)) throw Error(t);
669
+ let n = P("requireField").obj;
670
+ if (!yt(n, e)) throw Error(t ?? `requireField: missing field '${e}'`);
674
671
  }
675
672
  function Rt(e, t) {
676
- let n = F("ensureFieldEntries").obj, r = vt(n, e) ? _t(n, e) : void 0, i = L(r) ? r : {};
673
+ if (yt(P("forbidField").obj, e)) throw Error(t);
674
+ }
675
+ function zt(e, t) {
676
+ let n = P("ensureFieldEntries").obj, r = yt(n, e) ? vt(n, e) : void 0, i = I(r) ? r : {};
677
677
  for (let [e, n] of Object.entries(t)) i[e] = n;
678
- L(r) || yt(n, e, i);
678
+ I(r) || bt(n, e, i);
679
679
  }
680
- function B(e, t) {
681
- R(`scripts.${e}`, t);
680
+ function z(e, t) {
681
+ L(`scripts.${e}`, t);
682
682
  }
683
- function V(e) {
684
- z(`scripts.${e}`);
683
+ function B(e) {
684
+ R(`scripts.${e}`);
685
685
  }
686
- var zt = [
686
+ var Bt = [
687
687
  "dependencies",
688
688
  "devDependencies",
689
689
  "peerDependencies",
690
690
  "optionalDependencies"
691
691
  ];
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) {
692
+ function Vt(e, t, n, r) {
693
+ let i = P(e), a = i.obj, o = n === "sdk:" ? Ot(n, Nt(i, e).isSdkInternal) : n;
694
+ for (let e of Bt) {
695
695
  if (e === r) continue;
696
696
  let n = a[e];
697
- L(n) && t in n && delete n[t];
697
+ I(n) && t in n && delete n[t];
698
698
  }
699
- let s = a[r], c = L(s) ? s : {};
700
- c[t] = o, L(s) || (a[r] = c);
699
+ let s = a[r], c = I(s) ? s : {};
700
+ c[t] = o, I(s) || (a[r] = c);
701
701
  }
702
- function Vt(e, t) {
703
- Bt("ensureDep", e, t, "dependencies");
702
+ function Ht(e, t) {
703
+ Vt("ensureDep", e, t, "dependencies");
704
704
  }
705
- function H(e, t) {
706
- Bt("ensureDevDep", e, t, "devDependencies");
705
+ function V(e, t) {
706
+ Vt("ensureDevDep", e, t, "devDependencies");
707
707
  }
708
- function Ht(e, t) {
709
- Bt("ensurePeerDep", e, t, "peerDependencies");
708
+ function Ut(e, t) {
709
+ Vt("ensurePeerDep", e, t, "peerDependencies");
710
710
  }
711
- function U(e) {
712
- let t = F("removeDep").obj;
713
- for (let n of zt) {
711
+ function H(e) {
712
+ let t = P("removeDep").obj;
713
+ for (let n of Bt) {
714
714
  let r = t[n];
715
- L(r) && e in r && delete r[e];
715
+ I(r) && e in r && delete r[e];
716
716
  }
717
717
  }
718
- function W(e) {
719
- for (let [t, n] of Object.entries(e)) H(t, n);
718
+ function U(e) {
719
+ for (let [t, n] of Object.entries(e)) V(t, n);
720
720
  }
721
- function Ut(e) {
722
- for (let [t, n] of Object.entries(e)) Ht(t, n);
721
+ function W(e) {
722
+ for (let [t, n] of Object.entries(e)) Ut(t, n);
723
723
  }
724
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);
725
+ let r = Nt(P(e), e);
726
+ for (let i of r.modules) i.scope === t && Vt(e, i.name, "workspace:*", n);
727
727
  }
728
728
  function Gt(e) {
729
729
  Wt("ensureWorkspaceScopeDeps", e, "dependencies");
@@ -732,40 +732,40 @@ function Kt(e) {
732
732
  Wt("ensureWorkspaceScopeDevDeps", e, "devDependencies");
733
733
  }
734
734
  function qt(e) {
735
- let t = F("pruneKeysMatching").obj;
735
+ let t = P("pruneKeysMatching").obj;
736
736
  for (let n of Object.keys(t)) e(n, t[n]) && delete t[n];
737
737
  }
738
738
  function Jt(e, t) {
739
- let n = xt(e, t);
739
+ let n = St(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
- Jt(F("enforceFieldOrder").obj, e);
744
+ Jt(P("enforceFieldOrder").obj, e);
745
745
  }
746
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]) && Yt(e[i], !0);
750
+ for (let i of n) e[i] = r[i], t && I(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
- let r = F("enforceAlphabeticalOrder").obj;
755
+ let r = P("enforceAlphabeticalOrder").obj;
756
756
  if (e === "") {
757
757
  Yt(r, !0);
758
758
  return;
759
759
  }
760
- let i = _t(r, e);
761
- L(i) && Yt(i, n);
760
+ let i = vt(r, e);
761
+ I(i) && Yt(i, n);
762
762
  }
763
763
  function Xt(e, t) {
764
- let n = F("transformAt").obj;
765
- yt(n, e, t(_t(n, e)));
764
+ let n = P("transformAt").obj;
765
+ bt(n, e, t(vt(n, e)));
766
766
  }
767
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;
768
+ let e = F("ensureWorkspaceModulePaths"), t = Nt(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
771
  function Qt(e, t) {
@@ -773,49 +773,49 @@ function Qt(e, t) {
773
773
  return typeof n == "string" ? n : void 0;
774
774
  }
775
775
  function $t(e, t) {
776
- let n = I("ensureCatalogVersion");
776
+ let n = F("ensureCatalogVersion");
777
777
  Qt(n, e) === void 0 && n.doc.setIn(["catalog", e], t);
778
778
  }
779
779
  function en(e) {
780
- let t = I("ensureCatalogLatest");
780
+ let t = F("ensureCatalogLatest");
781
781
  if (!t.getLatestVersion) return;
782
782
  let n = t.getLatestVersion(e);
783
783
  n !== void 0 && Qt(t, e) !== n && t.doc.setIn(["catalog", e], n);
784
784
  }
785
785
  function tn(e, t) {
786
- let n = I("pinCatalogToDependencyOf");
786
+ let n = F("pinCatalogToDependencyOf");
787
787
  if (!n.getDerivedDependencyPin) return;
788
788
  let r = n.getDerivedDependencyPin(e);
789
789
  r !== void 0 && Qt(n, e) !== r && n.doc.setIn(["catalog", e], r);
790
790
  }
791
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);
792
+ let n = F("ensureCatalogAtLeast"), r = Qt(n, e), i = (0, lt.minVersion)(t), a = r !== void 0 && (0, lt.validRange)(r) !== null ? (0, lt.minVersion)(r) : null;
793
+ (r === void 0 || i !== null && a !== null && !(0, lt.gte)(a, i)) && n.doc.setIn(["catalog", e], t);
794
794
  }
795
795
  function rn(e) {
796
- let t = I("ensureCatalogAbsent");
796
+ let t = F("ensureCatalogAbsent");
797
797
  t.doc.hasIn(["catalog", e]) && t.doc.deleteIn(["catalog", e]);
798
798
  }
799
799
  function an(e, t, { keepExisting: n = !1 } = {}) {
800
- let r = I("ensureWorkspaceMapEntries");
801
- pe(r.doc.get(e)) || r.doc.delete(e);
800
+ let r = F("ensureWorkspaceMapEntries");
801
+ me(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
805
  function on(e, t) {
806
- let n = I("ensureWorkspaceListItems"), r = n.doc.toJSON()?.[e], i = new Set(Array.isArray(r) ? r : []), a = t.filter((e) => !i.has(e));
806
+ let n = F("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 (!me(n.doc.get(e))) n.doc.set(e, a);
808
+ if (!he(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
812
  function sn(e) {
813
- let t = jt("ensureGitignoreEntries");
814
- for (let n of e) Et(t.lines, n) || t.lines.push(n);
813
+ let t = Mt("ensureGitignoreEntries");
814
+ for (let n of e) Dt(t.lines, n) || t.lines.push(n);
815
815
  }
816
816
  // src/structure/engine/parsers/yaml.ts
817
817
  function cn(e) {
818
- return ge(e);
818
+ return _e(e);
819
819
  }
820
820
  function ln(e) {
821
821
  return e.toString();
@@ -858,11 +858,11 @@ function gn(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 Le(n.textRead(e.path), typeof e.vars == "function" ? e.vars(r) : e.vars);
861
+ return Re(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 kt(n, r.isSdkInternal), ht(n, { collapse: !t.endsWith("package.json") });
865
- if (t.endsWith(".yaml") || t.endsWith(".yml")) return _e(n);
864
+ if (t.endsWith(".json")) return At(n, r.isSdkInternal), gt(n, { collapse: !t.endsWith("package.json") });
865
+ if (t.endsWith(".yaml") || t.endsWith(".yml")) return ve(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
  }
@@ -878,21 +878,21 @@ function _n(e, t, n, r, i) {
878
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 = lt(t);
881
+ let i = ut(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 Nt(i, n, { triggerContext: r }), ht(i, { collapse: o !== "package.json" });
883
+ return Pt(i, n, { triggerContext: r }), gt(i, { collapse: o !== "package.json" });
884
884
  }
885
885
  if (e.endsWith(".yaml") || e.endsWith(".yml")) {
886
886
  let e = cn(t);
887
- return Pt(e, n, {
887
+ return Ft(e, n, {
888
888
  triggerContext: r,
889
889
  getLatestVersion: i,
890
890
  getDerivedDependencyPin: a
891
891
  }), ln(e);
892
892
  }
893
893
  if (o === ".gitignore" || o.endsWith(".gitignore")) {
894
- let e = St(t);
895
- return Ft(e, n, { triggerContext: r }), Ct(e);
894
+ let e = Ct(t);
895
+ return It(e, n, { triggerContext: r }), wt(e);
896
896
  }
897
897
  throw Error(`managed('${e}'): unsupported file kind. Only .json, .yaml, .yml, .gitignore are dispatched.`);
898
898
  }
@@ -917,7 +917,7 @@ function xn(e, t, n) {
917
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 (Ke(r, t)) return !0;
920
+ for (let t of e) if (qe(r, t)) return !0;
921
921
  return !1;
922
922
  }
923
923
  };
@@ -1013,14 +1013,14 @@ function Dn(e, t, n, r, i, a, o, s) {
1013
1013
  return l;
1014
1014
  }
1015
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);
1016
+ return Ze(n, () => {
1017
+ let i = He(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
1019
  mn(t, { version: 3 });
1020
1020
  let i = {
1021
1021
  ...r.rediscover ? r.rediscover(t) : n,
1022
1022
  dryRun: !0
1023
- }, a = Dn(Ve(e, i), t, i, !0, r.templates, !1, r.registryLookup, r.derivedPinLookup).filter((e) => e.path !== un);
1023
+ }, a = Dn(He(e, i), t, i, !0, r.templates, !1, r.registryLookup, r.derivedPinLookup).filter((e) => e.path !== un);
1024
1024
  if (a.length > 0) throw new hn(a[0]);
1025
1025
  }
1026
1026
  return a && !n.dryRun && mn(t, { version: 3 }), { changes: o };
@@ -1187,7 +1187,7 @@ function Hn(e) {
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 = he(t) ?? {}, r = Array.isArray(n.packages) ? n.packages : [], i = /* @__PURE__ */ new Set([""]);
1190
+ let n = ge(t) ?? {}, r = Array.isArray(n.packages) ? n.packages : [], i = /* @__PURE__ */ new Set([""]);
1191
1191
  for (let t of r) {
1192
1192
  let n = Vn(t);
1193
1193
  (n === "" || e.exists(n)) && i.add(n);
@@ -1339,20 +1339,20 @@ function tr() {
1339
1339
  };
1340
1340
  }
1341
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.");
1342
+ L("packageManager", Jn), L("devEngines.runtime", qn), R("pnpm", (e) => e === null || typeof e == "object" && Object.values(e).every((e) => typeof e == "object" && !!e && Object.keys(e).length === 0)), Rt("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
1343
  }
1344
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);
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({
1345
+ nr(), R("name"), z("fmt", "turbo run fmt"), z("check", "turbo run check");
1346
+ for (let [e, t] of Object.entries($n)) z(e, t);
1347
+ for (let [e, t] of Object.entries(er)) z(e, t);
1348
+ B("build"), B("build:dev"), z("mark-stable", "turbo run mark-stable"), z("do-pack", "turbo run do-pack"), z("watch", "turbo watch build"), z("changeset", "changeset"), z("version-packages", "changeset version"), z("update-sdk", "block-tools structure refresh --update-deps-only"), B("update"), z("upgrade-sdk", "block-tools structure refresh --update-deps-only && pnpm i && block-tools structure refresh && pnpm i && pnpm fmt"), U({
1349
1349
  "@changesets/cli": "catalog:",
1350
1350
  "@milaboratories/ts-builder": "sdk:",
1351
1351
  "@platforma-sdk/block-tools": "sdk:",
1352
1352
  "cross-env": "catalog:",
1353
1353
  shx: "catalog:",
1354
1354
  turbo: "catalog:"
1355
- }), Ut({
1355
+ }), W({
1356
1356
  oxlint: "*",
1357
1357
  oxfmt: "*"
1358
1358
  }), qt((e, t) => {
@@ -1419,7 +1419,7 @@ function sr() {
1419
1419
  };
1420
1420
  }
1421
1421
  function cr() {
1422
- R("$schema", ir), R("globalDependencies", ar), Rt("tasks", or), z("tasks.build:dev"), G([
1422
+ L("$schema", ir), L("globalDependencies", ar), zt("tasks", or), R("tasks.build:dev"), G([
1423
1423
  "$schema",
1424
1424
  "globalDependencies",
1425
1425
  "tasks"
@@ -1442,18 +1442,18 @@ async function pr(e) {
1442
1442
  } catch (e) {
1443
1443
  if (t > lr) throw e;
1444
1444
  let n = ur * 2 ** (t - 1) * (.8 + .4 * Math.random());
1445
- await ve(n);
1445
+ await ye(n);
1446
1446
  continue;
1447
1447
  }
1448
1448
  if (n.ok) return n;
1449
1449
  if (!(n.status === 429 || n.status >= 500) || t > lr) throw Error(`registry returned HTTP ${n.status}`);
1450
1450
  let r = fr(n.headers.get("retry-after"));
1451
1451
  if (r != null) {
1452
- await ve(r);
1452
+ await ye(r);
1453
1453
  continue;
1454
1454
  }
1455
1455
  let i = ur * 2 ** (t - 1) * (.8 + .4 * Math.random());
1456
- await ve(i);
1456
+ await ye(i);
1457
1457
  }
1458
1458
  }
1459
1459
  function mr() {
@@ -1507,7 +1507,7 @@ var Sr = [
1507
1507
  "@platforma-sdk/eslint-config"
1508
1508
  ];
1509
1509
  function Cr() {
1510
- for (let e of Sr) U(e);
1510
+ for (let e of Sr) H(e);
1511
1511
  }
1512
1512
  // src/structure/rules/root-pnpm-workspace.ts
1513
1513
  var wr = [
@@ -1590,7 +1590,7 @@ function Ir(e) {
1590
1590
  };
1591
1591
  }
1592
1592
  function Lr(e) {
1593
- R("changelog", Rr), R("commit", !1), R("access", zr), R("baseBranch", Br), R("updateInternalDependencies", Vr);
1593
+ L("changelog", Rr), L("commit", !1), L("access", zr), L("baseBranch", Br), L("updateInternalDependencies", Vr);
1594
1594
  let t = Wr(e);
1595
1595
  Xt("fixed", (e) => Gr(e, t)), G(Hr);
1596
1596
  }
@@ -1625,19 +1625,19 @@ function Kr(e) {
1625
1625
  }
1626
1626
  // src/structure/rules/root.ts
1627
1627
  function qr() {
1628
- S("root", () => {
1629
- C(({ ctx: e }) => !e.isSdkInternal, () => {
1630
- E("turbo.json", M(() => sr()), () => {
1628
+ x("root", () => {
1629
+ S(({ ctx: e }) => !e.isSdkInternal, () => {
1630
+ T("turbo.json", j(() => sr()), () => {
1631
1631
  cr();
1632
- }), T(".vscode/settings.json", A("root/.vscode/settings.json")), E("package.json", M(() => tr()), () => {
1632
+ }), w(".vscode/settings.json", k("root/.vscode/settings.json")), T("package.json", j(() => tr()), () => {
1633
1633
  rr();
1634
- }), E("pnpm-workspace.yaml", M((e) => Ar(e)), () => {
1634
+ }), T("pnpm-workspace.yaml", j((e) => Ar(e)), () => {
1635
1635
  Mr();
1636
- }), E(".gitignore", A("root/gitignore"), () => {
1636
+ }), T(".gitignore", k("root/gitignore"), () => {
1637
1637
  Pr();
1638
- }), E(".changeset/config.json", M((e) => Ir(e)), (e) => {
1638
+ }), T(".changeset/config.json", j((e) => Ir(e)), (e) => {
1639
1639
  Lr(e);
1640
- }), O(".changeset/scaffold.md", st(Fr));
1640
+ }), D(".changeset/scaffold.md", ct(Fr));
1641
1641
  });
1642
1642
  });
1643
1643
  }
@@ -1646,16 +1646,16 @@ function Jr(e) {
1646
1646
  return e.split(/[-_]+/).filter((e) => e.length > 0).map((e) => e.charAt(0).toUpperCase() + e.slice(1)).join(" ");
1647
1647
  }
1648
1648
  function Yr() {
1649
- S("root", () => {
1650
- C(({ ctx: e }) => !e.isSdkInternal, () => {
1651
- T(".github/workflows/build.yaml", j("workflows/build.tpl.yaml", (e) => {
1649
+ x("root", () => {
1650
+ S(({ ctx: e }) => !e.isSdkInternal, () => {
1651
+ w(".github/workflows/build.yaml", A("workflows/build.tpl.yaml", (e) => {
1652
1652
  let t = e.blockVars.shortName;
1653
1653
  return {
1654
1654
  appName: `Block: ${Jr(t)}`,
1655
1655
  appNameSlug: `block-${t}`,
1656
1656
  nodeVersion: Kn
1657
1657
  };
1658
- })), T(".github/workflows/mark-stable.yaml", j("workflows/mark-stable.tpl.yaml", (e) => ({
1658
+ })), w(".github/workflows/mark-stable.yaml", A("workflows/mark-stable.tpl.yaml", (e) => ({
1659
1659
  appName: `Block: ${Jr(e.blockVars.shortName)} - Mark Stable`,
1660
1660
  nodeVersion: Kn
1661
1661
  })));
@@ -1760,10 +1760,10 @@ function ai(e) {
1760
1760
  function oi(e) {
1761
1761
  let t = e.blockVars, n = q(e, "kind");
1762
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`);
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);
1763
+ L("type", "module"), L("files", ["dist", "block-pack"]), L("main", "./dist/index.js"), L("module", "./dist/index.js"), L("types", "./dist/index.d.ts"), L("exports", ri);
1764
1764
  let r = ti(t.npmOrg, e.isSdkInternal);
1765
- for (let [e, t] of Object.entries(r)) B(e, t);
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]);
1765
+ for (let [e, t] of Object.entries(r)) z(e, t);
1766
+ Kt("model"), Kt("ui"), Kt("workflow"), Kt("kind"), V("@milaboratories/ts-builder", "sdk:"), V("@milaboratories/ts-configs", "sdk:"), V("@platforma-sdk/block-tools", "sdk:"), V("@platforma-sdk/model", "sdk:"), V("shx", "catalog:"), V("typescript", "catalog:"), L("block.components", ei(e)), Lt("version", "facade package.json must carry a 'version' (the facade publishes)"), K("dependencies"), K("devDependencies"), K("peerDependencies"), K("optionalDependencies"), G([...X]);
1767
1767
  }
1768
1768
  // src/structure/rules/shared/pascal-case.ts
1769
1769
  function si(e) {
@@ -1772,11 +1772,11 @@ function si(e) {
1772
1772
  }
1773
1773
  // src/structure/rules/block.ts
1774
1774
  function ci() {
1775
- S("block", () => {
1776
- k("index.js"), k("index.d.ts"), T("src/index.ts", j("block/src/index.tpl.ts", (e) => ({
1775
+ x("block", () => {
1776
+ O("index.js"), O("index.d.ts"), w("src/index.ts", A("block/src/index.tpl.ts", (e) => ({
1777
1777
  facadeName: e.blockVars.facadeName,
1778
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) => {
1779
+ }))), w("src/AGENTS.ts", k("block/src/AGENTS.ts")), E("src/block-extra.ts", k("block/src/block-extra.ts")), E("src/agents-extra.ts", k("block/src/agents-extra.ts")), w("tsconfig.json", k("block/tsconfig.json")), D("logos/block-logo.png", st("block/logos/block-logo.png")), D("logos/organization-logo.png", st("block/logos/organization-logo.png")), T("package.json", j((e) => ai(e)), (e) => {
1780
1780
  oi(e);
1781
1781
  });
1782
1782
  });
@@ -1823,28 +1823,28 @@ function ui(e) {
1823
1823
  };
1824
1824
  }
1825
1825
  function di() {
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", {
1826
+ Q(), L("private", !0), L("type", "module"), L("main", "dist/index.cjs"), L("module", "dist/index.js"), L("types", "dist/index.d.ts"), L("exports", {
1827
1827
  ".": {
1828
1828
  types: "./dist/index.d.ts",
1829
1829
  sources: "./src/index.ts",
1830
1830
  import: "./dist/index.js"
1831
1831
  },
1832
1832
  "./dist/*": "./dist/*"
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({
1833
+ }), z("fmt", "ts-builder format"), z("watch", "ts-builder build --target block-model --watch"), z("build", "ts-builder build --target block-model && block-tools build-model"), z("check", "ts-builder check --target block-model"), Ht("@platforma-sdk/model", "sdk:"), Gt("kind"), U({
1834
1834
  "@milaboratories/ts-builder": "sdk:",
1835
1835
  "@milaboratories/ts-configs": "sdk:",
1836
1836
  "@platforma-sdk/block-tools": "sdk:"
1837
- }), Ut({
1837
+ }), W({
1838
1838
  "@types/node": "*",
1839
1839
  typescript: "*"
1840
- }), C(({ ctx: e }) => !e.isSdkInternal, () => C(w($), () => {
1841
- B("test", "vitest run --passWithNoTests"), H("vitest", "catalog:"), H("@types/node", "*");
1842
- }, () => U("vitest"))), Cr(), z("tsup"), V("lint"), K("dependencies"), K("devDependencies"), K("peerDependencies"), K("optionalDependencies"), G([...X]);
1840
+ }), S(({ ctx: e }) => !e.isSdkInternal, () => S(C($), () => {
1841
+ z("test", "vitest run --passWithNoTests"), V("vitest", "catalog:"), V("@types/node", "*");
1842
+ }, () => H("vitest"))), Cr(), R("tsup"), B("lint"), K("dependencies"), K("devDependencies"), K("peerDependencies"), K("optionalDependencies"), G([...X]);
1843
1843
  }
1844
1844
  // src/structure/rules/model.ts
1845
1845
  function fi() {
1846
- S("model", () => {
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)), () => {
1846
+ x("model", () => {
1847
+ S(C($), () => w("tsconfig.json", k("model/tsconfig.node.json")), () => w("tsconfig.json", k("model/tsconfig.json"))), w(".oxlintrc.json", k("model/.oxlintrc.json")), w(".oxfmtrc.json", k("model/.oxfmtrc.json")), D("src/index.ts", A("model/src/index.tpl.ts", (e) => ({ kindPkg: `${e.blockVars.facadeName}.kind` }))), T("package.json", j((e) => ui(e)), () => {
1848
1848
  di();
1849
1849
  });
1850
1850
  });
@@ -1886,19 +1886,19 @@ function mi(e) {
1886
1886
  };
1887
1887
  }
1888
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({
1889
+ Q(), L("private", !0), L("type", "module"), L("main", "./dist/index.cjs"), L("module", "./dist/index.js"), L("types", "./dist/index.d.ts"), L("exports", pi), z("fmt", "ts-builder format"), z("watch", "ts-builder build --target block-kind --watch"), z("build", "ts-builder build --target block-kind && block-tools build-kind-manifest"), z("check", "ts-builder check --target block-kind"), B("lint"), Ht("@platforma-sdk/block-kind", "sdk:"), U({
1890
1890
  "@milaboratories/ts-builder": "sdk:",
1891
1891
  "@milaboratories/ts-configs": "sdk:",
1892
1892
  "@platforma-sdk/block-tools": "sdk:"
1893
- }), Ut({
1893
+ }), W({
1894
1894
  "@types/node": "*",
1895
1895
  typescript: "*"
1896
1896
  }), K("dependencies"), K("devDependencies"), K("peerDependencies"), K("optionalDependencies"), G([...X]);
1897
1897
  }
1898
1898
  // src/structure/rules/kind.ts
1899
1899
  function gi() {
1900
- S("kind", () => {
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)), () => {
1900
+ x("kind", () => {
1901
+ w("tsconfig.json", k("kind/tsconfig.json")), w(".oxlintrc.json", k("kind/.oxlintrc.json")), w(".oxfmtrc.json", k("kind/.oxfmtrc.json")), E("src/index.ts", k("kind/src/index.ts")), T("package.json", j((e) => mi(e)), () => {
1902
1902
  hi();
1903
1903
  });
1904
1904
  });
@@ -1933,20 +1933,20 @@ function _i(e) {
1933
1933
  };
1934
1934
  }
1935
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({
1936
+ Q(), L("private", !0), L("type", "module"), z("fmt", "ts-builder format"), z("dev", "ts-builder serve --target block-ui"), z("watch", "ts-builder build --target block-ui --watch"), z("build", "ts-builder build --target block-ui"), z("check", "ts-builder check --target block-ui"), Ht("@platforma-sdk/ui-vue", "sdk:"), Ht("vue", "catalog:"), Gt("model"), U({
1937
1937
  "@milaboratories/ts-builder": "sdk:",
1938
1938
  "@milaboratories/ts-configs": "sdk:"
1939
- }), Cr(), V("preview"), V("lint"), Ut({
1939
+ }), Cr(), B("preview"), B("lint"), W({
1940
1940
  "@types/node": "*",
1941
1941
  typescript: "*"
1942
- }), C(({ ctx: e }) => !e.isSdkInternal, () => C(w($), () => {
1943
- B("test", "vitest run --passWithNoTests"), H("vitest", "catalog:"), H("@types/node", "*");
1944
- }, () => U("vitest"))), K("dependencies"), K("devDependencies"), K("peerDependencies"), K("optionalDependencies"), G([...X]);
1942
+ }), S(({ ctx: e }) => !e.isSdkInternal, () => S(C($), () => {
1943
+ z("test", "vitest run --passWithNoTests"), V("vitest", "catalog:"), V("@types/node", "*");
1944
+ }, () => H("vitest"))), K("dependencies"), K("devDependencies"), K("peerDependencies"), K("optionalDependencies"), G([...X]);
1945
1945
  }
1946
1946
  // src/structure/rules/ui.ts
1947
1947
  function yi() {
1948
- S("ui", () => {
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)), () => {
1948
+ x("ui", () => {
1949
+ S(C($), () => w("tsconfig.json", k("ui/tsconfig.node.json")), () => w("tsconfig.json", k("ui/tsconfig.json"))), w(".oxlintrc.json", k("ui/.oxlintrc.json")), w(".oxfmtrc.json", k("ui/.oxfmtrc.json")), E("index.html", k("ui/index.html")), D("src/main.ts", k("ui/src/main.ts")), D("src/app.ts", A("ui/src/app.tpl.ts", (e) => ({ modelPkg: `${e.blockVars.facadeName}.model` }))), D("src/MainPage.vue", A("ui/src/MainPage.tpl.vue", (e) => ({ shortName: e.blockVars.shortName }))), T("package.json", j((e) => _i(e)), () => {
1950
1950
  vi();
1951
1951
  });
1952
1952
  });
@@ -1975,11 +1975,11 @@ function bi(e) {
1975
1975
  };
1976
1976
  }
1977
1977
  function xi() {
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($), () => {
1979
- C(w(li), () => B("test", "pl-tengo test && vitest run --passWithNoTests"), () => B("test", "vitest run --passWithNoTests")), W({ vitest: "catalog:" });
1978
+ Q(), L("private", !0), L("type", "module"), z("build", "shx rm -rf dist && pl-tengo build"), z("check", "pl-tengo imports && pl-tengo check"), z("format", "/usr/bin/env emacs --script ./format.el || echo 'No emacs.'"), S(({ ctx: e }) => !e.isSdkInternal, () => S(C($), () => {
1979
+ S(C(li), () => z("test", "pl-tengo test && vitest run --passWithNoTests"), () => z("test", "vitest run --passWithNoTests")), U({ vitest: "catalog:" });
1980
1980
  }, () => {
1981
- C(w(li), () => B("test", "pl-tengo test")), U("vitest");
1982
- })), Vt("@platforma-sdk/workflow-tengo", "sdk:"), Gt("software"), W({
1981
+ S(C(li), () => z("test", "pl-tengo test")), H("vitest");
1982
+ })), Ht("@platforma-sdk/workflow-tengo", "sdk:"), Gt("software"), U({
1983
1983
  "@platforma-sdk/tengo-builder": "sdk:",
1984
1984
  "@platforma-sdk/test": "sdk:",
1985
1985
  shx: "catalog:"
@@ -1987,12 +1987,12 @@ function xi() {
1987
1987
  }
1988
1988
  // src/structure/rules/workflow.ts
1989
1989
  function Si() {
1990
- S("workflow", () => {
1991
- T("format.el", A("workflow/format.el")), C(({ ctx: e }) => !e.isSdkInternal, () => C(w($), () => {
1992
- T("tsconfig.json", A("workflow/tsconfig.json")), D("vitest.config.mts", A("workflow/vitest.config.mts"));
1990
+ x("workflow", () => {
1991
+ w("format.el", k("workflow/format.el")), S(({ ctx: e }) => !e.isSdkInternal, () => S(C($), () => {
1992
+ w("tsconfig.json", k("workflow/tsconfig.json")), E("vitest.config.mts", k("workflow/vitest.config.mts"));
1993
1993
  }, () => {
1994
- k("tsconfig.json"), k("vitest.config.mts");
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)), () => {
1994
+ O("tsconfig.json"), O("vitest.config.mts");
1995
+ })), O("index.js"), O("index.d.ts"), D("src/main.tpl.tengo", A("workflow/src/main.tpl.tengo", (e) => ({ shortName: e.blockVars.shortName }))), T("package.json", j((e) => bi(e)), () => {
1996
1996
  xi();
1997
1997
  });
1998
1998
  });
@@ -2019,17 +2019,17 @@ function Ci(e) {
2019
2019
  };
2020
2020
  }
2021
2021
  function wi() {
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({
2022
+ Q(), L("private", !0), L("type", "module"), z("fmt", "ts-builder format"), z("check", "ts-builder check --target block-test"), z("test", "vitest run --passWithNoTests"), B("lint"), U({
2023
2023
  "@platforma-sdk/test": "sdk:",
2024
2024
  "@milaboratories/ts-builder": "sdk:",
2025
2025
  "@milaboratories/ts-configs": "sdk:",
2026
2026
  vitest: "catalog:"
2027
- }), Ut({ typescript: "*" }), U("@types/node"), Cr(), K("dependencies"), K("devDependencies"), K("peerDependencies"), K("optionalDependencies"), G([...X]);
2027
+ }), W({ typescript: "*" }), H("@types/node"), Cr(), K("dependencies"), K("devDependencies"), K("peerDependencies"), K("optionalDependencies"), G([...X]);
2028
2028
  }
2029
2029
  // src/structure/rules/test.ts
2030
2030
  function Ti() {
2031
- S("test", () => {
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)), () => {
2031
+ x("test", () => {
2032
+ w("tsconfig.json", k("test/tsconfig.json")), w(".oxlintrc.json", k("test/.oxlintrc.json")), w(".oxfmtrc.json", k("test/.oxfmtrc.json")), E("vitest.config.mts", k("test/vitest.config.mts")), D("src/demo.test.ts", ct("import { expect, test } from \"vitest\";\n\ntest(\"scaffolded block sanity check\", () => {\n expect(true).toBe(true);\n});\n")), T("package.json", j((e) => Ci(e)), () => {
2033
2033
  wi();
2034
2034
  });
2035
2035
  });
@@ -2072,38 +2072,38 @@ function ki(e) {
2072
2072
  };
2073
2073
  }
2074
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]);
2075
+ R("private"), Q(), L("type", "module"), L("files", ["./dist/**/*"]), z("build", Ei), z("do-pack", Di), B("prepublishOnly"), z("changeset", "changeset"), z("version-packages", "changeset version"), V("@platforma-open/milaboratories.runenv-python-3", "catalog:"), V("@platforma-sdk/block-tools", "sdk:"), H("@platforma-sdk/package-builder"), K("dependencies"), K("devDependencies"), K("peerDependencies"), K("optionalDependencies"), G([...X]);
2076
2076
  }
2077
2077
  // src/structure/rules/software.ts
2078
2078
  var ji = "import sys\n\nprint(\"Hello from Python, \" + sys.argv[1] + \"!\")\n", Mi = "# No dependencies specified for this script\n";
2079
2079
  function Ni() {
2080
- S("software", () => {
2081
- O("src/main.py", st(ji)), O("src/requirements.txt", st(Mi)), E("package.json", M((e) => ki(e)), () => {
2080
+ x("software", () => {
2081
+ D("src/main.py", ct(ji)), D("src/requirements.txt", ct(Mi)), T("package.json", j((e) => ki(e)), () => {
2082
2082
  Ai();
2083
2083
  });
2084
2084
  });
2085
2085
  }
2086
2086
  function Pi() {
2087
- S("model", () => {
2088
- k("eslint.config.mjs"), k("vite.config.mts");
2089
- }), S("ui", () => {
2090
- k("eslint.config.mjs"), k("vite.config.ts"), k("tsconfig.app.json"), k("tsconfig.node.json");
2091
- }), S("test", () => {
2092
- k("eslint.config.mjs");
2093
- }), S("root", () => {
2094
- k(".prettierrc"), E("package.json", M(() => tr()), () => {
2095
- V("pretty"), U("@platforma-sdk/blocks-deps-updater");
2087
+ x("model", () => {
2088
+ O("eslint.config.mjs"), O("vite.config.mts");
2089
+ }), x("ui", () => {
2090
+ O("eslint.config.mjs"), O("vite.config.ts"), O("tsconfig.app.json"), O("tsconfig.node.json");
2091
+ }), x("test", () => {
2092
+ O("eslint.config.mjs");
2093
+ }), x("root", () => {
2094
+ O(".prettierrc"), T("package.json", j(() => tr()), () => {
2095
+ B("pretty"), H("@platforma-sdk/blocks-deps-updater");
2096
2096
  });
2097
2097
  });
2098
2098
  }
2099
2099
  // src/structure/rules/root-catalog-bump.ts
2100
2100
  function Fi() {
2101
- at(() => {
2102
- S("root", () => {
2103
- C(({ ctx: e }) => !e.isSdkInternal, () => {
2104
- E("package.json", M(() => tr()), () => {
2101
+ ot(() => {
2102
+ x("root", () => {
2103
+ S(({ ctx: e }) => !e.isSdkInternal, () => {
2104
+ T("package.json", j(() => tr()), () => {
2105
2105
  nr(), G([...X]);
2106
- }), E("pnpm-workspace.yaml", M((e) => Ar(e)), (e) => {
2106
+ }), T("pnpm-workspace.yaml", j((e) => Ar(e)), (e) => {
2107
2107
  for (let e of wr) en(e);
2108
2108
  for (let e of Dr) tn(e.entry, {
2109
2109
  of: e.of,
@@ -2116,7 +2116,7 @@ function Fi() {
2116
2116
  });
2117
2117
  }
2118
2118
  // src/structure/structure-definition.ts
2119
- var Ii = Qe(() => {
2119
+ var Ii = $e(() => {
2120
2120
  qr(), Yr(), ci(), fi(), gi(), yi(), Si(), Ti(), Ni(), Pi(), Fi();
2121
2121
  });
2122
2122
  // src/structure/cli/run-structure.ts
@@ -2124,7 +2124,7 @@ async function Li() {
2124
2124
  return yr(wr.filter(vr));
2125
2125
  }
2126
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({
2127
+ let t = h.resolve(e.blockPath), n = e.mode === "check", r = new Ie(t), i = new Le(e.templatesRoot), a = On(Ii, r, Gn({
2128
2128
  fs: r,
2129
2129
  isSdkInternal: e.isSdkInternal,
2130
2130
  updateDepsOnly: e.updateDepsOnly,
@@ -2146,7 +2146,7 @@ async function Ri(e) {
2146
2146
  };
2147
2147
  }
2148
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]);
2149
+ let t = e.flatMap((e) => /[*?[]/.test(e) ? ie(e).filter((e) => ae(e, { throwIfNoEntry: !1 })?.isDirectory() === !0).map((e) => e.split(h.sep).join("/")).sort() : [e]);
2150
2150
  return [...new Set(t)];
2151
2151
  }
2152
2152
  function Bi(e, t) {
@@ -2169,37 +2169,37 @@ async function Vi(e) {
2169
2169
  }
2170
2170
  }
2171
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).");
2172
+ let t = new p("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
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");
2174
+ let r = t.length > 0 ? zi(t) : ["."], i = h.join(e, "src", "structure", "templates");
2175
2175
  await Vi({
2176
2176
  paths: r,
2177
2177
  isSdkInternal: !!n.sdkInternal,
2178
2178
  updateDepsOnly: !!n.updateDepsOnly,
2179
2179
  templatesRoot: i,
2180
- logger: new b()
2180
+ logger: new y()
2181
2181
  });
2182
2182
  }), t;
2183
2183
  }
2184
2184
  // src/cmd/update-deps.ts
2185
2185
  function Ui(e) {
2186
- let t = new m("update-deps").description("[DEPRECATED] Use `block-tools structure refresh --update-deps-only`. This alias delegates to it.");
2186
+ let t = new p("update-deps").description("[DEPRECATED] Use `block-tools structure refresh --update-deps-only`. This alias delegates to it.");
2187
2187
  return t.action(async () => {
2188
- let t = new b();
2188
+ let t = new y();
2189
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({
2190
2190
  paths: ["."],
2191
2191
  isSdkInternal: !1,
2192
2192
  updateDepsOnly: !0,
2193
- templatesRoot: g.join(e, "src", "structure", "templates"),
2193
+ templatesRoot: h.join(e, "src", "structure", "templates"),
2194
2194
  logger: t
2195
2195
  });
2196
2196
  }), t;
2197
2197
  }
2198
2198
  // src/cmd/list-overview-snapshots.ts
2199
2199
  function Wi() {
2200
- let e = new m("list-overview-snapshots").description("List all available global overview snapshots in the registry");
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) => {
2202
- let t = new b(), n = l(e.registry), r = await new p(n, t).listGlobalOverviewSnapshots();
2200
+ let e = new p("list-overview-snapshots").description("List all available global overview snapshots in the registry");
2201
+ return e.addOption(new m("-r, --registry <address>", "full address of the registry").env("PL_REGISTRY").makeOptionMandatory()), e.option("--json", "output in JSON format", !1), e.action(async (e) => {
2202
+ let t = new y(), n = te(e.registry), r = await new s(n, t).listGlobalOverviewSnapshots();
2203
2203
  if (e.json) t.info(JSON.stringify(r, null, 2));
2204
2204
  else if (r.length === 0) t.info("No snapshots found.");
2205
2205
  else {
@@ -2210,9 +2210,9 @@ function Wi() {
2210
2210
  }
2211
2211
  // src/cmd/restore-overview-from-snapshot.ts
2212
2212
  function Gi() {
2213
- let e = new m("restore-overview-from-snapshot").description("Restore global overview from a snapshot");
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) => {
2215
- let t = new b(), n = l(e.registry), r = new p(n, t), i = await r.listGlobalOverviewSnapshots();
2213
+ let e = new p("restore-overview-from-snapshot").description("Restore global overview from a snapshot");
2214
+ return e.addOption(new m("-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) => {
2215
+ let t = new y(), n = te(e.registry), r = new s(n, t), i = await r.listGlobalOverviewSnapshots();
2216
2216
  if (!i.find((t) => t.timestamp === e.snapshot)) throw Error(`Snapshot '${e.snapshot}' not found. Available snapshots:\n${i.map((e) => ` - ${e.timestamp}`).join("\n") || " (none)"}`);
2217
2217
  if (!e.skipConfirmation) {
2218
2218
  let n = (await import("node:readline")).createInterface({
@@ -2245,11 +2245,11 @@ function Ki(e) {
2245
2245
  }
2246
2246
  return {
2247
2247
  src: e,
2248
- destName: g.basename(e)
2248
+ destName: h.basename(e)
2249
2249
  };
2250
2250
  }
2251
2251
  function qi(e, t) {
2252
- return new h(e, t).argParser((e, t) => [...t ?? [], Ki(e)]).default([]);
2252
+ return new m(e, t).argParser((e, t) => [...t ?? [], Ki(e)]).default([]);
2253
2253
  }
2254
2254
  // src/cmd/upload-package-v1.ts
2255
2255
  var Ji = [
@@ -2259,18 +2259,18 @@ var Ji = [
2259
2259
  "version"
2260
2260
  ];
2261
2261
  function Yi() {
2262
- let e = new m("upload-package-v1").description("Uploads V1 package and refreshes the registry");
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) => {
2264
- let t = new b(), n = f.parse({});
2262
+ let e = new p("upload-package-v1").description("Uploads V1 package and refreshes the registry");
2263
+ return e.addOption(new m("-r, --registry <address|alias>", "full address of the registry or alias from .pl.reg").env("PL_REGISTRY")), e.addOption(new m("-o, --organization <organization>", "target organisation").env("PL_PACKAGE_ORGANIZATION")), e.addOption(new m("-p, --package <package>", "target package").env("PL_PACKAGE_NAME")), e.addOption(new m("-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 m("--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) => {
2264
+ let t = new y(), n = ee.parse({});
2265
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" }))));
2266
+ e.meta && (e.meta.endsWith(".json") ? n.meta = JSON.parse(await g.promises.readFile(e.meta, { encoding: "utf-8" })) : e.meta.endsWith(".yaml") && (n.meta = pe.parse(await g.promises.readFile(e.meta, { encoding: "utf-8" }))));
2267
2267
  for (let t of e.file) n.files[t.destName] = t.src;
2268
- let r = await d(n);
2269
- t.info(fe.stringify(r.conf));
2268
+ let r = await f(n);
2269
+ t.info(pe.stringify(r.conf));
2270
2270
  let i = r.createRegistry(t), a = r.fullPackageName, o = i.constructNewPackage(a);
2271
2271
  for (let [e, n] of Object.entries(r.conf.files)) {
2272
2272
  t.info(`Uploading ${n} -> ${e} ...`);
2273
- let r = await _.promises.readFile(n);
2273
+ let r = await g.promises.readFile(n);
2274
2274
  await o.addFile(e, r);
2275
2275
  }
2276
2276
  t.info("Uploading meta information..."), await o.writeMeta(r.conf.meta), await o.finish(), e.refresh && await i.updateIfNeeded();
@@ -2278,9 +2278,9 @@ function Yi() {
2278
2278
  }
2279
2279
  // src/cmd/structure/check.ts
2280
2280
  function Xi(e) {
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.");
2281
+ let t = new p("check").description("Check block(s) against the canonical structure (read-only). Exits non-zero if any diff would land — used as the CI gate.");
2282
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) => {
2283
- let r = new b(), i = t.length > 0 ? zi(t) : ["."], a = g.join(e, "src", "structure", "templates"), o = !1;
2283
+ let r = new y(), i = t.length > 0 ? zi(t) : ["."], a = h.join(e, "src", "structure", "templates"), o = !1;
2284
2284
  for (let e of i) {
2285
2285
  let t = await Ri({
2286
2286
  blockPath: e,
@@ -2307,17 +2307,17 @@ async function $i(e, t, n, r) {
2307
2307
  return r();
2308
2308
  }
2309
2309
  async function ea(e) {
2310
- let t = await $i(e.npmOrg, "npm-org", e.nonInteractive, () => xe({
2310
+ let t = await $i(e.npmOrg, "npm-org", e.nonInteractive, () => Se({
2311
2311
  message: "npm org (e.g. @platforma-open):",
2312
2312
  default: "@platforma-open"
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({
2313
+ })), n = await $i(e.orgScope, "org-scope", e.nonInteractive, () => Se({ message: "org scope (e.g. my-org):" })), r = await $i(e.shortName, "short-name", e.nonInteractive, () => Se({ message: "block short name (e.g. mixcr-clonotyping):" })), i;
2314
+ i = e.withSoftware === void 0 ? !e.nonInteractive && await xe({
2315
2315
  message: "Include a software module?",
2316
2316
  default: !1
2317
2317
  }) : e.withSoftware;
2318
2318
  let a;
2319
2319
  if (i) {
2320
- if (a = await $i(e.platform, "platform", e.nonInteractive, () => Se({
2320
+ if (a = await $i(e.platform, "platform", e.nonInteractive, () => Ce({
2321
2321
  message: "Software platform:",
2322
2322
  choices: Zi.map((e) => ({
2323
2323
  name: e,
@@ -2335,7 +2335,7 @@ async function ea(e) {
2335
2335
  };
2336
2336
  }
2337
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({
2338
+ let t = e.vars, n = Ln(t), r = new Ie(e.blockPath), i = new Le(e.templatesRoot), a = Rn({
2339
2339
  blockVars: t,
2340
2340
  modules: n,
2341
2341
  isSdkInternal: !1,
@@ -2356,9 +2356,9 @@ async function ta(e) {
2356
2356
  }
2357
2357
  // src/cmd/structure/init.ts
2358
2358
  function na(e) {
2359
- let t = new m("init").description("Scaffold a fresh Platforma block from the canonical structure. Missing flags are prompted unless --non-interactive.");
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) => {
2361
- let r = new b(), i = n.withSoftware === !0, a = n.software === !1;
2359
+ let t = new p("init").description("Scaffold a fresh Platforma block from the canonical structure. Missing flags are prompted unless --non-interactive.");
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 m("--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) => {
2361
+ let r = new y(), i = n.withSoftware === !0, a = n.software === !1;
2362
2362
  if (i && a) throw Error("--with-software and --no-software are mutually exclusive.");
2363
2363
  let o = i ? !0 : !a && void 0, s = await ea({
2364
2364
  npmOrg: n.npmOrg,
@@ -2370,8 +2370,8 @@ function na(e) {
2370
2370
  });
2371
2371
  await ta({
2372
2372
  vars: s,
2373
- blockPath: t ? g.resolve(t) : g.resolve(process.cwd(), s.shortName),
2374
- templatesRoot: g.join(e, "src", "structure", "templates"),
2373
+ blockPath: t ? h.resolve(t) : h.resolve(process.cwd(), s.shortName),
2374
+ templatesRoot: h.join(e, "src", "structure", "templates"),
2375
2375
  log: (e) => r.info(e)
2376
2376
  });
2377
2377
  }), t;
@@ -2385,7 +2385,7 @@ var ra = ["dev", "release"], ia = [
2385
2385
  ], aa = ["local", "remote"];
2386
2386
  function oa(e) {
2387
2387
  if (e.usePublished) {
2388
- if (e.variant === "docker" || e.variant === "all") throw y.CLIError(`--use-published is binary-only and cannot be combined with --variant ${e.variant}`);
2388
+ if (e.variant === "docker" || e.variant === "all") throw v.CLIError(`--use-published is binary-only and cannot be combined with --variant ${e.variant}`);
2389
2389
  return { kind: "binary-existing" };
2390
2390
  }
2391
2391
  return e.variant === "none" ? { kind: "no-software" } : e.location === void 0 ? { kind: "bare" } : {
@@ -2399,30 +2399,30 @@ function oa(e) {
2399
2399
  var sa = "public.ecr.aws", ca = "us-east-1";
2400
2400
  function la(e) {
2401
2401
  if (process.env.AWS_ACCESS_KEY_ID || process.env.AWS_PROFILE) return;
2402
- let t = process.env.PL_AWS_PROFILE ?? de.AWS_DEV_PROFILE;
2402
+ let t = process.env.PL_AWS_PROFILE ?? fe.AWS_DEV_PROFILE;
2403
2403
  process.env.AWS_PROFILE = t, e?.debug(`Using AWS profile '${t}' for dev push credentials`);
2404
2404
  }
2405
2405
  function ua(e) {
2406
2406
  return new URL(`https://${e}`).hostname;
2407
2407
  }
2408
2408
  function da() {
2409
- return ` aws sso login --profile ${process.env.AWS_PROFILE ?? process.env.PL_AWS_PROFILE ?? de.AWS_DEV_PROFILE}`;
2409
+ return ` aws sso login --profile ${process.env.AWS_PROFILE ?? process.env.PL_AWS_PROFILE ?? fe.AWS_DEV_PROFILE}`;
2410
2410
  }
2411
2411
  async function fa(e, t) {
2412
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.`);
2413
+ if (n !== sa) throw v.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.`);
2414
2414
  t?.info(`Logging in to ECR registry '${n}'...`);
2415
2415
  let r, i;
2416
2416
  try {
2417
- let e = (await new we({ region: ca }).send(new Te({}))).authorizationData?.authorizationToken;
2417
+ let e = (await new Te({ region: ca }).send(new Ee({}))).authorizationData?.authorizationToken;
2418
2418
  if (!e) throw Error("empty authorization token");
2419
2419
  let t = Buffer.from(e, "base64").toString("utf8"), n = t.indexOf(":");
2420
2420
  if (n < 0) throw Error("malformed authorization token (no ':' separator)");
2421
2421
  r = t.slice(0, n), i = t.slice(n + 1);
2422
2422
  } catch (e) {
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());
2423
+ throw v.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());
2424
2424
  }
2425
- let a = Ce("docker", [
2425
+ let a = we("docker", [
2426
2426
  "login",
2427
2427
  "--username",
2428
2428
  r,
@@ -2437,10 +2437,10 @@ async function fa(e, t) {
2437
2437
  ],
2438
2438
  env: {
2439
2439
  ...process.env,
2440
- HOME: process.env.HOME || ye.homedir()
2440
+ HOME: process.env.HOME || be.homedir()
2441
2441
  }
2442
2442
  });
2443
- if (a.error || a.status !== 0) throw y.CLIError(`'docker login ${n}' failed`);
2443
+ if (a.error || a.status !== 0) throw v.CLIError(`'docker login ${n}' failed`);
2444
2444
  }
2445
2445
  // src/cmd/software/run-build.ts
2446
2446
  async function pa(e) {
@@ -2462,11 +2462,11 @@ async function pa(e) {
2462
2462
  r.buildDocker && t.buildDockerImages({
2463
2463
  ids: a,
2464
2464
  registry: r.dockerRegistry,
2465
- strictPlatformMatching: v.isCI()
2465
+ strictPlatformMatching: _.isCI()
2466
2466
  }), await o(), r.pushDocker && t.publishDockerImages({
2467
2467
  ids: a,
2468
2468
  pushTo: r.dockerPushTo,
2469
- strictPlatformMatching: v.isCI()
2469
+ strictPlatformMatching: _.isCI()
2470
2470
  });
2471
2471
  break;
2472
2472
  case "target": {
@@ -2474,18 +2474,18 @@ async function pa(e) {
2474
2474
  l && t.buildDockerImages({
2475
2475
  ids: a,
2476
2476
  registry: f.pull,
2477
- strictPlatformMatching: v.isCI()
2477
+ strictPlatformMatching: _.isCI()
2478
2478
  }), u && await o(), d && e === "dev" && (l || u) && la(i), l && d && (f.autoLogin && f.push && await fa(f.push, i), t.publishDockerImages({
2479
2479
  ids: a,
2480
2480
  pushTo: f.push,
2481
- strictPlatformMatching: v.isCI()
2481
+ strictPlatformMatching: _.isCI()
2482
2482
  })), u && d && await t.publishPackages({
2483
2483
  ids: a,
2484
2484
  storageURL: r.storageUrl
2485
2485
  });
2486
2486
  break;
2487
2487
  }
2488
- default: y.assertNever(n);
2488
+ default: v.assertNever(n);
2489
2489
  }
2490
2490
  t.buildSwJsonFiles({
2491
2491
  packageIds: a,
@@ -2511,10 +2511,10 @@ function _a(e) {
2511
2511
  };
2512
2512
  }
2513
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) : {
2514
+ let n = e === "dev", r = process.env[n ? _.PL_DEV_DOCKER_PUSH_URL : _.PL_RELEASE_DOCKER_PUSH_URL], i = process.env[n ? _.PL_DEV_DOCKER_PULL_URL : _.PL_RELEASE_DOCKER_PULL_URL], a = t.dockerPushTo ?? r ?? (n ? fe.DEV_DOCKER_PUSH_TARGET : void 0), o = a ? _a(a) : {
2515
2515
  registry: void 0,
2516
2516
  autoLogin: !1
2517
- }, s = t.dockerRegistry ?? i ?? (n ? a : de.DOCKER_REGISTRY);
2517
+ }, s = t.dockerRegistry ?? i ?? (n ? a : fe.DOCKER_REGISTRY);
2518
2518
  return {
2519
2519
  pull: s ? ga(s) : void 0,
2520
2520
  push: o.registry,
@@ -2523,35 +2523,35 @@ function va(e, t) {
2523
2523
  }
2524
2524
  // src/cmd/software/env.ts
2525
2525
  var ya = "PL_BUILD_CHANNEL", ba = "PL_BUILD_VARIANT", xa = "PL_BUILD_LOCATION", Sa = "PL_BUILD_USE_PUBLISHED";
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;
2526
+ _.PL_DOCKER_REGISTRY_PUSH_TO, _.PL_DEV_DOCKER_PUSH_URL, _.PL_DEV_DOCKER_PULL_URL, _.PL_DEV_BINARY_UPLOAD_URL, _.PL_RELEASE_DOCKER_PUSH_URL, _.PL_RELEASE_DOCKER_PULL_URL, _.PL_RELEASE_BINARY_UPLOAD_URL;
2527
2527
  // src/cmd/software/build.ts
2528
2528
  function Ca() {
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)");
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([
2529
+ let e = new p("build").description("Build a software module for a target and write its .sw.json descriptor (build + push in one pass)");
2530
+ return e.addOption(new m("--channel <channel>", "registry channel to build for").choices([...ra]).env(ya)), e.addOption(new m("--variant <variant>", "artifact kind to build (default: all declared)").choices([...ia]).env(ba)), e.addOption(new m("--location <location>", "where the artifact lands (local = no push)").choices([...aa]).env(xa)), e.addOption(new m("--use-published", "do not build or push; emit a descriptor pointing at the already-published release artifact").env(Sa)), e.addOption(new m("--log-level <level>", "logging level").choices([
2531
2531
  "error",
2532
2532
  "warn",
2533
2533
  "info",
2534
2534
  "debug"
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) => {
2536
- let t = y.createLogger(e.logLevel);
2535
+ ]).default("info")), e.addOption(new m("--package-root <path>", "path to directory with package.json file")), e.addOption(new m("--force", "force action, ignoring automatic safety checks").default(!1)), e.addOption(new m("--version <value>", "override package version (ignore package.json)")), e.addOption(new m("--platform <os-arch>", "{os}-{arch} pair; no effect on cross-platform packages").choices([...v.AllPlatforms]).env(_.PL_PKG_OS)), e.addOption(new m("--all-platforms", "build for all supported platforms").default(!1)), e.addOption(new m("--full-dir-hash", "hash file contents (not metadata) for the dev content hash").env(_.PL_PKG_FULL_HASH).default(!1)), e.addOption(new m("--package-id <id...>", "act only on selected packages")), e.addOption(new m("--content-root <path>", "override software content root").env(_.PL_PKG_CONTENT_ROOT)), e.addOption(new m("--storage-url <url>", "override binary upload registry URL").env(_.PL_PKG_STORAGE_URL)), e.addOption(new m("--docker-registry <registry>", "docker pull registry embedded in the descriptor").env(_.PL_DOCKER_REGISTRY)), e.addOption(new m("--docker-push-to <registry>", "alternative registry for docker push").env(_.PL_DOCKER_REGISTRY_PUSH_TO)), e.addOption(new m("--docker-build", "build docker images").env(_.PL_DOCKER_BUILD).default(!1)), e.addOption(new m("--docker-no-build", "do not build docker images").env(_.PL_DOCKER_NO_BUILD).default(!1)), e.addOption(new m("--docker-autopush", "push docker images after build").env(_.PL_DOCKER_AUTOPUSH).default(!1)), e.addOption(new m("--docker-no-autopush", "do not push docker images").env(_.PL_DOCKER_NO_AUTOPUSH).default(!1)), e.addOption(new m("--conda-build", "build conda environment before packing").env(_.PL_CONDA_BUILD).default(!1)), e.addOption(new m("--conda-no-build", "do not build conda environment").env(_.PL_CONDA_NO_BUILD).default(!1)), e.action(async (e) => {
2536
+ let t = v.createLogger(e.logLevel);
2537
2537
  try {
2538
2538
  let n = oa({
2539
2539
  channel: e.channel,
2540
2540
  variant: e.variant,
2541
2541
  location: e.location,
2542
2542
  usePublished: !!e.usePublished
2543
- }), r = ue(t, { packageRoot: e.packageRoot });
2543
+ }), r = de(t, { packageRoot: e.packageRoot });
2544
2544
  r.version = e.version, r.targetPlatform = e.platform, r.allPlatforms = !!e.allPlatforms, r.fullDirHash = !!e.fullDirHash;
2545
- let i = y.shouldDoAction({
2546
- default: v.isCI(),
2545
+ let i = v.shouldDoAction({
2546
+ default: _.isCI(),
2547
2547
  enable: e.dockerBuild,
2548
2548
  disable: e.dockerNoBuild
2549
- }), a = i && y.shouldDoAction({
2550
- default: v.isCI() && !r.isPrivate,
2549
+ }), a = i && v.shouldDoAction({
2550
+ default: _.isCI() && !r.isPrivate,
2551
2551
  enable: e.dockerAutopush,
2552
2552
  disable: e.dockerNoAutopush
2553
2553
  });
2554
- n.kind === "bare" && le({
2554
+ n.kind === "bare" && ue({
2555
2555
  buildDocker: i,
2556
2556
  pushDocker: a,
2557
2557
  pushDisabledExplicitly: !!e.dockerNoAutopush,
@@ -2569,7 +2569,7 @@ function Ca() {
2569
2569
  dockerPushTo: e.dockerPushTo,
2570
2570
  buildDocker: i,
2571
2571
  pushDocker: a,
2572
- condaBuild: y.shouldDoAction({
2572
+ condaBuild: v.shouldDoAction({
2573
2573
  default: !0,
2574
2574
  enable: e.condaBuild,
2575
2575
  disable: e.condaNoBuild
@@ -2583,14 +2583,14 @@ function Ca() {
2583
2583
  }
2584
2584
  // src/cmd/software/index.ts
2585
2585
  function wa() {
2586
- let e = new m("software").description("Build and publish a block's software modules");
2586
+ let e = new p("software").description("Build and publish a block's software modules");
2587
2587
  return e.addCommand(Ca()), e;
2588
2588
  }
2589
2589
  // src/cli.ts
2590
2590
  function Ta(e = process.cwd()) {
2591
- let t = new m();
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());
2593
- let n = new m("structure").description("Manage block scaffolding against the canonical structure (check / init / refresh)");
2591
+ let t = new p();
2592
+ t.name("block-tools").description("Utility to manipulate Platforma Blocks and Block Registry"), t.addCommand(De()), t.addCommand(ke()), t.addCommand(Ae()), t.addCommand(je()), t.addCommand(Ne()), t.addCommand(Pe()), t.addCommand(Fe()), t.addCommand(Ui(e)), t.addCommand(Wi()), t.addCommand(Gi()), t.addCommand(Yi()), t.addCommand(wa());
2593
+ let n = new p("structure").description("Manage block scaffolding against the canonical structure (check / init / refresh)");
2594
2594
  return n.addCommand(Xi(e)), n.addCommand(na(e)), n.addCommand(Hi(e)), t.addCommand(n), t;
2595
2595
  }
2596
2596
  async function Ea(e, t) {