kurenai-studio/kurenai

DSH原生Cocos vibe编码工作室,具备无头预览和运行时检查器

项目介绍Project Overview

Kurenai 是 DSH 原生 Cocos 插件,在聊天旁运行 Headless Cocos 预览,可查看场景树、点选节点并把节点路径与组件作为上下文,让代理直接改磁盘源码并经 HMR 刷新。适合在 DSH 工作区中新建或继续 Cocos 项目、可视化定位后编辑。注意:需自备本地 headless-cocos 运行套件并设置 KURENAI_HEADLESS_ROOT;当前为 MVP,3D 拾取等能力未完成。

Kurenai is a DSH-native Cocos plugin that runs a Headless Cocos preview beside chat, inspects the runtime scene tree, and turns clicked nodes into precise agent context. The agent edits source files on disk, then the preview compiles and HMR-refreshes. Use it to create or continue Cocos projects in a DSH workspace with visual selection. Caveat: it is an MVP and requires a local Headless Cocos runtime kit via KURENAI_HEADLESS_ROOT; 3D picking is not implemented.

或使用命令行安装(适合开发者)Or use CLI install (for developers)

命令行安装CLI Install

dsh plugin --profile web add github:kurenai-studio/kurenai

kurenai-studio/kurenai 加入你的 DSH 配置(web profile)即可启用。

READMEREADME

Kurenai Studio

DSH-native Cocos vibe coding: chat beside a live Headless Cocos preview, inspect the runtime scene tree, click a node, and use that selection as precise agent context.

Status: working MVP. Kurenai directly uses each DSH session's workspace directory as its Cocos project root.

The historical preview research tree lived in shinjiyu/headless-cocos (migrated / read-only). Point KURENAI_HEADLESS_ROOT at a local checkout or runtime kit; do not treat that remote as the product home.

Product loop

Click a node in the preview
  → Kurenai Inspector resolves node/path/components
  → selection becomes DSH chat context
  → agent edits the Cocos project on disk
  → Headless Cocos compiles and HMR refreshes the iframe

Kurenai intentionally edits source files rather than mutating only the browser runtime, so changes survive reload and remain reviewable.

Workspace workflow

Kurenai does not maintain an independent project registry.

  • New project — create/open an empty DSH Workspace, then choose the base-ai 2D template or base-ai-3d template from the supplied headless-cocos checkout.
  • Existing project — open the Cocos project directory as a DSH Workspace; Kurenai detects it from package.json and starts the preview.
  • Continue work — reopen the existing DSH Workspace/session. DSH remains the source of truth for project paths, recent workspaces and conversations.

Repository surfaces

  • src/index.ts — DSH host plugin and preview lifecycle tools.
  • src/preview/controller.ts — starts/stops an external Headless Cocos checkout.
  • src/project/ — current-DSH-workspace detection, initialization and local preview control API.
  • src/client/ — DSH shell overlay that splits chat on the left from the preview/Inspector workspace on the right.
  • src/inspector-runtime/ — browser runtime for scene tree, selection and initial 2D UI hit testing.
  • src/shared/protocol.ts — versioned postMessage contract between iframe and DSH.

Current DSH tools

  • kurenai_project_initialize
  • kurenai_project_current
  • kurenai_preview_start
  • kurenai_preview_status
  • kurenai_preview_stop
  • kurenai_publish — headless static publish (platform=web MVP; plugin-extensible)

Headless publish CLI (no Creator):

node $env:KURENAI_HEADLESS_ROOT\spike\publish\cli.mjs --project=<cocos-project> --platform=web

See headless-cocos/spike/publish/README.md.

Development

npm install
npm run check

Install a development build into a DSH profile after building:

dsh plugin --profile <profile> add <absolute-path-to-this-repo>

Configure the generated Cordis row with the Cocos project and a local headless-cocos checkout:

- id: kurenai
  name: "@kurenai-studio/dsh-plugin-kurenai"
  config:
    port: 7460
    controlPort: 7459

Point to the Headless Cocos stack through KURENAI_HEADLESS_ROOT. The project path is always read from the active DSH session cwd.

The runtime kit and Cocos engine binaries are deliberately not distributed by this repository. Follow the Headless Cocos runtime-kit instructions and Cocos licensing requirements.

MVP limitations

  • DSH does not expose a native center-split slot. Kurenai mounts through the additive shell.overlay slot and temporarily reserves right-side frame padding while open, preserving the original conversation and composer.
  • Selecting a node can copy a structured context block. Direct insertion into the active DSH composer still needs a supported conversation API adapter.
  • Initial canvas picking targets 2D UITransform bounds. Camera-aware 3D raycasting and complex multi-camera scenes are not implemented.

License

Kurenai source code is MIT licensed. Cocos Creator engine snapshots, packer binaries and other vendor assets are not part of this repository and remain under their respective licenses.

上一个 Prev dsh-koin-lily-news 下一个 Next dsh-maestro-memory