@sjawhar/pi-legion-envoy 1.37.0 → 1.38.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.
Files changed (2) hide show
  1. package/dist/legion.js +9 -10
  2. package/package.json +1 -1
package/dist/legion.js CHANGED
@@ -30443,6 +30443,13 @@ var exitProcess = (code) => process.exit(code);
30443
30443
  function setLegionBootstrapExitForTests(hook) {
30444
30444
  exitProcess = hook;
30445
30445
  }
30446
+ function exitOnRegistrationRefusal(route, error) {
30447
+ if (error instanceof LegionDaemonApiError && (error.status === 403 || error.status === 409)) {
30448
+ console.error(`[legion] ${route} refused this session (${error.status}); exiting \u2014 the daemon owns what happens to this role next: ${messageFor(error)}`);
30449
+ exitProcess(1);
30450
+ }
30451
+ throw error;
30452
+ }
30446
30453
  var READY_RETRY_ATTEMPTS = 3;
30447
30454
  var READY_RETRY_DELAY_MS = 1000;
30448
30455
  function isNetworkOrTimeoutError(error) {
@@ -30778,11 +30785,7 @@ function legionExtension(pi) {
30778
30785
  ompSessionFile: sessionFile
30779
30786
  });
30780
30787
  } catch (error) {
30781
- if (error instanceof LegionDaemonApiError && error.status === 403) {
30782
- console.error(`[legion] worker boot token rejected; exiting for the daemon to respawn: ${messageFor(error)}`);
30783
- exitProcess(1);
30784
- }
30785
- throw error;
30788
+ exitOnRegistrationRefusal("process/started", error);
30786
30789
  }
30787
30790
  })();
30788
30791
  const roleToken = started.roleTokens.architect;
@@ -30858,11 +30861,7 @@ function legionExtension(pi) {
30858
30861
  ompSessionFile: sessionFile
30859
30862
  });
30860
30863
  } catch (error) {
30861
- if (error instanceof LegionDaemonApiError && error.status === 403) {
30862
- console.error(`[legion] worker boot token rejected; exiting for the daemon to respawn: ${messageFor(error)}`);
30863
- exitProcess(1);
30864
- }
30865
- throw error;
30864
+ exitOnRegistrationRefusal("worker/started", error);
30866
30865
  }
30867
30866
  })();
30868
30867
  try {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@sjawhar/pi-legion-envoy",
3
- "version": "1.37.0",
3
+ "version": "1.38.0",
4
4
  "type": "module",
5
5
  "omp": {
6
6
  "extensions": [