* feat(artifacts): read Godot PCK packs Add a Godot Engine PCK artifact reader for standalone packs and packs embedded behind an executable trailer (formats 2 and 3). Members are uncompressed byte ranges verified against their declared MD5 on read. Encrypted directories, sparse bundles, patch removal entries, unknown flags and format 1 fail closed as unavailable; encrypted members are reported without being read. inspect-artifact and extract-artifact recognize standalone packs by their GDPC magic. Co-Authored-By: Claude Opus 5.5 <[email protected]> * fix(artifacts): bound Godot PCK metadata and own member streams Cap member paths at 4096 bytes and the retained directory at 64 MiB before allocation. Read members with positional chunk reads through pipeline so cancellation is typed, abandoned consumers release their source, and the shared descriptor stays reader-owned. Retain the root descriptor for godot-pck inventory, as for ZIP and universal Mach-O. Co-Authored-By: Claude Opus 5.5 <[email protected]> * feat(artifacts): complete Godot PCK facts, integrity and selected views * fix(artifacts): preserve atomic-root inventory Evidence * fix(artifacts): bound aggregate PCK member expansion --------- Co-authored-by: Samucahub <[email protected]> Co-authored-by: Claude Opus 5.5 <[email protected]> Co-authored-by: gensokyo-dev <[email protected]>
39 lines
1.2 KiB
TypeScript
39 lines
1.2 KiB
TypeScript
import { z } from "zod";
|
|
|
|
const offset = z.number().int().min(0).max(Number.MAX_SAFE_INTEGER);
|
|
const uint32 = z.number().int().min(0).max(0xffff_ffff);
|
|
|
|
/** Parsed source fields owned by the PCK adapter, independent of content hashes. */
|
|
export const godotPckMetadataSchema = z.strictObject({
|
|
kind: z.literal("godot-pck"),
|
|
format_version: uint32,
|
|
engine_major: uint32,
|
|
engine_minor: uint32,
|
|
engine_patch: uint32,
|
|
pack_start: offset,
|
|
pack_end: offset,
|
|
embedded: z.boolean(),
|
|
pack_flags: uint32,
|
|
file_base: offset,
|
|
directory_start: offset,
|
|
declared_file_count: uint32,
|
|
directory_status: z.enum(["available", "encrypted", "sparse-bundle"]),
|
|
});
|
|
export type GodotPckMetadata = z.infer<typeof godotPckMetadataSchema>;
|
|
|
|
export const godotPckEntryMetadataSchema = z.strictObject({
|
|
kind: z.literal("godot-pck-entry"),
|
|
index: uint32,
|
|
source_path: z.string(),
|
|
declared_offset: offset,
|
|
flags: uint32,
|
|
md5_status: z.enum(["declared", "all-zero"]),
|
|
});
|
|
export const artifactFormatMetadataSchema = z.discriminatedUnion("kind", [
|
|
godotPckMetadataSchema,
|
|
godotPckEntryMetadataSchema,
|
|
]);
|
|
export type ArtifactFormatMetadata = z.infer<
|
|
typeof artifactFormatMetadataSchema
|
|
>;
|