@ai-me-chat/nextjs 0.0.1 → 0.1.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 +69 -0
- package/package.json +18 -4
package/README.md
ADDED
|
@@ -0,0 +1,69 @@
|
|
|
1
|
+
# @ai-me-chat/nextjs
|
|
2
|
+
|
|
3
|
+
Next.js integration for AI-Me — route handler factory with auto-discovery, filtering, and auth forwarding.
|
|
4
|
+
|
|
5
|
+
## Installation
|
|
6
|
+
|
|
7
|
+
```bash
|
|
8
|
+
npm install @ai-me-chat/nextjs
|
|
9
|
+
```
|
|
10
|
+
|
|
11
|
+
## Quick Start
|
|
12
|
+
|
|
13
|
+
Create `app/api/ai-me/route.ts`:
|
|
14
|
+
|
|
15
|
+
```typescript
|
|
16
|
+
import { createAIMeHandler } from "@ai-me-chat/nextjs";
|
|
17
|
+
import { openai } from "@ai-sdk/openai";
|
|
18
|
+
|
|
19
|
+
const handler = createAIMeHandler({
|
|
20
|
+
model: openai("gpt-4o"),
|
|
21
|
+
|
|
22
|
+
discovery: {
|
|
23
|
+
mode: "filesystem",
|
|
24
|
+
include: ["/api/**"],
|
|
25
|
+
exclude: ["/api/ai-me/**"],
|
|
26
|
+
},
|
|
27
|
+
|
|
28
|
+
getSession: async (req) => {
|
|
29
|
+
// your auth logic
|
|
30
|
+
return { user: { id: "user-1", role: "admin" } };
|
|
31
|
+
},
|
|
32
|
+
|
|
33
|
+
systemPrompt: "You are a helpful AI assistant for this app.",
|
|
34
|
+
});
|
|
35
|
+
|
|
36
|
+
export { handler as GET, handler as POST };
|
|
37
|
+
```
|
|
38
|
+
|
|
39
|
+
## Features
|
|
40
|
+
|
|
41
|
+
- **Filesystem discovery** — auto-scans `app/api/` routes at startup
|
|
42
|
+
- **OpenAPI discovery** — generate tools from an OpenAPI 3.x spec (inline or remote URL)
|
|
43
|
+
- **Route filtering** — include/exclude patterns with glob support
|
|
44
|
+
- **Auth forwarding** — forwards cookies and authorization headers to your routes
|
|
45
|
+
- **Write confirmation** — POST/PUT/PATCH/DELETE require user confirmation by default
|
|
46
|
+
|
|
47
|
+
## Endpoints
|
|
48
|
+
|
|
49
|
+
| Path | Method | Purpose |
|
|
50
|
+
|------|--------|---------|
|
|
51
|
+
| `/api/ai-me` | POST | Chat endpoint |
|
|
52
|
+
| `/api/ai-me/tools` | GET | List discovered tools |
|
|
53
|
+
| `/api/ai-me/health` | GET | Health check |
|
|
54
|
+
|
|
55
|
+
## Peer Dependencies
|
|
56
|
+
|
|
57
|
+
| Package | Version |
|
|
58
|
+
|---------|---------|
|
|
59
|
+
| `ai` | ^6.0.0 |
|
|
60
|
+
| `next` | ^16.0.0 |
|
|
61
|
+
| `react` | ^19.0.0 |
|
|
62
|
+
|
|
63
|
+
## Documentation
|
|
64
|
+
|
|
65
|
+
Full setup guide and API reference: [github.com/aselims/ai-me-chat](https://github.com/aselims/ai-me-chat)
|
|
66
|
+
|
|
67
|
+
## License
|
|
68
|
+
|
|
69
|
+
MIT
|
package/package.json
CHANGED
|
@@ -1,13 +1,26 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@ai-me-chat/nextjs",
|
|
3
|
-
"version": "0.0
|
|
4
|
-
"description": "AI-Me Next.js integration — handler,
|
|
3
|
+
"version": "0.1.0",
|
|
4
|
+
"description": "AI-Me Next.js integration — route handler factory, auto-discovery, and proxy",
|
|
5
5
|
"license": "MIT",
|
|
6
|
+
"keywords": [
|
|
7
|
+
"ai",
|
|
8
|
+
"copilot",
|
|
9
|
+
"nextjs",
|
|
10
|
+
"app-router",
|
|
11
|
+
"route-handler",
|
|
12
|
+
"ai-assistant",
|
|
13
|
+
"vercel-ai-sdk",
|
|
14
|
+
"openapi"
|
|
15
|
+
],
|
|
6
16
|
"repository": {
|
|
7
17
|
"type": "git",
|
|
8
18
|
"url": "https://github.com/aselims/ai-me-chat",
|
|
9
19
|
"directory": "packages/nextjs"
|
|
10
20
|
},
|
|
21
|
+
"engines": {
|
|
22
|
+
"node": ">=20"
|
|
23
|
+
},
|
|
11
24
|
"type": "module",
|
|
12
25
|
"main": "./dist/index.cjs",
|
|
13
26
|
"module": "./dist/index.js",
|
|
@@ -20,7 +33,8 @@
|
|
|
20
33
|
}
|
|
21
34
|
},
|
|
22
35
|
"files": [
|
|
23
|
-
"dist"
|
|
36
|
+
"dist",
|
|
37
|
+
"README.md"
|
|
24
38
|
],
|
|
25
39
|
"sideEffects": false,
|
|
26
40
|
"peerDependencies": {
|
|
@@ -30,7 +44,7 @@
|
|
|
30
44
|
},
|
|
31
45
|
"dependencies": {
|
|
32
46
|
"picomatch": "^4.0.3",
|
|
33
|
-
"@ai-me-chat/core": "0.0
|
|
47
|
+
"@ai-me-chat/core": "0.1.0"
|
|
34
48
|
},
|
|
35
49
|
"devDependencies": {
|
|
36
50
|
"@types/node": "^25.5.0",
|