feat(desktop): DSH Electron desktop shell — harness internals visualized

Minimal Electron shell over the DSH JSON-RPC runtime — a first-look at
what a ChatGPT.app-style host on top of the DeepSeek Harness looks
like, with the harness's normally-invisible internals (trace timeline,
context surface, subagent tree, compaction, plugin registry, rubrics)
brought forward as first-class UI surfaces so plugin authors and
researchers can see what the agent is actually doing.

Runs against three keyless-to-live profiles (stdio-echo works on
master out of the box; daemon-echo / daemon-vibe-echo activate once
the daemon-demo lands; stdio-deepseek and daemon-vibe hit the real
DeepSeek API when you supply a key). HARNESS_DEV auto-resolves to the
in-repo runtime when this shell ships under examples/desktop/, so a
fresh clone launches without config; env DSH_DEV_ROOT overrides for
custom layouts, and a sibling deepseek-harness-dev/ checkout is the
original dev workflow.

Cold-clone gate (P0 fixes for first-time-clone usability):
- HARNESS_DEV: 3-candidate resolver (env → walk-up in-repo marker →
  sibling), unit-tested via mock fs so ordering is locked without
  needing either real layout on disk.
- config yml leaves rewritten at assemble time so the sibling-clone
  paths (../../deepseek-harness-dev/examples/echo-agent/…) become
  the in-repo paths (../../echo-agent/…) in the released tree —
  source yml stays usable for local dev, released tree ships a
  working shape.
- pnpm-workspace.yaml allowBuilds.electron = true (was placeholder).
- missing-key card in stdio-deepseek offers a one-click switch to
  stdio-echo (the keyless profile that works on master) rather than
  daemon-echo (blocked on the not-yet-shipped daemon-demo).
- assemble-oss-release.sh rewrites the source-side breadcrumb name
  'dsh-desktop-demo' → 'dsh-desktop' for the released package.json.

FOUC guard on the onboarding gate (41fc5df carried) keeps the
first-launch splash from flashing before the runtime probe finishes.

Test suite (1634 tests in source, 3990 in the runtime repo) covers
resolver ordering, renderer classifiers, trace timeline shape,
compaction diff rendering, rubric parity, and the missing-key
onboarding paths.
This commit is contained in:
ZiyaZhang
2026-07-18 12:59:34 -07:00
parent 67053d1cf6
commit e8f5c0b51b
378 changed files with 104431 additions and 0 deletions

View File

@@ -0,0 +1,93 @@
# JSON-RPC serving config with the real DeepSeek adapter. Needs
# DEEPSEEK_API_KEY in the environment (the desktop shell inherits it from the
# user's shell; or set it in `.env` at the DSH runtime root, which
# dsh-app-boot loads via loadEnv).
#
# Composition contract: the desktop shell announces
# capabilities.interruptions=true on initialize, so the JSON-RPC server needs
# @deepseek-ai/dsh-user-interaction to mount the interrupt bridge or
# initialize fails loud. session/list + session/events also require
# @deepseek-ai/dsh-session-query. Both are loaded below — omitting either
# leaves the shell showing runtime status "starting" indefinitely while
# stderr surfaces the failed handshake.
- id: jsonrpc
name: '@deepseek-ai/dsh-jsonrpc'
# agent-spine-demo requires an explicit `workspaceContext` (Config | false)
# because the loader changes model-visible input; there is no schema default.
# `false` = hermetic prompts (no workspace overview injected). Aligns with
# packages/examples/agent-spine-demo/src/index.ts Config schema. When we want
# a workspace overview later, swap for `{ maxBytes: 65536 }` matching the
# byte-budget pattern in examples/cordis-agent/cordis.yml.
- id: agent-core
name: '@deepseek-ai/dsh-agent-spine-demo'
config:
workspaceContext: false
- id: llm-deepseek
name: '@deepseek-ai/dsh-llm-deepseek'
config:
apiKey: !!js process.env.DEEPSEEK_API_KEY
baseURL: !!js process.env.DEEPSEEK_BASE_URL
models:
- deepseek-v4-flash
- deepseek-v4-pro
# Showcase default: pin thinking on so the reasoning fold — our headline
# visualization — is visible out of the box for a first-run user. The
# provider default is already "enabled", but a future flip would silently
# drop reasoning-delta events on this profile and take the fold with it.
# See packages/llm/llm-deepseek/src/index.ts Config for the field shape.
thinking: enabled
- id: sessions
name: '@deepseek-ai/dsh-session-persistence-jsonl'
config:
root: './.sessions'
# Host-facing session metadata: session/list and session/events require the
# session-query service and fail loud without it. The desktop shell polls
# session/list on every runtime handshake and reads session/events on
# switch-back.
- id: session-query
name: '@deepseek-ai/dsh-session-query'
# User-interaction seam: required when the JSON-RPC client announces
# capabilities.interruptions=true (the desktop shell does). Without this the
# interrupt bridge cannot mount and initialize itself fails loud with
# "jsonrpc client announced capabilities.interruptions=true but the composition
# has no ctx.userInteraction …".
- id: user-interaction
name: '@deepseek-ai/dsh-user-interaction'
- id: bash
name: '@deepseek-ai/dsh-bash-local'
# Showcase default: ship the model-facing filesystem tool suite so file edits
# render the diff card — the second headline visualization after the reasoning
# fold. This is a three-part stack (matching examples/coding-agent/cordis.yml
# — the canonical composition):
#
# 1. fs-local provides the backend that resolves paths from process.cwd()
# (schema in packages/fs/fs-local/src/index.ts).
# 2. fs-policy enforces the read-before-write / observation contract that
# tool-fs's edit/write listeners rely on.
# 3. tool-fs registers the fs.read / fs.edit / fs.write model-facing tools
# (its `inject` is ['tools', 'fs', 'systemPrompt']). Without this, no fs
# tool is exposed to the model at all — an fs.edit request would just
# make the model reply "no fs tool available", which is exactly what
# the previous default-profile behaviour did.
#
# Diff cards render only for tools with data-tool-card-family=fs (see
# src/renderer/tool-cards.js), so this stack is the sole path to the
# out-of-the-box diff-card demo.
- id: fs-local
name: '@deepseek-ai/dsh-fs-local'
config:
cwd: !!js process.cwd()
- id: fs-policy
name: '@deepseek-ai/dsh-fs-policy'
- id: tool-fs
name: '@deepseek-ai/dsh-tool-fs'