Expand description
POST /m4a/attach: on-demand m4a account for a provider session the node did not spawn
(spec live-session-m4a-attach).
Caller: m4a-agent mcp running inside that provider session. Checks, all required:
- owner: the ops listener’s owner-only control token (a file only the node’s OS user can read) – checked by the router before this module runs;
- policy:
HATCHERY_M4A_ATTACH=auto(defaultoff: nothing is adopted) and the provider inHATCHERY_M4A_ATTACH_PROVIDERS(default: all built-in providers); - process: the given pid is alive and descends (within a few generations) from a live process of that provider. Then the node provisions a per-session account (own registry entry, own store root and key) keyed by the provider session id (or the provider’s pid when none is known) and returns nick, session id and a fresh capability. The capability is returned once, never logged.
Structs§
Constants§
Functions§
- handle
- Handles the request;
tableis the current process table (injected for tests). - policy_
allows - process_
table - The live process table.
- provider_
ancestor - Walks from
pidup the parent chain; returns the nearest process whose image is the provider. - provider_
images - Process image base names that count as
provider.