@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,7 +1,7 @@
|
|
|
1
1
|
import type { ChooseAccountResult, HeaderEdits, InstallOpenCode2AuthOptions, OpenCode2AuthAdapter, OpenCode2AuthInstallation, OpenCode2HookContext } from './types.js';
|
|
2
2
|
export declare const DEFAULT_MAX_RECORDS = 512;
|
|
3
|
-
/**
|
|
4
|
-
export declare const MAX_RETRY_HOLD_MS
|
|
3
|
+
/** Allow a one-hour cache lifetime plus the maximum session jitter. */
|
|
4
|
+
export declare const MAX_RETRY_HOLD_MS = 3621000;
|
|
5
5
|
/**
|
|
6
6
|
* The request header `model.request` sets to the attempt it started. The
|
|
7
7
|
* host builds the HTTP request and the WebSocket handshake from the headers
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import type { Plugin } from '@opencode/plugin';
|
|
2
2
|
import type { SessionRequestKind, SessionRetryDecision } from '@opencode/plugin/promise/session';
|
|
3
|
+
import type { WaitCheckpoint } from '../limits/decide.js';
|
|
3
4
|
/** The parts of the OpenCode 2 plugin context the installer uses. */
|
|
4
5
|
export type OpenCode2HookContext = {
|
|
5
6
|
readonly session: Pick<Plugin.Context['session'], 'hook'>;
|
|
@@ -35,6 +36,8 @@ export interface EventVerdict<Q> {
|
|
|
35
36
|
readonly outputStarted?: boolean;
|
|
36
37
|
readonly quota?: Q;
|
|
37
38
|
readonly limit?: LimitSignal;
|
|
39
|
+
/** Applies only to this attempt, after ownership and attribution checks. */
|
|
40
|
+
readonly hostRetry?: RetryDisposition['hostRetry'];
|
|
38
41
|
/**
|
|
39
42
|
* This is the last event of the response (completed or failed); the
|
|
40
43
|
* attempt ends here. On WebSocket this is the only way an attempt ends
|
|
@@ -55,6 +58,16 @@ export type HeaderEdits = Readonly<Record<string, string | null>>;
|
|
|
55
58
|
export interface ChooseAccountInput extends RequestScope {
|
|
56
59
|
/** The retry hook's advance choice (which may hold), or a request's own choice. */
|
|
57
60
|
readonly phase: 'retry' | 'request';
|
|
61
|
+
/** Retry hook draft's attempt count; also carried by a consumed hold's wake. */
|
|
62
|
+
readonly hostAttempt?: number;
|
|
63
|
+
/** Revalidate the held account before dispatch, even if the target is not due. */
|
|
64
|
+
readonly wake?: RetryWake;
|
|
65
|
+
/**
|
|
66
|
+
* Accounts refused by earlier reroutes of this logical request. Absent means
|
|
67
|
+
* empty. Holds and wakes do not exclude the held account. A snapshot, not a
|
|
68
|
+
* live set; supplied whether or not enforcement is enabled.
|
|
69
|
+
*/
|
|
70
|
+
readonly excluded?: readonly string[];
|
|
58
71
|
/**
|
|
59
72
|
* The account of the attempt this one retries, when the retry hook just
|
|
60
73
|
* asked the host to retry an attempt of this session and kind; otherwise
|
|
@@ -75,19 +88,43 @@ export interface ChooseAccountInput extends RequestScope {
|
|
|
75
88
|
export interface AccountRequest extends RequestScope {
|
|
76
89
|
readonly accountId: string;
|
|
77
90
|
}
|
|
91
|
+
/** The held account is ChooseAccountInput.previousAccountId. */
|
|
92
|
+
export interface RetryWake {
|
|
93
|
+
readonly target: number;
|
|
94
|
+
readonly checkpoint?: WaitCheckpoint;
|
|
95
|
+
/** Terminal quota waits do not require the session's provider prompt-cache TTL. */
|
|
96
|
+
readonly kind?: 'hold' | 'terminal';
|
|
97
|
+
}
|
|
78
98
|
/** An explicit retry on the refused account, without moving its routing pin. */
|
|
79
99
|
export interface RetryHold {
|
|
80
100
|
readonly hold: {
|
|
81
101
|
/**
|
|
82
102
|
* Adapter-computed wait in milliseconds, including per-session jitter.
|
|
83
|
-
* Finite, non-negative values
|
|
84
|
-
*
|
|
103
|
+
* Finite, non-negative values up to MAX_RETRY_HOLD_MS (3_621_000) are
|
|
104
|
+
* accepted. Larger or invalid values keep the host's decision and release
|
|
105
|
+
* the choice rather than dispatching before the requested wait has elapsed.
|
|
85
106
|
*/
|
|
86
107
|
readonly delayMs: number;
|
|
108
|
+
/** An absolute wake target; its presence forces a request-phase re-check. */
|
|
109
|
+
readonly target?: number;
|
|
110
|
+
readonly checkpoint?: WaitCheckpoint;
|
|
111
|
+
/** Forwarded to wake.kind so terminal quota waits omit the cache bound. */
|
|
112
|
+
readonly kind?: RetryWake['kind'];
|
|
87
113
|
};
|
|
88
114
|
}
|
|
89
|
-
/**
|
|
90
|
-
export
|
|
115
|
+
/** Leave the host's retry decision alone, or forbid replay of this attempt. */
|
|
116
|
+
export interface RetryDisposition {
|
|
117
|
+
readonly hostRetry: 'leave' | 'veto';
|
|
118
|
+
}
|
|
119
|
+
/** Wait through one host retry, then choose afresh without reserving an account. */
|
|
120
|
+
export interface RetryWaitThenReselect {
|
|
121
|
+
readonly waitThenReselect: {
|
|
122
|
+
/** Same finite, non-negative delay bound as RetryHold.hold.delayMs. */
|
|
123
|
+
readonly delayMs: number;
|
|
124
|
+
};
|
|
125
|
+
}
|
|
126
|
+
/** Non-string choices are valid only in phase `retry`, after an account limit. */
|
|
127
|
+
export type ChooseAccountResult = string | RetryHold | RetryDisposition | RetryWaitThenReselect | undefined;
|
|
91
128
|
/**
|
|
92
129
|
* One physical send: created when an account is chosen for a request, and
|
|
93
130
|
* handed back on every hook call and event that belongs to that send, so a
|
|
@@ -194,7 +231,7 @@ export interface SameAccountRetryResult {
|
|
|
194
231
|
* quota reading type; the installer only carries it to the `quota` event.
|
|
195
232
|
* `A` is the plugin's per-attempt value (see `Attempt`).
|
|
196
233
|
* `Choice` defaults to the legacy ID-only result so existing adapters' direct
|
|
197
|
-
* callers still see IDs. Opt into
|
|
234
|
+
* callers still see IDs. Opt into retry directives with `ChooseAccountResult`.
|
|
198
235
|
*/
|
|
199
236
|
export interface OpenCode2AuthAdapter<Q = unknown, A = unknown, Choice extends ChooseAccountResult = string | undefined> {
|
|
200
237
|
/** Every hook is scoped to this provider; other providers are untouched. */
|
|
@@ -209,11 +246,24 @@ export interface OpenCode2AuthAdapter<Q = unknown, A = unknown, Choice extends C
|
|
|
209
246
|
* After a limit before any output, the retry hook makes this call itself,
|
|
210
247
|
* with `phase: 'retry'` and `rerouteFrom` set. Every returned account,
|
|
211
248
|
* including the refused one, is kept for the next attempt of that session
|
|
212
|
-
* and kind: it does not choose again
|
|
249
|
+
* and kind: it does not choose again, except for a hold with a target.
|
|
250
|
+
* Another account retries at once;
|
|
213
251
|
* the refused account keeps the host's decision and wait. `{ hold: { delayMs } }`
|
|
214
252
|
* commits the refused account without changing its pin and replaces the host's
|
|
215
253
|
* wait, even its no-retry decision, only for a recognised account limit before
|
|
216
|
-
* output in
|
|
254
|
+
* output in a session with no foreign transport. A hold with a target releases its queued
|
|
255
|
+
* choice and calls again in phase `request` with `wake` and `hostAttempt`
|
|
256
|
+
* before fetching account headers. The adapter must check that the account
|
|
257
|
+
* is still eligible, still represents the same login, is still available
|
|
258
|
+
* from the credential store and has any required provider prompt-cache TTL
|
|
259
|
+
* remaining, then choose normally if invalid.
|
|
260
|
+
* A hold without a target takes the queued account as before.
|
|
261
|
+
* `{ hostRetry: 'veto' }` forbids replay; `'leave'` preserves the host's decision
|
|
262
|
+
* without reserving an account. `{ waitThenReselect: { delayMs } }` asks for one
|
|
263
|
+
* delayed host retry, then chooses afresh. It commits no account or routing pin.
|
|
264
|
+
* Like holds, its delay must fit MAX_RETRY_HOLD_MS and the host retry budget.
|
|
265
|
+
* These directives obey the same ownership, attribution and output fences.
|
|
266
|
+
* Non-string choices returned in phase `request` cannot
|
|
217
267
|
* select an account and are treated as undefined. `undefined` or a
|
|
218
268
|
* throw commits nothing: the host decides, and the next attempt chooses
|
|
219
269
|
* with `phase: 'request'`, `previousAccountId` and no `rerouteFrom`.
|
|
@@ -222,7 +272,8 @@ export interface OpenCode2AuthAdapter<Q = unknown, A = unknown, Choice extends C
|
|
|
222
272
|
/**
|
|
223
273
|
* Releases a kept retry choice that will not be used: no retry, a changed
|
|
224
274
|
* model or agent, cancellation of a queued retry (session idle), session forgetting/deletion,
|
|
225
|
-
* disposal
|
|
275
|
+
* disposal, record eviction or a targeted hold's wake re-check. A hold
|
|
276
|
+
* releases the refused account's choice.
|
|
226
277
|
* Called once with the original choose input plus its returned accountId,
|
|
227
278
|
* never for a used choice. Awaited before any later chooseAccount for the
|
|
228
279
|
* same session; errors are logged and swallowed. A model/agent change
|
|
@@ -264,6 +315,21 @@ export interface OpenCode2AuthAdapter<Q = unknown, A = unknown, Choice extends C
|
|
|
264
315
|
readonly response: Response;
|
|
265
316
|
readonly attempt: Attempt<A>;
|
|
266
317
|
}): Promise<Response | undefined> | Response | undefined;
|
|
318
|
+
/**
|
|
319
|
+
* Optional retry policy for the final HTTP response. Runs immediately after
|
|
320
|
+
* `rewriteResponse` (or on the unchanged response when no rewrite is returned).
|
|
321
|
+
* Return `veto` to forbid host replay of a refusal the adapter formatted,
|
|
322
|
+
* even without a recognised limit. A veto is sticky for this attempt.
|
|
323
|
+
* Ownership and attribution checks still run first: a veto cannot affect a
|
|
324
|
+
* foreign request, a session with mixed ownership, or a retry whose attempt is
|
|
325
|
+
* ambiguous. `leave` or `undefined` preserves the existing retry policy,
|
|
326
|
+
* including an earlier veto.
|
|
327
|
+
*/
|
|
328
|
+
responseRetry?(input: AccountRequest & {
|
|
329
|
+
readonly request: Request;
|
|
330
|
+
readonly response: Response;
|
|
331
|
+
readonly attempt: Attempt<A>;
|
|
332
|
+
}): Promise<'leave' | 'veto' | undefined> | 'leave' | 'veto' | undefined;
|
|
267
333
|
/**
|
|
268
334
|
* Optional. For an adapter whose own sender can move a request to another
|
|
269
335
|
* account after `rewriteRequest` (a bridge that answers a 401 or 403 by
|
|
@@ -435,6 +501,24 @@ export interface InstallOpenCode2AuthOptions {
|
|
|
435
501
|
readonly hostCredentials?: readonly string[];
|
|
436
502
|
/** Most attempts kept before the oldest is abandoned and dropped. */
|
|
437
503
|
readonly maxRecords?: number;
|
|
504
|
+
/**
|
|
505
|
+
* Host retry budget, default 10. When hostAttempt leaves no retry available,
|
|
506
|
+
* limit holds and reroutes keep the host's decision and release their choice.
|
|
507
|
+
*/
|
|
508
|
+
readonly hostRetryLimit?: number;
|
|
509
|
+
/**
|
|
510
|
+
* Reject chooser results naming a request-excluded account (default false).
|
|
511
|
+
* A rejected choice warns and acts like undefined: the host decides in retry,
|
|
512
|
+
* and request selection stops with no-account. Without this option, chooser
|
|
513
|
+
* results retain their existing meaning.
|
|
514
|
+
*
|
|
515
|
+
* The host supplies no logical request id. The first later attempt of the
|
|
516
|
+
* same session and kind consumes a queued retry's exclusions. If another
|
|
517
|
+
* attempt is in flight, that binding warns but keeps the exclusions. A new
|
|
518
|
+
* concurrent request can therefore inherit them; if it consumes the retry
|
|
519
|
+
* first, the actual retry instead starts a fresh token without them.
|
|
520
|
+
*/
|
|
521
|
+
readonly enforceRequestExclusion?: boolean;
|
|
438
522
|
readonly logger?: OpenCode2AuthLogger;
|
|
439
523
|
}
|
|
440
524
|
/**
|
|
@@ -449,13 +533,15 @@ export interface InstallOpenCode2AuthOptions {
|
|
|
449
533
|
* (its wait, or its refusal to retry) stands and the next attempt may go
|
|
450
534
|
* to the refused account again;
|
|
451
535
|
* - `hold`: an explicit adapter wait on the refused account, before output;
|
|
536
|
+
* - `wait-then-reselect`: wait without reserving the next account;
|
|
537
|
+
* - `adapter-veto`: the attributed adapter disposition forbids host replay;
|
|
452
538
|
* - `same-account`: the adapter requested immediate recovery on the same route,
|
|
453
539
|
* without account selection, before output;
|
|
454
540
|
* - `host-decides`: no limit was recognised, or the failing call cannot be
|
|
455
541
|
* attributed safely (ambiguous attempts or mixed ownership in a gated
|
|
456
542
|
* session), so the host's decision stands.
|
|
457
543
|
*/
|
|
458
|
-
export type RetryReason = 'reroute' | 'hold' | 'same-account' | 'output-started' | 'no-account' | 'host-decides-last-account' | 'host-decides';
|
|
544
|
+
export type RetryReason = 'reroute' | 'hold' | 'wait-then-reselect' | 'adapter-veto' | 'same-account' | 'output-started' | 'no-account' | 'host-decides-last-account' | 'host-decides';
|
|
459
545
|
/**
|
|
460
546
|
* The hook that picked an account. Normally `model.request`; a transport hook
|
|
461
547
|
* picks only when the host skipped `model.request` for that request, which a
|
|
@@ -23,11 +23,16 @@ export interface AdmissionInput extends ExclusionInputs {
|
|
|
23
23
|
scope?: string;
|
|
24
24
|
/** Labels the scope requires an entry for; defaults to `['primary']`. */
|
|
25
25
|
requiredLabels?: readonly string[];
|
|
26
|
+
/**
|
|
27
|
+
* One-dispatch exemptions keyed by row; waive only gate 4. The caller first
|
|
28
|
+
* validates the current account incarnation and checkpointed reset times.
|
|
29
|
+
*/
|
|
30
|
+
liftedWindows?: ReadonlyMap<string, readonly WindowRef[]>;
|
|
26
31
|
now: number;
|
|
27
32
|
/**
|
|
28
|
-
* Called synchronously
|
|
33
|
+
* Called synchronously once per row needing a pull, including lifted windows.
|
|
29
34
|
* Its return value is ignored and never awaited, so a pull the caller
|
|
30
|
-
* starts from here cannot delay
|
|
35
|
+
* starts from here cannot delay admission or a refusal.
|
|
31
36
|
*/
|
|
32
37
|
requestPull?: (rowId: string) => void;
|
|
33
38
|
}
|
|
@@ -12,6 +12,14 @@ export interface AskRoutingInput<Candidate extends RoutingCandidate = RoutingCan
|
|
|
12
12
|
candidates: readonly Candidate[];
|
|
13
13
|
/** Defaults to 500 ms, clamped to 1–2000 ms. */
|
|
14
14
|
deadlineMs?: number;
|
|
15
|
+
/**
|
|
16
|
+
* Longest same-account hold, in seconds, that routing may advise. The
|
|
17
|
+
* holdWaitMaxS helper from `./limits` caps it by the setting and the current
|
|
18
|
+
* account's cache expiry, returning 0 when there is no accepted prompt cache
|
|
19
|
+
* worth waiting for. Fractions are floored and negatives become 0. Omit it to leave
|
|
20
|
+
* routing's default cap in force.
|
|
21
|
+
*/
|
|
22
|
+
holdWaitMaxS?: number;
|
|
15
23
|
}
|
|
16
24
|
export interface RoutingHold {
|
|
17
25
|
/** Uncapped advice from routing. The plugin must apply its own hold cap. */
|
|
@@ -39,9 +47,11 @@ export type ReportRoutingInput = RoutingReportIdentity & ({
|
|
|
39
47
|
/** The exhausted quota window; keep scoped quota groups in `pool`. */
|
|
40
48
|
window: '5h' | '7d';
|
|
41
49
|
/**
|
|
42
|
-
* Scoped quota group, such as `
|
|
43
|
-
* Must
|
|
44
|
-
*
|
|
50
|
+
* Scoped quota group, such as Antigravity's `3p` or `gemini`.
|
|
51
|
+
* Must match `^[a-z0-9._-]{1,64}$`. Routing compares names exactly, so
|
|
52
|
+
* callers must lowercase names from elsewhere (e.g. `Fable` to `fable`).
|
|
53
|
+
* Names are never rewritten here. Omit or pass `undefined` to block the
|
|
54
|
+
* whole account; include to block only this pool.
|
|
45
55
|
*/
|
|
46
56
|
pool?: string;
|
|
47
57
|
/** Optional reset time in epoch milliseconds. */
|
|
@@ -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
|
}
|
|
@@ -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>;
|
|
@@ -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
|
|
@@ -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>;
|
|
@@ -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,cAA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;;;;;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,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;AAE7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AAE,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"}
|
|
@@ -55,6 +55,11 @@ export interface RuntimeLayoutLogger {
|
|
|
55
55
|
info(message: string, meta?: Record<string, unknown>): unknown;
|
|
56
56
|
warn(message: string, meta?: Record<string, unknown>): unknown;
|
|
57
57
|
}
|
|
58
|
+
interface OldFileCleanupIO {
|
|
59
|
+
platform: NodeJS.Platform;
|
|
60
|
+
readFile(path: string): Promise<Buffer>;
|
|
61
|
+
unlink(path: string): Promise<void>;
|
|
62
|
+
}
|
|
58
63
|
export interface RuntimeLayoutOptions {
|
|
59
64
|
/** This build's version, for the version fence. */
|
|
60
65
|
version: string;
|
|
@@ -74,8 +79,8 @@ export interface RuntimeLayoutOptions {
|
|
|
74
79
|
*/
|
|
75
80
|
destinationPrivate?: (dir: string) => Promise<boolean>;
|
|
76
81
|
/**
|
|
77
|
-
* Test seams
|
|
78
|
-
*
|
|
82
|
+
* Test seams for the move. A step callback that throws stands in for a
|
|
83
|
+
* crash there: nothing after it runs.
|
|
79
84
|
*/
|
|
80
85
|
steps?: {
|
|
81
86
|
afterManifest?: () => void | Promise<void>;
|
|
@@ -87,6 +92,8 @@ export interface RuntimeLayoutOptions {
|
|
|
87
92
|
* check that guards it.
|
|
88
93
|
*/
|
|
89
94
|
beforeRemove?: (path: string) => void | Promise<void>;
|
|
95
|
+
/** Isolate old-copy comparison/removal from OS sharing races in tests. */
|
|
96
|
+
oldFileIO?: OldFileCleanupIO;
|
|
90
97
|
};
|
|
91
98
|
/** Test seam: how long to wait for the layout lock. */
|
|
92
99
|
layoutLockWaitMs?: number;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"runtime-layout.d.ts","sourceRoot":"","sources":["../../../src/runtime-layout.ts"],"names":[],"mappings":"AAiJA,OAAO,EACL,KAAK,kBAAkB,EAUvB,KAAK,aAAa,EAQnB,MAAM,iBAAiB,CAAA;AACxB,OAAO,EAAE,KAAK,kBAAkB,EAAoB,MAAM,iBAAiB,CAAA;AAE3E,YAAY,EAAE,aAAa,EAAE,CAAA;AAM7B,yEAAyE;AACzE,eAAO,MAAM,wBAAwB,mBAAmB,CAAA;AACxD,4EAA4E;AAC5E,eAAO,MAAM,4BAA4B,uBAAuB,CAAA;AAEhE;;;;GAIG;AACH,eAAO,MAAM,2BAA2B,mCAAmC,CAAA;AAK3E;;;;;;GAMG;AACH,eAAO,MAAM,gBAAgB,8IAMnB,CAAA;AA8CV,yEAAyE;AACzE,eAAO,MAAM,+BAA+B,4IAC+F,CAAA;AAE3I;;;;GAIG;AACH,eAAO,MAAM,8BAA8B,8IACkG,CAAA;AAE7I;;;;GAIG;AACH,eAAO,MAAM,iCAAiC,8MAC+J,CAAA;AAE7M;;;;;GAKG;AACH,qBAAa,oBAAqB,SAAQ,KAAK;IAE3C,QAAQ,CAAC,QAAQ,EAAE,MAAM;IACzB,QAAQ,CAAC,UAAU,EAAE,MAAM;gBADlB,QAAQ,EAAE,MAAM,EAChB,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AmB,CACvC,MAAM,EAAE,+BAA+B,EACvC,OAAO,EAAE,oBAAoB,GAC5B,OAAO,CAAC,IAAI,CAAC,CAWf;AAED,wBAAsB,iBAAiB,CACrC,IAAI,EAAE,eAAe,EACrB,eAAe,EAAE,MAAM,OAAO,CAAC,MAAM,CAAC,EACtC,UAAU,UAAQ,GACjB,OAAO,CAAC,WAAW,CAAC,CAoVtB;AAED,2FAA2F;AAC3F,wBAAsB,cAAc,CAClC,IAAI,EAAE,MAAM,EAAE,EACd,IAAI,EAAE,eAAe,EACrB,eAAe,EAAE,MAAM,OAAO,CAAC,MAAM,CAAC,EACtC,EAAE,GAAE,OAAY,GACf,OAAO,CAAC,IAAI,CAAC,CAOf"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@cortexkit/opencode-antigravity-auth",
|
|
3
|
-
"version": "3.0.
|
|
3
|
+
"version": "3.0.30",
|
|
4
4
|
"description": "Google Antigravity OAuth auth plugin for OpenCode - access Gemini and Claude models using Google credentials",
|
|
5
5
|
"main": "./dist/index.js",
|
|
6
6
|
"types": "./dist/index.d.ts",
|
|
@@ -130,7 +130,7 @@
|
|
|
130
130
|
"dependencies": {
|
|
131
131
|
"@cortexkit/claustrum-client": "0.12.0",
|
|
132
132
|
"@cortexkit/subc-client": "0.22.5",
|
|
133
|
-
"@cortexkit/antigravity-auth-core": "3.0.
|
|
133
|
+
"@cortexkit/antigravity-auth-core": "3.0.30",
|
|
134
134
|
"@cortexkit/private-files": "0.2.2",
|
|
135
135
|
"jsonc-parser": "^3.3.1",
|
|
136
136
|
"xdg-basedir": "^5.1.0",
|
|
@@ -6,6 +6,7 @@ import { type ClaustrumLogger } from './errors.js';
|
|
|
6
6
|
import type { CustodyLease } from './hub.js';
|
|
7
7
|
import { type InsulaQuotaOptions, type InsulaQuotaResult } from './insula.js';
|
|
8
8
|
import { type AccountMapper, type ProjectionOptions, type QuotaReceipt, type ReorderVaultRosterResult, type VaultRosterFile } from './roster.js';
|
|
9
|
+
import type { ClaustrumUsageReading, ClaustrumUsageReportState } from './usage.js';
|
|
9
10
|
import { type WatchMode } from './watch.js';
|
|
10
11
|
export interface ClaustrumConsumerOptions<Q = QuotaObservation> {
|
|
11
12
|
/**
|
|
@@ -229,6 +230,17 @@ export declare class ClaustrumConsumer<Q = QuotaObservation> {
|
|
|
229
230
|
* poll, and a route whose credential or account changed is refused.
|
|
230
231
|
*/
|
|
231
232
|
authorize(routeId: string, signal?: AbortSignal): Promise<ClaustrumScopedAttempt>;
|
|
233
|
+
/**
|
|
234
|
+
* Queue reply quota metadata without waiting or throwing. Pass rate-limit
|
|
235
|
+
* headers only, never tokens: the library does not filter header names.
|
|
236
|
+
* The credential must have been served by this host and still belong to the route.
|
|
237
|
+
*/
|
|
238
|
+
reportUsage(input: {
|
|
239
|
+
routeId: string;
|
|
240
|
+
credentialId: string;
|
|
241
|
+
reading: ClaustrumUsageReading;
|
|
242
|
+
}): void;
|
|
243
|
+
usageReportState(): ClaustrumUsageReportState;
|
|
232
244
|
reportFailure(attempt: ClaustrumScopedAttempt, status: number, source: ClaustrumReporterSource): Promise<void>;
|
|
233
245
|
/**
|
|
234
246
|
* Send on a vault route. `dispatch` builds and sends the request with the
|
|
@@ -738,6 +738,42 @@ export class ClaustrumConsumer {
|
|
|
738
738
|
combined.dispose();
|
|
739
739
|
}
|
|
740
740
|
}
|
|
741
|
+
/**
|
|
742
|
+
* Queue reply quota metadata without waiting or throwing. Pass rate-limit
|
|
743
|
+
* headers only, never tokens: the library does not filter header names.
|
|
744
|
+
* The credential must have been served by this host and still belong to the route.
|
|
745
|
+
*/
|
|
746
|
+
reportUsage(input) {
|
|
747
|
+
if (this.#shutdown.signal.aborted)
|
|
748
|
+
return;
|
|
749
|
+
try {
|
|
750
|
+
const row = this.#roster?.rows.find((row) => row.routeId === input.routeId);
|
|
751
|
+
if (!row?.enabled ||
|
|
752
|
+
row.state !== 'active' ||
|
|
753
|
+
(row.credentialId !== input.credentialId &&
|
|
754
|
+
!row.aliases?.includes(input.credentialId)))
|
|
755
|
+
return;
|
|
756
|
+
if (this.#hub) {
|
|
757
|
+
if (this.#lease && this.#hub.leaseLive(this.#lease))
|
|
758
|
+
this.#lease.custody.reportUsage(input);
|
|
759
|
+
}
|
|
760
|
+
else
|
|
761
|
+
this.#custody?.reportUsage(input);
|
|
762
|
+
}
|
|
763
|
+
catch {
|
|
764
|
+
// Quota bookkeeping must never reject a provider request.
|
|
765
|
+
}
|
|
766
|
+
}
|
|
767
|
+
usageReportState() {
|
|
768
|
+
try {
|
|
769
|
+
return ((this.#hub
|
|
770
|
+
? this.#lease?.custody
|
|
771
|
+
: this.#custody)?.usageReportState() ?? { pending: 0, inFlight: false, dropped: 0 });
|
|
772
|
+
}
|
|
773
|
+
catch {
|
|
774
|
+
return { pending: 0, inFlight: false, dropped: 0 };
|
|
775
|
+
}
|
|
776
|
+
}
|
|
741
777
|
async reportFailure(attempt, status, source) {
|
|
742
778
|
this.#assertOpen();
|
|
743
779
|
if (this.#hub) {
|
|
@@ -1,14 +1,15 @@
|
|
|
1
1
|
import { type ClaustrumClient, type ClaustrumReporterSource, type EnrollmentTokenFile } from '@cortexkit/claustrum-client';
|
|
2
2
|
import { type ClaustrumLogger } from './errors.js';
|
|
3
3
|
import type { InsulaUsageTransport } from './insula.js';
|
|
4
|
+
import { type ClaustrumUsageReading, type ClaustrumUsageReportState, type ScopedUsageSource } from './usage.js';
|
|
4
5
|
import { type ScopedWatchSource, type WatchMode } from './watch.js';
|
|
5
6
|
/**
|
|
6
|
-
*
|
|
7
|
-
*
|
|
7
|
+
* claustrum-client adds watchScoped in 0.12.0 and reportUsageScoped in 0.14.0.
|
|
8
|
+
* Older clients keep polling and simply do not send reply quota readings.
|
|
8
9
|
*/
|
|
9
10
|
export type ClaustrumScopedClient = Pick<ClaustrumClient, 'listScoped' | 'getScoped' | 'reportAuthFailureScoped' | 'close'> & {
|
|
10
11
|
insula?: InsulaUsageTransport;
|
|
11
|
-
} & ScopedWatchSource;
|
|
12
|
+
} & ScopedWatchSource & ScopedUsageSource;
|
|
12
13
|
/** The two credential types a plugin's family can hold; routing differs by type. */
|
|
13
14
|
export type VaultCredentialType = 'oauth' | 'api_key';
|
|
14
15
|
/**
|
|
@@ -332,7 +333,18 @@ export declare class ClaustrumScopedCustody {
|
|
|
332
333
|
* other mode the host keeps its usual list timer.
|
|
333
334
|
*/
|
|
334
335
|
watchRoster(options: ClaustrumRosterWatchOptions): ClaustrumRosterWatch;
|
|
336
|
+
/**
|
|
337
|
+
* Queue reply quota metadata and return synchronously. Pass rate-limit
|
|
338
|
+
* headers only, never tokens: the library does not filter header names.
|
|
339
|
+
* Only credentials served by this custody and retained in its roster report.
|
|
340
|
+
* Hosts managing their own roster must call retain() when that roster changes.
|
|
341
|
+
*/
|
|
342
|
+
reportUsage(input: {
|
|
343
|
+
credentialId: string;
|
|
344
|
+
reading: ClaustrumUsageReading;
|
|
345
|
+
}): void;
|
|
346
|
+
usageReportState(): ClaustrumUsageReportState;
|
|
335
347
|
close(): void;
|
|
336
|
-
/** Stop
|
|
348
|
+
/** Stop accepting work; give token reads and reply reports one shared 2 s drain. */
|
|
337
349
|
dispose(onTimeout?: (pendingOperations: number) => void): Promise<void>;
|
|
338
350
|
}
|