@craft_eco/craft-mcp 0.1.5 → 0.1.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/README.md +8 -8
- package/bin/craft-mcp.mjs +28 -2
- package/dist-server/engines/unreal/artifacts.mjs +7 -3
- package/dist-server/engines/unreal/check.mjs +56 -7
- package/dist-server/engines/unreal/export.mjs +3 -3
- package/dist-server/engines/unreal/external-environment.mjs +7 -1
- package/dist-server/engines/unreal/preview-project.mjs +2 -2
- package/dist-server/engines/unreal/project.mjs +44 -12
- package/dist-server/game-workflow/project-context.mjs +7 -6
- package/dist-server/game-workflow/project-install.mjs +2 -1
- package/dist-server/integrations/config.mjs +41 -18
- package/dist-server/integrations/connect.mjs +18 -9
- package/dist-server/integrations/connection-handoff.mjs +9 -8
- package/dist-server/integrations/dsh-config.mjs +30 -14
- package/dist-server/integrations/files.mjs +3 -1
- package/dist-server/integrations/fixed-launcher.mjs +1 -0
- package/dist-server/integrations/host-config-scope.mjs +4 -3
- package/dist-server/integrations/hosts.mjs +3 -1
- package/dist-server/integrations/install-source.mjs +44 -0
- package/dist-server/integrations/install.mjs +183 -53
- package/dist-server/integrations/installation-state.mjs +2 -1
- package/dist-server/integrations/instance-skill.mjs +26 -0
- package/dist-server/integrations/instance.mjs +29 -0
- package/dist-server/integrations/launcher-start.mjs +1 -1
- package/dist-server/integrations/login-task-command.mjs +3 -3
- package/dist-server/integrations/opencode-config.mjs +13 -6
- package/dist-server/integrations/project-setup.mjs +46 -18
- package/dist-server/integrations/runtime.mjs +2 -1
- package/dist-server/integrations/uninstall.mjs +160 -0
- package/dist-server/integrations/updates.mjs +57 -28
- package/dist-server/launcher.mjs +18 -2
- package/dist-server/mcp/server.mjs +19 -10
- package/dist-server/mcp/update-session.mjs +34 -12
- package/dist-server/upstream/craft-aigc.mjs +11 -2
- package/dist-server/upstream/draft-audit.mjs +52 -6
- package/package.json +4 -3
- package/resources/craft-create/SKILL.md +2 -0
- package/resources/craft-update/SKILL.md +2 -0
- package/resources/targets/claude/unreal/target.json +6 -6
- package/resources/targets/claude/unreal/unreal/bundle.json +10 -10
- package/resources/targets/claude/unreal/unreal/context/web/knowledge/WebBuild.md +6 -6
- package/resources/targets/codebuddy/unreal/target.json +6 -6
- package/resources/targets/codebuddy/unreal/unreal/bundle.json +10 -10
- package/resources/targets/codebuddy/unreal/unreal/context/web/knowledge/WebBuild.md +9 -7
- package/resources/targets/codex/unreal/target.json +6 -6
- package/resources/targets/codex/unreal/unreal/bundle.json +10 -10
- package/resources/targets/codex/unreal/unreal/context/web/knowledge/WebBuild.md +9 -7
- package/resources/targets/comate/unreal/target.json +6 -6
- package/resources/targets/comate/unreal/unreal/bundle.json +10 -10
- package/resources/targets/comate/unreal/unreal/context/web/knowledge/WebBuild.md +6 -6
- package/resources/targets/cursor/unreal/target.json +6 -6
- package/resources/targets/cursor/unreal/unreal/bundle.json +10 -10
- package/resources/targets/cursor/unreal/unreal/context/web/knowledge/WebBuild.md +6 -6
- package/resources/targets/dsh/unreal/target.json +6 -6
- package/resources/targets/dsh/unreal/unreal/bundle.json +10 -10
- package/resources/targets/dsh/unreal/unreal/context/web/knowledge/WebBuild.md +6 -6
- package/resources/targets/index.json +28 -28
- package/resources/targets/kimi/unreal/target.json +6 -6
- package/resources/targets/kimi/unreal/unreal/bundle.json +10 -10
- package/resources/targets/kimi/unreal/unreal/context/web/knowledge/WebBuild.md +6 -6
- package/resources/targets/opencode/unreal/target.json +6 -6
- package/resources/targets/opencode/unreal/unreal/bundle.json +10 -10
- package/resources/targets/opencode/unreal/unreal/context/web/knowledge/WebBuild.md +6 -6
- package/resources/targets/qoder/unreal/target.json +6 -6
- package/resources/targets/qoder/unreal/unreal/bundle.json +10 -10
- package/resources/targets/qoder/unreal/unreal/context/web/knowledge/WebBuild.md +6 -6
- package/resources/targets/qoder-cn/unreal/target.json +6 -6
- package/resources/targets/qoder-cn/unreal/unreal/bundle.json +10 -10
- package/resources/targets/qoder-cn/unreal/unreal/context/web/knowledge/WebBuild.md +6 -6
- package/resources/targets/qwen/unreal/target.json +6 -6
- package/resources/targets/qwen/unreal/unreal/bundle.json +10 -10
- package/resources/targets/qwen/unreal/unreal/context/web/knowledge/WebBuild.md +6 -6
- package/resources/targets/trae/unreal/target.json +6 -6
- package/resources/targets/trae/unreal/unreal/bundle.json +10 -10
- package/resources/targets/trae/unreal/unreal/context/web/knowledge/WebBuild.md +6 -6
- package/resources/targets/workbuddy/unreal/target.json +6 -6
- package/resources/targets/workbuddy/unreal/unreal/bundle.json +11 -11
- package/resources/targets/workbuddy/unreal/unreal/context/web/knowledge/WebBuild.md +7 -11
- package/resources/targets/workbuddy/unreal/unreal/context/web/skills/unreal-verify/SKILL.md +1 -1
- package/resources/targets/zcode/unreal/target.json +6 -6
- package/resources/targets/zcode/unreal/unreal/bundle.json +10 -10
- package/resources/targets/zcode/unreal/unreal/context/web/knowledge/WebBuild.md +6 -6
- package/resources/templates/unreal/project/Config/DefaultWebPublisher.ini +27 -21
- package/resources/templates/unreal/project/Config/README.md +10 -1
- package/resources/templates/unreal/project/Plugins/WebPublisher/Source/WebPublisher/Private/WebPublisherModule.cpp +13 -0
- package/resources/templates/unreal/project/template.json +33 -33
- package/resources/unreal-websdk/Setup-WebSDK.ps1 +2 -1
- package/resources/unreal-websdk/WebSDK-Packages.ps1 +143 -33
- package/resources/unreal-websdk/websdk-release.json +1 -5
|
@@ -28,6 +28,7 @@ import { getLoginPage } from './login-page.mjs';
|
|
|
28
28
|
import { loadEngineResources, loadEngineResource } from '../game-workflow/engines.mjs';
|
|
29
29
|
import { takeConnectorToken, ConnectorAuthStore, connectorLoginAction } from '../core/connector-auth.mjs';
|
|
30
30
|
import { clientIde } from '../integrations/hosts.mjs';
|
|
31
|
+
import { validateServerId } from '../integrations/instance.mjs';
|
|
31
32
|
import { currentWork, withWork, guardWork } from '../game-workflow/work-scope.mjs';
|
|
32
33
|
import { mcpProduceLocation } from '../core/production-source.mjs';
|
|
33
34
|
import { ProductionTelemetry } from './production-telemetry.mjs';
|
|
@@ -35,6 +36,7 @@ import { getRuntimeIdentity } from '../integrations/runtime.mjs';
|
|
|
35
36
|
import { UpdateSession } from './update-session.mjs';
|
|
36
37
|
import { registerRuntimeConnection } from '../integrations/runtime-gc.mjs';
|
|
37
38
|
import { readInstallation, sameRuntimeIdentity } from '../integrations/installation-state.mjs';
|
|
39
|
+
import { readProjectInstall, assertProjectInstallConnection } from '../game-workflow/project-install.mjs';
|
|
38
40
|
|
|
39
41
|
// Consume before any project/build subprocess can inherit the credential.
|
|
40
42
|
let connectorToken = takeConnectorToken();
|
|
@@ -51,6 +53,7 @@ if (connectorAuth) {
|
|
|
51
53
|
finally { connectorToken = undefined; }
|
|
52
54
|
}
|
|
53
55
|
const host = clientIde(process.env.CRAFT_CLIENT_IDE);
|
|
56
|
+
const serverId = validateServerId(process.env.CRAFT_SERVER_ID ?? 'craft');
|
|
54
57
|
const configuredMcpHost = process.env.CRAFT_MCP_HOST;
|
|
55
58
|
const { instructions:guide, workflow:bootstrapWorkflow, engines } = await loadEngineResources(resources,host);
|
|
56
59
|
const projects = new Projects(root,state,engines,host,async()=>{
|
|
@@ -58,10 +61,10 @@ const projects = new Projects(root,state,engines,host,async()=>{
|
|
|
58
61
|
// loopback mock server into a project that will be opened on another machine.
|
|
59
62
|
if(new URL(platform.base).protocol!=='https:') return {unavailable:'non_portable_platform'};
|
|
60
63
|
const installationFile=process.env.CRAFT_INSTALLATION_FILE;
|
|
61
|
-
if(!installationFile) return {version,platform:platform.base};
|
|
64
|
+
if(!installationFile) return {version,platform:platform.base,requireKnownChannel:true};
|
|
62
65
|
const installation=await readInstallation(installationFile);
|
|
63
66
|
const canonical=value=>process.platform==='win32'?path.resolve(value).toLowerCase():path.resolve(value);
|
|
64
|
-
if(installation.host!==host || canonical(installation.workspace)!==canonical(root) || new URL(installation.platform).origin!==new URL(platform.base).origin || installation.source.package!==runtimeIdentity.package) {
|
|
67
|
+
if(installation.server_id!==serverId || installation.host!==host || canonical(installation.workspace)!==canonical(root) || new URL(installation.platform).origin!==new URL(platform.base).origin || installation.source.package!==runtimeIdentity.package) {
|
|
65
68
|
throw new Error('Craft installation scope differs from this connection; reconnect before preparing project installation information');
|
|
66
69
|
}
|
|
67
70
|
if(!sameRuntimeIdentity(runtimeIdentity,installation.target)) throw new Error('The installed Craft target differs from this running connection; reconnect and verify the actual runtime before preparing project installation information');
|
|
@@ -85,7 +88,12 @@ let openingLoginPages=0;
|
|
|
85
88
|
const externalUnrealTask = task => !task?.work_id && ['unreal-export','unreal-preview','unreal-upload'].includes(task?.kind);
|
|
86
89
|
async function validateWork(work,{preparing=false}={}) {
|
|
87
90
|
await leases.assert(work.name,work.work_id,{ready:!preparing,context_revision:work.context_revision});
|
|
88
|
-
if(!preparing)
|
|
91
|
+
if(!preparing) {
|
|
92
|
+
const project = await projects.assertRevision(work.name,work.context_revision);
|
|
93
|
+
const manifest = await readProjectInstall(project.project);
|
|
94
|
+
if (manifest) assertProjectInstallConnection(manifest, {engine:project.engine,version,platform:platform.base,
|
|
95
|
+
registry:updates.connectedSource?.registry,channel:updates.connectedSource?.channel,requireKnownChannel:true});
|
|
96
|
+
}
|
|
89
97
|
}
|
|
90
98
|
function runtimeBusy({excludeUpdate=false}={}) {
|
|
91
99
|
const busy={work_count:leases.activeCount,task_count:tasks.activeCount,mutation_count:mutations.size,
|
|
@@ -94,9 +102,9 @@ function runtimeBusy({excludeUpdate=false}={}) {
|
|
|
94
102
|
maintenance_count:Number(Boolean(runtimeMaintenance))};
|
|
95
103
|
return {...busy,can_reconnect:!closing && Object.values(busy).every(count=>count===0)};
|
|
96
104
|
}
|
|
97
|
-
const updates=new UpdateSession({installationFile:process.env.CRAFT_INSTALLATION_FILE,current:runtimeIdentity,projects,host,workspace:root,platform:platform.base,busy:runtimeBusy});
|
|
105
|
+
const updates=new UpdateSession({installationFile:process.env.CRAFT_INSTALLATION_FILE,current:runtimeIdentity,projects,host,serverId,workspace:root,platform:platform.base,busy:runtimeBusy});
|
|
98
106
|
let runtimeConnection;
|
|
99
|
-
if(process.env.CRAFT_INSTALLATION_FILE && !await updates.
|
|
107
|
+
if(process.env.CRAFT_INSTALLATION_FILE && !await updates.connectionIssue()) {
|
|
100
108
|
try { runtimeConnection=await registerRuntimeConnection({installationFile:process.env.CRAFT_INSTALLATION_FILE,current:runtimeIdentity}); }
|
|
101
109
|
catch { process.stderr.write('[craft] Runtime cleanup is unavailable for this connection; MCP remains active.\n'); }
|
|
102
110
|
}
|
|
@@ -138,6 +146,7 @@ const tools = [
|
|
|
138
146
|
output_dir:{type:'string',description:'Optional absolute SDK export directory. Defaults to a stable per-project directory in Craft data.'},
|
|
139
147
|
lto:{type:'string',enum:['thin','full'],description:'Default to thin for local exports and testing without asking. Use full for a release package after the user confirms submission or explicitly requests a release build. This tool only builds the package.'},
|
|
140
148
|
variants:{type:'array',items:{type:'string'},description:'Optional Web platform and texture selections, for example WasmWebGPUMobile=ASTC. Defaults to configured or SDK selections.'},
|
|
149
|
+
content_delivery:{type:'boolean',description:'Optional direct override of the SDK ContentDelivery setting. Omit to preserve project/SDK defaults. False uses the SDK ordinary Pak export of the original map; true enables progressive content delivery. Never automatically retry a failed build with a different value.'},
|
|
141
150
|
web_settings:{type:'object',description:'Only supply the user’s choice when the project has ambiguous targets or needs an explicit startup map. Applied to the export copy.',additionalProperties:false,properties:{
|
|
142
151
|
target:{type:'string',description:'Game target from the project’s UBT target list.'},
|
|
143
152
|
editor_target:{type:'string',description:'Editor target from the project’s UBT target list.'},
|
|
@@ -186,7 +195,7 @@ const tools = [
|
|
|
186
195
|
// The connection and prepare result use the same maintained workflow; clients may omit initialize instructions from their model context.
|
|
187
196
|
const server = new Server({ name:'craft-local',version },{ capabilities:{ tools:{} },instructions:guide });
|
|
188
197
|
function productionTelemetry() {
|
|
189
|
-
//
|
|
198
|
+
// Initialization supplies clientInfo for hosts identified by handshake name.
|
|
190
199
|
return telemetry ??= new ProductionTelemetry(platform,drafts,mcpProduceLocation(host,{
|
|
191
200
|
configuredHost:configuredMcpHost, clientName:server.getClientVersion()?.name
|
|
192
201
|
}),{ state,workspace:root,version });
|
|
@@ -197,6 +206,7 @@ server.oninitialized=()=>{
|
|
|
197
206
|
// Hosts also initialize short-lived discovery probes. They can close or kill
|
|
198
207
|
// the child immediately after tools/list, so readiness must never start GC.
|
|
199
208
|
connectionReady=updates.connected();
|
|
209
|
+
if (process.env.CRAFT_STANDALONE_PROBE !== '1') productionTelemetry().start();
|
|
200
210
|
};
|
|
201
211
|
server.setRequestHandler(ListToolsRequestSchema,async()=>({ tools }));
|
|
202
212
|
function viewTask(task) {
|
|
@@ -287,7 +297,6 @@ server.setRequestHandler(CallToolRequestSchema,async request=>{
|
|
|
287
297
|
}
|
|
288
298
|
businessResult = await withWork(work,work ? ()=>validateWork(work,{preparing:preparing || definition.name==='craft_task_cancel'}) : undefined,async()=>{
|
|
289
299
|
const production = productionTelemetry();
|
|
290
|
-
if (definition.name !== 'craft_auth_logout' && process.env.CRAFT_STANDALONE_PROBE !== '1') production.start();
|
|
291
300
|
let result;
|
|
292
301
|
if(args.name && (definition.name.startsWith('craft_assets_') || definition.name==='craft_game_upload')) {
|
|
293
302
|
const project=await projects.describe(args.name);
|
|
@@ -301,10 +310,10 @@ server.setRequestHandler(CallToolRequestSchema,async request=>{
|
|
|
301
310
|
const environment=await externalUnrealEnvironment({resources,prepare:async({editor_root})=>{
|
|
302
311
|
assertOutsideBuildRoots(output,[editor_root]);
|
|
303
312
|
await progress({phase:'正在下载和安装官方 Web SDK'});
|
|
304
|
-
|
|
313
|
+
return prepareOfficialSdk(resources,signal);
|
|
305
314
|
}});
|
|
306
315
|
const exported=await runUnrealExport({project,environment,resources,templateRoot:engines.unreal.template,
|
|
307
|
-
output,variants:args.variants,lto:args.lto,
|
|
316
|
+
output,variants:args.variants,lto:args.lto,contentDelivery:args.content_delivery,
|
|
308
317
|
excludedPlugins:args.excluded_plugins,webSettings:args.web_settings,signal,progress});
|
|
309
318
|
await progress({phase:'正在准备游戏链接',exportResult:exported});
|
|
310
319
|
return attachSdkPreview({result:exported,environment,state,signal});
|
|
@@ -391,7 +400,7 @@ server.setRequestHandler(CallToolRequestSchema,async request=>{
|
|
|
391
400
|
environment:args.web_operation===existingScope ? existing : {...managed,scope:'web_build',operation:'managed_project_build'}};
|
|
392
401
|
}
|
|
393
402
|
const updateStatus=await updates.status();
|
|
394
|
-
result = { version, runtime:{...runtimeIdentity,busy:runtimeBusy(),activation:updateStatus.activation??{status:updateStatus.status}},update:updateStatus,host,mcp_produce_location:production.location, workspace:root, workspace_layout:'<workspace>/<name>', platform:platform.base, engine:engine ?? null, supported_engines:supportedEngines,
|
|
403
|
+
result = { version, server_id:serverId, channel:updates.connectedSource?.channel ?? null, runtime:{...runtimeIdentity,busy:runtimeBusy(),activation:updateStatus.activation??{status:updateStatus.status}},update:updateStatus,host,mcp_produce_location:production.location, workspace:root, workspace_layout:'<workspace>/<name>', platform:platform.base, engine:engine ?? null, supported_engines:supportedEngines,
|
|
395
404
|
context_binding:project?.context_binding,project_install:project?.project_install,
|
|
396
405
|
version_status:project?.version_status,pending_hosts:project?.pending_hosts,conflicting_hosts:project?.conflicting_hosts,
|
|
397
406
|
integrity:project?.integrity,preparation:project?.preparation,registration_required:project?.registration_required,occupancy,project_context:project?.project_context,
|
|
@@ -2,18 +2,20 @@ import { compatibleContextContract } from '../engines/catalog.mjs';
|
|
|
2
2
|
import path from 'node:path';
|
|
3
3
|
import { randomUUID } from 'node:crypto';
|
|
4
4
|
import { readFile } from 'node:fs/promises';
|
|
5
|
+
import { isDeepStrictEqual } from 'node:util';
|
|
5
6
|
import { loadInstalledEngine } from '../game-workflow/engines.mjs';
|
|
6
7
|
import { readContextLock, checkProjectCompatibility, planContextRelease, assertContextRelease } from '../game-workflow/project-bundles.mjs';
|
|
7
|
-
import { checkForUpdate, readUpdateStatus, readInstallation, confirmActiveInstallation, queryRegistry } from '../integrations/updates.mjs';
|
|
8
|
+
import { checkForUpdate, readUpdateStatus, readInstallation, confirmActiveInstallation, pendingChannelSwitch, queryRegistry } from '../integrations/updates.mjs';
|
|
9
|
+
import { sameRuntimeIdentity } from '../integrations/installation-state.mjs';
|
|
8
10
|
import { connectionHandoff } from '../integrations/connection-handoff.mjs';
|
|
9
11
|
import { readProjectInstall, assertProjectInstallConnection } from '../game-workflow/project-install.mjs';
|
|
10
12
|
|
|
11
13
|
// This connection owns one complete package for its entire lifetime. An
|
|
12
14
|
// installer probe or another connection can never replace its runtime identity.
|
|
13
15
|
export class UpdateSession {
|
|
14
|
-
constructor({installationFile, current, projects, host, workspace, platform, busy,
|
|
16
|
+
constructor({installationFile, current, projects, host, workspace, platform, serverId = 'craft', busy,
|
|
15
17
|
confirmInstallation=confirmActiveInstallation,checkInstallation=checkForUpdate,retryMinMs=250,retryMaxMs=5000}) {
|
|
16
|
-
Object.assign(this,{installationFile,current,projects,host,workspace,platform,busy});
|
|
18
|
+
Object.assign(this,{installationFile,current,projects,host,workspace,platform,serverId,busy});
|
|
17
19
|
Object.assign(this,{confirmInstallation,checkInstallation,retryMinMs,retryMaxMs});
|
|
18
20
|
this.updates=new Set();
|
|
19
21
|
this.inspections=new Set();
|
|
@@ -38,17 +40,31 @@ export class UpdateSession {
|
|
|
38
40
|
// roll back before the process acknowledges a graceful shutdown.
|
|
39
41
|
await Promise.allSettled([...this.updates,...this.inspections]);
|
|
40
42
|
}
|
|
41
|
-
async
|
|
42
|
-
if(!this.installationFile)
|
|
43
|
+
async connectionIssue(handoff) {
|
|
44
|
+
if (!this.installationFile) {
|
|
45
|
+
if (this.serverId === 'craft') return null;
|
|
46
|
+
return {status:'error',code:'installation_scope_mismatch',message:'Named Craft instances require their own installation record',can_continue:false,activation_required:false};
|
|
47
|
+
}
|
|
43
48
|
try {
|
|
44
49
|
const state=await readInstallation(this.installationFile);
|
|
45
50
|
const normalize=value=>{const resolved=path.resolve(value);return process.platform==='win32'?resolved.toLowerCase():resolved;};
|
|
46
|
-
if(state.host!==this.host || normalize(state.workspace)!==normalize(this.workspace) || new URL(state.platform).origin!==new URL(this.platform).origin) throw new Error('Craft installation host, workspace or platform differs from this connection; run install with the intended scope and reconnect');
|
|
51
|
+
if(state.server_id!==this.serverId || state.host!==this.host || normalize(state.workspace)!==normalize(this.workspace) || new URL(state.platform).origin!==new URL(this.platform).origin) throw new Error('Craft installation server, host, workspace or platform differs from this connection; run install with the intended scope and reconnect');
|
|
52
|
+
const switched=pendingChannelSwitch(state,this.current,this.connectedSource);
|
|
53
|
+
if(switched) return this.withHandoff(switched,handoff);
|
|
54
|
+
// Remember the source only when this process actually matches the target.
|
|
55
|
+
// Two tags can point to the same build; that process can keep serving.
|
|
56
|
+
if(sameRuntimeIdentity(this.current,state.target)) {
|
|
57
|
+
if(this.connectedSource && !isDeepStrictEqual(this.connectedSource,state.source)) {
|
|
58
|
+
delete this.last;
|
|
59
|
+
this.receipts.clear();
|
|
60
|
+
}
|
|
61
|
+
this.connectedSource=state.source;
|
|
62
|
+
}
|
|
47
63
|
return null;
|
|
48
64
|
} catch(error) {return {status:'error',code:'installation_scope_mismatch',message:error.message,current:this.current,can_continue:false,activation_required:false};}
|
|
49
65
|
}
|
|
50
66
|
async status() {
|
|
51
|
-
const
|
|
67
|
+
const issue=await this.connectionIssue();if(issue) return issue;
|
|
52
68
|
const verification=this.verificationStatus();if(verification) return verification;
|
|
53
69
|
return this.withHandoff({...await readUpdateStatus({installationFile:this.installationFile,current:this.current}),
|
|
54
70
|
...(this.last ? {last_check:this.last} : {})},{intent:'inspect'});
|
|
@@ -56,7 +72,7 @@ export class UpdateSession {
|
|
|
56
72
|
withHandoff(result,{intent='inspect',name,request_key,excludeUpdate=false}={}) {
|
|
57
73
|
if(!result.reconnect_required || !result.target || ['error','incompatible','migration_required'].includes(result.status)) return result;
|
|
58
74
|
const busy=this.busy?.({excludeUpdate});
|
|
59
|
-
const handoff=connectionHandoff({host:this.host,target:result.target,current:this.current,workspace:this.workspace,platform:this.platform,
|
|
75
|
+
const handoff=connectionHandoff({host:this.host,serverId:this.serverId,channel:result.source?.channel,target:result.target,current:this.current,workspace:this.workspace,platform:this.platform,
|
|
60
76
|
busy,intent,name,requestKey:request_key});
|
|
61
77
|
return {...result,...(busy?{busy}:{}),connection_handoff:handoff,next:handoff.next};
|
|
62
78
|
}
|
|
@@ -103,7 +119,13 @@ export class UpdateSession {
|
|
|
103
119
|
async confirmConnection() {
|
|
104
120
|
try {
|
|
105
121
|
if(!this.installationFile) {this.clearConnectionRetry();delete this.connectionError;return {status:'unmanaged'};}
|
|
106
|
-
const
|
|
122
|
+
const issue=await this.connectionIssue({excludeUpdate:true});
|
|
123
|
+
if(issue) {
|
|
124
|
+
this.clearConnectionRetry();
|
|
125
|
+
if(issue.status==='error') this.connectionError=issue;
|
|
126
|
+
else delete this.connectionError;
|
|
127
|
+
return issue;
|
|
128
|
+
}
|
|
107
129
|
const status=await readUpdateStatus({installationFile:this.installationFile,current:this.current});
|
|
108
130
|
if(status.status==='error') {this.clearConnectionRetry();return this.connectionError=status;}
|
|
109
131
|
if(status.activation?.status!=='active_verified') {
|
|
@@ -148,7 +170,7 @@ export class UpdateSession {
|
|
|
148
170
|
return this.check({name,request_key,intent:mode==='manual'?'update':'auto'});
|
|
149
171
|
}
|
|
150
172
|
async checkCurrent({name,intent='inspect',request_key,advisory=false}={}) {
|
|
151
|
-
const
|
|
173
|
+
const issue=await this.connectionIssue({intent,name,request_key,excludeUpdate:intent!=='inspect'});if(issue) return issue;
|
|
152
174
|
const verification=this.verificationStatus();if(verification) return verification;
|
|
153
175
|
if(name!==undefined) this.projects.file(name);
|
|
154
176
|
if(intent==='resume' && !name) throw new Error('Project name is required when checking a resume');
|
|
@@ -160,7 +182,7 @@ export class UpdateSession {
|
|
|
160
182
|
const source=this.installationFile ? (await readInstallation(this.installationFile)).source : undefined;
|
|
161
183
|
if(source && source.package!==manifest.package_name) throw new Error('Project installation package differs from the current Craft installation');
|
|
162
184
|
assertProjectInstallConnection(manifest,{engine:project.engine,version,platform:this.platform,
|
|
163
|
-
registry:source?.registry,channel:source?.channel});
|
|
185
|
+
registry:source?.registry,channel:source?.channel,requireKnownChannel:true});
|
|
164
186
|
};
|
|
165
187
|
try {
|
|
166
188
|
projectInstall=project ? await readProjectInstall(project.project) : null;
|
|
@@ -186,7 +208,7 @@ export class UpdateSession {
|
|
|
186
208
|
if(lock?.schema>=2 && !compatibleContextContract(lock.compatibility,candidate.bundle.compatibility)) throw new Error('New Craft context is incompatible with this project; keep its engine and migrate explicitly');
|
|
187
209
|
if(lock?.contexts && candidate.host) assertContextRelease(await planContextRelease(candidate.legacyResources,candidate.bundle,lock));
|
|
188
210
|
} : undefined;
|
|
189
|
-
const result=await this.checkInstallation({installationFile:this.installationFile,current:this.current,intent,
|
|
211
|
+
const result=await this.checkInstallation({installationFile:this.installationFile,current:this.current,connectedSource:this.connectedSource,intent,
|
|
190
212
|
...(advisory && {lookup:source=>queryRegistry(source,{timeoutMs:1500})}),
|
|
191
213
|
requestKey:request_key ? `${intent==='create'?'create':`${name??'global'}:${intent}`}:${request_key}` : undefined,projectCompatibility,
|
|
192
214
|
registryReceipt:request_key ? this.receipts.get(request_key) : undefined});
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { AuthStore } from '../core/auth-store.mjs';
|
|
2
2
|
import { resolveLibraryUrl } from './library-url.mjs';
|
|
3
3
|
import { externalGameUploadRequest, parseExternalGameUploadReceipt } from '#craft-sdk';
|
|
4
|
-
import { parseDraftAudit } from './draft-audit.mjs';
|
|
4
|
+
import { parseDraftAudit, parseDraftScanFailure } from './draft-audit.mjs';
|
|
5
5
|
import { encodeDraftSource, legacySourceFormat } from './draft-source.mjs';
|
|
6
6
|
import { mcpLocationHeader, validMcpProduceLocation } from '../core/production-source.mjs';
|
|
7
7
|
import { open } from 'node:fs/promises';
|
|
@@ -147,6 +147,12 @@ export class CraftAigc {
|
|
|
147
147
|
10015:'上传请求与云端版本冲突,请检查上传状态后重试',
|
|
148
148
|
30006:'Craft 账号的项目数量已达上限,无法新建云端项目。请在 Craft 网页的项目列表中删除不再需要的项目,腾出名额后再重试同一次上传。',
|
|
149
149
|
};
|
|
150
|
+
const scanFailure = draft && !unreal && data?.code === 10017 ? parseDraftScanFailure(data.data) : undefined;
|
|
151
|
+
if (scanFailure) {
|
|
152
|
+
const {message,reason,path} = scanFailure;
|
|
153
|
+
throw new PlatformError(message,{...detail(false,'upload_security'),
|
|
154
|
+
upload_security:{reason,...(path && !path.includes(token) ? {path} : {})}});
|
|
155
|
+
}
|
|
150
156
|
const unrealError = {
|
|
151
157
|
...draftError,
|
|
152
158
|
10001:'UE 上传参数或 ZIP 不合法,请检查入口、文件结构、大小和摘要,修正后发起新的上传',
|
|
@@ -304,7 +310,10 @@ export class CraftAigc {
|
|
|
304
310
|
let result;
|
|
305
311
|
try {
|
|
306
312
|
result=parseExternalGameUploadReceipt(data,{ uploadId:id,requireUploadPath:kind === 'prepare' });
|
|
307
|
-
if (data.audit !== undefined)
|
|
313
|
+
if (data.audit !== undefined) {
|
|
314
|
+
result.audit = parseDraftAudit(data.audit,result.state);
|
|
315
|
+
if (result.audit.findings?.some(finding=>finding.path.includes(token))) throw new Error('Craft 返回的上传检查路径无效');
|
|
316
|
+
}
|
|
308
317
|
if (data.upload_mode !== undefined) {
|
|
309
318
|
if (!['current_project','new_project'].includes(data.upload_mode)) throw new Error('Invalid external game upload mode');
|
|
310
319
|
result.upload_mode = data.upload_mode;
|
|
@@ -1,5 +1,53 @@
|
|
|
1
|
-
const rules =
|
|
2
|
-
'
|
|
1
|
+
const rules = Object.freeze({
|
|
2
|
+
executable_extension:'文件扩展名属于禁止上传的可执行格式',
|
|
3
|
+
executable_content:'文件内容包含本机可执行文件标记',
|
|
4
|
+
image_format:'图片内容与文件格式不匹配',
|
|
5
|
+
audio_format:'音频内容与文件格式不匹配',
|
|
6
|
+
video_format:'视频内容与文件格式不匹配',
|
|
7
|
+
invalid_text_encoding:'文本编码无效或包含空字节',
|
|
8
|
+
invalid_source:'源码文件结构无效',
|
|
9
|
+
invalid_base64:'二进制附件的 Base64 编码无效',
|
|
10
|
+
sensitive_word:'文件命中服务端内容审核规则',
|
|
11
|
+
embedded_private_key:'文件包含私钥,请移除私钥后重新检查',
|
|
12
|
+
process_execution:'代码包含启动系统进程的行为',
|
|
13
|
+
remote_executable_code:'代码加载外部可执行脚本',
|
|
14
|
+
private_network_request:'代码直接请求私网地址',
|
|
15
|
+
unsafe_code_generation:'代码包含执行字符串或动态生成代码的行为',
|
|
16
|
+
unbounded_network_calls:'代码包含循环或极高频网络请求',
|
|
17
|
+
unscannable_code:'代码无法完成静态检查,请检查编码、语法和文件大小',
|
|
18
|
+
});
|
|
19
|
+
|
|
20
|
+
const scanFailures = Object.freeze({
|
|
21
|
+
scanner_busy:'扫描器繁忙,请稍后重试同一次上传',
|
|
22
|
+
scanner_timeout:'扫描超时,请稍后重试同一次上传',
|
|
23
|
+
scanner_canceled:'扫描已取消,请重试同一次上传',
|
|
24
|
+
worker_unavailable:'服务端扫描程序不可用,请联系平台维护者',
|
|
25
|
+
runtime_unavailable:'服务端扫描运行环境不可用,请联系平台维护者',
|
|
26
|
+
dependency_unavailable:'服务端扫描依赖不可用,请联系平台维护者',
|
|
27
|
+
input_failed:'扫描器读取输入失败,请重试;持续失败时联系平台维护者',
|
|
28
|
+
process_start_failed:'服务端扫描进程启动失败,请联系平台维护者',
|
|
29
|
+
process_failed:'服务端扫描进程异常退出,请重试;持续失败时联系平台维护者',
|
|
30
|
+
output_limit:'扫描结果超过大小限制,请联系平台维护者',
|
|
31
|
+
invalid_report:'服务端扫描报告无效,请联系平台维护者',
|
|
32
|
+
invalid_finding:'服务端扫描返回了无效问题项,请联系平台维护者',
|
|
33
|
+
invalid_receipt:'服务端扫描回执校验失败,请联系平台维护者',
|
|
34
|
+
scan_failed:'文件扫描执行失败,请重试;持续失败时联系平台维护者',
|
|
35
|
+
internal_error:'服务端安全检查发生内部故障,请联系平台维护者',
|
|
36
|
+
});
|
|
37
|
+
|
|
38
|
+
function validAuditPath(value) {
|
|
39
|
+
return typeof value === 'string' && value.length > 0 && value.length <= 1024 &&
|
|
40
|
+
!/[\u0000-\u001f\u007f]/u.test(value) && !value.startsWith('/') && !/^[a-z]:/i.test(value) &&
|
|
41
|
+
!value.includes('\\') && !value.split('/').some(p=>!p || p === '.' || p === '..');
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
export function parseDraftScanFailure(value) {
|
|
45
|
+
if (!value || typeof value !== 'object' || Array.isArray(value) ||
|
|
46
|
+
value.kind !== 'upload_security_unavailable' || typeof value.reason !== 'string' || !Object.hasOwn(scanFailures,value.reason) ||
|
|
47
|
+
(value.path !== undefined && !validAuditPath(value.path))) return;
|
|
48
|
+
return {reason:value.reason,...(value.path ? {path:value.path} : {}),
|
|
49
|
+
message:'Craft 上传安全检查未完成:' + scanFailures[value.reason] + '。'};
|
|
50
|
+
}
|
|
3
51
|
|
|
4
52
|
// Treat the receipt as untrusted data. Return only the public review fields,
|
|
5
53
|
// never upstream messages, source text or the server's internal audit metadata.
|
|
@@ -14,10 +62,8 @@ export function parseDraftAudit(value, uploadState) {
|
|
|
14
62
|
!['uploaded','draft_ready','expired'].includes(uploadState)) throw new Error('Craft 返回的上传检查状态无效');
|
|
15
63
|
const findings = value.findings ?? [];
|
|
16
64
|
if (!Array.isArray(findings) || findings.length > 32 ||
|
|
17
|
-
findings.some(f=>!f ||
|
|
18
|
-
/[\u0000-\u001f\u007f]/u.test(f.path) || f.path.startsWith('/') || f.path.includes('\\') ||
|
|
19
|
-
f.path.split('/').some(p=>!p || p === '.' || p === '..')) ||
|
|
65
|
+
findings.some(f=>!f || typeof f.rule !== 'string' || !Object.hasOwn(rules,f.rule) || !validAuditPath(f.path)) ||
|
|
20
66
|
((value.state === 'rejected') !== (findings.length > 0))) throw new Error('Craft 返回的上传检查结果无效');
|
|
21
67
|
return { state:value.state,policy_version:value.policy_version,total:value.total,completed:value.completed,
|
|
22
|
-
...(findings.length ? {findings:findings.map(({path,rule})=>({path,rule}))} : {}) };
|
|
68
|
+
...(findings.length ? {findings:findings.map(({path,rule})=>({path,rule,message:rules[rule]}))} : {}) };
|
|
23
69
|
}
|
package/package.json
CHANGED
|
@@ -1,12 +1,13 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@craft_eco/craft-mcp",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.7",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"engines": {
|
|
6
6
|
"node": ">=22.12.0"
|
|
7
7
|
},
|
|
8
8
|
"craft": {
|
|
9
|
-
"platform": "https://test.craft.qq.com"
|
|
9
|
+
"platform": "https://test.craft.qq.com",
|
|
10
|
+
"source_sha256": "6c6ae5e369d01c0777d6ea217a28c8078cc7ae86cc3c1269284bb6a47a6c395c"
|
|
10
11
|
},
|
|
11
12
|
"scripts": {
|
|
12
13
|
"start": "node bin/craft-mcp.mjs"
|
|
@@ -30,7 +31,7 @@
|
|
|
30
31
|
"type": "git",
|
|
31
32
|
"url": "https://git.woa.com/EcoGame/WXUP/WXUPAgent/CraftCli.git"
|
|
32
33
|
},
|
|
33
|
-
"gitHead": "
|
|
34
|
+
"gitHead": "72796844a8da386cedc1437683970bb4b938d8ed",
|
|
34
35
|
"bin": {
|
|
35
36
|
"craft-mcp": "bin/craft-mcp.mjs"
|
|
36
37
|
},
|
|
@@ -6,6 +6,8 @@ description: 使用 Craft 创建 2D、3D 游戏或玩法原型,上传已有游
|
|
|
6
6
|
<!-- craft-mcp:bootstrap:v1 -->
|
|
7
7
|
# 使用 Craft 创建或上传游戏
|
|
8
8
|
|
|
9
|
+
本 Skill frontmatter 的 name 去掉末尾的 `-create` 或 `-update` 即为 MCP 服务名。普通请求使用默认服务 `craft`;用户明确选择了其他实例或项目已绑定其渠道时,使用对应入口。首次调用该服务的 `craft_game_info` 核对 server_id、渠道、实际版本和工作区,同次制作、轮询、上传、更新与重连沿用该服务。
|
|
10
|
+
|
|
9
11
|
上传已有游戏、更新原云端项目或发布时,先在当前会话发现 Craft MCP 工具,调用 `craft_game_info(name)` 核对当前目录与配置的工作区。有效 Craft 工程按 `craft_game_prepare(mode="resume")` 恢复。Unreal 网页包按工程的 .uproject 使用 `craft_unreal_upload`,用 `craft_unreal_upload_status` 查询。JS 和 JS3D 工程读取该宿主引擎目录的 `knowledge/Publishing.md`。纯上传走 `craft_game_check(purpose="upload")` 和 `craft_game_upload`。当前工具未提供该检查模式时,先核对版本并按更新指引重连。普通 JS 工程不支持直接导入,报告工具给出的路径和缺项。用户指定 Craft MCP 时,工具受阻就报告具体错误;改用 Computer Use、GM 控制台或网页编辑器上传须另获用户同意。
|
|
10
12
|
|
|
11
13
|
用户要预览 Unreal 游戏、打开网页或获取链接时,先调用 `craft_unreal_preview`,传当前工程或用户指定工程的 `.uproject` 绝对路径。新会话也能按工程找回已导出的包。轮询 `craft_task_status` 并交付链接;如果找不到包,告诉用户需要先导出。
|
|
@@ -6,6 +6,8 @@ description: 检查或更新 Craft MCP,核对当前连接的运行版本,恢
|
|
|
6
6
|
<!-- craft-mcp:update:v1 -->
|
|
7
7
|
# 更新 Craft
|
|
8
8
|
|
|
9
|
+
本 Skill frontmatter 的 name 去掉末尾的 `-create` 或 `-update` 即为 MCP 服务名。普通请求使用默认服务 `craft`;用户明确选择了其他实例或项目已绑定其渠道时,使用对应入口。首次调用该服务的 `craft_game_info` 核对 server_id、渠道、实际版本和工作区,同次制作、轮询、上传、更新与重连沿用该服务。
|
|
10
|
+
|
|
9
11
|
先确认当前聊天能发现并调用 Craft 工具。工具未暴露时,使用宿主实际提供的工具发现机制定位准确工具名;仍在连接中则等待就绪后重试一次。仍不可用或调用失败时,保留更新目标和当前工作,报告原始错误并诊断连接,停止新的准备;不能仅据工具缺失判断未安装或升级失败。用户选择的 Craft 流程不能自行改用造化或其他游戏插件替代。
|
|
10
12
|
|
|
11
13
|
进入 Craft 工作流后,每条用户消息使用新的检查 key。同一轮调用支持 `update_request_key` 的业务工具时传这个 key,工具会顺带检查;本轮仅答疑、编辑本地文件或只用轮询等工具时,补一次只读 `craft_update_check`(request_key=本轮 key,已有工程传 name)。制作时,业务回执的 update_notice 或显式检查返回 update_available=true 且 automatic_update_enabled=true,就用同一 key 调用 `craft_update`(mode=auto,已有工程传 name)。纯查看只检查,未发现更新直接继续。同一目标版本待重连时只提示一次。新建或恢复工作时,prepare 的 request_key 使用本轮 key;该操作重试沿用原 request_key。继续已有工作沿用 work_id。新版在下次启动或用户重连后生效。手动模式仅用于用户明确要求升级。
|
|
@@ -2,30 +2,30 @@
|
|
|
2
2
|
"schema": 1,
|
|
3
3
|
"host": "claude",
|
|
4
4
|
"engine": "unreal",
|
|
5
|
-
"version": "1.0.
|
|
5
|
+
"version": "1.0.6",
|
|
6
6
|
"template": {
|
|
7
7
|
"path": "engines/unreal/project",
|
|
8
8
|
"files": {
|
|
9
9
|
"Config/DefaultEngine.ini": "1936fd8cb7b8235e4003ecc033f10c7b4b42b9ebbf11f55edc6da4dd9becfeb3",
|
|
10
10
|
"Config/DefaultGame.ini": "8b6d4ddebbca62076d5e4e0b75523fc9beda83591dc8433a42a522cb32b915b0",
|
|
11
|
-
"Config/DefaultWebPublisher.ini": "
|
|
12
|
-
"Config/README.md": "
|
|
11
|
+
"Config/DefaultWebPublisher.ini": "3674c73943f1e2c01d0d1af8ccff9a3fcf26dbcc1e41f3811308177eca096814",
|
|
12
|
+
"Config/README.md": "a6dd52e2f571419a85f0912a86a23cc5bbb6e3ad5d9192574ffdd5db00abde53",
|
|
13
13
|
"Config/WasmWebGL2/WasmWebGL2Engine.ini": "7aa7e7dee79ce267d767958a74c0705742459c8c2243cfdeb7ce35c6f2d20f60",
|
|
14
14
|
"Config/WasmWebGPU/WasmWebGPUEngine.ini": "a6daa27e970bb03d7e3a832bcf25f3500deda27cc5bea7e7f267301a7ad2430b",
|
|
15
15
|
"Config/WasmWebGPUMobile/WasmWebGPUMobileEngine.ini": "dc0d24ed0222e2404fa36a6318009ab8e6023266917a7b70eb1b8fb7440c0712",
|
|
16
16
|
"Content/Maps/WebStart.umap": "b223fa8e8737c2e812bbf0ef35f81667bf719035c191ee49d5abf5efd45337b5",
|
|
17
17
|
"Plugins/WebPublisher/Source/WebPublisher/Private/WebPublisherCommandlets.cpp": "e9cf10b8a9c50e30ccb8d85c51b55cde88712c5a2c9b6a2765ad34f6273e89aa",
|
|
18
|
-
"Plugins/WebPublisher/Source/WebPublisher/Private/WebPublisherModule.cpp": "
|
|
18
|
+
"Plugins/WebPublisher/Source/WebPublisher/Private/WebPublisherModule.cpp": "965e2097cd4574cf4d7e9227b2795e39de830b88c0467c036de47945a927dcc3",
|
|
19
19
|
"Plugins/WebPublisher/Source/WebPublisher/Public/WebPublisherCommandlets.h": "bc013c2948b07543ad305064db70bd7b7fe69b786bd62060715b1e5723cc281c",
|
|
20
20
|
"Plugins/WebPublisher/Source/WebPublisher/WebPublisher.Build.cs": "6757cd4fef21aec3fd5e9437c95b327e1a68b473ae42dc62c439f67ac056e478",
|
|
21
21
|
"Plugins/WebPublisher/WebPublisher.uplugin": "543efa54e61c955551b310a06486c46148960f6e3f20717824ccedefbe0cddf8",
|
|
22
|
-
"Source/WebStarter.Target.cs": "4c240203433c0bef0626d66e8f9fde02922eee44194b5c0f1194ded676a52c9e",
|
|
23
22
|
"Source/WebStarter/CraftGameplayProbe.cpp": "8c7dcd35a6d4a7d3af17815c84dda792d0bda1a63af3238f916d46244a68ffc0",
|
|
24
23
|
"Source/WebStarter/CraftGameplayProbe.h": "08a82ff0fc21be238c7c6181cb9f7658277a24114793306f80298f64baf9eb26",
|
|
25
24
|
"Source/WebStarter/WebStarter.Build.cs": "f28d10abd74bba643c2eeb5aad36dcab3cdb6dad0bc2ebb50f8bb45a2443ebdb",
|
|
26
25
|
"Source/WebStarter/WebStarter.cpp": "c4d172fff4f49193be7e31a0651d3d9dc778001c4a25bec275b4dcd301e1ec16",
|
|
26
|
+
"Source/WebStarter.Target.cs": "4c240203433c0bef0626d66e8f9fde02922eee44194b5c0f1194ded676a52c9e",
|
|
27
27
|
"Source/WebStarterEditor.Target.cs": "948a23490a67c36366ea28728a975fc6b7355d32a5279187611e7a1c9aefd68d",
|
|
28
|
-
"template.json": "
|
|
28
|
+
"template.json": "cfb44bfbaa60550ce78c449523bfebcb4c9f6e710f225b34f5152b0152d30fd2",
|
|
29
29
|
"WebStarter.uproject": "f93c2fd6b7b7c5fca9d53c4f2036f411349d81515ce474beec8475d00a87f8e8"
|
|
30
30
|
}
|
|
31
31
|
}
|
|
@@ -2,8 +2,8 @@
|
|
|
2
2
|
"schema": 2,
|
|
3
3
|
"engine": "unreal",
|
|
4
4
|
"host": "claude",
|
|
5
|
-
"version": "1.0.
|
|
6
|
-
"source_revision": "sha256:
|
|
5
|
+
"version": "1.0.6",
|
|
6
|
+
"source_revision": "sha256:d398930c79630bc568b0a8b8c47bbd4b72bee4c216aa324f01986c801c3455e5",
|
|
7
7
|
"contracts": {
|
|
8
8
|
"export": 1,
|
|
9
9
|
"skills": 1,
|
|
@@ -17,7 +17,7 @@
|
|
|
17
17
|
"template_version": 2,
|
|
18
18
|
"runtime_pipeline_policy": 3,
|
|
19
19
|
"craft_bridge": 1,
|
|
20
|
-
"template_digest": "
|
|
20
|
+
"template_digest": "d5327f5fb81fd14448609b8f341378fb0fba4c58d2c616cc7cb427b1c4cc52de"
|
|
21
21
|
},
|
|
22
22
|
"files": {
|
|
23
23
|
"unreal/context/AGENTS.md": "5dfcbd72869e397fe036f76570e38f1a85286ffa45a1a9e341739680ce9b0d03",
|
|
@@ -34,19 +34,19 @@
|
|
|
34
34
|
"unreal/context/skills/unreal-editor/SKILL.md": "97e925cc2e73092644f2b6707027aafdb35b7c6bcc8f417c4606be50a72d512b",
|
|
35
35
|
"unreal/context/skills/unreal-editor/scripts/probe.py": "d3de64a4283d72fa4a4e8f2569724e1accfed8e3ee893d6646e8394e1470ef74",
|
|
36
36
|
"unreal/context/web/knowledge/Runtime.md": "84255a6e148ee4a90663196f92677071c27db91e20d6b080bbbdcda4443098c4",
|
|
37
|
-
"unreal/context/web/knowledge/WebBuild.md": "
|
|
37
|
+
"unreal/context/web/knowledge/WebBuild.md": "c1e52a87fe7b45e5bbb0a99c86c00b2c713f5f31191677b1b8a51f6983f4748e",
|
|
38
38
|
"unreal/context/web/skills/unreal-build/SKILL.md": "fb39ad5444fe2985e9a7e023d455b3c2e99009bd571a887f83feb6699a00b613",
|
|
39
39
|
"unreal/context/web/skills/unreal-verify/SKILL.md": "bdaf5efabd299d46782bcde32f961ee969ca49d5158767942dc8f478f8fd8f83",
|
|
40
40
|
"unreal/project/Config/DefaultEngine.ini": "1936fd8cb7b8235e4003ecc033f10c7b4b42b9ebbf11f55edc6da4dd9becfeb3",
|
|
41
41
|
"unreal/project/Config/DefaultGame.ini": "8b6d4ddebbca62076d5e4e0b75523fc9beda83591dc8433a42a522cb32b915b0",
|
|
42
|
-
"unreal/project/Config/DefaultWebPublisher.ini": "
|
|
43
|
-
"unreal/project/Config/README.md": "
|
|
42
|
+
"unreal/project/Config/DefaultWebPublisher.ini": "3674c73943f1e2c01d0d1af8ccff9a3fcf26dbcc1e41f3811308177eca096814",
|
|
43
|
+
"unreal/project/Config/README.md": "a6dd52e2f571419a85f0912a86a23cc5bbb6e3ad5d9192574ffdd5db00abde53",
|
|
44
44
|
"unreal/project/Config/WasmWebGL2/WasmWebGL2Engine.ini": "7aa7e7dee79ce267d767958a74c0705742459c8c2243cfdeb7ce35c6f2d20f60",
|
|
45
45
|
"unreal/project/Config/WasmWebGPU/WasmWebGPUEngine.ini": "a6daa27e970bb03d7e3a832bcf25f3500deda27cc5bea7e7f267301a7ad2430b",
|
|
46
46
|
"unreal/project/Config/WasmWebGPUMobile/WasmWebGPUMobileEngine.ini": "dc0d24ed0222e2404fa36a6318009ab8e6023266917a7b70eb1b8fb7440c0712",
|
|
47
47
|
"unreal/project/Content/Maps/WebStart.umap": "b223fa8e8737c2e812bbf0ef35f81667bf719035c191ee49d5abf5efd45337b5",
|
|
48
48
|
"unreal/project/Plugins/WebPublisher/Source/WebPublisher/Private/WebPublisherCommandlets.cpp": "e9cf10b8a9c50e30ccb8d85c51b55cde88712c5a2c9b6a2765ad34f6273e89aa",
|
|
49
|
-
"unreal/project/Plugins/WebPublisher/Source/WebPublisher/Private/WebPublisherModule.cpp": "
|
|
49
|
+
"unreal/project/Plugins/WebPublisher/Source/WebPublisher/Private/WebPublisherModule.cpp": "965e2097cd4574cf4d7e9227b2795e39de830b88c0467c036de47945a927dcc3",
|
|
50
50
|
"unreal/project/Plugins/WebPublisher/Source/WebPublisher/Public/WebPublisherCommandlets.h": "bc013c2948b07543ad305064db70bd7b7fe69b786bd62060715b1e5723cc281c",
|
|
51
51
|
"unreal/project/Plugins/WebPublisher/Source/WebPublisher/WebPublisher.Build.cs": "6757cd4fef21aec3fd5e9437c95b327e1a68b473ae42dc62c439f67ac056e478",
|
|
52
52
|
"unreal/project/Plugins/WebPublisher/WebPublisher.uplugin": "543efa54e61c955551b310a06486c46148960f6e3f20717824ccedefbe0cddf8",
|
|
@@ -57,12 +57,12 @@
|
|
|
57
57
|
"unreal/project/Source/WebStarter.Target.cs": "4c240203433c0bef0626d66e8f9fde02922eee44194b5c0f1194ded676a52c9e",
|
|
58
58
|
"unreal/project/Source/WebStarterEditor.Target.cs": "948a23490a67c36366ea28728a975fc6b7355d32a5279187611e7a1c9aefd68d",
|
|
59
59
|
"unreal/project/WebStarter.uproject": "f93c2fd6b7b7c5fca9d53c4f2036f411349d81515ce474beec8475d00a87f8e8",
|
|
60
|
-
"unreal/project/template.json": "
|
|
60
|
+
"unreal/project/template.json": "cfb44bfbaa60550ce78c449523bfebcb4c9f6e710f225b34f5152b0152d30fd2",
|
|
61
61
|
"craft-game-maker/SKILL.md": "0d418af4a84177e98fad5c2a1d36f120345655594760ae084e1ac3884647cac5",
|
|
62
62
|
"craft-game-maker/unreal.md": "b6c61e4cd236442856898cfbf9c3fafb1602f10c81160d8c9d76cfdc72f29be3",
|
|
63
|
-
"target.json": "
|
|
63
|
+
"target.json": "c4b69bd7e00968b826f9105b7c6fa6df7563f692a36de9121fb7ac9e322b2f74",
|
|
64
64
|
"bootstrap/SKILL.md": "de7e03850fa6eec48718bab5e31b758dac84de7ffe0061b48e522c3e2c9bdf22",
|
|
65
65
|
"recovery.md": "56ac76f429053b3e1a6f09541aa4723fc222d922d67fad94aceb340788df708b"
|
|
66
66
|
},
|
|
67
|
-
"id": "
|
|
67
|
+
"id": "d5f39e08557a3d2bd7c146beb1c7b6b5405a74ff44fcf0334aa49fbd1ab551f7"
|
|
68
68
|
}
|
|
@@ -1,20 +1,20 @@
|
|
|
1
1
|
# Web 构建排错
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
Craft 每次 Web 构建从官方 [LastVersion.txt](https://file.craft.qq.com/WXUPSDK/Version/LastVersion.txt) 选择最新发行包,通过 `Prepare` 复用同版完整安装或下载并校验 SDK 与配套模板;失败时报告本次日志,不回退旧版。当前构建要求 UE 5.8.4、运行管线策略 3 和 WebStarter 模板版本 2。只读查询和预览已有包使用本机已安装 SDK,不触发下载。已启用 WebPublisher 且配置齐全的工程可直接构建,需要补配置或安装插件时由 Craft 在导出副本中处理。Cook 使用 SDK 自带的 WebPublisher。
|
|
4
4
|
|
|
5
5
|
沿用原工程的游戏及编辑器目标、启动地图和 Cook 规则。目标有歧义或需显式选择地图时,仅在导出副本使用用户选定的目标或现有地图,保留源工程地图和配置。启用的插件默认保留并交给 SDK 校验,只有作者明确标为可省略的制作工具或用户指定排除的插件,才可在副本中排除。[官方已有工程接入说明](https://git.woa.com/EcoGame/WXUP/WXUPAgent/team_agent_context_sdk/-/blob/cfb49e6f6bc517d86139037763820a3065d05b1d/unreal/.agents/knowledge/WebSDK.md#手动接入已有工程)
|
|
6
6
|
|
|
7
7
|
## SDK 环境与手工配置
|
|
8
8
|
|
|
9
|
-
已有工程报环境错误时,调用 `craft_game_info(web_operation="existing_project_export")`,读取 `environment.issues` 和 `environment.config_file`。受管 WebStarter 的构建环境使用 `managed_project_build`。环境 ready
|
|
9
|
+
已有工程报环境错误时,调用 `craft_game_info(web_operation="existing_project_export")`,读取 `environment.issues` 和 `environment.config_file`。受管 WebStarter 的构建环境使用 `managed_project_build`。环境 ready 仅表示当前本机静态条件满足,实际构建仍会选择最新发行包。
|
|
10
10
|
|
|
11
|
-
|
|
11
|
+
需要指定编辑器,或为查询、预览配置已有 SDK 时,再手工配置。WebStarter 模板随 Craft 安装包提供,编辑器与 SDK 的绝对路径保存在本机。
|
|
12
12
|
|
|
13
|
-
1.
|
|
14
|
-
2. 在返回的 `environment.config_file` 中设置 `schema=1
|
|
13
|
+
1. 查询或预览可复用已安装的 `Packages/SDK`,其根目录应直接包含 `sdk.json`、`toolchain.json`、`Engine` 和 `Tools`。手动配置 `sdk_root` 不固定后续构建的版本;构建仍自动选择官方最新发行包。
|
|
14
|
+
2. 在返回的 `environment.config_file` 中设置 `schema=1` 和 `editor_root`,保留其他有效配置。`editor_root` 指向包含 `Engine` 的 UE 5.8.4 根目录;查询或预览使用已有 SDK 时,另将 `sdk_root` 指向上一步的 SDK 根目录。可设置 `variants=["WasmWebGL2=DXT"]`。Windows 默认配置文件为 `%LOCALAPPDATA%\CraftWorkBuddy\unreal.json`;指定其他配置文件时,在启动 MCP 的环境中设置绝对路径 `CRAFT_UNREAL_CONFIG`,随后重新连接。
|
|
15
15
|
3. 用相同的 `web_operation` 复查版本和缺失文件,环境就绪后重试原任务。
|
|
16
16
|
|
|
17
|
-
|
|
17
|
+
SDK 安装或版本校验失败时检查本次日志与官方发行清单,不通过手动固定旧版绕过失败。
|
|
18
18
|
|
|
19
19
|
## 构建与加载失败
|
|
20
20
|
|
|
@@ -2,30 +2,30 @@
|
|
|
2
2
|
"schema": 1,
|
|
3
3
|
"host": "codebuddy",
|
|
4
4
|
"engine": "unreal",
|
|
5
|
-
"version": "1.0.
|
|
5
|
+
"version": "1.0.6",
|
|
6
6
|
"template": {
|
|
7
7
|
"path": "engines/unreal/project",
|
|
8
8
|
"files": {
|
|
9
9
|
"Config/DefaultEngine.ini": "1936fd8cb7b8235e4003ecc033f10c7b4b42b9ebbf11f55edc6da4dd9becfeb3",
|
|
10
10
|
"Config/DefaultGame.ini": "8b6d4ddebbca62076d5e4e0b75523fc9beda83591dc8433a42a522cb32b915b0",
|
|
11
|
-
"Config/DefaultWebPublisher.ini": "
|
|
12
|
-
"Config/README.md": "
|
|
11
|
+
"Config/DefaultWebPublisher.ini": "3674c73943f1e2c01d0d1af8ccff9a3fcf26dbcc1e41f3811308177eca096814",
|
|
12
|
+
"Config/README.md": "a6dd52e2f571419a85f0912a86a23cc5bbb6e3ad5d9192574ffdd5db00abde53",
|
|
13
13
|
"Config/WasmWebGL2/WasmWebGL2Engine.ini": "7aa7e7dee79ce267d767958a74c0705742459c8c2243cfdeb7ce35c6f2d20f60",
|
|
14
14
|
"Config/WasmWebGPU/WasmWebGPUEngine.ini": "a6daa27e970bb03d7e3a832bcf25f3500deda27cc5bea7e7f267301a7ad2430b",
|
|
15
15
|
"Config/WasmWebGPUMobile/WasmWebGPUMobileEngine.ini": "dc0d24ed0222e2404fa36a6318009ab8e6023266917a7b70eb1b8fb7440c0712",
|
|
16
16
|
"Content/Maps/WebStart.umap": "b223fa8e8737c2e812bbf0ef35f81667bf719035c191ee49d5abf5efd45337b5",
|
|
17
17
|
"Plugins/WebPublisher/Source/WebPublisher/Private/WebPublisherCommandlets.cpp": "e9cf10b8a9c50e30ccb8d85c51b55cde88712c5a2c9b6a2765ad34f6273e89aa",
|
|
18
|
-
"Plugins/WebPublisher/Source/WebPublisher/Private/WebPublisherModule.cpp": "
|
|
18
|
+
"Plugins/WebPublisher/Source/WebPublisher/Private/WebPublisherModule.cpp": "965e2097cd4574cf4d7e9227b2795e39de830b88c0467c036de47945a927dcc3",
|
|
19
19
|
"Plugins/WebPublisher/Source/WebPublisher/Public/WebPublisherCommandlets.h": "bc013c2948b07543ad305064db70bd7b7fe69b786bd62060715b1e5723cc281c",
|
|
20
20
|
"Plugins/WebPublisher/Source/WebPublisher/WebPublisher.Build.cs": "6757cd4fef21aec3fd5e9437c95b327e1a68b473ae42dc62c439f67ac056e478",
|
|
21
21
|
"Plugins/WebPublisher/WebPublisher.uplugin": "543efa54e61c955551b310a06486c46148960f6e3f20717824ccedefbe0cddf8",
|
|
22
|
-
"Source/WebStarter.Target.cs": "4c240203433c0bef0626d66e8f9fde02922eee44194b5c0f1194ded676a52c9e",
|
|
23
22
|
"Source/WebStarter/CraftGameplayProbe.cpp": "8c7dcd35a6d4a7d3af17815c84dda792d0bda1a63af3238f916d46244a68ffc0",
|
|
24
23
|
"Source/WebStarter/CraftGameplayProbe.h": "08a82ff0fc21be238c7c6181cb9f7658277a24114793306f80298f64baf9eb26",
|
|
25
24
|
"Source/WebStarter/WebStarter.Build.cs": "f28d10abd74bba643c2eeb5aad36dcab3cdb6dad0bc2ebb50f8bb45a2443ebdb",
|
|
26
25
|
"Source/WebStarter/WebStarter.cpp": "c4d172fff4f49193be7e31a0651d3d9dc778001c4a25bec275b4dcd301e1ec16",
|
|
26
|
+
"Source/WebStarter.Target.cs": "4c240203433c0bef0626d66e8f9fde02922eee44194b5c0f1194ded676a52c9e",
|
|
27
27
|
"Source/WebStarterEditor.Target.cs": "948a23490a67c36366ea28728a975fc6b7355d32a5279187611e7a1c9aefd68d",
|
|
28
|
-
"template.json": "
|
|
28
|
+
"template.json": "cfb44bfbaa60550ce78c449523bfebcb4c9f6e710f225b34f5152b0152d30fd2",
|
|
29
29
|
"WebStarter.uproject": "f93c2fd6b7b7c5fca9d53c4f2036f411349d81515ce474beec8475d00a87f8e8"
|
|
30
30
|
}
|
|
31
31
|
}
|