1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
//! Taskdn - Rust library for parsing, querying, and manipulating Taskdn task files.
//!
//! This library provides the core functionality for working with Taskdn's markdown-based
//! task management system. It handles parsing files with YAML frontmatter, validating
//! against the specification, and performing CRUD operations.
//!
//! # Features
//!
//! - **Parse** markdown files with YAML frontmatter into typed entities
//! - **Query** tasks, projects, and areas with flexible filters
//! - **Create/Update/Delete** entities with automatic timestamp management
//! - **Validate** files against the Taskdn specification
//! - **Preserve** unknown frontmatter fields during round-trip serialization
//! - **Process** file system events into typed vault events
//! - **Watch** directories for changes (with the `watch` feature)
//!
//! # Quick Start
//!
//! ```ignore
//! use taskdn::{Taskdn, TaskdnConfig, TaskFilter, TaskStatus, NewTask};
//! use std::path::PathBuf;
//!
//! // Initialize the SDK with your vault directories
//! let config = TaskdnConfig::new(
//! PathBuf::from("./tasks"),
//! PathBuf::from("./projects"),
//! PathBuf::from("./areas"),
//! );
//! let sdk = Taskdn::new(config)?;
//!
//! // Create a new task
//! let path = sdk.create_task(NewTask::new("My new task"))?;
//!
//! // List tasks by status
//! let ready_tasks = sdk.list_tasks(&TaskFilter::new().with_status(TaskStatus::Ready))?;
//!
//! // Complete a task (automatically sets completed_at)
//! sdk.complete_task(&path)?;
//! # Ok::<(), taskdn::Error>(())
//! ```
//!
//! # Core Types
//!
//! - [`Taskdn`] - The main SDK entry point
//! - [`Task`], [`Project`], [`Area`] - Parsed entity types
//! - [`NewTask`], [`NewProject`], [`NewArea`] - Builder types for creating entities
//! - [`TaskFilter`], [`ProjectFilter`], [`AreaFilter`] - Query filters
//! - [`TaskStatus`], [`ProjectStatus`], [`AreaStatus`] - Status enums
//!
//! # File Watching
//!
//! Enable the `watch` feature to use the built-in file watcher:
//!
//! ```toml
//! [dependencies]
//! taskdn = { version = "0.1", features = ["watch"] }
//! ```
//!
//! Or process file changes manually using [`Taskdn::process_file_change`]:
//!
//! ```ignore
//! use taskdn::{Taskdn, FileChangeKind, VaultEvent};
//!
//! // When your file watcher reports a change:
//! if let Some(event) = sdk.process_file_change(&path, FileChangeKind::Modified)? {
//! match event {
//! VaultEvent::TaskUpdated(task) => println!("Updated: {}", task.title),
//! VaultEvent::TaskCreated(task) => println!("Created: {}", task.title),
//! _ => {}
//! }
//! }
//! # Ok::<(), taskdn::Error>(())
//! ```
//!
//! # Modules
//!
//! - [`types`] - All entity types, status enums, and builder types
//! - [`validation`] - Spec compliance warnings
// Re-export configuration
pub use TaskdnConfig;
// Re-export error types
pub use ;
// Re-export event types (always available)
pub use ;
// Re-export filter types
pub use ;
// Re-export watcher types (only with "watch" feature)
pub use ;
// Re-export all entity types
pub use ;
// Re-export validation types
pub use ValidationWarning;
/// The main entry point for the Taskdn SDK.
///
/// Provides methods for listing, reading, creating, and updating tasks,
/// projects, and areas.