agl 40.5.1 → 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.
- package/changelog.md +10 -0
- package/dist_serve/bundle.js +1 -1
- package/dist_serve/bundle.js.map +2 -2
- package/dist_ts/00_commitinfo_data.js +1 -1
- package/dist_ts/classes.aglhome.d.ts +5 -0
- package/dist_ts/classes.aglhome.js +2 -1
- package/dist_ts/classes.authstore.js +5 -1
- package/dist_ts/classes.controller.js +11 -2
- package/dist_ts/classes.inferencegateway.d.ts +35 -1
- package/dist_ts/classes.inferencegateway.js +86 -26
- package/dist_ts/classes.inferenceservice.d.ts +4 -2
- package/dist_ts/classes.inferenceservice.js +5 -4
- package/dist_ts/classes.proxycontrol.d.ts +58 -4
- package/dist_ts/classes.proxycontrol.js +23 -44
- package/dist_ts/classes.proxycontrolclient.d.ts +15 -5
- package/dist_ts/classes.proxycontrolclient.js +67 -17
- package/dist_ts/classes.proxydaemon.d.ts +22 -3
- package/dist_ts/classes.proxydaemon.js +73 -12
- package/dist_ts/classes.proxyleaseholder.d.ts +43 -14
- package/dist_ts/classes.proxyleaseholder.js +66 -22
- package/dist_ts/classes.proxystore.d.ts +9 -0
- package/dist_ts/classes.proxystore.js +15 -7
- package/dist_ts/classes.workercallerbindings.d.ts +66 -0
- package/dist_ts/classes.workercallerbindings.js +211 -0
- package/dist_ts/classes.workercallers.d.ts +63 -2
- package/dist_ts/classes.workercallers.js +430 -65
- package/dist_ts/fleet/classes.workerlaunches.d.ts +12 -5
- package/dist_ts/fleet/classes.workerlaunches.js +25 -19
- package/dist_ts/fleet/classes.workers.d.ts +17 -0
- package/dist_ts/fleet/classes.workers.js +74 -1
- package/dist_ts/functions.inferencecli.d.ts +3 -2
- package/dist_ts/functions.inferencecli.js +67 -5
- package/dist_ts/functions.inferencecliarguments.d.ts +6 -2
- package/dist_ts/functions.inferencecliarguments.js +29 -2
- package/dist_ts/functions.inferencelaunch.d.ts +24 -0
- package/dist_ts/functions.inferencelaunch.js +42 -2
- package/dist_ts/functions.proxycontract.d.ts +11 -0
- package/dist_ts/functions.proxycontract.js +12 -1
- package/dist_ts/functions.proxysocket.d.ts +6 -0
- package/dist_ts/functions.proxysocket.js +46 -0
- package/dist_ts/functions.workerprocessproof.d.ts +6 -0
- package/dist_ts/functions.workerprocessproof.js +28 -4
- package/dist_ts_interfaces/workercallers.d.ts +43 -4
- package/package.json +1 -1
- package/readme.md +102 -13
- package/ts/00_commitinfo_data.ts +1 -1
- package/ts/classes.aglhome.ts +6 -0
- package/ts/classes.authstore.ts +4 -0
- package/ts/classes.controller.ts +10 -1
- package/ts/classes.inferencegateway.ts +104 -23
- package/ts/classes.inferenceservice.ts +6 -3
- package/ts/classes.proxycontrol.ts +76 -39
- package/ts/classes.proxycontrolclient.ts +72 -20
- package/ts/classes.proxydaemon.ts +85 -15
- package/ts/classes.proxyleaseholder.ts +84 -28
- package/ts/classes.proxystore.ts +16 -5
- package/ts/classes.workercallerbindings.ts +147 -0
- package/ts/classes.workercallers.ts +410 -59
- package/ts/fleet/classes.workerlaunches.ts +23 -15
- package/ts/fleet/classes.workers.ts +51 -1
- package/ts/functions.inferencecli.ts +61 -7
- package/ts/functions.inferencecliarguments.ts +32 -1
- package/ts/functions.inferencelaunch.ts +49 -2
- package/ts/functions.proxycontract.ts +12 -0
- package/ts/functions.proxysocket.ts +39 -0
- package/ts/functions.workerprocessproof.ts +27 -4
- package/ts_interfaces/workercallers.ts +32 -4
- package/ts_web/00_commitinfo_data.ts +1 -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
|
-
/**
|
|
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
|
/**
|