@volter/supercode-teams 0.2.91 → 0.2.92
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/teams.mjs +2 -0
- package/bin/workspace.mjs +2 -0
- package/package.json +1 -1
package/bin/teams.mjs
CHANGED
|
@@ -135,6 +135,8 @@ async function main() {
|
|
|
135
135
|
const socket = await machine.start();
|
|
136
136
|
out({ id: machine.id, socket, home, protocol: NODE_PROTOCOL, floor: machine.floor });
|
|
137
137
|
const stop = async () => { await machine.stop(); process.exit(0); };
|
|
138
|
+
// Another daemon took the socket path: this one serves nobody, and its children would run beside that one's.
|
|
139
|
+
machine.once('superseded', (path) => { process.stderr.write(`supercode teams: another machine daemon now serves ${path}; this one stops\n`); void stop(); });
|
|
138
140
|
process.on('SIGINT', stop);
|
|
139
141
|
process.on('SIGTERM', stop);
|
|
140
142
|
return;
|
package/bin/workspace.mjs
CHANGED
|
@@ -732,6 +732,8 @@ async function connectorCommand(verb, { flags, rest, output, client, context, te
|
|
|
732
732
|
// A connected machine is a person's: each pane it launches opens a window on its screen (SUPERCODE_POPUPS=0: none).
|
|
733
733
|
const machine = new TeamsMachine({ home: daemonHome, supercode: binary, popups: process.env.SUPERCODE_POPUPS !== '0', ...(flags.tmux_socket ? { tmuxSocket: String(flags.tmux_socket) } : {}), link: { server: context.origin, teamId: context.team_id, machineId: saved.machine.id, credential: saved.credential.token, incarnationId: connector.state.incarnation_id, configuration: () => connector.configuration() }, onTurn: (turn) => connector.noteTurn(turn) });
|
|
734
734
|
machine.on('link', (event) => { if (event.event === 'replaced') process.stderr.write(`supercode teams: ${event.error}. Two connectors were running for this machine; stop one of them (\`supercode teams disconnect\` where it should not run).\n`); });
|
|
735
|
+
// The connector is the service's daemon and keeps serving; a daemon that took its socket path is the one to stop.
|
|
736
|
+
machine.on('superseded', (path) => process.stderr.write(`supercode teams: another machine daemon replaced this connector's socket at ${path}; stop it (supercode teams status)\n`));
|
|
735
737
|
const stopAll = async () => { await machine.stop().catch(() => {}); await connector.stop(); await core.close(); await largeCore.close(); await slowCore.close(); await liveCore.close(); await lifecycle.close(); state.update(current => current ? ({ ...current, process: undefined }) : null); };
|
|
736
738
|
try { await connector.start({ roots: () => saved.roots }); await machine.start(); } catch (error) { await stopAll(); throw error; }
|
|
737
739
|
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 } });
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@volter/supercode-teams",
|
|
3
|
-
"version": "0.2.
|
|
3
|
+
"version": "0.2.92",
|
|
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",
|