A preset is a directory holding one `agent.cordis.yml`. Mounting it under an agent's scope context during `setup(agentCtx)` gives that one session its own tools and prompt sections while every other live session keeps its own. No registry gains a tier. `dsh-tools` and `dsh-system-prompt` already file registrations into the calling context's scope layer, and entry contexts chain to the context a subtree was plugged into, so a composition mounted under `agent.ctx` is that agent's alone and unwinds with it. The mount audits itself because a directly-plugged subtree is absent from `ctx.loader.entries()` and no boot audit covers it. It rejects an unscoped target, a row that never became usable, and a row that published a service into the root service realm — that last one is process-global rather than per-session, and its collision with the next session surfaces as an unhandled rejection `setup` never observes, leaving a half-composed agent that looks healthy. The package invariant re-checks that rule on every service notification, since a row publishing from a timer would escape a one-shot audit. Raises the `packages/README.md` word ceiling from 920 to 980: the group table must enumerate every group, and the new `preset/` row is necessary content. Design: .agents/notes/implemented/architecture/2026-08-03-per-session-agent-presets.md
18 KiB
18 KiB
Event Producer And Consumer Matrix
This matrix shows which packages dispatch each harness-owned event and which packages listen to it. It is intentionally a table rather than one large graph: events are many-to-many, and dense relation data is easier to review in rows. Receiver and event-name types also cover contained dispatch sites that deliberately bypass ctx.emit, such as subagent lifecycle containment.
Non-harness or undeclared event strings seen in package source
| Event string | Dispatchers | Listeners |
|---|---|---|
commands/changed |
runtime (emit) |
ui-command |
connection/reset |
runtime (emit) |
ui-command, ui-models, ui-permission, ui-settings-general |
credentials/changed |
runtime (emit) |
ui-models |
internal/dispatch |
- | commands, compact, fs, goal, goal-session, hook-protocol, llm-retry, permission, plan-mode, pty-local, runtime, sandbox-policy, scope, session, session-title, subagent, time-context, tool-todo, tools, user-approval, workflow |
internal/plugin |
- | hmr, loader, modules, webserver |
internal/service |
- | agent-presets |
internal/status |
- | agent |
locale/change |
locale (emit) |
locale |
models/changed |
runtime (emit) |
ui-models |
settings/changed |
runtime (emit) |
ui-models, ui-permission, ui-settings-general |
slash/input-begin-command |
- | ui-conversation |
slash/input-consume-token |
- | ui-conversation |
slash/input-insert-reference |
- | ui-conversation |
slash/input-insert-text |
- | ui-conversation |
slots/changed |
runtime (emit) |
- |
theme/change |
ui-theme (emit) |
ui-layout, ui-theme |
Maintenance mode: generated: Cordis event declarations and producer/listener edges are resolved from the repository TypeScript Program.