feat(agent-builder): editable visual canvas for channels/sub-agents/skills/tools/MCP/schedules#264
Open
Weegy wants to merge 6 commits into
Open
feat(agent-builder): editable visual canvas for channels/sub-agents/skills/tools/MCP/schedules#264Weegy wants to merge 6 commits into
Weegy wants to merge 6 commits into
Conversation
…kills/tools/MCP/schedules
Adds an editable node-graph Agent Builder at /admin/builder backed by the
existing live, hot-reloading config graph. Drawing a connection writes the
wiring; deleting an edge removes it; edits apply without a restart via
pg_notify('agents_changed') -> registry.reload().
Backend (middleware):
- migration 0003: skills, mcp_servers, agent_subagents, agent_tool_grants,
agent_schedules + agents.model_routing/canvas_position + notify triggers
- AgentGraphStore (CRUD) + ConfigStore snapshot/diff awareness: graph changes
rebuild the owning agent; schedules are orthogonal (cron worker consumes them)
- per-agent model routing: persisted JSON -> runtime triage config
- MCP client (@modelcontextprotocol/sdk) + adapters to native + sub-agent tools
- DB sub-agents materialised as LocalSubAgent DomainTools, attached in onAgentBuilt
- REST router at /api/v1/operator: graph read, edge create/delete dispatcher,
sub-agent/skill/mcp/schedule CRUD, model-routing, positions, mcp discover
- cron schedule worker firing headless agent turns
Frontend (web-ui):
- @xyflow/react canvas: custom nodes, palette, toolbox, inspector, optimistic
edges with rollback, debounced position save; admin dashboard card; en/de i18n
Tests: cron matcher, model-routing mapping, sub-agent builder, MCP adapters,
graph diff. Typecheck + lint clean (middleware + web-ui), 27/27 unit tests pass.
See docs/plans/agent-builder-TESTING.md for the local end-to-end test flow.
…r-canvas-plan # Conflicts: # middleware/packages/harness-orchestrator/src/registry/applyDiff.ts
…string @types/express 5 types req.params[x]/req.query[x] as string|string[]; route handlers passed them straight into string-typed store methods (TS2345). Add a str() helper and read every param/query through it.
… canvas Addresses canvas feedback: (1) nothing could be removed, (2) the canvas did not reflect the running system on load. Deletion: - wire onNodesDelete + an explicit Inspector "Delete" button to the existing backend DELETE endpoints (sub-agent / skill / mcp / schedule; channel + tool nodes map to channel_bind / tool_grant edge deletes) - deleteKeyCode now also accepts Delete; agent + plugin nodes are non-deletable Current-system representation: - GET /graph now includes the agent's live enabled plugins (from the registry) as read-only `plugin` nodes wired into the agent, so the canvas shows the real capability surface instead of only the editable graph layer web-ui: new plugin node type + graph mapping + en/de i18n. Typecheck, lint and i18n parity clean (middleware + web-ui).
…r-agent plugin control Closes the three canvas follow-ups so the builder is functional end-to-end. 1. Channel binding — the "Channel" palette now drops a draft node; the inspector takes channelType + channelKey and "Bind" persists a channel_bind to the agent (was a no-op before). 2. Native-tool baseline — GET /graph returns the agent's orchestrator-native tools; the canvas renders them as read-only nodes wired into the agent (current-system view, deduped against explicit grants). 3. Per-agent plugins — plugin nodes are actionable: detach a plugin from the agent (inspector) and enable installable plugins from the agent inspector. New endpoints: GET .../installable-plugins, POST/DELETE .../plugins[/:id] (ConfigStore.upsertAgentPlugin/removeAgentPlugin → registry reload). web-ui: ChannelEditor + PluginEditor inspectors, agent plugin section, native baseline nodes/edges, en/de i18n. Typecheck/lint/i18n clean (middleware + web-ui).
…cker, per-agent native tools 1. Timezone-aware cron — the matcher now projects into the schedule's IANA timezone via Intl (e.g. "0 9 * * *" in Europe/Berlin fires at Berlin 09:00, DST-correct); invalid tz falls back to UTC. Worker passes schedule.timezone. 2. Channel binding picker — the channel inspector loads the live channel directory (GET /channel-directory) and offers type + key suggestions (datalist) instead of blind free-text. 3. Per-agent native tools — agents can now restrict which plugin-contributed native tools they expose. The orchestrator filters its advertised native tools by an optional allow-list derived from agent-level native grants (kernel tools like memory/KG stay always-on); the agent inspector shows a checklist (all checked = no restriction). New PUT .../native-tools setter. 4. Plugin install is still managed centrally (signing/registry), but the agent inspector now deep-links to /admin/registries so it is not a dead-end. Tests: cron timezone cases added. Typecheck/lint/i18n clean (middleware + web-ui), 29/29 unit tests pass.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Agent Builder — editable visual canvas
A LangChain-style visual builder at
/admin/builderfor wiring the orchestration layer: Channels → Agent → Sub-Agents → Skills → Tools/MCP, plus a Schedule trigger. Drawing a connection writes the wiring; deleting an edge removes it; node edits apply live without a restart via the existingpg_notify('agents_changed')→registry.reload()path.Backend (middleware)
0003_agent_builder_graph.sql—skills,mcp_servers,agent_subagents,agent_tool_grants,agent_schedules+agents.model_routing/canvas_position+ notify triggers (auto-runs on boot).AgentGraphStore(CRUD) +ConfigStoresnapshot/diff awareness — graph changes rebuild the owning agent; schedules stay orthogonal (consumed by the cron worker).@modelcontextprotocol/sdk, stdio/http/sse) + adapters into native + sub-agent tools.LocalSubAgentDomainTools, attached inonAgentBuilt(same seam plugin domain agents use)./api/v1/operator— graph read, edge create/delete dispatcher, sub-agent/skill/mcp/schedule CRUD, model-routing, positions, mcp discover (requireAuth,ConfigValidationError → 409, inlinereload()).chat()turns.Frontend (web-ui)
@xyflow/reactcanvas — custom node types, palette, toolbox, inspector, optimistic edges with rollback, debounced position save. Admin dashboard card + en/de i18n.Verification
typecheck+lintclean (middleware + web-ui), web-ui i18n parity OK.Testing
Local end-to-end flow documented in
docs/plans/agent-builder-TESTING.md(needsDATABASE_URL+ANTHROPIC_API_KEY; without a DB the builder endpoints 503 and the scheduler is skipped, by design).Notes / follow-ups