Add agent instructions bundle editing
Expose first-class instructions bundle APIs, preserve agent prompt bundles in portability flows, and replace the Agent Detail prompts tab with file-backed bundle editing while retiring bootstrap prompt UI. Co-Authored-By: Paperclip <noreply@paperclip.ing>
This commit is contained in:
@@ -11,6 +11,25 @@ export const agentPermissionsSchema = z.object({
|
||||
canCreateAgents: z.boolean().optional().default(false),
|
||||
});
|
||||
|
||||
export const agentInstructionsBundleModeSchema = z.enum(["managed", "external"]);
|
||||
|
||||
export const updateAgentInstructionsBundleSchema = z.object({
|
||||
mode: agentInstructionsBundleModeSchema.optional(),
|
||||
rootPath: z.string().trim().min(1).nullable().optional(),
|
||||
entryFile: z.string().trim().min(1).optional(),
|
||||
clearLegacyPromptTemplate: z.boolean().optional().default(false),
|
||||
});
|
||||
|
||||
export type UpdateAgentInstructionsBundle = z.infer<typeof updateAgentInstructionsBundleSchema>;
|
||||
|
||||
export const upsertAgentInstructionsFileSchema = z.object({
|
||||
path: z.string().trim().min(1),
|
||||
content: z.string(),
|
||||
clearLegacyPromptTemplate: z.boolean().optional().default(false),
|
||||
});
|
||||
|
||||
export type UpsertAgentInstructionsFile = z.infer<typeof upsertAgentInstructionsFileSchema>;
|
||||
|
||||
const adapterConfigSchema = z.record(z.unknown()).superRefine((value, ctx) => {
|
||||
const envValue = value.env;
|
||||
if (envValue === undefined) return;
|
||||
|
||||
@@ -73,6 +73,9 @@ export {
|
||||
createAgentSchema,
|
||||
createAgentHireSchema,
|
||||
updateAgentSchema,
|
||||
agentInstructionsBundleModeSchema,
|
||||
updateAgentInstructionsBundleSchema,
|
||||
upsertAgentInstructionsFileSchema,
|
||||
updateAgentInstructionsPathSchema,
|
||||
createAgentKeySchema,
|
||||
wakeAgentSchema,
|
||||
@@ -83,6 +86,8 @@ export {
|
||||
type CreateAgent,
|
||||
type CreateAgentHire,
|
||||
type UpdateAgent,
|
||||
type UpdateAgentInstructionsBundle,
|
||||
type UpsertAgentInstructionsFile,
|
||||
type UpdateAgentInstructionsPath,
|
||||
type CreateAgentKey,
|
||||
type WakeAgent,
|
||||
|
||||
Reference in New Issue
Block a user