tycono 0.3.0 → 0.3.2

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.
Files changed (2) hide show
  1. package/package.json +1 -1
  2. package/src/tui/app.tsx +7 -2
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "tycono",
3
- "version": "0.3.0",
3
+ "version": "0.3.2",
4
4
  "description": "Build an AI company. Watch them work.",
5
5
  "type": "module",
6
6
  "bin": {
package/src/tui/app.tsx CHANGED
@@ -266,8 +266,9 @@ export const App: React.FC = () => {
266
266
 
267
267
  for (const ses of sessions.slice(-2)) { // Last 2 sessions
268
268
  try {
269
- const events = await import('./api').then(m => m.fetchJson<any[]>(`/api/jobs/${ses.id}/history`));
270
- if (!Array.isArray(events)) continue;
269
+ const resp = await import('./api').then(m => m.fetchJson<{ events: any[] }>(`/api/jobs/${ses.id}/history`));
270
+ const events = resp?.events ?? (Array.isArray(resp) ? resp : []);
271
+ if (!events.length) continue;
271
272
 
272
273
  for (const e of events) {
273
274
  if (e.type === 'msg:start' && e.data?.task) {
@@ -401,6 +402,8 @@ export const App: React.FC = () => {
401
402
  onFocusWave: (waveId) => {
402
403
  setFocusedWaveId(waveId);
403
404
  sse.clearEvents();
405
+ setSystemMessages([]); // Clear old messages
406
+ loadPreviousConversation(waveId);
404
407
  },
405
408
  onQuit: () => exit(),
406
409
  onShowPanel: () => setMode('panel'),
@@ -646,6 +649,8 @@ export const App: React.FC = () => {
646
649
  onFocusWave={(newWaveId) => {
647
650
  setFocusedWaveId(newWaveId);
648
651
  sse.clearEvents();
652
+ setSystemMessages([]);
653
+ loadPreviousConversation(newWaveId);
649
654
  }}
650
655
  />
651
656
  </Box>