feat(mcp): WhatsApp connector, archivable catalog, MCP connector config endpoint
This commit is contained in:
@@ -107,6 +107,10 @@ impl Skald {
|
||||
let container = crate::container::container_name(user_id);
|
||||
let mut specs = Vec::with_capacity(rows.len());
|
||||
for r in &rows {
|
||||
// The home mount (and its `node_modules`/`.pydeps`) survives a
|
||||
// recreate, so this is normally a hash-match no-op; it still covers
|
||||
// the case where the source changed while the user was logged in.
|
||||
crate::mcp::prepare_local_connector(self.db(), user_id, &container, r).await;
|
||||
specs.push(crate::mcp::user_row_spec_resolved(r, &container, self.db()).await);
|
||||
}
|
||||
ctx.user_mcp.connect_all(specs, false).await;
|
||||
|
||||
@@ -205,12 +205,17 @@ impl UserContextFactory {
|
||||
let upool = Arc::clone(&pool);
|
||||
let registry = Arc::clone(&self.registry_pool);
|
||||
let container = crate::container::container_name(user_id);
|
||||
let uid = user_id.to_string();
|
||||
let mname: &'static str = Box::leak(format!("mcp:{user_id}").into_boxed_str());
|
||||
self.supervisor.adopt_one(mname, tokio::spawn(async move {
|
||||
match crate::db::mcp_user_servers::all_startable(&upool).await {
|
||||
Ok(rows) => {
|
||||
let mut specs = Vec::with_capacity(rows.len());
|
||||
for r in &rows {
|
||||
// Reconcile files + node/python deps in the container
|
||||
// before starting (covers a fresh container and any
|
||||
// connector update — see `prepare_local_connector`).
|
||||
crate::mcp::prepare_local_connector(®istry, &uid, &container, r).await;
|
||||
// OAuth connectors resolve their stored refresh token into
|
||||
// the env-delivered credential here (§15).
|
||||
specs.push(crate::mcp::user_row_spec_resolved(r, &container, ®istry).await);
|
||||
|
||||
Reference in New Issue
Block a user