@devrouter/cli 0.3.1 → 0.5.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/devrouter-lifecycle-worker.js +15 -6
- package/dist/devrouter.js +2511 -1459
- package/package.json +2 -1
- package/upgrade-prompts/0.4.0.md +39 -0
- package/upgrade-prompts/0.5.0.md +43 -0
|
@@ -5373,7 +5373,7 @@ function retain(session, previous) {
|
|
|
5373
5373
|
|
|
5374
5374
|
// src/core/reliability-operation-store.ts
|
|
5375
5375
|
function installedCliVersion() {
|
|
5376
|
-
return true ? "0.
|
|
5376
|
+
return true ? "0.5.0" : "0.0.0-dev";
|
|
5377
5377
|
}
|
|
5378
5378
|
function compareCliVersions(left, right) {
|
|
5379
5379
|
const parts = (value) => value.split(".").map((part) => Number.parseInt(part, 10) || 0);
|
|
@@ -5422,6 +5422,13 @@ function validateConsumerProtection(record5) {
|
|
|
5422
5422
|
if (protection.version !== 1 || !isReliabilityCounter(protection.revision) || typeof protection.humanPinned !== "boolean")
|
|
5423
5423
|
throw new Error("Invalid consumer protection.");
|
|
5424
5424
|
}
|
|
5425
|
+
function validateIdleProtection(record5) {
|
|
5426
|
+
const protection = record5.idleProtection;
|
|
5427
|
+
if (protection === void 0) return;
|
|
5428
|
+
exactKeys(protection, ["version", "revision", "pinned"], "Invalid idle protection fields.");
|
|
5429
|
+
if (protection.version !== 1 || !isReliabilityCounter(protection.revision) || typeof protection.pinned !== "boolean")
|
|
5430
|
+
throw new Error("Invalid idle protection.");
|
|
5431
|
+
}
|
|
5425
5432
|
function validateCapacityPhaseSettlement(record5, state, enrollment) {
|
|
5426
5433
|
const settlement = record5.phaseSettlement;
|
|
5427
5434
|
if (settlement === void 0 || settlement === null) return;
|
|
@@ -5519,6 +5526,7 @@ function validate2(record5, identity2) {
|
|
|
5519
5526
|
"result",
|
|
5520
5527
|
"writtenByVersion",
|
|
5521
5528
|
"consumerProtection",
|
|
5529
|
+
"idleProtection",
|
|
5522
5530
|
...record5.version === 2 ? [
|
|
5523
5531
|
"capacity",
|
|
5524
5532
|
"enrollment",
|
|
@@ -5529,6 +5537,7 @@ function validate2(record5, identity2) {
|
|
|
5529
5537
|
] : []
|
|
5530
5538
|
]);
|
|
5531
5539
|
validateConsumerProtection(record5);
|
|
5540
|
+
validateIdleProtection(record5);
|
|
5532
5541
|
if (record5.writtenByVersion !== void 0 && compareCliVersions(record5.writtenByVersion, installedCliVersion()) > 0) {
|
|
5533
5542
|
throw new Error(
|
|
5534
5543
|
`Reliability record was last written by devrouter ${record5.writtenByVersion}, which is newer than the installed ${installedCliVersion()}; upgrade devrouter (devrouter upgrade) before running lifecycle commands.`
|
|
@@ -6007,6 +6016,7 @@ function updateReliabilityOperation(identity2, operation) {
|
|
|
6007
6016
|
const previousVersion = record5.version;
|
|
6008
6017
|
const previousEnrollment = record5.enrollment && { ...record5.enrollment };
|
|
6009
6018
|
const previousProtection = structuredClone(record5.consumerProtection);
|
|
6019
|
+
const previousIdleProtection = structuredClone(record5.idleProtection);
|
|
6010
6020
|
const result = operation(record5);
|
|
6011
6021
|
if (result && typeof result.then === "function") {
|
|
6012
6022
|
throw new Error("Reliability record updates must be synchronous.");
|
|
@@ -6015,6 +6025,8 @@ function updateReliabilityOperation(identity2, operation) {
|
|
|
6015
6025
|
throw new Error("Durable capacity enrollment cannot be downgraded or replaced.");
|
|
6016
6026
|
if (!(0, import_node_util4.isDeepStrictEqual)(record5.consumerProtection, previousProtection))
|
|
6017
6027
|
throw new Error("Consumer protection is only writable through the dedicated pin authority.");
|
|
6028
|
+
if (!(0, import_node_util4.isDeepStrictEqual)(record5.idleProtection, previousIdleProtection))
|
|
6029
|
+
throw new Error("Idle protection is only writable through the idle pin authority.");
|
|
6018
6030
|
record5.writtenByVersion = installedCliVersion();
|
|
6019
6031
|
validate2(record5, identity2);
|
|
6020
6032
|
record5.revision += 1;
|
|
@@ -7371,7 +7383,7 @@ function loadRepoConfig(repoPath, read2 = (file) => import_node_fs19.default.rea
|
|
|
7371
7383
|
const config = parseConfig(parsed ?? {}, configPath);
|
|
7372
7384
|
const requiredVersion = config.devrouter?.version;
|
|
7373
7385
|
if (requiredVersion && !hasWarnedVersionMismatch) {
|
|
7374
|
-
const cliVersion = true ? "0.
|
|
7386
|
+
const cliVersion = true ? "0.5.0" : "0.0.0-dev";
|
|
7375
7387
|
if (cliVersion !== "0.0.0-dev" && compareSemver2(requiredVersion, cliVersion) > 0) {
|
|
7376
7388
|
hasWarnedVersionMismatch = true;
|
|
7377
7389
|
process.stderr.write(
|
|
@@ -10360,9 +10372,7 @@ async function startDevsyWorkspace(options) {
|
|
|
10360
10372
|
`DEVROUTER_WORKSPACE=${options.workspace.token}`
|
|
10361
10373
|
);
|
|
10362
10374
|
}
|
|
10363
|
-
|
|
10364
|
-
args.push("--provider-option", `INACTIVITY_TIMEOUT=${options.inactivityTimeout}`);
|
|
10365
|
-
}
|
|
10375
|
+
args.push("--provider-option", "INACTIVITY_TIMEOUT=");
|
|
10366
10376
|
if (options.recreate) args.push("--recreate");
|
|
10367
10377
|
const env = network ? networkProviderEnvironment(network.binding, process.env) : { ...process.env };
|
|
10368
10378
|
if (agent.binaryPath) env.DEVSY_AGENT_BINARY = agent.binaryPath;
|
|
@@ -11425,7 +11435,6 @@ async function startDevpodWorkspace(options) {
|
|
|
11425
11435
|
recreate: options.recreate,
|
|
11426
11436
|
quiet: options.quiet,
|
|
11427
11437
|
workspace: options.workspace,
|
|
11428
|
-
inactivityTimeout: readWorkspaceRuntimeConfig().devsyInactivityTimeout,
|
|
11429
11438
|
prepareNetwork: options.prepareNetwork
|
|
11430
11439
|
});
|
|
11431
11440
|
resetWorkspaceRuntimeCaches();
|