@assistant-ui/next 0.0.1 → 0.0.3

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/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2025 AgentbaseAI Inc.
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
package/dist/index.d.ts CHANGED
@@ -1,4 +1,2 @@
1
- import { defineToolkit } from "./define-toolkit.js";
2
- import { hitl } from "./hitl.js";
3
1
  import { WithAuiOptions, withAui } from "./with-aui.js";
4
- export { type WithAuiOptions, defineToolkit, hitl, withAui };
2
+ export { type WithAuiOptions, withAui };
package/dist/index.js CHANGED
@@ -1,4 +1,2 @@
1
- import { defineToolkit } from "./define-toolkit.js";
2
- import { hitl } from "./hitl.js";
3
1
  import { withAui } from "./with-aui.js";
4
- export { defineToolkit, hitl, withAui };
2
+ export { withAui };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@assistant-ui/next",
3
- "version": "0.0.1",
3
+ "version": "0.0.3",
4
4
  "description": "Next.js integration for assistant-ui: the withAui() config wrapper and the \"use generative\" directive compiler that colocates a tool's schema, server-only execute, and client-only render in one file.",
5
5
  "keywords": [
6
6
  "assistant-ui",
@@ -39,18 +39,13 @@
39
39
  "README.md"
40
40
  ],
41
41
  "sideEffects": false,
42
- "scripts": {
43
- "build": "aui-build",
44
- "test": "vitest run --passWithNoTests",
45
- "test:watch": "vitest"
46
- },
47
42
  "dependencies": {
48
- "@assistant-ui/x-generative-compiler": "workspace:^"
43
+ "@assistant-ui/x-generative-compiler": "^0.0.2"
49
44
  },
50
45
  "devDependencies": {
51
- "@assistant-ui/x-buildutils": "workspace:*",
52
46
  "@types/node": "^25.9.1",
53
- "vitest": "^4.1.7"
47
+ "vitest": "^4.1.7",
48
+ "@assistant-ui/x-buildutils": "0.0.10"
54
49
  },
55
50
  "publishConfig": {
56
51
  "access": "public",
@@ -64,5 +59,10 @@
64
59
  },
65
60
  "bugs": {
66
61
  "url": "https://github.com/assistant-ui/assistant-ui/issues"
62
+ },
63
+ "scripts": {
64
+ "build": "aui-build",
65
+ "test": "vitest run --passWithNoTests",
66
+ "test:watch": "vitest"
67
67
  }
68
- }
68
+ }
package/src/index.ts CHANGED
@@ -1,3 +1 @@
1
1
  export { withAui, type WithAuiOptions } from "./with-aui";
2
- export { defineToolkit } from "./define-toolkit";
3
- export { hitl } from "./hitl";
@@ -1,19 +0,0 @@
1
- import { Toolkit, ToolkitDeclaration } from "@assistant-ui/core/react";
2
-
3
- //#region src/define-toolkit.d.ts
4
- /**
5
- * Authoring helper for a `"use generative"` toolkit. Accepts the permissive
6
- * {@link ToolkitDeclaration} (a `backend` tool may carry its server `execute`)
7
- * and types the result as the canonical {@link Toolkit}.
8
- *
9
- * It has **no runtime implementation**. The `@assistant-ui/next` compiler strips
10
- * the `defineToolkit(...)` wrapper (and its import) per build, so a correctly
11
- * compiled `export default defineToolkit({...})` never calls this. If it *does*
12
- * run, the module was not compiled by the use-generative loader — e.g.
13
- * `defineToolkit` used outside a `"use generative"` file — which would ship a
14
- * backend `execute` to the client. So it throws instead of silently leaking.
15
- */
16
- declare function defineToolkit(_declaration: ToolkitDeclaration): Toolkit;
17
- //#endregion
18
- export { defineToolkit };
19
- //# sourceMappingURL=define-toolkit.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"define-toolkit.d.ts","names":[],"sources":["../src/define-toolkit.ts"],"mappings":";;;;;AAcA;;;;;;;;AAAwE;;iBAAxD,aAAA,CAAc,YAAA,EAAc,kBAAA,GAAqB,OAAO"}
@@ -1,20 +0,0 @@
1
- //#region src/define-toolkit.ts
2
- /**
3
- * Authoring helper for a `"use generative"` toolkit. Accepts the permissive
4
- * {@link ToolkitDeclaration} (a `backend` tool may carry its server `execute`)
5
- * and types the result as the canonical {@link Toolkit}.
6
- *
7
- * It has **no runtime implementation**. The `@assistant-ui/next` compiler strips
8
- * the `defineToolkit(...)` wrapper (and its import) per build, so a correctly
9
- * compiled `export default defineToolkit({...})` never calls this. If it *does*
10
- * run, the module was not compiled by the use-generative loader — e.g.
11
- * `defineToolkit` used outside a `"use generative"` file — which would ship a
12
- * backend `execute` to the client. So it throws instead of silently leaking.
13
- */
14
- function defineToolkit(_declaration) {
15
- throw new Error("[assistant-ui/next] defineToolkit() has no runtime implementation — it is stripped at build time by the use-generative compiler. Reaching it means this module was not compiled (e.g. defineToolkit used outside a \"use generative\" file). Add the directive, or do not use defineToolkit here.");
16
- }
17
- //#endregion
18
- export { defineToolkit };
19
-
20
- //# sourceMappingURL=define-toolkit.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"define-toolkit.js","names":[],"sources":["../src/define-toolkit.ts"],"sourcesContent":["import type { Toolkit, ToolkitDeclaration } from \"@assistant-ui/core/react\";\n\n/**\n * Authoring helper for a `\"use generative\"` toolkit. Accepts the permissive\n * {@link ToolkitDeclaration} (a `backend` tool may carry its server `execute`)\n * and types the result as the canonical {@link Toolkit}.\n *\n * It has **no runtime implementation**. The `@assistant-ui/next` compiler strips\n * the `defineToolkit(...)` wrapper (and its import) per build, so a correctly\n * compiled `export default defineToolkit({...})` never calls this. If it *does*\n * run, the module was not compiled by the use-generative loader — e.g.\n * `defineToolkit` used outside a `\"use generative\"` file — which would ship a\n * backend `execute` to the client. So it throws instead of silently leaking.\n */\nexport function defineToolkit(_declaration: ToolkitDeclaration): Toolkit {\n throw new Error(\n \"[assistant-ui/next] defineToolkit() has no runtime implementation — it is \" +\n \"stripped at build time by the use-generative compiler. Reaching it means \" +\n 'this module was not compiled (e.g. defineToolkit used outside a \"use ' +\n 'generative\" file). Add the directive, or do not use defineToolkit here.',\n );\n}\n"],"mappings":";;;;;;;;;;;;;AAcA,SAAgB,cAAc,cAA2C;CACvE,MAAM,IAAI,MACR,mSAIF;AACF"}
package/dist/hitl.d.ts DELETED
@@ -1,18 +0,0 @@
1
- //#region src/hitl.d.ts
2
- /**
3
- * Marks a tool as **human-in-the-loop**: the agent pauses and the UI (`render`)
4
- * supplies the result instead of code. Use it as the tool's `execute`:
5
- *
6
- * ```tsx
7
- * confirm: { execute: hitl(), render: (props) => <Confirm {...props} /> }
8
- * ```
9
- *
10
- * Like {@link defineToolkit}, it has **no runtime implementation**: the
11
- * `@assistant-ui/next` compiler detects `execute: hitl()`, drops it, and stamps
12
- * the tool `type: "human"`. Reaching it at runtime means the module wasn't
13
- * compiled (used outside a `"use generative"` file), so it throws.
14
- */
15
- declare function hitl(): never;
16
- //#endregion
17
- export { hitl };
18
- //# sourceMappingURL=hitl.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"hitl.d.ts","names":[],"sources":["../src/hitl.ts"],"mappings":";;AAaA;;;;AAAoB;;;;;;;;iBAAJ,IAAA"}
package/dist/hitl.js DELETED
@@ -1,21 +0,0 @@
1
- //#region src/hitl.ts
2
- /**
3
- * Marks a tool as **human-in-the-loop**: the agent pauses and the UI (`render`)
4
- * supplies the result instead of code. Use it as the tool's `execute`:
5
- *
6
- * ```tsx
7
- * confirm: { execute: hitl(), render: (props) => <Confirm {...props} /> }
8
- * ```
9
- *
10
- * Like {@link defineToolkit}, it has **no runtime implementation**: the
11
- * `@assistant-ui/next` compiler detects `execute: hitl()`, drops it, and stamps
12
- * the tool `type: "human"`. Reaching it at runtime means the module wasn't
13
- * compiled (used outside a `"use generative"` file), so it throws.
14
- */
15
- function hitl() {
16
- throw new Error("[assistant-ui/next] hitl() has no runtime implementation — it marks a human-in-the-loop tool and is stripped at build time by the use-generative compiler. Reaching it means this module was not compiled (e.g. hitl() used outside a \"use generative\" file).");
17
- }
18
- //#endregion
19
- export { hitl };
20
-
21
- //# sourceMappingURL=hitl.js.map
package/dist/hitl.js.map DELETED
@@ -1 +0,0 @@
1
- {"version":3,"file":"hitl.js","names":[],"sources":["../src/hitl.ts"],"sourcesContent":["/**\n * Marks a tool as **human-in-the-loop**: the agent pauses and the UI (`render`)\n * supplies the result instead of code. Use it as the tool's `execute`:\n *\n * ```tsx\n * confirm: { execute: hitl(), render: (props) => <Confirm {...props} /> }\n * ```\n *\n * Like {@link defineToolkit}, it has **no runtime implementation**: the\n * `@assistant-ui/next` compiler detects `execute: hitl()`, drops it, and stamps\n * the tool `type: \"human\"`. Reaching it at runtime means the module wasn't\n * compiled (used outside a `\"use generative\"` file), so it throws.\n */\nexport function hitl(): never {\n throw new Error(\n \"[assistant-ui/next] hitl() has no runtime implementation — it marks a \" +\n \"human-in-the-loop tool and is stripped at build time by the \" +\n \"use-generative compiler. Reaching it means this module was not compiled \" +\n '(e.g. hitl() used outside a \"use generative\" file).',\n );\n}\n"],"mappings":";;;;;;;;;;;;;;AAaA,SAAgB,OAAc;CAC5B,MAAM,IAAI,MACR,iQAIF;AACF"}