@michengai/dsh-codex-pet 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.
package/package.json ADDED
@@ -0,0 +1,78 @@
1
+ {
2
+ "name": "@michengai/dsh-codex-pet",
3
+ "version": "0.1.1",
4
+ "description": "独立实现的 DSH 宠物插件:Codex 原始宠物库、Skill 创建、Web 页内显示与消费者接入接口",
5
+ "type": "module",
6
+ "publishConfig": {
7
+ "access": "public",
8
+ "registry": "https://registry.npmjs.org/"
9
+ },
10
+ "repository": {
11
+ "type": "git",
12
+ "url": "git+https://github.com/MichengAI/dsh-codex-pet.git"
13
+ },
14
+ "homepage": "https://github.com/MichengAI/dsh-codex-pet#readme",
15
+ "bugs": {
16
+ "url": "https://github.com/MichengAI/dsh-codex-pet/issues"
17
+ },
18
+ "main": "lib/index.js",
19
+ "exports": {
20
+ ".": "./lib/index.js",
21
+ "./client": "./lib/client.js",
22
+ "./package.json": "./package.json"
23
+ },
24
+ "files": [
25
+ "lib",
26
+ "assets/codex/*/spritesheet.webp",
27
+ "assets/branding/dsh-codex-pet-banner.png",
28
+ "assets/screenshots/*.png",
29
+ "skills",
30
+ "cordis.patch.yml",
31
+ "README.md",
32
+ "README.zh-CN.md",
33
+ "CHANGELOG.md",
34
+ "CHANGELOG.zh-CN.md"
35
+ ],
36
+ "dsh": {
37
+ "bundle": {
38
+ "patch": "./cordis.patch.yml"
39
+ },
40
+ "client": {
41
+ "platform": "web",
42
+ "inject": [
43
+ "@deepseek-ai/dsh-client-runtime",
44
+ "@deepseek-ai/dsh-client-ui-slots",
45
+ "@deepseek-ai/dsh-client-ui-session",
46
+ "@deepseek-ai/dsh-client-locale"
47
+ ]
48
+ }
49
+ },
50
+ "scripts": {
51
+ "prepack": "npm run build && tsx scripts/verify-package.ts",
52
+ "build": "node scripts/build.mjs",
53
+ "check": "tsc --noEmit",
54
+ "test": "tsx --test test/*.test.ts",
55
+ "smoke": "npm run build && node scripts/run-smoke.cjs",
56
+ "assets:import": "tsx scripts/import-codex.ts"
57
+ },
58
+ "peerDependencies": {
59
+ "react": "^18.2.0",
60
+ "react-dom": "^18.2.0"
61
+ },
62
+ "devDependencies": {
63
+ "@electron/asar": "^3.4.1",
64
+ "@radix-ui/react-icons": "^1.3.2",
65
+ "@types/node": "^24.0.0",
66
+ "@types/react": "^18.3.0",
67
+ "@types/react-dom": "^18.3.0",
68
+ "esbuild": "^0.25.0",
69
+ "playwright": "^1.63.0",
70
+ "react": "^18.3.1",
71
+ "react-dom": "^18.3.1",
72
+ "tsx": "^4.20.0",
73
+ "typescript": "^5.9.0"
74
+ },
75
+ "engines": {
76
+ "node": ">=22.19.0"
77
+ }
78
+ }
@@ -0,0 +1,37 @@
1
+ ---
2
+ name: hatch-pet
3
+ description: 在 DSH 内创建、校验和安装兼容 Codex 动画协议的宠物,无需安装 Codex。
4
+ ---
5
+
6
+ # DSH 宠物创建
7
+
8
+ 使用当前 DSH 会话已配置的图像生成工具,依据用户描述生成角色与动画。开始前确认图像生成和本地文件处理工具可用;缺少能力时明确说明,不使用占位图片冒充成品。不要读取 Codex 安装目录、账户或 `.codex`。
9
+
10
+ ## 输出与保留
11
+
12
+ 最终目录由创建请求给出,在其中新建唯一的英文短名称子目录。不得覆盖已有宠物。中间产物放在本次专用工作目录,完成后仅清理本次临时产物。
13
+
14
+ 产物为透明背景 `spritesheet.png` 和 UTF-8 `pet.json`。清单包含 `displayName`、`description`、`spritesheetPath: "spritesheet.png"`、`spriteVersionNumber: 2`。
15
+
16
+ ## 动画协议
17
+
18
+ 图集固定 1536×2288,8 列、11 行,每格 192×208。角色外观、大小、脚底基线保持一致,各格透明,不含文字、格线和背景。先生成统一角色参考,再逐行动画,使用图像处理工具确定性拼接,不将整张自由生成的大图直接当作合格图集。
19
+
20
+ | 行 | 动作 | 有效帧 |
21
+ |---|---|---|
22
+ | 0 | 空闲 | 6 |
23
+ | 1 | 向右跑 | 8 |
24
+ | 2 | 向左跑 | 8 |
25
+ | 3 | 挥手 | 4 |
26
+ | 4 | 跳跃 | 5 |
27
+ | 5 | 失败 | 8 |
28
+ | 6 | 等待用户 | 6 |
29
+ | 7 | 工作中 | 6 |
30
+ | 8 | 完成待查看 | 6 |
31
+ | 9–10 | 从正上方起,顺时针每 22.5° 一个注视方向 | 16 |
32
+
33
+ 无效帧留透明。方向注视不能误当作整只角色旋转。生成失败时修复相应整行,避免角色漂移。
34
+
35
+ ## 验收
36
+
37
+ 用可用图像工具检查尺寸、透明通道、单格边界和清单引用;生成联系表与动画预览,实际检查所有动作、角色一致性、闪烁与裁切。未完成视觉检查时明确报告未验收。只有新目录的两项产物均有效时才报告创建完成,并提示回到 DSH 宠物设置刷新选择。