@m8t-stack/cli 0.2.17 → 0.2.18
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 +45 -33
- package/dist/cli.js.map +1 -1
- package/package.json +1 -1
package/dist/cli.js
CHANGED
|
@@ -1227,7 +1227,7 @@ var init_enable_hosted_brain = __esm({
|
|
|
1227
1227
|
import { Builtins, Cli } from "clipanion";
|
|
1228
1228
|
|
|
1229
1229
|
// src/lib/package-version.ts
|
|
1230
|
-
var CLI_VERSION = "0.2.
|
|
1230
|
+
var CLI_VERSION = "0.2.18";
|
|
1231
1231
|
|
|
1232
1232
|
// src/lib/render-error.ts
|
|
1233
1233
|
init_errors();
|
|
@@ -17480,7 +17480,7 @@ async function fetchPublicTags(repo, fetchImpl = fetch) {
|
|
|
17480
17480
|
// src/lib/release-channel.ts
|
|
17481
17481
|
import * as fs18 from "fs";
|
|
17482
17482
|
|
|
17483
|
-
//
|
|
17483
|
+
// ../../packages/platform-release/dist/esm/manifest.js
|
|
17484
17484
|
var SEVERITIES = ["critical", "recommended", "optional"];
|
|
17485
17485
|
var IMAGE_KEYS = ["gateway", "codingAgent", "azureExecutor", "installer"];
|
|
17486
17486
|
function isObj2(v) {
|
|
@@ -17488,16 +17488,20 @@ function isObj2(v) {
|
|
|
17488
17488
|
}
|
|
17489
17489
|
function validateManifest(m) {
|
|
17490
17490
|
const errors = [];
|
|
17491
|
-
if (!isObj2(m))
|
|
17492
|
-
|
|
17491
|
+
if (!isObj2(m))
|
|
17492
|
+
return ["manifest is not an object"];
|
|
17493
|
+
if (m.schemaVersion !== 1)
|
|
17494
|
+
errors.push("schemaVersion must be the integer 1");
|
|
17493
17495
|
const p = m.platform;
|
|
17494
17496
|
if (!isObj2(p)) {
|
|
17495
17497
|
errors.push("platform is required");
|
|
17496
17498
|
} else {
|
|
17497
17499
|
for (const f of ["version", "tag", "releasedAt", "commit", "notes", "notesUrl"]) {
|
|
17498
|
-
if (typeof p[f] !== "string" || p[f].length === 0)
|
|
17500
|
+
if (typeof p[f] !== "string" || p[f].length === 0)
|
|
17501
|
+
errors.push(`platform.${f} is required`);
|
|
17499
17502
|
}
|
|
17500
|
-
if (!SEVERITIES.includes(p.severity))
|
|
17503
|
+
if (!SEVERITIES.includes(p.severity))
|
|
17504
|
+
errors.push(`platform.severity must be one of ${SEVERITIES.join("|")}`);
|
|
17501
17505
|
if (!(typeof p.previousVersion === "string" || p.previousVersion === null)) {
|
|
17502
17506
|
errors.push("platform.previousVersion must be a string or null");
|
|
17503
17507
|
}
|
|
@@ -17513,9 +17517,11 @@ function validateManifest(m) {
|
|
|
17513
17517
|
errors.push(`components.${key2} is required`);
|
|
17514
17518
|
continue;
|
|
17515
17519
|
}
|
|
17516
|
-
if (img.kind !== "image")
|
|
17520
|
+
if (img.kind !== "image")
|
|
17521
|
+
errors.push(`components.${key2}.kind must be "image"`);
|
|
17517
17522
|
for (const f of ["ref", "tag", "version"]) {
|
|
17518
|
-
if (typeof img[f] !== "string" || img[f].length === 0)
|
|
17523
|
+
if (typeof img[f] !== "string" || img[f].length === 0)
|
|
17524
|
+
errors.push(`components.${key2}.${f} is required`);
|
|
17519
17525
|
}
|
|
17520
17526
|
if (typeof img.digest !== "string" || !/^sha256:[0-9a-f]+$/.test(img.digest)) {
|
|
17521
17527
|
errors.push(`components.${key2}.digest must be a sha256:\u2026 digest`);
|
|
@@ -17526,7 +17532,8 @@ function validateManifest(m) {
|
|
|
17526
17532
|
errors.push("components.cli (kind: npm) is required");
|
|
17527
17533
|
} else {
|
|
17528
17534
|
for (const f of ["package", "version", "min", "recommended"]) {
|
|
17529
|
-
if (typeof cli2[f] !== "string" || cli2[f].length === 0)
|
|
17535
|
+
if (typeof cli2[f] !== "string" || cli2[f].length === 0)
|
|
17536
|
+
errors.push(`components.cli.${f} is required`);
|
|
17530
17537
|
}
|
|
17531
17538
|
}
|
|
17532
17539
|
const personas = c.personas;
|
|
@@ -17567,12 +17574,39 @@ function validateManifest(m) {
|
|
|
17567
17574
|
return errors;
|
|
17568
17575
|
}
|
|
17569
17576
|
|
|
17570
|
-
//
|
|
17571
|
-
|
|
17577
|
+
// ../../packages/platform-release/dist/esm/stamp.js
|
|
17578
|
+
var TABLE = "Metadata";
|
|
17579
|
+
var PK = "system";
|
|
17580
|
+
var RK = "platform";
|
|
17581
|
+
function stampToEntity(s) {
|
|
17582
|
+
return {
|
|
17583
|
+
partitionKey: PK,
|
|
17584
|
+
rowKey: RK,
|
|
17585
|
+
platformVersion: s.platformVersion,
|
|
17586
|
+
updatedAt: s.updatedAt,
|
|
17587
|
+
lastResult: s.lastResult,
|
|
17588
|
+
value: JSON.stringify(s)
|
|
17589
|
+
};
|
|
17590
|
+
}
|
|
17591
|
+
function entityToStamp(e) {
|
|
17592
|
+
const raw = e.value;
|
|
17593
|
+
if (typeof raw !== "string")
|
|
17594
|
+
return null;
|
|
17595
|
+
try {
|
|
17596
|
+
return JSON.parse(raw);
|
|
17597
|
+
} catch {
|
|
17598
|
+
return null;
|
|
17599
|
+
}
|
|
17600
|
+
}
|
|
17601
|
+
|
|
17602
|
+
// ../../packages/platform-release/dist/esm/channel-url.js
|
|
17572
17603
|
var CHANNEL_LATEST_URL = "https://github.com/m8t-run/m8t/releases/latest/download/manifest.json";
|
|
17573
17604
|
function channelUrlForVersion(tag) {
|
|
17574
17605
|
return `https://github.com/m8t-run/m8t/releases/download/${tag}/manifest.json`;
|
|
17575
17606
|
}
|
|
17607
|
+
|
|
17608
|
+
// src/lib/release-channel.ts
|
|
17609
|
+
init_errors();
|
|
17576
17610
|
async function fetchManifest(source, deps = {}) {
|
|
17577
17611
|
const readFile8 = deps.readFile ?? ((p) => fs18.readFileSync(p, "utf8"));
|
|
17578
17612
|
const fetchImpl = deps.fetchImpl ?? fetch;
|
|
@@ -17744,28 +17778,6 @@ async function discoverStampStorage(opts) {
|
|
|
17744
17778
|
}
|
|
17745
17779
|
|
|
17746
17780
|
// src/lib/platform-stamp.ts
|
|
17747
|
-
var TABLE = "Metadata";
|
|
17748
|
-
var PK = "system";
|
|
17749
|
-
var RK = "platform";
|
|
17750
|
-
function stampToEntity(s) {
|
|
17751
|
-
return {
|
|
17752
|
-
partitionKey: PK,
|
|
17753
|
-
rowKey: RK,
|
|
17754
|
-
platformVersion: s.platformVersion,
|
|
17755
|
-
updatedAt: s.updatedAt,
|
|
17756
|
-
lastResult: s.lastResult,
|
|
17757
|
-
value: JSON.stringify(s)
|
|
17758
|
-
};
|
|
17759
|
-
}
|
|
17760
|
-
function entityToStamp(e) {
|
|
17761
|
-
const raw = e.value;
|
|
17762
|
-
if (typeof raw !== "string") return null;
|
|
17763
|
-
try {
|
|
17764
|
-
return JSON.parse(raw);
|
|
17765
|
-
} catch {
|
|
17766
|
-
return null;
|
|
17767
|
-
}
|
|
17768
|
-
}
|
|
17769
17781
|
async function makeSharedKeyClient(opts) {
|
|
17770
17782
|
const rg = /\/resourceGroups\/([^/]+)\//i.exec(opts.accountResourceId)?.[1];
|
|
17771
17783
|
if (!rg) return null;
|