forge-sdk
The Forge SDK — unified ANVIL-compliant agent development framework
The Forge SDK — unified ANVIL-compliant agent development framework
Package contract
| Field | Value |
|---|---|
| Language | rust |
| Source version | 0.2.0 |
| Manifest | forge-rs/crates/forge-sdk/Cargo.toml |
| Source files | 2 |
| Evidence | Source reference; registry publication and runtime conformance are separate checks |
Import boundary
use forge_sdk;Use a source checkout or your verified private registry. Manifest coordinates identify the package; they do not establish that a public registry release exists.
Crate boundary
The following entries are taken from src/lib.rs. Feature conditions in the exact source still apply.
pub use forge_core;
pub use forge_generate as generate;
pub use forge_tool as tool;
pub use forge_health as health;
pub use forge_agent as agent;
pub use forge_embed as embed;
pub use forge_media as media;
pub use forge_mcp as mcp;
pub mod adapters;
pub use forge_identity as identity;
pub use forge_auth as auth;
pub use forge_comm as comm;
pub use forge_collab as collab;
#[cfg(feature = "coding")]
pub use forge_provider_coding as coding;
#[cfg(feature = "platforms")]
pub use forge_provider_platforms as platforms;
pub use forge_telemetry as telemetry;
pub use serde;
pub use serde_json;
pub use async_trait;
#[cfg(not(target_arch = "wasm32"))]
pub use tokio;
pub mod prelude;
pub use forge_core::message::{MessagePart, ModelMessage, Role};
pub use forge_core::model::LanguageModel;
pub use forge_core::provider::{ProviderRef, ProviderRegistry};
pub use forge_core::tool::{ToolApproval, ToolCall, ToolDefinition, ToolResult, ToolTier};
pub use forge_core::config::GenerateOptions;
pub use forge_core::output::{FinishReason, GenerateResult, StreamChunk, Usage};
pub use forge_core::error::{ForgeError, ForgeResult};
pub use forge_core::telemetry::{ForgeEvent, ForgeSpan, TelemetryEmitter};
pub use forge_core::types::{AgentDid, Timestamp};
pub use forge_core::schema::JsonSchema;
pub use forge_agent::agent::{
Agent, AgentCheckpointValidationError, AgentConfig, AgentOutput, AgentRunCheckpoint,
AGENT_RUN_CHECKPOINT_SCHEMA,
};
pub use forge_agent::tool_loop::ToolLoopAgent;
pub use forge_agent::subagent::{create_subagent, SubAgentConfig};
pub use forge_agent::workflow::{
ParallelWorkflow, RouterWorkflow, SequentialWorkflow, WorkflowOutput,
};
pub use forge_agent::loop_control::{
AgentStopCondition, NoOpPrepare, PrepareStep, StopWhen, StopWhenCustom, StopWhenMaxSteps,
StopWhenTextGenerated, StopWhenToolCalled,
};
#[cfg(not(target_arch = "wasm32"))]
pub use forge_agent::messaging::{
AgentChannel, AgentChannelReceiver, AgentChannelSender, AgentMessage,
};
pub use forge_agent::error::{ForgeAgentError, ForgeAgentResult};
pub use forge_generate::generate_text;
pub use forge_generate::stream_text;
pub use forge_generate::generate_object;
pub use forge_generate::stream_object;
pub use forge_tool::registry::ToolRegistry;
pub use forge_tool::approval::{ApprovalHandler, AutoApprove, DenyAll};
#[cfg(all(feature = "coding", not(target_arch = "wasm32")))]
pub use forge_provider_coding::{
official_provider_registry, AuthorizedSessionExecution, AuthorizedSessionHandle,
AuthorizedSessionRequest, ClaudeCodeAdapter, CodexCliAdapter,
OfficialCodingProviderManager,
};
#[cfg(feature = "platforms")]
pub use forge_provider_platforms::{
approved_direct_provider_presets, approved_gateway_provider_presets, AuthStrategy,
ProviderFamily, ProviderPreset,
};
#[cfg(all(feature = "platforms", not(target_arch = "wasm32")))]
pub use forge_provider_platforms::{
register_anthropic_model, register_bedrock_model, register_cohere_model,
register_deepseek_model, register_default_core_direct_providers, register_foundry_model,
register_google_model, register_groq_model, register_microsoft_foundry_model,
register_minimax_model, register_mistral_model, register_moonshot_model,
register_openai_model, register_openrouter_model, register_vertex_ai_model,
register_xai_model, register_zai_model,
};
pub use forge_tool::execution::{execute_tool_call, FnToolExecutor, ToolExecutor};
pub use forge_tool::definition::ToolBuilder;
pub use forge_health::lifecycle::{LifecycleManager, LifecycleState, LifecycleTransition};
pub use forge_health::profile::HealthProfile;
pub use forge_health::monitoring::{HealthMonitor, HealthThresholds};
pub use forge_health::reporting::{HealthReport, HealthStatus};
pub use forge_health::events::LifecycleEvent;
pub use forge_identity::agent_identity::ForgeAgentIdentity;
pub use forge_identity::lineage::{
create_hmr_identity, create_mhr_identity, derive_agent_identity, verify_lineage_chain,
};
#[allow(deprecated)]
pub use forge_identity::persistence::{load_identity, save_identity};
pub use forge_identity::error::{ForgeIdentityError, ForgeIdentityResult};
pub use forge_auth::tool_auth::{
authorize_tool_invocation, ToolAuthorizationDecision, ToolAuthorizationRequest,
};
pub use forge_auth::delegation::{delegate_capabilities, DelegationRequest};
pub use forge_auth::capability::{act_allows_scope, extract_scopes, verify_act};
pub use forge_auth::error::{ForgeAuthError, ForgeAuthResult};
#[cfg(not(target_arch = "wasm32"))]
pub use crate::adapters::AegisVerificationAdapter;
pub use crate::adapters::{
ArsenalAuthorizationAdapter, AuthorizationAdapter, DocumentRevocationState,
DocumentVerification, ForgePlatformAdapters, HumanRootLivenessState, IdentityAdapter,
OasIdentityAdapter, VerificationAdapter, VerificationAdapterError,
VerificationAdapterResult,
};
pub use forge_comm::message::AgentMessage as CommMessage;
#[cfg(not(target_arch = "wasm32"))]
pub use forge_comm::transport::MessageTransport;
pub use forge_comm::noop::NoopTransport;
pub use forge_collab::types::CollaborationRole;
pub use forge_collab::types::CollaborationSession;
pub use forge_collab::types::DelegatedTask;
pub use forge_collab::types::TaskResult;
pub use forge_collab::types::Interrupt;
pub use forge_collab::types::AgentCapabilityProfile;
pub use forge_telemetry::contract::TelemetryContract;
pub use forge_telemetry::contract::NoopTelemetry;
pub use forge_telemetry::collector::InMemoryTelemetry;
pub use forge_telemetry::audit::AuditTrail;
pub use async_trait::async_trait;Feature flags
| Feature | Enables |
|---|---|
default | (empty) |
openai | dep:forge-provider-openai |
anthropic | dep:forge-provider-anthropic |
google | dep:forge-provider-google |
coding | dep:forge-provider-coding |
platforms | dep:forge-provider-platforms |
all-providers | openai, anthropic, google, coding, platforms |
Source reference
Download package reference JSON. Each original source file and generated declaration artifact has its own SHA-256 digest. Function bodies and constant values are omitted from downloads. These are source declaration inventories, not compiler-resolved rustdoc, TypeDoc, DocC, or Dokka output. Private modules can contain public declarations that are not reachable through the package boundary; consult the entry point before importing.
adapters.rs
Read declaration text · 19 declaration entries
pub trait IdentityAdapter: Send + Sync {
/// Creates a new human root identity.
fn create_hmr_identity(
&self,
namespace: &str,
identifier: &str,
) -> ForgeIdentityResult<ForgeAgentIdentity>;
/// Creates a new machine root identity.
fn create_mhr_identity(
&self,
namespace: &str,
identifier: &str,
) -> ForgeIdentityResult<ForgeAgentIdentity>;
/// Derives a child agent identity from a parent identity.
fn derive_agent_identity(
&self,
parent: &ForgeAgentIdentity,
name: &str,
namespace: &str,
) -> ForgeIdentityResult<ForgeAgentIdentity>;
}
#[derive(Debug, Default, Clone, Copy)]
pub struct OasIdentityAdapter;
pub trait AuthorizationAdapter: Send + Sync {
/// Verifies that an ACT is structurally and temporally valid.
fn verify_act(&self, act: &AgentCapabilityToken) -> ForgeAuthResult<()>;
/// Extracts the scopes granted by an ACT.
fn extract_scopes(&self, act: &AgentCapabilityToken) -> Vec<String>;
/// Authorizes a tool invocation against the active ACT.
fn authorize_tool_invocation(
&self,
request: &ToolAuthorizationRequest<'_>,
) -> ForgeAuthResult<ToolAuthorizationDecision>;
/// Delegates a narrowed capability set to a child agent.
fn delegate_capabilities(
&self,
request: &DelegationRequest<'_>,
) -> ForgeAuthResult<AgentCapabilityToken>;
}
#[derive(Debug, Default, Clone, Copy)]
pub struct ArsenalAuthorizationAdapter;
#[derive(Debug, Clone, Copy, PartialEq, Eq)]
pub enum DocumentRevocationState {
Active,
Revoked,
Suspended,
Expired,
Unknown,
}
#[derive(Debug, Clone, Copy, PartialEq, Eq)]
pub enum HumanRootLivenessState {
Active,
Warning,
Stale,
Unknown,
}
#[derive(Debug, Clone, PartialEq, Eq)]
pub struct DocumentVerification {
pub did: String,
pub signature_valid: bool,
pub lineage_valid: bool,
pub lineage_depth: u32,
pub human_root: Option<String>,
pub revocation_state: DocumentRevocationState,
pub liveness_state: HumanRootLivenessState,
pub conformance_level: u8,
pub warnings: Vec<String>,
pub verified_at: Timestamp
}
#[derive(Debug, Error)]
pub enum VerificationAdapterError {
#[cfg(not(target_arch = "wasm32"))]
#[error(transparent)]
Aegis(#[from] aegis_core::VerificationError),
#[error("verification backend unavailable: {reason}")]
BackendUnavailable { reason: String },
}
pub type VerificationAdapterResult<T> = Result<T, VerificationAdapterError>;
#[async_trait]
pub trait VerificationAdapter: Send + Sync {
/// Verifies a DID through the configured verification backend.
async fn verify_did(&self, did: &str) -> VerificationAdapterResult<DocumentVerification>;
}
#[derive(Clone)]
pub struct ForgePlatformAdapters {
}
pub fn new(
identity: Arc<dyn IdentityAdapter>,
authorization: Arc<dyn AuthorizationAdapter>,
verification: Arc<dyn VerificationAdapter>,
) -> Self;
pub fn identity(&self) -> &dyn IdentityAdapter;
pub fn authorization(&self) -> &dyn AuthorizationAdapter;
pub fn verification(&self) -> &dyn VerificationAdapter;
#[cfg(not(target_arch = "wasm32"))]
pub fn production(
registry: Arc<aegis_core::PluginRegistry>,
config: aegis_core::VerificationConfig,
) -> Self;
#[cfg(not(target_arch = "wasm32"))]
pub struct AegisVerificationAdapter {
}
#[cfg(not(target_arch = "wasm32"))]
pub fn new(
registry: Arc<aegis_core::PluginRegistry>,
config: aegis_core::VerificationConfig,
) -> Self;
#[cfg(not(target_arch = "wasm32"))]
pub fn from_pipeline(pipeline: aegis_verify::VerificationPipeline) -> Self;lib.rs
Read declaration text · 79 declaration entries
pub use forge_core;
pub use forge_generate as generate;
pub use forge_tool as tool;
pub use forge_health as health;
pub use forge_agent as agent;
pub use forge_embed as embed;
pub use forge_media as media;
pub use forge_mcp as mcp;
pub mod adapters;
pub use forge_identity as identity;
pub use forge_auth as auth;
pub use forge_comm as comm;
pub use forge_collab as collab;
#[cfg(feature = "coding")]
pub use forge_provider_coding as coding;
#[cfg(feature = "platforms")]
pub use forge_provider_platforms as platforms;
pub use forge_telemetry as telemetry;
pub use serde;
pub use serde_json;
pub use async_trait;
#[cfg(not(target_arch = "wasm32"))]
pub use tokio;
pub mod prelude;
pub use forge_core::message::{MessagePart, ModelMessage, Role};
pub use forge_core::model::LanguageModel;
pub use forge_core::provider::{ProviderRef, ProviderRegistry};
pub use forge_core::tool::{ToolApproval, ToolCall, ToolDefinition, ToolResult, ToolTier};
pub use forge_core::config::GenerateOptions;
pub use forge_core::output::{FinishReason, GenerateResult, StreamChunk, Usage};
pub use forge_core::error::{ForgeError, ForgeResult};
pub use forge_core::telemetry::{ForgeEvent, ForgeSpan, TelemetryEmitter};
pub use forge_core::types::{AgentDid, Timestamp};
pub use forge_core::schema::JsonSchema;
pub use forge_agent::agent::{
Agent, AgentCheckpointValidationError, AgentConfig, AgentOutput, AgentRunCheckpoint,
AGENT_RUN_CHECKPOINT_SCHEMA,
};
pub use forge_agent::tool_loop::ToolLoopAgent;
pub use forge_agent::subagent::{create_subagent, SubAgentConfig};
pub use forge_agent::workflow::{
ParallelWorkflow, RouterWorkflow, SequentialWorkflow, WorkflowOutput,
};
pub use forge_agent::loop_control::{
AgentStopCondition, NoOpPrepare, PrepareStep, StopWhen, StopWhenCustom, StopWhenMaxSteps,
StopWhenTextGenerated, StopWhenToolCalled,
};
#[cfg(not(target_arch = "wasm32"))]
pub use forge_agent::messaging::{
AgentChannel, AgentChannelReceiver, AgentChannelSender, AgentMessage,
};
pub use forge_agent::error::{ForgeAgentError, ForgeAgentResult};
pub use forge_generate::generate_text;
pub use forge_generate::stream_text;
pub use forge_generate::generate_object;
pub use forge_generate::stream_object;
pub use forge_tool::registry::ToolRegistry;
pub use forge_tool::approval::{ApprovalHandler, AutoApprove, DenyAll};
#[cfg(all(feature = "coding", not(target_arch = "wasm32")))]
pub use forge_provider_coding::{
official_provider_registry, AuthorizedSessionExecution, AuthorizedSessionHandle,
AuthorizedSessionRequest, ClaudeCodeAdapter, CodexCliAdapter,
OfficialCodingProviderManager,
};
#[cfg(feature = "platforms")]
pub use forge_provider_platforms::{
approved_direct_provider_presets, approved_gateway_provider_presets, AuthStrategy,
ProviderFamily, ProviderPreset,
};
#[cfg(all(feature = "platforms", not(target_arch = "wasm32")))]
pub use forge_provider_platforms::{
register_anthropic_model, register_bedrock_model, register_cohere_model,
register_deepseek_model, register_default_core_direct_providers, register_foundry_model,
register_google_model, register_groq_model, register_microsoft_foundry_model,
register_minimax_model, register_mistral_model, register_moonshot_model,
register_openai_model, register_openrouter_model, register_vertex_ai_model,
register_xai_model, register_zai_model,
};
pub use forge_tool::execution::{execute_tool_call, FnToolExecutor, ToolExecutor};
pub use forge_tool::definition::ToolBuilder;
pub use forge_health::lifecycle::{LifecycleManager, LifecycleState, LifecycleTransition};
pub use forge_health::profile::HealthProfile;
pub use forge_health::monitoring::{HealthMonitor, HealthThresholds};
pub use forge_health::reporting::{HealthReport, HealthStatus};
pub use forge_health::events::LifecycleEvent;
pub use forge_identity::agent_identity::ForgeAgentIdentity;
pub use forge_identity::lineage::{
create_hmr_identity, create_mhr_identity, derive_agent_identity, verify_lineage_chain,
};
#[allow(deprecated)]
pub use forge_identity::persistence::{load_identity, save_identity};
pub use forge_identity::error::{ForgeIdentityError, ForgeIdentityResult};
pub use forge_auth::tool_auth::{
authorize_tool_invocation, ToolAuthorizationDecision, ToolAuthorizationRequest,
};
pub use forge_auth::delegation::{delegate_capabilities, DelegationRequest};
pub use forge_auth::capability::{act_allows_scope, extract_scopes, verify_act};
pub use forge_auth::error::{ForgeAuthError, ForgeAuthResult};
#[cfg(not(target_arch = "wasm32"))]
pub use crate::adapters::AegisVerificationAdapter;
pub use crate::adapters::{
ArsenalAuthorizationAdapter, AuthorizationAdapter, DocumentRevocationState,
DocumentVerification, ForgePlatformAdapters, HumanRootLivenessState, IdentityAdapter,
OasIdentityAdapter, VerificationAdapter, VerificationAdapterError,
VerificationAdapterResult,
};
pub use forge_comm::message::AgentMessage as CommMessage;
#[cfg(not(target_arch = "wasm32"))]
pub use forge_comm::transport::MessageTransport;
pub use forge_comm::noop::NoopTransport;
pub use forge_collab::types::CollaborationRole;
pub use forge_collab::types::CollaborationSession;
pub use forge_collab::types::DelegatedTask;
pub use forge_collab::types::TaskResult;
pub use forge_collab::types::Interrupt;
pub use forge_collab::types::AgentCapabilityProfile;
pub use forge_telemetry::contract::TelemetryContract;
pub use forge_telemetry::contract::NoopTelemetry;
pub use forge_telemetry::collector::InMemoryTelemetry;
pub use forge_telemetry::audit::AuditTrail;
pub use async_trait::async_trait;
pub fn version() -> &'static str;