agl 43.8.0 → 43.10.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (146) hide show
  1. package/changelog.md +28 -0
  2. package/dist_serve/bundle.js +1157 -1122
  3. package/dist_serve/bundle.js.map +2 -2
  4. package/dist_ts/00_commitinfo_data.js +2 -2
  5. package/dist_ts/aglapi/aglapisurface.document.js +826 -8
  6. package/dist_ts/aglapi/interfaces.d.ts +8 -0
  7. package/dist_ts/aglapi/interfaces.js +3 -1
  8. package/dist_ts/classes.accountsactions.d.ts +3 -1
  9. package/dist_ts/classes.accountsactions.js +17 -1
  10. package/dist_ts/classes.controller.d.ts +1 -1
  11. package/dist_ts/classes.controller.js +21 -7
  12. package/dist_ts/classes.inferencegateway.js +7 -5
  13. package/dist_ts/classes.inferenceplacement.d.ts +1 -1
  14. package/dist_ts/classes.inferencerouter.d.ts +20 -3
  15. package/dist_ts/classes.inferencerouter.js +37 -10
  16. package/dist_ts/classes.inferenceservice.js +2 -2
  17. package/dist_ts/classes.mcpclient.js +3 -3
  18. package/dist_ts/classes.mcpcontrollerhost.js +3 -2
  19. package/dist_ts/classes.mcptools.d.ts +1 -1
  20. package/dist_ts/classes.mcptools.js +2 -1
  21. package/dist_ts/classes.ticketnotifier.d.ts +2 -2
  22. package/dist_ts/classes.ticketnotifier.js +6 -4
  23. package/dist_ts/classes.ticketstore.d.ts +36 -8
  24. package/dist_ts/classes.ticketstore.js +131 -29
  25. package/dist_ts/classes.workercallers.d.ts +35 -1
  26. package/dist_ts/classes.workercallers.js +139 -28
  27. package/dist_ts/fleet/classes.boardpump.d.ts +1 -1
  28. package/dist_ts/fleet/classes.boardpump.js +4 -2
  29. package/dist_ts/fleet/classes.ticketeffects.d.ts +11 -0
  30. package/dist_ts/fleet/classes.ticketeffects.js +28 -1
  31. package/dist_ts/fleet/classes.workers.d.ts +18 -1
  32. package/dist_ts/fleet/classes.workers.js +49 -8
  33. package/dist_ts/fleet/functions.workervalidation.js +7 -4
  34. package/dist_ts/functions.deviceapi.js +3 -1
  35. package/dist_ts/functions.fleetworkercli.d.ts +3 -1
  36. package/dist_ts/functions.fleetworkercli.js +6 -2
  37. package/dist_ts/functions.inferencecli.js +4 -1
  38. package/dist_ts/functions.mcpfleetworkertools.js +3 -3
  39. package/dist_ts/functions.mcptickettools.d.ts +60 -0
  40. package/dist_ts/functions.mcptickettools.js +4 -3
  41. package/dist_ts/functions.proxycapacity.d.ts +2 -1
  42. package/dist_ts/functions.proxycapacity.js +6 -3
  43. package/dist_ts/functions.proxycapacitycli.js +2 -2
  44. package/dist_ts/functions.ticketcli.d.ts +4 -2
  45. package/dist_ts/functions.ticketcli.js +70 -4
  46. package/dist_ts/functions.ticketlisting.d.ts +38 -0
  47. package/dist_ts/functions.ticketlisting.js +211 -0
  48. package/dist_ts/functions.ticketvalidation.d.ts +62 -0
  49. package/dist_ts/functions.ticketvalidation.js +41 -3
  50. package/dist_ts/functions.workerprocessproof.d.ts +6 -0
  51. package/dist_ts/functions.workerprocessproof.js +8 -3
  52. package/dist_ts/interfaces.auth.d.ts +1 -1
  53. package/dist_ts/interfaces.auth.js +2 -1
  54. package/dist_ts/interfaces.flexipc.d.ts +3 -1
  55. package/dist_ts/interfaces.flexipc.js +1 -1
  56. package/dist_ts_authswitch/authority-contract.d.ts +25 -0
  57. package/dist_ts_authswitch/authority-contract.js +1 -1
  58. package/dist_ts_authswitch/authority-overview.d.ts +7 -0
  59. package/dist_ts_authswitch/authority-overview.js +10 -6
  60. package/dist_ts_authswitch/authority-placement.d.ts +5 -2
  61. package/dist_ts_authswitch/authority-placement.js +6 -3
  62. package/dist_ts_authswitch/classes.authoritybroker.d.ts +6 -0
  63. package/dist_ts_authswitch/classes.authoritybroker.js +26 -1
  64. package/dist_ts_authswitch/classes.authoritycli.d.ts +1 -0
  65. package/dist_ts_authswitch/classes.authoritycli.js +50 -4
  66. package/dist_ts_authswitch/classes.authorityclient.d.ts +3 -1
  67. package/dist_ts_authswitch/classes.authorityclient.js +9 -4
  68. package/dist_ts_authswitch/classes.authoritydaemon.js +7 -1
  69. package/dist_ts_authswitch/classes.authoritydatabase.js +5 -1
  70. package/dist_ts_authswitch/classes.authoritymodels.d.ts +7 -0
  71. package/dist_ts_authswitch/classes.authoritymodels.js +13 -6
  72. package/dist_ts_interfaces/fleetworkers.d.ts +26 -1
  73. package/dist_ts_interfaces/fleetworkers.js +1 -1
  74. package/dist_ts_interfaces/interfaces.d.ts +4 -2
  75. package/dist_ts_interfaces/interfaces.js +1 -1
  76. package/dist_ts_interfaces/mcprequests.d.ts +1 -1
  77. package/dist_ts_interfaces/proxycapacity.d.ts +1 -1
  78. package/dist_ts_interfaces/requests.accounts.d.ts +19 -0
  79. package/dist_ts_interfaces/requests.accounts.js +1 -1
  80. package/dist_ts_interfaces/requests.d.ts +2 -2
  81. package/dist_ts_interfaces/requests.fleetworkers.d.ts +3 -1
  82. package/dist_ts_interfaces/requests.js +1 -1
  83. package/dist_ts_interfaces/requests.tickets.d.ts +31 -3
  84. package/dist_ts_interfaces/requests.tickets.js +2 -2
  85. package/dist_ts_interfaces/tickets.d.ts +174 -2
  86. package/dist_ts_interfaces/tickets.js +20 -2
  87. package/dist_ts_migration/v41_ticketclosedcolumn.js +7 -3
  88. package/docs/authswitch.md +22 -0
  89. package/package.json +2 -2
  90. package/readme.md +85 -6
  91. package/ts/00_commitinfo_data.ts +1 -1
  92. package/ts/aglapi/aglapisurface.document.ts +825 -7
  93. package/ts/aglapi/interfaces.ts +2 -0
  94. package/ts/classes.accountsactions.ts +25 -0
  95. package/ts/classes.controller.ts +18 -3
  96. package/ts/classes.inferencegateway.ts +6 -4
  97. package/ts/classes.inferenceplacement.ts +1 -1
  98. package/ts/classes.inferencerouter.ts +49 -10
  99. package/ts/classes.inferenceservice.ts +1 -1
  100. package/ts/classes.mcpclient.ts +2 -2
  101. package/ts/classes.mcpcontrollerhost.ts +2 -1
  102. package/ts/classes.mcptools.ts +1 -0
  103. package/ts/classes.ticketnotifier.ts +5 -3
  104. package/ts/classes.ticketstore.ts +124 -27
  105. package/ts/classes.workercallers.ts +165 -28
  106. package/ts/fleet/classes.boardpump.ts +3 -2
  107. package/ts/fleet/classes.ticketeffects.ts +25 -0
  108. package/ts/fleet/classes.workers.ts +47 -7
  109. package/ts/fleet/functions.workervalidation.ts +6 -3
  110. package/ts/functions.deviceapi.ts +2 -0
  111. package/ts/functions.fleetworkercli.ts +5 -1
  112. package/ts/functions.inferencecli.ts +2 -0
  113. package/ts/functions.mcpfleetworkertools.ts +2 -2
  114. package/ts/functions.mcptickettools.ts +3 -2
  115. package/ts/functions.proxycapacity.ts +5 -2
  116. package/ts/functions.proxycapacitycli.ts +1 -1
  117. package/ts/functions.ticketcli.ts +70 -5
  118. package/ts/functions.ticketlisting.ts +214 -0
  119. package/ts/functions.ticketvalidation.ts +41 -2
  120. package/ts/functions.workerprocessproof.ts +10 -2
  121. package/ts/interfaces.auth.ts +1 -0
  122. package/ts/interfaces.flexipc.ts +3 -1
  123. package/ts_authswitch/authority-contract.ts +20 -0
  124. package/ts_authswitch/authority-overview.ts +17 -6
  125. package/ts_authswitch/authority-placement.ts +7 -3
  126. package/ts_authswitch/classes.authoritybroker.ts +24 -0
  127. package/ts_authswitch/classes.authoritycli.ts +58 -4
  128. package/ts_authswitch/classes.authorityclient.ts +11 -4
  129. package/ts_authswitch/classes.authoritydaemon.ts +8 -1
  130. package/ts_authswitch/classes.authoritydatabase.ts +3 -0
  131. package/ts_authswitch/classes.authoritymodels.ts +12 -4
  132. package/ts_interfaces/fleetworkers.ts +26 -1
  133. package/ts_interfaces/interfaces.ts +4 -2
  134. package/ts_interfaces/proxycapacity.ts +1 -1
  135. package/ts_interfaces/requests.accounts.ts +17 -0
  136. package/ts_interfaces/requests.fleetworkers.ts +3 -1
  137. package/ts_interfaces/requests.tickets.ts +32 -2
  138. package/ts_interfaces/requests.ts +2 -0
  139. package/ts_interfaces/tickets.ts +136 -3
  140. package/ts_migration/v41_ticketclosedcolumn.ts +6 -2
  141. package/ts_web/00_commitinfo_data.ts +1 -1
  142. package/ts_web/accounts.templates.ts +12 -2
  143. package/ts_web/classes.accountsreadmodel.ts +42 -6
  144. package/ts_web/elements.accounts.ts +45 -3
  145. package/ts_web/elements.harnesscontrollerapp.ts +6 -1
  146. package/ts_web/elements.inbox.ts +50 -9
@@ -34,6 +34,7 @@ import type {
34
34
  IReq_ControllerAccountsClaudeCode,
35
35
  IReq_ControllerAccountsRenewal,
36
36
  IReq_ControllerAccountsPriority,
37
+ IReq_ControllerAccountsPause,
37
38
  IReq_ControllerAccountsSnapshot,
38
39
  IReq_ControllerAccountsUsageGet,
39
40
  IReq_ControllerAccountsUsageRecheck,
@@ -415,6 +416,7 @@ export type TControllerRequest =
415
416
  | IReq_ControllerAccountsClaudeCode
416
417
  | IReq_ControllerAccountsRenewal
417
418
  | IReq_ControllerAccountsPriority
419
+ | IReq_ControllerAccountsPause
418
420
  | IReq_ControllerAccountsRemove
419
421
  | IReq_ControllerAccountsAdd
420
422
  | IReq_ControllerAccountsReauth
@@ -6,7 +6,8 @@ export type TTicketColumn = (typeof ticketColumns)[number];
6
6
  /** The columns of finished work; the board folds them. */
7
7
  export const ticketDoneColumns: readonly TTicketColumn[] = ['released', 'closed'];
8
8
  export type TTicketKind = 'epic' | 'task' | 'subtask';
9
- export type TTicketPriority = 'none' | 'low' | 'normal' | 'high' | 'urgent';
9
+ export const ticketPriorities = ['urgent', 'high', 'normal', 'low', 'none'] as const;
10
+ export type TTicketPriority = (typeof ticketPriorities)[number];
10
11
  export interface ITicketPerson {
11
12
  id: string;
12
13
  name: string;
@@ -221,6 +222,127 @@ export interface ITicketFilters {
221
222
  label?: string;
222
223
  text?: string;
223
224
  }
225
+ /** How a page sorts: the board's own order, newest change first, newest ticket first, or urgent first and then the board's order. */
226
+ export const ticketPageSorts = ['board', 'updated', 'created', 'priority'] as const;
227
+ export type TTicketPageSort = (typeof ticketPageSorts)[number];
228
+ /**
229
+ * How many tickets one page returns unless it names `limit`, the most it may name, and the bytes a page holds at most
230
+ * (its tickets serialized; a page holds at least one ticket). The budget wins over `limit`.
231
+ */
232
+ export const ticketListPage = { default: 50, maximum: 200, bytes: 256 * 1024 } as const;
233
+ /**
234
+ * One page of the board. Beyond a listing's filters it narrows by several columns (`statuses`), by open work (`open`:
235
+ * true leaves out released and closed tickets, false keeps only those), kind, priorities, a parent's direct children,
236
+ * an assignee (a person id or a session id), tickets without one, named keys and a time of last change.
237
+ */
238
+ export interface ITicketPageRequest extends ITicketFilters {
239
+ statuses?: TTicketColumn[];
240
+ open?: boolean;
241
+ kind?: TTicketKind;
242
+ priorities?: TTicketPriority[];
243
+ /** A ticket key: its direct children, as the board's epic filter matches them. */
244
+ parent?: string;
245
+ /** A person id or a session id (`harness:nativeId`), as a ticket's assignee holds them; never a display name. */
246
+ assignee?: string;
247
+ unassigned?: boolean;
248
+ /** Up to 200 keys: reads those tickets in one call. */
249
+ keys?: string[];
250
+ /** An ISO 8601 instant: tickets changed at or after it. */
251
+ updatedSince?: string;
252
+ /** `board` when absent. */
253
+ sort?: TTicketPageSort;
254
+ /** `summary` (a ticket without its texts) when absent; `full` returns whole tickets. */
255
+ view?: 'summary' | 'full';
256
+ /** Tickets on the page, 1 to 200 (`ticketListPage.maximum`); 50 when absent. */
257
+ limit?: number;
258
+ /** A page's `nextCursor`, with the same filters, sort and view. */
259
+ cursor?: string;
260
+ }
261
+ /** A ticket without its description, source words and link details. Empty fields are left out. */
262
+ export interface ITicketSummary {
263
+ key: string;
264
+ revision: number;
265
+ project: string;
266
+ kind: TTicketKind;
267
+ title: string;
268
+ columnId: TTicketColumn;
269
+ priority: TTicketPriority;
270
+ updatedAt: string;
271
+ assignee?: Pick<ITicketPerson, 'id' | 'name' | 'sessionId'>;
272
+ parentId?: string;
273
+ labels?: string[];
274
+ autoLabels?: TTicketAutoLabel[];
275
+ /** How many links of each kind the ticket holds. */
276
+ links?: Partial<Record<TTicketLink['kind'], number>>;
277
+ releasePlan?: ITicketReleasePlan;
278
+ deployPlan?: ITicketDeployPlanInput;
279
+ maintenanceWindow?: Pick<ITicketMaintenanceWindow, 'from' | 'to' | 'targets'>;
280
+ /** Unanswered questions on the ticket. */
281
+ openQuestions?: number;
282
+ }
283
+ interface ITicketPageBase {
284
+ /** How many tickets the filters match, on every page. */
285
+ total: number;
286
+ /** How many of them each column holds; a column without any is left out. */
287
+ columns: Partial<Record<TTicketColumn, number>>;
288
+ /** The board revision this page was read at. */
289
+ revision: number;
290
+ /** Present while more tickets follow: pass it as `cursor` with the same filters, sort and view. */
291
+ nextCursor?: string;
292
+ /**
293
+ * The board changed since the first page of this cursor. A page continues after the last ticket shown as the board
294
+ * stands now, so a ticket that changed its place meanwhile may be missing or shown twice; list again for an exact reading.
295
+ */
296
+ moved?: true;
297
+ }
298
+ export type TTicketPage = (ITicketPageBase & { view: 'summary'; tickets: ITicketSummary[] })
299
+ | (ITicketPageBase & { view: 'full'; tickets: ITicket[] });
300
+ /** The overview's defaults: tickets per list, the days after which active work counts as stale, and the most projects, assignees and epics listed. */
301
+ export const ticketOverviewDefaults = { limit: 5, maximumLimit: 50, staleDays: 3, groups: 50 } as const;
302
+ export interface ITicketOverviewRequest {
303
+ /** Only this project's tickets. */
304
+ project?: string;
305
+ /** Only the tickets assigned to the caller's verified session. */
306
+ mine?: boolean;
307
+ /** Tickets per list, 1 to 50; 5 when absent. */
308
+ limit?: number;
309
+ /** Days without a change after which in_progress, needs_input and review work counts as stale, 1 to 365; 3 when absent. */
310
+ staleDays?: number;
311
+ }
312
+ /** Some tickets of a kind and how many there are in all. */
313
+ export interface ITicketOverviewGroup { total: number; tickets: ITicketSummary[] }
314
+ /** The board at a glance, without any ticket's texts; see `ticketOverview`. */
315
+ export interface ITicketOverview {
316
+ revision: number;
317
+ total: number;
318
+ /** Tickets that are neither released nor closed. */
319
+ open: number;
320
+ columns: Record<TTicketColumn, number>;
321
+ /** Open tickets by priority. */
322
+ priorities: Record<TTicketPriority, number>;
323
+ autoLabels: Record<TTicketAutoLabel, number>;
324
+ /** Most open work first; `projectsTotal` counts all. */
325
+ projects: { project: string; total: number; open: number; columns: Partial<Record<TTicketColumn, number>> }[];
326
+ projectsTotal: number;
327
+ /** Who holds open tickets, most first; `assigneesTotal` counts all. */
328
+ assignees: (Pick<ITicketPerson, 'id' | 'name' | 'sessionId'> & { open: number; columns: Partial<Record<TTicketColumn, number>> })[];
329
+ assigneesTotal: number;
330
+ unassignedOpen: number;
331
+ /** Open epics with their direct children: how many, how many done, and where they stand; `epicsTotal` counts all. */
332
+ epics: { key: string; title: string; project: string; columnId: TTicketColumn; children: number; done: number;
333
+ columns: Partial<Record<TTicketColumn, number>> }[];
334
+ epicsTotal: number;
335
+ attention: {
336
+ urgent: ITicketOverviewGroup;
337
+ needsInput: ITicketOverviewGroup;
338
+ openQuestions: ITicketOverviewGroup;
339
+ review: ITicketOverviewGroup;
340
+ unassignedReady: ITicketOverviewGroup;
341
+ stale: ITicketOverviewGroup;
342
+ };
343
+ /** The tickets changed last, newest first. */
344
+ recent: ITicketSummary[];
345
+ }
224
346
  export interface ITicketChanges {
225
347
  title?: string;
226
348
  description?: string;
@@ -297,6 +419,9 @@ export interface ITicketBoard {
297
419
  }
298
420
  export interface ITicketOperations {
299
421
  list: { request: ITicketFilters; response: { tickets: ITicket[] } };
422
+ /** `list` in pages, as summaries unless `view` is `full`, with further filters and a sort. */
423
+ page: { request: ITicketPageRequest; response: TTicketPage };
424
+ overview: { request: ITicketOverviewRequest; response: ITicketOverview };
300
425
  board: { request: ITicketFilters; response: ITicketBoard };
301
426
  search: { request: { query: string; label?: string }; response: { tickets: ITicket[] } };
302
427
  get: { request: ITicketGet; response: ITicketDetail };
@@ -370,6 +495,14 @@ export const ticketErrorMessages = {
370
495
  ticket_question_answered: 'The question already has a different answer; a second answer is refused. Ask a new question instead.',
371
496
  ticket_answer_invalid: 'An answer chooses existing option ids (one unless multiSelect) and/or gives free text where the question allows it.',
372
497
  } as const;
373
- export type TTicketClientErrorCode = Uppercase<keyof typeof ticketErrorMessages>;
374
- export const ticketClientErrorMessages = Object.fromEntries(Object.entries(ticketErrorMessages)
498
+ /**
499
+ * What a page refuses about its cursor. Kept apart from `ticketErrorMessages`, which the device contract lists code by
500
+ * code: a device pages nothing, and is answered `invalid_request` should it ever meet one.
501
+ */
502
+ export const ticketPageErrorMessages = {
503
+ ticket_cursor_invalid: 'The cursor is not the nextCursor of a ticket page; list again without cursor.',
504
+ ticket_cursor_mismatch: 'The cursor pages other filters, another sort or another view; repeat those or list again without cursor.',
505
+ } as const;
506
+ export type TTicketClientErrorCode = Uppercase<keyof typeof ticketErrorMessages | keyof typeof ticketPageErrorMessages>;
507
+ export const ticketClientErrorMessages = Object.fromEntries(Object.entries({ ...ticketErrorMessages, ...ticketPageErrorMessages })
375
508
  .map(([codeArg, messageArg]) => [codeArg.toUpperCase(), messageArg])) as Record<TTicketClientErrorCode, string>;
@@ -1,5 +1,6 @@
1
1
  import * as plugins from './plugins.js';
2
2
  import { TicketActivityModel, TicketBoardModel, TicketCommentModel, TicketModel } from '../ts/classes.ticketmodels.js';
3
+ import { ticketOrderStride } from '../ts/classes.ticketstore.js';
3
4
  import { AuthError } from '../ts/interfaces.auth.js';
4
5
  import type { ITicketActivity, ITicketActor, ITicketComment } from '../ts_interfaces/tickets.js';
5
6
  import { TicketMigrationMarkerModel } from './v41_ticketmigrationmarkers.js';
@@ -47,10 +48,13 @@ export class TicketClosedColumnV41Migration {
47
48
  { session: transactionArg });
48
49
  if (fenced.status !== 'transitioned') throw new AuthError('concurrent_change', 'The ticket board changed during the closed-column migration.');
49
50
  const revision = board.revision + 1;
50
- let order = (await this.page({ 'ticket.columnId': 'closed' }, transactionArg)).length;
51
+ // After the last ticket already in closed, a stride apart: orders are sparse (AGL-1907), never a count.
52
+ let order = (await TicketModel.exact.findStored({ filter: { 'ticket.columnId': 'closed' }, sort: { 'ticket.order': -1 }, limit: 1,
53
+ session: transactionArg }))[0]?.ticket.order ?? 0;
51
54
  for (const current of moving) {
52
55
  const before = { columnId: current.ticket.columnId, order: current.ticket.order };
53
- const after = { columnId: 'closed' as const, order: order++ };
56
+ order += ticketOrderStride;
57
+ const after = { columnId: 'closed' as const, order };
54
58
  const moved = await TicketModel.exact.transition({ current, change: (modelArg) => {
55
59
  modelArg.ticket = { ...modelArg.ticket, ...after, revision: (modelArg.ticket.revision ?? 0) + 1,
56
60
  updatedBy: ticketClosedColumnMigrationActor, updatedAt: now };
@@ -3,6 +3,6 @@
3
3
  */
4
4
  export const commitinfo = {
5
5
  name: 'agl',
6
- version: '43.8.0',
6
+ version: '43.10.0',
7
7
  description: 'Agent Gateway Layer for OpenCode, FlexHarness, and Codex sessions'
8
8
  }
@@ -128,9 +128,12 @@ export const renderListRow = (
128
128
  `;
129
129
  };
130
130
 
131
- /** The overview over the list: how many accounts take work, how many their usage holds back, how many need the owner. */
131
+ /**
132
+ * The overview over the list: how many accounts take work, how many their usage holds back, how many need the owner,
133
+ * and, while any is, how many their owner holds paused.
134
+ */
132
135
  export const renderSummary = (summaryArg: IAccountsSummary): plugins.deesElement.TemplateResult => plugins.deesElement.html`
133
- <div class="summary" role="group" aria-label="Accounts overview" data-summary>
136
+ <div class=${`summary ${summaryArg.paused ? 'withPaused' : ''}`} role="group" aria-label="Accounts overview" data-summary>
134
137
  <div class="tile" data-summary-tile="ready">
135
138
  <div class="figure">${summaryArg.ready} <span class="of">of ${summaryArg.total}</span></div>
136
139
  <div class="tileLabel">Ready</div>
@@ -146,6 +149,13 @@ export const renderSummary = (summaryArg: IAccountsSummary): plugins.deesElement
146
149
  <div class="tileLabel">Needs you</div>
147
150
  <div class="tileText">${summaryArg.needsYouText}</div>
148
151
  </div>
152
+ ${summaryArg.paused
153
+ ? plugins.deesElement.html`<div class="tile" data-summary-tile="paused">
154
+ <div class="figure">${summaryArg.paused}</div>
155
+ <div class="tileLabel">Paused</div>
156
+ <div class="tileText">${summaryArg.pausedText}</div>
157
+ </div>`
158
+ : ''}
149
159
  </div>
150
160
  `;
151
161
 
@@ -151,6 +151,8 @@ export type TAccountActionId =
151
151
  | 'clearRenewal'
152
152
  | 'priority'
153
153
  | 'clearPriority'
154
+ | 'pause'
155
+ | 'resume'
154
156
  | 'addApiKey'
155
157
  | 'remove'
156
158
  | 'usage'
@@ -261,7 +263,8 @@ export interface IAccountStatus {
261
263
 
262
264
  /**
263
265
  * What a row's one status stands for, worst first: the service, a payment problem, a sign-in, a switch held on this
264
- * host, a hand-over, a renewal retrying, the usage limit, the reserve, a lifted reserve, no sign-in, and ready. For an
266
+ * host, a hand-over, a renewal retrying, a pause by its owner (AGL-1933), the usage limit, the reserve, a lifted
267
+ * reserve, no sign-in, and ready. For an
265
268
  * API key, a payment problem includes its provider's spend cap, a sign-in is a key its provider rejected, and the usage
266
269
  * limit is its monthly spend limit (or an answer that could not be priced); a key has no reserve.
267
270
  */
@@ -272,6 +275,7 @@ export type TAccountPillKind =
272
275
  | 'held'
273
276
  | 'handover'
274
277
  | 'renewing'
278
+ | 'paused'
275
279
  | 'atLimit'
276
280
  | 'reserved'
277
281
  | 'lifted'
@@ -372,6 +376,13 @@ export interface IAccountRow {
372
376
  priorityUntil: string | null;
373
377
  /** The priority as a badge beside its actions: `Priority until 14:05`, in local time; `null` without one. */
374
378
  priorityStatus: IAccountStatus | null;
379
+ /**
380
+ * Since when the owner holds the account paused (ISO 8601 UTC, AGL-1933), or `null` while it is not and on a removed
381
+ * account. A paused account takes no new work until it is resumed.
382
+ */
383
+ pausedAt: string | null;
384
+ /** The pause as a badge beside its action: `Paused since 2026-11-14 14:05`, in local time; `null` while not paused. */
385
+ pausedStatus: IAccountStatus | null;
375
386
  /** What a removal does that the owner must know, said with the removal; empty for a sign-in. */
376
387
  removeNote: string;
377
388
  label: string;
@@ -466,6 +477,10 @@ export interface IAccountsSummary {
466
477
  needsYou: number;
467
478
  /** The first of them and what it needs: `Work account: needs sign-in`. */
468
479
  needsYouText: string;
480
+ /** Accounts their owner holds paused (AGL-1933), which take no new work until they are resumed. */
481
+ paused: number;
482
+ /** Which: `Work account`, or `Work account and 2 more`; empty with none. */
483
+ pausedText: string;
469
484
  }
470
485
 
471
486
  export interface IAccountsView {
@@ -1265,6 +1280,8 @@ interface IPillParts {
1265
1280
  limitText: string;
1266
1281
  /** Until when the reserve is lifted, while it is. */
1267
1282
  liftedUntil: string | null;
1283
+ /** The owner holds the account paused: it takes no new work, whatever its usage allows. */
1284
+ paused: boolean;
1268
1285
  }
1269
1286
 
1270
1287
  /**
@@ -1287,6 +1304,8 @@ const accountPill = (partsArg: IPillParts): IAccountPill => {
1287
1304
  if (partsArg.held) return pill('held', 'Switch held', 'critical');
1288
1305
  if (partsArg.worst === 'pendingHandoff') return pill('handover', partsArg.status.text, partsArg.status.tone);
1289
1306
  if (partsArg.worst === 'retryWait') return pill('renewing', partsArg.status.text, partsArg.status.tone);
1307
+ // Paused says more than a limit would: nothing is placed on it until its owner resumes it.
1308
+ if (partsArg.paused) return pill('paused', 'Paused', 'neutral');
1290
1309
  if (partsArg.limit?.state === 'exhausted') return pill('atLimit', back(partsArg.limitText), 'neutral');
1291
1310
  if (partsArg.limit?.state === 'reserved') return pill('reserved', back('Reserved'), 'neutral');
1292
1311
  if (partsArg.liftedUntil) {
@@ -1376,6 +1395,8 @@ export const priorityText = (priorityUntilArg: string | null, nowArg: number): s
1376
1395
  const listMeta = (accountArg: TAccount, chipsArg: readonly IAccountHarnessChip[], nowArg: number): string => {
1377
1396
  const claudeSignIn = !isApiKeyAccount(accountArg) && accountArg.providerId === 'anthropic';
1378
1397
  return [
1398
+ // Paused by its owner: said first, since nothing new is placed on the account until it is resumed.
1399
+ !accountArg.removed && accountArg.pausedAt !== null ? 'paused' : '',
1379
1400
  priorityText(accountArg.priorityUntil, nowArg),
1380
1401
  ...isApiKeyAccount(accountArg) ? [keyIdentityText(accountArg)] : [
1381
1402
  accountArg.email && accountArg.email !== accountArg.label ? accountArg.email : '',
@@ -1620,6 +1641,7 @@ const serviceRow = (
1620
1641
  const priorityUntil = accountArg.removed ? null
1621
1642
  : plugins.authswitchPriority.authSwitchPriorityUntil(accountArg.priorityUntil, contextArg.now);
1622
1643
  const priority = priorityText(priorityUntil, contextArg.now);
1644
+ const pausedAt = accountArg.removed ? null : accountArg.pausedAt;
1623
1645
  const liftedUntil = !accountArg.removed && accountArg.maxUsagePercent !== null
1624
1646
  && plugins.authswitchUsageLimit.authSwitchReserveLiftActive(accountArg.reserveLiftUntil, contextArg.now)
1625
1647
  ? accountArg.reserveLiftUntil! : null;
@@ -1636,6 +1658,9 @@ const serviceRow = (
1636
1658
  renewsAt: claudeSignIn ? accountArg.renewsAt : null,
1637
1659
  priorityUntil,
1638
1660
  priorityStatus: priority ? { text: `${priority.charAt(0).toUpperCase()}${priority.slice(1)}`, tone: 'info' } : null,
1661
+ pausedAt,
1662
+ pausedStatus: pausedAt === null ? null
1663
+ : { text: `Paused since ${plugins.authswitchPreuseText.localDateTime(pausedAt)}`, tone: 'neutral' },
1639
1664
  removeNote: apiKey
1640
1665
  ? `AGL stops using the key. It stays valid at ${provider.name} until you revoke it in ${provider.console}.`
1641
1666
  : '',
@@ -1655,6 +1680,7 @@ const serviceRow = (
1655
1680
  limit: rawLimit,
1656
1681
  limitText: !spend ? 'At limit' : heldUnpriced(spend) ? 'Unpriced answer' : 'At spend limit',
1657
1682
  liftedUntil,
1683
+ paused: pausedAt !== null,
1658
1684
  }),
1659
1685
  listMeta: accountArg.removed ? identity : listMeta(accountArg, harnesses, contextArg.now),
1660
1686
  primaryMeter: spend ? spendMeter(spend) : primaryMeter(usage, accountArg.maxUsagePercent),
@@ -1692,11 +1718,17 @@ const serviceRow = (
1692
1718
  ? [serviceSlot('liftReserve', 'Lift reserve', 'lucide:Clock', contextArg.service, removed)] : []),
1693
1719
  // A renewal is a Claude subscription's: neither a key nor a ChatGPT account has one to set.
1694
1720
  ...(claudeSignIn ? [serviceSlot('renewal', 'Renewal', 'lucide:CalendarClock', contextArg.service, removed)] : []),
1695
- // Any account can have priority; giving it again starts its 24 hours again.
1696
- serviceSlot('priority', priorityUntil === null ? 'Give priority' : 'Restart 24 hours', 'lucide:Star',
1697
- contextArg.service, removed),
1698
- ...(priorityUntil === null ? []
1699
- : [serviceSlot('clearPriority', 'Turn off', 'lucide:StarOff', contextArg.service, removed)]),
1721
+ // Any account can have priority; giving it again starts its 24 hours again. A paused account takes no new work,
1722
+ // so it can have none until it is resumed.
1723
+ ...(pausedAt !== null ? [] : [
1724
+ serviceSlot('priority', priorityUntil === null ? 'Give priority' : 'Restart 24 hours', 'lucide:Star',
1725
+ contextArg.service, removed),
1726
+ ...(priorityUntil === null ? []
1727
+ : [serviceSlot('clearPriority', 'Turn off', 'lucide:StarOff', contextArg.service, removed)]),
1728
+ ]),
1729
+ // Any account can be paused, and resumed again.
1730
+ pausedAt === null ? serviceSlot('pause', 'Pause', 'lucide:CirclePause', contextArg.service, removed)
1731
+ : serviceSlot('resume', 'Resume', 'lucide:CirclePlay', contextArg.service, removed),
1700
1732
  serviceSlot('remove', 'Remove', 'lucide:Trash2', contextArg.service, removed),
1701
1733
  ...(usageLogin ? [serviceSlot('usage', 'Show latest usage', 'lucide:Gauge', contextArg.service)] : []),
1702
1734
  ...(usageLogin && payment ? [serviceSlot('recheck', 'Re-check', 'lucide:RotateCcw', contextArg.service)] : []),
@@ -1780,6 +1812,8 @@ const accountsSummary = (serviceArg: IAccountsServiceStatus, listArg: IAccountsL
1780
1812
  const ready = rows.filter((rowArg) => readyPills.includes(rowArg.pill.kind));
1781
1813
  const limited = rows.filter((rowArg) => limitedPills.includes(rowArg.pill.kind));
1782
1814
  const needsYou = rows.filter((rowArg) => needsYouPills.includes(rowArg.pill.kind));
1815
+ // Paused accounts are neither ready nor held back by usage: they count on their own.
1816
+ const paused = rows.filter((rowArg) => rowArg.pill.kind === 'paused');
1783
1817
  const firstBack = limited.map((rowArg) => rowArg.backAt).filter((atArg): atArg is string => atArg !== null)
1784
1818
  .sort((leftArg, rightArg) => Date.parse(leftArg) - Date.parse(rightArg))[0];
1785
1819
  const keys = rows.filter((rowArg) => rowArg.apiKey);
@@ -1797,6 +1831,8 @@ const accountsSummary = (serviceArg: IAccountsServiceStatus, listArg: IAccountsL
1797
1831
  limitedText: firstBack ? `First back ${plugins.authswitchPreuseText.localDateTime(firstBack)}` : '',
1798
1832
  needsYou: needsYou.length,
1799
1833
  needsYouText: needsYou[0] ? `${needsYou[0].label}: ${needsYou[0].pill.text.toLowerCase()}` : '',
1834
+ paused: paused.length,
1835
+ pausedText: !paused[0] ? '' : paused.length === 1 ? paused[0].label : `${paused[0].label} and ${paused.length - 1} more`,
1800
1836
  };
1801
1837
  };
1802
1838
 
@@ -385,6 +385,8 @@ export class AglAccounts extends plugins.deesElement.DeesElement {
385
385
  gap: var(--dees-spacing-sm);
386
386
  }
387
387
 
388
+ .summary.withPaused { grid-template-columns: repeat(4, minmax(0, 1fr)); }
389
+
388
390
  .tile {
389
391
  display: grid;
390
392
  gap: 2px;
@@ -643,7 +645,7 @@ export class AglAccounts extends plugins.deesElement.DeesElement {
643
645
  .choice:not(:disabled):hover { background: var(--dees-color-hover); }
644
646
 
645
647
  @media (max-width: 720px) {
646
- .summary { grid-template-columns: minmax(0, 1fr); }
648
+ .summary, .summary.withPaused { grid-template-columns: minmax(0, 1fr); }
647
649
  .card.rows { grid-template-columns: auto minmax(0, 1fr) auto; }
648
650
  .row .primaryMeter, .row .chevron { display: none; }
649
651
  .facts { grid-template-columns: minmax(0, 1fr); gap: 1px; }
@@ -1040,6 +1042,19 @@ export class AglAccounts extends plugins.deesElement.DeesElement {
1040
1042
  });
1041
1043
  }
1042
1044
 
1045
+ /** Pauses the account, or resumes it with `false`; the page shows it once the projection has it (AGL-1933). */
1046
+ private async setPause(rowArg: IAccountRow, pausedArg: boolean): Promise<void> {
1047
+ await this.runAction(`pause:${rowArg.accountId}`, async () => {
1048
+ const { answer } = await this.client!.fire<interfaces.IReq_ControllerAccountsPause>(
1049
+ 'controller.accounts.pause',
1050
+ { accountId: rowArg.accountId, expectedRevision: rowArg.revision, paused: pausedArg },
1051
+ { maxRetries: 0 },
1052
+ );
1053
+ this.notice = answerNotice(answer);
1054
+ await this.refresh();
1055
+ });
1056
+ }
1057
+
1043
1058
  /** Sets an API key's monthly spend limit from the field, in dollars, or clears it with `null`. */
1044
1059
  private async setSpendLimit(rowArg: IAccountRow, spendLimitMicroUsdArg: number | null): Promise<void> {
1045
1060
  await this.runAction(`spendlimit:${rowArg.accountId}`, async () => {
@@ -1116,6 +1131,29 @@ export class AglAccounts extends plugins.deesElement.DeesElement {
1116
1131
  `;
1117
1132
  }
1118
1133
 
1134
+ /**
1135
+ * The owner's pause (AGL-1933): a paused account takes no new work until it is resumed. Everything else about it stays.
1136
+ */
1137
+ private renderPause(rowArg: IAccountRow, slotsArg: readonly IAccountActionSlot[]): plugins.deesElement.TemplateResult {
1138
+ return plugins.deesElement.html`
1139
+ <div class="item" data-pause>
1140
+ <div>
1141
+ <div class="itemLabel">Pause</div>
1142
+ <div class="itemText">${rowArg.pausedAt === null
1143
+ ? 'While it is paused, AGL places no new session on this account and moves the sessions running on it to another account. Its sign-in, usage and limits stay as they are; a priority on it ends.'
1144
+ : 'AGL places nothing on this account and has moved its sessions to other accounts. Its sign-in, usage and limits are kept up to date, so it takes work again as soon as you resume it.'}</div>
1145
+ </div>
1146
+ <div class="inline">
1147
+ ${rowArg.pausedStatus
1148
+ ? plugins.deesElement.html`<dees-badge data-pause-status .type=${badgeType(rowArg.pausedStatus.tone)}
1149
+ .text=${rowArg.pausedStatus.text}></dees-badge>`
1150
+ : ''}
1151
+ ${this.slots(slotsArg, (slotArg) => void this.setPause(rowArg, slotArg.id === 'pause'))}
1152
+ </div>
1153
+ </div>
1154
+ `;
1155
+ }
1156
+
1119
1157
  /**
1120
1158
  * Adds the API key the dialog holds. The accounts service asks the provider whether it accepts the key before it holds
1121
1159
  * anything, so the dialog's fields stay locked while it does; added, the dialog closes and the screen says the spend
@@ -1761,6 +1799,7 @@ export class AglAccounts extends plugins.deesElement.DeesElement {
1761
1799
  const claudeCodeSlot = slot('claudeCode');
1762
1800
  const liftSlot = slot('liftReserve');
1763
1801
  const prioritySlots = [slot('priority'), slot('clearPriority')].filter((slotArg) => slotArg !== null);
1802
+ const pauseSlots = [slot('pause'), slot('resume')].filter((slotArg) => slotArg !== null);
1764
1803
  const removeSlot = slot('remove');
1765
1804
  const useCodexSlot = slot('useCodex');
1766
1805
  const releaseCodexSlot = slot('releaseCodex');
@@ -1887,10 +1926,13 @@ export class AglAccounts extends plugins.deesElement.DeesElement {
1887
1926
  </div>
1888
1927
  </section>`
1889
1928
  : ''}
1890
- ${prioritySlots.length
1929
+ ${prioritySlots.length || pauseSlots.length
1891
1930
  ? plugins.deesElement.html`<section class="section" data-placement aria-label="Placement">
1892
1931
  <div class="sectionHead"><span>Placement</span></div>
1893
- <div class="card">${this.renderPriority(rowArg, prioritySlots)}</div>
1932
+ <div class="card">
1933
+ ${prioritySlots.length ? this.renderPriority(rowArg, prioritySlots) : ''}
1934
+ ${pauseSlots.length ? this.renderPause(rowArg, pauseSlots) : ''}
1935
+ </div>
1894
1936
  </section>`
1895
1937
  : ''}
1896
1938
  ${rowArg.harnesses.length || rowArg.flexActions.length
@@ -1986,6 +1986,7 @@ const flexAccountUnusableReason = (
1986
1986
  case 'active': return '';
1987
1987
  case 'reauthRequired': return 'Needs a new sign-in. Sign in again in Settings → Accounts.';
1988
1988
  case 'inHostCodex': return interfaces.accountInHostCodexReason;
1989
+ case 'paused': return 'Paused. Resume it in Settings → Accounts.';
1989
1990
  }
1990
1991
  };
1991
1992
 
@@ -17740,6 +17741,10 @@ ${entry.detail.stack}`}</pre>`}
17740
17741
  const unusable = this.providerConnections.find((connection) => (
17741
17742
  connection.id === chosenAccount && connection.status !== 'active'
17742
17743
  ));
17744
+ if (unusable?.status === 'paused') {
17745
+ return `${providerAccountName(unusable)} is paused, so this Flex message was not sent.`
17746
+ + ' Resume it in Settings → Accounts, or choose another account.';
17747
+ }
17743
17748
  if (unusable) {
17744
17749
  return `${providerAccountName(unusable)} needs a new sign-in, so this Flex message was not sent.`
17745
17750
  + ' Sign in again in Settings → Accounts, or choose another account.';
@@ -18098,7 +18103,7 @@ ${entry.detail.stack}`}</pre>`}
18098
18103
  ): Promise<void> {
18099
18104
  if (!this.providerOperationsAvailable()) return;
18100
18105
  if (connectionArg.status !== 'active') {
18101
- this.providerRefreshStatuses.set(connectionArg.id, 'Needs a new sign-in.');
18106
+ this.providerRefreshStatuses.set(connectionArg.id, connectionArg.status === 'paused' ? 'Paused.' : 'Needs a new sign-in.');
18102
18107
  await this.refreshSettingsModalContent();
18103
18108
  return;
18104
18109
  }
@@ -102,14 +102,23 @@ export class AglInbox extends plugins.deesElement.DeesElement {
102
102
  private unsubscribe: (() => void) | undefined;
103
103
  private subscribedFeed: InboxFeed | undefined;
104
104
  private ageTimer: ReturnType<typeof setInterval> | undefined;
105
+ /** The item the detail showed at the last render. */
106
+ private detailShownId = '';
107
+ /** The list and the detail's body scroll on their own; each fades toward an edge past which more lies. */
108
+ private readonly listEdges = new plugins.deesCatalog.ScrollEdgeShadowController(this,
109
+ () => this.shadowRoot?.querySelector<HTMLElement>('.list'));
110
+ private readonly detailEdges = new plugins.deesCatalog.ScrollEdgeShadowController(this,
111
+ () => this.shadowRoot?.querySelector<HTMLElement>('.detailBody'));
105
112
 
106
113
  public static styles = [
107
114
  plugins.deesElement.cssManager.defaultStyles,
108
115
  plugins.deesCatalog.themeDefaultStyles,
116
+ plugins.deesCatalog.scrollEdgeFadeStyles,
109
117
  css`
110
- :host { display: block; height: 100%; min-height: 0; overflow: auto; }
118
+ /* The view itself never scrolls: the list and the detail's body are the two scrollers, each with its own edge fade. */
119
+ :host { display: block; height: 100%; min-height: 0; overflow: hidden; container-type: inline-size; }
111
120
  .page { display: grid; grid-template-rows: auto auto minmax(0, 1fr); gap: 16px; padding: 20px; max-width: 1400px; margin: 0 auto;
112
- min-height: 100%; box-sizing: border-box; }
121
+ height: 100%; box-sizing: border-box; }
113
122
  .head { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 12px 16px; }
114
123
  h2 { margin: 0; font-size: 22px; font-weight: 700; color: var(--dees-color-text-primary); }
115
124
  .subtitle { margin: 4px 0 0; font-size: 13px; color: var(--dees-color-text-secondary); }
@@ -117,8 +126,11 @@ export class AglInbox extends plugins.deesElement.DeesElement {
117
126
  .search { width: 240px; }
118
127
  .notes:empty { display: none; }
119
128
  .notes { display: grid; gap: 8px; }
120
- .split { display: grid; grid-template-columns: minmax(280px, 380px) minmax(0, 1fr); gap: 16px; align-items: start; min-height: 0; }
121
- .list { display: grid; gap: 6px; align-content: start; }
129
+ .split { display: grid; grid-template-columns: minmax(280px, 380px) minmax(0, 1fr); grid-template-rows: minmax(0, 1fr); gap: 16px;
130
+ align-items: start; min-height: 0; }
131
+ /* The padding keeps a row's focus ring inside the scroller, which clips what leaves it. */
132
+ .list { display: grid; gap: 6px; align-content: start; max-height: 100%; min-height: 0; overflow-y: auto; overscroll-behavior: contain;
133
+ padding: 3px; margin: -3px; }
122
134
  .row { display: flex; gap: 12px; align-items: flex-start; width: 100%; padding: 12px; text-align: left; font: inherit;
123
135
  color: var(--dees-color-text-primary); background: var(--dees-color-bg-secondary); border: 1px solid var(--dees-color-border-subtle);
124
136
  border-radius: 10px; cursor: pointer; }
@@ -141,14 +153,16 @@ export class AglInbox extends plugins.deesElement.DeesElement {
141
153
  .title { font-size: 14px; line-height: 1.35; overflow-wrap: anywhere; }
142
154
  .where { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; font-size: 12px; color: var(--dees-color-text-secondary);
143
155
  overflow-wrap: anywhere; }
144
- .detail { display: grid; min-width: 0; background: var(--dees-color-bg-secondary); border: 1px solid var(--dees-color-border-subtle);
156
+ .detail { display: flex; flex-direction: column; max-height: 100%; min-height: 0; box-sizing: border-box; min-width: 0; background: var(--dees-color-bg-secondary); border: 1px solid var(--dees-color-border-subtle);
145
157
  border-radius: 12px; overflow: hidden; }
158
+ .detailHead, .detailFoot { flex: none; }
146
159
  .detailHead { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; padding: 14px 16px;
147
160
  border-bottom: 1px solid var(--dees-color-border-subtle); }
148
161
  .detailWhat { flex: 1; min-width: 0; display: grid; gap: 2px; }
149
162
  .detailKind { margin: 0; font-size: 13px; font-weight: 600; overflow-wrap: anywhere; }
150
163
  .detailMeta { margin: 0; font-size: 12px; color: var(--dees-color-text-secondary); }
151
- .detailBody { display: grid; gap: 14px; padding: 16px; min-width: 0; }
164
+ .detailBody { display: grid; gap: 14px; align-content: start; padding: 16px; min-width: 0; flex: 0 1 auto; min-height: 0; overflow-y: auto;
165
+ overscroll-behavior: contain; }
152
166
  .detailTitle { margin: 0; font-size: 18px; font-weight: 600; line-height: 1.35; overflow-wrap: anywhere; }
153
167
  .line { margin: 0; padding: 10px 12px; border-left: 3px solid var(--dees-color-accent-warning); background: var(--dees-color-fill-tertiary);
154
168
  border-radius: 6px; font-size: 14px; line-height: 1.45; white-space: pre-wrap; overflow-wrap: anywhere; }
@@ -160,7 +174,14 @@ export class AglInbox extends plugins.deesElement.DeesElement {
160
174
  .nothingShown { margin: 0; padding: 12px; font-size: 13px; color: var(--dees-color-text-secondary); }
161
175
  .emptyCard { align-self: start; padding: 40px 24px; background: var(--dees-color-bg-secondary);
162
176
  border: 1px solid var(--dees-color-border-subtle); border-radius: 12px; }
163
- @media (max-width: 900px) { .split { grid-template-columns: minmax(0, 1fr); } .search { width: 100%; } }
177
+ /* One column, by the view's own width (a sidebar may stand beside it): the list keeps at most two fifths of the
178
+ height above the detail, and both still scroll on their own. */
179
+ @container (max-width: 900px) {
180
+ .split { display: flex; flex-direction: column; align-items: stretch; }
181
+ .list { flex: 0 1 auto; max-height: 40%; }
182
+ .detail { flex: 0 1 auto; max-height: none; }
183
+ .search { width: 100%; }
184
+ }
164
185
  @media (max-width: 600px) { .page { padding: 12px; gap: 12px; } h2 { font-size: 19px; } }
165
186
  `,
166
187
  ];
@@ -171,6 +192,26 @@ export class AglInbox extends plugins.deesElement.DeesElement {
171
192
  this.ageTimer ??= setInterval(() => { this.now = Date.now(); }, 30_000);
172
193
  }
173
194
 
195
+ /**
196
+ * Another item took the detail: its body starts at its top, and the item's row is brought into the list's view. Only
197
+ * the list is moved, never by `scrollIntoView`, which would also scroll the view's own clipped box.
198
+ */
199
+ protected updated(changedArg: Map<PropertyKey, unknown>): void {
200
+ super.updated(changedArg);
201
+ const shownId = this.shadowRoot?.querySelector<HTMLElement>('.detail')?.dataset.detail ?? '';
202
+ if (shownId === this.detailShownId) return;
203
+ this.detailShownId = shownId;
204
+ const body = this.shadowRoot?.querySelector<HTMLElement>('.detailBody');
205
+ if (body) body.scrollTop = 0;
206
+ const list = this.shadowRoot?.querySelector<HTMLElement>('.list');
207
+ const row = list?.querySelector<HTMLElement>('.row.selected');
208
+ if (!list || !row) return;
209
+ const listBox = list.getBoundingClientRect();
210
+ const rowBox = row.getBoundingClientRect();
211
+ if (rowBox.top < listBox.top) list.scrollTop -= listBox.top - rowBox.top + 3;
212
+ else if (rowBox.bottom > listBox.bottom) list.scrollTop += rowBox.bottom - listBox.bottom + 3;
213
+ }
214
+
174
215
  public async disconnectedCallback(): Promise<void> {
175
216
  this.unsubscribe?.();
176
217
  this.unsubscribe = undefined;
@@ -284,7 +325,7 @@ export class AglInbox extends plugins.deesElement.DeesElement {
284
325
  const item = this.shownItem();
285
326
  return html`
286
327
  <div class="split">
287
- <div class="list" role="list" aria-label="What waits for you">
328
+ <div class=${`list ${this.listEdges.fadeClasses()}`} role="list" aria-label="What waits for you">
288
329
  ${shown.length === 0 ? html`<p class="nothingShown">Nothing that waits matches.</p>` : shown.map((itemArg) => this.renderRow(itemArg, itemArg.id === item?.id))}
289
330
  </div>
290
331
  ${item ? this.renderDetail(item) : ''}
@@ -336,7 +377,7 @@ export class AglInbox extends plugins.deesElement.DeesElement {
336
377
  ${inboxOpenLabel(itemArg)} <dees-icon icon="lucide:ExternalLink" iconSize="13"></dees-icon>
337
378
  </dees-button>`}
338
379
  </header>
339
- <div class="detailBody">
380
+ <div class=${`detailBody ${this.detailEdges.fadeClasses()}`}>
340
381
  ${this.cardShowsTitle(itemArg) ? '' : html`<h3 class="detailTitle">${itemArg.title}</h3>`}
341
382
  ${this.renderBody(itemArg, state)}
342
383
  </div>