@arcadialdev/arcality 2.2.3 β†’ 2.2.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.
package/README.md CHANGED
@@ -23,33 +23,34 @@
23
23
 
24
24
  ## πŸš€ Getting Started
25
25
 
26
- ### 1. Installation
27
- Install the CLI tool globally or as a dev dependency via NPM:
28
- ```bash
29
- # Using npm
30
- npm install -g @arcadialdev/arcality
26
+ ### 1. Install in your project
31
27
 
32
- # Or use npx directly without installing
33
- npx @arcadialdev/arcality init
28
+ ```bash
29
+ npm install @arcadialdev/arcality
34
30
  ```
35
31
 
36
- ### 2. Initialization
37
- Run the setup wizard at the root of your frontend or backend repository (e.g., Next.js, Vite). Arcality will auto-detect your framework and scaffold the necessary configurations.
32
+ > After install, Arcality **automatically adds the following scripts** to your `package.json`:
33
+ > ```json
34
+ > "arcality": "arcality run",
35
+ > "arcality:init": "arcality init",
36
+ > "arcality:run": "arcality run"
37
+ > ```
38
+
39
+ ### 2. Initialize your project
40
+ Run the setup wizard at the root of your project. Arcality will auto-detect your framework and scaffold the `arcality.config.json`.
38
41
 
39
42
  ```bash
40
- arcality init
43
+ npm run arcality:init
41
44
  ```
42
- *This command creates the `arcality.config.json` inside your project and connects you to the internal Arcadial AI Proxy.*
43
45
 
44
- ### 3. Running an Agent Mission
45
- Start an autonomous mission by feeding the agent a natural language prompt.
46
+ ### 3. Run an autonomous mission
46
47
 
47
48
  ```bash
48
- # Interactive GUI Mode
49
- arcality run
49
+ # Interactive menu
50
+ npm run arcality
50
51
 
51
- # CI/CD / Headless Mode
52
- arcality run --agent "Login with test credentials, navigate to Dashboard, and ensure the Welcome widget is visible."
52
+ # Direct mission
53
+ npm run arcality:run
53
54
  ```
54
55
 
55
56
  ---
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@arcadialdev/arcality",
3
- "version": "2.2.3",
3
+ "version": "2.2.5",
4
4
  "description": "AI-powered QA testing tool β€” Autonomous web testing agent by Arcadial",
5
5
  "main": "index.js",
6
6
  "scripts": {
@@ -18,6 +18,7 @@
18
18
  "src/",
19
19
  "tests/_helpers/",
20
20
  ".agents/",
21
+ "public/",
21
22
  "playwright.config.ts",
22
23
  "README.md"
23
24
  ],
Binary file
Binary file
Binary file
@@ -711,8 +711,15 @@ async function main() {
711
711
  console.log(chalk.gray(`\n>> ARCALITY_PROJECT_ID: ${finalProjectId}`));
712
712
  }
713
713
 
714
+ // Always use Arcality's own Playwright to avoid version conflicts with user's project
715
+ const playwrightBin = process.platform === 'win32'
716
+ ? path.join(PROJECT_ROOT, 'node_modules', '.bin', 'playwright.cmd')
717
+ : path.join(PROJECT_ROOT, 'node_modules', '.bin', 'playwright');
718
+
719
+ const configFile = path.join(PROJECT_ROOT, 'playwright.config.ts');
720
+
714
721
  try {
715
- await run("npx", ["playwright", "test", "tests/_helpers/agentic-runner.spec.ts", "--headed"], {
722
+ await run(playwrightBin, ["test", "tests/_helpers/agentic-runner.spec.ts", "--headed", `--config=${configFile}`], {
716
723
  env: mergedEnv,
717
724
  onStatus: (msg) => s.message(msg)
718
725
  });
@@ -783,7 +790,7 @@ async function main() {
783
790
  await run("node", ["scripts/rebrand-report.mjs"]).catch(() => { });
784
791
 
785
792
  const reportDir = process.env.REPORTS_DIR || 'tests-report';
786
- const arcalityPath = path.resolve(PROJECT_ROOT, reportDir, 'index.html');
793
+ const arcalityPath = path.resolve(reportDir, 'index.html');
787
794
 
788
795
  if (globalReportProcess) {
789
796
  try {
@@ -1,63 +1,77 @@
1
- #!/usr/bin/env node
2
- // scripts/postinstall.mjs β€” Post-install hook
3
- // Se ejecuta automΓ‘ticamente despuΓ©s de 'npm install -g @arcadial/arcality'
4
-
5
- import fs from 'node:fs';
6
- import path from 'node:path';
7
- import os from 'node:os';
8
-
9
- const CONFIG_DIR = path.join(os.homedir(), '.arcality');
10
- const CONFIG_FILE = path.join(CONFIG_DIR, 'config.json');
11
-
12
- // Leer versiΓ³n del package.json
13
- let version = 'unknown';
14
- try {
15
- const pkgPath = path.resolve(path.dirname(new URL(import.meta.url).pathname), '..', 'package.json');
16
- const pkg = JSON.parse(fs.readFileSync(pkgPath, 'utf8'));
17
- version = pkg.version || 'unknown';
18
- } catch { }
19
-
20
- console.log('');
21
- console.log(' ╔══════════════════════════════════════════╗');
22
- console.log(` β•‘ ARCALITY v${version.padEnd(10)} β€” Instalado βœ… β•‘`);
23
- console.log(' β•šβ•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•');
24
- console.log('');
25
-
26
- // Crear directorio de config si no existe
27
- if (!fs.existsSync(CONFIG_DIR)) {
28
- fs.mkdirSync(CONFIG_DIR, { recursive: true });
29
- console.log(` πŸ“ Directorio creado: ${CONFIG_DIR}`);
30
- }
31
-
32
- // Si no hay config, crear una por defecto (sin key)
33
- if (!fs.existsSync(CONFIG_FILE)) {
34
- const defaultConfig = {
35
- api_key: '',
36
- version: version,
37
- installed_at: new Date().toISOString()
38
- };
39
- fs.writeFileSync(CONFIG_FILE, JSON.stringify(defaultConfig, null, 2), 'utf8');
40
- console.log(` πŸ“ Config creada: ${CONFIG_FILE}`);
41
- console.log('');
42
- console.log(' πŸ”‘ Para configurar tu API Key, ejecuta:');
43
- console.log('');
44
- console.log(' arcality setup');
45
- console.log('');
46
- } else {
47
- // Actualizar versiΓ³n en config existente
48
- try {
49
- let raw = fs.readFileSync(CONFIG_FILE, 'utf8');
50
- if (raw.charCodeAt(0) === 0xFEFF) raw = raw.slice(1);
51
- const config = JSON.parse(raw);
52
- config.version = version;
53
- config.updated_at = new Date().toISOString();
54
- fs.writeFileSync(CONFIG_FILE, JSON.stringify(config, null, 2), 'utf8');
55
- console.log(` βœ… Config actualizada (v${version})`);
56
- } catch { }
57
- }
58
-
59
- console.log(' πŸ“Œ PrΓ³ximos pasos:');
60
- console.log(' 1. arcality setup β†’ Configura tu API Key y navegador');
61
- console.log(' 2. arcality β†’ Abre el menΓΊ principal');
62
- console.log(' 3. arcality --agent "misiΓ³n" β†’ Ejecuta directamente');
63
- console.log('');
1
+ #!/usr/bin/env node
2
+ // scripts/postinstall.mjs β€” Post-install hook
3
+ // Runs automatically after 'npm install @arcadialdev/arcality'
4
+
5
+ import fs from 'node:fs';
6
+ import path from 'node:path';
7
+ import os from 'node:os';
8
+
9
+ const CONFIG_DIR = path.join(os.homedir(), '.arcality');
10
+ const CONFIG_FILE = path.join(CONFIG_DIR, 'config.json');
11
+
12
+ // Read version from package.json
13
+ let version = 'unknown';
14
+ try {
15
+ const pkgPath = path.resolve(path.dirname(new URL(import.meta.url).pathname), '..', 'package.json');
16
+ const pkg = JSON.parse(fs.readFileSync(pkgPath, 'utf8'));
17
+ version = pkg.version || 'unknown';
18
+ } catch { }
19
+
20
+ // ── Create global config dir if missing ──
21
+ if (!fs.existsSync(CONFIG_DIR)) {
22
+ fs.mkdirSync(CONFIG_DIR, { recursive: true });
23
+ }
24
+ if (!fs.existsSync(CONFIG_FILE)) {
25
+ const defaultConfig = { api_key: '', version, installed_at: new Date().toISOString() };
26
+ fs.writeFileSync(CONFIG_FILE, JSON.stringify(defaultConfig, null, 2), 'utf8');
27
+ } else {
28
+ try {
29
+ let raw = fs.readFileSync(CONFIG_FILE, 'utf8');
30
+ if (raw.charCodeAt(0) === 0xFEFF) raw = raw.slice(1);
31
+ const config = JSON.parse(raw);
32
+ config.version = version;
33
+ config.updated_at = new Date().toISOString();
34
+ fs.writeFileSync(CONFIG_FILE, JSON.stringify(config, null, 2), 'utf8');
35
+ } catch { }
36
+ }
37
+
38
+ // ── Inject `arcality` npm scripts into user's project package.json ──
39
+ const userPkgPath = path.join(process.cwd(), 'package.json');
40
+ let scriptsInjected = false;
41
+
42
+ if (fs.existsSync(userPkgPath)) {
43
+ try {
44
+ let raw = fs.readFileSync(userPkgPath, 'utf8');
45
+ if (raw.charCodeAt(0) === 0xFEFF) raw = raw.slice(1);
46
+ const pkg = JSON.parse(raw);
47
+
48
+ // Only inject if not already there
49
+ if (!pkg.scripts?.['arcality'] && !pkg.scripts?.['arcality:run']) {
50
+ pkg.scripts = pkg.scripts || {};
51
+ pkg.scripts['arcality'] = 'arcality run';
52
+ pkg.scripts['arcality:init'] = 'arcality init';
53
+ pkg.scripts['arcality:run'] = 'arcality run';
54
+ fs.writeFileSync(userPkgPath, JSON.stringify(pkg, null, 2), 'utf8');
55
+ scriptsInjected = true;
56
+ }
57
+ } catch { /* silently skip if user's package.json is unreadable */ }
58
+ }
59
+
60
+ // ── Banner ──
61
+ console.log('');
62
+ console.log(' ╔══════════════════════════════════════════════╗');
63
+ console.log(` β•‘ ARCALITY v${version.padEnd(10)} β€” Installed βœ… β•‘`);
64
+ console.log(' β•šβ•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•');
65
+ console.log('');
66
+
67
+ if (scriptsInjected) {
68
+ console.log(' ⚑ Scripts added to your package.json automatically!');
69
+ console.log('');
70
+ }
71
+
72
+ console.log(' πŸ“Œ How to use Arcality:');
73
+ console.log('');
74
+ console.log(' npm run arcality:init β†’ Configure this project');
75
+ console.log(' npm run arcality:run β†’ Launch an autonomous test mission');
76
+ console.log(' npm run arcality β†’ Open the interactive menu');
77
+ console.log('');
@@ -1,5 +1,11 @@
1
1
  import fs from 'fs';
2
2
  import path from 'path';
3
+ import { fileURLToPath } from 'url';
4
+
5
+ const __filename = fileURLToPath(import.meta.url);
6
+ const __dirname = path.dirname(__filename);
7
+ // The tool root: always the parent of the scripts/ folder
8
+ const ARCALITY_ROOT = process.env.ARCALITY_ROOT || path.resolve(__dirname, '..');
3
9
 
4
10
  async function rebrandReport() {
5
11
  // Definir directorios objetivo: El reporte personalizado, el nativo anidado y el reporte interno
@@ -10,7 +16,7 @@ async function rebrandReport() {
10
16
  'playwright-internal-report'
11
17
  ];
12
18
 
13
- const logoPngPath = path.join('public', 'logo.png');
19
+ const logoPngPath = path.join(ARCALITY_ROOT, 'public', 'logo.png');
14
20
  let logoBase64 = '';
15
21
 
16
22
  // Preparar Logo Arcality