import { defineConfig } from 'kiira-core' export default defineConfig({ // skills/** are the repo-level discovery skills; packages/*/skills are the // per-package skills that ship in each npm package. The READMEs ship in // each npm package too, and npm shows them on the package page. include: [ 'docs/**/*.md', 'skills/**/*.md', 'packages/*/skills/**/*.md', 'README.md', 'packages/*/README.md', ], tsconfig: 'tsconfig.docs.json', exclude: [ // docs/reference/** is auto-generated by TypeDoc (`pnpm generate-docs`); // hand-fixing those snippets would be overwritten on regeneration. 'docs/reference/**', // @tanstack/ai-angular is an ng-packagr bundle: its published entries // are dist/types/*.d.ts, which kiira's dist->src heuristic can't map back // to a source file (unlike every other package's dist/esm/index.d.ts -> // src/index.ts). So these docs only resolve against the built package, // which isn't available during a source-based docs check. Excluded until // ai-angular exposes a source-resolvable entry. 'docs/api/ai-angular.md', 'docs/ui/angular.md', 'packages/ai-angular/README.md', // docs/superpowers/** are internal planning/spec artifacts (design docs and // implementation plans), not published, curated examples. Their snippets are // illustrative pseudo-code, not meant to compile against package source. 'docs/superpowers/**', ], defaultValidate: 'type', languages: ['ts', 'tsx', 'js', 'jsx'], // Third-party packages the docs import but the workspace doesn't depend on. // kiira installs these into an isolated cache (node_modules/.kiira) and // type-checks against them, so snippets that show real integrations (Vercel // AI SDK migration, community adapters, redis/pino/otel/express/hono, other // schema libs) are validated instead of `ignore`d. externalPackages: { // Vercel AI SDK (comparison is v7; migration "before" fences stay on // APIs that v7 still exports, including deprecated aliases) ai: '^7.0.0', '@ai-sdk/openai': '^4.0.0', '@ai-sdk/anthropic': '^4.0.0', '@ai-sdk/google': '^4.0.0', '@ai-sdk/react': '^4.0.0', // Provider SDKs / schema libraries shown in examples openai: '^6.0.0', arktype: '^2.0.0', valibot: '^1.0.0', '@valibot/to-json-schema': '^1.0.0', '@modelcontextprotocol/sdk': '^1.29.0', // Server / infra libraries used by real integration examples. // (express is intentionally NOT declared here: it's already a transitive // dependency in the workspace node_modules without its @types, which // shadows any cache copy — so those two express snippets stay `ignore`d.) hono: '^4.0.0', '@hono/node-server': '^2.0.0', redis: '^6.0.0', ioredis: '^5.0.0', pino: '^10.0.0', '@opentelemetry/api': '^1.9.0', // Community adapters (each documented page imports its published package) '@cloudflare/tanstack-ai': '^0.1.0', '@cloudflare/workers-types': '^4.20260317.1', '@decartai/tanstack-ai-adapter': '^0.0.2', '@mynthio/tanstack-ai-adapter': '^0.0.14', '@cencori/ai-sdk': '^0.4.0', '@soniox/tanstack-ai-adapter': '^0.1.2', '@upstash/agentkit-tanstack-ai': '^0.1.1', '@upstash/blob': '^0.0.8', '@fal-ai/client': '1.11.0-alpha.5', // Octane is a peer of @tanstack/ai-octane, not a root workspace dep. octane: '^0.1.17', // Remix 3 is a peer of @tanstack/ai-remix, not a root workspace dep. remix: '^3.0.0-rc.1', // TextPart highlighter examples. Not a workspace dependency. // Subpath exports are mapped in tsconfig.docs.json because kiira // does not read package.json exports. '@tanstack/highlight': '^0.1.0', // remix/ui re-exports this. Kiira's paths["*"] does not read the // package.json exports field, so the jsx-runtime file must exist on disk. '@remix-run/ui': '^0.8.0', }, overrides: [ // React (and anything not overridden below) uses the automatic JSX // runtime so snippets don't need an explicit `import React`. // noImplicitReturns is off: doc snippets routinely show callbacks that // return on some branches and fall through on others (e.g. a middleware // hook that returns a decision or continues), which is valid and shouldn't // force an explicit return type or trailing `return`. { include: [ 'docs/**/*.md', 'skills/**/*.md', 'packages/*/skills/**/*.md', 'README.md', 'packages/*/README.md', ], jsx: 'react-jsx', jsxImportSource: 'react', noImplicitReturns: false, }, // Solid snippets compile JSX through solid-js. { include: [ 'docs/api/ai-solid.md', 'docs/ui/solid.md', 'packages/ai-solid/README.md', ], jsx: 'preserve', jsxImportSource: 'solid-js', }, // Preact snippets compile JSX through preact. { include: ['docs/api/ai-preact.md', 'docs/ui/preact.md'], jsx: 'react-jsx', jsxImportSource: 'preact', }, // Octane snippets compile JSX through octane. Standard TSX works; // TSRX (`@{`, `@for`) is not TypeScript, so docs use TSX here. // `octane/jsx-runtime` is types-only via package.json exports; // kiira's paths["*"] does not read exports, so `octane/dist` points // at dist/jsx-runtime.d.ts, which exists on disk. { include: [ 'docs/api/ai-octane.md', 'docs/ui/octane.md', 'packages/ai-octane/README.md', ], jsx: 'react-jsx', jsxImportSource: 'octane/dist', }, // Remix snippets compile JSX through remix/ui. `remix/ui/jsx-runtime` // is types-only via package.json exports; kiira's paths["*"] does not // read exports, so `remix/dist/ui` points at dist/ui/jsx-runtime.d.ts, // which exists on disk. Subpath imports (`remix/ui`, `remix/router`) // are mapped in tsconfig.docs.json for the same reason. { include: ['docs/api/ai-remix.md', 'docs/ui/remix.md'], jsx: 'react-jsx', jsxImportSource: 'remix/dist/ui', }, ], })