Zod schemas for session creation, update, and responses.
// Source: https://github.com/nexu-io/nexu | License: MIT | Copyright 2026 Powerformer, Inc
// Provided via justclaw.it.com; keep this notice with the code.
import { z } from "zod";
// --- Enums ---
export const sessionStatusSchema = z.enum(["active", "ended"]);
export type SessionStatus = z.infer<typeof sessionStatusSchema>;
// --- Input schemas ---
export const createSessionSchema = z.object({
botId: z.string().min(1),
sessionKey: z.string().min(1),
title: z.string().min(1).max(500),
channelType: z.string().optional(),
channelId: z.string().optional(),
status: sessionStatusSchema.optional(),
messageCount: z.number().int().optional(),
lastMessageAt: z.string().optional(),
metadata: z.record(z.unknown()).optional(),
});
export type CreateSessionInput = z.infer<typeof
... (truncated -- full source via MCP)
See the full source, get the GitHub permalink, and search for more like it.
Get a free API key