@songsid/agend 2.3.0-beta.3 → 2.3.0-beta.5

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 (149) hide show
  1. package/dist/agent-file-read.d.ts +4 -1
  2. package/dist/agent-file-read.js +129 -16
  3. package/dist/agent-file-read.js.map +1 -1
  4. package/dist/auth-api.d.ts +30 -1
  5. package/dist/auth-api.js +32 -7
  6. package/dist/auth-api.js.map +1 -1
  7. package/dist/authority/web-authority.d.ts +100 -0
  8. package/dist/authority/web-authority.js +130 -0
  9. package/dist/authority/web-authority.js.map +1 -0
  10. package/dist/backend/types.d.ts +1 -0
  11. package/dist/backend/types.js +15 -0
  12. package/dist/backend/types.js.map +1 -1
  13. package/dist/backend-availability.d.ts +120 -0
  14. package/dist/backend-availability.js +396 -0
  15. package/dist/backend-availability.js.map +1 -0
  16. package/dist/backend-command.d.ts +21 -3
  17. package/dist/backend-command.js +23 -4
  18. package/dist/backend-command.js.map +1 -1
  19. package/dist/channel/adapters/discord.d.ts +7 -0
  20. package/dist/channel/adapters/discord.js +35 -0
  21. package/dist/channel/adapters/discord.js.map +1 -1
  22. package/dist/channel/mcp-tools.js +5 -5
  23. package/dist/channel/mcp-tools.js.map +1 -1
  24. package/dist/channel/types.d.ts +6 -0
  25. package/dist/config-validator.js +91 -2
  26. package/dist/config-validator.js.map +1 -1
  27. package/dist/daemon.js +5 -5
  28. package/dist/daemon.js.map +1 -1
  29. package/dist/delivery-outbox.d.ts +2 -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 +230 -6
  33. package/dist/fleet-manager.js +719 -42
  34. package/dist/fleet-manager.js.map +1 -1
  35. package/dist/general-knowledge/skills/web-appearance/SKILL.md +45 -18
  36. package/dist/general-knowledge/skills/web-dashboard/SKILL.md +7 -3
  37. package/dist/human-delivery-receipts.d.ts +10 -1
  38. package/dist/human-delivery-receipts.js +26 -9
  39. package/dist/human-delivery-receipts.js.map +1 -1
  40. package/dist/locale.js +42 -4
  41. package/dist/locale.js.map +1 -1
  42. package/dist/outbound-schemas.d.ts +7 -3
  43. package/dist/outbound-schemas.js +5 -1
  44. package/dist/outbound-schemas.js.map +1 -1
  45. package/dist/public-web-link.d.ts +9 -0
  46. package/dist/public-web-link.js +8 -0
  47. package/dist/public-web-link.js.map +1 -1
  48. package/dist/quickstart-api.d.ts +10 -1
  49. package/dist/quickstart-api.js +12 -4
  50. package/dist/quickstart-api.js.map +1 -1
  51. package/dist/reply-buttons-controller.d.ts +4 -0
  52. package/dist/reply-buttons-controller.js +2 -2
  53. package/dist/reply-buttons-controller.js.map +1 -1
  54. package/dist/settings-api.d.ts +9 -0
  55. package/dist/settings-api.js +76 -2
  56. package/dist/settings-api.js.map +1 -1
  57. package/dist/settings-change.js +66 -0
  58. package/dist/settings-change.js.map +1 -1
  59. package/dist/settings-effect.js +8 -1
  60. package/dist/settings-effect.js.map +1 -1
  61. package/dist/topic-commands.d.ts +5 -0
  62. package/dist/topic-commands.js +16 -0
  63. package/dist/topic-commands.js.map +1 -1
  64. package/dist/types.d.ts +36 -0
  65. package/dist/ui/chat-strings.js +4 -2
  66. package/dist/ui/chat-thread.js +4 -1
  67. package/dist/ui/panel-chat.js +19 -9
  68. package/dist/ui/panel-fleet.js +18 -6
  69. package/dist/ui/panel-settings.js +5 -2
  70. package/dist/ui/settings-catalog.js +92 -0
  71. package/dist/ui/settings-dialogs.js +37 -6
  72. package/dist/ui/settings-guests.js +117 -0
  73. package/dist/ui/settings-strings.js +28 -0
  74. package/dist/ui/shared/app-i18n.js +2 -0
  75. package/dist/ui/shared/app-prefs.js +3 -3
  76. package/dist/ui/shared/app-shell.js +36 -6
  77. package/dist/ui/shared/app-store.js +14 -0
  78. package/dist/ui/shared/app.css +54 -3
  79. package/dist/ui/shared/app.js +21 -14
  80. package/dist/ui/shared/card-strings.js +4 -0
  81. package/dist/ui/shared/effect-stock-trust.js +23 -2
  82. package/dist/ui/shared/identity-card.js +70 -2
  83. package/dist/ui/shared/instance-nav.js +8 -5
  84. package/dist/ui/shared/panel-view.js +22 -2
  85. package/dist/ui/shared/view-strings.js +6 -0
  86. package/dist/view-api.d.ts +11 -0
  87. package/dist/view-api.js +27 -4
  88. package/dist/view-api.js.map +1 -1
  89. package/dist/web-api.d.ts +32 -1
  90. package/dist/web-api.js +166 -28
  91. package/dist/web-api.js.map +1 -1
  92. package/dist/web-appearance-policy.d.ts +4 -6
  93. package/dist/web-appearance-policy.js +5 -12
  94. package/dist/web-appearance-policy.js.map +1 -1
  95. package/dist/web-appearance-tools.js +5 -1
  96. package/dist/web-appearance-tools.js.map +1 -1
  97. package/dist/web-appearance-view.d.ts +4 -1
  98. package/dist/web-appearance-view.js +21 -2
  99. package/dist/web-appearance-view.js.map +1 -1
  100. package/dist/web-appearance.d.ts +2 -2
  101. package/dist/web-appearance.js +5 -6
  102. package/dist/web-appearance.js.map +1 -1
  103. package/dist/web-card.d.ts +14 -0
  104. package/dist/web-card.js +40 -6
  105. package/dist/web-card.js.map +1 -1
  106. package/dist/web-channel-echo.d.ts +7 -1
  107. package/dist/web-channel-echo.js +6 -2
  108. package/dist/web-channel-echo.js.map +1 -1
  109. package/dist/web-chat-history.d.ts +40 -0
  110. package/dist/web-chat-history.js +66 -3
  111. package/dist/web-chat-history.js.map +1 -1
  112. package/dist/web-commands.d.ts +1 -0
  113. package/dist/web-effect-tools.js +2 -3
  114. package/dist/web-effect-tools.js.map +1 -1
  115. package/dist/web-effect-upload.js +1 -1
  116. package/dist/web-effect-upload.js.map +1 -1
  117. package/dist/web-guest-access.d.ts +65 -7
  118. package/dist/web-guest-access.js +124 -18
  119. package/dist/web-guest-access.js.map +1 -1
  120. package/dist/web-guest-rooms.d.ts +82 -0
  121. package/dist/web-guest-rooms.js +135 -0
  122. package/dist/web-guest-rooms.js.map +1 -0
  123. package/dist/web-identity-color.d.ts +1 -1
  124. package/dist/web-identity-color.js +2 -2
  125. package/dist/web-identity-color.js.map +1 -1
  126. package/dist/web-login.d.ts +47 -0
  127. package/dist/web-login.js +115 -0
  128. package/dist/web-login.js.map +1 -1
  129. package/dist/web-mod-agent.d.ts +1 -1
  130. package/dist/web-mod-agent.js +2 -4
  131. package/dist/web-mod-agent.js.map +1 -1
  132. package/dist/web-prefs.js +1 -1
  133. package/dist/web-prefs.js.map +1 -1
  134. package/dist/web-returning-device.d.ts +41 -0
  135. package/dist/web-returning-device.js +57 -5
  136. package/dist/web-returning-device.js.map +1 -1
  137. package/dist/web-session.d.ts +50 -3
  138. package/dist/web-session.js +96 -14
  139. package/dist/web-session.js.map +1 -1
  140. package/dist/web-settings-patch.d.ts +25 -2
  141. package/dist/web-settings-patch.js +96 -1
  142. package/dist/web-settings-patch.js.map +1 -1
  143. package/dist/web-settings-tools.d.ts +12 -0
  144. package/dist/web-settings-tools.js +10 -0
  145. package/dist/web-settings-tools.js.map +1 -1
  146. package/dist/web-theme.d.ts +2 -0
  147. package/dist/web-theme.js +10 -1
  148. package/dist/web-theme.js.map +1 -1
  149. 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";
@@ -89,6 +90,8 @@ import { type OrgChart } from "./web-org.js";
89
90
  import { type MemoryHog } from "./memory-hogs.js";
90
91
  import { type CacheReport } from "./cache-service.js";
91
92
  import { type WebCommandResult } from "./web-commands.js";
93
+ import { type SessionRecord } from "./web-session.js";
94
+ import { type HumanAuthority, type WebAuthorityResult, type WebPeer } from "./authority/web-authority.js";
92
95
  import { type ReturningDevice } from "./web-returning-device.js";
93
96
  import { type PreviewAvailability } from "./web-preview.js";
94
97
  import { type ConnectionMetadata, type ConnectionBinding, type BindingProbe, type SecretApplyJob, type ProviderSecretApplyJob } from "./connection-secrets.js";
@@ -465,6 +468,9 @@ export declare class FleetManager implements FleetContext, LifecycleContext, Arc
465
468
  /** Injectable only to keep the chat→CLI reload hand-off deterministic in tests. */
466
469
  private fullRestartLauncher;
467
470
  private eventLogPruneTimer;
471
+ /** #1920 §3.2: the background reads of guests' ClassicBot room membership (a minute's tick; reads only what is due). */
472
+ private guestRoomsTimer;
473
+ private guestRoomMembership;
468
474
  private outboxPruneTimer;
469
475
  private logRotateTimer;
470
476
  private discordPresenceTimer;
@@ -625,9 +631,26 @@ export declare class FleetManager implements FleetContext, LifecycleContext, Arc
625
631
  sseHeartbeatMs: number;
626
632
  /** The dashboard's login codes. Memory only: a code that outlives the process is a code nobody can prove was not copied. */
627
633
  private webLoginCodes;
634
+ /**
635
+ * #1920 step 4: guests' codes, apart from the admins' — one per account, so no guest's `/web` withdraws another's or
636
+ * an admin's code (#2093 review), at most 32 at once. Local sign-in only for now (audience "local").
637
+ */
638
+ private webGuestLoginCodes;
639
+ /** #1920 step 4: when each account last got a guest code (monotonic) — one a minute, so `/web` is no DM flood. */
640
+ private readonly guestCodeAskedAt;
641
+ /** #2093 review: an account's guest /web in progress — one at a time, so two at once cannot both pass the minute. */
642
+ private readonly guestCodeInFlight;
643
+ /**
644
+ * #2093 review: revokes a guest /web in progress must see — every web session's (`/web revoke` from an admin) bumps
645
+ * the global count, an account's own bumps its entry — checked before the code is issued and while it is delivered.
646
+ */
647
+ private guestRevokes;
648
+ private readonly guestAccountRevokes;
628
649
  /** #1570: browsers that may ask the sign-in page for a fresh code, and how often they may. */
629
650
  private returningDevices;
630
651
  private readonly codeRequestLimiter;
652
+ /** #1920 step 4b: guests' device code requests, limited apart — guests never use up the admins' fleet-wide budget. */
653
+ private readonly guestCodeRequestLimiter;
631
654
  /**
632
655
  * Set while a Settings apply job is driving the reconcile. The reconcile
633
656
  * stays the single doer; it just says out loud what it is doing to whom, so
@@ -1046,6 +1069,11 @@ export declare class FleetManager implements FleetContext, LifecycleContext, Arc
1046
1069
  * already in flight may still land late — the contract permits that.
1047
1070
  */
1048
1071
  /** `sender` (#1827): the web person's name, as the room log records them ("web-user" when none). */
1072
+ /**
1073
+ * #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
1074
+ * to the guests' streams only: an admin's page already has it, and nothing about it changed for them.
1075
+ */
1076
+ webMessageInChannel(instance: string, messageId: string): void;
1049
1077
  sendClassicWebEcho(instance: string, text: string, sender?: string): Promise<number>;
1050
1078
  /**
1051
1079
  * #1666: a delivered web chat message starts the same cancel/progress lifecycle in the instance's topic as a platform
@@ -1401,6 +1429,20 @@ export declare class FleetManager implements FleetContext, LifecycleContext, Arc
1401
1429
  handle: string;
1402
1430
  owner: LoginCodeOwner;
1403
1431
  }, current: () => boolean): Promise<void>;
1432
+ /**
1433
+ * #1920 §5.5 (step 4b): a guest signing in through the public link — said in the General of the admin who opened it
1434
+ * (who, how many agents), awaited as an admin's public sign-in is, while that link is the open one, its opener still
1435
+ * current, and the account still an admitted guest. A failure refuses the sign-in.
1436
+ */
1437
+ confirmGuestPublicWebLogin(info: {
1438
+ label: string;
1439
+ handle: string;
1440
+ account: {
1441
+ adapterId: string;
1442
+ userId: string;
1443
+ };
1444
+ exposureId: string;
1445
+ }, current: () => boolean): Promise<void>;
1404
1446
  /** Telegram's typed command enters through the same strict owner and nonce path as Discord. */
1405
1447
  dashboardMenu(msg: InboundMessage): Promise<void>;
1406
1448
  /**
@@ -1438,6 +1480,77 @@ export declare class FleetManager implements FleetContext, LifecycleContext, Arc
1438
1480
  count: number;
1439
1481
  durable: boolean;
1440
1482
  };
1483
+ /**
1484
+ * #1920 phase 3: Settings → Web sign-ins → Guests — the switches, each connection's access mode and the agents named for
1485
+ * an open one, and every guest account (signed in, with a returning device, or narrowed): who, its platform, what it
1486
+ * reaches now, its sessions and devices, and its narrowing. Ids are the accounts' own (an admin's page).
1487
+ */
1488
+ guestOverview(): {
1489
+ enabled: boolean;
1490
+ chat: boolean;
1491
+ instances: string[];
1492
+ connections: Array<{
1493
+ id: string;
1494
+ type: string;
1495
+ mode: "open" | "allowlist";
1496
+ named: string[];
1497
+ }>;
1498
+ guests: Array<{
1499
+ adapterId: string;
1500
+ userId: string;
1501
+ name: string;
1502
+ platform: string;
1503
+ scope: string[];
1504
+ reach: string[];
1505
+ sessions: number;
1506
+ lastSeen: number | null;
1507
+ devices: number;
1508
+ narrow: string[] | null;
1509
+ }>;
1510
+ };
1511
+ /** #1920 phase 3 (the app shell): a guest's chip — its web name, and its connection's platform (discord, telegram). */
1512
+ guestBadge(owner: {
1513
+ adapterId: string;
1514
+ userId: string;
1515
+ }): {
1516
+ name: string;
1517
+ platform: string;
1518
+ };
1519
+ /** #1920 step 4: whether a `/web` is a guest's — guest sign-in on, and not from a fleet admin (theirs runs as before). */
1520
+ isGuestWebAsk(adapterId: string | undefined, userId: string): boolean;
1521
+ /** #1920 step 4 (auth-api): a guest code's account may still sign in — guests on, and something in its scope now. */
1522
+ guestSignInAllowed(account: {
1523
+ adapterId: string;
1524
+ userId: string;
1525
+ }): boolean;
1526
+ /**
1527
+ * #1920 §5.4: a guest's own `/web revoke` — its sessions and its outstanding code; nobody else's (an admin's revokes
1528
+ * everyone's, as before).
1529
+ */
1530
+ revokeGuestWebSessions(owner: {
1531
+ adapterId: string;
1532
+ userId: string;
1533
+ }): {
1534
+ count: number;
1535
+ durable: boolean;
1536
+ };
1537
+ /**
1538
+ * #1920 §2.3 (step 4): `/web` from someone who is not a fleet admin, while guest sign-in is on. `revoke` ends their
1539
+ * own guest sessions. Otherwise a guest code (tier guest, bound to this account) goes privately — a DM, else the
1540
+ * slash command's ephemeral answer (`replyPrivately`) — once a minute at most, and only when their scope (from what
1541
+ * they may already use in chat, rooms read at sign-in) holds something. The code itself is never posted where asked.
1542
+ * Callers ask isGuestWebAsk first (synchronously); false here too when it is not a guest's.
1543
+ */
1544
+ guestWebCommand(ask: {
1545
+ adapterId: string;
1546
+ userId: string;
1547
+ username?: string;
1548
+ arg: string;
1549
+ replyHere: (text: string) => Promise<unknown>;
1550
+ replyPrivately?: (text: string) => Promise<unknown>;
1551
+ }): Promise<boolean>;
1552
+ /** guestWebCommand's issuance, one per account at a time; a revoke made meanwhile (either kind) ends it unissued. */
1553
+ private issueGuestCode;
1441
1554
  /** #1570 (auth-api): this browser becomes a returning device of the code's owner. The cookie value, or null. */
1442
1555
  rememberReturningDevice(owner: LoginCodeOwner, input: {
1443
1556
  surface: "local" | "gateway";
@@ -1463,12 +1576,31 @@ export declare class FleetManager implements FleetContext, LifecycleContext, Arc
1463
1576
  } | {
1464
1577
  kind: "refused";
1465
1578
  }>;
1579
+ /**
1580
+ * #1920 step 4b: a guest's returning device asks for a code — a guest code for that account, by DM only, under the
1581
+ * same rules as its /web (guests on, not an admin, something in scope now; one per account and the cap; one flow per
1582
+ * account at a time; a revoke meanwhile ends it), its own limiter, and the guests' breaker. Asked through the public
1583
+ * link: only while that exposure is the open one (its code then works through it alone), as an admin's device.
1584
+ */
1585
+ private requestGuestDeviceCode;
1586
+ /** #1920 step 4b (auth-api): this browser becomes a guest's returning device. The cookie value, or null. */
1587
+ rememberGuestDevice(account: {
1588
+ adapterId: string;
1589
+ userId: string;
1590
+ }, input: {
1591
+ surface: "local" | "gateway";
1592
+ label: string;
1593
+ }): string | null;
1466
1594
  /** Called by the sign-in endpoint: a login the operator did not make should be visible to them. */
1467
1595
  onWebLogin(info: {
1468
1596
  label: string;
1469
1597
  surface: "local" | "gateway";
1470
1598
  tier: string;
1471
1599
  handle: string;
1600
+ owner?: {
1601
+ adapterId: string;
1602
+ userId: string;
1603
+ };
1472
1604
  }): void;
1473
1605
  getDashboardAccess(): {
1474
1606
  ready: boolean;
@@ -1742,6 +1874,11 @@ export declare class FleetManager implements FleetContext, LifecycleContext, Arc
1742
1874
  */
1743
1875
  private inboundNoticeAdapter;
1744
1876
  private handleInboundMessageCore;
1877
+ /**
1878
+ * A person's platform message as the web chat shows it — the user's own words, as a user (#1306), in the instance's
1879
+ * history (#1565). #1920 §5.2: said in the instance's topic, General or room, so it is that channel's, by that account.
1880
+ */
1881
+ private emitPlatformInbound;
1745
1882
  /** Handle outbound tool calls from a daemon instance */
1746
1883
  /** Warn (but don't block) when rate limits are high. 30-min debounce per instance. */
1747
1884
  private rateLimitWarnedAt;
@@ -1784,6 +1921,14 @@ export declare class FleetManager implements FleetContext, LifecycleContext, Arc
1784
1921
  /** On a fleet with no chat platform, the dashboard is where an instance-health prompt is posted (#1307 item 6). */
1785
1922
  private webOnlyPromptPlace;
1786
1923
  /** Resolves when the reply is in the web chat (#1770: after its files are copied); the caller need not wait. */
1924
+ /**
1925
+ * #1920 §5.2: whether a platform send landed in the instance's own place — its ClassicBot room, or its topic in its
1926
+ * connection's group — so its channel's members saw it. Anything else (another chat, a DM, a context left from General,
1927
+ * an answer without the chat it went to) is not the channel's.
1928
+ */
1929
+ private landedInOwnChannel;
1930
+ /** #1920 §5.2 (#2085 review): a platform click's buttons are in the instance's own place — else not its channel's. */
1931
+ private clickInOwnChannel;
1787
1932
  private afterReplyRouted;
1788
1933
  /**
1789
1934
  * #1770: a reply's files as the web chat shows them. Each is copied into the instance's web-files/ and served from
@@ -2469,6 +2614,8 @@ export declare class FleetManager implements FleetContext, LifecycleContext, Arc
2469
2614
  key: string;
2470
2615
  userId: string;
2471
2616
  name: string;
2617
+ guest?: true;
2618
+ authority?: HumanAuthority;
2472
2619
  }): Promise<{
2473
2620
  status: 200 | 400 | 403 | 409;
2474
2621
  error?: string;
@@ -2506,6 +2653,16 @@ export declare class FleetManager implements FleetContext, LifecycleContext, Arc
2506
2653
  private readonly webBackendTokens;
2507
2654
  /** #1269: the web's /clear confirmations — one token per question, used once, for the instance as it was asked about. */
2508
2655
  private readonly webClearTokens;
2656
+ /**
2657
+ * #1939 S1: the design's §3 for one web request (authority/web-authority.ts), with this fleet's admins, policy and
2658
+ * token; `instance` once the body has named it. Observe only: receipts record it, no agent acts on it yet.
2659
+ */
2660
+ webAuthority(input: {
2661
+ session: SessionRecord | null;
2662
+ gateway: boolean;
2663
+ peer: WebPeer;
2664
+ instance?: string;
2665
+ }): WebAuthorityResult;
2509
2666
  /** #1269: an instance's chat command from the web chat (web-commands.ts); `publicLink`: a gateway request. */
2510
2667
  webCommand(input: {
2511
2668
  instance: string;
@@ -2515,6 +2672,7 @@ export declare class FleetManager implements FleetContext, LifecycleContext, Arc
2515
2672
  }, opts: {
2516
2673
  publicLink: boolean;
2517
2674
  person?: Pick<WebPersonView, "userId" | "name">;
2675
+ authority?: HumanAuthority;
2518
2676
  }): Promise<WebCommandResult>;
2519
2677
  /** Consume `/clear` Confirm/Cancel exactly once; only Confirm reaches IPC. */
2520
2678
  private handleClearConfirmation;
@@ -3198,8 +3356,31 @@ export declare class FleetManager implements FleetContext, LifecycleContext, Arc
3198
3356
  private prospectiveCodexModel;
3199
3357
  /** #1811: whether a launch of `backend` here would pass a level: the same gate its builder applies. */
3200
3358
  private launchEffortGate;
3201
- /** Installed the way the launch finds a CLI (resolveBinary): on PATH or in a known install directory. */
3202
- private backendInstalledHere;
3359
+ /**
3360
+ * #2072: what this host can run, from the published availability snapshot (backend-availability.ts). Read only: a
3361
+ * handler never starts a probe, not even in the background — launch, the timer, and /login install or sign-in do.
3362
+ */
3363
+ backendAvailabilityRows(): BackendAvailability[];
3364
+ /**
3365
+ * #2072 part 3: the models a Settings field offers for `backend` — the cached catalog (an instance's own credential
3366
+ * profile's, when it is named and has one), claude's account catalog included. Read only: never a probe.
3367
+ */
3368
+ modelCatalogFor(backend: string, instance: string | null): import("./backend/types.js").ModelOption[];
3369
+ /**
3370
+ * #2072 (#2078 review): the snapshot as THIS instance would see it. Its sign-in on a backend is its own credential
3371
+ * profile's when it has one there — the host's default login says nothing about it. A profile's login is a file check
3372
+ * (credentialProfileLogin), no process.
3373
+ */
3374
+ backendAvailabilityFor(instanceName: string): BackendAvailability[];
3375
+ /** The probes the snapshot runs (tests replace them: no CLI, no account, no network). */
3376
+ availabilityProbes: AvailabilityProbes;
3377
+ private availabilityStore;
3378
+ private availabilityTimer;
3379
+ get backendAvailability(): BackendAvailabilityStore;
3380
+ /** A launch need not look the binary up again (a synchronous `which` on the loop) when the snapshot found it. */
3381
+ private noteAvailabilityPaths;
3382
+ /** Probe now and then every AVAILABILITY_STALE_MS; a pass that finds nothing changed starts no CLI. */
3383
+ private startAvailabilityRefresh;
3203
3384
  /** The models `/model` would offer on a backend: the cached CLI env, else (live) a bounded probe. Never throws. */
3204
3385
  private backendModelOptions;
3205
3386
  /**
@@ -3244,6 +3425,7 @@ export declare class FleetManager implements FleetContext, LifecycleContext, Arc
3244
3425
  private findClassicApprovalGeneral;
3245
3426
  /** Return a user-facing blocker without mutating ClassicBot state. */
3246
3427
  private validateClassicStart;
3428
+ /** #2072: from the published snapshot (no `which` on the loop); not checked yet counts as installed (no false alarm). */
3247
3429
  private isBackendInstalled;
3248
3430
  private getMissingBackendWarning;
3249
3431
  /** Handle Discord's required static slash choice, warning before a likely startup failure. */
@@ -3540,13 +3722,55 @@ export declare class FleetManager implements FleetContext, LifecycleContext, Arc
3540
3722
  */
3541
3723
  private noteRejectedHost;
3542
3724
  /**
3543
- * #1920: the instances a guest session may see — derived on every request, never stored. Phase 2 derives it from
3544
- * the account's chat access (and an admin's naming for an open connection); until then a guest sees nothing.
3545
- */
3546
- guestScope(_owner: {
3725
+ * #1920 §3: the instances a guest session may see — derived on every request from the account's chat access, never
3726
+ * stored; nothing while `web.guests.enabled` is not true.
3727
+ * - Its connection's fleet topics and General (what it may talk to in chat): when that connection's access lets the
3728
+ * account in (AccessManager.isAllowed — allowed_users or paired). An `open` connection lets everyone in, so it gives
3729
+ * only the instances an admin named for its guests (`web.guests.open_instances`; the user's decision: least
3730
+ * privilege, as an open group has no list of people).
3731
+ * - A Telegram private ClassicBot room that is the account's own (its chat id is the user id).
3732
+ * - A ClassicBot group or guild room on its connection: only while its membership is verified (§3.2 — a "member"
3733
+ * answer read in the background, at most 15 minutes old; unknown, failed or stale hides it).
3734
+ * - Then an admin's narrowing (`web.guests.narrow`), which only takes away.
3735
+ * A fleet admin is not a guest: an admin outside the connection's access gets nothing here (admins sign in as admins).
3736
+ */
3737
+ guestScope(owner: {
3547
3738
  readonly adapterId: string;
3548
3739
  readonly userId: string;
3549
3740
  } | undefined): ReadonlySet<string>;
3741
+ /**
3742
+ * #1920 (#2104 review): what an account reaches before an admin's narrowing — its connection's topics (an open one's
3743
+ * named agents), its own Telegram private room, its verified group rooms. Narrowing can only take from this set, so it
3744
+ * is what Settings offers to narrow to. Empty while guest sign-in is off.
3745
+ */
3746
+ private guestReach;
3747
+ /**
3748
+ * #1920 §3.5: a guest session still admitted — current, with something in scope. A scope that became empty (guest
3749
+ * sign-in off, the account removed from the connection's access, everything narrowed away) ends the session here,
3750
+ * so the next request and the open stream find it gone.
3751
+ */
3752
+ private guestStillAdmitted;
3753
+ /**
3754
+ * The same, with a third answer (§3.2): "pending" — nothing in scope now, but a room's membership is not read yet
3755
+ * (a restart, a room just created). The request is refused and the session kept; its read starts in the background.
3756
+ */
3757
+ private guestAdmission;
3758
+ /** #1920 §3.2: the membership answers; the read goes to the room's own connection, never waits past its deadline. */
3759
+ private guestRooms;
3760
+ /** #1920 §3.2: read this guest's rooms that are due (GuestRoomMembership.refresh says when each mode reads). */
3761
+ private refreshGuestRooms;
3762
+ /** Every account with a live guest session, one after another (the guest caps bound them); one pass at a time. */
3763
+ private refreshAllGuestRooms;
3764
+ private guestRoomsPass;
3765
+ /**
3766
+ * #1920 §3.5: guest sign-in turned off ends every guest session — checked when the configuration is read or saved
3767
+ * and when the sessions are opened, so turning it back on never revives one.
3768
+ */
3769
+ private enforceGuestSwitch;
3770
+ /** #1920 §5.2: whether this instance is the account's own Telegram private ClassicBot room (its chat id is the user id). */
3771
+ private guestOwnRoom;
3772
+ /** A private room's chat id is its one user's id (a group's is negative, so never equal); Telegram only. */
3773
+ private isOwnPrivateRoom;
3550
3774
  /** Shared handler dispatcher; gateway admission is enforced by its separate listener. */
3551
3775
  private dispatchWebHttp;
3552
3776
  private startHealthServer;