tycono 0.1.98 → 0.1.100
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 +1 -1
- package/src/api/src/services/activity-stream.ts +2 -0
- package/src/api/src/services/execution-manager.ts +14 -0
- package/src/api/src/services/session-store.ts +7 -0
- package/src/api/src/services/wave-multiplexer.ts +6 -0
- package/src/tui/app.tsx +1 -1
- package/src/tui/components/CommandMode.tsx +10 -2
package/package.json
CHANGED
|
@@ -539,6 +539,20 @@ class ExecutionManager {
|
|
|
539
539
|
console.log(`[ExecMgr] Released ports for ${execution.id}: API :${execution.ports.api}, Vite :${execution.ports.vite}`);
|
|
540
540
|
}
|
|
541
541
|
}
|
|
542
|
+
|
|
543
|
+
// Memory cleanup: remove completed execution after 60s
|
|
544
|
+
// Keep briefly for status queries, then GC
|
|
545
|
+
setTimeout(() => {
|
|
546
|
+
this.executions.delete(execution.id);
|
|
547
|
+
// Clean up any leaked sessionMsgContent
|
|
548
|
+
if (execution.sessionId) {
|
|
549
|
+
for (const key of this.sessionMsgContent.keys()) {
|
|
550
|
+
if (key.startsWith(execution.sessionId + ':')) {
|
|
551
|
+
this.sessionMsgContent.delete(key);
|
|
552
|
+
}
|
|
553
|
+
}
|
|
554
|
+
}
|
|
555
|
+
}, 60_000);
|
|
542
556
|
});
|
|
543
557
|
}
|
|
544
558
|
|
|
@@ -251,6 +251,13 @@ export function updateSession(id: string, updates: Partial<Pick<Session, 'title'
|
|
|
251
251
|
if (updates.waveId !== undefined) session.waveId = updates.waveId;
|
|
252
252
|
session.updatedAt = new Date().toISOString();
|
|
253
253
|
writeImmediate(session);
|
|
254
|
+
|
|
255
|
+
// Memory: evict done/interrupted sessions from cache after write
|
|
256
|
+
// They're persisted to disk and can be re-loaded on demand
|
|
257
|
+
if (session.status === 'done' || session.status === 'interrupted') {
|
|
258
|
+
setTimeout(() => { cache.delete(id); }, 30_000);
|
|
259
|
+
}
|
|
260
|
+
|
|
254
261
|
return session;
|
|
255
262
|
}
|
|
256
263
|
|
|
@@ -222,6 +222,12 @@ class WaveMultiplexer {
|
|
|
222
222
|
this.registerSession(waveId, execution);
|
|
223
223
|
}
|
|
224
224
|
|
|
225
|
+
/** Remove completed wave sessions from memory */
|
|
226
|
+
cleanupWave(waveId: string): void {
|
|
227
|
+
this.waveSessions.delete(waveId);
|
|
228
|
+
this.clients.delete(waveId);
|
|
229
|
+
}
|
|
230
|
+
|
|
225
231
|
detach(waveId: string, client: WaveStreamClient): void {
|
|
226
232
|
client.closed = true;
|
|
227
233
|
clearInterval(client.heartbeat);
|
package/src/tui/app.tsx
CHANGED
|
@@ -343,7 +343,7 @@ export const App: React.FC = () => {
|
|
|
343
343
|
|
|
344
344
|
// Handle command submission from CommandMode
|
|
345
345
|
const handleCommandSubmit = useCallback(async (input: string) => {
|
|
346
|
-
|
|
346
|
+
// User input is already shown by CommandMode (immediate commit to Static)
|
|
347
347
|
|
|
348
348
|
const result = await execute(input);
|
|
349
349
|
|
|
@@ -281,6 +281,8 @@ export const CommandMode: React.FC<CommandModeProps> = ({
|
|
|
281
281
|
}) => {
|
|
282
282
|
const [input, setInput] = useState('');
|
|
283
283
|
const committedRef = useRef(0);
|
|
284
|
+
// Immediately committed user inputs (shown in Static before systemMessages arrive)
|
|
285
|
+
const [userInputs, setUserInputs] = useState<StreamLine[]>([]);
|
|
284
286
|
|
|
285
287
|
// Convert events to stream lines
|
|
286
288
|
const eventLines: StreamLine[] = [];
|
|
@@ -289,8 +291,8 @@ export const CommandMode: React.FC<CommandModeProps> = ({
|
|
|
289
291
|
if (line) eventLines.push(line);
|
|
290
292
|
}
|
|
291
293
|
|
|
292
|
-
// Merge system messages
|
|
293
|
-
const allLines = [...systemMessages, ...eventLines].slice(-100);
|
|
294
|
+
// Merge user inputs + system messages + event lines (cap total)
|
|
295
|
+
const allLines = [...userInputs, ...systemMessages, ...eventLines].slice(-100);
|
|
294
296
|
|
|
295
297
|
// Split into committed (scrollback) and live (re-rendered)
|
|
296
298
|
const newCommitted = allLines.slice(committedRef.current);
|
|
@@ -307,6 +309,12 @@ export const CommandMode: React.FC<CommandModeProps> = ({
|
|
|
307
309
|
const handleSubmit = useCallback((value: string) => {
|
|
308
310
|
const trimmed = value.trim();
|
|
309
311
|
if (trimmed) {
|
|
312
|
+
// Show user input immediately in scrollback (before AI responds)
|
|
313
|
+
setUserInputs(prev => [...prev.slice(-10), {
|
|
314
|
+
id: ++lineCounter,
|
|
315
|
+
text: `> ${trimmed}`,
|
|
316
|
+
color: 'yellow',
|
|
317
|
+
}]);
|
|
310
318
|
onSubmit(trimmed);
|
|
311
319
|
}
|
|
312
320
|
setInput('');
|