feat(runtime): establish miniapp kernel and sdk design

This commit is contained in:
2026-08-05 00:46:16 +08:00
parent d8aa087bc8
commit 9fb8cd1598
86 changed files with 4615 additions and 1364 deletions
@@ -0,0 +1,13 @@
import { describe, expect, it } from "vitest";
import { ArtifactContentCache } from "@/runtime/artifacts/artifact-content-cache";
describe("ArtifactContentCache", () => {
it("accepts only host-owned opaque references and never exposes paths", () => {
const cache = new ArtifactContentCache();
expect(cache.put("artifact-cache-001", new Blob(["verified bytes"]))).toBe(true);
expect(cache.has("artifact-cache-001")).toBe(true);
expect(cache.get("artifact-cache-001")?.size).toBe(14);
expect(cache.put("/tmp/report.pdf", new Blob(["x"]))).toBe(false);
expect(cache.has("/tmp/report.pdf")).toBe(false);
});
});