@volter/supercode-teams 0.3.10 → 0.3.11

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/machine.mjs +11 -3
  2. package/package.json +1 -1
package/machine.mjs CHANGED
@@ -521,10 +521,12 @@ export class TeamsMachine extends MachineCore {
521
521
  async #checkEnds() {
522
522
  const pending = this.#pendingNotices();
523
523
  if (!pending.length) { clearInterval(this.endWatch); this.endWatch = null; return; }
524
+ // One pane listing for every pending notice, not one per notice.
525
+ const panes = await this.host.listSessions();
524
526
  for (const ask of pending) {
525
527
  // A pane has ended when it is gone, or when its program has exited and the host keeps it for its last screen
526
528
  // (a ConPTY pane whose program failed).
527
- const session = await this.#paneByContext(ask.pane);
529
+ const session = panes.find((s) => s.contextKey === ask.pane) ?? null;
528
530
  if (session && !session.dead) continue;
529
531
  appendFileSync(this.#noticesPath(), JSON.stringify({ t: Date.now(), pane: ask.pane, told: true }) + '\n', { mode: 0o600 });
530
532
  const exit = session?.dead ? deadPaneExit(session) : paneExit(ask.pane);
@@ -1876,9 +1878,15 @@ export class TeamsMachine extends MachineCore {
1876
1878
  // Everything this daemon launched, by key, with whether the pane still lives: how an
1877
1879
  // operator tells its own launches from a person's panes without reading labels.
1878
1880
  if (!operator) throw Object.assign(new Error('operators only'), { code: 403 });
1881
+ // One pane listing for the whole journal: one per launch (thousands of them) ran past the door's 30 s bound,
1882
+ // the slowest door the slow log named on yuerans-macbook-pro (t_23e47b73).
1883
+ // The journal first, then the panes: a launch that becomes ready while the panes are listed is in a listing
1884
+ // taken after it, so it never reads as not live.
1879
1885
  const rows = [];
1880
- for (const found of this.launches.all()) {
1881
- const session = found.pane ? await this.#paneByContext(found.pane) : null;
1886
+ const launched = this.launches.all();
1887
+ const panes = await this.host.listSessions();
1888
+ for (const found of launched) {
1889
+ const session = found.pane ? panes.find((s) => s.contextKey === found.pane) ?? null : null;
1882
1890
  rows.push({ key: found.key, pane: found.pane ?? null, kind: found.kind ?? null, by: found.by ?? null, status: found.status ?? null, at: found.t, live: Boolean(session && !session.dead), ...initialInputFacts(found) });
1883
1891
  }
1884
1892
  return rows;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@volter/supercode-teams",
3
- "version": "0.3.10",
3
+ "version": "0.3.11",
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",