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 1760 820" width="100%" preserveAspectRatio="xMidYMid meet" font-family="ui-monospace, SFMono-Regular, 'SF Mono', Menlo, Monaco, Consolas, monospace">
<!-- Palette: OpenCompany dark-theme tokens (client/src/themes/dark.css surfaces/fg + light.css Dracula accents) -->
<defs>
<marker id="arrow" viewBox="0 0 10 10" refX="9" refY="5" markerWidth="8" markerHeight="8" orient="auto-start-reverse">
<path d="M0,0 L10,5 L0,10 z" fill="#e8eaed"/>
</marker>
<style>
.bg { fill: #0d0f13; }
.panel { fill: #15171c; stroke-width: 2; }
.p-cyan { stroke: #8be9fd; } .p-purple { stroke: #bd93f9; } .p-orange { stroke: #ffb86c; } .p-green { stroke: #50fa7b; } .p-pink { stroke: #ff79c6; }
.title { fill: #e8eaed; font-size: 20px; font-weight: 700; }
.h1 { fill: #e8eaed; font-size: 18px; font-weight: 700; }
.h2 { fill: #e8eaed; font-size: 14px; font-weight: 700; }
.sub { fill: #e8eaed; font-size: 12px; }
.small { fill: #e8eaed; font-size: 10px; }
.label { fill: #f1fa8c; font-size: 11px; font-style: italic; }
.conn { stroke: #e8eaed; stroke-width: 1.8; fill: none; }
.conn-dot { stroke: #9aa1ac; stroke-width: 1.5; fill: none; stroke-dasharray: 4 4; }
.box { fill: #1b1e25; stroke-width: 1.5; }
.tier-label { fill: #9aa1ac; font-size: 11px; text-transform: uppercase; letter-spacing: 1px; }
.accent-cyan { fill: #8be9fd; } .accent-purple { fill: #bd93f9; } .accent-green { fill: #50fa7b; } .accent-orange { fill: #ffb86c; } .accent-pink { fill: #ff79c6; }
.title, .h1, .h2 { font-family: 'Geist Variable', system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif; }
</style>
</defs>
<rect class="bg" width="1760" height="820"/>
<!-- Title -->
<text x="880" y="42" class="title" text-anchor="middle">Anatomy of a Plugin Node</text>
<text x="880" y="68" class="sub" text-anchor="middle">One Python folder = one node. Backend is the single source of truth - the frontend renders itself with zero TypeScript edits. 140+ nodes ship this way.</text>
<!-- ================= GROUP 1 (cyan): What you write ================= -->
<rect class="panel p-cyan" x="40" y="100" width="460" height="545" rx="10"/>
<text x="270" y="130" class="h1" text-anchor="middle">What you write</text>
<text x="270" y="150" class="accent-cyan" font-size="12" text-anchor="middle">server/nodes/<group>/<plugin>/</text>
<rect class="box p-cyan" x="60" y="168" width="420" height="78" rx="6"/>
<text x="270" y="190" class="h2" text-anchor="middle">__init__.py - the node class</text>
<text x="270" y="210" class="sub" text-anchor="middle">class MyNode(ActionNode / TriggerNode / ToolNode)</text>
<text x="270" y="228" class="small" text-anchor="middle">type, display_name, group, credentials, task_queue, ui_hints</text>
<rect class="box p-cyan" x="60" y="264" width="420" height="78" rx="6"/>
<text x="270" y="286" class="h2" text-anchor="middle">Params / Output (Pydantic)</text>
<text x="270" y="306" class="sub" text-anchor="middle">snake_case fields = UI params = LLM tool schema</text>
<text x="270" y="324" class="small" text-anchor="middle">Output enforced at the serialization boundary (OutputValidationError)</text>
<rect class="box p-cyan" x="60" y="360" width="420" height="78" rx="6"/>
<text x="270" y="382" class="h2" text-anchor="middle">@Operation methods</text>
<text x="270" y="402" class="sub" text-anchor="middle">async def op(self, ctx, params) -> Output</text>
<text x="270" y="420" class="small" text-anchor="middle">or a declarative routing= for plain REST calls (Connection facade)</text>
<rect class="box p-cyan" x="60" y="456" width="420" height="78" rx="6"/>
<text x="270" y="478" class="h2" text-anchor="middle">icon.svg / icon_<type>.svg + meta.json</text>
<text x="270" y="498" class="sub" text-anchor="middle">co-located brand mark + {"color": "#..."}</text>
<text x="270" y="516" class="small" text-anchor="middle">or lucide: / emoji refs in meta.json - never class attributes</text>
<rect class="box p-cyan" x="60" y="552" width="420" height="78" rx="6"/>
<text x="270" y="574" class="h2" text-anchor="middle">Optional siblings (rich plugins)</text>
<text x="270" y="594" class="small" text-anchor="middle">_service.py · _handlers.py · _credentials.py · _events.py · _router.py</text>
<text x="270" y="612" class="small" text-anchor="middle">bots, daemons, OAuth, signed webhooks - telegram/ is the reference</text>
<!-- ================= GROUP 2 (purple): Auto-registration ================= -->
<rect class="panel p-purple" x="650" y="100" width="460" height="449" rx="10"/>
<text x="880" y="130" class="h1" text-anchor="middle">Auto-registration on import</text>
<rect class="box p-purple" x="670" y="168" width="420" height="78" rx="6"/>
<text x="880" y="190" class="h2" text-anchor="middle">__init_subclass__ fires</text>
<text x="880" y="210" class="sub" text-anchor="middle">nodes/__init__.py pkgutil walker imports every plugin</text>
<text x="880" y="228" class="small" text-anchor="middle">no manual registry edit, no node_executor.py, no main.py edit</text>
<rect class="box p-purple" x="670" y="264" width="420" height="78" rx="6"/>
<text x="880" y="286" class="h2" text-anchor="middle">5 registries populated</text>
<text x="880" y="306" class="sub" text-anchor="middle">_NODE_CLASS_REGISTRY · NODE_METADATA · _DIRECT_MODELS</text>
<text x="880" y="324" class="small" text-anchor="middle">NODE_OUTPUT_SCHEMAS · _HANDLER_REGISTRY (class registry first)</text>
<rect class="box p-purple" x="670" y="360" width="420" height="78" rx="6"/>
<text x="880" y="382" class="h2" text-anchor="middle">Temporal activity minted</text>
<text x="880" y="402" class="sub" text-anchor="middle">cls.as_activity() -> node.{type}.v{version}</text>
<text x="880" y="420" class="small" text-anchor="middle">task_queue worker (9 queues) · class RetryPolicy + timeouts</text>
<rect class="box p-purple" x="670" y="456" width="420" height="78" rx="6"/>
<text x="880" y="478" class="h2" text-anchor="middle">18 self-registration hooks (rich plugins)</text>
<text x="880" y="498" class="sub" text-anchor="middle">ws_handlers · router · option_loader · oauth_callback_path</text>
<text x="880" y="516" class="small" text-anchor="middle">filter_builder · webhook_source · canary_trigger · output_schema ...</text>
<!-- ================= GROUP 3 (green): What the frontend sees ================= -->
<rect class="panel p-green" x="1260" y="100" width="460" height="353" rx="10"/>
<text x="1490" y="130" class="h1" text-anchor="middle">What the frontend sees</text>
<text x="1490" y="150" class="accent-green" font-size="12" text-anchor="middle">zero TS edits</text>
<rect class="box p-green" x="1280" y="168" width="420" height="78" rx="6"/>
<text x="1490" y="190" class="h2" text-anchor="middle">NodeSpec endpoint</text>
<text x="1490" y="210" class="sub" text-anchor="middle">GET /api/schemas/nodes/{type}/spec.json</text>
<text x="1490" y="228" class="small" text-anchor="middle">display meta, params, output schema, handles, uiHints, component_kind</text>
<rect class="box p-green" x="1280" y="264" width="420" height="78" rx="6"/>
<text x="1490" y="286" class="h2" text-anchor="middle">useNodeSpec renders it</text>
<text x="1490" y="306" class="sub" text-anchor="middle">canvas node picked by component_kind, param panel from</text>
<text x="1490" y="324" class="small" text-anchor="middle">the JSON Schema, palette entry from the group - no client edits</text>
<rect class="box p-green" x="1280" y="360" width="420" height="78" rx="6"/>
<text x="1490" y="382" class="h2" text-anchor="middle">Credentials modal</text>
<text x="1490" y="402" class="sub" text-anchor="middle">declare a Credential subclass in _credentials.py;</text>
<text x="1490" y="420" class="small" text-anchor="middle">modal renders from credential_providers.json (key / OAuth / CLI)</text>
<!-- ================= Arrows between groups ================= -->
<text x="575" y="292" class="label" text-anchor="middle">import re-registers</text>
<text x="575" y="307" class="label" text-anchor="middle">everything on</text>
<text x="575" y="322" class="label" text-anchor="middle">server restart</text>
<path class="conn" d="M 502 340 L 646 340" marker-end="url(#arrow)"/>
<text x="1185" y="270" class="label" text-anchor="middle">served over HTTP</text>
<text x="1185" y="285" class="label" text-anchor="middle">as NodeSpec</text>
<path class="conn" d="M 1112 300 L 1256 300" marker-end="url(#arrow)"/>
<!-- ================= Banner ================= -->
<rect class="panel p-pink" x="40" y="675" width="1680" height="58" rx="10"/>
<text x="880" y="711" class="accent-pink" font-size="18" font-weight="700" text-anchor="middle">No TypeScript node definition · No node_executor.py registry entry · No frontend edits · No core-services edits</text>
<!-- ================= Footnotes ================= -->
<text x="880" y="763" class="label" text-anchor="middle">Locked by tests/test_plugin_self_containment.py: core never imports a plugin and main.py mounts nothing per plugin - handlers, routers and OAuth callbacks self-register.</text>
<text x="880" y="785" class="label" text-anchor="middle">Edge case: if tool_name != snake_case(type) and the plugin ships a paired skill, add a visuals.json alias (icon + color) - locked by tests/test_skill_icon_resolution.py</text>
</svg>