dsh-plugin-trim
Trims the tool surface per session. Each session owns a profile — a tool whitelist — applied through `agent.ctx.tools.restrict({ allow })` on that agent scope only, and switching one session never touches another; `full` is the built-in no-restriction profile. The provider only picks the default: a session created or switched onto a local provider (explicit `localProvider`, `routes`, a loopback/private baseURL, or a local-ish id) gets the `local` profile, a cloud one gets `full`, and the re-plan runs on model-selection events plus one delayed pass because the projection can land after the event. Profiles are editable from the panel and persisted under `~/.dsh/plugin-trim-state.json`; an explicit per-session choice overrides the provider default until cleared. A separate, opt-in layer physically disables whole plugin entries through `pluginManager.setPluginEnabled` — that one is profile-scoped by API and the panel labels it as such rather than pretending it can be per-session. A `tool_trim` tool exposes list/status/profile/set/apply/restore to the model. The panel is served by a loopback-only HTTP server the plugin starts on its own fixed port — `http://127.0.0.1:12256/` (auto-bumps on collision, configurable) — because the DSH port changes on every restart and a locally linked package gets no market card in the sidebar; it lists live sessions with their profile and tool count, an editor per profile, a provider picker limited to providers declared in the profile or currently in use, and the full plugin list with search and paging. Two implementation details worth knowing: `tools.restrict()` is an intersection and cannot widen, so the old restriction is released before the visible set is read — otherwise switching to a bigger profile would shrink instead of grow; and ever
Overview
Trims the tool surface per session. Each session owns a profile — a tool whitelist — applied through `agent.ctx.tools.restrict({ allow })` on that agent scope only, and switching one session never touches another; `full` is the built-in no-restriction profile. The provider only picks the default: a session created or switched onto a local provider (explicit `localProvider`, `routes`, a loopback/private baseURL, or a local-ish id) gets the `local` profile, a cloud one gets `full`, and the re-plan runs on model-selection events plus one delayed pass because the projection can land after the event. Profiles are editable from the panel and persisted under `~/.dsh/plugin-trim-state.json`; an explicit per-session choice overrides the provider default until cleared. A separate, opt-in layer physically disables whole plugin entries through `pluginManager.setPluginEnabled` — that one is profile-scoped by API and the panel labels it as such rather than pretending it can be per-session. A `tool_trim` tool exposes list/status/profile/set/apply/restore to the model. The panel is served by a loopback-only HTTP server the plugin starts on its own fixed port — `http://127.0.0.1:12256/` (auto-bumps on collision, configurable) — because the DSH port changes on every restart and a locally linked package gets no market card in the sidebar; it lists live sessions with their profile and tool count, an editor per profile, a provider picker limited to providers declared in the profile or currently in use, and the full plugin list with search and paging. Two implementation details worth knowing: `tools.restrict()` is an intersection and cannot widen, so the old restriction is released before the visible set is read — otherwise switching to a bigger profile would shrink instead of grow; and ever
Installation
Version compatibility
Compatibility is unconfirmed. Check the project documentation for supported versions.
Installation notes
- May run terminal commands