@atlashub/smartstack-cli 2.2.0 → 2.4.0

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 (37) hide show
  1. package/.documentation/business-analyse.html +1503 -1058
  2. package/.documentation/cli-commands.html +1 -1
  3. package/.documentation/init.html +1 -1
  4. package/.documentation/installation.html +1 -1
  5. package/dist/index.js +76 -47
  6. package/dist/index.js.map +1 -1
  7. package/package.json +10 -7
  8. package/templates/agents/ba-reader.md +114 -9
  9. package/templates/agents/ba-writer.md +108 -27
  10. package/templates/agents/mcp-healthcheck.md +1 -1
  11. package/templates/ralph/README.md +1 -1
  12. package/templates/ralph/ralph.config.yaml +1 -1
  13. package/templates/skills/_shared.md +60 -0
  14. package/templates/skills/application/steps/step-00-init.md +32 -8
  15. package/templates/skills/business-analyse/SKILL.md +65 -42
  16. package/templates/skills/business-analyse/_shared.md +161 -51
  17. package/templates/skills/business-analyse/questionnaire/00-application.md +166 -0
  18. package/templates/skills/business-analyse/questionnaire/03-scope.md +7 -7
  19. package/templates/skills/business-analyse/questionnaire/12-migration.md +1 -1
  20. package/templates/skills/business-analyse/questionnaire.md +63 -19
  21. package/templates/skills/business-analyse/react/application-viewer.md +242 -0
  22. package/templates/skills/business-analyse/react/components.md +60 -8
  23. package/templates/skills/business-analyse/react/schema.md +413 -34
  24. package/templates/skills/business-analyse/schemas/application-schema.json +389 -0
  25. package/templates/skills/business-analyse/schemas/feature-schema.json +287 -46
  26. package/templates/skills/business-analyse/steps/step-00-init.md +110 -44
  27. package/templates/skills/business-analyse/steps/step-01-cadrage.md +259 -0
  28. package/templates/skills/business-analyse/steps/step-02-decomposition.md +282 -0
  29. package/templates/skills/business-analyse/steps/step-03-specify.md +489 -0
  30. package/templates/skills/business-analyse/steps/step-04-consolidation.md +336 -0
  31. package/templates/skills/business-analyse/steps/step-05-handoff.md +1119 -0
  32. package/templates/skills/business-analyse/templates/tpl-handoff.md +11 -2
  33. package/templates/skills/mcp/SKILL.md +2 -2
  34. package/templates/skills/business-analyse/steps/step-01-analyse.md +0 -505
  35. package/templates/skills/business-analyse/steps/step-02-specify.md +0 -833
  36. package/templates/skills/business-analyse/steps/step-03-validate.md +0 -862
  37. package/templates/skills/business-analyse/steps/step-04-handoff.md +0 -1593
@@ -610,7 +610,7 @@ smartstack check-mcp --json # Output JSON</code></pre>
610
610
  <td><strong>smartstack</strong></td>
611
611
  <td data-lang="fr">Validation conventions, scaffolding, API docs</td>
612
612
  <td data-lang="en">Convention validation, scaffolding, API docs</td>
613
- <td><code>claude mcp add smartstack -- npx -p @atlashub/smartstack-cli smartstack-mcp</code> <em data-lang="fr">(auto via install)</em><em data-lang="en">(auto via install)</em></td>
613
+ <td><code>claude mcp add smartstack -- npx --package @atlashub/smartstack-cli smartstack-mcp</code> <em data-lang="fr">(auto via install)</em><em data-lang="en">(auto via install)</em></td>
614
614
  </tr>
615
615
  </tbody>
616
616
  </table>
@@ -198,7 +198,7 @@
198
198
  <span data-lang="fr">Validation conventions, scaffolding, API docs</span>
199
199
  <span data-lang="en">Conventions validation, scaffolding, API docs</span>
200
200
  </td>
201
- <td><code>claude mcp add smartstack -- npx -p @atlashub/smartstack-cli smartstack-mcp</code> <em data-lang="fr">(auto via install)</em><em data-lang="en">(auto via install)</em></td>
201
+ <td><code>claude mcp add smartstack -- npx --package @atlashub/smartstack-cli smartstack-mcp</code> <em data-lang="fr">(auto via install)</em><em data-lang="en">(auto via install)</em></td>
202
202
  </tr>
203
203
  <tr>
204
204
  <td><strong>Context7 MCP</strong></td>
@@ -767,7 +767,7 @@ smartstack install</code></pre>
767
767
  smartstack install --force
768
768
 
769
769
  # Enregistrement manuel (si necessaire)
770
- claude mcp add smartstack -- npx -p @atlashub/smartstack-cli smartstack-mcp</code></pre>
770
+ claude mcp add smartstack -- npx --package @atlashub/smartstack-cli smartstack-mcp</code></pre>
771
771
  </div>
772
772
  </div>
773
773
  </div>
package/dist/index.js CHANGED
@@ -112367,7 +112367,7 @@ async function registerMcpServer() {
112367
112367
  if (addResult.status === 0) {
112368
112368
  logger.success("Registered SmartStack MCP server (bundled)");
112369
112369
  } else {
112370
- logger.warning("Failed to register MCP server - register manually: claude mcp add smartstack -- npx -p @atlashub/smartstack-cli smartstack-mcp");
112370
+ logger.warning("Failed to register MCP server - register manually: claude mcp add smartstack -- npx --package @atlashub/smartstack-cli smartstack-mcp");
112371
112371
  }
112372
112372
  } else {
112373
112373
  logger.info("SmartStack MCP server already registered");
@@ -124591,7 +124591,7 @@ var REQUIRED_MCP_SERVERS = [
124591
124591
  {
124592
124592
  name: "smartstack",
124593
124593
  description: "SmartStack validation and scaffolding (bundled)",
124594
- installCommand: "claude mcp add smartstack -- npx -p @atlashub/smartstack-cli smartstack-mcp"
124594
+ installCommand: "claude mcp add smartstack -- npx --package @atlashub/smartstack-cli smartstack-mcp"
124595
124595
  }
124596
124596
  ];
124597
124597
  function getInstalledMcpServers() {
@@ -125351,6 +125351,13 @@ var import_bcryptjs = __toESM(require_bcryptjs());
125351
125351
  var import_fs4 = require("fs");
125352
125352
  var import_path9 = require("path");
125353
125353
  var import_child_process8 = require("child_process");
125354
+ function tryLoadNativeDriver() {
125355
+ try {
125356
+ return require("mssql/msnodesqlv8");
125357
+ } catch {
125358
+ return null;
125359
+ }
125360
+ }
125354
125361
  var DEFAULT_CONFIG = {
125355
125362
  schema: "core",
125356
125363
  usersTable: "auth_Users",
@@ -125558,53 +125565,77 @@ adminCommand.command("reset").description("Reset the localAdmin account password
125558
125565
  console.log(source_default.green("\u2550".repeat(60)));
125559
125566
  console.log();
125560
125567
  };
125568
+ const resetViaMssql = async (sqlModule) => {
125569
+ spinner.text = "Connected. Checking account...";
125570
+ const checkResult = await sqlModule.query`
125571
+ SELECT COUNT(*) as count
125572
+ FROM [core].[auth_Users]
125573
+ WHERE Email = ${adminEmail}
125574
+ `;
125575
+ const exists = checkResult.recordset[0].count > 0;
125576
+ if (!exists) {
125577
+ spinner.fail(`Account ${source_default.yellow(adminEmail)} does not exist.`);
125578
+ logger.error("Cannot reset password for non-existent account.");
125579
+ logger.info("Use the application seeding or AdminTool to create the account first.");
125580
+ await sqlModule.close();
125581
+ process.exit(1);
125582
+ }
125583
+ spinner.text = "Generating new password...";
125584
+ const newPassword = generatePassword();
125585
+ const passwordHash = await import_bcryptjs.default.hash(newPassword, 10);
125586
+ spinner.text = "Updating password...";
125587
+ await sqlModule.query`
125588
+ UPDATE [core].[auth_Users]
125589
+ SET PasswordHash = ${passwordHash},
125590
+ UpdatedAt = ${/* @__PURE__ */ new Date()}
125591
+ WHERE Email = ${adminEmail}
125592
+ `;
125593
+ await sqlModule.close();
125594
+ spinner.succeed("Password reset successfully!");
125595
+ displayPasswordResult(adminEmail, newPassword);
125596
+ };
125597
+ const tryWithSqlCmd = async () => {
125598
+ try {
125599
+ await resetViaSqlCmd();
125600
+ } catch (winAuthError) {
125601
+ if (isLoginFailure(winAuthError)) {
125602
+ spinner.fail("Windows Authentication failed");
125603
+ console.log();
125604
+ const sqlCreds = await promptSqlCredentials();
125605
+ if (!sqlCreds) {
125606
+ process.exit(1);
125607
+ }
125608
+ spinner.start("Retrying with SQL Server credentials...");
125609
+ await resetViaSqlCmd(sqlCreds);
125610
+ } else {
125611
+ throw winAuthError;
125612
+ }
125613
+ }
125614
+ };
125561
125615
  try {
125562
125616
  if (connInfo.useWindowsAuth) {
125563
- try {
125564
- await resetViaSqlCmd();
125565
- } catch (winAuthError) {
125566
- if (isLoginFailure(winAuthError)) {
125567
- spinner.fail("Windows Authentication failed");
125568
- console.log();
125569
- const sqlCreds = await promptSqlCredentials();
125570
- if (!sqlCreds) {
125571
- process.exit(1);
125617
+ const nativeDriver = tryLoadNativeDriver();
125618
+ let nativeConnected = false;
125619
+ if (nativeDriver) {
125620
+ try {
125621
+ spinner.text = "Connecting with Windows Authentication...";
125622
+ await nativeDriver.connect(connectionString);
125623
+ nativeConnected = true;
125624
+ await resetViaMssql(nativeDriver);
125625
+ } catch (nativeError) {
125626
+ if (nativeConnected) throw nativeError;
125627
+ try {
125628
+ await nativeDriver.close();
125629
+ } catch {
125572
125630
  }
125573
- spinner.start("Retrying with SQL Server credentials...");
125574
- await resetViaSqlCmd(sqlCreds);
125575
- } else {
125576
- throw winAuthError;
125577
125631
  }
125578
125632
  }
125633
+ if (!nativeConnected) {
125634
+ await tryWithSqlCmd();
125635
+ }
125579
125636
  } else {
125580
125637
  await import_mssql.default.connect(connectionString);
125581
- spinner.text = "Connected. Checking account...";
125582
- const checkResult = await import_mssql.default.query`
125583
- SELECT COUNT(*) as count
125584
- FROM [core].[auth_Users]
125585
- WHERE Email = ${adminEmail}
125586
- `;
125587
- const exists = checkResult.recordset[0].count > 0;
125588
- if (!exists) {
125589
- spinner.fail(`Account ${source_default.yellow(adminEmail)} does not exist.`);
125590
- logger.error("Cannot reset password for non-existent account.");
125591
- logger.info("Use the application seeding or AdminTool to create the account first.");
125592
- await import_mssql.default.close();
125593
- process.exit(1);
125594
- }
125595
- spinner.text = "Generating new password...";
125596
- const newPassword = generatePassword();
125597
- const passwordHash = await import_bcryptjs.default.hash(newPassword, 10);
125598
- spinner.text = "Updating password...";
125599
- await import_mssql.default.query`
125600
- UPDATE [core].[auth_Users]
125601
- SET PasswordHash = ${passwordHash},
125602
- UpdatedAt = ${/* @__PURE__ */ new Date()}
125603
- WHERE Email = ${adminEmail}
125604
- `;
125605
- await import_mssql.default.close();
125606
- spinner.succeed("Password reset successfully!");
125607
- displayPasswordResult(adminEmail, newPassword);
125638
+ await resetViaMssql(import_mssql.default);
125608
125639
  }
125609
125640
  } catch (error) {
125610
125641
  spinner.fail("Failed to reset password");
@@ -125622,11 +125653,9 @@ adminCommand.command("reset").description("Reset the localAdmin account password
125622
125653
  logger.info(` 3. Or use: ${source_default.cyan('ss admin reset --connection "Server=...;Database=...;User Id=sa;Password=..."')}`);
125623
125654
  }
125624
125655
  }
125625
- if (!connInfo.useWindowsAuth) {
125626
- try {
125627
- await import_mssql.default.close();
125628
- } catch {
125629
- }
125656
+ try {
125657
+ await import_mssql.default.close();
125658
+ } catch {
125630
125659
  }
125631
125660
  process.exit(1);
125632
125661
  }