@threadbase-sh/streamer 1.58.0 → 1.58.2

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/dist/index.d.cts CHANGED
@@ -1788,6 +1788,21 @@ declare class LiveSessionManager {
1788
1788
  listSessions(): ManagedSession[];
1789
1789
  dispose(): void;
1790
1790
  private runnerFor;
1791
+ /**
1792
+ * Refuse before spawning when the provider's CLI is not on this machine.
1793
+ *
1794
+ * Without this the spawn "succeeds": on POSIX execvp fails inside the forked
1795
+ * child, so a session appears, exits ~12ms later with code 1 and no output,
1796
+ * and the caller is told only that it "exited before becoming ready" — or,
1797
+ * on the Claude resume path, is told nothing at all, since that path answers
1798
+ * 200 before the process has had a chance to die. Every start route funnels
1799
+ * through here, so one check covers start, resume, adopt and fork.
1800
+ *
1801
+ * 503, not 500: the request was well-formed and the fault is this machine's
1802
+ * environment. `code` is what mobile branches on (it reads `errBody.code`),
1803
+ * and `PROVIDER_NOT_INSTALLED` is a remediation string it already knows.
1804
+ */
1805
+ private assertProviderInstalled;
1791
1806
  private assertSupportedProvider;
1792
1807
  private activeRunners;
1793
1808
  }
@@ -2381,6 +2396,30 @@ declare class StreamerServer {
2381
2396
  private finishWarmup;
2382
2397
  private withWarmup;
2383
2398
  private rejectIfWarmingUp;
2399
+ /**
2400
+ * Say which provider CLIs this machine can actually launch.
2401
+ *
2402
+ * The operator cannot discover this case unaided: under launchd/Task
2403
+ * Scheduler the service inherits a stripped PATH, so a CLI that works
2404
+ * perfectly in their terminal is invisible to the service, and every session
2405
+ * start dies milliseconds in. `/api/diagnostics` answers it too, but only for
2406
+ * someone who already suspects it.
2407
+ *
2408
+ * Availability only, never a version — `--version` costs a process spawn per
2409
+ * provider (85ms for claude here) and belongs on the first request that wants
2410
+ * it, not on boot.
2411
+ *
2412
+ * Called AFTER the port is bound, which is not cosmetic. This is the first
2413
+ * caller of the exe resolvers in the process, so the memo is cold by
2414
+ * definition and each provider pays one synchronous `which` / `where.exe`
2415
+ * (platform.ts) with a 3s timeout. On POSIX that is 3ms found, 7ms missing.
2416
+ * Windows is the risk — `where.exe` is slower, `execFileSync` blocks the
2417
+ * event loop, and Task Scheduler's stripped PATH is exactly where a miss
2418
+ * pays the full timeout — so the worst case is ~6s of two blocking lookups.
2419
+ * After `listen()` that delays the first requests on a box that cannot start
2420
+ * a session anyway; before it, it would have delayed binding the port.
2421
+ */
2422
+ private logProviderAvailability;
2384
2423
  listen(port: number, opts?: {
2385
2424
  awaitReady?: boolean;
2386
2425
  }): Promise<void>;
package/dist/index.d.ts CHANGED
@@ -1788,6 +1788,21 @@ declare class LiveSessionManager {
1788
1788
  listSessions(): ManagedSession[];
1789
1789
  dispose(): void;
1790
1790
  private runnerFor;
1791
+ /**
1792
+ * Refuse before spawning when the provider's CLI is not on this machine.
1793
+ *
1794
+ * Without this the spawn "succeeds": on POSIX execvp fails inside the forked
1795
+ * child, so a session appears, exits ~12ms later with code 1 and no output,
1796
+ * and the caller is told only that it "exited before becoming ready" — or,
1797
+ * on the Claude resume path, is told nothing at all, since that path answers
1798
+ * 200 before the process has had a chance to die. Every start route funnels
1799
+ * through here, so one check covers start, resume, adopt and fork.
1800
+ *
1801
+ * 503, not 500: the request was well-formed and the fault is this machine's
1802
+ * environment. `code` is what mobile branches on (it reads `errBody.code`),
1803
+ * and `PROVIDER_NOT_INSTALLED` is a remediation string it already knows.
1804
+ */
1805
+ private assertProviderInstalled;
1791
1806
  private assertSupportedProvider;
1792
1807
  private activeRunners;
1793
1808
  }
@@ -2381,6 +2396,30 @@ declare class StreamerServer {
2381
2396
  private finishWarmup;
2382
2397
  private withWarmup;
2383
2398
  private rejectIfWarmingUp;
2399
+ /**
2400
+ * Say which provider CLIs this machine can actually launch.
2401
+ *
2402
+ * The operator cannot discover this case unaided: under launchd/Task
2403
+ * Scheduler the service inherits a stripped PATH, so a CLI that works
2404
+ * perfectly in their terminal is invisible to the service, and every session
2405
+ * start dies milliseconds in. `/api/diagnostics` answers it too, but only for
2406
+ * someone who already suspects it.
2407
+ *
2408
+ * Availability only, never a version — `--version` costs a process spawn per
2409
+ * provider (85ms for claude here) and belongs on the first request that wants
2410
+ * it, not on boot.
2411
+ *
2412
+ * Called AFTER the port is bound, which is not cosmetic. This is the first
2413
+ * caller of the exe resolvers in the process, so the memo is cold by
2414
+ * definition and each provider pays one synchronous `which` / `where.exe`
2415
+ * (platform.ts) with a 3s timeout. On POSIX that is 3ms found, 7ms missing.
2416
+ * Windows is the risk — `where.exe` is slower, `execFileSync` blocks the
2417
+ * event loop, and Task Scheduler's stripped PATH is exactly where a miss
2418
+ * pays the full timeout — so the worst case is ~6s of two blocking lookups.
2419
+ * After `listen()` that delays the first requests on a box that cannot start
2420
+ * a session anyway; before it, it would have delayed binding the port.
2421
+ */
2422
+ private logProviderAvailability;
2384
2423
  listen(port: number, opts?: {
2385
2424
  awaitReady?: boolean;
2386
2425
  }): Promise<void>;