Skip to content

Console ​

Console is the bot's browser admin UI. Use it to send test messages, read logs, edit config, manage plugins and accounts, and watch what the AI is doing.

There is nothing to deploy: open https://console.zhin.dev and enter the API address the bot prints at startup (new projects default to http://127.0.0.1:8068) and the HTTP_TOKEN from .env. You can also open the bot's own local /console and Sandbox pages.

What you can do once connected ​

PageWhat it's for
Conversations & Channels / SandboxSend test messages; see traffic per platform account
Runtime CapabilitiesConfirm commands, middleware, components and tools are loaded, and which plugin they come from
LogsBrowse runtime logs by time and source
ConfigEdit zhin.config.yml through a form or source editor; failed saves roll back automatically
Agent workbenchSee AI conversations, tool calls, approvals and cancellations
WorkroomsSee persistent task spaces and task boards
Why can Console connect while the bot is still logging in?

The HTTP service, Console RPC and SSE are process control-plane services that start listening before all plugins have started (before the first generation is published). So while an adapter such as ICQQ is still waiting for a QR scan, slider or device confirmation, the browser can complete login through login.list, login.submit and endpoint.login.pending. Pages that depend on started plugins may be empty or show not-ready until every adapter finishes starting.

Deployment and Configuration ​

All configuration is in the http: section at the top level of zhin.config.yml:

yaml
http:
  port: 8068                 # Scaffold default; trust project config
  host: 127.0.0.1            # Default 127.0.0.1; change to 0.0.0.0 for remote access
  token: ${HTTP_TOKEN}       # Main token (full scope)
  tokens:                    # Additional scoped tokens (optional)
    - token: ${DEMO_TOKEN}
      scope: demo            # full | demo
  corsOrigins:               # CORS whitelist; https://console.zhin.dev is always automatically included
    - "http://localhost:5173"
  base: /api                 # API prefix, default /api

With a token configured, /api requests require a Bearer token. /pub/*, the Console shell, and page routes stay public. corsOrigins is merged with the Remote Console origin.

A port conflict soft-degrades the HTTP Host: Adapters and Agents keep running, but Console is unavailable. A Console restart exits with code 51 and the CLI daemon relaunches the process.

Runtime falls back to 8086 when no config exists; the current scaffold writes 8068. Always trust project configuration and the startup log.

Find the page from the symptom ​

SymptomStart hereFact to verify
Console cannot connectDashboard / startup logHost, port, token, CORS, and HTTP Host degradation
Platform is online but receives nothingEndpoint detailConnection, inbox, requests/notices, and platform callback
Command, middleware, or component is missingRuntime CapabilitiesCurrent-generation capability, order, and owner
Agent does not call a toolAgent Studio + Runtime CapabilitiesVisibility, approval, security policy, trace, and cancellation
Messages disappear after refreshEndpoint conversation + LogsHistory RPC recovery and SSE recovery gap
Workroom does not claim a chat or repositoryWorkrooms + Task boardCatalog revision, full space address, Orchestrator, and Project Inbox
File changed but behavior did notConfig + DashboardSuccessful save and publication of a new generation

Page Features ​

PageData SourceDescription
DashboardGET /api/system/status, GET /api/statsRuntime status, version, statistics overview
PluginsGET /api/plugins, GET /api/plugins/<name>Plugin list and details (commands, tools, config schema)
EndpointsEndpoint summary + inbox tablePlatform endpoint connection status; detail page includes unified inbox (messages / requests / notifications)
ConfigRPC config:get-source / config:replace-source / config:setView the active YAML/JSON Root source and edit it with revision checks
LogsGET /api/logs, GET /api/logs/stats, DELETE /api/logs, POST /api/logs/cleanupSystem logs (SystemLog table, requires Database to be running)
CronRPC cron:*In-memory tasks registered by plugins (list); with Agent installed, can add/delete/pause persistent tasks
DatabaseRPC db:info / db:tables / db:select / db:insert / db:update / db:delete / db:kv:*Database browsing and editing, KV storage
FilesRPC files:tree / files:read / files:save, env:list / env:saveProject file tree and .env management
Runtime CapabilitiesGET /api/introspection/{commands,middlewares,components,tools,prompt-sections,endpoints,bindings,mcp}, POST /api/introspection/components/renderCurrent-generation contracts, owners, middleware order, component rendering lab, and Prompt Section governance metadata
Agent SessionsGET/POST /api/agent/sessions/*AI session tree viewing and branch switching; GET returns an empty state: not_started tree before a channel conversation creates an AI session
WorkroomsPersistent Workroom Catalog + Profile RPC + GET /api/agent/workroom/runs[/*]Revision-CAS management for Projects, members, Agent roles, and chat/channel/repository bindings; diagnose and initialize Profile/Planning Policy; inspect replayed Runs, Tasks, and Assignments
MarketplaceGET /pub/marketplace/search, /pub/marketplace/detail/*, GET /api/marketplace/updatesPlugin marketplace (plugins.json + npmmirror) and update checks
SandboxWS /sandboxBuilt-in sandbox chat, direct conversation without platform integration

Real-time pushes go through SSE: GET /api/events (page directory sync, HMR reload, message/configuration events).

Fixed string choices, such as the calendar provider, can use the existing select field instead of forcing the entire document into source editing. The supported anyOf consists of 1–64 unique, nonempty string constants of at most 256 characters, with no extra branch validation constraints; only the outer default is used. Object unions, mixed types, oneOf, and other combinations that cannot be represented completely still use source editing. The original JSON Schema validator is unchanged. A saved value outside the options, including an environment reference, must be preserved until explicitly replaced; changing one choice must not remove other backends or instances. This display requires the corresponding Console update.

Agent Studio run policy ​

The working directory and security policy belong to each run. They are not Prompt content, and the model cannot elevate them. A safe beginner baseline is the current project directory, workspace-write, ask, and network access disabled.

FieldAccepted valuesHow to choose
safetyModeread-only / workspace-write / danger-full-accessUse read-only for inspection, workspace-write for project edits, and full host access only for a local task whose risks are understood
approvalModeask / auto / bypassDefault to ask; auto uses a dedicated review Agent and asks the master when uncertain; bypass approves immediately while permissions and sandbox policy still apply
networkAccessfalse / trueEnable only when the task needs the network; danger-full-access inherently includes network authority
workingDirectorydirectory pathPoint to the project directory this run may use; avoid a broad system root

These values are a closed contract, not free-form labels. Unknown safetyMode or approvalMode values fall back to workspace-write or ask; Agent Studio should always echo the effective policy before execution.

Standard acceptance run ​

  1. Dashboard reports a healthy connection with readable version and runtime data.
  2. Send a Sandbox message, refresh, and confirm Endpoint history remains.
  3. Inspect current owners for commands, middleware, components, Tools, and Prompt Sections.
  4. Run an Agent task and verify working directory, security policy, approval, cancellation, trace, and artifacts.
  5. For a Workroom, prove that a real chat, channel, or repository event enters the correct Project.

A release is ready only when the current generation and durable projections agree. Disk configuration and plugin manifests are candidate inputs.

/entries Plugin Page Mechanism ​

Plugins can contribute their own pages to the Console. The mechanism has three steps:

  1. The plugin declares client pages (pagemanager), and the build output is served by the Host at /assets/client/*;
  2. The Host's ConsoleRuntime aggregates the page directory. GET /entries returns { entries, runtimeEnvHint } -- each entry contains id, title, route, module (page module URL), order, hash;
  3. The Remote Console / local shell fetches /entries and dynamically imports the corresponding modules for rendering; bare browser imports (react, etc.) are proxied by the Host's /esm/* as executable ESM.

Page directory changes are pushed in real-time to connected UIs via SSE sync events.

Demo Scope (Read-Only Deployment) ​

Issue a scope: demo token for demonstrations. Demo exposes only server-authorized, redacted data; a client-side mask is never a secret boundary.

  • Allowed: event stream and history, Runtime Capabilities, read-only Console RPC, system status, statistics, and plugin catalog;
  • WebSocket only for /sandbox;
  • All other write operations (changing config, clearing logs, DB writes, etc.) return 403.

The main token has full scope with all permissions.