agl 43.9.0 → 43.10.1

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 (147) hide show
  1. package/changelog.md +20 -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.authstore.d.ts +6 -0
  9. package/dist_ts/classes.authstore.js +8 -1
  10. package/dist_ts/classes.controller.d.ts +7 -1
  11. package/dist_ts/classes.controller.js +39 -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.mcpcallerregistry.d.ts +19 -1
  18. package/dist_ts/classes.mcpcallerregistry.js +33 -7
  19. package/dist_ts/classes.terminalcallers.d.ts +40 -0
  20. package/dist_ts/classes.terminalcallers.js +90 -0
  21. package/dist_ts/classes.terminalmanager.d.ts +20 -1
  22. package/dist_ts/classes.terminalmanager.js +36 -2
  23. package/dist_ts/classes.ticketnotifier.d.ts +2 -2
  24. package/dist_ts/classes.ticketnotifier.js +6 -4
  25. package/dist_ts/classes.ticketorderspread.d.ts +25 -0
  26. package/dist_ts/classes.ticketorderspread.js +52 -0
  27. package/dist_ts/classes.ticketstore.d.ts +60 -5
  28. package/dist_ts/classes.ticketstore.js +176 -40
  29. package/dist_ts/classes.workercallers.d.ts +40 -2
  30. package/dist_ts/classes.workercallers.js +156 -30
  31. package/dist_ts/fleet/classes.boardpump.d.ts +1 -1
  32. package/dist_ts/fleet/classes.boardpump.js +4 -2
  33. package/dist_ts/fleet/classes.claudeworkers.d.ts +18 -5
  34. package/dist_ts/fleet/classes.claudeworkers.js +105 -31
  35. package/dist_ts/fleet/classes.ticketeffects.d.ts +11 -0
  36. package/dist_ts/fleet/classes.ticketeffects.js +28 -1
  37. package/dist_ts/fleet/classes.workers.d.ts +23 -4
  38. package/dist_ts/fleet/classes.workers.js +65 -18
  39. package/dist_ts/fleet/functions.workervalidation.js +7 -4
  40. package/dist_ts/fleet/interfaces.workers.d.ts +16 -2
  41. package/dist_ts/fleet/interfaces.workers.js +8 -1
  42. package/dist_ts/functions.fleetworkercli.d.ts +3 -1
  43. package/dist_ts/functions.fleetworkercli.js +6 -2
  44. package/dist_ts/functions.inferencecli.js +4 -1
  45. package/dist_ts/functions.mcpfleetworkertools.js +3 -3
  46. package/dist_ts/functions.proxycapacity.d.ts +2 -1
  47. package/dist_ts/functions.proxycapacity.js +6 -3
  48. package/dist_ts/functions.proxycapacitycli.js +2 -2
  49. package/dist_ts/functions.workerprocessproof.d.ts +6 -0
  50. package/dist_ts/functions.workerprocessproof.js +8 -3
  51. package/dist_ts/interfaces.auth.d.ts +1 -1
  52. package/dist_ts/interfaces.auth.js +2 -1
  53. package/dist_ts/interfaces.flexipc.d.ts +3 -1
  54. package/dist_ts/interfaces.flexipc.js +1 -1
  55. package/dist_ts_authswitch/authority-contract.d.ts +25 -0
  56. package/dist_ts_authswitch/authority-contract.js +1 -1
  57. package/dist_ts_authswitch/authority-overview.d.ts +7 -0
  58. package/dist_ts_authswitch/authority-overview.js +10 -6
  59. package/dist_ts_authswitch/authority-placement.d.ts +5 -2
  60. package/dist_ts_authswitch/authority-placement.js +6 -3
  61. package/dist_ts_authswitch/classes.authoritybroker.d.ts +6 -0
  62. package/dist_ts_authswitch/classes.authoritybroker.js +26 -1
  63. package/dist_ts_authswitch/classes.authoritycli.d.ts +1 -0
  64. package/dist_ts_authswitch/classes.authoritycli.js +50 -4
  65. package/dist_ts_authswitch/classes.authorityclient.d.ts +3 -1
  66. package/dist_ts_authswitch/classes.authorityclient.js +9 -4
  67. package/dist_ts_authswitch/classes.authoritydaemon.js +7 -1
  68. package/dist_ts_authswitch/classes.authoritydatabase.js +5 -1
  69. package/dist_ts_authswitch/classes.authoritymodels.d.ts +7 -0
  70. package/dist_ts_authswitch/classes.authoritymodels.js +13 -6
  71. package/dist_ts_interfaces/fleetworkers.d.ts +26 -1
  72. package/dist_ts_interfaces/fleetworkers.js +1 -1
  73. package/dist_ts_interfaces/interfaces.d.ts +4 -2
  74. package/dist_ts_interfaces/interfaces.js +1 -1
  75. package/dist_ts_interfaces/mcprequests.d.ts +2 -1
  76. package/dist_ts_interfaces/mcprequests.js +3 -2
  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_migration/classes.documentmigrationrunner.d.ts +8 -1
  84. package/dist_ts_migration/classes.documentmigrationrunner.js +11 -2
  85. package/dist_ts_migration/index.d.ts +1 -0
  86. package/dist_ts_migration/index.js +2 -1
  87. package/dist_ts_migration/v41_ticketclosedcolumn.js +7 -3
  88. package/dist_ts_migration/v43_ticketorderstride.d.ts +54 -0
  89. package/dist_ts_migration/v43_ticketorderstride.js +161 -0
  90. package/docs/authswitch.md +22 -0
  91. package/package.json +1 -1
  92. package/readme.md +71 -4
  93. package/ts/00_commitinfo_data.ts +1 -1
  94. package/ts/aglapi/aglapisurface.document.ts +2 -2
  95. package/ts/classes.accountsactions.ts +25 -0
  96. package/ts/classes.authstore.ts +9 -0
  97. package/ts/classes.controller.ts +37 -3
  98. package/ts/classes.inferencegateway.ts +6 -4
  99. package/ts/classes.inferenceplacement.ts +1 -1
  100. package/ts/classes.inferencerouter.ts +49 -10
  101. package/ts/classes.inferenceservice.ts +1 -1
  102. package/ts/classes.mcpcallerregistry.ts +49 -7
  103. package/ts/classes.terminalcallers.ts +91 -0
  104. package/ts/classes.terminalmanager.ts +41 -1
  105. package/ts/classes.ticketnotifier.ts +5 -3
  106. package/ts/classes.ticketorderspread.ts +50 -0
  107. package/ts/classes.ticketstore.ts +164 -35
  108. package/ts/classes.workercallers.ts +183 -30
  109. package/ts/fleet/classes.boardpump.ts +3 -2
  110. package/ts/fleet/classes.claudeworkers.ts +101 -29
  111. package/ts/fleet/classes.ticketeffects.ts +25 -0
  112. package/ts/fleet/classes.workers.ts +62 -17
  113. package/ts/fleet/functions.workervalidation.ts +6 -3
  114. package/ts/fleet/interfaces.workers.ts +16 -2
  115. package/ts/functions.fleetworkercli.ts +5 -1
  116. package/ts/functions.inferencecli.ts +2 -0
  117. package/ts/functions.mcpfleetworkertools.ts +2 -2
  118. package/ts/functions.proxycapacity.ts +5 -2
  119. package/ts/functions.proxycapacitycli.ts +1 -1
  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/mcprequests.ts +2 -1
  135. package/ts_interfaces/proxycapacity.ts +1 -1
  136. package/ts_interfaces/requests.accounts.ts +17 -0
  137. package/ts_interfaces/requests.fleetworkers.ts +3 -1
  138. package/ts_interfaces/requests.ts +2 -0
  139. package/ts_migration/classes.documentmigrationrunner.ts +12 -1
  140. package/ts_migration/index.ts +1 -0
  141. package/ts_migration/v41_ticketclosedcolumn.ts +6 -2
  142. package/ts_migration/v43_ticketorderstride.ts +156 -0
  143. package/ts_web/00_commitinfo_data.ts +1 -1
  144. package/ts_web/accounts.templates.ts +12 -2
  145. package/ts_web/classes.accountsreadmodel.ts +42 -6
  146. package/ts_web/elements.accounts.ts +45 -3
  147. package/ts_web/elements.harnesscontrollerapp.ts +6 -1
@@ -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
@@ -15,7 +15,9 @@ import { TicketOwnerPrincipalV38Migration } from './v38_ticketownerprincipal.js'
15
15
  import { TicketClosedColumnV41Migration } from './v41_ticketclosedcolumn.js';
16
16
  import { TicketLinkReposV41Migration } from './v41_ticketlinkrepos.js';
17
17
  import { TicketActorNamesV43Migration } from './v43_ticketactornames.js';
18
+ import { TicketOrderStrideV43Migration } from './v43_ticketorderstride.js';
18
19
  import type { IControllerIssuerIdentity } from '../ts/interfaces.identity.js';
20
+ import type { TicketStore } from '../ts/classes.ticketstore.js';
19
21
 
20
22
  interface IDocumentMigration {
21
23
  run(): Promise<void>;
@@ -58,7 +60,8 @@ export class PostDatabaseDocumentMigrationRunner {
58
60
  /**
59
61
  * The ticket migrations of a controller start, in their order; a new one goes last. v38 gives owner assignments the
60
62
  * store's principal, v41 moves tickets released by hand without a release link to closed, and v43 names ticket actors
61
- * by their role (AGL-1686). Answers the keys v41 moved and those whose revision v43 moved.
63
+ * by their role (AGL-1686). Answers the keys v41 moved and those whose revision v43 moved. The order spread (AGL-1907)
64
+ * is not one of them: it runs after the controller is ready (`runTicketOrderStride`).
62
65
  */
63
66
  public async runTicketStart(principalIdArg: string): Promise<{ closed: string[]; renamed: string[] }> {
64
67
  await this.runTicketOwnerPrincipal(principalIdArg);
@@ -84,6 +87,14 @@ export class PostDatabaseDocumentMigrationRunner {
84
87
  return await new TicketActorNamesV43Migration(this.database).run();
85
88
  }
86
89
 
90
+ /**
91
+ * AGL-1907: once, every column's tickets take orders a stride apart in their board order, through `storeArg`'s steps
92
+ * on the live board, until `signalArg` ends it; answers the keys it moved.
93
+ */
94
+ public async runTicketOrderStride(storeArg: TicketStore, signalArg: AbortSignal): Promise<string[]> {
95
+ return await new TicketOrderStrideV43Migration(this.database, storeArg).run(signalArg);
96
+ }
97
+
87
98
  /**
88
99
  * AGL-909: once, links and release plans name each repository `resolveArg` resolves as `org/name`; answers the keys it
89
100
  * changed. With no repository discovered (`discoveredArg` 0) it waits for a later start.
@@ -29,4 +29,5 @@ export * from './v41_ticketmigrationmarkers.js';
29
29
  export * from './v41_ticketclosedcolumn.js';
30
30
  export * from './v41_ticketlinkrepos.js';
31
31
  export * from './v43_ticketactornames.js';
32
+ export * from './v43_ticketorderstride.js';
32
33
  export * from './v43_flexpostharnessmigrationmarkers.js';
@@ -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 };
@@ -0,0 +1,156 @@
1
+ import * as plugins from './plugins.js';
2
+ import { TicketModel } from '../ts/classes.ticketmodels.js';
3
+ import { TicketError, ticketOrderStride, type TicketStore } from '../ts/classes.ticketstore.js';
4
+ import { AuthError } from '../ts/interfaces.auth.js';
5
+ import { ticketColumns, type TTicketColumn } from '../ts_interfaces/tickets.js';
6
+ import { TicketMigrationMarkerModel } from './v41_ticketmigrationmarkers.js';
7
+
8
+ export const ticketOrderStrideMigrationId = 'v43_ticketorderstride';
9
+
10
+ /** Ticket documents one query of a column reads. */
11
+ const pageRecords = 500;
12
+ /**
13
+ * The tickets one transaction moves at most. It runs on a live board and holds the board's fence while it writes them,
14
+ * so a mutation that meets it runs again once it commits: 64 keeps that wait short (on a fully loaded host, 200 tickets
15
+ * took 1.8 s in one transaction, and the engine's cost per write grows with its transaction).
16
+ */
17
+ const chunkTickets = 64;
18
+
19
+ type TTicketStored = Awaited<ReturnType<typeof TicketModel.exact.findStored>>[number];
20
+
21
+ /** A transaction's outcome: the keys it moved, and whether its column holds nothing more to move. */
22
+ interface IChunkResult { moved: string[]; complete: boolean }
23
+
24
+ /**
25
+ * The deadlines in a row one transaction may reach after it lost a write conflict, 20 s each, before the run ends: 60 s
26
+ * without a commit is a board the spread does not get through now, or a transaction too slow for its deadline.
27
+ */
28
+ const deadlinesInARow = 3;
29
+
30
+ /**
31
+ * Whether a transaction that the driver ran more than once, so that lost a write conflict, ended without committing at
32
+ * its deadline. `TicketStore.migrate` gives every transaction a deadline, and with one the client rejects with `timeout`
33
+ * when the driver's retries run out (never with `transaction_conflict`, which only a transaction without one meets).
34
+ */
35
+ const lostConflicts = (errorArg: unknown): boolean => errorArg instanceof plugins.nosqldb.SmartdataPersistenceError
36
+ && errorArg.code === 'timeout';
37
+
38
+ /**
39
+ * AGL-1907: releases before kept each column's orders dense (0, 1, 2, …), so a placement before a ticket finds no free
40
+ * integer and moves a run of tickets by one. Once, every column's tickets take `(rank + 1) × ticketOrderStride` in their
41
+ * board order (by order, then by id, as the board breaks ties), so a placement finds the gap a stride leaves and writes
42
+ * one ticket.
43
+ *
44
+ * It runs after the controller is ready, in the background (`TicketOrderSpread`): the store is correct on dense orders,
45
+ * so nothing waits for it. Column by column in `ticketColumns` order, in transactions of at most `chunkTickets`
46
+ * tickets, each reading the column again. A ticket whose order rises moves after every one above it that rises, from
47
+ * the column's end down, and one whose order falls after every one below it that falls, from the column's head up (the
48
+ * rising ones first): each takes an order between its neighbours' orders as they stand, so the column keeps its board
49
+ * order after every transaction, and the next one, ranking the column again, finds the same ranks and only the tickets
50
+ * not yet moved. A spread column is a fixed point, so a run cut short starts again and finishes the rest; the
51
+ * transaction that completes the last column (`closed`) writes the marker, alone when nothing is left to move, and a
52
+ * later start does nothing whatever the board holds.
53
+ *
54
+ * Each transaction is a step of the ticket store (`TicketStore.migrate`): it takes the board fence every mutation takes
55
+ * and moves the revision of every ticket whose order it changes, and once it commits the store tells clients, devices
56
+ * and the board pump of the new revision and those tickets, as after a mutation. A mutation that meets a step re-runs,
57
+ * and a step that meets a mutation re-runs, as the driver re-runs every transaction that loses a write conflict. A
58
+ * transaction's first attempt reads its column before it takes the fence, so mutations go on while it reads and wait
59
+ * only for its writes; but then any mutation that commits while it reads makes it lose, and a busy board would starve
60
+ * it. An attempt after a lost one therefore takes the fence first: it waits for the mutations in flight, and the
61
+ * mutations that come after it wait for its read and its writes. A transaction that lost to a mutation and then reached the
62
+ * store's 20 s deadline runs again (nothing of it committed), up to `deadlinesInARow` deadlines in a row: a lost
63
+ * conflict does not prove the conflicts made it late (an attempt that won the fence may simply be too slow), so the
64
+ * next deadline in a row after them ends the run as any other failure does, and the next controller start continues
65
+ * it; every commit starts the count again. It changes nothing else of a ticket and adds no history, as the v41 migration did when it closed the released
66
+ * column's gaps.
67
+ */
68
+ export class TicketOrderStrideV43Migration {
69
+ constructor(private readonly database: plugins.nosqldb.SmartdataDb | undefined, private readonly store: TicketStore) {}
70
+
71
+ /**
72
+ * Runs the spread to its end, one transaction after another, and answers the keys of the tickets whose order it
73
+ * moved, column by column, in the order it first moved them (a mutation that places a ticket before tickets already
74
+ * spread changes their ranks, so the run moves them again). `signalArg` ends it: the run rejects with the signal's
75
+ * reason, and the transaction in flight rolls back unless its commit was already sent.
76
+ */
77
+ public async run(signalArg: AbortSignal): Promise<string[]> {
78
+ if (!this.database) throw new AuthError('not_initialized', 'The authentication store database is unavailable.');
79
+ if (await TicketMigrationMarkerModel.exact.findStoredOne({ id: ticketOrderStrideMigrationId }, { signal: signalArg })) return [];
80
+ const spread = new Set<string>();
81
+ for (const [index, columnId] of ticketColumns.entries()) {
82
+ const last = index === ticketColumns.length - 1;
83
+ /** Whether the column's next transaction lost a write conflict before: its attempts then take the fence first. */
84
+ let lost = false;
85
+ /** The deadlines the column's next transaction reached in a row since the last commit. */
86
+ let deadlines = 0;
87
+ while (true) {
88
+ signalArg.throwIfAborted();
89
+ let attempts = 0;
90
+ let result: IChunkResult;
91
+ try {
92
+ result = await this.store.migrate((sessionArg, fenceArg) => {
93
+ attempts += 1;
94
+ return this.chunk(sessionArg, fenceArg, columnId, last ? spread : undefined, lost || attempts > 1);
95
+ }, signalArg);
96
+ } catch (errorArg) {
97
+ // The driver ran it again after lost write conflicts until the deadline: it runs again, nothing committed,
98
+ // unless it reached `deadlinesInARow` deadlines without a commit.
99
+ if (attempts > 1 && lostConflicts(errorArg) && ++deadlines < deadlinesInARow) { lost = true; continue; }
100
+ throw errorArg;
101
+ }
102
+ lost = false;
103
+ deadlines = 0;
104
+ for (const key of result.moved) spread.add(key);
105
+ if (result.complete) break;
106
+ }
107
+ }
108
+ return [...spread];
109
+ }
110
+
111
+ /**
112
+ * One attempt of a transaction: up to `chunkTickets` tickets of the column take their stride order, after the board
113
+ * fence, which an attempt after a lost one (`fenceFirstArg`) takes before it reads the column. With `markerArg` (the
114
+ * keys moved so far) the transaction that completes the column writes the marker too. Nothing outside the transaction
115
+ * changes here: the driver may run it again.
116
+ */
117
+ private async chunk(sessionArg: plugins.nosqldb.SmartdataSession, fenceArg: () => Promise<void>, columnIdArg: TTicketColumn,
118
+ markerArg: ReadonlySet<string> | undefined, fenceFirstArg: boolean): Promise<{ ticketIds: string[]; result: IChunkResult }> {
119
+ const options = { session: sessionArg };
120
+ if (fenceFirstArg) await fenceArg();
121
+ const ranked = (await this.page(columnIdArg, sessionArg))
122
+ .sort((leftArg, rightArg) => leftArg.ticket.order - rightArg.ticket.order || (leftArg.id < rightArg.id ? -1 : 1))
123
+ .map((recordArg, rankArg) => ({ record: recordArg, order: (rankArg + 1) * ticketOrderStride }));
124
+ const moving = [...ranked.filter((entryArg) => entryArg.order > entryArg.record.ticket.order).reverse(),
125
+ ...ranked.filter((entryArg) => entryArg.order < entryArg.record.ticket.order)];
126
+ const taken = moving.slice(0, chunkTickets);
127
+ if (taken.length) await fenceArg();
128
+ for (const { record, order } of taken) {
129
+ const moved = await TicketModel.exact.transition({ current: record, change: (modelArg) => {
130
+ modelArg.ticket = { ...modelArg.ticket, order, revision: (modelArg.ticket.revision ?? 0) + 1 };
131
+ } }, options);
132
+ if (moved.status !== 'transitioned') throw new TicketError('concurrent_change', 'A ticket changed during the order spread.');
133
+ }
134
+ const moved = taken.map((entryArg) => entryArg.record.id);
135
+ const complete = moving.length === taken.length;
136
+ if (markerArg && complete) {
137
+ const inserted = await TicketMigrationMarkerModel.exact.insert({ id: ticketOrderStrideMigrationId, completedAt: new Date().toISOString(),
138
+ tickets: [...new Set([...markerArg, ...moved])] }, options);
139
+ if (inserted.status !== 'inserted') throw new TicketError('concurrent_change', 'The order spread ran twice.');
140
+ }
141
+ return { ticketIds: moved, result: { moved, complete } };
142
+ }
143
+
144
+ /** Every ticket of a column, read by id a page at a time. */
145
+ private async page(columnIdArg: TTicketColumn, sessionArg: plugins.nosqldb.SmartdataSession): Promise<TTicketStored[]> {
146
+ const records: TTicketStored[] = [];
147
+ let after: string | undefined;
148
+ while (true) {
149
+ const page = await TicketModel.exact.findStored({ filter: { 'ticket.columnId': columnIdArg, ...(after ? { id: { $gt: after } } : {}) },
150
+ sort: { id: 1 }, limit: pageRecords, session: sessionArg });
151
+ records.push(...page);
152
+ if (page.length < pageRecords) return records;
153
+ after = page.at(-1)!.id;
154
+ }
155
+ }
156
+ }
@@ -3,6 +3,6 @@
3
3
  */
4
4
  export const commitinfo = {
5
5
  name: 'agl',
6
- version: '43.9.0',
6
+ version: '43.10.1',
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
  }