Machine-produced by `pnpm run rescope-vendor --apply` plus the regeneration it prints: `pnpm install` for the lockfile, `pnpm run gen-third-party-notices`, `verify-translation-pairing --write` for the touched bilingual pairs, `gen-doc-graphs`, and one typert snapshot whose ids embed character offsets. `pnpm run rescope-vendor --check` verifies the result. Renames nine vendored packages (cordis, cosmokit, schemastery and the six @cordisjs plugins) and every reference that resolves them: manifest names and dependency keys, module specifiers including declare-module merges, cordis.yml plugin names, tsconfig paths, every Markdown fence, and `docs/` prose. Directory names, upstream versions, and dependency ranges are unchanged, so vendor/README.md still reads as an upstream snapshot; its manifest table gains an upstream-name column so THIRD_PARTY_NOTICES keeps MIT attribution pointed at each fork's origin. The tutorial tier follows the rename end to end: its yaml fences named plugins the Loader can no longer resolve, its `ts ignore-check` fences disagreed with the compiled fences beside them, and its prose quoted both. The contracts that told readers to keep upstream names — the root convention and the vendoring cookbook's tree comment and manifest invariant — now say to rescope instead. Two rules read `@deepseek-ai/` as "another workspace plugin": the client bundle purity gate now names the vendored libraries a browser bundle inlines, and the files where a bare `cordis` is an agent-preset id keep that product data.
@deepseek-ai/dsh-permission
English | 中文
User-facing permission presets through ctx.permission (PermissionService). Each configured name bundles sandbox/mode with approval/policy; the defaults are workspace-write (workspace-write + ask) and danger-full-access (danger-full-access + never). UI adapters may expose the table as one selector, while sandbox execution and approval continue to consume their own knobs.
set(session, name) records a changed selection in a log-only permission/preset event, then calls each knob's setter only when its effective value changes. The selection event precedes the knob events and preserves user intent when presets share a bundle; a net-zero selection appends nothing. current(events) prefers a still-matching recorded selection, then the first matching table entry, and otherwise returns custom. Clients may display custom as the current value, but cannot select it.
The service owns the permission Settings namespace. Its defaultPreset is the default for future sessions: the composition entry uses Config.defaultPreset, or infers the preset matching the composed sandbox and approval defaults when omitted. A committed Settings change is read when the next session is created; creation pins permission/preset, sandbox/mode, and approval/policy into that session, so later changes never alter an existing session. A resumed seed, including an explicitly empty one marked by session/end-seed, preserves its effective permission and receives only missing durable facts rather than the latest user default. Mounting the service also sweeps already-live sessions, so an HMR replacement pins any session created while the plugin was absent.
The service requires a confining ctx.bash executor and ctx.approval. A table entry named custom throws at load. When composition defaults match no preset, the plugin requires an explicit defaultPreset; an independently constructed zero-event session may still derive custom. See the sandbox switching design.
Two optional children ship the product surfaces over the same service: a permissions session-projection unit (src/types.ts declares the key; the unit folds the three whole-value knob events and views the select — table options plus a current-only custom — over the composition defaults) and the /permission command (bare invocation reports the current preset and the table; a preset argument switches through set). Each child activates only when its registry (ctx.sessionProjections / ctx.commands) is composed.
Model Experience
Indirectly, through dsh-user-approval and dsh-tool-bash, which render the approval-policy prompt, switch notice, and sandboxed tool outcomes selected by this service's knob events; permission/preset itself is log-only.
KV Cache effect
No direct invalidation; the named consumer owns any request-prefix changes.
Known Limitations and Deferred Work
- Only two mechanism knobs are bundled — presets select sandbox mode and approval policy; an agent/profile choice is not part of
PresetSpecyet. customis derived-only — callers can switch away from an unmatched knob combination but cannot target or persist a named custom preset through this service.- The preset table is process-level — configuration is fixed for the plugin lifetime; changing available presets requires reloading the plugin.
- Stored defaults must remain in the preset table — removing the referenced preset makes Permission settings registration fail until the
permissionsection insettings.yamlis updated or reset.