@alfe.ai/gateway 0.0.8 → 0.0.9
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/health.js +99 -2
- package/package.json +2 -2
package/dist/health.js
CHANGED
|
@@ -407,6 +407,95 @@ var AuthService = class {
|
|
|
407
407
|
}
|
|
408
408
|
};
|
|
409
409
|
//#endregion
|
|
410
|
+
//#region ../../packages-internal/api-client/dist/services/integrations.js
|
|
411
|
+
var IntegrationsService = class {
|
|
412
|
+
client;
|
|
413
|
+
voiceClient;
|
|
414
|
+
constructor(client, voiceClient) {
|
|
415
|
+
this.client = client;
|
|
416
|
+
this.voiceClient = voiceClient;
|
|
417
|
+
}
|
|
418
|
+
listIntegrations(agentId) {
|
|
419
|
+
return this.client.request(`/integrations/agents/${agentId}`);
|
|
420
|
+
}
|
|
421
|
+
installIntegration(agentId, data) {
|
|
422
|
+
return this.client.request(`/integrations/agents/${agentId}`, {
|
|
423
|
+
method: "POST",
|
|
424
|
+
body: JSON.stringify(data)
|
|
425
|
+
});
|
|
426
|
+
}
|
|
427
|
+
getIntegrationConfig(agentId, integrationId) {
|
|
428
|
+
return this.client.request(`/integrations/agents/${agentId}/${integrationId}/config`);
|
|
429
|
+
}
|
|
430
|
+
updateIntegration(agentId, integrationId, data) {
|
|
431
|
+
return this.client.request(`/integrations/agents/${agentId}/${integrationId}`, {
|
|
432
|
+
method: "PATCH",
|
|
433
|
+
body: JSON.stringify(data)
|
|
434
|
+
});
|
|
435
|
+
}
|
|
436
|
+
removeIntegration(agentId, integrationId) {
|
|
437
|
+
return this.client.request(`/integrations/agents/${agentId}/${integrationId}`, { method: "DELETE" });
|
|
438
|
+
}
|
|
439
|
+
getRegistry() {
|
|
440
|
+
return this.client.request("/integrations/registry");
|
|
441
|
+
}
|
|
442
|
+
triggerSync(agentId) {
|
|
443
|
+
return this.client.request("/integrations/sync/trigger", {
|
|
444
|
+
method: "POST",
|
|
445
|
+
body: JSON.stringify({ agentId })
|
|
446
|
+
});
|
|
447
|
+
}
|
|
448
|
+
listVoices() {
|
|
449
|
+
if (this.voiceClient) return this.voiceClient.request("/api/voices");
|
|
450
|
+
return this.client.request("/integrations/voices");
|
|
451
|
+
}
|
|
452
|
+
getDiscordGuildChannels(guildId) {
|
|
453
|
+
return this.client.request(`/discord/guilds/${encodeURIComponent(guildId)}/channels`);
|
|
454
|
+
}
|
|
455
|
+
listMobileNumbers() {
|
|
456
|
+
return this.client.request("/mobile/numbers");
|
|
457
|
+
}
|
|
458
|
+
assignMobileNumber(agentId, phoneNumber) {
|
|
459
|
+
return this.client.request("/mobile/numbers/assign", {
|
|
460
|
+
method: "POST",
|
|
461
|
+
body: JSON.stringify({
|
|
462
|
+
agentId,
|
|
463
|
+
phoneNumber
|
|
464
|
+
})
|
|
465
|
+
});
|
|
466
|
+
}
|
|
467
|
+
recallJoinMeeting(agentId, meetingUrl, botName) {
|
|
468
|
+
if (this.voiceClient) return this.voiceClient.request("/api/join", {
|
|
469
|
+
method: "POST",
|
|
470
|
+
body: JSON.stringify({
|
|
471
|
+
agentId,
|
|
472
|
+
meetingUrl,
|
|
473
|
+
botName
|
|
474
|
+
})
|
|
475
|
+
});
|
|
476
|
+
return this.client.request("/integrations/recall/join", {
|
|
477
|
+
method: "POST",
|
|
478
|
+
body: JSON.stringify({
|
|
479
|
+
agentId,
|
|
480
|
+
meetingUrl,
|
|
481
|
+
botName
|
|
482
|
+
})
|
|
483
|
+
});
|
|
484
|
+
}
|
|
485
|
+
listSlackChannels(agentId) {
|
|
486
|
+
return this.client.request(`/slack/agents/${encodeURIComponent(agentId)}/channels`);
|
|
487
|
+
}
|
|
488
|
+
sendSlackMessage(agentId, channel, text) {
|
|
489
|
+
return this.client.request(`/slack/agents/${encodeURIComponent(agentId)}/send`, {
|
|
490
|
+
method: "POST",
|
|
491
|
+
body: JSON.stringify({
|
|
492
|
+
channel,
|
|
493
|
+
text
|
|
494
|
+
})
|
|
495
|
+
});
|
|
496
|
+
}
|
|
497
|
+
};
|
|
498
|
+
//#endregion
|
|
410
499
|
//#region ../../packages-internal/types/dist/lib/enum-values.js
|
|
411
500
|
/**
|
|
412
501
|
* Converts a const enum object into a non-empty readonly tuple.
|
|
@@ -20163,9 +20252,17 @@ async function startDaemon() {
|
|
|
20163
20252
|
workspace: runtimeCfg.workspace
|
|
20164
20253
|
}, "Registered OpenClaw runtime applier");
|
|
20165
20254
|
} else logger$1.warn({ runtime: name }, "Unknown runtime type — skipping");
|
|
20255
|
+
const integrationsService = new IntegrationsService(new AlfeApiClient({
|
|
20256
|
+
apiBaseUrl: config.apiEndpoint,
|
|
20257
|
+
getToken: () => Promise.resolve(config.apiKey)
|
|
20258
|
+
}));
|
|
20166
20259
|
integrationManager = new IntegrationManager({
|
|
20167
|
-
|
|
20168
|
-
|
|
20260
|
+
runtimeAppliers,
|
|
20261
|
+
registryFetcher: async () => {
|
|
20262
|
+
const result = await integrationsService.getRegistry();
|
|
20263
|
+
if (!result.ok) throw new Error(result.error);
|
|
20264
|
+
return result.data.integrations;
|
|
20265
|
+
}
|
|
20169
20266
|
});
|
|
20170
20267
|
const integrationAdapter = new IntegrationManagerAdapter(integrationManager);
|
|
20171
20268
|
cloudClient.setIntegrationManager(integrationAdapter);
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@alfe.ai/gateway",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.9",
|
|
4
4
|
"description": "Alfe local gateway daemon — persistent control plane for agent integrations",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"bin": {
|
|
@@ -25,7 +25,7 @@
|
|
|
25
25
|
"@alfe.ai/ai-proxy-local": "^0.0.2",
|
|
26
26
|
"@alfe.ai/config": "^0.0.2",
|
|
27
27
|
"@alfe.ai/doctor": "^0.0.2",
|
|
28
|
-
"@alfe.ai/integrations": "^0.0.
|
|
28
|
+
"@alfe.ai/integrations": "^0.0.3"
|
|
29
29
|
},
|
|
30
30
|
"devDependencies": {
|
|
31
31
|
"@types/ws": "^8.5.13",
|