dexto 1.5.5 → 1.5.7

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 (234) hide show
  1. package/README.md +13 -0
  2. package/dist/agents/agent-template.yml +1 -1
  3. package/dist/agents/coding-agent/coding-agent.yml +17 -2
  4. package/dist/agents/coding-agent/skills/code-review.md +46 -0
  5. package/dist/agents/explore-agent/explore-agent.yml +2 -0
  6. package/dist/agents/podcast-agent/podcast-agent.yml +1 -1
  7. package/dist/analytics/events.d.ts +1 -1
  8. package/dist/analytics/events.d.ts.map +1 -1
  9. package/dist/api/server-hono.d.ts.map +1 -1
  10. package/dist/api/server-hono.js +55 -10
  11. package/dist/cli/assets/dexto-logo.svg +31 -0
  12. package/dist/cli/auth/api-client.d.ts +49 -0
  13. package/dist/cli/auth/api-client.d.ts.map +1 -0
  14. package/dist/cli/auth/api-client.js +127 -0
  15. package/dist/cli/auth/constants.d.ts +23 -0
  16. package/dist/cli/auth/constants.d.ts.map +1 -0
  17. package/dist/cli/auth/constants.js +24 -0
  18. package/dist/cli/auth/index.d.ts +5 -0
  19. package/dist/cli/auth/index.d.ts.map +1 -0
  20. package/dist/cli/auth/index.js +6 -0
  21. package/dist/cli/auth/oauth.d.ts +26 -0
  22. package/dist/cli/auth/oauth.d.ts.map +1 -0
  23. package/dist/cli/auth/oauth.js +327 -0
  24. package/dist/cli/auth/service.d.ts +20 -0
  25. package/dist/cli/auth/service.d.ts.map +1 -0
  26. package/dist/cli/auth/service.js +147 -0
  27. package/dist/cli/commands/auth/index.d.ts +4 -0
  28. package/dist/cli/commands/auth/index.d.ts.map +1 -0
  29. package/dist/cli/commands/auth/index.js +4 -0
  30. package/dist/cli/commands/auth/login.d.ts +9 -0
  31. package/dist/cli/commands/auth/login.d.ts.map +1 -0
  32. package/dist/cli/commands/auth/login.js +255 -0
  33. package/dist/cli/commands/auth/logout.d.ts +5 -0
  34. package/dist/cli/commands/auth/logout.d.ts.map +1 -0
  35. package/dist/cli/commands/auth/logout.js +51 -0
  36. package/dist/cli/commands/auth/status.d.ts +2 -0
  37. package/dist/cli/commands/auth/status.d.ts.map +1 -0
  38. package/dist/cli/commands/auth/status.js +22 -0
  39. package/dist/cli/commands/billing/index.d.ts +2 -0
  40. package/dist/cli/commands/billing/index.d.ts.map +1 -0
  41. package/dist/cli/commands/billing/index.js +2 -0
  42. package/dist/cli/commands/billing/status.d.ts +6 -0
  43. package/dist/cli/commands/billing/status.d.ts.map +1 -0
  44. package/dist/cli/commands/billing/status.js +60 -0
  45. package/dist/cli/commands/index.d.ts +4 -0
  46. package/dist/cli/commands/index.d.ts.map +1 -1
  47. package/dist/cli/commands/index.js +9 -0
  48. package/dist/cli/commands/interactive-commands/auth/index.d.ts +12 -0
  49. package/dist/cli/commands/interactive-commands/auth/index.d.ts.map +1 -0
  50. package/dist/cli/commands/interactive-commands/auth/index.js +20 -0
  51. package/dist/cli/commands/interactive-commands/command-parser.d.ts +5 -0
  52. package/dist/cli/commands/interactive-commands/command-parser.d.ts.map +1 -1
  53. package/dist/cli/commands/interactive-commands/command-parser.js +6 -0
  54. package/dist/cli/commands/interactive-commands/commands.d.ts +1 -0
  55. package/dist/cli/commands/interactive-commands/commands.d.ts.map +1 -1
  56. package/dist/cli/commands/interactive-commands/commands.js +10 -0
  57. package/dist/cli/commands/interactive-commands/export/index.d.ts +13 -0
  58. package/dist/cli/commands/interactive-commands/export/index.d.ts.map +1 -0
  59. package/dist/cli/commands/interactive-commands/export/index.js +21 -0
  60. package/dist/cli/commands/interactive-commands/general-commands.d.ts.map +1 -1
  61. package/dist/cli/commands/interactive-commands/general-commands.js +1 -0
  62. package/dist/cli/commands/interactive-commands/mcp/index.d.ts +2 -2
  63. package/dist/cli/commands/interactive-commands/mcp/index.d.ts.map +1 -1
  64. package/dist/cli/commands/interactive-commands/mcp/index.js +4 -7
  65. package/dist/cli/commands/interactive-commands/model/index.d.ts +2 -2
  66. package/dist/cli/commands/interactive-commands/model/index.d.ts.map +1 -1
  67. package/dist/cli/commands/interactive-commands/model/index.js +4 -7
  68. package/dist/cli/commands/interactive-commands/plugin/index.d.ts +13 -0
  69. package/dist/cli/commands/interactive-commands/plugin/index.d.ts.map +1 -0
  70. package/dist/cli/commands/interactive-commands/plugin/index.js +18 -0
  71. package/dist/cli/commands/interactive-commands/prompt-commands.d.ts +3 -1
  72. package/dist/cli/commands/interactive-commands/prompt-commands.d.ts.map +1 -1
  73. package/dist/cli/commands/interactive-commands/prompt-commands.js +72 -36
  74. package/dist/cli/commands/interactive-commands/system/system-commands.d.ts.map +1 -1
  75. package/dist/cli/commands/interactive-commands/system/system-commands.js +2 -3
  76. package/dist/cli/commands/plugin.d.ts +161 -0
  77. package/dist/cli/commands/plugin.d.ts.map +1 -0
  78. package/dist/cli/commands/plugin.js +376 -0
  79. package/dist/cli/commands/setup.d.ts +9 -9
  80. package/dist/cli/commands/setup.d.ts.map +1 -1
  81. package/dist/cli/commands/setup.js +325 -37
  82. package/dist/cli/commands/sync-agents.d.ts +44 -0
  83. package/dist/cli/commands/sync-agents.d.ts.map +1 -0
  84. package/dist/cli/commands/sync-agents.js +483 -0
  85. package/dist/cli/ink-cli/InkCLIRefactored.d.ts +14 -1
  86. package/dist/cli/ink-cli/InkCLIRefactored.d.ts.map +1 -1
  87. package/dist/cli/ink-cli/InkCLIRefactored.js +8 -2
  88. package/dist/cli/ink-cli/components/ApprovalPrompt.d.ts +1 -1
  89. package/dist/cli/ink-cli/components/ApprovalPrompt.d.ts.map +1 -1
  90. package/dist/cli/ink-cli/components/ApprovalPrompt.js +80 -12
  91. package/dist/cli/ink-cli/components/Footer.d.ts +2 -1
  92. package/dist/cli/ink-cli/components/Footer.d.ts.map +1 -1
  93. package/dist/cli/ink-cli/components/Footer.js +6 -2
  94. package/dist/cli/ink-cli/components/SlashCommandAutocomplete.d.ts.map +1 -1
  95. package/dist/cli/ink-cli/components/SlashCommandAutocomplete.js +15 -7
  96. package/dist/cli/ink-cli/components/StatusBar.d.ts +9 -1
  97. package/dist/cli/ink-cli/components/StatusBar.d.ts.map +1 -1
  98. package/dist/cli/ink-cli/components/StatusBar.js +17 -5
  99. package/dist/cli/ink-cli/components/TodoPanel.d.ts +11 -8
  100. package/dist/cli/ink-cli/components/TodoPanel.d.ts.map +1 -1
  101. package/dist/cli/ink-cli/components/TodoPanel.js +38 -36
  102. package/dist/cli/ink-cli/components/chat/Header.d.ts.map +1 -1
  103. package/dist/cli/ink-cli/components/chat/Header.js +1 -1
  104. package/dist/cli/ink-cli/components/chat/MessageItem.d.ts.map +1 -1
  105. package/dist/cli/ink-cli/components/chat/MessageItem.js +14 -1
  106. package/dist/cli/ink-cli/components/chat/styled-boxes/LogConfigBox.js +1 -1
  107. package/dist/cli/ink-cli/components/modes/AlternateBufferCLI.d.ts.map +1 -1
  108. package/dist/cli/ink-cli/components/modes/AlternateBufferCLI.js +16 -4
  109. package/dist/cli/ink-cli/components/modes/StaticCLI.d.ts.map +1 -1
  110. package/dist/cli/ink-cli/components/modes/StaticCLI.js +4 -1
  111. package/dist/cli/ink-cli/components/overlays/ExportWizard.d.ts +22 -0
  112. package/dist/cli/ink-cli/components/overlays/ExportWizard.d.ts.map +1 -0
  113. package/dist/cli/ink-cli/components/overlays/ExportWizard.js +308 -0
  114. package/dist/cli/ink-cli/components/overlays/LogLevelSelector.d.ts +1 -0
  115. package/dist/cli/ink-cli/components/overlays/LogLevelSelector.d.ts.map +1 -1
  116. package/dist/cli/ink-cli/components/overlays/LogLevelSelector.js +31 -20
  117. package/dist/cli/ink-cli/components/overlays/MarketplaceAddPrompt.d.ts +20 -0
  118. package/dist/cli/ink-cli/components/overlays/MarketplaceAddPrompt.d.ts.map +1 -0
  119. package/dist/cli/ink-cli/components/overlays/MarketplaceAddPrompt.js +81 -0
  120. package/dist/cli/ink-cli/components/overlays/MarketplaceBrowser.d.ts +31 -0
  121. package/dist/cli/ink-cli/components/overlays/MarketplaceBrowser.d.ts.map +1 -0
  122. package/dist/cli/ink-cli/components/overlays/MarketplaceBrowser.js +297 -0
  123. package/dist/cli/ink-cli/components/overlays/McpRemoveSelector.d.ts.map +1 -1
  124. package/dist/cli/ink-cli/components/overlays/McpRemoveSelector.js +7 -1
  125. package/dist/cli/ink-cli/components/overlays/McpServerActions.d.ts +1 -1
  126. package/dist/cli/ink-cli/components/overlays/McpServerActions.d.ts.map +1 -1
  127. package/dist/cli/ink-cli/components/overlays/McpServerActions.js +9 -0
  128. package/dist/cli/ink-cli/components/overlays/McpServerList.d.ts.map +1 -1
  129. package/dist/cli/ink-cli/components/overlays/McpServerList.js +9 -2
  130. package/dist/cli/ink-cli/components/overlays/ModelSelectorRefactored.d.ts.map +1 -1
  131. package/dist/cli/ink-cli/components/overlays/ModelSelectorRefactored.js +15 -2
  132. package/dist/cli/ink-cli/components/overlays/PluginActions.d.ts +27 -0
  133. package/dist/cli/ink-cli/components/overlays/PluginActions.d.ts.map +1 -0
  134. package/dist/cli/ink-cli/components/overlays/PluginActions.js +66 -0
  135. package/dist/cli/ink-cli/components/overlays/PluginList.d.ts +21 -0
  136. package/dist/cli/ink-cli/components/overlays/PluginList.d.ts.map +1 -0
  137. package/dist/cli/ink-cli/components/overlays/PluginList.js +70 -0
  138. package/dist/cli/ink-cli/components/overlays/PluginManager.d.ts +21 -0
  139. package/dist/cli/ink-cli/components/overlays/PluginManager.d.ts.map +1 -0
  140. package/dist/cli/ink-cli/components/overlays/PluginManager.js +63 -0
  141. package/dist/cli/ink-cli/components/overlays/PromptList.d.ts.map +1 -1
  142. package/dist/cli/ink-cli/components/overlays/PromptList.js +4 -1
  143. package/dist/cli/ink-cli/components/overlays/custom-model-wizard/provider-config.d.ts +2 -1
  144. package/dist/cli/ink-cli/components/overlays/custom-model-wizard/provider-config.d.ts.map +1 -1
  145. package/dist/cli/ink-cli/components/overlays/custom-model-wizard/provider-config.js +61 -2
  146. package/dist/cli/ink-cli/components/renderers/FilePreviewRenderer.d.ts +4 -2
  147. package/dist/cli/ink-cli/components/renderers/FilePreviewRenderer.d.ts.map +1 -1
  148. package/dist/cli/ink-cli/components/renderers/FilePreviewRenderer.js +4 -4
  149. package/dist/cli/ink-cli/constants/tips.js +2 -2
  150. package/dist/cli/ink-cli/containers/InputContainer.d.ts.map +1 -1
  151. package/dist/cli/ink-cli/containers/InputContainer.js +31 -3
  152. package/dist/cli/ink-cli/containers/OverlayContainer.d.ts.map +1 -1
  153. package/dist/cli/ink-cli/containers/OverlayContainer.js +260 -11
  154. package/dist/cli/ink-cli/hooks/index.d.ts +1 -0
  155. package/dist/cli/ink-cli/hooks/index.d.ts.map +1 -1
  156. package/dist/cli/ink-cli/hooks/index.js +1 -0
  157. package/dist/cli/ink-cli/hooks/useCLIState.d.ts.map +1 -1
  158. package/dist/cli/ink-cli/hooks/useCLIState.js +3 -0
  159. package/dist/cli/ink-cli/hooks/useGitBranch.d.ts +13 -0
  160. package/dist/cli/ink-cli/hooks/useGitBranch.d.ts.map +1 -0
  161. package/dist/cli/ink-cli/hooks/useGitBranch.js +35 -0
  162. package/dist/cli/ink-cli/hooks/useInputOrchestrator.d.ts.map +1 -1
  163. package/dist/cli/ink-cli/hooks/useInputOrchestrator.js +50 -6
  164. package/dist/cli/ink-cli/services/processStream.d.ts.map +1 -1
  165. package/dist/cli/ink-cli/services/processStream.js +42 -10
  166. package/dist/cli/ink-cli/state/initialState.d.ts.map +1 -1
  167. package/dist/cli/ink-cli/state/initialState.js +3 -0
  168. package/dist/cli/ink-cli/state/types.d.ts +16 -1
  169. package/dist/cli/ink-cli/state/types.d.ts.map +1 -1
  170. package/dist/cli/ink-cli/utils/commandOverlays.d.ts.map +1 -1
  171. package/dist/cli/ink-cli/utils/commandOverlays.js +2 -0
  172. package/dist/cli/ink-cli/utils/messageFormatting.d.ts +14 -1
  173. package/dist/cli/ink-cli/utils/messageFormatting.d.ts.map +1 -1
  174. package/dist/cli/ink-cli/utils/messageFormatting.js +68 -8
  175. package/dist/cli/ink-cli/utils/toolUtils.d.ts +11 -0
  176. package/dist/cli/ink-cli/utils/toolUtils.d.ts.map +1 -1
  177. package/dist/cli/ink-cli/utils/toolUtils.js +17 -0
  178. package/dist/cli/mcp/index.d.ts +8 -0
  179. package/dist/cli/mcp/index.d.ts.map +1 -0
  180. package/dist/cli/mcp/index.js +7 -0
  181. package/dist/cli/mcp/oauth-factory.d.ts +6 -0
  182. package/dist/cli/mcp/oauth-factory.d.ts.map +1 -0
  183. package/dist/cli/mcp/oauth-factory.js +25 -0
  184. package/dist/cli/mcp/oauth-provider.d.ts +10 -0
  185. package/dist/cli/mcp/oauth-provider.d.ts.map +1 -0
  186. package/dist/cli/mcp/oauth-provider.js +77 -0
  187. package/dist/cli/mcp/oauth-redirect.d.ts +3 -0
  188. package/dist/cli/mcp/oauth-redirect.d.ts.map +1 -0
  189. package/dist/cli/mcp/oauth-redirect.js +4 -0
  190. package/dist/cli/mcp/oauth-server.d.ts +2 -0
  191. package/dist/cli/mcp/oauth-server.d.ts.map +1 -0
  192. package/dist/cli/mcp/oauth-server.js +70 -0
  193. package/dist/cli/mcp/oauth-store.d.ts +10 -0
  194. package/dist/cli/mcp/oauth-store.d.ts.map +1 -0
  195. package/dist/cli/mcp/oauth-store.js +27 -0
  196. package/dist/cli/mcp/oauth-ui.d.ts +2 -0
  197. package/dist/cli/mcp/oauth-ui.d.ts.map +1 -0
  198. package/dist/cli/mcp/oauth-ui.js +12 -0
  199. package/dist/cli/mcp/oauth-utils.d.ts +2 -0
  200. package/dist/cli/mcp/oauth-utils.d.ts.map +1 -0
  201. package/dist/cli/mcp/oauth-utils.js +17 -0
  202. package/dist/cli/utils/api-key-setup.d.ts.map +1 -1
  203. package/dist/cli/utils/api-key-setup.js +13 -90
  204. package/dist/cli/utils/api-key-verification.d.ts.map +1 -1
  205. package/dist/cli/utils/api-key-verification.js +36 -0
  206. package/dist/cli/utils/config-validation.d.ts +3 -1
  207. package/dist/cli/utils/config-validation.d.ts.map +1 -1
  208. package/dist/cli/utils/config-validation.js +42 -19
  209. package/dist/cli/utils/dexto-auth-check.d.ts +53 -0
  210. package/dist/cli/utils/dexto-auth-check.d.ts.map +1 -0
  211. package/dist/cli/utils/dexto-auth-check.js +104 -0
  212. package/dist/cli/utils/dexto-setup.d.ts +8 -0
  213. package/dist/cli/utils/dexto-setup.d.ts.map +1 -0
  214. package/dist/cli/utils/dexto-setup.js +17 -0
  215. package/dist/cli/utils/options.d.ts.map +1 -1
  216. package/dist/cli/utils/options.js +5 -1
  217. package/dist/cli/utils/provider-setup.d.ts +4 -0
  218. package/dist/cli/utils/provider-setup.d.ts.map +1 -1
  219. package/dist/cli/utils/provider-setup.js +20 -0
  220. package/dist/cli/utils/version-check.d.ts +45 -0
  221. package/dist/cli/utils/version-check.d.ts.map +1 -0
  222. package/dist/cli/utils/version-check.js +195 -0
  223. package/dist/config/cli-overrides.d.ts +17 -8
  224. package/dist/config/cli-overrides.d.ts.map +1 -1
  225. package/dist/config/cli-overrides.js +36 -22
  226. package/dist/config/effective-llm.d.ts +123 -0
  227. package/dist/config/effective-llm.d.ts.map +1 -0
  228. package/dist/config/effective-llm.js +171 -0
  229. package/dist/index.js +451 -126
  230. package/dist/webui/assets/index-C9JXwpvo.css +1 -0
  231. package/dist/webui/assets/{index-DVQWNLpT.js → index-Dl3mj53P.js} +217 -217
  232. package/dist/webui/index.html +2 -2
  233. package/package.json +9 -8
  234. package/dist/webui/assets/index-BglIVTSG.css +0 -1
@@ -0,0 +1,255 @@
1
+ // packages/cli/src/cli/commands/auth/login.ts
2
+ import chalk from 'chalk';
3
+ import * as p from '@clack/prompts';
4
+ import { isAuthenticated, loadAuth, storeAuth, getDextoApiClient, SUPABASE_URL, SUPABASE_ANON_KEY, } from '../../auth/index.js';
5
+ import { logger } from '@dexto/core';
6
+ /**
7
+ * Handle login command - multiple methods supported
8
+ */
9
+ export async function handleLoginCommand(options = {}) {
10
+ try {
11
+ if (await isAuthenticated()) {
12
+ const auth = await loadAuth();
13
+ const userInfo = auth?.email || auth?.userId || 'user';
14
+ console.log(chalk.green(`✅ Already logged in as: ${userInfo}`));
15
+ // In non-interactive mode, already authenticated = success (idempotent)
16
+ if (options.interactive === false) {
17
+ return;
18
+ }
19
+ const shouldContinue = await p.confirm({
20
+ message: 'Do you want to login with a different account?',
21
+ initialValue: false,
22
+ });
23
+ if (p.isCancel(shouldContinue) || !shouldContinue) {
24
+ return;
25
+ }
26
+ }
27
+ if (options.apiKey) {
28
+ // Validate the Dexto API key before storing
29
+ const client = getDextoApiClient();
30
+ const isValid = await client.validateDextoApiKey(options.apiKey);
31
+ if (!isValid) {
32
+ throw new Error('Invalid API key provided - validation failed');
33
+ }
34
+ await storeAuth({ dextoApiKey: options.apiKey, createdAt: Date.now() });
35
+ console.log(chalk.green('✅ Dexto API key saved'));
36
+ return;
37
+ }
38
+ if (options.interactive === false) {
39
+ throw new Error('--api-key is required when --no-interactive is used');
40
+ }
41
+ p.intro(chalk.inverse(' Login to Dexto '));
42
+ console.log(chalk.dim('This will open your browser for authentication.'));
43
+ const shouldUseOAuth = await p.confirm({
44
+ message: 'Continue with browser authentication?',
45
+ initialValue: true,
46
+ });
47
+ if (p.isCancel(shouldUseOAuth)) {
48
+ p.cancel('Login cancelled');
49
+ return;
50
+ }
51
+ if (shouldUseOAuth) {
52
+ await handleBrowserLogin();
53
+ }
54
+ else {
55
+ console.log(chalk.dim('\nAlternatively, you can enter a token manually:'));
56
+ await handleTokenLogin();
57
+ }
58
+ p.outro(chalk.green('🎉 Login successful!'));
59
+ }
60
+ catch (error) {
61
+ const errorMessage = error instanceof Error ? error.message : String(error);
62
+ p.outro(chalk.red(`❌ Login failed: ${errorMessage}`));
63
+ // Re-throw to let CLI wrapper handle exit and analytics tracking
64
+ throw error;
65
+ }
66
+ }
67
+ export async function handleBrowserLogin() {
68
+ const { performOAuthLogin, DEFAULT_OAUTH_CONFIG } = await import('../../auth/oauth.js');
69
+ try {
70
+ const result = await performOAuthLogin(DEFAULT_OAUTH_CONFIG);
71
+ const expiresAt = result.expiresIn ? Date.now() + result.expiresIn * 1000 : undefined;
72
+ await storeAuth({
73
+ token: result.accessToken,
74
+ refreshToken: result.refreshToken,
75
+ userId: result.user?.id,
76
+ email: result.user?.email,
77
+ createdAt: Date.now(),
78
+ expiresAt,
79
+ });
80
+ if (result.user?.email) {
81
+ console.log(chalk.dim(`\nWelcome back, ${result.user.email}`));
82
+ }
83
+ await provisionKeys(result.accessToken, result.user?.email);
84
+ }
85
+ catch (error) {
86
+ const errorMessage = error instanceof Error ? error.message : String(error);
87
+ if (errorMessage.includes('timed out')) {
88
+ throw new Error('Login timed out. Please try again.');
89
+ }
90
+ else if (errorMessage.includes('user denied')) {
91
+ throw new Error('Login was cancelled.');
92
+ }
93
+ else {
94
+ throw new Error(`Login failed: ${errorMessage}`);
95
+ }
96
+ }
97
+ }
98
+ async function handleTokenLogin() {
99
+ const token = await p.password({
100
+ message: 'Enter your API token:',
101
+ validate: (value) => {
102
+ if (!value)
103
+ return 'Token is required';
104
+ if (value.length < 10)
105
+ return 'Token seems too short';
106
+ return undefined;
107
+ },
108
+ });
109
+ if (p.isCancel(token)) {
110
+ p.cancel('Token entry cancelled');
111
+ return;
112
+ }
113
+ const spinner = p.spinner();
114
+ spinner.start('Verifying token...');
115
+ try {
116
+ const isValid = await verifyToken(token);
117
+ if (!isValid) {
118
+ spinner.stop('Invalid token');
119
+ throw new Error('Token verification failed');
120
+ }
121
+ spinner.stop('Token verified!');
122
+ await storeAuth({
123
+ token: token,
124
+ createdAt: Date.now(),
125
+ });
126
+ // Provision Dexto API key for gateway access
127
+ await provisionKeys(token);
128
+ }
129
+ catch (error) {
130
+ spinner.stop('Verification failed');
131
+ throw error;
132
+ }
133
+ }
134
+ async function verifyToken(token) {
135
+ try {
136
+ const response = await fetch(`${SUPABASE_URL}/auth/v1/user`, {
137
+ headers: {
138
+ Authorization: `Bearer ${token}`,
139
+ apikey: SUPABASE_ANON_KEY,
140
+ 'User-Agent': 'dexto-cli/1.0.0',
141
+ },
142
+ signal: AbortSignal.timeout(10_000),
143
+ });
144
+ if (response.ok) {
145
+ const userData = await response.json();
146
+ return !!userData.id;
147
+ }
148
+ return false;
149
+ }
150
+ catch (error) {
151
+ logger.debug(`Token verification failed: ${error instanceof Error ? error.message : String(error)}`);
152
+ return false;
153
+ }
154
+ }
155
+ /**
156
+ * Helper to save Dexto API key to ~/.dexto/.env
157
+ * This ensures the key is available for the layered env loading at startup.
158
+ */
159
+ async function saveDextoApiKey(apiKey) {
160
+ const { getDextoEnvPath, ensureDextoGlobalDirectory } = await import('@dexto/core');
161
+ const path = await import('path');
162
+ const fs = await import('fs/promises');
163
+ const envVar = 'DEXTO_API_KEY';
164
+ const targetEnvPath = getDextoEnvPath();
165
+ // Ensure directory exists
166
+ await ensureDextoGlobalDirectory();
167
+ await fs.mkdir(path.dirname(targetEnvPath), { recursive: true });
168
+ // Read existing .env or create empty
169
+ let envContent = '';
170
+ try {
171
+ envContent = await fs.readFile(targetEnvPath, 'utf-8');
172
+ }
173
+ catch {
174
+ // File doesn't exist, start fresh
175
+ }
176
+ // Update or add the key
177
+ const lines = envContent.split('\n');
178
+ const keyPattern = new RegExp(`^${envVar}=`);
179
+ const keyIndex = lines.findIndex((line) => keyPattern.test(line));
180
+ if (keyIndex >= 0) {
181
+ lines[keyIndex] = `${envVar}=${apiKey}`;
182
+ }
183
+ else {
184
+ lines.push(`${envVar}=${apiKey}`);
185
+ }
186
+ // Write back
187
+ await fs.writeFile(targetEnvPath, lines.filter(Boolean).join('\n') + '\n', 'utf-8');
188
+ // Make available in current process immediately
189
+ process.env[envVar] = apiKey;
190
+ }
191
+ async function provisionKeys(authToken, _userEmail) {
192
+ try {
193
+ const apiClient = await getDextoApiClient();
194
+ const auth = await loadAuth();
195
+ // 1. Check if we already have a local key
196
+ if (auth?.dextoApiKey) {
197
+ console.log(chalk.cyan('🔍 Validating existing API key...'));
198
+ try {
199
+ const isValid = await apiClient.validateDextoApiKey(auth.dextoApiKey);
200
+ if (isValid) {
201
+ console.log(chalk.green('✅ Existing key is valid'));
202
+ // Ensure .env is in sync
203
+ await saveDextoApiKey(auth.dextoApiKey);
204
+ return; // All good, we're done
205
+ }
206
+ // Key is invalid - need new one
207
+ console.log(chalk.yellow('⚠️ Existing key is invalid, provisioning new one...'));
208
+ const provisionResult = await apiClient.provisionDextoApiKey(authToken);
209
+ if (!provisionResult.dextoApiKey) {
210
+ throw new Error('Failed to get new API key');
211
+ }
212
+ await storeAuth({
213
+ ...auth,
214
+ dextoApiKey: provisionResult.dextoApiKey,
215
+ dextoKeyId: provisionResult.keyId,
216
+ });
217
+ await saveDextoApiKey(provisionResult.dextoApiKey);
218
+ console.log(chalk.green('✅ New key provisioned'));
219
+ console.log(chalk.dim(` Key ID: ${provisionResult.keyId}`));
220
+ return;
221
+ }
222
+ catch (error) {
223
+ // Validation or rotation failed - this is a critical error
224
+ logger.warn(`Key validation/rotation failed: ${error}`);
225
+ throw new Error(`Failed to validate or rotate key: ${error instanceof Error ? error.message : String(error)}`);
226
+ }
227
+ }
228
+ // 2. No local key - provision one
229
+ console.log(chalk.cyan('🔑 Provisioning Dexto API key...'));
230
+ let provisionResult = await apiClient.provisionDextoApiKey(authToken);
231
+ if (!auth) {
232
+ throw new Error('Authentication state not found');
233
+ }
234
+ // If key already exists server-side but we don't have it locally, regenerate it
235
+ if (!provisionResult.isNewKey) {
236
+ console.log(chalk.yellow('⚠️ CLI key exists on server but not locally, regenerating...'));
237
+ provisionResult = await apiClient.provisionDextoApiKey(authToken, 'Dexto CLI Key', true);
238
+ }
239
+ await storeAuth({
240
+ ...auth,
241
+ dextoApiKey: provisionResult.dextoApiKey,
242
+ dextoKeyId: provisionResult.keyId,
243
+ });
244
+ await saveDextoApiKey(provisionResult.dextoApiKey);
245
+ console.log(chalk.green('✅ Dexto API key provisioned!'));
246
+ console.log(chalk.dim(` Key ID: ${provisionResult.keyId}`));
247
+ }
248
+ catch (error) {
249
+ const errorMessage = error instanceof Error ? error.message : String(error);
250
+ console.log(chalk.red(`❌ Failed to provision Dexto API key: ${errorMessage}`));
251
+ console.log(chalk.dim(' You can still use Dexto with your own API keys'));
252
+ logger.warn(`Provisioning failed: ${errorMessage}`);
253
+ // Don't throw - login should still succeed even if key provisioning fails
254
+ }
255
+ }
@@ -0,0 +1,5 @@
1
+ export declare function handleLogoutCommand(options?: {
2
+ force?: boolean;
3
+ interactive?: boolean;
4
+ }): Promise<void>;
5
+ //# sourceMappingURL=logout.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"logout.d.ts","sourceRoot":"","sources":["../../../../src/cli/commands/auth/logout.ts"],"names":[],"mappings":"AAQA,wBAAsB,mBAAmB,CACrC,OAAO,GAAE;IACL,KAAK,CAAC,EAAE,OAAO,CAAC;IAChB,WAAW,CAAC,EAAE,OAAO,CAAC;CACpB,GACP,OAAO,CAAC,IAAI,CAAC,CA2Df"}
@@ -0,0 +1,51 @@
1
+ // packages/cli/src/cli/commands/auth/logout.ts
2
+ import chalk from 'chalk';
3
+ import * as p from '@clack/prompts';
4
+ import { isAuthenticated, removeAuth } from '../../auth/index.js';
5
+ import { isUsingDextoCredits } from '../../../config/effective-llm.js';
6
+ import { logger } from '@dexto/core';
7
+ export async function handleLogoutCommand(options = {}) {
8
+ try {
9
+ if (!(await isAuthenticated())) {
10
+ console.log(chalk.yellow('ℹ️ Not currently logged in'));
11
+ return;
12
+ }
13
+ // Check if user is configured to use Dexto credits
14
+ // Uses getEffectiveLLMConfig() to check all config layers
15
+ const usingDextoCredits = await isUsingDextoCredits();
16
+ if (options.interactive !== false && !options.force) {
17
+ p.intro(chalk.inverse(' Logout '));
18
+ // Warn if using Dexto credits
19
+ if (usingDextoCredits) {
20
+ console.log(chalk.yellow('\n⚠️ You are currently configured to use Dexto credits (provider: dexto)'));
21
+ console.log(chalk.dim(' After logout, you will need to run `dexto setup` to configure'));
22
+ console.log(chalk.dim(' a different provider, or `dexto login` to log back in.\n'));
23
+ }
24
+ const shouldLogout = await p.confirm({
25
+ message: usingDextoCredits
26
+ ? 'Logout will disable Dexto credits. Continue?'
27
+ : 'Are you sure you want to logout?',
28
+ initialValue: false,
29
+ });
30
+ if (p.isCancel(shouldLogout) || !shouldLogout) {
31
+ p.cancel('Logout cancelled');
32
+ return;
33
+ }
34
+ }
35
+ await removeAuth();
36
+ console.log(chalk.green('✅ Successfully logged out'));
37
+ if (usingDextoCredits) {
38
+ console.log();
39
+ console.log(chalk.cyan('Next steps:'));
40
+ console.log(chalk.dim(' • Run `dexto login` to log back in'));
41
+ console.log(chalk.dim(' • Or run `dexto setup` to configure a different provider'));
42
+ }
43
+ logger.info('User logged out');
44
+ }
45
+ catch (error) {
46
+ const errorMessage = error instanceof Error ? error.message : String(error);
47
+ console.error(chalk.red(`❌ Logout failed: ${errorMessage}`));
48
+ // Re-throw to let CLI wrapper handle exit and analytics tracking
49
+ throw error;
50
+ }
51
+ }
@@ -0,0 +1,2 @@
1
+ export declare function handleStatusCommand(): Promise<void>;
2
+ //# sourceMappingURL=status.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"status.d.ts","sourceRoot":"","sources":["../../../../src/cli/commands/auth/status.ts"],"names":[],"mappings":"AAKA,wBAAsB,mBAAmB,IAAI,OAAO,CAAC,IAAI,CAAC,CAuBzD"}
@@ -0,0 +1,22 @@
1
+ // packages/cli/src/cli/commands/auth/status.ts
2
+ import chalk from 'chalk';
3
+ import { loadAuth } from '../../auth/index.js';
4
+ export async function handleStatusCommand() {
5
+ const auth = await loadAuth();
6
+ if (!auth) {
7
+ console.log(chalk.yellow('❌ Not logged in'));
8
+ console.log(chalk.dim('Run `dexto login` to authenticate'));
9
+ return;
10
+ }
11
+ console.log(chalk.green('✅ Logged in'));
12
+ if (auth.email) {
13
+ console.log(chalk.dim(`Email: ${auth.email}`));
14
+ }
15
+ if (auth.userId) {
16
+ console.log(chalk.dim(`User ID: ${auth.userId}`));
17
+ }
18
+ if (auth.expiresAt) {
19
+ const expiresDate = new Date(auth.expiresAt);
20
+ console.log(chalk.dim(`Expires: ${expiresDate.toLocaleDateString()}`));
21
+ }
22
+ }
@@ -0,0 +1,2 @@
1
+ export { handleBillingStatusCommand } from './status.js';
2
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/cli/commands/billing/index.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,0BAA0B,EAAE,MAAM,aAAa,CAAC"}
@@ -0,0 +1,2 @@
1
+ // packages/cli/src/cli/commands/billing/index.ts
2
+ export { handleBillingStatusCommand } from './status.js';
@@ -0,0 +1,6 @@
1
+ /**
2
+ * Handle the `dexto billing` command.
3
+ * Shows Dexto account billing information including balance and usage.
4
+ */
5
+ export declare function handleBillingStatusCommand(): Promise<void>;
6
+ //# sourceMappingURL=status.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"status.d.ts","sourceRoot":"","sources":["../../../../src/cli/commands/billing/status.ts"],"names":[],"mappings":"AAKA;;;GAGG;AACH,wBAAsB,0BAA0B,IAAI,OAAO,CAAC,IAAI,CAAC,CAiEhE"}
@@ -0,0 +1,60 @@
1
+ // packages/cli/src/cli/commands/billing/status.ts
2
+ import chalk from 'chalk';
3
+ import { loadAuth, getDextoApiClient } from '../../auth/index.js';
4
+ /**
5
+ * Handle the `dexto billing` command.
6
+ * Shows Dexto account billing information including balance and usage.
7
+ */
8
+ export async function handleBillingStatusCommand() {
9
+ const auth = await loadAuth();
10
+ if (!auth) {
11
+ console.log(chalk.yellow('❌ Not logged in to Dexto'));
12
+ console.log(chalk.dim('Run `dexto login` to authenticate'));
13
+ return;
14
+ }
15
+ if (!auth.dextoApiKey) {
16
+ console.log(chalk.yellow('❌ No Dexto API key found'));
17
+ console.log(chalk.dim('Run `dexto login` to provision an API key'));
18
+ return;
19
+ }
20
+ console.log(chalk.green('✅ Logged in to Dexto'));
21
+ if (auth.email) {
22
+ console.log(chalk.dim(`Account: ${auth.email}`));
23
+ }
24
+ console.log();
25
+ try {
26
+ const apiClient = getDextoApiClient();
27
+ const usage = await apiClient.getUsageSummary(auth.dextoApiKey);
28
+ // Display balance
29
+ console.log(chalk.cyan('💰 Balance'));
30
+ console.log(` ${chalk.bold('$' + usage.credits_usd.toFixed(2))} remaining`);
31
+ console.log();
32
+ // Display month-to-date usage
33
+ console.log(chalk.cyan('📊 This Month'));
34
+ console.log(` Spent: ${chalk.yellow('$' + usage.mtd_usage.total_cost_usd.toFixed(4))}`);
35
+ console.log(` Requests: ${chalk.yellow(usage.mtd_usage.total_requests.toString())}`);
36
+ // Show usage by model if there's any
37
+ const modelEntries = Object.entries(usage.mtd_usage.by_model);
38
+ if (modelEntries.length > 0) {
39
+ console.log();
40
+ console.log(chalk.cyan('📈 Usage by Model'));
41
+ for (const [model, stats] of modelEntries) {
42
+ console.log(` ${chalk.dim(model)}: $${stats.cost_usd.toFixed(4)} (${stats.requests} requests)`);
43
+ }
44
+ }
45
+ // Show recent usage if any
46
+ if (usage.recent.length > 0) {
47
+ console.log();
48
+ console.log(chalk.cyan('🕐 Recent Activity'));
49
+ for (const entry of usage.recent.slice(0, 5)) {
50
+ const date = new Date(entry.timestamp).toLocaleString();
51
+ console.log(` ${chalk.dim(date)} - ${entry.model}: $${entry.cost_usd.toFixed(4)}`);
52
+ }
53
+ }
54
+ }
55
+ catch (error) {
56
+ const errorMessage = error instanceof Error ? error.message : String(error);
57
+ console.log(chalk.red(`❌ Failed to fetch billing info: ${errorMessage}`));
58
+ console.log(chalk.dim('Your API key may be invalid. Try `dexto login` to refresh.'));
59
+ }
60
+ }
@@ -6,4 +6,8 @@ export { handleInstallCommand, type InstallCommandOptions } from './install.js';
6
6
  export { handleUninstallCommand, type UninstallCommandOptions } from './uninstall.js';
7
7
  export { handleListAgentsCommand, type ListAgentsCommandOptions, type ListAgentsCommandOptionsInput, } from './list-agents.js';
8
8
  export { handleWhichCommand, type WhichCommandOptions } from './which.js';
9
+ export { handleSyncAgentsCommand, shouldPromptForSync, markSyncDismissed, clearSyncDismissed, type SyncAgentsCommandOptions, } from './sync-agents.js';
10
+ export { handleLoginCommand, handleLogoutCommand, handleStatusCommand } from './auth/index.js';
11
+ export { handleBillingStatusCommand } from './billing/index.js';
12
+ export { handlePluginListCommand, handlePluginInstallCommand, handlePluginUninstallCommand, handlePluginValidateCommand, handleMarketplaceAddCommand, handleMarketplaceRemoveCommand, handleMarketplaceUpdateCommand, handleMarketplaceListCommand, handleMarketplacePluginsCommand, handleMarketplaceInstallCommand, type PluginListCommandOptions, type PluginListCommandOptionsInput, type PluginInstallCommandOptions, type PluginInstallCommandOptionsInput, type PluginUninstallCommandOptions, type PluginUninstallCommandOptionsInput, type PluginValidateCommandOptions, type PluginValidateCommandOptionsInput, type MarketplaceAddCommandOptionsInput, type MarketplaceRemoveCommandOptionsInput, type MarketplaceUpdateCommandOptionsInput, type MarketplaceListCommandOptionsInput, type MarketplaceInstallCommandOptionsInput, } from './plugin.js';
9
13
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/cli/commands/index.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,kBAAkB,EAAE,KAAK,gBAAgB,EAAE,MAAM,iBAAiB,CAAC;AAE5E,OAAO,EAAE,WAAW,EAAE,MAAM,mBAAmB,CAAC;AAEhD,OAAO,EAAE,0BAA0B,EAAE,SAAS,EAAE,aAAa,EAAE,MAAM,eAAe,CAAC;AAErF,OAAO,EAAE,kBAAkB,EAAE,KAAK,eAAe,EAAE,KAAK,oBAAoB,EAAE,MAAM,YAAY,CAAC;AACjG,OAAO,EAAE,oBAAoB,EAAE,KAAK,qBAAqB,EAAE,MAAM,cAAc,CAAC;AAChF,OAAO,EAAE,sBAAsB,EAAE,KAAK,uBAAuB,EAAE,MAAM,gBAAgB,CAAC;AACtF,OAAO,EACH,uBAAuB,EACvB,KAAK,wBAAwB,EAC7B,KAAK,6BAA6B,GACrC,MAAM,kBAAkB,CAAC;AAC1B,OAAO,EAAE,kBAAkB,EAAE,KAAK,mBAAmB,EAAE,MAAM,YAAY,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/cli/commands/index.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,kBAAkB,EAAE,KAAK,gBAAgB,EAAE,MAAM,iBAAiB,CAAC;AAE5E,OAAO,EAAE,WAAW,EAAE,MAAM,mBAAmB,CAAC;AAEhD,OAAO,EAAE,0BAA0B,EAAE,SAAS,EAAE,aAAa,EAAE,MAAM,eAAe,CAAC;AAErF,OAAO,EAAE,kBAAkB,EAAE,KAAK,eAAe,EAAE,KAAK,oBAAoB,EAAE,MAAM,YAAY,CAAC;AACjG,OAAO,EAAE,oBAAoB,EAAE,KAAK,qBAAqB,EAAE,MAAM,cAAc,CAAC;AAChF,OAAO,EAAE,sBAAsB,EAAE,KAAK,uBAAuB,EAAE,MAAM,gBAAgB,CAAC;AACtF,OAAO,EACH,uBAAuB,EACvB,KAAK,wBAAwB,EAC7B,KAAK,6BAA6B,GACrC,MAAM,kBAAkB,CAAC;AAC1B,OAAO,EAAE,kBAAkB,EAAE,KAAK,mBAAmB,EAAE,MAAM,YAAY,CAAC;AAC1E,OAAO,EACH,uBAAuB,EACvB,mBAAmB,EACnB,iBAAiB,EACjB,kBAAkB,EAClB,KAAK,wBAAwB,GAChC,MAAM,kBAAkB,CAAC;AAG1B,OAAO,EAAE,kBAAkB,EAAE,mBAAmB,EAAE,mBAAmB,EAAE,MAAM,iBAAiB,CAAC;AAG/F,OAAO,EAAE,0BAA0B,EAAE,MAAM,oBAAoB,CAAC;AAGhE,OAAO,EACH,uBAAuB,EACvB,0BAA0B,EAC1B,4BAA4B,EAC5B,2BAA2B,EAE3B,2BAA2B,EAC3B,8BAA8B,EAC9B,8BAA8B,EAC9B,4BAA4B,EAC5B,+BAA+B,EAC/B,+BAA+B,EAC/B,KAAK,wBAAwB,EAC7B,KAAK,6BAA6B,EAClC,KAAK,2BAA2B,EAChC,KAAK,gCAAgC,EACrC,KAAK,6BAA6B,EAClC,KAAK,kCAAkC,EACvC,KAAK,4BAA4B,EACjC,KAAK,iCAAiC,EAEtC,KAAK,iCAAiC,EACtC,KAAK,oCAAoC,EACzC,KAAK,oCAAoC,EACzC,KAAK,kCAAkC,EACvC,KAAK,qCAAqC,GAC7C,MAAM,aAAa,CAAC"}
@@ -8,3 +8,12 @@ export { handleInstallCommand } from './install.js';
8
8
  export { handleUninstallCommand } from './uninstall.js';
9
9
  export { handleListAgentsCommand, } from './list-agents.js';
10
10
  export { handleWhichCommand } from './which.js';
11
+ export { handleSyncAgentsCommand, shouldPromptForSync, markSyncDismissed, clearSyncDismissed, } from './sync-agents.js';
12
+ // Auth commands
13
+ export { handleLoginCommand, handleLogoutCommand, handleStatusCommand } from './auth/index.js';
14
+ // Billing commands
15
+ export { handleBillingStatusCommand } from './billing/index.js';
16
+ // Plugin commands
17
+ export { handlePluginListCommand, handlePluginInstallCommand, handlePluginUninstallCommand, handlePluginValidateCommand,
18
+ // Marketplace handlers
19
+ handleMarketplaceAddCommand, handleMarketplaceRemoveCommand, handleMarketplaceUpdateCommand, handleMarketplaceListCommand, handleMarketplacePluginsCommand, handleMarketplaceInstallCommand, } from './plugin.js';
@@ -0,0 +1,12 @@
1
+ /**
2
+ * Auth Commands Module
3
+ *
4
+ * Authentication commands for interactive CLI.
5
+ */
6
+ import type { CommandDefinition } from '../command-parser.js';
7
+ /**
8
+ * Login command - triggers OAuth flow for Dexto authentication
9
+ * Only available when DEXTO_FEATURE_AUTH=true
10
+ */
11
+ export declare const loginCommand: CommandDefinition;
12
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/cli/commands/interactive-commands/auth/index.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,sBAAsB,CAAC;AAG9D;;;GAGG;AACH,eAAO,MAAM,YAAY,EAAE,iBAS1B,CAAC"}
@@ -0,0 +1,20 @@
1
+ /**
2
+ * Auth Commands Module
3
+ *
4
+ * Authentication commands for interactive CLI.
5
+ */
6
+ import { handleLoginCommand } from '../../auth/login.js';
7
+ /**
8
+ * Login command - triggers OAuth flow for Dexto authentication
9
+ * Only available when DEXTO_FEATURE_AUTH=true
10
+ */
11
+ export const loginCommand = {
12
+ name: 'login',
13
+ description: 'Login to Dexto',
14
+ usage: '/login',
15
+ category: 'General',
16
+ handler: async () => {
17
+ await handleLoginCommand({ interactive: true });
18
+ return true;
19
+ },
20
+ };
@@ -30,6 +30,11 @@ export interface CommandDefinition {
30
30
  subcommands?: CommandDefinition[];
31
31
  handler: (args: string[], agent: DextoAgent, ctx: CommandContext) => Promise<CommandHandlerResult>;
32
32
  }
33
+ /**
34
+ * No-op handler for overlay-only commands.
35
+ * Used by commands in ALWAYS_OVERLAY that are handled entirely by the overlay system.
36
+ */
37
+ export declare const overlayOnlyHandler: () => Promise<CommandHandlerResult>;
33
38
  /**
34
39
  * Parses user input to determine if it's a slash command, shell command, or regular prompt
35
40
  */
@@ -1 +1 @@
1
- {"version":3,"file":"command-parser.d.ts","sourceRoot":"","sources":["../../../../src/cli/commands/interactive-commands/command-parser.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,aAAa,CAAC;AAC9C,OAAO,KAAK,EAAE,YAAY,EAAE,iBAAiB,EAAE,MAAM,0CAA0C,CAAC;AAEhG,MAAM,WAAW,aAAa;IAC1B,IAAI,EAAE,SAAS,GAAG,QAAQ,CAAC;IAC3B,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,IAAI,CAAC,EAAE,MAAM,EAAE,CAAC;IAChB,QAAQ,EAAE,MAAM,CAAC;CACpB;AAED;;;;;;GAMG;AACH,MAAM,MAAM,oBAAoB,GAAG,OAAO,GAAG,MAAM,GAAG,YAAY,GAAG,iBAAiB,CAAC;AAEvF;;GAEG;AACH,MAAM,WAAW,cAAc;IAC3B,uDAAuD;IACvD,SAAS,EAAE,MAAM,GAAG,IAAI,CAAC;CAC5B;AAED,MAAM,WAAW,iBAAiB;IAC9B,IAAI,EAAE,MAAM,CAAC;IACb,WAAW,EAAE,MAAM,CAAC;IACpB,KAAK,EAAE,MAAM,CAAC;IACd,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,OAAO,CAAC,EAAE,MAAM,EAAE,CAAC;IACnB,WAAW,CAAC,EAAE,iBAAiB,EAAE,CAAC;IAClC,OAAO,EAAE,CACL,IAAI,EAAE,MAAM,EAAE,EACd,KAAK,EAAE,UAAU,EACjB,GAAG,EAAE,cAAc,KAClB,OAAO,CAAC,oBAAoB,CAAC,CAAC;CACtC;AA4CD;;GAEG;AACH,wBAAgB,UAAU,CAAC,KAAK,EAAE,MAAM,GAAG,aAAa,CAiCvD;AAED;;GAEG;AACH,wBAAgB,qBAAqB,CAAC,OAAO,EAAE,MAAM,EAAE,QAAQ,EAAE,iBAAiB,EAAE,GAAG,MAAM,EAAE,CAoB9F;AAED;;GAEG;AACH,wBAAgB,iBAAiB,CAAC,GAAG,EAAE,iBAAiB,EAAE,QAAQ,GAAE,OAAe,GAAG,MAAM,CAmB3F;AAED;;GAEG;AACH,wBAAgB,kBAAkB,CAAC,QAAQ,EAAE,iBAAiB,EAAE,GAAG,IAAI,CAuDtE"}
1
+ {"version":3,"file":"command-parser.d.ts","sourceRoot":"","sources":["../../../../src/cli/commands/interactive-commands/command-parser.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,aAAa,CAAC;AAC9C,OAAO,KAAK,EAAE,YAAY,EAAE,iBAAiB,EAAE,MAAM,0CAA0C,CAAC;AAEhG,MAAM,WAAW,aAAa;IAC1B,IAAI,EAAE,SAAS,GAAG,QAAQ,CAAC;IAC3B,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,IAAI,CAAC,EAAE,MAAM,EAAE,CAAC;IAChB,QAAQ,EAAE,MAAM,CAAC;CACpB;AAED;;;;;;GAMG;AACH,MAAM,MAAM,oBAAoB,GAAG,OAAO,GAAG,MAAM,GAAG,YAAY,GAAG,iBAAiB,CAAC;AAEvF;;GAEG;AACH,MAAM,WAAW,cAAc;IAC3B,uDAAuD;IACvD,SAAS,EAAE,MAAM,GAAG,IAAI,CAAC;CAC5B;AAED,MAAM,WAAW,iBAAiB;IAC9B,IAAI,EAAE,MAAM,CAAC;IACb,WAAW,EAAE,MAAM,CAAC;IACpB,KAAK,EAAE,MAAM,CAAC;IACd,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,OAAO,CAAC,EAAE,MAAM,EAAE,CAAC;IACnB,WAAW,CAAC,EAAE,iBAAiB,EAAE,CAAC;IAClC,OAAO,EAAE,CACL,IAAI,EAAE,MAAM,EAAE,EACd,KAAK,EAAE,UAAU,EACjB,GAAG,EAAE,cAAc,KAClB,OAAO,CAAC,oBAAoB,CAAC,CAAC;CACtC;AAED;;;GAGG;AACH,eAAO,MAAM,kBAAkB,QAAa,OAAO,CAAC,oBAAoB,CAAS,CAAC;AA4ClF;;GAEG;AACH,wBAAgB,UAAU,CAAC,KAAK,EAAE,MAAM,GAAG,aAAa,CAiCvD;AAED;;GAEG;AACH,wBAAgB,qBAAqB,CAAC,OAAO,EAAE,MAAM,EAAE,QAAQ,EAAE,iBAAiB,EAAE,GAAG,MAAM,EAAE,CAoB9F;AAED;;GAEG;AACH,wBAAgB,iBAAiB,CAAC,GAAG,EAAE,iBAAiB,EAAE,QAAQ,GAAE,OAAe,GAAG,MAAM,CAmB3F;AAED;;GAEG;AACH,wBAAgB,kBAAkB,CAAC,QAAQ,EAAE,iBAAiB,EAAE,GAAG,IAAI,CAwDtE"}
@@ -1,4 +1,9 @@
1
1
  import chalk from 'chalk';
2
+ /**
3
+ * No-op handler for overlay-only commands.
4
+ * Used by commands in ALWAYS_OVERLAY that are handled entirely by the overlay system.
5
+ */
6
+ export const overlayOnlyHandler = async () => true;
2
7
  /**
3
8
  * Parse arguments respecting quotes and escape sequences
4
9
  */
@@ -124,6 +129,7 @@ export function displayAllCommands(commands) {
124
129
  'Session Management',
125
130
  'Model Management',
126
131
  'MCP Management',
132
+ 'Plugin Management',
127
133
  'Tool Management',
128
134
  'Prompt Management',
129
135
  'System',
@@ -10,6 +10,7 @@
10
10
  * - Conversation Commands: Session management, history, and search
11
11
  * - Model Commands: Model switching and configuration
12
12
  * - MCP Commands: MCP server management
13
+ * - Plugin Commands: Claude Code plugin management
13
14
  * - System Commands: Configuration, logging, and statistics
14
15
  * - Tool Commands: Tool listing and management
15
16
  * - Prompt Commands: System prompt management
@@ -1 +1 @@
1
- {"version":3,"file":"commands.d.ts","sourceRoot":"","sources":["../../../../src/cli/commands/interactive-commands/commands.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;GAmBG;AAEH,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,aAAa,CAAC;AAC9C,OAAO,KAAK,EAAE,iBAAiB,EAAE,oBAAoB,EAAE,MAAM,qBAAqB,CAAC;AAYnF;;;;;;;;;;;;;;GAcG;AACH,eAAO,MAAM,YAAY,EAAE,iBAAiB,EAAO,CAAC;AAsCpD;;;;;GAKG;AACH,wBAAsB,cAAc,CAChC,OAAO,EAAE,MAAM,EACf,IAAI,EAAE,MAAM,EAAE,EACd,KAAK,EAAE,UAAU,EACjB,SAAS,CAAC,EAAE,MAAM,GACnB,OAAO,CAAC,oBAAoB,CAAC,CAyD/B;AAED;;;GAGG;AACH,wBAAgB,cAAc,IAAI,iBAAiB,EAAE,CAEpD"}
1
+ {"version":3,"file":"commands.d.ts","sourceRoot":"","sources":["../../../../src/cli/commands/interactive-commands/commands.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;GAoBG;AAEH,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,aAAa,CAAC;AAC9C,OAAO,KAAK,EAAE,iBAAiB,EAAE,oBAAoB,EAAE,MAAM,qBAAqB,CAAC;AAgBnF;;;;;;;;;;;;;;GAcG;AACH,eAAO,MAAM,YAAY,EAAE,iBAAiB,EAAO,CAAC;AA6CpD;;;;;GAKG;AACH,wBAAsB,cAAc,CAChC,OAAO,EAAE,MAAM,EACf,IAAI,EAAE,MAAM,EAAE,EACd,KAAK,EAAE,UAAU,EACjB,SAAS,CAAC,EAAE,MAAM,GACnB,OAAO,CAAC,oBAAoB,CAAC,CAyD/B;AAED;;;GAGG;AACH,wBAAgB,cAAc,IAAI,iBAAiB,EAAE,CAEpD"}
@@ -10,6 +10,7 @@
10
10
  * - Conversation Commands: Session management, history, and search
11
11
  * - Model Commands: Model switching and configuration
12
12
  * - MCP Commands: MCP server management
13
+ * - Plugin Commands: Claude Code plugin management
13
14
  * - System Commands: Configuration, logging, and statistics
14
15
  * - Tool Commands: Tool listing and management
15
16
  * - Prompt Commands: System prompt management
@@ -18,15 +19,19 @@
18
19
  * This file serves as the integration layer that combines all modular commands
19
20
  * into a single CLI_COMMANDS array for the command execution system.
20
21
  */
22
+ import { isDextoAuthEnabled } from '@dexto/agent-management';
21
23
  // Import modular command definitions
22
24
  import { generalCommands, createHelpCommand } from './general-commands.js';
23
25
  import { searchCommand, resumeCommand, renameCommand } from './session/index.js';
26
+ import { exportCommand } from './export/index.js';
24
27
  import { modelCommands } from './model/index.js';
25
28
  import { mcpCommands } from './mcp/index.js';
29
+ import { pluginCommands } from './plugin/index.js';
26
30
  import { systemCommands } from './system/index.js';
27
31
  import { toolCommands } from './tool-commands.js';
28
32
  import { promptCommands } from './prompt-commands.js';
29
33
  import { documentationCommands } from './documentation-commands.js';
34
+ import { loginCommand } from './auth/index.js';
30
35
  /**
31
36
  * Complete list of all available CLI commands.
32
37
  * This array combines commands from all extracted modules to maintain
@@ -52,10 +57,13 @@ const baseCommands = [
52
57
  searchCommand, // /search - opens search overlay
53
58
  resumeCommand, // /resume - opens session selector overlay
54
59
  renameCommand, // /rename <title> - rename current session
60
+ exportCommand, // /export - opens export wizard overlay
55
61
  // Model management
56
62
  modelCommands, // /model - opens model selector overlay
57
63
  // MCP server management
58
64
  mcpCommands, // /mcp - opens MCP server list overlay
65
+ // Plugin management
66
+ pluginCommands, // /plugin - manage Claude Code compatible plugins
59
67
  // Tool management commands
60
68
  ...toolCommands,
61
69
  // Prompt management commands
@@ -64,6 +72,8 @@ const baseCommands = [
64
72
  ...systemCommands,
65
73
  // Documentation commands
66
74
  ...documentationCommands,
75
+ // Auth commands (feature-flagged)
76
+ ...(isDextoAuthEnabled() ? [loginCommand] : []),
67
77
  ];
68
78
  // Add help command that can see all commands
69
79
  CLI_COMMANDS.push(createHelpCommand(() => CLI_COMMANDS));
@@ -0,0 +1,13 @@
1
+ /**
2
+ * Export Command Module
3
+ *
4
+ * Provides the /export command for exporting conversation history.
5
+ * Always shows the interactive export wizard overlay.
6
+ */
7
+ import type { CommandDefinition } from '../command-parser.js';
8
+ /**
9
+ * Export command definition
10
+ * Always shows the interactive export wizard overlay (handled by ALWAYS_OVERLAY)
11
+ */
12
+ export declare const exportCommand: CommandDefinition;
13
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/cli/commands/interactive-commands/export/index.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,KAAK,EAAE,iBAAiB,EAAwC,MAAM,sBAAsB,CAAC;AAGpG;;;GAGG;AACH,eAAO,MAAM,aAAa,EAAE,iBAc3B,CAAC"}
@@ -0,0 +1,21 @@
1
+ /**
2
+ * Export Command Module
3
+ *
4
+ * Provides the /export command for exporting conversation history.
5
+ * Always shows the interactive export wizard overlay.
6
+ */
7
+ /**
8
+ * Export command definition
9
+ * Always shows the interactive export wizard overlay (handled by ALWAYS_OVERLAY)
10
+ */
11
+ export const exportCommand = {
12
+ name: 'export',
13
+ description: 'Export conversation to markdown or JSON',
14
+ usage: '/export',
15
+ category: 'Session',
16
+ handler: async (_args, _agent, _ctx) => {
17
+ // This handler is never called - export is in ALWAYS_OVERLAY
18
+ // which intercepts and shows the export wizard overlay instead
19
+ return true;
20
+ },
21
+ };