{"version":3,"file":"exceptions.cjs","names":[],"sources":["../../../../src/batteries/llm/gemini_generate_content/exceptions.ts"],"sourcesContent":["/**\n * Battery-scoped exception constructors for the native Gemini `generateContent` adapter.\n *\n * @module @nhtio/adk/batteries/llm/gemini_generate_content/exceptions\n *\n * @remarks\n * Owned by the battery, not the ADK core, and minted via `createException` from\n * `@nhtio/adk/factories`. The set mirrors the other chat batteries with one Gemini-specific\n * addition: {@link E_GEMINI_MISSING_THOUGHT_SIGNATURE}, which classifies the vendor's own hard\n * rejection of unsigned historical function calls so a caller can tell it apart from a generic\n * invalid-request — Gemini's error body is otherwise an opaque `INVALID_ARGUMENT`.\n */\n\nimport { createException } from '@nhtio/adk/factories'\n\n/** Resolved options (constructor, executor overrides, or `stash.geminiGenerateContent`) failed validation. */\nexport const E_INVALID_GEMINI_GENERATE_CONTENT_OPTIONS = createException<[string]>(\n  'E_INVALID_GEMINI_GENERATE_CONTENT_OPTIONS',\n  'Invalid Gemini generateContent adapter options: %s',\n  'E_INVALID_GEMINI_GENERATE_CONTENT_OPTIONS',\n  529,\n  true\n)\n\n/** Context token weight exceeded the configured window. */\nexport const E_GEMINI_GENERATE_CONTENT_CONTEXT_OVERFLOW = createException<[number, number, string]>(\n  'E_GEMINI_GENERATE_CONTENT_CONTEXT_OVERFLOW',\n  'Gemini generateContent request token weight (%d) exceeds context window (%d) under encoding %s',\n  'E_GEMINI_GENERATE_CONTENT_CONTEXT_OVERFLOW',\n  529,\n  true\n)\n\n/** The provider returned a non-2xx status. */\nexport const E_GEMINI_REQUEST_FAILED = createException<[number, string]>(\n  'E_GEMINI_REQUEST_FAILED',\n  'Gemini generateContent request failed with status %s: %s',\n  'E_GEMINI_REQUEST_FAILED',\n  502,\n  false\n)\n\n/**\n * Gemini rejected the request because a historical `functionCall` part carried no\n * `thoughtSignature`.\n *\n * @remarks\n * Distinguished from a generic invalid-request because it is ACTIONABLE: the caller either replays\n * a genuine signature, or opts into the documented sentinel via\n * `thoughtSignatureSentinel`. Gemini 3+ enforces this; 2.5 treats it as advisory.\n */\nexport const E_GEMINI_MISSING_THOUGHT_SIGNATURE = createException<[string]>(\n  'E_GEMINI_MISSING_THOUGHT_SIGNATURE',\n  'Gemini rejected a historical functionCall with no thoughtSignature: %s',\n  'E_GEMINI_MISSING_THOUGHT_SIGNATURE',\n  400,\n  false\n)\n\n/** A transport error or malformed frame killed the stream mid-generation. */\nexport const E_GEMINI_STREAM_ERROR = createException<[string]>(\n  'E_GEMINI_STREAM_ERROR',\n  'Gemini generateContent stream error: %s',\n  'E_GEMINI_STREAM_ERROR',\n  502,\n  false\n)\n\n/** A `functionCall` part carried an `args` value that is not a plain object. */\nexport const E_GEMINI_INVALID_TOOL_CALL_ARGS = createException<[string]>(\n  'E_GEMINI_INVALID_TOOL_CALL_ARGS',\n  'Gemini functionCall args are not a plain object: %s',\n  'E_GEMINI_INVALID_TOOL_CALL_ARGS',\n  422,\n  false\n)\n"],"mappings":";;;;;;;;;;;;;;;;;;AAgBA,IAAa,4CAA4C,mBAAA,gBACvD,6CACA,sDACA,6CACA,KACA,IACF;;AAGA,IAAa,6CAA6C,mBAAA,gBACxD,8CACA,kGACA,8CACA,KACA,IACF;;AAGA,IAAa,0BAA0B,mBAAA,gBACrC,2BACA,4DACA,2BACA,KACA,KACF;;;;;;;;;;AAWA,IAAa,qCAAqC,mBAAA,gBAChD,sCACA,0EACA,sCACA,KACA,KACF;;AAGA,IAAa,wBAAwB,mBAAA,gBACnC,yBACA,2CACA,yBACA,KACA,KACF;;AAGA,IAAa,kCAAkC,mBAAA,gBAC7C,mCACA,uDACA,mCACA,KACA,KACF"}