Skip to main content

onetaskgraph_plugin_api/
lib.rs

1//! The contract every onetaskgraph source is written against.
2//!
3//! This crate holds exactly what a plugin author needs in order to implement a
4//! source, and nothing else: the two traits, the work types, the query and paging
5//! types, the capability declaration, and the error enum. The engine that drives
6//! sources lives in `onetaskgraph-core`, and **no plugin crate may depend on it**:
7//! `deny.toml` permits that crate exactly one wrapper, the binary, failing the
8//! required `deny` job, and `scripts/check-plugin-isolation.sh` reads the real
9//! `cargo metadata` graph inside `just check`.
10//!
11//! Keeping this crate still is the point. Every change here rebuilds and re-tests
12//! every plugin, which is exactly the cost the split exists to avoid paying on an
13//! ordinary engine change. When a new type could plausibly sit on either side, it
14//! belongs in `onetaskgraph-core` unless a trait signature names it.
15#![deny(missing_docs)]
16
17mod capability;
18mod comment;
19mod error;
20mod id;
21mod metering;
22mod query;
23mod source;
24mod work;
25mod write;
26
27pub use capability::{Capabilities, DependencySupport, Support};
28pub use comment::{Comment, CommentBody, NewComment, commentless};
29pub use error::SourceError;
30pub use id::{NativeId, SOURCE_NAME_PATTERN, SourceName};
31pub use metering::{Metered, Metering};
32pub use query::{
33    Cursor, DocumentQuery, LabelFilter, Page, PageRequest, ProjectFilter, ProjectQuery, TaskQuery,
34    TextFields, TextQuery,
35};
36pub use source::{Health, SecretResolver, SourcePlugin, TaskSource};
37pub use work::{
38    DependencyEdge, DependencyEndpoint, DependencyKind, Direction, Document, ItemKind, Label,
39    Location, Project, Repository, Status, StatusCategory, Task, TaskRef,
40};
41pub use write::{ItemWrite, WriteSupport, documentless, unwritable, unwritable_field};