Add the harness, envs, per-bot models and chat attachments
- Harness: providers, model catalog synced hourly, automatic free picks, cooldowns, tool loop with context trimming, MCP computer tools - Bots queue runs replies and tasks through the harness; jobs wait (attempt refunded) while every model is resting - Envs: Settings > Environment, scoped general/workspace/computer, written to computers and redacted from tool output - Models: Settings > Models, per-harness provider select defaulting to OpenRouter, and a models modal on each bot's chat (the coordinator's edits the defaults) - Chat: thinking row while a reply runs, file attachments (upload, paste, drop) that replies read as images, audio and document text - Fix media uploads failing after a user's first file, and private files being served from the public media path Co-Authored-By: Claude Opus 5.5 <[email protected]>
This commit is contained in:
@@ -1,12 +1,29 @@
|
||||
import { z } from "zod";
|
||||
import { AppData } from "@/src/data/app-data";
|
||||
|
||||
export const SendBotMessageRequestSchema = z.object({
|
||||
bot_id: z.coerce.number().int().positive("Pick a bot to message"),
|
||||
text: z
|
||||
.string()
|
||||
.trim()
|
||||
.min(1, "Write a message first")
|
||||
.max(4000, "Keep messages under 4000 characters"),
|
||||
});
|
||||
text: z.string().trim().max(4000, "Keep messages under 4000 characters").default(""),
|
||||
media_ids: z
|
||||
.array(z.coerce.number().int().positive())
|
||||
.max(AppData.BotAttachmentMaxFiles, `Attach up to ${AppData.BotAttachmentMaxFiles} files`)
|
||||
.default([]),
|
||||
}).refine((body) => body.text || body.media_ids.length, "Write a message or attach a file first");
|
||||
|
||||
export type SendBotMessageRequest = z.infer<typeof SendBotMessageRequestSchema>;
|
||||
|
||||
export const BotIdRequestSchema = z.object({
|
||||
bot_id: z.coerce.number().int().positive("Pick a bot"),
|
||||
});
|
||||
|
||||
export type BotIdRequest = z.infer<typeof BotIdRequestSchema>;
|
||||
|
||||
export const UploadBotAttachmentRequestSchema = z.object({
|
||||
/**
|
||||
* The file as a base64 data URL.
|
||||
*/
|
||||
data_url: z.string().startsWith("data:", "Send the file as a data URL"),
|
||||
name: z.string().trim().min(1, "The file needs a name").max(255),
|
||||
});
|
||||
|
||||
export type UploadBotAttachmentRequest = z.infer<typeof UploadBotAttachmentRequestSchema>;
|
||||
|
||||
Reference in New Issue
Block a user