@schoolai/shipyard 3.18.0-rc.20260623.0 → 3.18.0

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.
@@ -71,7 +71,7 @@ async function main() {
71
71
  await loadAuthFromConfig(env);
72
72
  crumb("post-auth-load");
73
73
  crumb("pre-serve-import");
74
- const { serve } = await import("./serve-WPUUUANW.js");
74
+ const { serve } = await import("./serve-NTV6KMY3.js");
75
75
  crumb("post-serve-import");
76
76
  const portQueue = [];
77
77
  let acceptor = null;
package/dist/index.js CHANGED
@@ -129,7 +129,7 @@ async function handleSubcommand() {
129
129
  return true;
130
130
  }
131
131
  if (subcommand === "start") {
132
- const { startCommand } = await import("./start-ZVPBC66C.js");
132
+ const { startCommand } = await import("./start-MW3BBTC3.js");
133
133
  await startCommand();
134
134
  return true;
135
135
  }
@@ -151,7 +151,7 @@ async function main() {
151
151
  const args = parseCliArgs();
152
152
  if (args.serve) {
153
153
  await loadAuthFromConfig(env);
154
- const { serve } = await import("./serve-WPUUUANW.js");
154
+ const { serve } = await import("./serve-NTV6KMY3.js");
155
155
  return serve({ isDev: env.SHIPYARD_DEV });
156
156
  }
157
157
  logger.error("Use `shipyard start` to run the daemon. Use --help for usage.");
@@ -30231,6 +30231,13 @@ function computeReinitiateDelayMs(attempt) {
30231
30231
  const clamped = Math.min(Math.max(attempt, 1), MAX_REINITIATE_ATTEMPTS);
30232
30232
  return 2 ** (clamped - 1) * 1e3;
30233
30233
  }
30234
+ var REINITIATE_KEEPALIVE_MS = 15e3;
30235
+ function planReinitiate(attempt) {
30236
+ if (attempt <= MAX_REINITIATE_ATTEMPTS) {
30237
+ return { phase: "fast", delayMs: computeReinitiateDelayMs(attempt) };
30238
+ }
30239
+ return { phase: "keepalive", delayMs: REINITIATE_KEEPALIVE_MS };
30240
+ }
30234
30241
  function hasTurnServer(iceServers) {
30235
30242
  return iceServers.some((server) => {
30236
30243
  const urls = Array.isArray(server.urls) ? server.urls : [server.urls];
@@ -30763,31 +30770,26 @@ function createPeerManager(config) {
30763
30770
  }
30764
30771
  function scheduleReinitiate(targetMachineId) {
30765
30772
  if (!initiatorTargets.has(targetMachineId)) return;
30766
- const attempts = reinitiateAttempts.get(targetMachineId) ?? 0;
30767
- if (attempts >= MAX_REINITIATE_ATTEMPTS) {
30768
- config.logAdapter?.({ event: "collab_reinitiate_exhausted", targetMachineId });
30769
- config.log.warn({ targetMachineId, attempts }, "collab re-initiate exhausted");
30770
- return;
30771
- }
30772
- const attempt = attempts + 1;
30773
+ const attempt = (reinitiateAttempts.get(targetMachineId) ?? 0) + 1;
30774
+ const plan = planReinitiate(attempt);
30773
30775
  reinitiateAttempts.set(targetMachineId, attempt);
30774
30776
  relayPreferred.add(targetMachineId);
30775
30777
  const existing = reinitiateTimers.get(targetMachineId);
30776
30778
  if (existing) clearTimeout(existing);
30777
- const delayMs = computeReinitiateDelayMs(attempt);
30778
30779
  const timer = setTimeout(() => {
30779
30780
  reinitiateTimers.delete(targetMachineId);
30780
30781
  if (!initiatorTargets.has(targetMachineId)) return;
30781
30782
  void initiateOfferImpl(targetMachineId).catch(() => {
30782
30783
  scheduleReinitiate(targetMachineId);
30783
30784
  });
30784
- }, delayMs);
30785
+ }, plan.delayMs);
30785
30786
  reinitiateTimers.set(targetMachineId, timer);
30786
30787
  config.logAdapter?.({
30787
30788
  event: "collab_reinitiate_scheduled",
30788
30789
  targetMachineId,
30789
30790
  attempt,
30790
- delayMs
30791
+ delayMs: plan.delayMs,
30792
+ phase: plan.phase
30791
30793
  });
30792
30794
  }
30793
30795
  function applyDisconnectWatchdog(machineId, entry, newState) {
@@ -100398,4 +100400,4 @@ export {
100398
100400
  decideWorkspaceScope,
100399
100401
  serve
100400
100402
  };
100401
- //# sourceMappingURL=serve-WPUUUANW.js.map
100403
+ //# sourceMappingURL=serve-NTV6KMY3.js.map