Build checked component artifacts and shared React session SDK (WI-09)

This commit is contained in:
Timothy J. Aveni
2026-09-21 16:01:48 -07:00
parent 24073d7f2a
commit 2cf53280e4
9 changed files with 104 additions and 5 deletions
+11
View File
@@ -3,6 +3,7 @@ import { generatePortableTypeScriptBindings, generateRemoteTypeScriptBindings }
import { type ExecutionPlan, ExecutionPlanError, hexDigest } from "./plan.js";
import { type ArtifactReader, type PackageArtifacts } from "./artifacts.js";
import { loadArtifactWorld, type LoadedArtifactWorld } from "./files.js";
import { generateComponentClientBindings, componentAssetDeclarations } from "./client-contracts.js";
export interface ArtifactReceipt {
schemaVersion: 1;
@@ -57,6 +58,16 @@ export function expectedArtifactReceipt(
sources.set(path, bytes);
return { target, path, digest: hashBytes(bytes), bytes: bytes.length };
});
if (manifest.components?.length) {
for (const [path, source] of [
["share/quixos/generated/client.ts", generateComponentClientBindings(plan, pkg.revision)],
["share/quixos/generated/component-assets.d.ts", componentAssetDeclarations()],
] as const) {
const bytes = new TextEncoder().encode(source);
sources.set(path, bytes);
generated.push({ target: "window", path, digest: hashBytes(bytes), bytes: bytes.length });
}
}
// Custom language services need no TypeScript adapter. A checked JS module
// exporting remote handlers does, and must carry the exact generated source.
if (