/* * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. */ import * as z from "zod/v4-mini"; import { safeParse } from "../lib/schemas.js"; import { Result as SafeParseResult } from "../types/fp.js"; import * as types from "../types/primitives.js"; import { SDKValidationError } from "./errors/sdk-validation-error.js"; export type Agent = { id: number; workspaceId: string; name: string; slug: string; description: string | null; systemPrompt: string; model: string; maxTurns: number; permissionMode: string; allowedTools: Array | null; disallowedTools: Array | null; status: string; isPublic: boolean; metadata: { [k: string]: any } | null; tags: Array | null; createdBy: string | null; createdAt: Date; updatedAt: Date; }; /** @internal */ export const Agent$inboundSchema: z.ZodMiniType = z.object({ id: types.number(), workspaceId: types.string(), name: types.string(), slug: types.string(), description: types.nullable(types.string()), systemPrompt: types.string(), model: types.string(), maxTurns: types.number(), permissionMode: types.string(), allowedTools: types.nullable(z.array(types.string())), disallowedTools: types.nullable(z.array(types.string())), status: types.string(), isPublic: types.boolean(), metadata: types.nullable(z.record(z.string(), z.any())), tags: types.nullable(z.array(types.string())), createdBy: types.nullable(types.string()), createdAt: types.date(), updatedAt: types.date(), }); export function agentFromJSON( jsonString: string, ): SafeParseResult { return safeParse( jsonString, (x) => Agent$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'Agent' from JSON`, ); }