fleetbo-cockpit-cli 1.0.68 → 1.0.69
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/cli.js +37 -18
- package/package.json +1 -1
package/cli.js
CHANGED
|
@@ -241,39 +241,58 @@ if (command === 'alex') {
|
|
|
241
241
|
console.log('\x1b[33m🧠 Alex is thinking...\x1b[0m');
|
|
242
242
|
|
|
243
243
|
try {
|
|
244
|
-
// --- MEMORY SYSTEM (SMART CACHE SCANNER) ---
|
|
244
|
+
// --- MEMORY SYSTEM (SMART CACHE SCANNER V2) ---
|
|
245
245
|
let contextInjection = "";
|
|
246
246
|
const potentialModules = extractPotentialModules(prompt);
|
|
247
|
+
|
|
248
|
+
let targetModuleContext = "";
|
|
249
|
+
let referenceContexts = "";
|
|
250
|
+
|
|
251
|
+
for (let modName of potentialModules) {
|
|
252
|
+
let isReferenceOnly = false;
|
|
253
|
+
|
|
254
|
+
// 🟢 LE DÉTECTEUR D'INSPIRATION
|
|
255
|
+
if (modName.endsWith('Ref')) {
|
|
256
|
+
isReferenceOnly = true;
|
|
257
|
+
modName = modName.replace('Ref', '');
|
|
258
|
+
} else if (modName.endsWith('Schema')) {
|
|
259
|
+
isReferenceOnly = true;
|
|
260
|
+
modName = modName.replace('Schema', '');
|
|
261
|
+
}
|
|
247
262
|
|
|
248
|
-
for (const modName of potentialModules) {
|
|
249
263
|
process.stdout.write(` \x1b[90m🔍 Checking OS cache for ${modName}...\x1b[0m`);
|
|
250
264
|
const cache = await getModuleCache({ projectId, moduleName: modName });
|
|
251
265
|
|
|
252
266
|
if (cache.found) {
|
|
253
267
|
process.stdout.write(` \x1b[32mFOUND METAL\x1b[0m\n`);
|
|
254
268
|
|
|
255
|
-
const intent = getContextIntent(prompt);
|
|
256
|
-
|
|
257
|
-
// Récupération du Script Mémoire (généré par le Layer 7.7)
|
|
258
269
|
let memoryScript = cache.module.dataSchema
|
|
259
|
-
? `\n[SCRIPT MÉMOIRE DU MODULE]\n${cache.module.dataSchema}\n`
|
|
260
|
-
:
|
|
261
|
-
|
|
262
|
-
if (
|
|
263
|
-
// CAS
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
//
|
|
268
|
-
|
|
270
|
+
? `\n[SCRIPT MÉMOIRE DU MODULE ${modName}]\n${cache.module.dataSchema}\n`
|
|
271
|
+
: `\n[SCRIPT MÉMOIRE DU MODULE ${modName}]\nAucun schéma enregistré pour ce module.\n`;
|
|
272
|
+
|
|
273
|
+
if (isReferenceOnly) {
|
|
274
|
+
// 🚨 CAS A : INSPIRATION (DOGME DU MÉTAL APPLIQUÉ)
|
|
275
|
+
// On injecte le Schéma ET le code Kotlin, mais ON EXCLUT TOTALEMENT LE MOCK !
|
|
276
|
+
referenceContexts += `\n--- CONTEXTE : RÉFÉRENCE DE DONNÉES (${modName}) ---\nDOGME : Ne modifie pas ce module. Aligne-toi uniquement sur le code Natif ci-dessous pour extraire les clés de données.\n${memoryScript}\n[CODE NATIF DE RÉFÉRENCE]\n${cache.module.code}\n`;
|
|
277
|
+
} else if (!targetModuleContext) {
|
|
278
|
+
// CAS B : CIBLE PRINCIPALE (À modifier)
|
|
279
|
+
// Ici on est obligé d'envoyer le Mock car Alex DOIT le mettre à jour.
|
|
280
|
+
const intent = getContextIntent(prompt);
|
|
281
|
+
if (intent === "MODIFICATION") {
|
|
282
|
+
targetModuleContext = `\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`;
|
|
283
|
+
} else {
|
|
284
|
+
targetModuleContext = `\n--- CONTEXTE : BASE DE TRAVAIL (${modName}) ---\n${memoryScript}\n`;
|
|
285
|
+
}
|
|
269
286
|
}
|
|
270
|
-
|
|
271
|
-
prompt = contextInjection + "\n\n[INSTRUCTION DU PILOTE]\n" + prompt;
|
|
272
|
-
break;
|
|
273
287
|
} else {
|
|
274
288
|
process.stdout.write(` \x1b[31mNOT FOUND\x1b[0m\n`);
|
|
275
289
|
}
|
|
276
290
|
}
|
|
291
|
+
|
|
292
|
+
contextInjection = referenceContexts + targetModuleContext;
|
|
293
|
+
if (contextInjection) {
|
|
294
|
+
prompt = contextInjection + "\n\n[INSTRUCTION DU PILOTE]\n" + prompt;
|
|
295
|
+
}
|
|
277
296
|
// --- END MEMORY MODIFICATION ---
|
|
278
297
|
|
|
279
298
|
// 🟢 NEW: Real-time timestamp injection
|