@agent-link/agent 0.1.312 → 0.1.314

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.
@@ -121,6 +121,10 @@ function validateLatestReference(value) {
121
121
  return value;
122
122
  }
123
123
 
124
+ function isLegacyUpgradeReference(value) {
125
+ return isRecord(value) && value.schemaVersion === 1;
126
+ }
127
+
124
128
  function loadRecoveryLaunchSpec(launchSpecPath, agentHome) {
125
129
  if (typeof launchSpecPath !== 'string' || launchSpecPath.length === 0) {
126
130
  throw new Error('recovery LaunchSpec path is invalid');
@@ -451,7 +455,9 @@ function recoverUpgrade(agentHome) {
451
455
  if (!fs.existsSync(latestPath)) return false;
452
456
  let latest;
453
457
  try {
454
- latest = validateLatestReference(loadJson(latestPath));
458
+ const latestValue = loadJson(latestPath);
459
+ if (isLegacyUpgradeReference(latestValue)) return false;
460
+ latest = validateLatestReference(latestValue);
455
461
  } catch (error) {
456
462
  process.stderr.write(`[AgentLink Launcher] Upgrade state is corrupt; using last-known-good and repair is required: ${error.message}\n`);
457
463
  atomicJson(path.join(agentHome, 'upgrades', 'recovery-error.json'), {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@agent-link/agent",
3
- "version": "0.1.312",
3
+ "version": "0.1.314",
4
4
  "description": "AgentLink local agent CLI",
5
5
  "license": "MIT",
6
6
  "repository": {