Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
53 changes: 53 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,59 @@ const message = await complete(model!, {
console.log(message.content);
```

## Requirements

Node `>=18.17.0`. The provider adapters use `globalThis.fetch` directly — no
ponyfill, no polyfill. All supported runtimes (modern browsers, Bun, Deno, and
Node 18.17+) ship a Web-standard fetch with a `ReadableStream` body, which the
adapters need for SSE.

## Consuming from webpack / Next.js

The packages publish ESM with `.js`-suffixed relative imports (e.g.
`from './foo.js'`), which is the correct ESM-with-TS pattern. Webpack does not
auto-rewrite `.js` → `.ts` when reading TypeScript sources directly (e.g. when
linking the workspace from `apps/`), so add an `extensionAlias` to your
`next.config.mjs`:

```js
// next.config.mjs
export default {
transpilePackages: [
'agentic-kit',
'@agentic-kit/agent',
'@agentic-kit/react',
'@agentic-kit/openai',
'@agentic-kit/anthropic',
'@agentic-kit/ollama',
],
webpack: (config) => {
config.resolve.extensionAlias = {
'.js': ['.ts', '.tsx', '.js'],
'.mjs': ['.mts', '.mjs'],
};
return config;
},
};
```

Once a published artifact is installed (`npm install agentic-kit`), the
compiled `dist/` is what resolves and no `extensionAlias` is required — this
workaround only matters when reading TypeScript source through webpack.

Vite, Bun, and esbuild handle `.js` → `.ts` natively. Vite users who want to
consume the workspace TypeScript source via the package `"source"` condition
can opt in with:

```js
// vite.config.ts
export default {
resolve: {
conditions: ['source', 'import', 'module', 'browser', 'default'],
},
};
```

## Contributing

See individual package READMEs for docs and local dev instructions.
Expand Down
Loading
Loading