This commit is contained in:
Kelorastus
2026-09-30 12:27:14 +02:00
parent e4aeb6794e
commit 20227eda0e
8 changed files with 109 additions and 20 deletions
+11 -1
View File
@@ -12,9 +12,12 @@
let password = $state("");
let withApi = $state(true);
// Off by default, deliberately: it serves /download/* and proxies /dhp, so it is the one
// step that interrupts the road everything else publishes over.
let withMcp = $state(false);
async function release() {
await launcher.releaseRun(password, withApi);
await launcher.releaseRun(password, withApi, withMcp);
password = ""; // held for the one run, never kept
}
@@ -79,6 +82,13 @@
<em>— every operator is logged out</em>
</span>
</label>
<label class="check">
<input type="checkbox" bind:checked={withMcp} disabled={!plan.docker || busy} />
<span>
Also deploy the MCP server{plan.docker ? "" : " — needs Docker"}
<em>— runs last; it serves the download feeds</em>
</span>
</label>
<div class="row">
<input
class="input"
+1 -1
View File
@@ -72,7 +72,7 @@ function createTauriBackend(): Backend {
onStatus: (handler) => subscribe<Status>("status", handler),
onInstallProgress: (handler) => subscribe<InstallProgress>("install-progress", handler),
releasePlan: () => invoke<ReleasePlan>("release_plan"),
releaseRun: (password, withApi) => invoke<void>("release_run", { password, withApi }),
releaseRun: (password, withApi, withMcp) => invoke<void>("release_run", { password, withApi, withMcp }),
onTileSyncProgress: (handler) => subscribe<TileSyncProgress>("tile-sync-progress", handler),
onRemoveProgress: (handler) => subscribe<RemoveProgress>("remove-progress", handler),
onStack: (handler) => subscribe<StackEvent>("stack", handler),
+2 -2
View File
@@ -414,9 +414,9 @@ class Launcher {
});
}
releaseRun(password: string, withApi: boolean) {
releaseRun(password: string, withApi: boolean, withMcp: boolean) {
return this.run("release", async () => {
await backend.releaseRun(password, withApi);
await backend.releaseRun(password, withApi, withMcp);
this.releaseOpen = false;
});
}
+4 -2
View File
@@ -777,14 +777,16 @@ class MockBackend implements Backend {
dirty: false, note: "up to date" },
{ key: "api", title: "Engine API", live: null, commit: "a1b2c3d", behind: null,
dirty: false, note: "what is published does not say which commit it came from" },
{ key: "mcp", title: "MCP server", live: null, commit: "c7d8e9f", behind: null,
dirty: false, note: "the script asks the node whether it is already running this commit" },
],
};
}
async releaseRun(password: string, withApi: boolean): Promise<void> {
async releaseRun(password: string, withApi: boolean, withMcp: boolean): Promise<void> {
await this.wait(400);
if (!password.trim()) throw "The node's sudo password is needed to cut a pack and to roll the API.";
this.log("info", `Release started in its own window (browser mock: nothing runs). API: ${withApi}`);
this.log("info", `Release started in its own window (browser mock: nothing runs). API ${withApi}, MCP ${withMcp}`);
}
async syncNow(): Promise<void> {
+1 -1
View File
@@ -374,7 +374,7 @@ export interface Backend {
/** Take the tiles the DHP baked while this PC was away. */
syncTiles(): Promise<void>;
releasePlan(): Promise<ReleasePlan>;
releaseRun(password: string, withApi: boolean): Promise<void>;
releaseRun(password: string, withApi: boolean, withMcp: boolean): Promise<void>;
/** What the operator has to decide, oldest first. */
getSyncConflicts(): Promise<SyncConflict[]>;
/** Records one decision; resolves with what is left to decide. */