agl 43.9.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 (114) hide show
  1. package/changelog.md +12 -0
  2. package/dist_serve/bundle.js +997 -975
  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 +3 -3
  6. package/dist_ts/classes.accountsactions.d.ts +3 -1
  7. package/dist_ts/classes.accountsactions.js +17 -1
  8. package/dist_ts/classes.controller.d.ts +1 -1
  9. package/dist_ts/classes.controller.js +21 -7
  10. package/dist_ts/classes.inferencegateway.js +7 -5
  11. package/dist_ts/classes.inferenceplacement.d.ts +1 -1
  12. package/dist_ts/classes.inferencerouter.d.ts +20 -3
  13. package/dist_ts/classes.inferencerouter.js +37 -10
  14. package/dist_ts/classes.inferenceservice.js +2 -2
  15. package/dist_ts/classes.ticketnotifier.d.ts +2 -2
  16. package/dist_ts/classes.ticketnotifier.js +6 -4
  17. package/dist_ts/classes.ticketstore.d.ts +33 -5
  18. package/dist_ts/classes.ticketstore.js +109 -26
  19. package/dist_ts/classes.workercallers.d.ts +35 -1
  20. package/dist_ts/classes.workercallers.js +139 -28
  21. package/dist_ts/fleet/classes.boardpump.d.ts +1 -1
  22. package/dist_ts/fleet/classes.boardpump.js +4 -2
  23. package/dist_ts/fleet/classes.ticketeffects.d.ts +11 -0
  24. package/dist_ts/fleet/classes.ticketeffects.js +28 -1
  25. package/dist_ts/fleet/classes.workers.d.ts +18 -1
  26. package/dist_ts/fleet/classes.workers.js +49 -8
  27. package/dist_ts/fleet/functions.workervalidation.js +7 -4
  28. package/dist_ts/functions.fleetworkercli.d.ts +3 -1
  29. package/dist_ts/functions.fleetworkercli.js +6 -2
  30. package/dist_ts/functions.inferencecli.js +4 -1
  31. package/dist_ts/functions.mcpfleetworkertools.js +3 -3
  32. package/dist_ts/functions.proxycapacity.d.ts +2 -1
  33. package/dist_ts/functions.proxycapacity.js +6 -3
  34. package/dist_ts/functions.proxycapacitycli.js +2 -2
  35. package/dist_ts/functions.workerprocessproof.d.ts +6 -0
  36. package/dist_ts/functions.workerprocessproof.js +8 -3
  37. package/dist_ts/interfaces.auth.d.ts +1 -1
  38. package/dist_ts/interfaces.auth.js +2 -1
  39. package/dist_ts/interfaces.flexipc.d.ts +3 -1
  40. package/dist_ts/interfaces.flexipc.js +1 -1
  41. package/dist_ts_authswitch/authority-contract.d.ts +25 -0
  42. package/dist_ts_authswitch/authority-contract.js +1 -1
  43. package/dist_ts_authswitch/authority-overview.d.ts +7 -0
  44. package/dist_ts_authswitch/authority-overview.js +10 -6
  45. package/dist_ts_authswitch/authority-placement.d.ts +5 -2
  46. package/dist_ts_authswitch/authority-placement.js +6 -3
  47. package/dist_ts_authswitch/classes.authoritybroker.d.ts +6 -0
  48. package/dist_ts_authswitch/classes.authoritybroker.js +26 -1
  49. package/dist_ts_authswitch/classes.authoritycli.d.ts +1 -0
  50. package/dist_ts_authswitch/classes.authoritycli.js +50 -4
  51. package/dist_ts_authswitch/classes.authorityclient.d.ts +3 -1
  52. package/dist_ts_authswitch/classes.authorityclient.js +9 -4
  53. package/dist_ts_authswitch/classes.authoritydaemon.js +7 -1
  54. package/dist_ts_authswitch/classes.authoritydatabase.js +5 -1
  55. package/dist_ts_authswitch/classes.authoritymodels.d.ts +7 -0
  56. package/dist_ts_authswitch/classes.authoritymodels.js +13 -6
  57. package/dist_ts_interfaces/fleetworkers.d.ts +26 -1
  58. package/dist_ts_interfaces/fleetworkers.js +1 -1
  59. package/dist_ts_interfaces/interfaces.d.ts +4 -2
  60. package/dist_ts_interfaces/interfaces.js +1 -1
  61. package/dist_ts_interfaces/proxycapacity.d.ts +1 -1
  62. package/dist_ts_interfaces/requests.accounts.d.ts +19 -0
  63. package/dist_ts_interfaces/requests.accounts.js +1 -1
  64. package/dist_ts_interfaces/requests.d.ts +2 -2
  65. package/dist_ts_interfaces/requests.fleetworkers.d.ts +3 -1
  66. package/dist_ts_interfaces/requests.js +1 -1
  67. package/dist_ts_migration/v41_ticketclosedcolumn.js +7 -3
  68. package/docs/authswitch.md +22 -0
  69. package/package.json +1 -1
  70. package/readme.md +54 -3
  71. package/ts/00_commitinfo_data.ts +1 -1
  72. package/ts/aglapi/aglapisurface.document.ts +2 -2
  73. package/ts/classes.accountsactions.ts +25 -0
  74. package/ts/classes.controller.ts +18 -3
  75. package/ts/classes.inferencegateway.ts +6 -4
  76. package/ts/classes.inferenceplacement.ts +1 -1
  77. package/ts/classes.inferencerouter.ts +49 -10
  78. package/ts/classes.inferenceservice.ts +1 -1
  79. package/ts/classes.ticketnotifier.ts +5 -3
  80. package/ts/classes.ticketstore.ts +103 -24
  81. package/ts/classes.workercallers.ts +165 -28
  82. package/ts/fleet/classes.boardpump.ts +3 -2
  83. package/ts/fleet/classes.ticketeffects.ts +25 -0
  84. package/ts/fleet/classes.workers.ts +47 -7
  85. package/ts/fleet/functions.workervalidation.ts +6 -3
  86. package/ts/functions.fleetworkercli.ts +5 -1
  87. package/ts/functions.inferencecli.ts +2 -0
  88. package/ts/functions.mcpfleetworkertools.ts +2 -2
  89. package/ts/functions.proxycapacity.ts +5 -2
  90. package/ts/functions.proxycapacitycli.ts +1 -1
  91. package/ts/functions.workerprocessproof.ts +10 -2
  92. package/ts/interfaces.auth.ts +1 -0
  93. package/ts/interfaces.flexipc.ts +3 -1
  94. package/ts_authswitch/authority-contract.ts +20 -0
  95. package/ts_authswitch/authority-overview.ts +17 -6
  96. package/ts_authswitch/authority-placement.ts +7 -3
  97. package/ts_authswitch/classes.authoritybroker.ts +24 -0
  98. package/ts_authswitch/classes.authoritycli.ts +58 -4
  99. package/ts_authswitch/classes.authorityclient.ts +11 -4
  100. package/ts_authswitch/classes.authoritydaemon.ts +8 -1
  101. package/ts_authswitch/classes.authoritydatabase.ts +3 -0
  102. package/ts_authswitch/classes.authoritymodels.ts +12 -4
  103. package/ts_interfaces/fleetworkers.ts +26 -1
  104. package/ts_interfaces/interfaces.ts +4 -2
  105. package/ts_interfaces/proxycapacity.ts +1 -1
  106. package/ts_interfaces/requests.accounts.ts +17 -0
  107. package/ts_interfaces/requests.fleetworkers.ts +3 -1
  108. package/ts_interfaces/requests.ts +2 -0
  109. package/ts_migration/v41_ticketclosedcolumn.ts +6 -2
  110. package/ts_web/00_commitinfo_data.ts +1 -1
  111. package/ts_web/accounts.templates.ts +12 -2
  112. package/ts_web/classes.accountsreadmodel.ts +42 -6
  113. package/ts_web/elements.accounts.ts +45 -3
  114. package/ts_web/elements.harnesscontrollerapp.ts +6 -1
@@ -1693,9 +1693,11 @@ export type TControllerSessionIntelligenceRemedy = (typeof controllerSessionInte
1693
1693
 
1694
1694
  /**
1695
1695
  * `inHostCodex`: this host's Codex runs on the account and renews its login, so Flex cannot use it until this host's
1696
- * Codex is switched to another account (see `accountInHostCodexReason`).
1696
+ * Codex is switched to another account (see `accountInHostCodexReason`). `paused`: the account's owner holds it
1697
+ * paused in Accounts (AGL-1933), so no new conversation can choose it and a conversation on it sends nothing until it
1698
+ * is resumed; an account that also needs a sign-in, or runs this host's Codex, says that instead.
1697
1699
  */
1698
- export type TControllerProviderConnectionStatus = 'active' | 'reauthRequired' | 'inHostCodex';
1700
+ export type TControllerProviderConnectionStatus = 'active' | 'reauthRequired' | 'inHostCodex' | 'paused';
1699
1701
  export type TControllerModelRefreshJobStatus =
1700
1702
  | 'pending'
1701
1703
  | 'running'
@@ -42,7 +42,7 @@ export type TProxyCapacityMemberState = 'available' | 'reserved' | 'exhausted' |
42
42
  export const proxyCapacityMemberStates: readonly TProxyCapacityMemberState[] = ['available', 'reserved', 'exhausted',
43
43
  'cooling', 'unavailable'];
44
44
 
45
- /** An account the pool counts: a subscription sign-in of a counted plan that has not lapsed. */
45
+ /** An account the pool counts: a subscription sign-in of a counted plan that has not lapsed and is not paused. */
46
46
  export interface IProxyCapacityMember {
47
47
  /** The account's id (64 hex characters). */
48
48
  accountId: string;
@@ -290,6 +290,23 @@ export interface IReq_ControllerAccountsPriority extends plugins.typedrequestInt
290
290
  response: { answer: TControllerAccountsAnswer<TControllerAccount> };
291
291
  }
292
292
 
293
+ /**
294
+ * Pauses an account (AGL-1933), or resumes it with `paused: false`. A paused account takes no new work until it is
295
+ * resumed: AGL's inference proxy leaves it out of every pool and moves the sessions on it to another account, and a
296
+ * client restricted to it is refused with the reason. Its sign-in, logins, usage readings, limits and renewal stay as
297
+ * they are; a priority it holds ends. `expectedRevision` is the revision the view showed, so a change of an account
298
+ * that changed meanwhile is refused as `account_changed` by the service. The answer arrives only once the projection
299
+ * shows the result.
300
+ */
301
+ export interface IReq_ControllerAccountsPause extends plugins.typedrequestInterfaces.implementsTR<
302
+ plugins.typedrequestInterfaces.ITypedRequest,
303
+ IReq_ControllerAccountsPause
304
+ > {
305
+ method: 'controller.accounts.pause';
306
+ request: { accountId: string; expectedRevision: number; paused: boolean };
307
+ response: { answer: TControllerAccountsAnswer<TControllerAccount> };
308
+ }
309
+
293
310
  /** Duration validation shared with the authority; no implicit duration is supplied. */
294
311
  export const isControllerReserveLiftHours = plugins.authswitchAuthority.isAuthSwitchReserveLiftHours;
295
312
 
@@ -1,5 +1,5 @@
1
1
  import type * as plugins from './plugins.js';
2
- import type { IFleetWorker, IFleetWorkerJob, IFleetWorkerReport, IFleetWorkerTurnOutcome, TFleetWorkerAction, TFleetWorkerRequest, TFleetWorkerResponse } from './fleetworkers.js';
2
+ import type { IFleetWorker, IFleetWorkerIdentity, IFleetWorkerJob, IFleetWorkerReport, IFleetWorkerTurnOutcome, TFleetWorkerAction, TFleetWorkerRequest, TFleetWorkerResponse } from './fleetworkers.js';
3
3
  import type { IControllerDraftAttachment, IControllerMessageBundle, IControllerNativeWait } from './interfaces.js';
4
4
  export const controllerMcpFleetWorkerMethods = ['start', 'adopt', 'resolve-lost', 'reconfirm', 'steer', 'report', 'stop', 'archive', 'refresh', 'move', 'list', 'get', 'status', 'job-wait', 'watch', 'native-message'].map(
5
5
  (action) => `agl.mcp.fleet.worker.${action}`,
@@ -27,6 +27,8 @@ export interface IControllerFleetWorkerView {
27
27
  nativeWait?: IControllerNativeWait;
28
28
  /** The tail of the newest assistant text the controller last observed, for harnesses whose poll records it. */
29
29
  excerpt?: string;
30
+ /** Present while the worker's MCP calls run without its identity; see `IFleetWorkerIdentity`. */
31
+ identity?: IFleetWorkerIdentity;
30
32
  }
31
33
  /**
32
34
  * The owner's fleet workers that are not archived. No AGL client sends it since the Driver view lists direct reports:
@@ -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
@@ -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.9.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
  }