/** * T-172…T-175 (A-010) — AI Knowledge Assistant: the five new tools. * * Each capability gets: a `*_SYSTEM_PROMPT`, a `ToolSpec` (the strict * JSON-Schema subset the gateway validates), a `validate*` zod helper for the * UNTRUSTED model output, and a prompt renderer. The renderers are also the * MockProvider's parse contract (mode "assistant", action per tool) — the * unit/integration path exercises the REAL prompt → provider → * server-validation loop, exactly like the writing/database/rag/generate * capabilities. * * Security (spec §15, SECURITY_REVIEW §4.8): context is rendered ONLY from * the permission-filtered candidate set (the service re-checks VIEW per page * via `actorLevel` before it reaches here); every model-emitted page id is * filtered against that set before any use or write (no fabricated refs). */ import { z } from "zod"; // --------------------------------------------------------------------------- // Shared render helpers // --------------------------------------------------------------------------- /** `[n]