@zibby/skills 0.1.8 → 0.1.9
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/browser.js +2 -2
- package/dist/chat-memory.js +15 -15
- package/dist/core-tools.js +2 -2
- package/dist/function-skill.js +1 -1
- package/dist/git.js +2 -2
- package/dist/github.js +3 -3
- package/dist/index.js +646 -1
- package/dist/jira.js +6 -6
- package/dist/memory.js +4 -4
- package/dist/package.json +15 -10
- package/dist/sentry.js +2 -2
- package/dist/skill-installer.js +3 -3
- package/dist/slack.js +2 -2
- package/dist/test-runner.js +13 -13
- package/dist/workflow-builder.js +146 -82
- package/docs/analysis.md +109 -0
- package/docs/cli-reference.md +338 -0
- package/docs/cloning-repositories.md +285 -0
- package/docs/custom-workflows.md +358 -0
- package/docs/getting-started.md +108 -0
- package/docs/installation.md +127 -0
- package/docs/integrations/github.md +73 -0
- package/docs/integrations/jira.md +71 -0
- package/docs/intro.md +87 -0
- package/docs/packages/cli.md +238 -0
- package/docs/packages/core.md +256 -0
- package/docs/packages/mcp-browser.md +110 -0
- package/docs/packages/memory.md +223 -0
- package/docs/packages/skills.md +216 -0
- package/docs/reviewing-results.md +114 -0
- package/docs/running-tests.md +134 -0
- package/docs/triggering-workflows.md +552 -0
- package/docs/workflow-artifact-layout-evaluation.md +119 -0
- package/docs/workflow.md +558 -0
- package/package.json +6 -1
|
@@ -0,0 +1,71 @@
|
|
|
1
|
+
---
|
|
2
|
+
sidebar_position: 2
|
|
3
|
+
title: Jira Integration
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# Jira Integration
|
|
7
|
+
|
|
8
|
+
Connect your Jira workspace to sync tickets into Zibby for analysis and test generation.
|
|
9
|
+
|
|
10
|
+
## How It Works
|
|
11
|
+
|
|
12
|
+
Zibby uses OAuth 2.0 to connect to your Atlassian/Jira account. Once connected, it syncs tickets from your selected Jira project and keeps them up to date.
|
|
13
|
+
|
|
14
|
+
## Connect Jira
|
|
15
|
+
|
|
16
|
+
1. Go to your project's **Settings** page in the Zibby dashboard
|
|
17
|
+
2. Under **Integrations**, click **Connect Jira**
|
|
18
|
+
3. You'll be redirected to Atlassian to authorize Zibby
|
|
19
|
+
4. Grant access to your Jira workspace
|
|
20
|
+
5. You'll be redirected back to Zibby
|
|
21
|
+
|
|
22
|
+
## Select a Jira Space
|
|
23
|
+
|
|
24
|
+
After connecting:
|
|
25
|
+
|
|
26
|
+
1. Go to **Settings > Jira Configuration**
|
|
27
|
+
2. Select the Jira project/space to sync (e.g., "SCRUM", "ENG")
|
|
28
|
+
3. Zibby will import all tickets from that space
|
|
29
|
+
|
|
30
|
+
## Synced Data
|
|
31
|
+
|
|
32
|
+
For each ticket, Zibby imports:
|
|
33
|
+
|
|
34
|
+
- **Summary** and **Description** (including Atlassian Document Format)
|
|
35
|
+
- **Issue type** (Story, Bug, Task, etc.)
|
|
36
|
+
- **Priority** (High, Medium, Low)
|
|
37
|
+
- **Labels** and **Components**
|
|
38
|
+
- **Acceptance criteria** (from description)
|
|
39
|
+
|
|
40
|
+
## Ticket Management
|
|
41
|
+
|
|
42
|
+
In the **Tickets** page:
|
|
43
|
+
|
|
44
|
+
- Tickets sync automatically when you visit the page
|
|
45
|
+
- Drag and drop to reorder tickets by priority
|
|
46
|
+
- Click a ticket to view full details and run analysis
|
|
47
|
+
- Ticket order is preserved across sessions
|
|
48
|
+
|
|
49
|
+
## Reconnecting
|
|
50
|
+
|
|
51
|
+
Jira tokens expire periodically. If you see a "Please reconnect Jira" message:
|
|
52
|
+
|
|
53
|
+
1. Go to **Settings > Integrations**
|
|
54
|
+
2. Click **Reconnect** next to Jira
|
|
55
|
+
3. Re-authorize through the Atlassian OAuth flow
|
|
56
|
+
|
|
57
|
+
Your existing tickets and their order are preserved after reconnecting.
|
|
58
|
+
|
|
59
|
+
## Troubleshooting
|
|
60
|
+
|
|
61
|
+
**"Token refresh failed" error**
|
|
62
|
+
|
|
63
|
+
Your Jira refresh token has expired. Go to Settings and reconnect Jira. This won't affect your existing ticket data or analysis results.
|
|
64
|
+
|
|
65
|
+
**Tickets not syncing**
|
|
66
|
+
|
|
67
|
+
Make sure the correct Jira space is selected in Settings. Only tickets from the selected space are displayed.
|
|
68
|
+
|
|
69
|
+
**Duplicate tickets after reconnecting**
|
|
70
|
+
|
|
71
|
+
This shouldn't happen — Zibby matches tickets by their Jira key (e.g., SCRUM-123) and updates existing records rather than creating duplicates.
|
package/docs/intro.md
ADDED
|
@@ -0,0 +1,87 @@
|
|
|
1
|
+
---
|
|
2
|
+
slug: /
|
|
3
|
+
sidebar_position: 1
|
|
4
|
+
title: Introduction
|
|
5
|
+
---
|
|
6
|
+
|
|
7
|
+
# Zibby
|
|
8
|
+
|
|
9
|
+
Zibby is an AI-powered test automation platform. Write plain-text test instructions, and Zibby drives a real browser, records video, and generates Playwright scripts — no manual test code required.
|
|
10
|
+
|
|
11
|
+
## Quick Start
|
|
12
|
+
|
|
13
|
+
```bash
|
|
14
|
+
npm install -g @zibby/cli
|
|
15
|
+
echo "Go to example.com and verify the page title" > test.txt
|
|
16
|
+
zibby test test.txt --agent cursor
|
|
17
|
+
```
|
|
18
|
+
|
|
19
|
+
That's it. No `zibby init` required — the CLI uses a built-in workflow by default.
|
|
20
|
+
|
|
21
|
+
## How It Works
|
|
22
|
+
|
|
23
|
+
```
|
|
24
|
+
Plain Text Spec → AI Agent → Browser Automation → Video + Playwright Script
|
|
25
|
+
```
|
|
26
|
+
|
|
27
|
+
1. **Write a test spec** — plain text describing what to test
|
|
28
|
+
2. **Run it** — `zibby test spec.txt` launches an AI agent (Cursor, Claude, or Codex)
|
|
29
|
+
3. **AI drives the browser** — navigates, clicks, fills forms, asserts results
|
|
30
|
+
4. **Get artifacts** — video recording, action timeline, generated Playwright script
|
|
31
|
+
5. **Upload to cloud** (optional) — review results in the [Zibby dashboard](https://zibby.app)
|
|
32
|
+
|
|
33
|
+
## Architecture
|
|
34
|
+
|
|
35
|
+
Zibby is a monorepo with five published npm packages, each with a distinct responsibility:
|
|
36
|
+
|
|
37
|
+
| Package | Version | Description |
|
|
38
|
+
|---|---|---|
|
|
39
|
+
| [`@zibby/cli`](https://www.npmjs.com/package/@zibby/cli) | 0.1.27 | CLI entry point — the `zibby` command. Orchestrates runs, init, login, uploads, and workflow management. |
|
|
40
|
+
| [`@zibby/core`](https://www.npmjs.com/package/@zibby/core) | 0.1.22 | Core engine — workflow graph runtime, agent strategy framework, graph compiler, state management, and template workflows. |
|
|
41
|
+
| [`@zibby/skills`](https://www.npmjs.com/package/@zibby/skills) | 0.1.4 | Skill catalog — built-in skill definitions (Browser, Jira, GitHub, Slack, Memory) plus the `skill()` factory for custom MCP and function skills. |
|
|
42
|
+
| [`@zibby/memory`](https://www.npmjs.com/package/@zibby/memory) | 0.1.4 | Test memory database — version-controlled (Dolt-backed) knowledge base that learns from every run. Stores selectors, page models, navigation patterns, and insights. |
|
|
43
|
+
| [`@zibby/mcp-browser`](https://www.npmjs.com/package/@zibby/mcp-browser) | 0.1.6 | Browser MCP server — wrapper around `@playwright/mcp` with stable ID injection, event recording, and session-aware video capture. |
|
|
44
|
+
|
|
45
|
+
Users only install `@zibby/cli` — it pulls in the others automatically.
|
|
46
|
+
|
|
47
|
+
## Two Modes
|
|
48
|
+
|
|
49
|
+
### Local Mode (no account needed)
|
|
50
|
+
|
|
51
|
+
Run tests locally, get generated Playwright scripts:
|
|
52
|
+
|
|
53
|
+
```bash
|
|
54
|
+
zibby test test-specs/login.txt --agent cursor
|
|
55
|
+
```
|
|
56
|
+
|
|
57
|
+
### Cloud Mode (with Zibby account)
|
|
58
|
+
|
|
59
|
+
Upload results to the dashboard for video replay, team sharing, and CI integration:
|
|
60
|
+
|
|
61
|
+
```bash
|
|
62
|
+
zibby test test-specs/login.txt --agent cursor --sync
|
|
63
|
+
```
|
|
64
|
+
|
|
65
|
+
## Supported AI Agents
|
|
66
|
+
|
|
67
|
+
Zibby's workflow engine is **agent-agnostic** — the same workflow graph runs identically across all three supported agents:
|
|
68
|
+
|
|
69
|
+
| Agent | Provider | How It Works | Setup |
|
|
70
|
+
|---|---|---|---|
|
|
71
|
+
| **Cursor** | Cursor IDE | Uses Cursor's built-in agent with MCP tool access | Install [Cursor](https://cursor.com) or set `CURSOR_API_KEY` |
|
|
72
|
+
| **Claude** | Anthropic | Uses Claude Agent SDK with native MCP integration | Set `ANTHROPIC_API_KEY` in `.env` |
|
|
73
|
+
| **Codex** | OpenAI | Uses Codex SDK with full tool/file/bash access | Install `@openai/codex` CLI + set `OPENAI_API_KEY` |
|
|
74
|
+
|
|
75
|
+
```bash
|
|
76
|
+
# Pick your agent
|
|
77
|
+
zibby test test.txt --agent cursor
|
|
78
|
+
zibby test test.txt --agent claude
|
|
79
|
+
zibby test test.txt --agent codex
|
|
80
|
+
```
|
|
81
|
+
|
|
82
|
+
## Who Is Zibby For?
|
|
83
|
+
|
|
84
|
+
- **QA Engineers** who want AI-generated test cases from plain-text specs
|
|
85
|
+
- **Developers** who want Playwright scripts without writing them manually
|
|
86
|
+
- **Teams** adopting test automation without the upfront investment
|
|
87
|
+
- **CI/CD pipelines** that need automated browser testing
|
|
@@ -0,0 +1,238 @@
|
|
|
1
|
+
---
|
|
2
|
+
sidebar_position: 5
|
|
3
|
+
title: "@zibby/cli"
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# @zibby/cli
|
|
7
|
+
|
|
8
|
+
The user-facing entry point — the `zibby` command.
|
|
9
|
+
|
|
10
|
+
```bash
|
|
11
|
+
npm install -g @zibby/cli
|
|
12
|
+
```
|
|
13
|
+
|
|
14
|
+
## What It Does
|
|
15
|
+
|
|
16
|
+
`@zibby/cli` is the only package most users install. It provides:
|
|
17
|
+
|
|
18
|
+
- **`zibby run`** — execute test specs with AI agents
|
|
19
|
+
- **`zibby init`** — scaffold a customizable workflow
|
|
20
|
+
- **`zibby login/logout/status`** — authentication
|
|
21
|
+
- **`zibby upload`** — push existing artifacts to Zibby Cloud
|
|
22
|
+
- **`zibby workflow`** — download/upload/list workflow graphs
|
|
23
|
+
- **`zibby setup-playwright`** — configure Playwright MCP
|
|
24
|
+
- **`zibby ci-setup`** — configure for CI/CD pipelines
|
|
25
|
+
- **`zibby memory`** — memory database management
|
|
26
|
+
- **`zibby video`** — organize test video files
|
|
27
|
+
|
|
28
|
+
## Quick Usage
|
|
29
|
+
|
|
30
|
+
```bash
|
|
31
|
+
# Zero setup — run immediately
|
|
32
|
+
echo "Go to example.com and verify the page title" > test.txt
|
|
33
|
+
zibby run test.txt --agent cursor
|
|
34
|
+
|
|
35
|
+
# Or with npx (no install)
|
|
36
|
+
npx @zibby/cli run test.txt --agent cursor
|
|
37
|
+
```
|
|
38
|
+
|
|
39
|
+
## Commands
|
|
40
|
+
|
|
41
|
+
### `zibby run [spec-path]`
|
|
42
|
+
|
|
43
|
+
Run a test specification.
|
|
44
|
+
|
|
45
|
+
```bash
|
|
46
|
+
# Local test spec
|
|
47
|
+
zibby run test-specs/login.txt --agent cursor
|
|
48
|
+
|
|
49
|
+
# With cloud sync
|
|
50
|
+
zibby run test-specs/login.txt --sync
|
|
51
|
+
|
|
52
|
+
# Cloud test cases
|
|
53
|
+
zibby run --sources TC001,TC002 --execution abc123
|
|
54
|
+
|
|
55
|
+
# Specific workflow
|
|
56
|
+
zibby run test.txt --workflow QuickSmokeWorkflow
|
|
57
|
+
|
|
58
|
+
# Single node (debugging)
|
|
59
|
+
zibby run test.txt --node execute_live --session last
|
|
60
|
+
|
|
61
|
+
# Headless (CI/CD)
|
|
62
|
+
zibby run test.txt --headless --auto-approve
|
|
63
|
+
```
|
|
64
|
+
|
|
65
|
+
| Flag | Description |
|
|
66
|
+
|---|---|
|
|
67
|
+
| `--agent <type>` | `cursor`, `claude`, or `codex` |
|
|
68
|
+
| `--workflow <name>` | Named workflow (e.g., `QuickSmokeWorkflow`, `quick-smoke`) |
|
|
69
|
+
| `--headless` | Headless browser mode |
|
|
70
|
+
| `--node <name>` | Run a single node (`preflight`, `execute_live`, `generate_script`) |
|
|
71
|
+
| `--session <id>` | Reuse session (`last` for most recent) — requires `--node` |
|
|
72
|
+
| `--sources <ids>` | Comma-separated cloud test case IDs |
|
|
73
|
+
| `--execution <id>` | Execution ID (with `--sources`) |
|
|
74
|
+
| `--project <id>` | Project ID |
|
|
75
|
+
| `--collection <name>` | Collection to organize the run |
|
|
76
|
+
| `--folder <path>` | Folder within collection |
|
|
77
|
+
| `--sync` | Upload results to cloud |
|
|
78
|
+
| `--no-sync` | Skip cloud upload |
|
|
79
|
+
| `--config <path>` | Config file path (default: `.zibby.config.js`) |
|
|
80
|
+
| `--auto-approve` | Auto-approve MCP tool calls (CI/CD) |
|
|
81
|
+
| `-o, --open` | Open dashboard after upload |
|
|
82
|
+
| `--verbose` | Info-level logs |
|
|
83
|
+
| `--debug` | Full debug logs |
|
|
84
|
+
|
|
85
|
+
### `zibby init [project-name]`
|
|
86
|
+
|
|
87
|
+
Scaffold a Zibby project with config and workflow files.
|
|
88
|
+
|
|
89
|
+
```bash
|
|
90
|
+
zibby init
|
|
91
|
+
zibby init my-project --agent cursor --cloud-sync
|
|
92
|
+
```
|
|
93
|
+
|
|
94
|
+
| Flag | Description |
|
|
95
|
+
|---|---|
|
|
96
|
+
| `--agent <type>` | `cursor`, `claude`, or `codex` |
|
|
97
|
+
| `--cloud-sync` | Enable cloud sync |
|
|
98
|
+
| `--headless` / `--headed` | Browser mode |
|
|
99
|
+
| `--skip-install` | Skip `npm install` |
|
|
100
|
+
| `-f, --force` | Overwrite existing config |
|
|
101
|
+
| `--mem` | Initialize memory database |
|
|
102
|
+
|
|
103
|
+
Creates:
|
|
104
|
+
|
|
105
|
+
```
|
|
106
|
+
.zibby.config.js
|
|
107
|
+
.zibby/
|
|
108
|
+
├── graph.js
|
|
109
|
+
├── nodes/
|
|
110
|
+
│ ├── preflight.js
|
|
111
|
+
│ ├── execute-live.js
|
|
112
|
+
│ └── generate-script.js
|
|
113
|
+
└── result-handler.js
|
|
114
|
+
```
|
|
115
|
+
|
|
116
|
+
### `zibby login` / `zibby logout` / `zibby status`
|
|
117
|
+
|
|
118
|
+
```bash
|
|
119
|
+
zibby login # OAuth browser flow
|
|
120
|
+
zibby logout # Clear session
|
|
121
|
+
zibby status # Show auth status
|
|
122
|
+
zibby status --json # Machine-readable
|
|
123
|
+
```
|
|
124
|
+
|
|
125
|
+
### `zibby upload <spec-path>`
|
|
126
|
+
|
|
127
|
+
Upload existing test artifacts to Zibby Cloud.
|
|
128
|
+
|
|
129
|
+
```bash
|
|
130
|
+
zibby upload test-specs/login.txt --collection "Auth Tests"
|
|
131
|
+
```
|
|
132
|
+
|
|
133
|
+
### `zibby workflow`
|
|
134
|
+
|
|
135
|
+
Manage workflow graphs:
|
|
136
|
+
|
|
137
|
+
```bash
|
|
138
|
+
zibby workflow list
|
|
139
|
+
zibby workflow download --type run_test
|
|
140
|
+
zibby workflow upload --type analysis --file .zibby/workflow-analysis.json
|
|
141
|
+
```
|
|
142
|
+
|
|
143
|
+
### `zibby setup-playwright`
|
|
144
|
+
|
|
145
|
+
Configure the Playwright MCP server:
|
|
146
|
+
|
|
147
|
+
```bash
|
|
148
|
+
zibby setup-playwright
|
|
149
|
+
zibby setup-playwright --headed --viewport-width 1920 --viewport-height 1080
|
|
150
|
+
```
|
|
151
|
+
|
|
152
|
+
### `zibby ci-setup`
|
|
153
|
+
|
|
154
|
+
Configure Cursor Agent for CI/CD:
|
|
155
|
+
|
|
156
|
+
```bash
|
|
157
|
+
zibby ci-setup
|
|
158
|
+
zibby ci-setup --get-keys
|
|
159
|
+
zibby ci-setup --save
|
|
160
|
+
```
|
|
161
|
+
|
|
162
|
+
### `zibby video`
|
|
163
|
+
|
|
164
|
+
Organize test videos — moves videos from `test-results/` to sit next to test files:
|
|
165
|
+
|
|
166
|
+
```bash
|
|
167
|
+
zibby video
|
|
168
|
+
```
|
|
169
|
+
|
|
170
|
+
### `zibby list`
|
|
171
|
+
|
|
172
|
+
List your projects and API tokens:
|
|
173
|
+
|
|
174
|
+
```bash
|
|
175
|
+
zibby list
|
|
176
|
+
```
|
|
177
|
+
|
|
178
|
+
## Configuration File
|
|
179
|
+
|
|
180
|
+
`.zibby.config.js` (or `.zibby.config.mjs`) in your project root:
|
|
181
|
+
|
|
182
|
+
```javascript
|
|
183
|
+
export default {
|
|
184
|
+
agent: {
|
|
185
|
+
cursor: {
|
|
186
|
+
model: 'auto',
|
|
187
|
+
// Options: 'auto', 'opus-4.5', 'sonnet-4.5', 'composer-1',
|
|
188
|
+
// 'gpt-5.2-codex', 'gpt-5.2', 'gpt-5.3', 'gpt-5.4',
|
|
189
|
+
// 'gemini-3-pro', 'gemini-3-flash'
|
|
190
|
+
},
|
|
191
|
+
// claude: { model: 'auto' },
|
|
192
|
+
// codex: { model: 'gpt-5.2-codex' },
|
|
193
|
+
strictMode: false,
|
|
194
|
+
},
|
|
195
|
+
|
|
196
|
+
// Per-node model overrides
|
|
197
|
+
// models: {
|
|
198
|
+
// default: 'auto',
|
|
199
|
+
// execute_live: 'claude-opus-4',
|
|
200
|
+
// },
|
|
201
|
+
|
|
202
|
+
paths: {
|
|
203
|
+
specs: 'test-specs',
|
|
204
|
+
generated: 'tests',
|
|
205
|
+
output: '.zibby/output',
|
|
206
|
+
},
|
|
207
|
+
|
|
208
|
+
context: {
|
|
209
|
+
filenames: ['CONTEXT.md', 'AGENTS.md'],
|
|
210
|
+
discovery: {
|
|
211
|
+
env: `env-${process.env.ENV || 'local'}.js`,
|
|
212
|
+
},
|
|
213
|
+
},
|
|
214
|
+
|
|
215
|
+
video: 'on',
|
|
216
|
+
viewport: { width: 1280, height: 720 },
|
|
217
|
+
playwrightArtifacts: true,
|
|
218
|
+
cloudSync: false,
|
|
219
|
+
};
|
|
220
|
+
```
|
|
221
|
+
|
|
222
|
+
## Environment Variables
|
|
223
|
+
|
|
224
|
+
| Variable | Description |
|
|
225
|
+
|---|---|
|
|
226
|
+
| `CURSOR_API_KEY` | Cursor agent API key (required in CI, optional locally) |
|
|
227
|
+
| `ANTHROPIC_API_KEY` | Claude agent API key |
|
|
228
|
+
| `OPENAI_API_KEY` | Codex agent API key |
|
|
229
|
+
| `ZIBBY_API_KEY` | Project API key for cloud sync |
|
|
230
|
+
| `ZIBBY_USER_TOKEN` | Personal Access Token for CI/CD |
|
|
231
|
+
| `ZIBBY_ENV` | Environment override: `local`, `staging`, `prod` |
|
|
232
|
+
|
|
233
|
+
## Dependencies
|
|
234
|
+
|
|
235
|
+
`@zibby/cli` automatically installs:
|
|
236
|
+
- `@zibby/core` — workflow engine
|
|
237
|
+
- `@zibby/skills` — skill catalog
|
|
238
|
+
- `@zibby/memory` — test memory
|
|
@@ -0,0 +1,256 @@
|
|
|
1
|
+
---
|
|
2
|
+
sidebar_position: 1
|
|
3
|
+
title: "@zibby/core"
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# @zibby/core
|
|
7
|
+
|
|
8
|
+
Core test automation engine with multi-agent and multi-MCP support.
|
|
9
|
+
|
|
10
|
+
```bash
|
|
11
|
+
npm install @zibby/core
|
|
12
|
+
```
|
|
13
|
+
|
|
14
|
+
> Most users don't install this directly — `@zibby/cli` depends on it automatically.
|
|
15
|
+
|
|
16
|
+
## What's Inside
|
|
17
|
+
|
|
18
|
+
`@zibby/core` is the runtime heart of Zibby. It provides:
|
|
19
|
+
|
|
20
|
+
| Module | Purpose |
|
|
21
|
+
|---|---|
|
|
22
|
+
| **Workflow Framework** | `WorkflowGraph`, `Node`, `WorkflowState`, graph compiler |
|
|
23
|
+
| **Agent Strategies** | `CursorAgentStrategy`, `ClaudeAgentStrategy`, `CodexAgentStrategy` |
|
|
24
|
+
| **Skill Registry** | `registerSkill`, `getSkill`, `listSkillIds` |
|
|
25
|
+
| **Graph Compiler** | `compileGraph`, `validateGraphConfig` — JSON → executable graph |
|
|
26
|
+
| **Tool Resolver** | Maps node skill declarations to concrete MCP tool permissions |
|
|
27
|
+
| **Code Generator** | `generateWorkflowCode` — serializes graphs to code |
|
|
28
|
+
| **Templates** | Built-in workflow templates (browser-test-automation, code-analysis) |
|
|
29
|
+
| **Enrichment Pipeline** | DOM enrichers, accessibility enrichers, page-state enrichers |
|
|
30
|
+
| **Runtime** | Stable-ID runtime, verification strategies, Playwright integration |
|
|
31
|
+
| **Sync** | Cloud upload/download for test results |
|
|
32
|
+
|
|
33
|
+
## Exports
|
|
34
|
+
|
|
35
|
+
```javascript
|
|
36
|
+
// Framework
|
|
37
|
+
import {
|
|
38
|
+
WorkflowGraph,
|
|
39
|
+
Node,
|
|
40
|
+
ConditionalNode,
|
|
41
|
+
WorkflowState,
|
|
42
|
+
OutputParser,
|
|
43
|
+
compileGraph,
|
|
44
|
+
validateGraphConfig,
|
|
45
|
+
extractSteps,
|
|
46
|
+
} from '@zibby/core';
|
|
47
|
+
|
|
48
|
+
// Agent strategies
|
|
49
|
+
import {
|
|
50
|
+
invokeAgent,
|
|
51
|
+
getAgentStrategy,
|
|
52
|
+
CursorAgentStrategy,
|
|
53
|
+
ClaudeAgentStrategy,
|
|
54
|
+
AgentStrategy,
|
|
55
|
+
} from '@zibby/core';
|
|
56
|
+
|
|
57
|
+
// Skill registry
|
|
58
|
+
import {
|
|
59
|
+
registerSkill,
|
|
60
|
+
getSkill,
|
|
61
|
+
hasSkill,
|
|
62
|
+
getAllSkills,
|
|
63
|
+
listSkillIds,
|
|
64
|
+
} from '@zibby/core';
|
|
65
|
+
|
|
66
|
+
// Zod (re-exported for convenience)
|
|
67
|
+
import { z } from '@zibby/core';
|
|
68
|
+
|
|
69
|
+
// Skills enum
|
|
70
|
+
import { SKILLS } from '@zibby/core';
|
|
71
|
+
```
|
|
72
|
+
|
|
73
|
+
## WorkflowGraph
|
|
74
|
+
|
|
75
|
+
The central class. Create a graph, add nodes and edges, then run it.
|
|
76
|
+
|
|
77
|
+
```javascript
|
|
78
|
+
import { WorkflowGraph } from '@zibby/core';
|
|
79
|
+
import { z } from '@zibby/core';
|
|
80
|
+
|
|
81
|
+
const graph = new WorkflowGraph({
|
|
82
|
+
stateSchema: z.object({ // Optional: validates initial state
|
|
83
|
+
testSpec: z.string(),
|
|
84
|
+
cwd: z.string().optional(),
|
|
85
|
+
}),
|
|
86
|
+
middleware: [], // Optional: wrap every node execution
|
|
87
|
+
});
|
|
88
|
+
|
|
89
|
+
graph.addNode('step_a', myNode);
|
|
90
|
+
graph.addEdge('step_a', 'step_b');
|
|
91
|
+
graph.setEntryPoint('step_a');
|
|
92
|
+
|
|
93
|
+
const result = await graph.run(agent, { testSpec: '...' });
|
|
94
|
+
```
|
|
95
|
+
|
|
96
|
+
**Key methods:**
|
|
97
|
+
|
|
98
|
+
| Method | Description |
|
|
99
|
+
|---|---|
|
|
100
|
+
| `addNode(name, config, options?)` | Add an executable node |
|
|
101
|
+
| `addConditionalNode(name, config)` | Add a node that routes based on state |
|
|
102
|
+
| `addEdge(from, to)` | Linear connection between nodes |
|
|
103
|
+
| `addConditionalEdges(from, routeFn)` | Branch based on state — `routeFn(state) => 'next_node'` |
|
|
104
|
+
| `setEntryPoint(name)` | Declare which node runs first |
|
|
105
|
+
| `setStateSchema(zodSchema)` | Validate initial state before execution |
|
|
106
|
+
| `use(middlewareFn)` | Add graph-level middleware |
|
|
107
|
+
| `serialize()` | Export graph as JSON (for dashboard visual editor) |
|
|
108
|
+
| `run(agent, initialState)` | Execute the graph |
|
|
109
|
+
|
|
110
|
+
## Node Definition
|
|
111
|
+
|
|
112
|
+
A node is a plain object with `name`, `prompt`, and `outputSchema`:
|
|
113
|
+
|
|
114
|
+
```javascript
|
|
115
|
+
import { z } from '@zibby/core';
|
|
116
|
+
|
|
117
|
+
export const myNode = {
|
|
118
|
+
name: 'my_node',
|
|
119
|
+
|
|
120
|
+
// Prompt: function receiving state, returns string
|
|
121
|
+
prompt: (state) => `Analyze: ${state.testSpec}`,
|
|
122
|
+
|
|
123
|
+
// Output schema: Zod object validated at runtime
|
|
124
|
+
outputSchema: z.object({
|
|
125
|
+
title: z.string().describe('Short title'),
|
|
126
|
+
confidence: z.number().min(0).max(1),
|
|
127
|
+
}),
|
|
128
|
+
|
|
129
|
+
// Optional: skills needed (MCP tools)
|
|
130
|
+
skills: ['browser', 'memory'],
|
|
131
|
+
|
|
132
|
+
// Optional: timeout in ms (default 300000)
|
|
133
|
+
timeout: 600000,
|
|
134
|
+
|
|
135
|
+
// Optional: retry count
|
|
136
|
+
retries: 1,
|
|
137
|
+
|
|
138
|
+
// Optional: post-processing hook
|
|
139
|
+
onComplete: async (state, result) => {
|
|
140
|
+
// Transform result before it goes into state
|
|
141
|
+
return { ...result, processedAt: Date.now() };
|
|
142
|
+
},
|
|
143
|
+
};
|
|
144
|
+
```
|
|
145
|
+
|
|
146
|
+
For nodes that don't call an LLM (pure data transforms), use a custom `execute` function:
|
|
147
|
+
|
|
148
|
+
```javascript
|
|
149
|
+
export const transformNode = {
|
|
150
|
+
name: 'transform',
|
|
151
|
+
_isCustomCode: true,
|
|
152
|
+
outputSchema: z.object({ cleaned: z.string() }),
|
|
153
|
+
execute: async (context) => {
|
|
154
|
+
const raw = context.state.get('raw_data');
|
|
155
|
+
return { cleaned: raw.trim().toLowerCase() };
|
|
156
|
+
},
|
|
157
|
+
};
|
|
158
|
+
```
|
|
159
|
+
|
|
160
|
+
## Agent Strategy Framework
|
|
161
|
+
|
|
162
|
+
All agents implement the same `AgentStrategy` base class:
|
|
163
|
+
|
|
164
|
+
```javascript
|
|
165
|
+
import { AgentStrategy } from '@zibby/core';
|
|
166
|
+
|
|
167
|
+
class MyCustomAgent extends AgentStrategy {
|
|
168
|
+
constructor() {
|
|
169
|
+
super('my-agent', 'My Custom Agent', 50);
|
|
170
|
+
}
|
|
171
|
+
|
|
172
|
+
canHandle(context) {
|
|
173
|
+
return !!process.env.MY_AGENT_KEY;
|
|
174
|
+
}
|
|
175
|
+
|
|
176
|
+
async invoke(prompt, options) {
|
|
177
|
+
// options.schema — Zod schema for structured output
|
|
178
|
+
// options.workspace — working directory
|
|
179
|
+
// options.skills — skill IDs to resolve
|
|
180
|
+
// options.model — model name or 'auto'
|
|
181
|
+
// options.timeout — execution timeout
|
|
182
|
+
const response = await myApiCall(prompt, options);
|
|
183
|
+
if (options.schema) {
|
|
184
|
+
return { raw: response, structured: options.schema.parse(JSON.parse(response)) };
|
|
185
|
+
}
|
|
186
|
+
return response;
|
|
187
|
+
}
|
|
188
|
+
}
|
|
189
|
+
```
|
|
190
|
+
|
|
191
|
+
Select and invoke an agent:
|
|
192
|
+
|
|
193
|
+
```javascript
|
|
194
|
+
import { invokeAgent, getAgentStrategy } from '@zibby/core';
|
|
195
|
+
|
|
196
|
+
// Auto-select based on config
|
|
197
|
+
const result = await invokeAgent(prompt, { state: { agentType: 'cursor' } }, {
|
|
198
|
+
model: 'auto',
|
|
199
|
+
workspace: process.cwd(),
|
|
200
|
+
schema: MyZodSchema,
|
|
201
|
+
skills: ['browser'],
|
|
202
|
+
});
|
|
203
|
+
```
|
|
204
|
+
|
|
205
|
+
## Graph Compiler
|
|
206
|
+
|
|
207
|
+
Compile a JSON graph definition (from the Zibby dashboard visual editor) into an executable `WorkflowGraph`:
|
|
208
|
+
|
|
209
|
+
```javascript
|
|
210
|
+
import { compileGraph, validateGraphConfig } from '@zibby/core';
|
|
211
|
+
|
|
212
|
+
const graphJson = {
|
|
213
|
+
nodes: [
|
|
214
|
+
{ id: 'preflight', type: 'preflight', data: { nodeType: 'preflight' } },
|
|
215
|
+
{ id: 'execute_live', type: 'execute_live', data: { nodeType: 'execute_live' } },
|
|
216
|
+
],
|
|
217
|
+
edges: [
|
|
218
|
+
{ source: 'preflight', target: 'execute_live' },
|
|
219
|
+
{ source: 'execute_live', target: 'END' },
|
|
220
|
+
],
|
|
221
|
+
nodeConfigs: {
|
|
222
|
+
preflight: { prompt: 'Analyze: {{testSpec}}' },
|
|
223
|
+
},
|
|
224
|
+
};
|
|
225
|
+
|
|
226
|
+
// Validate
|
|
227
|
+
const { valid, errors } = validateGraphConfig(graphJson);
|
|
228
|
+
|
|
229
|
+
// Compile
|
|
230
|
+
const graph = compileGraph(graphJson, { stateSchema: MySchema });
|
|
231
|
+
|
|
232
|
+
// Run
|
|
233
|
+
await graph.run(agent, initialState);
|
|
234
|
+
```
|
|
235
|
+
|
|
236
|
+
## Built-in Templates
|
|
237
|
+
|
|
238
|
+
### Browser Test Automation
|
|
239
|
+
|
|
240
|
+
```
|
|
241
|
+
preflight → execute_live → generate_script → END
|
|
242
|
+
```
|
|
243
|
+
|
|
244
|
+
| Node | Skills | Output |
|
|
245
|
+
|---|---|---|
|
|
246
|
+
| `preflight` | — | `{ title, assertions[] }` |
|
|
247
|
+
| `execute_live` | browser, memory | `{ success, steps[], actions[], assertions[] }` |
|
|
248
|
+
| `generate_script` | — | `{ testCode, filename }` |
|
|
249
|
+
|
|
250
|
+
### Code Analysis
|
|
251
|
+
|
|
252
|
+
```
|
|
253
|
+
setup → analyze_ticket → generate_code → generate_test_cases → finalize → END
|
|
254
|
+
```
|
|
255
|
+
|
|
256
|
+
Used by the cloud pipeline for Jira ticket analysis and code generation.
|