mirror of
https://github.com/paperclipai/paperclip.git
synced 2026-11-30 17:14:54 +01:00
Gate agent plugin tabs by execution environment (#20657)
This commit is contained in:
1 parent
e9343d8501
commit
0d4b1d8c89
17 files changed
+275
-18
No files matched your search
@@ -395,6 +395,7 @@ export const pluginUiSlotDeclarationSchema = z.object({
|
||||
displayName: z.string().min(1),
|
||||
exportName: z.string().min(1),
|
||||
entityTypes: z.array(z.enum(PLUGIN_UI_SLOT_ENTITY_TYPES)).optional(),
|
||||
agentEnvironmentDriver: z.string().min(1).optional(),
|
||||
taskSidePanel: z.object({
|
||||
availabilityPath: z.string().regex(/^\/(?:[a-zA-Z0-9_-]+\/)*:entityId(?:\/[a-zA-Z0-9_-]+)*$/),
|
||||
activation: z.object({ namespace: runtimeActivityIdentifierSchema, activityKey: runtimeActivityIdentifierSchema }).strict().optional(),
|
||||
@@ -404,6 +405,9 @@ export const pluginUiSlotDeclarationSchema = z.object({
|
||||
}).optional(),
|
||||
order: z.number().int().optional(),
|
||||
}).superRefine((value, ctx) => {
|
||||
if (value.agentEnvironmentDriver && (value.type !== "detailTab" || value.entityTypes?.length !== 1 || value.entityTypes[0] !== "agent")) {
|
||||
ctx.addIssue({ code: z.ZodIssueCode.custom, message: "agentEnvironmentDriver requires an agent-only detailTab", path: ["agentEnvironmentDriver"] });
|
||||
}
|
||||
if (value.taskSidePanel && (value.type !== "detailTab" || !value.entityTypes?.includes("agent"))) {
|
||||
ctx.addIssue({ code: z.ZodIssueCode.custom, message: "taskSidePanel requires an agent detailTab", path: ["taskSidePanel"] });
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user