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.
Files changed (86) hide show
  1. package/LICENSE +1 -1
  2. package/README.md +159 -120
  3. package/dist/agents/registry.js +19 -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 +88 -6
  7. package/dist/config/defaults.js +82 -50
  8. package/dist/config/load.d.ts +5 -3
  9. package/dist/config/load.js +69 -30
  10. package/dist/config/schema.d.ts +46 -4
  11. package/dist/config/schema.js +49 -3
  12. package/dist/configure.d.ts +2 -0
  13. package/dist/configure.js +37 -14
  14. package/dist/dashboard/.next/BUILD_ID +1 -1
  15. package/dist/dashboard/.next/app-build-manifest.json +13 -13
  16. package/dist/dashboard/.next/app-path-routes-manifest.json +3 -3
  17. package/dist/dashboard/.next/build-manifest.json +2 -2
  18. package/dist/dashboard/.next/prerender-manifest.json +6 -6
  19. package/dist/dashboard/.next/server/app/_not-found/page_client-reference-manifest.js +1 -1
  20. package/dist/dashboard/.next/server/app/_not-found.html +1 -1
  21. package/dist/dashboard/.next/server/app/_not-found.rsc +1 -1
  22. package/dist/dashboard/.next/server/app/api/auth/login/route.js +1 -1
  23. package/dist/dashboard/.next/server/app/api/auth/login/route_client-reference-manifest.js +1 -1
  24. package/dist/dashboard/.next/server/app/api/auth/logout/route.js +1 -1
  25. package/dist/dashboard/.next/server/app/api/auth/logout/route_client-reference-manifest.js +1 -1
  26. package/dist/dashboard/.next/server/app/api/auth/session/route.js +1 -1
  27. package/dist/dashboard/.next/server/app/api/auth/session/route_client-reference-manifest.js +1 -1
  28. package/dist/dashboard/.next/server/app/api/auth/setup/route.js +1 -1
  29. package/dist/dashboard/.next/server/app/api/auth/setup/route_client-reference-manifest.js +1 -1
  30. package/dist/dashboard/.next/server/app/api/overview/route_client-reference-manifest.js +1 -1
  31. package/dist/dashboard/.next/server/app/api/stream/route_client-reference-manifest.js +1 -1
  32. package/dist/dashboard/.next/server/app/api/tasks/[taskId]/cancel/route_client-reference-manifest.js +1 -1
  33. package/dist/dashboard/.next/server/app/api/tasks/[taskId]/conversation/route_client-reference-manifest.js +1 -1
  34. package/dist/dashboard/.next/server/app/api/tasks/[taskId]/route_client-reference-manifest.js +1 -1
  35. package/dist/dashboard/.next/server/app/login/page_client-reference-manifest.js +1 -1
  36. package/dist/dashboard/.next/server/app/login.html +1 -1
  37. package/dist/dashboard/.next/server/app/login.rsc +1 -1
  38. package/dist/dashboard/.next/server/app/page.js +2 -2
  39. package/dist/dashboard/.next/server/app/page_client-reference-manifest.js +1 -1
  40. package/dist/dashboard/.next/server/app/setup/page_client-reference-manifest.js +1 -1
  41. package/dist/dashboard/.next/server/app/setup.html +1 -1
  42. package/dist/dashboard/.next/server/app/setup.rsc +1 -1
  43. package/dist/dashboard/.next/server/app-paths-manifest.json +3 -3
  44. package/dist/dashboard/.next/server/chunks/972.js +1 -1
  45. package/dist/dashboard/.next/server/functions-config-manifest.json +3 -3
  46. package/dist/dashboard/.next/server/middleware.js +1 -1
  47. package/dist/dashboard/.next/server/pages/404.html +1 -1
  48. package/dist/dashboard/.next/server/pages/500.html +1 -1
  49. package/dist/dashboard/.next/static/chunks/app/page-0314989c31e18b4b.js +1 -0
  50. package/dist/dashboard/.next/static/css/{94d75aff24d0c077.css → c3a7306cb2ba3f6c.css} +1 -1
  51. package/dist/dashboard.js +47 -0
  52. package/dist/doctor.js +28 -5
  53. package/dist/index.js +175 -171
  54. package/dist/onboard.d.ts +76 -2
  55. package/dist/onboard.js +529 -25
  56. package/dist/orchestration/dispatch.d.ts +3 -1
  57. package/dist/orchestration/dispatch.js +173 -45
  58. package/dist/orchestration/evidence.js +31 -4
  59. package/dist/orchestration/finalize.d.ts +1 -0
  60. package/dist/orchestration/finalize.js +5 -3
  61. package/dist/orchestration/report.js +9 -1
  62. package/dist/orchestration/worker.d.ts +1 -1
  63. package/dist/orchestration/worker.js +58 -8
  64. package/dist/rules/templates.js +3 -6
  65. package/dist/state/tasks.d.ts +12 -0
  66. package/dist/state/tasks.js +7 -0
  67. package/package.json +23 -2
  68. package/rules/defaults/README.md +9 -9
  69. package/rules/defaults/{back-zig.md → backend-agent.md} +4 -4
  70. package/rules/defaults/{front-zig.md → frontend-agent.md} +4 -4
  71. package/rules/defaults/orchestrator-agent.md +261 -0
  72. package/rules/defaults/{qa-zig.md → qa-agent.md} +11 -11
  73. package/rules/defaults/{sec-zig.md → security-agent.md} +4 -4
  74. package/rules/defaults/{sys-zig.md → system-agent.md} +8 -9
  75. package/rules/defaults/worker-common.md +25 -19
  76. package/skills/zigrix-doctor/SKILL.md +4 -2
  77. package/skills/zigrix-evidence/SKILL.md +7 -3
  78. package/skills/zigrix-main-agent-guide/SKILL.md +128 -0
  79. package/skills/zigrix-shared/SKILL.md +27 -3
  80. package/skills/zigrix-task-create/SKILL.md +8 -2
  81. package/skills/zigrix-task-status/SKILL.md +5 -2
  82. package/skills/zigrix-worker/SKILL.md +12 -4
  83. package/dist/dashboard/.next/static/chunks/app/page-25f54e54e74fb3af.js +0 -1
  84. package/rules/defaults/pro-zig.md +0 -238
  85. /package/dist/dashboard/.next/static/{2a4glWei05xr4Jg0Ly6cp → PT4hYxzrqxj-Zq4ZjtKNg}/_buildManifest.js +0 -0
  86. /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 [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,203 @@
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 delegation into a visible workflow with specialist routing,
9
+ evidence collection, and reportable finalization.
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
+ <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
- ## 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.
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
- See `docs/onboarding-ownership-model.md` for the product-direction source of truth.
27
+ ---
28
28
 
29
- ## Quick start
29
+ ## Why Zigrix
30
30
 
31
- ```bash
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
- # Verify readiness
37
- zigrix doctor
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
- # Launch dashboard (foreground, Ctrl+C to stop)
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
- ### Prerequisites: Node.js version
40
+ ---
45
41
 
46
- Zigrix requires Node.js **22 or later**. Verify before installing:
42
+ ## Is Zigrix for you?
47
43
 
48
- ```bash
49
- node --version # must be v22.x or higher
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
- If you use **nvm**, make sure the correct version is active:
66
+ ## Quick Start
67
+
68
+ ### 1) Install
53
69
 
54
70
  ```bash
55
- nvm use 22 # or: nvm use --lts
56
- node --version # confirm v22+
71
+ npm install -g zigrix
57
72
  ```
58
73
 
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
- > ```
74
+ From source:
64
75
 
65
- ### Version mismatch troubleshooting
76
+ ```bash
77
+ ./install.sh
78
+ ```
66
79
 
67
- If `zigrix --version` shows an unexpected version after updating, rebuild and relink:
80
+ ### 2) Onboard
68
81
 
69
82
  ```bash
70
- npm run build && npm link
71
- zigrix --version # should now match package.json
83
+ zigrix onboard
72
84
  ```
73
85
 
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:
86
+ ### 3) Verify
87
+
95
88
  ```bash
96
- zigrix template reset workerPrompt --yes
89
+ zigrix doctor
90
+ zigrix dashboard
97
91
  ```
98
92
 
99
- Reset all config back to defaults:
100
- ```bash
101
- zigrix reset config --yes
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
- Reset runtime state only:
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
- ## 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
128
- ```text
129
- zigrix/
130
- ├─ src/ # Node/TS main implementation
131
- ├─ tests/ # test coverage
132
- ├─ skills/ # OpenClaw skill packs
133
- ├─ examples/ # example workflows
134
- ├─ scripts/ # smoke / release helpers
135
- ├─ docs/ # product + architecture docs
136
- ├─ legacy-python/ # reference prototype only
137
- └─ .github/ # CI + issue/PR templates
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
- ## 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
178
+ Key docs:
146
179
 
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
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
- See `CONTRIBUTING.md`.
190
+
191
+ See [CONTRIBUTING.md](CONTRIBUTING.md).
156
192
 
157
193
  ## Support
158
- See `SUPPORT.md`.
194
+
195
+ See [SUPPORT.md](SUPPORT.md).
159
196
 
160
197
  ## Security
161
- See `SECURITY.md`.
198
+
199
+ See [SECURITY.md](SECURITY.md).
162
200
 
163
201
  ## License
202
+
164
203
  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]) {
@@ -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: params.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 = 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 ZIGRIX_HOME: string;
2
- export declare const defaultConfig: {
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", "infra"];
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 defaultConfig;
148
+ export type DefaultConfig = ReturnType<typeof buildDefaultConfig>;