Skip to main content

forge_core/
lib.rs

1//! Core types, traits, and contexts for the Forge framework.
2//!
3//! This crate defines all handler traits ([`function::ForgeQuery`], [`function::ForgeMutation`],
4//! [`job::ForgeJob`], [`cron::ForgeCron`], [`workflow::ForgeWorkflow`], [`daemon::ForgeDaemon`],
5//! [`webhook::ForgeWebhook`], [`mcp::ForgeMcpTool`]), execution contexts, error types,
6//! configuration, and testing infrastructure.
7//!
8//! Library code depends on `forge-core` for types. The runtime (`forge-runtime`) implements
9//! the execution engine. Proc macros (`forge-macros`) generate trait implementations.
10
11pub mod auth;
12pub mod cluster;
13pub mod config;
14pub mod cron;
15pub mod daemon;
16pub mod env;
17pub mod error;
18pub mod function;
19pub mod http;
20pub mod job;
21pub mod mcp;
22pub mod oauth;
23pub mod rate_limit;
24pub mod realtime;
25pub mod schema;
26pub mod signals;
27pub mod tenant;
28pub mod types;
29pub mod util;
30pub mod webhook;
31pub mod workflow;
32
33// Testing utilities
34pub mod testing;
35
36pub use auth::{Claims, ClaimsBuilder, TokenPair};
37pub use cluster::{ClusterInfo, LeaderInfo, LeaderRole, NodeId, NodeInfo, NodeRole, NodeStatus};
38pub use config::{ForgeConfig, McpConfig, SignalsConfig};
39pub use cron::{CronContext, CronInfo, CronSchedule, ForgeCron};
40pub use daemon::{DaemonContext, DaemonInfo, DaemonStatus, ForgeDaemon};
41pub use env::{EnvAccess, EnvProvider, MockEnvProvider, RealEnvProvider};
42pub use error::{ForgeError, Result};
43pub use function::{
44    AuthContext, AuthTokenTtl, DbConn, ForgeConn, ForgeDb, ForgeMutation, ForgeQuery, FunctionInfo,
45    FunctionKind, JobDispatch, JobInfoLookup, MutationContext, OutboxBuffer, PendingJob,
46    PendingWorkflow, QueryContext, RequestMetadata, TokenIssuer, WorkflowDispatch,
47};
48pub use http::{
49    CircuitBreakerClient, CircuitBreakerConfig, CircuitBreakerError, CircuitBreakerOpen,
50    CircuitState, CircuitStatus, HttpClient, HttpRequestBuilder,
51};
52pub use job::{ForgeJob, JobContext, JobInfo, JobPriority, JobStatus, RetryConfig};
53pub use mcp::{
54    ForgeMcpTool, McpContent, McpContentBlock, McpToolAnnotations, McpToolContext, McpToolIcon,
55    McpToolInfo, McpToolResult,
56};
57pub use rate_limit::{RateLimitConfig, RateLimitHeaders, RateLimitKey, RateLimitResult};
58pub use realtime::{
59    AuthScope, BloomFilter, Change, ChangeOperation, Delta, QueryGroup, QueryGroupId, ReadSet,
60    SessionId, SessionInfo, SessionStatus, Subscriber, SubscriberId, SubscriptionId,
61    SubscriptionState, TrackingMode,
62};
63pub use schema::{FieldDef, ModelMeta, SchemaRegistry, TableDef};
64pub use schemars;
65pub use tenant::{HasTenant, TenantContext, TenantIsolationMode};
66pub use types::{Instant, LocalDate, LocalTime, Upload};
67pub use webhook::{
68    ForgeWebhook, IdempotencyConfig, IdempotencySource, SignatureAlgorithm, SignatureConfig,
69    WebhookContext, WebhookInfo, WebhookResult, WebhookSignature,
70};
71pub use workflow::{
72    ForgeWorkflow, ParallelBuilder, ParallelResults, SuspendReason, WorkflowContext, WorkflowEvent,
73    WorkflowEventSender, WorkflowInfo, WorkflowStatus,
74};