@ai-me-chat/core 0.0.1 → 0.2.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 +39 -0
- package/dist/index.d.cts +8 -2
- package/dist/index.d.ts +8 -2
- package/package.json +17 -3
package/README.md
ADDED
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
# @ai-me-chat/core
|
|
2
|
+
|
|
3
|
+
Framework-agnostic AI copilot engine. Provides tool discovery, schema extraction, OpenAPI parsing, and execution for building AI assistants that interact with your app's API.
|
|
4
|
+
|
|
5
|
+
## Installation
|
|
6
|
+
|
|
7
|
+
```bash
|
|
8
|
+
npm install @ai-me-chat/core
|
|
9
|
+
```
|
|
10
|
+
|
|
11
|
+
## What it does
|
|
12
|
+
|
|
13
|
+
- **Tool discovery** — scans API routes and generates LLM-compatible tool definitions
|
|
14
|
+
- **Schema extraction** — reads Zod schemas from route files for rich parameter types
|
|
15
|
+
- **OpenAPI support** — parses OpenAPI 3.x specs into tool definitions
|
|
16
|
+
- **Execution engine** — proxies tool calls to your API with auth forwarding
|
|
17
|
+
|
|
18
|
+
## Usage
|
|
19
|
+
|
|
20
|
+
```typescript
|
|
21
|
+
import { generateToolDefinitions, executeToolCall } from "@ai-me-chat/core";
|
|
22
|
+
```
|
|
23
|
+
|
|
24
|
+
This is the foundation package — typically used via `@ai-me-chat/nextjs` (server) and `@ai-me-chat/react` (client) rather than directly.
|
|
25
|
+
|
|
26
|
+
## Peer Dependencies
|
|
27
|
+
|
|
28
|
+
| Package | Version |
|
|
29
|
+
|---------|---------|
|
|
30
|
+
| `ai` | ^6.0.0 |
|
|
31
|
+
| `zod` | ^4.0.0 |
|
|
32
|
+
|
|
33
|
+
## Documentation
|
|
34
|
+
|
|
35
|
+
Full setup guide and API reference: [github.com/aselims/ai-me-chat](https://github.com/aselims/ai-me-chat)
|
|
36
|
+
|
|
37
|
+
## License
|
|
38
|
+
|
|
39
|
+
MIT
|
package/dist/index.d.cts
CHANGED
|
@@ -7,8 +7,8 @@ interface AIMeConfig {
|
|
|
7
7
|
discovery: DiscoveryConfig;
|
|
8
8
|
/** Get the current user session from the request */
|
|
9
9
|
getSession: (req: Request) => Promise<AIMeSession | null>;
|
|
10
|
-
/** System prompt prepended to all conversations */
|
|
11
|
-
systemPrompt?: string;
|
|
10
|
+
/** System prompt prepended to all conversations. Pass a function to inject user-specific context. */
|
|
11
|
+
systemPrompt?: string | ((session: AIMeSession) => string | Promise<string>);
|
|
12
12
|
/** Confirmation settings for write operations */
|
|
13
13
|
confirmation?: ConfirmationConfig;
|
|
14
14
|
/** Maximum conversation history messages to send to LLM */
|
|
@@ -20,6 +20,12 @@ interface AIMeConfig {
|
|
|
20
20
|
}
|
|
21
21
|
interface DiscoveryConfig {
|
|
22
22
|
mode: "filesystem" | "openapi";
|
|
23
|
+
/**
|
|
24
|
+
* Absolute or relative path to the Next.js app directory.
|
|
25
|
+
* Defaults to auto-detection: prefers `src/app` when it exists, falls back to `app`.
|
|
26
|
+
* Only used when mode is "filesystem".
|
|
27
|
+
*/
|
|
28
|
+
appDir?: string;
|
|
23
29
|
/** Glob patterns of routes to include */
|
|
24
30
|
include?: string[];
|
|
25
31
|
/** Glob patterns of routes to exclude */
|
package/dist/index.d.ts
CHANGED
|
@@ -7,8 +7,8 @@ interface AIMeConfig {
|
|
|
7
7
|
discovery: DiscoveryConfig;
|
|
8
8
|
/** Get the current user session from the request */
|
|
9
9
|
getSession: (req: Request) => Promise<AIMeSession | null>;
|
|
10
|
-
/** System prompt prepended to all conversations */
|
|
11
|
-
systemPrompt?: string;
|
|
10
|
+
/** System prompt prepended to all conversations. Pass a function to inject user-specific context. */
|
|
11
|
+
systemPrompt?: string | ((session: AIMeSession) => string | Promise<string>);
|
|
12
12
|
/** Confirmation settings for write operations */
|
|
13
13
|
confirmation?: ConfirmationConfig;
|
|
14
14
|
/** Maximum conversation history messages to send to LLM */
|
|
@@ -20,6 +20,12 @@ interface AIMeConfig {
|
|
|
20
20
|
}
|
|
21
21
|
interface DiscoveryConfig {
|
|
22
22
|
mode: "filesystem" | "openapi";
|
|
23
|
+
/**
|
|
24
|
+
* Absolute or relative path to the Next.js app directory.
|
|
25
|
+
* Defaults to auto-detection: prefers `src/app` when it exists, falls back to `app`.
|
|
26
|
+
* Only used when mode is "filesystem".
|
|
27
|
+
*/
|
|
28
|
+
appDir?: string;
|
|
23
29
|
/** Glob patterns of routes to include */
|
|
24
30
|
include?: string[];
|
|
25
31
|
/** Glob patterns of routes to exclude */
|
package/package.json
CHANGED
|
@@ -1,13 +1,26 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@ai-me-chat/core",
|
|
3
|
-
"version": "0.0
|
|
4
|
-
"description": "AI-Me core — framework-agnostic AI copilot engine",
|
|
3
|
+
"version": "0.2.0",
|
|
4
|
+
"description": "AI-Me core — framework-agnostic AI copilot engine with tool discovery, schema extraction, and OpenAPI support",
|
|
5
5
|
"license": "MIT",
|
|
6
|
+
"keywords": [
|
|
7
|
+
"ai",
|
|
8
|
+
"copilot",
|
|
9
|
+
"chatbot",
|
|
10
|
+
"ai-assistant",
|
|
11
|
+
"tool-calling",
|
|
12
|
+
"openapi",
|
|
13
|
+
"vercel-ai-sdk",
|
|
14
|
+
"llm"
|
|
15
|
+
],
|
|
6
16
|
"repository": {
|
|
7
17
|
"type": "git",
|
|
8
18
|
"url": "https://github.com/aselims/ai-me-chat",
|
|
9
19
|
"directory": "packages/core"
|
|
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": {
|