@evomap/evolver-cli 2.0.55 → 2.0.56

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.
Files changed (2) hide show
  1. package/dist/recipe.js +14 -13
  2. package/package.json +7 -7
package/dist/recipe.js CHANGED
@@ -1429,19 +1429,20 @@ function persistRotatedNodeSecret(secret, version, nodeId, env, legacyDir) {
1429
1429
  const storePath = recipeProxyStorePath(env);
1430
1430
  const store = new mailbox.MailboxStore({ path: storePath });
1431
1431
  try {
1432
- const proxyNodeId = store.getState('node_id')?.trim();
1433
- store.setState('node_secret_source', 'pending_rotate');
1434
- if (nodeId)
1435
- store.setState('node_id', nodeId);
1436
- store.setState('node_secret', secret);
1437
- setOptionalStoreState(store, 'node_secret_version', version !== undefined ? String(version) : undefined);
1438
- store.setState('node_secret_source', 'hub_rotate');
1439
- // A running proxy refuses Hub calls while it records an auth failure; the new secret is what that failure
1440
- // waited for, so lift it and let the proxy's next request present the secret it now reloads from this store.
1441
- // The proxy reloads only its own node's secret, so a rotation of another node leaves its failure standing.
1442
- const sameNode = !nodeId || !proxyNodeId || nodeId === proxyNodeId;
1443
- if (sameNode && store.getState(PROXY_HUB_AUTH_STATUS) === 'auth_failed')
1444
- store.setState(PROXY_HUB_AUTH_STATUS, '');
1432
+ store.writeStateTransaction(() => {
1433
+ const proxyNodeId = store.getState('node_id')?.trim();
1434
+ if (nodeId)
1435
+ store.setState('node_id', nodeId);
1436
+ store.setState('node_secret', secret);
1437
+ setOptionalStoreState(store, 'node_secret_version', version !== undefined ? String(version) : undefined);
1438
+ store.setState('node_secret_source', 'hub_rotate');
1439
+ // Publish the new credential together with clearing the old failure so a genuine
1440
+ // 401 for the new credential cannot be erased by this rotation.
1441
+ const sameNode = !nodeId || !proxyNodeId || nodeId === proxyNodeId;
1442
+ if (sameNode && store.getState(PROXY_HUB_AUTH_STATUS) === 'auth_failed')
1443
+ store.setState(PROXY_HUB_AUTH_STATUS, '');
1444
+ return undefined;
1445
+ });
1445
1446
  }
1446
1447
  finally {
1447
1448
  store.close();
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@evomap/evolver-cli",
3
- "version": "2.0.55",
3
+ "version": "2.0.56",
4
4
  "private": false,
5
5
  "type": "module",
6
6
  "engines": {
@@ -27,12 +27,12 @@
27
27
  }
28
28
  },
29
29
  "dependencies": {
30
- "@evomap/evolver-core": "2.0.55",
31
- "@evomap/evolver-adapter-public": "2.0.55",
32
- "@evomap/evolver-mcp": "2.0.55",
33
- "@evomap/evolver-proxy": "2.0.55",
34
- "@evomap/evolver-runtime-adapters": "2.0.55",
35
- "@evomap/evolver-webui": "2.0.55"
30
+ "@evomap/evolver-core": "2.0.56",
31
+ "@evomap/evolver-adapter-public": "2.0.56",
32
+ "@evomap/evolver-mcp": "2.0.56",
33
+ "@evomap/evolver-proxy": "2.0.56",
34
+ "@evomap/evolver-runtime-adapters": "2.0.56",
35
+ "@evomap/evolver-webui": "2.0.56"
36
36
  },
37
37
  "repository": {
38
38
  "type": "git",