cursor-switch 1.0.7 → 1.0.8
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 +76 -75
- package/SECURITY.md +22 -19
- package/bin/cswitch.js +31 -8
- package/dist/cli.d.ts +0 -4
- package/dist/cli.js +404 -241
- package/dist/core/account-store.d.ts +0 -7
- package/dist/core/account-store.js +22 -28
- package/dist/core/cdp-engine.d.ts +11 -49
- package/dist/core/cdp-engine.js +155 -110
- package/dist/core/config-store.d.ts +7 -6
- package/dist/core/config-store.js +33 -12
- package/dist/core/cursor-paths.d.ts +8 -18
- package/dist/core/cursor-paths.js +18 -37
- package/dist/core/dashboard-launcher.d.ts +0 -20
- package/dist/core/dashboard-launcher.js +3 -53
- package/dist/core/extract-client.d.ts +57 -0
- package/dist/core/extract-client.js +219 -0
- package/dist/core/extract-menu.d.ts +3 -0
- package/dist/core/extract-menu.js +360 -0
- package/dist/core/extract-service.d.ts +64 -0
- package/dist/core/extract-service.js +435 -0
- package/dist/core/fingerprint.d.ts +0 -4
- package/dist/core/fingerprint.js +0 -6
- package/dist/core/oauth-receiver.d.ts +1 -11
- package/dist/core/oauth-receiver.js +509 -527
- package/dist/core/official-api.d.ts +0 -17
- package/dist/core/official-api.js +4 -23
- package/dist/core/outlook-launcher.d.ts +0 -31
- package/dist/core/outlook-launcher.js +194 -248
- package/dist/core/process-manager.d.ts +0 -14
- package/dist/core/process-manager.js +7 -22
- package/dist/core/pure-login-service.d.ts +54 -38
- package/dist/core/pure-login-service.js +483 -395
- package/dist/core/refund-client.d.ts +0 -22
- package/dist/core/refund-client.js +7 -27
- package/dist/core/refund-service.d.ts +0 -16
- package/dist/core/refund-service.js +8 -34
- package/dist/core/safe-storage.d.ts +27 -0
- package/dist/core/safe-storage.js +284 -0
- package/dist/core/sqlite-bridge.d.ts +10 -11
- package/dist/core/sqlite-bridge.js +112 -47
- package/dist/core/storage-bridge.d.ts +14 -5
- package/dist/core/storage-bridge.js +84 -24
- package/dist/core/switch-orchestrator.d.ts +96 -0
- package/dist/core/switch-orchestrator.js +341 -0
- package/dist/core/token-exchange.d.ts +81 -0
- package/dist/core/token-exchange.js +275 -0
- package/dist/core/token-parser.d.ts +56 -20
- package/dist/core/token-parser.js +354 -43
- package/dist/core/update-checker.d.ts +1 -29
- package/dist/core/update-checker.js +28 -43
- package/dist/index.d.ts +1 -3
- package/dist/index.js +1 -3
- package/dist/menu.d.ts +0 -7
- package/dist/menu.js +445 -548
- package/dist/types.d.ts +12 -4
- package/dist/types.js +0 -4
- package/dist/utils/account-text-importer.d.ts +9 -0
- package/dist/utils/account-text-importer.js +96 -0
- package/dist/utils/browser-utils.d.ts +0 -24
- package/dist/utils/browser-utils.js +0 -57
- package/dist/utils/clipboard.d.ts +0 -4
- package/dist/utils/clipboard.js +0 -5
- package/dist/utils/credential-bundle-ui.d.ts +36 -0
- package/dist/utils/credential-bundle-ui.js +246 -0
- package/dist/utils/live-menu.d.ts +37 -9
- package/dist/utils/live-menu.js +510 -81
- package/dist/utils/plan-formatter.d.ts +0 -26
- package/dist/utils/plan-formatter.js +10 -44
- package/dist/utils/prompt-utils.d.ts +0 -18
- package/dist/utils/prompt-utils.js +0 -23
- package/dist/utils/proxy-bootstrap.d.ts +12 -0
- package/dist/utils/proxy-bootstrap.js +141 -0
- package/dist/utils/security.d.ts +2 -4
- package/dist/utils/security.js +36 -4
- package/dist/utils/table-renderer.d.ts +0 -4
- package/dist/utils/table-renderer.js +24 -8
- package/dist/utils/time-formatter.d.ts +0 -4
- package/dist/utils/time-formatter.js +0 -8
- package/dist/utils/token-preflight-ui.d.ts +28 -0
- package/dist/utils/token-preflight-ui.js +222 -0
- package/dist/utils/window-focus.d.ts +3 -0
- package/dist/utils/window-focus.js +106 -0
- package/package.json +12 -5
- package/dist/core/welcome-offer-service.d.ts +0 -52
- package/dist/core/welcome-offer-service.js +0 -369
|
@@ -1,15 +1,11 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* 现代终端极速响应式交互菜单引擎 (Live & Quick TUI Engine)
|
|
3
|
-
* 支持:
|
|
4
|
-
* 1. 单键快捷直达 (按 0, 1, 2, s, q, Esc 键无需按回车直接触发秒选)
|
|
5
|
-
* 2. 方向键平滑巡览与动态说明 (↑↓ 移动光标,↵ 回车确认)
|
|
6
|
-
* 3. 毫秒级无闪烁响应式时钟 (主界面 HUD 每秒平滑走字)
|
|
7
|
-
*/
|
|
8
1
|
import { Separator } from '@inquirer/core';
|
|
2
|
+
import type { Context } from '@inquirer/type';
|
|
9
3
|
export interface QuickMenuChoice {
|
|
10
4
|
name: string;
|
|
11
5
|
value: string;
|
|
12
6
|
description?: string;
|
|
7
|
+
hint?: string;
|
|
8
|
+
shortHint?: string;
|
|
13
9
|
key?: string;
|
|
14
10
|
disabled?: boolean | string;
|
|
15
11
|
}
|
|
@@ -20,7 +16,39 @@ export interface QuickMenuConfig {
|
|
|
20
16
|
choices: Array<QuickMenuChoice | Separator>;
|
|
21
17
|
pageSize?: number;
|
|
22
18
|
tickIntervalMs?: number;
|
|
19
|
+
altScreen?: boolean;
|
|
23
20
|
}
|
|
24
|
-
export
|
|
25
|
-
|
|
21
|
+
export interface ViewportBudgetInput {
|
|
22
|
+
rawHeader: string;
|
|
23
|
+
message?: string;
|
|
24
|
+
description?: string;
|
|
25
|
+
requestedPageSize: number;
|
|
26
|
+
totalItems: number;
|
|
27
|
+
terminalRows: number;
|
|
28
|
+
terminalCols: number;
|
|
29
|
+
altScreen: boolean;
|
|
30
|
+
}
|
|
31
|
+
export interface ViewportLayout {
|
|
32
|
+
safeCols: number;
|
|
33
|
+
headerLines: string[];
|
|
34
|
+
promptLines: string[];
|
|
35
|
+
effectivePageSize: number;
|
|
36
|
+
footerLines: string[];
|
|
37
|
+
maxTotalLines: number;
|
|
38
|
+
}
|
|
39
|
+
export declare function measureAnsiWidth(text: string): number;
|
|
40
|
+
export declare function truncateAnsiLine(text: string, maxCols: number): string;
|
|
41
|
+
export declare function computeMenuViewport(input: ViewportBudgetInput): ViewportLayout;
|
|
42
|
+
export declare function leaveAltScreenIfActive(): void;
|
|
43
|
+
export declare function computeMenuPanelGeometry(items: Array<QuickMenuChoice | Separator>, headerLines: string[], safeCols: number): {
|
|
44
|
+
panelWidth: number;
|
|
45
|
+
nameColWidth: number;
|
|
46
|
+
};
|
|
47
|
+
export declare function computeHudInnerWidth(items: Array<QuickMenuChoice | Separator>, cols: number, minLinesWidth?: number): number;
|
|
48
|
+
export declare function resolveQuickShortcut(items: Array<QuickMenuChoice | Separator>, rawChar: string): {
|
|
49
|
+
index: number;
|
|
50
|
+
value: string;
|
|
51
|
+
} | null;
|
|
52
|
+
export declare function quickSelect(config: QuickMenuConfig, context?: Context): Promise<string>;
|
|
53
|
+
export declare const liveMenu: typeof quickSelect;
|
|
26
54
|
export { Separator };
|