@adhdev/daemon-standalone 0.8.87 → 0.8.89

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.js CHANGED
@@ -30308,8 +30308,7 @@ var require_dist2 = __commonJS({
30308
30308
  const buttons = Array.isArray(modal.buttons) ? modal.buttons : [];
30309
30309
  if (buttons.length !== 1) return false;
30310
30310
  const buttonLabel = String(buttons[0] || "").trim();
30311
- const modalText = `${modal.message || ""} ${buttonLabel}`.trim();
30312
- return looksLikeConfirmOnlyLabel(buttonLabel) || /Quick safety check|project trust|trust (?:this project|the contents of this directory|the files in this folder)|Enter to confirm/i.test(modalText);
30311
+ return looksLikeConfirmOnlyLabel(buttonLabel);
30313
30312
  }
30314
30313
  async waitForInteractivePrompt(maxWaitMs = 5e3) {
30315
30314
  const startedAt = Date.now();
@@ -30925,11 +30924,14 @@ var require_dist2 = __commonJS({
30925
30924
  }
30926
30925
  // ─── Public API (CliAdapter) ───────────────────
30927
30926
  getStatus() {
30927
+ const screenText = this.terminalScreen.getText() || "";
30928
+ const startupModal = this.startupParseGate ? this.getStartupConfirmationModal(screenText) : null;
30929
+ const effectiveStatus = this.parseErrorMessage ? "error" : startupModal ? "waiting_approval" : this.currentStatus;
30928
30930
  return {
30929
- status: this.parseErrorMessage ? "error" : this.currentStatus,
30931
+ status: effectiveStatus,
30930
30932
  messages: [...this.committedMessages],
30931
30933
  workingDir: this.workingDir,
30932
- activeModal: this.activeModal,
30934
+ activeModal: startupModal || this.activeModal,
30933
30935
  errorMessage: this.parseErrorMessage || void 0,
30934
30936
  errorReason: this.parseErrorMessage ? "parse_error" : void 0
30935
30937
  };
@@ -30982,8 +30984,38 @@ var require_dist2 = __commonJS({
30982
30984
  index: typeof message.index === "number" ? message.index : index,
30983
30985
  receivedAt: typeof message.receivedAt === "number" ? message.receivedAt : message.timestamp
30984
30986
  }));
30985
- const shouldPreferCommittedHistoryReplay = !this.currentTurnScope && !this.activeModal && committedHydratedMessages.length > parsedHydratedMessages.length;
30986
- const hydratedMessages = shouldPreferCommittedMessages || shouldPreferCommittedHistoryReplay ? committedHydratedMessages : parsedHydratedMessages;
30987
+ const parsedLastAssistant = [...parsedHydratedMessages].reverse().find((message) => message.role === "assistant" && typeof message.content === "string" && message.content.trim());
30988
+ const visibleIdlePrompt = this.looksLikeVisibleIdlePrompt(screenText);
30989
+ const shouldAdoptParsedIdleReplay = !this.currentTurnScope && !this.activeModal && !!parsedLastAssistant && parsedHydratedMessages.length > committedHydratedMessages.length && (this.currentStatus === "idle" || this.currentStatus === "generating" && this.isWaitingForResponse && parsed.status === "idle" && visibleIdlePrompt);
30990
+ if (shouldAdoptParsedIdleReplay) {
30991
+ this.committedMessages = normalizeCliParsedMessages(parsed.messages, {
30992
+ committedMessages: this.committedMessages,
30993
+ scope: this.currentTurnScope,
30994
+ lastOutputAt: this.lastOutputAt
30995
+ });
30996
+ this.syncMessageViews();
30997
+ if (this.currentStatus !== "idle" || this.isWaitingForResponse) {
30998
+ this.responseBuffer = "";
30999
+ this.isWaitingForResponse = false;
31000
+ this.responseSettleIgnoreUntil = 0;
31001
+ this.submitRetryUsed = false;
31002
+ this.submitRetryPromptSnippet = "";
31003
+ this.finishRetryCount = 0;
31004
+ this.currentTurnScope = null;
31005
+ this.activeModal = null;
31006
+ this.setStatus("idle", "parsed_idle_replay_commit");
31007
+ this.onStatusChange?.();
31008
+ }
31009
+ }
31010
+ const effectiveCommittedHydratedMessages = shouldAdoptParsedIdleReplay ? this.committedMessages.map((message, index) => buildChatMessage({
31011
+ ...message,
31012
+ id: message.id || `msg_${index}`,
31013
+ index: typeof message.index === "number" ? message.index : index,
31014
+ receivedAt: typeof message.receivedAt === "number" ? message.receivedAt : message.timestamp
31015
+ })) : committedHydratedMessages;
31016
+ const shouldPreferCommittedHistoryReplay = !this.currentTurnScope && !this.activeModal && effectiveCommittedHydratedMessages.length > parsedHydratedMessages.length;
31017
+ const shouldPreferCommittedIdleReplay = shouldPreferCommittedMessages && !shouldAdoptParsedIdleReplay;
31018
+ const hydratedMessages = shouldPreferCommittedIdleReplay || shouldPreferCommittedHistoryReplay ? effectiveCommittedHydratedMessages : parsedHydratedMessages;
30987
31019
  result = {
30988
31020
  id: parsed.id || "cli_session",
30989
31021
  status: parsed.status || this.currentStatus,
@@ -31584,8 +31616,9 @@ ${data.message || ""}`.trim();
31584
31616
  this.ptyProcess?.write(data);
31585
31617
  }
31586
31618
  resolveModal(buttonIndex) {
31587
- if (!this.ptyProcess || this.currentStatus !== "waiting_approval" && !this.activeModal) return;
31588
- const modal = this.activeModal;
31619
+ const screenText = this.terminalScreen.getText() || "";
31620
+ const modal = this.activeModal || this.getStartupConfirmationModal(screenText);
31621
+ if (!this.ptyProcess || this.currentStatus !== "waiting_approval" && !modal) return;
31589
31622
  this.clearIdleFinishCandidate("resolve_modal");
31590
31623
  this.recordTrace("resolve_modal", {
31591
31624
  buttonIndex,
@@ -31600,7 +31633,10 @@ ${data.message || ""}`.trim();
31600
31633
  }
31601
31634
  this.setStatus("generating", "approval_resolved");
31602
31635
  this.onStatusChange?.();
31603
- if (this.shouldResolveModalWithEnter(modal, buttonIndex)) {
31636
+ const startupTrustModal = /Quick safety check|project trust|trust (?:this project|the contents of this directory|the files in this folder)/i.test(String(modal?.message || ""));
31637
+ if (startupTrustModal && buttonIndex in this.approvalKeys) {
31638
+ this.ptyProcess.write(`${this.approvalKeys[buttonIndex]}\r`);
31639
+ } else if (this.shouldResolveModalWithEnter(modal, buttonIndex)) {
31604
31640
  this.ptyProcess.write("\r");
31605
31641
  } else if (buttonIndex in this.approvalKeys) {
31606
31642
  this.ptyProcess.write(this.approvalKeys[buttonIndex]);
@@ -31621,20 +31657,24 @@ ${data.message || ""}`.trim();
31621
31657
  }
31622
31658
  }
31623
31659
  getDebugState() {
31660
+ const screenText = sanitizeTerminalText(this.terminalScreen.getText());
31661
+ const startupModal = this.startupParseGate ? this.getStartupConfirmationModal(screenText) : null;
31662
+ const effectiveStatus = startupModal ? "waiting_approval" : this.currentStatus;
31663
+ const effectiveReady = this.ready || !!startupModal;
31624
31664
  return {
31625
31665
  type: this.cliType,
31626
31666
  name: this.cliName,
31627
31667
  providerResolution: this.providerResolutionMeta,
31628
- status: this.currentStatus,
31629
- ready: this.ready,
31668
+ status: effectiveStatus,
31669
+ ready: effectiveReady,
31630
31670
  startupParseGate: this.startupParseGate,
31631
31671
  spawnAt: this.spawnAt,
31632
31672
  workingDir: this.workingDir,
31633
- messages: this.messages.slice(-20),
31634
- committedMessages: this.committedMessages.slice(-20),
31635
- structuredMessages: this.structuredMessages.slice(-20),
31673
+ messages: this.messages,
31674
+ committedMessages: this.committedMessages,
31675
+ structuredMessages: this.structuredMessages,
31636
31676
  messageCount: this.committedMessages.length,
31637
- screenText: sanitizeTerminalText(this.terminalScreen.getText()).slice(-4e3),
31677
+ screenText: screenText.slice(-4e3),
31638
31678
  currentTurnScope: this.currentTurnScope,
31639
31679
  startupBuffer: this.startupBuffer.slice(-4e3),
31640
31680
  recentOutputBuffer: this.recentOutputBuffer.slice(-500),
@@ -31649,7 +31689,7 @@ ${data.message || ""}`.trim();
31649
31689
  lastScreenChangeAt: this.lastScreenChangeAt,
31650
31690
  lastScreenSnapshot: this.lastScreenSnapshot.slice(-500),
31651
31691
  isWaitingForResponse: this.isWaitingForResponse,
31652
- activeModal: this.activeModal,
31692
+ activeModal: startupModal || this.activeModal,
31653
31693
  lastApprovalResolvedAt: this.lastApprovalResolvedAt,
31654
31694
  sendDelayMs: this.sendDelayMs,
31655
31695
  sendKey: this.sendKey,
@@ -31699,10 +31739,19 @@ ${data.message || ""}`.trim();
31699
31739
  CliProviderInstance: () => CliProviderInstance,
31700
31740
  DAEMON_WS_PATH: () => DAEMON_WS_PATH,
31701
31741
  DEFAULT_ACTIVE_CHAT_POLL_STATUSES: () => DEFAULT_ACTIVE_CHAT_POLL_STATUSES,
31742
+ DEFAULT_CDP_DISCOVERY_INTERVAL_MS: () => DEFAULT_CDP_DISCOVERY_INTERVAL_MS,
31743
+ DEFAULT_CDP_SCAN_INTERVAL_MS: () => DEFAULT_CDP_SCAN_INTERVAL_MS,
31702
31744
  DEFAULT_CHAT_TAIL_RECENT_MESSAGE_GRACE_MS: () => DEFAULT_CHAT_TAIL_RECENT_MESSAGE_GRACE_MS,
31703
31745
  DEFAULT_DAEMON_PORT: () => DEFAULT_DAEMON_PORT,
31746
+ DEFAULT_MACHINE_RUNTIME_SUBSCRIPTION_INTERVAL_MS: () => DEFAULT_MACHINE_RUNTIME_SUBSCRIPTION_INTERVAL_MS2,
31704
31747
  DEFAULT_SESSION_HOST_APP_NAME: () => DEFAULT_SESSION_HOST_APP_NAME,
31748
+ DEFAULT_SESSION_HOST_DIAGNOSTICS_SUBSCRIPTION_INTERVAL_MS: () => DEFAULT_SESSION_HOST_DIAGNOSTICS_SUBSCRIPTION_INTERVAL_MS2,
31749
+ DEFAULT_SESSION_HOST_READY_TIMEOUT_MS: () => DEFAULT_SESSION_HOST_READY_TIMEOUT_MS2,
31705
31750
  DEFAULT_STANDALONE_SESSION_HOST_APP_NAME: () => DEFAULT_STANDALONE_SESSION_HOST_APP_NAME,
31751
+ DEFAULT_STATUS_INITIAL_REPORT_DELAY_MS: () => DEFAULT_STATUS_INITIAL_REPORT_DELAY_MS,
31752
+ DEFAULT_STATUS_P2P_REPORT_INTERVAL_MS: () => DEFAULT_STATUS_P2P_REPORT_INTERVAL_MS,
31753
+ DEFAULT_STATUS_SERVER_REPORT_INTERVAL_MS: () => DEFAULT_STATUS_SERVER_REPORT_INTERVAL_MS,
31754
+ DEV_SERVER_PORT: () => DEV_SERVER_PORT,
31706
31755
  DaemonAgentStreamManager: () => DaemonAgentStreamManager,
31707
31756
  DaemonCdpInitializer: () => DaemonCdpInitializer,
31708
31757
  DaemonCdpManager: () => DaemonCdpManager,
@@ -31714,10 +31763,13 @@ ${data.message || ""}`.trim();
31714
31763
  DevServer: () => DevServer,
31715
31764
  IdeProviderInstance: () => IdeProviderInstance,
31716
31765
  LOG: () => LOG2,
31766
+ MIN_MACHINE_RUNTIME_SUBSCRIPTION_INTERVAL_MS: () => MIN_MACHINE_RUNTIME_SUBSCRIPTION_INTERVAL_MS2,
31767
+ MIN_SESSION_HOST_DIAGNOSTICS_SUBSCRIPTION_INTERVAL_MS: () => MIN_SESSION_HOST_DIAGNOSTICS_SUBSCRIPTION_INTERVAL_MS2,
31717
31768
  NodePtyTransportFactory: () => NodePtyTransportFactory,
31718
31769
  ProviderCliAdapter: () => ProviderCliAdapter,
31719
31770
  ProviderInstanceManager: () => ProviderInstanceManager,
31720
31771
  ProviderLoader: () => ProviderLoader,
31772
+ STANDALONE_CDP_SCAN_INTERVAL_MS: () => STANDALONE_CDP_SCAN_INTERVAL_MS2,
31721
31773
  SessionHostPtyTransportFactory: () => SessionHostPtyTransportFactory2,
31722
31774
  VersionArchive: () => VersionArchive,
31723
31775
  appendRecentActivity: () => appendRecentActivity,
@@ -36520,6 +36572,17 @@ ${effect.notification.body || ""}`.trim();
36520
36572
  }
36521
36573
  }
36522
36574
  init_logger();
36575
+ var DEFAULT_CDP_SCAN_INTERVAL_MS = 3e4;
36576
+ var DEFAULT_CDP_DISCOVERY_INTERVAL_MS = 3e4;
36577
+ var DEFAULT_STATUS_INITIAL_REPORT_DELAY_MS = 2e3;
36578
+ var DEFAULT_STATUS_SERVER_REPORT_INTERVAL_MS = 3e4;
36579
+ var DEFAULT_STATUS_P2P_REPORT_INTERVAL_MS = 5e3;
36580
+ var MIN_MACHINE_RUNTIME_SUBSCRIPTION_INTERVAL_MS2 = 5e3;
36581
+ var DEFAULT_MACHINE_RUNTIME_SUBSCRIPTION_INTERVAL_MS2 = 15e3;
36582
+ var MIN_SESSION_HOST_DIAGNOSTICS_SUBSCRIPTION_INTERVAL_MS2 = 5e3;
36583
+ var DEFAULT_SESSION_HOST_DIAGNOSTICS_SUBSCRIPTION_INTERVAL_MS2 = 1e4;
36584
+ var DEFAULT_SESSION_HOST_READY_TIMEOUT_MS2 = 15e3;
36585
+ var STANDALONE_CDP_SCAN_INTERVAL_MS2 = 15e3;
36523
36586
  var DaemonCdpScanner = class {
36524
36587
  ctx;
36525
36588
  opts;
@@ -36553,7 +36616,7 @@ ${effect.notification.body || ""}`.trim();
36553
36616
  */
36554
36617
  startPeriodicScan() {
36555
36618
  if (this.scanTimer) return;
36556
- const interval = this.opts.scanIntervalMs || 3e4;
36619
+ const interval = this.opts.scanIntervalMs || DEFAULT_CDP_SCAN_INTERVAL_MS;
36557
36620
  this.scanTimer = setInterval(async () => {
36558
36621
  const portMap = this.ctx.providerLoader.getCdpPortMap();
36559
36622
  for (const [ide, ports] of Object.entries(portMap)) {
@@ -36573,7 +36636,7 @@ ${effect.notification.body || ""}`.trim();
36573
36636
  /**
36574
36637
  * Start periodic agent webview discovery on all connected CDPs.
36575
36638
  */
36576
- startWebviewDiscovery(intervalMs = 3e4) {
36639
+ startWebviewDiscovery(intervalMs = DEFAULT_CDP_DISCOVERY_INTERVAL_MS) {
36577
36640
  if (this.discoveryTimer) return;
36578
36641
  this.discoveryTimer = setInterval(async () => {
36579
36642
  for (const m of this.ctx.cdpManagers.values()) {
@@ -36793,7 +36856,7 @@ ${effect.notification.body || ""}`.trim();
36793
36856
  * Start periodic scanning for newly opened IDEs.
36794
36857
  * Idempotent — ignored if already started.
36795
36858
  */
36796
- startPeriodicScan(intervalMs = 3e4) {
36859
+ startPeriodicScan(intervalMs = DEFAULT_CDP_SCAN_INTERVAL_MS) {
36797
36860
  if (this.scanTimer) return;
36798
36861
  this.scanTimer = setInterval(async () => {
36799
36862
  const { providerLoader, cdpManagers } = this.config;
@@ -36807,7 +36870,7 @@ ${effect.notification.body || ""}`.trim();
36807
36870
  /**
36808
36871
  * Start periodic agent webview discovery.
36809
36872
  */
36810
- startDiscovery(intervalMs = 3e4) {
36873
+ startDiscovery(intervalMs = DEFAULT_CDP_DISCOVERY_INTERVAL_MS) {
36811
36874
  if (this.discoveryTimer) return;
36812
36875
  this.discoveryTimer = setInterval(async () => {
36813
36876
  for (const m of this.config.cdpManagers.values()) {
@@ -45935,19 +45998,19 @@ Run 'adhdev doctor' for detailed diagnostics.`
45935
45998
  startReporting() {
45936
45999
  setTimeout(() => {
45937
46000
  this.sendUnifiedStatusReport({ forceServer: true, reason: "initial" }).catch((e) => LOG2.warn("Status", `Initial report failed: ${e?.message}`));
45938
- }, 2e3);
46001
+ }, DEFAULT_STATUS_INITIAL_REPORT_DELAY_MS);
45939
46002
  const scheduleServerReport = () => {
45940
46003
  this.statusTimer = setTimeout(() => {
45941
46004
  this.sendUnifiedStatusReport({ forceServer: true, reason: "periodic" }).catch((e) => LOG2.warn("Status", `Periodic report failed: ${e?.message}`));
45942
46005
  scheduleServerReport();
45943
- }, 3e4);
46006
+ }, DEFAULT_STATUS_SERVER_REPORT_INTERVAL_MS);
45944
46007
  };
45945
46008
  scheduleServerReport();
45946
46009
  this.p2pTimer = setInterval(() => {
45947
46010
  if (this.deps.p2p?.isConnected) {
45948
46011
  this.sendUnifiedStatusReport({ p2pOnly: true }).catch((e) => LOG2.warn("Status", `P2P status send failed: ${e?.message}`));
45949
46012
  }
45950
- }, 5e3);
46013
+ }, DEFAULT_STATUS_P2P_REPORT_INTERVAL_MS);
45951
46014
  }
45952
46015
  stopReporting() {
45953
46016
  if (this.statusTimer) {
@@ -45965,14 +46028,14 @@ Run 'adhdev doctor' for detailed diagnostics.`
45965
46028
  throttledReport() {
45966
46029
  const now = Date.now();
45967
46030
  const elapsed = now - this.lastStatusSentAt;
45968
- if (elapsed >= 5e3) {
46031
+ if (elapsed >= DEFAULT_STATUS_P2P_REPORT_INTERVAL_MS) {
45969
46032
  this.sendUnifiedStatusReport().catch((e) => LOG2.warn("Status", `Throttled report failed: ${e?.message}`));
45970
46033
  } else if (!this.statusPendingThrottle) {
45971
46034
  this.statusPendingThrottle = true;
45972
46035
  setTimeout(() => {
45973
46036
  this.statusPendingThrottle = false;
45974
46037
  this.sendUnifiedStatusReport().catch((e) => LOG2.warn("Status", `Deferred report failed: ${e?.message}`));
45975
- }, 5e3 - elapsed);
46038
+ }, DEFAULT_STATUS_P2P_REPORT_INTERVAL_MS - elapsed);
45976
46039
  }
45977
46040
  }
45978
46041
  toDaemonStatusEventName(value) {
@@ -53183,7 +53246,7 @@ data: ${JSON.stringify(msg.data)}
53183
53246
  return resolveSessionHostAppNameResolution2(options).appName;
53184
53247
  }
53185
53248
  var import_session_host_core32 = require_dist();
53186
- var STARTUP_TIMEOUT_MS = 8e3;
53249
+ var STARTUP_TIMEOUT_MS = DEFAULT_SESSION_HOST_READY_TIMEOUT_MS2;
53187
53250
  var STARTUP_POLL_MS = 200;
53188
53251
  async function canConnect(endpoint) {
53189
53252
  const client = new import_session_host_core32.SessionHostClient({ endpoint });
@@ -53591,8 +53654,8 @@ data: ${JSON.stringify(msg.data)}
53591
53654
  }
53592
53655
  });
53593
53656
  await cdpInitializer.connectAll(detectedIdesRef.value);
53594
- cdpInitializer.startPeriodicScan(config2.cdpScanIntervalMs ?? 3e4);
53595
- cdpInitializer.startDiscovery(3e4);
53657
+ cdpInitializer.startPeriodicScan(config2.cdpScanIntervalMs ?? DEFAULT_CDP_SCAN_INTERVAL_MS);
53658
+ cdpInitializer.startDiscovery(DEFAULT_CDP_DISCOVERY_INTERVAL_MS);
53596
53659
  const commandHandler = new DaemonCommandHandler({
53597
53660
  cdpManagers,
53598
53661
  ideType: "unknown",
@@ -53806,9 +53869,19 @@ var fs3 = __toESM(require("fs"));
53806
53869
  var os2 = __toESM(require("os"));
53807
53870
  var path2 = __toESM(require("path"));
53808
53871
  var import_daemon_core = __toESM(require_dist2());
53872
+
53873
+ // ../daemon-core/src/runtime-defaults.ts
53874
+ var MIN_MACHINE_RUNTIME_SUBSCRIPTION_INTERVAL_MS = 5e3;
53875
+ var DEFAULT_MACHINE_RUNTIME_SUBSCRIPTION_INTERVAL_MS = 15e3;
53876
+ var MIN_SESSION_HOST_DIAGNOSTICS_SUBSCRIPTION_INTERVAL_MS = 5e3;
53877
+ var DEFAULT_SESSION_HOST_DIAGNOSTICS_SUBSCRIPTION_INTERVAL_MS = 1e4;
53878
+ var DEFAULT_SESSION_HOST_READY_TIMEOUT_MS = 15e3;
53879
+ var STANDALONE_CDP_SCAN_INTERVAL_MS = 15e3;
53880
+
53881
+ // src/session-host.ts
53809
53882
  var SESSION_HOST_APP_NAME_RESOLUTION = (0, import_daemon_core.resolveSessionHostAppNameResolution)({ standalone: true });
53810
53883
  var SESSION_HOST_APP_NAME = SESSION_HOST_APP_NAME_RESOLUTION.appName;
53811
- var SESSION_HOST_START_TIMEOUT_MS = 15e3;
53884
+ var SESSION_HOST_START_TIMEOUT_MS = DEFAULT_SESSION_HOST_READY_TIMEOUT_MS;
53812
53885
  function getStandaloneSessionHostAppName() {
53813
53886
  return SESSION_HOST_APP_NAME;
53814
53887
  }
@@ -54703,7 +54776,7 @@ var StandaloneServer = class {
54703
54776
  this.scheduleBroadcastStatus();
54704
54777
  },
54705
54778
  tickIntervalMs: 3e3,
54706
- cdpScanIntervalMs: 15e3
54779
+ cdpScanIntervalMs: STANDALONE_CDP_SCAN_INTERVAL_MS
54707
54780
  });
54708
54781
  if (shouldAutoRestoreHostedSessionsOnStartup(process.env)) {
54709
54782
  await this.components.cliManager.restoreHostedSessions();
@@ -55467,7 +55540,10 @@ var StandaloneServer = class {
55467
55540
  }
55468
55541
  }
55469
55542
  buildMachineRuntimeUpdate(state, key) {
55470
- const intervalMs = Math.max(5e3, Number(state.request.params.intervalMs || 15e3));
55543
+ const intervalMs = Math.max(
55544
+ MIN_MACHINE_RUNTIME_SUBSCRIPTION_INTERVAL_MS,
55545
+ Number(state.request.params.intervalMs || DEFAULT_MACHINE_RUNTIME_SUBSCRIPTION_INTERVAL_MS)
55546
+ );
55471
55547
  const now = Date.now();
55472
55548
  if (state.lastSentAt > 0 && now - state.lastSentAt < intervalMs) {
55473
55549
  return null;
@@ -55497,7 +55573,10 @@ var StandaloneServer = class {
55497
55573
  }
55498
55574
  async buildSessionHostDiagnosticsUpdate(state, key) {
55499
55575
  if (!this.sessionHostControl) return null;
55500
- const intervalMs = Math.max(5e3, Number(state.request.params.intervalMs || 1e4));
55576
+ const intervalMs = Math.max(
55577
+ MIN_SESSION_HOST_DIAGNOSTICS_SUBSCRIPTION_INTERVAL_MS,
55578
+ Number(state.request.params.intervalMs || DEFAULT_SESSION_HOST_DIAGNOSTICS_SUBSCRIPTION_INTERVAL_MS)
55579
+ );
55501
55580
  const now = Date.now();
55502
55581
  if (state.lastSentAt > 0 && now - state.lastSentAt < intervalMs) {
55503
55582
  return null;