/** * @module @nhtio/adk/eslint/rules/token_encoding_requires_context_window * * Flags a Chat Completions adapter options literal that sets a non-null `tokenEncoding` but omits * `contextWindow`. * * Why: the OpenAI / WebLLM Chat Completions batteries only perform local token counting + overflow * protection when BOTH `tokenEncoding` (how to count) and `contextWindow` (the budget to count * against) are provided. Setting `tokenEncoding` alone is a footgun — the encoding is configured but * there is no ceiling to enforce, so the overflow guard silently never runs. The adapters throw on * this cross-field mismatch at iteration time; this rule surfaces it at the construction site. * * Detects `new OpenAIChatCompletionsAdapter({ … })` / `new WebLLMChatCompletionsAdapter({ … })` * (and any `*ChatCompletionsAdapter`) where `tokenEncoding` is present and not `null`/`undefined` * while `contextWindow` is absent. * * Opt-out: * // eslint-disable-next-line adk/token-encoding-requires-context-window -- */ /** ESLint rule: flags setting a tokenEncoding without also setting a contextWindow. */ declare const tokenEncodingRequiresContextWindowRule: import("@typescript-eslint/utils/ts-eslint").RuleModule<"requireContextWindow", [ ], unknown, import("@typescript-eslint/utils/ts-eslint").RuleListener> & { name: string; }; export default tokenEncodingRequiresContextWindowRule;