opencode-account-manager 0.4.1

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 (131) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +266 -0
  3. package/dist/cli.d.ts +3 -0
  4. package/dist/cli.d.ts.map +1 -0
  5. package/dist/cli.js +183 -0
  6. package/dist/cli.js.map +1 -0
  7. package/dist/core/accounts.d.ts +19 -0
  8. package/dist/core/accounts.d.ts.map +1 -0
  9. package/dist/core/accounts.js +181 -0
  10. package/dist/core/accounts.js.map +1 -0
  11. package/dist/core/config-store.d.ts +48 -0
  12. package/dist/core/config-store.d.ts.map +1 -0
  13. package/dist/core/config-store.js +206 -0
  14. package/dist/core/config-store.js.map +1 -0
  15. package/dist/core/crypto.d.ts +40 -0
  16. package/dist/core/crypto.d.ts.map +1 -0
  17. package/dist/core/crypto.js +172 -0
  18. package/dist/core/crypto.js.map +1 -0
  19. package/dist/core/importers/amJson.d.ts +17 -0
  20. package/dist/core/importers/amJson.d.ts.map +1 -0
  21. package/dist/core/importers/amJson.js +131 -0
  22. package/dist/core/importers/amJson.js.map +1 -0
  23. package/dist/core/opencode-config.d.ts +92 -0
  24. package/dist/core/opencode-config.d.ts.map +1 -0
  25. package/dist/core/opencode-config.js +148 -0
  26. package/dist/core/opencode-config.js.map +1 -0
  27. package/dist/core/paths.d.ts +5 -0
  28. package/dist/core/paths.d.ts.map +1 -0
  29. package/dist/core/paths.js +38 -0
  30. package/dist/core/paths.js.map +1 -0
  31. package/dist/core/types.d.ts +74 -0
  32. package/dist/core/types.d.ts.map +1 -0
  33. package/dist/core/types.js +30 -0
  34. package/dist/core/types.js.map +1 -0
  35. package/dist/core/utils.d.ts +5 -0
  36. package/dist/core/utils.d.ts.map +1 -0
  37. package/dist/core/utils.js +35 -0
  38. package/dist/core/utils.js.map +1 -0
  39. package/dist/tui/Dashboard.d.ts +7 -0
  40. package/dist/tui/Dashboard.d.ts.map +1 -0
  41. package/dist/tui/Dashboard.js +331 -0
  42. package/dist/tui/Dashboard.js.map +1 -0
  43. package/dist/tui/components/AccountList.d.ts +18 -0
  44. package/dist/tui/components/AccountList.d.ts.map +1 -0
  45. package/dist/tui/components/AccountList.js +92 -0
  46. package/dist/tui/components/AccountList.js.map +1 -0
  47. package/dist/tui/components/Box.d.ts +11 -0
  48. package/dist/tui/components/Box.d.ts.map +1 -0
  49. package/dist/tui/components/Box.js +15 -0
  50. package/dist/tui/components/Box.js.map +1 -0
  51. package/dist/tui/components/ExportModal.d.ts +10 -0
  52. package/dist/tui/components/ExportModal.d.ts.map +1 -0
  53. package/dist/tui/components/ExportModal.js +192 -0
  54. package/dist/tui/components/ExportModal.js.map +1 -0
  55. package/dist/tui/components/FileBrowser.d.ts +12 -0
  56. package/dist/tui/components/FileBrowser.d.ts.map +1 -0
  57. package/dist/tui/components/FileBrowser.js +349 -0
  58. package/dist/tui/components/FileBrowser.js.map +1 -0
  59. package/dist/tui/components/Header.d.ts +8 -0
  60. package/dist/tui/components/Header.d.ts.map +1 -0
  61. package/dist/tui/components/Header.js +20 -0
  62. package/dist/tui/components/Header.js.map +1 -0
  63. package/dist/tui/components/ImportModal.d.ts +10 -0
  64. package/dist/tui/components/ImportModal.d.ts.map +1 -0
  65. package/dist/tui/components/ImportModal.js +215 -0
  66. package/dist/tui/components/ImportModal.js.map +1 -0
  67. package/dist/tui/components/McpServerList.d.ts +8 -0
  68. package/dist/tui/components/McpServerList.d.ts.map +1 -0
  69. package/dist/tui/components/McpServerList.js +35 -0
  70. package/dist/tui/components/McpServerList.js.map +1 -0
  71. package/dist/tui/components/Menu.d.ts +10 -0
  72. package/dist/tui/components/Menu.d.ts.map +1 -0
  73. package/dist/tui/components/Menu.js +83 -0
  74. package/dist/tui/components/Menu.js.map +1 -0
  75. package/dist/tui/components/PasswordInput.d.ts +12 -0
  76. package/dist/tui/components/PasswordInput.d.ts.map +1 -0
  77. package/dist/tui/components/PasswordInput.js +130 -0
  78. package/dist/tui/components/PasswordInput.js.map +1 -0
  79. package/dist/tui/components/ProviderList.d.ts +8 -0
  80. package/dist/tui/components/ProviderList.d.ts.map +1 -0
  81. package/dist/tui/components/ProviderList.js +37 -0
  82. package/dist/tui/components/ProviderList.js.map +1 -0
  83. package/dist/tui/components/SectionBox.d.ts +10 -0
  84. package/dist/tui/components/SectionBox.d.ts.map +1 -0
  85. package/dist/tui/components/SectionBox.js +16 -0
  86. package/dist/tui/components/SectionBox.js.map +1 -0
  87. package/dist/tui/components/StatsRow.d.ts +13 -0
  88. package/dist/tui/components/StatsRow.d.ts.map +1 -0
  89. package/dist/tui/components/StatsRow.js +18 -0
  90. package/dist/tui/components/StatsRow.js.map +1 -0
  91. package/dist/tui/components/StatusBadge.d.ts +8 -0
  92. package/dist/tui/components/StatusBadge.d.ts.map +1 -0
  93. package/dist/tui/components/StatusBadge.js +30 -0
  94. package/dist/tui/components/StatusBadge.js.map +1 -0
  95. package/dist/tui/components/index.d.ts +14 -0
  96. package/dist/tui/components/index.d.ts.map +1 -0
  97. package/dist/tui/components/index.js +32 -0
  98. package/dist/tui/components/index.js.map +1 -0
  99. package/dist/tui/index.d.ts +5 -0
  100. package/dist/tui/index.d.ts.map +1 -0
  101. package/dist/tui/index.js +13 -0
  102. package/dist/tui/index.js.map +1 -0
  103. package/docs/BLUEPRINT.md +476 -0
  104. package/docs/ROADMAP.md +74 -0
  105. package/package.json +38 -0
  106. package/src/cli.ts +207 -0
  107. package/src/core/accounts.ts +215 -0
  108. package/src/core/config-store.ts +212 -0
  109. package/src/core/crypto.ts +162 -0
  110. package/src/core/importers/amJson.ts +185 -0
  111. package/src/core/opencode-config.ts +217 -0
  112. package/src/core/paths.ts +32 -0
  113. package/src/core/types.ts +118 -0
  114. package/src/core/utils.ts +28 -0
  115. package/src/tui/Dashboard.tsx +431 -0
  116. package/src/tui/components/AccountList.tsx +155 -0
  117. package/src/tui/components/Box.tsx +37 -0
  118. package/src/tui/components/ExportModal.tsx +255 -0
  119. package/src/tui/components/FileBrowser.tsx +393 -0
  120. package/src/tui/components/Header.tsx +26 -0
  121. package/src/tui/components/ImportModal.tsx +288 -0
  122. package/src/tui/components/McpServerList.tsx +67 -0
  123. package/src/tui/components/Menu.tsx +103 -0
  124. package/src/tui/components/PasswordInput.tsx +159 -0
  125. package/src/tui/components/ProviderList.tsx +61 -0
  126. package/src/tui/components/SectionBox.tsx +35 -0
  127. package/src/tui/components/StatsRow.tsx +33 -0
  128. package/src/tui/components/StatusBadge.tsx +33 -0
  129. package/src/tui/components/index.ts +13 -0
  130. package/src/tui/index.tsx +11 -0
  131. package/tsconfig.json +20 -0
@@ -0,0 +1,35 @@
1
+ import React from "react";
2
+ import { Box, Text } from "ink";
3
+
4
+ interface SectionBoxProps {
5
+ title: string;
6
+ children: React.ReactNode;
7
+ borderColor?: string;
8
+ collapsed?: boolean;
9
+ }
10
+
11
+ export function SectionBox({
12
+ title,
13
+ children,
14
+ borderColor = "gray",
15
+ collapsed = false
16
+ }: SectionBoxProps) {
17
+ return (
18
+ <Box
19
+ flexDirection="column"
20
+ borderStyle="round"
21
+ borderColor={borderColor}
22
+ marginBottom={1}
23
+ >
24
+ <Box paddingX={1}>
25
+ <Text bold color="white">{title}</Text>
26
+ {collapsed && <Text dimColor> (collapsed)</Text>}
27
+ </Box>
28
+ {!collapsed && (
29
+ <Box flexDirection="column" paddingY={0}>
30
+ {children}
31
+ </Box>
32
+ )}
33
+ </Box>
34
+ );
35
+ }
@@ -0,0 +1,33 @@
1
+ import React from "react";
2
+ import { Box, Text } from "ink";
3
+
4
+ interface StatCardProps {
5
+ label: string;
6
+ value: string | number;
7
+ color?: string;
8
+ }
9
+
10
+ export function StatCard({ label, value, color = "white" }: StatCardProps) {
11
+ return (
12
+ <Box flexDirection="column" marginRight={2}>
13
+ <Text dimColor>{label}</Text>
14
+ <Text bold color={color}>
15
+ {value}
16
+ </Text>
17
+ </Box>
18
+ );
19
+ }
20
+
21
+ interface StatsRowProps {
22
+ stats: StatCardProps[];
23
+ }
24
+
25
+ export function StatsRow({ stats }: StatsRowProps) {
26
+ return (
27
+ <Box flexDirection="row" marginY={1}>
28
+ {stats.map((stat, index) => (
29
+ <StatCard key={index} {...stat} />
30
+ ))}
31
+ </Box>
32
+ );
33
+ }
@@ -0,0 +1,33 @@
1
+ import React from "react";
2
+ import { Text } from "ink";
3
+
4
+ interface StatusBadgeProps {
5
+ status: "available" | "limited" | "disabled" | "error";
6
+ label?: string;
7
+ }
8
+
9
+ const STATUS_COLORS: Record<string, string> = {
10
+ available: "green",
11
+ limited: "yellow",
12
+ disabled: "gray",
13
+ error: "red",
14
+ };
15
+
16
+ const STATUS_ICONS: Record<string, string> = {
17
+ available: "●",
18
+ limited: "○",
19
+ disabled: "x",
20
+ error: "!",
21
+ };
22
+
23
+ export function StatusBadge({ status, label }: StatusBadgeProps) {
24
+ const color = STATUS_COLORS[status] || "gray";
25
+ const icon = STATUS_ICONS[status] || "?";
26
+ const text = label || status.toUpperCase();
27
+
28
+ return (
29
+ <Text color={color}>
30
+ {icon} {text}
31
+ </Text>
32
+ );
33
+ }
@@ -0,0 +1,13 @@
1
+ export { Box } from "./Box";
2
+ export { Header } from "./Header";
3
+ export { StatusBadge } from "./StatusBadge";
4
+ export { StatCard, StatsRow } from "./StatsRow";
5
+ export { AccountRow, AccountList } from "./AccountList";
6
+ export { MenuBar, MenuAction } from "./Menu";
7
+ export { ProviderList } from "./ProviderList";
8
+ export { McpServerList } from "./McpServerList";
9
+ export { SectionBox } from "./SectionBox";
10
+ export { PasswordInput } from "./PasswordInput";
11
+ export { FileBrowser } from "./FileBrowser";
12
+ export { ExportModal } from "./ExportModal";
13
+ export { ImportModal } from "./ImportModal";
@@ -0,0 +1,11 @@
1
+ import React from "react";
2
+ import { render } from "ink";
3
+ import { Dashboard } from "./Dashboard";
4
+
5
+ export interface TuiOptions {
6
+ pluginPath?: string;
7
+ }
8
+
9
+ export function startTuiDashboard(options: TuiOptions) {
10
+ render(<Dashboard pluginPath={options.pluginPath} />);
11
+ }
package/tsconfig.json ADDED
@@ -0,0 +1,20 @@
1
+ {
2
+ "compilerOptions": {
3
+ "target": "ES2020",
4
+ "module": "commonjs",
5
+ "lib": ["ES2020"],
6
+ "outDir": "./dist",
7
+ "rootDir": "./src",
8
+ "strict": true,
9
+ "esModuleInterop": true,
10
+ "skipLibCheck": true,
11
+ "forceConsistentCasingInFileNames": true,
12
+ "resolveJsonModule": true,
13
+ "declaration": true,
14
+ "declarationMap": true,
15
+ "sourceMap": true,
16
+ "jsx": "react"
17
+ },
18
+ "include": ["src/**/*"],
19
+ "exclude": ["node_modules", "dist"]
20
+ }