@cortexkit/opencode-antigravity-auth 3.0.29 → 3.0.31
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 +783 -254
- package/dist/cli.js.map +4 -4
- package/dist/cli.meta.json +145 -77
- package/dist/index.js +842 -297
- package/dist/index.js.map +4 -4
- package/dist/index.meta.json +177 -85
- package/dist/server.js +842 -300
- 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 +4 -0
- package/dist/src/common-auth-embedded/claustrum/roster.js +34 -8
- 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/file-read-cache.js +10 -5
- 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 +69 -0
- package/dist/src/common-auth-embedded/limits/decide.d.ts +146 -0
- package/dist/src/common-auth-embedded/limits/duration.d.ts +8 -0
- package/dist/src/common-auth-embedded/limits/families.d.ts +59 -0
- package/dist/src/common-auth-embedded/limits/marker.d.ts +69 -0
- package/dist/src/common-auth-embedded/limits/request-history.d.ts +79 -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 +4 -3
- package/dist/src/common-auth-embedded/opencode2/install.js +219 -27
- package/dist/src/common-auth-embedded/opencode2/types.d.ts +113 -11
- 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/setup/enroll.js +7 -1
- package/dist/src/common-auth-embedded/source-output.json +260 -124
- 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 +13 -0
- package/dist/src/common-auth-embedded/store/limits-namespace.js +46 -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__/release-model-ids.d.ts.map +1 -1
- package/dist/src/plugin/__fixtures__/release-model-ids.js +0 -1
- package/dist/src/plugin/__fixtures__/release-model-ids.js.map +1 -1
- package/dist/src/plugin/__fixtures__/verified-store.js +2 -2
- package/dist/src/plugin/account-access.js +1 -1
- package/dist/src/plugin/request.d.ts.map +1 -1
- package/dist/src/plugin/request.js +3 -2
- package/dist/src/plugin/request.js.map +1 -1
- package/dist/src/plugin/shared/request-services.d.ts +1 -1
- package/dist/src/plugin/shared/request-services.js +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 +4 -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 +69 -0
- package/dist/types/src/common-auth-embedded/limits/decide.d.ts +146 -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 +59 -0
- package/dist/types/src/common-auth-embedded/limits/marker.d.ts +69 -0
- package/dist/types/src/common-auth-embedded/limits/request-history.d.ts +79 -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 +4 -3
- package/dist/types/src/common-auth-embedded/opencode2/types.d.ts +113 -11
- 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 +13 -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/request.d.ts.map +1 -1
- package/dist/types/src/plugin/shared/request-services.d.ts +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 +3 -3
- 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 +4 -0
- package/src/common-auth-embedded/claustrum/roster.js +34 -8
- 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/file-read-cache.js +10 -5
- 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 +69 -0
- package/src/common-auth-embedded/limits/decide.d.ts +146 -0
- package/src/common-auth-embedded/limits/duration.d.ts +8 -0
- package/src/common-auth-embedded/limits/families.d.ts +59 -0
- package/src/common-auth-embedded/limits/marker.d.ts +69 -0
- package/src/common-auth-embedded/limits/request-history.d.ts +79 -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 +4 -3
- package/src/common-auth-embedded/opencode2/install.js +219 -27
- package/src/common-auth-embedded/opencode2/types.d.ts +113 -11
- 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/setup/enroll.js +7 -1
- package/src/common-auth-embedded/source-output.json +260 -124
- 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 +13 -0
- package/src/common-auth-embedded/store/limits-namespace.js +46 -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,4 +1,5 @@
|
|
|
1
1
|
import { PoolOperationError } from './errors.js';
|
|
2
|
+
import { runInsideCodec } from './hooks.js';
|
|
2
3
|
import { toFailure, withTransaction, } from './mutate.js';
|
|
3
4
|
import { LockStack } from './refresh-lock.js';
|
|
4
5
|
import { refusal, requireBound, unknownRow, } from './runtime.js';
|
|
@@ -31,8 +32,8 @@ export function assertQuotaRow(id, attribution, row) {
|
|
|
31
32
|
});
|
|
32
33
|
}
|
|
33
34
|
export function mergedQuota(ctx, id, stored, observation) {
|
|
34
|
-
const merged = ctx.codec.merge(stored, observation);
|
|
35
|
-
if (!ctx.codec.validate(merged))
|
|
35
|
+
const merged = runInsideCodec(() => ctx.codec.merge(stored, observation));
|
|
36
|
+
if (!runInsideCodec(() => ctx.codec.validate(merged)))
|
|
36
37
|
throw refusal('pull', id, 'invalid-quota', 'the quota codec rejected the merged map');
|
|
37
38
|
return merged;
|
|
38
39
|
}
|
|
@@ -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, PoolLimitsWriteOptions, } 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,13 @@
|
|
|
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
|
+
/** Publication bookkeeping runs under the same locks as the namespace merge. */
|
|
7
|
+
export interface PoolLimitsWriteOptions {
|
|
8
|
+
readonly beforePublish?: () => void;
|
|
9
|
+
/** Runs once publication happened, even if a later step fails. Must not throw. */
|
|
10
|
+
readonly onPublished?: () => void;
|
|
11
|
+
}
|
|
12
|
+
/** A namespace merge and its check of current row bindings share one locked config snapshot. */
|
|
13
|
+
export declare function updatePoolLimitsNamespace(rt: StoreRuntime, mutator: PoolLimitsMutator, options?: PoolLimitsWriteOptions): Promise<void>;
|
|
@@ -0,0 +1,46 @@
|
|
|
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, options = {}) {
|
|
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
|
+
try {
|
|
26
|
+
await writeJsonAtomic(ctx.configPath, config, {
|
|
27
|
+
beforeRename: async () => {
|
|
28
|
+
await ctx.onStep?.('before-config-write', info);
|
|
29
|
+
await locks.assertAll();
|
|
30
|
+
options.beforePublish?.();
|
|
31
|
+
},
|
|
32
|
+
});
|
|
33
|
+
}
|
|
34
|
+
catch (error) {
|
|
35
|
+
if (error &&
|
|
36
|
+
typeof error === 'object' &&
|
|
37
|
+
'published' in error &&
|
|
38
|
+
error.published === true)
|
|
39
|
+
options.onPublished?.();
|
|
40
|
+
throw error;
|
|
41
|
+
}
|
|
42
|
+
progress.writes++;
|
|
43
|
+
options.onPublished?.();
|
|
44
|
+
await ctx.onStep?.('after-config-write', info);
|
|
45
|
+
});
|
|
46
|
+
}
|
|
@@ -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, options?: import('./limits-namespace.js').PoolLimitsWriteOptions): 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, options) => updatePoolLimitsNamespace(rt, mutator, options),
|
|
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 () => {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"release-model-ids.d.ts","sourceRoot":"","sources":["../../../../src/plugin/__fixtures__/release-model-ids.ts"],"names":[],"mappings":"AACA,eAAO,MAAM,iBAAiB,
|
|
1
|
+
{"version":3,"file":"release-model-ids.d.ts","sourceRoot":"","sources":["../../../../src/plugin/__fixtures__/release-model-ids.ts"],"names":[],"mappings":"AACA,eAAO,MAAM,iBAAiB,UAO7B,CAAA"}
|
|
@@ -3,7 +3,6 @@ export const RELEASE_MODEL_IDS = [
|
|
|
3
3
|
'antigravity-claude-opus-5-5',
|
|
4
4
|
'antigravity-claude-sonnet-5-5',
|
|
5
5
|
'antigravity-gemini-3.1-flash-image',
|
|
6
|
-
'antigravity-gemini-3.5-flash',
|
|
7
6
|
'antigravity-gemini-3.8-flash',
|
|
8
7
|
'antigravity-gemini-4-argon',
|
|
9
8
|
'antigravity-gpt-oss-120b-medium',
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"release-model-ids.js","sourceRoot":"","sources":["../../../../src/plugin/__fixtures__/release-model-ids.ts"],"names":[],"mappings":"AAAA,wGAAwG;AACxG,MAAM,CAAC,MAAM,iBAAiB,GAAG;IAC/B,6BAA6B;IAC7B,+BAA+B;IAC/B,oCAAoC;IACpC,8BAA8B;IAC9B,
|
|
1
|
+
{"version":3,"file":"release-model-ids.js","sourceRoot":"","sources":["../../../../src/plugin/__fixtures__/release-model-ids.ts"],"names":[],"mappings":"AAAA,wGAAwG;AACxG,MAAM,CAAC,MAAM,iBAAiB,GAAG;IAC/B,6BAA6B;IAC7B,+BAA+B;IAC/B,oCAAoC;IACpC,8BAA8B;IAC9B,4BAA4B;IAC5B,iCAAiC;CAClC,CAAA"}
|
|
@@ -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.38.0',
|
|
8
|
+
tarballSha256: 'bbe2dc4c05145544beceac22282c3cc1fde9e6fbfcaa04452790cc9a6cc20557',
|
|
9
9
|
};
|
|
10
10
|
async function filesBelow(root, dir) {
|
|
11
11
|
const out = [];
|
|
@@ -146,7 +146,7 @@ export function extractAccountAccessErrorDetails(bodyText) {
|
|
|
146
146
|
};
|
|
147
147
|
}
|
|
148
148
|
export function buildAccountAccessProbeRequest(projectId) {
|
|
149
|
-
const wireModel = 'gemini-3.
|
|
149
|
+
const wireModel = 'gemini-3.8-flash-low';
|
|
150
150
|
const request = {
|
|
151
151
|
contents: [{ role: 'user', parts: [{ text: 'ping' }] }],
|
|
152
152
|
generationConfig: { maxOutputTokens: 1, temperature: 0 },
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"request.d.ts","sourceRoot":"","sources":["../../../src/plugin/request.ts"],"names":[],"mappings":"AAsBA,OAAO,EACL,KAAK,wBAAwB,E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AG,EAAE,cAAc,MAAM;4CAEzB,GAAG,EAAE,cAAc,MAAM;;;sDAIf,GAAG,EAAE,OAAO,MAAM;sDAElB,GAAG,EAAE,OAAO,MAAM;;;;;CAMrE,CAAA"}
|
|
@@ -97,6 +97,7 @@ function getAgyMaxOutputTokens(model) {
|
|
|
97
97
|
if (native)
|
|
98
98
|
return native.maxOutputTokens;
|
|
99
99
|
const lower = model.toLowerCase();
|
|
100
|
+
// Keep output limits when reading old requests, including retired routes.
|
|
100
101
|
if (lower === 'gemini-3.5-flash-low' ||
|
|
101
102
|
lower === 'gemini-3.5-flash-extra-low' ||
|
|
102
103
|
lower === 'gemini-3-flash-agent' ||
|
|
@@ -1223,8 +1224,8 @@ function prepareAntigravityRequestIn(wire, input, init, accessToken, projectId,
|
|
|
1223
1224
|
// OpenCode runs title generation through the active model. Route that
|
|
1224
1225
|
// text-only helper call away from image generation to avoid consuming
|
|
1225
1226
|
// image quota and writing unrelated image files.
|
|
1226
|
-
effectiveModel = 'gemini-3.
|
|
1227
|
-
tierThinkingBudget =
|
|
1227
|
+
effectiveModel = 'gemini-3.8-flash-low';
|
|
1228
|
+
tierThinkingBudget = 1000;
|
|
1228
1229
|
tierThinkingLevel = undefined;
|
|
1229
1230
|
}
|
|
1230
1231
|
const rawGenerationConfig = requestPayload.generationConfig;
|