meshy-dsh 0.3.7 → 0.4.0

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/README.md CHANGED
@@ -2,10 +2,16 @@
2
2
 
3
3
  English | [中文](README.zh.md)
4
4
 
5
- Meshy's 3D generation and 3D printing skills for [DeepSeek Harness](https://github.com/deepseek-ai/deepseek-harness)
6
- (dsh). The agent drives [`meshy-cli`](https://www.npmjs.com/package/meshy-cli) through its shell
7
- tool and saves the results into your project: text or image to 3D, textures, remeshing, rigging
8
- and animation, format conversion, and print-ready files with slicer handoff.
5
+ Native 3D generation and 3D printing for [DeepSeek Harness](https://github.com/deepseek-ai/deepseek-harness)
6
+ (dsh). The agent runs the bundled [`meshy-cli`](https://www.npmjs.com/package/meshy-cli) through
7
+ one native `meshy` tool, with a chat card for every run and your approval before anything spends
8
+ credits. A right-sidebar **Meshy Studio** shows what each chat made, `.glb` and `.3mf` previews get
9
+ a full 3D viewer (animation playback for rigs, filament colours for multi-color prints), and the
10
+ Meshy page lists your recent generations. Every
11
+ generation is the agent's: the Studio's **New** menu, the `/meshy` command and the Meshy page only
12
+ put a request in the message box for you to finish and send. The `meshy-3d-generation` and
13
+ `meshy-3d-printing` skills teach the agent the CLI, and Cordis services let other plugins build on
14
+ all of it.
9
15
 
10
16
  ![A Meshy model delivered in a DeepSeek Harness chat, with the GLB open in the 3D preview](assets/screenshots/chat-and-3d-preview.png)
11
17
 
@@ -18,19 +24,182 @@ dsh plugin --profile web add github:meshy-dev/meshy-dsh
18
24
  ```
19
25
 
20
26
  `dsh --profile web --dump-config` now shows a `# == meshy-dsh` layer, and typing `/` in `dsh web`
21
- lists `meshy-3d-generation` and `meshy-3d-printing` in a new session. Plugins belong to one
22
- profile: install into each one you use (`web`, `tui`, `desktop`). Then ask for a model, for example "make a
23
- low-poly treasure chest and export FBX". The agent checks the CLI, asks you to sign in if needed,
24
- shows the cost and waits for your confirmation before it spends credits.
27
+ lists `meshy-3d-generation` and `meshy-3d-printing` in a new session. Plugins belong to one profile:
28
+ install into each one you use (`web`, `tui`, `desktop`). Then ask for a model, for example "make a
29
+ low-poly treasure chest and export FBX". The agent asks you to sign in if needed, shows the
30
+ estimated credit cost and waits for your approval before running any paid generation.
25
31
 
26
- The plugin ships the Meshy CLI and keeps your sign-in itself: dsh runs the agent's shell in a
32
+ The plugin ships the Meshy CLI and keeps your sign-in on the host: dsh runs the agent's shell in a
27
33
  sandbox that cannot save a login, so the plugin signs in, refreshes the session on its side and
28
- hands it to every shell call. Sign in once — from **Settings → Meshy**, or in a chat, where the
29
- agent shows you a link and a code (the `meshy_sign_in` tool) — and every session, new or old, is
30
- signed in; nothing is installed or downloaded per session. Choose the China site to sign in at
31
- meshy.cn with the same account and the same credits, and keep calls there. The sign-in is the CLI's own (encrypted under
32
- a key your OS keeps), so `meshy` in your terminal shares it. dsh keeps an exported `MESHY_API_KEY`
33
- out of the agent's shell, and the plugin does not pass it on either.
34
+ hands it to both native tools and shell calls. Sign in once — from **Settings → Meshy**, or in a
35
+ chat through `meshy_sign_in` — and every session, new or old, is signed in; nothing is installed or
36
+ downloaded per session. Choose the China site to sign in at meshy.cn with the same account and
37
+ credits, and keep calls there. The sign-in is the CLI's own (encrypted under a key your OS keeps),
38
+ so `meshy` in your terminal shares it. dsh keeps an exported `MESHY_API_KEY` out of the agent's
39
+ shell, and the plugin does not pass it on either.
40
+
41
+ ## What's included
42
+
43
+ ### Native tools
44
+
45
+ - **`meshy`** runs the bundled Meshy CLI, signed in as you, with the arguments the agent passes —
46
+ the commands the skills document, unchanged. It runs in the chat's workspace and writes nowhere
47
+ else. A command that spends credits (`make`, `create` on a task, a non-GET `api` call) first asks
48
+ for your approval, showing the agent's estimate and where it comes from (`make --dry-run` or the
49
+ published price list) next to your balance, or "price unknown" when there is none; declining
50
+ costs nothing. Generations run as dsh background jobs: several can run at once, you keep
51
+ chatting, and the agent hears when each ends. If the CLI stops waiting, the task keeps running on
52
+ Meshy and the agent picks it up again with `wait`, without starting a new one.
53
+ - **`meshy_sign_in`** signs you in from the chat.
54
+ - **`meshy_preview_model`** opens a model or image in the Studio.
55
+
56
+ Which commands are tasks, and so which ones spend credits, comes from the CLI itself
57
+ (`meshy resources`), so a CLI release with new commands works without a plugin change. Each run's
58
+ chat card shows the command, live progress, thumbnails and the credits actually charged, with
59
+ **View** to open the result in the Studio.
60
+
61
+ ### Starting a request
62
+
63
+ Three places put a request in the message box, in the language of the interface; you finish it
64
+ and send it, and nothing runs until you do:
65
+
66
+ - The Studio's **New** menu (and its list while the chat has made nothing yet).
67
+ - The **`/meshy`** command in the message box.
68
+ - The example requests on the Meshy page, which open a new session.
69
+
70
+ **Image to 3D** takes one image, or two to four views of the same object; **Text to 3D** and
71
+ **Generate an image** start a description; **Edit an image** takes the image plus up to four
72
+ references. `/meshy` also offers **Creative Lab**: pick a photo and the agent lists what Creative
73
+ Lab can make of it (a figure, a keychain and so on) and asks which one. Picked images are saved in
74
+ the workspace under `meshy_input/` and referenced in the request (`@meshy_input/sword.png`), so the
75
+ agent works from the files.
76
+
77
+ ### Right sidebar — Meshy Studio
78
+
79
+ In Web and Desktop, the right sidebar adds a **Meshy Studio** tab that follows the chat on screen.
80
+ It shows the chat's results and hands every change to the agent:
81
+
82
+ - **Models** and **Images** are kept apart, by what each task produced. Each has a large stage on
83
+ top — a 3D viewer for models, a zoomable view for images — and a grid of everything the chat
84
+ made below it, by the agent or by the CLI in its shell, where running generations show their
85
+ progress. A result that is neither, such as a printability report, stays in the chat. Each
86
+ result keeps the name it was submitted with; waiting on it later does not rename it.
87
+ - The 3D viewer follows Meshy's web app: **Solid / Unlit / Lit** render modes, the model's texture
88
+ channels (base color, roughness, metallic, normal, emission, ambient occlusion), a wireframe
89
+ overlay, a skeleton view for rigged models, lighting strength and rotation, a grid, face and
90
+ vertex counts, orbit and zoom, reset view and auto-rotate.
91
+ - 3MF print files open the way Meshy's web viewer reads them (build placement, components,
92
+ material and vertex colours, flat-shaded triangles, Z up), and a multi-color print shows its
93
+ filament painting in the filament colours its project settings list, as Bambu Studio and Orca
94
+ Slicer do. A print painted finer than about 1.5 million pieces shows each triangle in the
95
+ filament that covers most of it. A slicer project's negative volumes, modifiers and support
96
+ blockers or enforcers are left out, since they are not printed.
97
+ - Rigged and animated models play: play / pause, a timeline, playback speed and a pick of clips (a
98
+ rigging result has walking and running).
99
+ - Next steps sit in a toolbar over the stage and fit the asset: refine, retexture, remesh or
100
+ UV-unwrap a model; prepare it for 3D printing, or take one step of that (check printability,
101
+ repair, a multi-color 3MF, split into parts, set its real-world size, open it in a slicer); rig
102
+ it; download a format it already has or convert it to another; give a rigged model a new
103
+ animation; send a 3MF print file to the slicer; turn an image into 3D or edit it. A step goes
104
+ into your message box as a request to send or change. Any asset can open in a tab of its own.
105
+ - One Studio per chat: opening it again, from a card or a model preview, brings back the one
106
+ already open, in whichever pane it is.
107
+
108
+ ### Left sidebar — Meshy page, recent generations and Settings
109
+
110
+ The **Meshy** entry in the left sidebar opens the Meshy page with your account summary, your
111
+ **recent generations** and starter requests (pick one to open a new session prefilled and ready to
112
+ edit). Recent generations lists the models and images on your Meshy account that are still
113
+ available — Meshy keeps generated files for 3 days — so you can preview them or continue with one
114
+ in a new session. Files the agent saved stay in their session's workspace.
115
+
116
+ ![The Meshy page in DeepSeek Harness: account, credits and example requests](assets/screenshots/meshy-page.png)
117
+
118
+ **Settings → Meshy** (also the plugin's page under **Plugins**) shows the plugin and Meshy CLI
119
+ versions, sign-in method (browser or API key), account name and email (when reported by the site),
120
+ site (`meshy.ai` or `meshy.cn`) and credit balance. **Sign in to Meshy** shows the approval link
121
+ with a QR code for your phone and the code to check; the page picks up the approval automatically.
122
+
123
+ ### Upgraded GLB and 3MF preview
124
+
125
+ Clicking any `.glb` or `.3mf` file in the workspace opens the interactive 3D preview with the same
126
+ viewer toolbar and animation playback as the Studio. Models up to 256 MB open, past dsh's 32 MB limit for
127
+ previewing a whole file, because the viewer streams them in 2 MB pieces.
128
+
129
+ `tui` and headless profiles have no browser UI; the tools and skills work the same everywhere.
130
+
131
+ ## Composing with Cordis & Creator Mode
132
+
133
+ `meshy-dsh` provides two public Cordis services so other plugins — or custom extensions generated
134
+ in dsh Creator Mode — can build on Meshy without shelling out to the CLI or duplicating auth and
135
+ UI wiring.
136
+
137
+ ### Host service: `ctx.inject(['meshy'])`
138
+
139
+ | Member | Description |
140
+ |---|---|
141
+ | `version` | Contract version (`1`). |
142
+ | `status()` | `Promise<{ authenticated, verified, region, account, balance }>` |
143
+ | `tasks.session(sessionId, opts?)` | `Promise<{ workspace, tasks, models }>` for a session. |
144
+ | `tasks.library({ resource?, limit?, refresh? }?)` | `Promise<{ authenticated, items }>` from the signed-in Meshy account. |
145
+ | `tasks.get(resource, taskId)` | `Promise<{ view?, failed? } \| undefined>` for a single task. |
146
+ | `models.list(workspace)` | `Promise<ModelFile[]>` — `.glb` and `.3mf` files in a workspace, newest first. |
147
+ | `models.announce(workspace, file, meta?)` | Announces a new workspace `.glb` or `.3mf` to listeners and the Studio. |
148
+ | `ui.openModel(sessionId, target)` | Opens the Meshy Studio on `{ file }` or `{ resource, taskId }`. |
149
+ | `ui.openTasks(sessionId)` | Opens the Meshy Studio. |
150
+ | `run({ agent, callId?, signal?, requester?, args, estimatedCredits?, estimateSource?, title? })` | Runs one Meshy CLI command in a chat the way the `meshy` tool does — same approval, same card data — and resolves when it ends. |
151
+ | `subscribe(listener)` | Live `task`, `asset`, `model` and `open` events; returns an unsubscribe function. |
152
+
153
+ There is no price table or per-operation generator: prices and commands belong to the CLI, so a
154
+ plugin passes CLI arguments to `run()`, with the estimate it got from the CLI.
155
+
156
+ ### Client service: `ctx.inject(['meshyUi'])`
157
+
158
+ | Member | Description |
159
+ |---|---|
160
+ | `version` | Contract version (`1`). |
161
+ | `openTab(target?)` | Opens the Meshy Studio for the chat on screen, optionally on `{ file }` or `{ resource, taskId }`. |
162
+ | `openStudioPage()` | Navigates to the left-sidebar Meshy page. |
163
+
164
+ ### Example: a tool that exports a finished model
165
+
166
+ A plugin's own tool can hand a CLI command to Meshy inside the agent's turn; the user approves it
167
+ like any other Meshy run when it spends credits:
168
+
169
+ ```js
170
+ export const name = 'meshy-export-fbx'
171
+
172
+ export function apply(ctx) {
173
+ ctx.inject(['meshy', 'tools'], (ctx) => {
174
+ ctx.tools.register({
175
+ name: 'export_fbx',
176
+ description: 'Save the FBX of a finished Meshy task into exports/fbx/.',
177
+ parameters: {
178
+ type: 'object',
179
+ properties: { resource: { type: 'string' }, task_id: { type: 'string' } },
180
+ required: ['resource', 'task_id'],
181
+ },
182
+ execute: (args, { agent, callId, signal }) => ctx.meshy.run({
183
+ agent, callId, signal, requester: 'FBX export',
184
+ args: ['download', '--resource', args.resource, '--task-id', args.task_id,
185
+ '--model-format', 'fbx', '--output-dir', 'exports/fbx'],
186
+ }),
187
+ })
188
+ })
189
+ }
190
+ ```
191
+
192
+ On the browser side, another UI plugin can jump straight to a model in the right sidebar:
193
+
194
+ ```ts
195
+ ctx.inject(['meshyUi'], (ctx) => {
196
+ ctx.meshyUi.openTab({ file: 'meshy_output/chest.glb' })
197
+ })
198
+ ```
199
+
200
+ In dsh Creator Mode, you can ask dsh to scaffold a plugin around these services directly — for
201
+ example: *"Build a dsh plugin using `ctx.inject(['meshy'])` that listens for finished 3D models
202
+ and logs each model's name and credits to `assets/manifest.json`."*
34
203
 
35
204
  ## Update
36
205
 
@@ -41,36 +210,28 @@ installer would still pick the previous one. To update, uninstall Meshy on its p
41
210
  **Plugins** and add `meshy-dsh` again; from a terminal, `dsh plugin --profile web remove meshy-dsh`
42
211
  followed by the `add` command above. You stay signed in.
43
212
 
44
- ## Settings page and 3D preview
45
-
46
- In Web and Desktop, a **Meshy** entry appears in the left sidebar. It opens a Meshy page with your
47
- account and a few example requests: pick one and a new session opens with it filled in, ready to
48
- edit and send. **Settings → Meshy** (also the plugin's page under **Plugins**) shows the
49
- plugin and Meshy CLI versions, whether and how you are signed in (browser or API key), the account, which
50
- site (meshy.ai or meshy.cn) and your credits. The account (name and email) appears once you sign
51
- in with this version; the China site does not report it yet. **Sign in to Meshy** shows the approval link with a QR code for your phone and the code
52
- to check; the page picks up the approval by itself. Clicking a `.glb` file in the right sidebar, or
53
- the card of a model the agent delivers, opens an interactive 3D preview (drag to orbit, scroll to
54
- zoom, reset the view or let it turn) with its file size and triangle count. Models up to 256 MB
55
- open, past dsh's 32 MB limit for previewing a whole file, because the preview reads them in 2 MB
56
- pieces. tui and headless have
57
- neither; the skills work the same everywhere.
58
-
59
- ![The Meshy page in DeepSeek Harness: account, credits and example requests](assets/screenshots/meshy-page.png)
60
-
61
213
  ## How it works
62
214
 
63
215
  [`cordis.patch.yml`](cordis.patch.yml) mounts one more instance of dsh's built-in filesystem
64
216
  skill provider over this package's `skills/` directory, so the skills load like any local skill,
65
- and loads the package itself: `lib/index.js` keeps the sign-in fresh and gives every shell call
66
- the CLI this package depends on (`DSH_MESHY_NODE`, `DSH_MESHY_CLI`), the session
67
- (`DSH_MESHY_CREDENTIAL`, `DSH_MESHY_REGION`, `DSH_MESHY_SUBJECT`, never the refresh token) and a
68
- `.meshy` directory in the session's workspace for the CLI's operation journal
69
- (`DSH_MESHY_STATE_DIR`); it registers the `meshy_sign_in` tool, and in Web and Desktop serves four
70
- authenticated routes that run the CLI with fixed arguments. `lib/client.js` (built from `src/client/`)
71
- is the browser half, with three.js in a separate `lib/client.viewer.js` loaded on first use. A skill of the same name in
72
- your project's `.dsh/skills` or `.agents/skills` takes precedence. `locale/` and `icon.svg` are
73
- what dsh's Plugin Manager shows.
217
+ and loads the package itself:
218
+
219
+ - **Host (`lib/index.js` and siblings)** — keeps the sign-in fresh, injects the bundled CLI
220
+ (`DSH_MESHY_NODE`, `DSH_MESHY_CLI`), access credential (`DSH_MESHY_CREDENTIAL`,
221
+ `DSH_MESHY_REGION`, `DSH_MESHY_SUBJECT`, never the refresh token) and the chat's own operation
222
+ journal (`DSH_MESHY_STATE_DIR`, `.meshy/sessions/<chat>` in the workspace) into shell calls,
223
+ registers the `meshy`, `meshy_sign_in` and `meshy_preview_model` tools, provides the `meshy`
224
+ Cordis service, and serves the authenticated `/api/meshy.*` routes (status, login/logout,
225
+ update check, session tasks, account library, model streaming, saving picked images into
226
+ `meshy_input/`, live events and the bundled studio HDR map). It reads which commands exist from
227
+ `meshy resources` and holds no command list, model name or price of its own.
228
+ - **Browser (`lib/client.js`, built from `src/client/`)** — provides the `meshyUi` Cordis service,
229
+ the right-sidebar Meshy Studio tab, the `/meshy` command, chat cards for the three tools, the
230
+ left-sidebar Meshy page with recent generations, **Settings → Meshy**, and the `.glb` / `.3mf`
231
+ preview.
232
+ `three` is split into `lib/client.viewer.js` and loaded lazily on first 3D preview.
233
+ - **Skills & metadata** — a skill of the same name in your project's `.dsh/skills` or
234
+ `.agents/skills` takes precedence. `locale/` and `icon.svg` are what dsh's Plugin Manager shows.
74
235
 
75
236
  `skills/` is a copy of the CLI skills in
76
237
  [meshy-3d-agent](https://github.com/meshy-dev/meshy-3d-agent), which owns them and serves every
@@ -80,7 +241,7 @@ other agent host. Change them there.
80
241
 
81
242
  ```bash
82
243
  npm ci && npm run build # rebuild lib/client*.js from src/client/ (committed)
83
- npm test # manifest, client wrappers, host routes, packed files
244
+ npm test # manifest, client wrappers, host routes, tools, services, packed files
84
245
  node scripts/sync-skills.mjs --check # skills/ matches the pinned meshy-3d-agent release
85
246
  node scripts/smoke.mjs # install into a throwaway dsh and load the skills
86
247
  node scripts/sync-skills.mjs --from ../meshy-3d-agent # try unreleased skills from a checkout
package/README.zh.md CHANGED
@@ -2,7 +2,7 @@
2
2
 
3
3
  [English](README.md) | 中文
4
4
 
5
- 为 [DeepSeek Harness](https://github.com/deepseek-ai/deepseek-harness)(dsh)提供 Meshy 的 3D 生成与 3D 打印 skill。agent 通过 shell 调用 [`meshy-cli`](https://www.npmjs.com/package/meshy-cli),结果直接保存到你的项目里:文字或图片生成 3D、贴图、重拓扑、绑骨与动画、格式转换,以及可直接打印的文件和切片软件对接。
5
+ 为 [DeepSeek Harness](https://github.com/deepseek-ai/deepseek-harness)(dsh)提供原生 3D 生成与 3D 打印能力。agent 通过一个原生 `meshy` 工具运行内置的 [`meshy-cli`](https://www.npmjs.com/package/meshy-cli),每次运行都有聊天卡片,花积分前先等你确认。右侧栏 **Meshy Studio** 展示每个对话生成的内容,`.glb` 和 `.3mf` 预览升级为完整的 3D 查看器(绑骨模型可播放动画,多色打印文件显示耗材颜色),Meshy 页面列出你最近的生成。所有生成都由 agent 完成:Studio 的**新建**菜单、`/meshy` 命令和 Meshy 页面只会把请求放进输入框,由你补充后发送。`meshy-3d-generation` 和 `meshy-3d-printing` skill 教 agent 使用 CLI,Cordis 服务让其他插件可以在这一切之上扩展。
6
6
 
7
7
  ![DeepSeek Harness 对话里交付的 Meshy 模型,右侧是 GLB 的 3D 预览](assets/screenshots/chat-and-3d-preview.png)
8
8
 
@@ -14,23 +14,133 @@ dsh plugin --profile web add meshy-dsh
14
14
  dsh plugin --profile web add github:meshy-dev/meshy-dsh
15
15
  ```
16
16
 
17
- 装好后,`dsh --profile web --dump-config` 里会出现 `# == meshy-dsh` 一层;在 `dsh web` 的输入框里输入 `/`,能看到 `meshy-3d-generation` 和 `meshy-3d-printing`(装完要新开会话)。插件按 profile 安装,你用哪个 profile(`web`、`tui`、`desktop`)就要往哪个里装。然后直接提需求,比如"做一个低多边形的宝箱,导出 FBX"。agent 会先检查 CLI,需要时引导你登录,说明消耗的积分,等你确认后才开始生成。
17
+ 装好后,`dsh --profile web --dump-config` 里会出现 `# == meshy-dsh` 一层;在 `dsh web` 的输入框里输入 `/`,能看到 `meshy-3d-generation` 和 `meshy-3d-printing`(装完要新开会话)。插件按 profile 安装,你用哪个 profile(`web`、`tui`、`desktop`)就要往哪个里装。然后直接提需求,比如"做一个低多边形的宝箱,导出 FBX"。需要时 agent 会引导你登录,每次发起付费生成前都会展示预计消耗的积分并等待你确认。
18
18
 
19
- 插件自带 Meshy CLI,登录也由插件保管:dsh 让 agent 的 shell 跑在沙箱里,没法保存登录,所以由插件登录、在自己这边刷新登录态,再交给每一次 shell 调用。在**设置 → Meshy** 里登录一次,或者在聊天里由 agent 给你发链接和验证码(`meshy_sign_in` 工具),之后所有会话,不管新开还是已有,都是已登录状态,每个会话也不用再安装或下载任何东西。选中国站会在 meshy.cn 用同一个账号登录,额度也和国际站通用,之后的调用都走中国站。这份登录就是 CLI 自己的登录(用系统保管的密钥加密),所以终端里的 `meshy` 也共用它。dsh 不会把你 export 的 `MESHY_API_KEY` 带进 agent 的 shell,插件也不会转交它。
19
+ 插件自带 Meshy CLI,登录也由宿主端保管:dsh 让 agent 的 shell 跑在沙箱里,没法保存登录,所以由插件登录、在宿主侧刷新登录态,再同时提供给原生工具和 shell 调用。在**设置 → Meshy** 里登录一次,或在聊天里通过 `meshy_sign_in` 工具扫码/核对验证码完成登录,之后所有新旧会话都是已登录状态,每个会话也不用再安装或下载任何东西。选中国站会在 meshy.cn 用同一个账号登录,额度也和国际站通用,之后的调用都走中国站。这份登录就是 CLI 自己的登录(用系统保管的密钥加密),所以终端里的 `meshy` 也共用它。dsh 不会把你 export 的 `MESHY_API_KEY` 带进 agent 的 shell,插件也不会转交它。
20
20
 
21
- ## 更新
21
+ ## 包含的功能
22
22
 
23
- dsh 不会自动更新已安装的插件,重新安装之前一直是你当初装的版本。在 Web 和 Desktop 里,有新版本时 Meshy 页面和**设置 → Meshy** 会提示,左侧栏的入口上也会出现一个小圆点。新版本发布满一天才会提示,因为在那之前 dsh 安装插件时仍会选上一个版本。更新方法:在**插件**里打开 Meshy 的页面卸载,再重新添加 `meshy-dsh`;在终端里则先运行 `dsh plugin --profile web remove meshy-dsh`,再运行上面的 `add` 命令。登录状态会保留。
23
+ ### 原生工具
24
+
25
+ - **`meshy`**:以你的登录身份运行内置 Meshy CLI,参数就是 agent 传入的那些——skill 里写的命令,原样执行。它在当前对话的 workspace 里运行,也只写这个目录。会花积分的命令(`make`、任务的 `create`、非 GET 的 `api` 调用)会先请你确认:显示 agent 给出的预估及其来源(`make --dry-run` 或公开价格表)和你的余额,没有预估时显示"价格未知,以实际扣费为准";拒绝不花任何积分。生成作为 dsh 后台任务运行:可以同时跑多个,你可以继续聊天,每个结束时 agent 都会收到通知。CLI 等待超时后任务仍在 Meshy 上继续,agent 会用 `wait` 接着等,不会重新提交。
26
+ - **`meshy_sign_in`**:在聊天里登录。
27
+ - **`meshy_preview_model`**:在 Studio 中打开某个模型或图片。
28
+
29
+ 哪些命令是任务、因此会花积分,由 CLI 自己说了算(`meshy resources`),所以 CLI 新增命令后插件不用改就能用。每次运行的聊天卡片会显示命令、实时进度、缩略图和实际扣除的积分,点**查看**可在 Studio 中打开结果。
30
+
31
+ ### 发起请求
32
+
33
+ 有三个地方会按界面语言把请求放进输入框;由你补充并发送,发送之前什么都不会运行:
34
+
35
+ - Studio 的**新建**菜单(对话还没有生成内容时,Studio 里也会直接列出)。
36
+ - 输入框里的 **`/meshy`** 命令。
37
+ - Meshy 页面上的示例需求,会新开一个会话。
38
+
39
+ **图片生成 3D** 接受一张图片,或同一物体的两到四个视角;**文字生成 3D** 和**生成图片**会起一句描述的开头;**编辑图片**接受要改的图片外加最多四张参考图。`/meshy` 还多一个**创意工坊**:选一张照片,agent 会先列出创意工坊能把它做成什么(手办、钥匙扣等),再问你选哪个。选中的图片会保存到 workspace 的 `meshy_input/` 下,并在请求里引用(`@meshy_input/sword.png`),agent 直接用这些文件。
40
+
41
+ ### 右侧栏 —— Meshy Studio
42
+
43
+ 在 Web 和 Desktop 里,右侧栏新增跟随当前对话的 **Meshy Studio** 标签页。它负责展示对话的结果,所有修改都交给 agent:
44
+
45
+ - **模型**和**图片**按任务实际产出分开展示。上方是大舞台——模型用 3D 查看器,图片可缩放查看——下方是本对话生成内容(来自 agent,或 agent 在 shell 里运行的 CLI)的缩略图网格,正在生成的会显示进度。既不是模型也不是图片的结果(比如可打印性检查报告)留在对话里。每个结果沿用提交时的名字,之后等待它完成不会改名。
46
+ - 3D 查看器对齐 Meshy 网页版:**实体 / 无光影 / 真实光照** 三种渲染模式,基础色、粗糙度、金属度、法线、自发光、环境光遮蔽等贴图通道,线框叠加,绑骨模型的骨骼显示,光照强度与旋转,网格,面数和顶点数,旋转缩放、复位视角和自动旋转。
47
+ - 3MF 打印文件按 Meshy 网页版查看器的方式读取(摆放位置、组件、材质色与顶点色、平面着色、Z 轴朝上),多色打印文件按项目设置里的耗材颜色显示涂色,和 Bambu Studio、Orca Slicer 一致。涂色细分超过约 150 万块时,每个三角面显示占它面积最多的那种耗材颜色。切片项目里的负体积、修改器和支撑阻断/强制部件不会打印,因此不显示。
48
+ - 绑骨和带动画的模型可以播放:播放 / 暂停、进度条、播放速度和动画切换(绑骨结果自带走路和跑步)。
49
+ - 后续操作放在舞台底部的工具条里,按类型给出:模型可以精细贴图、重新贴图、重拓扑、UV 展开,准备 3D 打印或只做其中一步(检查可打印性、修复、多色 3MF、拆分部件、设置实际尺寸、在切片软件中打开),绑骨,下载已有的格式或转换为其他格式;绑好骨骼的模型可以换个动画;3MF 打印文件可以送进切片软件;图片可以转为 3D 或修改。操作会作为请求放进输入框,发送前可以修改。任何资产都能在单独的标签页打开。
50
+ - 每个对话只有一个 Studio:从卡片或模型预览再次打开时,会回到已经打开的那个,不管它在哪个面板里。
24
51
 
25
- ## 设置页与 3D 预览
52
+ ### 左侧栏 —— Meshy 页面、最近生成与设置页
26
53
 
27
- 在 Web 和 Desktop 里,左侧栏会出现 **Meshy** 入口,打开后是 Meshy 页面:显示账号,并给出几个示例需求,点一个就会新开会话并填好需求,改一改再发送。**设置 → Meshy**(插件页里也有)会显示插件和 Meshy CLI 的版本、是否已登录及登录方式(浏览器或 API key)、登录的账号、所在站点(meshy.ai 或 meshy.cn)和积分。账号(名字和邮箱)要用这个版本登录后才会显示,中国站暂时还不提供。点**登录 Meshy**会显示批准链接、二维码和核对用的验证码,可以用手机扫码批准,页面会自动发现批准完成。在右侧栏点一个 `.glb` 文件,或点 agent 交付的模型卡片,会打开可交互的 3D 预览(拖动旋转,滚轮缩放,可复位视角或自动旋转),并显示文件大小和三角面数。预览会按 2 MB 分块读取模型,所以不受 dsh 整文件预览 32 MB 的上限限制,最大可预览 256 MB。tui 和 headless 没有这些界面,skill 在任何界面都一样能用。
54
+ 左侧栏的 **Meshy** 入口打开 Meshy 页面,包含账号信息、**最近生成**以及示例需求(点一个即可新开会话并填好提示词)。最近生成列出你 Meshy 账号下仍可获取的模型和图片(Meshy 只保留 3 天内生成的文件),可以预览,或在新会话中继续使用。Agent 已保存的文件留在对应会话的 workspace 里。
28
55
 
29
56
  ![DeepSeek Harness 里的 Meshy 页面:账号、积分和示例需求](assets/screenshots/meshy-page.png)
30
57
 
58
+ **设置 → Meshy**(插件页里也有)显示插件和 Meshy CLI 的版本、登录方式(浏览器或 API key)、登录账号(站点返回时显示名字和邮箱)、所在站点(meshy.ai 或 meshy.cn)和剩余积分。点**登录 Meshy**会显示批准链接、手机二维码和核对验证码,页面会自动感知批准完成。
59
+
60
+ ### 升级版 GLB 与 3MF 预览
61
+
62
+ 在 workspace 里点击任意 `.glb` 或 `.3mf` 文件即可打开交互式 3D 预览,工具栏和动画播放与 Studio 相同。预览按 2 MB 分块读取模型,不受 dsh 整文件预览 32 MB 的限制,最大可预览 256 MB。
63
+
64
+ `tui` 和 headless 没有浏览器界面,工具和 skill 在所有 profile 下都一样能用。
65
+
66
+ ## 与 Cordis 及 Creator Mode 组合扩展
67
+
68
+ `meshy-dsh` 暴露了两个公共 Cordis 服务,其他插件或通过 dsh Creator Mode 生成的自定义扩展可以直接复用 Meshy 的鉴权、任务、模型和 3D 预览能力,无需自己拼 CLI 或重写界面。
69
+
70
+ ### 宿主侧服务:`ctx.inject(['meshy'])`
71
+
72
+ | 成员 | 说明 |
73
+ |---|---|
74
+ | `version` | 接口版本(`1`)。 |
75
+ | `status()` | `Promise<{ authenticated, verified, region, account, balance }>` |
76
+ | `tasks.session(sessionId, opts?)` | 返回指定会话的 `{ workspace, tasks, models }`。 |
77
+ | `tasks.library({ resource?, limit?, refresh? }?)` | 返回当前登录账号最近的任务列表 `{ authenticated, items }`。 |
78
+ | `tasks.get(resource, taskId)` | 查询单个任务详情。 |
79
+ | `models.list(workspace)` | 列出 workspace 中的 `.glb` 和 `.3mf` 文件(按最新排序)。 |
80
+ | `models.announce(workspace, file, meta?)` | 向监听方与 Studio 广播新的 workspace `.glb` 或 `.3mf` 文件。 |
81
+ | `ui.openModel(sessionId, target)` | 打开 Meshy Studio 并定位到 `{ file }` 或 `{ resource, taskId }`。 |
82
+ | `ui.openTasks(sessionId)` | 打开 Meshy Studio。 |
83
+ | `run({ agent, callId?, signal?, requester?, args, estimatedCredits?, estimateSource?, title? })` | 在某个对话里运行一条 Meshy CLI 命令,与 `meshy` 工具完全一致(同样的确认、同样的卡片数据),命令结束后返回结果。 |
84
+ | `subscribe(listener)` | 订阅实时的 `task`、`asset`、`model`、`open` 事件,返回取消订阅函数。 |
85
+
86
+ 服务里没有价格表,也没有按操作区分的生成接口:价格和命令都归 CLI 管,插件把 CLI 参数和它从 CLI 拿到的预估传给 `run()` 即可。
87
+
88
+ ### 浏览器侧服务:`ctx.inject(['meshyUi'])`
89
+
90
+ | 成员 | 说明 |
91
+ |---|---|
92
+ | `version` | 接口版本(`1`)。 |
93
+ | `openTab(target?)` | 为当前屏幕上的对话打开 Meshy Studio,可选定位到 `{ file }` 或 `{ resource, taskId }`。 |
94
+ | `openStudioPage()` | 跳转到左侧栏的 Meshy 页面。 |
95
+
96
+ ### 示例:导出已完成模型的工具
97
+
98
+ 插件自己的工具可以在 agent 的回合里把一条 CLI 命令交给 Meshy;如果会花积分,用户会像其他 Meshy 运行一样先确认:
99
+
100
+ ```js
101
+ export const name = 'meshy-export-fbx'
102
+
103
+ export function apply(ctx) {
104
+ ctx.inject(['meshy', 'tools'], (ctx) => {
105
+ ctx.tools.register({
106
+ name: 'export_fbx',
107
+ description: 'Save the FBX of a finished Meshy task into exports/fbx/.',
108
+ parameters: {
109
+ type: 'object',
110
+ properties: { resource: { type: 'string' }, task_id: { type: 'string' } },
111
+ required: ['resource', 'task_id'],
112
+ },
113
+ execute: (args, { agent, callId, signal }) => ctx.meshy.run({
114
+ agent, callId, signal, requester: 'FBX export',
115
+ args: ['download', '--resource', args.resource, '--task-id', args.task_id,
116
+ '--model-format', 'fbx', '--output-dir', 'exports/fbx'],
117
+ }),
118
+ })
119
+ })
120
+ }
121
+ ```
122
+
123
+ 在浏览器侧,其他 UI 插件也可以直接唤起右侧栏预览指定模型:
124
+
125
+ ```ts
126
+ ctx.inject(['meshyUi'], (ctx) => {
127
+ ctx.meshyUi.openTab({ file: 'meshy_output/chest.glb' })
128
+ })
129
+ ```
130
+
131
+ 在 dsh Creator Mode 里,你也可以直接让 dsh 基于这些服务帮你生成插件,例如:*"用 `ctx.inject(['meshy'])` 写一个 dsh 插件,监听已完成的 3D 模型,把每个模型的名称和消耗积分记录到 `assets/manifest.json`。"*
132
+
133
+ ## 更新
134
+
135
+ dsh 不会自动更新已安装的插件,重新安装之前一直是你当初装的版本。在 Web 和 Desktop 里,有新版本时 Meshy 页面和**设置 → Meshy** 会提示,左侧栏的入口上也会出现一个小圆点。新版本发布满一天才会提示,因为在那之前 dsh 安装插件时仍会选上一个版本。更新方法:在**插件**里打开 Meshy 的页面卸载,再重新添加 `meshy-dsh`;在终端里则先运行 `dsh plugin --profile web remove meshy-dsh`,再运行上面的 `add` 命令。登录状态会保留。
136
+
31
137
  ## 工作方式
32
138
 
33
- [`cordis.patch.yml`](cordis.patch.yml) 再挂一个 dsh 内置的文件系统 skill provider,只扫描本包的 `skills/` 目录,所以这些 skill 和本地 skill 的加载方式完全一样;同时加载本包自身:`lib/index.js` 负责刷新登录态,并给每次 shell 调用提供本包依赖的 CLI(`DSH_MESHY_NODE`、`DSH_MESHY_CLI`)、登录态(`DSH_MESHY_CREDENTIAL`、`DSH_MESHY_REGION`、`DSH_MESHY_SUBJECT`,从不包含 refresh token),以及会话 workspace 里给 CLI 操作日志用的 `.meshy` 目录(`DSH_MESHY_STATE_DIR`);它还注册 `meshy_sign_in` 工具,并在 Web 和 Desktop 里提供四个需要鉴权的接口,用固定参数调用 Meshy CLI;`lib/client.js`(由 `src/client/` 构建)是浏览器端,three.js 单独放在首次使用时才加载的 `lib/client.viewer.js` 里。项目里 `.dsh/skills` 或 `.agents/skills` 下的同名 skill 优先。`locale/` 和 `icon.svg` 是 dsh 插件管理页显示的名称、简介和图标。
139
+ [`cordis.patch.yml`](cordis.patch.yml) 挂载一个 dsh 内置的文件系统 skill provider 扫描本包的 `skills/` 目录,并加载本包自身:
140
+
141
+ - **宿主端(`lib/index.js` 及配套模块)**:维护并刷新登录态,为每次 shell 调用注入内置 CLI(`DSH_MESHY_NODE`、`DSH_MESHY_CLI`)、访问凭证(`DSH_MESHY_CREDENTIAL`、`DSH_MESHY_REGION`、`DSH_MESHY_SUBJECT`,从不包含 refresh token)和当前对话自己的操作日志目录(`DSH_MESHY_STATE_DIR`,即 workspace 下的 `.meshy/sessions/<对话>`);注册 `meshy`、`meshy_sign_in`、`meshy_preview_model` 三个工具并提供 `meshy` Cordis 服务;提供带鉴权的 `/api/meshy.*` 接口(状态、登录/退出、更新检查、会话任务、账号模型库、模型流式读取、把选中的图片存入 `meshy_input/`、实时事件与内置 HDR 环境贴图)。有哪些命令从 `meshy resources` 读取,插件自己不维护命令列表、模型名或价格。
142
+ - **浏览器端(`lib/client.js`,由 `src/client/` 构建)**:提供 `meshyUi` Cordis 服务、右侧栏 Meshy Studio 标签页、`/meshy` 命令、三个工具的聊天卡片、带最近生成的左侧栏 Meshy 页面、**设置 → Meshy** 以及 `.glb` / `.3mf` 预览;three.js 单独拆在首次使用时才加载的 `lib/client.viewer.js` 中。
143
+ - **Skill 与元数据**:项目里 `.dsh/skills` 或 `.agents/skills` 下的同名 skill 优先。`locale/` 和 `icon.svg` 是 dsh 插件管理页显示的名称、简介和图标。
34
144
 
35
145
  `skills/` 是 [meshy-3d-agent](https://github.com/meshy-dev/meshy-3d-agent) 里 CLI skill 的副本;那个仓库负责维护,也服务其他所有 agent 宿主。修改请提到那边。
36
146