@cortexkit/opencode-antigravity-auth 3.0.19 → 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/README.md +3 -1
- package/dist/cli.js +277 -150
- package/dist/cli.js.map +3 -3
- package/dist/cli.meta.json +43 -23
- package/dist/index.js +331 -204
- package/dist/index.js.map +3 -3
- package/dist/index.meta.json +43 -23
- package/dist/server.js +344 -217
- package/dist/server.js.map +3 -3
- package/dist/server.meta.json +1 -1
- package/dist/src/common-auth-embedded/claustrum/consumer.d.ts +10 -0
- package/dist/src/common-auth-embedded/claustrum/consumer.js +25 -0
- package/dist/src/common-auth-embedded/claustrum/custody.d.ts +6 -2
- package/dist/src/common-auth-embedded/claustrum/custody.js +45 -6
- package/dist/src/common-auth-embedded/claustrum/hub.d.ts +3 -1
- package/dist/src/common-auth-embedded/claustrum/hub.js +75 -6
- package/dist/src/common-auth-embedded/claustrum/insula.js +6 -0
- package/dist/src/common-auth-embedded/claustrum/roster.js +1 -1
- package/dist/src/common-auth-embedded/fs/refresh-file-lock.d.ts +2 -1
- package/dist/src/common-auth-embedded/fs/refresh-file-lock.js +3 -1
- package/dist/src/common-auth-embedded/fs/with-lock.js +1 -1
- package/dist/src/common-auth-embedded/opencode2/index.d.ts +1 -1
- package/dist/src/common-auth-embedded/opencode2/install.d.ts +4 -3
- package/dist/src/common-auth-embedded/opencode2/install.js +144 -17
- package/dist/src/common-auth-embedded/opencode2/types.d.ts +52 -1
- 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 +73 -53
- package/dist/src/ga/tui/host-ga.d.ts.map +1 -1
- package/dist/src/ga/tui/host-ga.js +2 -3
- package/dist/src/ga/tui/host-ga.js.map +1 -1
- package/dist/src/plugin/__fixtures__/verified-store.js +2 -2
- package/dist/src/server.d.ts +4 -4
- package/dist/src/server.js +4 -4
- 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 -35
- package/dist/src/tui/sidebar-frame.d.ts.map +1 -1
- package/dist/src/tui/sidebar-frame.js +91 -171
- package/dist/src/tui/sidebar-frame.js.map +1 -1
- package/dist/src/tui.js +3 -3
- 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/dist/types/src/common-auth-embedded/claustrum/consumer.d.ts +10 -0
- package/dist/types/src/common-auth-embedded/claustrum/custody.d.ts +6 -2
- package/dist/types/src/common-auth-embedded/claustrum/hub.d.ts +3 -1
- package/dist/types/src/common-auth-embedded/fs/refresh-file-lock.d.ts +2 -1
- package/dist/types/src/common-auth-embedded/opencode2/index.d.ts +1 -1
- package/dist/types/src/common-auth-embedded/opencode2/install.d.ts +4 -3
- package/dist/types/src/common-auth-embedded/opencode2/types.d.ts +52 -1
- package/dist/types/src/server.d.ts +4 -4
- package/package.json +3 -3
- package/src/common-auth-embedded/claustrum/consumer.d.ts +10 -0
- package/src/common-auth-embedded/claustrum/consumer.js +25 -0
- package/src/common-auth-embedded/claustrum/custody.d.ts +6 -2
- package/src/common-auth-embedded/claustrum/custody.js +45 -6
- package/src/common-auth-embedded/claustrum/hub.d.ts +3 -1
- package/src/common-auth-embedded/claustrum/hub.js +75 -6
- package/src/common-auth-embedded/claustrum/insula.js +6 -0
- package/src/common-auth-embedded/claustrum/roster.js +1 -1
- package/src/common-auth-embedded/fs/refresh-file-lock.d.ts +2 -1
- package/src/common-auth-embedded/fs/refresh-file-lock.js +3 -1
- package/src/common-auth-embedded/fs/with-lock.js +1 -1
- package/src/common-auth-embedded/opencode2/index.d.ts +1 -1
- package/src/common-auth-embedded/opencode2/install.d.ts +4 -3
- package/src/common-auth-embedded/opencode2/install.js +144 -17
- package/src/common-auth-embedded/opencode2/types.d.ts +52 -1
- 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 +73 -53
- 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 -503
- package/src/tui-compiled/tui.js +3 -3
- package/src/tui-ga-compiled/host-ga.js +2 -3
- package/src/tui-ga-compiled/shared/ced204104a639c9c-sidebar-frame.js +241 -503
- 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 -3
- package/src/tui-ga-raw/shared/ced204104a639c9c-sidebar-frame.tsx +209 -419
- 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 +209 -419
- package/src/tui-raw/tui.tsx +3 -3
- package/src/tui.tsx +3 -3
|
@@ -0,0 +1,666 @@
|
|
|
1
|
+
import { createTextNode as _$createTextNode } from "opentui:runtime-module:%40opentui%2Fsolid";
|
|
2
|
+
import { createComponent as _$createComponent } from "opentui:runtime-module:%40opentui%2Fsolid";
|
|
3
|
+
import { use as _$use } from "opentui:runtime-module:%40opentui%2Fsolid";
|
|
4
|
+
import { memo as _$memo } from "opentui:runtime-module:%40opentui%2Fsolid";
|
|
5
|
+
import { effect as _$effect } from "opentui:runtime-module:%40opentui%2Fsolid";
|
|
6
|
+
import { insertNode as _$insertNode } from "opentui:runtime-module:%40opentui%2Fsolid";
|
|
7
|
+
import { insert as _$insert } from "opentui:runtime-module:%40opentui%2Fsolid";
|
|
8
|
+
import { setProp as _$setProp } from "opentui:runtime-module:%40opentui%2Fsolid";
|
|
9
|
+
import { createElement as _$createElement } from "opentui:runtime-module:%40opentui%2Fsolid";
|
|
10
|
+
import { createContext, createMemo, createSignal, For, Index, mergeProps, Show, useContext } from "opentui:runtime-module:solid-js";
|
|
11
|
+
import { formatQuota, quotaWindowParts } from "./aef2402f8fc342f0-format.js";
|
|
12
|
+
const FrameContext = createContext();
|
|
13
|
+
function frameContext() {
|
|
14
|
+
const context = useContext(FrameContext);
|
|
15
|
+
if (!context) throw new Error('Sidebar primitives must be inside SidebarFrame');
|
|
16
|
+
return context;
|
|
17
|
+
}
|
|
18
|
+
function displayWidth(text) {
|
|
19
|
+
const bun = globalThis.Bun;
|
|
20
|
+
return bun?.stringWidth ? bun.stringWidth(text) : Array.from(text).length;
|
|
21
|
+
}
|
|
22
|
+
function fitText(text, columns) {
|
|
23
|
+
if (displayWidth(text) <= columns) return text;
|
|
24
|
+
if (columns < 1) return '';
|
|
25
|
+
let kept = '';
|
|
26
|
+
let used = 0;
|
|
27
|
+
for (const char of text) {
|
|
28
|
+
const width = displayWidth(char);
|
|
29
|
+
if (used + width > columns - 1) break;
|
|
30
|
+
kept += char;
|
|
31
|
+
used += width;
|
|
32
|
+
}
|
|
33
|
+
return `${kept}\u2026`;
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
/** A heading and its plugin-owned rows, with the frame's section spacing. */
|
|
37
|
+
export function SidebarSection(props) {
|
|
38
|
+
const context = frameContext();
|
|
39
|
+
return [(() => {
|
|
40
|
+
var _el$ = _$createElement("box"),
|
|
41
|
+
_el$2 = _$createElement("text"),
|
|
42
|
+
_el$3 = _$createElement("b");
|
|
43
|
+
_$insertNode(_el$, _el$2);
|
|
44
|
+
_$setProp(_el$, "width", '100%');
|
|
45
|
+
_$setProp(_el$, "marginTop", 1);
|
|
46
|
+
_$insertNode(_el$2, _el$3);
|
|
47
|
+
_$insert(_el$3, () => props.title);
|
|
48
|
+
_$effect(_$p => _$setProp(_el$2, "fg", context.theme.text, _$p));
|
|
49
|
+
return _el$;
|
|
50
|
+
})(), _$memo(() => props.children)];
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
/** Keep labels whole and reserve one blank cell before an ellipsized value. */
|
|
54
|
+
export function SidebarStatRow(props) {
|
|
55
|
+
const context = frameContext();
|
|
56
|
+
const [width, setWidth] = createSignal(0);
|
|
57
|
+
let row;
|
|
58
|
+
const value = () => width() <= 0 ? props.value : fitText(props.value, width() - displayWidth(props.label) - 1);
|
|
59
|
+
return (() => {
|
|
60
|
+
var _el$4 = _$createElement("box"),
|
|
61
|
+
_el$5 = _$createElement("text"),
|
|
62
|
+
_el$6 = _$createElement("text"),
|
|
63
|
+
_el$7 = _$createElement("b");
|
|
64
|
+
_$insertNode(_el$4, _el$5);
|
|
65
|
+
_$insertNode(_el$4, _el$6);
|
|
66
|
+
_$use(element => {
|
|
67
|
+
row = element;
|
|
68
|
+
}, _el$4);
|
|
69
|
+
_$setProp(_el$4, "onSizeChange", () => setWidth(row?.width ?? 0));
|
|
70
|
+
_$setProp(_el$4, "width", '100%');
|
|
71
|
+
_$setProp(_el$4, "flexDirection", 'row');
|
|
72
|
+
_$setProp(_el$4, "justifyContent", 'space-between');
|
|
73
|
+
_$setProp(_el$4, "columnGap", 1);
|
|
74
|
+
_$setProp(_el$5, "wrapMode", 'none');
|
|
75
|
+
_$setProp(_el$5, "flexShrink", 0);
|
|
76
|
+
_$insert(_el$5, () => props.label);
|
|
77
|
+
_$insertNode(_el$6, _el$7);
|
|
78
|
+
_$setProp(_el$6, "wrapMode", 'none');
|
|
79
|
+
_$setProp(_el$6, "flexShrink", 1);
|
|
80
|
+
_$insert(_el$7, value);
|
|
81
|
+
_$effect(_p$ => {
|
|
82
|
+
var _v$ = context.theme.textMuted,
|
|
83
|
+
_v$2 = context.theme[props.tone ?? 'text'];
|
|
84
|
+
_v$ !== _p$.e && (_p$.e = _$setProp(_el$5, "fg", _v$, _p$.e));
|
|
85
|
+
_v$2 !== _p$.t && (_p$.t = _$setProp(_el$6, "fg", _v$2, _p$.t));
|
|
86
|
+
return _p$;
|
|
87
|
+
}, {
|
|
88
|
+
e: undefined,
|
|
89
|
+
t: undefined
|
|
90
|
+
});
|
|
91
|
+
return _el$4;
|
|
92
|
+
})();
|
|
93
|
+
}
|
|
94
|
+
export function SidebarTextRow(props) {
|
|
95
|
+
const context = frameContext();
|
|
96
|
+
return (() => {
|
|
97
|
+
var _el$8 = _$createElement("text");
|
|
98
|
+
_$insert(_el$8, () => props.text);
|
|
99
|
+
_$effect(_p$ => {
|
|
100
|
+
var _v$3 = context.theme[props.tone ?? 'textMuted'],
|
|
101
|
+
_v$4 = props.wrapMode;
|
|
102
|
+
_v$3 !== _p$.e && (_p$.e = _$setProp(_el$8, "fg", _v$3, _p$.e));
|
|
103
|
+
_v$4 !== _p$.t && (_p$.t = _$setProp(_el$8, "wrapMode", _v$4, _p$.t));
|
|
104
|
+
return _p$;
|
|
105
|
+
}, {
|
|
106
|
+
e: undefined,
|
|
107
|
+
t: undefined
|
|
108
|
+
});
|
|
109
|
+
return _el$8;
|
|
110
|
+
})();
|
|
111
|
+
}
|
|
112
|
+
function usageTone(used, appearance) {
|
|
113
|
+
if (used >= appearance.errorThreshold) return 'error';
|
|
114
|
+
if (used >= appearance.warnThreshold) return 'warning';
|
|
115
|
+
return 'success';
|
|
116
|
+
}
|
|
117
|
+
function barSegments(used, appearance, pace) {
|
|
118
|
+
const width = appearance.barWidth;
|
|
119
|
+
const cells = pct => Math.max(0, Math.min(Math.round(pct / 100 * width), width));
|
|
120
|
+
const usedCells = cells(used);
|
|
121
|
+
const tone = usageTone(used, appearance);
|
|
122
|
+
// Keep the overlay's slot even when empty so live pacing changes reuse nodes.
|
|
123
|
+
const plain = [{
|
|
124
|
+
text: appearance.barFilledChar.repeat(usedCells),
|
|
125
|
+
tone
|
|
126
|
+
}, {
|
|
127
|
+
text: '',
|
|
128
|
+
tone
|
|
129
|
+
}, {
|
|
130
|
+
text: appearance.barEmptyChar.repeat(width - usedCells),
|
|
131
|
+
tone
|
|
132
|
+
}];
|
|
133
|
+
const overlay = pace?.overlay;
|
|
134
|
+
if (!overlay) return plain;
|
|
135
|
+
const paceCells = cells(overlay.percent);
|
|
136
|
+
const lo = Math.min(usedCells, paceCells);
|
|
137
|
+
const hi = Math.max(usedCells, paceCells);
|
|
138
|
+
if (lo === hi) return plain;
|
|
139
|
+
return [{
|
|
140
|
+
text: appearance.barFilledChar.repeat(lo),
|
|
141
|
+
tone
|
|
142
|
+
}, {
|
|
143
|
+
text: (overlay.kind === 'deficit' ? '\u2593' : '\u2592').repeat(hi - lo),
|
|
144
|
+
tone: overlay.kind === 'deficit' ? 'error' : 'success'
|
|
145
|
+
}, {
|
|
146
|
+
text: appearance.barEmptyChar.repeat(width - hi),
|
|
147
|
+
tone
|
|
148
|
+
}];
|
|
149
|
+
}
|
|
150
|
+
function QuotaRow(props) {
|
|
151
|
+
const context = frameContext();
|
|
152
|
+
const [columns, setColumns] = createSignal(0);
|
|
153
|
+
let row;
|
|
154
|
+
const label = () => props.part.name + ' '.repeat(Math.max(0, props.labelWidth - displayWidth(props.part.name)));
|
|
155
|
+
const figure = () => ` ${props.part.kind === 'budget' && props.part.figure.startsWith(`${props.part.name} `) ? props.part.figure.slice(props.part.name.length + 1) : props.part.figure}`;
|
|
156
|
+
const used = () => 100 - (props.part.remainingPercent ?? 100);
|
|
157
|
+
// Size notifications can recompute an unchanged fit after text has been flushed
|
|
158
|
+
// for the frame. Keep equal segments, and update fixed slots in place when the
|
|
159
|
+
// bar changes, rather than replacing text nodes during layout.
|
|
160
|
+
const segments = createMemo(() => barSegments(used(), {
|
|
161
|
+
...context.appearance,
|
|
162
|
+
barWidth: props.barCells
|
|
163
|
+
}, props.pace), undefined, {
|
|
164
|
+
equals: (previous, next) => previous.length === next.length && previous.every((segment, index) => segment.text === next[index]?.text && segment.tone === next[index]?.tone)
|
|
165
|
+
});
|
|
166
|
+
const paceLine = () => {
|
|
167
|
+
const text = props.pace?.text;
|
|
168
|
+
if (!text || columns() <= 0) return text;
|
|
169
|
+
return fitText(text, columns() - props.labelWidth);
|
|
170
|
+
};
|
|
171
|
+
return [(() => {
|
|
172
|
+
var _el$9 = _$createElement("box"),
|
|
173
|
+
_el$0 = _$createElement("box");
|
|
174
|
+
_$insertNode(_el$9, _el$0);
|
|
175
|
+
_$use(element => {
|
|
176
|
+
row = element;
|
|
177
|
+
}, _el$9);
|
|
178
|
+
_$setProp(_el$9, "onSizeChange", () => setColumns(row?.width ?? 0));
|
|
179
|
+
_$setProp(_el$9, "width", '100%');
|
|
180
|
+
_$setProp(_el$9, "flexDirection", 'row');
|
|
181
|
+
_$setProp(_el$9, "justifyContent", 'space-between');
|
|
182
|
+
_$setProp(_el$0, "flexDirection", 'row');
|
|
183
|
+
_$insert(_el$0, _$createComponent(Show, {
|
|
184
|
+
get when() {
|
|
185
|
+
return props.labelWidth > 0;
|
|
186
|
+
},
|
|
187
|
+
get children() {
|
|
188
|
+
var _el$1 = _$createElement("text");
|
|
189
|
+
_$setProp(_el$1, "wrapMode", 'none');
|
|
190
|
+
_$setProp(_el$1, "flexShrink", 0);
|
|
191
|
+
_$insert(_el$1, label);
|
|
192
|
+
_$effect(_$p => _$setProp(_el$1, "fg", context.theme.textMuted, _$p));
|
|
193
|
+
return _el$1;
|
|
194
|
+
}
|
|
195
|
+
}), null);
|
|
196
|
+
_$insert(_el$0, _$createComponent(Show, {
|
|
197
|
+
get when() {
|
|
198
|
+
return !props.part.resetSinceReading;
|
|
199
|
+
},
|
|
200
|
+
get fallback() {
|
|
201
|
+
return (() => {
|
|
202
|
+
var _el$13 = _$createElement("text");
|
|
203
|
+
_$insertNode(_el$13, _$createTextNode(`reset since last check`));
|
|
204
|
+
_$setProp(_el$13, "wrapMode", 'none');
|
|
205
|
+
_$effect(_$p => _$setProp(_el$13, "fg", context.theme.textMuted, _$p));
|
|
206
|
+
return _el$13;
|
|
207
|
+
})();
|
|
208
|
+
},
|
|
209
|
+
get children() {
|
|
210
|
+
return [_$createComponent(Show, {
|
|
211
|
+
get when() {
|
|
212
|
+
return props.barCells > 0;
|
|
213
|
+
},
|
|
214
|
+
get children() {
|
|
215
|
+
return _$createComponent(Index, {
|
|
216
|
+
get each() {
|
|
217
|
+
return segments();
|
|
218
|
+
},
|
|
219
|
+
children: segment => (() => {
|
|
220
|
+
var _el$15 = _$createElement("text");
|
|
221
|
+
_$setProp(_el$15, "wrapMode", 'none');
|
|
222
|
+
_$insert(_el$15, () => segment().text);
|
|
223
|
+
_$effect(_p$ => {
|
|
224
|
+
var _v$5 = context.theme[segment().tone],
|
|
225
|
+
_v$6 = segment().text ? undefined : 0;
|
|
226
|
+
_v$5 !== _p$.e && (_p$.e = _$setProp(_el$15, "fg", _v$5, _p$.e));
|
|
227
|
+
_v$6 !== _p$.t && (_p$.t = _$setProp(_el$15, "width", _v$6, _p$.t));
|
|
228
|
+
return _p$;
|
|
229
|
+
}, {
|
|
230
|
+
e: undefined,
|
|
231
|
+
t: undefined
|
|
232
|
+
});
|
|
233
|
+
return _el$15;
|
|
234
|
+
})()
|
|
235
|
+
});
|
|
236
|
+
}
|
|
237
|
+
}), (() => {
|
|
238
|
+
var _el$10 = _$createElement("text");
|
|
239
|
+
_$setProp(_el$10, "wrapMode", 'none');
|
|
240
|
+
_$insert(_el$10, figure);
|
|
241
|
+
_$effect(_$p => _$setProp(_el$10, "fg", context.theme[usageTone(used(), context.appearance)], _$p));
|
|
242
|
+
return _el$10;
|
|
243
|
+
})()];
|
|
244
|
+
}
|
|
245
|
+
}), null);
|
|
246
|
+
_$insert(_el$9, _$createComponent(Show, {
|
|
247
|
+
get when() {
|
|
248
|
+
return _$memo(() => !!props.showReset)() && !props.part.resetSinceReading;
|
|
249
|
+
},
|
|
250
|
+
get children() {
|
|
251
|
+
var _el$11 = _$createElement("box");
|
|
252
|
+
_$setProp(_el$11, "flexShrink", 0);
|
|
253
|
+
_$setProp(_el$11, "flexDirection", 'row');
|
|
254
|
+
_$setProp(_el$11, "justifyContent", 'flex-end');
|
|
255
|
+
_$insert(_el$11, _$createComponent(Show, {
|
|
256
|
+
get when() {
|
|
257
|
+
return props.part.resetIn;
|
|
258
|
+
},
|
|
259
|
+
get children() {
|
|
260
|
+
var _el$12 = _$createElement("text");
|
|
261
|
+
_$setProp(_el$12, "wrapMode", 'none');
|
|
262
|
+
_$insert(_el$12, () => props.part.resetIn);
|
|
263
|
+
_$effect(_$p => _$setProp(_el$12, "fg", context.theme.textMuted, _$p));
|
|
264
|
+
return _el$12;
|
|
265
|
+
}
|
|
266
|
+
}));
|
|
267
|
+
_$effect(_$p => _$setProp(_el$11, "width", props.resetWidth, _$p));
|
|
268
|
+
return _el$11;
|
|
269
|
+
}
|
|
270
|
+
}), null);
|
|
271
|
+
_$effect(_$p => _$setProp(_el$0, "flexShrink", props.part.resetSinceReading ? 1 : 0, _$p));
|
|
272
|
+
return _el$9;
|
|
273
|
+
})(), _$createComponent(Show, {
|
|
274
|
+
get when() {
|
|
275
|
+
return _$memo(() => !!!props.part.resetSinceReading)() && paceLine();
|
|
276
|
+
},
|
|
277
|
+
keyed: true,
|
|
278
|
+
children: line => (() => {
|
|
279
|
+
var _el$16 = _$createElement("box"),
|
|
280
|
+
_el$18 = _$createElement("text");
|
|
281
|
+
_$insertNode(_el$16, _el$18);
|
|
282
|
+
_$setProp(_el$16, "width", '100%');
|
|
283
|
+
_$setProp(_el$16, "flexDirection", 'row');
|
|
284
|
+
_$insert(_el$16, _$createComponent(Show, {
|
|
285
|
+
get when() {
|
|
286
|
+
return props.labelWidth > 0;
|
|
287
|
+
},
|
|
288
|
+
get children() {
|
|
289
|
+
var _el$17 = _$createElement("text");
|
|
290
|
+
_$insert(_el$17, () => ''.padEnd(props.labelWidth));
|
|
291
|
+
_$effect(_$p => _$setProp(_el$17, "fg", context.theme.textMuted, _$p));
|
|
292
|
+
return _el$17;
|
|
293
|
+
}
|
|
294
|
+
}), _el$18);
|
|
295
|
+
_$setProp(_el$18, "wrapMode", 'none');
|
|
296
|
+
_$insert(_el$18, line);
|
|
297
|
+
_$effect(_$p => _$setProp(_el$18, "fg", context.theme[props.pace?.tone ?? 'textMuted'], _$p));
|
|
298
|
+
return _el$16;
|
|
299
|
+
})()
|
|
300
|
+
})];
|
|
301
|
+
}
|
|
302
|
+
function CollapsedAccountRow(props) {
|
|
303
|
+
const context = frameContext();
|
|
304
|
+
const [width, setWidth] = createSignal(0);
|
|
305
|
+
let row;
|
|
306
|
+
const hasQuota = () => quotaWindowParts(props.account.quota, {
|
|
307
|
+
now: context.now
|
|
308
|
+
}).windows.length > 0;
|
|
309
|
+
const text = () => hasQuota() ? formatQuota(props.account.quota, {
|
|
310
|
+
now: context.now,
|
|
311
|
+
form: 'narrow'
|
|
312
|
+
}) : props.account.emptyQuotaText?.collapsed ?? '\u2014';
|
|
313
|
+
// Reserve an ellipsis, a separator and the trailing indicator before keeping quota.
|
|
314
|
+
const showQuota = () => width() <= 0 || displayWidth(text()) + 4 <= width();
|
|
315
|
+
const label = () => {
|
|
316
|
+
if (width() <= 0) return props.account.label;
|
|
317
|
+
return fitText(props.account.label, width() - (showQuota() ? displayWidth(text()) + 3 : 2));
|
|
318
|
+
};
|
|
319
|
+
const muted = () => props.account.collapsed?.muted ?? false;
|
|
320
|
+
const quotaTone = () => muted() ? 'textMuted' : props.account.collapsed?.quotaTone ?? 'success';
|
|
321
|
+
return (() => {
|
|
322
|
+
var _el$19 = _$createElement("box"),
|
|
323
|
+
_el$21 = _$createElement("box"),
|
|
324
|
+
_el$24 = _$createElement("text");
|
|
325
|
+
_$insertNode(_el$19, _el$21);
|
|
326
|
+
_$use(element => {
|
|
327
|
+
row = element;
|
|
328
|
+
}, _el$19);
|
|
329
|
+
_$setProp(_el$19, "onSizeChange", () => setWidth(row?.width ?? 0));
|
|
330
|
+
_$setProp(_el$19, "width", '100%');
|
|
331
|
+
_$setProp(_el$19, "flexDirection", 'row');
|
|
332
|
+
_$setProp(_el$19, "justifyContent", 'space-between');
|
|
333
|
+
_$insert(_el$19, _$createComponent(Show, {
|
|
334
|
+
get when() {
|
|
335
|
+
return label();
|
|
336
|
+
},
|
|
337
|
+
get children() {
|
|
338
|
+
var _el$20 = _$createElement("text");
|
|
339
|
+
_$setProp(_el$20, "wrapMode", 'none');
|
|
340
|
+
_$setProp(_el$20, "flexShrink", 1);
|
|
341
|
+
_$insert(_el$20, label);
|
|
342
|
+
_$effect(_$p => _$setProp(_el$20, "fg", context.theme[muted() ? 'textMuted' : 'text'], _$p));
|
|
343
|
+
return _el$20;
|
|
344
|
+
}
|
|
345
|
+
}), _el$21);
|
|
346
|
+
_$insertNode(_el$21, _el$24);
|
|
347
|
+
_$setProp(_el$21, "flexDirection", 'row');
|
|
348
|
+
_$setProp(_el$21, "flexShrink", 0);
|
|
349
|
+
_$insert(_el$21, _$createComponent(Show, {
|
|
350
|
+
get when() {
|
|
351
|
+
return showQuota();
|
|
352
|
+
},
|
|
353
|
+
get children() {
|
|
354
|
+
return _$createComponent(Show, {
|
|
355
|
+
get when() {
|
|
356
|
+
return _$memo(() => !!hasQuota())() && !muted();
|
|
357
|
+
},
|
|
358
|
+
get fallback() {
|
|
359
|
+
return (() => {
|
|
360
|
+
var _el$25 = _$createElement("text");
|
|
361
|
+
_$insert(_el$25, text);
|
|
362
|
+
_$effect(_$p => _$setProp(_el$25, "fg", context.theme.textMuted, _$p));
|
|
363
|
+
return _el$25;
|
|
364
|
+
})();
|
|
365
|
+
},
|
|
366
|
+
get children() {
|
|
367
|
+
var _el$22 = _$createElement("text"),
|
|
368
|
+
_el$23 = _$createElement("b");
|
|
369
|
+
_$insertNode(_el$22, _el$23);
|
|
370
|
+
_$insert(_el$23, text);
|
|
371
|
+
_$effect(_$p => _$setProp(_el$22, "fg", context.theme[quotaTone()], _$p));
|
|
372
|
+
return _el$22;
|
|
373
|
+
}
|
|
374
|
+
});
|
|
375
|
+
}
|
|
376
|
+
}), _el$24);
|
|
377
|
+
_$insert(_el$24, () => showQuota() ? ' ' : '', null);
|
|
378
|
+
_$insert(_el$24, () => props.account.blocked ? '\u2298' : '\u25cf', null);
|
|
379
|
+
_$effect(_p$ => {
|
|
380
|
+
var _v$7 = label() ? 1 : 0,
|
|
381
|
+
_v$8 = context.theme[props.account.indicatorTone];
|
|
382
|
+
_v$7 !== _p$.e && (_p$.e = _$setProp(_el$19, "columnGap", _v$7, _p$.e));
|
|
383
|
+
_v$8 !== _p$.t && (_p$.t = _$setProp(_el$24, "fg", _v$8, _p$.t));
|
|
384
|
+
return _p$;
|
|
385
|
+
}, {
|
|
386
|
+
e: undefined,
|
|
387
|
+
t: undefined
|
|
388
|
+
});
|
|
389
|
+
return _el$19;
|
|
390
|
+
})();
|
|
391
|
+
}
|
|
392
|
+
function AccountBlock(props) {
|
|
393
|
+
const context = frameContext();
|
|
394
|
+
const [columns, setColumns] = createSignal(0);
|
|
395
|
+
let block;
|
|
396
|
+
const rows = () => props.account.groups.flatMap(group => group.rows);
|
|
397
|
+
const labelWidth = () => Math.max(0, ...rows().map(({
|
|
398
|
+
part
|
|
399
|
+
}) => part.name ? Math.max(3, displayWidth(part.name) + 1) : 0));
|
|
400
|
+
const resetWidth = () => Math.max(0, ...rows().map(({
|
|
401
|
+
part
|
|
402
|
+
}) => part.resetSinceReading ? 0 : displayWidth(part.resetIn ?? '')));
|
|
403
|
+
const figureWidth = createMemo(() => Math.max(10, ...rows().filter(({
|
|
404
|
+
part
|
|
405
|
+
}) => !part.resetSinceReading).map(({
|
|
406
|
+
part
|
|
407
|
+
}) => displayWidth(` ${part.kind === 'budget' && part.figure.startsWith(`${part.name} `) ? part.figure.slice(part.name.length + 1) : part.figure}`))));
|
|
408
|
+
const fit = rowLabelWidth => {
|
|
409
|
+
const desired = context.appearance.barWidth;
|
|
410
|
+
// Four cells still distinguish quarters of a window without sacrificing its reset.
|
|
411
|
+
const minimum = Math.min(4, desired);
|
|
412
|
+
if (columns() <= 0) return {
|
|
413
|
+
barCells: desired,
|
|
414
|
+
showReset: resetWidth() > 0
|
|
415
|
+
};
|
|
416
|
+
const room = columns() - rowLabelWidth - figureWidth();
|
|
417
|
+
const withReset = room - resetWidth() - 1;
|
|
418
|
+
const showReset = resetWidth() > 0 && withReset >= minimum;
|
|
419
|
+
const available = showReset ? withReset : room;
|
|
420
|
+
return {
|
|
421
|
+
barCells: available >= minimum ? Math.min(desired, available) : 0,
|
|
422
|
+
showReset
|
|
423
|
+
};
|
|
424
|
+
};
|
|
425
|
+
const label = () => {
|
|
426
|
+
const full = `${props.account.label}${props.account.titleSuffix ? ` · ${props.account.titleSuffix}` : ''}`;
|
|
427
|
+
return columns() <= 0 ? full : fitText(full, columns() - displayWidth(props.account.status.text) - 1);
|
|
428
|
+
};
|
|
429
|
+
const age = () => quotaWindowParts(props.account.quota, {
|
|
430
|
+
now: context.now
|
|
431
|
+
}).age;
|
|
432
|
+
const hasRows = () => props.account.groups.some(group => group.rows.length > 0);
|
|
433
|
+
return (() => {
|
|
434
|
+
var _el$26 = _$createElement("box"),
|
|
435
|
+
_el$27 = _$createElement("box"),
|
|
436
|
+
_el$28 = _$createElement("text"),
|
|
437
|
+
_el$29 = _$createElement("b"),
|
|
438
|
+
_el$30 = _$createElement("text"),
|
|
439
|
+
_el$31 = _$createElement("b");
|
|
440
|
+
_$insertNode(_el$26, _el$27);
|
|
441
|
+
_$use(element => {
|
|
442
|
+
block = element;
|
|
443
|
+
}, _el$26);
|
|
444
|
+
_$setProp(_el$26, "onSizeChange", () => setColumns(block?.width ?? 0));
|
|
445
|
+
_$setProp(_el$26, "width", '100%');
|
|
446
|
+
_$setProp(_el$26, "flexDirection", 'column');
|
|
447
|
+
_$insertNode(_el$27, _el$28);
|
|
448
|
+
_$insertNode(_el$27, _el$30);
|
|
449
|
+
_$setProp(_el$27, "width", '100%');
|
|
450
|
+
_$setProp(_el$27, "flexDirection", 'row');
|
|
451
|
+
_$setProp(_el$27, "justifyContent", 'space-between');
|
|
452
|
+
_$setProp(_el$27, "columnGap", 1);
|
|
453
|
+
_$insertNode(_el$28, _el$29);
|
|
454
|
+
_$setProp(_el$28, "wrapMode", 'none');
|
|
455
|
+
_$setProp(_el$28, "flexShrink", 1);
|
|
456
|
+
_$insert(_el$29, label);
|
|
457
|
+
_$insertNode(_el$30, _el$31);
|
|
458
|
+
_$setProp(_el$30, "wrapMode", 'none');
|
|
459
|
+
_$setProp(_el$30, "flexShrink", 0);
|
|
460
|
+
_$insert(_el$31, () => props.account.status.text);
|
|
461
|
+
_$insert(_el$26, () => context.beforeQuota?.(props.account), null);
|
|
462
|
+
_$insert(_el$26, _$createComponent(Show, {
|
|
463
|
+
get when() {
|
|
464
|
+
return hasRows();
|
|
465
|
+
},
|
|
466
|
+
get fallback() {
|
|
467
|
+
return _$createComponent(SidebarTextRow, {
|
|
468
|
+
get text() {
|
|
469
|
+
return props.account.emptyQuotaText?.expanded ?? '\u2014';
|
|
470
|
+
},
|
|
471
|
+
wrapMode: "none"
|
|
472
|
+
});
|
|
473
|
+
},
|
|
474
|
+
get children() {
|
|
475
|
+
return _$createComponent(For, {
|
|
476
|
+
get each() {
|
|
477
|
+
return props.account.groups;
|
|
478
|
+
},
|
|
479
|
+
children: group => [_$createComponent(Show, {
|
|
480
|
+
get when() {
|
|
481
|
+
return group.title;
|
|
482
|
+
},
|
|
483
|
+
get children() {
|
|
484
|
+
return _$createComponent(SidebarTextRow, {
|
|
485
|
+
get text() {
|
|
486
|
+
return group.title ?? '';
|
|
487
|
+
},
|
|
488
|
+
tone: "text",
|
|
489
|
+
wrapMode: "none"
|
|
490
|
+
});
|
|
491
|
+
}
|
|
492
|
+
}), _$createComponent(For, {
|
|
493
|
+
get each() {
|
|
494
|
+
return group.rows;
|
|
495
|
+
},
|
|
496
|
+
children: row => {
|
|
497
|
+
const rowLabelWidth = () => row.part.name ? labelWidth() : 0;
|
|
498
|
+
const rowFit = createMemo(() => fit(rowLabelWidth()));
|
|
499
|
+
return _$createComponent(QuotaRow, {
|
|
500
|
+
get part() {
|
|
501
|
+
return row.part;
|
|
502
|
+
},
|
|
503
|
+
get pace() {
|
|
504
|
+
return row.pace;
|
|
505
|
+
},
|
|
506
|
+
get labelWidth() {
|
|
507
|
+
return rowLabelWidth();
|
|
508
|
+
},
|
|
509
|
+
get barCells() {
|
|
510
|
+
return rowFit().barCells;
|
|
511
|
+
},
|
|
512
|
+
get resetWidth() {
|
|
513
|
+
return resetWidth();
|
|
514
|
+
},
|
|
515
|
+
get showReset() {
|
|
516
|
+
return rowFit().showReset;
|
|
517
|
+
}
|
|
518
|
+
});
|
|
519
|
+
}
|
|
520
|
+
})]
|
|
521
|
+
});
|
|
522
|
+
}
|
|
523
|
+
}), null);
|
|
524
|
+
_$insert(_el$26, _$createComponent(Show, {
|
|
525
|
+
get when() {
|
|
526
|
+
return age();
|
|
527
|
+
},
|
|
528
|
+
children: text => _$createComponent(SidebarTextRow, {
|
|
529
|
+
get text() {
|
|
530
|
+
return text();
|
|
531
|
+
},
|
|
532
|
+
wrapMode: "none"
|
|
533
|
+
})
|
|
534
|
+
}), null);
|
|
535
|
+
_$insert(_el$26, () => context.afterQuota?.(props.account), null);
|
|
536
|
+
_$effect(_p$ => {
|
|
537
|
+
var _v$9 = props.marginTop,
|
|
538
|
+
_v$0 = context.theme.text,
|
|
539
|
+
_v$1 = context.theme[props.account.status.tone];
|
|
540
|
+
_v$9 !== _p$.e && (_p$.e = _$setProp(_el$26, "marginTop", _v$9, _p$.e));
|
|
541
|
+
_v$0 !== _p$.t && (_p$.t = _$setProp(_el$28, "fg", _v$0, _p$.t));
|
|
542
|
+
_v$1 !== _p$.a && (_p$.a = _$setProp(_el$30, "fg", _v$1, _p$.a));
|
|
543
|
+
return _p$;
|
|
544
|
+
}, {
|
|
545
|
+
e: undefined,
|
|
546
|
+
t: undefined,
|
|
547
|
+
a: undefined
|
|
548
|
+
});
|
|
549
|
+
return _el$26;
|
|
550
|
+
})();
|
|
551
|
+
}
|
|
552
|
+
|
|
553
|
+
/** Borderless, controlled presentation; host registration and provider policy stay in the plugin. */
|
|
554
|
+
export function SidebarFrame(props) {
|
|
555
|
+
const hasData = () => props.accounts.length > 0;
|
|
556
|
+
const headerLabel = () => !hasData() ? props.header.badge : `${props.collapsed ? '\u25b6' : '\u25bc'} ${props.header.badge}`;
|
|
557
|
+
// Missing semantic colors inherit normal text; an unset palette uses terminal defaults.
|
|
558
|
+
const context = mergeProps(props, {
|
|
559
|
+
get theme() {
|
|
560
|
+
const theme = props.theme;
|
|
561
|
+
return {
|
|
562
|
+
...theme,
|
|
563
|
+
textMuted: theme?.textMuted ?? theme?.text,
|
|
564
|
+
accent: theme?.accent ?? theme?.text,
|
|
565
|
+
success: theme?.success ?? theme?.text,
|
|
566
|
+
warning: theme?.warning ?? theme?.text,
|
|
567
|
+
error: theme?.error ?? theme?.text
|
|
568
|
+
};
|
|
569
|
+
}
|
|
570
|
+
});
|
|
571
|
+
// Inverting an incomplete badge palette can put light text on a light background.
|
|
572
|
+
const invertBadge = () => props.theme?.accent !== undefined && props.theme?.background !== undefined;
|
|
573
|
+
return _$createComponent(FrameContext.Provider, {
|
|
574
|
+
value: context,
|
|
575
|
+
get children() {
|
|
576
|
+
var _el$32 = _$createElement("box"),
|
|
577
|
+
_el$33 = _$createElement("box"),
|
|
578
|
+
_el$34 = _$createElement("box"),
|
|
579
|
+
_el$35 = _$createElement("text"),
|
|
580
|
+
_el$36 = _$createElement("b");
|
|
581
|
+
_$insertNode(_el$32, _el$33);
|
|
582
|
+
_$setProp(_el$32, "width", '100%');
|
|
583
|
+
_$setProp(_el$32, "flexDirection", 'column');
|
|
584
|
+
_$insertNode(_el$33, _el$34);
|
|
585
|
+
_$setProp(_el$33, "width", '100%');
|
|
586
|
+
_$setProp(_el$33, "flexDirection", 'row');
|
|
587
|
+
_$setProp(_el$33, "justifyContent", 'space-between');
|
|
588
|
+
_$setProp(_el$33, "alignItems", 'center');
|
|
589
|
+
_$setProp(_el$33, "onMouseDown", () => {
|
|
590
|
+
if (hasData()) props.onToggle();
|
|
591
|
+
});
|
|
592
|
+
_$insertNode(_el$34, _el$35);
|
|
593
|
+
_$setProp(_el$34, "paddingLeft", 1);
|
|
594
|
+
_$setProp(_el$34, "paddingRight", 1);
|
|
595
|
+
_$insertNode(_el$35, _el$36);
|
|
596
|
+
_$insert(_el$36, headerLabel);
|
|
597
|
+
_$insert(_el$33, _$createComponent(Show, {
|
|
598
|
+
get when() {
|
|
599
|
+
return props.header.version;
|
|
600
|
+
},
|
|
601
|
+
get children() {
|
|
602
|
+
var _el$37 = _$createElement("text");
|
|
603
|
+
_$insert(_el$37, () => props.header.version);
|
|
604
|
+
_$effect(_$p => _$setProp(_el$37, "fg", context.theme.textMuted, _$p));
|
|
605
|
+
return _el$37;
|
|
606
|
+
}
|
|
607
|
+
}), null);
|
|
608
|
+
_$insert(_el$32, _$createComponent(Show, {
|
|
609
|
+
get when() {
|
|
610
|
+
return _$memo(() => !!props.collapsed)() && hasData();
|
|
611
|
+
},
|
|
612
|
+
get children() {
|
|
613
|
+
return [_$createComponent(For, {
|
|
614
|
+
get each() {
|
|
615
|
+
return props.accounts;
|
|
616
|
+
},
|
|
617
|
+
children: account => _$createComponent(CollapsedAccountRow, {
|
|
618
|
+
account: account
|
|
619
|
+
})
|
|
620
|
+
}), _$memo(() => props.collapsedSections?.())];
|
|
621
|
+
}
|
|
622
|
+
}), null);
|
|
623
|
+
_$insert(_el$32, _$createComponent(Show, {
|
|
624
|
+
get when() {
|
|
625
|
+
return !props.collapsed || !hasData();
|
|
626
|
+
},
|
|
627
|
+
get children() {
|
|
628
|
+
return [_$createComponent(Show, {
|
|
629
|
+
get when() {
|
|
630
|
+
return _$memo(() => !!props.showQuota)() && hasData();
|
|
631
|
+
},
|
|
632
|
+
get children() {
|
|
633
|
+
return _$createComponent(SidebarSection, {
|
|
634
|
+
title: "Quota",
|
|
635
|
+
get children() {
|
|
636
|
+
return _$createComponent(For, {
|
|
637
|
+
get each() {
|
|
638
|
+
return props.accounts;
|
|
639
|
+
},
|
|
640
|
+
children: (account, index) => _$createComponent(AccountBlock, {
|
|
641
|
+
account: account,
|
|
642
|
+
get marginTop() {
|
|
643
|
+
return index() === 0 ? 0 : 1;
|
|
644
|
+
}
|
|
645
|
+
})
|
|
646
|
+
});
|
|
647
|
+
}
|
|
648
|
+
});
|
|
649
|
+
}
|
|
650
|
+
}), _$memo(() => props.sections?.())];
|
|
651
|
+
}
|
|
652
|
+
}), null);
|
|
653
|
+
_$effect(_p$ => {
|
|
654
|
+
var _v$10 = invertBadge() ? props.theme?.accent : undefined,
|
|
655
|
+
_v$11 = invertBadge() ? props.theme?.background : context.theme.accent;
|
|
656
|
+
_v$10 !== _p$.e && (_p$.e = _$setProp(_el$34, "backgroundColor", _v$10, _p$.e));
|
|
657
|
+
_v$11 !== _p$.t && (_p$.t = _$setProp(_el$35, "fg", _v$11, _p$.t));
|
|
658
|
+
return _p$;
|
|
659
|
+
}, {
|
|
660
|
+
e: undefined,
|
|
661
|
+
t: undefined
|
|
662
|
+
});
|
|
663
|
+
return _el$32;
|
|
664
|
+
}
|
|
665
|
+
});
|
|
666
|
+
}
|
|
@@ -65,11 +65,11 @@ import {
|
|
|
65
65
|
type MenuUi,
|
|
66
66
|
} from "./shared/07365a7d2ccade4c-host-api.js"
|
|
67
67
|
import {
|
|
68
|
+
AntigravitySidebar,
|
|
68
69
|
DEFAULT_FRAME_SETTINGS,
|
|
69
70
|
type FrameColor,
|
|
70
71
|
type FrameRoute,
|
|
71
72
|
type FrameTheme,
|
|
72
|
-
SidebarFrame,
|
|
73
73
|
} from "./shared/ced204104a639c9c-sidebar-frame.tsx"
|
|
74
74
|
|
|
75
75
|
export const GA_TUI_ID = 'cortexkit.antigravity-auth' as const
|
|
@@ -1542,7 +1542,6 @@ export function sidebarThemeFromHost(theme: GaTheme | undefined): FrameTheme {
|
|
|
1542
1542
|
textMuted: theme?.text?.muted ?? text,
|
|
1543
1543
|
accent,
|
|
1544
1544
|
background: theme?.background?.base ?? theme?.background?.raised?.base,
|
|
1545
|
-
borderActive: theme?.border?.base ?? accent,
|
|
1546
1545
|
success: feedback?.success?.base ?? feedback?.success?.muted,
|
|
1547
1546
|
warning: feedback?.warning?.base ?? feedback?.warning?.muted,
|
|
1548
1547
|
error: feedback?.error?.base ?? feedback?.error?.muted,
|
|
@@ -1571,7 +1570,7 @@ function GaSidebar(props: {
|
|
|
1571
1570
|
}
|
|
1572
1571
|
}
|
|
1573
1572
|
return (
|
|
1574
|
-
<
|
|
1573
|
+
<AntigravitySidebar
|
|
1575
1574
|
theme={() => sidebarThemeFromHost(props.theme())}
|
|
1576
1575
|
settings={() => DEFAULT_FRAME_SETTINGS}
|
|
1577
1576
|
version={props.version}
|