@volter/supercode-teams 0.2.106 → 0.2.107

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 +5 -7
  2. package/package.json +1 -1
package/machine.mjs CHANGED
@@ -51,12 +51,8 @@ import { JobOwner, executionCapabilities, streamProgram, serveWorkspace } from '
51
51
 
52
52
  /** The preload every launched pane carries: it announces the ports a pane's node processes listen on. */
53
53
  const PORTHOLE_HOOK = fileURLToPath(new URL('./porthole-hook.cjs', import.meta.url));
54
- /** How long a launch's `initialInput` waits for its pane to become ready for
55
- * input before it is delivered anyway. Long enough for the slowest cold
56
- * start anyone has reported (a first-run agent TUI fetching its config over a
57
- * slow link); past it the input goes in regardless and the launch record says
58
- * so, because silently dropping a caller's first message is worse than an
59
- * imperfectly-timed one. */
54
+ /** How long launch input waits for a ready composer. At the deadline it stays
55
+ * undelivered; startup dialogs must never receive the queued message. */
60
56
  const INITIAL_INPUT_READY_DEADLINE_MS = 90_000;
61
57
  /** How often the readiness evidence is re-read while waiting. Same cadence the
62
58
  * terminal controller polls its own composer at: fast enough that a ready pane
@@ -823,6 +819,7 @@ export class TeamsMachine extends MachineCore {
823
819
  async #awaitInputReady(session, contextKey, kind, signal) {
824
820
  const composerKind = this.#paneKind(contextKey, session);
825
821
  const until = Date.now() + INITIAL_INPUT_READY_DEADLINE_MS;
822
+ let readySince = null;
826
823
  while (!signal.aborted && Date.now() < until) {
827
824
  const capture = await Promise.resolve().then(() => this.host.capture(session.id, { preserveEscapes: true })).catch(() => '');
828
825
  const unchangedMs = this.#screenUnchangedMs(session.id, capture, Date.now());
@@ -837,7 +834,8 @@ export class TeamsMachine extends MachineCore {
837
834
  // never "not yet", or an unrecognized kind would wait out the whole
838
835
  // deadline on a screen nobody is reading.
839
836
  const composer = composerReadyForInput(composerKind, capture);
840
- if (composer === true) return 'composer';
837
+ readySince = composer === true ? (readySince ?? Date.now()) : null;
838
+ if (composer === true && Date.now() - readySince >= INITIAL_INPUT_SETTLE_MS) return 'composer';
841
839
  if (composer === null && unchangedMs >= INITIAL_INPUT_SETTLE_MS && (!blank || livenessOf(live.activeCommand) === 'waiting')) return 'settled';
842
840
  await new Promise((resolve) => setTimeout(resolve, INITIAL_INPUT_POLL_MS));
843
841
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@volter/supercode-teams",
3
- "version": "0.2.106",
3
+ "version": "0.2.107",
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",