'use strict'; var v4 = require('zod/v4'); // src/server/schemas/a2a.ts var a2aAgentIdPathParams = v4.z.object({ agentId: v4.z.string().describe("Unique identifier for the agent") }); var a2aTaskPathParams = a2aAgentIdPathParams.extend({ taskId: v4.z.string().describe("Unique identifier for the task") }); var pushNotificationAuthenticationInfoSchema = v4.z.object({ schemes: v4.z.array(v4.z.string()).describe("Supported authentication schemes - e.g. Basic, Bearer"), credentials: v4.z.string().optional().describe("Optional credentials") }); var pushNotificationConfigSchema = v4.z.object({ url: v4.z.string().describe("URL for sending the push notifications"), id: v4.z.string().optional().describe("Push Notification ID - created by server to support multiple callbacks"), token: v4.z.string().optional().describe("Token unique to this task/session"), authentication: pushNotificationAuthenticationInfoSchema.optional() }); var messageSendConfigurationSchema = v4.z.object({ acceptedOutputModes: v4.z.array(v4.z.string()).optional().describe("Accepted output modalities by the client"), blocking: v4.z.boolean().optional().describe("If the server should treat the client as a blocking request"), historyLength: v4.z.number().optional().describe("Number of recent messages to be retrieved"), pushNotificationConfig: pushNotificationConfigSchema.optional() }); var textPartSchema = v4.z.object({ kind: v4.z.literal("text").describe("Part type - text for TextParts"), text: v4.z.string().describe("Text content"), metadata: v4.z.record(v4.z.string(), v4.z.unknown()).optional().describe("Optional metadata associated with the part") }); var fileWithBytesSchema = v4.z.object({ bytes: v4.z.string().describe("base64 encoded content of the file"), mimeType: v4.z.string().optional().describe("Optional mimeType for the file"), name: v4.z.string().optional().describe("Optional name for the file") }); var fileWithUriSchema = v4.z.object({ uri: v4.z.string().describe("URL for the File content"), mimeType: v4.z.string().optional().describe("Optional mimeType for the file"), name: v4.z.string().optional().describe("Optional name for the file") }); var filePartSchema = v4.z.object({ kind: v4.z.literal("file").describe("Part type - file for FileParts"), file: v4.z.union([fileWithBytesSchema, fileWithUriSchema]).describe("File content either as url or bytes"), metadata: v4.z.record(v4.z.string(), v4.z.unknown()).optional().describe("Optional metadata associated with the part") }); var dataPartSchema = v4.z.object({ kind: v4.z.literal("data").describe("Part type - data for DataParts"), data: v4.z.record(v4.z.string(), v4.z.unknown()).describe("Structured data content"), metadata: v4.z.record(v4.z.string(), v4.z.unknown()).optional().describe("Optional metadata associated with the part") }); var partSchema = v4.z.union([textPartSchema, filePartSchema, dataPartSchema]); var messageSchema = v4.z.object({ kind: v4.z.literal("message").describe("Event type"), messageId: v4.z.string().describe("Identifier created by the message creator"), role: v4.z.enum(["user", "agent"]).describe("Message sender's role"), parts: v4.z.array(partSchema).describe("Message content"), contextId: v4.z.string().optional().describe("The context the message is associated with"), taskId: v4.z.string().optional().describe("Identifier of task the message is related to"), referenceTaskIds: v4.z.array(v4.z.string()).optional().describe("List of tasks referenced as context by this message"), extensions: v4.z.array(v4.z.string()).optional().describe("The URIs of extensions that are present or contributed to this Message"), metadata: v4.z.record(v4.z.string(), v4.z.unknown()).optional().describe("Extension metadata") }); var messageSendParamsSchema = v4.z.object({ message: messageSchema, configuration: messageSendConfigurationSchema.optional(), metadata: v4.z.record(v4.z.string(), v4.z.unknown()).optional().describe("Extension metadata") }); var taskQueryParamsSchema = v4.z.object({ id: v4.z.string().describe("Task id"), historyLength: v4.z.number().optional().describe("Number of recent messages to be retrieved"), metadata: v4.z.record(v4.z.string(), v4.z.unknown()).optional() }); var taskIdParamsSchema = v4.z.object({ id: v4.z.string().describe("Task id"), metadata: v4.z.record(v4.z.string(), v4.z.unknown()).optional() }); var taskResubscribeParamsSchema = taskIdParamsSchema; var setPushNotificationConfigParamsSchema = v4.z.object({ taskId: v4.z.string().describe("Task id"), pushNotificationConfig: pushNotificationConfigSchema }); var getPushNotificationConfigParamsSchema = taskIdParamsSchema.extend({ pushNotificationConfigId: v4.z.string().optional().describe("Push notification config id") }); var listPushNotificationConfigParamsSchema = taskIdParamsSchema; var deletePushNotificationConfigParamsSchema = taskIdParamsSchema.extend({ pushNotificationConfigId: v4.z.string().describe("Push notification config id") }); var messageSendBodySchema = v4.z.object({ message: messageSchema, metadata: v4.z.record(v4.z.string(), v4.z.any()).optional() }); var taskQueryBodySchema = v4.z.object({ id: v4.z.string() }); var requestBaseSchema = { jsonrpc: v4.z.literal("2.0"), id: v4.z.union([v4.z.string(), v4.z.number()]) }; var agentExecutionBodySchema = v4.z.discriminatedUnion("method", [ v4.z.object({ ...requestBaseSchema, method: v4.z.literal("message/send"), params: messageSendParamsSchema }), v4.z.object({ ...requestBaseSchema, method: v4.z.literal("message/stream"), params: messageSendParamsSchema }), v4.z.object({ ...requestBaseSchema, method: v4.z.literal("tasks/get"), params: taskQueryParamsSchema }), v4.z.object({ ...requestBaseSchema, method: v4.z.literal("tasks/cancel"), params: taskIdParamsSchema }), v4.z.object({ ...requestBaseSchema, method: v4.z.literal("tasks/resubscribe"), params: taskResubscribeParamsSchema }), v4.z.object({ ...requestBaseSchema, method: v4.z.literal("tasks/pushNotificationConfig/set"), params: setPushNotificationConfigParamsSchema }), v4.z.object({ ...requestBaseSchema, method: v4.z.literal("tasks/pushNotificationConfig/get"), params: getPushNotificationConfigParamsSchema }), v4.z.object({ ...requestBaseSchema, method: v4.z.literal("tasks/pushNotificationConfig/list"), params: listPushNotificationConfigParamsSchema }), v4.z.object({ ...requestBaseSchema, method: v4.z.literal("tasks/pushNotificationConfig/delete"), params: deletePushNotificationConfigParamsSchema }), v4.z.object({ ...requestBaseSchema, method: v4.z.literal("agent/getAuthenticatedExtendedCard") }) ]); var agentCardResponseSchema = v4.z.object({ additionalInterfaces: v4.z.array(v4.z.unknown()).optional(), name: v4.z.string(), description: v4.z.string(), url: v4.z.string(), protocolVersion: v4.z.string(), provider: v4.z.object({ organization: v4.z.string(), url: v4.z.string() }).optional(), security: v4.z.array(v4.z.record(v4.z.string(), v4.z.array(v4.z.string()))).optional(), securitySchemes: v4.z.record(v4.z.string(), v4.z.unknown()).optional(), version: v4.z.string(), capabilities: v4.z.object({ extensions: v4.z.array(v4.z.unknown()).optional(), streaming: v4.z.boolean().optional(), pushNotifications: v4.z.boolean().optional(), stateTransitionHistory: v4.z.boolean().optional() }), defaultInputModes: v4.z.array(v4.z.string()), defaultOutputModes: v4.z.array(v4.z.string()), supportsAuthenticatedExtendedCard: v4.z.boolean().optional(), signatures: v4.z.array( v4.z.object({ protected: v4.z.string(), signature: v4.z.string(), header: v4.z.record(v4.z.string(), v4.z.unknown()).optional() }) ).optional(), skills: v4.z.array( v4.z.object({ id: v4.z.string(), name: v4.z.string(), description: v4.z.string(), tags: v4.z.array(v4.z.string()).optional() }) ) }); var taskResponseSchema = v4.z.unknown(); var agentExecutionResponseSchema = v4.z.unknown(); exports.a2aAgentIdPathParams = a2aAgentIdPathParams; exports.a2aTaskPathParams = a2aTaskPathParams; exports.agentCardResponseSchema = agentCardResponseSchema; exports.agentExecutionBodySchema = agentExecutionBodySchema; exports.agentExecutionResponseSchema = agentExecutionResponseSchema; exports.messageSendBodySchema = messageSendBodySchema; exports.taskQueryBodySchema = taskQueryBodySchema; exports.taskResponseSchema = taskResponseSchema; //# sourceMappingURL=chunk-CXAJPAJ2.cjs.map //# sourceMappingURL=chunk-CXAJPAJ2.cjs.map