@playcraft/common 0.0.4 → 0.0.7
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/dist/auth/jwt.test.d.ts +2 -0
- package/dist/auth/jwt.test.d.ts.map +1 -0
- package/dist/auth/jwt.test.js +13 -0
- package/dist/auth/jwt.test.js.map +1 -0
- package/dist/auth/signature.spec.d.ts +2 -0
- package/dist/auth/signature.spec.d.ts.map +1 -0
- package/dist/auth/signature.spec.js +195 -0
- package/dist/auth/signature.spec.js.map +1 -0
- package/dist/database/schema.d.ts +19 -0
- package/dist/database/schema.d.ts.map +1 -1
- package/dist/database/schema.js +1 -0
- package/dist/database/schema.js.map +1 -1
- package/dist/mcp/tools.d.ts +2 -2
- package/dist/mcp/tools.d.ts.map +1 -1
- package/dist/mcp/tools.js +573 -61
- package/dist/mcp/tools.js.map +1 -1
- package/dist/messenger/server.test.d.ts +2 -0
- package/dist/messenger/server.test.d.ts.map +1 -0
- package/dist/messenger/server.test.js +66 -0
- package/dist/messenger/server.test.js.map +1 -0
- package/dist/models/converters.d.ts +11 -0
- package/dist/models/converters.d.ts.map +1 -0
- package/dist/models/converters.js +25 -0
- package/dist/models/converters.js.map +1 -0
- package/dist/models/converters.test.d.ts +2 -0
- package/dist/models/converters.test.d.ts.map +1 -0
- package/dist/models/converters.test.js +18 -0
- package/dist/models/converters.test.js.map +1 -0
- package/dist/models/playcanvas-compat.d.ts +1 -0
- package/dist/models/playcanvas-compat.d.ts.map +1 -1
- package/dist/models/playcanvas-compat.js +1 -0
- package/dist/models/playcanvas-compat.js.map +1 -1
- package/dist/models/scene.d.ts +10 -1
- package/dist/models/scene.d.ts.map +1 -1
- package/dist/models/scene.js +10 -1
- package/dist/models/scene.js.map +1 -1
- package/dist/models/scene.test.d.ts +2 -0
- package/dist/models/scene.test.d.ts.map +1 -0
- package/dist/models/scene.test.js +12 -0
- package/dist/models/scene.test.js.map +1 -0
- package/dist/sharedb/server.d.ts +21 -3
- package/dist/sharedb/server.d.ts.map +1 -1
- package/dist/sharedb/server.js +273 -91
- package/dist/sharedb/server.js.map +1 -1
- package/dist/sharedb/server.test.d.ts +2 -0
- package/dist/sharedb/server.test.d.ts.map +1 -0
- package/dist/sharedb/server.test.js +59 -0
- package/dist/sharedb/server.test.js.map +1 -0
- package/dist/storage/cos.d.ts +6 -6
- package/dist/storage/cos.d.ts.map +1 -1
- package/dist/storage/cos.js +70 -80
- package/dist/storage/cos.js.map +1 -1
- package/dist/storage/index.d.ts +1 -0
- package/dist/storage/index.d.ts.map +1 -1
- package/dist/storage/index.js +2 -0
- package/dist/storage/index.js.map +1 -1
- package/dist/storage/interface.d.ts +1 -0
- package/dist/storage/interface.d.ts.map +1 -1
- package/dist/storage/upload-build-artifacts.d.ts +38 -0
- package/dist/storage/upload-build-artifacts.d.ts.map +1 -0
- package/dist/storage/upload-build-artifacts.js +60 -0
- package/dist/storage/upload-build-artifacts.js.map +1 -0
- package/package.json +3 -2
package/dist/mcp/tools.js
CHANGED
|
@@ -98,82 +98,594 @@ export const MCP_TOOL_NAMES = [
|
|
|
98
98
|
]),
|
|
99
99
|
];
|
|
100
100
|
/**
|
|
101
|
-
*
|
|
102
|
-
*
|
|
101
|
+
* Full tool definitions for MCP tools/list with inputSchema.
|
|
102
|
+
* Schema definitions match editor test_mcp tool implementations.
|
|
103
103
|
*/
|
|
104
104
|
export const MCP_TOOL_DEFINITIONS = [
|
|
105
105
|
// Entity
|
|
106
|
-
{
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
106
|
+
{
|
|
107
|
+
name: 'pc_list_entities',
|
|
108
|
+
description: '列出场景中PlayCanvas实体的层级结构。⚠️ 建议:尽可能传入parentId以减少返回数据量,节省Token开销',
|
|
109
|
+
inputSchema: {
|
|
110
|
+
type: 'object',
|
|
111
|
+
properties: {
|
|
112
|
+
parentId: { type: 'string', description: '父实体ID(resource_id格式)。强烈建议指定此参数,仅返回该实体及其子实体,避免返回整个场景树(数据量大)' }
|
|
113
|
+
},
|
|
114
|
+
required: []
|
|
115
|
+
}
|
|
116
|
+
},
|
|
117
|
+
{
|
|
118
|
+
name: 'pc_create_entity',
|
|
119
|
+
description: '在PlayCanvas编辑器中创建新实体。注意:parent参数指定父实体ID,如果不指定则创建在根节点下。⚠️ 重要:Element组件的color属性必须是RGB格式(3个值如[1,1,1]),透明度使用单独的opacity属性,不要使用RGBA格式(4个值)!',
|
|
120
|
+
inputSchema: {
|
|
121
|
+
type: 'object',
|
|
122
|
+
properties: {
|
|
123
|
+
name: { type: 'string', description: '实体名称' },
|
|
124
|
+
parent: { type: 'string', description: '父实体ID(resource_id格式,如"0e00c15e-5605-4a14-80e9-6c22c24f57a2")。不填则创建在根节点下' },
|
|
125
|
+
components: { type: 'object', description: '组件配置对象。格式: {"组件类型": {组件属性}}' },
|
|
126
|
+
tags: { type: 'array', items: { type: 'string' }, description: '标签列表' },
|
|
127
|
+
enabled: { type: 'boolean', description: '是否启用,默认true' },
|
|
128
|
+
position: { type: 'array', items: { type: 'number' }, description: '位置 [x, y, z]' }
|
|
129
|
+
},
|
|
130
|
+
required: []
|
|
131
|
+
}
|
|
132
|
+
},
|
|
133
|
+
{
|
|
134
|
+
name: 'pc_get_entity',
|
|
135
|
+
description: '获取PlayCanvas实体信息',
|
|
136
|
+
inputSchema: {
|
|
137
|
+
type: 'object',
|
|
138
|
+
properties: {
|
|
139
|
+
entityId: { type: 'string', description: '实体ID(resource_id格式)' }
|
|
140
|
+
},
|
|
141
|
+
required: ['entityId']
|
|
142
|
+
}
|
|
143
|
+
},
|
|
144
|
+
{
|
|
145
|
+
name: 'pc_update_entity',
|
|
146
|
+
description: '更新PlayCanvas实体的属性。可更新name、enabled、tags、position、rotation、scale和components。⚠️ 重要:Element组件的color属性必须是RGB格式(3个值如[1,1,1]),透明度使用单独的opacity属性!',
|
|
147
|
+
inputSchema: {
|
|
148
|
+
type: 'object',
|
|
149
|
+
properties: {
|
|
150
|
+
entityId: { type: 'string', description: '实体ID(resource_id格式)' },
|
|
151
|
+
name: { type: 'string', description: '实体名称' },
|
|
152
|
+
enabled: { type: 'boolean', description: '是否启用' },
|
|
153
|
+
tags: { type: 'array', items: { type: 'string' }, description: '标签列表' },
|
|
154
|
+
position: { type: 'array', items: { type: 'number' }, description: '位置 [x, y, z]' },
|
|
155
|
+
rotation: { type: 'array', items: { type: 'number' }, description: '旋转角度 [x, y, z](单位:度)' },
|
|
156
|
+
scale: { type: 'array', items: { type: 'number' }, description: '缩放 [x, y, z]' },
|
|
157
|
+
components: { type: 'object', description: '组件配置' }
|
|
158
|
+
},
|
|
159
|
+
required: ['entityId']
|
|
160
|
+
}
|
|
161
|
+
},
|
|
162
|
+
{
|
|
163
|
+
name: 'pc_delete_entity',
|
|
164
|
+
description: '删除PlayCanvas实体。会同时删除所有子实体',
|
|
165
|
+
inputSchema: {
|
|
166
|
+
type: 'object',
|
|
167
|
+
properties: {
|
|
168
|
+
entityId: { type: 'string', description: '实体ID(resource_id格式)' }
|
|
169
|
+
},
|
|
170
|
+
required: ['entityId']
|
|
171
|
+
}
|
|
172
|
+
},
|
|
173
|
+
{
|
|
174
|
+
name: 'pc_duplicate_entities',
|
|
175
|
+
description: '复制一个或多个实体。复制的实体会放在原实体的同级位置',
|
|
176
|
+
inputSchema: {
|
|
177
|
+
type: 'object',
|
|
178
|
+
properties: {
|
|
179
|
+
entityIds: { type: 'array', items: { type: 'string' }, description: '要复制的实体ID列表(resource_id格式)' }
|
|
180
|
+
},
|
|
181
|
+
required: ['entityIds']
|
|
182
|
+
}
|
|
183
|
+
},
|
|
184
|
+
{
|
|
185
|
+
name: 'pc_reparent_entity',
|
|
186
|
+
description: '重新设置实体的父子关系。可将实体移动到其他父实体下或移到根节点',
|
|
187
|
+
inputSchema: {
|
|
188
|
+
type: 'object',
|
|
189
|
+
properties: {
|
|
190
|
+
entityId: { type: 'string', description: '要移动的实体ID(resource_id格式)' },
|
|
191
|
+
newParentId: { type: 'string', description: '新父实体ID(resource_id格式)。不填或为null则移到根节点' },
|
|
192
|
+
index: { type: 'number', description: '在父实体子节点中的索引位置(可选),从0开始' }
|
|
193
|
+
},
|
|
194
|
+
required: ['entityId']
|
|
195
|
+
}
|
|
196
|
+
},
|
|
197
|
+
{
|
|
198
|
+
name: 'pc_add_components',
|
|
199
|
+
description: '为实体添加组件。注意:components参数是一个对象,key是组件类型名,value是组件配置。⚠️ 重要:Element组件的color属性必须是RGB格式(3个值如[1,1,1]),透明度使用单独的opacity属性,不要使用RGBA格式(4个值)!',
|
|
200
|
+
inputSchema: {
|
|
201
|
+
type: 'object',
|
|
202
|
+
properties: {
|
|
203
|
+
entityId: { type: 'string', description: '实体ID(resource_id格式)' },
|
|
204
|
+
components: { type: 'object', description: '组件配置对象' }
|
|
205
|
+
},
|
|
206
|
+
required: ['entityId', 'components']
|
|
207
|
+
}
|
|
208
|
+
},
|
|
209
|
+
{
|
|
210
|
+
name: 'pc_remove_components',
|
|
211
|
+
description: '从实体移除组件',
|
|
212
|
+
inputSchema: {
|
|
213
|
+
type: 'object',
|
|
214
|
+
properties: {
|
|
215
|
+
entityId: { type: 'string', description: '实体ID(resource_id格式)' },
|
|
216
|
+
componentTypes: { type: 'array', items: { type: 'string' }, description: '要移除的组件类型列表,如 ["light", "camera", "script"]' }
|
|
217
|
+
},
|
|
218
|
+
required: ['entityId', 'componentTypes']
|
|
219
|
+
}
|
|
220
|
+
},
|
|
115
221
|
// Asset
|
|
116
|
-
{
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
222
|
+
{
|
|
223
|
+
name: 'pc_list_assets',
|
|
224
|
+
description: '列出项目中PlayCanvas资源。⚠️ 建议:尽可能传入folderPath以减少返回数据量,节省Token开销',
|
|
225
|
+
inputSchema: {
|
|
226
|
+
type: 'object',
|
|
227
|
+
properties: {
|
|
228
|
+
folderPath: { type: 'string', description: '文件夹路径,如"/Generated"。强烈建议指定此参数,仅列出该目录下的资源,避免返回整个项目资源(数据量大)' }
|
|
229
|
+
},
|
|
230
|
+
required: []
|
|
231
|
+
}
|
|
232
|
+
},
|
|
233
|
+
{
|
|
234
|
+
name: 'pc_get_asset',
|
|
235
|
+
description: '获取PlayCanvas资源的详细信息,包括类型、路径、元数据等',
|
|
236
|
+
inputSchema: {
|
|
237
|
+
type: 'object',
|
|
238
|
+
properties: {
|
|
239
|
+
assetId: { type: 'string', description: '资源ID(数字ID)' }
|
|
240
|
+
},
|
|
241
|
+
required: ['assetId']
|
|
242
|
+
}
|
|
243
|
+
},
|
|
244
|
+
{
|
|
245
|
+
name: 'pc_upload_asset',
|
|
246
|
+
description: '上传资源文件到PlayCanvas编辑器。支持图片、模型、音频等文件类型',
|
|
247
|
+
inputSchema: {
|
|
248
|
+
type: 'object',
|
|
249
|
+
properties: {
|
|
250
|
+
name: { type: 'string', description: '资源名称(建议包含扩展名)' },
|
|
251
|
+
type: { type: 'string', description: '资源类型: texture, model, audio, binary等' },
|
|
252
|
+
file: { type: 'string', description: '文件数据(Base64编码或文件路径)' },
|
|
253
|
+
folder: { type: 'string', description: '目标文件夹ID或路径' },
|
|
254
|
+
folderPath: { type: 'string', description: '目标文件夹路径,如"/Generated/Texture"(推荐使用)' },
|
|
255
|
+
tags: { type: 'array', items: { type: 'string' }, description: '标签列表' }
|
|
256
|
+
},
|
|
257
|
+
required: ['name', 'type', 'file']
|
|
258
|
+
}
|
|
259
|
+
},
|
|
260
|
+
{
|
|
261
|
+
name: 'pc_delete_asset',
|
|
262
|
+
description: '删除PlayCanvas资源。删除后无法恢复',
|
|
263
|
+
inputSchema: {
|
|
264
|
+
type: 'object',
|
|
265
|
+
properties: {
|
|
266
|
+
assetId: { type: 'string', description: '资源ID(数字ID)' }
|
|
267
|
+
},
|
|
268
|
+
required: ['assetId']
|
|
269
|
+
}
|
|
270
|
+
},
|
|
271
|
+
{
|
|
272
|
+
name: 'pc_create_asset',
|
|
273
|
+
description: '创建资源(材质、纹理、JSON等)。支持通过路径或ID指定目标文件夹,推荐使用folderPath',
|
|
274
|
+
inputSchema: {
|
|
275
|
+
type: 'object',
|
|
276
|
+
properties: {
|
|
277
|
+
type: { type: 'string', description: '资源类型: material, texture, cubemap, json, text, html, css, shader等' },
|
|
278
|
+
name: { type: 'string', description: '资源名称(建议包含扩展名,如"config.json")' },
|
|
279
|
+
data: { type: 'object', description: '资源数据配置。对于json类型,此对象直接作为JSON内容' },
|
|
280
|
+
folder: { type: 'string', description: '目标文件夹ID或路径' },
|
|
281
|
+
folderPath: { type: 'string', description: '目标文件夹路径,如"/Generated/GameConfig"(推荐使用)' }
|
|
282
|
+
},
|
|
283
|
+
required: ['type', 'name']
|
|
284
|
+
}
|
|
285
|
+
},
|
|
286
|
+
{
|
|
287
|
+
name: 'pc_find_assets',
|
|
288
|
+
description: '按名称和/或类型查找资产,返回所有匹配的资产列表(含完整路径)。支持模糊匹配',
|
|
289
|
+
inputSchema: {
|
|
290
|
+
type: 'object',
|
|
291
|
+
properties: {
|
|
292
|
+
name: { type: 'string', description: '资产名称(可选)。支持模糊匹配' },
|
|
293
|
+
type: { type: 'string', description: '资产类型(可选): script, folder, material, texture, template, json等' },
|
|
294
|
+
fuzzy: { type: 'boolean', description: '是否启用模糊匹配(默认true)' }
|
|
295
|
+
},
|
|
296
|
+
required: []
|
|
297
|
+
}
|
|
298
|
+
},
|
|
299
|
+
{
|
|
300
|
+
name: 'pc_create_folder',
|
|
301
|
+
description: '创建文件夹资源。支持通过路径或ID指定父文件夹,推荐使用parentPath',
|
|
302
|
+
inputSchema: {
|
|
303
|
+
type: 'object',
|
|
304
|
+
properties: {
|
|
305
|
+
name: { type: 'string', description: '文件夹名称' },
|
|
306
|
+
parent: { type: 'string', description: '父文件夹ID或路径' },
|
|
307
|
+
parentPath: { type: 'string', description: '父文件夹路径,如"/Generated"(推荐使用)' }
|
|
308
|
+
},
|
|
309
|
+
required: ['name']
|
|
310
|
+
}
|
|
311
|
+
},
|
|
312
|
+
{
|
|
313
|
+
name: 'pc_get_selection',
|
|
314
|
+
description: '获取用户在PlayCanvas编辑器中当前选中的资产或实体',
|
|
315
|
+
inputSchema: {
|
|
316
|
+
type: 'object',
|
|
317
|
+
properties: {},
|
|
318
|
+
required: []
|
|
319
|
+
}
|
|
320
|
+
},
|
|
124
321
|
// Script
|
|
125
|
-
{
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
322
|
+
{
|
|
323
|
+
name: 'pc_create_script',
|
|
324
|
+
description: '创建PlayCanvas脚本资源。脚本内容应包含ESM格式的类定义,且必须包含static scriptName属性。⚠️ 重要:仅允许.mjs扩展名',
|
|
325
|
+
inputSchema: {
|
|
326
|
+
type: 'object',
|
|
327
|
+
properties: {
|
|
328
|
+
name: { type: 'string', description: '脚本文件名(必须以.mjs结尾)' },
|
|
329
|
+
content: { type: 'string', description: '脚本内容(JavaScript/ESM代码)' },
|
|
330
|
+
folder: { type: 'string', description: '目标文件夹ID或路径' },
|
|
331
|
+
folderPath: { type: 'string', description: '目标文件夹路径' }
|
|
332
|
+
},
|
|
333
|
+
required: ['name', 'content']
|
|
334
|
+
}
|
|
335
|
+
},
|
|
336
|
+
{
|
|
337
|
+
name: 'pc_add_script_to_entity',
|
|
338
|
+
description: '将脚本添加到实体的script组件。如果实体没有script组件会自动创建',
|
|
339
|
+
inputSchema: {
|
|
340
|
+
type: 'object',
|
|
341
|
+
properties: {
|
|
342
|
+
entityId: { type: 'string', description: '实体ID(resource_id格式)' },
|
|
343
|
+
scriptName: { type: 'string', description: '脚本名称(小驼峰格式)' },
|
|
344
|
+
assetId: { type: 'string', description: '脚本资源ID(可选)' }
|
|
345
|
+
},
|
|
346
|
+
required: ['entityId', 'scriptName']
|
|
347
|
+
}
|
|
348
|
+
},
|
|
349
|
+
{
|
|
350
|
+
name: 'pc_set_script_text',
|
|
351
|
+
description: '设置/更新脚本内容。会自动触发脚本解析',
|
|
352
|
+
inputSchema: {
|
|
353
|
+
type: 'object',
|
|
354
|
+
properties: {
|
|
355
|
+
assetId: { type: 'string', description: '脚本资源ID(数字ID)' },
|
|
356
|
+
content: { type: 'string', description: '新的脚本内容' }
|
|
357
|
+
},
|
|
358
|
+
required: ['assetId', 'content']
|
|
359
|
+
}
|
|
360
|
+
},
|
|
361
|
+
{
|
|
362
|
+
name: 'pc_get_script_text',
|
|
363
|
+
description: '获取脚本的源代码内容',
|
|
364
|
+
inputSchema: {
|
|
365
|
+
type: 'object',
|
|
366
|
+
properties: {
|
|
367
|
+
assetId: { type: 'string', description: '脚本资源ID(数字ID)' }
|
|
368
|
+
},
|
|
369
|
+
required: ['assetId']
|
|
370
|
+
}
|
|
371
|
+
},
|
|
372
|
+
{
|
|
373
|
+
name: 'pc_script_parse',
|
|
374
|
+
description: '手动解析脚本,使runtime识别脚本中的属性和方法',
|
|
375
|
+
inputSchema: {
|
|
376
|
+
type: 'object',
|
|
377
|
+
properties: {
|
|
378
|
+
assetId: { type: 'string', description: '脚本资源ID(数字ID)' }
|
|
379
|
+
},
|
|
380
|
+
required: ['assetId']
|
|
381
|
+
}
|
|
382
|
+
},
|
|
130
383
|
// Content
|
|
131
|
-
{
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
384
|
+
{
|
|
385
|
+
name: 'pc_set_json_content',
|
|
386
|
+
description: '设置JSON资源的内容',
|
|
387
|
+
inputSchema: {
|
|
388
|
+
type: 'object',
|
|
389
|
+
properties: {
|
|
390
|
+
assetId: { type: 'string', description: 'JSON资源ID(数字ID)' },
|
|
391
|
+
content: { type: 'object', description: 'JSON内容' }
|
|
392
|
+
},
|
|
393
|
+
required: ['assetId', 'content']
|
|
394
|
+
}
|
|
395
|
+
},
|
|
396
|
+
{
|
|
397
|
+
name: 'pc_get_json_content',
|
|
398
|
+
description: '获取JSON资源的内容',
|
|
399
|
+
inputSchema: {
|
|
400
|
+
type: 'object',
|
|
401
|
+
properties: {
|
|
402
|
+
assetId: { type: 'string', description: 'JSON资源ID(数字ID)' }
|
|
403
|
+
},
|
|
404
|
+
required: ['assetId']
|
|
405
|
+
}
|
|
406
|
+
},
|
|
407
|
+
{
|
|
408
|
+
name: 'pc_set_text_content',
|
|
409
|
+
description: '设置Text类资源的内容',
|
|
410
|
+
inputSchema: {
|
|
411
|
+
type: 'object',
|
|
412
|
+
properties: {
|
|
413
|
+
assetId: { type: 'string', description: 'Text资源ID(数字ID)' },
|
|
414
|
+
content: { type: 'string', description: '文本内容' }
|
|
415
|
+
},
|
|
416
|
+
required: ['assetId', 'content']
|
|
417
|
+
}
|
|
418
|
+
},
|
|
419
|
+
{
|
|
420
|
+
name: 'pc_get_text_content',
|
|
421
|
+
description: '获取Text类资源的内容',
|
|
422
|
+
inputSchema: {
|
|
423
|
+
type: 'object',
|
|
424
|
+
properties: {
|
|
425
|
+
assetId: { type: 'string', description: 'Text资源ID(数字ID)' }
|
|
426
|
+
},
|
|
427
|
+
required: ['assetId']
|
|
428
|
+
}
|
|
429
|
+
},
|
|
430
|
+
{
|
|
431
|
+
name: 'pc_list_extensions',
|
|
432
|
+
description: '列出Extension目录下的所有可用扩展列表',
|
|
433
|
+
inputSchema: {
|
|
434
|
+
type: 'object',
|
|
435
|
+
properties: {},
|
|
436
|
+
required: []
|
|
437
|
+
}
|
|
438
|
+
},
|
|
136
439
|
// Template
|
|
137
|
-
{
|
|
138
|
-
|
|
139
|
-
|
|
440
|
+
{
|
|
441
|
+
name: 'pc_instantiate_template',
|
|
442
|
+
description: '实例化模板资源到场景中。支持单个或批量实例化',
|
|
443
|
+
inputSchema: {
|
|
444
|
+
type: 'object',
|
|
445
|
+
properties: {
|
|
446
|
+
templateAssetId: { type: 'string', description: '模板资源ID(数字ID)' },
|
|
447
|
+
parent: { type: 'string', description: '父实体ID(resource_id格式)' },
|
|
448
|
+
position: { type: 'array', items: { type: 'number' }, description: '位置 [x, y, z]' },
|
|
449
|
+
rotation: { type: 'array', items: { type: 'number' }, description: '旋转 [x, y, z]' },
|
|
450
|
+
scale: { type: 'array', items: { type: 'number' }, description: '缩放 [x, y, z]' },
|
|
451
|
+
templates: { type: 'array', description: '批量实例化模式' }
|
|
452
|
+
},
|
|
453
|
+
required: []
|
|
454
|
+
}
|
|
455
|
+
},
|
|
456
|
+
{
|
|
457
|
+
name: 'pc_create_template',
|
|
458
|
+
description: '从现有实体创建模板资源',
|
|
459
|
+
inputSchema: {
|
|
460
|
+
type: 'object',
|
|
461
|
+
properties: {
|
|
462
|
+
entityId: { type: 'string', description: '源实体ID(resource_id格式)' },
|
|
463
|
+
name: { type: 'string', description: '模板名称' },
|
|
464
|
+
folder: { type: 'string', description: '目标文件夹ID或路径' },
|
|
465
|
+
folderPath: { type: 'string', description: '目标文件夹路径(推荐)' }
|
|
466
|
+
},
|
|
467
|
+
required: ['entityId']
|
|
468
|
+
}
|
|
469
|
+
},
|
|
470
|
+
{
|
|
471
|
+
name: 'pc_apply_template',
|
|
472
|
+
description: '将Template实例的修改应用回Template资产',
|
|
473
|
+
inputSchema: {
|
|
474
|
+
type: 'object',
|
|
475
|
+
properties: {
|
|
476
|
+
entityId: { type: 'string', description: 'Template实例的根实体ID(resource_id格式)' }
|
|
477
|
+
},
|
|
478
|
+
required: ['entityId']
|
|
479
|
+
}
|
|
480
|
+
},
|
|
140
481
|
// Scene
|
|
141
|
-
{ name: 'list_scenes', description: 'List scenes (legacy).' },
|
|
142
|
-
{ name: 'load_scene', description: 'Load a scene by ID (legacy).' },
|
|
143
|
-
{
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
482
|
+
{ name: 'list_scenes', description: 'List scenes (legacy).', inputSchema: { type: 'object', properties: {}, required: [] } },
|
|
483
|
+
{ name: 'load_scene', description: 'Load a scene by ID (legacy).', inputSchema: { type: 'object', properties: { sceneId: { type: 'string' } }, required: ['sceneId'] } },
|
|
484
|
+
{
|
|
485
|
+
name: 'pc_get_scene',
|
|
486
|
+
description: '获取当前PlayCanvas场景信息',
|
|
487
|
+
inputSchema: {
|
|
488
|
+
type: 'object',
|
|
489
|
+
properties: {},
|
|
490
|
+
required: []
|
|
491
|
+
}
|
|
492
|
+
},
|
|
493
|
+
{
|
|
494
|
+
name: 'pc_save_scene',
|
|
495
|
+
description: '保存当前PlayCanvas场景',
|
|
496
|
+
inputSchema: {
|
|
497
|
+
type: 'object',
|
|
498
|
+
properties: {},
|
|
499
|
+
required: []
|
|
500
|
+
}
|
|
501
|
+
},
|
|
502
|
+
{
|
|
503
|
+
name: 'pc_query_scene_settings',
|
|
504
|
+
description: '查询当前场景设置(渲染、物理、音频等)',
|
|
505
|
+
inputSchema: {
|
|
506
|
+
type: 'object',
|
|
507
|
+
properties: {},
|
|
508
|
+
required: []
|
|
509
|
+
}
|
|
510
|
+
},
|
|
511
|
+
{
|
|
512
|
+
name: 'pc_modify_scene_settings',
|
|
513
|
+
description: '修改场景设置',
|
|
514
|
+
inputSchema: {
|
|
515
|
+
type: 'object',
|
|
516
|
+
properties: {
|
|
517
|
+
settings: { type: 'object', description: '要修改的设置' }
|
|
518
|
+
},
|
|
519
|
+
required: ['settings']
|
|
520
|
+
}
|
|
521
|
+
},
|
|
147
522
|
// Project
|
|
148
|
-
{
|
|
149
|
-
|
|
150
|
-
|
|
523
|
+
{
|
|
524
|
+
name: 'pc_get_project',
|
|
525
|
+
description: '获取PlayCanvas项目信息',
|
|
526
|
+
inputSchema: {
|
|
527
|
+
type: 'object',
|
|
528
|
+
properties: {},
|
|
529
|
+
required: []
|
|
530
|
+
}
|
|
531
|
+
},
|
|
532
|
+
{
|
|
533
|
+
name: 'pc_get_project_settings',
|
|
534
|
+
description: '获取PlayCanvas项目设置',
|
|
535
|
+
inputSchema: {
|
|
536
|
+
type: 'object',
|
|
537
|
+
properties: {},
|
|
538
|
+
required: []
|
|
539
|
+
}
|
|
540
|
+
},
|
|
541
|
+
{
|
|
542
|
+
name: 'pc_update_project_settings',
|
|
543
|
+
description: '更新PlayCanvas项目设置',
|
|
544
|
+
inputSchema: {
|
|
545
|
+
type: 'object',
|
|
546
|
+
properties: {
|
|
547
|
+
settings: { type: 'object', description: '项目设置对象' }
|
|
548
|
+
},
|
|
549
|
+
required: ['settings']
|
|
550
|
+
}
|
|
551
|
+
},
|
|
151
552
|
// Material
|
|
152
|
-
{
|
|
553
|
+
{
|
|
554
|
+
name: 'pc_set_material_diffuse',
|
|
555
|
+
description: '设置材质的漫反射颜色(diffuse color)',
|
|
556
|
+
inputSchema: {
|
|
557
|
+
type: 'object',
|
|
558
|
+
properties: {
|
|
559
|
+
assetId: { type: 'string', description: '材质资源ID(数字ID)' },
|
|
560
|
+
color: { type: 'array', items: { type: 'number' }, description: 'RGB颜色值 [r, g, b],范围0-1' }
|
|
561
|
+
},
|
|
562
|
+
required: ['assetId', 'color']
|
|
563
|
+
}
|
|
564
|
+
},
|
|
153
565
|
// Runtime
|
|
154
|
-
{
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
566
|
+
{
|
|
567
|
+
name: 'pc_get_runtime_errors',
|
|
568
|
+
description: '获取运行时错误',
|
|
569
|
+
inputSchema: {
|
|
570
|
+
type: 'object',
|
|
571
|
+
properties: {
|
|
572
|
+
clear: { type: 'boolean', description: '是否清除错误列表,默认true' }
|
|
573
|
+
},
|
|
574
|
+
required: []
|
|
575
|
+
}
|
|
576
|
+
},
|
|
577
|
+
{
|
|
578
|
+
name: 'pc_get_editor_errors',
|
|
579
|
+
description: '获取编辑器错误',
|
|
580
|
+
inputSchema: {
|
|
581
|
+
type: 'object',
|
|
582
|
+
properties: {
|
|
583
|
+
clear: { type: 'boolean', description: '是否清除错误列表,默认true' }
|
|
584
|
+
},
|
|
585
|
+
required: []
|
|
586
|
+
}
|
|
587
|
+
},
|
|
588
|
+
{
|
|
589
|
+
name: 'pc_find_runtime_entities',
|
|
590
|
+
description: '查找运行时实体',
|
|
591
|
+
inputSchema: {
|
|
592
|
+
type: 'object',
|
|
593
|
+
properties: {
|
|
594
|
+
name: { type: 'string', description: '实体名称' },
|
|
595
|
+
tag: { type: 'string', description: '标签' },
|
|
596
|
+
hasComponent: { type: 'string', description: '组件类型' }
|
|
597
|
+
},
|
|
598
|
+
required: []
|
|
599
|
+
}
|
|
600
|
+
},
|
|
601
|
+
{
|
|
602
|
+
name: 'pc_get_runtime_entity',
|
|
603
|
+
description: '通过GUID获取运行时实体',
|
|
604
|
+
inputSchema: {
|
|
605
|
+
type: 'object',
|
|
606
|
+
properties: {
|
|
607
|
+
guid: { type: 'string', description: '实体GUID' }
|
|
608
|
+
},
|
|
609
|
+
required: ['guid']
|
|
610
|
+
}
|
|
611
|
+
},
|
|
158
612
|
// Editor
|
|
159
|
-
{ name: 'editor_call', description: 'Call editor API.' },
|
|
160
|
-
{ name: 'editor_run', description: 'Run editor command.' },
|
|
613
|
+
{ name: 'editor_call', description: 'Call editor API.', inputSchema: { type: 'object', properties: {}, required: [] } },
|
|
614
|
+
{ name: 'editor_run', description: 'Run editor command.', inputSchema: { type: 'object', properties: { code: { type: 'string' } }, required: ['code'] } },
|
|
161
615
|
// Agent
|
|
162
|
-
{
|
|
163
|
-
|
|
616
|
+
{
|
|
617
|
+
name: 'pc_get_pending_messages',
|
|
618
|
+
description: '获取PlayCanvas Dashboard中用户发送的待处理消息',
|
|
619
|
+
inputSchema: {
|
|
620
|
+
type: 'object',
|
|
621
|
+
properties: {},
|
|
622
|
+
required: []
|
|
623
|
+
}
|
|
624
|
+
},
|
|
625
|
+
{
|
|
626
|
+
name: 'pc_send_agent_response',
|
|
627
|
+
description: '向PlayCanvas Dashboard发送Agent的响应消息',
|
|
628
|
+
inputSchema: {
|
|
629
|
+
type: 'object',
|
|
630
|
+
properties: {
|
|
631
|
+
message: { type: 'string', description: '要发送的响应消息' }
|
|
632
|
+
},
|
|
633
|
+
required: ['message']
|
|
634
|
+
}
|
|
635
|
+
},
|
|
164
636
|
// AI
|
|
165
|
-
{
|
|
166
|
-
|
|
637
|
+
{
|
|
638
|
+
name: 'pc_generate_with_ai',
|
|
639
|
+
description: 'Generate content with AI (single resource per call).',
|
|
640
|
+
inputSchema: {
|
|
641
|
+
type: 'object',
|
|
642
|
+
properties: {
|
|
643
|
+
prompt: { type: 'string', description: 'AI生成prompt' },
|
|
644
|
+
options: { type: 'object', description: '生成选项' }
|
|
645
|
+
},
|
|
646
|
+
required: ['prompt']
|
|
647
|
+
}
|
|
648
|
+
},
|
|
649
|
+
{
|
|
650
|
+
name: 'pc_analyze_image',
|
|
651
|
+
description: '分析项目中的图片资产,智能识别图片类型和属性',
|
|
652
|
+
inputSchema: {
|
|
653
|
+
type: 'object',
|
|
654
|
+
properties: {
|
|
655
|
+
assetId: { type: 'number', description: '图片资产ID' },
|
|
656
|
+
imageBase64: { type: 'string', description: 'Base64图片数据' },
|
|
657
|
+
imageUrl: { type: 'string', description: '图片URL' },
|
|
658
|
+
options: { type: 'object', description: '分析选项' }
|
|
659
|
+
},
|
|
660
|
+
required: []
|
|
661
|
+
}
|
|
662
|
+
},
|
|
167
663
|
// Generator
|
|
168
|
-
{
|
|
664
|
+
{
|
|
665
|
+
name: 'pc_apply_table_to_scene',
|
|
666
|
+
description: '将指定的 Table 数据(球桌几何/贴图)应用到场景中的 Entity',
|
|
667
|
+
inputSchema: {
|
|
668
|
+
type: 'object',
|
|
669
|
+
properties: {
|
|
670
|
+
folderId: { type: 'number', description: 'Table数据文件夹的AssetID' },
|
|
671
|
+
entityName: { type: 'string', description: '目标Entity名称,默认"Table"' },
|
|
672
|
+
generateTexture: { type: 'boolean', description: '是否先生成贴图' },
|
|
673
|
+
texturePrompt: { type: 'string', description: '贴图生成prompt' },
|
|
674
|
+
textureServiceType: { type: 'string', description: '贴图生成服务:svg/gemini/comfyui' },
|
|
675
|
+
style: { type: 'string', description: '球桌风格' },
|
|
676
|
+
theme: { type: 'string', description: '球桌主题' }
|
|
677
|
+
},
|
|
678
|
+
required: ['folderId']
|
|
679
|
+
}
|
|
680
|
+
},
|
|
169
681
|
// Legacy
|
|
170
|
-
{ name: 'list_entities', description: 'List entities (legacy).' },
|
|
171
|
-
{ name: 'create_entity', description: 'Create entity (legacy).' },
|
|
172
|
-
{ name: 'delete_entity', description: 'Delete entity (legacy).' },
|
|
173
|
-
{ name: 'modify_entity', description: 'Modify entity (legacy).' },
|
|
174
|
-
{ name: 'list_assets', description: 'List assets (legacy).' },
|
|
175
|
-
{ name: 'create_asset', description: 'Create asset (legacy).' },
|
|
176
|
-
{ name: 'delete_asset', description: 'Delete asset (legacy).' },
|
|
177
|
-
{ name: 'query_scene_settings', description: 'Query scene settings (legacy).' },
|
|
682
|
+
{ name: 'list_entities', description: 'List entities (legacy).', inputSchema: { type: 'object', properties: {}, required: [] } },
|
|
683
|
+
{ name: 'create_entity', description: 'Create entity (legacy).', inputSchema: { type: 'object', properties: {}, required: [] } },
|
|
684
|
+
{ name: 'delete_entity', description: 'Delete entity (legacy).', inputSchema: { type: 'object', properties: { entityId: { type: 'string' } }, required: ['entityId'] } },
|
|
685
|
+
{ name: 'modify_entity', description: 'Modify entity (legacy).', inputSchema: { type: 'object', properties: {}, required: [] } },
|
|
686
|
+
{ name: 'list_assets', description: 'List assets (legacy).', inputSchema: { type: 'object', properties: {}, required: [] } },
|
|
687
|
+
{ name: 'create_asset', description: 'Create asset (legacy).', inputSchema: { type: 'object', properties: {}, required: [] } },
|
|
688
|
+
{ name: 'delete_asset', description: 'Delete asset (legacy).', inputSchema: { type: 'object', properties: { assetId: { type: 'string' } }, required: ['assetId'] } },
|
|
689
|
+
{ name: 'query_scene_settings', description: 'Query scene settings (legacy).', inputSchema: { type: 'object', properties: {}, required: [] } },
|
|
178
690
|
];
|
|
179
691
|
//# sourceMappingURL=tools.js.map
|