Add image attachments to agent creation
This commit is contained in:
@@ -365,6 +365,10 @@ export const CreateAgentRequestMessageSchema = z.object({
|
||||
config: AgentSessionConfigSchema,
|
||||
worktreeName: z.string().optional(),
|
||||
initialPrompt: z.string().optional(),
|
||||
images: z.array(z.object({
|
||||
data: z.string(), // base64 encoded image
|
||||
mimeType: z.string(), // e.g., "image/jpeg", "image/png"
|
||||
})).optional(),
|
||||
git: GitSetupOptionsSchema.optional(),
|
||||
requestId: z.string().optional(),
|
||||
});
|
||||
|
||||
@@ -1265,7 +1265,7 @@ export class Session {
|
||||
private async handleCreateAgentRequest(
|
||||
msg: Extract<SessionInboundMessage, { type: "create_agent_request" }>
|
||||
): Promise<void> {
|
||||
const { config, worktreeName, requestId, initialPrompt, git } = msg;
|
||||
const { config, worktreeName, requestId, initialPrompt, git, images } = msg;
|
||||
console.log(
|
||||
`[Session ${this.clientId}] Creating agent in ${config.cwd} (${config.provider})${
|
||||
worktreeName ? ` with worktree ${worktreeName}` : ""
|
||||
@@ -1306,7 +1306,8 @@ export class Session {
|
||||
await this.handleSendAgentMessage(
|
||||
snapshot.id,
|
||||
trimmedPrompt,
|
||||
uuidv4()
|
||||
uuidv4(),
|
||||
images
|
||||
);
|
||||
} catch (promptError) {
|
||||
console.error(
|
||||
|
||||
Reference in New Issue
Block a user