@pantheon.ai/agents 0.0.8 → 0.0.10
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 +76 -0
- package/dist/index.js +30654 -1010
- package/package.json +2 -1
package/README.md
ADDED
|
@@ -0,0 +1,76 @@
|
|
|
1
|
+
# `@pantheon.ai/agents`
|
|
2
|
+
|
|
3
|
+
This package contains:
|
|
4
|
+
|
|
5
|
+
- A **runner loop** (`pantheon-agents run <agent>`) that executes queued tasks via Pantheon and persists status/output to TiDB.
|
|
6
|
+
- A **client-facing server** (`pantheon-agents server`) that exposes the same task operations over **HTTP REST** and **MCP (HTTP+SSE)**.
|
|
7
|
+
|
|
8
|
+
## Prerequisites
|
|
9
|
+
|
|
10
|
+
- `DATABASE_URL` (TiDB/MySQL connection string) must be set for all commands that touch the DB.
|
|
11
|
+
- `PANTHEON_API_KEY` is required for the runner loop (`pantheon-agents run`) and bootstrap config flows.
|
|
12
|
+
|
|
13
|
+
### DB schema / migrations
|
|
14
|
+
|
|
15
|
+
The schema lives in `packages/agents/src/db/schema/tidb.sql`.
|
|
16
|
+
|
|
17
|
+
If you have an existing DB, issue #9 adds `task.cancelled_at`:
|
|
18
|
+
|
|
19
|
+
```sql
|
|
20
|
+
ALTER TABLE task ADD COLUMN cancelled_at DATETIME NULL;
|
|
21
|
+
```
|
|
22
|
+
|
|
23
|
+
## Start the server (HTTP + MCP)
|
|
24
|
+
|
|
25
|
+
Auth is enabled by default. Provide a token via env or flag:
|
|
26
|
+
|
|
27
|
+
```bash
|
|
28
|
+
export PANTHEON_AGENTS_API_TOKEN="your-token"
|
|
29
|
+
pantheon-agents server --host 127.0.0.1 --port 8000 --base-path /
|
|
30
|
+
```
|
|
31
|
+
|
|
32
|
+
To disable auth for local-only use (not recommended):
|
|
33
|
+
|
|
34
|
+
```bash
|
|
35
|
+
pantheon-agents server --no-auth
|
|
36
|
+
```
|
|
37
|
+
|
|
38
|
+
### REST API
|
|
39
|
+
|
|
40
|
+
Base path: `/api/v1`
|
|
41
|
+
|
|
42
|
+
Examples:
|
|
43
|
+
|
|
44
|
+
```bash
|
|
45
|
+
TOKEN="$PANTHEON_AGENTS_API_TOKEN"
|
|
46
|
+
|
|
47
|
+
curl -sS -H "Authorization: Bearer $TOKEN" \\
|
|
48
|
+
http://127.0.0.1:8000/api/v1/agents
|
|
49
|
+
|
|
50
|
+
curl -sS -H "Authorization: Bearer $TOKEN" \\
|
|
51
|
+
"http://127.0.0.1:8000/api/v1/agents/<agent>/tasks?status=pending,running&order_by=queued_at&order_direction=desc&limit=50"
|
|
52
|
+
|
|
53
|
+
curl -sS -H "Authorization: Bearer $TOKEN" -H "Content-Type: application/json" \\
|
|
54
|
+
-X POST http://127.0.0.1:8000/api/v1/agents/<agent>/tasks \\
|
|
55
|
+
-d '{ "project_id": "<project_id>", "task": "Do the thing" }'
|
|
56
|
+
|
|
57
|
+
curl -sS -H "Authorization: Bearer $TOKEN" \\
|
|
58
|
+
-X POST http://127.0.0.1:8000/api/v1/agents/<agent>/tasks/<task_id>/cancel
|
|
59
|
+
|
|
60
|
+
curl -sS -H "Authorization: Bearer $TOKEN" \\
|
|
61
|
+
-X DELETE http://127.0.0.1:8000/api/v1/agents/<agent>/tasks/<task_id>
|
|
62
|
+
```
|
|
63
|
+
|
|
64
|
+
### MCP (HTTP+SSE)
|
|
65
|
+
|
|
66
|
+
The MCP endpoint is exposed at `/mcp` (and `/mcp/messages` for client POSTs).
|
|
67
|
+
|
|
68
|
+
Tools:
|
|
69
|
+
|
|
70
|
+
- `agents.list`
|
|
71
|
+
- `tasks.list`
|
|
72
|
+
- `tasks.get`
|
|
73
|
+
- `tasks.create`
|
|
74
|
+
- `tasks.cancel`
|
|
75
|
+
- `tasks.delete`
|
|
76
|
+
|