fix(host): harden skill.invoke at the enforcement boundary
Review fixes: recheck isUserInvocable on the loaded definition (list and get collect independently, so a provider change between them could swap in a user-disabled body — the skill-tool execute template's second check); thread the carrier signal through the lookup and refuse an abandoned caller's turn as cancelled; fold lookup/loader failures into the structured internal error the list face already uses; refuse cwd-less sessions with the skill.list stance; and reject blank trailing text at the wire schema instead of relying on client trimming.
This commit is contained in:
@@ -27,11 +27,14 @@ export const skillListValueSchema = z.object({
|
||||
skills: z.array(skillEntrySchema),
|
||||
}) satisfies z.ZodType<Wire<ResponseValue<'skill.list'>>>
|
||||
|
||||
/** skill.invoke request payload. */
|
||||
/**
|
||||
* skill.invoke request payload. `text` is the user's trailing message; a
|
||||
* blank one stays off the wire (the boundary, not client courtesy, refuses it).
|
||||
*/
|
||||
export const skillInvokeRequestSchema = z.object({
|
||||
sessionId: sessionIdSchema,
|
||||
name: z.string().min(1),
|
||||
text: z.string().optional(),
|
||||
text: z.string().min(1).optional(),
|
||||
}) satisfies z.ZodType<Wire<RequestPayload<'skill.invoke'>>>
|
||||
|
||||
/** skill.invoke response value. */
|
||||
|
||||
Reference in New Issue
Block a user