Self-improving AI Employees for everyone
Python ai-agentsai-employeeai-employeesassistantautonomous-agentsco-employeescompanygrok-botinstinctloop-agentsmuseown-your-datapersonalself-hosted
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 1920 1080" width="100%" role="img" aria-labelledby="title desc">
<title id="title">Workspace Anatomy</title>
<desc id="desc">A source-backed anatomy of per-workflow workspaces: the database-backed id-to-slug resolver selects a DATA_DIR-rooted directory, contained consumers read and write artifacts through traversal-safe helpers, and CLI agents receive the workspace for worktrees and per-workflow skill discovery. Sources: server/core/paths.py; server/services/workspace_locator.py; server/services/workflow.py; server/services/workflow_storage/handlers.py; server/routers/workspace.py; server/nodes/filesystem/_backend.py; server/services/media/workspace.py; server/nodes/agent/claude_code_agent/_skills.py; server/services/cli_agent/session.py</desc>
<defs>
<marker id="arrow" viewBox="0 0 10 10" refX="9" refY="5" markerWidth="8" markerHeight="8" orient="auto"><path d="M0,0 L10,5 L0,10 z" fill="#e8eaed"/></marker>
<style>
.title { fill:#e8eaed; font:700 30px Geist,system-ui,sans-serif; }
.subtitle { fill:#9aa1ac; font:400 18px Geist,system-ui,sans-serif; }
.group-label { fill:#9aa1ac; font:600 16px 'JetBrains Mono',ui-monospace,monospace; letter-spacing:1.2px; }
.type-label { fill:#9aa1ac; font:600 16px 'JetBrains Mono',ui-monospace,monospace; letter-spacing:.8px; }
.node-label { fill:#e8eaed; font:650 20px Geist,system-ui,sans-serif; }
.node-detail { fill:#9aa1ac; font:400 16px Geist,system-ui,sans-serif; }
.edge-label { fill:#e8eaed; font:500 16px Geist,system-ui,sans-serif; }
.edge-protocol { fill:#9aa1ac; font:500 16px 'JetBrains Mono',ui-monospace,monospace; }
.callout-title { fill:#e8eaed; font:650 18px Geist,system-ui,sans-serif; }
.callout-text { fill:#9aa1ac; font:400 16px Geist,system-ui,sans-serif; }
.legend { fill:#9aa1ac; font:500 16px Geist,system-ui,sans-serif; }
</style>
</defs>
<rect width="1920" height="1080" fill="#0d0f13"/>
<text x="72" y="58" class="title">Workspace Anatomy</text>
<text x="72" y="91" class="subtitle">Immutable workflow IDs resolve to mutable slug directories that isolate files, generated media, CLI worktrees, and materialized skills</text>
<g data-group-id="workspace-resolution"><rect x="50" y="125" width="500" height="830" rx="18" fill="#15171c" stroke="#ffb86c" stroke-width="2"/><text x="70" y="157" class="group-label">IDENTITY & ROOT RESOLUTION</text></g><g data-group-id="workspace-boundary"><rect x="590" y="125" width="710" height="830" rx="18" fill="#15171c" stroke="#ff79c6" stroke-width="2"/><text x="610" y="157" class="group-label">PER-WORKFLOW WORKSPACE</text></g><g data-group-id="workspace-consumers"><rect x="1340" y="125" width="530" height="830" rx="18" fill="#15171c" stroke="#50fa7b" stroke-width="2"/><text x="1360" y="157" class="group-label">CONTAINED CONSUMERS</text></g><g data-relationship-id="r-workflow-locator"><title>lookup by immutable workflow id</title><path d="M 300.0 340 L 300.0 430" fill="none" stroke="#e8eaed" stroke-width="2" marker-end="url(#arrow)"/><rect x="170.2" y="370.0" width="259.6" height="30" rx="7" fill="#15171c" stroke="#2b2f37"/><text x="300" y="388" class="edge-label" text-anchor="middle" textLength="241.6" lengthAdjust="spacingAndGlyphs">lookup by immutable workflow id</text></g><g data-relationship-id="r-locator-base"><title>selects mutable slug below root</title><path d="M 300.0 600 L 300.0 720" fill="none" stroke="#e8eaed" stroke-width="2" marker-end="url(#arrow)"/><rect x="170.2" y="650.0" width="259.6" height="30" rx="7" fill="#15171c" stroke="#2b2f37"/><text x="300" y="668" class="edge-label" text-anchor="middle" textLength="241.6" lengthAdjust="spacingAndGlyphs">selects mutable slug below root</text></g><g data-relationship-id="r-base-workspace"><title>contains one slug directory</title><path d="M 300.0 720 L 300 680 L 945 680 L 945.0 350" fill="none" stroke="#e8eaed" stroke-width="2" marker-end="url(#arrow)"/><rect x="560.4" y="665.0" width="229.2" height="30" rx="7" fill="#15171c" stroke="#2b2f37"/><text x="675" y="683" class="edge-label" text-anchor="middle" textLength="211.2" lengthAdjust="spacingAndGlyphs">contains one slug directory</text></g><g data-relationship-id="r-workspace-files"><title>contains runtime artifacts</title><path d="M 945.0 350 L 945 410 L 780 410 L 780.0 470" fill="none" stroke="#e8eaed" stroke-width="2" marker-end="url(#arrow)"/><rect x="669.2" y="395.0" width="221.6" height="30" rx="7" fill="#15171c" stroke="#2b2f37"/><text x="780" y="413" class="edge-label" text-anchor="middle" textLength="203.6" lengthAdjust="spacingAndGlyphs">contains runtime artifacts</text></g><g data-relationship-id="r-workspace-skills"><title>contains isolated skill tree</title><path d="M 945.0 350 L 945 410 L 1110 410 L 1110.0 470" fill="none" stroke="#e8eaed" stroke-width="2" marker-end="url(#arrow)"/><rect x="991.6" y="395.0" width="236.79999999999998" height="30" rx="7" fill="#15171c" stroke="#2b2f37"/><text x="1110" y="413" class="edge-label" text-anchor="middle" textLength="218.8" lengthAdjust="spacingAndGlyphs">contains isolated skill tree</text></g><g data-relationship-id="r-workspace-worktrees"><title>contains per-node task worktrees</title><path d="M 945.0 350 L 945 690 L 960.0 730" fill="none" stroke="#e8eaed" stroke-width="2" marker-end="url(#arrow)"/><rect x="811.4" y="675.0" width="267.2" height="30" rx="7" fill="#15171c" stroke="#2b2f37"/><text x="945" y="693" class="edge-label" text-anchor="middle" textLength="249.2" lengthAdjust="spacingAndGlyphs">contains per-node task worktrees</text></g><g data-relationship-id="r-routes-resolve"><title>resolves workflow id before file access · via workspace locator</title><path d="M 1600.0 340 L 1600 400 L 945 400 L 945.0 350" fill="none" stroke="#e8eaed" stroke-width="2" marker-end="url(#arrow)"/><path d="M 1320.0 400.0 L 1410 400" fill="none" stroke="#9aa1ac" stroke-width="1" stroke-dasharray="3 4" opacity=".7"/><rect x="1249.8" y="376.0" width="320.4" height="48" rx="7" fill="#15171c" stroke="#2b2f37"/><text x="1410" y="397" class="edge-label" text-anchor="middle" textLength="302.4" lengthAdjust="spacingAndGlyphs">resolves workflow id before file access</text><text x="1410" y="417" class="edge-protocol" text-anchor="middle">via workspace locator</text></g><g data-relationship-id="r-filesystem-files"><title>reads and writes contained paths</title><path d="M 1380 545.0 L 920 555.0" fill="none" stroke="#e8eaed" stroke-width="2" marker-end="url(#arrow)"/><path d="M 1150.0 545.0 L 1240 707" fill="none" stroke="#9aa1ac" stroke-width="1" stroke-dasharray="3 4" opacity=".7"/><rect x="1106.4" y="692.0" width="267.2" height="30" rx="7" fill="#15171c" stroke="#2b2f37"/><text x="1240" y="710" class="edge-label" text-anchor="middle" textLength="249.2" lengthAdjust="spacingAndGlyphs">reads and writes contained paths</text></g><g data-relationship-id="r-skills-cli"><title>auto-discovers enabled skills · via --add-dir</title><path d="M 1110.0 640 L 1110 680 L 1320 680 L 1320 805 L 1380 805.0" fill="none" stroke="#e8eaed" stroke-width="2" marker-end="url(#arrow)"/><path d="M 1215.0 680.0 L 1215 950" fill="none" stroke="#9aa1ac" stroke-width="1" stroke-dasharray="3 4" opacity=".7"/><rect x="1092.8" y="926.0" width="244.39999999999998" height="48" rx="7" fill="#15171c" stroke="#2b2f37"/><text x="1215" y="947" class="edge-label" text-anchor="middle" textLength="226.4" lengthAdjust="spacingAndGlyphs">auto-discovers enabled skills</text><text x="1215" y="967" class="edge-protocol" text-anchor="middle">via --add-dir</text></g><g data-relationship-id="r-workspace-cli"><title>passes workspace_dir</title><path d="M 945.0 350 L 1270 350 L 1270 690 L 1600 690 L 1600.0 730" fill="none" stroke="#e8eaed" stroke-width="2" marker-end="url(#arrow)"/><path d="M 1450.0 690.0 L 1540 690" fill="none" stroke="#9aa1ac" stroke-width="1" stroke-dasharray="3 4" opacity=".7"/><rect x="1452.0" y="675.0" width="176.0" height="30" rx="7" fill="#15171c" stroke="#2b2f37"/><text x="1540" y="693" class="edge-label" text-anchor="middle" textLength="158.0" lengthAdjust="spacingAndGlyphs">passes workspace_dir</text></g><g data-component-id="workflow-record"><title>Workflow record</title><rect x="90" y="190" width="420" height="150" rx="12" fill="#1b1e25" stroke="#ff79c6" stroke-width="2"/><rect x="90" y="190" width="420" height="7" rx="4" fill="#ff79c6"/><text x="108" y="216" class="type-label">DATABASE IDENTITY</text><text x="108" y="242" class="node-label">Workflow record</text><text x="108" y="268" class="node-detail">Immutable id · mutable slug</text><text x="108" y="288" class="node-detail">Stable references carry the id</text></g><g data-component-id="workspace-locator"><title>Workspace locator</title><rect x="90" y="430" width="420" height="170" rx="12" fill="#1b1e25" stroke="#ffb86c" stroke-width="2"/><rect x="90" y="430" width="420" height="7" rx="4" fill="#ffb86c"/><text x="108" y="456" class="type-label">PATH RESOLVER</text><text x="108" y="482" class="node-label">Workspace locator</text><text x="108" y="508" class="node-detail">Looks up id → slug in workflow.db</text><text x="108" y="528" class="node-detail">Read-only misses may use default</text><text x="108" y="548" class="node-detail">Mutations fail if id cannot resolve</text></g><g data-component-id="workspace-base"><title>DATA_DIR / workspaces</title><rect x="90" y="720" width="420" height="150" rx="12" fill="#1b1e25" stroke="#ff79c6" stroke-width="2"/><rect x="90" y="720" width="420" height="7" rx="4" fill="#ff79c6"/><text x="108" y="746" class="type-label">FILESYSTEM ROOT</text><text x="108" y="772" class="node-label">DATA_DIR /</text><text x="108" y="794" class="node-label">workspaces</text><text x="108" y="820" class="node-detail">~/.opencompany/workspaces by default</text><text x="108" y="840" class="node-detail">WORKSPACE_BASE_DIR remains configurable</text></g><g data-component-id="workflow-workspace"><title>workspaces/<workflow.slug>/</title><rect x="640" y="190" width="610" height="160" rx="12" fill="#1b1e25" stroke="#ff79c6" stroke-width="2"/><rect x="640" y="190" width="610" height="7" rx="4" fill="#ff79c6"/><text x="658" y="216" class="type-label">WORKSPACE ROOT</text><text x="658" y="242" class="node-label">workspaces/<workflow.slug>/</text><text x="658" y="268" class="node-detail">Created for one workflow</text><text x="658" y="288" class="node-detail">Directory moves when the slug changes</text></g><g data-component-id="workspace-files"><title>Workspace files</title><rect x="640" y="470" width="280" height="170" rx="12" fill="#1b1e25" stroke="#ff79c6" stroke-width="2"/><rect x="640" y="470" width="280" height="7" rx="4" fill="#ff79c6"/><text x="658" y="496" class="type-label">RUNTIME ARTIFACTS</text><text x="658" y="522" class="node-label">Workspace files</text><text x="658" y="548" class="node-detail">Uploads · generated media</text><text x="658" y="568" class="node-detail" textLength="244.0" lengthAdjust="spacingAndGlyphs">Documents · code · nested files</text></g><g data-component-id="workspace-skills"><title>.claude/skills/<name>/</title><rect x="970" y="470" width="280" height="170" rx="12" fill="#1b1e25" stroke="#50fa7b" stroke-width="2"/><rect x="970" y="470" width="280" height="7" rx="4" fill="#50fa7b"/><text x="988" y="496" class="type-label">MATERIALIZED SKILLS</text><text x="988" y="522" class="node-label">.claude/skills/</text><text x="988" y="544" class="node-label"><name>/</text><text x="988" y="570" class="node-detail">SKILL.md</text><text x="988" y="590" class="node-detail" textLength="244.0" lengthAdjust="spacingAndGlyphs">scripts/ + references/ preserved</text></g><g data-component-id="cli-worktrees"><title><node_id>/wt_<task_id>/</title><rect x="810" y="730" width="300" height="150" rx="12" fill="#1b1e25" stroke="#ffb86c" stroke-width="2"/><rect x="810" y="730" width="300" height="7" rx="4" fill="#ffb86c"/><text x="828" y="756" class="type-label">CLI WORKTREE</text><text x="828" y="782" class="node-label"><node_id>/</text><text x="828" y="804" class="node-label">wt_<task_id>/</text><text x="828" y="830" class="node-detail">task or session worktree</text><text x="828" y="850" class="node-detail" textLength="264.0" lengthAdjust="spacingAndGlyphs">Lives under the workflow workspace</text></g><g data-component-id="workspace-routes"><title>Workspace HTTP routes</title><rect x="1380" y="190" width="440" height="150" rx="12" fill="#1b1e25" stroke="#8be9fd" stroke-width="2"/><rect x="1380" y="190" width="440" height="7" rx="4" fill="#8be9fd"/><text x="1398" y="216" class="type-label">INTERFACE</text><text x="1398" y="242" class="node-label">Workspace HTTP</text><text x="1398" y="264" class="node-label">routes</text><text x="1398" y="290" class="node-detail">Serve file by workflow id + path</text><text x="1398" y="310" class="node-detail">Accept bounded uploads</text></g><g data-component-id="filesystem-media"><title>Filesystem & media nodes</title><rect x="1380" y="460" width="440" height="170" rx="12" fill="#1b1e25" stroke="#50fa7b" stroke-width="2"/><rect x="1380" y="460" width="440" height="7" rx="4" fill="#50fa7b"/><text x="1398" y="486" class="type-label">CONTAINED I/O</text><text x="1398" y="512" class="node-label">Filesystem &</text><text x="1398" y="534" class="node-label">media nodes</text><text x="1398" y="560" class="node-detail">resolve_within containment</text><text x="1398" y="580" class="node-detail">Traversal + symlink/junction defense</text><text x="1398" y="600" class="node-detail">Atomic workspace writes</text></g><g data-component-id="cli-agent-session"><title>CLI agent session</title><rect x="1380" y="730" width="440" height="150" rx="12" fill="#1b1e25" stroke="#bd93f9" stroke-width="2"/><rect x="1380" y="730" width="440" height="7" rx="4" fill="#bd93f9"/><text x="1398" y="756" class="type-label">AGENT CONSUMER</text><text x="1398" y="782" class="node-label">CLI agent session</text><text x="1398" y="808" class="node-detail">Receives workspace_dir / --add-dir</text><text x="1398" y="828" class="node-detail">Discovers skills and owns worktrees</text></g>
<g aria-label="Legend"><circle cx="72" cy="1038" r="7" fill="#bd93f9"/><text x="86" y="1044" class="legend">Agents / system</text><circle cx="317" cy="1038" r="7" fill="#8be9fd"/><text x="331" y="1044" class="legend">Models / interfaces</text><circle cx="562" cy="1038" r="7" fill="#50fa7b"/><text x="576" y="1044" class="legend">Tools / results</text><circle cx="807" cy="1038" r="7" fill="#ff79c6"/><text x="821" y="1044" class="legend">Triggers / events</text><circle cx="1052" cy="1038" r="7" fill="#ffb86c"/><text x="1066" y="1044" class="legend">Workflow / runtime</text><circle cx="1297" cy="1038" r="7" fill="#f1fa8c"/><text x="1311" y="1044" class="legend">Security note</text></g>
</svg>