Calendar Documentation
A Rust library, CLI, and MCP server for rule-based scheduling with constraints.
Quick Links
Installation
cargo build --release
CLI Usage
chronosched generate problem.json --output schedule.json
chronosched validate schedule.json
chronosched serve
chronosched list-rules
Library Usage
use chronosched::types::{Task, Resource, Problem};
use chronosched::scheduler::{GreedyScheduler, Scheduler};
let problem = Problem::new()
.with_task(Task::new("Meeting A").duration_minutes(60))
.with_resource(Resource::new("Alice"));
let schedule = GreedyScheduler::new().solve(&problem, &[], &[], &[])?;
MCP Server
Start the MCP server with chronosched serve. It communicates over stdio using JSON-RPC 2.0.
Supported Constraints
Hard Constraints
- NoOverlap — A resource cannot execute two tasks at the same time.
- ResourceAvailability — Tasks must fall within resource availability windows.
- Deadline — A task must finish before its deadline.
- ResourceCapacity — A resource cannot exceed its concurrent task capacity.
- Dependency — Task A must finish before Task B starts.
- MutualExclusion — Two specific tasks must not overlap.
- FixedTime — A task must be scheduled at an exact time.
Soft Constraints
- PreferredTime — Prefer scheduling within given time windows.
- MinimizeGaps — Penalize idle time on resources.
- BalanceLoad — Distribute tasks evenly across resources.
- ContiguousBlock — Prefer grouping related tasks together.
- EarlyCompletion — Prefer finishing tasks as early as possible.
Supported Rules
- RecurrenceRule — Generate recurring task instances (daily, weekly, monthly).
- AvailabilityRule — Enforce resource availability windows.
- PriorityRule — Meta rule; priority is used directly by the scheduler.
Output Formats
- JSON
- Human-readable text table
- CSV
- iCalendar (.ics)