@inamul_hasan/vouch 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.
@@ -0,0 +1,29 @@
1
+ # Contributing to Vouch
2
+
3
+ First off, thank you for considering contributing to Vouch! It's people like you that make Vouch such a great tool for vision-driven automation.
4
+
5
+ ## Where do I go from here?
6
+
7
+ If you've noticed a bug or have a feature request, make sure to check our [Issues](https://github.com/HackX-IN/vouch/issues) first to see if someone else has already created a ticket. If not, go ahead and create one!
8
+
9
+ ## Fork & create a branch
10
+
11
+ If this is something you think you can fix, then fork Vouch and create a branch with a descriptive name.
12
+
13
+ ## Local Development
14
+
15
+ 1. Clone your fork: \`git clone https://github.com/YOUR_USERNAME/vouch.git\`
16
+ 2. Install dependencies: \`npm install\` or \`bun install\`
17
+ 3. Create a \`vouch.config.json\` file with your preferred AI provider settings.
18
+ 4. Run the project in development mode: \`npm run dev\`
19
+ 5. Test your changes by running example tests: \`npm start run examples/demo.vch\`
20
+
21
+ ## Guidelines
22
+
23
+ - Keep it blazing fast. Vouch is designed for low latency. Ensure new features do not slow down the critical Actor-Critic loop.
24
+ - Avoid CSS selectors and DOM queries. Vouch operates exclusively via the Chrome Accessibility Tree.
25
+ - Format code using Prettier and ensure \`npm run lint\` passes without errors.
26
+
27
+ ## Pull Requests
28
+
29
+ When you're ready to submit a Pull Request, please provide a clear description of the changes you've made, why you made them, and how they can be tested. We will review your PR as soon as possible!
package/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2026 Vouch Team
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
package/README.md ADDED
@@ -0,0 +1,140 @@
1
+ # πŸ•ΈοΈ Vouch
2
+
3
+ **Zero-selector, vision-driven web automation. Blazing fast.**
4
+
5
+ Vouch acts like a human QA engineer β€” it reads the screen via Chrome's Accessibility Tree, understands UI components through AI, and interacts by clicking and typing at exact coordinates. No DOM, no selectors, no XPaths.
6
+
7
+ ## Features
8
+
9
+ - 🧠 **AI-Powered Engine** β€” Uses GPT-4o, Claude, Gemini, or local Ollama models (like qwen2.5-coder) to interpret the UI.
10
+ - 🎯 **Zero Selectors** β€” No CSS, XPath, or DOM queries. Navigates natively via Chrome's Accessibility API.
11
+ - πŸ”„ **Self-Healing** β€” Actor-Critic loop auto-corrects form validation errors and retries failed steps.
12
+ - πŸ“ **Plain English Tests** β€” Write tests in natural language with typo tolerance in `.vch` files.
13
+ - πŸ“ **Smart Inputs** β€” Natively handles file uploads, calendars, dropdowns, hover, scroll, and keypresses.
14
+ - πŸ“Š **JSON Reports** β€” Auto-generated timestamped JSON reports under `.vouch/reports/`.
15
+ - πŸŽ₯ **Video Recording** β€” Full session video capture via `puppeteer-screen-recorder`.
16
+ - ⚑ **Low-Latency** β€” Persistent CDP sessions, batched AX tree resolution, instant typing, and optimized token usage.
17
+ - πŸ–₯️ **Interactive CLI** β€” Daytona-style interactive console with spinners, file search, and guided execution.
18
+
19
+ ## Quick Start
20
+
21
+ ```bash
22
+ # Install
23
+ npm install -g @inamul_hasan/vouch
24
+
25
+ # Interactive Mode (Recommended)
26
+ vouch
27
+
28
+ # Run a test directly
29
+ vouch run examples/demo.vch
30
+ ```
31
+
32
+ ## Writing Tests
33
+
34
+ Create a `.vch` file with plain English instructions:
35
+
36
+ ```
37
+ > name: Login Flow Test
38
+
39
+ @navigate https://myapp.com/login
40
+
41
+ click on the email input field
42
+ type user@example.com into the email field
43
+ click the password field
44
+ type MyPassword123! into the password field
45
+ click the Login button
46
+
47
+ @assert Dashboard is visible
48
+ ```
49
+
50
+ ### Syntax
51
+
52
+ | Prefix | Purpose | Example |
53
+ | -------------- | ------------------ | ------------------------------- |
54
+ | `>` | Metadata | `> name: My Test Suite` |
55
+ | `#` | Comment | `# This is a comment` |
56
+ | `@navigate` | Navigate to URL | `@navigate https://example.com` |
57
+ | `@wait` | Wait (ms) | `@wait 3000` |
58
+ | `@assert` | Visual assertion | `@assert Login form is visible` |
59
+ | `@if` | Conditional | `@if dialog is visible` |
60
+ | _(plain text)_ | Action instruction | `click the blue submit button` |
61
+
62
+ ## Configuration
63
+
64
+ Create `vouch.config.json` in your project root (auto-created on first run):
65
+
66
+ ```json
67
+ {
68
+ "provider": "ollama",
69
+ "model": "qwen2.5-coder:3b",
70
+ "viewportWidth": 1280,
71
+ "viewportHeight": 800,
72
+ "headless": false,
73
+ "maxRetries": 3,
74
+ "actionDelay": 200,
75
+ "stepTimeout": 30000,
76
+ "report": true,
77
+ "reportDir": "./.vouch/reports",
78
+ "recordVideo": true,
79
+ "videoDir": "./.vouch/videos"
80
+ }
81
+ ```
82
+
83
+ ### Environment Variables
84
+
85
+ | Variable | Description |
86
+ | ---------------- | ------------------------------------------------------- |
87
+ | `VOUCH_PROVIDER` | AI provider (`openai`, `anthropic`, `google`, `ollama`) |
88
+ | `VOUCH_MODEL` | Model identifier |
89
+ | `VOUCH_API_KEY` | API key for the provider |
90
+ | `VOUCH_BASE_URL` | Base URL override |
91
+ | `VOUCH_HEADLESS` | `true` or `false` |
92
+
93
+ ### CLI Flags
94
+
95
+ ```bash
96
+ vouch run test.vch \
97
+ --provider openai \
98
+ --model gpt-4o \
99
+ --api-key sk-xxx \
100
+ --headless \
101
+ --retries 5 \
102
+ --viewport 1920x1080 \
103
+ --report-dir ./reports
104
+ ```
105
+
106
+ ## Project Structure
107
+
108
+ ```
109
+ .vouch/
110
+ β”œβ”€β”€ reports/ # Timestamped JSON test reports
111
+ └── videos/ # Session video recordings (.mp4)
112
+ ```
113
+
114
+ ## Architecture
115
+
116
+ ```
117
+ Accessibility Tree β†’ VisionQA Engine (AI) β†’ Action JSON β†’ Browser Controller β†’ Verify
118
+ ↑ ↓
119
+ Self-Heal ← ── Validation Error Detected β†β”€β”˜
120
+ ```
121
+
122
+ The **Actor-Critic Loop**:
123
+
124
+ 1. **Actor**: Reads the accessibility tree β†’ sends to AI β†’ executes the returned action.
125
+ 2. **Critic**: Validates the result on `@assert` steps or when validation errors block progress, triggering self-healing retries.
126
+
127
+ ### Performance Optimizations
128
+
129
+ - **Persistent CDP session** β€” reused across all accessibility reads (no create/detach overhead per step).
130
+ - **Batched box model resolution** β€” all element coordinates resolved in parallel via `Promise.allSettled`.
131
+ - **Instant keyboard typing** β€” zero per-character delay.
132
+ - **Token-optimized prompts** β€” compressed system prompt and dense history ledger format.
133
+ - **`keep_alive`** β€” keeps Ollama models hot in VRAM between calls.
134
+ - **`domcontentloaded`** β€” faster navigation without waiting for all network requests.
135
+
136
+ ## License
137
+
138
+ This project is licensed under the MIT License - see the [LICENSE](LICENSE) file for details.
139
+
140
+ Copyright (c) 2026 Vouch Team
@@ -0,0 +1,2 @@
1
+
2
+ export { }