zigrix 0.1.0-alpha.7 → 0.1.0-alpha.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/LICENSE +1 -1
- package/README.md +248 -112
- package/dist/agents/registry.js +5 -2
- package/dist/agents/roles.d.ts +10 -0
- package/dist/agents/roles.js +83 -0
- package/dist/config/defaults.d.ts +2 -1
- package/dist/config/defaults.js +2 -1
- package/dist/config/schema.d.ts +25 -3
- package/dist/config/schema.js +34 -2
- package/dist/configure.d.ts +1 -0
- package/dist/configure.js +14 -1
- package/dist/dashboard/.next/BUILD_ID +1 -1
- package/dist/dashboard/.next/app-build-manifest.json +10 -10
- package/dist/dashboard/.next/app-path-routes-manifest.json +4 -4
- package/dist/dashboard/.next/build-manifest.json +2 -2
- package/dist/dashboard/.next/server/app/_not-found.html +1 -1
- package/dist/dashboard/.next/server/app/_not-found.rsc +1 -1
- package/dist/dashboard/.next/server/app/api/auth/login/route.js +1 -1
- package/dist/dashboard/.next/server/app/api/auth/logout/route.js +1 -1
- package/dist/dashboard/.next/server/app/api/auth/session/route.js +1 -1
- package/dist/dashboard/.next/server/app/api/auth/setup/route.js +1 -1
- package/dist/dashboard/.next/server/app/api/overview/route.js +1 -1
- package/dist/dashboard/.next/server/app/api/stream/route.js +1 -1
- package/dist/dashboard/.next/server/app/api/tasks/[taskId]/cancel/route.js +1 -1
- package/dist/dashboard/.next/server/app/api/tasks/[taskId]/conversation/route.js +1 -1
- package/dist/dashboard/.next/server/app/api/tasks/[taskId]/route.js +1 -1
- package/dist/dashboard/.next/server/app/login.html +1 -1
- package/dist/dashboard/.next/server/app/login.rsc +1 -1
- package/dist/dashboard/.next/server/app/setup.html +1 -1
- package/dist/dashboard/.next/server/app/setup.rsc +1 -1
- package/dist/dashboard/.next/server/app-paths-manifest.json +4 -4
- package/dist/dashboard/.next/server/functions-config-manifest.json +3 -3
- package/dist/dashboard/.next/server/middleware.js +1 -1
- package/dist/dashboard/.next/server/pages/404.html +1 -1
- package/dist/dashboard/.next/server/pages/500.html +1 -1
- package/dist/index.js +5 -1
- package/dist/onboard.d.ts +16 -2
- package/dist/onboard.js +128 -9
- package/dist/orchestration/dispatch.d.ts +2 -1
- package/dist/orchestration/dispatch.js +157 -41
- package/dist/orchestration/evidence.js +17 -3
- package/dist/orchestration/finalize.js +2 -2
- package/dist/orchestration/report.js +6 -1
- package/dist/orchestration/worker.d.ts +1 -1
- package/dist/orchestration/worker.js +17 -2
- package/dist/rules/templates.js +3 -6
- package/dist/state/tasks.d.ts +7 -0
- package/package.json +1 -1
- package/skills/zigrix-main-agent-guide/SKILL.md +118 -0
- /package/dist/dashboard/.next/static/{afoa9JVywKLyR6X4Cxspl → TlUj0t8APzTccK13DVZZW}/_buildManifest.js +0 -0
- /package/dist/dashboard/.next/static/{afoa9JVywKLyR6X4Cxspl → TlUj0t8APzTccK13DVZZW}/_ssgManifest.js +0 -0
package/LICENSE
CHANGED
|
@@ -169,7 +169,7 @@ recommend that a file or class name and description of purpose be included on
|
|
|
169
169
|
the same "printed page" as the copyright notice for easier identification
|
|
170
170
|
within third-party archives.
|
|
171
171
|
|
|
172
|
-
Copyright
|
|
172
|
+
Copyright 2026 owen-ever
|
|
173
173
|
|
|
174
174
|
Licensed under the Apache License, Version 2.0 (the "License");
|
|
175
175
|
you may not use this file except in compliance with the License.
|
package/README.md
CHANGED
|
@@ -1,164 +1,300 @@
|
|
|
1
|
-
|
|
1
|
+
<h1 align="center">Zigrix</h1>
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
<p align="center">
|
|
4
|
+
<strong>OpenClaw-first orchestration CLI for tracked, multi-agent execution.</strong>
|
|
5
|
+
</p>
|
|
4
6
|
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
- rule/template validation and recovery
|
|
10
|
-
- evidence merge + final report rendering
|
|
11
|
-
- OpenClaw integration (skill registration + PATH stabilization)
|
|
12
|
-
- built-in web dashboard (`zigrix dashboard --port 3838`)
|
|
13
|
-
- release-friendly Node/TypeScript packaging
|
|
7
|
+
<p align="center">
|
|
8
|
+
Zigrix turns ad-hoc agent delegation into a tracked, inspectable workflow<br>
|
|
9
|
+
with specialist routing, evidence collection, final reporting, and a built-in dashboard.
|
|
10
|
+
</p>
|
|
14
11
|
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
-
|
|
18
|
-
-
|
|
19
|
-
-
|
|
20
|
-
|
|
12
|
+
<p align="center">
|
|
13
|
+
<a href="https://www.npmjs.com/package/zigrix"><img src="https://img.shields.io/npm/v/zigrix?color=cb3837" alt="npm version"></a>
|
|
14
|
+
<img src="https://img.shields.io/badge/node-%3E%3D22-339933?logo=node.js&logoColor=white" alt="Node >=22">
|
|
15
|
+
<img src="https://img.shields.io/badge/license-Apache--2.0-blue" alt="License">
|
|
16
|
+
<img src="https://img.shields.io/badge/platform-macOS%20%7C%20Linux-lightgrey" alt="Platform">
|
|
17
|
+
<img src="https://img.shields.io/badge/OpenClaw-first-6f42c1" alt="OpenClaw-first">
|
|
18
|
+
<img src="https://img.shields.io/badge/stage-alpha-orange" alt="Alpha">
|
|
19
|
+
</p>
|
|
21
20
|
|
|
22
|
-
|
|
23
|
-
-
|
|
24
|
-
-
|
|
25
|
-
-
|
|
21
|
+
<p align="center">
|
|
22
|
+
<a href="#quick-start">Quick Start</a> ·
|
|
23
|
+
<a href="#why-zigrix">Why Zigrix</a> ·
|
|
24
|
+
<a href="#what-zigrix-does">What It Does</a> ·
|
|
25
|
+
<a href="docs/architecture.md">Architecture</a> ·
|
|
26
|
+
<a href="docs/openclaw-integration.md">OpenClaw Integration</a> ·
|
|
27
|
+
<a href="#documentation">Docs</a>
|
|
28
|
+
</p>
|
|
26
29
|
|
|
27
|
-
|
|
30
|
+
---
|
|
28
31
|
|
|
29
|
-
##
|
|
32
|
+
## Why Zigrix
|
|
30
33
|
|
|
31
|
-
|
|
32
|
-
# Install and onboard (one-time human setup)
|
|
33
|
-
./install.sh
|
|
34
|
-
zigrix onboard
|
|
34
|
+
Most agent workflows break down at the same point:
|
|
35
35
|
|
|
36
|
-
|
|
37
|
-
|
|
36
|
+
- work gets delegated in chat, but **not tracked**
|
|
37
|
+
- follow-up lives in memory, not in **runtime state**
|
|
38
|
+
- specialist routing is **inconsistent**
|
|
39
|
+
- results arrive without **evidence** or a reliable **final report**
|
|
38
40
|
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
```
|
|
41
|
+
Zigrix gives that work a control surface — visible, recoverable, and inspectable from dispatch to finalization.
|
|
42
|
+
|
|
43
|
+
---
|
|
43
44
|
|
|
44
|
-
|
|
45
|
+
## What Zigrix does
|
|
45
46
|
|
|
46
|
-
|
|
47
|
+
| Capability | Description |
|
|
48
|
+
|---|---|
|
|
49
|
+
| **Task dispatch** | Tracked tasks with full orchestration metadata |
|
|
50
|
+
| **Specialist routing** | Role-based dispatch maps work to standard roles (`orchestrator`, `qa`, `security`, `frontend`, `backend`, `system`) |
|
|
51
|
+
| **Evidence collection** | Workers contribute evidence before finalization |
|
|
52
|
+
| **Final reporting** | Inspectable reports with execution unit checks |
|
|
53
|
+
| **Built-in dashboard** | Web UI for runtime visibility (`zigrix dashboard`) |
|
|
54
|
+
| **OpenClaw integration** | Agent import, skill registration, PATH stabilization |
|
|
55
|
+
| **Recovery-first** | Reset, re-seed, re-onboard — recoverable by default |
|
|
56
|
+
|
|
57
|
+
**Best with OpenClaw. Still usable as a standalone orchestration CLI.**
|
|
58
|
+
|
|
59
|
+
---
|
|
60
|
+
|
|
61
|
+
## Quick Start
|
|
62
|
+
|
|
63
|
+
### Step 1 — Install
|
|
47
64
|
|
|
48
65
|
```bash
|
|
49
|
-
|
|
66
|
+
npm install -g zigrix
|
|
50
67
|
```
|
|
51
68
|
|
|
52
|
-
|
|
69
|
+
### Step 2 — Onboard
|
|
53
70
|
|
|
54
71
|
```bash
|
|
55
|
-
|
|
56
|
-
node --version # confirm v22+
|
|
72
|
+
zigrix onboard
|
|
57
73
|
```
|
|
58
74
|
|
|
59
|
-
|
|
60
|
-
> If you switch node versions later, re-run the install to rebind:
|
|
61
|
-
> ```bash
|
|
62
|
-
> npm run build && npm link
|
|
63
|
-
> ```
|
|
75
|
+
### Step 3 — Verify
|
|
64
76
|
|
|
65
|
-
|
|
77
|
+
```bash
|
|
78
|
+
zigrix doctor
|
|
79
|
+
zigrix dashboard
|
|
80
|
+
```
|
|
81
|
+
|
|
82
|
+
That's it. `onboard` handles config, agent import, skill registration, and PATH setup.
|
|
66
83
|
|
|
67
|
-
|
|
84
|
+
> **From source?** Clone this repo, run `./install.sh`, then `zigrix onboard`.
|
|
85
|
+
> See [docs/install.md](docs/install.md) for details.
|
|
86
|
+
|
|
87
|
+
### Prerequisites
|
|
88
|
+
|
|
89
|
+
- **Node.js 22+** — verify with `node --version`
|
|
90
|
+
- **macOS or Linux** — Windows is not yet supported
|
|
91
|
+
|
|
92
|
+
If you use **nvm**, make sure the correct version is active before installing:
|
|
68
93
|
|
|
69
94
|
```bash
|
|
70
|
-
|
|
71
|
-
|
|
95
|
+
nvm use 22
|
|
96
|
+
node --version # confirm v22+
|
|
72
97
|
```
|
|
73
98
|
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
- start a bundled web dashboard with explicit port control (`zigrix dashboard --port <n>`, default 3838)
|
|
91
|
-
- **configure** agents, rules, PATH, skills, and workspace after initial setup
|
|
92
|
-
|
|
93
|
-
## Recovery-first operations
|
|
94
|
-
Reset one broken template:
|
|
95
|
-
```bash
|
|
96
|
-
zigrix template reset workerPrompt --yes
|
|
99
|
+
---
|
|
100
|
+
|
|
101
|
+
## Core Workflow
|
|
102
|
+
|
|
103
|
+
A typical Zigrix flow:
|
|
104
|
+
|
|
105
|
+
```text
|
|
106
|
+
Human installs → zigrix onboard → runtime ready
|
|
107
|
+
|
|
108
|
+
zigrix task dispatch --title "..." --description "..." --scale normal
|
|
109
|
+
→ specialist agents contribute evidence
|
|
110
|
+
→ zigrix task finalize merges evidence + checks execution units
|
|
111
|
+
→ reportable result
|
|
112
|
+
|
|
113
|
+
zigrix dashboard
|
|
114
|
+
→ inspect task state, progress, and reports
|
|
97
115
|
```
|
|
98
116
|
|
|
99
|
-
|
|
117
|
+
### Key commands
|
|
118
|
+
|
|
100
119
|
```bash
|
|
120
|
+
# Dispatch a new task (role-based selection)
|
|
121
|
+
zigrix task dispatch --title "Implement auth module" --description "..." --scale normal --json
|
|
122
|
+
|
|
123
|
+
# Check runtime health
|
|
124
|
+
zigrix doctor
|
|
125
|
+
|
|
126
|
+
# Launch dashboard
|
|
127
|
+
zigrix dashboard --port 3838
|
|
128
|
+
|
|
129
|
+
# Reconfigure after changes
|
|
130
|
+
zigrix configure --section agents
|
|
131
|
+
zigrix configure --section skills
|
|
132
|
+
|
|
133
|
+
# Recovery
|
|
134
|
+
zigrix template reset workerPrompt --yes
|
|
101
135
|
zigrix reset config --yes
|
|
136
|
+
zigrix reset state --yes
|
|
102
137
|
```
|
|
103
138
|
|
|
104
|
-
|
|
139
|
+
### Standard roles and orchestrator selection
|
|
140
|
+
|
|
141
|
+
Zigrix dispatch uses a closed set of normalized roles:
|
|
142
|
+
|
|
143
|
+
- `orchestrator`
|
|
144
|
+
- `qa`
|
|
145
|
+
- `security`
|
|
146
|
+
- `frontend`
|
|
147
|
+
- `backend`
|
|
148
|
+
- `system`
|
|
149
|
+
|
|
150
|
+
At dispatch time, Zigrix resolves `requiredRoles` / `optionalRoles` from scale rules and maps them to enabled agents in the registry.
|
|
151
|
+
|
|
152
|
+
- `agents.orchestration.orchestratorId` selects the orchestrator owner agent
|
|
153
|
+
- if multiple orchestrator-role agents exist, `orchestratorId` is the source of truth
|
|
154
|
+
- dispatch output includes orchestration fields such as `orchestratorId`, `qaAgentId`, `baselineRequiredAgents`, `candidateAgents`, `roleAgentMap`, and `orchestratorPrompt`
|
|
155
|
+
|
|
156
|
+
---
|
|
157
|
+
|
|
158
|
+
## What `zigrix onboard` does
|
|
159
|
+
|
|
160
|
+
`onboard` prepares the runtime for actual orchestration work:
|
|
161
|
+
|
|
162
|
+
1. Creates `~/.zigrix/` with default config
|
|
163
|
+
2. Seeds rule files from bundled templates
|
|
164
|
+
3. Stabilizes PATH reachability
|
|
165
|
+
4. Detects OpenClaw when present
|
|
166
|
+
5. Imports agents from `openclaw.json`
|
|
167
|
+
6. Registers Zigrix skill packs into `~/.openclaw/skills/`
|
|
168
|
+
|
|
169
|
+
If OpenClaw is not present, Zigrix still initializes its own runtime and remains usable in standalone mode.
|
|
170
|
+
|
|
171
|
+
---
|
|
172
|
+
|
|
173
|
+
## OpenClaw Integration
|
|
174
|
+
|
|
175
|
+
Zigrix is **OpenClaw-first** in intended use.
|
|
176
|
+
|
|
177
|
+
When OpenClaw is available, Zigrix:
|
|
178
|
+
|
|
179
|
+
- **imports agent definitions** from `openclaw.json` — filters `main`, normalizes agent roles, and sets/validates `orchestratorId`
|
|
180
|
+
- **registers skill packs** — symlinks `skills/zigrix-*` into `~/.openclaw/skills/`
|
|
181
|
+
- **stabilizes CLI visibility** — ensures `zigrix` is reachable from the OpenClaw gateway-visible PATH
|
|
182
|
+
- **inspects readiness** — `zigrix doctor` reports OpenClaw detection, skill dir presence, and PATH reachability
|
|
183
|
+
|
|
184
|
+
The intended operator experience is strongest when OpenClaw is part of the stack.
|
|
185
|
+
|
|
186
|
+
See [docs/openclaw-integration.md](docs/openclaw-integration.md) for the full integration spec.
|
|
187
|
+
|
|
188
|
+
---
|
|
189
|
+
|
|
190
|
+
## Built-in Dashboard
|
|
191
|
+
|
|
192
|
+
Zigrix ships with a bundled web dashboard for runtime visibility.
|
|
193
|
+
|
|
105
194
|
```bash
|
|
106
|
-
zigrix
|
|
195
|
+
zigrix dashboard --port 3838
|
|
107
196
|
```
|
|
108
197
|
|
|
109
|
-
|
|
110
|
-
-
|
|
111
|
-
-
|
|
112
|
-
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
198
|
+
Use it to inspect:
|
|
199
|
+
- active task state and orchestration progress
|
|
200
|
+
- agent participation and evidence flow
|
|
201
|
+
- finalization and report status
|
|
202
|
+
|
|
203
|
+
<!-- TODO: dashboard screenshot -->
|
|
204
|
+
|
|
205
|
+
---
|
|
206
|
+
|
|
207
|
+
## Intended User Model
|
|
208
|
+
|
|
209
|
+
| Role | What they do |
|
|
210
|
+
|---|---|
|
|
211
|
+
| **Human operator** | Install, run `zigrix onboard`, verify with `zigrix doctor`, then stop |
|
|
212
|
+
| **OpenClaw agents** | Use operational commands: `task dispatch`, `task finalize`, `worker`, `evidence`, `report` |
|
|
213
|
+
| **Advanced maintenance** | `zigrix configure` for reconfiguration, `zigrix reset` for recovery |
|
|
214
|
+
|
|
215
|
+
See [docs/onboarding-ownership-model.md](docs/onboarding-ownership-model.md) for the ownership model.
|
|
216
|
+
|
|
217
|
+
---
|
|
218
|
+
|
|
219
|
+
## Product Stance
|
|
220
|
+
|
|
221
|
+
Zigrix is:
|
|
222
|
+
|
|
223
|
+
- **local-first** — runtime state lives in `~/.zigrix/`, not a cloud service
|
|
224
|
+
- **runtime-visible** — tasks, evidence, and reports are inspectable, not hidden
|
|
225
|
+
- **recoverable by default** — reset templates, config, or state independently
|
|
226
|
+
- **OpenClaw-first** — best with OpenClaw, still usable standalone
|
|
227
|
+
- **operator-friendly** — `onboard` + `doctor` + `dashboard` cover the human path
|
|
228
|
+
|
|
229
|
+
### Non-goals right now
|
|
230
|
+
|
|
231
|
+
- hosted control plane or multi-user UI
|
|
232
|
+
- generalized plugin SDK
|
|
233
|
+
- Windows-first support
|
|
234
|
+
- speculative expansion before core workflow is stable
|
|
235
|
+
|
|
236
|
+
---
|
|
237
|
+
|
|
238
|
+
## Repository Layout
|
|
239
|
+
|
|
128
240
|
```text
|
|
129
241
|
zigrix/
|
|
130
|
-
├─ src/ # Node/
|
|
131
|
-
├─ tests/ # test
|
|
242
|
+
├─ src/ # Node/TypeScript implementation
|
|
243
|
+
├─ tests/ # test suite
|
|
132
244
|
├─ skills/ # OpenClaw skill packs
|
|
245
|
+
├─ dashboard/ # bundled Next.js dashboard
|
|
246
|
+
├─ rules/ # default rule/template files
|
|
133
247
|
├─ examples/ # example workflows
|
|
134
248
|
├─ scripts/ # smoke / release helpers
|
|
135
249
|
├─ docs/ # product + architecture docs
|
|
136
|
-
├─ legacy-python/ # reference prototype
|
|
137
|
-
└─ .
|
|
250
|
+
├─ legacy-python/ # reference prototype (not active)
|
|
251
|
+
└─ install.sh # source-based install script
|
|
138
252
|
```
|
|
139
253
|
|
|
140
|
-
|
|
141
|
-
- local-first
|
|
142
|
-
- config-first
|
|
143
|
-
- recoverable by default
|
|
144
|
-
- OpenClaw-friendly, not OpenClaw-dependent in the core
|
|
145
|
-
- stability before speculative expansion
|
|
254
|
+
---
|
|
146
255
|
|
|
147
|
-
##
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
-
|
|
152
|
-
|
|
256
|
+
## Documentation
|
|
257
|
+
|
|
258
|
+
| Doc | What it covers |
|
|
259
|
+
|---|---|
|
|
260
|
+
| [Quick Start](docs/quickstart.md) | First-time setup walk-through |
|
|
261
|
+
| [Install](docs/install.md) | Install paths, prerequisites, nvm notes |
|
|
262
|
+
| [OpenClaw Integration](docs/openclaw-integration.md) | Agent import, skill registration, PATH |
|
|
263
|
+
| [Config Schema](docs/config-schema.md) | Config contract including role model and `orchestratorId` |
|
|
264
|
+
| [Orchestrator/Role Guide](docs/orchestrator-role-guide.md) | Role normalization, dispatch mapping, and orchestrator selection |
|
|
265
|
+
| [Architecture](docs/architecture.md) | System design and runtime layout |
|
|
266
|
+
| [CLI Spec](docs/cli-spec.md) | Full command reference |
|
|
267
|
+
| [Runtime Flow](docs/runtime-flow.md) | Task lifecycle from dispatch to report |
|
|
268
|
+
| [State Layout](docs/state-layout.md) | `~/.zigrix/` directory structure |
|
|
269
|
+
| [Concepts](docs/concepts.md) | Core abstractions and terminology |
|
|
270
|
+
| [Troubleshooting](docs/troubleshooting.md) | Common issues and recovery |
|
|
271
|
+
| [Main Agent Skill Guide](skills/zigrix-main-agent-guide/SKILL.md) | Dispatch → orchestrator spawn → worker/evidence/finalize chain |
|
|
272
|
+
| [Product Decisions](docs/product-decisions.md) | Why things are the way they are |
|
|
273
|
+
|
|
274
|
+
---
|
|
275
|
+
|
|
276
|
+
## Current Status
|
|
277
|
+
|
|
278
|
+
- **Stage:** alpha — productization in progress
|
|
279
|
+
- **Implementation:** Node/TypeScript (repository root)
|
|
280
|
+
- **Published:** [`zigrix` on npm](https://www.npmjs.com/package/zigrix)
|
|
281
|
+
- **Supported platforms:** macOS, Linux
|
|
282
|
+
- **Legacy:** Python prototype under `legacy-python/` (reference only)
|
|
283
|
+
|
|
284
|
+
---
|
|
153
285
|
|
|
154
286
|
## Contributing
|
|
155
|
-
|
|
287
|
+
|
|
288
|
+
See [CONTRIBUTING.md](CONTRIBUTING.md).
|
|
156
289
|
|
|
157
290
|
## Support
|
|
158
|
-
|
|
291
|
+
|
|
292
|
+
See [SUPPORT.md](SUPPORT.md).
|
|
159
293
|
|
|
160
294
|
## Security
|
|
161
|
-
|
|
295
|
+
|
|
296
|
+
See [SECURITY.md](SECURITY.md).
|
|
162
297
|
|
|
163
298
|
## License
|
|
299
|
+
|
|
164
300
|
Apache-2.0
|
package/dist/agents/registry.js
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { assertStandardAgentRole } from './roles.js';
|
|
1
2
|
import { zigrixConfigSchema } from '../config/schema.js';
|
|
2
3
|
function assertAgentExists(config, agentId) {
|
|
3
4
|
if (!config.agents.registry[agentId]) {
|
|
@@ -24,10 +25,11 @@ export function addAgent(config, params) {
|
|
|
24
25
|
if (config.agents.registry[params.id]) {
|
|
25
26
|
throw new Error(`agent already exists: ${params.id}`);
|
|
26
27
|
}
|
|
28
|
+
const normalizedRole = assertStandardAgentRole(params.role, 'agent role');
|
|
27
29
|
const next = structuredClone(config);
|
|
28
30
|
next.agents.registry[params.id] = {
|
|
29
31
|
label: params.label ?? params.id,
|
|
30
|
-
role:
|
|
32
|
+
role: normalizedRole,
|
|
31
33
|
runtime: params.runtime,
|
|
32
34
|
enabled: params.enabled ?? true,
|
|
33
35
|
metadata: {},
|
|
@@ -88,8 +90,9 @@ export function setAgentEnabled(config, agentId, enabled) {
|
|
|
88
90
|
}
|
|
89
91
|
export function setAgentRole(config, agentId, role) {
|
|
90
92
|
assertAgentExists(config, agentId);
|
|
93
|
+
const normalizedRole = assertStandardAgentRole(role, 'agent role');
|
|
91
94
|
const next = structuredClone(config);
|
|
92
|
-
next.agents.registry[agentId].role =
|
|
95
|
+
next.agents.registry[agentId].role = normalizedRole;
|
|
93
96
|
return {
|
|
94
97
|
config: zigrixConfigSchema.parse(next),
|
|
95
98
|
changed: true,
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
export declare const STANDARD_AGENT_ROLES: readonly ["orchestrator", "qa", "security", "frontend", "backend", "system"];
|
|
2
|
+
export type StandardAgentRole = (typeof STANDARD_AGENT_ROLES)[number];
|
|
3
|
+
export declare const ROLE_HINTS: Record<StandardAgentRole, string>;
|
|
4
|
+
export declare function normalizeAgentRole(value: string): StandardAgentRole | null;
|
|
5
|
+
export declare function assertStandardAgentRole(value: string, context?: string): StandardAgentRole;
|
|
6
|
+
export declare function inferStandardAgentRole(params: {
|
|
7
|
+
agentId: string;
|
|
8
|
+
theme?: string | null;
|
|
9
|
+
}): StandardAgentRole;
|
|
10
|
+
export declare function listStandardRolesText(): string;
|
|
@@ -0,0 +1,83 @@
|
|
|
1
|
+
export const STANDARD_AGENT_ROLES = [
|
|
2
|
+
'orchestrator',
|
|
3
|
+
'qa',
|
|
4
|
+
'security',
|
|
5
|
+
'frontend',
|
|
6
|
+
'backend',
|
|
7
|
+
'system',
|
|
8
|
+
];
|
|
9
|
+
const ROLE_ALIAS_MAP = {
|
|
10
|
+
orchestrator: 'orchestrator',
|
|
11
|
+
orchestration: 'orchestrator',
|
|
12
|
+
orchestrate: 'orchestrator',
|
|
13
|
+
pro: 'orchestrator',
|
|
14
|
+
qa: 'qa',
|
|
15
|
+
quality: 'qa',
|
|
16
|
+
qualityassurance: 'qa',
|
|
17
|
+
test: 'qa',
|
|
18
|
+
testing: 'qa',
|
|
19
|
+
security: 'security',
|
|
20
|
+
sec: 'security',
|
|
21
|
+
frontend: 'frontend',
|
|
22
|
+
front: 'frontend',
|
|
23
|
+
ui: 'frontend',
|
|
24
|
+
client: 'frontend',
|
|
25
|
+
backend: 'backend',
|
|
26
|
+
back: 'backend',
|
|
27
|
+
server: 'backend',
|
|
28
|
+
api: 'backend',
|
|
29
|
+
system: 'system',
|
|
30
|
+
sys: 'system',
|
|
31
|
+
infra: 'system',
|
|
32
|
+
infrastructure: 'system',
|
|
33
|
+
architecture: 'system',
|
|
34
|
+
};
|
|
35
|
+
export const ROLE_HINTS = {
|
|
36
|
+
orchestrator: 'coordination / orchestration / execution planning',
|
|
37
|
+
qa: 'quality assurance / regression / verification',
|
|
38
|
+
security: 'security-sensitive scope or risky changes',
|
|
39
|
+
frontend: 'UI / styling / client-side integration when present',
|
|
40
|
+
backend: 'API / DB / server-side logic when present',
|
|
41
|
+
system: 'system architecture / technical decision / platform-wide changes',
|
|
42
|
+
};
|
|
43
|
+
export function normalizeAgentRole(value) {
|
|
44
|
+
const normalized = value.trim().toLowerCase().replace(/[^a-z]/g, '');
|
|
45
|
+
return ROLE_ALIAS_MAP[normalized] ?? null;
|
|
46
|
+
}
|
|
47
|
+
export function assertStandardAgentRole(value, context = 'role') {
|
|
48
|
+
const normalized = normalizeAgentRole(value);
|
|
49
|
+
if (!normalized) {
|
|
50
|
+
throw new Error(`${context} must be one of: ${STANDARD_AGENT_ROLES.join(', ')}`);
|
|
51
|
+
}
|
|
52
|
+
return normalized;
|
|
53
|
+
}
|
|
54
|
+
function inferRoleFromHints(agentIdOrTheme) {
|
|
55
|
+
const normalized = agentIdOrTheme.trim().toLowerCase();
|
|
56
|
+
if (!normalized)
|
|
57
|
+
return null;
|
|
58
|
+
if (normalized.includes('qa') || normalized.includes('test'))
|
|
59
|
+
return 'qa';
|
|
60
|
+
if (normalized.includes('sec'))
|
|
61
|
+
return 'security';
|
|
62
|
+
if (normalized.includes('front') || normalized.includes('ui'))
|
|
63
|
+
return 'frontend';
|
|
64
|
+
if (normalized.includes('back') || normalized.includes('api') || normalized.includes('server'))
|
|
65
|
+
return 'backend';
|
|
66
|
+
if (normalized.includes('sys') || normalized.includes('infra') || normalized.includes('arch'))
|
|
67
|
+
return 'system';
|
|
68
|
+
if (normalized.includes('pro') || normalized.includes('orch') || normalized.includes('coord'))
|
|
69
|
+
return 'orchestrator';
|
|
70
|
+
return null;
|
|
71
|
+
}
|
|
72
|
+
export function inferStandardAgentRole(params) {
|
|
73
|
+
const fromTheme = params.theme ? inferRoleFromHints(params.theme) : null;
|
|
74
|
+
if (fromTheme)
|
|
75
|
+
return fromTheme;
|
|
76
|
+
const fromId = inferRoleFromHints(params.agentId);
|
|
77
|
+
if (fromId)
|
|
78
|
+
return fromId;
|
|
79
|
+
return 'system';
|
|
80
|
+
}
|
|
81
|
+
export function listStandardRolesText() {
|
|
82
|
+
return STANDARD_AGENT_ROLES.join(', ');
|
|
83
|
+
}
|
|
@@ -18,6 +18,7 @@ export declare const defaultConfig: {
|
|
|
18
18
|
readonly orchestration: {
|
|
19
19
|
readonly participants: readonly [];
|
|
20
20
|
readonly excluded: readonly [];
|
|
21
|
+
readonly orchestratorId: "pro-zig";
|
|
21
22
|
};
|
|
22
23
|
};
|
|
23
24
|
readonly rules: {
|
|
@@ -32,7 +33,7 @@ export declare const defaultConfig: {
|
|
|
32
33
|
};
|
|
33
34
|
readonly risky: {
|
|
34
35
|
readonly requiredRoles: readonly ["orchestrator", "qa", "security"];
|
|
35
|
-
readonly optionalRoles: readonly ["frontend", "backend", "
|
|
36
|
+
readonly optionalRoles: readonly ["frontend", "backend", "system"];
|
|
36
37
|
};
|
|
37
38
|
};
|
|
38
39
|
readonly completion: {
|
package/dist/config/defaults.js
CHANGED
|
@@ -20,13 +20,14 @@ export const defaultConfig = {
|
|
|
20
20
|
orchestration: {
|
|
21
21
|
participants: [],
|
|
22
22
|
excluded: [],
|
|
23
|
+
orchestratorId: 'pro-zig',
|
|
23
24
|
},
|
|
24
25
|
},
|
|
25
26
|
rules: {
|
|
26
27
|
scales: {
|
|
27
28
|
simple: { requiredRoles: ['orchestrator'], optionalRoles: ['qa'] },
|
|
28
29
|
normal: { requiredRoles: ['orchestrator', 'qa'], optionalRoles: ['frontend', 'backend'] },
|
|
29
|
-
risky: { requiredRoles: ['orchestrator', 'qa', 'security'], optionalRoles: ['frontend', 'backend', '
|
|
30
|
+
risky: { requiredRoles: ['orchestrator', 'qa', 'security'], optionalRoles: ['frontend', 'backend', 'system'] },
|
|
30
31
|
},
|
|
31
32
|
completion: {
|
|
32
33
|
requireQa: true,
|
package/dist/config/schema.d.ts
CHANGED
|
@@ -16,7 +16,14 @@ export declare const zigrixConfigSchema: z.ZodObject<{
|
|
|
16
16
|
agents: z.ZodObject<{
|
|
17
17
|
registry: z.ZodRecord<z.ZodString, z.ZodObject<{
|
|
18
18
|
label: z.ZodString;
|
|
19
|
-
role: z.ZodString
|
|
19
|
+
role: z.ZodPipe<z.ZodPipe<z.ZodString, z.ZodTransform<"orchestrator" | "qa" | "security" | "frontend" | "backend" | "system", string>>, z.ZodEnum<{
|
|
20
|
+
orchestrator: "orchestrator";
|
|
21
|
+
qa: "qa";
|
|
22
|
+
security: "security";
|
|
23
|
+
frontend: "frontend";
|
|
24
|
+
backend: "backend";
|
|
25
|
+
system: "system";
|
|
26
|
+
}>>;
|
|
20
27
|
runtime: z.ZodString;
|
|
21
28
|
enabled: z.ZodDefault<z.ZodBoolean>;
|
|
22
29
|
metadata: z.ZodDefault<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
|
|
@@ -24,12 +31,27 @@ export declare const zigrixConfigSchema: z.ZodObject<{
|
|
|
24
31
|
orchestration: z.ZodObject<{
|
|
25
32
|
participants: z.ZodArray<z.ZodString>;
|
|
26
33
|
excluded: z.ZodArray<z.ZodString>;
|
|
34
|
+
orchestratorId: z.ZodString;
|
|
27
35
|
}, z.core.$strip>;
|
|
28
36
|
}, z.core.$strip>;
|
|
29
37
|
rules: z.ZodObject<{
|
|
30
38
|
scales: z.ZodRecord<z.ZodString, z.ZodObject<{
|
|
31
|
-
requiredRoles: z.ZodArray<z.ZodString
|
|
32
|
-
|
|
39
|
+
requiredRoles: z.ZodArray<z.ZodPipe<z.ZodPipe<z.ZodString, z.ZodTransform<"orchestrator" | "qa" | "security" | "frontend" | "backend" | "system", string>>, z.ZodEnum<{
|
|
40
|
+
orchestrator: "orchestrator";
|
|
41
|
+
qa: "qa";
|
|
42
|
+
security: "security";
|
|
43
|
+
frontend: "frontend";
|
|
44
|
+
backend: "backend";
|
|
45
|
+
system: "system";
|
|
46
|
+
}>>>;
|
|
47
|
+
optionalRoles: z.ZodArray<z.ZodPipe<z.ZodPipe<z.ZodString, z.ZodTransform<"orchestrator" | "qa" | "security" | "frontend" | "backend" | "system", string>>, z.ZodEnum<{
|
|
48
|
+
orchestrator: "orchestrator";
|
|
49
|
+
qa: "qa";
|
|
50
|
+
security: "security";
|
|
51
|
+
frontend: "frontend";
|
|
52
|
+
backend: "backend";
|
|
53
|
+
system: "system";
|
|
54
|
+
}>>>;
|
|
33
55
|
}, z.core.$strip>>;
|
|
34
56
|
completion: z.ZodObject<{
|
|
35
57
|
requireQa: z.ZodBoolean;
|