diff --git a/plugins/examples/scum-server-plugin/manifest.json b/plugins/examples/scum-server-plugin/manifest.json index 5e0d485..1bdc49c 100644 --- a/plugins/examples/scum-server-plugin/manifest.json +++ b/plugins/examples/scum-server-plugin/manifest.json @@ -3,7 +3,7 @@ "id": "game.scum", "name": "SCUM Server", "description": "First-party SCUM game server operations plugin with platform-mediated lifecycle and companion bridge support.", - "version": "0.1.4", + "version": "0.1.5", "kind": "game-plugin", "tags": [ "scum", @@ -374,8 +374,8 @@ "approvalRequired": ["disable", "rollback", "retire"] }, "pages": [ - { "key": "files-config", "title": "文件管理", "path": "/files-config", "bundleKey": "scum-server-plugin", "bundleVersion": "1.0.3", "bundleIntegritySha256": "sha256:797c4e303c102f0316e71e4e5bda50a6ca96506a7cb368a42ecf858b236609b2", "permissions": ["server.read", "server.files.read", "server.files.write", "server.logs.read"], "bridgeActions": ["server.instances.read", "files.request", "logs.query"], "featureKeys": ["config.manage"] }, - { "key": "players", "title": "用户管理", "path": "/players", "bundleKey": "scum-server-plugin", "bundleVersion": "1.0.3", "bundleIntegritySha256": "sha256:797c4e303c102f0316e71e4e5bda50a6ca96506a7cb368a42ecf858b236609b2", "permissions": ["server.read", "server.game-client.read", "server.game-client.command"], "bridgeActions": ["server.instances.read"], "featureKeys": ["player.intelligence", "state.patch"] }, + { "key": "files-config", "title": "文件管理", "path": "/files-config", "bundleKey": "scum-server-plugin", "bundleVersion": "1.0.3", "bundleIntegritySha256": "sha256:797c4e303c102f0316e71e4e5bda50a6ca96506a7cb368a42ecf858b236609b2", "permissions": ["server.read", "server.files.read", "server.files.write", "server.logs.read", "server.game-client.read", "server.game-client.command", "server.game-client.maintenance"], "bridgeActions": ["server.instances.read", "files.request", "logs.query"], "featureKeys": ["config.manage"] }, + { "key": "players", "title": "用户管理", "path": "/players", "bundleKey": "scum-server-plugin", "bundleVersion": "1.0.3", "bundleIntegritySha256": "sha256:797c4e303c102f0316e71e4e5bda50a6ca96506a7cb368a42ecf858b236609b2", "permissions": ["server.read", "server.game-client.read", "server.game-client.command", "server.game-client.maintenance"], "bridgeActions": ["server.instances.read"], "featureKeys": ["player.intelligence", "state.patch"] }, { "key": "squads", "title": "队伍管理", "path": "/squads", "bundleKey": "scum-server-plugin", "bundleVersion": "1.0.3", "bundleIntegritySha256": "sha256:797c4e303c102f0316e71e4e5bda50a6ca96506a7cb368a42ecf858b236609b2", "permissions": ["server.read", "server.game-client.read"], "bridgeActions": ["server.instances.read"], "featureKeys": ["player.intelligence"] }, { "key": "live-map", "title": "实时地图", "path": "/live-map", "bundleKey": "scum-server-plugin", "bundleVersion": "1.0.3", "bundleIntegritySha256": "sha256:797c4e303c102f0316e71e4e5bda50a6ca96506a7cb368a42ecf858b236609b2", "permissions": ["server.read", "server.game-client.read"], "bridgeActions": ["server.instances.read"], "featureKeys": ["trajectory.collect"] }, { "key": "gifts", "title": "礼包管理", "path": "/gifts", "bundleKey": "scum-server-plugin", "bundleVersion": "1.0.3", "bundleIntegritySha256": "sha256:797c4e303c102f0316e71e4e5bda50a6ca96506a7cb368a42ecf858b236609b2", "permissions": ["server.read", "server.game-client.read", "server.game-client.command"], "bridgeActions": ["server.instances.read"], "featureKeys": ["reward.delivery"] } diff --git a/plugins/tests/manifest-validation.test.ts b/plugins/tests/manifest-validation.test.ts index 4df0747..4cc4b79 100644 --- a/plugins/tests/manifest-validation.test.ts +++ b/plugins/tests/manifest-validation.test.ts @@ -441,7 +441,7 @@ describe("plugin manifest validation", () => { snapshots: Array<{ type: string; schemaVersion: string; schemaRef: string }>; pages: Array<{ pageKey: string; commandTypes?: string[]; snapshotTypes?: string[] }>; }; - pages: Array<{ key: string }>; + pages: Array<{ key: string; permissions?: string[] }>; fileWorkspace?: { defaultDirectoryKey: string; directories: Array<{ key: string; label: string; scope: string }>; @@ -459,11 +459,13 @@ describe("plugin manifest validation", () => { health?: { intervalSeconds?: number; degradedAfterSeconds?: number; offlineAfterSeconds?: number }; }>; }; + version: string; }; const installAction = JSON.parse(fs.readFileSync(path.join(pluginsRoot, "examples/scum-server-plugin/actions/install.json"), "utf8")) as { environment?: Record }; const serialized = JSON.stringify(manifest).toLowerCase(); expect(serialized).not.toContain("local-proof"); + expect(manifest.version).toBe("0.1.5"); expect(installAction.environment?.SERVER_TEMPLATE).toBe("scum-server"); expect(manifest.permissions).toEqual(expect.arrayContaining(["server.game-client.read", "server.game-client.command", "server.game-client.maintenance"])); expect(manifest.gameClientBridge.commands.map((command) => command.type)).toEqual(expect.arrayContaining([ @@ -487,6 +489,8 @@ describe("plugin manifest validation", () => { "maintenance.prepare" ])); expect(manifest.pages.map((page) => page.key)).toEqual(expect.arrayContaining(["files-config", "players", "squads", "live-map", "gifts"])); + expect(manifest.pages.find((page) => page.key === "files-config")?.permissions).toEqual(expect.arrayContaining(["server.game-client.read", "server.game-client.command", "server.game-client.maintenance"])); + expect(manifest.pages.find((page) => page.key === "players")?.permissions).toEqual(expect.arrayContaining(["server.game-client.read", "server.game-client.command", "server.game-client.maintenance"])); expect(manifest.fileWorkspace?.defaultDirectoryKey).toBe("scum-config"); expect(manifest.fileWorkspace?.directories.map((directory) => directory.key)).toEqual(["scum-config", "scum-logs"]); expect(manifest.fileWorkspace?.files.map((file) => file.key)).toEqual(expect.arrayContaining(["scum-server-settings", "scum-game-config", "scum-engine-config", "scum-game-user-settings", "scum-admin-log", "scum-chat-log", "scum-kill-log", "scum-login-log", "scum-server-log"])); diff --git a/scripts/local-debug/smoke.sh b/scripts/local-debug/smoke.sh index 6c60044..20d5607 100755 --- a/scripts/local-debug/smoke.sh +++ b/scripts/local-debug/smoke.sh @@ -306,6 +306,7 @@ const missing = []; const declaredPermissions = Array.isArray(plugin.declaredPermissions) ? plugin.declaredPermissions : []; const bridgeActions = Array.isArray(plugin.bridgeActions) ? plugin.bridgeActions : []; const lifecycleProfiles = plugin.runtimeProfiles?.lifecycleProfiles ?? []; +const pageKeys = (plugin.pages ?? []).map((page) => page.key); if (plugin.version !== expectedVersion) { missing.push(`version ${expectedVersion}`); } @@ -321,6 +322,11 @@ if (!lifecycleProfiles.some((profile) => profile.key === "run-local")) { if (!plugin.gameClientBridge?.commands?.length) { missing.push("game client bridge declarations"); } +for (const pageKey of ["files-config", "players", "squads", "live-map", "gifts"]) { + if (!pageKeys.includes(pageKey)) { + missing.push(`SCUM page ${pageKey}`); + } +} if (missing.length > 0) { console.error(`SCUM plugin registration is stale or incomplete: missing ${missing.join(", ")}`); console.error("Run scripts/dev-reset.sh, restart the local debug stack, then rerun scripts/dev-smoke.sh."); @@ -777,7 +783,7 @@ const manifest = { gameClientBridge: localGameClientBridge }; fs.writeFileSync(outputPath, JSON.stringify({ - manifestRef: "artifact://manifests/game.scum/0.1.0", + manifestRef: `artifact://manifests/game.scum/${source.version}`, manifest, assetFiles: readAssetFiles(source) }, null, 2));