{"version":3,"file":"artifacts.cjs","names":[],"sources":["../../src/batteries/artifacts/index.ts"],"sourcesContent":["/**\n * Artifacts battery: structured query tools for multiple document formats.\n *\n * @remarks\n * Exports the four artifact classes ({@link SpooledToonArtifact},\n * {@link SpooledYamlArtifact}, {@link SpooledXmlArtifact}, {@link SpooledEcmaScriptArtifact})\n * and their converters from their respective batteries. Also exports the\n * {@link registerArtifactEncodables} function for encoding support.\n *\n * Note: `decode()` on artifact instances throws until `registerArtifactEncodables()`\n * has been called. `encode()` requires no setup — the classes carry the\n * `Symbol.for('@nhtio/encoder:toEncoded')` method with zero dependency on the encoder.\n *\n * @module @nhtio/adk/batteries/artifacts\n */\n\nexport * from './toon'\nexport * from './yaml'\nexport * from './xml'\nexport * from './ecmascript'\n\n/**\n * Registers the four artifact classes with the '@nhtio/encoder' decoder.\n *\n * @remarks\n * This function must be called once before decoding artifact instances that were\n * previously encoded. It is idempotent and safe to call multiple times. Consumers\n * who need both core primitives and artifacts typically call\n * `registerAdkEncodables()` (from the encoding battery) followed by this function.\n *\n * @returns A promise that resolves when registration is complete.\n * @throws If '@nhtio/encoder' is not available or registration fails.\n *\n * @example\n * ```ts\n * import { registerArtifactEncodables } from '@nhtio/adk/batteries/artifacts'\n * await registerArtifactEncodables()\n * ```\n */\nexport const registerArtifactEncodables = async (): Promise<void> => {\n  const { registerClass } = await import('@nhtio/encoder')\n  const { SpooledToonArtifact } = await import('./toon')\n  const { SpooledYamlArtifact } = await import('./yaml')\n  const { SpooledXmlArtifact } = await import('./xml')\n  const { SpooledEcmaScriptArtifact } = await import('./ecmascript')\n\n  for (const ctor of [\n    SpooledToonArtifact,\n    SpooledYamlArtifact,\n    SpooledXmlArtifact,\n    SpooledEcmaScriptArtifact,\n  ]) {\n    registerClass(ctor as unknown as Parameters<typeof registerClass>[0])\n  }\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;AAuCA,IAAa,6BAA6B,YAA2B;CACnE,MAAM,EAAE,kBAAkB,MAAM,OAAO;CACvC,MAAM,EAAE,wBAAwB,MAAA,QAAA,QAAA,EAAA,WAAA,QAAM,sBAAA,CAAA;CACtC,MAAM,EAAE,wBAAwB,MAAA,QAAA,QAAA,EAAA,WAAA,QAAM,sBAAA,CAAA;CACtC,MAAM,EAAE,uBAAuB,MAAA,QAAA,QAAA,EAAA,WAAA,QAAM,qBAAA,CAAA;CACrC,MAAM,EAAE,8BAA8B,MAAA,QAAA,QAAA,EAAA,WAAA,QAAM,4BAAA,CAAA;CAE5C,KAAK,MAAM,QAAQ;EACjB;EACA;EACA;EACA;CACF,GACE,cAAc,IAAsD;AAExE"}