Skip to content
Source
Sign inSign up
TanStack/ai
Open History to see the last commit

kiira.config.ts

124 lines5.6 KB

1import { defineConfig } from 'kiira-core'
2​
3export default defineConfig({
4 // skills/** are the repo-level discovery skills; packages/*/skills are the
5 // per-package skills that ship in each npm package.
6 include: ['docs/**/*.md', 'skills/**/*.md', 'packages/*/skills/**/*.md'],
7 tsconfig: 'tsconfig.docs.json',
8 exclude: [
9 // docs/reference/** is auto-generated by TypeDoc (`pnpm generate-docs`);
10 // hand-fixing those snippets would be overwritten on regeneration.
11 'docs/reference/**',
12 // @tanstack/ai-angular is an ng-packagr bundle: its published entries
13 // are dist/types/*.d.ts, which kiira's dist->src heuristic can't map back
14 // to a source file (unlike every other package's dist/esm/index.d.ts ->
15 // src/index.ts). So these docs only resolve against the built package,
16 // which isn't available during a source-based docs check. Excluded until
17 // ai-angular exposes a source-resolvable entry.
18 'docs/api/ai-angular.md',
19 'docs/ui/angular.md',
20 // docs/superpowers/** are internal planning/spec artifacts (design docs and
21 // implementation plans), not published, curated examples. Their snippets are
22 // illustrative pseudo-code, not meant to compile against package source.
23 'docs/superpowers/**',
24 ],
25 defaultValidate: 'type',
26 languages: ['ts', 'tsx', 'js', 'jsx'],
27 // Third-party packages the docs import but the workspace doesn't depend on.
28 // kiira installs these into an isolated cache (node_modules/.kiira) and
29 // type-checks against them, so snippets that show real integrations (Vercel
30 // AI SDK migration, community adapters, redis/pino/otel/express/hono, other
31 // schema libs) are validated instead of `ignore`d.
32 externalPackages: {
33 // Vercel AI SDK (comparison is v7; migration "before" fences stay on
34 // APIs that v7 still exports, including deprecated aliases)
35 ai: '^7.0.0',
36 '@ai-sdk/openai': '^4.0.0',
37 '@ai-sdk/anthropic': '^4.0.0',
38 '@ai-sdk/google': '^4.0.0',
39 '@ai-sdk/react': '^4.0.0',
40 // Provider SDKs / schema libraries shown in examples
41 openai: '^6.0.0',
42 arktype: '^2.0.0',
43 valibot: '^1.0.0',
44 '@valibot/to-json-schema': '^1.0.0',
45 '@modelcontextprotocol/sdk': '^1.29.0',
46 // Server / infra libraries used by real integration examples.
47 // (express is intentionally NOT declared here: it's already a transitive
48 // dependency in the workspace node_modules without its @types, which
49 // shadows any cache copy — so those two express snippets stay `ignore`d.)
50 hono: '^4.0.0',
51 '@hono/node-server': '^2.0.0',
52 redis: '^6.0.0',
53 ioredis: '^5.0.0',
54 pino: '^10.0.0',
55 '@opentelemetry/api': '^1.9.0',
56 // Community adapters (each documented page imports its published package)
57 '@cloudflare/tanstack-ai': '^0.1.0',
58 '@cloudflare/workers-types': '^4.20260317.1',
59 '@decartai/tanstack-ai-adapter': '^0.0.2',
60 '@mynthio/tanstack-ai-adapter': '^0.0.14',
61 '@cencori/ai-sdk': '^0.4.0',
62 '@soniox/tanstack-ai-adapter': '^0.1.2',
63 '@upstash/agentkit-tanstack-ai': '^0.1.1',
64 '@upstash/blob': '^0.0.8',
65 '@fal-ai/client': '1.11.0-alpha.5',
66 // Octane is a peer of @tanstack/ai-octane, not a root workspace dep.
67 octane: '^0.1.17',
68 // Remix 3 is a peer of @tanstack/ai-remix, not a root workspace dep.
69 remix: '^3.0.0-rc.1',
70 // TextPart highlighter examples. Not a workspace dependency.
71 // Subpath exports are mapped in tsconfig.docs.json because kiira
72 // does not read package.json exports.
73 '@tanstack/highlight': '^0.1.0',
74 // remix/ui re-exports this. Kiira's paths["*"] does not read the
75 // package.json exports field, so the jsx-runtime file must exist on disk.
76 '@remix-run/ui': '^0.8.0',
77 },
78 overrides: [
79 // React (and anything not overridden below) uses the automatic JSX
80 // runtime so snippets don't need an explicit `import React`.
81 // noImplicitReturns is off: doc snippets routinely show callbacks that
82 // return on some branches and fall through on others (e.g. a middleware
83 // hook that returns a decision or continues), which is valid and shouldn't
84 // force an explicit return type or trailing `return`.
85 {
86 include: ['docs/**/*.md', 'skills/**/*.md', 'packages/*/skills/**/*.md'],
87 jsx: 'react-jsx',
88 jsxImportSource: 'react',
89 noImplicitReturns: false,
90 },
91 // Solid snippets compile JSX through solid-js.
92 {
93 include: ['docs/api/ai-solid.md', 'docs/ui/solid.md'],
94 jsx: 'preserve',
95 jsxImportSource: 'solid-js',
96 },
97 // Preact snippets compile JSX through preact.
98 {
99 include: ['docs/api/ai-preact.md', 'docs/ui/preact.md'],
100 jsx: 'react-jsx',
101 jsxImportSource: 'preact',
102 },
103 // Octane snippets compile JSX through octane. Standard TSX works;
104 // TSRX (`@{`, `@for`) is not TypeScript, so docs use TSX here.
105 // `octane/jsx-runtime` is types-only via package.json exports;
106 // kiira's paths["*"] does not read exports, so `octane/dist` points
107 // at dist/jsx-runtime.d.ts, which exists on disk.
108 {
109 include: ['docs/api/ai-octane.md', 'docs/ui/octane.md'],
110 jsx: 'react-jsx',
111 jsxImportSource: 'octane/dist',
112 },
113 // Remix snippets compile JSX through remix/ui. `remix/ui/jsx-runtime`
114 // is types-only via package.json exports; kiira's paths["*"] does not
115 // read exports, so `remix/dist/ui` points at dist/ui/jsx-runtime.d.ts,
116 // which exists on disk. Subpath imports (`remix/ui`, `remix/router`)
117 // are mapped in tsconfig.docs.json for the same reason.
118 {
119 include: ['docs/api/ai-remix.md', 'docs/ui/remix.md'],
120 jsx: 'react-jsx',
121 jsxImportSource: 'remix/dist/ui',
122 },
123 ],
124})