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_schedule",
    aliases = aliases(package_name = "meerkat-schedule"),
    crate_name = "meerkat_schedule",
    crate_root = "src/lib.rs",
    crate_features = [
        "schema",
        "skills",
    ],
    edition = "2024",
    compile_data = [
        "Cargo.toml",
        "skills/schedule-workflow/SKILL.md",
    ],
    srcs = glob(["src/**/*.rs"]),
    visibility = ["//visibility:public"],
    rustc_env = {
        "CARGO_PKG_VERSION": "0.7.15",
        "CARGO_MANIFEST_DIR": "./meerkat-schedule",
    },
    proc_macro_deps = all_crate_deps(
        package_name = "meerkat-schedule",
        proc_macro = True,
    ),
    deps = [
        "//meerkat-capabilities:meerkat_capabilities",
        "//meerkat-core:meerkat_core",
        "//meerkat-machine-schema:meerkat_machine_schema",
        "//meerkat-skills:meerkat_skills",
    ] + all_crate_deps(
        package_name = "meerkat-schedule",
        normal = True,
    ),
)

rust_library(
    name = "meerkat_schedule_agent_factory_build",
    aliases = aliases(package_name = "meerkat-schedule"),
    crate_name = "meerkat_schedule",
    crate_root = "src/lib.rs",
    crate_features = [
        "schema",
        "skills",
    ],
    edition = "2024",
    compile_data = [
        "Cargo.toml",
        "skills/schedule-workflow/SKILL.md",
    ],
    srcs = glob(["src/**/*.rs"]),
    visibility = [
        "//meerkat:__pkg__",
    ],
    rustc_env = {
        "CARGO_PKG_VERSION": "0.7.15",
        "CARGO_MANIFEST_DIR": "./meerkat-schedule",
    },
    proc_macro_deps = all_crate_deps(
        package_name = "meerkat-schedule",
        proc_macro = True,
    ),
    deps = [
        "//meerkat:meerkat_capabilities_agent_factory_build",
        "//meerkat:meerkat_core_agent_factory_build",
        "//meerkat:meerkat_machine_schema_agent_factory_build",
        "//meerkat:meerkat_skills_agent_factory_build",
    ] + all_crate_deps(
        package_name = "meerkat-schedule",
        normal = True,
    ),
)

rust_test(
    name = "meerkat_schedule_unit_test",
    aliases = aliases(
        package_name = "meerkat-schedule",
        normal = True,
        normal_dev = True,
        proc_macro = True,
        proc_macro_dev = True,
    ),
    crate_name = "meerkat_schedule",
    crate_root = "src/lib.rs",
    crate_features = [
        "schema",
        "skills",
    ],
    edition = "2024",
    compile_data = [
        "Cargo.toml",
        "skills/schedule-workflow/SKILL.md",
    ],
    srcs = glob(["src/**/*.rs"]),
    visibility = ["//visibility:public"],
    rustc_env = {
        "CARGO_PKG_VERSION": "0.7.15",
        "CARGO_MANIFEST_DIR": "./meerkat-schedule",
    },
    tags = [
        "fast",
        "unit",
    ],
    size = "small",
    data = [
        ":package_runfiles",
    ],
    env = {
        "RUST_MIN_STACK": "16777216",
    },
    proc_macro_deps = all_crate_deps(
        package_name = "meerkat-schedule",
        proc_macro = True,
        proc_macro_dev = True,
    ),
    deps = [
        "//meerkat-capabilities:meerkat_capabilities",
        "//meerkat-core:meerkat_core",
        "//meerkat-machine-schema:meerkat_machine_schema",
        "//meerkat-skills:meerkat_skills",
    ] + all_crate_deps(
        package_name = "meerkat-schedule",
        normal = True,
        normal_dev = True,
    ),
)

rust_test(
    name = "flow_target_serde_test",
    aliases = aliases(
        package_name = "meerkat-schedule",
        normal = True,
        normal_dev = True,
        proc_macro = True,
        proc_macro_dev = True,
    ),
    crate_name = "flow_target_serde",
    crate_root = "tests/flow_target_serde.rs",
    crate_features = [
        "schema",
        "skills",
    ],
    edition = "2024",
    compile_data = [
        "Cargo.toml",
        "skills/schedule-workflow/SKILL.md",
    ],
    srcs = [
        "tests/flow_target_serde.rs",
    ],
    visibility = ["//visibility:public"],
    rustc_env = {
        "CARGO_PKG_VERSION": "0.7.15",
        "CARGO_BIN_NAME": "flow_target_serde",
        "CARGO_MANIFEST_DIR": "./meerkat-schedule",
    },
    tags = [
        "fast",
    ],
    size = "small",
    data = [],
    env = {
        "RUST_MIN_STACK": "16777216",
    },
    proc_macro_deps = all_crate_deps(
        package_name = "meerkat-schedule",
        proc_macro = True,
        proc_macro_dev = True,
    ),
    deps = [
        "//meerkat-capabilities:meerkat_capabilities",
        "//meerkat-core:meerkat_core",
        "//meerkat-machine-schema:meerkat_machine_schema",
        "//meerkat-schedule:meerkat_schedule",
        "//meerkat-skills:meerkat_skills",
    ] + all_crate_deps(
        package_name = "meerkat-schedule",
        normal = True,
        normal_dev = True,
    ),
)

rust_library(
    name = "meerkat_schedule_machine_schema_exports",
    aliases = aliases(package_name = "meerkat-schedule"),
    crate_name = "meerkat_schedule",
    crate_root = "src/lib.rs",
    crate_features = [
        "machine-schema-exports",
        "schema",
        "skills",
    ],
    edition = "2024",
    compile_data = [
        "Cargo.toml",
        "skills/schedule-workflow/SKILL.md",
    ],
    srcs = glob(["src/**/*.rs"]),
    visibility = ["//meerkat-machine-codegen:__pkg__"],
    proc_macro_deps = [
        "//meerkat-machine-dsl:meerkat_machine_dsl",
    ] + all_crate_deps(
        package_name = "meerkat-schedule",
        proc_macro = True,
    ),
    deps = [
        "//meerkat-capabilities:meerkat_capabilities",
        "//meerkat-core:meerkat_core",
        "//meerkat-machine-schema:meerkat_machine_schema",
        "//meerkat-skills:meerkat_skills",
    ] + all_crate_deps(
        package_name = "meerkat-schedule",
        normal = True,
    ),
)

rust_library(
    name = "meerkat_schedule_machine_schema_exports_agent_factory_build",
    aliases = aliases(package_name = "meerkat-schedule"),
    crate_name = "meerkat_schedule",
    crate_root = "src/lib.rs",
    crate_features = [
        "machine-schema-exports",
        "schema",
        "skills",
    ],
    edition = "2024",
    compile_data = [
        "Cargo.toml",
        "skills/schedule-workflow/SKILL.md",
    ],
    srcs = glob(["src/**/*.rs"]),
    visibility = ["//meerkat-machine-codegen:__pkg__"],
    proc_macro_deps = [
        "//meerkat-machine-dsl:meerkat_machine_dsl",
    ] + all_crate_deps(
        package_name = "meerkat-schedule",
        proc_macro = True,
    ),
    deps = [
        "//meerkat:meerkat_capabilities_agent_factory_build",
        "//meerkat:meerkat_core_agent_factory_build",
        "//meerkat:meerkat_machine_schema_agent_factory_build",
        "//meerkat:meerkat_skills_agent_factory_build",
    ] + all_crate_deps(
        package_name = "meerkat-schedule",
        normal = True,
    ),
)

test_suite(
    name = "fast_tests",
    tests = [
        ":flow_target_serde_test",
        ":meerkat_schedule_unit_test",
    ],
)
