@songsid/agend 2.3.0-beta.2 → 2.3.0-beta.4

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 (189) hide show
  1. package/dist/agent-whats-new.js +2 -0
  2. package/dist/agent-whats-new.js.map +1 -1
  3. package/dist/auth-api.d.ts +30 -1
  4. package/dist/auth-api.js +42 -12
  5. package/dist/auth-api.js.map +1 -1
  6. package/dist/backend/claude-code.d.ts +2 -2
  7. package/dist/backend/claude-code.js +5 -4
  8. package/dist/backend/claude-code.js.map +1 -1
  9. package/dist/backend/types.d.ts +6 -0
  10. package/dist/backend/types.js +15 -0
  11. package/dist/backend/types.js.map +1 -1
  12. package/dist/backend-availability.d.ts +120 -0
  13. package/dist/backend-availability.js +396 -0
  14. package/dist/backend-availability.js.map +1 -0
  15. package/dist/backend-command.d.ts +21 -3
  16. package/dist/backend-command.js +23 -4
  17. package/dist/backend-command.js.map +1 -1
  18. package/dist/channel/adapters/discord.d.ts +7 -0
  19. package/dist/channel/adapters/discord.js +35 -0
  20. package/dist/channel/adapters/discord.js.map +1 -1
  21. package/dist/channel/mcp-tools.js +8 -4
  22. package/dist/channel/mcp-tools.js.map +1 -1
  23. package/dist/channel/types.d.ts +6 -0
  24. package/dist/classic-channel-manager.d.ts +8 -3
  25. package/dist/classic-channel-manager.js +10 -3
  26. package/dist/classic-channel-manager.js.map +1 -1
  27. package/dist/config-validator.js +73 -2
  28. package/dist/config-validator.js.map +1 -1
  29. package/dist/delivery-outbox.js +5 -0
  30. package/dist/delivery-outbox.js.map +1 -1
  31. package/dist/fleet-context.d.ts +10 -0
  32. package/dist/fleet-manager.d.ts +238 -5
  33. package/dist/fleet-manager.js +878 -71
  34. package/dist/fleet-manager.js.map +1 -1
  35. package/dist/fleet-traffic.d.ts +38 -0
  36. package/dist/fleet-traffic.js +96 -0
  37. package/dist/fleet-traffic.js.map +1 -0
  38. package/dist/general-knowledge/skills/credential-profiles/SKILL.md +13 -5
  39. package/dist/general-knowledge/skills/multi-channel/SKILL.md +1 -1
  40. package/dist/general-knowledge/skills/web-appearance/SKILL.md +56 -11
  41. package/dist/general-knowledge/skills/web-dashboard/SKILL.md +398 -0
  42. package/dist/human-delivery-receipts.js +2 -1
  43. package/dist/human-delivery-receipts.js.map +1 -1
  44. package/dist/locale.js +48 -8
  45. package/dist/locale.js.map +1 -1
  46. package/dist/memory-hogs.d.ts +27 -0
  47. package/dist/memory-hogs.js +124 -0
  48. package/dist/memory-hogs.js.map +1 -0
  49. package/dist/outbound-handlers.d.ts +2 -0
  50. package/dist/outbound-handlers.js +40 -1
  51. package/dist/outbound-handlers.js.map +1 -1
  52. package/dist/outbound-schemas.d.ts +92 -0
  53. package/dist/outbound-schemas.js +55 -1
  54. package/dist/outbound-schemas.js.map +1 -1
  55. package/dist/public-web-gateway.js +1 -1
  56. package/dist/public-web-gateway.js.map +1 -1
  57. package/dist/public-web-link.d.ts +9 -0
  58. package/dist/public-web-link.js +8 -0
  59. package/dist/public-web-link.js.map +1 -1
  60. package/dist/quickstart-api.d.ts +10 -1
  61. package/dist/quickstart-api.js +12 -4
  62. package/dist/quickstart-api.js.map +1 -1
  63. package/dist/reply-buttons-controller.d.ts +2 -0
  64. package/dist/reply-buttons-controller.js +1 -1
  65. package/dist/reply-buttons-controller.js.map +1 -1
  66. package/dist/tmux-manager.d.ts +5 -0
  67. package/dist/tmux-manager.js +16 -0
  68. package/dist/tmux-manager.js.map +1 -1
  69. package/dist/tool-permissions.js +4 -0
  70. package/dist/tool-permissions.js.map +1 -1
  71. package/dist/topic-commands.d.ts +5 -0
  72. package/dist/topic-commands.js +16 -0
  73. package/dist/topic-commands.js.map +1 -1
  74. package/dist/types.d.ts +25 -1
  75. package/dist/ui/app-effects.js +33 -9
  76. package/dist/ui/chat-effects.js +62 -4
  77. package/dist/ui/chat-strings.js +40 -4
  78. package/dist/ui/chat-thread.js +17 -6
  79. package/dist/ui/effect-trial-panel.js +19 -16
  80. package/dist/ui/fleet-canvas-layout.js +111 -0
  81. package/dist/ui/fleet-canvas.js +489 -0
  82. package/dist/ui/fleet-org.js +27 -12
  83. package/dist/ui/fleet-traffic.js +224 -0
  84. package/dist/ui/panel-chat.js +12 -5
  85. package/dist/ui/panel-details.js +2 -1
  86. package/dist/ui/panel-fleet.js +32 -11
  87. package/dist/ui/panel-settings.js +6 -4
  88. package/dist/ui/preview.js +3 -2
  89. package/dist/ui/settings-appearance.js +34 -18
  90. package/dist/ui/settings-catalog.js +89 -0
  91. package/dist/ui/settings-dialogs.js +40 -12
  92. package/dist/ui/settings-effects.js +4 -3
  93. package/dist/ui/settings-learn.js +25 -0
  94. package/dist/ui/settings-model.js +6 -2
  95. package/dist/ui/settings-mods.js +4 -3
  96. package/dist/ui/settings-owner-effects.js +8 -8
  97. package/dist/ui/settings-strings.js +40 -38
  98. package/dist/ui/shared/app-i18n.js +2 -2
  99. package/dist/ui/shared/app-prefs.js +1 -1
  100. package/dist/ui/shared/app-shell.js +23 -1
  101. package/dist/ui/shared/app-store.js +12 -1
  102. package/dist/ui/shared/app-stream.js +2 -1
  103. package/dist/ui/shared/app.css +186 -11
  104. package/dist/ui/shared/card-strings.js +4 -0
  105. package/dist/ui/shared/effect-app-runtime.js +1 -1
  106. package/dist/ui/shared/effect-frame.js +10 -5
  107. package/dist/ui/shared/effect-geometry.js +24 -9
  108. package/dist/ui/shared/effect-policy.js +2 -1
  109. package/dist/ui/shared/effect-registry.js +71 -17
  110. package/dist/ui/shared/effect-stock-trust.js +23 -2
  111. package/dist/ui/shared/effect-trial-shadow.js +62 -0
  112. package/dist/ui/shared/effect-trial-stage.js +15 -9
  113. package/dist/ui/shared/effect-trial.css +40 -0
  114. package/dist/ui/shared/identity-card.js +75 -4
  115. package/dist/ui/shared/identity-color.js +3 -3
  116. package/dist/ui/shared/instance-nav.js +20 -4
  117. package/dist/ui/shared/panel-view.js +24 -4
  118. package/dist/ui/shared/view-strings.js +22 -0
  119. package/dist/view-api.d.ts +32 -0
  120. package/dist/view-api.js +55 -4
  121. package/dist/view-api.js.map +1 -1
  122. package/dist/web-api.d.ts +19 -4
  123. package/dist/web-api.js +178 -20
  124. package/dist/web-api.js.map +1 -1
  125. package/dist/web-appearance-policy.d.ts +4 -6
  126. package/dist/web-appearance-policy.js +5 -12
  127. package/dist/web-appearance-policy.js.map +1 -1
  128. package/dist/web-appearance-tools.js +5 -1
  129. package/dist/web-appearance-tools.js.map +1 -1
  130. package/dist/web-appearance-view.d.ts +14 -1
  131. package/dist/web-appearance-view.js +98 -10
  132. package/dist/web-appearance-view.js.map +1 -1
  133. package/dist/web-appearance.d.ts +2 -2
  134. package/dist/web-appearance.js +5 -6
  135. package/dist/web-appearance.js.map +1 -1
  136. package/dist/web-auth.js +1 -1
  137. package/dist/web-auth.js.map +1 -1
  138. package/dist/web-card.d.ts +14 -0
  139. package/dist/web-card.js +40 -6
  140. package/dist/web-card.js.map +1 -1
  141. package/dist/web-channel-echo.d.ts +7 -1
  142. package/dist/web-channel-echo.js +6 -2
  143. package/dist/web-channel-echo.js.map +1 -1
  144. package/dist/web-chat-history.d.ts +40 -0
  145. package/dist/web-chat-history.js +66 -3
  146. package/dist/web-chat-history.js.map +1 -1
  147. package/dist/web-commands.d.ts +1 -0
  148. package/dist/web-effect-tools.js +2 -3
  149. package/dist/web-effect-tools.js.map +1 -1
  150. package/dist/web-effect-trials.d.ts +2 -2
  151. package/dist/web-effect-trials.js +3 -3
  152. package/dist/web-effect-trials.js.map +1 -1
  153. package/dist/web-guest-access.d.ts +125 -0
  154. package/dist/web-guest-access.js +232 -0
  155. package/dist/web-guest-access.js.map +1 -0
  156. package/dist/web-guest-rooms.d.ts +82 -0
  157. package/dist/web-guest-rooms.js +135 -0
  158. package/dist/web-guest-rooms.js.map +1 -0
  159. package/dist/web-identity-palette.d.ts +1 -1
  160. package/dist/web-identity-palette.js +2 -2
  161. package/dist/web-identity-palette.js.map +1 -1
  162. package/dist/web-login.d.ts +47 -0
  163. package/dist/web-login.js +115 -0
  164. package/dist/web-login.js.map +1 -1
  165. package/dist/web-mod-agent.d.ts +1 -1
  166. package/dist/web-mod-agent.js +2 -4
  167. package/dist/web-mod-agent.js.map +1 -1
  168. package/dist/web-mod-store.d.ts +5 -0
  169. package/dist/web-mod-store.js +6 -0
  170. package/dist/web-mod-store.js.map +1 -1
  171. package/dist/web-prefs.d.ts +8 -0
  172. package/dist/web-prefs.js +9 -0
  173. package/dist/web-prefs.js.map +1 -1
  174. package/dist/web-preview.d.ts +6 -2
  175. package/dist/web-preview.js +4 -2
  176. package/dist/web-preview.js.map +1 -1
  177. package/dist/web-returning-device.d.ts +39 -0
  178. package/dist/web-returning-device.js +46 -5
  179. package/dist/web-returning-device.js.map +1 -1
  180. package/dist/web-session.d.ts +58 -10
  181. package/dist/web-session.js +104 -22
  182. package/dist/web-session.js.map +1 -1
  183. package/dist/web-settings-tools.d.ts +81 -0
  184. package/dist/web-settings-tools.js +257 -0
  185. package/dist/web-settings-tools.js.map +1 -0
  186. package/dist/web-theme.d.ts +2 -0
  187. package/dist/web-theme.js +10 -1
  188. package/dist/web-theme.js.map +1 -1
  189. package/package.json +1 -1
@@ -10,6 +10,7 @@ import type { FleetConfig, RawFleetConfig, InstanceConfig } from "./types.js";
10
10
  import { type DeliveryStatus, type GuildEmoji, type GuildEmojiGroup, type ResolvedStatusEmojis } from "./status-emojis.js";
11
11
  import { type RouteTarget } from "./fleet-context.js";
12
12
  import { EventLog } from "./event-log.js";
13
+ import { BackendAvailabilityStore, type AvailabilityProbes, type BackendAvailability } from "./backend-availability.js";
13
14
  import { AdapterWorld } from "./adapter-world.js";
14
15
  import { CostGuard } from "./cost-guard.js";
15
16
  import { IpcClient } from "./channel/ipc-bridge.js";
@@ -73,6 +74,8 @@ import { AppearanceTools } from "./web-appearance-tools.js";
73
74
  import { ModStore } from "./web-mod-store.js";
74
75
  import { AgentMods } from "./web-mod-agent.js";
75
76
  import { type CachedImage } from "./web-images.js";
77
+ import { WebSettingsTools } from "./web-settings-tools.js";
78
+ import { type TrafficItem } from "./fleet-traffic.js";
76
79
  import { type RawConfigPatch } from "./settings-api.js";
77
80
  import { type AgentEndpointContext } from "./agent-endpoint.js";
78
81
  import { ClassicChannelManager } from "./classic-channel-manager.js";
@@ -84,6 +87,7 @@ import { TargetQueueWorker } from "./target-queue-worker.js";
84
87
  import { resolveDeliveryWorkerMode } from "./types.js";
85
88
  import { type WebNeedsItem } from "./needs-you-hub.js";
86
89
  import { type OrgChart } from "./web-org.js";
90
+ import { type MemoryHog } from "./memory-hogs.js";
87
91
  import { type CacheReport } from "./cache-service.js";
88
92
  import { type WebCommandResult } from "./web-commands.js";
89
93
  import { type ReturningDevice } from "./web-returning-device.js";
@@ -442,6 +446,8 @@ export declare class FleetManager implements FleetContext, LifecycleContext, Arc
442
446
  /** #1306: the preview listener (health_port + 1 by default), and whether it is listening. */
443
447
  private previewListener;
444
448
  private previewListening;
449
+ /** The preview listener could not open its port: "<port>: <error code>", for the page (#2061 follow-up); null otherwise. */
450
+ private previewListenError;
445
451
  /** The ports the preview listener was started for, and the inputs it was built from (a reload compares them). */
446
452
  private previewPorts;
447
453
  private previewInputs;
@@ -460,6 +466,9 @@ export declare class FleetManager implements FleetContext, LifecycleContext, Arc
460
466
  /** Injectable only to keep the chat→CLI reload hand-off deterministic in tests. */
461
467
  private fullRestartLauncher;
462
468
  private eventLogPruneTimer;
469
+ /** #1920 §3.2: the background reads of guests' ClassicBot room membership (a minute's tick; reads only what is due). */
470
+ private guestRoomsTimer;
471
+ private guestRoomMembership;
463
472
  private outboxPruneTimer;
464
473
  private logRotateTimer;
465
474
  private discordPresenceTimer;
@@ -474,6 +483,17 @@ export declare class FleetManager implements FleetContext, LifecycleContext, Arc
474
483
  private startedAt;
475
484
  private stormOpenNotifyTimer;
476
485
  private memoryLogAt;
486
+ /**
487
+ * #2015: while host memory is elevated or critical, the processes holding the most in the fleet's service and whose
488
+ * they are (an instance, the fleet, tmux), for the pressure log, /health and the dashboard — never chat (#1712).
489
+ * Rescanned at most once a minute (async, one at a time); cleared when pressure ends.
490
+ */
491
+ private memoryTop;
492
+ private memoryTopScan;
493
+ /** The scan (a seam for tests: they give it a fake /proc). */
494
+ private memoryHogScan;
495
+ /** The fleet's own tmux session exists (only then are its panes read: a fleet that never started has none). */
496
+ private tmuxSessionEnsured;
477
497
  private memoryDebugAt;
478
498
  private memoryLogLevel;
479
499
  /** #1685: the host_memory value the last status frame carried, so a change re-sends the frame. */
@@ -574,6 +594,12 @@ export declare class FleetManager implements FleetContext, LifecycleContext, Arc
574
594
  private ownerCssStore?;
575
595
  /** #1629 r4 §3: each person's own CSS; which version is in force is their `css.active` in the web preferences. */
576
596
  get ownerCss(): OwnerCssStore;
597
+ private webSettingsToolsService?;
598
+ /**
599
+ * #2056: Settings → Web appearance for a tool (General, a coordinator, full) — the page's own stores and checks, and the
600
+ * page's announcement after a change (web-settings-tools.ts).
601
+ */
602
+ get webSettings(): WebSettingsTools;
577
603
  get webPrefs(): WebPrefsStore;
578
604
  /**
579
605
  * Read from disk on every access rather than cached at startup: `agend
@@ -603,9 +629,26 @@ export declare class FleetManager implements FleetContext, LifecycleContext, Arc
603
629
  sseHeartbeatMs: number;
604
630
  /** The dashboard's login codes. Memory only: a code that outlives the process is a code nobody can prove was not copied. */
605
631
  private webLoginCodes;
632
+ /**
633
+ * #1920 step 4: guests' codes, apart from the admins' — one per account, so no guest's `/web` withdraws another's or
634
+ * an admin's code (#2093 review), at most 32 at once. Local sign-in only for now (audience "local").
635
+ */
636
+ private webGuestLoginCodes;
637
+ /** #1920 step 4: when each account last got a guest code (monotonic) — one a minute, so `/web` is no DM flood. */
638
+ private readonly guestCodeAskedAt;
639
+ /** #2093 review: an account's guest /web in progress — one at a time, so two at once cannot both pass the minute. */
640
+ private readonly guestCodeInFlight;
641
+ /**
642
+ * #2093 review: revokes a guest /web in progress must see — every web session's (`/web revoke` from an admin) bumps
643
+ * the global count, an account's own bumps its entry — checked before the code is issued and while it is delivered.
644
+ */
645
+ private guestRevokes;
646
+ private readonly guestAccountRevokes;
606
647
  /** #1570: browsers that may ask the sign-in page for a fresh code, and how often they may. */
607
648
  private returningDevices;
608
649
  private readonly codeRequestLimiter;
650
+ /** #1920 step 4b: guests' device code requests, limited apart — guests never use up the admins' fleet-wide budget. */
651
+ private readonly guestCodeRequestLimiter;
609
652
  /**
610
653
  * Set while a Settings apply job is driving the reconcile. The reconcile
611
654
  * stays the single doer; it just says out loud what it is doing to whom, so
@@ -651,6 +694,20 @@ export declare class FleetManager implements FleetContext, LifecycleContext, Arc
651
694
  /** #1266: the choice, delivered as an ordinary inbound message from whoever made it, and shown in the web chat. */
652
695
  private deliverReplyButtonChoice;
653
696
  private ensureDeliveryOutbox;
697
+ /** #1918: cross-instance traffic, as the org canvas draws it (fleet-traffic.ts). */
698
+ private readonly trafficLog;
699
+ private trafficMemo;
700
+ /** One delivery row's traffic item, kept for the snapshot and sent to the open pages when it is news. */
701
+ private publishTraffic;
702
+ /**
703
+ * GET /ui/traffic: what is in flight now (the outbox's pending rows) and what finished in the last two minutes, at
704
+ * most TRAFFIC_SNAPSHOT_MAX items. Worked out at most once every two seconds, so the public link's polling (or any
705
+ * number of pages) costs one indexed read per two seconds. Visibility is applied as of now.
706
+ */
707
+ trafficSnapshot(): {
708
+ now: string;
709
+ items: TrafficItem[];
710
+ };
654
711
  /** Synchronous SQLite admission; the caller may acknowledge only after this returns. */
655
712
  admitDurableDelivery(input: {
656
713
  operationId: string;
@@ -704,6 +761,11 @@ export declare class FleetManager implements FleetContext, LifecycleContext, Arc
704
761
  private hostMemoryIndicator;
705
762
  /** Separate cooldown: changing measurements must not create new text-throttle keys. */
706
763
  private reportMemoryPressure;
764
+ /**
765
+ * #2015: rescan the largest processes (at most once a minute, one at a time). The first result of an episode, and
766
+ * then at most every 10 minutes, is logged with the pressure; /health and the dashboard read the latest. Never chat.
767
+ */
768
+ private refreshMemoryTop;
707
769
  /** Wire the one fleet-wide storm into notification and recovery surfaces. */
708
770
  private bindStormWindowEvents;
709
771
  /** What the gate allows while any storm window is open (see SpawnGate.pump). */
@@ -993,7 +1055,8 @@ export declare class FleetManager implements FleetContext, LifecycleContext, Arc
993
1055
  * for `instance` (#1320 part B). Per entry: the channel's own adapter, no
994
1056
  * thread, mention suppression on. Returns the number of channels posted
995
1057
  * to. Failures are per-entry warn-and-continue — a failed echo never fails
996
- * the web send. Entries without `web_echo: true` are never touched.
1058
+ * the web send. Only entries classicWebEchoOn admits are touched (#2054: unset follows web.echo_to_channel; an explicit
1059
+ * `web_echo: false` never echoes).
997
1060
  *
998
1061
  * Every copy is fenced at start time: an entry whose explicit world is
999
1062
  * gone is skipped (only legacy adapterId-less entries fall back to the
@@ -1004,6 +1067,11 @@ export declare class FleetManager implements FleetContext, LifecycleContext, Arc
1004
1067
  * already in flight may still land late — the contract permits that.
1005
1068
  */
1006
1069
  /** `sender` (#1827): the web person's name, as the room log records them ("web-user" when none). */
1070
+ /**
1071
+ * #1920 §5.2: a web message's channel copy was sent — it is now what the channel saw. Kept so (and on disk), and sent
1072
+ * to the guests' streams only: an admin's page already has it, and nothing about it changed for them.
1073
+ */
1074
+ webMessageInChannel(instance: string, messageId: string): void;
1007
1075
  sendClassicWebEcho(instance: string, text: string, sender?: string): Promise<number>;
1008
1076
  /**
1009
1077
  * #1666: a delivered web chat message starts the same cancel/progress lifecycle in the instance's topic as a platform
@@ -1359,6 +1427,20 @@ export declare class FleetManager implements FleetContext, LifecycleContext, Arc
1359
1427
  handle: string;
1360
1428
  owner: LoginCodeOwner;
1361
1429
  }, current: () => boolean): Promise<void>;
1430
+ /**
1431
+ * #1920 §5.5 (step 4b): a guest signing in through the public link — said in the General of the admin who opened it
1432
+ * (who, how many agents), awaited as an admin's public sign-in is, while that link is the open one, its opener still
1433
+ * current, and the account still an admitted guest. A failure refuses the sign-in.
1434
+ */
1435
+ confirmGuestPublicWebLogin(info: {
1436
+ label: string;
1437
+ handle: string;
1438
+ account: {
1439
+ adapterId: string;
1440
+ userId: string;
1441
+ };
1442
+ exposureId: string;
1443
+ }, current: () => boolean): Promise<void>;
1362
1444
  /** Telegram's typed command enters through the same strict owner and nonce path as Discord. */
1363
1445
  dashboardMenu(msg: InboundMessage): Promise<void>;
1364
1446
  /**
@@ -1396,6 +1478,41 @@ export declare class FleetManager implements FleetContext, LifecycleContext, Arc
1396
1478
  count: number;
1397
1479
  durable: boolean;
1398
1480
  };
1481
+ /** #1920 step 4: whether a `/web` is a guest's — guest sign-in on, and not from a fleet admin (theirs runs as before). */
1482
+ isGuestWebAsk(adapterId: string | undefined, userId: string): boolean;
1483
+ /** #1920 step 4 (auth-api): a guest code's account may still sign in — guests on, and something in its scope now. */
1484
+ guestSignInAllowed(account: {
1485
+ adapterId: string;
1486
+ userId: string;
1487
+ }): boolean;
1488
+ /**
1489
+ * #1920 §5.4: a guest's own `/web revoke` — its sessions and its outstanding code; nobody else's (an admin's revokes
1490
+ * everyone's, as before).
1491
+ */
1492
+ revokeGuestWebSessions(owner: {
1493
+ adapterId: string;
1494
+ userId: string;
1495
+ }): {
1496
+ count: number;
1497
+ durable: boolean;
1498
+ };
1499
+ /**
1500
+ * #1920 §2.3 (step 4): `/web` from someone who is not a fleet admin, while guest sign-in is on. `revoke` ends their
1501
+ * own guest sessions. Otherwise a guest code (tier guest, bound to this account) goes privately — a DM, else the
1502
+ * slash command's ephemeral answer (`replyPrivately`) — once a minute at most, and only when their scope (from what
1503
+ * they may already use in chat, rooms read at sign-in) holds something. The code itself is never posted where asked.
1504
+ * Callers ask isGuestWebAsk first (synchronously); false here too when it is not a guest's.
1505
+ */
1506
+ guestWebCommand(ask: {
1507
+ adapterId: string;
1508
+ userId: string;
1509
+ username?: string;
1510
+ arg: string;
1511
+ replyHere: (text: string) => Promise<unknown>;
1512
+ replyPrivately?: (text: string) => Promise<unknown>;
1513
+ }): Promise<boolean>;
1514
+ /** guestWebCommand's issuance, one per account at a time; a revoke made meanwhile (either kind) ends it unissued. */
1515
+ private issueGuestCode;
1399
1516
  /** #1570 (auth-api): this browser becomes a returning device of the code's owner. The cookie value, or null. */
1400
1517
  rememberReturningDevice(owner: LoginCodeOwner, input: {
1401
1518
  surface: "local" | "gateway";
@@ -1421,12 +1538,31 @@ export declare class FleetManager implements FleetContext, LifecycleContext, Arc
1421
1538
  } | {
1422
1539
  kind: "refused";
1423
1540
  }>;
1541
+ /**
1542
+ * #1920 step 4b: a guest's returning device asks for a code — a guest code for that account, by DM only, under the
1543
+ * same rules as its /web (guests on, not an admin, something in scope now; one per account and the cap; one flow per
1544
+ * account at a time; a revoke meanwhile ends it), its own limiter, and the guests' breaker. Asked through the public
1545
+ * link: only while that exposure is the open one (its code then works through it alone), as an admin's device.
1546
+ */
1547
+ private requestGuestDeviceCode;
1548
+ /** #1920 step 4b (auth-api): this browser becomes a guest's returning device. The cookie value, or null. */
1549
+ rememberGuestDevice(account: {
1550
+ adapterId: string;
1551
+ userId: string;
1552
+ }, input: {
1553
+ surface: "local" | "gateway";
1554
+ label: string;
1555
+ }): string | null;
1424
1556
  /** Called by the sign-in endpoint: a login the operator did not make should be visible to them. */
1425
1557
  onWebLogin(info: {
1426
1558
  label: string;
1427
1559
  surface: "local" | "gateway";
1428
1560
  tier: string;
1429
1561
  handle: string;
1562
+ owner?: {
1563
+ adapterId: string;
1564
+ userId: string;
1565
+ };
1430
1566
  }): void;
1431
1567
  getDashboardAccess(): {
1432
1568
  ready: boolean;
@@ -1545,7 +1681,10 @@ export declare class FleetManager implements FleetContext, LifecycleContext, Arc
1545
1681
  * reported separately because they differ by ~60x and only one of them can
1546
1682
  * show a fleet-manager leak. */
1547
1683
  memory: FleetMemory;
1548
- hostMemory: MemoryPressureSnapshot;
1684
+ hostMemory: MemoryPressureSnapshot & {
1685
+ topProcesses?: MemoryHog[];
1686
+ topProcessesAt?: string;
1687
+ };
1549
1688
  problems: string[];
1550
1689
  };
1551
1690
  /** Start the primary adapter (backward-compatible, sets this.adapter) */
@@ -1697,6 +1836,11 @@ export declare class FleetManager implements FleetContext, LifecycleContext, Arc
1697
1836
  */
1698
1837
  private inboundNoticeAdapter;
1699
1838
  private handleInboundMessageCore;
1839
+ /**
1840
+ * A person's platform message as the web chat shows it — the user's own words, as a user (#1306), in the instance's
1841
+ * history (#1565). #1920 §5.2: said in the instance's topic, General or room, so it is that channel's, by that account.
1842
+ */
1843
+ private emitPlatformInbound;
1700
1844
  /** Handle outbound tool calls from a daemon instance */
1701
1845
  /** Warn (but don't block) when rate limits are high. 30-min debounce per instance. */
1702
1846
  private rateLimitWarnedAt;
@@ -1739,6 +1883,14 @@ export declare class FleetManager implements FleetContext, LifecycleContext, Arc
1739
1883
  /** On a fleet with no chat platform, the dashboard is where an instance-health prompt is posted (#1307 item 6). */
1740
1884
  private webOnlyPromptPlace;
1741
1885
  /** Resolves when the reply is in the web chat (#1770: after its files are copied); the caller need not wait. */
1886
+ /**
1887
+ * #1920 §5.2: whether a platform send landed in the instance's own place — its ClassicBot room, or its topic in its
1888
+ * connection's group — so its channel's members saw it. Anything else (another chat, a DM, a context left from General,
1889
+ * an answer without the chat it went to) is not the channel's.
1890
+ */
1891
+ private landedInOwnChannel;
1892
+ /** #1920 §5.2 (#2085 review): a platform click's buttons are in the instance's own place — else not its channel's. */
1893
+ private clickInOwnChannel;
1742
1894
  private afterReplyRouted;
1743
1895
  /**
1744
1896
  * #1770: a reply's files as the web chat shows them. Each is copied into the instance's web-files/ and served from
@@ -2424,6 +2576,7 @@ export declare class FleetManager implements FleetContext, LifecycleContext, Arc
2424
2576
  key: string;
2425
2577
  userId: string;
2426
2578
  name: string;
2579
+ guest?: true;
2427
2580
  }): Promise<{
2428
2581
  status: 200 | 400 | 403 | 409;
2429
2582
  error?: string;
@@ -2937,8 +3090,14 @@ export declare class FleetManager implements FleetContext, LifecycleContext, Arc
2937
3090
  private pasteRawToClassicInstance;
2938
3091
  /** Resolve the backend name configured for an instance (fleet or classic). */
2939
3092
  private backendNameForInstance;
3093
+ /**
3094
+ * #2072: a catalog is the account's, so a credential profile has its own. Only claude-code's probe reads an account
3095
+ * catalog through a profile's login (its `GET /v1/models` with the profile's token); other backends' probes read the
3096
+ * process environment, so their catalog stays the backend's own.
3097
+ */
3098
+ private catalogProfile;
2940
3099
  private cliEnvPath;
2941
- /** Read the cached CLI env for a backend, or null if missing/stale/unparseable. */
3100
+ /** Read the cached CLI env for a backend (a credential profile's own, when given), or null if missing/stale/unparseable. */
2942
3101
  private readCliEnv;
2943
3102
  /** Return cached CLI versions immediately. Refresh is started after /sysinfo is sent. */
2944
3103
  getBackendCliVersionSnapshot(): BackendCliVersionSnapshot;
@@ -2969,6 +3128,11 @@ export declare class FleetManager implements FleetContext, LifecycleContext, Arc
2969
3128
  };
2970
3129
  /** Human-readable effective model, e.g. `auto (default)`. Used by /ctx. */
2971
3130
  modelDisplayForInstance(instanceName: string): string;
3131
+ /**
3132
+ * #2072: the model an instance runs is always among its choices — one its CLI's catalog does not list (an older
3133
+ * name, a custom provider's, a typed one) is shown first, marked, so the menu never hides what is running.
3134
+ */
3135
+ private withCurrentModel;
2972
3136
  private modelChoiceLabel;
2973
3137
  /** Preserve the existing cache merge rules for worker probes. */
2974
3138
  private persistCliEnvProbeResult;
@@ -3142,8 +3306,31 @@ export declare class FleetManager implements FleetContext, LifecycleContext, Arc
3142
3306
  private prospectiveCodexModel;
3143
3307
  /** #1811: whether a launch of `backend` here would pass a level: the same gate its builder applies. */
3144
3308
  private launchEffortGate;
3145
- /** Installed the way the launch finds a CLI (resolveBinary): on PATH or in a known install directory. */
3146
- private backendInstalledHere;
3309
+ /**
3310
+ * #2072: what this host can run, from the published availability snapshot (backend-availability.ts). Read only: a
3311
+ * handler never starts a probe, not even in the background — launch, the timer, and /login install or sign-in do.
3312
+ */
3313
+ backendAvailabilityRows(): BackendAvailability[];
3314
+ /**
3315
+ * #2072 part 3: the models a Settings field offers for `backend` — the cached catalog (an instance's own credential
3316
+ * profile's, when it is named and has one), claude's account catalog included. Read only: never a probe.
3317
+ */
3318
+ modelCatalogFor(backend: string, instance: string | null): import("./backend/types.js").ModelOption[];
3319
+ /**
3320
+ * #2072 (#2078 review): the snapshot as THIS instance would see it. Its sign-in on a backend is its own credential
3321
+ * profile's when it has one there — the host's default login says nothing about it. A profile's login is a file check
3322
+ * (credentialProfileLogin), no process.
3323
+ */
3324
+ backendAvailabilityFor(instanceName: string): BackendAvailability[];
3325
+ /** The probes the snapshot runs (tests replace them: no CLI, no account, no network). */
3326
+ availabilityProbes: AvailabilityProbes;
3327
+ private availabilityStore;
3328
+ private availabilityTimer;
3329
+ get backendAvailability(): BackendAvailabilityStore;
3330
+ /** A launch need not look the binary up again (a synchronous `which` on the loop) when the snapshot found it. */
3331
+ private noteAvailabilityPaths;
3332
+ /** Probe now and then every AVAILABILITY_STALE_MS; a pass that finds nothing changed starts no CLI. */
3333
+ private startAvailabilityRefresh;
3147
3334
  /** The models `/model` would offer on a backend: the cached CLI env, else (live) a bounded probe. Never throws. */
3148
3335
  private backendModelOptions;
3149
3336
  /**
@@ -3188,6 +3375,7 @@ export declare class FleetManager implements FleetContext, LifecycleContext, Arc
3188
3375
  private findClassicApprovalGeneral;
3189
3376
  /** Return a user-facing blocker without mutating ClassicBot state. */
3190
3377
  private validateClassicStart;
3378
+ /** #2072: from the published snapshot (no `which` on the loop); not checked yet counts as installed (no false alarm). */
3191
3379
  private isBackendInstalled;
3192
3380
  private getMissingBackendWarning;
3193
3381
  /** Handle Discord's required static slash choice, warning before a likely startup failure. */
@@ -3483,6 +3671,50 @@ export declare class FleetManager implements FleetContext, LifecycleContext, Arc
3483
3671
  * Only the parsed host name is logged, never the raw header.
3484
3672
  */
3485
3673
  private noteRejectedHost;
3674
+ /**
3675
+ * #1920 §3: the instances a guest session may see — derived on every request from the account's chat access, never
3676
+ * stored; nothing while `web.guests.enabled` is not true.
3677
+ * - Its connection's fleet topics and General (what it may talk to in chat): when that connection's access lets the
3678
+ * account in (AccessManager.isAllowed — allowed_users or paired). An `open` connection lets everyone in, so it gives
3679
+ * only the instances an admin named for its guests (`web.guests.open_instances`; the user's decision: least
3680
+ * privilege, as an open group has no list of people).
3681
+ * - A Telegram private ClassicBot room that is the account's own (its chat id is the user id).
3682
+ * - A ClassicBot group or guild room on its connection: only while its membership is verified (§3.2 — a "member"
3683
+ * answer read in the background, at most 15 minutes old; unknown, failed or stale hides it).
3684
+ * - Then an admin's narrowing (`web.guests.narrow`), which only takes away.
3685
+ * A fleet admin is not a guest: an admin outside the connection's access gets nothing here (admins sign in as admins).
3686
+ */
3687
+ guestScope(owner: {
3688
+ readonly adapterId: string;
3689
+ readonly userId: string;
3690
+ } | undefined): ReadonlySet<string>;
3691
+ /**
3692
+ * #1920 §3.5: a guest session still admitted — current, with something in scope. A scope that became empty (guest
3693
+ * sign-in off, the account removed from the connection's access, everything narrowed away) ends the session here,
3694
+ * so the next request and the open stream find it gone.
3695
+ */
3696
+ private guestStillAdmitted;
3697
+ /**
3698
+ * The same, with a third answer (§3.2): "pending" — nothing in scope now, but a room's membership is not read yet
3699
+ * (a restart, a room just created). The request is refused and the session kept; its read starts in the background.
3700
+ */
3701
+ private guestAdmission;
3702
+ /** #1920 §3.2: the membership answers; the read goes to the room's own connection, never waits past its deadline. */
3703
+ private guestRooms;
3704
+ /** #1920 §3.2: read this guest's rooms that are due (GuestRoomMembership.refresh says when each mode reads). */
3705
+ private refreshGuestRooms;
3706
+ /** Every account with a live guest session, one after another (the guest caps bound them); one pass at a time. */
3707
+ private refreshAllGuestRooms;
3708
+ private guestRoomsPass;
3709
+ /**
3710
+ * #1920 §3.5: guest sign-in turned off ends every guest session — checked when the configuration is read or saved
3711
+ * and when the sessions are opened, so turning it back on never revives one.
3712
+ */
3713
+ private enforceGuestSwitch;
3714
+ /** #1920 §5.2: whether this instance is the account's own Telegram private ClassicBot room (its chat id is the user id). */
3715
+ private guestOwnRoom;
3716
+ /** A private room's chat id is its one user's id (a group's is negative, so never equal); Telegram only. */
3717
+ private isOwnPrivateRoom;
3486
3718
  /** Shared handler dispatcher; gateway admission is enforced by its separate listener. */
3487
3719
  private dispatchWebHttp;
3488
3720
  private startHealthServer;
@@ -3504,6 +3736,7 @@ export declare class FleetManager implements FleetContext, LifecycleContext, Arc
3504
3736
  previewForUi(hostHeader: string | undefined, secure: boolean): PreviewAvailability & {
3505
3737
  boot: string | null;
3506
3738
  };
3739
+ private previewNotListening;
3507
3740
  /**
3508
3741
  * #1723: for one page of the public link (exposure `exposureId`, at `dashboardOrigin`): its own preview tunnel's
3509
3742
  * origin once up, "starting" until then, why it failed if it did — or a configured web.preview_origin, used instead.