load("@crates//:defs.bzl", "aliases", "all_crate_deps")

load("@rules_rust//rust:defs.bzl", "rust_binary", "rust_library", "rust_proc_macro", "rust_test")



filegroup(

    name = "cargo_manifest",

    srcs = ["Cargo.toml"],

    visibility = ["//visibility:public"],

)



filegroup(

    name = "package_runfiles",

    srcs = glob(["Cargo.toml", "**/*"], exclude = ["BUILD", "BUILD.bazel"], allow_empty = True),

    visibility = ["//visibility:public"],

)



rust_library(
    name = "meerkat_core",
    aliases = aliases(package_name = "meerkat-core"),
    crate_name = "meerkat_core",
    crate_root = "src/lib.rs",
    crate_features = [
        "jsonschema",
        "schema",
    ],
    edition = "2024",
    compile_data = [
        "Cargo.toml",
        "src/config_template.toml",
    ],
    srcs = glob(["src/**/*.rs"]),
    visibility = ["//visibility:public"],
    rustc_env = {
        "CARGO_PKG_VERSION": "0.6.14",
        "CARGO_MANIFEST_DIR": "./meerkat-core",
    },
    proc_macro_deps = all_crate_deps(
        package_name = "meerkat-core",
        proc_macro = True,
    ),
    deps = all_crate_deps(
        package_name = "meerkat-core",
        normal = True,
    ),
)

rust_library(
    name = "meerkat_core_agent_factory_build",
    aliases = aliases(package_name = "meerkat-core"),
    crate_name = "meerkat_core",
    crate_root = "src/lib.rs",
    crate_features = [
        "jsonschema",
        "schema",
    ],
    edition = "2024",
    rustc_flags = ["--cfg=meerkat_internal_agent_factory_build"],
    compile_data = [
        "Cargo.toml",
        "src/config_template.toml",
    ],
    srcs = glob(["src/**/*.rs"]),
    visibility = [
        "//meerkat:__pkg__",
    ],
    rustc_env = {
        "CARGO_PKG_VERSION": "0.6.14",
        "CARGO_MANIFEST_DIR": "./meerkat-core",
        "MEERKAT_AGENT_FACTORY_POLICY_BRIDGE_SYMBOL_SUFFIX": "bazel_private_agent_factory_build",
    },
    proc_macro_deps = all_crate_deps(
        package_name = "meerkat-core",
        proc_macro = True,
    ),
    deps = all_crate_deps(
        package_name = "meerkat-core",
        normal = True,
    ),
)

rust_test(
    name = "meerkat_core_unit_test",
    aliases = aliases(
        package_name = "meerkat-core",
        normal = True,
        normal_dev = True,
        proc_macro = True,
        proc_macro_dev = True,
    ),
    crate_name = "meerkat_core",
    crate_root = "src/lib.rs",
    crate_features = [
        "__meerkat-facade-agent-factory-build",
        "jsonschema",
        "schema",
    ],
    edition = "2024",
    compile_data = [
        "Cargo.toml",
        "src/config_template.toml",
    ],
    srcs = glob(["src/**/*.rs"]),
    visibility = ["//visibility:public"],
    rustc_env = {
        "CARGO_PKG_VERSION": "0.6.14",
        "CARGO_MANIFEST_DIR": "./meerkat-core",
    },
    tags = [
        "fast",
        "unit",
    ],
    size = "small",
    data = [
        ":package_runfiles",
    ],
    env = {
        "RUST_MIN_STACK": "16777216",
    },
    proc_macro_deps = all_crate_deps(
        package_name = "meerkat-core",
        proc_macro = True,
        proc_macro_dev = True,
    ),
    deps = all_crate_deps(
        package_name = "meerkat-core",
        normal = True,
        normal_dev = True,
    ),
)

rust_test(
    name = "auth_binding_no_string_form_test",
    aliases = aliases(
        package_name = "meerkat-core",
        normal = True,
        normal_dev = True,
        proc_macro = True,
        proc_macro_dev = True,
    ),
    crate_name = "auth_binding_no_string_form",
    crate_root = "tests/auth_binding_no_string_form.rs",
    crate_features = [
        "__meerkat-facade-agent-factory-build",
        "jsonschema",
        "schema",
    ],
    edition = "2024",
    compile_data = [
        "Cargo.toml",
        "src/config_template.toml",
    ],
    srcs = [
        "tests/auth_binding_no_string_form.rs",
    ],
    visibility = ["//visibility:public"],
    rustc_env = {
        "CARGO_PKG_VERSION": "0.6.14",
        "CARGO_BIN_NAME": "auth_binding_no_string_form",
        "CARGO_MANIFEST_DIR": "./meerkat-core",
    },
    tags = [
        "fast",
    ],
    size = "small",
    data = [],
    env = {
        "RUST_MIN_STACK": "16777216",
    },
    proc_macro_deps = all_crate_deps(
        package_name = "meerkat-core",
        proc_macro = True,
        proc_macro_dev = True,
    ),
    deps = [
        "//meerkat-core:meerkat_core",
    ] + all_crate_deps(
        package_name = "meerkat-core",
        normal = True,
        normal_dev = True,
    ),
)

rust_test(
    name = "fork_at_rotates_session_id_test",
    aliases = aliases(
        package_name = "meerkat-core",
        normal = True,
        normal_dev = True,
        proc_macro = True,
        proc_macro_dev = True,
    ),
    crate_name = "fork_at_rotates_session_id",
    crate_root = "tests/fork_at_rotates_session_id.rs",
    crate_features = [
        "__meerkat-facade-agent-factory-build",
        "jsonschema",
        "schema",
    ],
    edition = "2024",
    compile_data = [
        "Cargo.toml",
        "src/config_template.toml",
    ],
    srcs = [
        "tests/fork_at_rotates_session_id.rs",
    ],
    visibility = ["//visibility:public"],
    rustc_env = {
        "CARGO_PKG_VERSION": "0.6.14",
        "CARGO_BIN_NAME": "fork_at_rotates_session_id",
        "CARGO_MANIFEST_DIR": "./meerkat-core",
    },
    tags = [
        "fast",
    ],
    size = "small",
    data = [
        ":package_runfiles",
    ],
    env = {
        "RUST_MIN_STACK": "16777216",
    },
    proc_macro_deps = all_crate_deps(
        package_name = "meerkat-core",
        proc_macro = True,
        proc_macro_dev = True,
    ),
    deps = [
        "//meerkat-core:meerkat_core",
    ] + all_crate_deps(
        package_name = "meerkat-core",
        normal = True,
        normal_dev = True,
    ),
)

rust_test(
    name = "hooks_contracts_test",
    aliases = aliases(
        package_name = "meerkat-core",
        normal = True,
        normal_dev = True,
        proc_macro = True,
        proc_macro_dev = True,
    ),
    crate_name = "hooks_contracts",
    crate_root = "tests/hooks_contracts.rs",
    crate_features = [
        "__meerkat-facade-agent-factory-build",
        "jsonschema",
        "schema",
    ],
    edition = "2024",
    compile_data = [
        "Cargo.toml",
        "src/config_template.toml",
    ],
    srcs = [
        "tests/hooks_contracts.rs",
    ],
    visibility = ["//visibility:public"],
    rustc_env = {
        "CARGO_PKG_VERSION": "0.6.14",
        "CARGO_BIN_NAME": "hooks_contracts",
        "CARGO_MANIFEST_DIR": "./meerkat-core",
    },
    tags = [
        "fast",
    ],
    size = "small",
    data = [
        ":package_runfiles",
        "//:test_fixtures",
        "//test-fixtures/machine-dsl-tests:package_runfiles",
        "//test-fixtures/mcp-test-server:package_runfiles",
        "//test-fixtures/surface-build-fixtures:package_runfiles",
    ],
    env = {
        "RUST_MIN_STACK": "16777216",
    },
    proc_macro_deps = all_crate_deps(
        package_name = "meerkat-core",
        proc_macro = True,
        proc_macro_dev = True,
    ),
    deps = [
        "//meerkat-core:meerkat_core",
    ] + all_crate_deps(
        package_name = "meerkat-core",
        normal = True,
        normal_dev = True,
    ),
)

rust_test(
    name = "image_generation_contracts_test",
    aliases = aliases(
        package_name = "meerkat-core",
        normal = True,
        normal_dev = True,
        proc_macro = True,
        proc_macro_dev = True,
    ),
    crate_name = "image_generation_contracts",
    crate_root = "tests/image_generation_contracts.rs",
    crate_features = [
        "__meerkat-facade-agent-factory-build",
        "jsonschema",
        "schema",
    ],
    edition = "2024",
    compile_data = [
        "Cargo.toml",
        "src/config_template.toml",
    ],
    srcs = [
        "tests/image_generation_contracts.rs",
    ],
    visibility = ["//visibility:public"],
    rustc_env = {
        "CARGO_PKG_VERSION": "0.6.14",
        "CARGO_BIN_NAME": "image_generation_contracts",
        "CARGO_MANIFEST_DIR": "./meerkat-core",
    },
    tags = [
        "fast",
    ],
    size = "small",
    data = [],
    env = {
        "RUST_MIN_STACK": "16777216",
    },
    proc_macro_deps = all_crate_deps(
        package_name = "meerkat-core",
        proc_macro = True,
        proc_macro_dev = True,
    ),
    deps = [
        "//meerkat-core:meerkat_core",
    ] + all_crate_deps(
        package_name = "meerkat-core",
        normal = True,
        normal_dev = True,
    ),
)

rust_test(
    name = "ops_lifecycle_integration_test",
    aliases = aliases(
        package_name = "meerkat-core",
        normal = True,
        normal_dev = True,
        proc_macro = True,
        proc_macro_dev = True,
    ),
    crate_name = "ops_lifecycle_integration",
    crate_root = "tests/ops_lifecycle_integration.rs",
    crate_features = [
        "__meerkat-facade-agent-factory-build",
        "jsonschema",
        "schema",
    ],
    edition = "2024",
    compile_data = [
        "Cargo.toml",
        "src/config_template.toml",
    ],
    srcs = [
        "tests/ops_lifecycle_integration.rs",
    ],
    visibility = ["//visibility:public"],
    rustc_env = {
        "CARGO_PKG_VERSION": "0.6.14",
        "CARGO_BIN_NAME": "ops_lifecycle_integration",
        "CARGO_MANIFEST_DIR": "./meerkat-core",
    },
    tags = [
        "integration",
    ],
    data = [],
    env = {
        "RUST_MIN_STACK": "16777216",
    },
    proc_macro_deps = all_crate_deps(
        package_name = "meerkat-core",
        proc_macro = True,
        proc_macro_dev = True,
    ),
    deps = [
        "//meerkat-core:meerkat_core",
    ] + all_crate_deps(
        package_name = "meerkat-core",
        normal = True,
        normal_dev = True,
    ),
)

rust_test(
    name = "rct_contracts_test",
    aliases = aliases(
        package_name = "meerkat-core",
        normal = True,
        normal_dev = True,
        proc_macro = True,
        proc_macro_dev = True,
    ),
    crate_name = "rct_contracts",
    crate_root = "tests/rct_contracts.rs",
    crate_features = [
        "__meerkat-facade-agent-factory-build",
        "jsonschema",
        "schema",
    ],
    edition = "2024",
    compile_data = [
        "Cargo.toml",
        "src/config_template.toml",
    ],
    srcs = [
        "tests/rct_contracts.rs",
    ],
    visibility = ["//visibility:public"],
    rustc_env = {
        "CARGO_PKG_VERSION": "0.6.14",
        "CARGO_BIN_NAME": "rct_contracts",
        "CARGO_MANIFEST_DIR": "./meerkat-core",
    },
    tags = [
        "fast",
    ],
    size = "small",
    data = [
        "//meerkat:package_runfiles",
    ],
    env = {
        "RUST_MIN_STACK": "16777216",
    },
    proc_macro_deps = all_crate_deps(
        package_name = "meerkat-core",
        proc_macro = True,
        proc_macro_dev = True,
    ),
    deps = [
        "//meerkat-core:meerkat_core",
    ] + all_crate_deps(
        package_name = "meerkat-core",
        normal = True,
        normal_dev = True,
    ),
)

rust_test(
    name = "realm_connection_config_test",
    aliases = aliases(
        package_name = "meerkat-core",
        normal = True,
        normal_dev = True,
        proc_macro = True,
        proc_macro_dev = True,
    ),
    crate_name = "realm_connection_config",
    crate_root = "tests/realm_connection_config.rs",
    crate_features = [
        "__meerkat-facade-agent-factory-build",
        "jsonschema",
        "schema",
    ],
    edition = "2024",
    compile_data = [
        "Cargo.toml",
        "src/config_template.toml",
    ],
    srcs = [
        "tests/realm_connection_config.rs",
    ],
    visibility = ["//visibility:public"],
    rustc_env = {
        "CARGO_PKG_VERSION": "0.6.14",
        "CARGO_BIN_NAME": "realm_connection_config",
        "CARGO_MANIFEST_DIR": "./meerkat-core",
    },
    tags = [
        "fast",
    ],
    size = "small",
    data = [],
    env = {
        "RUST_MIN_STACK": "16777216",
    },
    proc_macro_deps = all_crate_deps(
        package_name = "meerkat-core",
        proc_macro = True,
        proc_macro_dev = True,
    ),
    deps = [
        "//meerkat-core:meerkat_core",
    ] + all_crate_deps(
        package_name = "meerkat-core",
        normal = True,
        normal_dev = True,
    ),
)

rust_test(
    name = "runtime_turn_metadata_typed_round_trip_test",
    aliases = aliases(
        package_name = "meerkat-core",
        normal = True,
        normal_dev = True,
        proc_macro = True,
        proc_macro_dev = True,
    ),
    crate_name = "runtime_turn_metadata_typed_round_trip",
    crate_root = "tests/runtime_turn_metadata_typed_round_trip.rs",
    crate_features = [
        "__meerkat-facade-agent-factory-build",
        "jsonschema",
        "schema",
    ],
    edition = "2024",
    compile_data = [
        "Cargo.toml",
        "src/config_template.toml",
    ],
    srcs = [
        "tests/runtime_turn_metadata_typed_round_trip.rs",
    ],
    visibility = ["//visibility:public"],
    rustc_env = {
        "CARGO_PKG_VERSION": "0.6.14",
        "CARGO_BIN_NAME": "runtime_turn_metadata_typed_round_trip",
        "CARGO_MANIFEST_DIR": "./meerkat-core",
    },
    tags = [
        "fast",
    ],
    size = "small",
    data = [],
    env = {
        "RUST_MIN_STACK": "16777216",
    },
    proc_macro_deps = all_crate_deps(
        package_name = "meerkat-core",
        proc_macro = True,
        proc_macro_dev = True,
    ),
    deps = [
        "//meerkat-core:meerkat_core",
    ] + all_crate_deps(
        package_name = "meerkat-core",
        normal = True,
        normal_dev = True,
    ),
)

rust_test(
    name = "source_identity_resolve_enforces_lifecycle_test",
    aliases = aliases(
        package_name = "meerkat-core",
        normal = True,
        normal_dev = True,
        proc_macro = True,
        proc_macro_dev = True,
    ),
    crate_name = "source_identity_resolve_enforces_lifecycle",
    crate_root = "tests/source_identity_resolve_enforces_lifecycle.rs",
    crate_features = [
        "__meerkat-facade-agent-factory-build",
        "jsonschema",
        "schema",
    ],
    edition = "2024",
    compile_data = [
        "Cargo.toml",
        "src/config_template.toml",
    ],
    srcs = [
        "tests/source_identity_resolve_enforces_lifecycle.rs",
    ],
    visibility = ["//visibility:public"],
    rustc_env = {
        "CARGO_PKG_VERSION": "0.6.14",
        "CARGO_BIN_NAME": "source_identity_resolve_enforces_lifecycle",
        "CARGO_MANIFEST_DIR": "./meerkat-core",
    },
    tags = [
        "fast",
    ],
    size = "small",
    data = [],
    env = {
        "RUST_MIN_STACK": "16777216",
    },
    proc_macro_deps = all_crate_deps(
        package_name = "meerkat-core",
        proc_macro = True,
        proc_macro_dev = True,
    ),
    deps = [
        "//meerkat-core:meerkat_core",
    ] + all_crate_deps(
        package_name = "meerkat-core",
        normal = True,
        normal_dev = True,
    ),
)

rust_test(
    name = "tool_notice_projection_test",
    aliases = aliases(
        package_name = "meerkat-core",
        normal = True,
        normal_dev = True,
        proc_macro = True,
        proc_macro_dev = True,
    ),
    crate_name = "tool_notice_projection",
    crate_root = "tests/tool_notice_projection.rs",
    crate_features = [
        "__meerkat-facade-agent-factory-build",
        "jsonschema",
        "schema",
    ],
    edition = "2024",
    compile_data = [
        "Cargo.toml",
        "src/config_template.toml",
    ],
    srcs = [
        "tests/tool_notice_projection.rs",
    ],
    visibility = ["//visibility:public"],
    rustc_env = {
        "CARGO_PKG_VERSION": "0.6.14",
        "CARGO_BIN_NAME": "tool_notice_projection",
        "CARGO_MANIFEST_DIR": "./meerkat-core",
    },
    tags = [
        "fast",
    ],
    size = "small",
    data = [],
    env = {
        "RUST_MIN_STACK": "16777216",
    },
    proc_macro_deps = all_crate_deps(
        package_name = "meerkat-core",
        proc_macro = True,
        proc_macro_dev = True,
    ),
    deps = [
        "//meerkat-core:meerkat_core",
    ] + all_crate_deps(
        package_name = "meerkat-core",
        normal = True,
        normal_dev = True,
    ),
)

test_suite(
    name = "fast_tests",
    tests = [
        ":auth_binding_no_string_form_test",
        ":fork_at_rotates_session_id_test",
        ":hooks_contracts_test",
        ":image_generation_contracts_test",
        ":meerkat_core_unit_test",
        ":rct_contracts_test",
        ":realm_connection_config_test",
        ":runtime_turn_metadata_typed_round_trip_test",
        ":source_identity_resolve_enforces_lifecycle_test",
        ":tool_notice_projection_test",
    ],
)
