## 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> |
||
|---|---|---|
| .. | ||
| src | ||
| Dockerfile | ||
| README.md | ||
| package.json | ||
| supervisord.conf | ||
| tsconfig.json | ||
README.md
IT0 OpenClaw Bridge
Custom Docker image that bundles the official OpenClaw agent with the IT0 Bridge process, enabling IT0's agent-service to manage and monitor OpenClaw instances.
Architecture
Container (single image, two processes via supervisord)
├── openclaw gateway (internal port 18789, NOT exposed)
└── it0-bridge (external port 3000, exposed to IT0)
├── GET /health — liveness probe
├── GET /status — detailed status
├── POST /task — submit task to OpenClaw
├── GET /sessions — list sessions
└── GET /metrics — usage metrics
Build & Push
docker build -t it0hub/openclaw-bridge:latest .
docker push it0hub/openclaw-bridge:latest
Environment Variables
| Variable | Required | Description |
|---|---|---|
OPENCLAW_GATEWAY_TOKEN |
Yes | Internal OpenClaw gateway auth token |
CLAUDE_API_KEY |
Yes | Anthropic API key (injected by IT0) |
IT0_INSTANCE_ID |
Yes | UUID from IT0's agent_instances table |
IT0_AGENT_SERVICE_URL |
Yes | IT0 agent-service URL for heartbeat |
Deploy (via iAgent SSH)
docker run -d \
--name openclaw-{instanceId} \
--restart unless-stopped \
-p {hostPort}:3000 \
-v /data/openclaw/{instanceId}:/home/node/.openclaw \
-e OPENCLAW_GATEWAY_TOKEN={token} \
-e CLAUDE_API_KEY={claudeApiKey} \
-e IT0_INSTANCE_ID={instanceId} \
-e IT0_AGENT_SERVICE_URL=https://it0api.szaiai.com \
it0hub/openclaw-bridge:latest