zigrix 0.1.0-alpha.8 → 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.
Files changed (55) hide show
  1. package/LICENSE +1 -1
  2. package/README.md +248 -112
  3. package/dist/agents/registry.js +5 -2
  4. package/dist/agents/roles.d.ts +10 -0
  5. package/dist/agents/roles.js +83 -0
  6. package/dist/config/defaults.d.ts +2 -1
  7. package/dist/config/defaults.js +2 -1
  8. package/dist/config/schema.d.ts +25 -3
  9. package/dist/config/schema.js +34 -2
  10. package/dist/configure.d.ts +1 -0
  11. package/dist/configure.js +14 -1
  12. package/dist/dashboard/.next/BUILD_ID +1 -1
  13. package/dist/dashboard/.next/app-build-manifest.json +14 -14
  14. package/dist/dashboard/.next/app-path-routes-manifest.json +5 -5
  15. package/dist/dashboard/.next/build-manifest.json +2 -2
  16. package/dist/dashboard/.next/prerender-manifest.json +7 -7
  17. package/dist/dashboard/.next/server/app/_not-found/page_client-reference-manifest.js +1 -1
  18. package/dist/dashboard/.next/server/app/_not-found.html +1 -1
  19. package/dist/dashboard/.next/server/app/_not-found.rsc +1 -1
  20. package/dist/dashboard/.next/server/app/api/auth/login/route_client-reference-manifest.js +1 -1
  21. package/dist/dashboard/.next/server/app/api/auth/logout/route_client-reference-manifest.js +1 -1
  22. package/dist/dashboard/.next/server/app/api/auth/session/route_client-reference-manifest.js +1 -1
  23. package/dist/dashboard/.next/server/app/api/auth/setup/route_client-reference-manifest.js +1 -1
  24. package/dist/dashboard/.next/server/app/api/overview/route_client-reference-manifest.js +1 -1
  25. package/dist/dashboard/.next/server/app/api/stream/route_client-reference-manifest.js +1 -1
  26. package/dist/dashboard/.next/server/app/api/tasks/[taskId]/cancel/route_client-reference-manifest.js +1 -1
  27. package/dist/dashboard/.next/server/app/api/tasks/[taskId]/conversation/route_client-reference-manifest.js +1 -1
  28. package/dist/dashboard/.next/server/app/api/tasks/[taskId]/route_client-reference-manifest.js +1 -1
  29. package/dist/dashboard/.next/server/app/login/page_client-reference-manifest.js +1 -1
  30. package/dist/dashboard/.next/server/app/login.html +1 -1
  31. package/dist/dashboard/.next/server/app/login.rsc +1 -1
  32. package/dist/dashboard/.next/server/app/page_client-reference-manifest.js +1 -1
  33. package/dist/dashboard/.next/server/app/setup/page_client-reference-manifest.js +1 -1
  34. package/dist/dashboard/.next/server/app/setup.html +1 -1
  35. package/dist/dashboard/.next/server/app/setup.rsc +1 -1
  36. package/dist/dashboard/.next/server/app-paths-manifest.json +5 -5
  37. package/dist/dashboard/.next/server/functions-config-manifest.json +4 -4
  38. package/dist/dashboard/.next/server/pages/404.html +1 -1
  39. package/dist/dashboard/.next/server/pages/500.html +1 -1
  40. package/dist/index.js +5 -1
  41. package/dist/onboard.d.ts +16 -2
  42. package/dist/onboard.js +128 -9
  43. package/dist/orchestration/dispatch.d.ts +2 -1
  44. package/dist/orchestration/dispatch.js +157 -41
  45. package/dist/orchestration/evidence.js +17 -3
  46. package/dist/orchestration/finalize.js +2 -2
  47. package/dist/orchestration/report.js +6 -1
  48. package/dist/orchestration/worker.d.ts +1 -1
  49. package/dist/orchestration/worker.js +17 -2
  50. package/dist/rules/templates.js +3 -6
  51. package/dist/state/tasks.d.ts +7 -0
  52. package/package.json +1 -1
  53. package/skills/zigrix-main-agent-guide/SKILL.md +118 -0
  54. /package/dist/dashboard/.next/static/{2a4glWei05xr4Jg0Ly6cp → TlUj0t8APzTccK13DVZZW}/_buildManifest.js +0 -0
  55. /package/dist/dashboard/.next/static/{2a4glWei05xr4Jg0Ly6cp → 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 [yyyy] [name of copyright owner]
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
- # Zigrix
1
+ <h1 align="center">Zigrix</h1>
2
2
 
3
- Zigrix is a **multi-project parallel task orchestration CLI** for agent-assisted development workflows.
3
+ <p align="center">
4
+ <strong>OpenClaw-first orchestration CLI for tracked, multi-agent execution.</strong>
5
+ </p>
4
6
 
5
- It turns ad-hoc delegation into a file-backed, inspectable flow with:
6
- - global runtime state (`~/.zigrix/`) tasks are not project-bound
7
- - task dispatch and finalization with full orchestration metadata
8
- - agent registry + participation control
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
- ## Current status
16
- - Stage: **alpha, productization in progress**
17
- - Main implementation: **Node/TypeScript at repository root**
18
- - Legacy reference: **Python prototype under `legacy-python/`**
19
- - Supported first: **macOS, Linux**
20
- - Packaging path: **GitHub Releases + install.sh**, npm publish prepared for manual follow-up
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
- ## Intended user model
23
- - **Human operator:** install Zigrix, run `zigrix onboard`, and stop there unless recovery or advanced maintenance is needed.
24
- - **OpenClaw agents:** use the operational Zigrix commands (`task`, `worker`, `evidence`, `report`, `pipeline`, and low-level config surfaces) after onboarding.
25
- - **Advanced maintenance:** `zigrix configure` for reconfiguration, `zigrix reset` for recovery.
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
- See `docs/onboarding-ownership-model.md` for the product-direction source of truth.
30
+ ---
28
31
 
29
- ## Quick start
32
+ ## Why Zigrix
30
33
 
31
- ```bash
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
- # Verify readiness
37
- zigrix doctor
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
- # Launch dashboard (foreground, Ctrl+C to stop)
40
- zigrix dashboard
41
- # zigrix dashboard --port 3939
42
- ```
41
+ Zigrix gives that work a control surface — visible, recoverable, and inspectable from dispatch to finalization.
42
+
43
+ ---
43
44
 
44
- ### Prerequisites: Node.js version
45
+ ## What Zigrix does
45
46
 
46
- Zigrix requires Node.js **22 or later**. Verify before installing:
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
- node --version # must be v22.x or higher
66
+ npm install -g zigrix
50
67
  ```
51
68
 
52
- If you use **nvm**, make sure the correct version is active:
69
+ ### Step 2 Onboard
53
70
 
54
71
  ```bash
55
- nvm use 22 # or: nvm use --lts
56
- node --version # confirm v22+
72
+ zigrix onboard
57
73
  ```
58
74
 
59
- > **Important (nvm users):** `npm link` binds `zigrix` to whichever Node version is active at install time.
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
- ### Version mismatch troubleshooting
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
- If `zigrix --version` shows an unexpected version after updating, rebuild and relink:
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
- npm run build && npm link
71
- zigrix --version # should now match package.json
95
+ nvm use 22
96
+ node --version # confirm v22+
72
97
  ```
73
98
 
74
- `zigrix onboard` will:
75
- 1. Create `~/.zigrix/` with default config
76
- 2. Detect OpenClaw and import agents from `openclaw.json`
77
- 3. Seed rule files from `orchestration/rules/`
78
- 4. Ensure `zigrix` is reachable from PATH (creates symlink if needed)
79
- 5. Register zigrix skill packs into OpenClaw's `~/.openclaw/skills/`
80
-
81
- ## What Zigrix can do today
82
- - **dispatch** tasks with full orchestration metadata (replaces `dev_dispatch.py`)
83
- - **finalize** tasks with evidence merge and execution unit checks (replaces `dev_finalize.py`)
84
- - validate, inspect, change, diff, and reset config
85
- - manage agent registry and orchestration membership
86
- - validate, render, edit, diff, and reset rules/templates
87
- - create and track tasks with append-only event history
88
- - manage worker/evidence/report lifecycle
89
- - detect stale tasks, verify state consistency, and recover state
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
- Reset all config back to defaults:
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
- Reset runtime state only:
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 reset state --yes
195
+ zigrix dashboard --port 3838
107
196
  ```
108
197
 
109
- ## Documentation map
110
- - `docs/quickstart.md`
111
- - `docs/onboarding-ownership-model.md`
112
- - `docs/product-decisions.md`
113
- - `docs/cli-spec.md`
114
- - `docs/openclaw-integration.md`
115
- - `docs/concepts.md`
116
- - `docs/runtime-flow.md`
117
- - `docs/state-layout.md`
118
- - `docs/troubleshooting.md`
119
- - `docs/v1-scope.md`
120
- - `docs/non-goals.md`
121
- - `docs/install.md`
122
- - `docs/release-process.md`
123
- - `docs/versioning.md`
124
- - `docs/known-limitations.md`
125
- - `docs/npm-publish-manual.md`
126
-
127
- ## Repository layout
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/TS main implementation
131
- ├─ tests/ # test coverage
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 only
137
- └─ .github/ # CI + issue/PR templates
250
+ ├─ legacy-python/ # reference prototype (not active)
251
+ └─ install.sh # source-based install script
138
252
  ```
139
253
 
140
- ## Product stance
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
- ## Non-goals right now
148
- - hosted control plane
149
- - hosted multi-user control-plane UI surface
150
- - generalized plugin SDK
151
- - automatic npm publish execution
152
- - Windows-first support
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
- See `CONTRIBUTING.md`.
287
+
288
+ See [CONTRIBUTING.md](CONTRIBUTING.md).
156
289
 
157
290
  ## Support
158
- See `SUPPORT.md`.
291
+
292
+ See [SUPPORT.md](SUPPORT.md).
159
293
 
160
294
  ## Security
161
- See `SECURITY.md`.
295
+
296
+ See [SECURITY.md](SECURITY.md).
162
297
 
163
298
  ## License
299
+
164
300
  Apache-2.0
@@ -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: params.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 = 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", "infra"];
36
+ readonly optionalRoles: readonly ["frontend", "backend", "system"];
36
37
  };
37
38
  };
38
39
  readonly completion: {
@@ -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', 'infra'] },
30
+ risky: { requiredRoles: ['orchestrator', 'qa', 'security'], optionalRoles: ['frontend', 'backend', 'system'] },
30
31
  },
31
32
  completion: {
32
33
  requireQa: true,
@@ -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
- optionalRoles: z.ZodArray<z.ZodString>;
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;