Every live agent owns a dsh-scope context (Agent.ctx, key = the agent), minted inside the loop's composite lifecycle effect: registrations through it are agent-visible and agent-lifetime, and agent.ctx listeners hear only that agent's dispatches. The composite yields the scope's raw disposer first (identity-nested, no un-nested window), then session entry (scoped enter captures the session carrier), then registration; teardown runs stop/drain -> unregister -> detach session -> unwind scope, keeping store/registry rollback synchronous on every failure path. CreateAgentOptions.setup(agentCtx) runs after the scope is minted and the agent registered, before agent/session-start and the loop start — the slot where a creator composes the agent's scoped world (persona sections, restrict(), scoped tools); a throwing setup unwinds inside the rollback boundary. Setup registers, it never drives. agentEvents(ctx, agent) fuses the scope carrier with the injected subject argument for every agent/* dispatch (the correct dispatch is the shortest spelling); assembleContextFor(agent) pairs the agent DX field with the scope layer selector. All loop/agent/registry dispatch sites converted; agent/* event declarations carry this: Scoped<Agent>; ctx.agent is a safe root accessor defaulting undefined, shadowed by each agent context.
43 lines
696 B
JSON
43 lines
696 B
JSON
{
|
|
"extends": "../../../tsconfig.base.json",
|
|
"compilerOptions": {
|
|
"rootDir": "src",
|
|
"outDir": "lib/types"
|
|
},
|
|
"include": [
|
|
"src"
|
|
],
|
|
"references": [
|
|
{
|
|
"path": "../../../vendor/cosmokit"
|
|
},
|
|
{
|
|
"path": "../../../vendor/cordis"
|
|
},
|
|
{
|
|
"path": "../../../vendor/schemastery"
|
|
},
|
|
{
|
|
"path": "../../llm/llm"
|
|
},
|
|
{
|
|
"path": "../../core/session"
|
|
},
|
|
{
|
|
"path": "../../session-persistence/session-persistence"
|
|
},
|
|
{
|
|
"path": "../../core/system-prompt"
|
|
},
|
|
{
|
|
"path": "../../core/tools"
|
|
},
|
|
{
|
|
"path": "../../core/agent"
|
|
},
|
|
{
|
|
"path": "../../core/scope"
|
|
}
|
|
]
|
|
}
|