adding a queue system to the agent runner

This commit is contained in:
Test User
2025-12-26 10:59:13 -05:00
parent f95282069d
commit 17c1c733b7
24 changed files with 1753 additions and 65 deletions

View File

@@ -829,6 +829,47 @@ export class HttpApiClient implements ElectronAPI {
onStream: (callback: (data: unknown) => void): (() => void) => {
return this.subscribeToEvent('agent:stream', callback as EventCallback);
},
// Queue management
queueAdd: (
sessionId: string,
message: string,
imagePaths?: string[],
model?: string
): Promise<{
success: boolean;
queuedPrompt?: {
id: string;
message: string;
imagePaths?: string[];
model?: string;
addedAt: string;
};
error?: string;
}> => this.post('/api/agent/queue/add', { sessionId, message, imagePaths, model }),
queueList: (
sessionId: string
): Promise<{
success: boolean;
queue?: Array<{
id: string;
message: string;
imagePaths?: string[];
model?: string;
addedAt: string;
}>;
error?: string;
}> => this.post('/api/agent/queue/list', { sessionId }),
queueRemove: (
sessionId: string,
promptId: string
): Promise<{ success: boolean; error?: string }> =>
this.post('/api/agent/queue/remove', { sessionId, promptId }),
queueClear: (sessionId: string): Promise<{ success: boolean; error?: string }> =>
this.post('/api/agent/queue/clear', { sessionId }),
};
// Templates API
@@ -1045,6 +1086,45 @@ export class HttpApiClient implements ElectronAPI {
error?: string;
}> => this.post('/api/context/describe-file', { filePath }),
};
// Backlog Plan API
backlogPlan = {
generate: (
projectPath: string,
prompt: string,
model?: string
): Promise<{ success: boolean; error?: string }> =>
this.post('/api/backlog-plan/generate', { projectPath, prompt, model }),
stop: (): Promise<{ success: boolean; error?: string }> =>
this.post('/api/backlog-plan/stop', {}),
status: (): Promise<{ success: boolean; isRunning?: boolean; error?: string }> =>
this.get('/api/backlog-plan/status'),
apply: (
projectPath: string,
plan: {
changes: Array<{
type: 'add' | 'update' | 'delete';
featureId?: string;
feature?: Record<string, unknown>;
reason: string;
}>;
summary: string;
dependencyUpdates: Array<{
featureId: string;
removedDependencies: string[];
addedDependencies: string[];
}>;
}
): Promise<{ success: boolean; appliedChanges?: string[]; error?: string }> =>
this.post('/api/backlog-plan/apply', { projectPath, plan }),
onEvent: (callback: (data: unknown) => void): (() => void) => {
return this.subscribeToEvent('backlog-plan:event', callback as EventCallback);
},
};
}
// Singleton instance