@yak-io/nextjs 0.4.3 → 0.6.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -1,26 +1,30 @@
1
1
  # @yak-io/nextjs
2
2
 
3
- Next.js integration layer for the Yak embeddable chat widget. This package focuses on the App Router plumbing (route scanning, CLI helpers, and ergonomic handler factories) while delegating the widget runtime to [`@yak-io/react`](../react) and [`@yak-io/javascript`](../javascript).
3
+ > 📚 **Full documentation:** https://docs.yak.io/docs/sdks/nextjs
4
+ >
5
+ > 🤖 **For LLMs / AI agents:** https://docs.yak.io/llms.txt
4
6
 
5
- ## Relationship to `@yak-io/javascript` and `@yak-io/react`
6
-
7
- - **`@yak-io/javascript`** exposes the framework-agnostic client logic (iframe communication, tool execution) and server utilities (`createYakHandler`, `RouteSource`, `ToolSource`, etc.).
8
- - **`@yak-io/react`** exposes the React provider/widget and hooks.
9
- - **`@yak-io/nextjs`** re-exports the client entrypoint for convenience and layers Next-specific helpers on top of the core primitives (route scanners, manifest CLI, handler factories that accept either simple callbacks or rich adapters).
10
-
11
- If you are not on Next.js you can depend on `@yak-io/react` directly and provide your own routing/tool adapters.
12
-
13
- ## Installation
7
+ Next.js (App Router) SDK for [Yak](https://docs.yak.io) — an embeddable AI assistant (text chat **and** push-to-talk voice) for web apps. It re-exports the React client and adds Next-specific plumbing: a Next-aware `YakProvider`, filesystem route scanning, a unified API-route handler, and a route-manifest CLI.
14
8
 
15
9
  ```bash
16
10
  pnpm add @yak-io/nextjs
17
11
  ```
18
12
 
19
- The widget core is pulled in automatically as a dependency.
13
+ The widget runtime ([`@yak-io/react`](https://docs.yak.io/docs/sdks/react) + [`@yak-io/javascript`](https://docs.yak.io/docs/sdks/javascript)) is pulled in automatically.
14
+
15
+ ## Package layout
16
+
17
+ | Import | Use in | Provides |
18
+ | --- | --- | --- |
19
+ | `@yak-io/nextjs/client` | Client components | `YakProvider`, `YakWidget`, `useYak`, `useYakToolEvent` (everything `@yak-io/react` exports), with Next-aware defaults. |
20
+ | `@yak-io/nextjs/server` | Route handlers | `createNextYakHandler` + route/tool source helpers. |
21
+ | CLI: `yak-nextjs` | `package.json` scripts | `generate-manifest` for production route discovery. |
22
+
23
+ The Next `YakProvider` defaults `getConfig` to `GET /api/yak`, `onToolCall` to `POST /api/yak`, and `onRedirect` to the Next router — so the client setup below needs no handlers wired by hand.
20
24
 
21
25
  ## Quickstart
22
26
 
23
- ### 1. Client widget
27
+ ### 1. Client — wrap your layout
24
28
 
25
29
  ```tsx
26
30
  // app/layout.tsx
@@ -30,10 +34,7 @@ export default function RootLayout({ children }: { children: React.ReactNode })
30
34
  return (
31
35
  <html lang="en">
32
36
  <body>
33
- <YakProvider
34
- appId={process.env.NEXT_PUBLIC_YAK_APP_ID!}
35
- theme={{ position: "bottom-right" }}
36
- >
37
+ <YakProvider appId={process.env.NEXT_PUBLIC_YAK_APP_ID!} mode="both">
37
38
  {children}
38
39
  <YakWidget />
39
40
  </YakProvider>
@@ -43,69 +44,63 @@ export default function RootLayout({ children }: { children: React.ReactNode })
43
44
  }
44
45
  ```
45
46
 
46
- ### 2. Unified API route
47
+ ### 2. Server — one API route
47
48
 
48
49
  ```ts
49
50
  // app/api/yak/[[...yak]]/route.ts
50
51
  import { createNextYakHandler } from "@yak-io/nextjs/server";
51
52
 
52
53
  export const { GET, POST } = createNextYakHandler({
53
- // Routes auto-scan from ./src/app and ./src/pages
54
+ // Routes auto-scan from ./src/app and ./src/pages.
55
+ // Add tools via adapters or inline sources (see below).
54
56
  });
55
57
  ```
56
58
 
57
- The handler responds to `GET` with route metadata (and optional tool manifest) and to `POST` with tool execution.
58
-
59
- ### 3. Programmatic control
59
+ `GET` returns the route/tool manifest the assistant sees; `POST` executes tool calls.
60
60
 
61
- Control the chat widget from your code:
61
+ ### 3. Control it from anywhere
62
62
 
63
63
  ```tsx
64
- // app/my-page/page.tsx
65
64
  "use client";
66
-
67
65
  import { useYak } from "@yak-io/nextjs/client";
68
66
 
69
- export default function MyPage() {
70
- const chat = useYak();
71
-
67
+ export function HelpButton() {
68
+ const { open, openWithPrompt, voiceToggle, voiceState } = useYak();
72
69
  return (
73
- <div>
74
- <button onClick={() => chat.open()}>Open Chat</button>
75
- <button onClick={() => chat.openWithPrompt("Explain this product")}>
76
- Product Help
77
- </button>
78
- <button onClick={() => chat.openWithPrompt("How do I use this feature?")}>
79
- Feature Help
80
- </button>
81
- {chat.isOpen && <p>Chat is open</p>}
82
- </div>
70
+ <>
71
+ <button onClick={open}>Open chat</button>
72
+ <button onClick={() => openWithPrompt("Explain this page")}>Page help</button>
73
+ <button onClick={voiceToggle}>{voiceState === "idle" ? "Start voice" : "Stop voice"}</button>
74
+ </>
83
75
  );
84
76
  }
85
77
  ```
86
78
 
87
- ### 4. Add tools (tRPC example)
79
+ `useYak()` returns the full chat + voice handle — see the [React SDK reference](https://docs.yak.io/docs/sdks/react) for the complete shape (`open`, `openWithPrompt`, `voiceStart`/`voiceStop`/`voiceToggle`, `voiceState`, `isOpen`, `chatLoading`, `voiceLoading`, …). Skip `<YakWidget>` and wire your own buttons for a fully custom UI.
80
+
81
+ ## Adding tools
82
+
83
+ Pass any tool adapter (or an array of them) to `tools`:
88
84
 
89
85
  ```ts
90
86
  import { createNextYakHandler } from "@yak-io/nextjs/server";
91
87
  import { createTRPCToolAdapter } from "@yak-io/trpc";
92
88
  import { appRouter, createContext } from "@/server/trpc";
93
89
 
94
- const trpcTools = createTRPCToolAdapter({
95
- id: "trpc",
96
- router: appRouter,
97
- createContext: async ({ req }) => createContext({ req }),
98
- allowedProcedures: ["orders.list", "orders.detail"],
99
- });
100
-
101
90
  export const { GET, POST } = createNextYakHandler({
102
- tools: trpcTools,
91
+ tools: createTRPCToolAdapter({
92
+ router: appRouter,
93
+ createContext: async ({ req }) => createContext({ req }),
94
+ allowedProcedures: ["orders.list", "orders.detail"],
95
+ }),
103
96
  });
104
97
  ```
105
98
 
106
- ## Route & tool injection
99
+ `routes` and `tools` each accept a single source or an array, so you can compose filesystem scanning, tRPC, GraphQL, REST, and CMS sources together.
100
+
101
+ ## Route discovery
107
102
 
108
- `createNextYakHandler` auto-scans `./src/app` **and** `./src/pages`, skips `api/` folders, and feeds the manifest to Yak. Override the directories or clamp the manifest with regex filters:
103
+ `createNextYakHandler` auto-scans `./src/app` and `./src/pages` (skipping `api/` folders), extracting `title`/`description` from each page's static `metadata`. Override or filter:
109
104
 
110
105
  ```ts
111
106
  import { createNextYakConfigHandler } from "@yak-io/nextjs/server";
@@ -114,79 +109,28 @@ export const { GET } = createNextYakConfigHandler({
114
109
  appDir: "./app",
115
110
  pagesDir: "./pages",
116
111
  routeFilter: {
117
- include: [/^\/docs/],
118
- exclude: [/^\/docs\/draft/],
112
+ include: [/^\/docs/], // at least one must match
113
+ exclude: [/^\/docs\/draft/], // remove any matches
119
114
  },
120
115
  });
121
116
  ```
122
117
 
123
- Providing `routeFilter.include` means at least one regex must match the path; `routeFilter.exclude` removes any matches. If you set `routes` or `getRoutes` the auto-scanner is bypassed, allowing you to compose your own sources:
118
+ Setting `routes` or `getRoutes` bypasses the auto-scanner so you can supply your own sources:
124
119
 
125
120
  ```ts
126
- import type { RouteSource } from "@yak-io/javascript/server";
127
- import {
128
- createNextYakHandler,
129
- scanRoutes,
130
- } from "@yak-io/nextjs/server";
131
- import { createTRPCToolAdapter } from "@yak-io/trpc";
132
-
133
- const marketingRoutes: RouteSource = {
134
- id: "marketing",
135
- getRoutes: async () => [
136
- { path: "/docs", title: "Documentation", description: "Product docs" },
137
- ],
138
- };
139
-
140
- const graphqlTools = {
141
- id: "graphql",
142
- getTools: async () => [{ name: "accounts.lookup", description: "Fetch account" }],
143
- executeTool: async (name, args) => {
144
- const res = await fetch("https://graphql.example.com", {
145
- method: "POST",
146
- headers: { "Content-Type": "application/json" },
147
- body: JSON.stringify({ query: buildQueryFor(name), variables: args }),
148
- });
149
- return res.json();
150
- },
151
- };
152
-
153
121
  export const { GET, POST } = createNextYakHandler({
154
- routes: [() => scanRoutes("./src/app"), marketingRoutes],
155
- tools: [createTRPCToolAdapter(trpcConfig), graphqlTools],
122
+ routes: [
123
+ { path: "/", title: "Home" },
124
+ { path: "/pricing", title: "Pricing" },
125
+ ],
156
126
  });
157
127
  ```
158
128
 
159
- Behind the scenes `@yak-io/javascript` merges every `RouteSource` into a single manifest and wires each tool definition to the adapter that registered it.
160
-
161
- ## CLI: route manifest generator
162
-
163
- ```bash
164
- yak-nextjs generate-manifest
165
- ```
166
-
167
- Use the CLI to generate a TypeScript module with your routes at build time.
168
-
169
- **Options:**
170
- - `--app-dir <path>` – Path to Next.js app directory (default: `./src/app`)
171
- - `--pages-dir <path>` – Path to Next.js pages directory (optional, scanned in addition to app-dir)
172
- - `--output <path>` – Output file path (default: `./src/yak.routes.ts`)
173
-
174
- **Examples:**
175
- ```bash
176
- yak-nextjs generate-manifest
177
- yak-nextjs generate-manifest --pages-dir ./src/pages
178
- yak-nextjs generate-manifest --app-dir ./app --output ./src/generated/routes.ts
179
- ```
180
-
181
- ## Route Manifest for Production (Required)
182
-
183
- > **Important:** This setup is required for production deployments. Skip this only if you are providing your own custom routes via the `routes` or `getRoutes` options.
129
+ ### Production manifest (required for filesystem scanning)
184
130
 
185
- During local development, routes are scanned directly from the filesystem. However, when you build your Next.js app for production, only the compiled `.next` output is included—source files like `./src/app` are not present at runtime, causing route discovery to fail.
131
+ Production builds ship only `.next` output source files like `./src/app` aren't present at runtime, so live scanning fails. Generate a manifest at build time instead. **Skip this only if you supply your own `routes`/`getRoutes`.**
186
132
 
187
- ### Required setup
188
-
189
- 1. Add a `prebuild` script to generate the manifest before Next.js builds:
133
+ 1. Generate the manifest before `next build`:
190
134
 
191
135
  ```json
192
136
  {
@@ -197,182 +141,60 @@ During local development, routes are scanned directly from the filesystem. Howev
197
141
  }
198
142
  ```
199
143
 
200
- The CLI auto-detects your directory structure. If your project uses non-standard paths, specify them explicitly:
201
-
202
- ```json
203
- {
204
- "scripts": {
205
- "prebuild": "yak-nextjs generate-manifest --app-dir ./app --output ./app/yak.routes.ts",
206
- "build": "next build"
207
- }
208
- }
209
- ```
210
-
211
144
  | Project structure | Command |
212
- |-------------------|-------------------------------------------------------|
145
+ | --- | --- |
213
146
  | `src/app/` (default) | `yak-nextjs generate-manifest` |
214
147
  | `app/` | `yak-nextjs generate-manifest --app-dir ./app --output ./app/yak.routes.ts` |
215
148
  | `src/app/` + `src/pages/` | `yak-nextjs generate-manifest --pages-dir ./src/pages` |
216
- | `app/` + `pages/` | `yak-nextjs generate-manifest --app-dir ./app --pages-dir ./pages --output ./app/yak.routes.ts` |
217
-
218
- 2. Add the generated file to `.gitignore`:
219
149
 
220
- ```gitignore
221
- # Generated route manifest (use the path matching your --output)
222
- src/yak.routes.ts
223
- # or for root app/ directory:
224
- # app/yak.routes.ts
225
- ```
150
+ 2. Gitignore the generated file (`src/yak.routes.ts` by default).
226
151
 
227
- 3. Use the route manifest adapter in your handler:
152
+ 3. Feed it through the manifest adapter:
228
153
 
229
154
  ```ts
230
155
  // app/api/yak/[[...yak]]/route.ts
231
156
  import { createNextYakHandler, createRouteManifestAdapter } from "@yak-io/nextjs/server";
232
- import { routes } from "@/yak.routes"; // Adjust path based on your tsconfig paths
157
+ import { routes } from "@/yak.routes";
233
158
 
234
159
  export const { GET, POST } = createNextYakHandler({
235
- routes: createRouteManifestAdapter({ routes }),
160
+ routes: createRouteManifestAdapter({
161
+ routes,
162
+ allowedRoutes: ["/", "/pricing", "/docs/*"], // optional
163
+ disallowedRoutes: ["/docs/internal/*"], // optional
164
+ }),
236
165
  });
237
166
  ```
238
167
 
239
- > **Note:** The import path depends on your `tsconfig.json` paths. Common configurations:
240
- > - `src/yak.routes.ts` → `@/yak.routes` (when `@/*` maps to `./src/*`)
241
- > - `app/yak.routes.ts` → `@/yak.routes` (when `@/*` maps to `./app/*`) or `../../../yak.routes`
242
-
243
- The generated TypeScript module is imported directly, ensuring it's bundled with your serverless function automatically.
244
-
245
- ### Route filtering
246
-
247
- Use `allowedRoutes` and `disallowedRoutes` to control which routes are exposed (similar to tRPC adapter):
248
-
249
- ```ts
250
- createRouteManifestAdapter({
251
- routes,
252
- allowedRoutes: ["/docs/*", "/pricing", "/"],
253
- disallowedRoutes: ["/docs/internal/*"],
254
- })
255
- ```
256
-
257
- Pattern matching:
258
- - Exact match: `"/pricing"` matches only `/pricing`
259
- - Prefix match: `"/docs/*"` matches `/docs`, `/docs/getting-started`, etc.
260
-
261
- ### Alternative: explicit routes
262
-
263
- If you prefer not to use filesystem scanning, provide routes explicitly:
264
-
265
- ```ts
266
- export const { GET, POST } = createNextYakHandler({
267
- routes: [
268
- { path: "/", title: "Home" },
269
- { path: "/pricing", title: "Pricing" },
270
- ],
271
- });
272
- ```
273
-
274
- ## API surface (server)
275
-
276
- `@yak-io/nextjs/server` exports:
277
-
278
- - `scanRoutes(directory: string, options?: { directoryType?: "app" | "pages" })` – low-level filesystem scanner (useful for precomputing manifests or composing custom sources). Only captures page routes, extracting `title` and `description` from static metadata exports.
279
- - `loadRouteManifest(path?: string)` – load a pre-built JSON manifest via filesystem read, returns `null` if not found.
280
- - `loadRoutes(path?: string)` – load routes from a manifest, throws with helpful error if not found.
281
- - `createNextYakHandler(config)` – unified GET + POST handler. When `routes`/`getRoutes` are omitted it auto-scans `./src/app` (override with `appDir`). In production, automatically fetches manifest from public folder.
282
- - `createNextYakConfigHandler(config)` – GET-only convenience wrapper.
283
- - `createNextYakToolsHandler(config)` – POST-only wrapper.
284
- - Re-exported types from `@yak-io/javascript/server` (RouteInfo, RouteManifest, ToolDefinition, ToolManifest, ToolExecutor, ChatConfig, RouteSourceInput, ToolSourceInput, etc.).
285
-
286
- ## Client props
287
-
288
- `YakProvider` accepts:
289
-
290
- | Prop | Type | Description |
291
- | --- | --- | --- |
292
- | `appId` | `string` | Yak app identifier |
293
- | `getConfig` | `() => Promise<ChatConfig>` | Config provider (default fetches `/api/yak`) |
294
- | `onToolCall` | `(name, args) => Promise<unknown>` | Tool call handler (default POSTs to `/api/yak`) |
295
- | `theme` | `Theme` | Chat panel theme (`position`, `colorMode`, colors) |
296
- | `onRedirect` | `(path: string) => void` | Custom navigation handler |
297
- | `disableRestartButton` | `boolean` | Hide the restart session button in the header |
298
-
299
- ## Hooks
300
-
301
- ### useYak
302
-
303
- Access the widget API from any component:
304
-
305
- ```tsx
306
- import { useYak } from "@yak-io/nextjs/client";
307
-
308
- export function ChatButton() {
309
- const { open, close, openWithPrompt, isOpen } = useYak();
310
- return <button onClick={() => open()}>Open Chat</button>;
311
- }
312
- ```
313
-
314
- ### useYakToolEvent
168
+ Pattern matching: `"/pricing"` is exact; `"/docs/*"` matches `/docs` and everything beneath it.
315
169
 
316
- Subscribe to tool call completion events for page-level cache invalidation:
170
+ ## Exports
317
171
 
318
- ```tsx
319
- import { useYakToolEvent } from "@yak-io/nextjs/client";
320
- import { trpc } from "@/utils/trpc";
321
-
322
- function PlanPage({ planId }: { planId: string }) {
323
- const utils = trpc.useUtils();
324
-
325
- useYakToolEvent((event) => {
326
- // Invalidate cache when plan-related tools are called
327
- if (event.ok && event.name.startsWith("plan.")) {
328
- utils.plan.get.invalidate({ id: planId });
329
- utils.planItem.list.invalidate({ planId });
330
- }
331
- });
332
-
333
- // ... component rendering
334
- }
335
- ```
172
+ **`@yak-io/nextjs/client`** — re-exports all of `@yak-io/react` (`YakProvider`, `YakWidget`, `useYak`, `useYakToolEvent`, types) with Next-aware `YakProvider` defaults. Plus the `YakChatAPI` type (`= ReturnType<typeof useYak>`).
336
173
 
337
- The event object contains:
174
+ **`@yak-io/nextjs/server`:**
338
175
 
339
- | Property | Type | Description |
340
- | --- | --- | --- |
341
- | `name` | `string` | The tool name that was called |
342
- | `args` | `unknown` | The arguments passed to the tool |
343
- | `ok` | `boolean` | Whether the call succeeded |
344
- | `result` | `unknown` | The result (if `ok` is true) |
345
- | `error` | `string` | The error message (if `ok` is false) |
176
+ | Export | Purpose |
177
+ | --- | --- |
178
+ | `createNextYakHandler(config)` | Unified `GET` + `POST` handler. Auto-scans routes when `routes`/`getRoutes` is omitted. |
179
+ | `createNextYakConfigHandler(config)` | `GET`-only (manifest) handler. |
180
+ | `createNextYakToolsHandler(config)` | `POST`-only (tool execution) handler. |
181
+ | `createRouteManifestAdapter({ routes, allowedRoutes?, disallowedRoutes? })` | Turn a prebuilt manifest into a `RouteSource`. |
182
+ | `scanRoutes(dir, options?)` | Low-level filesystem route scanner. |
183
+ | `loadRouteManifest(path?)` / `loadRoutes(path?)` | Load a prebuilt manifest. |
184
+ | Re-exported `@yak-io/javascript/server` types | `RouteInfo`, `RouteManifest`, `ToolDefinition`, `ToolManifest`, `ChatConfig`, `RouteSource`, `ToolSource`, … |
346
185
 
347
- `YakWidget` renders the launcher + iframe shell. It accepts:
186
+ ### `YakProvider` props (Next)
348
187
 
349
- | Prop | Type | Description |
350
- | --- | --- | --- |
351
- | `iframeClassName` | `string` | Optional CSS class for the iframe |
352
- | `triggerLabel` | `string` | Text to display next to the logo (default "Ask with AI") |
188
+ Same as [`@yak-io/react`](https://docs.yak.io/docs/sdks/react#yakprovider), but `getConfig`, `onToolCall`, and `onRedirect` default to the `/api/yak` route and the Next router. At minimum you only need `appId` (and `mode` if you want voice).
353
189
 
354
- ## Using `@yak-io/javascript` directly
355
-
356
- If you need to integrate with Remix, SvelteKit, or a custom Node runtime you can:
190
+ ## Logging
357
191
 
358
192
  ```ts
359
- import { createYakHandler } from "@yak-io/javascript/server";
193
+ import { enableYakLogging, disableYakLogging, isYakLoggingEnabled } from "@yak-io/nextjs/client";
360
194
 
361
- export const { GET, POST } = createYakHandler({
362
- routes: [{ id: "remix", getRoutes: listRoutes }],
363
- tools: [{ id: "graphql", getTools, executeTool }],
364
- });
195
+ enableYakLogging(); // verbose SDK logs
365
196
  ```
366
197
 
367
- The React provider/widget are also exported from `@yak-io/react`.
368
-
369
- ## Migration notes
370
-
371
- - Existing imports from `@yak-io/nextjs/client` continue to work, but the actual implementation lives in `@yak-io/react`.
372
- - `createNextYakHandler` auto-scans `./src/app` and `./src/pages`; configure via `appDir`, `pagesDir`, or regex-based `routeFilter`.
373
- - `createNextYakHandler` accepts `routes`/`tools` arrays. Legacy `getRoutes/getTools/executeTool` still work and are normalized internally.
374
- - For custom adapters prefer using `@yak-io/javascript/server` types so your code can be reused outside Next.js.
375
-
376
198
  ## License
377
199
 
378
- Proprietary - see LICENSE file
200
+ Proprietary see [LICENSE](./LICENSE).
@@ -161,7 +161,6 @@ const SPECIAL_PAGE_FILENAMES = new Set([
161
161
  /**
162
162
  * Recursively scan a pages directory for Next.js page routes
163
163
  */
164
- // biome-ignore lint/complexity/noExcessiveCognitiveComplexity: recursive directory scanner with multiple file type checks
165
164
  function scanPagesDirectory(dirPath, segments = []) {
166
165
  const routes = [];
167
166
  try {
@@ -1,5 +1,5 @@
1
- import type React from "react";
2
1
  import { type YakProviderProps as CoreYakProviderProps } from "@yak-io/react";
2
+ import type React from "react";
3
3
  export type YakProviderProps = CoreYakProviderProps;
4
4
  /**
5
5
  * Next-aware YakProvider that falls back to client-side navigation
@@ -1 +1 @@
1
- {"version":3,"file":"YakProvider.d.ts","sourceRoot":"","sources":["../../src/client/YakProvider.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAG/B,OAAO,EAEL,KAAK,gBAAgB,IAAI,oBAAoB,EAC9C,MAAM,eAAe,CAAC;AAEvB,MAAM,MAAM,gBAAgB,GAAG,oBAAoB,CAAC;AAkCpD;;;;;;;;;GASG;AACH,wBAAgB,WAAW,CAAC,KAAK,EAAE,gBAAgB,GAAG,KAAK,CAAC,GAAG,CAAC,OAAO,CA2BtE"}
1
+ {"version":3,"file":"YakProvider.d.ts","sourceRoot":"","sources":["../../src/client/YakProvider.tsx"],"names":[],"mappings":"AAEA,OAAO,EAEL,KAAK,gBAAgB,IAAI,oBAAoB,EAC9C,MAAM,eAAe,CAAC;AAEvB,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAG/B,MAAM,MAAM,gBAAgB,GAAG,oBAAoB,CAAC;AAkCpD;;;;;;;;;GASG;AACH,wBAAgB,WAAW,CAAC,KAAK,EAAE,gBAAgB,GAAG,KAAK,CAAC,GAAG,CAAC,OAAO,CA2BtE"}
@@ -1,8 +1,8 @@
1
1
  "use client";
2
2
  import { jsx as _jsx } from "react/jsx-runtime";
3
- import { useCallback, useMemo } from "react";
4
- import { useRouter } from "next/navigation";
5
3
  import { YakProvider as CoreYakProvider, } from "@yak-io/react";
4
+ import { useRouter } from "next/navigation";
5
+ import { useCallback, useMemo } from "react";
6
6
  function isAbsoluteUrl(path) {
7
7
  return /^https?:\/\//i.test(path);
8
8
  }
@@ -1,4 +1,10 @@
1
1
  import { useYak } from "@yak-io/react";
2
2
  export { useYak };
3
+ /**
4
+ * The object returned by {@link useYak} — the imperative handle for controlling
5
+ * chat and voice (`open`, `close`, `openWithPrompt`, `voiceStart`, `voiceStop`,
6
+ * `voiceToggle`) plus reactive state (`isOpen`, `isReady`, `chatLoading`,
7
+ * `voiceState`, `voiceLoading`, …).
8
+ */
3
9
  export type YakChatAPI = ReturnType<typeof useYak>;
4
10
  //# sourceMappingURL=useYak.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"useYak.d.ts","sourceRoot":"","sources":["../../src/client/useYak.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,MAAM,EAAE,MAAM,eAAe,CAAC;AAGvC,OAAO,EAAE,MAAM,EAAE,CAAC;AAElB,MAAM,MAAM,UAAU,GAAG,UAAU,CAAC,OAAO,MAAM,CAAC,CAAC"}
1
+ {"version":3,"file":"useYak.d.ts","sourceRoot":"","sources":["../../src/client/useYak.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,MAAM,EAAE,MAAM,eAAe,CAAC;AAGvC,OAAO,EAAE,MAAM,EAAE,CAAC;AAElB;;;;;GAKG;AACH,MAAM,MAAM,UAAU,GAAG,UAAU,CAAC,OAAO,MAAM,CAAC,CAAC"}
@@ -1,6 +1,6 @@
1
1
  export * from "@yak-io/react";
2
- export { YakProvider } from "./client/YakProvider.js";
3
- export type { YakProviderProps } from "./client/YakProvider.js";
4
- export { useYak } from "./client/useYak.js";
5
2
  export type { YakChatAPI } from "./client/useYak.js";
3
+ export { useYak } from "./client/useYak.js";
4
+ export type { YakProviderProps } from "./client/YakProvider.js";
5
+ export { YakProvider } from "./client/YakProvider.js";
6
6
  //# sourceMappingURL=index.client.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.client.d.ts","sourceRoot":"","sources":["../src/index.client.ts"],"names":[],"mappings":"AAEA,cAAc,eAAe,CAAC;AAC9B,OAAO,EAAE,WAAW,EAAE,MAAM,yBAAyB,CAAC;AACtD,YAAY,EAAE,gBAAgB,EAAE,MAAM,yBAAyB,CAAC;AAChE,OAAO,EAAE,MAAM,EAAE,MAAM,oBAAoB,CAAC;AAC5C,YAAY,EAAE,UAAU,EAAE,MAAM,oBAAoB,CAAC"}
1
+ {"version":3,"file":"index.client.d.ts","sourceRoot":"","sources":["../src/index.client.ts"],"names":[],"mappings":"AAEA,cAAc,eAAe,CAAC;AAC9B,YAAY,EAAE,UAAU,EAAE,MAAM,oBAAoB,CAAC;AACrD,OAAO,EAAE,MAAM,EAAE,MAAM,oBAAoB,CAAC;AAC5C,YAAY,EAAE,gBAAgB,EAAE,MAAM,yBAAyB,CAAC;AAChE,OAAO,EAAE,WAAW,EAAE,MAAM,yBAAyB,CAAC"}
@@ -1,4 +1,4 @@
1
1
  "use client";
2
2
  export * from "@yak-io/react";
3
- export { YakProvider } from "./client/YakProvider.js";
4
3
  export { useYak } from "./client/useYak.js";
4
+ export { YakProvider } from "./client/YakProvider.js";
@@ -1,3 +1,3 @@
1
- export { createNextYakConfigHandler } from "./createNextYakHandler.js";
2
1
  export type { NextYakConfigHandlerConfig } from "./createNextYakHandler.js";
2
+ export { createNextYakConfigHandler } from "./createNextYakHandler.js";
3
3
  //# sourceMappingURL=createNextYakConfigHandler.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"createNextYakConfigHandler.d.ts","sourceRoot":"","sources":["../../src/server/createNextYakConfigHandler.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,0BAA0B,EAAE,MAAM,2BAA2B,CAAC;AACvE,YAAY,EAAE,0BAA0B,EAAE,MAAM,2BAA2B,CAAC"}
1
+ {"version":3,"file":"createNextYakConfigHandler.d.ts","sourceRoot":"","sources":["../../src/server/createNextYakConfigHandler.ts"],"names":[],"mappings":"AAAA,YAAY,EAAE,0BAA0B,EAAE,MAAM,2BAA2B,CAAC;AAC5E,OAAO,EAAE,0BAA0B,EAAE,MAAM,2BAA2B,CAAC"}
@@ -1,4 +1,4 @@
1
- import type { RouteSourceInput, ToolSourceInput, RouteInfo, RouteManifest, ToolManifest, ToolExecutor } from "@yak-io/javascript/server";
1
+ import type { RouteInfo, RouteManifest, RouteSourceInput, ToolExecutor, ToolManifest, ToolSourceInput } from "@yak-io/javascript/server";
2
2
  /**
3
3
  * Load a pre-built route manifest from disk (JSON file).
4
4
  *
@@ -1 +1 @@
1
- {"version":3,"file":"createNextYakHandler.d.ts","sourceRoot":"","sources":["../../src/server/createNextYakHandler.ts"],"names":[],"mappings":"AAOA,OAAO,KAAK,EACV,gBAAgB,EAChB,eAAe,EACf,SAAS,EACT,aAAa,EACb,YAAY,EACZ,YAAY,EACb,MAAM,2BAA2B,CAAC;AAkBnC;;;;;;;;;;;GAWG;AACH,wBAAgB,iBAAiB,CAAC,YAAY,CAAC,EAAE,MAAM,GAAG,aAAa,GAAG,IAAI,CAgB7E;AAED;;;GAGG;AACH,wBAAgB,UAAU,CAAC,YAAY,CAAC,EAAE,MAAM,GAAG,SAAS,EAAE,CAa7D;AAED,MAAM,MAAM,kBAAkB,GAAG;IAC/B,OAAO,CAAC,EAAE,MAAM,EAAE,CAAC;IACnB,OAAO,CAAC,EAAE,MAAM,EAAE,CAAC;CACpB,CAAC;AAEF,MAAM,MAAM,oBAAoB,GAAG;IACjC,MAAM,CAAC,EAAE,MAAM,CAAC;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C,EAAE,eAAe,CAAC;IACxB,QAAQ,CAAC,EAAE,MAAM,OAAO,CAAC,YAAY,CAAC,CAAC;IACvC,WAAW,EAAE,YAAY,CAAC;CAC3B,CAAC;AAEF,wBAAgB,yBAAyB,CAAC,MAAM,EAAE,yBAAyB,uCAY1E"}
@@ -1,6 +1,6 @@
1
- import { createYakHandler, createYakConfigHandler, createYakToolsHandler, } from "@yak-io/javascript/server";
2
1
  import * as fs from "node:fs";
3
2
  import * as path from "node:path";
3
+ import { createYakConfigHandler, createYakHandler, createYakToolsHandler, } from "@yak-io/javascript/server";
4
4
  import { scanRoutes } from "./scan-routes.js";
5
5
  /**
6
6
  * Default paths to check for pre-built route manifests (JSON files).
@@ -1,3 +1,3 @@
1
- export { createNextYakToolsHandler } from "./createNextYakHandler.js";
2
1
  export type { NextYakToolsHandlerConfig } from "./createNextYakHandler.js";
2
+ export { createNextYakToolsHandler } from "./createNextYakHandler.js";
3
3
  //# sourceMappingURL=createNextYakToolsHandler.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"createNextYakToolsHandler.d.ts","sourceRoot":"","sources":["../../src/server/createNextYakToolsHandler.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,yBAAyB,EAAE,MAAM,2BAA2B,CAAC;AACtE,YAAY,EAAE,yBAAyB,EAAE,MAAM,2BAA2B,CAAC"}
1
+ {"version":3,"file":"createNextYakToolsHandler.d.ts","sourceRoot":"","sources":["../../src/server/createNextYakToolsHandler.ts"],"names":[],"mappings":"AAAA,YAAY,EAAE,yBAAyB,EAAE,MAAM,2BAA2B,CAAC;AAC3E,OAAO,EAAE,yBAAyB,EAAE,MAAM,2BAA2B,CAAC"}
@@ -1,8 +1,8 @@
1
- export { scanRoutes } from "./scan-routes.js";
2
- export type { ScanRoutesOptions } from "./scan-routes.js";
3
- export { createNextYakHandler, createNextYakConfigHandler, createNextYakToolsHandler, loadRouteManifest, loadRoutes, } from "./createNextYakHandler.js";
4
- export type { NextYakHandlerConfig, NextYakConfigHandlerConfig, NextYakToolsHandlerConfig, NextYakRouteFilter, } from "./createNextYakHandler.js";
5
- export { createRouteManifestAdapter } from "./route-manifest-adapter.js";
1
+ export type { ChatConfig, RouteInfo, RouteManifest, ToolCallPayload, ToolCallResult, ToolDefinition, ToolExecutor, ToolManifest, } from "@yak-io/javascript/server";
2
+ export type { NextYakConfigHandlerConfig, NextYakHandlerConfig, NextYakRouteFilter, NextYakToolsHandlerConfig, } from "./createNextYakHandler.js";
3
+ export { createNextYakConfigHandler, createNextYakHandler, createNextYakToolsHandler, loadRouteManifest, loadRoutes, } from "./createNextYakHandler.js";
6
4
  export type { RouteManifestAdapterConfig } from "./route-manifest-adapter.js";
7
- export type { ToolExecutor, ToolCallPayload, ToolCallResult, ToolDefinition, ToolManifest, RouteInfo, RouteManifest, ChatConfig, } from "@yak-io/javascript/server";
5
+ export { createRouteManifestAdapter } from "./route-manifest-adapter.js";
6
+ export type { ScanRoutesOptions } from "./scan-routes.js";
7
+ export { scanRoutes } from "./scan-routes.js";
8
8
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/server/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,kBAAkB,CAAC;AAC9C,YAAY,EAAE,iBAAiB,EAAE,MAAM,kBAAkB,CAAC;AAE1D,OAAO,EACL,oBAAoB,EACpB,0BAA0B,EAC1B,yBAAyB,EACzB,iBAAiB,EACjB,UAAU,GACX,MAAM,2BAA2B,CAAC;AACnC,YAAY,EACV,oBAAoB,EACpB,0BAA0B,EAC1B,yBAAyB,EACzB,kBAAkB,GACnB,MAAM,2BAA2B,CAAC;AAEnC,OAAO,EAAE,0BAA0B,EAAE,MAAM,6BAA6B,CAAC;AACzE,YAAY,EAAE,0BAA0B,EAAE,MAAM,6BAA6B,CAAC;AAE9E,YAAY,EACV,YAAY,EACZ,eAAe,EACf,cAAc,EACd,cAAc,EACd,YAAY,EACZ,SAAS,EACT,aAAa,EACb,UAAU,GACX,MAAM,2BAA2B,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/server/index.ts"],"names":[],"mappings":"AAAA,YAAY,EACV,UAAU,EACV,SAAS,EACT,aAAa,EACb,eAAe,EACf,cAAc,EACd,cAAc,EACd,YAAY,EACZ,YAAY,GACb,MAAM,2BAA2B,CAAC;AACnC,YAAY,EACV,0BAA0B,EAC1B,oBAAoB,EACpB,kBAAkB,EAClB,yBAAyB,GAC1B,MAAM,2BAA2B,CAAC;AAEnC,OAAO,EACL,0BAA0B,EAC1B,oBAAoB,EACpB,yBAAyB,EACzB,iBAAiB,EACjB,UAAU,GACX,MAAM,2BAA2B,CAAC;AACnC,YAAY,EAAE,0BAA0B,EAAE,MAAM,6BAA6B,CAAC;AAE9E,OAAO,EAAE,0BAA0B,EAAE,MAAM,6BAA6B,CAAC;AACzE,YAAY,EAAE,iBAAiB,EAAE,MAAM,kBAAkB,CAAC;AAC1D,OAAO,EAAE,UAAU,EAAE,MAAM,kBAAkB,CAAC"}
@@ -1,3 +1,3 @@
1
- export { scanRoutes } from "./scan-routes.js";
2
- export { createNextYakHandler, createNextYakConfigHandler, createNextYakToolsHandler, loadRouteManifest, loadRoutes, } from "./createNextYakHandler.js";
1
+ export { createNextYakConfigHandler, createNextYakHandler, createNextYakToolsHandler, loadRouteManifest, loadRoutes, } from "./createNextYakHandler.js";
3
2
  export { createRouteManifestAdapter } from "./route-manifest-adapter.js";
3
+ export { scanRoutes } from "./scan-routes.js";
@@ -1 +1 @@
1
- {"version":3,"file":"scan-routes.d.ts","sourceRoot":"","sources":["../../src/server/scan-routes.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,2BAA2B,CAAC;AAE3D,MAAM,MAAM,iBAAiB,GAAG;IAC9B,aAAa,CAAC,EAAE,KAAK,GAAG,OAAO,CAAC;CACjC,CAAC;AAsOF;;GAEG;AACH,wBAAgB,UAAU,CAAC,SAAS,EAAE,MAAM,EAAE,OAAO,CAAC,EAAE,iBAAiB,GAAG,SAAS,EAAE,CActF"}
1
+ {"version":3,"file":"scan-routes.d.ts","sourceRoot":"","sources":["../../src/server/scan-routes.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,2BAA2B,CAAC;AAE3D,MAAM,MAAM,iBAAiB,GAAG;IAC9B,aAAa,CAAC,EAAE,KAAK,GAAG,OAAO,CAAC;CACjC,CAAC;AAqOF;;GAEG;AACH,wBAAgB,UAAU,CAAC,SAAS,EAAE,MAAM,EAAE,OAAO,CAAC,EAAE,iBAAiB,GAAG,SAAS,EAAE,CActF"}
@@ -143,7 +143,6 @@ const SPECIAL_PAGE_FILENAMES = new Set([
143
143
  "middleware",
144
144
  "_middleware",
145
145
  ]);
146
- // biome-ignore lint/complexity/noExcessiveCognitiveComplexity: recursive directory scanner with multiple file type checks
147
146
  function scanPagesDirectory(dirPath, segments = []) {
148
147
  const routes = [];
149
148
  try {
@@ -1,5 +1,5 @@
1
- import type { ToolManifest } from "./tools.js";
2
1
  import type { RouteManifest } from "./routes.js";
2
+ import type { ToolManifest } from "./tools.js";
3
3
  /**
4
4
  * Combined configuration for the chatbot including routes and optionally tools
5
5
  */
@@ -1 +1 @@
1
- {"version":3,"file":"config.d.ts","sourceRoot":"","sources":["../../src/types/config.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,YAAY,CAAC;AAC/C,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,aAAa,CAAC;AAEjD;;GAEG;AACH,MAAM,MAAM,UAAU,GAAG;IACvB,yCAAyC;IACzC,MAAM,EAAE,aAAa,CAAC;IACtB,qDAAqD;IACrD,KAAK,CAAC,EAAE,YAAY,CAAC;CACtB,CAAC"}
1
+ {"version":3,"file":"config.d.ts","sourceRoot":"","sources":["../../src/types/config.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,aAAa,CAAC;AACjD,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,YAAY,CAAC;AAE/C;;GAEG;AACH,MAAM,MAAM,UAAU,GAAG;IACvB,yCAAyC;IACzC,MAAM,EAAE,aAAa,CAAC;IACtB,qDAAqD;IACrD,KAAK,CAAC,EAAE,YAAY,CAAC;CACtB,CAAC"}
@@ -1,5 +1,5 @@
1
- import type { ToolManifest } from "./tools";
2
1
  import type { RouteManifest } from "./routes";
2
+ import type { ToolManifest } from "./tools";
3
3
  /**
4
4
  * Theme configuration for the chatbot widget
5
5
  */
@@ -1 +1 @@
1
- {"version":3,"file":"messaging.d.ts","sourceRoot":"","sources":["../../src/types/messaging.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,SAAS,CAAC;AAC5C,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,UAAU,CAAC;AAE9C;;GAEG;AACH,MAAM,MAAM,KAAK,GAAG;IAClB,QAAQ,CAAC,EAAE,cAAc,GAAG,aAAa,CAAC;CAC3C,CAAC;AAEF;;GAEG;AACH,MAAM,MAAM,WAAW,GAAG;IACxB,GAAG,EAAE,MAAM,CAAC;IACZ,KAAK,EAAE,MAAM,CAAC;IACd,IAAI,EAAE,MAAM,CAAC;IACb,SAAS,EAAE,MAAM,CAAC;CACnB,CAAC;AAEF;;GAEG;AACH,MAAM,MAAM,qBAAqB,GAC7B;IACE,IAAI,EAAE,YAAY,CAAC;IACnB,OAAO,EAAE;QACP,KAAK,EAAE,MAAM,CAAC;QACd,KAAK,CAAC,EAAE,KAAK,CAAC;QACd,YAAY,CAAC,EAAE,YAAY,CAAC;QAC5B,aAAa,CAAC,EAAE,aAAa,CAAC;KAC/B,CAAC;CACH,GACD;IAAE,IAAI,EAAE,iBAAiB,CAAC;IAAC,OAAO,EAAE;QAAE,EAAE,EAAE,MAAM,CAAC;QAAC,EAAE,EAAE,IAAI,CAAC;QAAC,MAAM,EAAE,OA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ak chatbot with route manifest generation",
5
5
  "type": "module",
6
6
  "license": "SEE LICENSE IN LICENSE",
@@ -26,6 +26,7 @@
26
26
  "node": ">=18"
27
27
  },
28
28
  "files": [
29
+ "README.md",
29
30
  "dist",
30
31
  "LICENSE"
31
32
  ],
@@ -60,8 +61,8 @@
60
61
  "yak-nextjs": "./dist/cli/generate-manifest.js"
61
62
  },
62
63
  "dependencies": {
63
- "@yak-io/javascript": "0.7.0",
64
- "@yak-io/react": "0.8.0"
64
+ "@yak-io/javascript": "0.9.0",
65
+ "@yak-io/react": "0.10.0"
65
66
  },
66
67
  "peerDependencies": {
67
68
  "next": "^14.0.0 || ^15.0.0 || ^16.0.0",
@@ -69,15 +70,16 @@
69
70
  "react-dom": "^18.0.0 || ^19.0.0"
70
71
  },
71
72
  "devDependencies": {
72
- "@types/node": "^24.12.0",
73
+ "@types/node": "^24.12.4",
73
74
  "@types/react": "^19.2.14",
74
75
  "@types/react-dom": "^19.2.0",
75
- "next": "^16.1.7",
76
- "react": "^19.2.4",
77
- "react-dom": "^19.2.4",
76
+ "next": "^16.2.6",
77
+ "react": "^19.2.6",
78
+ "react-dom": "^19.2.6",
78
79
  "typescript": "^5.3.0",
79
80
  "@repo/typescript-config": "0.0.0"
80
81
  },
82
+ "homepage": "https://docs.yak.io/docs/sdks/nextjs",
81
83
  "scripts": {
82
84
  "build": "tsc",
83
85
  "check-types": "tsc --noEmit",