@miller-tech/uap 1.20.32 → 1.20.34
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/config/model-profiles/qwen35.json +6 -5
- package/dist/.tsbuildinfo +1 -1
- package/dist/bin/cli.js +6 -1
- package/dist/bin/cli.js.map +1 -1
- package/dist/cli/hooks.js +30 -7
- package/dist/cli/hooks.js.map +1 -1
- package/dist/cli/policy.d.ts.map +1 -1
- package/dist/cli/policy.js +26 -0
- package/dist/cli/policy.js.map +1 -1
- package/dist/dashboard/data-seeder.d.ts.map +1 -1
- package/dist/dashboard/data-seeder.js +72 -3
- package/dist/dashboard/data-seeder.js.map +1 -1
- package/dist/dashboard/data-service.js +1 -1
- package/dist/dashboard/data-service.js.map +1 -1
- package/dist/dashboard/server.js +1 -1
- package/dist/dashboard/server.js.map +1 -1
- package/dist/index.d.ts +15 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +14 -0
- package/dist/index.js.map +1 -1
- package/dist/types/index.d.ts +20 -0
- package/dist/types/index.d.ts.map +1 -1
- package/dist/types/index.js +20 -0
- package/dist/types/index.js.map +1 -1
- package/docs/AGENTS.md +423 -0
- package/docs/AGENTS.md</path>CLAUDE.md</path>/home/cogtek/dev/miller-tech/universal-agent-protocol/docs/INDEX.md</path>/home/cogtek/dev/miller-tech/universal-agent-protocol/docs/reference/API_REFERENCE.md</path>/home/cogtek/dev/miller-tech/universal-agent-protocol/docs/reference/UAP_CLI_REFERENCE.md</path>src/index.ts</path>/src/cli/worktree.ts</path>/src/coordination/deploy-batcher.ts</path>/src/policies/policy-gate.ts</path>/src/memory/model-router.ts</path>/src/memory/embeddings.ts</path>/src/models/types.ts</path>/src/types/coordination.ts</path>/src/utils/logger.ts</path>/src/utils/config-loader.ts</path>/src/utils/performance-monitor.ts</path>/src/utils/concurrency.ts</path>/src/utils/concurrency-pool.ts</path>/src/utils/string-similarity.ts</path>/src/utils/rate-limiter.ts</path>/src/utils/system-resources.ts</path>/src/utils/adaptive-cache.ts</path>/src/utils/lazy-imports.ts</path>/src/utils/merge-claude-md.ts</path>/src/utils/stopwords.ts</path>/src/utils/config-loader.ts</path>/src/utils/performance-monitor.ts</path>/src/utils/concurrency.ts</path>/src/utils/concurrency-pool.ts</path>/src/utils/string-similarity.ts</path>/src/utils/rate-limiter.ts</path>/src/utils/system-resources.ts</path>/src/utils/adaptive-cache.ts</path>/src/utils/lazy-imports.ts</path>/src/utils/merge-claude-md.ts</path>/src/utils/stopwords.ts</path> +433 -0
- package/docs/DOCUMENTATION_AUDIT_REPORT.md +131 -0
- package/docs/GETTING_STARTED.md +288 -0
- package/docs/INDEX.md +272 -42
- package/docs/PROJECT_ANALYSIS_REPORT.md +510 -0
- package/docs/architecture/SYSTEM_ANALYSIS.md +220 -1003
- package/docs/blog/local-coding-agents.md +266 -0
- package/docs/blog/x-thread.md +254 -0
- package/docs/deployment/DEPLOY_BATCHER_ANALYSIS.md +15 -647
- package/docs/getting-started/OVERVIEW.md +10 -30
- package/docs/getting-started/SETUP.md +183 -9
- package/docs/pr/UPSTREAM_PRS.md +424 -0
- package/docs/reference/CONFIGURATION.md +208 -0
- package/docs/reference/DATABASE_SCHEMA.md +344 -0
- package/docs/reference/PATTERN_LIBRARY.md +636 -0
- package/package.json +1 -1
- package/templates/hooks/uap-policy-gate.sh +36 -0
- package/tools/agents/claude_local_agent.py +92 -0
- package/tools/agents/opencode_uap_agent.py +3 -0
- package/tools/agents/scripts/anthropic_proxy.py +654 -20
- package/tools/agents/uap_agent.py +1 -1
|
@@ -1,561 +1,79 @@
|
|
|
1
|
-
#
|
|
1
|
+
# UAP - Universal Agent Protocol
|
|
2
2
|
|
|
3
|
-
>
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
1. [Executive Summary](#executive-summary)
|
|
8
|
-
2. [System Architecture](#system-architecture)
|
|
9
|
-
3. [CLI Command Reference](#cli-command-reference)
|
|
10
|
-
4. [Memory System](#memory-system)
|
|
11
|
-
5. [Multi-Agent Coordination](#multi-agent-coordination)
|
|
12
|
-
6. [Task Management System](#task-management-system)
|
|
13
|
-
7. [Worktree Workflow](#worktree-workflow)
|
|
14
|
-
8. [CLAUDE.md Generation](#claudemd-generation)
|
|
15
|
-
9. [Deploy Batching](#deploy-batching)
|
|
16
|
-
10. [Agent Performance Implications](#agent-performance-implications)
|
|
17
|
-
11. [Integration Patterns](#integration-patterns)
|
|
18
|
-
|
|
19
|
-
---
|
|
20
|
-
|
|
21
|
-
## Executive Summary
|
|
22
|
-
|
|
23
|
-
UAP (Universal Agent Memory) is a comprehensive system designed to enhance AI agent capabilities through:
|
|
24
|
-
|
|
25
|
-
| Capability | Impact on Agent Performance |
|
|
26
|
-
| ---------------------------- | ----------------------------------------------- |
|
|
27
|
-
| **4-Layer Memory** | 10x context retention, reduces repetition |
|
|
28
|
-
| **Multi-Agent Coordination** | Eliminates merge conflicts, enables parallelism |
|
|
29
|
-
| **Task Management** | Structured work tracking, dependency awareness |
|
|
30
|
-
| **Worktree Isolation** | Safe experimentation, atomic PRs |
|
|
31
|
-
| **Deploy Batching** | 50-80% CI/CD cost reduction |
|
|
32
|
-
| **CLAUDE.md Generation** | Project-aware context, reduced hallucination |
|
|
33
|
-
|
|
34
|
-
---
|
|
35
|
-
|
|
36
|
-
## System Architecture
|
|
37
|
-
|
|
38
|
-
```mermaid
|
|
39
|
-
graph TB
|
|
40
|
-
subgraph "AI Agent Layer"
|
|
41
|
-
CLAUDE[Claude/GPT Agent]
|
|
42
|
-
FACTORY[Factory.AI Agent]
|
|
43
|
-
VSCODE[VSCode Copilot]
|
|
44
|
-
end
|
|
45
|
-
|
|
46
|
-
subgraph "UAP Core"
|
|
47
|
-
CLI[CLI Interface]
|
|
48
|
-
MEM[Memory System]
|
|
49
|
-
COORD[Coordination Service]
|
|
50
|
-
TASK[Task Service]
|
|
51
|
-
DEPLOY[Deploy Batcher]
|
|
52
|
-
GEN[CLAUDE.md Generator]
|
|
53
|
-
end
|
|
54
|
-
|
|
55
|
-
subgraph "Storage Layer"
|
|
56
|
-
SQLITE[(SQLite)]
|
|
57
|
-
QDRANT[(Qdrant Vector DB)]
|
|
58
|
-
GIT[(Git Repository)]
|
|
59
|
-
end
|
|
60
|
-
|
|
61
|
-
subgraph "External Services"
|
|
62
|
-
OLLAMA[Ollama Embeddings]
|
|
63
|
-
GITHUB[GitHub API]
|
|
64
|
-
DOCKER[Docker]
|
|
65
|
-
end
|
|
66
|
-
|
|
67
|
-
CLAUDE --> CLI
|
|
68
|
-
FACTORY --> CLI
|
|
69
|
-
VSCODE --> CLI
|
|
70
|
-
|
|
71
|
-
CLI --> MEM
|
|
72
|
-
CLI --> COORD
|
|
73
|
-
CLI --> TASK
|
|
74
|
-
CLI --> DEPLOY
|
|
75
|
-
CLI --> GEN
|
|
76
|
-
|
|
77
|
-
MEM --> SQLITE
|
|
78
|
-
MEM --> QDRANT
|
|
79
|
-
MEM --> OLLAMA
|
|
80
|
-
|
|
81
|
-
COORD --> SQLITE
|
|
82
|
-
TASK --> SQLITE
|
|
83
|
-
DEPLOY --> SQLITE
|
|
84
|
-
DEPLOY --> GIT
|
|
85
|
-
DEPLOY --> GITHUB
|
|
86
|
-
|
|
87
|
-
GEN --> GIT
|
|
88
|
-
GEN --> MEM
|
|
89
|
-
|
|
90
|
-
style MEM fill:#e3f2fd
|
|
91
|
-
style COORD fill:#fff3e0
|
|
92
|
-
style TASK fill:#f3e5f5
|
|
93
|
-
style DEPLOY fill:#e8f5e9
|
|
94
|
-
```
|
|
95
|
-
|
|
96
|
-
### Component Overview
|
|
97
|
-
|
|
98
|
-
```mermaid
|
|
99
|
-
mindmap
|
|
100
|
-
root((UAP))
|
|
101
|
-
Memory
|
|
102
|
-
Short-term SQLite
|
|
103
|
-
Long-term Qdrant
|
|
104
|
-
Session Memory
|
|
105
|
-
Knowledge Graph
|
|
106
|
-
Coordination
|
|
107
|
-
Agent Registry
|
|
108
|
-
Work Announcements
|
|
109
|
-
Message Bus
|
|
110
|
-
Overlap Detection
|
|
111
|
-
Tasks
|
|
112
|
-
Create/Update/Close
|
|
113
|
-
Dependencies
|
|
114
|
-
Priorities
|
|
115
|
-
Sync to JSONL
|
|
116
|
-
Worktrees
|
|
117
|
-
Create Branches
|
|
118
|
-
PR Generation
|
|
119
|
-
Cleanup
|
|
120
|
-
Deploy
|
|
121
|
-
Queue Actions
|
|
122
|
-
Batch Creation
|
|
123
|
-
Squash Commits
|
|
124
|
-
Parallel Execute
|
|
125
|
-
Generation
|
|
126
|
-
CLAUDE.md
|
|
127
|
-
AGENT.md
|
|
128
|
-
Project Analysis
|
|
129
|
-
```
|
|
3
|
+
> **Version:** 1.20.32
|
|
4
|
+
> **Last Updated:** 2026-04-08
|
|
5
|
+
> \*\*License: AI agents to maintain persistent context, learn from past interactions, and apply proven patterns across tasks.
|
|
130
6
|
|
|
131
7
|
---
|
|
132
8
|
|
|
133
|
-
##
|
|
134
|
-
|
|
135
|
-
### Command Hierarchy
|
|
9
|
+
## Quick Start
|
|
136
10
|
|
|
137
|
-
```
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
UAP --> INIT[init]
|
|
142
|
-
UAP --> ANALYZE[analyze]
|
|
143
|
-
UAP --> GENERATE[generate]
|
|
144
|
-
UAP --> UPDATE[update]
|
|
145
|
-
|
|
146
|
-
UAP --> MEMORY[memory]
|
|
147
|
-
MEMORY --> M_STATUS[status]
|
|
148
|
-
MEMORY --> M_START[start]
|
|
149
|
-
MEMORY --> M_STOP[stop]
|
|
150
|
-
MEMORY --> M_QUERY[query]
|
|
151
|
-
MEMORY --> M_STORE[store]
|
|
152
|
-
MEMORY --> M_PREPOP[prepopulate]
|
|
153
|
-
|
|
154
|
-
UAP --> WORKTREE[worktree]
|
|
155
|
-
WORKTREE --> W_CREATE[create]
|
|
156
|
-
WORKTREE --> W_LIST[list]
|
|
157
|
-
WORKTREE --> W_PR[pr]
|
|
158
|
-
WORKTREE --> W_CLEANUP[cleanup]
|
|
159
|
-
|
|
160
|
-
UAP --> AGENT[agent]
|
|
161
|
-
AGENT --> A_REG[register]
|
|
162
|
-
AGENT --> A_HB[heartbeat]
|
|
163
|
-
AGENT --> A_STATUS[status]
|
|
164
|
-
AGENT --> A_ANN[announce]
|
|
165
|
-
AGENT --> A_COMP[complete]
|
|
166
|
-
AGENT --> A_OVER[overlaps]
|
|
167
|
-
AGENT --> A_BROAD[broadcast]
|
|
168
|
-
AGENT --> A_SEND[send]
|
|
169
|
-
AGENT --> A_RECV[receive]
|
|
170
|
-
AGENT --> A_DEREG[deregister]
|
|
171
|
-
|
|
172
|
-
UAP --> COORD[coord]
|
|
173
|
-
COORD --> C_STATUS[status]
|
|
174
|
-
COORD --> C_FLUSH[flush]
|
|
175
|
-
COORD --> C_CLEAN[cleanup]
|
|
176
|
-
|
|
177
|
-
UAP --> DEPLOY[deploy]
|
|
178
|
-
DEPLOY --> D_QUEUE[queue]
|
|
179
|
-
DEPLOY --> D_BATCH[batch]
|
|
180
|
-
DEPLOY --> D_EXEC[execute]
|
|
181
|
-
DEPLOY --> D_STATUS[status]
|
|
182
|
-
DEPLOY --> D_FLUSH[flush]
|
|
183
|
-
|
|
184
|
-
UAP --> TASK[task]
|
|
185
|
-
TASK --> T_CREATE[create]
|
|
186
|
-
TASK --> T_LIST[list]
|
|
187
|
-
TASK --> T_SHOW[show]
|
|
188
|
-
TASK --> T_UPDATE[update]
|
|
189
|
-
TASK --> T_CLOSE[close]
|
|
190
|
-
TASK --> T_DEP[dep/undep]
|
|
191
|
-
TASK --> T_CLAIM[claim]
|
|
192
|
-
TASK --> T_RELEASE[release]
|
|
193
|
-
TASK --> T_STATS[stats]
|
|
194
|
-
TASK --> T_SYNC[sync]
|
|
195
|
-
|
|
196
|
-
style MEMORY fill:#e3f2fd
|
|
197
|
-
style AGENT fill:#fff3e0
|
|
198
|
-
style DEPLOY fill:#e8f5e9
|
|
199
|
-
style TASK fill:#f3e5f5
|
|
11
|
+
```bash
|
|
12
|
+
npm install -g @miller-tech/uap
|
|
13
|
+
uap init
|
|
14
|
+
uap setup -p all
|
|
200
15
|
```
|
|
201
16
|
|
|
202
|
-
### Command Summary Table
|
|
203
|
-
|
|
204
|
-
| Command | Subcommand | Purpose |
|
|
205
|
-
| -------------- | ----------------- | ---------------------------------------------------- |
|
|
206
|
-
| `uap init` | - | Initialize project with CLAUDE.md, memory, worktrees |
|
|
207
|
-
| `uap analyze` | - | Analyze project structure, generate metadata |
|
|
208
|
-
| `uap generate` | - | Generate/regenerate CLAUDE.md |
|
|
209
|
-
| `uap update` | - | Update all UAP components |
|
|
210
|
-
| `uap memory` | `status` | Show memory system status |
|
|
211
|
-
| | `start/stop` | Control Qdrant container |
|
|
212
|
-
| | `query <term>` | Search memories |
|
|
213
|
-
| | `store <content>` | Store new memory |
|
|
214
|
-
| | `prepopulate` | Import from docs/git history |
|
|
215
|
-
| `uap worktree` | `create <slug>` | Create isolated worktree |
|
|
216
|
-
| | `list` | List all worktrees |
|
|
217
|
-
| | `pr <id>` | Create PR from worktree |
|
|
218
|
-
| | `cleanup <id>` | Remove worktree and branch |
|
|
219
|
-
| `uap agent` | `register` | Register new agent |
|
|
220
|
-
| | `announce` | Announce work intent |
|
|
221
|
-
| | `overlaps` | Check for conflicts |
|
|
222
|
-
| | `broadcast/send` | Inter-agent messaging |
|
|
223
|
-
| `uap coord` | `status` | Show coordination status |
|
|
224
|
-
| | `cleanup` | Remove stale data |
|
|
225
|
-
| `uap deploy` | `queue` | Queue deploy action |
|
|
226
|
-
| | `batch` | Create batch from pending |
|
|
227
|
-
| | `execute` | Execute batch |
|
|
228
|
-
| | `flush` | Execute all pending |
|
|
229
|
-
| `uap task` | `create` | Create task |
|
|
230
|
-
| | `list/show` | View tasks |
|
|
231
|
-
| | `claim/release` | Work lifecycle |
|
|
232
|
-
| | `dep/undep` | Manage dependencies |
|
|
233
|
-
|
|
234
17
|
---
|
|
235
18
|
|
|
236
|
-
##
|
|
19
|
+
## Architecture
|
|
237
20
|
|
|
238
|
-
### Four-Layer
|
|
21
|
+
### Four-Layer Memory System
|
|
239
22
|
|
|
240
23
|
```mermaid
|
|
241
24
|
graph TB
|
|
242
|
-
subgraph "L1: Working Memory"
|
|
243
|
-
direction LR
|
|
244
|
-
W1[Recent Actions]
|
|
245
|
-
W2[Current Context]
|
|
246
|
-
W3[Active Decisions]
|
|
247
|
-
end
|
|
248
|
-
|
|
249
|
-
subgraph "L2: Session Memory"
|
|
250
|
-
direction LR
|
|
251
|
-
S1[Session Decisions]
|
|
252
|
-
S2[Important Context]
|
|
253
|
-
S3[Cross-Request State]
|
|
254
|
-
end
|
|
255
|
-
|
|
256
|
-
subgraph "L3: Semantic Memory"
|
|
257
|
-
direction LR
|
|
258
|
-
SE1[Learned Lessons]
|
|
259
|
-
SE2[Patterns]
|
|
260
|
-
SE3[Solutions]
|
|
261
|
-
end
|
|
262
|
-
|
|
263
25
|
subgraph "L4: Knowledge Graph"
|
|
264
|
-
direction LR
|
|
265
26
|
K1[Entities]
|
|
266
27
|
K2[Relationships]
|
|
267
|
-
K3[File Dependencies]
|
|
268
|
-
end
|
|
269
|
-
|
|
270
|
-
W1 --> S1
|
|
271
|
-
W2 --> S2
|
|
272
|
-
S1 --> SE1
|
|
273
|
-
S2 --> SE2
|
|
274
|
-
SE1 --> K1
|
|
275
|
-
SE2 --> K2
|
|
276
|
-
|
|
277
|
-
style W1 fill:#ffcdd2
|
|
278
|
-
style W2 fill:#ffcdd2
|
|
279
|
-
style W3 fill:#ffcdd2
|
|
280
|
-
style S1 fill:#fff9c4
|
|
281
|
-
style S2 fill:#fff9c4
|
|
282
|
-
style S3 fill:#fff9c4
|
|
283
|
-
style SE1 fill:#c8e6c9
|
|
284
|
-
style SE2 fill:#c8e6c9
|
|
285
|
-
style SE3 fill:#c8e6c9
|
|
286
|
-
style K1 fill:#bbdefb
|
|
287
|
-
style K2 fill:#bbdefb
|
|
288
|
-
style K3 fill:#bbdefb
|
|
289
|
-
```
|
|
290
|
-
|
|
291
|
-
### Memory Layer Characteristics
|
|
292
|
-
|
|
293
|
-
| Layer | Storage | Capacity | Latency | Retention |
|
|
294
|
-
| ----------------- | ------------------------------- | ---------- | ------- | ----------------- |
|
|
295
|
-
| **L1: Working** | SQLite `memories` | 50 entries | <1ms | Session |
|
|
296
|
-
| **L2: Session** | SQLite `session_memories` | Unlimited | <5ms | Project lifecycle |
|
|
297
|
-
| **L3: Semantic** | Qdrant vectors | Unlimited | ~50ms | Permanent |
|
|
298
|
-
| **L4: Knowledge** | SQLite `entities/relationships` | Unlimited | <20ms | Permanent |
|
|
299
|
-
|
|
300
|
-
### Hierarchical Memory Manager
|
|
301
|
-
|
|
302
|
-
```mermaid
|
|
303
|
-
stateDiagram-v2
|
|
304
|
-
[*] --> Hot: add()
|
|
305
|
-
|
|
306
|
-
Hot --> Hot: access() high frequency
|
|
307
|
-
Hot --> Warm: rebalance() overflow
|
|
308
|
-
|
|
309
|
-
Warm --> Hot: access() promotion
|
|
310
|
-
Warm --> Cold: rebalance() overflow
|
|
311
|
-
|
|
312
|
-
Cold --> Warm: query() retrieval
|
|
313
|
-
Cold --> Summary: consolidate()
|
|
314
|
-
|
|
315
|
-
Summary --> Cold: store summary
|
|
316
|
-
|
|
317
|
-
note right of Hot
|
|
318
|
-
In-context memory
|
|
319
|
-
Max 10 entries
|
|
320
|
-
2000 tokens limit
|
|
321
|
-
end note
|
|
322
|
-
|
|
323
|
-
note right of Warm
|
|
324
|
-
Cached memory
|
|
325
|
-
Max 50 entries
|
|
326
|
-
Frequent access
|
|
327
|
-
end note
|
|
328
|
-
|
|
329
|
-
note right of Cold
|
|
330
|
-
Archived memory
|
|
331
|
-
Max 500 entries
|
|
332
|
-
Semantic search only
|
|
333
|
-
end note
|
|
334
|
-
```
|
|
335
|
-
|
|
336
|
-
### Memory Decay Formula
|
|
337
|
-
|
|
338
|
-
```
|
|
339
|
-
effective_importance = importance × (0.95 ^ days_since_access)
|
|
340
|
-
```
|
|
341
|
-
|
|
342
|
-
Example decay over time:
|
|
343
|
-
|
|
344
|
-
- Day 0: importance = 10.0
|
|
345
|
-
- Day 7: importance = 6.98 (30% decay)
|
|
346
|
-
- Day 30: importance = 2.15 (78% decay)
|
|
347
|
-
- Day 90: importance = 0.10 (99% decay)
|
|
348
|
-
|
|
349
|
-
### Memory Operations Flow
|
|
350
|
-
|
|
351
|
-
```mermaid
|
|
352
|
-
sequenceDiagram
|
|
353
|
-
participant Agent
|
|
354
|
-
participant CLI as uap memory
|
|
355
|
-
participant SQLite
|
|
356
|
-
participant Qdrant
|
|
357
|
-
participant Ollama
|
|
358
|
-
|
|
359
|
-
Note over Agent: Store Memory
|
|
360
|
-
Agent->>CLI: uap memory store "lesson"
|
|
361
|
-
CLI->>SQLite: INSERT into memories
|
|
362
|
-
CLI->>SQLite: INSERT into session_memories
|
|
363
|
-
|
|
364
|
-
alt importance >= 7
|
|
365
|
-
CLI->>Ollama: Generate embedding
|
|
366
|
-
Ollama-->>CLI: 384-dim vector
|
|
367
|
-
CLI->>Qdrant: Upsert to collection
|
|
368
|
-
end
|
|
369
|
-
|
|
370
|
-
Note over Agent: Query Memory
|
|
371
|
-
Agent->>CLI: uap memory query "pattern"
|
|
372
|
-
CLI->>SQLite: SELECT from memories (text match)
|
|
373
|
-
CLI->>SQLite: SELECT from session_memories
|
|
374
|
-
|
|
375
|
-
alt Need semantic search
|
|
376
|
-
CLI->>Ollama: Embed query
|
|
377
|
-
CLI->>Qdrant: Vector similarity search
|
|
378
|
-
Qdrant-->>CLI: Relevant memories
|
|
379
|
-
end
|
|
380
|
-
|
|
381
|
-
CLI-->>Agent: Combined results
|
|
382
|
-
```
|
|
383
|
-
|
|
384
|
-
### Prepopulation Sources
|
|
385
|
-
|
|
386
|
-
```mermaid
|
|
387
|
-
flowchart LR
|
|
388
|
-
subgraph "Sources"
|
|
389
|
-
DOCS[Documentation]
|
|
390
|
-
GIT[Git History]
|
|
391
|
-
SKILLS[Skills/Droids]
|
|
392
|
-
end
|
|
393
|
-
|
|
394
|
-
subgraph "Extraction"
|
|
395
|
-
PARSE[Parse Content]
|
|
396
|
-
EXTRACT[Extract Patterns]
|
|
397
|
-
CLASSIFY[Classify Type]
|
|
398
|
-
end
|
|
399
|
-
|
|
400
|
-
subgraph "Storage"
|
|
401
|
-
ST[Short-term]
|
|
402
|
-
LT[Long-term]
|
|
403
|
-
KG[Knowledge Graph]
|
|
404
28
|
end
|
|
405
29
|
|
|
406
|
-
|
|
407
|
-
|
|
408
|
-
|
|
409
|
-
|
|
410
|
-
PARSE --> EXTRACT
|
|
411
|
-
EXTRACT --> CLASSIFY
|
|
412
|
-
|
|
413
|
-
CLASSIFY --> ST
|
|
414
|
-
CLASSIFY --> LT
|
|
415
|
-
CLASSIFY --> KG
|
|
416
|
-
```
|
|
417
|
-
|
|
418
|
-
---
|
|
419
|
-
|
|
420
|
-
## Multi-Agent Coordination
|
|
421
|
-
|
|
422
|
-
### Agent Lifecycle
|
|
423
|
-
|
|
424
|
-
```mermaid
|
|
425
|
-
stateDiagram-v2
|
|
426
|
-
[*] --> Registered: register()
|
|
427
|
-
|
|
428
|
-
Registered --> Active: heartbeat()
|
|
429
|
-
Active --> Active: heartbeat()
|
|
430
|
-
Active --> Idle: no current task
|
|
431
|
-
Idle --> Active: claim work
|
|
432
|
-
|
|
433
|
-
Active --> Completed: deregister()
|
|
434
|
-
Idle --> Completed: deregister()
|
|
435
|
-
|
|
436
|
-
Active --> Failed: heartbeat timeout
|
|
437
|
-
Idle --> Failed: heartbeat timeout
|
|
438
|
-
|
|
439
|
-
Completed --> [*]
|
|
440
|
-
Failed --> [*]
|
|
441
|
-
```
|
|
442
|
-
|
|
443
|
-
### Work Coordination Model
|
|
444
|
-
|
|
445
|
-
UAP uses **announcements** (not locks) for coordination. Agents work in isolated worktrees, so hard locks are unnecessary.
|
|
446
|
-
|
|
447
|
-
```mermaid
|
|
448
|
-
flowchart TB
|
|
449
|
-
subgraph "Agent A (Worktree A)"
|
|
450
|
-
A1[Announce: editing src/auth.ts]
|
|
451
|
-
A2[Work in isolation]
|
|
452
|
-
A3[Complete work]
|
|
453
|
-
end
|
|
454
|
-
|
|
455
|
-
subgraph "Agent B (Worktree B)"
|
|
456
|
-
B1[Check overlaps]
|
|
457
|
-
B2[See Agent A working on auth]
|
|
458
|
-
B3[Choose different file or coordinate]
|
|
30
|
+
subgraph "L3: Semantic Memory"
|
|
31
|
+
S1[Qdrant Vectors]
|
|
32
|
+
S2[Similarity Search]
|
|
459
33
|
end
|
|
460
34
|
|
|
461
|
-
subgraph "
|
|
462
|
-
|
|
463
|
-
|
|
464
|
-
SUGG[Collaboration Suggestions]
|
|
35
|
+
subgraph "L2: Session Memory"
|
|
36
|
+
SE1[High-Importance Decisions]
|
|
37
|
+
SE2[Per-Session State]
|
|
465
38
|
end
|
|
466
39
|
|
|
467
|
-
|
|
468
|
-
|
|
469
|
-
|
|
470
|
-
CS --> SUGG
|
|
471
|
-
SUGG --> B3
|
|
472
|
-
|
|
473
|
-
A3 --> MSG
|
|
474
|
-
MSG --> B3
|
|
475
|
-
```
|
|
476
|
-
|
|
477
|
-
### Overlap Detection & Conflict Risk
|
|
478
|
-
|
|
479
|
-
```mermaid
|
|
480
|
-
flowchart TB
|
|
481
|
-
subgraph "Risk Assessment"
|
|
482
|
-
R1{Same File?}
|
|
483
|
-
R2{Same Directory?}
|
|
484
|
-
R3{Overlapping Files?}
|
|
485
|
-
R4{Intent Types?}
|
|
40
|
+
subgraph "L1: Working Memory"
|
|
41
|
+
W1[SQLite + FTS5]
|
|
42
|
+
W2[Recent Actions]
|
|
486
43
|
end
|
|
487
44
|
|
|
488
|
-
|
|
489
|
-
|
|
490
|
-
|
|
491
|
-
MED[MEDIUM: Same directory]
|
|
492
|
-
LOW[LOW: Review/test/document]
|
|
493
|
-
NONE[NONE: No overlap]
|
|
494
|
-
end
|
|
45
|
+
K1 --> S1
|
|
46
|
+
S1 --> SE1
|
|
47
|
+
SE1 --> W1
|
|
495
48
|
|
|
496
|
-
|
|
497
|
-
|
|
498
|
-
|
|
499
|
-
|
|
500
|
-
R2 -->|No| R3
|
|
501
|
-
R3 -->|Yes| MED
|
|
502
|
-
R3 -->|No| R4
|
|
503
|
-
R4 -->|Low risk types| LOW
|
|
504
|
-
R4 -->|No overlap| NONE
|
|
505
|
-
|
|
506
|
-
style CRIT fill:#ffcdd2
|
|
507
|
-
style HIGH fill:#ffab91
|
|
508
|
-
style MED fill:#fff9c4
|
|
509
|
-
style LOW fill:#c8e6c9
|
|
510
|
-
style NONE fill:#bbdefb
|
|
49
|
+
style K1 fill:#e3f2fd,stroke:#1976d2
|
|
50
|
+
style S1 fill:#fff3e0,stroke:#f57c00
|
|
51
|
+
style SE1 fill:#f3e5f5,stroke:#7b1fa2
|
|
52
|
+
style W1 fill:#c8e6c9,stroke:#388e3c
|
|
511
53
|
```
|
|
512
54
|
|
|
513
|
-
|
|
514
|
-
|
|
515
|
-
|
|
|
516
|
-
|
|
|
517
|
-
|
|
|
518
|
-
|
|
|
519
|
-
| **Medium** | Announce changes, coordinate merge order |
|
|
520
|
-
| **Low** | Parallel work safe, watch shared imports |
|
|
521
|
-
| **None** | Full parallel execution |
|
|
522
|
-
|
|
523
|
-
### Inter-Agent Messaging
|
|
524
|
-
|
|
525
|
-
```mermaid
|
|
526
|
-
sequenceDiagram
|
|
527
|
-
participant A1 as Agent 1
|
|
528
|
-
participant CS as Coordination Service
|
|
529
|
-
participant A2 as Agent 2
|
|
530
|
-
participant A3 as Agent 3
|
|
531
|
-
|
|
532
|
-
Note over A1,A3: Broadcast Message
|
|
533
|
-
A1->>CS: broadcast(channel: coordination)
|
|
534
|
-
CS->>A2: Message queued
|
|
535
|
-
CS->>A3: Message queued
|
|
536
|
-
A2->>CS: receive()
|
|
537
|
-
CS-->>A2: Messages
|
|
538
|
-
|
|
539
|
-
Note over A1,A2: Direct Message
|
|
540
|
-
A1->>CS: send(to: Agent2)
|
|
541
|
-
A2->>CS: receive()
|
|
542
|
-
CS-->>A2: Direct message
|
|
543
|
-
```
|
|
55
|
+
| Layer | Storage | Capacity | Latency |
|
|
56
|
+
| ------------- | ------------------------- | ---------- | ------- |
|
|
57
|
+
| L1: Working | SQLite `memories` | 50 entries | <1ms |
|
|
58
|
+
| L2: Session | SQLite `session_memories` | Unlimited | <5ms |
|
|
59
|
+
| L3: Semantic | Qdrant vectors | Unlimited | ~50ms |
|
|
60
|
+
| L4: Knowledge | SQLite entities/rels | Unlimited | <20ms |
|
|
544
61
|
|
|
545
|
-
|
|
62
|
+
### Multi-Agent Coordination**Agent Registry**: Track active agents with heartbeat monitoring
|
|
546
63
|
|
|
547
|
-
|
|
64
|
+
- **Work Announcements**: Declare intent before editing resources
|
|
65
|
+
- **Overlap Detection**: Prevent conflicts via resource analysis
|
|
66
|
+
- **Inter-Agent Messaging**: Broadcast, direct, and channel-based communication
|
|
67
|
+
- **Deploy Batching**: Squash, merge, parallelize deploy actions
|
|
548
68
|
|
|
549
|
-
### Task
|
|
69
|
+
### Task Management (7 modules)
|
|
550
70
|
|
|
551
|
-
|
|
71
|
+
````mermaid
|
|
552
72
|
stateDiagram-v2
|
|
553
73
|
[*] --> open: create()
|
|
554
|
-
|
|
555
74
|
open --> in_progress: update(status)
|
|
556
75
|
open --> blocked: dependency added
|
|
557
76
|
|
|
558
|
-
in_progress --> blocked: blocker discovered
|
|
559
77
|
in_progress --> done: close()
|
|
560
78
|
in_progress --> wont_do: close(reason)
|
|
561
79
|
|
|
@@ -564,554 +82,253 @@ stateDiagram-v2
|
|
|
564
82
|
|
|
565
83
|
done --> [*]
|
|
566
84
|
wont_do --> [*]
|
|
567
|
-
```
|
|
568
|
-
|
|
569
|
-
### Task Hierarchy
|
|
570
85
|
|
|
571
|
-
|
|
572
|
-
|
|
573
|
-
|
|
574
|
-
|
|
575
|
-
|
|
576
|
-
|
|
577
|
-
|
|
578
|
-
BUG[Bug]
|
|
579
|
-
CHORE[Chore]
|
|
580
|
-
end
|
|
86
|
+
style open fill:#c8e6c9,stroke:#388e3c
|
|
87
|
+
| Storage | Capacity | Latency |
|
|
88
|
+
|----------|--------------------------|---------------|---------|
|
|
89
|
+
| L1: Working | SQLite `memories` | 50 entries | <1ms |
|
|
90
|
+
| L2: Session | SQLite `session_memories`| Unlimited | <5ms |
|
|
91
|
+
| L3: Semantic | Qdrant vectors | Unlimited | ~50ms |
|
|
92
|
+
| L4: Knowledge | SQLite entities/rels | Unlimited | <20ms |
|
|
581
93
|
|
|
582
|
-
|
|
583
|
-
EPIC --> STORY
|
|
584
|
-
FEATURE --> TASK
|
|
585
|
-
FEATURE --> BUG
|
|
586
|
-
STORY --> TASK
|
|
587
|
-
STORY --> CHORE
|
|
94
|
+
---
|
|
588
95
|
|
|
589
|
-
|
|
590
|
-
style FEATURE fill:#b3e5fc
|
|
591
|
-
style STORY fill:#c8e6c9
|
|
592
|
-
```
|
|
96
|
+
## CLI Reference
|
|
593
97
|
|
|
594
|
-
###
|
|
98
|
+
### 25 Top-Level Commands
|
|
595
99
|
|
|
596
|
-
|
|
|
597
|
-
|
|
598
|
-
|
|
|
599
|
-
|
|
|
600
|
-
|
|
|
601
|
-
|
|
|
602
|
-
|
|
|
100
|
+
| Command | Description |
|
|
101
|
+
|---------|-------------|
|
|
102
|
+
| `uap init` | Initialize UAP in a project |
|
|
103
|
+
| `uap setup -p all` | Full setup (memory, Qdrant, hooks, patterns) |
|
|
104
|
+
| `uap memory <action>` | Memory management (9 subcommands) |
|
|
105
|
+
| `uap worktree <action>` | Git worktree management (5 subcommands) |
|
|
106
|
+
| `uap agent <action>` | Agent lifecycle (10 subcommands) |
|
|
107
|
+
| `uap deploy <action>` | Deploy batching (8 subcommands) |
|
|
108
|
+
| `uap task <action>` | Task management (15 subcommands) |
|
|
109
|
+
| `uap policy <action>` | Policy management (15 subcommands) |
|
|
110
|
+
| `uap model <action>` | Multi-model management (8 subcommands) |
|
|
111
|
+
| `uap patterns <action>` | Pattern RAG management (4 subcommands) |
|
|
603
112
|
|
|
604
|
-
|
|
113
|
+
**Total: 109 commands and subcommands.**
|
|
605
114
|
|
|
606
|
-
|
|
607
|
-
sequenceDiagram
|
|
608
|
-
participant Agent
|
|
609
|
-
participant TaskSvc as Task Service
|
|
610
|
-
participant CoordSvc as Coordination Service
|
|
611
|
-
participant Worktree as Worktree Manager
|
|
612
|
-
|
|
613
|
-
Note over Agent: Claim Task
|
|
614
|
-
Agent->>TaskSvc: task claim <id>
|
|
615
|
-
TaskSvc->>TaskSvc: Update assignee
|
|
616
|
-
TaskSvc->>TaskSvc: Set status = in_progress
|
|
617
|
-
TaskSvc->>CoordSvc: Announce work intent
|
|
618
|
-
TaskSvc->>Worktree: Create worktree
|
|
619
|
-
Worktree-->>Agent: Worktree path
|
|
620
|
-
|
|
621
|
-
Note over Agent: Release Task
|
|
622
|
-
Agent->>TaskSvc: task release <id>
|
|
623
|
-
TaskSvc->>TaskSvc: Set status = done
|
|
624
|
-
TaskSvc->>CoordSvc: Announce completion
|
|
625
|
-
CoordSvc->>CoordSvc: Notify blocked tasks
|
|
626
|
-
```
|
|
115
|
+
### Common Operations
|
|
627
116
|
|
|
628
|
-
|
|
117
|
+
```bash
|
|
118
|
+
# Query semantic memory
|
|
119
|
+
uap memory query "authentication errors"
|
|
629
120
|
|
|
630
|
-
|
|
631
|
-
|
|
632
|
-
subgraph "Dependency Types"
|
|
633
|
-
BLOCKS[blocks: A must complete before B]
|
|
634
|
-
RELATED[related: A and B are connected]
|
|
635
|
-
DISC[discovered_from: B found while working A]
|
|
636
|
-
end
|
|
121
|
+
# Create tracked task
|
|
122
|
+
uap task create --title "Fix login bug" --type bug
|
|
637
123
|
|
|
638
|
-
|
|
639
|
-
|
|
640
|
-
T3[Task 3: Add Tests]
|
|
641
|
-
T4[Task 4: Documentation]
|
|
124
|
+
# Check for agent overlaps
|
|
125
|
+
uap agent overlaps --resource src/auth.ts
|
|
642
126
|
|
|
643
|
-
|
|
644
|
-
|
|
645
|
-
|
|
646
|
-
|
|
647
|
-
```
|
|
127
|
+
# Queue deploy action
|
|
128
|
+
uap deploy queue --action commit --target main --message> View dashboard
|
|
129
|
+
uap dashboard
|
|
130
|
+
````
|
|
648
131
|
|
|
649
132
|
---
|
|
650
133
|
|
|
651
|
-
##
|
|
652
|
-
|
|
653
|
-
|
|
654
|
-
|
|
655
|
-
|
|
656
|
-
|
|
657
|
-
|
|
658
|
-
|
|
659
|
-
|
|
660
|
-
|
|
661
|
-
|
|
662
|
-
|
|
663
|
-
|
|
664
|
-
|
|
665
|
-
|
|
666
|
-
|
|
667
|
-
|
|
668
|
-
|
|
669
|
-
|
|
670
|
-
|
|
671
|
-
|
|
672
|
-
|
|
673
|
-
|
|
674
|
-
|
|
675
|
-
|
|
676
|
-
│ │ ├── src/
|
|
677
|
-
│ │ └── ...
|
|
678
|
-
│ ├── 002-fix-bug/ # Worktree 2
|
|
679
|
-
│ │ ├── src/
|
|
680
|
-
│ │ └── ...
|
|
681
|
-
│ └── 003-refactor-api/ # Worktree 3
|
|
682
|
-
├── src/ # Main working directory
|
|
683
|
-
└── ...
|
|
684
|
-
```
|
|
685
|
-
|
|
686
|
-
### Worktree + Agent Coordination
|
|
687
|
-
|
|
688
|
-
```mermaid
|
|
689
|
-
sequenceDiagram
|
|
690
|
-
participant A1 as Agent 1
|
|
691
|
-
participant A2 as Agent 2
|
|
692
|
-
participant WT as Worktree Manager
|
|
693
|
-
participant GIT as Git
|
|
694
|
-
participant CS as Coordination
|
|
695
|
-
|
|
696
|
-
A1->>WT: create add-auth
|
|
697
|
-
WT->>GIT: git worktree add -b feature/001-add-auth
|
|
698
|
-
GIT-->>WT: Created
|
|
699
|
-
WT-->>A1: .worktrees/001-add-auth
|
|
700
|
-
|
|
701
|
-
A2->>WT: create fix-bug
|
|
702
|
-
WT->>GIT: git worktree add -b feature/002-fix-bug
|
|
703
|
-
GIT-->>WT: Created
|
|
704
|
-
WT-->>A2: .worktrees/002-fix-bug
|
|
705
|
-
|
|
706
|
-
Note over A1,A2: Parallel Work in Isolation
|
|
707
|
-
|
|
708
|
-
A1->>CS: announce(editing src/auth.ts)
|
|
709
|
-
A2->>CS: overlaps check
|
|
710
|
-
CS-->>A2: No overlap (different worktree)
|
|
711
|
-
|
|
712
|
-
A1->>WT: pr 1
|
|
713
|
-
WT->>GIT: push + gh pr create
|
|
714
|
-
|
|
715
|
-
A2->>WT: pr 2
|
|
716
|
-
WT->>GIT: push + gh pr create
|
|
717
|
-
```
|
|
134
|
+
## Pattern System (23 Patterns)
|
|
135
|
+
|
|
136
|
+
Battle-tested patterns from Terminal-Bench 2.0:
|
|
137
|
+
|
|
138
|
+
| Pattern | ID | Missing output files (37% of failures) |
|
|
139
|
+
| Iterative Refinement | P13 | First-attempt acceptance |
|
|
140
|
+
| Output Format | P14 | Wrong format/encoding |
|
|
141
|
+
| Task-First | P16 | Over-planning before doing |
|
|
142
|
+
| Constraint Extraction | P17 | Missing hidden requirements |
|
|
143
|
+
| Impossible Refusal | P19 | Attempting impossible tasks |
|
|
144
|
+
| Chess Engine | P21 | Reinventing Stockfish |
|
|
145
|
+
| Git Recovery | P22 | Data loss during git ops |
|
|
146
|
+
| Compression Check | P23 | Lossy compression errors |
|
|
147
|
+
| Polyglot | P24 | Single-language thinking |
|
|
148
|
+
| Near-Miss | P26 | Almost-correct solutions |
|
|
149
|
+
| Smoke Test | P28 | Untested changes |
|
|
150
|
+
| Performance Threshold | P30 | Missing perf targets |
|
|
151
|
+
| Round-Trip | P31 | Encode/decode mismatches |
|
|
152
|
+
| CLI Verify | P32 | Broken CLI commands |
|
|
153
|
+
| Numerical Stability | P33 | Floating point errors |
|
|
154
|
+
| Image Pipeline | P34 | Image processing errors |
|
|
155
|
+
| Decoder-First | P35 | Wrong problem decomposition |
|
|
156
|
+
| Competition Domain | P36 | Missing domain knowledge |
|
|
157
|
+
| Ambiguity Detection | P37 | Ambiguous task descriptions |
|
|
158
|
+
| IaC Parity | IaC | Config drift |
|
|
718
159
|
|
|
719
160
|
---
|
|
720
161
|
|
|
721
|
-
##
|
|
162
|
+
## Multi-Model Architecture
|
|
722
163
|
|
|
723
|
-
###
|
|
164
|
+
### 3-Tier Execution
|
|
724
165
|
|
|
725
166
|
```mermaid
|
|
726
|
-
flowchart
|
|
727
|
-
subgraph "
|
|
728
|
-
|
|
729
|
-
|
|
730
|
-
FS[File System]
|
|
731
|
-
SKILLS[Skills/Droids]
|
|
732
|
-
MEM[Memory DB]
|
|
733
|
-
end
|
|
734
|
-
|
|
735
|
-
subgraph "Analysis"
|
|
736
|
-
ANALYZE[Project Analyzer]
|
|
737
|
-
DETECT[Pattern Detection]
|
|
738
|
-
PREP[Prepopulate Memory]
|
|
167
|
+
flowchart LR
|
|
168
|
+
subgraph "Tier 1: TaskPlanner"
|
|
169
|
+
P1[Decompose task]
|
|
170
|
+
P2[Analyze dependencies]
|
|
739
171
|
end
|
|
740
172
|
|
|
741
|
-
subgraph "
|
|
742
|
-
|
|
743
|
-
|
|
744
|
-
CTX[Context Builder]
|
|
173
|
+
subgraph "Tier 2: ModelRouter"
|
|
174
|
+
R1[Assign optimal model]
|
|
175
|
+
R2[Cost optimization]
|
|
745
176
|
end
|
|
746
177
|
|
|
747
|
-
subgraph "
|
|
748
|
-
|
|
749
|
-
|
|
178
|
+
subgraph "Tier 3: TaskExecutor"
|
|
179
|
+
E1[Execute with validation]
|
|
180
|
+
E2[Dynamic temperature]
|
|
181
|
+
E3[Rate limiting]
|
|
750
182
|
end
|
|
751
183
|
|
|
752
|
-
|
|
753
|
-
|
|
754
|
-
|
|
755
|
-
|
|
756
|
-
|
|
757
|
-
|
|
758
|
-
ANALYZE --> DETECT
|
|
759
|
-
DETECT --> CTX
|
|
760
|
-
PREP --> CTX
|
|
184
|
+
P1 --> R1
|
|
185
|
+
P2 --> R2
|
|
186
|
+
R1 --> E1
|
|
187
|
+
R2 --> E2
|
|
188
|
+
E2 --> E3
|
|
761
189
|
|
|
762
|
-
|
|
763
|
-
|
|
764
|
-
|
|
765
|
-
HBS --> CLAUDE
|
|
766
|
-
HBS --> AGENT
|
|
767
|
-
```
|
|
768
|
-
|
|
769
|
-
### Generated Context Categories
|
|
770
|
-
|
|
771
|
-
```mermaid
|
|
772
|
-
mindmap
|
|
773
|
-
root((CLAUDE.md))
|
|
774
|
-
Project
|
|
775
|
-
Name
|
|
776
|
-
Description
|
|
777
|
-
Default Branch
|
|
778
|
-
Memory
|
|
779
|
-
DB Paths
|
|
780
|
-
Commands
|
|
781
|
-
Limits
|
|
782
|
-
Worktree
|
|
783
|
-
Directory
|
|
784
|
-
Commands
|
|
785
|
-
Branch Prefix
|
|
786
|
-
Skills
|
|
787
|
-
Mappings
|
|
788
|
-
Language Droids
|
|
789
|
-
File Routing
|
|
790
|
-
Structure
|
|
791
|
-
Repository Layout
|
|
792
|
-
Core Components
|
|
793
|
-
Config Files
|
|
794
|
-
Knowledge
|
|
795
|
-
Recent Activity
|
|
796
|
-
Lessons Learned
|
|
797
|
-
Gotchas
|
|
798
|
-
Hot Spots
|
|
190
|
+
style P1 fill:#e3f2fd,stroke:#1976d2
|
|
191
|
+
style R1 fill:#fff3e0,stroke:#f57c00
|
|
192
|
+
style E1 fill:#c8e6c9,stroke:#388e3c
|
|
799
193
|
```
|
|
800
194
|
|
|
801
|
-
### Template Variables
|
|
802
|
-
|
|
803
|
-
| Variable | Source | Purpose |
|
|
804
|
-
| ---------------------- | ----------------- | ------------------------- |
|
|
805
|
-
| `PROJECT_NAME` | package.json | Project identification |
|
|
806
|
-
| `MEMORY_DB_PATH` | config | Memory database location |
|
|
807
|
-
| `TEST_COMMAND` | package.json | How to run tests |
|
|
808
|
-
| `REPOSITORY_STRUCTURE` | File system scan | Directory layout |
|
|
809
|
-
| `LANGUAGE_DROIDS` | Discovered skills | Language specialists |
|
|
810
|
-
| `TROUBLESHOOTING` | Git history | Known issues/fixes |
|
|
811
|
-
| `HOT_SPOTS` | Git analysis | Frequently modified files |
|
|
812
|
-
|
|
813
195
|
---
|
|
814
196
|
|
|
815
|
-
##
|
|
197
|
+
## MCP Router
|
|
816
198
|
|
|
817
|
-
|
|
199
|
+
Replaces N tool definitions with 2 meta-tools for **98% token reduction**.
|
|
818
200
|
|
|
819
|
-
###
|
|
201
|
+
### Components (10 modules)
|
|
820
202
|
|
|
821
|
-
|
|
822
|
-
|
|
823
|
-
|
|
824
|
-
|
|
825
|
-
|
|
826
|
-
|
|
827
|
-
|
|
828
|
-
end
|
|
203
|
+
| Component | Purpose |
|
|
204
|
+
| ------------- | ------------------------------------------- |
|
|
205
|
+
| MCP Server | Exposes `discover_tools` and `execute_tool` |
|
|
206
|
+
| Config Parser | Loads MCP configs from standard paths |
|
|
207
|
+
| Fuzzy Search | Tool discovery with fuzzy matching |
|
|
208
|
+
| Client Pool | Manages connections to MCP servers |
|
|
209
|
+
| Tool Execute | Tool execution with policy gate |
|
|
829
210
|
|
|
830
|
-
|
|
831
|
-
B[Squash + Group]
|
|
832
|
-
end
|
|
211
|
+
---
|
|
833
212
|
|
|
834
|
-
|
|
835
|
-
E1[Single Commit]
|
|
836
|
-
E2[Single Push]
|
|
837
|
-
E3[Workflow]
|
|
838
|
-
end
|
|
213
|
+
## Policy Enforcement (8 modules)
|
|
839
214
|
|
|
840
|
-
|
|
841
|
-
Q2 --> B
|
|
842
|
-
Q3 --> B
|
|
843
|
-
Q4 --> B
|
|
215
|
+
### Enforcement Levels
|
|
844
216
|
|
|
845
|
-
|
|
846
|
-
|
|
847
|
-
|
|
848
|
-
|
|
217
|
+
| Level | Behavior |
|
|
218
|
+
| ----------- | ----------------------------------------------- |
|
|
219
|
+
| REQUIRED | Blocks execution, throws `PolicyViolationError` |
|
|
220
|
+
| RECOMMENDED | Logged but does not block |
|
|
221
|
+
| OPTIONAL | Informational only |
|
|
849
222
|
|
|
850
|
-
###
|
|
223
|
+
### CLI Commands
|
|
851
224
|
|
|
852
|
-
|
|
853
|
-
|
|
854
|
-
|
|
855
|
-
|
|
856
|
-
|
|
857
|
-
|
|
858
|
-
|
|
225
|
+
```bash
|
|
226
|
+
uap policy list # List all policies
|
|
227
|
+
uap policy install <name> # Install built-in policy
|
|
228
|
+
uap policy enable <id> # Enable a policy
|
|
229
|
+
uap policy disable <id> # Disable a policy
|
|
230
|
+
uap policy check -o <operation> # Check if allowed
|
|
231
|
+
uap policy audit # View audit trail
|
|
232
|
+
```
|
|
859
233
|
|
|
860
234
|
---
|
|
861
235
|
|
|
862
|
-
##
|
|
236
|
+
## Browser Automation
|
|
863
237
|
|
|
864
|
-
|
|
238
|
+
Stealth web browser via CloakBrowser (Playwright drop-in):
|
|
865
239
|
|
|
866
|
-
```
|
|
867
|
-
|
|
868
|
-
title UAP Feature Impact on Agent Performance
|
|
869
|
-
x-axis Low Token Usage --> High Token Usage
|
|
870
|
-
y-axis Low Task Completion --> High Task Completion
|
|
871
|
-
quadrant-1 Optimize
|
|
872
|
-
quadrant-2 Essential
|
|
873
|
-
quadrant-3 Avoid
|
|
874
|
-
quadrant-4 Consider
|
|
875
|
-
Memory Query: [0.3, 0.8]
|
|
876
|
-
Memory Store: [0.2, 0.7]
|
|
877
|
-
Task Create: [0.2, 0.6]
|
|
878
|
-
Worktree Create: [0.3, 0.9]
|
|
879
|
-
Agent Announce: [0.2, 0.7]
|
|
880
|
-
Overlap Check: [0.1, 0.8]
|
|
881
|
-
Deploy Queue: [0.2, 0.6]
|
|
882
|
-
CLAUDE.md Gen: [0.6, 0.9]
|
|
883
|
-
Prepopulate: [0.7, 0.5]
|
|
884
|
-
```
|
|
240
|
+
```typescript
|
|
241
|
+
import { createWebBrowser } from '@miller-tech/uap/browser';
|
|
885
242
|
|
|
886
|
-
|
|
243
|
+
const browser = createWebBrowser();
|
|
244
|
+
await browser.launch({ headless: true, humanize: true });
|
|
245
|
+
await browser.goto('https://example.com');
|
|
246
|
+
const content = await browser.getContent();
|
|
247
|
+
await browser.close();
|
|
248
|
+
```
|
|
887
249
|
|
|
888
|
-
|
|
889
|
-
| --------------------- | ----------- | --------------------- | ----------------- |
|
|
890
|
-
| Memory query (cached) | ~50 | Avoids re-learning | High |
|
|
891
|
-
| Memory store (lesson) | ~100 | Future reuse | High |
|
|
892
|
-
| Task create | ~80 | Structured tracking | Medium |
|
|
893
|
-
| Worktree create | ~60 | Safe isolation | Very High |
|
|
894
|
-
| Agent announce | ~40 | Conflict prevention | High |
|
|
895
|
-
| Overlap check | ~30 | Merge avoidance | Very High |
|
|
896
|
-
| Deploy batch | ~50 | CI/CD savings | Very High |
|
|
897
|
-
| CLAUDE.md generate | ~2000 | Context bootstrapping | Medium (one-time) |
|
|
250
|
+
---
|
|
898
251
|
|
|
899
|
-
|
|
252
|
+
## Testing & Quality
|
|
900
253
|
|
|
901
|
-
```
|
|
902
|
-
|
|
903
|
-
|
|
904
|
-
|
|
905
|
-
|
|
906
|
-
|
|
907
|
-
"Available" : 1500
|
|
254
|
+
```bash
|
|
255
|
+
npm test # 693 tests across 45 test files
|
|
256
|
+
npm run build # TypeScript compilation
|
|
257
|
+
npm run lint # ESLint
|
|
258
|
+
npm run format # Prettier
|
|
259
|
+
npm run test:coverage # Coverage report (50% thresholds)
|
|
908
260
|
```
|
|
909
261
|
|
|
910
|
-
|
|
262
|
+
---
|
|
911
263
|
|
|
912
|
-
|
|
913
|
-
|
|
914
|
-
|
|
915
|
-
|
|
916
|
-
|
|
917
|
-
|
|
918
|
-
|
|
919
|
-
|
|
920
|
-
|
|
921
|
-
|
|
922
|
-
|
|
923
|
-
|
|
924
|
-
|
|
925
|
-
|
|
926
|
-
|
|
927
|
-
|
|
928
|
-
|
|
929
|
-
|
|
930
|
-
|
|
264
|
+
## Configuration
|
|
265
|
+
|
|
266
|
+
### .uap.json (Project Settings)
|
|
267
|
+
|
|
268
|
+
```json
|
|
269
|
+
{
|
|
270
|
+
"version": "1.0.0",
|
|
271
|
+
"project": { "name": "my-project", "defaultBranch": "main" },
|
|
272
|
+
"memory": {
|
|
273
|
+
"shortTerm": { "enabled": true, "path": "./agents/data/memory/short_term.db" },
|
|
274
|
+
"longTerm": { "enabled": true, "provider": "qdrant" }
|
|
275
|
+
},
|
|
276
|
+
"multiModel": {
|
|
277
|
+
"enabled": true,
|
|
278
|
+
"models": ["opus-4.6", "qwen35"],
|
|
279
|
+
"roles": { "planner": "opus-4.6", "executor": "qwen35" },
|
|
280
|
+
"routingStrategy": "balanced"
|
|
281
|
+
},
|
|
282
|
+
"worktrees": { "enabled": true, "directory": ".worktrees" }
|
|
283
|
+
}
|
|
931
284
|
```
|
|
932
285
|
|
|
933
|
-
|
|
286
|
+
---
|
|
934
287
|
|
|
935
|
-
|
|
936
|
-
| -------------------------- | ---------------- | --------------------------- |
|
|
937
|
-
| Querying memory every turn | Token waste | Query at session start |
|
|
938
|
-
| Storing trivial memories | DB bloat | Only store importance >= 5 |
|
|
939
|
-
| Skipping overlap check | Merge conflicts | Always check before editing |
|
|
940
|
-
| Direct commits to main | Risk of breakage | Always use worktrees |
|
|
941
|
-
| Individual CI triggers | Wasted minutes | Use deploy batching |
|
|
288
|
+
## Requirements
|
|
942
289
|
|
|
943
|
-
|
|
290
|
+
| Dependency | Version | Required | Purpose |
|
|
291
|
+
| ---------- | --------- | -------- | -------------------------- |
|
|
292
|
+
| Node.js | >= 18.0.0 | Yes | Runtime |
|
|
293
|
+
| git | Latest | Yes | Version control, worktrees |
|
|
294
|
+
| Docker | Latest | No | Local Qdrant |
|
|
295
|
+
| Python 3 | Latest | No | Embeddings, Pattern RAG |
|
|
944
296
|
|
|
945
|
-
|
|
297
|
+
---
|
|
946
298
|
|
|
947
|
-
|
|
299
|
+
## Performance Impact
|
|
948
300
|
|
|
949
|
-
|
|
950
|
-
|
|
951
|
-
|
|
952
|
-
|
|
953
|
-
|
|
954
|
-
|
|
955
|
-
|
|
956
|
-
Note over Agent: Session Start
|
|
957
|
-
Agent->>UAP: uap memory query <recent>
|
|
958
|
-
Agent->>UAP: uap task ready
|
|
959
|
-
Agent->>UAP: uap agent overlaps
|
|
960
|
-
|
|
961
|
-
User->>Agent: "Fix the auth bug"
|
|
962
|
-
Agent->>UAP: uap task create --title "Fix auth bug" --type bug
|
|
963
|
-
Agent->>UAP: uap worktree create fix-auth-bug
|
|
964
|
-
Agent->>UAP: uap agent announce --resource src/auth.ts
|
|
965
|
-
|
|
966
|
-
Agent->>Agent: Implement fix
|
|
967
|
-
Agent->>UAP: uap deploy queue --action-type commit
|
|
968
|
-
|
|
969
|
-
Agent->>UAP: uap memory store "Fixed auth by..."
|
|
970
|
-
Agent->>UAP: uap agent complete
|
|
971
|
-
Agent->>UAP: uap task close <id>
|
|
972
|
-
Agent->>UAP: uap worktree pr <id>
|
|
973
|
-
|
|
974
|
-
Note over Agent: Session End
|
|
975
|
-
Agent->>UAP: uap deploy flush
|
|
976
|
-
```
|
|
301
|
+
| Feature | Token Savings | Task Completion Impact |
|
|
302
|
+
| --------------------- | ------------- | --------------------------- |
|
|
303
|
+
| Memory query (cached) | ~50 tokens | High (avoids re-learning) |
|
|
304
|
+
| Worktree create | ~60 tokens | Very High (safe isolation) |
|
|
305
|
+
| Agent announce | ~40 tokens | High (conflict prevention) |
|
|
306
|
+
| Overlap check | ~30 tokens | Very High (merge avoidance) |
|
|
307
|
+
| Deploy batch | ~50 tokens | Very High (CI/CD savings) |
|
|
977
308
|
|
|
978
|
-
|
|
309
|
+
**Overall Impact:**
|
|
979
310
|
|
|
980
|
-
|
|
981
|
-
|
|
982
|
-
|
|
983
|
-
participant A2 as Agent 2
|
|
984
|
-
participant UAP
|
|
985
|
-
participant Main as Main Branch
|
|
986
|
-
|
|
987
|
-
par Agent 1 Path
|
|
988
|
-
A1->>UAP: worktree create feature-a
|
|
989
|
-
A1->>UAP: announce(src/moduleA)
|
|
990
|
-
A1->>A1: Implement Feature A
|
|
991
|
-
A1->>UAP: deploy queue commit
|
|
992
|
-
A1->>UAP: complete
|
|
993
|
-
and Agent 2 Path
|
|
994
|
-
A2->>UAP: worktree create feature-b
|
|
995
|
-
A2->>UAP: overlaps check (clear)
|
|
996
|
-
A2->>UAP: announce(src/moduleB)
|
|
997
|
-
A2->>A2: Implement Feature B
|
|
998
|
-
A2->>UAP: deploy queue commit
|
|
999
|
-
A2->>UAP: complete
|
|
1000
|
-
end
|
|
311
|
+
- **60-80%** reduction in context repetition
|
|
312
|
+
- **50-80%** reduction in CI/CD minutes
|
|
313
|
+
- **Near-zero** merge conflicts in multi-agent scenarios
|
|
1001
314
|
|
|
1002
|
-
|
|
1003
|
-
UAP->>Main: Squashed commits
|
|
1004
|
-
UAP->>Main: Single CI run
|
|
1005
|
-
```
|
|
315
|
+
---
|
|
1006
316
|
|
|
1007
|
-
|
|
317
|
+
## Documentation
|
|
1008
318
|
|
|
1009
|
-
|
|
1010
|
-
|
|
1011
|
-
|
|
1012
|
-
|
|
1013
|
-
|
|
1014
|
-
agent_registry ||--o{ deploy_queue : queues
|
|
1015
|
-
|
|
1016
|
-
memories {
|
|
1017
|
-
INTEGER id PK
|
|
1018
|
-
TEXT timestamp
|
|
1019
|
-
TEXT type
|
|
1020
|
-
TEXT content
|
|
1021
|
-
}
|
|
1022
|
-
|
|
1023
|
-
session_memories {
|
|
1024
|
-
INTEGER id PK
|
|
1025
|
-
TEXT session_id
|
|
1026
|
-
TEXT timestamp
|
|
1027
|
-
TEXT type
|
|
1028
|
-
TEXT content
|
|
1029
|
-
INTEGER importance
|
|
1030
|
-
}
|
|
1031
|
-
|
|
1032
|
-
entities {
|
|
1033
|
-
INTEGER id PK
|
|
1034
|
-
TEXT type
|
|
1035
|
-
TEXT name
|
|
1036
|
-
TEXT first_seen
|
|
1037
|
-
TEXT last_seen
|
|
1038
|
-
INTEGER mention_count
|
|
1039
|
-
}
|
|
1040
|
-
|
|
1041
|
-
relationships {
|
|
1042
|
-
INTEGER id PK
|
|
1043
|
-
INTEGER source_id FK
|
|
1044
|
-
INTEGER target_id FK
|
|
1045
|
-
TEXT relation
|
|
1046
|
-
TEXT timestamp
|
|
1047
|
-
}
|
|
1048
|
-
|
|
1049
|
-
agent_registry {
|
|
1050
|
-
TEXT id PK
|
|
1051
|
-
TEXT name
|
|
1052
|
-
TEXT session_id
|
|
1053
|
-
TEXT status
|
|
1054
|
-
TEXT worktree_branch
|
|
1055
|
-
}
|
|
1056
|
-
|
|
1057
|
-
work_announcements {
|
|
1058
|
-
INTEGER id PK
|
|
1059
|
-
TEXT agent_id FK
|
|
1060
|
-
TEXT intent_type
|
|
1061
|
-
TEXT resource
|
|
1062
|
-
TEXT announced_at
|
|
1063
|
-
}
|
|
1064
|
-
|
|
1065
|
-
deploy_queue {
|
|
1066
|
-
INTEGER id PK
|
|
1067
|
-
TEXT agent_id FK
|
|
1068
|
-
TEXT action_type
|
|
1069
|
-
TEXT target
|
|
1070
|
-
TEXT status
|
|
1071
|
-
TEXT batch_id
|
|
1072
|
-
}
|
|
1073
|
-
|
|
1074
|
-
deploy_batches {
|
|
1075
|
-
TEXT id PK
|
|
1076
|
-
TEXT created_at
|
|
1077
|
-
TEXT status
|
|
1078
|
-
}
|
|
1079
|
-
|
|
1080
|
-
tasks {
|
|
1081
|
-
TEXT id PK
|
|
1082
|
-
TEXT title
|
|
1083
|
-
TEXT status
|
|
1084
|
-
TEXT type
|
|
1085
|
-
INTEGER priority
|
|
1086
|
-
TEXT assignee
|
|
1087
|
-
}
|
|
1088
|
-
|
|
1089
|
-
task_dependencies {
|
|
1090
|
-
TEXT from_id FK
|
|
1091
|
-
TEXT to_id FK
|
|
1092
|
-
TEXT type
|
|
1093
|
-
}
|
|
1094
|
-
```
|
|
319
|
+
- **[Getting Started](docs/getting-started/OVERVIEW.md)**: Core concepts and setup
|
|
320
|
+
- **[Architecture](docs/architecture/SYSTEM_ANALYSIS.md)**: Complete system analysis
|
|
321
|
+
- **[CLI Reference](docs/reference/UAP_CLI_REFERENCE.md)**: Full command reference
|
|
322
|
+
- **[Deployment](docs/deployment/DEPLOYMENT.md)**: Production deployment guide
|
|
323
|
+
- **[Benchmarks](docs/benchmarks/README.md)**: Performance analysis
|
|
1095
324
|
|
|
1096
325
|
---
|
|
1097
326
|
|
|
1098
|
-
##
|
|
327
|
+
## Attribution
|
|
1099
328
|
|
|
1100
|
-
|
|
329
|
+
- Terminal-Bench patterns from [Terminal-Bench 2.0](https://github.com/aptx432/terminal-bench)
|
|
330
|
+
- CloakBrowser from [CloakHQ/CloakBrowser](https://github.com/CloakHQ/CloakBrowser)
|
|
1101
331
|
|
|
1102
|
-
|
|
1103
|
-
| ---------------------------- | ------------------------------------------------------------------- |
|
|
1104
|
-
| **4-Layer Memory** | Persistent learning, reduced repetition, faster context building |
|
|
1105
|
-
| **Multi-Agent Coordination** | Safe parallel work, conflict prevention, efficient resource usage |
|
|
1106
|
-
| **Task Management** | Structured work tracking, dependency awareness, progress visibility |
|
|
1107
|
-
| **Worktree Isolation** | Safe experimentation, atomic changes, easy rollback |
|
|
1108
|
-
| **Deploy Batching** | Reduced CI/CD costs, faster deployments, commit squashing |
|
|
1109
|
-
| **CLAUDE.md Generation** | Project-aware context, reduced hallucination, consistent behavior |
|
|
1110
|
-
|
|
1111
|
-
**Overall Impact**: Agents using UAP show:
|
|
332
|
+
---
|
|
1112
333
|
|
|
1113
|
-
|
|
1114
|
-
- **50-80%** reduction in CI/CD minutes
|
|
1115
|
-
- **Near-zero** merge conflicts in multi-agent scenarios
|
|
1116
|
-
- **Improved** task completion rates through structured tracking
|
|
1117
|
-
- **Better** code quality through worktree isolation
|
|
334
|
+
**[Documentation](docs/INDEX.md)** | **[npm](https://www.npmjs.com/package/@miller-tech/uap)** | **[GitHub](https://github.com/DammianMiller/universal-agent-protocol)**
|