@cortexkit/opencode-antigravity-auth 3.0.13 → 3.0.15
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 +1865 -571
- package/dist/cli.js.map +4 -4
- package/dist/cli.meta.json +294 -55
- package/dist/index.js +2377 -784
- package/dist/index.js.map +4 -4
- package/dist/index.meta.json +332 -78
- package/dist/server.js +3977 -2327
- package/dist/server.js.map +4 -4
- package/dist/server.meta.json +1 -1
- package/dist/src/__fixtures__/runtime-layout-process.d.ts +2 -0
- package/dist/src/__fixtures__/runtime-layout-process.d.ts.map +1 -0
- package/dist/src/__fixtures__/runtime-layout-process.js +88 -0
- package/dist/src/__fixtures__/runtime-layout-process.js.map +1 -0
- package/dist/src/cli.d.ts +17 -6
- package/dist/src/cli.d.ts.map +1 -1
- package/dist/src/cli.js +26 -9
- package/dist/src/cli.js.map +1 -1
- package/dist/src/common-auth-embedded/claustrum/enrollment.d.ts +9 -0
- package/dist/src/common-auth-embedded/claustrum/enrollment.js +15 -8
- package/dist/src/common-auth-embedded/claustrum/hub.js +86 -42
- package/dist/src/common-auth-embedded/fs/refresh-file-lock.js +16 -3
- package/dist/src/common-auth-embedded/setup/command.js +4 -49
- package/dist/src/common-auth-embedded/setup/flags.d.ts +50 -0
- package/dist/src/common-auth-embedded/setup/flags.js +123 -0
- package/dist/src/common-auth-embedded/setup/index.d.ts +1 -0
- package/dist/src/common-auth-embedded/setup/index.js +1 -0
- package/dist/src/common-auth-embedded/setup/types.d.ts +7 -1
- package/dist/src/common-auth-embedded/source-output.json +47 -31
- package/dist/src/ga/server/auth.d.ts.map +1 -1
- package/dist/src/ga/server/auth.js +7 -2
- package/dist/src/ga/server/auth.js.map +1 -1
- package/dist/src/ga/server/index.d.ts.map +1 -1
- package/dist/src/ga/server/index.js +18 -4
- package/dist/src/ga/server/index.js.map +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/__fixtures__/controlled-timeouts.d.ts +7 -0
- package/dist/src/plugin/__fixtures__/controlled-timeouts.d.ts.map +1 -0
- package/dist/src/plugin/__fixtures__/controlled-timeouts.js +41 -0
- package/dist/src/plugin/__fixtures__/controlled-timeouts.js.map +1 -0
- package/dist/src/plugin/__fixtures__/release-model-ids.d.ts +2 -0
- package/dist/src/plugin/__fixtures__/release-model-ids.d.ts.map +1 -0
- package/dist/src/plugin/__fixtures__/release-model-ids.js +11 -0
- package/dist/src/plugin/__fixtures__/release-model-ids.js.map +1 -0
- package/dist/src/plugin/__fixtures__/verified-store.d.ts +3 -0
- package/dist/src/plugin/__fixtures__/verified-store.d.ts.map +1 -0
- package/dist/src/plugin/__fixtures__/verified-store.js +50 -0
- package/dist/src/plugin/__fixtures__/verified-store.js.map +1 -0
- package/dist/src/plugin/auth-loader.d.ts +7 -1
- package/dist/src/plugin/auth-loader.d.ts.map +1 -1
- package/dist/src/plugin/auth-loader.js +4 -4
- package/dist/src/plugin/auth-loader.js.map +1 -1
- package/dist/src/plugin/cache/signature-cache.d.ts +7 -1
- package/dist/src/plugin/cache/signature-cache.d.ts.map +1 -1
- package/dist/src/plugin/cache/signature-cache.js +10 -13
- package/dist/src/plugin/cache/signature-cache.js.map +1 -1
- package/dist/src/plugin/config/loader.d.ts +2 -1
- package/dist/src/plugin/config/loader.d.ts.map +1 -1
- package/dist/src/plugin/config/loader.js +4 -2
- package/dist/src/plugin/config/loader.js.map +1 -1
- package/dist/src/plugin/config/schema.js +1 -1
- package/dist/src/plugin/debug.d.ts.map +1 -1
- package/dist/src/plugin/debug.js +18 -19
- package/dist/src/plugin/debug.js.map +1 -1
- package/dist/src/plugin/errors.js +1 -1
- package/dist/src/plugin/errors.js.map +1 -1
- package/dist/src/plugin/ga-location-services.d.ts +1 -1
- package/dist/src/plugin/ga-location-services.d.ts.map +1 -1
- package/dist/src/plugin/ga-location-services.js +99 -32
- package/dist/src/plugin/ga-location-services.js.map +1 -1
- package/dist/src/plugin/ga-shared-vault-custody.d.ts +19 -5
- package/dist/src/plugin/ga-shared-vault-custody.d.ts.map +1 -1
- package/dist/src/plugin/ga-shared-vault-custody.js +12 -4
- package/dist/src/plugin/ga-shared-vault-custody.js.map +1 -1
- package/dist/src/plugin/index.d.ts.map +1 -1
- package/dist/src/plugin/index.js +31 -9
- package/dist/src/plugin/index.js.map +1 -1
- package/dist/src/plugin/shared/source-sidebar.d.ts +6 -0
- package/dist/src/plugin/shared/source-sidebar.d.ts.map +1 -1
- package/dist/src/plugin/shared/source-sidebar.js +1 -1
- package/dist/src/plugin/shared/source-sidebar.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 +5 -2
- package/dist/src/plugin/storage.d.ts.map +1 -1
- package/dist/src/plugin/storage.js +5 -4
- package/dist/src/plugin/storage.js.map +1 -1
- package/dist/src/plugin/vault-custody.d.ts +29 -8
- package/dist/src/plugin/vault-custody.d.ts.map +1 -1
- package/dist/src/plugin/vault-custody.js +61 -10
- package/dist/src/plugin/vault-custody.js.map +1 -1
- package/dist/src/process-heartbeat.d.ts +22 -2
- package/dist/src/process-heartbeat.d.ts.map +1 -1
- package/dist/src/process-heartbeat.js +47 -10
- package/dist/src/process-heartbeat.js.map +1 -1
- package/dist/src/rpc/rpc-server.d.ts +8 -0
- package/dist/src/rpc/rpc-server.d.ts.map +1 -1
- package/dist/src/rpc/rpc-server.js +26 -1
- package/dist/src/rpc/rpc-server.js.map +1 -1
- package/dist/src/runtime-layout.d.ts +100 -0
- package/dist/src/runtime-layout.d.ts.map +1 -0
- package/dist/src/runtime-layout.js +1242 -0
- package/dist/src/runtime-layout.js.map +1 -0
- package/dist/src/runtime-paths.d.ts +132 -0
- package/dist/src/runtime-paths.d.ts.map +1 -0
- package/dist/src/runtime-paths.js +214 -0
- package/dist/src/runtime-paths.js.map +1 -0
- package/dist/src/setup.d.ts.map +1 -1
- package/dist/src/setup.js +30 -7
- package/dist/src/setup.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/src/vault-folder.d.ts +38 -0
- package/dist/src/vault-folder.d.ts.map +1 -0
- package/dist/src/vault-folder.js +91 -0
- package/dist/src/vault-folder.js.map +1 -0
- package/dist/src/version-fence.d.ts +54 -0
- package/dist/src/version-fence.d.ts.map +1 -0
- package/dist/src/version-fence.js +254 -0
- package/dist/src/version-fence.js.map +1 -0
- package/dist/tui-build-map.json +121 -93
- package/dist/tui-ga-build-map.json +23 -9
- package/dist/types/src/cli.d.ts +17 -6
- package/dist/types/src/cli.d.ts.map +1 -1
- package/dist/types/src/common-auth-embedded/claustrum/enrollment.d.ts +9 -0
- package/dist/types/src/common-auth-embedded/setup/flags.d.ts +50 -0
- package/dist/types/src/common-auth-embedded/setup/index.d.ts +1 -0
- package/dist/types/src/common-auth-embedded/setup/types.d.ts +7 -1
- package/dist/types/src/ga/server/auth.d.ts.map +1 -1
- package/dist/types/src/ga/server/index.d.ts.map +1 -1
- package/dist/types/src/plugin/auth-loader.d.ts +7 -1
- package/dist/types/src/plugin/auth-loader.d.ts.map +1 -1
- package/dist/types/src/plugin/cache/signature-cache.d.ts +7 -1
- package/dist/types/src/plugin/cache/signature-cache.d.ts.map +1 -1
- package/dist/types/src/plugin/config/loader.d.ts +2 -1
- package/dist/types/src/plugin/config/loader.d.ts.map +1 -1
- package/dist/types/src/plugin/debug.d.ts.map +1 -1
- package/dist/types/src/plugin/ga-location-services.d.ts +1 -1
- package/dist/types/src/plugin/ga-location-services.d.ts.map +1 -1
- package/dist/types/src/plugin/ga-shared-vault-custody.d.ts +19 -5
- package/dist/types/src/plugin/ga-shared-vault-custody.d.ts.map +1 -1
- package/dist/types/src/plugin/index.d.ts.map +1 -1
- package/dist/types/src/plugin/shared/source-sidebar.d.ts +6 -0
- package/dist/types/src/plugin/shared/source-sidebar.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 +5 -2
- package/dist/types/src/plugin/storage.d.ts.map +1 -1
- package/dist/types/src/plugin/vault-custody.d.ts +29 -8
- package/dist/types/src/plugin/vault-custody.d.ts.map +1 -1
- package/dist/types/src/process-heartbeat.d.ts +22 -2
- package/dist/types/src/process-heartbeat.d.ts.map +1 -1
- package/dist/types/src/rpc/rpc-server.d.ts +8 -0
- package/dist/types/src/rpc/rpc-server.d.ts.map +1 -1
- package/dist/types/src/runtime-layout.d.ts +100 -0
- package/dist/types/src/runtime-layout.d.ts.map +1 -0
- package/dist/types/src/runtime-paths.d.ts +132 -0
- package/dist/types/src/runtime-paths.d.ts.map +1 -0
- package/dist/types/src/setup.d.ts.map +1 -1
- package/dist/types/src/vault-folder.d.ts +38 -0
- package/dist/types/src/vault-folder.d.ts.map +1 -0
- package/dist/types/src/version-fence.d.ts +54 -0
- package/dist/types/src/version-fence.d.ts.map +1 -0
- package/package.json +2 -2
- package/src/common-auth-embedded/claustrum/enrollment.d.ts +9 -0
- package/src/common-auth-embedded/claustrum/enrollment.js +15 -8
- package/src/common-auth-embedded/claustrum/hub.js +86 -42
- package/src/common-auth-embedded/fs/refresh-file-lock.js +16 -3
- package/src/common-auth-embedded/setup/command.js +4 -49
- package/src/common-auth-embedded/setup/flags.d.ts +50 -0
- package/src/common-auth-embedded/setup/flags.js +123 -0
- package/src/common-auth-embedded/setup/index.d.ts +1 -0
- package/src/common-auth-embedded/setup/index.js +1 -0
- package/src/common-auth-embedded/setup/types.d.ts +7 -1
- package/src/common-auth-embedded/source-output.json +47 -31
- 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,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"schema": 1,
|
|
3
3
|
"package": "@cortexkit/common-auth",
|
|
4
|
-
"version": "0.
|
|
4
|
+
"version": "0.28.0",
|
|
5
5
|
"artifactStatus": "published",
|
|
6
6
|
"publicRoots": {
|
|
7
7
|
"./rpc": {
|
|
@@ -61,15 +61,15 @@
|
|
|
61
61
|
"import": "./dist/opencode2/index.js"
|
|
62
62
|
}
|
|
63
63
|
},
|
|
64
|
-
"input": "tools/common-auth-build/inputs/cortexkit-common-auth-0.
|
|
65
|
-
"tarballSha256": "
|
|
66
|
-
"sri": "sha512-
|
|
67
|
-
"canonicalFiles":
|
|
68
|
-
"canonicalBytes":
|
|
64
|
+
"input": "tools/common-auth-build/inputs/cortexkit-common-auth-0.28.0.tgz",
|
|
65
|
+
"tarballSha256": "8070e3c1882238d78ac5e955fb140484e08d9f97ed0f2d5d40f35928c60fbbc5",
|
|
66
|
+
"sri": "sha512-PRyppMdE3y8dTzF3iQHcFruo5ksPPhgSQExe7g4Ij/oPynDLbalSQqBaInKdSV/v5qyrY0iJs/D0Yu7fbWh3NQ==",
|
|
67
|
+
"canonicalFiles": 195,
|
|
68
|
+
"canonicalBytes": 1220682,
|
|
69
69
|
"generator": {
|
|
70
70
|
"path": "packages/opencode/scripts/embed-common-auth.ts",
|
|
71
71
|
"version": 3,
|
|
72
|
-
"sha256": "
|
|
72
|
+
"sha256": "32e05acc65fbec2114dce8a43e29e3eca2d6f02594f20e3f6e7bc3b1ec9b8aa3"
|
|
73
73
|
},
|
|
74
74
|
"files": [
|
|
75
75
|
{
|
|
@@ -283,17 +283,17 @@
|
|
|
283
283
|
{
|
|
284
284
|
"source": "package/dist/claustrum/enrollment.d.ts",
|
|
285
285
|
"output": "claustrum/enrollment.d.ts",
|
|
286
|
-
"bytes":
|
|
287
|
-
"sourceSha256": "
|
|
288
|
-
"outputSha256": "
|
|
286
|
+
"bytes": 8530,
|
|
287
|
+
"sourceSha256": "8e44065db1b28f930f01b9c267aacb23e2f4f9d5d7d358b815fdc8c5080450ff",
|
|
288
|
+
"outputSha256": "8e44065db1b28f930f01b9c267aacb23e2f4f9d5d7d358b815fdc8c5080450ff",
|
|
289
289
|
"transform": "verbatim"
|
|
290
290
|
},
|
|
291
291
|
{
|
|
292
292
|
"source": "package/dist/claustrum/enrollment.js",
|
|
293
293
|
"output": "claustrum/enrollment.js",
|
|
294
|
-
"bytes":
|
|
295
|
-
"sourceSha256": "
|
|
296
|
-
"outputSha256": "
|
|
294
|
+
"bytes": 36868,
|
|
295
|
+
"sourceSha256": "7dab3edbc03542bcd75578449f6c3b92959671f0669332c62b2ad4525aa9c829",
|
|
296
|
+
"outputSha256": "7dab3edbc03542bcd75578449f6c3b92959671f0669332c62b2ad4525aa9c829",
|
|
297
297
|
"transform": "verbatim"
|
|
298
298
|
},
|
|
299
299
|
{
|
|
@@ -339,9 +339,9 @@
|
|
|
339
339
|
{
|
|
340
340
|
"source": "package/dist/claustrum/hub.js",
|
|
341
341
|
"output": "claustrum/hub.js",
|
|
342
|
-
"bytes":
|
|
343
|
-
"sourceSha256": "
|
|
344
|
-
"outputSha256": "
|
|
342
|
+
"bytes": 43086,
|
|
343
|
+
"sourceSha256": "f156151cba0a628828a9c28cdeea757a4c959e4398a79c423001b2b2857c2ec7",
|
|
344
|
+
"outputSha256": "f156151cba0a628828a9c28cdeea757a4c959e4398a79c423001b2b2857c2ec7",
|
|
345
345
|
"transform": "verbatim"
|
|
346
346
|
},
|
|
347
347
|
{
|
|
@@ -627,9 +627,9 @@
|
|
|
627
627
|
{
|
|
628
628
|
"source": "package/dist/fs/refresh-file-lock.js",
|
|
629
629
|
"output": "fs/refresh-file-lock.js",
|
|
630
|
-
"bytes":
|
|
631
|
-
"sourceSha256": "
|
|
632
|
-
"outputSha256": "
|
|
630
|
+
"bytes": 30833,
|
|
631
|
+
"sourceSha256": "c0e4de79b0c0bb8fac09b13c5cf861eaa008434b336e87ce761d7f0713203a90",
|
|
632
|
+
"outputSha256": "c0e4de79b0c0bb8fac09b13c5cf861eaa008434b336e87ce761d7f0713203a90",
|
|
633
633
|
"transform": "verbatim"
|
|
634
634
|
},
|
|
635
635
|
{
|
|
@@ -1187,9 +1187,9 @@
|
|
|
1187
1187
|
{
|
|
1188
1188
|
"source": "package/dist/setup/command.js",
|
|
1189
1189
|
"output": "setup/command.js",
|
|
1190
|
-
"bytes":
|
|
1191
|
-
"sourceSha256": "
|
|
1192
|
-
"outputSha256": "
|
|
1190
|
+
"bytes": 13573,
|
|
1191
|
+
"sourceSha256": "182db608585e2ab5d47a6c388fb46973739364d72f5df9b035875f765b7a6f79",
|
|
1192
|
+
"outputSha256": "182db608585e2ab5d47a6c388fb46973739364d72f5df9b035875f765b7a6f79",
|
|
1193
1193
|
"transform": "verbatim"
|
|
1194
1194
|
},
|
|
1195
1195
|
{
|
|
@@ -1232,20 +1232,36 @@
|
|
|
1232
1232
|
"outputSha256": "dd21599c916733c327bca81c48372034a349a2840e50fac7d2d30b33668a1537",
|
|
1233
1233
|
"transform": "verbatim"
|
|
1234
1234
|
},
|
|
1235
|
+
{
|
|
1236
|
+
"source": "package/dist/setup/flags.d.ts",
|
|
1237
|
+
"output": "setup/flags.d.ts",
|
|
1238
|
+
"bytes": 1975,
|
|
1239
|
+
"sourceSha256": "8475bfc500aaaae2ccc4f6d6a90be029911c88082e1f6fe646d9a02e24aecd3c",
|
|
1240
|
+
"outputSha256": "8475bfc500aaaae2ccc4f6d6a90be029911c88082e1f6fe646d9a02e24aecd3c",
|
|
1241
|
+
"transform": "verbatim"
|
|
1242
|
+
},
|
|
1243
|
+
{
|
|
1244
|
+
"source": "package/dist/setup/flags.js",
|
|
1245
|
+
"output": "setup/flags.js",
|
|
1246
|
+
"bytes": 4610,
|
|
1247
|
+
"sourceSha256": "6c424773289587568500e53a76e7a64074867bab6e97318ff9b619b93c694bfb",
|
|
1248
|
+
"outputSha256": "6c424773289587568500e53a76e7a64074867bab6e97318ff9b619b93c694bfb",
|
|
1249
|
+
"transform": "verbatim"
|
|
1250
|
+
},
|
|
1235
1251
|
{
|
|
1236
1252
|
"source": "package/dist/setup/index.d.ts",
|
|
1237
1253
|
"output": "setup/index.d.ts",
|
|
1238
|
-
"bytes":
|
|
1239
|
-
"sourceSha256": "
|
|
1240
|
-
"outputSha256": "
|
|
1254
|
+
"bytes": 1011,
|
|
1255
|
+
"sourceSha256": "4a0f5a26bca035276077740d5fab9187000d15e575a6c195a0772d64d8c7e9f0",
|
|
1256
|
+
"outputSha256": "4a0f5a26bca035276077740d5fab9187000d15e575a6c195a0772d64d8c7e9f0",
|
|
1241
1257
|
"transform": "verbatim"
|
|
1242
1258
|
},
|
|
1243
1259
|
{
|
|
1244
1260
|
"source": "package/dist/setup/index.js",
|
|
1245
1261
|
"output": "setup/index.js",
|
|
1246
|
-
"bytes":
|
|
1247
|
-
"sourceSha256": "
|
|
1248
|
-
"outputSha256": "
|
|
1262
|
+
"bytes": 658,
|
|
1263
|
+
"sourceSha256": "218409be186bc7e52d0606699502ccb272f024676018a1d1835a45573e2ea787",
|
|
1264
|
+
"outputSha256": "218409be186bc7e52d0606699502ccb272f024676018a1d1835a45573e2ea787",
|
|
1249
1265
|
"transform": "verbatim"
|
|
1250
1266
|
},
|
|
1251
1267
|
{
|
|
@@ -1299,9 +1315,9 @@
|
|
|
1299
1315
|
{
|
|
1300
1316
|
"source": "package/dist/setup/types.d.ts",
|
|
1301
1317
|
"output": "setup/types.d.ts",
|
|
1302
|
-
"bytes":
|
|
1303
|
-
"sourceSha256": "
|
|
1304
|
-
"outputSha256": "
|
|
1318
|
+
"bytes": 6038,
|
|
1319
|
+
"sourceSha256": "f4091b3f1f5018e9ac9b3da4329cb388302ef1c12c7c927fb43c631e1a0295f6",
|
|
1320
|
+
"outputSha256": "f4091b3f1f5018e9ac9b3da4329cb388302ef1c12c7c927fb43c631e1a0295f6",
|
|
1305
1321
|
"transform": "verbatim"
|
|
1306
1322
|
},
|
|
1307
1323
|
{
|
package/src/tui/entry.mjs
CHANGED
|
@@ -22,6 +22,23 @@ function loadV1() {
|
|
|
22
22
|
return v1Root
|
|
23
23
|
}
|
|
24
24
|
|
|
25
|
+
// The plugin version for the OpenCode 2 sidebar header, passed to the GA
|
|
26
|
+
// setup. The GA root may use no Node built-in (the TUI build refuses one),
|
|
27
|
+
// so it cannot read package.json; this entry can. Read lazily on setup, so
|
|
28
|
+
// importing the entry stays inert, and never fatal: without a version the
|
|
29
|
+
// header just leaves it out.
|
|
30
|
+
async function packageVersion() {
|
|
31
|
+
try {
|
|
32
|
+
const manifest = await import('../../package.json', {
|
|
33
|
+
with: { type: 'json' },
|
|
34
|
+
})
|
|
35
|
+
const version = manifest.default?.version
|
|
36
|
+
return typeof version === 'string' ? version : ''
|
|
37
|
+
} catch {
|
|
38
|
+
return ''
|
|
39
|
+
}
|
|
40
|
+
}
|
|
41
|
+
|
|
25
42
|
function loadGa() {
|
|
26
43
|
gaRoot ??= loadTui({
|
|
27
44
|
rawEntry: new URL('../tui-ga-raw/host-ga.tsx', import.meta.url).href,
|
|
@@ -37,6 +54,7 @@ export default {
|
|
|
37
54
|
return (await loadV1()).tui(api, options, meta)
|
|
38
55
|
},
|
|
39
56
|
async setup(context) {
|
|
40
|
-
|
|
57
|
+
const [root, version] = await Promise.all([loadGa(), packageVersion()])
|
|
58
|
+
return root.setup(context, { version })
|
|
41
59
|
},
|
|
42
60
|
}
|
|
@@ -0,0 +1,119 @@
|
|
|
1
|
+
import { quotaReadingParts } from "./quota-presentation.js";
|
|
2
|
+
export const QUOTA_POOL_LABELS = {
|
|
3
|
+
gemini: "Gemini",
|
|
4
|
+
"non-gemini": "Other models",
|
|
5
|
+
"gemini-argon": "Argon"
|
|
6
|
+
};
|
|
7
|
+
const POOL_ORDER = [
|
|
8
|
+
"gemini",
|
|
9
|
+
"non-gemini",
|
|
10
|
+
"gemini-argon"
|
|
11
|
+
];
|
|
12
|
+
function clamp(value) {
|
|
13
|
+
if (!Number.isFinite(value))
|
|
14
|
+
return 0;
|
|
15
|
+
return Math.min(100, Math.max(0, value));
|
|
16
|
+
}
|
|
17
|
+
export function remainingTone(remaining) {
|
|
18
|
+
if (remaining === null)
|
|
19
|
+
return "muted";
|
|
20
|
+
if (remaining <= 10)
|
|
21
|
+
return "err";
|
|
22
|
+
if (remaining <= 30)
|
|
23
|
+
return "warn";
|
|
24
|
+
return "ok";
|
|
25
|
+
}
|
|
26
|
+
export function formatResetIn(resetAt, now) {
|
|
27
|
+
if (!resetAt)
|
|
28
|
+
return "";
|
|
29
|
+
const ms = resetAt - now;
|
|
30
|
+
if (ms <= 0)
|
|
31
|
+
return "now";
|
|
32
|
+
const mins = Math.floor(ms / 60000);
|
|
33
|
+
if (mins < 60)
|
|
34
|
+
return `${mins}m`;
|
|
35
|
+
const hrs = Math.floor(mins / 60);
|
|
36
|
+
if (hrs < 24) {
|
|
37
|
+
const rm = mins % 60;
|
|
38
|
+
return rm > 0 ? `${hrs}h${rm}m` : `${hrs}h`;
|
|
39
|
+
}
|
|
40
|
+
const days = Math.floor(hrs / 24), rh = hrs % 24;
|
|
41
|
+
return rh > 0 ? `${days}d${rh}h` : `${days}d`;
|
|
42
|
+
}
|
|
43
|
+
export function formatWait(ms) {
|
|
44
|
+
const seconds = Math.ceil(ms / 1000);
|
|
45
|
+
if (seconds < 60)
|
|
46
|
+
return `${seconds}s`;
|
|
47
|
+
const minutes = Math.floor(seconds / 60), remaining = seconds % 60;
|
|
48
|
+
return remaining > 0 ? `${minutes}m ${remaining}s` : `${minutes}m`;
|
|
49
|
+
}
|
|
50
|
+
function quotaRows(account, now) {
|
|
51
|
+
const rows = [];
|
|
52
|
+
for (const key of POOL_ORDER) {
|
|
53
|
+
const entry = account.quota[key], label = QUOTA_POOL_LABELS[key];
|
|
54
|
+
if (!entry) {
|
|
55
|
+
if (key === "gemini-argon")
|
|
56
|
+
continue;
|
|
57
|
+
rows.push({
|
|
58
|
+
label,
|
|
59
|
+
remaining: null,
|
|
60
|
+
figure: quotaReadingParts(label, void 0, now).figure,
|
|
61
|
+
tone: "muted",
|
|
62
|
+
reset: ""
|
|
63
|
+
});
|
|
64
|
+
continue;
|
|
65
|
+
}
|
|
66
|
+
const windows = entry.windows ?? [];
|
|
67
|
+
if (windows.length === 0) {
|
|
68
|
+
const parts = quotaReadingParts(label, entry, now);
|
|
69
|
+
rows.push({
|
|
70
|
+
label,
|
|
71
|
+
remaining: parts.remaining,
|
|
72
|
+
figure: parts.figure,
|
|
73
|
+
tone: remainingTone(parts.remaining),
|
|
74
|
+
reset: parts.detail
|
|
75
|
+
});
|
|
76
|
+
continue;
|
|
77
|
+
}
|
|
78
|
+
for (const window of windows) {
|
|
79
|
+
const parts = quotaReadingParts(label, window, now);
|
|
80
|
+
rows.push({
|
|
81
|
+
label: `${label} ${parts.name}`,
|
|
82
|
+
remaining: parts.remaining,
|
|
83
|
+
figure: parts.figure,
|
|
84
|
+
tone: remainingTone(parts.remaining),
|
|
85
|
+
reset: parts.detail
|
|
86
|
+
});
|
|
87
|
+
}
|
|
88
|
+
}
|
|
89
|
+
return rows;
|
|
90
|
+
}
|
|
91
|
+
export function projectAccount(account, now) {
|
|
92
|
+
const cooling = typeof account.cooldownUntil === "number" && account.cooldownUntil > now, status = !account.enabled ? "off" : cooling ? "cooling" : account.current ? "active" : "idle", statusTone = status === "off" ? "muted" : status === "cooling" ? "warn" : status === "active" ? "ok" : "muted", base = `health ${Math.round(clamp(account.health))}`, health = cooling ? `${base} \xB7 cooling ${formatWait(account.cooldownUntil - now)}` : base;
|
|
93
|
+
return {
|
|
94
|
+
id: account.id,
|
|
95
|
+
label: account.label,
|
|
96
|
+
status,
|
|
97
|
+
statusTone,
|
|
98
|
+
quota: quotaRows(account, now),
|
|
99
|
+
health
|
|
100
|
+
};
|
|
101
|
+
}
|
|
102
|
+
export function projectSidebar(input) {
|
|
103
|
+
const accounts = input.accounts.map((account) => projectAccount(account, input.now));
|
|
104
|
+
let route = null;
|
|
105
|
+
if (input.route)
|
|
106
|
+
route = [
|
|
107
|
+
input.accounts.find((account) => account.id === input.route?.accountId)?.label ?? "unknown account",
|
|
108
|
+
input.route.modelFamily,
|
|
109
|
+
input.route.headerStyle
|
|
110
|
+
].join(" \xB7 ");
|
|
111
|
+
const notices = [];
|
|
112
|
+
if (input.status.quotaBackoffUntil !== null && input.status.quotaBackoffUntil > input.now)
|
|
113
|
+
notices.push(`quota checks paused ${formatWait(input.status.quotaBackoffUntil - input.now)}`);
|
|
114
|
+
if (input.status.checkedAt === null)
|
|
115
|
+
notices.push("quota not checked yet");
|
|
116
|
+
if (accounts.length === 0)
|
|
117
|
+
notices.push("no accounts");
|
|
118
|
+
return { accounts, route, notices };
|
|
119
|
+
}
|
|
@@ -252,7 +252,7 @@ function WindowRow(props) {
|
|
|
252
252
|
* right-aligned; the age moves to its own dim line when the three do not
|
|
253
253
|
* fit. Below it each quota group present gets a plain-word header and one
|
|
254
254
|
* row per window, or a single dim line when there is no reading at all.
|
|
255
|
-
* `children
|
|
255
|
+
* `children`, when given, render after the quota rows.
|
|
256
256
|
*/
|
|
257
257
|
export function QuotaAccountBlock(props) {
|
|
258
258
|
const windows = () => accountWindows(props.account, props.now());
|