feat(connectors): /api/connectors/call — proxy a connector tool call (pre-chat)
Neuron Soul CI / build (pull_request) Failing after 21m3s
Neuron Soul CI / build (pull_request) Failing after 21m3s
Adds /api/connectors/call -> connectd /mcp/call, so the app can invoke a connector tool (e.g. WhatsApp get_pairing_qr / get_login_status for the pairing UI) through the soul, keeping app->soul->connectd intact (UI never hits connectd directly) and working for future remote/hosted clients. elc-clean. NOTE: soul-core change — needs dist/soul.c regen (Will), can ride the same rebuild as PR #56. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This commit is contained in:
@@ -335,6 +335,12 @@ fn handle_connectors(method: String, clean: String, body: String) -> String {
|
||||
if str_eq(clean, "/api/connectors/oauth/start") {
|
||||
return connectd_post("/mcp/oauth/start", body)
|
||||
}
|
||||
// Call a connector tool directly (pre-chat), e.g. WhatsApp get_pairing_qr / get_login_status for
|
||||
// the pairing UI. Body: {"name":"mcp__<server>__<tool>","input":{...}}. Keeps the app on the
|
||||
// app->soul->connectd path (the UI never hits connectd directly) and works for remote/hosted apps.
|
||||
if str_eq(clean, "/api/connectors/call") {
|
||||
return connectd_post("/mcp/call", body)
|
||||
}
|
||||
return "{\"ok\":false,\"error\":\"unknown connectors route\"}"
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user