@vostride/agent-qa-dashboard 0.1.9 → 0.1.11

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/dist/index.d.cts CHANGED
@@ -1,5 +1,5 @@
1
- import { D as DashboardDatabase } from './index-CmNQ5PbF.cjs';
2
- export { A as AppiumManager, C as ConfigManager, L as LiveExecutionEvent, R as RunRow, S as StepRow, T as TestFileInfo, a as TestFileManager, b as TestRunHandle, c as TestRunner, d as TestValidationError, e as TestValidationResult, f as createRouter, r as readJsonBody, s as startServer } from './index-CmNQ5PbF.cjs';
1
+ import { D as DashboardDatabase } from './index-BL7OautO.cjs';
2
+ export { A as AppiumManager, C as ConfigManager, L as LiveExecutionEvent, R as RunRow, S as StepRow, T as TestFileInfo, a as TestFileManager, b as TestRunHandle, c as TestRunner, d as TestValidationError, e as TestValidationResult, f as createRouter, r as readJsonBody, s as startServer } from './index-BL7OautO.cjs';
3
3
  import { Reporter, SecretRedactor, SuiteDefinition, RunArtifactReporterContext, SuiteSummary, TestDefinition, StepResult, TestResult, RunSummary, HookResultEvent } from '@vostride/agent-qa-core';
4
4
  import 'node:http';
5
5
  import '@vostride/agent-qa-mcp';
package/dist/index.d.ts CHANGED
@@ -1,5 +1,5 @@
1
- import { D as DashboardDatabase } from './index-CmNQ5PbF.js';
2
- export { A as AppiumManager, C as ConfigManager, L as LiveExecutionEvent, R as RunRow, S as StepRow, T as TestFileInfo, a as TestFileManager, b as TestRunHandle, c as TestRunner, d as TestValidationError, e as TestValidationResult, f as createRouter, r as readJsonBody, s as startServer } from './index-CmNQ5PbF.js';
1
+ import { D as DashboardDatabase } from './index-BL7OautO.js';
2
+ export { A as AppiumManager, C as ConfigManager, L as LiveExecutionEvent, R as RunRow, S as StepRow, T as TestFileInfo, a as TestFileManager, b as TestRunHandle, c as TestRunner, d as TestValidationError, e as TestValidationResult, f as createRouter, r as readJsonBody, s as startServer } from './index-BL7OautO.js';
3
3
  import { Reporter, SecretRedactor, SuiteDefinition, RunArtifactReporterContext, SuiteSummary, TestDefinition, StepResult, TestResult, RunSummary, HookResultEvent } from '@vostride/agent-qa-core';
4
4
  import 'node:http';
5
5
  import '@vostride/agent-qa-mcp';
package/dist/index.js CHANGED
@@ -1161,10 +1161,14 @@ var DashboardDatabase = class {
1161
1161
  const steps = this.getSteps(runId);
1162
1162
  const allViolations = [];
1163
1163
  let stepsWithViolations = 0;
1164
+ let scannedSteps = 0;
1164
1165
  for (const step of steps) {
1165
- if (step.accessibilityViolations && step.accessibilityViolations.length > 0) {
1166
- stepsWithViolations++;
1167
- allViolations.push(...step.accessibilityViolations);
1166
+ if (Array.isArray(step.accessibilityViolations)) {
1167
+ scannedSteps++;
1168
+ if (step.accessibilityViolations.length > 0) {
1169
+ stepsWithViolations++;
1170
+ allViolations.push(...step.accessibilityViolations);
1171
+ }
1168
1172
  }
1169
1173
  }
1170
1174
  const bySeverity = { critical: 0, serious: 0, moderate: 0, minor: 0 };
@@ -1175,13 +1179,39 @@ var DashboardDatabase = class {
1175
1179
  byRule[v.ruleId].count++;
1176
1180
  }
1177
1181
  return {
1182
+ enabled: this.getRunAccessibilityEnabled(runId),
1178
1183
  total: allViolations.length,
1179
1184
  bySeverity,
1180
1185
  byRule: Object.entries(byRule).map(([ruleId, data]) => ({ ruleId, ...data })).sort((a, b) => b.count - a.count),
1181
1186
  stepsWithViolations,
1187
+ scannedSteps,
1188
+ unscannedSteps: Math.max(0, steps.length - scannedSteps),
1182
1189
  totalSteps: steps.length
1183
1190
  };
1184
1191
  }
1192
+ getRunAccessibilityEnabled(runId) {
1193
+ const artifact = this.getRunArtifact(runId);
1194
+ const payload = artifact?.payload;
1195
+ if (!payload || typeof payload !== "object" || Array.isArray(payload)) return null;
1196
+ const config = payload.config;
1197
+ if (!config || typeof config !== "object" || Array.isArray(config)) return null;
1198
+ const configRecord = config;
1199
+ const candidates = [configRecord.effectiveConfig, configRecord.parsedConfig];
1200
+ let sawConfig = false;
1201
+ let sawAccessibility = false;
1202
+ for (const candidate of candidates) {
1203
+ if (!candidate || typeof candidate !== "object" || Array.isArray(candidate)) continue;
1204
+ sawConfig = true;
1205
+ const services = candidate.services;
1206
+ if (!services || typeof services !== "object" || Array.isArray(services)) continue;
1207
+ const accessibility = services.accessibility;
1208
+ if (!accessibility || typeof accessibility !== "object" || Array.isArray(accessibility)) continue;
1209
+ sawAccessibility = true;
1210
+ const enabled = accessibility.enabled;
1211
+ if (typeof enabled === "boolean") return enabled;
1212
+ }
1213
+ return sawConfig || sawAccessibility ? false : null;
1214
+ }
1185
1215
  getStep(stepId) {
1186
1216
  const row = this.db.prepare("SELECT * FROM steps WHERE id = ?").get(stepId);
1187
1217
  return row ? this.mapStepRow(row) : void 0;
@@ -8276,6 +8306,10 @@ var ConfigManager = class {
8276
8306
  // src/execution/appium-manager.ts
8277
8307
  import { request } from "http";
8278
8308
  import { spawn as spawn2 } from "child_process";
8309
+ import {
8310
+ formatAppiumInstallGuidance,
8311
+ resolveAppiumExecutable
8312
+ } from "@vostride/agent-qa-core";
8279
8313
  import treeKill2 from "tree-kill";
8280
8314
  import pc from "picocolors";
8281
8315
  var APPIUM_PREFIX = pc.magenta("[appium]");
@@ -8290,11 +8324,13 @@ var AppiumManager = class {
8290
8324
  anonymousRefCount = 0;
8291
8325
  leases = /* @__PURE__ */ new Map();
8292
8326
  logLevel;
8327
+ appiumResolver;
8293
8328
  constructor(opts) {
8294
8329
  this.port = opts?.port ?? 4723;
8295
8330
  this.startupTimeoutMs = opts?.startupTimeoutMs ?? 3e4;
8296
8331
  this.pollIntervalMs = opts?.pollIntervalMs ?? 500;
8297
8332
  this.logLevel = opts?.logLevel ?? "normal";
8333
+ this.appiumResolver = opts?.appiumResolver ?? resolveAppiumExecutable;
8298
8334
  }
8299
8335
  async acquire() {
8300
8336
  await this.ensureRunning();
@@ -8389,14 +8425,15 @@ var AppiumManager = class {
8389
8425
  });
8390
8426
  }
8391
8427
  async startAndWait() {
8392
- const child = spawn2("appium", ["-p", String(this.port), "--relaxed-security", "--log-no-colors"], {
8428
+ const appium = this.appiumResolver();
8429
+ const child = spawn2(appium.command, ["-p", String(this.port), "--relaxed-security", "--log-no-colors"], {
8393
8430
  stdio: ["ignore", "pipe", "pipe"]
8394
8431
  });
8395
8432
  this.process = child;
8396
8433
  this.managed = true;
8397
8434
  child.on("error", (err) => {
8398
8435
  if (err.code === "ENOENT") {
8399
- console.error(`${APPIUM_PREFIX} Appium not found. Run \`npm install -g appium\` to install it.`);
8436
+ console.error(`${APPIUM_PREFIX} Appium not found. ${formatAppiumInstallGuidance()}`);
8400
8437
  } else {
8401
8438
  console.error(`${APPIUM_PREFIX} Error: ${err.message}`);
8402
8439
  }