/* * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. * @generated-id: 85a13b850b1a */ import * as z from "zod/v4"; import { safeParse } from "../lib/schemas.js"; import { ClosedEnum } from "../types/enums.js"; import { Result as SafeParseResult } from "../types/fp.js"; import { SDKValidationError } from "./errors/sdkvalidationerror.js"; /** * Workspace-level policy for ai-agent debug commands. `auto` runs `alien_debug` tool calls without asking; `ask` halts each session before every debug command and waits for a human approval from dashboard or Slack. */ export const AgentSettingsDebugPermissionMode = { Auto: "auto", Ask: "ask", } as const; /** * Workspace-level policy for ai-agent debug commands. `auto` runs `alien_debug` tool calls without asking; `ask` halts each session before every debug command and waits for a human approval from dashboard or Slack. */ export type AgentSettingsDebugPermissionMode = ClosedEnum< typeof AgentSettingsDebugPermissionMode >; export type AgentSettings = { /** * Unique identifier for the workspace. */ workspaceId: string; /** * Workspace on/off switch for the ai-agent. When `false`, incoming triggers (release/deployment monitoring and Slack-invoked sessions) are rejected before any session runs. Defaults to `true`. */ enabled: boolean; /** * Workspace-level policy for ai-agent debug commands. `auto` runs `alien_debug` tool calls without asking; `ask` halts each session before every debug command and waits for a human approval from dashboard or Slack. */ debugPermissionMode: AgentSettingsDebugPermissionMode; createdAt: Date; updatedAt: Date; }; /** @internal */ export const AgentSettingsDebugPermissionMode$inboundSchema: z.ZodEnum< typeof AgentSettingsDebugPermissionMode > = z.enum(AgentSettingsDebugPermissionMode); /** @internal */ export const AgentSettings$inboundSchema: z.ZodType = z .object({ workspaceId: z.string(), enabled: z.boolean(), debugPermissionMode: AgentSettingsDebugPermissionMode$inboundSchema, createdAt: z.iso.datetime({ offset: true }).transform(v => new Date(v)), updatedAt: z.iso.datetime({ offset: true }).transform(v => new Date(v)), }); export function agentSettingsFromJSON( jsonString: string, ): SafeParseResult { return safeParse( jsonString, (x) => AgentSettings$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'AgentSettings' from JSON`, ); }