@exodus/xqa 1.0.0

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.
Files changed (3) hide show
  1. package/README.md +166 -0
  2. package/dist/index.cjs +67956 -0
  3. package/package.json +57 -0
package/README.md ADDED
@@ -0,0 +1,166 @@
1
+ # @exodus/xqa
2
+
3
+ CLI for running AI-powered QA agents against Exodus mobile apps on iOS.
4
+
5
+ ## Prerequisites
6
+
7
+ - Node >= 22
8
+ - pnpm
9
+ - An Anthropic API key
10
+
11
+ ## Installation
12
+
13
+ From the monorepo root:
14
+
15
+ ```bash
16
+ pnpm install
17
+ ```
18
+
19
+ Then build and link the CLI globally:
20
+
21
+ ```bash
22
+ pnpm build:link # build + link `xqa` into PATH
23
+ ```
24
+
25
+ For active development:
26
+
27
+ ```bash
28
+ pnpm dev:link # build, link, and watch for changes
29
+ ```
30
+
31
+ ## Setup
32
+
33
+ Copy the example env file and fill in your values:
34
+
35
+ ```bash
36
+ cp .env.example .env.local
37
+ ```
38
+
39
+ `.env.local` is loaded automatically at startup.
40
+
41
+ ## Environment Variables
42
+
43
+ | Variable | Required | Default | Description |
44
+ | ------------------------------ | -------- | ---------------- | ------------------------------------------------------------------------------------------- |
45
+ | `ANTHROPIC_API_KEY` | Yes | — | Anthropic API key |
46
+ | `GOOGLE_GENERATIVE_AI_API_KEY` | No | — | Gemini key — enables video analysis; required for `xqa analyse` |
47
+ | `QA_RUN_ID` | No | auto-generated | Fixed run ID; auto-incremented when omitted |
48
+ | `QA_EXPLORE_TIMEOUT_SECONDS` | No | — | Max wall-clock time for an explore or spec run |
49
+ | `QA_WALLET_MNEMONIC` | No | — | Wallet mnemonic; agent restores wallet before exploring when set |
50
+ | `QA_BUILD_ENV` | No | `prod` | `dev` or `prod`; `dev` mode ignores debug overlays |
51
+ | `QA_STARTUP_STATE` | No | — | `portfolio`, `new-wallet`, or `restore-wallet`; unset means app starts in its current state |
52
+ | `QA_DESIGNS_DIR` | No | `./.xqa/designs` | Design artboards directory; enables visual regression checks when set |
53
+
54
+ ## Commands
55
+
56
+ ### `xqa explore [prompt]`
57
+
58
+ Runs the explorer agent against the live simulator. Without a prompt the agent sweeps the entire app. With a prompt it focuses on the described flow.
59
+
60
+ ```bash
61
+ xqa explore
62
+ xqa explore "Try to send Bitcoin to an external address"
63
+ xqa explore --verbose
64
+ ```
65
+
66
+ Startup state (`QA_STARTUP_STATE`) controls what the agent sees on launch:
67
+
68
+ - `portfolio` — main assets screen (default)
69
+ - `new-wallet` — onboarding screen; agent taps through setup
70
+ - `restore-wallet` — onboarding screen; agent restores wallet using `QA_WALLET_MNEMONIC`
71
+
72
+ When `GOOGLE_GENERATIVE_AI_API_KEY` is set, a Gemini video analyser runs automatically after the explorer finishes.
73
+
74
+ ### `xqa spec <spec-file>`
75
+
76
+ Runs the explorer against a markdown spec file. The agent navigates to the entry point defined in the frontmatter and verifies each described step.
77
+
78
+ ```bash
79
+ xqa spec path/to/send-flow.md
80
+ xqa spec path/to/send-flow.md --verbose
81
+ ```
82
+
83
+ Spec file format:
84
+
85
+ ```markdown
86
+ ---
87
+ feature: Send Flow
88
+ entry: Assets list
89
+ max_steps: 40
90
+ ---
91
+
92
+ Steps describing the flow to verify...
93
+ ```
94
+
95
+ | Field | Required | Description |
96
+ | ----------- | -------- | -------------------------------------------------- |
97
+ | `feature` | Yes | Human-readable feature name |
98
+ | `entry` | Yes | Screen name the agent navigates to before starting |
99
+ | `max_steps` | No | Maximum number of agent steps |
100
+
101
+ ### `xqa analyse <video-path>`
102
+
103
+ Analyses a session recording with Gemini. Requires `GOOGLE_GENERATIVE_AI_API_KEY`. Prints findings as JSON to stdout.
104
+
105
+ ```bash
106
+ xqa analyse .xqa/output/2026-04-10/0001/recording.mp4
107
+ ```
108
+
109
+ ### `xqa review [findings-path]`
110
+
111
+ Interactive terminal session for reviewing findings and marking false positives. Requires a TTY. Dismissals are persisted to a dismissals store and excluded from future runs.
112
+
113
+ ```bash
114
+ xqa review .xqa/output/2026-04-10/0001/findings.json
115
+
116
+ # re-open the last reviewed findings file
117
+ xqa review
118
+ ```
119
+
120
+ ### `xqa completion <shell>`
121
+
122
+ Outputs a shell completion script.
123
+
124
+ ```bash
125
+ xqa completion zsh >> ~/.zshrc
126
+ xqa completion bash >> ~/.bashrc
127
+ ```
128
+
129
+ ## Process Behaviour
130
+
131
+ Only one `xqa` instance runs at a time (PID lock). A second invocation while a run is active will exit immediately with an error.
132
+
133
+ - `Ctrl+C` once: graceful shutdown — the current agent step completes, findings are written, then the process exits
134
+ - `Ctrl+C` twice: force exit
135
+
136
+ ## Development
137
+
138
+ ```bash
139
+ pnpm dev # watch build
140
+ pnpm build # production build
141
+ pnpm build:link # build + link `xqa` globally
142
+ pnpm dev:link # watch build + link
143
+ pnpm test # run Vitest test suite
144
+ pnpm typecheck # TypeScript type check
145
+ pnpm lint # ESLint + Prettier check
146
+ pnpm lint:fix # ESLint + Prettier auto-fix
147
+ pnpm check # lint + typecheck + test (affected only)
148
+ pnpm check:fix # lint:fix + typecheck + test (affected only)
149
+ ```
150
+
151
+ ## Architecture
152
+
153
+ ```
154
+ src/
155
+ index.ts # CLI entry — registers all commands
156
+ config-schema.ts # Zod schema for all environment variables
157
+ commands/
158
+ explore-command.ts # xqa explore
159
+ spec-command.ts # xqa spec
160
+ analyse-command.ts # xqa analyse
161
+ review-command.ts # xqa review
162
+ completion-command.ts # xqa completion
163
+ prompt-builder.ts # builds the explorer system prompt from config
164
+ ```
165
+
166
+ The CLI is a thin shell over `@qa-agents/pipeline`. It parses env vars, builds a `PipelineConfig`, and calls `runPipeline()`.