zigrix 0.1.0-alpha.8 → 0.1.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.
- package/LICENSE +1 -1
- package/README.md +159 -120
- package/dist/agents/registry.js +19 -2
- package/dist/agents/roles.d.ts +10 -0
- package/dist/agents/roles.js +83 -0
- package/dist/config/defaults.d.ts +88 -6
- package/dist/config/defaults.js +82 -50
- package/dist/config/load.d.ts +5 -3
- package/dist/config/load.js +69 -30
- package/dist/config/schema.d.ts +46 -4
- package/dist/config/schema.js +49 -3
- package/dist/configure.d.ts +2 -0
- package/dist/configure.js +37 -14
- package/dist/dashboard/.next/BUILD_ID +1 -1
- package/dist/dashboard/.next/app-build-manifest.json +13 -13
- package/dist/dashboard/.next/app-path-routes-manifest.json +3 -3
- package/dist/dashboard/.next/build-manifest.json +2 -2
- package/dist/dashboard/.next/prerender-manifest.json +6 -6
- package/dist/dashboard/.next/server/app/_not-found/page_client-reference-manifest.js +1 -1
- 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/login/route_client-reference-manifest.js +1 -1
- package/dist/dashboard/.next/server/app/api/auth/logout/route.js +1 -1
- package/dist/dashboard/.next/server/app/api/auth/logout/route_client-reference-manifest.js +1 -1
- package/dist/dashboard/.next/server/app/api/auth/session/route.js +1 -1
- package/dist/dashboard/.next/server/app/api/auth/session/route_client-reference-manifest.js +1 -1
- package/dist/dashboard/.next/server/app/api/auth/setup/route.js +1 -1
- package/dist/dashboard/.next/server/app/api/auth/setup/route_client-reference-manifest.js +1 -1
- package/dist/dashboard/.next/server/app/api/overview/route_client-reference-manifest.js +1 -1
- package/dist/dashboard/.next/server/app/api/stream/route_client-reference-manifest.js +1 -1
- package/dist/dashboard/.next/server/app/api/tasks/[taskId]/cancel/route_client-reference-manifest.js +1 -1
- package/dist/dashboard/.next/server/app/api/tasks/[taskId]/conversation/route_client-reference-manifest.js +1 -1
- package/dist/dashboard/.next/server/app/api/tasks/[taskId]/route_client-reference-manifest.js +1 -1
- package/dist/dashboard/.next/server/app/login/page_client-reference-manifest.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/page.js +2 -2
- package/dist/dashboard/.next/server/app/page_client-reference-manifest.js +1 -1
- package/dist/dashboard/.next/server/app/setup/page_client-reference-manifest.js +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 +3 -3
- package/dist/dashboard/.next/server/chunks/972.js +1 -1
- 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/dashboard/.next/static/chunks/app/page-0314989c31e18b4b.js +1 -0
- package/dist/dashboard/.next/static/css/{94d75aff24d0c077.css → c3a7306cb2ba3f6c.css} +1 -1
- package/dist/dashboard.js +47 -0
- package/dist/doctor.js +28 -5
- package/dist/index.js +175 -171
- package/dist/onboard.d.ts +76 -2
- package/dist/onboard.js +529 -25
- package/dist/orchestration/dispatch.d.ts +3 -1
- package/dist/orchestration/dispatch.js +173 -45
- package/dist/orchestration/evidence.js +31 -4
- package/dist/orchestration/finalize.d.ts +1 -0
- package/dist/orchestration/finalize.js +5 -3
- package/dist/orchestration/report.js +9 -1
- package/dist/orchestration/worker.d.ts +1 -1
- package/dist/orchestration/worker.js +58 -8
- package/dist/rules/templates.js +3 -6
- package/dist/state/tasks.d.ts +12 -0
- package/dist/state/tasks.js +7 -0
- package/package.json +23 -2
- package/rules/defaults/README.md +9 -9
- package/rules/defaults/{back-zig.md → backend-agent.md} +4 -4
- package/rules/defaults/{front-zig.md → frontend-agent.md} +4 -4
- package/rules/defaults/orchestrator-agent.md +261 -0
- package/rules/defaults/{qa-zig.md → qa-agent.md} +11 -11
- package/rules/defaults/{sec-zig.md → security-agent.md} +4 -4
- package/rules/defaults/{sys-zig.md → system-agent.md} +8 -9
- package/rules/defaults/worker-common.md +25 -19
- package/skills/zigrix-doctor/SKILL.md +4 -2
- package/skills/zigrix-evidence/SKILL.md +7 -3
- package/skills/zigrix-main-agent-guide/SKILL.md +128 -0
- package/skills/zigrix-shared/SKILL.md +27 -3
- package/skills/zigrix-task-create/SKILL.md +8 -2
- package/skills/zigrix-task-status/SKILL.md +5 -2
- package/skills/zigrix-worker/SKILL.md +12 -4
- package/dist/dashboard/.next/static/chunks/app/page-25f54e54e74fb3af.js +0 -1
- package/rules/defaults/pro-zig.md +0 -238
- /package/dist/dashboard/.next/static/{2a4glWei05xr4Jg0Ly6cp → PT4hYxzrqxj-Zq4ZjtKNg}/_buildManifest.js +0 -0
- /package/dist/dashboard/.next/static/{2a4glWei05xr4Jg0Ly6cp → PT4hYxzrqxj-Zq4ZjtKNg}/_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,203 @@
|
|
|
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 delegation into a visible workflow with specialist routing,
|
|
9
|
+
evidence collection, and reportable finalization.
|
|
10
|
+
</p>
|
|
14
11
|
|
|
15
|
-
|
|
16
|
-
-
|
|
17
|
-
|
|
18
|
-
-
|
|
19
|
-
|
|
20
|
-
- Packaging path: **GitHub Releases + install.sh**, npm publish prepared for manual follow-up
|
|
12
|
+
<p align="center">
|
|
13
|
+
<img src="https://img.shields.io/badge/license-Apache--2.0-blue" alt="License">
|
|
14
|
+
<img src="https://img.shields.io/badge/platform-macOS%20%7C%20Linux-lightgrey" alt="Platform">
|
|
15
|
+
<img src="https://img.shields.io/badge/OpenClaw-first-6f42c1" alt="OpenClaw-first">
|
|
16
|
+
</p>
|
|
21
17
|
|
|
22
|
-
|
|
23
|
-
-
|
|
24
|
-
-
|
|
25
|
-
-
|
|
18
|
+
<p align="center">
|
|
19
|
+
<a href="#why-zigrix">Why Zigrix</a> ·
|
|
20
|
+
<a href="#is-zigrix-for-you">Is Zigrix for you?</a> ·
|
|
21
|
+
<a href="#quick-start">Quick Start</a> ·
|
|
22
|
+
<a href="#core-workflow">Core Workflow</a> ·
|
|
23
|
+
<a href="#openclaw-integration">OpenClaw Integration</a> ·
|
|
24
|
+
<a href="#dashboard--docs">Dashboard / Docs</a>
|
|
25
|
+
</p>
|
|
26
26
|
|
|
27
|
-
|
|
27
|
+
---
|
|
28
28
|
|
|
29
|
-
##
|
|
29
|
+
## Why Zigrix
|
|
30
30
|
|
|
31
|
-
|
|
32
|
-
# Install and onboard (one-time human setup)
|
|
33
|
-
./install.sh
|
|
34
|
-
zigrix onboard
|
|
31
|
+
Most agent-heavy workflows break down in the same places:
|
|
35
32
|
|
|
36
|
-
|
|
37
|
-
|
|
33
|
+
- work gets delegated, but not consistently tracked
|
|
34
|
+
- specialist routing depends on memory, not policy
|
|
35
|
+
- outputs arrive without structured evidence
|
|
36
|
+
- final reporting is manual and hard to audit
|
|
38
37
|
|
|
39
|
-
|
|
40
|
-
zigrix dashboard
|
|
41
|
-
# zigrix dashboard --port 3939
|
|
42
|
-
```
|
|
38
|
+
Zigrix gives that flow a control surface: dispatch, worker lifecycle, evidence, and finalization in one runtime.
|
|
43
39
|
|
|
44
|
-
|
|
40
|
+
---
|
|
45
41
|
|
|
46
|
-
|
|
42
|
+
## Is Zigrix for you?
|
|
47
43
|
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
44
|
+
Zigrix is a strong fit if you want:
|
|
45
|
+
|
|
46
|
+
- **one-time operator setup, then agent-driven execution**
|
|
47
|
+
- **repeatable orchestration rules** instead of ad-hoc delegation
|
|
48
|
+
- **recoverable local runtime state** for task progress and reports
|
|
49
|
+
- **OpenClaw compatibility** without requiring a plugin-based architecture
|
|
50
|
+
|
|
51
|
+
Zigrix may be a poor fit if your main goal is a hosted, multi-tenant control plane.
|
|
52
|
+
|
|
53
|
+
---
|
|
54
|
+
|
|
55
|
+
## Supported environments
|
|
56
|
+
|
|
57
|
+
- **Operating systems:** macOS, Linux
|
|
58
|
+
- **Runtime:** Node.js (current LTS recommended)
|
|
59
|
+
- **Package manager:** npm
|
|
60
|
+
- **OpenClaw:** optional, but recommended for full orchestration flow
|
|
61
|
+
|
|
62
|
+
Zigrix still works as a standalone CLI when OpenClaw is not installed.
|
|
63
|
+
|
|
64
|
+
---
|
|
51
65
|
|
|
52
|
-
|
|
66
|
+
## Quick Start
|
|
67
|
+
|
|
68
|
+
### 1) Install
|
|
53
69
|
|
|
54
70
|
```bash
|
|
55
|
-
|
|
56
|
-
node --version # confirm v22+
|
|
71
|
+
npm install -g zigrix
|
|
57
72
|
```
|
|
58
73
|
|
|
59
|
-
|
|
60
|
-
> If you switch node versions later, re-run the install to rebind:
|
|
61
|
-
> ```bash
|
|
62
|
-
> npm run build && npm link
|
|
63
|
-
> ```
|
|
74
|
+
From source:
|
|
64
75
|
|
|
65
|
-
|
|
76
|
+
```bash
|
|
77
|
+
./install.sh
|
|
78
|
+
```
|
|
66
79
|
|
|
67
|
-
|
|
80
|
+
### 2) Onboard
|
|
68
81
|
|
|
69
82
|
```bash
|
|
70
|
-
|
|
71
|
-
zigrix --version # should now match package.json
|
|
83
|
+
zigrix onboard
|
|
72
84
|
```
|
|
73
85
|
|
|
74
|
-
|
|
75
|
-
|
|
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:
|
|
86
|
+
### 3) Verify
|
|
87
|
+
|
|
95
88
|
```bash
|
|
96
|
-
zigrix
|
|
89
|
+
zigrix doctor
|
|
90
|
+
zigrix dashboard
|
|
97
91
|
```
|
|
98
92
|
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
93
|
+
That is the intended entry flow: **install → onboard → done**.
|
|
94
|
+
|
|
95
|
+
---
|
|
96
|
+
|
|
97
|
+
## Usage model: human vs agent
|
|
98
|
+
|
|
99
|
+
| Role | Primary responsibility |
|
|
100
|
+
|---|---|
|
|
101
|
+
| **Human operator** | Install Zigrix, run `zigrix onboard`, verify readiness (`zigrix doctor`), then step out of day-to-day orchestration |
|
|
102
|
+
| **OpenClaw / automation agents** | Run task/worker/evidence/report commands to execute and complete orchestration work |
|
|
103
|
+
| **Human (maintenance mode)** | Use `zigrix configure` or `zigrix reset` only when reconfiguration or recovery is needed |
|
|
104
|
+
|
|
105
|
+
This split keeps normal operation agent-driven while keeping setup and governance human-controlled.
|
|
106
|
+
|
|
107
|
+
---
|
|
108
|
+
|
|
109
|
+
## Core Workflow
|
|
110
|
+
|
|
111
|
+
Typical operational flow:
|
|
112
|
+
|
|
113
|
+
```text
|
|
114
|
+
Human setup
|
|
115
|
+
install -> zigrix onboard -> doctor check
|
|
116
|
+
|
|
117
|
+
Agent execution
|
|
118
|
+
zigrix task dispatch
|
|
119
|
+
-> worker prepare/register/complete
|
|
120
|
+
-> evidence collect/merge
|
|
121
|
+
-> task finalize + report
|
|
102
122
|
```
|
|
103
123
|
|
|
104
|
-
|
|
124
|
+
Common commands:
|
|
125
|
+
|
|
105
126
|
```bash
|
|
127
|
+
# Dispatch orchestration work
|
|
128
|
+
zigrix task dispatch --title "Implement auth module" --description "..." --scale normal --json
|
|
129
|
+
|
|
130
|
+
# Check runtime health
|
|
131
|
+
zigrix doctor
|
|
132
|
+
|
|
133
|
+
# Launch dashboard
|
|
134
|
+
zigrix dashboard --port 3838
|
|
135
|
+
|
|
136
|
+
# Maintenance surfaces
|
|
137
|
+
zigrix configure --section agents
|
|
138
|
+
zigrix configure --section skills
|
|
106
139
|
zigrix reset state --yes
|
|
107
140
|
```
|
|
108
141
|
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
142
|
+
---
|
|
143
|
+
|
|
144
|
+
## What onboard does
|
|
145
|
+
|
|
146
|
+
`zigrix onboard` prepares runtime and integration in one pass:
|
|
147
|
+
|
|
148
|
+
1. creates runtime directories from `zigrix.config.json` (`paths.*`) and default config/state structure
|
|
149
|
+
2. seeds rule files from bundled templates
|
|
150
|
+
3. ensures `zigrix` is reachable from the runtime-visible PATH
|
|
151
|
+
4. detects OpenClaw and imports agents from `openclaw.json`
|
|
152
|
+
5. registers bundled `skills/zigrix-*` into `~/.openclaw/skills/`
|
|
153
|
+
6. leaves the environment ready for agent-led orchestration
|
|
154
|
+
|
|
155
|
+
---
|
|
156
|
+
|
|
157
|
+
## OpenClaw Integration
|
|
158
|
+
|
|
159
|
+
When OpenClaw is present, Zigrix is optimized for this model:
|
|
160
|
+
|
|
161
|
+
- import agent definitions and normalize roles
|
|
162
|
+
- establish orchestrator ownership for task execution
|
|
163
|
+
- register Zigrix skill packs for agent readiness checks
|
|
164
|
+
- keep CLI reachability stable for OpenClaw runtime
|
|
165
|
+
|
|
166
|
+
Read the full integration contract in [docs/openclaw-integration.md](docs/openclaw-integration.md).
|
|
167
|
+
|
|
168
|
+
---
|
|
169
|
+
|
|
170
|
+
## Dashboard / Docs
|
|
171
|
+
|
|
172
|
+
Start dashboard:
|
|
173
|
+
|
|
174
|
+
```bash
|
|
175
|
+
zigrix dashboard --port 3838
|
|
138
176
|
```
|
|
139
177
|
|
|
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
|
|
178
|
+
Key docs:
|
|
146
179
|
|
|
147
|
-
|
|
148
|
-
-
|
|
149
|
-
-
|
|
150
|
-
-
|
|
151
|
-
-
|
|
152
|
-
-
|
|
180
|
+
- [Quickstart](docs/quickstart.md)
|
|
181
|
+
- [Install](docs/install.md)
|
|
182
|
+
- [OpenClaw Integration](docs/openclaw-integration.md)
|
|
183
|
+
- [CLI Spec](docs/cli-spec.md)
|
|
184
|
+
- [Architecture](docs/architecture.md)
|
|
185
|
+
- [Troubleshooting](docs/troubleshooting.md)
|
|
186
|
+
|
|
187
|
+
---
|
|
153
188
|
|
|
154
189
|
## Contributing
|
|
155
|
-
|
|
190
|
+
|
|
191
|
+
See [CONTRIBUTING.md](CONTRIBUTING.md).
|
|
156
192
|
|
|
157
193
|
## Support
|
|
158
|
-
|
|
194
|
+
|
|
195
|
+
See [SUPPORT.md](SUPPORT.md).
|
|
159
196
|
|
|
160
197
|
## Security
|
|
161
|
-
|
|
198
|
+
|
|
199
|
+
See [SECURITY.md](SECURITY.md).
|
|
162
200
|
|
|
163
201
|
## License
|
|
202
|
+
|
|
164
203
|
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]) {
|
|
@@ -7,6 +8,18 @@ function assertAgentExists(config, agentId) {
|
|
|
7
8
|
function unique(items) {
|
|
8
9
|
return [...new Set(items)];
|
|
9
10
|
}
|
|
11
|
+
function normalizeOrchestratorId(config) {
|
|
12
|
+
const current = config.agents.orchestration.orchestratorId;
|
|
13
|
+
if (config.agents.registry[current])
|
|
14
|
+
return;
|
|
15
|
+
const candidates = Object.entries(config.agents.registry)
|
|
16
|
+
.filter(([, agent]) => agent.role === 'orchestrator')
|
|
17
|
+
.map(([agentId]) => agentId)
|
|
18
|
+
.sort();
|
|
19
|
+
if (candidates.length > 0) {
|
|
20
|
+
config.agents.orchestration.orchestratorId = candidates[0];
|
|
21
|
+
}
|
|
22
|
+
}
|
|
10
23
|
export function listAgents(config) {
|
|
11
24
|
return Object.entries(config.agents.registry)
|
|
12
25
|
.map(([id, agent]) => ({
|
|
@@ -24,10 +37,11 @@ export function addAgent(config, params) {
|
|
|
24
37
|
if (config.agents.registry[params.id]) {
|
|
25
38
|
throw new Error(`agent already exists: ${params.id}`);
|
|
26
39
|
}
|
|
40
|
+
const normalizedRole = assertStandardAgentRole(params.role, 'agent role');
|
|
27
41
|
const next = structuredClone(config);
|
|
28
42
|
next.agents.registry[params.id] = {
|
|
29
43
|
label: params.label ?? params.id,
|
|
30
|
-
role:
|
|
44
|
+
role: normalizedRole,
|
|
31
45
|
runtime: params.runtime,
|
|
32
46
|
enabled: params.enabled ?? true,
|
|
33
47
|
metadata: {},
|
|
@@ -36,6 +50,7 @@ export function addAgent(config, params) {
|
|
|
36
50
|
next.agents.orchestration.participants = unique([...next.agents.orchestration.participants, params.id]);
|
|
37
51
|
next.agents.orchestration.excluded = next.agents.orchestration.excluded.filter((item) => item !== params.id);
|
|
38
52
|
}
|
|
53
|
+
normalizeOrchestratorId(next);
|
|
39
54
|
return {
|
|
40
55
|
config: zigrixConfigSchema.parse(next),
|
|
41
56
|
changed: true,
|
|
@@ -48,6 +63,7 @@ export function removeAgent(config, agentId) {
|
|
|
48
63
|
delete next.agents.registry[agentId];
|
|
49
64
|
next.agents.orchestration.participants = next.agents.orchestration.participants.filter((item) => item !== agentId);
|
|
50
65
|
next.agents.orchestration.excluded = next.agents.orchestration.excluded.filter((item) => item !== agentId);
|
|
66
|
+
normalizeOrchestratorId(next);
|
|
51
67
|
return {
|
|
52
68
|
config: zigrixConfigSchema.parse(next),
|
|
53
69
|
changed: true,
|
|
@@ -88,8 +104,9 @@ export function setAgentEnabled(config, agentId, enabled) {
|
|
|
88
104
|
}
|
|
89
105
|
export function setAgentRole(config, agentId, role) {
|
|
90
106
|
assertAgentExists(config, agentId);
|
|
107
|
+
const normalizedRole = assertStandardAgentRole(role, 'agent role');
|
|
91
108
|
const next = structuredClone(config);
|
|
92
|
-
next.agents.registry[agentId].role =
|
|
109
|
+
next.agents.registry[agentId].role = normalizedRole;
|
|
93
110
|
return {
|
|
94
111
|
config: zigrixConfigSchema.parse(next),
|
|
95
112
|
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
|
+
}
|
|
@@ -1,5 +1,11 @@
|
|
|
1
|
-
export declare const
|
|
2
|
-
export declare const
|
|
1
|
+
export declare const CONFIG_FILENAME = "zigrix.config.json";
|
|
2
|
+
export declare const LEGACY_DEFAULT_GATEWAY_URL = "http://127.0.0.1:18789";
|
|
3
|
+
export declare function expandTilde(input: string): string;
|
|
4
|
+
export declare function resolveAbsolutePath(input: string): string;
|
|
5
|
+
export declare function resolveCanonicalConfigHome(): string;
|
|
6
|
+
export declare function resolveCanonicalConfigPath(): string;
|
|
7
|
+
export declare function resolveDefaultWorkspaceDir(baseDir?: string): string;
|
|
8
|
+
export declare function buildDefaultConfig(baseDir?: string): {
|
|
3
9
|
readonly paths: {
|
|
4
10
|
readonly baseDir: string;
|
|
5
11
|
readonly tasksDir: string;
|
|
@@ -11,13 +17,14 @@ export declare const defaultConfig: {
|
|
|
11
17
|
readonly rulesDir: string;
|
|
12
18
|
};
|
|
13
19
|
readonly workspace: {
|
|
14
|
-
readonly projectsBaseDir:
|
|
20
|
+
readonly projectsBaseDir: string;
|
|
15
21
|
};
|
|
16
22
|
readonly agents: {
|
|
17
23
|
readonly registry: {};
|
|
18
24
|
readonly orchestration: {
|
|
19
25
|
readonly participants: readonly [];
|
|
20
26
|
readonly excluded: readonly [];
|
|
27
|
+
readonly orchestratorId: "orchestrator";
|
|
21
28
|
};
|
|
22
29
|
};
|
|
23
30
|
readonly rules: {
|
|
@@ -32,7 +39,7 @@ export declare const defaultConfig: {
|
|
|
32
39
|
};
|
|
33
40
|
readonly risky: {
|
|
34
41
|
readonly requiredRoles: readonly ["orchestrator", "qa", "security"];
|
|
35
|
-
readonly optionalRoles: readonly ["frontend", "backend", "
|
|
42
|
+
readonly optionalRoles: readonly ["frontend", "backend", "system"];
|
|
36
43
|
};
|
|
37
44
|
};
|
|
38
45
|
readonly completion: {
|
|
@@ -46,10 +53,80 @@ export declare const defaultConfig: {
|
|
|
46
53
|
};
|
|
47
54
|
readonly templates: {
|
|
48
55
|
readonly workerPrompt: {
|
|
56
|
+
readonly format: "markdown";
|
|
57
|
+
readonly version: 2;
|
|
58
|
+
readonly placeholders: readonly ["taskId", "title", "scale", "agentId", "description"];
|
|
59
|
+
readonly body: "## Worker Assignment: {{taskId}}\n- title: {{title}}\n- scale: {{scale}}\n- agent: {{agentId}}\n- description: {{description}}\n\n### Completion\n작업 완료 후 반드시 증적을 먼저 수집하라:\n```bash\nzigrix evidence collect --task-id {{taskId}} --agent-id {{agentId}} --summary \"<결과 요약>\"\n```\n⚠️ 증적 없이 완료하면 finalize에서 incomplete 판정된다.";
|
|
60
|
+
};
|
|
61
|
+
readonly finalReport: {
|
|
49
62
|
readonly format: "markdown";
|
|
50
63
|
readonly version: 1;
|
|
64
|
+
readonly placeholders: readonly ["taskId", "title", "status", "summary"];
|
|
65
|
+
readonly body: "## Final Report: {{taskId}}\n- title: {{title}}\n- status: {{status}}\n- summary: {{summary}}";
|
|
66
|
+
};
|
|
67
|
+
};
|
|
68
|
+
readonly openclaw: {
|
|
69
|
+
readonly home: "";
|
|
70
|
+
readonly binPath: null;
|
|
71
|
+
readonly gatewayUrl: "";
|
|
72
|
+
};
|
|
73
|
+
readonly runtime: {
|
|
74
|
+
readonly outputMode: "text";
|
|
75
|
+
readonly jsonIndent: 2;
|
|
76
|
+
};
|
|
77
|
+
};
|
|
78
|
+
export declare const defaultConfig: {
|
|
79
|
+
readonly paths: {
|
|
80
|
+
readonly baseDir: string;
|
|
81
|
+
readonly tasksDir: string;
|
|
82
|
+
readonly evidenceDir: string;
|
|
83
|
+
readonly promptsDir: string;
|
|
84
|
+
readonly eventsFile: string;
|
|
85
|
+
readonly indexFile: string;
|
|
86
|
+
readonly runsDir: string;
|
|
87
|
+
readonly rulesDir: string;
|
|
88
|
+
};
|
|
89
|
+
readonly workspace: {
|
|
90
|
+
readonly projectsBaseDir: string;
|
|
91
|
+
};
|
|
92
|
+
readonly agents: {
|
|
93
|
+
readonly registry: {};
|
|
94
|
+
readonly orchestration: {
|
|
95
|
+
readonly participants: readonly [];
|
|
96
|
+
readonly excluded: readonly [];
|
|
97
|
+
readonly orchestratorId: "orchestrator";
|
|
98
|
+
};
|
|
99
|
+
};
|
|
100
|
+
readonly rules: {
|
|
101
|
+
readonly scales: {
|
|
102
|
+
readonly simple: {
|
|
103
|
+
readonly requiredRoles: readonly ["orchestrator"];
|
|
104
|
+
readonly optionalRoles: readonly ["qa"];
|
|
105
|
+
};
|
|
106
|
+
readonly normal: {
|
|
107
|
+
readonly requiredRoles: readonly ["orchestrator", "qa"];
|
|
108
|
+
readonly optionalRoles: readonly ["frontend", "backend"];
|
|
109
|
+
};
|
|
110
|
+
readonly risky: {
|
|
111
|
+
readonly requiredRoles: readonly ["orchestrator", "qa", "security"];
|
|
112
|
+
readonly optionalRoles: readonly ["frontend", "backend", "system"];
|
|
113
|
+
};
|
|
114
|
+
};
|
|
115
|
+
readonly completion: {
|
|
116
|
+
readonly requireQa: true;
|
|
117
|
+
readonly requireEvidence: true;
|
|
118
|
+
readonly requireUserReport: true;
|
|
119
|
+
};
|
|
120
|
+
readonly stale: {
|
|
121
|
+
readonly defaultHours: 24;
|
|
122
|
+
};
|
|
123
|
+
};
|
|
124
|
+
readonly templates: {
|
|
125
|
+
readonly workerPrompt: {
|
|
126
|
+
readonly format: "markdown";
|
|
127
|
+
readonly version: 2;
|
|
51
128
|
readonly placeholders: readonly ["taskId", "title", "scale", "agentId", "description"];
|
|
52
|
-
readonly body: "## Worker Assignment: {{taskId}}\n- title: {{title}}\n- scale: {{scale}}\n- agent: {{agentId}}\n- description: {{description}}";
|
|
129
|
+
readonly body: "## Worker Assignment: {{taskId}}\n- title: {{title}}\n- scale: {{scale}}\n- agent: {{agentId}}\n- description: {{description}}\n\n### Completion\n작업 완료 후 반드시 증적을 먼저 수집하라:\n```bash\nzigrix evidence collect --task-id {{taskId}} --agent-id {{agentId}} --summary \"<결과 요약>\"\n```\n⚠️ 증적 없이 완료하면 finalize에서 incomplete 판정된다.";
|
|
53
130
|
};
|
|
54
131
|
readonly finalReport: {
|
|
55
132
|
readonly format: "markdown";
|
|
@@ -58,9 +135,14 @@ export declare const defaultConfig: {
|
|
|
58
135
|
readonly body: "## Final Report: {{taskId}}\n- title: {{title}}\n- status: {{status}}\n- summary: {{summary}}";
|
|
59
136
|
};
|
|
60
137
|
};
|
|
138
|
+
readonly openclaw: {
|
|
139
|
+
readonly home: "";
|
|
140
|
+
readonly binPath: null;
|
|
141
|
+
readonly gatewayUrl: "";
|
|
142
|
+
};
|
|
61
143
|
readonly runtime: {
|
|
62
144
|
readonly outputMode: "text";
|
|
63
145
|
readonly jsonIndent: 2;
|
|
64
146
|
};
|
|
65
147
|
};
|
|
66
|
-
export type DefaultConfig = typeof
|
|
148
|
+
export type DefaultConfig = ReturnType<typeof buildDefaultConfig>;
|