tycono 0.3.15 → 0.3.17
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/package.json
CHANGED
|
@@ -89,18 +89,18 @@ export function handleExecRequest(req: IncomingMessage, res: ServerResponse): vo
|
|
|
89
89
|
return;
|
|
90
90
|
}
|
|
91
91
|
|
|
92
|
-
// ── /api/waves/:waveId/stop —
|
|
92
|
+
// ── /api/waves/:waveId/stop — Interrupt supervisor (like Claude Code Esc) ──
|
|
93
93
|
const stopMatch = url.match(/^\/api\/waves\/([^/]+)\/stop$/);
|
|
94
94
|
if (method === 'POST' && stopMatch) {
|
|
95
95
|
const waveId = stopMatch[1];
|
|
96
|
-
|
|
97
|
-
//
|
|
98
|
-
const
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
if (executionManager.abortSession(ses.id)) aborted++;
|
|
96
|
+
// Interrupt CEO supervisor only — children keep running naturally
|
|
97
|
+
// Wave stays alive for new directives (interrupt + redirect)
|
|
98
|
+
const state = supervisorHeartbeat.getState(waveId);
|
|
99
|
+
if (state?.supervisorSessionId) {
|
|
100
|
+
executionManager.abortSession(state.supervisorSessionId);
|
|
102
101
|
}
|
|
103
|
-
|
|
102
|
+
supervisorHeartbeat.stop(waveId);
|
|
103
|
+
jsonResponse(res, 200, { ok: true, waveId, interrupted: true });
|
|
104
104
|
return;
|
|
105
105
|
}
|
|
106
106
|
|
package/src/tui/app.tsx
CHANGED
|
@@ -20,7 +20,7 @@ import { SetupWizard } from './components/SetupWizard';
|
|
|
20
20
|
import { useApi } from './hooks/useApi';
|
|
21
21
|
import { useSSE } from './hooks/useSSE';
|
|
22
22
|
import { useCommand, type WaveInfo } from './hooks/useCommand';
|
|
23
|
-
import { dispatchWave } from './api';
|
|
23
|
+
import { dispatchWave, stopWave } from './api';
|
|
24
24
|
import type { ActiveSessionInfo, PresetSummary } from './api';
|
|
25
25
|
import { buildOrgTree, flattenOrgRoleIds } from './store';
|
|
26
26
|
|
|
@@ -630,10 +630,15 @@ export const App: React.FC = () => {
|
|
|
630
630
|
return;
|
|
631
631
|
}
|
|
632
632
|
if (mode === 'command' && key.tab) {
|
|
633
|
-
// Clear terminal before Panel Mode (removes Command Mode scrollback)
|
|
634
633
|
process.stdout.write('\x1b[2J\x1b[H');
|
|
635
634
|
setMode('panel');
|
|
636
635
|
}
|
|
636
|
+
// Esc in Command Mode → interrupt supervisor (like Claude Code)
|
|
637
|
+
// Only when actually streaming (not idle/done) — prevents spam on repeated Esc
|
|
638
|
+
if (mode === 'command' && key.escape && focusedWaveId
|
|
639
|
+
&& (sse.streamStatus === 'streaming')) {
|
|
640
|
+
stopWave(focusedWaveId).catch(() => {});
|
|
641
|
+
}
|
|
637
642
|
});
|
|
638
643
|
|
|
639
644
|
// Loading state
|
|
@@ -114,16 +114,16 @@ export function useCommand(options: UseCommandOptions) {
|
|
|
114
114
|
return { type: 'sessions', message: '__sessions__' };
|
|
115
115
|
|
|
116
116
|
case 'stop': {
|
|
117
|
-
//
|
|
117
|
+
// Interrupt supervisor (like Esc) — wave stays alive for new directives
|
|
118
118
|
const targetWaveId = args?.trim() || focusedWaveId;
|
|
119
119
|
if (!targetWaveId) {
|
|
120
|
-
return { type: 'error', message: 'No wave
|
|
120
|
+
return { type: 'error', message: 'No wave focused. Use /stop or focus a wave first.' };
|
|
121
121
|
}
|
|
122
122
|
try {
|
|
123
|
-
|
|
124
|
-
return { type: 'success', message:
|
|
123
|
+
await stopWave(targetWaveId);
|
|
124
|
+
return { type: 'success', message: '\u23F9 Interrupted. Type to continue.' };
|
|
125
125
|
} catch (err) {
|
|
126
|
-
return { type: 'error', message: `
|
|
126
|
+
return { type: 'error', message: `Interrupt failed: ${err instanceof Error ? err.message : 'unknown'}` };
|
|
127
127
|
}
|
|
128
128
|
}
|
|
129
129
|
|