feat(launcher): launch the game through the guarded lab

This commit is contained in:
N0VAN0M4LY committed 2026-11-29 15:02:39 +08:00
1 parent d633280e23
commit e41b73aaa3
25 files changed
+920 -23

No files matched your search

@@ -0,0 +1,22 @@
import { z } from 'zod';
import { APP_ERROR_CODES } from '../errors.ts';
export const LaunchStateSchema = z.object({
phase: z.enum([
'ready', 'checking', 'building', 'starting-server', 'starting-game', 'running',
'stopping', 'port-busy', 'version-changed', 'server-exited', 'failed',
]),
port: z.number().int().min(1).max(65535).optional(),
filesWritten: z.number().int().nonnegative().optional(),
filesTotal: z.number().int().nonnegative().optional(),
file: z.string().optional(),
actualVersion: z.string().nullable().optional(),
error: z.enum(APP_ERROR_CODES).optional(),
});
export type LaunchState = z.output<typeof LaunchStateSchema>;
export const LabInfoSchema = z.object({
copyPath: z.string(),
port: z.number().int().min(1).max(65535),
});