it0/it0_app/lib/features
hailin 7d5840c245 feat(openclaw): Phase 1 — server pool + agent instance deployment infrastructure
## inventory-service
- New: pool_servers table (public schema, platform-admin managed)
- New: PoolServer entity, PoolServerRepository, PoolServerController
- CRUD endpoints at /api/v1/inventory/pool-servers
- Internal /deploy-creds endpoint (x-internal-api-key protected) for SSH key retrieval
- increment/decrement endpoints for capacity tracking

## agent-service
- New: agent_instances table (tenant schema)
- New: AgentInstance entity, AgentInstanceRepository, AgentInstanceController
- New: AgentInstanceDeployService — SSH-based docker deployment
  - Queries pool server availability from inventory-service
  - AES-256 encrypts OpenClaw gateway token at rest
  - Allocates host ports in range 20000-29999
  - Fires docker run for it0hub/openclaw-bridge:latest
  - Async deploy with error capture
- Added ssh2 dependency for SSH execution
- Added INVENTORY_SERVICE_URL, INTERNAL_API_KEY, VAULT_MASTER_KEY to docker-compose

## openclaw-bridge (new package)
- packages/openclaw-bridge/ — custom Docker image
- Two processes via supervisord: OpenClaw gateway + IT0 Bridge (Node.js)
- IT0 Bridge exposes REST API on port 3000:
  GET /health, GET /status, POST /task, GET /sessions, GET /metrics
- Connects to OpenClaw gateway at ws://127.0.0.1:18789 via WebSocket RPC
- Sends heartbeat to IT0 agent-service every 60s
- Dockerfile: multi-stage build (openclaw source + bridge TS compilation)

## Web Admin
- New: /server-pool page — list/add/edit/delete pool servers with capacity bars
- New: /openclaw-instances page — cross-tenant instance monitoring with status filter
- Sidebar: added 服务器池 (Database icon) + OpenClaw 实例 (Boxes icon) to platform_admin nav

## Flutter App
- my_agents_page: rewritten to show real AgentInstance data from /api/v1/agent/instances
- Added AgentInstance model with status-driven UI (running/deploying/stopped/error)
- Status badges with color coding + spinner for deploying state
- Summary chips showing running vs stopped counts
- api_endpoints.dart: added agentInstances endpoint

## Design docs
- OPENCLAW_INTEGRATION_PLAN.md: complete architecture document with all confirmed decisions

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-03-07 11:11:21 -08:00
..
agent_call feat(it0_app): add PTT mode to agent call page 2026-03-06 06:49:53 -08:00
alerts refactor: 移除 AppBar 刷新按钮,统一使用下拉刷新 2026-02-23 05:08:16 -08:00
approvals refactor: 移除 AppBar 刷新按钮,统一使用下拉刷新 2026-02-23 05:08:16 -08:00
auth feat(auth): add SMS OTP verification for phone registration and login 2026-03-07 06:43:27 -08:00
billing/presentation feat: implement complete commercial monetization loop (Phases 1-4) 2026-03-03 21:09:17 -08:00
chat feat(app): redesign navigation — floating robot FAB + 4-tab layout 2026-03-07 09:42:17 -08:00
dashboard refactor: 移除 AppBar 刷新按钮,统一使用下拉刷新 2026-02-23 05:08:16 -08:00
home/presentation/pages fix(home): import accountProfileProvider from settings_providers instead of auth_provider 2026-03-07 09:47:19 -08:00
my_agents/presentation/pages feat(openclaw): Phase 1 — server pool + agent instance deployment infrastructure 2026-03-07 11:11:21 -08:00
notifications feat: 完成 iAgent App 三大功能 + 修复租户上下文 2026-02-23 01:10:52 -08:00
profile/presentation/pages feat(app): redesign navigation — floating robot FAB + 4-tab layout 2026-03-07 09:42:17 -08:00
servers refactor: 移除 AppBar 刷新按钮,统一使用下拉刷新 2026-02-23 05:08:16 -08:00
settings feat: implement complete commercial monetization loop (Phases 1-4) 2026-03-03 21:09:17 -08:00
standing_orders feat: add app upgrade system with self-hosted APK update support 2026-02-26 22:35:01 -08:00
tasks feat: add app upgrade system with self-hosted APK update support 2026-02-26 22:35:01 -08:00
terminal fix: translate all remaining English UI strings to Chinese and remove dead code 2026-02-23 02:07:57 -08:00