@maintainer-pro/ai-cli 0.1.0 → 0.1.2
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 +63 -0
- package/package.json +13 -2
package/README.md
ADDED
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
# @maintainer-pro/ai-cli
|
|
2
|
+
|
|
3
|
+
Server SDK for Maintainer Pro. It talks to coding agents — Cursor (`agent`), Claude (`claude`), or Antigravity (`agy`) — and exposes chat HTTP handlers.
|
|
4
|
+
|
|
5
|
+
**Local development:** prefer [`@maintainer-pro/ai-server`](https://www.npmjs.com/package/@maintainer-pro/ai-server) as a sidecar (a separate Node chat server beside the host app). Do not add chat routes to the host.
|
|
6
|
+
|
|
7
|
+
**Production:** use this SDK on a machine that can run a coding-agent CLI, or pass a custom `AiProvider`. HTTP model backends are out of scope for the default providers. The embed widget (`ai-ui.iife.js`) must be served as a static file in production — `localhost` sidecar URLs will not load.
|
|
8
|
+
|
|
9
|
+
## Install
|
|
10
|
+
|
|
11
|
+
```bash
|
|
12
|
+
npm install @maintainer-pro/ai-cli
|
|
13
|
+
```
|
|
14
|
+
|
|
15
|
+
Requires **Node.js 22+** and one authenticated coding-agent CLI on the machine that runs chat (unless you supply `providers`).
|
|
16
|
+
|
|
17
|
+
## Quick start
|
|
18
|
+
|
|
19
|
+
```ts
|
|
20
|
+
import {
|
|
21
|
+
createChatHandler,
|
|
22
|
+
createDefaultSystemPrompt,
|
|
23
|
+
createMaintainerProStoreFromEnv,
|
|
24
|
+
} from "@maintainer-pro/ai-cli";
|
|
25
|
+
|
|
26
|
+
const db = createMaintainerProStoreFromEnv();
|
|
27
|
+
if (!db) {
|
|
28
|
+
throw new Error("Set MAINTAINER_PRO_URL and MAINTAINER_PRO_API_KEY");
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
export const handlers = createChatHandler({
|
|
32
|
+
systemPrompt: createDefaultSystemPrompt({
|
|
33
|
+
productDescription: "Edit source files in the workspace when the user asks.",
|
|
34
|
+
}),
|
|
35
|
+
workspaceDir: process.env.AI_CLI_WORKSPACE ?? process.cwd(),
|
|
36
|
+
db,
|
|
37
|
+
});
|
|
38
|
+
|
|
39
|
+
export const GET = handlers.GET;
|
|
40
|
+
export const POST = handlers.POST;
|
|
41
|
+
```
|
|
42
|
+
|
|
43
|
+
Chat history is stored in Maintainer Pro admin. Do not put API keys in the browser — serve the client key from `/embed-config.js`.
|
|
44
|
+
|
|
45
|
+
## Environment
|
|
46
|
+
|
|
47
|
+
| Variable | Purpose |
|
|
48
|
+
|----------|---------|
|
|
49
|
+
| `AI_CLI_PROVIDER` | `auto` \| `claude` \| `cursor` \| `antigravity` |
|
|
50
|
+
| `AI_CLI_COMMAND` | Optional binary name or absolute path |
|
|
51
|
+
| `AI_CLI_WORKSPACE` | Folder the agent may edit |
|
|
52
|
+
| `MAINTAINER_PRO_URL` | Admin base URL |
|
|
53
|
+
| `MAINTAINER_PRO_API_KEY` | Server API key from admin |
|
|
54
|
+
|
|
55
|
+
## Related packages
|
|
56
|
+
|
|
57
|
+
| Package | Role |
|
|
58
|
+
|---------|------|
|
|
59
|
+
| [`@maintainer-pro/ai-server`](https://www.npmjs.com/package/@maintainer-pro/ai-server) | Local Node chat server (sidecar) that uses this SDK |
|
|
60
|
+
| [`@maintainer-pro/ai-ui`](https://www.npmjs.com/package/@maintainer-pro/ai-ui) | Embed widget (`ai-ui.iife.js`) — sidecar in dev, static file in prod |
|
|
61
|
+
| [`@maintainer-pro/setup`](https://www.npmjs.com/package/@maintainer-pro/setup) | Download the sandbox setup guide |
|
|
62
|
+
|
|
63
|
+
Optional SQL persistence lives on `@maintainer-pro/ai-cli/db` (install `better-sqlite3`, `postgres`, or `mysql2`).
|
package/package.json
CHANGED
|
@@ -1,7 +1,17 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@maintainer-pro/ai-cli",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.2",
|
|
4
4
|
"description": "Maintainer Pro server SDK: Claude/Cursor CLI, chat HTTP handlers, and optional SQL persistence",
|
|
5
|
+
"keywords": [
|
|
6
|
+
"maintainer-pro",
|
|
7
|
+
"ai",
|
|
8
|
+
"chat",
|
|
9
|
+
"cursor",
|
|
10
|
+
"claude",
|
|
11
|
+
"antigravity",
|
|
12
|
+
"agent",
|
|
13
|
+
"sdk"
|
|
14
|
+
],
|
|
5
15
|
"license": "MIT",
|
|
6
16
|
"type": "module",
|
|
7
17
|
"main": "./dist/index.cjs",
|
|
@@ -21,7 +31,8 @@
|
|
|
21
31
|
},
|
|
22
32
|
"files": [
|
|
23
33
|
"dist",
|
|
24
|
-
"drizzle"
|
|
34
|
+
"drizzle",
|
|
35
|
+
"README.md"
|
|
25
36
|
],
|
|
26
37
|
"publishConfig": {
|
|
27
38
|
"access": "public"
|