aios-core 4.4.3 → 4.4.4

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.
@@ -7,8 +7,8 @@
7
7
  # - SHA256 hashes for change detection
8
8
  # - File types for categorization
9
9
  #
10
- version: 4.4.3
11
- generated_at: "2026-02-25T00:54:57.457Z"
10
+ version: 4.4.4
11
+ generated_at: "2026-02-25T01:37:46.325Z"
12
12
  generator: scripts/generate-install-manifest.js
13
13
  file_count: 1084
14
14
  files:
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "aios-core",
3
- "version": "4.4.3",
3
+ "version": "4.4.4",
4
4
  "description": "Synkra AIOS: AI-Orchestrated System for Full Stack Development - Core Framework",
5
5
  "bin": {
6
6
  "aios": "bin/aios.js",
@@ -122,6 +122,7 @@ const TRANSLATIONS = {
122
122
  proKeyInvalid: 'Invalid format. Expected: PRO-XXXX-XXXX-XXXX-XXXX',
123
123
  proKeyValidated: 'License validated: {key}',
124
124
  proModuleNotAvailable: 'Pro license module not available. Ensure @aios-fullstack/pro is installed.',
125
+ proModuleBootstrap: 'Pro license module not found locally. Installing @aios-fullstack/pro to bootstrap...',
125
126
  proServerUnreachable: 'License server is unreachable. Check your internet connection and try again.',
126
127
  proVerifyingAccessShort: 'Verifying access...',
127
128
  proAccessConfirmed: 'Pro access confirmed.',
@@ -279,6 +280,7 @@ const TRANSLATIONS = {
279
280
  proKeyInvalid: 'Formato inválido. Esperado: PRO-XXXX-XXXX-XXXX-XXXX',
280
281
  proKeyValidated: 'Licença validada: {key}',
281
282
  proModuleNotAvailable: 'Módulo de licença Pro não disponível. Certifique-se de que @aios-fullstack/pro está instalado.',
283
+ proModuleBootstrap: 'Módulo de licença Pro não encontrado localmente. Instalando @aios-fullstack/pro...',
282
284
  proServerUnreachable: 'Servidor de licenças inacessível. Verifique sua conexão com a internet e tente novamente.',
283
285
  proVerifyingAccessShort: 'Verificando acesso...',
284
286
  proAccessConfirmed: 'Acesso Pro confirmado.',
@@ -435,6 +437,7 @@ const TRANSLATIONS = {
435
437
  proKeyInvalid: 'Formato inválido. Esperado: PRO-XXXX-XXXX-XXXX-XXXX',
436
438
  proKeyValidated: 'Licencia validada: {key}',
437
439
  proModuleNotAvailable: 'Módulo de licencia Pro no disponible. Asegúrese de que @aios-fullstack/pro esté instalado.',
440
+ proModuleBootstrap: 'Módulo de licencia Pro no encontrado localmente. Instalando @aios-fullstack/pro...',
438
441
  proServerUnreachable: 'Servidor de licencias inaccesible. Verifique su conexión a internet e intente nuevamente.',
439
442
  proVerifyingAccessShort: 'Verificando acceso...',
440
443
  proAccessConfirmed: 'Acceso Pro confirmado.',
@@ -145,30 +145,56 @@ function showStep(current, total, label) {
145
145
  console.log(colors.dim(' ' + '─'.repeat(44)));
146
146
  }
147
147
 
148
+ /**
149
+ * Try to load a pro license module via multiple resolution paths.
150
+ *
151
+ * Resolution order:
152
+ * 1. Relative path (framework-dev mode: ../../../../pro/license/{name})
153
+ * 2. @aios-fullstack/pro package (brownfield: node_modules/@aios-fullstack/pro/license/{name})
154
+ * 3. Absolute path via aios-core in node_modules (brownfield upgrade)
155
+ *
156
+ * @param {string} moduleName - Module filename without extension (e.g., 'license-api')
157
+ * @returns {Object|null} Loaded module or null
158
+ */
159
+ function loadProModule(moduleName) {
160
+ // 1. Framework-dev mode (cloned repo with pro/ submodule)
161
+ try {
162
+ return require(`../../../../pro/license/${moduleName}`);
163
+ } catch { /* not available */ }
164
+
165
+ // 2. @aios-fullstack/pro installed in user project
166
+ try {
167
+ return require(`@aios-fullstack/pro/license/${moduleName}`);
168
+ } catch { /* not available */ }
169
+
170
+ // 3. aios-core in node_modules (brownfield upgrade from >= v4.2.15)
171
+ try {
172
+ const path = require('path');
173
+ const absPath = path.join(process.cwd(), 'node_modules', 'aios-core', 'pro', 'license', moduleName);
174
+ return require(absPath);
175
+ } catch { /* not available */ }
176
+
177
+ return null;
178
+ }
179
+
148
180
  /**
149
181
  * Try to load the license API client via lazy import.
182
+ * Attempts multiple resolution paths for framework-dev, greenfield, and brownfield.
150
183
  *
151
184
  * @returns {{ LicenseApiClient: Function, licenseApi: Object }|null} License API or null
152
185
  */
153
186
  function loadLicenseApi() {
154
- try {
155
- return require('../../../../pro/license/license-api');
156
- } catch {
157
- return null;
158
- }
187
+ return loadProModule('license-api');
159
188
  }
160
189
 
161
190
  /**
162
191
  * Try to load the feature gate via lazy import.
192
+ * Attempts multiple resolution paths for framework-dev, greenfield, and brownfield.
163
193
  *
164
194
  * @returns {{ featureGate: Object }|null} Feature gate or null
165
195
  */
166
196
  function loadFeatureGate() {
167
- try {
168
- return require('../../../../pro/license/feature-gate');
169
- } catch {
170
- return null;
171
- }
197
+ return loadProModule('feature-gate');
172
198
  }
173
199
 
174
200
  /**
@@ -1192,6 +1218,48 @@ async function runProWizard(options = {}) {
1192
1218
  showProHeader();
1193
1219
  }
1194
1220
 
1221
+ // Pre-check: If license module is not available (brownfield upgrade from older version),
1222
+ // install @aios-fullstack/pro first to get the license API, then proceed with gate.
1223
+ if (!loadLicenseApi()) {
1224
+ const fs = require('fs');
1225
+ const path = require('path');
1226
+ const { execSync } = require('child_process');
1227
+
1228
+ showInfo(t('proModuleBootstrap'));
1229
+
1230
+ // Ensure package.json exists
1231
+ const packageJsonPath = path.join(targetDir, 'package.json');
1232
+ if (!fs.existsSync(packageJsonPath)) {
1233
+ execSync('npm init -y', { cwd: targetDir, stdio: 'pipe' });
1234
+ }
1235
+
1236
+ // Install @aios-fullstack/pro to get license module
1237
+ const proDir = path.join(targetDir, 'node_modules', '@aios-fullstack', 'pro');
1238
+ if (!fs.existsSync(proDir)) {
1239
+ const installSpinner = createSpinner(t('proInstallingPackage'));
1240
+ installSpinner.start();
1241
+ try {
1242
+ execSync('npm install @aios-fullstack/pro', {
1243
+ cwd: targetDir,
1244
+ stdio: 'pipe',
1245
+ timeout: 120000,
1246
+ });
1247
+ installSpinner.succeed(t('proPackageInstalled'));
1248
+ } catch (err) {
1249
+ installSpinner.fail(t('proPackageInstallFailed'));
1250
+ result.error = tf('proNpmInstallFailed', { message: err.message });
1251
+ return result;
1252
+ }
1253
+ }
1254
+
1255
+ // Clear require cache so loadLicenseApi() picks up newly installed module
1256
+ Object.keys(require.cache).forEach((key) => {
1257
+ if (key.includes('license-api') || key.includes('@aios-fullstack')) {
1258
+ delete require.cache[key];
1259
+ }
1260
+ });
1261
+ }
1262
+
1195
1263
  // Step 1: License Gate
1196
1264
  const licenseResult = await stepLicenseGate({
1197
1265
  key: options.key || process.env.AIOS_PRO_KEY,
@@ -1255,6 +1323,7 @@ module.exports = {
1255
1323
  stepLicenseGateWithKey,
1256
1324
  stepLicenseGateWithKeyInteractive,
1257
1325
  stepLicenseGateWithEmail,
1326
+ loadProModule,
1258
1327
  loadLicenseApi,
1259
1328
  loadFeatureGate,
1260
1329
  loadProScaffolder,