feat(scope): dsh-scope scoped-context registration primitive

createScope(ctx, key) mints a tagged context over a synchronously-usable
no-op-plugin fiber (one fact drives visibility AND lifetime); scopeOf reads
the tag through the prototype chain; scopeTarget(base, key) builds the
scope-filtered dispatch carrier over cordis Context.filter, composing the
base's own filter, branded Scoped<T> and runtime-marked for the dev
invariants. Scope.rawDispose exposes the exact cordis disposer so a
composite effect can nest the scope's teardown at its yield position.
This commit is contained in:
Tianyi Cui
2026-07-08 23:54:03 +08:00
parent dabc5e6225
commit 32db205c10
10 changed files with 525 additions and 0 deletions

View File

@@ -24,6 +24,7 @@
{ "path": "./packages/util/brand" },
{ "path": "./packages/llm/llm" },
{ "path": "./packages/core/session" },
{ "path": "./packages/core/scope" },
{ "path": "./packages/session-persistence/session-persistence" },
{ "path": "./packages/session-persistence/session-persistence-jsonl" },
{ "path": "./packages/session-persistence/session-persistence-sqlite" },