deepseek-harness/examples/acp-agent
pku-xht 84cbec28e9 Merge remote-tracking branch 'origin/master' into codex/localized-chinese-doc-links
# Conflicts:
#	.agents/notes/implemented/architecture/2026-06-11-content-block-vocabulary.i18n.yaml
#	.agents/notes/implemented/architecture/2026-06-11-content-block-vocabulary.zh.md
#	.agents/notes/implemented/architecture/2026-06-18-shared-persistence-write-coordinator.i18n.yaml
#	.agents/notes/implemented/architecture/2026-07-10-single-file-executable-sdk-runtime-distribution.i18n.yaml
#	.agents/notes/implemented/architecture/2026-07-10-single-file-executable-sdk-runtime-distribution.zh.md
#	.agents/notes/implemented/bug-fix/2026-07-29-pnpm-setup-runner-isolation.i18n.yaml
#	.agents/notes/implemented/bug-fix/2026-07-29-pnpm-setup-runner-isolation.zh.md
#	.agents/notes/implemented/bug-fix/2026-08-18-request-image-payload-bound.i18n.yaml
#	.agents/notes/implemented/bug-fix/2026-08-18-request-image-payload-bound.zh.md
#	.agents/notes/implemented/feature/2026-07-06-sandbox.i18n.yaml
#	.agents/notes/implemented/feature/2026-07-06-sandbox.zh.md
#	.agents/notes/implemented/feature/2026-07-16-persistent-pty-sessions.i18n.yaml
#	.agents/notes/implemented/feature/2026-07-21-cross-session-references.i18n.yaml
#	.agents/notes/implemented/feature/2026-07-21-cross-session-references.zh.md
#	.agents/notes/implemented/feature/2026-07-22-web-multimodal-image-input-and-durable-attachments.i18n.yaml
#	.agents/notes/implemented/feature/2026-07-22-web-multimodal-image-input-and-durable-attachments.zh.md
#	.agents/notes/implemented/feature/2026-07-27-web-subagent-conversations.i18n.yaml
#	.agents/notes/implemented/feature/2026-07-31-permission-default-for-new-sessions.i18n.yaml
#	.agents/notes/implemented/feature/2026-08-03-web-search-source-scroll.i18n.yaml
#	.agents/notes/implemented/feature/2026-08-03-web-search-source-scroll.zh.md
#	.agents/notes/implemented/feature/2026-08-04-claude-code-and-codex-subagent-backends.i18n.yaml
#	.agents/notes/implemented/feature/2026-08-04-claude-code-and-codex-subagent-backends.zh.md
#	.agents/notes/implemented/feature/2026-08-05-agent-teams.i18n.yaml
#	.agents/notes/implemented/feature/2026-08-05-agent-teams.zh.md
#	.agents/notes/implemented/feature/2026-08-11-workspace-sidebar-order-and-folding.i18n.yaml
#	.agents/notes/implemented/feature/2026-08-15-product-subagent-noninteractive-permissions.i18n.yaml
#	.agents/notes/implemented/process/2026-07-21-serial-cross-platform-ci-reference.i18n.yaml
#	.agents/notes/implemented/process/2026-07-21-serial-cross-platform-ci-reference.zh.md
#	.agents/notes/implemented/process/2026-07-22-evidence-based-larger-hosted-runners.i18n.yaml
#	.agents/notes/implemented/process/2026-07-22-evidence-based-larger-hosted-runners.zh.md
#	.agents/notes/implemented/process/2026-07-23-portable-required-pull-request-ci.i18n.yaml
#	.agents/notes/implemented/process/2026-07-23-portable-required-pull-request-ci.zh.md
#	.agents/notes/implemented/testing/2026-07-24-web-gui-browser-e2e-lane.i18n.yaml
#	.agents/notes/implemented/testing/2026-07-24-web-gui-browser-e2e-lane.zh.md
#	.agents/notes/implemented/testing/2026-07-30-web-browser-snapshot-ci-gate.i18n.yaml
#	.agents/notes/implemented/testing/2026-07-30-web-browser-snapshot-ci-gate.zh.md
#	.agents/notes/proposed/architecture/2026-07-27-session-projection-and-command-log.i18n.yaml
#	README.i18n.yaml
#	README.zh.md
#	docs/architecture.i18n.yaml
#	docs/architecture.zh.md
#	docs/development.i18n.yaml
#	docs/development.zh.md
#	docs/persistence-catalog.i18n.yaml
#	docs/persistence-catalog.zh.md
#	docs/subsystems/README.i18n.yaml
#	docs/subsystems/README.zh.md
#	docs/subsystems/agent-team.i18n.yaml
#	docs/subsystems/agent-team.zh.md
#	docs/subsystems/client-modules.i18n.yaml
#	docs/subsystems/client-modules.zh.md
#	docs/subsystems/commands.i18n.yaml
#	docs/subsystems/commands.zh.md
#	docs/subsystems/persistence.i18n.yaml
#	docs/subsystems/persistence.zh.md
#	docs/subsystems/session-reference.i18n.yaml
#	docs/tool-catalog.i18n.yaml
#	docs/tool-catalog.zh.md
#	docs/user/guide/providers.i18n.yaml
#	docs/user/guide/providers.zh.md
#	packages/README.i18n.yaml
#	packages/README.zh.md
#	packages/bundle/web-app/README.i18n.yaml
#	packages/bundle/web-app/README.zh.md
#	packages/client/README.i18n.yaml
#	packages/client/README.zh.md
#	packages/client/connection/README.i18n.yaml
#	packages/client/connection/README.zh.md
#	packages/client/ui-conversation/README.i18n.yaml
#	packages/client/ui-conversation/README.zh.md
#	packages/client/ui-primitives/README.i18n.yaml
#	packages/client/ui-primitives/README.zh.md
#	packages/client/ui-sidebar/README.i18n.yaml
#	packages/client/ui-sidebar/README.zh.md
#	packages/client/ui-workspace/README.i18n.yaml
#	packages/client/ui-workspace/README.zh.md
#	packages/context/README.i18n.yaml
#	packages/context/README.zh.md
#	packages/core/agent-loop/README.i18n.yaml
#	packages/credentials/README.i18n.yaml
#	packages/credentials/README.zh.md
#	packages/experimental/agent-team/README.i18n.yaml
#	packages/experimental/agent-team/README.zh.md
#	packages/experimental/tool-agent-team/README.i18n.yaml
#	packages/experimental/tool-agent-team/README.zh.md
#	packages/host/frontend-static/README.i18n.yaml
#	packages/host/frontend-static/README.zh.md
#	packages/host/webserver/README.i18n.yaml
#	packages/host/webserver/README.zh.md
#	packages/interaction/commands/README.i18n.yaml
#	packages/interaction/commands/README.zh.md
#	packages/plan/plan-mode/README.i18n.yaml
#	packages/plan/plan-mode/README.zh.md
#	packages/sandbox/sandbox-local/README.i18n.yaml
#	packages/sandbox/sandbox-local/README.zh.md
#	packages/session/README.i18n.yaml
#	packages/session/README.zh.md
#	packages/session/session-persistence-sqlite/README.i18n.yaml
#	packages/session/session-persistence-sqlite/README.zh.md
#	packages/session/session-projection-cache/README.i18n.yaml
#	packages/session/session-projection-cache/README.zh.md
#	packages/shell/tool-pwsh/README.i18n.yaml
#	packages/shell/tool-pwsh/README.zh.md
#	packages/subagent/subagent-codex/README.i18n.yaml
#	packages/subagent/subagent-codex/README.zh.md
#	packages/subagent/subagent/README.i18n.yaml
#	packages/subagent/subagent/README.zh.md
#	packages/web/tool-web/README.i18n.yaml
#	packages/web/tool-web/README.zh.md
#	scripts/snapshots/translation-prompt-v4/request-response.expected.json
2026-08-20 19:15:33 +08:00
..
tests fix(sandbox): isolate bwrap PID namespace 2026-08-20 10:05:16 +08:00
advanced.cordis.snapshot.yml • feat(self-modification): add dynamic Cordis plugin runtime and UI 2026-08-13 01:29:36 +08:00
advanced.cordis.yml • feat(self-modification): add dynamic Cordis plugin runtime and UI 2026-08-13 01:29:36 +08:00
agent-instructions.cordis.snapshot.yml refactor: apply repository naming contract 2026-08-13 00:54:38 +08:00
agent-instructions.cordis.yml refactor: apply repository naming contract 2026-08-13 00:54:38 +08:00
background-job-admission.cordis.snapshot.yml refactor: apply repository naming contract 2026-08-13 00:54:38 +08:00
background-job-admission.cordis.yml refactor: apply repository naming contract 2026-08-13 00:54:38 +08:00
both-mode.cordis.snapshot.yml refactor: apply repository naming contract 2026-08-13 00:54:38 +08:00
both-mode.cordis.yml refactor: apply repository naming contract 2026-08-13 00:54:38 +08:00
child-question.cordis.snapshot.yml refactor: apply repository naming contract 2026-08-13 00:54:38 +08:00
child-question.cordis.yml refactor: apply repository naming contract 2026-08-13 00:54:38 +08:00
code-mode-image.cordis.snapshot.yml feat(llm-deepseek): support multimodal requests 2026-08-19 11:39:52 +08:00
code-mode-image.cordis.yml Merge commit '70396085b141370ce32de1be4e225b4384eaf46d' into HEAD 2026-08-17 11:31:59 +08:00
code-mode-workspace-context.cordis.snapshot.yml refactor: apply repository naming contract 2026-08-13 00:54:38 +08:00
code-mode-workspace-context.cordis.yml refactor: apply repository naming contract 2026-08-13 00:54:38 +08:00
code-mode.cordis.snapshot.yml refactor: apply repository naming contract 2026-08-13 00:54:38 +08:00
code-mode.cordis.yml refactor: apply repository naming contract 2026-08-13 00:54:38 +08:00
composition.md refactor: apply repository naming contract 2026-08-13 00:54:38 +08:00
cordis-tools.cordis.yml • feat(self-modification): add dynamic Cordis plugin runtime and UI 2026-08-13 01:29:36 +08:00
cordis.snapshot.yml build(vendor): rescope the vendored Cordis packages into @deepseek-ai 2026-08-10 22:04:13 +08:00
cordis.yml Merge commit '5ae8c6487ad9556b8793b890a4fe5ece24c55805' into codex/product-subagent-one-shot-background 2026-08-13 15:50:23 +08:00
depth-two.cordis.snapshot.yml build(vendor): rescope the vendored Cordis packages into @deepseek-ai 2026-08-10 22:04:13 +08:00
depth-two.cordis.yml build(vendor): rescope the vendored Cordis packages into @deepseek-ai 2026-08-10 22:04:13 +08:00
fs.cordis.snapshot.yml build(vendor): rescope the vendored Cordis packages into @deepseek-ai 2026-08-10 22:04:13 +08:00
fs.cordis.yml build(vendor): rescope the vendored Cordis packages into @deepseek-ai 2026-08-10 22:04:13 +08:00
image-text-route.cordis.snapshot.yml fix(examples): follow Cordis package rescope 2026-08-11 10:30:04 +08:00
image-text-route.cordis.yml fix(examples): follow Cordis package rescope 2026-08-11 10:30:04 +08:00
image.cordis.snapshot.yml feat(llm-deepseek): support multimodal requests 2026-08-19 11:39:52 +08:00
image.cordis.yml feat(llm-deepseek): support multimodal requests 2026-08-19 11:39:52 +08:00
package.json refactor(acp): reduce bridge to automation protocol 2026-07-24 01:40:25 +08:00
partial-landlock.cordis.snapshot.yml build(vendor): rescope the vendored Cordis packages into @deepseek-ai 2026-08-10 22:04:13 +08:00
partial-landlock.cordis.yml build(vendor): rescope the vendored Cordis packages into @deepseek-ai 2026-08-10 22:04:13 +08:00
product-subagent-both.cordis.snapshot.yml test(subagent): narrow named instance evidence 2026-08-18 04:34:24 +08:00
product-subagent-both.cordis.yml test(subagent): narrow named instance evidence 2026-08-18 04:34:24 +08:00
product-subagent-codex.cordis.snapshot.yml test(subagent): narrow named instance evidence 2026-08-18 04:34:24 +08:00
product-subagent-codex.cordis.yml test(subagent): narrow named instance evidence 2026-08-18 04:34:24 +08:00
pty-snapshot-backend.mjs refactor: apply repository naming contract 2026-08-13 00:54:38 +08:00
pty.cordis.snapshot.yml refactor: apply repository naming contract 2026-08-13 00:54:38 +08:00
pty.cordis.yml refactor: apply repository naming contract 2026-08-13 00:54:38 +08:00
README.i18n.yaml docs(i18n): localize Chinese internal links 2026-08-18 19:00:37 +08:00
README.md docs: apply hierarchy across the corpus 2026-08-05 16:13:28 +08:00
README.zh.md docs(i18n): localize Chinese internal links 2026-08-18 19:00:37 +08:00
retry.cordis.snapshot.yml build(vendor): rescope the vendored Cordis packages into @deepseek-ai 2026-08-10 22:04:13 +08:00
retry.cordis.yml build(vendor): rescope the vendored Cordis packages into @deepseek-ai 2026-08-10 22:04:13 +08:00
session-query.cordis.snapshot.yml refactor: apply repository naming contract 2026-08-13 00:54:38 +08:00
session-query.cordis.yml refactor: apply repository naming contract 2026-08-13 00:54:38 +08:00
session-sandbox-root.cordis.snapshot.yml build(vendor): rescope the vendored Cordis packages into @deepseek-ai 2026-08-10 22:04:13 +08:00
session-sandbox-root.cordis.yml build(vendor): rescope the vendored Cordis packages into @deepseek-ai 2026-08-10 22:04:13 +08:00
session-title.cordis.snapshot.yml refactor: apply repository naming contract 2026-08-13 00:54:38 +08:00
session-title.cordis.yml refactor: apply repository naming contract 2026-08-13 00:54:38 +08:00
subagent-continuable-inheritance.cordis.snapshot.yml Merge remote-tracking branch 'origin/master' into fix/continuable-subagent-policy-inheritance 2026-08-10 22:24:56 +08:00
subagent-continuable-inheritance.cordis.yml Merge remote-tracking branch 'origin/master' into fix/continuable-subagent-policy-inheritance 2026-08-10 22:24:56 +08:00
subagent-durability-failure.cordis.snapshot.yml build(vendor): rescope the vendored Cordis packages into @deepseek-ai 2026-08-10 22:04:13 +08:00
subagent-durability-failure.cordis.yml build(vendor): rescope the vendored Cordis packages into @deepseek-ai 2026-08-10 22:04:13 +08:00
subagent-report.cordis.snapshot.yml Deliver subagent reports at next step 2026-08-18 11:14:10 +08:00
subagent-report.cordis.yml Deliver subagent reports at next step 2026-08-18 11:14:10 +08:00
subagent-result-diagnostic.cordis.snapshot.yml feat(subagent): add Claude Code non-interactive permission modes 2026-08-15 16:37:19 +08:00
subagent-result-diagnostic.cordis.yml feat(subagent): add Claude Code non-interactive permission modes 2026-08-15 16:37:19 +08:00
web-fetch-fixture-server.mjs refactor: apply repository naming contract 2026-08-13 00:54:38 +08:00
web.cordis.snapshot.yml refactor: apply repository naming contract 2026-08-13 00:54:38 +08:00
web.cordis.yml refactor: apply repository naming contract 2026-08-13 00:54:38 +08:00

acp-agent example

English | 中文

Automation-oriented Agent Client Protocol server over JSON-RPC stdio. It is intended for parent agents, subagent providers, and other programmatic clients, not as the product UI.

pnpm run demo:acp             # needs DEEPSEEK_API_KEY (repo-root .env or env)
pnpm run demo:code-mode       # same protocol with the Code Mode tool transport

The leaf loads the ACP app, DeepSeek adapter, sandboxed bash and filesystem stacks, one-shot approval policy, compaction, subagents, workflows, hooks, a derived session-query index, and repeat guard. The app creates one fresh agent per session/new, persists sessions to JSONL, and keeps stdout protocol-pure. Optional overlays add session queries, filesystem spill storage, Code Mode, or web fetching.

Protocol channel

Stdout carries only newline-delimited ACP JSON-RPC. @deepseek-ai/dsh-acp-demo installs no stdout logger; leaf additions must use stderr for diagnostics.

The automation contract — supported methods, baseline prompt content, committed-text output, and the intentionally absent UI surfaces — lives in @deepseek-ai/dsh-acp.

Session workspaces and permissions

Each session/new supplies an absolute cwd. Sandboxed bash and filesystem mutations resolve workspace-write against that session cwd, so concurrent sessions can use separate project roots; platform temporary roots remain shared writable scratch space (sandbox contract). DSH_PERMISSION_MODE selects workspace-write or danger-full-access for the deployment.

Under workspace-write, a model retry requesting wider sandbox access triggers session/request_permission with allow_once and reject_once. The client decides programmatically; dismissal or an unavailable answer fails closed. The selected outcome applies only to that retry and is recorded through the normal tool-result/audit path. The server never exposes a permission picker or persists client policy.