๐Ÿ“ฆ RightNow-AI / openfang

๐Ÿ“„ architecture-overview.svg ยท 164 lines
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
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>