@songsid/agend 2.4.0-beta.16 → 2.4.0-beta.17

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 (112) hide show
  1. package/dist/auth-api.js +2 -0
  2. package/dist/auth-api.js.map +1 -1
  3. package/dist/backend/claude-code.d.ts +10 -1
  4. package/dist/backend/claude-code.js +1 -0
  5. package/dist/backend/claude-code.js.map +1 -1
  6. package/dist/backend/types.d.ts +6 -0
  7. package/dist/backend/types.js.map +1 -1
  8. package/dist/build-provenance.json +1 -1
  9. package/dist/claude-credential-launch.d.ts +1 -0
  10. package/dist/claude-credential-launch.js +13 -2
  11. package/dist/claude-credential-launch.js.map +1 -1
  12. package/dist/claude-credential-vault.d.ts +7 -1
  13. package/dist/claude-credential-vault.js +26 -1
  14. package/dist/claude-credential-vault.js.map +1 -1
  15. package/dist/claude-request-observation.d.ts +7 -0
  16. package/dist/claude-request-observation.js +26 -0
  17. package/dist/claude-request-observation.js.map +1 -0
  18. package/dist/cli-audited.js +8 -6
  19. package/dist/cli-audited.js.map +1 -1
  20. package/dist/daemon.js +6 -0
  21. package/dist/daemon.js.map +1 -1
  22. package/dist/fleet-manager.d.ts +14 -0
  23. package/dist/fleet-manager.js +128 -3
  24. package/dist/fleet-manager.js.map +1 -1
  25. package/dist/general-knowledge/skills/web-dashboard/SKILL.md +9 -3
  26. package/dist/host-monitoring-config.d.ts +2 -1
  27. package/dist/host-monitoring-config.js +8 -3
  28. package/dist/host-monitoring-config.js.map +1 -1
  29. package/dist/host-monitoring-history-files.d.ts +2 -0
  30. package/dist/host-monitoring-history-files.js +16 -0
  31. package/dist/host-monitoring-history-files.js.map +1 -0
  32. package/dist/host-monitoring-history-policy.d.ts +55 -0
  33. package/dist/host-monitoring-history-policy.js +93 -0
  34. package/dist/host-monitoring-history-policy.js.map +1 -0
  35. package/dist/host-monitoring-history-store.d.ts +52 -0
  36. package/dist/host-monitoring-history-store.js +176 -0
  37. package/dist/host-monitoring-history-store.js.map +1 -0
  38. package/dist/host-monitoring-history-worker.d.ts +1 -0
  39. package/dist/host-monitoring-history-worker.js +50 -0
  40. package/dist/host-monitoring-history-worker.js.map +1 -0
  41. package/dist/host-monitoring-history.d.ts +71 -0
  42. package/dist/host-monitoring-history.js +265 -0
  43. package/dist/host-monitoring-history.js.map +1 -0
  44. package/dist/host-monitoring-platform.d.ts +73 -0
  45. package/dist/host-monitoring-platform.js +273 -0
  46. package/dist/host-monitoring-platform.js.map +1 -0
  47. package/dist/host-monitoring-runtime.d.ts +34 -0
  48. package/dist/host-monitoring-runtime.js +80 -0
  49. package/dist/host-monitoring-runtime.js.map +1 -0
  50. package/dist/host-monitoring-settings-store.d.ts +5 -0
  51. package/dist/host-monitoring-settings-store.js +49 -0
  52. package/dist/host-monitoring-settings-store.js.map +1 -0
  53. package/dist/host-monitoring.d.ts +106 -0
  54. package/dist/host-monitoring.js +157 -0
  55. package/dist/host-monitoring.js.map +1 -0
  56. package/dist/public-web-gateway.js +4 -0
  57. package/dist/public-web-gateway.js.map +1 -1
  58. package/dist/runtime-cli-install.js +17 -16
  59. package/dist/runtime-cli-install.js.map +1 -1
  60. package/dist/settings-api.d.ts +3 -0
  61. package/dist/settings-api.js +14 -7
  62. package/dist/settings-api.js.map +1 -1
  63. package/dist/settings-baseline.d.ts +1 -0
  64. package/dist/settings-baseline.js +5 -4
  65. package/dist/settings-baseline.js.map +1 -1
  66. package/dist/settings-change.js +8 -0
  67. package/dist/settings-change.js.map +1 -1
  68. package/dist/settings-effect.d.ts +2 -0
  69. package/dist/settings-effect.js +5 -3
  70. package/dist/settings-effect.js.map +1 -1
  71. package/dist/transcript-monitor.d.ts +1 -0
  72. package/dist/transcript-monitor.js +18 -0
  73. package/dist/transcript-monitor.js.map +1 -1
  74. package/dist/ui/accounts-view.js +7 -5
  75. package/dist/ui/claude-credentials.js +12 -1
  76. package/dist/ui/fleet-office-pack.js +2 -2
  77. package/dist/ui/fleet-office-play.js +142 -3
  78. package/dist/ui/fleet-office-skin.js +67 -2
  79. package/dist/ui/fleet-office-store.js +41 -0
  80. package/dist/ui/fleet-office-zones.js +15 -8
  81. package/dist/ui/fleet-office.js +126 -21
  82. package/dist/ui/host-health-model.js +42 -0
  83. package/dist/ui/host-health.js +74 -0
  84. package/dist/ui/panel-chat.js +99 -43
  85. package/dist/ui/panel-fleet.js +24 -11
  86. package/dist/ui/panel-hub.js +5 -1
  87. package/dist/ui/panel-settings.js +3 -3
  88. package/dist/ui/search-dialog.js +8 -1
  89. package/dist/ui/settings-capabilities.js +2 -0
  90. package/dist/ui/settings-host-monitoring.js +31 -13
  91. package/dist/ui/settings-registry.js +4 -1
  92. package/dist/ui/shared/accounts.css +8 -4
  93. package/dist/ui/shared/agent-sheet.js +5 -2
  94. package/dist/ui/shared/app-route.js +1 -1
  95. package/dist/ui/shared/app.css +37 -0
  96. package/dist/ui/shared/app.js +1 -0
  97. package/dist/ui/shared/chat-strings.js +2 -2
  98. package/dist/ui/shared/chat-thread.js +42 -10
  99. package/dist/ui/shared/instance-nav.js +47 -5
  100. package/dist/ui/shared/jump-idle.js +36 -0
  101. package/dist/ui/shared/theme.js +6 -2
  102. package/dist/ui/shared/ui-menu.js +17 -11
  103. package/dist/web-api.d.ts +2 -0
  104. package/dist/web-api.js +54 -0
  105. package/dist/web-api.js.map +1 -1
  106. package/dist/web-chat-history.d.ts +7 -1
  107. package/dist/web-chat-history.js +19 -3
  108. package/dist/web-chat-history.js.map +1 -1
  109. package/dist/web-shell-routes.d.ts +1 -1
  110. package/dist/web-shell-routes.js +1 -1
  111. package/dist/web-shell-routes.js.map +1 -1
  112. package/package.json +1 -1
@@ -346,6 +346,15 @@ export declare class FleetManager implements FleetContext, LifecycleContext, Arc
346
346
  readonly stormWindow: StormWindow;
347
347
  readonly spawnGate: SpawnGate;
348
348
  readonly memoryPressure: MemoryPressure;
349
+ private hostMonitor;
350
+ private hostHistory;
351
+ private startHostMonitoringRuntime;
352
+ hostHistoryQuery(range: unknown, series: unknown): Promise<import('./host-monitoring-history.js').HostHistoryResult>;
353
+ hostMonitoringAvailable(): boolean;
354
+ hostHealthSnapshot(): import("./host-monitoring.js").HostHealthSnapshot;
355
+ /** Effective Settings view: the drive is intentionally outside FleetConfig/fleet.yaml. */
356
+ hostMonitoringSettings(): import('./host-monitoring-config.js').HostMonitoringConfig;
357
+ saveHostMonitoringSettings(patch: Partial<import('./host-monitoring-config.js').HostMonitoringConfig>): import('./host-monitoring-config.js').HostMonitoringConfig;
349
358
  /** Fleet-level backend reachability memory (fed by pty_error / startup panes). */
350
359
  readonly backendOutage: BackendOutageTracker;
351
360
  /** Stable for this FleetManager OS-process lifetime; Daemon objects have their own boot IDs. */
@@ -3320,6 +3329,11 @@ export declare class FleetManager implements FleetContext, LifecycleContext, Arc
3320
3329
  private landedInOwnChannel;
3321
3330
  /** #1920 §5.2 (#2085 review): a platform click's buttons are in the instance's own place — else not its channel's. */
3322
3331
  private clickInOwnChannel;
3332
+ /**
3333
+ * M-3491: the platform message id a reply to `id` uses on `adapterId`'s chat and thread — the copy there of the kept
3334
+ * web-chat message `id` names (#2281 posts) — or undefined when the chat keeps no such message or it has no copy there.
3335
+ */
3336
+ nativeReplyTo(instance: string, id: string, adapterId: string, chatId: string, threadId: string): string | undefined;
3323
3337
  captureReplyPreview(instance: string, args: Record<string, unknown>): ((result: unknown) => void) | undefined;
3324
3338
  private afterReplyRouted;
3325
3339
  /**
@@ -1,3 +1,9 @@
1
+ import { readHostMonitoringDrive, writeHostMonitoringDrive, validMonitoringDrive } from './host-monitoring-settings-store.js';
2
+ import { HostMonitoringHistory } from './host-monitoring-history.js';
3
+ import { HostMonitoringRuntime } from "./host-monitoring-runtime.js";
4
+ import { NativeHostMonitoring } from "./host-monitoring-platform.js";
5
+ import { disabledHostHealth } from "./host-monitoring.js";
6
+ import { monitoringConfig } from "./host-monitoring-config.js";
1
7
  import { ClaudeSetupTokens } from "./claude-setup-token.js";
2
8
  import { changeIdleClaudeCredential } from "./claude-credential-change.js";
3
9
  import { readClaudeCredentialSelection, claudeSubscriptionSuppressed } from "./claude-credential-launch.js";
@@ -249,7 +255,7 @@ import { createNativeWindowsInstance, updateNativeWindowsInstance } from "./nati
249
255
  import { NativeInstanceConfigEdit, parseNativeInstanceCreate } from "./native-instance-input.js";
250
256
  import { LogService, thinkingOn } from "./log-service.js";
251
257
  import { viewHistory } from "./view-history.js";
252
- import { WebChatHistory, WEB_CHAT_TEXT_MAX, isWebMessageId, newWebMessageId, webChatFrom } from "./web-chat-history.js";
258
+ import { WebChatHistory, WEB_CHAT_TEXT_MAX, isWebMessageId, newWebMessageId, webChatFrom, webChatReplyRef } from "./web-chat-history.js";
253
259
  import { WEB_ECHO_COPIES_MAX, WEB_MIRROR_TIMEOUT_MS, webReactionEmoji, webReactionProblem } from "./web-reactions.js";
254
260
  import { WebChatDiskStore, isSafeInstanceDirName } from "./web-chat-store.js";
255
261
  import { WebChatArchive } from "./web-chat-archive.js";
@@ -803,6 +809,59 @@ export class FleetManager {
803
809
  stormWindow;
804
810
  spawnGate;
805
811
  memoryPressure;
812
+ hostMonitor = null;
813
+ hostHistory = null;
814
+ startHostMonitoringRuntime() {
815
+ this.hostHistory ??= new HostMonitoringHistory({ path: join(this.dataDir, 'host-monitoring.sqlite'), unblocked: () => this.hostMonitor?.apply() });
816
+ this.hostMonitor ??= new HostMonitoringRuntime({
817
+ history: this.hostHistory,
818
+ supported: () => process.platform === "linux" || process.platform === "darwin",
819
+ drive: () => readHostMonitoringDrive(this.dataDir),
820
+ committed: () => monitoringConfig(this.fleetConfig?.monitoring),
821
+ raw: () => { if (!this.configPath)
822
+ throw Error("config unavailable"); return { monitoring: loadRawFleetConfig(this.configPath).monitoring }; },
823
+ pin: patches => this.saveFleetConfig(patches),
824
+ factory: () => new NativeHostMonitoring({ statePath: this.dataDir, memory: () => this.memoryPressure.snapshot(), wslDrive: readHostMonitoringDrive(this.dataDir) }),
825
+ });
826
+ this.hostMonitor.start();
827
+ }
828
+ hostHistoryQuery(range, series) { return this.hostHistory?.query(range, series) ?? Promise.resolve({ ok: false, reason: 'history_unavailable' }); }
829
+ hostMonitoringAvailable() { return this.hostMonitor?.available() === true; }
830
+ hostHealthSnapshot() { return this.hostMonitor?.snapshot() ?? disabledHostHealth(); }
831
+ /** Effective Settings view: the drive is intentionally outside FleetConfig/fleet.yaml. */
832
+ hostMonitoringSettings() {
833
+ const drive = readHostMonitoringDrive(this.dataDir);
834
+ return { ...monitoringConfig(this.fleetConfig?.monitoring), ...(drive ? { wsl_drive: drive } : {}) };
835
+ }
836
+ saveHostMonitoringSettings(patch) {
837
+ if (!this.fleetConfig || !this.configPath)
838
+ throw Error('fleet unavailable');
839
+ const previous = this.fleetConfig.monitoring, oldDrive = readHostMonitoringDrive(this.dataDir);
840
+ const raw = loadRawFleetConfig(this.configPath).monitoring;
841
+ const legacy = raw && Object.hasOwn(raw, 'wsl_drive');
842
+ const change = Object.hasOwn(patch, 'wsl_drive') || legacy;
843
+ const nextDrive = Object.hasOwn(patch, 'wsl_drive') ? patch.wsl_drive : legacy ? raw.wsl_drive : oldDrive;
844
+ // Sidecar first: failure cannot leave new YAML pointing at an unsaved selection.
845
+ if (change) {
846
+ if (!validMonitoringDrive(nextDrive))
847
+ throw Error('invalid_monitoring_drive');
848
+ writeHostMonitoringDrive(this.dataDir, nextDrive);
849
+ }
850
+ try {
851
+ this.fleetConfig.monitoring = monitoringConfig({ ...monitoringConfig(previous), ...patch });
852
+ this.saveFleetConfig([
853
+ ...Object.entries(this.fleetConfig.monitoring).map(([key, value]) => ({ path: ['monitoring', key], value })),
854
+ { path: ['monitoring', 'wsl_drive'], remove: true },
855
+ ]);
856
+ }
857
+ catch (error) {
858
+ this.fleetConfig.monitoring = previous;
859
+ if (change)
860
+ writeHostMonitoringDrive(this.dataDir, oldDrive ?? '');
861
+ throw error;
862
+ }
863
+ return this.hostMonitoringSettings();
864
+ }
806
865
  /** Fleet-level backend reachability memory (fed by pty_error / startup panes). */
807
866
  backendOutage = new BackendOutageTracker();
808
867
  /** Stable for this FleetManager OS-process lifetime; Daemon objects have their own boot IDs. */
@@ -4210,6 +4269,7 @@ export class FleetManager {
4210
4269
  generalLocation: input => this.previewGeneralLocation(input),
4211
4270
  hubMembership: raw => hubMembershipSettings(raw),
4212
4271
  hubPageSharing: raw => hubPageSharingSettings(raw),
4272
+ hostMonitoringAvailable: () => this.hostMonitoringAvailable(),
4213
4273
  hubPilotTrust: raw => hubPilotTrustSettings(raw, RUNNING_AGEND_VERSION),
4214
4274
  // S3c (S-55): a Hub exposure publish's confirmation summary, while a member composition is attached.
4215
4275
  hubBrowserCertificate: (input, binding) => {
@@ -6333,6 +6393,18 @@ export class FleetManager {
6333
6393
  if (this.workingStateListeners.has(daemon))
6334
6394
  return;
6335
6395
  this.workingStateListeners.add(daemon);
6396
+ daemon.on("claude_credential_request", (event) => {
6397
+ try {
6398
+ if (this.daemons.get(name) !== daemon || !sameInteractionOwner(event.owner, daemon.getInteractionSnapshot().owner) || resolvePath(event.binding.home) !== resolvePath(this.dataDir) || event.binding.kind === "subscription")
6399
+ return;
6400
+ const { binding, record } = event, kind = binding.kind;
6401
+ if (kind === "subscription")
6402
+ return;
6403
+ if (this.withClaudeVault(vault => vault.observeRequest(binding.profile, binding.id, binding.revision, kind, record)))
6404
+ broadcastSseEvent(this.sseClients, "backend_login", {}, () => { });
6405
+ }
6406
+ catch { /* Metadata observation never changes the source or interrupts work. */ }
6407
+ });
6336
6408
  daemon.on("working_state", (event) => {
6337
6409
  try {
6338
6410
  if (this.daemons.get(name) !== daemon || !sameInteractionOwner(event.observation.owner, daemon.getInteractionSnapshot().owner))
@@ -7334,6 +7406,9 @@ export class FleetManager {
7334
7406
  process.env.AGEND_FLEET_CONFIG_PATH = resolvePath(configPath);
7335
7407
  if (options.remember !== false && existsSync(configPath))
7336
7408
  history.accepted("fleet.yaml", configPath, selected);
7409
+ // The normal lossless writer owns migration; never hand-edit YAML or retain this beta.17-only key for rollback.
7410
+ if (options.startup && raw.monitoring && Object.hasOwn(raw.monitoring, 'wsl_drive'))
7411
+ this.saveFleetConfig();
7337
7412
  return this.fleetConfig;
7338
7413
  }
7339
7414
  relayLoginModeWarned = false;
@@ -9927,8 +10002,10 @@ export class FleetManager {
9927
10002
  }
9928
10003
  // CLI single-instance cold starts bypass startAll. Start diagnostics before
9929
10004
  // any lifecycle/wake work; a shutdown must not revive the stopped sampler.
9930
- if (!this.shuttingDown)
10005
+ if (!this.shuttingDown) {
9931
10006
  this.memoryPressure?.start();
10007
+ this.startHostMonitoringRuntime();
10008
+ }
9932
10009
  // Any start supersedes a pending automatic retry (it would otherwise fire
9933
10010
  // into a running instance — harmless, but noisy — or race this start).
9934
10011
  this.cancelStartupRetry(name);
@@ -12792,6 +12869,7 @@ export class FleetManager {
12792
12869
  // Must run before the first General/CLI spawn: pressure can hold startup.
12793
12870
  // Logs remain available even before the adapters and health listener exist.
12794
12871
  this.memoryPressure.start();
12872
+ this.startHostMonitoringRuntime();
12795
12873
  // #2910: a web-only fleet's agents run in topic mode too (their cross-instance tools work; the dashboard is their place).
12796
12874
  const topicMode = daemonTopicMode(fleet);
12797
12875
  // Set tmux socket isolation for custom AGEND_HOME
@@ -16205,6 +16283,14 @@ export class FleetManager {
16205
16283
  });
16206
16284
  }
16207
16285
  };
16286
+ // M-3491: a `reply_to` that names a kept web-chat message (by its web id, or a copy elsewhere) becomes that
16287
+ // message's copy on this platform, so the reply is a native reply there; an id the chat does not know is left as
16288
+ // it is (the adapter ignores one that is not its own: no quote, no error, as before).
16289
+ if (typeof args.reply_to === "string" && args.reply_to && outAdapter !== WEB_ONLY_REPLY_SINK) {
16290
+ const native = this.nativeReplyTo(instanceName, args.reply_to, outAdapter.id ?? contextAdapterId ?? "", String(args.chat_id ?? ""), String(args.thread_id ?? threadId ?? ""));
16291
+ if (native)
16292
+ args.reply_to = native;
16293
+ }
16208
16294
  if (routeToolCall(outAdapter, tool, args, threadId, respondAndRecord, { ...restrictedExtras, ...(replySet ? { replyButtons: replySet.callbacks, ...(replySet.poll ? { replyPoll: replySet.poll } : {}) } : {}) })) {
16209
16295
  return;
16210
16296
  }
@@ -16274,6 +16360,18 @@ export class FleetManager {
16274
16360
  return false;
16275
16361
  }
16276
16362
  }
16363
+ /**
16364
+ * M-3491: the platform message id a reply to `id` uses on `adapterId`'s chat and thread — the copy there of the kept
16365
+ * web-chat message `id` names (#2281 posts) — or undefined when the chat keeps no such message or it has no copy there.
16366
+ */
16367
+ nativeReplyTo(instance, id, adapterId, chatId, threadId) {
16368
+ const row = this.webChatHistory.findByReplyId(instance, id);
16369
+ if (!row || !adapterId)
16370
+ return undefined;
16371
+ const here = this.webChatHistory.postsOf(row).filter(p => p.adapterId === adapterId && p.chatId === chatId && (p.threadId ?? "") === threadId);
16372
+ // An id that already is one of its copies here (its buttons message, say) stays the one the agent named.
16373
+ return here.find(p => p.messageId === id)?.messageId ?? here[0]?.messageId;
16374
+ }
16277
16375
  captureReplyPreview(instance, args) {
16278
16376
  if (!replyPreviews(args.previews)?.length)
16279
16377
  return undefined;
@@ -16288,6 +16386,13 @@ export class FleetManager {
16288
16386
  const sent = (sentAs?.result && typeof sentAs.result === "object" ? sentAs.result : {});
16289
16387
  const post = inChannel && sentAs && typeof sent.messageId === "string" && typeof sent.chatId === "string"
16290
16388
  ? { adapterId: sentAs.adapterId, chatId: sent.chatId, ...(typeof sent.threadId === "string" && sent.threadId ? { threadId: sent.threadId } : {}), messageId: sent.messageId } : undefined;
16389
+ // M-3491: a long reply's buttons ride its last part, a message of its own: a later `reply_to` may name that one.
16390
+ const buttonsPost = post && typeof sent.buttonsMessageId === "string" && sent.buttonsMessageId && sent.buttonsMessageId !== post.messageId
16391
+ ? { ...post, messageId: sent.buttonsMessageId } : undefined;
16392
+ // M-3491: what the reply quotes in the web chat — the kept message its `reply_to` names (a web id, the id an earlier
16393
+ // reply returned, or a Discord/Telegram copy's id), taken now; an id the chat does not keep quotes nothing, as before.
16394
+ const quotedRow = typeof args.reply_to === "string" && args.reply_to ? this.webChatHistory.findByReplyId(instanceName, args.reply_to) : undefined;
16395
+ const quoted = quotedRow ? webChatReplyRef(quotedRow) : undefined;
16291
16396
  // A reply is NOT proof the turn is over (#410) — but it is not proof of
16292
16397
  // more work either. Split the difference: an instance that is clearly
16293
16398
  // idle loses the button now; one that looks busy keeps it (re-posted
@@ -16334,7 +16439,8 @@ export class FleetManager {
16334
16439
  ...(buttons ? { buttons } : {}), // #1266
16335
16440
  ...(replyPreviews(args.previews)?.length ? { previews: replyPreviews(args.previews) } : {}),
16336
16441
  ...(inChannel ? { channel: true } : {}), // #1920 §5.2
16337
- ...(post ? { posts: [post] } : {}), // #2281
16442
+ ...(post ? { posts: buttonsPost ? [post, buttonsPost] : [post] } : {}), // #2281 (M-3491: and its buttons message)
16443
+ ...(quoted ? { replyTo: quoted } : {}), // M-3491
16338
16444
  ...(typeof returned === "string" && returned ? { anchor: returned } : {}), // AGEND-181: what the reply call returned
16339
16445
  ...(reserved !== undefined ? { reserved } : {}), // #1774
16340
16446
  });
@@ -17877,6 +17983,22 @@ export class FleetManager {
17877
17983
  this.rawFleetConfig = loadRawFleetConfig(this.configPath);
17878
17984
  // #2208: what the file says before this save, aliases expanded — every write below is recorded, and anything that
17879
17985
  // changes outside them (a place sharing a node with one written) refuses the save.
17986
+ // Any save repairs a legacy drive key. A Settings transaction which already saved its sidecar supplies remove.
17987
+ const drivePath = (p) => p.path.length === 2 && p.path[0] === 'monitoring' && p.path[1] === 'wsl_drive';
17988
+ const requestedDrive = explicitPatches.find(p => drivePath(p) && !p.remove);
17989
+ const removesDrive = explicitPatches.some(p => drivePath(p) && p.remove);
17990
+ const rawMonitoring = this.rawFleetConfig.monitoring;
17991
+ const legacyDrive = rawMonitoring && Object.hasOwn(rawMonitoring, 'wsl_drive');
17992
+ if (requestedDrive || legacyDrive && !removesDrive) {
17993
+ const value = requestedDrive ? requestedDrive.value : rawMonitoring.wsl_drive;
17994
+ if (!validMonitoringDrive(value))
17995
+ throw Error('invalid_monitoring_drive');
17996
+ writeHostMonitoringDrive(this.dataDir, value);
17997
+ }
17998
+ if (this.fleetConfig.monitoring)
17999
+ this.fleetConfig.monitoring = monitoringConfig(this.fleetConfig.monitoring);
18000
+ explicitPatches = explicitPatches.filter(p => !drivePath(p));
18001
+ explicitPatches.push({ path: ['monitoring', 'wsl_drive'], remove: true });
17880
18002
  const fileBefore = this.rawFleetDocument.toJS({ maxAliasCount: -1 });
17881
18003
  const writes = this.fleetDocumentWrites = []; // a throw below leaves it to the next save
17882
18004
  this.patchFleetDocument(this.rawFleetDocument, [], this.savedFleetConfigSnapshot, this.fleetConfig);
@@ -17968,6 +18090,7 @@ export class FleetManager {
17968
18090
  this.logger.info({ path: this.configPath, strippedDefaults: redundantPaths.length }, "Saved fleet config (lossless patch)");
17969
18091
  this.observeRuntimeSwitches(); // M-2255: a saved Windows runtime switch applies now
17970
18092
  this.observeHubSwitches(); // S-51: so does a saved Hub switch
18093
+ this.hostMonitor?.apply();
17971
18094
  }
17972
18095
  /** A permission tightening is effective when its save returns, independently of the later apply job or IPC. */
17973
18096
  refreshSavedDashboardPermissions() {
@@ -29751,6 +29874,7 @@ export class FleetManager {
29751
29874
  // because we asked it to. Set synchronously — doStopAll runs to its first
29752
29875
  // await in the same tick as the signal handler, so no event can slip in.
29753
29876
  this.shuttingDown = true;
29877
+ this.hostMonitor?.stop();
29754
29878
  this.stopQuotaObserver?.();
29755
29879
  this.stopQuotaObserver = null;
29756
29880
  const quotaNoticesStopped = this.quotaNotices?.stop();
@@ -30277,6 +30401,7 @@ export class FleetManager {
30277
30401
  this.reregisterClassicChannels();
30278
30402
  this.scheduler?.reload();
30279
30403
  this.reconcilePreviewListener();
30404
+ this.hostMonitor?.apply();
30280
30405
  this.publicWebLink?.refresh();
30281
30406
  const newInstances = this.fleetConfig.instances;
30282
30407
  const topicMode = daemonTopicMode(this.fleetConfig);