feat: auto-deploy guided servers on run registration

This commit is contained in:
npc0-hue
2026-07-28 16:57:09 +08:00
parent e2d0bc0595
commit 7f64765c1c
15 changed files with 191 additions and 55 deletions
@@ -1,7 +1,7 @@
import { describe, expect, it } from "vitest";
import type { GamePluginResponse } from "../api/types";
import { canDeployServer, defaultServerCreateForm, runtimeBindingFields } from "../contracts/serverManagement";
import { defaultServerCreateForm, runtimeBindingFields } from "../contracts/serverManagement";
import { serverCreateRequestFromForm, serverInstanceIdFromName } from "./serverManagement";
const plugin: GamePluginResponse = {
@@ -42,13 +42,6 @@ const plugin: GamePluginResponse = {
};
describe("runtime profile server creation contracts", () => {
it("allows deployment only from draft or failed server states", () => {
expect(canDeployServer("draft")).toBe(true);
expect(canDeployServer("failed")).toBe(true);
expect(canDeployServer("installing")).toBe(false);
expect(canDeployServer("ready")).toBe(false);
});
it("derives logical binding fields from the selected profile", () => {
expect(runtimeBindingFields(plugin, "local")).toEqual([
{ key: "java-runtime", required: false, sensitive: false },