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;
16#[cfg(feature = "dynamic-workflow")]
17mod flow_binding;
18mod id;
19mod knowledge_surface_binding;
20mod lease;
21mod projection;
22mod projection_error;
23mod readiness;
24mod run_binding;
25mod runtime;
26mod scope;
27mod scope_error;
28mod sdk_batch;
29mod set;
30mod source;
31mod supervisor;
32mod transaction;
33mod ui_binding;
34mod value;
35
36pub use crate::mcp::McpBinding;
37pub(crate) use agent_execution::{
38    AgentCapabilityOperation, AgentCapabilityRuntime, AgentCapabilitySubtask, AgentCapabilityTurn,
39    AgentToolCapabilityContext,
40};
41pub use ceiling::{
42    CapabilityCeiling, CapabilityExecutionCeiling, GovernanceCapabilityCeiling,
43    WorkspaceCapabilityCeiling, CAPABILITY_CEILING_SCHEMA,
44};
45pub use descriptor::{CapabilityContribution, CapabilityDescriptor, MAX_CAPABILITY_DEPENDENCIES};
46pub use effect::{CapabilityEffect, CapabilityEffectError};
47pub use error::CapabilitySetError;
48#[cfg(feature = "dynamic-workflow")]
49pub use flow_binding::FlowBinding;
50pub use id::{
51    CapabilityId, CapabilityKind, CapabilitySourceId, CodeCatalogGeneration, Sha256Digest,
52    UseCapabilityGeneration, UsePackageGeneration, MAX_CAPABILITY_IDENTIFIER_BYTES,
53    USE_CAPABILITY_SNAPSHOT_CURSOR_SCHEMA,
54};
55pub use knowledge_surface_binding::{
56    KnowledgeSurfaceBinding, KnowledgeSurfaceBindingError, KnowledgeSurfaceBindingSpec,
57    KNOWLEDGE_SURFACE_BINDING_SCHEMA, MAX_KNOWLEDGE_SURFACE_PROJECTIONS,
58};
59pub use lease::{CapabilityLease, RetainedUseGeneration};
60pub use projection::{
61    CapabilityCatalog, CapabilityCatalogStamp, CapabilityCleanupReport, CapabilityCommitReceipt,
62    CapabilityProjection, CapabilityProjectionLease,
63};
64pub use projection_error::{CapabilityAdapterError, CapabilityProjectionError};
65pub use readiness::{
66    CapabilityReadinessPlan, CAPABILITY_READINESS_PLAN_SCHEMA, MAX_CAPABILITY_READINESS_WAVES,
67};
68pub use run_binding::{
69    RunCapabilityBindingError, RunCapabilityBindingV1, RunUseCapabilityGenerationV1,
70    CAPABILITY_CEILING_DIGEST_DOMAIN, RUN_CAPABILITY_BINDING_SCHEMA,
71};
72pub use runtime::{
73    CapabilityRuntimeError, SessionCapabilityBatch, SessionCapabilityRun, UseGenerationLeaseError,
74    UseGenerationLeaseProvider,
75};
76pub use scope::{
77    CapabilityScope, CapabilityScopeHandle, CapabilityScopeId, CapabilityScopeKind, Run, ScopeKind,
78    Session, Subtask, Turn,
79};
80pub use scope_error::CapabilityScopeError;
81pub use sdk_batch::{
82    SdkCapabilityBatchError, SdkCapabilityBatchV1, SdkCapabilityCommitReceiptV1,
83    SdkSkillCapabilityV1, SDK_CAPABILITY_BATCH_SCHEMA,
84};
85pub use set::{
86    CapabilitySet, CAPABILITY_SET_DIGEST_DOMAIN, CAPABILITY_SET_SCHEMA, MAX_CAPABILITIES,
87    MAX_CAPABILITY_CANONICAL_BYTES, MAX_CAPABILITY_DEPENDENCY_EDGES, MAX_CAPABILITY_SOURCES,
88};
89pub use source::{CapabilitySource, CapabilitySourceClass};
90pub(crate) use supervisor::SupervisedTaskSpawner;
91pub use supervisor::{
92    ScopeClosePolicy, ScopeCloseReport, SupervisedTaskId, DEFAULT_SCOPE_CLOSE_TIMEOUT,
93    MAX_SCOPE_CHILDREN, MAX_SCOPE_CLOSE_TIMEOUT, MAX_SCOPE_EFFECTS, MAX_SCOPE_TASKS,
94};
95pub use transaction::{
96    CapabilityProjectionAdapter, CapabilityTxn, Prepared, PreparedCapability, Staged, Validated,
97    MAX_CAPABILITY_TRANSACTION_EFFECTS,
98};
99pub use ui_binding::{
100    UiAsset, UiAssetKind, UiBinding, UiBindingError, UiBindingSpec, UiDocument,
101    MAX_UI_ASSETS_PER_KIND, MAX_UI_ASSET_BYTES, MAX_UI_DOCUMENT_BYTES, UI_BINDING_SCHEMA,
102    UI_DOCUMENT_SCHEMA,
103};
104pub use value::CapabilityValue;