tycono 0.2.0 → 0.3.0
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/tui/app.tsx +41 -1
package/package.json
CHANGED
package/src/tui/app.tsx
CHANGED
|
@@ -258,6 +258,40 @@ export const App: React.FC = () => {
|
|
|
258
258
|
});
|
|
259
259
|
}, []);
|
|
260
260
|
|
|
261
|
+
// Load previous conversation from wave's activity stream into system messages
|
|
262
|
+
const loadPreviousConversation = useCallback(async (waveId: string) => {
|
|
263
|
+
try {
|
|
264
|
+
const sessions = api.sessions.filter(s => s.waveId === waveId && s.roleId === 'ceo');
|
|
265
|
+
if (sessions.length === 0) return;
|
|
266
|
+
|
|
267
|
+
for (const ses of sessions.slice(-2)) { // Last 2 sessions
|
|
268
|
+
try {
|
|
269
|
+
const events = await import('./api').then(m => m.fetchJson<any[]>(`/api/jobs/${ses.id}/history`));
|
|
270
|
+
if (!Array.isArray(events)) continue;
|
|
271
|
+
|
|
272
|
+
for (const e of events) {
|
|
273
|
+
if (e.type === 'msg:start' && e.data?.task) {
|
|
274
|
+
const task = String(e.data.task);
|
|
275
|
+
const match = task.match(/\[CEO (?:Supervisor|Question)\]\s*(.*?)(?:\n|$)/);
|
|
276
|
+
if (match) {
|
|
277
|
+
addSystemMessage(`> ${match[1].slice(0, 80)}`, 'green');
|
|
278
|
+
}
|
|
279
|
+
}
|
|
280
|
+
if (e.type === 'text' && e.roleId === 'ceo') {
|
|
281
|
+
const text = String(e.data?.text ?? '').trim();
|
|
282
|
+
if (text && text.length > 5 && !text.startsWith('#') && !text.startsWith('\u26D4') && !text.startsWith('[')) {
|
|
283
|
+
addSystemMessage(text.slice(0, 200), 'white');
|
|
284
|
+
}
|
|
285
|
+
}
|
|
286
|
+
}
|
|
287
|
+
} catch { /* skip individual session errors */ }
|
|
288
|
+
}
|
|
289
|
+
|
|
290
|
+
addSystemMessage('\u2500'.repeat(40), 'gray');
|
|
291
|
+
addSystemMessage('(previous conversation loaded)', 'gray');
|
|
292
|
+
} catch { /* ignore */ }
|
|
293
|
+
}, [api.sessions, addSystemMessage]);
|
|
294
|
+
|
|
261
295
|
// Auto-wave: on dashboard entry, create an empty wave or attach to existing
|
|
262
296
|
useEffect(() => {
|
|
263
297
|
if (view !== 'dashboard' || autoWaveCreated.current) return;
|
|
@@ -297,7 +331,13 @@ export const App: React.FC = () => {
|
|
|
297
331
|
pastEntries.sort((a, b) => a.startedAt - b.startedAt);
|
|
298
332
|
setWaves(pastEntries);
|
|
299
333
|
// Focus most recent wave (last in sorted list)
|
|
300
|
-
|
|
334
|
+
const lastWave = pastEntries[pastEntries.length - 1];
|
|
335
|
+
setFocusedWaveId(lastWave?.waveId ?? null);
|
|
336
|
+
|
|
337
|
+
// Load previous conversation into stream (like claude --resume)
|
|
338
|
+
if (lastWave) {
|
|
339
|
+
loadPreviousConversation(lastWave.waveId);
|
|
340
|
+
}
|
|
301
341
|
} else if (api.loaded) {
|
|
302
342
|
// No active waves, no past waves — fresh start
|
|
303
343
|
autoWaveCreated.current = true;
|