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
|
@@ -98,7 +98,11 @@ export function fitHeight(lines, height) {
|
|
|
98
98
|
}
|
|
99
99
|
/** Wrap lines in a themed box panel. */
|
|
100
100
|
export function panel(title, lines, width) {
|
|
101
|
-
const processed = lines.map((line) =>
|
|
101
|
+
const processed = lines.map((line) => {
|
|
102
|
+
const truncated = truncateLine(line, width);
|
|
103
|
+
const vw = visibleTerminalWidth(truncated);
|
|
104
|
+
return vw < width ? truncated + " ".repeat(width - vw) : truncated;
|
|
105
|
+
});
|
|
102
106
|
return box(processed, title || undefined);
|
|
103
107
|
}
|
|
104
108
|
/** Render a section header. */
|
package/dist/util/version.js
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { readFileSync } from "fs";
|
|
2
2
|
import { dirname, join } from "path";
|
|
3
3
|
import { fileURLToPath } from "url";
|
|
4
|
+
import { OMK_RUNTIME_VERSION } from "../version.js";
|
|
4
5
|
export const OMK_REPO_URL = "https://github.com/dmae97/open-multi-agent-kit";
|
|
5
6
|
let cachedVersion;
|
|
6
7
|
let cachedRepoUrl;
|
|
@@ -47,5 +48,5 @@ export function getOmkRepoUrlSync() {
|
|
|
47
48
|
return cachedRepoUrl;
|
|
48
49
|
}
|
|
49
50
|
export function formatOmkVersionFooter(version = getOmkVersionSync()) {
|
|
50
|
-
return `omk v${version} • GitHub: ${getOmkRepoUrlSync()}`;
|
|
51
|
+
return `omk package v${version} • runtime ${OMK_RUNTIME_VERSION} • GitHub: ${getOmkRepoUrlSync()}`;
|
|
51
52
|
}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
# 2026-06-11 Critical Issues
|
|
2
|
+
|
|
3
|
+
## Critical Init Status
|
|
4
|
+
- No critical init artifacts were missing when this daily file was generated.
|
|
5
|
+
### Missing critical artifacts
|
|
6
|
+
- None detected.
|
|
7
|
+
|
|
8
|
+
|
|
9
|
+
## Critical Artifacts Present
|
|
10
|
+
- ✅ `AGENTS.md` — top-level operating contract
|
|
11
|
+
- ✅ `.kimi/AGENTS.md` — Kimi-specific operating rules
|
|
12
|
+
- ✅ `.omk/config.toml` — OMK project runtime settings
|
|
13
|
+
- ✅ `.omk/agents/root.yaml` — root coordinator agent
|
|
14
|
+
- ✅ `.kimi/mcp.json` — Kimi project MCP registry
|
|
15
|
+
- ✅ `.omk/hooks/pre-shell-guard.sh` — destructive shell guard
|
|
16
|
+
- ✅ `.omk/hooks/protect-secrets.sh` — secret write guard
|
|
17
|
+
- ✅ `.omk/memory/graph-state.json` — local ontology graph database
|
|
18
|
+
|
|
19
|
+
## Escalation Rule
|
|
20
|
+
- Treat missing shell/secret guards, root agent config, MCP registry, or ontology graph as critical until restored.
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
# 2026-06-11 Improvements
|
|
2
|
+
|
|
3
|
+
## Current Improvement Backlog
|
|
4
|
+
### Optional init/support artifacts to add or refresh
|
|
5
|
+
- None detected.
|
|
6
|
+
|
|
7
|
+
### Critical init artifacts currently blocking reliable chat startup
|
|
8
|
+
- None detected.
|
|
9
|
+
|
|
10
|
+
|
|
11
|
+
## Suggested Focus
|
|
12
|
+
- Keep `omk chat` startup idempotent and non-destructive.
|
|
13
|
+
- Prefer local graph memory for default ontology state.
|
|
14
|
+
- Keep generated daily docs small, dated, and safe to edit by hand.
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
# 2026-06-11 Required Init Checklist
|
|
2
|
+
|
|
3
|
+
**Run ID:** chat-2026-06-10T18-23-46-194Z-9124
|
|
4
|
+
**Ontology graph:** `.omk/memory/graph-state.json`
|
|
5
|
+
|
|
6
|
+
## Required Artifacts
|
|
7
|
+
- ✅ `AGENTS.md` — critical; top-level operating contract
|
|
8
|
+
- ✅ `.kimi/AGENTS.md` — critical; Kimi-specific operating rules
|
|
9
|
+
- ✅ `DESIGN.md` — support; design/brand source of truth
|
|
10
|
+
- ✅ `.omk/config.toml` — critical; OMK project runtime settings
|
|
11
|
+
- ✅ `.omk/agents/root.yaml` — critical; root coordinator agent
|
|
12
|
+
- ✅ `.kimi/mcp.json` — critical; Kimi project MCP registry
|
|
13
|
+
- ✅ `.omk/mcp.json` — support; legacy OMK MCP fallback
|
|
14
|
+
- ✅ `.omk/lsp.json` — support; bundled TypeScript/Python LSP config
|
|
15
|
+
- ✅ `.omk/hooks/pre-shell-guard.sh` — critical; destructive shell guard
|
|
16
|
+
- ✅ `.omk/hooks/protect-secrets.sh` — critical; secret write guard
|
|
17
|
+
- ✅ `.omk/memory/graph-state.json` — critical; local ontology graph database
|
|
18
|
+
- ✅ `.kimi/skills` — support; Kimi skill directory
|
|
19
|
+
- ✅ `.agents/skills` — support; portable skill directory
|
|
20
|
+
|
|
21
|
+
## Recovery Command
|
|
22
|
+
```bash
|
|
23
|
+
omk init
|
|
24
|
+
omk doctor
|
|
25
|
+
```
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
# 2026-06-11 OMK Chat Plan
|
|
2
|
+
|
|
3
|
+
**Run ID:** chat-2026-06-10T18-23-46-194Z-9124
|
|
4
|
+
**Generated by:** omk chat bootstrap
|
|
5
|
+
|
|
6
|
+
## Purpose
|
|
7
|
+
- Start every chat with a dated workspace for planning, issue triage, and verification evidence.
|
|
8
|
+
- Keep ontology-backed memory available before the root coordinator starts.
|
|
9
|
+
- Make required init state visible without overwriting user-authored docs.
|
|
10
|
+
|
|
11
|
+
## Today Plan
|
|
12
|
+
1. Review `init-checklist.md` and resolve missing critical init artifacts first.
|
|
13
|
+
2. Use `improvements.md` as the active improvement backlog.
|
|
14
|
+
3. Use `critical-issues.md` for blocking defects, safety risks, and verification gaps.
|
|
15
|
+
4. Record command evidence before claiming work is complete.
|
|
16
|
+
|
|
17
|
+
## Stop Condition
|
|
18
|
+
- Critical init artifacts are present.
|
|
19
|
+
- Ontology graph exists at `.omk/memory/graph-state.json`.
|
|
20
|
+
- Any new code/docs changes have explicit verification evidence.
|
|
@@ -0,0 +1,223 @@
|
|
|
1
|
+
# OMK CLI 아키텍처 분석 보고서 (CodeGraph)
|
|
2
|
+
|
|
3
|
+
> 분석일: 2026-05-25
|
|
4
|
+
> 도구: CodeGraph (SQLite 기반 코드 의존성 그래프)
|
|
5
|
+
> 대상: /home/yu/open_multi-agent_kit (open-multi-agent-kit v1.1.18)
|
|
6
|
+
|
|
7
|
+
---
|
|
8
|
+
|
|
9
|
+
## 1. 개요
|
|
10
|
+
|
|
11
|
+
OMK CLI는 Commander.js 기반의 단일 진입점(entry point)을 가진 Node.js CLI 도구로, 4개의 핵심 축으로 구성됨.
|
|
12
|
+
|
|
13
|
+
## 2. Entry Point & Command Routing 흐름
|
|
14
|
+
|
|
15
|
+
Entry: src/cli.ts → main.ts → createOmkProgram() → registerCliCommands()
|
|
16
|
+
Root Flow (no args): runRootHudFlow() → HUD + mode selector + spawn
|
|
17
|
+
|
|
18
|
+
병목: Command Registry Coupling — register-*.ts가 commands/와 1:1 coupling
|
|
19
|
+
|
|
20
|
+
## 3. Theme System
|
|
21
|
+
|
|
22
|
+
src/brand/palette.ts (21색상) → src/util/theme.ts (God Module, 230 inbound)
|
|
23
|
+
|
|
24
|
+
## 4. Render Pipeline
|
|
25
|
+
|
|
26
|
+
src/hud/render.ts (42KB, 74 nodes, 115 outbound) → LiveHudRenderer
|
|
27
|
+
|
|
28
|
+
## 5. Orchestration
|
|
29
|
+
|
|
30
|
+
src/orchestration/executor.ts (39KB, DAG 실행 엔진)
|
|
31
|
+
src/orchestration/routing.ts (825L, 73 nodes)
|
|
32
|
+
src/orchestration/parallel-orchestrator.ts (650L, 59 nodes)
|
|
33
|
+
|
|
34
|
+
## 6. 의존성 분석 (CodeGraph 기반)
|
|
35
|
+
|
|
36
|
+
Hub Modules:
|
|
37
|
+
- src/util/fs.ts — 496 total degree
|
|
38
|
+
- src/util/theme.ts — 343 total degree
|
|
39
|
+
- src/providers/provider-router.ts — 298 total degree
|
|
40
|
+
|
|
41
|
+
최고 복잡도 파일:
|
|
42
|
+
- providers/provider-task-runner.ts — 1,442L
|
|
43
|
+
- mcp/omk-project-server.ts — 1,737L
|
|
44
|
+
- commands/mcp.ts — ~1,800L
|
|
45
|
+
- commands/design.ts — ~1,600L
|
|
46
|
+
|
|
47
|
+
순환 의존성: File-level 명확한 순환은 미발견. 단 theme.ts와 render.ts 간 강한 coupling 존재.
|
|
48
|
+
|
|
49
|
+
## 7. 병목 지점
|
|
50
|
+
|
|
51
|
+
Critical:
|
|
52
|
+
1. util/fs.ts (496 degree) → path/project/run으로 분리
|
|
53
|
+
2. util/theme.ts (343 degree) → ansi/colors/panels로 분리
|
|
54
|
+
3. providers/provider-task-runner.ts (1,442L) → runner/selection/state 분리
|
|
55
|
+
|
|
56
|
+
Major:
|
|
57
|
+
4. orchestration/routing.ts (825L)
|
|
58
|
+
5. mcp/omk-project-server.ts (1,737L)
|
|
59
|
+
6. hud/render.ts (1,300+L)
|
|
60
|
+
|
|
61
|
+
## 8. 개선 권장사항
|
|
62
|
+
|
|
63
|
+
P0: util/fs.ts, util/theme.ts, provider-task-runner.ts, routing.ts 구조적 분리
|
|
64
|
+
P1: commands/ 서브디렉토리화, cli/register 동적 임포트
|
|
65
|
+
P2: orchestration/ → execution/, routing/, ensemble/, evidence/ 분리
|
|
66
|
+
P3: theme.ts와 render.ts 간 interface 기반 의존성 전환
|
|
67
|
+
|
|
68
|
+
## 9. 결론
|
|
69
|
+
|
|
70
|
+
OMK CLI는 기능적으로 성숙했으나 구조적 부채가 누적된 상태.
|
|
71
|
+
핵심: util/fs.ts + util/theme.ts 허브화 → 1,000L+ 파일 5개 이상 → orchestration/ 책임 과다
|
|
72
|
+
권장 우선순위: fs/theme 분리 → provider-task-runner 분리 → orchestration 관심사 분리 → commands 서브디렉토리화
|
|
73
|
+
|
|
74
|
+
---
|
|
75
|
+
|
|
76
|
+
## 10. HUD Render Pipeline Decoupling (2026-05-25)
|
|
77
|
+
|
|
78
|
+
### 변경 개요
|
|
79
|
+
`src/hud/render.ts` → `src/util/theme.ts` 간 강한 coupling 해소 작업 완료.
|
|
80
|
+
|
|
81
|
+
### 생성/변경 파일
|
|
82
|
+
- `src/hud/types.ts` (새로 생성)
|
|
83
|
+
- `HudStyle`, `HudStatus`, `SystemUsage`, `HudTheme` 인터페이스 정의
|
|
84
|
+
- render pipeline이 필요로 하는 theme 계약을 당소화
|
|
85
|
+
- `src/util/theme.ts` (수정)
|
|
86
|
+
- `hudTheme: HudTheme` 객체 추가 → 인터페이스 구현체
|
|
87
|
+
- `src/hud/render.ts` (성형 보전)
|
|
88
|
+
- `theme.ts`의 직접 import를 제거하고 `HudTheme` 타입의 `theme` 객체를 하나의 출입점에서 사용
|
|
89
|
+
- `fetchHudDashboardData()`: compact/medium/full/section 4개 모드의 중복되던 run state/git/session 폴링 로직 통합
|
|
90
|
+
- `buildHudHeader()`: matrix rain + 헤더 + summary 생성 함수 분리
|
|
91
|
+
- `buildHudFooter()`: 기존 `renderFooter` 을 이름 변경 후 독립 함수화
|
|
92
|
+
- dashboard renderer 4개 모드 모두 `fetchHudDashboardData` + `buildHudHeader` + `buildHudFooter` 조합으로 단순화
|
|
93
|
+
|
|
94
|
+
### 결과
|
|
95
|
+
- **순환 의존성 해소**: render.ts → theme.ts 직접 의존이 `HudTheme` 인터페이스로 대체되면서 구현체 교체 시 단 하나의 import만 바뀌면 됨
|
|
96
|
+
- **코드 줄이기**: render.ts 1,300+줄 → 1,076줄 (약 18% 감소)
|
|
97
|
+
- **경로 최소화**: HUD 렌더러의 공통 데이터 폐치가 한 곳에서 관리되면서 바뀌는 경우의 추적성 향상
|
|
98
|
+
- **컴파일 성공**: `tsc --noEmit` 패스
|
|
99
|
+
|
|
100
|
+
---
|
|
101
|
+
|
|
102
|
+
## 11. OMK CLI V2 런타임 아키텍처 (2026-05-28)
|
|
103
|
+
|
|
104
|
+
> 아키텍처 문서: `docs/OMK_CLI_V2_RUNTIME_ARCHITECTURE.md` (2058 lines)
|
|
105
|
+
> 구현 진행률: ~85%
|
|
106
|
+
|
|
107
|
+
### 11.1 핵심 문제 (해결됨)
|
|
108
|
+
|
|
109
|
+
1. **Prompt bloat**: 2자 요청에 전체 오케스트레이션 계약 전송 → `context-broker.ts`에서 `promptMode === "dnc-nlp"` 체크 추가
|
|
110
|
+
2. **available ≠ required MCP 분리**: `CapabilityPlan`로 분리 완료
|
|
111
|
+
3. **Optional MCP 실패 = 치명적**: 경고로 변경 완료
|
|
112
|
+
4. **Provider raw stdout 유출**: `ProviderEventNormalizer` → `OutputRouter` 경유 필수
|
|
113
|
+
5. **Slash commands 미연결**: `CommandBus`에 핸들러 등록 완료
|
|
114
|
+
6. **kimi-cli 의존성**: `kimi-api` (직접 Moonshot HTTP)로 대체 완료
|
|
115
|
+
|
|
116
|
+
### 11.2 런타임 파이프라인 (현재)
|
|
117
|
+
|
|
118
|
+
```
|
|
119
|
+
User Input → Clipanion CLI → OmkCommand.executePipeline()
|
|
120
|
+
→ CommandBus (slash commands registered)
|
|
121
|
+
→ IntentClassifier (classifyIntent)
|
|
122
|
+
→ CapabilitySelector (selectCapabilities)
|
|
123
|
+
→ RuntimeSidecar (compileBloatToNlp)
|
|
124
|
+
→ OutputRouter (ThemePalette resolve)
|
|
125
|
+
→ ThemeRenderer / NlpRenderer / JsonRenderer / NlgRenderer
|
|
126
|
+
```
|
|
127
|
+
|
|
128
|
+
### 11.3 핵심 런타임 파일
|
|
129
|
+
|
|
130
|
+
| 파일 | 라인 | 역할 |
|
|
131
|
+
|------|------|------|
|
|
132
|
+
| `src/runtime/contracts/command-envelope.ts` | ~130 | CommandKind, OutputFormat, StdoutMode, OutputProfile, OmkEvent, CapabilityPlan |
|
|
133
|
+
| `src/runtime/contracts/reasoning-trace.ts` | 144 | RTE 스키마 (ReasoningTrace, TraceSummary, ConsentAwareNlgInput/Output) |
|
|
134
|
+
| `src/runtime/debloat-nlp.ts` | ~531 | classifyIntent, classifyRisk, selectCapabilities, compileBloatToNlp, filterMcpConfigForTurn, selectProviderRuntime |
|
|
135
|
+
| `src/runtime/command-bus.ts` | 88 | CommandBus 인터페이스, slash → handler 매핑 |
|
|
136
|
+
| `src/runtime/slash-commands.ts` | 194 | SlashCommandParser + /model, /status, /theme, /help 핸들러 |
|
|
137
|
+
| `src/runtime/provider-event-normalizer.ts` | 555 | KimiEventNormalizer + KimiPrintNormalizer, i18n bilingual |
|
|
138
|
+
| `src/runtime/output-router.ts` | ~200 | OutputRouter 인터페이스, ThemePalette resolve, routeTrace, NLG renderer |
|
|
139
|
+
| `src/runtime/renderers.ts` | 272 | ThemeRenderer (opencode-style), NlpRenderer (bilingual), JsonRenderer |
|
|
140
|
+
| `src/runtime/ui-components.ts` | 301 | statusCard, providerCard, memoryCard, mcpHealthCard, errorBox, traceSummaryCard, consentNotice |
|
|
141
|
+
| `src/runtime/nlg-renderer.ts` | 190 | NlgRenderer (renderTrace, renderSummary, renderConsentReport, renderTurnResult) |
|
|
142
|
+
| `src/runtime/reasoning-trace.ts` | 354 | RTE 구현 (createReasoningTrace, redactTrace, summarizeTrace, generateConsentReport, createReasoningTraceStore) |
|
|
143
|
+
| `src/runtime/context-broker.ts` | 375 | ContextCapsule 빌더, promptMode dnc-nlp 체크 |
|
|
144
|
+
| `src/runtime/mimo-api-runtime.ts` | 35 | MiMo API 런타임 (KimiApiRuntime 확장) |
|
|
145
|
+
| `src/runtime/kimi-api-runtime.ts` | 445 | Moonshot API 직접 HTTP 런타임 |
|
|
146
|
+
| `src/runtime/runtime-router.ts` | 513 | 런타임 우선순위, provider → runtime 매핑 |
|
|
147
|
+
|
|
148
|
+
### 11.4 CLI v2 파일
|
|
149
|
+
|
|
150
|
+
| 파일 | 라인 | 역할 |
|
|
151
|
+
|------|------|------|
|
|
152
|
+
| `src/cli/v2/cli-v2-skeleton.ts` | ~340 | Clipanion 기반 7개 명령어 + 전체 파이프라인 |
|
|
153
|
+
| `src/cli/v2/chat-repl.ts` | ~170 | 대화형 REPL + 파이프라인 통합 |
|
|
154
|
+
| `src/cli/v2/interactive-prompt.ts` | 225 | Clack 프롬프트 |
|
|
155
|
+
| `src/cli/v2/persistent-memory.ts` | 350 | Section 17 영구 메모리 (.omk/memory/) |
|
|
156
|
+
| `src/cli/main.ts` | ~115 | OMK_CLI_V2=1일 때 모든 명령어 cli-v2로 라우팅 |
|
|
157
|
+
|
|
158
|
+
### 11.5 오케스트레이션 파일
|
|
159
|
+
|
|
160
|
+
| 파일 | 라인 | 역할 |
|
|
161
|
+
|------|------|------|
|
|
162
|
+
| `src/orchestration/interactive-orchestrator.ts` | 667 | InteractiveOrchestrator (goal-driven, SubAgentRole 10개) |
|
|
163
|
+
| `src/commands/parallel/interactive.ts` | 246 | omk parallel:interactive CLI 명령어 |
|
|
164
|
+
|
|
165
|
+
### 11.6 Provider 시스템
|
|
166
|
+
|
|
167
|
+
| 파일 | 역할 |
|
|
168
|
+
|------|------|
|
|
169
|
+
| `src/providers/model-registry.ts` | KnownProviderId (9개: codex/commandcode/deepseek/kimi/local-llm/mimo/opencode/openrouter/qwen), DEFAULT_PROVIDER_CONFIGS |
|
|
170
|
+
| `src/providers/provider-runtime.ts` | discoverKimiRuntime, discoverMimoRuntime (kimi-api/mimo-api 항상 등록) |
|
|
171
|
+
| `src/providers/types.ts` | ProviderId, ProviderPolicy, RuntimeId, DEFAULT_RUNTIME_FALLBACK_CHAIN |
|
|
172
|
+
| `src/runtime/runtime-bootstrap.ts` | resolveAutoProvider (mimo 자동 감지) |
|
|
173
|
+
|
|
174
|
+
### 11.7 i18n 시스템
|
|
175
|
+
|
|
176
|
+
- `src/util/i18n.ts` (~1070 lines): KO/EN 사전, `t()` 함수
|
|
177
|
+
- 키 카테고리: nlp.*, normalizer.*, ui.*, nlg.*
|
|
178
|
+
- `getLanguage()`, `setLanguage()`, `initI18n()`
|
|
179
|
+
|
|
180
|
+
### 11.8 테스트
|
|
181
|
+
|
|
182
|
+
- `test/v2-regression.test.mjs` (217 lines, 10/10 PASS)
|
|
183
|
+
- `test/cli-v2-gating.test.mjs` (2/2 PASS)
|
|
184
|
+
|
|
185
|
+
### 11.9 설정
|
|
186
|
+
|
|
187
|
+
- `~/.kimi/config.toml` (154 lines): default_model = "mimo/mimo-v2.5-pro", providers: mimo, kimi, deepseek, codex, opencode, openrouter, qwen
|
|
188
|
+
- `.omk/kimi.config.toml` (53 lines): hooks만 포함 (중복 키 해결)
|
|
189
|
+
- `~/.kimi/mcp.json`: 8개 MCP 서버 (context7, gh_grep, filesystem, playwright, memory, sequential-thinking, clearthought, obsidian)
|
|
190
|
+
|
|
191
|
+
### 11.10 아키텍처 문서 이행률
|
|
192
|
+
|
|
193
|
+
| 섹션 | 상태 | 비고 |
|
|
194
|
+
|------|------|------|
|
|
195
|
+
| 0-2 (Executive Summary, Problem, Target) | ✅ | 전체 파이프라인 구현 |
|
|
196
|
+
| 5-13 (Data Models ~ ProviderEventNormalizer) | ✅ | 타입 정렬 완료 |
|
|
197
|
+
| 14 (Theme Architecture) | ✅ | ThemePalette + UiComponents |
|
|
198
|
+
| 15 (NlpRenderer) | ✅ | bilingual i18n |
|
|
199
|
+
| 16 (Slash Command) | ✅ | CommandBus 핸들러 등록 |
|
|
200
|
+
| 17 (Persistent Memory) | ✅ | .omk/memory/ |
|
|
201
|
+
| 20 (Regression Tests) | ✅ | 6개 테스트 |
|
|
202
|
+
| 22 P1 (RuntimeSidecar, ThemeRenderer) | ✅ | |
|
|
203
|
+
| 22 P2 (Clipanion, Clack) | ✅ | cli-v2-skeleton + interactive-prompt |
|
|
204
|
+
| 4 (Directory Structure) | ❌ | flat 구조 유지 |
|
|
205
|
+
| 19 (Migration Plan Phase 4-5) | ❌ | |
|
|
206
|
+
| 21 (CLI v2 full migration) | ⚠️ | skeleton exists, wiring partial |
|
|
207
|
+
|
|
208
|
+
### 11.11 핵심 불변식 (I-001 ~ I-012)
|
|
209
|
+
|
|
210
|
+
- I-001: availableMcp ≠ prompt MUST activate
|
|
211
|
+
- I-004: optional failure = warning
|
|
212
|
+
- I-005: raw TurnBegin/StatusUpdate not in stdout
|
|
213
|
+
- I-006: status requiredMcp=[]
|
|
214
|
+
- I-008: slash command through CommandBus
|
|
215
|
+
- I-011: kimi-print debug-only
|
|
216
|
+
|
|
217
|
+
### 11.12 남은 작업
|
|
218
|
+
|
|
219
|
+
1. Section 21 CLI v2 전체 마이그레이션 (Commander → Clipanion)
|
|
220
|
+
2. Section 4 디렉토리 구조 재편
|
|
221
|
+
3. Section 19 Migration Phase 4-5
|
|
222
|
+
4. omk chat 실제 모델 연결 테스트
|
|
223
|
+
5. UI/UX opencode-style 최종 적용 확인
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
# ADR-0001: No native Rust lane for omk-safety
|
|
2
|
+
|
|
3
|
+
Status: Accepted
|
|
4
|
+
Date: 2026-06-10
|
|
5
|
+
|
|
6
|
+
## Context
|
|
7
|
+
|
|
8
|
+
`crates/omk-safety` was scaffolded as a future native lane for safety hot paths
|
|
9
|
+
(redact_stream / sanitize_env / check_path_policy). Remediation item A4 required either
|
|
10
|
+
building it into a measured, shippable lane or killing it with evidence.
|
|
11
|
+
|
|
12
|
+
## Decision
|
|
13
|
+
|
|
14
|
+
Remove the Rust surface. Keep TypeScript as the only implementation.
|
|
15
|
+
|
|
16
|
+
## Evidence (measured, not estimated)
|
|
17
|
+
|
|
18
|
+
| candidate | p (wall fraction, representative run) | Amdahl ceiling 1/(1−p) | gate (≥1.15) | capability gate |
|
|
19
|
+
|---|---|---|---|---|
|
|
20
|
+
| redact_stream | 0.297% | 1.0030 | FAIL (unreachable even at s=∞) | FAIL — TS hot lane already 65–428 MB/s; 0.26–0.70 ms per 64 KiB ≤ 2 ms budget |
|
|
21
|
+
| sanitize_env | 0.018% | 1.0002 | FAIL | FAIL — cold path, once per spawn |
|
|
22
|
+
| check_path_policy | <0.06% (below sampler resolution) | ≈1.0000 | FAIL | FAIL — realpath syscall-bound |
|
|
23
|
+
|
|
24
|
+
s (local Rust speedup) was not measured: with all ceilings < 1.004, no finite or infinite
|
|
25
|
+
s can satisfy the gate; building napi bindings to measure it cannot change the outcome.
|
|
26
|
+
|
|
27
|
+
Profiles, throughput benches, and analysis: `proof/rust-lane-2026-06-10/`.
|
|
28
|
+
|
|
29
|
+
## Removal scope (larger than "delete crates/" — wired surfaces)
|
|
30
|
+
|
|
31
|
+
- `crates/`, root `Cargo.toml`, `Cargo.lock` (no rust-toolchain.toml exists)
|
|
32
|
+
- package.json: `rust:build`, `native:build`, and `native:build` steps inside
|
|
33
|
+
`release:check`, `release:full`, `release:rc`; `native:no-kimi:turn` reference check
|
|
34
|
+
- `scripts/build-native.mjs`, `scripts/rust-safety-check.mjs`,
|
|
35
|
+
`scripts/normalize-native-artifacts.mjs`, native branch of `scripts/package-audit.mjs`
|
|
36
|
+
- `src/util/native-safety.ts` + doctor lane report (`src/commands/doctor/checks.ts:253,358`)
|
|
37
|
+
- CI: rust/cargo steps in `.github/workflows/{ci,release,smoke-test}.yml`
|
|
38
|
+
- README/CHANGELOG native-lane claims; SECURITY.md stays unchanged (it never claimed
|
|
39
|
+
native sandboxing — verify on execution)
|
|
40
|
+
|
|
41
|
+
## What we keep instead (TS follow-ups carrying the real value)
|
|
42
|
+
|
|
43
|
+
1. Fix O(matches × n) `SecretScanner.getLineColumn` (secret-scanner.ts:729) — measured
|
|
44
|
+
3 404 ms/call at 1 MiB match-heavy input vs 11.7 ms clean.
|
|
45
|
+
2. Enforce `writableRoots` (src/runtime/sandbox-profile.ts:13) in tool dispatch — currently
|
|
46
|
+
declared but never consulted against any path.
|
|
47
|
+
3. Deduplicate child-env sanitizer clones (kimi runner ↔ adapter).
|
|
48
|
+
|
|
49
|
+
## Consequences
|
|
50
|
+
|
|
51
|
+
- No supply-chain surface from prebuilds; `--ignore-scripts` installs remain trivially safe.
|
|
52
|
+
- A future native lane proposal must re-run this gate with new measured p.
|
|
@@ -39,6 +39,14 @@ Codex/ChatGPT OAuth proves the Codex CLI login state only. It is not an OpenAI P
|
|
|
39
39
|
OPENAI_API_KEY=<platform-project-key> omk image generate "OMK control-plane hero" --model gpt-image-2
|
|
40
40
|
```
|
|
41
41
|
|
|
42
|
+
You can also run the guided key setup instead of exporting the variable manually:
|
|
43
|
+
|
|
44
|
+
```bash
|
|
45
|
+
omk openai setup
|
|
46
|
+
```
|
|
47
|
+
|
|
48
|
+
Do not store the API key in project files; prefer environment variables or a user-local secret store.
|
|
49
|
+
|
|
42
50
|
See [`openai-platform-image-keys.md`](openai-platform-image-keys.md) for the one-shot key flow.
|
|
43
51
|
|
|
44
52
|
## Troubleshooting
|
|
@@ -46,3 +54,9 @@ See [`openai-platform-image-keys.md`](openai-platform-image-keys.md) for the one
|
|
|
46
54
|
- If `codex` is not found, install the official Codex CLI/app or add it to `PATH`.
|
|
47
55
|
- If login status is unclear, run `codex login`, then `omk provider doctor codex --soft`.
|
|
48
56
|
- If MCP import finds nothing, check whether your Codex config has importable MCP servers.
|
|
57
|
+
|
|
58
|
+
## Security principles
|
|
59
|
+
|
|
60
|
+
- Never print token/session files.
|
|
61
|
+
- OMK never reuses Codex OAuth values as OpenAI API bearer keys.
|
|
62
|
+
- In shared environments, keep per-provider authentication and project configuration separate.
|
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
# Decision: Git history bloat — defer rewrite, apply linguist-vendored interim
|
|
2
|
+
|
|
3
|
+
- Date: 2026-06-10
|
|
4
|
+
- Status: Accepted (interim mitigation only; rewrite deferred pending owner approval)
|
|
5
|
+
|
|
6
|
+
## Problem
|
|
7
|
+
|
|
8
|
+
The repository pack is far larger than the working tree:
|
|
9
|
+
|
|
10
|
+
- `git count-objects -vH` → `size-pack: 80.19 MiB`
|
|
11
|
+
- Tracked worktree content ≈ 27 MiB
|
|
12
|
+
|
|
13
|
+
The gap is caused by large binary blobs (GIF/MP4/PNG/PPTX) committed and later
|
|
14
|
+
replaced/removed, which remain in history forever.
|
|
15
|
+
|
|
16
|
+
## Evidence: top-10 largest blobs
|
|
17
|
+
|
|
18
|
+
Command:
|
|
19
|
+
|
|
20
|
+
```bash
|
|
21
|
+
git rev-list --objects --all \
|
|
22
|
+
| git cat-file --batch-check='%(objecttype) %(objectname) %(objectsize) %(rest)' \
|
|
23
|
+
| sort -k3 -rn | head -10
|
|
24
|
+
```
|
|
25
|
+
|
|
26
|
+
Output (2026-06-10):
|
|
27
|
+
|
|
28
|
+
```text
|
|
29
|
+
blob f2aa8c50905967a71bab34b5045406ed668b3a1c 29252458 readmeasset/kimicat.gif
|
|
30
|
+
blob fee8957c9ff26f7243d375f919c6cba5fa53ca3d 18261906 readmeasset/oneprompt.mp4
|
|
31
|
+
blob 8ff0eb7cc1fa08c49fe51ade9dc016fb81f31cd7 10528089 readmeasset/kimicat.gif
|
|
32
|
+
blob c4fea42c159c57e82f64e274335b9829ea1e8dbe 7016890 readmeasset/oneprompt.gif
|
|
33
|
+
blob e1aa1c049e1444d250da52202944d6f8ef1aed9f 3643625 EGG_PEAK_IR_Malgun_Gothic_FIXED_TRUE_ANIM.pptx
|
|
34
|
+
blob f6097940de448e09de07e9b949f6caab13fec433 3041622 readmeasset/kimicat.mp4
|
|
35
|
+
blob 5f671d8ac6c8a6011891164a0bdfa84ea7733749 2802989 readmeasset/kimicat.mp4
|
|
36
|
+
blob 75169d7c30c48b552c621c2f23779d6354974e9f 1849634 kimichan.png
|
|
37
|
+
blob 8edbf5a56bf456284bbd8fb5aa580245684d72e0 1708509 readmeasset/kimicat.png
|
|
38
|
+
blob 13a70fc8e0a35e20c1967b0306b29540bfb75b88 1522325 readmeasset/kimicat.png
|
|
39
|
+
```
|
|
40
|
+
|
|
41
|
+
The top 4 blobs alone account for ~65 MB of the 80.19 MiB pack.
|
|
42
|
+
|
|
43
|
+
## Decision
|
|
44
|
+
|
|
45
|
+
1. **No history rewrite now.** A `git filter-repo` rewrite of the blobs above
|
|
46
|
+
would shrink the pack to roughly worktree scale, but it rewrites every
|
|
47
|
+
commit hash, **invalidates all existing clones, forks, and open PRs**, and
|
|
48
|
+
requires a coordinated force-push. Execute it ONLY with explicit owner
|
|
49
|
+
approval and a scheduled migration window.
|
|
50
|
+
2. **Interim mitigation:** mark the intentionally hand-written template JS
|
|
51
|
+
under `templates/web-bridge/chrome-extension/**` as `linguist-vendored` in
|
|
52
|
+
`.gitattributes` so language stats and code-scanning surfaces stay clean.
|
|
53
|
+
`dist/` and `coverage/` remain git-ignored (already present in `.gitignore`).
|
|
54
|
+
|
|
55
|
+
## Follow-up (requires owner approval)
|
|
56
|
+
|
|
57
|
+
- `git filter-repo --strip-blobs-bigger-than 1M` (or an explicit path list for
|
|
58
|
+
`readmeasset/` historical media + the stray `.pptx`/`.png`), then force-push
|
|
59
|
+
and re-clone guidance for all contributors.
|
|
60
|
+
- Move future README media to GitHub release assets or an external CDN instead
|
|
61
|
+
of committing binaries.
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
# ADR: Dark-only README SVG assets derived from the night-city theme
|
|
2
|
+
|
|
3
|
+
- Status: accepted
|
|
4
|
+
- Date: 2026-06-10
|
|
5
|
+
- Owners: OMK theme contract lane (T4)
|
|
6
|
+
- Related: `themes/night-city.theme.json`, `scripts/assets-build.mjs`, `scripts/theme-check.mjs`, `proof/theme-2026-06-10/t1-t2-summary.md`
|
|
7
|
+
|
|
8
|
+
## Context
|
|
9
|
+
|
|
10
|
+
OMK ships a single `omk.theme.v1` theme — `night-city` (`mode: dark`) — as the source of
|
|
11
|
+
truth for all branded surfaces. Every foreground/background pair in that theme is
|
|
12
|
+
contrast-gated by `npm run theme:check` (text ≥ 4.5, indicator ≥ 3.0; 48 pairs, 0 failed),
|
|
13
|
+
and the gate blocks merge in CI. The 5 README SVG assets
|
|
14
|
+
(`readmeasset/omk-{badges,core-loop,evidence-ledger,logo-mark,provider-lanes}.svg`) are now
|
|
15
|
+
derived from that theme's primitives by `npm run assets:build`, which embeds a
|
|
16
|
+
`derived-from: omk.theme.v1/night-city@<hash>` provenance comment per SVG.
|
|
17
|
+
|
|
18
|
+
A light variant of the assets was considered for GitHub light-mode READMEs. There is no
|
|
19
|
+
light theme file, no light contrast matrix, and no reviewed light palette — generating one
|
|
20
|
+
by naive color inversion would ship pairs that were never gated.
|
|
21
|
+
|
|
22
|
+
## Decision
|
|
23
|
+
|
|
24
|
+
Do **not** build a light variant. Assets are dark-only and derive exclusively from the
|
|
25
|
+
single contrast-gated dark theme.
|
|
26
|
+
|
|
27
|
+
`scripts/assets-build.mjs` enforces this: it refuses any theme with `mode` other than
|
|
28
|
+
`dark` unless every foreground/background token pair actually used by the SVGs passes the
|
|
29
|
+
same 4.5/3.0 WCAG gates inline (the same model `theme:check` applies). The inline gate
|
|
30
|
+
also runs for dark themes, so a drifted primitive cannot silently ship an unreadable
|
|
31
|
+
asset.
|
|
32
|
+
|
|
33
|
+
## Consequences
|
|
34
|
+
|
|
35
|
+
- README assets render correctly on dark backgrounds only; light-mode viewers see the
|
|
36
|
+
dark cards as framed panels (each SVG paints its own `dark` background rect, so nothing
|
|
37
|
+
becomes unreadable on a light page).
|
|
38
|
+
- Introducing a light variant requires: a new `omk.theme.v1` theme file with
|
|
39
|
+
`mode: light`, a full `npm run theme:check` pass for that file, and only then will
|
|
40
|
+
`npm run assets:build --theme <file>` accept it (its inline used-pair gate must pass).
|
|
41
|
+
- Theme color changes propagate to assets only via `npm run assets:build`; the
|
|
42
|
+
`@<hash>` provenance suffix makes a stale asset detectable against the current theme
|
|
43
|
+
file hash.
|