{"record":{"id":"351a794da53c03f7","repo":"astrid-runtime/astrid","slug":"could-not-automatically-detect-the-project-type-p","errorCode":null,"errorMessage":"Could not automatically detect the project type. Please ensure a Cargo.toml, gemini-extension.json, package.json, or Capsule.toml exists in the directory, or use the --type flag.","messagePattern":"Could not automatically detect the project type\\. Please ensure a Cargo\\.toml, gemini-extension\\.json, package\\.json, or Capsule\\.toml exists in the directory, or use the --type flag\\.","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"crates/astrid-build/src/build.rs","lineNumber":83,"sourceCode":"    }\n\n    if dir.join(\"gemini-extension.json\").exists() {\n        return Ok(\"extension\".to_string());\n    }\n\n    if dir.join(\"package.json\").exists() {\n        return Ok(\"js\".to_string());\n    }\n\n    if dir.join(\"mcp.json\").exists() {\n        return Ok(\"mcp\".to_string());\n    }\n\n    if dir.join(\"Capsule.toml\").exists() {\n        return Ok(\"static\".to_string());\n    }\n\n    bail!(\n        \"Could not automatically detect the project type. \\\n         Please ensure a Cargo.toml, gemini-extension.json, \\\n         package.json, or Capsule.toml exists in the directory, or use the --type flag.\"\n    );\n}\n\n#[cfg(test)]\nmod tests {\n    use crate::archiver::pack_capsule_archive;\n    use std::fs;\n    use std::path::Path;\n\n    /// Unpack a .capsule archive into a directory (mirrors install.rs logic).\n    fn unpack_capsule(archive_path: &Path, dest: &Path) {\n        let tar_gz = fs::File::open(archive_path).unwrap();\n        let decoder = flate2::read::GzDecoder::new(tar_gz);\n        let mut archive = tar::Archive::new(decoder);\n","sourceCodeStart":65,"sourceCodeEnd":101,"githubUrl":"https://github.com/astrid-runtime/astrid/blob/affd8760f44190dbdfbec23403f4c4b642c33112/crates/astrid-build/src/build.rs#L65-L101","documentation":"Error \"Could not automatically detect the project type. Please ensure a Cargo.toml, gemini-extension.json, package.json, or Capsule.toml exists in the directory, or use the --type flag.\" thrown in astrid-runtime/astrid.","triggerScenarios":"Thrown at crates/astrid-build/src/build.rs:83 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["cd into the directory containing Cargo.toml, gemini-extension.json, package.json, mcp.json, or Capsule.toml","Create the appropriate manifest file for your project type","Pass the project type explicitly with `--type`"],"exampleFix":null,"handlingStrategy":"validation","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"affd8760f44190dbdfbec23403f4c4b642c33112","analyzedAt":"2026-09-09T21:28:12.402Z","contentChangedAt":"2026-09-09T21:28:12.402Z","schemaVersion":2},"datasetVersion":"2026-09-17T15:17:12.973Z"}