pub struct TsPluginBridge { /* private fields */ }Expand description
Bridge to existing TypeScript plugins.
Implementations§
Source§impl TsPluginBridge
impl TsPluginBridge
Sourcepub fn with_address(self, address: impl Into<String>) -> Self
pub fn with_address(self, address: impl Into<String>) -> Self
Set a custom IPC address.
Sourcepub fn spawn_and_connect(&mut self) -> Result<(), PluginError>
pub fn spawn_and_connect(&mut self) -> Result<(), PluginError>
Spawn the TypeScript plugin host process and connect.
This looks for a plugin-host.js or plugin-host.ts entry point
in the plugins directory and runs it with Node.js or Bun.
§Errors
Returns error if process spawn or connection fails.
Sourcepub fn is_running(&mut self) -> bool
pub fn is_running(&mut self) -> bool
Check if the host process is still running.
Sourcepub const fn skill_manifest(&self) -> Option<&SkillManifest>
pub const fn skill_manifest(&self) -> Option<&SkillManifest>
Get the cached skill manifest.
Sourcepub fn load_skills(&self) -> Result<SkillManifest, PluginError>
pub fn load_skills(&self) -> Result<SkillManifest, PluginError>
Sourcepub fn execute_tool(
&self,
name: &str,
params: Value,
) -> Result<Value, PluginError>
pub fn execute_tool( &self, name: &str, params: Value, ) -> Result<Value, PluginError>
Execute a tool registered by TypeScript plugin.
§Errors
Returns error if not connected or tool execution fails.
Trait Implementations§
Source§impl Drop for TsPluginBridge
impl Drop for TsPluginBridge
Source§impl Plugin for TsPluginBridge
Implement the Plugin trait so the bridge can be registered.
impl Plugin for TsPluginBridge
Implement the Plugin trait so the bridge can be registered.
Source§fn hooks(&self) -> &[PluginHook]
fn hooks(&self) -> &[PluginHook]
Supported hooks.
Source§fn execute_hook<'life0, 'async_trait>(
&'life0 self,
hook: PluginHook,
data: Value,
) -> Pin<Box<dyn Future<Output = Result<Value, PluginError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn execute_hook<'life0, 'async_trait>(
&'life0 self,
hook: PluginHook,
data: Value,
) -> Pin<Box<dyn Future<Output = Result<Value, PluginError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Execute a hook.
Source§fn activate<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = Result<(), PluginError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn activate<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = Result<(), PluginError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Activate the plugin.
Source§fn deactivate<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = Result<(), PluginError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn deactivate<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = Result<(), PluginError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Deactivate the plugin.
Auto Trait Implementations§
impl Freeze for TsPluginBridge
impl RefUnwindSafe for TsPluginBridge
impl Send for TsPluginBridge
impl Sync for TsPluginBridge
impl Unpin for TsPluginBridge
impl UnwindSafe for TsPluginBridge
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more