import { z as t } from "zod";
const e = t.enum(["agent", "spec"]), o = t.enum([
  "pending",
  "awaiting_approval",
  "approved",
  "denied",
  "executing",
  "completed",
  "failed"
]), n = t.enum([
  "read",
  "edit",
  "execute",
  "search",
  "delete",
  "move",
  "fetch",
  "think",
  "switch_mode",
  "other"
]), s = t.object({
  name: t.string(),
  description: t.string().optional(),
  content: t.string(),
  uri: t.string().optional()
}), a = t.object({
  type: t.literal("user"),
  content: t.string(),
  contextItems: t.array(s).optional(),
  source: t.enum(["chat", "hook", "api"]).optional(),
  images: t.array(t.object({ data: t.string(), mimeType: t.string() })).optional(),
  documents: t.array(t.object({ data: t.string(), name: t.string(), mimeType: t.string() })).optional()
}), i = t.object({
  type: t.literal("assistant"),
  content: t.string(),
  operationType: t.enum(["Say", "Reasoning", "Print"]).optional(),
  executionId: t.string().optional(),
  subExecutionId: t.string().optional()
}), r = t.object({
  type: t.literal("tool_call"),
  toolCallId: t.string(),
  toolName: t.string(),
  args: t.record(t.unknown()),
  status: o,
  title: t.string().optional(),
  kind: n.optional(),
  executionId: t.string().optional(),
  actionType: t.string().optional(),
  filePath: t.string().optional(),
  preSnapshotId: t.string().optional(),
  postSnapshotId: t.string().optional(),
  subExecutionId: t.string().optional()
}), c = t.object({
  type: t.literal("tool_result"),
  toolCallId: t.string(),
  content: t.string(),
  success: t.boolean(),
  durationMs: t.number().optional(),
  executionId: t.string().optional(),
  metadata: t.record(t.unknown()).optional(),
  subExecutionId: t.string().optional()
}), l = t.object({
  type: t.literal("system"),
  content: t.string()
}), g = t.object({
  type: t.literal("error"),
  message: t.string(),
  code: t.string().optional(),
  details: t.record(t.unknown()).optional()
}), d = t.object({
  type: t.literal("mode_change"),
  fromMode: e,
  toMode: e,
  reason: t.string().optional()
}), p = t.object({
  type: t.literal("session_event"),
  category: t.enum(["session_start", "session_restore", "session_pause", "session_resume"]),
  context: t.record(t.unknown()).optional()
}), m = t.object({
  type: t.literal("sub_agent_start"),
  parentExecutionId: t.string(),
  subSessionId: t.string(),
  subAgentName: t.string(),
  prompt: t.string(),
  explanation: t.string()
}), u = t.object({
  type: t.literal("sub_agent_complete"),
  parentExecutionId: t.string(),
  subSessionId: t.string(),
  response: t.string(),
  status: t.enum(["success", "error", "cancelled"]),
  errorMessage: t.string().optional()
}), S = t.object({
  type: t.literal("sub_agent_progress"),
  parentExecutionId: t.string(),
  subSessionId: t.string(),
  message: t.string()
}), y = t.object({
  type: t.literal("steering_inclusion"),
  documents: t.array(t.string()),
  executionId: t.string().optional(),
  subExecutionId: t.string().optional()
}), h = t.discriminatedUnion("type", [
  a,
  i,
  r,
  c,
  l,
  g,
  d,
  p,
  m,
  u,
  S,
  y
]), b = t.object({
  schemaVersion: t.string(),
  id: t.string(),
  title: t.string(),
  agentMode: e,
  workspacePaths: t.array(t.string()),
  createdAt: t.string(),
  lastModifiedAt: t.string(),
  lastCheckpointId: t.string().optional(),
  parentSessionId: t.string().optional(),
  parentExecutionId: t.string().optional()
}), I = t.object({
  id: t.string(),
  timestamp: t.string(),
  payload: h
}), M = t.object({
  metadata: b,
  messages: t.array(I)
}), j = t.object({
  id: t.string(),
  title: t.string(),
  agentMode: e,
  createdAt: t.string(),
  lastModifiedAt: t.string(),
  workspacePaths: t.array(t.string())
}), P = t.array(j), _ = t.object({ sessions: P }), A = t.object({
  limit: t.number().optional(),
  sortBy: t.enum(["createdAt", "lastModifiedAt"]).optional(),
  sortOrder: t.enum(["asc", "desc"]).optional()
}), E = "0.0.1";
export {
  e as AgentModeSchema,
  i as AssistantMessagePayloadSchema,
  s as ContextItemSchema,
  g as ErrorPayloadSchema,
  A as ListSessionsOptionsSchema,
  _ as ListSessionsResponseSchema,
  h as MessagePayloadSchema,
  d as ModeChangePayloadSchema,
  I as PersistedMessageSchema,
  M as PersistedSessionSchema,
  E as SCHEMA_VERSION,
  p as SessionEventPayloadSchema,
  b as SessionMetadataSchema,
  P as SessionSummariesSchema,
  j as SessionSummarySchema,
  y as SteeringInclusionPayloadSchema,
  u as SubAgentCompletePayloadSchema,
  S as SubAgentProgressPayloadSchema,
  m as SubAgentStartPayloadSchema,
  l as SystemMessagePayloadSchema,
  r as ToolCallPayloadSchema,
  o as ToolCallStatusSchema,
  n as ToolKindSchema,
  c as ToolResultPayloadSchema,
  a as UserMessagePayloadSchema
};
//# sourceMappingURL=index.js.map
