codex-multi-auth 0.1.0
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/LICENSE +1 -0
- package/README.md +162 -0
- package/assets/opencode-logo-ornate-dark.svg +18 -0
- package/assets/readme-hero.svg +31 -0
- package/config/README.md +87 -0
- package/config/minimal-opencode.json +13 -0
- package/config/opencode-legacy.json +571 -0
- package/config/opencode-modern.json +239 -0
- package/dist/index.d.ts +45 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +3160 -0
- package/dist/index.js.map +1 -0
- package/dist/lib/accounts/rate-limits.d.ts +22 -0
- package/dist/lib/accounts/rate-limits.d.ts.map +1 -0
- package/dist/lib/accounts/rate-limits.js +63 -0
- package/dist/lib/accounts/rate-limits.js.map +1 -0
- package/dist/lib/accounts.d.ts +95 -0
- package/dist/lib/accounts.d.ts.map +1 -0
- package/dist/lib/accounts.js +668 -0
- package/dist/lib/accounts.js.map +1 -0
- package/dist/lib/audit.d.ts +45 -0
- package/dist/lib/audit.d.ts.map +1 -0
- package/dist/lib/audit.js +131 -0
- package/dist/lib/audit.js.map +1 -0
- package/dist/lib/auth/auth.d.ts +56 -0
- package/dist/lib/auth/auth.d.ts.map +1 -0
- package/dist/lib/auth/auth.js +214 -0
- package/dist/lib/auth/auth.js.map +1 -0
- package/dist/lib/auth/browser.d.ts +34 -0
- package/dist/lib/auth/browser.d.ts.map +1 -0
- package/dist/lib/auth/browser.js +185 -0
- package/dist/lib/auth/browser.js.map +1 -0
- package/dist/lib/auth/server.d.ts +24 -0
- package/dist/lib/auth/server.d.ts.map +1 -0
- package/dist/lib/auth/server.js +116 -0
- package/dist/lib/auth/server.js.map +1 -0
- package/dist/lib/auth/token-utils.d.ts +59 -0
- package/dist/lib/auth/token-utils.d.ts.map +1 -0
- package/dist/lib/auth/token-utils.js +331 -0
- package/dist/lib/auth/token-utils.js.map +1 -0
- package/dist/lib/auth-rate-limit.d.ts +20 -0
- package/dist/lib/auth-rate-limit.d.ts.map +1 -0
- package/dist/lib/auth-rate-limit.js +91 -0
- package/dist/lib/auth-rate-limit.js.map +1 -0
- package/dist/lib/auto-update-checker.d.ts +10 -0
- package/dist/lib/auto-update-checker.d.ts.map +1 -0
- package/dist/lib/auto-update-checker.js +216 -0
- package/dist/lib/auto-update-checker.js.map +1 -0
- package/dist/lib/capability-policy.d.ts +18 -0
- package/dist/lib/capability-policy.d.ts.map +1 -0
- package/dist/lib/capability-policy.js +150 -0
- package/dist/lib/capability-policy.js.map +1 -0
- package/dist/lib/circuit-breaker.d.ts +34 -0
- package/dist/lib/circuit-breaker.d.ts.map +1 -0
- package/dist/lib/circuit-breaker.js +124 -0
- package/dist/lib/circuit-breaker.js.map +1 -0
- package/dist/lib/cli.d.ts +64 -0
- package/dist/lib/cli.d.ts.map +1 -0
- package/dist/lib/cli.js +274 -0
- package/dist/lib/cli.js.map +1 -0
- package/dist/lib/codex-cli/observability.d.ts +22 -0
- package/dist/lib/codex-cli/observability.d.ts.map +1 -0
- package/dist/lib/codex-cli/observability.js +36 -0
- package/dist/lib/codex-cli/observability.js.map +1 -0
- package/dist/lib/codex-cli/state.d.ts +86 -0
- package/dist/lib/codex-cli/state.d.ts.map +1 -0
- package/dist/lib/codex-cli/state.js +470 -0
- package/dist/lib/codex-cli/state.js.map +1 -0
- package/dist/lib/codex-cli/sync.d.ts +27 -0
- package/dist/lib/codex-cli/sync.d.ts.map +1 -0
- package/dist/lib/codex-cli/sync.js +325 -0
- package/dist/lib/codex-cli/sync.js.map +1 -0
- package/dist/lib/codex-cli/writer.d.ts +12 -0
- package/dist/lib/codex-cli/writer.d.ts.map +1 -0
- package/dist/lib/codex-cli/writer.js +388 -0
- package/dist/lib/codex-cli/writer.js.map +1 -0
- package/dist/lib/codex-manager.d.ts +2 -0
- package/dist/lib/codex-manager.d.ts.map +1 -0
- package/dist/lib/codex-manager.js +4841 -0
- package/dist/lib/codex-manager.js.map +1 -0
- package/dist/lib/config.d.ts +269 -0
- package/dist/lib/config.d.ts.map +1 -0
- package/dist/lib/config.js +789 -0
- package/dist/lib/config.js.map +1 -0
- package/dist/lib/constants.d.ts +78 -0
- package/dist/lib/constants.d.ts.map +1 -0
- package/dist/lib/constants.js +78 -0
- package/dist/lib/constants.js.map +1 -0
- package/dist/lib/context-overflow.d.ts +27 -0
- package/dist/lib/context-overflow.d.ts.map +1 -0
- package/dist/lib/context-overflow.js +124 -0
- package/dist/lib/context-overflow.js.map +1 -0
- package/dist/lib/dashboard-settings.d.ts +90 -0
- package/dist/lib/dashboard-settings.d.ts.map +1 -0
- package/dist/lib/dashboard-settings.js +327 -0
- package/dist/lib/dashboard-settings.js.map +1 -0
- package/dist/lib/entitlement-cache.d.ts +41 -0
- package/dist/lib/entitlement-cache.d.ts.map +1 -0
- package/dist/lib/entitlement-cache.js +137 -0
- package/dist/lib/entitlement-cache.js.map +1 -0
- package/dist/lib/errors.d.ts +113 -0
- package/dist/lib/errors.d.ts.map +1 -0
- package/dist/lib/errors.js +103 -0
- package/dist/lib/errors.js.map +1 -0
- package/dist/lib/forecast.d.ts +42 -0
- package/dist/lib/forecast.d.ts.map +1 -0
- package/dist/lib/forecast.js +256 -0
- package/dist/lib/forecast.js.map +1 -0
- package/dist/lib/health.d.ts +33 -0
- package/dist/lib/health.d.ts.map +1 -0
- package/dist/lib/health.js +70 -0
- package/dist/lib/health.js.map +1 -0
- package/dist/lib/index.d.ts +32 -0
- package/dist/lib/index.d.ts.map +1 -0
- package/dist/lib/index.js +32 -0
- package/dist/lib/index.js.map +1 -0
- package/dist/lib/live-account-sync.d.ts +39 -0
- package/dist/lib/live-account-sync.d.ts.map +1 -0
- package/dist/lib/live-account-sync.js +196 -0
- package/dist/lib/live-account-sync.js.map +1 -0
- package/dist/lib/logger.d.ts +40 -0
- package/dist/lib/logger.d.ts.map +1 -0
- package/dist/lib/logger.js +364 -0
- package/dist/lib/logger.js.map +1 -0
- package/dist/lib/oauth-success.html +338 -0
- package/dist/lib/parallel-probe.d.ts +28 -0
- package/dist/lib/parallel-probe.d.ts.map +1 -0
- package/dist/lib/parallel-probe.js +97 -0
- package/dist/lib/parallel-probe.js.map +1 -0
- package/dist/lib/preemptive-quota-scheduler.d.ts +53 -0
- package/dist/lib/preemptive-quota-scheduler.d.ts.map +1 -0
- package/dist/lib/preemptive-quota-scheduler.js +220 -0
- package/dist/lib/preemptive-quota-scheduler.js.map +1 -0
- package/dist/lib/proactive-refresh.d.ts +66 -0
- package/dist/lib/proactive-refresh.d.ts.map +1 -0
- package/dist/lib/proactive-refresh.js +143 -0
- package/dist/lib/proactive-refresh.js.map +1 -0
- package/dist/lib/prompts/codex-opencode-bridge.d.ts +19 -0
- package/dist/lib/prompts/codex-opencode-bridge.d.ts.map +1 -0
- package/dist/lib/prompts/codex-opencode-bridge.js +169 -0
- package/dist/lib/prompts/codex-opencode-bridge.js.map +1 -0
- package/dist/lib/prompts/codex.d.ts +41 -0
- package/dist/lib/prompts/codex.d.ts.map +1 -0
- package/dist/lib/prompts/codex.js +383 -0
- package/dist/lib/prompts/codex.js.map +1 -0
- package/dist/lib/prompts/opencode-codex.d.ts +25 -0
- package/dist/lib/prompts/opencode-codex.d.ts.map +1 -0
- package/dist/lib/prompts/opencode-codex.js +270 -0
- package/dist/lib/prompts/opencode-codex.js.map +1 -0
- package/dist/lib/quota-cache.d.ts +68 -0
- package/dist/lib/quota-cache.d.ts.map +1 -0
- package/dist/lib/quota-cache.js +224 -0
- package/dist/lib/quota-cache.js.map +1 -0
- package/dist/lib/quota-probe.d.ts +49 -0
- package/dist/lib/quota-probe.d.ts.map +1 -0
- package/dist/lib/quota-probe.js +368 -0
- package/dist/lib/quota-probe.js.map +1 -0
- package/dist/lib/recovery/constants.d.ts +12 -0
- package/dist/lib/recovery/constants.d.ts.map +1 -0
- package/dist/lib/recovery/constants.js +31 -0
- package/dist/lib/recovery/constants.js.map +1 -0
- package/dist/lib/recovery/index.d.ts +12 -0
- package/dist/lib/recovery/index.d.ts.map +1 -0
- package/dist/lib/recovery/index.js +12 -0
- package/dist/lib/recovery/index.js.map +1 -0
- package/dist/lib/recovery/storage.d.ts +24 -0
- package/dist/lib/recovery/storage.d.ts.map +1 -0
- package/dist/lib/recovery/storage.js +362 -0
- package/dist/lib/recovery/storage.js.map +1 -0
- package/dist/lib/recovery/types.d.ts +116 -0
- package/dist/lib/recovery/types.d.ts.map +1 -0
- package/dist/lib/recovery/types.js +7 -0
- package/dist/lib/recovery/types.js.map +1 -0
- package/dist/lib/recovery.d.ts +31 -0
- package/dist/lib/recovery.d.ts.map +1 -0
- package/dist/lib/recovery.js +313 -0
- package/dist/lib/recovery.js.map +1 -0
- package/dist/lib/refresh-guardian.d.ts +31 -0
- package/dist/lib/refresh-guardian.d.ts.map +1 -0
- package/dist/lib/refresh-guardian.js +151 -0
- package/dist/lib/refresh-guardian.js.map +1 -0
- package/dist/lib/refresh-lease.d.ts +37 -0
- package/dist/lib/refresh-lease.d.ts.map +1 -0
- package/dist/lib/refresh-lease.js +335 -0
- package/dist/lib/refresh-lease.js.map +1 -0
- package/dist/lib/refresh-queue.d.ts +117 -0
- package/dist/lib/refresh-queue.d.ts.map +1 -0
- package/dist/lib/refresh-queue.js +297 -0
- package/dist/lib/refresh-queue.js.map +1 -0
- package/dist/lib/request/failure-policy.d.ts +42 -0
- package/dist/lib/request/failure-policy.d.ts.map +1 -0
- package/dist/lib/request/failure-policy.js +133 -0
- package/dist/lib/request/failure-policy.js.map +1 -0
- package/dist/lib/request/fetch-helpers.d.ts +152 -0
- package/dist/lib/request/fetch-helpers.d.ts.map +1 -0
- package/dist/lib/request/fetch-helpers.js +704 -0
- package/dist/lib/request/fetch-helpers.js.map +1 -0
- package/dist/lib/request/helpers/input-utils.d.ts +7 -0
- package/dist/lib/request/helpers/input-utils.d.ts.map +1 -0
- package/dist/lib/request/helpers/input-utils.js +214 -0
- package/dist/lib/request/helpers/input-utils.js.map +1 -0
- package/dist/lib/request/helpers/model-map.d.ts +28 -0
- package/dist/lib/request/helpers/model-map.d.ts.map +1 -0
- package/dist/lib/request/helpers/model-map.js +133 -0
- package/dist/lib/request/helpers/model-map.js.map +1 -0
- package/dist/lib/request/helpers/tool-utils.d.ts +29 -0
- package/dist/lib/request/helpers/tool-utils.d.ts.map +1 -0
- package/dist/lib/request/helpers/tool-utils.js +117 -0
- package/dist/lib/request/helpers/tool-utils.js.map +1 -0
- package/dist/lib/request/rate-limit-backoff.d.ts +17 -0
- package/dist/lib/request/rate-limit-backoff.d.ts.map +1 -0
- package/dist/lib/request/rate-limit-backoff.js +83 -0
- package/dist/lib/request/rate-limit-backoff.js.map +1 -0
- package/dist/lib/request/request-transformer.d.ts +107 -0
- package/dist/lib/request/request-transformer.d.ts.map +1 -0
- package/dist/lib/request/request-transformer.js +814 -0
- package/dist/lib/request/request-transformer.js.map +1 -0
- package/dist/lib/request/response-handler.d.ts +23 -0
- package/dist/lib/request/response-handler.d.ts.map +1 -0
- package/dist/lib/request/response-handler.js +155 -0
- package/dist/lib/request/response-handler.js.map +1 -0
- package/dist/lib/request/stream-failover.d.ts +21 -0
- package/dist/lib/request/stream-failover.d.ts.map +1 -0
- package/dist/lib/request/stream-failover.js +204 -0
- package/dist/lib/request/stream-failover.js.map +1 -0
- package/dist/lib/rotation.d.ts +146 -0
- package/dist/lib/rotation.d.ts.map +1 -0
- package/dist/lib/rotation.js +321 -0
- package/dist/lib/rotation.js.map +1 -0
- package/dist/lib/runtime-paths.d.ts +58 -0
- package/dist/lib/runtime-paths.d.ts.map +1 -0
- package/dist/lib/runtime-paths.js +164 -0
- package/dist/lib/runtime-paths.js.map +1 -0
- package/dist/lib/schemas.d.ts +435 -0
- package/dist/lib/schemas.d.ts.map +1 -0
- package/dist/lib/schemas.js +268 -0
- package/dist/lib/schemas.js.map +1 -0
- package/dist/lib/session-affinity.d.ts +23 -0
- package/dist/lib/session-affinity.d.ts.map +1 -0
- package/dist/lib/session-affinity.js +127 -0
- package/dist/lib/session-affinity.js.map +1 -0
- package/dist/lib/shutdown.d.ts +7 -0
- package/dist/lib/shutdown.d.ts.map +1 -0
- package/dist/lib/shutdown.js +43 -0
- package/dist/lib/shutdown.js.map +1 -0
- package/dist/lib/storage/migrations.d.ts +59 -0
- package/dist/lib/storage/migrations.d.ts.map +1 -0
- package/dist/lib/storage/migrations.js +41 -0
- package/dist/lib/storage/migrations.js.map +1 -0
- package/dist/lib/storage/paths.d.ts +51 -0
- package/dist/lib/storage/paths.d.ts.map +1 -0
- package/dist/lib/storage/paths.js +152 -0
- package/dist/lib/storage/paths.js.map +1 -0
- package/dist/lib/storage.d.ts +106 -0
- package/dist/lib/storage.d.ts.map +1 -0
- package/dist/lib/storage.js +896 -0
- package/dist/lib/storage.js.map +1 -0
- package/dist/lib/table-formatter.d.ts +32 -0
- package/dist/lib/table-formatter.d.ts.map +1 -0
- package/dist/lib/table-formatter.js +44 -0
- package/dist/lib/table-formatter.js.map +1 -0
- package/dist/lib/tools/hashline-tools.d.ts +51 -0
- package/dist/lib/tools/hashline-tools.d.ts.map +1 -0
- package/dist/lib/tools/hashline-tools.js +456 -0
- package/dist/lib/tools/hashline-tools.js.map +1 -0
- package/dist/lib/types.d.ts +130 -0
- package/dist/lib/types.d.ts.map +1 -0
- package/dist/lib/types.js +2 -0
- package/dist/lib/types.js.map +1 -0
- package/dist/lib/ui/ansi.d.ts +40 -0
- package/dist/lib/ui/ansi.d.ts.map +1 -0
- package/dist/lib/ui/ansi.js +68 -0
- package/dist/lib/ui/ansi.js.map +1 -0
- package/dist/lib/ui/auth-menu.d.ts +76 -0
- package/dist/lib/ui/auth-menu.d.ts.map +1 -0
- package/dist/lib/ui/auth-menu.js +590 -0
- package/dist/lib/ui/auth-menu.js.map +1 -0
- package/dist/lib/ui/confirm.d.ts +11 -0
- package/dist/lib/ui/confirm.d.ts.map +1 -0
- package/dist/lib/ui/confirm.js +29 -0
- package/dist/lib/ui/confirm.js.map +1 -0
- package/dist/lib/ui/copy.d.ts +123 -0
- package/dist/lib/ui/copy.d.ts.map +1 -0
- package/dist/lib/ui/copy.js +127 -0
- package/dist/lib/ui/copy.js.map +1 -0
- package/dist/lib/ui/format.d.ts +62 -0
- package/dist/lib/ui/format.d.ts.map +1 -0
- package/dist/lib/ui/format.js +205 -0
- package/dist/lib/ui/format.js.map +1 -0
- package/dist/lib/ui/runtime.d.ts +43 -0
- package/dist/lib/ui/runtime.d.ts.map +1 -0
- package/dist/lib/ui/runtime.js +69 -0
- package/dist/lib/ui/runtime.js.map +1 -0
- package/dist/lib/ui/select.d.ts +60 -0
- package/dist/lib/ui/select.d.ts.map +1 -0
- package/dist/lib/ui/select.js +467 -0
- package/dist/lib/ui/select.js.map +1 -0
- package/dist/lib/ui/theme.d.ts +56 -0
- package/dist/lib/ui/theme.d.ts.map +1 -0
- package/dist/lib/ui/theme.js +186 -0
- package/dist/lib/ui/theme.js.map +1 -0
- package/dist/lib/unified-settings.d.ts +71 -0
- package/dist/lib/unified-settings.d.ts.map +1 -0
- package/dist/lib/unified-settings.js +299 -0
- package/dist/lib/unified-settings.js.map +1 -0
- package/dist/lib/utils.d.ts +29 -0
- package/dist/lib/utils.d.ts.map +1 -0
- package/dist/lib/utils.js +54 -0
- package/dist/lib/utils.js.map +1 -0
- package/package.json +115 -0
- package/scripts/audit-dev-allowlist.js +128 -0
- package/scripts/bench-format/hashline-v2.mjs +642 -0
- package/scripts/bench-format/models.mjs +105 -0
- package/scripts/bench-format/opencode.mjs +205 -0
- package/scripts/bench-format/render.mjs +496 -0
- package/scripts/bench-format/stats.mjs +54 -0
- package/scripts/bench-format/tasks.mjs +151 -0
- package/scripts/benchmark-edit-formats.mjs +1161 -0
- package/scripts/benchmark-render-dashboard.mjs +49 -0
- package/scripts/codex-multi-auth.js +6 -0
- package/scripts/codex-routing.js +34 -0
- package/scripts/codex.js +122 -0
- package/scripts/copy-oauth-success.js +37 -0
- package/scripts/install-opencode-codex-auth.js +193 -0
- package/scripts/test-all-models.sh +7 -0
- package/scripts/test-model-matrix.js +424 -0
- package/scripts/validate-model-map.sh +7 -0
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import { select } from "./select.js";
|
|
2
|
+
import { getUiRuntimeOptions } from "./runtime.js";
|
|
3
|
+
/**
|
|
4
|
+
* Prompt the user with a Yes/No choice.
|
|
5
|
+
*
|
|
6
|
+
* Assumes a single interactive UI context; concurrent prompts may interleave. Does not access the filesystem (no Windows-specific filesystem effects). Callers should redact sensitive tokens from `message` before passing it to this prompt.
|
|
7
|
+
*
|
|
8
|
+
* @param message - The prompt text shown to the user
|
|
9
|
+
* @param defaultYes - If true, "Yes" is presented first and treated as the default ordering
|
|
10
|
+
* @returns `true` if the user selects "Yes", `false` otherwise
|
|
11
|
+
*/
|
|
12
|
+
export async function confirm(message, defaultYes = false) {
|
|
13
|
+
const ui = getUiRuntimeOptions();
|
|
14
|
+
const items = defaultYes
|
|
15
|
+
? [
|
|
16
|
+
{ label: "Yes", value: true },
|
|
17
|
+
{ label: "No", value: false },
|
|
18
|
+
]
|
|
19
|
+
: [
|
|
20
|
+
{ label: "No", value: false },
|
|
21
|
+
{ label: "Yes", value: true },
|
|
22
|
+
];
|
|
23
|
+
const result = await select(items, {
|
|
24
|
+
message,
|
|
25
|
+
theme: ui.theme,
|
|
26
|
+
});
|
|
27
|
+
return result ?? false;
|
|
28
|
+
}
|
|
29
|
+
//# sourceMappingURL=confirm.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"confirm.js","sourceRoot":"","sources":["../../../lib/ui/confirm.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,MAAM,aAAa,CAAC;AACrC,OAAO,EAAE,mBAAmB,EAAE,MAAM,cAAc,CAAC;AAEnD;;;;;;;;GAQG;AACH,MAAM,CAAC,KAAK,UAAU,OAAO,CAAC,OAAe,EAAE,UAAU,GAAG,KAAK;IAChE,MAAM,EAAE,GAAG,mBAAmB,EAAE,CAAC;IACjC,MAAM,KAAK,GAAG,UAAU;QACvB,CAAC,CAAC;YACA,EAAE,KAAK,EAAE,KAAK,EAAE,KAAK,EAAE,IAAI,EAAE;YAC7B,EAAE,KAAK,EAAE,IAAI,EAAE,KAAK,EAAE,KAAK,EAAE;SAC7B;QACF,CAAC,CAAC;YACA,EAAE,KAAK,EAAE,IAAI,EAAE,KAAK,EAAE,KAAK,EAAE;YAC7B,EAAE,KAAK,EAAE,KAAK,EAAE,KAAK,EAAE,IAAI,EAAE;SAC7B,CAAC;IAEJ,MAAM,MAAM,GAAG,MAAM,MAAM,CAAC,KAAK,EAAE;QAClC,OAAO;QACP,KAAK,EAAE,EAAE,CAAC,KAAK;KACf,CAAC,CAAC;IACH,OAAO,MAAM,IAAI,KAAK,CAAC;AACxB,CAAC"}
|
|
@@ -0,0 +1,123 @@
|
|
|
1
|
+
export declare const UI_COPY: {
|
|
2
|
+
readonly mainMenu: {
|
|
3
|
+
readonly title: "Accounts Dashboard";
|
|
4
|
+
readonly searchSubtitlePrefix: "Search:";
|
|
5
|
+
readonly quickStart: "Quick Actions";
|
|
6
|
+
readonly addAccount: "Add New Account";
|
|
7
|
+
readonly checkAccounts: "Run Health Check";
|
|
8
|
+
readonly bestAccount: "Pick Best Account";
|
|
9
|
+
readonly fixIssues: "Auto-Repair Issues";
|
|
10
|
+
readonly settings: "Settings";
|
|
11
|
+
readonly moreChecks: "Advanced Checks";
|
|
12
|
+
readonly refreshChecks: "Refresh All Accounts";
|
|
13
|
+
readonly checkFlagged: "Check Problem Accounts";
|
|
14
|
+
readonly accounts: "Saved Accounts";
|
|
15
|
+
readonly loadingLimits: "Fetching account limits...";
|
|
16
|
+
readonly noSearchMatches: "No accounts match your search";
|
|
17
|
+
readonly dangerZone: "Danger Zone";
|
|
18
|
+
readonly removeAllAccounts: "Delete All Accounts";
|
|
19
|
+
readonly helpCompact: "↑↓ Move | Enter Select | / Search | 1-9 Switch | Q Back";
|
|
20
|
+
readonly helpDetailed: "Arrow keys move, Enter selects, / searches, 1-9 switches account, Q goes back";
|
|
21
|
+
};
|
|
22
|
+
readonly accountDetails: {
|
|
23
|
+
readonly back: "Back";
|
|
24
|
+
readonly enable: "Enable Account";
|
|
25
|
+
readonly disable: "Disable Account";
|
|
26
|
+
readonly setCurrent: "Set As Current";
|
|
27
|
+
readonly refresh: "Re-Login";
|
|
28
|
+
readonly remove: "Delete Account";
|
|
29
|
+
readonly help: "↑↓ Move | Enter Select | S Use | R Sign In | D Delete | Q Back";
|
|
30
|
+
};
|
|
31
|
+
readonly oauth: {
|
|
32
|
+
readonly chooseModeTitle: "Sign-In Method";
|
|
33
|
+
readonly chooseModeSubtitle: "How do you want to sign in?";
|
|
34
|
+
readonly openBrowser: "Open Browser (Easy)";
|
|
35
|
+
readonly manualMode: "Manual / Incognito";
|
|
36
|
+
readonly back: "Back";
|
|
37
|
+
readonly chooseModeHelp: "↑↓ Move | Enter Select | 1 Easy | 2 Manual | Q Back";
|
|
38
|
+
readonly goTo: "Go to:";
|
|
39
|
+
readonly copyOk: "Login link copied.";
|
|
40
|
+
readonly copyFail: "Could not copy login link.";
|
|
41
|
+
readonly pastePrompt: "Paste callback URL or code here (Q to cancel):";
|
|
42
|
+
readonly browserOpened: "Browser opened.";
|
|
43
|
+
readonly browserOpenFail: "Could not open browser. Use this link:";
|
|
44
|
+
readonly waitingCallback: "Waiting for login callback on localhost:1455...";
|
|
45
|
+
readonly callbackMissed: "No callback received. Paste manually.";
|
|
46
|
+
readonly cancelled: "Sign-in cancelled.";
|
|
47
|
+
readonly cancelledBackToMenu: "Sign-in cancelled. Going back to menu.";
|
|
48
|
+
};
|
|
49
|
+
readonly returnFlow: {
|
|
50
|
+
readonly continuePrompt: "Press Enter to go back.";
|
|
51
|
+
readonly actionFailedPrompt: "Action failed. Press Enter to go back.";
|
|
52
|
+
readonly autoReturn: (seconds: number) => string;
|
|
53
|
+
readonly paused: "Paused. Press any key to continue.";
|
|
54
|
+
readonly working: "Running...";
|
|
55
|
+
readonly done: "Done.";
|
|
56
|
+
readonly failed: "Failed.";
|
|
57
|
+
};
|
|
58
|
+
readonly settings: {
|
|
59
|
+
readonly title: "Settings";
|
|
60
|
+
readonly subtitle: "Customize menu, behavior, and backend";
|
|
61
|
+
readonly help: "↑↓ Move | Enter Select | Q Back";
|
|
62
|
+
readonly sectionTitle: "Basic";
|
|
63
|
+
readonly advancedTitle: "Advanced";
|
|
64
|
+
readonly exitTitle: "Back";
|
|
65
|
+
readonly accountList: "Account List View";
|
|
66
|
+
readonly summaryFields: "Summary Line";
|
|
67
|
+
readonly behavior: "Menu Behavior";
|
|
68
|
+
readonly theme: "Color Theme";
|
|
69
|
+
readonly backend: "Backend Controls";
|
|
70
|
+
readonly back: "Back";
|
|
71
|
+
readonly previewHeading: "Live Preview";
|
|
72
|
+
readonly displayHeading: "Options";
|
|
73
|
+
readonly resetDefault: "Reset to Default";
|
|
74
|
+
readonly saveAndBack: "Save and Back";
|
|
75
|
+
readonly backNoSave: "Back Without Saving";
|
|
76
|
+
readonly accountListTitle: "Account List View";
|
|
77
|
+
readonly accountListSubtitle: "Choose row details and optional smart sorting";
|
|
78
|
+
readonly accountListHelp: "Enter Toggle | Number Toggle | M Sort | L Layout | S Save | Q Save+Back";
|
|
79
|
+
readonly summaryTitle: "Account Details Row";
|
|
80
|
+
readonly summarySubtitle: "Choose and order detail fields";
|
|
81
|
+
readonly summaryHelp: "Enter Toggle | 1-3 Toggle | [ ] Reorder | S Save | Q Save+Back";
|
|
82
|
+
readonly behaviorTitle: "Return Behavior";
|
|
83
|
+
readonly behaviorSubtitle: "Control how result screens return";
|
|
84
|
+
readonly behaviorHelp: "Enter Select | 1-3 Delay | P Pause | L AutoFetch | F Status | T TTL | S Save | Q Save+Back";
|
|
85
|
+
readonly themeTitle: "Color Theme";
|
|
86
|
+
readonly themeSubtitle: "Pick base color and accent";
|
|
87
|
+
readonly themeHelp: "Enter Select | 1-2 Base | S Save | Q Save+Back";
|
|
88
|
+
readonly backendTitle: "Backend Controls";
|
|
89
|
+
readonly backendSubtitle: "Tune sync, retry, and limit behavior";
|
|
90
|
+
readonly backendHelp: "Enter Open | 1-4 Category | S Save | R Reset | Q Save+Back";
|
|
91
|
+
readonly backendCategoriesHeading: "Categories";
|
|
92
|
+
readonly backendCategoryTitle: "Backend Category";
|
|
93
|
+
readonly backendCategoryHelp: "Enter Toggle/Adjust | +/- or [ ] Number | 1-9 Toggle | R Reset | Q Back";
|
|
94
|
+
readonly backendToggleHeading: "Switches";
|
|
95
|
+
readonly backendNumberHeading: "Numbers";
|
|
96
|
+
readonly backendDecrease: "Decrease Focused Value";
|
|
97
|
+
readonly backendIncrease: "Increase Focused Value";
|
|
98
|
+
readonly backendResetCategory: "Reset Category";
|
|
99
|
+
readonly backendBackToCategories: "Back to Categories";
|
|
100
|
+
readonly baseTheme: "Base Color";
|
|
101
|
+
readonly accentColor: "Accent Color";
|
|
102
|
+
readonly actionTiming: "Auto Return Delay";
|
|
103
|
+
readonly moveUp: "Move Focused Field Up";
|
|
104
|
+
readonly moveDown: "Move Focused Field Down";
|
|
105
|
+
};
|
|
106
|
+
readonly fallback: {
|
|
107
|
+
readonly addAnotherTip: "Tip: Use private mode or sign out before adding another account.";
|
|
108
|
+
readonly addAnotherQuestion: (count: number) => string;
|
|
109
|
+
readonly selectModePrompt: "(a) add, (c) check, (b) best, fi(x), (s) settings, (d) deep, (g) problem, (f) fresh, (q) back [a/c/b/x/s/d/g/f/q]: ";
|
|
110
|
+
readonly invalidModePrompt: "Use one of: a, c, b, x, s, d, g, f, q.";
|
|
111
|
+
};
|
|
112
|
+
};
|
|
113
|
+
/**
|
|
114
|
+
* Builds the "Check Problem Accounts" label, appending the flagged count when greater than zero.
|
|
115
|
+
*
|
|
116
|
+
* This function is pure and has no side effects, is safe for concurrent use, performs no filesystem
|
|
117
|
+
* access (including Windows-specific behavior), and does not perform any token redaction.
|
|
118
|
+
*
|
|
119
|
+
* @param flaggedCount - The number of flagged accounts to show; if greater than zero the count is appended in parentheses.
|
|
120
|
+
* @returns The resulting label string: the base label when `flaggedCount` is 0 or less, otherwise the base label followed by ` (count)`.
|
|
121
|
+
*/
|
|
122
|
+
export declare function formatCheckFlaggedLabel(flaggedCount: number): string;
|
|
123
|
+
//# sourceMappingURL=copy.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"copy.d.ts","sourceRoot":"","sources":["../../../lib/ui/copy.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,OAAO;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;uCAmDI,MAAM;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;6CAwDA,MAAM;;;;CAK1B,CAAC;AAEX;;;;;;;;GAQG;AACH,wBAAgB,uBAAuB,CAAC,YAAY,EAAE,MAAM,GAAG,MAAM,CAIpE"}
|
|
@@ -0,0 +1,127 @@
|
|
|
1
|
+
export const UI_COPY = {
|
|
2
|
+
mainMenu: {
|
|
3
|
+
title: "Accounts Dashboard",
|
|
4
|
+
searchSubtitlePrefix: "Search:",
|
|
5
|
+
quickStart: "Quick Actions",
|
|
6
|
+
addAccount: "Add New Account",
|
|
7
|
+
checkAccounts: "Run Health Check",
|
|
8
|
+
bestAccount: "Pick Best Account",
|
|
9
|
+
fixIssues: "Auto-Repair Issues",
|
|
10
|
+
settings: "Settings",
|
|
11
|
+
moreChecks: "Advanced Checks",
|
|
12
|
+
refreshChecks: "Refresh All Accounts",
|
|
13
|
+
checkFlagged: "Check Problem Accounts",
|
|
14
|
+
accounts: "Saved Accounts",
|
|
15
|
+
loadingLimits: "Fetching account limits...",
|
|
16
|
+
noSearchMatches: "No accounts match your search",
|
|
17
|
+
dangerZone: "Danger Zone",
|
|
18
|
+
removeAllAccounts: "Delete All Accounts",
|
|
19
|
+
helpCompact: "↑↓ Move | Enter Select | / Search | 1-9 Switch | Q Back",
|
|
20
|
+
helpDetailed: "Arrow keys move, Enter selects, / searches, 1-9 switches account, Q goes back",
|
|
21
|
+
},
|
|
22
|
+
accountDetails: {
|
|
23
|
+
back: "Back",
|
|
24
|
+
enable: "Enable Account",
|
|
25
|
+
disable: "Disable Account",
|
|
26
|
+
setCurrent: "Set As Current",
|
|
27
|
+
refresh: "Re-Login",
|
|
28
|
+
remove: "Delete Account",
|
|
29
|
+
help: "↑↓ Move | Enter Select | S Use | R Sign In | D Delete | Q Back",
|
|
30
|
+
},
|
|
31
|
+
oauth: {
|
|
32
|
+
chooseModeTitle: "Sign-In Method",
|
|
33
|
+
chooseModeSubtitle: "How do you want to sign in?",
|
|
34
|
+
openBrowser: "Open Browser (Easy)",
|
|
35
|
+
manualMode: "Manual / Incognito",
|
|
36
|
+
back: "Back",
|
|
37
|
+
chooseModeHelp: "↑↓ Move | Enter Select | 1 Easy | 2 Manual | Q Back",
|
|
38
|
+
goTo: "Go to:",
|
|
39
|
+
copyOk: "Login link copied.",
|
|
40
|
+
copyFail: "Could not copy login link.",
|
|
41
|
+
pastePrompt: "Paste callback URL or code here (Q to cancel):",
|
|
42
|
+
browserOpened: "Browser opened.",
|
|
43
|
+
browserOpenFail: "Could not open browser. Use this link:",
|
|
44
|
+
waitingCallback: "Waiting for login callback on localhost:1455...",
|
|
45
|
+
callbackMissed: "No callback received. Paste manually.",
|
|
46
|
+
cancelled: "Sign-in cancelled.",
|
|
47
|
+
cancelledBackToMenu: "Sign-in cancelled. Going back to menu.",
|
|
48
|
+
},
|
|
49
|
+
returnFlow: {
|
|
50
|
+
continuePrompt: "Press Enter to go back.",
|
|
51
|
+
actionFailedPrompt: "Action failed. Press Enter to go back.",
|
|
52
|
+
autoReturn: (seconds) => `Returning in ${seconds}s... Press any key to pause.`,
|
|
53
|
+
paused: "Paused. Press any key to continue.",
|
|
54
|
+
working: "Running...",
|
|
55
|
+
done: "Done.",
|
|
56
|
+
failed: "Failed.",
|
|
57
|
+
},
|
|
58
|
+
settings: {
|
|
59
|
+
title: "Settings",
|
|
60
|
+
subtitle: "Customize menu, behavior, and backend",
|
|
61
|
+
help: "↑↓ Move | Enter Select | Q Back",
|
|
62
|
+
sectionTitle: "Basic",
|
|
63
|
+
advancedTitle: "Advanced",
|
|
64
|
+
exitTitle: "Back",
|
|
65
|
+
accountList: "Account List View",
|
|
66
|
+
summaryFields: "Summary Line",
|
|
67
|
+
behavior: "Menu Behavior",
|
|
68
|
+
theme: "Color Theme",
|
|
69
|
+
backend: "Backend Controls",
|
|
70
|
+
back: "Back",
|
|
71
|
+
previewHeading: "Live Preview",
|
|
72
|
+
displayHeading: "Options",
|
|
73
|
+
resetDefault: "Reset to Default",
|
|
74
|
+
saveAndBack: "Save and Back",
|
|
75
|
+
backNoSave: "Back Without Saving",
|
|
76
|
+
accountListTitle: "Account List View",
|
|
77
|
+
accountListSubtitle: "Choose row details and optional smart sorting",
|
|
78
|
+
accountListHelp: "Enter Toggle | Number Toggle | M Sort | L Layout | S Save | Q Save+Back",
|
|
79
|
+
summaryTitle: "Account Details Row",
|
|
80
|
+
summarySubtitle: "Choose and order detail fields",
|
|
81
|
+
summaryHelp: "Enter Toggle | 1-3 Toggle | [ ] Reorder | S Save | Q Save+Back",
|
|
82
|
+
behaviorTitle: "Return Behavior",
|
|
83
|
+
behaviorSubtitle: "Control how result screens return",
|
|
84
|
+
behaviorHelp: "Enter Select | 1-3 Delay | P Pause | L AutoFetch | F Status | T TTL | S Save | Q Save+Back",
|
|
85
|
+
themeTitle: "Color Theme",
|
|
86
|
+
themeSubtitle: "Pick base color and accent",
|
|
87
|
+
themeHelp: "Enter Select | 1-2 Base | S Save | Q Save+Back",
|
|
88
|
+
backendTitle: "Backend Controls",
|
|
89
|
+
backendSubtitle: "Tune sync, retry, and limit behavior",
|
|
90
|
+
backendHelp: "Enter Open | 1-4 Category | S Save | R Reset | Q Save+Back",
|
|
91
|
+
backendCategoriesHeading: "Categories",
|
|
92
|
+
backendCategoryTitle: "Backend Category",
|
|
93
|
+
backendCategoryHelp: "Enter Toggle/Adjust | +/- or [ ] Number | 1-9 Toggle | R Reset | Q Back",
|
|
94
|
+
backendToggleHeading: "Switches",
|
|
95
|
+
backendNumberHeading: "Numbers",
|
|
96
|
+
backendDecrease: "Decrease Focused Value",
|
|
97
|
+
backendIncrease: "Increase Focused Value",
|
|
98
|
+
backendResetCategory: "Reset Category",
|
|
99
|
+
backendBackToCategories: "Back to Categories",
|
|
100
|
+
baseTheme: "Base Color",
|
|
101
|
+
accentColor: "Accent Color",
|
|
102
|
+
actionTiming: "Auto Return Delay",
|
|
103
|
+
moveUp: "Move Focused Field Up",
|
|
104
|
+
moveDown: "Move Focused Field Down",
|
|
105
|
+
},
|
|
106
|
+
fallback: {
|
|
107
|
+
addAnotherTip: "Tip: Use private mode or sign out before adding another account.",
|
|
108
|
+
addAnotherQuestion: (count) => `Add another account? (${count} added) (y/n): `,
|
|
109
|
+
selectModePrompt: "(a) add, (c) check, (b) best, fi(x), (s) settings, (d) deep, (g) problem, (f) fresh, (q) back [a/c/b/x/s/d/g/f/q]: ",
|
|
110
|
+
invalidModePrompt: "Use one of: a, c, b, x, s, d, g, f, q.",
|
|
111
|
+
},
|
|
112
|
+
};
|
|
113
|
+
/**
|
|
114
|
+
* Builds the "Check Problem Accounts" label, appending the flagged count when greater than zero.
|
|
115
|
+
*
|
|
116
|
+
* This function is pure and has no side effects, is safe for concurrent use, performs no filesystem
|
|
117
|
+
* access (including Windows-specific behavior), and does not perform any token redaction.
|
|
118
|
+
*
|
|
119
|
+
* @param flaggedCount - The number of flagged accounts to show; if greater than zero the count is appended in parentheses.
|
|
120
|
+
* @returns The resulting label string: the base label when `flaggedCount` is 0 or less, otherwise the base label followed by ` (count)`.
|
|
121
|
+
*/
|
|
122
|
+
export function formatCheckFlaggedLabel(flaggedCount) {
|
|
123
|
+
return flaggedCount > 0
|
|
124
|
+
? `${UI_COPY.mainMenu.checkFlagged} (${flaggedCount})`
|
|
125
|
+
: UI_COPY.mainMenu.checkFlagged;
|
|
126
|
+
}
|
|
127
|
+
//# sourceMappingURL=copy.js.map
|
|
@@ -0,0 +1 @@
|
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E;QAC9F,oBAAoB,EAAE,UAAU;QAChC,oBAAoB,EAAE,SAAS;QAC/B,eAAe,EAAE,wBAAwB;QACzC,eAAe,EAAE,wBAAwB;QACzC,oBAAoB,EAAE,gBAAgB;QACtC,uBAAuB,EAAE,oBAAoB;QAC7C,SAAS,EAAE,YAAY;QACvB,WAAW,EAAE,cAAc;QAC3B,YAAY,EAAE,mBAAmB;QACjC,MAAM,EAAE,uBAAuB;QAC/B,QAAQ,EAAE,yBAAyB;KACnC;IACD,QAAQ,EAAE;QACT,aAAa,EAAE,kEAAkE;QACjF,kBAAkB,EAAE,CAAC,KAAa,EAAE,EAAE,CAAC,yBAAyB,KAAK,iBAAiB;QACtF,gBAAgB,EACf,qHAAqH;QACtH,iBAAiB,EAAE,wCAAwC;KAC3D;CACQ,CAAC;AAEX;;;;;;;;GAQG;AACH,MAAM,UAAU,uBAAuB,CAAC,YAAoB;IAC3D,OAAO,YAAY,GAAG,CAAC;QACtB,CAAC,CAAC,GAAG,OAAO,CAAC,QAAQ,CAAC,YAAY,KAAK,YAAY,GAAG;QACtD,CAAC,CAAC,OAAO,CAAC,QAAQ,CAAC,YAAY,CAAC;AAClC,CAAC"}
|
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
import type { UiRuntimeOptions } from "./runtime.js";
|
|
2
|
+
export type UiTextTone = "primary" | "heading" | "accent" | "muted" | "success" | "warning" | "danger" | "normal";
|
|
3
|
+
/**
|
|
4
|
+
* Colorize a text string according to the UI theme and tone.
|
|
5
|
+
*
|
|
6
|
+
* If `ui.v2Enabled` is false or the tone maps to no color, the original `text` is returned unchanged.
|
|
7
|
+
*
|
|
8
|
+
* Concurrency: pure and side-effect-free; safe to call concurrently.
|
|
9
|
+
* Filesystem: performs no I/O and behaves identically on Windows and other platforms.
|
|
10
|
+
* Token redaction: this function only wraps `text` with theme color tokens and does not redact or alter token contents.
|
|
11
|
+
*
|
|
12
|
+
* @param ui - Runtime UI options (used to determine theme colors and whether v2 styling is enabled)
|
|
13
|
+
* @param text - The text to colorize
|
|
14
|
+
* @param tone - The text tone to apply; when the tone maps to no color (e.g., "normal") the text is returned as-is
|
|
15
|
+
* @returns The input `text` wrapped with the theme color start token for `tone` and the theme reset token, or the original `text` if no color is applied
|
|
16
|
+
*/
|
|
17
|
+
export declare function paintUiText(ui: UiRuntimeOptions, text: string, tone?: UiTextTone): string;
|
|
18
|
+
export declare function formatUiHeader(ui: UiRuntimeOptions, title: string): string[];
|
|
19
|
+
export declare function formatUiSection(ui: UiRuntimeOptions, title: string): string[];
|
|
20
|
+
export declare function formatUiItem(ui: UiRuntimeOptions, text: string, tone?: UiTextTone): string;
|
|
21
|
+
/**
|
|
22
|
+
* Format a key/value pair for display, applying muted styling to the key and a configurable tone to the value when v2 UI is enabled.
|
|
23
|
+
*
|
|
24
|
+
* @param ui - Runtime UI options that control theming and v2 behavior
|
|
25
|
+
* @param key - The label for the value; a trailing colon is added when v2 is enabled
|
|
26
|
+
* @param value - The value text to display
|
|
27
|
+
* @param valueTone - Tone to apply to the value (e.g., "accent", "success"); "normal" leaves the value uncolored
|
|
28
|
+
*
|
|
29
|
+
* Concurrency: pure and safe to call concurrently.
|
|
30
|
+
* Windows: ANSI or truecolor sequences may not be interpreted on older Windows terminals.
|
|
31
|
+
* Redaction: this function does not redact sensitive tokens; callers must provide already-redacted values if needed.
|
|
32
|
+
*
|
|
33
|
+
* @returns The formatted key/value string, optionally wrapped with theme color sequences when v2 is enabled
|
|
34
|
+
*/
|
|
35
|
+
export declare function formatUiKeyValue(ui: UiRuntimeOptions, key: string, value: string, valueTone?: UiTextTone): string;
|
|
36
|
+
/**
|
|
37
|
+
* Format a badge label for the UI, applying tone-specific styling when v2 UI is enabled.
|
|
38
|
+
*
|
|
39
|
+
* @param ui - Runtime UI options that control styling, color profile, and v2 enablement
|
|
40
|
+
* @param label - Text to display inside the badge (will be wrapped in square brackets)
|
|
41
|
+
* @param tone - Visual tone for the badge; must not be `"normal"` or `"heading"`
|
|
42
|
+
* @returns The badge string; when v2 is disabled this is `"[label]"`, otherwise the label wrapped with start/end styling sequences
|
|
43
|
+
*
|
|
44
|
+
* @remarks
|
|
45
|
+
* Concurrency: safe to call concurrently; function is pure with respect to provided inputs.
|
|
46
|
+
* Windows filesystem: output contains ANSI/ANSI256/truecolor escape sequences when v2 is enabled—terminal support may vary on Windows consoles.
|
|
47
|
+
* Token redaction: this function does not perform any secret/token redaction; callers should redact sensitive values in `label` before calling if needed.
|
|
48
|
+
*/
|
|
49
|
+
export declare function formatUiBadge(ui: UiRuntimeOptions, label: string, tone?: Exclude<UiTextTone, "normal" | "heading">): string;
|
|
50
|
+
/**
|
|
51
|
+
* Selects a UI tone representing quota health based on remaining percentage.
|
|
52
|
+
*
|
|
53
|
+
* @param leftPercent - Percentage of quota remaining (typically 0–100)
|
|
54
|
+
* @returns `'success'` if `leftPercent` > 35, `'warning'` if `leftPercent` ≤ 35 and > 15, `'danger'` if `leftPercent` ≤ 15
|
|
55
|
+
*
|
|
56
|
+
* @remarks
|
|
57
|
+
* Concurrency: pure and side-effect-free; safe to call from concurrent contexts.
|
|
58
|
+
* Windows filesystem: no filesystem interaction.
|
|
59
|
+
* Token redaction: does not handle or emit sensitive tokens.
|
|
60
|
+
*/
|
|
61
|
+
export declare function quotaToneFromLeftPercent(leftPercent: number): Extract<UiTextTone, "success" | "warning" | "danger">;
|
|
62
|
+
//# sourceMappingURL=format.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"format.d.ts","sourceRoot":"","sources":["../../../lib/ui/format.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,cAAc,CAAC;AAErD,MAAM,MAAM,UAAU,GACnB,SAAS,GACT,SAAS,GACT,QAAQ,GACR,OAAO,GACP,SAAS,GACT,SAAS,GACT,QAAQ,GACR,QAAQ,CAAC;AAuGZ;;;;;;;;;;;;;GAaG;AACH,wBAAgB,WAAW,CAAC,EAAE,EAAE,gBAAgB,EAAE,IAAI,EAAE,MAAM,EAAE,IAAI,GAAE,UAAqB,GAAG,MAAM,CAKnG;AAED,wBAAgB,cAAc,CAAC,EAAE,EAAE,gBAAgB,EAAE,KAAK,EAAE,MAAM,GAAG,MAAM,EAAE,CAO5E;AAED,wBAAgB,eAAe,CAAC,EAAE,EAAE,gBAAgB,EAAE,KAAK,EAAE,MAAM,GAAG,MAAM,EAAE,CAG7E;AAED,wBAAgB,YAAY,CAC3B,EAAE,EAAE,gBAAgB,EACpB,IAAI,EAAE,MAAM,EACZ,IAAI,GAAE,UAAqB,GACzB,MAAM,CAIR;AAED;;;;;;;;;;;;;GAaG;AACH,wBAAgB,gBAAgB,CAC/B,EAAE,EAAE,gBAAgB,EACpB,GAAG,EAAE,MAAM,EACX,KAAK,EAAE,MAAM,EACb,SAAS,GAAE,UAAqB,GAC9B,MAAM,CAKR;AAED;;;;;;;;;;;;GAYG;AACH,wBAAgB,aAAa,CAC5B,EAAE,EAAE,gBAAgB,EACpB,KAAK,EAAE,MAAM,EACb,IAAI,GAAE,OAAO,CAAC,UAAU,EAAE,QAAQ,GAAG,SAAS,CAAY,GACxD,MAAM,CAKR;AAED;;;;;;;;;;GAUG;AACH,wBAAgB,wBAAwB,CACvC,WAAW,EAAE,MAAM,GACjB,OAAO,CAAC,UAAU,EAAE,SAAS,GAAG,SAAS,GAAG,QAAQ,CAAC,CAIvD"}
|
|
@@ -0,0 +1,205 @@
|
|
|
1
|
+
const TONE_TO_COLOR = {
|
|
2
|
+
primary: "primary",
|
|
3
|
+
heading: "heading",
|
|
4
|
+
accent: "accent",
|
|
5
|
+
muted: "muted",
|
|
6
|
+
success: "success",
|
|
7
|
+
warning: "warning",
|
|
8
|
+
danger: "danger",
|
|
9
|
+
normal: null,
|
|
10
|
+
};
|
|
11
|
+
/**
|
|
12
|
+
* Produce the ANSI/ANSI256/truecolor start and theme reset sequences for a badge given UI options and tone.
|
|
13
|
+
*
|
|
14
|
+
* @param ui - Runtime UI options used to select color profile, palette, accent, and the theme reset sequence
|
|
15
|
+
* @param tone - Badge tone: "primary", "accent", "success", "warning", "danger", or "muted"
|
|
16
|
+
* @returns The `start` escape sequence to begin badge styling and the `end` reset sequence from the theme
|
|
17
|
+
*
|
|
18
|
+
* Concurrency: pure and safe for concurrent use.
|
|
19
|
+
* Windows consoles: returned ANSI sequences may not be interpreted on older Windows terminals and can appear verbatim.
|
|
20
|
+
* Token redaction: returned strings contain raw ANSI codes and should be treated as presentation data (avoid leaking in sensitive logs).
|
|
21
|
+
*/
|
|
22
|
+
function badgeStyleForTone(ui, tone) {
|
|
23
|
+
const end = ui.theme.colors.reset;
|
|
24
|
+
const isBlue = ui.palette === "blue";
|
|
25
|
+
const accent = ui.accent;
|
|
26
|
+
if (ui.colorProfile === "truecolor") {
|
|
27
|
+
const accentStart = (() => {
|
|
28
|
+
if (accent === "cyan")
|
|
29
|
+
return "\x1b[48;2;8;89;106m\x1b[38;2;224;242;254m\x1b[1m";
|
|
30
|
+
if (accent === "blue")
|
|
31
|
+
return "\x1b[48;2;30;64;175m\x1b[38;2;219;234;254m\x1b[1m";
|
|
32
|
+
if (accent === "yellow")
|
|
33
|
+
return "\x1b[48;2;120;53;15m\x1b[38;2;255;247;237m\x1b[1m";
|
|
34
|
+
return "\x1b[48;2;20;83;45m\x1b[38;2;220;252;231m\x1b[1m";
|
|
35
|
+
})();
|
|
36
|
+
const successStart = isBlue
|
|
37
|
+
? "\x1b[48;2;30;64;175m\x1b[38;2;219;234;254m\x1b[1m"
|
|
38
|
+
: "\x1b[48;2;20;83;45m\x1b[38;2;220;252;231m\x1b[1m";
|
|
39
|
+
switch (tone) {
|
|
40
|
+
case "primary":
|
|
41
|
+
case "accent":
|
|
42
|
+
return { start: accentStart, end };
|
|
43
|
+
case "success":
|
|
44
|
+
return { start: successStart, end };
|
|
45
|
+
case "warning":
|
|
46
|
+
return { start: "\x1b[48;2;120;53;15m\x1b[38;2;255;247;237m\x1b[1m", end };
|
|
47
|
+
case "danger":
|
|
48
|
+
return { start: "\x1b[48;2;127;29;29m\x1b[38;2;254;226;226m\x1b[1m", end };
|
|
49
|
+
case "muted":
|
|
50
|
+
return { start: "\x1b[48;2;51;65;85m\x1b[38;2;226;232;240m\x1b[1m", end };
|
|
51
|
+
}
|
|
52
|
+
}
|
|
53
|
+
if (ui.colorProfile === "ansi256") {
|
|
54
|
+
const accentStart = (() => {
|
|
55
|
+
if (accent === "cyan")
|
|
56
|
+
return "\x1b[48;5;23m\x1b[38;5;159m\x1b[1m";
|
|
57
|
+
if (accent === "blue")
|
|
58
|
+
return "\x1b[48;5;19m\x1b[38;5;153m\x1b[1m";
|
|
59
|
+
if (accent === "yellow")
|
|
60
|
+
return "\x1b[48;5;94m\x1b[38;5;230m\x1b[1m";
|
|
61
|
+
return "\x1b[48;5;22m\x1b[38;5;157m\x1b[1m";
|
|
62
|
+
})();
|
|
63
|
+
const successStart = isBlue
|
|
64
|
+
? "\x1b[48;5;19m\x1b[38;5;153m\x1b[1m"
|
|
65
|
+
: "\x1b[48;5;22m\x1b[38;5;157m\x1b[1m";
|
|
66
|
+
switch (tone) {
|
|
67
|
+
case "primary":
|
|
68
|
+
case "accent":
|
|
69
|
+
return { start: accentStart, end };
|
|
70
|
+
case "success":
|
|
71
|
+
return { start: successStart, end };
|
|
72
|
+
case "warning":
|
|
73
|
+
return { start: "\x1b[48;5;94m\x1b[38;5;230m\x1b[1m", end };
|
|
74
|
+
case "danger":
|
|
75
|
+
return { start: "\x1b[48;5;88m\x1b[38;5;224m\x1b[1m", end };
|
|
76
|
+
case "muted":
|
|
77
|
+
return { start: "\x1b[48;5;240m\x1b[38;5;255m\x1b[1m", end };
|
|
78
|
+
}
|
|
79
|
+
}
|
|
80
|
+
const accentStart = (() => {
|
|
81
|
+
if (accent === "cyan")
|
|
82
|
+
return "\x1b[46m\x1b[30m\x1b[1m";
|
|
83
|
+
if (accent === "blue")
|
|
84
|
+
return "\x1b[44m\x1b[97m\x1b[1m";
|
|
85
|
+
if (accent === "yellow")
|
|
86
|
+
return "\x1b[43m\x1b[30m\x1b[1m";
|
|
87
|
+
return "\x1b[42m\x1b[30m\x1b[1m";
|
|
88
|
+
})();
|
|
89
|
+
const successStart = isBlue ? "\x1b[44m\x1b[97m\x1b[1m" : "\x1b[42m\x1b[30m\x1b[1m";
|
|
90
|
+
switch (tone) {
|
|
91
|
+
case "primary":
|
|
92
|
+
case "accent":
|
|
93
|
+
return { start: accentStart, end };
|
|
94
|
+
case "success":
|
|
95
|
+
return { start: successStart, end };
|
|
96
|
+
case "warning":
|
|
97
|
+
return { start: "\x1b[43m\x1b[30m\x1b[1m", end };
|
|
98
|
+
case "danger":
|
|
99
|
+
return { start: "\x1b[41m\x1b[97m\x1b[1m", end };
|
|
100
|
+
case "muted":
|
|
101
|
+
return { start: "\x1b[100m\x1b[97m\x1b[1m", end };
|
|
102
|
+
}
|
|
103
|
+
}
|
|
104
|
+
/**
|
|
105
|
+
* Colorize a text string according to the UI theme and tone.
|
|
106
|
+
*
|
|
107
|
+
* If `ui.v2Enabled` is false or the tone maps to no color, the original `text` is returned unchanged.
|
|
108
|
+
*
|
|
109
|
+
* Concurrency: pure and side-effect-free; safe to call concurrently.
|
|
110
|
+
* Filesystem: performs no I/O and behaves identically on Windows and other platforms.
|
|
111
|
+
* Token redaction: this function only wraps `text` with theme color tokens and does not redact or alter token contents.
|
|
112
|
+
*
|
|
113
|
+
* @param ui - Runtime UI options (used to determine theme colors and whether v2 styling is enabled)
|
|
114
|
+
* @param text - The text to colorize
|
|
115
|
+
* @param tone - The text tone to apply; when the tone maps to no color (e.g., "normal") the text is returned as-is
|
|
116
|
+
* @returns The input `text` wrapped with the theme color start token for `tone` and the theme reset token, or the original `text` if no color is applied
|
|
117
|
+
*/
|
|
118
|
+
export function paintUiText(ui, text, tone = "normal") {
|
|
119
|
+
if (!ui.v2Enabled)
|
|
120
|
+
return text;
|
|
121
|
+
const colorKey = TONE_TO_COLOR[tone];
|
|
122
|
+
if (!colorKey)
|
|
123
|
+
return text;
|
|
124
|
+
return `${ui.theme.colors[colorKey]}${text}${ui.theme.colors.reset}`;
|
|
125
|
+
}
|
|
126
|
+
export function formatUiHeader(ui, title) {
|
|
127
|
+
if (!ui.v2Enabled)
|
|
128
|
+
return [title];
|
|
129
|
+
const divider = "-".repeat(Math.max(8, title.length));
|
|
130
|
+
return [
|
|
131
|
+
paintUiText(ui, title, "heading"),
|
|
132
|
+
paintUiText(ui, divider, "muted"),
|
|
133
|
+
];
|
|
134
|
+
}
|
|
135
|
+
export function formatUiSection(ui, title) {
|
|
136
|
+
if (!ui.v2Enabled)
|
|
137
|
+
return [title];
|
|
138
|
+
return [paintUiText(ui, title, "accent")];
|
|
139
|
+
}
|
|
140
|
+
export function formatUiItem(ui, text, tone = "normal") {
|
|
141
|
+
if (!ui.v2Enabled)
|
|
142
|
+
return `- ${text}`;
|
|
143
|
+
const bullet = paintUiText(ui, ui.theme.glyphs.bullet, "muted");
|
|
144
|
+
return `${bullet} ${paintUiText(ui, text, tone)}`;
|
|
145
|
+
}
|
|
146
|
+
/**
|
|
147
|
+
* Format a key/value pair for display, applying muted styling to the key and a configurable tone to the value when v2 UI is enabled.
|
|
148
|
+
*
|
|
149
|
+
* @param ui - Runtime UI options that control theming and v2 behavior
|
|
150
|
+
* @param key - The label for the value; a trailing colon is added when v2 is enabled
|
|
151
|
+
* @param value - The value text to display
|
|
152
|
+
* @param valueTone - Tone to apply to the value (e.g., "accent", "success"); "normal" leaves the value uncolored
|
|
153
|
+
*
|
|
154
|
+
* Concurrency: pure and safe to call concurrently.
|
|
155
|
+
* Windows: ANSI or truecolor sequences may not be interpreted on older Windows terminals.
|
|
156
|
+
* Redaction: this function does not redact sensitive tokens; callers must provide already-redacted values if needed.
|
|
157
|
+
*
|
|
158
|
+
* @returns The formatted key/value string, optionally wrapped with theme color sequences when v2 is enabled
|
|
159
|
+
*/
|
|
160
|
+
export function formatUiKeyValue(ui, key, value, valueTone = "normal") {
|
|
161
|
+
if (!ui.v2Enabled)
|
|
162
|
+
return `${key}: ${value}`;
|
|
163
|
+
const keyText = paintUiText(ui, `${key}:`, "muted");
|
|
164
|
+
const valueText = paintUiText(ui, value, valueTone);
|
|
165
|
+
return `${keyText} ${valueText}`;
|
|
166
|
+
}
|
|
167
|
+
/**
|
|
168
|
+
* Format a badge label for the UI, applying tone-specific styling when v2 UI is enabled.
|
|
169
|
+
*
|
|
170
|
+
* @param ui - Runtime UI options that control styling, color profile, and v2 enablement
|
|
171
|
+
* @param label - Text to display inside the badge (will be wrapped in square brackets)
|
|
172
|
+
* @param tone - Visual tone for the badge; must not be `"normal"` or `"heading"`
|
|
173
|
+
* @returns The badge string; when v2 is disabled this is `"[label]"`, otherwise the label wrapped with start/end styling sequences
|
|
174
|
+
*
|
|
175
|
+
* @remarks
|
|
176
|
+
* Concurrency: safe to call concurrently; function is pure with respect to provided inputs.
|
|
177
|
+
* Windows filesystem: output contains ANSI/ANSI256/truecolor escape sequences when v2 is enabled—terminal support may vary on Windows consoles.
|
|
178
|
+
* Token redaction: this function does not perform any secret/token redaction; callers should redact sensitive values in `label` before calling if needed.
|
|
179
|
+
*/
|
|
180
|
+
export function formatUiBadge(ui, label, tone = "accent") {
|
|
181
|
+
const text = `[${label}]`;
|
|
182
|
+
if (!ui.v2Enabled)
|
|
183
|
+
return text;
|
|
184
|
+
const style = badgeStyleForTone(ui, tone);
|
|
185
|
+
return `${style.start}${text}${style.end}`;
|
|
186
|
+
}
|
|
187
|
+
/**
|
|
188
|
+
* Selects a UI tone representing quota health based on remaining percentage.
|
|
189
|
+
*
|
|
190
|
+
* @param leftPercent - Percentage of quota remaining (typically 0–100)
|
|
191
|
+
* @returns `'success'` if `leftPercent` > 35, `'warning'` if `leftPercent` ≤ 35 and > 15, `'danger'` if `leftPercent` ≤ 15
|
|
192
|
+
*
|
|
193
|
+
* @remarks
|
|
194
|
+
* Concurrency: pure and side-effect-free; safe to call from concurrent contexts.
|
|
195
|
+
* Windows filesystem: no filesystem interaction.
|
|
196
|
+
* Token redaction: does not handle or emit sensitive tokens.
|
|
197
|
+
*/
|
|
198
|
+
export function quotaToneFromLeftPercent(leftPercent) {
|
|
199
|
+
if (leftPercent <= 15)
|
|
200
|
+
return "danger";
|
|
201
|
+
if (leftPercent <= 35)
|
|
202
|
+
return "warning";
|
|
203
|
+
return "success";
|
|
204
|
+
}
|
|
205
|
+
//# sourceMappingURL=format.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"format.js","sourceRoot":"","sources":["../../../lib/ui/format.ts"],"names":[],"mappings":"AAYA,MAAM,aAAa,GAAyE;IAC3F,OAAO,EAAE,SAAS;IAClB,OAAO,EAAE,SAAS;IAClB,MAAM,EAAE,QAAQ;IAChB,KAAK,EAAE,OAAO;IACd,OAAO,EAAE,SAAS;IAClB,OAAO,EAAE,SAAS;IAClB,MAAM,EAAE,QAAQ;IAChB,MAAM,EAAE,IAAI;CACZ,CAAC;AAEF;;;;;;;;;;GAUG;AACH,SAAS,iBAAiB,CACzB,EAAoB,EACpB,IAA+C;IAE/C,MAAM,GAAG,GAAG,EAAE,CAAC,KAAK,CAAC,MAAM,CAAC,KAAK,CAAC;IAClC,MAAM,MAAM,GAAG,EAAE,CAAC,OAAO,KAAK,MAAM,CAAC;IACrC,MAAM,MAAM,GAAG,EAAE,CAAC,MAAM,CAAC;IACzB,IAAI,EAAE,CAAC,YAAY,KAAK,WAAW,EAAE,CAAC;QACrC,MAAM,WAAW,GAAG,CAAC,GAAG,EAAE;YACzB,IAAI,MAAM,KAAK,MAAM;gBAAE,OAAO,kDAAkD,CAAC;YACjF,IAAI,MAAM,KAAK,MAAM;gBAAE,OAAO,mDAAmD,CAAC;YAClF,IAAI,MAAM,KAAK,QAAQ;gBAAE,OAAO,mDAAmD,CAAC;YACpF,OAAO,kDAAkD,CAAC;QAC3D,CAAC,CAAC,EAAE,CAAC;QACL,MAAM,YAAY,GAAG,MAAM;YAC1B,CAAC,CAAC,mDAAmD;YACrD,CAAC,CAAC,kDA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;IAEhC,IAAI,CAAC,EAAE,CAAC,SAAS;QAAE,OAAO,GAAG,GAAG,KAAK,KAAK,EAAE,CAAC;IAC7C,MAAM,OAAO,GAAG,WAAW,CAAC,EAAE,EAAE,GAAG,GAAG,GAAG,EAAE,OAAO,CAAC,CAAC;IACpD,MAAM,SAAS,GAAG,WAAW,CAAC,EAAE,EAAE,KAAK,EAAE,SAAS,CAAC,CAAC;IACpD,OAAO,GAAG,OAAO,IAAI,SAAS,EAAE,CAAC;AAClC,CAAC;AAED;;;;;;;;;;;;GAYG;AACH,MAAM,UAAU,aAAa,CAC5B,EAAoB,EACpB,KAAa,EACb,OAAkD,QAAQ;IAE1D,MAAM,IAAI,GAAG,IAAI,KAAK,GAAG,CAAC;IAC1B,IAAI,CAAC,EAAE,CAAC,SAAS;QAAE,OAAO,IAAI,CAAC;IAC/B,MAAM,KAAK,GAAG,iBAAiB,CAAC,EAAE,EAAE,IAAI,CAAC,CAAC;IAC1C,OAAO,GAAG,KAAK,CAAC,KAAK,GAAG,IAAI,GAAG,KAAK,CAAC,GAAG,EAAE,CAAC;AAC5C,CAAC;AAED;;;;;;;;;;GAUG;AACH,MAAM,UAAU,wBAAwB,CACvC,WAAmB;IAEnB,IAAI,WAAW,IAAI,EAAE;QAAE,OAAO,QAAQ,CAAC;IACvC,IAAI,WAAW,IAAI,EAAE;QAAE,OAAO,SAAS,CAAC;IACxC,OAAO,SAAS,CAAC;AAClB,CAAC"}
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
import { type UiColorProfile, type UiGlyphMode, type UiPalette, type UiAccent, type UiTheme } from "./theme.js";
|
|
2
|
+
export interface UiRuntimeOptions {
|
|
3
|
+
v2Enabled: boolean;
|
|
4
|
+
colorProfile: UiColorProfile;
|
|
5
|
+
glyphMode: UiGlyphMode;
|
|
6
|
+
palette: UiPalette;
|
|
7
|
+
accent: UiAccent;
|
|
8
|
+
theme: UiTheme;
|
|
9
|
+
}
|
|
10
|
+
/**
|
|
11
|
+
* Update UI runtime options and recompute the derived theme.
|
|
12
|
+
*
|
|
13
|
+
* Unspecified fields in `options` retain their current values; the exported `runtimeOptions`
|
|
14
|
+
* object is replaced with a new object containing the resolved fields and a newly created
|
|
15
|
+
* `theme` based on `colorProfile`, `glyphMode`, `palette`, and `accent`.
|
|
16
|
+
*
|
|
17
|
+
* Concurrency: callers should synchronize externally if multiple callers may update options
|
|
18
|
+
* concurrently (updates are a single replacement and may race). Filesystem: this function
|
|
19
|
+
* performs no filesystem operations and is unaffected by Windows filesystem semantics.
|
|
20
|
+
* Token handling: this function does not perform token redaction or logging—sensitive
|
|
21
|
+
* values should be redacted by the caller before passing them in.
|
|
22
|
+
*
|
|
23
|
+
* @param options - Partial runtime options (omit `theme`); any omitted fields keep their current values
|
|
24
|
+
* @returns The resolved `UiRuntimeOptions` including the recomputed `theme`
|
|
25
|
+
*/
|
|
26
|
+
export declare function setUiRuntimeOptions(options: Partial<Omit<UiRuntimeOptions, "theme">>): UiRuntimeOptions;
|
|
27
|
+
/**
|
|
28
|
+
* Accesses the current UI runtime options.
|
|
29
|
+
*
|
|
30
|
+
* The returned object reflects the current in-memory runtime configuration; concurrent callers may observe updates made by others, so external synchronization is recommended when mutating options. This function performs no filesystem I/O (including on Windows) and the runtime options contain no sensitive tokens that require redaction.
|
|
31
|
+
*
|
|
32
|
+
* @returns The current UiRuntimeOptions object
|
|
33
|
+
*/
|
|
34
|
+
export declare function getUiRuntimeOptions(): UiRuntimeOptions;
|
|
35
|
+
/**
|
|
36
|
+
* Reset the UI runtime options to the default configuration.
|
|
37
|
+
*
|
|
38
|
+
* This replaces the global runtime options with a fresh shallow copy of DEFAULT_OPTIONS. Concurrent callers may observe the updated options immediately; callers that need isolation should clone the returned object. This operation performs no filesystem access (including on Windows). The runtime options contain only configuration fields and do not include sensitive tokens.
|
|
39
|
+
*
|
|
40
|
+
* @returns The new runtime options object set to the defaults
|
|
41
|
+
*/
|
|
42
|
+
export declare function resetUiRuntimeOptions(): UiRuntimeOptions;
|
|
43
|
+
//# sourceMappingURL=runtime.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"runtime.d.ts","sourceRoot":"","sources":["../../../lib/ui/runtime.ts"],"names":[],"mappings":"AAAA,OAAO,EAEN,KAAK,cAAc,EACnB,KAAK,WAAW,EAChB,KAAK,SAAS,EACd,KAAK,QAAQ,EACb,KAAK,OAAO,EACZ,MAAM,YAAY,CAAC;AAEpB,MAAM,WAAW,gBAAgB;IAChC,SAAS,EAAE,OAAO,CAAC;IACnB,YAAY,EAAE,cAAc,CAAC;IAC7B,SAAS,EAAE,WAAW,CAAC;IACvB,OAAO,EAAE,SAAS,CAAC;IACnB,MAAM,EAAE,QAAQ,CAAC;IACjB,KAAK,EAAE,OAAO,CAAC;CACf;AAkBD;;;;;;;;;;;;;;;GAeG;AACH,wBAAgB,mBAAmB,CAClC,OAAO,EAAE,OAAO,CAAC,IAAI,CAAC,gBAAgB,EAAE,OAAO,CAAC,CAAC,GAC/C,gBAAgB,CAelB;AAED;;;;;;GAMG;AACH,wBAAgB,mBAAmB,IAAI,gBAAgB,CAEtD;AAED;;;;;;GAMG;AACH,wBAAgB,qBAAqB,IAAI,gBAAgB,CAGxD"}
|