@cortexkit/opencode-antigravity-auth 3.0.28 → 3.0.30
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/dist/cli.js +689 -183
- package/dist/cli.js.map +4 -4
- package/dist/cli.meta.json +131 -68
- package/dist/index.js +844 -199
- package/dist/index.js.map +4 -4
- package/dist/index.meta.json +173 -76
- package/dist/server.js +855 -213
- package/dist/server.js.map +4 -4
- package/dist/server.meta.json +1 -1
- package/dist/src/cli.d.ts +1 -0
- package/dist/src/cli.d.ts.map +1 -1
- package/dist/src/cli.js +22 -2
- package/dist/src/cli.js.map +1 -1
- package/dist/src/common-auth-embedded/claustrum/consumer.d.ts +12 -0
- package/dist/src/common-auth-embedded/claustrum/consumer.js +36 -0
- package/dist/src/common-auth-embedded/claustrum/custody.d.ts +16 -4
- package/dist/src/common-auth-embedded/claustrum/custody.js +74 -9
- package/dist/src/common-auth-embedded/claustrum/hub.d.ts +3 -2
- package/dist/src/common-auth-embedded/claustrum/hub.js +8 -0
- package/dist/src/common-auth-embedded/claustrum/index.d.ts +1 -0
- package/dist/src/common-auth-embedded/claustrum/roster.d.ts +2 -0
- package/dist/src/common-auth-embedded/claustrum/roster.js +2 -0
- package/dist/src/common-auth-embedded/claustrum/usage.d.ts +41 -0
- package/dist/src/common-auth-embedded/claustrum/usage.js +145 -0
- package/dist/src/common-auth-embedded/commands/builtins.d.ts +5 -0
- package/dist/src/common-auth-embedded/commands/builtins.js +38 -0
- package/dist/src/common-auth-embedded/fs/private-files.d.ts +5 -0
- package/dist/src/common-auth-embedded/fs/private-files.js +7 -0
- package/dist/src/common-auth-embedded/fs/refresh-file-lock.js +142 -47
- package/dist/src/common-auth-embedded/fs/with-lock.js +2 -5
- package/dist/src/common-auth-embedded/limits/activity.d.ts +26 -0
- package/dist/src/common-auth-embedded/limits/axes.d.ts +63 -0
- package/dist/src/common-auth-embedded/limits/decide.d.ts +141 -0
- package/dist/src/common-auth-embedded/limits/duration.d.ts +8 -0
- package/dist/src/common-auth-embedded/limits/families.d.ts +57 -0
- package/dist/src/common-auth-embedded/limits/marker.d.ts +64 -0
- package/dist/src/common-auth-embedded/limits/request-history.d.ts +77 -0
- package/dist/src/common-auth-embedded/limits/scope.d.ts +12 -0
- package/dist/src/common-auth-embedded/limits/signal.d.ts +41 -0
- package/dist/src/common-auth-embedded/limits/terminal.d.ts +52 -0
- package/dist/src/common-auth-embedded/limits/wake.d.ts +21 -0
- package/dist/src/common-auth-embedded/limits/wording.d.ts +25 -0
- package/dist/src/common-auth-embedded/opencode2/index.d.ts +1 -1
- package/dist/src/common-auth-embedded/opencode2/install.d.ts +2 -2
- package/dist/src/common-auth-embedded/opencode2/install.js +161 -18
- package/dist/src/common-auth-embedded/opencode2/types.d.ts +95 -9
- package/dist/src/common-auth-embedded/routing/admission.d.ts +7 -2
- package/dist/src/common-auth-embedded/routing/admission.js +17 -7
- package/dist/src/common-auth-embedded/routing-accessor/handle.js +10 -0
- package/dist/src/common-auth-embedded/routing-accessor/index.d.ts +13 -3
- package/dist/src/common-auth-embedded/routing-accessor/index.js +11 -10
- package/dist/src/common-auth-embedded/rpc/port-file.d.ts +12 -3
- package/dist/src/common-auth-embedded/rpc/port-file.js +46 -4
- package/dist/src/common-auth-embedded/source-output.json +254 -118
- package/dist/src/common-auth-embedded/store/attribution.js +3 -2
- package/dist/src/common-auth-embedded/store/errors.d.ts +1 -1
- package/dist/src/common-auth-embedded/store/hooks.d.ts +5 -1
- package/dist/src/common-auth-embedded/store/hooks.js +20 -5
- package/dist/src/common-auth-embedded/store/index.d.ts +1 -0
- package/dist/src/common-auth-embedded/store/limits-namespace.d.ts +7 -0
- package/dist/src/common-auth-embedded/store/limits-namespace.js +34 -0
- package/dist/src/common-auth-embedded/store/pool.d.ts +10 -1
- package/dist/src/common-auth-embedded/store/pool.js +2 -0
- package/dist/src/common-auth-embedded/store/provider-state.js +5 -5
- package/dist/src/common-auth-embedded/store/refresh.js +1 -1
- package/dist/src/common-auth-embedded/store/schema.js +9 -4
- package/dist/src/common-auth-embedded/store/settings.d.ts +2 -0
- package/dist/src/common-auth-embedded/store/settings.js +11 -4
- package/dist/src/plugin/__fixtures__/verified-store.js +2 -2
- package/dist/src/plugin/shared/request-services.d.ts +14 -18
- package/dist/src/plugin/shared/request-services.d.ts.map +1 -1
- package/dist/src/plugin/shared/request-services.js +127 -7
- package/dist/src/plugin/shared/request-services.js.map +1 -1
- package/dist/src/runtime-layout.d.ts +9 -2
- package/dist/src/runtime-layout.d.ts.map +1 -1
- package/dist/src/runtime-layout.js +8 -8
- package/dist/src/runtime-layout.js.map +1 -1
- package/dist/src/setup.d.ts.map +1 -1
- package/dist/src/setup.js +29 -40
- package/dist/src/setup.js.map +1 -1
- package/dist/tui-build-map.json +9 -9
- package/dist/tui-ga-build-map.json +1 -1
- package/dist/types/src/cli.d.ts +1 -0
- package/dist/types/src/cli.d.ts.map +1 -1
- package/dist/types/src/common-auth-embedded/claustrum/consumer.d.ts +12 -0
- package/dist/types/src/common-auth-embedded/claustrum/custody.d.ts +16 -4
- package/dist/types/src/common-auth-embedded/claustrum/hub.d.ts +3 -2
- package/dist/types/src/common-auth-embedded/claustrum/index.d.ts +1 -0
- package/dist/types/src/common-auth-embedded/claustrum/roster.d.ts +2 -0
- package/dist/types/src/common-auth-embedded/claustrum/usage.d.ts +41 -0
- package/dist/types/src/common-auth-embedded/commands/builtins.d.ts +5 -0
- package/dist/types/src/common-auth-embedded/limits/activity.d.ts +26 -0
- package/dist/types/src/common-auth-embedded/limits/axes.d.ts +63 -0
- package/dist/types/src/common-auth-embedded/limits/decide.d.ts +141 -0
- package/dist/types/src/common-auth-embedded/limits/duration.d.ts +8 -0
- package/dist/types/src/common-auth-embedded/limits/families.d.ts +57 -0
- package/dist/types/src/common-auth-embedded/limits/marker.d.ts +64 -0
- package/dist/types/src/common-auth-embedded/limits/request-history.d.ts +77 -0
- package/dist/types/src/common-auth-embedded/limits/scope.d.ts +12 -0
- package/dist/types/src/common-auth-embedded/limits/signal.d.ts +41 -0
- package/dist/types/src/common-auth-embedded/limits/terminal.d.ts +52 -0
- package/dist/types/src/common-auth-embedded/limits/wake.d.ts +21 -0
- package/dist/types/src/common-auth-embedded/limits/wording.d.ts +25 -0
- package/dist/types/src/common-auth-embedded/opencode2/index.d.ts +1 -1
- package/dist/types/src/common-auth-embedded/opencode2/install.d.ts +2 -2
- package/dist/types/src/common-auth-embedded/opencode2/types.d.ts +95 -9
- package/dist/types/src/common-auth-embedded/routing/admission.d.ts +7 -2
- package/dist/types/src/common-auth-embedded/routing-accessor/index.d.ts +13 -3
- package/dist/types/src/common-auth-embedded/store/errors.d.ts +1 -1
- package/dist/types/src/common-auth-embedded/store/hooks.d.ts +5 -1
- package/dist/types/src/common-auth-embedded/store/index.d.ts +1 -0
- package/dist/types/src/common-auth-embedded/store/limits-namespace.d.ts +7 -0
- package/dist/types/src/common-auth-embedded/store/pool.d.ts +10 -1
- package/dist/types/src/common-auth-embedded/store/settings.d.ts +2 -0
- package/dist/types/src/plugin/shared/request-services.d.ts +14 -18
- package/dist/types/src/plugin/shared/request-services.d.ts.map +1 -1
- package/dist/types/src/runtime-layout.d.ts +9 -2
- package/dist/types/src/runtime-layout.d.ts.map +1 -1
- package/dist/types/src/setup.d.ts.map +1 -1
- package/package.json +2 -2
- package/src/common-auth-embedded/claustrum/consumer.d.ts +12 -0
- package/src/common-auth-embedded/claustrum/consumer.js +36 -0
- package/src/common-auth-embedded/claustrum/custody.d.ts +16 -4
- package/src/common-auth-embedded/claustrum/custody.js +74 -9
- package/src/common-auth-embedded/claustrum/hub.d.ts +3 -2
- package/src/common-auth-embedded/claustrum/hub.js +8 -0
- package/src/common-auth-embedded/claustrum/index.d.ts +1 -0
- package/src/common-auth-embedded/claustrum/roster.d.ts +2 -0
- package/src/common-auth-embedded/claustrum/roster.js +2 -0
- package/src/common-auth-embedded/claustrum/usage.d.ts +41 -0
- package/src/common-auth-embedded/claustrum/usage.js +145 -0
- package/src/common-auth-embedded/commands/builtins.d.ts +5 -0
- package/src/common-auth-embedded/commands/builtins.js +38 -0
- package/src/common-auth-embedded/fs/private-files.d.ts +5 -0
- package/src/common-auth-embedded/fs/private-files.js +7 -0
- package/src/common-auth-embedded/fs/refresh-file-lock.js +142 -47
- package/src/common-auth-embedded/fs/with-lock.js +2 -5
- package/src/common-auth-embedded/limits/activity.d.ts +26 -0
- package/src/common-auth-embedded/limits/axes.d.ts +63 -0
- package/src/common-auth-embedded/limits/decide.d.ts +141 -0
- package/src/common-auth-embedded/limits/duration.d.ts +8 -0
- package/src/common-auth-embedded/limits/families.d.ts +57 -0
- package/src/common-auth-embedded/limits/marker.d.ts +64 -0
- package/src/common-auth-embedded/limits/request-history.d.ts +77 -0
- package/src/common-auth-embedded/limits/scope.d.ts +12 -0
- package/src/common-auth-embedded/limits/signal.d.ts +41 -0
- package/src/common-auth-embedded/limits/terminal.d.ts +52 -0
- package/src/common-auth-embedded/limits/wake.d.ts +21 -0
- package/src/common-auth-embedded/limits/wording.d.ts +25 -0
- package/src/common-auth-embedded/opencode2/index.d.ts +1 -1
- package/src/common-auth-embedded/opencode2/install.d.ts +2 -2
- package/src/common-auth-embedded/opencode2/install.js +161 -18
- package/src/common-auth-embedded/opencode2/types.d.ts +95 -9
- package/src/common-auth-embedded/routing/admission.d.ts +7 -2
- package/src/common-auth-embedded/routing/admission.js +17 -7
- package/src/common-auth-embedded/routing-accessor/handle.js +10 -0
- package/src/common-auth-embedded/routing-accessor/index.d.ts +13 -3
- package/src/common-auth-embedded/routing-accessor/index.js +11 -10
- package/src/common-auth-embedded/rpc/port-file.d.ts +12 -3
- package/src/common-auth-embedded/rpc/port-file.js +46 -4
- package/src/common-auth-embedded/source-output.json +254 -118
- package/src/common-auth-embedded/store/attribution.js +3 -2
- package/src/common-auth-embedded/store/errors.d.ts +1 -1
- package/src/common-auth-embedded/store/hooks.d.ts +5 -1
- package/src/common-auth-embedded/store/hooks.js +20 -5
- package/src/common-auth-embedded/store/index.d.ts +1 -0
- package/src/common-auth-embedded/store/limits-namespace.d.ts +7 -0
- package/src/common-auth-embedded/store/limits-namespace.js +34 -0
- package/src/common-auth-embedded/store/pool.d.ts +10 -1
- package/src/common-auth-embedded/store/pool.js +2 -0
- package/src/common-auth-embedded/store/provider-state.js +5 -5
- package/src/common-auth-embedded/store/refresh.js +1 -1
- package/src/common-auth-embedded/store/schema.js +9 -4
- package/src/common-auth-embedded/store/settings.d.ts +2 -0
- package/src/common-auth-embedded/store/settings.js +11 -4
- package/src/tui-compiled/common-auth-embedded/fs/private-files.js +7 -0
- package/src/tui-compiled/common-auth-embedded/rpc/port-file.js +46 -4
- package/src/tui-raw/common-auth-embedded/fs/private-files.js +7 -0
- package/src/tui-raw/common-auth-embedded/rpc/port-file.js +46 -4
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import type { StoredCredential } from './schema.js';
|
|
2
2
|
/** Every library operation that can fail, as named in the failure value. */
|
|
3
|
-
export type PoolOperation = 'initialize' | 'add' | 'replace' | 'rotate' | 'disable' | 'enable' | 'remove' | 'reorder' | 'updateSettings' | 'recordIdentity' | 'updateProviderState' | 'refresh' | 'pull' | 'publishRoster';
|
|
3
|
+
export type PoolOperation = 'initialize' | 'add' | 'replace' | 'rotate' | 'disable' | 'enable' | 'remove' | 'reorder' | 'updateSettings' | 'updateLimitsNamespace' | 'recordIdentity' | 'updateProviderState' | 'refresh' | 'pull' | 'publishRoster';
|
|
4
4
|
/**
|
|
5
5
|
* How far an operation got before it failed.
|
|
6
6
|
*
|
|
@@ -1,7 +1,11 @@
|
|
|
1
1
|
import { type PoolOperation } from './errors.js';
|
|
2
2
|
/** Refuses a row operation or refresh called from inside a hook. */
|
|
3
3
|
export declare function assertNotInsideHook(operation: PoolOperation): void;
|
|
4
|
-
|
|
4
|
+
/** Namespace writes need only the store locks, not the row lock a hook may retain. */
|
|
5
|
+
export declare function assertLimitsWriteAllowed(): void;
|
|
6
|
+
/** Codecs may run under store locks even when no asynchronous hook is active. */
|
|
7
|
+
export declare function runInsideCodec<T>(fn: () => T): T;
|
|
8
|
+
export declare function runInsideHook<T>(operation: PoolOperation, fn: () => Promise<T> | T, storeLocksReleased?: boolean): Promise<T>;
|
|
5
9
|
export interface PoolLogger {
|
|
6
10
|
warn(message: string, data?: unknown): void;
|
|
7
11
|
}
|
|
@@ -1,18 +1,33 @@
|
|
|
1
1
|
import { AsyncLocalStorage } from 'node:async_hooks';
|
|
2
2
|
import { PoolReentryError } from './errors.js';
|
|
3
3
|
/**
|
|
4
|
-
* Set while a hook
|
|
5
|
-
* inherited by every timer, promise and continuation
|
|
4
|
+
* Set while a store hook runs, recording whether its store locks are released.
|
|
5
|
+
* Async context is inherited by every timer, promise and continuation inside the hook,
|
|
6
6
|
* so work a hook schedules is inside the guarded region too.
|
|
7
7
|
*/
|
|
8
8
|
const insideHook = new AsyncLocalStorage();
|
|
9
|
+
const insideCodec = new AsyncLocalStorage();
|
|
9
10
|
/** Refuses a row operation or refresh called from inside a hook. */
|
|
10
11
|
export function assertNotInsideHook(operation) {
|
|
11
12
|
if (insideHook.getStore() !== undefined)
|
|
12
13
|
throw new PoolReentryError(operation);
|
|
13
14
|
}
|
|
14
|
-
|
|
15
|
-
|
|
15
|
+
/** Namespace writes need only the store locks, not the row lock a hook may retain. */
|
|
16
|
+
export function assertLimitsWriteAllowed() {
|
|
17
|
+
if (insideHook.getStore()?.storeLocksReleased === false ||
|
|
18
|
+
insideCodec.getStore())
|
|
19
|
+
throw new PoolReentryError('updateLimitsNamespace');
|
|
20
|
+
}
|
|
21
|
+
/** Codecs may run under store locks even when no asynchronous hook is active. */
|
|
22
|
+
export function runInsideCodec(fn) {
|
|
23
|
+
return insideCodec.run(true, fn);
|
|
24
|
+
}
|
|
25
|
+
export function runInsideHook(operation, fn, storeLocksReleased = false) {
|
|
26
|
+
return insideHook.run({
|
|
27
|
+
operation,
|
|
28
|
+
storeLocksReleased: storeLocksReleased &&
|
|
29
|
+
insideHook.getStore()?.storeLocksReleased !== false,
|
|
30
|
+
}, async () => await fn());
|
|
16
31
|
}
|
|
17
32
|
/**
|
|
18
33
|
* Runs a failure hook. A hook that throws never replaces the failure it was
|
|
@@ -22,7 +37,7 @@ export async function callFailureHook(operation, hook, rowId, error, logger) {
|
|
|
22
37
|
if (!hook)
|
|
23
38
|
return;
|
|
24
39
|
try {
|
|
25
|
-
await runInsideHook(operation, () => hook(rowId, error));
|
|
40
|
+
await runInsideHook(operation, () => hook(rowId, error), true);
|
|
26
41
|
}
|
|
27
42
|
catch (hookError) {
|
|
28
43
|
logger?.warn('store failure hook threw; the original failure stands', {
|
|
@@ -3,6 +3,7 @@ export type { PoolFailureKind, PoolFailurePhase, PoolOperation, } from './errors
|
|
|
3
3
|
export { PoolOperationError, PoolReentryError } from './errors.js';
|
|
4
4
|
export type { PoolLogger } from './hooks.js';
|
|
5
5
|
export { countUnknownIdentityRows, DUPLICATE_IDENTITY_REASON, } from './identity.js';
|
|
6
|
+
export type { PoolLimitsMutator, PoolLimitsRow } from './limits-namespace.js';
|
|
6
7
|
export type { HoldPoint, InitializeOutcome, WriteStep } from './mutate.js';
|
|
7
8
|
export type { OpenPoolStoreOptions, PoolLoad, PoolStore, } from './pool.js';
|
|
8
9
|
export { openPoolStore } from './pool.js';
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import type { StoreRuntime } from './runtime.js';
|
|
2
|
+
import type { PoolRow } from './schema.js';
|
|
3
|
+
/** Row IDs, credential epochs and identities only; mutators never receive credentials. */
|
|
4
|
+
export type PoolLimitsRow = Pick<PoolRow, 'id' | 'credentialEpoch' | 'identity'>;
|
|
5
|
+
export type PoolLimitsMutator = (envelope: unknown, rows: readonly PoolLimitsRow[]) => unknown | Promise<unknown>;
|
|
6
|
+
/** A namespace merge and its check of current row bindings share one locked config snapshot. */
|
|
7
|
+
export declare function updatePoolLimitsNamespace(rt: StoreRuntime, mutator: PoolLimitsMutator): Promise<void>;
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
import { writeJsonAtomic } from '../fs/atomic-write.js';
|
|
2
|
+
import { assertLimitsWriteAllowed, runInsideHook } from './hooks.js';
|
|
3
|
+
import { notReadyError, readPool, runOperation } from './mutate.js';
|
|
4
|
+
/** A namespace merge and its check of current row bindings share one locked config snapshot. */
|
|
5
|
+
export async function updatePoolLimitsNamespace(rt, mutator) {
|
|
6
|
+
assertLimitsWriteAllowed();
|
|
7
|
+
const { ctx } = rt;
|
|
8
|
+
await runOperation(ctx, 'updateLimitsNamespace', undefined, undefined, async (locks, progress) => {
|
|
9
|
+
for (const spec of ctx.storeLocks)
|
|
10
|
+
await locks.acquire(spec);
|
|
11
|
+
const result = await readPool(ctx);
|
|
12
|
+
if (result.status !== 'ready')
|
|
13
|
+
throw notReadyError(result, 'updateLimitsNamespace', undefined);
|
|
14
|
+
const rows = result.rows.map(({ id, credentialEpoch, identity }) => ({
|
|
15
|
+
id,
|
|
16
|
+
credentialEpoch,
|
|
17
|
+
identity,
|
|
18
|
+
}));
|
|
19
|
+
const envelope = await runInsideHook('updateLimitsNamespace', () => mutator(structuredClone(result.config.commonAuthLimits), rows));
|
|
20
|
+
const config = { ...result.config, commonAuthLimits: envelope };
|
|
21
|
+
const info = {
|
|
22
|
+
operation: 'updateLimitsNamespace',
|
|
23
|
+
rowId: undefined,
|
|
24
|
+
};
|
|
25
|
+
await writeJsonAtomic(ctx.configPath, config, {
|
|
26
|
+
beforeRename: async () => {
|
|
27
|
+
await ctx.onStep?.('before-config-write', info);
|
|
28
|
+
await locks.assertAll();
|
|
29
|
+
},
|
|
30
|
+
});
|
|
31
|
+
progress.writes++;
|
|
32
|
+
await ctx.onStep?.('after-config-write', info);
|
|
33
|
+
});
|
|
34
|
+
}
|
|
@@ -2,6 +2,7 @@ import type { QuotaCommitTimer } from '../quota/commit-interval.js';
|
|
|
2
2
|
import { type Attribution } from './attribution.js';
|
|
3
3
|
import type { PoolOperationError } from './errors.js';
|
|
4
4
|
import type { PoolLogger } from './hooks.js';
|
|
5
|
+
import { type PoolLimitsMutator } from './limits-namespace.js';
|
|
5
6
|
import { type HoldPoint, type InitializeOutcome, type StoreContext } from './mutate.js';
|
|
6
7
|
import { type ProviderStateMutator, type UpdateProviderStateResult } from './provider-state.js';
|
|
7
8
|
import { type PublicationReceipt, type PublishOptions, type PublishPlan, type PublishResult } from './publication.js';
|
|
@@ -191,9 +192,17 @@ export interface PoolStore {
|
|
|
191
192
|
/**
|
|
192
193
|
* One locked write of the plugin's settings (since 0.2.6) beside the pool,
|
|
193
194
|
* in the config file. Refuses a result that sets a pool-owned key
|
|
194
|
-
* (`invalid-input`).
|
|
195
|
+
* (`invalid-input`). Carries commonAuthLimits through unchanged and refuses
|
|
196
|
+
* an explicit alteration to it. Takes `extraLocks`, then the store locks.
|
|
195
197
|
*/
|
|
196
198
|
updateSettings(mutator: SettingsMutator, options?: UpdateSettingsOptions): Promise<UpdateSettingsResult>;
|
|
199
|
+
/**
|
|
200
|
+
* Merges commonAuthLimits with current row bindings in one config write.
|
|
201
|
+
* Requires a ready pool and takes only the store locks. May run in an
|
|
202
|
+
* onPersisted/onFailure hook or a pull, but not in a lock-held mutator.
|
|
203
|
+
* Optional so existing structural implementations remain compatible.
|
|
204
|
+
*/
|
|
205
|
+
updateLimitsNamespace?(mutator: PoolLimitsMutator): Promise<void>;
|
|
197
206
|
/**
|
|
198
207
|
* Records the identity a lookup found for the row's credential. Since
|
|
199
208
|
* 0.3.1 it takes the credential epoch the lookup was issued for, and
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { recordQuota } from './attribution.js';
|
|
2
|
+
import { updatePoolLimitsNamespace, } from './limits-namespace.js';
|
|
2
3
|
import { initializePool, readPool, } from './mutate.js';
|
|
3
4
|
import { updateProviderStateRow, } from './provider-state.js';
|
|
4
5
|
import { publication, publishRoster, } from './publication.js';
|
|
@@ -126,6 +127,7 @@ export function openPoolStore(options) {
|
|
|
126
127
|
reorder: (ids, callOptions) => reorderRows(rt, ids, callOptions),
|
|
127
128
|
readSettings: () => readPoolSettings(rt),
|
|
128
129
|
updateSettings: (mutator, callOptions) => updatePoolSettings(rt, mutator, callOptions),
|
|
130
|
+
updateLimitsNamespace: (mutator) => updatePoolLimitsNamespace(rt, mutator),
|
|
129
131
|
recordIdentity: (id, identity, attribution, callOptions) => recordRowIdentity(rt, id, identity, attribution, callOptions),
|
|
130
132
|
refresh: (id, provider, callOptions) => refreshRow(rt, id, provider, callOptions),
|
|
131
133
|
recordQuota: record,
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { assertNotInsideHook, runInsideHook } from './hooks.js';
|
|
1
|
+
import { assertNotInsideHook, runInsideCodec, runInsideHook } from './hooks.js';
|
|
2
2
|
import { runOperation, withTransaction } from './mutate.js';
|
|
3
3
|
import { readRow, refusal, requireBound, rowLockSpec, unknownRow, } from './runtime.js';
|
|
4
4
|
import { boundProviderStateDigest, CREDENTIAL_STAMP_KEY, credentialDigest, isCredentialEpoch, isRecord, PROVIDER_STATE_KEY, parseStamp, providerStateDigest, rowLockKey, } from './schema.js';
|
|
@@ -21,7 +21,7 @@ export function acceptProviderState(codec, operation, id, value, what = 'the pro
|
|
|
21
21
|
}
|
|
22
22
|
if (normalized === undefined)
|
|
23
23
|
throw refusal(operation, id, 'invalid-provider-state', `${what} cannot be stored as JSON`);
|
|
24
|
-
if (!codec.validate(normalized))
|
|
24
|
+
if (!runInsideCodec(() => codec.validate(normalized)))
|
|
25
25
|
throw refusal(operation, id, 'invalid-provider-state', `the provider-state codec rejected ${what}`);
|
|
26
26
|
return normalized;
|
|
27
27
|
}
|
|
@@ -35,7 +35,7 @@ export function mergedProviderState(codec, operation, id, onDisk, incoming) {
|
|
|
35
35
|
return { kind: 'set', value: incoming };
|
|
36
36
|
return {
|
|
37
37
|
kind: 'set',
|
|
38
|
-
value: acceptProviderState(codec, operation, id, codec.merge(structuredClone(onDisk), structuredClone(incoming)), 'the merged provider state'),
|
|
38
|
+
value: acceptProviderState(codec, operation, id, runInsideCodec(() => codec.merge?.(structuredClone(onDisk), structuredClone(incoming))), 'the merged provider state'),
|
|
39
39
|
};
|
|
40
40
|
}
|
|
41
41
|
/**
|
|
@@ -48,7 +48,7 @@ export function mergedProviderState(codec, operation, id, onDisk, incoming) {
|
|
|
48
48
|
export function replacementProviderState(codec, row, credentialEpoch, identity, incoming) {
|
|
49
49
|
const hook = codec?.onReplace;
|
|
50
50
|
const next = hook
|
|
51
|
-
? hook(row.providerState === undefined
|
|
51
|
+
? runInsideCodec(() => hook(row.providerState === undefined
|
|
52
52
|
? undefined
|
|
53
53
|
: structuredClone(row.providerState), {
|
|
54
54
|
id: row.id,
|
|
@@ -60,7 +60,7 @@ export function replacementProviderState(codec, row, credentialEpoch, identity,
|
|
|
60
60
|
...(incoming !== undefined
|
|
61
61
|
? { incoming: structuredClone(incoming) }
|
|
62
62
|
: {}),
|
|
63
|
-
})
|
|
63
|
+
}))
|
|
64
64
|
: incoming;
|
|
65
65
|
if (next === undefined)
|
|
66
66
|
return { kind: 'clear' };
|
|
@@ -200,7 +200,7 @@ export async function refreshRow(rt, id, provider, options = {}) {
|
|
|
200
200
|
if (options.onPersisted) {
|
|
201
201
|
try {
|
|
202
202
|
const persisted = options.onPersisted;
|
|
203
|
-
await runInsideHook('refresh', () => persisted(id, commit.stored));
|
|
203
|
+
await runInsideHook('refresh', () => persisted(id, commit.stored), true);
|
|
204
204
|
}
|
|
205
205
|
catch (cause) {
|
|
206
206
|
throw new PoolOperationError({
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { createHash } from 'node:crypto';
|
|
2
|
+
import { runInsideCodec } from './hooks.js';
|
|
2
3
|
/** Top-level key of the config file that holds everything the pool adds. */
|
|
3
4
|
export const POOL_KEY = 'commonAuthPool';
|
|
4
5
|
/** The pool schema this library reads and writes. */
|
|
@@ -182,7 +183,9 @@ export function stampFor(credential, credentialEpoch, binding, options = {}) {
|
|
|
182
183
|
* digest the store writes.
|
|
183
184
|
*/
|
|
184
185
|
export function providerStateDigest(codec, value) {
|
|
185
|
-
const bound = codec?.credentialBound
|
|
186
|
+
const bound = codec?.credentialBound
|
|
187
|
+
? runInsideCodec(() => codec.credentialBound?.(value))
|
|
188
|
+
: value;
|
|
186
189
|
return createHash('sha256')
|
|
187
190
|
.update(`provider-state\0${JSON.stringify(bound ?? null)}`)
|
|
188
191
|
.digest('hex');
|
|
@@ -420,8 +423,10 @@ function parseEntry(raw, codec) {
|
|
|
420
423
|
return undefined;
|
|
421
424
|
if ('disabledReason' in raw && typeof raw.disabledReason !== 'string')
|
|
422
425
|
return undefined;
|
|
423
|
-
const quota = 'quota' in raw && codec.decode
|
|
424
|
-
|
|
426
|
+
const quota = 'quota' in raw && codec.decode
|
|
427
|
+
? runInsideCodec(() => codec.decode?.(raw.quota))
|
|
428
|
+
: raw.quota;
|
|
429
|
+
if ('quota' in raw && !runInsideCodec(() => codec.validate(quota)))
|
|
425
430
|
return undefined;
|
|
426
431
|
if ('staged' in raw && !parseReservation(raw.staged))
|
|
427
432
|
return undefined;
|
|
@@ -666,7 +671,7 @@ function providerStateFields(account, credential, credentialEpoch, identity, cod
|
|
|
666
671
|
const value = account[PROVIDER_STATE_KEY];
|
|
667
672
|
// The value is validated before it is projected, so the projection only
|
|
668
673
|
// ever sees a value of the shape the codec accepts.
|
|
669
|
-
if (!codec
|
|
674
|
+
if (!codec || !runInsideCodec(() => codec.validate(value)))
|
|
670
675
|
return { providerStateDropped: 'invalid' };
|
|
671
676
|
if (providerStateDigest(codec, value) !== digest)
|
|
672
677
|
return { providerStateDropped: 'uncovered' };
|
|
@@ -59,5 +59,7 @@ export declare function readPoolSettings(rt: StoreRuntime): Promise<SettingsRead
|
|
|
59
59
|
* pool-owned key refuses (`invalid-input`) with nothing written; a result
|
|
60
60
|
* equal to the current settings writes nothing. The state file is never
|
|
61
61
|
* touched, and the pool-owned keys are written back exactly as read.
|
|
62
|
+
* commonAuthLimits is also carried through unchanged, even when omitted by
|
|
63
|
+
* the mutator; an explicit change to it refuses before writing anything.
|
|
62
64
|
*/
|
|
63
65
|
export declare function updatePoolSettings(rt: StoreRuntime, mutator: SettingsMutator, options?: UpdateSettingsOptions): Promise<UpdateSettingsResult>;
|
|
@@ -36,12 +36,13 @@ function defineKey(target, key, value) {
|
|
|
36
36
|
/**
|
|
37
37
|
* The next config: the pool-owned keys exactly as read, every settings key
|
|
38
38
|
* from `next` in its existing position, settings keys `next` dropped left
|
|
39
|
-
* out, and new settings keys appended.
|
|
39
|
+
* out, and new settings keys appended. The limits envelope is always carried
|
|
40
|
+
* through from disk; ordinary settings mutators do not own that namespace.
|
|
40
41
|
*/
|
|
41
42
|
function composeConfig(config, next) {
|
|
42
43
|
const out = {};
|
|
43
44
|
for (const [key, value] of Object.entries(config)) {
|
|
44
|
-
if (POOL_OWNED_KEYS.includes(key))
|
|
45
|
+
if (POOL_OWNED_KEYS.includes(key) || key === 'commonAuthLimits')
|
|
45
46
|
defineKey(out, key, value);
|
|
46
47
|
else if (Object.hasOwn(next, key))
|
|
47
48
|
defineKey(out, key, next[key]);
|
|
@@ -82,6 +83,8 @@ export async function readPoolSettings(rt) {
|
|
|
82
83
|
* pool-owned key refuses (`invalid-input`) with nothing written; a result
|
|
83
84
|
* equal to the current settings writes nothing. The state file is never
|
|
84
85
|
* touched, and the pool-owned keys are written back exactly as read.
|
|
86
|
+
* commonAuthLimits is also carried through unchanged, even when omitted by
|
|
87
|
+
* the mutator; an explicit change to it refuses before writing anything.
|
|
85
88
|
*/
|
|
86
89
|
export async function updatePoolSettings(rt, mutator, options = {}) {
|
|
87
90
|
assertNotInsideHook('updateSettings');
|
|
@@ -109,9 +112,13 @@ export async function updatePoolSettings(rt, mutator, options = {}) {
|
|
|
109
112
|
const owned = POOL_OWNED_KEYS.filter((key) => Object.hasOwn(next, key));
|
|
110
113
|
if (owned.length > 0)
|
|
111
114
|
throw settingsRefusal(`settings cannot set the pool-owned key(s) ${owned.join(', ')}`);
|
|
112
|
-
if (
|
|
113
|
-
|
|
115
|
+
if (Object.hasOwn(next, 'commonAuthLimits') &&
|
|
116
|
+
(!Object.hasOwn(current, 'commonAuthLimits') ||
|
|
117
|
+
!isDeepStrictEqual(next.commonAuthLimits, current.commonAuthLimits)))
|
|
118
|
+
throw settingsRefusal('settings cannot alter commonAuthLimits; use updateLimitsNamespace');
|
|
114
119
|
const config = composeConfig(result.config, next);
|
|
120
|
+
if (isDeepStrictEqual(settingsOf(config), current))
|
|
121
|
+
return { settings: current, outcome: 'unchanged' };
|
|
115
122
|
const info = { operation: 'updateSettings', rowId: undefined };
|
|
116
123
|
await writeJsonAtomic(ctx.configPath, config, {
|
|
117
124
|
beforeRename: async () => {
|
|
@@ -4,8 +4,8 @@ import { dirname, join } from 'node:path';
|
|
|
4
4
|
import { loadCommonAuthStoreModules } from '@cortexkit/antigravity-auth-core';
|
|
5
5
|
const PIN = {
|
|
6
6
|
package: '@cortexkit/common-auth',
|
|
7
|
-
version: '0.
|
|
8
|
-
tarballSha256: '
|
|
7
|
+
version: '0.34.0',
|
|
8
|
+
tarballSha256: '381a0a78b6ca4873922ce1be1378c5b891136686a5ba85ffe6d39c6a2624f549',
|
|
9
9
|
};
|
|
10
10
|
async function filesBelow(root, dir) {
|
|
11
11
|
const out = [];
|
|
@@ -1,21 +1,3 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Shared Antigravity request engine: account selection, retries, endpoint
|
|
3
|
-
* fallback, warmups and response handling for one plugin location.
|
|
4
|
-
*
|
|
5
|
-
* OpenCode 1's `createFetchInterceptor` and the GA location services both
|
|
6
|
-
* call `createRequestExecutor`, so there is exactly one retry loop. Every
|
|
7
|
-
* collaborator with state (accounts, credentials, session metadata, operator
|
|
8
|
-
* settings, wire state, debug log, dump switch, logger, health and token
|
|
9
|
-
* trackers) arrives through `RequestServicesDeps`; this module never reads a
|
|
10
|
-
* module-level OpenCode 1 binding or a host SDK client. Host-only effects
|
|
11
|
-
* (toasts, the sidebar routing file, clearing host-stored OAuth credentials)
|
|
12
|
-
* are optional or explicit callbacks the host binding supplies.
|
|
13
|
-
*
|
|
14
|
-
* The wire rules themselves (payload transformation, header and envelope
|
|
15
|
-
* order, SSE handling) stay in `../request`. The engine receives them as
|
|
16
|
-
* `RequestWire`, which `createRequestWire` binds to one location's signature
|
|
17
|
-
* cache, debug log and logger; the raw sender is called unchanged.
|
|
18
|
-
*/
|
|
19
1
|
import { type AgyTransportOptions, type AccountManager as CoreAccountManager, type Fingerprint, type HealthScoreTracker, type ManagedAccount, type OAuthAuthDetails, type PreResponseClock, type ProjectContextResult, type QuotaGroup, type QuotaGroupSummary, type QuotaManager, type TokenBucketTracker } from '@cortexkit/antigravity-auth-core';
|
|
20
2
|
import { type RoutingCandidate } from '../../common-auth-embedded/routing-accessor/index.js';
|
|
21
3
|
import type { AntigravityConfig } from '../config/index.js';
|
|
@@ -44,6 +26,18 @@ export interface RequestAccountRow {
|
|
|
44
26
|
};
|
|
45
27
|
readonly cachedQuota?: Partial<Record<QuotaGroup, QuotaGroupSummary>>;
|
|
46
28
|
readonly cachedQuotaUpdatedAt?: number;
|
|
29
|
+
readonly capturedTierId?: string;
|
|
30
|
+
readonly capturedPaidTierId?: string;
|
|
31
|
+
readonly ref?: {
|
|
32
|
+
readonly id: string;
|
|
33
|
+
readonly credentialEpoch: number;
|
|
34
|
+
readonly identity?: string;
|
|
35
|
+
};
|
|
36
|
+
readonly route?: {
|
|
37
|
+
readonly routeId: string;
|
|
38
|
+
readonly credentialId: string;
|
|
39
|
+
readonly accountIdentity: string;
|
|
40
|
+
};
|
|
47
41
|
}
|
|
48
42
|
type CoreArgs<K extends keyof CoreAccountManager> = CoreAccountManager[K] extends (...args: infer P) => unknown ? P : never;
|
|
49
43
|
type CoreArgsAfterAccount<K extends keyof CoreAccountManager> = CoreArgs<K> extends [unknown, ...infer Rest] ? Rest : never;
|
|
@@ -273,6 +267,8 @@ export type RequestDebug = Pick<LocationDebug, 'isDebugEnabled' | 'logAccountCon
|
|
|
273
267
|
*/
|
|
274
268
|
export interface RequestServicesDeps<A extends RequestAccountRow> {
|
|
275
269
|
readonly preResponseClock?: PreResponseClock;
|
|
270
|
+
/** Wall clock for the process-local model-availability cache. */
|
|
271
|
+
readonly modelAvailabilityNow?: () => number;
|
|
276
272
|
/** Check the persistent account source before each operation that uses credentials. */
|
|
277
273
|
readonly assertAdmission?: (signal: AbortSignal) => Promise<void>;
|
|
278
274
|
readonly config: AntigravityConfig;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"request-services.d.ts","sourceRoot":"","sources":["../../../../src/plugin/shared/request-services.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;GAiBG;AACH,OAAO,EACL,KAAK,mBAAmB,EAExB,KAAK,cAAc,IAAI,kBAAkB,EAGzC,KAAK,WAAW,EAIhB,KAAK,kBAAkB,EAIvB,KAAK,cAAc,EACnB,KAAK,gBAAgB,EAErB,KAAK,gBAAgB,EAGrB,KAAK,oBAAoB,EAKzB,KAAK,UAAU,EACf,KAAK,iBAAiB,EACtB,KAAK,YAAY,EAMjB,KAAK,kBAAkB,EAExB,MAAM,kCAAkC,CAAA;AACzC,OAAO,EAEL,KAAK,gBAAgB,EACtB,MAAM,sDAAsD,CAAA;AAK7D,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,WAAW,CAAA;AAClD,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,UAAU,CAAA;AAgB7C,OAAO,EAAE,KAAK,eAAe,EAA0B,MAAM,gBAAgB,CAAA;AAE7E,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,WAAW,CAAA;AACvC,OAAO,KAAK,EAAE,0BAA0B,EAAE,MAAM,sBAAsB,CAAA;AACtE,OAAO,KAAK,EACV,uBAAuB,EACvB,uBAAuB,EACvB,iBAAiB,EACjB,qBAAqB,EACrB,yBAAyB,EACzB,4BAA4B,EAC7B,MAAM,YAAY,CAAA;AAQnB,OAAO,EACL,KAAK,kBAAkB,EAEvB,KAAK,uBAAuB,EAC7B,MAAM,oBAAoB,CAAA;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zE;;;GAGG;AACH,eAAO,MAAM,oBAAoB,yBAAyB,CAAA;AAE1D;;;;GAIG;AACH,wBAAgB,eAAe,CAAC,GAAG,EAAE,MAAM,GAAG,MAAM,CASnD;AAED;;;GAGG;AACH,wBAAgB,oBAAoB,CAAC,GAAG,EAAE,MAAM,GAAG,QAAQ,GAAG,SAAS,CAatE;AAmBD,+CAA+C;AAC/C,MAAM,WAAW,0BAA0B;IACzC;;;;OAIG;IACH,OAAO,CACL,KAAK,EAAE,WAAW,GAAG,GAAG,EACxB,IAAI,CAAC,EAAE,WAAW,EAClB,OAAO,CAAC,EAAE,qBAAqB,GAC9B,OAAO,CAAC,QAAQ,CAAC,CAAA;IACpB;;;;;;OAMG;IACH,MAAM,IAAI,OAAO,CAAC,IAAI,CAAC,CAAA;IACvB;;;OAGG;IACH,OAAO,IAAI,OAAO,CAAC,IAAI,CAAC,CAAA;CACzB;AA2FD;;;;;GAKG;AACH,wBAAgB,uBAAuB,CACrC,cAAc,EAAE,IAAI,CAClB,kBAAkB,EAChB,aAAa,GACb,0BAA0B,GAC1B,kBAAkB,GAClB,mBAAmB,CACtB,EACD,YAAY,EAAE,IAAI,CAAC,YAAY,EAAE,gBAAgB,GAAG,gBAAgB,CAAC,EACrE,GAAG,EAAE,MAAM,GACV,CACD,OAAO,EAAE,cAAc,EACvB,eAAe,EAAE,MAAM,EACvB,MAAM,CAAC,EAAE,WAAW,KACjB,OAAO,CAAC,IAAI,CAAC,CA0DjB;AAED;;;GAGG;AACH,wBAAgB,qBAAqB,CAAC,CAAC,SAAS,iBAAiB,EAC/D,IAAI,EAAE,mBAAmB,CAAC,CAAC,CAAC,GAC3B,0BAA0B,CA62E5B"}
|
|
1
|
+
{"version":3,"file":"request-services.d.ts","sourceRoot":"","sources":["../../../../src/plugin/shared/request-services.ts"],"names":[],"mappings":"AAmBA,OAAO,EACL,KAAK,mBAAmB,EAExB,KAAK,cAAc,IAAI,kBAAkB,EAGzC,KAAK,WAAW,EAIhB,KAAK,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AAG,SAAS,GAAG,YAAY,GAAG,OAAO,GAAG,UAAU,CAAA;AAEzE;;;GAGG;AACH,eAAO,MAAM,oBAAoB,yBAAyB,CAAA;AAE1D;;;;GAIG;AACH,wBAAgB,eAAe,CAAC,GAAG,EAAE,MAAM,GAAG,MAAM,CASnD;AAED;;;GAGG;AACH,wBAAgB,oBAAoB,CAAC,GAAG,EAAE,MAAM,GAAG,QAAQ,GAAG,SAAS,CAatE;AAmBD,+CAA+C;AAC/C,MAAM,WAAW,0BAA0B;IACzC;;;;OAIG;IACH,OAAO,CACL,KAAK,EAAE,WAAW,GAAG,GAAG,EACxB,IAAI,CAAC,EAAE,WAAW,EAClB,OAAO,CAAC,EAAE,qBAAqB,GAC9B,OAAO,CAAC,QAAQ,CAAC,CAAA;IACpB;;;;;;OAMG;IACH,MAAM,IAAI,OAAO,CAAC,IAAI,CAAC,CAAA;IACvB;;;OAGG;IACH,OAAO,IAAI,OAAO,CAAC,IAAI,CAAC,CAAA;CACzB;AA2FD;;;;;GAKG;AACH,wBAAgB,uBAAuB,CACrC,cAAc,EAAE,IAAI,CAClB,kBAAkB,EAChB,aAAa,GACb,0BAA0B,GAC1B,kBAAkB,GAClB,mBAAmB,CACtB,EACD,YAAY,EAAE,IAAI,CAAC,YAAY,EAAE,gBAAgB,GAAG,gBAAgB,CAAC,EACrE,GAAG,EAAE,MAAM,GACV,CACD,OAAO,EAAE,cAAc,EACvB,eAAe,EAAE,MAAM,EACvB,MAAM,CAAC,EAAE,WAAW,KACjB,OAAO,CAAC,IAAI,CAAC,CA0DjB;AAED;;;GAGG;AACH,wBAAgB,qBAAqB,CAAC,CAAC,SAAS,iBAAiB,EAC/D,IAAI,EAAE,mBAAmB,CAAC,CAAC,CAAC,GAC3B,0BAA0B,CA4+E5B"}
|
|
@@ -16,6 +16,7 @@
|
|
|
16
16
|
* `RequestWire`, which `createRequestWire` binds to one location's signature
|
|
17
17
|
* cache, debug log and logger; the raw sender is called unchanged.
|
|
18
18
|
*/
|
|
19
|
+
import { createHash } from 'node:crypto';
|
|
19
20
|
import { accessTokenExpired, calculateBackoffMs, computeSoftQuotaCacheTtlMs, getPublicModelDefinitions, getQuotaKey, getResolverAliasMap, isClaudeThinkingModel, isImageGenerationModel, isRetiredAgyModel, PRE_RESPONSE_DEADLINE_MS, PreResponseDeadline, PreResponseTimeoutError, parseRateLimitReason, parseRefreshParts, preResponseTimeoutResponse, preserveResponseMetadata, RETIRED_AGY_MODEL_MESSAGE, redactCredentialError, redactCredentialResponse, redactCredentialText, resolveQuotaGroup, VAULT_ACCOUNT_REMEDY, } from '@cortexkit/antigravity-auth-core';
|
|
20
21
|
import { askRouting, } from '../../common-auth-embedded/routing-accessor/index.js';
|
|
21
22
|
import { ANTIGRAVITY_ENDPOINT_DAILY, ANTIGRAVITY_ENDPOINT_FALLBACKS, } from '../../constants';
|
|
@@ -36,6 +37,8 @@ import { isPrimaryVaultRequest } from './vault-routing-purpose';
|
|
|
36
37
|
* Wait before retrying the same selection after its first 429.
|
|
37
38
|
*/
|
|
38
39
|
const FIRST_RETRY_DELAY_MS = 1000;
|
|
40
|
+
// Re-probe within an hour even when no quota refresh has revealed a new allowance.
|
|
41
|
+
const MODEL_UNAVAILABLE_TTL_MS = 60 * 60 * 1000;
|
|
39
42
|
/**
|
|
40
43
|
* Prepares one upstream Antigravity request: payload transforms, AGY
|
|
41
44
|
* metadata and envelope, header order and the endpoint URL. It is the single
|
|
@@ -229,6 +232,111 @@ export function createRequestExecutor(deps) {
|
|
|
229
232
|
const { config, accounts: accountManager, credentials, sessions: agySessionRegistry, operatorSettings, transport: defaultTransport, wire, debug, dump, logger: log, trackers, classifyAccessError, notify, onRouting, } = deps;
|
|
230
233
|
const retryState = createRetryState();
|
|
231
234
|
const warmupState = createWarmupState();
|
|
235
|
+
// One executor serves every request of its interceptor/location pipeline.
|
|
236
|
+
// Keep negative capability evidence separate from retry and health state.
|
|
237
|
+
const modelAvailabilityNow = deps.modelAvailabilityNow ?? Date.now;
|
|
238
|
+
const unavailableModels = new Map();
|
|
239
|
+
const accountKey = (account) => {
|
|
240
|
+
if (credentials.domain === 'vault') {
|
|
241
|
+
const route = account.route;
|
|
242
|
+
return route
|
|
243
|
+
? JSON.stringify([
|
|
244
|
+
'vault',
|
|
245
|
+
route.routeId,
|
|
246
|
+
route.credentialId,
|
|
247
|
+
route.accountIdentity,
|
|
248
|
+
])
|
|
249
|
+
: account;
|
|
250
|
+
}
|
|
251
|
+
if (account.ref) {
|
|
252
|
+
const ref = account.ref;
|
|
253
|
+
return JSON.stringify([
|
|
254
|
+
'local',
|
|
255
|
+
ref.id,
|
|
256
|
+
ref.credentialEpoch,
|
|
257
|
+
ref.identity,
|
|
258
|
+
]);
|
|
259
|
+
}
|
|
260
|
+
// Legacy pool-file accounts have no RowRef. Include their credential so
|
|
261
|
+
// re-login cannot inherit evidence about the previous login of an email.
|
|
262
|
+
const refresh = credentials.toAuthDetails(account).refresh;
|
|
263
|
+
return JSON.stringify([
|
|
264
|
+
'pool-file',
|
|
265
|
+
account.email?.toLowerCase(),
|
|
266
|
+
createHash('sha256')
|
|
267
|
+
.update(parseRefreshParts(refresh).refreshToken)
|
|
268
|
+
.digest('hex'),
|
|
269
|
+
]);
|
|
270
|
+
};
|
|
271
|
+
const tierOf = (account) => JSON.stringify([account.capturedTierId, account.capturedPaidTierId]);
|
|
272
|
+
const dropModel = (key, model, cause) => {
|
|
273
|
+
const entries = unavailableModels.get(key);
|
|
274
|
+
const entry = entries?.get(model);
|
|
275
|
+
if (!entries || !entry)
|
|
276
|
+
return;
|
|
277
|
+
log.debug('model-unavailable-memory-drop', {
|
|
278
|
+
account: entry.label,
|
|
279
|
+
model,
|
|
280
|
+
cause,
|
|
281
|
+
});
|
|
282
|
+
entries.delete(model);
|
|
283
|
+
if (entries.size === 0)
|
|
284
|
+
unavailableModels.delete(key);
|
|
285
|
+
};
|
|
286
|
+
const rememberedIndexes = (model) => {
|
|
287
|
+
const rows = accountManager.getAccounts();
|
|
288
|
+
const live = new Map(rows.map((row) => [accountKey(row), row]));
|
|
289
|
+
const indexes = new Set();
|
|
290
|
+
for (const [key, entries] of unavailableModels) {
|
|
291
|
+
const row = live.get(key);
|
|
292
|
+
for (const [exactModel, entry] of entries) {
|
|
293
|
+
const cause = !row
|
|
294
|
+
? 'identity-replaced'
|
|
295
|
+
: modelAvailabilityNow() - entry.recordedAt >=
|
|
296
|
+
MODEL_UNAVAILABLE_TTL_MS
|
|
297
|
+
? 'expired'
|
|
298
|
+
: row.cachedQuotaUpdatedAt !== undefined &&
|
|
299
|
+
row.cachedQuota?.['gemini-argon'] !== undefined &&
|
|
300
|
+
(!entry.argonPool ||
|
|
301
|
+
row.cachedQuotaUpdatedAt !== entry.quotaUpdatedAt)
|
|
302
|
+
? 'argon-pool'
|
|
303
|
+
: row.cachedQuotaUpdatedAt !== undefined &&
|
|
304
|
+
row.cachedQuotaUpdatedAt !== entry.quotaUpdatedAt
|
|
305
|
+
? 'quota-reading'
|
|
306
|
+
: tierOf(row) !== entry.tier
|
|
307
|
+
? 'tier-changed'
|
|
308
|
+
: undefined;
|
|
309
|
+
if (cause)
|
|
310
|
+
dropModel(key, exactModel, cause);
|
|
311
|
+
else if (row && exactModel === model)
|
|
312
|
+
indexes.add(row.index);
|
|
313
|
+
}
|
|
314
|
+
}
|
|
315
|
+
return indexes;
|
|
316
|
+
};
|
|
317
|
+
const captureAvailability = (account) => ({
|
|
318
|
+
key: accountKey(account),
|
|
319
|
+
quotaUpdatedAt: account.cachedQuotaUpdatedAt,
|
|
320
|
+
tier: tierOf(account),
|
|
321
|
+
argonPool: account.cachedQuota?.['gemini-argon'] !== undefined,
|
|
322
|
+
label: `Account ${account.index + 1}`,
|
|
323
|
+
});
|
|
324
|
+
const rememberUnavailable = (snapshot, model) => {
|
|
325
|
+
const { key, ...entry } = snapshot;
|
|
326
|
+
let entries = unavailableModels.get(key);
|
|
327
|
+
if (!entries) {
|
|
328
|
+
entries = new Map();
|
|
329
|
+
unavailableModels.set(key, entries);
|
|
330
|
+
}
|
|
331
|
+
entries.set(model, {
|
|
332
|
+
...entry,
|
|
333
|
+
recordedAt: modelAvailabilityNow(),
|
|
334
|
+
});
|
|
335
|
+
log.debug('model-unavailable-memory-record', {
|
|
336
|
+
account: entry.label,
|
|
337
|
+
model,
|
|
338
|
+
});
|
|
339
|
+
};
|
|
232
340
|
const shutdown = new AbortController();
|
|
233
341
|
const inFlight = new Set();
|
|
234
342
|
const advisoryWork = new Set();
|
|
@@ -438,9 +546,8 @@ export function createRequestExecutor(deps) {
|
|
|
438
546
|
let localRecaptureUsed = false;
|
|
439
547
|
const maxWaitMs = (config.max_rate_limit_wait_seconds ?? 300) * 1000;
|
|
440
548
|
let allAccountsBlockedAt;
|
|
441
|
-
//
|
|
442
|
-
//
|
|
443
|
-
// this request only; no rate limit, cooldown or failure is recorded.
|
|
549
|
+
// Retain the request-local skip even if fresh quota evidence drops the
|
|
550
|
+
// cross-request memory during this request. Neither skip is a penalty.
|
|
444
551
|
const modelUnavailableIndexes = new Set();
|
|
445
552
|
let routingPlacementConsidered = false;
|
|
446
553
|
while (true) {
|
|
@@ -514,7 +621,11 @@ export function createRequestExecutor(deps) {
|
|
|
514
621
|
.getAccounts()
|
|
515
622
|
.map((entry) => entry.index)
|
|
516
623
|
.filter((index) => !eligibleIndexes.has(index)));
|
|
517
|
-
|
|
624
|
+
const unavailableIndexes = new Set([
|
|
625
|
+
...modelUnavailableIndexes,
|
|
626
|
+
...rememberedIndexes(model),
|
|
627
|
+
]);
|
|
628
|
+
if (unavailableIndexes.size > 0) {
|
|
518
629
|
const candidates = accountManager
|
|
519
630
|
.getAccounts()
|
|
520
631
|
.filter((entry) => entry.enabled !== false &&
|
|
@@ -522,7 +633,7 @@ export function createRequestExecutor(deps) {
|
|
|
522
633
|
!entry.verificationRequired &&
|
|
523
634
|
(eligibleIndexes === null || eligibleIndexes.has(entry.index)));
|
|
524
635
|
if (candidates.length > 0 &&
|
|
525
|
-
candidates.every((entry) =>
|
|
636
|
+
candidates.every((entry) => unavailableIndexes.has(entry.index))) {
|
|
526
637
|
// Every account that could serve this request lacks the model.
|
|
527
638
|
// Waiting or retrying cannot change that, so end with a
|
|
528
639
|
// non-retryable local refusal instead of the last upstream 404.
|
|
@@ -538,9 +649,9 @@ export function createRequestExecutor(deps) {
|
|
|
538
649
|
});
|
|
539
650
|
}
|
|
540
651
|
}
|
|
541
|
-
const excludedIndexes =
|
|
652
|
+
const excludedIndexes = unavailableIndexes.size === 0
|
|
542
653
|
? killedIndexes
|
|
543
|
-
: new Set([...(killedIndexes ?? []), ...
|
|
654
|
+
: new Set([...(killedIndexes ?? []), ...unavailableIndexes]);
|
|
544
655
|
const routingPresent = credentials.domain === 'vault' && hasVaultRoutingAccessor();
|
|
545
656
|
const firstPlacement = routingPresent &&
|
|
546
657
|
!routingPlacementConsidered &&
|
|
@@ -1090,6 +1201,9 @@ export function createRequestExecutor(deps) {
|
|
|
1090
1201
|
let tokenConsumed = false;
|
|
1091
1202
|
let physicalAttemptStarted = false;
|
|
1092
1203
|
try {
|
|
1204
|
+
// Attribute the answer to the identity and reading used by this
|
|
1205
|
+
// attempt, not a replacement that arrives while the send waits.
|
|
1206
|
+
const availabilitySnapshot = captureAvailability(account);
|
|
1093
1207
|
// One credential grant per physical send, chosen by domain. Vault:
|
|
1094
1208
|
// a fresh admission for this send only; its token and project come
|
|
1095
1209
|
// from that one receipt, and a 401 is reported against its record
|
|
@@ -1443,6 +1557,8 @@ export function createRequestExecutor(deps) {
|
|
|
1443
1557
|
});
|
|
1444
1558
|
void response.body?.cancel().catch(() => { });
|
|
1445
1559
|
modelUnavailableIndexes.add(account.index);
|
|
1560
|
+
if (model)
|
|
1561
|
+
rememberUnavailable(availabilitySnapshot, model);
|
|
1446
1562
|
skippedForModelUnavailable = true;
|
|
1447
1563
|
shouldSwitchAccount = true;
|
|
1448
1564
|
break;
|
|
@@ -1755,6 +1871,10 @@ export function createRequestExecutor(deps) {
|
|
|
1755
1871
|
await Promise.allSettled([...advisoryWork]);
|
|
1756
1872
|
retryState.dispose();
|
|
1757
1873
|
warmupState.dispose();
|
|
1874
|
+
for (const [key, entries] of unavailableModels) {
|
|
1875
|
+
for (const model of entries.keys())
|
|
1876
|
+
dropModel(key, model, 'disposed');
|
|
1877
|
+
}
|
|
1758
1878
|
})();
|
|
1759
1879
|
return drainPromise;
|
|
1760
1880
|
}
|