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.
- package/README.md +235 -216
- package/README_VI.md +235 -216
- package/dist/cli.js +83 -0
- package/dist/cli.js.map +1 -1
- package/dist/core/config-store.d.ts +12 -0
- package/dist/core/config-store.d.ts.map +1 -1
- package/dist/core/config-store.js +98 -0
- package/dist/core/config-store.js.map +1 -1
- package/dist/core/health-log.d.ts +9 -0
- package/dist/core/health-log.d.ts.map +1 -0
- package/dist/core/health-log.js +154 -0
- package/dist/core/health-log.js.map +1 -0
- package/dist/core/health-oauth.d.ts +5 -0
- package/dist/core/health-oauth.d.ts.map +1 -0
- package/dist/core/health-oauth.js +147 -0
- package/dist/core/health-oauth.js.map +1 -0
- package/dist/core/health-orchestrator.d.ts +32 -0
- package/dist/core/health-orchestrator.d.ts.map +1 -0
- package/dist/core/health-orchestrator.js +148 -0
- package/dist/core/health-orchestrator.js.map +1 -0
- package/dist/core/health-utils.d.ts +15 -0
- package/dist/core/health-utils.d.ts.map +1 -0
- package/dist/core/health-utils.js +60 -0
- package/dist/core/health-utils.js.map +1 -0
- package/dist/core/paths.d.ts +1 -0
- package/dist/core/paths.d.ts.map +1 -1
- package/dist/core/paths.js +4 -0
- package/dist/core/paths.js.map +1 -1
- package/dist/core/types.d.ts +26 -0
- package/dist/core/types.d.ts.map +1 -1
- package/dist/tui/Dashboard.d.ts.map +1 -1
- package/dist/tui/Dashboard.js +69 -2
- package/dist/tui/Dashboard.js.map +1 -1
- package/dist/tui/components/AccountList.d.ts +5 -3
- package/dist/tui/components/AccountList.d.ts.map +1 -1
- package/dist/tui/components/AccountList.js +9 -3
- package/dist/tui/components/AccountList.js.map +1 -1
- package/dist/tui/components/DashboardView.d.ts +3 -2
- package/dist/tui/components/DashboardView.d.ts.map +1 -1
- package/dist/tui/components/DashboardView.js +102 -17
- package/dist/tui/components/DashboardView.js.map +1 -1
- package/dist/tui/components/HealthBadge.d.ts +9 -0
- package/dist/tui/components/HealthBadge.d.ts.map +1 -0
- package/dist/tui/components/HealthBadge.js +56 -0
- package/dist/tui/components/HealthBadge.js.map +1 -0
- package/dist/tui/components/StatusBadge.d.ts +2 -1
- package/dist/tui/components/StatusBadge.d.ts.map +1 -1
- package/dist/tui/components/StatusBadge.js +30 -2
- package/dist/tui/components/StatusBadge.js.map +1 -1
- package/dist/tui/components/index.d.ts +1 -0
- package/dist/tui/components/index.d.ts.map +1 -1
- package/dist/tui/components/index.js +3 -1
- package/dist/tui/components/index.js.map +1 -1
- package/docs/BLUEPRINT.md +476 -476
- package/docs/ROADMAP.md +125 -107
- package/package.json +38 -38
- package/src/cli.ts +139 -38
- package/src/core/config-store.ts +278 -171
- package/src/core/crypto.ts +162 -162
- package/src/core/health-log.ts +173 -0
- package/src/core/health-oauth.ts +190 -0
- package/src/core/health-orchestrator.ts +224 -0
- package/src/core/importers/amExport.ts +177 -177
- package/src/core/opencode-config.ts +217 -217
- package/src/core/paths.ts +10 -6
- package/src/core/types.ts +193 -147
- package/src/tui/Dashboard.tsx +557 -478
- package/src/tui/components/AccountList.tsx +122 -104
- package/src/tui/components/ActionPalette.tsx +117 -117
- package/src/tui/components/Box.tsx +7 -7
- package/src/tui/components/DashboardView.tsx +324 -220
- package/src/tui/components/ExportModal.tsx +255 -255
- package/src/tui/components/FileBrowser.tsx +393 -393
- package/src/tui/components/Header.tsx +26 -26
- package/src/tui/components/HealthBadge.tsx +64 -0
- package/src/tui/components/ImportModal.tsx +334 -334
- package/src/tui/components/McpServerList.tsx +67 -67
- package/src/tui/components/Menu.tsx +61 -61
- package/src/tui/components/PasswordInput.tsx +159 -159
- package/src/tui/components/ProviderList.tsx +59 -59
- package/src/tui/components/SectionBox.tsx +35 -35
- package/src/tui/components/StatsRow.tsx +33 -33
- package/src/tui/components/StatusBadge.tsx +36 -3
- package/src/tui/components/index.ts +15 -14
- package/test-minimal.js +26 -26
- 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
|
+
}
|