返回目录
开发工具 插件

dsh-cpp-compiler

daerwen122/dsh-cpp-compiler

优秀的cpp AI调用工具

Stars
1
Forks
0
Issues
0
更新
7 天前

PROJECT TOPICS

项目标签

INSTALL REFERENCE

安装参考

未验证
dsh plugin --profile web add github:daerwen122/dsh-cpp-compiler

该命令指向仓库当前默认分支;尚无绑定当前 commit 的完整验证结果。

PROJECT README

README

dsh-cpp-compiler

English | 简体中文

A DeepSeek Harness plugin that gives every model in DSH the ability to compile, run, crash-analyse and step through C++ — using a green MinGW-w64 GCC toolchain bundled inside the plugin. No compiler installed, no installer, no PATH surgery.

⚠️ Confinement: compiling is not sandboxed — the bundled g++ runs with your full user privileges, and it reads whatever the process can read, so a #include of an absolute path echoes that file's contents back inside a GCC diagnostic. The compiled program, and the GDB that debugs it, are confined whenever the session mode is workspace-write or read-only: their argv is wrapped through DSH's own sandbox (ctx.sandbox.confine, the seam the shell tools use), so their writes land only in the session's working directory. Under danger-full-access — or with runPolicy: allow — they run unconfined with your full user privileges and do not trigger an approval prompt. Use this only in a trusted environment, and do not use it to run code from an untrusted source.

Mechanism: processes are spawned through ctx.subprocess (dsh-subprocess-local), which applies no token or ACL restriction of its own; the wrap is requested from ctx.sandbox when the resolved mode confines. A mode that asks for confinement with no provider mounted is refused, never run unconfined. DSH's modes restrict writes only — reads are outside that vocabulary, which is why confining the compiler further would not narrow what it can read.

🔒 Reads and network can be confined too, by an optional second layer — a separate Windows account, installed with one elevated command per workspace. It is off until you install it, and a workspace that was never granted produces a program that runs fine and then fails its first write with Access is denied (which reads like a bug in your program, not a missing setup step). Start here: SECURITY-SETUP.md. Check the grant with dsh-cpp-guard.exe status --account DshCppSandbox --workspace "<dir>" → workspaceGranted: true.

Tool What it does
compile_cpp Compiles a C++ program with the bundled g++ and optionally runs it. Returns GCC's diagnostics verbatim on failure, the program's output on success. Accepts program args, extra link libraries, and an outputPath to keep the binary.
debug_cpp_crash Compiles with debug info and runs the result under GDB; on a crash returns the backtrace (bt full) and the locals. Distinguishes a crash from a breakpoint stop from a clean exit.
debug_cpp A genuine interactive GDB session across multiple tool calls: breakpoints (including conditional), run, step, next, finish, until, print, backtrace, locals, continue, stop.

Bundled toolchain: GCC 16.2.0 / GDB 18.1 / MinGW-w64 14.0.0, ~430 MB on disk, statically linked output, and GDB's libstdc++ pretty-printers working out of the box (std::vector<int> prints as {1, 2, 3}).


Install

The plugin is a normal DSH bundle. Add it to a profile as a file: dependency and list it in dsh.profile.bundles, then restart DSH:

// ~/.dsh/profiles/web/package.json
{
  "dependencies": {
    "dsh-cpp-compiler": "file:./dsh-cpp-compiler"
  },
  "dsh": {
    "profile": {
      "bundles": ["@deepseek-ai/dsh-base", "@deepseek-ai/dsh-web-app", "dsh-cpp-compiler"]
    }
  }
}

The plugin's own cordis.patch.yml inserts it into the tree, so the bundle entry is all that is required. On load you should see:

[cpp] loading: compile_cpp, debug_cpp_crash, debug_cpp (bundled MinGW-w64 toolchain)
[cpp] native hashing: 2342 file(s) in 2444 ms including process spawn
[cpp] toolchain integrity: 2342 pinned file(s) verified in 1300 ms
[cpp] toolchain ready: g++.exe (Rev4, Built by MSYS2 project) 16.2.0 | GNU gdb (GDB) 18.1 | pretty-printers=loaded (…\share\gcc-16.2.0\python)
[cpp] registered tool compile_cpp
[cpp] registered tool debug_cpp_crash
[cpp] registered tool debug_cpp

If resources/mingw64 is missing

cd path/to/dsh-cpp-compiler
node scripts/fetch-toolchain.mjs     # ~105 MB download, verifies every SHA-256
node scripts/prune-toolchain.mjs     # trims unreachable payload, then re-verifies
node scripts/stage-licences.mjs
node scripts/stage-checksums.mjs     # pins the executables that run, for run-time verification

A missing toolchain is reported to the model as toolchain_error with the exact sentence "This is NOT a problem with your source code." — see Failure classification.


Using the tools

compile_cpp

{
  "sourceCode": "#include <algorithm>\n#include <iostream>\n#include <vector>\nint main(){ std::vector<int> v{5,3,1}; std::sort(v.begin(), v.end()); for (int x : v) std::cout << x << ' '; }\n",
  "std": "c++17",              // c++11 | c++14 | c++17 | c++20   (default c++17)
  "optimization": "O2",        // O0 | O1 | O2 | O3               (default O2)
  "compileProfile": "standard", // quick 5s | standard 30s | heavy 120s  (optional)
  "runAfterCompile": true,
  "stdin": "optional program input",
  "args": ["--demo", "60"],    // argv[1..] for the PROGRAM — an array, never a shell
  "link": ["ws2_32"],          // extra libraries, as bare stems (optional)
  "outputPath": "build/demo.exe", // keep the binary (relative to the workspace)
  "runTimeoutMs": 10000
}

Compile flags, always the same set (plus any -l you ask for):

g++ main.cpp -o main.exe -std=<std> -O<n> -Wall
    -fdiagnostics-color=never
    -static-libgcc -static-libstdc++ -static
    [-l<stem> …]

Static linking is why the produced .exe runs anywhere without shipping DLLs; -fdiagnostics-color=never is what keeps GCC's diagnostics parseable in a log rather than riddled with ANSI escapes.

args is an array, and there is no shell. Each element is handed to the OS verbatim, so "; echo hi" reaches the program as that literal string rather than being executed. This is what makes a program with a CLI testable without editing its source — and it is deliberately not a command string, because a cmd /c implementation would be an injection surface.

link needs a bare stem (ws2_32, user32), because the name is placed on the compiler's command line. Anything containing a space, a leading -, a path separator or = is refused and reported in rejectedLink rather than dropped: a silently ignored -l turns into undefined reference errors that look like a source bug. A refused write during compilation is reported as sandbox_denied — not as a rejected source.

outputPath is copied after a successful compile, and must resolve inside the session workspace; an escaping path is refused and reported in outputPathError. It is a copy rather than g++ -o <path> on purpose: the compile stage is not wrapped through ctx.sandbox.confine, so pointing -o at an arbitrary path would be the one way to make this plugin write outside the grant.

The program's working directory is a per-call scratch directory that is deleted when the call returns. It is reported as run.cwd; a program that writes a relative path writes it there. Use an absolute path for workspace files, or outputPath to keep a binary.

debug_cpp_crash

{
  "sourceCode": "…",
  "breakpoints": ["boom", "main.cpp:17", "main.cpp:17 if i == 200"],  // name | file:line | conditional
  "stdin": "…",
  "link": ["ws2_32"],
  "args": ["--mode", "fast"],   // argv[1..] for the debugged program
  "runTimeoutMs": 180000        // whole batch session (default 120000, max 300000)
}

The program is rebuilt with -g -O0, so frames and variables are meaningful. GDB runs in batch mode with set pagination off (without it, GDB blocks forever on a ---Type <return> to continue--- prompt that a piped stdout never answers) and with the libstdc++ pretty-printers explicitly registered.

The verdict is one of three, and the third exists because conflating it with the second misleads in the direction that matters:

crash.crashed crash.stoppedAtBreakpoint verdict
true false CRASHED — signal(s) SIGSEGV
false true STOPPED AT BREAKPOINT (not a crash, and NOT a clean run)
false false did NOT crash — exit code 0

A program that stops at one of your breakpoints did not run to completion, so "did NOT crash" would read as "no problem" about a run that never finished. Drop the breakpoint (or continue past it with debug_cpp) before concluding anything.

debug_cpp

{ "action": "start", "sourceCode": "…", "breakpoints": ["main"] }
{ "action": "start", "sourceCode": "…", "args": ["--mode", "fast"] }  // argv[1..] for the debuggee
{ "action": "break",     "sessionId": "dshcpp_…", "argument": "main.cpp:17 if i == 200" }
{ "action": "run",       "sessionId": "dshcpp_…" }
{ "action": "print",     "sessionId": "dshcpp_…", "argument": "v.size()" }
{ "action": "finish",    "sessionId": "dshcpp_…" }   // run to the end of this function
{ "action": "until",     "sessionId": "dshcpp_…" }   // run past this line (escape a loop)
{ "action": "continue",  "sessionId": "dshcpp_…" }
{ "action": "stop",      "sessionId": "dshcpp_…" }

Actions: start, restart, break, run, step, next, continue, finish, until, print, backtrace, locals, stop. Sessions are closed automatically after 5 minutes of inactivity, on plugin unload, and by stop.

The edit → rebuild → debug loop does not need a fresh start. restart recompiles and reopens the session, and by default carries over the breakpoint list, the C++ standard, the optimisation level, the link flags and the debuggee's args — so you only pass what changed:

{ "action": "restart", "sessionId": "dshcpp_…" }                                  // same source, breakpoints kept
{ "action": "restart", "sessionId": "dshcpp_…", "sourceCode": "…" }               // new source, breakpoints kept
{ "action": "restart", "sessionId": "dshcpp_…", "breakpoints": ["main.cpp:9"] }   // replace the breakpoints

It returns a new sessionId and the previous one stops working, because the rebuild produces a new binary in a new scratch directory. If the new source does not compile, nothing is torn down: the old session keeps running and the diagnostics come back in restart.diagnostics, so a failed restart never costs you your session.

Parameters the three tools share

std, optimization, compileProfile, link, args and runTimeoutMs mean the same thing in all three tools, and a test enforces that: a parameter added to one and forgotten in another would be silently dropped, because defineTool validates parameters and an undeclared field never reaches the tool at all. The one deliberate exception is stdin on debug_cpp — in an interactive session GDB's stdin is the command channel, so the debuggee cannot also read it.

args reaches the program the same way in all three: appended after the binary (or after GDB's --args), as separate array elements with no shell in between.

Conditional breakpoints are how you debug a bug that appears on iteration 200. The condition is accepted only as <variable> == <integer>, and the command is rebuilt from the validated variable and integer rather than copied from your string. A variable path like a.subtotal, p[2], obj->field or ns::counter is fine; a general expression is refused, because these strings are written into a GDB command file — and because a general expression could call functions in your program at every hit.

Two behaviours worth knowing:

  • continue is also how you wait. GDB does not read its command stream while the inferior runs, so a run that outlasts its budget leaves an outstanding marker. Calling continue again waits for it and returns whatever the program printed in the meantime, instead of failing.
  • Only the source passed to start is compiled. Edit the code and you start a new session.

Failure classification

Nine statuses, kept strictly apart — because the worst outcome for a code-generating model is treating a broken toolchain as a broken program and "fixing" correct code forever:

status Meaning What the model is told
ok compiled. Whether the program also RAN is reported by the permission field and by whether the result has a run member: no run means nothing executed —
compile_error GCC rejected the source; diagnostics are GCC's own words, unedited first error kept, the rest folded as ... and N more errors
run_error the source compiled; the program then decided to exit non-zero "syntax and types are OK. This is a RUNTIME failure."
run_timeout the source compiled; the program never exited on its own and its tree was terminated "a TIMEOUT, not a syntax verdict" — the program did not decide to exit, so calling it a RUNTIME failure sends the reader to the wrong place
toolchain_error the compiler or debugger could not run "This is NOT a problem with your source code."
sandbox_denied a file effect was refused by the OS. During compilation the source is fine and editing it cannot help; during the run the program did execute and only one write was refused the policy boundary, named as a boundary rather than a C++ bug
sandbox_unavailable DSH's sandbox could not start the program, so nothing ran, and this plugin will not run it unconfined "fixing the C++ source will not help"
scratch_unavailable the plugin could not create its own scratch directory, so nothing was compiled and nothing ran the host's errno and message, and the two ways forward — never a compiler verdict
permission_denied the session's sandbox mode does not permit running a program, so debug_cpp_crash / debug_cpp compiled nothing and executed nothing the reason, the current mode, and how to change it

A compile timeout is reported as a timeout, not as a syntax verdict: the diagnostics are incomplete and the message says so. A runtime timeout has its own status for the same reason, in the other direction: run_error and run_timeout are two different bugs, and the reader acts on them differently.


Run permission and confinement

Compiling is always allowed and is not sandboxed — it is the syntax and type check, it runs the plugin's own SHA-256-verified toolchain, and it writes only to its own scratch directory. Running is what the session's mode governs, and it runs inside DSH's sandbox whenever the mode confines:

session mode what happens to the compiled program (and the GDB driving it)
workspace-write (DSH's default) runs, confined — writes land only in the session's working directory (and a private temp directory); anything else is refused by the OS
read-only runs, confined — reads only; a write is refused
danger-full-access runs unconfined, with your full user privileges
could not be determined refused (an unknown mode is treated as untrusted)

runPolicy: follow-sandbox is the default and produces the table above. The two explicit overrides:

  • runPolicy: allow — run regardless of the mode, and unconfined. This is the escape hatch; it is named as such everywhere it is mentioned.
  • runPolicy: deny — never run; compile only.

Two things worth knowing about the confined path:

  • The wrap is DSH's own (ctx.sandbox.confine, the same seam dsh-pwsh-sandbox uses). On Windows it installs a WRITE_RESTRICTED token; the backend reports its own completeness as enforcement: partial, which every result repeats verbatim rather than rounding up to "isolated".
  • A mode that asks for confinement with no ctx.sandbox provider mounted is refused, not run unconfined — a deployment that lost its sandbox does not silently regain the old behaviour.

The mode is resolved per session and per call (ctx.sandboxPolicy, folding an approved override, then the session's last sandbox/mode event, then the deployment default), so switching a session to danger-full-access takes effect without a restart. Every result carries:

  • permission — the decision, its cause, the current mode, where that mode came from, and confinement (none, or the mode the spawn was confined to). Read it instead of retrying when a call is refused.
  • sandbox — present only when the spawn was confined: the mode, the backend's enforcement, whether a file effect was denied, and whether the runner runnerFailed (in which case nothing ran).

Three outcomes stay strictly apart, because conflating them misleads in different directions:

status meaning
run_error the program ran and misbehaved
sandbox_denied the program ran, and the OS refused one of its file writes — a policy boundary, not a C++ bug
sandbox_unavailable the sandbox runner could not start the program at all: nothing ran, and fixing the source will not help

Override the policy in the profile's cordis.patch.yml:

- id: dsh-cpp-compiler
  config:
    runPolicy: allow

Toolchain integrity

resources/mingw64 is ~430 MB of executable code that this plugin runs every time you compile: g++ drives cc1plus, as, collect2 and ld, and both debug tools run gdb. The fetch script checks every package against the MSYS2 repository database at download time, and until now nothing looked again — a binary modified on disk afterwards would have been executed silently, forever.

So the code that can actually run is pinned in resources/toolchain-checksums.json by SHA-256. The seven programs this plugin executes come first:

bin/g++.exe   bin/gcc.exe   bin/gdb.exe   bin/ld.exe   bin/as.exe
lib/gcc/<triple>/<version>/cc1plus.exe    lib/gcc/<triple>/<version>/collect2.exe

— and, because those seven do not run alone, every other file that can be loaded and executed:

every DLL in the tree          (42 in bin/, +2 elsewhere — the Windows loader resolves an
                                executable's imports from its own directory first)
every Python module and bytecode  (.py, .pyc — GDB's embedded interpreter executes and
                                imports these; printers.py is injected by this plugin)
every CPython extension module (.pyd)
every archive under lib/       (the import libraries `-l<stem>` resolves against: `ld` copies
                                code out of them into the executable you then run)

That closure is 2342 files / 283 MB, verified before anything is executed, including the g++ --version capability probe. The C++ front end and the link driver collect2 live under lib/gcc/…, so they are pinned too — a tampered ld.exe is exactly as interesting as a tampered g++, and pinning only the drivers would leave libisl/libmpc/libmpfr/zlib/libpython3.14 — which those drivers load — unverified, along with the Python that GDB executes from this same tree.

The lib/*.a entries are pinned because link exists: once a caller can name a library, ld reads that archive and copies its code into the produced binary, so the archive is part of the program. The archives nested under lib/gcc/** (libstdc++, libsupc++, the static libgcc pieces) stay out of scope — no exposed flag reaches them — and test/integrity.test.mjs asserts both halves of that line: every archive a -l name can resolve to is pinned, and the nested ones are not.

Situation What happens
Everything matches 2342 files (283 MB) hashed in ~1.3 s, then the tree is used
A pinned file differs or is missing, or the pin file is present but unparseable or empty all three tools report toolchain_error and refuse to use the tree, naming each file that differs. Nothing is compiled, and the failure is never re-checked mid-process
resources/toolchain-checksums.json is absent refused as well: this plugin does not use a toolchain it has not pinned. Restore the file from the repository, or re-pin with node scripts/stage-checksums.mjs

Regenerate the pin after staging or pruning a toolchain:

node scripts/stage-checksums.mjs           # rewrite the pin from the tree you just verified
node scripts/stage-checksums.mjs --check   # compare without writing; non-zero exit if stale

npm test fails if the committed pin no longer matches the tree, so a restaged toolchain cannot silently outlive its pin.

What this does and does not buy, stated plainly. It catches a corrupted or partially-extracted tree, a half-finished prune, and tampering that did not also edit the pin file — and because the pin file is committed, editing it shows up as a git diff. It does not stop an attacker who can write to both the tree and the working copy of the pin: same-user code execution can always rewrite both. It is a consistency and tamper-evidence check, not a privilege boundary.

⚠️ In this deployment, that is the operative case, so read the check as a consistency check. The plugin lives inside the session workspace, which the sandbox grants as writable, so a confined program can rewrite the toolchain — pin included. And the tree itself is .gitignored (git ls-files resources/mingw64 returns nothing), so the pin file is the only record that the tree ever changed; a modified cc1plus.exe leaves no diff of its own. It still refuses to run on a mismatch, and it still catches corruption and a half-finished prune. It is not a boundary against an actor who already has write access to the workspace — nothing here could be, and the shell and write tools reach these same files anyway.

That boundary was not always where the code said it was. Two self-disables were found by audit and closed, and they are worth knowing because they are the shape of the mistake to look for again:

  • An empty pin used to pass. {"schemaVersion":1,"files":[]} parsed cleanly, the verification loop ran zero times, and the report came back verified: true, ok: true, checked: 0 — one text edit turned the check into a no-op that every result still advertised as verified. An empty (or missing) pin is now a failure, and a report that verified nothing can never be ok.
  • Deleting the pin file used to mean "run unverified", which was the same self-disable through another door. Absence now also fails closed, naming the one command that fixes it. The trade is deliberate: tampering costs you the toolchain until it is re-pinned (a visible denial of service) instead of quietly costing you the check.

There is a second pin, and it is the one to think about

Verifying 2342 files on every load is too slow to do one file at a time in JavaScript, so the hashing runs in a small native helper (resources/bin/dsh-cpp-hash.exe, 568 KB, static, built from native/hash/main.cpp by scripts/build-native.mjs). That helper is itself code this plugin executes, so it is pinned too — resources/native-checksums.json — and checked before it is run.

Which means the integrity story has two anchors, not one, and they are not equally strong:

pin covers protects
resources/toolchain-checksums.json 2342 files / 283 MB the compiler, GDB, every DLL and every Python module they load, and every archive -l can link
resources/native-checksums.json every file in resources/bin/ the helper that computes the digests above

State this plainly, because it is the weakest link in the chain. A helper that lied — returning the digests from the pin file instead of reading the tree — would make the 2342-file check pass while checking nothing, and nothing downstream could tell. It does not need to write a file to do that, only to read the pin and echo it. So the strength of the big pin is bounded by the strength of the small one, and both cover directories that a confined program can write, because this plugin is installed inside the session workspace (see below).

Two things keep that from being a hole rather than a note:

  • A helper that fails can never cause a false pass. Every failure path — missing, unpinned, unreadable, wrong size, wrong digest, spawn error, timeout, non-zero exit, malformed output, wrong output length, non-digest values — falls back to the TypeScript hasher, which compares against the same pin. A helper that is broken, stale or slow costs time and never correctness. Only a helper that is deliberately wrong is a problem, and that is exactly what its own pin exists to catch.
  • resources/bin/ is covered as a set, not just the helper. The verifier refuses when the directory holds a file the pin does not name, so a planted DLL cannot sit next to the helper unnoticed. (Measured benign anyway: the helper imports only KERNEL32.dll and msvcrt.dll, both KnownDLLs loaded from System32, so app-directory planting does not work against this particular binary. The closure is there so that stays true if its imports ever change.)

What this does not fix. Merging the two pins into one would remove the asymmetry, but the helper cannot live in resources/mingw64/ — that tree is .gitignored, so the helper would leave git while staying in the published package, which is worse. The asymmetry is therefore accepted, and recorded here rather than left for a reader to rediscover.

Compile-time budget

Inferred from the source so that a fixed number is never wrong in both directions:

budget = 5000 ms + 20 ms × lines
       × 3   if a heavy header family is included (boost, range/v3, eigen, fmt, spdlog)
       × 2   if more than 10 template declarations appear
       clamped to [5000 ms, 180000 ms]        ← hard ceiling, no input can exceed it

compileProfile overrides the inference outright (quick 5 s, standard 30 s, heavy 120 s). Runtime budget is separate (runTimeoutMs, default 10 s, max 60 s) — a program slow to build is not expected to be slow to run, and conflating the two would give a runaway loop 180 seconds.

Every multiplier only ever increases the budget: too much time costs wall-clock on failure, too little costs a wrong answer.


Resource management

  • 🔴 The scratch lives in your workspace, and is kept by default. Every call writes main.cpp, main.exe and GDB's command file under <your workspace>/.dsh-cpp/<session id>/<call id>/, and that directory is not deleted when the call finishes — a failed compile is exactly when you want the source that produced it. A .gitignore containing * sits at the top of .dsh-cpp/, so the tree never shows up in git status. Remove it whenever you like:

    node <plugin>/lib/cleanup.js --workspace <your workspace> --dry-run   # show what would go
    node <plugin>/lib/cleanup.js --workspace <your workspace>             # remove it
    node <plugin>/lib/cleanup.js --workspace <your workspace> --session <id>   # just one session

    Or set DSH_CPP_CLEAN_ON_UNLOAD=1 to have the plugin prune the directories it created when it unloads. DSH_CPP_KEEP_ARTIFACTS=1 does the opposite and keeps even the per-call directory. The command refuses a --session it cannot vouch for rather than sanitising it, and reports (never silently skips) anything that is not a session directory.

  • Every spawn goes through ctx.subprocess. Nothing in this plugin imports node:child_process; DSH's subprocess service owns tree-scoped termination and is disposed by the harness on unload.

  • The child environment is an allowlist. Toolchain children get PATH (prepended, not replaced), TEMP/TMP/TMPDIR pointed at the call's scratch, and a handful of machine-identity names — and every other inherited variable is explicitly deleted. DSH's own scrub is one heuristic (/KEY|PASSWORD|SECRET|TOKEN/i plus DSH_*) and leaves proxy variables in place on purpose, so the plugin tombstones the rest itself. The native hash helper gets nothing at all.

  • ctx.effect registers one disposer that terminates every live child and closes every debug session. It logs what it reaped.

  • Orphan reaping. DSH terminates child trees, but only when something asks it to. If the host dies hard, the Job Object the sandbox runner holds is keyed to the runner's death, not the host's — so nothing kills the runner, and the tree survives. Each invocation therefore writes a PID record carrying ownerHostPid, the image name, and a marker that is present in the child's command line (-DDSH_CPP_COMPILE_ID=… for g++, set environment DSH_CPP_COMPILE_ID=… for GDB, and --marker=… for the hash helper, which ignores argv but must still carry it) — an environment variable alone is unverifiable from the parent on Windows. On the next load, records whose owner is gone are verified against the live process (image name, then command line when readable) and killed with taskkill /T /F. A record whose owner is still alive is never touched, so two DSH instances cannot reap each other.


Limits, stated honestly

  • Windows only. The bundled toolchain is MinGW-w64 and the process plumbing uses tasklist / taskkill. Other platforms would need a different bundle.
  • One translation unit per call. sourceCode is written to main.cpp; there is no multi-file project support and no build system.
  • No LTO and no coverage. lto1/lto-wrapper and gcov were removed from the bundle because the fixed flag set can never reach them.
  • debug_cpp's live path is not covered by the test suite in every environment. Interactive sessions need a persistent stdin pipe, and a sandboxed development environment denies pipes outright. The session protocol is tested against an in-memory handle, and batch GDB is tested against the real binary — see the header of test/session.test.mjs.
  • Bundle size. ~430 MB on disk. The requirement this plugin was built to estimated 130-160 MB; that is not reachable while keeping a C++ front end, the Windows SDK headers, the import libraries and a Python-enabled GDB.

Development

npm install
npm run build            # tsc: src/ → lib/  (lib/ is what DSH loads)
npm test                 # unit + tool-contract + session suites
node test/tools.test.mjs # compiles, runs and debugs real C++ against the bundle

test/tools.test.mjs is the important one: it feeds the real return values of every tool to the real validateJsonSchemaValue from the harness. A schema that omits a field the code returns fails every call at run time and nowhere else, so nothing here is asserted against a hand-written expectation.

DSH_CPP_TOOLS_PATH points the suite at @deepseek-ai/dsh-tools when it lives somewhere unusual.

CLASSIFICATION EVIDENCE

分类依据

项目类型插件
功能分类开发工具
规则置信度低

系统优先读取 GitHub Topics,再与站内分类词典和词根规则比对。当前命中: 工具。