@volter/supercode-teams 0.2.102 → 0.2.103

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/fleet.mjs CHANGED
@@ -46,16 +46,13 @@ function channelForOn() {
46
46
  return openOn(onName(), { context: contextName() });
47
47
  }
48
48
 
49
- // Who starts a pane: supercode names it when it runs this CLI (empty: a person); run on its own, supercode is asked
50
- // (`teams caller`), and a launch no supercode answers for records no starter (so no session may act on the pane).
49
+ // Who starts a pane, as supercode answers it (`teams caller`); a launch nothing answers for records no starter, so no
50
+ // session may act on the pane.
51
51
  let launcherAnswer;
52
52
  function launcher() {
53
53
  if (launcherAnswer === undefined) {
54
- if (process.env.SUPERCODE_CALLER !== undefined) launcherAnswer = process.env.SUPERCODE_CALLER || null;
55
- else {
56
- const r = spawnSync(process.env.SUPERCODE_BIN || 'supercode', ['teams', 'caller'], { encoding: 'utf8', shell: process.platform === 'win32', windowsHide: true });
57
- try { launcherAnswer = JSON.parse(r.stdout.trim().split('\n').pop()).caller ?? null; } catch { launcherAnswer = null; }
58
- }
54
+ const r = spawnSync(process.env.SUPERCODE_BIN || 'supercode', ['teams', 'caller'], { encoding: 'utf8', shell: process.platform === 'win32', windowsHide: true });
55
+ try { launcherAnswer = JSON.parse(r.stdout.trim().split('\n').pop()).caller ?? null; } catch { launcherAnswer = null; }
59
56
  }
60
57
  return launcherAnswer;
61
58
  }
package/bin/teams.mjs CHANGED
@@ -108,19 +108,16 @@ async function machineChannel() {
108
108
  }
109
109
 
110
110
  // The session (or board) this command acts for: the pane doors refuse a session acting on a pane it did not start.
111
- // supercode names it when it runs this CLI (empty: a person); run on its own (`supercode-teams`), this CLI asks
112
- // supercode (`teams caller`), which reads the session from this process's ancestry, and refuses when none answers.
111
+ // supercode answers it (`teams caller`: the session in this process's ancestry first, a named caller only as supercode
112
+ // itself takes one), so this bin holds the same rule as \`supercode teams\`; a command nothing answers for is refused.
113
113
  let callerAnswer;
114
114
  function caller() {
115
115
  if (callerAnswer === undefined) {
116
- if (process.env.SUPERCODE_CALLER !== undefined) callerAnswer = process.env.SUPERCODE_CALLER || null;
117
- else {
118
- const r = spawnSync(process.env.SUPERCODE_BIN || 'supercode', ['teams', 'caller'], { encoding: 'utf8', shell: process.platform === 'win32', windowsHide: true });
119
- let answer;
120
- try { answer = JSON.parse(r.stdout.trim().split('\n').pop()); } catch { /* no answer */ }
121
- if (!answer || !('caller' in answer)) die(`cannot tell which session runs this, so the pane doors cannot hold it to the panes it started; nothing was done. Run it as \`supercode teams …\` (${(r.error?.message ?? r.stderr ?? '').trim().slice(0, 200)})`, 1);
122
- callerAnswer = answer.caller ?? null;
123
- }
116
+ const r = spawnSync(process.env.SUPERCODE_BIN || 'supercode', ['teams', 'caller'], { encoding: 'utf8', shell: process.platform === 'win32', windowsHide: true });
117
+ let answer;
118
+ try { answer = JSON.parse(r.stdout.trim().split('\n').pop()); } catch { /* no answer */ }
119
+ if (!answer || !('caller' in answer)) die(`cannot tell which session runs this, so the pane doors cannot hold it to the panes it started; nothing was done (${(r.error?.message ?? r.stderr ?? '').trim().slice(0, 200)})`, 1);
120
+ callerAnswer = answer.caller ?? null;
124
121
  }
125
122
  return callerAnswer ?? undefined;
126
123
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@volter/supercode-teams",
3
- "version": "0.2.102",
3
+ "version": "0.2.103",
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",