Files
deepseek-harness/examples
_Kerman c0ef93efc8 Merge remote-tracking branch 'origin/master' into xtr/react-loop-simplification
# Conflicts:
#	.agents/notes/implemented/architecture/2026-07-22-unified-send-and-coalesced-user-messages.i18n.yaml
#	.agents/notes/implemented/architecture/2026-07-22-unified-send-and-coalesced-user-messages.md
#	.agents/notes/implemented/architecture/2026-07-22-unified-send-and-coalesced-user-messages.zh.md
#	.agents/notes/implemented/feature/2026-07-21-tui-skill-slash-command.i18n.yaml
#	.agents/notes/implemented/feature/2026-07-21-tui-skill-slash-command.md
#	.agents/notes/implemented/feature/2026-07-21-tui-skill-slash-command.zh.md
#	.agents/notes/implemented/simplification/2026-07-17-one-send-one-turn.i18n.yaml
#	.agents/notes/implemented/simplification/2026-07-17-one-send-one-turn.md
#	.agents/notes/implemented/simplification/2026-07-17-one-send-one-turn.zh.md
#	docs/architecture.i18n.yaml
#	docs/cordis-catalog/events.md
#	docs/cordis-catalog/services.md
#	docs/core-data-structures/core.i18n.yaml
#	docs/core-data-structures/core.md
#	docs/core-data-structures/core.zh.md
#	docs/defensive-patterns.i18n.yaml
#	packages/client/runtime/src/client/sessions/session.ts
#	packages/client/runtime/tests/queue-store.spec.ts
#	packages/context/time-context/tests/time-context.spec.ts
#	packages/context/workspace-context/tests/workspace-context.spec.ts
#	packages/cordis/tool-cordis/src/api-catalog.ts
#	packages/core/agent-loop/README.i18n.yaml
#	packages/core/agent-loop/README.md
#	packages/core/agent-loop/README.zh.md
#	packages/core/agent-loop/src/agent.ts
#	packages/core/agent/README.i18n.yaml
#	packages/core/agent/README.md
#	packages/core/agent/README.zh.md
#	packages/core/agent/src/types.ts
#	packages/core/agent/tests/agent.spec.ts
#	packages/core/scope/src/scoped-events.generated.ts
#	packages/goal/command-goal/tests/command-goal.spec.ts
#	packages/goal/goal-session/src/index.ts
#	packages/goal/goal-session/tests/goal-session.spec.ts
#	packages/goal/goal/tests/goal.spec.ts
#	packages/goal/goal/tests/projection.spec.ts
#	packages/goal/tool-goal/tests/tool-goal.spec.ts
#	packages/host/apiproxy/src/api-proxy.ts
#	packages/host/apiproxy/src/api/events.schema.ts
#	packages/host/apiproxy/src/api/events.ts
#	packages/host/apiproxy/tests/api-proxy-workspace.spec.ts
#	packages/llm/llm/README.i18n.yaml
#	packages/llm/llm/README.zh.md
#	packages/llm/llm/src/index.ts
#	packages/pty/pty-local/tests/index.spec.ts
#	packages/pty/pty-local/tests/local.spec.ts
#	packages/pty/pty/tests/service.spec.ts
#	packages/pty/tool-pty/tests/loader-composition.spec.ts
#	packages/pty/tool-pty/tests/tools.spec.ts
#	packages/skill/tool-skill/tests/tool-skill.spec.ts
#	packages/tasks/tasks-local/tests/tasks.spec.ts
#	packages/ui/tui/src/index.ts
#	packages/ui/tui/tests/harness.ts
#	packages/ui/tui/tests/tui.spec.ts
#	scripts/gen-cordis-catalog.ts
#	scripts/type-equiv.manifest.json
2026-07-30 14:04:53 +08:00
..
2026-07-20 20:16:41 +08:00

Examples

English | 中文

Runnable demos (not workspaces) that showcase how the harness is wired. Each example is a thin leaf: a cordis.yml that picks swappable backends, loads one app package, and may add optional product tools. The composition and boot glue live in @deepseek-ai/dsh-tui-demo, @deepseek-ai/dsh-cli-demo, @deepseek-ai/dsh-acp-demo, and their shared @deepseek-ai/dsh-agent-spine-demo bundle. There is no start.ts; the terminal demo:* scripts boot through the dsh CLI (which mounts the tui-demo bundle), and the headless/ACP scripts invoke the cli-demo/acp-demo bins.

headless-agent

A non-interactive agent demo that accepts one positional task, runs one complete model/tool turn on the @deepseek-ai/dsh-cli-demo app, persists a fresh session, prints text, json, or stream-json, and exits.

Run with: pnpm run demo:headless "task" (needs DEEPSEEK_API_KEY). See headless-agent/README.md for the output contract, safety boundaries, and snapshot suite.

tui-agent

The interactive coding agent: DeepSeek V4, filesystem and bash tools, subagents, workflows, todo_write, compaction, and the full-screen TUI. It is also the home of TUI PTY and snapshot scenarios.

Run with: pnpm run demo:tui (needs DEEPSEEK_API_KEY). Run its Code Mode overlay with pnpm run demo:code-mode. See tui-agent/README.md for controls and composition.

jsonrpc-agent

An unattended coding agent driven through the Python SDK: JSON-RPC stdio, foreground-only bash, read / write / edit, one foreground subagent, todo_write, JSONL persistence, and compaction. It excludes terminal UI, stdout logging, approvals, skills, and background task controls. See jsonrpc-agent/README.md.

cordis-agent

The self-referential demo: the coding spine plus @deepseek-ai/dsh-tool-cordis, whose three tools (cordis_inspect / cordis_mount / cordis_unmount) let the agent inspect the current DSH process, mount model-written temporary Plugins (an event listener, a brand-new tool, or a service another temporary Plugin injects), and unmount them again. These Plugins exist only in memory and share one internal cordis-dynamic fiber subtree; ctx.fs/ctx.web ride along provider-only as capabilities they can use.

Run the TUI with pnpm run demo:cordis, the browser UI at http://127.0.0.1:3081 with pnpm run demo:cordis web, or the ACP server with pnpm run demo:cordis acp (all need DEEPSEEK_API_KEY). See cordis-agent/README.md for the staged demo script and the toolset Agent Note for the design and sandbox caveats.

acp-agent

An agent exposed as an Agent Client Protocol (ACP) automation server over JSON-RPC stdio, via @deepseek-ai/dsh-acp-demo. Programmatic clients create fresh sessions, send text prompts, consume committed assistant text, answer one-shot permission requests, and cancel work. It owns the ACP keyless snapshot suite.

Run with: pnpm run demo:acp (needs DEEPSEEK_API_KEY); pnpm run demo:code-mode acp boots the same server in Code Mode via the code-mode.cordis.yml overlay. See acp-agent/README.md for the protocol and snapshot-test contracts.

The default cordis.yml composes @deepseek-ai/dsh-sandbox-local, @deepseek-ai/dsh-bash-sandbox, and @deepseek-ai/dsh-user-approval. workspace-write confines bash and filesystem mutations to each session workspace; a wider retry becomes a one-shot machine permission request over ACP.