dsh-web
zhu1090093659/dsh-webDeepSeek Harness(DSH)Web 插件聚合生态包 · 一切皆插件,创意工坊分发(dsh-market.com)
DSH-native Cocos vibe coding studio with headless preview and runtime inspector
PinK 的升级版:项目管理、资源编译、预览、构建在同一产品里。
Agents install only kurenai — no PinK / separate cocos-cli.
The trimmed cocos runtime lives in this repo asvendor/cocos-core.
Paste only this; everything else is in the linked doc:
Download and follow https://raw.githubusercontent.com/kurenai-studio/kurenai/main/docs/getting-started.md (Kurenai / Creator 4.0).
If the repo is already cloned: Read kurenai/docs/getting-started.md and follow it exactly.
Longer Chinese prompt (same rules):
自学并只用最新 kurenai(https://github.com/kurenai-studio/kurenai:clone 后 Node.js 22+ 下 `npm install && npm link`;不要单独安装完整 cocos-cli / PinK)开发 Cocos 游戏:`kurenai init`(3D 用 `--3d`)→ `host start` → 按项目 `AGENTS.md` 只改 `assets/game/` 与 `assets/resources/`,用 `import` / `asset info` / `logs` / `context` 闭环,`.meta` 由引擎生成、不要手写;`.prefab` / `.mtl` 可以直接手写,但 prefab 里不挂脚本组件,行为写在 TS 里用 `addComponent` 挂上;交付时再 `kurenai publish --platform web-desktop`。
入口:docs/getting-started.md · docs/rendering.md · docs/安装方法.md · docs/简单使用方法.md
kurenai
├─ CLI / inspector / templates (agent 面)
└─ vendor/cocos-core (裁剪后的运行时:asset-db + preview + web build)
四个核心能力在一起:项目管理 · 资源编译 · 预览 · 构建。
Agent writes files under assets/ (prefabs, materials, TypeScript views)
→ host watcher → asset-db refresh (.meta, import, compile)
→ live reload refreshes the preview
→ agent imports assets and reads uuids / errors through `kurenai import` / `asset info` / `logs`
Prefabs describe structure and look and carry no scripts; code loads them by
path and attaches behaviour with addComponent(View).bind(root). .meta files
are always written by the engine. The rules agents follow live in
templates/shared/AGENTS.md, copied into every
new project.
| Tool | Engine | Repo |
|---|---|---|
| Kurenai | Creator 4.0 (this package) | preview + publish |
| Enji | Creator 3.8 | kurenai-studio/enji — preview/edit, no publish, 3.8 .meta caps |
| Akane | — | reserved name, unassigned |
Do not run kurenai on a 3.8 project (risk of 4.0-oriented meta / publish). Use Enji instead.
scripts/slim-vendor.mjs(工作树约 515 MB,原先约 1.4 GB;Enji 约 505 MB。多留 Web 构建器与引擎源码)docs/rendering.md、--3d、getting-startednpm install 按需下,开发包再靠近 500 MBbin/kurenai.mjs — the CLI (see below).bin/kurenai-cocos-host.mjs — one long-lived process per project. Loads the
bundled vendor/cocos-core runtime, starts game preview, watches assets/
(or polls with WATCH_POLL=1) and exposes /__kurenai/status,
/__kurenai/refresh, /__kurenai/asset and /__kurenai/logs. Advertises
itself in <project>/temp/kurenai-host.json.vendor/cocos-core/ — trimmed like Enji (asset-db, preview, web builders,
engine sources for publish). Refresh with npm run vendor:slim.
npm install / postinstall installs its JS deps (pure JS, no native addons).src/preview/controller.ts — starts the host (or attaches to one the CLI
started) and puts PreviewBridge in front of it.src/preview/bridge.ts — reverse proxy that injects the inspector and keeps
every preview request on the bridge origin.src/project/control.ts — project detection, template initialization,
selection context and publish (web-desktop / web-mobile).src/inspector-runtime/ — browser runtime for scene tree, selection and 2D
hit testing.templates/ — base-ai (2D) and base-ai-3d project templates plus the
shared layer (Boot entry, helpers, AGENTS.md).portable-sharp / jimp; no Node-ABI gl / sharp addons)kit add unzips in pure JS. Works the same on macOS, Windows and Linux.Optional override for tests only: KURENAI_COCOS_CLI_ROOT pointing at a custom tree.
kurenai host start waits up to 600s by default for first-time engine import. Use --timeout <seconds> or KURENAI_HOST_READY_TIMEOUT_MS. On timeout the host is left running — poll with kurenai host status.temp/programming/**/*.lock. Manual recovery: stop host, delete temp/ (and if needed library/), then host start again.kurenai publish type-checks assets/ with the vendored TypeScript and fails on type errors; kurenai check runs the same check in about a second.Not published to npm; install from GitHub:
git clone https://github.com/kurenai-studio/kurenai.git
cd kurenai
npm install # also prepares vendor/cocos-core deps
npm link # optional: puts `kurenai` on PATH
lib/ is committed, so no build step is needed to use the CLI. First
npm install may take a few minutes (runtime dependencies).
kurenai init ./my-game --template base-ai-3d
cd my-game
kurenai host start # background preview host; prints the preview URL
# kurenai host start --timeout 1200 # wait up to 20 minutes for first import
kurenai host status # poll readiness if start wait expired
kurenai import assets/resources/materials/red.mtl # import + uuid / sub-assets
kurenai asset info assets/resources/materials/red.mtl # read existing .meta only
kurenai kit add ks-survivor-kit # kit folder, zip or Kura pack id -> assets/resources/kits/<kit>/
kurenai check # type-check assets/ (preview does not)
kurenai logs --errors # errors since the last good preview boot (--all: older too)
kurenai context # project state + AGENTS.md
kurenai publish --platform web-desktop --release --out ./dist
kurenai host stop
Commands that need the host start it when it is not running. Output is JSON.
publish may warn if tsc is not on PATH; the web build can still succeed.
From a clean clone, node scripts/run-puzzle.mjs creates a temp 2D project
(base-ai), writes a generated assets/resources/images/puzzle.png, a
script-free PuzzleTile prefab, and MainView / PuzzleTileView (3×3 slice
swap until the picture is restored). It runs kurenai asset info on the image
and prefab (prints uuids), then starts the preview host.
Manual check after the host starts: open the printed previewUrl, tap one tile
then another to swap slices; when all nine are in the correct order the status
line shows Complete!
Options: --dir <path> for a fixed project directory, --no-host to skip the
host, --cleanup to remove the temp project (and stop the host) when finished.
node scripts/bench-host.mjs initializes a temp project (default
base-ai-3d), runs kurenai host start, prints JSON with wall time to
ready and host process RSS (via ps), then stops the host. Uses the bundled
vendor/cocos-core runtime. Pass --concurrent to start two hosts on ports
7460/7461; --cleanup removes temp dirs.
import { ProjectControl } from "@kurenai-studio/kurenai";
const control = new ProjectControl({ scene: "db://assets/main.scene" });
await control.initialize("/path/to/new-game", "base-ai-3d");
const preview = await control.startPreview("/path/to/new-game");
console.log(preview.url); // bridge URL with the inspector injected
await control.publish("/path/to/new-game", { platform: "web-desktop" });
await control.stopServer(); // stops the bridges and any hosts it started
npm install
npm run check
Maintainer refresh of the bundled runtime (from a full install source):
npm run vendor:cocos
CI runs npm run check on pull requests to main (see .github/workflows/check.yml).
Parallel workers claim GitHub issues labeled swarm:available. Claim, branch, PR, and
manager review rules live in docs/SWARM.md.
WATCH_POLL=1 on the host;
see docs/docker-watch-poll.md.UITransform bounds; 3D raycasting is not
implemented.builtin-unlit; write .mtl files
for lit materials.web-desktop and web-mobile.node scripts/bench-host.mjs on your machine for repeatable numbers.Kurenai Studio source is MIT licensed. The bundled vendor/cocos-core tree
(Cocos / cocos-cli derived runtime) remains under its upstream licenses.