// This file is auto-generated by @hey-api/openapi-ts

export type ClientOptions = {
  baseUrl: `${string}://${string}` | (string & {});
};

/**
 * AddBackgroundRequest
 *
 * Request model for adding/merging background information. Deprecated: use SetMissionRequest instead.
 */
export type AddBackgroundRequest = {
  /**
   * Content
   *
   * New background information to add or merge
   */
  content: string;
  /**
   * Update Disposition
   *
   * Deprecated - disposition is no longer auto-inferred from mission
   */
  update_disposition?: boolean;
};

/**
 * AsyncOperationSubmitResponse
 *
 * Response model for submitting an async operation.
 */
export type AsyncOperationSubmitResponse = {
  /**
   * Operation Id
   */
  operation_id: string;
  /**
   * Status
   */
  status: string;
};

/**
 * AuditLogEntry
 *
 * A single audit log entry.
 */
export type AuditLogEntry = {
  /**
   * Id
   */
  id: string;
  /**
   * Action
   */
  action: string;
  /**
   * Transport
   */
  transport: string;
  /**
   * Bank Id
   */
  bank_id: string | null;
  /**
   * Started At
   */
  started_at: string | null;
  /**
   * Ended At
   */
  ended_at: string | null;
  /**
   * Duration Ms
   *
   * Server-computed duration in milliseconds (started_at → ended_at). Null if not yet completed.
   */
  duration_ms?: number | null;
  /**
   * Request
   */
  request: {
    [key: string]: unknown;
  } | null;
  /**
   * Response
   */
  response: {
    [key: string]: unknown;
  } | null;
  /**
   * Metadata
   */
  metadata: {
    [key: string]: unknown;
  };
};

/**
 * AuditLogListResponse
 *
 * Response model for list audit logs endpoint.
 */
export type AuditLogListResponse = {
  /**
   * Bank Id
   */
  bank_id: string;
  /**
   * Total
   */
  total: number;
  /**
   * Limit
   */
  limit: number;
  /**
   * Offset
   */
  offset: number;
  /**
   * Items
   */
  items: Array<AuditLogEntry>;
};

/**
 * AuditLogStatsBucket
 *
 * A single time bucket in audit log stats.
 */
export type AuditLogStatsBucket = {
  /**
   * Time
   */
  time: string;
  /**
   * Actions
   */
  actions: {
    [key: string]: number;
  };
  /**
   * Total
   */
  total: number;
};

/**
 * AuditLogStatsResponse
 *
 * Response model for audit log stats endpoint.
 */
export type AuditLogStatsResponse = {
  /**
   * Bank Id
   */
  bank_id: string;
  /**
   * Period
   */
  period: string;
  /**
   * Trunc
   */
  trunc: string;
  /**
   * Start
   */
  start: string;
  /**
   * Buckets
   */
  buckets: Array<AuditLogStatsBucket>;
};

/**
 * BackgroundResponse
 *
 * Response model for background update. Deprecated: use MissionResponse instead.
 */
export type BackgroundResponse = {
  /**
   * Mission
   */
  mission: string;
  /**
   * Background
   *
   * Deprecated: same as mission
   */
  background?: string | null;
  disposition?: DispositionTraits | null;
};

/**
 * BankConfigResponse
 *
 * Response model for bank configuration.
 */
export type BankConfigResponse = {
  /**
   * Bank Id
   *
   * Bank identifier
   */
  bank_id: string;
  /**
   * Config
   *
   * Fully resolved configuration with all hierarchical overrides applied (Python field names)
   */
  config: {
    [key: string]: unknown;
  };
  /**
   * Overrides
   *
   * Bank-specific configuration overrides only (Python field names)
   */
  overrides: {
    [key: string]: unknown;
  };
};

/**
 * BankConfigUpdate
 *
 * Request model for updating bank configuration.
 */
export type BankConfigUpdate = {
  /**
   * Updates
   *
   * Configuration overrides. Keys can be in Python field format (llm_provider) or environment variable format (HINDSIGHT_API_LLM_PROVIDER). Only hierarchical fields can be overridden per-bank.
   */
  updates: {
    [key: string]: unknown;
  };
};

/**
 * BankListItem
 *
 * Bank list item with profile summary.
 */
export type BankListItem = {
  /**
   * Bank Id
   */
  bank_id: string;
  /**
   * Name
   */
  name?: string | null;
  disposition: DispositionTraits;
  /**
   * Mission
   */
  mission?: string | null;
  /**
   * Created At
   */
  created_at?: string | null;
  /**
   * Updated At
   */
  updated_at?: string | null;
};

/**
 * BankListResponse
 *
 * Response model for listing all banks.
 */
export type BankListResponse = {
  /**
   * Banks
   */
  banks: Array<BankListItem>;
};

/**
 * BankProfileResponse
 *
 * Response model for bank profile.
 */
export type BankProfileResponse = {
  /**
   * Bank Id
   */
  bank_id: string;
  /**
   * Name
   */
  name: string;
  disposition: DispositionTraits;
  /**
   * Mission
   *
   * The agent's mission - who they are and what they're trying to accomplish
   */
  mission: string;
  /**
   * Background
   *
   * Deprecated: use mission instead
   */
  background?: string | null;
};

/**
 * BankStatsResponse
 *
 * Response model for bank statistics endpoint.
 */
export type BankStatsResponse = {
  /**
   * Bank Id
   */
  bank_id: string;
  /**
   * Total Nodes
   */
  total_nodes: number;
  /**
   * Total Links
   */
  total_links: number;
  /**
   * Total Documents
   */
  total_documents: number;
  /**
   * Nodes By Fact Type
   */
  nodes_by_fact_type: {
    [key: string]: number;
  };
  /**
   * Links By Link Type
   */
  links_by_link_type: {
    [key: string]: number;
  };
  /**
   * Links By Fact Type
   */
  links_by_fact_type: {
    [key: string]: number;
  };
  /**
   * Links Breakdown
   */
  links_breakdown: {
    [key: string]: {
      [key: string]: number;
    };
  };
  /**
   * Pending Operations
   */
  pending_operations: number;
  /**
   * Failed Operations
   */
  failed_operations: number;
  /**
   * Operations By Status
   *
   * Async operations grouped by status (pending, in_progress, completed, failed, cancelled).
   */
  operations_by_status?: {
    [key: string]: number;
  };
  /**
   * Last Consolidated At
   *
   * When consolidation last ran (ISO format)
   */
  last_consolidated_at?: string | null;
  /**
   * Pending Consolidation
   *
   * Number of memories not yet processed into observations
   */
  pending_consolidation?: number;
  /**
   * Failed Consolidation
   *
   * Number of source memories (world/experience) whose consolidation permanently failed and can be retried via the consolidation recovery endpoint.
   */
  failed_consolidation?: number;
  /**
   * Total Observations
   *
   * Total number of observations
   */
  total_observations?: number;
};

/**
 * BankTemplateConfig
 *
 * Bank configuration fields within a template manifest.
 *
 * Only includes configurable (per-bank) fields. Credential fields
 * (API keys, base URLs) are intentionally excluded for security.
 */
export type BankTemplateConfig = {
  /**
   * Reflect Mission
   *
   * Mission/context for Reflect operations
   */
  reflect_mission?: string | null;
  /**
   * Retain Mission
   *
   * Steers what gets extracted during retain
   */
  retain_mission?: string | null;
  /**
   * Retain Extraction Mode
   *
   * Fact extraction mode: 'concise' (default), 'verbose', or 'custom'
   */
  retain_extraction_mode?: string | null;
  /**
   * Retain Custom Instructions
   *
   * Custom extraction prompt (when mode='custom')
   */
  retain_custom_instructions?: string | null;
  /**
   * Retain Chunk Size
   *
   * Max token size for each content chunk
   */
  retain_chunk_size?: number | null;
  /**
   * Enable Observations
   *
   * Toggle observation consolidation
   */
  enable_observations?: boolean | null;
  /**
   * Observations Mission
   *
   * Controls what gets synthesised
   */
  observations_mission?: string | null;
  /**
   * Disposition Skepticism
   *
   * Skepticism trait (1-5)
   */
  disposition_skepticism?: number | null;
  /**
   * Disposition Literalism
   *
   * Literalism trait (1-5)
   */
  disposition_literalism?: number | null;
  /**
   * Disposition Empathy
   *
   * Empathy trait (1-5)
   */
  disposition_empathy?: number | null;
  /**
   * Entity Labels
   *
   * Controlled vocabulary for entity labels
   */
  entity_labels?: Array<{
    [key: string]: unknown;
  }> | null;
  /**
   * Entities Allow Free Form
   *
   * Allow entities outside the label vocabulary
   */
  entities_allow_free_form?: boolean | null;
  /**
   * Retain Default Strategy
   *
   * Name of the default retain strategy (key into retain_strategies map)
   */
  retain_default_strategy?: string | null;
  /**
   * Retain Strategies
   *
   * Map of retain strategy name to per-strategy config dict
   */
  retain_strategies?: {
    [key: string]: unknown;
  } | null;
  /**
   * Retain Chunk Batch Size
   *
   * Max chunks per streaming batch (0 disables batching)
   */
  retain_chunk_batch_size?: number | null;
  /**
   * Mcp Enabled Tools
   *
   * MCP tool allowlist for this bank (None = all tools)
   */
  mcp_enabled_tools?: Array<string> | null;
  /**
   * Consolidation Llm Batch Size
   *
   * LLM batch size for observation consolidation
   */
  consolidation_llm_batch_size?: number | null;
  /**
   * Consolidation Source Facts Max Tokens
   *
   * Max tokens of source facts per consolidation batch
   */
  consolidation_source_facts_max_tokens?: number | null;
  /**
   * Consolidation Source Facts Max Tokens Per Observation
   *
   * Max tokens of source facts per observation
   */
  consolidation_source_facts_max_tokens_per_observation?: number | null;
  /**
   * Max Observations Per Scope
   *
   * Max observations to retain per consolidation scope
   */
  max_observations_per_scope?: number | null;
  /**
   * Reflect Source Facts Max Tokens
   *
   * Max tokens of source facts per reflect call
   */
  reflect_source_facts_max_tokens?: number | null;
  /**
   * Llm Gemini Safety Settings
   *
   * Per-bank Gemini/VertexAI safety filter settings
   */
  llm_gemini_safety_settings?: Array<unknown> | null;
  /**
   * Recall Budget Function
   *
   * Recall budget mapping function: 'fixed' or 'adaptive'
   */
  recall_budget_function?: string | null;
  /**
   * Recall Budget Fixed Low
   *
   * Fixed thinking_budget for budget=low (function='fixed')
   */
  recall_budget_fixed_low?: number | null;
  /**
   * Recall Budget Fixed Mid
   *
   * Fixed thinking_budget for budget=mid (function='fixed')
   */
  recall_budget_fixed_mid?: number | null;
  /**
   * Recall Budget Fixed High
   *
   * Fixed thinking_budget for budget=high (function='fixed')
   */
  recall_budget_fixed_high?: number | null;
  /**
   * Recall Budget Adaptive Low
   *
   * Ratio of max_tokens for budget=low (function='adaptive')
   */
  recall_budget_adaptive_low?: number | null;
  /**
   * Recall Budget Adaptive Mid
   *
   * Ratio of max_tokens for budget=mid (function='adaptive')
   */
  recall_budget_adaptive_mid?: number | null;
  /**
   * Recall Budget Adaptive High
   *
   * Ratio of max_tokens for budget=high (function='adaptive')
   */
  recall_budget_adaptive_high?: number | null;
  /**
   * Recall Budget Min
   *
   * Floor for the adaptive function (after clamping)
   */
  recall_budget_min?: number | null;
  /**
   * Recall Budget Max
   *
   * Ceiling for the adaptive function (after clamping)
   */
  recall_budget_max?: number | null;
};

/**
 * BankTemplateDirective
 *
 * A directive definition within a bank template manifest.
 *
 * Directives are matched by name on re-import: existing directives
 * with the same name are updated, new ones are created.
 */
export type BankTemplateDirective = {
  /**
   * Name
   *
   * Human-readable name for the directive (used as match key on re-import)
   */
  name: string;
  /**
   * Content
   *
   * The directive text to inject into prompts
   */
  content: string;
  /**
   * Priority
   *
   * Higher priority directives are injected first
   */
  priority?: number;
  /**
   * Is Active
   *
   * Whether this directive is active
   */
  is_active?: boolean;
  /**
   * Tags
   *
   * Tags for filtering
   */
  tags?: Array<string>;
};

/**
 * BankTemplateImportResponse
 *
 * Response model for the bank template import endpoint.
 */
export type BankTemplateImportResponse = {
  /**
   * Bank Id
   *
   * Bank that was imported into
   */
  bank_id: string;
  /**
   * Config Applied
   *
   * Whether bank config was updated
   */
  config_applied: boolean;
  /**
   * Mental Models Created
   *
   * IDs of newly created mental models
   */
  mental_models_created?: Array<string>;
  /**
   * Mental Models Updated
   *
   * IDs of updated mental models
   */
  mental_models_updated?: Array<string>;
  /**
   * Directives Created
   *
   * Names of newly created directives
   */
  directives_created?: Array<string>;
  /**
   * Directives Updated
   *
   * Names of updated directives
   */
  directives_updated?: Array<string>;
  /**
   * Operation Ids
   *
   * Operation IDs for mental model content generation (async)
   */
  operation_ids?: Array<string>;
  /**
   * Dry Run
   *
   * True if this was a validation-only run
   */
  dry_run?: boolean;
};

/**
 * BankTemplateManifest
 *
 * A bank template manifest for import/export.
 *
 * Version field enables forward-compatible schema evolution: the API
 * auto-upgrades older manifest versions to the current schema on import.
 */
export type BankTemplateManifest = {
  /**
   * Version
   *
   * Manifest schema version (currently '1')
   */
  version: string;
  /**
   * Bank configuration to apply. Omit to leave config unchanged.
   */
  bank?: BankTemplateConfig | null;
  /**
   * Mental Models
   *
   * Mental models to create or update (matched by id). Omit to leave unchanged.
   */
  mental_models?: Array<BankTemplateMentalModel> | null;
  /**
   * Directives
   *
   * Directives to create or update (matched by name). Omit to leave unchanged.
   */
  directives?: Array<BankTemplateDirective> | null;
};

/**
 * BankTemplateMentalModel
 *
 * A mental model definition within a bank template manifest.
 */
export type BankTemplateMentalModel = {
  /**
   * Id
   *
   * Unique ID for the mental model (alphanumeric lowercase with hyphens)
   */
  id: string;
  /**
   * Name
   *
   * Human-readable name for the mental model
   */
  name: string;
  /**
   * Source Query
   *
   * The query to run to generate content
   */
  source_query: string;
  /**
   * Tags
   *
   * Tags for scoped visibility
   */
  tags?: Array<string>;
  /**
   * Max Tokens
   *
   * Maximum tokens for generated content
   */
  max_tokens?: number;
  /**
   * Trigger settings
   */
  trigger?: MentalModelTriggerOutput;
};

/**
 * Body_file_retain
 */
export type BodyFileRetain = {
  /**
   * Files
   *
   * Files to upload and convert
   */
  files: Array<Blob | File>;
  /**
   * Request
   *
   * JSON string with FileRetainRequest model
   */
  request: string;
};

/**
 * Budget
 *
 * Budget levels for recall/reflect operations.
 */
export type Budget = "low" | "mid" | "high";

/**
 * CancelOperationResponse
 *
 * Response model for cancel operation endpoint.
 */
export type CancelOperationResponse = {
  /**
   * Success
   */
  success: boolean;
  /**
   * Message
   */
  message: string;
  /**
   * Operation Id
   */
  operation_id: string;
};

/**
 * ChildOperationStatus
 *
 * Status of a child operation (for batch operations).
 */
export type ChildOperationStatus = {
  /**
   * Operation Id
   */
  operation_id: string;
  /**
   * Status
   */
  status: string;
  /**
   * Sub Batch Index
   */
  sub_batch_index?: number | null;
  /**
   * Items Count
   */
  items_count?: number | null;
  /**
   * Error Message
   */
  error_message?: string | null;
};

/**
 * ChunkData
 *
 * Chunk data for a single chunk.
 */
export type ChunkData = {
  /**
   * Id
   */
  id: string;
  /**
   * Text
   */
  text: string;
  /**
   * Chunk Index
   */
  chunk_index: number;
  /**
   * Truncated
   *
   * Whether the chunk text was truncated due to token limits
   */
  truncated?: boolean;
};

/**
 * ChunkIncludeOptions
 *
 * Options for including chunks in recall results.
 */
export type ChunkIncludeOptions = {
  /**
   * Max Tokens
   *
   * Maximum tokens for chunks (chunks may be truncated)
   */
  max_tokens?: number;
};

/**
 * ChunkResponse
 *
 * Response model for get chunk endpoint.
 */
export type ChunkResponse = {
  /**
   * Chunk Id
   */
  chunk_id: string;
  /**
   * Document Id
   */
  document_id: string;
  /**
   * Bank Id
   */
  bank_id: string;
  /**
   * Chunk Index
   */
  chunk_index: number;
  /**
   * Chunk Text
   */
  chunk_text: string;
  /**
   * Created At
   */
  created_at: string;
};

/**
 * ClearMemoryObservationsResponse
 *
 * Response model for clearing observations for a specific memory.
 */
export type ClearMemoryObservationsResponse = {
  /**
   * Deleted Count
   */
  deleted_count: number;
};

/**
 * ConsolidationResponse
 *
 * Response model for consolidation trigger endpoint.
 */
export type ConsolidationResponse = {
  /**
   * Operation Id
   *
   * ID of the async consolidation operation
   */
  operation_id: string;
  /**
   * Deduplicated
   *
   * True if an existing pending task was reused
   */
  deduplicated?: boolean;
};

/**
 * CreateBankRequest
 *
 * Request model for creating/updating a bank.
 */
export type CreateBankRequest = {
  /**
   * Name
   *
   * Deprecated: display label only, not advertised
   */
  name?: string | null;
  /**
   * Deprecated: use update_bank_config instead
   */
  disposition?: DispositionTraits | null;
  /**
   * Disposition Skepticism
   *
   * Deprecated: use update_bank_config instead
   */
  disposition_skepticism?: number | null;
  /**
   * Disposition Literalism
   *
   * Deprecated: use update_bank_config instead
   */
  disposition_literalism?: number | null;
  /**
   * Disposition Empathy
   *
   * Deprecated: use update_bank_config instead
   */
  disposition_empathy?: number | null;
  /**
   * Mission
   *
   * Deprecated: use update_bank_config with reflect_mission instead
   */
  mission?: string | null;
  /**
   * Background
   *
   * Deprecated: use update_bank_config with reflect_mission instead
   */
  background?: string | null;
  /**
   * Reflect Mission
   *
   * Mission/context for Reflect operations. Guides how Reflect interprets and uses memories.
   */
  reflect_mission?: string | null;
  /**
   * Retain Mission
   *
   * Steers what gets extracted during retain(). Injected alongside built-in extraction rules.
   */
  retain_mission?: string | null;
  /**
   * Retain Extraction Mode
   *
   * Fact extraction mode: 'concise' (default), 'verbose', or 'custom'.
   */
  retain_extraction_mode?: string | null;
  /**
   * Retain Custom Instructions
   *
   * Custom extraction prompt. Only active when retain_extraction_mode is 'custom'.
   */
  retain_custom_instructions?: string | null;
  /**
   * Retain Chunk Size
   *
   * Maximum token size for each content chunk during retain.
   */
  retain_chunk_size?: number | null;
  /**
   * Enable Observations
   *
   * Toggle automatic observation consolidation after retain().
   */
  enable_observations?: boolean | null;
  /**
   * Observations Mission
   *
   * Controls what gets synthesised into observations. Replaces built-in consolidation rules entirely.
   */
  observations_mission?: string | null;
};

/**
 * CreateDirectiveRequest
 *
 * Request model for creating a directive.
 */
export type CreateDirectiveRequest = {
  /**
   * Name
   *
   * Human-readable name for the directive
   */
  name: string;
  /**
   * Content
   *
   * The directive text to inject into prompts
   */
  content: string;
  /**
   * Priority
   *
   * Higher priority directives are injected first
   */
  priority?: number;
  /**
   * Is Active
   *
   * Whether this directive is active
   */
  is_active?: boolean;
  /**
   * Tags
   *
   * Tags for filtering
   */
  tags?: Array<string>;
};

/**
 * CreateMentalModelRequest
 *
 * Request model for creating a mental model.
 */
export type CreateMentalModelRequest = {
  /**
   * Id
   *
   * Optional custom ID for the mental model (alphanumeric lowercase with hyphens)
   */
  id?: string | null;
  /**
   * Name
   *
   * Human-readable name for the mental model
   */
  name: string;
  /**
   * Source Query
   *
   * The query to run to generate content
   */
  source_query: string;
  /**
   * Tags
   *
   * Tags for scoped visibility
   */
  tags?: Array<string>;
  /**
   * Max Tokens
   *
   * Maximum tokens for generated content
   */
  max_tokens?: number;
  /**
   * Trigger settings
   */
  trigger?: MentalModelTriggerInput;
};

/**
 * CreateMentalModelResponse
 *
 * Response model for mental model creation.
 */
export type CreateMentalModelResponse = {
  /**
   * Mental Model Id
   *
   * ID of the created mental model
   */
  mental_model_id?: string | null;
  /**
   * Operation Id
   *
   * Operation ID to track refresh progress
   */
  operation_id: string;
};

/**
 * CreateWebhookRequest
 *
 * Request model for registering a webhook.
 */
export type CreateWebhookRequest = {
  /**
   * Url
   *
   * HTTP(S) endpoint URL to deliver events to
   */
  url: string;
  /**
   * Secret
   *
   * HMAC-SHA256 signing secret (optional)
   */
  secret?: string | null;
  /**
   * Event Types
   *
   * List of event types to deliver. Currently supported: 'consolidation.completed'
   */
  event_types?: Array<string>;
  /**
   * Enabled
   *
   * Whether this webhook is active
   */
  enabled?: boolean;
  /**
   * HTTP delivery configuration (method, timeout, headers, params)
   */
  http_config?: WebhookHttpConfig;
};

/**
 * DeleteDocumentResponse
 *
 * Response model for delete document endpoint.
 */
export type DeleteDocumentResponse = {
  /**
   * Success
   */
  success: boolean;
  /**
   * Message
   */
  message: string;
  /**
   * Document Id
   */
  document_id: string;
  /**
   * Memory Units Deleted
   */
  memory_units_deleted: number;
};

/**
 * DeleteResponse
 *
 * Response model for delete operations.
 */
export type DeleteResponse = {
  /**
   * Success
   */
  success: boolean;
  /**
   * Message
   */
  message?: string | null;
  /**
   * Deleted Count
   */
  deleted_count?: number | null;
};

/**
 * DirectiveListResponse
 *
 * Response model for listing directives.
 */
export type DirectiveListResponse = {
  /**
   * Items
   */
  items: Array<DirectiveResponse>;
};

/**
 * DirectiveResponse
 *
 * Response model for a directive.
 */
export type DirectiveResponse = {
  /**
   * Id
   */
  id: string;
  /**
   * Bank Id
   */
  bank_id: string;
  /**
   * Name
   */
  name: string;
  /**
   * Content
   */
  content: string;
  /**
   * Priority
   */
  priority?: number;
  /**
   * Is Active
   */
  is_active?: boolean;
  /**
   * Tags
   */
  tags?: Array<string>;
  /**
   * Created At
   */
  created_at?: string | null;
  /**
   * Updated At
   */
  updated_at?: string | null;
};

/**
 * DispositionTraits
 *
 * Disposition traits that influence how memories are formed and interpreted.
 */
export type DispositionTraits = {
  /**
   * Skepticism
   *
   * How skeptical vs trusting (1=trusting, 5=skeptical)
   */
  skepticism: number;
  /**
   * Literalism
   *
   * How literally to interpret information (1=flexible, 5=literal)
   */
  literalism: number;
  /**
   * Empathy
   *
   * How much to consider emotional context (1=detached, 5=empathetic)
   */
  empathy: number;
};

/**
 * DocumentResponse
 *
 * Response model for get document endpoint.
 */
export type DocumentResponse = {
  /**
   * Id
   */
  id: string;
  /**
   * Bank Id
   */
  bank_id: string;
  /**
   * Original Text
   */
  original_text: string;
  /**
   * Content Hash
   */
  content_hash: string | null;
  /**
   * Created At
   */
  created_at: string;
  /**
   * Updated At
   */
  updated_at: string;
  /**
   * Memory Unit Count
   */
  memory_unit_count: number;
  /**
   * Tags
   *
   * Tags associated with this document
   */
  tags?: Array<string>;
  /**
   * Document Metadata
   *
   * Document metadata
   */
  document_metadata?: {
    [key: string]: unknown;
  } | null;
  /**
   * Retain Params
   *
   * Parameters used during retain
   */
  retain_params?: {
    [key: string]: unknown;
  } | null;
};

/**
 * EntityDetailResponse
 *
 * Response model for entity detail endpoint.
 */
export type EntityDetailResponse = {
  /**
   * Id
   */
  id: string;
  /**
   * Canonical Name
   */
  canonical_name: string;
  /**
   * Mention Count
   */
  mention_count: number;
  /**
   * First Seen
   */
  first_seen?: string | null;
  /**
   * Last Seen
   */
  last_seen?: string | null;
  /**
   * Metadata
   */
  metadata?: {
    [key: string]: unknown;
  } | null;
  /**
   * Observations
   */
  observations: Array<EntityObservationResponse>;
};

/**
 * EntityGraphResponse
 *
 * Response model for entity co-occurrence graph endpoint.
 */
export type EntityGraphResponse = {
  /**
   * Nodes
   */
  nodes: Array<{
    [key: string]: unknown;
  }>;
  /**
   * Edges
   */
  edges: Array<{
    [key: string]: unknown;
  }>;
  /**
   * Total Entities
   */
  total_entities: number;
  /**
   * Total Edges
   */
  total_edges: number;
  /**
   * Limit
   */
  limit: number;
};

/**
 * EntityIncludeOptions
 *
 * Options for including entity observations in recall results.
 */
export type EntityIncludeOptions = {
  /**
   * Max Tokens
   *
   * Maximum tokens for entity observations
   */
  max_tokens?: number;
};

/**
 * EntityInput
 *
 * Entity to associate with retained content.
 */
export type EntityInput = {
  /**
   * Text
   *
   * The entity name/text
   */
  text: string;
  /**
   * Type
   *
   * Optional entity type (e.g., 'PERSON', 'ORG', 'CONCEPT')
   */
  type?: string | null;
};

/**
 * EntityListItem
 *
 * Entity list item with summary.
 */
export type EntityListItem = {
  /**
   * Id
   */
  id: string;
  /**
   * Canonical Name
   */
  canonical_name: string;
  /**
   * Mention Count
   */
  mention_count: number;
  /**
   * First Seen
   */
  first_seen?: string | null;
  /**
   * Last Seen
   */
  last_seen?: string | null;
  /**
   * Metadata
   */
  metadata?: {
    [key: string]: unknown;
  } | null;
};

/**
 * EntityListResponse
 *
 * Response model for entity list endpoint.
 */
export type EntityListResponse = {
  /**
   * Items
   */
  items: Array<EntityListItem>;
  /**
   * Total
   */
  total: number;
  /**
   * Limit
   */
  limit: number;
  /**
   * Offset
   */
  offset: number;
};

/**
 * EntityObservationResponse
 *
 * An observation about an entity.
 */
export type EntityObservationResponse = {
  /**
   * Text
   */
  text: string;
  /**
   * Mentioned At
   */
  mentioned_at?: string | null;
};

/**
 * EntityStateResponse
 *
 * Current mental model of an entity.
 */
export type EntityStateResponse = {
  /**
   * Entity Id
   */
  entity_id: string;
  /**
   * Canonical Name
   */
  canonical_name: string;
  /**
   * Observations
   */
  observations: Array<EntityObservationResponse>;
};

/**
 * FactsIncludeOptions
 *
 * Options for including facts (based_on) in reflect results.
 */
export type FactsIncludeOptions = {
  [key: string]: unknown;
};

/**
 * FeaturesInfo
 *
 * Feature flags indicating which capabilities are enabled.
 */
export type FeaturesInfo = {
  /**
   * Observations
   *
   * Whether observations (auto-consolidation) are enabled
   */
  observations: boolean;
  /**
   * Mcp
   *
   * Whether MCP (Model Context Protocol) server is enabled
   */
  mcp: boolean;
  /**
   * Worker
   *
   * Whether the background worker is enabled
   */
  worker: boolean;
  /**
   * Bank Config Api
   *
   * Whether per-bank configuration API is enabled
   */
  bank_config_api: boolean;
  /**
   * File Upload Api
   *
   * Whether file upload/conversion API is enabled
   */
  file_upload_api: boolean;
};

/**
 * FileRetainResponse
 *
 * Response model for file upload endpoint.
 */
export type FileRetainResponse = {
  /**
   * Operation Ids
   *
   * Operation IDs for tracking file conversion operations. Use GET /v1/default/banks/{bank_id}/operations to list operations.
   */
  operation_ids: Array<string>;
};

/**
 * GraphDataResponse
 *
 * Response model for graph data endpoint.
 */
export type GraphDataResponse = {
  /**
   * Nodes
   */
  nodes: Array<{
    [key: string]: unknown;
  }>;
  /**
   * Edges
   */
  edges: Array<{
    [key: string]: unknown;
  }>;
  /**
   * Table Rows
   */
  table_rows: Array<{
    [key: string]: unknown;
  }>;
  /**
   * Total Units
   */
  total_units: number;
  /**
   * Limit
   */
  limit: number;
};

/**
 * HTTPValidationError
 */
export type HttpValidationError = {
  /**
   * Detail
   */
  detail?: Array<ValidationError>;
};

/**
 * IncludeOptions
 *
 * Options for including additional data in recall results.
 */
export type IncludeOptions = {
  /**
   * Include entity observations. Set to null to disable entity inclusion.
   */
  entities?: EntityIncludeOptions | null;
  /**
   * Include raw chunks. Set to {} to enable, null to disable (default: disabled).
   */
  chunks?: ChunkIncludeOptions | null;
  /**
   * Include source facts for observation-type results. Set to {} to enable, null to disable (default: disabled).
   */
  source_facts?: SourceFactsIncludeOptions | null;
};

/**
 * ListDocumentsResponse
 *
 * Response model for list documents endpoint.
 */
export type ListDocumentsResponse = {
  /**
   * Items
   */
  items: Array<{
    [key: string]: unknown;
  }>;
  /**
   * Total
   */
  total: number;
  /**
   * Limit
   */
  limit: number;
  /**
   * Offset
   */
  offset: number;
};

/**
 * ListMemoryUnitsResponse
 *
 * Response model for list memory units endpoint.
 */
export type ListMemoryUnitsResponse = {
  /**
   * Items
   */
  items: Array<{
    [key: string]: unknown;
  }>;
  /**
   * Total
   */
  total: number;
  /**
   * Limit
   */
  limit: number;
  /**
   * Offset
   */
  offset: number;
};

/**
 * ListTagsResponse
 *
 * Response model for list tags endpoint.
 */
export type ListTagsResponse = {
  /**
   * Items
   */
  items: Array<TagItem>;
  /**
   * Total
   */
  total: number;
  /**
   * Limit
   */
  limit: number;
  /**
   * Offset
   */
  offset: number;
};

/**
 * MemoriesTimeseriesResponse
 *
 * Time-series of memory ingestion bucketed by time and fact type.
 */
export type MemoriesTimeseriesResponse = {
  /**
   * Bank Id
   */
  bank_id: string;
  /**
   * Period
   *
   * One of: 1h, 12h, 1d, 7d, 30d, 90d.
   */
  period: string;
  /**
   * Trunc
   *
   * Bucket granularity: minute, hour, day.
   */
  trunc: string;
  /**
   * Buckets
   *
   * Per-bucket counts, always returned fully padded for the requested period.
   */
  buckets?: Array<MemoryTimeseriesBucket>;
};

/**
 * MemoryItem
 *
 * Single memory item for retain.
 */
export type MemoryItem = {
  /**
   * Content
   */
  content: string;
  /**
   * Timestamp
   *
   * When the content occurred. Accepts an ISO 8601 datetime string (e.g. '2024-01-15T10:30:00Z'), null/omitted (defaults to now), or the special string 'unset' to explicitly store without any timestamp (use this for timeless content such as fictional documents or static reference material).
   */
  timestamp?: string | null;
  /**
   * Context
   */
  context?: string | null;
  /**
   * Metadata
   */
  metadata?: {
    [key: string]: string;
  } | null;
  /**
   * Document Id
   *
   * Optional document ID for this memory item.
   */
  document_id?: string | null;
  /**
   * Entities
   *
   * Optional entities to combine with auto-extracted entities.
   */
  entities?: Array<EntityInput> | null;
  /**
   * Tags
   *
   * Optional tags for visibility scoping. Memories with tags can be filtered during recall.
   */
  tags?: Array<string> | null;
  /**
   * ObservationScopes
   *
   * How to scope observations during consolidation. 'per_tag' runs one consolidation pass per individual tag, creating separate observations for each tag. 'combined' (default) runs a single pass with all tags together. A list of tag lists runs one pass per inner list, giving full control over which combinations to use.
   */
  observation_scopes?:
    | "per_tag"
    | "combined"
    | "all_combinations"
    | Array<Array<string>>
    | null;
  /**
   * Strategy
   *
   * Named retain strategy for this item. Overrides the bank's default strategy for this item only. Strategies are defined in the bank config under 'retain_strategies'.
   */
  strategy?: string | null;
  /**
   * Update Mode
   *
   * How to handle an existing document with the same document_id. 'replace' (default) deletes old data and reprocesses from scratch. 'append' concatenates new content to the existing document text and reprocesses.
   */
  update_mode?: "replace" | "append" | null;
};

/**
 * MemoryTimeseriesBucket
 *
 * One bucket in the memory ingestion time-series.
 */
export type MemoryTimeseriesBucket = {
  /**
   * Time
   *
   * Bucket start timestamp in ISO-8601 (UTC).
   */
  time: string;
  /**
   * World
   *
   * World-fact memories ingested in this bucket.
   */
  world?: number;
  /**
   * Experience
   *
   * Experience memories ingested in this bucket.
   */
  experience?: number;
  /**
   * Observation
   *
   * Observations recorded in this bucket.
   */
  observation?: number;
};

/**
 * MentalModelListResponse
 *
 * Response model for listing mental models.
 */
export type MentalModelListResponse = {
  /**
   * Items
   */
  items: Array<MentalModelResponse>;
};

/**
 * MentalModelResponse
 *
 * Response model for a mental model (stored reflect response).
 */
export type MentalModelResponse = {
  /**
   * Id
   */
  id: string;
  /**
   * Bank Id
   */
  bank_id: string;
  /**
   * Name
   */
  name: string;
  /**
   * Source Query
   */
  source_query?: string | null;
  /**
   * Content
   *
   * The mental model content as well-formatted markdown (auto-generated from reflect endpoint)
   */
  content?: string | null;
  /**
   * Tags
   */
  tags?: Array<string>;
  /**
   * Max Tokens
   */
  max_tokens?: number | null;
  trigger?: MentalModelTriggerOutput | null;
  /**
   * Last Refreshed At
   */
  last_refreshed_at?: string | null;
  /**
   * Created At
   */
  created_at?: string | null;
  /**
   * Reflect Response
   *
   * Full reflect API response payload including based_on facts and observations
   */
  reflect_response?: {
    [key: string]: unknown;
  } | null;
  /**
   * Is Stale
   *
   * True when new memories matching this mental model's tag/fact_type scope have been ingested since last_refreshed_at, or consolidation has pending items. Only populated when detail=full.
   */
  is_stale?: boolean | null;
};

/**
 * MentalModelTrigger
 *
 * Trigger settings for a mental model.
 */
export type MentalModelTriggerInput = {
  /**
   * Mode
   *
   * Refresh mode. 'full' (default) regenerates the mental model content from scratch on each refresh. 'delta' performs surgical edits against the existing content: unchanged sections are preserved byte-for-byte, stale content is removed, new content is added. If the mental model has no existing content, or if the source_query has changed since the last refresh, delta mode falls back to a full regeneration automatically.
   */
  mode?: "full" | "delta";
  /**
   * Refresh After Consolidation
   *
   * If true, refresh this mental model after observations consolidation (real-time mode)
   */
  refresh_after_consolidation?: boolean;
  /**
   * Fact Types
   *
   * Filter which fact types are retrieved during reflect. None means all types (world, experience, observation).
   */
  fact_types?: Array<"world" | "experience" | "observation"> | null;
  /**
   * Exclude Mental Models
   *
   * If true, exclude all mental models from the reflect loop (skip search_mental_models tool).
   */
  exclude_mental_models?: boolean;
  /**
   * Exclude Mental Model Ids
   *
   * Exclude specific mental models by ID from the reflect loop.
   */
  exclude_mental_model_ids?: Array<string> | null;
  /**
   * Tags Match
   *
   * Override how the model's tags filter memories during refresh. If not set, defaults to 'all_strict' when the model has tags (security isolation) or 'any' when the model has no tags. Set to 'any' to include untagged memories alongside tagged ones during refresh.
   */
  tags_match?: "any" | "all" | "any_strict" | "all_strict" | null;
  /**
   * Tag Groups
   *
   * Compound boolean tag expressions to use during refresh instead of the model's own tags. When set, these tag groups are passed to reflect and the model's flat tags are NOT used for filtering. Supports nested and/or/not expressions for complex tag-based scoping.
   */
  tag_groups?: Array<
    TagGroupLeaf | TagGroupAndInput | TagGroupOrInput | TagGroupNotInput
  > | null;
  /**
   * Include Chunks
   *
   * Override whether the internal recall used during refresh returns raw chunk text. None means use the bank/global config default (recall_include_chunks).
   */
  include_chunks?: boolean | null;
  /**
   * Recall Max Tokens
   *
   * Override the token budget for facts returned by the internal recall during refresh. None means use the bank/global config default (recall_max_tokens).
   */
  recall_max_tokens?: number | null;
  /**
   * Recall Chunks Max Tokens
   *
   * Override the token budget for raw chunks returned by the internal recall during refresh. None means use the bank/global config default (recall_chunks_max_tokens).
   */
  recall_chunks_max_tokens?: number | null;
};

/**
 * MentalModelTrigger
 *
 * Trigger settings for a mental model.
 */
export type MentalModelTriggerOutput = {
  /**
   * Mode
   *
   * Refresh mode. 'full' (default) regenerates the mental model content from scratch on each refresh. 'delta' performs surgical edits against the existing content: unchanged sections are preserved byte-for-byte, stale content is removed, new content is added. If the mental model has no existing content, or if the source_query has changed since the last refresh, delta mode falls back to a full regeneration automatically.
   */
  mode?: "full" | "delta";
  /**
   * Refresh After Consolidation
   *
   * If true, refresh this mental model after observations consolidation (real-time mode)
   */
  refresh_after_consolidation?: boolean;
  /**
   * Fact Types
   *
   * Filter which fact types are retrieved during reflect. None means all types (world, experience, observation).
   */
  fact_types?: Array<"world" | "experience" | "observation"> | null;
  /**
   * Exclude Mental Models
   *
   * If true, exclude all mental models from the reflect loop (skip search_mental_models tool).
   */
  exclude_mental_models?: boolean;
  /**
   * Exclude Mental Model Ids
   *
   * Exclude specific mental models by ID from the reflect loop.
   */
  exclude_mental_model_ids?: Array<string> | null;
  /**
   * Tags Match
   *
   * Override how the model's tags filter memories during refresh. If not set, defaults to 'all_strict' when the model has tags (security isolation) or 'any' when the model has no tags. Set to 'any' to include untagged memories alongside tagged ones during refresh.
   */
  tags_match?: "any" | "all" | "any_strict" | "all_strict" | null;
  /**
   * Tag Groups
   *
   * Compound boolean tag expressions to use during refresh instead of the model's own tags. When set, these tag groups are passed to reflect and the model's flat tags are NOT used for filtering. Supports nested and/or/not expressions for complex tag-based scoping.
   */
  tag_groups?: Array<
    TagGroupLeaf | TagGroupAndOutput | TagGroupOrOutput | TagGroupNotOutput
  > | null;
  /**
   * Include Chunks
   *
   * Override whether the internal recall used during refresh returns raw chunk text. None means use the bank/global config default (recall_include_chunks).
   */
  include_chunks?: boolean | null;
  /**
   * Recall Max Tokens
   *
   * Override the token budget for facts returned by the internal recall during refresh. None means use the bank/global config default (recall_max_tokens).
   */
  recall_max_tokens?: number | null;
  /**
   * Recall Chunks Max Tokens
   *
   * Override the token budget for raw chunks returned by the internal recall during refresh. None means use the bank/global config default (recall_chunks_max_tokens).
   */
  recall_chunks_max_tokens?: number | null;
};

/**
 * OperationResponse
 *
 * Response model for a single async operation.
 */
export type OperationResponse = {
  /**
   * Id
   */
  id: string;
  /**
   * Task Type
   */
  task_type: string;
  /**
   * Items Count
   */
  items_count: number;
  /**
   * Document Id
   */
  document_id?: string | null;
  /**
   * Created At
   */
  created_at: string;
  /**
   * Status
   */
  status: string;
  /**
   * Error Message
   */
  error_message: string | null;
};

/**
 * OperationStatusResponse
 *
 * Response model for getting a single operation status.
 */
export type OperationStatusResponse = {
  /**
   * Operation Id
   */
  operation_id: string;
  /**
   * Status
   */
  status: "pending" | "completed" | "failed" | "not_found";
  /**
   * Operation Type
   */
  operation_type?: string | null;
  /**
   * Created At
   */
  created_at?: string | null;
  /**
   * Updated At
   */
  updated_at?: string | null;
  /**
   * Completed At
   */
  completed_at?: string | null;
  /**
   * Error Message
   */
  error_message?: string | null;
  /**
   * Result Metadata
   *
   * Internal metadata for debugging. Structure may change without notice. Not for production use.
   */
  result_metadata?: {
    [key: string]: unknown;
  } | null;
  /**
   * Child Operations
   *
   * Child operations for batch operations (if applicable)
   */
  child_operations?: Array<ChildOperationStatus> | null;
  /**
   * Task Payload
   *
   * Raw task payload (params the operation was submitted with). Only populated when include_payload=true.
   */
  task_payload?: {
    [key: string]: unknown;
  } | null;
};

/**
 * OperationsListResponse
 *
 * Response model for list operations endpoint.
 */
export type OperationsListResponse = {
  /**
   * Bank Id
   */
  bank_id: string;
  /**
   * Total
   */
  total: number;
  /**
   * Limit
   */
  limit: number;
  /**
   * Offset
   */
  offset: number;
  /**
   * Operations
   */
  operations: Array<OperationResponse>;
};

/**
 * RecallRequest
 *
 * Request model for recall endpoint.
 */
export type RecallRequest = {
  /**
   * Query
   */
  query: string;
  /**
   * Types
   *
   * List of fact types to recall: 'world', 'experience', 'observation'. Defaults to world and experience if not specified.
   */
  types?: Array<string> | null;
  budget?: Budget;
  /**
   * Max Tokens
   */
  max_tokens?: number;
  /**
   * Trace
   */
  trace?: boolean;
  /**
   * Query Timestamp
   *
   * ISO format date string (e.g., '2023-05-30T23:40:00')
   */
  query_timestamp?: string | null;
  /**
   * Options for including additional data (entities are included by default)
   */
  include?: IncludeOptions;
  /**
   * Tags
   *
   * Filter memories by tags. If not specified, all memories are returned.
   */
  tags?: Array<string> | null;
  /**
   * Tags Match
   *
   * How to match tags: 'any' (OR, includes untagged), 'all' (AND, includes untagged), 'any_strict' (OR, excludes untagged), 'all_strict' (AND, excludes untagged).
   */
  tags_match?: "any" | "all" | "any_strict" | "all_strict";
  /**
   * Tag Groups
   *
   * Compound tag filter using boolean groups. Groups in the list are AND-ed. Each group is a leaf {tags, match} or compound {and: [...]}, {or: [...]}, {not: ...}.
   */
  tag_groups?: Array<
    TagGroupLeaf | TagGroupAndInput | TagGroupOrInput | TagGroupNotInput
  > | null;
};

/**
 * RecallResponse
 *
 * Response model for recall endpoints.
 */
export type RecallResponse = {
  /**
   * Results
   */
  results: Array<RecallResult>;
  /**
   * Trace
   */
  trace?: {
    [key: string]: unknown;
  } | null;
  /**
   * Entities
   *
   * Entity states for entities mentioned in results
   */
  entities?: {
    [key: string]: EntityStateResponse;
  } | null;
  /**
   * Chunks
   *
   * Chunks for facts, keyed by chunk_id
   */
  chunks?: {
    [key: string]: ChunkData;
  } | null;
  /**
   * Source Facts
   *
   * Source facts for observation-type results, keyed by fact ID
   */
  source_facts?: {
    [key: string]: RecallResult;
  } | null;
};

/**
 * RecallResult
 *
 * Single recall result item.
 */
export type RecallResult = {
  /**
   * Id
   */
  id: string;
  /**
   * Text
   */
  text: string;
  /**
   * Type
   */
  type?: string | null;
  /**
   * Entities
   */
  entities?: Array<string> | null;
  /**
   * Context
   */
  context?: string | null;
  /**
   * Occurred Start
   */
  occurred_start?: string | null;
  /**
   * Occurred End
   */
  occurred_end?: string | null;
  /**
   * Mentioned At
   */
  mentioned_at?: string | null;
  /**
   * Document Id
   */
  document_id?: string | null;
  /**
   * Metadata
   */
  metadata?: {
    [key: string]: string;
  } | null;
  /**
   * Chunk Id
   */
  chunk_id?: string | null;
  /**
   * Tags
   */
  tags?: Array<string> | null;
  /**
   * Source Fact Ids
   */
  source_fact_ids?: Array<string> | null;
};

/**
 * RecoverConsolidationResponse
 *
 * Response model for recovering failed consolidation.
 */
export type RecoverConsolidationResponse = {
  /**
   * Retried Count
   */
  retried_count: number;
};

/**
 * ReflectBasedOn
 *
 * Evidence the response is based on: memories, mental models, and directives.
 */
export type ReflectBasedOn = {
  /**
   * Memories
   *
   * Memory facts used to generate the response
   */
  memories?: Array<ReflectFact>;
  /**
   * Mental Models
   *
   * Mental models used during reflection
   */
  mental_models?: Array<ReflectMentalModel>;
  /**
   * Directives
   *
   * Directives applied during reflection
   */
  directives?: Array<ReflectDirective>;
};

/**
 * ReflectDirective
 *
 * A directive applied during reflect.
 */
export type ReflectDirective = {
  /**
   * Id
   *
   * Directive ID
   */
  id: string;
  /**
   * Name
   *
   * Directive name
   */
  name: string;
  /**
   * Content
   *
   * Directive content
   */
  content: string;
};

/**
 * ReflectFact
 *
 * A fact used in think response.
 */
export type ReflectFact = {
  /**
   * Id
   */
  id?: string | null;
  /**
   * Text
   *
   * Fact text. When type='observation', this contains markdown-formatted consolidated knowledge
   */
  text: string;
  /**
   * Type
   */
  type?: string | null;
  /**
   * Context
   */
  context?: string | null;
  /**
   * Occurred Start
   */
  occurred_start?: string | null;
  /**
   * Occurred End
   */
  occurred_end?: string | null;
};

/**
 * ReflectIncludeOptions
 *
 * Options for including additional data in reflect results.
 */
export type ReflectIncludeOptions = {
  /**
   * Include facts that the answer is based on. Set to {} to enable, null to disable (default: disabled).
   */
  facts?: FactsIncludeOptions | null;
  /**
   * Include tool calls trace. Set to {} for full trace (input+output), {output: false} for inputs only.
   */
  tool_calls?: ToolCallsIncludeOptions | null;
};

/**
 * ReflectLLMCall
 *
 * An LLM call made during reflect agent execution.
 */
export type ReflectLlmCall = {
  /**
   * Scope
   *
   * Call scope: agent_1, agent_2, final, etc.
   */
  scope: string;
  /**
   * Duration Ms
   *
   * Execution time in milliseconds
   */
  duration_ms: number;
};

/**
 * ReflectMentalModel
 *
 * A mental model used during reflect.
 */
export type ReflectMentalModel = {
  /**
   * Id
   *
   * Mental model ID
   */
  id: string;
  /**
   * Text
   *
   * Mental model content
   */
  text: string;
  /**
   * Context
   *
   * Additional context
   */
  context?: string | null;
};

/**
 * ReflectRequest
 *
 * Request model for reflect endpoint.
 */
export type ReflectRequest = {
  /**
   * Query
   */
  query: string;
  budget?: Budget;
  /**
   * Context
   *
   * DEPRECATED: Additional context is now concatenated with the query. Pass context directly in the query field instead. If provided, it will be appended to the query for backward compatibility.
   *
   * @deprecated
   */
  context?: string | null;
  /**
   * Max Tokens
   *
   * Maximum tokens for the response
   */
  max_tokens?: number;
  /**
   * Options for including additional data (disabled by default)
   */
  include?: ReflectIncludeOptions;
  /**
   * Response Schema
   *
   * Optional JSON Schema for structured output. When provided, the response will include a 'structured_output' field with the LLM response parsed according to this schema.
   */
  response_schema?: {
    [key: string]: unknown;
  } | null;
  /**
   * Tags
   *
   * Filter memories by tags during reflection. If not specified, all memories are considered.
   */
  tags?: Array<string> | null;
  /**
   * Tags Match
   *
   * How to match tags: 'any' (OR, includes untagged), 'all' (AND, includes untagged), 'any_strict' (OR, excludes untagged), 'all_strict' (AND, excludes untagged).
   */
  tags_match?: "any" | "all" | "any_strict" | "all_strict";
  /**
   * Tag Groups
   *
   * Compound tag filter using boolean groups. Groups in the list are AND-ed. Each group is a leaf {tags, match} or compound {and: [...]}, {or: [...]}, {not: ...}.
   */
  tag_groups?: Array<
    TagGroupLeaf | TagGroupAndInput | TagGroupOrInput | TagGroupNotInput
  > | null;
  /**
   * Fact Types
   *
   * Filter which fact types are retrieved during reflect. None means all types (world, experience, observation).
   */
  fact_types?: Array<"world" | "experience" | "observation"> | null;
  /**
   * Exclude Mental Models
   *
   * If true, exclude all mental models from the reflect loop (skip search_mental_models tool).
   */
  exclude_mental_models?: boolean;
  /**
   * Exclude Mental Model Ids
   *
   * Exclude specific mental models by ID from the reflect loop.
   */
  exclude_mental_model_ids?: Array<string> | null;
};

/**
 * ReflectResponse
 *
 * Response model for think endpoint.
 */
export type ReflectResponse = {
  /**
   * Text
   *
   * The reflect response as well-formatted markdown (headers, lists, bold/italic, code blocks, etc.)
   */
  text: string;
  /**
   * Evidence used to generate the response. Only present when include.facts is set.
   */
  based_on?: ReflectBasedOn | null;
  /**
   * Structured Output
   *
   * Structured output parsed according to the request's response_schema. Only present when response_schema was provided in the request.
   */
  structured_output?: {
    [key: string]: unknown;
  } | null;
  /**
   * Token usage metrics for LLM calls during reflection.
   */
  usage?: TokenUsage | null;
  /**
   * Execution trace of tool and LLM calls. Only present when include.tool_calls is set.
   */
  trace?: ReflectTrace | null;
};

/**
 * ReflectToolCall
 *
 * A tool call made during reflect agent execution.
 */
export type ReflectToolCall = {
  /**
   * Tool
   *
   * Tool name: lookup, recall, learn, expand
   */
  tool: string;
  /**
   * Input
   *
   * Tool input parameters
   */
  input: {
    [key: string]: unknown;
  };
  /**
   * Output
   *
   * Tool output (only included when include.tool_calls.output is true)
   */
  output?: {
    [key: string]: unknown;
  } | null;
  /**
   * Duration Ms
   *
   * Execution time in milliseconds
   */
  duration_ms: number;
  /**
   * Iteration
   *
   * Iteration number (1-based) when this tool was called
   */
  iteration?: number;
};

/**
 * ReflectTrace
 *
 * Execution trace of LLM and tool calls during reflection.
 */
export type ReflectTrace = {
  /**
   * Tool Calls
   *
   * Tool calls made during reflection
   */
  tool_calls?: Array<ReflectToolCall>;
  /**
   * Llm Calls
   *
   * LLM calls made during reflection
   */
  llm_calls?: Array<ReflectLlmCall>;
};

/**
 * RetainRequest
 *
 * Request model for retain endpoint.
 */
export type RetainRequest = {
  /**
   * Items
   */
  items: Array<MemoryItem>;
  /**
   * Async
   *
   * If true, process asynchronously in background. If false, wait for completion (default: false)
   */
  async?: boolean;
  /**
   * Document Tags
   *
   * Deprecated. Use item-level tags instead.
   *
   * @deprecated
   */
  document_tags?: Array<string> | null;
};

/**
 * RetainResponse
 *
 * Response model for retain endpoint.
 */
export type RetainResponse = {
  /**
   * Success
   */
  success: boolean;
  /**
   * Bank Id
   */
  bank_id: string;
  /**
   * Items Count
   */
  items_count: number;
  /**
   * Async
   *
   * Whether the operation was processed asynchronously
   */
  async: boolean;
  /**
   * Operation Id
   *
   * Operation ID for tracking async operations. Use GET /v1/default/banks/{bank_id}/operations to list operations. Only present when async=true. When items use different per-item strategies, use operation_ids instead.
   */
  operation_id?: string | null;
  /**
   * Operation Ids
   *
   * Operation IDs when items were submitted as multiple strategy groups (async=true with mixed per-item strategies). operation_id is set to the first entry for backward compatibility.
   */
  operation_ids?: Array<string> | null;
  /**
   * Token usage metrics for LLM calls during fact extraction (only present for synchronous operations)
   */
  usage?: TokenUsage | null;
};

/**
 * RetryOperationResponse
 *
 * Response model for retry operation endpoint.
 */
export type RetryOperationResponse = {
  /**
   * Success
   */
  success: boolean;
  /**
   * Message
   */
  message: string;
  /**
   * Operation Id
   */
  operation_id: string;
};

/**
 * SourceFactsIncludeOptions
 *
 * Options for including source facts for observation-type results.
 */
export type SourceFactsIncludeOptions = {
  /**
   * Max Tokens
   *
   * Maximum total tokens for source facts across all observations (-1 = unlimited)
   */
  max_tokens?: number;
  /**
   * Max Tokens Per Observation
   *
   * Maximum tokens of source facts per observation (-1 = unlimited)
   */
  max_tokens_per_observation?: number;
};

/**
 * TagGroupAnd
 *
 * Compound AND group: all child filters must match.
 */
export type TagGroupAndInput = {
  /**
   * And
   */
  and: Array<
    TagGroupLeaf | TagGroupAndInput | TagGroupOrInput | TagGroupNotInput
  >;
};

/**
 * TagGroupAnd
 *
 * Compound AND group: all child filters must match.
 */
export type TagGroupAndOutput = {
  /**
   * And
   */
  and: Array<
    TagGroupLeaf | TagGroupAndOutput | TagGroupOrOutput | TagGroupNotOutput
  >;
};

/**
 * TagGroupLeaf
 *
 * A leaf tag filter: matches memories by tag list and match mode.
 */
export type TagGroupLeaf = {
  /**
   * Tags
   */
  tags: Array<string>;
  /**
   * Match
   */
  match?: "any" | "all" | "any_strict" | "all_strict";
};

/**
 * TagGroupNot
 *
 * Compound NOT group: child filter must NOT match.
 */
export type TagGroupNotInput = {
  /**
   * Not
   */
  not: TagGroupLeaf | TagGroupAndInput | TagGroupOrInput | TagGroupNotInput;
};

/**
 * TagGroupNot
 *
 * Compound NOT group: child filter must NOT match.
 */
export type TagGroupNotOutput = {
  /**
   * Not
   */
  not: TagGroupLeaf | TagGroupAndOutput | TagGroupOrOutput | TagGroupNotOutput;
};

/**
 * TagGroupOr
 *
 * Compound OR group: at least one child filter must match.
 */
export type TagGroupOrInput = {
  /**
   * Or
   */
  or: Array<
    TagGroupLeaf | TagGroupAndInput | TagGroupOrInput | TagGroupNotInput
  >;
};

/**
 * TagGroupOr
 *
 * Compound OR group: at least one child filter must match.
 */
export type TagGroupOrOutput = {
  /**
   * Or
   */
  or: Array<
    TagGroupLeaf | TagGroupAndOutput | TagGroupOrOutput | TagGroupNotOutput
  >;
};

/**
 * TagItem
 *
 * Single tag with usage count.
 */
export type TagItem = {
  /**
   * Tag
   *
   * The tag value
   */
  tag: string;
  /**
   * Count
   *
   * Number of memories with this tag
   */
  count: number;
};

/**
 * TokenUsage
 *
 * Token usage metrics for LLM calls.
 *
 * Tracks input/output tokens for a single request to enable
 * per-request cost tracking and monitoring.
 */
export type TokenUsage = {
  /**
   * Input Tokens
   *
   * Number of input/prompt tokens consumed
   */
  input_tokens?: number;
  /**
   * Output Tokens
   *
   * Number of output/completion tokens generated
   */
  output_tokens?: number;
  /**
   * Total Tokens
   *
   * Total tokens (input + output)
   */
  total_tokens?: number;
};

/**
 * ToolCallsIncludeOptions
 *
 * Options for including tool calls in reflect results.
 */
export type ToolCallsIncludeOptions = {
  /**
   * Output
   *
   * Include tool outputs in the trace. Set to false to only include inputs (smaller payload).
   */
  output?: boolean;
};

/**
 * UpdateDirectiveRequest
 *
 * Request model for updating a directive.
 */
export type UpdateDirectiveRequest = {
  /**
   * Name
   *
   * New name
   */
  name?: string | null;
  /**
   * Content
   *
   * New content
   */
  content?: string | null;
  /**
   * Priority
   *
   * New priority
   */
  priority?: number | null;
  /**
   * Is Active
   *
   * New active status
   */
  is_active?: boolean | null;
  /**
   * Tags
   *
   * New tags
   */
  tags?: Array<string> | null;
};

/**
 * UpdateDispositionRequest
 *
 * Request model for updating disposition traits.
 */
export type UpdateDispositionRequest = {
  disposition: DispositionTraits;
};

/**
 * UpdateDocumentRequest
 *
 * Request model for updating a document's mutable fields.
 */
export type UpdateDocumentRequest = {
  /**
   * Tags
   *
   * New tags for the document and its memory units. Triggers observation invalidation and re-consolidation.
   */
  tags?: Array<string> | null;
};

/**
 * UpdateDocumentResponse
 *
 * Response model for update document endpoint.
 */
export type UpdateDocumentResponse = {
  /**
   * Success
   */
  success?: boolean;
};

/**
 * UpdateMentalModelRequest
 *
 * Request model for updating a mental model.
 */
export type UpdateMentalModelRequest = {
  /**
   * Name
   *
   * New name for the mental model
   */
  name?: string | null;
  /**
   * Source Query
   *
   * New source query for the mental model
   */
  source_query?: string | null;
  /**
   * Max Tokens
   *
   * Maximum tokens for generated content
   */
  max_tokens?: number | null;
  /**
   * Tags
   *
   * Tags for scoped visibility
   */
  tags?: Array<string> | null;
  /**
   * Trigger settings
   */
  trigger?: MentalModelTriggerInput | null;
};

/**
 * UpdateWebhookRequest
 *
 * Request model for updating a webhook. Only provided fields are updated.
 */
export type UpdateWebhookRequest = {
  /**
   * Url
   *
   * HTTP(S) endpoint URL
   */
  url?: string | null;
  /**
   * Secret
   *
   * HMAC-SHA256 signing secret. Omit to keep existing; send null to clear.
   */
  secret?: string | null;
  /**
   * Event Types
   *
   * List of event types
   */
  event_types?: Array<string> | null;
  /**
   * Enabled
   *
   * Whether this webhook is active
   */
  enabled?: boolean | null;
  /**
   * HTTP delivery configuration
   */
  http_config?: WebhookHttpConfig | null;
};

/**
 * ValidationError
 */
export type ValidationError = {
  /**
   * Location
   */
  loc: Array<string | number>;
  /**
   * Message
   */
  msg: string;
  /**
   * Error Type
   */
  type: string;
  /**
   * Input
   */
  input?: unknown;
  /**
   * Context
   */
  ctx?: {
    [key: string]: unknown;
  };
  /**
   * URL
   */
  url?: string;
};

/**
 * VersionResponse
 *
 * Response model for the version/info endpoint.
 */
export type VersionResponse = {
  /**
   * Api Version
   *
   * API version string
   */
  api_version: string;
  /**
   * Enabled feature flags
   */
  features: FeaturesInfo;
};

/**
 * WebhookDeliveryListResponse
 *
 * Response model for listing webhook deliveries.
 */
export type WebhookDeliveryListResponse = {
  /**
   * Items
   */
  items: Array<WebhookDeliveryResponse>;
  /**
   * Next Cursor
   */
  next_cursor?: string | null;
};

/**
 * WebhookDeliveryResponse
 *
 * Response model for a webhook delivery record.
 */
export type WebhookDeliveryResponse = {
  /**
   * Id
   */
  id: string;
  /**
   * Webhook Id
   */
  webhook_id: string | null;
  /**
   * Url
   */
  url: string;
  /**
   * Event Type
   */
  event_type: string;
  /**
   * Status
   */
  status: string;
  /**
   * Attempts
   */
  attempts: number;
  /**
   * Next Retry At
   */
  next_retry_at?: string | null;
  /**
   * Last Error
   */
  last_error?: string | null;
  /**
   * Last Response Status
   */
  last_response_status?: number | null;
  /**
   * Last Response Body
   */
  last_response_body?: string | null;
  /**
   * Last Attempt At
   */
  last_attempt_at?: string | null;
  /**
   * Created At
   */
  created_at?: string | null;
  /**
   * Updated At
   */
  updated_at?: string | null;
};

/**
 * WebhookHttpConfig
 *
 * HTTP delivery configuration for a webhook.
 */
export type WebhookHttpConfig = {
  /**
   * Method
   *
   * HTTP method: GET or POST
   */
  method?: string;
  /**
   * Timeout Seconds
   *
   * HTTP request timeout in seconds
   */
  timeout_seconds?: number;
  /**
   * Headers
   *
   * Custom HTTP headers
   */
  headers?: {
    [key: string]: string;
  };
  /**
   * Params
   *
   * Custom HTTP query parameters
   */
  params?: {
    [key: string]: string;
  };
};

/**
 * WebhookListResponse
 *
 * Response model for listing webhooks.
 */
export type WebhookListResponse = {
  /**
   * Items
   */
  items: Array<WebhookResponse>;
};

/**
 * WebhookResponse
 *
 * Response model for a webhook.
 */
export type WebhookResponse = {
  /**
   * Id
   */
  id: string;
  /**
   * Bank Id
   */
  bank_id: string | null;
  /**
   * Url
   */
  url: string;
  /**
   * Secret
   *
   * Signing secret (redacted in responses)
   */
  secret?: string | null;
  /**
   * Event Types
   */
  event_types: Array<string>;
  /**
   * Enabled
   */
  enabled: boolean;
  http_config?: WebhookHttpConfig;
  /**
   * Created At
   */
  created_at?: string | null;
  /**
   * Updated At
   */
  updated_at?: string | null;
};

export type HealthEndpointHealthGetData = {
  body?: never;
  path?: never;
  query?: never;
  url: "/health";
};

export type HealthEndpointHealthGetResponses = {
  /**
   * Successful Response
   */
  200: unknown;
};

export type GetVersionData = {
  body?: never;
  path?: never;
  query?: never;
  url: "/version";
};

export type GetVersionResponses = {
  /**
   * Successful Response
   */
  200: VersionResponse;
};

export type GetVersionResponse = GetVersionResponses[keyof GetVersionResponses];

export type MetricsEndpointMetricsGetData = {
  body?: never;
  path?: never;
  query?: never;
  url: "/metrics";
};

export type MetricsEndpointMetricsGetResponses = {
  /**
   * Successful Response
   */
  200: unknown;
};

export type GetGraphData = {
  body?: never;
  headers?: {
    /**
     * Authorization
     */
    authorization?: string | null;
  };
  path: {
    /**
     * Bank Id
     */
    bank_id: string;
  };
  query?: {
    /**
     * Type
     */
    type?: string | null;
    /**
     * Limit
     */
    limit?: number;
    /**
     * Q
     */
    q?: string | null;
    /**
     * Tags
     */
    tags?: Array<string> | null;
    /**
     * Tags Match
     */
    tags_match?: string;
  };
  url: "/v1/default/banks/{bank_id}/graph";
};

export type GetGraphErrors = {
  /**
   * Validation Error
   */
  422: HttpValidationError;
};

export type GetGraphError = GetGraphErrors[keyof GetGraphErrors];

export type GetGraphResponses = {
  /**
   * Successful Response
   */
  200: GraphDataResponse;
};

export type GetGraphResponse = GetGraphResponses[keyof GetGraphResponses];

export type ListMemoriesData = {
  body?: never;
  headers?: {
    /**
     * Authorization
     */
    authorization?: string | null;
  };
  path: {
    /**
     * Bank Id
     */
    bank_id: string;
  };
  query?: {
    /**
     * Type
     */
    type?: string | null;
    /**
     * Q
     */
    q?: string | null;
    /**
     * Consolidation State
     */
    consolidation_state?: string | null;
    /**
     * Limit
     */
    limit?: number;
    /**
     * Offset
     */
    offset?: number;
  };
  url: "/v1/default/banks/{bank_id}/memories/list";
};

export type ListMemoriesErrors = {
  /**
   * Validation Error
   */
  422: HttpValidationError;
};

export type ListMemoriesError = ListMemoriesErrors[keyof ListMemoriesErrors];

export type ListMemoriesResponses = {
  /**
   * Successful Response
   */
  200: ListMemoryUnitsResponse;
};

export type ListMemoriesResponse =
  ListMemoriesResponses[keyof ListMemoriesResponses];

export type GetMemoryData = {
  body?: never;
  headers?: {
    /**
     * Authorization
     */
    authorization?: string | null;
  };
  path: {
    /**
     * Bank Id
     */
    bank_id: string;
    /**
     * Memory Id
     */
    memory_id: string;
  };
  query?: never;
  url: "/v1/default/banks/{bank_id}/memories/{memory_id}";
};

export type GetMemoryErrors = {
  /**
   * Validation Error
   */
  422: HttpValidationError;
};

export type GetMemoryError = GetMemoryErrors[keyof GetMemoryErrors];

export type GetMemoryResponses = {
  /**
   * Successful Response
   */
  200: unknown;
};

export type GetObservationHistoryData = {
  body?: never;
  headers?: {
    /**
     * Authorization
     */
    authorization?: string | null;
  };
  path: {
    /**
     * Bank Id
     */
    bank_id: string;
    /**
     * Memory Id
     */
    memory_id: string;
  };
  query?: never;
  url: "/v1/default/banks/{bank_id}/memories/{memory_id}/history";
};

export type GetObservationHistoryErrors = {
  /**
   * Validation Error
   */
  422: HttpValidationError;
};

export type GetObservationHistoryError =
  GetObservationHistoryErrors[keyof GetObservationHistoryErrors];

export type GetObservationHistoryResponses = {
  /**
   * Successful Response
   */
  200: unknown;
};

export type RecallMemoriesData = {
  body: RecallRequest;
  headers?: {
    /**
     * Authorization
     */
    authorization?: string | null;
  };
  path: {
    /**
     * Bank Id
     */
    bank_id: string;
  };
  query?: never;
  url: "/v1/default/banks/{bank_id}/memories/recall";
};

export type RecallMemoriesErrors = {
  /**
   * Validation Error
   */
  422: HttpValidationError;
};

export type RecallMemoriesError =
  RecallMemoriesErrors[keyof RecallMemoriesErrors];

export type RecallMemoriesResponses = {
  /**
   * Successful Response
   */
  200: RecallResponse;
};

export type RecallMemoriesResponse =
  RecallMemoriesResponses[keyof RecallMemoriesResponses];

export type ReflectData = {
  body: ReflectRequest;
  headers?: {
    /**
     * Authorization
     */
    authorization?: string | null;
  };
  path: {
    /**
     * Bank Id
     */
    bank_id: string;
  };
  query?: never;
  url: "/v1/default/banks/{bank_id}/reflect";
};

export type ReflectErrors = {
  /**
   * Validation Error
   */
  422: HttpValidationError;
};

export type ReflectError = ReflectErrors[keyof ReflectErrors];

export type ReflectResponses = {
  /**
   * Successful Response
   */
  200: ReflectResponse;
};

export type ReflectResponse2 = ReflectResponses[keyof ReflectResponses];

export type ListBanksData = {
  body?: never;
  headers?: {
    /**
     * Authorization
     */
    authorization?: string | null;
  };
  path?: never;
  query?: never;
  url: "/v1/default/banks";
};

export type ListBanksErrors = {
  /**
   * Validation Error
   */
  422: HttpValidationError;
};

export type ListBanksError = ListBanksErrors[keyof ListBanksErrors];

export type ListBanksResponses = {
  /**
   * Successful Response
   */
  200: BankListResponse;
};

export type ListBanksResponse = ListBanksResponses[keyof ListBanksResponses];

export type GetAgentStatsData = {
  body?: never;
  headers?: {
    /**
     * Authorization
     */
    authorization?: string | null;
  };
  path: {
    /**
     * Bank Id
     */
    bank_id: string;
  };
  query?: never;
  url: "/v1/default/banks/{bank_id}/stats";
};

export type GetAgentStatsErrors = {
  /**
   * Validation Error
   */
  422: HttpValidationError;
};

export type GetAgentStatsError = GetAgentStatsErrors[keyof GetAgentStatsErrors];

export type GetAgentStatsResponses = {
  /**
   * Successful Response
   */
  200: BankStatsResponse;
};

export type GetAgentStatsResponse =
  GetAgentStatsResponses[keyof GetAgentStatsResponses];

export type GetMemoriesTimeseriesData = {
  body?: never;
  headers?: {
    /**
     * Authorization
     */
    authorization?: string | null;
  };
  path: {
    /**
     * Bank Id
     */
    bank_id: string;
  };
  query?: {
    /**
     * Period
     */
    period?: string;
  };
  url: "/v1/default/banks/{bank_id}/stats/memories-timeseries";
};

export type GetMemoriesTimeseriesErrors = {
  /**
   * Validation Error
   */
  422: HttpValidationError;
};

export type GetMemoriesTimeseriesError =
  GetMemoriesTimeseriesErrors[keyof GetMemoriesTimeseriesErrors];

export type GetMemoriesTimeseriesResponses = {
  /**
   * Successful Response
   */
  200: MemoriesTimeseriesResponse;
};

export type GetMemoriesTimeseriesResponse =
  GetMemoriesTimeseriesResponses[keyof GetMemoriesTimeseriesResponses];

export type ListEntitiesData = {
  body?: never;
  headers?: {
    /**
     * Authorization
     */
    authorization?: string | null;
  };
  path: {
    /**
     * Bank Id
     */
    bank_id: string;
  };
  query?: {
    /**
     * Limit
     *
     * Maximum number of entities to return
     */
    limit?: number;
    /**
     * Offset
     *
     * Offset for pagination
     */
    offset?: number;
  };
  url: "/v1/default/banks/{bank_id}/entities";
};

export type ListEntitiesErrors = {
  /**
   * Validation Error
   */
  422: HttpValidationError;
};

export type ListEntitiesError = ListEntitiesErrors[keyof ListEntitiesErrors];

export type ListEntitiesResponses = {
  /**
   * Successful Response
   */
  200: EntityListResponse;
};

export type ListEntitiesResponse =
  ListEntitiesResponses[keyof ListEntitiesResponses];

export type GetEntityGraphData = {
  body?: never;
  headers?: {
    /**
     * Authorization
     */
    authorization?: string | null;
  };
  path: {
    /**
     * Bank Id
     */
    bank_id: string;
  };
  query?: {
    /**
     * Limit
     *
     * Maximum number of co-occurrence edges to return
     */
    limit?: number;
    /**
     * Min Count
     *
     * Minimum cooccurrence_count to include an edge
     */
    min_count?: number;
  };
  url: "/v1/default/banks/{bank_id}/entities/graph";
};

export type GetEntityGraphErrors = {
  /**
   * Validation Error
   */
  422: HttpValidationError;
};

export type GetEntityGraphError =
  GetEntityGraphErrors[keyof GetEntityGraphErrors];

export type GetEntityGraphResponses = {
  /**
   * Successful Response
   */
  200: EntityGraphResponse;
};

export type GetEntityGraphResponse =
  GetEntityGraphResponses[keyof GetEntityGraphResponses];

export type GetEntityData = {
  body?: never;
  headers?: {
    /**
     * Authorization
     */
    authorization?: string | null;
  };
  path: {
    /**
     * Bank Id
     */
    bank_id: string;
    /**
     * Entity Id
     */
    entity_id: string;
  };
  query?: never;
  url: "/v1/default/banks/{bank_id}/entities/{entity_id}";
};

export type GetEntityErrors = {
  /**
   * Validation Error
   */
  422: HttpValidationError;
};

export type GetEntityError = GetEntityErrors[keyof GetEntityErrors];

export type GetEntityResponses = {
  /**
   * Successful Response
   */
  200: EntityDetailResponse;
};

export type GetEntityResponse = GetEntityResponses[keyof GetEntityResponses];

export type RegenerateEntityObservationsData = {
  body?: never;
  headers?: {
    /**
     * Authorization
     */
    authorization?: string | null;
  };
  path: {
    /**
     * Bank Id
     */
    bank_id: string;
    /**
     * Entity Id
     */
    entity_id: string;
  };
  query?: never;
  url: "/v1/default/banks/{bank_id}/entities/{entity_id}/regenerate";
};

export type RegenerateEntityObservationsErrors = {
  /**
   * Validation Error
   */
  422: HttpValidationError;
};

export type RegenerateEntityObservationsError =
  RegenerateEntityObservationsErrors[keyof RegenerateEntityObservationsErrors];

export type RegenerateEntityObservationsResponses = {
  /**
   * Successful Response
   */
  200: EntityDetailResponse;
};

export type RegenerateEntityObservationsResponse =
  RegenerateEntityObservationsResponses[keyof RegenerateEntityObservationsResponses];

export type ListMentalModelsData = {
  body?: never;
  headers?: {
    /**
     * Authorization
     */
    authorization?: string | null;
  };
  path: {
    /**
     * Bank Id
     */
    bank_id: string;
  };
  query?: {
    /**
     * Tags
     *
     * Filter by tags
     */
    tags?: Array<string> | null;
    /**
     * Tags Match
     *
     * How to match tags
     */
    tags_match?: "any" | "all" | "exact";
    /**
     * Detail
     *
     * Detail level: 'metadata' (names/tags only), 'content' (adds content/config), 'full' (includes reflect_response)
     */
    detail?: "metadata" | "content" | "full";
    /**
     * Limit
     */
    limit?: number;
    /**
     * Offset
     */
    offset?: number;
  };
  url: "/v1/default/banks/{bank_id}/mental-models";
};

export type ListMentalModelsErrors = {
  /**
   * Validation Error
   */
  422: HttpValidationError;
};

export type ListMentalModelsError =
  ListMentalModelsErrors[keyof ListMentalModelsErrors];

export type ListMentalModelsResponses = {
  /**
   * Successful Response
   */
  200: MentalModelListResponse;
};

export type ListMentalModelsResponse =
  ListMentalModelsResponses[keyof ListMentalModelsResponses];

export type CreateMentalModelData = {
  body: CreateMentalModelRequest;
  headers?: {
    /**
     * Authorization
     */
    authorization?: string | null;
  };
  path: {
    /**
     * Bank Id
     */
    bank_id: string;
  };
  query?: never;
  url: "/v1/default/banks/{bank_id}/mental-models";
};

export type CreateMentalModelErrors = {
  /**
   * Validation Error
   */
  422: HttpValidationError;
};

export type CreateMentalModelError =
  CreateMentalModelErrors[keyof CreateMentalModelErrors];

export type CreateMentalModelResponses = {
  /**
   * Successful Response
   */
  200: CreateMentalModelResponse;
};

export type CreateMentalModelResponse2 =
  CreateMentalModelResponses[keyof CreateMentalModelResponses];

export type DeleteMentalModelData = {
  body?: never;
  headers?: {
    /**
     * Authorization
     */
    authorization?: string | null;
  };
  path: {
    /**
     * Bank Id
     */
    bank_id: string;
    /**
     * Mental Model Id
     */
    mental_model_id: string;
  };
  query?: never;
  url: "/v1/default/banks/{bank_id}/mental-models/{mental_model_id}";
};

export type DeleteMentalModelErrors = {
  /**
   * Validation Error
   */
  422: HttpValidationError;
};

export type DeleteMentalModelError =
  DeleteMentalModelErrors[keyof DeleteMentalModelErrors];

export type DeleteMentalModelResponses = {
  /**
   * Successful Response
   */
  200: unknown;
};

export type GetMentalModelData = {
  body?: never;
  headers?: {
    /**
     * Authorization
     */
    authorization?: string | null;
  };
  path: {
    /**
     * Bank Id
     */
    bank_id: string;
    /**
     * Mental Model Id
     */
    mental_model_id: string;
  };
  query?: {
    /**
     * Detail
     *
     * Detail level: 'metadata' (names/tags only), 'content' (adds content/config), 'full' (includes reflect_response)
     */
    detail?: "metadata" | "content" | "full";
  };
  url: "/v1/default/banks/{bank_id}/mental-models/{mental_model_id}";
};

export type GetMentalModelErrors = {
  /**
   * Validation Error
   */
  422: HttpValidationError;
};

export type GetMentalModelError =
  GetMentalModelErrors[keyof GetMentalModelErrors];

export type GetMentalModelResponses = {
  /**
   * Successful Response
   */
  200: MentalModelResponse;
};

export type GetMentalModelResponse =
  GetMentalModelResponses[keyof GetMentalModelResponses];

export type UpdateMentalModelData = {
  body: UpdateMentalModelRequest;
  headers?: {
    /**
     * Authorization
     */
    authorization?: string | null;
  };
  path: {
    /**
     * Bank Id
     */
    bank_id: string;
    /**
     * Mental Model Id
     */
    mental_model_id: string;
  };
  query?: never;
  url: "/v1/default/banks/{bank_id}/mental-models/{mental_model_id}";
};

export type UpdateMentalModelErrors = {
  /**
   * Validation Error
   */
  422: HttpValidationError;
};

export type UpdateMentalModelError =
  UpdateMentalModelErrors[keyof UpdateMentalModelErrors];

export type UpdateMentalModelResponses = {
  /**
   * Successful Response
   */
  200: MentalModelResponse;
};

export type UpdateMentalModelResponse =
  UpdateMentalModelResponses[keyof UpdateMentalModelResponses];

export type GetMentalModelHistoryData = {
  body?: never;
  headers?: {
    /**
     * Authorization
     */
    authorization?: string | null;
  };
  path: {
    /**
     * Bank Id
     */
    bank_id: string;
    /**
     * Mental Model Id
     */
    mental_model_id: string;
  };
  query?: never;
  url: "/v1/default/banks/{bank_id}/mental-models/{mental_model_id}/history";
};

export type GetMentalModelHistoryErrors = {
  /**
   * Validation Error
   */
  422: HttpValidationError;
};

export type GetMentalModelHistoryError =
  GetMentalModelHistoryErrors[keyof GetMentalModelHistoryErrors];

export type GetMentalModelHistoryResponses = {
  /**
   * Successful Response
   */
  200: unknown;
};

export type RefreshMentalModelData = {
  body?: never;
  headers?: {
    /**
     * Authorization
     */
    authorization?: string | null;
  };
  path: {
    /**
     * Bank Id
     */
    bank_id: string;
    /**
     * Mental Model Id
     */
    mental_model_id: string;
  };
  query?: never;
  url: "/v1/default/banks/{bank_id}/mental-models/{mental_model_id}/refresh";
};

export type RefreshMentalModelErrors = {
  /**
   * Validation Error
   */
  422: HttpValidationError;
};

export type RefreshMentalModelError =
  RefreshMentalModelErrors[keyof RefreshMentalModelErrors];

export type RefreshMentalModelResponses = {
  /**
   * Successful Response
   */
  200: AsyncOperationSubmitResponse;
};

export type RefreshMentalModelResponse =
  RefreshMentalModelResponses[keyof RefreshMentalModelResponses];

export type ListDirectivesData = {
  body?: never;
  headers?: {
    /**
     * Authorization
     */
    authorization?: string | null;
  };
  path: {
    /**
     * Bank Id
     */
    bank_id: string;
  };
  query?: {
    /**
     * Tags
     *
     * Filter by tags
     */
    tags?: Array<string> | null;
    /**
     * Tags Match
     *
     * How to match tags
     */
    tags_match?: "any" | "all" | "exact";
    /**
     * Active Only
     *
     * Only return active directives
     */
    active_only?: boolean;
    /**
     * Limit
     */
    limit?: number;
    /**
     * Offset
     */
    offset?: number;
  };
  url: "/v1/default/banks/{bank_id}/directives";
};

export type ListDirectivesErrors = {
  /**
   * Validation Error
   */
  422: HttpValidationError;
};

export type ListDirectivesError =
  ListDirectivesErrors[keyof ListDirectivesErrors];

export type ListDirectivesResponses = {
  /**
   * Successful Response
   */
  200: DirectiveListResponse;
};

export type ListDirectivesResponse =
  ListDirectivesResponses[keyof ListDirectivesResponses];

export type CreateDirectiveData = {
  body: CreateDirectiveRequest;
  headers?: {
    /**
     * Authorization
     */
    authorization?: string | null;
  };
  path: {
    /**
     * Bank Id
     */
    bank_id: string;
  };
  query?: never;
  url: "/v1/default/banks/{bank_id}/directives";
};

export type CreateDirectiveErrors = {
  /**
   * Validation Error
   */
  422: HttpValidationError;
};

export type CreateDirectiveError =
  CreateDirectiveErrors[keyof CreateDirectiveErrors];

export type CreateDirectiveResponses = {
  /**
   * Successful Response
   */
  200: DirectiveResponse;
};

export type CreateDirectiveResponse =
  CreateDirectiveResponses[keyof CreateDirectiveResponses];

export type DeleteDirectiveData = {
  body?: never;
  headers?: {
    /**
     * Authorization
     */
    authorization?: string | null;
  };
  path: {
    /**
     * Bank Id
     */
    bank_id: string;
    /**
     * Directive Id
     */
    directive_id: string;
  };
  query?: never;
  url: "/v1/default/banks/{bank_id}/directives/{directive_id}";
};

export type DeleteDirectiveErrors = {
  /**
   * Validation Error
   */
  422: HttpValidationError;
};

export type DeleteDirectiveError =
  DeleteDirectiveErrors[keyof DeleteDirectiveErrors];

export type DeleteDirectiveResponses = {
  /**
   * Successful Response
   */
  200: unknown;
};

export type GetDirectiveData = {
  body?: never;
  headers?: {
    /**
     * Authorization
     */
    authorization?: string | null;
  };
  path: {
    /**
     * Bank Id
     */
    bank_id: string;
    /**
     * Directive Id
     */
    directive_id: string;
  };
  query?: never;
  url: "/v1/default/banks/{bank_id}/directives/{directive_id}";
};

export type GetDirectiveErrors = {
  /**
   * Validation Error
   */
  422: HttpValidationError;
};

export type GetDirectiveError = GetDirectiveErrors[keyof GetDirectiveErrors];

export type GetDirectiveResponses = {
  /**
   * Successful Response
   */
  200: DirectiveResponse;
};

export type GetDirectiveResponse =
  GetDirectiveResponses[keyof GetDirectiveResponses];

export type UpdateDirectiveData = {
  body: UpdateDirectiveRequest;
  headers?: {
    /**
     * Authorization
     */
    authorization?: string | null;
  };
  path: {
    /**
     * Bank Id
     */
    bank_id: string;
    /**
     * Directive Id
     */
    directive_id: string;
  };
  query?: never;
  url: "/v1/default/banks/{bank_id}/directives/{directive_id}";
};

export type UpdateDirectiveErrors = {
  /**
   * Validation Error
   */
  422: HttpValidationError;
};

export type UpdateDirectiveError =
  UpdateDirectiveErrors[keyof UpdateDirectiveErrors];

export type UpdateDirectiveResponses = {
  /**
   * Successful Response
   */
  200: DirectiveResponse;
};

export type UpdateDirectiveResponse =
  UpdateDirectiveResponses[keyof UpdateDirectiveResponses];

export type ListDocumentsData = {
  body?: never;
  headers?: {
    /**
     * Authorization
     */
    authorization?: string | null;
  };
  path: {
    /**
     * Bank Id
     */
    bank_id: string;
  };
  query?: {
    /**
     * Q
     *
     * Case-insensitive substring filter on document ID (e.g. 'report' matches 'report-2024')
     */
    q?: string | null;
    /**
     * Tags
     *
     * Filter documents by tags
     */
    tags?: Array<string> | null;
    /**
     * Tags Match
     *
     * How to match tags: 'any', 'all', 'any_strict', 'all_strict'
     */
    tags_match?: string;
    /**
     * Limit
     */
    limit?: number;
    /**
     * Offset
     */
    offset?: number;
  };
  url: "/v1/default/banks/{bank_id}/documents";
};

export type ListDocumentsErrors = {
  /**
   * Validation Error
   */
  422: HttpValidationError;
};

export type ListDocumentsError = ListDocumentsErrors[keyof ListDocumentsErrors];

export type ListDocumentsResponses = {
  /**
   * Successful Response
   */
  200: ListDocumentsResponse;
};

export type ListDocumentsResponse2 =
  ListDocumentsResponses[keyof ListDocumentsResponses];

export type DeleteDocumentData = {
  body?: never;
  headers?: {
    /**
     * Authorization
     */
    authorization?: string | null;
  };
  path: {
    /**
     * Bank Id
     */
    bank_id: string;
    /**
     * Document Id
     */
    document_id: string;
  };
  query?: never;
  url: "/v1/default/banks/{bank_id}/documents/{document_id}";
};

export type DeleteDocumentErrors = {
  /**
   * Validation Error
   */
  422: HttpValidationError;
};

export type DeleteDocumentError =
  DeleteDocumentErrors[keyof DeleteDocumentErrors];

export type DeleteDocumentResponses = {
  /**
   * Successful Response
   */
  200: DeleteDocumentResponse;
};

export type DeleteDocumentResponse2 =
  DeleteDocumentResponses[keyof DeleteDocumentResponses];

export type GetDocumentData = {
  body?: never;
  headers?: {
    /**
     * Authorization
     */
    authorization?: string | null;
  };
  path: {
    /**
     * Bank Id
     */
    bank_id: string;
    /**
     * Document Id
     */
    document_id: string;
  };
  query?: never;
  url: "/v1/default/banks/{bank_id}/documents/{document_id}";
};

export type GetDocumentErrors = {
  /**
   * Validation Error
   */
  422: HttpValidationError;
};

export type GetDocumentError = GetDocumentErrors[keyof GetDocumentErrors];

export type GetDocumentResponses = {
  /**
   * Successful Response
   */
  200: DocumentResponse;
};

export type GetDocumentResponse =
  GetDocumentResponses[keyof GetDocumentResponses];

export type UpdateDocumentData = {
  body: UpdateDocumentRequest;
  headers?: {
    /**
     * Authorization
     */
    authorization?: string | null;
  };
  path: {
    /**
     * Bank Id
     */
    bank_id: string;
    /**
     * Document Id
     */
    document_id: string;
  };
  query?: never;
  url: "/v1/default/banks/{bank_id}/documents/{document_id}";
};

export type UpdateDocumentErrors = {
  /**
   * Validation Error
   */
  422: HttpValidationError;
};

export type UpdateDocumentError =
  UpdateDocumentErrors[keyof UpdateDocumentErrors];

export type UpdateDocumentResponses = {
  /**
   * Successful Response
   */
  200: UpdateDocumentResponse;
};

export type UpdateDocumentResponse2 =
  UpdateDocumentResponses[keyof UpdateDocumentResponses];

export type ListTagsData = {
  body?: never;
  headers?: {
    /**
     * Authorization
     */
    authorization?: string | null;
  };
  path: {
    /**
     * Bank Id
     */
    bank_id: string;
  };
  query?: {
    /**
     * Q
     *
     * Wildcard pattern to filter tags (e.g., 'user:*' for user:alice, '*-admin' for role-admin). Use '*' as wildcard. Case-insensitive.
     */
    q?: string | null;
    /**
     * Limit
     *
     * Maximum number of tags to return
     */
    limit?: number;
    /**
     * Offset
     *
     * Offset for pagination
     */
    offset?: number;
  };
  url: "/v1/default/banks/{bank_id}/tags";
};

export type ListTagsErrors = {
  /**
   * Validation Error
   */
  422: HttpValidationError;
};

export type ListTagsError = ListTagsErrors[keyof ListTagsErrors];

export type ListTagsResponses = {
  /**
   * Successful Response
   */
  200: ListTagsResponse;
};

export type ListTagsResponse2 = ListTagsResponses[keyof ListTagsResponses];

export type GetChunkData = {
  body?: never;
  headers?: {
    /**
     * Authorization
     */
    authorization?: string | null;
  };
  path: {
    /**
     * Chunk Id
     */
    chunk_id: string;
  };
  query?: never;
  url: "/v1/default/chunks/{chunk_id}";
};

export type GetChunkErrors = {
  /**
   * Validation Error
   */
  422: HttpValidationError;
};

export type GetChunkError = GetChunkErrors[keyof GetChunkErrors];

export type GetChunkResponses = {
  /**
   * Successful Response
   */
  200: ChunkResponse;
};

export type GetChunkResponse = GetChunkResponses[keyof GetChunkResponses];

export type ListOperationsData = {
  body?: never;
  headers?: {
    /**
     * Authorization
     */
    authorization?: string | null;
  };
  path: {
    /**
     * Bank Id
     */
    bank_id: string;
  };
  query?: {
    /**
     * Status
     *
     * Filter by status: pending, completed, or failed
     */
    status?: string | null;
    /**
     * Type
     *
     * Filter by operation type: retain, consolidation, refresh_mental_model, file_convert_retain, webhook_delivery
     */
    type?: string | null;
    /**
     * Limit
     *
     * Maximum number of operations to return
     */
    limit?: number;
    /**
     * Offset
     *
     * Number of operations to skip
     */
    offset?: number;
  };
  url: "/v1/default/banks/{bank_id}/operations";
};

export type ListOperationsErrors = {
  /**
   * Validation Error
   */
  422: HttpValidationError;
};

export type ListOperationsError =
  ListOperationsErrors[keyof ListOperationsErrors];

export type ListOperationsResponses = {
  /**
   * Successful Response
   */
  200: OperationsListResponse;
};

export type ListOperationsResponse =
  ListOperationsResponses[keyof ListOperationsResponses];

export type CancelOperationData = {
  body?: never;
  headers?: {
    /**
     * Authorization
     */
    authorization?: string | null;
  };
  path: {
    /**
     * Bank Id
     */
    bank_id: string;
    /**
     * Operation Id
     */
    operation_id: string;
  };
  query?: never;
  url: "/v1/default/banks/{bank_id}/operations/{operation_id}";
};

export type CancelOperationErrors = {
  /**
   * Validation Error
   */
  422: HttpValidationError;
};

export type CancelOperationError =
  CancelOperationErrors[keyof CancelOperationErrors];

export type CancelOperationResponses = {
  /**
   * Successful Response
   */
  200: CancelOperationResponse;
};

export type CancelOperationResponse2 =
  CancelOperationResponses[keyof CancelOperationResponses];

export type GetOperationStatusData = {
  body?: never;
  headers?: {
    /**
     * Authorization
     */
    authorization?: string | null;
  };
  path: {
    /**
     * Bank Id
     */
    bank_id: string;
    /**
     * Operation Id
     */
    operation_id: string;
  };
  query?: {
    /**
     * Include Payload
     *
     * Include the raw task payload (submission params) in the response. May be large.
     */
    include_payload?: boolean;
  };
  url: "/v1/default/banks/{bank_id}/operations/{operation_id}";
};

export type GetOperationStatusErrors = {
  /**
   * Validation Error
   */
  422: HttpValidationError;
};

export type GetOperationStatusError =
  GetOperationStatusErrors[keyof GetOperationStatusErrors];

export type GetOperationStatusResponses = {
  /**
   * Successful Response
   */
  200: OperationStatusResponse;
};

export type GetOperationStatusResponse =
  GetOperationStatusResponses[keyof GetOperationStatusResponses];

export type RetryOperationData = {
  body?: never;
  headers?: {
    /**
     * Authorization
     */
    authorization?: string | null;
  };
  path: {
    /**
     * Bank Id
     */
    bank_id: string;
    /**
     * Operation Id
     */
    operation_id: string;
  };
  query?: never;
  url: "/v1/default/banks/{bank_id}/operations/{operation_id}/retry";
};

export type RetryOperationErrors = {
  /**
   * Validation Error
   */
  422: HttpValidationError;
};

export type RetryOperationError =
  RetryOperationErrors[keyof RetryOperationErrors];

export type RetryOperationResponses = {
  /**
   * Successful Response
   */
  200: RetryOperationResponse;
};

export type RetryOperationResponse2 =
  RetryOperationResponses[keyof RetryOperationResponses];

export type GetBankProfileData = {
  body?: never;
  headers?: {
    /**
     * Authorization
     */
    authorization?: string | null;
  };
  path: {
    /**
     * Bank Id
     */
    bank_id: string;
  };
  query?: never;
  url: "/v1/default/banks/{bank_id}/profile";
};

export type GetBankProfileErrors = {
  /**
   * Validation Error
   */
  422: HttpValidationError;
};

export type GetBankProfileError =
  GetBankProfileErrors[keyof GetBankProfileErrors];

export type GetBankProfileResponses = {
  /**
   * Successful Response
   */
  200: BankProfileResponse;
};

export type GetBankProfileResponse =
  GetBankProfileResponses[keyof GetBankProfileResponses];

export type UpdateBankDispositionData = {
  body: UpdateDispositionRequest;
  headers?: {
    /**
     * Authorization
     */
    authorization?: string | null;
  };
  path: {
    /**
     * Bank Id
     */
    bank_id: string;
  };
  query?: never;
  url: "/v1/default/banks/{bank_id}/profile";
};

export type UpdateBankDispositionErrors = {
  /**
   * Validation Error
   */
  422: HttpValidationError;
};

export type UpdateBankDispositionError =
  UpdateBankDispositionErrors[keyof UpdateBankDispositionErrors];

export type UpdateBankDispositionResponses = {
  /**
   * Successful Response
   */
  200: BankProfileResponse;
};

export type UpdateBankDispositionResponse =
  UpdateBankDispositionResponses[keyof UpdateBankDispositionResponses];

export type AddBankBackgroundData = {
  body: AddBackgroundRequest;
  headers?: {
    /**
     * Authorization
     */
    authorization?: string | null;
  };
  path: {
    /**
     * Bank Id
     */
    bank_id: string;
  };
  query?: never;
  url: "/v1/default/banks/{bank_id}/background";
};

export type AddBankBackgroundErrors = {
  /**
   * Validation Error
   */
  422: HttpValidationError;
};

export type AddBankBackgroundError =
  AddBankBackgroundErrors[keyof AddBankBackgroundErrors];

export type AddBankBackgroundResponses = {
  /**
   * Successful Response
   */
  200: BackgroundResponse;
};

export type AddBankBackgroundResponse =
  AddBankBackgroundResponses[keyof AddBankBackgroundResponses];

export type DeleteBankData = {
  body?: never;
  headers?: {
    /**
     * Authorization
     */
    authorization?: string | null;
  };
  path: {
    /**
     * Bank Id
     */
    bank_id: string;
  };
  query?: never;
  url: "/v1/default/banks/{bank_id}";
};

export type DeleteBankErrors = {
  /**
   * Validation Error
   */
  422: HttpValidationError;
};

export type DeleteBankError = DeleteBankErrors[keyof DeleteBankErrors];

export type DeleteBankResponses = {
  /**
   * Successful Response
   */
  200: DeleteResponse;
};

export type DeleteBankResponse = DeleteBankResponses[keyof DeleteBankResponses];

export type UpdateBankData = {
  body: CreateBankRequest;
  headers?: {
    /**
     * Authorization
     */
    authorization?: string | null;
  };
  path: {
    /**
     * Bank Id
     */
    bank_id: string;
  };
  query?: never;
  url: "/v1/default/banks/{bank_id}";
};

export type UpdateBankErrors = {
  /**
   * Validation Error
   */
  422: HttpValidationError;
};

export type UpdateBankError = UpdateBankErrors[keyof UpdateBankErrors];

export type UpdateBankResponses = {
  /**
   * Successful Response
   */
  200: BankProfileResponse;
};

export type UpdateBankResponse = UpdateBankResponses[keyof UpdateBankResponses];

export type CreateOrUpdateBankData = {
  body: CreateBankRequest;
  headers?: {
    /**
     * Authorization
     */
    authorization?: string | null;
  };
  path: {
    /**
     * Bank Id
     */
    bank_id: string;
  };
  query?: never;
  url: "/v1/default/banks/{bank_id}";
};

export type CreateOrUpdateBankErrors = {
  /**
   * Validation Error
   */
  422: HttpValidationError;
};

export type CreateOrUpdateBankError =
  CreateOrUpdateBankErrors[keyof CreateOrUpdateBankErrors];

export type CreateOrUpdateBankResponses = {
  /**
   * Successful Response
   */
  200: BankProfileResponse;
};

export type CreateOrUpdateBankResponse =
  CreateOrUpdateBankResponses[keyof CreateOrUpdateBankResponses];

export type ImportBankTemplateData = {
  body?: never;
  headers?: {
    /**
     * Authorization
     */
    authorization?: string | null;
  };
  path: {
    /**
     * Bank Id
     */
    bank_id: string;
  };
  query?: {
    /**
     * Dry Run
     *
     * Validate only, do not apply changes
     */
    dry_run?: boolean;
  };
  url: "/v1/default/banks/{bank_id}/import";
};

export type ImportBankTemplateErrors = {
  /**
   * Validation Error
   */
  422: HttpValidationError;
};

export type ImportBankTemplateError =
  ImportBankTemplateErrors[keyof ImportBankTemplateErrors];

export type ImportBankTemplateResponses = {
  /**
   * Successful Response
   */
  200: BankTemplateImportResponse;
};

export type ImportBankTemplateResponse =
  ImportBankTemplateResponses[keyof ImportBankTemplateResponses];

export type ExportBankTemplateData = {
  body?: never;
  headers?: {
    /**
     * Authorization
     */
    authorization?: string | null;
  };
  path: {
    /**
     * Bank Id
     */
    bank_id: string;
  };
  query?: never;
  url: "/v1/default/banks/{bank_id}/export";
};

export type ExportBankTemplateErrors = {
  /**
   * Validation Error
   */
  422: HttpValidationError;
};

export type ExportBankTemplateError =
  ExportBankTemplateErrors[keyof ExportBankTemplateErrors];

export type ExportBankTemplateResponses = {
  /**
   * Successful Response
   */
  200: BankTemplateManifest;
};

export type ExportBankTemplateResponse =
  ExportBankTemplateResponses[keyof ExportBankTemplateResponses];

export type GetBankTemplateSchemaData = {
  body?: never;
  path?: never;
  query?: never;
  url: "/v1/bank-template-schema";
};

export type GetBankTemplateSchemaResponses = {
  /**
   * Successful Response
   */
  200: unknown;
};

export type ClearObservationsData = {
  body?: never;
  headers?: {
    /**
     * Authorization
     */
    authorization?: string | null;
  };
  path: {
    /**
     * Bank Id
     */
    bank_id: string;
  };
  query?: never;
  url: "/v1/default/banks/{bank_id}/observations";
};

export type ClearObservationsErrors = {
  /**
   * Validation Error
   */
  422: HttpValidationError;
};

export type ClearObservationsError =
  ClearObservationsErrors[keyof ClearObservationsErrors];

export type ClearObservationsResponses = {
  /**
   * Successful Response
   */
  200: DeleteResponse;
};

export type ClearObservationsResponse =
  ClearObservationsResponses[keyof ClearObservationsResponses];

export type RecoverConsolidationData = {
  body?: never;
  headers?: {
    /**
     * Authorization
     */
    authorization?: string | null;
  };
  path: {
    /**
     * Bank Id
     */
    bank_id: string;
  };
  query?: never;
  url: "/v1/default/banks/{bank_id}/consolidation/recover";
};

export type RecoverConsolidationErrors = {
  /**
   * Validation Error
   */
  422: HttpValidationError;
};

export type RecoverConsolidationError =
  RecoverConsolidationErrors[keyof RecoverConsolidationErrors];

export type RecoverConsolidationResponses = {
  /**
   * Successful Response
   */
  200: RecoverConsolidationResponse;
};

export type RecoverConsolidationResponse2 =
  RecoverConsolidationResponses[keyof RecoverConsolidationResponses];

export type ClearMemoryObservationsData = {
  body?: never;
  headers?: {
    /**
     * Authorization
     */
    authorization?: string | null;
  };
  path: {
    /**
     * Bank Id
     */
    bank_id: string;
    /**
     * Memory Id
     */
    memory_id: string;
  };
  query?: never;
  url: "/v1/default/banks/{bank_id}/memories/{memory_id}/observations";
};

export type ClearMemoryObservationsErrors = {
  /**
   * Validation Error
   */
  422: HttpValidationError;
};

export type ClearMemoryObservationsError =
  ClearMemoryObservationsErrors[keyof ClearMemoryObservationsErrors];

export type ClearMemoryObservationsResponses = {
  /**
   * Successful Response
   */
  200: ClearMemoryObservationsResponse;
};

export type ClearMemoryObservationsResponse2 =
  ClearMemoryObservationsResponses[keyof ClearMemoryObservationsResponses];

export type ResetBankConfigData = {
  body?: never;
  headers?: {
    /**
     * Authorization
     */
    authorization?: string | null;
  };
  path: {
    /**
     * Bank Id
     */
    bank_id: string;
  };
  query?: never;
  url: "/v1/default/banks/{bank_id}/config";
};

export type ResetBankConfigErrors = {
  /**
   * Validation Error
   */
  422: HttpValidationError;
};

export type ResetBankConfigError =
  ResetBankConfigErrors[keyof ResetBankConfigErrors];

export type ResetBankConfigResponses = {
  /**
   * Successful Response
   */
  200: BankConfigResponse;
};

export type ResetBankConfigResponse =
  ResetBankConfigResponses[keyof ResetBankConfigResponses];

export type GetBankConfigData = {
  body?: never;
  headers?: {
    /**
     * Authorization
     */
    authorization?: string | null;
  };
  path: {
    /**
     * Bank Id
     */
    bank_id: string;
  };
  query?: never;
  url: "/v1/default/banks/{bank_id}/config";
};

export type GetBankConfigErrors = {
  /**
   * Validation Error
   */
  422: HttpValidationError;
};

export type GetBankConfigError = GetBankConfigErrors[keyof GetBankConfigErrors];

export type GetBankConfigResponses = {
  /**
   * Successful Response
   */
  200: BankConfigResponse;
};

export type GetBankConfigResponse =
  GetBankConfigResponses[keyof GetBankConfigResponses];

export type UpdateBankConfigData = {
  body: BankConfigUpdate;
  headers?: {
    /**
     * Authorization
     */
    authorization?: string | null;
  };
  path: {
    /**
     * Bank Id
     */
    bank_id: string;
  };
  query?: never;
  url: "/v1/default/banks/{bank_id}/config";
};

export type UpdateBankConfigErrors = {
  /**
   * Validation Error
   */
  422: HttpValidationError;
};

export type UpdateBankConfigError =
  UpdateBankConfigErrors[keyof UpdateBankConfigErrors];

export type UpdateBankConfigResponses = {
  /**
   * Successful Response
   */
  200: BankConfigResponse;
};

export type UpdateBankConfigResponse =
  UpdateBankConfigResponses[keyof UpdateBankConfigResponses];

export type TriggerConsolidationData = {
  body?: never;
  headers?: {
    /**
     * Authorization
     */
    authorization?: string | null;
  };
  path: {
    /**
     * Bank Id
     */
    bank_id: string;
  };
  query?: never;
  url: "/v1/default/banks/{bank_id}/consolidate";
};

export type TriggerConsolidationErrors = {
  /**
   * Validation Error
   */
  422: HttpValidationError;
};

export type TriggerConsolidationError =
  TriggerConsolidationErrors[keyof TriggerConsolidationErrors];

export type TriggerConsolidationResponses = {
  /**
   * Successful Response
   */
  200: ConsolidationResponse;
};

export type TriggerConsolidationResponse =
  TriggerConsolidationResponses[keyof TriggerConsolidationResponses];

export type ListWebhooksData = {
  body?: never;
  headers?: {
    /**
     * Authorization
     */
    authorization?: string | null;
  };
  path: {
    /**
     * Bank Id
     */
    bank_id: string;
  };
  query?: never;
  url: "/v1/default/banks/{bank_id}/webhooks";
};

export type ListWebhooksErrors = {
  /**
   * Validation Error
   */
  422: HttpValidationError;
};

export type ListWebhooksError = ListWebhooksErrors[keyof ListWebhooksErrors];

export type ListWebhooksResponses = {
  /**
   * Successful Response
   */
  200: WebhookListResponse;
};

export type ListWebhooksResponse =
  ListWebhooksResponses[keyof ListWebhooksResponses];

export type CreateWebhookData = {
  body: CreateWebhookRequest;
  headers?: {
    /**
     * Authorization
     */
    authorization?: string | null;
  };
  path: {
    /**
     * Bank Id
     */
    bank_id: string;
  };
  query?: never;
  url: "/v1/default/banks/{bank_id}/webhooks";
};

export type CreateWebhookErrors = {
  /**
   * Validation Error
   */
  422: HttpValidationError;
};

export type CreateWebhookError = CreateWebhookErrors[keyof CreateWebhookErrors];

export type CreateWebhookResponses = {
  /**
   * Successful Response
   */
  201: WebhookResponse;
};

export type CreateWebhookResponse =
  CreateWebhookResponses[keyof CreateWebhookResponses];

export type DeleteWebhookData = {
  body?: never;
  headers?: {
    /**
     * Authorization
     */
    authorization?: string | null;
  };
  path: {
    /**
     * Bank Id
     */
    bank_id: string;
    /**
     * Webhook Id
     */
    webhook_id: string;
  };
  query?: never;
  url: "/v1/default/banks/{bank_id}/webhooks/{webhook_id}";
};

export type DeleteWebhookErrors = {
  /**
   * Validation Error
   */
  422: HttpValidationError;
};

export type DeleteWebhookError = DeleteWebhookErrors[keyof DeleteWebhookErrors];

export type DeleteWebhookResponses = {
  /**
   * Successful Response
   */
  200: DeleteResponse;
};

export type DeleteWebhookResponse =
  DeleteWebhookResponses[keyof DeleteWebhookResponses];

export type UpdateWebhookData = {
  body: UpdateWebhookRequest;
  headers?: {
    /**
     * Authorization
     */
    authorization?: string | null;
  };
  path: {
    /**
     * Bank Id
     */
    bank_id: string;
    /**
     * Webhook Id
     */
    webhook_id: string;
  };
  query?: never;
  url: "/v1/default/banks/{bank_id}/webhooks/{webhook_id}";
};

export type UpdateWebhookErrors = {
  /**
   * Validation Error
   */
  422: HttpValidationError;
};

export type UpdateWebhookError = UpdateWebhookErrors[keyof UpdateWebhookErrors];

export type UpdateWebhookResponses = {
  /**
   * Successful Response
   */
  200: WebhookResponse;
};

export type UpdateWebhookResponse =
  UpdateWebhookResponses[keyof UpdateWebhookResponses];

export type ListWebhookDeliveriesData = {
  body?: never;
  headers?: {
    /**
     * Authorization
     */
    authorization?: string | null;
  };
  path: {
    /**
     * Bank Id
     */
    bank_id: string;
    /**
     * Webhook Id
     */
    webhook_id: string;
  };
  query?: {
    /**
     * Limit
     *
     * Maximum number of deliveries to return
     */
    limit?: number;
    /**
     * Cursor
     *
     * Pagination cursor (created_at of last item)
     */
    cursor?: string | null;
  };
  url: "/v1/default/banks/{bank_id}/webhooks/{webhook_id}/deliveries";
};

export type ListWebhookDeliveriesErrors = {
  /**
   * Validation Error
   */
  422: HttpValidationError;
};

export type ListWebhookDeliveriesError =
  ListWebhookDeliveriesErrors[keyof ListWebhookDeliveriesErrors];

export type ListWebhookDeliveriesResponses = {
  /**
   * Successful Response
   */
  200: WebhookDeliveryListResponse;
};

export type ListWebhookDeliveriesResponse =
  ListWebhookDeliveriesResponses[keyof ListWebhookDeliveriesResponses];

export type ClearBankMemoriesData = {
  body?: never;
  headers?: {
    /**
     * Authorization
     */
    authorization?: string | null;
  };
  path: {
    /**
     * Bank Id
     */
    bank_id: string;
  };
  query?: {
    /**
     * Type
     *
     * Optional fact type filter (world, experience, opinion)
     */
    type?: string | null;
  };
  url: "/v1/default/banks/{bank_id}/memories";
};

export type ClearBankMemoriesErrors = {
  /**
   * Validation Error
   */
  422: HttpValidationError;
};

export type ClearBankMemoriesError =
  ClearBankMemoriesErrors[keyof ClearBankMemoriesErrors];

export type ClearBankMemoriesResponses = {
  /**
   * Successful Response
   */
  200: DeleteResponse;
};

export type ClearBankMemoriesResponse =
  ClearBankMemoriesResponses[keyof ClearBankMemoriesResponses];

export type RetainMemoriesData = {
  body: RetainRequest;
  headers?: {
    /**
     * Authorization
     */
    authorization?: string | null;
  };
  path: {
    /**
     * Bank Id
     */
    bank_id: string;
  };
  query?: never;
  url: "/v1/default/banks/{bank_id}/memories";
};

export type RetainMemoriesErrors = {
  /**
   * Validation Error
   */
  422: HttpValidationError;
};

export type RetainMemoriesError =
  RetainMemoriesErrors[keyof RetainMemoriesErrors];

export type RetainMemoriesResponses = {
  /**
   * Successful Response
   */
  200: RetainResponse;
};

export type RetainMemoriesResponse =
  RetainMemoriesResponses[keyof RetainMemoriesResponses];

export type FileRetainData = {
  body: BodyFileRetain;
  headers?: {
    /**
     * Authorization
     */
    authorization?: string | null;
  };
  path: {
    /**
     * Bank Id
     */
    bank_id: string;
  };
  query?: never;
  url: "/v1/default/banks/{bank_id}/files/retain";
};

export type FileRetainErrors = {
  /**
   * Validation Error
   */
  422: HttpValidationError;
};

export type FileRetainError = FileRetainErrors[keyof FileRetainErrors];

export type FileRetainResponses = {
  /**
   * Successful Response
   */
  200: FileRetainResponse;
};

export type FileRetainResponse2 =
  FileRetainResponses[keyof FileRetainResponses];

export type ListAuditLogsData = {
  body?: never;
  headers?: {
    /**
     * Authorization
     */
    authorization?: string | null;
  };
  path: {
    /**
     * Bank Id
     */
    bank_id: string;
  };
  query?: {
    /**
     * Action
     *
     * Filter by action type
     */
    action?: string | null;
    /**
     * Transport
     *
     * Filter by transport (http, mcp, system)
     */
    transport?: string | null;
    /**
     * Start Date
     *
     * Filter from this ISO datetime (inclusive)
     */
    start_date?: string | null;
    /**
     * End Date
     *
     * Filter until this ISO datetime (exclusive)
     */
    end_date?: string | null;
    /**
     * Limit
     *
     * Max items to return
     */
    limit?: number;
    /**
     * Offset
     *
     * Offset for pagination
     */
    offset?: number;
  };
  url: "/v1/default/banks/{bank_id}/audit-logs";
};

export type ListAuditLogsErrors = {
  /**
   * Validation Error
   */
  422: HttpValidationError;
};

export type ListAuditLogsError = ListAuditLogsErrors[keyof ListAuditLogsErrors];

export type ListAuditLogsResponses = {
  /**
   * Successful Response
   */
  200: AuditLogListResponse;
};

export type ListAuditLogsResponse =
  ListAuditLogsResponses[keyof ListAuditLogsResponses];

export type AuditLogStatsData = {
  body?: never;
  headers?: {
    /**
     * Authorization
     */
    authorization?: string | null;
  };
  path: {
    /**
     * Bank Id
     */
    bank_id: string;
  };
  query?: {
    /**
     * Action
     *
     * Filter by action type
     */
    action?: string | null;
    /**
     * Period
     *
     * Time period: 1d, 7d, or 30d
     */
    period?: string;
  };
  url: "/v1/default/banks/{bank_id}/audit-logs/stats";
};

export type AuditLogStatsErrors = {
  /**
   * Validation Error
   */
  422: HttpValidationError;
};

export type AuditLogStatsError = AuditLogStatsErrors[keyof AuditLogStatsErrors];

export type AuditLogStatsResponses = {
  /**
   * Successful Response
   */
  200: AuditLogStatsResponse;
};

export type AuditLogStatsResponse2 =
  AuditLogStatsResponses[keyof AuditLogStatsResponses];
