Update the full-text instruction assertions, the run_code tool-schema and system-prompt sidecars of the session, SDK, and Web snapshots, the cua-mcp expected tools, the generated tool catalog with its Chinese pair, and the ptc-runtime-node README pair.
* feat(ptc): define scoped REPL top-level scopes and import base in guidance
The scoped REPL guidance now states the rules a program follows instead of
listing edge cases: each run_code call runs one program in its own top-level
scope, whose top-level declarations and received names are copied, not
referenced, into later programs; a program either uses a copied name or
declares it again; block-level var is discouraged because it changes which
value later programs copy; a failed program keeps earlier values. It names
the missing require and module and separates the import base, fixed at the
environment's first program, from process.cwd(), which follows each program.
Formats without top-level return say to await work before the program ends.
* test(ptc): pin the scoped REPL scope and import guidance
Update the verbatim scoped REPL guidance assertion and refresh, without a key,
the recorded run_code descriptions of the PTC and CUA scenarios whose guidance
changed: the scoped REPL rules and the "before the program ends" wording
shared by retained formats.
* test(cua-mcp): refresh the cua_run_code description for the scoped REPL guidance
The cua-mcp profile expectation landed on master after this branch's base; it lists cua_run_code with the scoped REPL execution instructions.
* fix(ptc): keep the shared scoped guidance free of a consumer tool name
The runtime execution instructions are shared by run_code and cua_run_code, so
the new sentence no longer names run_code. The Agent Note also gives the
missing top-level return as the reason for the retained-state wording, which
covers the persistent script format as well as the REPLs.
* test(ptc): pin the unchanged scoped guidance across consumers
The verbatim assertion, the three scoped tool schemas, and the cua-mcp profile
fixture follow the shared sentence, which no longer names run_code.
master renamed the macOS Computer Use provider to @deepseek-ai/dsh-cua-macos
(#8284) and moved identity construction to brandString (#8214).
Adapted to master:
- The cua-mcp profile mounts @deepseek-ai/dsh-cua-macos and declares it as the
optional dependency; the bundle test follows the new name.
- The MCP adapter builds its Session and tool-call ids with brandString, so
@deepseek-ai/dsh-brand becomes a runtime dependency of the package.
Conflicts:
- scripts/experimental-package-policy.ts and scripts/release/families.spec.ts:
both sides added a row; the cua-macos, cua-mcp, and cua-windows rows coexist.
- scripts/package-dependency-policy.ts: took master's removal of the SessionId
safe entry. longEdgeDimensions no longer sits in the safe-export list; it
joins the existing peer-required @deepseek-ai/dsh-attachment entry, so this
branch adds no safe-export exception.
- Generated catalogs, module graphs, and the dsh-doc package reference: took
master and regenerated.
- Four translation pairing records: took master and re-recorded after
reviewing both language diffs.
The profile mounted only the macOS provider, so a Windows Host listed no cua_run_code. Add a second
provider row for @deepseek-ai/dsh-cua-windows, enabled on native Windows only, with the same fixed
screenshot target and PTC preset as the macOS row, and declare the package as an optional dependency
beside the macOS provider. The profile e2e fixture switches both native rows off. The no-provider
message names both platforms and points at the launcher's stderr.
README: Windows helper setup through the row's helperPath, with the fields a config override must
restate, and the Windows provider's limits that apply through MCP.
Not exercised on a Windows desktop. On macOS the row was forced on through a profile patch: the
Loader resolved the package, accepted the documented config, rejected an invalid one, and reached
the provider's own host check.
The Windows coverage job failed on the new working-directory assertion: realpath expands the
runner's 8.3 short temporary path (RUNNER~1) while the program's process.cwd() keeps the spelling
it was started with. Both sides are now resolved before comparison in the composition test and in
the profile end-to-end test; macOS still needs the resolution because its temporary directory is a
symlink. The parsed window id is annotated as the string it has been since window ids became strings.
Conflicts: both sides added one adjacent entry (cua-mcp here, cua-windows on master) to
scripts/experimental-package-policy.ts, scripts/release/families.spec.ts, and tsconfig.host.json;
both entries are kept. Generated and recorded files take master's side and are regenerated: the
config catalog, the module graph, the package list, two pairing records, pnpm-lock.yaml, and the
creation-recommendations fixture.
Adaptations to master:
- @deepseek-ai/dsh-cua-mcp follows its release family to 0.2.2-rc.2.
- Window ids are strings: this branch's fixture programs and assertions pass "7".
- The retained program environment is a scoped REPL, in which a later call may declare an earlier
name again: cua_reset no longer names declaration conflicts as its use, and the cua-mcp README
and Agent Note state the registration's current description length.
- The cua-mcp README names the Windows provider, which this profile does not mount.
- The profile's expected reference and tool list are re-recorded.
- Add the read-only cua_get_api_reference tool. It returns the provider's cua guidance for the
connection's Agent and keeps no state. The reference no longer rides on the first program result
of each environment: the server cannot observe a new conversation on a held connection, a
cancelled or failed first call, or a compacted context, and the delivery flag had two writers
without a common ordering point.
- Create the connection's Agent in a dedicated workspace: DSH_CUA_WORKSPACE, or cua-mcp/workspace
under the Harness home. An Agent's working directory is the workspace-write root of its programs,
so the directory a client launched the server from, which can be /, is no longer writable.
- Report startup failures on stderr and exit with code 1, including a relative workspace path and a
workspace directory that cannot be created. The profile mounts no log sink.
- Run each program call as the Agent's maintenance activity, so Agent disposal cancels an in-flight
call and waits for it and its nested calls to settle before the Session closes.
- Return a failed call's message without DSH's "Error: " prefix; isError already marks it.
A `tools/call` that names anything but the listed `cua_run_code` registration or
`cua_reset` now fails as an unknown tool before it reaches the tool executor, so a
tool another row registers for the connection's Agent cannot be called without
being listed, and the sandbox-escalation refusal applies to every program call.
`dispose()` releases the connection's Agent even when closing the protocol server
rejects. The `cua_reset` description states that a running program is cancelled,
and an `isEscalationField` guard replaces the two type assertions.
Documentation follows the code: the README states that a Host without a provider
lists only `cua_reset`, that the Web plugin page hides the bundle while the Host
inventory still reports it, that the documented Codex configuration carries the
output budget, which client entries were exercised, that the sandbox root is the
client's launch directory, and that the registration's escalation guidance has no
effect in this profile. The unused `zod` dependency is removed.
The launcher, the plugin manager, the CLI plugin command, and the bundle
manifest type return to master: `dsh.bundle.profile`, `shippedProfileTemplate`,
and `bundleProfileName` are withdrawn, and `cua-mcp` is no longer a required
startup entry. A profile manifest that lists `@deepseek-ai/dsh-cua-mcp` as its
only bundle is the whole setup; `loadProfile` already loads an existing
manifest without a template, and the installation ships the bundle, so no pnpm
or registry access is involved. The README documents that manifest for
installed users and for the Python runtime wheel, and states that layering the
bundle over `dsh-base` is unsupported because both compositions declare the
same row ids.
The optional-bundles spec and the Web preview-boot e2e name the standalone
bundle through a `STANDALONE_PROFILE_BUNDLES` constant instead of reading a
manifest field; the cua-mcp expected-output e2e writes the documented manifest
before starting the server. The Agent Note records the bundle-declared profile
as a considered alternative, deferred until CUA leaves experimental and a
`PROFILE_TEMPLATES` entry can provide the zero-step start.
`--print-client-config codex|claude-code|json` is withdrawn together with the
client-config module and the static `node:sea` import that told a single-file
executable from a script launch. The browser worker image packs every optional
bundle and registers no `node:sea`, so the Cloudflare preview packer failed to
load the bundle; the README now documents the Codex `config.toml` fragment, the
`claude mcp add-json dsh_cua` command, and the generic `mcpServers` entry with
the same timeouts, tool exposure, and output budget. The frontend accepts only
`--help` besides the profile selection, and the server owns its `dsh_cua` name.
The README names the macOS helper's prepared build directory relative to the
provider package instead of as a repository path, because the gitignored
`.build` directory does not exist on a clean tree and `verify-package-paths`
rejects the reference. The expected-output e2e asserts the profile manifest
after `initialize` instead of after a configuration print.
The MCP server no longer carries its own cua_run_code schema and description.
Each tools/list reads the connection Agent's registration from the tool
registry and projects it onto the MCP tool, checked against the protocol's
tool type, so the provider's definition is the only source and `description`
is required as it declares. The projection omits the sandbox-escalation
fields `sandbox_permissions` and `justification`, and a call naming them is
refused before execution; every other argument reaches ctx.tools.execute
unchanged inside ctx.agents.withInitiator, so DSH validates arguments and
answers unknown names. The SDK's McpServer owns tools/list and tools/call
once a tool is registered on it, so both tools use the low-level Server
handlers; cua_reset keeps its hand-written definition.
The connection's Agent is created before the stdio transport opens, so the
first listing already carries its registration, and a creation failure exits
the process instead of retrying per call. The first result of an environment
now prefaces only the cua API reference; the execution rules travel in the
tool description. A Host without a provider lists only cua_reset.
The README and Agent Note record the measured client description budgets:
Claude Code 2.1.309 forwards the first 4,096 characters of an MCP tool
description, dsh-mcp-client forwards 20,000 intact, so the API reference
stays in the first result.
The cua-mcp bundle composes its profile from one insert over the empty root
instead of layering on dsh-base, so no model adapter, prompt-side tool,
telemetry, or session-management row loads; every row is a bundle dependency.
The bundle declares the profile through dsh.bundle.profile, and app-boot's
shippedProfileTemplate initializes a missing profile from that single shipped
bundle for `dsh --profile`, the CLI `dsh plugin` command, and the plugin
manager's pnpm path. The `dsh plugin enable|disable` subcommand is withdrawn.