visor-ai 0.2.4 → 0.2.6

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/validator.js CHANGED
@@ -5,7 +5,7 @@ const ALLOWED_CONFIG = new Set(['timeoutMs', 'seed', 'artifactsDir']);
5
5
  const ALLOWED_STEP = new Set(['id', 'command', 'args']);
6
6
  const ALLOWED_ASSERT = new Set(['id', 'type', 'target']);
7
7
  const ALLOWED_OUTPUT = new Set(['report']);
8
- const SUPPORTED_COMMANDS = new Set(['tap', 'navigate', 'act', 'screenshot', 'wait', 'source']);
8
+ const SUPPORTED_COMMANDS = new Set(['tap', 'navigate', 'act', 'scroll', 'screenshot', 'wait', 'source']);
9
9
  function validationIssue(severity, code, message, issuePath) {
10
10
  return { severity, code, message, path: issuePath };
11
11
  }
@@ -46,6 +46,21 @@ function validateTapArgs(args, issuePath) {
46
46
  }
47
47
  return issues;
48
48
  }
49
+ function validateScrollArgs(args, issuePath) {
50
+ const issues = [];
51
+ if (!Object.hasOwn(args, 'direction')) {
52
+ issues.push(validationIssue('error', 'ARG_ERROR', 'scroll requires args.direction', issuePath));
53
+ return issues;
54
+ }
55
+ if (typeof args.direction !== 'string' || !['up', 'down'].includes(args.direction.toLowerCase())) {
56
+ issues.push(validationIssue('error', 'ARG_ERROR', "scroll args.direction must be 'up' or 'down'", issuePath));
57
+ }
58
+ if (Object.hasOwn(args, 'percent') &&
59
+ (typeof args.percent !== 'number' || !Number.isFinite(args.percent) || args.percent < 1 || args.percent > 100)) {
60
+ issues.push(validationIssue('error', 'ARG_ERROR', 'scroll args.percent must be a number between 1 and 100', issuePath));
61
+ }
62
+ return issues;
63
+ }
49
64
  export function parseAndValidate(filePath) {
50
65
  const issues = [];
51
66
  const raw = JSON.parse(fs.readFileSync(filePath, 'utf8'));
@@ -65,16 +80,17 @@ export function parseAndValidate(filePath) {
65
80
  let meta = null;
66
81
  if (isRecord(metaRaw)) {
67
82
  issues.push(...unknownFields(metaRaw, ALLOWED_META, '$.meta'));
68
- issues.push(...requiredFields(metaRaw, ['name', 'version', 'platform'], '$.meta'));
69
- if (metaRaw.platform !== 'ios' && metaRaw.platform !== 'android') {
83
+ issues.push(...requiredFields(metaRaw, ['name', 'version'], '$.meta'));
84
+ if (metaRaw.platform !== undefined &&
85
+ metaRaw.platform !== 'ios' &&
86
+ metaRaw.platform !== 'android') {
70
87
  issues.push(validationIssue('error', 'INPUT_ERROR', 'meta.platform must be ios|android', '$.meta.platform'));
71
88
  }
72
- else if (typeof metaRaw.name === 'string' && typeof metaRaw.version === 'string') {
89
+ if (typeof metaRaw.name === 'string' && typeof metaRaw.version === 'string') {
73
90
  meta = {
74
91
  ...metaRaw,
75
92
  name: metaRaw.name,
76
- version: metaRaw.version,
77
- platform: metaRaw.platform
93
+ version: metaRaw.version
78
94
  };
79
95
  }
80
96
  }
@@ -115,6 +131,9 @@ export function parseAndValidate(filePath) {
115
131
  if (command === 'navigate' && isRecord(args) && !Object.hasOwn(args, 'to')) {
116
132
  issues.push(validationIssue('error', 'ARG_ERROR', 'navigate requires args.to', `${issuePath}.args`));
117
133
  }
134
+ if (command === 'scroll' && isRecord(args)) {
135
+ issues.push(...validateScrollArgs(args, `${issuePath}.args`));
136
+ }
118
137
  if (command === 'screenshot' && isRecord(args) && !Object.hasOwn(args, 'label')) {
119
138
  issues.push(validationIssue('warning', 'DETERMINISM_WARNING', 'screenshot missing label may reduce determinism', `${issuePath}.args`));
120
139
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "visor-ai",
3
- "version": "0.2.4",
3
+ "version": "0.2.6",
4
4
  "description": "Visor CLI for LLM-driven mobile app interaction and artifact capture",
5
5
  "type": "module",
6
6
  "license": "MIT",
@@ -30,7 +30,11 @@
30
30
  "build": "rm -rf dist && tsc -p tsconfig.json",
31
31
  "dev": "tsx src/main.ts",
32
32
  "test": "vitest run",
33
- "check": "npm run build && npm run test"
33
+ "check": "npm run build && npm run test",
34
+ "release": "node scripts/release.mjs",
35
+ "release:patch": "node scripts/release.mjs patch",
36
+ "release:minor": "node scripts/release.mjs minor",
37
+ "release:major": "node scripts/release.mjs major"
34
38
  },
35
39
  "keywords": [
36
40
  "appium",
@@ -47,6 +51,7 @@
47
51
  },
48
52
  "devDependencies": {
49
53
  "@types/node": "^22.13.10",
54
+ "appium-xcuitest-driver": "^9.10.5",
50
55
  "tsx": "^4.19.3",
51
56
  "typescript": "^5.8.2",
52
57
  "vitest": "^3.0.8"