dsh-game-material-master 0.10.2 → 0.11.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.en.md +25 -3
- package/README.md +21 -3
- package/lib/client.js +291 -109
- package/lib/imagedraw.js +185 -0
- package/lib/index.js +80 -7
- package/lib/isodoc.js +153 -4
- package/lib/isoexport.js +14 -2
- package/lib/isogen.js +406 -19
- package/lib/isorender.js +215 -0
- package/lib/links.js +1 -1
- package/lib/mapdoc.js +162 -3
- package/lib/mapexport.js +14 -2
- package/lib/mapgen.js +421 -22
- package/lib/maprender.js +169 -0
- package/lib/maptiles.js +7 -2
- package/lib/toolguides.js +53 -8
- package/lib/tools.js +35 -7
- package/lib/wire.js +90 -8
- package/package.json +1 -1
package/README.en.md
CHANGED
|
@@ -12,7 +12,18 @@ third-party service.
|
|
|
12
12
|
[](https://www.npmjs.com/package/dsh-game-material-master)
|
|
13
13
|
[](LICENSE)
|
|
14
14
|
|
|
15
|
-
> **🆕 0.
|
|
15
|
+
> **🆕 0.11.0 update**: both map editors gain a full **Agent loop** — `mapInspect` / `isoInspect` read cells,
|
|
16
|
+
> objects, stamps, markers and passability by region, while `mapRender` / `isoRender` synchronously produce a
|
|
17
|
+
> **check image** (region crop, zoom, optional marker / grid / passability / outline overlays) and return a local
|
|
18
|
+
> absolute path for `read_image`. `applyMapOps` / `applyIsoOps` add **`dryRun`** (validate without writing) and
|
|
19
|
+
> **`ifRevision`** (reject stale writes instead of overwriting newer edits). Markers carry **kind / color / note /
|
|
20
|
+
> tags** (`marker update`; export formats move to `@5` / `@2`); stamps can be **moved / rotated**, the minimum
|
|
21
|
+
> footprint drops to **1×1**, and passability can be **repainted from the asset properties**; 45° objects can be
|
|
22
|
+
> **duplicated**; tile imports accept a **local path**; every project / task has a **Copy ID** button. Also fixes
|
|
23
|
+
> the multi-cell stamp brush leaking into marker / eraser tools. Wire methods 184 → **188**, new
|
|
24
|
+
> `verify-map-agent` self-check.
|
|
25
|
+
>
|
|
26
|
+
> **0.10.0 update**: the conversational surface is now a single **`game_material`** tool
|
|
16
27
|
> (`action` picks `guide / intake / call / status / wait / review / approve / reviewMode / upload`).
|
|
17
28
|
> The always-resident context drops from **49 KB to about 4 KB**; flows and method tables are loaded on demand
|
|
18
29
|
> through `action:"guide"`. Module ⑤ is replaced by a fully local **45° isometric map editor** (2:1 diamonds,
|
|
@@ -342,7 +353,7 @@ not pay for them in context.
|
|
|
342
353
|
|
|
343
354
|
| action | What it does |
|
|
344
355
|
|---|---|
|
|
345
|
-
| `guide` | Read the manual: `overview` / `workflow` / `config` / `methods` / `ai-asset` / eight module topics |
|
|
356
|
+
| `guide` | Read the manual: `overview` / `workflow` / `config` / `methods` / `ai-asset` / `map-agent` / eight module topics |
|
|
346
357
|
| `intake` | **Step 0 of the fixed workflow**: nail down the key parameters and review mode before doing anything |
|
|
347
358
|
| `call` | Universal channel: every remote method of the plugin is individually callable (`{method, payload}`) |
|
|
348
359
|
| `upload` | Upload assets by local file path (character sheet / reference image / first and last frames / parts…) |
|
|
@@ -361,6 +372,14 @@ game_material({ action: "call", method: "runTurnVideo", payload: { projectId } }
|
|
|
361
372
|
game_material({ action: "wait", module: "sprite", id: projectId })
|
|
362
373
|
```
|
|
363
374
|
|
|
375
|
+
The map editors also expose an Agent loop — inspect state, draw, render a check image, then read it:
|
|
376
|
+
|
|
377
|
+
```js
|
|
378
|
+
game_material({ action: "call", method: "mapInspect", payload: { projectId, region: { r0: 0, c0: 0, r1: 16, c1: 16 } } })
|
|
379
|
+
game_material({ action: "call", method: "mapRender", payload: { projectId, region: { r0: 0, c0: 0, r1: 16, c1: 16 }, overlay: { markers: true, grid: true } } })
|
|
380
|
+
// pass the returned localPath to read_image; use isoInspect / isoRender for the 45° editor
|
|
381
|
+
```
|
|
382
|
+
|
|
364
383
|
The old per-tool registrations (`game_material_call` / `game_material_status` / …) have been merged into this single
|
|
365
384
|
tool; see [docs/ENGINEERING.md](docs/ENGINEERING.md#对话调用agent-也能驱动整条流水线) for the migration mapping.
|
|
366
385
|
|
|
@@ -368,6 +387,9 @@ Review links are **deep links**: an `openUrl` posted by the agent in its reply t
|
|
|
368
387
|
matching plugin page when clicked, landing on the right module / project / stage without any navigating
|
|
369
388
|
on your part.
|
|
370
389
|
|
|
390
|
+
Every project / task header also has a **Copy ID** button (side-list rows show `⧉`); one click copies
|
|
391
|
+
the `projectId` / `jobId` to the clipboard so you can paste it to the agent.
|
|
392
|
+
|
|
371
393
|
---
|
|
372
394
|
|
|
373
395
|
## Installation
|
|
@@ -381,7 +403,7 @@ dsh plugin --profile web add /path/to/dsh-game-material-master
|
|
|
381
403
|
```
|
|
382
404
|
|
|
383
405
|
The package is published to npm: [dsh-game-material-master](https://www.npmjs.com/package/dsh-game-material-master)
|
|
384
|
-
(currently `0.
|
|
406
|
+
(currently `0.11.0`, `latest`). It has no runtime dependencies, so `dsh plugin add` is all you need.
|
|
385
407
|
|
|
386
408
|
**DSH version**: `>=0.2.0-rc.2 <0.3.0` (the `engines.dsh` field; since DSH 0.2.1 the plugin manager checks it first).
|
|
387
409
|
When a Web deployment uses `--public-url https://host/prefix/`, deep links and asset URLs include that path prefix.
|
package/README.md
CHANGED
|
@@ -10,7 +10,14 @@
|
|
|
10
10
|
[](https://www.npmjs.com/package/dsh-game-material-master)
|
|
11
11
|
[](LICENSE)
|
|
12
12
|
|
|
13
|
-
> **🆕 0.
|
|
13
|
+
> **🆕 0.11.0 更新**:两套地图编辑器补上 **Agent 闭环** —— `mapInspect` / `isoInspect` 按区域读逐格、物件、整图、标记与通行性,
|
|
14
|
+
> `mapRender` / `isoRender` 同步出**检查图**(区域裁切、放大、可叠标记 / 网格 / 通行性 / 轮廓,返回本机绝对路径交给 `read_image`);
|
|
15
|
+
> `applyMapOps` / `applyIsoOps` 新增 **`dryRun`**(只校验不写盘)与 **`ifRevision`**(旧版本直接拒绝,防覆盖)。
|
|
16
|
+
> 标记可带 **类型 / 颜色 / 备注 / 标签**(`marker update`,导出格式升到 `@5` / `@2`);整图支持**移动 / 旋转**、最小占格放宽到 **1×1**,
|
|
17
|
+
> 素材属性里可**重画通行区域**;45° 物件可**复制**;导入素材支持直接传**本机路径**;所有项目 / 任务都能**一键复制 ID**。
|
|
18
|
+
> 另外修掉「整图多格笔刷被标记 / 橡皮借用」的问题。wire 方法 184 → **188**,新增自检 `verify-map-agent`。
|
|
19
|
+
>
|
|
20
|
+
> **0.10.0 更新**:对话工具面收成一个 **`game_material`**(`action` 选 `guide / intake / call / status /
|
|
14
21
|
> wait / review / approve / reviewMode / upload`),常驻上下文从 **49 KB 降到约 4 KB**,流程与方法表改成按需读手册;
|
|
15
22
|
> 模块⑤换成**全本地的 45° 地图编辑器**(2:1 等距、4×4 自动连接、多格 / 高处物件、动画地块、标记层、环绕、
|
|
16
23
|
> 一键生成;还能「**AI 生成素材**」:自动开对话生成,整理好回链到「新增素材」确认导入);
|
|
@@ -282,7 +289,7 @@ flowchart LR
|
|
|
282
289
|
|
|
283
290
|
| action | 作用 |
|
|
284
291
|
|---|---|
|
|
285
|
-
| `guide` | 读手册:`overview` / `workflow` / `config` / `methods` / `ai-asset` / 八个模块主题 |
|
|
292
|
+
| `guide` | 读手册:`overview` / `workflow` / `config` / `methods` / `ai-asset` / `map-agent` / 八个模块主题 |
|
|
286
293
|
| `intake` | **固定流程第 0 步**:先把关键参数与审核模式问清楚,再动手 |
|
|
287
294
|
| `call` | 万能通道:插件全部远程方法逐个可调(`{method, payload}`) |
|
|
288
295
|
| `upload` | 按本机文件路径上传素材(设定图 / 参考图 / 首尾帧 / 部件…) |
|
|
@@ -301,12 +308,23 @@ game_material({ action: "call", method: "runTurnVideo", payload: { projectId } }
|
|
|
301
308
|
game_material({ action: "wait", module: "sprite", id: projectId })
|
|
302
309
|
```
|
|
303
310
|
|
|
311
|
+
地图编辑器还支持 Agent 专用的「读状态 → 画 → 看效果图」闭环:
|
|
312
|
+
|
|
313
|
+
```js
|
|
314
|
+
game_material({ action: "call", method: "mapInspect", payload: { projectId, region: { r0: 0, c0: 0, r1: 16, c1: 16 } } })
|
|
315
|
+
game_material({ action: "call", method: "mapRender", payload: { projectId, region: { r0: 0, c0: 0, r1: 16, c1: 16 }, overlay: { markers: true, grid: true } } })
|
|
316
|
+
// 把返回的 localPath 交给 read_image;iso 用 isoInspect / isoRender
|
|
317
|
+
```
|
|
318
|
+
|
|
304
319
|
旧版按 `game_material_call` / `game_material_status` / … 逐个注册的工具已经合并到上面这一个工具,
|
|
305
320
|
迁移对照见 [docs/ENGINEERING.md](docs/ENGINEERING.md#对话调用agent-也能驱动整条流水线)。
|
|
306
321
|
|
|
307
322
|
验收链接是**深链接**:agent 在回复里贴出的 `openUrl` 点一下就切到插件对应页面,原地落到
|
|
308
323
|
对应模块 / 项目 / 阶段上,不需要你自己翻。
|
|
309
324
|
|
|
325
|
+
每个模块的项目 / 任务标题旁都有「**复制 ID**」按钮(侧栏项目行里还有 `⧉`),点一下就把
|
|
326
|
+
`projectId` / `jobId` 复制到剪贴板,直接粘贴给 agent 即可。
|
|
327
|
+
|
|
310
328
|
---
|
|
311
329
|
|
|
312
330
|
## 安装
|
|
@@ -320,7 +338,7 @@ dsh plugin --profile web add /path/to/dsh-game-material-master
|
|
|
320
338
|
```
|
|
321
339
|
|
|
322
340
|
包已发布到 npm:[dsh-game-material-master](https://www.npmjs.com/package/dsh-game-material-master)
|
|
323
|
-
(当前 `0.
|
|
341
|
+
(当前 `0.11.0`,`latest`)。本包没有运行时依赖,`dsh plugin add` 拉下来即可用。
|
|
324
342
|
|
|
325
343
|
**DSH 版本**:`>=0.2.0-rc.2 <0.3.0`(`package.json` 的 `engines.dsh`;DSH 0.2.1 起插件管理器优先按它判断兼容性)。
|
|
326
344
|
Web 部署用 `--public-url https://host/prefix/` 时,深链接与产物地址会跟着补路径前缀。
|