feat: add pod feature registry slice
This commit is contained in:
@@ -9,6 +9,7 @@ use session_store::Store;
|
||||
use tokio::sync::{broadcast, mpsc, oneshot};
|
||||
|
||||
use crate::discovery::{PodDiscovery, list_pods_tool, restore_pod_tool, send_to_peer_pod_tool};
|
||||
use crate::feature::{FeatureRegistryBuilder, builtin::task_feature};
|
||||
use crate::ipc::alerter::Alerter;
|
||||
use crate::ipc::notify_buffer::NotifyBuffer;
|
||||
use crate::ipc::server::SocketServer;
|
||||
@@ -502,8 +503,6 @@ where
|
||||
let pod_store = pod.store().clone();
|
||||
let self_parent_socket = pod.callback_socket().cloned();
|
||||
|
||||
let worker = pod.worker_mut();
|
||||
|
||||
// The Pod's SharedScope (already augmented with the bash-output
|
||||
// Read rule by the caller) is the single source of truth — every
|
||||
// ScopedFs (builtin tools, fs_view, compact worker) reads from it,
|
||||
@@ -515,14 +514,19 @@ where
|
||||
// a clone for the FS view we attach below, since the tools consume
|
||||
// `fs` itself.
|
||||
let fs_for_view = fs.clone();
|
||||
worker.register_tools(tools::builtin_tools(
|
||||
pod.worker_mut().register_tools(tools::core_builtin_tools(
|
||||
fs,
|
||||
tracker.clone(),
|
||||
task_store,
|
||||
bash_output_dir,
|
||||
web_config,
|
||||
));
|
||||
|
||||
let mut feature_registry = FeatureRegistryBuilder::new();
|
||||
feature_registry.add_module(task_feature(task_store));
|
||||
let _feature_install_report = pod.install_features(feature_registry);
|
||||
|
||||
let worker = pod.worker_mut();
|
||||
|
||||
// Memory subsystem opt-in. When `[memory]` is present in the
|
||||
// manifest, register the memory-specific Read/Write/Edit tools that
|
||||
// target `<workspace>/memory/` and `<workspace>/knowledge/` with
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@@ -2,6 +2,7 @@ pub mod compact;
|
||||
pub mod controller;
|
||||
pub mod discovery;
|
||||
pub mod entrypoint;
|
||||
pub mod feature;
|
||||
pub mod fs_view;
|
||||
pub mod hook;
|
||||
pub mod ipc;
|
||||
|
||||
@@ -28,6 +28,7 @@ use manifest::{
|
||||
|
||||
use crate::compact::state::CompactState;
|
||||
use crate::compact::usage_tracker::UsageTracker;
|
||||
use crate::feature::{FeatureRegistryBuilder, FeatureRegistryInstallReport};
|
||||
use crate::hook::{
|
||||
Hook, HookPreRequestAction, HookRegistryBuilder, OnAbort, OnPromptSubmit, OnTurnEnd,
|
||||
PostToolCall, PreLlmRequest, PreRequestInfo, PreToolCall,
|
||||
@@ -784,6 +785,15 @@ impl<C: LlmClient, St: Store> Pod<C, St> {
|
||||
self.worker.as_mut().expect("worker taken during run")
|
||||
}
|
||||
|
||||
/// Install enabled feature modules into the Pod host surfaces.
|
||||
pub fn install_features(
|
||||
&mut self,
|
||||
registry: FeatureRegistryBuilder,
|
||||
) -> FeatureRegistryInstallReport {
|
||||
let worker = self.worker.as_mut().expect("worker taken during run");
|
||||
registry.install_into_worker(worker, &mut self.hook_builder)
|
||||
}
|
||||
|
||||
/// Reference to the store.
|
||||
pub fn store(&self) -> &St {
|
||||
&self.store
|
||||
|
||||
Reference in New Issue
Block a user