refactor(domain): own digest and prefixed identifier shapes in one module (#547)

This commit is contained in:
morluto
2026-10-05 17:29:20 +08:00
committed by GitHub
parent 828395d510
commit ea58834940
56 changed files with 314 additions and 162 deletions
+3 -2
View File
@@ -3,6 +3,7 @@ import { z } from "zod";
import { browserCompletenessSchema } from "./browserCompleteness.js";
import { browserEndpointSchema } from "./browserObservation.js";
import { webTextArtifactSchema } from "./webContentArtifact.js";
import { prefixedDigestSchema } from "./../domain/digests.js";
const approvedElectronInput = {
cdp_endpoint: browserEndpointSchema,
@@ -102,7 +103,7 @@ export const electronPageInspectionSchema = z.object({
total: z.number().int().min(0),
items: z.array(
z.object({
script_key: z.string().regex(/^electron_script_[a-f0-9]{64}$/u),
script_key: prefixedDigestSchema("electron_script"),
frame_id: z.string().nullable().default(null),
file_path: z.string(),
cdp_hash: z.string(),
@@ -115,7 +116,7 @@ export const electronPageInspectionSchema = z.object({
}),
resources: z.array(
z.object({
resource_key: z.string().regex(/^electron_resource_[a-f0-9]{64}$/u),
resource_key: prefixedDigestSchema("electron_resource"),
file_path: z.string(),
type: z.string(),
mime_type: z.string(),