@cortexkit/opencode-antigravity-auth 3.0.5 → 3.0.7
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 +38 -352
- package/dist/cli.js +13757 -12857
- package/dist/cli.js.map +4 -4
- package/dist/cli.meta.json +1362 -1056
- package/dist/index.js +16038 -16162
- package/dist/index.js.map +4 -4
- package/dist/index.meta.json +1447 -1375
- package/dist/server.js +11254 -10921
- package/dist/server.js.map +4 -4
- package/dist/server.meta.json +1 -1
- package/dist/src/auth-method-labels.d.ts +3 -0
- package/dist/src/auth-method-labels.d.ts.map +1 -0
- package/dist/src/auth-method-labels.js +5 -0
- package/dist/src/auth-method-labels.js.map +1 -0
- package/dist/src/cli.d.ts +3 -1
- package/dist/src/cli.d.ts.map +1 -1
- package/dist/src/cli.js +98 -12
- package/dist/src/cli.js.map +1 -1
- package/dist/src/common-auth-embedded/claustrum/consumer.d.ts +44 -4
- package/dist/src/common-auth-embedded/claustrum/consumer.js +134 -2
- package/dist/src/common-auth-embedded/claustrum/custody.d.ts +33 -1
- package/dist/src/common-auth-embedded/claustrum/custody.js +17 -0
- package/dist/src/common-auth-embedded/claustrum/enrollment.d.ts +6 -1
- package/dist/src/common-auth-embedded/claustrum/enrollment.js +6 -1
- package/dist/src/common-auth-embedded/claustrum/index.d.ts +3 -2
- package/dist/src/common-auth-embedded/claustrum/index.js +5 -3
- package/dist/src/common-auth-embedded/claustrum/insula.d.ts +69 -0
- package/dist/src/common-auth-embedded/claustrum/insula.js +152 -0
- package/dist/src/common-auth-embedded/claustrum/roster.d.ts +13 -0
- package/dist/src/common-auth-embedded/claustrum/roster.js +33 -3
- package/dist/src/common-auth-embedded/fs/refresh-file-lock.d.ts +8 -2
- package/dist/src/common-auth-embedded/fs/refresh-file-lock.js +26 -12
- package/dist/src/common-auth-embedded/pi-slot/lock.js +7 -3
- package/dist/src/common-auth-embedded/quota/codec.d.ts +2 -0
- package/dist/src/common-auth-embedded/quota/codec.js +2 -1
- package/dist/src/common-auth-embedded/quota/format.d.ts +40 -3
- package/dist/src/common-auth-embedded/quota/format.js +196 -43
- package/dist/src/common-auth-embedded/quota/index.d.ts +4 -4
- package/dist/src/common-auth-embedded/quota/index.js +2 -2
- package/dist/src/common-auth-embedded/quota/map.d.ts +11 -0
- package/dist/src/common-auth-embedded/quota/map.js +36 -1
- package/dist/src/common-auth-embedded/quota/merge.d.ts +3 -1
- package/dist/src/common-auth-embedded/quota/merge.js +21 -5
- package/dist/src/common-auth-embedded/quota/projection.d.ts +2 -1
- package/dist/src/common-auth-embedded/quota/projection.js +3 -1
- package/dist/src/common-auth-embedded/setup/command-error.d.ts +32 -0
- package/dist/src/common-auth-embedded/setup/command-error.js +79 -0
- package/dist/src/common-auth-embedded/setup/command-runner.js +143 -0
- package/dist/src/common-auth-embedded/setup/command.d.ts +3 -0
- package/dist/src/common-auth-embedded/setup/command.js +271 -0
- package/dist/src/common-auth-embedded/setup/config-write.js +60 -0
- package/dist/src/common-auth-embedded/setup/detect.d.ts +6 -0
- package/dist/src/common-auth-embedded/setup/detect.js +224 -0
- package/dist/src/common-auth-embedded/setup/enroll.js +82 -0
- package/dist/src/common-auth-embedded/setup/index.d.ts +6 -0
- package/dist/src/common-auth-embedded/setup/index.js +5 -0
- package/dist/src/common-auth-embedded/setup/paths.js +33 -0
- package/dist/src/common-auth-embedded/setup/process-fence.d.ts +43 -0
- package/dist/src/common-auth-embedded/setup/process-fence.js +270 -0
- package/dist/src/common-auth-embedded/setup/prompts.js +26 -0
- package/dist/src/common-auth-embedded/setup/register.d.ts +11 -0
- package/dist/src/common-auth-embedded/setup/register.js +136 -0
- package/dist/src/common-auth-embedded/setup/types.d.ts +150 -0
- package/dist/src/common-auth-embedded/source-output.json +265 -101
- package/dist/src/common-auth-embedded/store/pool.d.ts +1 -1
- package/dist/src/common-auth-embedded/store/pool.js +0 -1
- package/dist/src/common-auth-embedded/store/refresh-lock.d.ts +0 -1
- package/dist/src/common-auth-embedded/store/refresh-lock.js +0 -1
- package/dist/src/common-auth-embedded/store/schema.d.ts +2 -0
- package/dist/src/common-auth-embedded/store/schema.js +3 -2
- package/dist/src/ga/rpc/protocol.d.ts +4 -7
- package/dist/src/ga/rpc/protocol.d.ts.map +1 -1
- package/dist/src/ga/rpc/protocol.js +5 -13
- package/dist/src/ga/rpc/protocol.js.map +1 -1
- package/dist/src/ga/server/auth.d.ts +8 -3
- package/dist/src/ga/server/auth.d.ts.map +1 -1
- package/dist/src/ga/server/auth.js +25 -9
- package/dist/src/ga/server/auth.js.map +1 -1
- package/dist/src/ga/server/index.d.ts +39 -12
- package/dist/src/ga/server/index.d.ts.map +1 -1
- package/dist/src/ga/server/index.js +218 -55
- package/dist/src/ga/server/index.js.map +1 -1
- package/dist/src/ga/server/pool-login.d.ts +22 -0
- package/dist/src/ga/server/pool-login.d.ts.map +1 -0
- package/dist/src/ga/server/pool-login.js +150 -0
- package/dist/src/ga/server/pool-login.js.map +1 -0
- package/dist/src/ga/tui/host-ga.d.ts +2 -5
- package/dist/src/ga/tui/host-ga.d.ts.map +1 -1
- package/dist/src/ga/tui/host-ga.js +54 -52
- package/dist/src/ga/tui/host-ga.js.map +1 -1
- package/dist/src/plugin/accounts.d.ts +1 -1
- package/dist/src/plugin/accounts.d.ts.map +1 -1
- package/dist/src/plugin/accounts.js +1 -0
- package/dist/src/plugin/accounts.js.map +1 -1
- package/dist/src/plugin/background-vault-quota-refresh.d.ts +2 -0
- package/dist/src/plugin/background-vault-quota-refresh.d.ts.map +1 -1
- package/dist/src/plugin/background-vault-quota-refresh.js +125 -10
- package/dist/src/plugin/background-vault-quota-refresh.js.map +1 -1
- package/dist/src/plugin/command-apply.d.ts +2 -2
- package/dist/src/plugin/command-apply.d.ts.map +1 -1
- package/dist/src/plugin/command-apply.js +3 -10
- package/dist/src/plugin/command-apply.js.map +1 -1
- package/dist/src/plugin/commands.d.ts +1 -0
- package/dist/src/plugin/commands.d.ts.map +1 -1
- package/dist/src/plugin/commands.js +2 -2
- package/dist/src/plugin/commands.js.map +1 -1
- package/dist/src/plugin/config/operator-settings-schema.d.ts +0 -4
- package/dist/src/plugin/config/operator-settings-schema.d.ts.map +1 -1
- package/dist/src/plugin/config/operator-settings-schema.js +0 -5
- package/dist/src/plugin/config/operator-settings-schema.js.map +1 -1
- package/dist/src/plugin/config/schema.d.ts +0 -7
- package/dist/src/plugin/config/schema.d.ts.map +1 -1
- package/dist/src/plugin/config/schema.js +2 -44
- package/dist/src/plugin/config/schema.js.map +1 -1
- package/dist/src/plugin/config/writer.d.ts +1 -1
- package/dist/src/plugin/config/writer.js +1 -1
- package/dist/src/plugin/fetch/retry-state.d.ts +19 -3
- package/dist/src/plugin/fetch/retry-state.d.ts.map +1 -1
- package/dist/src/plugin/fetch/retry-state.js +0 -6
- package/dist/src/plugin/fetch/retry-state.js.map +1 -1
- package/dist/src/plugin/fetch-interceptor.d.ts.map +1 -1
- package/dist/src/plugin/fetch-interceptor.js +0 -3
- package/dist/src/plugin/fetch-interceptor.js.map +1 -1
- package/dist/src/plugin/fetch-routing.d.ts +0 -16
- package/dist/src/plugin/fetch-routing.d.ts.map +1 -1
- package/dist/src/plugin/fetch-routing.js +0 -49
- package/dist/src/plugin/fetch-routing.js.map +1 -1
- package/dist/src/plugin/ga-location-services.d.ts +14 -9
- package/dist/src/plugin/ga-location-services.d.ts.map +1 -1
- package/dist/src/plugin/ga-location-services.js +124 -43
- package/dist/src/plugin/ga-location-services.js.map +1 -1
- package/dist/src/plugin/gemini-dump.d.ts.map +1 -1
- package/dist/src/plugin/gemini-dump.js +2 -5
- package/dist/src/plugin/gemini-dump.js.map +1 -1
- package/dist/src/plugin/google-origin.d.ts +7 -0
- package/dist/src/plugin/google-origin.d.ts.map +1 -0
- package/dist/src/plugin/google-origin.js +14 -0
- package/dist/src/plugin/google-origin.js.map +1 -0
- package/dist/src/plugin/index.d.ts.map +1 -1
- package/dist/src/plugin/index.js +18 -7
- package/dist/src/plugin/index.js.map +1 -1
- package/dist/src/plugin/logging-utils.d.ts.map +1 -1
- package/dist/src/plugin/logging-utils.js +2 -5
- package/dist/src/plugin/logging-utils.js.map +1 -1
- package/dist/src/plugin/oauth-methods.d.ts.map +1 -1
- package/dist/src/plugin/oauth-methods.js +0 -33
- package/dist/src/plugin/oauth-methods.js.map +1 -1
- package/dist/src/plugin/operator-settings.d.ts +1 -1
- package/dist/src/plugin/operator-settings.d.ts.map +1 -1
- package/dist/src/plugin/operator-settings.js +1 -8
- package/dist/src/plugin/operator-settings.js.map +1 -1
- package/dist/src/plugin/quota.d.ts +11 -7
- package/dist/src/plugin/quota.d.ts.map +1 -1
- package/dist/src/plugin/quota.js +128 -102
- package/dist/src/plugin/quota.js.map +1 -1
- package/dist/src/plugin/request.d.ts +6 -5
- package/dist/src/plugin/request.d.ts.map +1 -1
- package/dist/src/plugin/request.js +95 -180
- package/dist/src/plugin/request.js.map +1 -1
- package/dist/src/plugin/server.d.ts.map +1 -1
- package/dist/src/plugin/server.js +60 -53
- package/dist/src/plugin/server.js.map +1 -1
- package/dist/src/plugin/shared/advisory-repository.d.ts +20 -0
- package/dist/src/plugin/shared/advisory-repository.d.ts.map +1 -0
- package/dist/src/plugin/shared/advisory-repository.js +91 -0
- package/dist/src/plugin/shared/advisory-repository.js.map +1 -0
- package/dist/src/plugin/shared/request-services.d.ts +27 -26
- package/dist/src/plugin/shared/request-services.d.ts.map +1 -1
- package/dist/src/plugin/shared/request-services.js +244 -245
- package/dist/src/plugin/shared/request-services.js.map +1 -1
- package/dist/src/plugin/shared/runtime.js +4 -2
- package/dist/src/plugin/shared/runtime.js.map +1 -1
- package/dist/src/plugin/shared/vault-request-credentials.d.ts +16 -4
- package/dist/src/plugin/shared/vault-request-credentials.d.ts.map +1 -1
- package/dist/src/plugin/shared/vault-request-credentials.js +44 -7
- package/dist/src/plugin/shared/vault-request-credentials.js.map +1 -1
- package/dist/src/plugin/storage.d.ts +2 -2
- package/dist/src/plugin/storage.d.ts.map +1 -1
- package/dist/src/plugin/storage.js.map +1 -1
- package/dist/src/plugin/vault-custody.d.ts +14 -1
- package/dist/src/plugin/vault-custody.d.ts.map +1 -1
- package/dist/src/plugin/vault-custody.js +203 -44
- package/dist/src/plugin/vault-custody.js.map +1 -1
- package/dist/src/plugin/vault-quota-outcome.d.ts +19 -0
- package/dist/src/plugin/vault-quota-outcome.d.ts.map +1 -0
- package/dist/src/plugin/vault-quota-outcome.js +47 -0
- package/dist/src/plugin/vault-quota-outcome.js.map +1 -0
- package/dist/src/quota-presentation.d.ts +29 -1
- package/dist/src/quota-presentation.d.ts.map +1 -1
- package/dist/src/quota-presentation.js +52 -17
- package/dist/src/quota-presentation.js.map +1 -1
- package/dist/src/setup.d.ts +15 -0
- package/dist/src/setup.d.ts.map +1 -0
- package/dist/src/setup.js +320 -0
- package/dist/src/setup.js.map +1 -0
- package/dist/src/sidebar-projection.d.ts +5 -1
- package/dist/src/sidebar-projection.d.ts.map +1 -1
- package/dist/src/sidebar-projection.js +6 -2
- package/dist/src/sidebar-projection.js.map +1 -1
- package/dist/src/sidebar-state.d.ts +1 -1
- package/dist/src/sidebar-state.d.ts.map +1 -1
- package/dist/src/sidebar-state.js +19 -1
- package/dist/src/sidebar-state.js.map +1 -1
- package/dist/src/tui/quota-layout.d.ts +94 -0
- package/dist/src/tui/quota-layout.d.ts.map +1 -0
- package/dist/src/tui/quota-layout.js +139 -0
- package/dist/src/tui/quota-layout.js.map +1 -0
- package/dist/src/tui/route-layout.d.ts +8 -0
- package/dist/src/tui/route-layout.d.ts.map +1 -0
- package/dist/src/tui/route-layout.js +36 -0
- package/dist/src/tui/route-layout.js.map +1 -0
- package/dist/src/tui.d.ts.map +1 -1
- package/dist/src/tui.js +120 -127
- package/dist/src/tui.js.map +1 -1
- package/dist/tui-build-map.json +66 -37
- package/dist/tui-ga-build-map.json +66 -37
- package/dist/types/src/auth-method-labels.d.ts +3 -0
- package/dist/types/src/auth-method-labels.d.ts.map +1 -0
- package/dist/types/src/cli.d.ts +3 -1
- package/dist/types/src/cli.d.ts.map +1 -1
- package/dist/types/src/common-auth-embedded/auth-menu/terminal.d.ts +43 -0
- package/dist/types/src/common-auth-embedded/claustrum/consumer.d.ts +142 -0
- package/dist/types/src/common-auth-embedded/claustrum/custody.d.ts +207 -0
- package/dist/types/src/common-auth-embedded/claustrum/enrollment.d.ts +164 -0
- package/dist/types/src/common-auth-embedded/claustrum/errors.d.ts +16 -0
- package/dist/types/src/common-auth-embedded/claustrum/host-slot.d.ts +39 -0
- package/dist/types/src/common-auth-embedded/claustrum/index.d.ts +19 -0
- package/dist/types/src/common-auth-embedded/claustrum/insula.d.ts +69 -0
- package/dist/types/src/common-auth-embedded/claustrum/interlock.d.ts +27 -0
- package/dist/types/src/common-auth-embedded/claustrum/roster.d.ts +221 -0
- package/dist/types/src/common-auth-embedded/fs/refresh-file-lock.d.ts +8 -2
- package/dist/types/src/common-auth-embedded/opencode2/errors.d.ts +25 -0
- package/dist/types/src/common-auth-embedded/opencode2/index.d.ts +8 -0
- package/dist/types/src/common-auth-embedded/opencode2/install.d.ts +55 -0
- package/dist/types/src/common-auth-embedded/opencode2/integration.d.ts +112 -0
- package/dist/types/src/common-auth-embedded/opencode2/sse.d.ts +12 -0
- package/dist/types/src/common-auth-embedded/opencode2/types.d.ts +413 -0
- package/dist/types/src/common-auth-embedded/quota/codec.d.ts +2 -0
- package/dist/types/src/common-auth-embedded/quota/format.d.ts +40 -3
- package/dist/types/src/common-auth-embedded/quota/index.d.ts +4 -4
- package/dist/types/src/common-auth-embedded/quota/map.d.ts +11 -0
- package/dist/types/src/common-auth-embedded/quota/merge.d.ts +3 -1
- package/dist/types/src/common-auth-embedded/quota/projection.d.ts +2 -1
- package/dist/types/src/common-auth-embedded/routing/admission.d.ts +93 -0
- package/dist/types/src/common-auth-embedded/routing/index.d.ts +8 -0
- package/dist/types/src/common-auth-embedded/routing/ordered.d.ts +47 -0
- package/dist/types/src/common-auth-embedded/routing/pins.d.ts +22 -0
- package/dist/types/src/common-auth-embedded/routing/sticky.d.ts +158 -0
- package/dist/types/src/common-auth-embedded/setup/command-error.d.ts +32 -0
- package/dist/types/src/common-auth-embedded/setup/command.d.ts +3 -0
- package/dist/types/src/common-auth-embedded/setup/detect.d.ts +6 -0
- package/dist/types/src/common-auth-embedded/setup/index.d.ts +6 -0
- package/dist/types/src/common-auth-embedded/setup/process-fence.d.ts +43 -0
- package/dist/types/src/common-auth-embedded/setup/register.d.ts +11 -0
- package/dist/types/src/common-auth-embedded/setup/types.d.ts +150 -0
- package/dist/types/src/common-auth-embedded/store/pool.d.ts +1 -1
- package/dist/types/src/common-auth-embedded/store/refresh-lock.d.ts +0 -1
- package/dist/types/src/common-auth-embedded/store/schema.d.ts +2 -0
- package/dist/types/src/ga/rpc/protocol.d.ts +4 -7
- package/dist/types/src/ga/rpc/protocol.d.ts.map +1 -1
- package/dist/types/src/ga/server/auth.d.ts +8 -3
- package/dist/types/src/ga/server/auth.d.ts.map +1 -1
- package/dist/types/src/ga/server/index.d.ts +39 -12
- package/dist/types/src/ga/server/index.d.ts.map +1 -1
- package/dist/types/src/ga/server/pool-login.d.ts +22 -0
- package/dist/types/src/ga/server/pool-login.d.ts.map +1 -0
- package/dist/types/src/plugin/accounts.d.ts +1 -1
- package/dist/types/src/plugin/accounts.d.ts.map +1 -1
- package/dist/types/src/plugin/background-vault-quota-refresh.d.ts +2 -0
- package/dist/types/src/plugin/background-vault-quota-refresh.d.ts.map +1 -1
- package/dist/types/src/plugin/command-apply.d.ts +2 -2
- package/dist/types/src/plugin/command-apply.d.ts.map +1 -1
- package/dist/types/src/plugin/commands.d.ts +1 -0
- package/dist/types/src/plugin/commands.d.ts.map +1 -1
- package/dist/types/src/plugin/config/operator-settings-schema.d.ts +0 -4
- package/dist/types/src/plugin/config/operator-settings-schema.d.ts.map +1 -1
- package/dist/types/src/plugin/config/schema.d.ts +0 -7
- package/dist/types/src/plugin/config/schema.d.ts.map +1 -1
- package/dist/types/src/plugin/config/writer.d.ts +1 -1
- package/dist/types/src/plugin/fetch/retry-state.d.ts +19 -3
- package/dist/types/src/plugin/fetch/retry-state.d.ts.map +1 -1
- package/dist/types/src/plugin/fetch-interceptor.d.ts.map +1 -1
- package/dist/types/src/plugin/fetch-routing.d.ts +0 -16
- package/dist/types/src/plugin/fetch-routing.d.ts.map +1 -1
- package/dist/types/src/plugin/ga-location-services.d.ts +14 -9
- package/dist/types/src/plugin/ga-location-services.d.ts.map +1 -1
- package/dist/types/src/plugin/gemini-dump.d.ts.map +1 -1
- package/dist/types/src/plugin/google-origin.d.ts +7 -0
- package/dist/types/src/plugin/google-origin.d.ts.map +1 -0
- package/dist/types/src/plugin/index.d.ts.map +1 -1
- package/dist/types/src/plugin/logging-utils.d.ts.map +1 -1
- package/dist/types/src/plugin/oauth-methods.d.ts.map +1 -1
- package/dist/types/src/plugin/operator-settings.d.ts +1 -1
- package/dist/types/src/plugin/operator-settings.d.ts.map +1 -1
- package/dist/types/src/plugin/quota.d.ts +11 -7
- package/dist/types/src/plugin/quota.d.ts.map +1 -1
- package/dist/types/src/plugin/request.d.ts +6 -5
- package/dist/types/src/plugin/request.d.ts.map +1 -1
- package/dist/types/src/plugin/server.d.ts.map +1 -1
- package/dist/types/src/plugin/shared/advisory-repository.d.ts +20 -0
- package/dist/types/src/plugin/shared/advisory-repository.d.ts.map +1 -0
- package/dist/types/src/plugin/shared/request-services.d.ts +27 -26
- package/dist/types/src/plugin/shared/request-services.d.ts.map +1 -1
- package/dist/types/src/plugin/shared/vault-request-credentials.d.ts +16 -4
- package/dist/types/src/plugin/shared/vault-request-credentials.d.ts.map +1 -1
- package/dist/types/src/plugin/storage.d.ts +2 -2
- package/dist/types/src/plugin/storage.d.ts.map +1 -1
- package/dist/types/src/plugin/vault-custody.d.ts +14 -1
- package/dist/types/src/plugin/vault-custody.d.ts.map +1 -1
- package/dist/types/src/plugin/vault-quota-outcome.d.ts +19 -0
- package/dist/types/src/plugin/vault-quota-outcome.d.ts.map +1 -0
- package/dist/types/src/setup.d.ts +15 -0
- package/dist/types/src/setup.d.ts.map +1 -0
- package/dist/types/src/sidebar-state.d.ts +1 -1
- package/dist/types/src/sidebar-state.d.ts.map +1 -1
- package/package.json +5 -4
- package/src/common-auth-embedded/claustrum/consumer.d.ts +44 -4
- package/src/common-auth-embedded/claustrum/consumer.js +134 -2
- package/src/common-auth-embedded/claustrum/custody.d.ts +33 -1
- package/src/common-auth-embedded/claustrum/custody.js +17 -0
- package/src/common-auth-embedded/claustrum/enrollment.d.ts +6 -1
- package/src/common-auth-embedded/claustrum/enrollment.js +6 -1
- package/src/common-auth-embedded/claustrum/index.d.ts +3 -2
- package/src/common-auth-embedded/claustrum/index.js +5 -3
- package/src/common-auth-embedded/claustrum/insula.d.ts +69 -0
- package/src/common-auth-embedded/claustrum/insula.js +152 -0
- package/src/common-auth-embedded/claustrum/roster.d.ts +13 -0
- package/src/common-auth-embedded/claustrum/roster.js +33 -3
- package/src/common-auth-embedded/fs/refresh-file-lock.d.ts +8 -2
- package/src/common-auth-embedded/fs/refresh-file-lock.js +26 -12
- package/src/common-auth-embedded/pi-slot/lock.js +7 -3
- package/src/common-auth-embedded/quota/codec.d.ts +2 -0
- package/src/common-auth-embedded/quota/codec.js +2 -1
- package/src/common-auth-embedded/quota/format.d.ts +40 -3
- package/src/common-auth-embedded/quota/format.js +196 -43
- package/src/common-auth-embedded/quota/index.d.ts +4 -4
- package/src/common-auth-embedded/quota/index.js +2 -2
- package/src/common-auth-embedded/quota/map.d.ts +11 -0
- package/src/common-auth-embedded/quota/map.js +36 -1
- package/src/common-auth-embedded/quota/merge.d.ts +3 -1
- package/src/common-auth-embedded/quota/merge.js +21 -5
- package/src/common-auth-embedded/quota/projection.d.ts +2 -1
- package/src/common-auth-embedded/quota/projection.js +3 -1
- package/src/common-auth-embedded/setup/command-error.d.ts +32 -0
- package/src/common-auth-embedded/setup/command-error.js +79 -0
- package/src/common-auth-embedded/setup/command-runner.js +143 -0
- package/src/common-auth-embedded/setup/command.d.ts +3 -0
- package/src/common-auth-embedded/setup/command.js +271 -0
- package/src/common-auth-embedded/setup/config-write.js +60 -0
- package/src/common-auth-embedded/setup/detect.d.ts +6 -0
- package/src/common-auth-embedded/setup/detect.js +224 -0
- package/src/common-auth-embedded/setup/enroll.js +82 -0
- package/src/common-auth-embedded/setup/index.d.ts +6 -0
- package/src/common-auth-embedded/setup/index.js +5 -0
- package/src/common-auth-embedded/setup/paths.js +33 -0
- package/src/common-auth-embedded/setup/process-fence.d.ts +43 -0
- package/src/common-auth-embedded/setup/process-fence.js +270 -0
- package/src/common-auth-embedded/setup/prompts.js +26 -0
- package/src/common-auth-embedded/setup/register.d.ts +11 -0
- package/src/common-auth-embedded/setup/register.js +136 -0
- package/src/common-auth-embedded/setup/types.d.ts +150 -0
- package/src/common-auth-embedded/source-output.json +265 -101
- package/src/common-auth-embedded/store/pool.d.ts +1 -1
- package/src/common-auth-embedded/store/pool.js +0 -1
- package/src/common-auth-embedded/store/refresh-lock.d.ts +0 -1
- package/src/common-auth-embedded/store/refresh-lock.js +0 -1
- package/src/common-auth-embedded/store/schema.d.ts +2 -0
- package/src/common-auth-embedded/store/schema.js +3 -2
- package/src/sidebar-state.ts +19 -2
- package/src/tui-compiled/common-auth-embedded/quota/codec.js +2 -1
- package/src/tui-compiled/common-auth-embedded/quota/format.js +196 -43
- package/src/tui-compiled/common-auth-embedded/quota/index.js +2 -2
- package/src/tui-compiled/common-auth-embedded/quota/map.js +36 -1
- package/src/tui-compiled/common-auth-embedded/quota/merge.js +21 -5
- package/src/tui-compiled/common-auth-embedded/quota/projection.js +3 -1
- package/src/tui-compiled/quota-presentation.js +42 -9
- package/src/tui-compiled/sidebar-state.js +15 -1
- package/src/tui-compiled/tui/quota-layout.js +378 -0
- package/src/tui-compiled/tui/route-layout.js +30 -0
- package/src/tui-compiled/tui.js +271 -371
- package/src/tui-ga-compiled/host-ga.js +93 -90
- package/src/tui-ga-compiled/shared/1ff34afa7c42d196-projection.js +3 -1
- package/src/tui-ga-compiled/shared/6ca47cd4ec33fe72-route-layout.js +30 -0
- package/src/tui-ga-compiled/shared/77138df80c7ae006-map.js +36 -1
- package/src/tui-ga-compiled/shared/8ae1927e5910ea81-sidebar-projection.js +2 -2
- package/src/tui-ga-compiled/shared/98cc0c186c46c42d-quota-presentation.js +42 -9
- package/src/tui-ga-compiled/shared/aef2402f8fc342f0-format.js +196 -43
- package/src/tui-ga-compiled/shared/bf17cbee28e58197-index.js +2 -2
- package/src/tui-ga-compiled/shared/ca21dc417b36dc5d-codec.js +2 -1
- package/src/tui-ga-compiled/shared/dd4c9e1a907f8ef0-quota-layout.js +378 -0
- package/src/tui-ga-compiled/shared/ecc214300932dfb6-merge.js +21 -5
- package/src/tui-ga-raw/host-ga.tsx +102 -92
- package/src/tui-ga-raw/shared/1ff34afa7c42d196-projection.js +3 -1
- package/src/tui-ga-raw/shared/6ca47cd4ec33fe72-route-layout.js +30 -0
- package/src/tui-ga-raw/shared/77138df80c7ae006-map.js +36 -1
- package/src/tui-ga-raw/shared/8ae1927e5910ea81-sidebar-projection.js +2 -2
- package/src/tui-ga-raw/shared/98cc0c186c46c42d-quota-presentation.js +42 -9
- package/src/tui-ga-raw/shared/aef2402f8fc342f0-format.js +196 -43
- package/src/tui-ga-raw/shared/bf17cbee28e58197-index.js +2 -2
- package/src/tui-ga-raw/shared/ca21dc417b36dc5d-codec.js +2 -1
- package/src/tui-ga-raw/shared/dd4c9e1a907f8ef0-quota-layout.tsx +391 -0
- package/src/tui-ga-raw/shared/ecc214300932dfb6-merge.js +21 -5
- package/src/tui-raw/common-auth-embedded/quota/codec.js +2 -1
- package/src/tui-raw/common-auth-embedded/quota/format.js +196 -43
- package/src/tui-raw/common-auth-embedded/quota/index.js +2 -2
- package/src/tui-raw/common-auth-embedded/quota/map.js +36 -1
- package/src/tui-raw/common-auth-embedded/quota/merge.js +21 -5
- package/src/tui-raw/common-auth-embedded/quota/projection.js +3 -1
- package/src/tui-raw/quota-presentation.js +42 -9
- package/src/tui-raw/sidebar-state.js +15 -1
- package/src/tui-raw/tui/quota-layout.tsx +391 -0
- package/src/tui-raw/tui/route-layout.js +30 -0
- package/src/tui-raw/tui.tsx +218 -272
- package/src/tui.tsx +218 -272
- package/dist/src/tui/vault-setup.d.ts +0 -98
- package/dist/src/tui/vault-setup.d.ts.map +0 -1
- package/dist/src/tui/vault-setup.js +0 -198
- package/dist/src/tui/vault-setup.js.map +0 -1
- package/dist/types/src/plugin/transform/model-resolver.d.ts +0 -2
- package/dist/types/src/plugin/transform/model-resolver.d.ts.map +0 -1
- package/dist/types/src/quota-presentation.d.ts +0 -18
- package/dist/types/src/quota-presentation.d.ts.map +0 -1
package/src/tui-raw/tui.tsx
CHANGED
|
@@ -13,16 +13,20 @@
|
|
|
13
13
|
* score, and per-session routing decisions), so the fleet components are
|
|
14
14
|
* adapted rather than copied verbatim:
|
|
15
15
|
*
|
|
16
|
-
* -
|
|
17
|
-
*
|
|
18
|
-
*
|
|
16
|
+
* - The quota rows come from `tui/quota-layout.tsx`, shared with the
|
|
17
|
+
* OpenCode 2 sidebar: each window reads `remainingPercent + resetAt` from
|
|
18
|
+
* the Antigravity `SidebarQuotaEntry` shape, is colored via `quotaTone`
|
|
19
|
+
* (remaining threshold) instead of `usageTone` (used threshold), and is
|
|
20
|
+
* one line sized from the measured sidebar width.
|
|
19
21
|
* - `AccountBlock` derives its status word (`active` / `idle` /
|
|
20
|
-
* `cooling` / `off`
|
|
21
|
-
*
|
|
22
|
-
*
|
|
23
|
-
*
|
|
24
|
-
*
|
|
25
|
-
*
|
|
22
|
+
* `cooling` / `off`) from the Antigravity account state; the shared block
|
|
23
|
+
* shows the reading age once per account and groups windows under
|
|
24
|
+
* `Gemini` and `Other models` headers. The routing health score is not
|
|
25
|
+
* shown.
|
|
26
|
+
* - `Routing` shows the mounted session's most recent `activeRouting`
|
|
27
|
+
* entry, or `No request yet` before the session's first request, since
|
|
28
|
+
* Antigravity does not maintain a per-session sidebar state alongside the
|
|
29
|
+
* slot-rendered tree.
|
|
26
30
|
*
|
|
27
31
|
* Hard rules for this file:
|
|
28
32
|
*
|
|
@@ -45,12 +49,11 @@ import type {
|
|
|
45
49
|
} from "@opencode-ai/plugin/tui"
|
|
46
50
|
import { createSlot } from "@opentui/solid"
|
|
47
51
|
import { createSignal, For, type JSX, onCleanup, onMount, Show } from "solid-js"
|
|
48
|
-
import {
|
|
52
|
+
import { NO_QUOTA_READING } from "./quota-presentation.js"
|
|
49
53
|
import { getRpcDir } from "./rpc/rpc-dir.js"
|
|
50
54
|
import {
|
|
51
55
|
readSidebarState,
|
|
52
56
|
type SidebarAccountState,
|
|
53
|
-
type SidebarQuotaEntry,
|
|
54
57
|
type SidebarQuotaKey,
|
|
55
58
|
type SidebarStateV1,
|
|
56
59
|
} from "./sidebar-state.js"
|
|
@@ -60,6 +63,19 @@ import {
|
|
|
60
63
|
dispatchV1Notification,
|
|
61
64
|
type V1Notification,
|
|
62
65
|
} from "./tui/host-v1.tsx"
|
|
66
|
+
import {
|
|
67
|
+
type AccountWindow,
|
|
68
|
+
ASSUMED_CONTENT_WIDTH,
|
|
69
|
+
accountWindows,
|
|
70
|
+
fitLabel,
|
|
71
|
+
QuotaAccountBlock,
|
|
72
|
+
type QuotaPalette,
|
|
73
|
+
type QuotaTone,
|
|
74
|
+
quotaTone,
|
|
75
|
+
RESET_SINCE_READING,
|
|
76
|
+
showsFigure,
|
|
77
|
+
} from "./tui/quota-layout.tsx"
|
|
78
|
+
import { routeLineFits } from "./tui/route-layout.js"
|
|
63
79
|
import {
|
|
64
80
|
type AntigravityAuthTuiPrefs,
|
|
65
81
|
type AppearancePrefs,
|
|
@@ -121,18 +137,11 @@ let rpcInFlight = false
|
|
|
121
137
|
const GLOBAL_NOTIFICATION_CURSOR = '__global__'
|
|
122
138
|
const MAX_NOTIFICATION_CURSORS = 256
|
|
123
139
|
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
const QUOTA_ORDER: readonly SidebarQuotaKey[] = ['gemini', 'non-gemini']
|
|
130
|
-
|
|
131
|
-
const WINDOW_GUTTER: Record<string, string> = {
|
|
132
|
-
weekly: '7d',
|
|
133
|
-
'5h': '5h',
|
|
140
|
+
// The collapsed row has room for one word before the window name.
|
|
141
|
+
const COLLAPSED_GROUP_NAMES: Record<SidebarQuotaKey, string> = {
|
|
142
|
+
gemini: 'Gemini',
|
|
143
|
+
'non-gemini': 'Other',
|
|
134
144
|
}
|
|
135
|
-
|
|
136
145
|
// --- Theme tokens ----------------------------------------------------------
|
|
137
146
|
//
|
|
138
147
|
// The sidebar pulls its colors from the live host theme (`api.theme.current`
|
|
@@ -146,7 +155,7 @@ const WINDOW_GUTTER: Record<string, string> = {
|
|
|
146
155
|
// uses are populated; the rest of the TuiThemeCurrent fields are left
|
|
147
156
|
// undefined and the `??` chain in `toneColor` falls through cleanly.
|
|
148
157
|
|
|
149
|
-
type Tone =
|
|
158
|
+
type Tone = QuotaTone
|
|
150
159
|
type Theme = TuiThemeCurrent
|
|
151
160
|
type ThemeColor = Theme['text']
|
|
152
161
|
|
|
@@ -225,31 +234,15 @@ function toneColor(theme: Theme, tone: Tone): ThemeColor {
|
|
|
225
234
|
}
|
|
226
235
|
}
|
|
227
236
|
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
}
|
|
238
|
-
|
|
239
|
-
function quotaBarSegments(
|
|
240
|
-
remainingPct: number,
|
|
241
|
-
appearance: AppearancePrefs,
|
|
242
|
-
): BarSegment[] {
|
|
243
|
-
const width = appearance.barWidth
|
|
244
|
-
const usedCells = Math.max(
|
|
245
|
-
0,
|
|
246
|
-
Math.min(Math.round((remainingPct / 100) * width), width),
|
|
247
|
-
)
|
|
248
|
-
const tone = quotaTone(100 - remainingPct, appearance)
|
|
249
|
-
return [
|
|
250
|
-
{ text: appearance.barFilledChar.repeat(usedCells), tone },
|
|
251
|
-
{ text: appearance.barEmptyChar.repeat(width - usedCells), tone },
|
|
252
|
-
].filter((segment) => segment.text.length > 0)
|
|
237
|
+
// The shared quota layout reads its colors through this palette. Muted text
|
|
238
|
+
// and the account label read `textMuted` and `text` straight from the theme,
|
|
239
|
+
// without the `toneColor` fallback chain.
|
|
240
|
+
function themePalette(theme: () => Theme): QuotaPalette {
|
|
241
|
+
return {
|
|
242
|
+
text: () => theme().text,
|
|
243
|
+
muted: () => theme().textMuted,
|
|
244
|
+
tone: (tone) => toneColor(theme(), tone),
|
|
245
|
+
}
|
|
253
246
|
}
|
|
254
247
|
|
|
255
248
|
export interface SidebarPanelProps {
|
|
@@ -397,12 +390,6 @@ function getSidebarController(): SidebarController {
|
|
|
397
390
|
|
|
398
391
|
// --- Shared helpers (fleet shape, antigravity data) ------------------------
|
|
399
392
|
|
|
400
|
-
function clamp(value: number, min: number, max: number): number {
|
|
401
|
-
if (value < min) return min
|
|
402
|
-
if (value > max) return max
|
|
403
|
-
return value
|
|
404
|
-
}
|
|
405
|
-
|
|
406
393
|
// Render a "reset in Nm/Nh/NdNh" string from an epoch-ms reset time.
|
|
407
394
|
// Empty string when no resetAt is cached. The fleet's `formatResetIn`
|
|
408
395
|
// reads ISO strings; Antigravity persists resetAt as a numeric epoch, so
|
|
@@ -468,11 +455,9 @@ function StatRow(props: {
|
|
|
468
455
|
)
|
|
469
456
|
}
|
|
470
457
|
|
|
471
|
-
// Fleet CollapsedRow: muted label left, caller-supplied value right.
|
|
472
|
-
//
|
|
473
|
-
//
|
|
474
|
-
// single primary-quota line, but Antigravity's multi-quota model fits a
|
|
475
|
-
// per-account row better when the sidebar is collapsed).
|
|
458
|
+
// Fleet CollapsedRow: muted label left, caller-supplied value right. The
|
|
459
|
+
// collapsed view renders one for the active account. The caller sizes both
|
|
460
|
+
// sides to the measured width, so neither side may wrap.
|
|
476
461
|
function CollapsedRow(props: {
|
|
477
462
|
theme: () => Theme
|
|
478
463
|
label: string
|
|
@@ -480,77 +465,19 @@ function CollapsedRow(props: {
|
|
|
480
465
|
}): JSX.Element {
|
|
481
466
|
return (
|
|
482
467
|
<box width='100%' flexDirection='row' justifyContent='space-between'>
|
|
483
|
-
<text fg={props.theme().textMuted}>
|
|
468
|
+
<text flexShrink={0} wrapMode='none' fg={props.theme().textMuted}>
|
|
469
|
+
{props.label}
|
|
470
|
+
</text>
|
|
484
471
|
{props.children}
|
|
485
472
|
</box>
|
|
486
473
|
)
|
|
487
474
|
}
|
|
488
475
|
|
|
489
|
-
//
|
|
490
|
-
//
|
|
491
|
-
|
|
492
|
-
theme: () => Theme
|
|
493
|
-
appearance: AppearancePrefs
|
|
494
|
-
label: string
|
|
495
|
-
entry: SidebarQuotaEntry | undefined
|
|
496
|
-
now: () => number
|
|
497
|
-
}): JSX.Element {
|
|
498
|
-
const parts = () => quotaReadingParts(props.label, props.entry, props.now())
|
|
499
|
-
const remaining = () => parts().remaining
|
|
500
|
-
const reset = () => parts().detail
|
|
501
|
-
return (
|
|
502
|
-
<Show
|
|
503
|
-
when={remaining() != null}
|
|
504
|
-
fallback={
|
|
505
|
-
<box width='100%' flexDirection='row' justifyContent='space-between'>
|
|
506
|
-
<text fg={props.theme().textMuted}>{props.label.padEnd(5)}</text>
|
|
507
|
-
<text fg={props.theme().textMuted}>{parts().figure}</text>
|
|
508
|
-
</box>
|
|
509
|
-
}
|
|
510
|
-
>
|
|
511
|
-
<box width='100%' flexDirection='row' justifyContent='space-between'>
|
|
512
|
-
<box flexDirection='row'>
|
|
513
|
-
<text width={5} flexShrink={0} fg={props.theme().textMuted}>
|
|
514
|
-
{props.label}
|
|
515
|
-
</text>
|
|
516
|
-
<box
|
|
517
|
-
width={props.appearance.barWidth}
|
|
518
|
-
flexShrink={0}
|
|
519
|
-
flexDirection='row'
|
|
520
|
-
>
|
|
521
|
-
<For each={quotaBarSegments(remaining() ?? 0, props.appearance)}>
|
|
522
|
-
{(segment) => (
|
|
523
|
-
<text fg={toneColor(props.theme(), segment.tone)}>
|
|
524
|
-
{segment.text}
|
|
525
|
-
</text>
|
|
526
|
-
)}
|
|
527
|
-
</For>
|
|
528
|
-
</box>
|
|
529
|
-
<text
|
|
530
|
-
fg={toneColor(
|
|
531
|
-
props.theme(),
|
|
532
|
-
quotaTone(100 - (remaining() ?? 0), props.appearance),
|
|
533
|
-
)}
|
|
534
|
-
>
|
|
535
|
-
{` ${parts().figure}`}
|
|
536
|
-
</text>
|
|
537
|
-
</box>
|
|
538
|
-
<Show when={reset()}>
|
|
539
|
-
<text fg={props.theme().textMuted}>{reset()}</text>
|
|
540
|
-
</Show>
|
|
541
|
-
</box>
|
|
542
|
-
</Show>
|
|
543
|
-
)
|
|
544
|
-
}
|
|
545
|
-
|
|
546
|
-
// Fleet AccountBlock, adapted to Antigravity's per-account data. Header
|
|
547
|
-
// row is account label (left) + status word (right). The body renders one
|
|
548
|
-
// QuotaRow per present quota group in the fleet's stable order, then a
|
|
549
|
-
// muted secondary line with the account's health score and, when
|
|
550
|
-
// relevant, a cooldown countdown. Status word priorities (first match
|
|
551
|
-
// wins):
|
|
476
|
+
// One account in the Quota section: the shared quota block, with the status
|
|
477
|
+
// word computed from the sidebar file's account state. Status word priorities
|
|
478
|
+
// (first match wins):
|
|
552
479
|
// - `off` when the account is disabled
|
|
553
|
-
// - `cooling
|
|
480
|
+
// - `cooling <wait>` when cooldownUntil is still in the future
|
|
554
481
|
// - `active` when current === true
|
|
555
482
|
// - `idle` for the fallback (current === false) case
|
|
556
483
|
function AccountBlock(props: {
|
|
@@ -558,86 +485,82 @@ function AccountBlock(props: {
|
|
|
558
485
|
appearance: AppearancePrefs
|
|
559
486
|
account: SidebarAccountState
|
|
560
487
|
now: () => number
|
|
488
|
+
width: () => number
|
|
561
489
|
active?: boolean
|
|
562
490
|
marginTop?: number
|
|
563
491
|
}): JSX.Element {
|
|
564
492
|
const active = () => props.active ?? props.account.current
|
|
493
|
+
const cooldownMs = (): number => {
|
|
494
|
+
const cd = props.account.cooldownUntil
|
|
495
|
+
if (typeof cd !== 'number') return 0
|
|
496
|
+
return Math.max(0, cd - props.now())
|
|
497
|
+
}
|
|
565
498
|
const statusWord = (): string => {
|
|
566
499
|
if (!props.account.enabled) return 'off'
|
|
567
|
-
|
|
568
|
-
if (typeof cd === 'number' && cd > props.now()) return 'cooling'
|
|
500
|
+
if (cooldownMs() > 0) return `cooling ${formatWait(cooldownMs())}`
|
|
569
501
|
return active() ? 'active' : 'idle'
|
|
570
502
|
}
|
|
571
503
|
const statusTone = (): Tone => {
|
|
572
504
|
if (!props.account.enabled) return 'muted'
|
|
573
|
-
|
|
574
|
-
if (typeof cd === 'number' && cd > props.now()) return 'warn'
|
|
505
|
+
if (cooldownMs() > 0) return 'warn'
|
|
575
506
|
return active() ? 'ok' : 'muted'
|
|
576
507
|
}
|
|
577
|
-
const cooldownMs = (): number => {
|
|
578
|
-
const cd = props.account.cooldownUntil
|
|
579
|
-
if (typeof cd !== 'number') return 0
|
|
580
|
-
return Math.max(0, cd - props.now())
|
|
581
|
-
}
|
|
582
|
-
const healthText = () => {
|
|
583
|
-
const base = `health ${Math.round(clamp(props.account.health, 0, 100))}`
|
|
584
|
-
return cooldownMs() > 0
|
|
585
|
-
? `${base} · cooling ${formatWait(cooldownMs())}`
|
|
586
|
-
: base
|
|
587
|
-
}
|
|
588
508
|
return (
|
|
589
|
-
<
|
|
590
|
-
|
|
591
|
-
|
|
592
|
-
|
|
593
|
-
|
|
594
|
-
|
|
595
|
-
|
|
596
|
-
|
|
597
|
-
|
|
598
|
-
|
|
599
|
-
{(key) => {
|
|
600
|
-
const poolEntry = props.account.quota[key]
|
|
601
|
-
const windows = poolEntry?.windows
|
|
602
|
-
// Legacy: no windows array — render a single row with the pool label.
|
|
603
|
-
const hasWindows = windows && windows.length > 0
|
|
604
|
-
if (!hasWindows) {
|
|
605
|
-
return (
|
|
606
|
-
<QuotaRow
|
|
607
|
-
theme={props.theme}
|
|
608
|
-
appearance={props.appearance}
|
|
609
|
-
label={QUOTA_LABELS[key]}
|
|
610
|
-
entry={poolEntry}
|
|
611
|
-
now={props.now}
|
|
612
|
-
/>
|
|
613
|
-
)
|
|
614
|
-
}
|
|
615
|
-
return (
|
|
616
|
-
<>
|
|
617
|
-
{windows.map((w) => (
|
|
618
|
-
<QuotaRow
|
|
619
|
-
theme={props.theme}
|
|
620
|
-
appearance={props.appearance}
|
|
621
|
-
label={`${QUOTA_LABELS[key]} ${WINDOW_GUTTER[w.window] ?? w.window}`}
|
|
622
|
-
entry={{
|
|
623
|
-
remainingPercent: w.remainingPercent,
|
|
624
|
-
resetAt: w.resetAt,
|
|
625
|
-
checkedAt: w.checkedAt,
|
|
626
|
-
}}
|
|
627
|
-
now={props.now}
|
|
628
|
-
/>
|
|
629
|
-
))}
|
|
630
|
-
</>
|
|
631
|
-
)
|
|
632
|
-
}}
|
|
633
|
-
</For>
|
|
634
|
-
<box width='100%' flexDirection='row'>
|
|
635
|
-
<text fg={props.theme().textMuted}>{` ${healthText()}`}</text>
|
|
636
|
-
</box>
|
|
637
|
-
</box>
|
|
509
|
+
<QuotaAccountBlock
|
|
510
|
+
palette={themePalette(props.theme)}
|
|
511
|
+
appearance={props.appearance}
|
|
512
|
+
account={props.account}
|
|
513
|
+
status={statusWord()}
|
|
514
|
+
statusTone={statusTone()}
|
|
515
|
+
now={props.now}
|
|
516
|
+
width={props.width}
|
|
517
|
+
marginTop={props.marginTop}
|
|
518
|
+
/>
|
|
638
519
|
)
|
|
639
520
|
}
|
|
640
521
|
|
|
522
|
+
interface CollapsedQuota {
|
|
523
|
+
// The group and window of the figure (`Other 7d `), dropped when narrow.
|
|
524
|
+
prefix: string
|
|
525
|
+
text: string
|
|
526
|
+
remaining: number | null
|
|
527
|
+
}
|
|
528
|
+
|
|
529
|
+
// The collapsed row's figure: the lowest current window across both groups.
|
|
530
|
+
// A window that reset since its reading is not current and never binds.
|
|
531
|
+
function collapsedQuota(
|
|
532
|
+
account: SidebarAccountState,
|
|
533
|
+
now: number,
|
|
534
|
+
): CollapsedQuota {
|
|
535
|
+
if (account.quota.gemini == null && account.quota['non-gemini'] == null)
|
|
536
|
+
return { prefix: '', text: '—', remaining: null }
|
|
537
|
+
const windows = accountWindows(account, now)
|
|
538
|
+
let lowest: AccountWindow | undefined
|
|
539
|
+
for (const window of windows) {
|
|
540
|
+
if (!showsFigure(window)) continue
|
|
541
|
+
if (
|
|
542
|
+
lowest === undefined ||
|
|
543
|
+
(window.text.remaining ?? 100) < (lowest.text.remaining ?? 100)
|
|
544
|
+
)
|
|
545
|
+
lowest = window
|
|
546
|
+
}
|
|
547
|
+
if (lowest) {
|
|
548
|
+
const name = lowest.text.name
|
|
549
|
+
return {
|
|
550
|
+
prefix: `${COLLAPSED_GROUP_NAMES[lowest.key]}${name ? ` ${name}` : ''} `,
|
|
551
|
+
text: lowest.text.figure,
|
|
552
|
+
remaining: lowest.text.remaining,
|
|
553
|
+
}
|
|
554
|
+
}
|
|
555
|
+
return {
|
|
556
|
+
prefix: '',
|
|
557
|
+
text: windows.some((window) => window.text.resetSinceReading)
|
|
558
|
+
? RESET_SINCE_READING
|
|
559
|
+
: NO_QUOTA_READING,
|
|
560
|
+
remaining: null,
|
|
561
|
+
}
|
|
562
|
+
}
|
|
563
|
+
|
|
641
564
|
function formatWait(ms: number): string {
|
|
642
565
|
const seconds = Math.ceil(ms / 1000)
|
|
643
566
|
if (seconds < 60) return `${seconds}s`
|
|
@@ -723,6 +646,36 @@ export function SidebarPanel(props: SidebarPanelProps): JSX.Element {
|
|
|
723
646
|
}
|
|
724
647
|
}
|
|
725
648
|
|
|
649
|
+
// The route on one `Route <value>` line when it fits, else one line per
|
|
650
|
+
// part with the strategy last.
|
|
651
|
+
const routeValue = (route: {
|
|
652
|
+
strategy?: string
|
|
653
|
+
family: string
|
|
654
|
+
style: string
|
|
655
|
+
}): string =>
|
|
656
|
+
`${route.strategy ? `${route.strategy} · ` : ''}${route.family}: ${route.style}`
|
|
657
|
+
const routeLines = (route: {
|
|
658
|
+
strategy?: string
|
|
659
|
+
family: string
|
|
660
|
+
style: string
|
|
661
|
+
}): string[] =>
|
|
662
|
+
[`${route.family}: ${route.style}`, route.strategy ?? ''].filter(
|
|
663
|
+
(line) => line !== '',
|
|
664
|
+
)
|
|
665
|
+
|
|
666
|
+
// The width available to content: the header row spans the panel inside
|
|
667
|
+
// its border and padding. Layout reports it during a render pass, so the
|
|
668
|
+
// signal is updated afterwards rather than rebuilding rows mid-pass.
|
|
669
|
+
const [contentWidth, setContentWidth] = createSignal(ASSUMED_CONTENT_WIDTH)
|
|
670
|
+
let headerRow: { width: number } | undefined
|
|
671
|
+
const measureContentWidth = (): void => {
|
|
672
|
+
const width = headerRow?.width
|
|
673
|
+
if (typeof width !== 'number' || width <= 0) return
|
|
674
|
+
queueMicrotask(() => {
|
|
675
|
+
if (width !== contentWidth()) setContentWidth(width)
|
|
676
|
+
})
|
|
677
|
+
}
|
|
678
|
+
|
|
726
679
|
// Header badge: ▼/▶ {label}. The fleet shows the version string on the
|
|
727
680
|
// right when no degraded state is present; the antigravity adapter keeps
|
|
728
681
|
// that right-alignment and surfaces `degraded` as a "LIMITED" badge
|
|
@@ -745,6 +698,10 @@ export function SidebarPanel(props: SidebarPanelProps): JSX.Element {
|
|
|
745
698
|
>
|
|
746
699
|
{/* biome-ignore lint/a11y/noStaticElementInteractions: opentui renders to a terminal, not the DOM — ARIA roles do not apply */}
|
|
747
700
|
<box
|
|
701
|
+
ref={(element) => {
|
|
702
|
+
headerRow = element
|
|
703
|
+
}}
|
|
704
|
+
onSizeChange={measureContentWidth}
|
|
748
705
|
width='100%'
|
|
749
706
|
flexDirection='row'
|
|
750
707
|
justifyContent='space-between'
|
|
@@ -781,48 +738,12 @@ export function SidebarPanel(props: SidebarPanelProps): JSX.Element {
|
|
|
781
738
|
</Show>
|
|
782
739
|
</box>
|
|
783
740
|
|
|
784
|
-
{/* Collapsed: the active account's
|
|
741
|
+
{/* Collapsed: the active account's lowest current figure and fleet status dot. */}
|
|
785
742
|
<Show when={collapsed() && hasData()}>
|
|
786
743
|
{(() => {
|
|
787
744
|
const account = () =>
|
|
788
745
|
visibleAccounts().find((entry) => entry.current) ??
|
|
789
746
|
visibleAccounts()[0]
|
|
790
|
-
const remaining = () => {
|
|
791
|
-
const q = account()?.quota
|
|
792
|
-
// The lowest remaining percentage among dated readings determines the warning tone.
|
|
793
|
-
const gemini = quotaReadingParts('Gm', q?.gemini, now()).remaining
|
|
794
|
-
const nonGemini = quotaReadingParts(
|
|
795
|
-
'NG',
|
|
796
|
-
q?.['non-gemini'],
|
|
797
|
-
now(),
|
|
798
|
-
).remaining
|
|
799
|
-
if (gemini === null && nonGemini === null) return null
|
|
800
|
-
return Math.min(gemini ?? 100, nonGemini ?? 100)
|
|
801
|
-
}
|
|
802
|
-
const poolText = (key: 'gemini' | 'non-gemini') => {
|
|
803
|
-
const entry = account()?.quota[key]
|
|
804
|
-
if (!entry)
|
|
805
|
-
return `${QUOTA_LABELS[key]}: ${formatQuotaReading(QUOTA_LABELS[key], undefined, now())}`
|
|
806
|
-
// Show binding window when available, else just pool label.
|
|
807
|
-
const bindingWindow = entry.windows?.reduce<
|
|
808
|
-
(typeof entry.windows)[0] | null
|
|
809
|
-
>(
|
|
810
|
-
(best, w) =>
|
|
811
|
-
best === null || w.remainingPercent < best.remainingPercent
|
|
812
|
-
? w
|
|
813
|
-
: best,
|
|
814
|
-
null,
|
|
815
|
-
)
|
|
816
|
-
const gutter = bindingWindow
|
|
817
|
-
? ` ${WINDOW_GUTTER[bindingWindow.window] ?? bindingWindow.window}`
|
|
818
|
-
: ''
|
|
819
|
-
const text = formatQuotaReading(
|
|
820
|
-
`${QUOTA_LABELS[key]}${gutter}`,
|
|
821
|
-
bindingWindow ?? entry,
|
|
822
|
-
now(),
|
|
823
|
-
)
|
|
824
|
-
return bindingWindow ? `${QUOTA_LABELS[key]} ${text}` : text
|
|
825
|
-
}
|
|
826
747
|
const unavailable = () => {
|
|
827
748
|
const selected = account()
|
|
828
749
|
return (
|
|
@@ -834,45 +755,50 @@ export function SidebarPanel(props: SidebarPanelProps): JSX.Element {
|
|
|
834
755
|
}
|
|
835
756
|
return (
|
|
836
757
|
<Show when={account()}>
|
|
837
|
-
{(selected) =>
|
|
838
|
-
|
|
839
|
-
|
|
840
|
-
|
|
841
|
-
|
|
842
|
-
|
|
843
|
-
|
|
844
|
-
|
|
845
|
-
|
|
846
|
-
|
|
847
|
-
|
|
848
|
-
|
|
849
|
-
|
|
850
|
-
|
|
851
|
-
|
|
852
|
-
|
|
853
|
-
|
|
854
|
-
|
|
855
|
-
|
|
856
|
-
|
|
857
|
-
|
|
858
|
-
|
|
859
|
-
|
|
860
|
-
|
|
861
|
-
|
|
862
|
-
|
|
863
|
-
|
|
864
|
-
|
|
865
|
-
|
|
866
|
-
|
|
867
|
-
|
|
868
|
-
|
|
869
|
-
|
|
870
|
-
|
|
871
|
-
|
|
872
|
-
|
|
873
|
-
|
|
874
|
-
|
|
875
|
-
|
|
758
|
+
{(selected) => {
|
|
759
|
+
const quota = () => collapsedQuota(selected(), now())
|
|
760
|
+
const tone = (): Tone => {
|
|
761
|
+
const remaining = quota().remaining
|
|
762
|
+
return remaining == null
|
|
763
|
+
? 'muted'
|
|
764
|
+
: quotaTone(100 - remaining, prefs().appearance)
|
|
765
|
+
}
|
|
766
|
+
// Label, one space, the figure and the two-cell dot. The
|
|
767
|
+
// group prefix goes first when narrow; then the label is cut.
|
|
768
|
+
const figure = () => {
|
|
769
|
+
const { prefix, text } = quota()
|
|
770
|
+
const full = `${prefix}${text}`
|
|
771
|
+
return selected().label.length + 1 + full.length + 2 <=
|
|
772
|
+
contentWidth()
|
|
773
|
+
? full
|
|
774
|
+
: text
|
|
775
|
+
}
|
|
776
|
+
const label = () =>
|
|
777
|
+
fitLabel(
|
|
778
|
+
selected().label,
|
|
779
|
+
contentWidth() - 1 - figure().length - 2,
|
|
780
|
+
)
|
|
781
|
+
return (
|
|
782
|
+
<CollapsedRow theme={theme} label={label()}>
|
|
783
|
+
<box flexDirection='row' flexShrink={0}>
|
|
784
|
+
<text
|
|
785
|
+
flexShrink={0}
|
|
786
|
+
wrapMode='none'
|
|
787
|
+
fg={toneColor(theme(), tone())}
|
|
788
|
+
>
|
|
789
|
+
<b>{figure()}</b>
|
|
790
|
+
</text>
|
|
791
|
+
<text
|
|
792
|
+
flexShrink={0}
|
|
793
|
+
wrapMode='none'
|
|
794
|
+
fg={toneColor(theme(), unavailable() ? 'err' : tone())}
|
|
795
|
+
>
|
|
796
|
+
{unavailable() ? ' ⊘' : ' ●'}
|
|
797
|
+
</text>
|
|
798
|
+
</box>
|
|
799
|
+
</CollapsedRow>
|
|
800
|
+
)
|
|
801
|
+
}}
|
|
876
802
|
</Show>
|
|
877
803
|
)
|
|
878
804
|
})()}
|
|
@@ -899,28 +825,48 @@ export function SidebarPanel(props: SidebarPanelProps): JSX.Element {
|
|
|
899
825
|
appearance={prefs().appearance}
|
|
900
826
|
account={account}
|
|
901
827
|
now={now}
|
|
828
|
+
width={contentWidth}
|
|
902
829
|
marginTop={index() === 0 ? 0 : 1}
|
|
903
830
|
/>
|
|
904
831
|
)}
|
|
905
832
|
</For>
|
|
906
833
|
</Show>
|
|
907
834
|
|
|
908
|
-
{/* Routing */}
|
|
835
|
+
{/* Routing: the session's route, or one dim line before its first request. */}
|
|
909
836
|
<Show when={prefs().sections.routing}>
|
|
910
837
|
<SectionHeader theme={theme} title='Routing' />
|
|
911
838
|
<Show
|
|
912
839
|
when={currentRoute()}
|
|
913
840
|
fallback={
|
|
914
|
-
<
|
|
841
|
+
<text wrapMode='none' fg={theme().textMuted}>
|
|
842
|
+
{'No request yet'}
|
|
843
|
+
</text>
|
|
915
844
|
}
|
|
916
845
|
>
|
|
917
846
|
{(route) => (
|
|
918
|
-
<
|
|
919
|
-
|
|
920
|
-
|
|
921
|
-
|
|
922
|
-
|
|
923
|
-
|
|
847
|
+
<Show
|
|
848
|
+
when={routeLineFits(
|
|
849
|
+
'Route',
|
|
850
|
+
routeValue(route()),
|
|
851
|
+
contentWidth(),
|
|
852
|
+
)}
|
|
853
|
+
fallback={
|
|
854
|
+
<For each={routeLines(route())}>
|
|
855
|
+
{(line) => (
|
|
856
|
+
<text wrapMode='none' fg={toneColor(theme(), 'accent')}>
|
|
857
|
+
<b>{line}</b>
|
|
858
|
+
</text>
|
|
859
|
+
)}
|
|
860
|
+
</For>
|
|
861
|
+
}
|
|
862
|
+
>
|
|
863
|
+
<StatRow
|
|
864
|
+
theme={theme}
|
|
865
|
+
label='Route'
|
|
866
|
+
value={routeValue(route())}
|
|
867
|
+
tone='accent'
|
|
868
|
+
/>
|
|
869
|
+
</Show>
|
|
924
870
|
)}
|
|
925
871
|
</Show>
|
|
926
872
|
</Show>
|