@parall/daemon 1.69.0 → 1.70.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.
@@ -1433,6 +1433,7 @@ var init_constants = __esm({
1433
1433
  UNREAD_BY_ORG: `${API_BASE2}/me/unread/orgs`,
1434
1434
  CHAT_READ: (orgId, chatId) => `${API_BASE2}/orgs/${orgId}/chats/${chatId}/read`,
1435
1435
  CHAT_READ_ALL: (orgId, chatId) => `${API_BASE2}/orgs/${orgId}/chats/${chatId}/read-all`,
1436
+ CHAT_UNREAD_THREADS: (orgId, chatId) => `${API_BASE2}/orgs/${orgId}/chats/${chatId}/threads/unread`,
1436
1437
  THREAD_UNREAD: (orgId, chatId, threadRootId) => `${API_BASE2}/orgs/${orgId}/chats/${chatId}/threads/${threadRootId}/unread`,
1437
1438
  THREAD_READ: (orgId, chatId, threadRootId) => `${API_BASE2}/orgs/${orgId}/chats/${chatId}/threads/${threadRootId}/read`,
1438
1439
  // References (org-scoped)
@@ -1591,6 +1592,7 @@ var init_constants = __esm({
1591
1592
  ORG_INVITE_LINK_JOINED: "org.invite_link.joined",
1592
1593
  ORG_MEMBER_REMOVED: "org.member.removed",
1593
1594
  ORG_MEMBER_PROFILE_UPDATED: "org.member.profile.updated",
1595
+ APP_DATA_CHANGED: "app.data.changed",
1594
1596
  AGENT_CONFIG_UPDATE: "agent_config.update",
1595
1597
  PRESENCE_UPDATE: "presence.update",
1596
1598
  WIKI_CHANGESET_CREATED: "wiki.changeset.created",
@@ -4025,6 +4027,12 @@ var init_client = __esm({
4025
4027
  async markAllRead(orgId, chatId) {
4026
4028
  return this.request("POST", ENDPOINTS.CHAT_READ_ALL(orgId, chatId));
4027
4029
  }
4030
+ /** The caller's watched threads in a chat that have unread replies — the
4031
+ * per-thread breakdown of the chat's `thread_count`, for reaching thread
4032
+ * residue whose root is outside the loaded message window. */
4033
+ async getUnreadThreads(orgId, chatId) {
4034
+ return this.request("GET", ENDPOINTS.CHAT_UNREAD_THREADS(orgId, chatId));
4035
+ }
4028
4036
  async getThreadUnread(orgId, chatId, threadRootId) {
4029
4037
  return this.request("GET", ENDPOINTS.THREAD_UNREAD(orgId, chatId, threadRootId));
4030
4038
  }
@@ -5990,7 +5998,7 @@ var init_ws = __esm({
5990
5998
  enterAuthInvalid(event) {
5991
5999
  this.clearReconnect();
5992
6000
  this.setState("auth-invalid");
5993
- console.error(`WS auth-invalid: server rejected this credential (status ${event.status}${event.code ? `, code ${event.code}` : ""}) \u2014 ${event.message}. The key is invalid, expired, or revoked; retrying it cannot succeed, so reconnects are stopped. Recover by refreshing credentials (re-login, or issue a new API key), then connect again.`);
6001
+ console.error(`WS auth-invalid: server rejected this credential (status ${event.status}${event.code ? `, code ${event.code}` : ""}) \u2014 ${event.message}. This client stops reconnecting on its own; the owner decides whether to call connect() again later or refresh credentials (re-login, or issue a new API key) first.`);
5994
6002
  for (const listener of this.authInvalidListeners) {
5995
6003
  listener(event);
5996
6004
  }
@@ -59477,6 +59485,8 @@ function resolveClaudeDaemonConfig(env = process.env) {
59477
59485
  restartBackoffMaxMs: parseMs(env.PRLL_DAEMON_RESTART_BACKOFF_MAX_MS, 5 * 6e4),
59478
59486
  bootstrapBackoffMs: parseMsAllowZero(env.PRLL_DAEMON_BOOTSTRAP_BACKOFF_MS, 2e3),
59479
59487
  bootstrapBackoffMaxMs: parseMs(env.PRLL_DAEMON_BOOTSTRAP_BACKOFF_MAX_MS, 6e4),
59488
+ credentialRetryBackoffMs: parseMs(env.PRLL_DAEMON_CREDENTIAL_RETRY_BACKOFF_MS, 6e4),
59489
+ credentialRetryBackoffMaxMs: parseMs(env.PRLL_DAEMON_CREDENTIAL_RETRY_BACKOFF_MAX_MS, 15 * 6e4),
59480
59490
  supervisorRestartBackoffMs: parseMsAllowZero(env.PRLL_DAEMON_SUPERVISOR_RESTART_BACKOFF_MS, 5e3),
59481
59491
  supervisorRestartBackoffMaxMs: parseMs(env.PRLL_DAEMON_SUPERVISOR_RESTART_BACKOFF_MAX_MS, 5 * 6e4),
59482
59492
  updateCdnUrl: env.PRLL_DAEMON_UPDATE_CDN_URL?.trim() || ((env.PRLL_DAEMON_UPDATE_CHANNEL?.trim() ?? "production") === "staging" ? "https://releases.staging.prll.sh/daemon/staging" : "https://releases.parall.com/daemon/production"),
@@ -60273,6 +60283,7 @@ MCowBQYDK2VwAyEAQHQAZThNX7+deJNyHl/5DgiAa1OHx7UQoJotam0JhUk=
60273
60283
  updating = false;
60274
60284
  periodicTimer = null;
60275
60285
  reportOutcome = null;
60286
+ restartHandler = null;
60276
60287
  constructor(bundleDir, cdnBaseUrl, log2, signingEnabled) {
60277
60288
  this.bundleDir = bundleDir;
60278
60289
  this.cdnBaseUrl = cdnBaseUrl;
@@ -60287,6 +60298,15 @@ MCowBQYDK2VwAyEAQHQAZThNX7+deJNyHl/5DgiAa1OHx7UQoJotam0JhUk=
60287
60298
  report(outcome, reason) {
60288
60299
  this.reportOutcome?.(outcome, reason);
60289
60300
  }
60301
+ /**
60302
+ * Restart the daemon onto an update installed after boot (periodic check or
60303
+ * WS push). Installed-but-not-running is not an update: the old process
60304
+ * would keep its bugs, and a later push for the same version is skipped
60305
+ * because the disk is already current.
60306
+ */
60307
+ setRestartHandler(fn) {
60308
+ this.restartHandler = fn;
60309
+ }
60290
60310
  /**
60291
60311
  * Start periodic update checks. Call once after supervisor bootstrap.
60292
60312
  */
@@ -60294,9 +60314,7 @@ MCowBQYDK2VwAyEAQHQAZThNX7+deJNyHl/5DgiAa1OHx7UQoJotam0JhUk=
60294
60314
  if (intervalMs <= 0 || this.periodicTimer)
60295
60315
  return;
60296
60316
  this.periodicTimer = setInterval(() => {
60297
- this.checkAndApply().catch((err) => {
60298
- this.log.warn(`periodic update check failed: ${String(err)}`);
60299
- });
60317
+ void this.applyAndRestart();
60300
60318
  }, intervalMs);
60301
60319
  this.periodicTimer.unref?.();
60302
60320
  }
@@ -60332,7 +60350,13 @@ MCowBQYDK2VwAyEAQHQAZThNX7+deJNyHl/5DgiAa1OHx7UQoJotam0JhUk=
60332
60350
  const jitter = Math.random() * 18e4;
60333
60351
  await new Promise((r) => setTimeout(r, jitter));
60334
60352
  }
60335
- return this.checkAndApply(targetVersion);
60353
+ return this.applyAndRestart(targetVersion);
60354
+ }
60355
+ async applyAndRestart(targetVersion) {
60356
+ const applied = await this.checkAndApply(targetVersion);
60357
+ if (applied)
60358
+ this.restartHandler?.();
60359
+ return applied;
60336
60360
  }
60337
60361
  /**
60338
60362
  * Check if we need to roll back from a failed update.
@@ -67681,8 +67705,7 @@ var init_process = __esm({
67681
67705
  }
67682
67706
  });
67683
67707
 
67684
- // ts/daemon/dist/clip-runtime/hub-client.js
67685
- import * as http22 from "node:http2";
67708
+ // ts/daemon/dist/clip-runtime/connect-envelope.js
67686
67709
  function encodeEnvelope(msg) {
67687
67710
  const json = Buffer.from(JSON.stringify(msg), "utf-8");
67688
67711
  const header = Buffer.alloc(5);
@@ -67690,6 +67713,40 @@ function encodeEnvelope(msg) {
67690
67713
  header.writeUInt32BE(json.length, 1);
67691
67714
  return Buffer.concat([header, json]);
67692
67715
  }
67716
+ var ENVELOPE_FLAG_DATA, ENVELOPE_FLAG_TRAILER, MAX_FRAME_LENGTH, EnvelopeDecoder;
67717
+ var init_connect_envelope = __esm({
67718
+ "ts/daemon/dist/clip-runtime/connect-envelope.js"() {
67719
+ "use strict";
67720
+ ENVELOPE_FLAG_DATA = 0;
67721
+ ENVELOPE_FLAG_TRAILER = 2;
67722
+ MAX_FRAME_LENGTH = 16 * 1024 * 1024;
67723
+ EnvelopeDecoder = class {
67724
+ buf = Buffer.alloc(0);
67725
+ push(chunk) {
67726
+ this.buf = this.buf.length === 0 ? Buffer.from(chunk) : Buffer.concat([this.buf, chunk]);
67727
+ }
67728
+ /** Drain all complete envelopes from the internal buffer. */
67729
+ *flush() {
67730
+ while (this.buf.length >= 5) {
67731
+ const flags = this.buf[0];
67732
+ const length = this.buf.readUInt32BE(1);
67733
+ if (length > MAX_FRAME_LENGTH) {
67734
+ this.buf = Buffer.alloc(0);
67735
+ throw new Error(`envelope frame too large: ${length} bytes`);
67736
+ }
67737
+ if (this.buf.length < 5 + length)
67738
+ break;
67739
+ const payload = this.buf.subarray(5, 5 + length);
67740
+ this.buf = Buffer.from(this.buf.subarray(5 + length));
67741
+ yield { flags, payload };
67742
+ }
67743
+ }
67744
+ };
67745
+ }
67746
+ });
67747
+
67748
+ // ts/daemon/dist/clip-runtime/hub-client.js
67749
+ import * as http22 from "node:http2";
67693
67750
  function connectErrorMessage(text) {
67694
67751
  try {
67695
67752
  const obj = JSON.parse(text);
@@ -67717,35 +67774,12 @@ function parseTrailer(payload) {
67717
67774
  return null;
67718
67775
  }
67719
67776
  }
67720
- var ENVELOPE_FLAG_DATA, ENVELOPE_FLAG_TRAILER, MAX_FRAME_LENGTH, DEFAULT_REQUEST_TIMEOUT_MS, EnvelopeDecoder, HubCommandError, HubClient;
67777
+ var DEFAULT_REQUEST_TIMEOUT_MS, HubCommandError, HubClient;
67721
67778
  var init_hub_client = __esm({
67722
67779
  "ts/daemon/dist/clip-runtime/hub-client.js"() {
67723
67780
  "use strict";
67724
- ENVELOPE_FLAG_DATA = 0;
67725
- ENVELOPE_FLAG_TRAILER = 2;
67726
- MAX_FRAME_LENGTH = 16 * 1024 * 1024;
67781
+ init_connect_envelope();
67727
67782
  DEFAULT_REQUEST_TIMEOUT_MS = 3e4;
67728
- EnvelopeDecoder = class {
67729
- buf = Buffer.alloc(0);
67730
- push(chunk) {
67731
- this.buf = this.buf.length === 0 ? Buffer.from(chunk) : Buffer.concat([this.buf, chunk]);
67732
- }
67733
- *flush() {
67734
- while (this.buf.length >= 5) {
67735
- const flags = this.buf[0];
67736
- const length = this.buf.readUInt32BE(1);
67737
- if (length > MAX_FRAME_LENGTH) {
67738
- this.buf = Buffer.alloc(0);
67739
- throw new Error(`envelope frame too large: ${length} bytes`);
67740
- }
67741
- if (this.buf.length < 5 + length)
67742
- break;
67743
- const payload = this.buf.subarray(5, 5 + length);
67744
- this.buf = Buffer.from(this.buf.subarray(5 + length));
67745
- yield { flags, payload };
67746
- }
67747
- }
67748
- };
67749
67783
  HubCommandError = class extends Error {
67750
67784
  code;
67751
67785
  constructor(message, code) {
@@ -68448,51 +68482,19 @@ var init_viewer_command_deadline = __esm({
68448
68482
 
68449
68483
  // ts/daemon/dist/clip-runtime/clip-provider.js
68450
68484
  import * as http23 from "node:http2";
68451
- function encodeEnvelope2(msg) {
68452
- const json = Buffer.from(JSON.stringify(msg), "utf-8");
68453
- const header = Buffer.alloc(5);
68454
- header[0] = ENVELOPE_FLAG_DATA2;
68455
- header.writeUInt32BE(json.length, 1);
68456
- return Buffer.concat([header, json]);
68457
- }
68458
68485
  function registrationKey(clips) {
68459
68486
  const sorted = [...clips].sort((a, b) => (a.alias ?? "").localeCompare(b.alias ?? ""));
68460
68487
  return JSON.stringify(sorted);
68461
68488
  }
68462
- var ENVELOPE_FLAG_DATA2, ENVELOPE_FLAG_TRAILER2, EnvelopeDecoder2, ClipProvider;
68489
+ var ClipProvider;
68463
68490
  var init_clip_provider = __esm({
68464
68491
  "ts/daemon/dist/clip-runtime/clip-provider.js"() {
68465
68492
  "use strict";
68466
68493
  init_browser_dependency();
68494
+ init_connect_envelope();
68467
68495
  init_process();
68468
68496
  init_viewer_command_deadline();
68469
68497
  init_viewer_command_error();
68470
- ENVELOPE_FLAG_DATA2 = 0;
68471
- ENVELOPE_FLAG_TRAILER2 = 2;
68472
- EnvelopeDecoder2 = class _EnvelopeDecoder {
68473
- buf = Buffer.alloc(0);
68474
- push(chunk) {
68475
- this.buf = this.buf.length === 0 ? Buffer.from(chunk) : Buffer.concat([this.buf, chunk]);
68476
- }
68477
- /** Drain all complete envelopes from the internal buffer. */
68478
- static MAX_FRAME_LENGTH = 16 * 1024 * 1024;
68479
- // 16 MiB
68480
- *flush() {
68481
- while (this.buf.length >= 5) {
68482
- const flags = this.buf[0];
68483
- const length = this.buf.readUInt32BE(1);
68484
- if (length > _EnvelopeDecoder.MAX_FRAME_LENGTH) {
68485
- this.buf = Buffer.alloc(0);
68486
- throw new Error(`envelope frame too large: ${length} bytes`);
68487
- }
68488
- if (this.buf.length < 5 + length)
68489
- break;
68490
- const payload = this.buf.subarray(5, 5 + length);
68491
- this.buf = Buffer.from(this.buf.subarray(5 + length));
68492
- yield { flags, payload };
68493
- }
68494
- }
68495
- };
68496
68498
  ClipProvider = class _ClipProvider {
68497
68499
  opts;
68498
68500
  session = null;
@@ -68500,6 +68502,7 @@ var init_clip_provider = __esm({
68500
68502
  stopped = false;
68501
68503
  connected = false;
68502
68504
  reconnectAttempt = 0;
68505
+ rejectedAttempt = 0;
68503
68506
  reconnectTimer = null;
68504
68507
  heartbeatTimer = null;
68505
68508
  statusUnsubscribe = null;
@@ -68578,11 +68581,11 @@ var init_clip_provider = __esm({
68578
68581
  this.opts.log.warn(`[clip-provider] stream error: ${String(err)}`);
68579
68582
  this.handleDisconnect(gen);
68580
68583
  });
68581
- const decoder = new EnvelopeDecoder2();
68584
+ const decoder = new EnvelopeDecoder();
68582
68585
  this.stream.on("data", (chunk) => {
68583
68586
  decoder.push(chunk);
68584
68587
  for (const envelope of decoder.flush()) {
68585
- if (envelope.flags === ENVELOPE_FLAG_TRAILER2) {
68588
+ if (envelope.flags === ENVELOPE_FLAG_TRAILER) {
68586
68589
  this.opts.log.info("[clip-provider] received end-of-stream trailer");
68587
68590
  continue;
68588
68591
  }
@@ -68618,10 +68621,10 @@ var init_clip_provider = __esm({
68618
68621
  this.clearHeartbeatTimer();
68619
68622
  this.scheduleReconnect();
68620
68623
  }
68621
- scheduleReconnect() {
68624
+ scheduleReconnect(delayMs) {
68622
68625
  if (this.stopped || this.reconnectTimer)
68623
68626
  return;
68624
- const delay = Math.min(_ClipProvider.RECONNECT_BASE_MS * Math.pow(2, this.reconnectAttempt), _ClipProvider.RECONNECT_MAX_MS);
68627
+ const delay = delayMs ?? Math.min(_ClipProvider.RECONNECT_BASE_MS * Math.pow(2, this.reconnectAttempt), _ClipProvider.RECONNECT_MAX_MS);
68625
68628
  this.reconnectAttempt++;
68626
68629
  this.opts.log.info(`[clip-provider] reconnecting in ${delay}ms (attempt ${this.reconnectAttempt})`);
68627
68630
  if (this.reconnectAttempt % _ClipProvider.PERSISTENT_FAILURE_ATTEMPT === 0) {
@@ -68764,11 +68767,19 @@ var init_clip_provider = __esm({
68764
68767
  this.opts.log.info(`[clip-provider] registered with hub (org=${this.opts.orgId})`);
68765
68768
  this.connected = true;
68766
68769
  this.reconnectAttempt = 0;
68770
+ this.rejectedAttempt = 0;
68767
68771
  this.startHeartbeat();
68768
68772
  this.flushReregister();
68769
68773
  } else {
68770
68774
  this.opts.log.error(`[clip-provider] registration rejected: ${reg.message}`);
68771
- this.stopped = true;
68775
+ this.connected = false;
68776
+ const retryDelay = this.opts.rejectedRetryDelayMs?.(this.rejectedAttempt++);
68777
+ if (retryDelay === void 0) {
68778
+ this.stopped = true;
68779
+ } else {
68780
+ this.clearHeartbeatTimer();
68781
+ this.scheduleReconnect(retryDelay);
68782
+ }
68772
68783
  this.closeStream();
68773
68784
  this.closeSession();
68774
68785
  }
@@ -68887,7 +68898,7 @@ var init_clip_provider = __esm({
68887
68898
  if (!this.stream || this.stream.closed || this.stream.destroyed) {
68888
68899
  throw new Error("stream not open");
68889
68900
  }
68890
- const envelope = encodeEnvelope2(msg);
68901
+ const envelope = encodeEnvelope(msg);
68891
68902
  return new Promise((resolve9, reject) => {
68892
68903
  this.stream.write(envelope, (err) => {
68893
68904
  if (err)
@@ -72009,7 +72020,7 @@ function sleepCancellable(ms, signal) {
72009
72020
  signal.addEventListener("abort", onAbort, { once: true });
72010
72021
  });
72011
72022
  }
72012
- var RUNTIME_PACKAGES, WORKSPACE_SETUP_RETRY_DELAY_MS, PARK_KEEPALIVE_MS, MACHINE_KEY_RECOVERY, AGENT_CONFIG_REFRESH_RETRY_DELAY_MS, CLIP_RECONCILE_INTERVAL_MS, RUNTIME_DETECT_INTERVAL_MS, DaemonSupervisor;
72023
+ var RUNTIME_PACKAGES, WORKSPACE_SETUP_RETRY_DELAY_MS, MACHINE_KEY_RECOVERY, AGENT_CONFIG_REFRESH_RETRY_DELAY_MS, CLIP_RECONCILE_INTERVAL_MS, RUNTIME_DETECT_INTERVAL_MS, DaemonSupervisor;
72013
72024
  var init_supervisor = __esm({
72014
72025
  "ts/daemon/dist/supervisor.js"() {
72015
72026
  "use strict";
@@ -72039,8 +72050,7 @@ var init_supervisor = __esm({
72039
72050
  openclaw: "@parall/openclaw-agent"
72040
72051
  };
72041
72052
  WORKSPACE_SETUP_RETRY_DELAY_MS = 5e3;
72042
- PARK_KEEPALIVE_MS = 6e4;
72043
- MACHINE_KEY_RECOVERY = 'Re-register this machine to get a new key \u2014 Desktop app: "Disable daemon", then "Enable daemon" (this registers a new machine and tries to delete the old one; re-attach its agents); CLI or server: create a machine under Compute in Parall and run `parall-daemon init` with its key \u2014 then restart the daemon. If you left the org or your account was disabled, this machine cannot be registered there again.';
72053
+ MACHINE_KEY_RECOVERY = 'The daemon keeps retrying and reconnects by itself if the key becomes valid again. If it keeps failing, the key was revoked or rotated, this machine was deleted, or its owner left the org: re-register this machine to get a new key \u2014 Desktop app: "Disable daemon", then "Enable daemon" (this registers a new machine and tries to delete the old one; re-attach its agents); CLI or server: create a machine under Compute in Parall and run `parall-daemon init` with its key \u2014 then restart the daemon. If you left the org or your account was disabled, this machine cannot be registered there again.';
72044
72054
  AGENT_CONFIG_REFRESH_RETRY_DELAY_MS = 5e3;
72045
72055
  CLIP_RECONCILE_INTERVAL_MS = 5 * 6e4;
72046
72056
  RUNTIME_DETECT_INTERVAL_MS = 5 * 6e4;
@@ -72080,6 +72090,9 @@ var init_supervisor = __esm({
72080
72090
  // registration check already keeps the stale state from ever spawning.
72081
72091
  restartingStates = /* @__PURE__ */ new Set();
72082
72092
  ws = null;
72093
+ // Slow re-arm of the machine WS after the server rejected this machine's key.
72094
+ wsAuthRetryTimer = null;
72095
+ wsAuthRetryAttempt = 0;
72083
72096
  running = false;
72084
72097
  machineId = null;
72085
72098
  /**
@@ -72248,17 +72261,7 @@ var init_supervisor = __esm({
72248
72261
  });
72249
72262
  this.ws.on("machine.update", (data) => {
72250
72263
  this.log.info(`WS: daemon update available \u2014 version=${data.new_version} mandatory=${data.mandatory}`);
72251
- if (this.updater) {
72252
- void this.updater.triggerUpdate(data.new_version, data.mandatory).then(async (applied) => {
72253
- if (applied) {
72254
- this.log.info("daemon update applied \u2014 stopping supervisor before restart");
72255
- await this.stop();
72256
- process.exit(42);
72257
- }
72258
- }).catch((err) => {
72259
- this.log.warn(`daemon update failed: ${String(err)}`);
72260
- });
72261
- }
72264
+ void this.updater?.triggerUpdate(data.new_version, data.mandatory);
72262
72265
  });
72263
72266
  this.ws.on("machine.agent.attached", (data) => {
72264
72267
  this.log.info(`WS: agent ${data.agent_id} attached`);
@@ -72316,10 +72319,10 @@ var init_supervisor = __esm({
72316
72319
  if (state === "reconnecting") {
72317
72320
  this.daemonTelemetry?.recordWsReconnect({ cause: detail?.cause, closeCode: detail?.code });
72318
72321
  }
72322
+ if (state === "connected")
72323
+ this.wsAuthRetryAttempt = 0;
72319
72324
  });
72320
- this.ws.onAuthInvalid((event) => {
72321
- this.log.error(`machine WS auth-invalid: the server rejected this machine's key (status ${event.status}${event.code ? `, code ${event.code}` : ""}) \u2014 ${event.message}. Control-plane events (attach/detach, config updates, update signals) are OFFLINE and reconnects are stopped. ${MACHINE_KEY_RECOVERY}`);
72322
- });
72325
+ this.ws.onAuthInvalid((event) => this.handleMachineWsAuthInvalid(event));
72323
72326
  await this.ws.connect();
72324
72327
  await new Promise((resolve9) => {
72325
72328
  this.stopResolve = resolve9;
@@ -72332,6 +72335,10 @@ var init_supervisor = __esm({
72332
72335
  return;
72333
72336
  this.running = false;
72334
72337
  this.healthGate?.onSupervisorEnded();
72338
+ if (this.wsAuthRetryTimer) {
72339
+ clearTimeout(this.wsAuthRetryTimer);
72340
+ this.wsAuthRetryTimer = null;
72341
+ }
72335
72342
  if (this.ws) {
72336
72343
  this.ws.disconnect();
72337
72344
  this.ws = null;
@@ -72386,9 +72393,31 @@ var init_supervisor = __esm({
72386
72393
  this.stopResolve = null;
72387
72394
  }
72388
72395
  }
72396
+ /**
72397
+ * The SDK stops after its small auth budget; re-arm it on the slow credential
72398
+ * schedule (connect() from auth-invalid grants a fresh budget). Running
72399
+ * children keep their own agk_ and are left alone; machine.hello on
72400
+ * reconnect replays whatever was missed.
72401
+ */
72402
+ handleMachineWsAuthInvalid(event) {
72403
+ if (!this.running)
72404
+ return;
72405
+ const delay = this.credentialRetryDelay(this.wsAuthRetryAttempt++);
72406
+ this.log.error(`machine WS auth-invalid: the server rejected this machine's key (status ${event.status}${event.code ? `, code ${event.code}` : ""}) \u2014 ${event.message}. Control-plane events (attach/detach, config updates, update signals) are OFFLINE; retrying in ${Math.round(delay / 1e3)}s. ` + MACHINE_KEY_RECOVERY);
72407
+ this.wsAuthRetryTimer = setTimeout(() => {
72408
+ this.wsAuthRetryTimer = null;
72409
+ if (this.running)
72410
+ void this.ws?.connect();
72411
+ }, delay);
72412
+ }
72389
72413
  // ---- Bootstrap (resilient identity probe) ----
72414
+ /** Slow schedule shared by every machine-key rejection retry (boot, WS, ProviderStream). */
72415
+ credentialRetryDelay(attempt) {
72416
+ return Math.min(this.config.credentialRetryBackoffMs * 2 ** attempt, this.config.credentialRetryBackoffMaxMs);
72417
+ }
72390
72418
  async bootstrapWithRetry(signal) {
72391
72419
  let attempt = 0;
72420
+ let credentialAttempt = 0;
72392
72421
  while (this.running && !signal.aborted) {
72393
72422
  try {
72394
72423
  const machine = await this.client.getMachineSelf();
@@ -72402,21 +72431,11 @@ var init_supervisor = __esm({
72402
72431
  return true;
72403
72432
  } catch (err) {
72404
72433
  if (err instanceof ApiError && err.status === 401) {
72405
- this.log.error(`machine key rejected by the server (status 401${err.code ? `, code ${err.code}` : ""}): ${err.message}. The daemon cannot start with this machine key. ${MACHINE_KEY_RECOVERY}`);
72406
- const parked = setInterval(() => {
72407
- }, PARK_KEEPALIVE_MS);
72408
- try {
72409
- await new Promise((resolve9) => {
72410
- if (signal.aborted) {
72411
- resolve9();
72412
- return;
72413
- }
72414
- signal.addEventListener("abort", () => resolve9(), { once: true });
72415
- });
72416
- } finally {
72417
- clearInterval(parked);
72418
- }
72419
- return false;
72434
+ const delay2 = this.credentialRetryDelay(credentialAttempt++);
72435
+ this.log.error(`machine key rejected by the server (status 401${err.code ? `, code ${err.code}` : ""}): ${err.message}. Retrying in ${Math.round(delay2 / 1e3)}s. ${MACHINE_KEY_RECOVERY}`);
72436
+ if (!await sleepCancellable(delay2, signal))
72437
+ return false;
72438
+ continue;
72420
72439
  }
72421
72440
  if (this.config.bootstrapBackoffMs === 0) {
72422
72441
  this.log.error(`getMachineSelf failed: ${String(err)} (fail-fast mode)`);
@@ -73186,7 +73205,8 @@ var init_supervisor = __esm({
73186
73205
  // server may have rolled out a (new) clip_provider_url after we booted
73187
73206
  // (our ws-gateway WS never bounced to re-trigger machine.hello). Refetch
73188
73207
  // machine config; applyClipProviderState rebuilds us if the URL moved.
73189
- onPersistentFailure: () => void this.refreshMachineConfig()
73208
+ onPersistentFailure: () => void this.refreshMachineConfig(),
73209
+ rejectedRetryDelayMs: (attempt) => this.credentialRetryDelay(attempt)
73190
73210
  });
73191
73211
  this.clipProvider.connect().catch((err) => this.log.warn(`clip provider connect failed: ${String(err)}`));
73192
73212
  } else if (this.clipProvider) {
@@ -73763,6 +73783,7 @@ async function main(bootstrap2) {
73763
73783
  process.exit(1);
73764
73784
  });
73765
73785
  config.wsUrl = resolveWsUrl(config.apiUrl, config.wsUrl, config.swimlaneName);
73786
+ let restartForUpdate = false;
73766
73787
  if (updater) {
73767
73788
  const applied = await updater.checkAndApply().catch((err) => {
73768
73789
  log.warn(`boot update check failed: ${String(err)}`);
@@ -73774,11 +73795,19 @@ async function main(bootstrap2) {
73774
73795
  await telemetry.shutdown();
73775
73796
  process.exit(UPDATE_EXIT_CODE);
73776
73797
  }
73798
+ updater.setRestartHandler(() => {
73799
+ restartForUpdate = true;
73800
+ abortController.abort();
73801
+ });
73777
73802
  updater.startPeriodicCheck(config.updateIntervalMs);
73778
73803
  }
73779
73804
  await runForever(config, client, log, abortController.signal, updater, healthGate, daemonTelemetry);
73780
73805
  daemonTelemetry.stop();
73781
73806
  await telemetry.shutdown();
73807
+ if (restartForUpdate) {
73808
+ log.info("daemon update applied \u2014 exiting for service manager restart");
73809
+ process.exit(UPDATE_EXIT_CODE);
73810
+ }
73782
73811
  }
73783
73812
  async function runDaemonEntry(bootstrap2, args = process.argv.slice(2)) {
73784
73813
  try {
@@ -39,6 +39,9 @@ export interface ClipProviderOptions {
39
39
  * re-trigger machine.hello. Optional.
40
40
  */
41
41
  onPersistentFailure?: () => void;
42
+ /** Retry delay after the hub rejects registration. BYOC sets it (a rejected mck_ can
43
+ * recover); hosted pods leave it unset and stop (their lease was superseded). */
44
+ rejectedRetryDelayMs?: (attempt: number) => number;
42
45
  /**
43
46
  * Hosted-browser live-viewer handler. Set ONLY for a hosted browser pod
44
47
  * (browser-pod.ts): clip-service relays viewer commands down the
@@ -68,6 +71,7 @@ export declare class ClipProvider {
68
71
  private stopped;
69
72
  private connected;
70
73
  private reconnectAttempt;
74
+ private rejectedAttempt;
71
75
  private reconnectTimer;
72
76
  private heartbeatTimer;
73
77
  private statusUnsubscribe;
@@ -1 +1 @@
1
- {"version":3,"file":"clip-provider.d.ts","sourceRoot":"","sources":["../../src/clip-runtime/clip-provider.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAMH,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,sBAAsB,CAAC;AA6L/D,MAAM,WAAW,mBAAmB;IAClC,sDAAsD;IACtD,UAAU,EAAE,MAAM,CAAC;IACnB,6CAA6C;IAC7C,OAAO,EAAE,MAAM,CAAC;IAChB,sEAAsE;IACtE,KAAK,EAAE,MAAM,CAAC;IACd,mDAAmD;IACnD,YAAY,EAAE,MAAM,CAAC;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mB;IAS3B,OAAO,CAAC,eAAe;IAWvB,OAAO,CAAC,cAAc;CAUvB"}
@@ -15,21 +15,10 @@
15
15
  */
16
16
  import * as http2 from 'node:http2';
17
17
  import { isBrowserDependencyName } from './browser-dependency.js';
18
+ import { ENVELOPE_FLAG_TRAILER, EnvelopeDecoder, encodeEnvelope } from './connect-envelope.js';
18
19
  import { ClipCommandError } from './process.js';
19
20
  import { isViewerReadinessCommand, parseViewerDispatchDeadlineUnixMs, viewerReadinessDeadlineError, } from './viewer-command-deadline.js';
20
21
  import { viewerCommandFailure } from './viewer-command-error.js';
21
- // ---------------------------------------------------------------------------
22
- // Connect envelope helpers
23
- // ---------------------------------------------------------------------------
24
- const ENVELOPE_FLAG_DATA = 0x00;
25
- const ENVELOPE_FLAG_TRAILER = 0x02;
26
- function encodeEnvelope(msg) {
27
- const json = Buffer.from(JSON.stringify(msg), 'utf-8');
28
- const header = Buffer.alloc(5);
29
- header[0] = ENVELOPE_FLAG_DATA;
30
- header.writeUInt32BE(json.length, 1);
31
- return Buffer.concat([header, json]);
32
- }
33
22
  /**
34
23
  * Canonical key for a clip-registration set — used by flushReregister to skip a
35
24
  * re-register that would not change the hub's view. Sorted by alias so set
@@ -41,33 +30,6 @@ function registrationKey(clips) {
41
30
  const sorted = [...clips].sort((a, b) => (a.alias ?? '').localeCompare(b.alias ?? ''));
42
31
  return JSON.stringify(sorted);
43
32
  }
44
- /**
45
- * Incremental envelope decoder. Feed chunks via push(), receive decoded
46
- * messages from flush(). Handles partial reads across chunk boundaries.
47
- */
48
- class EnvelopeDecoder {
49
- buf = Buffer.alloc(0);
50
- push(chunk) {
51
- this.buf = this.buf.length === 0 ? Buffer.from(chunk) : Buffer.concat([this.buf, chunk]);
52
- }
53
- /** Drain all complete envelopes from the internal buffer. */
54
- static MAX_FRAME_LENGTH = 16 * 1024 * 1024; // 16 MiB
55
- *flush() {
56
- while (this.buf.length >= 5) {
57
- const flags = this.buf[0];
58
- const length = this.buf.readUInt32BE(1);
59
- if (length > EnvelopeDecoder.MAX_FRAME_LENGTH) {
60
- this.buf = Buffer.alloc(0);
61
- throw new Error(`envelope frame too large: ${length} bytes`);
62
- }
63
- if (this.buf.length < 5 + length)
64
- break; // incomplete frame
65
- const payload = this.buf.subarray(5, 5 + length);
66
- this.buf = Buffer.from(this.buf.subarray(5 + length));
67
- yield { flags, payload };
68
- }
69
- }
70
- }
71
33
  export class ClipProvider {
72
34
  opts;
73
35
  session = null;
@@ -75,6 +37,7 @@ export class ClipProvider {
75
37
  stopped = false;
76
38
  connected = false;
77
39
  reconnectAttempt = 0;
40
+ rejectedAttempt = 0;
78
41
  reconnectTimer = null;
79
42
  heartbeatTimer = null;
80
43
  statusUnsubscribe = null;
@@ -202,10 +165,11 @@ export class ClipProvider {
202
165
  this.clearHeartbeatTimer();
203
166
  this.scheduleReconnect();
204
167
  }
205
- scheduleReconnect() {
168
+ scheduleReconnect(delayMs) {
206
169
  if (this.stopped || this.reconnectTimer)
207
170
  return;
208
- const delay = Math.min(ClipProvider.RECONNECT_BASE_MS * Math.pow(2, this.reconnectAttempt), ClipProvider.RECONNECT_MAX_MS);
171
+ const delay = delayMs ??
172
+ Math.min(ClipProvider.RECONNECT_BASE_MS * Math.pow(2, this.reconnectAttempt), ClipProvider.RECONNECT_MAX_MS);
209
173
  this.reconnectAttempt++;
210
174
  this.opts.log.info(`[clip-provider] reconnecting in ${delay}ms (attempt ${this.reconnectAttempt})`);
211
175
  if (this.reconnectAttempt % ClipProvider.PERSISTENT_FAILURE_ATTEMPT === 0) {
@@ -384,6 +348,7 @@ export class ClipProvider {
384
348
  this.opts.log.info(`[clip-provider] registered with hub (org=${this.opts.orgId})`);
385
349
  this.connected = true;
386
350
  this.reconnectAttempt = 0;
351
+ this.rejectedAttempt = 0;
387
352
  this.startHeartbeat();
388
353
  // A manifest change that landed during the connect handshake (after the
389
354
  // initial register was sent) is flushed now that the stream is writable.
@@ -391,8 +356,16 @@ export class ClipProvider {
391
356
  }
392
357
  else {
393
358
  this.opts.log.error(`[clip-provider] registration rejected: ${reg.message}`);
394
- // Don't reconnect on rejection — likely a permanent auth error
395
- this.stopped = true;
359
+ this.connected = false;
360
+ const retryDelay = this.opts.rejectedRetryDelayMs?.(this.rejectedAttempt++);
361
+ if (retryDelay === undefined) {
362
+ this.stopped = true;
363
+ }
364
+ else {
365
+ // The pending timer also makes the rejected stream's late close a no-op.
366
+ this.clearHeartbeatTimer();
367
+ this.scheduleReconnect(retryDelay);
368
+ }
396
369
  this.closeStream();
397
370
  this.closeSession();
398
371
  }
@@ -0,0 +1,22 @@
1
+ /**
2
+ * Connect protocol envelope framing (JSON mode), shared by the ProviderStream
3
+ * (clip-provider.ts) and the execution-side hub client (hub-client.ts):
4
+ * [flags:1][length:4 big-endian][JSON payload]
5
+ * flags=0x00 data, flags=0x02 end-of-stream (trailers)
6
+ */
7
+ export declare const ENVELOPE_FLAG_TRAILER = 2;
8
+ export declare function encodeEnvelope(msg: unknown): Buffer;
9
+ /**
10
+ * Incremental envelope decoder. Feed chunks via push(), receive decoded
11
+ * messages from flush(). Handles partial reads across chunk boundaries.
12
+ */
13
+ export declare class EnvelopeDecoder {
14
+ private buf;
15
+ push(chunk: Buffer): void;
16
+ /** Drain all complete envelopes from the internal buffer. */
17
+ flush(): Generator<{
18
+ flags: number;
19
+ payload: Buffer;
20
+ }>;
21
+ }
22
+ //# sourceMappingURL=connect-envelope.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"connect-envelope.d.ts","sourceRoot":"","sources":["../../src/clip-runtime/connect-envelope.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAGH,eAAO,MAAM,qBAAqB,IAAO,CAAC;AAG1C,wBAAgB,cAAc,CAAC,GAAG,EAAE,OAAO,GAAG,MAAM,CAMnD;AAED;;;GAGG;AACH,qBAAa,eAAe;IAC1B,OAAO,CAAC,GAAG,CAAmB;IAE9B,IAAI,CAAC,KAAK,EAAE,MAAM,GAAG,IAAI;IAIzB,6DAA6D;IAC5D,KAAK,IAAI,SAAS,CAAC;QAAE,KAAK,EAAE,MAAM,CAAC;QAAC,OAAO,EAAE,MAAM,CAAA;KAAE,CAAC;CAcxD"}