@m8t-stack/cli 0.2.119 → 0.2.120

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.js CHANGED
@@ -1454,7 +1454,7 @@ function installFoundryDnsShim() {
1454
1454
  }
1455
1455
 
1456
1456
  // src/lib/package-version.ts
1457
- var CLI_VERSION = "0.2.119";
1457
+ var CLI_VERSION = "0.2.120";
1458
1458
 
1459
1459
  // src/lib/render-error.ts
1460
1460
  init_errors();
@@ -19538,6 +19538,10 @@ var DEV_TAG = "v0.0.0-dev";
19538
19538
  var PINNED_INSTALLER = fromBuild('{"ref":"ghcr.io/m8t-labs/m8t-installer:v0.1.84","registry":"ghcr.io/m8t-labs","image":"m8t-installer","tag":"v0.1.84"}', "ghcr.io/m8t-labs/m8t-installer");
19539
19539
  var PINNED_CODING_AGENT = fromBuild('{"ref":"ghcr.io/m8t-labs/m8t-coding-agent:v0.1.5","registry":"ghcr.io/m8t-labs","image":"m8t-coding-agent","tag":"v0.1.5"}', "ghcr.io/m8t-labs/m8t-coding-agent");
19540
19540
  var PINNED_AZURE_EXECUTOR = fromBuild('{"ref":"ghcr.io/m8t-labs/m8t-azure-executor:v0.1.5","registry":"ghcr.io/m8t-labs","image":"m8t-azure-executor","tag":"v0.1.5"}', "ghcr.io/m8t-labs/m8t-azure-executor");
19541
+ var PINNED_PLATFORM_VERSION = (() => {
19542
+ const raw = "0.7.7";
19543
+ return /^\d+\.\d+\.\d+$/.test(raw) ? raw : "";
19544
+ })();
19541
19545
 
19542
19546
  // src/commands/coder/deploy.ts
19543
19547
  var SIZE_PRESETS = {
@@ -24531,6 +24535,9 @@ init_errors();
24531
24535
  // src/lib/platform-stamp-seed.ts
24532
24536
  var IMAGE_COMPONENTS = ["gateway", "codingAgent", "azureExecutor"];
24533
24537
  var BARE_SEMVER = /^\d+\.\d+\.\d+$/;
24538
+ function isBarePlatformVersion(v) {
24539
+ return typeof v === "string" && BARE_SEMVER.test(v);
24540
+ }
24534
24541
  function isObj3(v) {
24535
24542
  return typeof v === "object" && v !== null && !Array.isArray(v);
24536
24543
  }
@@ -24578,7 +24585,10 @@ function validateDescriptor(raw) {
24578
24585
  }
24579
24586
  return errors;
24580
24587
  }
24581
- function buildSeedStamp(d, cliVersion, nowIso) {
24588
+ function buildSeedStamp(d, cliVersion, nowIso, platformVersionOverride) {
24589
+ if (platformVersionOverride !== void 0 && !isBarePlatformVersion(platformVersionOverride)) {
24590
+ throw new Error(`platformVersionOverride must be a bare X.Y.Z release version, got ${JSON.stringify(platformVersionOverride)}`);
24591
+ }
24582
24592
  const img = (k) => ({
24583
24593
  tag: d.images[k].tag,
24584
24594
  digest: d.images[k].digest,
@@ -24590,7 +24600,7 @@ function buildSeedStamp(d, cliVersion, nowIso) {
24590
24600
  }
24591
24601
  const stamp = {
24592
24602
  schemaVersion: 1,
24593
- platformVersion: platformTag(d.platformVersion),
24603
+ platformVersion: platformTag(platformVersionOverride ?? d.platformVersion),
24594
24604
  previousPlatformVersion: null,
24595
24605
  updatedAt: nowIso,
24596
24606
  lastResult: "success",
@@ -24610,6 +24620,13 @@ function buildSeedStamp(d, cliVersion, nowIso) {
24610
24620
 
24611
24621
  // src/commands/platform/seed-stamp.ts
24612
24622
  async function seedStamp2(args) {
24623
+ if (args.platformVersion !== void 0 && !isBarePlatformVersion(args.platformVersion)) {
24624
+ throw new LocalCliError({
24625
+ code: "PLATFORM_SEED_VERSION_INVALID",
24626
+ message: `--platform-version must be a bare X.Y.Z release version, got ${JSON.stringify(args.platformVersion)}.`,
24627
+ hint: "Pass the platform release this install is deploying, e.g. --platform-version 0.7.8. Omit the flag to stamp the version baked into the installer image."
24628
+ });
24629
+ }
24613
24630
  const readFileImpl = args.readFileImpl ?? ((p) => readFileSync20(p, "utf8"));
24614
24631
  const readStampImpl = args.readStampImpl ?? readStamp;
24615
24632
  const writeStampImpl = args.writeStampImpl ?? ((stamp2, o) => writeStamp({ ...o, stamp: stamp2 }));
@@ -24641,7 +24658,7 @@ async function seedStamp2(args) {
24641
24658
  args.onProgress?.(`platform stamp already present (${existing.platformVersion}) \u2014 leaving it untouched.`);
24642
24659
  return { outcome: "already-stamped", platformVersion: existing.platformVersion, storageAccount: accountName };
24643
24660
  }
24644
- const stamp = buildSeedStamp(descriptor, CLI_VERSION, args.nowIso ?? (/* @__PURE__ */ new Date()).toISOString());
24661
+ const stamp = buildSeedStamp(descriptor, CLI_VERSION, args.nowIso ?? (/* @__PURE__ */ new Date()).toISOString(), args.platformVersion);
24645
24662
  await writeStampImpl(stamp, { ...ctx, onProgress: args.onProgress });
24646
24663
  return {
24647
24664
  outcome: descriptor.content ? "seeded" : "seeded-partial",
@@ -24661,6 +24678,7 @@ var PlatformSeedStampCommand = class extends M8tCommand {
24661
24678
  details: "Used by the cloud installer at the end of a from-zero install so the platform records which release it is running. Writes the stamp ONLY IF ABSENT \u2014 it never overwrites a stamp written by the converge engine, so a re-run or a container restart is harmless. Not a founder-facing command: to change what is installed, use 'm8t platform update'."
24662
24679
  });
24663
24680
  descriptor = Option36.String("--descriptor", { description: "Path to install-descriptor.json (baked into the installer image)." });
24681
+ platformVersion = Option36.String("--platform-version", { description: "Bare X.Y.Z release this install is deploying. Overrides the descriptor's baked version, which lags by one declaration under publish->select. Omit to use the baked value." });
24664
24682
  subscription = Option36.String("--subscription");
24665
24683
  resourceGroup = Option36.String("--resource-group");
24666
24684
  miClientId = Option36.String("--mi-client-id", { description: "Authenticate as this user-assigned managed identity instead of the ambient credential." });
@@ -24680,6 +24698,12 @@ var PlatformSeedStampCommand = class extends M8tCommand {
24680
24698
  const credential2 = typeof this.miClientId === "string" && this.miClientId.trim().length > 0 ? new ManagedIdentityCredential4({ clientId: this.miClientId.trim() }) : new DefaultAzureCredential20();
24681
24699
  const result2 = await seedStamp2({
24682
24700
  descriptorPath: need(this.descriptor, "--descriptor"),
24701
+ // Absent flag ⇒ undefined ⇒ the descriptor's baked value. A flag PASSED but
24702
+ // empty is not the same thing and is refused below, deliberately: the
24703
+ // installer omits the flag entirely when it has nothing to say
24704
+ // (installer/lib.sh), so an empty one means a launcher computed a version and
24705
+ // got nothing — which should be loud, not silently absorbed by the fallback.
24706
+ platformVersion: typeof this.platformVersion === "string" ? this.platformVersion.trim() : void 0,
24683
24707
  credential: credential2,
24684
24708
  subscriptionId: need(this.subscription, "--subscription"),
24685
24709
  resourceGroup: need(this.resourceGroup, "--resource-group"),
@@ -32564,6 +32588,7 @@ function buildAciCreateArgs(s) {
32564
32588
  // pin, which can name an installer several versions behind the running one.
32565
32589
  `INSTALLER_IMAGE_REF=${s.image}`
32566
32590
  ];
32591
+ if (s.platformVersion) env.push(`M8T_PLATFORM_VERSION=${s.platformVersion}`);
32567
32592
  if (s.gatewayImageRef) env.push(`GATEWAY_IMAGE_REF=${s.gatewayImageRef}`);
32568
32593
  if (s.foundryTracing) env.push(`FOUNDRY_TRACING=${s.foundryTracing}`);
32569
32594
  if (s.skipBrains) env.push("SKIP_BRAINS=true");
@@ -32997,6 +33022,7 @@ var BootstrapLaunchCommand = class extends M8tCommand {
32997
33022
  } catch (e) {
32998
33023
  out(`warning: could not determine your Azure object id (${e.message}) \u2014 the install will not grant you data-plane access; run 'm8t prereqs --fix' afterwards`);
32999
33024
  }
33025
+ const platformVersion = installerImage === PINNED_INSTALLER.ref ? PINNED_PLATFORM_VERSION : "";
33000
33026
  out("launching the cloud installer (ACI)\u2026");
33001
33027
  await kickInstaller({
33002
33028
  aciName: ACI_NAME,
@@ -33010,6 +33036,7 @@ var BootstrapLaunchCommand = class extends M8tCommand {
33010
33036
  gatewayImageRef,
33011
33037
  foundryTracing,
33012
33038
  githubApp,
33039
+ ...platformVersion ? { platformVersion } : {},
33013
33040
  ...founderObjectId ? { founderObjectId } : {},
33014
33041
  ...skipBrains ? { skipBrains: true } : {},
33015
33042
  // Opt-in only. The signed-in UPN was previously seeded here automatically;