@khorsheed/dsh-game 0.0.0-stage → 0.1.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (101) hide show
  1. package/CHANGELOG.md +25 -0
  2. package/README.en.md +53 -0
  3. package/README.i18n.yaml +6 -0
  4. package/README.md +52 -2
  5. package/cordis.patch.yml +23 -0
  6. package/lib/client.js +30690 -0
  7. package/lib/index.js +4297 -0
  8. package/lib/typert.host.d.ts +3 -0
  9. package/lib/typert.host.js +3876 -0
  10. package/lib/typert.remote-client.d.ts +104 -0
  11. package/lib/typert.remote-client.js +2138 -0
  12. package/lib/types/agent.d.ts +20 -0
  13. package/lib/types/agent.js +43 -0
  14. package/lib/types/checks.d.ts +44 -0
  15. package/lib/types/checks.js +267 -0
  16. package/lib/types/client/DesignView.d.ts +22 -0
  17. package/lib/types/client/DesignView.js +134 -0
  18. package/lib/types/client/ElementsView.d.ts +21 -0
  19. package/lib/types/client/ElementsView.js +195 -0
  20. package/lib/types/client/GameTab.d.ts +14 -0
  21. package/lib/types/client/GameTab.js +261 -0
  22. package/lib/types/client/PlayFrame.d.ts +54 -0
  23. package/lib/types/client/PlayFrame.js +129 -0
  24. package/lib/types/client/PlayView.d.ts +19 -0
  25. package/lib/types/client/PlayView.js +163 -0
  26. package/lib/types/client/Preview3D.d.ts +52 -0
  27. package/lib/types/client/Preview3D.js +178 -0
  28. package/lib/types/client/ProjectSwitcher.d.ts +20 -0
  29. package/lib/types/client/ProjectSwitcher.js +75 -0
  30. package/lib/types/client/Recipe3DEditor.d.ts +19 -0
  31. package/lib/types/client/Recipe3DEditor.js +44 -0
  32. package/lib/types/client/StyleGallery.d.ts +18 -0
  33. package/lib/types/client/StyleGallery.js +27 -0
  34. package/lib/types/client/TurnCard.d.ts +62 -0
  35. package/lib/types/client/TurnCard.js +100 -0
  36. package/lib/types/client/VersionsView.d.ts +17 -0
  37. package/lib/types/client/VersionsView.js +68 -0
  38. package/lib/types/client/chat-node.d.ts +42 -0
  39. package/lib/types/client/chat-node.js +77 -0
  40. package/lib/types/client/contract.d.ts +131 -0
  41. package/lib/types/client/contract.js +6 -0
  42. package/lib/types/client/definition.d.ts +22 -0
  43. package/lib/types/client/definition.js +28 -0
  44. package/lib/types/client/index.d.ts +21 -0
  45. package/lib/types/client/index.js +263 -0
  46. package/lib/types/client/locales.d.ts +379 -0
  47. package/lib/types/client/locales.js +733 -0
  48. package/lib/types/client/looks.d.ts +36 -0
  49. package/lib/types/client/looks.js +105 -0
  50. package/lib/types/client/markdown.d.ts +11 -0
  51. package/lib/types/client/markdown.js +52 -0
  52. package/lib/types/client/preset-visibility.d.ts +94 -0
  53. package/lib/types/client/preset-visibility.js +115 -0
  54. package/lib/types/client/preview-entry.d.ts +24 -0
  55. package/lib/types/client/preview-entry.js +110 -0
  56. package/lib/types/client/refs.d.ts +36 -0
  57. package/lib/types/client/refs.js +44 -0
  58. package/lib/types/client/reveal.d.ts +43 -0
  59. package/lib/types/client/reveal.js +73 -0
  60. package/lib/types/client/style-samples.d.ts +5 -0
  61. package/lib/types/client/style-samples.js +196 -0
  62. package/lib/types/fsutil.d.ts +26 -0
  63. package/lib/types/fsutil.js +104 -0
  64. package/lib/types/hooks.d.ts +83 -0
  65. package/lib/types/hooks.js +108 -0
  66. package/lib/types/index.d.ts +30 -0
  67. package/lib/types/index.js +22 -0
  68. package/lib/types/kits/canvas2d.d.ts +6 -0
  69. package/lib/types/kits/canvas2d.js +60 -0
  70. package/lib/types/kits/ids.d.ts +11 -0
  71. package/lib/types/kits/ids.js +6 -0
  72. package/lib/types/kits/index.d.ts +26 -0
  73. package/lib/types/kits/index.js +28 -0
  74. package/lib/types/kits/three3d.d.ts +12 -0
  75. package/lib/types/kits/three3d.js +188 -0
  76. package/lib/types/kits/types.d.ts +52 -0
  77. package/lib/types/kits/types.js +6 -0
  78. package/lib/types/look3d.d.ts +20 -0
  79. package/lib/types/look3d.js +175 -0
  80. package/lib/types/panel-session.d.ts +21 -0
  81. package/lib/types/panel-session.js +16 -0
  82. package/lib/types/project.d.ts +138 -0
  83. package/lib/types/project.js +504 -0
  84. package/lib/types/remote.d.ts +184 -0
  85. package/lib/types/remote.js +263 -0
  86. package/lib/types/skills.d.ts +13 -0
  87. package/lib/types/skills.js +141 -0
  88. package/lib/types/store.d.ts +346 -0
  89. package/lib/types/store.js +1383 -0
  90. package/lib/types/tools.d.ts +12 -0
  91. package/lib/types/tools.js +309 -0
  92. package/lib/types/trash.d.ts +5 -0
  93. package/lib/types/trash.js +64 -0
  94. package/lib/types/types.d.ts +548 -0
  95. package/lib/types/types.js +85 -0
  96. package/lib/types/vfs.d.ts +94 -0
  97. package/lib/types/vfs.js +217 -0
  98. package/locale/en.json +6 -0
  99. package/locale/zh.json +6 -0
  100. package/package.json +132 -3
  101. package/runtime/dsh3d.js +1279 -0
package/CHANGELOG.md ADDED
@@ -0,0 +1,25 @@
1
+ # 变更记录
2
+
3
+ ## 0.1.1(2026-10-27)
4
+
5
+ - **发版时把你带到结果那里**:agent 每次发版,右栏就跳到这一版改的地方——只改了一个元素就打开它,改了好几个就打开元素列表,改了玩法就去「试玩」;agent 也可以自己指定去哪、附一句看什么。你正在试玩或刚在面板里操作时只在顶上提示,不打断。浏览器控制台会记下每次跳或不跳的原因。
6
+ - 元素列表按最近修改排在前面。
7
+ - 协作间里的成员建好或打开项目后,右栏会自己刷新并打开这个项目(以前停在项目列表,要手动点)。
8
+ - 自己描述的长风格只在标签上显示简称(如「青金纸草」),完整描述放在策划的一页纸里、鼠标悬停也能看到,不再挤歪顶栏。
9
+ - 分段按钮(正面 / 侧面 / 背面、卡通着色 / 原材质、画笔 / 换色)改成一整组,选中的那段填色;视角按钮和动画标签都标出当前选中的是哪个。
10
+
11
+ ## 0.1.0(2026-10-26)
12
+
13
+ 首个公开发布:游戏——和 agent 一起做小游戏,你说想玩什么,它做出来,你在右栏直接试玩。随「游戏开发套件」安装,只在游戏开发模式的会话里出现。
14
+
15
+ - **先聊清楚再动手**:游戏名、一句话玩法、有哪几类东西、什么美术风格,agent 一样样问你;风格从示例图里挑。一页纸策划(`game.json`)在「策划」卡片里就地编辑,章节和数值图表都在那里。
16
+ - **坏的版本到不了你手上**:每轮结束自动检查(数据校验、无头冒烟试跑、项目自己的测试),没过就当场修(同一轮至多两次),过了才进「试玩」(想先看一眼再上线,把「自动上线」关掉);agent 在问你之前要先发出一个通过检查的版本(`game_publish`)。
17
+ - **边玩边调手感**:跳多高、跑多快做成滑块,拖着试,觉得对了「定稿」;「告诉 agent」把试的数值写进输入框。
18
+ - **看得见的都能改样子**:主角、敌人、道具,连树、石头、房子都在「元素」里,可以自己画像素外观,也可以让 agent 一次给三个方案挑;每个元素有自己的「设定」卡,汇成「元素设定」一章。
19
+ - **你、agent、成员的改动一条路进游戏**:面板里的修改、agent 和 Claude Code 这类成员改的文件、你在编辑器里改的,右栏都会提示,点「检查并发版」进游戏;每一版记着是谁发的。
20
+ - **随时退回**:「版本」里每一版都留着,可以对比、回滚、确认或拒绝候选版本,也能导出成单个 `.html` 发给朋友。
21
+ - **项目切换**:点标题打开项目卡片(截图、版本、风格、元素、最近改动)。
22
+ - **3D 也能做**:场景切换与地形、批量散布(草、树随风摆)、第三人称跟随相机、可行走的模型;glTF 模型带卡通描边,可按名字调材质颜色、骨骼与形态键,骨骼动画能播放和切换;元素页用 3D 静帧与可拖动的转台预览(正面 / 侧面 / 背面)。
23
+ - 试玩要你点播放按钮才开始;对话里每轮末尾有一张卡片列出这一轮改了什么,点了跳到对应页签。
24
+
25
+ 已知限制:画面全靠代码画(没有 AI 生图),游戏不能联网,每轮的试跑检查要用本机的 Chrome。
package/README.en.md ADDED
@@ -0,0 +1,53 @@
1
+ # @khorsheed/dsh-game
2
+
3
+ English | [中文](README.md)
4
+
5
+ Make a small game with the agent: tell it what you want to play, it builds the game, you play it right there in the sidebar, and if something feels off you just say so.
6
+
7
+ Making a small game used to mean writing the code yourself, or getting a model to spit out some code and then figuring out how to run it, chasing bugs, and watching every fix break something else. With this plugin you only describe the game you want and how it feels when you play; the agent settles the gameplay and the look with you, builds the smallest version that plays, checks its own work every round, and only puts a version in the right sidebar's "Game" panel once it passes. No game-design experience needed.
8
+
9
+ <img src="https://raw.githubusercontent.com/Khorsheed/dsh-basic/main/docs/screenshots/game-1.png" width="560" alt="The right sidebar's Game panel, Play: live v13 waiting for "Start", then sliders such as walk and sneak speed that take effect as you drag; a game-dev mode session on the left">
10
+
11
+ ## What it does
12
+
13
+ - **Talk it through before building**: the name, the one-line pitch, the kinds of things in the game, the art style; it asks about each in turn, and for the style you just pick one of the samples.
14
+ - **Playable early**: it builds the smallest version you can actually play first, then improves it from how playing it feels to you.
15
+ - **Broken versions never reach you**: after every round it checks its own work and fixes what fails on the spot; only a passing version lands under "Play". Want to look before anything goes live? Turn off "Auto-deploy".
16
+ - **Tune the feel while you play**: numbers like jump height and run speed become sliders; drag them around and press "Finalize" when it feels right.
17
+ - **Change the look of anything you can see**: the hero, enemies, items, even trees, rocks and houses live under "Elements"; draw them yourself, or press "Ask the agent for a new look" and pick from three options.
18
+ - **See changes as soon as they land**: whether you edited in the panel or the agent or a Claude Code member changed files, the sidebar says "New changes are not in the game yet"; press "Check and publish" and they go into the game. Every version in "Versions" says whether you or the agent published it.
19
+ - **Go back any time**: every version stays under "Versions"; switch back to an old one, or export a single `.html` file and send it to a friend.
20
+
21
+ <img src="https://raw.githubusercontent.com/Khorsheed/dsh-basic/main/docs/screenshots/game-2.png" width="560" alt="The Elements page: one tile per element — mountains, strange beasts, terrain, characters, buildings — each with a preview">
22
+
23
+ <img src="https://raw.githubusercontent.com/Khorsheed/dsh-basic/main/docs/screenshots/game-3.png" width="560" alt="An element opened: the traveler's 3D model you can drag to rotate, with idle, sneak, walk and other animations, front, side and back views, then "Ask the agent to change the look" and its lore">
24
+
25
+ <img src="https://raw.githubusercontent.com/Khorsheed/dsh-basic/main/docs/screenshots/game-4.png" width="560" alt="The Versions page: every change ships as a checked version; below live v13 the history, each with "Switch back", "Compare with v13" and "Export"">
26
+
27
+ ## Install
28
+
29
+ In DSH, open Plugins → Add plugin, enter this package name, and press Install:
30
+
31
+ ```
32
+ @khorsheed/dsh-gamedev-suite
33
+ ```
34
+
35
+ The game comes with the Game Dev Suite. Then start a new session, pick "游戏开发模式" (game dev mode), and tell the agent what kind of game you'd like to make.
36
+
37
+ The Game panel only appears in Game-dev-mode sessions; not seeing it in other modes is expected.
38
+
39
+ ## Known limitations
40
+
41
+ - Everything on screen is drawn in code, with no AI image generation, so art styles are limited to what code can draw well.
42
+ - Games can't reach the internet; every image and sound has to live inside the project.
43
+ - The per-round check uses Chrome on this computer; without Chrome it only checks the game's data and doesn't actually run it.
44
+
45
+ ## Compatibility
46
+
47
+ Needs DSH 0.2.0 or later; verified on 0.2.1.
48
+
49
+ ## For developers
50
+
51
+ - Entry points: `src/index.ts` (service and per-round checks), `src/client/` (sidebar), `src/agent.ts` (the agent's tools and skills); a project is just a folder in the session workspace, so copying the folder takes the whole game with it.
52
+ - You can install this package alone (`dsh plugin --profile web add @khorsheed/dsh-game`); the game tools are then available in every session.
53
+ - Part of [dsh-plugins](https://github.com/Khorsheed/dsh-plugins); open issues and contributions there. Changes: [CHANGELOG.md](CHANGELOG.md).
@@ -0,0 +1,6 @@
1
+ # Bilingual-pair consistency record: the git blob hash of each side as of the
2
+ # last confirmed-consistent state. Both languages carry equal authority; after
3
+ # editing either side, bring the other along and re-record with:
4
+ # pnpm run verify-translation-pairing --write packages/game/README.en.md
5
+ packages/game/README.en.md: 5b3abc5bfb566be7391691366d1eddea76cf8e43
6
+ packages/game/README.md: 5fa77aa7f174295119dbc75710ef2060c550d6dc
package/README.md CHANGED
@@ -1,3 +1,53 @@
1
- # Temporary Holding Version
1
+ # @khorsheed/dsh-game
2
2
 
3
- This version is a temporary placeholder for this package. An operational version to replace this has been submitted for review and is awaiting a staged release.
3
+ [English](README.en.md) | 中文
4
+
5
+ 和 agent 一起做小游戏:你说想玩什么,它把游戏做出来,你在右边直接试玩,不满意就接着说。
6
+
7
+ 以前想做个小游戏,要么自己写代码,要么让模型吐一份代码,再自己想办法跑起来、找 bug,改一处坏一处。装上之后,你只管说想做什么样的游戏、玩下来感觉哪里不对;agent 陪你把玩法和风格定下来,做出能玩的最小版本,每一轮自己检查一遍,没问题才放进右栏「游戏」让你玩。没做过游戏策划也能上手。
8
+
9
+ <img src="https://raw.githubusercontent.com/Khorsheed/dsh-basic/main/docs/screenshots/game-1.png" width="560" alt="右栏「游戏」的「试玩」:线上 v13 等你点「开始试玩」,下面是行走速度、潜行速度这些拖动即时生效的参数滑块;左边是游戏开发模式的会话">
10
+
11
+ ## 能做什么
12
+
13
+ - **先聊清楚再动手**:游戏叫什么、一句话怎么玩、有哪几类东西、画成什么风格,它会一样样问你;风格从示例图里挑一个就行。
14
+ - **很快就能玩上**:它先做一个能玩起来的最小版本,再照你玩下来的感受一点点改。
15
+ - **坏的版本到不了你手上**:每一轮做完它自己检查,没过就当场修,过了才进「试玩」;想先看一眼再上线,把「自动上线」关掉。
16
+ - **边玩边调手感**:跳多高、跑多快这类数值做成滑块,拖着试,觉得对了点「定稿」。
17
+ - **看得见的都能改样子**:主角、敌人、道具,连树、石头、房子都在「元素」里,可以自己动手画,也可以点「让 agent 改外观」,它一次给三个方案让你挑。
18
+ - **改了就能看到**:不管是你在面板里改的,还是 agent、Claude Code 这些成员改的文件,右栏都会提示「有新改动还没进游戏」,点「检查并发版」就进游戏;「版本」里每一版都标着是你发的还是 agent 发的。
19
+ - **随时退回旧版本**:「版本」里每一版都留着,可以切回去,也能导出成一个 `.html` 文件发给朋友玩。
20
+
21
+ <img src="https://raw.githubusercontent.com/Khorsheed/dsh-basic/main/docs/screenshots/game-2.png" width="560" alt="「元素」页:一格一个元素——名山、异兽、山水地形、角色、建筑,每个都有预览">
22
+
23
+ <img src="https://raw.githubusercontent.com/Khorsheed/dsh-basic/main/docs/screenshots/game-3.png" width="560" alt="打开一个元素:行者的 3D 模型可以拖着转,切换 idle、sneak、walk 等动作和正面、侧面、背面视角,下面是「让 agent 改外观」和它的设定">
24
+
25
+ <img src="https://raw.githubusercontent.com/Khorsheed/dsh-basic/main/docs/screenshots/game-4.png" width="560" alt="「版本」页:每次修改都发成一个版本并通过检查,线上 v13 之下是历史版本,每一版都能「切回这一版」「与 v13 对比」「导出」">
26
+
27
+ ## 安装
28
+
29
+ 在 DSH 的「插件 → 添加插件」里输入下面的包名,点安装:
30
+
31
+ ```
32
+ @khorsheed/dsh-gamedev-suite
33
+ ```
34
+
35
+ 游戏会跟着「游戏开发套件」一起装好。装完开一个新会话,选「游戏开发模式」,告诉 agent 你想做个什么游戏。
36
+
37
+ 「游戏」只在游戏开发模式的会话里出现,在其它模式里看不到它是正常的。
38
+
39
+ ## 已知限制
40
+
41
+ - 画面全靠代码画,没有 AI 生图,美术风格只能在代码画得好的范围里挑。
42
+ - 游戏不能联网,用到的图片、声音都得放在项目里。
43
+ - 每轮检查要用这台电脑上的 Chrome;没装 Chrome 时只检查数据,不实际跑一遍。
44
+
45
+ ## Compatibility
46
+
47
+ 需要 DSH 0.2.0 或更新版本,已在 0.2.1 上验证。
48
+
49
+ ## 给开发者
50
+
51
+ - 入口:`src/index.ts`(服务和每轮检查)、`src/client/`(侧栏)、`src/agent.ts`(agent 用的工具和技能);项目就是会话工作区里的一个文件夹,拷走就带走。
52
+ - 也可以单独安装本包(`dsh plugin --profile web add @khorsheed/dsh-game`),这时游戏工具在所有会话里都能用。
53
+ - 隶属 [dsh-plugins](https://github.com/Khorsheed/dsh-plugins),问题与贡献请到该仓库;变更见 [CHANGELOG.md](CHANGELOG.md)。
@@ -0,0 +1,23 @@
1
+ # game bundle patch: inserts the plugin rows into the composing profile, so
2
+ # `dsh plugin --profile <name> add @khorsheed/dsh-game` reconciles it into the
3
+ # bundles layer. The first row is a bare mount — the host half provides the
4
+ # `gameStore` service, mounts its Remote face and runs the end-of-turn checks
5
+ # for sessions bound to a game project; the browser half is discovered
6
+ # through the package.json `dsh.client` block.
7
+ #
8
+ # NOTE: a composition must mount each row id exactly once — a duplicate loader
9
+ # entry id fails boot.
10
+ #
11
+ # The second row is the `./agent` composition entry (game_open / game_read,
12
+ # the mode's guidance section, the gamedev and game-design skills), live for
13
+ # EVERY session — the community default (the canvas `./agent` pattern). The
14
+ # game-development mode pack (@khorsheed/dsh-gamedev-suite) does NOT re-mount this
15
+ # row: it grants the same entry inside its preset composition, and under host
16
+ # 0.2.x a preset session's scoped copy shadows this global row
17
+ # (packages/core/tools/tests/scoped.spec.ts), so the two coexist — no
18
+ # `disabled: true` handle is needed on either side.
19
+ - insert:
20
+ - id: game
21
+ name: "@khorsheed/dsh-game"
22
+ - id: game-agent
23
+ name: "@khorsheed/dsh-game/agent"