Skip to main content

Module tools

Module tools 

Source
Expand description

App-owned external tool-port contracts.

These ports describe narrow capabilities the deterministic app may call. Constructing a request is not authority for an agent to perform the side effect directly: message tools can draft under review, reservation tools can draft updates, and payment/provider traits remain behind app policy and human review gates.

use app::tools::{draft_update, messaging};
use domain::{entities, message, workflow};
use uuid::Uuid;

let draft_request = messaging::draft::Request {
    channel: messaging::DeliveryChannel::Portal,
    recipient: messaging::Recipient::Manager(
        entities::ManagerId::try_new("gm-fixture")?,
    ),
    body: messaging::message_body::Body::try_new(
        "Internal review task: verify vaccine evidence before any customer send.",
    )?,
    review: messaging::ReviewPolicy::ManagerApprovalRequired,
};

assert_eq!(draft_request.review, messaging::ReviewPolicy::ManagerApprovalRequired);

let reservation_update = draft_update::Request {
    reservation_id: entities::reservation::Id(Uuid::from_u128(0x123)),
    proposed_status: entities::reservation::Status::SpecialReview,
    rationale: draft_update::Rationale::ManagerReviewRequired,
};

// The port models a draft/update proposal; it is not a provider/PMS write.
assert_eq!(reservation_update.proposed_status, entities::reservation::Status::SpecialReview);

let internal_task = workflow::task::Title::try_new("Review ambiguous boarding vaccine proof")?;
assert_eq!(
    internal_task.into_inner(),
    "Review ambiguous boarding vaccine proof",
);

Re-exports§

pub use error::Error;
pub use error::ExternalFailure;
pub use error::Resource;
pub use error::ResourceId;
pub use error::Result;

Modules§

availability
Read-only availability checks that inform drafts without confirming bookings.
documents
Document intake and OCR helpers that turn uploads into reviewable evidence.
draft_update
Draft reservation-update requests held for staff review before provider writes.
error
Shared tool errors returned when an agent helper cannot safely complete.
hermes
Hermes task and schedule drafts used to queue staff work safely.
media
Media snapshot helpers that provide visual context without live device control.
messaging
Customer-message drafting contracts that never send without staff approval.
payment
Payment helper contracts that keep authorizations, refunds, and deposits auditable.
portal
Provider portal lookups exposed as read-only agent context.

Enums§

ExternalToolCandidate
Decision taxonomy for external tool candidate in the agent tool workflow; each value carries operational meaning for source-grounded routing and review.

Traits§

AgentRuntime
Structured agent runtime used only after deterministic app context is built.
CustomerStore
Read-only customer/reservation evidence store exposed to app workflows.
ReservationSystem
Reservation-system port for read checks and review-held draft updates.