Introduction¶
In DeepSeek Harness (DSH), when creating Scratch-style projects, the common approach is to modify JSON inside .sb3 zip archives or hand-write block XML. The former is difficult to align with editor semantics, while the latter lacks the “run it, see the stage, then modify” closed loop. The Gandi IDE desktop version used on Co-creation World is a full-featured Scratch editor, but standard automation struggles to click the green flag, drag blocks, or load extensions like a human user.
Here we introduce the community plugin dsh-gandi (maintainer yee114514). It does not modify Gandi or inject hidden content into projects. Instead, it connects to a running editor via the Chrome DevTools Protocol (CDP), providing the agent with a set of gandi_* tools. It also supports reading and writing .sb3 files directly without opening Gandi. The current plugin version is 0.0.1, licensed under MIT. It is categorized as “Client” on the SkillHub directory, with 0 stars on GitHub.
What is this¶
dsh-gandi is positioned to let DSH agents complete Scratch projects within the Gandi editor you are currently using—writing scripts, drawing costumes, adding sounds, running the project, viewing screenshots, and then iterating on changes. The plugin exports online works as local .sb3 files for the agent to modify; it will not save or publish cloud versions on your behalf. To persist changes, use gandi_save, and read them back with gandi_open next time.
If you tell the agent “Use the gandi tools to make a catch-the-apple game,” it will autonomously: open an editor tab → create a new project → draw costumes → write scripts → perform key press tests → view stage screenshots → identify issues and modify them.
Core Features¶
Operate on the Editor¶
- Write Scripts: Uses Scratch-readable block XML, supporting custom blocks and script comments.
- Extensions: Music, Pen, Text-to-Speech, 3D, AI, etc.; Load them first via
gandi_extension. Input names and dropdown menus for blocks are read from the editor to avoid the “looks correct but doesn’t react when running” issue. - Art and Audio: Costumes/backgrounds can be written as SVG or bitmaps; sounds can be synthesized by pitch and duration.
- Project Structure: Create variables, lists, and sprites; change names, set positions, and resize.
- Execution and Observation: Click the green flag, advance at a fixed frame rate, return coordinates and variable values; stage screenshots can be attached (models must support image viewing, otherwise screenshots will degrade to being written to a path for you to read manually).
- Input Simulation: Schedule key/mouse events by second in the
inputofgandi_run, used for testing interactions like “hold to move, release to stop.”
Offline .sb3 Editing¶
When you already have a .sb3 file, you can use gandi_inspect {path} and gandi_apply {path} to read and write without opening Gandi. Drawing costumes, adding sounds, or running projects still requires the editor runtime.
Editing Rights and Visibility¶
When shared between humans or between human and AI, the plugin implements a lease mechanism (yielded after about 60 seconds of idle, manageable via gandi_lease or force: true). The editor view opened by the plugin inside the Gandi window will be brought to the front, but it will not steal system focus. If you switch back to the home page in Gandi, the plugin will bring the editor view to the front again before the next project modification (state is not lost; in extreme cases where the view is rebuilt, this will be noted in the tool output).
Installation and Activation¶
Refer to the README for installation commands (can be installed into the dsh-tui or web profile, or both):
# 1. Install into your desired profile (installing into both is fine)
dsh plugin --profile dsh-tui add https://github.com/yee114514/dsh-gandi
dsh plugin --profile web add https://github.com/yee114514/dsh-gandi
# 2. Tell the plugin where Gandi is installed (can also be written to config file, see below)
$env:GANDI_APP_PATH = 'E:\Gandi\Gandi.exe'
# 3. Restart DSH
After installation, use dsh --profile <profile> --dump-config to confirm that gandi appears in the configuration. If the network drops during the first installation, it may silently roll back; simply rerun the command. Restart DSH is required after modifying plugin code or configuration; host-side plugins do not support hot reloading.
You can also write to the profile’s cordis.patch.yml ($DSH_HOME/profiles/<profile>/cordis.patch.yml):
- id: gandi
config:
appPath: 'E:\Gandi\Gandi.exe'
port: 9222
autoLaunch: true
Common configuration keys can be overridden by environment variables: GANDI_APP_PATH, GANDI_PORT (default 9222), GANDI_AUTO_LAUNCH, etc.; see the repository README for the complete table.
Prerequisites¶
| Item | Requirement |
|---|---|
| Node | ^22.19 or >=24 |
| Gandi Desktop | Version 1.0.5 verified on Windows (E:\Gandi\Gandi.exe) |
| Network | Connection required; the editor itself is at www.ccw.site |
| Account | Must be logged in on the desktop version |
| Debug Port | Gandi must be launched with a remote debugging port; gandi_launch handles this for you |
Two common scenarios:
- Gandi is stuck on the “My Works” list, and
gandi_statusshowseditor tab: none—this is normal; othergandi_*tools will open the editor tab first. - If an already open Gandi instance does not have a debugging port, it can never be connected to, and the plugin will not force-close it for you. A convenient solution: use
gandi_launch {launcher: true}to create aGandi (DSH attachable)shortcut in the Start Menu; or usegandi_launch {patchShortcuts: true}to modify existing desktop icons; usegandi_launch {restart: true}if the current instance needs restarting (polite close, not taskkill).
Manual launch example:
Gandi.exe --remote-debugging-port=9222
Typical Usage¶
Extension Blocks¶
Extension blocks do not exist until loaded; the order is fixed:
gandi_extension {action: "load", id: "music"} # Load, and print the dialect
gandi_apply {xml: "…<block type=\"music_playDrumForBeats\">…"}
Opcodes include the extension ID prefix; dropdown field names follow the output of gandi_extension. If you try to write a block for an unloaded extension, gandi_apply will reject it and prompt you to load it first. Device-based extensions (camera/microphone) are marked [uses a device] in gandi_extension {action:'list'}; after loading, the plugin will proactively turn off the device and explain in the results.
Testing Interactions¶
Keys must be active after the green flag. Use input in gandi_run:
gandi_run {seconds: 1, input: [{atSeconds: 0, key: 'space', isDown: true}]}
Hold and release can be written in the same run:
gandi_run {seconds: 1, input: [
{atSeconds: 0, key: 'space', isDown: true},
{atSeconds: 0.5, key: 'space', isDown: false}
]}
Tool Entry Points¶
Check gandi_status first if issues arise. Common tools include: gandi_launch (ready/shortcut/restart), gandi_new / gandi_open / gandi_save, gandi_apply (with dryRun: true), gandi_run / gandi_observe / gandi_screenshot, gandi_merge (merge sprites from another .sb3), etc. See the GitHub README for the full list.
Adding dryRun: true to gandi_apply before writing scripts allows validation only; scripts that would cause the project to fail to open will be rejected. Paths are restricted to the session working directory by default; writing outside requires setting allowOutsideWorkspace: true.
Use Cases and Notes¶
Best For: Wanting the agent to iterate on Scratch works in the real Gandi editor within a DSH conversation; or having an existing .sb3 that needs batch script/XML modifications by the agent followed by verification in the editor.
Notes:
- The plugin runs with current DSH process privileges. Please review the source code and MIT license yourself before installing.
- It does not touch your cloud works; cloud saving and publishing must still be done by you in Gandi.
- The DSH ecosystem follows “everything is a plugin”; SkillHub is a community directory and has no official affiliation with DeepSeek / High-Flyer.
Conclusion¶
dsh-gandi turns Gandi into a Scratch workbench drivable by agents: connecting to the live editor via CDP, plus an offline .sb3 toolchain, emphasizing a verification loop of running, screenshotting, and simulating key presses. Directory page: https://www.skillhub.cn/plugins/yee114514/dsh-gandi; Repository: https://github.com/yee114514/dsh-gandi.