@supaku/agentfactory 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.
Files changed (2) hide show
  1. package/README.md +90 -0
  2. package/package.json +2 -2
package/README.md ADDED
@@ -0,0 +1,90 @@
1
+ # @supaku/agentfactory
2
+
3
+ Core orchestrator for multi-agent fleet management. Turns your issue backlog into shipped code by coordinating coding agents (Claude, Codex, Amp) through an automated pipeline.
4
+
5
+ Part of the [AgentFactory](https://github.com/supaku/agentfactory) monorepo.
6
+
7
+ ## Installation
8
+
9
+ ```bash
10
+ npm install @supaku/agentfactory @supaku/agentfactory-linear
11
+ ```
12
+
13
+ ## Quick Start
14
+
15
+ ```typescript
16
+ import { createOrchestrator } from '@supaku/agentfactory'
17
+
18
+ const orchestrator = createOrchestrator({
19
+ maxConcurrent: 3,
20
+ worktreePath: '.worktrees',
21
+ })
22
+
23
+ // Process a single issue
24
+ await orchestrator.spawnAgentForIssue('PROJ-123')
25
+ await orchestrator.waitForAll()
26
+
27
+ // Check results
28
+ for (const agent of orchestrator.getAgents()) {
29
+ console.log(`${agent.identifier}: ${agent.status}`)
30
+ if (agent.pullRequestUrl) console.log(` PR: ${agent.pullRequestUrl}`)
31
+ if (agent.totalCostUsd) console.log(` Cost: $${agent.totalCostUsd.toFixed(4)}`)
32
+ }
33
+ ```
34
+
35
+ ## What It Does
36
+
37
+ 1. **Issue selection** — queries Linear for backlog issues, filters by project, selects by priority
38
+ 2. **Worktree creation** — creates isolated git worktrees per agent
39
+ 3. **Agent spawning** — delegates to providers (Claude, Codex, Amp)
40
+ 4. **Stream processing** — iterates `AgentEvent` from providers, emits activities to Linear
41
+ 5. **Crash recovery** — persists state to `.agent/` directory, resumes on restart
42
+ 6. **Inactivity timeout** — monitors idle agents and stops them
43
+
44
+ ## Provider Abstraction
45
+
46
+ ```typescript
47
+ interface AgentProvider {
48
+ readonly name: 'claude' | 'codex' | 'amp'
49
+ spawn(config: AgentSpawnConfig): AgentHandle
50
+ resume(sessionId: string, config: AgentSpawnConfig): AgentHandle
51
+ }
52
+
53
+ interface AgentHandle {
54
+ sessionId: string | null
55
+ stream: AsyncIterable<AgentEvent>
56
+ injectMessage(text: string): Promise<void>
57
+ stop(): Promise<void>
58
+ }
59
+ ```
60
+
61
+ Provider resolution: `AGENT_PROVIDER_{WORKTYPE}` > `AGENT_PROVIDER_{PROJECT}` > `AGENT_PROVIDER` > `'claude'`
62
+
63
+ ## Configuration
64
+
65
+ ```typescript
66
+ const orchestrator = createOrchestrator({
67
+ provider: myProvider, // Agent provider instance
68
+ maxConcurrent: 3, // Max concurrent agents
69
+ project: 'MyProject', // Filter by project
70
+ worktreePath: '.worktrees', // Git worktree base path
71
+ inactivityTimeoutMs: 300_000, // 5 min idle timeout
72
+ maxSessionTimeoutMs: 7_200_000, // 2 hour hard cap
73
+ workTypeTimeouts: {
74
+ qa: { inactivityTimeoutMs: 600_000 },
75
+ },
76
+ })
77
+ ```
78
+
79
+ ## Related Packages
80
+
81
+ | Package | Description |
82
+ |---------|-------------|
83
+ | [@supaku/agentfactory-linear](https://www.npmjs.com/package/@supaku/agentfactory-linear) | Linear issue tracker integration |
84
+ | [@supaku/agentfactory-server](https://www.npmjs.com/package/@supaku/agentfactory-server) | Redis work queue, distributed workers |
85
+ | [@supaku/agentfactory-cli](https://www.npmjs.com/package/@supaku/agentfactory-cli) | CLI tools |
86
+ | [@supaku/agentfactory-nextjs](https://www.npmjs.com/package/@supaku/agentfactory-nextjs) | Next.js webhook server |
87
+
88
+ ## License
89
+
90
+ MIT
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@supaku/agentfactory",
3
- "version": "0.4.0",
3
+ "version": "0.4.2",
4
4
  "type": "module",
5
5
  "description": "Multi-agent fleet management for coding agents — orchestrator, providers, crash recovery",
6
6
  "author": "Supaku (https://supaku.com)",
@@ -47,7 +47,7 @@
47
47
  "dependencies": {
48
48
  "@anthropic-ai/claude-agent-sdk": "^0.2.7",
49
49
  "dotenv": "^17.2.3",
50
- "@supaku/agentfactory-linear": "0.4.0"
50
+ "@supaku/agentfactory-linear": "0.4.2"
51
51
  },
52
52
  "devDependencies": {
53
53
  "@types/node": "^22.5.4",