{"version":3,"file":"exceptions.cjs","names":[],"sources":["../../../src/batteries/vector/exceptions.ts"],"sourcesContent":["/**\n * Battery-scoped exception constructors for vector store adapter failures.\n *\n * @module @nhtio/adk/batteries/vector/exceptions\n *\n * @remarks\n * Battery-scoped exception classes for the vector store battery. These exceptions are owned\n * by the battery (not the ADK core) and are minted via `createException` from\n * `@nhtio/adk/factories`. Re-exported from the battery's barrel.\n */\n\nimport { createException } from '@nhtio/adk/factories'\n\n/**\n * Thrown when the vector store configuration fails validation.\n * Fatal: config bugs fail loud at construction time.\n */\nexport const E_INVALID_VECTOR_STORE_CONFIG = createException<[string]>(\n  'E_INVALID_VECTOR_STORE_CONFIG',\n  'Invalid vector store config: %s',\n  'E_INVALID_VECTOR_STORE_CONFIG',\n  529,\n  true\n)\n\n/**\n * Thrown when the vector store driver is unavailable.\n * Fatal: driver failures are critical.\n */\nexport const E_VECTOR_STORE_DRIVER_UNAVAILABLE = createException<[string]>(\n  'E_VECTOR_STORE_DRIVER_UNAVAILABLE',\n  'Vector store driver unavailable: %s',\n  'E_VECTOR_STORE_DRIVER_UNAVAILABLE',\n  503,\n  true\n)\n\n/**\n * Thrown when the vector store adapter receives text input but has no encoder and no built-in encoding.\n * Fatal: encoding is required for vector operations.\n */\nexport const E_VECTOR_STORE_ENCODER_REQUIRED = createException<[string]>(\n  'E_VECTOR_STORE_ENCODER_REQUIRED',\n  'Vector store adapter \"%s\" received text input but has no encoder and no built-in encoding; supply an encoder or pass a precomputed vector',\n  'E_VECTOR_STORE_ENCODER_REQUIRED',\n  529,\n  true\n)\n\n/**\n * Thrown when a vector's dimension does not match the expected dimension.\n * Fatal: dimension mismatch indicates incompatible data.\n */\nexport const E_VECTOR_STORE_DIMENSION_MISMATCH = createException<[number, number]>(\n  'E_VECTOR_STORE_DIMENSION_MISMATCH',\n  'Vector dimension mismatch: expected %d, got %d',\n  'E_VECTOR_STORE_DIMENSION_MISMATCH',\n  529,\n  true\n)\n\n/**\n * Thrown when a filter operator/dialect is unsupported by the adapter.\n * Fatal: unsupported filter dialects cannot be processed.\n */\nexport const E_VECTOR_STORE_UNSUPPORTED_FILTER_OPERATOR = createException<[string, string]>(\n  'E_VECTOR_STORE_UNSUPPORTED_FILTER_OPERATOR',\n  'Filter operator/dialect unsupported by adapter \"%s\": %s',\n  'E_VECTOR_STORE_UNSUPPORTED_FILTER_OPERATOR',\n  529,\n  true\n)\n\n/**\n * Thrown when an operation is unsupported by the adapter.\n * Fatal: unsupported operations cannot be performed.\n */\nexport const E_VECTOR_STORE_UNSUPPORTED_OPERATION = createException<[string, string]>(\n  'E_VECTOR_STORE_UNSUPPORTED_OPERATION',\n  'Operation \"%s\" is unsupported by adapter \"%s\"',\n  'E_VECTOR_STORE_UNSUPPORTED_OPERATION',\n  529,\n  true\n)\n\n/**\n * Thrown when the query builder is in a conflicting state.\n * Fatal: conflicting state indicates programming errors.\n */\nexport const E_VECTOR_STORE_QUERY_CONFLICT = createException<[string]>(\n  'E_VECTOR_STORE_QUERY_CONFLICT',\n  'Conflicting query builder state: %s',\n  'E_VECTOR_STORE_QUERY_CONFLICT',\n  529,\n  true\n)\n\n/**\n * Thrown when a read operation requires an explicit select projection.\n * Fatal: projection is required for read operations.\n */\nexport const E_VECTOR_STORE_PROJECTION_REQUIRED = createException<[]>(\n  'E_VECTOR_STORE_PROJECTION_REQUIRED',\n  'A read requires an explicit .select() projection',\n  'E_VECTOR_STORE_PROJECTION_REQUIRED',\n  529,\n  true\n)\n\n/**\n * Thrown when the adapter does not support transactions.\n * Fatal: transaction support is required for the requested operation.\n */\nexport const E_VECTOR_STORE_TRANSACTIONS_UNSUPPORTED = createException<[string]>(\n  'E_VECTOR_STORE_TRANSACTIONS_UNSUPPORTED',\n  'Adapter \"%s\" does not support transactions',\n  'E_VECTOR_STORE_TRANSACTIONS_UNSUPPORTED',\n  529,\n  true\n)\n\n/**\n * Thrown when the raw fragment placeholder count does not match the bindings length.\n * Fatal: binding mismatch indicates query construction errors.\n */\nexport const E_VECTOR_STORE_RAW_BINDING_MISMATCH = createException<[number, number]>(\n  'E_VECTOR_STORE_RAW_BINDING_MISMATCH',\n  'Raw fragment placeholder count (%d) does not match bindings length (%d)',\n  'E_VECTOR_STORE_RAW_BINDING_MISMATCH',\n  529,\n  true\n)\n\n/**\n * Thrown when a vector record at a specific index is invalid.\n * Fatal: invalid records cannot be processed.\n */\nexport const E_INVALID_VECTOR_RECORD = createException<[number, string]>(\n  'E_INVALID_VECTOR_RECORD',\n  'Invalid vector record at index %d: %s',\n  'E_INVALID_VECTOR_RECORD',\n  529,\n  true\n)\n\n/**\n * Thrown when a vector store operation cannot be confirmed with strong consistency within the bound.\n * Fatal: strong mode requires confirmation; timeout indicates a backend consistency issue.\n */\nexport const E_VECTOR_STORE_CONSISTENCY_TIMEOUT = createException<[string]>(\n  'E_VECTOR_STORE_CONSISTENCY_TIMEOUT',\n  'Strong consistency could not be confirmed within the bound: %s',\n  'E_VECTOR_STORE_CONSISTENCY_TIMEOUT',\n  504,\n  false\n)\n\n/**\n * Thrown when a migration fails.\n * Non-fatal: migration failures are recoverable.\n */\nexport const E_VECTOR_STORE_MIGRATION_FAILED = createException<[string, string]>(\n  'E_VECTOR_STORE_MIGRATION_FAILED',\n  'Migration \"%s\" failed: %s',\n  'E_VECTOR_STORE_MIGRATION_FAILED',\n  502,\n  false\n)\n\n/**\n * Thrown when a vector store connection fails.\n * Non-fatal: connection failures are recoverable.\n */\nexport const E_VECTOR_STORE_CONNECTION_FAILED = createException<[string]>(\n  'E_VECTOR_STORE_CONNECTION_FAILED',\n  'Vector store connection failed: %s',\n  'E_VECTOR_STORE_CONNECTION_FAILED',\n  502,\n  false\n)\n\n/**\n * Thrown when a collection operation fails.\n * Non-fatal: collection operation failures are recoverable.\n */\nexport const E_VECTOR_STORE_COLLECTION_FAILED = createException<[string, string]>(\n  'E_VECTOR_STORE_COLLECTION_FAILED',\n  'Collection operation \"%s\" failed: %s',\n  'E_VECTOR_STORE_COLLECTION_FAILED',\n  502,\n  false\n)\n\n/**\n * Thrown when a vector upsert fails.\n * Non-fatal: upsert failures are recoverable.\n */\nexport const E_VECTOR_STORE_UPSERT_FAILED = createException<[string]>(\n  'E_VECTOR_STORE_UPSERT_FAILED',\n  'Vector upsert failed: %s',\n  'E_VECTOR_STORE_UPSERT_FAILED',\n  502,\n  false\n)\n\n/**\n * Thrown when a vector search fails.\n * Non-fatal: search failures are recoverable.\n */\nexport const E_VECTOR_STORE_SEARCH_FAILED = createException<[string]>(\n  'E_VECTOR_STORE_SEARCH_FAILED',\n  'Vector search failed: %s',\n  'E_VECTOR_STORE_SEARCH_FAILED',\n  502,\n  false\n)\n\n/**\n * Thrown when a vector delete fails.\n * Non-fatal: delete failures are recoverable.\n */\nexport const E_VECTOR_STORE_DELETE_FAILED = createException<[string]>(\n  'E_VECTOR_STORE_DELETE_FAILED',\n  'Vector delete failed: %s',\n  'E_VECTOR_STORE_DELETE_FAILED',\n  502,\n  false\n)\n"],"mappings":";;;;;;;;;;;;;;;;;;;AAiBA,IAAa,gCAAgC,mBAAA,gBAC3C,iCACA,mCACA,iCACA,KACA,IACF;;;;;AAMA,IAAa,oCAAoC,mBAAA,gBAC/C,qCACA,uCACA,qCACA,KACA,IACF;;;;;AAMA,IAAa,kCAAkC,mBAAA,gBAC7C,mCACA,+IACA,mCACA,KACA,IACF;;;;;AAMA,IAAa,oCAAoC,mBAAA,gBAC/C,qCACA,kDACA,qCACA,KACA,IACF;;;;;AAMA,IAAa,6CAA6C,mBAAA,gBACxD,8CACA,6DACA,8CACA,KACA,IACF;;;;;AAMA,IAAa,uCAAuC,mBAAA,gBAClD,wCACA,qDACA,wCACA,KACA,IACF;;;;;AAMA,IAAa,gCAAgC,mBAAA,gBAC3C,iCACA,uCACA,iCACA,KACA,IACF;;;;;AAMA,IAAa,qCAAqC,mBAAA,gBAChD,sCACA,oDACA,sCACA,KACA,IACF;;;;;AAMA,IAAa,0CAA0C,mBAAA,gBACrD,2CACA,gDACA,2CACA,KACA,IACF;;;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