Skip to content

Commit f762a21

Browse files
committed
feat(provider): add embedded extension tier
1 parent b7db48b commit f762a21

5 files changed

Lines changed: 463 additions & 0 deletions

File tree

‎Cargo.lock‎

Lines changed: 1 addition & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

‎crates/jcode-provider-extensions/Cargo.toml‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ license = "MIT"
77
repository = "https://github.com/1jehuang/jcode"
88

99
[dependencies]
10+
async-trait = "0.1"
1011
jcode-provider-protocol = { path = "../jcode-provider-protocol", version = "0.1.0" }
1112
jcode-provider-subprocess = { path = "../jcode-provider-subprocess", version = "0.1.0" }
1213
serde = { version = "1", features = ["derive"] }

‎crates/jcode-provider-extensions/src/lib.rs‎

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,11 +5,16 @@
55
//! deadlines, cancellation, and frame limits outside the persistence layer.
66
77
mod bundle;
8+
mod runtime;
89

910
pub use bundle::{
1011
BundleComponents, BundleError, PLUGIN_MANIFEST_VERSION, PluginBundle, PluginManifest,
1112
SkillMetadata,
1213
};
14+
pub use runtime::{
15+
EmbeddedExtension, EmbeddedExtensionManifest, ExtensionBackend, ExtensionEvent,
16+
ExtensionInvocation, ExtensionRequest, ExtensionRuntimeRegistry,
17+
};
1318

1419
pub use jcode_provider_protocol::Frame;
1520
use jcode_provider_protocol::PROTOCOL_VERSION;
@@ -73,6 +78,14 @@ pub enum ExtensionError {
7378
provider: String,
7479
permission: Permission,
7580
},
81+
#[error("embedded extension '{0}' is already registered")]
82+
DuplicateEmbeddedExtension(String),
83+
#[error("extension '{0}' is not registered")]
84+
MissingExtension(String),
85+
#[error("extension request failed: {0}")]
86+
RequestFailed(String),
87+
#[error("extension cancellation is not supported by '{0}'")]
88+
CancellationUnsupported(String),
7689
}
7790

7891
#[derive(Debug, Clone, Default)]

0 commit comments

Comments
 (0)