opencode-account-manager 0.6.4 → 0.6.6

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (86) hide show
  1. package/README.md +235 -216
  2. package/README_VI.md +235 -216
  3. package/dist/cli.js +83 -0
  4. package/dist/cli.js.map +1 -1
  5. package/dist/core/config-store.d.ts +12 -0
  6. package/dist/core/config-store.d.ts.map +1 -1
  7. package/dist/core/config-store.js +98 -0
  8. package/dist/core/config-store.js.map +1 -1
  9. package/dist/core/health-log.d.ts +9 -0
  10. package/dist/core/health-log.d.ts.map +1 -0
  11. package/dist/core/health-log.js +154 -0
  12. package/dist/core/health-log.js.map +1 -0
  13. package/dist/core/health-oauth.d.ts +5 -0
  14. package/dist/core/health-oauth.d.ts.map +1 -0
  15. package/dist/core/health-oauth.js +147 -0
  16. package/dist/core/health-oauth.js.map +1 -0
  17. package/dist/core/health-orchestrator.d.ts +32 -0
  18. package/dist/core/health-orchestrator.d.ts.map +1 -0
  19. package/dist/core/health-orchestrator.js +148 -0
  20. package/dist/core/health-orchestrator.js.map +1 -0
  21. package/dist/core/health-utils.d.ts +15 -0
  22. package/dist/core/health-utils.d.ts.map +1 -0
  23. package/dist/core/health-utils.js +60 -0
  24. package/dist/core/health-utils.js.map +1 -0
  25. package/dist/core/paths.d.ts +1 -0
  26. package/dist/core/paths.d.ts.map +1 -1
  27. package/dist/core/paths.js +4 -0
  28. package/dist/core/paths.js.map +1 -1
  29. package/dist/core/types.d.ts +26 -0
  30. package/dist/core/types.d.ts.map +1 -1
  31. package/dist/tui/Dashboard.d.ts.map +1 -1
  32. package/dist/tui/Dashboard.js +69 -2
  33. package/dist/tui/Dashboard.js.map +1 -1
  34. package/dist/tui/components/AccountList.d.ts +5 -3
  35. package/dist/tui/components/AccountList.d.ts.map +1 -1
  36. package/dist/tui/components/AccountList.js +9 -3
  37. package/dist/tui/components/AccountList.js.map +1 -1
  38. package/dist/tui/components/DashboardView.d.ts +3 -2
  39. package/dist/tui/components/DashboardView.d.ts.map +1 -1
  40. package/dist/tui/components/DashboardView.js +102 -17
  41. package/dist/tui/components/DashboardView.js.map +1 -1
  42. package/dist/tui/components/HealthBadge.d.ts +9 -0
  43. package/dist/tui/components/HealthBadge.d.ts.map +1 -0
  44. package/dist/tui/components/HealthBadge.js +56 -0
  45. package/dist/tui/components/HealthBadge.js.map +1 -0
  46. package/dist/tui/components/StatusBadge.d.ts +2 -1
  47. package/dist/tui/components/StatusBadge.d.ts.map +1 -1
  48. package/dist/tui/components/StatusBadge.js +30 -2
  49. package/dist/tui/components/StatusBadge.js.map +1 -1
  50. package/dist/tui/components/index.d.ts +1 -0
  51. package/dist/tui/components/index.d.ts.map +1 -1
  52. package/dist/tui/components/index.js +3 -1
  53. package/dist/tui/components/index.js.map +1 -1
  54. package/docs/BLUEPRINT.md +476 -476
  55. package/docs/ROADMAP.md +125 -107
  56. package/package.json +38 -38
  57. package/src/cli.ts +139 -38
  58. package/src/core/config-store.ts +278 -171
  59. package/src/core/crypto.ts +162 -162
  60. package/src/core/health-log.ts +173 -0
  61. package/src/core/health-oauth.ts +190 -0
  62. package/src/core/health-orchestrator.ts +224 -0
  63. package/src/core/importers/amExport.ts +177 -177
  64. package/src/core/opencode-config.ts +217 -217
  65. package/src/core/paths.ts +10 -6
  66. package/src/core/types.ts +193 -147
  67. package/src/tui/Dashboard.tsx +557 -478
  68. package/src/tui/components/AccountList.tsx +122 -104
  69. package/src/tui/components/ActionPalette.tsx +117 -117
  70. package/src/tui/components/Box.tsx +7 -7
  71. package/src/tui/components/DashboardView.tsx +324 -220
  72. package/src/tui/components/ExportModal.tsx +255 -255
  73. package/src/tui/components/FileBrowser.tsx +393 -393
  74. package/src/tui/components/Header.tsx +26 -26
  75. package/src/tui/components/HealthBadge.tsx +64 -0
  76. package/src/tui/components/ImportModal.tsx +334 -334
  77. package/src/tui/components/McpServerList.tsx +67 -67
  78. package/src/tui/components/Menu.tsx +61 -61
  79. package/src/tui/components/PasswordInput.tsx +159 -159
  80. package/src/tui/components/ProviderList.tsx +59 -59
  81. package/src/tui/components/SectionBox.tsx +35 -35
  82. package/src/tui/components/StatsRow.tsx +33 -33
  83. package/src/tui/components/StatusBadge.tsx +36 -3
  84. package/src/tui/components/index.ts +15 -14
  85. package/test-minimal.js +26 -26
  86. package/test-with-accounts.js +58 -58
@@ -1,26 +1,26 @@
1
- import React from "react";
2
- import { Box, Text } from "ink";
3
-
4
- interface HeaderProps {
5
- title?: string;
6
- subtitle?: string;
7
- }
8
-
9
- export function Header({
10
- title = "OpenCode Account Manager",
11
- subtitle,
12
- }: HeaderProps) {
13
- return (
14
- <Box flexDirection="column" marginBottom={1}>
15
- <Box>
16
- <Text bold color="white">
17
- {title}
18
- </Text>
19
- {subtitle ? <Text dimColor> / {subtitle}</Text> : null}
20
- </Box>
21
- <Text dimColor>
22
- ────────────────────────────────────────────────────────────────
23
- </Text>
24
- </Box>
25
- );
26
- }
1
+ import React from "react";
2
+ import { Box, Text } from "ink";
3
+
4
+ interface HeaderProps {
5
+ title?: string;
6
+ subtitle?: string;
7
+ }
8
+
9
+ export function Header({
10
+ title = "OpenCode Account Manager",
11
+ subtitle,
12
+ }: HeaderProps) {
13
+ return (
14
+ <Box flexDirection="column" marginBottom={1}>
15
+ <Box>
16
+ <Text bold color="white">
17
+ {title}
18
+ </Text>
19
+ {subtitle ? <Text dimColor> / {subtitle}</Text> : null}
20
+ </Box>
21
+ <Text dimColor>
22
+ ────────────────────────────────────────────────────────────────
23
+ </Text>
24
+ </Box>
25
+ );
26
+ }
@@ -0,0 +1,64 @@
1
+ import React from "react";
2
+ import { Text } from "ink";
3
+ import { AccountHealthResult, AccountHealthStatus } from "../../core/types";
4
+
5
+ interface HealthBadgeProps {
6
+ result?: AccountHealthResult;
7
+ compact?: boolean;
8
+ }
9
+
10
+ const HEALTH_COLORS: Record<AccountHealthStatus, string> = {
11
+ ok: "green",
12
+ verification_required: "yellow",
13
+ revoked: "red",
14
+ disabled: "gray",
15
+ deleted: "red",
16
+ password_changed: "yellow",
17
+ network_error: "cyan",
18
+ unknown_error: "red",
19
+ not_checked: "gray",
20
+ not_configured: "gray",
21
+ };
22
+
23
+ const HEALTH_ICONS: Record<AccountHealthStatus, string> = {
24
+ ok: "v",
25
+ verification_required: "!",
26
+ revoked: "x",
27
+ disabled: "-",
28
+ deleted: "x",
29
+ password_changed: "!",
30
+ network_error: "~",
31
+ unknown_error: "?",
32
+ not_checked: ".",
33
+ not_configured: "-",
34
+ };
35
+
36
+ const HEALTH_LABELS: Record<AccountHealthStatus, string> = {
37
+ ok: "OK",
38
+ verification_required: "VERIFY",
39
+ revoked: "REVOKED",
40
+ disabled: "DISABLED",
41
+ deleted: "DELETED",
42
+ password_changed: "PWD CHG",
43
+ network_error: "NET ERR",
44
+ unknown_error: "ERROR",
45
+ not_checked: "UNCHECK",
46
+ not_configured: "NO CFG",
47
+ };
48
+
49
+ export function HealthBadge({ result, compact = false }: HealthBadgeProps) {
50
+ if (!result) {
51
+ return <Text dimColor>-</Text>;
52
+ }
53
+
54
+ const color = HEALTH_COLORS[result.status] || "gray";
55
+ const icon = HEALTH_ICONS[result.status] || "?";
56
+ const label = HEALTH_LABELS[result.status] || result.status.toUpperCase();
57
+
58
+ return (
59
+ <Text color={color}>
60
+ {icon}
61
+ {compact ? "" : ` ${label}`}
62
+ </Text>
63
+ );
64
+ }