dexto 1.6.0 → 1.6.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 (132) hide show
  1. package/dist/agents/coding-agent/coding-agent.yml +3 -1
  2. package/dist/cli/assets/sounds/SOURCES.md +35 -0
  3. package/dist/cli/assets/sounds/boot.wav +0 -0
  4. package/dist/cli/assets/sounds/chime.wav +0 -0
  5. package/dist/cli/assets/sounds/coin.wav +0 -0
  6. package/dist/cli/assets/sounds/confirm.wav +0 -0
  7. package/dist/cli/assets/sounds/levelup.wav +0 -0
  8. package/dist/cli/assets/sounds/ping.wav +0 -0
  9. package/dist/cli/assets/sounds/powerup.wav +0 -0
  10. package/dist/cli/assets/sounds/startup.wav +0 -0
  11. package/dist/cli/assets/sounds/success.wav +0 -0
  12. package/dist/cli/assets/sounds/treasure.wav +0 -0
  13. package/dist/cli/assets/sounds/win.wav +0 -0
  14. package/dist/cli/commands/interactive-commands/exit-handler.d.ts +12 -0
  15. package/dist/cli/commands/interactive-commands/exit-handler.d.ts.map +1 -0
  16. package/dist/cli/commands/interactive-commands/exit-handler.js +20 -0
  17. package/dist/cli/commands/interactive-commands/exit-stats.d.ts +24 -0
  18. package/dist/cli/commands/interactive-commands/exit-stats.d.ts.map +1 -0
  19. package/dist/cli/commands/interactive-commands/exit-stats.js +17 -0
  20. package/dist/cli/commands/interactive-commands/general-commands.d.ts.map +1 -1
  21. package/dist/cli/commands/interactive-commands/general-commands.js +53 -3
  22. package/dist/cli/commands/interactive-commands/prompt-commands.d.ts.map +1 -1
  23. package/dist/cli/commands/interactive-commands/prompt-commands.js +12 -67
  24. package/dist/cli/commands/interactive-commands/session/session-commands.d.ts.map +1 -1
  25. package/dist/cli/commands/interactive-commands/session/session-commands.js +0 -2
  26. package/dist/cli/commands/interactive-commands/system/system-commands.d.ts +1 -13
  27. package/dist/cli/commands/interactive-commands/system/system-commands.d.ts.map +1 -1
  28. package/dist/cli/commands/interactive-commands/system/system-commands.js +45 -54
  29. package/dist/cli/ink-cli/InkCLIRefactored.d.ts.map +1 -1
  30. package/dist/cli/ink-cli/InkCLIRefactored.js +132 -21
  31. package/dist/cli/ink-cli/components/ApprovalPrompt.d.ts.map +1 -1
  32. package/dist/cli/ink-cli/components/ApprovalPrompt.js +74 -20
  33. package/dist/cli/ink-cli/components/ElicitationForm.d.ts +5 -3
  34. package/dist/cli/ink-cli/components/ElicitationForm.d.ts.map +1 -1
  35. package/dist/cli/ink-cli/components/ElicitationForm.js +414 -180
  36. package/dist/cli/ink-cli/components/ResourceAutocomplete.d.ts.map +1 -1
  37. package/dist/cli/ink-cli/components/ResourceAutocomplete.js +20 -11
  38. package/dist/cli/ink-cli/components/SlashCommandAutocomplete.d.ts.map +1 -1
  39. package/dist/cli/ink-cli/components/SlashCommandAutocomplete.js +47 -67
  40. package/dist/cli/ink-cli/components/StatusBar.d.ts.map +1 -1
  41. package/dist/cli/ink-cli/components/StatusBar.js +10 -4
  42. package/dist/cli/ink-cli/components/base/BaseSelector.d.ts +2 -1
  43. package/dist/cli/ink-cli/components/base/BaseSelector.d.ts.map +1 -1
  44. package/dist/cli/ink-cli/components/base/BaseSelector.js +37 -27
  45. package/dist/cli/ink-cli/components/chat/Header.d.ts.map +1 -1
  46. package/dist/cli/ink-cli/components/chat/Header.js +1 -1
  47. package/dist/cli/ink-cli/components/chat/MessageItem.d.ts.map +1 -1
  48. package/dist/cli/ink-cli/components/chat/MessageItem.js +3 -1
  49. package/dist/cli/ink-cli/components/chat/ToolIcon.d.ts.map +1 -1
  50. package/dist/cli/ink-cli/components/chat/ToolIcon.js +5 -15
  51. package/dist/cli/ink-cli/components/chat/styled-boxes/LogConfigBox.d.ts.map +1 -1
  52. package/dist/cli/ink-cli/components/chat/styled-boxes/LogConfigBox.js +1 -1
  53. package/dist/cli/ink-cli/components/modes/AlternateBufferCLI.d.ts.map +1 -1
  54. package/dist/cli/ink-cli/components/modes/AlternateBufferCLI.js +4 -2
  55. package/dist/cli/ink-cli/components/modes/StaticCLI.d.ts.map +1 -1
  56. package/dist/cli/ink-cli/components/modes/StaticCLI.js +9 -2
  57. package/dist/cli/ink-cli/components/overlays/CommandOutputOverlay.d.ts +13 -0
  58. package/dist/cli/ink-cli/components/overlays/CommandOutputOverlay.d.ts.map +1 -0
  59. package/dist/cli/ink-cli/components/overlays/CommandOutputOverlay.js +60 -0
  60. package/dist/cli/ink-cli/components/overlays/LogLevelSelector.js +1 -1
  61. package/dist/cli/ink-cli/components/overlays/ModelSelectorRefactored.d.ts.map +1 -1
  62. package/dist/cli/ink-cli/components/overlays/ModelSelectorRefactored.js +213 -100
  63. package/dist/cli/ink-cli/components/overlays/PromptList.d.ts.map +1 -1
  64. package/dist/cli/ink-cli/components/overlays/PromptList.js +12 -16
  65. package/dist/cli/ink-cli/components/overlays/SoundsSelector.d.ts +21 -0
  66. package/dist/cli/ink-cli/components/overlays/SoundsSelector.d.ts.map +1 -0
  67. package/dist/cli/ink-cli/components/overlays/SoundsSelector.js +566 -0
  68. package/dist/cli/ink-cli/components/overlays/ToolBrowser.d.ts.map +1 -1
  69. package/dist/cli/ink-cli/components/overlays/ToolBrowser.js +94 -39
  70. package/dist/cli/ink-cli/components/overlays/custom-model-wizard/LocalModelWizard.d.ts.map +1 -1
  71. package/dist/cli/ink-cli/components/overlays/custom-model-wizard/LocalModelWizard.js +8 -13
  72. package/dist/cli/ink-cli/components/renderers/FilePreviewRenderer.d.ts +3 -3
  73. package/dist/cli/ink-cli/components/renderers/FilePreviewRenderer.d.ts.map +1 -1
  74. package/dist/cli/ink-cli/components/renderers/FilePreviewRenderer.js +6 -5
  75. package/dist/cli/ink-cli/components/renderers/FileRenderer.d.ts +3 -1
  76. package/dist/cli/ink-cli/components/renderers/FileRenderer.d.ts.map +1 -1
  77. package/dist/cli/ink-cli/components/renderers/FileRenderer.js +18 -7
  78. package/dist/cli/ink-cli/components/renderers/ShellRenderer.d.ts.map +1 -1
  79. package/dist/cli/ink-cli/components/renderers/ShellRenderer.js +7 -17
  80. package/dist/cli/ink-cli/components/renderers/index.d.ts.map +1 -1
  81. package/dist/cli/ink-cli/components/renderers/index.js +1 -1
  82. package/dist/cli/ink-cli/components/shared/FocusOverlayFrame.d.ts +7 -0
  83. package/dist/cli/ink-cli/components/shared/FocusOverlayFrame.d.ts.map +1 -0
  84. package/dist/cli/ink-cli/components/shared/FocusOverlayFrame.js +8 -0
  85. package/dist/cli/ink-cli/components/shared/HintBar.d.ts +6 -0
  86. package/dist/cli/ink-cli/components/shared/HintBar.d.ts.map +1 -0
  87. package/dist/cli/ink-cli/components/shared/HintBar.js +6 -0
  88. package/dist/cli/ink-cli/constants/spinnerFrames.d.ts +2 -0
  89. package/dist/cli/ink-cli/constants/spinnerFrames.d.ts.map +1 -0
  90. package/dist/cli/ink-cli/constants/spinnerFrames.js +1 -0
  91. package/dist/cli/ink-cli/constants/tips.d.ts.map +1 -1
  92. package/dist/cli/ink-cli/constants/tips.js +1 -0
  93. package/dist/cli/ink-cli/containers/InputContainer.d.ts.map +1 -1
  94. package/dist/cli/ink-cli/containers/InputContainer.js +19 -15
  95. package/dist/cli/ink-cli/containers/OverlayContainer.d.ts.map +1 -1
  96. package/dist/cli/ink-cli/containers/OverlayContainer.js +21 -5
  97. package/dist/cli/ink-cli/hooks/useAnimationTick.d.ts +11 -0
  98. package/dist/cli/ink-cli/hooks/useAnimationTick.d.ts.map +1 -0
  99. package/dist/cli/ink-cli/hooks/useAnimationTick.js +54 -0
  100. package/dist/cli/ink-cli/hooks/useCLIState.d.ts.map +1 -1
  101. package/dist/cli/ink-cli/hooks/useCLIState.js +1 -0
  102. package/dist/cli/ink-cli/services/processStream.d.ts.map +1 -1
  103. package/dist/cli/ink-cli/services/processStream.js +17 -8
  104. package/dist/cli/ink-cli/state/initialState.d.ts.map +1 -1
  105. package/dist/cli/ink-cli/state/initialState.js +1 -0
  106. package/dist/cli/ink-cli/state/types.d.ts +13 -1
  107. package/dist/cli/ink-cli/state/types.d.ts.map +1 -1
  108. package/dist/cli/ink-cli/utils/commandOverlays.d.ts.map +1 -1
  109. package/dist/cli/ink-cli/utils/commandOverlays.js +1 -0
  110. package/dist/cli/ink-cli/utils/elicitationSchema.d.ts +11 -0
  111. package/dist/cli/ink-cli/utils/elicitationSchema.d.ts.map +1 -0
  112. package/dist/cli/ink-cli/utils/elicitationSchema.js +80 -0
  113. package/dist/cli/ink-cli/utils/index.d.ts +1 -1
  114. package/dist/cli/ink-cli/utils/index.d.ts.map +1 -1
  115. package/dist/cli/ink-cli/utils/index.js +1 -1
  116. package/dist/cli/ink-cli/utils/messageFormatting.d.ts +2 -17
  117. package/dist/cli/ink-cli/utils/messageFormatting.d.ts.map +1 -1
  118. package/dist/cli/ink-cli/utils/messageFormatting.js +22 -128
  119. package/dist/cli/ink-cli/utils/overlayPresentation.d.ts +19 -0
  120. package/dist/cli/ink-cli/utils/overlayPresentation.d.ts.map +1 -0
  121. package/dist/cli/ink-cli/utils/overlayPresentation.js +33 -0
  122. package/dist/cli/ink-cli/utils/overlaySizing.d.ts +19 -0
  123. package/dist/cli/ink-cli/utils/overlaySizing.d.ts.map +1 -0
  124. package/dist/cli/ink-cli/utils/overlaySizing.js +11 -0
  125. package/dist/cli/ink-cli/utils/soundNotification.d.ts +19 -13
  126. package/dist/cli/ink-cli/utils/soundNotification.d.ts.map +1 -1
  127. package/dist/cli/ink-cli/utils/soundNotification.js +120 -97
  128. package/dist/utils/session-logger-factory.d.ts.map +1 -1
  129. package/dist/utils/session-logger-factory.js +17 -2
  130. package/dist/webui/assets/{index-DwtueA8l.js → index-CKhumsZA.js} +135 -135
  131. package/dist/webui/index.html +1 -1
  132. package/package.json +11 -11
@@ -123,7 +123,9 @@ permissions:
123
123
  - bash_output # Check background process output
124
124
  - kill_process # Kill processes without approval (only processes started by agent)
125
125
  - todo_write # Todo updates don't need approval
126
+ - plan_create # Create plan without approval
126
127
  - plan_read # Read plan without approval
128
+ - plan_update # Update plan without approval
127
129
  - wait_for # Wait for background tasks without approval
128
130
  - check_task # Check background tasks without approval
129
131
 
@@ -166,7 +168,7 @@ tools:
166
168
  basePath: "${{dexto.project_dir}}/plans"
167
169
  - type: agent-spawner
168
170
  maxConcurrentAgents: 5
169
- defaultTimeout: 300000
171
+ defaultTimeout: 0
170
172
  allowSpawning: true
171
173
  # List of agent IDs from the registry that can be spawned.
172
174
  # Agent metadata (name, description) is pulled from the registry at runtime.
@@ -0,0 +1,35 @@
1
+ # Sound sources / licensing
2
+
3
+ This folder contains built-in sounds shipped with the Dexto CLI.
4
+
5
+ Note: Some defaults are provided by the OS (e.g., macOS system sounds) and are not included here.
6
+
7
+ ## Third-party sources
8
+
9
+ ### `coin.wav`
10
+
11
+ - Source: ā€œCoins 1ā€ by AceOfSpadesProduc100 (Freesound sound ID `341695`)
12
+ - License: Creative Commons Attribution 4.0 (CC BY 4.0)
13
+ - URL: https://freesound.org/s/341695/
14
+ - Changes: none
15
+
16
+ ### `startup.wav`
17
+
18
+ - Source: ā€œGame Boy Classic - Startup Soundā€ by toumas (Freesound sound ID `610484`)
19
+ - License: Creative Commons 0 (CC0)
20
+ - URL: https://freesound.org/s/610484/
21
+ - Changes: trimmed/processed for CLI use
22
+
23
+ ### `boot.wav`, `ping.wav`, `win.wav`
24
+
25
+ - Source pack: ā€œGame Audio - UI SFXā€ by GameAudio (Freesound pack ID `13940`)
26
+ - License: Creative Commons 0 (CC0)
27
+ - Pack URL: https://freesound.org/people/GameAudio/packs/13940/
28
+ - Original sound IDs:
29
+ - `boot.wav`: `220207`
30
+ - `ping.wav`: `220212`
31
+ - `win.wav`: `220184`
32
+
33
+ ## First-party
34
+
35
+ Other sounds in this folder were created for Dexto.
Binary file
Binary file
Binary file
Binary file
Binary file
@@ -0,0 +1,12 @@
1
+ /**
2
+ * Exit Handler
3
+ *
4
+ * Provides a way for commands to trigger a graceful CLI exit.
5
+ * The exit function is registered by the Ink app and can be called
6
+ * by commands to unmount the app properly.
7
+ */
8
+ type ExitFunction = () => void;
9
+ export declare function registerExitHandler(fn: ExitFunction): void;
10
+ export declare function triggerExit(): void;
11
+ export {};
12
+ //# sourceMappingURL=exit-handler.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"exit-handler.d.ts","sourceRoot":"","sources":["../../../../src/cli/commands/interactive-commands/exit-handler.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,KAAK,YAAY,GAAG,MAAM,IAAI,CAAC;AAI/B,wBAAgB,mBAAmB,CAAC,EAAE,EAAE,YAAY,GAAG,IAAI,CAE1D;AAED,wBAAgB,WAAW,IAAI,IAAI,CAOlC"}
@@ -0,0 +1,20 @@
1
+ /**
2
+ * Exit Handler
3
+ *
4
+ * Provides a way for commands to trigger a graceful CLI exit.
5
+ * The exit function is registered by the Ink app and can be called
6
+ * by commands to unmount the app properly.
7
+ */
8
+ let exitFn = null;
9
+ export function registerExitHandler(fn) {
10
+ exitFn = fn;
11
+ }
12
+ export function triggerExit() {
13
+ if (exitFn) {
14
+ exitFn();
15
+ }
16
+ else {
17
+ // Fallback to process.exit if exit handler not registered
18
+ process.exit(0);
19
+ }
20
+ }
@@ -0,0 +1,24 @@
1
+ /**
2
+ * Exit Stats Storage
3
+ *
4
+ * Stores session statistics to be displayed after the CLI exits.
5
+ * This allows the stats to be printed to stdout after Ink unmounts,
6
+ * ensuring they appear at the bottom of the terminal.
7
+ */
8
+ import type { SessionMetadata } from '@dexto/core';
9
+ export interface ExitSessionStats {
10
+ sessionId?: string;
11
+ duration?: string;
12
+ messageCount: {
13
+ total: number;
14
+ user: number;
15
+ assistant: number;
16
+ };
17
+ tokenUsage?: NonNullable<SessionMetadata['tokenUsage']>;
18
+ estimatedCost?: SessionMetadata['estimatedCost'];
19
+ modelStats?: NonNullable<SessionMetadata['modelStats']>;
20
+ }
21
+ export declare function setExitStats(stats: ExitSessionStats): void;
22
+ export declare function getExitStats(): ExitSessionStats | null;
23
+ export declare function clearExitStats(): void;
24
+ //# sourceMappingURL=exit-stats.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"exit-stats.d.ts","sourceRoot":"","sources":["../../../../src/cli/commands/interactive-commands/exit-stats.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,aAAa,CAAC;AAEnD,MAAM,WAAW,gBAAgB;IAC7B,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,YAAY,EAAE;QACV,KAAK,EAAE,MAAM,CAAC;QACd,IAAI,EAAE,MAAM,CAAC;QACb,SAAS,EAAE,MAAM,CAAC;KACrB,CAAC;IACF,UAAU,CAAC,EAAE,WAAW,CAAC,eAAe,CAAC,YAAY,CAAC,CAAC,CAAC;IACxD,aAAa,CAAC,EAAE,eAAe,CAAC,eAAe,CAAC,CAAC;IACjD,UAAU,CAAC,EAAE,WAAW,CAAC,eAAe,CAAC,YAAY,CAAC,CAAC,CAAC;CAC3D;AAID,wBAAgB,YAAY,CAAC,KAAK,EAAE,gBAAgB,GAAG,IAAI,CAE1D;AAED,wBAAgB,YAAY,IAAI,gBAAgB,GAAG,IAAI,CAEtD;AAED,wBAAgB,cAAc,IAAI,IAAI,CAErC"}
@@ -0,0 +1,17 @@
1
+ /**
2
+ * Exit Stats Storage
3
+ *
4
+ * Stores session statistics to be displayed after the CLI exits.
5
+ * This allows the stats to be printed to stdout after Ink unmounts,
6
+ * ensuring they appear at the bottom of the terminal.
7
+ */
8
+ let exitStats = null;
9
+ export function setExitStats(stats) {
10
+ exitStats = stats;
11
+ }
12
+ export function getExitStats() {
13
+ return exitStats;
14
+ }
15
+ export function clearExitStats() {
16
+ exitStats = null;
17
+ }
@@ -1 +1 @@
1
- {"version":3,"file":"general-commands.d.ts","sourceRoot":"","sources":["../../../../src/cli/commands/interactive-commands/general-commands.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AAKH,OAAO,KAAK,EAAE,iBAAiB,EAAwC,MAAM,qBAAqB,CAAC;AAgGnG;;GAEG;AACH,wBAAgB,iBAAiB,CAAC,cAAc,EAAE,MAAM,iBAAiB,EAAE,GAAG,iBAAiB,CAgC9F;AAED;;;GAGG;AACH,eAAO,MAAM,eAAe,EAAE,iBAAiB,EAyZ9C,CAAC"}
1
+ {"version":3,"file":"general-commands.d.ts","sourceRoot":"","sources":["../../../../src/cli/commands/interactive-commands/general-commands.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AAKH,OAAO,KAAK,EAAE,iBAAiB,EAAwC,MAAM,qBAAqB,CAAC;AAkGnG;;GAEG;AACH,wBAAgB,iBAAiB,CAAC,cAAc,EAAE,MAAM,iBAAiB,EAAE,GAAG,iBAAiB,CAgC9F;AAED;;;GAGG;AACH,eAAO,MAAM,eAAe,EAAE,iBAAiB,EAid9C,CAAC"}
@@ -14,6 +14,8 @@ import { spawn } from 'child_process';
14
14
  import { formatForInkCli } from './utils/format-output.js';
15
15
  import { CommandOutputHelper } from './utils/command-output.js';
16
16
  import { writeToClipboard } from '../../ink-cli/utils/clipboardUtils.js';
17
+ import { setExitStats } from './exit-stats.js';
18
+ import { triggerExit } from './exit-handler.js';
17
19
  /**
18
20
  * Get the shell rc file path for the given shell
19
21
  */
@@ -159,9 +161,57 @@ export const generalCommands = [
159
161
  usage: '/exit',
160
162
  category: 'General',
161
163
  aliases: ['quit', 'q'],
162
- handler: async (_args, _agent, _ctx) => {
163
- console.log(chalk.rgb(255, 165, 0)('Exiting AI CLI. Goodbye!'));
164
- process.exit(0);
164
+ handler: async (_args, agent, ctx) => {
165
+ // Store session stats to be displayed after Ink exits
166
+ try {
167
+ const { sessionId } = ctx;
168
+ if (sessionId) {
169
+ const [sessionMetadata, history] = await Promise.all([
170
+ agent.sessionManager.getSessionMetadata(sessionId),
171
+ agent.getSessionHistory(sessionId),
172
+ ]);
173
+ if (sessionMetadata) {
174
+ // Calculate session duration
175
+ let durationStr;
176
+ if (sessionMetadata.createdAt) {
177
+ const duration = Date.now() - new Date(sessionMetadata.createdAt).getTime();
178
+ const minutes = Math.floor(duration / 60000);
179
+ const seconds = Math.floor((duration % 60000) / 1000);
180
+ durationStr = minutes > 0 ? `${minutes}m ${seconds}s` : `${seconds}s`;
181
+ }
182
+ // Message counts
183
+ const messageCount = {
184
+ total: history?.length || 0,
185
+ user: history?.filter((msg) => msg.role === 'user').length || 0,
186
+ assistant: history?.filter((msg) => msg.role === 'assistant').length || 0,
187
+ };
188
+ // Store stats for display after exit
189
+ setExitStats({
190
+ ...(sessionId && { sessionId }),
191
+ ...(durationStr && { duration: durationStr }),
192
+ messageCount,
193
+ ...(sessionMetadata.tokenUsage && {
194
+ tokenUsage: sessionMetadata.tokenUsage,
195
+ }),
196
+ ...(sessionMetadata.estimatedCost !== undefined && {
197
+ estimatedCost: sessionMetadata.estimatedCost,
198
+ }),
199
+ ...(sessionMetadata.modelStats && {
200
+ modelStats: sessionMetadata.modelStats,
201
+ }),
202
+ });
203
+ }
204
+ }
205
+ }
206
+ catch (error) {
207
+ // Silently ignore errors - don't block exit
208
+ agent.logger.debug(`Failed to collect session stats on exit: ${error instanceof Error ? error.message : String(error)}`);
209
+ }
210
+ // Trigger graceful exit - this will unmount the Ink app
211
+ // After unmount, session stats will be printed to stdout
212
+ triggerExit();
213
+ // Return true to indicate command was handled
214
+ return true;
165
215
  },
166
216
  },
167
217
  {
@@ -1 +1 @@
1
- {"version":3,"file":"prompt-commands.d.ts","sourceRoot":"","sources":["../../../../src/cli/commands/interactive-commands/prompt-commands.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AAGH,OAAO,KAAK,EAAE,UAAU,EAAc,MAAM,aAAa,CAAC;AAC1D,OAAO,KAAK,EAAE,iBAAiB,EAAwC,MAAM,qBAAqB,CAAC;AAKnG;;GAEG;AACH,eAAO,MAAM,cAAc,EAAE,iBAAiB,EA8L7C,CAAC;AA2JF;;;;;GAKG;AACH,wBAAsB,wBAAwB,CAAC,KAAK,EAAE,UAAU,GAAG,OAAO,CAAC,iBAAiB,EAAE,CAAC,CAiB9F"}
1
+ {"version":3,"file":"prompt-commands.d.ts","sourceRoot":"","sources":["../../../../src/cli/commands/interactive-commands/prompt-commands.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AAEH,OAAO,KAAK,EAAE,UAAU,EAAc,MAAM,aAAa,CAAC;AAC1D,OAAO,KAAK,EAAE,iBAAiB,EAAwC,MAAM,qBAAqB,CAAC;AAKnG;;GAEG;AACH,eAAO,MAAM,cAAc,EAAE,iBAAiB,EAiI7C,CAAC;AA6IF;;;;;GAKG;AACH,wBAAsB,wBAAwB,CAAC,KAAK,EAAE,UAAU,GAAG,OAAO,CAAC,iBAAiB,EAAE,CAAC,CAiB9F"}
@@ -9,7 +9,6 @@
9
9
  * - /prompts - List all available prompts (MCP + internal)
10
10
  * - /<prompt-name> [args] - Direct prompt execution (auto-generated for each prompt)
11
11
  */
12
- import chalk from 'chalk';
13
12
  import { formatForInkCli } from './utils/format-output.js';
14
13
  import { createSendMessageMarker } from '../../ink-cli/services/index.js';
15
14
  // Avoid depending on core types to keep CLI typecheck independent of build
@@ -51,7 +50,6 @@ export const promptCommands = [
51
50
  const promptNames = Object.keys(prompts || {});
52
51
  if (promptNames.length === 0) {
53
52
  const output = '\nāš ļø No prompts available';
54
- console.log(chalk.rgb(255, 165, 0)(output));
55
53
  return formatForInkCli(output);
56
54
  }
57
55
  // Build output string
@@ -117,59 +115,10 @@ export const promptCommands = [
117
115
  }
118
116
  outputLines.push(`Total: ${promptNames.length} prompts`);
119
117
  const output = outputLines.join('\n');
120
- // Log for regular CLI (with chalk formatting)
121
- console.log(chalk.bold.green('\nšŸ“ Available Prompts:\n'));
122
- if (mcpPrompts.length > 0) {
123
- console.log(chalk.cyan('šŸ”— MCP Prompts:'));
124
- mcpPrompts.forEach((name) => {
125
- const info = prompts[name];
126
- if (info) {
127
- const displayName = info.displayName || name;
128
- const title = info.title && info.title !== displayName ? ` (${info.title})` : '';
129
- const desc = info.description ? ` - ${info.description}` : '';
130
- const args = info.arguments && info.arguments.length > 0
131
- ? ` [args: ${info.arguments
132
- .map((a) => `${a.name}${a.required ? '*' : ''}`)
133
- .join(', ')}]`
134
- : '';
135
- console.log(` ${chalk.blue(displayName)}${chalk.rgb(255, 165, 0)(title)}${chalk.gray(desc)}${chalk.gray(args)}`);
136
- }
137
- });
138
- console.log();
139
- }
140
- if (configPrompts.length > 0) {
141
- console.log(chalk.cyan('šŸ“‹ Config Prompts:'));
142
- configPrompts.forEach((name) => {
143
- const info = prompts[name];
144
- if (info) {
145
- const displayName = info.displayName || name;
146
- const title = info.title && info.title !== displayName ? ` (${info.title})` : '';
147
- const desc = info.description ? ` - ${info.description}` : '';
148
- console.log(` ${chalk.blue(displayName)}${chalk.rgb(255, 165, 0)(title)}${chalk.gray(desc)}`);
149
- }
150
- });
151
- console.log();
152
- }
153
- if (customPrompts.length > 0) {
154
- console.log(chalk.greenBright('✨ Custom Prompts:'));
155
- customPrompts.forEach((name) => {
156
- const info = prompts[name];
157
- if (info) {
158
- const displayName = info.displayName || name;
159
- const title = info.title && info.title !== displayName ? ` (${info.title})` : '';
160
- const desc = info.description ? ` - ${info.description}` : '';
161
- console.log(` ${chalk.blue(displayName)}${chalk.rgb(255, 165, 0)(title)}${chalk.gray(desc)}`);
162
- }
163
- });
164
- console.log();
165
- }
166
- console.log(chalk.gray(`Total: ${promptNames.length} prompts`));
167
- console.log(chalk.gray('šŸ’” Use /<prompt-name> to execute a prompt directly\n'));
168
118
  return formatForInkCli(output);
169
119
  }
170
120
  catch (error) {
171
121
  const errorMsg = `Error listing prompts: ${error instanceof Error ? error.message : String(error)}`;
172
- console.error(chalk.red(`āŒ ${errorMsg}`));
173
122
  return formatForInkCli(`āŒ ${errorMsg}`);
174
123
  }
175
124
  },
@@ -212,34 +161,31 @@ function createPromptCommand(promptInfo) {
212
161
  if (ctx.sessionId) {
213
162
  // Apply model override if specified
214
163
  if (result.model) {
215
- console.log(chalk.gray(`šŸ”„ Switching model to '${result.model}' for this prompt`));
216
164
  try {
217
165
  await agent.switchLLM({ model: result.model }, ctx.sessionId);
218
166
  }
219
167
  catch (modelError) {
220
- console.log(chalk.yellow(`āš ļø Failed to switch model: ${modelError instanceof Error ? modelError.message : String(modelError)}`));
168
+ agent.logger.warn('Failed to switch model for prompt override', {
169
+ model: result.model,
170
+ error: modelError instanceof Error
171
+ ? modelError.message
172
+ : String(modelError),
173
+ });
221
174
  }
222
175
  }
223
176
  // Apply auto-approve tools if specified
224
177
  // These tools will skip confirmation prompts during skill execution
225
178
  if (result.allowedTools && result.allowedTools.length > 0) {
226
- const displayTools = result.allowedTools.map((tool) => {
227
- if (tool.startsWith('mcp--')) {
228
- const trimmed = tool.replace(/^mcp--/, '');
229
- const [server, ...rest] = trimmed.split('--');
230
- if (server && rest.length > 0) {
231
- return `${server}/${rest.join('--')}`;
232
- }
233
- return trimmed;
234
- }
235
- return tool;
236
- });
237
- console.log(chalk.gray(`šŸ”“ Auto-approving tools: ${displayTools.join(', ')}`));
238
179
  try {
239
180
  agent.toolManager.setSessionAutoApproveTools(ctx.sessionId, result.allowedTools);
240
181
  }
241
182
  catch (toolError) {
242
- console.log(chalk.yellow(`āš ļø Failed to set auto-approve tools: ${toolError instanceof Error ? toolError.message : String(toolError)}`));
183
+ agent.logger.warn('Failed to set auto-approve tools for prompt', {
184
+ tools: result.allowedTools,
185
+ error: toolError instanceof Error
186
+ ? toolError.message
187
+ : String(toolError),
188
+ });
243
189
  }
244
190
  }
245
191
  }
@@ -285,7 +231,6 @@ ${finalText.trim()}`;
285
231
  }
286
232
  else {
287
233
  const warningMsg = `āš ļø Prompt '${commandName}' returned no content`;
288
- console.log(chalk.rgb(255, 165, 0)(warningMsg));
289
234
  return formatForInkCli(warningMsg);
290
235
  }
291
236
  }
@@ -1 +1 @@
1
- {"version":3,"file":"session-commands.d.ts","sourceRoot":"","sources":["../../../../../src/cli/commands/interactive-commands/session/session-commands.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;GAaG;AAIH,OAAO,KAAK,EAAE,iBAAiB,EAAkB,MAAM,sBAAsB,CAAC;AAE9E;;;;GAIG;AACH,eAAO,MAAM,aAAa,EAAE,iBAsB3B,CAAC;AAEF;;GAEG;AACH,eAAO,MAAM,aAAa,EAAE,iBAc3B,CAAC;AAEF;;;;GAIG;AACH,eAAO,MAAM,aAAa,EAAE,iBAa3B,CAAC"}
1
+ {"version":3,"file":"session-commands.d.ts","sourceRoot":"","sources":["../../../../../src/cli/commands/interactive-commands/session/session-commands.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;GAaG;AAGH,OAAO,KAAK,EAAE,iBAAiB,EAAkB,MAAM,sBAAsB,CAAC;AAE9E;;;;GAIG;AACH,eAAO,MAAM,aAAa,EAAE,iBAqB3B,CAAC;AAEF;;GAEG;AACH,eAAO,MAAM,aAAa,EAAE,iBAc3B,CAAC;AAEF;;;;GAIG;AACH,eAAO,MAAM,aAAa,EAAE,iBAa3B,CAAC"}
@@ -12,7 +12,6 @@
12
12
  * Note: For non-interactive session subcommands (list, history, delete),
13
13
  * see src/cli/commands/session-commands.ts
14
14
  */
15
- import chalk from 'chalk';
16
15
  /**
17
16
  * Resume command - shows interactive session selector
18
17
  * Note: In interactive CLI, this always shows the selector (args ignored)
@@ -32,7 +31,6 @@ export const resumeCommand = {
32
31
  'šŸ“‹ Resume Session',
33
32
  '\nType /resume to show the session selector\n',
34
33
  ].join('\n');
35
- console.log(chalk.blue(helpText));
36
34
  return helpText;
37
35
  },
38
36
  };
@@ -1,16 +1,4 @@
1
- /**
2
- * System Commands Module
3
- *
4
- * This module defines system-level slash commands for the Dexto CLI interface.
5
- * These commands provide system configuration, logging, and statistics functionality.
6
- *
7
- * Available System Commands:
8
- * - /log [level] - Set or view log level
9
- * - /config - Show current configuration
10
- * - /stats - Show system statistics
11
- * - /stream - Toggle streaming mode for LLM responses
12
- */
13
- import type { CommandDefinition } from '../command-parser.js';
1
+ import { type CommandDefinition } from '../command-parser.js';
14
2
  /**
15
3
  * System commands for configuration and monitoring
16
4
  */
@@ -1 +1 @@
1
- {"version":3,"file":"system-commands.d.ts","sourceRoot":"","sources":["../../../../../src/cli/commands/interactive-commands/system/system-commands.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;GAWG;AAIH,OAAO,KAAK,EAAE,iBAAiB,EAAwC,MAAM,sBAAsB,CAAC;AAKpG;;GAEG;AACH,eAAO,MAAM,cAAc,EAAE,iBAAiB,EAkN7C,CAAC"}
1
+ {"version":3,"file":"system-commands.d.ts","sourceRoot":"","sources":["../../../../../src/cli/commands/interactive-commands/system/system-commands.ts"],"names":[],"mappings":"AAaA,OAAO,EAEH,KAAK,iBAAiB,EAGzB,MAAM,sBAAsB,CAAC;AAmB9B;;GAEG;AACH,eAAO,MAAM,cAAc,EAAE,iBAAiB,EAuN7C,CAAC"}
@@ -1,19 +1,15 @@
1
- /**
2
- * System Commands Module
3
- *
4
- * This module defines system-level slash commands for the Dexto CLI interface.
5
- * These commands provide system configuration, logging, and statistics functionality.
6
- *
7
- * Available System Commands:
8
- * - /log [level] - Set or view log level
9
- * - /config - Show current configuration
10
- * - /stats - Show system statistics
11
- * - /stream - Toggle streaming mode for LLM responses
12
- */
13
- import chalk from 'chalk';
14
- import { logger } from '@dexto/core';
1
+ import { overlayOnlyHandler, } from '../command-parser.js';
15
2
  import { formatForInkCli } from '../utils/format-output.js';
16
3
  import { CommandOutputHelper } from '../utils/command-output.js';
4
+ const validLevels = [
5
+ 'error',
6
+ 'warn',
7
+ 'info',
8
+ 'debug',
9
+ 'silly',
10
+ ];
11
+ const validLevelSet = new Set(validLevels);
12
+ const isLogLevel = (value) => validLevelSet.has(value);
17
13
  /**
18
14
  * System commands for configuration and monitoring
19
15
  */
@@ -24,50 +20,38 @@ export const systemCommands = [
24
20
  usage: '/log [level]',
25
21
  category: 'System',
26
22
  aliases: [],
27
- handler: async (args, _agent, _ctx) => {
28
- const validLevels = ['error', 'warn', 'info', 'http', 'verbose', 'debug', 'silly'];
29
- const level = args[0];
30
- if (!level) {
31
- // Interactive view: show current level and options
32
- const currentLevel = logger.getLevel();
33
- const logFilePath = logger.getLogFilePath();
34
- console.log(chalk.bold.blue('\nšŸ“Š Logging Configuration:\n'));
35
- console.log(` Current level: ${chalk.green.bold(currentLevel)}`);
36
- if (logFilePath) {
37
- console.log(` Log file: ${chalk.cyan(logFilePath)}`);
23
+ handler: async (args, agent, ctx) => {
24
+ try {
25
+ const level = args[0];
26
+ if (!level) {
27
+ const currentLevel = agent.logger.getLevel();
28
+ const logFile = agent.logger.getLogFilePath();
29
+ const styledData = {
30
+ currentLevel,
31
+ logFile,
32
+ availableLevels: [...validLevels],
33
+ };
34
+ const fallbackLines = [
35
+ 'Logging Configuration:',
36
+ ` Current level: ${currentLevel}`,
37
+ logFile ? ` Log file: ${logFile}` : '',
38
+ ` Available levels: ${validLevels.join(', ')}`,
39
+ ' Use /log <level> to change level',
40
+ ].filter(Boolean);
41
+ return CommandOutputHelper.styled('log-config', styledData, fallbackLines.join('\n'));
42
+ }
43
+ if (isLogLevel(level)) {
44
+ await agent.setLogLevel(level, ctx.sessionId ? { sessionId: ctx.sessionId } : undefined);
45
+ return formatForInkCli(`āœ… Log level set to ${level}`);
38
46
  }
39
- console.log(chalk.gray('\n Available levels (from least to most verbose):'));
40
- validLevels.forEach((lvl) => {
41
- const isCurrent = lvl === currentLevel;
42
- const marker = isCurrent ? chalk.green('ā–¶') : ' ';
43
- const levelText = isCurrent ? chalk.green.bold(lvl) : chalk.gray(lvl);
44
- console.log(` ${marker} ${levelText}`);
45
- });
46
- console.log(chalk.gray('\n šŸ’” Use /log <level> to change level (e.g., /log debug)\n'));
47
- const output = [
48
- '\nšŸ“Š Logging Configuration:',
49
- `Current level: ${currentLevel}`,
50
- logFilePath ? `Log file: ${logFilePath}` : '',
51
- '\nAvailable levels: error, warn, info, http, verbose, debug, silly',
52
- 'šŸ’” Use /log <level> to change level',
53
- ]
54
- .filter(Boolean)
55
- .join('\n');
56
- return formatForInkCli(output);
57
- }
58
- if (validLevels.includes(level)) {
59
- logger.setLevel(level);
60
- logger.info(`Log level set to ${level}`, null, 'green');
61
- console.log(chalk.green(`āœ… Log level changed to: ${chalk.bold(level)}`));
62
- const output = `āœ… Log level set to ${level}`;
63
- return formatForInkCli(output);
64
- }
65
- else {
66
47
  const errorMsg = `āŒ Invalid log level: ${level}\nValid levels: ${validLevels.join(', ')}`;
67
- console.log(chalk.red(`āŒ Invalid log level: ${chalk.bold(level)}`));
68
- console.log(chalk.gray(`Valid levels: ${validLevels.join(', ')}`));
69
48
  return formatForInkCli(errorMsg);
70
49
  }
50
+ catch (error) {
51
+ const errorMsg = `Failed to update log level: ${error instanceof Error ? error.message : String(error)}`;
52
+ agent.logger.error(errorMsg);
53
+ return formatForInkCli(`āŒ ${errorMsg}`);
54
+ }
71
55
  },
72
56
  },
73
57
  {
@@ -194,4 +178,11 @@ export const systemCommands = [
194
178
  return true;
195
179
  },
196
180
  },
181
+ {
182
+ name: 'sounds',
183
+ description: 'Configure sound notifications',
184
+ usage: '/sounds',
185
+ category: 'System',
186
+ handler: overlayOnlyHandler,
187
+ },
197
188
  ];
@@ -1 +1 @@
1
- {"version":3,"file":"InkCLIRefactored.d.ts","sourceRoot":"","sources":["../../../src/cli/ink-cli/InkCLIRefactored.tsx"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAIH,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,aAAa,CAAC;AAK9C,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,kBAAkB,CAAC;AAWpD,OAAO,KAAK,EAAE,wBAAwB,EAAE,MAAM,8BAA8B,CAAC;AAiB7E,UAAU,WAAW;IACjB,KAAK,EAAE,UAAU,CAAC;IAClB,gBAAgB,EAAE,MAAM,GAAG,IAAI,CAAC;IAChC,aAAa,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC;IACnC,WAAW,EAAE,WAAW,CAAC;IACzB,YAAY,EAAE,wBAAwB,GAAG,IAAI,CAAC;IAC9C,cAAc,EAAE,MAAM,GAAG,IAAI,CAAC;CACjC;AAwDD;;;;;;;GAOG;AACH,wBAAgB,gBAAgB,CAAC,EAC7B,KAAK,EACL,gBAAgB,EAChB,aAAa,EACb,WAAW,EACX,YAAY,EACZ,cAAc,GACjB,EAAE,WAAW,2CAkBb;AAED;;GAEG;AACH,MAAM,WAAW,aAAa;IAC1B,kDAAkD;IAClD,UAAU,CAAC,EAAE;QAAE,OAAO,EAAE,MAAM,CAAC;QAAC,MAAM,EAAE,MAAM,CAAC;QAAC,aAAa,EAAE,MAAM,CAAA;KAAE,GAAG,SAAS,CAAC;IACpF,wEAAwE;IACxE,cAAc,CAAC,EAAE,OAAO,GAAG,SAAS,CAAC;IACrC,mDAAmD;IACnD,cAAc,CAAC,EAAE,MAAM,GAAG,IAAI,GAAG,SAAS,CAAC;IAC3C,iEAAiE;IACjE,aAAa,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC;CACtC;AAED;;GAEG;AACH,wBAAsB,qBAAqB,CACvC,KAAK,EAAE,UAAU,EACjB,gBAAgB,EAAE,MAAM,GAAG,IAAI,EAC/B,OAAO,GAAE,aAAkB,GAC5B,OAAO,CAAC,IAAI,CAAC,CAwFf"}
1
+ {"version":3,"file":"InkCLIRefactored.d.ts","sourceRoot":"","sources":["../../../src/cli/ink-cli/InkCLIRefactored.tsx"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAIH,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,aAAa,CAAC;AAK9C,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,kBAAkB,CAAC;AAWpD,OAAO,KAAK,EAAe,wBAAwB,EAAE,MAAM,8BAA8B,CAAC;AAuB1F,UAAU,WAAW;IACjB,KAAK,EAAE,UAAU,CAAC;IAClB,gBAAgB,EAAE,MAAM,GAAG,IAAI,CAAC;IAChC,aAAa,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC;IACnC,WAAW,EAAE,WAAW,CAAC;IACzB,YAAY,EAAE,wBAAwB,GAAG,IAAI,CAAC;IAC9C,cAAc,EAAE,MAAM,GAAG,IAAI,CAAC;CACjC;AAwDD;;;;;;;GAOG;AACH,wBAAgB,gBAAgB,CAAC,EAC7B,KAAK,EACL,gBAAgB,EAChB,aAAa,EACb,WAAW,EACX,YAAY,EACZ,cAAc,GACjB,EAAE,WAAW,2CAkBb;AAED;;GAEG;AACH,MAAM,WAAW,aAAa;IAC1B,kDAAkD;IAClD,UAAU,CAAC,EAAE;QAAE,OAAO,EAAE,MAAM,CAAC;QAAC,MAAM,EAAE,MAAM,CAAC;QAAC,aAAa,EAAE,MAAM,CAAA;KAAE,GAAG,SAAS,CAAC;IACpF,wEAAwE;IACxE,cAAc,CAAC,EAAE,OAAO,GAAG,SAAS,CAAC;IACrC,mDAAmD;IACnD,cAAc,CAAC,EAAE,MAAM,GAAG,IAAI,GAAG,SAAS,CAAC;IAC3C,iEAAiE;IACjE,aAAa,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC;CACtC;AAED;;GAEG;AACH,wBAAsB,qBAAqB,CACvC,KAAK,EAAE,UAAU,EACjB,gBAAgB,EAAE,MAAM,GAAG,IAAI,EAC/B,OAAO,GAAE,aAAkB,GAC5B,OAAO,CAAC,IAAI,CAAC,CA+Qf"}