@alfe.ai/gateway 0.0.35 → 0.0.37

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 +77 -7
  2. package/package.json +2 -2
package/dist/health.js CHANGED
@@ -82,6 +82,8 @@ const ID_PREFIXES = {
82
82
  memory: "mem",
83
83
  knowledgeTriple: "kgt",
84
84
  accessCode: "acc",
85
+ pendingInject: "pij",
86
+ attachment: "att",
85
87
  run: "run",
86
88
  request: "req",
87
89
  connection: "conn",
@@ -518,6 +520,15 @@ var IntegrationsService = class {
518
520
  disconnectGoogle(agentId) {
519
521
  return this.client.request(`/google/agents/${encodeURIComponent(agentId)}/account`, { method: "DELETE" });
520
522
  }
523
+ getAtlassianSites(agentId) {
524
+ return this.client.request(`/atlassian/agents/${encodeURIComponent(agentId)}/sites`);
525
+ }
526
+ selectAtlassianSite(agentId, cloudId) {
527
+ return this.client.request(`/atlassian/agents/${encodeURIComponent(agentId)}/sites`, {
528
+ method: "PUT",
529
+ body: JSON.stringify({ cloudId })
530
+ });
531
+ }
521
532
  listSlackChannels(agentId) {
522
533
  return this.client.request(`/slack/agents/${encodeURIComponent(agentId)}/channels`);
523
534
  }
@@ -3235,6 +3246,7 @@ enumValues({
3235
3246
  object({ gracePeriodDays: number().int().positive().optional() });
3236
3247
  enumValues({
3237
3248
  Free: "free",
3249
+ Personal: "personal",
3238
3250
  Tier1: "tier_1",
3239
3251
  Tier2: "tier_2"
3240
3252
  });
@@ -3306,7 +3318,8 @@ enumValues({
3306
3318
  AdminGift: "admin_gift",
3307
3319
  ReferralCredit: "referral_credit",
3308
3320
  PromoCredit: "promo_credit",
3309
- Refund: "refund"
3321
+ Refund: "refund",
3322
+ WelcomeCredit: "welcome_credit"
3310
3323
  });
3311
3324
  enumValues({
3312
3325
  Pending: "pending",
@@ -3523,6 +3536,46 @@ enumValues({
3523
3536
  Error: "error"
3524
3537
  });
3525
3538
  //#endregion
3539
+ //#region ../../packages-internal/types/dist/notification-events.js
3540
+ const NotificationCategory = {
3541
+ Billing: "billing",
3542
+ Agents: "agents",
3543
+ Team: "team",
3544
+ Integrations: "integrations",
3545
+ System: "system"
3546
+ };
3547
+ const NotificationType = {
3548
+ PaymentSucceeded: "payment.succeeded",
3549
+ PaymentFailed: "payment.failed",
3550
+ TopUpCompleted: "top-up.completed",
3551
+ AutoRechargeCompleted: "auto-recharge.completed",
3552
+ AutoRechargeFailed: "auto-recharge.failed",
3553
+ SubscriptionCreated: "subscription.created",
3554
+ SubscriptionCancelled: "subscription.cancelled",
3555
+ SubscriptionPastDue: "subscription.past_due",
3556
+ BalanceThresholdWarning: "balance.threshold.warning",
3557
+ AgentCreated: "agent.created",
3558
+ AgentProvisionFailed: "agent.provision.failed",
3559
+ AgentBillingSuspended: "agent.billing.suspended",
3560
+ AgentDisconnectedExtended: "agent.disconnected.extended",
3561
+ InviteCreated: "onboarding.invite.created",
3562
+ OrgClaimed: "onboarding.org.claimed",
3563
+ TeamMemberAdded: "team.member.added",
3564
+ ProjectMemberAdded: "project.member.added",
3565
+ IntegrationInstalled: "integration.installed",
3566
+ IntegrationRemoved: "integration.removed"
3567
+ };
3568
+ const NotificationChannel = {
3569
+ Email: "email",
3570
+ Push: "push",
3571
+ Sms: "sms"
3572
+ };
3573
+ const RecipientStrategy = {
3574
+ TenantAdmins: "tenant_admins",
3575
+ SpecificUser: "specific_user"
3576
+ };
3577
+ NotificationType.PaymentSucceeded, NotificationCategory.Billing, RecipientStrategy.TenantAdmins, NotificationChannel.Email, NotificationChannel.Push, NotificationType.PaymentFailed, NotificationCategory.Billing, RecipientStrategy.TenantAdmins, NotificationChannel.Email, NotificationChannel.Push, NotificationChannel.Sms, NotificationType.TopUpCompleted, NotificationCategory.Billing, RecipientStrategy.TenantAdmins, NotificationChannel.Email, NotificationChannel.Push, NotificationType.AutoRechargeCompleted, NotificationCategory.Billing, RecipientStrategy.TenantAdmins, NotificationChannel.Email, NotificationType.AutoRechargeFailed, NotificationCategory.Billing, RecipientStrategy.TenantAdmins, NotificationChannel.Email, NotificationChannel.Push, NotificationChannel.Sms, NotificationType.SubscriptionCreated, NotificationCategory.Billing, RecipientStrategy.TenantAdmins, NotificationChannel.Email, NotificationType.SubscriptionCancelled, NotificationCategory.Billing, RecipientStrategy.TenantAdmins, NotificationChannel.Email, NotificationChannel.Push, NotificationType.SubscriptionPastDue, NotificationCategory.Billing, RecipientStrategy.TenantAdmins, NotificationChannel.Email, NotificationChannel.Push, NotificationChannel.Sms, NotificationType.BalanceThresholdWarning, NotificationCategory.Billing, RecipientStrategy.TenantAdmins, NotificationChannel.Email, NotificationChannel.Push, NotificationType.AgentCreated, NotificationCategory.Agents, RecipientStrategy.TenantAdmins, NotificationChannel.Email, NotificationChannel.Push, NotificationType.AgentProvisionFailed, NotificationCategory.Agents, RecipientStrategy.TenantAdmins, NotificationChannel.Email, NotificationChannel.Push, NotificationType.AgentBillingSuspended, NotificationCategory.Agents, RecipientStrategy.TenantAdmins, NotificationChannel.Email, NotificationChannel.Push, NotificationType.AgentDisconnectedExtended, NotificationCategory.Agents, RecipientStrategy.TenantAdmins, NotificationChannel.Push, NotificationType.InviteCreated, NotificationCategory.System, RecipientStrategy.SpecificUser, NotificationChannel.Email, NotificationType.OrgClaimed, NotificationCategory.System, RecipientStrategy.TenantAdmins, NotificationChannel.Email, NotificationChannel.Push, NotificationType.TeamMemberAdded, NotificationCategory.Team, RecipientStrategy.SpecificUser, NotificationChannel.Email, NotificationChannel.Push, NotificationType.ProjectMemberAdded, NotificationCategory.Team, RecipientStrategy.SpecificUser, NotificationChannel.Email, NotificationChannel.Push, NotificationType.IntegrationInstalled, NotificationCategory.Integrations, RecipientStrategy.TenantAdmins, NotificationChannel.Push, NotificationType.IntegrationRemoved, NotificationCategory.Integrations, RecipientStrategy.TenantAdmins, NotificationChannel.Push;
3578
+ //#endregion
3526
3579
  //#region src/config.ts
3527
3580
  /**
3528
3581
  * Daemon configuration — reads ~/.alfe/config.toml and resolves agent identity.
@@ -4974,20 +5027,38 @@ async function uninstallService() {
4974
5027
  if (platform === "linux") return uninstallSystemd();
4975
5028
  throw new Error(`Unsupported platform: ${platform}`);
4976
5029
  }
5030
+ function getLaunchdUid() {
5031
+ return execSync("id -u", { encoding: "utf-8" }).trim();
5032
+ }
4977
5033
  async function installLaunchd() {
4978
5034
  const plistPath = getLaunchdPlistPath();
4979
- await mkdir(join(homedir(), "Library", "LaunchAgents"), { recursive: true });
5035
+ const dir = join(homedir(), "Library", "LaunchAgents");
5036
+ const logsDir = join(homedir(), ".alfe", "logs");
5037
+ await mkdir(dir, { recursive: true });
5038
+ await mkdir(logsDir, { recursive: true });
4980
5039
  await writeFile(plistPath, generateLaunchdPlist(), "utf-8");
4981
5040
  logger$1.info({ path: plistPath }, "Wrote launchd plist");
5041
+ const uid = getLaunchdUid();
4982
5042
  try {
4983
- execSync(`launchctl load ${plistPath}`, { stdio: "pipe" });
5043
+ execSync(`launchctl bootout gui/${uid}/${LAUNCHD_LABEL}`, { stdio: "pipe" });
4984
5044
  } catch {}
5045
+ try {
5046
+ execSync(`launchctl bootstrap gui/${uid} ${plistPath}`, { stdio: "pipe" });
5047
+ } catch (err) {
5048
+ const msg = err instanceof Error ? err.message : String(err);
5049
+ logger$1.error({
5050
+ err: msg,
5051
+ plistPath
5052
+ }, "launchctl bootstrap failed");
5053
+ return `Installed plist at ${plistPath}, but failed to bootstrap service: ${msg}`;
5054
+ }
4985
5055
  return `Installed: ${plistPath}\nService will start on boot and restart on crash.`;
4986
5056
  }
4987
5057
  async function uninstallLaunchd() {
4988
5058
  const plistPath = getLaunchdPlistPath();
5059
+ const uid = getLaunchdUid();
4989
5060
  try {
4990
- execSync(`launchctl unload ${plistPath}`, { stdio: "pipe" });
5061
+ execSync(`launchctl bootout gui/${uid}/${LAUNCHD_LABEL}`, { stdio: "pipe" });
4991
5062
  } catch {}
4992
5063
  try {
4993
5064
  await unlink(plistPath);
@@ -5033,9 +5104,8 @@ async function uninstallSystemd() {
5033
5104
  function startService() {
5034
5105
  const platform = process.platform;
5035
5106
  if (platform === "darwin") {
5036
- const plistPath = getLaunchdPlistPath();
5037
- execSync(`launchctl start ${LAUNCHD_LABEL}`, { stdio: "pipe" });
5038
- logger$1.info({ path: plistPath }, "Started launchd service");
5107
+ execSync(`launchctl kickstart -k gui/${getLaunchdUid()}/${LAUNCHD_LABEL}`, { stdio: "pipe" });
5108
+ logger$1.info("Started launchd service");
5039
5109
  return;
5040
5110
  }
5041
5111
  if (platform === "linux") {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@alfe.ai/gateway",
3
- "version": "0.0.35",
3
+ "version": "0.0.37",
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.7",
26
26
  "@alfe.ai/config": "^0.0.7",
27
27
  "@alfe.ai/integration-manifest": "^0.0.9",
28
- "@alfe.ai/integrations": "^0.0.23"
28
+ "@alfe.ai/integrations": "^0.0.24"
29
29
  },
30
30
  "license": "UNLICENSED",
31
31
  "scripts": {