quay-ai-factory 0.3.0 β 0.3.1
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 +120 -39
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -1,18 +1,18 @@
|
|
|
1
1
|
# Quay - Autonomous AI Software Factory
|
|
2
2
|
|
|
3
|
-
> Self-hosted AI agents with MCP integration, customizable pipelines, real-time Mission Control dashboard, cost transparency, and full audit trails.
|
|
3
|
+
> Self-hosted AI agents with MCP integration, A3M routing, customizable pipelines, real-time Mission Control dashboard, cost transparency, and full audit trails.
|
|
4
4
|
|
|
5
5
|
## π Features
|
|
6
6
|
|
|
7
7
|
### 5 AI-Powered Features (Built on A3M Router)
|
|
8
8
|
|
|
9
|
-
| Feature | Description |
|
|
10
|
-
|
|
11
|
-
| **Human-in-Loop Verification** | Require approval before critical actions
|
|
12
|
-
| **Determinism & Replay** | Black-box recorder captures every step
|
|
13
|
-
| **Visual Pipeline Builder** | Drag-drop YAML pipeline generation
|
|
14
|
-
| **Agent RAG** | Knowledge grounding to reduce hallucinations |
|
|
15
|
-
| **Self-Healing Agents** | Auto-detect and recover from failures |
|
|
9
|
+
| Feature | Description | Agent Integration |
|
|
10
|
+
|---------|-------------|-------------------|
|
|
11
|
+
| **Human-in-Loop Verification** | Require approval before critical actions | Auto-triggers on deploy, delete, rm, etc. |
|
|
12
|
+
| **Determinism & Replay** | Black-box recorder captures every step | Snapshots after each LLM call |
|
|
13
|
+
| **Visual Pipeline Builder** | Drag-drop YAML pipeline generation | Built-in templates for common workflows |
|
|
14
|
+
| **Agent RAG** | Knowledge grounding to reduce hallucinations | Applied before first LLM call |
|
|
15
|
+
| **Self-Healing Agents** | Auto-detect and recover from failures | Detects 7 failure types, 5 recovery strategies |
|
|
16
16
|
|
|
17
17
|
### Core Capabilities
|
|
18
18
|
|
|
@@ -25,7 +25,7 @@
|
|
|
25
25
|
## π¦ Installation
|
|
26
26
|
|
|
27
27
|
```bash
|
|
28
|
-
npm install
|
|
28
|
+
npm install quay-ai-factory
|
|
29
29
|
```
|
|
30
30
|
|
|
31
31
|
## πββοΈ Running
|
|
@@ -42,6 +42,88 @@ node build
|
|
|
42
42
|
bun test
|
|
43
43
|
```
|
|
44
44
|
|
|
45
|
+
## π€ Agent Runner
|
|
46
|
+
|
|
47
|
+
The `AgentRunner` orchestrates the observeβplanβact loop with all 5 AI features:
|
|
48
|
+
|
|
49
|
+
```typescript
|
|
50
|
+
import { agentRunner } from './server/agents/agentRunner.js';
|
|
51
|
+
|
|
52
|
+
// Run an agent with all features enabled
|
|
53
|
+
const result = await agentRunner.run(
|
|
54
|
+
{ id: 'task-1', title: 'Deploy to production', description: '...' },
|
|
55
|
+
{ id: 'agent-1', name: 'DeployBot', type: 'coder', provider: 'openai', model: 'gpt-4o', config: '{}' },
|
|
56
|
+
'run-123',
|
|
57
|
+
'You are a deployment agent...',
|
|
58
|
+
['bash', 'deploy'],
|
|
59
|
+
{
|
|
60
|
+
knowledgeBaseId: 'kb-1', // Enable RAG grounding
|
|
61
|
+
verificationConfig: { // Custom verification rules
|
|
62
|
+
criticalActions: ['deploy', 'delete'],
|
|
63
|
+
autoApproveBelow: 0.10,
|
|
64
|
+
},
|
|
65
|
+
maxSteps: 30, // Custom step limit
|
|
66
|
+
}
|
|
67
|
+
);
|
|
68
|
+
```
|
|
69
|
+
|
|
70
|
+
### How Features Integrate
|
|
71
|
+
|
|
72
|
+
```
|
|
73
|
+
User Request
|
|
74
|
+
β
|
|
75
|
+
AgentRunner.run()
|
|
76
|
+
β
|
|
77
|
+
βββββββββββββββββββββββββββββββββββββββββββ
|
|
78
|
+
β 1. RAG Grounding β
|
|
79
|
+
β buildGroundedPrompt() β
|
|
80
|
+
β β Adds relevant knowledge to prompt β
|
|
81
|
+
βββββββββββββββββββββββββββββββββββββββββββ
|
|
82
|
+
β
|
|
83
|
+
βββββββββββββββββββββββββββββββββββββββββββ
|
|
84
|
+
β 2. LLM Call β
|
|
85
|
+
β callLLM() with A3M routing β
|
|
86
|
+
βββββββββββββββββββββββββββββββββββββββββββ
|
|
87
|
+
β
|
|
88
|
+
βββββββββββββββββββββββββββββββββββββββββββ
|
|
89
|
+
β 3. Self-Healing Check β
|
|
90
|
+
β detectFailure() β getRecoveryStrategyβ
|
|
91
|
+
βββββββββββββββββββββββββββββββββββββββββββ
|
|
92
|
+
β
|
|
93
|
+
βββββββββββββββββββββββββββββββββββββββββββ
|
|
94
|
+
β 4. Determinism Snapshot β
|
|
95
|
+
β createSnapshot() with state hash β
|
|
96
|
+
βββββββββββββββββββββββββββββββββββββββββββ
|
|
97
|
+
β
|
|
98
|
+
βββββββββββββββββββββββββββββββββββββββββββ
|
|
99
|
+
β 5. Health Update β
|
|
100
|
+
β updateHealthStatus() β
|
|
101
|
+
βββββββββββββββββββββββββββββββββββββββββββ
|
|
102
|
+
β
|
|
103
|
+
βββββββββββββββββββββββββββββββββββββββββββ
|
|
104
|
+
β 6. Critical Action Verification β
|
|
105
|
+
β createVerificationRequest() β
|
|
106
|
+
β β Pauses if approval needed β
|
|
107
|
+
βββββββββββββββββββββββββββββββββββββββββββ
|
|
108
|
+
β
|
|
109
|
+
Tool Execution β Loop
|
|
110
|
+
```
|
|
111
|
+
|
|
112
|
+
## π§ Configuration
|
|
113
|
+
|
|
114
|
+
```bash
|
|
115
|
+
# Environment variables
|
|
116
|
+
OPENAI_API_KEY=sk-... # OpenAI API key
|
|
117
|
+
ANTHROPIC_API_KEY=sk-ant-... # Anthropic API key
|
|
118
|
+
QUAY_DEFAULT_LLM_URL=https://api.openai.com/v1 # Default LLM endpoint
|
|
119
|
+
|
|
120
|
+
EMBEDDING_PROVIDER=openai # openai, local, or mock
|
|
121
|
+
EMBEDDING_ENDPOINT=http://localhost:11434/api/embeddings
|
|
122
|
+
QUAY_DB_PATH=./quay.db # Database path
|
|
123
|
+
SSE_ENABLED=true # Enable SSE
|
|
124
|
+
NODE_ENV=production # production, development, test
|
|
125
|
+
```
|
|
126
|
+
|
|
45
127
|
## π§ͺ Features
|
|
46
128
|
|
|
47
129
|
### Verification Dashboard (`/verification`)
|
|
@@ -64,6 +146,8 @@ const request = await createVerificationRequest(
|
|
|
64
146
|
approveRequest(request.id, 'admin');
|
|
65
147
|
```
|
|
66
148
|
|
|
149
|
+
**Critical Actions** (auto-detected): `deploy`, `delete`, `rm`, `drop`, `truncate`, `shutdown`, `restart`
|
|
150
|
+
|
|
67
151
|
### Health Monitor (`/health`)
|
|
68
152
|
Real-time agent health status with self-healing.
|
|
69
153
|
|
|
@@ -76,8 +160,13 @@ updateHealthStatus('agent-1', { latencyMs: 150, success: true });
|
|
|
76
160
|
// Detect failure and get recovery strategy
|
|
77
161
|
const failure = detectFailure(new Error('timeout'));
|
|
78
162
|
const strategy = getRecoveryStrategy(failure.type);
|
|
163
|
+
// β { action: 'retry', maxRetries: 3, fallbackModel: 'gpt-4o-mini' }
|
|
79
164
|
```
|
|
80
165
|
|
|
166
|
+
**Failure Types**: `timeout`, `rate_limit`, `api_error`, `context_overflow`, `tool_error`, `unknown`
|
|
167
|
+
|
|
168
|
+
**Recovery Strategies**: `retry`, `fallback_model`, `fallback_agent`, `abort`, `skip_step`
|
|
169
|
+
|
|
81
170
|
### Knowledge Base (`/knowledge`)
|
|
82
171
|
RAG-powered knowledge grounding.
|
|
83
172
|
|
|
@@ -103,6 +192,8 @@ const templates = getTemplates('code-review');
|
|
|
103
192
|
const yaml = generateYAML(nodes, edges);
|
|
104
193
|
```
|
|
105
194
|
|
|
195
|
+
**Built-in Templates**: `code-review`, `security-scan`, `data-processing`, `research-agent`
|
|
196
|
+
|
|
106
197
|
### Replay (`/replay`)
|
|
107
198
|
Deterministic replay of agent runs.
|
|
108
199
|
|
|
@@ -113,43 +204,34 @@ await createSnapshot(runId, stepIndex, state);
|
|
|
113
204
|
const session = await startReplay(runId);
|
|
114
205
|
```
|
|
115
206
|
|
|
116
|
-
## π§ Configuration
|
|
117
|
-
|
|
118
|
-
```bash
|
|
119
|
-
# Environment variables
|
|
120
|
-
OPENAI_API_KEY=sk-... # OpenAI API key
|
|
121
|
-
EMBEDDING_PROVIDER=openai # openai, local, or mock
|
|
122
|
-
EMBEDDING_ENDPOINT=http://localhost:11434/api/embeddings
|
|
123
|
-
QUAY_DB_PATH=./quay.db # Database path
|
|
124
|
-
SSE_ENABLED=true # Enable SSE
|
|
125
|
-
NODE_ENV=production # production, development, test
|
|
126
|
-
```
|
|
127
|
-
|
|
128
207
|
## π Project Structure
|
|
129
208
|
|
|
130
209
|
```
|
|
131
210
|
quay/
|
|
132
211
|
βββ src/
|
|
133
212
|
β βββ lib/
|
|
134
|
-
β β βββ features/
|
|
135
|
-
β β β βββ verification.ts
|
|
136
|
-
β β β βββ determinism.ts
|
|
137
|
-
β β β βββ visualBuilder.ts
|
|
138
|
-
β β β βββ agentRAG.ts
|
|
139
|
-
β β β βββ selfHealing.ts
|
|
140
|
-
β β βββ components/
|
|
141
|
-
β β βββ sse/
|
|
142
|
-
β β βββ a3m.ts
|
|
143
|
-
β β βββ db.ts
|
|
144
|
-
β β βββ embedding.ts
|
|
213
|
+
β β βββ features/ # 5 AI features
|
|
214
|
+
β β β βββ verification.ts # Human-in-loop
|
|
215
|
+
β β β βββ determinism.ts # Snapshots & replay
|
|
216
|
+
β β β βββ visualBuilder.ts # Pipeline builder
|
|
217
|
+
β β β βββ agentRAG.ts # Knowledge grounding
|
|
218
|
+
β β β βββ selfHealing.ts # Auto-recovery
|
|
219
|
+
β β βββ components/ # Svelte UI components
|
|
220
|
+
β β βββ sse/ # SSE broadcaster
|
|
221
|
+
β β βββ a3m.ts # A3M router integration
|
|
222
|
+
β β βββ db.ts # Database layer
|
|
223
|
+
β β βββ embedding.ts # Embedding service
|
|
145
224
|
β βββ routes/
|
|
146
|
-
β β βββ api/
|
|
147
|
-
β β βββ [page].svelte
|
|
225
|
+
β β βββ api/ # API endpoints
|
|
226
|
+
β β βββ [page].svelte # UI pages
|
|
148
227
|
β βββ server/
|
|
149
|
-
β βββ
|
|
150
|
-
β βββ
|
|
228
|
+
β βββ agents/
|
|
229
|
+
β β βββ agentRunner.ts # Main agent loop (integrates all features)
|
|
230
|
+
β βββ db/ # Database schema
|
|
231
|
+
β βββ features/ # Feature implementations
|
|
232
|
+
β βββ ...
|
|
151
233
|
βββ tests/
|
|
152
|
-
βββ __tests__/
|
|
234
|
+
βββ __tests__/ # Integration tests
|
|
153
235
|
```
|
|
154
236
|
|
|
155
237
|
## π§ͺ Testing
|
|
@@ -172,7 +254,6 @@ Total: 56 tests passing
|
|
|
172
254
|
| Endpoint | Description |
|
|
173
255
|
|----------|-------------|
|
|
174
256
|
| `GET /api/verification` | List verification requests |
|
|
175
|
-
| `POST /api/verification` | Create verification request |
|
|
176
257
|
| `POST /api/verification/[id]/approve` | Approve request |
|
|
177
258
|
| `POST /api/verification/[id]/reject` | Reject request |
|
|
178
259
|
| `GET /api/agent-health` | Get all agent health status |
|
|
@@ -188,7 +269,7 @@ Total: 56 tests passing
|
|
|
188
269
|
|
|
189
270
|
| Route | Description |
|
|
190
271
|
|-------|-------------|
|
|
191
|
-
| `/` | Home |
|
|
272
|
+
| `/` | Home / Mission Control |
|
|
192
273
|
| `/features` | Features dashboard |
|
|
193
274
|
| `/verification` | Verification dashboard |
|
|
194
275
|
| `/health` | Agent health monitor |
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "quay-ai-factory",
|
|
3
|
-
"version": "0.3.
|
|
3
|
+
"version": "0.3.1",
|
|
4
4
|
"description": "Quay β Autonomous AI Software Factory. Self-hosted AI agents, MCP integration, customizable pipelines, real-time Mission Control dashboard, cost transparency, and full audit trails.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"ai-software-factory",
|