tycono 0.1.96-beta.33 → 0.1.96-beta.34
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
|
@@ -282,17 +282,44 @@ class SupervisorHeartbeat {
|
|
|
282
282
|
* CEO reads files and answers directly.
|
|
283
283
|
*/
|
|
284
284
|
private spawnConversation(state: SupervisorState, directive: string): void {
|
|
285
|
-
// Build conversation context
|
|
285
|
+
// Build conversation context: previous directives + last execution summary
|
|
286
286
|
const deliveredDirectives = state.pendingDirectives.filter(d => d.delivered);
|
|
287
|
-
const
|
|
288
|
-
?
|
|
287
|
+
const directiveHistory = deliveredDirectives.length > 0
|
|
288
|
+
? deliveredDirectives.map(d => `- CEO: "${d.text}"`).join('\n')
|
|
289
289
|
: '';
|
|
290
290
|
|
|
291
|
-
|
|
291
|
+
// Extract last execution's output from activity stream (what "just happened")
|
|
292
|
+
let lastExecutionSummary = '';
|
|
293
|
+
if (state.supervisorSessionId) {
|
|
294
|
+
try {
|
|
295
|
+
const events = ActivityStream.readAll(state.supervisorSessionId);
|
|
296
|
+
// Get last text outputs (the supervisor's final response)
|
|
297
|
+
const textEvents = events.filter(e => e.type === 'text' && e.roleId === 'ceo');
|
|
298
|
+
const toolEvents = events.filter(e => e.type === 'tool:start' && e.roleId === 'ceo');
|
|
299
|
+
|
|
300
|
+
// Summarize: what tools were used + final text
|
|
301
|
+
const toolSummary = toolEvents.slice(-10).map(e => {
|
|
302
|
+
const name = (e.data.name as string) ?? '';
|
|
303
|
+
const inp = e.data.input as Record<string, unknown> | undefined;
|
|
304
|
+
const detail = inp?.file_path ?? inp?.command ?? '';
|
|
305
|
+
return ` → ${name} ${String(detail).slice(0, 60)}`;
|
|
306
|
+
}).join('\n');
|
|
307
|
+
|
|
308
|
+
const lastText = textEvents.slice(-5).map(e => String(e.data.text ?? '')).join('').slice(-500);
|
|
309
|
+
|
|
310
|
+
if (toolSummary || lastText) {
|
|
311
|
+
lastExecutionSummary = `\n[Previous execution in this wave]\nTools used:\n${toolSummary}\n\nLast response:\n${lastText.slice(0, 500)}\n`;
|
|
312
|
+
}
|
|
313
|
+
} catch { /* ignore */ }
|
|
314
|
+
}
|
|
315
|
+
|
|
316
|
+
const context = [directiveHistory, lastExecutionSummary].filter(Boolean).join('\n');
|
|
317
|
+
|
|
318
|
+
const task = `${context ? context + '\n' : ''}[CEO Question] ${directive}
|
|
292
319
|
|
|
293
|
-
You are the CEO's AI assistant.
|
|
294
|
-
|
|
295
|
-
|
|
320
|
+
You are the CEO's AI assistant. The above shows what happened previously in this wave.
|
|
321
|
+
Answer the CEO's question based on context. Be specific — reference files, results, and actions from the previous execution.
|
|
322
|
+
Do NOT dispatch anyone. Do NOT create new files. Just answer concisely.`;
|
|
296
323
|
|
|
297
324
|
// Reuse session
|
|
298
325
|
let sessionId = state.supervisorSessionId;
|