@xiaobuyu/nodesign 0.0.1 → 0.0.2

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 (282) hide show
  1. package/README.md +156 -106
  2. package/bin/nodesign.js +0 -0
  3. package/package.json +1 -1
  4. package/server/api/README.md +45 -45
  5. package/server/api/_guard.js +75 -75
  6. package/server/api/admin.js +187 -187
  7. package/server/api/assets/docx-page.js +103 -103
  8. package/server/api/assets/helpers.js +22 -22
  9. package/server/api/assets/notes.js +144 -144
  10. package/server/api/assets.js +896 -896
  11. package/server/api/board.js +57 -57
  12. package/server/api/browse.js +138 -138
  13. package/server/api/canvas.js +444 -444
  14. package/server/api/chatai.js +324 -324
  15. package/server/api/exports/build-standalone.js +980 -980
  16. package/server/api/exports/cards.js +118 -118
  17. package/server/api/exports/docx-pdf.js +46 -46
  18. package/server/api/exports/export-page.js +142 -142
  19. package/server/api/exports/handoff.js +147 -147
  20. package/server/api/exports.js +690 -690
  21. package/server/api/instruction.js +75 -75
  22. package/server/api/me.js +116 -116
  23. package/server/api/memory.js +185 -185
  24. package/server/api/pending-changes.js +366 -366
  25. package/server/api/plugins.js +164 -164
  26. package/server/api/projects.js +220 -220
  27. package/server/api/publish.js +64 -64
  28. package/server/api/recent.js +73 -73
  29. package/server/api/sessions.js +589 -589
  30. package/server/api/skills.js +77 -77
  31. package/server/api/standalone-fit.js +168 -168
  32. package/server/api/turn-compose.js +180 -180
  33. package/server/api/turn-inflight.js +44 -44
  34. package/server/auth/README.md +17 -17
  35. package/server/auth/middleware.js +138 -138
  36. package/server/auth/origin-guard.js +71 -71
  37. package/server/auth/session.js +108 -108
  38. package/server/auth/tier.js +113 -113
  39. package/server/auth/users-store.js +348 -348
  40. package/server/edit/README.md +29 -29
  41. package/server/engine/README.md +113 -113
  42. package/server/engine/agent/agent-shared.js +550 -550
  43. package/server/engine/agent/auto-mode-default-hard-deny.txt +4 -4
  44. package/server/engine/agent/auto-mode-rules.js +78 -78
  45. package/server/engine/agent/context.js +418 -418
  46. package/server/engine/agent/events.js +464 -464
  47. package/server/engine/agent/hooks/canvas-validate.js +199 -199
  48. package/server/engine/agent/hooks/failure.js +120 -120
  49. package/server/engine/agent/hooks/file-events.js +75 -75
  50. package/server/engine/agent/hooks/lifecycle.js +233 -233
  51. package/server/engine/agent/hooks/post-canvas-focus.js +80 -80
  52. package/server/engine/agent/hooks/post-guidance.js +206 -206
  53. package/server/engine/agent/hooks/post-subagent-report.js +104 -104
  54. package/server/engine/agent/hooks/post-trim.js +58 -58
  55. package/server/engine/agent/hooks/pre-board-neighborhood.js +34 -34
  56. package/server/engine/agent/hooks/pre-defaults.js +84 -84
  57. package/server/engine/agent/hooks/pre-injectors.js +277 -277
  58. package/server/engine/agent/hooks/pre-performance-log-guard.js +78 -78
  59. package/server/engine/agent/hooks/pre-starter-files.js +61 -61
  60. package/server/engine/agent/hooks/pre-workspace-scope-guard.js +78 -78
  61. package/server/engine/agent/hooks/site-validate.js +94 -94
  62. package/server/engine/agent/hooks/tool-prompts.js +31 -31
  63. package/server/engine/agent/hooks/turn-state-memory.js +56 -56
  64. package/server/engine/agent/hooks/user-prompt-submit.js +215 -215
  65. package/server/engine/agent/hooks.js +354 -354
  66. package/server/engine/agent/init-contract.js +69 -69
  67. package/server/engine/agent/isolation.js +159 -159
  68. package/server/engine/agent/model-table.js +292 -292
  69. package/server/engine/agent/plugin-loader.js +266 -266
  70. package/server/engine/agent/prompts/nodesign-prelude.md +336 -336
  71. package/server/engine/agent/prompts/tools/ask-user-question-protocol.md +71 -71
  72. package/server/engine/agent/prompts/tools/direct-edit-protocol.md +98 -98
  73. package/server/engine/agent/prompts/tools/generate-image-cookbook.gemini-gateway.md +583 -583
  74. package/server/engine/agent/prompts/tools/generate-image-cookbook.md +483 -483
  75. package/server/engine/agent/prompts/tools/hybrid-reference.md +100 -100
  76. package/server/engine/agent/prompts/tools/paint-still-cookbook.md +270 -270
  77. package/server/engine/agent/prompts/tools/roll-film-cookbook.md +70 -70
  78. package/server/engine/agent/prompts/tools/site-reference.md +106 -106
  79. package/server/engine/agent/prompts/tools/tweaks-syntax.md +125 -125
  80. package/server/engine/agent/prompts/tools/vision-checker-dispatch.md +48 -48
  81. package/server/engine/agent/session-loop.js +1024 -1024
  82. package/server/engine/agent/session-model.js +164 -164
  83. package/server/engine/agent/skill.js +204 -204
  84. package/server/engine/agent/task-events.js +78 -78
  85. package/server/engine/agents/ds-extractor.md +132 -132
  86. package/server/engine/agents/explorer.md +190 -190
  87. package/server/engine/agents/index.js +230 -230
  88. package/server/engine/agents/schemas/design-system.json +156 -156
  89. package/server/engine/agents/schemas/tweak-schema.json +113 -113
  90. package/server/engine/agents/tweak-proposer.md +127 -127
  91. package/server/engine/agents/vision-checker.md +254 -254
  92. package/server/engine/browse/capture.js +422 -422
  93. package/server/engine/browse/card.js +137 -137
  94. package/server/engine/browse/handover.js +59 -59
  95. package/server/engine/browse/page-digest.js +119 -119
  96. package/server/engine/browse/refs.js +196 -196
  97. package/server/engine/browse/registry.js +307 -307
  98. package/server/engine/browse/screencast.js +170 -170
  99. package/server/engine/browse/state.js +121 -121
  100. package/server/engine/chatai/chat-log.js +79 -79
  101. package/server/engine/chatai/index.js +193 -193
  102. package/server/engine/chatai/openai-compat.js +152 -152
  103. package/server/engine/chatai/orchestrate.js +309 -309
  104. package/server/engine/chatai/perform.js +40 -40
  105. package/server/engine/chatai/summarize.js +79 -79
  106. package/server/engine/mcp/capability-gate.js +52 -52
  107. package/server/engine/mcp/index.js +339 -339
  108. package/server/engine/mcp/param-sanitizer.js +142 -142
  109. package/server/engine/mcp/tools/arrange-on-board.js +124 -124
  110. package/server/engine/mcp/tools/artifact-session.js +278 -278
  111. package/server/engine/mcp/tools/browse-computer.js +421 -421
  112. package/server/engine/mcp/tools/browse-find-batch.js +183 -183
  113. package/server/engine/mcp/tools/browse-screenshot.js +157 -157
  114. package/server/engine/mcp/tools/browse.js +480 -480
  115. package/server/engine/mcp/tools/build-docx.js +101 -101
  116. package/server/engine/mcp/tools/clear-pending-changes.js +99 -99
  117. package/server/engine/mcp/tools/create-on-board.js +155 -155
  118. package/server/engine/mcp/tools/crystallize-skill.js +168 -168
  119. package/server/engine/mcp/tools/explain-style.js +237 -237
  120. package/server/engine/mcp/tools/export-handoff.js +133 -133
  121. package/server/engine/mcp/tools/expose-tweaks.js +149 -149
  122. package/server/engine/mcp/tools/generate-image.js +842 -842
  123. package/server/engine/mcp/tools/get-computed-styles.js +164 -164
  124. package/server/engine/mcp/tools/get-pending-changes.js +205 -205
  125. package/server/engine/mcp/tools/h3box-ssh.js +84 -84
  126. package/server/engine/mcp/tools/helpers/acquire-page.js +82 -82
  127. package/server/engine/mcp/tools/helpers/motion-lab.js +554 -554
  128. package/server/engine/mcp/tools/helpers/motion-scroll.js +112 -112
  129. package/server/engine/mcp/tools/helpers/perception-page.js +215 -215
  130. package/server/engine/mcp/tools/helpers/reference-download.js +103 -103
  131. package/server/engine/mcp/tools/helpers/rembg-bridge.py +80 -80
  132. package/server/engine/mcp/tools/helpers/shot-pipeline.js +280 -280
  133. package/server/engine/mcp/tools/highlight.js +68 -68
  134. package/server/engine/mcp/tools/list-pages.js +222 -222
  135. package/server/engine/mcp/tools/lookup-tags.js +59 -59
  136. package/server/engine/mcp/tools/navigate-to-page.js +60 -60
  137. package/server/engine/mcp/tools/organize-board.js +64 -64
  138. package/server/engine/mcp/tools/paint-still.js +434 -434
  139. package/server/engine/mcp/tools/pin-to-board.js +130 -130
  140. package/server/engine/mcp/tools/preview-deck.js +130 -130
  141. package/server/engine/mcp/tools/profile-scroll.js +305 -305
  142. package/server/engine/mcp/tools/publish-site.js +102 -102
  143. package/server/engine/mcp/tools/query-elements.js +195 -195
  144. package/server/engine/mcp/tools/read-board.js +103 -103
  145. package/server/engine/mcp/tools/read-document.js +93 -93
  146. package/server/engine/mcp/tools/read-page.js +264 -264
  147. package/server/engine/mcp/tools/read-tavern-json.js +143 -143
  148. package/server/engine/mcp/tools/record-decision.js +140 -140
  149. package/server/engine/mcp/tools/relate-on-board.js +110 -110
  150. package/server/engine/mcp/tools/report-issue.js +115 -115
  151. package/server/engine/mcp/tools/roll-film.js +266 -266
  152. package/server/engine/mcp/tools/screenshot-docx.js +138 -138
  153. package/server/engine/mcp/tools/screenshot-url.js +195 -195
  154. package/server/engine/mcp/tools/screenshot.js +583 -583
  155. package/server/engine/mcp/tools/tier-gate.js +96 -96
  156. package/server/engine/mcp/tools/trace-motion.js +215 -215
  157. package/server/engine/mcp/tools/web-search.js +548 -548
  158. package/server/engine/motion/inventory.js +349 -349
  159. package/server/engine/perception/session.js +235 -235
  160. package/server/engine/plugins/nodesign/.claude-plugin/plugin.json +5 -5
  161. package/server/engine/plugins/nodesign/skills/deskskill-engine-mini/SKILL.md +192 -192
  162. package/server/engine/plugins/nodesign/skills/deskskill-engine-mini/canvas.template.html +667 -667
  163. package/server/engine/plugins/nodesign/skills/deskskill-engine-mini/patterns/hybrid-grid.md +22 -22
  164. package/server/engine/plugins/nodesign/skills/deskskill-engine-mini/patterns/image-led-cover.md +25 -25
  165. package/server/engine/plugins/nodesign/skills/deskskill-engine-mini/patterns/portrait.md +23 -23
  166. package/server/engine/plugins/nodesign/skills/deskskill-engine-mini/patterns/quote-backdrop.md +21 -21
  167. package/server/engine/plugins/nodesign/skills/deskskill-engine-mini/patterns/section-divider.md +23 -23
  168. package/server/engine/plugins/nodesign/skills/deskskill-engine-mini/patterns/text-led.md +21 -21
  169. package/server/engine/plugins/nodesign/skills/docx-craft/SKILL.md +162 -162
  170. package/server/engine/plugins/nodesign/skills/docx-craft/references/token-schema.md +407 -407
  171. package/server/engine/plugins/nodesign/skills/docx-craft//346/226/207/346/241/243.template.json +80 -80
  172. package/server/engine/plugins/nodesign/skills/rp-craft/SKILL.md +228 -228
  173. package/server/engine/plugins/nodesign/skills/rp-craft/patterns//346/274/224/345/207/272/351/241/265-/346/234/200/345/260/217/345/256/236/347/216/260.html +78 -78
  174. package/server/engine/plugins/nodesign/skills/rp-craft//346/274/224/345/207/272.template.js +268 -268
  175. package/server/engine/plugins/nodesign/skills/site-craft/SKILL.md +323 -323
  176. package/server/engine/plugins/nodesign/skills/site-craft/patterns/build-lane.md +134 -134
  177. package/server/engine/plugins/nodesign/skills/site-craft/patterns/cutout-collage.md +61 -61
  178. package/server/engine/plugins/nodesign/skills/site-craft/patterns/mock-app.md +163 -163
  179. package/server/engine/plugins/nodesign/skills/site-craft/patterns/page-transitions.md +86 -86
  180. package/server/engine/runs/active-runs.js +698 -698
  181. package/server/engine/runs/live-turn.js +252 -252
  182. package/server/engine/runs/store.js +364 -364
  183. package/server/engine/runs/turn-relay.js +217 -217
  184. package/server/engine/runtime/workspace.js +164 -164
  185. package/server/lib/artifact-file-path.js +80 -80
  186. package/server/lib/artifact-target.js +284 -284
  187. package/server/lib/asset-refs.js +239 -239
  188. package/server/lib/async-queue.js +104 -104
  189. package/server/lib/auto-relations.js +130 -130
  190. package/server/lib/binding-types.js +60 -60
  191. package/server/lib/board-kind-sizes.js +62 -62
  192. package/server/lib/board-relations.js +133 -133
  193. package/server/lib/browse-proxy.js +180 -180
  194. package/server/lib/canvas-id.js +36 -36
  195. package/server/lib/cover.js +227 -227
  196. package/server/lib/danbooru-tags.js +291 -291
  197. package/server/lib/doc-extract.js +156 -156
  198. package/server/lib/docx/build-from-source.js +260 -260
  199. package/server/lib/docx/build.js +490 -490
  200. package/server/lib/docx/dump-styles.js +287 -287
  201. package/server/lib/docx/fonts/nodesign-cjk.conf +164 -164
  202. package/server/lib/docx/merge-runs.js +129 -129
  203. package/server/lib/docx/numbering.js +218 -218
  204. package/server/lib/docx/order.js +152 -152
  205. package/server/lib/docx/rawzip.js +172 -172
  206. package/server/lib/docx/render.js +92 -92
  207. package/server/lib/docx/text-lint.js +225 -225
  208. package/server/lib/docx/tokens.js +335 -335
  209. package/server/lib/docx/units.js +29 -29
  210. package/server/lib/docx/xml.js +291 -291
  211. package/server/lib/docx-pages.js +187 -187
  212. package/server/lib/export-collect.js +289 -289
  213. package/server/lib/export-package.js +210 -210
  214. package/server/lib/html-srcset.js +145 -145
  215. package/server/lib/image-variant.js +460 -460
  216. package/server/lib/ingress/forward-openai-chat.js +305 -305
  217. package/server/lib/ingress/openai-chat.js +491 -491
  218. package/server/lib/ingress/session-notice.js +66 -66
  219. package/server/lib/ingress/session-routes.js +68 -68
  220. package/server/lib/ingress/slot-probe.js +130 -130
  221. package/server/lib/ingress/upstream-billing.js +52 -52
  222. package/server/lib/ingress/upstream-fail-streak.js +72 -72
  223. package/server/lib/ingress/upstream-truncation.js +48 -48
  224. package/server/lib/issues-store.js +182 -182
  225. package/server/lib/kinds/deck.js +72 -72
  226. package/server/lib/kinds/docx.js +283 -283
  227. package/server/lib/kinds/file-kinds.js +113 -113
  228. package/server/lib/kinds/index.js +202 -202
  229. package/server/lib/kinds/site.js +161 -161
  230. package/server/lib/model-ingress.js +543 -543
  231. package/server/lib/moderation.js +255 -255
  232. package/server/lib/notice-store.js +103 -103
  233. package/server/lib/plugin-install.js +104 -104
  234. package/server/lib/plugin-validator.js +721 -721
  235. package/server/lib/publish-store.js +115 -115
  236. package/server/lib/quick-summary.js +52 -52
  237. package/server/lib/quota.js +270 -270
  238. package/server/lib/rate-window.js +29 -29
  239. package/server/lib/reference-assets.js +92 -92
  240. package/server/lib/region-shot.js +135 -135
  241. package/server/lib/safe-path.js +73 -73
  242. package/server/lib/sdk-session.js +33 -33
  243. package/server/lib/showcase-store.js +92 -92
  244. package/server/lib/site-publish.js +465 -465
  245. package/server/lib/ssrf-guard.js +432 -432
  246. package/server/lib/task-scan.js +158 -158
  247. package/server/lib/tavern-json.js +154 -154
  248. package/server/lib/video-variant.js +237 -237
  249. package/server/lib/workspace-path.js +33 -33
  250. package/server/ops/fix-sdk-musl.mjs +40 -40
  251. package/server/ops/install-macos-fonts.sh +114 -114
  252. package/server/ops/macos-fonts.conf +336 -336
  253. package/server/ops/sandbox-shim/bwrap +57 -57
  254. package/server/projects/assets-summary.js +119 -119
  255. package/server/projects/auto-name.js +53 -53
  256. package/server/projects/board-store.js +640 -640
  257. package/server/projects/move-entry.js +103 -103
  258. package/server/projects/store.js +270 -270
  259. package/server/projects/ui-config.js +54 -54
  260. package/server/projects/workspace-templates.js +53 -53
  261. package/server/projects/workspace.js +1025 -1025
  262. package/server/runtime/local-config.js +177 -177
  263. package/server/runtime/profile.js +72 -72
  264. package/server/services/rembg-service.py +334 -334
  265. package/server/shared/README.md +25 -25
  266. package/server/shared/deck.js +54 -54
  267. package/server/shared/time.js +49 -49
  268. package/server/style-pipeline/README.md +53 -53
  269. package/server/ws/broker.js +36 -36
  270. package/server/ws/browse-channel.js +177 -177
  271. package/server/ws/index.js +386 -386
  272. package/web/README.md +89 -89
  273. package/web/dist/assets/BrowserWindow-BYCgizHw.js +11 -0
  274. package/web/dist/assets/{DeckWindow-4G0xX7P3.js → DeckWindow-pNydEM4L.js} +1 -1
  275. package/web/dist/assets/{DocxWindow-BXQsoPkh.js → DocxWindow-PPgzh3Gq.js} +1 -1
  276. package/web/dist/assets/{SiteWindow-D6eS-2gM.js → SiteWindow-DM0LQPCO.js} +1 -1
  277. package/web/dist/assets/{index-Cbl3ATvp.js → index-BHTBJlpY.js} +32 -32
  278. package/web/dist/assets/{pending-edit-apply-DTjo2geW.js → pending-edit-apply-C0I13CbD.js} +1 -1
  279. package/web/dist/assets/{rotate-cw-LMT3x1Zj.js → rotate-cw-B1UQ8Hld.js} +1 -1
  280. package/web/dist/assets/{square-dashed-mouse-pointer-CBoAkfhi.js → square-dashed-mouse-pointer-8lrgqmfv.js} +1 -1
  281. package/web/dist/index.html +17 -17
  282. package/web/dist/assets/BrowserWindow-Dc7J7CYc.js +0 -11
@@ -1,143 +1,143 @@
1
- /**
2
- * mcp/tools/read-tavern-json.js — read_tavern_json MCP tool(2026-08-15)
3
- *
4
- * 搬酒馆的东西进来时的读取口。**不要用 Read 去读这类文件**:真样本
5
- * (Izumi 0814.json)464KB、210 条提示词,启用的只有 56 条 —— Read 一次就是
6
- * 十几万 token 进上下文,换来的绝大部分是停用的备选条目。
7
- *
8
- * 两步走:先 `摘要` 看结构(每条只给名字/角色/字数/一句引子),挑好了再
9
- * `取` 正文。转成 编排.yaml 和设定文件是 agent 自己的活,这个工具只读不写。
10
- */
11
-
12
- import path from 'node:path';
13
- import fs from 'node:fs/promises';
14
- import { tool } from '@anthropic-ai/claude-agent-sdk';
15
- import { z } from 'zod';
16
- import { detectKind, digest, fetchEntries } from '../../../lib/tavern-json.js';
17
-
18
- const MAX_FETCH_CHARS = 24_000;
19
-
20
- function 渲染摘要(d, 文件名) {
21
- const L = [];
22
- if (d.形态 === 'preset') {
23
- L.push(`酒馆 Chat Completion 预设:${文件名}`);
24
- L.push(`启用 ${d.启用.length} 条(其中有正文的 ${d.启用.filter(e => e.字数 > 0).length} 条,合计 ${d.合计字数} 字)· 停用 ${d.停用.length} 条`);
25
- const p = d.参数;
26
- L.push(`参数:temperature ${p.temperature} · top_p ${p.top_p} · 最大输出 ${p.最大输出} · reasoning_effort ${p.reasoning_effort ?? '未设'}`);
27
- L.push('');
28
- L.push('启用条目(顺序 = 进模型顺序):');
29
- for (const [i, e] of d.启用.entries()) {
30
- const 标 = e.占位 ? '〔占位·酒馆运行时填,搬过来丢掉〕'
31
- : e.分隔 ? '〔分节标题·无正文〕' : `${e.字数}字`;
32
- L.push(`${String(i + 1).padStart(2)}. ${e.名字} [${e.角色}] ${标}${e.深度 != null ? ` 深度${e.深度}` : ''}`);
33
- if (e.引子) L.push(` ${e.引子}…`);
34
- }
35
- if (d.停用.length) {
36
- L.push('');
37
- L.push(`停用的 ${d.停用.length} 条(同一功能的备选,酒馆里只开一个;名字列表):`);
38
- L.push(d.停用.map(e => e.名字).join(' / '));
39
- }
40
- L.push('');
41
- L.push('占位条目(marker,酒馆运行时填角色卡/历史,搬过来一律丢):' + (d.占位条目.join(' / ') || '无'));
42
- L.push('分节标题(0 字,只是把开关分组,也不用搬):' + (d.分隔条目.join(' / ') || '无'));
43
- } else if (d.形态 === 'card') {
44
- L.push(`酒馆角色卡:${d.名字}(${文件名})`);
45
- for (const f of d.字段) L.push(`- ${f.字段} ${f.字数}字 ${f.引子}…`);
46
- if (d.开场白备选) L.push(`- alternate_greetings ${d.开场白备选} 条备选开场白`);
47
- if (d.世界书.length) {
48
- L.push('');
49
- L.push(`内嵌世界书 ${d.世界书.length} 条:`);
50
- for (const e of d.世界书) {
51
- L.push(`- ${e.名字} ${e.常驻 ? '常驻' : `触发[${e.触发.join(' ')}]`} ${e.字数}字${e.停用 ? ' (停用)' : ''}`);
52
- }
53
- }
54
- } else {
55
- L.push(`酒馆世界书:${文件名},${d.条目.length} 条`);
56
- for (const e of d.条目) {
57
- L.push(`- ${e.名字} ${e.常驻 ? '常驻' : `触发[${e.触发.join(' ')}]`} ${e.字数}字${e.停用 ? ' (停用)' : ''}`);
58
- if (e.引子) L.push(` ${e.引子}…`);
59
- }
60
- }
61
- L.push('');
62
- L.push('要正文就再调一次本工具:mode="fetch",entries=["名字或名字的一部分", …]。');
63
- return L.join('\n');
64
- }
65
-
66
- export function makeReadTavernJsonTool({ workspaceRoot, sharedRoot }) {
67
- return tool(
68
- 'read_tavern_json',
69
- `Read a SillyTavern (酒馆) export JSON — a chat-completion **preset**, a
70
- **character card** (V2/V3), or a **lorebook** — without pouring the whole file
71
- into your context.
72
-
73
- Use this instead of Read for any 酒馆 JSON. A real preset in the wild is 460KB
74
- with 210 prompt entries of which only 56 are enabled; Read would burn six digits
75
- of tokens on disabled alternates.
76
-
77
- Two steps:
78
- 1. mode "digest" (default) — structure only: every entry's name, role, size and a
79
- 60-char peek, plus which are enabled/disabled, plus sampler params.
80
- 2. mode "fetch" with entries[] — full text of just the ones you picked (name,
81
- partial name, or id). Capped at ${MAX_FETCH_CHARS} chars per call.
82
-
83
- This tool only reads. Turning a preset into 编排.yaml + 设定 files is your job —
84
- you decide the grouping, and you drop what does not belong (markers are filled by
85
- 酒馆 at runtime and have no place here; platform-specific jailbreak sections are
86
- pointless on this platform).`,
87
- {
88
- path: z.string().describe(
89
- 'Path to the .json. Relative paths resolve against the session workspace, '
90
- + 'then the shared project dir (e.g. "assets/Izumi 0814.json").',
91
- ),
92
- // ⚠️ 参数名和枚举值一律 ASCII —— 工具 schema 是模型要照着填的东西,
93
- // 中文键名在这条路上不可靠(全仓其他工具也都是 ASCII,别开这个头)
94
- mode: z.enum(['digest', 'fetch']).optional()
95
- .describe('digest = structure only (default); fetch = full text of the picked entries'),
96
- entries: z.array(z.string()).optional()
97
- .describe('For mode="fetch": entry names (partial match ok) or ids'),
98
- },
99
- async ({ path: rel, mode = 'digest', entries = [] }) => {
100
- const fail = (text) => ({ content: [{ type: 'text', text }], isError: true });
101
- try {
102
- const raw = String(rel || '').trim();
103
- if (!raw) return fail('read_tavern_json needs a path.');
104
- const candidates = path.isAbsolute(raw)
105
- ? [raw]
106
- : [workspaceRoot && path.resolve(workspaceRoot, raw),
107
- sharedRoot && path.resolve(sharedRoot, raw)].filter(Boolean);
108
- let abs = null;
109
- for (const c of candidates) {
110
- try { await fs.access(c); abs = c; break; } catch { /* 下一个 */ }
111
- }
112
- if (!abs) return fail(`File not found: ${raw}\nLooked in:\n${candidates.map(c => ` ${c}`).join('\n')}`);
113
-
114
- let doc;
115
- try { doc = JSON.parse(await fs.readFile(abs, 'utf8')); } catch (e) {
116
- return fail(`这个文件不是合法 JSON:${e.message}`);
117
- }
118
- const kind = detectKind(doc);
119
- if (!kind) {
120
- return fail('认不出这是酒馆的哪种导出(预设要有 prompts + prompt_order;角色卡要有 first_mes;世界书要有 entries)。普通 JSON 用 Read 就行。');
121
- }
122
-
123
- if (mode === 'fetch') {
124
- const 出 = fetchEntries(doc, entries);
125
- if (!出.length) return fail(`没找到这些条目:${entries.join(' / ')}。先用 mode="digest" 看名字。`);
126
- let 总 = 0;
127
- const 块 = [];
128
- for (const e of 出) {
129
- if (总 >= MAX_FETCH_CHARS) { 块.push(`〔余下 ${出.length - 块.length} 条超出单次上限,分批取〕`); break; }
130
- const 文 = e.正文.slice(0, MAX_FETCH_CHARS - 总);
131
- 总 += 文.length;
132
- 块.push(`### ${e.名字}${e.角色 ? ` [${e.角色}]` : ''}\n${文}`);
133
- }
134
- return { content: [{ type: 'text', text: 块.join('\n\n') }] };
135
- }
136
-
137
- return { content: [{ type: 'text', text: 渲染摘要(digest(doc), path.basename(abs)) }] };
138
- } catch (err) {
139
- return fail(`read_tavern_json failed: ${err?.message || String(err)}`);
140
- }
141
- },
142
- );
143
- }
1
+ /**
2
+ * mcp/tools/read-tavern-json.js — read_tavern_json MCP tool(2026-08-15)
3
+ *
4
+ * 搬酒馆的东西进来时的读取口。**不要用 Read 去读这类文件**:真样本
5
+ * (Izumi 0814.json)464KB、210 条提示词,启用的只有 56 条 —— Read 一次就是
6
+ * 十几万 token 进上下文,换来的绝大部分是停用的备选条目。
7
+ *
8
+ * 两步走:先 `摘要` 看结构(每条只给名字/角色/字数/一句引子),挑好了再
9
+ * `取` 正文。转成 编排.yaml 和设定文件是 agent 自己的活,这个工具只读不写。
10
+ */
11
+
12
+ import path from 'node:path';
13
+ import fs from 'node:fs/promises';
14
+ import { tool } from '@anthropic-ai/claude-agent-sdk';
15
+ import { z } from 'zod';
16
+ import { detectKind, digest, fetchEntries } from '../../../lib/tavern-json.js';
17
+
18
+ const MAX_FETCH_CHARS = 24_000;
19
+
20
+ function 渲染摘要(d, 文件名) {
21
+ const L = [];
22
+ if (d.形态 === 'preset') {
23
+ L.push(`酒馆 Chat Completion 预设:${文件名}`);
24
+ L.push(`启用 ${d.启用.length} 条(其中有正文的 ${d.启用.filter(e => e.字数 > 0).length} 条,合计 ${d.合计字数} 字)· 停用 ${d.停用.length} 条`);
25
+ const p = d.参数;
26
+ L.push(`参数:temperature ${p.temperature} · top_p ${p.top_p} · 最大输出 ${p.最大输出} · reasoning_effort ${p.reasoning_effort ?? '未设'}`);
27
+ L.push('');
28
+ L.push('启用条目(顺序 = 进模型顺序):');
29
+ for (const [i, e] of d.启用.entries()) {
30
+ const 标 = e.占位 ? '〔占位·酒馆运行时填,搬过来丢掉〕'
31
+ : e.分隔 ? '〔分节标题·无正文〕' : `${e.字数}字`;
32
+ L.push(`${String(i + 1).padStart(2)}. ${e.名字} [${e.角色}] ${标}${e.深度 != null ? ` 深度${e.深度}` : ''}`);
33
+ if (e.引子) L.push(` ${e.引子}…`);
34
+ }
35
+ if (d.停用.length) {
36
+ L.push('');
37
+ L.push(`停用的 ${d.停用.length} 条(同一功能的备选,酒馆里只开一个;名字列表):`);
38
+ L.push(d.停用.map(e => e.名字).join(' / '));
39
+ }
40
+ L.push('');
41
+ L.push('占位条目(marker,酒馆运行时填角色卡/历史,搬过来一律丢):' + (d.占位条目.join(' / ') || '无'));
42
+ L.push('分节标题(0 字,只是把开关分组,也不用搬):' + (d.分隔条目.join(' / ') || '无'));
43
+ } else if (d.形态 === 'card') {
44
+ L.push(`酒馆角色卡:${d.名字}(${文件名})`);
45
+ for (const f of d.字段) L.push(`- ${f.字段} ${f.字数}字 ${f.引子}…`);
46
+ if (d.开场白备选) L.push(`- alternate_greetings ${d.开场白备选} 条备选开场白`);
47
+ if (d.世界书.length) {
48
+ L.push('');
49
+ L.push(`内嵌世界书 ${d.世界书.length} 条:`);
50
+ for (const e of d.世界书) {
51
+ L.push(`- ${e.名字} ${e.常驻 ? '常驻' : `触发[${e.触发.join(' ')}]`} ${e.字数}字${e.停用 ? ' (停用)' : ''}`);
52
+ }
53
+ }
54
+ } else {
55
+ L.push(`酒馆世界书:${文件名},${d.条目.length} 条`);
56
+ for (const e of d.条目) {
57
+ L.push(`- ${e.名字} ${e.常驻 ? '常驻' : `触发[${e.触发.join(' ')}]`} ${e.字数}字${e.停用 ? ' (停用)' : ''}`);
58
+ if (e.引子) L.push(` ${e.引子}…`);
59
+ }
60
+ }
61
+ L.push('');
62
+ L.push('要正文就再调一次本工具:mode="fetch",entries=["名字或名字的一部分", …]。');
63
+ return L.join('\n');
64
+ }
65
+
66
+ export function makeReadTavernJsonTool({ workspaceRoot, sharedRoot }) {
67
+ return tool(
68
+ 'read_tavern_json',
69
+ `Read a SillyTavern (酒馆) export JSON — a chat-completion **preset**, a
70
+ **character card** (V2/V3), or a **lorebook** — without pouring the whole file
71
+ into your context.
72
+
73
+ Use this instead of Read for any 酒馆 JSON. A real preset in the wild is 460KB
74
+ with 210 prompt entries of which only 56 are enabled; Read would burn six digits
75
+ of tokens on disabled alternates.
76
+
77
+ Two steps:
78
+ 1. mode "digest" (default) — structure only: every entry's name, role, size and a
79
+ 60-char peek, plus which are enabled/disabled, plus sampler params.
80
+ 2. mode "fetch" with entries[] — full text of just the ones you picked (name,
81
+ partial name, or id). Capped at ${MAX_FETCH_CHARS} chars per call.
82
+
83
+ This tool only reads. Turning a preset into 编排.yaml + 设定 files is your job —
84
+ you decide the grouping, and you drop what does not belong (markers are filled by
85
+ 酒馆 at runtime and have no place here; platform-specific jailbreak sections are
86
+ pointless on this platform).`,
87
+ {
88
+ path: z.string().describe(
89
+ 'Path to the .json. Relative paths resolve against the session workspace, '
90
+ + 'then the shared project dir (e.g. "assets/Izumi 0814.json").',
91
+ ),
92
+ // ⚠️ 参数名和枚举值一律 ASCII —— 工具 schema 是模型要照着填的东西,
93
+ // 中文键名在这条路上不可靠(全仓其他工具也都是 ASCII,别开这个头)
94
+ mode: z.enum(['digest', 'fetch']).optional()
95
+ .describe('digest = structure only (default); fetch = full text of the picked entries'),
96
+ entries: z.array(z.string()).optional()
97
+ .describe('For mode="fetch": entry names (partial match ok) or ids'),
98
+ },
99
+ async ({ path: rel, mode = 'digest', entries = [] }) => {
100
+ const fail = (text) => ({ content: [{ type: 'text', text }], isError: true });
101
+ try {
102
+ const raw = String(rel || '').trim();
103
+ if (!raw) return fail('read_tavern_json needs a path.');
104
+ const candidates = path.isAbsolute(raw)
105
+ ? [raw]
106
+ : [workspaceRoot && path.resolve(workspaceRoot, raw),
107
+ sharedRoot && path.resolve(sharedRoot, raw)].filter(Boolean);
108
+ let abs = null;
109
+ for (const c of candidates) {
110
+ try { await fs.access(c); abs = c; break; } catch { /* 下一个 */ }
111
+ }
112
+ if (!abs) return fail(`File not found: ${raw}\nLooked in:\n${candidates.map(c => ` ${c}`).join('\n')}`);
113
+
114
+ let doc;
115
+ try { doc = JSON.parse(await fs.readFile(abs, 'utf8')); } catch (e) {
116
+ return fail(`这个文件不是合法 JSON:${e.message}`);
117
+ }
118
+ const kind = detectKind(doc);
119
+ if (!kind) {
120
+ return fail('认不出这是酒馆的哪种导出(预设要有 prompts + prompt_order;角色卡要有 first_mes;世界书要有 entries)。普通 JSON 用 Read 就行。');
121
+ }
122
+
123
+ if (mode === 'fetch') {
124
+ const 出 = fetchEntries(doc, entries);
125
+ if (!出.length) return fail(`没找到这些条目:${entries.join(' / ')}。先用 mode="digest" 看名字。`);
126
+ let 总 = 0;
127
+ const 块 = [];
128
+ for (const e of 出) {
129
+ if (总 >= MAX_FETCH_CHARS) { 块.push(`〔余下 ${出.length - 块.length} 条超出单次上限,分批取〕`); break; }
130
+ const 文 = e.正文.slice(0, MAX_FETCH_CHARS - 总);
131
+ 总 += 文.length;
132
+ 块.push(`### ${e.名字}${e.角色 ? ` [${e.角色}]` : ''}\n${文}`);
133
+ }
134
+ return { content: [{ type: 'text', text: 块.join('\n\n') }] };
135
+ }
136
+
137
+ return { content: [{ type: 'text', text: 渲染摘要(digest(doc), path.basename(abs)) }] };
138
+ } catch (err) {
139
+ return fail(`read_tavern_json failed: ${err?.message || String(err)}`);
140
+ }
141
+ },
142
+ );
143
+ }
@@ -1,140 +1,140 @@
1
- /**
2
- * mcp/tools/record-decision.js — record_decision MCP tool
3
- *
4
- * agent 在做关键设计决策时调,把"做了什么 + 为什么"写成共享便利贴
5
- * `notes/决策.md` 的一面(`---` 分面)。2026-07-30 起决策
6
- * 不再进 spec.json.decisions[]:便利贴是 agent 和用户的**共享层**——
7
- * 用户在画布上直接看到、能翻、能改;spec.json 只是 agent 自己的暗档案,
8
- * 用户看不见,头脑风暴根本进不来。旧会话已有的 spec.json decisions[]
9
- * 仍被 hooks 注入(只读遗产),新决策一律走这里。
10
- *
11
- * 便利贴格式约定(前端 NoteSticker 按此渲染):
12
- * - 一个 .md = 一张贴;`\n---\n` 分面,翻页看
13
- * - 每面第一行 `# 标题`
14
- *
15
- * 落点:工作区 `notes/`(扁平模型,2026-08-08 起)—— 没有"任务归属"了,
16
- * 便利贴直接住项目桌面。
17
- */
18
-
19
- import { tool } from '@anthropic-ai/claude-agent-sdk';
20
- import { z } from 'zod';
21
- import { promises as fs } from 'node:fs';
22
- import path from 'node:path';
23
- import { Events } from '../../agent/events.js';
24
-
25
- const NOTE_FILE = '决策.md';
26
-
27
- /**
28
- * @param {object} deps
29
- * @param {string} deps.workspaceRoot
30
- * @param {string} [deps.sessionId]
31
- * @param {import('../../agent/context.js').AgentContext} [deps.ctx]
32
- */
33
- export function makeRecordDecisionTool({ workspaceRoot, sessionId, ctx }) {
34
- return tool(
35
- 'record_decision',
36
- `Record a key design decision as a face of the project's decision sticky note
37
- (notes/决策.md). The note is SHARED with the user — it renders as
38
- a flippable sticky on their canvas, they can read and edit it. Use this to
39
- capture WHY you made a particular choice — color, type scale, layout metaphor,
40
- copy strategy — so the intent survives across sessions and the user can push
41
- back on it.
42
-
43
- Use this tool when:
44
- - You make a non-trivial choice that has multiple defensible alternatives
45
- (e.g., picking a primary color, deciding deck length, choosing a layout)
46
- - The user gives feedback that changes a previous decision (record both)
47
- - You want to document a constraint discovered mid-work
48
-
49
- Do NOT use this tool for:
50
- - Trivial implementation details (CSS class names, file structure)
51
- - Things obvious from the canvas itself (the visible design speaks for itself)
52
- - Every change — over-recording bloats the note and dilutes signal
53
-
54
- For free-form shared notes (brainstorm material, reference digests, handoff
55
- context), just Write notes/<slug>.md directly — same sticky-note
56
- rendering, no tool needed.`,
57
- {
58
- title: z
59
- .string()
60
- .min(2)
61
- .max(200)
62
- .describe('Short decision title (e.g., "Primary color = #3366FF")'),
63
- rationale: z
64
- .string()
65
- .min(2)
66
- .max(2000)
67
- .describe('Why this choice — connect to brief / user feedback / design principle'),
68
- scope: z
69
- .string()
70
- .optional()
71
- .describe('Where it applies (e.g., "Global", "Cover page", "All H1 headings")'),
72
- alternatives: z
73
- .array(z.string())
74
- .optional()
75
- .describe('Alternatives considered, briefly noting why rejected'),
76
- },
77
- async ({ title, rationale, scope, alternatives }) => {
78
- try {
79
- if (!workspaceRoot) {
80
- return {
81
- content: [{ type: 'text', text: 'No workspace bound; cannot record decision.' }],
82
- isError: true,
83
- };
84
- }
85
- const alts = Array.isArray(alternatives)
86
- ? alternatives.map(s => String(s).trim()).filter(Boolean) : [];
87
- const face = [
88
- `# ${title.trim()}`,
89
- '',
90
- rationale.trim(),
91
- ...(scope ? ['', `- 范围:${scope.trim()}`] : []),
92
- ...(alts.length ? [`- 备选:${alts.join(' / ')}`] : []),
93
- `- ${new Date().toISOString().slice(0, 10)}`,
94
- ].join('\n');
95
-
96
- const notesDir = path.join(workspaceRoot, 'notes');
97
- await fs.mkdir(notesDir, { recursive: true });
98
- const noteFile = path.join(notesDir, NOTE_FILE);
99
- let prev = '';
100
- try { prev = await fs.readFile(noteFile, 'utf8'); } catch { /* 首条 */ }
101
- const next = prev.trim() ? `${prev.replace(/\s+$/, '')}\n\n---\n\n${face}\n` : `${face}\n`;
102
- await fs.writeFile(noteFile, next, 'utf8');
103
-
104
- const faceCount = next.split(/\n---\n/).length;
105
- try {
106
- // MCP 工具写盘不走 PostToolUse(Write/Edit) 那条 file_changed 直发,
107
- // 自己补一发,前端便利贴才会当场刷新
108
- // 工作区相对路径(fileChanged 正字法;曾发绝对路径=前端只吃到清单重拉,
109
- // 寻址和版本 key 全失配。2026-08-14 普查改)
110
- ctx?.emit?.(Events.fileChanged(`notes/${NOTE_FILE}`, 'change'));
111
- ctx?.emit?.({
112
- type: 'run.decision_recorded',
113
- title: title.trim(),
114
- scope: scope?.trim() || null,
115
- decisionsCount: faceCount,
116
- });
117
- } catch { /* emit fail-safe */ }
118
-
119
- return {
120
- content: [{
121
- type: 'text',
122
- // ⚠️ 这里曾写 `tasks/${task}/...` —— 扁平化删掉 task 变量时漏了这行,
123
- // `task` 成悬空引用:决策照写、事件照发,**返回时 ReferenceError 被
124
- // 外层 catch 接住**,agent 每次调用都收到报错以为失败(还可能重试出
125
- // 重复面)。悬空引用潜伏族第二案(第一案 reloadToken,2026-08-08)。
126
- text: `Decision recorded as face ${faceCount} of notes/${NOTE_FILE}: "${title.trim()}"`,
127
- }],
128
- };
129
- } catch (err) {
130
- return {
131
- content: [{
132
- type: 'text',
133
- text: `Record decision failed: ${err?.message || String(err)}`,
134
- }],
135
- isError: true,
136
- };
137
- }
138
- },
139
- );
140
- }
1
+ /**
2
+ * mcp/tools/record-decision.js — record_decision MCP tool
3
+ *
4
+ * agent 在做关键设计决策时调,把"做了什么 + 为什么"写成共享便利贴
5
+ * `notes/决策.md` 的一面(`---` 分面)。2026-07-30 起决策
6
+ * 不再进 spec.json.decisions[]:便利贴是 agent 和用户的**共享层**——
7
+ * 用户在画布上直接看到、能翻、能改;spec.json 只是 agent 自己的暗档案,
8
+ * 用户看不见,头脑风暴根本进不来。旧会话已有的 spec.json decisions[]
9
+ * 仍被 hooks 注入(只读遗产),新决策一律走这里。
10
+ *
11
+ * 便利贴格式约定(前端 NoteSticker 按此渲染):
12
+ * - 一个 .md = 一张贴;`\n---\n` 分面,翻页看
13
+ * - 每面第一行 `# 标题`
14
+ *
15
+ * 落点:工作区 `notes/`(扁平模型,2026-08-08 起)—— 没有"任务归属"了,
16
+ * 便利贴直接住项目桌面。
17
+ */
18
+
19
+ import { tool } from '@anthropic-ai/claude-agent-sdk';
20
+ import { z } from 'zod';
21
+ import { promises as fs } from 'node:fs';
22
+ import path from 'node:path';
23
+ import { Events } from '../../agent/events.js';
24
+
25
+ const NOTE_FILE = '决策.md';
26
+
27
+ /**
28
+ * @param {object} deps
29
+ * @param {string} deps.workspaceRoot
30
+ * @param {string} [deps.sessionId]
31
+ * @param {import('../../agent/context.js').AgentContext} [deps.ctx]
32
+ */
33
+ export function makeRecordDecisionTool({ workspaceRoot, sessionId, ctx }) {
34
+ return tool(
35
+ 'record_decision',
36
+ `Record a key design decision as a face of the project's decision sticky note
37
+ (notes/决策.md). The note is SHARED with the user — it renders as
38
+ a flippable sticky on their canvas, they can read and edit it. Use this to
39
+ capture WHY you made a particular choice — color, type scale, layout metaphor,
40
+ copy strategy — so the intent survives across sessions and the user can push
41
+ back on it.
42
+
43
+ Use this tool when:
44
+ - You make a non-trivial choice that has multiple defensible alternatives
45
+ (e.g., picking a primary color, deciding deck length, choosing a layout)
46
+ - The user gives feedback that changes a previous decision (record both)
47
+ - You want to document a constraint discovered mid-work
48
+
49
+ Do NOT use this tool for:
50
+ - Trivial implementation details (CSS class names, file structure)
51
+ - Things obvious from the canvas itself (the visible design speaks for itself)
52
+ - Every change — over-recording bloats the note and dilutes signal
53
+
54
+ For free-form shared notes (brainstorm material, reference digests, handoff
55
+ context), just Write notes/<slug>.md directly — same sticky-note
56
+ rendering, no tool needed.`,
57
+ {
58
+ title: z
59
+ .string()
60
+ .min(2)
61
+ .max(200)
62
+ .describe('Short decision title (e.g., "Primary color = #3366FF")'),
63
+ rationale: z
64
+ .string()
65
+ .min(2)
66
+ .max(2000)
67
+ .describe('Why this choice — connect to brief / user feedback / design principle'),
68
+ scope: z
69
+ .string()
70
+ .optional()
71
+ .describe('Where it applies (e.g., "Global", "Cover page", "All H1 headings")'),
72
+ alternatives: z
73
+ .array(z.string())
74
+ .optional()
75
+ .describe('Alternatives considered, briefly noting why rejected'),
76
+ },
77
+ async ({ title, rationale, scope, alternatives }) => {
78
+ try {
79
+ if (!workspaceRoot) {
80
+ return {
81
+ content: [{ type: 'text', text: 'No workspace bound; cannot record decision.' }],
82
+ isError: true,
83
+ };
84
+ }
85
+ const alts = Array.isArray(alternatives)
86
+ ? alternatives.map(s => String(s).trim()).filter(Boolean) : [];
87
+ const face = [
88
+ `# ${title.trim()}`,
89
+ '',
90
+ rationale.trim(),
91
+ ...(scope ? ['', `- 范围:${scope.trim()}`] : []),
92
+ ...(alts.length ? [`- 备选:${alts.join(' / ')}`] : []),
93
+ `- ${new Date().toISOString().slice(0, 10)}`,
94
+ ].join('\n');
95
+
96
+ const notesDir = path.join(workspaceRoot, 'notes');
97
+ await fs.mkdir(notesDir, { recursive: true });
98
+ const noteFile = path.join(notesDir, NOTE_FILE);
99
+ let prev = '';
100
+ try { prev = await fs.readFile(noteFile, 'utf8'); } catch { /* 首条 */ }
101
+ const next = prev.trim() ? `${prev.replace(/\s+$/, '')}\n\n---\n\n${face}\n` : `${face}\n`;
102
+ await fs.writeFile(noteFile, next, 'utf8');
103
+
104
+ const faceCount = next.split(/\n---\n/).length;
105
+ try {
106
+ // MCP 工具写盘不走 PostToolUse(Write/Edit) 那条 file_changed 直发,
107
+ // 自己补一发,前端便利贴才会当场刷新
108
+ // 工作区相对路径(fileChanged 正字法;曾发绝对路径=前端只吃到清单重拉,
109
+ // 寻址和版本 key 全失配。2026-08-14 普查改)
110
+ ctx?.emit?.(Events.fileChanged(`notes/${NOTE_FILE}`, 'change'));
111
+ ctx?.emit?.({
112
+ type: 'run.decision_recorded',
113
+ title: title.trim(),
114
+ scope: scope?.trim() || null,
115
+ decisionsCount: faceCount,
116
+ });
117
+ } catch { /* emit fail-safe */ }
118
+
119
+ return {
120
+ content: [{
121
+ type: 'text',
122
+ // ⚠️ 这里曾写 `tasks/${task}/...` —— 扁平化删掉 task 变量时漏了这行,
123
+ // `task` 成悬空引用:决策照写、事件照发,**返回时 ReferenceError 被
124
+ // 外层 catch 接住**,agent 每次调用都收到报错以为失败(还可能重试出
125
+ // 重复面)。悬空引用潜伏族第二案(第一案 reloadToken,2026-08-08)。
126
+ text: `Decision recorded as face ${faceCount} of notes/${NOTE_FILE}: "${title.trim()}"`,
127
+ }],
128
+ };
129
+ } catch (err) {
130
+ return {
131
+ content: [{
132
+ type: 'text',
133
+ text: `Record decision failed: ${err?.message || String(err)}`,
134
+ }],
135
+ isError: true,
136
+ };
137
+ }
138
+ },
139
+ );
140
+ }