Skip to content
dsh.fish
Bundle

@dsh-external/dsh-possibility-space

Explore AI answers as a steerable two-dimensional semantic possibility space inside DeepSeek Harness.

Source
zhangguiping-xydt
License
MIT
Updated
Updated yesterday

Readme

# dsh-possibility-space

English | [中文](README.zh-CN.md)

> Stop asking for another version. Drag to the version you want.

`dsh-possibility-space` turns a DSH answer into an explorable two-dimensional semantic map, expanded directly beneath that answer. It does not generate ten candidates and choose for you. It discovers meaningful trade-offs first, then generates exactly one version at the point where you release the cursor.

![Possibility Space light precision-instrument interface inside a real DSH conversation](assets/possibility-space.webp)

![Inline DSH interaction: open, drag, inspect diff, and revisit the trail](assets/possibility-space-demo.gif)

## The interaction

Every finalized assistant answer gets a map action. Click it to expand an inline map while the answer and composer remain visible; use the expand control only when you want a fullscreen focus mode. From there you can:

1. Discover three independent semantic trade-off axes for that specific answer.
2. Pick two axes for the map.
3. Drag to preview a coordinate; release to generate one version.
4. Lock good paragraphs verbatim or add semantic invariants.
5. Inspect the diff and revisit every generated point in the version trail.
6. Copy the selected answer and save its coordinates as a personal preference. A later space with the same semantic axes restores that point without generating in the background.

The same interaction works for UI design, code architecture, writing, product strategy, and decisions because the axes are inferred from the answer rather than selected from a fixed style template.

## Install

Requires DSH `0.1.1-rc.2` or newer and Node.js 22+.

```bash
npx --yes @deepseek-ai/dsh@latest plugin --profile web add \
  github:zhangguiping-xydt/dsh-possibility-space

npx --yes @deepseek-ai/dsh@latest web
```

No separate API key is required. The plugin reuses the provider and model provenance of the answer you opened, then calls the model through the configured DSH adapter.

## Token discipline

- One model call discovers the axes when a space is first opened.
- Internal axis discovery and controlled rewrites keep the answer's provider/model. They select reasoning effort `off` only when that exact model advertises it; otherwise the adapter's valid default is preserved.
- Pointer movement makes no request; `pointerup` or an explicit Generate action makes one.
- Coordinates are quantized to `0.05` to suppress pointer noise.
- Baseline, axes, coordinate, and locks form a deterministic local cache key.
- No background candidate fan-out and no model-driven auto-selection.

## Constraint guarantees

A quote lock carries both the exact source text and its invariant. The Host rejects a variant unless every non-empty quote is preserved byte-for-byte and every lock id is acknowledged. Rejected variants never enter the trail. Custom semantic invariants cannot be mechanically proven; they remain visible for human review.

## Privacy and safety

- There is no plugin-owned cloud service. Requests stay between the browser, the authenticated DSH Host, and its configured model adapter.
- Answers, variants, locks, cache entries, and preferences live in browser `localStorage`.
- The original Session log is never rewritten.
- The Host bounds input length, lock count, output tokens, and concurrency, then validates all model JSON.
- The plugin does not run tools, edit files, or submit code.

## Architecture

```text
final assistant answer
        │ text + message id + actual model provenance
        ▼
assistant-actions slot ──► inline anchor under that DSH turn
        │                         └─ map, diff, locks, trail, optional fullscreen
        │                            local cache and preferences
        ▼
authenticated DSH Connection RPC endpoint
        │ only on axis discovery or pointer release
        ▼
ctx.llm.stream ──► the answer's configured DSH model adapter
        │
        └─ schema + lock validation ──► one variant
```

It uses the official `conversation.chat.assistant-actions` client slot. The action mounts a React Portal into that turn's existing `data-turn-tail` container, so the explorer participates in normal conversation scrolling without claiming another plugin's slot. Browser-to-Host calls use a private DSH Connection RPC interceptor. No DSH source patch is required.

## Configuration

```yaml
- id: dsh-possibility-space
  name: '@dsh-external/dsh-possibility-space'
  config:
    maxBaselineChars: 80000
    maxVariantTokens: 6000
    maxConcurrentRequests: 2
```

## Develop

```bash
corepack enable
pnpm install
pnpm run check
pnpm run test:coverage
pnpm run pack:check
```

The test suite includes inline turn mounting, pointer drag commits, preference restore, bounded history, provider capability handling, request validation, lock guarantees, and Client Slot registration. `lib/` is committed intentionally because GitHub-based DSH installation does not run a build step.

See [CONTRIBUTING.md](CONTRIBUTING.md), [SECURITY.md](SECURITY.md), and [CHANGELOG.md](CHANGELOG.md).

MIT © 2026 [Guiping Zhang](https://github.com/zhangguiping-xydt)

Install

dsh plugin --profile web add github:zhangguiping-xydt/dsh-possibility-space

Profile: web

  • This package builds from source on install. pnpm will ask you to allow its build script — that is permission to run the package’s code on your machine, outside the agent sandbox. Only allow sources you trust.
  • This source has no pinned commit, so a later push upstream changes what installs. Prefer pinning a commit.
Source