dsh-next-prompt
Standalone next-prompt suggestions for DeepSeek Harness Web.
@sitex/dsh-next-prompt adds a Cordis host plugin and one additive Web client occupant in
conversation.input.dock. After an eligible completed assistant turn, the plugin may generate one
concise next user prompt. Selecting the suggestion fills the public composer draft through
inputActions.setDraft; it never submits the draft.
The package targets DeepSeek Harness 0.1.1-rc.2 and is independent of tools-dsh.
Requirements
- Node.js
>=22.19.0
- pnpm
11.24.0 through Corepack
- DeepSeek Harness
0.1.1-rc.2
All declared DSH development and peer packages are pinned exactly to 0.1.1-rc.2.
Installation
Install the package into a DSH profile:
corepack pnpm exec dsh plugin --profile default add @sitex/dsh-next-prompt
The package ships cordis.patch.yml. DSH composes one dsh-next-prompt row whose package root is
the Cordis host plugin; the same package manifest supplies the official Web client metadata.
This repository does not publish an npm release as part of issue #1. Until a release exists, install
a locally packed tarball:
corepack pnpm install --frozen-lockfile
corepack pnpm build
corepack pnpm pack --pack-destination .dsh-smoke
corepack pnpm exec dsh plugin --profile default add .dsh-smoke/sitex-dsh-next-prompt-0.1.0.tgz
Eligibility
A suggestion is generated only when all of these conditions hold:
- The latest turn ended with reason
completed.
- The session is idle and has no prompt or agent error.
- The input phase is
plain.
- The trimmed draft is empty.
- There are no draft images.
- Recent public conversation context is nonempty.
- The completed turn exposes a provider and model route.
Running, error, cancelled, aborted, blocked, interrupted, nonempty-draft, image-draft, session-switch,
timeout, RPC failure, invalid-response, empty-output, and superseded states hide the suggestion.
Each sessionId:turnEndSeq receives at most one generation attempt. A successful suggestion is
cached for that turn and returns when the draft becomes eligible again. A failed attempt is not
retried for the same turn. A newer turn aborts the older request, and stale results never publish.
Generation boundary
- Context contains only recent public user and assistant text from the conversation snapshot.
- Context is bounded to 4,000 characters.
- Output is bounded to 80 model tokens and 120 displayed graphemes.
- Generation receives the completed turn's public provider/model route.
tools is always an empty array.
- The host makes one LLM stream attempt per eligible turn.
- Output is normalized to one physical line without labels, list markers, or code fences.
The plugin does not read transcript DOM, hidden model input, tool results, images, credentials, or
provider-private state. It executes no tool or capability and performs no file mutation.
Composer behavior
The client registers only conversation.input.dock at order 10. It renders one semantic button
named Fill draft with suggested prompt. Native click, Enter, and Space activation call only
inputActions.setDraft.
The package deliberately does not:
- Submit or auto-submit the draft.
- Replace the composer or conversation surface.
- Monkey-patch textarea, placeholder, backdrop, mirror, or transcript DOM.
- Intercept Tab or ArrowRight.
- Register sidebar, overlay, Projects, inventory, CLI, MCP, or Herdr surfaces.
DSH 0.1.1-rc.2 exposes no public ghost-text or key-acceptance seam, so input-dock fill UI is the
supported implementation boundary.
The RPC is registered with DSH authority loopback. This package follows the DSH plugin trust
model: locally installed Cordis plugins and the local Web client are trusted profile members. It is
not a network API and is not intended to provide an authorization boundary between mutually
untrusted local plugins.
Architecture
src/contracts.ts: bounded Zod request/response schemas and protocol constants.
src/context.ts: public conversation text projection.
src/controller.ts: one-attempt ledger, caching, timeout, and stale cancellation.
src/rpc.ts: no-tools host LLM stream handler.
src/plugin.ts: loopback Cordis RPC registration.
src/client/NextSuggestionDock.tsx: public composer state projection and draft-fill UI.
src/client/index.tsx: browser RPC bridge, single slot registration, and style ownership.
src/client/styles.ts: DSH-token-only dock styling.
See DESIGN.md for the visual and accessibility contract.
Development
corepack pnpm install --frozen-lockfile
corepack pnpm lint
corepack pnpm typecheck
corepack pnpm test
corepack pnpm build
corepack pnpm test:package
corepack pnpm smoke:profile
smoke:profile builds and packs the repository, installs only the tarball into isolated DSH
profiles, verifies the Cordis patch and exports from an unrelated working directory, starts an
isolated real DSH Web server, and inspects the served browser module.
Scope
This package contains only next-prompt functionality. Projects, portfolio inventory, CLI, MCP,
Herdr, sidebar, overlay, generated history, and tools-dsh compatibility wrappers are intentionally
excluded.
License
MIT