codeharbor 0.1.13 → 0.1.15

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/.env.example CHANGED
@@ -74,6 +74,11 @@ ADMIN_PORT=8787
74
74
  # Strongly recommended for any non-localhost access.
75
75
  # Required when exposing admin via reverse proxy/tunnel/public domain.
76
76
  ADMIN_TOKEN=
77
+ # Optional multi-token RBAC (JSON array).
78
+ # Each item: {"token":"...","role":"admin|viewer","actor":"ops-name"}
79
+ # Example:
80
+ # ADMIN_TOKENS_JSON=[{"token":"admin-secret","role":"admin","actor":"ops-admin"},{"token":"viewer-secret","role":"viewer","actor":"ops-audit"}]
81
+ ADMIN_TOKENS_JSON=
77
82
  # Optional IP allowlist (comma-separated, for example: 127.0.0.1,192.168.1.10).
78
83
  ADMIN_IP_ALLOWLIST=
79
84
  # Optional browser origin allowlist for CORS (comma-separated).
package/README.md CHANGED
@@ -311,7 +311,7 @@ Optional overrides:
311
311
  codeharbor admin serve --host 127.0.0.1 --port 8787
312
312
  ```
313
313
 
314
- If you bind Admin to a non-loopback host and `ADMIN_TOKEN` is empty, startup is rejected by default.
314
+ If you bind Admin to a non-loopback host and both `ADMIN_TOKEN` and `ADMIN_TOKENS_JSON` are empty, startup is rejected by default.
315
315
  Explicit bypass exists but is not recommended:
316
316
 
317
317
  ```bash
@@ -336,7 +336,7 @@ Main endpoints:
336
336
  - `GET /api/admin/health`
337
337
  - `GET /api/admin/audit?limit=50`
338
338
 
339
- When `ADMIN_TOKEN` is set, requests must include:
339
+ When `ADMIN_TOKEN` or `ADMIN_TOKENS_JSON` is set, requests must include:
340
340
 
341
341
  ```http
342
342
  Authorization: Bearer <ADMIN_TOKEN>
@@ -345,9 +345,16 @@ Authorization: Bearer <ADMIN_TOKEN>
345
345
  Access control options:
346
346
 
347
347
  - `ADMIN_TOKEN`: require bearer token for `/api/admin/*`
348
+ - `ADMIN_TOKENS_JSON`: optional multi-token RBAC list (supports `admin` and `viewer` roles)
348
349
  - `ADMIN_IP_ALLOWLIST`: optional comma-separated client IP whitelist (for example `127.0.0.1,192.168.1.10`)
349
350
  - `ADMIN_ALLOWED_ORIGINS`: optional CORS origin allowlist for browser-based cross-origin admin access
350
351
 
352
+ RBAC behavior:
353
+
354
+ - `viewer` tokens can call read endpoints (`GET /api/admin/*`)
355
+ - `admin` tokens can call read + write endpoints (`PUT/POST/DELETE /api/admin/*`)
356
+ - for `ADMIN_TOKENS_JSON`, audit actor is derived from token identity (`actor` field), not `x-admin-actor`
357
+
351
358
  Note: `PUT /api/admin/config/global` writes to `.env` and marks changes as restart-required.
352
359
 
353
360
  ### Admin UI Quick Walkthrough
@@ -403,14 +410,23 @@ If any check fails, it prints actionable fix commands (for example `codeharbor i
403
410
  - `/stop` cancel in-flight execution (if running) and reset session context
404
411
  - `/agents status` show multi-agent workflow status for current session (when enabled)
405
412
  - `/agents run <objective>` run Planner -> Executor -> Reviewer workflow (when enabled)
413
+ - `/autodev status` show AutoDev doc/task summary + run snapshot (when enabled)
414
+ - `/autodev run [taskId]` auto-pick pending task (or run specified task) from `TASK_LIST.md` (when enabled)
406
415
 
407
416
  ### Multi-Agent Workflow (Phase B, Opt-In)
408
417
 
409
418
  - `AGENT_WORKFLOW_ENABLED=true`
410
- - enable `/agents` workflow commands
419
+ - enable `/agents` and `/autodev` workflow commands
411
420
  - `AGENT_WORKFLOW_AUTO_REPAIR_MAX_ROUNDS`
412
421
  - reviewer reject loop upper bound (default `1`)
413
422
 
423
+ AutoDev (`/autodev`) conventions:
424
+
425
+ - Workspace must contain `REQUIREMENTS.md` and `TASK_LIST.md`.
426
+ - `TASK_LIST.md` should include task IDs and status markers (`⬜`, `🔄`, `✅`, `❌`, `🚫`) in table rows or checklist rows.
427
+ - `/autodev run` selects `🔄` task first, then `⬜` task.
428
+ - When reviewer verdict is `APPROVED`, CodeHarbor updates the task status to `✅` automatically.
429
+
414
430
  Default is disabled to keep legacy behavior unchanged.
415
431
 
416
432
  ## CLI Compatibility Mode