- Capabilities: all 14 registered (AO: inventory.query, download.plan/submit, organize.plan/execute,
policy.preview/apply; agent: task.inspect/retry/cancel); startup asserts count == 14.
Registry injects server-side authorize (automation_grant by action/scope/policy version/budget,
one-shot approval bound to plan id + payload hash + revision + expiry; model claims ignored;
automation switch), audit_event, server idempotency keys and a capability_invocation op ledger
(migration 0021) used for crash reconciliation. download.plan creates draft plans only;
download.submit promotes draft -> reserved after authorization.
- Agent session API: POST/GET /agent/runs, GET /agent/runs/{id} (events by seq, messages, report),
POST .../messages (wake), POST .../abort; automation-grants, approvals, capabilities invoke, tasks.
- runAgent task: Pi or fake provider from settings (apiKey via secrets), events persisted to
agent_run_event then published, resume + ledger reconciliation when pendingOperations > 0,
waits for goal-linked downloads/imports and reports from business tables (submitted != imported).
- Background triggers: decision.created -> bounded plan_only investigation (dedupe per decision);
decision.updated(resolved) -> resolveDecision executes chosen option.
- W2 closure: all OpenAPI routes registered in contracts api.ts (+ subset test); TMDB key from
settings secret_ref with env fallback; PUT /sites/{id}/credentials documented as alias of
/site-accounts; completion events documented as existing status events.
- e2e (real PG + OpenWorkflow + testkit mocks): RSS->library, agent delegation with grant/deny,
background continuation, worker kill -9 recovery (single qB add), auto investigation dedupe.
Co-Authored-By: Claude Opus 5.5 <[email protected]>
12 lines
603 B
Bash
12 lines
603 B
Bash
# 复制为 .env 后按需修改(apps/server 与 packages/db 都会读取仓库根的 .env)
|
|
PORT=4380
|
|
DATABASE_URL=postgres://umt:umt@localhost:55433/umt
|
|
# 凭证加密主密钥(32 字节以上随机串);与数据库备份分开保管
|
|
SECRET_MASTER_KEY=dev-only-change-me-dev-only-change-me
|
|
LOG_LEVEL=info
|
|
NODE_ENV=development
|
|
# 开发模式下可直接用此 Key 以 admin scope 访问 API;生产环境忽略
|
|
DEV_ADMIN_KEY=umt-dev-admin-key
|
|
# Agent(Pi)JSONL 会话目录:api 与 worker 进程需共享同一目录(崩溃恢复点);缺省 ./data/agent-sessions
|
|
# AGENT_SESSION_DIR=./data/agent-sessions
|