feat: execute route and release recovery contracts

This commit is contained in:
donghyeon-ka
2026-07-26 14:26:39 +09:00
parent a33e93d4d4
commit ce0040e407
49 changed files with 1761 additions and 373 deletions
+19
View File
@@ -9,6 +9,7 @@ import {
} from "../adapters/query-cache/tanstack-query-cache.js";
import { createBrowserStorageAdapter } from "../adapters/storage/browser-storage-adapter.js";
import { createTelemetryAdapter } from "../adapters/telemetry/best-effort-telemetry.js";
import { fetchReleaseManifest } from "./load-release-manifest.js";
/**
* @param {Record<string, unknown>} host
@@ -97,6 +98,23 @@ export async function createRuntimeAdapters(context) {
async getCurrent() {
return structuredClone(context.release);
},
async refresh() {
return fetchReleaseManifest(config.RELEASE_MANIFEST_URL, {
fetcher: context.fetcher,
buildId: context.release.buildId,
releaseId: context.release.releaseId,
});
},
});
const navigation = Object.freeze({
reload() {
const location =
/** @type {{reload?: () => void} | undefined} */ (host.location);
if (typeof location?.reload !== "function") {
throw new Error("Browser reload is unavailable");
}
location.reload();
},
});
return Object.freeze({
@@ -105,6 +123,7 @@ export async function createRuntimeAdapters(context) {
preferences: storage,
diagnostics: telemetry,
releaseInfo,
navigation,
}),
infrastructure: Object.freeze({
queryClient,