@agenticmail/enterprise 0.5.4 → 0.5.6

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 (50) hide show
  1. package/dist/chunk-2AHKTK2N.js +819 -0
  2. package/dist/chunk-2ESYSVXG.js +48 -0
  3. package/dist/chunk-6CVIA5YL.js +808 -0
  4. package/dist/chunk-FVXEXRP2.js +12666 -0
  5. package/dist/chunk-OZZ65RAG.js +9040 -0
  6. package/dist/chunk-P2FILRUE.js +591 -0
  7. package/dist/chunk-Q3ZHFVGV.js +48 -0
  8. package/dist/chunk-TCIGK4HQ.js +1943 -0
  9. package/dist/chunk-WI62KTVK.js +3455 -0
  10. package/dist/cidr-O6T7HDUD.js +17 -0
  11. package/dist/cli-build-skill-AE7QC5C5.js +235 -0
  12. package/dist/cli-build-skill-MP6K4ZXO.js +235 -0
  13. package/dist/cli-recover-5M74V7V4.js +97 -0
  14. package/dist/cli-recover-5VWKSBTE.js +97 -0
  15. package/dist/cli-submit-skill-6AAQWZWW.js +162 -0
  16. package/dist/cli-submit-skill-LDFJGSKO.js +162 -0
  17. package/dist/cli-validate-DHESCL7V.js +148 -0
  18. package/dist/cli-validate-QTV6662P.js +148 -0
  19. package/dist/cli-verify-G27G44PM.js +98 -0
  20. package/dist/cli.js +13 -13
  21. package/dist/config-store-YW6BMVSU.js +58 -0
  22. package/dist/db-adapter-WPKXQDEY.js +7 -0
  23. package/dist/domain-lock-XXXJIX7D.js +7 -0
  24. package/dist/dynamodb-33B2BXRN.js +426 -0
  25. package/dist/esm-BZF7GNJD.js +5090 -0
  26. package/dist/factory-X6SKUEDX.js +9 -0
  27. package/dist/firewall-ZGR2AGAP.js +10 -0
  28. package/dist/index.js +35 -35
  29. package/dist/managed-J3QQMQQJ.js +16 -0
  30. package/dist/mongodb-KTICSLUI.js +319 -0
  31. package/dist/mysql-VIFJFM4A.js +574 -0
  32. package/dist/postgres-A67RQTZX.js +575 -0
  33. package/dist/registry/cli.js +1 -1
  34. package/dist/routes-F22OJNEY.js +5674 -0
  35. package/dist/runtime-TCAE7QSD.js +47 -0
  36. package/dist/server-B27VUUU6.js +11 -0
  37. package/dist/setup-HJ4PTUSA.js +20 -0
  38. package/dist/setup-UIQKEGIG.js +20 -0
  39. package/dist/skills-NJKTYIGZ.js +14 -0
  40. package/dist/sqlite-Y6GS6AE3.js +490 -0
  41. package/dist/turso-A7AO3JDH.js +495 -0
  42. package/package.json +1 -1
  43. package/src/cli.ts +13 -13
  44. package/src/domain-lock/cli-recover.ts +4 -4
  45. package/src/domain-lock/cli-verify.ts +3 -3
  46. package/src/engine/cli-build-skill.ts +2 -2
  47. package/src/engine/cli-submit-skill.ts +3 -3
  48. package/src/engine/cli-validate.ts +3 -3
  49. package/src/setup/index.ts +19 -3
  50. package/src/setup/registration.ts +4 -4
@@ -15,6 +15,9 @@
15
15
  */
16
16
 
17
17
  import { execSync } from 'child_process';
18
+ import { createRequire } from 'module';
19
+ import { fileURLToPath } from 'url';
20
+ import { dirname, join } from 'path';
18
21
  import { promptCompanyInfo } from './company.js';
19
22
  import { promptDatabase } from './database.js';
20
23
  import { promptDeployment } from './deployment.js';
@@ -54,26 +57,39 @@ async function ensureDbDriver(dbType: string, ora: any, chalk: any): Promise<voi
54
57
  const packages = DB_DRIVER_MAP[dbType];
55
58
  if (!packages?.length) return;
56
59
 
60
+ // Resolve the enterprise package's own directory for installing drivers
61
+ const __filename = fileURLToPath(import.meta.url);
62
+ const pkgDir = join(dirname(__filename), '..');
63
+
57
64
  const missing: string[] = [];
58
65
  for (const pkg of packages) {
59
66
  try {
60
- await import(pkg);
67
+ // Check if resolvable from the package directory
68
+ const require = createRequire(join(pkgDir, 'node_modules', '.package-lock.json'));
69
+ require.resolve(pkg);
61
70
  } catch {
62
- missing.push(pkg);
71
+ // Also try dynamic import as fallback
72
+ try {
73
+ await import(pkg);
74
+ } catch {
75
+ missing.push(pkg);
76
+ }
63
77
  }
64
78
  }
65
79
  if (!missing.length) return;
66
80
 
67
81
  const spinner = ora(`Installing database driver: ${missing.join(', ')}...`).start();
68
82
  try {
83
+ // Install into the enterprise package's node_modules so dynamic imports find them
69
84
  execSync(`npm install --no-save ${missing.join(' ')}`, {
70
85
  stdio: 'pipe',
71
86
  timeout: 120_000,
87
+ cwd: pkgDir,
72
88
  });
73
89
  spinner.succeed(`Database driver installed: ${missing.join(', ')}`);
74
90
  } catch (err: any) {
75
91
  spinner.fail(`Failed to install ${missing.join(', ')}`);
76
- console.error(chalk.red(`\n Run manually: npm install ${missing.join(' ')}\n`));
92
+ console.error(chalk.red(`\n Run manually: cd ${pkgDir} && npm install ${missing.join(' ')}\n`));
77
93
  process.exit(1);
78
94
  }
79
95
  }
@@ -94,7 +94,7 @@ export async function promptRegistration(
94
94
  spinner.fail('Domain already registered');
95
95
  console.log('');
96
96
  console.log(chalk.yellow(' This domain is already registered and verified.'));
97
- console.log(chalk.dim(' If this is your domain, use: agenticmail-enterprise recover'));
97
+ console.log(chalk.dim(' If this is your domain, use: npx @agenticmail/enterprise recover'));
98
98
  console.log('');
99
99
 
100
100
  const { continueAnyway } = await inquirer.prompt([{
@@ -121,7 +121,7 @@ export async function promptRegistration(
121
121
  spinner.warn('Registry unavailable');
122
122
  console.log('');
123
123
  console.log(chalk.yellow(` Could not reach registry: ${err.message}`));
124
- console.log(chalk.dim(' You can register later with: agenticmail-enterprise verify-domain'));
124
+ console.log(chalk.dim(' You can register later with: npx @agenticmail/enterprise verify-domain'));
125
125
  console.log('');
126
126
 
127
127
  const { continueAnyway } = await inquirer.prompt([{
@@ -209,11 +209,11 @@ export async function promptRegistration(
209
209
  await new Promise(r => setTimeout(r, 10_000));
210
210
  } else {
211
211
  spinner.info('DNS record not found yet');
212
- console.log(chalk.dim(' Run later: agenticmail-enterprise verify-domain'));
212
+ console.log(chalk.dim(' Run later: npx @agenticmail/enterprise verify-domain'));
213
213
  }
214
214
  }
215
215
  } else {
216
- console.log(chalk.dim(' Run when ready: agenticmail-enterprise verify-domain'));
216
+ console.log(chalk.dim(' Run when ready: npx @agenticmail/enterprise verify-domain'));
217
217
  }
218
218
 
219
219
  console.log('');