rea
morluto
Reverse engineer anything with agents, from app behavior down to native binaries.
PROJECT TOPICS
INSTALL REFERENCE
dsh plugin --profile web add github:lishize20040802-rgb/dsh-deep-ptc-mode
该命令指向仓库当前默认分支;尚无绑定当前 commit 的完整验证结果。
PROJECT README
中文 · MIT · 2.0.0
Changelog · Test report · Plugin workflows and verification
Deep PTC is a DeepSeek Harness agent mode with progress reports, clarifying questions, task-size planning, and interruptible background work. It builds on the installed official PTC preset with selectable shells, on-demand tools and skills, and a two-layer preset identity adapter for third-party plugins.
The panel sits beside the conversation and shows the environment, subagents, jobs, output files, SSH connections and tool state. The panel width can be dragged. The capsule expands or collapses it; it sits below the composer by default and can move into the toolbar or be hidden. Deep PTC also has its own settings page. Visual effects are lightweight and start off when an appearance plugin is installed.
Version 2 restores the original 1.9.9 persona and adds proactive cards and progress reminders. Workspace setup remembers guidance, pending proposals and deferral. Independent sources keep separate proposals. Stale proposals require merging and fresh approval. End and restart the panel guide without losing pending proposals. For feature changes the model uses related F records to report new and existing behavior checks together.
| # | Problem | What Deep PTC does |
|---|---|---|
| 1 | Working silently without reporting | Give a brief chat update before each run_code call. Two consecutive tool steps without assistant text trigger a reminder at the next step. |
| 2 | Guessing instead of asking | Meaning belongs to the user, facts to the tools: ask one to three questions with options when names, targets, routes, scope or acceptance criteria are unclear; an unfamiliar term is asked about first and researched only when the user does not know it; inspectable facts are looked up. The user's statements outrank the model's prior beliefs: no silent change of approach, every part of a request checked off, nothing unverified reported as verified. |
| 3 | Sleeping or becoming unreachable | Enforced in code: foreground waits move to the background after 30 s; a user message hands the waiting command to the background within about 2 s; foreground sleeps over 5 s are refused; job completion wakes the model. |
| 4 | No plan, or an invisible plan | Plan by estimated size: act silently under 5 minutes; show the plan and start without approval for 5–20 minutes; show it and wait for approval over 20 minutes. Re-plan when the estimate moves up; the user can redirect at any step. |
| 5 | Not using the concise context and unlimited-token prompt | Derive from the live official PTC composition, keep the tool catalog compact and load full schemas on demand, and state that this mode spends its token budget on reads, searches, commands and checks rather than rationing them. The prompt does not change billing or the real token limit. |
Read the running host's official PTC declaration and inherit its rows as they are; only the persona, execution group, reachability guard, job wrapper and question wrapper are replaced. Rebuild only when the declaration or settings change, checked when settings change and once before each Deep PTC conversation is created or resumed, with no polling timer; fall back to the bundled snapshot with a warning if it cannot be loaded, parsed or derived. An official upgrade can add tools without a release of this preset; existing sessions are not forcibly switched.
The plugin lab is always on for a session. It reads the host's creative preset and appends only the rows that mode adds, specifically for building DSH plugins. Module names stay as declared; skill directories resolve relative to the creative preset file. Lab packages stay in process memory, are not written to the repository, shipped presets, desktop composition or this plugin's source, and run only through the host's existing approval. Loading reads the roster and documents only; it never calls composedPreset.
Screen-control tools stay in the initial PTC SDK, are not moved on demand, and are not quarantined on failure. Recognition uses the tool's own resident mark, dsh-go/view, its name or its provider mark. Deep PTC does not claim dsh-go's slots or replace its settings form; if the tool-state projection fails, that control stays empty without tearing down the composer or screen-control UI.
WSL Bash, PowerShell (including discovered 5.1 and 7 executables), Zsh and native Bash are supported. The choice applies to this preset only and does not change the global shell; sandbox, approval and process management stay official. WSL currently requires the host-authorized danger-full-access mode.
This is the core interface: external plugins publish tools under their own contract; Deep PTC discovers them, loads them on demand, quarantines failures per conversation and falls back to official PTC. Extensions must support the installed host and publish into the deep-ptc scope; Deep PTC does not depend on any specific plugin or replace the executor.
Third-party plugins that query composedPreset share the same compatibility rules. The tested dsh-ops package recognises only minimal/standard/ptc/cordis, so its query receives ptc in a session that DSH mounts as deep-ptc. Quarantine applies only to tools attributed to external providers.
Each turn ends with a skill context card that lists only the skills still loaded and not closed, so the user decides what stays for the next turn.
Search summaries first, then load full schemas: six entries per page by default (maximum eight), up to six schemas within a 16 KB budget per load, and up to twelve recent selections. Quarantine persists with the conversation: clear unavailability blocks immediately; temporary failures need three in a row and a success clears the count; wrong arguments, denial and normal business failures are not tool failures; one reset clears only the current conversation. Skills load in two stages: discovery reads metadata and invocation permission only; the official skill tool loads the body.
Install the plugin, choose an environment under Settings → Deep PTC, and select Deep PTC Mode for a new conversation.
After each turn, a card at the end of that turn in the conversation (where official plan cards appear) lists only the skills that are still in context and not closed — not the whole skill catalog. Each row shows the name, description and a switch, on by default; the card also offers Keep all / Close all and says how many skills leave after the next message. More than four rows fold behind “Show all”. Only the latest turn shows the card.
skill again and the card lists it after that turn.skill tool and skills loaded by a PTC inner call inside run_code. The latter usually reach the program rather than the model context, so closing one only removes it from the card, not from program output. /name injections are not covered yet.The model leaves cards at the end of the conversation with the ui_card tool. Cards are composed, not picked from fixed templates: a header (title, subtitle, icon, state tone), up to 6 blocks, a note and up to 4 buttons. Any combination is valid, so the model can create a new card for any situation.
stats tiles, rows, progress, bars, line (with a hover tooltip), donut, steps (checklist or timeline), table, tags, text, callout.choice (single or multiple, with a preselected recommendation) and field (time, date or number).size (full / half / third); several cards form a grid, two side by side or three in a row, stacking in narrow windows.run really runs on the host (deletes scheduled tasks, or runs one command in your selected execution environment); reply sends the user's choice to the model as their next message; a button can do both. keep leaves the card usable after a press (restart, snooze, rerun).{name} placeholders in a command are filled only from times, dates, numbers and option values the card declared, so free text never reaches a shell; the server validates them again. Destructive buttons use the danger style.Three built-in skills load on demand. deep-ptc-cards explains the conversation card interface and layout. deep-ptc-card-examples provides 20 validated templates covering development scenarios and multi-card layouts. deep-ptc-project-cards covers settings, proposals and project records.
The project's standing rules and records, kept in PROJECT-CARDS.md at the workspace root. Like AGENTS.md it lives in the workspace, and other AI tools read it as plain documentation.
PROJECT-CARDS.md for DSH conversations in the workspace. User-approved settings take precedence among project documents. Earlier copies quoted in the conversation are historical. The project-card interface is read-only in other modes.$DSH_HOME/storages/deep-ptc-project-cards.json.The Deep PTC mode label, settings, and conversation UI switch between Chinese and English with DSH Settings → General → Language. Every entry point uses an official DSH extension point; the plugin changes no host layout and registers no keyboard shortcuts.
run_code.~/.ssh/config.Visual effects apply only while the conversation on screen is a Deep PTC session, and only on the composer, send button, message bubbles, reply typography and session rows. They never rewrite the host's colour tokens or fonts, so switching conversations does not restyle the whole page: a hairline on the focused composer, a blue gradient send button, soft blue user bubbles, pointer spotlight, click ripple, a magnetic send button; while running, a glowing composer, a send-button ring and sparks rising above the composer.
The panel can copy a general SSH check command or DSH Go connection details. Normal SSH, SCP, SFTP and forwarding work uses OpenSSH. DSH Go can start managed dsh web on a POSIX remote host, or attach to an existing service on Windows. Use the actual service port and configure authentication in the client. Copying these details prepares information.
DSH allows a blank session to select another preset before its first turn starts. It locks that choice once a turn has started. Deep PTC command gates follow the host's current selection, which is also used by the UI.
Deep PTC reaches external hosts through the local OpenSSH client in the selected environment's shell; it adds no transport of its own. The model is told where the client is, which host aliases ~/.ssh/config defines (names, addresses, users and ports only, never keys), and how to use them: always non-interactive (BatchMode=yes, a connect timeout), no interactive remote shell, never waiting for a password or host-key prompt; on an authentication failure it stops and tells you instead of trying other credentials or disabling host-key checking; long remote work runs as a background job. In WSL, SSH runs inside the distribution with its own ~/.ssh.
One tool/skill directory, deep_ptc_tools, coordinates discovery. Task operations still belong to external providers and the current official PTC tools.
lsp and terminal_*). After quarantine, execution is blocked in code and state persists with the session. Agent recreation, conversation restore and provider reload do not lift quarantine. Capture provenance and reset generation before dispatch; late pre-reset results cannot contaminate the new state. Empty results, normal pagination and ordinary nonzero command exits are not failures either./deep-ptc-reset-tools provides the same action. The tool state and this command are registered at the plugin root, like the skill card, so they work in an idle conversation too.skill tool and follow its full instructions. Reuse instructions already in context. Discovery never reads skill bodies.// Inside the official run_code tool; discovery itself never executes a found task tool.
const matches = await tools.deep_ptc_tools({ action: 'search', query: 'search files' });
const loaded = await tools.deep_ptc_tools({ action: 'load', names: ['actual_tool_name'] });
const skills = await tools.deep_ptc_tools({ action: 'skills', query: 'build test' });
// Next use each actual tool schema, or the official skill loader for a selected skill.
Set compactToolCatalog: false under deep-ptc-settings to retain the full host SDK while keeping quarantine and reset. toolCompatibility: false disables the entire new layer. Optional toolPreferences still guide choices between existing tools.
Compaction only changes an untouched SDK section generated by the installed official renderer. Provider-owned/custom SDKs keep their own loaders. Extensions must support the host and publish into deep-ptc; this layer does not override hidden tools, authorization or an unloaded whole executor. Actual OPS/online-model end-to-end integration has not been performed.
From 1.5.0, "don't sleep or wait" is enforced by plugin code, not just requested in the prompt:
| Situation | What the code does |
|---|---|
| A foreground command runs long | After 30 s (configurable, 5–600) it moves to a background job and keeps running; a larger requested timeoutMs is capped |
| You send a message while a command runs | The foreground wait ends within about 2 s, the command continues in the background, and the model reads your message; job completion still wakes it |
job_output waits on a job |
Capped at 30 s, ends early when you send a message, and waiting again while your message is unread is refused |
The model writes sleep 60, Start-Sleep 30 or timeout /t 20 |
Foreground pauses over 5 s are refused (run_in_background commands are exempt); short readiness loops such as sleep 1 still work |
setTimeout, setInterval or time.sleep in a run_code program |
Known waits over 5 s are refused; unresolved durations pass through; polling one running job more than 3 times in one program is refused |
ask_user_question |
Runs in timed mode: 120 s by default, at most 300 s, -1 refused. An unanswered question becomes pending and your later answer arrives as a message; typing a reply instead of using the card ends the wait at once |
These rules apply only to Deep PTC sessions. They rely on the desktop "busy Enter" setting being steer; with queue, messages wait for the whole turn to end.
- id: deep-ptc-settings
config:
foregroundSeconds: 30 # foreground wait cap in seconds, 5-600
Open Settings → Deep PTC, choose an environment, save, and create a new Deep PTC Mode session.
| Selection | Host | Executor / tool |
|---|---|---|
| Automatic | Windows / macOS / Linux | PowerShell on Windows, Zsh on macOS, Bash on Linux |
| WSL Bash | Windows | Explicit wsl.exe ... --exec bash -lc, tool bash |
| PowerShell | Windows | Official native PowerShell executor, tool pwsh |
| Native Bash | Windows | An absolute path to bash.exe, such as the Niubash binary bundled with dsh-ops |
| Zsh | macOS / Linux | /bin/zsh -lc on macOS; installed zsh on Linux; tool zsh |
| Native Bash | macOS / Linux | Official Bash executor, tool bash |
Unsupported choices are disabled according to the Host, not the browser OS, and rejected by the Host schema. Leave the WSL distribution blank for the Windows default or enter an installed name such as Ubuntu. Zsh must be installed when selected on Linux.
The selection changes the real executor, tool contract and environment instructions. Executors live in a preset-local shell realm, independent of the global shell and other presets. Settings register a new preset revision for new sessions. Existing sessions and background jobs retain their revision: create a new session to change environment safely.
WSL source uses Linux/POSIX syntax, while file tools and workdir use Windows host paths. Distribution, cwd and source are distinct argv entries passed through wsl.exe --cd; no surrounding shell string is assembled. Login-shell configuration in the selected distribution controls Linux PATH and proxy setup. Windows environment variables are not all automatically exported into Linux.
Native PowerShell and the macOS/Linux shells use Harness sandbox, approval and process management. On Windows, WSL and native Bash require execution already authorized as danger-full-access. Choose PowerShell for confined Windows work.
PowerShell, macOS/Linux Bash and Zsh can use a discovered executable. On Windows, native Bash accepts an absolute path to bash.exe, such as <profile>/node_modules/dsh-ops/runtime/win32-x64/niubash/winuxcmd/bin/bash.exe. If that path is unavailable, new sessions keep the official shell.
In the existing deep-ptc-settings configuration, specify a tool name and optionally its preset row and replacement. For example, install a plugin that provides pwsh_safe, then configure the preset:
- id: deep-ptc-settings
config:
toolOverrides:
- tool: pwsh
row: tool-pwsh
replacement: pwsh_safe
The rule is scoped to Deep PTC. tool hides the inherited tool of that name. row disables the entire named preset row, including any other tools it registers. replacement is optional. If its provider has yet to load, the model is told that the replacement is unavailable for that request. Calls use the replacement’s own schema and permission policy.
Existing disabledShellTools: ['pwsh'] configurations keep working. A card command reports an error when its session’s shell is disabled. A reply button can send the decision to the model, which can then use an installed replacement. New sessions use the updated preset settings.
Deep PTC is often used for programming, and it can also be used to design a DSH plugin. Plugin lab is always on for a session; there is no toggle. An existing pluginLab key in the Cordis settings is accepted for compatibility but ignored.
The lab loads the official creative mode (创造模式) the same way it loads PTC: from the preset the running host publishes (agentPresets.readDocument, preferring the preset named 创造模式, otherwise the shipped id cordis). It appends only the rows that creative mode adds beyond the current PTC composition. Module names stay exactly as that document declares them, so an official rename follows the host instead of a name baked into this plugin. Skill directories that the creative preset expresses relative to its own file are resolved against that preset's directory. The desktop already mounts the host runner, so those rows are left to the host and are not copied a second time.
The lab is an environment for designing and trying a plugin in this process: inspect the live composition, define a syntax-checked package, then run it only through the host's existing approval. Packages stay in memory for this process. They do not write the repository, shipped presets, the desktop composition, or this plugin's source. Host approval stays as the host defined it. If the creative preset cannot be read, or a lab tool is missing or fails, the session continues with the official PTC tools.
Deep PTC can use other plugins within the same task: DrawAI reads, edits and exports diagrams; guizang-design supplies page, slide, social-card and writing skills; Agentero supplies paper and note tools; dsh-ops recognizes the preset for its execution environments; and DSH Go receives screen-tool availability and SSH connection assistance. dsh-context can read skills from the current Agent's service for context inspection.
Version 1.9.2 prevents repeated stale-revision rejections from quarantining a working editor. Twenty-six actual DrawAI, guizang-design and Agentero host tools passed isolated interface checks; DrawAI file editing and SVG export also passed. Design generation, the paper CLI, phone connections and video rendering have their own dependencies and verification limits. See the plugin workflow details.
External plugins are discovered from what they actually register. Tools and workflows are chosen by capability first. Official PTC tools stay available and are the fallback when a third-party tool fails. No external plugin, including dsh-go, is a dependency of this package.
dsh-go (the phone app and its screen-control surface) stays usable inside a Deep PTC session:
resident (or deepPtc.resident), when its presentation carries the dsh-go/view key, when its name is intent, collect, tap_xy, or starts with screen_, or when its provider is marked as dsh-go, screen control, computer use, or phone control. Any other plugin can use the same resident flag. Ordinary extensions stay on demand.Phone screen control was not clicked on a device for this release. The guarantee above is the SDK membership, the quarantine rule, and the composer failure path.
External plugins often use the preset ID to enable capabilities. The adapter runs only for sessions using Deep PTC. DSH mounts deep-ptc and records that preset ID on the session. A plugin such as dsh-ops that relies on official preset IDs receives ptc when it queries composedPreset.
deep-ptc and works as-is; a plugin that explicitly declares support for deep-ptc also receives the native id.ptc by default when the caller's gate requires an official preset ID. The alias applies to that query.deep-ptc, so inheritance and scheduling are unaffected.ptc; every other preset is returned unchanged. The official PTC preset is not replaced, and DSH is not modified.composedPreset. A creative row mounted into a Deep PTC session that accepts only cordis gets cordis; a normal creative session is unchanged.composedPreset returns one ID per call. The adapter selects a layer from the caller's package or explicit settings before returning. The host exposes no callback for the caller's validation result. The settings are presetCompat, presetFallback and presetSupport.Limitation: this wraps the host's agentPresets.composedPreset instance and depends on its internal signature, so re-check after a DSH upgrade. The per-package probe is heuristic; dynamically assembled ids may not be recognised.
run_code, longer updates at milestones, never more than two or three silent tool calls.A prompt changes the model's working tendency, not the real token limit or billing, and compliance is not guaranteed. The setting that actually controls thinking depth is the model's reasoningEffort.
Requires Node >=24 and DSH >=0.2.2-rc.1. The installer rejects the current package on DSH 0.2.1-rc.5 based on its manifest. macOS/Zsh checks cover configuration, argv and tool mounting.
plugin_manager({ action: "install_bundle", target: "dsh-deep-ptc-mode@1.9.5" })
// Or from a local checkout or archive:
plugin_manager({ action: "install_bundle", target: "C:\\path\\to\\dsh-deep-ptc-mode" })
// Or target: "C:\\path\\to\\dsh-deep-ptc-mode-1.9.5.tgz"
Repository locator: github:lishize20040802-rgb/dsh-deep-ptc-mode. It installs content actually published there; a local upgrade does not publish to GitHub or npm.
Installing the same bundle updates it. Upgrading from the persona-only release requires a Host plugin reload; reopen the app if the settings card has not appeared. Installation does not change the default mode for unrelated new sessions.
Settings persist through the active profile's Cordis patch:
- id: deep-ptc-settings
config:
environment: auto # auto | wsl | powershell | zsh | bash
wslDistribution: '' # blank uses the Windows default
shellExecutable: '' # blank keeps the official lookup
An existing pluginLab key is accepted but ignored. If the creative preset cannot be read, or the preset enters safe mode, the session keeps the PTC tools only.
Prefer the UI, which uses revisioned, atomic Host form writes.
Runtime features serve sessions currently selected as deep-ptc. The preset mounts its tool directory, tool state and execution environment. The skill projection starts from the creation header and folds valid host agent-preset/selected events. Commands, agent/pre-step and the client panel check the current selection. Other modes keep empty skill state, and a missing creation header starts inactive.
Deep PTC is composed at load time from the PTC preset the installed Harness declares (@deepseek-ai/dsh-web-app/presets/ptc.patch.yml). Every official row is inherited as-is; Deep PTC replaces only its persona text, swaps the two platform-switched shell tools for one isolated execution group, adds the reachability guard, and wraps the official job and question tools. The wrappers and the execution group never name an official module themselves: they load the module the official row names (and the shell executors the base deployment declares in @deepseek-ai/dsh-base/cordis.patch.yml), with the official options. An official PTC change therefore reaches this mode without a plugin release, and a removed or renamed upstream module cannot leave a stale row behind. When the chosen execution environment cannot be mapped onto the official rows, those rows are kept and the change is logged. If the declaration cannot be resolved, read or parsed, the bundled lib/preset.json snapshot is used as a fallback and the fallback is logged.
Because the declarations are resolved through the host runtime, every host package the plugin imports statically is declared in peerDependencies — including @deepseek-ai/dsh-web-app. The host routes those names to the installation for a linked plugin; npm run check fails if one is missing, which is what keeps a link: installation on the live declaration instead of silently using the fallback snapshot. compatibility.json records the upstream release the checked fixture was taken from and its hash; npm run check verifies that the bundled fallback still derives the same preset as that fixture and that the inheritance invariants hold. The engines range is an installation floor, not proof that every future release was tested, so run npm run check:upstream -- <path> against a new release before trusting it.
npm ci
npm run build:client
npm run check
npm test
npm run check:upstream -- /path/to/the/new/upstream/ptc.patch.yml
npm run sync:snapshot # refresh lib/preset.json and lib/base-snapshot.json from the installed declarations
PTC_RUNTIME_MODULES=/path/to/dsh/node_modules node scripts/check-preset.cjs # loader-level row resolution on a real runtime
PTC_RUNTIME_MODULES=/path/to/dsh/node_modules node scripts/check-reachability.mjs # interruptible waits on a real runtime
npm pack
The checker parses !!js as data and asserts the derivation invariants: every official row survives unchanged except the persona, the shell rows and the two wrapped tools (including when the official preset nests them in a group); row ids stay unique; derivation is deterministic across ten platform/environment pairs. Tests cover future compositions as well (unknown rows, reordered rows, removed shell or wrapped rows), plus platforms, argv boundaries, confined WSL refusal, atomic settings writes and stale revisions. Real-task evaluations should measure successful completion, unnecessary questions, scope expansion, background-work collection and latency.
Main files: cordis.patch.yml is the settings entry; lib/index.mjs manages revisions; lib/model.mjs builds isolated execution configurations; lib/executor.mjs extends the official bash executor for WSL/Zsh; lib/terminal.mjs runs the official shell tool the declaration names, with interruptible waits and the Zsh dialect; lib/jobs-tool.mjs and lib/ask-user.mjs run the official job and question tools the declaration names; lib/host.mjs resolves those official modules through the installed runtime; lib/guard.mjs, lib/rules.mjs, lib/sleep-lint.mjs and lib/reachable.mjs implement the pause/polling guard and interruptible waits; lib/client.js is the generated client bundle built from src/client/; lib/upstream.mjs locates and parses the installed PTC declaration; lib/preset.json holds the persona and the fallback snapshot used only when that declaration is unavailable.
Uninstall with plugin_manager action remove_bundle, target dsh-deep-ptc-mode. Local link installations depend on their source directory: uninstall before deleting it.
Deep PTC mode is written and maintained by lishize20040802-rgb.
Thanks to these contributors for merged pull requests:
Bugs in DeepSeek Harness itself belong upstream, at deepseek-ai/deepseek-harness.
Runtime boundaries: pause checks distinguish executable waits from strings, comments and ordinary timer callbacks. Known constants/products are checked; unresolved durations pass through. wsl -- sleep 20 really pauses and remains refused. Static checks are not a complete language interpreter. Arbitrary run_code, synchronous subprocesses and long workflow waits cannot currently guarantee early steering; use managed jobs for long work. Official tools are never quarantined, including by stale records. Unattributed tools remain available; quarantine requires positive external attribution.
Version 1.7.3 first reads the running host’s public PTC registry, then discovers installed declarations if that API is unavailable, and uses a warned snapshot only as the final fallback. Registry/declaration or plugin-setting changes automatically refresh new preset generations; changed module sources invalidate attribution caches. No pinned DSH version selects the tool inventory, and leased sessions are not forcibly switched.
CLASSIFICATION EVIDENCE
系统优先读取 GitHub Topics,再与站内分类词典和词根规则比对。当前命中: deepseek、deepseek-harness。