@alfe.ai/gateway 0.1.1 → 0.1.3

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 +35 -10
  2. package/package.json +5 -5
package/dist/health.js CHANGED
@@ -93,6 +93,7 @@ const ID_PREFIXES = {
93
93
  role: "role",
94
94
  directGrant: "dgr",
95
95
  oauthConnection: "con",
96
+ channel: "chn",
96
97
  oauthConnectionRequest: "crq",
97
98
  deviceCode: "dvc",
98
99
  attachment: "att",
@@ -584,8 +585,9 @@ var IntegrationsService = class {
584
585
  });
585
586
  return this.client.request(`/integrations/scoped/${encodeURIComponent(integrationId)}?${params}`, { method: "DELETE" });
586
587
  }
587
- listIntegrations(agentId) {
588
- return this.client.request(`/integrations/agents/${agentId}`);
588
+ listIntegrations(agentId, options) {
589
+ const qs = options?.includeInherited ? "?includeInherited=true" : "";
590
+ return this.client.request(`/integrations/agents/${agentId}${qs}`);
589
591
  }
590
592
  installIntegration(agentId, data) {
591
593
  return this.client.request(`/integrations/agents/${agentId}`, {
@@ -4352,7 +4354,8 @@ enumValues({
4352
4354
  ElevenLabs: "elevenlabs",
4353
4355
  Twilio: "twilio",
4354
4356
  ClaudeMax: "claude-max",
4355
- OpenAICodexMax: "openai-codex-max"
4357
+ OpenAICodexMax: "openai-codex-max",
4358
+ GeminiMax: "gemini-max"
4356
4359
  });
4357
4360
  enumValues({
4358
4361
  Month: "month",
@@ -4410,6 +4413,7 @@ enumValues({
4410
4413
  Project: "project",
4411
4414
  Agent: "agent"
4412
4415
  });
4416
+ ["alfe"].filter((id) => id !== "alfe");
4413
4417
  enumValues({
4414
4418
  Public: "public",
4415
4419
  Hidden: "hidden"
@@ -5163,7 +5167,7 @@ var ReconciliationEngine = class {
5163
5167
  try {
5164
5168
  if (!local) {
5165
5169
  log$2.info(`Installing ${id}@${desired.version}`);
5166
- await this.manager.install(id, desired.version, desired.config);
5170
+ await this.manager.install(id, desired.version, desired.config, desired.customSource);
5167
5171
  report.installed.push(id);
5168
5172
  log$2.info(`Activating ${id}`);
5169
5173
  if ((await this.manager.activate(id)).configApplied) report.configApplied = true;
@@ -5177,7 +5181,7 @@ var ReconciliationEngine = class {
5177
5181
  }
5178
5182
  if (local.version !== desired.version && desired.version !== "" && local.version !== "unknown") {
5179
5183
  log$2.info(`Upgrading ${id}: ${local.version} → ${desired.version}`);
5180
- if ((await this.manager.reinstall(id, desired.version, desired.config)).configApplied) report.configApplied = true;
5184
+ if ((await this.manager.reinstall(id, desired.version, desired.config, desired.customSource)).configApplied) report.configApplied = true;
5181
5185
  report.installed.push(id);
5182
5186
  report.activated.push(id);
5183
5187
  report.results.push({
@@ -5191,7 +5195,7 @@ var ReconciliationEngine = class {
5191
5195
  if (desired.reinstallRequestedAt && local.installedAt && desired.reinstallRequestedAt > local.installedAt) {
5192
5196
  log$2.info(`Reinstalling ${id} from error state (requested: ${desired.reinstallRequestedAt}, installed: ${local.installedAt})`);
5193
5197
  this.manager.resetReinstallAttempts(id);
5194
- if ((await this.manager.reinstall(id, desired.version, desired.config)).configApplied) report.configApplied = true;
5198
+ if ((await this.manager.reinstall(id, desired.version, desired.config, desired.customSource)).configApplied) report.configApplied = true;
5195
5199
  report.installed.push(id);
5196
5200
  report.activated.push(id);
5197
5201
  report.results.push({
@@ -5220,7 +5224,7 @@ var ReconciliationEngine = class {
5220
5224
  log$2.info(`Auto-reinstalling ${id} — install directory is corrupted or missing (attempt ${String(attempts + 1)}/3)`);
5221
5225
  this.manager.incrementReinstallAttempts(id);
5222
5226
  try {
5223
- if ((await this.manager.reinstall(id, desired.version, desired.config)).configApplied) report.configApplied = true;
5227
+ if ((await this.manager.reinstall(id, desired.version, desired.config, desired.customSource)).configApplied) report.configApplied = true;
5224
5228
  this.manager.resetReinstallAttempts(id);
5225
5229
  report.installed.push(id);
5226
5230
  report.activated.push(id);
@@ -5272,7 +5276,7 @@ var ReconciliationEngine = class {
5272
5276
  if (desired.reinstallRequestedAt && local.installedAt && desired.reinstallRequestedAt > local.installedAt) {
5273
5277
  log$2.info(`Reinstall requested for ${id} (requested: ${desired.reinstallRequestedAt}, installed: ${local.installedAt})`);
5274
5278
  this.manager.resetReinstallAttempts(id);
5275
- if ((await this.manager.reinstall(id, desired.version, desired.config)).configApplied) report.configApplied = true;
5279
+ if ((await this.manager.reinstall(id, desired.version, desired.config, desired.customSource)).configApplied) report.configApplied = true;
5276
5280
  report.installed.push(id);
5277
5281
  report.activated.push(id);
5278
5282
  report.results.push({
@@ -22088,7 +22092,28 @@ let stopPairingApprovalPoller = null;
22088
22092
  * `undefined` for unknown providers and on 404/network error so the
22089
22093
  * applier can skip registration silently (its documented contract).
22090
22094
  */
22091
- async function fetchProviderCredentials(agentApi, provider) {
22095
+ async function fetchProviderCredentials(agentApi, provider, connectionId) {
22096
+ if (connectionId) try {
22097
+ const raw = await agentApi.getConnectionCredentials(connectionId);
22098
+ const fields = { ...raw.providerMetadata ?? {} };
22099
+ if (typeof raw.accessToken === "string" && raw.accessToken.length > 0) try {
22100
+ const bundle = JSON.parse(raw.accessToken);
22101
+ if (bundle && typeof bundle === "object" && !Array.isArray(bundle)) Object.assign(fields, bundle);
22102
+ } catch (err) {
22103
+ logger$1.warn({
22104
+ connectionId,
22105
+ err: err instanceof Error ? err.message : String(err)
22106
+ }, "Custom connection accessToken is not a JSON bundle — exposing as accessToken field");
22107
+ fields.accessToken = raw.accessToken;
22108
+ }
22109
+ return fields;
22110
+ } catch (err) {
22111
+ logger$1.warn({
22112
+ connectionId,
22113
+ err: err instanceof Error ? err.message : String(err)
22114
+ }, "Failed to resolve connection-scoped credentials — MCP server will be skipped");
22115
+ return;
22116
+ }
22092
22117
  const key = provider.toLowerCase();
22093
22118
  try {
22094
22119
  switch (key) {
@@ -22356,7 +22381,7 @@ async function startDaemon() {
22356
22381
  runtimeAppliers,
22357
22382
  mcpApplier: new McpApplier({
22358
22383
  manager: mcpManager,
22359
- credentials: { getCredentials: (provider) => fetchProviderCredentials(agentApi, provider) },
22384
+ credentials: { getCredentials: (provider, opts) => fetchProviderCredentials(agentApi, provider, opts?.connectionId) },
22360
22385
  platform: { apiUrl: config.apiEndpoint }
22361
22386
  }),
22362
22387
  registryFetcher: async () => {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@alfe.ai/gateway",
3
- "version": "0.1.1",
3
+ "version": "0.1.3",
4
4
  "description": "Alfe local gateway daemon — persistent control plane for agent integrations",
5
5
  "type": "module",
6
6
  "bin": {
@@ -22,12 +22,12 @@
22
22
  "pino-roll": "^1.2.0",
23
23
  "smol-toml": ">=1.6.1",
24
24
  "ws": "^8.18.0",
25
- "@alfe.ai/agent-api-client": "^0.1.4",
25
+ "@alfe.ai/agent-api-client": "^0.2.2",
26
26
  "@alfe.ai/ai-proxy-local": "^0.0.10",
27
27
  "@alfe.ai/config": "^0.0.9",
28
- "@alfe.ai/integration-manifest": "^0.1.0",
29
- "@alfe.ai/integrations": "^0.1.1",
30
- "@alfe.ai/mcp-bundler": "^0.1.1"
28
+ "@alfe.ai/integration-manifest": "^0.2.1",
29
+ "@alfe.ai/integrations": "^0.1.3",
30
+ "@alfe.ai/mcp-bundler": "^0.2.0"
31
31
  },
32
32
  "license": "UNLICENSED",
33
33
  "scripts": {