Skip to main content

a3s_code_core/capability/
mod.rs

1//! Immutable, source-owned capability identity and scoped lifecycle kernel.
2//!
3//! This module deliberately contains no package resolution, runtime
4//! activation, or mutable latest-value registry. A capability source submits
5//! one complete contribution, and [`CapabilitySet`] freezes the validated
6//! descriptors behind an [`std::sync::Arc`]. Typed scopes add monotonic
7//! ceilings, borrowed leases, reversible effects, and bounded structured
8//! teardown. Closed runtime values and typestate transactions publish one
9//! complete projected generation through a short catalog CAS.
10
11mod agent_execution;
12mod ceiling;
13mod descriptor;
14mod effect;
15mod error;
16mod flow_binding;
17mod id;
18mod knowledge_surface_binding;
19mod lease;
20mod projection;
21mod projection_error;
22mod readiness;
23mod run_binding;
24mod runtime;
25mod scope;
26mod scope_error;
27mod set;
28mod source;
29mod supervisor;
30mod transaction;
31mod ui_binding;
32mod value;
33
34pub use crate::mcp::McpBinding;
35pub(crate) use agent_execution::{
36    AgentCapabilityOperation, AgentCapabilityRuntime, AgentCapabilitySubtask, AgentCapabilityTurn,
37    AgentToolCapabilityContext,
38};
39pub use ceiling::{
40    CapabilityCeiling, CapabilityExecutionCeiling, GovernanceCapabilityCeiling,
41    WorkspaceCapabilityCeiling, CAPABILITY_CEILING_SCHEMA,
42};
43pub use descriptor::{CapabilityContribution, CapabilityDescriptor, MAX_CAPABILITY_DEPENDENCIES};
44pub use effect::{CapabilityEffect, CapabilityEffectError};
45pub use error::CapabilitySetError;
46pub use flow_binding::FlowBinding;
47pub use id::{
48    CapabilityId, CapabilityKind, CapabilitySourceId, CodeCatalogGeneration, Sha256Digest,
49    UseCapabilityGeneration, UsePackageGeneration, MAX_CAPABILITY_IDENTIFIER_BYTES,
50    USE_CAPABILITY_SNAPSHOT_CURSOR_SCHEMA,
51};
52pub use knowledge_surface_binding::{
53    KnowledgeSurfaceBinding, KnowledgeSurfaceBindingError, KnowledgeSurfaceBindingSpec,
54    KNOWLEDGE_SURFACE_BINDING_SCHEMA, MAX_KNOWLEDGE_SURFACE_PROJECTIONS,
55};
56pub use lease::{CapabilityLease, RetainedUseGeneration};
57pub use projection::{
58    CapabilityCatalog, CapabilityCatalogStamp, CapabilityCleanupReport, CapabilityCommitReceipt,
59    CapabilityProjection, CapabilityProjectionLease,
60};
61pub use projection_error::{CapabilityAdapterError, CapabilityProjectionError};
62pub use readiness::{
63    CapabilityReadinessPlan, CAPABILITY_READINESS_PLAN_SCHEMA, MAX_CAPABILITY_READINESS_WAVES,
64};
65pub use run_binding::{
66    RunCapabilityBindingError, RunCapabilityBindingV1, RunUseCapabilityGenerationV1,
67    CAPABILITY_CEILING_DIGEST_DOMAIN, RUN_CAPABILITY_BINDING_SCHEMA,
68};
69pub use runtime::{
70    CapabilityRuntimeError, SessionCapabilityBatch, SessionCapabilityRun, UseGenerationLeaseError,
71    UseGenerationLeaseProvider,
72};
73pub use scope::{
74    CapabilityScope, CapabilityScopeHandle, CapabilityScopeId, CapabilityScopeKind, Run, ScopeKind,
75    Session, Subtask, Turn,
76};
77pub use scope_error::CapabilityScopeError;
78pub use set::{
79    CapabilitySet, CAPABILITY_SET_DIGEST_DOMAIN, CAPABILITY_SET_SCHEMA, MAX_CAPABILITIES,
80    MAX_CAPABILITY_CANONICAL_BYTES, MAX_CAPABILITY_DEPENDENCY_EDGES, MAX_CAPABILITY_SOURCES,
81};
82pub use source::{CapabilitySource, CapabilitySourceClass};
83pub(crate) use supervisor::SupervisedTaskSpawner;
84pub use supervisor::{
85    ScopeClosePolicy, ScopeCloseReport, SupervisedTaskId, DEFAULT_SCOPE_CLOSE_TIMEOUT,
86    MAX_SCOPE_CHILDREN, MAX_SCOPE_CLOSE_TIMEOUT, MAX_SCOPE_EFFECTS, MAX_SCOPE_TASKS,
87};
88pub use transaction::{
89    CapabilityProjectionAdapter, CapabilityTxn, Prepared, PreparedCapability, Staged, Validated,
90    MAX_CAPABILITY_TRANSACTION_EFFECTS,
91};
92pub use ui_binding::{
93    UiAsset, UiAssetKind, UiBinding, UiBindingError, UiBindingSpec, UiDocument,
94    MAX_UI_ASSETS_PER_KIND, MAX_UI_ASSET_BYTES, MAX_UI_DOCUMENT_BYTES, UI_BINDING_SCHEMA,
95    UI_DOCUMENT_SCHEMA,
96};
97pub use value::CapabilityValue;