a plugin can ship affordances, and installing publishes them

A plugin is a new SURFACE arriving at runtime, which is exactly the case
hand-written prose could never cover: install gitea and no agent learns that
`tea` is authenticated, or that plain `git` is the better tool for what git
already does. The plugin knows; nothing carried it across.

An `affordances/` directory in the plugin repository is copied to
capabilities/affordances/<publisher>/<plugin>/ on install and removed on
uninstall — the same shape as assets/ and publishAssets, deliberately, because
two mechanisms for "the plugin ships some files" would drift and that one is
already understood.

Namespaced by publisher because two plugins named `gitea` from different
publishers must not overwrite each other, and because an affordance in the tree
should say whose it is without being opened. It mirrors mountPrefix.

Uninstall removes the PLUGIN's directory, never the publisher's: every
first-party plugin publishes under one officerdev/, and taking that level out
because one was uninstalled would strip the rest silently. That is what the
tests are mostly about — a copy going wrong is obvious, this would not be.

Publishing is not fatal to an install. An affordance that failed to copy costs
an agent some knowledge; refusing the install over it costs the owner the
plugin.

Verified against the real gitea plugin: published, the loader saw
officerdev/gitea/gitea beside officer/core/image-rendering, uninstall removed
it and left core alone.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
This commit is contained in:
2026-08-19 08:23:35 +00:00
co-authored by Claude Opus 5
parent d49776307d
commit 8fe1b1824b
4 changed files with 174 additions and 4 deletions
+10 -3
View File
@@ -320,9 +320,16 @@ Still to build:
- A bare `claude` run in a terminal on the host gets nothing either, since it never passes through
`claude-manager`. Would need a generated file, which is the thing `user-instance.ts` refuses to write
for the owner.
- Plugin contribution: an `affordances/` directory in the plugin repository, copied to
`capabilities/affordances/<publisher>/<plugin>/` on install and removed on uninstall. Same shape as
`assets/` and `publishAssets`. **Nothing does this yet** — gitea will be the first.
- ~~Plugin contribution~~ — built 2026-08-19 (`affordances/publish.ts`). An `affordances/` directory in
the plugin repository is copied to `capabilities/affordances/<publisher>/<plugin>/` on install and
removed on uninstall. Gitea is the first to ship one.
- **The other categories.** A plugin can contribute affordances and nothing else. Skills, tools, tasks
and processes are the obvious next ones and were deliberately left out — one mechanism, proven, before
five. When they land, `publishAffordances` generalises rather than gaining siblings.
- **The path uses `publisher` verbatim**, so gitea's is `officerdev/gitea` while the platform's own is
`officer/core`. Consistent with `mountPrefix`, which is the only thing allowed to branch on provenance,
but it does mean `officer` and `officerdev` both appear in the tree. Rename `core` to `officerdev/core`
or normalise first-party to `officer` — either is fine, neither is done.
Open, and deliberately deferred: