Chuyển đến nội dung chính

dsh-preset-persona-editor

Đã xác minh

@yadsh/dsh-preset-persona-editor · v0.2.2 · MIT · Giao diện web

Read what an agent preset contributes to the prompt from the DeepSeek Harness settings UI: the persona prefix, suffix, complete mode and runtime-context toggle the preset composes with, and the named prompt sections it registers in its own name

Cài đặt

dsh plugin add @yadsh/dsh-preset-persona-editor

Xác nhận layer đã áp bằng dsh --profile default --dump-config — xem hướng dẫn cài plugin.

Mã nguồn

Phát hành lên npm mà không có repository công khai. Hãy kiểm tra nội dung package trước khi cài.

Thẻ

Readme

@yadsh/dsh-preset-persona-editor

Read what an agent preset contributes to the prompt — its system-prompt prefix and suffix, complete mode, runtime-context toggle, and the named sections it registers in its own name — from the DeepSeek Harness settings UI, without hand-editing the preset's composition.

The page appears in Settings as Persona, right beside the deployment's own Agent Presets page, and reads the same thing that page composes: the rows of a preset composition.

It reads, and does not write. Since DeepSeek Harness 0.1.7-rc.2 the Host has no durable preset-authoring path — the roster's authorable root and its copy operation were deleted, not relocated — so this page reports what a preset composes rather than changing it. The decision is D2 of §10 of the migration guide, and §0 of the package specification names the issue a restored write path is waiting on. Neither document ships in the tarball, so both are linked where the repository keeps them.

Features

  • One card per preset, badged Cannot compose, Unreadable, Two rows, Custom or Inherited — the first two say what the registry could not do, the rest say which persona the composition carries.
  • The persona's four values in the persona's own semantics: the prefix replaces the deployment's persona prefix for this preset, the suffix renders after the first-party guidance.
  • Complete mode, with the warning that this persona then replaces the agent's other system-prompt sections — stated wherever it is found on.
  • Runtime context (includeRuntimeContext, on by default) shown per preset: whether its sessions receive the dynamic sandbox/approval snapshots.
  • Prompt sections (advanced) — a preset can contribute named, ordered sections of its own: name, order, text, and the enabled value each row carries. A section registered under a first-party name (deployment:*, tool:*, …) shadows that section for this preset's sessions. The list is data in the composition row; the preset ships a small registrar (prompt-sections.mjs) that mounts it, so the sections keep working with this plugin uninstalled.
  • Preview of the persona and the section list in the YAML shape the composition carries, and of where they land in the assembled prompt, ordered by the harness's own section vocabulary.
  • The composition itself, for the cases this page can only describe: a row that carries keys beyond the four, a managed key set to a !!js expression, or more than one persona row in one preset.

Install

dsh plugin --profile web add @yadsh/dsh-preset-persona-editor

From a checkout of this repository:

pnpm install
pnpm --filter @yadsh/dsh-preset-persona-editor build
dsh plugin --profile web add ./plugins/dsh-preset-persona-editor

Restart the deployment (or reload the browser page) and open Settings → Persona, on a desktop-width viewport. That step walks the Host's own section nav, and on 0.1.7-rc.2 the nav's buttons are invisible at 390px with nothing in their place, so at phone width this page has no entry point — the Host's operator layer, not this page. To check this page at a narrow width, constrain the settings dialog's container rather than the viewport.

Configuration

The plugin takes no configuration: it writes nothing, so it has no ceilings to enforce. Its row in the deployment composition is the plain two-field entry the install command above creates.

A row that still names the four ceilings the write path carried — allowComplete, maxPersonaBytes, maxSections, maxSectionsBytes — changes nothing, and it is worth knowing why rather than finding out by experiment: the plugin declares no Config schema, so the Host hands that block to it unvalidated and the plugin reads none of it. Drop the config: key with the writer that needed it.

What a preset with sections looks like

- id: prompt-sections
  name: ./prompt-sections.mjs
  config:
    sections:
      - name: team:style
        order: 2500
        text: |-
          Answer in the user's language.
          Prefer small, reviewable changes.
        enabled: true

prompt-sections.mjs is a small registrar the preset carries beside its composition. It reads the row's list and registers each enabled section through ctx.systemPrompt, which is what makes a section of this preset shadow a deployment-global section of the same name. It imports nothing from this plugin, so the preset keeps composing with the plugin uninstalled. It is code, so this page does not read it as data: it reports the list the composition names, and that is what the preset declares — whether the module beside it matches is the Loader's answer at mount, and a preset that cannot compose arrives as broken, with the registry's own reason on the card.

What the page shows

  • The persona's four values as the composition carries them, plus the section list, in the same YAML shape a hand edit would use.
  • Keys the page does not describe: a persona row that carries more than the four, a managed key set to a !!js expression (whose value is not the text shown), or more than one persona row in one preset — each is named on the card, because then no single value is "the" persona.
  • The composition text itself, for every case the four fields cannot hold.
  • Two failures that are not the same failure: a preset the registry calls broken cannot start a session, yet its declarations still render, so its readings are real; a preset whose composition the registry will not render has no readings, and the card carries the registry's reason for that. The registry answers a broken preset with a tree — the row that refused, and beneath it each cause it wrapped — so the closed card states that tree's first line and the opened card states every line, breaks included: a settings card has room for one line of description, and the line it uses is the host's own.
  • A host that answers differently than either of those says so too. Inside the <0.2.0 half of the compatibility range a deployment may publish no readDocument() at all, or answer it with something that is not a composition; the card names which of the two happened, in this page's words, rather than blaming the preset or showing a TypeError. What the host's own reason may contain is bounded by §2 of the package specification: the registry's failures name preset ids, and that text is already on the host's own list Remote.
  • A roster that refuses to refresh says so. The rows stay on screen — dropping them would answer a failed list() with a deployment that composes no presets — and the reason arrives above them: the screen that draws a list draws no failure of its own otherwise, and rows held on screen after a refused refresh are rows the page has not told anyone are stale. The notice carries a Dismiss control, because the page keeps the message for the user and opening a preset is not the same as having read it.
  • A roster that has gone stale on its own can be asked again. Reload the roster re-reads the list under the rows it draws: a preset waiting on a service that has not mounted yet becomes healthy by itself, and the page that read it once would otherwise keep saying so after the deployment stopped agreeing. The reader's own Reload re-reads the open preset; the roster's re-reads the list.
  • Presets apply to new sessions: DSH composes an agent from the preset it names when the session starts, and a running session keeps the composition it began with. The page states this instead of implying a live swap.

Compatibility

  • DeepSeek Harness >=0.1.7-rc.2 <0.2.0 (tested against 0.1.7-rc.2).
  • Requires the deployment to mount @deepseek-ai/dsh-agent-preset-registry (the agentPresets service) and @deepseek-ai/dsh-system-prompt.
  • Client surface: settings.section and the Typert Remote namespace presetPersonaEditor.
  • Node ^22.19.0 || >=24.0.0.

Development

pnpm install
pnpm --filter @yadsh/dsh-preset-persona-editor check

check runs lint, typecheck, the test suite (composition surgery, the reading layer, the service's wire surface, the page's store and wiring, and the built browser bundle), the build, and the package gate.

To try it against a local deployment, build the package, add it to a profile, and restart that deployment — the host half is loaded from the composition and the browser half is served as /plugins/@yadsh/dsh-preset-persona-editor/client.js.

License

MIT. See LICENSE.