zigrix 0.1.0-alpha.10 → 0.1.0-alpha.11

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 (40) hide show
  1. package/dist/configure.d.ts +1 -0
  2. package/dist/configure.js +14 -1
  3. package/dist/dashboard/.next/BUILD_ID +1 -1
  4. package/dist/dashboard/.next/app-build-manifest.json +17 -17
  5. package/dist/dashboard/.next/app-path-routes-manifest.json +4 -4
  6. package/dist/dashboard/.next/build-manifest.json +2 -2
  7. package/dist/dashboard/.next/prerender-manifest.json +6 -6
  8. package/dist/dashboard/.next/server/app/_not-found/page_client-reference-manifest.js +1 -1
  9. package/dist/dashboard/.next/server/app/_not-found.html +1 -1
  10. package/dist/dashboard/.next/server/app/_not-found.rsc +1 -1
  11. package/dist/dashboard/.next/server/app/api/auth/login/route_client-reference-manifest.js +1 -1
  12. package/dist/dashboard/.next/server/app/api/auth/logout/route_client-reference-manifest.js +1 -1
  13. package/dist/dashboard/.next/server/app/api/auth/session/route_client-reference-manifest.js +1 -1
  14. package/dist/dashboard/.next/server/app/api/auth/setup/route_client-reference-manifest.js +1 -1
  15. package/dist/dashboard/.next/server/app/api/overview/route_client-reference-manifest.js +1 -1
  16. package/dist/dashboard/.next/server/app/api/stream/route_client-reference-manifest.js +1 -1
  17. package/dist/dashboard/.next/server/app/api/tasks/[taskId]/cancel/route_client-reference-manifest.js +1 -1
  18. package/dist/dashboard/.next/server/app/api/tasks/[taskId]/conversation/route_client-reference-manifest.js +1 -1
  19. package/dist/dashboard/.next/server/app/api/tasks/[taskId]/route_client-reference-manifest.js +1 -1
  20. package/dist/dashboard/.next/server/app/login/page_client-reference-manifest.js +1 -1
  21. package/dist/dashboard/.next/server/app/login.html +1 -1
  22. package/dist/dashboard/.next/server/app/login.rsc +1 -1
  23. package/dist/dashboard/.next/server/app/page.js +1 -1
  24. package/dist/dashboard/.next/server/app/page_client-reference-manifest.js +1 -1
  25. package/dist/dashboard/.next/server/app/setup/page_client-reference-manifest.js +1 -1
  26. package/dist/dashboard/.next/server/app/setup.html +1 -1
  27. package/dist/dashboard/.next/server/app/setup.rsc +1 -1
  28. package/dist/dashboard/.next/server/app-paths-manifest.json +4 -4
  29. package/dist/dashboard/.next/server/functions-config-manifest.json +3 -3
  30. package/dist/dashboard/.next/server/pages/404.html +1 -1
  31. package/dist/dashboard/.next/server/pages/500.html +1 -1
  32. package/dist/dashboard/.next/static/chunks/app/{page-25f54e54e74fb3af.js → page-23f9176364af6d64.js} +1 -1
  33. package/dist/doctor.js +24 -1
  34. package/dist/onboard.d.ts +18 -0
  35. package/dist/onboard.js +133 -1
  36. package/package.json +2 -2
  37. package/rules/defaults/pro-zig.md +1 -1
  38. package/rules/defaults/worker-common.md +1 -1
  39. /package/dist/dashboard/.next/static/{DgtFk85938G89Sfc7dxRP → AzCYYgjxkCO7RQ7KmraXN}/_buildManifest.js +0 -0
  40. /package/dist/dashboard/.next/static/{DgtFk85938G89Sfc7dxRP → AzCYYgjxkCO7RQ7KmraXN}/_ssgManifest.js +0 -0
package/dist/onboard.js CHANGED
@@ -382,6 +382,121 @@ export function ensureZigrixInPath(opts) {
382
382
  : `Created zigrix at ${symlinkPath}, but ${userBinDir} is not in your PATH. Add it:\n export PATH="${userBinDir}:$PATH"`;
383
383
  return { alreadyInPath: false, symlinkCreated: true, symlinkPath, warning };
384
384
  }
385
+ // ─── OpenClaw PATH check and stabilization ────────────────────────────────────
386
+ export function checkOpenClawInPath(opts) {
387
+ const dirs = opts?._overrideStablePaths ?? STABLE_SHELL_PATHS;
388
+ for (const dir of dirs) {
389
+ try {
390
+ if (!fs.existsSync(dir))
391
+ continue;
392
+ const entries = fs.readdirSync(dir);
393
+ if (entries.includes('openclaw')) {
394
+ return true;
395
+ }
396
+ }
397
+ catch {
398
+ // skip unreadable dirs
399
+ }
400
+ }
401
+ return false;
402
+ }
403
+ /**
404
+ * Ensure openclaw is reachable from PATH.
405
+ * Same strategy as ensureZigrixInPath():
406
+ * 1. /usr/local/bin — stable path, accessible from non-login shells
407
+ * 2. ~/.local/bin — user-local fallback
408
+ *
409
+ * @param opts._overrideSystemBinDir - Override system bin dir selection (for testing)
410
+ * @param opts._overrideStablePaths - Override stable paths list (for testing)
411
+ */
412
+ export function ensureOpenClawInPath(opts) {
413
+ if (checkOpenClawInPath({ _overrideStablePaths: opts?._overrideStablePaths })) {
414
+ return { alreadyInPath: true, symlinkCreated: false, symlinkPath: null, warning: null };
415
+ }
416
+ const binPath = resolveOpenClawBin();
417
+ if (!binPath) {
418
+ return {
419
+ alreadyInPath: false,
420
+ symlinkCreated: false,
421
+ symlinkPath: null,
422
+ warning: 'Could not locate openclaw binary. Ensure openclaw is installed via npm.',
423
+ };
424
+ }
425
+ // ── Strategy 1: system bin dir (accessible from non-login shells) ──────────
426
+ const systemBinDir = opts !== undefined && '_overrideSystemBinDir' in opts
427
+ ? opts._overrideSystemBinDir
428
+ : findSystemBinDir();
429
+ if (systemBinDir) {
430
+ const symlinkPath = path.join(systemBinDir, 'openclaw');
431
+ try {
432
+ // Remove stale entry if present
433
+ try {
434
+ if (fs.existsSync(symlinkPath) || fs.lstatSync(symlinkPath).isSymbolicLink()) {
435
+ fs.unlinkSync(symlinkPath);
436
+ }
437
+ }
438
+ catch {
439
+ // doesn't exist — fine
440
+ }
441
+ fs.symlinkSync(binPath, symlinkPath);
442
+ fs.chmodSync(symlinkPath, 0o755);
443
+ return { alreadyInPath: false, symlinkCreated: true, symlinkPath, warning: null };
444
+ }
445
+ catch (e) {
446
+ if (e.code === 'EACCES') {
447
+ return {
448
+ alreadyInPath: false,
449
+ symlinkCreated: false,
450
+ symlinkPath: null,
451
+ warning: `Cannot write to ${systemBinDir} (permission denied). Run:\n sudo ln -sfn ${binPath} ${symlinkPath}`,
452
+ };
453
+ }
454
+ // Fall through to user bin dir
455
+ }
456
+ }
457
+ // ── Strategy 2: user-local bin dir ────────────────────────────────────────
458
+ const userBinDir = findUserBinDir();
459
+ try {
460
+ fs.mkdirSync(userBinDir, { recursive: true });
461
+ }
462
+ catch {
463
+ return {
464
+ alreadyInPath: false,
465
+ symlinkCreated: false,
466
+ symlinkPath: null,
467
+ warning: `Could not create ${userBinDir}. Create it manually and add to PATH.`,
468
+ };
469
+ }
470
+ const symlinkPath = path.join(userBinDir, 'openclaw');
471
+ try {
472
+ // Remove existing if present (stale symlink)
473
+ if (fs.existsSync(symlinkPath) || fs.lstatSync(symlinkPath).isSymbolicLink()) {
474
+ fs.unlinkSync(symlinkPath);
475
+ }
476
+ }
477
+ catch {
478
+ // doesn't exist, fine
479
+ }
480
+ try {
481
+ fs.symlinkSync(binPath, symlinkPath);
482
+ fs.chmodSync(symlinkPath, 0o755);
483
+ }
484
+ catch (e) {
485
+ return {
486
+ alreadyInPath: false,
487
+ symlinkCreated: false,
488
+ symlinkPath: null,
489
+ warning: `Failed to create symlink at ${symlinkPath}: ${e instanceof Error ? e.message : String(e)}`,
490
+ };
491
+ }
492
+ // Check if userBinDir is actually in PATH
493
+ const pathEnv = process.env.PATH ?? '';
494
+ const inPath = pathEnv.split(path.delimiter).some((d) => path.resolve(d) === path.resolve(userBinDir));
495
+ const warning = inPath
496
+ ? null
497
+ : `Created openclaw at ${symlinkPath}, but ${userBinDir} is not in your PATH. Add it:\n export PATH="${userBinDir}:$PATH"`;
498
+ return { alreadyInPath: false, symlinkCreated: true, symlinkPath, warning };
499
+ }
385
500
  // ─── OpenClaw skill registration ──────────────────────────────────────────────
386
501
  /**
387
502
  * Find the skills/ directory bundled with this zigrix package.
@@ -719,7 +834,22 @@ export async function runOnboard(options) {
719
834
  log(`✅ OpenClaw config persisted (home: ${openclawHome}, bin: ${openclawBinPath ?? 'not found'})`);
720
835
  }
721
836
  }
722
- // 7. Register OpenClaw skills (symlink skill packs)
837
+ // 7. Stabilize PATH ensure openclaw is reachable from non-login shells
838
+ let openclawPathResult = { alreadyInPath: false, symlinkCreated: false, symlinkPath: null, warning: null };
839
+ if (openclawBinPath) {
840
+ openclawPathResult = ensureOpenClawInPath();
841
+ if (openclawPathResult.symlinkCreated) {
842
+ log(`✅ openclaw symlinked to ${openclawPathResult.symlinkPath}`);
843
+ }
844
+ else if (openclawPathResult.alreadyInPath) {
845
+ log('✅ openclaw already in PATH');
846
+ }
847
+ if (openclawPathResult.warning) {
848
+ warnings.push(openclawPathResult.warning);
849
+ log(`⚠️ ${openclawPathResult.warning}`);
850
+ }
851
+ }
852
+ // 8. Register OpenClaw skills (symlink skill packs)
723
853
  let skillsRegistered = [];
724
854
  let skillsSkipped = [];
725
855
  let skillsFailed = [];
@@ -763,9 +893,11 @@ export async function runOnboard(options) {
763
893
  skillsSkipped,
764
894
  skillsFailed,
765
895
  pathStabilized: pathResult,
896
+ openclawPathStabilized: openclawPathResult,
766
897
  warnings,
767
898
  checks: {
768
899
  zigrixInPath: pathResult.alreadyInPath || pathResult.symlinkCreated,
900
+ openclawInPath: openclawPathResult.alreadyInPath || openclawPathResult.symlinkCreated,
769
901
  openclawSkillsDir: openclawSkillsDirExists,
770
902
  },
771
903
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "zigrix",
3
- "version": "0.1.0-alpha.10",
3
+ "version": "0.1.0-alpha.11",
4
4
  "type": "module",
5
5
  "description": "Multi-project parallel task orchestration CLI for agent-assisted development",
6
6
  "license": "Apache-2.0",
@@ -23,7 +23,7 @@
23
23
  "prebuild": "npm run clean",
24
24
  "prepack": "npm run build && npm run build:dashboard",
25
25
  "publish:check": "npm run build && npm run build:dashboard && npm run test && npm run smoke && bash scripts/release-smoke.sh && npm pack --dry-run",
26
- "smoke": "node dist/index.js --version && node dist/index.js config validate --json",
26
+ "smoke": "node dist/index.js --version",
27
27
  "pretest": "npm run build",
28
28
  "test": "vitest run",
29
29
  "typecheck": "tsc -p tsconfig.json --noEmit"
@@ -41,7 +41,7 @@
41
41
  15. execution unit 완료 시 `orch_complete_worker.py`에 같은 `--unit-id`를 넘겨 `unit_done` + evidence(unitId 포함)를 남긴다.
42
42
  16. finalize 전 `executionUnits[].status`가 전부 `DONE`인지 확인해야 하며, 미완료 unit이 있으면 완료 보고 금지.
43
43
  17. 중단 복구 판단은 session 문맥이 아니라 `meta.json.executionUnits[]`를 우선한다.
44
- 18. **Git Workflow Policy 준수 (2026-03-17):** 프로젝트 작업 시 `/Users/janos/.openclaw/public-knowledge/policies/git-workflow.md`를 반드시 따른다. GitHub 원격 저장소가 연결된 프로젝트는 기본 브랜치에서 직접 작업/commit/push 하지 않고, 신규 브랜치에서 작업 후 commit + PR까지를 기본 완료선으로 삼는다.
44
+ 18. **Git Workflow Policy 준수 (2026-03-17):** 프로젝트 작업 시 `/Users/janos/.openclaw/public-knowledge/policies/git-workflow.md`를 반드시 따른다. GitHub 원격 저장소가 연결된 프로젝트는 기본 브랜치(main, master)에서 직접 작업/commit/push 하지 않고, 신규 브랜치에서 작업 후 commit + PR까지를 기본 완료선으로 삼는다.
45
45
  19. **상태 불변성 하드가드 (2026-03-17):** `/Users/janos/.openclaw/public-knowledge/policies/task-status-policy.md`를 따른다. task가 `REPORTED`가 된 이후에는 어떤 후속 completion/event가 와도 상태를 `DONE_PENDING_REPORT`/`IN_PROGRESS`/`BLOCKED`로 되돌리지 않는다. `REPORTED`는 terminal state이며, 후행 이벤트는 NO-OP(로그만) 처리한다.
46
46
  20. **Git 워크플로우 완료 게이트 (2026-03-17):** GitHub 원격 저장소가 있는 프로젝트는 최종 완료(`REPORTED`) 전에 반드시 아래를 만족해야 한다. 하나라도 불충족이면 완료 보고 금지.
47
47
  - 작업 브랜치가 `main/master`가 아닐 것
@@ -13,7 +13,7 @@
13
13
  6. **모든 문제는 근본적인 해결을 원칙으로 한다. 임시방편(workaround) 금지.**
14
14
  7. **오케스트레이션 필수 (이후락 고정, 2026-03-04):** 오케스트레이션에 등록(`orchestration/tasks/<taskId>.md` 존재)되지 않은 작업은 수행 거부. taskId가 있더라도 오케스트레이션 미등록이면 pro-zig에 확인 요청.
15
15
  8. **스크립트 체인 정합 (2026-03-11):** 구 worker lifecycle 스크립트(`dev_worker_dispatch.py`, `dev_worker_start.py`, `dev_worker_done.py`)는 제거됐다. 워커 lifecycle 기록(`worker_dispatched`/`worker_done`/`worker_skipped`)은 pro-zig가 `orch_prepare_worker.py → orch_register_worker.py → orch_complete_worker.py` 체인으로 처리한다.
16
- 9. **Git Workflow Policy 준수 (2026-03-17):** 프로젝트 작업 시 `/Users/janos/.openclaw/public-knowledge/policies/git-workflow.md`를 반드시 따른다. 기본 브랜치 직접 작업/commit/push 금지, GitHub 원격이 있으면 브랜치 작업 후 PR 제출이 기본이다.
16
+ 9. **Git Workflow Policy 준수 (2026-03-17):** 프로젝트 작업 시 `/Users/janos/.openclaw/public-knowledge/policies/git-workflow.md`를 반드시 따른다. 기본 브랜치(main, master) 직접 작업/commit/push 금지, GitHub 원격이 있으면 브랜치 작업 후 PR 제출이 기본이다.
17
17
  10. **완료 상태 불변성 (2026-03-17):** `/Users/janos/.openclaw/public-knowledge/policies/task-status-policy.md`를 따른다. `REPORTED` task에 대한 후행 completion/event는 상태 전이를 만들지 않는다. 워커는 중복 완료 알림이 와도 추가 상태 변경 시도를 하지 않고 NO-OP로 처리한다.
18
18
 
19
19
  ## 3) Project Path Policy (고정)