import z from 'zod';

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

export { fsDeleteQuerySchema, fsDeleteResponseSchema, fsListQuerySchema, fsListResponseSchema, fsMkdirBodySchema, fsMkdirResponseSchema, fsReadQuerySchema, fsReadResponseSchema, fsStatQuerySchema, fsStatResponseSchema, fsWriteBodySchema, fsWriteResponseSchema, getAgentSkillResponseSchema, getSkillResponseSchema, indexBodySchema, indexResponseSchema, listReferencesResponseSchema, listSkillsResponseSchema, listWorkspacesResponseSchema, searchQuerySchema, searchResponseSchema, searchSkillsQuerySchema, searchSkillsResponseSchema, skillNamePathParams, skillReferencePathParams, skillReferenceResponseSchema, skillsShInstallBodySchema, skillsShInstallResponseSchema, skillsShListResponseSchema, skillsShPopularQuerySchema, skillsShPreviewQuerySchema, skillsShPreviewResponseSchema, skillsShRemoveBodySchema, skillsShRemoveResponseSchema, skillsShSearchQuerySchema, skillsShSearchResponseSchema, skillsShUpdateBodySchema, skillsShUpdateResponseSchema, workspaceIdPathParams, workspaceInfoResponseSchema };
//# sourceMappingURL=chunk-OBH5ZLNK.js.map
//# sourceMappingURL=chunk-OBH5ZLNK.js.map