import { createRequire as __kanban_createRequire } from "node:module";
const require = __kanban_createRequire(import.meta.url);

// src/core/api-contract.ts
import { z } from "zod";
var runtimeWorkspaceFileStatusSchema = z.enum([
  "modified",
  "added",
  "deleted",
  "renamed",
  "copied",
  "untracked",
  "unknown"
]);
var runtimeWorkspaceFileChangeSchema = z.object({
  path: z.string(),
  previousPath: z.string().optional(),
  status: runtimeWorkspaceFileStatusSchema,
  additions: z.number(),
  deletions: z.number(),
  oldText: z.string().nullable(),
  newText: z.string().nullable()
});
var runtimeWorkspaceChangesRequestSchema = z.object({
  taskId: z.string(),
  baseRef: z.string(),
  mode: z.enum(["working_copy", "last_turn"]).optional()
});
var runtimeWorkspaceChangesModeSchema = z.enum(["working_copy", "last_turn"]);
var runtimeWorkspaceChangesResponseSchema = z.object({
  repoRoot: z.string(),
  generatedAt: z.number(),
  files: z.array(runtimeWorkspaceFileChangeSchema)
});
var runtimeWorkspaceFileSearchRequestSchema = z.object({
  query: z.string(),
  limit: z.number().int().positive().optional()
});
var runtimeWorkspaceFileSearchMatchSchema = z.object({
  path: z.string(),
  name: z.string(),
  changed: z.boolean()
});
var runtimeWorkspaceFileSearchResponseSchema = z.object({
  query: z.string(),
  files: z.array(runtimeWorkspaceFileSearchMatchSchema)
});
var runtimeSlashCommandSchema = z.object({
  name: z.string(),
  instructions: z.string(),
  description: z.string().optional()
});
var runtimeSlashCommandsResponseSchema = z.object({
  commands: z.array(runtimeSlashCommandSchema)
});
var runtimeAgentIdSchema = z.enum(["claude", "codex", "gemini", "opencode", "droid", "cline"]);
var runtimeBoardColumnIdSchema = z.enum(["backlog", "in_progress", "review", "trash"]);
var runtimeTaskAutoReviewModeSchema = z.enum(["commit", "pr", "move_to_trash"]);
var runtimeTaskImageSchema = z.object({
  id: z.string(),
  data: z.string(),
  mimeType: z.string(),
  name: z.string().optional()
});
var runtimeBoardCardSchema = z.object({
  id: z.string(),
  prompt: z.string(),
  startInPlanMode: z.boolean(),
  autoReviewEnabled: z.boolean().optional(),
  autoReviewMode: runtimeTaskAutoReviewModeSchema.optional(),
  images: z.array(runtimeTaskImageSchema).optional(),
  baseRef: z.string(),
  createdAt: z.number(),
  updatedAt: z.number()
});
var runtimeBoardColumnSchema = z.object({
  id: runtimeBoardColumnIdSchema,
  title: z.string(),
  cards: z.array(runtimeBoardCardSchema)
});
var runtimeBoardDependencySchema = z.object({
  id: z.string(),
  fromTaskId: z.string(),
  toTaskId: z.string(),
  createdAt: z.number()
});
var runtimeBoardDataSchema = z.object({
  columns: z.array(runtimeBoardColumnSchema),
  dependencies: z.array(runtimeBoardDependencySchema).default([])
});
var runtimeGitRepositoryInfoSchema = z.object({
  currentBranch: z.string().nullable(),
  defaultBranch: z.string().nullable(),
  branches: z.array(z.string())
});
var runtimeGitSyncActionSchema = z.enum(["fetch", "pull", "push"]);
var runtimeGitSyncSummarySchema = z.object({
  currentBranch: z.string().nullable(),
  upstreamBranch: z.string().nullable(),
  changedFiles: z.number(),
  additions: z.number(),
  deletions: z.number(),
  aheadCount: z.number(),
  behindCount: z.number()
});
var runtimeGitSummaryResponseSchema = z.object({
  ok: z.boolean(),
  summary: runtimeGitSyncSummarySchema,
  error: z.string().optional()
});
var runtimeGitSyncResponseSchema = z.object({
  ok: z.boolean(),
  action: runtimeGitSyncActionSchema,
  summary: runtimeGitSyncSummarySchema,
  output: z.string(),
  error: z.string().optional()
});
var runtimeGitCheckoutRequestSchema = z.object({
  branch: z.string()
});
var runtimeGitCheckoutResponseSchema = z.object({
  ok: z.boolean(),
  branch: z.string(),
  summary: runtimeGitSyncSummarySchema,
  output: z.string(),
  error: z.string().optional()
});
var runtimeGitDiscardResponseSchema = z.object({
  ok: z.boolean(),
  summary: runtimeGitSyncSummarySchema,
  output: z.string(),
  error: z.string().optional()
});
var runtimeTaskSessionStateSchema = z.enum(["idle", "running", "awaiting_review", "failed", "interrupted"]);
var runtimeTaskSessionModeSchema = z.enum(["act", "plan"]);
var runtimeTaskSessionReviewReasonSchema = z.enum(["attention", "exit", "error", "interrupted", "hook"]).nullable();
var runtimeTaskHookActivitySchema = z.object({
  activityText: z.string().nullable().default(null),
  toolName: z.string().nullable().default(null),
  toolInputSummary: z.string().nullable().default(null),
  finalMessage: z.string().nullable().default(null),
  hookEventName: z.string().nullable().default(null),
  notificationType: z.string().nullable().default(null),
  source: z.string().nullable().default(null)
});
var runtimeTaskTurnCheckpointSchema = z.object({
  turn: z.number().int().positive(),
  ref: z.string(),
  commit: z.string(),
  createdAt: z.number()
});
var runtimeTaskSessionSummarySchema = z.object({
  taskId: z.string(),
  state: runtimeTaskSessionStateSchema,
  mode: runtimeTaskSessionModeSchema.nullable().optional(),
  agentId: runtimeAgentIdSchema.nullable(),
  workspacePath: z.string().nullable(),
  pid: z.number().nullable(),
  startedAt: z.number().nullable(),
  updatedAt: z.number(),
  lastOutputAt: z.number().nullable(),
  reviewReason: runtimeTaskSessionReviewReasonSchema,
  exitCode: z.number().nullable(),
  lastHookAt: z.number().nullable().default(null),
  latestHookActivity: runtimeTaskHookActivitySchema.nullable().default(null),
  warningMessage: z.string().nullable().optional(),
  latestTurnCheckpoint: runtimeTaskTurnCheckpointSchema.nullable().optional(),
  previousTurnCheckpoint: runtimeTaskTurnCheckpointSchema.nullable().optional()
});
var runtimeWorkspaceStateResponseSchema = z.object({
  repoPath: z.string(),
  statePath: z.string(),
  git: runtimeGitRepositoryInfoSchema,
  board: runtimeBoardDataSchema,
  sessions: z.record(z.string(), runtimeTaskSessionSummarySchema),
  revision: z.number()
});
var runtimeWorkspaceStateSaveRequestSchema = z.object({
  board: runtimeBoardDataSchema,
  sessions: z.record(z.string(), runtimeTaskSessionSummarySchema),
  expectedRevision: z.number().int().nonnegative().optional()
});
var runtimeWorkspaceStateConflictResponseSchema = z.object({
  error: z.string(),
  currentRevision: z.number()
});
var runtimeWorkspaceStateNotifyResponseSchema = z.object({
  ok: z.boolean()
});
var runtimeProjectTaskCountsSchema = z.object({
  backlog: z.number(),
  in_progress: z.number(),
  review: z.number(),
  trash: z.number()
});
var runtimeProjectSummarySchema = z.object({
  id: z.string(),
  path: z.string(),
  name: z.string(),
  taskCounts: runtimeProjectTaskCountsSchema
});
var runtimeTaskWorkspaceMetadataSchema = z.object({
  taskId: z.string(),
  path: z.string(),
  exists: z.boolean(),
  baseRef: z.string(),
  branch: z.string().nullable(),
  isDetached: z.boolean(),
  headCommit: z.string().nullable(),
  changedFiles: z.number().nullable(),
  additions: z.number().nullable(),
  deletions: z.number().nullable(),
  stateVersion: z.number().int().nonnegative()
});
var runtimeWorkspaceMetadataSchema = z.object({
  homeGitSummary: runtimeGitSyncSummarySchema.nullable(),
  homeGitStateVersion: z.number().int().nonnegative(),
  taskWorkspaces: z.array(runtimeTaskWorkspaceMetadataSchema)
});
var runtimeClineMcpServerAuthStatusSchema = z.object({
  serverName: z.string(),
  oauthSupported: z.boolean(),
  oauthConfigured: z.boolean(),
  lastError: z.string().nullable(),
  lastAuthenticatedAt: z.number().nullable()
});
var runtimeStateStreamSnapshotMessageSchema = z.object({
  type: z.literal("snapshot"),
  currentProjectId: z.string().nullable(),
  projects: z.array(runtimeProjectSummarySchema),
  workspaceState: runtimeWorkspaceStateResponseSchema.nullable(),
  workspaceMetadata: runtimeWorkspaceMetadataSchema.nullable(),
  clineSessionContextVersion: z.number().int().nonnegative()
});
var runtimeStateStreamWorkspaceStateMessageSchema = z.object({
  type: z.literal("workspace_state_updated"),
  workspaceId: z.string(),
  workspaceState: runtimeWorkspaceStateResponseSchema
});
var runtimeStateStreamTaskSessionsMessageSchema = z.object({
  type: z.literal("task_sessions_updated"),
  workspaceId: z.string(),
  summaries: z.array(runtimeTaskSessionSummarySchema)
});
var runtimeStateStreamProjectsMessageSchema = z.object({
  type: z.literal("projects_updated"),
  currentProjectId: z.string().nullable(),
  projects: z.array(runtimeProjectSummarySchema)
});
var runtimeStateStreamWorkspaceMetadataMessageSchema = z.object({
  type: z.literal("workspace_metadata_updated"),
  workspaceId: z.string(),
  workspaceMetadata: runtimeWorkspaceMetadataSchema
});
var runtimeStateStreamTaskReadyForReviewMessageSchema = z.object({
  type: z.literal("task_ready_for_review"),
  workspaceId: z.string(),
  taskId: z.string(),
  triggeredAt: z.number()
});
var runtimeStateStreamTaskChatMessageSchema = z.object({
  type: z.literal("task_chat_message"),
  workspaceId: z.string(),
  taskId: z.string(),
  message: z.lazy(() => runtimeTaskChatMessageSchema)
});
var runtimeStateStreamMcpAuthUpdatedMessageSchema = z.object({
  type: z.literal("mcp_auth_updated"),
  statuses: z.array(runtimeClineMcpServerAuthStatusSchema)
});
var runtimeStateStreamClineSessionContextUpdatedMessageSchema = z.object({
  type: z.literal("cline_session_context_updated"),
  version: z.number().int().nonnegative()
});
var runtimeStateStreamErrorMessageSchema = z.object({
  type: z.literal("error"),
  message: z.string()
});
var runtimeStateStreamMessageSchema = z.discriminatedUnion("type", [
  runtimeStateStreamSnapshotMessageSchema,
  runtimeStateStreamWorkspaceStateMessageSchema,
  runtimeStateStreamTaskSessionsMessageSchema,
  runtimeStateStreamProjectsMessageSchema,
  runtimeStateStreamWorkspaceMetadataMessageSchema,
  runtimeStateStreamTaskReadyForReviewMessageSchema,
  runtimeStateStreamTaskChatMessageSchema,
  runtimeStateStreamMcpAuthUpdatedMessageSchema,
  runtimeStateStreamClineSessionContextUpdatedMessageSchema,
  runtimeStateStreamErrorMessageSchema
]);
var runtimeProjectsResponseSchema = z.object({
  currentProjectId: z.string().nullable(),
  projects: z.array(runtimeProjectSummarySchema)
});
var runtimeProjectAddRequestSchema = z.object({
  path: z.string(),
  initializeGit: z.boolean().optional()
});
var runtimeProjectAddResponseSchema = z.object({
  ok: z.boolean(),
  project: runtimeProjectSummarySchema.nullable(),
  requiresGitInitialization: z.boolean().optional(),
  error: z.string().optional()
});
var runtimeProjectDirectoryPickerResponseSchema = z.object({
  ok: z.boolean(),
  path: z.string().nullable(),
  error: z.string().optional()
});
var runtimeProjectRemoveRequestSchema = z.object({
  projectId: z.string()
});
var runtimeProjectRemoveResponseSchema = z.object({
  ok: z.boolean(),
  error: z.string().optional()
});
var runtimeWorktreeEnsureRequestSchema = z.object({
  taskId: z.string(),
  baseRef: z.string()
});
var runtimeWorktreeEnsureResponseSchema = z.union([
  z.object({
    ok: z.literal(true),
    path: z.string(),
    baseRef: z.string(),
    baseCommit: z.string(),
    warning: z.string().optional(),
    error: z.string().optional()
  }),
  z.object({
    ok: z.literal(false),
    path: z.null(),
    baseRef: z.string(),
    baseCommit: z.null(),
    error: z.string().optional()
  })
]);
var runtimeWorktreeDeleteRequestSchema = z.object({
  taskId: z.string()
});
var runtimeWorktreeDeleteResponseSchema = z.object({
  ok: z.boolean(),
  removed: z.boolean(),
  error: z.string().optional()
});
var runtimeTaskWorkspaceInfoRequestSchema = z.object({
  taskId: z.string(),
  baseRef: z.string()
});
var runtimeTaskWorkspaceInfoResponseSchema = z.object({
  taskId: z.string(),
  path: z.string(),
  exists: z.boolean(),
  baseRef: z.string(),
  branch: z.string().nullable(),
  isDetached: z.boolean(),
  headCommit: z.string().nullable()
});
var runtimeProjectShortcutSchema = z.object({
  label: z.string(),
  command: z.string(),
  icon: z.string().optional()
});
var runtimeClineOauthProviderSchema = z.enum(["cline", "oca", "openai-codex"]);
var runtimeClineReasoningEffortSchema = z.enum(["low", "medium", "high", "xhigh"]);
var runtimeClineProviderSettingsSchema = z.object({
  providerId: z.string().nullable(),
  modelId: z.string().nullable(),
  baseUrl: z.string().nullable(),
  reasoningEffort: runtimeClineReasoningEffortSchema.nullable().optional(),
  apiKeyConfigured: z.boolean(),
  oauthProvider: runtimeClineOauthProviderSchema.nullable(),
  oauthAccessTokenConfigured: z.boolean(),
  oauthRefreshTokenConfigured: z.boolean(),
  oauthAccountId: z.string().nullable(),
  oauthExpiresAt: z.number().int().positive().nullable()
});
var runtimeClineAccountProfileSchema = z.object({
  accountId: z.string().nullable(),
  email: z.string().nullable(),
  displayName: z.string().nullable()
});
var runtimeClineAccountProfileResponseSchema = z.object({
  profile: runtimeClineAccountProfileSchema.nullable(),
  error: z.string().optional()
});
var runtimeClineKanbanAccessResponseSchema = z.object({
  enabled: z.boolean(),
  error: z.string().optional()
});
var runtimeClineProviderCatalogItemSchema = z.object({
  id: z.string(),
  name: z.string(),
  oauthSupported: z.boolean(),
  enabled: z.boolean(),
  defaultModelId: z.string().nullable()
});
var runtimeClineProviderCatalogResponseSchema = z.object({
  providers: z.array(runtimeClineProviderCatalogItemSchema)
});
var runtimeClineProviderModelsRequestSchema = z.object({
  providerId: z.string()
});
var runtimeClineProviderModelSchema = z.object({
  id: z.string(),
  name: z.string(),
  supportsVision: z.boolean().optional(),
  supportsAttachments: z.boolean().optional(),
  supportsReasoningEffort: z.boolean().optional()
});
var runtimeClineProviderModelsResponseSchema = z.object({
  providerId: z.string(),
  models: z.array(runtimeClineProviderModelSchema)
});
var runtimeClineOauthLoginRequestSchema = z.object({
  provider: runtimeClineOauthProviderSchema,
  baseUrl: z.string().nullable().optional()
});
var runtimeClineOauthLoginResponseSchema = z.object({
  ok: z.boolean(),
  provider: runtimeClineOauthProviderSchema,
  settings: runtimeClineProviderSettingsSchema.optional(),
  error: z.string().optional()
});
var runtimeClineProviderSettingsSaveRequestSchema = z.object({
  providerId: z.string(),
  modelId: z.string().nullable().optional(),
  apiKey: z.string().nullable().optional(),
  baseUrl: z.string().nullable().optional(),
  reasoningEffort: runtimeClineReasoningEffortSchema.nullable().optional()
});
var runtimeClineProviderSettingsSaveResponseSchema = runtimeClineProviderSettingsSchema;
var runtimeClineMcpServerBaseSchema = z.object({
  name: z.string(),
  disabled: z.boolean()
});
var runtimeClineMcpServerSchema = z.discriminatedUnion("type", [
  runtimeClineMcpServerBaseSchema.extend({
    type: z.literal("stdio"),
    command: z.string(),
    args: z.array(z.string()).optional(),
    cwd: z.string().optional(),
    env: z.record(z.string(), z.string()).optional()
  }),
  runtimeClineMcpServerBaseSchema.extend({
    type: z.literal("sse"),
    url: z.string().url(),
    headers: z.record(z.string(), z.string()).optional()
  }),
  runtimeClineMcpServerBaseSchema.extend({
    type: z.literal("streamableHttp"),
    url: z.string().url(),
    headers: z.record(z.string(), z.string()).optional()
  })
]);
var runtimeClineMcpSettingsResponseSchema = z.object({
  path: z.string(),
  servers: z.array(runtimeClineMcpServerSchema)
});
var runtimeClineMcpSettingsSaveRequestSchema = z.object({
  servers: z.array(runtimeClineMcpServerSchema)
});
var runtimeClineMcpSettingsSaveResponseSchema = runtimeClineMcpSettingsResponseSchema;
var runtimeClineMcpAuthStatusResponseSchema = z.object({
  statuses: z.array(runtimeClineMcpServerAuthStatusSchema)
});
var runtimeClineMcpOAuthRequestSchema = z.object({
  serverName: z.string()
});
var runtimeClineMcpOAuthResponseSchema = z.object({
  serverName: z.string(),
  authorized: z.literal(true),
  message: z.string()
});
var runtimeCommandRunRequestSchema = z.object({
  command: z.string()
});
var runtimeCommandRunResponseSchema = z.object({
  exitCode: z.number(),
  stdout: z.string(),
  stderr: z.string(),
  combinedOutput: z.string(),
  durationMs: z.number()
});
var runtimeOpenFileRequestSchema = z.object({
  filePath: z.string()
});
var runtimeOpenFileResponseSchema = z.object({
  ok: z.boolean()
});
var runtimeDebugResetAllStateResponseSchema = z.object({
  ok: z.boolean(),
  clearedPaths: z.array(z.string())
});
var runtimeAgentDefinitionSchema = z.object({
  id: runtimeAgentIdSchema,
  label: z.string(),
  binary: z.string(),
  command: z.string(),
  defaultArgs: z.array(z.string()),
  installed: z.boolean(),
  configured: z.boolean()
});
var runtimeConfigResponseSchema = z.object({
  selectedAgentId: runtimeAgentIdSchema,
  selectedShortcutLabel: z.string().nullable(),
  agentAutonomousModeEnabled: z.boolean(),
  debugModeEnabled: z.boolean().optional(),
  effectiveCommand: z.string().nullable(),
  globalConfigPath: z.string(),
  projectConfigPath: z.string().nullable(),
  readyForReviewNotificationsEnabled: z.boolean(),
  detectedCommands: z.array(z.string()),
  agents: z.array(runtimeAgentDefinitionSchema),
  shortcuts: z.array(runtimeProjectShortcutSchema),
  clineProviderSettings: runtimeClineProviderSettingsSchema,
  commitPromptTemplate: z.string(),
  openPrPromptTemplate: z.string(),
  commitPromptTemplateDefault: z.string(),
  openPrPromptTemplateDefault: z.string(),
  fabricPortalUrl: z.string().nullable(),
  fabricApiKey: z.string().nullable(),
  fabricMcpEnabled: z.boolean()
});
var runtimeConfigSaveRequestSchema = z.object({
  selectedAgentId: runtimeAgentIdSchema.optional(),
  selectedShortcutLabel: z.string().nullable().optional(),
  agentAutonomousModeEnabled: z.boolean().optional(),
  shortcuts: z.array(runtimeProjectShortcutSchema).optional(),
  readyForReviewNotificationsEnabled: z.boolean().optional(),
  commitPromptTemplate: z.string().optional(),
  openPrPromptTemplate: z.string().optional(),
  fabricPortalUrl: z.string().nullable().optional(),
  fabricApiKey: z.string().nullable().optional(),
  fabricMcpEnabled: z.boolean().optional()
});
var runtimePullFromFabricResponseSchema = z.object({
  pulled: z.number(),
  tasks: z.array(
    z.object({
      id: z.string(),
      prompt: z.string(),
      storyIdentifier: z.string()
    })
  ),
  error: z.string().optional()
});
var runtimeTaskSessionStartRequestSchema = z.object({
  taskId: z.string(),
  prompt: z.string(),
  images: z.array(runtimeTaskImageSchema).optional(),
  startInPlanMode: z.boolean().optional(),
  mode: runtimeTaskSessionModeSchema.optional(),
  resumeFromTrash: z.boolean().optional(),
  baseRef: z.string(),
  cols: z.number().int().positive().optional(),
  rows: z.number().int().positive().optional()
});
var runtimeTaskSessionStartResponseSchema = z.object({
  ok: z.boolean(),
  summary: runtimeTaskSessionSummarySchema.nullable(),
  error: z.string().optional()
});
var runtimeTaskSessionStopRequestSchema = z.object({
  taskId: z.string()
});
var runtimeTaskSessionStopResponseSchema = z.object({
  ok: z.boolean(),
  summary: runtimeTaskSessionSummarySchema.nullable(),
  error: z.string().optional()
});
var runtimeTaskSessionInputRequestSchema = z.object({
  taskId: z.string(),
  text: z.string(),
  appendNewline: z.boolean().optional()
});
var runtimeTaskSessionInputResponseSchema = z.object({
  ok: z.boolean(),
  summary: runtimeTaskSessionSummarySchema.nullable(),
  error: z.string().optional()
});
var runtimeTaskChatMessageSchema = z.object({
  id: z.string(),
  role: z.enum(["user", "assistant", "system", "tool", "reasoning", "status"]),
  content: z.string(),
  images: z.array(runtimeTaskImageSchema).optional(),
  createdAt: z.number(),
  meta: z.object({
    toolName: z.string().nullable().optional(),
    hookEventName: z.string().nullable().optional(),
    toolCallId: z.string().nullable().optional(),
    streamType: z.string().nullable().optional(),
    messageKind: z.string().nullable().optional(),
    displayRole: z.string().nullable().optional(),
    reason: z.string().nullable().optional()
  }).nullable().optional()
});
var runtimeTaskChatMessagesRequestSchema = z.object({
  taskId: z.string()
});
var runtimeTaskChatMessagesResponseSchema = z.object({
  ok: z.boolean(),
  messages: z.array(runtimeTaskChatMessageSchema),
  error: z.string().optional()
});
var runtimeTaskChatSendRequestSchema = z.object({
  taskId: z.string(),
  text: z.string(),
  images: z.array(runtimeTaskImageSchema).optional(),
  mode: runtimeTaskSessionModeSchema.optional()
});
var runtimeTaskChatSendResponseSchema = z.object({
  ok: z.boolean(),
  summary: runtimeTaskSessionSummarySchema.nullable(),
  message: runtimeTaskChatMessageSchema.nullable().optional(),
  error: z.string().optional()
});
var runtimeTaskChatReloadRequestSchema = z.object({
  taskId: z.string()
});
var runtimeTaskChatReloadResponseSchema = z.object({
  ok: z.boolean(),
  summary: runtimeTaskSessionSummarySchema.nullable(),
  error: z.string().optional()
});
var runtimeTaskChatAbortRequestSchema = z.object({
  taskId: z.string()
});
var runtimeTaskChatAbortResponseSchema = z.object({
  ok: z.boolean(),
  summary: runtimeTaskSessionSummarySchema.nullable(),
  error: z.string().optional()
});
var runtimeTaskChatCancelRequestSchema = z.object({
  taskId: z.string()
});
var runtimeTaskChatCancelResponseSchema = z.object({
  ok: z.boolean(),
  summary: runtimeTaskSessionSummarySchema.nullable(),
  error: z.string().optional()
});
var runtimeShellSessionStartRequestSchema = z.object({
  taskId: z.string(),
  cols: z.number().int().positive().optional(),
  rows: z.number().int().positive().optional(),
  workspaceTaskId: z.string().optional(),
  baseRef: z.string()
});
var runtimeShellSessionStartResponseSchema = z.object({
  ok: z.boolean(),
  summary: runtimeTaskSessionSummarySchema.nullable(),
  shellBinary: z.string().nullable().optional(),
  error: z.string().optional()
});
var runtimeTerminalWsResizeMessageSchema = z.object({
  type: z.literal("resize"),
  cols: z.number().int().positive(),
  rows: z.number().int().positive(),
  pixelWidth: z.number().int().positive().optional(),
  pixelHeight: z.number().int().positive().optional()
});
var runtimeTerminalWsStopMessageSchema = z.object({
  type: z.literal("stop")
});
var runtimeTerminalWsOutputAckMessageSchema = z.object({
  type: z.literal("output_ack"),
  bytes: z.number().int().nonnegative()
});
var runtimeTerminalWsRestoreCompleteMessageSchema = z.object({
  type: z.literal("restore_complete")
});
var runtimeTerminalWsClientMessageSchema = z.discriminatedUnion("type", [
  runtimeTerminalWsResizeMessageSchema,
  runtimeTerminalWsStopMessageSchema,
  runtimeTerminalWsOutputAckMessageSchema,
  runtimeTerminalWsRestoreCompleteMessageSchema
]);
var runtimeTerminalWsStateMessageSchema = z.object({
  type: z.literal("state"),
  summary: runtimeTaskSessionSummarySchema
});
var runtimeTerminalWsErrorMessageSchema = z.object({
  type: z.literal("error"),
  message: z.string()
});
var runtimeTerminalWsExitMessageSchema = z.object({
  type: z.literal("exit"),
  code: z.number().nullable()
});
var runtimeTerminalWsRestoreMessageSchema = z.object({
  type: z.literal("restore"),
  snapshot: z.string(),
  cols: z.number().int().positive().nullable().optional(),
  rows: z.number().int().positive().nullable().optional()
});
var runtimeTerminalWsServerMessageSchema = z.discriminatedUnion("type", [
  runtimeTerminalWsStateMessageSchema,
  runtimeTerminalWsErrorMessageSchema,
  runtimeTerminalWsExitMessageSchema,
  runtimeTerminalWsRestoreMessageSchema
]);
var runtimeGitCommitSchema = z.object({
  hash: z.string(),
  shortHash: z.string(),
  authorName: z.string(),
  authorEmail: z.string(),
  date: z.string(),
  message: z.string(),
  parentHashes: z.array(z.string()),
  relation: z.enum(["selected", "upstream", "shared"]).optional()
});
var runtimeGitRefSchema = z.object({
  name: z.string(),
  type: z.enum(["branch", "remote", "detached"]),
  hash: z.string(),
  isHead: z.boolean(),
  upstreamName: z.string().optional(),
  ahead: z.number().optional(),
  behind: z.number().optional()
});
var runtimeGitLogRequestSchema = z.object({
  ref: z.string().nullable().optional(),
  refs: z.array(z.string()).optional(),
  maxCount: z.number().int().positive().optional(),
  skip: z.number().int().nonnegative().optional(),
  taskScope: runtimeTaskWorkspaceInfoRequestSchema.nullable().optional()
});
var runtimeGitLogResponseSchema = z.object({
  ok: z.boolean(),
  commits: z.array(runtimeGitCommitSchema),
  totalCount: z.number(),
  error: z.string().optional()
});
var runtimeGitCommitDiffFileSchema = z.object({
  path: z.string(),
  previousPath: z.string().optional(),
  status: z.enum(["modified", "added", "deleted", "renamed"]),
  additions: z.number(),
  deletions: z.number(),
  patch: z.string()
});
var runtimeGitCommitDiffRequestSchema = z.object({
  commitHash: z.string(),
  taskScope: runtimeTaskWorkspaceInfoRequestSchema.nullable().optional()
});
var runtimeGitCommitDiffResponseSchema = z.object({
  ok: z.boolean(),
  commitHash: z.string(),
  files: z.array(runtimeGitCommitDiffFileSchema),
  error: z.string().optional()
});
var runtimeGitRefsResponseSchema = z.object({
  ok: z.boolean(),
  refs: z.array(runtimeGitRefSchema),
  error: z.string().optional()
});
var runtimeHookEventSchema = z.enum(["to_review", "to_in_progress", "activity"]);
var runtimeHookIngestRequestSchema = z.object({
  taskId: z.string(),
  workspaceId: z.string(),
  event: runtimeHookEventSchema,
  metadata: runtimeTaskHookActivitySchema.partial().optional()
});
var runtimeHookIngestResponseSchema = z.object({
  ok: z.boolean(),
  error: z.string().optional()
});
export {
  runtimeAgentDefinitionSchema,
  runtimeAgentIdSchema,
  runtimeBoardCardSchema,
  runtimeBoardColumnIdSchema,
  runtimeBoardColumnSchema,
  runtimeBoardDataSchema,
  runtimeBoardDependencySchema,
  runtimeClineAccountProfileResponseSchema,
  runtimeClineAccountProfileSchema,
  runtimeClineKanbanAccessResponseSchema,
  runtimeClineMcpAuthStatusResponseSchema,
  runtimeClineMcpOAuthRequestSchema,
  runtimeClineMcpOAuthResponseSchema,
  runtimeClineMcpServerAuthStatusSchema,
  runtimeClineMcpServerSchema,
  runtimeClineMcpSettingsResponseSchema,
  runtimeClineMcpSettingsSaveRequestSchema,
  runtimeClineMcpSettingsSaveResponseSchema,
  runtimeClineOauthLoginRequestSchema,
  runtimeClineOauthLoginResponseSchema,
  runtimeClineOauthProviderSchema,
  runtimeClineProviderCatalogItemSchema,
  runtimeClineProviderCatalogResponseSchema,
  runtimeClineProviderModelSchema,
  runtimeClineProviderModelsRequestSchema,
  runtimeClineProviderModelsResponseSchema,
  runtimeClineProviderSettingsSaveRequestSchema,
  runtimeClineProviderSettingsSaveResponseSchema,
  runtimeClineProviderSettingsSchema,
  runtimeClineReasoningEffortSchema,
  runtimeCommandRunRequestSchema,
  runtimeCommandRunResponseSchema,
  runtimeConfigResponseSchema,
  runtimeConfigSaveRequestSchema,
  runtimeDebugResetAllStateResponseSchema,
  runtimeGitCheckoutRequestSchema,
  runtimeGitCheckoutResponseSchema,
  runtimeGitCommitDiffFileSchema,
  runtimeGitCommitDiffRequestSchema,
  runtimeGitCommitDiffResponseSchema,
  runtimeGitCommitSchema,
  runtimeGitDiscardResponseSchema,
  runtimeGitLogRequestSchema,
  runtimeGitLogResponseSchema,
  runtimeGitRefSchema,
  runtimeGitRefsResponseSchema,
  runtimeGitRepositoryInfoSchema,
  runtimeGitSummaryResponseSchema,
  runtimeGitSyncActionSchema,
  runtimeGitSyncResponseSchema,
  runtimeGitSyncSummarySchema,
  runtimeHookEventSchema,
  runtimeHookIngestRequestSchema,
  runtimeHookIngestResponseSchema,
  runtimeOpenFileRequestSchema,
  runtimeOpenFileResponseSchema,
  runtimeProjectAddRequestSchema,
  runtimeProjectAddResponseSchema,
  runtimeProjectDirectoryPickerResponseSchema,
  runtimeProjectRemoveRequestSchema,
  runtimeProjectRemoveResponseSchema,
  runtimeProjectShortcutSchema,
  runtimeProjectSummarySchema,
  runtimeProjectTaskCountsSchema,
  runtimeProjectsResponseSchema,
  runtimePullFromFabricResponseSchema,
  runtimeShellSessionStartRequestSchema,
  runtimeShellSessionStartResponseSchema,
  runtimeSlashCommandSchema,
  runtimeSlashCommandsResponseSchema,
  runtimeStateStreamClineSessionContextUpdatedMessageSchema,
  runtimeStateStreamErrorMessageSchema,
  runtimeStateStreamMcpAuthUpdatedMessageSchema,
  runtimeStateStreamMessageSchema,
  runtimeStateStreamProjectsMessageSchema,
  runtimeStateStreamSnapshotMessageSchema,
  runtimeStateStreamTaskChatMessageSchema,
  runtimeStateStreamTaskReadyForReviewMessageSchema,
  runtimeStateStreamTaskSessionsMessageSchema,
  runtimeStateStreamWorkspaceMetadataMessageSchema,
  runtimeStateStreamWorkspaceStateMessageSchema,
  runtimeTaskAutoReviewModeSchema,
  runtimeTaskChatAbortRequestSchema,
  runtimeTaskChatAbortResponseSchema,
  runtimeTaskChatCancelRequestSchema,
  runtimeTaskChatCancelResponseSchema,
  runtimeTaskChatMessageSchema,
  runtimeTaskChatMessagesRequestSchema,
  runtimeTaskChatMessagesResponseSchema,
  runtimeTaskChatReloadRequestSchema,
  runtimeTaskChatReloadResponseSchema,
  runtimeTaskChatSendRequestSchema,
  runtimeTaskChatSendResponseSchema,
  runtimeTaskHookActivitySchema,
  runtimeTaskImageSchema,
  runtimeTaskSessionInputRequestSchema,
  runtimeTaskSessionInputResponseSchema,
  runtimeTaskSessionModeSchema,
  runtimeTaskSessionReviewReasonSchema,
  runtimeTaskSessionStartRequestSchema,
  runtimeTaskSessionStartResponseSchema,
  runtimeTaskSessionStateSchema,
  runtimeTaskSessionStopRequestSchema,
  runtimeTaskSessionStopResponseSchema,
  runtimeTaskSessionSummarySchema,
  runtimeTaskTurnCheckpointSchema,
  runtimeTaskWorkspaceInfoRequestSchema,
  runtimeTaskWorkspaceInfoResponseSchema,
  runtimeTaskWorkspaceMetadataSchema,
  runtimeTerminalWsClientMessageSchema,
  runtimeTerminalWsErrorMessageSchema,
  runtimeTerminalWsExitMessageSchema,
  runtimeTerminalWsOutputAckMessageSchema,
  runtimeTerminalWsResizeMessageSchema,
  runtimeTerminalWsRestoreCompleteMessageSchema,
  runtimeTerminalWsRestoreMessageSchema,
  runtimeTerminalWsServerMessageSchema,
  runtimeTerminalWsStateMessageSchema,
  runtimeTerminalWsStopMessageSchema,
  runtimeWorkspaceChangesModeSchema,
  runtimeWorkspaceChangesRequestSchema,
  runtimeWorkspaceChangesResponseSchema,
  runtimeWorkspaceFileChangeSchema,
  runtimeWorkspaceFileSearchMatchSchema,
  runtimeWorkspaceFileSearchRequestSchema,
  runtimeWorkspaceFileSearchResponseSchema,
  runtimeWorkspaceFileStatusSchema,
  runtimeWorkspaceMetadataSchema,
  runtimeWorkspaceStateConflictResponseSchema,
  runtimeWorkspaceStateNotifyResponseSchema,
  runtimeWorkspaceStateResponseSchema,
  runtimeWorkspaceStateSaveRequestSchema,
  runtimeWorktreeDeleteRequestSchema,
  runtimeWorktreeDeleteResponseSchema,
  runtimeWorktreeEnsureRequestSchema,
  runtimeWorktreeEnsureResponseSchema
};
//# sourceMappingURL=index.js.map
