Files
reverse-engineering-anything/src/domain/analysisSource.ts
T
morluto b97023809f feat(native): retain decompile export source facts (#8805)
* feat(native): retain decompile export source facts

* test(native): verify historical export source facts

* test(native): retain source after export conflict
2026-11-05 01:48:53 +08:00

20 lines
657 B
TypeScript

import { z } from "zod";
import { digestSchema } from "./digests.js";
import { absoluteLocalPathStringSchema } from "./localPath.js";
/** Compact source facts supplied by the provider for one observation. */
export const analysisSourceDescriptorSchema = z.discriminatedUnion("kind", [
z.strictObject({
kind: z.literal("file-range"),
path: absoluteLocalPathStringSchema,
sha256: digestSchema,
byte_offset: z.int().nonnegative(),
byte_length: z.int().nonnegative(),
}),
z.strictObject({ kind: z.literal("single-function-decompile") }),
]);
export type AnalysisSourceDescriptor = z.infer<
typeof analysisSourceDescriptorSchema
>;