open-multi-agent-kit 0.78.6 → 0.78.7
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/AGENTS.md +1 -1
- package/CHANGELOG.md +26 -0
- package/MATURITY.md +2 -2
- package/README.md +19 -4
- package/dist/brand/night-city.theme.json +80 -0
- package/dist/brand/palette.d.ts +73 -177
- package/dist/brand/palette.js +115 -39
- package/dist/brand/rust-forge.theme.json +216 -0
- package/dist/brand/theme-compiled.d.ts +61 -0
- package/dist/brand/theme-compiled.js +241 -0
- package/dist/brand/theme.js +50 -37
- package/dist/cli/release-promotion-gate.d.ts +8 -1
- package/dist/cli/release-promotion-gate.js +20 -9
- package/dist/cli/root.d.ts +1 -0
- package/dist/cli/root.js +2 -1
- package/dist/cli/theme/index.d.ts +11 -2
- package/dist/cli/theme/index.js +6 -1
- package/dist/cli/theme/oklab-quantize.d.ts +29 -0
- package/dist/cli/theme/oklab-quantize.js +105 -0
- package/dist/cli/theme/render-table.d.ts +59 -0
- package/dist/cli/theme/render-table.js +112 -0
- package/dist/cli/theme/status-frame.d.ts +10 -0
- package/dist/cli/theme/status-frame.js +22 -0
- package/dist/cli/theme/terminal-capability.d.ts +6 -1
- package/dist/cli/theme/terminal-capability.js +20 -4
- package/dist/cli/theme/theme-doc.d.ts +22 -0
- package/dist/cli/theme/theme-doc.js +97 -0
- package/dist/cli/theme/theme-registry.js +39 -18
- package/dist/cli/theme/tier-explain.d.ts +21 -0
- package/dist/cli/theme/tier-explain.js +60 -0
- package/dist/cli/ui/green-rain-renderer.js +3 -2
- package/dist/cli/ui/neon-grid-renderer.js +4 -3
- package/dist/cli/ui/rust-forge-renderer.js +17 -3
- package/dist/cli/ui/system24-renderer.d.ts +18 -1
- package/dist/cli/ui/system24-renderer.js +39 -16
- package/dist/cli/v2/chat-repl.js +3 -1
- package/dist/cli/v2/cli-v2-skeleton.d.ts +6 -0
- package/dist/cli/v2/cli-v2-skeleton.js +121 -9
- package/dist/cli/v2/interactive-prompt.d.ts +1 -0
- package/dist/cli/v2/interactive-prompt.js +6 -2
- package/dist/commands/chat/core.js +2 -2
- package/dist/commands/chat/runtime.js +2 -0
- package/dist/commands/chat/utils.js +12 -4
- package/dist/commands/cockpit/render.js +102 -64
- package/dist/commands/cockpit/utils.d.ts +2 -0
- package/dist/commands/design.js +18 -16
- package/dist/commands/doctor/checks.d.ts +0 -1
- package/dist/commands/doctor/checks.js +1 -36
- package/dist/commands/doctor/report.js +0 -11
- package/dist/commands/init/content.d.ts +1 -1
- package/dist/commands/init/content.js +3 -11
- package/dist/commands/init.js +2 -2
- package/dist/commands/mcp/config.d.ts +32 -0
- package/dist/commands/mcp/config.js +264 -0
- package/dist/commands/mcp/doctor-fix.d.ts +12 -0
- package/dist/commands/mcp/doctor-fix.js +261 -0
- package/dist/commands/mcp/doctor.d.ts +55 -0
- package/dist/commands/mcp/doctor.js +401 -0
- package/dist/commands/mcp/list.d.ts +1 -0
- package/dist/commands/mcp/list.js +56 -0
- package/dist/commands/mcp/shared.d.ts +47 -0
- package/dist/commands/mcp/shared.js +192 -0
- package/dist/commands/mcp/test.d.ts +5 -0
- package/dist/commands/mcp/test.js +457 -0
- package/dist/commands/mcp.d.ts +8 -104
- package/dist/commands/mcp.js +5 -1603
- package/dist/contracts/proof.d.ts +1 -1
- package/dist/goal/control-loop.d.ts +15 -0
- package/dist/goal/control-loop.js +39 -5
- package/dist/hud/render.d.ts +2 -0
- package/dist/hud/render.js +7 -1
- package/dist/mcp/secret-scanner.d.ts +6 -0
- package/dist/mcp/secret-scanner.js +44 -11
- package/dist/memory/graph-delta-log.d.ts +137 -0
- package/dist/memory/graph-delta-log.js +650 -0
- package/dist/memory/graph-viewer.js +13 -32
- package/dist/memory/local-graph-memory-store.d.ts +36 -3
- package/dist/memory/local-graph-memory-store.js +255 -10
- package/dist/orchestration/log-streamer.js +13 -8
- package/dist/orchestration/routing.d.ts +4 -0
- package/dist/orchestration/routing.js +28 -3
- package/dist/orchestration/state-persister.js +8 -1
- package/dist/providers/anthropic-messages-runner.d.ts +17 -0
- package/dist/providers/anthropic-messages-runner.js +197 -0
- package/dist/providers/model-registry.d.ts +1 -1
- package/dist/providers/model-registry.js +37 -3
- package/dist/providers/provider-runtime.js +27 -11
- package/dist/providers/thinking-levels.js +4 -1
- package/dist/providers/types.d.ts +3 -3
- package/dist/runtime/contracts/weakness-remediation.d.ts +9 -1
- package/dist/runtime/contracts/weakness-remediation.js +9 -1
- package/dist/runtime/router-v2-scoring.d.ts +8 -3
- package/dist/runtime/router-v2-scoring.js +27 -22
- package/dist/runtime/runtime-router.d.ts +5 -0
- package/dist/runtime/runtime-router.js +40 -8
- package/dist/runtime/sandbox-profile.d.ts +29 -0
- package/dist/runtime/sandbox-profile.js +101 -0
- package/dist/runtime/slash-commands.js +300 -2
- package/dist/runtime/tool-dispatch-contracts.d.ts +15 -0
- package/dist/runtime/tool-dispatch-contracts.js +12 -0
- package/dist/runtime/weights-config.d.ts +90 -0
- package/dist/runtime/weights-config.js +249 -0
- package/dist/schema/envelope.schema.d.ts +18 -18
- package/dist/schema/evidence.schema.d.ts +2 -2
- package/dist/schema/proof-bundle.schema.d.ts +6 -6
- package/dist/schema/proof-bundle.schema.js +0 -1
- package/dist/schema/provider.schema.d.ts +2 -2
- package/dist/schema/run-manifest.schema.d.ts +16 -16
- package/dist/theme/ansi.js +9 -2
- package/dist/theme/extended-palette.d.ts +85 -0
- package/dist/theme/extended-palette.js +108 -0
- package/dist/theme/layout.js +29 -8
- package/dist/theme/metrics.js +5 -5
- package/dist/theme/parallel.js +25 -15
- package/dist/ui/omk-sigil.js +5 -14
- package/dist/ui/omk-working-sweep.js +5 -15
- package/dist/util/chat-agent-mode.d.ts +11 -0
- package/dist/util/chat-agent-mode.js +41 -8
- package/dist/util/chat-cockpit.d.ts +9 -0
- package/dist/util/chat-cockpit.js +77 -20
- package/dist/util/fs/core.d.ts +5 -0
- package/dist/util/fs/core.js +35 -0
- package/dist/util/fs/internal.d.ts +14 -0
- package/dist/util/fs/internal.js +169 -0
- package/dist/util/fs/kimi-sync.d.ts +41 -0
- package/dist/util/fs/kimi-sync.js +495 -0
- package/dist/util/fs/logo.d.ts +2 -0
- package/dist/util/fs/logo.js +78 -0
- package/dist/util/fs/manifest.d.ts +6 -0
- package/dist/util/fs/manifest.js +40 -0
- package/dist/util/fs/mcp-diagnose.d.ts +15 -0
- package/dist/util/fs/mcp-diagnose.js +204 -0
- package/dist/util/fs/mcp-runtime-config.d.ts +23 -0
- package/dist/util/fs/mcp-runtime-config.js +412 -0
- package/dist/util/fs/paths.d.ts +13 -0
- package/dist/util/fs/paths.js +82 -0
- package/dist/util/fs/preflight.d.ts +27 -0
- package/dist/util/fs/preflight.js +271 -0
- package/dist/util/fs.d.ts +8 -128
- package/dist/util/fs.js +8 -1757
- package/dist/util/terminal-layout.js +5 -1
- package/dist/util/version.js +2 -1
- package/docs/2026-06-11/critical-issues.md +20 -0
- package/docs/2026-06-11/improvements.md +14 -0
- package/docs/2026-06-11/init-checklist.md +25 -0
- package/docs/2026-06-11/plan.md +20 -0
- package/docs/ARCHITECTURE_ANALYSIS_CODEGRAPH.md +223 -0
- package/docs/adr/0001-no-native-rust-lane.md +52 -0
- package/docs/codex-oauth-setup.md +14 -0
- package/docs/decisions/2026-06-10-git-history-bloat.md +61 -0
- package/docs/decisions/ADR-theme-dark-only-assets.md +43 -0
- package/docs/getting-started.md +1 -1
- package/docs/headroom-omk-final-summary.md +188 -0
- package/docs/headroom-omk-integration.md +394 -0
- package/docs/headroom-omk-setup-guide.md +422 -0
- package/docs/headroom-omk-usage-examples.md +371 -0
- package/docs/provider-maturity.md +1 -1
- package/docs/versioning.md +3 -3
- package/package.json +10 -10
- package/readmeasset/.npmignore +2 -0
- package/readmeasset/ASSET_INDEX.md +7 -5
- package/readmeasset/ASSET_PROVENANCE.md +21 -5
- package/readmeasset/omk-control-surfaces.svg +55 -0
- package/readmeasset/omk-core-loop.svg +1 -0
- package/readmeasset/omk-logo-mark.svg +1 -0
- package/readmeasset/omk-release-assertions.svg +51 -0
- package/dist/native/linux-x64/omk-safety +0 -0
- package/dist/util/native-safety.d.ts +0 -28
- package/dist/util/native-safety.js +0 -118
|
@@ -0,0 +1,188 @@
|
|
|
1
|
+
# Headroom OMK 통합 최종 요약
|
|
2
|
+
|
|
3
|
+
## 1. 프로젝트 개요
|
|
4
|
+
|
|
5
|
+
Headroom을 OMK (Open Multi-agent Kit)에 통합하기 위한 OMK-native 목표 레이아웃과 검증 결과를 정리했습니다. 아래 경로는 로컬 증거로 존재가 확인되기 전까지 설치 대상/설계안으로 취급합니다.
|
|
6
|
+
|
|
7
|
+
## 2. OMK 런타임 통합 대상
|
|
8
|
+
|
|
9
|
+
### 2.1 Headroom Skill
|
|
10
|
+
- **설치 대상 위치**: `$OMK_RUNTIME_HOME/.agents/skills/headroom/SKILL.md`
|
|
11
|
+
- **목적**: headroom 컨텍스트 압축 기능 제공
|
|
12
|
+
- **기능**:
|
|
13
|
+
- headroom 설치 및 설정 안내
|
|
14
|
+
- 압축 사용법 설명
|
|
15
|
+
- 토큰 절약 효과介绍
|
|
16
|
+
|
|
17
|
+
### 2.2 병렬 에이전트 Extension
|
|
18
|
+
- **설치 대상 위치**: `$OMK_RUNTIME_HOME/extensions/parallel-agents/index.ts`
|
|
19
|
+
- **목적**:多个 서브에이전트를 병렬로 스폰 및 관리
|
|
20
|
+
- **도구**:
|
|
21
|
+
- `spawn_parallel_agents`:多个 에이전트 스폰
|
|
22
|
+
- `check_parallel_agents`: 에이전트 상태 확인
|
|
23
|
+
- `coordinate_agent_results`: 결과 조정
|
|
24
|
+
|
|
25
|
+
### 2.3 오케스트레이터 Extension
|
|
26
|
+
- **설치 대상 위치**: `$OMK_RUNTIME_HOME/extensions/orchestrator/index.ts`
|
|
27
|
+
- **목적**: 서브에이전트를 목표 지향적으로 오케스트레이션
|
|
28
|
+
- **도구**:
|
|
29
|
+
- `orchestrate_goal`: 주요 오케스트레이션 도구
|
|
30
|
+
- `orchestrator_status`: 오케스트레이터 상태 확인
|
|
31
|
+
- `equip_agent`: 에이전트 장비 설정
|
|
32
|
+
|
|
33
|
+
### 2.4 Headroom 통합 Extension
|
|
34
|
+
- **설치 대상 위치**: `$OMK_RUNTIME_HOME/extensions/headroom-integration/index.ts`
|
|
35
|
+
- **목적**: headroom 압축을 OMK에 통합
|
|
36
|
+
- **도구**:
|
|
37
|
+
- `headroom_install`: headroom 설치
|
|
38
|
+
- `headroom_compress`: 컨텍스트 압축
|
|
39
|
+
- `headroom_stats`: 압축 통계
|
|
40
|
+
- `headroom_proxy`: 프록시 서버 시작
|
|
41
|
+
|
|
42
|
+
## 3. 테스트 결과
|
|
43
|
+
|
|
44
|
+
### 3.1 Headroom 압축效果
|
|
45
|
+
```
|
|
46
|
+
Structured data test:
|
|
47
|
+
- Tokens before: 3125
|
|
48
|
+
- Tokens after: 533
|
|
49
|
+
- Tokens saved: 2592
|
|
50
|
+
- Compression ratio: 82.94%
|
|
51
|
+
|
|
52
|
+
Tool output test:
|
|
53
|
+
- Tokens before: 4277
|
|
54
|
+
- Tokens after: 2867
|
|
55
|
+
- Tokens saved: 1410
|
|
56
|
+
- Compression ratio: 32.97%
|
|
57
|
+
```
|
|
58
|
+
|
|
59
|
+
### 3.2 주요 발견
|
|
60
|
+
1. **높은 압축률**: 구조화된 데이터에서 80% 이상 압축
|
|
61
|
+
2. **실용적인 적용**: 도구 출력에서 30% 이상 압축
|
|
62
|
+
3. **안정적인 작동**: 다양한 콘텐츠 유형에서稳定적으로 작동
|
|
63
|
+
4. **유연한 설정**: 다양한 압축 설정选项 제공
|
|
64
|
+
|
|
65
|
+
## 4. 사용 방법
|
|
66
|
+
|
|
67
|
+
### 4.1 기본 사용
|
|
68
|
+
```typescript
|
|
69
|
+
// 1. headroom으로 컨텍스트 압축
|
|
70
|
+
headroom_compress({
|
|
71
|
+
messages: [
|
|
72
|
+
{ role: "user", content: "대용량 데이터..." }
|
|
73
|
+
],
|
|
74
|
+
model: "claude-3-5-sonnet-20241022"
|
|
75
|
+
})
|
|
76
|
+
|
|
77
|
+
// 2. 병렬 에이전트 스폰
|
|
78
|
+
spawn_parallel_agents({
|
|
79
|
+
goal: "코드베이스 분석",
|
|
80
|
+
agents: [
|
|
81
|
+
{ id: "agent-1", task: "보안 분석", skills: ["security-scanner"] },
|
|
82
|
+
{ id: "agent-2", task: "성능 분석", skills: ["performance-analyzer"] }
|
|
83
|
+
]
|
|
84
|
+
})
|
|
85
|
+
|
|
86
|
+
// 3. 오케스트레이션
|
|
87
|
+
orchestrate_goal({
|
|
88
|
+
goal: "REST API 구축",
|
|
89
|
+
subAgents: [
|
|
90
|
+
{ id: "api-designer", task: "API 설계", skills: ["api-design"] },
|
|
91
|
+
{ id: "auth-specialist", task: "인증 구현", skills: ["jwt", "oauth2"] }
|
|
92
|
+
],
|
|
93
|
+
strategy: "parallel"
|
|
94
|
+
})
|
|
95
|
+
```
|
|
96
|
+
|
|
97
|
+
### 4.2 통합 워크플로우
|
|
98
|
+
```
|
|
99
|
+
1. 대용량 컨텍스트 수신
|
|
100
|
+
→ headroom_compress로 압축 (60-95% 절약)
|
|
101
|
+
|
|
102
|
+
2. 병렬 작업 필요
|
|
103
|
+
→ spawn_parallel_agents로 서브에이전트 생성
|
|
104
|
+
|
|
105
|
+
3. 복잡한 목표
|
|
106
|
+
→ orchestrate_goal로 오케스트레이션
|
|
107
|
+
|
|
108
|
+
4. 결과 통합
|
|
109
|
+
→ coordinate_agent_results로 결과 병합
|
|
110
|
+
```
|
|
111
|
+
|
|
112
|
+
## 5. 성과
|
|
113
|
+
|
|
114
|
+
### 5.1 토큰 절약
|
|
115
|
+
- **구조화된 데이터**: 80% 이상 절약
|
|
116
|
+
- **도구 출력**: 30% 이상 절약
|
|
117
|
+
- **로그 파일**: 60-90% 절약 (실제 시나리오)
|
|
118
|
+
- **코드 분석 결과**: 70% 이상 절약 (실제 시나리오)
|
|
119
|
+
|
|
120
|
+
### 5.2 병렬 처리
|
|
121
|
+
- **多个 에이전트 동시 실행**: 최대 10개 이상 가능
|
|
122
|
+
- **독립적 작업 분할**: 각 에이전트가特定한 작업 수행
|
|
123
|
+
- **결果协调**:自动으로 결과 통합 및 보고
|
|
124
|
+
|
|
125
|
+
### 5.3 목표 지향적 오케스트레이션
|
|
126
|
+
- **복잡한 목표 분해**:多个 하위 목표로 분해
|
|
127
|
+
- **의존성 관리**: 에이전트 간 의존성 자동 관리
|
|
128
|
+
- **전략 선택**: 병렬, 순차적, 파이프라인, 적응형 전략
|
|
129
|
+
|
|
130
|
+
## 6. 기술적 세부사항
|
|
131
|
+
|
|
132
|
+
### 6.1 Headroom 통합
|
|
133
|
+
- **Python 패키지**: headroom-ai 0.22.4 설치됨
|
|
134
|
+
- **압축 알고리즘**: ContentRouter, SmartCrusher, CodeAwareCompressor
|
|
135
|
+
- **설정选项**: CompressConfig로 세밀한控制 가능
|
|
136
|
+
|
|
137
|
+
### 6.2 OMK Extensions
|
|
138
|
+
- **TypeScript 모듈**: omk.registerTool()으로 도구 등록
|
|
139
|
+
- **이벤트处理**: omk.on()으로生命周期 이벤트处理
|
|
140
|
+
- **명령어 등록**: omk.registerCommand()으로 명령어 등록
|
|
141
|
+
|
|
142
|
+
### 6.3 병렬 처리
|
|
143
|
+
- **Promise.all()**:多个 에이전트 동시 실행
|
|
144
|
+
- **상태 관리**: Map으로 에이전트 상태 추적
|
|
145
|
+
- **결과收集**: Promise.all()로 결과收集 및 통합
|
|
146
|
+
|
|
147
|
+
## 7. 문서
|
|
148
|
+
|
|
149
|
+
### 7.1 생성된 문서
|
|
150
|
+
1. `docs/headroom-omk-integration.md`: 통합指南
|
|
151
|
+
2. `docs/headroom-omk-usage-examples.md`: 사용 예시
|
|
152
|
+
3. `docs/headroom-omk-setup-guide.md`: 설정指南
|
|
153
|
+
4. `docs/headroom-omk-final-summary.md`: 최종 요약 (본 문서)
|
|
154
|
+
|
|
155
|
+
### 7.2 주요 내용
|
|
156
|
+
- **설치 방법**: headroom 및 OMK extensions 설치
|
|
157
|
+
- **사용 방법**:各种 도구 및 명령어 사용法
|
|
158
|
+
- **통합 워크플로우**:实际应用场景에서의使用法
|
|
159
|
+
- **문제 해결**:常见问题及解决方法
|
|
160
|
+
|
|
161
|
+
## 8. 다음 단계
|
|
162
|
+
|
|
163
|
+
### 8.1 실제 적용
|
|
164
|
+
1. **OMK에서 extensions 로딩 확인**
|
|
165
|
+
2. **LLM이 도구를 호출할 수 있는지 확인**
|
|
166
|
+
3. **실제 작업에 적용하여效果 확인**
|
|
167
|
+
|
|
168
|
+
### 8.2 최적화
|
|
169
|
+
1. **압축 설정 최적화**:不同的 콘텐츠 유형에适当的 설정
|
|
170
|
+
2. **병렬处理 최적화**:适当的 에이전트 수 및 전략 선택
|
|
171
|
+
3. **오케스트레이션 최적화**:目标分解及依赖성管理优化
|
|
172
|
+
|
|
173
|
+
### 8.3扩展
|
|
174
|
+
1. **새로운 Skills 추가**:特定领域에适当的 Skills
|
|
175
|
+
2. **새로운 Extensions 추가**:新的功能扩展
|
|
176
|
+
3. **MCP 서버 통합**:外部工具访问扩展
|
|
177
|
+
|
|
178
|
+
## 9. 결론
|
|
179
|
+
|
|
180
|
+
이 프로젝트는 Headroom과 OMK의 성공적인 통합을实现했습니다:
|
|
181
|
+
|
|
182
|
+
1. **토큰 절약**: 60-95% 토큰 절약 through headroom 압축
|
|
183
|
+
2. **병렬 처리**:多个 서브에이전트가 동시에 작업
|
|
184
|
+
3. **목표 오케스트레이션**: 복잡한 목표를 향한协调된 작업
|
|
185
|
+
4. **유연한 장비**: 각 에이전트에特定한 skills, hooks, MCP 서버
|
|
186
|
+
5. **모니터링 및 통계**: 압축效果 및 에이전트状态 모니터링
|
|
187
|
+
|
|
188
|
+
이러한 도구들을 사용하여 OMK 워크플로우를 효율적인 컨텍스트 압축과 병렬 에이전트 오케스트레이션으로 향상시킬 수 있습니다.
|
|
@@ -0,0 +1,394 @@
|
|
|
1
|
+
# Headroom OMK Integration Guide
|
|
2
|
+
|
|
3
|
+
## Overview
|
|
4
|
+
|
|
5
|
+
This guide explains the OMK-native target layout for integrating [Headroom](https://github.com/chopratejas/headroom) with OMK (Open Multi-agent Kit) for token savings and parallel sub-agent orchestration. Treat paths below as runtime installation targets unless local evidence confirms they already exist.
|
|
6
|
+
|
|
7
|
+
## OMK Runtime Integration Targets
|
|
8
|
+
|
|
9
|
+
### 1. Headroom Skill
|
|
10
|
+
- **Target location when installed**: `$OMK_RUNTIME_HOME/.agents/skills/headroom/SKILL.md`
|
|
11
|
+
- **Purpose**: Provides headroom context compression capabilities
|
|
12
|
+
- **Usage**: `/skill:headroom` or automatic loading
|
|
13
|
+
|
|
14
|
+
### 2. Parallel Agents Extension
|
|
15
|
+
- **Target location when installed**: `$OMK_RUNTIME_HOME/extensions/parallel-agents/index.ts`
|
|
16
|
+
- **Purpose**: Spawn and manage multiple sub-agents in parallel
|
|
17
|
+
- **Tools**:
|
|
18
|
+
- `spawn_parallel_agents` - Spawn multiple agents
|
|
19
|
+
- `check_parallel_agents` - Check agent status
|
|
20
|
+
- `coordinate_agent_results` - Coordinate results
|
|
21
|
+
|
|
22
|
+
### 3. Orchestrator Extension
|
|
23
|
+
- **Target location when installed**: `$OMK_RUNTIME_HOME/extensions/orchestrator/index.ts`
|
|
24
|
+
- **Purpose**: Orchestrate sub-agents toward a common goal
|
|
25
|
+
- **Tools**:
|
|
26
|
+
- `orchestrate_goal` - Main orchestration tool
|
|
27
|
+
- `orchestrator_status` - Check orchestrator status
|
|
28
|
+
- `equip_agent` - Equip agents with skills/hooks/MCP
|
|
29
|
+
|
|
30
|
+
### 4. Headroom Integration Extension
|
|
31
|
+
- **Target location when installed**: `$OMK_RUNTIME_HOME/extensions/headroom-integration/index.ts`
|
|
32
|
+
- **Purpose**: Integrate headroom compression into OMK
|
|
33
|
+
- **Tools**:
|
|
34
|
+
- `headroom_install` - Install headroom
|
|
35
|
+
- `headroom_compress` - Compress context
|
|
36
|
+
- `headroom_stats` - Get compression statistics
|
|
37
|
+
- `headroom_proxy` - Start proxy server
|
|
38
|
+
|
|
39
|
+
## Installation
|
|
40
|
+
|
|
41
|
+
### 1. Install Headroom
|
|
42
|
+
```bash
|
|
43
|
+
pip install "headroom-ai[all]"
|
|
44
|
+
```
|
|
45
|
+
|
|
46
|
+
### 2. Verify Installation
|
|
47
|
+
```bash
|
|
48
|
+
python3 -c "import headroom; print(headroom.__version__)"
|
|
49
|
+
```
|
|
50
|
+
|
|
51
|
+
## Usage Examples
|
|
52
|
+
|
|
53
|
+
### Example 1: Basic Context Compression
|
|
54
|
+
|
|
55
|
+
```
|
|
56
|
+
User: Compress this large code output using headroom
|
|
57
|
+
|
|
58
|
+
Agent: I'll use the headroom_compress tool to compress your context.
|
|
59
|
+
|
|
60
|
+
[Agent uses headroom_compress tool with the large content]
|
|
61
|
+
|
|
62
|
+
Result: 60-95% token savings while preserving answer quality.
|
|
63
|
+
```
|
|
64
|
+
|
|
65
|
+
### Example 2: Parallel Sub-Agent Work
|
|
66
|
+
|
|
67
|
+
```
|
|
68
|
+
User: I need to analyze 3 different codebases in parallel
|
|
69
|
+
|
|
70
|
+
Agent: I'll spawn 3 parallel sub-agents for this task.
|
|
71
|
+
|
|
72
|
+
[Agent uses spawn_parallel_agents tool]
|
|
73
|
+
|
|
74
|
+
Result: 3 agents spawned, each working on different codebase.
|
|
75
|
+
```
|
|
76
|
+
|
|
77
|
+
### Example 3: Orchestrated Goal Achievement
|
|
78
|
+
|
|
79
|
+
```
|
|
80
|
+
User: Build a complete authentication system with JWT, OAuth, and session management
|
|
81
|
+
|
|
82
|
+
Agent: I'll orchestrate multiple sub-agents toward this goal.
|
|
83
|
+
|
|
84
|
+
[Agent uses orchestrate_goal tool with multiple agents]
|
|
85
|
+
|
|
86
|
+
Result: 5 agents orchestrated, each handling different auth component.
|
|
87
|
+
```
|
|
88
|
+
|
|
89
|
+
## Detailed Usage
|
|
90
|
+
|
|
91
|
+
### Using Headroom Skill
|
|
92
|
+
|
|
93
|
+
1. **Manual Loading**: Use `/skill:headroom` to load the skill
|
|
94
|
+
2. **Automatic Loading**: The skill loads automatically when needed
|
|
95
|
+
3. **Commands**:
|
|
96
|
+
- `/headroom:compress` - Compress current context
|
|
97
|
+
- `/headroom:stats` - Show compression statistics
|
|
98
|
+
- `/headroom:retrieve` - Retrieve original content
|
|
99
|
+
|
|
100
|
+
### Using Parallel Agents
|
|
101
|
+
|
|
102
|
+
1. **Spawn Agents**:
|
|
103
|
+
```typescript
|
|
104
|
+
spawn_parallel_agents({
|
|
105
|
+
goal: "Analyze codebase security",
|
|
106
|
+
agents: [
|
|
107
|
+
{
|
|
108
|
+
id: "agent-1",
|
|
109
|
+
task: "Scan for SQL injection vulnerabilities",
|
|
110
|
+
skills: ["security-scanner"],
|
|
111
|
+
hooks: ["pre-commit"],
|
|
112
|
+
mcpServers: ["vulnerability-db"]
|
|
113
|
+
},
|
|
114
|
+
{
|
|
115
|
+
id: "agent-2",
|
|
116
|
+
task: "Check authentication flaws",
|
|
117
|
+
skills: ["auth-analyzer"],
|
|
118
|
+
hooks: ["post-commit"],
|
|
119
|
+
mcpServers: ["auth-patterns"]
|
|
120
|
+
}
|
|
121
|
+
],
|
|
122
|
+
coordination: "Share findings and cross-validate"
|
|
123
|
+
})
|
|
124
|
+
```
|
|
125
|
+
|
|
126
|
+
2. **Check Status**:
|
|
127
|
+
```typescript
|
|
128
|
+
check_parallel_agents()
|
|
129
|
+
```
|
|
130
|
+
|
|
131
|
+
3. **Coordinate Results**:
|
|
132
|
+
```typescript
|
|
133
|
+
coordinate_agent_results({
|
|
134
|
+
goal: "Analyze codebase security",
|
|
135
|
+
mergeStrategy: "combine"
|
|
136
|
+
})
|
|
137
|
+
```
|
|
138
|
+
|
|
139
|
+
### Using Orchestrator
|
|
140
|
+
|
|
141
|
+
1. **Set Goal and Orchestrate**:
|
|
142
|
+
```typescript
|
|
143
|
+
orchestrate_goal({
|
|
144
|
+
goal: "Build REST API with authentication",
|
|
145
|
+
subAgents: [
|
|
146
|
+
{
|
|
147
|
+
id: "api-designer",
|
|
148
|
+
task: "Design API endpoints and schemas",
|
|
149
|
+
skills: ["api-design", "openapi"],
|
|
150
|
+
hooks: ["validation"],
|
|
151
|
+
mcpServers: ["api-standards"]
|
|
152
|
+
},
|
|
153
|
+
{
|
|
154
|
+
id: "auth-specialist",
|
|
155
|
+
task: "Implement JWT authentication",
|
|
156
|
+
skills: ["jwt", "oauth2"],
|
|
157
|
+
hooks: ["security-check"],
|
|
158
|
+
mcpServers: ["auth-providers"]
|
|
159
|
+
},
|
|
160
|
+
{
|
|
161
|
+
id: "database-engineer",
|
|
162
|
+
task: "Design and implement database schema",
|
|
163
|
+
skills: ["database-design", "migration"],
|
|
164
|
+
hooks: ["backup"],
|
|
165
|
+
mcpServers: ["database-tools"]
|
|
166
|
+
}
|
|
167
|
+
],
|
|
168
|
+
strategy: "parallel",
|
|
169
|
+
timeout: 600
|
|
170
|
+
})
|
|
171
|
+
```
|
|
172
|
+
|
|
173
|
+
2. **Check Orchestrator Status**:
|
|
174
|
+
```typescript
|
|
175
|
+
orchestrator_status()
|
|
176
|
+
```
|
|
177
|
+
|
|
178
|
+
3. **Equip Agent**:
|
|
179
|
+
```typescript
|
|
180
|
+
equip_agent({
|
|
181
|
+
agentId: "auth-specialist",
|
|
182
|
+
skills: ["rate-limiting"],
|
|
183
|
+
hooks: ["logging"],
|
|
184
|
+
mcpServers: ["monitoring"]
|
|
185
|
+
})
|
|
186
|
+
```
|
|
187
|
+
|
|
188
|
+
### Using Headroom Integration
|
|
189
|
+
|
|
190
|
+
1. **Install Headroom** (if not installed):
|
|
191
|
+
```typescript
|
|
192
|
+
headroom_install({ force: false })
|
|
193
|
+
```
|
|
194
|
+
|
|
195
|
+
2. **Compress Context**:
|
|
196
|
+
```typescript
|
|
197
|
+
headroom_compress({
|
|
198
|
+
content: "Large code output or logs...",
|
|
199
|
+
contentType: "auto",
|
|
200
|
+
compressionLevel: "medium"
|
|
201
|
+
})
|
|
202
|
+
```
|
|
203
|
+
|
|
204
|
+
3. **Get Statistics**:
|
|
205
|
+
```typescript
|
|
206
|
+
headroom_stats({ detailed: true })
|
|
207
|
+
```
|
|
208
|
+
|
|
209
|
+
4. **Start Proxy** (for automatic compression):
|
|
210
|
+
```typescript
|
|
211
|
+
headroom_proxy({
|
|
212
|
+
port: 8787,
|
|
213
|
+
background: true
|
|
214
|
+
})
|
|
215
|
+
```
|
|
216
|
+
|
|
217
|
+
## Integration with Existing OMK Workflows
|
|
218
|
+
|
|
219
|
+
### 1. Token-Saving Workflow
|
|
220
|
+
|
|
221
|
+
```
|
|
222
|
+
1. Receive large context (tool outputs, logs, files)
|
|
223
|
+
2. Use headroom_compress to reduce token usage
|
|
224
|
+
3. Send compressed context to LLM
|
|
225
|
+
4. LLM can retrieve originals via CCR if needed
|
|
226
|
+
```
|
|
227
|
+
|
|
228
|
+
### 2. Parallel Analysis Workflow
|
|
229
|
+
|
|
230
|
+
```
|
|
231
|
+
1. Identify tasks that can be parallelized
|
|
232
|
+
2. Use spawn_parallel_agents to create sub-agents
|
|
233
|
+
3. Each sub-agent works independently
|
|
234
|
+
4. Use coordinate_agent_results to merge findings
|
|
235
|
+
```
|
|
236
|
+
|
|
237
|
+
### 3. Goal-Oriented Orchestration
|
|
238
|
+
|
|
239
|
+
```
|
|
240
|
+
1. Define complex goal requiring multiple skills
|
|
241
|
+
2. Use orchestrate_goal to create sub-agents
|
|
242
|
+
3. Each sub-agent equipped with specific skills/hooks/MCP
|
|
243
|
+
4. Orchestrator manages coordination and result merging
|
|
244
|
+
```
|
|
245
|
+
|
|
246
|
+
## Best Practices
|
|
247
|
+
|
|
248
|
+
### For Token Savings
|
|
249
|
+
1. **Compress early**: Apply compression to tool outputs before they enter context
|
|
250
|
+
2. **Use content routing**: Let headroom auto-detect content type
|
|
251
|
+
3. **Monitor savings**: Use headroom_stats to track compression effectiveness
|
|
252
|
+
4. **Enable CCR**: Use reversible compression for important context
|
|
253
|
+
|
|
254
|
+
### For Parallel Agents
|
|
255
|
+
1. **Clear task division**: Each agent should have distinct, non-overlapping tasks
|
|
256
|
+
2. **Proper equipment**: Equip agents with relevant skills, hooks, and MCP servers
|
|
257
|
+
3. **Coordination strategy**: Choose appropriate strategy (parallel, sequential, pipeline, adaptive)
|
|
258
|
+
4. **Result merging**: Define clear strategy for combining agent results
|
|
259
|
+
|
|
260
|
+
### For Orchestration
|
|
261
|
+
1. **Goal clarity**: Define clear, measurable goals
|
|
262
|
+
2. **Agent specialization**: Each agent should handle specific aspect of goal
|
|
263
|
+
3. **Dependency management**: Define dependencies between agents
|
|
264
|
+
4. **Resource allocation**: Allocate appropriate skills/hooks/MCP to each agent
|
|
265
|
+
|
|
266
|
+
## Configuration
|
|
267
|
+
|
|
268
|
+
### Headroom Configuration
|
|
269
|
+
Headroom can be configured via:
|
|
270
|
+
- Environment variables
|
|
271
|
+
- Config file (`~/.headroom/config.toml`)
|
|
272
|
+
- Per-call overrides
|
|
273
|
+
|
|
274
|
+
### OMK Configuration
|
|
275
|
+
Extensions are auto-discovered from:
|
|
276
|
+
- `$OMK_RUNTIME_HOME/extensions/` (global)
|
|
277
|
+
- `.omk/extensions/` (project-local)
|
|
278
|
+
|
|
279
|
+
Skills are auto-discovered from:
|
|
280
|
+
- `$OMK_RUNTIME_HOME/.agents/skills/` (global)
|
|
281
|
+
- `.agents/skills/` (project-local)
|
|
282
|
+
|
|
283
|
+
## Troubleshooting
|
|
284
|
+
|
|
285
|
+
### Common Issues
|
|
286
|
+
|
|
287
|
+
1. **Headroom not installed**
|
|
288
|
+
- Solution: Use `headroom_install` tool or `pip install "headroom-ai[all]"`
|
|
289
|
+
|
|
290
|
+
2. **Extensions not loading**
|
|
291
|
+
- Solution: Check file permissions and TypeScript syntax
|
|
292
|
+
- Use `/reload` to reload extensions
|
|
293
|
+
|
|
294
|
+
3. **Agents not spawning**
|
|
295
|
+
- Solution: Check agent configuration and dependencies
|
|
296
|
+
- Use `check_parallel_agents` to monitor status
|
|
297
|
+
|
|
298
|
+
4. **Compression not working**
|
|
299
|
+
- Solution: Verify headroom installation with `headroom_stats`
|
|
300
|
+
- Check content type detection
|
|
301
|
+
|
|
302
|
+
### Performance Tips
|
|
303
|
+
|
|
304
|
+
1. **Parallel vs Sequential**: Use parallel for independent tasks, sequential for dependent tasks
|
|
305
|
+
2. **Compression level**: Balance between compression ratio and processing time
|
|
306
|
+
3. **Agent count**: Too many agents can cause coordination overhead
|
|
307
|
+
4. **Timeout settings**: Set appropriate timeouts for long-running tasks
|
|
308
|
+
|
|
309
|
+
## Advanced Features
|
|
310
|
+
|
|
311
|
+
### Custom Skills for Agents
|
|
312
|
+
Create custom skills for specific agent tasks:
|
|
313
|
+
```markdown
|
|
314
|
+
# Custom Security Scanner Skill
|
|
315
|
+
Use this skill when scanning for security vulnerabilities.
|
|
316
|
+
|
|
317
|
+
## Steps
|
|
318
|
+
1. Analyze code patterns
|
|
319
|
+
2. Check for common vulnerabilities
|
|
320
|
+
3. Generate security report
|
|
321
|
+
```
|
|
322
|
+
|
|
323
|
+
### Custom Hooks
|
|
324
|
+
Create hooks for pre/post processing:
|
|
325
|
+
```typescript
|
|
326
|
+
// Pre-commit hook for code validation
|
|
327
|
+
omk.on("tool_call", async (event, ctx) => {
|
|
328
|
+
if (event.toolName === "write") {
|
|
329
|
+
// Validate code before writing
|
|
330
|
+
const validation = await validateCode(event.input.content);
|
|
331
|
+
if (!validation.valid) {
|
|
332
|
+
return { block: true, reason: validation.error };
|
|
333
|
+
}
|
|
334
|
+
}
|
|
335
|
+
});
|
|
336
|
+
```
|
|
337
|
+
|
|
338
|
+
### MCP Server Integration
|
|
339
|
+
Equip agents with MCP servers for external tool access:
|
|
340
|
+
```typescript
|
|
341
|
+
equip_agent({
|
|
342
|
+
agentId: "database-engineer",
|
|
343
|
+
mcpServers: ["postgres-mcp", "redis-mcp", "elasticsearch-mcp"]
|
|
344
|
+
});
|
|
345
|
+
```
|
|
346
|
+
|
|
347
|
+
## Examples
|
|
348
|
+
|
|
349
|
+
### Example 1: Security Audit
|
|
350
|
+
```
|
|
351
|
+
Goal: Perform comprehensive security audit
|
|
352
|
+
Agents:
|
|
353
|
+
1. SQL Injection Scanner
|
|
354
|
+
2. XSS Vulnerability Detector
|
|
355
|
+
3. Authentication Analyzer
|
|
356
|
+
4. Authorization Checker
|
|
357
|
+
Strategy: Parallel
|
|
358
|
+
Coordination: Cross-validate findings
|
|
359
|
+
```
|
|
360
|
+
|
|
361
|
+
### Example 2: Code Refactoring
|
|
362
|
+
```
|
|
363
|
+
Goal: Refactor legacy authentication system
|
|
364
|
+
Agents:
|
|
365
|
+
1. Code Analyzer (understand current system)
|
|
366
|
+
2. Pattern Designer (design new patterns)
|
|
367
|
+
3. Migration Planner (plan migration steps)
|
|
368
|
+
4. Test Writer (write comprehensive tests)
|
|
369
|
+
Strategy: Pipeline
|
|
370
|
+
Coordination: Sequential with result passing
|
|
371
|
+
```
|
|
372
|
+
|
|
373
|
+
### Example 3: Feature Development
|
|
374
|
+
```
|
|
375
|
+
Goal: Build real-time notification system
|
|
376
|
+
Agents:
|
|
377
|
+
1. WebSocket Specialist
|
|
378
|
+
2. Database Designer
|
|
379
|
+
3. API Developer
|
|
380
|
+
4. Frontend Integrator
|
|
381
|
+
5. Test Automator
|
|
382
|
+
Strategy: Adaptive
|
|
383
|
+
Coordination: Dependency-based execution
|
|
384
|
+
```
|
|
385
|
+
|
|
386
|
+
## Conclusion
|
|
387
|
+
|
|
388
|
+
This integration provides:
|
|
389
|
+
1. **Token Savings**: 60-95% reduction in token usage through headroom compression
|
|
390
|
+
2. **Parallel Processing**: Multiple sub-agents working simultaneously
|
|
391
|
+
3. **Goal Orchestration**: Coordinated work toward complex objectives
|
|
392
|
+
4. **Flexible Equipment**: Custom skills, hooks, and MCP servers for each agent
|
|
393
|
+
|
|
394
|
+
Use these tools to enhance your OMK workflow with efficient context compression and parallel agent orchestration.
|