'use strict'; var v4 = require('zod/v4'); // src/server/schemas/workspace.ts var fsPathParams = v4.z.object({ path: v4.z.string().describe("File or directory path (URL encoded)") }); var workspaceIdPathParams = v4.z.object({ workspaceId: v4.z.string().describe("Workspace ID") }); var fsReadQuerySchema = v4.z.object({ path: v4.z.string().describe("Path to the file to read"), encoding: v4.z.string().optional().describe("Encoding for text files (default: utf-8)") }); var fsListQuerySchema = v4.z.object({ path: v4.z.string().describe("Path to the directory to list"), recursive: v4.z.coerce.boolean().optional().describe("Include subdirectories") }); var fsStatQuerySchema = v4.z.object({ path: v4.z.string().describe("Path to get info about") }); var fsDeleteQuerySchema = v4.z.object({ path: v4.z.string().describe("Path to delete"), recursive: v4.z.coerce.boolean().optional().describe("Delete directories recursively"), force: v4.z.coerce.boolean().optional().describe("Don't error if path doesn't exist") }); var fsWriteBodySchema = v4.z.object({ path: v4.z.string().describe("Path to write to"), content: v4.z.string().describe("Content to write (text or base64-encoded binary)"), encoding: v4.z.enum(["utf-8", "base64"]).optional().default("utf-8").describe("Content encoding"), recursive: v4.z.coerce.boolean().optional().describe("Create parent directories if needed") }); var fsMkdirBodySchema = v4.z.object({ path: v4.z.string().describe("Directory path to create"), recursive: v4.z.coerce.boolean().optional().describe("Create parent directories if needed") }); var fileEntrySchema = v4.z.object({ name: v4.z.string(), type: v4.z.enum(["file", "directory"]), size: v4.z.number().optional(), mount: v4.z.object({ provider: v4.z.string(), icon: v4.z.string().optional(), displayName: v4.z.string().optional(), description: v4.z.string().optional(), status: v4.z.enum([ "pending", "initializing", "ready", "starting", "running", "stopping", "stopped", "destroying", "destroyed", "error" ]).optional(), error: v4.z.string().optional() }).optional() }); var fsReadResponseSchema = v4.z.object({ path: v4.z.string(), content: v4.z.string(), type: v4.z.enum(["file", "directory"]), size: v4.z.number().optional(), mimeType: v4.z.string().optional() }); var fsWriteResponseSchema = v4.z.object({ success: v4.z.boolean(), path: v4.z.string() }); var fsListResponseSchema = v4.z.object({ path: v4.z.string(), entries: v4.z.array(fileEntrySchema) }); var fsDeleteResponseSchema = v4.z.object({ success: v4.z.boolean(), path: v4.z.string() }); var fsMkdirResponseSchema = v4.z.object({ success: v4.z.boolean(), path: v4.z.string() }); var fsStatResponseSchema = v4.z.object({ path: v4.z.string(), type: v4.z.enum(["file", "directory"]), size: v4.z.number().optional(), createdAt: v4.z.string().optional(), modifiedAt: v4.z.string().optional(), mimeType: v4.z.string().optional() }); var searchQuerySchema = v4.z.object({ query: v4.z.string().describe("Search query text"), topK: v4.z.coerce.number().optional().default(5).describe("Maximum number of results"), mode: v4.z.enum(["bm25", "vector", "hybrid"]).optional().describe("Search mode"), minScore: v4.z.coerce.number().optional().describe("Minimum relevance score threshold") }); var searchResultSchema = v4.z.object({ id: v4.z.string().describe("Document ID (file path)"), content: v4.z.string(), score: v4.z.number(), lineRange: v4.z.object({ start: v4.z.number(), end: v4.z.number() }).optional(), scoreDetails: v4.z.object({ vector: v4.z.number().optional(), bm25: v4.z.number().optional() }).optional() }); var searchResponseSchema = v4.z.object({ results: v4.z.array(searchResultSchema), query: v4.z.string(), mode: v4.z.enum(["bm25", "vector", "hybrid"]) }); var indexBodySchema = v4.z.object({ path: v4.z.string().describe("Path to use as document ID"), content: v4.z.string().describe("Content to index"), metadata: v4.z.record(v4.z.string(), v4.z.unknown()).optional().describe("Optional metadata") }); var indexResponseSchema = v4.z.object({ success: v4.z.boolean(), path: v4.z.string() }); var mountInfoSchema = v4.z.object({ path: v4.z.string().describe("Mount path"), provider: v4.z.string().describe("Filesystem provider type"), readOnly: v4.z.boolean().describe("Whether the mount is read-only"), displayName: v4.z.string().optional().describe("Human-readable name"), icon: v4.z.string().optional().describe("UI icon identifier"), name: v4.z.string().optional().describe("Filesystem instance name") }); var workspaceInfoResponseSchema = v4.z.object({ isWorkspaceConfigured: v4.z.boolean(), id: v4.z.string().optional(), name: v4.z.string().optional(), status: v4.z.string().optional(), capabilities: v4.z.object({ hasFilesystem: v4.z.boolean(), hasSandbox: v4.z.boolean(), canBM25: v4.z.boolean(), canVector: v4.z.boolean(), canHybrid: v4.z.boolean(), hasSkills: v4.z.boolean() }).optional(), safety: v4.z.object({ readOnly: v4.z.boolean() }).optional(), filesystem: v4.z.object({ id: v4.z.string(), name: v4.z.string(), provider: v4.z.string(), status: v4.z.string().optional(), error: v4.z.string().optional(), readOnly: v4.z.boolean().optional(), icon: v4.z.string().optional(), metadata: v4.z.record(v4.z.string(), v4.z.unknown()).optional() }).optional(), mounts: v4.z.array(mountInfoSchema).optional().describe("Mount points (only present for CompositeFilesystem)") }); var workspaceItemSchema = v4.z.object({ id: v4.z.string(), name: v4.z.string(), status: v4.z.string(), source: v4.z.enum(["mastra", "agent"]), agentId: v4.z.string().optional(), agentName: v4.z.string().optional(), capabilities: v4.z.object({ hasFilesystem: v4.z.boolean(), hasSandbox: v4.z.boolean(), canBM25: v4.z.boolean(), canVector: v4.z.boolean(), canHybrid: v4.z.boolean(), hasSkills: v4.z.boolean() }), safety: v4.z.object({ readOnly: v4.z.boolean() }) }); var listWorkspacesResponseSchema = v4.z.object({ workspaces: v4.z.array(workspaceItemSchema) }); var skillNamePathParams = workspaceIdPathParams.extend({ skillName: v4.z.string().describe("Skill name identifier") }); var skillReferencePathParams = skillNamePathParams.extend({ referencePath: v4.z.string().describe("Reference file path (URL encoded)") }); var skillDisambiguationQuerySchema = v4.z.object({ path: v4.z.string().optional().describe("Skill path for disambiguation when multiple skills share the same name") }); var searchSkillsQuerySchema = v4.z.object({ query: v4.z.string().describe("Search query text"), topK: v4.z.coerce.number().optional().default(5).describe("Maximum number of results"), minScore: v4.z.coerce.number().optional().describe("Minimum relevance score threshold"), skillNames: v4.z.string().optional().describe("Comma-separated list of skill names to search within"), includeReferences: v4.z.coerce.boolean().optional().default(true).describe("Include reference files in search") }); var skillMetadataSchema = v4.z.object({ name: v4.z.string(), description: v4.z.string(), license: v4.z.string().optional(), compatibility: v4.z.unknown().optional(), metadata: v4.z.record(v4.z.string(), v4.z.unknown()).optional(), path: v4.z.string() }); var skillSourceSchema = v4.z.discriminatedUnion("type", [ v4.z.object({ type: v4.z.literal("external"), packagePath: v4.z.string() }), v4.z.object({ type: v4.z.literal("local"), projectPath: v4.z.string() }), v4.z.object({ type: v4.z.literal("managed"), mastraPath: v4.z.string() }) ]); var skillSchema = skillMetadataSchema.extend({ instructions: v4.z.string(), source: skillSourceSchema, references: v4.z.array(v4.z.string()), scripts: v4.z.array(v4.z.string()), assets: v4.z.array(v4.z.string()) }); var skillsShSourceSchema = v4.z.object({ owner: v4.z.string().describe("GitHub owner/org"), repo: v4.z.string().describe("GitHub repository") }); var skillMetadataWithPathSchema = skillMetadataSchema.extend({ /** Source info for skills installed via skills.sh (from .meta.json) */ skillsShSource: skillsShSourceSchema.optional() }); var listSkillsResponseSchema = v4.z.object({ skills: v4.z.array(skillMetadataWithPathSchema), isSkillsConfigured: v4.z.boolean().describe("Whether skills are configured in the workspace") }); var getSkillResponseSchema = skillSchema; var getAgentSkillResponseSchema = skillMetadataSchema.extend({ path: v4.z.string().optional(), instructions: v4.z.string().optional(), source: skillSourceSchema.optional(), references: v4.z.array(v4.z.string()).optional(), scripts: v4.z.array(v4.z.string()).optional(), assets: v4.z.array(v4.z.string()).optional() }); var skillReferenceResponseSchema = v4.z.object({ skillName: v4.z.string(), referencePath: v4.z.string(), content: v4.z.string() }); var listReferencesResponseSchema = v4.z.object({ skillName: v4.z.string(), references: v4.z.array(v4.z.string()) }); var skillSearchResultSchema = v4.z.object({ skillName: v4.z.string(), skillPath: v4.z.string(), source: v4.z.string(), content: v4.z.string(), score: v4.z.number(), lineRange: v4.z.object({ start: v4.z.number(), end: v4.z.number() }).optional(), scoreDetails: v4.z.object({ vector: v4.z.number().optional(), bm25: v4.z.number().optional() }).optional() }); var searchSkillsResponseSchema = v4.z.object({ results: v4.z.array(skillSearchResultSchema), query: v4.z.string() }); var skillsShSearchQuerySchema = v4.z.object({ q: v4.z.string().describe("Search query"), limit: v4.z.coerce.number().optional().default(10).describe("Maximum number of results") }); var skillsShPopularQuerySchema = v4.z.object({ limit: v4.z.coerce.number().optional().default(10).describe("Maximum number of results"), offset: v4.z.coerce.number().optional().default(0).describe("Offset for pagination") }); var skillsShSkillSchema = v4.z.object({ id: v4.z.string(), name: v4.z.string(), installs: v4.z.number(), topSource: v4.z.string() }); var skillsShSearchResponseSchema = v4.z.object({ query: v4.z.string(), searchType: v4.z.string(), skills: v4.z.array(skillsShSkillSchema), count: v4.z.number() }); var skillsShListResponseSchema = v4.z.object({ skills: v4.z.array(skillsShSkillSchema), count: v4.z.number(), limit: v4.z.number(), offset: v4.z.number() }); var skillsShPreviewQuerySchema = v4.z.object({ owner: v4.z.string().describe("GitHub repository owner"), repo: v4.z.string().describe("GitHub repository name"), path: v4.z.string().describe("Path to skill within repo") }); var skillsShPreviewResponseSchema = v4.z.object({ content: v4.z.string() }); var skillsShInstallBodySchema = v4.z.object({ owner: v4.z.string().describe("GitHub repository owner"), repo: v4.z.string().describe("GitHub repository name"), skillName: v4.z.string().describe("Skill name from skills.sh"), mount: v4.z.string().optional().describe("Mount path to install into (for CompositeFilesystem)") }); var skillsShInstallResponseSchema = v4.z.object({ success: v4.z.boolean(), skillName: v4.z.string(), installedPath: v4.z.string(), filesWritten: v4.z.number() }); var skillsShRemoveBodySchema = v4.z.object({ skillName: v4.z.string().describe("Name of the installed skill to remove") }); var skillsShRemoveResponseSchema = v4.z.object({ success: v4.z.boolean(), skillName: v4.z.string(), removedPath: v4.z.string() }); var skillsShUpdateBodySchema = v4.z.object({ skillName: v4.z.string().optional().describe("Specific skill to update, or omit to update all") }); var skillsShUpdateResponseSchema = v4.z.object({ updated: v4.z.array( v4.z.object({ skillName: v4.z.string(), success: v4.z.boolean(), filesWritten: v4.z.number().optional(), error: v4.z.string().optional() }) ) }); exports.fileEntrySchema = fileEntrySchema; exports.fsDeleteQuerySchema = fsDeleteQuerySchema; exports.fsDeleteResponseSchema = fsDeleteResponseSchema; exports.fsListQuerySchema = fsListQuerySchema; exports.fsListResponseSchema = fsListResponseSchema; exports.fsMkdirBodySchema = fsMkdirBodySchema; exports.fsMkdirResponseSchema = fsMkdirResponseSchema; exports.fsPathParams = fsPathParams; exports.fsReadQuerySchema = fsReadQuerySchema; exports.fsReadResponseSchema = fsReadResponseSchema; exports.fsStatQuerySchema = fsStatQuerySchema; exports.fsStatResponseSchema = fsStatResponseSchema; exports.fsWriteBodySchema = fsWriteBodySchema; exports.fsWriteResponseSchema = fsWriteResponseSchema; exports.getAgentSkillResponseSchema = getAgentSkillResponseSchema; exports.getSkillResponseSchema = getSkillResponseSchema; exports.indexBodySchema = indexBodySchema; exports.indexResponseSchema = indexResponseSchema; exports.listReferencesResponseSchema = listReferencesResponseSchema; exports.listSkillsResponseSchema = listSkillsResponseSchema; exports.listWorkspacesResponseSchema = listWorkspacesResponseSchema; exports.mountInfoSchema = mountInfoSchema; exports.searchQuerySchema = searchQuerySchema; exports.searchResponseSchema = searchResponseSchema; exports.searchResultSchema = searchResultSchema; exports.searchSkillsQuerySchema = searchSkillsQuerySchema; exports.searchSkillsResponseSchema = searchSkillsResponseSchema; exports.skillDisambiguationQuerySchema = skillDisambiguationQuerySchema; exports.skillMetadataSchema = skillMetadataSchema; exports.skillMetadataWithPathSchema = skillMetadataWithPathSchema; exports.skillNamePathParams = skillNamePathParams; exports.skillReferencePathParams = skillReferencePathParams; exports.skillReferenceResponseSchema = skillReferenceResponseSchema; exports.skillSchema = skillSchema; exports.skillSearchResultSchema = skillSearchResultSchema; exports.skillSourceSchema = skillSourceSchema; exports.skillsShInstallBodySchema = skillsShInstallBodySchema; exports.skillsShInstallResponseSchema = skillsShInstallResponseSchema; exports.skillsShListResponseSchema = skillsShListResponseSchema; exports.skillsShPopularQuerySchema = skillsShPopularQuerySchema; exports.skillsShPreviewQuerySchema = skillsShPreviewQuerySchema; exports.skillsShPreviewResponseSchema = skillsShPreviewResponseSchema; exports.skillsShRemoveBodySchema = skillsShRemoveBodySchema; exports.skillsShRemoveResponseSchema = skillsShRemoveResponseSchema; exports.skillsShSearchQuerySchema = skillsShSearchQuerySchema; exports.skillsShSearchResponseSchema = skillsShSearchResponseSchema; exports.skillsShSkillSchema = skillsShSkillSchema; exports.skillsShSourceSchema = skillsShSourceSchema; exports.skillsShUpdateBodySchema = skillsShUpdateBodySchema; exports.skillsShUpdateResponseSchema = skillsShUpdateResponseSchema; exports.workspaceIdPathParams = workspaceIdPathParams; exports.workspaceInfoResponseSchema = workspaceInfoResponseSchema; //# sourceMappingURL=chunk-HXICAUTW.cjs.map //# sourceMappingURL=chunk-HXICAUTW.cjs.map