import { defaultOptionsSchema } from './chunk-7XBOJMBD.js';
import { tracingOptionsSchema, coreMessageSchema, messageResponseSchema } from './chunk-HT4LP3BO.js';
import z from 'zod';

var agentIdPathParams = z.object({
  agentId: z.string().describe("Unique identifier for the agent")
});
var toolIdPathParams = z.object({
  toolId: z.string().describe("Unique identifier for the tool")
});
var agentToolPathParams = agentIdPathParams.extend({
  toolId: z.string().describe("Unique identifier for the tool")
});
var agentSkillPathParams = agentIdPathParams.extend({
  skillName: z.string().describe("Name of the skill")
});
var modelConfigIdPathParams = agentIdPathParams.extend({
  modelConfigId: z.string().describe("Unique identifier for the model configuration")
});
var serializedProcessorSchema = z.object({
  id: z.string(),
  name: z.string().optional()
});
var serializedToolSchema = z.object({
  id: z.string(),
  description: z.string().optional(),
  inputSchema: z.string().optional(),
  outputSchema: z.string().optional(),
  requireApproval: z.boolean().optional()
});
var serializedWorkflowSchema = z.object({
  name: z.string(),
  steps: z.record(
    z.string(),
    z.object({
      id: z.string(),
      description: z.string().optional()
    })
  ).optional()
});
var serializedAgentDefinitionSchema = z.object({
  id: z.string(),
  name: z.string()
});
var systemMessageSchema = z.union([
  z.string(),
  z.array(z.string()),
  z.any(),
  // CoreSystemMessage or SystemModelMessage
  z.array(z.any())
]);
var modelConfigSchema = z.object({
  model: z.object({
    modelId: z.string(),
    provider: z.string(),
    modelVersion: z.string()
  })
  // Additional fields from AgentModelManagerConfig can be added here
});
var serializedAgentSchema = z.object({
  name: z.string(),
  description: z.string().optional(),
  instructions: systemMessageSchema.optional(),
  tools: z.record(z.string(), serializedToolSchema),
  agents: z.record(z.string(), serializedAgentDefinitionSchema),
  workflows: z.record(z.string(), serializedWorkflowSchema),
  inputProcessors: z.array(serializedProcessorSchema),
  outputProcessors: z.array(serializedProcessorSchema),
  provider: z.string().optional(),
  modelId: z.string().optional(),
  modelVersion: z.string().optional(),
  modelList: z.array(modelConfigSchema).optional(),
  defaultOptions: defaultOptionsSchema.optional(),
  defaultGenerateOptionsLegacy: z.record(z.string(), z.any()).optional(),
  defaultStreamOptionsLegacy: z.record(z.string(), z.any()).optional()
});
serializedAgentSchema.extend({
  id: z.string()
});
var providerSchema = z.object({
  id: z.string(),
  name: z.string(),
  label: z.string().optional(),
  description: z.string().optional()
});
var providersResponseSchema = z.object({
  providers: z.array(providerSchema)
});
var listAgentsResponseSchema = z.record(z.string(), serializedAgentSchema);
var listToolsResponseSchema = z.record(z.string(), serializedToolSchema);
var agentMemoryOptionSchema = z.object({
  thread: z.union([z.string(), z.object({ id: z.string() }).passthrough()]),
  resource: z.string(),
  options: z.record(z.string(), z.any()).optional(),
  readOnly: z.boolean().optional()
});
var toolChoiceSchema = z.union([
  z.enum(["auto", "none", "required"]),
  z.object({ type: z.literal("tool"), toolName: z.string() })
]);
var agentExecutionBodySchema = z.object({
  // REQUIRED
  messages: z.union([
    z.array(coreMessageSchema),
    // Array of messages
    z.string()
    // Single user message shorthand
  ]),
  // Message Configuration
  instructions: systemMessageSchema.optional(),
  system: systemMessageSchema.optional(),
  context: z.array(coreMessageSchema).optional(),
  // Memory & Persistence
  memory: agentMemoryOptionSchema.optional(),
  runId: z.string().optional(),
  savePerStep: z.boolean().optional(),
  // Request Context (handler-specific field - merged with server's requestContext)
  requestContext: z.record(z.string(), z.any()).optional(),
  // Execution Control
  maxSteps: z.number().optional(),
  stopWhen: z.any().optional(),
  // Model Configuration
  providerOptions: z.object({
    anthropic: z.record(z.string(), z.any()).optional(),
    google: z.record(z.string(), z.any()).optional(),
    openai: z.record(z.string(), z.any()).optional(),
    xai: z.record(z.string(), z.any()).optional()
  }).optional(),
  modelSettings: z.any().optional(),
  // Tool Configuration
  activeTools: z.array(z.string()).optional(),
  toolsets: z.record(z.string(), z.any()).optional(),
  clientTools: z.record(z.string(), z.any()).optional(),
  toolChoice: toolChoiceSchema.optional(),
  requireToolApproval: z.boolean().optional(),
  // Evaluation
  scorers: z.union([
    z.record(z.string(), z.any()),
    z.record(
      z.string(),
      z.object({
        scorer: z.string(),
        sampling: z.any().optional()
      })
    )
  ]).optional(),
  returnScorerData: z.boolean().optional(),
  // Observability
  tracingOptions: tracingOptionsSchema.optional(),
  // Structured Output
  output: z.any().optional(),
  // Zod schema, JSON schema, or structured output object
  structuredOutput: z.object({
    schema: z.object({}).passthrough(),
    model: z.union([z.string(), z.any()]).optional(),
    instructions: z.string().optional(),
    jsonPromptInjection: z.boolean().optional(),
    errorStrategy: z.enum(["strict", "warn", "fallback"]).optional(),
    fallbackValue: z.any().optional()
  }).optional()
}).passthrough();
var agentExecutionLegacyBodySchema = agentExecutionBodySchema.extend({
  resourceId: z.string().optional(),
  resourceid: z.string().optional(),
  // lowercase variant
  threadId: z.string().optional()
});
var executeToolDataBodySchema = z.object({
  data: z.custom((x) => x !== void 0, { message: "data is required" })
});
var executeToolBodySchema = executeToolDataBodySchema.extend({
  requestContext: z.record(z.string(), z.any()).optional()
});
var executeToolContextBodySchema = executeToolDataBodySchema.extend({
  requestContext: z.record(z.string(), z.any()).optional()
});
var voiceSpeakersResponseSchema = z.array(
  z.object({
    voiceId: z.string()
  }).passthrough()
  // Allow provider-specific fields like name, language, etc.
);
var toolCallActionBodySchema = z.object({
  runId: z.string(),
  requestContext: z.record(z.string(), z.any()).optional(),
  toolCallId: z.string(),
  format: z.string().optional()
});
var networkToolCallActionBodySchema = z.object({
  runId: z.string(),
  requestContext: z.record(z.string(), z.any()).optional(),
  format: z.string().optional()
});
var approveToolCallBodySchema = toolCallActionBodySchema;
var declineToolCallBodySchema = toolCallActionBodySchema;
var approveNetworkToolCallBodySchema = networkToolCallActionBodySchema;
var declineNetworkToolCallBodySchema = networkToolCallActionBodySchema;
var toolCallResponseSchema = z.object({
  fullStream: z.any()
  // ReadableStream
});
var updateAgentModelBodySchema = z.object({
  modelId: z.string(),
  provider: z.string()
});
var reorderAgentModelListBodySchema = z.object({
  reorderedModelIds: z.array(z.string())
});
var updateAgentModelInModelListBodySchema = z.object({
  model: z.object({
    modelId: z.string(),
    provider: z.string()
  }).optional(),
  maxRetries: z.number().optional(),
  enabled: z.boolean().optional()
});
var modelManagementResponseSchema = messageResponseSchema;
var generateSpeechBodySchema = z.object({
  text: z.string(),
  speakerId: z.string().optional()
});
var transcribeSpeechBodySchema = z.object({
  audio: z.any(),
  // Buffer
  options: z.record(z.string(), z.any()).optional()
});
var transcribeSpeechResponseSchema = z.object({
  text: z.string()
});
var getListenerResponseSchema = z.any();
var generateResponseSchema = z.any();
var streamResponseSchema = z.any();
var speakResponseSchema = z.any();
var executeToolResponseSchema = z.any();
var enhanceInstructionsBodySchema = z.object({
  instructions: z.string().describe("The current agent instructions to enhance"),
  comment: z.string().describe("User comment describing how to enhance the instructions")
});
var enhanceInstructionsResponseSchema = z.object({
  explanation: z.string().describe("Explanation of the changes made"),
  new_prompt: z.string().describe("The enhanced instructions")
});

export { agentExecutionBodySchema, agentExecutionLegacyBodySchema, agentIdPathParams, agentSkillPathParams, agentToolPathParams, approveNetworkToolCallBodySchema, approveToolCallBodySchema, declineNetworkToolCallBodySchema, declineToolCallBodySchema, enhanceInstructionsBodySchema, enhanceInstructionsResponseSchema, executeToolBodySchema, executeToolContextBodySchema, executeToolResponseSchema, generateResponseSchema, generateSpeechBodySchema, getListenerResponseSchema, listAgentsResponseSchema, listToolsResponseSchema, modelConfigIdPathParams, modelManagementResponseSchema, providersResponseSchema, reorderAgentModelListBodySchema, serializedAgentSchema, serializedToolSchema, speakResponseSchema, streamResponseSchema, toolCallResponseSchema, toolIdPathParams, transcribeSpeechBodySchema, transcribeSpeechResponseSchema, updateAgentModelBodySchema, updateAgentModelInModelListBodySchema, voiceSpeakersResponseSchema };
//# sourceMappingURL=chunk-HXRJMA6T.js.map
//# sourceMappingURL=chunk-HXRJMA6T.js.map