{"version":3,"file":"eslint.cjs","names":[],"sources":["../src/eslint/index.ts"],"sourcesContent":["/**\n * @module @nhtio/adk/eslint\n *\n * The `@nhtio/adk` ESLint plugin: machine-checkable enforcement of the harness contracts that\n * implementors of bring-your-own batteries, tools, and primitives are most likely to get wrong.\n *\n * @remarks\n * These rules turn documented footguns into lint errors. They are report-only (no autofix) — each\n * names the contract it enforces and the fix; carve out a deliberate exception with an inline\n * `// eslint-disable-next-line adk/<rule> -- <reason>` comment.\n *\n * `@typescript-eslint/utils` and `eslint` are OPTIONAL peer dependencies of `@nhtio/adk` — installed\n * only by consumers who lint with this plugin. The main library never imports this module.\n *\n * @example Flat config\n * ```ts\n * import adk from '@nhtio/adk/eslint'\n *\n * export default [\n *   { plugins: { adk: adk.plugin }, rules: adk.configs.recommended.rules },\n * ]\n * ```\n */\n\nimport { default as noModelInToolHandler } from './rules/no_model_in_tool_handler'\nimport { default as requireValidatorAnyRequired } from './rules/require_validator_any_required'\nimport { default as requireStringEmptyDisposition } from './rules/require_string_empty_disposition'\nimport { default as thoughtPayloadRequiresReplayTag } from './rules/thought_payload_requires_replay_tag'\nimport { default as tokenEncodingRequiresContextWindow } from './rules/token_encoding_requires_context_window'\nimport { default as artifactToolForbidsArtifactConstructor } from './rules/artifact_tool_forbids_artifact_constructor'\nimport type { FlatConfig } from '@typescript-eslint/utils/ts-eslint'\n\n/**\n * Map of rule id (without the `adk/` plugin prefix) to its rule object. Registered on the plugin as\n * `rules`, so configs reference them as `adk/<id>`.\n */\nexport const rules = {\n  'require-validator-any-required': requireValidatorAnyRequired,\n  'require-string-empty-disposition': requireStringEmptyDisposition,\n  'no-model-in-tool-handler': noModelInToolHandler,\n  'thought-payload-requires-replay-tag': thoughtPayloadRequiresReplayTag,\n  'token-encoding-requires-context-window': tokenEncodingRequiresContextWindow,\n  'artifact-tool-forbids-artifact-constructor': artifactToolForbidsArtifactConstructor,\n} satisfies FlatConfig.Plugin['rules']\n\n/**\n * The ESLint plugin object. Register under the `adk` namespace: `plugins: { adk: plugin }`.\n */\nexport const plugin: FlatConfig.Plugin = {\n  meta: { name: '@nhtio/adk/eslint', version: __VERSION__ },\n  rules,\n}\n\n/** Every rule enabled at `error`, keyed `adk/<id>` (assumes the plugin is registered as `adk`). */\nconst recommendedRules: NonNullable<FlatConfig.Config['rules']> = Object.fromEntries(\n  Object.keys(rules).map((id) => [`adk/${id}`, 'error'])\n)\n\n/**\n * Named config presets. `recommended` enables every rule at `error` and registers the plugin under\n * the `adk` namespace — spread it into a flat config to adopt the full set.\n */\nexport const configs = {\n  recommended: {\n    name: '@nhtio/adk/eslint/recommended',\n    plugins: { adk: plugin },\n    rules: recommendedRules,\n  } satisfies FlatConfig.Config,\n}\n\n/**\n * Default export bundles the plugin and its config presets, mirroring the shape ESLint flat configs\n * expect from a plugin module.\n */\nexport default { plugin, rules, configs }\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAoCA,IAAa,QAAQ;CACnB,kCAAkC,oDAAA;CAClC,oCAAoC,sDAAA;CACpC,4BAA4B,8CAAA;CAC5B,uCAAuC,yDAAA;CACvC,0CAA0C,4DAAA;CAC1C,8CAA8C,gEAAA;AAChD;;;;AAKA,IAAa,SAA4B;CACvC,MAAM;EAAE,MAAM;EAAqB,SAAA;CAAqB;CACxD;AACF;;AAGA,IAAM,mBAA4D,OAAO,YACvE,OAAO,KAAK,KAAK,EAAE,KAAK,OAAO,CAAC,OAAO,MAAM,OAAO,CAAC,CACvD;;;;;AAMA,IAAa,UAAU,EACrB,aAAa;CACX,MAAM;CACN,SAAS,EAAE,KAAK,OAAO;CACvB,OAAO;AACT,EACF;;;;;AAMA,IAAA,iBAAe;CAAE;CAAQ;CAAO;AAAQ"}