agl 43.6.0 → 43.8.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 (166) hide show
  1. package/changelog.md +27 -0
  2. package/dist_serve/bundle.js +1801 -1783
  3. package/dist_serve/bundle.js.map +2 -2
  4. package/dist_ts/00_commitinfo_data.js +1 -1
  5. package/dist_ts/aglapi/interfaces.d.ts +35 -0
  6. package/dist_ts/aglapi/interfaces.js +9 -1
  7. package/dist_ts/classes.accountsactions.d.ts +3 -1
  8. package/dist_ts/classes.accountsactions.js +17 -1
  9. package/dist_ts/classes.apnsclient.d.ts +97 -0
  10. package/dist_ts/classes.apnsclient.js +363 -0
  11. package/dist_ts/classes.authmodels.js +19 -6
  12. package/dist_ts/classes.authstore.js +15 -2
  13. package/dist_ts/classes.cli.js +8 -1
  14. package/dist_ts/classes.controller.d.ts +33 -6
  15. package/dist_ts/classes.controller.js +254 -12
  16. package/dist_ts/classes.controllerdevices.d.ts +35 -7
  17. package/dist_ts/classes.controllerdevices.js +86 -13
  18. package/dist_ts/classes.controllerpush.d.ts +111 -0
  19. package/dist_ts/classes.controllerpush.js +299 -0
  20. package/dist_ts/classes.fcmclient.d.ts +78 -0
  21. package/dist_ts/classes.fcmclient.js +278 -0
  22. package/dist_ts/classes.inbox.d.ts +10 -2
  23. package/dist_ts/classes.inbox.js +9 -2
  24. package/dist_ts/classes.inferencerouter.d.ts +21 -3
  25. package/dist_ts/classes.inferencerouter.js +40 -17
  26. package/dist_ts/classes.inferenceservice.js +2 -2
  27. package/dist_ts/classes.mcpclient.d.ts +5 -0
  28. package/dist_ts/classes.mcpclient.js +18 -6
  29. package/dist_ts/classes.mcpcontrollerhost.d.ts +3 -0
  30. package/dist_ts/classes.mcpcontrollerhost.js +19 -1
  31. package/dist_ts/classes.mcpvalidation.js +4 -1
  32. package/dist_ts/classes.mcpworkercaller.d.ts +6 -0
  33. package/dist_ts/classes.mcpworkercaller.js +26 -4
  34. package/dist_ts/classes.pushdelivery.d.ts +115 -0
  35. package/dist_ts/classes.pushdelivery.js +311 -0
  36. package/dist_ts/classes.pushhandover.d.ts +46 -0
  37. package/dist_ts/classes.pushhandover.js +131 -0
  38. package/dist_ts/classes.pushregistrations.d.ts +96 -0
  39. package/dist_ts/classes.pushregistrations.js +263 -0
  40. package/dist_ts/classes.pushsettings.d.ts +125 -0
  41. package/dist_ts/classes.pushsettings.js +377 -0
  42. package/dist_ts/classes.workercallers.d.ts +73 -2
  43. package/dist_ts/classes.workercallers.js +354 -43
  44. package/dist_ts/driver/classes.directreports.d.ts +5 -0
  45. package/dist_ts/driver/classes.directreports.js +3 -2
  46. package/dist_ts/fleet/classes.workerlaunches.d.ts +6 -4
  47. package/dist_ts/fleet/classes.workerlaunches.js +10 -9
  48. package/dist_ts/fleet/classes.workers.d.ts +12 -2
  49. package/dist_ts/fleet/classes.workers.js +82 -2
  50. package/dist_ts/functions.deviceapi.d.ts +23 -3
  51. package/dist_ts/functions.deviceapi.js +41 -3
  52. package/dist_ts/functions.inferencecli.js +2 -1
  53. package/dist_ts/functions.pushcli.d.ts +43 -0
  54. package/dist_ts/functions.pushcli.js +201 -0
  55. package/dist_ts/functions.pushcredentials.d.ts +53 -0
  56. package/dist_ts/functions.pushcredentials.js +111 -0
  57. package/dist_ts/functions.pushwire.d.ts +8 -0
  58. package/dist_ts/functions.pushwire.js +83 -0
  59. package/dist_ts/functions.remotecli.d.ts +2 -2
  60. package/dist_ts/functions.remotecli.js +4 -4
  61. package/dist_ts/functions.workercallervalidation.js +3 -2
  62. package/dist_ts/functions.workerprocessproof.d.ts +12 -0
  63. package/dist_ts/functions.workerprocessproof.js +32 -1
  64. package/dist_ts/interfaces.auth.d.ts +27 -3
  65. package/dist_ts/interfaces.auth.js +10 -1
  66. package/dist_ts/interfaces.lifecycle.d.ts +7 -1
  67. package/dist_ts/interfaces.push.d.ts +69 -0
  68. package/dist_ts/interfaces.push.js +25 -0
  69. package/dist_ts/plugins.d.ts +5 -2
  70. package/dist_ts/plugins.js +7 -3
  71. package/dist_ts_authswitch/authority-contract.d.ts +26 -0
  72. package/dist_ts_authswitch/authority-contract.js +1 -1
  73. package/dist_ts_authswitch/authority-overview.d.ts +8 -0
  74. package/dist_ts_authswitch/authority-overview.js +10 -4
  75. package/dist_ts_authswitch/authority-placement.d.ts +16 -9
  76. package/dist_ts_authswitch/authority-placement.js +10 -7
  77. package/dist_ts_authswitch/authority-priority.d.ts +20 -0
  78. package/dist_ts_authswitch/authority-priority.js +21 -0
  79. package/dist_ts_authswitch/classes.authoritybroker.d.ts +7 -0
  80. package/dist_ts_authswitch/classes.authoritybroker.js +26 -2
  81. package/dist_ts_authswitch/classes.authoritycli.d.ts +1 -0
  82. package/dist_ts_authswitch/classes.authoritycli.js +43 -3
  83. package/dist_ts_authswitch/classes.authorityclient.d.ts +6 -1
  84. package/dist_ts_authswitch/classes.authorityclient.js +12 -4
  85. package/dist_ts_authswitch/classes.authoritydaemon.js +7 -1
  86. package/dist_ts_authswitch/classes.authoritydatabase.d.ts +6 -0
  87. package/dist_ts_authswitch/classes.authoritydatabase.js +13 -2
  88. package/dist_ts_authswitch/classes.authoritymodels.d.ts +7 -0
  89. package/dist_ts_authswitch/classes.authoritymodels.js +17 -8
  90. package/dist_ts_interfaces/devices.d.ts +178 -2
  91. package/dist_ts_interfaces/devices.js +24 -2
  92. package/dist_ts_interfaces/index.d.ts +1 -0
  93. package/dist_ts_interfaces/index.js +2 -1
  94. package/dist_ts_interfaces/mcprequests.d.ts +3 -2
  95. package/dist_ts_interfaces/mcprequests.js +3 -1
  96. package/dist_ts_interfaces/push.d.ts +166 -0
  97. package/dist_ts_interfaces/push.js +24 -0
  98. package/dist_ts_interfaces/requests.accounts.d.ts +19 -0
  99. package/dist_ts_interfaces/requests.accounts.js +1 -1
  100. package/dist_ts_interfaces/requests.d.ts +2 -2
  101. package/dist_ts_interfaces/requests.js +1 -1
  102. package/dist_ts_interfaces/workercallers.d.ts +43 -3
  103. package/docs/authswitch.md +25 -0
  104. package/package.json +1 -1
  105. package/readme.md +93 -16
  106. package/ts/00_commitinfo_data.ts +1 -1
  107. package/ts/aglapi/interfaces.ts +8 -0
  108. package/ts/classes.accountsactions.ts +25 -0
  109. package/ts/classes.apnsclient.ts +389 -0
  110. package/ts/classes.authmodels.ts +21 -5
  111. package/ts/classes.authstore.ts +14 -1
  112. package/ts/classes.cli.ts +7 -0
  113. package/ts/classes.controller.ts +277 -10
  114. package/ts/classes.controllerdevices.ts +94 -12
  115. package/ts/classes.controllerpush.ts +351 -0
  116. package/ts/classes.fcmclient.ts +292 -0
  117. package/ts/classes.inbox.ts +13 -2
  118. package/ts/classes.inferencerouter.ts +61 -16
  119. package/ts/classes.inferenceservice.ts +1 -1
  120. package/ts/classes.mcpclient.ts +20 -5
  121. package/ts/classes.mcpcontrollerhost.ts +20 -0
  122. package/ts/classes.mcpvalidation.ts +2 -0
  123. package/ts/classes.mcpworkercaller.ts +24 -2
  124. package/ts/classes.pushdelivery.ts +378 -0
  125. package/ts/classes.pushhandover.ts +98 -0
  126. package/ts/classes.pushregistrations.ts +244 -0
  127. package/ts/classes.pushsettings.ts +428 -0
  128. package/ts/classes.workercallers.ts +329 -37
  129. package/ts/driver/classes.directreports.ts +7 -1
  130. package/ts/fleet/classes.workerlaunches.ts +9 -7
  131. package/ts/fleet/classes.workers.ts +65 -2
  132. package/ts/functions.deviceapi.ts +52 -2
  133. package/ts/functions.inferencecli.ts +1 -0
  134. package/ts/functions.pushcli.ts +212 -0
  135. package/ts/functions.pushcredentials.ts +129 -0
  136. package/ts/functions.pushwire.ts +106 -0
  137. package/ts/functions.remotecli.ts +3 -2
  138. package/ts/functions.workercallervalidation.ts +2 -1
  139. package/ts/functions.workerprocessproof.ts +34 -0
  140. package/ts/interfaces.auth.ts +27 -3
  141. package/ts/interfaces.lifecycle.ts +7 -1
  142. package/ts/interfaces.push.ts +78 -0
  143. package/ts/plugins.ts +6 -1
  144. package/ts_authswitch/authority-contract.ts +21 -0
  145. package/ts_authswitch/authority-overview.ts +19 -5
  146. package/ts_authswitch/authority-placement.ts +18 -10
  147. package/ts_authswitch/authority-priority.ts +25 -0
  148. package/ts_authswitch/classes.authoritybroker.ts +26 -1
  149. package/ts_authswitch/classes.authoritycli.ts +48 -2
  150. package/ts_authswitch/classes.authorityclient.ts +14 -4
  151. package/ts_authswitch/classes.authoritydaemon.ts +8 -1
  152. package/ts_authswitch/classes.authoritydatabase.ts +11 -1
  153. package/ts_authswitch/classes.authoritymodels.ts +17 -6
  154. package/ts_authswitch/readme.md +1 -1
  155. package/ts_interfaces/devices.schema.json +327 -0
  156. package/ts_interfaces/devices.ts +206 -1
  157. package/ts_interfaces/index.ts +1 -0
  158. package/ts_interfaces/mcprequests.ts +3 -0
  159. package/ts_interfaces/push.ts +162 -0
  160. package/ts_interfaces/requests.accounts.ts +17 -0
  161. package/ts_interfaces/requests.ts +2 -0
  162. package/ts_interfaces/workercallers.ts +34 -2
  163. package/ts_web/00_commitinfo_data.ts +1 -1
  164. package/ts_web/accounts.plugins.ts +4 -2
  165. package/ts_web/classes.accountsreadmodel.ts +36 -2
  166. package/ts_web/elements.accounts.ts +48 -0
@@ -1,5 +1,5 @@
1
1
  import type { IReq_ControllerConfigurationResourceGet, IReq_ControllerConfigurationStateGet, IReq_ControllerConfigurationSummaryGet, IReq_ControllerConfigurationMasterGet, IReq_ControllerConfigurationMasterSave, IReq_ControllerConfigurationProject, IReq_ControllerConfigurationReview, IReq_ControllerConfigurationApply, IReq_ControllerConfigurationRestoreReview, IReq_ControllerConfigurationRestore, IReq_ControllerConfigurationTargetBind, IReq_ControllerConfigurationOperationRetry, IReq_ControllerConfigurationOperationRecover, IReq_ControllerConfigurationOperationAbandon, IReq_ControllerConfigurationOwnerIssue, IReq_ControllerConfigurationOwnerRevoke } from './requests.configuration.js';
2
- import type { IReq_ControllerAccountsAdd, IReq_ControllerAccountsDoctorGet, IReq_ControllerAccountsOperationCancel, IReq_ControllerAccountsOperationGet, IReq_ControllerAccountsPreuseCancel, IReq_ControllerAccountsPreuseGet, IReq_ControllerAccountsPreuseStart, IReq_ControllerAccountsReauth, IReq_ControllerAccountsRemove, IReq_ControllerAccountsRename, IReq_ControllerAccountsMaxUsage, IReq_ControllerAccountsReserveLift, IReq_ControllerAccountsApiKeyAdd, IReq_ControllerAccountsSpendLimit, IReq_ControllerAccountsClaudeCode, IReq_ControllerAccountsRenewal, IReq_ControllerAccountsSnapshot, IReq_ControllerAccountsUsageGet, IReq_ControllerAccountsUsageRecheck, IReq_ControllerAccountsClaudeHostGet, IReq_ControllerAccountsClaudeRelease, IReq_ControllerAccountsClaudeReleaseGet, IReq_ControllerAccountsClaudeRepair, IReq_ControllerAccountsClaudeSignInCancel, IReq_ControllerAccountsClaudeSignInGet, IReq_ControllerAccountsClaudeSignInStart, IReq_ControllerAccountsCodexAdopt, IReq_ControllerCodexAccountUse, IReq_ControllerAccountsCodexRelease } from './requests.accounts.js';
2
+ import type { IReq_ControllerAccountsAdd, IReq_ControllerAccountsDoctorGet, IReq_ControllerAccountsOperationCancel, IReq_ControllerAccountsOperationGet, IReq_ControllerAccountsPreuseCancel, IReq_ControllerAccountsPreuseGet, IReq_ControllerAccountsPreuseStart, IReq_ControllerAccountsReauth, IReq_ControllerAccountsRemove, IReq_ControllerAccountsRename, IReq_ControllerAccountsMaxUsage, IReq_ControllerAccountsReserveLift, IReq_ControllerAccountsApiKeyAdd, IReq_ControllerAccountsSpendLimit, IReq_ControllerAccountsClaudeCode, IReq_ControllerAccountsRenewal, IReq_ControllerAccountsPriority, IReq_ControllerAccountsSnapshot, IReq_ControllerAccountsUsageGet, IReq_ControllerAccountsUsageRecheck, IReq_ControllerAccountsClaudeHostGet, IReq_ControllerAccountsClaudeRelease, IReq_ControllerAccountsClaudeReleaseGet, IReq_ControllerAccountsClaudeRepair, IReq_ControllerAccountsClaudeSignInCancel, IReq_ControllerAccountsClaudeSignInGet, IReq_ControllerAccountsClaudeSignInStart, IReq_ControllerAccountsCodexAdopt, IReq_ControllerCodexAccountUse, IReq_ControllerAccountsCodexRelease } from './requests.accounts.js';
3
3
  import type { IReq_ControllerOpenCodeRestart, IReq_ControllerProxyStatusGet, IReq_ControllerRestart, IReq_ControllerStatus } from './requests.status.js';
4
4
  import type { IReq_ControllerDriverGet, IReq_ControllerDriverEnsure, IReq_ControllerDriverSeen } from './requests.driver.js';
5
5
  import type { IReq_ControllerFleetWorkerList, IReq_ControllerFleetWorkerRead, IReq_ControllerFleetWorkerSteer } from './requests.fleetworkers.js';
@@ -43,4 +43,4 @@ export * from './requests.browser.js';
43
43
  export * from './requests.terminal.js';
44
44
  export * from './requests.workspace.js';
45
45
  export * from './requests.events.js';
46
- export type TControllerRequest = IReq_ControllerConfigurationResourceGet | IReq_ControllerConfigurationStateGet | IReq_ControllerConfigurationSummaryGet | IReq_ControllerConfigurationMasterGet | IReq_ControllerConfigurationMasterSave | IReq_ControllerConfigurationProject | IReq_ControllerConfigurationReview | IReq_ControllerConfigurationApply | IReq_ControllerConfigurationRestoreReview | IReq_ControllerConfigurationRestore | IReq_ControllerConfigurationTargetBind | IReq_ControllerConfigurationOperationRetry | IReq_ControllerConfigurationOperationRecover | IReq_ControllerConfigurationOperationAbandon | IReq_ControllerConfigurationOwnerIssue | IReq_ControllerConfigurationOwnerRevoke | IReq_ControllerStatus | IReq_ControllerProxyStatusGet | IReq_ControllerOpenCodeRestart | IReq_ControllerRestart | IReq_ControllerDriverGet | IReq_ControllerDriverEnsure | IReq_ControllerDriverSeen | IReq_ControllerFleetWorkerList | IReq_ControllerFleetWorkerRead | IReq_ControllerFleetWorkerSteer | IReq_ControllerDirectReportList | IReq_ControllerDirectReportMessage | IReq_ControllerDirectReportRead | IReq_ControllerDirectReportPreflight | IReq_ControllerDirectReportAppoint | IReq_ControllerDirectReportAdopt | IReq_ControllerSessionFeedList | IReq_ControllerSessionFeedAcknowledge | TControllerDeployTypedRequest | IReq_ControllerNativeSessionRead | IReq_ControllerNativeSessionAuxiliaryGet | IReq_ControllerNativeSessionSend | IReq_ControllerNativeSessionScratchpadSave | IReq_ControllerNativeSessionIntelligenceAsk | IReq_ControllerNativeSessionPermissionReply | IReq_ControllerNativeSessionQuestionReply | IReq_ControllerNativeSessionElicitationReply | IReq_ControllerUsageWatch | IReq_ControllerUsageUnwatch | IReq_ControllerSystemMetrics | IReq_ControllerSystemMetricsHistory | IReq_ControllerFailureDetailGet | IReq_ControllerAuthState | IReq_ControllerSetupBegin | IReq_ControllerSetupFinish | IReq_ControllerAuthenticationBegin | IReq_ControllerAuthenticationFinish | IReq_ControllerTempPasswordLogin | IReq_ControllerAuthResume | IReq_ControllerAuthHandoff | IReq_ControllerAuthSignout | IReq_ControllerProjectList | IReq_ControllerProjectCreate | IReq_ControllerProjectRemove | IReq_ControllerProjectRemovalRetry | IReq_ControllerProjectAgentMessagesUpdate | IReq_ControllerProjectSuggest | IReq_ControllerProviderConnectionList | IReq_ControllerProviderModelRefreshBegin | IReq_ControllerProviderModelRefreshGet | IReq_ControllerSlashList | IReq_ControllerSlashExecute | IReq_ControllerModelList | IReq_ControllerSettingsGet | IReq_ControllerSettingsUpdate | IReq_ControllerConversationList | IReq_ControllerConversationSearch | IReq_ControllerConversationOpen | IReq_ControllerConversationArchive | IReq_ControllerConversationReopen | IReq_ControllerSessionGet | IReq_ControllerSessionChildGet | IReq_ControllerSessionChildStatusGet | IReq_ControllerFlexChildGet | IReq_ControllerCodexChildGet | IReq_ControllerSessionChildMessagesPage | IReq_ControllerSessionChildMessageGet | IReq_ControllerSessionChildPermissionReply | IReq_ControllerSessionChildQuestionReply | IReq_ControllerSessionAuxiliaryGet | IReq_ControllerSessionModelUpdate | IReq_ControllerSessionScratchpadSave | IReq_ControllerSessionIntelligenceAsk | IReq_ControllerSessionMessagesPage | IReq_ControllerSessionMessageGet | IReq_ControllerSessionCreate | IReq_ControllerSessionDelete | IReq_ControllerSessionDiscardEmpty | IReq_ControllerSessionDraftGet | IReq_ControllerSessionDraftUpdate | IReq_ControllerSessionSend | import('./codex.js').IReq_ControllerCodexRestart | import('./codex.js').IReq_ControllerCodexWriterUpdate | import('./codex.js').IReq_ControllerCodexModeUpdate | import('./codex.js').IReq_ControllerCodexProfilesList | import('./codex.js').IReq_ControllerCodexAccountProfile | import('./codex.js').IReq_ControllerCodexProfileCreate | import('./codex.js').IReq_ControllerCodexProfileUpdate | import('./codex.js').IReq_ControllerCodexProfileTest | import('./codex.js').IReq_ControllerCodexMappingUpdate | import('./codex.js').IReq_ControllerCodexThreadsList | import('./codex.js').IReq_ControllerCodexThreadEnroll | IReq_ControllerSessionAbort | IReq_ControllerSessionHarnessRestart | IReq_ControllerSessionCompactionUpdate | IReq_ControllerSessionLimitResumeUpdate | IReq_ControllerSessionPromptQueueRelease | IReq_ControllerSessionHeldPromptRelease | IReq_ControllerSessionPendingPromptAction | IReq_ControllerPermissionReply | IReq_ControllerQuestionReply | IReq_ControllerElicitationReply | IReq_ControllerSessionRename | IReq_ControllerSessionArchive | IReq_ControllerSessionGroupsGet | IReq_ControllerSessionGroupsUpdate | IReq_ControllerSessionYolo | IReq_ControllerResourceList | IReq_ControllerResourceCreate | IReq_ControllerResourceRename | IReq_ControllerResourceAttach | IReq_ControllerResourceDetach | IReq_ControllerResourceRetire | IReq_ControllerResourceStart | IReq_ControllerResourceStop | IReq_ControllerBrowserViewOpen | IReq_ControllerBrowserViewActivate | IReq_ControllerBrowserViewRecover | IReq_ControllerBrowserViewClose | IReq_ControllerBrowserDevToolsOpen | IReq_ControllerBrowserDevToolsClose | IReq_ControllerBrowserPaintOpen | IReq_ControllerBrowserPaintClose | IReq_ControllerBrowserAudioOpen | IReq_ControllerBrowserAudioClose | IReq_ControllerBrowserPaintRearm | IReq_ControllerBrowserAssetsGet | IReq_ControllerBrowserPaintVideoRouteOpen | IReq_ControllerTerminalList | IReq_ControllerTerminalCreate | IReq_ControllerTerminalRename | IReq_ControllerTerminalRemove | IReq_ControllerTerminalAttach | IReq_ControllerTerminalDetach | IReq_ControllerTerminalInput | IReq_ControllerTerminalResize | IReq_ControllerWorkspaceList | IReq_ControllerWorkspaceStat | IReq_ControllerWorkspaceRead | IReq_ControllerWorkspaceWrite | IReq_ControllerWorkspaceMkdir | IReq_ControllerWorkspaceRemove | IReq_ControllerWorkspaceRename | IReq_ControllerWorkspaceCopy | IReq_ControllerWorkspaceWatch | IReq_ControllerWorkspaceUnwatch | IReq_ControllerWorkspaceBaseSet | IReq_ControllerTerminalOutput | IReq_ControllerTerminalDetached | IReq_ControllerWorkspaceChanged | IReq_ControllerAccountsSnapshot | IReq_ControllerAccountsRename | IReq_ControllerAccountsMaxUsage | IReq_ControllerAccountsReserveLift | IReq_ControllerAccountsApiKeyAdd | IReq_ControllerAccountsSpendLimit | IReq_ControllerAccountsClaudeCode | IReq_ControllerAccountsRenewal | IReq_ControllerAccountsRemove | IReq_ControllerAccountsAdd | IReq_ControllerAccountsReauth | IReq_ControllerAccountsOperationGet | IReq_ControllerAccountsOperationCancel | IReq_ControllerAccountsUsageGet | IReq_ControllerAccountsUsageRecheck | IReq_ControllerAccountsPreuseStart | IReq_ControllerAccountsPreuseGet | IReq_ControllerAccountsPreuseCancel | IReq_ControllerAccountsDoctorGet | IReq_ControllerAccountsClaudeSignInStart | IReq_ControllerAccountsClaudeSignInGet | IReq_ControllerAccountsClaudeSignInCancel | IReq_ControllerAccountsClaudeHostGet | IReq_ControllerAccountsClaudeRelease | IReq_ControllerAccountsClaudeReleaseGet | IReq_ControllerAccountsClaudeRepair | IReq_ControllerCodexAccountUse | IReq_ControllerAccountsCodexRelease | IReq_ControllerAccountsCodexAdopt | IReq_ControllerDevicesList | IReq_ControllerDevicesPairingBegin | IReq_ControllerDevicesPairingCancel | IReq_ControllerDevicesRevoke | IReq_ControllerInboxList | import('./requests.tickets.js').TControllerTicketTypedRequest | IReq_ControllerEvent | IReq_ControllerSessionChildEvent;
46
+ export type TControllerRequest = IReq_ControllerConfigurationResourceGet | IReq_ControllerConfigurationStateGet | IReq_ControllerConfigurationSummaryGet | IReq_ControllerConfigurationMasterGet | IReq_ControllerConfigurationMasterSave | IReq_ControllerConfigurationProject | IReq_ControllerConfigurationReview | IReq_ControllerConfigurationApply | IReq_ControllerConfigurationRestoreReview | IReq_ControllerConfigurationRestore | IReq_ControllerConfigurationTargetBind | IReq_ControllerConfigurationOperationRetry | IReq_ControllerConfigurationOperationRecover | IReq_ControllerConfigurationOperationAbandon | IReq_ControllerConfigurationOwnerIssue | IReq_ControllerConfigurationOwnerRevoke | IReq_ControllerStatus | IReq_ControllerProxyStatusGet | IReq_ControllerOpenCodeRestart | IReq_ControllerRestart | IReq_ControllerDriverGet | IReq_ControllerDriverEnsure | IReq_ControllerDriverSeen | IReq_ControllerFleetWorkerList | IReq_ControllerFleetWorkerRead | IReq_ControllerFleetWorkerSteer | IReq_ControllerDirectReportList | IReq_ControllerDirectReportMessage | IReq_ControllerDirectReportRead | IReq_ControllerDirectReportPreflight | IReq_ControllerDirectReportAppoint | IReq_ControllerDirectReportAdopt | IReq_ControllerSessionFeedList | IReq_ControllerSessionFeedAcknowledge | TControllerDeployTypedRequest | IReq_ControllerNativeSessionRead | IReq_ControllerNativeSessionAuxiliaryGet | IReq_ControllerNativeSessionSend | IReq_ControllerNativeSessionScratchpadSave | IReq_ControllerNativeSessionIntelligenceAsk | IReq_ControllerNativeSessionPermissionReply | IReq_ControllerNativeSessionQuestionReply | IReq_ControllerNativeSessionElicitationReply | IReq_ControllerUsageWatch | IReq_ControllerUsageUnwatch | IReq_ControllerSystemMetrics | IReq_ControllerSystemMetricsHistory | IReq_ControllerFailureDetailGet | IReq_ControllerAuthState | IReq_ControllerSetupBegin | IReq_ControllerSetupFinish | IReq_ControllerAuthenticationBegin | IReq_ControllerAuthenticationFinish | IReq_ControllerTempPasswordLogin | IReq_ControllerAuthResume | IReq_ControllerAuthHandoff | IReq_ControllerAuthSignout | IReq_ControllerProjectList | IReq_ControllerProjectCreate | IReq_ControllerProjectRemove | IReq_ControllerProjectRemovalRetry | IReq_ControllerProjectAgentMessagesUpdate | IReq_ControllerProjectSuggest | IReq_ControllerProviderConnectionList | IReq_ControllerProviderModelRefreshBegin | IReq_ControllerProviderModelRefreshGet | IReq_ControllerSlashList | IReq_ControllerSlashExecute | IReq_ControllerModelList | IReq_ControllerSettingsGet | IReq_ControllerSettingsUpdate | IReq_ControllerConversationList | IReq_ControllerConversationSearch | IReq_ControllerConversationOpen | IReq_ControllerConversationArchive | IReq_ControllerConversationReopen | IReq_ControllerSessionGet | IReq_ControllerSessionChildGet | IReq_ControllerSessionChildStatusGet | IReq_ControllerFlexChildGet | IReq_ControllerCodexChildGet | IReq_ControllerSessionChildMessagesPage | IReq_ControllerSessionChildMessageGet | IReq_ControllerSessionChildPermissionReply | IReq_ControllerSessionChildQuestionReply | IReq_ControllerSessionAuxiliaryGet | IReq_ControllerSessionModelUpdate | IReq_ControllerSessionScratchpadSave | IReq_ControllerSessionIntelligenceAsk | IReq_ControllerSessionMessagesPage | IReq_ControllerSessionMessageGet | IReq_ControllerSessionCreate | IReq_ControllerSessionDelete | IReq_ControllerSessionDiscardEmpty | IReq_ControllerSessionDraftGet | IReq_ControllerSessionDraftUpdate | IReq_ControllerSessionSend | import('./codex.js').IReq_ControllerCodexRestart | import('./codex.js').IReq_ControllerCodexWriterUpdate | import('./codex.js').IReq_ControllerCodexModeUpdate | import('./codex.js').IReq_ControllerCodexProfilesList | import('./codex.js').IReq_ControllerCodexAccountProfile | import('./codex.js').IReq_ControllerCodexProfileCreate | import('./codex.js').IReq_ControllerCodexProfileUpdate | import('./codex.js').IReq_ControllerCodexProfileTest | import('./codex.js').IReq_ControllerCodexMappingUpdate | import('./codex.js').IReq_ControllerCodexThreadsList | import('./codex.js').IReq_ControllerCodexThreadEnroll | IReq_ControllerSessionAbort | IReq_ControllerSessionHarnessRestart | IReq_ControllerSessionCompactionUpdate | IReq_ControllerSessionLimitResumeUpdate | IReq_ControllerSessionPromptQueueRelease | IReq_ControllerSessionHeldPromptRelease | IReq_ControllerSessionPendingPromptAction | IReq_ControllerPermissionReply | IReq_ControllerQuestionReply | IReq_ControllerElicitationReply | IReq_ControllerSessionRename | IReq_ControllerSessionArchive | IReq_ControllerSessionGroupsGet | IReq_ControllerSessionGroupsUpdate | IReq_ControllerSessionYolo | IReq_ControllerResourceList | IReq_ControllerResourceCreate | IReq_ControllerResourceRename | IReq_ControllerResourceAttach | IReq_ControllerResourceDetach | IReq_ControllerResourceRetire | IReq_ControllerResourceStart | IReq_ControllerResourceStop | IReq_ControllerBrowserViewOpen | IReq_ControllerBrowserViewActivate | IReq_ControllerBrowserViewRecover | IReq_ControllerBrowserViewClose | IReq_ControllerBrowserDevToolsOpen | IReq_ControllerBrowserDevToolsClose | IReq_ControllerBrowserPaintOpen | IReq_ControllerBrowserPaintClose | IReq_ControllerBrowserAudioOpen | IReq_ControllerBrowserAudioClose | IReq_ControllerBrowserPaintRearm | IReq_ControllerBrowserAssetsGet | IReq_ControllerBrowserPaintVideoRouteOpen | IReq_ControllerTerminalList | IReq_ControllerTerminalCreate | IReq_ControllerTerminalRename | IReq_ControllerTerminalRemove | IReq_ControllerTerminalAttach | IReq_ControllerTerminalDetach | IReq_ControllerTerminalInput | IReq_ControllerTerminalResize | IReq_ControllerWorkspaceList | IReq_ControllerWorkspaceStat | IReq_ControllerWorkspaceRead | IReq_ControllerWorkspaceWrite | IReq_ControllerWorkspaceMkdir | IReq_ControllerWorkspaceRemove | IReq_ControllerWorkspaceRename | IReq_ControllerWorkspaceCopy | IReq_ControllerWorkspaceWatch | IReq_ControllerWorkspaceUnwatch | IReq_ControllerWorkspaceBaseSet | IReq_ControllerTerminalOutput | IReq_ControllerTerminalDetached | IReq_ControllerWorkspaceChanged | IReq_ControllerAccountsSnapshot | IReq_ControllerAccountsRename | IReq_ControllerAccountsMaxUsage | IReq_ControllerAccountsReserveLift | IReq_ControllerAccountsApiKeyAdd | IReq_ControllerAccountsSpendLimit | IReq_ControllerAccountsClaudeCode | IReq_ControllerAccountsRenewal | IReq_ControllerAccountsPriority | IReq_ControllerAccountsRemove | IReq_ControllerAccountsAdd | IReq_ControllerAccountsReauth | IReq_ControllerAccountsOperationGet | IReq_ControllerAccountsOperationCancel | IReq_ControllerAccountsUsageGet | IReq_ControllerAccountsUsageRecheck | IReq_ControllerAccountsPreuseStart | IReq_ControllerAccountsPreuseGet | IReq_ControllerAccountsPreuseCancel | IReq_ControllerAccountsDoctorGet | IReq_ControllerAccountsClaudeSignInStart | IReq_ControllerAccountsClaudeSignInGet | IReq_ControllerAccountsClaudeSignInCancel | IReq_ControllerAccountsClaudeHostGet | IReq_ControllerAccountsClaudeRelease | IReq_ControllerAccountsClaudeReleaseGet | IReq_ControllerAccountsClaudeRepair | IReq_ControllerCodexAccountUse | IReq_ControllerAccountsCodexRelease | IReq_ControllerAccountsCodexAdopt | IReq_ControllerDevicesList | IReq_ControllerDevicesPairingBegin | IReq_ControllerDevicesPairingCancel | IReq_ControllerDevicesRevoke | IReq_ControllerInboxList | import('./requests.tickets.js').TControllerTicketTypedRequest | IReq_ControllerEvent | IReq_ControllerSessionChildEvent;
@@ -18,4 +18,4 @@ export * from './requests.browser.js';
18
18
  export * from './requests.terminal.js';
19
19
  export * from './requests.workspace.js';
20
20
  export * from './requests.events.js';
21
- //# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoicmVxdWVzdHMuanMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyIuLi8uLi90c19pbnRlcmZhY2VzL3JlcXVlc3RzLnRzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiJBQTJOQSxvRkFBb0Y7QUFDcEYsbUVBQW1FO0FBQ25FLGNBQWMsc0JBQXNCLENBQUM7QUFDckMsY0FBYyx1QkFBdUIsQ0FBQztBQUN0QyxjQUFjLG9CQUFvQixDQUFDO0FBQ25DLGNBQWMsMkJBQTJCLENBQUM7QUFDMUMsY0FBYyx1QkFBdUIsQ0FBQztBQUN0QyxjQUFjLHFCQUFxQixDQUFDO0FBQ3BDLGNBQWMsd0JBQXdCLENBQUM7QUFDdkMsY0FBYyxxQkFBcUIsQ0FBQztBQUNwQyxjQUFjLHdCQUF3QixDQUFDO0FBQ3ZDLGNBQWMsNkJBQTZCLENBQUM7QUFDNUMsY0FBYyw0QkFBNEIsQ0FBQztBQUMzQyxjQUFjLHVCQUF1QixDQUFDO0FBQ3RDLGNBQWMsMkJBQTJCLENBQUM7QUFDMUMsY0FBYyx3QkFBd0IsQ0FBQztBQUN2QyxjQUFjLHVCQUF1QixDQUFDO0FBQ3RDLGNBQWMsd0JBQXdCLENBQUM7QUFDdkMsY0FBYyx5QkFBeUIsQ0FBQztBQUN4QyxjQUFjLHNCQUFzQixDQUFDIn0=
21
+ //# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoicmVxdWVzdHMuanMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyIuLi8uLi90c19pbnRlcmZhY2VzL3JlcXVlc3RzLnRzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiJBQTROQSxvRkFBb0Y7QUFDcEYsbUVBQW1FO0FBQ25FLGNBQWMsc0JBQXNCLENBQUM7QUFDckMsY0FBYyx1QkFBdUIsQ0FBQztBQUN0QyxjQUFjLG9CQUFvQixDQUFDO0FBQ25DLGNBQWMsMkJBQTJCLENBQUM7QUFDMUMsY0FBYyx1QkFBdUIsQ0FBQztBQUN0QyxjQUFjLHFCQUFxQixDQUFDO0FBQ3BDLGNBQWMsd0JBQXdCLENBQUM7QUFDdkMsY0FBYyxxQkFBcUIsQ0FBQztBQUNwQyxjQUFjLHdCQUF3QixDQUFDO0FBQ3ZDLGNBQWMsNkJBQTZCLENBQUM7QUFDNUMsY0FBYyw0QkFBNEIsQ0FBQztBQUMzQyxjQUFjLHVCQUF1QixDQUFDO0FBQ3RDLGNBQWMsMkJBQTJCLENBQUM7QUFDMUMsY0FBYyx3QkFBd0IsQ0FBQztBQUN2QyxjQUFjLHVCQUF1QixDQUFDO0FBQ3RDLGNBQWMsd0JBQXdCLENBQUM7QUFDdkMsY0FBYyx5QkFBeUIsQ0FBQztBQUN4QyxjQUFjLHNCQUFzQixDQUFDIn0=
@@ -67,8 +67,9 @@ export interface IFleetWorkerCallerHooks {
67
67
  }>;
68
68
  getWorkerCallerStatus(launchId: string): IWorkerCallerReadiness;
69
69
  /**
70
- * Revokes one launch, or the current launch of a worker, also one the controller kept from before a restart. Every
71
- * reason but `generation_change` revokes it for good: its kept binding is deleted with it.
70
+ * Revokes one launch, or the current launch of a worker, also one the controller kept from before a restart or
71
+ * recorded for a bridge it identified by its process. Every reason but `generation_change` revokes it for good: its
72
+ * kept binding is deleted with it.
72
73
  */
73
74
  revokeWorkerCaller(request: ({
74
75
  launchId: string;
@@ -77,6 +78,11 @@ export interface IFleetWorkerCallerHooks {
77
78
  }) & {
78
79
  reason: 'failure' | 'stop' | 'replacement' | 'generation_change' | 'cancelled';
79
80
  }): Promise<void>;
81
+ /**
82
+ * The fleet adopted or re-bound a worker: every process whose bridge the controller refused to identify is
83
+ * identified afresh at its bridge's next call.
84
+ */
85
+ clearCallerRefusals(): void;
80
86
  }
81
87
  /** The background job a Claude worker's launch is bound to, as the controller asks the fleet about it. */
82
88
  export interface IWorkerClaudeJobRequest {
@@ -102,6 +108,36 @@ export type TWorkerClaudeJobObservation = {
102
108
  state: 'unproven';
103
109
  reason: string;
104
110
  };
111
+ /**
112
+ * The process an MCP bridge runs under (its direct parent), which the controller proved to run an installed Claude Code
113
+ * release, and that process's own parent, as the controller asks the fleet whose job it is.
114
+ */
115
+ export interface IWorkerClaudeProcessRequest {
116
+ pid: number;
117
+ parentPid: number;
118
+ }
119
+ /**
120
+ * What the fleet names a process for: `identified` when a fresh inventory of the fleet's Claude homes lists it exactly
121
+ * once, as the process of a background job with an agent id whose session it lists once, and exactly one stored worker
122
+ * of any owner, a live Claude worker without a dispatch in flight or a lost one, binds that session under the home that
123
+ * lists it. Otherwise `refused` by the check that failed: `parent` when the process is not the job's but its own parent
124
+ * is (the bridge runs one level too deep), `inventory` or `worker`; with the worker when one is named, and whether the
125
+ * refusal holds while the process runs (`forGood`) or may pass soon.
126
+ */
127
+ export type TWorkerClaudeProcessIdentification = {
128
+ state: 'identified';
129
+ workerId: string;
130
+ projectId: string;
131
+ nativeSessionId: string;
132
+ jobId: string;
133
+ } | {
134
+ state: 'refused';
135
+ check: 'parent' | 'inventory' | 'worker';
136
+ reason: string;
137
+ forGood: boolean;
138
+ workerId?: string;
139
+ nativeSessionId?: string;
140
+ };
105
141
  export interface IWorkerCallerSubject {
106
142
  kind: 'worker_launch';
107
143
  launchId: string;
@@ -115,6 +151,10 @@ export interface IWorkerCallerSubject {
115
151
  /** The fleet worker's name: what a ticket calls the worker, unless it is an active direct report. */
116
152
  workerName: string;
117
153
  }
154
+ /**
155
+ * A bridge enrolls with the launch its MCP configuration gave it, a Codex challenge or thread, or, holding none, its
156
+ * process id alone: the controller then identifies it by its process chain.
157
+ */
118
158
  export type TWorkerCallerEnrollment = {
119
159
  bridgePid: number;
120
160
  } & ({
@@ -125,7 +165,7 @@ export type TWorkerCallerEnrollment = {
125
165
  nativeThreadId: string;
126
166
  } | {
127
167
  nativeThreadId: string;
128
- });
168
+ } | Record<never, never>);
129
169
  export interface IWorkerCallerEnrollmentResponse extends IWorkerCallerReadiness {
130
170
  credential?: string;
131
171
  }
@@ -326,6 +326,8 @@ authswitch account set <account-id> --max-usage <percent> [--json]
326
326
  authswitch account set <account-id> --clear [--json]
327
327
  authswitch account set <account-id> --lapses-at <date-time> [--json]
328
328
  authswitch account set <account-id> --clear-lapse [--json]
329
+ authswitch account set <account-id> --priority [--json]
330
+ authswitch account set <account-id> --clear-priority [--json]
329
331
  authswitch account set <account-id> --spend-limit <dollars> [--json]
330
332
  authswitch account set <account-id> --clear-spend-limit [--json]
331
333
  authswitch account set <account-id> --claude-code on|off [--json]
@@ -465,6 +467,29 @@ limit row). The account record holds `renewsAt` only while it is set; clearing i
465
467
  never had one is the record an earlier service reads. An earlier service refuses the store while any account holds a
466
468
  renewal: clear every renewal (`authswitch account set <id> --clear-renewal`) before downgrading.
467
469
 
470
+ `account set --priority` gives an account the owner's priority (AGL-1809) for 24 hours, at the revision `account list`
471
+ reads just before (`authswitch.authority.priority { accountId, expectedRevision, priority }`,
472
+ `AuthSwitchClient.setAccountPriority`); `--clear-priority` ends it. The service sets its end, its own clock plus
473
+ `authSwitchPriorityMs` (`ts_authswitch/authority-priority.ts`), and stores it as `priorityUntil` in UTC; giving it to an
474
+ account that holds it starts the 24 hours again. Any account can hold one -- a ChatGPT or Claude sign-in, an OpenAI or
475
+ Anthropic API key -- and several at once; a stale revision is refused as `account_changed`. It ends by itself: a reader
476
+ judges it against its own clock (`authSwitchPriorityActive`, strictly before the end), so one whose end passed reads as
477
+ none everywhere, with nothing run at that moment. While it holds, the AGL proxy places a new session on the account
478
+ before any account of its pool without one, as long as the account takes the request (`authSwitchPlacementOrder`, and
479
+ across credential tiers the proxy's own order): one at its limit or reserve -- a priority lifts no `maxUsagePercent`
480
+ --, resting after a 429, lapsed or without the model is passed over, and among several priority accounts the usual
481
+ order decides. A session already running stays on its account, except that a session on an API key returns to a sign-in
482
+ of the better tier as on any key: while the key holds priority only to a sign-in that has priority too, and at its
483
+ first request once the key's priority ended to any that takes the request. `account set` and `account list` print it while it holds
484
+ (`priority until <ISO> (set by the owner)`); `list` and `limits` show `priority until 14:05 (set by the owner)` in local
485
+ time, with the date on another day (`--json`: `priorityUntil`, the end while it holds or null, on the overview and each
486
+ limit row; `account list --json` carries the stored end as `priorityUntil`). The account record holds `priorityUntil`
487
+ only while it is set: ending it removes the member, and so does the account's first write after its end passed or its
488
+ removal (`AuthSwitchAuthorityDatabase.persistAccount`, judged at the write's `statusObservedAt`). An earlier service
489
+ refuses the store while any account record holds one: run `authswitch account set <id> --clear-priority` on every
490
+ account before downgrading, since a priority that ended is listed nowhere, yet its record keeps it until the account's
491
+ next change.
492
+
468
493
  A Claude account's reading states what its profile says of the subscription as facts (`summaryKey: 'subscription'`):
469
494
  `Subscription status` -- `organization.subscription_status` as received, then what it means from the one shared map
470
495
  (`authority-subscription.ts`, empty: no value is described yet, so each shows `(not described yet)`) -- and
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "agl",
3
- "version": "43.6.0",
3
+ "version": "43.8.0",
4
4
  "controllerUpgradeManagementVersion": 2,
5
5
  "controllerManagementProtocolVersion": 1,
6
6
  "controllerGatewaySourcesVersion": 1,
package/readme.md CHANGED
@@ -129,6 +129,7 @@ authswitch account list # the stored records, with the ids the account comman
129
129
  authswitch account set <account-id> --max-usage 80 # keep 20% of each usage window for use outside AGL
130
130
  authswitch account set <account-id> --lapses-at 2026-11-01T00:00:00Z # a canceled subscription ends then
131
131
  authswitch account set <account-id> --renews-at 2026-10-20T09:00:00Z # a Claude subscription renews monthly from then
132
+ authswitch account set <account-id> --priority # use this account before any other for 24 hours (--clear-priority ends it)
132
133
  authswitch account recheck <account-id> # read a Claude account now; a healthy read clears its payment problem
133
134
  authswitch --help
134
135
  ```
@@ -196,6 +197,25 @@ usage windows at a renewal is not known. `authswitch list`, `limits` and `accoun
196
197
  (`renews in 9d 4h (set by the owner)`; `--json`: `renewal { at, source: 'manual' }`), and `agl proxy status` too.
197
198
  Any other account is refused one.
198
199
 
200
+ Any account can be given **priority**, to be used up before anything else: for 24 hours from when it was given, or
201
+ until the owner turns it off, the proxy places a new session on it before any account of its pool without priority, as
202
+ long as it takes the request -- one at its limit, at its reserve (a priority lifts no maximum usage), resting after a
203
+ provider 429, lapsed or without the model is passed over, and the other accounts take the session then. Several accounts
204
+ can have it at once; among them placement decides as it always does (below). A session already running stays where it
205
+ is: giving an account priority moves nothing to it, and its end moves no session between accounts, except that a
206
+ session on an API key returns to a sign-in of the better tier that can take its request, as a session on any key does,
207
+ at its first request once the key's priority ended; while the key holds priority, it returns only to a sign-in that has
208
+ priority too. `authswitch account set <account-id> --priority` gives it, again restarts the 24 hours, and `--clear-priority` ends it
209
+ (`authswitch.authority.priority`); the account's page in Settings → Accounts has **Give priority**, then **Restart 24
210
+ hours** and **Turn off** (`controller.accounts.priority`, audited `accounts.priority`). The accounts service sets the
211
+ end by its own clock and keeps it on the account (`priorityUntil`), and every reader judges it against its own clock,
212
+ so it ends by itself with nothing run at its end. The account's row says `priority until 14:05` in the browser's time
213
+ (`tomorrow 14:05` on the next day), as does its page beside its actions; `authswitch list`, `limits` and `account list`
214
+ and `agl proxy status` show it too (`--json`: `priorityUntil`, null without one or once it ended). The account record
215
+ holds it only while it is set; an earlier accounts service refuses the store while any account record holds one, so run
216
+ `authswitch account set <id> --clear-priority` on every account before downgrading: a priority that ran out is listed
217
+ nowhere, yet its record keeps it until the account's next change.
218
+
199
219
  Flex uses every OpenAI account the service holds with a login of its own: each is the Flex connection `flex:authority:<accountId>`, listed wherever Flex accounts are chosen. Flex keeps no login of its own.
200
220
 
201
221
  A Flex session on a ChatGPT account runs through AGL's inference proxy, on the controller's lease of that one account's pool (proxy client `flex`, policy `accountIds: [<accountId>]`): the account the session chose serves it, and the proxy authenticates as the account, applies its maximum usage and limits, and counts every answer's tokens in the [token usage](#token-usage) under the client `flex`. At the account's limit the run reports the limit and its reset; it never moves to another account. The account's model catalog is read by the proxy on that account too. The Flex child is given only the proxy's address and the lease credential, never an account token. When the proxy is not running, a Flex request on a ChatGPT account fails with `INFERENCE_PROXY_UNAVAILABLE`; there is no direct route to ChatGPT. An account whose access ChatGPT keeps rejecting, or the accounts service cannot renew, fails with `PROVIDER_REAUTH_REQUIRED`, repaired by signing it in again in **Settings → Accounts**. Removing an account ends the controller's lease of it at once.
@@ -401,8 +421,9 @@ none shows as unavailable), so a pool no request used since the proxy started is
401
421
  find it -- naming as of when, whether its
402
422
  newest values came from provider answers or the account service's own read, whether a window is estimated since, and
403
423
  whether the service's last read was rate-limited -- with its lifecycle (canceled with its lapse date, or lapsed), its
404
- placement score and its rank for the next new session, and the next renewal its owner set (`--json`: `lifecycle`,
405
- `lapsesAt`, `renewal { at, source: 'manual' }` or null, `placementScore`, `placementRank`, `lastResort`; an OpenAI or Anthropic API key shows its month in place of a maximum usage, as of when
424
+ placement score and its rank for the next new session, and the priority and next renewal its owner set (`--json`:
425
+ `lifecycle`, `lapsesAt`, `priorityUntil` (the end of the account's priority while it holds) or null, `renewal { at,
426
+ source: 'manual' }` or null, `placementScore`, `placementRank`, `lastResort`; an OpenAI or Anthropic API key shows its month in place of a maximum usage, as of when
406
427
  the account service read its spend: `available ($12.40 of $50.00 this month)` with what is left of its limit as its
407
428
  headroom and placement score, `available ($3.20 this month, no spend limit)` with neither, `at its spend limit` (or
408
429
  `held until its month ends`, for an answer that could not be priced) with the month's end -- the month counts the
@@ -552,7 +573,8 @@ counts only on an account without a lapse date) -- and at least one hour; a wind
552
573
  serves now (`score / (1 + in flight)`), so new sessions spread over the accounts in proportion to what each can spend:
553
574
  quota that resets soon, or is lost when the account lapses, is used first -- as is quota an account would still hold at
554
575
  its renewal, when its window resets after it -- and an account that resets in days is spared. An account that lapses within a day comes after every other, and an account without a counted window after
555
- every scored one. Within the client's pool, only current quota exhaustion, a definite provider HTTP 429 before
576
+ every scored one. Before all of this, an account the owner gave priority (above) comes before every account without one,
577
+ of any credential tier, as long as it takes the request; among several priority accounts this order decides. Within the client's pool, only current quota exhaustion, a definite provider HTTP 429 before
556
578
  forwarding output, the account lapsing or leaving the pool, or a Claude account taking no request for a reason of its
557
579
  own (below) permits moving the session to another eligible account.
558
580
  The proxy records every session it places and every move, with why (`new`, `exhausted`, `reserved`, `cooling`,
@@ -597,10 +619,12 @@ allowed in its pool.
597
619
  A Claude pool whose client names no credential -- Claude Code's own lease, `agl proxy run claude` and the `claude`
598
620
  client -- is served by its Claude accounts first and by the Anthropic API keys only when no Claude account can take a
599
621
  request, for whatever reason: every one at its limit or reserve, cooling down, without a usage reading, model list or
600
- access, or with a payment problem. A new session then goes to the key with the most of its monthly spend limit left
622
+ access, or with a payment problem -- unless a key has the owner's priority, which puts it before every Claude account
623
+ without one. A new session then goes to the key with the most of its monthly spend limit left
601
624
  for the requests in flight on it, the keys without a limit after those with one and the least busy of them first, and
602
625
  a session on a Claude account moves to one at its next request. A session on a key returns to a Claude account at the
603
- next request one can take (`returned` in the placement journal), with no waiting period; Claude Code's request reaches
626
+ next request one can take (`returned` in the placement journal), with no waiting period -- a session on a key with
627
+ priority only to a Claude account with priority, since a new session would go to the key first; Claude Code's request reaches
604
628
  the key unchanged, as it reaches an account (thinking signatures carry; the prompt cache starts cold). `count_tokens` never moves a session. A key at its
605
629
  monthly spend limit takes nothing until the month ends, and a key with a limit whose spend could not be read takes
606
630
  nothing until it can (see [API keys and their spend limit](#api-keys-and-their-spend-limit)). When every Claude account
@@ -1483,7 +1507,8 @@ id: the `cwd` and name the inventory reports are where the session is now and wh
1483
1507
  now, and a worker that changes into a worktree or is renamed stays observable and steerable.
1484
1508
 
1485
1509
  Adoption by reference leaves the session's MCP configuration as it was launched, so it holds no
1486
- fleet caller launch and its MCP ticket writes are not admitted as the worker.
1510
+ fleet caller launch: from its next tool call on, its MCP bridge is identified by its process
1511
+ instead (below), also after a controller restart, and its ticket writes are admitted as the worker.
1487
1512
  `--relaunch-file FILE` adopts a settled Claude session with a verified identity instead: the
1488
1513
  fleet resumes it under its own control as a new worker, `claude --bg --resume <id>` with the
1489
1514
  worker's profile options, its caller overlay and the file's message after the profile preamble,
@@ -1516,7 +1541,9 @@ only `named`). It refuses a worker with a pending, unknown or lost dispatch, a r
1516
1541
  predecessor or successor, a reconfirmation whose ticket comment is not saved, and a session any
1517
1542
  worker of any owner is bound to, archived ones included. The re-bind stores `rebound` (resolver,
1518
1543
  reason, time and proof, with the previous session and its status), drops a reconfirmation that
1519
- named the previous session, and becomes an idempotent ticket comment attributed to the resolver
1544
+ named the previous session, revokes the worker's MCP caller identity once the worker names the new
1545
+ session (the previous session's process no longer writes as the worker; the new session's bridge
1546
+ is identified at its next call), and becomes an idempotent ticket comment attributed to the resolver
1520
1547
  under `fleet:rebound:RESOLUTION_ID`; repeating the same re-bind only synchronizes that comment
1521
1548
  from the saved record. Codex workers are not re-bound and fail closed.
1522
1549
 
@@ -2377,8 +2404,10 @@ that worker, not as the driver or anonymously:
2377
2404
  generation reach only the `agl` MCP server's environment, never the Claude process's.
2378
2405
  Once the agents listing shows the job's process, the fleet binds the launch to the job and
2379
2406
  that process; a job that already settled after a quick turn is bound without a process. A
2380
- start, wake or relaunch that fails at any step revokes its launch. Stop revokes the launch
2381
- and archive also removes the overlay. A start fails closed before Claude runs when the
2407
+ start, wake or relaunch that fails at any step revokes its launch. Stop and archive revoke
2408
+ whatever caller identity the controller holds for the worker, also one the fleet never
2409
+ prepared (kept from before a restart, or recorded for a bridge identified by its process,
2410
+ below), and archive also removes the overlay. A start fails closed before Claude runs when the
2382
2411
  Configuration master has no `agl` MCP server.
2383
2412
  - Fleet Codex workers prepare the launch on the fleet's own connection before
2384
2413
  `thread/start` and bind it before the first `turn/start`. Before steering a thread whose
@@ -2393,9 +2422,10 @@ that worker, not as the driver or anonymously:
2393
2422
  credential). When a bridge enrolls under another process than the bound one, or after a
2394
2423
  controller restart, the fleet reads a fresh Claude inventory (one read at a time) and the
2395
2424
  launch is bound to the bridge's process only when the inventory lists the worker's session,
2396
- once, as the same background job in exactly that process, the process runs the approved
2397
- Claude Code executable, and the bridge is its direct child running the recorded command
2398
- over its own connection. A launch a restarted controller restores is proved the same way
2425
+ once, as the same background job in exactly that process, the process runs an installed
2426
+ Claude Code release (a regular file of the controller's user in the directory of the release
2427
+ `claude` resolves to now; a process the launch was proved against keeps the release it runs),
2428
+ and the bridge is its direct child running the recorded command over its own connection. A launch a restarted controller restores is proved the same way
2399
2429
  before its first write, also when its process still runs. Every other process stays
2400
2430
  unverified, and a refused bridge is not proved again at every call: for the life of that
2401
2431
  process image, or for five seconds when the job showed no process yet, the inventory could
@@ -2412,6 +2442,27 @@ that worker, not as the driver or anonymously:
2412
2442
  with. Each reason an enrollment stays unverified is written once to the controller log,
2413
2443
  naming the worker and its session, never the launch ID or a credential; a bridge refused
2414
2444
  under both commands has both reasons, the recorded command's first.
2445
+ - A launch is only a hint. A bridge that presents none (a Claude session adopted by reference,
2446
+ whose saved options lack the overlay) or one the controller does not hold as presented
2447
+ (unknown, replaced, revoked, of another generation) is identified by its process chain when it
2448
+ enrolls before a call. All of these must hold: the bridge holds its own connection and runs the
2449
+ bridge command the controller approves now; the process it runs under directly, never one
2450
+ further up, runs an installed Claude Code release (proved before the fleet is asked, so a shell
2451
+ or terminal costs no inventory read), is listed exactly once by a fresh inventory of the
2452
+ fleet's Claude homes (those of its workers that are not archived) as the process of a
2453
+ background job, whose session the inventory lists once, and is unchanged across that read; and
2454
+ exactly one stored worker of any owner binds that session, a live Claude worker without a
2455
+ dispatch in flight or a lost one, under the profile home that lists it. The bridge
2456
+ then enrolls into the worker's current record, or into one bound to that process when the
2457
+ worker has none or a revoked one; a record a fleet wake prepared answers pending and is never
2458
+ replaced. That record is not kept in the store: after a restart the process proves itself
2459
+ again. A refused bridge is answered from memory for its image and its parent process, for the
2460
+ process's life or five seconds for a reason that may pass (an inventory that does not list that
2461
+ process yet, as after Claude Code moved a job to a new process, an unreadable inventory, a
2462
+ dispatch in flight, a worker that is not live), until the fleet adopts or re-binds a worker. A
2463
+ refusal read while the fleet adopted or re-bound a worker is not remembered.
2464
+ A bridge that gets a credential this way presents only it; without one, or when the controller
2465
+ rejects or fails the enrollment, it calls as before, with a caller credential it inherited, if any.
2415
2466
 
2416
2467
  The bridge exchanges credentials only through the private controller endpoint after Linux
2417
2468
  direct-loopback socket-inode ownership, approved executable/argv and current native
@@ -3465,6 +3516,7 @@ agl mcp [--port 4097]
3465
3516
  agl ticket list|get|create|update|move|comment|link|unlink|assign|ask|answer [options] [--json]
3466
3517
  agl deploy status [TARGET] | history TARGET | probe TARGET [--json]
3467
3518
  agl release status [REPO] [--json]
3519
+ agl push status [--json] | apns set|unset | fcm set|unset | previews on|off | test [--port 4097] [options]
3468
3520
  agl feed list [--state failed] [--json] | acknowledge <row-id> --updated-at <ms> [--json]
3469
3521
  agl foreground [options]
3470
3522
  agl temp-password [--port 4097] [--ttl-hours 24]
@@ -3841,13 +3893,13 @@ Each connection of a device authenticates on its own: the controller hands it a
3841
3893
 
3842
3894
  ### Managing devices
3843
3895
 
3844
- Settings → Devices lists every paired device with its model, when it paired, whether it is connected now and when it last connected. A device's page shows its key fingerprint and id. **Revoke** deletes the device and closes every connection of it at once with WebSocket close code 4403; the device must pair again with a new code. Moving the controller to another public origin with `agl remote set` or `agl remote unset` removes every device, since each signed the old origin; the devices go in the same transaction as the move, so a move that fails keeps them. Pairing, authentication and revocation are audited (`device.pairing.begin`, `device.pair`, `device.auth`, `device.revoke`), and every request of a device is audited under `device:<id>`.
3896
+ Settings → Devices lists every paired device with its model, when it paired, whether it is connected now and when it last connected. A device's page shows its key fingerprint and id. **Revoke** deletes the device and its notification registration and closes every connection of it at once with WebSocket close code 4403; the device must pair again with a new code. Moving the controller to another public origin with `agl remote set` or `agl remote unset` removes every device, since each signed the old origin; the devices and their registrations go in the same transaction as the move, so a move that fails keeps them. Pairing, authentication and revocation are audited (`device.pairing.begin`, `device.pair`, `device.auth`, `device.revoke`), and every request of a device is audited under `device:<id>`.
3845
3897
 
3846
3898
  ### The device protocol
3847
3899
 
3848
- The device API is its own contract, separate from the browser's: `ts_interfaces/devices.ts` in the package, and the same contracts as JSON Schema in `ts_interfaces/devices.schema.json` (each contract's request and response, and every named type they reach). A device asks `device.hello` for the device protocol version (`major` 1, `minor` 3) and speaks one major; within it, changes only add. Minor 1 added MCP elicitations: `elicitations` in every `device.session.read` (empty while none is pending; each one a `form` with its `fields`, a `url` or an `unsupported` request with its `reason`) and `device.elicitation.reply`. Minor 2 added the Inbox: `device.inbox.list` and its `inbox.changed` event (the same list as the browser's, without host paths; each item says whether a device answers it: `session`, `child`, `ticket` or `none`), `device.ticket.answer` (a ticket question or a go, as the owner) and `childSessionId` on `device.permission.reply` and `device.question.reply` for a direct child the Inbox names; a client sends `childSessionId` only to a controller that answers `minor` 2 or later. Minor 3 added the driver and the direct reports: `device.driver.get`, `device.driver.seen`, `device.driver.read` and `device.driver.send`, `device.directreports.list` and `device.directreport.message`, and the events `driver.changed` and `directreports.changed`, the host's status, read-only: `device.host.get` and its `host.changed` event, and the shared board: `device.board.list`, `device.ticket.get`, `device.ticket.comment`, `device.ticket.ask` and `device.ticket.move`, and the `tickets.changed` event; a client calls them only on a controller that answers `minor` 3 or later. A device does not tell the controller its minor, so a client ignores keys it does not know; the iOS (HarnessKit) and Android clients of minor 0 do. Apps generate their clients from these files.
3900
+ The device API is its own contract, separate from the browser's: `ts_interfaces/devices.ts` in the package, and the same contracts as JSON Schema in `ts_interfaces/devices.schema.json` (each contract's request and response, every named type they reach, the refusal codes and what a push notification carries). A device asks `device.hello` for the device protocol version (`major` 1, `minor` 4) and speaks one major; within it, changes only add. Minor 1 added MCP elicitations: `elicitations` in every `device.session.read` (empty while none is pending; each one a `form` with its `fields`, a `url` or an `unsupported` request with its `reason`) and `device.elicitation.reply`. Minor 2 added the Inbox: `device.inbox.list` and its `inbox.changed` event (the same list as the browser's, without host paths; each item says whether a device answers it: `session`, `child`, `ticket` or `none`), `device.ticket.answer` (a ticket question or a go, as the owner) and `childSessionId` on `device.permission.reply` and `device.question.reply` for a direct child the Inbox names; a client sends `childSessionId` only to a controller that answers `minor` 2 or later. Minor 3 added the driver and the direct reports: `device.driver.get`, `device.driver.seen`, `device.driver.read` and `device.driver.send`, `device.directreports.list` and `device.directreport.message`, and the events `driver.changed` and `directreports.changed`, the host's status, read-only: `device.host.get` and its `host.changed` event, and the shared board: `device.board.list`, `device.ticket.get`, `device.ticket.comment`, `device.ticket.ask` and `device.ticket.move`, and the `tickets.changed` event; a client calls them only on a controller that answers `minor` 3 or later. Minor 4 adds notifications: `device.push.register` and `device.push.unregister`, `push` on `device.host.get`'s `device` while the device is registered for them (whether it asked for direct report results, whether notifications carry previews, whether the host can send now, and the last notification that did not go out; never its token), and what a notification carries (`TDevicePushData`, one set of string values for both platforms: an Inbox item, a summary, a direct report's result and the removal of notifications whose items left the Inbox). A device does not tell the controller its minor, so a client ignores keys it does not know; the iOS (HarnessKit) and Android clients of minor 0 do. Apps generate their clients from these files.
3849
3901
 
3850
- - Before it is authenticated a connection reaches `device.hello`, `device.pair`, `device.auth.challenge` and `device.auth.prove`, under the controller's limits for unauthenticated requests: per connection, and in total together with the browser's sign-in requests. After that it reaches `device.sessions.list`, `device.session.read`, `device.session.send`, `device.permission.reply`, `device.question.reply`, `device.elicitation.reply`, `device.inbox.list`, `device.ticket.answer`, `device.driver.get`, `device.driver.seen`, `device.driver.read`, `device.driver.send`, `device.directreports.list`, `device.directreport.message`, `device.host.get`, `device.board.list`, `device.ticket.get`, `device.ticket.comment`, `device.ticket.ask` and `device.ticket.move`, under the limits of the owner's browser. A device never reaches a method of the browser, and the browser never one of a device. A connection is one or the other for its whole life: a connection signed in as the browser cannot authenticate as a device, and one a device authenticated cannot sign in as the browser.
3902
+ - Before it is authenticated a connection reaches `device.hello`, `device.pair`, `device.auth.challenge` and `device.auth.prove`, under the controller's limits for unauthenticated requests: per connection, and in total together with the browser's sign-in requests. After that it reaches `device.sessions.list`, `device.session.read`, `device.session.send`, `device.permission.reply`, `device.question.reply`, `device.elicitation.reply`, `device.inbox.list`, `device.ticket.answer`, `device.driver.get`, `device.driver.seen`, `device.driver.read`, `device.driver.send`, `device.directreports.list`, `device.directreport.message`, `device.host.get`, `device.push.register`, `device.push.unregister`, `device.board.list`, `device.ticket.get`, `device.ticket.comment`, `device.ticket.ask` and `device.ticket.move`, under the limits of the owner's browser. A device never reaches a method of the browser, and the browser never one of a device. A connection is one or the other for its whole life: a connection signed in as the browser cannot authenticate as a device, and one a device authenticated cannot sign in as the browser.
3851
3903
  - The feed is the sidebar's session feed without terminal rows, host directories or tickets. A transcript page reduces a tool call to its name, title and status; its input and output stay on the controller. `device.session.read` without `before` returns the newest page, sized by the controller whatever `limit` says; with `before` it returns the next older page of `limit` messages (1 to 50, default 20). A device names a session only by the feed's row id, and reaches only what the feed lists.
3852
3904
  - A message from a device is a direct message (it queues behind a running turn), never the browser's shared draft. A native session AGL does not write to (another process runs it, a fleet worker owns it) refuses it, as it refuses the browser.
3853
3905
  - A device answers as the owner on its own authenticated connection, audited as the device. Its Inbox lists the driver's turn and the driver's own prompts without an answer (the driver session is no feed row), and a native wait as information. A child's answer is sent only after the controller proved the child a running direct child of the session, as it does for the browser.
@@ -3855,16 +3907,41 @@ The device API is its own contract, separate from the browser's: `ts_interfaces/
3855
3907
  - `device.directreports.list` lists the active direct reports as the Driver view does, each by its name, with its session as the feed names it, status, projects, ticket, newest `result:` line, open questions and the fleet workers that report to it (name, harness, status, ticket; no directories or profiles), and whether it takes a message. `device.directreport.message` sends one the owner's message as the Driver view does: a fleet worker report is steered through its ticket and answers `fleet` once the steer succeeded (a steer the fleet refused before its dispatch is refused with `direct_report_failed` and the fleet's own text, such as "Worker is archived.", or "The controller operation failed." with the failure journal's reference where a harness's own text failed it; a steer that failed after its dispatch, or whose job does not prove it sent nothing (`errorOutcome` other than `refused`), may have delivered the message and is `outcome_unknown`, "The request may have taken effect. Read again to learn whether it did before sending it again." with the failure journal's reference, which a client never sends again on its own); a Codex thread takes it as the owner's agent message, `steer` into the turn AGL runs or `next-turn`. A turn another Codex client runs is refused with `direct_report_busy` (nothing was sent), a Claude Code session the fleet does not run with `direct_report_failed`, and messages to a report faster than its agent message rate with `rate_limited`. Messages are audited as `session.message` from `Owner` for the device.
3856
3908
  - The Host view is read-only (AGL-824): a device changes nothing on the host (no deploy or deploy probe, account, setting, upgrade or pairing). `device.host.get` answers what runs (`agl`: the AGL release, its start, its public origin, and whether a device reaches it through the gateway AGL keeps its route on, with where that route's sync stands, or through the owner's own reverse proxy; never the gateway's address, the client or the route's target), the device itself as the controller keeps it (`device`: name, model, when it paired and when it last connected; a device neither renames nor unpairs itself), the deploy targets (`deploys`: what each runs and since when, whether its probe answers, its newest release, the released versions it does not run (`undeployed`, newest first), and its planned deploys (`plans`: the ticket, the version, the owner's go and, for one queued into a maintenance window, the window's times); never a probe's address, the owner's notes on how it deploys and what a deploy interrupts, a failed probe's text, a plan's question or who deploys it, and the read runs no probe), the inference proxy's account pools (`pools`: each pool's verdict and room, and its accounts by plan and then the most used first, each only as its plan, state and the usage window it is bound by: no account id, and no order that stands in for one) and the API keys (`apiKeys`: per provider, how many keys are under their monthly spend limit, held at it, without one, or not read, judged by the rule AGL's inference proxy places by; no label, email, id or dollar amount). `deploys`, `pools` and `apiKeys` each answer `ready` or `unavailable` on their own, with the reason (`not_running`, `outdated`, or `failed` with the failure journal's `reference`), and the request still answers the others. `host.changed` (no payload) says when to read it again: the deploy targets, their planned deploys (tickets) or the accounts changed. Usage moves without an event, so a client reads it again when the Host view is opened or refreshed.
3857
3909
  - The shared board on a device is the browser's board (AGL-1637). `device.board.list` answers one column at a time, as the browser shows its cards (the tasks; an epic and a subtask open with `device.ticket.get`), in the column's order, `limit` (1 to 100, default 50) from `offset`, filtered as the browser filters: `text` (1 to 200 characters, in the key, title, description and source words), `project`, `epic` (the epic's own tasks), `assignee` (`{ kind: 'owner' }`, `{ kind: 'unassigned' }` or a session as the feed names it) and an AutoLabel (`openQuestion`, `planned`, `undeployed`). Every column's count under the same filters comes from the same read as the page, with `total`, the projects the board's tickets name, the epics a filter may choose and the board's `revision`: when a later page answers another revision, or `tickets.changed` arrives, a client reads the board again from offset 0. `device.ticket.get` answers a ticket with its description, source words, links and parent, one page of its discussion (comments and questions together in the order they were written, newest page first, at most `limit` of 1 to 50 and 256 KiB, `before` for the next older page), where it runs (`placement`, from the deploy monitor, `unavailable` on its own as a section of `device.host.get` is) and what it plans (`plans`: the release plan, the maintenance window and the deploy plan, with where the window stands and the owner's go while the monitor answers); no history of its other changes, no source attachments, no plan's question and nothing that names who deploys it. People appear by name: the owner as `kind: 'owner'`, never the owner's account, a person's id or a session the feed does not list (the driver's own session included). `device.ticket.comment` (Markdown, at most 64 KiB as the store keeps it), `device.ticket.ask` (text alone, at most 16 KiB, answered with text) and `device.ticket.move` (to the end of a column; "Move to…" stands in for the browser's drag) run the browser board's own function as the owner, audited as `ticket.comment`, `ticket.ask` and `ticket.move` for the device; `device.ticket.answer` answers a question. The controller decides every change: a refusal changes nothing and carries the ticket store's own code (`deviceTicketRefusalCodes`, such as `ticket_review_branch_required` for a move to review without a branch) and its reason. The app then keeps the owner's draft, reads the ticket again and shows the reason; it never sends a refused change again on its own. A change whose outcome AGL cannot tell is refused as `outcome_unknown` and stays fenced: the app reads the ticket again to learn whether it happened before the owner decides, and never sends it again on its own. Creating, editing and assigning tickets stay in the browser.
3910
+ - Notifications (AGL-1639): `device.push.register` registers the device itself, never another, with its push service's token (`platform` `apns` with the device token as lowercase hex and its `environment`, `sandbox` or `production`, or `fcm` with the registration token) and whether it wants the direct reports' results too (`reports`). A device holds one registration, which the next one replaces, so the app registers again with its current token on every connect; the same request again changes nothing. It answers the registration as `device.host.get` shows it (`push`: `reports`, `previews`, `available`, `lastFailure`), and is taken also while the host cannot send (`available` `false`: the owner has not set the platform's credential, or Apple or Google refused it; see [Notifications](#notifications)). `device.push.unregister` ends it (`removed` says whether there was one). The token is kept only in the registration (`agl_controller_push_registrations`, one record per device, beside the device record and never in it); no answer, event, audit entry or log repeats it. Revoking the device and an origin move delete its registration with it, in the same transaction, and a start removes every registration whose device is gone.
3858
3911
  - Every refusal of every device method carries one code of `TDeviceRefusalCode` as `error.data.code` and a message to show, whatever the controller refused it with (AGL-1670): the set is closed, and within a major it only grows. The pairing and the connection: `device_unknown` (forget the pairing), `device_pairing_invalid`, `device_pairing_unavailable`, `device_limit`, `device_already_paired`, `device_proof_invalid`, `device_challenge_invalid` and `device_authentication_required`. What the request names is gone: `session_not_found` (list the feed again), `driver_absent`, and the ticket store's `ticket_not_found` and `ticket_question_not_found`. Nothing was done because something else changed meanwhile, so read again, then decide: `concurrent_change` (among others an answer to a permission or question the session no longer holds, AGL-1687), `ticket_revision_conflict` and `direct_report_busy`. Refused by a rule, with the reason: `session_read_only` (including a session whose model or stopped message the owner resolves in the browser first), `invalid_request`, `direct_report_failed` and the ticket store's other codes (`deviceTicketRefusalCodes`). Limits: `rate_limited`, final as every refusal, and `operation_limit`. The controller: `controller_unavailable` (not ready: starting, stopping, or a harness or the Flex child not running) and `controller_failed` (a fault, always "The controller operation failed."; `error.data.reference` names the failure journal entry the owner's browser shows, and no message to a device carries a raw cause such as a socket path or a spawn error). `outcome_unknown` means the request may have happened: AGL dispatched it, or may have, and cannot tell whether it took effect. A client never resends it on its own; it keeps the owner's text, reads the session, the driver or the ticket again to learn the outcome, and the owner decides.
3859
3912
  - The controller pushes a device an allowlist of events in their own shape: feed changes, a session's change, its streaming text (snapshots and exact deltas), Inbox changes, the driver's changes (`driver.changed` with its status, also when its transcript or prompts changed, never its streaming text), the direct reports' changes (`directreports.changed`, with no payload, also when fleet workers or tickets changed), the host's changes (`host.changed`, with no payload, when the deploy targets or the accounts changed), the board's changes (`tickets.changed`, with no ticket key and with the board's revision when it moved, followed by `directreports.changed` and `host.changed`, since tickets hold the reports' questions and the planned deploys) and a resynchronization request. Every other event, and every event about a session the feed does not list, stays on the controller. A device that falls behind by 256 events or 4 MiB is resynchronized alone: on `sessions.changed` it lists the feed and reads the open session again, an open Driver view included (the driver's own changes may have folded into it).
3860
3913
  - Through the gateway, a device's WebSocket upgrade carries the public origin as `Origin`, like a browser's (Admission).
3861
3914
 
3915
+ ### Notifications
3916
+
3917
+ The host sends notifications of what waits in the Inbox itself, straight to Apple's push service (APNs) and to Firebase Cloud Messaging (FCM), to each paired device that registered for them (`device.push.register`); no relay sits between. It sends with the app publisher's own credentials, which the owner gives the running controller with `agl push`, as the local owner (the same owner capability `agl config` and `agl ticket` use); there is no way to upload a key through the browser.
3918
+
3919
+ ```sh
3920
+ agl push apns set --key-id ABC123DEFG --team-id DEF123GHIJ < AuthKey_ABC123DEFG.p8 # topic com.modelprofile.harness unless --topic names another
3921
+ agl push fcm set < service-account.json # the Firebase project's service account key file
3922
+ agl push previews on # off by default
3923
+ agl push status [--json]
3924
+ agl push test [--device DEVICE_ID] # the test notification to every registered device, with what Apple or Google answered
3925
+ agl push apns unset
3926
+ agl push fcm unset
3927
+ ```
3928
+
3929
+ - What is sent: one notification for each item that comes into the Inbox, to every registered device of this host, also to a device that is connected (the app does not show it in the foreground) and while nobody is connected at all: with a usable credential and a registered device the Inbox is kept current without an open browser. More than four items at once are one notification ("New items wait for you in the Inbox."). An item that leaves the Inbox, answered anywhere, removes its notification from the devices, and one still waiting to be sent is dropped; a changed item sends nothing. The badge is the Inbox's count. A clean stop (`agl stop`, `agl restart`, an upgrade) hands over what was announced, and what the handover before it named that has not come back yet: after it, an item that still waits as it did is not sent again, while one that came meanwhile, or that waits anew (another wait in the same session), is. After a crash or a kill, or when the handover could not be written or read (the failure journal says so), the items still waiting are sent once more under their keys: the notification shown is replaced, and it sounds again. The handover is one document per controller (`agl_controller_push_handover`) that the next start reads and removes; an older controller does not read it. A device that asked for direct reports' results gets a quiet notification, without a badge, for each new `result:` line of a direct report that is a fleet worker.
3930
+ - A key is read from standard input, from a pipe or a file and never from a terminal, and checked before it is kept: an APNs key is the AuthKey .p8 file (one P-256 private key) with its 10-character key id and the team id; an FCM key is the service account's JSON key file (`type` `service_account`, `project_id`, `client_email` and an RSA `private_key` of at least 2048 bits). The file's `token_uri` and its other URLs are ignored: the host asks only Google's own endpoints. A refusal names the field and the rule, never what was given.
3931
+ - Each key is TPM2-sealed in the controller's database (`agl_controller_push_settings`, one document per controller, `{ id, content }`) under a name bound to the controller, the platform and the credential's generation, as the trusted-proxy secret is; it exists in plaintext only in the running controller. No answer, CLI line, log line, audit entry, event or stored byte repeats a key. Setting a credential again replaces it.
3932
+ - `agl push status` shows previews and, for each platform, whether its credential is `ready`, `refused` (Apple or Google refused it: nothing is sent on the platform until the owner sets it again), `unreadable` (this machine cannot unseal it: set it again) or not set, what it is for (key id, team id and topic; project and service account), when it was set and how many devices registered for the platform. Removing a credential leaves the registrations in place.
3933
+ - Previews are one setting for every device of the host, off unless the owner turns them on. Off, a notification says one fixed sentence per kind of item; on, it also says where the item lives, what it asks and its id, which Apple or Google can read.
3934
+ - Sending: APNs over HTTP/2 to `api.push.apple.com`, or `api.sandbox.push.apple.com` for a development build's token, with an ES256 provider token signed with the key (renewed after 50 minutes, within Apple's 20-to-60-minute rule) and the bundle id as topic; FCM through the HTTP v1 API, with an access token the service account's RS256 assertion gets from Google's token endpoint. An iOS notification is an alert push (thread `inbox` or `reports`, interruption level `active` or `passive`, the default sound except for a report's result, the Inbox's count as badge) carrying the payload under `agl`, with the item's key as `apns-collapse-id`; removing notifications is a background push. An Android notification is a data-only message whose values are all strings; the app builds the notification itself. Apple and Google are told a notification expires after an hour.
3935
+ - A send never holds up the Inbox or event delivery. A notification Apple or Google could not take for a reason that passes (they asked the host to wait, failed, or could not be reached) waits in the device's queue, in memory only: the newest per key, sent again after 1 s, doubling up to 5 minutes or as long as the service asked, and dropped once it is an hour old. A notification refused for good is dropped. A token the push service no longer knows ends the device's registration, if the device still holds that token; the app registers again on its next connect. A credential Apple or Google refuses stops its platform until the owner sets it again; Google's bare "not found", which names neither the token nor the credential, drops only that notification. A refusal that does not name the credential waits and is sent again instead: Apple calling a provider token stale that the host signed less than 20 minutes ago (the host's clock is off, or a resumed VM's was), which is signed again once Apple allows it, an answer of Google's token endpoint that names neither the service account nor its key, and Google's `invalid_grant` while the `Date` of its answer is more than 60 seconds from the host's clock (the host's clock is off: `agl push status` and the failure journal say by how much and which clock is behind; set the host's clock right, NTP). A connection to Apple that has been quiet for a minute answers a ping before the next notification goes on it, so one a NAT or firewall dropped without a word is replaced within 3 seconds. `device.host.get` shows the device whether the host can send (`available`) and its last notification that did not go out (`lastFailure`); `agl push status` shows each platform's last failed send with the push service's own code, and how far the host's clock was off when that was why. Nothing of this survives a restart, and stopping the controller ends every request and connection.
3936
+ - `agl push test` sends the test notification ("Push from AGL works.") to every registered device, or to the one `--device` names, and prints for each what its push service answered: `delivered`, `not sent` without a usable credential, the reason it was not delivered with the service's code, that the service no longer knows the token (the registration is then removed), or `no answer in time` when it did not answer within 20 seconds (the notification may still arrive; the command never waits longer than its request may). It names each device by its name and id, never its token.
3937
+ - Every change is audited: `push.apns.set` (with the key id, team id and topic in `details.push`), `push.apns.unset`, `push.fcm.set` (with the project and the service account), `push.fcm.unset` and `push.previews` (with the setting), and every `agl push test` as `push.test` (with how many devices it went to and how many got it), each with the local CLI that made it. An earlier release (41.1.0 on) reads them as audit types it does not know and starts with the collection in place.
3938
+
3862
3939
  ## Security Boundaries
3863
3940
 
3864
3941
  - Local mode binds the controller to loopback only, and so does TLS-proxy mode without a gateway source. With one, a request from off loopback needs a configured gateway source address and the trusted-proxy secret, and only loopback connects without an `Origin`.
3865
3942
  - The trusted-proxy secret is generated and TPM2-sealed in the controller's database; it is never read from the environment, written to a file or logged.
3866
3943
  - Only `agl remote`, run by the local OS user against a stopped controller, changes a port's public origin, RP ID, TLS mode or gateway sources, and a changed origin or RP ID removes the passkey (a changed origin every paired device too).
3867
- - A paired device holds its own key; the controller stores only its public key. A device reaches only the device scope (feed, bounded reads, direct sends, permission, question and elicitation answers, the Inbox and ticket answers, the driver and the direct reports, the host's status, read-only, and the shared board's comments, questions and moves, as the owner), each connection proves the key over a fresh nonce, and revoking a device closes its connections at once. Pairing codes are single-use, live five minutes in memory only, and pairing is refused in local mode.
3944
+ - A paired device holds its own key; the controller stores only its public key. A device reaches only the device scope (feed, bounded reads, direct sends, permission, question and elicitation answers, the Inbox and ticket answers, the driver and the direct reports, the host's status, read-only, the shared board's comments, questions and moves, as the owner, and its own notification registration, whose push token it never reads back), each connection proves the key over a fresh nonce, and revoking a device closes its connections at once. Pairing codes are single-use, live five minutes in memory only, and pairing is refused in local mode.
3868
3945
  - The private OpenCode server always remains on loopback and uses a generated per-process password.
3869
3946
  - Application RPC starts only after the exact TypedSocket package-major handshake.
3870
3947
  - The management endpoint (`/management/typedrequest`, used by the CLI and the upgrade worker) answers only an HTTP `POST` of `application/json` from a loopback peer (`127.0.0.1` or `::1`), addressed to `127.0.0.1:<port>`, with no `Origin` and no forwarding header (`Forwarded`, `X-Forwarded-*`, `X-Real-IP`, `X-Harness-Controller-Proxy-Secret`), so a browser or a request a proxy forwards is refused, also in proxy mode. It serves only the status read and the upgrade methods; each upgrade method authorises itself against the upgrade token and its one-time grant, as it does over the socket, and every upgrade request counts against the controller's global unauthenticated preflight limit.
@@ -3,6 +3,6 @@
3
3
  */
4
4
  export const commitinfo = {
5
5
  name: 'agl',
6
- version: '43.6.0',
6
+ version: '43.8.0',
7
7
  description: 'Agent Gateway Layer for OpenCode, FlexHarness, and Codex sessions'
8
8
  }
@@ -155,6 +155,14 @@ export const aglApiMethods = {
155
155
  'agl.mcp.deploy.release': { use: 'excluded', exclusion: 'person', reason: ownerToken },
156
156
  'agl.mcp.deploy.ticket': { use: 'excluded', exclusion: 'person', reason: ownerToken },
157
157
  'agl.mcp.deploy.refresh': { use: 'excluded', exclusion: 'person', reason: ownerToken },
158
+ // The host's push credentials and previews (AGL-1639): only the owner sets them, with `agl push`.
159
+ 'agl.mcp.push.status': { use: 'excluded', exclusion: 'person', reason: ownerToken },
160
+ 'agl.mcp.push.apns.set': { use: 'excluded', exclusion: 'person', reason: ownerToken },
161
+ 'agl.mcp.push.apns.unset': { use: 'excluded', exclusion: 'person', reason: ownerToken },
162
+ 'agl.mcp.push.fcm.set': { use: 'excluded', exclusion: 'person', reason: ownerToken },
163
+ 'agl.mcp.push.fcm.unset': { use: 'excluded', exclusion: 'person', reason: ownerToken },
164
+ 'agl.mcp.push.previews': { use: 'excluded', exclusion: 'person', reason: ownerToken },
165
+ 'agl.mcp.push.test': { use: 'excluded', exclusion: 'person', reason: ownerToken },
158
166
  'agl.mcp.worker.enroll': { use: 'excluded', exclusion: 'transport',
159
167
  reason: 'It enrols the caller credential of a launched worker: the MCP channel itself.' },
160
168
  } as const satisfies Record<TControllerMcpMethod, TAglApiMethodUse>;
@@ -29,6 +29,7 @@ import type {
29
29
  IReq_ControllerAccountsSpendLimit,
30
30
  IReq_ControllerAccountsClaudeCode,
31
31
  IReq_ControllerAccountsRenewal,
32
+ IReq_ControllerAccountsPriority,
32
33
  IReq_ControllerAccountsUsageGet,
33
34
  IReq_ControllerAccountsUsageRecheck,
34
35
  TControllerAccountBinding,
@@ -256,6 +257,18 @@ export class AccountsActions {
256
257
  }));
257
258
  },
258
259
  );
260
+ routerArg.addHandler<IReq_ControllerAccountsPriority>(
261
+ 'controller.accounts.priority',
262
+ async (requestArg, toolsArg) => {
263
+ const request = assertRequestShape(requestArg, {
264
+ accountId: 'string', expectedRevision: 'number', priority: 'boolean',
265
+ }) as IReq_ControllerAccountsPriority['request'];
266
+ // The audit names the action and the peer; the end is the account's, which the accounts service journals.
267
+ return hostArg.runAudited(toolsArg?.localData, 'accounts.priority', async (signalArg) => ({
268
+ answer: await this.setPriority(request, signalArg),
269
+ }));
270
+ },
271
+ );
259
272
  routerArg.addHandler<IReq_ControllerAccountsRemove>(
260
273
  'controller.accounts.remove',
261
274
  async (requestArg, toolsArg) => {
@@ -559,6 +572,18 @@ export class AccountsActions {
559
572
  return answer;
560
573
  }
561
574
 
575
+ /** Gives an account the owner's priority for 24 hours, or ends it, and answers once the projection shows it. */
576
+ public async setPriority(
577
+ requestArg: IReq_ControllerAccountsPriority['request'],
578
+ signalArg: AbortSignal,
579
+ ): Promise<TControllerAccountsAnswer<plugins.authswitchAuthority.IAuthSwitchAccount>> {
580
+ const answer = await this.answer((clientArg) => clientArg.setAccountPriority(
581
+ requestArg.accountId, requestArg.expectedRevision, requestArg.priority, signalArg,
582
+ ));
583
+ if (answer.state === 'done') await this.waitForAccountRevision(answer.value, signalArg);
584
+ return answer;
585
+ }
586
+
562
587
  /** Waits until the controller's projection shows the account at `accountArg`'s revision or later. */
563
588
  private async waitForAccountRevision(
564
589
  accountArg: plugins.authswitchAuthority.IAuthSwitchAccount,