@alfe.ai/gateway 0.0.7 → 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.
Files changed (2) hide show
  1. package/dist/health.js +103 -8
  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.
@@ -4541,12 +4630,10 @@ function getSystemdServicePath() {
4541
4630
  function getGatewayBinPath() {
4542
4631
  const globalBin = process.env.ALFE_GATEWAY_BIN;
4543
4632
  if (globalBin) return globalBin;
4544
- const builtBin = join(import.meta.dirname, "..", "bin", "gateway.js");
4545
- if (existsSync(builtBin)) return builtBin;
4546
- try {
4547
- const resolved = execSync("node -e \"console.log(require.resolve('@alfe.ai/gateway/bin/gateway.js'))\"", { encoding: "utf-8" }).trim();
4548
- if (existsSync(resolved)) return resolved;
4549
- } catch {}
4633
+ for (const rel of ["../bin/gateway.js", "bin/gateway.js"]) {
4634
+ const candidate = join(import.meta.dirname, rel);
4635
+ if (existsSync(candidate)) return candidate;
4636
+ }
4550
4637
  return "alfe-gateway";
4551
4638
  }
4552
4639
  function getNodePath() {
@@ -20165,9 +20252,17 @@ async function startDaemon() {
20165
20252
  workspace: runtimeCfg.workspace
20166
20253
  }, "Registered OpenClaw runtime applier");
20167
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
+ }));
20168
20259
  integrationManager = new IntegrationManager({
20169
- logger: logger$1,
20170
- runtimeAppliers
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
+ }
20171
20266
  });
20172
20267
  const integrationAdapter = new IntegrationManagerAdapter(integrationManager);
20173
20268
  cloudClient.setIntegrationManager(integrationAdapter);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@alfe.ai/gateway",
3
- "version": "0.0.7",
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.2"
28
+ "@alfe.ai/integrations": "^0.0.3"
29
29
  },
30
30
  "devDependencies": {
31
31
  "@types/ws": "^8.5.13",