初始化提交
Some checks failed
CI / Check / macos-latest (push) Has been cancelled
CI / Check / ubuntu-latest (push) Has been cancelled
CI / Check / windows-latest (push) Has been cancelled
CI / Test / macos-latest (push) Has been cancelled
CI / Test / ubuntu-latest (push) Has been cancelled
CI / Test / windows-latest (push) Has been cancelled
CI / Clippy (push) Has been cancelled
CI / Format (push) Has been cancelled
CI / Security Audit (push) Has been cancelled
CI / Secrets Scan (push) Has been cancelled
CI / Install Script Smoke Test (push) Has been cancelled

This commit is contained in:
iven
2026-03-01 16:24:24 +08:00
commit 92e5def702
492 changed files with 211343 additions and 0 deletions

View File

@@ -0,0 +1,164 @@
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 900 640" font-family="-apple-system,BlinkMacSystemFont,'Segoe UI',Roboto,Helvetica,Arial,sans-serif">
<defs>
<linearGradient id="kern" x1="0" y1="0" x2="0" y2="1">
<stop offset="0%" stop-color="#10b981"/>
<stop offset="100%" stop-color="#059669"/>
</linearGradient>
<linearGradient id="rt" x1="0" y1="0" x2="0" y2="1">
<stop offset="0%" stop-color="#3b82f6"/>
<stop offset="100%" stop-color="#2563eb"/>
</linearGradient>
<linearGradient id="api" x1="0" y1="0" x2="0" y2="1">
<stop offset="0%" stop-color="#8b5cf6"/>
<stop offset="100%" stop-color="#7c3aed"/>
</linearGradient>
<linearGradient id="ch" x1="0" y1="0" x2="0" y2="1">
<stop offset="0%" stop-color="#f59e0b"/>
<stop offset="100%" stop-color="#d97706"/>
</linearGradient>
<linearGradient id="mem" x1="0" y1="0" x2="0" y2="1">
<stop offset="0%" stop-color="#ec4899"/>
<stop offset="100%" stop-color="#db2777"/>
</linearGradient>
<linearGradient id="ext" x1="0" y1="0" x2="0" y2="1">
<stop offset="0%" stop-color="#06b6d4"/>
<stop offset="100%" stop-color="#0891b2"/>
</linearGradient>
</defs>
<!-- Background -->
<rect width="900" height="640" rx="12" fill="#0f172a"/>
<!-- Title -->
<text x="450" y="32" text-anchor="middle" fill="#f1f5f9" font-size="18" font-weight="700">OpenFang — Agent Operating System Architecture</text>
<text x="450" y="50" text-anchor="middle" fill="#64748b" font-size="11">14 crates | 137K lines of Rust | single binary</text>
<!-- === User Layer === -->
<rect x="30" y="65" width="840" height="55" rx="8" fill="#1e293b" stroke="#334155" stroke-width="1"/>
<text x="50" y="82" fill="#94a3b8" font-size="9" font-weight="600" letter-spacing="1">USER SPACE</text>
<rect x="50" y="90" width="120" height="24" rx="4" fill="#334155"/>
<text x="110" y="106" text-anchor="middle" fill="#e2e8f0" font-size="10" font-weight="600">Desktop (Tauri)</text>
<rect x="185" y="90" width="90" height="24" rx="4" fill="#334155"/>
<text x="230" y="106" text-anchor="middle" fill="#e2e8f0" font-size="10" font-weight="600">CLI + TUI</text>
<rect x="290" y="90" width="90" height="24" rx="4" fill="#334155"/>
<text x="335" y="106" text-anchor="middle" fill="#e2e8f0" font-size="10" font-weight="600">Web Dashboard</text>
<rect x="395" y="90" width="90" height="24" rx="4" fill="#334155"/>
<text x="440" y="106" text-anchor="middle" fill="#e2e8f0" font-size="10" font-weight="600">JS/Python SDK</text>
<rect x="500" y="90" width="130" height="24" rx="4" fill="#334155"/>
<text x="565" y="106" text-anchor="middle" fill="#e2e8f0" font-size="10" font-weight="600">OpenAI-compat API</text>
<rect x="645" y="90" width="70" height="24" rx="4" fill="#334155"/>
<text x="680" y="106" text-anchor="middle" fill="#e2e8f0" font-size="10" font-weight="600">MCP</text>
<rect x="730" y="90" width="60" height="24" rx="4" fill="#334155"/>
<text x="760" y="106" text-anchor="middle" fill="#e2e8f0" font-size="10" font-weight="600">A2A</text>
<!-- Arrow down -->
<line x1="450" y1="120" x2="450" y2="135" stroke="#475569" stroke-width="2" marker-end="url(#arrowhead)"/>
<!-- === API Layer === -->
<rect x="30" y="135" width="840" height="70" rx="8" fill="url(#api)" opacity="0.15" stroke="#8b5cf6" stroke-width="1"/>
<text x="50" y="153" fill="#a78bfa" font-size="9" font-weight="600" letter-spacing="1">API GATEWAY — openfang-api</text>
<text x="50" y="172" fill="#c4b5fd" font-size="10">140 REST endpoints | WebSocket streaming | SSE events | GCRA rate limiter</text>
<text x="50" y="189" fill="#c4b5fd" font-size="10">Security headers (CSP/HSTS) | CORS | Health redaction | File uploads | Approval queue</text>
<!-- Arrow down -->
<line x1="450" y1="205" x2="450" y2="218" stroke="#475569" stroke-width="2"/>
<!-- === Kernel Layer === -->
<rect x="30" y="218" width="840" height="85" rx="8" fill="url(#kern)" opacity="0.15" stroke="#10b981" stroke-width="1.5"/>
<text x="50" y="237" fill="#34d399" font-size="9" font-weight="600" letter-spacing="1">KERNEL — openfang-kernel</text>
<rect x="50" y="245" width="95" height="20" rx="3" fill="#10b98133"/>
<text x="97" y="259" text-anchor="middle" fill="#a7f3d0" font-size="9">Agent Registry</text>
<rect x="152" y="245" width="75" height="20" rx="3" fill="#10b98133"/>
<text x="189" y="259" text-anchor="middle" fill="#a7f3d0" font-size="9">Scheduler</text>
<rect x="234" y="245" width="85" height="20" rx="3" fill="#10b98133"/>
<text x="276" y="259" text-anchor="middle" fill="#a7f3d0" font-size="9">Capabilities</text>
<rect x="326" y="245" width="85" height="20" rx="3" fill="#10b98133"/>
<text x="368" y="259" text-anchor="middle" fill="#a7f3d0" font-size="9">Workflow Eng</text>
<rect x="418" y="245" width="70" height="20" rx="3" fill="#10b98133"/>
<text x="453" y="259" text-anchor="middle" fill="#a7f3d0" font-size="9">RBAC Auth</text>
<rect x="495" y="245" width="75" height="20" rx="3" fill="#10b98133"/>
<text x="532" y="259" text-anchor="middle" fill="#a7f3d0" font-size="9">Metering</text>
<rect x="577" y="245" width="70" height="20" rx="3" fill="#10b98133"/>
<text x="612" y="259" text-anchor="middle" fill="#a7f3d0" font-size="9">EventBus</text>
<rect x="654" y="245" width="70" height="20" rx="3" fill="#10b98133"/>
<text x="689" y="259" text-anchor="middle" fill="#a7f3d0" font-size="9">Heartbeat</text>
<rect x="731" y="245" width="60" height="20" rx="3" fill="#10b98133"/>
<text x="761" y="259" text-anchor="middle" fill="#a7f3d0" font-size="9">Wizard</text>
<rect x="50" y="272" width="95" height="20" rx="3" fill="#10b98133"/>
<text x="97" y="286" text-anchor="middle" fill="#a7f3d0" font-size="9">Hot Reload</text>
<rect x="152" y="272" width="95" height="20" rx="3" fill="#10b98133"/>
<text x="199" y="286" text-anchor="middle" fill="#a7f3d0" font-size="9">Budget Manager</text>
<rect x="254" y="272" width="85" height="20" rx="3" fill="#10b98133"/>
<text x="296" y="286" text-anchor="middle" fill="#a7f3d0" font-size="9">Approvals</text>
<rect x="346" y="272" width="100" height="20" rx="3" fill="#10b98133"/>
<text x="396" y="286" text-anchor="middle" fill="#a7f3d0" font-size="9">Device Pairing</text>
<rect x="453" y="272" width="105" height="20" rx="3" fill="#10b98133"/>
<text x="505" y="286" text-anchor="middle" fill="#a7f3d0" font-size="9">Graceful Shutdown</text>
<rect x="565" y="272" width="110" height="20" rx="3" fill="#10b98133"/>
<text x="620" y="286" text-anchor="middle" fill="#a7f3d0" font-size="9">Circuit Breakers</text>
<!-- Arrow down to runtime and channels -->
<line x1="300" y1="303" x2="300" y2="318" stroke="#475569" stroke-width="2"/>
<line x1="600" y1="303" x2="600" y2="318" stroke="#475569" stroke-width="2"/>
<!-- === Runtime (left) === -->
<rect x="30" y="318" width="420" height="110" rx="8" fill="url(#rt)" opacity="0.12" stroke="#3b82f6" stroke-width="1"/>
<text x="50" y="337" fill="#60a5fa" font-size="9" font-weight="600" letter-spacing="1">RUNTIME — openfang-runtime</text>
<text x="50" y="354" fill="#93c5fd" font-size="10">Agent loop (streaming) | 3 LLM drivers | 53 tools</text>
<text x="50" y="369" fill="#93c5fd" font-size="10">WASM sandbox (dual metering) | MCP client/server</text>
<text x="50" y="384" fill="#93c5fd" font-size="10">Loop guard | Session repair | Auth cooldown</text>
<text x="50" y="399" fill="#93c5fd" font-size="10">Web search (4 engines) | Browser automation</text>
<text x="50" y="414" fill="#93c5fd" font-size="10">TTS/STT | Image gen | Docker sandbox | Compactor</text>
<!-- === Channels + Skills (right) === -->
<rect x="460" y="318" width="200" height="110" rx="8" fill="url(#ch)" opacity="0.12" stroke="#f59e0b" stroke-width="1"/>
<text x="480" y="337" fill="#fbbf24" font-size="9" font-weight="600" letter-spacing="1">CHANNELS</text>
<text x="480" y="354" fill="#fde68a" font-size="10">40 adapters</text>
<text x="480" y="369" fill="#fde68a" font-size="10">Bridge + Router</text>
<text x="480" y="384" fill="#fde68a" font-size="10">Rate limiter</text>
<text x="480" y="399" fill="#fde68a" font-size="10">DM/group policy</text>
<text x="480" y="414" fill="#fde68a" font-size="10">Formatter</text>
<rect x="670" y="318" width="200" height="110" rx="8" fill="url(#ext)" opacity="0.12" stroke="#06b6d4" stroke-width="1"/>
<text x="690" y="337" fill="#22d3ee" font-size="9" font-weight="600" letter-spacing="1">SKILLS + HANDS</text>
<text x="690" y="354" fill="#a5f3fc" font-size="10">60 bundled skills</text>
<text x="690" y="369" fill="#a5f3fc" font-size="10">7 autonomous Hands</text>
<text x="690" y="384" fill="#a5f3fc" font-size="10">SKILL.md parser</text>
<text x="690" y="399" fill="#a5f3fc" font-size="10">FangHub marketplace</text>
<text x="690" y="414" fill="#a5f3fc" font-size="10">Injection scanner</text>
<!-- Arrow down to memory -->
<line x1="450" y1="428" x2="450" y2="443" stroke="#475569" stroke-width="2"/>
<!-- === Memory Layer === -->
<rect x="30" y="443" width="540" height="60" rx="8" fill="url(#mem)" opacity="0.12" stroke="#ec4899" stroke-width="1"/>
<text x="50" y="462" fill="#f472b6" font-size="9" font-weight="600" letter-spacing="1">MEMORY — openfang-memory</text>
<text x="50" y="479" fill="#fbcfe8" font-size="10">SQLite (KV + relational) | Vector embeddings | Usage tracking | Canonical sessions | JSONL mirror</text>
<text x="50" y="494" fill="#fbcfe8" font-size="10">Schema v7 | Session compaction | Knowledge graphs</text>
<!-- === Extensions Layer === -->
<rect x="580" y="443" width="290" height="60" rx="8" fill="#1e293b" stroke="#475569" stroke-width="1"/>
<text x="600" y="462" fill="#94a3b8" font-size="9" font-weight="600" letter-spacing="1">EXTENSIONS</text>
<text x="600" y="479" fill="#cbd5e1" font-size="10">25 MCP templates | AES-256 vault</text>
<text x="600" y="494" fill="#cbd5e1" font-size="10">OAuth2 PKCE | Health monitor</text>
<!-- === Foundation Layer === -->
<rect x="30" y="515" width="840" height="55" rx="8" fill="#1e293b" stroke="#334155" stroke-width="1"/>
<text x="50" y="534" fill="#94a3b8" font-size="9" font-weight="600" letter-spacing="1">FOUNDATION</text>
<rect x="50" y="541" width="110" height="22" rx="3" fill="#334155"/>
<text x="105" y="556" text-anchor="middle" fill="#e2e8f0" font-size="9">openfang-types</text>
<rect x="170" y="541" width="100" height="22" rx="3" fill="#334155"/>
<text x="220" y="556" text-anchor="middle" fill="#e2e8f0" font-size="9">openfang-wire</text>
<rect x="280" y="541" width="120" height="22" rx="3" fill="#334155"/>
<text x="340" y="556" text-anchor="middle" fill="#e2e8f0" font-size="9">openfang-migrate</text>
<rect x="410" y="541" width="110" height="22" rx="3" fill="#334155"/>
<text x="465" y="556" text-anchor="middle" fill="#e2e8f0" font-size="9">openfang-hands</text>
<rect x="530" y="541" width="130" height="22" rx="3" fill="#334155"/>
<text x="595" y="556" text-anchor="middle" fill="#e2e8f0" font-size="9">openfang-extensions</text>
<!-- Footer -->
<text x="450" y="598" text-anchor="middle" fill="#475569" font-size="10">Taint tracking | Ed25519 manifests | Merkle audit | SSRF protection | Zeroizing secrets</text>
<text x="450" y="614" text-anchor="middle" fill="#475569" font-size="10">OFP mutual auth | Path traversal prevention | Subprocess sandbox | Prompt injection scanning</text>
<text x="450" y="630" text-anchor="middle" fill="#334155" font-size="9">16 independent security systems woven through every layer</text>
</svg>

After

Width:  |  Height:  |  Size: 11 KiB