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.
Files changed (51) 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 +10 -10
  14. package/dist/dashboard/.next/app-path-routes-manifest.json +4 -4
  15. package/dist/dashboard/.next/build-manifest.json +2 -2
  16. package/dist/dashboard/.next/server/app/_not-found.html +1 -1
  17. package/dist/dashboard/.next/server/app/_not-found.rsc +1 -1
  18. package/dist/dashboard/.next/server/app/api/auth/login/route.js +1 -1
  19. package/dist/dashboard/.next/server/app/api/auth/logout/route.js +1 -1
  20. package/dist/dashboard/.next/server/app/api/auth/session/route.js +1 -1
  21. package/dist/dashboard/.next/server/app/api/auth/setup/route.js +1 -1
  22. package/dist/dashboard/.next/server/app/api/overview/route.js +1 -1
  23. package/dist/dashboard/.next/server/app/api/stream/route.js +1 -1
  24. package/dist/dashboard/.next/server/app/api/tasks/[taskId]/cancel/route.js +1 -1
  25. package/dist/dashboard/.next/server/app/api/tasks/[taskId]/conversation/route.js +1 -1
  26. package/dist/dashboard/.next/server/app/api/tasks/[taskId]/route.js +1 -1
  27. package/dist/dashboard/.next/server/app/login.html +1 -1
  28. package/dist/dashboard/.next/server/app/login.rsc +1 -1
  29. package/dist/dashboard/.next/server/app/setup.html +1 -1
  30. package/dist/dashboard/.next/server/app/setup.rsc +1 -1
  31. package/dist/dashboard/.next/server/app-paths-manifest.json +4 -4
  32. package/dist/dashboard/.next/server/functions-config-manifest.json +3 -3
  33. package/dist/dashboard/.next/server/middleware.js +1 -1
  34. package/dist/dashboard/.next/server/pages/404.html +1 -1
  35. package/dist/dashboard/.next/server/pages/500.html +1 -1
  36. package/dist/index.js +5 -1
  37. package/dist/onboard.d.ts +16 -2
  38. package/dist/onboard.js +128 -9
  39. package/dist/orchestration/dispatch.d.ts +2 -1
  40. package/dist/orchestration/dispatch.js +157 -41
  41. package/dist/orchestration/evidence.js +17 -3
  42. package/dist/orchestration/finalize.js +2 -2
  43. package/dist/orchestration/report.js +6 -1
  44. package/dist/orchestration/worker.d.ts +1 -1
  45. package/dist/orchestration/worker.js +17 -2
  46. package/dist/rules/templates.js +3 -6
  47. package/dist/state/tasks.d.ts +7 -0
  48. package/package.json +1 -1
  49. package/skills/zigrix-main-agent-guide/SKILL.md +118 -0
  50. /package/dist/dashboard/.next/static/{afoa9JVywKLyR6X4Cxspl → TlUj0t8APzTccK13DVZZW}/_buildManifest.js +0 -0
  51. /package/dist/dashboard/.next/static/{afoa9JVywKLyR6X4Cxspl → TlUj0t8APzTccK13DVZZW}/_ssgManifest.js +0 -0
@@ -3,7 +3,22 @@ import path from 'node:path';
3
3
  import { appendEvent } from '../state/events.js';
4
4
  import { ensureBaseState } from '../state/paths.js';
5
5
  import { loadTask, saveTask } from '../state/tasks.js';
6
- export const DEFAULT_REQUIRED_AGENTS = ['pro-zig', 'qa-zig'];
6
+ export const DEFAULT_REQUIRED_AGENTS = ['orchestrator', 'qa'];
7
+ const DEFAULT_ORCHESTRATOR_ID = 'pro-zig';
8
+ const DEFAULT_QA_AGENT_ID = 'qa-zig';
9
+ function resolveDefaultRequiredAgents(task) {
10
+ const orchestratorId = typeof task.orchestratorId === 'string' && task.orchestratorId.trim().length > 0
11
+ ? task.orchestratorId
12
+ : DEFAULT_ORCHESTRATOR_ID;
13
+ const qaAgentId = typeof task.qaAgentId === 'string' && task.qaAgentId.trim().length > 0
14
+ ? task.qaAgentId
15
+ : DEFAULT_QA_AGENT_ID;
16
+ const resolvedByRole = {
17
+ orchestrator: orchestratorId,
18
+ qa: qaAgentId,
19
+ };
20
+ return [...new Set(DEFAULT_REQUIRED_AGENTS.map((role) => resolvedByRole[role]))];
21
+ }
7
22
  export function resolveRequiredAgents(task) {
8
23
  for (const key of ['requiredAgents', 'selectedAgents', 'baselineRequiredAgents']) {
9
24
  const value = task[key];
@@ -15,7 +30,7 @@ export function resolveRequiredAgents(task) {
15
30
  if (workers && typeof workers === 'object' && Object.keys(workers).length > 0) {
16
31
  return Object.keys(workers).sort();
17
32
  }
18
- return [...DEFAULT_REQUIRED_AGENTS];
33
+ return resolveDefaultRequiredAgents(task);
19
34
  }
20
35
  function renderPrompt(params) {
21
36
  const sections = [
@@ -1,3 +1,4 @@
1
+ import { STANDARD_AGENT_ROLES } from '../agents/roles.js';
1
2
  export const TEMPLATE_PLACEHOLDERS = {
2
3
  workerPrompt: ['taskId', 'title', 'scale', 'agentId', 'description', 'constraints', 'requiredRoles', 'workPackage', 'unitId'],
3
4
  finalReport: ['taskId', 'title', 'scale', 'status', 'summary', 'missingAgents'],
@@ -36,12 +37,8 @@ export function validateTemplate(kind, body) {
36
37
  }
37
38
  export function validateRules(config) {
38
39
  const knownRoles = new Set(Object.values(config.agents.registry).map((agent) => agent.role));
39
- knownRoles.add('orchestrator');
40
- knownRoles.add('qa');
41
- knownRoles.add('frontend');
42
- knownRoles.add('backend');
43
- knownRoles.add('security');
44
- knownRoles.add('infra');
40
+ for (const role of STANDARD_AGENT_ROLES)
41
+ knownRoles.add(role);
45
42
  const invalidRoles = new Set();
46
43
  for (const scale of Object.values(config.rules.scales)) {
47
44
  for (const role of [...scale.requiredRoles, ...scale.optionalRoles]) {
@@ -31,6 +31,13 @@ export type ZigrixTask = {
31
31
  selectedAgents?: string[];
32
32
  workPackages?: WorkPackage[];
33
33
  executionUnits?: ExecutionUnit[];
34
+ baselineRequiredAgents?: string[];
35
+ candidateAgents?: string[];
36
+ requiredRoles?: string[];
37
+ optionalRoles?: string[];
38
+ roleAgentMap?: Record<string, string[]>;
39
+ orchestratorId?: string;
40
+ qaAgentId?: string;
34
41
  orchestratorSessionKey?: string;
35
42
  orchestratorSessionId?: string;
36
43
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "zigrix",
3
- "version": "0.1.0-alpha.7",
3
+ "version": "0.1.0-alpha.9",
4
4
  "type": "module",
5
5
  "description": "Multi-project parallel task orchestration CLI for agent-assisted development",
6
6
  "license": "Apache-2.0",
@@ -0,0 +1,118 @@
1
+ ---
2
+ name: zigrix-main-agent-guide
3
+ version: 0.1.0
4
+ description: Main-agent guide for using Zigrix CLI (task issuance, orchestrator spawn, dashboard, and Python-script-to-CLI migration).
5
+ metadata:
6
+ openclaw:
7
+ requires:
8
+ bins: ["zigrix"]
9
+ ---
10
+
11
+ # Zigrix Main Agent Guide
12
+
13
+ 메인 에이전트가 Zigrix를 사용할 때의 표준 흐름.
14
+
15
+ ## 1) 기본 명령
16
+
17
+ ```bash
18
+ # 초기 설정
19
+ zigrix onboard --yes --json
20
+
21
+ # 환경/설정 점검
22
+ zigrix doctor
23
+ zigrix config validate --json
24
+ zigrix agent list --json
25
+
26
+ # 대시보드 실행
27
+ zigrix dashboard --port 5173
28
+ ```
29
+
30
+ ## 2) 태스크 발급 흐름 (권장)
31
+
32
+ `task create`보다 `task dispatch`를 우선 사용한다.
33
+
34
+ ```bash
35
+ zigrix task dispatch \
36
+ --title "Implement X" \
37
+ --description "..." \
38
+ --scale normal \
39
+ --project-dir /path/to/project \
40
+ --json
41
+ ```
42
+
43
+ 디스패치 결과에서 확인할 핵심 필드:
44
+ - `taskId`
45
+ - `orchestratorId`
46
+ - `qaAgentId`
47
+ - `baselineRequiredAgents`
48
+ - `candidateAgents`
49
+ - `orchestratorPrompt` (`proZigPrompt` 호환 별칭 포함)
50
+
51
+ ## 3) 오케스트레이터 spawn 패턴
52
+
53
+ 디스패치 응답의 `orchestratorPrompt`를 오케스트레이터 에이전트에게 전달한다.
54
+
55
+ ```text
56
+ sessions_spawn(
57
+ agentId: <orchestratorId>,
58
+ task: <dispatchResult.orchestratorPrompt>
59
+ )
60
+ ```
61
+
62
+ 오케스트레이터는 이후 워커를 `zigrix worker prepare/register/complete` 체인으로 관리한다.
63
+
64
+ ## 4) 워커/검증/최종 보고 체인
65
+
66
+ ```bash
67
+ # 워커 준비
68
+ zigrix worker prepare --task-id <taskId> --agent-id <agentId> --description "..." --json
69
+
70
+ # 워커 세션 등록
71
+ zigrix worker register --task-id <taskId> --agent-id <agentId> --session-key <sessionKey> --run-id <runId> --json
72
+
73
+ # 워커 완료
74
+ zigrix worker complete --task-id <taskId> --agent-id <agentId> --session-key <sessionKey> --run-id <runId> --json
75
+
76
+ # evidence 수집/머지
77
+ zigrix evidence collect --task-id <taskId> --agent-id <agentId> --summary "..." --json
78
+ zigrix evidence merge --task-id <taskId> --require-qa --json
79
+
80
+ # 최종화
81
+ zigrix task finalize <taskId> --auto-report --json
82
+ ```
83
+
84
+ ## 5) 대시보드 사용 포인트
85
+
86
+ 대시보드에서 확인:
87
+ - Task 상태 (OPEN → IN_PROGRESS → REPORTED)
88
+ - 워커 세션 매핑
89
+ - 이벤트 로그
90
+ - Conversation/증적 추적
91
+
92
+ 문제 상황 디버깅 순서:
93
+ 1. `zigrix task status <taskId> --json`
94
+ 2. `zigrix task events <taskId> --json`
95
+ 3. `zigrix evidence merge --task-id <taskId> --require-qa --json`
96
+
97
+ ## 6) Python 스크립트 체인 → Zigrix CLI 전환 가이드
98
+
99
+ 기존(레거시 Python):
100
+ - `dev_dispatch.py`
101
+ - `dev_start.py`
102
+ - `orch_prepare_worker.py`
103
+ - `orch_register_worker.py`
104
+ - `orch_complete_worker.py`
105
+ - `dev_finalize.py`
106
+
107
+ 신규(권장 Zigrix CLI):
108
+ - `zigrix task dispatch`
109
+ - `zigrix task start`
110
+ - `zigrix worker prepare`
111
+ - `zigrix worker register`
112
+ - `zigrix worker complete`
113
+ - `zigrix task finalize`
114
+
115
+ 전환 원칙:
116
+ - 신규 자동화는 CLI 우선
117
+ - Python 스크립트는 호환/과도기용
118
+ - JSON 출력(`--json`)을 기본으로 파이프라인에서 파싱