agl 40.4.0 → 40.5.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/changelog.md +33 -0
- package/dist_serve/bundle.js +2228 -2177
- package/dist_serve/bundle.js.map +2 -2
- package/dist_ts/00_commitinfo_data.js +1 -1
- package/dist_ts/aglapi/aglapisurface.document.js +2 -2
- package/dist_ts/classes.accountsactions.d.ts +11 -1
- package/dist_ts/classes.accountsactions.js +59 -2
- package/dist_ts/classes.controller.js +5 -5
- package/dist_ts/classes.flexaccountaccess.js +3 -2
- package/dist_ts/classes.harnessreleases.d.ts +14 -4
- package/dist_ts/classes.harnessreleases.js +28 -4
- package/dist_ts/classes.inferencegateway.d.ts +28 -3
- package/dist_ts/classes.inferencegateway.js +177 -61
- package/dist_ts/classes.inferenceplacement.d.ts +5 -3
- package/dist_ts/classes.inferenceplacement.js +2 -2
- package/dist_ts/classes.inferencerouter.d.ts +349 -91
- package/dist_ts/classes.inferencerouter.js +804 -297
- package/dist_ts/classes.inferenceservice.d.ts +14 -2
- package/dist_ts/classes.inferenceservice.js +53 -14
- package/dist_ts/classes.inferencespend.d.ts +339 -0
- package/dist_ts/classes.inferencespend.js +815 -0
- package/dist_ts/classes.inferenceusagecache.d.ts +8 -0
- package/dist_ts/classes.inferenceusagecache.js +9 -5
- package/dist_ts/classes.inferenceusagetap.d.ts +50 -9
- package/dist_ts/classes.inferenceusagetap.js +185 -31
- package/dist_ts/classes.proxycontrol.d.ts +3 -2
- package/dist_ts/classes.proxycontrol.js +1 -2
- package/dist_ts/classes.proxydaemon.js +3 -2
- package/dist_ts/classes.proxystore.d.ts +6 -0
- package/dist_ts/classes.proxystore.js +11 -2
- package/dist_ts/fleet/classes.claudeworkers.d.ts +5 -4
- package/dist_ts/fleet/classes.claudeworkers.js +10 -9
- package/dist_ts/functions.claudecoderelease.d.ts +12 -6
- package/dist_ts/functions.claudecoderelease.js +13 -7
- package/dist_ts/functions.inferencecli.js +12 -8
- package/dist_ts/interfaces.auth.d.ts +1 -1
- package/dist_ts/interfaces.auth.js +3 -1
- package/dist_ts/plugins.d.ts +3 -1
- package/dist_ts/plugins.js +7 -2
- package/dist_ts_authswitch/authority-apikeys.d.ts +32 -0
- package/dist_ts_authswitch/authority-apikeys.js +65 -0
- package/dist_ts_authswitch/authority-contract.d.ts +172 -33
- package/dist_ts_authswitch/authority-contract.js +54 -1
- package/dist_ts_authswitch/authority-overview.js +8 -1
- package/dist_ts_authswitch/authority-placement.d.ts +7 -2
- package/dist_ts_authswitch/authority-placement.js +10 -3
- package/dist_ts_authswitch/authority-runtime-contract.d.ts +2 -2
- package/dist_ts_authswitch/authority-spend.d.ts +103 -0
- package/dist_ts_authswitch/authority-spend.js +110 -0
- package/dist_ts_authswitch/authority-subscription.d.ts +12 -1
- package/dist_ts_authswitch/authority-subscription.js +24 -1
- package/dist_ts_authswitch/authority-usagelimit.d.ts +7 -4
- package/dist_ts_authswitch/authority-usagelimit.js +89 -39
- package/dist_ts_authswitch/authority-usagewindows.d.ts +4 -1
- package/dist_ts_authswitch/authority-usagewindows.js +41 -16
- package/dist_ts_authswitch/classes.authoritybroker.d.ts +30 -19
- package/dist_ts_authswitch/classes.authoritybroker.js +152 -61
- package/dist_ts_authswitch/classes.authoritycli.d.ts +9 -4
- package/dist_ts_authswitch/classes.authoritycli.js +99 -30
- package/dist_ts_authswitch/classes.authorityclient.d.ts +24 -7
- package/dist_ts_authswitch/classes.authorityclient.js +45 -15
- package/dist_ts_authswitch/classes.authoritydaemon.js +39 -12
- package/dist_ts_authswitch/classes.authoritydatabase.d.ts +28 -5
- package/dist_ts_authswitch/classes.authoritydatabase.js +171 -9
- package/dist_ts_authswitch/classes.authorityimport.js +2 -2
- package/dist_ts_authswitch/classes.authoritymodels.d.ts +71 -3
- package/dist_ts_authswitch/classes.authoritymodels.js +249 -20
- package/dist_ts_authswitch/classes.authorityregistry.js +4 -2
- package/dist_ts_authswitch/classes.authorityusage.d.ts +69 -7
- package/dist_ts_authswitch/classes.authorityusage.js +118 -4
- package/dist_ts_authswitch/classes.claudenative.d.ts +23 -8
- package/dist_ts_authswitch/classes.claudenative.js +49 -21
- package/dist_ts_authswitch/classes.claudesignin.d.ts +14 -2
- package/dist_ts_authswitch/classes.claudesignin.js +72 -23
- package/dist_ts_authswitch/classes.codexmanaged.d.ts +8 -0
- package/dist_ts_authswitch/classes.codexmanaged.js +33 -18
- package/dist_ts_authswitch/classes.harnessprocesses.d.ts +8 -0
- package/dist_ts_authswitch/classes.harnessprocesses.js +41 -9
- package/dist_ts_authswitch/testsupport.d.ts +24 -5
- package/dist_ts_authswitch/testsupport.js +56 -12
- package/dist_ts_authswitch/ts_migration/0011_account_api_key_fields.d.ts +12 -0
- package/dist_ts_authswitch/ts_migration/0011_account_api_key_fields.js +21 -0
- package/dist_ts_authswitch/ts_migration/index.js +3 -1
- package/dist_ts_interfaces/functions.authorityscope.d.ts +18 -7
- package/dist_ts_interfaces/functions.authorityscope.js +35 -8
- package/dist_ts_interfaces/interfaces.d.ts +1 -1
- package/dist_ts_interfaces/interfaces.js +1 -1
- package/dist_ts_interfaces/plugins.d.ts +2 -1
- package/dist_ts_interfaces/plugins.js +7 -4
- package/dist_ts_interfaces/requests.accounts.d.ts +56 -0
- package/dist_ts_interfaces/requests.accounts.js +11 -1
- package/dist_ts_interfaces/requests.d.ts +2 -2
- package/dist_ts_interfaces/requests.js +1 -1
- package/docs/authswitch.md +75 -12
- package/package.json +5 -5
- package/readme.md +199 -22
- package/ts/00_commitinfo_data.ts +1 -1
- package/ts/aglapi/aglapisurface.document.ts +2 -2
- package/ts/classes.accountsactions.ts +75 -1
- package/ts/classes.controller.ts +4 -4
- package/ts/classes.flexaccountaccess.ts +2 -1
- package/ts/classes.harnessreleases.ts +25 -4
- package/ts/classes.inferencegateway.ts +184 -64
- package/ts/classes.inferenceplacement.ts +6 -4
- package/ts/classes.inferencerouter.ts +1026 -314
- package/ts/classes.inferenceservice.ts +56 -13
- package/ts/classes.inferencespend.ts +870 -0
- package/ts/classes.inferenceusagecache.ts +16 -4
- package/ts/classes.inferenceusagetap.ts +159 -34
- package/ts/classes.proxycontrol.ts +3 -3
- package/ts/classes.proxydaemon.ts +2 -1
- package/ts/classes.proxystore.ts +11 -1
- package/ts/fleet/classes.claudeworkers.ts +9 -8
- package/ts/functions.claudecoderelease.ts +13 -6
- package/ts/functions.inferencecli.ts +11 -7
- package/ts/interfaces.auth.ts +2 -0
- package/ts/plugins.ts +7 -0
- package/ts_authswitch/authority-apikeys.ts +85 -0
- package/ts_authswitch/authority-contract.ts +201 -34
- package/ts_authswitch/authority-overview.ts +7 -0
- package/ts_authswitch/authority-placement.ts +12 -4
- package/ts_authswitch/authority-runtime-contract.ts +2 -2
- package/ts_authswitch/authority-spend.ts +168 -0
- package/ts_authswitch/authority-subscription.ts +28 -1
- package/ts_authswitch/authority-usagelimit.ts +95 -40
- package/ts_authswitch/authority-usagewindows.ts +42 -17
- package/ts_authswitch/classes.authoritybroker.ts +161 -68
- package/ts_authswitch/classes.authoritycli.ts +112 -32
- package/ts_authswitch/classes.authorityclient.ts +66 -19
- package/ts_authswitch/classes.authoritydaemon.ts +43 -13
- package/ts_authswitch/classes.authoritydatabase.ts +178 -8
- package/ts_authswitch/classes.authorityimport.ts +1 -1
- package/ts_authswitch/classes.authoritymodels.ts +165 -19
- package/ts_authswitch/classes.authorityregistry.ts +3 -0
- package/ts_authswitch/classes.authorityusage.ts +171 -10
- package/ts_authswitch/classes.claudenative.ts +51 -22
- package/ts_authswitch/classes.claudesignin.ts +74 -24
- package/ts_authswitch/classes.codexmanaged.ts +30 -16
- package/ts_authswitch/classes.harnessprocesses.ts +39 -8
- package/ts_authswitch/native-contracts.md +82 -21
- package/ts_authswitch/readme.md +1 -1
- package/ts_authswitch/testsupport.ts +58 -11
- package/ts_authswitch/ts_migration/0011_account_api_key_fields.ts +20 -0
- package/ts_authswitch/ts_migration/index.ts +2 -0
- package/ts_interfaces/functions.authorityscope.ts +43 -8
- package/ts_interfaces/interfaces.ts +1 -1
- package/ts_interfaces/plugins.ts +6 -3
- package/ts_interfaces/requests.accounts.ts +48 -0
- package/ts_interfaces/requests.ts +4 -0
- package/ts_web/00_commitinfo_data.ts +1 -1
- package/ts_web/accounts.plugins.ts +7 -1
- package/ts_web/accounts.templates.ts +20 -11
- package/ts_web/classes.accountsreadmodel.ts +326 -71
- package/ts_web/elements.accounts.ts +219 -20
- package/ts_web/elements.codexconnections.ts +3 -1
- package/ts_web/plugins.ts +4 -2
|
@@ -1,4 +1,6 @@
|
|
|
1
1
|
import * as plugins from './plugins.js';
|
|
2
|
+
import { type IAuthSwitchSpendAnswer } from './authority-contract.js';
|
|
3
|
+
import { type IAuthSwitchSpendReading } from './authority-spend.js';
|
|
2
4
|
import { type IStoredAuthorityAccount, type IStoredAuthorityBinding, type IStoredAuthorityClaudeHandoff, type IStoredAuthorityClaudeSwitch, type IStoredAuthorityClaudeRepair, type IStoredAuthorityClaudeRelease, type IStoredAuthorityClaudeHome, type IStoredAuthorityClaudeContainerHome, type IStoredAuthorityNativeIdentity, type IStoredAuthorityNativePair, type TStoredClaudeMoveOutcome, type IStoredAuthorityCodexHandoff, type IStoredAuthorityCodexHome, type IStoredAuthorityCodexHostHome, type IStoredAuthorityEnrollment, type IStoredAuthorityEvent, type IStoredAuthorityGrant, type IStoredAuthorityHandoff, type IStoredAuthorityDeviceOperation, type IStoredAuthorityMeta, type IStoredAuthorityMigrationLedger, type IStoredAuthorityOperation, type IStoredAuthorityPreuseOperation } from './classes.authoritymodels.js';
|
|
3
5
|
import { type IAuthSwitchStoredUsage, type IAuthSwitchStoredUsageEstimate, type IAuthSwitchUsageContext } from './classes.authorityusage.js';
|
|
4
6
|
export interface IAuthSwitchAuthorityDatabaseOptions {
|
|
@@ -125,15 +127,18 @@ export type TClaudeReleaseStep = {
|
|
|
125
127
|
} | {
|
|
126
128
|
step: 'quarantine';
|
|
127
129
|
};
|
|
130
|
+
/** The purposes of a login a runtime binds: a ChatGPT login, a Claude login, or an Anthropic or OpenAI API key. */
|
|
131
|
+
export type TAuthSwitchBindPurpose = 'openai_managed' | 'claude_host_native' | 'anthropic_api_key' | 'openai_api_key';
|
|
132
|
+
export declare const authSwitchBindPurposes: readonly TAuthSwitchBindPurpose[];
|
|
128
133
|
/**
|
|
129
134
|
* The purpose a runtime bind of this login is accepted under, as far as the stored records decide it, or `null`:
|
|
130
135
|
* the account is not removed, and the login is its selected, ready, daemon-held login of the account's own provider
|
|
131
|
-
* -- its ChatGPT login (`openai_managed`), its Claude login (`claude_host_native`) or its Anthropic API key
|
|
132
|
-
* (`anthropic_api_key`). A Claude login further needs a verified import receipt
|
|
133
|
-
* the daemon's Claude renewer. The authority page's `bindableGrantIds` and the
|
|
134
|
-
* login published as bindable is one a bind accepts.
|
|
136
|
+
* -- its ChatGPT login (`openai_managed`), its Claude login (`claude_host_native`) or its Anthropic or OpenAI API key
|
|
137
|
+
* (`anthropic_api_key`, `openai_api_key`). A Claude login further needs a verified import receipt
|
|
138
|
+
* (`hasVerifiedClaudeGrantReceipt`) and the daemon's Claude renewer. The authority page's `bindableGrantIds` and the
|
|
139
|
+
* bind itself both decide by this, so a login published as bindable is one a bind accepts.
|
|
135
140
|
*/
|
|
136
|
-
export declare const authorityBindPurpose: (account: IStoredAuthorityAccount, grant: IStoredAuthorityGrant) =>
|
|
141
|
+
export declare const authorityBindPurpose: (account: IStoredAuthorityAccount, grant: IStoredAuthorityGrant) => TAuthSwitchBindPurpose | null;
|
|
137
142
|
/** Separate account, grant, binding and journal records; the only global record is a revision counter. */
|
|
138
143
|
export declare class AuthSwitchAuthorityDatabase {
|
|
139
144
|
private readonly options;
|
|
@@ -248,6 +253,24 @@ export declare class AuthSwitchAuthorityDatabase {
|
|
|
248
253
|
* reader of the snapshot follows.
|
|
249
254
|
*/
|
|
250
255
|
writeUsageEstimate(next: IAuthSwitchStoredUsageEstimate): Promise<boolean>;
|
|
256
|
+
/**
|
|
257
|
+
* An API key's spend in the month `nowArg` falls in, with its account's spend limit as it stands. Refused
|
|
258
|
+
* (`login_unavailable`) for any login but an API key of its account.
|
|
259
|
+
*/
|
|
260
|
+
readSpend(accountId: string, loginId: string, nowArg: number): Promise<IAuthSwitchSpendReading>;
|
|
261
|
+
/**
|
|
262
|
+
* Records a spend report of an API key's login in one transaction: each answer's entry, the totals of the months they
|
|
263
|
+
* count in, and an account event when the report changed whether the key is at its limit or began the month's spend,
|
|
264
|
+
* so a reader of the snapshot reads the key's usage again. An entry recorded already with the same content is no
|
|
265
|
+
* change; one with other content refuses the whole report, naming the answer. An answer of a month before the previous
|
|
266
|
+
* one counts nowhere: only the current and the previous month are kept, and entries and totals of earlier months are
|
|
267
|
+
* deleted here, a bounded number per report. A removed key's spend is recorded too, so its account keeps the month's
|
|
268
|
+
* spend if the key comes back. Answers `changed` with the reading of the month `nowArg` falls in.
|
|
269
|
+
*/
|
|
270
|
+
recordSpend(accountId: string, loginId: string, answers: readonly IAuthSwitchSpendAnswer[], nowArg: number): Promise<{
|
|
271
|
+
reading: IAuthSwitchSpendReading;
|
|
272
|
+
changed: boolean;
|
|
273
|
+
}>;
|
|
251
274
|
/** Delete one login's usage estimate, if one is stored. */
|
|
252
275
|
deleteUsageEstimate(accountId: string, loginId: string): Promise<void>;
|
|
253
276
|
/** Publish one credential-free usage result only if its authority and predecessor still match. */
|