@cortexkit/opencode-antigravity-auth 3.0.5 → 3.0.6
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 +9199 -8799
- package/dist/cli.js.map +4 -4
- package/dist/cli.meta.json +1286 -1064
- package/dist/index.js +13641 -14559
- package/dist/index.js.map +4 -4
- package/dist/index.meta.json +1333 -1342
- package/dist/server.js +10618 -11080
- 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 +33 -3
- package/dist/src/common-auth-embedded/claustrum/consumer.js +96 -1
- package/dist/src/common-auth-embedded/claustrum/custody.d.ts +4 -1
- 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 +2 -1
- 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.js +20 -11
- 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 +26 -0
- package/dist/src/common-auth-embedded/quota/format.js +78 -42
- 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-runner.js +49 -0
- package/dist/src/common-auth-embedded/setup/command.d.ts +3 -0
- package/dist/src/common-auth-embedded/setup/command.js +215 -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 +70 -0
- package/dist/src/common-auth-embedded/setup/index.d.ts +5 -0
- package/dist/src/common-auth-embedded/setup/index.js +4 -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 +130 -0
- package/dist/src/common-auth-embedded/setup/types.d.ts +136 -0
- package/dist/src/common-auth-embedded/source-output.json +228 -80
- 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 +214 -53
- 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 +17 -49
- 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 +0 -43
- 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 +120 -40
- package/dist/src/plugin/ga-location-services.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 +15 -4
- package/dist/src/plugin/index.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 +5 -3
- package/dist/src/plugin/request.d.ts.map +1 -1
- package/dist/src/plugin/request.js +87 -168
- 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 +19 -25
- package/dist/src/plugin/shared/request-services.d.ts.map +1 -1
- package/dist/src/plugin/shared/request-services.js +105 -188
- 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 +4 -1
- package/dist/src/plugin/shared/vault-request-credentials.d.ts.map +1 -1
- package/dist/src/plugin/shared/vault-request-credentials.js +41 -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.map +1 -1
- package/dist/src/plugin/vault-custody.js +147 -35
- 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 +1 -1
- package/dist/src/sidebar-projection.d.ts.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.d.ts.map +1 -1
- package/dist/src/tui.js +205 -110
- package/dist/src/tui.js.map +1 -1
- package/dist/tui-build-map.json +37 -37
- package/dist/tui-ga-build-map.json +33 -33
- 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 +132 -0
- package/dist/types/src/common-auth-embedded/claustrum/custody.d.ts +178 -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/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 +26 -0
- 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.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 +5 -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 +136 -0
- 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/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/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 +5 -3
- 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 +19 -25
- package/dist/types/src/plugin/shared/request-services.d.ts.map +1 -1
- package/dist/types/src/plugin/shared/vault-request-credentials.d.ts +4 -1
- 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.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 +33 -3
- package/src/common-auth-embedded/claustrum/consumer.js +96 -1
- package/src/common-auth-embedded/claustrum/custody.d.ts +4 -1
- 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 +2 -1
- 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.js +20 -11
- 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 +26 -0
- package/src/common-auth-embedded/quota/format.js +78 -42
- 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-runner.js +49 -0
- package/src/common-auth-embedded/setup/command.d.ts +3 -0
- package/src/common-auth-embedded/setup/command.js +215 -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 +70 -0
- package/src/common-auth-embedded/setup/index.d.ts +5 -0
- package/src/common-auth-embedded/setup/index.js +4 -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 +130 -0
- package/src/common-auth-embedded/setup/types.d.ts +136 -0
- package/src/common-auth-embedded/source-output.json +228 -80
- 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 +78 -42
- 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.js +516 -334
- package/src/tui-ga-compiled/host-ga.js +11 -38
- package/src/tui-ga-compiled/shared/1ff34afa7c42d196-projection.js +3 -1
- package/src/tui-ga-compiled/shared/77138df80c7ae006-map.js +36 -1
- package/src/tui-ga-compiled/shared/98cc0c186c46c42d-quota-presentation.js +42 -9
- package/src/tui-ga-compiled/shared/aef2402f8fc342f0-format.js +78 -42
- 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/ecc214300932dfb6-merge.js +21 -5
- package/src/tui-ga-raw/host-ga.tsx +31 -62
- package/src/tui-ga-raw/shared/1ff34afa7c42d196-projection.js +3 -1
- package/src/tui-ga-raw/shared/77138df80c7ae006-map.js +36 -1
- package/src/tui-ga-raw/shared/98cc0c186c46c42d-quota-presentation.js +42 -9
- package/src/tui-ga-raw/shared/aef2402f8fc342f0-format.js +78 -42
- 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/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 +78 -42
- 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.tsx +423 -218
- package/src/tui.tsx +423 -218
- 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-compiled/tui.js
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { createTextNode as _$createTextNode } from "opentui:runtime-module:%40opentui%2Fsolid";
|
|
2
|
+
import { use as _$use } from "opentui:runtime-module:%40opentui%2Fsolid";
|
|
2
3
|
import { memo as _$memo } from "opentui:runtime-module:%40opentui%2Fsolid";
|
|
3
4
|
import { createComponent as _$createComponent } from "opentui:runtime-module:%40opentui%2Fsolid";
|
|
4
5
|
import { effect as _$effect } from "opentui:runtime-module:%40opentui%2Fsolid";
|
|
@@ -21,16 +22,18 @@ import { createElement as _$createElement } from "opentui:runtime-module:%40open
|
|
|
21
22
|
* score, and per-session routing decisions), so the fleet components are
|
|
22
23
|
* adapted rather than copied verbatim:
|
|
23
24
|
*
|
|
24
|
-
* - `
|
|
25
|
+
* - `WindowRow` reads `remainingPercent + resetAt` from the Antigravity
|
|
25
26
|
* `SidebarQuotaEntry` shape and colors via `quotaTone` (remaining
|
|
26
|
-
* threshold) instead of `usageTone` (used threshold).
|
|
27
|
+
* threshold) instead of `usageTone` (used threshold). Each window is one
|
|
28
|
+
* line sized from the measured sidebar width.
|
|
27
29
|
* - `AccountBlock` derives its status word (`active` / `idle` /
|
|
28
|
-
* `cooling` / `off`
|
|
29
|
-
*
|
|
30
|
-
*
|
|
31
|
-
* - `Routing`
|
|
32
|
-
*
|
|
33
|
-
* per-session sidebar state alongside the
|
|
30
|
+
* `cooling` / `off`) from the Antigravity account state, shows the
|
|
31
|
+
* reading age once per account, and groups windows under `Gemini` and
|
|
32
|
+
* `Other models` headers. The routing health score is not shown.
|
|
33
|
+
* - `Routing` shows the mounted session's most recent `activeRouting`
|
|
34
|
+
* entry, or `No request yet` before the session's first request, since
|
|
35
|
+
* Antigravity does not maintain a per-session sidebar state alongside the
|
|
36
|
+
* slot-rendered tree.
|
|
34
37
|
*
|
|
35
38
|
* Hard rules for this file:
|
|
36
39
|
*
|
|
@@ -48,7 +51,7 @@ import { dirname, join } from "node:path";
|
|
|
48
51
|
import { fileURLToPath } from "node:url";
|
|
49
52
|
import { createSlot } from "opentui:runtime-module:%40opentui%2Fsolid";
|
|
50
53
|
import { createSignal, For, onCleanup, onMount, Show } from "opentui:runtime-module:solid-js";
|
|
51
|
-
import {
|
|
54
|
+
import { NO_QUOTA_READING, quotaReadingAge, quotaWindowText } from "./quota-presentation.js";
|
|
52
55
|
import { getRpcDir } from "./rpc/rpc-dir.js";
|
|
53
56
|
import { readSidebarState } from "./sidebar-state.js";
|
|
54
57
|
import { createTuiFileLogger } from "./tui/file-logger.js";
|
|
@@ -98,15 +101,35 @@ const dispatchedNotificationIds = new Set();
|
|
|
98
101
|
let rpcInFlight = false;
|
|
99
102
|
const GLOBAL_NOTIFICATION_CURSOR = '__global__';
|
|
100
103
|
const MAX_NOTIFICATION_CURSORS = 256;
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
+
|
|
105
|
+
// Group headers name each quota pool in plain words.
|
|
106
|
+
const GROUP_NAMES = {
|
|
107
|
+
gemini: 'Gemini',
|
|
108
|
+
'non-gemini': 'Other models'
|
|
104
109
|
};
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
110
|
+
|
|
111
|
+
// The collapsed row has room for one word before the window name.
|
|
112
|
+
const COLLAPSED_GROUP_NAMES = {
|
|
113
|
+
gemini: 'Gemini',
|
|
114
|
+
'non-gemini': 'Other'
|
|
109
115
|
};
|
|
116
|
+
const QUOTA_ORDER = ['gemini', 'non-gemini'];
|
|
117
|
+
|
|
118
|
+
// Shown instead of a stored figure once the window has reset since it was
|
|
119
|
+
// read: the stored figure describes the window before the reset.
|
|
120
|
+
const RESET_SINCE_READING = 'reset since last check';
|
|
121
|
+
|
|
122
|
+
// Content width (the panel's width inside its padding) used until the first
|
|
123
|
+
// layout pass reports the real one. It fits the narrowest OpenCode sidebar.
|
|
124
|
+
const ASSUMED_CONTENT_WIDTH = 28;
|
|
125
|
+
|
|
126
|
+
// A window row is `<name> <bar> <figure> <reset>`. The bar shrinks to this
|
|
127
|
+
// before the reset column is dropped; below it the bar is dropped too.
|
|
128
|
+
const MIN_BAR_WIDTH = 4;
|
|
129
|
+
// The widest figure the formatter writes: `100% left`.
|
|
130
|
+
const FIGURE_WIDTH = 9;
|
|
131
|
+
// A window name (`5h`, `7d`) and the space after it.
|
|
132
|
+
const NAME_WIDTH = 3;
|
|
110
133
|
|
|
111
134
|
// --- Theme tokens ----------------------------------------------------------
|
|
112
135
|
//
|
|
@@ -200,8 +223,7 @@ function quotaTone(usedPct, appearance) {
|
|
|
200
223
|
if (usedPct < appearance.errorThreshold) return 'warn';
|
|
201
224
|
return 'err';
|
|
202
225
|
}
|
|
203
|
-
function quotaBarSegments(remainingPct, appearance) {
|
|
204
|
-
const width = appearance.barWidth;
|
|
226
|
+
function quotaBarSegments(remainingPct, width, appearance) {
|
|
205
227
|
const usedCells = Math.max(0, Math.min(Math.round(remainingPct / 100 * width), width));
|
|
206
228
|
const tone = quotaTone(100 - remainingPct, appearance);
|
|
207
229
|
return [{
|
|
@@ -314,12 +336,6 @@ function getSidebarController() {
|
|
|
314
336
|
|
|
315
337
|
// --- Shared helpers (fleet shape, antigravity data) ------------------------
|
|
316
338
|
|
|
317
|
-
function clamp(value, min, max) {
|
|
318
|
-
if (value < min) return min;
|
|
319
|
-
if (value > max) return max;
|
|
320
|
-
return value;
|
|
321
|
-
}
|
|
322
|
-
|
|
323
339
|
// Render a "reset in Nm/Nh/NdNh" string from an epoch-ms reset time.
|
|
324
340
|
// Empty string when no resetAt is cached. The fleet's `formatResetIn`
|
|
325
341
|
// reads ISO strings; Antigravity persists resetAt as a numeric epoch, so
|
|
@@ -398,11 +414,9 @@ function StatRow(props) {
|
|
|
398
414
|
})();
|
|
399
415
|
}
|
|
400
416
|
|
|
401
|
-
// Fleet CollapsedRow: muted label left, caller-supplied value right.
|
|
402
|
-
//
|
|
403
|
-
//
|
|
404
|
-
// single primary-quota line, but Antigravity's multi-quota model fits a
|
|
405
|
-
// per-account row better when the sidebar is collapsed).
|
|
417
|
+
// Fleet CollapsedRow: muted label left, caller-supplied value right. The
|
|
418
|
+
// collapsed view renders one for the active account. The caller sizes both
|
|
419
|
+
// sides to the measured width, so neither side may wrap.
|
|
406
420
|
function CollapsedRow(props) {
|
|
407
421
|
return (() => {
|
|
408
422
|
var _el$8 = _$createElement("box"),
|
|
@@ -411,6 +425,8 @@ function CollapsedRow(props) {
|
|
|
411
425
|
_$setProp(_el$8, "width", '100%');
|
|
412
426
|
_$setProp(_el$8, "flexDirection", 'row');
|
|
413
427
|
_$setProp(_el$8, "justifyContent", 'space-between');
|
|
428
|
+
_$setProp(_el$9, "flexShrink", 0);
|
|
429
|
+
_$setProp(_el$9, "wrapMode", 'none');
|
|
414
430
|
_$insert(_el$9, () => props.label);
|
|
415
431
|
_$insert(_el$8, () => props.children, null);
|
|
416
432
|
_$effect(_$p => _$setProp(_el$9, "fg", props.theme().textMuted, _$p));
|
|
@@ -418,226 +434,342 @@ function CollapsedRow(props) {
|
|
|
418
434
|
})();
|
|
419
435
|
}
|
|
420
436
|
|
|
421
|
-
//
|
|
422
|
-
//
|
|
423
|
-
|
|
424
|
-
|
|
425
|
-
|
|
426
|
-
|
|
427
|
-
|
|
428
|
-
|
|
429
|
-
|
|
430
|
-
|
|
431
|
-
|
|
432
|
-
|
|
433
|
-
|
|
434
|
-
|
|
435
|
-
|
|
436
|
-
|
|
437
|
-
|
|
438
|
-
|
|
439
|
-
|
|
440
|
-
|
|
441
|
-
|
|
442
|
-
|
|
443
|
-
|
|
444
|
-
|
|
445
|
-
|
|
446
|
-
|
|
447
|
-
|
|
448
|
-
|
|
449
|
-
|
|
450
|
-
|
|
451
|
-
|
|
452
|
-
|
|
453
|
-
|
|
454
|
-
|
|
455
|
-
|
|
456
|
-
|
|
457
|
-
|
|
458
|
-
|
|
459
|
-
|
|
460
|
-
|
|
461
|
-
|
|
462
|
-
|
|
463
|
-
|
|
464
|
-
|
|
465
|
-
|
|
466
|
-
|
|
467
|
-
|
|
468
|
-
|
|
469
|
-
|
|
470
|
-
|
|
471
|
-
|
|
472
|
-
|
|
473
|
-
|
|
474
|
-
|
|
475
|
-
|
|
476
|
-
|
|
477
|
-
|
|
478
|
-
|
|
479
|
-
|
|
480
|
-
|
|
481
|
-
|
|
482
|
-
|
|
483
|
-
|
|
484
|
-
})()
|
|
485
|
-
}));
|
|
486
|
-
_$insert(_el$12, () => ` ${parts().figure}`);
|
|
487
|
-
_$insert(_el$0, _$createComponent(Show, {
|
|
488
|
-
get when() {
|
|
489
|
-
return reset();
|
|
490
|
-
},
|
|
491
|
-
get children() {
|
|
492
|
-
var _el$13 = _$createElement("text");
|
|
493
|
-
_$insert(_el$13, reset);
|
|
494
|
-
_$effect(_$p => _$setProp(_el$13, "fg", props.theme().textMuted, _$p));
|
|
495
|
-
return _el$13;
|
|
496
|
-
}
|
|
497
|
-
}), null);
|
|
498
|
-
_$effect(_p$ => {
|
|
499
|
-
var _v$3 = props.theme().textMuted,
|
|
500
|
-
_v$4 = props.appearance.barWidth,
|
|
501
|
-
_v$5 = toneColor(props.theme(), quotaTone(100 - (remaining() ?? 0), props.appearance));
|
|
502
|
-
_v$3 !== _p$.e && (_p$.e = _$setProp(_el$10, "fg", _v$3, _p$.e));
|
|
503
|
-
_v$4 !== _p$.t && (_p$.t = _$setProp(_el$11, "width", _v$4, _p$.t));
|
|
504
|
-
_v$5 !== _p$.a && (_p$.a = _$setProp(_el$12, "fg", _v$5, _p$.a));
|
|
505
|
-
return _p$;
|
|
506
|
-
}, {
|
|
507
|
-
e: undefined,
|
|
508
|
-
t: undefined,
|
|
509
|
-
a: undefined
|
|
510
|
-
});
|
|
511
|
-
return _el$0;
|
|
512
|
-
}
|
|
513
|
-
});
|
|
437
|
+
// --- Width-fitted quota rows ------------------------------------------------
|
|
438
|
+
//
|
|
439
|
+
// The OpenCode 1 sidebar is about 32 to 48 columns wide. Every quota line is
|
|
440
|
+
// sized from the measured content width so that it fits on one line: text is
|
|
441
|
+
// never left to the renderer's wrapping, which breaks a row mid-word or down
|
|
442
|
+
// to one character per line once the right-hand column runs out of room.
|
|
443
|
+
|
|
444
|
+
// One entry per stored window, in group order. A pool stored before
|
|
445
|
+
// per-window readings existed contributes one window without a name.
|
|
446
|
+
function accountWindows(account, now) {
|
|
447
|
+
const result = [];
|
|
448
|
+
for (const key of QUOTA_ORDER) {
|
|
449
|
+
const entry = account.quota[key];
|
|
450
|
+
if (!entry) continue;
|
|
451
|
+
const readings = entry.windows && entry.windows.length > 0 ? entry.windows.map(window => ({
|
|
452
|
+
window: window.window,
|
|
453
|
+
remainingPercent: window.remainingPercent,
|
|
454
|
+
resetAt: window.resetAt,
|
|
455
|
+
checkedAt: window.checkedAt
|
|
456
|
+
})) : [{
|
|
457
|
+
remainingPercent: entry.remainingPercent,
|
|
458
|
+
resetAt: entry.resetAt,
|
|
459
|
+
checkedAt: entry.checkedAt
|
|
460
|
+
}];
|
|
461
|
+
for (const reading of readings) result.push({
|
|
462
|
+
key,
|
|
463
|
+
reading,
|
|
464
|
+
text: quotaWindowText(reading, now)
|
|
465
|
+
});
|
|
466
|
+
}
|
|
467
|
+
return result;
|
|
468
|
+
}
|
|
469
|
+
|
|
470
|
+
// A window shows its figure only while no reset has happened since it was
|
|
471
|
+
// read and it has a read time at all.
|
|
472
|
+
function showsFigure(window) {
|
|
473
|
+
return window.text.remaining != null && !window.text.resetSinceReading;
|
|
474
|
+
}
|
|
475
|
+
// Column widths for one `<name> <bar> <figure> <reset>` row within `width`
|
|
476
|
+
// cells. The bar shrinks first, down to MIN_BAR_WIDTH; then the reset column
|
|
477
|
+
// is dropped; then the bar.
|
|
478
|
+
function windowRowLayout(width, named, resetWidth, maxBar) {
|
|
479
|
+
const room = width - (named ? NAME_WIDTH : 0) - FIGURE_WIDTH;
|
|
480
|
+
if (resetWidth > 0) {
|
|
481
|
+
const bar = Math.min(maxBar, room - resetWidth - 2);
|
|
482
|
+
if (bar >= MIN_BAR_WIDTH) return {
|
|
483
|
+
bar,
|
|
484
|
+
reset: true
|
|
485
|
+
};
|
|
486
|
+
}
|
|
487
|
+
const bar = Math.min(maxBar, room - 1);
|
|
488
|
+
return {
|
|
489
|
+
bar: bar >= MIN_BAR_WIDTH ? bar : 0,
|
|
490
|
+
reset: false
|
|
491
|
+
};
|
|
492
|
+
}
|
|
493
|
+
|
|
494
|
+
// Shorten a label to `max` cells, marking the cut with an ellipsis.
|
|
495
|
+
function fitLabel(label, max) {
|
|
496
|
+
if (label.length <= max) return label;
|
|
497
|
+
if (max <= 0) return '';
|
|
498
|
+
if (max === 1) return '…';
|
|
499
|
+
return `${label.slice(0, max - 1)}…`;
|
|
514
500
|
}
|
|
515
501
|
|
|
516
|
-
//
|
|
517
|
-
//
|
|
518
|
-
//
|
|
519
|
-
|
|
520
|
-
|
|
521
|
-
|
|
502
|
+
// One quota window on one line. The bar fills with remaining quota; the
|
|
503
|
+
// figure and reset come from the shared formatter. A window that reset since
|
|
504
|
+
// its reading shows that fact, dim, in place of the stale figure.
|
|
505
|
+
function WindowRow(props) {
|
|
506
|
+
const text = () => props.window.text;
|
|
507
|
+
const tone = () => quotaTone(100 - (text().remaining ?? 0), props.appearance);
|
|
508
|
+
return (() => {
|
|
509
|
+
var _el$0 = _$createElement("box");
|
|
510
|
+
_$setProp(_el$0, "width", '100%');
|
|
511
|
+
_$setProp(_el$0, "flexDirection", 'row');
|
|
512
|
+
_$insert(_el$0, _$createComponent(Show, {
|
|
513
|
+
get when() {
|
|
514
|
+
return text().name !== '';
|
|
515
|
+
},
|
|
516
|
+
get children() {
|
|
517
|
+
var _el$1 = _$createElement("text");
|
|
518
|
+
_$setProp(_el$1, "width", 3);
|
|
519
|
+
_$setProp(_el$1, "flexShrink", 0);
|
|
520
|
+
_$setProp(_el$1, "wrapMode", 'none');
|
|
521
|
+
_$insert(_el$1, () => text().name);
|
|
522
|
+
_$effect(_$p => _$setProp(_el$1, "fg", props.theme().textMuted, _$p));
|
|
523
|
+
return _el$1;
|
|
524
|
+
}
|
|
525
|
+
}), null);
|
|
526
|
+
_$insert(_el$0, _$createComponent(Show, {
|
|
527
|
+
get when() {
|
|
528
|
+
return showsFigure(props.window);
|
|
529
|
+
},
|
|
530
|
+
get fallback() {
|
|
531
|
+
return (() => {
|
|
532
|
+
var _el$14 = _$createElement("text");
|
|
533
|
+
_$setProp(_el$14, "flexShrink", 1);
|
|
534
|
+
_$setProp(_el$14, "wrapMode", 'none');
|
|
535
|
+
_$insert(_el$14, (() => {
|
|
536
|
+
var _c$ = _$memo(() => !!text().resetSinceReading);
|
|
537
|
+
return () => _c$() ? RESET_SINCE_READING : text().figure;
|
|
538
|
+
})());
|
|
539
|
+
_$effect(_$p => _$setProp(_el$14, "fg", props.theme().textMuted, _$p));
|
|
540
|
+
return _el$14;
|
|
541
|
+
})();
|
|
542
|
+
},
|
|
543
|
+
get children() {
|
|
544
|
+
return [_$createComponent(Show, {
|
|
545
|
+
get when() {
|
|
546
|
+
return props.layout.bar > 0;
|
|
547
|
+
},
|
|
548
|
+
get children() {
|
|
549
|
+
var _el$10 = _$createElement("box");
|
|
550
|
+
_$setProp(_el$10, "flexShrink", 0);
|
|
551
|
+
_$setProp(_el$10, "flexDirection", 'row');
|
|
552
|
+
_$insert(_el$10, _$createComponent(For, {
|
|
553
|
+
get each() {
|
|
554
|
+
return quotaBarSegments(text().remaining ?? 0, props.layout.bar, props.appearance);
|
|
555
|
+
},
|
|
556
|
+
children: segment => (() => {
|
|
557
|
+
var _el$15 = _$createElement("text");
|
|
558
|
+
_$setProp(_el$15, "wrapMode", 'none');
|
|
559
|
+
_$insert(_el$15, () => segment.text);
|
|
560
|
+
_$effect(_$p => _$setProp(_el$15, "fg", toneColor(props.theme(), segment.tone), _$p));
|
|
561
|
+
return _el$15;
|
|
562
|
+
})()
|
|
563
|
+
}));
|
|
564
|
+
_$effect(_$p => _$setProp(_el$10, "width", props.layout.bar + 1, _$p));
|
|
565
|
+
return _el$10;
|
|
566
|
+
}
|
|
567
|
+
}), (() => {
|
|
568
|
+
var _el$11 = _$createElement("text");
|
|
569
|
+
_$setProp(_el$11, "flexShrink", 0);
|
|
570
|
+
_$setProp(_el$11, "wrapMode", 'none');
|
|
571
|
+
_$insert(_el$11, () => text().figure);
|
|
572
|
+
_$effect(_$p => _$setProp(_el$11, "fg", toneColor(props.theme(), tone()), _$p));
|
|
573
|
+
return _el$11;
|
|
574
|
+
})(), (() => {
|
|
575
|
+
var _el$12 = _$createElement("box");
|
|
576
|
+
_$setProp(_el$12, "flexGrow", 1);
|
|
577
|
+
return _el$12;
|
|
578
|
+
})(), _$createComponent(Show, {
|
|
579
|
+
get when() {
|
|
580
|
+
return _$memo(() => !!props.layout.reset)() && text().reset !== '';
|
|
581
|
+
},
|
|
582
|
+
get children() {
|
|
583
|
+
var _el$13 = _$createElement("text");
|
|
584
|
+
_$setProp(_el$13, "flexShrink", 0);
|
|
585
|
+
_$setProp(_el$13, "wrapMode", 'none');
|
|
586
|
+
_$insert(_el$13, () => text().reset);
|
|
587
|
+
_$effect(_$p => _$setProp(_el$13, "fg", props.theme().textMuted, _$p));
|
|
588
|
+
return _el$13;
|
|
589
|
+
}
|
|
590
|
+
})];
|
|
591
|
+
}
|
|
592
|
+
}), null);
|
|
593
|
+
return _el$0;
|
|
594
|
+
})();
|
|
595
|
+
}
|
|
596
|
+
|
|
597
|
+
// Fleet AccountBlock, adapted to Antigravity's per-account data. The header
|
|
598
|
+
// line is the account label, the reading age when the oldest reading is
|
|
599
|
+
// stale, and the status word right-aligned; the age moves to its own dim
|
|
600
|
+
// line when the three do not fit. Below it each quota group present gets a
|
|
601
|
+
// plain-word header and one WindowRow per window. Status word priorities
|
|
602
|
+
// (first match wins):
|
|
522
603
|
// - `off` when the account is disabled
|
|
523
|
-
// - `cooling
|
|
604
|
+
// - `cooling <wait>` when cooldownUntil is still in the future
|
|
524
605
|
// - `active` when current === true
|
|
525
606
|
// - `idle` for the fallback (current === false) case
|
|
526
607
|
function AccountBlock(props) {
|
|
527
608
|
const active = () => props.active ?? props.account.current;
|
|
609
|
+
const cooldownMs = () => {
|
|
610
|
+
const cd = props.account.cooldownUntil;
|
|
611
|
+
if (typeof cd !== 'number') return 0;
|
|
612
|
+
return Math.max(0, cd - props.now());
|
|
613
|
+
};
|
|
528
614
|
const statusWord = () => {
|
|
529
615
|
if (!props.account.enabled) return 'off';
|
|
530
|
-
|
|
531
|
-
if (typeof cd === 'number' && cd > props.now()) return 'cooling';
|
|
616
|
+
if (cooldownMs() > 0) return `cooling ${formatWait(cooldownMs())}`;
|
|
532
617
|
return active() ? 'active' : 'idle';
|
|
533
618
|
};
|
|
534
619
|
const statusTone = () => {
|
|
535
620
|
if (!props.account.enabled) return 'muted';
|
|
536
|
-
|
|
537
|
-
if (typeof cd === 'number' && cd > props.now()) return 'warn';
|
|
621
|
+
if (cooldownMs() > 0) return 'warn';
|
|
538
622
|
return active() ? 'ok' : 'muted';
|
|
539
623
|
};
|
|
540
|
-
const
|
|
541
|
-
|
|
542
|
-
|
|
543
|
-
|
|
544
|
-
|
|
545
|
-
const
|
|
546
|
-
|
|
547
|
-
|
|
548
|
-
|
|
624
|
+
const windows = () => accountWindows(props.account, props.now());
|
|
625
|
+
const age = () => quotaReadingAge(windows().map(window => window.reading), props.now());
|
|
626
|
+
const ageInline = () => age() !== '' && props.account.label.length + 3 + age().length + 1 + statusWord().length <= props.width();
|
|
627
|
+
const label = () => fitLabel(props.account.label, props.width() - 1 - statusWord().length);
|
|
628
|
+
// One reset column width per account, so bars line up across its rows.
|
|
629
|
+
const resetWidth = () => Math.max(0, ...windows().filter(showsFigure).map(window => window.text.reset.length));
|
|
630
|
+
const layoutFor = window => windowRowLayout(props.width(), window.text.name !== '', resetWidth(), props.appearance.barWidth);
|
|
631
|
+
const groups = () => QUOTA_ORDER.map(key => ({
|
|
632
|
+
key,
|
|
633
|
+
windows: windows().filter(window => window.key === key)
|
|
634
|
+
})).filter(group => group.windows.length > 0);
|
|
549
635
|
return (() => {
|
|
550
|
-
var _el$
|
|
551
|
-
_el$
|
|
552
|
-
_el$
|
|
553
|
-
_el$
|
|
636
|
+
var _el$16 = _$createElement("box"),
|
|
637
|
+
_el$17 = _$createElement("box"),
|
|
638
|
+
_el$18 = _$createElement("text"),
|
|
639
|
+
_el$19 = _$createElement("b"),
|
|
640
|
+
_el$21 = _$createElement("box"),
|
|
554
641
|
_el$22 = _$createElement("text"),
|
|
555
|
-
_el$23 = _$createElement("b")
|
|
556
|
-
|
|
557
|
-
|
|
642
|
+
_el$23 = _$createElement("b");
|
|
643
|
+
_$insertNode(_el$16, _el$17);
|
|
644
|
+
_$setProp(_el$16, "width", '100%');
|
|
645
|
+
_$setProp(_el$16, "flexDirection", 'column');
|
|
646
|
+
_$insertNode(_el$17, _el$18);
|
|
647
|
+
_$insertNode(_el$17, _el$21);
|
|
648
|
+
_$insertNode(_el$17, _el$22);
|
|
649
|
+
_$setProp(_el$17, "width", '100%');
|
|
650
|
+
_$setProp(_el$17, "flexDirection", 'row');
|
|
558
651
|
_$insertNode(_el$18, _el$19);
|
|
559
|
-
_$
|
|
560
|
-
_$setProp(_el$18, "
|
|
561
|
-
_$
|
|
562
|
-
_$
|
|
563
|
-
|
|
564
|
-
|
|
565
|
-
|
|
566
|
-
|
|
567
|
-
|
|
568
|
-
|
|
652
|
+
_$setProp(_el$18, "flexShrink", 0);
|
|
653
|
+
_$setProp(_el$18, "wrapMode", 'none');
|
|
654
|
+
_$insert(_el$19, label);
|
|
655
|
+
_$insert(_el$17, _$createComponent(Show, {
|
|
656
|
+
get when() {
|
|
657
|
+
return ageInline();
|
|
658
|
+
},
|
|
659
|
+
get children() {
|
|
660
|
+
var _el$20 = _$createElement("text");
|
|
661
|
+
_$setProp(_el$20, "flexShrink", 0);
|
|
662
|
+
_$setProp(_el$20, "wrapMode", 'none');
|
|
663
|
+
_$insert(_el$20, () => ` · ${age()}`);
|
|
664
|
+
_$effect(_$p => _$setProp(_el$20, "fg", props.theme().textMuted, _$p));
|
|
665
|
+
return _el$20;
|
|
666
|
+
}
|
|
667
|
+
}), _el$21);
|
|
668
|
+
_$setProp(_el$21, "flexGrow", 1);
|
|
569
669
|
_$insertNode(_el$22, _el$23);
|
|
670
|
+
_$setProp(_el$22, "flexShrink", 0);
|
|
671
|
+
_$setProp(_el$22, "wrapMode", 'none');
|
|
570
672
|
_$insert(_el$23, statusWord);
|
|
571
|
-
_$insert(_el$
|
|
572
|
-
|
|
573
|
-
|
|
574
|
-
|
|
575
|
-
|
|
576
|
-
|
|
577
|
-
|
|
578
|
-
|
|
579
|
-
|
|
580
|
-
|
|
581
|
-
|
|
582
|
-
|
|
583
|
-
|
|
584
|
-
|
|
585
|
-
|
|
586
|
-
|
|
587
|
-
|
|
588
|
-
|
|
589
|
-
|
|
590
|
-
|
|
591
|
-
|
|
592
|
-
|
|
593
|
-
|
|
594
|
-
}
|
|
595
|
-
|
|
596
|
-
|
|
597
|
-
|
|
598
|
-
|
|
599
|
-
|
|
600
|
-
return props.appearance;
|
|
601
|
-
},
|
|
602
|
-
get label() {
|
|
603
|
-
return `${QUOTA_LABELS[key]} ${WINDOW_GUTTER[w.window] ?? w.window}`;
|
|
604
|
-
},
|
|
605
|
-
get entry() {
|
|
606
|
-
return {
|
|
607
|
-
remainingPercent: w.remainingPercent,
|
|
608
|
-
resetAt: w.resetAt,
|
|
609
|
-
checkedAt: w.checkedAt
|
|
610
|
-
};
|
|
673
|
+
_$insert(_el$16, _$createComponent(Show, {
|
|
674
|
+
get when() {
|
|
675
|
+
return _$memo(() => age() !== '')() && !ageInline();
|
|
676
|
+
},
|
|
677
|
+
get children() {
|
|
678
|
+
var _el$24 = _$createElement("text");
|
|
679
|
+
_$setProp(_el$24, "wrapMode", 'none');
|
|
680
|
+
_$insert(_el$24, age);
|
|
681
|
+
_$effect(_$p => _$setProp(_el$24, "fg", props.theme().textMuted, _$p));
|
|
682
|
+
return _el$24;
|
|
683
|
+
}
|
|
684
|
+
}), null);
|
|
685
|
+
_$insert(_el$16, _$createComponent(Show, {
|
|
686
|
+
get when() {
|
|
687
|
+
return groups().length > 0;
|
|
688
|
+
},
|
|
689
|
+
get fallback() {
|
|
690
|
+
return (() => {
|
|
691
|
+
var _el$25 = _$createElement("text");
|
|
692
|
+
_$setProp(_el$25, "wrapMode", 'none');
|
|
693
|
+
_$insert(_el$25, NO_QUOTA_READING);
|
|
694
|
+
_$effect(_$p => _$setProp(_el$25, "fg", props.theme().textMuted, _$p));
|
|
695
|
+
return _el$25;
|
|
696
|
+
})();
|
|
697
|
+
},
|
|
698
|
+
get children() {
|
|
699
|
+
return _$createComponent(For, {
|
|
700
|
+
get each() {
|
|
701
|
+
return groups();
|
|
611
702
|
},
|
|
612
|
-
|
|
613
|
-
|
|
614
|
-
|
|
615
|
-
|
|
703
|
+
children: group => [(() => {
|
|
704
|
+
var _el$26 = _$createElement("text");
|
|
705
|
+
_$setProp(_el$26, "wrapMode", 'none');
|
|
706
|
+
_$insert(_el$26, () => GROUP_NAMES[group.key]);
|
|
707
|
+
_$effect(_$p => _$setProp(_el$26, "fg", props.theme().textMuted, _$p));
|
|
708
|
+
return _el$26;
|
|
709
|
+
})(), _$createComponent(For, {
|
|
710
|
+
get each() {
|
|
711
|
+
return group.windows;
|
|
712
|
+
},
|
|
713
|
+
children: window => _$createComponent(WindowRow, {
|
|
714
|
+
get theme() {
|
|
715
|
+
return props.theme;
|
|
716
|
+
},
|
|
717
|
+
get appearance() {
|
|
718
|
+
return props.appearance;
|
|
719
|
+
},
|
|
720
|
+
window: window,
|
|
721
|
+
get layout() {
|
|
722
|
+
return layoutFor(window);
|
|
723
|
+
}
|
|
724
|
+
})
|
|
725
|
+
})]
|
|
726
|
+
});
|
|
616
727
|
}
|
|
617
|
-
}),
|
|
618
|
-
_$insertNode(_el$24, _el$25);
|
|
619
|
-
_$setProp(_el$24, "width", '100%');
|
|
620
|
-
_$setProp(_el$24, "flexDirection", 'row');
|
|
621
|
-
_$insert(_el$25, () => ` ${healthText()}`);
|
|
728
|
+
}), null);
|
|
622
729
|
_$effect(_p$ => {
|
|
623
|
-
var _v$
|
|
624
|
-
_v$
|
|
625
|
-
_v$
|
|
626
|
-
|
|
627
|
-
_v$
|
|
628
|
-
_v$
|
|
629
|
-
_v$0 !== _p$.a && (_p$.a = _$setProp(_el$22, "fg", _v$0, _p$.a));
|
|
630
|
-
_v$1 !== _p$.o && (_p$.o = _$setProp(_el$25, "fg", _v$1, _p$.o));
|
|
730
|
+
var _v$3 = props.marginTop ?? 0,
|
|
731
|
+
_v$4 = props.theme().text,
|
|
732
|
+
_v$5 = toneColor(props.theme(), statusTone());
|
|
733
|
+
_v$3 !== _p$.e && (_p$.e = _$setProp(_el$16, "marginTop", _v$3, _p$.e));
|
|
734
|
+
_v$4 !== _p$.t && (_p$.t = _$setProp(_el$18, "fg", _v$4, _p$.t));
|
|
735
|
+
_v$5 !== _p$.a && (_p$.a = _$setProp(_el$22, "fg", _v$5, _p$.a));
|
|
631
736
|
return _p$;
|
|
632
737
|
}, {
|
|
633
738
|
e: undefined,
|
|
634
739
|
t: undefined,
|
|
635
|
-
a: undefined
|
|
636
|
-
o: undefined
|
|
740
|
+
a: undefined
|
|
637
741
|
});
|
|
638
|
-
return _el$
|
|
742
|
+
return _el$16;
|
|
639
743
|
})();
|
|
640
744
|
}
|
|
745
|
+
// The collapsed row's figure: the lowest current window across both groups.
|
|
746
|
+
// A window that reset since its reading is not current and never binds.
|
|
747
|
+
function collapsedQuota(account, now) {
|
|
748
|
+
if (account.quota.gemini == null && account.quota['non-gemini'] == null) return {
|
|
749
|
+
prefix: '',
|
|
750
|
+
text: '—',
|
|
751
|
+
remaining: null
|
|
752
|
+
};
|
|
753
|
+
const windows = accountWindows(account, now);
|
|
754
|
+
let lowest;
|
|
755
|
+
for (const window of windows) {
|
|
756
|
+
if (!showsFigure(window)) continue;
|
|
757
|
+
if (lowest === undefined || (window.text.remaining ?? 100) < (lowest.text.remaining ?? 100)) lowest = window;
|
|
758
|
+
}
|
|
759
|
+
if (lowest) {
|
|
760
|
+
const name = lowest.text.name;
|
|
761
|
+
return {
|
|
762
|
+
prefix: `${COLLAPSED_GROUP_NAMES[lowest.key]}${name ? ` ${name}` : ''} `,
|
|
763
|
+
text: lowest.text.figure,
|
|
764
|
+
remaining: lowest.text.remaining
|
|
765
|
+
};
|
|
766
|
+
}
|
|
767
|
+
return {
|
|
768
|
+
prefix: '',
|
|
769
|
+
text: windows.some(window => window.text.resetSinceReading) ? RESET_SINCE_READING : NO_QUOTA_READING,
|
|
770
|
+
remaining: null
|
|
771
|
+
};
|
|
772
|
+
}
|
|
641
773
|
function formatWait(ms) {
|
|
642
774
|
const seconds = Math.ceil(ms / 1000);
|
|
643
775
|
if (seconds < 60) return `${seconds}s`;
|
|
@@ -714,6 +846,24 @@ export function SidebarPanel(props) {
|
|
|
714
846
|
};
|
|
715
847
|
};
|
|
716
848
|
|
|
849
|
+
// The route on one `Route <value>` line when it fits, else one line per
|
|
850
|
+
// part with the strategy last.
|
|
851
|
+
const routeValue = route => `${route.strategy ? `${route.strategy} · ` : ''}${route.family}: ${route.style}`;
|
|
852
|
+
const routeLines = route => [`${route.family}: ${route.style}`, route.strategy ?? ''].filter(line => line !== '');
|
|
853
|
+
|
|
854
|
+
// The width available to content: the header row spans the panel inside
|
|
855
|
+
// its border and padding. Layout reports it during a render pass, so the
|
|
856
|
+
// signal is updated afterwards rather than rebuilding rows mid-pass.
|
|
857
|
+
const [contentWidth, setContentWidth] = createSignal(ASSUMED_CONTENT_WIDTH);
|
|
858
|
+
let headerRow;
|
|
859
|
+
const measureContentWidth = () => {
|
|
860
|
+
const width = headerRow?.width;
|
|
861
|
+
if (typeof width !== 'number' || width <= 0) return;
|
|
862
|
+
queueMicrotask(() => {
|
|
863
|
+
if (width !== contentWidth()) setContentWidth(width);
|
|
864
|
+
});
|
|
865
|
+
};
|
|
866
|
+
|
|
717
867
|
// Header badge: ▼/▶ {label}. The fleet shows the version string on the
|
|
718
868
|
// right when no degraded state is present; the antigravity adapter keeps
|
|
719
869
|
// that right-alignment and surfaces `degraded` as a "LIMITED" badge
|
|
@@ -723,36 +873,40 @@ export function SidebarPanel(props) {
|
|
|
723
873
|
return !hasData() ? name : collapsed() ? `\u25b6 ${name}` : `\u25bc ${name}`;
|
|
724
874
|
};
|
|
725
875
|
return (() => {
|
|
726
|
-
var _el$
|
|
727
|
-
_el$27 = _$createElement("box"),
|
|
876
|
+
var _el$27 = _$createElement("box"),
|
|
728
877
|
_el$28 = _$createElement("box"),
|
|
729
|
-
_el$29 = _$createElement("
|
|
730
|
-
_el$30 = _$createElement("
|
|
731
|
-
|
|
732
|
-
_$setProp(_el$26, "width", '100%');
|
|
733
|
-
_$setProp(_el$26, "flexDirection", 'column');
|
|
734
|
-
_$setProp(_el$26, "border", SINGLE_BORDER);
|
|
735
|
-
_$setProp(_el$26, "paddingTop", 1);
|
|
736
|
-
_$setProp(_el$26, "paddingBottom", 1);
|
|
737
|
-
_$setProp(_el$26, "paddingLeft", 1);
|
|
738
|
-
_$setProp(_el$26, "paddingRight", 1);
|
|
878
|
+
_el$29 = _$createElement("box"),
|
|
879
|
+
_el$30 = _$createElement("text"),
|
|
880
|
+
_el$31 = _$createElement("b");
|
|
739
881
|
_$insertNode(_el$27, _el$28);
|
|
740
882
|
_$setProp(_el$27, "width", '100%');
|
|
741
|
-
_$setProp(_el$27, "flexDirection", '
|
|
742
|
-
_$setProp(_el$27, "
|
|
743
|
-
_$setProp(_el$27, "
|
|
744
|
-
_$setProp(_el$27, "
|
|
883
|
+
_$setProp(_el$27, "flexDirection", 'column');
|
|
884
|
+
_$setProp(_el$27, "border", SINGLE_BORDER);
|
|
885
|
+
_$setProp(_el$27, "paddingTop", 1);
|
|
886
|
+
_$setProp(_el$27, "paddingBottom", 1);
|
|
887
|
+
_$setProp(_el$27, "paddingLeft", 1);
|
|
888
|
+
_$setProp(_el$27, "paddingRight", 1);
|
|
889
|
+
_$insertNode(_el$28, _el$29);
|
|
890
|
+
_$use(element => {
|
|
891
|
+
headerRow = element;
|
|
892
|
+
}, _el$28);
|
|
893
|
+
_$setProp(_el$28, "onSizeChange", measureContentWidth);
|
|
894
|
+
_$setProp(_el$28, "width", '100%');
|
|
895
|
+
_$setProp(_el$28, "flexDirection", 'row');
|
|
896
|
+
_$setProp(_el$28, "justifyContent", 'space-between');
|
|
897
|
+
_$setProp(_el$28, "alignItems", 'center');
|
|
898
|
+
_$setProp(_el$28, "onMouseDown", () => {
|
|
745
899
|
// Mirror the fleet guard: only toggle when there is data to expand
|
|
746
900
|
// into. Without this a click on the empty-awaiting header would just
|
|
747
901
|
// toggle the affordance for nothing.
|
|
748
902
|
if (hasData()) controller.toggleCollapsed();
|
|
749
903
|
});
|
|
750
|
-
_$insertNode(_el$28, _el$29);
|
|
751
|
-
_$setProp(_el$28, "paddingLeft", 1);
|
|
752
|
-
_$setProp(_el$28, "paddingRight", 1);
|
|
753
904
|
_$insertNode(_el$29, _el$30);
|
|
754
|
-
_$
|
|
755
|
-
_$
|
|
905
|
+
_$setProp(_el$29, "paddingLeft", 1);
|
|
906
|
+
_$setProp(_el$29, "paddingRight", 1);
|
|
907
|
+
_$insertNode(_el$30, _el$31);
|
|
908
|
+
_$insert(_el$31, headerLabel);
|
|
909
|
+
_$insert(_el$28, _$createComponent(Show, {
|
|
756
910
|
get when() {
|
|
757
911
|
return degraded();
|
|
758
912
|
},
|
|
@@ -762,59 +916,42 @@ export function SidebarPanel(props) {
|
|
|
762
916
|
return prefs().header.showVersion && PLUGIN_VERSION !== '';
|
|
763
917
|
},
|
|
764
918
|
get children() {
|
|
765
|
-
var _el$
|
|
766
|
-
_$insert(_el$
|
|
767
|
-
_$effect(_$p => _$setProp(_el$
|
|
768
|
-
return _el$
|
|
919
|
+
var _el$36 = _$createElement("text");
|
|
920
|
+
_$insert(_el$36, `v${PLUGIN_VERSION}`);
|
|
921
|
+
_$effect(_$p => _$setProp(_el$36, "fg", theme().textMuted, _$p));
|
|
922
|
+
return _el$36;
|
|
769
923
|
}
|
|
770
924
|
});
|
|
771
925
|
},
|
|
772
926
|
get children() {
|
|
773
|
-
var _el$
|
|
774
|
-
_el$
|
|
775
|
-
_el$
|
|
776
|
-
_$insertNode(_el$31, _el$32);
|
|
777
|
-
_$setProp(_el$31, "paddingLeft", 1);
|
|
778
|
-
_$setProp(_el$31, "paddingRight", 1);
|
|
927
|
+
var _el$32 = _$createElement("box"),
|
|
928
|
+
_el$33 = _$createElement("text"),
|
|
929
|
+
_el$34 = _$createElement("b");
|
|
779
930
|
_$insertNode(_el$32, _el$33);
|
|
780
|
-
_$
|
|
931
|
+
_$setProp(_el$32, "paddingLeft", 1);
|
|
932
|
+
_$setProp(_el$32, "paddingRight", 1);
|
|
933
|
+
_$insertNode(_el$33, _el$34);
|
|
934
|
+
_$insertNode(_el$34, _$createTextNode(`LIMITED`));
|
|
781
935
|
_$effect(_p$ => {
|
|
782
|
-
var _v$
|
|
783
|
-
_v$
|
|
784
|
-
_v$
|
|
785
|
-
_v$
|
|
936
|
+
var _v$6 = theme().warning,
|
|
937
|
+
_v$7 = theme().background;
|
|
938
|
+
_v$6 !== _p$.e && (_p$.e = _$setProp(_el$32, "backgroundColor", _v$6, _p$.e));
|
|
939
|
+
_v$7 !== _p$.t && (_p$.t = _$setProp(_el$33, "fg", _v$7, _p$.t));
|
|
786
940
|
return _p$;
|
|
787
941
|
}, {
|
|
788
942
|
e: undefined,
|
|
789
943
|
t: undefined
|
|
790
944
|
});
|
|
791
|
-
return _el$
|
|
945
|
+
return _el$32;
|
|
792
946
|
}
|
|
793
947
|
}), null);
|
|
794
|
-
_$insert(_el$
|
|
948
|
+
_$insert(_el$27, _$createComponent(Show, {
|
|
795
949
|
get when() {
|
|
796
950
|
return _$memo(() => !!collapsed())() && hasData();
|
|
797
951
|
},
|
|
798
952
|
get children() {
|
|
799
953
|
return (() => {
|
|
800
954
|
const account = () => visibleAccounts().find(entry => entry.current) ?? visibleAccounts()[0];
|
|
801
|
-
const remaining = () => {
|
|
802
|
-
const q = account()?.quota;
|
|
803
|
-
// The lowest remaining percentage among dated readings determines the warning tone.
|
|
804
|
-
const gemini = quotaReadingParts('Gm', q?.gemini, now()).remaining;
|
|
805
|
-
const nonGemini = quotaReadingParts('NG', q?.['non-gemini'], now()).remaining;
|
|
806
|
-
if (gemini === null && nonGemini === null) return null;
|
|
807
|
-
return Math.min(gemini ?? 100, nonGemini ?? 100);
|
|
808
|
-
};
|
|
809
|
-
const poolText = key => {
|
|
810
|
-
const entry = account()?.quota[key];
|
|
811
|
-
if (!entry) return `${QUOTA_LABELS[key]}: ${formatQuotaReading(QUOTA_LABELS[key], undefined, now())}`;
|
|
812
|
-
// Show binding window when available, else just pool label.
|
|
813
|
-
const bindingWindow = entry.windows?.reduce((best, w) => best === null || w.remainingPercent < best.remainingPercent ? w : best, null);
|
|
814
|
-
const gutter = bindingWindow ? ` ${WINDOW_GUTTER[bindingWindow.window] ?? bindingWindow.window}` : '';
|
|
815
|
-
const text = formatQuotaReading(`${QUOTA_LABELS[key]}${gutter}`, bindingWindow ?? entry, now());
|
|
816
|
-
return bindingWindow ? `${QUOTA_LABELS[key]} ${text}` : text;
|
|
817
|
-
};
|
|
818
955
|
const unavailable = () => {
|
|
819
956
|
const selected = account();
|
|
820
957
|
return selected != null && (!selected.enabled || selected.cooldownUntil != null && selected.cooldownUntil > now());
|
|
@@ -823,43 +960,63 @@ export function SidebarPanel(props) {
|
|
|
823
960
|
get when() {
|
|
824
961
|
return account();
|
|
825
962
|
},
|
|
826
|
-
children: selected =>
|
|
827
|
-
|
|
828
|
-
|
|
829
|
-
|
|
830
|
-
|
|
831
|
-
|
|
832
|
-
|
|
833
|
-
|
|
834
|
-
|
|
835
|
-
|
|
836
|
-
|
|
837
|
-
|
|
838
|
-
|
|
839
|
-
|
|
840
|
-
|
|
841
|
-
|
|
842
|
-
|
|
843
|
-
|
|
844
|
-
|
|
845
|
-
|
|
846
|
-
|
|
847
|
-
|
|
848
|
-
|
|
849
|
-
|
|
850
|
-
|
|
851
|
-
|
|
852
|
-
|
|
853
|
-
|
|
854
|
-
|
|
855
|
-
|
|
856
|
-
|
|
857
|
-
|
|
963
|
+
children: selected => {
|
|
964
|
+
const quota = () => collapsedQuota(selected(), now());
|
|
965
|
+
const tone = () => {
|
|
966
|
+
const remaining = quota().remaining;
|
|
967
|
+
return remaining == null ? 'muted' : quotaTone(100 - remaining, prefs().appearance);
|
|
968
|
+
};
|
|
969
|
+
// Label, one space, the figure and the two-cell dot. The
|
|
970
|
+
// group prefix goes first when narrow; then the label is cut.
|
|
971
|
+
const figure = () => {
|
|
972
|
+
const {
|
|
973
|
+
prefix,
|
|
974
|
+
text
|
|
975
|
+
} = quota();
|
|
976
|
+
const full = `${prefix}${text}`;
|
|
977
|
+
return selected().label.length + 1 + full.length + 2 <= contentWidth() ? full : text;
|
|
978
|
+
};
|
|
979
|
+
const label = () => fitLabel(selected().label, contentWidth() - 1 - figure().length - 2);
|
|
980
|
+
return _$createComponent(CollapsedRow, {
|
|
981
|
+
theme: theme,
|
|
982
|
+
get label() {
|
|
983
|
+
return label();
|
|
984
|
+
},
|
|
985
|
+
get children() {
|
|
986
|
+
var _el$37 = _$createElement("box"),
|
|
987
|
+
_el$38 = _$createElement("text"),
|
|
988
|
+
_el$39 = _$createElement("b"),
|
|
989
|
+
_el$40 = _$createElement("text");
|
|
990
|
+
_$insertNode(_el$37, _el$38);
|
|
991
|
+
_$insertNode(_el$37, _el$40);
|
|
992
|
+
_$setProp(_el$37, "flexDirection", 'row');
|
|
993
|
+
_$setProp(_el$37, "flexShrink", 0);
|
|
994
|
+
_$insertNode(_el$38, _el$39);
|
|
995
|
+
_$setProp(_el$38, "flexShrink", 0);
|
|
996
|
+
_$setProp(_el$38, "wrapMode", 'none');
|
|
997
|
+
_$insert(_el$39, figure);
|
|
998
|
+
_$setProp(_el$40, "flexShrink", 0);
|
|
999
|
+
_$setProp(_el$40, "wrapMode", 'none');
|
|
1000
|
+
_$insert(_el$40, () => unavailable() ? ' ⊘' : ' ●');
|
|
1001
|
+
_$effect(_p$ => {
|
|
1002
|
+
var _v$1 = toneColor(theme(), tone()),
|
|
1003
|
+
_v$10 = toneColor(theme(), unavailable() ? 'err' : tone());
|
|
1004
|
+
_v$1 !== _p$.e && (_p$.e = _$setProp(_el$38, "fg", _v$1, _p$.e));
|
|
1005
|
+
_v$10 !== _p$.t && (_p$.t = _$setProp(_el$40, "fg", _v$10, _p$.t));
|
|
1006
|
+
return _p$;
|
|
1007
|
+
}, {
|
|
1008
|
+
e: undefined,
|
|
1009
|
+
t: undefined
|
|
1010
|
+
});
|
|
1011
|
+
return _el$37;
|
|
1012
|
+
}
|
|
1013
|
+
});
|
|
1014
|
+
}
|
|
858
1015
|
});
|
|
859
1016
|
})();
|
|
860
1017
|
}
|
|
861
1018
|
}), null);
|
|
862
|
-
_$insert(_el$
|
|
1019
|
+
_$insert(_el$27, _$createComponent(Show, {
|
|
863
1020
|
get when() {
|
|
864
1021
|
return !collapsed() || !hasData();
|
|
865
1022
|
},
|
|
@@ -870,14 +1027,14 @@ export function SidebarPanel(props) {
|
|
|
870
1027
|
},
|
|
871
1028
|
get fallback() {
|
|
872
1029
|
return (() => {
|
|
873
|
-
var _el$
|
|
874
|
-
_el$
|
|
875
|
-
_$insertNode(_el$
|
|
876
|
-
_$setProp(_el$
|
|
877
|
-
_$setProp(_el$
|
|
878
|
-
_$insertNode(_el$
|
|
879
|
-
_$effect(_$p => _$setProp(_el$
|
|
880
|
-
return _el$
|
|
1030
|
+
var _el$41 = _$createElement("box"),
|
|
1031
|
+
_el$42 = _$createElement("text");
|
|
1032
|
+
_$insertNode(_el$41, _el$42);
|
|
1033
|
+
_$setProp(_el$41, "marginTop", 1);
|
|
1034
|
+
_$setProp(_el$41, "width", '100%');
|
|
1035
|
+
_$insertNode(_el$42, _$createTextNode(`Waiting for quota…`));
|
|
1036
|
+
_$effect(_$p => _$setProp(_el$42, "fg", theme().textMuted, _$p));
|
|
1037
|
+
return _el$41;
|
|
881
1038
|
})();
|
|
882
1039
|
},
|
|
883
1040
|
get children() {
|
|
@@ -900,6 +1057,7 @@ export function SidebarPanel(props) {
|
|
|
900
1057
|
},
|
|
901
1058
|
account: account,
|
|
902
1059
|
now: now,
|
|
1060
|
+
width: contentWidth,
|
|
903
1061
|
get marginTop() {
|
|
904
1062
|
return index() === 0 ? 0 : 1;
|
|
905
1063
|
}
|
|
@@ -919,20 +1077,44 @@ export function SidebarPanel(props) {
|
|
|
919
1077
|
return currentRoute();
|
|
920
1078
|
},
|
|
921
1079
|
get fallback() {
|
|
922
|
-
return
|
|
923
|
-
|
|
924
|
-
|
|
925
|
-
|
|
926
|
-
|
|
927
|
-
|
|
1080
|
+
return (() => {
|
|
1081
|
+
var _el$44 = _$createElement("text");
|
|
1082
|
+
_$insertNode(_el$44, _$createTextNode(`No request yet`));
|
|
1083
|
+
_$setProp(_el$44, "wrapMode", 'none');
|
|
1084
|
+
_$effect(_$p => _$setProp(_el$44, "fg", theme().textMuted, _$p));
|
|
1085
|
+
return _el$44;
|
|
1086
|
+
})();
|
|
928
1087
|
},
|
|
929
|
-
children: route => _$createComponent(
|
|
930
|
-
|
|
931
|
-
|
|
932
|
-
get value() {
|
|
933
|
-
return `${route().strategy ? `${route().strategy} · ` : ''}${route().family}: ${route().style}`;
|
|
1088
|
+
children: route => _$createComponent(Show, {
|
|
1089
|
+
get when() {
|
|
1090
|
+
return 'Route'.length + 1 + routeValue(route()).length <= contentWidth();
|
|
934
1091
|
},
|
|
935
|
-
|
|
1092
|
+
get fallback() {
|
|
1093
|
+
return _$createComponent(For, {
|
|
1094
|
+
get each() {
|
|
1095
|
+
return routeLines(route());
|
|
1096
|
+
},
|
|
1097
|
+
children: line => (() => {
|
|
1098
|
+
var _el$46 = _$createElement("text"),
|
|
1099
|
+
_el$47 = _$createElement("b");
|
|
1100
|
+
_$insertNode(_el$46, _el$47);
|
|
1101
|
+
_$setProp(_el$46, "wrapMode", 'none');
|
|
1102
|
+
_$insert(_el$47, line);
|
|
1103
|
+
_$effect(_$p => _$setProp(_el$46, "fg", toneColor(theme(), 'accent'), _$p));
|
|
1104
|
+
return _el$46;
|
|
1105
|
+
})()
|
|
1106
|
+
});
|
|
1107
|
+
},
|
|
1108
|
+
get children() {
|
|
1109
|
+
return _$createComponent(StatRow, {
|
|
1110
|
+
theme: theme,
|
|
1111
|
+
label: "Route",
|
|
1112
|
+
get value() {
|
|
1113
|
+
return routeValue(route());
|
|
1114
|
+
},
|
|
1115
|
+
tone: "accent"
|
|
1116
|
+
});
|
|
1117
|
+
}
|
|
936
1118
|
})
|
|
937
1119
|
})];
|
|
938
1120
|
}
|
|
@@ -980,19 +1162,19 @@ export function SidebarPanel(props) {
|
|
|
980
1162
|
}
|
|
981
1163
|
}), null);
|
|
982
1164
|
_$effect(_p$ => {
|
|
983
|
-
var _v$
|
|
984
|
-
_v$
|
|
985
|
-
_v$
|
|
986
|
-
_v$
|
|
987
|
-
_v$
|
|
988
|
-
_v$
|
|
1165
|
+
var _v$8 = theme().borderActive,
|
|
1166
|
+
_v$9 = theme().accent,
|
|
1167
|
+
_v$0 = theme().background;
|
|
1168
|
+
_v$8 !== _p$.e && (_p$.e = _$setProp(_el$27, "borderColor", _v$8, _p$.e));
|
|
1169
|
+
_v$9 !== _p$.t && (_p$.t = _$setProp(_el$29, "backgroundColor", _v$9, _p$.t));
|
|
1170
|
+
_v$0 !== _p$.a && (_p$.a = _$setProp(_el$30, "fg", _v$0, _p$.a));
|
|
989
1171
|
return _p$;
|
|
990
1172
|
}, {
|
|
991
1173
|
e: undefined,
|
|
992
1174
|
t: undefined,
|
|
993
1175
|
a: undefined
|
|
994
1176
|
});
|
|
995
|
-
return _el$
|
|
1177
|
+
return _el$27;
|
|
996
1178
|
})();
|
|
997
1179
|
}
|
|
998
1180
|
|