agl 41.1.0 → 42.0.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 (106) hide show
  1. package/changelog.md +48 -0
  2. package/dist_serve/bundle.js +2190 -2193
  3. package/dist_serve/bundle.js.map +2 -2
  4. package/dist_serve/bundle.js.third-party-notices.json +3 -68
  5. package/dist_serve/bundle.js.third-party-notices.txt +4 -137
  6. package/dist_ts/00_commitinfo_data.js +1 -1
  7. package/dist_ts/aglapi/aglapisurface.document.js +4 -4
  8. package/dist_ts/classes.authmodels.d.ts +2 -8
  9. package/dist_ts/classes.authmodels.js +60 -23
  10. package/dist_ts/classes.authstore.d.ts +22 -0
  11. package/dist_ts/classes.authstore.js +152 -23
  12. package/dist_ts/classes.cli.d.ts +3 -6
  13. package/dist_ts/classes.cli.js +38 -51
  14. package/dist_ts/classes.config.d.ts +17 -3
  15. package/dist_ts/classes.config.js +55 -18
  16. package/dist_ts/classes.controller.d.ts +12 -12
  17. package/dist_ts/classes.controller.js +46 -117
  18. package/dist_ts/classes.controllermanagement.d.ts +42 -9
  19. package/dist_ts/classes.controllermanagement.js +72 -23
  20. package/dist_ts/classes.controllerservice.d.ts +3 -31
  21. package/dist_ts/classes.controllerservice.js +3 -47
  22. package/dist_ts/classes.inferencegateway.js +4 -3
  23. package/dist_ts/classes.inferenceusage.d.ts +19 -7
  24. package/dist_ts/classes.inferenceusage.js +49 -13
  25. package/dist_ts/classes.inferenceusagetap.d.ts +15 -3
  26. package/dist_ts/classes.inferenceusagetap.js +16 -9
  27. package/dist_ts/classes.mcpcontrollerhost.js +9 -3
  28. package/dist_ts/classes.processinspection.d.ts +8 -1
  29. package/dist_ts/classes.processinspection.js +92 -2
  30. package/dist_ts/classes.proxycontrol.js +6 -1
  31. package/dist_ts/classes.proxydaemon.d.ts +2 -2
  32. package/dist_ts/classes.proxydaemon.js +1 -1
  33. package/dist_ts/classes.proxystore.d.ts +2 -11
  34. package/dist_ts/classes.proxystore.js +3 -25
  35. package/dist_ts/classes.tpmsecretcodec.d.ts +13 -0
  36. package/dist_ts/classes.tpmsecretcodec.js +28 -0
  37. package/dist_ts/classes.trustedproxysecrets.d.ts +91 -0
  38. package/dist_ts/classes.trustedproxysecrets.js +338 -0
  39. package/dist_ts/classes.upgradecoordinator.d.ts +14 -1
  40. package/dist_ts/classes.upgradecoordinator.js +21 -3
  41. package/dist_ts/classes.upgradetransaction.d.ts +32 -0
  42. package/dist_ts/classes.upgradetransaction.js +101 -4
  43. package/dist_ts/classes.usagefeed.js +3 -2
  44. package/dist_ts/functions.controlleradmission.d.ts +67 -0
  45. package/dist_ts/functions.controlleradmission.js +127 -0
  46. package/dist_ts/functions.remotecli.d.ts +27 -0
  47. package/dist_ts/functions.remotecli.js +236 -0
  48. package/dist_ts/functions.retiredenvironment.d.ts +11 -2
  49. package/dist_ts/functions.retiredenvironment.js +22 -5
  50. package/dist_ts/index.d.ts +1 -0
  51. package/dist_ts/index.js +2 -1
  52. package/dist_ts/interfaces.auth.d.ts +29 -4
  53. package/dist_ts/interfaces.auth.js +5 -1
  54. package/dist_ts/interfaces.config.d.ts +14 -0
  55. package/dist_ts/interfaces.config.js +9 -2
  56. package/dist_ts/interfaces.lifecycle.d.ts +3 -0
  57. package/dist_ts_authswitch/classes.authoritydaemon.js +6 -1
  58. package/dist_ts_interfaces/interfaces.d.ts +2 -2
  59. package/dist_ts_interfaces/interfaces.js +1 -1
  60. package/dist_ts_interfaces/management.d.ts +2 -2
  61. package/dist_ts_interfaces/management.js +2 -2
  62. package/dist_ts_interfaces/metrics.d.ts +29 -7
  63. package/dist_ts_interfaces/metrics.js +14 -1
  64. package/dist_ts_interfaces/requests.d.ts +1 -2
  65. package/dist_ts_interfaces/requests.js +1 -1
  66. package/dist_ts_interfaces/requests.upgrade.d.ts +0 -12
  67. package/package.json +12 -11
  68. package/readme.md +99 -28
  69. package/ts/00_commitinfo_data.ts +1 -1
  70. package/ts/aglapi/aglapisurface.document.ts +3 -3
  71. package/ts/classes.authmodels.ts +68 -25
  72. package/ts/classes.authstore.ts +151 -24
  73. package/ts/classes.cli.ts +38 -61
  74. package/ts/classes.config.ts +70 -21
  75. package/ts/classes.controller.ts +50 -163
  76. package/ts/classes.controllermanagement.ts +123 -49
  77. package/ts/classes.controllerservice.ts +3 -56
  78. package/ts/classes.inferencegateway.ts +3 -2
  79. package/ts/classes.inferenceusage.ts +58 -19
  80. package/ts/classes.inferenceusagetap.ts +27 -8
  81. package/ts/classes.mcpcontrollerhost.ts +10 -5
  82. package/ts/classes.processinspection.ts +84 -3
  83. package/ts/classes.proxycontrol.ts +2 -0
  84. package/ts/classes.proxydaemon.ts +3 -2
  85. package/ts/classes.proxystore.ts +4 -25
  86. package/ts/classes.tpmsecretcodec.ts +26 -0
  87. package/ts/classes.trustedproxysecrets.ts +317 -0
  88. package/ts/classes.upgradecoordinator.ts +33 -3
  89. package/ts/classes.upgradetransaction.ts +130 -1
  90. package/ts/classes.usagefeed.ts +2 -1
  91. package/ts/functions.controlleradmission.ts +168 -0
  92. package/ts/functions.remotecli.ts +264 -0
  93. package/ts/functions.retiredenvironment.ts +25 -3
  94. package/ts/index.ts +1 -0
  95. package/ts/interfaces.auth.ts +36 -3
  96. package/ts/interfaces.config.ts +15 -0
  97. package/ts/interfaces.lifecycle.ts +3 -0
  98. package/ts_authswitch/classes.authoritydaemon.ts +2 -0
  99. package/ts_interfaces/interfaces.ts +2 -2
  100. package/ts_interfaces/management.ts +2 -2
  101. package/ts_interfaces/metrics.ts +34 -7
  102. package/ts_interfaces/requests.ts +0 -10
  103. package/ts_interfaces/requests.upgrade.ts +0 -16
  104. package/ts_web/00_commitinfo_data.ts +1 -1
  105. package/ts_web/classes.controllersocketclient.ts +5 -2
  106. package/ts_web/elements.metricsboard.ts +68 -18
@@ -1,4 +1,17 @@
1
1
  export const controllerUsageWindows = ['1h', '24h', '7d'];
2
+ /**
3
+ * Whether a provider's answers state their input without the tokens read from or written to the cache, so that a bucket
4
+ * of that provider with unknown cache counts (`cacheReadUnknownCalls` or `cacheWriteUnknownCalls` above 0) has total
5
+ * tokens (input, output, cache reads and cache writes) that are a lower bound of what its answers used. An Anthropic
6
+ * account's answers leave the cache out of their input, so a cache count such an answer did not state is counted
7
+ * nowhere. An OpenAI account's answers state every input token in their input count, the Messages answers the proxy
8
+ * translates from them included, so their unknown cache counts lie inside the input and their total is exact. Every
9
+ * provider must be named here: a new one fails the type check instead of reading as exact.
10
+ */
11
+ export const controllerUsageTotalIsLowerBound = {
12
+ anthropic: true,
13
+ openai: false,
14
+ };
2
15
  const minuteMs = 60_000;
3
16
  const hourMs = 60 * minuteMs;
4
17
  /** The span each window reads and how many spans it shows, the current one included. */
@@ -32,4 +45,4 @@ export const applyControllerUsageDelta = (viewArg, deltaArg) => {
32
45
  viewArg.revision = deltaArg.revision;
33
46
  return 'applied';
34
47
  };
35
- //# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoibWV0cmljcy5qcyIsInNvdXJjZVJvb3QiOiIiLCJzb3VyY2VzIjpbIi4uLy4uL3RzX2ludGVyZmFjZXMvbWV0cmljcy50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiQUFTQSxNQUFNLENBQUMsTUFBTSxzQkFBc0IsR0FBc0MsQ0FBQyxJQUFJLEVBQUUsS0FBSyxFQUFFLElBQUksQ0FBQyxDQUFDO0FBMEI3RixNQUFNLFFBQVEsR0FBRyxNQUFNLENBQUM7QUFDeEIsTUFBTSxNQUFNLEdBQUcsRUFBRSxHQUFHLFFBQVEsQ0FBQztBQUU3Qix3RkFBd0Y7QUFDeEYsTUFBTSxDQUFDLE1BQU0sMEJBQTBCLEdBQWtGO0lBQ3ZILElBQUksRUFBRSxFQUFFLElBQUksRUFBRSxRQUFRLEVBQUUsS0FBSyxFQUFFLEVBQUUsRUFBRTtJQUNuQyxLQUFLLEVBQUUsRUFBRSxJQUFJLEVBQUUsTUFBTSxFQUFFLEtBQUssRUFB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BQUMsTUFBTTtXQUM1RixRQUFRLENBQUMsUUFBUSxLQUFLLE9BQU8sQ0FBQyxRQUFRLEdBQUcsQ0FBQztRQUFFLE9BQU8sWUFBWSxDQUFDO0lBQ3JFLEtBQUssTUFBTSxNQUFNLElBQUksUUFBUSxDQUFDLE9BQU87UUFBRSxPQUFPLENBQUMsT0FBTyxDQUFDLEdBQUcsQ0FBQyxNQUFNLENBQUMsRUFBRSxFQUFFLE1BQU0sQ0FBQyxDQUFDO0lBQzlFLE9BQU8sQ0FBQyxRQUFRLEdBQUcsUUFBUSxDQUFDLFFBQVEsQ0FBQztJQUNyQyxPQUFPLFNBQVMsQ0FBQztBQUNuQixDQUFDLENBQUMifQ==
@@ -1,7 +1,6 @@
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
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_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
- import type { IReq_ControllerUpgradeLaunch, IReq_ControllerUpgradePrepare, IReq_ControllerUpgradePrepareBegin, IReq_ControllerUpgradeFinalize } from './requests.upgrade.js';
5
4
  import type { IReq_ControllerDriverGet, IReq_ControllerDriverEnsure, IReq_ControllerDriverSeen } from './requests.driver.js';
6
5
  import type { IReq_ControllerFleetWorkerList, IReq_ControllerFleetWorkerRead, IReq_ControllerFleetWorkerSteer } from './requests.fleetworkers.js';
7
6
  import type { IReq_ControllerDirectReportList, IReq_ControllerDirectReportMessage, IReq_ControllerDirectReportRead } from './requests.directreports.js';
@@ -41,4 +40,4 @@ export * from './requests.browser.js';
41
40
  export * from './requests.terminal.js';
42
41
  export * from './requests.workspace.js';
43
42
  export * from './requests.events.js';
44
- 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_ControllerUpgradeLaunch | IReq_ControllerUpgradePrepare | IReq_ControllerUpgradePrepareBegin | IReq_ControllerUpgradeFinalize | IReq_ControllerDriverGet | IReq_ControllerDriverEnsure | IReq_ControllerDriverSeen | IReq_ControllerFleetWorkerList | IReq_ControllerFleetWorkerRead | IReq_ControllerFleetWorkerSteer | IReq_ControllerDirectReportList | IReq_ControllerDirectReportMessage | IReq_ControllerDirectReportRead | IReq_ControllerSessionFeedList | IReq_ControllerSessionFeedAcknowledge | IReq_ControllerNativeSessionRead | IReq_ControllerNativeSessionAuxiliaryGet | IReq_ControllerNativeSessionSend | IReq_ControllerNativeSessionScratchpadSave | IReq_ControllerNativeSessionIntelligenceAsk | IReq_ControllerNativeSessionPermissionReply | IReq_ControllerNativeSessionQuestionReply | 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_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_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 | import('./requests.tickets.js').TControllerTicketTypedRequest | IReq_ControllerEvent | IReq_ControllerSessionChildEvent;
43
+ 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_ControllerSessionFeedList | IReq_ControllerSessionFeedAcknowledge | IReq_ControllerNativeSessionRead | IReq_ControllerNativeSessionAuxiliaryGet | IReq_ControllerNativeSessionSend | IReq_ControllerNativeSessionScratchpadSave | IReq_ControllerNativeSessionIntelligenceAsk | IReq_ControllerNativeSessionPermissionReply | IReq_ControllerNativeSessionQuestionReply | 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_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_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 | 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,eyJ2ZXJzaW9uIjozLCJmaWxlIjoicmVxdWVzdHMuanMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyIuLi8uLi90c19pbnRlcmZhY2VzL3JlcXVlc3RzLnRzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiJBQXFOQSxvRkFBb0Y7QUFDcEYsbUVBQW1FO0FBQ25FLGNBQWMsc0JBQXNCLENBQUM7QUFDckMsY0FBYyx1QkFBdUIsQ0FBQztBQUN0QyxjQUFjLG9CQUFvQixDQUFDO0FBQ25DLGNBQWMsMkJBQTJCLENBQUM7QUFDMUMsY0FBYyx1QkFBdUIsQ0FBQztBQUN0QyxjQUFjLHFCQUFxQixDQUFDO0FBQ3BDLGNBQWMsd0JBQXdCLENBQUM7QUFDdkMsY0FBYyxxQkFBcUIsQ0FBQztBQUNw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ztBQUN4QyxjQUFjLHNCQUFzQixDQUFDIn0=
@@ -11,18 +11,6 @@ export interface IReq_ControllerUpgradeLaunch extends plugins.typedrequestInterf
11
11
  logFilePath: string;
12
12
  };
13
13
  }
14
- export interface IReq_ControllerUpgradePrepare extends plugins.typedrequestInterfaces.implementsTR<plugins.typedrequestInterfaces.ITypedRequest, IReq_ControllerUpgradePrepare> {
15
- method: 'controller.upgrade.prepare';
16
- request: {
17
- token: string;
18
- targetVersion: string;
19
- gracePeriodMs: number;
20
- };
21
- response: {
22
- prepared: true;
23
- sessionCount: number;
24
- };
25
- }
26
14
  export interface IReq_ControllerUpgradePrepareBegin extends plugins.typedrequestInterfaces.implementsTR<plugins.typedrequestInterfaces.ITypedRequest, IReq_ControllerUpgradePrepareBegin> {
27
15
  method: 'controller.upgrade.prepare.begin';
28
16
  request: {
package/package.json CHANGED
@@ -1,8 +1,9 @@
1
1
  {
2
2
  "name": "agl",
3
- "version": "41.1.0",
3
+ "version": "42.0.0",
4
4
  "controllerUpgradeManagementVersion": 2,
5
5
  "controllerManagementProtocolVersion": 1,
6
+ "controllerGatewaySourcesVersion": 1,
6
7
  "private": false,
7
8
  "description": "Agent Gateway Layer for OpenCode, FlexHarness, and Codex sessions",
8
9
  "main": "dist_ts/index.js",
@@ -19,25 +20,25 @@
19
20
  },
20
21
  "dependencies": {
21
22
  "@anthropic-ai/claude-agent-sdk": "0.3.288",
22
- "@api.global/typedrequest": "8.2.1",
23
+ "@api.global/typedrequest": "9.2.0",
23
24
  "@api.global/typedrequest-interfaces": "7.1.0",
24
- "@api.global/typedserver": "14.2.1",
25
- "@api.global/typedsocket": "8.10.0",
26
- "@apiclient.xyz/docker": "10.1.3",
25
+ "@api.global/typedserver": "^16.0.0",
26
+ "@api.global/typedsocket": "^10.0.1",
27
+ "@apiclient.xyz/docker": "^12.0.0",
27
28
  "@aws-sdk/client-s3": "^3.1136.0",
28
29
  "@design.estate/dees-catalog": "^23.4.0",
29
30
  "@design.estate/dees-comms": "^2.1.0",
30
31
  "@design.estate/dees-element": "4.0.2",
31
32
  "@jitl/quickjs-ng-wasmfile-release-sync": "0.32.0",
32
- "@lossless.org/client": "1.22.2",
33
+ "@lossless.org/client": "^2.5.0",
33
34
  "@lossless.org/nosqldb": "10.8.0",
34
35
  "@lossless.org/objectstorage": "10.7.1",
35
36
  "@modelcontextprotocol/sdk": "1.30.0",
36
37
  "@modelprofile.com/catalog": "^1.1.0",
37
- "@modelprofile.com/flexharness": "16.4.0",
38
- "@modelprofile.com/flexharness-agent": "16.4.0",
39
- "@modelprofile.com/flexharness-models": "16.4.0",
40
- "@modelprofile.com/flexharness-providers": "16.4.0",
38
+ "@modelprofile.com/flexharness": "17.0.1",
39
+ "@modelprofile.com/flexharness-agent": "17.0.1",
40
+ "@modelprofile.com/flexharness-models": "17.0.1",
41
+ "@modelprofile.com/flexharness-providers": "17.0.1",
41
42
  "@modelprofile.com/mcp-crossharness": "5.9.0",
42
43
  "@modelprofile.com/mcp-system": "3.1.0",
43
44
  "@opencode-ai/sdk": "1.18.15",
@@ -46,7 +47,7 @@
46
47
  "@push.rocks/smartdaemon": "2.21.0",
47
48
  "@push.rocks/smartfs": "1.9.0",
48
49
  "@push.rocks/smartsecret": "1.9.1",
49
- "@push.rocks/smartserve": "8.3.1",
50
+ "@push.rocks/smartserve": "^10.0.1",
50
51
  "@push.rocks/smartshell": "4.2.0",
51
52
  "@push.rocks/smartstring": "4.3.0",
52
53
  "@push.rocks/smartsystem": "3.1.1",
package/readme.md CHANGED
@@ -628,7 +628,15 @@ proxy then keeps the account out of rotation itself until it restarts, and says
628
628
  The proxy also records the tokens every answer states -- input, output, cache reads and cache writes -- per minute and per
629
629
  hour, model, client name, account and the session id the client sent, minutes for a day and hours for eight days, also
630
630
  for an Anthropic API key; it keeps no prompt, answer or credential, and a write that fails is reported on its standard
631
- error and retried with the next. The controller reads these only while a browser watches a usage window:
631
+ error and retried with the next. An answer that does not state its cache reads or writes (a ChatGPT answer without
632
+ `input_tokens_details.cache_write_tokens`, a Claude answer whose `cache_read_input_tokens` or
633
+ `cache_creation_input_tokens` is missing or null) has unknown cache reads or writes, not none: each bucket counts the
634
+ reads and writes its answers stated (`cacheReadTokens`, `cacheWriteTokens`) and, beside them, the answers that did not
635
+ state theirs (`cacheReadUnknownCalls`, `cacheWriteUnknownCalls`). An OpenAI account's unknown cache counts stay in its
636
+ input count, since OpenAI counts every input token there; a Claude account's input leaves the cache out, so a bucket of
637
+ one with unknown cache counts adds up to less than its answers used (`controllerUsageTotalIsLowerBound`). A bucket
638
+ stored before AGL counted them reads with all its answers unknown. The controller reads these only while a browser
639
+ watches a usage window:
632
640
  `controller.metrics.usage.watch { window }` (`1h` by minute, `24h` or `7d` by hour) answers the window's buckets with
633
641
  a `watchId`, the feed's `epoch` and a `revision`, and the changes follow on that connection alone as `usage.changed`
634
642
  events, each continuing the revision before it, until `controller.metrics.usage.unwatch { watchId }` or the
@@ -642,7 +650,10 @@ is told to watch again and refused. An unreachable proxy refuses a watch with `p
642
650
 
643
651
  The web app's header has a **Metrics** button. It shows the token usage in the main pane, as the Board button
644
652
  shows the board; leaving it ends its watch. A toggle chooses the last hour, day or week. Totals for input, output,
645
- cache reads, cache writes and calls head the view; below them a line chart shows the tokens per minute by model, each
653
+ cache reads, cache writes and calls head the view; cache reads and writes read **Unknown** when no call stated any, and
654
+ **≥** the stated count when some calls did not, with the number of calls whose count is unknown under the tile (the
655
+ model and session tables say the same, and their **Total** reads **≥** when it leaves out a Claude answer's unknown
656
+ cache count); below them a line chart shows the tokens per minute by model, each
646
657
  model's line drawn from zero (each completed minute for the hour, the hourly average for the day and week, the current
647
658
  hour's over its minutes so far), and pointing at a moment lists every model's value there with the time. A table lists
648
659
  every model the window counted, sorted by total tokens. A model's row opens a second table of its sessions by client and session id. The
@@ -737,8 +748,8 @@ accepted without effect. What cannot be translated faithfully is refused with a
737
748
  Code then continues without them), server-side context management, code execution containers, remote MCP servers and
738
749
  deferred tool loading, whose betas `CLAUDE_CODE_DISABLE_EXPERIMENTAL_BETAS=1` keeps Claude Code from sending. Of an
739
750
  answer Claude Code gets the model's text, its tool calls, its reasoning summary as thinking, the stop reason and the
740
- token counts (input, output, cache reads); the backend's response id, its own headers and the rest of its response do
741
- not reach it.
751
+ token counts (input, output, cache reads and writes, a cache count `null` when the backend did not state it); the
752
+ backend's response id, its own headers and the rest of its response do not reach it.
742
753
 
743
754
  Reasoning effort: Claude Code sends its effort as `output_config.effort` (`low` to `max`, chosen with `/effort`,
744
755
  `--effort` or `CLAUDE_CODE_EFFORT_LEVEL`), together with adaptive thinking; Claude Code 2.1.288, the release of AGL's
@@ -2784,7 +2795,7 @@ The tabs of one browser share the sign-in without sharing its resume token, whic
2784
2795
  - **Signing in.** When one tab signs in, a tab waiting at the sign-in screen asks for a handoff. One signed-in tab answers: it asks the controller for a single-use resume token of its sign-in (`controller.auth.handoff`), and the waiting tab redeems it through `controller.auth.resume`. The token must be redeemed within 30 seconds and carries the same sign-in and expiry. A tab opened later beside a signed-in tab joins the same way. When the answering tab cannot get a token, it says so and the waiting tab stays at the sign-in screen right away; when no tab answers within 5 seconds, the waiting tab stays there too.
2785
2796
  - **Signing out.** **Sign out** in the header (`controller.auth.signout`) revokes every resume token of the sign-in and closes every connection of it with code 4401. The other tabs show that the browser signed out, and they do not rejoin until someone signs in again.
2786
2797
  - **Layout.** Each tab follows the sidebar width and whether the browser sidebar is shown; the theme already follows through local storage.
2787
- - **Upgrades.** When the controller is upgraded, one tab reloads into the new bundle and reports the outcome. The others follow it and do not race it to the reload.
2798
+ - **Upgrades.** When the controller is upgraded, one tab reloads into the new bundle and reports the outcome. The others follow it and do not race it to the reload. A tab whose release speaks another TypedSocket wire major than the upgraded controller (a tab of AGL 41, wire 8, after the upgrade to 42, wire 9) cannot reconnect to read the new version: it shows "This page does not match the running controller … Reload the page" until you reload it.
2788
2799
 
2789
2800
  The project and session in view, the conversation sidebar, and the upgrade-reload fence stay with each tab.
2790
2801
 
@@ -2805,6 +2816,7 @@ agl ticket list|get|create|update|move|comment|link|assign [options] [--json]
2805
2816
  agl feed list [--state failed] [--json] | acknowledge <row-id> --updated-at <ms> [--json]
2806
2817
  agl foreground [options]
2807
2818
  agl temp-password [--port 4097] [--ttl-hours 24]
2819
+ agl remote set|unset|secret import [--port 4097] [options]
2808
2820
  agl help
2809
2821
  agl --version
2810
2822
  ```
@@ -2824,7 +2836,7 @@ Important startup options:
2824
2836
 
2825
2837
  `settings` prints the browser capture backend and the standard project directories; `--json` includes the complete public settings, including a selected Session Intelligence model and Claude terminal routing. A plain read never updates settings. `--add-standard-dir` and `--remove-standard-dir` edit that list, which is the same list **Settings -> Projects** edits in the browser. Directories must be absolute and must exist on the controller's disk.
2826
2838
 
2827
- Runtime configuration is durable and immutable per controller port. Later management commands must use the same `--port`. The `--directory` option is transient and can register another project during a later stopped start.
2839
+ Runtime configuration is durable and immutable per controller port. Later management commands must use the same `--port`. A start never changes the public origin, RP ID or TLS mode of an initialized port and refuses to; only `agl remote set` and `agl remote unset` move a stopped controller's port (see [Remote Browser Access](#remote-browser-access)). The `--directory` option is transient and can register another project during a later stopped start.
2828
2840
 
2829
2841
  `feed` reads the sidebar's session feed and acknowledges failed rows as the local owner, as **Acknowledge and remove** does:
2830
2842
 
@@ -2838,7 +2850,7 @@ agl feed acknowledge codex:01a1504e-1f31-7123-a67a-3d4bd59be124 --updated-at 176
2838
2850
 
2839
2851
  `stop` verifies the exact package CLI, process, process group, command, port, and process-start fingerprint before signaling anything. AGL never kills processes by name.
2840
2852
 
2841
- `restart` stops the controller and starts it again on the same port. It takes no startup options: the controller comes back with the runtime configuration stored for its port (public origin, RP ID, projects root, OpenCode port and TLS mode), and with the environment of the shell that runs `restart` when it runs detached (the unit's own when it runs as `agl-controller.service`). It checks that the start would succeed before it stops anything: the start must be admitted, and a controller behind a TLS proxy (`tlsMode: proxy` in `agl status --json`) is not stopped while `AGL_TRUSTED_PROXY_SECRET` is missing or malformed in this shell, or while `agl-controller.service` is installed for its port. The secret is only checked, never shown. Sessions are not paused or continued; `upgrade` is the command that carries them across a restart.
2853
+ `restart` stops the controller and starts it again on the same port. It takes no startup options: the controller comes back with the runtime configuration stored for its port (public origin, RP ID, projects root, OpenCode port and TLS mode), and with the environment of the shell that runs `restart` when it runs detached (the unit's own when it runs as `agl-controller.service`). It checks that the start would succeed before it stops anything: the start must be admitted, and a start the installed `agl-controller.service` would refuse is refused before anything stops. A controller behind a TLS reverse proxy restarts like any other: its trusted-proxy secret is in its database. Sessions are not paused or continued; `upgrade` is the command that carries them across a restart.
2842
2854
 
2843
2855
  ### Running AGL as a systemd user unit
2844
2856
 
@@ -2851,7 +2863,7 @@ agl restart --port 4097 # move a running detached controller into the
2851
2863
 
2852
2864
  `service install` takes the persistent startup options (`--opencode-port`, `--projects-root`, `--public-origin`, `--rp-id`) and writes them into the unit's command line: the pnpm-global `agl` shim, verified to run this release, with `__serve --service --port <port>`. Because pnpm rewrites the shim for every release it installs, the unit runs whichever AGL is installed and survives upgrades. The unit runs from the home directory, after `authswitch-authority.service`, and is wanted by `default.target`, so the user manager starts AGL at login, or at boot when lingering is enabled for the user (`loginctl enable-linger`). Running it again with the same settings changes nothing, even while the unit runs. A changed definition is written only while the unit is stopped, so changing the settings is `agl stop`, then `agl service install` with the new settings, then `agl start`. It needs a systemd user manager of version 254 or later.
2853
2865
 
2854
- The unit runs only a controller on localhost. A controller behind a TLS proxy needs `AGL_TRUSTED_PROXY_SECRET`, which the unit cannot carry, so `service install` refuses `--behind-tls-proxy`, an HTTPS `--public-origin`, and a port whose stored runtime configuration is in TLS-proxy mode (it reads that configuration under start admission, from the controller's store); such a controller keeps running detached. A start that asks the installed unit for that mode, or comes from a shell holding `AGL_TRUSTED_PROXY_SECRET`, is refused the same way, and a unit-run controller that finds its stored configuration in that mode stands down with exit status 78 instead of being restarted.
2866
+ The unit runs a controller behind a TLS reverse proxy as well as one on localhost: the trusted-proxy secret is generated and sealed in the controller's database, so the unit carries none (see [Remote Browser Access](#remote-browser-access)).
2855
2867
 
2856
2868
  From then on, `start`, `stop`, `restart` and `upgrade` drive the unit for the AGL home and port it was installed for:
2857
2869
 
@@ -2861,7 +2873,7 @@ From then on, `start`, `stop`, `restart` and `upgrade` drive the unit for the AG
2861
2873
 
2862
2874
  `agl status` shows `agl-controller.service` in place of `detached` for a controller the unit runs. `agl service status [--json]` reports the unit's state, its port and AGL home, and its unit and log files. `agl service uninstall` disables the unit, stops the controller it runs, waits for the unit to stop and removes exactly the definition AGL installed; it refuses while processes it started, such as jobs, still run in the unit's control group. Start AGL detached again with `agl start`.
2863
2875
 
2864
- The unit carries `PATH` and `AGL_HOME`, and, when set, `AGL_DB_DIR`, `AGL_MONGO_DB`, `AGL_MONGO_URL`, `AGL_CODEX_EXECUTABLE`, `AGL_CLAUDE_EXECUTABLE`, `CODEX_HOME`, `CLAUDE_CONFIG_DIR`, `XDG_CONFIG_HOME`, `XDG_DATA_HOME`, `XDG_STATE_HOME`, `XDG_CACHE_HOME`, `NODE_EXTRA_CA_CERTS`, `SSL_CERT_FILE`, `SSL_CERT_DIR`, `TZ`, `HTTP_PROXY`, `HTTPS_PROXY` and `NO_PROXY`; nothing else from the installing shell reaches it. The unit file is readable by every local user, so it never holds a secret: `service install` refuses while `AGL_TRUSTED_PROXY_SECRET` is set, while `AGL_MONGO_URL`, `HTTP_PROXY` or `HTTPS_PROXY` carries credentials, and while `AGL_FORWARD_ENV` names variables the fixed set would drop. Such a controller keeps running detached.
2876
+ The unit carries `PATH` and `AGL_HOME`, and, when set, `AGL_DB_DIR`, `AGL_MONGO_DB`, `AGL_MONGO_URL`, `AGL_CODEX_EXECUTABLE`, `AGL_CLAUDE_EXECUTABLE`, `CODEX_HOME`, `CLAUDE_CONFIG_DIR`, `XDG_CONFIG_HOME`, `XDG_DATA_HOME`, `XDG_STATE_HOME`, `XDG_CACHE_HOME`, `NODE_EXTRA_CA_CERTS`, `SSL_CERT_FILE`, `SSL_CERT_DIR`, `TZ`, `HTTP_PROXY`, `HTTPS_PROXY` and `NO_PROXY`; nothing else from the installing shell reaches it. The unit file is readable by every local user, so it never holds a secret: `service install` refuses while `AGL_MONGO_URL`, `HTTP_PROXY` or `HTTPS_PROXY` carries credentials, and while `AGL_FORWARD_ENV` names variables the fixed set would drop. Such a controller keeps running detached.
2865
2877
 
2866
2878
  The unit appends the controller's errors to the same `$AGL_HOME/logs/controller-<port>.log` a detached controller writes; standard output is discarded, as it is for a detached controller.
2867
2879
 
@@ -2907,7 +2919,9 @@ The upgrade worker:
2907
2919
  - Restarts `agl-proxy.service` onto the new release once the target controller is up, when the unit is installed and running and runs the pnpm-global `agl` shim, and waits until the proxy answers as the new release and its credential launcher, run with an empty environment as a harness runs it, runs the new release too. A unit that is not installed or not running is left alone. A restart that fails does not fail the upgrade: it is logged as a warning and appended to the completion message (`message` in `--json` output).
2908
2920
  - Moves the accounts service onto the authswitch the new AGL brings, with authswitch's own `authority service stop`, `install` and `start`: the service is stopped before the package changes and started again, on the new release, when it ran before. A release that declares no `authswitch` command is refused before anything is stopped. A host without the service's unit keeps it that way, and the service's store is never touched. Stopping the service also stops the managed Codex runtimes it runs; they start again when next asked for. The log names what was stopped and started; a failed upgrade restores the previous AGL first, then the running service, and each step is recorded in the upgrade transaction, so recovering a lost worker finishes or undoes it.
2909
2921
  - Preserves its transaction across worker or controller failure.
2910
- - Reads the controller's status, prepares it and finalizes it through the controller's loopback management endpoint (an HTTP `POST` of one TypedRequest to `/management/typedrequest` on the controller's port, addressed to `127.0.0.1:<port>`), never through the browser's WebSocket, so the worker of one release finalizes the controller of the next whatever transport that release's browser speaks. `agl status` and `agl upgrade` read their own release's controller the same way. The endpoint is used only for a controller that declares it: before the controller runs, by `controllerManagementProtocolVersion` in the `package.json` of the installed release that starts it, and once it runs, by `managementProtocolVersion` in its status. A controller that declares neither, as every release before the endpoint, such as a source an upgrade recovery restores, is reached over its controller socket, which keeps serving the status read and the upgrade methods for the workers of earlier releases. Nothing is tried over one transport and then the other.
2922
+ - Reads the controller's status, prepares it and finalizes it through the controller's loopback management endpoint (an HTTP `POST` of one TypedRequest to `/management/typedrequest` on the controller's port, addressed to `127.0.0.1:<port>`), never through the browser's WebSocket, so the worker of one release finalizes the controller of the next whatever transport that release's browser speaks. `agl status` and `agl upgrade` read their own release's controller the same way. The endpoint is used only for a controller that declares it: before the controller runs, by `controllerManagementProtocolVersion` in the `package.json` of the installed release that starts it, and once it runs, by `managementProtocolVersion` in its status. A controller that declares neither, as every release before the endpoint, is refused by name and never reached over its controller socket, which since 42 serves only the browser's status read. Nothing is tried over one transport and then the other.
2923
+
2924
+ **AGL 41.0.x or older must upgrade to 41.1.x before 42.** AGL 42 manages a controller only through the loopback management endpoint, which 41.1.0 added, and its controller no longer speaks TypedSocket 8, the only way an upgrade worker of 41.0.x or older reaches the controller it starts. Run `agl upgrade` while 41.1.x is the latest release, then upgrade again. Once 42 is the latest release, upgrade a 41.0.x or older controller while it is stopped: `agl stop --port 4097` with its own release, then `agl upgrade --port 4097` and `agl start --port 4097`. AGL 42 refuses to manage an older controller: `agl status`, `stop`, `start`, `restart`, `upgrade` and `service install` say "AGL 41.0.x or older must upgrade to 41.1.x before 42" instead of reporting no controller, and name the release (`agl@41.0.3`) when its package or an upgrade transaction names it, or else call it a controller older than 41.1.0 on its port. They say so only when the process listening on the port runs an installed AGL package's controller (on Linux and macOS); any other program on the port is reported as a busy port. A recovery that restores such a release leaves it installed and its controller stopped, with the upgrade transaction open; the next `agl upgrade --port 4097`, now of that release, starts it and finishes the recovery.
2911
2925
 
2912
2926
  The cohort is every conversation with an AGL prompt that is queued or still running when the upgrade starts. AGL seals prompt admission, so no new message is accepted and no queue starts a turn, and stops each of them, as **Stop** does:
2913
2927
 
@@ -2929,15 +2943,17 @@ Upgrade coordination lives under `$AGL_HOME/upgrade`. Private logs live under `$
2929
2943
 
2930
2944
  A failure reference from the Errors dialog appears in those logs on the line the controller wrote when the failure happened, together with the operation and the cause. The journal the dialog reads it from is in memory only, so it is gone after a controller restart while the log line remains.
2931
2945
 
2932
- ### Rolling back from a later release
2946
+ ### Rolling back to 41.x
2947
+
2948
+ 41.1.0 and the later 41.x releases are the ones this release rolls back to. This release keeps a port's trusted-proxy secret sealed in the controller's database and never exports it, and `agl remote set` can store gateway sources, which 41.x cannot enforce. To roll back a port that this release serves behind a TLS reverse proxy:
2933
2949
 
2934
- A later release keeps a port's trusted-proxy secret sealed in the controller's database and never exports it, and `agl remote set` there can store gateway sources, which 41.1.x cannot enforce. To roll back a port that a later release serves behind a TLS reverse proxy:
2950
+ 1. Stop the controller and run `agl remote unset --port <port>`. It moves the port back to `http://localhost:<port>` and removes its passkey, so the next start prints a setup code. A 41.x controller refuses to start on a configuration with gateway sources, and its refusal names this command.
2951
+ 2. Roll back and start the controller. Roll back only while no upgrade is open: 41.x refuses an upgrade transaction this release created.
2952
+ 3. To serve 41.x behind the proxy again, generate a new secret and set it both on the proxy route (`X-Harness-Controller-Proxy-Secret`) and in `AGL_TRUSTED_PROXY_SECRET`, as 41.x's readme describes. 41.x fixes a port's public origin and TLS mode on its first start, so that is a port that has not been started yet.
2935
2953
 
2936
- 1. On the later release, stop the controller and run `agl remote unset --port <port>`. It moves the port back to `http://localhost:<port>` and removes its passkey, so the next start prints a setup code. A 41.1.x controller refuses to start on a configuration with gateway sources, and its refusal names this command.
2937
- 2. Roll back and start the controller.
2938
- 3. To serve 41.1.x behind the proxy again, generate a new secret and set it both on the proxy route (`X-Harness-Controller-Proxy-Secret`) and in `AGL_TRUSTED_PROXY_SECRET`, as in [Remote Browser Access](#remote-browser-access). 41.1.x fixes a port's public origin and TLS mode on its first start, so that is a port that has not been started yet.
2954
+ A recovery of AGL 42 that would roll a stalled upgrade back to a release older than 42 first checks the port's stored configuration: while it names gateway sources (`agl remote set --gateway-source`), which such a release refuses to start on and has no command to remove, it restores nothing and asks you to run `agl remote unset --port 4097` with 42, still installed, and then `agl upgrade --port 4097` again. Whether the release it would put back supports gateway sources is what that release's package declares (`controllerGatewaySourcesVersion`), as the upgrade recorded it when it started.
2939
2955
 
2940
- Audit events of types a later release wrote stay in the audit log and are pruned with the others.
2956
+ The audit events of types 41.x does not know (`remote.*`) stay in the audit log and are pruned with the others.
2941
2957
 
2942
2958
  ### Migrating From `hcon`
2943
2959
 
@@ -3044,31 +3060,86 @@ A controller that runs as `agl-controller.service` has the unit's environment in
3044
3060
 
3045
3061
  ## Remote Browser Access
3046
3062
 
3047
- Remote WebAuthn requires HTTPS. Start AGL behind a trusted TLS reverse proxy:
3063
+ Remote WebAuthn requires HTTPS, so a browser on another machine reaches AGL through a trusted TLS reverse proxy: the proxy terminates TLS for a public origin and forwards plain HTTP to the controller's port, and the controller runs in TLS-proxy mode (`tlsMode: proxy` in `agl status --json`). A browser at `http://localhost:<port>` is refused from then on: one origin per port.
3064
+
3065
+ ### Moving a port behind the proxy
3066
+
3067
+ Only a stopped controller's port moves, with `agl remote set`:
3048
3068
 
3049
3069
  ```sh
3050
- export AGL_TRUSTED_PROXY_SECRET="$(node -e "console.log(require('node:crypto').randomBytes(32).toString('base64url'))")"
3070
+ agl stop --port 4097
3071
+ agl remote set --port 4097 \
3072
+ --public-origin https://agl.example.com \
3073
+ --rp-id agl.example.com \
3074
+ --gateway-source 192.0.2.10
3075
+ agl start --port 4097 # prints the setup code for https://agl.example.com
3076
+ ```
3077
+
3078
+ - The controller keeps its id (`controller:4097`) and all of its data: projects, conversations, tickets, settings and the audit trail. Only the public origin, the WebAuthn RP ID (the origin's hostname when `--rp-id` is omitted; IP addresses and public suffixes are refused) and the gateway sources change.
3079
+ - A passkey belongs to its RP ID. When the origin or RP ID changes, the passkey is removed and every temporary password revoked, so nothing that signed in to the old origin signs in to the new one. The next `agl start` prints a fresh setup code to its terminal, never to a log: enroll the passkey at the new origin with it. Running `remote set` again with only other gateway sources keeps the passkey.
3080
+ - `--gateway-source` names an address the proxy's connections arrive from (IPv4 or IPv6, repeatable, at most 16). Without one only a reverse proxy on this host reaches the controller.
3081
+ - `agl remote unset --port 4097` moves the port back to `http://localhost:4097` (RP ID `localhost`): it removes the passkey, revokes every temporary password and forgets the trusted-proxy secret. The next start prints a setup code.
3082
+ - Both refuse while anything listens on the port, take start admission (no upgrade runs meanwhile), run as the local OS user (the trust `agl temp-password` has) and are audited as `remote.set` or `remote.unset`, attempted and then succeeded or failed, with the OS user and process and the public origin and RP ID the move goes from and to (never a secret).
3083
+ - A start never moves a port: one that asks for another `--public-origin`, `--rp-id` or TLS mode is refused and names `agl remote set`. A new port can still start behind a reverse proxy on this host directly: `agl start --public-origin https://agl.example.com --rp-id agl.example.com --behind-tls-proxy`.
3084
+
3085
+ ### The trusted-proxy secret
3051
3086
 
3052
- agl start \
3053
- --public-origin https://controller.example.com \
3054
- --rp-id controller.example.com \
3055
- --behind-tls-proxy
3087
+ The controller trusts the proxy by the secret it sends as `X-Harness-Controller-Proxy-Secret`. AGL generates it, 32 random bytes, at the first start in TLS-proxy mode, seals it with the TPM (`systemd-creds`, as the inference proxy seals its credentials) and keeps only the sealed form in its database. It is never read from the environment, written to a file or the unit, or logged. TLS-proxy mode therefore needs a TPM2 the user can use, as `agl proxy` does.
3088
+
3089
+ A rotation keeps the previous secret valid until the proxy is confirmed to send the new one, and refuses it from then on. For a reverse proxy AGL does not configure itself, choose the secret and import it into the stopped controller:
3090
+
3091
+ ```sh
3092
+ node -e "console.log(require('node:crypto').randomBytes(32).toString('base64url'))" > ~/agl-proxy-secret
3093
+ chmod 600 ~/agl-proxy-secret
3094
+ agl stop --port 4097
3095
+ agl remote secret import --port 4097 < ~/agl-proxy-secret
3096
+ agl start --port 4097
3056
3097
  ```
3057
3098
 
3058
- The proxy must:
3099
+ `secret import` reads a 32-byte base64url secret (43 characters) from a pipe or file, never from a terminal, replaces the secret and any rotation in progress, prints only its generation and is audited as `remote.secret.import`. A controller on localhost takes no secret.
3100
+
3101
+ `AGL_TRUSTED_PROXY_SECRET` is not read any more: `start`, `restart`, `foreground`, `upgrade`, `temp-password` and `service` refuse to run while it is set, naming the import. Move the secret it holds into the database and unset it:
3059
3102
 
3060
- - Remove client-supplied copies of AGL transport headers.
3061
- - Inject the configured secret as `X-Harness-Controller-Proxy-Secret`.
3103
+ ```sh
3104
+ agl stop --port 4097
3105
+ printf '%s' "$AGL_TRUSTED_PROXY_SECRET" | agl remote secret import --port 4097
3106
+ unset AGL_TRUSTED_PROXY_SECRET
3107
+ agl start --port 4097
3108
+ ```
3109
+
3110
+ ### What the proxy must do
3111
+
3112
+ - Inject the secret as `X-Harness-Controller-Proxy-Secret`, replacing any copy the client sent: a request with two copies is refused.
3062
3113
  - Set `X-Forwarded-Proto: https` on WebSocket upgrades.
3063
3114
  - Preserve the exact public Host and Origin.
3064
3115
  - Forward WebSocket upgrades.
3065
- - Restrict direct access to the backend listener.
3066
3116
 
3067
- Backend isolation is mandatory. Proxy mode binds the controller to all interfaces, while origin-less loopback CLI management remains intentionally available. Never expose the plain backend port directly.
3117
+ ### Admission
3118
+
3119
+ The controller has one listener. It binds loopback in local mode and in TLS-proxy mode without a gateway source, and every interface once a gateway source is configured (IPv6 too when one is an IPv6 address). Every HTTP request and WebSocket upgrade on it, static assets included, is admitted alike:
3120
+
3121
+ - From loopback, as before: the CLI, `agl mcp` and the upgrade worker connect without an `Origin`. A browser's upgrade carries the public origin as `Origin`, and in TLS-proxy mode `X-Forwarded-Proto: https` and the secret, since a reverse proxy on this host forwards from loopback.
3122
+ - From any other address, only a configured gateway source that sends the secret. Its upgrades also carry the public origin as `Origin` and `X-Forwarded-Proto: https`: an upgrade without an `Origin` is admitted only from loopback, so a native client sends the public origin too. Its GET and HEAD requests may come without an `Origin`, as a browser's page loads do; every other method needs the public origin as `Origin`, and no request may carry another.
3123
+
3124
+ A refused request is answered 403.
3125
+
3126
+ ### Backend isolation
3127
+
3128
+ Admission is the second line. The host firewall must let only the gateway reach the controller's port; with ufw:
3129
+
3130
+ ```sh
3131
+ sudo ufw allow proto tcp from 192.0.2.10 to any port 4097 comment 'AGL through its gateway'
3132
+ sudo ufw deny proto tcp to any port 4097 comment 'AGL only through its gateway'
3133
+ sudo ufw status verbose # the allow is listed before the deny, and no broader rule allows the port
3134
+ ```
3135
+
3136
+ The gateway source is the address the proxy's connections arrive from on this host. A router that translates addresses between the proxy and this host puts its own address there, and every host behind it then passes the source check: route without translation, or put the proxy on this host's network.
3068
3137
 
3069
3138
  ## Security Boundaries
3070
3139
 
3071
- - Local mode binds the controller to loopback only.
3140
+ - 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`.
3141
+ - 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.
3142
+ - 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.
3072
3143
  - The private OpenCode server always remains on loopback and uses a generated per-process password.
3073
3144
  - Application RPC starts only after the exact TypedSocket package-major handshake.
3074
3145
  - 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: '41.1.0',
6
+ version: '42.0.0',
7
7
  description: 'Agent Gateway Layer for OpenCode, FlexHarness, and Codex sessions'
8
8
  }
@@ -3765,14 +3765,14 @@ export const AGL_API_SURFACE: plugins.flexTypedRequest.IFlexTypedRequestSurface
3765
3765
  },
3766
3766
  "protocolVersion": {
3767
3767
  "type": "number",
3768
- "const": 46
3768
+ "const": 48
3769
3769
  },
3770
3770
  "upgradeManagementVersion": {
3771
3771
  "type": "number"
3772
3772
  },
3773
3773
  "managementProtocolVersion": {
3774
3774
  "type": "number",
3775
- "description": "The protocol of the controller's loopback management endpoint (`controllerManagementProtocolVersion`); absent from a controller older than the endpoint, which is reached over its socket."
3775
+ "description": "The protocol of the controller's loopback management endpoint (`controllerManagementProtocolVersion`); absent from a controller older than the endpoint, which this release refuses to manage."
3776
3776
  },
3777
3777
  "controllerPid": {
3778
3778
  "type": "number"
@@ -3891,7 +3891,7 @@ export const AGL_API_SURFACE: plugins.flexTypedRequest.IFlexTypedRequestSurface
3891
3891
  ],
3892
3892
  "additionalProperties": false
3893
3893
  },
3894
- "declaration": "interface IControllerStatus {\n packageName: string;\n packageVersion: string;\n protocolVersion: 46;\n upgradeManagementVersion: number;\n /**\n * The protocol of the controller's loopback management endpoint (`controllerManagementProtocolVersion`); absent\n * from a controller older than the endpoint, which is reached over its socket.\n */\n managementProtocolVersion?: number;\n controllerPid: number;\n processGroupId: number;\n processFingerprint: string;\n processMode: TControllerProcessMode;\n lifecycleState: TControllerLifecycleState;\n startedAt: number;\n setupRequired: boolean;\n /** Present when the controller runs as the systemd user unit (`agl service install`); absent for a detached or foreground one. */\n serviceUnit?: \"agl-controller.service\";\n /** The TLS mode of the runtime configuration the controller runs with; absent until it is resolved. */\n tlsMode?: TControllerTlsMode;\n upgrade?: IControllerUpgradeStatus;\n /** AGL's inference proxy, by state only; details need a signed-in owner (`controller.proxy.status.get`). */\n proxy?: { state: TControllerProxyState };\n harnesses: Array<{\n harnessId: TControllerSessionHarnessId;\n pid?: number;\n state: TControllerHarnessLifecycleState;\n healthy: boolean;\n version?: string;\n supportsLocalAttachments?: boolean;\n connectionMode?: 'local' | 'shared' | 'remote';\n diagnostic?: IControllerCodexDiagnostic;\n /** Codex only: automatic reconnection of this entry's profile to the local shared app-server. */\n rejoin?: IControllerCodexRejoinStatus;\n /**\n * Codex only, on the controller status: every connected or required profile. The entry's\n * `healthy` is then true only when each of them is, apart from a profile on an account Codex\n * cannot run on now, listed `stopped` with an `account_unavailable` diagnostic that says why;\n * its other members describe the default profile.\n */\n profiles?: IControllerCodexProfileStatus[];\n }>;\n}"
3894
+ "declaration": "interface IControllerStatus {\n packageName: string;\n packageVersion: string;\n protocolVersion: 48;\n upgradeManagementVersion: number;\n /**\n * The protocol of the controller's loopback management endpoint (`controllerManagementProtocolVersion`); absent\n * from a controller older than the endpoint, which this release refuses to manage.\n */\n managementProtocolVersion?: number;\n controllerPid: number;\n processGroupId: number;\n processFingerprint: string;\n processMode: TControllerProcessMode;\n lifecycleState: TControllerLifecycleState;\n startedAt: number;\n setupRequired: boolean;\n /** Present when the controller runs as the systemd user unit (`agl service install`); absent for a detached or foreground one. */\n serviceUnit?: \"agl-controller.service\";\n /** The TLS mode of the runtime configuration the controller runs with; absent until it is resolved. */\n tlsMode?: TControllerTlsMode;\n upgrade?: IControllerUpgradeStatus;\n /** AGL's inference proxy, by state only; details need a signed-in owner (`controller.proxy.status.get`). */\n proxy?: { state: TControllerProxyState };\n harnesses: Array<{\n harnessId: TControllerSessionHarnessId;\n pid?: number;\n state: TControllerHarnessLifecycleState;\n healthy: boolean;\n version?: string;\n supportsLocalAttachments?: boolean;\n connectionMode?: 'local' | 'shared' | 'remote';\n diagnostic?: IControllerCodexDiagnostic;\n /** Codex only: automatic reconnection of this entry's profile to the local shared app-server. */\n rejoin?: IControllerCodexRejoinStatus;\n /**\n * Codex only, on the controller status: every connected or required profile. The entry's\n * `healthy` is then true only when each of them is, apart from a profile on an account Codex\n * cannot run on now, listed `stopped` with an `account_unavailable` diagnostic that says why;\n * its other members describe the default profile.\n */\n profiles?: IControllerCodexProfileStatus[];\n }>;\n}"
3895
3895
  },
3896
3896
  {
3897
3897
  "name": "IControllerTerminalResource",