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 asset;
18mod cache;
19mod capability;
20mod clock;
21mod comment;
22mod error;
23mod id;
24mod issue;
25mod metadata;
26mod metering;
27mod query;
28mod source;
29mod status_mapping;
30mod update;
31mod visibility;
32mod work;
33mod write;
34
35pub use asset::{
36    Asset, AssetContentType, AssetName, AssetPayload, AssetUpload, AssetUploads, AssetWrite,
37    AssetsWritten, asset_references, asset_sha256, assetless, body_digest, is_sha256,
38    rewrite_asset_references, serve_asset_references,
39};
40pub use cache::{
41    Coverage, DocumentVersionCoverage, JournalEntry, PartOutcome, ProjectVersionCoverage,
42    RequestKind, Shown, VersionCoverage, WholeTask, WriteJournal,
43};
44pub use capability::{Capabilities, DependencySupport, Support};
45pub use clock::{Clock, SIMULATED_CLOCK_VARIABLE, SharedClock, system_clock};
46pub use comment::{
47    Comment, CommentBody, CommentCopy, CommentOrigin, NewComment, TaskDetailRead, commentless,
48};
49pub use error::SourceError;
50pub use id::{NativeId, SOURCE_NAME_PATTERN, SourceName};
51pub use issue::{
52    ClosedAs, Completion, HeldTask, ISSUE_REF_PATTERN, IssueHolding, IssueRef, StatusContradiction,
53};
54pub use metadata::{MetadataKey, MetadataRecord, unwritable_metadata};
55pub use metering::{Metered, Metering};
56pub use query::{
57    Cursor, DocumentQuery, LabelFilter, MetadataMatch, Page, PageRequest, ProjectFilter,
58    ProjectQuery, TaskQuery, TextFields, TextQuery,
59};
60pub use source::{Health, SecretResolver, SourcePlugin, TaskSource};
61pub use status_mapping::{StatusMapping, StatusName, StatusNames, UnmappedStatus};
62pub use update::{TaskUpdate, TaskUpdateOutcome, UpdatedField};
63pub use visibility::{Visibility, WriteTarget};
64pub use work::{
65    Classification, DependencyEdge, DependencyEndpoint, DependencyKind, Direction, Document,
66    ItemKind, Label, Location, Priority, Project, Repository, Status, StatusCategory, Task,
67    TaskRef,
68};
69pub use write::{ItemWrite, WriteSupport, documentless, unwritable, unwritable_field};