mirror of
https://github.com/AutoMaker-Org/automaker.git
synced 2026-02-01 20:23:36 +00:00
adding a queue system to the agent runner
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user