opencode-account-manager 0.6.3 → 0.6.5

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 (95) 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 +72 -5
  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/Box.js +2 -2
  39. package/dist/tui/components/Box.js.map +1 -1
  40. package/dist/tui/components/DashboardView.d.ts +3 -2
  41. package/dist/tui/components/DashboardView.d.ts.map +1 -1
  42. package/dist/tui/components/DashboardView.js +50 -4
  43. package/dist/tui/components/DashboardView.js.map +1 -1
  44. package/dist/tui/components/ExportModal.js +4 -4
  45. package/dist/tui/components/ExportModal.js.map +1 -1
  46. package/dist/tui/components/FileBrowser.js +1 -1
  47. package/dist/tui/components/HealthBadge.d.ts +9 -0
  48. package/dist/tui/components/HealthBadge.d.ts.map +1 -0
  49. package/dist/tui/components/HealthBadge.js +56 -0
  50. package/dist/tui/components/HealthBadge.js.map +1 -0
  51. package/dist/tui/components/ImportModal.js +4 -4
  52. package/dist/tui/components/ImportModal.js.map +1 -1
  53. package/dist/tui/components/PasswordInput.js +2 -2
  54. package/dist/tui/components/PasswordInput.js.map +1 -1
  55. package/dist/tui/components/StatusBadge.d.ts +2 -1
  56. package/dist/tui/components/StatusBadge.d.ts.map +1 -1
  57. package/dist/tui/components/StatusBadge.js +30 -2
  58. package/dist/tui/components/StatusBadge.js.map +1 -1
  59. package/dist/tui/components/index.d.ts +1 -0
  60. package/dist/tui/components/index.d.ts.map +1 -1
  61. package/dist/tui/components/index.js +3 -1
  62. package/dist/tui/components/index.js.map +1 -1
  63. package/docs/BLUEPRINT.md +476 -476
  64. package/docs/ROADMAP.md +125 -107
  65. package/package.json +36 -36
  66. package/src/cli.ts +139 -38
  67. package/src/core/config-store.ts +278 -171
  68. package/src/core/crypto.ts +162 -162
  69. package/src/core/health-log.ts +173 -0
  70. package/src/core/health-oauth.ts +190 -0
  71. package/src/core/health-orchestrator.ts +224 -0
  72. package/src/core/importers/amExport.ts +177 -177
  73. package/src/core/opencode-config.ts +217 -217
  74. package/src/core/paths.ts +10 -6
  75. package/src/core/types.ts +193 -147
  76. package/src/tui/Dashboard.tsx +557 -478
  77. package/src/tui/components/AccountList.tsx +122 -104
  78. package/src/tui/components/ActionPalette.tsx +117 -117
  79. package/src/tui/components/Box.tsx +2 -2
  80. package/src/tui/components/DashboardView.tsx +285 -230
  81. package/src/tui/components/ExportModal.tsx +255 -255
  82. package/src/tui/components/FileBrowser.tsx +393 -393
  83. package/src/tui/components/Header.tsx +26 -26
  84. package/src/tui/components/HealthBadge.tsx +64 -0
  85. package/src/tui/components/ImportModal.tsx +334 -334
  86. package/src/tui/components/McpServerList.tsx +67 -67
  87. package/src/tui/components/Menu.tsx +61 -61
  88. package/src/tui/components/PasswordInput.tsx +159 -159
  89. package/src/tui/components/ProviderList.tsx +59 -59
  90. package/src/tui/components/SectionBox.tsx +35 -35
  91. package/src/tui/components/StatsRow.tsx +33 -33
  92. package/src/tui/components/StatusBadge.tsx +36 -3
  93. package/src/tui/components/index.ts +15 -14
  94. package/test-minimal.js +26 -26
  95. 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: "✓",
25
+ verification_required: "⚠",
26
+ revoked: "✘",
27
+ disabled: "○",
28
+ deleted: "✖",
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
+ }