tycono 0.3.15 → 0.3.16

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
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "tycono",
3
- "version": "0.3.15",
3
+ "version": "0.3.16",
4
4
  "description": "Build an AI company. Watch them work.",
5
5
  "type": "module",
6
6
  "bin": {
@@ -89,18 +89,18 @@ export function handleExecRequest(req: IncomingMessage, res: ServerResponse): vo
89
89
  return;
90
90
  }
91
91
 
92
- // ── /api/waves/:waveId/stop — Stop wave execution ──
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
- supervisorHeartbeat.stop(waveId);
97
- // Also abort all running executions for this wave
98
- const waveSessions = listSessions().filter(s => s.waveId === waveId && s.status === 'active');
99
- let aborted = 0;
100
- for (const ses of waveSessions) {
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
- jsonResponse(res, 200, { ok: true, waveId, abortedSessions: aborted });
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
+ if (mode === 'command' && key.escape && focusedWaveId && derivedWaveStatus === 'running') {
638
+ stopWave(focusedWaveId).then(() => {
639
+ addSystemMessage('\u23F9 Interrupted. Type to continue.', 'yellow');
640
+ }).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
- // Stop current wave execution
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 to stop. Use /stop or focus a wave first.' };
120
+ return { type: 'error', message: 'No wave focused. Use /stop or focus a wave first.' };
121
121
  }
122
122
  try {
123
- const result = await stopWave(targetWaveId);
124
- return { type: 'success', message: `Wave stopped. ${result.abortedSessions} sessions aborted.` };
123
+ await stopWave(targetWaveId);
124
+ return { type: 'success', message: '\u23F9 Interrupted. Type to continue.' };
125
125
  } catch (err) {
126
- return { type: 'error', message: `Stop failed: ${err instanceof Error ? err.message : 'unknown'}` };
126
+ return { type: 'error', message: `Interrupt failed: ${err instanceof Error ? err.message : 'unknown'}` };
127
127
  }
128
128
  }
129
129