@askmesh/mcp 0.10.2 → 0.10.3

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/README.md CHANGED
@@ -19,7 +19,7 @@ npx -y @askmesh/mcp
19
19
  "mcpServers": {
20
20
  "askmesh": {
21
21
  "command": "npx",
22
- "args": ["-y", "@askmesh/mcp"]
22
+ "args": ["-y", "@askmesh/mcp@latest"]
23
23
  }
24
24
  }
25
25
  }
package/dist/index.js CHANGED
@@ -11,7 +11,7 @@ const TOKEN = process.env.ASKMESH_TOKEN;
11
11
  const URL = process.env.ASKMESH_URL || 'https://api.askmesh.dev';
12
12
  const server = new McpServer({
13
13
  name: 'askmesh',
14
- version: '0.10.2',
14
+ version: '0.10.3',
15
15
  });
16
16
  if (!TOKEN) {
17
17
  // No token — start in setup-only mode
@@ -218,21 +218,27 @@ Actions disponibles :
218
218
  });
219
219
  }
220
220
  export function registerSetupOnly(server) {
221
- server.tool('askmesh', `AskMesh — première configuration requise.
222
- Aucun token trouvé. Utilise cet outil pour configurer AskMesh dans ce projet.
221
+ server.tool('askmesh', `AskMesh — réseau de communication entre développeurs et agents IA.
223
222
 
224
- Actions disponibles :
225
- - "setup" : configurer le projet (crée le .env, installe les slash commands, configure la status line)
223
+ ⚠️ CONFIGURATION REQUISE — Aucun token trouvé dans le .env.
224
+
225
+ IMPORTANT : Demande immédiatement à l'utilisateur son token AskMesh.
226
+ Le token est disponible sur https://askmesh.dev → Settings → copier l'API token.
227
+
228
+ Une fois le token obtenu, appelle cet outil avec action "setup" et le token en paramètre.
229
+ Cela va configurer automatiquement : le .env, les slash commands, et la status line.
226
230
 
227
- Pour commencer :
228
- 1. Inscris-toi sur https://askmesh.dev
229
- 2. Copie ton API token depuis Settings
230
- 3. Lance l'action "setup" avec ton token pour tout installer`, {
231
- action: z.enum(['setup']).describe('Action à effectuer'),
232
- token: z.string().optional().describe('Ton API token AskMesh (depuis askmesh.dev > Settings)'),
233
- }, async ({ action, token }) => {
231
+ Si l'utilisateur n'a pas encore de compte, dirige-le vers https://askmesh.dev pour s'inscrire.`, {
232
+ action: z.enum(['setup']).describe('Action à effectuer — toujours "setup" en mode configuration'),
233
+ token: z.string().optional().describe('API token AskMesh DEMANDER à l\'utilisateur si non fourni'),
234
+ pollInterval: z.number().optional().describe('Intervalle de polling en secondes (optionnel, pour agents serveur)'),
235
+ url: z.string().optional().describe('URL API AskMesh (optionnel, défaut: https://api.askmesh.dev)'),
236
+ }, async ({ action, token, pollInterval, url }) => {
234
237
  if (action === 'setup') {
235
- return setupSkillsAndStatusLine(token);
238
+ if (!token) {
239
+ return text(`Pour configurer AskMesh, j'ai besoin de ton token.\n\n1. Va sur https://askmesh.dev\n2. Connecte-toi ou crée un compte\n3. Va dans Settings → copie ton API token\n4. Donne-le moi et je configure tout automatiquement.\n\nSi tu as déjà un token, relance avec : action "setup", token "<ton_token>"`);
240
+ }
241
+ return setupSkillsAndStatusLine(token, pollInterval, url);
236
242
  }
237
243
  return text('Action inconnue.');
238
244
  });
@@ -240,7 +246,7 @@ Pour commencer :
240
246
  function text(t) {
241
247
  return { content: [{ type: 'text', text: t }] };
242
248
  }
243
- function setupSkillsAndStatusLine(token) {
249
+ function setupSkillsAndStatusLine(token, pollInterval, url) {
244
250
  const cwd = process.cwd();
245
251
  const commandsDir = join(cwd, '.claude', 'commands');
246
252
  const installed = [];
@@ -285,25 +291,36 @@ function setupSkillsAndStatusLine(token) {
285
291
  catch { }
286
292
  }
287
293
  }
288
- // Handle .env token
294
+ // Handle .env
289
295
  const envPath = join(cwd, '.env');
296
+ const apiUrl = url || 'https://api.askmesh.dev';
290
297
  let envStatus = '';
291
298
  if (token) {
299
+ // Build env content
300
+ const envLines = [];
301
+ envLines.push(`ASKMESH_TOKEN=${token}`);
302
+ envLines.push(`ASKMESH_URL=${apiUrl}`);
303
+ if (pollInterval && pollInterval > 0) {
304
+ envLines.push(`ASKMESH_POLL_INTERVAL=${pollInterval}`);
305
+ }
292
306
  if (existsSync(envPath)) {
293
- const content = readFileSync(envPath, 'utf-8');
294
- if (content.includes('ASKMESH_TOKEN')) {
295
- const updated = content.replace(/ASKMESH_TOKEN=.*/, `ASKMESH_TOKEN=${token}`);
296
- writeFileSync(envPath, updated);
297
- envStatus = '.env : ASKMESH_TOKEN mis à jour';
298
- }
299
- else {
300
- appendFileSync(envPath, `\nASKMESH_TOKEN=${token}\nASKMESH_URL=https://api.askmesh.dev\n`);
301
- envStatus = '.env : ASKMESH_TOKEN ajouté';
307
+ let content = readFileSync(envPath, 'utf-8');
308
+ // Update or append each var
309
+ for (const line of envLines) {
310
+ const key = line.split('=')[0];
311
+ if (content.includes(key + '=')) {
312
+ content = content.replace(new RegExp(`${key}=.*`), line);
313
+ }
314
+ else {
315
+ content = content.trimEnd() + '\n' + line;
316
+ }
302
317
  }
318
+ writeFileSync(envPath, content + '\n');
319
+ envStatus = '.env : configuration mise à jour';
303
320
  }
304
321
  else {
305
- writeFileSync(envPath, `ASKMESH_TOKEN=${token}\nASKMESH_URL=https://api.askmesh.dev\n`);
306
- envStatus = '.env créé avec le token';
322
+ writeFileSync(envPath, envLines.join('\n') + '\n');
323
+ envStatus = '.env créé avec la configuration';
307
324
  }
308
325
  }
309
326
  else if (existsSync(envPath)) {
@@ -312,12 +329,11 @@ function setupSkillsAndStatusLine(token) {
312
329
  envStatus = '.env : ASKMESH_TOKEN présent';
313
330
  }
314
331
  else {
315
- envStatus = '.env : ASKMESH_TOKEN absent — ajoute-le ou relance /ask-setup avec ton token';
332
+ envStatus = '.env : ASKMESH_TOKEN absent — relance /ask-setup avec ton token';
316
333
  }
317
334
  }
318
335
  else {
319
- writeFileSync(envPath, `ASKMESH_TOKEN=your_token_here\nASKMESH_URL=https://api.askmesh.dev\n`);
320
- envStatus = '.env créé — remplace your_token_here par ton token (depuis askmesh.dev > Settings)';
336
+ envStatus = '.env absent — relance /ask-setup avec ton token pour le créer';
321
337
  }
322
338
  // Check .gitignore includes .env
323
339
  const gitignorePath = join(cwd, '.gitignore');
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@askmesh/mcp",
3
- "version": "0.10.2",
3
+ "version": "0.10.3",
4
4
  "description": "AskMesh MCP server — connect your AI coding agent to your team's mesh network",
5
5
  "type": "module",
6
6
  "bin": {