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_mob",
    aliases = aliases(package_name = "meerkat-mob"),
    crate_name = "meerkat_mob",
    crate_root = "src/lib.rs",
    crate_features = [
        "integration-real-tests",
        "runtime-adapter",
    ],
    edition = "2024",
    compile_data = [
        "Cargo.toml",
        "src/runtime/actor.rs",
        "src/runtime/builder.rs",
        "src/runtime/flow_frame_engine.rs",
        "src/runtime/recovery.rs",
    ],
    srcs = glob(["src/**/*.rs"]),
    visibility = ["//visibility:public"],
    rustc_env = {
        "CARGO_PKG_VERSION": "0.6.7",
        "CARGO_MANIFEST_DIR": "./meerkat-mob",
    },
    proc_macro_deps = [
        "//meerkat-machine-derive:meerkat_machine_derive",
        "//meerkat-machine-dsl:meerkat_machine_dsl",
    ] + all_crate_deps(
        package_name = "meerkat-mob",
        proc_macro = True,
    ),
    deps = [
        "//meerkat:meerkat",
        "//meerkat:meerkat_client_agent_factory_build",
        "//meerkat:meerkat_comms_agent_factory_build",
        "//meerkat:meerkat_contracts_agent_factory_build",
        "//meerkat:meerkat_core_agent_factory_build",
        "//meerkat:meerkat_machine_kernels_agent_factory_build",
        "//meerkat:meerkat_machine_schema_agent_factory_build",
        "//meerkat:meerkat_runtime_agent_factory_build",
        "//meerkat:meerkat_session_agent_factory_build",
    ] + all_crate_deps(
        package_name = "meerkat-mob",
        normal = True,
    ),
)

rust_test(
    name = "meerkat_mob_unit_test",
    aliases = aliases(
        package_name = "meerkat-mob",
        normal = True,
        normal_dev = True,
        proc_macro = True,
        proc_macro_dev = True,
    ),
    crate_name = "meerkat_mob",
    crate_root = "src/lib.rs",
    crate_features = [
        "integration-real-tests",
        "runtime-adapter",
    ],
    edition = "2024",
    compile_data = [
        "Cargo.toml",
        "src/runtime/actor.rs",
        "src/runtime/builder.rs",
        "src/runtime/flow_frame_engine.rs",
        "src/runtime/recovery.rs",
    ],
    srcs = glob(["src/**/*.rs"]),
    visibility = ["//visibility:public"],
    rustc_env = {
        "CARGO_PKG_VERSION": "0.6.7",
        "CARGO_MANIFEST_DIR": "./meerkat-mob",
    },
    tags = [
        "fast",
        "unit",
    ],
    size = "large",
    data = [
        ":package_runfiles",
    ],
    env = {
        "RUST_MIN_STACK": "16777216",
    },
    proc_macro_deps = [
        "//meerkat-machine-derive:meerkat_machine_derive",
        "//meerkat-machine-dsl:meerkat_machine_dsl",
    ] + all_crate_deps(
        package_name = "meerkat-mob",
        proc_macro = True,
        proc_macro_dev = True,
    ),
    deps = [
        "//meerkat:meerkat",
        "//meerkat:meerkat_client_agent_factory_build",
        "//meerkat:meerkat_comms_agent_factory_build",
        "//meerkat:meerkat_contracts_agent_factory_build",
        "//meerkat:meerkat_core_agent_factory_build",
        "//meerkat:meerkat_machine_kernels_agent_factory_build",
        "//meerkat:meerkat_machine_schema_agent_factory_build",
        "//meerkat:meerkat_runtime_agent_factory_build",
        "//meerkat:meerkat_session_agent_factory_build",
        "//meerkat:meerkat_store_agent_factory_build",
    ] + all_crate_deps(
        package_name = "meerkat-mob",
        normal = True,
        normal_dev = True,
    ),
)

rust_test(
    name = "dispatcher_rule_synthetic_injection_test",
    aliases = aliases(
        package_name = "meerkat-mob",
        normal = True,
        normal_dev = True,
        proc_macro = True,
        proc_macro_dev = True,
    ),
    crate_name = "dispatcher_rule_synthetic_injection",
    crate_root = "tests/dispatcher_rule_synthetic_injection.rs",
    crate_features = [
        "integration-real-tests",
        "runtime-adapter",
    ],
    edition = "2024",
    compile_data = [
        "Cargo.toml",
        "src/runtime/actor.rs",
        "src/runtime/builder.rs",
        "src/runtime/flow_frame_engine.rs",
        "src/runtime/recovery.rs",
    ],
    srcs = [
        "tests/dispatcher_rule_synthetic_injection.rs",
    ],
    visibility = ["//visibility:public"],
    rustc_env = {
        "CARGO_PKG_VERSION": "0.6.7",
        "CARGO_BIN_NAME": "dispatcher_rule_synthetic_injection",
        "CARGO_MANIFEST_DIR": "./meerkat-mob",
    },
    tags = [
        "fast",
    ],
    size = "small",
    data = [
        "//xtask:package_runfiles",
    ],
    env = {
        "RUST_MIN_STACK": "16777216",
    },
    proc_macro_deps = [
        "//meerkat-machine-derive:meerkat_machine_derive",
        "//meerkat-machine-dsl:meerkat_machine_dsl",
    ] + all_crate_deps(
        package_name = "meerkat-mob",
        proc_macro = True,
        proc_macro_dev = True,
    ),
    deps = [
        "//meerkat-mob:meerkat_mob",
        "//meerkat:meerkat",
        "//meerkat:meerkat_client_agent_factory_build",
        "//meerkat:meerkat_comms_agent_factory_build",
        "//meerkat:meerkat_contracts_agent_factory_build",
        "//meerkat:meerkat_core_agent_factory_build",
        "//meerkat:meerkat_machine_kernels_agent_factory_build",
        "//meerkat:meerkat_machine_schema_agent_factory_build",
        "//meerkat:meerkat_runtime_agent_factory_build",
        "//meerkat:meerkat_session_agent_factory_build",
        "//meerkat:meerkat_store_agent_factory_build",
    ] + all_crate_deps(
        package_name = "meerkat-mob",
        normal = True,
        normal_dev = True,
    ),
)

rust_test(
    name = "flow_frame_recovery_tests_test",
    aliases = aliases(
        package_name = "meerkat-mob",
        normal = True,
        normal_dev = True,
        proc_macro = True,
        proc_macro_dev = True,
    ),
    crate_name = "flow_frame_recovery_tests",
    crate_root = "tests/flow_frame_recovery_tests.rs",
    crate_features = [
        "integration-real-tests",
        "runtime-adapter",
    ],
    edition = "2024",
    compile_data = [
        "Cargo.toml",
        "src/runtime/actor.rs",
        "src/runtime/builder.rs",
        "src/runtime/flow_frame_engine.rs",
        "src/runtime/recovery.rs",
    ],
    srcs = [
        "tests/flow_frame_recovery_tests.rs",
    ],
    visibility = ["//visibility:public"],
    rustc_env = {
        "CARGO_PKG_VERSION": "0.6.7",
        "CARGO_BIN_NAME": "flow_frame_recovery_tests",
        "CARGO_MANIFEST_DIR": "./meerkat-mob",
    },
    tags = [
        "fast",
    ],
    size = "small",
    data = [],
    env = {
        "RUST_MIN_STACK": "16777216",
    },
    proc_macro_deps = [
        "//meerkat-machine-derive:meerkat_machine_derive",
        "//meerkat-machine-dsl:meerkat_machine_dsl",
    ] + all_crate_deps(
        package_name = "meerkat-mob",
        proc_macro = True,
        proc_macro_dev = True,
    ),
    deps = [
        "//meerkat-mob:meerkat_mob",
        "//meerkat:meerkat",
        "//meerkat:meerkat_client_agent_factory_build",
        "//meerkat:meerkat_comms_agent_factory_build",
        "//meerkat:meerkat_contracts_agent_factory_build",
        "//meerkat:meerkat_core_agent_factory_build",
        "//meerkat:meerkat_machine_kernels_agent_factory_build",
        "//meerkat:meerkat_machine_schema_agent_factory_build",
        "//meerkat:meerkat_runtime_agent_factory_build",
        "//meerkat:meerkat_session_agent_factory_build",
        "//meerkat:meerkat_store_agent_factory_build",
    ] + all_crate_deps(
        package_name = "meerkat-mob",
        normal = True,
        normal_dev = True,
    ),
)

rust_test(
    name = "member_session_bindings_test",
    aliases = aliases(
        package_name = "meerkat-mob",
        normal = True,
        normal_dev = True,
        proc_macro = True,
        proc_macro_dev = True,
    ),
    crate_name = "member_session_bindings",
    crate_root = "tests/member_session_bindings.rs",
    crate_features = [
        "integration-real-tests",
        "runtime-adapter",
    ],
    edition = "2024",
    compile_data = [
        "Cargo.toml",
        "src/runtime/actor.rs",
        "src/runtime/builder.rs",
        "src/runtime/flow_frame_engine.rs",
        "src/runtime/recovery.rs",
    ],
    srcs = [
        "tests/member_session_bindings.rs",
    ],
    visibility = ["//visibility:public"],
    rustc_env = {
        "CARGO_PKG_VERSION": "0.6.7",
        "CARGO_BIN_NAME": "member_session_bindings",
        "CARGO_MANIFEST_DIR": "./meerkat-mob",
    },
    tags = [
        "fast",
    ],
    size = "small",
    data = [],
    env = {
        "RUST_MIN_STACK": "16777216",
    },
    proc_macro_deps = [
        "//meerkat-machine-derive:meerkat_machine_derive",
        "//meerkat-machine-dsl:meerkat_machine_dsl",
    ] + all_crate_deps(
        package_name = "meerkat-mob",
        proc_macro = True,
        proc_macro_dev = True,
    ),
    deps = [
        "//meerkat-mob:meerkat_mob",
        "//meerkat:meerkat",
        "//meerkat:meerkat_client_agent_factory_build",
        "//meerkat:meerkat_comms_agent_factory_build",
        "//meerkat:meerkat_contracts_agent_factory_build",
        "//meerkat:meerkat_core_agent_factory_build",
        "//meerkat:meerkat_machine_kernels_agent_factory_build",
        "//meerkat:meerkat_machine_schema_agent_factory_build",
        "//meerkat:meerkat_runtime_agent_factory_build",
        "//meerkat:meerkat_session_agent_factory_build",
        "//meerkat:meerkat_store_agent_factory_build",
    ] + all_crate_deps(
        package_name = "meerkat-mob",
        normal = True,
        normal_dev = True,
    ),
)

rust_test(
    name = "mob_orchestrator_kernel_test",
    aliases = aliases(
        package_name = "meerkat-mob",
        normal = True,
        normal_dev = True,
        proc_macro = True,
        proc_macro_dev = True,
    ),
    crate_name = "mob_orchestrator_kernel",
    crate_root = "tests/mob_orchestrator_kernel.rs",
    crate_features = [
        "integration-real-tests",
        "runtime-adapter",
    ],
    edition = "2024",
    compile_data = [
        "Cargo.toml",
        "src/runtime/actor.rs",
        "src/runtime/builder.rs",
        "src/runtime/flow_frame_engine.rs",
        "src/runtime/recovery.rs",
    ],
    srcs = [
        "tests/mob_orchestrator_kernel.rs",
    ],
    visibility = ["//visibility:public"],
    rustc_env = {
        "CARGO_PKG_VERSION": "0.6.7",
        "CARGO_BIN_NAME": "mob_orchestrator_kernel",
        "CARGO_MANIFEST_DIR": "./meerkat-mob",
    },
    tags = [
        "fast",
    ],
    size = "small",
    data = [],
    env = {
        "RUST_MIN_STACK": "16777216",
    },
    proc_macro_deps = [
        "//meerkat-machine-derive:meerkat_machine_derive",
        "//meerkat-machine-dsl:meerkat_machine_dsl",
    ] + all_crate_deps(
        package_name = "meerkat-mob",
        proc_macro = True,
        proc_macro_dev = True,
    ),
    deps = [
        "//meerkat-mob:meerkat_mob",
        "//meerkat:meerkat",
        "//meerkat:meerkat_client_agent_factory_build",
        "//meerkat:meerkat_comms_agent_factory_build",
        "//meerkat:meerkat_contracts_agent_factory_build",
        "//meerkat:meerkat_core_agent_factory_build",
        "//meerkat:meerkat_machine_kernels_agent_factory_build",
        "//meerkat:meerkat_machine_schema_agent_factory_build",
        "//meerkat:meerkat_runtime_agent_factory_build",
        "//meerkat:meerkat_session_agent_factory_build",
        "//meerkat:meerkat_store_agent_factory_build",
    ] + all_crate_deps(
        package_name = "meerkat-mob",
        normal = True,
        normal_dev = True,
    ),
)

rust_test(
    name = "shadow_state_absent_test",
    aliases = aliases(
        package_name = "meerkat-mob",
        normal = True,
        normal_dev = True,
        proc_macro = True,
        proc_macro_dev = True,
    ),
    crate_name = "shadow_state_absent",
    crate_root = "tests/shadow_state_absent.rs",
    crate_features = [
        "integration-real-tests",
        "runtime-adapter",
    ],
    edition = "2024",
    compile_data = [
        "Cargo.toml",
        "src/runtime/actor.rs",
        "src/runtime/builder.rs",
        "src/runtime/flow_frame_engine.rs",
        "src/runtime/recovery.rs",
    ],
    srcs = [
        "tests/shadow_state_absent.rs",
    ],
    visibility = ["//visibility:public"],
    rustc_env = {
        "CARGO_PKG_VERSION": "0.6.7",
        "CARGO_BIN_NAME": "shadow_state_absent",
        "CARGO_MANIFEST_DIR": "./meerkat-mob",
    },
    tags = [
        "fast",
    ],
    size = "small",
    data = [],
    env = {
        "RUST_MIN_STACK": "16777216",
    },
    proc_macro_deps = [
        "//meerkat-machine-derive:meerkat_machine_derive",
        "//meerkat-machine-dsl:meerkat_machine_dsl",
    ] + all_crate_deps(
        package_name = "meerkat-mob",
        proc_macro = True,
        proc_macro_dev = True,
    ),
    deps = [
        "//meerkat-mob:meerkat_mob",
        "//meerkat:meerkat",
        "//meerkat:meerkat_client_agent_factory_build",
        "//meerkat:meerkat_comms_agent_factory_build",
        "//meerkat:meerkat_contracts_agent_factory_build",
        "//meerkat:meerkat_core_agent_factory_build",
        "//meerkat:meerkat_machine_kernels_agent_factory_build",
        "//meerkat:meerkat_machine_schema_agent_factory_build",
        "//meerkat:meerkat_runtime_agent_factory_build",
        "//meerkat:meerkat_session_agent_factory_build",
        "//meerkat:meerkat_store_agent_factory_build",
    ] + all_crate_deps(
        package_name = "meerkat-mob",
        normal = True,
        normal_dev = True,
    ),
)

rust_test(
    name = "smoke_mob_flow_runtime_test",
    aliases = aliases(
        package_name = "meerkat-mob",
        normal = True,
        normal_dev = True,
        proc_macro = True,
        proc_macro_dev = True,
    ),
    crate_name = "smoke_mob_flow_runtime",
    crate_root = "tests/smoke_mob_flow_runtime.rs",
    crate_features = [
        "integration-real-tests",
        "runtime-adapter",
    ],
    edition = "2024",
    compile_data = [
        "Cargo.toml",
        "src/runtime/actor.rs",
        "src/runtime/builder.rs",
        "src/runtime/flow_frame_engine.rs",
        "src/runtime/recovery.rs",
    ],
    srcs = [
        "tests/smoke_mob_flow_runtime.rs",
    ],
    visibility = ["//visibility:public"],
    rustc_env = {
        "CARGO_PKG_VERSION": "0.6.7",
        "CARGO_BIN_NAME": "smoke_mob_flow_runtime",
        "CARGO_MANIFEST_DIR": "./meerkat-mob",
    },
    tags = [
        "integration",
        "required-feature",
    ],
    data = [],
    env = {
        "RUST_MIN_STACK": "16777216",
    },
    proc_macro_deps = [
        "//meerkat-machine-derive:meerkat_machine_derive",
        "//meerkat-machine-dsl:meerkat_machine_dsl",
    ] + all_crate_deps(
        package_name = "meerkat-mob",
        proc_macro = True,
        proc_macro_dev = True,
    ),
    deps = [
        "//meerkat-mob:meerkat_mob",
        "//meerkat:meerkat",
        "//meerkat:meerkat_client_agent_factory_build",
        "//meerkat:meerkat_comms_agent_factory_build",
        "//meerkat:meerkat_contracts_agent_factory_build",
        "//meerkat:meerkat_core_agent_factory_build",
        "//meerkat:meerkat_machine_kernels_agent_factory_build",
        "//meerkat:meerkat_machine_schema_agent_factory_build",
        "//meerkat:meerkat_runtime_agent_factory_build",
        "//meerkat:meerkat_session_agent_factory_build",
        "//meerkat:meerkat_store_agent_factory_build",
    ] + all_crate_deps(
        package_name = "meerkat-mob",
        normal = True,
        normal_dev = True,
    ),
)

rust_test(
    name = "smoke_mob_generated_image_comms_test",
    aliases = aliases(
        package_name = "meerkat-mob",
        normal = True,
        normal_dev = True,
        proc_macro = True,
        proc_macro_dev = True,
    ),
    crate_name = "smoke_mob_generated_image_comms",
    crate_root = "tests/smoke_mob_generated_image_comms.rs",
    crate_features = [
        "integration-real-tests",
        "runtime-adapter",
    ],
    edition = "2024",
    compile_data = [
        "Cargo.toml",
        "src/runtime/actor.rs",
        "src/runtime/builder.rs",
        "src/runtime/flow_frame_engine.rs",
        "src/runtime/recovery.rs",
    ],
    srcs = [
        "tests/smoke_mob_generated_image_comms.rs",
    ],
    visibility = ["//visibility:public"],
    rustc_env = {
        "CARGO_PKG_VERSION": "0.6.7",
        "CARGO_BIN_NAME": "smoke_mob_generated_image_comms",
        "CARGO_MANIFEST_DIR": "./meerkat-mob",
    },
    tags = [
        "integration",
        "required-feature",
    ],
    data = [],
    env = {
        "RUST_MIN_STACK": "16777216",
    },
    proc_macro_deps = [
        "//meerkat-machine-derive:meerkat_machine_derive",
        "//meerkat-machine-dsl:meerkat_machine_dsl",
    ] + all_crate_deps(
        package_name = "meerkat-mob",
        proc_macro = True,
        proc_macro_dev = True,
    ),
    deps = [
        "//meerkat-mob:meerkat_mob",
        "//meerkat:meerkat",
        "//meerkat:meerkat_client_agent_factory_build",
        "//meerkat:meerkat_comms_agent_factory_build",
        "//meerkat:meerkat_contracts_agent_factory_build",
        "//meerkat:meerkat_core_agent_factory_build",
        "//meerkat:meerkat_machine_kernels_agent_factory_build",
        "//meerkat:meerkat_machine_schema_agent_factory_build",
        "//meerkat:meerkat_runtime_agent_factory_build",
        "//meerkat:meerkat_session_agent_factory_build",
        "//meerkat:meerkat_store_agent_factory_build",
    ] + all_crate_deps(
        package_name = "meerkat-mob",
        normal = True,
        normal_dev = True,
    ),
)

rust_test(
    name = "smoke_mob_pictionary_test",
    aliases = aliases(
        package_name = "meerkat-mob",
        normal = True,
        normal_dev = True,
        proc_macro = True,
        proc_macro_dev = True,
    ),
    crate_name = "smoke_mob_pictionary",
    crate_root = "tests/smoke_mob_pictionary.rs",
    crate_features = [
        "integration-real-tests",
        "runtime-adapter",
    ],
    edition = "2024",
    compile_data = [
        "Cargo.toml",
        "src/runtime/actor.rs",
        "src/runtime/builder.rs",
        "src/runtime/flow_frame_engine.rs",
        "src/runtime/recovery.rs",
    ],
    srcs = [
        "tests/smoke_mob_pictionary.rs",
    ],
    visibility = ["//visibility:public"],
    rustc_env = {
        "CARGO_PKG_VERSION": "0.6.7",
        "CARGO_BIN_NAME": "smoke_mob_pictionary",
        "CARGO_MANIFEST_DIR": "./meerkat-mob",
    },
    tags = [
        "integration",
        "required-feature",
    ],
    data = [],
    env = {
        "RUST_MIN_STACK": "16777216",
    },
    proc_macro_deps = [
        "//meerkat-machine-derive:meerkat_machine_derive",
        "//meerkat-machine-dsl:meerkat_machine_dsl",
    ] + all_crate_deps(
        package_name = "meerkat-mob",
        proc_macro = True,
        proc_macro_dev = True,
    ),
    deps = [
        "//meerkat-mob:meerkat_mob",
        "//meerkat:meerkat",
        "//meerkat:meerkat_client_agent_factory_build",
        "//meerkat:meerkat_comms_agent_factory_build",
        "//meerkat:meerkat_contracts_agent_factory_build",
        "//meerkat:meerkat_core_agent_factory_build",
        "//meerkat:meerkat_machine_kernels_agent_factory_build",
        "//meerkat:meerkat_machine_schema_agent_factory_build",
        "//meerkat:meerkat_runtime_agent_factory_build",
        "//meerkat:meerkat_session_agent_factory_build",
        "//meerkat:meerkat_store_agent_factory_build",
    ] + all_crate_deps(
        package_name = "meerkat-mob",
        normal = True,
        normal_dev = True,
    ),
)

rust_test(
    name = "smoke_mob_resume_test",
    aliases = aliases(
        package_name = "meerkat-mob",
        normal = True,
        normal_dev = True,
        proc_macro = True,
        proc_macro_dev = True,
    ),
    crate_name = "smoke_mob_resume",
    crate_root = "tests/smoke_mob_resume.rs",
    crate_features = [
        "integration-real-tests",
        "runtime-adapter",
    ],
    edition = "2024",
    compile_data = [
        "Cargo.toml",
        "src/runtime/actor.rs",
        "src/runtime/builder.rs",
        "src/runtime/flow_frame_engine.rs",
        "src/runtime/recovery.rs",
    ],
    srcs = [
        "tests/smoke_mob_resume.rs",
    ],
    visibility = ["//visibility:public"],
    rustc_env = {
        "CARGO_PKG_VERSION": "0.6.7",
        "CARGO_BIN_NAME": "smoke_mob_resume",
        "CARGO_MANIFEST_DIR": "./meerkat-mob",
    },
    tags = [
        "integration",
        "required-feature",
    ],
    data = [],
    env = {
        "RUST_MIN_STACK": "16777216",
    },
    proc_macro_deps = [
        "//meerkat-machine-derive:meerkat_machine_derive",
        "//meerkat-machine-dsl:meerkat_machine_dsl",
    ] + all_crate_deps(
        package_name = "meerkat-mob",
        proc_macro = True,
        proc_macro_dev = True,
    ),
    deps = [
        "//meerkat-mob:meerkat_mob",
        "//meerkat:meerkat",
        "//meerkat:meerkat_client_agent_factory_build",
        "//meerkat:meerkat_comms_agent_factory_build",
        "//meerkat:meerkat_contracts_agent_factory_build",
        "//meerkat:meerkat_core_agent_factory_build",
        "//meerkat:meerkat_machine_kernels_agent_factory_build",
        "//meerkat:meerkat_machine_schema_agent_factory_build",
        "//meerkat:meerkat_runtime_agent_factory_build",
        "//meerkat:meerkat_session_agent_factory_build",
        "//meerkat:meerkat_store_agent_factory_build",
    ] + all_crate_deps(
        package_name = "meerkat-mob",
        normal = True,
        normal_dev = True,
    ),
)

test_suite(
    name = "fast_tests",
    tests = [
        ":dispatcher_rule_synthetic_injection_test",
        ":flow_frame_recovery_tests_test",
        ":meerkat_mob_unit_test",
        ":member_session_bindings_test",
        ":mob_orchestrator_kernel_test",
        ":shadow_state_absent_test",
    ],
)
