import { initContract } from '@ts-rest/core'; import { z } from 'zod'; import { errorResponseSchema } from '../schemas/common.schemas'; const c = initContract(); export const shopkeeperMobileLlmContract = c.router({ getManifest: { method: 'GET', path: '/shopkeeper/mobile-llm/manifest', responses: { 200: z.object({ modelFileName: z.string(), sha256: z.string().optional(), downloadUrl: z.string().url().optional(), }), 401: errorResponseSchema, }, summary: 'Get current on-device LLM model manifest (filename + hash for update check)', }, getUploadLogUrl: { method: 'POST', path: '/shopkeeper/mobile-llm/upload-log-url', body: z.object({}), responses: { 200: z.object({ uploadUrl: z.string().url(), key: z.string(), }), 400: errorResponseSchema, 401: errorResponseSchema, }, summary: 'Get presigned PUT URL to upload one on-device LLM request/response log (direct to S3).', }, });