@aarwitz/tapp 0.34.0 → 0.35.1

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.
@@ -16,6 +16,7 @@ import fs from "node:fs";
16
16
  import path from "node:path";
17
17
 
18
18
  import { resolveAdbPath } from "./android-driver.js";
19
+ import { macAccessibilityTrusted } from "./macos-driver.js";
19
20
 
20
21
  /**
21
22
  * The states a platform can be in, worst-named-first so nobody mistakes one for another:
@@ -31,27 +32,27 @@ export const PLATFORM_STATES = Object.freeze(["ready", "needs-machine", "pilot"]
31
32
  /** What tapp aims at, in the order a person should see them. */
32
33
  export const PLATFORM_TARGETS = Object.freeze([
33
34
  {
34
- id: "web", label: "Web", give: "A website URL",
35
+ id: "web", label: "Web", subject: "websites", give: "A website URL",
35
36
  driver: "playwright", needs: "Playwright and Chromium, which tapp installs",
36
37
  machine: "any machine",
37
38
  },
38
39
  {
39
- id: "ios", label: "iOS", give: "A simulator .app or a bundle id",
40
+ id: "ios", label: "iOS", subject: "iOS apps", give: "A simulator .app or a bundle id",
40
41
  driver: "xcuitest", needs: "macOS with Xcode",
41
42
  machine: "a Mac with Xcode",
42
43
  },
43
44
  {
44
- id: "android", label: "Android", give: "An .apk or a connected device",
45
+ id: "android", label: "Android", subject: "Android apps", give: "An .apk or a connected device",
45
46
  driver: "adb", needs: "the Android SDK and adb",
46
47
  machine: "a machine with the Android SDK",
47
48
  },
48
49
  {
49
- id: "macos", label: "macOS app", give: "A .app on your Mac",
50
- driver: null, needs: "macOS",
50
+ id: "macos", label: "macOS app", subject: "macOS apps", give: "A .app",
51
+ driver: "accessibility", needs: "macOS, and the Accessibility permission",
51
52
  machine: "a Mac",
52
53
  },
53
54
  {
54
- id: "windows", label: "Windows app", give: "A WPF, WinForms or WinUI app",
55
+ id: "windows", label: "Windows app", subject: "Windows apps", give: "A WPF, WinForms or WinUI app",
55
56
  driver: null, needs: "Windows",
56
57
  machine: "a Windows machine",
57
58
  },
@@ -73,6 +74,10 @@ export function hostToolchain({ env = process.env, platform = process.platform }
73
74
  // cask with ANDROID_HOME unset, and the Studio must not say "no Android" about a machine
74
75
  // where `tapp explore` would happily find adb.
75
76
  android: platform === "linux" || platform === "darwin" || platform === "win32" ? Boolean(resolveAdbPath(env)) : false,
77
+ // Driven through the Accessibility API, which needs a permission nothing can grant for
78
+ // itself. A Mac without it is not ready, and saying otherwise would promise a run that
79
+ // fails on its first action.
80
+ macos: platform === "darwin" && macAccessibilityTrusted(),
76
81
  // Chromium is fetched on demand, so web is reachable from any host; whether this particular
77
82
  // one has it unpacked is checked when the run starts, which is where the error belongs.
78
83
  web: true,
@@ -91,14 +96,15 @@ export const SELF_HOST_COMMAND = "npx -y @aarwitz/tapp@latest app";
91
96
  export function platformStates({ hosted = false, env = process.env, platform = process.platform, toolchain = null } = {}) {
92
97
  const has = toolchain || hostToolchain({ env, platform });
93
98
  return PLATFORM_TARGETS.map((target) => {
94
- // No driver is no driver, on any host. This must never read as "you need a different machine",
95
- // because buying the machine would not help.
99
+ // No driver is no driver, on any host — so this must not read as "buy a Mac and it works".
100
+ // But the machine still matters: when the driver lands, running it locally will need one,
101
+ // and somebody deciding today should know which. State both, and the way round it.
96
102
  if (!target.driver) {
97
103
  return {
98
104
  ...target,
99
- state: "pilot",
100
- summary: `tapp has no ${target.label} driver yet.`,
101
- how: `Early ${target.label} work is done with us while the driver lands. Tell us about yours and we will run it with you.`,
105
+ state: "pilot", because: "no-driver",
106
+ summary: `tapp has no ${target.label} driver yet — it is being built.`,
107
+ how: `Running ${target.subject} locally will need ${target.machine}. Until the driver lands we do these runs with you: tell us about your app, or have tapp run it for you.`,
102
108
  command: "",
103
109
  };
104
110
  }
@@ -120,11 +126,11 @@ export function platformStates({ hosted = false, env = process.env, platform = p
120
126
  ...target,
121
127
  state: "needs-machine", because,
122
128
  summary: because === "not-exposed"
123
- ? `tapp drives ${target.label}, and this machine could — but a public Studio only starts website runs.`
124
- : `tapp drives ${target.label}, but this Studio is not on ${target.machine}.`,
125
- // Self-host is the same product without the hosting, so the answer is a command, not an
126
- // apology (ADR-0006).
127
- how: `Run this Studio on ${target.machine} and give it ${lower(target.give)} there:`,
129
+ ? `tapp drives ${target.subject}, and this machine could — but a public Studio only starts website runs.`
130
+ : `tapp drives ${target.subject}, but this Studio is not on ${target.machine}.`,
131
+ // Two ways out, always both: self-host is the same product without the hosting (ADR-0006),
132
+ // and not everyone has the machine or wants to keep it awake.
133
+ how: `Run this Studio on ${target.machine} and give it ${lower(target.give)} there — or have tapp run it for you.`,
128
134
  command: SELF_HOST_COMMAND,
129
135
  };
130
136
  });
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@aarwitz/tapp",
3
- "version": "0.34.0",
3
+ "version": "0.35.1",
4
4
  "mcpName": "io.github.aarwitz/tapp",
5
5
  "description": "Let coding agents verify UI changes on real iOS, Android, and web surfaces, then enforce reviewed proof in deterministic CI.",
6
6
  "license": "MIT",
@@ -40,6 +40,7 @@
40
40
  "scripts/platform-gate.js",
41
41
  "scripts/pr-plan.js",
42
42
  "scripts/quick-capture.sh",
43
+ "scripts/run-macos-flow.js",
43
44
  "scripts/run-android-flow.js",
44
45
  "scripts/run-flow.sh",
45
46
  "scripts/run-web-flow.js",
@@ -48,6 +49,7 @@
48
49
  "Harness/OCQAHarnessUITests/",
49
50
  "Harness/OCQAHarness.xcodeproj/",
50
51
  "Harness/generate-harness-xcodeproj.rb",
52
+ "MacHarness/",
51
53
  "skills/",
52
54
  ".claude-plugin/",
53
55
  "AGENTS.md"
@@ -96,7 +98,7 @@
96
98
  "mobile"
97
99
  ],
98
100
  "scripts": {
99
- "test": "node --test tests/report.test.js tests/regression.test.js tests/engine.test.js tests/project-config.test.js tests/application-model.test.js tests/ui-map.test.js tests/focused-navigation.test.js tests/task-runtime.test.js tests/release-contract.test.js tests/pr-selection.test.js tests/flow-runtime.test.js tests/web-explorer.test.js tests/web-session.test.js tests/web-link-audit.test.js tests/web-overlay.test.js tests/web-audit.test.js tests/page-observations.test.js tests/capture-provenance.test.js tests/capture-frames.test.js tests/actor-store.test.js tests/account-store.test.js tests/alerts.test.js tests/access-jwt.test.js tests/oauth.test.js tests/studio-client.test.js tests/journeys.test.js tests/ios-crash-attribution.test.js tests/ios-simulator-selection.test.js tests/ios-recording-stop.test.js tests/web-flow.test.js tests/sign-in.test.js tests/scenario-runtime.test.js tests/android-driver.test.js tests/android-explorer.test.js tests/android-flow.test.js tests/android-primitives-protocol.test.js tests/managed-web.test.js tests/product-operations.test.js tests/job-lanes.test.js tests/browser-product.test.js tests/browser-chat-narration.test.js tests/browser-onboarding.test.js tests/managed-operation.test.js tests/ci-setup.test.js tests/ci-install.test.js tests/cli.test.js tests/mcp-workspace.test.js tests/action.test.js tests/package-surface.test.js tests/agent-surface.test.js tests/platforms.test.js tests/presentation-contract.test.js tests/landing-brand.test.js tests/ci-gate.test.js tests/ci-report.test.js tests/desktop-protocol.test.js tests/ios-flow-protocol.test.js tests/feedback-triage-0919.test.js vscode-extension/test/bridge.test.js",
101
+ "test": "node --test tests/report.test.js tests/regression.test.js tests/engine.test.js tests/project-config.test.js tests/application-model.test.js tests/ui-map.test.js tests/focused-navigation.test.js tests/task-runtime.test.js tests/release-contract.test.js tests/pr-selection.test.js tests/flow-runtime.test.js tests/web-explorer.test.js tests/web-session.test.js tests/web-link-audit.test.js tests/web-overlay.test.js tests/web-audit.test.js tests/page-observations.test.js tests/capture-provenance.test.js tests/capture-frames.test.js tests/actor-store.test.js tests/account-store.test.js tests/alerts.test.js tests/access-jwt.test.js tests/oauth.test.js tests/studio-client.test.js tests/journeys.test.js tests/ios-crash-attribution.test.js tests/ios-simulator-selection.test.js tests/ios-recording-stop.test.js tests/web-flow.test.js tests/sign-in.test.js tests/scenario-runtime.test.js tests/android-driver.test.js tests/android-explorer.test.js tests/android-flow.test.js tests/macos-driver.test.js tests/android-primitives-protocol.test.js tests/managed-web.test.js tests/product-operations.test.js tests/job-lanes.test.js tests/browser-product.test.js tests/browser-chat-narration.test.js tests/browser-onboarding.test.js tests/managed-operation.test.js tests/ci-setup.test.js tests/ci-install.test.js tests/cli.test.js tests/mcp-workspace.test.js tests/action.test.js tests/package-surface.test.js tests/agent-surface.test.js tests/platforms.test.js tests/presentation-contract.test.js tests/landing-brand.test.js tests/ci-gate.test.js tests/ci-report.test.js tests/desktop-protocol.test.js tests/ios-flow-protocol.test.js tests/feedback-triage-0919.test.js vscode-extension/test/bridge.test.js",
100
102
  "test:browser-journey": "node --test tests/browser-journey.test.js",
101
103
  "test:browser-native": "TAPP_RUN_NATIVE_BROWSER=1 node --test tests/browser-native-journey.test.js"
102
104
  }
@@ -0,0 +1,32 @@
1
+ #!/usr/bin/env node
2
+ // Replay a Flow against a macOS application. Mirrors scripts/run-android-flow.js: the platform
3
+ // runner the CLI spawns, so evidence and the log land where every other platform puts them.
4
+ import path from "node:path";
5
+ import fs from "node:fs";
6
+
7
+ import { loadFlowFile } from "../mcp-server/src/flow-runtime.js";
8
+ import { runMacosFlow } from "../mcp-server/src/macos-flow.js";
9
+
10
+ const [, , flowPath, appPath = ""] = process.argv;
11
+ if (!flowPath) {
12
+ console.error("usage: run-macos-flow.js <flow.yml> [/path/to/App.app]");
13
+ process.exit(2);
14
+ }
15
+
16
+ const evidenceDir = process.env.TAPP_FLOW_EVIDENCE_DIR || "";
17
+ if (evidenceDir) fs.mkdirSync(evidenceDir, { recursive: true });
18
+
19
+ try {
20
+ const flow = loadFlowFile(path.resolve(flowPath));
21
+ const result = await runMacosFlow({
22
+ flow,
23
+ appPath: appPath || flow.app || "",
24
+ logPath: process.env.FLOW_LOG || (evidenceDir ? path.join(evidenceDir, "flow.log") : ""),
25
+ screenshotDir: evidenceDir || "",
26
+ });
27
+ console.log(`${result.passed ? "✅" : "❌"} ${result.name} — ${result.executed}/${result.total} steps, ${result.failed} failed`);
28
+ process.exit(result.passed ? 0 : 1);
29
+ } catch (error) {
30
+ console.error(`❌ ${error.message || error}`);
31
+ process.exit(1);
32
+ }