@supaku/agentfactory-server 0.4.0 → 0.4.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 +67 -0
- package/package.json +3 -3
package/README.md
ADDED
|
@@ -0,0 +1,67 @@
|
|
|
1
|
+
# @supaku/agentfactory-server
|
|
2
|
+
|
|
3
|
+
Redis-backed infrastructure for [AgentFactory](https://github.com/supaku/agentfactory). Provides work queue, session storage, worker pool management, issue locking, and webhook idempotency.
|
|
4
|
+
|
|
5
|
+
## Installation
|
|
6
|
+
|
|
7
|
+
```bash
|
|
8
|
+
npm install @supaku/agentfactory-server
|
|
9
|
+
```
|
|
10
|
+
|
|
11
|
+
Requires a Redis instance (works with Redis, Upstash, Vercel KV, or any Redis-compatible store).
|
|
12
|
+
|
|
13
|
+
## What It Provides
|
|
14
|
+
|
|
15
|
+
| Component | Description |
|
|
16
|
+
|-----------|-------------|
|
|
17
|
+
| **WorkQueue** | Priority queue with atomic claim/release (sorted sets) |
|
|
18
|
+
| **SessionStorage** | Key-value session state (status, cost, timestamps) |
|
|
19
|
+
| **WorkerStorage** | Worker registration, heartbeat, capacity tracking |
|
|
20
|
+
| **IssueLock** | Per-issue mutex with pending queue |
|
|
21
|
+
| **AgentTracking** | QA attempt counts, agent-worked history |
|
|
22
|
+
| **WebhookIdempotency** | Dedup webhook deliveries with TTL |
|
|
23
|
+
| **TokenStorage** | OAuth token storage and retrieval |
|
|
24
|
+
| **RateLimit** | Token bucket rate limiting |
|
|
25
|
+
| **WorkerAuth** | API key verification for workers |
|
|
26
|
+
|
|
27
|
+
## Quick Start
|
|
28
|
+
|
|
29
|
+
```typescript
|
|
30
|
+
import { createRedisClient, enqueueWork, claimWork } from '@supaku/agentfactory-server'
|
|
31
|
+
|
|
32
|
+
// Redis client (auto-reads REDIS_URL from env)
|
|
33
|
+
const redis = createRedisClient()
|
|
34
|
+
|
|
35
|
+
// Enqueue a work item with priority
|
|
36
|
+
await enqueueWork({
|
|
37
|
+
issueId: 'issue-uuid',
|
|
38
|
+
identifier: 'PROJ-123',
|
|
39
|
+
workType: 'development',
|
|
40
|
+
priority: 2,
|
|
41
|
+
prompt: 'Implement the login feature...',
|
|
42
|
+
})
|
|
43
|
+
|
|
44
|
+
// Worker claims next item
|
|
45
|
+
const work = await claimWork('worker-1')
|
|
46
|
+
if (work) {
|
|
47
|
+
console.log(`Claimed: ${work.identifier} [${work.workType}]`)
|
|
48
|
+
}
|
|
49
|
+
```
|
|
50
|
+
|
|
51
|
+
## Environment Variables
|
|
52
|
+
|
|
53
|
+
| Variable | Required | Description |
|
|
54
|
+
|----------|----------|-------------|
|
|
55
|
+
| `REDIS_URL` | Yes | Redis connection URL (e.g., `redis://localhost:6379`) |
|
|
56
|
+
|
|
57
|
+
## Related Packages
|
|
58
|
+
|
|
59
|
+
| Package | Description |
|
|
60
|
+
|---------|-------------|
|
|
61
|
+
| [@supaku/agentfactory](https://www.npmjs.com/package/@supaku/agentfactory) | Core orchestrator |
|
|
62
|
+
| [@supaku/agentfactory-cli](https://www.npmjs.com/package/@supaku/agentfactory-cli) | CLI tools (worker, orchestrator) |
|
|
63
|
+
| [@supaku/agentfactory-nextjs](https://www.npmjs.com/package/@supaku/agentfactory-nextjs) | Next.js webhook server |
|
|
64
|
+
|
|
65
|
+
## License
|
|
66
|
+
|
|
67
|
+
MIT
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@supaku/agentfactory-server",
|
|
3
|
-
"version": "0.4.
|
|
3
|
+
"version": "0.4.2",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"description": "Webhook server and distributed worker pool for AgentFactory — Redis queues, issue locks, session management",
|
|
6
6
|
"author": "Supaku (https://supaku.com)",
|
|
@@ -44,8 +44,8 @@
|
|
|
44
44
|
],
|
|
45
45
|
"dependencies": {
|
|
46
46
|
"ioredis": "^5.4.2",
|
|
47
|
-
"@supaku/agentfactory": "0.4.
|
|
48
|
-
"@supaku/agentfactory-linear": "0.4.
|
|
47
|
+
"@supaku/agentfactory": "0.4.2",
|
|
48
|
+
"@supaku/agentfactory-linear": "0.4.2"
|
|
49
49
|
},
|
|
50
50
|
"devDependencies": {
|
|
51
51
|
"@types/node": "^22.5.4",
|