fleetbo-cockpit-cli 1.0.65 → 1.0.67

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/cli.js +18 -17
  2. package/package.json +1 -1
package/cli.js CHANGED
@@ -253,22 +253,22 @@ if (command === 'alex') {
253
253
  process.stdout.write(` \x1b[32mFOUND METAL\x1b[0m\n`);
254
254
 
255
255
  const intent = getContextIntent(prompt);
256
- const contextTitle = intent === "MODIFICATION"
257
- ? "EXISTING METAL (TO MODIFY)"
258
- : "REFERENCE METAL (FOR DATA PARITY)";
259
-
260
- // 🟢 NEW: Data Schema extraction and formatting
261
- let schemaInstruction = "";
262
- if (cache.module.dataSchema && Array.isArray(cache.module.dataSchema)) {
263
- schemaInstruction = "\n[STRICT DATA CONTRACT]\nThe reference module uses this configuration. You MUST strictly use these collections and keys:\n";
264
- cache.module.dataSchema.forEach(schema => {
265
- schemaInstruction += `- Collection '${schema.collection}': fields [${schema.fields.join(', ')}]\n`;
266
- });
256
+
257
+ // Récupération du Script Mémoire (généré par le Layer 7.7)
258
+ let memoryScript = cache.module.dataSchema
259
+ ? `\n[SCRIPT MÉMOIRE DU MODULE]\n${cache.module.dataSchema}\n`
260
+ : "\n[SCRIPT MÉMOIRE DU MODULE]\nAucun schéma enregistré pour ce module.\n";
261
+
262
+ if (intent === "MODIFICATION") {
263
+ // CAS LOURD : Le pilote veut modifier le code existant
264
+ contextInjection = `\n--- CONTEXTE : MÉTAL EXISTANT (À MODIFIER) (${modName}) ---\nDOGME: Tu dois modifier ce module existant.\n${memoryScript}\n[CODE NATIF EXISTANT]\n${cache.module.code}\n[MOCK JSX EXISTANT]\n${cache.module.mockCode}\n--- FIN DU CONTEXTE ---\n`;
265
+ } else {
266
+ // CAS LÉGER : Le pilote veut juste s'inspirer ou lier les données
267
+ // ON N'ENVOIE PAS LE CODE SOURCE ! Uniquement le Script Mémoire.
268
+ contextInjection = `\n--- CONTEXTE : RÉFÉRENCE DE DONNÉES (${modName}) ---\nDOGME: Tu dois t'aligner sur la logique de ce module. NE LIS QUE CE SCRIPT MÉMOIRE pour comprendre comment les données ont été nommées et sauvegardées.\n${memoryScript}\n--- FIN DU CONTEXTE ---\n`;
267
269
  }
268
-
269
- contextInjection = `\n--- SOVEREIGN CONTEXT: ${contextTitle} (${modName}) ---\nDOGMA: The Metal is the absolute source of truth.\n${schemaInstruction}\n\n[EXISTING NATIVE CODE]\n${cache.module.code}\n--- END OF CONTEXT ---\n`;
270
270
 
271
- prompt = contextInjection + "\n\n[PILOT INSTRUCTION]\n" + prompt;
271
+ prompt = contextInjection + "\n\n[INSTRUCTION DU PILOTE]\n" + prompt;
272
272
  break;
273
273
  } else {
274
274
  process.stdout.write(` \x1b[31mNOT FOUND\x1b[0m\n`);
@@ -334,12 +334,12 @@ if (command === 'alex') {
334
334
 
335
335
  const formattedMsg = wrapText(rawMsg, 85);
336
336
  console.log('\x1b[32mAlex ❯\x1b[0m ' + formattedMsg);
337
-
337
+
338
338
  }
339
339
 
340
340
  // --- FILE CREATION LOGIC ---
341
341
  if (aiData.status === 'success' && aiData.moduleData) {
342
- let { fileName, code, mockFileName, mockCode, moduleName, instructions, config_offload } = aiData.moduleData;
342
+ let { fileName, code, mockFileName, mockCode, moduleName, instructions, config_offload, dataSchema } = aiData.moduleData;
343
343
 
344
344
  // 🛡️ ANTI-DUMP SHIELD (Prevents terminal flooding)
345
345
  if (moduleName) {
@@ -397,7 +397,8 @@ if (command === 'alex') {
397
397
  code: code,
398
398
  mockFileName: mockFileName,
399
399
  mockCode: mockCode,
400
- config_offload: config_offload || { dependencies: [], permissions: [] }
400
+ config_offload: config_offload || { dependencies: [], permissions: [] },
401
+ dataSchema: dataSchema || null // 👈 LA LIGNE MAGIQUE
401
402
  }
402
403
  });
403
404
  process.stdout.write(` \x1b[32mOK\x1b[0m\n`);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "fleetbo-cockpit-cli",
3
- "version": "1.0.65",
3
+ "version": "1.0.67",
4
4
  "description": "Fleetbo CLI - Build native mobile apps with React",
5
5
  "author": "Fleetbo",
6
6
  "license": "MIT",