agl 40.5.0 → 40.6.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 (95) hide show
  1. package/changelog.md +16 -0
  2. package/dist_serve/bundle.js +598 -598
  3. package/dist_serve/bundle.js.map +2 -2
  4. package/dist_ts/00_commitinfo_data.js +1 -1
  5. package/dist_ts/aglapi/aglapisurface.document.js +2 -2
  6. package/dist_ts/classes.aglhome.d.ts +5 -0
  7. package/dist_ts/classes.aglhome.js +2 -1
  8. package/dist_ts/classes.authstore.js +5 -1
  9. package/dist_ts/classes.controller.js +11 -2
  10. package/dist_ts/classes.inferencegateway.d.ts +35 -1
  11. package/dist_ts/classes.inferencegateway.js +86 -26
  12. package/dist_ts/classes.inferenceservice.d.ts +4 -2
  13. package/dist_ts/classes.inferenceservice.js +5 -4
  14. package/dist_ts/classes.proxycontrol.d.ts +58 -4
  15. package/dist_ts/classes.proxycontrol.js +23 -44
  16. package/dist_ts/classes.proxycontrolclient.d.ts +15 -5
  17. package/dist_ts/classes.proxycontrolclient.js +67 -17
  18. package/dist_ts/classes.proxydaemon.d.ts +22 -3
  19. package/dist_ts/classes.proxydaemon.js +73 -12
  20. package/dist_ts/classes.proxyleaseholder.d.ts +43 -14
  21. package/dist_ts/classes.proxyleaseholder.js +66 -22
  22. package/dist_ts/classes.proxystore.d.ts +9 -0
  23. package/dist_ts/classes.proxystore.js +15 -7
  24. package/dist_ts/classes.workercallerbindings.d.ts +66 -0
  25. package/dist_ts/classes.workercallerbindings.js +211 -0
  26. package/dist_ts/classes.workercallers.d.ts +63 -2
  27. package/dist_ts/classes.workercallers.js +430 -65
  28. package/dist_ts/fleet/classes.workerlaunches.d.ts +12 -5
  29. package/dist_ts/fleet/classes.workerlaunches.js +25 -19
  30. package/dist_ts/fleet/classes.workers.d.ts +17 -0
  31. package/dist_ts/fleet/classes.workers.js +74 -1
  32. package/dist_ts/functions.inferencecli.d.ts +3 -2
  33. package/dist_ts/functions.inferencecli.js +67 -5
  34. package/dist_ts/functions.inferencecliarguments.d.ts +6 -2
  35. package/dist_ts/functions.inferencecliarguments.js +29 -2
  36. package/dist_ts/functions.inferencelaunch.d.ts +24 -0
  37. package/dist_ts/functions.inferencelaunch.js +42 -2
  38. package/dist_ts/functions.proxycontract.d.ts +11 -0
  39. package/dist_ts/functions.proxycontract.js +12 -1
  40. package/dist_ts/functions.proxysocket.d.ts +6 -0
  41. package/dist_ts/functions.proxysocket.js +46 -0
  42. package/dist_ts/functions.workerprocessproof.d.ts +6 -0
  43. package/dist_ts/functions.workerprocessproof.js +28 -4
  44. package/dist_ts_authswitch/authority-contract.d.ts +30 -5
  45. package/dist_ts_authswitch/authority-contract.js +7 -1
  46. package/dist_ts_authswitch/classes.authoritycli.js +6 -2
  47. package/dist_ts_authswitch/classes.authorityclient.js +15 -5
  48. package/dist_ts_authswitch/classes.claudenative.d.ts +7 -1
  49. package/dist_ts_authswitch/classes.claudenative.js +21 -6
  50. package/dist_ts_authswitch/classes.claudesignin.d.ts +14 -2
  51. package/dist_ts_authswitch/classes.claudesignin.js +68 -22
  52. package/dist_ts_authswitch/classes.codexmanaged.d.ts +8 -0
  53. package/dist_ts_authswitch/classes.codexmanaged.js +33 -18
  54. package/dist_ts_authswitch/classes.harnessprocesses.d.ts +8 -0
  55. package/dist_ts_authswitch/classes.harnessprocesses.js +41 -9
  56. package/dist_ts_interfaces/interfaces.d.ts +1 -1
  57. package/dist_ts_interfaces/interfaces.js +1 -1
  58. package/dist_ts_interfaces/workercallers.d.ts +43 -4
  59. package/package.json +1 -1
  60. package/readme.md +103 -14
  61. package/ts/00_commitinfo_data.ts +1 -1
  62. package/ts/aglapi/aglapisurface.document.ts +2 -2
  63. package/ts/classes.aglhome.ts +6 -0
  64. package/ts/classes.authstore.ts +4 -0
  65. package/ts/classes.controller.ts +10 -1
  66. package/ts/classes.inferencegateway.ts +104 -23
  67. package/ts/classes.inferenceservice.ts +6 -3
  68. package/ts/classes.proxycontrol.ts +76 -39
  69. package/ts/classes.proxycontrolclient.ts +72 -20
  70. package/ts/classes.proxydaemon.ts +85 -15
  71. package/ts/classes.proxyleaseholder.ts +84 -28
  72. package/ts/classes.proxystore.ts +16 -5
  73. package/ts/classes.workercallerbindings.ts +147 -0
  74. package/ts/classes.workercallers.ts +410 -59
  75. package/ts/fleet/classes.workerlaunches.ts +23 -15
  76. package/ts/fleet/classes.workers.ts +51 -1
  77. package/ts/functions.inferencecli.ts +61 -7
  78. package/ts/functions.inferencecliarguments.ts +32 -1
  79. package/ts/functions.inferencelaunch.ts +49 -2
  80. package/ts/functions.proxycontract.ts +12 -0
  81. package/ts/functions.proxysocket.ts +39 -0
  82. package/ts/functions.workerprocessproof.ts +27 -4
  83. package/ts_authswitch/authority-contract.ts +34 -5
  84. package/ts_authswitch/classes.authoritycli.ts +5 -1
  85. package/ts_authswitch/classes.authorityclient.ts +25 -9
  86. package/ts_authswitch/classes.claudenative.ts +23 -7
  87. package/ts_authswitch/classes.claudesignin.ts +70 -23
  88. package/ts_authswitch/classes.codexmanaged.ts +30 -16
  89. package/ts_authswitch/classes.harnessprocesses.ts +39 -8
  90. package/ts_authswitch/native-contracts.md +1 -1
  91. package/ts_interfaces/interfaces.ts +1 -1
  92. package/ts_interfaces/workercallers.ts +32 -4
  93. package/ts_web/00_commitinfo_data.ts +1 -1
  94. package/ts_web/accounts.plugins.ts +5 -1
  95. package/ts_web/classes.accountsreadmodel.ts +4 -1
@@ -3,6 +3,11 @@ import { InferenceRouter, type IInferenceRoutingPolicy, type TInferencePaymentCa
3
3
  import { type IInferenceAffinityStore } from './classes.inferenceaffinity.js';
4
4
  import type { IInferencePlacementJournal, TInferencePlacementReason } from './classes.inferenceplacement.js';
5
5
  import { type IInferenceUsageLedger } from './classes.inferenceusage.js';
6
+ /**
7
+ * Where a credential is accepted: the loopback listener, which every process on the host can reach, or the confined
8
+ * listener, a Unix socket only the containers it is mounted into have. Each credential is accepted on its own route alone.
9
+ */
10
+ export type TInferenceGatewayRoute = 'loopback' | 'confined';
6
11
  /**
7
12
  * Requests in flight: per session, so one runaway conversation cannot starve the others; per client credential,
8
13
  * which every session of one harness shares; and in all.
@@ -43,6 +48,13 @@ export interface IInferenceGatewayOptions {
43
48
  * and translated Messages answers alike. It holds no prompt, answer or credential.
44
49
  */
45
50
  usageLedger: IInferenceUsageLedger;
51
+ /**
52
+ * The confined listener's Unix socket, bound beside the loopback port and made this user's alone (0600, in a private
53
+ * directory that holds nothing else). It accepts confined credentials alone and serves them the Claude pool's three
54
+ * endpoints Claude Code uses (`confinedEndpoints`), exactly as the loopback listener serves them; unset, the gateway has
55
+ * no confined listener and admits no confined credential.
56
+ */
57
+ confinedSocketPath?: string;
46
58
  }
47
59
  /** A placement the journal could not record, as the proxy reports it: no session id, prompt or account id. */
48
60
  export interface IInferenceGatewayPlacementFailure {
@@ -93,6 +105,11 @@ export interface IInferenceGatewayClientOptions {
93
105
  * sessions are its name's. Sessions are kept per pool (see `inferenceSessionKey`).
94
106
  */
95
107
  sessionScope?: string;
108
+ /**
109
+ * Where the credential is accepted; `loopback` when unset. A confined credential is a lease of the Claude pool, accepted
110
+ * on the confined listener alone.
111
+ */
112
+ route?: TInferenceGatewayRoute;
96
113
  }
97
114
  /** A credential the gateway admits, known to it by its digest alone. */
98
115
  export interface IInferenceGatewayGrant {
@@ -112,6 +129,8 @@ export interface IInferenceGatewayRestoredLease {
112
129
  digest: string;
113
130
  /** The lease's `sessionScope`; see `IInferenceGatewayClientOptions`. */
114
131
  sessionScope?: string;
132
+ /** The lease's `route`; see `IInferenceGatewayClientOptions`. */
133
+ route?: TInferenceGatewayRoute;
115
134
  }
116
135
  /** Codex's Responses, Messages answered by a ChatGPT pool, or Claude Code's own Messages sent to a Claude pool. */
117
136
  type TProtocol = 'responses' | 'messages' | 'claude';
@@ -140,7 +159,10 @@ export declare const inferencePaymentCause: (providerArg: TInferenceProvider, cr
140
159
  * Claude Code and Flex, OpenAI's serve Responses requests.
141
160
  */
142
161
  export declare const assertInferenceRoutingPolicy: (policyArg: IInferenceRoutingPolicy) => void;
143
- /** Authenticated, loopback-only Responses and Messages endpoints with bounded, cancelable streaming. */
162
+ /**
163
+ * Authenticated Responses and Messages endpoints with bounded, cancelable streaming, on a loopback listener and, for
164
+ * confined credentials, a Unix socket that serves the Claude pool alone.
165
+ */
144
166
  export declare class InferenceGateway {
145
167
  private readonly options;
146
168
  private readonly clients;
@@ -155,6 +177,7 @@ export declare class InferenceGateway {
155
177
  private inFlight;
156
178
  private readonly limits;
157
179
  private server?;
180
+ private confinedServer?;
158
181
  private host;
159
182
  private startTask?;
160
183
  private stopTask?;
@@ -177,7 +200,18 @@ export declare class InferenceGateway {
177
200
  restore(policyArg: IInferenceRoutingPolicy, leaseArg: IInferenceGatewayRestoredLease): Promise<IInferenceGatewayGrant>;
178
201
  private admit;
179
202
  stop(): Promise<void>;
203
+ /**
204
+ * Binds the loopback listener, then the confined one when the gateway has its socket. A stop that comes meanwhile
205
+ * closes whatever was bound.
206
+ */
180
207
  private start;
208
+ /** One listener: the loopback port or the confined socket, each with the same bounds and handling. */
209
+ private createServer;
210
+ /**
211
+ * The client a request's credential names, among those accepted on the listener it came in on. A loopback request must
212
+ * name the listener's exact host; on the confined socket the host is irrelevant, nothing but a mounted container
213
+ * reaches it. Neither takes a browser's request. A credential of the other listener is refused like an unknown one.
214
+ */
181
215
  private authenticate;
182
216
  private handle;
183
217
  /**