@slkiser/opencode-quota 5.0.3 → 6.0.0-beta.1
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 +30 -44
- package/dist/agent-tools.d.ts +24 -0
- package/dist/agent-tools.d.ts.map +1 -0
- package/dist/agent-tools.js +578 -0
- package/dist/agent-tools.js.map +1 -0
- package/dist/bin/opencode-quota.d.ts.map +1 -1
- package/dist/bin/opencode-quota.js +1 -32
- package/dist/bin/opencode-quota.js.map +1 -1
- package/dist/core/errors.d.ts +12 -0
- package/dist/core/errors.d.ts.map +1 -0
- package/dist/core/errors.js +141 -0
- package/dist/core/errors.js.map +1 -0
- package/dist/core/pace.d.ts +13 -0
- package/dist/core/pace.d.ts.map +1 -0
- package/dist/core/pace.js +52 -0
- package/dist/core/pace.js.map +1 -0
- package/dist/core/persist.d.ts +44 -0
- package/dist/core/persist.d.ts.map +1 -0
- package/dist/core/persist.js +210 -0
- package/dist/core/persist.js.map +1 -0
- package/dist/core/provider-source.d.ts +40 -0
- package/dist/core/provider-source.d.ts.map +1 -0
- package/dist/core/provider-source.js +210 -0
- package/dist/core/provider-source.js.map +1 -0
- package/dist/core/redact.d.ts +17 -0
- package/dist/core/redact.d.ts.map +1 -0
- package/dist/core/redact.js +217 -0
- package/dist/core/redact.js.map +1 -0
- package/dist/core/rows.d.ts +20 -0
- package/dist/core/rows.d.ts.map +1 -0
- package/dist/core/rows.js +142 -0
- package/dist/core/rows.js.map +1 -0
- package/dist/core/selection.d.ts +15 -0
- package/dist/core/selection.d.ts.map +1 -0
- package/dist/core/selection.js +43 -0
- package/dist/core/selection.js.map +1 -0
- package/dist/core/snapshot-publisher.d.ts +15 -0
- package/dist/core/snapshot-publisher.d.ts.map +1 -0
- package/dist/core/snapshot-publisher.js +57 -0
- package/dist/core/snapshot-publisher.js.map +1 -0
- package/dist/core/store.d.ts +93 -0
- package/dist/core/store.d.ts.map +1 -0
- package/dist/core/store.js +563 -0
- package/dist/core/store.js.map +1 -0
- package/dist/core/types.d.ts +186 -0
- package/dist/core/types.d.ts.map +1 -0
- package/dist/core/types.js +2 -0
- package/dist/core/types.js.map +1 -0
- package/dist/core/usage-ranges.d.ts +46 -0
- package/dist/core/usage-ranges.d.ts.map +1 -0
- package/dist/core/usage-ranges.js +72 -0
- package/dist/core/usage-ranges.js.map +1 -0
- package/dist/core/usage.d.ts +100 -0
- package/dist/core/usage.d.ts.map +1 -0
- package/dist/core/usage.js +373 -0
- package/dist/core/usage.js.map +1 -0
- package/dist/core/validate.d.ts +8 -0
- package/dist/core/validate.d.ts.map +1 -0
- package/dist/core/validate.js +167 -0
- package/dist/core/validate.js.map +1 -0
- package/dist/core/windows.d.ts +24 -0
- package/dist/core/windows.d.ts.map +1 -0
- package/dist/core/windows.js +43 -0
- package/dist/core/windows.js.map +1 -0
- package/dist/index.d.ts +2 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js.map +1 -1
- package/dist/lib/accounting-format.d.ts +2 -52
- package/dist/lib/accounting-format.d.ts.map +1 -1
- package/dist/lib/accounting-format.js +6 -255
- package/dist/lib/accounting-format.js.map +1 -1
- package/dist/lib/alibaba-auth.d.ts +14 -21
- package/dist/lib/alibaba-auth.d.ts.map +1 -1
- package/dist/lib/alibaba-auth.js +36 -149
- package/dist/lib/alibaba-auth.js.map +1 -1
- package/dist/lib/alibaba-coding-plan-local-quota.d.ts +1 -6
- package/dist/lib/alibaba-coding-plan-local-quota.d.ts.map +1 -1
- package/dist/lib/alibaba-coding-plan-local-quota.js +1 -1
- package/dist/lib/alibaba-coding-plan-local-quota.js.map +1 -1
- package/dist/lib/alibaba-token-plan.d.ts +18 -27
- package/dist/lib/alibaba-token-plan.d.ts.map +1 -1
- package/dist/lib/alibaba-token-plan.js +121 -285
- package/dist/lib/alibaba-token-plan.js.map +1 -1
- package/dist/lib/anthropic-auth.d.ts +3 -5
- package/dist/lib/anthropic-auth.d.ts.map +1 -1
- package/dist/lib/anthropic-auth.js +6 -9
- package/dist/lib/anthropic-auth.js.map +1 -1
- package/dist/lib/anthropic.d.ts +12 -37
- package/dist/lib/anthropic.d.ts.map +1 -1
- package/dist/lib/anthropic.js +348 -698
- package/dist/lib/anthropic.js.map +1 -1
- package/dist/lib/api-key-resolver.d.ts +165 -192
- package/dist/lib/api-key-resolver.d.ts.map +1 -1
- package/dist/lib/api-key-resolver.js +208 -234
- package/dist/lib/api-key-resolver.js.map +1 -1
- package/dist/lib/atomic-json.d.ts +4 -1
- package/dist/lib/atomic-json.d.ts.map +1 -1
- package/dist/lib/atomic-json.js +2 -3
- package/dist/lib/atomic-json.js.map +1 -1
- package/dist/lib/calendar-date.d.ts +15 -0
- package/dist/lib/calendar-date.d.ts.map +1 -0
- package/dist/lib/calendar-date.js +21 -0
- package/dist/lib/calendar-date.js.map +1 -0
- package/dist/lib/chutes.d.ts +0 -1
- package/dist/lib/chutes.d.ts.map +1 -1
- package/dist/lib/chutes.js +2 -4
- package/dist/lib/chutes.js.map +1 -1
- package/dist/lib/cli-reports.d.ts +15 -11
- package/dist/lib/cli-reports.d.ts.map +1 -1
- package/dist/lib/cli-reports.js +34 -107
- package/dist/lib/cli-reports.js.map +1 -1
- package/dist/lib/cli-show.d.ts +9 -22
- package/dist/lib/cli-show.d.ts.map +1 -1
- package/dist/lib/cli-show.js +104 -75
- package/dist/lib/cli-show.js.map +1 -1
- package/dist/lib/config-file-utils.d.ts +3 -15
- package/dist/lib/config-file-utils.d.ts.map +1 -1
- package/dist/lib/config-file-utils.js +4 -63
- package/dist/lib/config-file-utils.js.map +1 -1
- package/dist/lib/config-write-target.d.ts +4 -7
- package/dist/lib/config-write-target.d.ts.map +1 -1
- package/dist/lib/config-write-target.js +4 -18
- package/dist/lib/config-write-target.js.map +1 -1
- package/dist/lib/copilot.d.ts +29 -20
- package/dist/lib/copilot.d.ts.map +1 -1
- package/dist/lib/copilot.js +392 -649
- package/dist/lib/copilot.js.map +1 -1
- package/dist/lib/cursor-detection.d.ts +3 -3
- package/dist/lib/cursor-detection.d.ts.map +1 -1
- package/dist/lib/cursor-detection.js +44 -88
- package/dist/lib/cursor-detection.js.map +1 -1
- package/dist/lib/cursor-pricing.d.ts +71 -8
- package/dist/lib/cursor-pricing.d.ts.map +1 -1
- package/dist/lib/cursor-pricing.js +33 -125
- package/dist/lib/cursor-pricing.js.map +1 -1
- package/dist/lib/cursor-usage.d.ts +6 -4
- package/dist/lib/cursor-usage.d.ts.map +1 -1
- package/dist/lib/cursor-usage.js +27 -40
- package/dist/lib/cursor-usage.js.map +1 -1
- package/dist/lib/deepseek.d.ts +9 -17
- package/dist/lib/deepseek.d.ts.map +1 -1
- package/dist/lib/deepseek.js +24 -54
- package/dist/lib/deepseek.js.map +1 -1
- package/dist/lib/display-sanitize.d.ts +0 -8
- package/dist/lib/display-sanitize.d.ts.map +1 -1
- package/dist/lib/display-sanitize.js +0 -139
- package/dist/lib/display-sanitize.js.map +1 -1
- package/dist/lib/entries.d.ts +13 -239
- package/dist/lib/entries.d.ts.map +1 -1
- package/dist/lib/entries.js +1 -46
- package/dist/lib/entries.js.map +1 -1
- package/dist/lib/file-lock.d.ts +23 -0
- package/dist/lib/file-lock.d.ts.map +1 -0
- package/dist/lib/file-lock.js +122 -0
- package/dist/lib/file-lock.js.map +1 -0
- package/dist/lib/format-utils.d.ts +2 -82
- package/dist/lib/format-utils.d.ts.map +1 -1
- package/dist/lib/format-utils.js +2 -191
- package/dist/lib/format-utils.js.map +1 -1
- package/dist/lib/glm-coding-plan.d.ts +6 -5
- package/dist/lib/glm-coding-plan.d.ts.map +1 -1
- package/dist/lib/glm-coding-plan.js +19 -1
- package/dist/lib/glm-coding-plan.js.map +1 -1
- package/dist/lib/google-agy.d.ts +8 -40
- package/dist/lib/google-agy.d.ts.map +1 -1
- package/dist/lib/google-agy.js +88 -519
- package/dist/lib/google-agy.js.map +1 -1
- package/dist/lib/google-companion-credentials.d.ts +9 -40
- package/dist/lib/google-companion-credentials.d.ts.map +1 -1
- package/dist/lib/google-companion-credentials.js +167 -224
- package/dist/lib/google-companion-credentials.js.map +1 -1
- package/dist/lib/google-gemini-cli.d.ts +5 -38
- package/dist/lib/google-gemini-cli.d.ts.map +1 -1
- package/dist/lib/google-gemini-cli.js +71 -442
- package/dist/lib/google-gemini-cli.js.map +1 -1
- package/dist/lib/google-oauth-quota.d.ts +76 -0
- package/dist/lib/google-oauth-quota.d.ts.map +1 -0
- package/dist/lib/google-oauth-quota.js +297 -0
- package/dist/lib/google-oauth-quota.js.map +1 -0
- package/dist/lib/google-token-cache.d.ts +3 -5
- package/dist/lib/google-token-cache.d.ts.map +1 -1
- package/dist/lib/google-token-cache.js +2 -14
- package/dist/lib/google-token-cache.js.map +1 -1
- package/dist/lib/home-dir-display.d.ts.map +1 -1
- package/dist/lib/home-dir-display.js +21 -39
- package/dist/lib/home-dir-display.js.map +1 -1
- package/dist/lib/http.d.ts +4 -1
- package/dist/lib/http.d.ts.map +1 -1
- package/dist/lib/http.js +2 -1
- package/dist/lib/http.js.map +1 -1
- package/dist/lib/json-guards.d.ts +11 -0
- package/dist/lib/json-guards.d.ts.map +1 -0
- package/dist/lib/json-guards.js +25 -0
- package/dist/lib/json-guards.js.map +1 -0
- package/dist/lib/kilo.d.ts +0 -2
- package/dist/lib/kilo.d.ts.map +1 -1
- package/dist/lib/kilo.js +33 -116
- package/dist/lib/kilo.js.map +1 -1
- package/dist/lib/kimi-endpoints.d.ts +2 -2
- package/dist/lib/kimi-endpoints.d.ts.map +1 -1
- package/dist/lib/kimi-endpoints.js +1 -1
- package/dist/lib/kimi-endpoints.js.map +1 -1
- package/dist/lib/kimi.d.ts.map +1 -1
- package/dist/lib/kimi.js +40 -86
- package/dist/lib/kimi.js.map +1 -1
- package/dist/lib/maintainer-announcements.d.ts +4 -17
- package/dist/lib/maintainer-announcements.d.ts.map +1 -1
- package/dist/lib/maintainer-announcements.js +7 -44
- package/dist/lib/maintainer-announcements.js.map +1 -1
- package/dist/lib/maintainer-home-notice.d.ts +19 -0
- package/dist/lib/maintainer-home-notice.d.ts.map +1 -0
- package/dist/lib/maintainer-home-notice.js +92 -0
- package/dist/lib/maintainer-home-notice.js.map +1 -0
- package/dist/lib/mimo-config.d.ts +6 -9
- package/dist/lib/mimo-config.d.ts.map +1 -1
- package/dist/lib/mimo-config.js +43 -74
- package/dist/lib/mimo-config.js.map +1 -1
- package/dist/lib/mimo.d.ts +2 -5
- package/dist/lib/mimo.d.ts.map +1 -1
- package/dist/lib/mimo.js +57 -109
- package/dist/lib/mimo.js.map +1 -1
- package/dist/lib/minimax-endpoints.d.ts +2 -2
- package/dist/lib/minimax-endpoints.d.ts.map +1 -1
- package/dist/lib/minimax-endpoints.js +1 -1
- package/dist/lib/minimax-endpoints.js.map +1 -1
- package/dist/lib/modelsdev-pricing.d.ts +22 -16
- package/dist/lib/modelsdev-pricing.d.ts.map +1 -1
- package/dist/lib/modelsdev-pricing.js +279 -560
- package/dist/lib/modelsdev-pricing.js.map +1 -1
- package/dist/lib/nanogpt.d.ts +6 -6
- package/dist/lib/nanogpt.d.ts.map +1 -1
- package/dist/lib/nanogpt.js +19 -72
- package/dist/lib/nanogpt.js.map +1 -1
- package/dist/lib/ollama-cloud.d.ts +3 -6
- package/dist/lib/ollama-cloud.d.ts.map +1 -1
- package/dist/lib/ollama-cloud.js +26 -37
- package/dist/lib/ollama-cloud.js.map +1 -1
- package/dist/lib/openai.d.ts +18 -29
- package/dist/lib/openai.d.ts.map +1 -1
- package/dist/lib/openai.js +108 -182
- package/dist/lib/openai.js.map +1 -1
- package/dist/lib/opencode-auth-sqlite.d.ts.map +1 -1
- package/dist/lib/opencode-auth-sqlite.js +22 -23
- package/dist/lib/opencode-auth-sqlite.js.map +1 -1
- package/dist/lib/opencode-auth.d.ts +17 -11
- package/dist/lib/opencode-auth.d.ts.map +1 -1
- package/dist/lib/opencode-auth.js +39 -46
- package/dist/lib/opencode-auth.js.map +1 -1
- package/dist/lib/opencode-config-editor.d.ts +3 -34
- package/dist/lib/opencode-config-editor.d.ts.map +1 -1
- package/dist/lib/opencode-config-editor.js +23 -142
- package/dist/lib/opencode-config-editor.js.map +1 -1
- package/dist/lib/opencode-config-providers.d.ts +4 -3
- package/dist/lib/opencode-config-providers.d.ts.map +1 -1
- package/dist/lib/opencode-config-providers.js +7 -11
- package/dist/lib/opencode-config-providers.js.map +1 -1
- package/dist/lib/opencode-config-read.d.ts +2 -1
- package/dist/lib/opencode-config-read.d.ts.map +1 -1
- package/dist/lib/opencode-config-read.js +3 -2
- package/dist/lib/opencode-config-read.js.map +1 -1
- package/dist/lib/opencode-console-auth.d.ts +2 -3
- package/dist/lib/opencode-console-auth.d.ts.map +1 -1
- package/dist/lib/opencode-console-auth.js +2 -2
- package/dist/lib/opencode-console-auth.js.map +1 -1
- package/dist/lib/opencode-go.d.ts.map +1 -1
- package/dist/lib/opencode-go.js +51 -79
- package/dist/lib/opencode-go.js.map +1 -1
- package/dist/lib/opencode-storage.d.ts +18 -3
- package/dist/lib/opencode-storage.d.ts.map +1 -1
- package/dist/lib/opencode-storage.js +134 -2
- package/dist/lib/opencode-storage.js.map +1 -1
- package/dist/lib/opencode-zen.d.ts +15 -12
- package/dist/lib/opencode-zen.d.ts.map +1 -1
- package/dist/lib/opencode-zen.js +139 -147
- package/dist/lib/opencode-zen.js.map +1 -1
- package/dist/lib/openrouter.d.ts.map +1 -1
- package/dist/lib/openrouter.js +1 -13
- package/dist/lib/openrouter.js.map +1 -1
- package/dist/lib/pricing-key.d.ts +48 -0
- package/dist/lib/pricing-key.d.ts.map +1 -0
- package/dist/lib/pricing-key.js +371 -0
- package/dist/lib/pricing-key.js.map +1 -0
- package/dist/lib/provider-metadata.d.ts +16 -20
- package/dist/lib/provider-metadata.d.ts.map +1 -1
- package/dist/lib/provider-metadata.js +69 -69
- package/dist/lib/provider-metadata.js.map +1 -1
- package/dist/lib/provider-model-matching.d.ts +2 -1
- package/dist/lib/provider-model-matching.d.ts.map +1 -1
- package/dist/lib/provider-registration.d.ts +1 -177
- package/dist/lib/provider-registration.d.ts.map +1 -1
- package/dist/lib/provider-registration.js +1 -163
- package/dist/lib/provider-registration.js.map +1 -1
- package/dist/lib/quota-dialog-commands.d.ts +87 -53
- package/dist/lib/quota-dialog-commands.d.ts.map +1 -1
- package/dist/lib/quota-dialog-commands.js +259 -519
- package/dist/lib/quota-dialog-commands.js.map +1 -1
- package/dist/lib/quota-export-types.d.ts +29 -23
- package/dist/lib/quota-export-types.d.ts.map +1 -1
- package/dist/lib/quota-export.d.ts +16 -26
- package/dist/lib/quota-export.d.ts.map +1 -1
- package/dist/lib/quota-export.js +105 -147
- package/dist/lib/quota-export.js.map +1 -1
- package/dist/lib/quota-providers-local.d.ts +12 -8
- package/dist/lib/quota-providers-local.d.ts.map +1 -1
- package/dist/lib/quota-providers-local.js +150 -223
- package/dist/lib/quota-providers-local.js.map +1 -1
- package/dist/lib/quota-providers-remote.d.ts +3 -8
- package/dist/lib/quota-providers-remote.d.ts.map +1 -1
- package/dist/lib/quota-providers-remote.js +309 -449
- package/dist/lib/quota-providers-remote.js.map +1 -1
- package/dist/lib/quota-providers.d.ts +57 -15
- package/dist/lib/quota-providers.d.ts.map +1 -1
- package/dist/lib/quota-providers.js +157 -64
- package/dist/lib/quota-providers.js.map +1 -1
- package/dist/lib/quota-report-message.d.ts +23 -10
- package/dist/lib/quota-report-message.d.ts.map +1 -1
- package/dist/lib/quota-report-message.js +37 -13
- package/dist/lib/quota-report-message.js.map +1 -1
- package/dist/lib/quota-retry-wait.d.ts +14 -6
- package/dist/lib/quota-retry-wait.d.ts.map +1 -1
- package/dist/lib/quota-retry-wait.js +37 -39
- package/dist/lib/quota-retry-wait.js.map +1 -1
- package/dist/lib/quota-status.d.ts +50 -33
- package/dist/lib/quota-status.d.ts.map +1 -1
- package/dist/lib/quota-status.js +1113 -773
- package/dist/lib/quota-status.js.map +1 -1
- package/dist/lib/quota-telemetry.d.ts +7 -14
- package/dist/lib/quota-telemetry.d.ts.map +1 -1
- package/dist/lib/quota-telemetry.js +46 -97
- package/dist/lib/quota-telemetry.js.map +1 -1
- package/dist/lib/report-document.d.ts +5 -65
- package/dist/lib/report-document.d.ts.map +1 -1
- package/dist/lib/report-document.js +14 -167
- package/dist/lib/report-document.js.map +1 -1
- package/dist/lib/resolved-auth-identity.d.ts +1 -2
- package/dist/lib/resolved-auth-identity.d.ts.map +1 -1
- package/dist/lib/resolved-auth-identity.js +0 -4
- package/dist/lib/resolved-auth-identity.js.map +1 -1
- package/dist/lib/session-tokens.d.ts +19 -19
- package/dist/lib/session-tokens.d.ts.map +1 -1
- package/dist/lib/session-tokens.js +58 -44
- package/dist/lib/session-tokens.js.map +1 -1
- package/dist/lib/synthetic.d.ts +0 -1
- package/dist/lib/synthetic.d.ts.map +1 -1
- package/dist/lib/synthetic.js +43 -94
- package/dist/lib/synthetic.js.map +1 -1
- package/dist/lib/token-buckets.d.ts +0 -1
- package/dist/lib/token-buckets.d.ts.map +1 -1
- package/dist/lib/token-buckets.js +0 -3
- package/dist/lib/token-buckets.js.map +1 -1
- package/dist/lib/token-cost.d.ts +2 -1
- package/dist/lib/token-cost.d.ts.map +1 -1
- package/dist/lib/types.d.ts +25 -333
- package/dist/lib/types.d.ts.map +1 -1
- package/dist/lib/types.js +2 -70
- package/dist/lib/types.js.map +1 -1
- package/dist/lib/xai.d.ts +6 -6
- package/dist/lib/xai.d.ts.map +1 -1
- package/dist/lib/xai.js +51 -90
- package/dist/lib/xai.js.map +1 -1
- package/dist/plugin.d.ts +6 -3
- package/dist/plugin.d.ts.map +1 -1
- package/dist/plugin.js +315 -90
- package/dist/plugin.js.map +1 -1
- package/dist/providers/alibaba-coding-plan.d.ts +4 -0
- package/dist/providers/alibaba-coding-plan.d.ts.map +1 -1
- package/dist/providers/alibaba-coding-plan.js +47 -77
- package/dist/providers/alibaba-coding-plan.js.map +1 -1
- package/dist/providers/alibaba-token-plan.d.ts.map +1 -1
- package/dist/providers/alibaba-token-plan.js +34 -46
- package/dist/providers/alibaba-token-plan.js.map +1 -1
- package/dist/providers/anthropic.d.ts +2 -4
- package/dist/providers/anthropic.d.ts.map +1 -1
- package/dist/providers/anthropic.js +80 -162
- package/dist/providers/anthropic.js.map +1 -1
- package/dist/providers/cache-policies.d.ts +0 -2
- package/dist/providers/cache-policies.d.ts.map +1 -1
- package/dist/providers/cache-policies.js +38 -88
- package/dist/providers/cache-policies.js.map +1 -1
- package/dist/providers/chutes.d.ts +0 -3
- package/dist/providers/chutes.d.ts.map +1 -1
- package/dist/providers/chutes.js +16 -28
- package/dist/providers/chutes.js.map +1 -1
- package/dist/providers/contract.d.ts +128 -0
- package/dist/providers/contract.d.ts.map +1 -0
- package/dist/providers/contract.js +101 -0
- package/dist/providers/contract.js.map +1 -0
- package/dist/providers/copilot.d.ts.map +1 -1
- package/dist/providers/copilot.js +171 -175
- package/dist/providers/copilot.js.map +1 -1
- package/dist/providers/cursor.d.ts.map +1 -1
- package/dist/providers/cursor.js +56 -109
- package/dist/providers/cursor.js.map +1 -1
- package/dist/providers/deepseek.d.ts +1 -6
- package/dist/providers/deepseek.d.ts.map +1 -1
- package/dist/providers/deepseek.js +46 -81
- package/dist/providers/deepseek.js.map +1 -1
- package/dist/providers/glm-coding-plan.d.ts +8 -0
- package/dist/providers/glm-coding-plan.d.ts.map +1 -0
- package/dist/providers/glm-coding-plan.js +106 -0
- package/dist/providers/glm-coding-plan.js.map +1 -0
- package/dist/providers/google-agy.d.ts +0 -1
- package/dist/providers/google-agy.d.ts.map +1 -1
- package/dist/providers/google-agy.js +41 -192
- package/dist/providers/google-agy.js.map +1 -1
- package/dist/providers/google-gemini-cli.d.ts.map +1 -1
- package/dist/providers/google-gemini-cli.js +51 -151
- package/dist/providers/google-gemini-cli.js.map +1 -1
- package/dist/providers/google-oauth-provider.d.ts +39 -0
- package/dist/providers/google-oauth-provider.d.ts.map +1 -0
- package/dist/providers/google-oauth-provider.js +161 -0
- package/dist/providers/google-oauth-provider.js.map +1 -0
- package/dist/providers/kilo.d.ts +0 -3
- package/dist/providers/kilo.d.ts.map +1 -1
- package/dist/providers/kilo.js +69 -123
- package/dist/providers/kilo.js.map +1 -1
- package/dist/providers/kimi-code.d.ts +5 -0
- package/dist/providers/kimi-code.d.ts.map +1 -1
- package/dist/providers/kimi-code.js +91 -136
- package/dist/providers/kimi-code.js.map +1 -1
- package/dist/providers/mimo.d.ts.map +1 -1
- package/dist/providers/mimo.js +55 -94
- package/dist/providers/mimo.js.map +1 -1
- package/dist/providers/minimax-coding-plan.d.ts +2 -23
- package/dist/providers/minimax-coding-plan.d.ts.map +1 -1
- package/dist/providers/minimax-coding-plan.js +161 -277
- package/dist/providers/minimax-coding-plan.js.map +1 -1
- package/dist/providers/nanogpt.d.ts +0 -3
- package/dist/providers/nanogpt.d.ts.map +1 -1
- package/dist/providers/nanogpt.js +61 -95
- package/dist/providers/nanogpt.js.map +1 -1
- package/dist/providers/ollama-cloud.d.ts +0 -6
- package/dist/providers/ollama-cloud.d.ts.map +1 -1
- package/dist/providers/ollama-cloud.js +86 -112
- package/dist/providers/ollama-cloud.js.map +1 -1
- package/dist/providers/openai.d.ts.map +1 -1
- package/dist/providers/openai.js +144 -166
- package/dist/providers/openai.js.map +1 -1
- package/dist/providers/opencode-go.d.ts.map +1 -1
- package/dist/providers/opencode-go.js +157 -199
- package/dist/providers/opencode-go.js.map +1 -1
- package/dist/providers/opencode-zen.d.ts.map +1 -1
- package/dist/providers/opencode-zen.js +100 -150
- package/dist/providers/opencode-zen.js.map +1 -1
- package/dist/providers/openrouter.d.ts +0 -3
- package/dist/providers/openrouter.d.ts.map +1 -1
- package/dist/providers/openrouter.js +26 -13
- package/dist/providers/openrouter.js.map +1 -1
- package/dist/providers/quota-providers.d.ts +7 -3
- package/dist/providers/quota-providers.d.ts.map +1 -1
- package/dist/providers/quota-providers.js +111 -217
- package/dist/providers/quota-providers.js.map +1 -1
- package/dist/providers/registry.d.ts.map +1 -1
- package/dist/providers/registry.js +1 -2
- package/dist/providers/registry.js.map +1 -1
- package/dist/providers/result-helpers.d.ts +10 -37
- package/dist/providers/result-helpers.d.ts.map +1 -1
- package/dist/providers/result-helpers.js +23 -56
- package/dist/providers/result-helpers.js.map +1 -1
- package/dist/providers/synthetic.d.ts +0 -3
- package/dist/providers/synthetic.d.ts.map +1 -1
- package/dist/providers/synthetic.js +16 -58
- package/dist/providers/synthetic.js.map +1 -1
- package/dist/providers/xai.d.ts +2 -1
- package/dist/providers/xai.d.ts.map +1 -1
- package/dist/providers/xai.js +49 -71
- package/dist/providers/xai.js.map +1 -1
- package/dist/rpc.d.ts +110 -38
- package/dist/rpc.d.ts.map +1 -1
- package/dist/rpc.js +125 -37
- package/dist/rpc.js.map +1 -1
- package/dist/settings/convert.d.ts +60 -0
- package/dist/settings/convert.d.ts.map +1 -0
- package/dist/settings/convert.js +473 -0
- package/dist/settings/convert.js.map +1 -0
- package/dist/settings/file.d.ts +89 -0
- package/dist/settings/file.d.ts.map +1 -0
- package/dist/settings/file.js +452 -0
- package/dist/settings/file.js.map +1 -0
- package/dist/settings/index.d.ts +10 -0
- package/dist/settings/index.d.ts.map +1 -0
- package/dist/settings/index.js +3 -0
- package/dist/settings/index.js.map +1 -0
- package/dist/settings/schema.d.ts +607 -0
- package/dist/settings/schema.d.ts.map +1 -0
- package/dist/settings/schema.js +479 -0
- package/dist/settings/schema.js.map +1 -0
- package/dist/tui/client.d.ts +86 -0
- package/dist/tui/client.d.ts.map +1 -0
- package/dist/tui/client.js +229 -0
- package/dist/tui/client.js.map +1 -0
- package/dist/tui/display.d.ts +127 -0
- package/dist/tui/display.d.ts.map +1 -0
- package/dist/tui/display.js +474 -0
- package/dist/tui/display.js.map +1 -0
- package/dist/tui/index.d.ts +21 -0
- package/dist/tui/index.d.ts.map +1 -0
- package/dist/tui/index.js +305 -0
- package/dist/tui/server-settings.d.ts +43 -0
- package/dist/tui/server-settings.d.ts.map +1 -0
- package/dist/tui/server-settings.js +233 -0
- package/dist/tui/server-settings.js.map +1 -0
- package/dist/tui/sidebar.d.ts +41 -0
- package/dist/tui/sidebar.d.ts.map +1 -0
- package/dist/tui/sidebar.js +148 -0
- package/dist/tui/status-line.d.ts +14 -0
- package/dist/tui/status-line.d.ts.map +1 -0
- package/dist/tui/status-line.js +225 -0
- package/dist/tui/theme.d.ts +41 -0
- package/dist/tui/theme.d.ts.map +1 -0
- package/dist/tui/theme.js +52 -0
- package/dist/tui/theme.js.map +1 -0
- package/dist/tui/toast-colors.d.ts +37 -0
- package/dist/tui/toast-colors.d.ts.map +1 -0
- package/dist/tui/toast-colors.js +77 -0
- package/dist/tui/toasts.d.ts +59 -0
- package/dist/tui/toasts.d.ts.map +1 -0
- package/dist/tui/toasts.js +148 -0
- package/dist/tui/toasts.js.map +1 -0
- package/dist/tui/window/drag.d.ts +26 -0
- package/dist/tui/window/drag.d.ts.map +1 -0
- package/dist/tui/window/drag.js +80 -0
- package/dist/tui/window/drag.js.map +1 -0
- package/dist/tui/window/limits.d.ts +15 -0
- package/dist/tui/window/limits.d.ts.map +1 -0
- package/dist/tui/window/limits.js +227 -0
- package/dist/tui/window/limits.js.map +1 -0
- package/dist/tui/window/rail.d.ts +21 -0
- package/dist/tui/window/rail.d.ts.map +1 -0
- package/dist/tui/window/rail.js +81 -0
- package/dist/tui/window/settings.d.ts +164 -0
- package/dist/tui/window/settings.d.ts.map +1 -0
- package/dist/tui/window/settings.js +1679 -0
- package/dist/tui/window/shell.d.ts +108 -0
- package/dist/tui/window/shell.d.ts.map +1 -0
- package/dist/tui/window/shell.js +1003 -0
- package/dist/tui/window/usage.d.ts +75 -0
- package/dist/tui/window/usage.d.ts.map +1 -0
- package/dist/tui/window/usage.js +928 -0
- package/dist/tui/window/views.d.ts +61 -0
- package/dist/tui/window/views.d.ts.map +1 -0
- package/dist/tui/window/views.js +242 -0
- package/dist/tui.d.ts +1 -5
- package/dist/tui.js +1 -894
- package/dist/view/columns.d.ts +15 -0
- package/dist/view/columns.d.ts.map +1 -0
- package/dist/view/columns.js +48 -0
- package/dist/view/columns.js.map +1 -0
- package/dist/view/format.d.ts +82 -0
- package/dist/view/format.d.ts.map +1 -0
- package/dist/view/format.js +201 -0
- package/dist/view/format.js.map +1 -0
- package/dist/view/quick-look.d.ts +28 -0
- package/dist/view/quick-look.d.ts.map +1 -0
- package/dist/view/quick-look.js +150 -0
- package/dist/view/quick-look.js.map +1 -0
- package/dist/view/select.d.ts +67 -0
- package/dist/view/select.d.ts.map +1 -0
- package/dist/view/select.js +87 -0
- package/dist/view/select.js.map +1 -0
- package/dist/view/text.d.ts +153 -0
- package/dist/view/text.d.ts.map +1 -0
- package/dist/view/text.js +642 -0
- package/dist/view/text.js.map +1 -0
- package/dist/view/usage.d.ts +86 -0
- package/dist/view/usage.d.ts.map +1 -0
- package/dist/view/usage.js +724 -0
- package/dist/view/usage.js.map +1 -0
- package/package.json +4 -6
- package/dist/lib/chutes-config.d.ts +0 -15
- package/dist/lib/chutes-config.d.ts.map +0 -1
- package/dist/lib/chutes-config.js +0 -28
- package/dist/lib/chutes-config.js.map +0 -1
- package/dist/lib/cli-status.d.ts +0 -8
- package/dist/lib/cli-status.d.ts.map +0 -1
- package/dist/lib/cli-status.js +0 -98
- package/dist/lib/cli-status.js.map +0 -1
- package/dist/lib/command-parsing.d.ts +0 -43
- package/dist/lib/command-parsing.d.ts.map +0 -1
- package/dist/lib/command-parsing.js +0 -103
- package/dist/lib/command-parsing.js.map +0 -1
- package/dist/lib/config.d.ts +0 -63
- package/dist/lib/config.d.ts.map +0 -1
- package/dist/lib/config.js +0 -1092
- package/dist/lib/config.js.map +0 -1
- package/dist/lib/deepseek-auth.d.ts +0 -15
- package/dist/lib/deepseek-auth.d.ts.map +0 -1
- package/dist/lib/deepseek-auth.js +0 -28
- package/dist/lib/deepseek-auth.js.map +0 -1
- package/dist/lib/format.d.ts +0 -25
- package/dist/lib/format.d.ts.map +0 -1
- package/dist/lib/format.js +0 -300
- package/dist/lib/format.js.map +0 -1
- package/dist/lib/google-agy-companion.d.ts +0 -8
- package/dist/lib/google-agy-companion.d.ts.map +0 -1
- package/dist/lib/google-agy-companion.js +0 -64
- package/dist/lib/google-agy-companion.js.map +0 -1
- package/dist/lib/google-gemini-cli-companion.d.ts +0 -8
- package/dist/lib/google-gemini-cli-companion.d.ts.map +0 -1
- package/dist/lib/google-gemini-cli-companion.js +0 -64
- package/dist/lib/google-gemini-cli-companion.js.map +0 -1
- package/dist/lib/grouped-entry-normalization.d.ts +0 -12
- package/dist/lib/grouped-entry-normalization.d.ts.map +0 -1
- package/dist/lib/grouped-entry-normalization.js +0 -124
- package/dist/lib/grouped-entry-normalization.js.map +0 -1
- package/dist/lib/grouped-header-format.d.ts +0 -5
- package/dist/lib/grouped-header-format.d.ts.map +0 -1
- package/dist/lib/grouped-header-format.js +0 -16
- package/dist/lib/grouped-header-format.js.map +0 -1
- package/dist/lib/init-installer.d.ts +0 -123
- package/dist/lib/init-installer.d.ts.map +0 -1
- package/dist/lib/init-installer.js +0 -1111
- package/dist/lib/init-installer.js.map +0 -1
- package/dist/lib/jsonc.d.ts +0 -17
- package/dist/lib/jsonc.d.ts.map +0 -1
- package/dist/lib/jsonc.js +0 -23
- package/dist/lib/jsonc.js.map +0 -1
- package/dist/lib/kilo-config.d.ts +0 -15
- package/dist/lib/kilo-config.d.ts.map +0 -1
- package/dist/lib/kilo-config.js +0 -27
- package/dist/lib/kilo-config.js.map +0 -1
- package/dist/lib/kimi-auth.d.ts +0 -49
- package/dist/lib/kimi-auth.d.ts.map +0 -1
- package/dist/lib/kimi-auth.js +0 -82
- package/dist/lib/kimi-auth.js.map +0 -1
- package/dist/lib/markdown-table.d.ts +0 -51
- package/dist/lib/markdown-table.d.ts.map +0 -1
- package/dist/lib/markdown-table.js +0 -179
- package/dist/lib/markdown-table.js.map +0 -1
- package/dist/lib/minimax-auth.d.ts +0 -62
- package/dist/lib/minimax-auth.d.ts.map +0 -1
- package/dist/lib/minimax-auth.js +0 -206
- package/dist/lib/minimax-auth.js.map +0 -1
- package/dist/lib/nanogpt-config.d.ts +0 -15
- package/dist/lib/nanogpt-config.d.ts.map +0 -1
- package/dist/lib/nanogpt-config.js +0 -31
- package/dist/lib/nanogpt-config.js.map +0 -1
- package/dist/lib/ollama-cloud-config.d.ts +0 -15
- package/dist/lib/ollama-cloud-config.d.ts.map +0 -1
- package/dist/lib/ollama-cloud-config.js +0 -27
- package/dist/lib/ollama-cloud-config.js.map +0 -1
- package/dist/lib/opencode-go-auth.d.ts +0 -16
- package/dist/lib/opencode-go-auth.d.ts.map +0 -1
- package/dist/lib/opencode-go-auth.js +0 -42
- package/dist/lib/opencode-go-auth.js.map +0 -1
- package/dist/lib/opencode-version.d.ts +0 -6
- package/dist/lib/opencode-version.d.ts.map +0 -1
- package/dist/lib/opencode-version.js +0 -26
- package/dist/lib/opencode-version.js.map +0 -1
- package/dist/lib/provider-add-command.d.ts +0 -35
- package/dist/lib/provider-add-command.d.ts.map +0 -1
- package/dist/lib/provider-add-command.js +0 -204
- package/dist/lib/provider-add-command.js.map +0 -1
- package/dist/lib/provider-add-json-v1-questionnaire.d.ts +0 -32
- package/dist/lib/provider-add-json-v1-questionnaire.d.ts.map +0 -1
- package/dist/lib/provider-add-json-v1-questionnaire.js +0 -336
- package/dist/lib/provider-add-json-v1-questionnaire.js.map +0 -1
- package/dist/lib/provider-add.d.ts +0 -21
- package/dist/lib/provider-add.d.ts.map +0 -1
- package/dist/lib/provider-add.js +0 -219
- package/dist/lib/provider-add.js.map +0 -1
- package/dist/lib/quota-accounting-projection.d.ts +0 -9
- package/dist/lib/quota-accounting-projection.d.ts.map +0 -1
- package/dist/lib/quota-accounting-projection.js +0 -254
- package/dist/lib/quota-accounting-projection.js.map +0 -1
- package/dist/lib/quota-columns.d.ts +0 -38
- package/dist/lib/quota-columns.d.ts.map +0 -1
- package/dist/lib/quota-columns.js +0 -129
- package/dist/lib/quota-columns.js.map +0 -1
- package/dist/lib/quota-command-format.d.ts +0 -34
- package/dist/lib/quota-command-format.d.ts.map +0 -1
- package/dist/lib/quota-command-format.js +0 -240
- package/dist/lib/quota-command-format.js.map +0 -1
- package/dist/lib/quota-dialog-command-specs.d.ts +0 -63
- package/dist/lib/quota-dialog-command-specs.d.ts.map +0 -1
- package/dist/lib/quota-dialog-command-specs.js +0 -145
- package/dist/lib/quota-dialog-command-specs.js.map +0 -1
- package/dist/lib/quota-entry-display.d.ts +0 -7
- package/dist/lib/quota-entry-display.d.ts.map +0 -1
- package/dist/lib/quota-entry-display.js +0 -59
- package/dist/lib/quota-entry-display.js.map +0 -1
- package/dist/lib/quota-exhaustion-projection.d.ts +0 -11
- package/dist/lib/quota-exhaustion-projection.d.ts.map +0 -1
- package/dist/lib/quota-exhaustion-projection.js +0 -105
- package/dist/lib/quota-exhaustion-projection.js.map +0 -1
- package/dist/lib/quota-format-style.d.ts +0 -21
- package/dist/lib/quota-format-style.d.ts.map +0 -1
- package/dist/lib/quota-format-style.js +0 -38
- package/dist/lib/quota-format-style.js.map +0 -1
- package/dist/lib/quota-render-data.d.ts +0 -102
- package/dist/lib/quota-render-data.d.ts.map +0 -1
- package/dist/lib/quota-render-data.js +0 -419
- package/dist/lib/quota-render-data.js.map +0 -1
- package/dist/lib/quota-reset-notifications.d.ts +0 -20
- package/dist/lib/quota-reset-notifications.d.ts.map +0 -1
- package/dist/lib/quota-reset-notifications.js +0 -331
- package/dist/lib/quota-reset-notifications.js.map +0 -1
- package/dist/lib/quota-runtime-context.d.ts +0 -54
- package/dist/lib/quota-runtime-context.d.ts.map +0 -1
- package/dist/lib/quota-runtime-context.js +0 -110
- package/dist/lib/quota-runtime-context.js.map +0 -1
- package/dist/lib/quota-state-codec.d.ts +0 -16
- package/dist/lib/quota-state-codec.d.ts.map +0 -1
- package/dist/lib/quota-state-codec.js +0 -412
- package/dist/lib/quota-state-codec.js.map +0 -1
- package/dist/lib/quota-state.d.ts +0 -28
- package/dist/lib/quota-state.d.ts.map +0 -1
- package/dist/lib/quota-state.js +0 -473
- package/dist/lib/quota-state.js.map +0 -1
- package/dist/lib/quota-stats-format.d.ts +0 -29
- package/dist/lib/quota-stats-format.d.ts.map +0 -1
- package/dist/lib/quota-stats-format.js +0 -459
- package/dist/lib/quota-stats-format.js.map +0 -1
- package/dist/lib/quota-stats.d.ts +0 -126
- package/dist/lib/quota-stats.d.ts.map +0 -1
- package/dist/lib/quota-stats.js +0 -695
- package/dist/lib/quota-stats.js.map +0 -1
- package/dist/lib/quota-surface-data.d.ts +0 -21
- package/dist/lib/quota-surface-data.d.ts.map +0 -1
- package/dist/lib/quota-surface-data.js +0 -362
- package/dist/lib/quota-surface-data.js.map +0 -1
- package/dist/lib/scoped-update-migration.d.ts +0 -103
- package/dist/lib/scoped-update-migration.d.ts.map +0 -1
- package/dist/lib/scoped-update-migration.js +0 -344
- package/dist/lib/scoped-update-migration.js.map +0 -1
- package/dist/lib/scoped-update.d.ts +0 -77
- package/dist/lib/scoped-update.d.ts.map +0 -1
- package/dist/lib/scoped-update.js +0 -590
- package/dist/lib/scoped-update.js.map +0 -1
- package/dist/lib/session-tokens-format.d.ts +0 -36
- package/dist/lib/session-tokens-format.d.ts.map +0 -1
- package/dist/lib/session-tokens-format.js +0 -111
- package/dist/lib/session-tokens-format.js.map +0 -1
- package/dist/lib/synthetic-config.d.ts +0 -15
- package/dist/lib/synthetic-config.d.ts.map +0 -1
- package/dist/lib/synthetic-config.js +0 -28
- package/dist/lib/synthetic-config.js.map +0 -1
- package/dist/lib/toast-format-grouped.d.ts +0 -25
- package/dist/lib/toast-format-grouped.d.ts.map +0 -1
- package/dist/lib/toast-format-grouped.js +0 -296
- package/dist/lib/toast-format-grouped.js.map +0 -1
- package/dist/lib/tui-compact-format.d.ts +0 -10
- package/dist/lib/tui-compact-format.d.ts.map +0 -1
- package/dist/lib/tui-compact-format.js +0 -460
- package/dist/lib/tui-compact-format.js.map +0 -1
- package/dist/lib/tui-panel-state.d.ts +0 -15
- package/dist/lib/tui-panel-state.d.ts.map +0 -1
- package/dist/lib/tui-panel-state.js +0 -2
- package/dist/lib/tui-panel-state.js.map +0 -1
- package/dist/lib/tui-prompt-bar-format.d.ts +0 -25
- package/dist/lib/tui-prompt-bar-format.d.ts.map +0 -1
- package/dist/lib/tui-prompt-bar-format.js +0 -206
- package/dist/lib/tui-prompt-bar-format.js.map +0 -1
- package/dist/lib/tui-sidebar-format.d.ts +0 -13
- package/dist/lib/tui-sidebar-format.d.ts.map +0 -1
- package/dist/lib/tui-sidebar-format.js +0 -34
- package/dist/lib/tui-sidebar-format.js.map +0 -1
- package/dist/lib/zai-auth.d.ts +0 -15
- package/dist/lib/zai-auth.d.ts.map +0 -1
- package/dist/lib/zai-auth.js +0 -37
- package/dist/lib/zai-auth.js.map +0 -1
- package/dist/lib/zai.d.ts +0 -5
- package/dist/lib/zai.d.ts.map +0 -1
- package/dist/lib/zai.js +0 -14
- package/dist/lib/zai.js.map +0 -1
- package/dist/lib/zhipu-auth.d.ts +0 -15
- package/dist/lib/zhipu-auth.d.ts.map +0 -1
- package/dist/lib/zhipu-auth.js +0 -42
- package/dist/lib/zhipu-auth.js.map +0 -1
- package/dist/lib/zhipu.d.ts +0 -5
- package/dist/lib/zhipu.d.ts.map +0 -1
- package/dist/lib/zhipu.js +0 -13
- package/dist/lib/zhipu.js.map +0 -1
- package/dist/providers/glm-coding-plan-provider.d.ts +0 -56
- package/dist/providers/glm-coding-plan-provider.d.ts.map +0 -1
- package/dist/providers/glm-coding-plan-provider.js +0 -115
- package/dist/providers/glm-coding-plan-provider.js.map +0 -1
- package/dist/providers/google-account-format.d.ts +0 -7
- package/dist/providers/google-account-format.d.ts.map +0 -1
- package/dist/providers/google-account-format.js +0 -52
- package/dist/providers/google-account-format.js.map +0 -1
- package/dist/providers/zai.d.ts +0 -2
- package/dist/providers/zai.d.ts.map +0 -1
- package/dist/providers/zai.js +0 -24
- package/dist/providers/zai.js.map +0 -1
- package/dist/providers/zhipu.d.ts +0 -2
- package/dist/providers/zhipu.d.ts.map +0 -1
- package/dist/providers/zhipu.js +0 -21
- package/dist/providers/zhipu.js.map +0 -1
- package/dist/tui-v2.d.ts +0 -5
- package/dist/tui-v2.d.ts.map +0 -1
- package/dist/tui-v2.jsx +0 -624
- package/dist/tui-v2.jsx.map +0 -1
- package/dist/tui.d.ts.map +0 -1
|
@@ -0,0 +1,1003 @@
|
|
|
1
|
+
import { use as _$use } from "@opentui/solid";
|
|
2
|
+
import { createComponent as _$createComponent } from "@opentui/solid";
|
|
3
|
+
import { memo as _$memo } from "@opentui/solid";
|
|
4
|
+
import { effect as _$effect } from "@opentui/solid";
|
|
5
|
+
import { createTextNode as _$createTextNode } from "@opentui/solid";
|
|
6
|
+
import { insertNode as _$insertNode } from "@opentui/solid";
|
|
7
|
+
import { insert as _$insert } from "@opentui/solid";
|
|
8
|
+
import { setProp as _$setProp } from "@opentui/solid";
|
|
9
|
+
import { createElement as _$createElement } from "@opentui/solid";
|
|
10
|
+
/** @jsxImportSource @opentui/solid */
|
|
11
|
+
/**
|
|
12
|
+
* The quota window. `/quota`, `/quota_usage`, `/quota_status` and `/quota_settings` open it
|
|
13
|
+
* above the message box of a session, where it covers the chat
|
|
14
|
+
* with the same size on every tab: Usage, Limits, Plugin and the Settings tabs Layout, Colors
|
|
15
|
+
* and Providers (`settings.tsx`); Layout has pages, All places and one per place. The tab bar is
|
|
16
|
+
* one line: the window's title and the plugin's version, the tabs, and "esc" at its right end to
|
|
17
|
+
* close the window. When its tabs don't fit, it drops the "Settings" label, then shows the tabs
|
|
18
|
+
* around the current one between ‹ and ›. Usage keeps its range list and Layout its page list
|
|
19
|
+
* left of the scrolling tab body (`rail.tsx`); a Settings tab's switch and warning sit above
|
|
20
|
+
* that body. The bottom line lists the tab's keys (Usage's as key and label pairs); the Settings
|
|
21
|
+
* tabs have Save and Discard above it. While the window is focused (it is after opening; click
|
|
22
|
+
* it to give it the keyboard again) its keys work: ↑↓ select or scroll,
|
|
23
|
+
* space/enter use a line, ←/→ change it, c on Limits copies its limits as text, tab switches
|
|
24
|
+
* tabs, esc closes. Closing gives the keyboard back to whatever had it before. Plugin shows the
|
|
25
|
+
* maintainer notices, the switches
|
|
26
|
+
* for other tools and the status report, each under its own title.
|
|
27
|
+
*/
|
|
28
|
+
|
|
29
|
+
import { createSignal, onCleanup, onMount, Show } from "solid-js";
|
|
30
|
+
import { DEFAULT_USAGE_RANGE } from "../../core/usage-ranges.js";
|
|
31
|
+
import { sanitizeDisplayText } from "../../lib/display-sanitize.js";
|
|
32
|
+
import { quotaLimitsText } from "../../lib/quota-report-message.js";
|
|
33
|
+
import { getPackageVersion } from "../../lib/version.js";
|
|
34
|
+
import { QuotaRpc } from "../../rpc.js";
|
|
35
|
+
import { columnsOf } from "../../view/columns.js";
|
|
36
|
+
import { errorToast, quotaCallOptions, rpcErrorMessage } from "../client.js";
|
|
37
|
+
import { isSettingsTab, OptionRow, pagesRoom, SETTINGS_GROUPS } from "./settings.js";
|
|
38
|
+
import { Choice, createUsageTab, USAGE_RAIL_WIDTH } from "./usage.js";
|
|
39
|
+
import { LimitsView, NoticesView, StatusView } from "./views.js";
|
|
40
|
+
/** Plugin's switches (`system`), under their group's title; each saves straight away. */
|
|
41
|
+
const SYSTEM_SWITCHES = [{
|
|
42
|
+
key: "system.oldCommands",
|
|
43
|
+
group: "Commands",
|
|
44
|
+
title: "Old command names",
|
|
45
|
+
note: "the 4.x and 5.x /tokens_* names; the / list changes after a restart"
|
|
46
|
+
}, {
|
|
47
|
+
key: "system.exportFile",
|
|
48
|
+
group: "For other tools",
|
|
49
|
+
title: "Quota file (JSON)",
|
|
50
|
+
note: "for status bars and scripts; the opencode-quota CLI works either way"
|
|
51
|
+
}, {
|
|
52
|
+
key: "system.telemetry",
|
|
53
|
+
group: "For other tools",
|
|
54
|
+
title: "OpenTelemetry metrics"
|
|
55
|
+
}];
|
|
56
|
+
/** Columns inside the window until it knows its real width. */
|
|
57
|
+
const DEFAULT_WIDTH = 120;
|
|
58
|
+
|
|
59
|
+
/** A tab of the tab bar and the window tabs it shows: Layout shows one of its pages. */
|
|
60
|
+
|
|
61
|
+
/** The view tabs; the Settings tabs (`SETTINGS_GROUPS`) follow them under their own label. */
|
|
62
|
+
const TABS = [{
|
|
63
|
+
title: "Usage",
|
|
64
|
+
pages: ["usage"]
|
|
65
|
+
}, {
|
|
66
|
+
title: "Limits",
|
|
67
|
+
pages: ["limits"]
|
|
68
|
+
}, {
|
|
69
|
+
title: "Plugin",
|
|
70
|
+
pages: ["system"]
|
|
71
|
+
}];
|
|
72
|
+
/** Every tab in the order the tab bar shows them and tab and shift+tab go through them. */
|
|
73
|
+
const BAR_TABS = [...TABS, ...SETTINGS_GROUPS];
|
|
74
|
+
const WINDOW_TITLE = "OpenCode Quota";
|
|
75
|
+
const SETTINGS_LABEL = "Settings";
|
|
76
|
+
/** Between the tab bar's items. */
|
|
77
|
+
const TAB_GAP = 2;
|
|
78
|
+
/** "‹" or "›" and its gap. */
|
|
79
|
+
const ARROW_WIDTH = 1 + TAB_GAP;
|
|
80
|
+
/** The "esc" that closes the window, at the right end of the tab bar, and the gap before it. */
|
|
81
|
+
const CLOSE_WIDTH = "esc".length + TAB_GAP;
|
|
82
|
+
|
|
83
|
+
/** The tabs the tab bar shows, `first` to `last`, and whether "Settings" labels its group. */
|
|
84
|
+
const HINT_SEPARATOR = " · ";
|
|
85
|
+
|
|
86
|
+
/** The keyboard hint in `width` columns, its lines broken between " · " items, never inside one. */
|
|
87
|
+
export function hintLines(hint, width) {
|
|
88
|
+
const lines = [];
|
|
89
|
+
for (const item of hint.split(HINT_SEPARATOR)) {
|
|
90
|
+
const last = lines.length - 1;
|
|
91
|
+
if (last >= 0 && columnsOf(lines[last] + HINT_SEPARATOR + item) <= width) {
|
|
92
|
+
lines[last] += HINT_SEPARATOR + item;
|
|
93
|
+
} else {
|
|
94
|
+
lines.push(item);
|
|
95
|
+
}
|
|
96
|
+
}
|
|
97
|
+
return lines.join("\n");
|
|
98
|
+
}
|
|
99
|
+
|
|
100
|
+
/** A key and what it does, for a tab's bottom line; without a key, a note such as "updating…". */
|
|
101
|
+
|
|
102
|
+
const KEY_HINT_GAP = " ";
|
|
103
|
+
function keyHintText(hint) {
|
|
104
|
+
return hint.key ? `${hint.key} ${hint.label}` : hint.label;
|
|
105
|
+
}
|
|
106
|
+
|
|
107
|
+
/** The key hints in `width` columns, two spaces apart, lines broken between hints, never inside one. */
|
|
108
|
+
export function keyHintLines(hints, width) {
|
|
109
|
+
const lines = [];
|
|
110
|
+
let lineWidth = 0;
|
|
111
|
+
for (const hint of hints) {
|
|
112
|
+
const hintWidth = columnsOf(keyHintText(hint));
|
|
113
|
+
const last = lines.at(-1);
|
|
114
|
+
if (last && lineWidth + KEY_HINT_GAP.length + hintWidth <= width) {
|
|
115
|
+
last.push(hint);
|
|
116
|
+
lineWidth += KEY_HINT_GAP.length + hintWidth;
|
|
117
|
+
} else {
|
|
118
|
+
lines.push([hint]);
|
|
119
|
+
lineWidth = hintWidth;
|
|
120
|
+
}
|
|
121
|
+
}
|
|
122
|
+
return lines;
|
|
123
|
+
}
|
|
124
|
+
/**
|
|
125
|
+
* What fits in `room` columns after the window's title: every tab under both labels; every tab
|
|
126
|
+
* with a │ before the Settings tabs; or the tabs around `active` between ‹ and ›.
|
|
127
|
+
*/
|
|
128
|
+
export function tabStrip(titles, settingsFrom, active, room) {
|
|
129
|
+
const runWidth = (first, last, label) => {
|
|
130
|
+
let width = 0;
|
|
131
|
+
for (let index = first; index <= last; index += 1) {
|
|
132
|
+
width += titles[index].length + (index > first ? TAB_GAP : 0);
|
|
133
|
+
}
|
|
134
|
+
if (first < settingsFrom && last >= settingsFrom) {
|
|
135
|
+
width += (label ? SETTINGS_LABEL.length : 1) + TAB_GAP;
|
|
136
|
+
}
|
|
137
|
+
return width;
|
|
138
|
+
};
|
|
139
|
+
const end = titles.length - 1;
|
|
140
|
+
if (runWidth(0, end, true) <= room) return {
|
|
141
|
+
first: 0,
|
|
142
|
+
last: end,
|
|
143
|
+
settingsLabel: true
|
|
144
|
+
};
|
|
145
|
+
if (runWidth(0, end, false) <= room) return {
|
|
146
|
+
first: 0,
|
|
147
|
+
last: end,
|
|
148
|
+
settingsLabel: false
|
|
149
|
+
};
|
|
150
|
+
const fits = (first, last) => runWidth(first, last, false) + (first > 0 ? ARROW_WIDTH : 0) + (last < end ? ARROW_WIDTH : 0) <= room;
|
|
151
|
+
let first = active;
|
|
152
|
+
let last = active;
|
|
153
|
+
for (let grew = true; grew;) {
|
|
154
|
+
grew = false;
|
|
155
|
+
if (last < end && fits(first, last + 1)) {
|
|
156
|
+
last += 1;
|
|
157
|
+
grew = true;
|
|
158
|
+
}
|
|
159
|
+
if (first > 0 && fits(first - 1, last)) {
|
|
160
|
+
first -= 1;
|
|
161
|
+
grew = true;
|
|
162
|
+
}
|
|
163
|
+
}
|
|
164
|
+
return {
|
|
165
|
+
first,
|
|
166
|
+
last,
|
|
167
|
+
settingsLabel: false
|
|
168
|
+
};
|
|
169
|
+
}
|
|
170
|
+
|
|
171
|
+
/** The theme tokens the window reads, besides the surfaces' ones (OpenCode's `ResolvedTheme`). */
|
|
172
|
+
|
|
173
|
+
/** Returning false lets the key continue to the next layer. */
|
|
174
|
+
|
|
175
|
+
/** What the window needs from OpenCode's TUI context (its theme and client types aren't installed). */
|
|
176
|
+
|
|
177
|
+
/** The session on screen; undefined on Home. */
|
|
178
|
+
export function routeSessionID(api) {
|
|
179
|
+
const route = api.ui.router.current();
|
|
180
|
+
return route.type === "session" ? route.sessionID : undefined;
|
|
181
|
+
}
|
|
182
|
+
const KEYS = "Quota window";
|
|
183
|
+
export function createQuotaWindow(api, host, settings) {
|
|
184
|
+
const [tab, setTab] = createSignal();
|
|
185
|
+
const [selected, setSelected] = createSignal("");
|
|
186
|
+
/** The page each tab of the tab bar showed last, by its title: Layout goes back to it. */
|
|
187
|
+
const lastPages = new Map();
|
|
188
|
+
const [notices, setNotices] = createSignal({
|
|
189
|
+
state: "loading"
|
|
190
|
+
});
|
|
191
|
+
const [status, setStatus] = createSignal({
|
|
192
|
+
state: "loading"
|
|
193
|
+
});
|
|
194
|
+
let windowBox;
|
|
195
|
+
let scroll;
|
|
196
|
+
/** What had the keyboard before the window opened (the message box), so closing gives it back. */
|
|
197
|
+
let focusBefore = null;
|
|
198
|
+
/**
|
|
199
|
+
* The window had the keyboard and nothing took it on purpose. A resize across the sidebar's
|
|
200
|
+
* breakpoint makes OpenCode give the keyboard to its message box, and OpenCode can draw the
|
|
201
|
+
* window again (a new box); the window then takes the keyboard back.
|
|
202
|
+
*/
|
|
203
|
+
let keyboardWanted = false;
|
|
204
|
+
/** The terminal was resized in this turn of the event loop. */
|
|
205
|
+
let resizedThisTurn = false;
|
|
206
|
+
const onResize = () => {
|
|
207
|
+
resizedThisTurn = true;
|
|
208
|
+
setTimeout(() => {
|
|
209
|
+
resizedThisTurn = false;
|
|
210
|
+
}, 0);
|
|
211
|
+
};
|
|
212
|
+
/** Numbers the notice and status requests; only the newest one's answer shows. */
|
|
213
|
+
let noticeRequest = 0;
|
|
214
|
+
let statusRequest = 0;
|
|
215
|
+
/** Plugin switches whose save is not back yet; another flip of the same one is ignored. */
|
|
216
|
+
const savingSwitches = new Set();
|
|
217
|
+
|
|
218
|
+
// The RPC client is made per call, so nothing reaches OpenCode during plugin setup.
|
|
219
|
+
const rpc = () => api.client.rpc(QuotaRpc);
|
|
220
|
+
const options = () => quotaCallOptions(api);
|
|
221
|
+
const usage = createUsageTab(api, () => scroll);
|
|
222
|
+
const showError = error => api.ui.toast.show(errorToast(error));
|
|
223
|
+
/** The installed plugin's version from its package.json, like "v5.0.2", after the title. */
|
|
224
|
+
const [version, setVersion] = createSignal("");
|
|
225
|
+
void getPackageVersion().then(found => {
|
|
226
|
+
if (found) setVersion(`v${found}`);
|
|
227
|
+
});
|
|
228
|
+
async function loadNotices() {
|
|
229
|
+
const request = ++noticeRequest;
|
|
230
|
+
setNotices({
|
|
231
|
+
state: "loading"
|
|
232
|
+
});
|
|
233
|
+
try {
|
|
234
|
+
const board = await rpc().noticeList({}, options());
|
|
235
|
+
if (request === noticeRequest) setNotices({
|
|
236
|
+
state: "ready",
|
|
237
|
+
board
|
|
238
|
+
});
|
|
239
|
+
} catch (error) {
|
|
240
|
+
if (request !== noticeRequest) return;
|
|
241
|
+
setNotices({
|
|
242
|
+
state: "failed",
|
|
243
|
+
message: sanitizeDisplayText(rpcErrorMessage(error))
|
|
244
|
+
});
|
|
245
|
+
}
|
|
246
|
+
}
|
|
247
|
+
async function flipSwitch(key, on) {
|
|
248
|
+
if (savingSwitches.has(key)) return;
|
|
249
|
+
savingSwitches.add(key);
|
|
250
|
+
try {
|
|
251
|
+
await settings.saveSwitch(key, on);
|
|
252
|
+
} catch (error) {
|
|
253
|
+
showError(error);
|
|
254
|
+
} finally {
|
|
255
|
+
savingSwitches.delete(key);
|
|
256
|
+
}
|
|
257
|
+
}
|
|
258
|
+
async function loadStatus(sessionID) {
|
|
259
|
+
const request = ++statusRequest;
|
|
260
|
+
setStatus({
|
|
261
|
+
state: "loading"
|
|
262
|
+
});
|
|
263
|
+
try {
|
|
264
|
+
const output = await rpc().status(sessionID ? {
|
|
265
|
+
sessionID
|
|
266
|
+
} : {}, options());
|
|
267
|
+
if (request === statusRequest) setStatus({
|
|
268
|
+
state: "ready",
|
|
269
|
+
text: output.text
|
|
270
|
+
});
|
|
271
|
+
} catch (error) {
|
|
272
|
+
if (request !== statusRequest) return;
|
|
273
|
+
setStatus({
|
|
274
|
+
state: "failed",
|
|
275
|
+
message: sanitizeDisplayText(rpcErrorMessage(error))
|
|
276
|
+
});
|
|
277
|
+
}
|
|
278
|
+
}
|
|
279
|
+
|
|
280
|
+
/** The tab bar's tab that shows `shown`. */
|
|
281
|
+
function barTabOf(shown) {
|
|
282
|
+
return BAR_TABS.find(item => shown !== undefined && item.pages.includes(shown));
|
|
283
|
+
}
|
|
284
|
+
|
|
285
|
+
/** The page a tab of the tab bar opens on: the one it showed last, else its first. */
|
|
286
|
+
function pageOf(item) {
|
|
287
|
+
return lastPages.get(item.title) ?? item.pages[0];
|
|
288
|
+
}
|
|
289
|
+
|
|
290
|
+
/**
|
|
291
|
+
* Each tab asks the server again when it shows: Limits a refresh, the others their data. Usage
|
|
292
|
+
* shows `choice`: the default range, unless a command named one.
|
|
293
|
+
*/
|
|
294
|
+
function showTab(next, choice = {
|
|
295
|
+
range: DEFAULT_USAGE_RANGE
|
|
296
|
+
}) {
|
|
297
|
+
const item = barTabOf(next);
|
|
298
|
+
if (item) lastPages.set(item.title, next);
|
|
299
|
+
settings.setTab(next);
|
|
300
|
+
setTab(next);
|
|
301
|
+
// A Settings line may have had the keyboard; it is gone with its tab.
|
|
302
|
+
windowBox?.focus();
|
|
303
|
+
const sessionID = routeSessionID(api);
|
|
304
|
+
if (next === "limits") void host.quota.refresh("manual", sessionID);
|
|
305
|
+
if (next === "system") {
|
|
306
|
+
void loadNotices();
|
|
307
|
+
void loadStatus(sessionID);
|
|
308
|
+
// Snapshots bring the saved settings too, so the switches show even if this read fails.
|
|
309
|
+
settings.loadSaved().catch(() => {});
|
|
310
|
+
}
|
|
311
|
+
if (next === "usage") usage.choose(choice);
|
|
312
|
+
if (next === "usage" && sessionID) usage.show(sessionID);
|
|
313
|
+
// Plugin picks Copy, so enter copies the report as soon as the tab opens.
|
|
314
|
+
setSelected(next === "system" ? "copy" : "");
|
|
315
|
+
scroll?.scrollTo(0);
|
|
316
|
+
}
|
|
317
|
+
|
|
318
|
+
/** Copies `text` and says in a toast titled `title` whether the terminal let it. */
|
|
319
|
+
function copyWithToast(text, title, messages) {
|
|
320
|
+
const copied = api.renderer.copyToClipboardOSC52(text);
|
|
321
|
+
api.ui.toast.show({
|
|
322
|
+
variant: copied ? "success" : "warning",
|
|
323
|
+
title,
|
|
324
|
+
message: copied ? messages.copied : messages.failed,
|
|
325
|
+
duration: 4_000
|
|
326
|
+
});
|
|
327
|
+
}
|
|
328
|
+
function copyReport() {
|
|
329
|
+
const report = status();
|
|
330
|
+
if (report.state !== "ready") return;
|
|
331
|
+
copyWithToast(report.text, "Status report", {
|
|
332
|
+
copied: "Copied. Paste it into a GitHub issue.",
|
|
333
|
+
failed: "This terminal doesn't allow copying; select the text instead."
|
|
334
|
+
});
|
|
335
|
+
}
|
|
336
|
+
|
|
337
|
+
/** c on Limits: every provider's limits as Web and Desktop /quota write them. */
|
|
338
|
+
function copyLimits(sessionID) {
|
|
339
|
+
const snapshot = host.quota.snapshot(sessionID);
|
|
340
|
+
if (!snapshot) {
|
|
341
|
+
api.ui.toast.show({
|
|
342
|
+
variant: "info",
|
|
343
|
+
title: "Limits",
|
|
344
|
+
message: "Quota is still loading.",
|
|
345
|
+
duration: 4_000
|
|
346
|
+
});
|
|
347
|
+
return;
|
|
348
|
+
}
|
|
349
|
+
copyWithToast(quotaLimitsText(snapshot, Date.now()), "Limits", {
|
|
350
|
+
copied: "Copied the limits report",
|
|
351
|
+
failed: "This terminal doesn't allow copying."
|
|
352
|
+
});
|
|
353
|
+
}
|
|
354
|
+
|
|
355
|
+
/**
|
|
356
|
+
* The lines that ↑↓ can select, under the notices: Plugin's switches (‹ on ›)
|
|
357
|
+
* once the saved settings arrived, then Copy (▸) above the status report.
|
|
358
|
+
*/
|
|
359
|
+
function tabOptions() {
|
|
360
|
+
if (tab() !== "system") return [];
|
|
361
|
+
const copy = {
|
|
362
|
+
id: "copy",
|
|
363
|
+
group: "Status report",
|
|
364
|
+
title: "Copy the report",
|
|
365
|
+
value: () => "copy",
|
|
366
|
+
run: copyReport,
|
|
367
|
+
note: () => "then paste it into a GitHub issue"
|
|
368
|
+
};
|
|
369
|
+
const switches = SYSTEM_SWITCHES.flatMap(({
|
|
370
|
+
key,
|
|
371
|
+
group,
|
|
372
|
+
title,
|
|
373
|
+
note
|
|
374
|
+
}, index) => {
|
|
375
|
+
const on = settings.savedSwitch(key);
|
|
376
|
+
if (on === undefined) return [];
|
|
377
|
+
return [{
|
|
378
|
+
id: key,
|
|
379
|
+
...(group !== SYSTEM_SWITCHES[index - 1]?.group ? {
|
|
380
|
+
group
|
|
381
|
+
} : {}),
|
|
382
|
+
title,
|
|
383
|
+
value: () => on ? "on" : "off",
|
|
384
|
+
cycle: () => void flipSwitch(key, !on),
|
|
385
|
+
...(note ? {
|
|
386
|
+
note: () => note
|
|
387
|
+
} : {})
|
|
388
|
+
}];
|
|
389
|
+
});
|
|
390
|
+
return [...switches, copy];
|
|
391
|
+
}
|
|
392
|
+
|
|
393
|
+
/** Opens the window on `next`; on Usage, on `choice` (else the default range). */
|
|
394
|
+
function open(next, choice) {
|
|
395
|
+
if (!routeSessionID(api)) {
|
|
396
|
+
api.ui.toast.show({
|
|
397
|
+
variant: "info",
|
|
398
|
+
title: "OpenCode Quota",
|
|
399
|
+
message: "Open a session first: the quota window opens above its message box."
|
|
400
|
+
});
|
|
401
|
+
return;
|
|
402
|
+
}
|
|
403
|
+
if (tab() === undefined) focusBefore = api.renderer.currentFocusedRenderable;
|
|
404
|
+
showTab(next === "settings" ? pageOf(BAR_TABS[TABS.length]) : next, choice);
|
|
405
|
+
// The command leaves the message box focused; take the keyboard once it has settled.
|
|
406
|
+
setTimeout(() => windowBox?.focus(), 50);
|
|
407
|
+
}
|
|
408
|
+
|
|
409
|
+
/** Esc or Close. With unsaved settings the bottom bar asks first. */
|
|
410
|
+
function close() {
|
|
411
|
+
if (settings.askBeforeClose()) return;
|
|
412
|
+
settings.setTab(undefined);
|
|
413
|
+
setTab(undefined);
|
|
414
|
+
// Answers still on their way belong to the closed window.
|
|
415
|
+
noticeRequest += 1;
|
|
416
|
+
statusRequest += 1;
|
|
417
|
+
keyboardWanted = false;
|
|
418
|
+
if (focusBefore && !focusBefore.isDestroyed) focusBefore.focus();
|
|
419
|
+
focusBefore = null;
|
|
420
|
+
}
|
|
421
|
+
function switchTab(delta) {
|
|
422
|
+
const index = Math.max(0, BAR_TABS.indexOf(barTabOf(tab()) ?? BAR_TABS[0]));
|
|
423
|
+
showTab(pageOf(BAR_TABS[(index + delta + BAR_TABS.length) % BAR_TABS.length]));
|
|
424
|
+
}
|
|
425
|
+
|
|
426
|
+
/** ↑↓ select the next line; past the first or last one (or with none) they scroll. */
|
|
427
|
+
function select(delta) {
|
|
428
|
+
const ids = tabOptions().map(option => option.id);
|
|
429
|
+
const next = ids.indexOf(selected()) + delta;
|
|
430
|
+
if (ids.length === 0 || next < 0 || next >= ids.length) scroll?.scrollBy(delta);else setSelected(ids[next]);
|
|
431
|
+
}
|
|
432
|
+
|
|
433
|
+
/** Space or enter use any line; ←/→ only flip a switch. */
|
|
434
|
+
function useLine(option, anyKind) {
|
|
435
|
+
if (option?.cycle) option.cycle(1);else if (anyKind) option?.run?.();
|
|
436
|
+
}
|
|
437
|
+
const useSelected = anyKind => useLine(tabOptions().find(item => item.id === selected()), anyKind);
|
|
438
|
+
function Window(props) {
|
|
439
|
+
const theme = () => api.theme;
|
|
440
|
+
const [hasKeyboard, setHasKeyboard] = createSignal(false);
|
|
441
|
+
const [width, setWidth] = createSignal(DEFAULT_WIDTH);
|
|
442
|
+
const [nowMs, setNowMs] = createSignal(Date.now());
|
|
443
|
+
// Reset times and the pace count on between snapshots.
|
|
444
|
+
const clock = setInterval(() => setNowMs(Date.now()), 60_000);
|
|
445
|
+
onCleanup(() => clearInterval(clock));
|
|
446
|
+
const stopWatch = host.quota.watch(props.sessionID);
|
|
447
|
+
onCleanup(stopWatch);
|
|
448
|
+
|
|
449
|
+
// The window covers the whole chat, so it has the same size on every tab. OpenCode's
|
|
450
|
+
// session column holds the messages box (its first child holds the messages scrollbox),
|
|
451
|
+
// a one-line "Jump to latest" row, then the box with this slot and the message box. Room =
|
|
452
|
+
// the column minus its 1-line bottom padding, the other rows, and whatever else sits in
|
|
453
|
+
// that last box (the message box, queued prompts).
|
|
454
|
+
const [roomHeight, setRoomHeight] = createSignal();
|
|
455
|
+
function measureRoom() {
|
|
456
|
+
const box = windowBox;
|
|
457
|
+
if (!box || box.isDestroyed) return;
|
|
458
|
+
let child = box;
|
|
459
|
+
for (let parent = box.parent; parent; child = parent, parent = parent.parent) {
|
|
460
|
+
const siblings = parent.getChildren();
|
|
461
|
+
const messages = siblings[0];
|
|
462
|
+
if (messages === child || !messages?.getChildren().some(item => "scrollChildIntoView" in item)) {
|
|
463
|
+
continue;
|
|
464
|
+
}
|
|
465
|
+
const otherRows = siblings.filter(item => item !== child && item !== messages).reduce((total, item) => total + item.height, 0);
|
|
466
|
+
const room = Math.max(12, parent.height - 1 - otherRows - (child.height - box.height));
|
|
467
|
+
if (room !== roomHeight()) queueMicrotask(() => setRoomHeight(room));
|
|
468
|
+
return;
|
|
469
|
+
}
|
|
470
|
+
}
|
|
471
|
+
onMount(() => {
|
|
472
|
+
api.renderer.root.on("layout-changed", measureRoom);
|
|
473
|
+
onCleanup(() => api.renderer.root.off("layout-changed", measureRoom));
|
|
474
|
+
});
|
|
475
|
+
api.renderer.on("resize", onResize);
|
|
476
|
+
onCleanup(() => api.renderer.off("resize", onResize));
|
|
477
|
+
// This window's own boxes: when OpenCode draws the window again, the new one may already
|
|
478
|
+
// have set them before this one is cleaned up.
|
|
479
|
+
let ownBox;
|
|
480
|
+
let ownScroll;
|
|
481
|
+
onCleanup(() => {
|
|
482
|
+
if (windowBox === ownBox) windowBox = undefined;
|
|
483
|
+
if (scroll === ownScroll) scroll = undefined;
|
|
484
|
+
});
|
|
485
|
+
|
|
486
|
+
// Keys work only while this box has the keyboard; the message box keeps its own keys.
|
|
487
|
+
api.keymap.layer(() => ({
|
|
488
|
+
target: () => windowBox,
|
|
489
|
+
priority: 10,
|
|
490
|
+
// While a Settings line takes typed text, the keys go to its input.
|
|
491
|
+
enabled: () => !settings.typing(),
|
|
492
|
+
commands: [{
|
|
493
|
+
bind: "up",
|
|
494
|
+
title: "Previous line",
|
|
495
|
+
group: KEYS,
|
|
496
|
+
run: () => select(-1)
|
|
497
|
+
}, {
|
|
498
|
+
bind: "down",
|
|
499
|
+
title: "Next line",
|
|
500
|
+
group: KEYS,
|
|
501
|
+
run: () => select(1)
|
|
502
|
+
}, {
|
|
503
|
+
bind: "pageup",
|
|
504
|
+
title: "Scroll up one page",
|
|
505
|
+
group: KEYS,
|
|
506
|
+
run: () => scroll?.scrollBy(-(scroll.height || 1))
|
|
507
|
+
}, {
|
|
508
|
+
bind: "pagedown",
|
|
509
|
+
title: "Scroll down one page",
|
|
510
|
+
group: KEYS,
|
|
511
|
+
run: () => scroll?.scrollBy(scroll.height || 1)
|
|
512
|
+
}, {
|
|
513
|
+
bind: "space",
|
|
514
|
+
title: "Use the line",
|
|
515
|
+
group: KEYS,
|
|
516
|
+
run: () => useSelected(true)
|
|
517
|
+
}, {
|
|
518
|
+
bind: "return",
|
|
519
|
+
title: "Use the line",
|
|
520
|
+
group: KEYS,
|
|
521
|
+
run: () => useSelected(true)
|
|
522
|
+
}, {
|
|
523
|
+
bind: "left",
|
|
524
|
+
title: "Change the line",
|
|
525
|
+
group: KEYS,
|
|
526
|
+
run: () => useSelected(false)
|
|
527
|
+
}, {
|
|
528
|
+
bind: "right",
|
|
529
|
+
title: "Change the line",
|
|
530
|
+
group: KEYS,
|
|
531
|
+
run: () => useSelected(false)
|
|
532
|
+
}, {
|
|
533
|
+
bind: "c",
|
|
534
|
+
title: "Copy the limits report",
|
|
535
|
+
group: KEYS,
|
|
536
|
+
run: () => tab() === "limits" ? copyLimits(props.sessionID) : false
|
|
537
|
+
}, {
|
|
538
|
+
bind: "tab",
|
|
539
|
+
title: "Next tab",
|
|
540
|
+
group: KEYS,
|
|
541
|
+
run: () => switchTab(1)
|
|
542
|
+
}, {
|
|
543
|
+
bind: "shift+tab",
|
|
544
|
+
title: "Previous tab",
|
|
545
|
+
group: KEYS,
|
|
546
|
+
run: () => switchTab(-1)
|
|
547
|
+
}, {
|
|
548
|
+
bind: "escape",
|
|
549
|
+
title: "Close",
|
|
550
|
+
group: KEYS,
|
|
551
|
+
run: close
|
|
552
|
+
}]
|
|
553
|
+
}));
|
|
554
|
+
const settingsTab = () => {
|
|
555
|
+
const shown = tab();
|
|
556
|
+
return isSettingsTab(shown) ? shown : undefined;
|
|
557
|
+
};
|
|
558
|
+
const viewHint = () => {
|
|
559
|
+
const end = "tab next tab · esc close";
|
|
560
|
+
if (tab() === "limits") return `┃ where even use would be · c copy · ↑↓ scroll · ${end}`;
|
|
561
|
+
return `↑↓ select · space/enter or click to use · ‹ › (or ←/→) change · ${end}`;
|
|
562
|
+
};
|
|
563
|
+
const hint = () => settings.hint(tab() ?? "", hasKeyboard()) ?? (hasKeyboard() ? viewHint() : "The keyboard is somewhere else (the message box, a dialog). Click this box to use ↑↓ space tab esc here.");
|
|
564
|
+
/**
|
|
565
|
+
* Usage's own key hints while the tab or one of its dates has the keyboard, unless the
|
|
566
|
+
* bottom bar asks about unsaved settings.
|
|
567
|
+
*/
|
|
568
|
+
const usageHints = () => {
|
|
569
|
+
if (tab() !== "usage") return undefined;
|
|
570
|
+
if (usage.typingDate()) return usage.hints();
|
|
571
|
+
if (!hasKeyboard() || settings.hint(tab() ?? "", true) !== undefined) return undefined;
|
|
572
|
+
return usage.hints();
|
|
573
|
+
};
|
|
574
|
+
/** Usage's key hints: each key bold in the text color, its label muted, two spaces apart. */
|
|
575
|
+
const KeyHints = hintProps => (() => {
|
|
576
|
+
var _el$ = _$createElement("box");
|
|
577
|
+
_$setProp(_el$, "flexDirection", "column");
|
|
578
|
+
_$setProp(_el$, "flexShrink", 0);
|
|
579
|
+
_$insert(_el$, () => keyHintLines(hintProps.hints, width()).map(line => (() => {
|
|
580
|
+
var _el$2 = _$createElement("text");
|
|
581
|
+
_$setProp(_el$2, "wrapMode", "none");
|
|
582
|
+
_$setProp(_el$2, "selectable", false);
|
|
583
|
+
_$insert(_el$2, () => line.flatMap((item, index) => [...(index > 0 ? [(() => {
|
|
584
|
+
var _el$3 = _$createElement("span");
|
|
585
|
+
_$insertNode(_el$3, _$createTextNode(` `));
|
|
586
|
+
_$effect(_$p => _$setProp(_el$3, "style", {
|
|
587
|
+
fg: theme().text.muted
|
|
588
|
+
}, _$p));
|
|
589
|
+
return _el$3;
|
|
590
|
+
})()] : []), ...(item.key ? [(() => {
|
|
591
|
+
var _el$5 = _$createElement("b");
|
|
592
|
+
_$insert(_el$5, () => item.key);
|
|
593
|
+
_$effect(_$p => _$setProp(_el$5, "style", {
|
|
594
|
+
fg: theme().text.base
|
|
595
|
+
}, _$p));
|
|
596
|
+
return _el$5;
|
|
597
|
+
})()] : []), (() => {
|
|
598
|
+
var _el$6 = _$createElement("span");
|
|
599
|
+
_$insert(_el$6, (() => {
|
|
600
|
+
var _c$ = _$memo(() => !!item.key);
|
|
601
|
+
return () => _c$() ? ` ${item.label}` : item.label;
|
|
602
|
+
})());
|
|
603
|
+
_$effect(_$p => _$setProp(_el$6, "style", {
|
|
604
|
+
fg: theme().text.muted
|
|
605
|
+
}, _$p));
|
|
606
|
+
return _el$6;
|
|
607
|
+
})()]));
|
|
608
|
+
return _el$2;
|
|
609
|
+
})()));
|
|
610
|
+
return _el$;
|
|
611
|
+
})();
|
|
612
|
+
/** The title and the version, as the tab bar shows them. */
|
|
613
|
+
const titleText = () => version() ? `${WINDOW_TITLE} ${version()}` : WINDOW_TITLE;
|
|
614
|
+
/** The drawn tab bodies' width: the scrollbar's column and a gap before it stay free. */
|
|
615
|
+
const bodyWidth = () => width() - 2;
|
|
616
|
+
const strip = () => tabStrip(BAR_TABS.map(item => item.title), TABS.length, Math.max(0, BAR_TABS.indexOf(barTabOf(tab()) ?? BAR_TABS[0])), width() - columnsOf(titleText()) - TAB_GAP - CLOSE_WIDTH);
|
|
617
|
+
const label = text => (() => {
|
|
618
|
+
var _el$7 = _$createElement("text"),
|
|
619
|
+
_el$8 = _$createElement("b");
|
|
620
|
+
_$insertNode(_el$7, _el$8);
|
|
621
|
+
_$setProp(_el$7, "wrapMode", "none");
|
|
622
|
+
_$setProp(_el$7, "selectable", false);
|
|
623
|
+
_$insert(_el$8, text);
|
|
624
|
+
_$effect(_$p => _$setProp(_el$7, "fg", theme().text.base, _$p));
|
|
625
|
+
return _el$7;
|
|
626
|
+
})();
|
|
627
|
+
const arrow = (text, delta) => (() => {
|
|
628
|
+
var _el$9 = _$createElement("text");
|
|
629
|
+
_$setProp(_el$9, "wrapMode", "none");
|
|
630
|
+
_$setProp(_el$9, "selectable", false);
|
|
631
|
+
_$insert(_el$9, text);
|
|
632
|
+
_$effect(_p$ => {
|
|
633
|
+
var _v$ = theme().text.action.primary.selected,
|
|
634
|
+
_v$2 = settings.click(() => switchTab(delta));
|
|
635
|
+
_v$ !== _p$.e && (_p$.e = _$setProp(_el$9, "fg", _v$, _p$.e));
|
|
636
|
+
_v$2 !== _p$.t && (_p$.t = _$setProp(_el$9, "onMouseUp", _v$2, _p$.t));
|
|
637
|
+
return _p$;
|
|
638
|
+
}, {
|
|
639
|
+
e: undefined,
|
|
640
|
+
t: undefined
|
|
641
|
+
});
|
|
642
|
+
return _el$9;
|
|
643
|
+
})();
|
|
644
|
+
/** The tab bar after the title: the shown tabs, with "Settings" or │ before the Settings tabs. */
|
|
645
|
+
const stripItems = () => {
|
|
646
|
+
const {
|
|
647
|
+
first,
|
|
648
|
+
last,
|
|
649
|
+
settingsLabel
|
|
650
|
+
} = strip();
|
|
651
|
+
const items = [];
|
|
652
|
+
for (let index = first; index <= last; index += 1) {
|
|
653
|
+
const item = BAR_TABS[index];
|
|
654
|
+
if (index === TABS.length && index > first) {
|
|
655
|
+
items.push(settingsLabel ? label(SETTINGS_LABEL) : (() => {
|
|
656
|
+
var _el$0 = _$createElement("text");
|
|
657
|
+
_$insertNode(_el$0, _$createTextNode(`│`));
|
|
658
|
+
_$setProp(_el$0, "wrapMode", "none");
|
|
659
|
+
_$setProp(_el$0, "selectable", false);
|
|
660
|
+
_$effect(_$p => _$setProp(_el$0, "fg", theme().text.muted, _$p));
|
|
661
|
+
return _el$0;
|
|
662
|
+
})());
|
|
663
|
+
}
|
|
664
|
+
items.push(_$createComponent(Choice, {
|
|
665
|
+
get label() {
|
|
666
|
+
return item.title;
|
|
667
|
+
},
|
|
668
|
+
get active() {
|
|
669
|
+
return barTabOf(tab()) === item;
|
|
670
|
+
},
|
|
671
|
+
get theme() {
|
|
672
|
+
return theme();
|
|
673
|
+
},
|
|
674
|
+
get run() {
|
|
675
|
+
return settings.click(() => showTab(pageOf(item)));
|
|
676
|
+
}
|
|
677
|
+
}));
|
|
678
|
+
}
|
|
679
|
+
return items;
|
|
680
|
+
};
|
|
681
|
+
return (() => {
|
|
682
|
+
var _el$10 = _$createElement("box"),
|
|
683
|
+
_el$11 = _$createElement("box"),
|
|
684
|
+
_el$12 = _$createElement("box"),
|
|
685
|
+
_el$13 = _$createElement("text"),
|
|
686
|
+
_el$14 = _$createElement("b"),
|
|
687
|
+
_el$16 = _$createElement("span"),
|
|
688
|
+
_el$17 = _$createElement("text"),
|
|
689
|
+
_el$19 = _$createElement("box"),
|
|
690
|
+
_el$20 = _$createElement("box"),
|
|
691
|
+
_el$21 = _$createElement("scrollbox"),
|
|
692
|
+
_el$22 = _$createElement("box"),
|
|
693
|
+
_el$23 = _$createElement("box");
|
|
694
|
+
_$insertNode(_el$10, _el$11);
|
|
695
|
+
_$insertNode(_el$10, _el$19);
|
|
696
|
+
_$insertNode(_el$10, _el$22);
|
|
697
|
+
_$use(element => {
|
|
698
|
+
windowBox = element;
|
|
699
|
+
ownBox = element;
|
|
700
|
+
element.on("focused", () => {
|
|
701
|
+
keyboardWanted = true;
|
|
702
|
+
setHasKeyboard(true);
|
|
703
|
+
});
|
|
704
|
+
element.on("blurred", () => {
|
|
705
|
+
setHasKeyboard(false);
|
|
706
|
+
// Decided once the event that took the keyboard is over: a resize took it (take it
|
|
707
|
+
// back), or a click elsewhere or a dialog did (leave it). A box drawn again loses it
|
|
708
|
+
// to its replacement, which takes it back.
|
|
709
|
+
queueMicrotask(() => {
|
|
710
|
+
if (windowBox !== element || element.isDestroyed) return;
|
|
711
|
+
if (resizedThisTurn && keyboardWanted) element.focus();else keyboardWanted = false;
|
|
712
|
+
});
|
|
713
|
+
});
|
|
714
|
+
// Drawn again while it had the keyboard: take it back once the new box is in place.
|
|
715
|
+
if (keyboardWanted) {
|
|
716
|
+
setTimeout(() => {
|
|
717
|
+
if (keyboardWanted && windowBox === element) element.focus();
|
|
718
|
+
}, 0);
|
|
719
|
+
}
|
|
720
|
+
}, _el$10);
|
|
721
|
+
_$setProp(_el$10, "focusable", true);
|
|
722
|
+
_$setProp(_el$10, "border", true);
|
|
723
|
+
_$setProp(_el$10, "borderStyle", "rounded");
|
|
724
|
+
_$setProp(_el$10, "paddingLeft", 1);
|
|
725
|
+
_$setProp(_el$10, "paddingRight", 1);
|
|
726
|
+
_$setProp(_el$10, "onMouseDown", () => {
|
|
727
|
+
settings.pressed();
|
|
728
|
+
if (!settings.typing()) windowBox?.focus();
|
|
729
|
+
});
|
|
730
|
+
_$setProp(_el$10, "onSizeChange", function () {
|
|
731
|
+
// Inside the border and the padding.
|
|
732
|
+
const measured = this.width - 4;
|
|
733
|
+
if (measured > 0 && measured !== width()) queueMicrotask(() => setWidth(measured));
|
|
734
|
+
});
|
|
735
|
+
_$insertNode(_el$11, _el$12);
|
|
736
|
+
_$insertNode(_el$11, _el$17);
|
|
737
|
+
_$setProp(_el$11, "flexDirection", "row");
|
|
738
|
+
_$setProp(_el$11, "flexShrink", 0);
|
|
739
|
+
_$insertNode(_el$12, _el$13);
|
|
740
|
+
_$setProp(_el$12, "flexDirection", "row");
|
|
741
|
+
_$setProp(_el$12, "columnGap", 2);
|
|
742
|
+
_$setProp(_el$12, "flexGrow", 1);
|
|
743
|
+
_$insertNode(_el$13, _el$14);
|
|
744
|
+
_$insertNode(_el$13, _el$16);
|
|
745
|
+
_$setProp(_el$13, "wrapMode", "none");
|
|
746
|
+
_$setProp(_el$13, "selectable", false);
|
|
747
|
+
_$insertNode(_el$14, _$createTextNode(`OpenCode Quota`));
|
|
748
|
+
_$insert(_el$16, (() => {
|
|
749
|
+
var _c$2 = _$memo(() => !!version());
|
|
750
|
+
return () => _c$2() ? ` ${version()}` : "";
|
|
751
|
+
})());
|
|
752
|
+
_$insert(_el$12, _$createComponent(Show, {
|
|
753
|
+
get when() {
|
|
754
|
+
return strip().first > 0;
|
|
755
|
+
},
|
|
756
|
+
get children() {
|
|
757
|
+
return arrow("‹", -1);
|
|
758
|
+
}
|
|
759
|
+
}), null);
|
|
760
|
+
_$insert(_el$12, stripItems, null);
|
|
761
|
+
_$insert(_el$12, _$createComponent(Show, {
|
|
762
|
+
get when() {
|
|
763
|
+
return strip().last < BAR_TABS.length - 1;
|
|
764
|
+
},
|
|
765
|
+
get children() {
|
|
766
|
+
return arrow("›", 1);
|
|
767
|
+
}
|
|
768
|
+
}), null);
|
|
769
|
+
_$insertNode(_el$17, _$createTextNode(`esc`));
|
|
770
|
+
_$setProp(_el$17, "selectable", false);
|
|
771
|
+
_$insertNode(_el$19, _el$20);
|
|
772
|
+
_$setProp(_el$19, "flexDirection", "row");
|
|
773
|
+
_$setProp(_el$19, "flexGrow", 1);
|
|
774
|
+
_$setProp(_el$19, "flexBasis", 0);
|
|
775
|
+
_$setProp(_el$19, "minHeight", 0);
|
|
776
|
+
_$setProp(_el$19, "marginTop", 1);
|
|
777
|
+
_$insert(_el$19, _$createComponent(Show, {
|
|
778
|
+
get when() {
|
|
779
|
+
return tab() === "usage";
|
|
780
|
+
},
|
|
781
|
+
get children() {
|
|
782
|
+
return _$createComponent(usage.Rail, {});
|
|
783
|
+
}
|
|
784
|
+
}), _el$20);
|
|
785
|
+
_$insert(_el$19, _$createComponent(Show, {
|
|
786
|
+
get when() {
|
|
787
|
+
return settingsTab();
|
|
788
|
+
},
|
|
789
|
+
children: shown => _$createComponent(settings.Pages, {
|
|
790
|
+
get tab() {
|
|
791
|
+
return shown();
|
|
792
|
+
},
|
|
793
|
+
showPage: showTab
|
|
794
|
+
})
|
|
795
|
+
}), _el$20);
|
|
796
|
+
_$insertNode(_el$20, _el$21);
|
|
797
|
+
_$setProp(_el$20, "flexDirection", "column");
|
|
798
|
+
_$setProp(_el$20, "flexGrow", 1);
|
|
799
|
+
_$setProp(_el$20, "overflow", "hidden");
|
|
800
|
+
_$insert(_el$20, _$createComponent(Show, {
|
|
801
|
+
get when() {
|
|
802
|
+
return settingsTab();
|
|
803
|
+
},
|
|
804
|
+
children: shown => _$createComponent(settings.Header, {
|
|
805
|
+
get tab() {
|
|
806
|
+
return shown();
|
|
807
|
+
},
|
|
808
|
+
refocus: () => windowBox?.focus()
|
|
809
|
+
})
|
|
810
|
+
}), _el$21);
|
|
811
|
+
_$use(element => {
|
|
812
|
+
scroll = element;
|
|
813
|
+
ownScroll = element;
|
|
814
|
+
}, _el$21);
|
|
815
|
+
_$setProp(_el$21, "flexGrow", 1);
|
|
816
|
+
_$setProp(_el$21, "flexBasis", 0);
|
|
817
|
+
_$setProp(_el$21, "minHeight", 0);
|
|
818
|
+
_$insert(_el$21, _$createComponent(Show, {
|
|
819
|
+
get when() {
|
|
820
|
+
return tab() === "system";
|
|
821
|
+
},
|
|
822
|
+
get children() {
|
|
823
|
+
return _$createComponent(NoticesView, {
|
|
824
|
+
get theme() {
|
|
825
|
+
return theme();
|
|
826
|
+
},
|
|
827
|
+
get report() {
|
|
828
|
+
return notices();
|
|
829
|
+
}
|
|
830
|
+
});
|
|
831
|
+
}
|
|
832
|
+
}), null);
|
|
833
|
+
_$insert(_el$21, () => tabOptions().map(option => _$createComponent(OptionRow, {
|
|
834
|
+
line: option,
|
|
835
|
+
get theme() {
|
|
836
|
+
return theme();
|
|
837
|
+
},
|
|
838
|
+
get active() {
|
|
839
|
+
return selected() === option.id;
|
|
840
|
+
},
|
|
841
|
+
get click() {
|
|
842
|
+
return settings.click;
|
|
843
|
+
},
|
|
844
|
+
press: () => setSelected(option.id),
|
|
845
|
+
use: () => useLine(option, true),
|
|
846
|
+
get valueWidth() {
|
|
847
|
+
return option.cycle ? 3 : 9;
|
|
848
|
+
},
|
|
849
|
+
get width() {
|
|
850
|
+
return bodyWidth();
|
|
851
|
+
}
|
|
852
|
+
})), null);
|
|
853
|
+
_$insert(_el$21, _$createComponent(Show, {
|
|
854
|
+
get when() {
|
|
855
|
+
return tab() === "limits";
|
|
856
|
+
},
|
|
857
|
+
get children() {
|
|
858
|
+
return _$createComponent(LimitsView, {
|
|
859
|
+
host: host,
|
|
860
|
+
get sessionID() {
|
|
861
|
+
return props.sessionID;
|
|
862
|
+
},
|
|
863
|
+
get nowMs() {
|
|
864
|
+
return nowMs();
|
|
865
|
+
},
|
|
866
|
+
get width() {
|
|
867
|
+
return bodyWidth();
|
|
868
|
+
}
|
|
869
|
+
});
|
|
870
|
+
}
|
|
871
|
+
}), null);
|
|
872
|
+
_$insert(_el$21, _$createComponent(Show, {
|
|
873
|
+
get when() {
|
|
874
|
+
return tab() === "usage";
|
|
875
|
+
},
|
|
876
|
+
get children() {
|
|
877
|
+
return _$createComponent(usage.View, {
|
|
878
|
+
get width() {
|
|
879
|
+
return bodyWidth() - USAGE_RAIL_WIDTH;
|
|
880
|
+
},
|
|
881
|
+
keyTarget: () => windowBox
|
|
882
|
+
});
|
|
883
|
+
}
|
|
884
|
+
}), null);
|
|
885
|
+
_$insert(_el$21, _$createComponent(Show, {
|
|
886
|
+
get when() {
|
|
887
|
+
return tab() === "system";
|
|
888
|
+
},
|
|
889
|
+
get children() {
|
|
890
|
+
return _$createComponent(StatusView, {
|
|
891
|
+
get theme() {
|
|
892
|
+
return theme();
|
|
893
|
+
},
|
|
894
|
+
get report() {
|
|
895
|
+
return status();
|
|
896
|
+
},
|
|
897
|
+
get width() {
|
|
898
|
+
return bodyWidth();
|
|
899
|
+
}
|
|
900
|
+
});
|
|
901
|
+
}
|
|
902
|
+
}), null);
|
|
903
|
+
_$insert(_el$21, _$createComponent(Show, {
|
|
904
|
+
get when() {
|
|
905
|
+
return settingsTab();
|
|
906
|
+
},
|
|
907
|
+
children: shown => _$createComponent(settings.Body, {
|
|
908
|
+
get tab() {
|
|
909
|
+
return shown();
|
|
910
|
+
},
|
|
911
|
+
showPage: showTab,
|
|
912
|
+
host: host,
|
|
913
|
+
get sessionID() {
|
|
914
|
+
return props.sessionID;
|
|
915
|
+
},
|
|
916
|
+
box: () => windowBox,
|
|
917
|
+
scroll: () => scroll,
|
|
918
|
+
get width() {
|
|
919
|
+
return bodyWidth() - pagesRoom(shown());
|
|
920
|
+
}
|
|
921
|
+
})
|
|
922
|
+
}), null);
|
|
923
|
+
_$insertNode(_el$22, _el$23);
|
|
924
|
+
_$setProp(_el$22, "flexDirection", "column");
|
|
925
|
+
_$setProp(_el$22, "marginTop", 1);
|
|
926
|
+
_$setProp(_el$22, "flexShrink", 0);
|
|
927
|
+
_$setProp(_el$23, "flexDirection", "row");
|
|
928
|
+
_$setProp(_el$23, "gap", 2);
|
|
929
|
+
_$insert(_el$23, _$createComponent(settings.Buttons, {
|
|
930
|
+
get tab() {
|
|
931
|
+
return tab() ?? "";
|
|
932
|
+
},
|
|
933
|
+
host: host,
|
|
934
|
+
get sessionID() {
|
|
935
|
+
return props.sessionID;
|
|
936
|
+
},
|
|
937
|
+
box: () => windowBox,
|
|
938
|
+
close: close
|
|
939
|
+
}));
|
|
940
|
+
_$insert(_el$22, _$createComponent(Show, {
|
|
941
|
+
get when() {
|
|
942
|
+
return usageHints();
|
|
943
|
+
},
|
|
944
|
+
get fallback() {
|
|
945
|
+
return (() => {
|
|
946
|
+
var _el$24 = _$createElement("text");
|
|
947
|
+
_$setProp(_el$24, "wrapMode", "word");
|
|
948
|
+
_$setProp(_el$24, "selectable", false);
|
|
949
|
+
_$insert(_el$24, () => hintLines(hint(), width()));
|
|
950
|
+
_$effect(_$p => _$setProp(_el$24, "fg", theme().text.muted, _$p));
|
|
951
|
+
return _el$24;
|
|
952
|
+
})();
|
|
953
|
+
},
|
|
954
|
+
children: hints => _$createComponent(KeyHints, {
|
|
955
|
+
get hints() {
|
|
956
|
+
return hints();
|
|
957
|
+
}
|
|
958
|
+
})
|
|
959
|
+
}), null);
|
|
960
|
+
_$effect(_p$ => {
|
|
961
|
+
var _v$3 = roomHeight(),
|
|
962
|
+
_v$4 = hasKeyboard() ? theme().text.action.primary.selected : theme().border.base,
|
|
963
|
+
_v$5 = theme().text.base,
|
|
964
|
+
_v$6 = {
|
|
965
|
+
fg: theme().text.muted
|
|
966
|
+
},
|
|
967
|
+
_v$7 = theme().text.muted,
|
|
968
|
+
_v$8 = settings.click(close);
|
|
969
|
+
_v$3 !== _p$.e && (_p$.e = _$setProp(_el$10, "height", _v$3, _p$.e));
|
|
970
|
+
_v$4 !== _p$.t && (_p$.t = _$setProp(_el$10, "borderColor", _v$4, _p$.t));
|
|
971
|
+
_v$5 !== _p$.a && (_p$.a = _$setProp(_el$13, "fg", _v$5, _p$.a));
|
|
972
|
+
_v$6 !== _p$.o && (_p$.o = _$setProp(_el$16, "style", _v$6, _p$.o));
|
|
973
|
+
_v$7 !== _p$.i && (_p$.i = _$setProp(_el$17, "fg", _v$7, _p$.i));
|
|
974
|
+
_v$8 !== _p$.n && (_p$.n = _$setProp(_el$17, "onMouseUp", _v$8, _p$.n));
|
|
975
|
+
return _p$;
|
|
976
|
+
}, {
|
|
977
|
+
e: undefined,
|
|
978
|
+
t: undefined,
|
|
979
|
+
a: undefined,
|
|
980
|
+
o: undefined,
|
|
981
|
+
i: undefined,
|
|
982
|
+
n: undefined
|
|
983
|
+
});
|
|
984
|
+
return _el$10;
|
|
985
|
+
})();
|
|
986
|
+
}
|
|
987
|
+
return {
|
|
988
|
+
open,
|
|
989
|
+
openUsage: choice => open("usage", choice),
|
|
990
|
+
Slot: props => _$createComponent(Show, {
|
|
991
|
+
get when() {
|
|
992
|
+
return tab() !== undefined;
|
|
993
|
+
},
|
|
994
|
+
get children() {
|
|
995
|
+
return _$createComponent(Window, {
|
|
996
|
+
get sessionID() {
|
|
997
|
+
return props.sessionID;
|
|
998
|
+
}
|
|
999
|
+
});
|
|
1000
|
+
}
|
|
1001
|
+
})
|
|
1002
|
+
};
|
|
1003
|
+
}
|