mcp-state-machine-test-framework 1.1.3 → 1.1.5

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 (3) hide show
  1. package/README.md +7 -2
  2. package/bin/init.js +53 -0
  3. package/package.json +3 -2
package/README.md CHANGED
@@ -49,9 +49,14 @@ If you are an AI agent helping with this project, follow these rules:
49
49
  5. **Workflow**: Use `inspect_framework` to understand the current state before proposing changes.
50
50
 
51
51
  ## 🚀 Mission Bootstrap (Copy & Paste to any AI Agent)
52
- > **IMPORTANT**: This package is a ready-to-use binary. **ZERO CODING IS REQUIRED**. Do not create `index.ts` or setup TypeScript to "build" the server.
52
+ > **⚠️ STRICT PROHIBITION**: DO NOT create any folders (`src`, `.mcp`, etc.) or files (`index.js`, `mcp.json`) manually. This framework is SELF-MANAGED.
53
53
  >
54
- > "Initialize a new Node.js project here. Install `mcp-state-machine-test-framework` using npm. Configure it in `mcp_config.json` using `npx mcp-sms`. Read `.mcp_agent_rules` from the package and immediately run the `init_project` tool to setup the environment. You have full permission to execute commands and create files."
54
+ > **YOUR ONLY MISSION**:
55
+ > 1. Install via `npm install mcp-state-machine-test-framework`.
56
+ > 2. Create a standard `mcp_config.json` for MCP tool access.
57
+ > 3. **IMMEDIATELY** call the `init_project` tool.
58
+ >
59
+ > "Initialize a new Node.js project. Install `mcp-state-machine-test-framework` via npm. Setup `mcp_config.json` for `npx mcp-sms`. **DO NOT create any files or folders**. Read `.mcp_agent_rules` and run `init_project` tool NOW."
55
60
 
56
61
  ---
57
62
  *Developed with ❤️ for maximum automation efficiency.*
package/bin/init.js ADDED
@@ -0,0 +1,53 @@
1
+ #!/usr/bin/env node
2
+ import fs from "fs/promises";
3
+ import path from "path";
4
+ import { execSync } from "child_process";
5
+
6
+ async function init() {
7
+ console.log("🚀 Iniciando instalación universal del State Machine Framework...");
8
+ const root = process.cwd();
9
+
10
+ // 1. Asegurar package.json
11
+ try {
12
+ await fs.access(path.join(root, "package.json"));
13
+ } catch (e) {
14
+ console.log("📦 No se encontró package.json. Inicializando proyecto Node...");
15
+ execSync("npm init -y", { stdio: "inherit" });
16
+ }
17
+
18
+ // 2. Crear carpetas
19
+ const dirs = ['maps', 'suites', 'test_cases', 'reports', 'data'];
20
+ for (const dir of dirs) {
21
+ await fs.mkdir(path.join(root, dir), { recursive: true });
22
+ }
23
+
24
+ // 3. Crear mcp_config.json
25
+ const mcpConfig = {
26
+ mcpServers: {
27
+ "mcp-sms": {
28
+ "command": "npx",
29
+ "args": ["-y", "mcp-state-machine-test-framework"]
30
+ }
31
+ }
32
+ };
33
+ await fs.writeFile(path.join(root, "mcp_config.json"), JSON.stringify(mcpConfig, null, 2));
34
+ console.log("🔌 mcp_config.json creado.");
35
+
36
+ // 4. Crear Templates
37
+ const templates = {
38
+ 'maps/template_map.json': { nodos: { HOME: { transiciones: { IR_A_LOGIN: { destino: "LOGIN", accion: "mcp:wdio-mcp/click_element { \"selector\": \"~Login\" }" } } }, LOGIN: { transiciones: { VOLVER: { destino: "HOME", accion: "mcp:wdio-mcp/click_element { \"selector\": \"~Back\" }" } } } } },
39
+ 'test_cases/template_case.json': { name: "Template Case", steps: [ { name: "Ir a Login", action: "IR_A_LOGIN" } ] },
40
+ 'suites/template_suite.json': { name: "Template Suite", state_map: "template_map.json", tests: ["template_case"] }
41
+ };
42
+
43
+ for (const [relPath, content] of Object.entries(templates)) {
44
+ await fs.writeFile(path.join(root, relPath), JSON.stringify(content, null, 2));
45
+ }
46
+
47
+ console.log("✅ ¡Instalación completada con éxito! Ya puedes usar las herramientas MCP.");
48
+ }
49
+
50
+ init().catch(err => {
51
+ console.error("❌ Error durante la instalación:", err.message);
52
+ process.exit(1);
53
+ });
package/package.json CHANGED
@@ -1,12 +1,13 @@
1
1
  {
2
2
  "name": "mcp-state-machine-test-framework",
3
- "version": "1.1.3",
3
+ "version": "1.1.5",
4
4
  "description": "High-fidelity State Machine MCP Server for autonomous E2E testing orchestration.",
5
5
  "main": "index.js",
6
6
  "type": "module",
7
7
  "bin": {
8
8
  "mcp-sms": "index.js",
9
- "mcp-cli": "mcp_cli.js"
9
+ "mcp-cli": "mcp_cli.js",
10
+ "mcp-sms-init": "bin/init.js"
10
11
  },
11
12
  "scripts": {
12
13
  "start": "node index.js"