/** * T-172
T-175 (A-010) — AI Knowledge Assistant request DTOs. * * Five capabilities, one route family (`POST /workspaces/:id/ai/assistant/:capability`). * Hard caps that map to 4xx are checked in-service (the codebase convention — * see ai-writing.dto.ts: caps are not zod refines). */ import { z } from "zod"; /** Raw meeting notes for extract-actions. */ export const AiExtractActionsDto = z.object({ text: z.string().trim().min(1).max(100_000), }); export type AiExtractActionsInput = z.infer; /** Explicit page ids for generate-faqs (the caller's own visible pages). */ export const AiGenerateFaqsDto = z.object({ pageIds: z.array(z.string().min(1)).min(1).max(50), }); export type AiGenerateFaqsInput = z.infer; /** * find-duplicates: an optional query narrows the candidate pool (BM25 over the * caller's visible pages); omitted → the most recently updated pages (the pool * cap is enforced in-service). */ export const AiFindDuplicatesDto = z.object({ query: z.string().trim().min(1).max(200).optional(), limit: z.number().int().min(10).max(200).optional(), }); export type AiFindDuplicatesInput = z.infer; /** find-stale: look back N days of updates (server-side cap 365). */ export const AiFindStaleDto = z.object({ days: z.number().int().min(1).max(365).default(90), limit: z.number().int().min(10).max(200).optional(), }); export type AiFindStaleInput = z.infer; /** suggest-metadata: the single page to re-title / re-describe. */ export const AiSuggestMetadataDto = z.object({ pageId: z.string().min(1), }); export type AiSuggestMetadataInput = z.infer; /** Applying a metadata suggestion: a subset of what the call suggested. */ export const AiApplyMetadataDto = z.object({ suggestionId: z.string().min(1), fields: z .object({ title: z.string().trim().min(1).max(200).optional(), description: z.string().trim().min(1).max(2000).optional(), }) .refine((f) => f.title !== undefined || f.description !== undefined, { message: "fields: provide title and/or description" }), }); export type AiApplyMetadataInput = z.infer;