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 batch;
19mod cache;
20mod capability;
21mod clock;
22mod comment;
23mod error;
24mod guard;
25mod held;
26mod id;
27mod issue;
28mod metadata;
29mod metering;
30mod migration;
31mod projection;
32mod query;
33mod quota;
34mod relation;
35mod section;
36mod source;
37mod status_mapping;
38mod update;
39mod visibility;
40mod work;
41mod write;
42
43pub use asset::{
44    Asset, AssetContentType, AssetName, AssetPayload, AssetUpload, AssetUploads, AssetWrite,
45    AssetsWritten, asset_references, asset_sha256, assetless, body_digest, is_sha256,
46    rewrite_asset_references, serve_asset_references,
47};
48pub use batch::{BatchAnswer, BatchComment, BatchUpdate, decided_on, version_at};
49pub use cache::{
50    Coverage, DocumentVersionCoverage, JournalEntry, PartOutcome, ProjectVersionCoverage,
51    RequestKind, Shown, VersionCoverage, WholeTask, WriteJournal,
52};
53pub use capability::{Capabilities, DependencySupport, Support};
54pub use clock::{Clock, SIMULATED_CLOCK_VARIABLE, SharedClock, WaitCause, system_clock};
55pub use comment::{
56    AuthorKind, Comment, CommentBody, CommentCopy, CommentOrigin, NewComment, TaskDetailRead,
57    commentless,
58};
59pub use error::SourceError;
60pub use guard::WriteGuard;
61pub use held::HeldVersion;
62pub use id::{NativeId, SOURCE_NAME_PATTERN, SourceName};
63pub use issue::{
64    ClosedAs, Completion, ContradictedItem, HeldTask, ISSUE_REF_PATTERN, IssueHolding, IssueRef,
65    StatusContradiction,
66};
67pub use metadata::{MetadataKey, MetadataRecord, unwritable_metadata};
68pub use metering::{Metered, Metering};
69pub use migration::{MigratedItem, MigrationFailure, StoredFormMigration};
70pub use projection::ProjectedValue;
71pub use query::{
72    Cursor, DocumentQuery, LabelFilter, MetadataMatch, Page, PageRequest, ProjectFilter,
73    ProjectQuery, TaskQuery, TextFields, TextQuery,
74};
75pub use quota::{AdmittedRequest, GatedRequest, QuotaReading, ReportedCost, RequestGate};
76pub use relation::{
77    LINKS_HEADING, LinkDirection, LinkTypeConfig, LinkTypes, NativeLink, NativeWord, ParentAnswer,
78    ParentWrite, Relations, TaskLink, arrow, link_line, read_content, relationless, relinked,
79    strip_links_section, with_links_section,
80};
81pub use section::{BodyMarkup, SharedBodyMarkup, StoredHeading};
82pub use source::{Health, SecretResolver, SourcePlugin, TaskSource};
83pub use status_mapping::{StatusMapping, StatusName, StatusNames, UnmappedStatus};
84pub use update::{TaskUpdate, TaskUpdateOutcome, UpdatedField};
85pub use visibility::{Visibility, WriteTarget};
86pub use work::{
87    Classification, DependencyEdge, DependencyEndpoint, DependencyKind, Designator, Direction,
88    Document, EndpointRefusal, ItemKind, Label, Location, Priority, Project, Repository, Status,
89    StatusCategory, Task, TaskRef,
90};
91pub use write::{BodySize, ItemWrite, WriteSupport, documentless, unwritable, unwritable_field};