@ekkos/cli 1.0.3 → 1.0.5
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/dist/commands/run.js +81 -14
- package/dist/deploy/settings.js +6 -19
- package/package.json +1 -1
package/dist/commands/run.js
CHANGED
|
@@ -808,6 +808,61 @@ function cleanupInstanceFile(instanceId) {
|
|
|
808
808
|
// Ignore cleanup errors
|
|
809
809
|
}
|
|
810
810
|
}
|
|
811
|
+
/**
|
|
812
|
+
* Launch ekkos run + dashboard using Windows Terminal split panes (Windows equivalent of tmux)
|
|
813
|
+
*/
|
|
814
|
+
function launchWithDashboardWindows(options) {
|
|
815
|
+
const launchTime = Date.now();
|
|
816
|
+
// Build the ekkos run command WITHOUT --dashboard (prevent recursion)
|
|
817
|
+
const runArgs = ['run'];
|
|
818
|
+
if (options.session)
|
|
819
|
+
runArgs.push('-s', options.session);
|
|
820
|
+
if (options.bypass)
|
|
821
|
+
runArgs.push('-b');
|
|
822
|
+
if (options.verbose)
|
|
823
|
+
runArgs.push('-v');
|
|
824
|
+
if (options.doctor)
|
|
825
|
+
runArgs.push('-d');
|
|
826
|
+
if (options.research)
|
|
827
|
+
runArgs.push('-r');
|
|
828
|
+
if (options.noInject)
|
|
829
|
+
runArgs.push('--skip-inject');
|
|
830
|
+
if (options.noDna)
|
|
831
|
+
runArgs.push('--skip-dna');
|
|
832
|
+
if (options.noProxy)
|
|
833
|
+
runArgs.push('--skip-proxy');
|
|
834
|
+
runArgs.push('--kickstart');
|
|
835
|
+
const ekkosCmd = process.argv[1];
|
|
836
|
+
const cwd = process.cwd();
|
|
837
|
+
// Write dashboard launch marker
|
|
838
|
+
const markerPath = path.join(state_1.EKKOS_DIR, '.dashboard-launch-ts');
|
|
839
|
+
try {
|
|
840
|
+
fs.writeFileSync(markerPath, `${launchTime}\n${cwd}`);
|
|
841
|
+
}
|
|
842
|
+
catch { }
|
|
843
|
+
const runCommand = `node "${ekkosCmd}" ${runArgs.join(' ')}`;
|
|
844
|
+
const dashCommand = `node "${ekkosCmd}" dashboard --wait-for-new --refresh 2000`;
|
|
845
|
+
// Windows Terminal split pane command:
|
|
846
|
+
// wt --window 0 split-pane -V --size 0.4 --title "ekkOS Dashboard" powershell -NoExit -Command "..."
|
|
847
|
+
// If no WT window exists yet, open a new one with two panes
|
|
848
|
+
const wtCmd = [
|
|
849
|
+
'wt',
|
|
850
|
+
`new-tab --title "ekkOS" powershell -NoExit -Command "${runCommand}"`,
|
|
851
|
+
`; split-pane -V --size 0.4 --title "ekkOS Dashboard" powershell -NoExit -Command "${dashCommand}"`
|
|
852
|
+
].join(' ');
|
|
853
|
+
try {
|
|
854
|
+
(0, child_process_1.execSync)(wtCmd, { stdio: 'inherit', shell: true });
|
|
855
|
+
console.log(chalk_1.default.cyan('\n Dashboard launched in right pane (40%)'));
|
|
856
|
+
console.log(chalk_1.default.gray(' Switch panes: Alt+Left / Alt+Right in Windows Terminal'));
|
|
857
|
+
// Exit current process — the new WT window takes over
|
|
858
|
+
process.exit(0);
|
|
859
|
+
}
|
|
860
|
+
catch (err) {
|
|
861
|
+
console.log(chalk_1.default.red(`Windows Terminal error: ${err.message}`));
|
|
862
|
+
console.log(chalk_1.default.gray('Tip: Install Windows Terminal from the Microsoft Store for split-pane support.'));
|
|
863
|
+
console.log(chalk_1.default.gray('Falling back to normal mode. Run "ekkos dashboard --latest" in another terminal.'));
|
|
864
|
+
}
|
|
865
|
+
}
|
|
811
866
|
/**
|
|
812
867
|
* Launch ekkos run + dashboard in isolated tmux panes (60/40 split)
|
|
813
868
|
*/
|
|
@@ -911,25 +966,37 @@ async function run(options) {
|
|
|
911
966
|
console.log(chalk_1.default.yellow(' ⏭️ API proxy disabled (--no-proxy)'));
|
|
912
967
|
}
|
|
913
968
|
// ══════════════════════════════════════════════════════════════════════════
|
|
914
|
-
// DASHBOARD MODE:
|
|
969
|
+
// DASHBOARD MODE: tmux (Mac/Linux) or Windows Terminal (Windows)
|
|
915
970
|
// ══════════════════════════════════════════════════════════════════════════
|
|
916
971
|
if (options.dashboard) {
|
|
917
|
-
|
|
918
|
-
|
|
919
|
-
|
|
920
|
-
|
|
921
|
-
|
|
922
|
-
launchWithDashboard(options);
|
|
972
|
+
if (isWindows) {
|
|
973
|
+
// Windows: use Windows Terminal split panes
|
|
974
|
+
try {
|
|
975
|
+
(0, child_process_1.execSync)('where wt', { stdio: 'pipe' });
|
|
976
|
+
launchWithDashboardWindows(options);
|
|
923
977
|
return;
|
|
924
978
|
}
|
|
979
|
+
catch {
|
|
980
|
+
console.log(chalk_1.default.yellow(' Windows Terminal not found.'));
|
|
981
|
+
console.log(chalk_1.default.gray(' Install from Microsoft Store: https://aka.ms/terminal'));
|
|
982
|
+
console.log(chalk_1.default.gray(' Alternative: run "ekkos dashboard --latest" in a separate terminal'));
|
|
983
|
+
console.log(chalk_1.default.gray(' Continuing without dashboard...\n'));
|
|
984
|
+
}
|
|
925
985
|
}
|
|
926
|
-
|
|
927
|
-
|
|
928
|
-
|
|
929
|
-
|
|
930
|
-
|
|
931
|
-
|
|
932
|
-
|
|
986
|
+
else {
|
|
987
|
+
// Mac/Linux: use tmux
|
|
988
|
+
try {
|
|
989
|
+
const tmuxPath = (0, child_process_1.execSync)('which tmux', { encoding: 'utf-8' }).trim();
|
|
990
|
+
if (tmuxPath) {
|
|
991
|
+
launchWithDashboard(options);
|
|
992
|
+
return;
|
|
993
|
+
}
|
|
994
|
+
}
|
|
995
|
+
catch {
|
|
996
|
+
console.log(chalk_1.default.yellow(' tmux not found. Install: brew install tmux'));
|
|
997
|
+
console.log(chalk_1.default.gray(' Alternative: run "ekkos dashboard --latest" in a separate terminal'));
|
|
998
|
+
console.log(chalk_1.default.gray(' Continuing without dashboard...\n'));
|
|
999
|
+
}
|
|
933
1000
|
}
|
|
934
1001
|
}
|
|
935
1002
|
// Generate instance ID for this run
|
package/dist/deploy/settings.js
CHANGED
|
@@ -6,40 +6,28 @@ const fs_1 = require("fs");
|
|
|
6
6
|
const platform_1 = require("../utils/platform");
|
|
7
7
|
/**
|
|
8
8
|
* Generate the hooks configuration for Claude Code settings.json
|
|
9
|
+
* Uses the new format required by Claude Code 2.1.40+
|
|
9
10
|
*/
|
|
10
11
|
function generateHooksConfig() {
|
|
11
12
|
const hooksDir = `${platform_1.HOME_DIR}/.claude/hooks`;
|
|
12
13
|
if (platform_1.isWindows) {
|
|
13
|
-
// Windows uses PowerShell
|
|
14
14
|
return {
|
|
15
|
-
SessionStart: [
|
|
16
|
-
{ type: 'command', command: `powershell -ExecutionPolicy Bypass -File "${hooksDir}/session-start.ps1"` }
|
|
17
|
-
],
|
|
18
15
|
UserPromptSubmit: [
|
|
19
|
-
{ type: 'command', command: `powershell -ExecutionPolicy Bypass -File "${hooksDir}/user-prompt-submit.ps1"` }
|
|
16
|
+
{ hooks: [{ type: 'command', command: `powershell -ExecutionPolicy Bypass -File "${hooksDir}/user-prompt-submit.ps1"` }] }
|
|
20
17
|
],
|
|
21
18
|
Stop: [
|
|
22
|
-
{ type: 'command', command: `powershell -ExecutionPolicy Bypass -File "${hooksDir}/stop.ps1"` }
|
|
19
|
+
{ hooks: [{ type: 'command', command: `powershell -ExecutionPolicy Bypass -File "${hooksDir}/stop.ps1"` }] }
|
|
23
20
|
],
|
|
24
|
-
AssistantResponse: [
|
|
25
|
-
{ type: 'command', command: `powershell -ExecutionPolicy Bypass -File "${hooksDir}/assistant-response.ps1"` }
|
|
26
|
-
]
|
|
27
21
|
};
|
|
28
22
|
}
|
|
29
23
|
// Unix uses bash
|
|
30
24
|
return {
|
|
31
|
-
SessionStart: [
|
|
32
|
-
{ type: 'command', command: `bash ${hooksDir}/session-start.sh` }
|
|
33
|
-
],
|
|
34
25
|
UserPromptSubmit: [
|
|
35
|
-
{ type: 'command', command: `bash ${hooksDir}/user-prompt-submit.sh` }
|
|
26
|
+
{ hooks: [{ type: 'command', command: `bash ${hooksDir}/user-prompt-submit.sh` }] }
|
|
36
27
|
],
|
|
37
28
|
Stop: [
|
|
38
|
-
{ type: 'command', command: `bash ${hooksDir}/stop.sh` }
|
|
29
|
+
{ hooks: [{ type: 'command', command: `bash ${hooksDir}/stop.sh` }] }
|
|
39
30
|
],
|
|
40
|
-
AssistantResponse: [
|
|
41
|
-
{ type: 'command', command: `bash ${hooksDir}/assistant-response.sh` }
|
|
42
|
-
]
|
|
43
31
|
};
|
|
44
32
|
}
|
|
45
33
|
/**
|
|
@@ -74,8 +62,7 @@ function areHooksConfigured() {
|
|
|
74
62
|
try {
|
|
75
63
|
const settings = JSON.parse((0, fs_1.readFileSync)(platform_1.CLAUDE_SETTINGS, 'utf-8'));
|
|
76
64
|
const hooks = settings.hooks || {};
|
|
77
|
-
return Boolean(hooks.
|
|
78
|
-
hooks.UserPromptSubmit?.length &&
|
|
65
|
+
return Boolean(hooks.UserPromptSubmit?.length &&
|
|
79
66
|
hooks.Stop?.length);
|
|
80
67
|
}
|
|
81
68
|
catch {
|