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.
Files changed (2) hide show
  1. package/README.md +120 -39
  2. 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 (deploy, delete) |
12
- | **Determinism & Replay** | Black-box recorder captures every step for reproducibility |
13
- | **Visual Pipeline Builder** | Drag-drop YAML pipeline generation with built-in templates |
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/ # 5 AI features
135
- β”‚ β”‚ β”‚ β”œβ”€β”€ verification.ts
136
- β”‚ β”‚ β”‚ β”œβ”€β”€ determinism.ts
137
- β”‚ β”‚ β”‚ β”œβ”€β”€ visualBuilder.ts
138
- β”‚ β”‚ β”‚ β”œβ”€β”€ agentRAG.ts
139
- β”‚ β”‚ β”‚ └── selfHealing.ts
140
- β”‚ β”‚ β”œβ”€β”€ components/ # Svelte UI components
141
- β”‚ β”‚ β”œβ”€β”€ sse/ # SSE broadcaster
142
- β”‚ β”‚ β”œβ”€β”€ a3m.ts # A3M router integration
143
- β”‚ β”‚ β”œβ”€β”€ db.ts # Database layer
144
- β”‚ β”‚ └── embedding.ts # Embedding service
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/ # API endpoints
147
- β”‚ β”‚ └── [page].svelte # UI pages
225
+ β”‚ β”‚ β”œβ”€β”€ api/ # API endpoints
226
+ β”‚ β”‚ └── [page].svelte # UI pages
148
227
  β”‚ └── server/
149
- β”‚ β”œβ”€β”€ db/ # Database schema
150
- β”‚ └── a3m/ # A3M config
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__/ # Integration 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.0",
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",