mirror of
https://github.com/MoonshotAI/kimi-code.git
synced 2026-08-11 01:37:31 +00:00
* feat(protocol): extract shared protocol package from agent-core - add `@moonshot-ai/protocol` package with REST/WS schemas, envelopes, error codes, event types, and display schemas\n- migrate agent-core `events.ts` and `display/schemas.ts` to re-export from protocol - add centralized `onUnexpectedError` handler for safe emitter listener callbacks - reject forkSession when source session has an active running turn - add protocol schema tests and unexpectedError handler tests
13 lines
373 B
TypeScript
13 lines
373 B
TypeScript
import { z } from 'zod';
|
|
|
|
import { isoDateTimeSchema } from './time';
|
|
|
|
export const fileMetaSchema = z.object({
|
|
id: z.string().min(1),
|
|
name: z.string().min(1),
|
|
media_type: z.string().min(1),
|
|
size: z.number().int().nonnegative(),
|
|
created_at: isoDateTimeSchema,
|
|
expires_at: isoDateTimeSchema.optional(),
|
|
});
|
|
export type FileMeta = z.infer<typeof fileMetaSchema>;
|