@cortexkit/opencode-antigravity-auth 3.0.20 → 3.0.21
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 +75 -32
- package/dist/cli.js.map +3 -3
- package/dist/cli.meta.json +31 -11
- package/dist/index.js +75 -32
- package/dist/index.js.map +3 -3
- package/dist/index.meta.json +31 -11
- package/dist/server.js +75 -32
- package/dist/server.js.map +3 -3
- package/dist/server.meta.json +1 -1
- package/dist/src/common-auth-embedded/claustrum/custody.js +25 -0
- package/dist/src/common-auth-embedded/claustrum/hub.js +20 -1
- package/dist/src/common-auth-embedded/claustrum/insula.js +6 -0
- package/dist/src/common-auth-embedded/quota-sidebar/index.d.ts +86 -0
- package/dist/src/common-auth-embedded/quota-sidebar/index.tsx +630 -0
- package/dist/src/common-auth-embedded/source-output.json +37 -17
- package/dist/src/ga/tui/host-ga.d.ts.map +1 -1
- package/dist/src/ga/tui/host-ga.js +2 -2
- package/dist/src/ga/tui/host-ga.js.map +1 -1
- package/dist/src/plugin/__fixtures__/verified-store.js +2 -2
- package/dist/src/tui/quota-layout.d.ts +4 -58
- package/dist/src/tui/quota-layout.d.ts.map +1 -1
- package/dist/src/tui/quota-layout.js +4 -90
- package/dist/src/tui/quota-layout.js.map +1 -1
- package/dist/src/tui/sidebar-frame.d.ts +4 -34
- package/dist/src/tui/sidebar-frame.d.ts.map +1 -1
- package/dist/src/tui/sidebar-frame.js +91 -167
- package/dist/src/tui/sidebar-frame.js.map +1 -1
- package/dist/src/tui.js +2 -2
- package/dist/src/tui.js.map +1 -1
- package/dist/tui-build-map.json +27 -13
- package/dist/tui-ga-build-map.json +28 -13
- package/package.json +2 -2
- package/src/common-auth-embedded/claustrum/custody.js +25 -0
- package/src/common-auth-embedded/claustrum/hub.js +20 -1
- package/src/common-auth-embedded/claustrum/insula.js +6 -0
- package/src/common-auth-embedded/quota-sidebar/index.d.ts +86 -0
- package/src/common-auth-embedded/quota-sidebar/index.tsx +630 -0
- package/src/common-auth-embedded/source-output.json +37 -17
- package/src/tui-compiled/common-auth-embedded/quota-sidebar/index.js +666 -0
- package/src/tui-compiled/tui/quota-layout.js +5 -330
- package/src/tui-compiled/tui/sidebar-frame.js +241 -466
- package/src/tui-compiled/tui.js +2 -2
- package/src/tui-ga-compiled/host-ga.js +2 -2
- package/src/tui-ga-compiled/shared/ced204104a639c9c-sidebar-frame.js +241 -466
- package/src/tui-ga-compiled/shared/dd4c9e1a907f8ef0-quota-layout.js +5 -330
- package/src/tui-ga-compiled/shared/e4ec36f367492969-index.js +666 -0
- package/src/tui-ga-raw/host-ga.tsx +2 -2
- package/src/tui-ga-raw/shared/ced204104a639c9c-sidebar-frame.tsx +211 -399
- package/src/tui-ga-raw/shared/dd4c9e1a907f8ef0-quota-layout.tsx +10 -301
- package/src/tui-ga-raw/shared/e4ec36f367492969-index.tsx +630 -0
- package/src/tui-raw/common-auth-embedded/quota-sidebar/index.tsx +630 -0
- package/src/tui-raw/tui/quota-layout.tsx +10 -301
- package/src/tui-raw/tui/sidebar-frame.tsx +211 -399
- package/src/tui-raw/tui.tsx +2 -2
- package/src/tui.tsx +2 -2
|
@@ -1,11 +1,12 @@
|
|
|
1
1
|
{
|
|
2
2
|
"schema": 1,
|
|
3
|
-
"compiler": "@cortexkit/common-auth/tui-build@0.
|
|
3
|
+
"compiler": "@cortexkit/common-auth/tui-build@0.32.1",
|
|
4
4
|
"bun": "1.4.2",
|
|
5
5
|
"raw": {
|
|
6
6
|
"selector": "selector.js",
|
|
7
7
|
"externals": [
|
|
8
8
|
"@opentui/core",
|
|
9
|
+
"@opentui/solid",
|
|
9
10
|
"solid-js"
|
|
10
11
|
],
|
|
11
12
|
"files": [
|
|
@@ -79,11 +80,18 @@
|
|
|
79
80
|
"sha256": "c97d7b942476301768f4c74e3ba277ed56ab450b3b179dea08d5f561b42ee622",
|
|
80
81
|
"transform": "public-raw"
|
|
81
82
|
},
|
|
83
|
+
{
|
|
84
|
+
"source": "src/common-auth-embedded/quota-sidebar/index.tsx",
|
|
85
|
+
"output": "src/tui-ga-raw/shared/e4ec36f367492969-index.tsx",
|
|
86
|
+
"bytes": 19158,
|
|
87
|
+
"sha256": "ed2e1d75ab103d5ad698c48c207cb31beec19072cbf7e2c9f9286b3439149b21",
|
|
88
|
+
"transform": "public-raw"
|
|
89
|
+
},
|
|
82
90
|
{
|
|
83
91
|
"source": "src/tui/quota-layout.tsx",
|
|
84
92
|
"output": "src/tui-ga-raw/shared/dd4c9e1a907f8ef0-quota-layout.tsx",
|
|
85
|
-
"bytes":
|
|
86
|
-
"sha256": "
|
|
93
|
+
"bytes": 3066,
|
|
94
|
+
"sha256": "27c91d606d0c129a0e7d99ef1bd114bd4faac21c868f471b834bef706bef3ea3",
|
|
87
95
|
"transform": "public-raw"
|
|
88
96
|
},
|
|
89
97
|
{
|
|
@@ -96,15 +104,15 @@
|
|
|
96
104
|
{
|
|
97
105
|
"source": "src/tui/sidebar-frame.tsx",
|
|
98
106
|
"output": "src/tui-ga-raw/shared/ced204104a639c9c-sidebar-frame.tsx",
|
|
99
|
-
"bytes":
|
|
100
|
-
"sha256": "
|
|
107
|
+
"bytes": 12930,
|
|
108
|
+
"sha256": "2ff228e1f1b8b2472d61636e5543284e8a2c7b3adbe9a99cea0f4e9179c5d665",
|
|
101
109
|
"transform": "public-raw"
|
|
102
110
|
},
|
|
103
111
|
{
|
|
104
112
|
"source": "src/ga/tui/host-ga.tsx",
|
|
105
113
|
"output": "src/tui-ga-raw/host-ga.tsx",
|
|
106
|
-
"bytes":
|
|
107
|
-
"sha256": "
|
|
114
|
+
"bytes": 59262,
|
|
115
|
+
"sha256": "8c63f170f0c1f62432127ff66e5fa659fae0778f898d892c0f6cee287ee17603",
|
|
108
116
|
"transform": "public-raw"
|
|
109
117
|
},
|
|
110
118
|
{
|
|
@@ -190,11 +198,18 @@
|
|
|
190
198
|
"sha256": "0f03fad2e1c68cf827b44b749807c1760222a577775a37bb500df0f721e6f26a",
|
|
191
199
|
"transform": "public-solid-runtime"
|
|
192
200
|
},
|
|
201
|
+
{
|
|
202
|
+
"source": "src/common-auth-embedded/quota-sidebar/index.tsx",
|
|
203
|
+
"output": "src/tui-ga-compiled/shared/e4ec36f367492969-index.js",
|
|
204
|
+
"bytes": 24768,
|
|
205
|
+
"sha256": "21020c8e77d1cb769d31546f3f08e1098ea578e1b9b19e212f9fae3552967f4e",
|
|
206
|
+
"transform": "public-solid-runtime"
|
|
207
|
+
},
|
|
193
208
|
{
|
|
194
209
|
"source": "src/tui/quota-layout.tsx",
|
|
195
210
|
"output": "src/tui-ga-compiled/shared/dd4c9e1a907f8ef0-quota-layout.js",
|
|
196
|
-
"bytes":
|
|
197
|
-
"sha256": "
|
|
211
|
+
"bytes": 1778,
|
|
212
|
+
"sha256": "bc7677e2348cd0b37d010ed2342c26242b43860513bc688dc134d7d3b5da837f",
|
|
198
213
|
"transform": "public-solid-runtime"
|
|
199
214
|
},
|
|
200
215
|
{
|
|
@@ -207,15 +222,15 @@
|
|
|
207
222
|
{
|
|
208
223
|
"source": "src/tui/sidebar-frame.tsx",
|
|
209
224
|
"output": "src/tui-ga-compiled/shared/ced204104a639c9c-sidebar-frame.js",
|
|
210
|
-
"bytes":
|
|
211
|
-
"sha256": "
|
|
225
|
+
"bytes": 14296,
|
|
226
|
+
"sha256": "0158754e17db32c7915a9147a2271a92bc7098f82dba5c71ea75b55a65402b44",
|
|
212
227
|
"transform": "public-solid-runtime"
|
|
213
228
|
},
|
|
214
229
|
{
|
|
215
230
|
"source": "src/ga/tui/host-ga.tsx",
|
|
216
231
|
"output": "src/tui-ga-compiled/host-ga.js",
|
|
217
|
-
"bytes":
|
|
218
|
-
"sha256": "
|
|
232
|
+
"bytes": 47485,
|
|
233
|
+
"sha256": "6d5cc2d26ec8934ec26fad5327e1bc7067b708c83332c789b6292f0d711b21d0",
|
|
219
234
|
"transform": "public-solid-runtime"
|
|
220
235
|
},
|
|
221
236
|
{
|
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.21",
|
|
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.21",
|
|
134
134
|
"@cortexkit/private-files": "0.2.2",
|
|
135
135
|
"jsonc-parser": "^3.3.1",
|
|
136
136
|
"xdg-basedir": "^5.1.0",
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { channel } from 'node:diagnostics_channel';
|
|
1
2
|
import { ClaustrumCredentialError, } from '@cortexkit/claustrum-client';
|
|
2
3
|
import { createLogger } from '../logger/index.js';
|
|
3
4
|
import { ClaustrumUnreachableError, classifyVaultFailure, } from './availability.js';
|
|
@@ -27,6 +28,8 @@ function scopedRetryReason(served, current) {
|
|
|
27
28
|
return 'rotated';
|
|
28
29
|
}
|
|
29
30
|
const defaultLogger = createLogger('claustrum');
|
|
31
|
+
// Opt-in diagnostics let tests retain wait phases without logging each vault read.
|
|
32
|
+
const phaseDiagnostics = channel('common-auth.claustrum.phases');
|
|
30
33
|
/**
|
|
31
34
|
* Decide whether a request that got a 401 should retry with the freshly
|
|
32
35
|
* re-authorized receipt, and log the decision. The vault can refresh a
|
|
@@ -280,6 +283,11 @@ export class ClaustrumScopedCustody {
|
|
|
280
283
|
}
|
|
281
284
|
async #token(signal) {
|
|
282
285
|
this.#check(signal);
|
|
286
|
+
if (phaseDiagnostics.hasSubscribers)
|
|
287
|
+
phaseDiagnostics.publish({
|
|
288
|
+
logger: this.#logger,
|
|
289
|
+
phase: 'token read begin',
|
|
290
|
+
});
|
|
283
291
|
const pending = this.#readToken();
|
|
284
292
|
this.#tokenReads.add(pending);
|
|
285
293
|
let value;
|
|
@@ -288,6 +296,11 @@ export class ClaustrumScopedCustody {
|
|
|
288
296
|
}
|
|
289
297
|
finally {
|
|
290
298
|
this.#tokenReads.delete(pending);
|
|
299
|
+
if (phaseDiagnostics.hasSubscribers)
|
|
300
|
+
phaseDiagnostics.publish({
|
|
301
|
+
logger: this.#logger,
|
|
302
|
+
phase: 'token read end',
|
|
303
|
+
});
|
|
291
304
|
}
|
|
292
305
|
this.#check(signal);
|
|
293
306
|
if (!/^[0-9a-f]{64}$/.test(value.token) ||
|
|
@@ -359,6 +372,11 @@ export class ClaustrumScopedCustody {
|
|
|
359
372
|
this.#kept.clear();
|
|
360
373
|
throw error;
|
|
361
374
|
}
|
|
375
|
+
if (phaseDiagnostics.hasSubscribers)
|
|
376
|
+
phaseDiagnostics.publish({
|
|
377
|
+
logger: this.#logger,
|
|
378
|
+
phase: 'list scoped begin',
|
|
379
|
+
});
|
|
362
380
|
try {
|
|
363
381
|
inventory = await this.#call(() => this.#client.listScoped(token), signal);
|
|
364
382
|
}
|
|
@@ -366,6 +384,13 @@ export class ClaustrumScopedCustody {
|
|
|
366
384
|
this.listFailed(error);
|
|
367
385
|
throw error;
|
|
368
386
|
}
|
|
387
|
+
finally {
|
|
388
|
+
if (phaseDiagnostics.hasSubscribers)
|
|
389
|
+
phaseDiagnostics.publish({
|
|
390
|
+
logger: this.#logger,
|
|
391
|
+
phase: 'list scoped end',
|
|
392
|
+
});
|
|
393
|
+
}
|
|
369
394
|
const skipped = [];
|
|
370
395
|
const refused = [];
|
|
371
396
|
let notMine = 0;
|
|
@@ -11,6 +11,7 @@
|
|
|
11
11
|
// different processes already share, plus the base-view rule, so a commit
|
|
12
12
|
// never replaces a view another process committed after this hub listed.
|
|
13
13
|
import { createHash } from 'node:crypto';
|
|
14
|
+
import { channel } from 'node:diagnostics_channel';
|
|
14
15
|
import { readdir, stat } from 'node:fs/promises';
|
|
15
16
|
import { dirname, join, resolve } from 'node:path';
|
|
16
17
|
import { createLogger } from '../logger/index.js';
|
|
@@ -766,7 +767,25 @@ export class ClaustrumDiscoveryHub {
|
|
|
766
767
|
throw base;
|
|
767
768
|
// A member's first roster under this key carries the declines and
|
|
768
769
|
// order of its newest roster under an older key.
|
|
769
|
-
|
|
770
|
+
let seed;
|
|
771
|
+
if (!base.file) {
|
|
772
|
+
const phaseDiagnostics = channel('common-auth.claustrum.phases');
|
|
773
|
+
if (phaseDiagnostics.hasSubscribers)
|
|
774
|
+
phaseDiagnostics.publish({
|
|
775
|
+
logger: this.#logger,
|
|
776
|
+
phase: `seed read ${entry.provider} begin`,
|
|
777
|
+
});
|
|
778
|
+
try {
|
|
779
|
+
seed = await this.#seed(entry);
|
|
780
|
+
}
|
|
781
|
+
finally {
|
|
782
|
+
if (phaseDiagnostics.hasSubscribers)
|
|
783
|
+
phaseDiagnostics.publish({
|
|
784
|
+
logger: this.#logger,
|
|
785
|
+
phase: `seed read ${entry.provider} end`,
|
|
786
|
+
});
|
|
787
|
+
}
|
|
788
|
+
}
|
|
770
789
|
const roster = await refreshVaultRoster({
|
|
771
790
|
path: entry.path,
|
|
772
791
|
custody: { discover: async () => share },
|
|
@@ -443,6 +443,12 @@ export class InsulaQuotaSource {
|
|
|
443
443
|
...(typeof entry.source === 'string' && { source: entry.source }),
|
|
444
444
|
},
|
|
445
445
|
};
|
|
446
|
+
// Kept usage must not trigger a provider poll after a non-local failure.
|
|
447
|
+
// Only an explicitly local failure permits fallback; unknown causes do not.
|
|
448
|
+
if (entry.stale !== undefined &&
|
|
449
|
+
(!record(entry.stale) ||
|
|
450
|
+
entry.stale.class !== 'local_source_unavailable'))
|
|
451
|
+
return { miss: 'upstream-failed', reading };
|
|
446
452
|
return now >= fetchedAt + MAX_AGE || entry.stale !== undefined
|
|
447
453
|
? { miss: 'stale', reading }
|
|
448
454
|
: { reading };
|
|
@@ -0,0 +1,86 @@
|
|
|
1
|
+
import type { RGBA } from '@opentui/core';
|
|
2
|
+
import type { JSX } from '@opentui/solid';
|
|
3
|
+
import type { QuotaWindowPart } from '../quota/format.js';
|
|
4
|
+
import type { ProjectedQuota } from '../quota/projection.js';
|
|
5
|
+
export type Tone = 'text' | 'textMuted' | 'accent' | 'success' | 'warning' | 'error';
|
|
6
|
+
export type SidebarTheme = Readonly<Partial<Record<Tone | 'background' | 'borderActive', RGBA | string | undefined>>>;
|
|
7
|
+
export interface SidebarAppearance {
|
|
8
|
+
barWidth: number;
|
|
9
|
+
barFilledChar: string;
|
|
10
|
+
barEmptyChar: string;
|
|
11
|
+
warnThreshold: number;
|
|
12
|
+
errorThreshold: number;
|
|
13
|
+
}
|
|
14
|
+
export interface PaceView {
|
|
15
|
+
text: string;
|
|
16
|
+
tone: Tone;
|
|
17
|
+
/** The elapsed-window percentage, not the difference from usage. */
|
|
18
|
+
overlay?: {
|
|
19
|
+
kind: 'reserve' | 'deficit';
|
|
20
|
+
percent: number;
|
|
21
|
+
};
|
|
22
|
+
}
|
|
23
|
+
export interface QuotaGroupView {
|
|
24
|
+
title?: string;
|
|
25
|
+
rows: readonly {
|
|
26
|
+
part: QuotaWindowPart;
|
|
27
|
+
pace?: PaceView;
|
|
28
|
+
}[];
|
|
29
|
+
}
|
|
30
|
+
export interface AccountView {
|
|
31
|
+
id: string;
|
|
32
|
+
label: string;
|
|
33
|
+
titleSuffix?: string;
|
|
34
|
+
status: {
|
|
35
|
+
text: string;
|
|
36
|
+
tone: Tone;
|
|
37
|
+
};
|
|
38
|
+
blocked: boolean;
|
|
39
|
+
indicatorTone: Tone;
|
|
40
|
+
quota: ProjectedQuota | undefined;
|
|
41
|
+
groups: readonly QuotaGroupView[];
|
|
42
|
+
emptyQuotaText?: {
|
|
43
|
+
expanded: string;
|
|
44
|
+
collapsed: string;
|
|
45
|
+
};
|
|
46
|
+
/** Presentation decided by the plugin, never inferred from status or freshness. */
|
|
47
|
+
collapsed?: {
|
|
48
|
+
quotaTone?: Tone;
|
|
49
|
+
muted?: boolean;
|
|
50
|
+
};
|
|
51
|
+
}
|
|
52
|
+
export interface SidebarFrameProps {
|
|
53
|
+
header: {
|
|
54
|
+
badge: string;
|
|
55
|
+
version?: string;
|
|
56
|
+
};
|
|
57
|
+
accounts: readonly AccountView[];
|
|
58
|
+
theme?: SidebarTheme;
|
|
59
|
+
appearance: SidebarAppearance;
|
|
60
|
+
showQuota: boolean;
|
|
61
|
+
now: number;
|
|
62
|
+
collapsed: boolean;
|
|
63
|
+
onToggle: () => void;
|
|
64
|
+
beforeQuota?: (account: AccountView) => JSX.Element;
|
|
65
|
+
afterQuota?: (account: AccountView) => JSX.Element;
|
|
66
|
+
sections?: () => JSX.Element;
|
|
67
|
+
collapsedSections?: () => JSX.Element;
|
|
68
|
+
}
|
|
69
|
+
/** A heading and its plugin-owned rows, with the frame's section spacing. */
|
|
70
|
+
export declare function SidebarSection(props: {
|
|
71
|
+
title: string;
|
|
72
|
+
children?: JSX.Element;
|
|
73
|
+
}): any;
|
|
74
|
+
/** Keep labels whole and reserve one blank cell before an ellipsized value. */
|
|
75
|
+
export declare function SidebarStatRow(props: {
|
|
76
|
+
label: string;
|
|
77
|
+
value: string;
|
|
78
|
+
tone?: Tone;
|
|
79
|
+
}): any;
|
|
80
|
+
export declare function SidebarTextRow(props: {
|
|
81
|
+
text: string;
|
|
82
|
+
tone?: Tone;
|
|
83
|
+
wrapMode?: JSX.IntrinsicElements['text']['wrapMode'];
|
|
84
|
+
}): any;
|
|
85
|
+
/** Borderless, controlled presentation; host registration and provider policy stay in the plugin. */
|
|
86
|
+
export declare function SidebarFrame(props: SidebarFrameProps): any;
|