Saltar al contenido principal
D

dsh-preset-composer

danonyvincit/dsh-preset-composer

Settings page for editing DSH agent presets as a plugin tree, with per-plugin parameter forms and custom presets.

Instalar

dsh plugin --profile web add github:danonyvincit/dsh-preset-composer

README

dsh-preset-composer

English | 简体中文

A visual editor for DSH agent presets. It adds a Preset composer section to Settings, next to Agent presets.

icon

What it does

  • Lists every agent preset, shipped and custom, and shows its plugin rows, parameters and !!js expressions read-only.
  • Edits a preset as a tree: add, remove, reorder and drag plugin rows, toggle them on or off, and put rows inside cordis:group groups.
  • Opens a parameter dialog for a plugin row. Fields come from the installed DSH docs/config-catalog.md (144 modules in DSH 0.2.2-rc.5) with defaults from the config schema. Plugins missing from the catalog fall back to raw JSON.
  • Groups the plugin library by purpose (tools, prompt, models, subagents, sessions, permissions, shell, host services, interface, experimental) and searches by name, title and description.
  • Warns when a plugin needs a service that nothing in the preset provides (for example, persistent bash needs terminals, which @deepseek-ai/dsh-terminal provides) and offers a one-click button to add the provider. The plugin library marks such plugins with Needs: …. The warning does not block saving.
  • Warns when a provider such as dsh-terminal sits outside a group that isolates its service. The Host rejects that with Preset services require isolate realms: terminals. One click moves the provider and the plugins that use it into a group with isolate: { terminals: true }, the same layout as the built-in minimal preset.
  • Warns when two enabled plugins register the same tool name (for example dsh-tool-bash and dsh-tool-bash-persistent both register bash, which the Host rejects with tool "bash" is already registered in this scope) and offers a button to disable the later one.
  • Creates and duplicates custom presets. Saving a shipped preset writes an override through the configEditor service; Reset removes it.

Preset changes apply to new sessions. Existing sessions keep the preset they started with.

Install

Requires DSH 0.2.x. Download dsh-preset-composer.tgz from the latest release, then:

dsh plugin --profile <name> add ./dsh-preset-composer.tgz

Or from source: dsh plugin --profile <name> add github:DAnonyvinciT/dsh-preset-composer (pnpm needs allowBuilds approval only if a build script exists; this package has none).

Restart DSH after installing.

Parts

  • lib/index.js: Host plugin. Serves GET /api/preset-composer/state and POST /api/preset-composer/{save,delete,reset}.
  • lib/store.js: Host plugin (dsh-preset-composer/store). Registers valid custom presets from its own presets config with the agentPresets registry.
  • lib/model.js: validation, normalization, revisions and the plugin palette.
  • lib/deps.js and lib/deps.json: which plugins need a provider row for which service. lib/deps.json is generated by scripts/gen-deps.mjs; rerun it after upgrading DSH.
  • lib/catalog.js: parses the installed config-catalog.md into per-plugin field lists.
  • lib/defaults.json: parameter defaults generated by scripts/gen-defaults.mjs from dsh web --dump-config-schema. Regenerate after upgrading DSH.
  • client.js: the Settings section (React, dpc- prefixed styles, host theme tokens).

Develop

node --test test/
node --check client.js lib/*.js

Limits

  • The read-only view shows configuration values as stored, including any secrets in plain text.
  • Parameter defaults are missing for some modules; those fields show no default.
  • Preset editing needs an editable profile (the plugin must be installed in the profile root).

License

MIT

Plugins relacionados