import { fileURLToPath as __fileURLToPath } from 'url';
import { dirname as __pathDirname } from 'path';
const __filename = __fileURLToPath(import.meta.url);
const __dirname = __pathDirname(__filename);
import { z } from "zod";
const GetContextSchema = z.object({
  query: z.string().min(1).max(5e3).optional(),
  limit: z.number().int().min(1).max(100).default(10)
});
const AddDecisionSchema = z.object({
  content: z.string().min(1).max(1e4),
  type: z.enum(["decision", "constraint", "learning"])
});
const StartFrameSchema = z.object({
  name: z.string().min(1).max(500),
  type: z.enum(["task", "subtask", "tool_scope", "review", "write", "debug"]),
  constraints: z.array(z.string().max(1e3)).optional()
});
const CloseFrameSchema = z.object({
  result: z.string().max(1e4).optional(),
  outputs: z.record(z.unknown()).optional()
});
const AddAnchorSchema = z.object({
  type: z.enum([
    "FACT",
    "DECISION",
    "CONSTRAINT",
    "INTERFACE_CONTRACT",
    "TODO",
    "RISK"
  ]),
  text: z.string().min(1).max(1e4),
  priority: z.number().int().min(0).max(10).default(5)
});
const GetHotStackSchema = z.object({
  maxDepth: z.number().int().min(1).max(50).default(10)
});
const CreateTaskSchema = z.object({
  title: z.string().min(1).max(500),
  description: z.string().max(1e4).optional(),
  priority: z.enum(["low", "medium", "high", "critical"]).default("medium"),
  tags: z.array(z.string().max(100)).optional(),
  parentId: z.string().uuid().optional()
});
const UpdateTaskStatusSchema = z.object({
  taskId: z.string().min(1),
  status: z.enum(["pending", "in_progress", "completed", "blocked"]),
  note: z.string().max(5e3).optional()
});
const GetActiveTasksSchema = z.object({
  status: z.enum(["pending", "in_progress", "blocked"]).optional(),
  limit: z.number().int().min(1).max(100).default(50)
});
const AddTaskDependencySchema = z.object({
  taskId: z.string().min(1),
  dependsOn: z.string().min(1)
});
const LinearSyncSchema = z.object({
  direction: z.enum(["to_linear", "from_linear", "bidirectional"]).optional(),
  force: z.boolean().default(false)
});
const LinearUpdateTaskSchema = z.object({
  taskId: z.string().min(1),
  updates: z.object({
    title: z.string().min(1).max(500).optional(),
    description: z.string().max(1e4).optional(),
    status: z.string().optional(),
    priority: z.number().int().min(0).max(4).optional()
  })
});
const LinearGetTasksSchema = z.object({
  status: z.string().optional(),
  limit: z.number().int().min(1).max(100).default(50)
});
const GetTracesSchema = z.object({
  sessionId: z.string().optional(),
  limit: z.number().int().min(1).max(1e3).default(100),
  since: z.string().datetime().optional()
});
const CompressOldTracesSchema = z.object({
  olderThanDays: z.number().int().min(1).max(365).default(7)
});
const SmartContextSchema = z.object({
  query: z.string().min(1).max(5e3),
  maxResults: z.number().int().min(1).max(50).default(10),
  includeRelated: z.boolean().default(true)
});
const GetSummarySchema = z.object({
  timeRange: z.object({
    start: z.string().datetime(),
    end: z.string().datetime()
  }).optional(),
  includeMetrics: z.boolean().default(true)
});
const DiscoverSchema = z.object({
  pattern: z.string().max(500).optional(),
  maxDepth: z.number().int().min(1).max(20).default(5)
});
const RelatedFilesSchema = z.object({
  filePath: z.string().min(1).max(1e3),
  limit: z.number().int().min(1).max(50).default(10)
});
const SearchSchema = z.object({
  query: z.string().min(1).max(1e3),
  type: z.enum(["code", "context", "task", "all"]).default("all"),
  limit: z.number().int().min(1).max(100).default(20)
});
import { ValidationError, ErrorCode } from "../../core/errors/index.js";
function validateInput(schema, input, toolName) {
  const result = schema.safeParse(input);
  if (!result.success) {
    const errors = result.error.errors.map((e) => ({
      path: e.path.join("."),
      message: e.message
    }));
    throw new ValidationError(
      `Invalid input for tool '${toolName}': ${errors.map((e) => e.message).join(", ")}`,
      ErrorCode.VALIDATION_FAILED,
      { toolName, errors }
    );
  }
  return result.data;
}
export {
  AddAnchorSchema,
  AddDecisionSchema,
  AddTaskDependencySchema,
  CloseFrameSchema,
  CompressOldTracesSchema,
  CreateTaskSchema,
  DiscoverSchema,
  GetActiveTasksSchema,
  GetContextSchema,
  GetHotStackSchema,
  GetSummarySchema,
  GetTracesSchema,
  LinearGetTasksSchema,
  LinearSyncSchema,
  LinearUpdateTaskSchema,
  RelatedFilesSchema,
  SearchSchema,
  SmartContextSchema,
  StartFrameSchema,
  UpdateTaskStatusSchema,
  validateInput
};
//# sourceMappingURL=schemas.js.map
