@cortexkit/antigravity-auth-core 2.2.1 → 3.0.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +24 -2
- package/dist/abort-forwarding.d.ts +3 -0
- package/dist/abort-forwarding.d.ts.map +1 -0
- package/dist/abort-forwarding.js +19 -0
- package/dist/abort-forwarding.js.map +1 -0
- package/dist/account-identity.d.ts +52 -0
- package/dist/account-identity.d.ts.map +1 -0
- package/dist/account-identity.js +66 -0
- package/dist/account-identity.js.map +1 -0
- package/dist/account-manager.d.ts +228 -43
- package/dist/account-manager.d.ts.map +1 -1
- package/dist/account-manager.js +942 -903
- package/dist/account-manager.js.map +1 -1
- package/dist/account-migration.d.ts +309 -0
- package/dist/account-migration.d.ts.map +1 -0
- package/dist/account-migration.js +2284 -0
- package/dist/account-migration.js.map +1 -0
- package/dist/account-repository-codecs.d.ts +82 -0
- package/dist/account-repository-codecs.d.ts.map +1 -0
- package/dist/account-repository-codecs.js +609 -0
- package/dist/account-repository-codecs.js.map +1 -0
- package/dist/account-repository-types.d.ts +831 -0
- package/dist/account-repository-types.d.ts.map +1 -0
- package/dist/account-repository-types.js +137 -0
- package/dist/account-repository-types.js.map +1 -0
- package/dist/account-repository.d.ts +442 -0
- package/dist/account-repository.d.ts.map +1 -0
- package/dist/account-repository.js +2253 -0
- package/dist/account-repository.js.map +1 -0
- package/dist/account-selector.d.ts +470 -0
- package/dist/account-selector.d.ts.map +1 -0
- package/dist/account-selector.js +1383 -0
- package/dist/account-selector.js.map +1 -0
- package/dist/account-storage.d.ts.map +1 -1
- package/dist/account-storage.js +5 -0
- package/dist/account-storage.js.map +1 -1
- package/dist/agy-request-metadata.d.ts.map +1 -1
- package/dist/agy-request-metadata.js +8 -21
- package/dist/agy-request-metadata.js.map +1 -1
- package/dist/agy-transport.d.ts.map +1 -1
- package/dist/agy-transport.js +21 -35
- package/dist/agy-transport.js.map +1 -1
- package/dist/antigravity-command-menu.d.ts +171 -0
- package/dist/antigravity-command-menu.d.ts.map +1 -0
- package/dist/antigravity-command-menu.js +523 -0
- package/dist/antigravity-command-menu.js.map +1 -0
- package/dist/atomic-write.d.ts +18 -1
- package/dist/atomic-write.d.ts.map +1 -1
- package/dist/atomic-write.js +15 -3
- package/dist/atomic-write.js.map +1 -1
- package/dist/common-auth-embedded/NOTICE.txt +21 -0
- package/dist/common-auth-embedded/auth-menu/accounts.d.ts +97 -0
- package/dist/common-auth-embedded/auth-menu/accounts.js +387 -0
- package/dist/common-auth-embedded/auth-menu/ansi.d.ts +26 -0
- package/dist/common-auth-embedded/auth-menu/ansi.js +98 -0
- package/dist/common-auth-embedded/auth-menu/confirm.d.ts +7 -0
- package/dist/common-auth-embedded/auth-menu/confirm.js +21 -0
- package/dist/common-auth-embedded/auth-menu/doctor.d.ts +52 -0
- package/dist/common-auth-embedded/auth-menu/doctor.js +81 -0
- package/dist/common-auth-embedded/auth-menu/index.d.ts +17 -0
- package/dist/common-auth-embedded/auth-menu/index.js +12 -0
- package/dist/common-auth-embedded/auth-menu/login.d.ts +55 -0
- package/dist/common-auth-embedded/auth-menu/login.js +83 -0
- package/dist/common-auth-embedded/auth-menu/menu.d.ts +59 -0
- package/dist/common-auth-embedded/auth-menu/menu.js +73 -0
- package/dist/common-auth-embedded/auth-menu/opencode-v1.d.ts +49 -0
- package/dist/common-auth-embedded/auth-menu/opencode-v1.js +47 -0
- package/dist/common-auth-embedded/auth-menu/select.d.ts +21 -0
- package/dist/common-auth-embedded/auth-menu/select.js +159 -0
- package/dist/common-auth-embedded/auth-menu/terminal.d.ts +43 -0
- package/dist/common-auth-embedded/auth-menu/terminal.js +19 -0
- package/dist/common-auth-embedded/claustrum/consumer.d.ts +102 -0
- package/dist/common-auth-embedded/claustrum/consumer.js +298 -0
- package/dist/common-auth-embedded/claustrum/custody.d.ts +175 -0
- package/dist/common-auth-embedded/claustrum/custody.js +354 -0
- package/dist/common-auth-embedded/claustrum/enrollment.d.ts +158 -0
- package/dist/common-auth-embedded/claustrum/enrollment.js +759 -0
- package/dist/common-auth-embedded/claustrum/errors.d.ts +16 -0
- package/dist/common-auth-embedded/claustrum/errors.js +8 -0
- package/dist/common-auth-embedded/claustrum/host-slot.d.ts +39 -0
- package/dist/common-auth-embedded/claustrum/host-slot.js +72 -0
- package/dist/common-auth-embedded/claustrum/index.d.ts +18 -0
- package/dist/common-auth-embedded/claustrum/index.js +22 -0
- package/dist/common-auth-embedded/claustrum/interlock.d.ts +27 -0
- package/dist/common-auth-embedded/claustrum/interlock.js +29 -0
- package/dist/common-auth-embedded/claustrum/roster.d.ts +208 -0
- package/dist/common-auth-embedded/claustrum/roster.js +536 -0
- package/dist/common-auth-embedded/commands/builtins.d.ts +71 -0
- package/dist/common-auth-embedded/commands/builtins.js +534 -0
- package/dist/common-auth-embedded/commands/index.d.ts +10 -0
- package/dist/common-auth-embedded/commands/index.js +5 -0
- package/dist/common-auth-embedded/commands/menu.d.ts +61 -0
- package/dist/common-auth-embedded/commands/menu.js +300 -0
- package/dist/common-auth-embedded/commands/model.d.ts +238 -0
- package/dist/common-auth-embedded/commands/model.js +16 -0
- package/dist/common-auth-embedded/commands/pi.d.ts +23 -0
- package/dist/common-auth-embedded/commands/pi.js +206 -0
- package/dist/common-auth-embedded/commands/seam.d.ts +72 -0
- package/dist/common-auth-embedded/commands/seam.js +301 -0
- package/dist/common-auth-embedded/fs/atomic-write.d.ts +20 -0
- package/dist/common-auth-embedded/fs/atomic-write.js +80 -0
- package/dist/common-auth-embedded/fs/index.d.ts +7 -0
- package/dist/common-auth-embedded/fs/index.js +6 -0
- package/dist/common-auth-embedded/fs/lock-constants.d.ts +14 -0
- package/dist/common-auth-embedded/fs/lock-constants.js +14 -0
- package/dist/common-auth-embedded/fs/refresh-file-lock.d.ts +33 -0
- package/dist/common-auth-embedded/fs/refresh-file-lock.js +501 -0
- package/dist/common-auth-embedded/fs/with-lock.d.ts +33 -0
- package/dist/common-auth-embedded/fs/with-lock.js +48 -0
- package/dist/common-auth-embedded/logger/capture-sink.d.ts +14 -0
- package/dist/common-auth-embedded/logger/capture-sink.js +13 -0
- package/dist/common-auth-embedded/logger/engine.d.ts +100 -0
- package/dist/common-auth-embedded/logger/engine.js +246 -0
- package/dist/common-auth-embedded/logger/index.d.ts +6 -0
- package/dist/common-auth-embedded/logger/index.js +3 -0
- package/dist/common-auth-embedded/logger/redact.d.ts +11 -0
- package/dist/common-auth-embedded/logger/redact.js +83 -0
- package/dist/common-auth-embedded/pi-slot/index.d.ts +3 -0
- package/dist/common-auth-embedded/pi-slot/index.js +2 -0
- package/dist/common-auth-embedded/pi-slot/lock.js +212 -0
- package/dist/common-auth-embedded/pi-slot/slot.d.ts +49 -0
- package/dist/common-auth-embedded/pi-slot/slot.js +383 -0
- package/dist/common-auth-embedded/quota/codec.d.ts +11 -0
- package/dist/common-auth-embedded/quota/codec.js +12 -0
- package/dist/common-auth-embedded/quota/format.d.ts +46 -0
- package/dist/common-auth-embedded/quota/format.js +138 -0
- package/dist/common-auth-embedded/quota/index.d.ts +10 -0
- package/dist/common-auth-embedded/quota/index.js +5 -0
- package/dist/common-auth-embedded/quota/map.d.ts +63 -0
- package/dist/common-auth-embedded/quota/map.js +105 -0
- package/dist/common-auth-embedded/quota/merge.d.ts +48 -0
- package/dist/common-auth-embedded/quota/merge.js +162 -0
- package/dist/common-auth-embedded/quota/projection.d.ts +64 -0
- package/dist/common-auth-embedded/quota/projection.js +134 -0
- package/dist/common-auth-embedded/routing/admission.d.ts +93 -0
- package/dist/common-auth-embedded/routing/admission.js +142 -0
- package/dist/common-auth-embedded/routing/index.d.ts +8 -0
- package/dist/common-auth-embedded/routing/index.js +4 -0
- package/dist/common-auth-embedded/routing/ordered.d.ts +47 -0
- package/dist/common-auth-embedded/routing/ordered.js +58 -0
- package/dist/common-auth-embedded/routing/pins.d.ts +22 -0
- package/dist/common-auth-embedded/routing/pins.js +34 -0
- package/dist/common-auth-embedded/routing/sticky.d.ts +158 -0
- package/dist/common-auth-embedded/routing/sticky.js +339 -0
- package/dist/common-auth-embedded/source-output.json +1090 -0
- package/dist/common-auth-embedded/store/attribution.d.ts +28 -0
- package/dist/common-auth-embedded/store/attribution.js +60 -0
- package/dist/common-auth-embedded/store/errors.d.ts +55 -0
- package/dist/common-auth-embedded/store/errors.js +38 -0
- package/dist/common-auth-embedded/store/hooks.d.ts +12 -0
- package/dist/common-auth-embedded/store/hooks.js +34 -0
- package/dist/common-auth-embedded/store/identity.d.ts +39 -0
- package/dist/common-auth-embedded/store/identity.js +79 -0
- package/dist/common-auth-embedded/store/index.d.ts +21 -0
- package/dist/common-auth-embedded/store/index.js +7 -0
- package/dist/common-auth-embedded/store/mutate.d.ts +189 -0
- package/dist/common-auth-embedded/store/mutate.js +500 -0
- package/dist/common-auth-embedded/store/pool.d.ts +196 -0
- package/dist/common-auth-embedded/store/pool.js +120 -0
- package/dist/common-auth-embedded/store/provider-state.d.ts +131 -0
- package/dist/common-auth-embedded/store/provider-state.js +226 -0
- package/dist/common-auth-embedded/store/publication.d.ts +47 -0
- package/dist/common-auth-embedded/store/publication.js +304 -0
- package/dist/common-auth-embedded/store/pull.d.ts +36 -0
- package/dist/common-auth-embedded/store/pull.js +143 -0
- package/dist/common-auth-embedded/store/refresh-lock.d.ts +63 -0
- package/dist/common-auth-embedded/store/refresh-lock.js +136 -0
- package/dist/common-auth-embedded/store/refresh.d.ts +72 -0
- package/dist/common-auth-embedded/store/refresh.js +225 -0
- package/dist/common-auth-embedded/store/reserved.js +13 -0
- package/dist/common-auth-embedded/store/rows.d.ts +313 -0
- package/dist/common-auth-embedded/store/rows.js +1258 -0
- package/dist/common-auth-embedded/store/runtime.d.ts +36 -0
- package/dist/common-auth-embedded/store/runtime.js +68 -0
- package/dist/common-auth-embedded/store/schema.d.ts +443 -0
- package/dist/common-auth-embedded/store/schema.js +754 -0
- package/dist/common-auth-embedded/store/settings.d.ts +63 -0
- package/dist/common-auth-embedded/store/settings.js +120 -0
- package/dist/common-auth-embedded/store/torn.d.ts +78 -0
- package/dist/common-auth-embedded/store/torn.js +294 -0
- package/dist/common-auth-embedded/util/any-signal.js +42 -0
- package/dist/common-auth-runtime.d.ts +73 -0
- package/dist/common-auth-runtime.d.ts.map +1 -0
- package/dist/common-auth-runtime.js +65 -0
- package/dist/common-auth-runtime.js.map +1 -0
- package/dist/credential-redaction.d.ts +13 -0
- package/dist/credential-redaction.d.ts.map +1 -0
- package/dist/credential-redaction.js +230 -0
- package/dist/credential-redaction.js.map +1 -0
- package/dist/fetch-timeout.d.ts +4 -2
- package/dist/fetch-timeout.d.ts.map +1 -1
- package/dist/fetch-timeout.js +121 -14
- package/dist/fetch-timeout.js.map +1 -1
- package/dist/fingerprint.d.ts +3 -3
- package/dist/fingerprint.d.ts.map +1 -1
- package/dist/fingerprint.js +4 -4
- package/dist/fingerprint.js.map +1 -1
- package/dist/index.d.ts +16 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +15 -0
- package/dist/index.js.map +1 -1
- package/dist/model-registry.d.ts +16 -0
- package/dist/model-registry.d.ts.map +1 -1
- package/dist/model-registry.js +242 -30
- package/dist/model-registry.js.map +1 -1
- package/dist/quota-manager.d.ts.map +1 -1
- package/dist/quota-manager.js +35 -10
- package/dist/quota-manager.js.map +1 -1
- package/dist/quota-presentation.d.ts +10 -0
- package/dist/quota-presentation.d.ts.map +1 -0
- package/dist/quota-presentation.js +60 -0
- package/dist/quota-presentation.js.map +1 -0
- package/dist/quota-types.d.ts +2 -0
- package/dist/quota-types.d.ts.map +1 -1
- package/dist/rotation.d.ts +8 -0
- package/dist/rotation.d.ts.map +1 -1
- package/dist/rotation.js +24 -0
- package/dist/rotation.js.map +1 -1
- package/dist/transform/agy-generation.d.ts +3 -0
- package/dist/transform/agy-generation.d.ts.map +1 -0
- package/dist/transform/agy-generation.js +28 -0
- package/dist/transform/agy-generation.js.map +1 -0
- package/dist/transform/claude.d.ts +7 -3
- package/dist/transform/claude.d.ts.map +1 -1
- package/dist/transform/claude.js +8 -2
- package/dist/transform/claude.js.map +1 -1
- package/dist/transform/index.d.ts +1 -0
- package/dist/transform/index.d.ts.map +1 -1
- package/dist/transform/index.js +1 -0
- package/dist/transform/index.js.map +1 -1
- package/dist/transform/model-resolver.d.ts +2 -1
- package/dist/transform/model-resolver.d.ts.map +1 -1
- package/dist/transform/model-resolver.js +46 -5
- package/dist/transform/model-resolver.js.map +1 -1
- package/dist/transform/types.d.ts +1 -1
- package/dist/transform/types.d.ts.map +1 -1
- package/dist/vault-account-source.d.ts +183 -0
- package/dist/vault-account-source.d.ts.map +1 -0
- package/dist/vault-account-source.js +296 -0
- package/dist/vault-account-source.js.map +1 -0
- package/dist/vault-enrollment-authority.d.ts +16 -0
- package/dist/vault-enrollment-authority.d.ts.map +1 -0
- package/dist/vault-enrollment-authority.js +19 -0
- package/dist/vault-enrollment-authority.js.map +1 -0
- package/dist/vault-family.d.ts +11 -0
- package/dist/vault-family.d.ts.map +1 -0
- package/dist/vault-family.js +24 -0
- package/dist/vault-family.js.map +1 -0
- package/dist/vault-provider-state.d.ts +162 -0
- package/dist/vault-provider-state.d.ts.map +1 -0
- package/dist/vault-provider-state.js +422 -0
- package/dist/vault-provider-state.js.map +1 -0
- package/package.json +39 -2
|
@@ -0,0 +1,171 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The `/antigravity` command menu, shared by every host adapter.
|
|
3
|
+
*
|
|
4
|
+
* The menu itself (payloads, confirmation, redaction, per-invocation
|
|
5
|
+
* isolation and action dispatch) is common-auth's public `./commands` entry;
|
|
6
|
+
* this module only supplies Antigravity's section bodies. The Accounts,
|
|
7
|
+
* Quota, Routing and Limits slots replace the library's store-backed
|
|
8
|
+
* built-ins, because the built-ins would put each account's row id and
|
|
9
|
+
* recorded identity (its email) into the payload a renderer receives.
|
|
10
|
+
*
|
|
11
|
+
* Accounts are shown by position ("Account 2") and carry an opaque item id:
|
|
12
|
+
* a random string bound for the life of the menu to one exact credential
|
|
13
|
+
* (row id, credential epoch and recorded identity). An action runs against
|
|
14
|
+
* the credential captured in the read that built it, and the repository
|
|
15
|
+
* refuses it if that credential has since changed. Item ids are never reused
|
|
16
|
+
* for another credential and positions are never accepted as targets.
|
|
17
|
+
*
|
|
18
|
+
* Nothing here imports a host SDK; the commands module, the account source
|
|
19
|
+
* and the settings arrive from the caller.
|
|
20
|
+
*/
|
|
21
|
+
import type { AccountRepository, RowRef } from './account-repository-types.ts';
|
|
22
|
+
import type { CommonAuthCommandsModule } from './common-auth-runtime.ts';
|
|
23
|
+
type Commands = CommonAuthCommandsModule;
|
|
24
|
+
type CommandMenu = ReturnType<Commands['createCommandMenu']>;
|
|
25
|
+
type CommandMenuOptions = Parameters<Commands['createCommandMenu']>[0];
|
|
26
|
+
type PluginSection = NonNullable<CommandMenuOptions['cache']>;
|
|
27
|
+
type PluginExtraSection = NonNullable<CommandMenuOptions['extras']>[number];
|
|
28
|
+
type SectionContent = Awaited<ReturnType<PluginSection['build']>>;
|
|
29
|
+
type ItemDefinition = NonNullable<SectionContent['items']>[number];
|
|
30
|
+
type ActionDefinition = NonNullable<ItemDefinition['actions']>[number];
|
|
31
|
+
type ActionOutcome = Exclude<Awaited<ReturnType<ActionDefinition['run']>>, string>;
|
|
32
|
+
type CommandInvocation = Parameters<PluginSection['build']>[0];
|
|
33
|
+
/** The slash command's name, without the slash. */
|
|
34
|
+
export declare const ANTIGRAVITY_MENU_COMMAND = "antigravity";
|
|
35
|
+
export declare const ANTIGRAVITY_MENU_TITLE = "Antigravity";
|
|
36
|
+
/** `disabledReason` recorded when the user disables an account from the menu. */
|
|
37
|
+
export declare const ANTIGRAVITY_MENU_DISABLED_REASON = "disabled from the command menu";
|
|
38
|
+
/** The account operations the menu reads and writes. */
|
|
39
|
+
export type AntigravityMenuAccounts = Pick<AccountRepository, 'read' | 'setEnabled' | 'remove' | 'selectAccount'>;
|
|
40
|
+
/** Routing and killswitch values the Routing and Limits sections show. */
|
|
41
|
+
export interface AntigravityMenuSettings {
|
|
42
|
+
readonly routing: {
|
|
43
|
+
readonly cliFirst: boolean;
|
|
44
|
+
readonly quotaStyleFallback: boolean;
|
|
45
|
+
};
|
|
46
|
+
readonly killswitch: {
|
|
47
|
+
readonly enabled: boolean;
|
|
48
|
+
readonly minimumRemainingPercent: number;
|
|
49
|
+
};
|
|
50
|
+
}
|
|
51
|
+
/**
|
|
52
|
+
* The location's operator settings. `read` is called for every section
|
|
53
|
+
* build, so the menu always shows the current values; only the two update
|
|
54
|
+
* methods write.
|
|
55
|
+
*/
|
|
56
|
+
export interface AntigravityMenuSettingsSource {
|
|
57
|
+
read(): AntigravityMenuSettings | Promise<AntigravityMenuSettings>;
|
|
58
|
+
updateRouting(next: AntigravityMenuSettings['routing']): Promise<void>;
|
|
59
|
+
updateKillswitch(next: AntigravityMenuSettings['killswitch']): Promise<void>;
|
|
60
|
+
}
|
|
61
|
+
/**
|
|
62
|
+
* The outcome of one quota check over the menu's accounts. `checked` counts
|
|
63
|
+
* readings taken and recorded for exactly the credential they were asked
|
|
64
|
+
* for; `notChecked` counts the rest (refused because the credential changed
|
|
65
|
+
* or is unusable, or failed).
|
|
66
|
+
*/
|
|
67
|
+
export interface AntigravityQuotaCheckReport {
|
|
68
|
+
readonly checked: number;
|
|
69
|
+
readonly notChecked: number;
|
|
70
|
+
}
|
|
71
|
+
/** Options both menu modes share; the host's sections and the menu plumbing. */
|
|
72
|
+
interface AntigravityMenuSharedOptions {
|
|
73
|
+
/** common-auth's public `./commands` entry, as `loadCommonAuthCommands` returns it. */
|
|
74
|
+
readonly commands: Commands;
|
|
75
|
+
readonly cache?: PluginSection;
|
|
76
|
+
readonly diagnostics?: PluginSection;
|
|
77
|
+
readonly extras?: readonly PluginExtraSection[];
|
|
78
|
+
readonly logger?: CommandMenuOptions['logger'];
|
|
79
|
+
readonly redaction?: CommandMenuOptions['redaction'];
|
|
80
|
+
readonly now?: () => number;
|
|
81
|
+
}
|
|
82
|
+
/**
|
|
83
|
+
* A menu over an account repository (OpenCode): this module builds the
|
|
84
|
+
* Accounts, Quota, Routing and Limits sections from the repository and the
|
|
85
|
+
* location's operator settings.
|
|
86
|
+
*/
|
|
87
|
+
export interface AntigravityRepositoryMenuOptions extends AntigravityMenuSharedOptions {
|
|
88
|
+
readonly source: 'repository';
|
|
89
|
+
readonly accounts: AntigravityMenuAccounts;
|
|
90
|
+
readonly settings: AntigravityMenuSettingsSource;
|
|
91
|
+
/**
|
|
92
|
+
* Checks quota now for exactly the given account credentials and reports
|
|
93
|
+
* how many readings were taken. Without it the Quota section offers no
|
|
94
|
+
* check action.
|
|
95
|
+
*/
|
|
96
|
+
readonly refreshQuota?: (refs: readonly RowRef[], invocation: CommandInvocation) => Promise<AntigravityQuotaCheckReport>;
|
|
97
|
+
/**
|
|
98
|
+
* The host's login. It returns the text to show; the host owns the OAuth
|
|
99
|
+
* flow (browser, callback, manual paste) and adds the account itself.
|
|
100
|
+
*/
|
|
101
|
+
readonly login?: {
|
|
102
|
+
readonly label?: string;
|
|
103
|
+
run(invocation: CommandInvocation): Promise<string | ActionOutcome>;
|
|
104
|
+
};
|
|
105
|
+
/**
|
|
106
|
+
* Per-account quota floors the host keeps. Without it the account items
|
|
107
|
+
* offer no floor action.
|
|
108
|
+
*/
|
|
109
|
+
readonly accountLimits?: AntigravityAccountLimitSource;
|
|
110
|
+
/**
|
|
111
|
+
* The host's re-authentication of one account: a fresh sign-in that
|
|
112
|
+
* replaces exactly the credential named by the captured reference. It may
|
|
113
|
+
* finish later (a browser sign-in); it reports through the invocation.
|
|
114
|
+
* Without it the account items offer no Reauthorize action.
|
|
115
|
+
*/
|
|
116
|
+
readonly reauthorize?: {
|
|
117
|
+
readonly label?: string;
|
|
118
|
+
run(ref: RowRef, invocation: CommandInvocation): Promise<string | ActionOutcome>;
|
|
119
|
+
};
|
|
120
|
+
/** Item id source; defaults to 128 random bits. */
|
|
121
|
+
readonly createItemId?: () => string;
|
|
122
|
+
}
|
|
123
|
+
/**
|
|
124
|
+
* A per-account minimum remaining quota, kept by the host. The menu hands it
|
|
125
|
+
* the exact credential reference captured for the item, never a position,
|
|
126
|
+
* an id shown to the user or a value derived from a token; how the floor is
|
|
127
|
+
* stored stays private to the host. `write` answers `stale` (or throws the
|
|
128
|
+
* repository's attribution failure) when that credential is no longer the
|
|
129
|
+
* row's current one, and then writes nothing.
|
|
130
|
+
*/
|
|
131
|
+
export interface AntigravityAccountLimitSource {
|
|
132
|
+
/** The account's own floor, or null when it follows the global floor. */
|
|
133
|
+
read(ref: RowRef): number | null | Promise<number | null>;
|
|
134
|
+
/** Sets the floor; null returns the account to the global floor. */
|
|
135
|
+
write(ref: RowRef, minimumRemainingPercent: number | null): Promise<'applied' | 'stale'>;
|
|
136
|
+
}
|
|
137
|
+
/** The four account slots, each supplied by the host. */
|
|
138
|
+
export interface AntigravityMenuSections {
|
|
139
|
+
readonly accounts: PluginSection;
|
|
140
|
+
readonly quota: PluginSection;
|
|
141
|
+
readonly routing: PluginSection;
|
|
142
|
+
readonly limits: PluginSection;
|
|
143
|
+
}
|
|
144
|
+
/**
|
|
145
|
+
* A menu whose account slots the host builds itself (a single login or a
|
|
146
|
+
* vault-held account, with no account rows to expose). No repository is
|
|
147
|
+
* read or written; the host's items and actions run through the same
|
|
148
|
+
* library dispatcher.
|
|
149
|
+
*/
|
|
150
|
+
export interface AntigravitySectionsMenuOptions extends AntigravityMenuSharedOptions {
|
|
151
|
+
readonly source: 'sections';
|
|
152
|
+
readonly sections: AntigravityMenuSections;
|
|
153
|
+
}
|
|
154
|
+
export type AntigravityCommandMenuOptions = AntigravityRepositoryMenuOptions | AntigravitySectionsMenuOptions;
|
|
155
|
+
/** What a quota check shows: never success when no reading was taken. */
|
|
156
|
+
export declare function quotaCheckOutcome(report: AntigravityQuotaCheckReport): string | ActionOutcome;
|
|
157
|
+
/**
|
|
158
|
+
* The Routing and Limits sections over a settings source, for a host that
|
|
159
|
+
* supplies its own account slots (sections mode) but keeps the same
|
|
160
|
+
* operator settings as the repository-mode menu.
|
|
161
|
+
*/
|
|
162
|
+
export declare function antigravitySettingsSections(settings: AntigravityMenuSettingsSource): Pick<AntigravityMenuSections, 'routing' | 'limits'>;
|
|
163
|
+
/**
|
|
164
|
+
* Builds the `/antigravity` menu on common-auth's `createCommandMenu`. The
|
|
165
|
+
* four account slots replace the library's store-backed built-ins in both
|
|
166
|
+
* modes, so no pool store is passed; Cache, Diagnostics and extras are the
|
|
167
|
+
* host's.
|
|
168
|
+
*/
|
|
169
|
+
export declare function createAntigravityCommandMenu(options: AntigravityCommandMenuOptions): CommandMenu;
|
|
170
|
+
export {};
|
|
171
|
+
//# sourceMappingURL=antigravity-command-menu.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"antigravity-command-menu.d.ts","sourceRoot":"","sources":["../src/antigravity-command-menu.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;GAmBG;AAKH,OAAO,KAAK,EACV,iBAAiB,EAIjB,MAAM,EACP,MAAM,+BAA+B,CAAA;AACtC,OAAO,KAAK,EAAE,wBAAwB,EAAE,MAAM,0BAA0B,CAAA;AAGxE,KAAK,QAAQ,GAAG,wBAAwB,CAAA;AACxC,KAAK,WAAW,GAAG,UAAU,CAAC,QAAQ,CAAC,mBAAmB,CAAC,CAAC,CAAA;AAC5D,KAAK,kBAAkB,GAAG,UAAU,CAAC,QAAQ,CAAC,mBAAmB,CAAC,CAAC,CAAC,CAAC,CAAC,CAAA;AACtE,KAAK,aAAa,GAAG,WAAW,CAAC,kBAAkB,CAAC,OAAO,CAAC,CAAC,CAAA;AAC7D,KAAK,kBAAkB,GAAG,WAAW,CAAC,kBAAkB,CAAC,QAAQ,CAAC,CAAC,CAAC,MAAM,CAAC,CAAA;AAC3E,KAAK,cAAc,GAAG,OAAO,CAAC,UAAU,CAAC,aAAa,CAAC,OAAO,CAAC,CAAC,CAAC,CAAA;AACjE,KAAK,cAAc,GAAG,WAAW,CAAC,cAAc,CAAC,OAAO,CAAC,CAAC,CAAC,MAAM,CAAC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