@alfe.ai/gateway 0.0.24 → 0.0.26
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 +134 -12
- package/package.json +3 -9
package/dist/health.js
CHANGED
|
@@ -74,6 +74,10 @@ const ID_PREFIXES = {
|
|
|
74
74
|
onboardingSession: "obs",
|
|
75
75
|
inviteToken: "inv",
|
|
76
76
|
claimToken: "clm",
|
|
77
|
+
usageLimit: "lim",
|
|
78
|
+
team: "team",
|
|
79
|
+
project: "proj",
|
|
80
|
+
goal: "goal",
|
|
77
81
|
run: "run",
|
|
78
82
|
request: "req",
|
|
79
83
|
connection: "conn",
|
|
@@ -360,6 +364,21 @@ var AuthService = class {
|
|
|
360
364
|
body: JSON.stringify(input)
|
|
361
365
|
});
|
|
362
366
|
}
|
|
367
|
+
getSubscriptionStatus() {
|
|
368
|
+
return this.client.request(`${this.prefix}/subscription`);
|
|
369
|
+
}
|
|
370
|
+
applyForStartup(input) {
|
|
371
|
+
return this.client.request(`${this.prefix}/subscription/apply-startup`, {
|
|
372
|
+
method: "POST",
|
|
373
|
+
body: JSON.stringify(input)
|
|
374
|
+
});
|
|
375
|
+
}
|
|
376
|
+
createCheckoutSession(input) {
|
|
377
|
+
return this.client.request(`${this.prefix}/subscription/checkout`, {
|
|
378
|
+
method: "POST",
|
|
379
|
+
body: JSON.stringify(input)
|
|
380
|
+
});
|
|
381
|
+
}
|
|
363
382
|
};
|
|
364
383
|
//#endregion
|
|
365
384
|
//#region ../../packages-internal/api-client/dist/services/integrations.js
|
|
@@ -370,6 +389,39 @@ var IntegrationsService = class {
|
|
|
370
389
|
this.client = client;
|
|
371
390
|
this.voiceClient = voiceClient;
|
|
372
391
|
}
|
|
392
|
+
listScopedInstalls(scope, scopeId) {
|
|
393
|
+
const params = new URLSearchParams({
|
|
394
|
+
scope,
|
|
395
|
+
scopeId
|
|
396
|
+
});
|
|
397
|
+
return this.client.request(`/integrations/scoped?${params}`);
|
|
398
|
+
}
|
|
399
|
+
installScoped(data) {
|
|
400
|
+
return this.client.request("/integrations/scoped", {
|
|
401
|
+
method: "POST",
|
|
402
|
+
body: JSON.stringify(data)
|
|
403
|
+
});
|
|
404
|
+
}
|
|
405
|
+
getScopedInstall(integrationId, scope, scopeId) {
|
|
406
|
+
const params = new URLSearchParams({
|
|
407
|
+
scope,
|
|
408
|
+
scopeId
|
|
409
|
+
});
|
|
410
|
+
return this.client.request(`/integrations/scoped/${encodeURIComponent(integrationId)}?${params}`);
|
|
411
|
+
}
|
|
412
|
+
updateScopedInstall(integrationId, data) {
|
|
413
|
+
return this.client.request(`/integrations/scoped/${encodeURIComponent(integrationId)}`, {
|
|
414
|
+
method: "PATCH",
|
|
415
|
+
body: JSON.stringify(data)
|
|
416
|
+
});
|
|
417
|
+
}
|
|
418
|
+
removeScopedInstall(integrationId, scope, scopeId) {
|
|
419
|
+
const params = new URLSearchParams({
|
|
420
|
+
scope,
|
|
421
|
+
scopeId
|
|
422
|
+
});
|
|
423
|
+
return this.client.request(`/integrations/scoped/${encodeURIComponent(integrationId)}?${params}`, { method: "DELETE" });
|
|
424
|
+
}
|
|
373
425
|
listIntegrations(agentId) {
|
|
374
426
|
return this.client.request(`/integrations/agents/${agentId}`);
|
|
375
427
|
}
|
|
@@ -391,6 +443,9 @@ var IntegrationsService = class {
|
|
|
391
443
|
removeIntegration(agentId, integrationId) {
|
|
392
444
|
return this.client.request(`/integrations/agents/${agentId}/${integrationId}`, { method: "DELETE" });
|
|
393
445
|
}
|
|
446
|
+
reinstallIntegration(agentId, integrationId) {
|
|
447
|
+
return this.client.request(`/integrations/agents/${agentId}/${integrationId}/reinstall`, { method: "POST" });
|
|
448
|
+
}
|
|
394
449
|
getRegistry() {
|
|
395
450
|
return this.client.request("/integrations/registry");
|
|
396
451
|
}
|
|
@@ -410,12 +465,13 @@ var IntegrationsService = class {
|
|
|
410
465
|
listMobileNumbers() {
|
|
411
466
|
return this.client.request("/mobile/numbers");
|
|
412
467
|
}
|
|
413
|
-
assignMobileNumber(agentId, phoneNumber) {
|
|
468
|
+
assignMobileNumber(agentId, phoneNumber, phoneSid) {
|
|
414
469
|
return this.client.request("/mobile/numbers/assign", {
|
|
415
470
|
method: "POST",
|
|
416
471
|
body: JSON.stringify({
|
|
417
472
|
agentId,
|
|
418
|
-
phoneNumber
|
|
473
|
+
phoneNumber,
|
|
474
|
+
phoneSid
|
|
419
475
|
})
|
|
420
476
|
});
|
|
421
477
|
}
|
|
@@ -3138,13 +3194,29 @@ enumValues({
|
|
|
3138
3194
|
enumValues({
|
|
3139
3195
|
Anthropic: "anthropic",
|
|
3140
3196
|
OpenAI: "openai",
|
|
3141
|
-
ElevenLabs: "elevenlabs"
|
|
3197
|
+
ElevenLabs: "elevenlabs",
|
|
3198
|
+
Twilio: "twilio"
|
|
3142
3199
|
});
|
|
3143
3200
|
enumValues({
|
|
3144
3201
|
Month: "month",
|
|
3145
3202
|
Year: "year"
|
|
3146
3203
|
});
|
|
3147
3204
|
object({ gracePeriodDays: number().int().positive().optional() });
|
|
3205
|
+
enumValues({
|
|
3206
|
+
Free: "free",
|
|
3207
|
+
Tier1: "tier_1",
|
|
3208
|
+
Tier2: "tier_2"
|
|
3209
|
+
});
|
|
3210
|
+
enumValues({
|
|
3211
|
+
Pending: "pending",
|
|
3212
|
+
Approved: "approved",
|
|
3213
|
+
Denied: "denied"
|
|
3214
|
+
});
|
|
3215
|
+
enumValues({
|
|
3216
|
+
PreSeed: "pre-seed",
|
|
3217
|
+
Seed: "seed",
|
|
3218
|
+
SeriesA: "series-a"
|
|
3219
|
+
});
|
|
3148
3220
|
enumValues({
|
|
3149
3221
|
Active: "active",
|
|
3150
3222
|
Pending: "pending",
|
|
@@ -3167,6 +3239,12 @@ enumValues({
|
|
|
3167
3239
|
OpenClaw: "openclaw",
|
|
3168
3240
|
NanoClaw: "nanoclaw"
|
|
3169
3241
|
});
|
|
3242
|
+
enumValues({
|
|
3243
|
+
Org: "org",
|
|
3244
|
+
Team: "team",
|
|
3245
|
+
Project: "project",
|
|
3246
|
+
Agent: "agent"
|
|
3247
|
+
});
|
|
3170
3248
|
enumValues({
|
|
3171
3249
|
Active: "active",
|
|
3172
3250
|
Removed: "removed"
|
|
@@ -3203,7 +3281,14 @@ enumValues({
|
|
|
3203
3281
|
Hour: "hour",
|
|
3204
3282
|
Day: "day",
|
|
3205
3283
|
Week: "week",
|
|
3206
|
-
Month: "month"
|
|
3284
|
+
Month: "month",
|
|
3285
|
+
Year: "year"
|
|
3286
|
+
});
|
|
3287
|
+
enumValues({
|
|
3288
|
+
Tenant: "tenant",
|
|
3289
|
+
Agent: "agent",
|
|
3290
|
+
Team: "team",
|
|
3291
|
+
Project: "project"
|
|
3207
3292
|
});
|
|
3208
3293
|
enumValues({
|
|
3209
3294
|
Active: "active",
|
|
@@ -3219,7 +3304,8 @@ enumValues({
|
|
|
3219
3304
|
enumValues({
|
|
3220
3305
|
BalanceCredit: "balance_credit",
|
|
3221
3306
|
SubscriptionDiscount: "subscription_discount",
|
|
3222
|
-
FreeTrial: "free_trial"
|
|
3307
|
+
FreeTrial: "free_trial",
|
|
3308
|
+
UsageDiscount: "usage_discount"
|
|
3223
3309
|
});
|
|
3224
3310
|
enumValues({
|
|
3225
3311
|
Active: "active",
|
|
@@ -3236,6 +3322,10 @@ enumValues({
|
|
|
3236
3322
|
Consumed: "consumed",
|
|
3237
3323
|
Expired: "expired"
|
|
3238
3324
|
});
|
|
3325
|
+
enumValues({
|
|
3326
|
+
Admin: "admin",
|
|
3327
|
+
Promo: "promo"
|
|
3328
|
+
});
|
|
3239
3329
|
enumValues({
|
|
3240
3330
|
Synced: "synced",
|
|
3241
3331
|
Stale: "stale",
|
|
@@ -3310,6 +3400,32 @@ enumValues({
|
|
|
3310
3400
|
Dashboard: "dashboard",
|
|
3311
3401
|
Agent: "agent"
|
|
3312
3402
|
});
|
|
3403
|
+
enumValues({
|
|
3404
|
+
Agent: "agent",
|
|
3405
|
+
Human: "human"
|
|
3406
|
+
});
|
|
3407
|
+
enumValues({
|
|
3408
|
+
Admin: "admin",
|
|
3409
|
+
Member: "member"
|
|
3410
|
+
});
|
|
3411
|
+
enumValues({
|
|
3412
|
+
Active: "active",
|
|
3413
|
+
Completed: "completed",
|
|
3414
|
+
Archived: "archived"
|
|
3415
|
+
});
|
|
3416
|
+
enumValues({
|
|
3417
|
+
Todo: "todo",
|
|
3418
|
+
InProgress: "in-progress",
|
|
3419
|
+
Done: "done"
|
|
3420
|
+
});
|
|
3421
|
+
enumValues({ Flex: "flex" });
|
|
3422
|
+
enumValues({
|
|
3423
|
+
Provisioning: "provisioning",
|
|
3424
|
+
Active: "active",
|
|
3425
|
+
Suspended: "suspended",
|
|
3426
|
+
Deleting: "deleting",
|
|
3427
|
+
Error: "error"
|
|
3428
|
+
});
|
|
3313
3429
|
//#endregion
|
|
3314
3430
|
//#region src/config.ts
|
|
3315
3431
|
/**
|
|
@@ -3751,14 +3867,8 @@ var ReconciliationEngine = class {
|
|
|
3751
3867
|
}
|
|
3752
3868
|
if (local.version !== desired.version && desired.version !== "" && local.version !== "unknown") {
|
|
3753
3869
|
log$2.info(`Upgrading ${id}: ${local.version} → ${desired.version}`);
|
|
3754
|
-
|
|
3755
|
-
await this.manager.deactivate(id);
|
|
3756
|
-
await this.manager.uninstall(id);
|
|
3757
|
-
} catch {}
|
|
3758
|
-
await this.manager.install(id, desired.version, desired.config);
|
|
3870
|
+
await this.manager.reinstall(id, desired.version, desired.config);
|
|
3759
3871
|
report.installed.push(id);
|
|
3760
|
-
log$2.info(`Activating ${id}`);
|
|
3761
|
-
await this.manager.activate(id);
|
|
3762
3872
|
report.activated.push(id);
|
|
3763
3873
|
report.results.push({
|
|
3764
3874
|
integrationId: id,
|
|
@@ -3778,6 +3888,18 @@ var ReconciliationEngine = class {
|
|
|
3778
3888
|
});
|
|
3779
3889
|
return;
|
|
3780
3890
|
}
|
|
3891
|
+
if (desired.reinstallRequestedAt && local.installedAt && desired.reinstallRequestedAt > local.installedAt) {
|
|
3892
|
+
log$2.info(`Reinstall requested for ${id} (requested: ${desired.reinstallRequestedAt}, installed: ${local.installedAt})`);
|
|
3893
|
+
await this.manager.reinstall(id, desired.version, desired.config);
|
|
3894
|
+
report.installed.push(id);
|
|
3895
|
+
report.activated.push(id);
|
|
3896
|
+
report.results.push({
|
|
3897
|
+
integrationId: id,
|
|
3898
|
+
action: "installed",
|
|
3899
|
+
actualStatus: "active"
|
|
3900
|
+
});
|
|
3901
|
+
return;
|
|
3902
|
+
}
|
|
3781
3903
|
report.results.push({
|
|
3782
3904
|
integrationId: id,
|
|
3783
3905
|
action: "up_to_date",
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@alfe.ai/gateway",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.26",
|
|
4
4
|
"description": "Alfe local gateway daemon — persistent control plane for agent integrations",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"bin": {
|
|
@@ -24,14 +24,8 @@
|
|
|
24
24
|
"ws": "^8.18.0",
|
|
25
25
|
"@alfe.ai/ai-proxy-local": "^0.0.5",
|
|
26
26
|
"@alfe.ai/config": "^0.0.5",
|
|
27
|
-
"@alfe.ai/integration-manifest": "^0.0.
|
|
28
|
-
"@alfe.ai/integrations": "^0.0.
|
|
29
|
-
},
|
|
30
|
-
"devDependencies": {
|
|
31
|
-
"@types/ws": "^8.5.13",
|
|
32
|
-
"tsx": "^4.19.0",
|
|
33
|
-
"@alfe/api-client": "0.1.1",
|
|
34
|
-
"@alfe/ids": "0.1.0"
|
|
27
|
+
"@alfe.ai/integration-manifest": "^0.0.7",
|
|
28
|
+
"@alfe.ai/integrations": "^0.0.17"
|
|
35
29
|
},
|
|
36
30
|
"license": "UNLICENSED",
|
|
37
31
|
"scripts": {
|