@arcadialdev/arcality 2.4.23 → 2.4.25

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/package.json CHANGED
@@ -1,69 +1,69 @@
1
- {
2
- "name": "@arcadialdev/arcality",
3
- "version": "2.4.23",
4
- "description": "AI-powered QA testing tool — Autonomous web testing agent by Arcadial",
5
- "main": "index.js",
6
- "scripts": {
7
- "dev": "node scripts/gen-and-run.mjs",
8
- "arcality": "node scripts/gen-and-run.mjs",
9
- "postinstall": "node scripts/postinstall.mjs",
10
- "setup": "node scripts/setup.mjs",
11
- "build:runner": "npx esbuild tests/_helpers/agentic-runner.spec.ts --bundle --platform=node --target=node18 --format=cjs --external:@playwright/test --external:chalk --external:dotenv --external:node-fetch --external:js-yaml --external:axios --external:crypto --external:fs --external:path --outfile=tests/_helpers/agentic-runner.bundle.spec.js",
12
- "prepublishOnly": "npm run build:runner"
13
- },
14
- "bin": {
15
- "arcality": "bin/arcality.mjs"
16
- },
17
- "files": [
18
- "bin/",
19
- "scripts/",
20
- "src/",
21
- "tests/_helpers/",
22
- ".agents/",
23
- "public/",
24
- "playwright.config.js",
25
- "README.md"
26
- ],
27
- "publishConfig": {
28
- "access": "public"
29
- },
30
- "repository": {
31
- "type": "git",
32
- "url": "https://dev.azure.com/arcadial/_git/ArcalityQA"
33
- },
34
- "keywords": [
35
- "qa",
36
- "testing",
37
- "ai",
38
- "playwright",
39
- "autonomous",
40
- "arcadial"
41
- ],
42
- "author": "Arcadial",
43
- "license": "ISC",
44
- "type": "commonjs",
45
- "bugs": {
46
- "url": "https://dev.azure.com/arcadial/_git/ArcalityQA"
47
- },
48
- "homepage": "https://dev.azure.com/arcadial/_git/ArcalityQA",
49
- "devDependencies": {
50
- "@types/figlet": "^1.7.0",
51
- "@types/node": "^25.0.9",
52
- "@types/prompts": "^2.4.9",
53
- "esbuild": "^0.20.2"
54
- },
55
- "dependencies": {
56
- "@clack/prompts": "^1.0.1",
57
- "@inquirer/prompts": "^8.2.0",
58
- "@playwright/test": "^1.57.0",
59
- "axios": "^1.13.6",
60
- "chalk": "^5.6.2",
61
- "dotenv": "^17.2.3",
62
- "figlet": "^1.9.4",
63
- "js-yaml": "^4.1.1",
64
- "node-fetch": "^3.3.2",
65
- "prompts": "^2.4.2",
66
- "terminal-image": "^1.1.0",
67
- "tsx": "^4.21.0"
68
- }
1
+ {
2
+ "name": "@arcadialdev/arcality",
3
+ "version": "2.4.25",
4
+ "description": "AI-powered QA testing tool — Autonomous web testing agent by Arcadial",
5
+ "main": "index.js",
6
+ "scripts": {
7
+ "dev": "node scripts/gen-and-run.mjs",
8
+ "arcality": "node scripts/gen-and-run.mjs",
9
+ "postinstall": "node scripts/postinstall.mjs",
10
+ "setup": "node scripts/setup.mjs",
11
+ "build:runner": "npx esbuild tests/_helpers/agentic-runner.spec.ts --bundle --platform=node --target=node18 --format=cjs --external:@playwright/test --external:chalk --external:dotenv --external:node-fetch --external:js-yaml --external:axios --external:crypto --external:fs --external:path --outfile=tests/_helpers/agentic-runner.bundle.spec.js",
12
+ "prepublishOnly": "npm run build:runner"
13
+ },
14
+ "bin": {
15
+ "arcality": "bin/arcality.mjs"
16
+ },
17
+ "files": [
18
+ "bin/",
19
+ "scripts/",
20
+ "src/",
21
+ "tests/_helpers/",
22
+ ".agents/",
23
+ "public/",
24
+ "playwright.config.js",
25
+ "README.md"
26
+ ],
27
+ "publishConfig": {
28
+ "access": "public"
29
+ },
30
+ "repository": {
31
+ "type": "git",
32
+ "url": "https://dev.azure.com/arcadial/_git/ArcalityQA"
33
+ },
34
+ "keywords": [
35
+ "qa",
36
+ "testing",
37
+ "ai",
38
+ "playwright",
39
+ "autonomous",
40
+ "arcadial"
41
+ ],
42
+ "author": "Arcadial",
43
+ "license": "ISC",
44
+ "type": "commonjs",
45
+ "bugs": {
46
+ "url": "https://dev.azure.com/arcadial/_git/ArcalityQA"
47
+ },
48
+ "homepage": "https://dev.azure.com/arcadial/_git/ArcalityQA",
49
+ "devDependencies": {
50
+ "@types/figlet": "^1.7.0",
51
+ "@types/node": "^25.0.9",
52
+ "@types/prompts": "^2.4.9",
53
+ "esbuild": "^0.20.2"
54
+ },
55
+ "dependencies": {
56
+ "@clack/prompts": "^1.0.1",
57
+ "@inquirer/prompts": "^8.2.0",
58
+ "@playwright/test": "^1.57.0",
59
+ "axios": "^1.13.6",
60
+ "chalk": "^5.6.2",
61
+ "dotenv": "^17.2.3",
62
+ "figlet": "^1.9.4",
63
+ "js-yaml": "^4.1.1",
64
+ "node-fetch": "^3.3.2",
65
+ "prompts": "^2.4.2",
66
+ "terminal-image": "^1.1.0",
67
+ "tsx": "^4.21.0"
68
+ }
69
69
  }
@@ -1,33 +1,33 @@
1
- // playwright.config.js
2
- 'use strict';
3
- const { defineConfig, devices } = require('@playwright/test');
4
- const path = require('path');
5
-
6
- module.exports = defineConfig({
7
- testDir: path.join(__dirname, 'tests', '_helpers'),
8
- testMatch: ['agentic-runner.bundle.spec.js'],
9
- reporter: [
10
- [path.join(__dirname, 'tests', '_helpers', 'ArcalityReporter.js'),
11
- { outputDir: process.env.REPORTS_DIR || path.join(__dirname, 'tests-report') }]
12
- ],
13
- use: {
14
- video: 'on',
15
- screenshot: 'on',
16
- trace: 'on',
17
- colorScheme: 'dark',
18
- contextOptions: {
19
- reducedMotion: 'reduce',
20
- },
21
- },
22
- projects: [
23
- {
24
- name: 'AgenticBrowser',
25
- use: {
26
- ...devices['Desktop Chrome'],
27
- channel: 'chrome',
28
- viewport: { width: 1440, height: 900 },
29
- userAgent: 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/120.0.0.0 Safari/537.36 ArcalityAgent/1.0',
30
- },
31
- },
32
- ],
33
- });
1
+ // playwright.config.js
2
+ 'use strict';
3
+ const { defineConfig, devices } = require('@playwright/test');
4
+ const path = require('path');
5
+
6
+ module.exports = defineConfig({
7
+ testDir: path.join(__dirname, 'tests', '_helpers'),
8
+ testMatch: ['agentic-runner.bundle.spec.js'],
9
+ reporter: [
10
+ [path.join(__dirname, 'tests', '_helpers', 'ArcalityReporter.js'),
11
+ { outputDir: process.env.REPORTS_DIR || path.join(__dirname, 'tests-report') }]
12
+ ],
13
+ use: {
14
+ video: 'on',
15
+ screenshot: 'on',
16
+ trace: 'on',
17
+ colorScheme: 'dark',
18
+ contextOptions: {
19
+ reducedMotion: 'reduce',
20
+ },
21
+ },
22
+ projects: [
23
+ {
24
+ name: 'AgenticBrowser',
25
+ use: {
26
+ ...devices['Desktop Chrome'],
27
+ channel: 'chrome',
28
+ viewport: { width: 1440, height: 900 },
29
+ userAgent: 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/120.0.0.0 Safari/537.36 ArcalityAgent/1.0',
30
+ },
31
+ },
32
+ ],
33
+ });
@@ -97,11 +97,6 @@ function updateDotEnvFile(updates) {
97
97
  }
98
98
 
99
99
  function setupEnvironment() {
100
- // Load API Key from global config
101
- const globalConfig = loadGlobalConfig();
102
- if (globalConfig?.api_key && !process.env.ARCALITY_API_KEY) {
103
- process.env.ARCALITY_API_KEY = globalConfig.api_key;
104
- }
105
100
 
106
101
  // Use config name from arcality.config or fallback
107
102
  const configName = projectConfig?.project?.name || 'Default';
@@ -225,6 +220,8 @@ async function arcalityChat(messages) {
225
220
 
226
221
  if (isProxyMode) {
227
222
  headers["x-api-key"] = process.env.ARCALITY_API_KEY || "";
223
+ const missionId = process.env.ARCALITY_MISSION_ID || '';
224
+ if (missionId) headers["x-mission-id"] = missionId;
228
225
  } else {
229
226
  headers["x-api-key"] = process.env.ANTHROPIC_API_KEY;
230
227
  headers["anthropic-version"] = "2023-06-01";
@@ -439,7 +436,9 @@ async function main() {
439
436
  let smartMode = firstRun ? initialSmartMode : false;
440
437
  let discoverPath = firstRun ? initialDiscoverPath : null;
441
438
 
442
- let skipMenu = firstRun && (prompt || agentMode || smartMode);
439
+ let skipMenu = (firstRun && (prompt || agentMode || smartMode)) || agentMode;
440
+ if (agentMode) skipMenu = true; // Hard-lock: No menu in agent mode
441
+
443
442
  firstRun = false;
444
443
 
445
444
  if (!skipMenu) {
@@ -466,7 +465,7 @@ async function main() {
466
465
  const options = [
467
466
  { label: '🤖 Run Autonomous Agent (Prompt)', value: 'agent' },
468
467
  ...(savedMissions.length ? [{ label: '🚀 Launch Saved Mission (.yaml)', value: 'launch_saved' }] : []),
469
- ...(yamlOutputFiles.length ? [{ label: '♻️ Reuse Successful YAML', value: 'reuse_yaml' }] : []),
468
+ ...(yamlOutputFiles.length ? [{ label: '♻️ Reuse YAML + Auto-Guide (if prev. run exists)', value: 'reuse_yaml' }] : []),
470
469
  ...(rootYamlFiles.length ? [{ label: '📂 Choose Root YAML (Templates)', value: 'yaml_list' }] : []),
471
470
  { label: '📋 View Current Configuration', value: 'view_config' },
472
471
  { label: '🔄 Reconfigure (arcality init)', value: 'reconfigure' },
@@ -586,11 +585,20 @@ async function main() {
586
585
  }
587
586
 
588
587
  if (!discoverPath) {
588
+ const knownBaseUrl = projectConfig?.project?.baseUrl || process.env.BASE_URL;
589
+ const promptMsg = knownBaseUrl
590
+ ? `🌐 Initial navigation path (relative to ${knownBaseUrl}):`
591
+ : '🌐 Full Navigation URL (e.g., http://localhost:3000/):';
592
+
589
593
  const d = await text({
590
- message: chalk.cyan('🌐 Initial navigation path:'),
591
- initialValue: '/',
592
- placeholder: '/'
594
+ message: chalk.cyan(promptMsg),
595
+ placeholder: knownBaseUrl ? '/' : 'http://localhost:3000/',
596
+ validate: v => {
597
+ if (!knownBaseUrl && !v.startsWith('http')) return 'Please provide a full URL with http:// or https://';
598
+ return undefined;
599
+ }
593
600
  });
601
+
594
602
  if (isCancel(d)) {
595
603
  cancel('Mission aborted. Returning to menu...');
596
604
  agentMode = false;
@@ -606,7 +614,7 @@ async function main() {
606
614
  // Load environment from BOTH the user's project and the library's root
607
615
  const userDotEnv = parseDotEnvFile(path.join(ORIGINAL_CWD, '.env'));
608
616
  const libDotEnv = parseDotEnvFile(path.join(PROJECT_ROOT, '.env'));
609
- const dotEnv = { ...userDotEnv, ...libDotEnv };
617
+ const dotEnv = { ...userDotEnv, ...libDotEnv };
610
618
 
611
619
  // ── API Key and Quota Validation ──
612
620
  const { validateApiKey, startMission: requestMission } = await import('../src/arcalityClient.mjs');
@@ -730,12 +738,15 @@ async function main() {
730
738
  // Build env for the runner — merge arcality.config values.
731
739
  // ARCALITY_API_URL must be explicit — it comes from the library's internal config,
732
740
  // not from the user's project .env, so we inject it directly via getApiUrl().
741
+ const fallbackBaseUrl = (!projectConfig && discoverPath?.startsWith('http')) ? discoverPath : undefined;
742
+
733
743
  const mergedEnv = {
734
744
  ...dotEnv,
735
745
  ...process.env,
736
746
  ARCALITY_API_URL: getApiUrl(), // Internal URL — always injected explicitly
737
747
  ARCALITY_PROJECT_ID: finalProjectId,
738
- BASE_URL: projectConfig?.project?.baseUrl || dotEnv.BASE_URL || process.env.BASE_URL,
748
+ ARCALITY_MISSION_ID: mission.mission_id || '', // Propagate mission_id to every proxy call
749
+ BASE_URL: projectConfig?.project?.baseUrl || dotEnv.BASE_URL || process.env.BASE_URL || fallbackBaseUrl || 'http://localhost:3000',
739
750
  LOGIN_USER: projectConfig?.auth?.username || dotEnv.LOGIN_USER || process.env.LOGIN_USER,
740
751
  LOGIN_PASSWORD: projectConfig?.auth?.password || dotEnv.LOGIN_PASSWORD || process.env.LOGIN_PASSWORD,
741
752
  DOMAIN_DIR: process.env.DOMAIN_DIR,
@@ -757,7 +768,7 @@ async function main() {
757
768
  //
758
769
  // KEY: tsx loader uses file:// URL (pathToFileURL) so spaces encode as %20 — no quoting needed.
759
770
 
760
- const testFile = path.join(PROJECT_ROOT, 'tests', '_helpers', 'agentic-runner.spec.ts');
771
+ const testFile = path.join(PROJECT_ROOT, 'tests', '_helpers', 'agentic-runner.spec.ts');
761
772
  const configFile = path.join(PROJECT_ROOT, 'playwright.config.js');
762
773
 
763
774
  // Resolve playwright CLI relative to PROJECT_ROOT exactly as Node handles module resolution.