multica/docs/architecture.drawio
Jiayuan Zhang 1bfd206217
docs: add architecture and module diagram (draw.io) (#180)
Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-15 01:09:26 +08:00

433 lines
40 KiB
Text

<mxfile host="app.diagrams.net" modified="2026-02-15T00:00:00.000Z" agent="Claude" version="24.0.0" type="device">
<diagram id="multica-architecture" name="Architecture Overview">
<mxGraphModel dx="2400" dy="1600" grid="1" gridSize="10" guides="1" tooltips="1" connect="1" arrows="1" fold="1" page="0" pageScale="1" pageWidth="3300" pageHeight="2400" math="0" shadow="0">
<root>
<mxCell id="0" />
<mxCell id="1" parent="0" />
<!-- ==================== TITLE ==================== -->
<mxCell id="title" value="Super Multica — Architecture &amp; Module Map" style="text;html=1;fontSize=24;fontStyle=1;align=center;verticalAlign=middle;whiteSpace=wrap;fontFamily=Helvetica;fontColor=#1a1a2e;" vertex="1" parent="1">
<mxGeometry x="400" y="20" width="800" height="40" as="geometry" />
</mxCell>
<!-- ==================== APPS LAYER ==================== -->
<mxCell id="apps-group" value="Apps Layer" style="rounded=1;whiteSpace=wrap;html=1;fillColor=#f0f4ff;strokeColor=#4361ee;strokeWidth=2;fontSize=14;fontStyle=1;verticalAlign=top;align=left;spacingLeft=10;spacingTop=5;arcSize=8;fontColor=#4361ee;dashed=0;" vertex="1" parent="1">
<mxGeometry x="40" y="80" width="1530" height="260" as="geometry" />
</mxCell>
<!-- Desktop App -->
<mxCell id="desktop" value="Desktop App" style="rounded=1;whiteSpace=wrap;html=1;fillColor=#4361ee;strokeColor=#3a56d4;fontSize=13;fontStyle=1;fontColor=#ffffff;arcSize=12;" vertex="1" parent="1">
<mxGeometry x="70" y="120" width="340" height="40" as="geometry" />
</mxCell>
<mxCell id="desktop-main" value="Main Process (Electron)&#xa;├ IPC Handlers (14+ modules)&#xa;├ System Tray&#xa;└ Auto Updater" style="rounded=1;whiteSpace=wrap;html=1;fillColor=#e8edff;strokeColor=#4361ee;fontSize=11;align=left;spacingLeft=10;arcSize=8;fontColor=#333;" vertex="1" parent="1">
<mxGeometry x="70" y="170" width="165" height="80" as="geometry" />
</mxCell>
<mxCell id="desktop-renderer" value="Renderer (React 19)&#xa;├ Zustand Stores (9)&#xa;├ Chat Interface&#xa;└ Settings / Dashboard" style="rounded=1;whiteSpace=wrap;html=1;fillColor=#e8edff;strokeColor=#4361ee;fontSize=11;align=left;spacingLeft=10;arcSize=8;fontColor=#333;" vertex="1" parent="1">
<mxGeometry x="245" y="170" width="165" height="80" as="geometry" />
</mxCell>
<mxCell id="desktop-ipc-arrow" value="" style="endArrow=classic;startArrow=classic;html=1;strokeColor=#4361ee;exitX=1;exitY=0.5;exitDx=0;exitDy=0;entryX=0;entryY=0.5;entryDx=0;entryDy=0;" edge="1" parent="1" source="desktop-main" target="desktop-renderer">
<mxGeometry relative="1" as="geometry" />
</mxCell>
<mxCell id="desktop-ipc-label" value="IPC" style="edgeLabel;html=1;align=center;verticalAlign=middle;fontSize=9;fontColor=#4361ee;fontStyle=1;" vertex="1" connectable="0" parent="desktop-ipc-arrow">
<mxGeometry x="-0.1" relative="1" as="geometry">
<mxPoint as="offset" />
</mxGeometry>
</mxCell>
<mxCell id="desktop-tag" value="@multica/desktop · Electron + Vite" style="text;html=1;fontSize=9;fontColor=#888;align=center;" vertex="1" parent="1">
<mxGeometry x="70" y="255" width="340" height="16" as="geometry" />
</mxCell>
<!-- Gateway -->
<mxCell id="gateway" value="Gateway" style="rounded=1;whiteSpace=wrap;html=1;fillColor=#7209b7;strokeColor=#5a078f;fontSize=13;fontStyle=1;fontColor=#ffffff;arcSize=12;" vertex="1" parent="1">
<mxGeometry x="440" y="120" width="240" height="40" as="geometry" />
</mxCell>
<mxCell id="gateway-detail" value="NestJS WebSocket Server&#xa;├ Socket.io (port 3000)&#xa;├ Device Registration&#xa;├ RPC Message Routing&#xa;├ Heartbeat (25s ping)&#xa;└ Telegram Channel" style="rounded=1;whiteSpace=wrap;html=1;fillColor=#f3e8ff;strokeColor=#7209b7;fontSize=11;align=left;spacingLeft=10;arcSize=8;fontColor=#333;" vertex="1" parent="1">
<mxGeometry x="440" y="170" width="240" height="100" as="geometry" />
</mxCell>
<mxCell id="gateway-tag" value="@multica/gateway · NestJS + Socket.io" style="text;html=1;fontSize=9;fontColor=#888;align=center;" vertex="1" parent="1">
<mxGeometry x="440" y="275" width="240" height="16" as="geometry" />
</mxCell>
<!-- Web App -->
<mxCell id="web" value="Web App" style="rounded=1;whiteSpace=wrap;html=1;fillColor=#f72585;strokeColor=#d01f6e;fontSize=13;fontStyle=1;fontColor=#ffffff;arcSize=12;" vertex="1" parent="1">
<mxGeometry x="710" y="120" width="200" height="40" as="geometry" />
</mxCell>
<mxCell id="web-detail" value="Next.js 16 + React 19&#xa;├ App Router&#xa;├ Gateway Client (SDK)&#xa;└ Zustand Store" style="rounded=1;whiteSpace=wrap;html=1;fillColor=#ffe0ef;strokeColor=#f72585;fontSize=11;align=left;spacingLeft=10;arcSize=8;fontColor=#333;" vertex="1" parent="1">
<mxGeometry x="710" y="170" width="200" height="75" as="geometry" />
</mxCell>
<mxCell id="web-tag" value="@multica/web · Next.js 16" style="text;html=1;fontSize=9;fontColor=#888;align=center;" vertex="1" parent="1">
<mxGeometry x="710" y="250" width="200" height="16" as="geometry" />
</mxCell>
<!-- CLI -->
<mxCell id="cli" value="CLI" style="rounded=1;whiteSpace=wrap;html=1;fillColor=#ff6d00;strokeColor=#e06200;fontSize=13;fontStyle=1;fontColor=#ffffff;arcSize=12;" vertex="1" parent="1">
<mxGeometry x="940" y="120" width="200" height="40" as="geometry" />
</mxCell>
<mxCell id="cli-detail" value="Interactive &amp; Non-interactive&#xa;├ run / chat / session&#xa;├ profile / skills / tools&#xa;├ credentials / cron / dev&#xa;└ Autocomplete + Help" style="rounded=1;whiteSpace=wrap;html=1;fillColor=#fff3e0;strokeColor=#ff6d00;fontSize=11;align=left;spacingLeft=10;arcSize=8;fontColor=#333;" vertex="1" parent="1">
<mxGeometry x="940" y="170" width="200" height="85" as="geometry" />
</mxCell>
<mxCell id="cli-tag" value="@multica/cli · Node.js" style="text;html=1;fontSize=9;fontColor=#888;align=center;" vertex="1" parent="1">
<mxGeometry x="940" y="260" width="200" height="16" as="geometry" />
</mxCell>
<!-- Mobile -->
<mxCell id="mobile" value="Mobile" style="rounded=1;whiteSpace=wrap;html=1;fillColor=#06d6a0;strokeColor=#05b88a;fontSize=13;fontStyle=1;fontColor=#ffffff;arcSize=12;" vertex="1" parent="1">
<mxGeometry x="1170" y="120" width="170" height="40" as="geometry" />
</mxCell>
<mxCell id="mobile-detail" value="React Native&#xa;└ (In Development)" style="rounded=1;whiteSpace=wrap;html=1;fillColor=#e0fff5;strokeColor=#06d6a0;fontSize=11;align=left;spacingLeft=10;arcSize=8;fontColor=#333;" vertex="1" parent="1">
<mxGeometry x="1170" y="170" width="170" height="45" as="geometry" />
</mxCell>
<mxCell id="mobile-tag" value="@multica/mobile · React Native" style="text;html=1;fontSize=9;fontColor=#888;align=center;" vertex="1" parent="1">
<mxGeometry x="1170" y="220" width="170" height="16" as="geometry" />
</mxCell>
<!-- Server -->
<mxCell id="server" value="Server" style="rounded=1;whiteSpace=wrap;html=1;fillColor=#adb5bd;strokeColor=#868e96;fontSize=13;fontStyle=1;fontColor=#ffffff;arcSize=12;" vertex="1" parent="1">
<mxGeometry x="1370" y="120" width="170" height="40" as="geometry" />
</mxCell>
<mxCell id="server-detail" value="NestJS REST API&#xa;└ Port 4000 (Legacy)" style="rounded=1;whiteSpace=wrap;html=1;fillColor=#f1f3f5;strokeColor=#adb5bd;fontSize=11;align=left;spacingLeft=10;arcSize=8;fontColor=#333;" vertex="1" parent="1">
<mxGeometry x="1370" y="170" width="170" height="45" as="geometry" />
</mxCell>
<!-- ==================== CONNECTION ARROWS (Apps → Core) ==================== -->
<!-- Desktop → Hub (embedded) -->
<mxCell id="arrow-desktop-hub" value="" style="endArrow=classic;html=1;strokeColor=#4361ee;strokeWidth=2;exitX=0.5;exitY=1;exitDx=0;exitDy=0;entryX=0.15;entryY=0;entryDx=0;entryDy=0;" edge="1" parent="1" source="desktop-main" target="core-group">
<mxGeometry relative="1" as="geometry" />
</mxCell>
<mxCell id="arrow-desktop-hub-label" value="Embedded Hub" style="edgeLabel;html=1;align=center;verticalAlign=middle;fontSize=10;fontColor=#4361ee;fontStyle=1;labelBackgroundColor=#ffffff;" vertex="1" connectable="0" parent="arrow-desktop-hub">
<mxGeometry x="0.2" relative="1" as="geometry">
<mxPoint as="offset" />
</mxGeometry>
</mxCell>
<!-- Web → Gateway (Socket.io) -->
<mxCell id="arrow-web-gateway" value="" style="endArrow=classic;startArrow=classic;html=1;strokeColor=#f72585;strokeWidth=2;exitX=0;exitY=0.5;exitDx=0;exitDy=0;entryX=1;entryY=0.3;entryDx=0;entryDy=0;" edge="1" parent="1" source="web-detail" target="gateway-detail">
<mxGeometry relative="1" as="geometry" />
</mxCell>
<mxCell id="arrow-web-gateway-label" value="Socket.io" style="edgeLabel;html=1;align=center;verticalAlign=middle;fontSize=10;fontColor=#f72585;fontStyle=1;labelBackgroundColor=#ffffff;" vertex="1" connectable="0" parent="arrow-web-gateway">
<mxGeometry relative="1" as="geometry">
<mxPoint as="offset" />
</mxGeometry>
</mxCell>
<!-- Gateway → Hub -->
<mxCell id="arrow-gateway-hub" value="" style="endArrow=classic;html=1;strokeColor=#7209b7;strokeWidth=2;exitX=0.5;exitY=1;exitDx=0;exitDy=0;entryX=0.35;entryY=0;entryDx=0;entryDy=0;" edge="1" parent="1" source="gateway-detail" target="core-group">
<mxGeometry relative="1" as="geometry" />
</mxCell>
<mxCell id="arrow-gateway-hub-label" value="RPC" style="edgeLabel;html=1;align=center;verticalAlign=middle;fontSize=10;fontColor=#7209b7;fontStyle=1;labelBackgroundColor=#ffffff;" vertex="1" connectable="0" parent="arrow-gateway-hub">
<mxGeometry relative="1" as="geometry">
<mxPoint as="offset" />
</mxGeometry>
</mxCell>
<!-- CLI → Core -->
<mxCell id="arrow-cli-core" value="" style="endArrow=classic;html=1;strokeColor=#ff6d00;strokeWidth=2;exitX=0.5;exitY=1;exitDx=0;exitDy=0;entryX=0.85;entryY=0;entryDx=0;entryDy=0;" edge="1" parent="1" source="cli-detail" target="core-group">
<mxGeometry relative="1" as="geometry" />
</mxCell>
<mxCell id="arrow-cli-core-label" value="Direct Import" style="edgeLabel;html=1;align=center;verticalAlign=middle;fontSize=10;fontColor=#ff6d00;fontStyle=1;labelBackgroundColor=#ffffff;" vertex="1" connectable="0" parent="arrow-cli-core">
<mxGeometry relative="1" as="geometry">
<mxPoint as="offset" />
</mxGeometry>
</mxCell>
<!-- ==================== CORE PACKAGE ==================== -->
<mxCell id="core-group" value="@multica/core — Core Engine" style="rounded=1;whiteSpace=wrap;html=1;fillColor=#fff8f0;strokeColor=#e76f51;strokeWidth=2;fontSize=14;fontStyle=1;verticalAlign=top;align=left;spacingLeft=10;spacingTop=5;arcSize=6;fontColor=#e76f51;" vertex="1" parent="1">
<mxGeometry x="40" y="370" width="1530" height="590" as="geometry" />
</mxCell>
<!-- Hub -->
<mxCell id="hub" value="Hub" style="rounded=1;whiteSpace=wrap;html=1;fillColor=#e76f51;strokeColor=#d05a3e;fontSize=13;fontStyle=1;fontColor=#ffffff;arcSize=10;" vertex="1" parent="1">
<mxGeometry x="70" y="410" width="350" height="35" as="geometry" />
</mxCell>
<mxCell id="hub-detail" value="Multi-Agent Coordination&#xa;&#xa;├ Agent Manager — create / delete / list agents&#xa;├ RPC Dispatcher — 12+ handlers for remote ops&#xa;├ Gateway Client — Socket.io ↔ remote devices&#xa;├ Agent Store — persistent agent list (JSON)&#xa;├ Device Store — device metadata&#xa;├ Auth Store — Hub authentication tokens&#xa;├ Exec Approval Manager — tool approval flow&#xa;├ Message Aggregator — message coalescing&#xa;└ Block Chunker — large payload chunking" style="rounded=1;whiteSpace=wrap;html=1;fillColor=#fef0eb;strokeColor=#e76f51;fontSize=11;align=left;spacingLeft=10;arcSize=6;fontColor=#333;verticalAlign=top;spacingTop=6;" vertex="1" parent="1">
<mxGeometry x="70" y="455" width="350" height="180" as="geometry" />
</mxCell>
<!-- Agent Engine -->
<mxCell id="agent-engine" value="Agent Engine" style="rounded=1;whiteSpace=wrap;html=1;fillColor=#264653;strokeColor=#1d3740;fontSize=13;fontStyle=1;fontColor=#ffffff;arcSize=10;" vertex="1" parent="1">
<mxGeometry x="450" y="410" width="530" height="35" as="geometry" />
</mxCell>
<mxCell id="agent-runner" value="Agent Runner&#xa;├ Agent (sync orchestrator)&#xa;├ AsyncAgent (event-driven)&#xa;├ SyncAgent (blocking)&#xa;├ pi-agent-core integration&#xa;└ Run Log (JSONL debug)" style="rounded=1;whiteSpace=wrap;html=1;fillColor=#e8f4f0;strokeColor=#264653;fontSize=11;align=left;spacingLeft=10;arcSize=6;fontColor=#333;verticalAlign=top;spacingTop=6;" vertex="1" parent="1">
<mxGeometry x="450" y="455" width="165" height="105" as="geometry" />
</mxCell>
<mxCell id="agent-session" value="Session Manager&#xa;├ JSONL Persistence&#xa;├ Compaction (3 modes)&#xa;│ ├ Count-based&#xa;│ ├ Token-aware&#xa;│ └ Summary (LLM)&#xa;├ File Repair&#xa;├ Write Lock&#xa;└ UUIDv7 IDs" style="rounded=1;whiteSpace=wrap;html=1;fillColor=#e8f4f0;strokeColor=#264653;fontSize=11;align=left;spacingLeft=10;arcSize=6;fontColor=#333;verticalAlign=top;spacingTop=6;" vertex="1" parent="1">
<mxGeometry x="625" y="455" width="165" height="150" as="geometry" />
</mxCell>
<mxCell id="agent-ctx" value="Context Window Guard&#xa;├ Token Estimation&#xa;├ Budget Enforcement&#xa;├ LLM Summarization&#xa;├ Tool Result Pruning&#xa;└ Compaction Metadata" style="rounded=1;whiteSpace=wrap;html=1;fillColor=#e8f4f0;strokeColor=#264653;fontSize=11;align=left;spacingLeft=10;arcSize=6;fontColor=#333;verticalAlign=top;spacingTop=6;" vertex="1" parent="1">
<mxGeometry x="800" y="455" width="175" height="105" as="geometry" />
</mxCell>
<!-- System Prompt -->
<mxCell id="agent-prompt" value="System Prompt Builder&#xa;├ Dynamic Construction&#xa;├ Sections (tools, skills,&#xa;│ memory, channels)&#xa;├ Constitution (safety)&#xa;└ Runtime Info" style="rounded=1;whiteSpace=wrap;html=1;fillColor=#e8f4f0;strokeColor=#264653;fontSize=11;align=left;spacingLeft=10;arcSize=6;fontColor=#333;verticalAlign=top;spacingTop=6;" vertex="1" parent="1">
<mxGeometry x="450" y="570" width="165" height="105" as="geometry" />
</mxCell>
<!-- Providers -->
<mxCell id="providers" value="LLM Providers" style="rounded=1;whiteSpace=wrap;html=1;fillColor=#264653;strokeColor=#1d3740;fontSize=13;fontStyle=1;fontColor=#ffffff;arcSize=10;" vertex="1" parent="1">
<mxGeometry x="1010" y="410" width="230" height="35" as="geometry" />
</mxCell>
<mxCell id="providers-detail" value="Multi-Provider Registry&#xa;&#xa;├ Anthropic (Claude)&#xa;├ OpenAI (GPT / o-series)&#xa;├ Google (Gemini)&#xa;├ DeepSeek&#xa;├ Kimi (Moonshot)&#xa;├ Groq&#xa;├ Mistral&#xa;├ Together&#xa;├ OpenRouter&#xa;└ xAI (Grok)" style="rounded=1;whiteSpace=wrap;html=1;fillColor=#e8f4f0;strokeColor=#264653;fontSize=11;align=left;spacingLeft=10;arcSize=6;fontColor=#333;verticalAlign=top;spacingTop=6;" vertex="1" parent="1">
<mxGeometry x="1010" y="455" width="145" height="185" as="geometry" />
</mxCell>
<!-- Auth Profiles -->
<mxCell id="auth-profiles" value="Auth Profiles&#xa;├ Multi-credential store&#xa;├ Rotation on error&#xa;├ Cooldown mechanism&#xa;├ OAuth support&#xa;└ API key resolution" style="rounded=1;whiteSpace=wrap;html=1;fillColor=#e8f4f0;strokeColor=#264653;fontSize=11;align=left;spacingLeft=10;arcSize=6;fontColor=#333;verticalAlign=top;spacingTop=6;" vertex="1" parent="1">
<mxGeometry x="1165" y="455" width="155" height="105" as="geometry" />
</mxCell>
<!-- Tools -->
<mxCell id="tools" value="Tools" style="rounded=1;whiteSpace=wrap;html=1;fillColor=#2a9d8f;strokeColor=#218778;fontSize=13;fontStyle=1;fontColor=#ffffff;arcSize=10;" vertex="1" parent="1">
<mxGeometry x="70" y="650" width="350" height="35" as="geometry" />
</mxCell>
<mxCell id="tools-detail" value="Tool Registry &amp; Execution&#xa;&#xa;├ Exec (shell commands)&#xa;│ ├ Safety Classification&#xa;│ ├ Approval Callbacks&#xa;│ └ Command Allowlist&#xa;├ Web Fetch &amp; Web Search&#xa;│ ├ SSRF Protection&#xa;│ └ Response Cache&#xa;├ File Glob&#xa;├ Memory Search&#xa;├ Sessions Spawn / List (subagents)&#xa;├ Cron Tool&#xa;├ Data / Finance APIs&#xa;├ Send File &amp; Image Resize&#xa;├ Process Management&#xa;└ Policy Engine&#xa; ├ Allow / Deny Lists&#xa; ├ Provider Overrides&#xa; └ Group Patterns (web:*, fs:*)" style="rounded=1;whiteSpace=wrap;html=1;fillColor=#e8f8f5;strokeColor=#2a9d8f;fontSize=11;align=left;spacingLeft=10;arcSize=6;fontColor=#333;verticalAlign=top;spacingTop=6;" vertex="1" parent="1">
<mxGeometry x="70" y="695" width="350" height="245" as="geometry" />
</mxCell>
<!-- Skills System -->
<mxCell id="skills-sys" value="Skills System" style="rounded=1;whiteSpace=wrap;html=1;fillColor=#e9c46a;strokeColor=#d4a843;fontSize=13;fontStyle=1;fontColor=#333;arcSize=10;" vertex="1" parent="1">
<mxGeometry x="450" y="690" width="170" height="35" as="geometry" />
</mxCell>
<mxCell id="skills-detail" value="Modular Skill Loader&#xa;├ YAML Frontmatter&#xa;├ Eligibility Filtering&#xa;│ (OS, binaries, configs)&#xa;├ Hot-Reload Watcher&#xa;├ GitHub Install&#xa;└ OpenClaw Compatible" style="rounded=1;whiteSpace=wrap;html=1;fillColor=#fdf6e3;strokeColor=#e9c46a;fontSize=11;align=left;spacingLeft=10;arcSize=6;fontColor=#333;verticalAlign=top;spacingTop=6;" vertex="1" parent="1">
<mxGeometry x="450" y="735" width="170" height="120" as="geometry" />
</mxCell>
<!-- Profile System -->
<mxCell id="profile-sys" value="Profile System" style="rounded=1;whiteSpace=wrap;html=1;fillColor=#e9c46a;strokeColor=#d4a843;fontSize=13;fontStyle=1;fontColor=#333;arcSize=10;" vertex="1" parent="1">
<mxGeometry x="640" y="690" width="170" height="35" as="geometry" />
</mxCell>
<mxCell id="profile-detail" value="Agent Identity &amp; Config&#xa;├ Soul (personality)&#xa;├ User info&#xa;├ Workspace context&#xa;├ Memory (long-term)&#xa;├ Heartbeat prompt&#xa;└ Config (YAML)" style="rounded=1;whiteSpace=wrap;html=1;fillColor=#fdf6e3;strokeColor=#e9c46a;fontSize=11;align=left;spacingLeft=10;arcSize=6;fontColor=#333;verticalAlign=top;spacingTop=6;" vertex="1" parent="1">
<mxGeometry x="640" y="735" width="170" height="120" as="geometry" />
</mxCell>
<!-- Subagent System -->
<mxCell id="subagent-sys" value="Subagent System" style="rounded=1;whiteSpace=wrap;html=1;fillColor=#e9c46a;strokeColor=#d4a843;fontSize=13;fontStyle=1;fontColor=#333;arcSize=10;" vertex="1" parent="1">
<mxGeometry x="840" y="690" width="180" height="35" as="geometry" />
</mxCell>
<mxCell id="subagent-detail" value="Child Agent Orchestration&#xa;├ Registry (lifecycle)&#xa;├ JSONL Persistence&#xa;├ Result Announcement&#xa;├ Coalesced Batching&#xa;├ Command Queue&#xa;└ Lane-based Concurrency" style="rounded=1;whiteSpace=wrap;html=1;fillColor=#fdf6e3;strokeColor=#e9c46a;fontSize=11;align=left;spacingLeft=10;arcSize=6;fontColor=#333;verticalAlign=top;spacingTop=6;" vertex="1" parent="1">
<mxGeometry x="840" y="735" width="180" height="120" as="geometry" />
</mxCell>
<!-- Cron System -->
<mxCell id="cron-sys" value="Cron" style="rounded=1;whiteSpace=wrap;html=1;fillColor=#e9c46a;strokeColor=#d4a843;fontSize=13;fontStyle=1;fontColor=#333;arcSize=10;" vertex="1" parent="1">
<mxGeometry x="1050" y="690" width="130" height="35" as="geometry" />
</mxCell>
<mxCell id="cron-detail" value="Scheduled Tasks&#xa;├ Cron Expressions&#xa;├ Job Execution&#xa;└ JSONL Storage" style="rounded=1;whiteSpace=wrap;html=1;fillColor=#fdf6e3;strokeColor=#e9c46a;fontSize=11;align=left;spacingLeft=10;arcSize=6;fontColor=#333;verticalAlign=top;spacingTop=6;" vertex="1" parent="1">
<mxGeometry x="1050" y="735" width="130" height="75" as="geometry" />
</mxCell>
<!-- Heartbeat -->
<mxCell id="heartbeat-sys" value="Heartbeat" style="rounded=1;whiteSpace=wrap;html=1;fillColor=#e9c46a;strokeColor=#d4a843;fontSize=13;fontStyle=1;fontColor=#333;arcSize=10;" vertex="1" parent="1">
<mxGeometry x="1200" y="690" width="130" height="35" as="geometry" />
</mxCell>
<mxCell id="heartbeat-detail" value="Always-On Agent&#xa;├ Periodic Runner&#xa;├ Wake-from-sleep&#xa;└ System Events" style="rounded=1;whiteSpace=wrap;html=1;fillColor=#fdf6e3;strokeColor=#e9c46a;fontSize=11;align=left;spacingLeft=10;arcSize=6;fontColor=#333;verticalAlign=top;spacingTop=6;" vertex="1" parent="1">
<mxGeometry x="1200" y="735" width="130" height="75" as="geometry" />
</mxCell>
<!-- Channels -->
<mxCell id="channels-sys" value="Channels" style="rounded=1;whiteSpace=wrap;html=1;fillColor=#e9c46a;strokeColor=#d4a843;fontSize=13;fontStyle=1;fontColor=#333;arcSize=10;" vertex="1" parent="1">
<mxGeometry x="1350" y="690" width="190" height="35" as="geometry" />
</mxCell>
<mxCell id="channels-detail" value="Messaging Integrations&#xa;├ Channel Manager&#xa;├ Plugin Registry&#xa;├ Inbound Debouncer&#xa;└ Telegram (via Gateway)" style="rounded=1;whiteSpace=wrap;html=1;fillColor=#fdf6e3;strokeColor=#e9c46a;fontSize=11;align=left;spacingLeft=10;arcSize=6;fontColor=#333;verticalAlign=top;spacingTop=6;" vertex="1" parent="1">
<mxGeometry x="1350" y="735" width="190" height="90" as="geometry" />
</mxCell>
<!-- Media -->
<mxCell id="media-sys" value="Media" style="rounded=1;whiteSpace=wrap;html=1;fillColor=#e9c46a;strokeColor=#d4a843;fontSize=11;fontStyle=1;fontColor=#333;arcSize=10;" vertex="1" parent="1">
<mxGeometry x="1350" y="835" width="190" height="30" as="geometry" />
</mxCell>
<mxCell id="media-detail" value="Image / Video / Audio&#xa;├ describe-image (LLM)&#xa;├ describe-video (frames)&#xa;└ transcribe (Whisper)" style="rounded=1;whiteSpace=wrap;html=1;fillColor=#fdf6e3;strokeColor=#e9c46a;fontSize=10;align=left;spacingLeft=10;arcSize=6;fontColor=#333;verticalAlign=top;spacingTop=4;" vertex="1" parent="1">
<mxGeometry x="1350" y="870" width="190" height="75" as="geometry" />
</mxCell>
<!-- Hub → Agent Engine arrow -->
<mxCell id="hub-agent-arrow" value="" style="endArrow=classic;startArrow=classic;html=1;strokeColor=#264653;strokeWidth=1.5;exitX=1;exitY=0.5;exitDx=0;exitDy=0;entryX=0;entryY=0.5;entryDx=0;entryDy=0;" edge="1" parent="1" source="hub" target="agent-engine">
<mxGeometry relative="1" as="geometry" />
</mxCell>
<mxCell id="hub-agent-label" value="manages" style="edgeLabel;html=1;align=center;verticalAlign=middle;fontSize=9;fontColor=#264653;fontStyle=2;" vertex="1" connectable="0" parent="hub-agent-arrow">
<mxGeometry relative="1" as="geometry">
<mxPoint as="offset" />
</mxGeometry>
</mxCell>
<!-- ==================== SHARED PACKAGES ==================== -->
<mxCell id="shared-group" value="Shared Packages" style="rounded=1;whiteSpace=wrap;html=1;fillColor=#f0fff4;strokeColor=#38b000;strokeWidth=2;fontSize=14;fontStyle=1;verticalAlign=top;align=left;spacingLeft=10;spacingTop=5;arcSize=6;fontColor=#38b000;" vertex="1" parent="1">
<mxGeometry x="40" y="990" width="1080" height="130" as="geometry" />
</mxCell>
<mxCell id="pkg-sdk" value="SDK&#xa;@multica/sdk&#xa;Gateway Client&#xa;Socket.io" style="rounded=1;whiteSpace=wrap;html=1;fillColor=#d4edda;strokeColor=#38b000;fontSize=11;align=center;arcSize=8;fontColor=#333;fontStyle=0;" vertex="1" parent="1">
<mxGeometry x="60" y="1025" width="130" height="75" as="geometry" />
</mxCell>
<mxCell id="pkg-ui" value="UI&#xa;@multica/ui&#xa;Shadcn + Radix&#xa;Tailwind v4" style="rounded=1;whiteSpace=wrap;html=1;fillColor=#d4edda;strokeColor=#38b000;fontSize=11;align=center;arcSize=8;fontColor=#333;fontStyle=0;" vertex="1" parent="1">
<mxGeometry x="210" y="1025" width="130" height="75" as="geometry" />
</mxCell>
<mxCell id="pkg-store" value="Store&#xa;@multica/store&#xa;Zustand" style="rounded=1;whiteSpace=wrap;html=1;fillColor=#d4edda;strokeColor=#38b000;fontSize=11;align=center;arcSize=8;fontColor=#333;fontStyle=0;" vertex="1" parent="1">
<mxGeometry x="360" y="1025" width="130" height="75" as="geometry" />
</mxCell>
<mxCell id="pkg-hooks" value="Hooks&#xa;@multica/hooks&#xa;React Hooks" style="rounded=1;whiteSpace=wrap;html=1;fillColor=#d4edda;strokeColor=#38b000;fontSize=11;align=center;arcSize=8;fontColor=#333;fontStyle=0;" vertex="1" parent="1">
<mxGeometry x="510" y="1025" width="130" height="75" as="geometry" />
</mxCell>
<mxCell id="pkg-types" value="Types&#xa;@multica/types&#xa;Shared TypeScript&#xa;Zero-dep" style="rounded=1;whiteSpace=wrap;html=1;fillColor=#d4edda;strokeColor=#38b000;fontSize=11;align=center;arcSize=8;fontColor=#333;fontStyle=0;" vertex="1" parent="1">
<mxGeometry x="660" y="1025" width="130" height="75" as="geometry" />
</mxCell>
<mxCell id="pkg-utils" value="Utils&#xa;@multica/utils&#xa;Paths, Retry&#xa;Errors, Device ID" style="rounded=1;whiteSpace=wrap;html=1;fillColor=#d4edda;strokeColor=#38b000;fontSize=11;align=center;arcSize=8;fontColor=#333;fontStyle=0;" vertex="1" parent="1">
<mxGeometry x="810" y="1025" width="140" height="75" as="geometry" />
</mxCell>
<mxCell id="pkg-utils2" value="Credentials&#xa;@multica/core&#xa;credentials.json5&#xa;skills.env.json5" style="rounded=1;whiteSpace=wrap;html=1;fillColor=#d4edda;strokeColor=#38b000;fontSize=11;align=center;arcSize=8;fontColor=#333;fontStyle=0;" vertex="1" parent="1">
<mxGeometry x="970" y="1025" width="130" height="75" as="geometry" />
</mxCell>
<!-- ==================== SKILLS LAYER ==================== -->
<mxCell id="skills-group" value="Bundled Skills" style="rounded=1;whiteSpace=wrap;html=1;fillColor=#fffde7;strokeColor=#f9a825;strokeWidth=2;fontSize=14;fontStyle=1;verticalAlign=top;align=left;spacingLeft=10;spacingTop=5;arcSize=6;fontColor=#f9a825;" vertex="1" parent="1">
<mxGeometry x="1150" y="990" width="420" height="130" as="geometry" />
</mxCell>
<mxCell id="skill-pdf" value="pdf" style="rounded=1;whiteSpace=wrap;html=1;fillColor=#fff9c4;strokeColor=#f9a825;fontSize=10;align=center;arcSize=10;fontColor=#333;" vertex="1" parent="1">
<mxGeometry x="1170" y="1025" width="55" height="30" as="geometry" />
</mxCell>
<mxCell id="skill-pptx" value="pptx" style="rounded=1;whiteSpace=wrap;html=1;fillColor=#fff9c4;strokeColor=#f9a825;fontSize=10;align=center;arcSize=10;fontColor=#333;" vertex="1" parent="1">
<mxGeometry x="1235" y="1025" width="55" height="30" as="geometry" />
</mxCell>
<mxCell id="skill-docx" value="docx" style="rounded=1;whiteSpace=wrap;html=1;fillColor=#fff9c4;strokeColor=#f9a825;fontSize=10;align=center;arcSize=10;fontColor=#333;" vertex="1" parent="1">
<mxGeometry x="1300" y="1025" width="55" height="30" as="geometry" />
</mxCell>
<mxCell id="skill-xlsx" value="xlsx" style="rounded=1;whiteSpace=wrap;html=1;fillColor=#fff9c4;strokeColor=#f9a825;fontSize=10;align=center;arcSize=10;fontColor=#333;" vertex="1" parent="1">
<mxGeometry x="1365" y="1025" width="55" height="30" as="geometry" />
</mxCell>
<mxCell id="skill-whisper" value="whisper" style="rounded=1;whiteSpace=wrap;html=1;fillColor=#fff9c4;strokeColor=#f9a825;fontSize=10;align=center;arcSize=10;fontColor=#333;" vertex="1" parent="1">
<mxGeometry x="1430" y="1025" width="55" height="30" as="geometry" />
</mxCell>
<mxCell id="skill-finance" value="finance-&#xa;research" style="rounded=1;whiteSpace=wrap;html=1;fillColor=#fff9c4;strokeColor=#f9a825;fontSize=10;align=center;arcSize=10;fontColor=#333;" vertex="1" parent="1">
<mxGeometry x="1495" y="1025" width="60" height="30" as="geometry" />
</mxCell>
<mxCell id="skill-profile" value="profile-&#xa;setup" style="rounded=1;whiteSpace=wrap;html=1;fillColor=#fff9c4;strokeColor=#f9a825;fontSize=10;align=center;arcSize=10;fontColor=#333;" vertex="1" parent="1">
<mxGeometry x="1170" y="1065" width="60" height="30" as="geometry" />
</mxCell>
<mxCell id="skill-creator" value="skill-&#xa;creator" style="rounded=1;whiteSpace=wrap;html=1;fillColor=#fff9c4;strokeColor=#f9a825;fontSize=10;align=center;arcSize=10;fontColor=#333;" vertex="1" parent="1">
<mxGeometry x="1240" y="1065" width="60" height="30" as="geometry" />
</mxCell>
<mxCell id="skill-earnings" value="earnings-&#xa;analysis" style="rounded=1;whiteSpace=wrap;html=1;fillColor=#fff9c4;strokeColor=#f9a825;fontSize=10;align=center;arcSize=10;fontColor=#333;" vertex="1" parent="1">
<mxGeometry x="1310" y="1065" width="60" height="30" as="geometry" />
</mxCell>
<mxCell id="skill-dcf" value="dcf-&#xa;valuation" style="rounded=1;whiteSpace=wrap;html=1;fillColor=#fff9c4;strokeColor=#f9a825;fontSize=10;align=center;arcSize=10;fontColor=#333;" vertex="1" parent="1">
<mxGeometry x="1380" y="1065" width="60" height="30" as="geometry" />
</mxCell>
<!-- ==================== DATA LAYER ==================== -->
<mxCell id="data-group" value="Persistent Storage (~/.super-multica/)" style="rounded=1;whiteSpace=wrap;html=1;fillColor=#f5f5f5;strokeColor=#666;strokeWidth=2;fontSize=14;fontStyle=1;verticalAlign=top;align=left;spacingLeft=10;spacingTop=5;arcSize=6;fontColor=#666;dashed=1;" vertex="1" parent="1">
<mxGeometry x="40" y="1150" width="1530" height="90" as="geometry" />
</mxCell>
<mxCell id="data-sessions" value="sessions/&#xa;{id}.jsonl" style="rounded=1;whiteSpace=wrap;html=1;fillColor=#eee;strokeColor=#999;fontSize=10;align=center;arcSize=8;fontColor=#333;" vertex="1" parent="1">
<mxGeometry x="70" y="1185" width="100" height="40" as="geometry" />
</mxCell>
<mxCell id="data-profiles" value="agent-profiles/&#xa;{id}/*.md" style="rounded=1;whiteSpace=wrap;html=1;fillColor=#eee;strokeColor=#999;fontSize=10;align=center;arcSize=8;fontColor=#333;" vertex="1" parent="1">
<mxGeometry x="190" y="1185" width="110" height="40" as="geometry" />
</mxCell>
<mxCell id="data-creds" value="credentials&#xa;.json5" style="rounded=1;whiteSpace=wrap;html=1;fillColor=#eee;strokeColor=#999;fontSize=10;align=center;arcSize=8;fontColor=#333;" vertex="1" parent="1">
<mxGeometry x="320" y="1185" width="90" height="40" as="geometry" />
</mxCell>
<mxCell id="data-agents" value="agents&#xa;.json" style="rounded=1;whiteSpace=wrap;html=1;fillColor=#eee;strokeColor=#999;fontSize=10;align=center;arcSize=8;fontColor=#333;" vertex="1" parent="1">
<mxGeometry x="430" y="1185" width="80" height="40" as="geometry" />
</mxCell>
<mxCell id="data-subagents" value="subagents&#xa;.jsonl" style="rounded=1;whiteSpace=wrap;html=1;fillColor=#eee;strokeColor=#999;fontSize=10;align=center;arcSize=8;fontColor=#333;" vertex="1" parent="1">
<mxGeometry x="530" y="1185" width="90" height="40" as="geometry" />
</mxCell>
<mxCell id="data-cron" value="cron-jobs&#xa;.jsonl" style="rounded=1;whiteSpace=wrap;html=1;fillColor=#eee;strokeColor=#999;fontSize=10;align=center;arcSize=8;fontColor=#333;" vertex="1" parent="1">
<mxGeometry x="640" y="1185" width="80" height="40" as="geometry" />
</mxCell>
<mxCell id="data-skills-env" value="skills.env&#xa;.json5" style="rounded=1;whiteSpace=wrap;html=1;fillColor=#eee;strokeColor=#999;fontSize=10;align=center;arcSize=8;fontColor=#333;" vertex="1" parent="1">
<mxGeometry x="740" y="1185" width="80" height="40" as="geometry" />
</mxCell>
<mxCell id="data-runlog" value="run-log&#xa;.jsonl" style="rounded=1;whiteSpace=wrap;html=1;fillColor=#eee;strokeColor=#999;fontSize=10;align=center;arcSize=8;fontColor=#333;" vertex="1" parent="1">
<mxGeometry x="840" y="1185" width="80" height="40" as="geometry" />
</mxCell>
<!-- ==================== EXTERNAL DEPS ==================== -->
<mxCell id="ext-group" value="External Dependencies" style="rounded=1;whiteSpace=wrap;html=1;fillColor=#fafafa;strokeColor=#aaa;strokeWidth=1;fontSize=12;fontStyle=1;verticalAlign=top;align=left;spacingLeft=10;spacingTop=5;arcSize=6;fontColor=#888;dashed=1;dashPattern=5 5;" vertex="1" parent="1">
<mxGeometry x="40" y="1270" width="1530" height="60" as="geometry" />
</mxCell>
<mxCell id="ext-piagent" value="pi-agent-core" style="rounded=1;whiteSpace=wrap;html=1;fillColor=#f8f8f8;strokeColor=#ccc;fontSize=10;align=center;arcSize=8;fontColor=#666;" vertex="1" parent="1">
<mxGeometry x="70" y="1295" width="100" height="25" as="geometry" />
</mxCell>
<mxCell id="ext-electron" value="Electron 33+" style="rounded=1;whiteSpace=wrap;html=1;fillColor=#f8f8f8;strokeColor=#ccc;fontSize=10;align=center;arcSize=8;fontColor=#666;" vertex="1" parent="1">
<mxGeometry x="185" y="1295" width="100" height="25" as="geometry" />
</mxCell>
<mxCell id="ext-nestjs" value="NestJS 11" style="rounded=1;whiteSpace=wrap;html=1;fillColor=#f8f8f8;strokeColor=#ccc;fontSize=10;align=center;arcSize=8;fontColor=#666;" vertex="1" parent="1">
<mxGeometry x="300" y="1295" width="80" height="25" as="geometry" />
</mxCell>
<mxCell id="ext-nextjs" value="Next.js 16" style="rounded=1;whiteSpace=wrap;html=1;fillColor=#f8f8f8;strokeColor=#ccc;fontSize=10;align=center;arcSize=8;fontColor=#666;" vertex="1" parent="1">
<mxGeometry x="395" y="1295" width="80" height="25" as="geometry" />
</mxCell>
<mxCell id="ext-react" value="React 19" style="rounded=1;whiteSpace=wrap;html=1;fillColor=#f8f8f8;strokeColor=#ccc;fontSize=10;align=center;arcSize=8;fontColor=#666;" vertex="1" parent="1">
<mxGeometry x="490" y="1295" width="70" height="25" as="geometry" />
</mxCell>
<mxCell id="ext-socketio" value="Socket.io" style="rounded=1;whiteSpace=wrap;html=1;fillColor=#f8f8f8;strokeColor=#ccc;fontSize=10;align=center;arcSize=8;fontColor=#666;" vertex="1" parent="1">
<mxGeometry x="575" y="1295" width="70" height="25" as="geometry" />
</mxCell>
<mxCell id="ext-zustand" value="Zustand" style="rounded=1;whiteSpace=wrap;html=1;fillColor=#f8f8f8;strokeColor=#ccc;fontSize=10;align=center;arcSize=8;fontColor=#666;" vertex="1" parent="1">
<mxGeometry x="660" y="1295" width="70" height="25" as="geometry" />
</mxCell>
<mxCell id="ext-turborepo" value="Turborepo" style="rounded=1;whiteSpace=wrap;html=1;fillColor=#f8f8f8;strokeColor=#ccc;fontSize=10;align=center;arcSize=8;fontColor=#666;" vertex="1" parent="1">
<mxGeometry x="745" y="1295" width="70" height="25" as="geometry" />
</mxCell>
<mxCell id="ext-pnpm" value="pnpm 10" style="rounded=1;whiteSpace=wrap;html=1;fillColor=#f8f8f8;strokeColor=#ccc;fontSize=10;align=center;arcSize=8;fontColor=#666;" vertex="1" parent="1">
<mxGeometry x="830" y="1295" width="70" height="25" as="geometry" />
</mxCell>
<mxCell id="ext-vitest" value="Vitest" style="rounded=1;whiteSpace=wrap;html=1;fillColor=#f8f8f8;strokeColor=#ccc;fontSize=10;align=center;arcSize=8;fontColor=#666;" vertex="1" parent="1">
<mxGeometry x="915" y="1295" width="60" height="25" as="geometry" />
</mxCell>
<mxCell id="ext-tailwind" value="Tailwind v4" style="rounded=1;whiteSpace=wrap;html=1;fillColor=#f8f8f8;strokeColor=#ccc;fontSize=10;align=center;arcSize=8;fontColor=#666;" vertex="1" parent="1">
<mxGeometry x="990" y="1295" width="80" height="25" as="geometry" />
</mxCell>
<mxCell id="ext-shadcn" value="Shadcn/UI" style="rounded=1;whiteSpace=wrap;html=1;fillColor=#f8f8f8;strokeColor=#ccc;fontSize=10;align=center;arcSize=8;fontColor=#666;" vertex="1" parent="1">
<mxGeometry x="1085" y="1295" width="75" height="25" as="geometry" />
</mxCell>
<!-- ==================== LEGEND ==================== -->
<mxCell id="legend-box" value="" style="rounded=1;whiteSpace=wrap;html=1;fillColor=#ffffff;strokeColor=#ddd;strokeWidth=1;arcSize=6;" vertex="1" parent="1">
<mxGeometry x="1200" y="1270" width="370" height="60" as="geometry" />
</mxCell>
<mxCell id="legend-title" value="Legend" style="text;html=1;fontSize=11;fontStyle=1;align=left;fontColor=#666;" vertex="1" parent="1">
<mxGeometry x="1210" y="1273" width="50" height="16" as="geometry" />
</mxCell>
<mxCell id="legend-1" value="" style="rounded=1;fillColor=#4361ee;strokeColor=none;fontSize=1;" vertex="1" parent="1">
<mxGeometry x="1210" y="1295" width="12" height="12" as="geometry" />
</mxCell>
<mxCell id="legend-1t" value="Apps" style="text;fontSize=9;fontColor=#666;align=left;" vertex="1" parent="1">
<mxGeometry x="1226" y="1293" width="35" height="16" as="geometry" />
</mxCell>
<mxCell id="legend-2" value="" style="rounded=1;fillColor=#264653;strokeColor=none;fontSize=1;" vertex="1" parent="1">
<mxGeometry x="1270" y="1295" width="12" height="12" as="geometry" />
</mxCell>
<mxCell id="legend-2t" value="Engine" style="text;fontSize=9;fontColor=#666;align=left;" vertex="1" parent="1">
<mxGeometry x="1286" y="1293" width="40" height="16" as="geometry" />
</mxCell>
<mxCell id="legend-3" value="" style="rounded=1;fillColor=#e76f51;strokeColor=none;fontSize=1;" vertex="1" parent="1">
<mxGeometry x="1335" y="1295" width="12" height="12" as="geometry" />
</mxCell>
<mxCell id="legend-3t" value="Hub" style="text;fontSize=9;fontColor=#666;align=left;" vertex="1" parent="1">
<mxGeometry x="1351" y="1293" width="30" height="16" as="geometry" />
</mxCell>
<mxCell id="legend-4" value="" style="rounded=1;fillColor=#2a9d8f;strokeColor=none;fontSize=1;" vertex="1" parent="1">
<mxGeometry x="1390" y="1295" width="12" height="12" as="geometry" />
</mxCell>
<mxCell id="legend-4t" value="Tools" style="text;fontSize=9;fontColor=#666;align=left;" vertex="1" parent="1">
<mxGeometry x="1406" y="1293" width="35" height="16" as="geometry" />
</mxCell>
<mxCell id="legend-5" value="" style="rounded=1;fillColor=#e9c46a;strokeColor=none;fontSize=1;" vertex="1" parent="1">
<mxGeometry x="1450" y="1295" width="12" height="12" as="geometry" />
</mxCell>
<mxCell id="legend-5t" value="Systems" style="text;fontSize=9;fontColor=#666;align=left;" vertex="1" parent="1">
<mxGeometry x="1466" y="1293" width="50" height="16" as="geometry" />
</mxCell>
<mxCell id="legend-6" value="" style="rounded=1;fillColor=#38b000;strokeColor=none;fontSize=1;" vertex="1" parent="1">
<mxGeometry x="1520" y="1295" width="12" height="12" as="geometry" />
</mxCell>
<mxCell id="legend-6t" value="Shared" style="text;fontSize=9;fontColor=#666;align=left;" vertex="1" parent="1">
<mxGeometry x="1536" y="1293" width="40" height="16" as="geometry" />
</mxCell>
</root>
</mxGraphModel>
</diagram>
</mxfile>