astrid-runtime/astrid · error

Unknown project type

Error message

Unknown project type: {unknown}. Supported types: rust, mcp, extension

What it means

Dispatch guard in run_build: the detected or explicitly supplied project type matched none of the supported builders (rust, mcp, extension). The adjacent js/ts/node and static arms bail with their own not-yet-implemented messages, so this error means the type detector returned an unrecognized string or the user forced an unsupported type — a supported-types whitelist violation at routing time.

Solutions

  1. Pass `--type rust`, `--type mcp`, or `--type extension`
  2. Omit `--type` so detection infers the type from manifest files
  3. Fix any typo in the --type value
Defensive patterns

Strategy: validation

When it happens

Trigger: Thrown at crates/astrid-build/src/build.rs:52 when the library encounters an invalid state.

Common situations: See trigger scenarios.


AI-assisted analysis of astrid-runtime/astrid@affd8760f4 (2026-09-09). Data as JSON: /api/errors/ba1a5e0a26cbcb42. Report an issue: GitHub.

Appendix: source

Thrown at crates/astrid-build/src/build.rs:52

    } else {
        detect_project_type(&target_dir)?
    };

    info!("Detected project type: {detected_type}");

    // Route to the appropriate builder
    match detected_type.as_str() {
        "rust" => crate::rust::build(&target_dir, output)?,
        "mcp" => crate::mcp::convert(&target_dir, "mcp.json", output)?,
        "extension" => crate::mcp::convert(&target_dir, "gemini-extension.json", output)?,
        "js" | "ts" | "node" => {
            bail!("Native JS/TS capsule SDK is not yet implemented.");
        },
        "static" => {
            bail!("Static No-Code building is not yet implemented in the CLI.");
        },
        unknown => {
            bail!(
                "Unknown project type: {unknown}. \
                 Supported types: rust, mcp, extension"
            );
        },
    }

    Ok(())
}

fn detect_project_type(dir: &Path) -> Result<String> {
    if dir.join("Cargo.toml").exists() {
        return Ok("rust".to_string());
    }

    if dir.join("gemini-extension.json").exists() {
        return Ok("extension".to_string());
    }

View on GitHub (pinned to affd8760f4)