@volter/supercode-orchestrator 0.4.49 → 0.4.50

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/board/cli.mjs +7 -1
  2. package/package.json +1 -1
package/board/cli.mjs CHANGED
@@ -1085,7 +1085,11 @@ async function serve(root, args = {}) {
1085
1085
  process.on('SIGTERM', stop);
1086
1086
  process.on('SIGINT', stop);
1087
1087
  const log = (text) => process.stdout.write(`${new Date().toISOString()} ${text}\n`);
1088
- log(`dispatching the boards of ${root} from ${localMachine()}`);
1088
+ // the orchestrator this serve runs, as installed: a newer install ends the serve after its tick, so whatever keeps it
1089
+ // running starts it again on the new code (a fix reaches the board with no hand relaunch)
1090
+ const installed = () => { try { return JSON.parse(readFileSync(new URL('../package.json', import.meta.url), 'utf8')).version ?? null; } catch { return null; } };
1091
+ const running = installed();
1092
+ log(`dispatching the boards of ${root} from ${localMachine()} (orchestrator ${running ?? 'unknown'})`);
1089
1093
  const stuck = {};
1090
1094
  const warned = {};
1091
1095
  let pausedSaid = false;
@@ -1113,6 +1117,8 @@ async function serve(root, args = {}) {
1113
1117
  } catch (error) {
1114
1118
  log(`tick failed: ${error.message}`);
1115
1119
  }
1120
+ const now = installed();
1121
+ if (running && now && now !== running) { log(`orchestrator ${now} is installed (this serve runs ${running}); stopping, for its keeper to start the new one`); break; }
1116
1122
  // the next tick is due an interval after this one began (a long tick is not followed by a full interval's wait)
1117
1123
  const rest = Math.max(1, interval - Math.floor((Date.now() - began) / 1000));
1118
1124
  for (let waited = 0; waited < rest && !stopped; waited += 1) await new Promise((done) => setTimeout(done, 1000));
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@volter/supercode-orchestrator",
3
- "version": "0.4.49",
3
+ "version": "0.4.50",
4
4
  "type": "module",
5
5
  "description": "The orchestrator runtime over the Volter Harness ontology: one typed operational model whose folder is its serialization, read and written through the harness orchestration doors (docs/ORCHESTRATOR-IR.md)",
6
6
  "exports": {