/**
 * This file was generated by kysely-codegen.
 * Please do not edit it manually.
 */

import type { ColumnType } from "kysely";

export type Generated<T> =
  T extends ColumnType<infer S, infer I, infer U>
    ? ColumnType<S, I | undefined, U>
    : ColumnType<T, T | undefined, T>;

export interface AcpReplayEvents {
  at: number;
  estimated_bytes: Generated<number>;
  run_id: string | null;
  seq: number;
  session_id: string;
  session_key: string;
  update_json: string;
}

export interface AcpReplaySessions {
  complete: number;
  created_at: number;
  cwd: string;
  estimated_bytes: Generated<number>;
  next_seq: number;
  session_id: string;
  session_key: string;
  updated_at: number;
}

export interface AcpSessions {
  agent: string;
  backend: string;
  cwd: string | null;
  identity_json: string | null;
  last_activity_at: number;
  last_error: string | null;
  mode: string;
  runtime_options_json: string | null;
  runtime_session_name: string;
  session_id: string | null;
  session_key: string;
  state: string;
  updated_at: number;
}

export interface AgentDatabaseLeases {
  agent_id: string;
  lease_id: string;
  opened_at: number;
  owner_pid: number;
  owner_start_time: number | null;
  path: string;
}

export interface AgentDatabases {
  agent_id: string;
  last_seen_at: number;
  path: string;
  schema_version: number;
  size_bytes: number | null;
}

export interface AgentDeletionJournal {
  agent_dir: string;
  agent_id: string;
  cleanup_completed: Generated<number>;
  cleanup_paths_json: Generated<string>;
  created_at: number;
  database_paths_json: Generated<string>;
  delete_files: Generated<number>;
  operation_id: Generated<string>;
  sessions_dir: string;
  workspace_dir: string;
}

export interface AgentModelCatalogs {
  agent_dir: string;
  catalog_key: string;
  raw_json: string;
  updated_at: number;
}

export interface AndroidNotificationRecentPackages {
  package_name: string;
  sort_order: number;
  updated_at_ms: number;
}

export interface ApnsRegistrationTombstones {
  deleted_at_ms: number;
  node_id: string;
}

export interface ApnsRegistrations {
  distribution: string | null;
  environment: string;
  installation_id: string | null;
  node_id: string;
  relay_handle: string | null;
  relay_origin: string | null;
  send_grant: string | null;
  token: string | null;
  token_debug_suffix: string | null;
  topic: string;
  transport: string;
  updated_at_ms: number;
}

export interface AuditEvents {
  account_ref: string | null;
  action: string;
  actor_id: string;
  actor_type: string;
  agent_id: string | null;
  channel: string | null;
  conversation_kind: string | null;
  conversation_ref: string | null;
  delivery_kind: string | null;
  direction: string | null;
  duration_ms: number | null;
  error_code: string | null;
  event_id: string;
  failure_stage: string | null;
  kind: string;
  message_outcome: string | null;
  message_ref: string | null;
  occurred_at: number;
  reason_code: string | null;
  result_count: number | null;
  run_id: string | null;
  schema_version: Generated<number>;
  sequence: Generated<number>;
  session_id: string | null;
  session_key: string | null;
  source_id: string;
  source_sequence: number;
  status: string;
  target_ref: string | null;
  tool_call_id: string | null;
  tool_name: string | null;
}

export interface AuditIdentityKeys {
  created_at: number;
  id: Generated<number>;
  key: Uint8Array;
  key_id: string;
}

export interface AuthProfileState {
  state_json: string;
  store_key: string;
  updated_at: number;
}

export interface AuthProfileStores {
  store_json: string;
  store_key: string;
  updated_at: number;
}

export interface BackupRuns {
  archive_path: string;
  created_at: number;
  id: string;
  manifest_json: string;
  status: string;
}

export interface CaptureBlobs {
  blob_id: string;
  content_type: string | null;
  created_at: number;
  data: Uint8Array;
  encoding: string;
  sha256: string;
  size_bytes: number;
}

export interface CaptureEvents {
  close_code: number | null;
  content_type: string | null;
  data_blob_id: string | null;
  data_sha256: string | null;
  data_text: string | null;
  direction: string;
  error_text: string | null;
  flow_id: string;
  headers_json: string | null;
  host: string | null;
  id: Generated<number>;
  kind: string;
  meta_json: string | null;
  method: string | null;
  path: string | null;
  protocol: string;
  session_id: string;
  source_process: string;
  source_scope: string;
  status: number | null;
  ts: number;
}

export interface CaptureSessions {
  ended_at: number | null;
  id: string;
  mode: string;
  proxy_url: string | null;
  source_process: string;
  source_scope: string;
  started_at: number;
}

export interface ChannelIngressEvents {
  account_id: string;
  attempts: Generated<number>;
  channel_id: string;
  claim_owner: string | null;
  claim_token: string | null;
  claimed_at: number | null;
  completed_at: number | null;
  completed_metadata_json: string | null;
  event_id: string;
  failed_at: number | null;
  failed_reason: string | null;
  lane_key: string | null;
  last_attempt_at: number | null;
  last_error: string | null;
  metadata_json: string | null;
  payload_json: string;
  queue_name: string;
  received_at: number;
  status: string;
  updated_at: number;
}

export interface ChannelPairingAllowEntries {
  account_id: string;
  channel_key: string;
  entry: string;
  sort_order: number;
  updated_at: number;
}

export interface ChannelPairingRequests {
  account_id: string;
  channel_key: string;
  code: string;
  created_at: string;
  last_seen_at: string;
  meta_json: string | null;
  request_id: string;
}

export interface ClawCronRefs {
  agent_id: string;
  created_at_ms: number;
  declaration_key: string;
  error: string | null;
  job_json: string;
  manifest_id: string;
  scheduler_job_id: string | null;
  schema_version: string;
  status: string;
  updated_at_ms: number;
}

export interface ClawInstalls {
  added_at_ms: number;
  agent_config_digest: string;
  agent_id: string;
  agent_owned_paths_json: string;
  bootstrap_content_digest: string | null;
  bootstrap_source_path: string | null;
  claw_name: string;
  claw_version: string;
  integrity: string;
  integrity_kind: string;
  manifest_path: string;
  manifest_schema_version: number;
  package_root: string;
  plan_integrity: string;
  schema_version: string;
  source_byte_length: number;
  source_kind: string;
  status: string;
  updated_at_ms: number;
  workspace: string;
}

export interface ClawMcpServerRefs {
  agent_id: string;
  config_digest: string;
  created_at_ms: number;
  error: string | null;
  independent_owner: Generated<number>;
  name: string;
  origin: string;
  relationship: string;
  schema_version: string;
  status: string;
  updated_at_ms: number;
}

export interface ClawPackageRefs {
  agent_id: string;
  claw_name: string;
  extension_adapter_identity: string | null;
  extension_detected_format: string | null;
  extension_format: string | null;
  extension_id: string | null;
  extension_mapped_json: string | null;
  extension_unavailable_json: string | null;
  independent_owner: number;
  installed_at_ms: number;
  origin: string;
  package_integrity: string;
  package_kind: string;
  package_ref: string;
  package_source: string;
  package_status: string;
  package_version: string;
  relationship: string;
  schema_version: string;
  updated_at_ms: number;
}

export interface ClawWorkspaceFiles {
  agent_id: string;
  content_digest: string;
  created_at_ms: number;
  schema_version: string;
  source_path: string;
  status: string;
  target_path: string;
  updated_at_ms: number;
  workspace: string;
}

export interface ClawhubPromotionClaims {
  claimed_at_ms: number;
  ends_at_ms: number;
  model_keys_json: string;
  provider: string | null;
  slug: string;
}

export interface ClawhubPromotionsFeedState {
  etag: string | null;
  feed_sequence: number | null;
  last_checked_at_ms: number | null;
  notified_slugs_json: Generated<string>;
  payload_json: string | null;
  state_key: string;
  updated_at_ms: number;
}

export interface CommandLogEntries {
  action: string;
  entry_json: string;
  id: string;
  sender_id: string;
  session_key: string;
  source: string;
  timestamp_ms: number;
}

export interface Commitments {
  account_id: string | null;
  agent_id: string;
  attempts: number;
  channel: string;
  confidence: number;
  created_at_ms: number;
  dedupe_key: string;
  dismissed_at_ms: number | null;
  due_earliest_ms: number;
  due_latest_ms: number;
  due_timezone: string;
  expired_at_ms: number | null;
  id: string;
  kind: string;
  last_attempt_at_ms: number | null;
  reason: string;
  recipient_id: string | null;
  record_json: string;
  sender_id: string | null;
  sensitivity: string;
  sent_at_ms: number | null;
  session_key: string;
  snoozed_until_ms: number | null;
  source: string;
  source_message_id: string | null;
  source_run_id: string | null;
  status: string;
  suggested_text: string;
  thread_id: string | null;
  updated_at_ms: number;
}

export interface ConfigHealthEntries {
  config_path: string;
  last_known_good_json: string | null;
  last_observed_suspicious_signature: string | null;
  last_promoted_good_json: string | null;
  updated_at_ms: number;
}

export interface ConfigMachineState {
  state_key: string;
  updated_at_ms: number;
  value_json: string;
}

export interface CronJobScratch {
  content: string | null;
  job_id: string;
  revision: number;
  source_sha256: string | null;
  store_key: string;
  updated_at_ms: number;
}

export interface CronJobs {
  agent_id: string | null;
  anchor_ms: number | null;
  at: string | null;
  consecutive_errors: number | null;
  consecutive_skipped: number | null;
  created_at_ms: number;
  declaration_key: string | null;
  delete_after_run: number | null;
  delivery_account_id: string | null;
  delivery_best_effort: number | null;
  delivery_channel: string | null;
  delivery_completion_mode: string | null;
  delivery_completion_to: string | null;
  delivery_mode: string | null;
  delivery_thread_id: string | null;
  delivery_thread_id_type: string | null;
  delivery_to: string | null;
  description: string | null;
  display_name: string | null;
  enabled: number;
  every_ms: number | null;
  failure_alert_account_id: string | null;
  failure_alert_after: number | null;
  failure_alert_channel: string | null;
  failure_alert_cooldown_ms: number | null;
  failure_alert_disabled: number | null;
  failure_alert_include_skipped: number | null;
  failure_alert_mode: string | null;
  failure_alert_to: string | null;
  failure_delivery_account_id: string | null;
  failure_delivery_channel: string | null;
  failure_delivery_mode: string | null;
  failure_delivery_to: string | null;
  job_id: string;
  job_json: string;
  last_delivered: number | null;
  last_delivery_error: string | null;
  last_delivery_status: string | null;
  last_duration_ms: number | null;
  last_error: string | null;
  last_failure_alert_at_ms: number | null;
  last_run_at_ms: number | null;
  last_run_status: string | null;
  name: string;
  next_run_at_ms: number | null;
  owner_agent_id: string | null;
  owner_session_key: string | null;
  payload_allow_unsafe_external_content: number | null;
  payload_external_content_source_json: string | null;
  payload_fallbacks_json: string | null;
  payload_kind: string;
  payload_light_context: number | null;
  payload_message: string | null;
  payload_model: string | null;
  payload_thinking: string | null;
  payload_timeout_seconds: number | null;
  payload_tools_allow_is_default: number | null;
  payload_tools_allow_json: string | null;
  running_at_ms: number | null;
  runtime_updated_at_ms: number | null;
  schedule_error_count: number | null;
  schedule_expr: string | null;
  schedule_identity: string | null;
  schedule_kind: string;
  schedule_tz: string | null;
  session_key: string | null;
  session_target: string;
  sort_order: Generated<number>;
  stagger_ms: number | null;
  state_json: Generated<string>;
  store_key: string;
  trigger_once: number | null;
  trigger_script: string | null;
  updated_at: number;
  wake_mode: string;
}

export interface CurrentConversationBindings {
  account_id: string;
  binding_id: string;
  binding_key: string;
  bound_at: number;
  channel: string;
  conversation_id: string;
  conversation_kind: string;
  expires_at: number | null;
  metadata_json: string | null;
  parent_conversation_id: string | null;
  record_json: string;
  status: string;
  target_agent_id: string;
  target_kind: string;
  target_session_id: string | null;
  target_session_key: string;
  updated_at: number;
}

export interface DeliveryQueueEntries {
  account_id: string | null;
  channel: string | null;
  enqueued_at: number;
  entry_json: string;
  entry_kind: string | null;
  failed_at: number | null;
  id: string;
  last_attempt_at: number | null;
  last_error: string | null;
  platform_send_started_at: number | null;
  queue_name: string;
  recovery_state: string | null;
  retry_count: Generated<number>;
  session_key: string | null;
  status: string;
  target: string | null;
  updated_at: number;
}

export interface DeviceAuthTokens {
  device_id: string;
  role: string;
  scopes_json: string;
  token: string;
  updated_at_ms: number;
}

export interface DeviceBootstrapTokens {
  device_id: string | null;
  issued_at_ms: number;
  last_used_at_ms: number | null;
  pending_profile_json: string | null;
  profile_json: string | null;
  public_key: string | null;
  redeemed_profile_json: string | null;
  token: string;
  token_key: string;
  ts: number;
}

export interface DeviceIdentities {
  created_at_ms: number;
  device_id: string;
  identity_key: string;
  private_key_pem: string;
  public_key_pem: string;
  updated_at_ms: number;
}

export interface DevicePairingPaired {
  approved_at_ms: number;
  approved_scopes_json: string | null;
  approved_via: string | null;
  browser_origin: string | null;
  client_id: string | null;
  client_mode: string | null;
  created_at_ms: number;
  device_family: string | null;
  device_id: string;
  display_name: string | null;
  last_seen_at_ms: number | null;
  last_seen_reason: string | null;
  node_surface_json: string | null;
  operator_label: string | null;
  pending_node_surface_json: string | null;
  platform: string | null;
  public_key: string;
  remote_ip: string | null;
  role: string | null;
  roles_json: string | null;
  scopes_json: string | null;
  tokens_json: string | null;
}

export interface DevicePairingPending {
  browser_origin: string | null;
  client_id: string | null;
  client_mode: string | null;
  device_family: string | null;
  device_id: string;
  display_name: string | null;
  is_repair: number | null;
  platform: string | null;
  public_key: string;
  refreshed_at_ms: number | null;
  remote_ip: string | null;
  request_id: string;
  role: string | null;
  roles_json: string | null;
  scopes_json: string | null;
  silent: number | null;
  ts: number;
}

export interface DiagnosticEvents {
  created_at: number;
  event_key: string;
  payload_json: string;
  scope: string;
  sequence: Generated<number>;
}

export interface DiagnosticStabilityBundles {
  bundle_json: string;
  bundle_key: string;
  created_at: number;
  generated_at: string;
  reason: string;
}

export interface ExecApprovalsConfig {
  agent_count: number;
  allowlist_count: number;
  auto_allow_skills: number | null;
  config_key: string;
  default_ask: string | null;
  default_ask_fallback: string | null;
  default_security: string | null;
  has_socket_token: number;
  raw_json: string;
  socket_path: string | null;
  updated_at_ms: number;
}

export interface ExecutionIdentityContexts {
  context_bytes: number;
  context_id: string;
  context_json: string;
  coverage_state: string;
  created_at: number;
  execution_id: string;
  run_id: string;
}

export interface FleetCells {
  container_name: string;
  created_at_ms: number;
  data_dir: string;
  host_port: number;
  image: string;
  runtime: string;
  tenant_id: string;
}

export interface FlowRuns {
  blocked_summary: string | null;
  blocked_task_id: string | null;
  cancel_requested_at: number | null;
  controller_id: string | null;
  created_at: number;
  current_step: string | null;
  ended_at: number | null;
  flow_id: string;
  goal: string;
  notify_policy: string;
  owner_key: string;
  requester_origin_json: string | null;
  revision: Generated<number>;
  shape: string | null;
  state_json: string | null;
  status: string;
  sync_mode: Generated<string>;
  updated_at: number;
  wait_json: string | null;
}

export interface GatewayBootLifecycle {
  boot_id: string;
  completed_at_ms: number | null;
  outcome: string | null;
  pid: number;
  reason: string | null;
  started_at_ms: number;
  startup_reason: string | null;
}

export interface GatewayRestartHandoff {
  created_at: number;
  expires_at: number;
  handoff_key: string;
  intent_id: string;
  kind: string;
  pid: number;
  process_instance_id: string | null;
  reason: string | null;
  restart_kind: string;
  restart_trace_last_at: number | null;
  restart_trace_started_at: number | null;
  source: string;
  supervisor_mode: string;
  updated_at_ms: number;
  version: number;
}

export interface GatewayRestartIntent {
  created_at: number;
  force: number | null;
  intent_key: string;
  kind: string;
  pid: number;
  reason: string | null;
  updated_at_ms: number;
  wait_ms: number | null;
}

export interface GatewayRestartSentinel {
  continuation_json: string | null;
  delivery_account_id: string | null;
  delivery_channel: string | null;
  delivery_to: string | null;
  doctor_hint: string | null;
  kind: string;
  message: string | null;
  payload_json: string;
  sentinel_key: string;
  session_key: string | null;
  stats_json: string | null;
  status: string;
  thread_id: string | null;
  ts: number;
  updated_at_ms: number;
  version: number;
}

export interface InstalledPluginIndex {
  compat_registry_version: string;
  diagnostics_json: string;
  generated_at_ms: number;
  host_contract_version: string;
  index_key: string;
  install_records_json: string;
  migration_version: number;
  plugins_json: string;
  policy_hash: string;
  refresh_reason: string | null;
  updated_at_ms: number;
  version: number;
  warning: string | null;
}

export interface MacosPortGuardianRecords {
  command: string;
  mode: string;
  pid: Generated<number>;
  port: number;
  timestamp: number;
}

export interface ManagedOutgoingImageRecords {
  agent_id: string | null;
  alt: string;
  attachment_id: string;
  cleanup_pending: Generated<number>;
  created_at: string;
  message_id: string | null;
  original_content_type: string;
  original_filename: string | null;
  original_height: number | null;
  original_media_id: string;
  original_media_root: string;
  original_media_subdir: string;
  original_size_bytes: number | null;
  original_width: number | null;
  record_json: string;
  retention_class: string | null;
  session_key: string;
  updated_at: string | null;
}

export interface McpOauthStores {
  format_version: number;
  store_json: string;
  store_key: string;
  updated_at: number;
}

export interface MediaBlobs {
  blob: Uint8Array;
  content_type: string | null;
  created_at: number;
  id: string;
  size_bytes: number;
  subdir: string;
  updated_at: number;
}

export interface MeetingTranscriptSessions {
  created_at_ms: number;
  export_key: string;
  export_manifest_json: Generated<string>;
  export_pending_json: Generated<string>;
  metadata_json: string | null;
  next_utterance_seq: Generated<number>;
  provider_id: string;
  selector: string;
  session_id: string;
  session_slug: string;
  source_json: string;
  started_at: string;
  stopped_at: string | null;
  title: string | null;
  updated_at_ms: number;
}

export interface MeetingTranscriptSummaries {
  generated_at: string | null;
  markdown: string | null;
  session_id: string;
  session_started_at: string;
  summary_json: string | null;
  utterance_count: number;
}

export interface MeetingTranscriptUtterances {
  ended_at: string | null;
  final: number | null;
  metadata_json: string | null;
  sequence: number;
  session_id: string;
  session_started_at: string;
  speaker_id: string | null;
  speaker_label: string | null;
  started_at: string | null;
  text: string;
  utterance_id: string | null;
}

export interface MigrationRuns {
  finished_at: number | null;
  id: string;
  report_json: string;
  started_at: number;
  status: string;
}

export interface MigrationSources {
  imported_at: number;
  last_run_id: string;
  migration_kind: string;
  removed_source: Generated<number>;
  report_json: string;
  source_key: string;
  source_path: string;
  source_record_count: number | null;
  source_sha256: string | null;
  source_size_bytes: number | null;
  status: string;
  target_table: string;
}

export interface ModelCapabilityCache {
  context_window: number;
  cost_cache_read: number;
  cost_cache_write: number;
  cost_input: number;
  cost_output: number;
  input_image: number;
  input_text: number;
  max_tokens: number;
  model_id: string;
  name: string;
  provider_id: string;
  reasoning: number;
  supports_tools: number | null;
  updated_at_ms: number;
}

export interface ModelCatalogRemote {
  bundle_json: string;
  checked_at: number;
  etag: string | null;
  generated_at: number;
  id: Generated<number>;
  last_modified: string | null;
  min_version: string | null;
  source_url: string;
}

export interface NativeHookRelayBridges {
  expires_at_ms: number;
  hostname: string;
  pid: number;
  port: number;
  relay_id: string;
  token: string;
  updated_at_ms: number;
}

export interface NodeHostConfig {
  config_key: string;
  display_name: string | null;
  gateway_context_path: string | null;
  gateway_host: string | null;
  gateway_port: number | null;
  gateway_tls: number | null;
  gateway_tls_fingerprint: string | null;
  installed_apps_sharing: Generated<number>;
  node_id: string;
  token: string | null;
  updated_at_ms: number;
  version: number;
}

export interface OfficialExternalPluginCatalogSnapshots {
  body: string;
  checksum: string;
  etag: string | null;
  feed_url: string;
  last_modified: string | null;
  saved_at: string;
  status: number;
  trust_key_id: string | null;
  trust_mode: string | null;
  trust_signature_count: number | null;
  trust_threshold: number | null;
  trust_verified_at: string | null;
  updated_at_ms: number;
}

export interface OnboardingRecommendations {
  accepted_at_ms: number | null;
  config_key: string;
  inventory_hash: string;
  matches_json: string;
  offered_at_ms: number;
  updated_at_ms: number;
}

export interface OperatorApprovals {
  approval_id: string;
  audience_session_keys_json: string;
  consumed_at_ms: number | null;
  consumed_by: string | null;
  created_at_ms: number;
  decision: string | null;
  expires_at_ms: number;
  kind: string;
  presentation_json: string;
  requested_by_client_id: string | null;
  requested_by_device_id: string | null;
  requested_by_device_token_auth: Generated<number>;
  resolution_ref: string;
  resolved_at_ms: number | null;
  resolver_id: string | null;
  resolver_kind: string | null;
  reviewer_device_ids_json: string;
  runtime_epoch: string;
  source_agent_id: string | null;
  source_run_id: string | null;
  source_session_id: string | null;
  source_session_key: string | null;
  source_tool_call_id: string | null;
  source_tool_name: string | null;
  status: string;
  terminal_reason: string | null;
  updated_at_ms: number;
}

export interface OutboundMediaProvenance {
  created_at_ms: number;
  kind: string;
  realpath: string;
  sha256: string;
  size_bytes: number;
  version: number;
}

export interface PluginBindingApprovals {
  account_id: string;
  approved_at: number;
  channel: string;
  plugin_id: string;
  plugin_name: string | null;
  plugin_root: string;
}

export interface PluginBlobEntries {
  blob: Uint8Array;
  created_at: number;
  entry_key: string;
  expires_at: number | null;
  metadata_json: string;
  namespace: string;
  plugin_id: string;
}

export interface PluginStateEntries {
  created_at: number;
  entry_key: string;
  expires_at: number | null;
  namespace: string;
  plugin_id: string;
  value_json: string;
}

export interface SandboxRegistryEntries {
  backend_id: string | null;
  cdp_port: number | null;
  config_hash: string | null;
  config_label_kind: string | null;
  container_name: string;
  created_at_ms: number | null;
  entry_json: string;
  image: string | null;
  last_used_at_ms: number | null;
  no_vnc_port: number | null;
  registry_kind: string;
  runtime_label: string | null;
  session_key: string | null;
  updated_at: number;
}

export interface SchemaMeta {
  agent_id: string | null;
  app_version: string | null;
  created_at: number;
  meta_key: string;
  role: string;
  schema_version: number;
  updated_at: number;
}

export interface SessionGroups {
  created_at: number;
  name: string;
  position: number;
}

export interface SessionStateEvents {
  actor_id: string | null;
  actor_type: string;
  agent_id: string;
  dedupe_key: string | null;
  kind: string;
  occurred_at: number;
  payload_json: string | null;
  run_id: string | null;
  sequence: Generated<number>;
  session_id: string | null;
  session_key: string;
  summary: string;
}

export interface SessionStateHeads {
  agent_id: string;
  last_sequence: number;
  pruned_max_sequence: Generated<number>;
  session_key: string;
  updated_at: number;
}

export interface SessionUpstreamLinks {
  agent_id: string;
  catalog_id: string;
  created_at: number;
  host_id: string;
  last_marker_json: string | null;
  last_scanned_at: number | null;
  session_key: string;
  thread_id: string;
  updated_at: number;
  upstream_kind: string;
  upstream_ref_json: string | null;
}

export interface SessionWatchCursors {
  last_seen_sequence: Generated<number>;
  material_sequence: Generated<number>;
  notified_sequence: Generated<number>;
  provenance: Generated<string>;
  target_session_key: string;
  updated_at: number;
  watcher_session_key: string;
}

export interface SidebarSections {
  position: number;
  section_id: string;
}

export interface SkillCuratorState {
  id: Generated<number>;
  last_attempt_at_ms: number;
  last_error: string | null;
  last_result_json: string;
  last_success_at_ms: number | null;
}

export interface SkillLifecycle {
  archived_reason: string | null;
  created_at_ms: number;
  pinned: Generated<number>;
  skill_file: string;
  skill_key: string;
  skill_name: string;
  state: string;
  state_changed_at_ms: number;
}

export interface SkillUploadChunks {
  byte_offset: number;
  chunk_blob: Uint8Array;
  size_bytes: number;
  upload_id: string;
}

export interface SkillUploads {
  actual_sha256: string | null;
  archive_blob: Uint8Array;
  committed: number;
  committed_at: number | null;
  created_at: number;
  expires_at: number;
  force: number;
  idempotency_key_hash: string | null;
  kind: string;
  received_bytes: number;
  sha256: string | null;
  size_bytes: number;
  slug: string;
  upload_id: string;
}

export interface SkillUsage {
  first_used_at_ms: number;
  last_agent_id: string | null;
  last_used_at_ms: number;
  skill_file: string;
  skill_key: string;
  skill_name: string;
  skill_source: string;
  use_count: number;
}

export interface SkillWorkshopProposalEvents {
  actor_json: string;
  correlation_id: string | null;
  event_id: string;
  event_type: string;
  occurred_at: string;
  payload_json: string | null;
  proposal_id: string;
  proposed_version: string;
  revision_hash: string;
  sequence: Generated<number>;
}

export interface SkillWorkshopProposalOriginRuns {
  mutation_count: number;
  position: number;
  proposal_id: string;
  run_id: string;
}

export interface SkillWorkshopProposalRollbacks {
  action: string;
  previous_content: string | null;
  previous_content_hash: string | null;
  proposal_id: string;
  support_files_json: string | null;
  target_skill_file: string;
  written_at: string;
}

export interface SkillWorkshopProposals {
  applied_at: string | null;
  created_at: string;
  draft_hash: string;
  kind: string;
  origin_agent_id: string | null;
  origin_message_id: string | null;
  origin_run_id: string | null;
  origin_session_key: string | null;
  owner_agent_id: string | null;
  proposal_id: string;
  quarantined_at: string | null;
  record_json: string;
  rejected_at: string | null;
  stale_at: string | null;
  status: string;
  status_reason: string | null;
  updated_at: string;
  workspace_dir: string;
}

export interface StateLeases {
  created_at: number;
  expires_at: number | null;
  heartbeat_at: number | null;
  lease_key: string;
  owner: string;
  payload_json: string | null;
  scope: string;
  updated_at: number;
}

export interface SubagentRuns {
  accumulated_runtime_ms: number | null;
  agent_dir: string | null;
  announce_retry_count: number | null;
  archive_at_ms: number | null;
  child_session_key: string;
  cleanup: string;
  cleanup_completed_at: number | null;
  cleanup_handled: number | null;
  completion_announced_at: number | null;
  controller_session_key: string | null;
  created_at: number;
  ended_at: number | null;
  ended_hook_emitted_at: number | null;
  ended_reason: string | null;
  expects_completion_message: number | null;
  fallback_frozen_result_captured_at: number | null;
  fallback_frozen_result_text: string | null;
  frozen_result_captured_at: number | null;
  frozen_result_text: string | null;
  label: string | null;
  last_announce_delivery_error: string | null;
  last_announce_retry_at: number | null;
  model: string | null;
  outcome_json: string | null;
  pause_reason: string | null;
  payload_json: Generated<string>;
  pending_final_delivery: number | null;
  pending_final_delivery_attempt_count: number | null;
  pending_final_delivery_created_at: number | null;
  pending_final_delivery_last_attempt_at: number | null;
  pending_final_delivery_last_error: string | null;
  pending_final_delivery_payload_json: string | null;
  requester_display_key: string;
  requester_origin_json: string | null;
  requester_session_key: string;
  requester_settle_wake_attempt_count: number | null;
  requester_settle_wake_batch_run_ids_json: string | null;
  requester_settle_wake_last_error: string | null;
  requester_settle_wake_next_attempt_at: number | null;
  requester_settle_wake_replay_count: number | null;
  requester_settle_wake_retire_after: number | null;
  requester_settle_wake_status: string | null;
  run_id: string;
  run_timeout_seconds: number | null;
  session_started_at: number | null;
  spawn_mode: string | null;
  started_at: number | null;
  suppress_announce_reason: string | null;
  swarm_collector: number | null;
  swarm_completion_status: string | null;
  swarm_group_id: string | null;
  swarm_output_schema_json: string | null;
  swarm_schema_error: string | null;
  swarm_structured_json: string | null;
  swarm_usage_json: string | null;
  task: string;
  task_name: string | null;
  wake_on_descendant_settle: number | null;
  workspace_dir: string | null;
}

export interface TaskDeliveryState {
  last_notified_event_at: number | null;
  requester_origin_json: string | null;
  task_id: string;
}

export interface TaskRuns {
  agent_id: string | null;
  child_session_key: string | null;
  cleanup_after: number | null;
  created_at: number;
  delivery_status: string;
  detail_json: string | null;
  ended_at: number | null;
  error: string | null;
  label: string | null;
  last_event_at: number | null;
  last_tool_name: string | null;
  notify_policy: string;
  owner_key: string;
  parent_flow_id: string | null;
  parent_task_id: string | null;
  progress_summary: string | null;
  requester_agent_id: string | null;
  requester_session_key: string | null;
  run_id: string | null;
  runtime: string;
  scope_kind: string;
  source_id: string | null;
  started_at: number | null;
  status: string;
  task: string;
  task_id: string;
  task_kind: string | null;
  terminal_outcome: string | null;
  terminal_summary: string | null;
  tool_use_count: number | null;
}

export interface TuiLastSessions {
  scope_key: string;
  session_key: string;
  updated_at: number;
}

export interface UpdateCheckState {
  auto_first_seen_at: string | null;
  auto_first_seen_tag: string | null;
  auto_first_seen_version: string | null;
  auto_install_id: string | null;
  auto_last_attempt_at: string | null;
  auto_last_attempt_version: string | null;
  auto_last_success_at: string | null;
  auto_last_success_version: string | null;
  last_available_tag: string | null;
  last_available_version: string | null;
  last_checked_at: string | null;
  last_notified_tag: string | null;
  last_notified_version: string | null;
  state_key: string;
  updated_at_ms: number;
}

export interface VoicewakeRoutingConfig {
  config_key: string;
  default_target_agent_id: string | null;
  default_target_mode: string;
  default_target_session_key: string | null;
  updated_at_ms: number;
  version: number;
}

export interface VoicewakeRoutingRoutes {
  config_key: string;
  position: number;
  target_agent_id: string | null;
  target_mode: string;
  target_session_key: string | null;
  trigger: string;
  updated_at_ms: number;
}

export interface VoicewakeTriggers {
  config_key: string;
  position: number;
  trigger: string;
  updated_at_ms: number;
}

export interface WebPushSubscriptions {
  auth: string;
  created_at_ms: number;
  endpoint: string;
  endpoint_hash: string;
  p256dh: string;
  subscription_id: string;
  updated_at_ms: number;
}

export interface WebPushVapidKeys {
  key_id: string;
  private_key: string;
  public_key: string;
  subject: string;
  updated_at_ms: number;
}

export interface WorkerEnvironmentCredentials {
  bundle_hash: string;
  credential_hash: string;
  delivered_at_ms: number | null;
  environment_id: string;
  expires_at_ms: number;
  owner_epoch: number;
  rpc_set_version: number;
  session_id: string | null;
}

export interface WorkerEnvironments {
  attached_session_ids_json: Generated<string>;
  bootstrap_bundle_hash: string | null;
  bootstrap_openclaw_version: string | null;
  bootstrap_protocol_features_json: string | null;
  created_at_ms: number;
  destroy_requested_at_ms: number | null;
  environment_id: string;
  idle_since_at_ms: number | null;
  last_error: string | null;
  lease_id: string | null;
  owner_epoch: Generated<number>;
  profile_id: string;
  profile_snapshot_json: string;
  provider_id: string;
  provision_operation_id: string;
  ssh_host: string | null;
  ssh_host_key: string | null;
  ssh_key_ref_json: string | null;
  ssh_port: number | null;
  ssh_user: string | null;
  state: string;
  state_changed_at_ms: number;
  teardown_terminal_state: string | null;
  updated_at_ms: number;
}

export interface WorkerInferenceTurns {
  created_at_ms: number;
  environment_id: string;
  request_hash: string;
  run_epoch: number;
  run_id: string;
  session_id: string;
  state: string;
  terminal_json: string | null;
  turn_id: string;
  updated_at_ms: number;
}

export interface WorkerSessionPlacements {
  active_owner_epoch: number | null;
  agent_id: string;
  created_at_ms: number;
  environment_id: string | null;
  last_live_event_ack_cursor: number | null;
  last_transcript_ack_cursor: number | null;
  recovery_error: string | null;
  remote_workspace_dir: string | null;
  session_id: string;
  session_key: string;
  state: string;
  state_changed_at_ms: number;
  transition_generation: Generated<number>;
  turn_claim_generation: number | null;
  turn_claim_id: string | null;
  turn_claim_owner: string | null;
  turn_claim_owner_epoch: number | null;
  turn_claim_run_id: string | null;
  updated_at_ms: number;
  worker_bundle_hash: string | null;
  workspace_base_manifest_ref: string | null;
}

export interface WorkerTranscriptCommitHeads {
  environment_id: string;
  next_seq: number;
  run_epoch: number;
  session_id: string;
  updated_at_ms: number;
}

export interface WorkerTranscriptCommits {
  created_at_ms: number;
  request_hash: string;
  result_json: string | null;
  run_epoch: number;
  seq: number;
  session_id: string;
  state: string;
  updated_at_ms: number;
}

export interface WorkerWorkspacePendingResults {
  claim_id: string;
  created_at_ms: number;
  environment_id: string;
  gateway_instance_id: string;
  owner_epoch: number;
  placement_generation: number;
  recovery_requested_at_ms: number | null;
  run_id: string;
  session_id: string;
  staged_result_ref: string | null;
  workspace_accepted_at_ms: number | null;
}

export interface WorkerWorkspaceReconciliations {
  base_manifest_ref: string;
  base_pack: Uint8Array;
  created_at_ms: number;
  current_manifest_ref: string;
  environment_id: string;
  owner_epoch: number;
  placement_generation: number;
  plan_json: string;
  session_id: string;
}

export interface WorkspaceAttestations {
  attested_at_ms: number;
  updated_at_ms: number;
  workspace_key: string;
}

export interface WorkspaceGeneratedBootstrapHashes {
  filename: string;
  sha256: string;
  workspace_key: string;
}

export interface WorkspacePathAliases {
  alias_key: string;
  alias_path: string;
  updated_at_ms: number;
  workspace_key: string;
  workspace_path: string;
}

export interface WorkspaceSetupState {
  bootstrap_seeded_at: string | null;
  setup_completed_at: string | null;
  updated_at: number;
  version: number;
  workspace_key: string;
  workspace_path: string;
}

export interface WorktreeProvisionedFileChunks {
  chunk_index: number;
  data: Uint8Array;
  path: string;
  worktree_id: string;
}

export interface Worktrees {
  base_ref: string;
  branch: string;
  created_at: number;
  id: string;
  last_active_at: number;
  owner_id: string | null;
  owner_kind: string;
  path: string;
  provisioned_paths_json: string | null;
  removed_at: number | null;
  repo_fingerprint: string;
  repo_root: string;
  snapshot_ref: string | null;
}

export interface DB {
  acp_replay_events: AcpReplayEvents;
  acp_replay_sessions: AcpReplaySessions;
  acp_sessions: AcpSessions;
  agent_database_leases: AgentDatabaseLeases;
  agent_databases: AgentDatabases;
  agent_deletion_journal: AgentDeletionJournal;
  agent_model_catalogs: AgentModelCatalogs;
  android_notification_recent_packages: AndroidNotificationRecentPackages;
  apns_registration_tombstones: ApnsRegistrationTombstones;
  apns_registrations: ApnsRegistrations;
  audit_events: AuditEvents;
  audit_identity_keys: AuditIdentityKeys;
  auth_profile_state: AuthProfileState;
  auth_profile_stores: AuthProfileStores;
  backup_runs: BackupRuns;
  capture_blobs: CaptureBlobs;
  capture_events: CaptureEvents;
  capture_sessions: CaptureSessions;
  channel_ingress_events: ChannelIngressEvents;
  channel_pairing_allow_entries: ChannelPairingAllowEntries;
  channel_pairing_requests: ChannelPairingRequests;
  claw_cron_refs: ClawCronRefs;
  claw_installs: ClawInstalls;
  claw_mcp_server_refs: ClawMcpServerRefs;
  claw_package_refs: ClawPackageRefs;
  claw_workspace_files: ClawWorkspaceFiles;
  clawhub_promotion_claims: ClawhubPromotionClaims;
  clawhub_promotions_feed_state: ClawhubPromotionsFeedState;
  command_log_entries: CommandLogEntries;
  commitments: Commitments;
  config_health_entries: ConfigHealthEntries;
  config_machine_state: ConfigMachineState;
  cron_job_scratch: CronJobScratch;
  cron_jobs: CronJobs;
  current_conversation_bindings: CurrentConversationBindings;
  delivery_queue_entries: DeliveryQueueEntries;
  device_auth_tokens: DeviceAuthTokens;
  device_bootstrap_tokens: DeviceBootstrapTokens;
  device_identities: DeviceIdentities;
  device_pairing_paired: DevicePairingPaired;
  device_pairing_pending: DevicePairingPending;
  diagnostic_events: DiagnosticEvents;
  diagnostic_stability_bundles: DiagnosticStabilityBundles;
  exec_approvals_config: ExecApprovalsConfig;
  execution_identity_contexts: ExecutionIdentityContexts;
  fleet_cells: FleetCells;
  flow_runs: FlowRuns;
  gateway_boot_lifecycle: GatewayBootLifecycle;
  gateway_restart_handoff: GatewayRestartHandoff;
  gateway_restart_intent: GatewayRestartIntent;
  gateway_restart_sentinel: GatewayRestartSentinel;
  installed_plugin_index: InstalledPluginIndex;
  macos_port_guardian_records: MacosPortGuardianRecords;
  managed_outgoing_image_records: ManagedOutgoingImageRecords;
  mcp_oauth_stores: McpOauthStores;
  media_blobs: MediaBlobs;
  meeting_transcript_sessions: MeetingTranscriptSessions;
  meeting_transcript_summaries: MeetingTranscriptSummaries;
  meeting_transcript_utterances: MeetingTranscriptUtterances;
  migration_runs: MigrationRuns;
  migration_sources: MigrationSources;
  model_capability_cache: ModelCapabilityCache;
  model_catalog_remote: ModelCatalogRemote;
  native_hook_relay_bridges: NativeHookRelayBridges;
  node_host_config: NodeHostConfig;
  official_external_plugin_catalog_snapshots: OfficialExternalPluginCatalogSnapshots;
  onboarding_recommendations: OnboardingRecommendations;
  operator_approvals: OperatorApprovals;
  outbound_media_provenance: OutboundMediaProvenance;
  plugin_binding_approvals: PluginBindingApprovals;
  plugin_blob_entries: PluginBlobEntries;
  plugin_state_entries: PluginStateEntries;
  sandbox_registry_entries: SandboxRegistryEntries;
  schema_meta: SchemaMeta;
  session_groups: SessionGroups;
  session_state_events: SessionStateEvents;
  session_state_heads: SessionStateHeads;
  session_upstream_links: SessionUpstreamLinks;
  session_watch_cursors: SessionWatchCursors;
  sidebar_sections: SidebarSections;
  skill_curator_state: SkillCuratorState;
  skill_lifecycle: SkillLifecycle;
  skill_upload_chunks: SkillUploadChunks;
  skill_uploads: SkillUploads;
  skill_usage: SkillUsage;
  skill_workshop_proposal_events: SkillWorkshopProposalEvents;
  skill_workshop_proposal_origin_runs: SkillWorkshopProposalOriginRuns;
  skill_workshop_proposal_rollbacks: SkillWorkshopProposalRollbacks;
  skill_workshop_proposals: SkillWorkshopProposals;
  state_leases: StateLeases;
  subagent_runs: SubagentRuns;
  task_delivery_state: TaskDeliveryState;
  task_runs: TaskRuns;
  tui_last_sessions: TuiLastSessions;
  update_check_state: UpdateCheckState;
  voicewake_routing_config: VoicewakeRoutingConfig;
  voicewake_routing_routes: VoicewakeRoutingRoutes;
  voicewake_triggers: VoicewakeTriggers;
  web_push_subscriptions: WebPushSubscriptions;
  web_push_vapid_keys: WebPushVapidKeys;
  worker_environment_credentials: WorkerEnvironmentCredentials;
  worker_environments: WorkerEnvironments;
  worker_inference_turns: WorkerInferenceTurns;
  worker_session_placements: WorkerSessionPlacements;
  worker_transcript_commit_heads: WorkerTranscriptCommitHeads;
  worker_transcript_commits: WorkerTranscriptCommits;
  worker_workspace_pending_results: WorkerWorkspacePendingResults;
  worker_workspace_reconciliations: WorkerWorkspaceReconciliations;
  workspace_attestations: WorkspaceAttestations;
  workspace_generated_bootstrap_hashes: WorkspaceGeneratedBootstrapHashes;
  workspace_path_aliases: WorkspacePathAliases;
  workspace_setup_state: WorkspaceSetupState;
  worktree_provisioned_file_chunks: WorktreeProvisionedFileChunks;
  worktrees: Worktrees;
}
