fleetbo-svro 1.0.50 → 1.0.52

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.
@@ -56,7 +56,9 @@ const FLEETBO_SYSTEM_GUIDELINES = `
56
56
  ## 🚀 Le Cycle de Production Unifié en 5 Étapes
57
57
 
58
58
  ### Étape 0 : Cadrage & Allocation Instantanée (Zéro LLM)
59
- - L'agent appelle directement l'outil 'fleetbo_create_project' avec uniquement 'name' et 'keyApp'.
59
+ - Toute demande de création d'application DOIT immédiatement déclencher l'outil 'fleetbo_create_project'.
60
+ - RÈGLE ABSOLUE : N'inspectez JAMAIS les variables d'environnement locales ou le shell (ex: grep env). Chaque demande de création concerne un projet totalement neuf et indépendant.
61
+ - Si l'utilisateur donne un nom sans préciser de clé, déduisez automatiquement 'keyApp' (en minuscules, sans espaces ni caractères spéciaux, ex: 'Mon App' -> 'mon_app').
60
62
  - Aucun schéma préalable n'est requis ni autorisé. Le Cloud réserve la base et retourne 'bootstrapToken'.
61
63
 
62
64
  ### Étape 1 : Amorçage Local & Contrat Initial Vierge
@@ -153,7 +155,7 @@ server.setRequestHandler(ListToolsRequestSchema, async () => {
153
155
  {
154
156
  name: "fleetbo_create_project",
155
157
  description:
156
- "Étape 0 OBLIGATOIRE du cycle Fleetbo : Alloue instantanément le projet dans le Cloud avec son nom et sa clé unique. RÈGLE STRICTE : Ne concevez AUCUN schéma DDL avant d'appeler cet outil. Le cycle Fleetbo impose de créer le projet vierge ici, d'initialiser en local (Étape 1), de coder directement les composants d'interface UI (Étape 2), puis d'appeler 'fleetbo_update_project' (Étape 3) pour laisser Alex AI inférer la base de données à partir du code UI.",
158
+ "Étape 0 OBLIGATOIRE : Alloue une nouvelle application Fleetbo Cloud. RÈGLE ULTIME : N'inspectez JAMAIS le shell ou les variables d'environnement avant d'utiliser cet outil. Toute demande de création est un projet vierge. Si l'utilisateur fournit un nom sans 'keyApp', générez 'keyApp' vous-même en slugifiant le nom (ex: 'Coworking Space' -> 'coworking_space'). Ne concevez AUCUN schéma DDL avant d'appeler cet outil.",
157
159
  inputSchema: {
158
160
  type: "object",
159
161
  properties: {
@@ -163,10 +165,10 @@ server.setRequestHandler(ListToolsRequestSchema, async () => {
163
165
  },
164
166
  keyApp: {
165
167
  type: "string",
166
- description: "Clé unique d'application sans espace ni caractères spéciaux (ex: coworking_prod)",
168
+ description: "Clé unique d'application déduite automatiquement sans espace ni caractères spéciaux (ex: coworking_prod)",
167
169
  },
168
170
  },
169
- required: ["name", "keyApp"],
171
+ required: ["name"],
170
172
  },
171
173
  },
172
174
  {
@@ -287,10 +289,21 @@ server.setRequestHandler(CallToolRequestSchema, async (request) => {
287
289
  if (name === "fleetbo_create_project") {
288
290
  const schema = z.object({
289
291
  name: z.string().min(2),
290
- keyApp: z.string().min(2),
292
+ keyApp: z.string().optional(), // <-- Optionnel ici
291
293
  });
292
294
  const params = schema.parse(args);
293
295
 
296
+ // Slugification automatique si l'agent a omis keyApp
297
+ const resolvedKeyApp =
298
+ params.keyApp?.trim() ||
299
+ params.name
300
+ .toLowerCase()
301
+ .normalize("NFD")
302
+ .replace(/[\u0300-\u036f]/g, "")
303
+ .replace(/[^a-z0-9]/g, "_")
304
+ .replace(/^_+|_+$/g, "")
305
+ .slice(0, 30);
306
+
294
307
  const res = await fetch(`https://createprojectlight-${CLOUD_RUN_REGION}`, {
295
308
  method: "POST",
296
309
  headers: {
@@ -300,7 +313,7 @@ server.setRequestHandler(CallToolRequestSchema, async (request) => {
300
313
  body: JSON.stringify({
301
314
  data: {
302
315
  name: params.name,
303
- keyApp: params.keyApp,
316
+ keyApp: resolvedKeyApp, // Utilise la clé validée ou calculée
304
317
  },
305
318
  }),
306
319
  });
@@ -314,7 +327,7 @@ server.setRequestHandler(CallToolRequestSchema, async (request) => {
314
327
  const resolvedId = proj.enterpriseId || proj.referenceId || proj.id;
315
328
 
316
329
  // Commande chaînée : init + sync immédiat
317
- const fullBootstrapCommand = `npx fleetbo-svro init --keyApp=${params.keyApp} --token=${proj.bootstrapToken} && npx fleetbo-svro sync`;
330
+ const fullBootstrapCommand = `npx fleetbo-svro init --keyApp=${resolvedKeyApp} --token=${proj.bootstrapToken} && npx fleetbo-svro sync`;
318
331
 
319
332
  return {
320
333
  content: [
@@ -325,9 +338,10 @@ server.setRequestHandler(CallToolRequestSchema, async (request) => {
325
338
  status: "SUCCESS",
326
339
  message: `Project "${params.name}" successfully created. Ready for bootstrap and modeling.`,
327
340
  enterpriseID: resolvedId,
328
- keyApp: params.keyApp,
341
+ keyApp: resolvedKeyApp,
329
342
  bootstrapToken: proj.bootstrapToken,
330
343
  commandInit: fullBootstrapCommand,
344
+ directive: "Execute commandInit immediately in terminal shell to bootstrap local env, generate src/fleetbo.d.ts and seal Fleetbo_contract.md.",
331
345
  nextSteps: [
332
346
  "1. Run commandInit in your terminal to bootstrap local env, fetch initial contracts, and generate src/fleetbo.d.ts + Fleetbo_contract.md.",
333
347
  "2. Inspect Fleetbo_contract.md and start writing UI views (.jsx/.tsx) using global Fleetbo.* and <fleetbo-*> tags directly.",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "fleetbo-svro",
3
- "version": "1.0.50",
3
+ "version": "1.0.52",
4
4
  "main": "dist/index.js",
5
5
  "type": "module",
6
6
  "exports": {