@@ -45,6 +45,59 @@ const message = await complete(model!, {
4545console .log (message .content );
4646```
4747
48+ ## Requirements
49+
50+ Node ` >=18.17.0 ` . The provider adapters use ` globalThis.fetch ` directly — no
51+ ponyfill, no polyfill. All supported runtimes (modern browsers, Bun, Deno, and
52+ Node 18.17+) ship a Web-standard fetch with a ` ReadableStream ` body, which the
53+ adapters need for SSE.
54+
55+ ## Consuming from webpack / Next.js
56+
57+ The packages publish ESM with ` .js ` -suffixed relative imports (e.g.
58+ ` from './foo.js' ` ), which is the correct ESM-with-TS pattern. Webpack does not
59+ auto-rewrite ` .js ` → ` .ts ` when reading TypeScript sources directly (e.g. when
60+ linking the workspace from ` apps/ ` ), so add an ` extensionAlias ` to your
61+ ` next.config.mjs ` :
62+
63+ ``` js
64+ // next.config.mjs
65+ export default {
66+ transpilePackages: [
67+ ' agentic-kit' ,
68+ ' @agentic-kit/agent' ,
69+ ' @agentic-kit/react' ,
70+ ' @agentic-kit/openai' ,
71+ ' @agentic-kit/anthropic' ,
72+ ' @agentic-kit/ollama' ,
73+ ],
74+ webpack : (config ) => {
75+ config .resolve .extensionAlias = {
76+ ' .js' : [' .ts' , ' .tsx' , ' .js' ],
77+ ' .mjs' : [' .mts' , ' .mjs' ],
78+ };
79+ return config;
80+ },
81+ };
82+ ```
83+
84+ Once a published artifact is installed (` npm install agentic-kit ` ), the
85+ compiled ` dist/ ` is what resolves and no ` extensionAlias ` is required — this
86+ workaround only matters when reading TypeScript source through webpack.
87+
88+ Vite, Bun, and esbuild handle ` .js ` → ` .ts ` natively. Vite users who want to
89+ consume the workspace TypeScript source via the package ` "source" ` condition
90+ can opt in with:
91+
92+ ``` js
93+ // vite.config.ts
94+ export default {
95+ resolve: {
96+ conditions: [' source' , ' import' , ' module' , ' browser' , ' default' ],
97+ },
98+ };
99+ ```
100+
48101## Contributing
49102
50103See individual package READMEs for docs and local dev instructions.
0 commit comments