Phase 11, part 2: module tools over MCP

Agents get each module's tools by their scopes: reading tools with read,
the others with read and act. Content (drafts and items; writing, editing
and discarding drafts), Prospects (signals, review, outreach, suppression;
outreach drafts and edits), SEO (the morning check, What to write next,
links, changes; editing a proposal), Sites and Metrics (reading) and the
Market (list, get, save). They call what the pages call, and what an agent
changes is in the audit log as the agent. Nothing that leaves Supermarket
is offered yet: that waits for approvals.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
2026-11-25 10:31:43 -07:00
co-authored by Claude Opus 5.5
parent da2d56f8d2
commit bfb74e7700
6 changed files with 903 additions and 6 deletions
+31 -2
View File
@@ -53,8 +53,8 @@ branch `phase10` (2026-11-25), not yet merged: schema 36, a new
the visible changes are posting accounts, Connections, Activity, and a
CSRF token in every form.
**Next: Phase 11, agents.** Part 1 (agent users and keys) is built on
branch `phase11`. Phase 12 still needs who adds Supermarket's client to
**Next: Phase 11, agents.** Parts 1 (agent users and keys) and 2 (module
tools over MCP) are built on branch `phase11`; part 3 (approvals) is next. Phase 12 still needs who adds Supermarket's client to
Authelia.
**Coming back to it (for the agent working on it):**
@@ -2552,6 +2552,35 @@ single `mcp-token`. A commit after each part.
The socket stays as it is (everything, no key). The server edition has no
built-in Hermes: an admin makes an agent with the CRM scope.
**Part 2 built 2026-11-26** on `phase11`.
- The module tools live in the web package (`agenttools.go`), because they
call what the pages call (site scopes, What to write next, the AI clients);
`mcpserver.Handler` takes them as a hook and builds each agent's server
from its scopes, so an agent is never even offered a tool it can't use.
Every agent gets `profile_get`.
- **Content:** read: `content_drafts` (waiting, scheduled, published),
`content_items` (an entry's fetched items, or the company's own); act:
`content_create_draft` (the agent writes the text; the channel's rules
apply: Reddit needs a title and subreddit; the entry, signal and items
are checked), `content_edit_draft`, `content_discard_draft`.
- **Prospects:** read: `signals_list` (with the 90-day scorecard),
`prospects_review`, `outreach_list` (with replies), `suppression_list`;
act: `outreach_draft` (Supermarket's AI writes it, as on the page, so
suppression and the rest hold), `outreach_edit`, `suppress`.
- **SEO:** read: `seo_sites`, `seo_morning_check`, `seo_next`, `seo_links`,
`seo_changes`; act: `seo_edit_change` (a proposal's wording; the yes that
opens the pull request stays a person's).
- **Sites:** read: `sites_list`, `sites_new_pages`. **Metrics:** read:
`metrics_months` (the last 13). **The Market:** read: `market_list`,
`market_get` (with ids; `inventory_list` stays for Hermes and Claude
Code); act: `market_save` (adds, or replaces the entry of that name).
- Everything an agent changes is in the audit log as the agent; drafts and
outreach it writes show *by* its name.
- Not here, on purpose: anything that leaves Supermarket (publishing or
scheduling a post, queueing or sending an email, mailing-list adds,
pushing a page or opening a pull request). Those need part 3's
approvals, so an agent can't do them at all yet.
1. **Agent users and their keys.**
- An admin creates an agent on Settings → Users → *New agent*. It has a
name, a description, and the modules it's given, each *read* or