fleetbo-cockpit-cli 1.0.92 → 1.0.94
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 +30 -16
- package/package.json +1 -1
package/cli.js
CHANGED
|
@@ -99,9 +99,9 @@ const checkGitSecurity = () => {
|
|
|
99
99
|
const injectRouteIntoAppJs = (moduleName, subPath = '') => {
|
|
100
100
|
const appJsPath = fs.existsSync(path.join(process.cwd(), 'src', 'App.jsx'))
|
|
101
101
|
? path.join(process.cwd(), 'src', 'App.jsx')
|
|
102
|
-
: path.join(process.cwd(), 'src', 'App.
|
|
102
|
+
: path.join(process.cwd(), 'src', 'App.jsx');
|
|
103
103
|
if (!fs.existsSync(appJsPath)) {
|
|
104
|
-
console.error(` \x1b[31m[Safety Stop]\x1b[0m App.
|
|
104
|
+
console.error(` \x1b[31m[Safety Stop]\x1b[0m App.jsx missing.`);
|
|
105
105
|
return false;
|
|
106
106
|
}
|
|
107
107
|
|
|
@@ -110,7 +110,7 @@ const injectRouteIntoAppJs = (moduleName, subPath = '') => {
|
|
|
110
110
|
const routeAnchor = '{/* FLEETBO_DYNAMIC ROUTES */}';
|
|
111
111
|
|
|
112
112
|
if (!content.includes(importAnchor) || !content.includes(routeAnchor)) {
|
|
113
|
-
console.log(` \x1b[33m[Skipped]\x1b[0m Anchors missing in App.
|
|
113
|
+
console.log(` \x1b[33m[Skipped]\x1b[0m Anchors missing in App.jsx. Manual injection required.`);
|
|
114
114
|
return false;
|
|
115
115
|
}
|
|
116
116
|
|
|
@@ -158,12 +158,26 @@ const extractPotentialModules = (text) => {
|
|
|
158
158
|
// Sert uniquement à définir le TON du contexte envoyé à Alex
|
|
159
159
|
const getContextIntent = (text) => {
|
|
160
160
|
const modifierKeywords = [
|
|
161
|
-
|
|
162
|
-
'
|
|
161
|
+
// 🇫🇷 FRANÇAIS
|
|
162
|
+
'modifier', 'modifie', 'corrige', 'ajoute', 'erreur', 'plante', 'problème', 'bug', 'change',
|
|
163
|
+
'met a jour', 'mets à jour', 'mise à jour',
|
|
164
|
+
|
|
165
|
+
// 🇬🇧 ANGLAIS
|
|
166
|
+
'update', 'fix', 'edit', 'error', 'fail', 'crash', 'issue', 'add', 'modify', 'upgrade',
|
|
167
|
+
|
|
168
|
+
// 🇪🇸 ESPAGNOL
|
|
169
|
+
'modifica', 'edita', 'actualiza', 'añade', 'agrega', 'mejora', 'problema', 'fallo'
|
|
163
170
|
];
|
|
171
|
+
|
|
164
172
|
const inspireKeywords = [
|
|
165
|
-
|
|
166
|
-
'inspire', '
|
|
173
|
+
// 🇫🇷 FRANÇAIS
|
|
174
|
+
'inspire', 'base', 'comme', 'modèle', 'reference', 'reprends', 'copie', 'imite', 'basé sur',
|
|
175
|
+
|
|
176
|
+
// 🇬🇧 ANGLAIS
|
|
177
|
+
'based on', 'model', 'like', 'copy', 'similar', 'imitate', 'replicate',
|
|
178
|
+
|
|
179
|
+
// 🇪🇸 ESPAGNOL
|
|
180
|
+
'inspira', 'basado', 'como', 'modelo', 'referencia', 'copia', 'imita', 'básate'
|
|
167
181
|
];
|
|
168
182
|
|
|
169
183
|
const lower = text.toLowerCase();
|
|
@@ -188,7 +202,7 @@ const getModuleCache = async ({ projectId, moduleName }) => {
|
|
|
188
202
|
const removeRouteFromAppJs = (moduleName) => {
|
|
189
203
|
const appJsPath = fs.existsSync(path.join(process.cwd(), 'src', 'App.jsx'))
|
|
190
204
|
? path.join(process.cwd(), 'src', 'App.jsx')
|
|
191
|
-
: path.join(process.cwd(), 'src', 'App.
|
|
205
|
+
: path.join(process.cwd(), 'src', 'App.jsx');
|
|
192
206
|
if (!fs.existsSync(appJsPath)) return false;
|
|
193
207
|
|
|
194
208
|
let content = fs.readFileSync(appJsPath, 'utf8');
|
|
@@ -205,7 +219,7 @@ const removeRouteFromAppJs = (moduleName) => {
|
|
|
205
219
|
|
|
206
220
|
if (content !== originalContent) {
|
|
207
221
|
fs.writeFileSync(appJsPath, content);
|
|
208
|
-
console.log(` \x1b[32m[Unrouted]\x1b[0m ${moduleName} removed from App.
|
|
222
|
+
console.log(` \x1b[32m[Unrouted]\x1b[0m ${moduleName} removed from App.jsx.`);
|
|
209
223
|
return true;
|
|
210
224
|
}
|
|
211
225
|
return false;
|
|
@@ -224,8 +238,8 @@ if (command === 'alex') {
|
|
|
224
238
|
return;
|
|
225
239
|
}
|
|
226
240
|
|
|
227
|
-
// 📋 INTERCEPTION: LIST MODULES
|
|
228
|
-
const isListingRequest = /^(liste|list|quels modules|montre les modules|show modules)/i.test(prompt);
|
|
241
|
+
// 📋 INTERCEPTION: LIST MODULES (Multilingue)
|
|
242
|
+
const isListingRequest = /^(liste|list|listar|lista|quels modules|montre les modules|affiche les modules|show modules|what modules|display modules|qu[eé] m[oó]dulos|muestra los m[oó]dulos|ver m[oó]dulos)/i.test(prompt);
|
|
229
243
|
if (isListingRequest) {
|
|
230
244
|
process.stdout.write(` \x1b[90m🔍 Scanning OS Cache...\x1b[0m\n`);
|
|
231
245
|
const cacheRes = await getModuleCache({ projectId, moduleName: null });
|
|
@@ -556,10 +570,10 @@ if (command === 'alex') {
|
|
|
556
570
|
console.log('');
|
|
557
571
|
console.log(' \x1b[36m CAPABILITIES\x1b[0m');
|
|
558
572
|
console.log(' \x1b[90m ─────────────────────────────────────────────────────\x1b[0m');
|
|
559
|
-
console.log(' \x1b[1m
|
|
560
|
-
console.log(' \x1b[1m
|
|
561
|
-
console.log(' \x1b[1m
|
|
562
|
-
console.log(' \x1b[1m
|
|
573
|
+
console.log(' \x1b[1m Hardware\x1b[0m\x1b[90m Camera · Scanner · GPS · Biometrics\x1b[0m');
|
|
574
|
+
console.log(' \x1b[1m High-Perf\x1b[0m\x1b[90m Video Feed · Swipe Deck · Audio\x1b[0m');
|
|
575
|
+
console.log(' \x1b[1m Sovereign\x1b[0m\x1b[90m Form + Photo + Save-to-Cloud\x1b[0m');
|
|
576
|
+
console.log(' \x1b[1m Fleetbo View\x1b[0m\x1b[90m Full native tab (120 FPS)\x1b[0m');
|
|
563
577
|
console.log(' \x1b[90m ─────────────────────────────────────────────────────\x1b[0m');
|
|
564
578
|
|
|
565
579
|
// TRIGGER WORDS
|
|
@@ -676,7 +690,7 @@ else if (command === 'rm') {
|
|
|
676
690
|
actionsDone++;
|
|
677
691
|
}
|
|
678
692
|
|
|
679
|
-
// 4. Disinfect System Core (App.
|
|
693
|
+
// 4. Disinfect System Core (App.jsx)
|
|
680
694
|
const unrouted = removeRouteFromAppJs(moduleName);
|
|
681
695
|
if (unrouted) actionsDone++;
|
|
682
696
|
|