cursor-switch 1.0.6 → 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.
Files changed (84) hide show
  1. package/README.md +76 -75
  2. package/SECURITY.md +22 -19
  3. package/bin/cswitch.js +31 -8
  4. package/dist/cli.d.ts +0 -4
  5. package/dist/cli.js +404 -225
  6. package/dist/core/account-store.d.ts +0 -7
  7. package/dist/core/account-store.js +22 -28
  8. package/dist/core/cdp-engine.d.ts +11 -49
  9. package/dist/core/cdp-engine.js +155 -110
  10. package/dist/core/config-store.d.ts +7 -6
  11. package/dist/core/config-store.js +33 -12
  12. package/dist/core/cursor-paths.d.ts +8 -18
  13. package/dist/core/cursor-paths.js +18 -37
  14. package/dist/core/dashboard-launcher.d.ts +2 -22
  15. package/dist/core/dashboard-launcher.js +10 -60
  16. package/dist/core/extract-client.d.ts +57 -0
  17. package/dist/core/extract-client.js +219 -0
  18. package/dist/core/extract-menu.d.ts +3 -0
  19. package/dist/core/extract-menu.js +360 -0
  20. package/dist/core/extract-service.d.ts +64 -0
  21. package/dist/core/extract-service.js +435 -0
  22. package/dist/core/fingerprint.d.ts +0 -4
  23. package/dist/core/fingerprint.js +0 -6
  24. package/dist/core/oauth-receiver.d.ts +1 -11
  25. package/dist/core/oauth-receiver.js +509 -527
  26. package/dist/core/official-api.d.ts +0 -17
  27. package/dist/core/official-api.js +4 -23
  28. package/dist/core/outlook-launcher.d.ts +0 -27
  29. package/dist/core/outlook-launcher.js +235 -261
  30. package/dist/core/process-manager.d.ts +0 -14
  31. package/dist/core/process-manager.js +7 -22
  32. package/dist/core/pure-login-service.d.ts +64 -28
  33. package/dist/core/pure-login-service.js +527 -346
  34. package/dist/core/refund-client.d.ts +0 -22
  35. package/dist/core/refund-client.js +7 -27
  36. package/dist/core/refund-service.d.ts +0 -16
  37. package/dist/core/refund-service.js +8 -34
  38. package/dist/core/safe-storage.d.ts +27 -0
  39. package/dist/core/safe-storage.js +284 -0
  40. package/dist/core/sqlite-bridge.d.ts +10 -11
  41. package/dist/core/sqlite-bridge.js +112 -47
  42. package/dist/core/storage-bridge.d.ts +14 -5
  43. package/dist/core/storage-bridge.js +84 -24
  44. package/dist/core/switch-orchestrator.d.ts +96 -0
  45. package/dist/core/switch-orchestrator.js +341 -0
  46. package/dist/core/token-exchange.d.ts +81 -0
  47. package/dist/core/token-exchange.js +275 -0
  48. package/dist/core/token-parser.d.ts +56 -20
  49. package/dist/core/token-parser.js +354 -43
  50. package/dist/core/update-checker.d.ts +1 -29
  51. package/dist/core/update-checker.js +28 -43
  52. package/dist/index.d.ts +1 -3
  53. package/dist/index.js +1 -3
  54. package/dist/menu.d.ts +0 -7
  55. package/dist/menu.js +445 -538
  56. package/dist/types.d.ts +12 -4
  57. package/dist/types.js +0 -4
  58. package/dist/utils/account-text-importer.d.ts +9 -0
  59. package/dist/utils/account-text-importer.js +96 -0
  60. package/dist/utils/browser-utils.d.ts +0 -24
  61. package/dist/utils/browser-utils.js +0 -57
  62. package/dist/utils/clipboard.d.ts +0 -4
  63. package/dist/utils/clipboard.js +0 -5
  64. package/dist/utils/credential-bundle-ui.d.ts +36 -0
  65. package/dist/utils/credential-bundle-ui.js +246 -0
  66. package/dist/utils/live-menu.d.ts +37 -9
  67. package/dist/utils/live-menu.js +510 -81
  68. package/dist/utils/plan-formatter.d.ts +0 -26
  69. package/dist/utils/plan-formatter.js +10 -44
  70. package/dist/utils/prompt-utils.d.ts +0 -18
  71. package/dist/utils/prompt-utils.js +0 -23
  72. package/dist/utils/proxy-bootstrap.d.ts +12 -0
  73. package/dist/utils/proxy-bootstrap.js +141 -0
  74. package/dist/utils/security.d.ts +2 -4
  75. package/dist/utils/security.js +36 -4
  76. package/dist/utils/table-renderer.d.ts +0 -4
  77. package/dist/utils/table-renderer.js +24 -8
  78. package/dist/utils/time-formatter.d.ts +0 -4
  79. package/dist/utils/time-formatter.js +0 -8
  80. package/dist/utils/token-preflight-ui.d.ts +28 -0
  81. package/dist/utils/token-preflight-ui.js +222 -0
  82. package/dist/utils/window-focus.d.ts +3 -0
  83. package/dist/utils/window-focus.js +106 -0
  84. package/package.json +12 -5
@@ -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 declare const quickSelect: import("@inquirer/type").Prompt<string, QuickMenuConfig>;
25
- export declare const liveMenu: import("@inquirer/type").Prompt<string, QuickMenuConfig>;
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 };