@volter/supercode-teams 0.2.96 → 0.2.97
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/bin/workspace.mjs +24 -0
- package/package.json +1 -1
package/bin/workspace.mjs
CHANGED
|
@@ -744,6 +744,30 @@ async function connectorCommand(verb, { flags, rest, output, client, context, te
|
|
|
744
744
|
output({ version: 1, context: scope(context), data: { machine: saved.machine, source: saved.source, roots: saved.roots.map(({ path: _path, ...item }) => item), socket: machine.socketPath, foreground: true } });
|
|
745
745
|
// Run by a service, the connector moves to an upgrade on its own: its readers would otherwise answer from the code
|
|
746
746
|
// they loaded until something restarted it (after 0.5.51 this Mac's went on reading a Codex turn waiting on an
|
|
747
|
+
// approval as busy). The move is the install, run by the upgraded CLI, because an upgrade can change the service
|
|
748
|
+
// unit too (a launchd job without ProcessType ran at background priority and missed discovery's bound): it rewrites
|
|
749
|
+
// a changed unit and restarts this connector under it. It runs in a session of its own, so a service manager
|
|
750
|
+
// stopping this connector cannot stop it half done. On Windows the service runs a per-version copy, so the upgraded
|
|
751
|
+
// CLI is the `supercode` on PATH (whose install stops this connector; the task's repeat starts the new copy).
|
|
752
|
+
// An unchanged unit leaves this connector running, and it then restarts itself: every service manager here
|
|
753
|
+
// restarts a connector that exits non-zero.
|
|
754
|
+
if (saved.service) {
|
|
755
|
+
const shim = process.platform === 'win32' ? (() => { try { return execFileSync('where', ['supercode'], { encoding: 'utf8', windowsHide: true }).split(/\r?\n/).find(Boolean); } catch { return null; } })() : null;
|
|
756
|
+
watchCodeChange([process.env.SUPERCODE_BIN, new URL('../package.json', import.meta.url), shim], (changed) => {
|
|
757
|
+
process.stderr.write(`supercode teams: ${changed} changed under this connector (an upgrade); moving to the new code\n`);
|
|
758
|
+
const cli = process.platform === 'win32' ? 'supercode' : process.env.SUPERCODE_BIN;
|
|
759
|
+
spawn(cli, ['teams', 'connect', '--install', '--context', contextName, '--cwd', path], { shell: process.platform === 'win32', detached: true, stdio: 'ignore', windowsHide: true }).unref();
|
|
760
|
+
if (process.platform !== 'win32') setTimeout(() => { process.exitCode = 75; void stopConnector?.(); }, 60_000);
|
|
761
|
+
});
|
|
762
|
+
}
|
|
763
|
+
// A daemon with no server link holding the socket is a session's auto-start while this service was between
|
|
764
|
+
// restarts (from a supercode old enough not to wait for the service): it yields to the service's connector, which
|
|
765
|
+
// otherwise failed on EADDRINUSE at every restart and left this machine unlinked.
|
|
766
|
+
if (saved.service) await retireLinklessDaemon(paths(daemonHome).machine);
|
|
767
|
+
try { await connector.start({ roots: () => saved.roots }); await machine.start(); } catch (error) { await stopAll(); throw error; }
|
|
768
|
+
output({ version: 1, context: scope(context), data: { machine: saved.machine, source: saved.source, roots: saved.roots.map(({ path: _path, ...item }) => item), socket: machine.socketPath, foreground: true } });
|
|
769
|
+
// Run by a service, the connector moves to an upgrade on its own: its readers would otherwise answer from the code
|
|
770
|
+
// they loaded until something restarted it (after 0.5.51 this Mac's went on reading a Codex turn waiting on an
|
|
747
771
|
// approval as busy). On Windows the service runs a per-version copy, so what an upgrade replaces is the
|
|
748
772
|
// `supercode` on PATH, and the move is the install that re-pins the service (it stops this connector and starts
|
|
749
773
|
// the new copy). Elsewhere it stops and exits non-zero, which every service manager here restarts.
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@volter/supercode-teams",
|
|
3
|
-
"version": "0.2.
|
|
3
|
+
"version": "0.2.97",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"description": "A machine daemon serving this machine's doors, and a local or remote Teams server for shared session discovery, OpenTelemetry ingestion and access to enrolled machines.",
|
|
6
6
|
"license": "MIT",
|