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.
- package/README.md +3 -3
- package/dist/agents/agent-template.yml +2 -2
- package/dist/agents/coding-agent/README.md +10 -10
- package/dist/agents/coding-agent/coding-agent.yml +84 -83
- package/dist/agents/default-agent.yml +32 -47
- package/dist/agents/explore-agent/explore-agent.yml +3 -6
- package/dist/agents/image-editor-agent/image-editor-agent.yml +1 -1
- package/dist/agents/nano-banana-agent/nano-banana-agent.yml +1 -1
- package/dist/agents/podcast-agent/podcast-agent.yml +1 -1
- package/dist/agents/product-name-researcher/product-name-researcher.yml +1 -1
- package/dist/agents/sora-video-agent/sora-video-agent.yml +4 -6
- package/dist/agents/triage-demo/triage-agent.yml +1 -1
- package/dist/analytics/events.d.ts +1 -1
- package/dist/analytics/events.d.ts.map +1 -1
- package/dist/api/mcp/tool-aggregation-handler.d.ts +2 -2
- package/dist/api/server-hono.d.ts +2 -2
- package/dist/api/server-hono.d.ts.map +1 -1
- package/dist/api/server-hono.js +37 -60
- package/dist/cli/approval/cli-approval-handler.d.ts +10 -3
- package/dist/cli/approval/cli-approval-handler.d.ts.map +1 -1
- package/dist/cli/approval/cli-approval-handler.js +1 -1
- package/dist/cli/assets/sounds/SOURCES.md +35 -0
- package/dist/cli/assets/sounds/boot.wav +0 -0
- package/dist/cli/assets/sounds/chime.wav +0 -0
- package/dist/cli/assets/sounds/coin.wav +0 -0
- package/dist/cli/assets/sounds/confirm.wav +0 -0
- package/dist/cli/assets/sounds/levelup.wav +0 -0
- package/dist/cli/assets/sounds/ping.wav +0 -0
- package/dist/cli/assets/sounds/powerup.wav +0 -0
- package/dist/cli/assets/sounds/startup.wav +0 -0
- package/dist/cli/assets/sounds/success.wav +0 -0
- package/dist/cli/assets/sounds/treasure.wav +0 -0
- package/dist/cli/assets/sounds/win.wav +0 -0
- package/dist/cli/commands/create-app.d.ts +1 -11
- package/dist/cli/commands/create-app.d.ts.map +1 -1
- package/dist/cli/commands/create-app.js +21 -545
- package/dist/cli/commands/create-image.d.ts.map +1 -1
- package/dist/cli/commands/create-image.js +54 -53
- package/dist/cli/commands/image.d.ts +52 -0
- package/dist/cli/commands/image.d.ts.map +1 -0
- package/dist/cli/commands/image.js +118 -0
- package/dist/cli/commands/index.d.ts +2 -1
- package/dist/cli/commands/index.d.ts.map +1 -1
- package/dist/cli/commands/index.js +3 -1
- package/dist/cli/commands/init-app.d.ts +4 -8
- package/dist/cli/commands/init-app.d.ts.map +1 -1
- package/dist/cli/commands/init-app.js +37 -161
- package/dist/cli/commands/interactive-commands/command-parser.d.ts +2 -0
- package/dist/cli/commands/interactive-commands/command-parser.d.ts.map +1 -1
- package/dist/cli/commands/interactive-commands/commands.d.ts +1 -1
- package/dist/cli/commands/interactive-commands/commands.d.ts.map +1 -1
- package/dist/cli/commands/interactive-commands/commands.js +2 -2
- package/dist/cli/commands/interactive-commands/exit-handler.d.ts +12 -0
- package/dist/cli/commands/interactive-commands/exit-handler.d.ts.map +1 -0
- package/dist/cli/commands/interactive-commands/exit-handler.js +20 -0
- package/dist/cli/commands/interactive-commands/exit-stats.d.ts +24 -0
- package/dist/cli/commands/interactive-commands/exit-stats.d.ts.map +1 -0
- package/dist/cli/commands/interactive-commands/exit-stats.js +17 -0
- package/dist/cli/commands/interactive-commands/general-commands.d.ts.map +1 -1
- package/dist/cli/commands/interactive-commands/general-commands.js +55 -5
- package/dist/cli/commands/interactive-commands/prompt-commands.d.ts.map +1 -1
- package/dist/cli/commands/interactive-commands/prompt-commands.js +14 -74
- package/dist/cli/commands/interactive-commands/session/index.d.ts +2 -1
- package/dist/cli/commands/interactive-commands/session/index.d.ts.map +1 -1
- package/dist/cli/commands/interactive-commands/session/index.js +2 -1
- package/dist/cli/commands/interactive-commands/session/session-commands.d.ts +2 -2
- package/dist/cli/commands/interactive-commands/session/session-commands.d.ts.map +1 -1
- package/dist/cli/commands/interactive-commands/session/session-commands.js +2 -4
- package/dist/cli/commands/interactive-commands/system/system-commands.d.ts +1 -13
- package/dist/cli/commands/interactive-commands/system/system-commands.d.ts.map +1 -1
- package/dist/cli/commands/interactive-commands/system/system-commands.js +52 -83
- package/dist/cli/commands/plugin.d.ts +4 -4
- package/dist/cli/commands/sync-agents.d.ts +2 -12
- package/dist/cli/commands/sync-agents.d.ts.map +1 -1
- package/dist/cli/commands/sync-agents.js +2 -50
- package/dist/cli/ink-cli/InkCLIRefactored.d.ts +7 -1
- package/dist/cli/ink-cli/InkCLIRefactored.d.ts.map +1 -1
- package/dist/cli/ink-cli/InkCLIRefactored.js +138 -27
- package/dist/cli/ink-cli/components/ApprovalPrompt.d.ts +2 -2
- package/dist/cli/ink-cli/components/ApprovalPrompt.d.ts.map +1 -1
- package/dist/cli/ink-cli/components/ApprovalPrompt.js +85 -30
- package/dist/cli/ink-cli/components/BackgroundTasksPanel.js +1 -1
- package/dist/cli/ink-cli/components/ElicitationForm.d.ts +5 -3
- package/dist/cli/ink-cli/components/ElicitationForm.d.ts.map +1 -1
- package/dist/cli/ink-cli/components/ElicitationForm.js +414 -180
- package/dist/cli/ink-cli/components/Footer.d.ts.map +1 -1
- package/dist/cli/ink-cli/components/Footer.js +1 -2
- package/dist/cli/ink-cli/components/ResourceAutocomplete.d.ts.map +1 -1
- package/dist/cli/ink-cli/components/ResourceAutocomplete.js +20 -11
- package/dist/cli/ink-cli/components/SlashCommandAutocomplete.d.ts.map +1 -1
- package/dist/cli/ink-cli/components/SlashCommandAutocomplete.js +47 -67
- package/dist/cli/ink-cli/components/StatusBar.d.ts.map +1 -1
- package/dist/cli/ink-cli/components/StatusBar.js +20 -10
- package/dist/cli/ink-cli/components/TodoPanel.js +1 -1
- package/dist/cli/ink-cli/components/base/BaseSelector.d.ts +2 -1
- package/dist/cli/ink-cli/components/base/BaseSelector.d.ts.map +1 -1
- package/dist/cli/ink-cli/components/base/BaseSelector.js +37 -27
- package/dist/cli/ink-cli/components/chat/Header.d.ts.map +1 -1
- package/dist/cli/ink-cli/components/chat/Header.js +1 -1
- package/dist/cli/ink-cli/components/chat/MessageItem.d.ts.map +1 -1
- package/dist/cli/ink-cli/components/chat/MessageItem.js +3 -1
- package/dist/cli/ink-cli/components/chat/ToolIcon.d.ts.map +1 -1
- package/dist/cli/ink-cli/components/chat/ToolIcon.js +5 -15
- package/dist/cli/ink-cli/components/chat/styled-boxes/ConfigBox.js +1 -1
- package/dist/cli/ink-cli/components/chat/styled-boxes/LogConfigBox.d.ts.map +1 -1
- package/dist/cli/ink-cli/components/chat/styled-boxes/LogConfigBox.js +1 -1
- package/dist/cli/ink-cli/components/modes/AlternateBufferCLI.d.ts +3 -1
- package/dist/cli/ink-cli/components/modes/AlternateBufferCLI.d.ts.map +1 -1
- package/dist/cli/ink-cli/components/modes/AlternateBufferCLI.js +5 -3
- package/dist/cli/ink-cli/components/modes/StaticCLI.d.ts +3 -1
- package/dist/cli/ink-cli/components/modes/StaticCLI.d.ts.map +1 -1
- package/dist/cli/ink-cli/components/modes/StaticCLI.js +10 -3
- package/dist/cli/ink-cli/components/overlays/CommandOutputOverlay.d.ts +13 -0
- package/dist/cli/ink-cli/components/overlays/CommandOutputOverlay.d.ts.map +1 -0
- package/dist/cli/ink-cli/components/overlays/CommandOutputOverlay.js +60 -0
- package/dist/cli/ink-cli/components/overlays/LogLevelSelector.js +1 -1
- package/dist/cli/ink-cli/components/overlays/ModelSelectorRefactored.d.ts.map +1 -1
- package/dist/cli/ink-cli/components/overlays/ModelSelectorRefactored.js +213 -100
- package/dist/cli/ink-cli/components/overlays/PromptList.d.ts.map +1 -1
- package/dist/cli/ink-cli/components/overlays/PromptList.js +12 -16
- package/dist/cli/ink-cli/components/overlays/SoundsSelector.d.ts +21 -0
- package/dist/cli/ink-cli/components/overlays/SoundsSelector.d.ts.map +1 -0
- package/dist/cli/ink-cli/components/overlays/SoundsSelector.js +566 -0
- package/dist/cli/ink-cli/components/overlays/ToolBrowser.d.ts +1 -1
- package/dist/cli/ink-cli/components/overlays/ToolBrowser.d.ts.map +1 -1
- package/dist/cli/ink-cli/components/overlays/ToolBrowser.js +100 -45
- package/dist/cli/ink-cli/components/overlays/custom-model-wizard/LocalModelWizard.d.ts.map +1 -1
- package/dist/cli/ink-cli/components/overlays/custom-model-wizard/LocalModelWizard.js +8 -13
- package/dist/cli/ink-cli/components/renderers/FilePreviewRenderer.d.ts +3 -3
- package/dist/cli/ink-cli/components/renderers/FilePreviewRenderer.d.ts.map +1 -1
- package/dist/cli/ink-cli/components/renderers/FilePreviewRenderer.js +6 -5
- package/dist/cli/ink-cli/components/renderers/FileRenderer.d.ts +3 -1
- package/dist/cli/ink-cli/components/renderers/FileRenderer.d.ts.map +1 -1
- package/dist/cli/ink-cli/components/renderers/FileRenderer.js +18 -7
- package/dist/cli/ink-cli/components/renderers/ShellRenderer.d.ts.map +1 -1
- package/dist/cli/ink-cli/components/renderers/ShellRenderer.js +7 -17
- package/dist/cli/ink-cli/components/renderers/index.d.ts.map +1 -1
- package/dist/cli/ink-cli/components/renderers/index.js +1 -1
- package/dist/cli/ink-cli/components/shared/FocusOverlayFrame.d.ts +7 -0
- package/dist/cli/ink-cli/components/shared/FocusOverlayFrame.d.ts.map +1 -0
- package/dist/cli/ink-cli/components/shared/FocusOverlayFrame.js +8 -0
- package/dist/cli/ink-cli/components/shared/HintBar.d.ts +6 -0
- package/dist/cli/ink-cli/components/shared/HintBar.d.ts.map +1 -0
- package/dist/cli/ink-cli/components/shared/HintBar.js +6 -0
- package/dist/cli/ink-cli/constants/spinnerFrames.d.ts +2 -0
- package/dist/cli/ink-cli/constants/spinnerFrames.d.ts.map +1 -0
- package/dist/cli/ink-cli/constants/spinnerFrames.js +1 -0
- package/dist/cli/ink-cli/constants/tips.d.ts.map +1 -1
- package/dist/cli/ink-cli/constants/tips.js +2 -1
- package/dist/cli/ink-cli/containers/InputContainer.d.ts +4 -0
- package/dist/cli/ink-cli/containers/InputContainer.d.ts.map +1 -1
- package/dist/cli/ink-cli/containers/InputContainer.js +47 -21
- package/dist/cli/ink-cli/containers/OverlayContainer.d.ts +2 -0
- package/dist/cli/ink-cli/containers/OverlayContainer.d.ts.map +1 -1
- package/dist/cli/ink-cli/containers/OverlayContainer.js +101 -40
- package/dist/cli/ink-cli/hooks/useAgentEvents.d.ts.map +1 -1
- package/dist/cli/ink-cli/hooks/useAgentEvents.js +15 -16
- package/dist/cli/ink-cli/hooks/useAnimationTick.d.ts +11 -0
- package/dist/cli/ink-cli/hooks/useAnimationTick.d.ts.map +1 -0
- package/dist/cli/ink-cli/hooks/useAnimationTick.js +54 -0
- package/dist/cli/ink-cli/hooks/useCLIState.d.ts.map +1 -1
- package/dist/cli/ink-cli/hooks/useCLIState.js +1 -0
- package/dist/cli/ink-cli/hooks/useTokenCounter.d.ts.map +1 -1
- package/dist/cli/ink-cli/hooks/useTokenCounter.js +7 -4
- package/dist/cli/ink-cli/services/CommandService.d.ts +1 -1
- package/dist/cli/ink-cli/services/CommandService.d.ts.map +1 -1
- package/dist/cli/ink-cli/services/CommandService.js +2 -2
- package/dist/cli/ink-cli/services/processStream.d.ts +2 -2
- package/dist/cli/ink-cli/services/processStream.d.ts.map +1 -1
- package/dist/cli/ink-cli/services/processStream.js +27 -19
- package/dist/cli/ink-cli/state/initialState.d.ts.map +1 -1
- package/dist/cli/ink-cli/state/initialState.js +1 -0
- package/dist/cli/ink-cli/state/types.d.ts +15 -3
- package/dist/cli/ink-cli/state/types.d.ts.map +1 -1
- package/dist/cli/ink-cli/utils/commandOverlays.d.ts.map +1 -1
- package/dist/cli/ink-cli/utils/commandOverlays.js +1 -0
- package/dist/cli/ink-cli/utils/elicitationSchema.d.ts +11 -0
- package/dist/cli/ink-cli/utils/elicitationSchema.d.ts.map +1 -0
- package/dist/cli/ink-cli/utils/elicitationSchema.js +80 -0
- package/dist/cli/ink-cli/utils/index.d.ts +1 -1
- package/dist/cli/ink-cli/utils/index.d.ts.map +1 -1
- package/dist/cli/ink-cli/utils/index.js +1 -1
- package/dist/cli/ink-cli/utils/messageFormatting.d.ts +10 -19
- package/dist/cli/ink-cli/utils/messageFormatting.d.ts.map +1 -1
- package/dist/cli/ink-cli/utils/messageFormatting.js +43 -262
- package/dist/cli/ink-cli/utils/overlayPresentation.d.ts +19 -0
- package/dist/cli/ink-cli/utils/overlayPresentation.d.ts.map +1 -0
- package/dist/cli/ink-cli/utils/overlayPresentation.js +33 -0
- package/dist/cli/ink-cli/utils/overlaySizing.d.ts +19 -0
- package/dist/cli/ink-cli/utils/overlaySizing.d.ts.map +1 -0
- package/dist/cli/ink-cli/utils/overlaySizing.js +11 -0
- package/dist/cli/ink-cli/utils/soundNotification.d.ts +19 -13
- package/dist/cli/ink-cli/utils/soundNotification.d.ts.map +1 -1
- package/dist/cli/ink-cli/utils/soundNotification.js +120 -97
- package/dist/cli/ink-cli/utils/toolUtils.d.ts.map +1 -1
- package/dist/cli/ink-cli/utils/toolUtils.js +2 -9
- package/dist/cli/utils/config-validation.d.ts +11 -11
- package/dist/cli/utils/config-validation.d.ts.map +1 -1
- package/dist/cli/utils/config-validation.js +56 -290
- package/dist/cli/utils/image-store.d.ts +16 -0
- package/dist/cli/utils/image-store.d.ts.map +1 -0
- package/dist/cli/utils/image-store.js +289 -0
- package/dist/cli/utils/scaffolding-utils.d.ts +5 -0
- package/dist/cli/utils/scaffolding-utils.d.ts.map +1 -1
- package/dist/cli/utils/scaffolding-utils.js +46 -4
- package/dist/cli/utils/template-engine.d.ts +28 -16
- package/dist/cli/utils/template-engine.d.ts.map +1 -1
- package/dist/cli/utils/template-engine.js +339 -479
- package/dist/config/cli-overrides.d.ts +4 -3
- package/dist/config/cli-overrides.d.ts.map +1 -1
- package/dist/config/cli-overrides.js +7 -9
- package/dist/index-main.d.ts +2 -0
- package/dist/index-main.d.ts.map +1 -0
- package/dist/index-main.js +1554 -0
- package/dist/index.js +2 -1589
- package/dist/utils/session-logger-factory.d.ts +3 -0
- package/dist/utils/session-logger-factory.d.ts.map +1 -0
- package/dist/utils/session-logger-factory.js +34 -0
- package/dist/webui/assets/{index-Cz2z7NQ8.js → index-CKhumsZA.js} +231 -231
- package/dist/webui/index.html +1 -1
- package/package.json +11 -8
- package/dist/cli/cli-subscriber.d.ts +0 -45
- package/dist/cli/cli-subscriber.d.ts.map +0 -1
- 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/
|
|
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 {
|
|
12
|
-
import {
|
|
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
|
-
|
|
35
|
-
|
|
36
|
-
|
|
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
|
-
|
|
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
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
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
|
-
|
|
93
|
+
execOrBell('paplay', [soundPath], () => {
|
|
94
|
+
execOrBell('aplay', ['-q', soundPath]);
|
|
95
|
+
});
|
|
65
96
|
}
|
|
66
|
-
|
|
67
|
-
|
|
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
|
-
|
|
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
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
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
|
|
114
|
-
|
|
115
|
-
|
|
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
|
-
|
|
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,
|
|
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
|
|
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
|
|
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
|
|
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
|
|
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
|
|
19
|
-
* @param
|
|
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,
|
|
23
|
-
agentPath?: string;
|
|
24
|
-
}): Promise<ValidationResult>;
|
|
26
|
+
export declare function validateAgentConfig(config: AgentConfig, interactive?: boolean, options?: ValidationOptions): Promise<ValidationResult>;
|
|
25
27
|
/**
|
|
26
|
-
*
|
|
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,
|
|
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"}
|