feat: release 1.1.0 with responsive task control
This commit is contained in:
1 parent
057f0c3050
commit
bfcd828fa8
37 files changed
+1601
-151
No files matched your search
@@ -54,6 +54,15 @@ export interface StartupProgressEvent {
|
||||
timestamp: number;
|
||||
}
|
||||
|
||||
export interface GuidanceEvent {
|
||||
id: string;
|
||||
instruction: string;
|
||||
source: string;
|
||||
timestamp: number;
|
||||
status: 'pending' | 'consumed';
|
||||
consumed_at?: number;
|
||||
}
|
||||
|
||||
interface SessionVideoResponse {
|
||||
session_id: string;
|
||||
status?: 'processing' | 'ready' | 'failed' | 'unavailable';
|
||||
@@ -201,6 +210,8 @@ export class AgentService {
|
||||
|
||||
public currentSessionId = signal<string | null>(null);
|
||||
public sessionLogs = signal<any[]>([]); // Dynamic array of all raw events received
|
||||
public guidanceEvents = signal<GuidanceEvent[]>([]);
|
||||
private guidanceSignature = '';
|
||||
public isSessionContentLoading = signal<boolean>(false);
|
||||
public agentStatus = signal<string>('idle'); // Status of the agent runner process
|
||||
public runningSessionId = signal<string | null>(null);
|
||||
@@ -725,6 +736,8 @@ export class AgentService {
|
||||
this.isSessionContentLoading.set(false);
|
||||
this.currentSessionId.set(null);
|
||||
this.sessionLogs.set([]);
|
||||
this.guidanceEvents.set([]);
|
||||
this.guidanceSignature = '';
|
||||
this.currentNotes.set({});
|
||||
return;
|
||||
}
|
||||
@@ -740,6 +753,9 @@ export class AgentService {
|
||||
this.isSessionContentLoading.set(true);
|
||||
this.currentSessionId.set(sessionId);
|
||||
this.sessionLogs.set([]); // Reset logs for new session selection
|
||||
this.guidanceEvents.set([]);
|
||||
this.guidanceSignature = '';
|
||||
this.fetchGuidance(sessionId);
|
||||
this.activePauseCardKey = null;
|
||||
this.isPaused.set(false);
|
||||
this.pausedError.set(null);
|
||||
@@ -1279,6 +1295,21 @@ export class AgentService {
|
||||
});
|
||||
}
|
||||
|
||||
public fetchGuidance(sessionId: string): void {
|
||||
if (this.currentSessionId() !== sessionId) return;
|
||||
this.http.get<GuidanceEvent[]>(`/api/tasks/${encodeURIComponent(sessionId)}/guidance`).subscribe({
|
||||
next: (items) => {
|
||||
if (this.currentSessionId() !== sessionId) return;
|
||||
const signature = JSON.stringify(items);
|
||||
if (signature !== this.guidanceSignature) {
|
||||
this.guidanceSignature = signature;
|
||||
this.guidanceEvents.set(items);
|
||||
}
|
||||
},
|
||||
error: () => { /* Older runners have no guidance history; steps remain authoritative. */ }
|
||||
});
|
||||
}
|
||||
|
||||
private restoreSessionsCache(): void {
|
||||
try {
|
||||
const cached = localStorage.getItem(SESSION_CACHE_KEY);
|
||||
@@ -1488,6 +1519,8 @@ export class AgentService {
|
||||
// Periodically refresh sessions every 6 seconds (every 3 polling intervals of 2s) to stay in sync with external DB modifications
|
||||
if (this.pollCounter % 3 === 0) {
|
||||
this.fetchSessions();
|
||||
const selected = this.currentSessionId();
|
||||
if (selected) this.fetchGuidance(selected);
|
||||
}
|
||||
}, 2000);
|
||||
});
|
||||
|
||||
Reference in new issue
Block a user