@cortexkit/opencode-antigravity-auth 3.0.14 → 3.0.16
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 +257 -57
- package/dist/cli.js.map +3 -3
- package/dist/cli.meta.json +11 -11
- package/dist/index.js +468 -90
- package/dist/index.js.map +3 -3
- package/dist/index.meta.json +14 -14
- package/dist/server.js +499 -95
- package/dist/server.js.map +3 -3
- package/dist/server.meta.json +1 -1
- package/dist/src/ga/tui/host-ga.d.ts +55 -2
- package/dist/src/ga/tui/host-ga.d.ts.map +1 -1
- package/dist/src/ga/tui/host-ga.js +73 -43
- package/dist/src/ga/tui/host-ga.js.map +1 -1
- package/dist/src/plugin/ga-location-services.d.ts.map +1 -1
- package/dist/src/plugin/ga-location-services.js +49 -5
- package/dist/src/plugin/ga-location-services.js.map +1 -1
- package/dist/src/plugin/shared/vault-request-credentials.d.ts +33 -13
- package/dist/src/plugin/shared/vault-request-credentials.d.ts.map +1 -1
- package/dist/src/plugin/shared/vault-request-credentials.js +97 -44
- package/dist/src/plugin/shared/vault-request-credentials.js.map +1 -1
- package/dist/src/plugin/storage.d.ts +17 -0
- package/dist/src/plugin/storage.d.ts.map +1 -1
- package/dist/src/plugin/storage.js +44 -10
- package/dist/src/plugin/storage.js.map +1 -1
- package/dist/src/runtime-paths.d.ts +2 -1
- package/dist/src/runtime-paths.d.ts.map +1 -1
- package/dist/src/runtime-paths.js +5 -5
- package/dist/src/runtime-paths.js.map +1 -1
- package/dist/src/tui/quota-layout.d.ts +1 -1
- package/dist/src/tui/quota-layout.js +1 -1
- package/dist/src/tui/sidebar-frame.d.ts +109 -0
- package/dist/src/tui/sidebar-frame.d.ts.map +1 -0
- package/dist/src/tui/sidebar-frame.js +244 -0
- package/dist/src/tui/sidebar-frame.js.map +1 -0
- package/dist/src/tui.d.ts.map +1 -1
- package/dist/src/tui.js +11 -251
- package/dist/src/tui.js.map +1 -1
- package/dist/tui-build-map.json +120 -92
- package/dist/tui-ga-build-map.json +22 -8
- package/dist/types/src/plugin/ga-location-services.d.ts.map +1 -1
- package/dist/types/src/plugin/shared/vault-request-credentials.d.ts +33 -13
- package/dist/types/src/plugin/shared/vault-request-credentials.d.ts.map +1 -1
- package/dist/types/src/plugin/storage.d.ts +17 -0
- package/dist/types/src/plugin/storage.d.ts.map +1 -1
- package/dist/types/src/runtime-paths.d.ts +2 -1
- package/dist/types/src/runtime-paths.d.ts.map +1 -1
- package/package.json +2 -2
- package/src/tui/entry.mjs +19 -1
- package/src/tui-compiled/sidebar-projection.js +119 -0
- package/src/tui-compiled/tui/quota-layout.js +1 -1
- package/src/tui-compiled/tui/sidebar-frame.js +657 -0
- package/src/tui-compiled/tui.js +25 -606
- package/src/tui-ga-compiled/host-ga.js +116 -124
- package/src/tui-ga-compiled/shared/ced204104a639c9c-sidebar-frame.js +657 -0
- package/src/tui-ga-compiled/shared/dd4c9e1a907f8ef0-quota-layout.js +1 -1
- package/src/tui-ga-raw/host-ga.tsx +157 -95
- package/src/tui-ga-raw/shared/ced204104a639c9c-sidebar-frame.tsx +603 -0
- package/src/tui-ga-raw/shared/dd4c9e1a907f8ef0-quota-layout.tsx +1 -1
- package/src/tui-raw/sidebar-projection.js +119 -0
- package/src/tui-raw/tui/quota-layout.tsx +1 -1
- package/src/tui-raw/tui/sidebar-frame.tsx +603 -0
- package/src/tui-raw/tui.tsx +25 -523
- package/src/tui.tsx +25 -523
|
@@ -1,11 +1,5 @@
|
|
|
1
1
|
import { memo as _$memo } from "opentui:runtime-module:%40opentui%2Fsolid";
|
|
2
|
-
import { insert as _$insert } from "opentui:runtime-module:%40opentui%2Fsolid";
|
|
3
2
|
import { createComponent as _$createComponent } from "opentui:runtime-module:%40opentui%2Fsolid";
|
|
4
|
-
import { createTextNode as _$createTextNode } from "opentui:runtime-module:%40opentui%2Fsolid";
|
|
5
|
-
import { insertNode as _$insertNode } from "opentui:runtime-module:%40opentui%2Fsolid";
|
|
6
|
-
import { use as _$use } from "opentui:runtime-module:%40opentui%2Fsolid";
|
|
7
|
-
import { setProp as _$setProp } from "opentui:runtime-module:%40opentui%2Fsolid";
|
|
8
|
-
import { createElement as _$createElement } from "opentui:runtime-module:%40opentui%2Fsolid";
|
|
9
3
|
/** @jsxImportSource @opentui/solid */
|
|
10
4
|
|
|
11
5
|
/**
|
|
@@ -49,12 +43,11 @@ import { createElement as _$createElement } from "opentui:runtime-module:%40open
|
|
|
49
43
|
* server code, and nothing writes to the terminal or forces a theme.
|
|
50
44
|
*/
|
|
51
45
|
|
|
52
|
-
import { createSignal
|
|
46
|
+
import { createSignal } from "opentui:runtime-module:solid-js";
|
|
53
47
|
import { projectAccount, projectSidebar } from "./shared/8ae1927e5910ea81-sidebar-projection.js";
|
|
54
48
|
import { MenuRefusedError, openAntigravityMenu } from "./shared/0e19a88ff3535906-command-dialogs.js";
|
|
55
49
|
import { ANTIGRAVITY_MENU_COMMAND, ANTIGRAVITY_MENU_TITLE } from "./shared/07365a7d2ccade4c-host-api.js";
|
|
56
|
-
import {
|
|
57
|
-
import { fitRouteParts } from "./shared/6ca47cd4ec33fe72-route-layout.js";
|
|
50
|
+
import { DEFAULT_FRAME_SETTINGS, SidebarFrame } from "./shared/ced204104a639c9c-sidebar-frame.js";
|
|
58
51
|
export const GA_TUI_ID = 'cortexkit.antigravity-auth';
|
|
59
52
|
export const GA_RPC_ID = 'antigravity-auth';
|
|
60
53
|
export const GA_RPC_VERSION = 1;
|
|
@@ -67,6 +60,11 @@ const MAX_PULLS_PER_TICK = 4;
|
|
|
67
60
|
|
|
68
61
|
// ── Host surface (structural subset of the GA TUI context) ─────────────────
|
|
69
62
|
|
|
63
|
+
/**
|
|
64
|
+
* The host's durable plugin storage, as far as the sidebar uses it: one
|
|
65
|
+
* JSON store and the function that changes it.
|
|
66
|
+
*/
|
|
67
|
+
|
|
70
68
|
/** The parts of the GA TUI `Context` this adapter uses. */
|
|
71
69
|
|
|
72
70
|
// ── Wire shapes ─────────────────────────────────────────────────────────────
|
|
@@ -1024,121 +1022,103 @@ export async function pollGaOnce(options) {
|
|
|
1024
1022
|
|
|
1025
1023
|
// ── Sidebar ─────────────────────────────────────────────────────────────────
|
|
1026
1024
|
|
|
1027
|
-
|
|
1028
|
-
|
|
1029
|
-
|
|
1030
|
-
|
|
1031
|
-
|
|
1032
|
-
|
|
1033
|
-
|
|
1025
|
+
/**
|
|
1026
|
+
* The OpenCode 2 host theme tokens the sidebar reads (the host's resolved
|
|
1027
|
+
* theme, as far as this sidebar uses it). Any of them may be missing.
|
|
1028
|
+
*/
|
|
1029
|
+
|
|
1030
|
+
/**
|
|
1031
|
+
* Maps the OpenCode 2 semantic theme tokens onto the frame's OpenCode 1
|
|
1032
|
+
* names. A missing token falls back to a sibling token; with none at all
|
|
1033
|
+
* the color stays `undefined`, so the host's default color shows and no
|
|
1034
|
+
* color is ever fixed here.
|
|
1035
|
+
*/
|
|
1036
|
+
export function sidebarThemeFromHost(theme) {
|
|
1037
|
+
const text = theme?.text?.base ?? theme?.text?.muted ?? theme?.text?.action?.primary?.base;
|
|
1038
|
+
const accent = theme?.text?.action?.primary?.base ?? text;
|
|
1039
|
+
const feedback = theme?.text?.feedback;
|
|
1040
|
+
return {
|
|
1041
|
+
text,
|
|
1042
|
+
textMuted: theme?.text?.muted ?? text,
|
|
1043
|
+
accent,
|
|
1044
|
+
background: theme?.background?.base ?? theme?.background?.raised?.base,
|
|
1045
|
+
borderActive: theme?.border?.base ?? accent,
|
|
1046
|
+
success: feedback?.success?.base ?? feedback?.success?.muted,
|
|
1047
|
+
warning: feedback?.warning?.base ?? feedback?.warning?.muted,
|
|
1048
|
+
error: feedback?.error?.base ?? feedback?.error?.muted
|
|
1049
|
+
};
|
|
1050
|
+
}
|
|
1034
1051
|
function GaSidebar(props) {
|
|
1035
|
-
// The route
|
|
1052
|
+
// The route belongs to one session; show it only in that session's
|
|
1036
1053
|
// sidebar, never another session's.
|
|
1037
1054
|
const route = () => {
|
|
1038
1055
|
const view = props.view();
|
|
1039
1056
|
if (view === undefined || view.scope.kind !== 'session') return null;
|
|
1040
|
-
|
|
1041
|
-
|
|
1042
|
-
|
|
1043
|
-
|
|
1044
|
-
|
|
1045
|
-
|
|
1057
|
+
if (view.scope.sessionID !== props.sessionID || view.route === null) return null;
|
|
1058
|
+
return {
|
|
1059
|
+
...(view.route.strategy ? {
|
|
1060
|
+
strategy: view.route.strategy
|
|
1061
|
+
} : {}),
|
|
1062
|
+
family: view.route.modelFamily,
|
|
1063
|
+
style: view.route.headerStyle
|
|
1064
|
+
};
|
|
1046
1065
|
};
|
|
1047
|
-
|
|
1048
|
-
|
|
1049
|
-
|
|
1050
|
-
|
|
1051
|
-
|
|
1052
|
-
|
|
1053
|
-
|
|
1054
|
-
|
|
1055
|
-
|
|
1056
|
-
|
|
1066
|
+
return _$createComponent(SidebarFrame, {
|
|
1067
|
+
theme: () => sidebarThemeFromHost(props.theme()),
|
|
1068
|
+
settings: () => DEFAULT_FRAME_SETTINGS,
|
|
1069
|
+
get version() {
|
|
1070
|
+
return props.version;
|
|
1071
|
+
},
|
|
1072
|
+
get collapsed() {
|
|
1073
|
+
return props.collapsed;
|
|
1074
|
+
},
|
|
1075
|
+
get onToggleCollapsed() {
|
|
1076
|
+
return props.toggleCollapsed;
|
|
1077
|
+
},
|
|
1078
|
+
accounts: () => props.view()?.accounts ?? [],
|
|
1079
|
+
route: route,
|
|
1080
|
+
quotaBackoffUntil: () => props.view()?.quotaBackoffUntil ?? undefined,
|
|
1081
|
+
lastError: () => undefined,
|
|
1082
|
+
now: () => props.view()?.readAt ?? 0
|
|
1083
|
+
});
|
|
1084
|
+
}
|
|
1085
|
+
|
|
1086
|
+
/** Where the collapse choice is kept in the host's plugin storage. */
|
|
1087
|
+
export const GA_SIDEBAR_STORE_KEY = 'antigravity-auth.sidebar';
|
|
1088
|
+
|
|
1089
|
+
/**
|
|
1090
|
+
* The collapse state: the host's durable plugin storage when it has one, so
|
|
1091
|
+
* the choice survives a reload; for this TUI session otherwise.
|
|
1092
|
+
*/
|
|
1093
|
+
function createGaCollapse(storage, logger) {
|
|
1094
|
+
const saved = storage?.store(GA_SIDEBAR_STORE_KEY, {
|
|
1095
|
+
initial: {
|
|
1096
|
+
collapsed: false
|
|
1097
|
+
}
|
|
1098
|
+
});
|
|
1099
|
+
// A click updates the sidebar at once: the local choice wins while its
|
|
1100
|
+
// save is pending, and once storage holds it the stored value decides
|
|
1101
|
+
// again. Without storage the local choice lasts for the session.
|
|
1102
|
+
const [chosen, setChosen] = createSignal(undefined);
|
|
1103
|
+
const collapsed = () => chosen() ?? saved?.[0].collapsed === true;
|
|
1104
|
+
const toggle = () => {
|
|
1105
|
+
const next = !collapsed();
|
|
1106
|
+
setChosen(next);
|
|
1107
|
+
if (!saved) return;
|
|
1108
|
+
saved[1](draft => {
|
|
1109
|
+
draft.collapsed = next;
|
|
1110
|
+
}).then(() => {
|
|
1111
|
+
if (chosen() === next && saved[0].collapsed === next) setChosen(undefined);
|
|
1112
|
+
}, error => {
|
|
1113
|
+
logger?.warn('sidebar-collapse-not-saved', {
|
|
1114
|
+
error: error instanceof Error ? error.name : typeof error
|
|
1115
|
+
});
|
|
1057
1116
|
});
|
|
1058
1117
|
};
|
|
1059
|
-
return
|
|
1060
|
-
|
|
1061
|
-
|
|
1062
|
-
|
|
1063
|
-
_el$4 = _$createElement("b");
|
|
1064
|
-
_$insertNode(_el$, _el$2);
|
|
1065
|
-
_$setProp(_el$, "flexDirection", 'column');
|
|
1066
|
-
_$setProp(_el$, "width", '100%');
|
|
1067
|
-
_$insertNode(_el$2, _el$3);
|
|
1068
|
-
_$use(element => {
|
|
1069
|
-
titleRow = element;
|
|
1070
|
-
}, _el$2);
|
|
1071
|
-
_$setProp(_el$2, "onSizeChange", measureContentWidth);
|
|
1072
|
-
_$setProp(_el$2, "width", '100%');
|
|
1073
|
-
_$setProp(_el$2, "flexDirection", 'row');
|
|
1074
|
-
_$insertNode(_el$3, _el$4);
|
|
1075
|
-
_$insertNode(_el$4, _$createTextNode(`Antigravity`));
|
|
1076
|
-
_$insert(_el$, _$createComponent(Show, {
|
|
1077
|
-
get when() {
|
|
1078
|
-
return props.view();
|
|
1079
|
-
},
|
|
1080
|
-
get fallback() {
|
|
1081
|
-
return (() => {
|
|
1082
|
-
var _el$6 = _$createElement("text");
|
|
1083
|
-
_$insertNode(_el$6, _$createTextNode(`connecting…`));
|
|
1084
|
-
return _el$6;
|
|
1085
|
-
})();
|
|
1086
|
-
},
|
|
1087
|
-
children: view => [_$createComponent(For, {
|
|
1088
|
-
get each() {
|
|
1089
|
-
return view().projected.accounts;
|
|
1090
|
-
},
|
|
1091
|
-
children: (account, index) => _$createComponent(Show, {
|
|
1092
|
-
get when() {
|
|
1093
|
-
return view().accounts[index()];
|
|
1094
|
-
},
|
|
1095
|
-
children: source => _$createComponent(QuotaAccountBlock, {
|
|
1096
|
-
palette: HOST_COLORS,
|
|
1097
|
-
appearance: DEFAULT_QUOTA_APPEARANCE,
|
|
1098
|
-
get account() {
|
|
1099
|
-
return source();
|
|
1100
|
-
},
|
|
1101
|
-
get status() {
|
|
1102
|
-
return account.status;
|
|
1103
|
-
},
|
|
1104
|
-
get statusTone() {
|
|
1105
|
-
return account.statusTone;
|
|
1106
|
-
},
|
|
1107
|
-
now: () => view().readAt,
|
|
1108
|
-
width: contentWidth,
|
|
1109
|
-
get marginTop() {
|
|
1110
|
-
return index() === 0 ? 0 : 1;
|
|
1111
|
-
},
|
|
1112
|
-
get children() {
|
|
1113
|
-
var _el$8 = _$createElement("text");
|
|
1114
|
-
_$insert(_el$8, () => ` ${account.health}`);
|
|
1115
|
-
return _el$8;
|
|
1116
|
-
}
|
|
1117
|
-
})
|
|
1118
|
-
})
|
|
1119
|
-
}), _$createComponent(Show, {
|
|
1120
|
-
get when() {
|
|
1121
|
-
return routeLine();
|
|
1122
|
-
},
|
|
1123
|
-
children: line => (() => {
|
|
1124
|
-
var _el$9 = _$createElement("text");
|
|
1125
|
-
_$setProp(_el$9, "wrapMode", 'none');
|
|
1126
|
-
_$insert(_el$9, line);
|
|
1127
|
-
return _el$9;
|
|
1128
|
-
})()
|
|
1129
|
-
}), _$createComponent(For, {
|
|
1130
|
-
get each() {
|
|
1131
|
-
return view().projected.notices;
|
|
1132
|
-
},
|
|
1133
|
-
children: notice => (() => {
|
|
1134
|
-
var _el$0 = _$createElement("text");
|
|
1135
|
-
_$insert(_el$0, notice);
|
|
1136
|
-
return _el$0;
|
|
1137
|
-
})()
|
|
1138
|
-
})]
|
|
1139
|
-
}), null);
|
|
1140
|
-
return _el$;
|
|
1141
|
-
})();
|
|
1118
|
+
return {
|
|
1119
|
+
collapsed,
|
|
1120
|
+
toggle
|
|
1121
|
+
};
|
|
1142
1122
|
}
|
|
1143
1123
|
|
|
1144
1124
|
// ── Plugin setup ────────────────────────────────────────────────────────────
|
|
@@ -1167,12 +1147,23 @@ export function setupGaTui(context, options = {}) {
|
|
|
1167
1147
|
const active = () => !client.disposed();
|
|
1168
1148
|
const ui = createGaMenuUi(context, active);
|
|
1169
1149
|
const [view, setView] = createSignal(undefined);
|
|
1150
|
+
const collapse = createGaCollapse(context.storage, logger);
|
|
1170
1151
|
const releaseSlot = context.ui.slot({
|
|
1171
1152
|
append: 'sidebar.content',
|
|
1172
1153
|
render: input => _$createComponent(GaSidebar, {
|
|
1173
1154
|
view: view,
|
|
1174
1155
|
get sessionID() {
|
|
1175
1156
|
return input.sessionID;
|
|
1157
|
+
},
|
|
1158
|
+
theme: () => context.theme,
|
|
1159
|
+
get version() {
|
|
1160
|
+
return options.version ?? '';
|
|
1161
|
+
},
|
|
1162
|
+
get collapsed() {
|
|
1163
|
+
return collapse.collapsed;
|
|
1164
|
+
},
|
|
1165
|
+
get toggleCollapsed() {
|
|
1166
|
+
return collapse.toggle;
|
|
1176
1167
|
}
|
|
1177
1168
|
})
|
|
1178
1169
|
});
|
|
@@ -1185,12 +1176,8 @@ export function setupGaTui(context, options = {}) {
|
|
|
1185
1176
|
setView({
|
|
1186
1177
|
scope: snapshot.scope,
|
|
1187
1178
|
accounts: snapshot.accounts,
|
|
1188
|
-
|
|
1189
|
-
|
|
1190
|
-
route: snapshot.route,
|
|
1191
|
-
status: snapshot.status,
|
|
1192
|
-
now: readAt
|
|
1193
|
-
}),
|
|
1179
|
+
route: snapshot.route,
|
|
1180
|
+
quotaBackoffUntil: snapshot.status.quotaBackoffUntil,
|
|
1194
1181
|
readAt
|
|
1195
1182
|
});
|
|
1196
1183
|
};
|
|
@@ -1299,10 +1286,15 @@ export function setupGaTui(context, options = {}) {
|
|
|
1299
1286
|
* The GA TUI plugin definition (`{ id, setup }`, the 2.0.22 TUI plugin
|
|
1300
1287
|
* shape). Importing this module starts nothing; `setup` binds to the
|
|
1301
1288
|
* context's location and returns the cleanup that stops everything it
|
|
1302
|
-
* started.
|
|
1289
|
+
* started. The host calls `setup(context)`; the package's `./tui` entry
|
|
1290
|
+
* passes the plugin version as the second argument. This module's graph
|
|
1291
|
+
* may use no Node built-in (the build refuses one), so it cannot read
|
|
1292
|
+
* `package.json` itself.
|
|
1303
1293
|
*/
|
|
1304
1294
|
const gaTuiPlugin = {
|
|
1305
1295
|
id: GA_TUI_ID,
|
|
1306
|
-
setup: context => setupGaTui(context
|
|
1296
|
+
setup: (context, options = {}) => setupGaTui(context, options.version ? {
|
|
1297
|
+
version: options.version
|
|
1298
|
+
} : {})
|
|
1307
1299
|
};
|
|
1308
1300
|
export default gaTuiPlugin;
|