dexto 1.5.8 → 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 (224) hide show
  1. package/README.md +3 -3
  2. package/dist/agents/agent-template.yml +2 -2
  3. package/dist/agents/coding-agent/README.md +10 -10
  4. package/dist/agents/coding-agent/coding-agent.yml +84 -83
  5. package/dist/agents/default-agent.yml +32 -47
  6. package/dist/agents/explore-agent/explore-agent.yml +3 -6
  7. package/dist/agents/image-editor-agent/image-editor-agent.yml +1 -1
  8. package/dist/agents/nano-banana-agent/nano-banana-agent.yml +1 -1
  9. package/dist/agents/podcast-agent/podcast-agent.yml +1 -1
  10. package/dist/agents/product-name-researcher/product-name-researcher.yml +1 -1
  11. package/dist/agents/sora-video-agent/sora-video-agent.yml +4 -6
  12. package/dist/agents/triage-demo/triage-agent.yml +1 -1
  13. package/dist/analytics/events.d.ts +1 -1
  14. package/dist/analytics/events.d.ts.map +1 -1
  15. package/dist/api/mcp/tool-aggregation-handler.d.ts +2 -2
  16. package/dist/api/server-hono.d.ts +2 -2
  17. package/dist/api/server-hono.d.ts.map +1 -1
  18. package/dist/api/server-hono.js +37 -60
  19. package/dist/cli/approval/cli-approval-handler.d.ts +10 -3
  20. package/dist/cli/approval/cli-approval-handler.d.ts.map +1 -1
  21. package/dist/cli/approval/cli-approval-handler.js +1 -1
  22. package/dist/cli/assets/sounds/SOURCES.md +35 -0
  23. package/dist/cli/assets/sounds/boot.wav +0 -0
  24. package/dist/cli/assets/sounds/chime.wav +0 -0
  25. package/dist/cli/assets/sounds/coin.wav +0 -0
  26. package/dist/cli/assets/sounds/confirm.wav +0 -0
  27. package/dist/cli/assets/sounds/levelup.wav +0 -0
  28. package/dist/cli/assets/sounds/ping.wav +0 -0
  29. package/dist/cli/assets/sounds/powerup.wav +0 -0
  30. package/dist/cli/assets/sounds/startup.wav +0 -0
  31. package/dist/cli/assets/sounds/success.wav +0 -0
  32. package/dist/cli/assets/sounds/treasure.wav +0 -0
  33. package/dist/cli/assets/sounds/win.wav +0 -0
  34. package/dist/cli/commands/create-app.d.ts +1 -11
  35. package/dist/cli/commands/create-app.d.ts.map +1 -1
  36. package/dist/cli/commands/create-app.js +21 -545
  37. package/dist/cli/commands/create-image.d.ts.map +1 -1
  38. package/dist/cli/commands/create-image.js +54 -53
  39. package/dist/cli/commands/image.d.ts +52 -0
  40. package/dist/cli/commands/image.d.ts.map +1 -0
  41. package/dist/cli/commands/image.js +118 -0
  42. package/dist/cli/commands/index.d.ts +2 -1
  43. package/dist/cli/commands/index.d.ts.map +1 -1
  44. package/dist/cli/commands/index.js +3 -1
  45. package/dist/cli/commands/init-app.d.ts +4 -8
  46. package/dist/cli/commands/init-app.d.ts.map +1 -1
  47. package/dist/cli/commands/init-app.js +37 -161
  48. package/dist/cli/commands/interactive-commands/command-parser.d.ts +2 -0
  49. package/dist/cli/commands/interactive-commands/command-parser.d.ts.map +1 -1
  50. package/dist/cli/commands/interactive-commands/commands.d.ts +1 -1
  51. package/dist/cli/commands/interactive-commands/commands.d.ts.map +1 -1
  52. package/dist/cli/commands/interactive-commands/commands.js +2 -2
  53. package/dist/cli/commands/interactive-commands/exit-handler.d.ts +12 -0
  54. package/dist/cli/commands/interactive-commands/exit-handler.d.ts.map +1 -0
  55. package/dist/cli/commands/interactive-commands/exit-handler.js +20 -0
  56. package/dist/cli/commands/interactive-commands/exit-stats.d.ts +24 -0
  57. package/dist/cli/commands/interactive-commands/exit-stats.d.ts.map +1 -0
  58. package/dist/cli/commands/interactive-commands/exit-stats.js +17 -0
  59. package/dist/cli/commands/interactive-commands/general-commands.d.ts.map +1 -1
  60. package/dist/cli/commands/interactive-commands/general-commands.js +55 -5
  61. package/dist/cli/commands/interactive-commands/prompt-commands.d.ts.map +1 -1
  62. package/dist/cli/commands/interactive-commands/prompt-commands.js +14 -74
  63. package/dist/cli/commands/interactive-commands/session/index.d.ts +2 -1
  64. package/dist/cli/commands/interactive-commands/session/index.d.ts.map +1 -1
  65. package/dist/cli/commands/interactive-commands/session/index.js +2 -1
  66. package/dist/cli/commands/interactive-commands/session/session-commands.d.ts +2 -2
  67. package/dist/cli/commands/interactive-commands/session/session-commands.d.ts.map +1 -1
  68. package/dist/cli/commands/interactive-commands/session/session-commands.js +2 -4
  69. package/dist/cli/commands/interactive-commands/system/system-commands.d.ts +1 -13
  70. package/dist/cli/commands/interactive-commands/system/system-commands.d.ts.map +1 -1
  71. package/dist/cli/commands/interactive-commands/system/system-commands.js +52 -83
  72. package/dist/cli/commands/plugin.d.ts +4 -4
  73. package/dist/cli/commands/sync-agents.d.ts +2 -12
  74. package/dist/cli/commands/sync-agents.d.ts.map +1 -1
  75. package/dist/cli/commands/sync-agents.js +2 -50
  76. package/dist/cli/ink-cli/InkCLIRefactored.d.ts +7 -1
  77. package/dist/cli/ink-cli/InkCLIRefactored.d.ts.map +1 -1
  78. package/dist/cli/ink-cli/InkCLIRefactored.js +138 -27
  79. package/dist/cli/ink-cli/components/ApprovalPrompt.d.ts +2 -2
  80. package/dist/cli/ink-cli/components/ApprovalPrompt.d.ts.map +1 -1
  81. package/dist/cli/ink-cli/components/ApprovalPrompt.js +85 -30
  82. package/dist/cli/ink-cli/components/BackgroundTasksPanel.js +1 -1
  83. package/dist/cli/ink-cli/components/ElicitationForm.d.ts +5 -3
  84. package/dist/cli/ink-cli/components/ElicitationForm.d.ts.map +1 -1
  85. package/dist/cli/ink-cli/components/ElicitationForm.js +414 -180
  86. package/dist/cli/ink-cli/components/Footer.d.ts.map +1 -1
  87. package/dist/cli/ink-cli/components/Footer.js +1 -2
  88. package/dist/cli/ink-cli/components/ResourceAutocomplete.d.ts.map +1 -1
  89. package/dist/cli/ink-cli/components/ResourceAutocomplete.js +20 -11
  90. package/dist/cli/ink-cli/components/SlashCommandAutocomplete.d.ts.map +1 -1
  91. package/dist/cli/ink-cli/components/SlashCommandAutocomplete.js +47 -67
  92. package/dist/cli/ink-cli/components/StatusBar.d.ts.map +1 -1
  93. package/dist/cli/ink-cli/components/StatusBar.js +20 -10
  94. package/dist/cli/ink-cli/components/TodoPanel.js +1 -1
  95. package/dist/cli/ink-cli/components/base/BaseSelector.d.ts +2 -1
  96. package/dist/cli/ink-cli/components/base/BaseSelector.d.ts.map +1 -1
  97. package/dist/cli/ink-cli/components/base/BaseSelector.js +37 -27
  98. package/dist/cli/ink-cli/components/chat/Header.d.ts.map +1 -1
  99. package/dist/cli/ink-cli/components/chat/Header.js +1 -1
  100. package/dist/cli/ink-cli/components/chat/MessageItem.d.ts.map +1 -1
  101. package/dist/cli/ink-cli/components/chat/MessageItem.js +3 -1
  102. package/dist/cli/ink-cli/components/chat/ToolIcon.d.ts.map +1 -1
  103. package/dist/cli/ink-cli/components/chat/ToolIcon.js +5 -15
  104. package/dist/cli/ink-cli/components/chat/styled-boxes/ConfigBox.js +1 -1
  105. package/dist/cli/ink-cli/components/chat/styled-boxes/LogConfigBox.d.ts.map +1 -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 +3 -1
  108. package/dist/cli/ink-cli/components/modes/AlternateBufferCLI.d.ts.map +1 -1
  109. package/dist/cli/ink-cli/components/modes/AlternateBufferCLI.js +5 -3
  110. package/dist/cli/ink-cli/components/modes/StaticCLI.d.ts +3 -1
  111. package/dist/cli/ink-cli/components/modes/StaticCLI.d.ts.map +1 -1
  112. package/dist/cli/ink-cli/components/modes/StaticCLI.js +10 -3
  113. package/dist/cli/ink-cli/components/overlays/CommandOutputOverlay.d.ts +13 -0
  114. package/dist/cli/ink-cli/components/overlays/CommandOutputOverlay.d.ts.map +1 -0
  115. package/dist/cli/ink-cli/components/overlays/CommandOutputOverlay.js +60 -0
  116. package/dist/cli/ink-cli/components/overlays/LogLevelSelector.js +1 -1
  117. package/dist/cli/ink-cli/components/overlays/ModelSelectorRefactored.d.ts.map +1 -1
  118. package/dist/cli/ink-cli/components/overlays/ModelSelectorRefactored.js +213 -100
  119. package/dist/cli/ink-cli/components/overlays/PromptList.d.ts.map +1 -1
  120. package/dist/cli/ink-cli/components/overlays/PromptList.js +12 -16
  121. package/dist/cli/ink-cli/components/overlays/SoundsSelector.d.ts +21 -0
  122. package/dist/cli/ink-cli/components/overlays/SoundsSelector.d.ts.map +1 -0
  123. package/dist/cli/ink-cli/components/overlays/SoundsSelector.js +566 -0
  124. package/dist/cli/ink-cli/components/overlays/ToolBrowser.d.ts +1 -1
  125. package/dist/cli/ink-cli/components/overlays/ToolBrowser.d.ts.map +1 -1
  126. package/dist/cli/ink-cli/components/overlays/ToolBrowser.js +100 -45
  127. package/dist/cli/ink-cli/components/overlays/custom-model-wizard/LocalModelWizard.d.ts.map +1 -1
  128. package/dist/cli/ink-cli/components/overlays/custom-model-wizard/LocalModelWizard.js +8 -13
  129. package/dist/cli/ink-cli/components/renderers/FilePreviewRenderer.d.ts +3 -3
  130. package/dist/cli/ink-cli/components/renderers/FilePreviewRenderer.d.ts.map +1 -1
  131. package/dist/cli/ink-cli/components/renderers/FilePreviewRenderer.js +6 -5
  132. package/dist/cli/ink-cli/components/renderers/FileRenderer.d.ts +3 -1
  133. package/dist/cli/ink-cli/components/renderers/FileRenderer.d.ts.map +1 -1
  134. package/dist/cli/ink-cli/components/renderers/FileRenderer.js +18 -7
  135. package/dist/cli/ink-cli/components/renderers/ShellRenderer.d.ts.map +1 -1
  136. package/dist/cli/ink-cli/components/renderers/ShellRenderer.js +7 -17
  137. package/dist/cli/ink-cli/components/renderers/index.d.ts.map +1 -1
  138. package/dist/cli/ink-cli/components/renderers/index.js +1 -1
  139. package/dist/cli/ink-cli/components/shared/FocusOverlayFrame.d.ts +7 -0
  140. package/dist/cli/ink-cli/components/shared/FocusOverlayFrame.d.ts.map +1 -0
  141. package/dist/cli/ink-cli/components/shared/FocusOverlayFrame.js +8 -0
  142. package/dist/cli/ink-cli/components/shared/HintBar.d.ts +6 -0
  143. package/dist/cli/ink-cli/components/shared/HintBar.d.ts.map +1 -0
  144. package/dist/cli/ink-cli/components/shared/HintBar.js +6 -0
  145. package/dist/cli/ink-cli/constants/spinnerFrames.d.ts +2 -0
  146. package/dist/cli/ink-cli/constants/spinnerFrames.d.ts.map +1 -0
  147. package/dist/cli/ink-cli/constants/spinnerFrames.js +1 -0
  148. package/dist/cli/ink-cli/constants/tips.d.ts.map +1 -1
  149. package/dist/cli/ink-cli/constants/tips.js +2 -1
  150. package/dist/cli/ink-cli/containers/InputContainer.d.ts +4 -0
  151. package/dist/cli/ink-cli/containers/InputContainer.d.ts.map +1 -1
  152. package/dist/cli/ink-cli/containers/InputContainer.js +47 -21
  153. package/dist/cli/ink-cli/containers/OverlayContainer.d.ts +2 -0
  154. package/dist/cli/ink-cli/containers/OverlayContainer.d.ts.map +1 -1
  155. package/dist/cli/ink-cli/containers/OverlayContainer.js +101 -40
  156. package/dist/cli/ink-cli/hooks/useAgentEvents.d.ts.map +1 -1
  157. package/dist/cli/ink-cli/hooks/useAgentEvents.js +15 -16
  158. package/dist/cli/ink-cli/hooks/useAnimationTick.d.ts +11 -0
  159. package/dist/cli/ink-cli/hooks/useAnimationTick.d.ts.map +1 -0
  160. package/dist/cli/ink-cli/hooks/useAnimationTick.js +54 -0
  161. package/dist/cli/ink-cli/hooks/useCLIState.d.ts.map +1 -1
  162. package/dist/cli/ink-cli/hooks/useCLIState.js +1 -0
  163. package/dist/cli/ink-cli/hooks/useTokenCounter.d.ts.map +1 -1
  164. package/dist/cli/ink-cli/hooks/useTokenCounter.js +7 -4
  165. package/dist/cli/ink-cli/services/CommandService.d.ts +1 -1
  166. package/dist/cli/ink-cli/services/CommandService.d.ts.map +1 -1
  167. package/dist/cli/ink-cli/services/CommandService.js +2 -2
  168. package/dist/cli/ink-cli/services/processStream.d.ts +2 -2
  169. package/dist/cli/ink-cli/services/processStream.d.ts.map +1 -1
  170. package/dist/cli/ink-cli/services/processStream.js +27 -19
  171. package/dist/cli/ink-cli/state/initialState.d.ts.map +1 -1
  172. package/dist/cli/ink-cli/state/initialState.js +1 -0
  173. package/dist/cli/ink-cli/state/types.d.ts +15 -3
  174. package/dist/cli/ink-cli/state/types.d.ts.map +1 -1
  175. package/dist/cli/ink-cli/utils/commandOverlays.d.ts.map +1 -1
  176. package/dist/cli/ink-cli/utils/commandOverlays.js +1 -0
  177. package/dist/cli/ink-cli/utils/elicitationSchema.d.ts +11 -0
  178. package/dist/cli/ink-cli/utils/elicitationSchema.d.ts.map +1 -0
  179. package/dist/cli/ink-cli/utils/elicitationSchema.js +80 -0
  180. package/dist/cli/ink-cli/utils/index.d.ts +1 -1
  181. package/dist/cli/ink-cli/utils/index.d.ts.map +1 -1
  182. package/dist/cli/ink-cli/utils/index.js +1 -1
  183. package/dist/cli/ink-cli/utils/messageFormatting.d.ts +10 -19
  184. package/dist/cli/ink-cli/utils/messageFormatting.d.ts.map +1 -1
  185. package/dist/cli/ink-cli/utils/messageFormatting.js +43 -262
  186. package/dist/cli/ink-cli/utils/overlayPresentation.d.ts +19 -0
  187. package/dist/cli/ink-cli/utils/overlayPresentation.d.ts.map +1 -0
  188. package/dist/cli/ink-cli/utils/overlayPresentation.js +33 -0
  189. package/dist/cli/ink-cli/utils/overlaySizing.d.ts +19 -0
  190. package/dist/cli/ink-cli/utils/overlaySizing.d.ts.map +1 -0
  191. package/dist/cli/ink-cli/utils/overlaySizing.js +11 -0
  192. package/dist/cli/ink-cli/utils/soundNotification.d.ts +19 -13
  193. package/dist/cli/ink-cli/utils/soundNotification.d.ts.map +1 -1
  194. package/dist/cli/ink-cli/utils/soundNotification.js +120 -97
  195. package/dist/cli/ink-cli/utils/toolUtils.d.ts.map +1 -1
  196. package/dist/cli/ink-cli/utils/toolUtils.js +2 -9
  197. package/dist/cli/utils/config-validation.d.ts +11 -11
  198. package/dist/cli/utils/config-validation.d.ts.map +1 -1
  199. package/dist/cli/utils/config-validation.js +56 -290
  200. package/dist/cli/utils/image-store.d.ts +16 -0
  201. package/dist/cli/utils/image-store.d.ts.map +1 -0
  202. package/dist/cli/utils/image-store.js +289 -0
  203. package/dist/cli/utils/scaffolding-utils.d.ts +5 -0
  204. package/dist/cli/utils/scaffolding-utils.d.ts.map +1 -1
  205. package/dist/cli/utils/scaffolding-utils.js +46 -4
  206. package/dist/cli/utils/template-engine.d.ts +28 -16
  207. package/dist/cli/utils/template-engine.d.ts.map +1 -1
  208. package/dist/cli/utils/template-engine.js +339 -479
  209. package/dist/config/cli-overrides.d.ts +4 -3
  210. package/dist/config/cli-overrides.d.ts.map +1 -1
  211. package/dist/config/cli-overrides.js +7 -9
  212. package/dist/index-main.d.ts +2 -0
  213. package/dist/index-main.d.ts.map +1 -0
  214. package/dist/index-main.js +1554 -0
  215. package/dist/index.js +2 -1589
  216. package/dist/utils/session-logger-factory.d.ts +3 -0
  217. package/dist/utils/session-logger-factory.d.ts.map +1 -0
  218. package/dist/utils/session-logger-factory.js +34 -0
  219. package/dist/webui/assets/{index-Cz2z7NQ8.js → index-CKhumsZA.js} +231 -231
  220. package/dist/webui/index.html +1 -1
  221. package/package.json +11 -8
  222. package/dist/cli/cli-subscriber.d.ts +0 -45
  223. package/dist/cli/cli-subscriber.d.ts.map +0 -1
  224. package/dist/cli/cli-subscriber.js +0 -204
@@ -4,12 +4,35 @@
4
4
  * Plays system sounds for CLI notifications like approval requests and task completion.
5
5
  * Uses platform-specific commands with fallback to terminal bell.
6
6
  *
7
- * Sound files should be placed in ~/.dexto/sounds/ or use system defaults.
7
+ * Sound files should be placed in the Dexto sounds directory (typically ~/.dexto/sounds/).
8
+ * In dexto source + DEXTO_DEV_MODE=true, this uses <repo>/.dexto/sounds/ for isolated dev.
8
9
  */
9
- import { exec } from 'child_process';
10
10
  import { existsSync } from 'fs';
11
- import { join } from 'path';
12
- import { homedir, platform } from 'os';
11
+ import { isAbsolute, normalize, resolve, sep } from 'path';
12
+ import { fileURLToPath } from 'node:url';
13
+ import { execFile } from 'child_process';
14
+ import { getDextoGlobalPath } from '@dexto/agent-management';
15
+ export const CUSTOM_SOUND_EXTENSIONS = ['.wav', '.mp3', '.ogg', '.oga', '.aiff', '.m4a'];
16
+ function getSoundFileKey(soundType) {
17
+ switch (soundType) {
18
+ case 'startup':
19
+ return 'startupSoundFile';
20
+ case 'approval':
21
+ return 'approvalSoundFile';
22
+ case 'complete':
23
+ return 'completeSoundFile';
24
+ }
25
+ }
26
+ function resolvePathWithinSoundsDir(soundPath) {
27
+ if (soundPath.trim().length === 0)
28
+ return null;
29
+ const soundsDir = normalize(getDextoGlobalPath('sounds'));
30
+ const resolved = isAbsolute(soundPath) ? normalize(soundPath) : resolve(soundsDir, soundPath);
31
+ if (resolved === soundsDir || resolved.startsWith(soundsDir + sep)) {
32
+ return resolved;
33
+ }
34
+ return null;
35
+ }
13
36
  /**
14
37
  * Platform-specific default sound paths
15
38
  */
@@ -30,64 +53,81 @@ const PLATFORM_SOUNDS = {
30
53
  complete: 'SystemHand',
31
54
  },
32
55
  };
33
- /**
34
- * Get custom sound path from ~/.dexto/sounds/
35
- */
36
- function getCustomSoundPath(soundType) {
37
- const dextoSoundsDir = join(homedir(), '.dexto', 'sounds');
38
- const extensions = ['.wav', '.mp3', '.ogg', '.aiff', '.m4a'];
39
- for (const ext of extensions) {
40
- const customPath = join(dextoSoundsDir, `${soundType}${ext}`);
41
- if (existsSync(customPath)) {
42
- return customPath;
43
- }
56
+ const BUNDLED_STARTUP_SOUND_PATH = fileURLToPath(new URL('../../assets/sounds/startup.wav', import.meta.url));
57
+ export function getDefaultSoundSpec(soundType) {
58
+ if (soundType === 'startup') {
59
+ return BUNDLED_STARTUP_SOUND_PATH;
44
60
  }
45
- return null;
61
+ const platformSounds = PLATFORM_SOUNDS[process.platform];
62
+ return platformSounds?.[soundType] ?? null;
46
63
  }
47
64
  /**
48
65
  * Play a sound file using platform-specific command
49
66
  */
50
67
  function playSound(soundPath) {
51
- const currentPlatform = platform();
52
- let command;
53
- switch (currentPlatform) {
54
- case 'darwin':
55
- // macOS: use afplay
56
- command = `afplay "${soundPath}"`;
57
- break;
58
- case 'linux':
59
- // Linux: try paplay (PulseAudio), then aplay (ALSA)
60
- if (soundPath.endsWith('.oga') || soundPath.endsWith('.ogg')) {
61
- command = `paplay "${soundPath}" 2>/dev/null || ogg123 -q "${soundPath}" 2>/dev/null`;
68
+ const execOrBell = (cmd, args, onError) => {
69
+ execFile(cmd, args, { windowsHide: true }, (error) => {
70
+ if (!error)
71
+ return;
72
+ if (onError) {
73
+ onError();
74
+ return;
75
+ }
76
+ playTerminalBell();
77
+ });
78
+ };
79
+ switch (process.platform) {
80
+ case 'darwin': {
81
+ execOrBell('afplay', [soundPath]);
82
+ return;
83
+ }
84
+ case 'linux': {
85
+ const lowerSoundPath = soundPath.toLowerCase();
86
+ const isOgg = lowerSoundPath.endsWith('.oga') || lowerSoundPath.endsWith('.ogg');
87
+ if (isOgg) {
88
+ execOrBell('paplay', [soundPath], () => {
89
+ execOrBell('ogg123', ['-q', soundPath]);
90
+ });
62
91
  }
63
92
  else {
64
- command = `paplay "${soundPath}" 2>/dev/null || aplay -q "${soundPath}" 2>/dev/null`;
93
+ execOrBell('paplay', [soundPath], () => {
94
+ execOrBell('aplay', ['-q', soundPath]);
95
+ });
65
96
  }
66
- break;
67
- case 'win32':
97
+ return;
98
+ }
99
+ case 'win32': {
68
100
  // Windows: use PowerShell with System.Media.SystemSounds
69
101
  // For Windows system sounds, soundPath is the sound name
70
102
  if (['SystemAsterisk', 'SystemHand', 'SystemExclamation', 'SystemQuestion'].includes(soundPath)) {
71
- command = `powershell -c "[System.Media.SystemSounds]::${soundPath.replace('System', '')}.Play()"`;
103
+ const systemSoundName = soundPath.replace('System', '');
104
+ execOrBell('powershell', [
105
+ '-NoProfile',
106
+ '-NonInteractive',
107
+ '-Command',
108
+ `[System.Media.SystemSounds]::${systemSoundName}.Play()`,
109
+ ]);
110
+ return;
72
111
  }
73
- else {
74
- // For custom files, use SoundPlayer
75
- command = `powershell -c "(New-Object System.Media.SoundPlayer '${soundPath}').PlaySync()"`;
76
- }
77
- break;
78
- default:
112
+ // For custom files, use SoundPlayer
113
+ execOrBell('powershell', [
114
+ '-NoProfile',
115
+ '-NonInteractive',
116
+ '-Command',
117
+ '& { param([string]$p) (New-Object System.Media.SoundPlayer $p).PlaySync() }',
118
+ soundPath,
119
+ ]);
120
+ return;
121
+ }
122
+ default: {
79
123
  // Fallback: try to use terminal bell
80
124
  playTerminalBell();
81
125
  return;
82
- }
83
- // Execute sound command asynchronously (fire and forget)
84
- // Use 5s timeout to prevent hanging processes (e.g., audio device issues)
85
- exec(command, { timeout: 5000 }, (error) => {
86
- if (error) {
87
- // Silently fall back to terminal bell on error
88
- playTerminalBell();
89
126
  }
90
- });
127
+ }
128
+ }
129
+ export function playSoundFile(soundPath) {
130
+ playSound(soundPath);
91
131
  }
92
132
  /**
93
133
  * Play terminal bell (works in most terminals)
@@ -95,10 +135,26 @@ function playSound(soundPath) {
95
135
  function playTerminalBell() {
96
136
  process.stdout.write('\x07');
97
137
  }
138
+ function resolveNotificationSoundSpec(soundType, config) {
139
+ const configuredRelativePath = config?.[getSoundFileKey(soundType)];
140
+ if (configuredRelativePath) {
141
+ const resolved = resolvePathWithinSoundsDir(configuredRelativePath);
142
+ if (resolved && existsSync(resolved)) {
143
+ return resolved;
144
+ }
145
+ }
146
+ const defaultSpec = getDefaultSoundSpec(soundType);
147
+ if (!defaultSpec)
148
+ return null;
149
+ if (process.platform === 'win32') {
150
+ return defaultSpec;
151
+ }
152
+ return existsSync(defaultSpec) ? defaultSpec : null;
153
+ }
98
154
  /**
99
155
  * Play a notification sound
100
156
  *
101
- * @param soundType - Type of sound to play ('approval' or 'complete')
157
+ * @param soundType - Type of sound to play ('startup', 'approval', or 'complete')
102
158
  *
103
159
  * @example
104
160
  * ```typescript
@@ -107,40 +163,18 @@ function playTerminalBell() {
107
163
  *
108
164
  * // Play task complete sound
109
165
  * playNotificationSound('complete');
166
+ *
167
+ * // Play startup sound
168
+ * playNotificationSound('startup');
110
169
  * ```
111
170
  */
112
- export function playNotificationSound(soundType) {
113
- const currentPlatform = platform();
114
- // Check for custom sound first
115
- const customSound = getCustomSoundPath(soundType);
116
- if (customSound) {
117
- playSound(customSound);
171
+ export function playNotificationSound(soundType, config) {
172
+ const soundSpec = resolveNotificationSoundSpec(soundType, config);
173
+ if (!soundSpec) {
174
+ playTerminalBell();
118
175
  return;
119
176
  }
120
- // Use platform default
121
- const platformSounds = PLATFORM_SOUNDS[currentPlatform];
122
- if (platformSounds) {
123
- const defaultSound = platformSounds[soundType];
124
- if (defaultSound) {
125
- // For macOS and Linux, check if file exists
126
- if (currentPlatform !== 'win32') {
127
- if (existsSync(defaultSound)) {
128
- playSound(defaultSound);
129
- }
130
- else {
131
- // File doesn't exist, use bell
132
- playTerminalBell();
133
- }
134
- }
135
- else {
136
- // Windows uses system sound names
137
- playSound(defaultSound);
138
- }
139
- return;
140
- }
141
- }
142
- // Fallback to terminal bell
143
- playTerminalBell();
177
+ playSound(soundSpec);
144
178
  }
145
179
  /**
146
180
  * Sound notification service that respects configuration
@@ -165,12 +199,20 @@ export class SoundNotificationService {
165
199
  getConfig() {
166
200
  return { ...this.config };
167
201
  }
202
+ /**
203
+ * Play CLI startup sound if enabled
204
+ */
205
+ playStartupSound() {
206
+ if (this.config.enabled && this.config.onStartup) {
207
+ playNotificationSound('startup', this.config);
208
+ }
209
+ }
168
210
  /**
169
211
  * Play approval required sound if enabled
170
212
  */
171
213
  playApprovalSound() {
172
214
  if (this.config.enabled && this.config.onApprovalRequired) {
173
- playNotificationSound('approval');
215
+ playNotificationSound('approval', this.config);
174
216
  }
175
217
  }
176
218
  /**
@@ -178,26 +220,7 @@ export class SoundNotificationService {
178
220
  */
179
221
  playCompleteSound() {
180
222
  if (this.config.enabled && this.config.onTaskComplete) {
181
- playNotificationSound('complete');
223
+ playNotificationSound('complete', this.config);
182
224
  }
183
225
  }
184
226
  }
185
- /**
186
- * Singleton instance for global use
187
- * Initialize with loadGlobalPreferences() in CLI startup
188
- */
189
- let globalSoundService = null;
190
- /**
191
- * Get the global sound notification service
192
- * @returns The global service, or null if not initialized
193
- */
194
- export function getSoundService() {
195
- return globalSoundService;
196
- }
197
- /**
198
- * Initialize the global sound service with configuration
199
- */
200
- export function initializeSoundService(config) {
201
- globalSoundService = new SoundNotificationService(config);
202
- return globalSoundService;
203
- }
@@ -1 +1 @@
1
- {"version":3,"file":"toolUtils.d.ts","sourceRoot":"","sources":["../../../../src/cli/ink-cli/utils/toolUtils.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH;;;GAGG;AACH,wBAAgB,eAAe,CAAC,QAAQ,EAAE,MAAM,GAAG,SAAS,GAAG,OAAO,CASrE;AAED;;;;GAIG;AACH,wBAAgB,gBAAgB,CAAC,QAAQ,EAAE,MAAM,GAAG,SAAS,GAAG,OAAO,CAMtE;AAED;;;GAGG;AACH,wBAAgB,0BAA0B,CAAC,QAAQ,EAAE,MAAM,GAAG,SAAS,GAAG,OAAO,CAEhF"}
1
+ {"version":3,"file":"toolUtils.d.ts","sourceRoot":"","sources":["../../../../src/cli/ink-cli/utils/toolUtils.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH;;;GAGG;AACH,wBAAgB,eAAe,CAAC,QAAQ,EAAE,MAAM,GAAG,SAAS,GAAG,OAAO,CAErE;AAED;;;;GAIG;AACH,wBAAgB,gBAAgB,CAAC,QAAQ,EAAE,MAAM,GAAG,SAAS,GAAG,OAAO,CAEtE;AAED;;;GAGG;AACH,wBAAgB,0BAA0B,CAAC,QAAQ,EAAE,MAAM,GAAG,SAAS,GAAG,OAAO,CAEhF"}
@@ -6,12 +6,7 @@
6
6
  * Used for "accept all edits" mode which auto-approves these tools.
7
7
  */
8
8
  export function isEditWriteTool(toolName) {
9
- return (toolName === 'internal--edit_file' ||
10
- toolName === 'internal--write_file' ||
11
- toolName === 'custom--write_file' ||
12
- toolName === 'custom--edit_file' ||
13
- toolName === 'edit_file' ||
14
- toolName === 'write_file');
9
+ return toolName === 'edit_file' || toolName === 'write_file';
15
10
  }
16
11
  /**
17
12
  * Check if a tool is a plan update tool.
@@ -19,9 +14,7 @@ export function isEditWriteTool(toolName) {
19
14
  * (typically marking tasks as complete during implementation).
20
15
  */
21
16
  export function isPlanUpdateTool(toolName) {
22
- return (toolName === 'plan_update' ||
23
- toolName === 'custom--plan_update' ||
24
- toolName === 'internal--plan_update');
17
+ return toolName === 'plan_update';
25
18
  }
26
19
  /**
27
20
  * Check if a tool should be auto-approved in "accept all edits" mode.
@@ -1,13 +1,18 @@
1
- import { type AgentConfig, type ValidatedAgentConfig, type LLMValidationOptions } from '@dexto/core';
1
+ import { type AgentConfig, type ValidatedAgentConfig } from '@dexto/agent-config';
2
2
  export interface ValidationResult {
3
3
  success: boolean;
4
4
  config?: ValidatedAgentConfig;
5
5
  errors?: string[];
6
+ warnings?: string[];
6
7
  skipped?: boolean;
7
8
  }
9
+ export interface ValidationOptions {
10
+ agentPath?: string;
11
+ credentialPolicy?: 'warn' | 'error' | 'ignore';
12
+ }
8
13
  /**
9
14
  * Validates agent config with optional interactive fixes for user experience.
10
- * Uses schema parsing to detect API key issues and provides targeted setup.
15
+ * Uses schema parsing for structural validation and performs targeted credential checks.
11
16
  * Returns validated config with all defaults applied.
12
17
  *
13
18
  * IMPORTANT: This function NEVER exits the process. It always returns a result
@@ -15,16 +20,11 @@ export interface ValidationResult {
15
20
  *
16
21
  * @param config - The agent configuration to validate
17
22
  * @param interactive - Whether to allow interactive prompts to fix issues
18
- * @param validationOptions - Validation strictness options
19
- * @param validationOptions.strict - When true (default), enforces API key requirements.
20
- * When false, allows missing credentials for interactive config.
23
+ * @param options.credentialPolicy - Behavior when credentials are missing (warn, error, ignore)
24
+ * @param options.agentPath - Agent config path (used for manual-edit instructions).
21
25
  */
22
- export declare function validateAgentConfig(config: AgentConfig, interactive?: boolean, validationOptions?: LLMValidationOptions & {
23
- agentPath?: string;
24
- }): Promise<ValidationResult>;
26
+ export declare function validateAgentConfig(config: AgentConfig, interactive?: boolean, options?: ValidationOptions): Promise<ValidationResult>;
25
27
  /**
26
- * Legacy function for backwards compatibility
27
- * @deprecated Use validateAgentConfig with result handling instead
28
+ * Note: validateAgentConfig never exits. Callers own exit behavior.
28
29
  */
29
- export declare function validateAgentConfigOrExit(config: AgentConfig, interactive?: boolean): Promise<ValidatedAgentConfig>;
30
30
  //# sourceMappingURL=config-validation.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"config-validation.d.ts","sourceRoot":"","sources":["../../../src/cli/utils/config-validation.ts"],"names":[],"mappings":"AAGA,OAAO,EAGH,KAAK,WAAW,EAChB,KAAK,oBAAoB,EACzB,KAAK,oBAAoB,EAC5B,MAAM,aAAa,CAAC;AAYrB,MAAM,WAAW,gBAAgB;IAC7B,OAAO,EAAE,OAAO,CAAC;IACjB,MAAM,CAAC,EAAE,oBAAoB,CAAC;IAC9B,MAAM,CAAC,EAAE,MAAM,EAAE,CAAC;IAClB,OAAO,CAAC,EAAE,OAAO,CAAC;CACrB;AAED;;;;;;;;;;;;;GAaG;AACH,wBAAsB,mBAAmB,CACrC,MAAM,EAAE,WAAW,EACnB,WAAW,GAAE,OAAe,EAC5B,iBAAiB,CAAC,EAAE,oBAAoB,GAAG;IAAE,SAAS,CAAC,EAAE,MAAM,CAAA;CAAE,GAClE,OAAO,CAAC,gBAAgB,CAAC,CAyC3B;AAkbD;;;GAGG;AACH,wBAAsB,yBAAyB,CAC3C,MAAM,EAAE,WAAW,EACnB,WAAW,GAAE,OAAe,GAC7B,OAAO,CAAC,oBAAoB,CAAC,CAgC/B"}
1
+ {"version":3,"file":"config-validation.d.ts","sourceRoot":"","sources":["../../../src/cli/utils/config-validation.ts"],"names":[],"mappings":"AAGA,OAAO,EAEH,KAAK,WAAW,EAChB,KAAK,oBAAoB,EAC5B,MAAM,qBAAqB,CAAC;AAW7B,MAAM,WAAW,gBAAgB;IAC7B,OAAO,EAAE,OAAO,CAAC;IACjB,MAAM,CAAC,EAAE,oBAAoB,CAAC;IAC9B,MAAM,CAAC,EAAE,MAAM,EAAE,CAAC;IAClB,QAAQ,CAAC,EAAE,MAAM,EAAE,CAAC;IACpB,OAAO,CAAC,EAAE,OAAO,CAAC;CACrB;AAED,MAAM,WAAW,iBAAiB;IAC9B,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,gBAAgB,CAAC,EAAE,MAAM,GAAG,OAAO,GAAG,QAAQ,CAAC;CAClD;AAED;;;;;;;;;;;;GAYG;AACH,wBAAsB,mBAAmB,CACrC,MAAM,EAAE,WAAW,EACnB,WAAW,GAAE,OAAe,EAC5B,OAAO,CAAC,EAAE,iBAAiB,GAC5B,OAAO,CAAC,gBAAgB,CAAC,CAsC3B;AAsLD;;GAEG"}