BigPizzaV3/CodexPlusPlus · error

manifest.files 缺少必需文件

Error message

manifest.files 缺少必需文件

What it means

Thrown by validate_manifest_files after the per-file loop when the seen-paths set is missing one of the mandatory package files (theme.json, theme.css, or the background image). The offending input is manifest.files as a whole: the inventory may be internally consistent but incomplete, so the package cannot be installed.

Source

Thrown at crates/codex-plus-core/src/dream_skin_package.rs:1137

        let expected_media_type = match file.path.as_str() {
            "theme.json" => "application/json",
            "theme.css" => "text/css",
            "background.webp" => "image/webp",
            "background.jpg" => "image/jpeg",
            "background.png" => "image/png",
            "LICENSE.txt" => "text/plain",
            _ => "",
        };
        if file.media_type != expected_media_type {
            bail!("manifest.files 的 mediaType 不匹配:{}", file.path);
        }
        let actual = format!("{:x}", Sha256::digest(bytes));
        if file.bytes != bytes.len() || !actual.eq_ignore_ascii_case(&file.sha256) {
            bail!("manifest.files 的 SHA-256 或大小不匹配:{}", file.path);
        }
    }
    if !seen.contains("theme.json") || !seen.contains("theme.css") || !seen.contains(image_name) {
        bail!("manifest.files 缺少必需文件");
    }
    if seen.contains("LICENSE.txt") != license_bytes.is_some() {
        bail!("manifest.files 的 LICENSE.txt 与包内容不一致");
    }
    Ok(())
}

fn valid_theme_id(value: &str) -> bool {
    let mut chars = value.chars();
    chars.next().is_some_and(|c| c.is_ascii_alphanumeric())
        && value
            .chars()
            .all(|c| c.is_ascii_lowercase() || c.is_ascii_digit() || matches!(c, '-' | '.'))
}

fn valid_semver(value: &str) -> bool {
    let parts = value.split('.').collect::<Vec<_>>();
    parts.len() == 3

View on GitHub (pinned to f2074595a2)

Solutions

  1. 在 files 中补全所有必需文件的条目(路径、大小、SHA-256、mediaType)
Defensive patterns

Strategy: validation

When it happens

Trigger: Thrown at crates/codex-plus-core/src/dream_skin_package.rs:1137 when the library encounters an invalid state.

Common situations: See trigger scenarios.


AI-assisted analysis of BigPizzaV3/CodexPlusPlus@f2074595a2 (2026-08-23). Data as JSON: /api/errors/3cd7716dd42df7c9. Report an issue: GitHub.