@cortexkit/opencode-antigravity-auth 3.0.10 → 3.0.12
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 +2077 -1451
- package/dist/cli.js.map +4 -4
- package/dist/cli.meta.json +207 -120
- package/dist/index.js +1526 -861
- package/dist/index.js.map +4 -4
- package/dist/index.meta.json +214 -127
- package/dist/server.js +1524 -859
- package/dist/server.js.map +4 -4
- package/dist/server.meta.json +1 -1
- package/dist/src/common-auth-embedded/claustrum/consumer.d.ts +7 -1
- package/dist/src/common-auth-embedded/claustrum/consumer.js +17 -2
- package/dist/src/common-auth-embedded/claustrum/enrollment.d.ts +5 -0
- package/dist/src/common-auth-embedded/claustrum/enrollment.js +27 -0
- package/dist/src/common-auth-embedded/claustrum/errors.d.ts +1 -1
- package/dist/src/common-auth-embedded/claustrum/index.d.ts +1 -1
- package/dist/src/common-auth-embedded/claustrum/index.js +1 -1
- package/dist/src/common-auth-embedded/claustrum/quota-writer.js +4 -54
- package/dist/src/common-auth-embedded/claustrum/roster.d.ts +31 -0
- package/dist/src/common-auth-embedded/claustrum/roster.js +72 -0
- package/dist/src/common-auth-embedded/commands/builtins.d.ts +37 -0
- package/dist/src/common-auth-embedded/commands/builtins.js +95 -13
- package/dist/src/common-auth-embedded/commands/index.d.ts +1 -1
- package/dist/src/common-auth-embedded/fs/private-files.d.ts +2 -0
- package/dist/src/common-auth-embedded/fs/private-files.js +49 -3
- package/dist/src/common-auth-embedded/opencode2/install.d.ts +3 -2
- package/dist/src/common-auth-embedded/opencode2/install.js +184 -63
- package/dist/src/common-auth-embedded/opencode2/types.d.ts +43 -6
- package/dist/src/common-auth-embedded/quota/pending.js +48 -0
- package/dist/src/common-auth-embedded/setup/enroll.d.ts +34 -0
- package/dist/src/common-auth-embedded/setup/enroll.js +116 -34
- package/dist/src/common-auth-embedded/setup/index.d.ts +1 -0
- package/dist/src/common-auth-embedded/setup/index.js +1 -0
- package/dist/src/common-auth-embedded/setup/process-fence.d.ts +7 -0
- package/dist/src/common-auth-embedded/setup/process-fence.js +56 -1
- package/dist/src/common-auth-embedded/setup/types.d.ts +5 -0
- package/dist/src/common-auth-embedded/source-output.json +121 -97
- package/dist/src/common-auth-embedded/store/attribution.d.ts +5 -0
- package/dist/src/common-auth-embedded/store/attribution.js +39 -25
- package/dist/src/common-auth-embedded/store/pool.d.ts +17 -0
- package/dist/src/common-auth-embedded/store/pool.js +18 -3
- package/dist/src/common-auth-embedded/store/pull.js +3 -1
- package/dist/src/common-auth-embedded/store/quota-writer.js +298 -0
- package/dist/src/common-auth-embedded/store/runtime.d.ts +2 -0
- package/dist/src/plugin/lifecycle.d.ts.map +1 -1
- package/dist/src/plugin/lifecycle.js +48 -27
- package/dist/src/plugin/lifecycle.js.map +1 -1
- package/dist/src/plugin/shared/request-services.d.ts.map +1 -1
- package/dist/src/plugin/shared/request-services.js +3 -2
- package/dist/src/plugin/shared/request-services.js.map +1 -1
- package/dist/src/plugin/vault-custody.d.ts.map +1 -1
- package/dist/src/plugin/vault-custody.js +13 -3
- package/dist/src/plugin/vault-custody.js.map +1 -1
- package/dist/tui-build-map.json +5 -5
- package/dist/tui-ga-build-map.json +1 -1
- package/dist/types/src/common-auth-embedded/claustrum/consumer.d.ts +7 -1
- package/dist/types/src/common-auth-embedded/claustrum/enrollment.d.ts +5 -0
- package/dist/types/src/common-auth-embedded/claustrum/errors.d.ts +1 -1
- package/dist/types/src/common-auth-embedded/claustrum/index.d.ts +1 -1
- package/dist/types/src/common-auth-embedded/claustrum/roster.d.ts +31 -0
- package/dist/types/src/common-auth-embedded/commands/builtins.d.ts +37 -0
- package/dist/types/src/common-auth-embedded/commands/index.d.ts +1 -1
- package/dist/types/src/common-auth-embedded/opencode2/install.d.ts +3 -2
- package/dist/types/src/common-auth-embedded/opencode2/types.d.ts +43 -6
- package/dist/types/src/common-auth-embedded/setup/enroll.d.ts +34 -0
- package/dist/types/src/common-auth-embedded/setup/index.d.ts +1 -0
- package/dist/types/src/common-auth-embedded/setup/process-fence.d.ts +7 -0
- package/dist/types/src/common-auth-embedded/setup/types.d.ts +5 -0
- package/dist/types/src/common-auth-embedded/store/attribution.d.ts +5 -0
- package/dist/types/src/common-auth-embedded/store/pool.d.ts +17 -0
- package/dist/types/src/common-auth-embedded/store/runtime.d.ts +2 -0
- package/dist/types/src/plugin/lifecycle.d.ts.map +1 -1
- package/dist/types/src/plugin/shared/request-services.d.ts.map +1 -1
- package/dist/types/src/plugin/vault-custody.d.ts.map +1 -1
- package/package.json +2 -2
- package/src/common-auth-embedded/claustrum/consumer.d.ts +7 -1
- package/src/common-auth-embedded/claustrum/consumer.js +17 -2
- package/src/common-auth-embedded/claustrum/enrollment.d.ts +5 -0
- package/src/common-auth-embedded/claustrum/enrollment.js +27 -0
- package/src/common-auth-embedded/claustrum/errors.d.ts +1 -1
- package/src/common-auth-embedded/claustrum/index.d.ts +1 -1
- package/src/common-auth-embedded/claustrum/index.js +1 -1
- package/src/common-auth-embedded/claustrum/quota-writer.js +4 -54
- package/src/common-auth-embedded/claustrum/roster.d.ts +31 -0
- package/src/common-auth-embedded/claustrum/roster.js +72 -0
- package/src/common-auth-embedded/commands/builtins.d.ts +37 -0
- package/src/common-auth-embedded/commands/builtins.js +95 -13
- package/src/common-auth-embedded/commands/index.d.ts +1 -1
- package/src/common-auth-embedded/fs/private-files.d.ts +2 -0
- package/src/common-auth-embedded/fs/private-files.js +49 -3
- package/src/common-auth-embedded/opencode2/install.d.ts +3 -2
- package/src/common-auth-embedded/opencode2/install.js +184 -63
- package/src/common-auth-embedded/opencode2/types.d.ts +43 -6
- package/src/common-auth-embedded/quota/pending.js +48 -0
- package/src/common-auth-embedded/setup/enroll.d.ts +34 -0
- package/src/common-auth-embedded/setup/enroll.js +116 -34
- package/src/common-auth-embedded/setup/index.d.ts +1 -0
- package/src/common-auth-embedded/setup/index.js +1 -0
- package/src/common-auth-embedded/setup/process-fence.d.ts +7 -0
- package/src/common-auth-embedded/setup/process-fence.js +56 -1
- package/src/common-auth-embedded/setup/types.d.ts +5 -0
- package/src/common-auth-embedded/source-output.json +121 -97
- package/src/common-auth-embedded/store/attribution.d.ts +5 -0
- package/src/common-auth-embedded/store/attribution.js +39 -25
- package/src/common-auth-embedded/store/pool.d.ts +17 -0
- package/src/common-auth-embedded/store/pool.js +18 -3
- package/src/common-auth-embedded/store/pull.js +3 -1
- package/src/common-auth-embedded/store/quota-writer.js +298 -0
- package/src/common-auth-embedded/store/runtime.d.ts +2 -0
- package/src/tui-compiled/common-auth-embedded/fs/private-files.js +49 -3
- package/src/tui-raw/common-auth-embedded/fs/private-files.js +49 -3
|
@@ -48,6 +48,43 @@ export interface RoutingSectionOptions {
|
|
|
48
48
|
*/
|
|
49
49
|
orderedVariants?: MenuChoice[];
|
|
50
50
|
formerMainId?: string;
|
|
51
|
+
/**
|
|
52
|
+
* The vault accounts' routing order, for a plugin that can run in vault
|
|
53
|
+
* mode. Called on each build; return the order while the plugin routes
|
|
54
|
+
* through vault accounts and undefined otherwise. While it returns one, the
|
|
55
|
+
* section shows and sets the vault accounts' order (by the name the menu
|
|
56
|
+
* shows for each account) instead of the pool roster's. Wire it to
|
|
57
|
+
* `ClaustrumConsumer.snapshot()` and `ClaustrumConsumer.reorder`, or to
|
|
58
|
+
* `readVaultRoster` and `reorderVaultRoster` for a plugin without a
|
|
59
|
+
* consumer.
|
|
60
|
+
*/
|
|
61
|
+
vaultOrder?: () => VaultRoutingOrder | undefined | Promise<VaultRoutingOrder | undefined>;
|
|
62
|
+
}
|
|
63
|
+
/**
|
|
64
|
+
* The order vault accounts are tried in, as the Routing section reads and
|
|
65
|
+
* sets it in vault mode. Shaped after `/claustrum`'s roster, without
|
|
66
|
+
* importing it, so the menu does not need the vault client.
|
|
67
|
+
*/
|
|
68
|
+
export interface VaultRoutingOrder {
|
|
69
|
+
/**
|
|
70
|
+
* Every vault roster row, in roster (routing) order: its route id and the
|
|
71
|
+
* name the plugin shows for that account (the roster row's `label`, or its
|
|
72
|
+
* email). Route ids are long and opaque, so the section shows and accepts
|
|
73
|
+
* labels; a route id is still accepted wherever a label is.
|
|
74
|
+
*/
|
|
75
|
+
rows: readonly {
|
|
76
|
+
id: string;
|
|
77
|
+
label: string;
|
|
78
|
+
}[];
|
|
79
|
+
/**
|
|
80
|
+
* Sets the order. `ids` are route ids, every one exactly once. Wire it to
|
|
81
|
+
* `ClaustrumConsumer.reorder` or `reorderVaultRoster`, which refuse any
|
|
82
|
+
* other list without writing.
|
|
83
|
+
*/
|
|
84
|
+
reorder(ids: readonly string[]): Promise<{
|
|
85
|
+
ids: readonly string[];
|
|
86
|
+
outcome: 'reordered' | 'unchanged';
|
|
87
|
+
}>;
|
|
51
88
|
}
|
|
52
89
|
export interface LimitsSectionOptions {
|
|
53
90
|
/**
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export type { AccountsSectionOptions, LimitsSectionOptions, LoginOutcome, QuotaSectionOptions, RoutingSectionOptions, } from './builtins.js';
|
|
1
|
+
export type { AccountsSectionOptions, LimitsSectionOptions, LoginOutcome, QuotaSectionOptions, RoutingSectionOptions, VaultRoutingOrder, } from './builtins.js';
|
|
2
2
|
export { MENU_DISABLED_REASON } from './builtins.js';
|
|
3
3
|
export type { CommandMenu, CommandMenuOptions, StoreSectionSlot, } from './menu.js';
|
|
4
4
|
export { createCommandMenu, parseApplyRequest } from './menu.js';
|
|
@@ -26,8 +26,9 @@ export declare function applyHeaderEdits(target: Record<string, string>, edits:
|
|
|
26
26
|
* whether output has started and when the response ended, attributed to
|
|
27
27
|
* an attempt by the rules below;
|
|
28
28
|
* - `retry` asks the host to retry at once when an account was refused
|
|
29
|
-
* before any output
|
|
30
|
-
*
|
|
29
|
+
* before any output and `chooseAccount` names another account for the
|
|
30
|
+
* next attempt, keeps the host's decision when the refused account was the
|
|
31
|
+
* last one that can serve, and refuses to retry once output has started.
|
|
31
32
|
*
|
|
32
33
|
* Attribution. A send belongs to the attempt named by the mark
|
|
33
34
|
* `model.request` left on it, so several attempts of one session and kind
|
|
@@ -53,6 +53,8 @@ export interface EventVerdict<Q> {
|
|
|
53
53
|
*/
|
|
54
54
|
export type HeaderEdits = Readonly<Record<string, string | null>>;
|
|
55
55
|
export interface ChooseAccountInput extends RequestScope {
|
|
56
|
+
/** Informational: the retry hook's advance choice, or a request's own choice. */
|
|
57
|
+
readonly phase: 'retry' | 'request';
|
|
56
58
|
/**
|
|
57
59
|
* The account of the attempt this one retries, when the retry hook just
|
|
58
60
|
* asked the host to retry an attempt of this session and kind; otherwise
|
|
@@ -61,8 +63,9 @@ export interface ChooseAccountInput extends RequestScope {
|
|
|
61
63
|
readonly previousAccountId?: string;
|
|
62
64
|
/**
|
|
63
65
|
* Set when the attempt this one retries was refused for a limit before any
|
|
64
|
-
* output
|
|
65
|
-
*
|
|
66
|
+
* output. The adapter should not pick `accountId` again unless it has
|
|
67
|
+
* nothing else; returning it, or `undefined`, tells the retry hook that no
|
|
68
|
+
* other account can serve, so the host's own retry decision stands.
|
|
66
69
|
*/
|
|
67
70
|
readonly rerouteFrom?: {
|
|
68
71
|
readonly accountId: string;
|
|
@@ -166,11 +169,32 @@ export interface OpenCode2AuthAdapter<Q = unknown, A = unknown> {
|
|
|
166
169
|
/** Every hook is scoped to this provider; other providers are untouched. */
|
|
167
170
|
readonly providerID: string;
|
|
168
171
|
/**
|
|
169
|
-
*
|
|
170
|
-
*
|
|
171
|
-
*
|
|
172
|
+
* Commits an account for one attempt. An undefined answer commits nothing
|
|
173
|
+
* to routing state: no consumed retry entry, no queued choice, and no session
|
|
174
|
+
* pin created, moved or deleted. Idempotent maintenance (credential refresh
|
|
175
|
+
* to check usability and recording quota readings) is allowed. On a request,
|
|
176
|
+
* undefined stops with kind `no-account`.
|
|
177
|
+
*
|
|
178
|
+
* After a limit before any output, the retry hook makes this call itself,
|
|
179
|
+
* with `phase: 'retry'` and `rerouteFrom` set. Every returned account,
|
|
180
|
+
* including the refused one, is kept for the next attempt of that session
|
|
181
|
+
* and kind: it does not choose again. Another account retries at once;
|
|
182
|
+
* the refused account keeps the host's decision and wait. `undefined` or a
|
|
183
|
+
* throw commits nothing: the host decides, and the next attempt chooses
|
|
184
|
+
* with `phase: 'request'`, `previousAccountId` and no `rerouteFrom`.
|
|
172
185
|
*/
|
|
173
186
|
chooseAccount(input: ChooseAccountInput): Promise<string | undefined> | string | undefined;
|
|
187
|
+
/**
|
|
188
|
+
* Releases a kept retry choice that will not be used: no retry, a changed
|
|
189
|
+
* model or agent, session forgetting/deletion, disposal or record eviction.
|
|
190
|
+
* Called once with the original choose input plus its returned accountId,
|
|
191
|
+
* never for a used choice. Awaited before any later chooseAccount for the
|
|
192
|
+
* same session; errors are logged and swallowed. A model/agent change
|
|
193
|
+
* releases the old choice before choosing afresh.
|
|
194
|
+
*/
|
|
195
|
+
dropChoice?(input: ChooseAccountInput & {
|
|
196
|
+
readonly accountId: string;
|
|
197
|
+
}): Promise<void> | void;
|
|
174
198
|
/**
|
|
175
199
|
* The credential and per-account headers for an account, applied in
|
|
176
200
|
* `model.request`, `http.request` and `experimental.ws.handshake`. The last
|
|
@@ -337,7 +361,20 @@ export interface InstallOpenCode2AuthOptions {
|
|
|
337
361
|
readonly maxRecords?: number;
|
|
338
362
|
readonly logger?: OpenCode2AuthLogger;
|
|
339
363
|
}
|
|
340
|
-
|
|
364
|
+
/**
|
|
365
|
+
* Why the retry hook decided as it did:
|
|
366
|
+
*
|
|
367
|
+
* - `reroute`: refused for a limit before any output, and `chooseAccount`
|
|
368
|
+
* named another account for the next attempt, so the host retries at once;
|
|
369
|
+
* - `output-started`: output had reached the user, so no retry;
|
|
370
|
+
* - `no-account`: the attempt had no account, so no retry;
|
|
371
|
+
* - `host-decides-last-account`: refused for a limit before any output, but
|
|
372
|
+
* no other account can serve the next attempt, so the host's own decision
|
|
373
|
+
* (its wait, or its refusal to retry) stands and the next attempt may go
|
|
374
|
+
* to the refused account again;
|
|
375
|
+
* - `host-decides`: no limit was recognised, so the host's decision stands.
|
|
376
|
+
*/
|
|
377
|
+
export type RetryReason = 'reroute' | 'output-started' | 'no-account' | 'host-decides-last-account' | 'host-decides';
|
|
341
378
|
/**
|
|
342
379
|
* The hook that picked an account. Normally `model.request`; a transport hook
|
|
343
380
|
* picks only when the host skipped `model.request` for that request, which a
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
import { type MenuTerminal } from '../auth-menu/terminal.js';
|
|
2
|
+
import type { SetupHost, SetupIO, SetupPlugin } from './types.js';
|
|
3
|
+
/** Fixed text: no version, host or account detail, so it is safe to print anywhere. */
|
|
4
|
+
export declare const UNSUPPORTED_VAULT_MESSAGE = "This Claustrum vault is too old to connect plugins. Run ck upgrade to move to Claustrum v0.2.0 or newer (read \"Upgrading from v0.1.3\" in its release notes first), or run setup without --claustrum to use local accounts.";
|
|
5
|
+
/**
|
|
6
|
+
* The longest setup waits, in total, for the vault to create the enrollment
|
|
7
|
+
* request and for an operator to approve it. It matches the wait setup always
|
|
8
|
+
* had (300 one-second polls), but is now measured on the clock: a vault that
|
|
9
|
+
* answers each request slowly can no longer stretch it.
|
|
10
|
+
*/
|
|
11
|
+
export declare const ENROLLMENT_WAIT_MS = 300000;
|
|
12
|
+
/** Why a host's enrollment ended without a token. */
|
|
13
|
+
export type HostNotEnrolledReason = 'connection-failed' | 'unsupported-vault' | 'request-not-created' | 'approval-pending' | 'refused' | 'invalid-request' | 'incomplete';
|
|
14
|
+
/**
|
|
15
|
+
* Thrown when the enrollment ended without writing the host's token: the vault
|
|
16
|
+
* could not be reached, it cannot enroll plugins, it refused the request, it
|
|
17
|
+
* never created one, approval never came before setup stopped waiting, or
|
|
18
|
+
* the enrollment failed in some other way (`incomplete`).
|
|
19
|
+
* Setup can then report the host as not connected without reading its files.
|
|
20
|
+
* The message is fixed text built only from vetted values, never from what
|
|
21
|
+
* the vault or client threw. `lastErrorCode` is the last enrollment error code
|
|
22
|
+
* setup saw, from the vault or from the client's transport (for example
|
|
23
|
+
* `transport_error`), for diagnostics; it carries no secret.
|
|
24
|
+
*/
|
|
25
|
+
export declare class HostNotEnrolledError extends Error {
|
|
26
|
+
readonly reason: HostNotEnrolledReason;
|
|
27
|
+
readonly lastErrorCode?: string;
|
|
28
|
+
constructor(message: string, details: {
|
|
29
|
+
reason: HostNotEnrolledReason;
|
|
30
|
+
lastErrorCode?: string;
|
|
31
|
+
});
|
|
32
|
+
}
|
|
33
|
+
/** Enroll an independently revocable host; plugin callbacks choose its credential store and account permissions. */
|
|
34
|
+
export declare function connectSetupHost(plugin: SetupPlugin, host: SetupHost, io: SetupIO, terminal: MenuTerminal, fence: () => Promise<void>): Promise<void>;
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
export { AMBIGUOUS_OPENCODE_MESSAGE, runSetup } from './command.js';
|
|
2
2
|
export { SetupCommandError, setupEnrollment } from './command-error.js';
|
|
3
3
|
export { detectHosts, detectOpenCodeGeneration, findExecutableOnPath, openCodeDesktopMarkers, } from './detect.js';
|
|
4
|
+
export { ENROLLMENT_WAIT_MS, HostNotEnrolledError, type HostNotEnrolledReason, UNSUPPORTED_VAULT_MESSAGE, } from './enroll.js';
|
|
4
5
|
export { assertHostsStopped, createProcessFence, listSetupProcesses, ProcessFenceViolationError, ProcessInspectionError, type ProcessInspectionStep, } from './process-fence.js';
|
|
5
6
|
export { type PlannedWrite, planOpenCodeRegistration, registerOpenCode, registerPi, updatePluginConfig, } from './register.js';
|
|
6
7
|
export type { CommandResult, CommandRunner, HostDetection, OpenCodeGeneration, ProcessFence, SetupCallbackContext, SetupDetection, SetupEnrollmentOutcome, SetupEnvironment, SetupFileSystem, SetupHost, SetupHostEnrollment, SetupIO, SetupPlugin, SetupResult, } from './types.js';
|
|
@@ -39,6 +39,13 @@ export declare function listSetupProcesses(runner?: CommandRunner, options?: {
|
|
|
39
39
|
* a container this process can hold any small PID a fixture uses.
|
|
40
40
|
*/
|
|
41
41
|
selfPid?: number;
|
|
42
|
+
/**
|
|
43
|
+
* Windows only: answer with one CIM query for the images a fence cares
|
|
44
|
+
* about (host programs, Node and Bun), returning image name, PID and
|
|
45
|
+
* command line together, instead of `tasklist` followed by a second CIM
|
|
46
|
+
* query. The result lists only those processes.
|
|
47
|
+
*/
|
|
48
|
+
hostImagesOnly?: boolean;
|
|
42
49
|
}): Promise<Array<{
|
|
43
50
|
pid: number;
|
|
44
51
|
command: string;
|
|
@@ -125,6 +125,11 @@ export interface SetupIO {
|
|
|
125
125
|
handshakeTimeoutMs: number;
|
|
126
126
|
}) => Promise<ClaustrumEnrollmentConnection>;
|
|
127
127
|
wait?: (ms: number) => Promise<void>;
|
|
128
|
+
/**
|
|
129
|
+
* Monotonic milliseconds that bound the enrollment wait. Defaults to
|
|
130
|
+
* `performance.now`; tests pair it with `wait` to run a fake clock.
|
|
131
|
+
*/
|
|
132
|
+
now?: () => number;
|
|
128
133
|
}
|
|
129
134
|
export interface HostDetection {
|
|
130
135
|
installed: boolean;
|
|
@@ -1,4 +1,6 @@
|
|
|
1
|
+
import { type StoreContext } from './mutate.js';
|
|
1
2
|
import { type StoreRuntime } from './runtime.js';
|
|
3
|
+
import { type PoolRow } from './schema.js';
|
|
2
4
|
/**
|
|
3
5
|
* What a pull or refresh captured about its row (named by id alongside) when
|
|
4
6
|
* it was issued. A result applies only while the row with that id still has
|
|
@@ -20,6 +22,9 @@ export interface Attribution {
|
|
|
20
22
|
credentialEpoch: number;
|
|
21
23
|
identity?: string;
|
|
22
24
|
}
|
|
25
|
+
export declare function assertQuotaEpoch(id: string, attribution: Attribution): void;
|
|
26
|
+
export declare function assertQuotaRow(id: string, attribution: Attribution, row: PoolRow | undefined): asserts row is PoolRow;
|
|
27
|
+
export declare function mergedQuota(ctx: StoreContext, id: string, stored: unknown, observation: unknown): unknown;
|
|
23
28
|
/**
|
|
24
29
|
* Merges a quota observation into a row's stored map under the store locks,
|
|
25
30
|
* after attribution passes. Needs no row lock, so it is permitted from
|
|
@@ -16,6 +16,19 @@ export interface OpenPoolStoreOptions {
|
|
|
16
16
|
configPath: string;
|
|
17
17
|
statePath: string;
|
|
18
18
|
quota: QuotaCodec;
|
|
19
|
+
/**
|
|
20
|
+
* Opt in to detached, coalesced quota publication, with any `quota` codec.
|
|
21
|
+
* Each accepted observation is queued whole for its row and binding, and
|
|
22
|
+
* the queue is applied in arrival order through `quota.merge` under the
|
|
23
|
+
* store locks, so the codec's own merge decides which fields a newer or
|
|
24
|
+
* older reading replaces. Accepted readings appear in read/load
|
|
25
|
+
* immediately, merged the same way; the returned promise still rejects
|
|
26
|
+
* current-row refusals before queueing. Await dispose or close at shutdown
|
|
27
|
+
* to drain.
|
|
28
|
+
*/
|
|
29
|
+
coalesceQuota?: boolean;
|
|
30
|
+
/** Bounded quota drain on close/dispose, in milliseconds; defaults to 1,000. */
|
|
31
|
+
quotaDrainTimeoutMs?: number;
|
|
19
32
|
/**
|
|
20
33
|
* The codec of the provider state kept beside each row's credential (see
|
|
21
34
|
* `ProviderStateCodec`). Without it no row shows a provider state, and
|
|
@@ -189,6 +202,10 @@ export interface PoolStore {
|
|
|
189
202
|
}>;
|
|
190
203
|
refresh(id: string, provider: ProviderRefresh, options?: RefreshOptions): Promise<RefreshOutcome>;
|
|
191
204
|
recordQuota(id: string, attribution: Attribution, observation: unknown): Promise<void>;
|
|
205
|
+
/** Drain opted-in quota publication; subsequent coalesced readings refuse. Idempotent. */
|
|
206
|
+
close(): Promise<void>;
|
|
207
|
+
/** Same bounded quota drain as close(). Does not wait for provider pull hooks. */
|
|
208
|
+
dispose(): Promise<void>;
|
|
192
209
|
/** Fires a pull for a row admission refused for want of a reading. */
|
|
193
210
|
requestReading(id: string): void;
|
|
194
211
|
/** Resolves once every pull fired so far has settled. */
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import type { Attribution } from './attribution.js';
|
|
1
2
|
import { type PoolOperation, PoolOperationError } from './errors.js';
|
|
2
3
|
import { type ReadResult, type StoreContext } from './mutate.js';
|
|
3
4
|
import type { PoolLockOptions, PoolLockSpec } from './refresh-lock.js';
|
|
@@ -10,6 +11,7 @@ export interface StoreRuntime {
|
|
|
10
11
|
providerLock: PoolLockSpec;
|
|
11
12
|
rowLockOptions: Partial<PoolLockOptions>;
|
|
12
13
|
firePull(id: string, reason: PullReason): void;
|
|
14
|
+
publishQuota?: (id: string, attribution: Attribution, observation: unknown) => Promise<void>;
|
|
13
15
|
}
|
|
14
16
|
/**
|
|
15
17
|
* The row lock's (name, path): keyed by the row's recorded wire identity when
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"lifecycle.d.ts","sourceRoot":"","sources":["../../../../src/plugin/lifecycle.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,YAAY,CAAA;AAChD,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,iBAAiB,CAAA;AAE5D,MAAM,WAAW,UAAU;IACzB,OAAO,IAAI,OAAO,CAAC,IAAI,CAAC,GAAG,IAAI,CAAA;CAChC;AAED;;;;;;;;;;GAUG;AACH,MAAM,MAAM,cAAc,GAAG,UAAU,GAAG,UAAU,CAAA;AAEpD,MAAM,WAAW,sBAAsB;IACrC,eAAe,EAAE;QAAE,KAAK,IAAI,IAAI,CAAA;KAAE,CAAA;IAClC,0BAA0B,EAAE,MAAM,OAAO,CAAC,IAAI,CAAC,CAAA;IAC/C,eAAe,EAAE,MAAM,IAAI,CAAA;IAC3B;;;;;;;OAOG;IACH,kBAAkB,CAAC,EAAE,MAAM,OAAO,CAAC,IAAI,CAAC,CAAA;CACzC;AAED;;;;GAIG;AACH,MAAM,WAAW,qBAAqB;IACpC,2EAA2E;IAC3E,MAAM,IAAI,OAAO,CAAC,IAAI,CAAC,CAAA;IACvB,kEAAkE;IAClE,OAAO,IAAI,OAAO,CAAC,IAAI,CAAC,GAAG,IAAI,CAAA;CAChC;AAED,MAAM,WAAW,eAAgB,SAAQ,UAAU;IACjD,iBAAiB,IAAI,cAAc,GAAG,IAAI,CAAA;IAC1C,4EAA4E;IAC5E,SAAS,IA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O,CAAA;IACpB;;;;;;;;;OASG;IACH,qBAAqB,CACnB,OAAO,EAAE,cAAc,EACvB,YAAY,EAAE,qBAAqB,GAAG,IAAI,EAC1C,QAAQ,CAAC,EAAE,qBAAqB,GAAG,IAAI,GACtC,OAAO,CAAC,OAAO,CAAC,CAAA;IACnB,QAAQ,CAAC,UAAU,EAAE,UAAU,EAAE,KAAK,CAAC,EAAE,cAAc,GAAG,IAAI,CAAA;CAC/D;AAsBD,wBAAgB,qBAAqB,CACnC,OAAO,EAAE,sBAAsB,GAC9B,eAAe,CA+LjB"}
|
|
@@ -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;AAMzC,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;AAMnB,OAAO,EACL,KAAK,kBA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HD;;;;;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,
|
|
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;AAMzC,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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O,CAAC,IAAI,CAAC,CAAA;IACvB;;;OAGG;IACH,OAAO,IAAI,OAAO,CAAC,IAAI,CAAC,CAAA;CACzB;AAkHD;;;;;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,CAmqE5B"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"vault-custody.d.ts","sourceRoot":"","sources":["../../../../src/plugin/vault-custody.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;GAmBG;
|
|
1
|
+
{"version":3,"file":"vault-custody.d.ts","sourceRoot":"","sources":["../../../../src/plugin/vault-custody.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;GAmBG;AAIH,OAAO,EACL,KAAK,6BAA6B,EAClC,KAAK,yBAAyB,EAC9B,KAAK,wBAAwB,EAE7B,KAAK,qBAAqB,EAC1B,KAAK,mBAAmB,EAcxB,KAAK,WAAW,EAChB,KAAK,sBAAsB,EAC3B,KAAK,mBAAmB,EACxB,KAAK,iBAAiB,EACvB,MAAM,kCAAkC,CAAA;AAGzC,OAAO,EAEL,KAAK,gBAAgB,EACrB,KAAK,uBAAuB,EAC7B,MAAM,uCAAuC,CAAA;AAG9C,sEAAsE;AACtE,eAAO,MAAM,uBAAuB,WAAW,CAAA;AAC/C,oDAAoD;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AS,CAEpB;AAED;;;GAGG;AACH,wBAAgB,8BAA8B,CAC5C,OAAO,EAAE,IAAI,CAAC,uBAAuB,EAAE,oBAAoB,CAAC,GAC3D,gBAAgB,CAKlB;AA+CD,0EAA0E;AAC1E,wBAAgB,WAAW,CAAC,MAAM,EAAE,mBAAmB,GAAG,MAAM,EAAE,CAejE"}
|
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.12",
|
|
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.12",
|
|
134
134
|
"@cortexkit/private-files": "0.2.1",
|
|
135
135
|
"jsonc-parser": "^3.3.1",
|
|
136
136
|
"xdg-basedir": "^5.1.0",
|
|
@@ -4,7 +4,7 @@ import type { RoutingRow } from '../routing/index.js';
|
|
|
4
4
|
import { type ClaustrumFamily, type ClaustrumScopedAttempt, type ClaustrumScopedClient, type IdentityParser, type KeptReceiptState, type VaultGrantReach } from './custody.js';
|
|
5
5
|
import { type ClaustrumLogger } from './errors.js';
|
|
6
6
|
import { type InsulaQuotaOptions, type InsulaQuotaResult } from './insula.js';
|
|
7
|
-
import { type AccountMapper, type QuotaReceipt, type VaultRosterFile } from './roster.js';
|
|
7
|
+
import { type AccountMapper, type QuotaReceipt, type ReorderVaultRosterResult, type VaultRosterFile } from './roster.js';
|
|
8
8
|
import { type WatchMode } from './watch.js';
|
|
9
9
|
export interface ClaustrumConsumerOptions<Q = QuotaObservation> {
|
|
10
10
|
/**
|
|
@@ -157,6 +157,12 @@ export declare class ClaustrumConsumer<Q = QuotaObservation> {
|
|
|
157
157
|
/** Decline a vault account: it stays listed and never routes until accepted. */
|
|
158
158
|
decline(routeId: string): Promise<void>;
|
|
159
159
|
accept(routeId: string): Promise<void>;
|
|
160
|
+
/**
|
|
161
|
+
* Set the order vault accounts are tried in (`reorderVaultRoster`), then
|
|
162
|
+
* re-read the roster, so the next routing decision in this process uses
|
|
163
|
+
* the new order without waiting for a discovery. Never contacts the vault.
|
|
164
|
+
*/
|
|
165
|
+
reorder(routeIds: readonly string[]): Promise<ReorderVaultRosterResult>;
|
|
160
166
|
/**
|
|
161
167
|
* Store a quota or profile observation for a vault route. The receipt the
|
|
162
168
|
* reading was taken with is required: the observation lands only while the
|
|
@@ -5,7 +5,7 @@ import { readClaustrumEnrollmentToken } from './enrollment.js';
|
|
|
5
5
|
import { ClaustrumConsumerError } from './errors.js';
|
|
6
6
|
import { acquireInsulaQuotaSource, } from './insula.js';
|
|
7
7
|
import { pendingVaultQuota, retainVaultQuotaWriter } from './quota-writer.js';
|
|
8
|
-
import { acceptVaultRoute, applyVaultQuota, declineVaultRoute, forgetPendingVaultDiscovery, readVaultRoster, recordVaultAccountQuota, recordVaultQuota, refreshVaultRoster, vaultRoutingRows, } from './roster.js';
|
|
8
|
+
import { acceptVaultRoute, applyVaultQuota, declineVaultRoute, forgetPendingVaultDiscovery, readVaultRoster, recordVaultAccountQuota, recordVaultQuota, refreshVaultRoster, reorderVaultRoster, vaultRoutingRows, } from './roster.js';
|
|
9
9
|
import { SAFETY_POLL_MS } from './watch.js';
|
|
10
10
|
/**
|
|
11
11
|
* One plugin host's view of its vault accounts. It turns vault credentials
|
|
@@ -485,8 +485,12 @@ export class ClaustrumConsumer {
|
|
|
485
485
|
let current;
|
|
486
486
|
try {
|
|
487
487
|
current = await this.authorize(routeId, signal);
|
|
488
|
+
// Cancellation can land after authorize settles, before this continuation.
|
|
489
|
+
signal?.throwIfAborted();
|
|
488
490
|
}
|
|
489
|
-
catch {
|
|
491
|
+
catch (error) {
|
|
492
|
+
if (signal?.aborted)
|
|
493
|
+
throw error;
|
|
490
494
|
// Re-authorization failed: keep this 401 and report it against the
|
|
491
495
|
// receipt (served record version) this request was sent with.
|
|
492
496
|
}
|
|
@@ -522,6 +526,17 @@ export class ClaustrumConsumer {
|
|
|
522
526
|
await acceptVaultRoute(this.#options.rosterPath, routeId);
|
|
523
527
|
this.#roster = pendingVaultQuota(this.#options.rosterPath, await readVaultRoster(this.#options.rosterPath));
|
|
524
528
|
}
|
|
529
|
+
/**
|
|
530
|
+
* Set the order vault accounts are tried in (`reorderVaultRoster`), then
|
|
531
|
+
* re-read the roster, so the next routing decision in this process uses
|
|
532
|
+
* the new order without waiting for a discovery. Never contacts the vault.
|
|
533
|
+
*/
|
|
534
|
+
async reorder(routeIds) {
|
|
535
|
+
this.#assertOpen();
|
|
536
|
+
const result = await reorderVaultRoster(this.#options.rosterPath, routeIds);
|
|
537
|
+
this.#roster = pendingVaultQuota(this.#options.rosterPath, await readVaultRoster(this.#options.rosterPath));
|
|
538
|
+
return result;
|
|
539
|
+
}
|
|
525
540
|
/**
|
|
526
541
|
* Store a quota or profile observation for a vault route. The receipt the
|
|
527
542
|
* reading was taken with is required: the observation lands only while the
|
|
@@ -1,4 +1,9 @@
|
|
|
1
1
|
import { type ClaustrumClientOptions as ClaustrumEnrollmentClientOptions, type EnrollmentPollOutcome, type EnrollmentTokenFile, writeEnrollmentTokenFile } from '@cortexkit/claustrum-client';
|
|
2
|
+
/**
|
|
3
|
+
* The code a vault without the enrollment ceremony answers a proposal with.
|
|
4
|
+
* Setup reports it as "this vault cannot connect plugins" instead of waiting.
|
|
5
|
+
*/
|
|
6
|
+
export declare const UNSUPPORTED_ENROLLMENT_CODE = "unknown_method";
|
|
2
7
|
/**
|
|
3
8
|
* Codes the vault's closed enrollment-refusal vocabulary marks permanent. The
|
|
4
9
|
* client labels some module error frames transient/retry regardless, so the
|
|
@@ -10,12 +10,22 @@ const ENROLLMENT_SCHEMA = 1;
|
|
|
10
10
|
const ENROLLMENT_FILE_MAX_BYTES = 16 * 1024;
|
|
11
11
|
const ENROLLMENT_LOCK_TTL_MS = 30_000;
|
|
12
12
|
const TOKEN_RE = /^[0-9a-f]{64}$/;
|
|
13
|
+
/**
|
|
14
|
+
* The code a vault without the enrollment ceremony answers a proposal with.
|
|
15
|
+
* Setup reports it as "this vault cannot connect plugins" instead of waiting.
|
|
16
|
+
*/
|
|
17
|
+
export const UNSUPPORTED_ENROLLMENT_CODE = 'unknown_method';
|
|
13
18
|
/**
|
|
14
19
|
* Codes the vault's closed enrollment-refusal vocabulary marks permanent. The
|
|
15
20
|
* client labels some module error frames transient/retry regardless, so the
|
|
16
21
|
* producer's code takes precedence over the client's action for these.
|
|
17
22
|
*/
|
|
18
23
|
export const TERMINAL_ENROLLMENT_CODES = new Set([
|
|
24
|
+
// The daemon's answer to an operation it does not implement: a vault built
|
|
25
|
+
// before the enrollment ceremony. It arrives as a transport Error frame with
|
|
26
|
+
// no class, which claustrum-client before 0.13.0 labels transient/retry, but
|
|
27
|
+
// asking again can never succeed.
|
|
28
|
+
UNSUPPORTED_ENROLLMENT_CODE,
|
|
19
29
|
'invalid_params',
|
|
20
30
|
'pending_exists',
|
|
21
31
|
'not_found',
|
|
@@ -638,6 +648,23 @@ export class ClaustrumEnrollmentManager {
|
|
|
638
648
|
retryCode: refusal.code,
|
|
639
649
|
};
|
|
640
650
|
}
|
|
651
|
+
// A vault without the ceremony cannot hold a request for this
|
|
652
|
+
// proposal, now or from an earlier run (the state has no request
|
|
653
|
+
// id). So nothing is blocked and nothing is in progress: remove the
|
|
654
|
+
// pending state, still under the ceremony lock, so status reads as
|
|
655
|
+
// "not enrolled" and a reset or a later run starts afresh.
|
|
656
|
+
if (refusal.code === UNSUPPORTED_ENROLLMENT_CODE) {
|
|
657
|
+
await lock.assertOwned();
|
|
658
|
+
await unlink(this.#paths.statePath).catch((cause) => {
|
|
659
|
+
if (cause.code !== 'ENOENT')
|
|
660
|
+
throw cause;
|
|
661
|
+
});
|
|
662
|
+
return {
|
|
663
|
+
state: 'unavailable',
|
|
664
|
+
proposedName: state.proposedName,
|
|
665
|
+
code: refusal.code,
|
|
666
|
+
};
|
|
667
|
+
}
|
|
641
668
|
return this.#block(state, refusal.code);
|
|
642
669
|
}
|
|
643
670
|
}
|
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
* `code`, a `class` and an `action`), so callers can tell the vault's verdict
|
|
5
5
|
* apart from a check made on this side.
|
|
6
6
|
*/
|
|
7
|
-
export type ClaustrumConsumerFailureKind = 'closed' | 'not-enrolled' | 'invalid-token' | 'unavailable' | 'identity-changed' | 'identity-unasserted' | 'insufficient-validity' | 'invalid-material' | 'not-active' | 'route-unavailable' | 'route-declined' | 'no-receipt' | 'unsafe-file' | 'invalid-state' | 'wrong-consumer' | 'roster-busy' | 'host-slot-login' | 'host-slot-placeholder' | 'placeholder-refresh';
|
|
7
|
+
export type ClaustrumConsumerFailureKind = 'closed' | 'not-enrolled' | 'invalid-token' | 'unavailable' | 'identity-changed' | 'identity-unasserted' | 'insufficient-validity' | 'invalid-material' | 'not-active' | 'route-unavailable' | 'route-declined' | 'no-receipt' | 'unsafe-file' | 'invalid-state' | 'wrong-consumer' | 'roster-busy' | 'host-slot-login' | 'host-slot-placeholder' | 'placeholder-refresh' | 'invalid-order';
|
|
8
8
|
export declare class ClaustrumConsumerError extends Error {
|
|
9
9
|
readonly kind: ClaustrumConsumerFailureKind;
|
|
10
10
|
constructor(kind: ClaustrumConsumerFailureKind, message: string);
|
|
@@ -10,7 +10,7 @@ export { assertHostSlotMatchesMode, assertNotCustodyPlaceholder, CUSTODY_PLACEHO
|
|
|
10
10
|
export { acquireInsulaQuotaSource, type InsulaQuotaContext, type InsulaQuotaLookup, type InsulaQuotaMiss, type InsulaQuotaOptions, type InsulaQuotaReading, type InsulaQuotaResult, type InsulaQuotaSource, type InsulaUsageEntry, type InsulaUsageTransport, type InsulaUsageWatch, type InsulaUsageWindow, type InsulaWatchOptions, } from './insula.js';
|
|
11
11
|
export { acceptAccount, type DeclinedAccount, declineAccount, isDeclined, } from './interlock.js';
|
|
12
12
|
export { drainVaultQuota } from './quota-writer.js';
|
|
13
|
-
export { type AccountMapper, acceptVaultRoute, DEFAULT_ROUTE_PREFIX, declineVaultRoute, type MutateVaultRosterOptions, mutateVaultRoster, type ProjectionOptions, projectVaultRoster, type QuotaReceipt, readVaultRoster, recordVaultAccountQuota, recordVaultQuota, refreshVaultRoster, resolveVaultPrimary, type VaultPrimary, type VaultPrimaryBinding, type VaultPrimaryUnavailableReason, type VaultRosterFile, type VaultRosterLockContext, type VaultRosterRow, vaultRoutingRows, } from './roster.js';
|
|
13
|
+
export { type AccountMapper, acceptVaultRoute, DEFAULT_ROUTE_PREFIX, declineVaultRoute, type MutateVaultRosterOptions, mutateVaultRoster, type ProjectionOptions, projectVaultRoster, type QuotaReceipt, type ReorderVaultRosterOptions, type ReorderVaultRosterResult, readVaultRoster, recordVaultAccountQuota, recordVaultQuota, refreshVaultRoster, reorderVaultRoster, resolveVaultPrimary, type VaultPrimary, type VaultPrimaryBinding, type VaultPrimaryUnavailableReason, type VaultRosterFile, type VaultRosterLockContext, type VaultRosterRow, vaultRoutingRows, } from './roster.js';
|
|
14
14
|
export { type ChangeNotice, ChangeNoticeReader, RESUBSCRIBE_BACKOFF_MS, SAFETY_POLL_MS, ScopedRosterWatch, type ScopedRosterWatchOptions, type ScopedWatchEnd, type ScopedWatchHandle, type ScopedWatchNoticeShape, type ScopedWatchSource, WATCH_RETRY_MS, type WatchMode, } from './watch.js';
|
|
15
15
|
/**
|
|
16
16
|
* Connect the client that lists and fetches this consumer's vault credentials
|
|
@@ -15,7 +15,7 @@ export { assertHostSlotMatchesMode, assertNotCustodyPlaceholder, CUSTODY_PLACEHO
|
|
|
15
15
|
export { acquireInsulaQuotaSource, } from './insula.js';
|
|
16
16
|
export { acceptAccount, declineAccount, isDeclined, } from './interlock.js';
|
|
17
17
|
export { drainVaultQuota } from './quota-writer.js';
|
|
18
|
-
export { acceptVaultRoute, DEFAULT_ROUTE_PREFIX, declineVaultRoute, mutateVaultRoster, projectVaultRoster, readVaultRoster, recordVaultAccountQuota, recordVaultQuota, refreshVaultRoster, resolveVaultPrimary, vaultRoutingRows, } from './roster.js';
|
|
18
|
+
export { acceptVaultRoute, DEFAULT_ROUTE_PREFIX, declineVaultRoute, mutateVaultRoster, projectVaultRoster, readVaultRoster, recordVaultAccountQuota, recordVaultQuota, refreshVaultRoster, reorderVaultRoster, resolveVaultPrimary, vaultRoutingRows, } from './roster.js';
|
|
19
19
|
export { ChangeNoticeReader, RESUBSCRIBE_BACKOFF_MS, SAFETY_POLL_MS, ScopedRosterWatch, WATCH_RETRY_MS, } from './watch.js';
|
|
20
20
|
/**
|
|
21
21
|
* Connect the client that lists and fetches this consumer's vault credentials
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { resolve } from 'node:path';
|
|
2
2
|
import { createLogger } from '../logger/index.js';
|
|
3
3
|
import { isQuotaObservation } from '../quota/index.js';
|
|
4
|
+
import { quotaFields } from '../quota/pending.js';
|
|
4
5
|
import { applyVaultQuota, mutateVaultRoster, } from './roster.js';
|
|
5
6
|
// Every consumer of the same file shares one mailbox and one lock waiter.
|
|
6
7
|
const writers = new Map();
|
|
@@ -34,65 +35,14 @@ export function retainVaultQuotaWriter(path, listener) {
|
|
|
34
35
|
return writer.listeners.size ? Promise.resolve() : drainVaultQuota(path);
|
|
35
36
|
})());
|
|
36
37
|
}
|
|
37
|
-
//
|
|
38
|
-
// window (scope and label), each covered-but-unread window, the budget, each
|
|
39
|
-
// counter and the credits record. The mailbox keeps the newest of each part on
|
|
40
|
-
// its own, so a later observation that carries only some parts can't erase an
|
|
41
|
-
// older but still newest reading of another part, which is how
|
|
42
|
-
// mergeQuotaObservation treats them on disk. Each key also carries the
|
|
43
|
-
// receipt's identity, so the identity fence still applies to every part.
|
|
38
|
+
// Each field retains the receipt fence as well as its independent timestamp.
|
|
44
39
|
function fields(publication) {
|
|
45
|
-
|
|
46
|
-
const { observation } = publication;
|
|
47
|
-
const witness = JSON.stringify([
|
|
40
|
+
return quotaFields(publication, JSON.stringify([
|
|
48
41
|
publication.routeId,
|
|
49
42
|
publication.receipt?.credentialId,
|
|
50
43
|
publication.receipt?.accountIdentitySource,
|
|
51
44
|
publication.receipt?.expectedAccountIdentity,
|
|
52
|
-
]);
|
|
53
|
-
const add = (key, at, part) => result.set(`${witness}:${key}`, {
|
|
54
|
-
at,
|
|
55
|
-
order: 0,
|
|
56
|
-
publication: { ...publication, observation: part },
|
|
57
|
-
});
|
|
58
|
-
const keyFor = (scope, label) => JSON.stringify([scope ?? 'all', label]);
|
|
59
|
-
const read = new Set();
|
|
60
|
-
for (const reading of observation.readings ?? []) {
|
|
61
|
-
const key = keyFor(reading.scope, reading.label);
|
|
62
|
-
read.add(key);
|
|
63
|
-
add(key, observation.checkedAt, {
|
|
64
|
-
checkedAt: observation.checkedAt,
|
|
65
|
-
readings: [{ ...reading }],
|
|
66
|
-
});
|
|
67
|
-
}
|
|
68
|
-
for (const pair of observation.coverage ?? []) {
|
|
69
|
-
const key = keyFor(pair.scope, pair.label);
|
|
70
|
-
if (!read.has(key))
|
|
71
|
-
add(key, observation.checkedAt, {
|
|
72
|
-
checkedAt: observation.checkedAt,
|
|
73
|
-
coverage: [{ ...pair }],
|
|
74
|
-
});
|
|
75
|
-
}
|
|
76
|
-
if (observation.budget)
|
|
77
|
-
add('budget', observation.checkedAt, {
|
|
78
|
-
checkedAt: observation.checkedAt,
|
|
79
|
-
budget: { ...observation.budget },
|
|
80
|
-
});
|
|
81
|
-
for (const [name, counter] of Object.entries(observation.counters ?? {})) {
|
|
82
|
-
add(`counter:${name}`, counter.checkedAt, {
|
|
83
|
-
checkedAt: observation.checkedAt,
|
|
84
|
-
counters: { [name]: { ...counter } },
|
|
85
|
-
});
|
|
86
|
-
}
|
|
87
|
-
if (observation.credits)
|
|
88
|
-
add('credits', observation.credits.checkedAt, {
|
|
89
|
-
checkedAt: observation.checkedAt,
|
|
90
|
-
credits: { ...observation.credits },
|
|
91
|
-
});
|
|
92
|
-
// Even an empty observation can bind an account proved by its receipt.
|
|
93
|
-
if (!result.size)
|
|
94
|
-
add('empty', observation.checkedAt, { checkedAt: observation.checkedAt });
|
|
95
|
-
return result;
|
|
45
|
+
]));
|
|
96
46
|
}
|
|
97
47
|
/** Enqueue without filesystem work; each quota field retains its own receipt fence. */
|
|
98
48
|
export function enqueueVaultQuota(path, publication) {
|