diff --git a/README.md b/README.md index d70eac9..abb823f 100644 --- a/README.md +++ b/README.md @@ -2,266 +2,161 @@ **English** | [简体中文](README.zh-CN.md) -An open-source web console for creating Agents and running durable conversations -on Parsar Agent Core or another compatible Agents API Core. +Agents Core Web is an open-source workspace for creating AI Agents, starting durable +Sessions, following live work, and managing the resources used by a compatible Agent +Core. It gives teams a product UI for their own Core deployment without moving +credentials or execution into the browser. -## What it is - -Agents Core Web gives an independently deployed Agent Core a focused browser UI -and a reusable TypeScript client. The Core remains responsible for authentication, -persistence, scheduling, and execution; this project does not embed or reimplement it. +![Agents Core Web Dashboard](docs/images/dashboard.png) ## What you can do -- Create, view, edit, and delete reusable Agent configurations. -- Start durable Sessions with optional text input, metadata, and bounded - Session-only Agent overrides, then inspect their saved Items. -- Show Sessions for all Agents or use a server-side root-Agent filter. -- Optionally create a Codex `self_hosted` Session and follow the connection state - of an operator-managed Linux executor. -- Optionally create the basic Codex `openai_hosted` profile through an - operator-qualified managed Runtime, inspect its exact Environment state, and - list or explicitly add bounded `/workspace` files. -- Use Dashboard for the last Agent/Session results successfully traversed to - Core's page-chain end marker, and System for live API reachability, pinned - contract coverage, Source Files, and ownership boundaries. -- Follow live progress over SSE and recover persisted output after reconnecting. -- Cancel active work and return function results or errors. -- Use the same Web client with Parsar Core or another proven-compatible Core. - -## Compatible Agent Cores - -| Core or interface | Can Web connect? | Notes | -| --- | --- | --- | -| [Parsar Agents API Core at `dadf64a7`](https://github.com/MiniMax-AI-Dev/parsar/tree/dadf64a76bde58255281f3b6c3e939f8b556be09/services/agents-api) | Yes | Primary tested integration and immutable capability baseline | -| Another Core implementing the tested `/v1/agents/**` HTTP/SSE subset | Yes | It must match the resources and behavior in [protocol coverage](docs/protocol-coverage.md) | -| OpenAI's hosted Agents API | Not claimed | This project does not promise complete hosted-API compatibility | -| OpenAI Agents SDK, Responses API, or Parsar daemon WebSocket | No | They are an SDK interface, a model API, and an internal execution interface—not directly connectable Core protocols | - -Web speaks a tested subset of the [OpenAI Agents API](https://developers.openai.com/api/docs/guides/agents) -beta HTTP resource shape: -JSON requests and authenticated SSE under `/v1/agents/**`, with -`OpenAI-Beta: agents=v1`. Compatibility means this documented and tested subset, -not merely accepting the header or sharing similar names. - -The capability statements below are audited against immutable Parsar revision -[`dadf64a7`](https://github.com/MiniMax-AI-Dev/parsar/commit/dadf64a76bde58255281f3b6c3e939f8b556be09), -not a moving upstream branch. - -## Start Web with an existing Core - -You need Node.js 22.12+, pnpm 10.30.3, a running compatible Agent Core, and a -caller bearer issued or configured by that Core's operator. For working chat, -the Core must also have a configured execution path. - -Clone and start the Web: +- **Operate from one Dashboard** — see loaded Agents, active Sessions, work that needs + attention, recent activity, and the two common create flows. +- **Build reusable Agents** — start from a blank Agent or a practical template, then + configure its model, instructions, text behavior, Functions, and HTTP MCP servers. +- **Run durable conversations** — create a Session, send messages, follow live events, + reopen previous work, inspect trace history, and continue after a failed Turn. +- **Work with tools safely** — review Function calls, submit requested Function results, + inspect command and patch activity, and attach write-only MCP credentials through Vaults. +- **Choose an Environment** — use Core's default execution path, connect a caller-managed + self-hosted executor, or use an operator-enabled managed Runtime. +- **Understand the connection** — view Core reachability and exposed product capabilities, + and get actionable local Docker recovery guidance when the backend is not ready. + +## Product tour + +### Dashboard + +Dashboard is the starting point. It summarizes the current Agent and Session results, +highlights Sessions that need attention, and links directly to Agent creation or a new +Session. + +### Agents + +Agents are reusable working profiles. Create one from scratch or begin with a starter +template for incident response, Slack collaboration, data analysis, GitHub investigation, +or contract review. Existing Agents open directly in the editor and can start a Session +from their card. + +![Agent library and starter templates](docs/images/agents.png) + +### Sessions + +Sessions keep the conversation and work history in Core. The workspace combines Session +navigation, live connection state, conversation output, trace inspection, tool activity, +and follow-up input without losing the durable record. + +![Durable Session conversation](docs/images/sessions.png) + +### System and connection status + +System shows what the connected Core exposes to this Web build. It separates API access, +Vault availability, self-hosted presentation, and runtime readiness so a healthy HTTP +service is not mistaken for a ready model execution path. + +![Core connection and capability status](docs/images/system.png) + +## Main capabilities + +| Area | User experience | +| --- | --- | +| Dashboard | Agent and Session overview, attention queue, recent activity, quick actions | +| Agents | Create, search, inspect, edit, delete, use templates, and start Sessions | +| Sessions | Durable conversation history, Agent filtering, live events, cancellation, retry and continuation | +| Trace | Turn history, usage when reported by Core, command output, Function and patch activity | +| Functions and MCP | Configure supported tools, inspect calls, submit requested results, attach Vault credentials | +| Vaults | Create project Vaults and manage write-only MCP bearer credentials without reading tokens back | +| Environments | Default execution, optional self-hosted executor connection, and optional managed Runtime views | +| Workspace and Files | Inspect supported Environment files and manage project Source Files when enabled by Core | +| System | Connection status, surfaced capabilities, Core ownership boundaries, and local recovery guidance | + +Capabilities appear only when the connected Core and the Web operator configuration expose +them. Saving an Agent proves that its definition was stored; actual execution still depends +on the Core's runtime, model provider, credentials, and tool connectivity. + +## Quick start + +### Requirements + +- Node.js 22.12+ +- pnpm 10.30.3 +- a running [compatible Agent Core](#compatible-cores) +- a caller key issued by that Core's operator + +### Start Web ```bash git clone https://github.com/MiniMax-AI-Dev/agents-core-web.git cd agents-core-web pnpm install +cp .env.example .env.local pnpm dev ``` -The default local setup expects: - -- Agent Core at `http://127.0.0.1:8091`; -- browser requests through the same-origin `/v1` proxy; -- the plaintext caller bearer at `~/.parsar/agents-api/web-token`, read only by - the local Vite server. +The default development server opens on `http://127.0.0.1:4173` and proxies browser +requests to a Core on `http://127.0.0.1:8091`. -Open the loopback URL printed by Vite. Keep the connection base at `/v1`; when -**Server-managed Core key active** appears, leave the browser token field empty. - -To use another server target or private key file, copy `.env.example` to -`.env.local` and set these optional server-side variables: +Configure the local proxy in `.env.local`: ```dotenv AGENTS_API_PROXY_TARGET=http://127.0.0.1:8091 AGENTS_API_PROXY_TOKEN_FILE=/absolute/private/path/to/web-token ``` -Self-hosted Session creation is a public, non-secret operator opt-in and is hidden -by default. Enable it only for a reviewed Codex Core deployment whose executor -registry and externally reachable executor origin are configured: +Only the local Web server reads the caller-key file. Do not place a plaintext key in a +`VITE_*` variable, URL, screenshot, Agent, Session metadata, or Git. -```dotenv -AGENTS_CORE_WEB_SELF_HOSTED_SESSIONS=1 -``` +### First workflow -This flag is read when Vite starts or builds the Web. It exposes the supported -Session creation form; it does not probe Core capabilities or prove that an -executor, native runtime, model, or provider is ready. Restart `pnpm dev` after -changing it. Never place an executor key or any other credential in this variable. +1. Open **Agents** and choose **Create agent** or a starter template. +2. Set a name, model, and instructions; add supported tools only when needed. +3. Select **Start Session**, choose an Environment, and optionally send the first message. +4. Continue in **Sessions** while live events and durable history update. +5. Use **Trace**, **Vaults**, **Environment**, or **System** when the workflow needs them. -Basic managed hosted Session creation is a separate default-off presentation -policy. Enable it only after the Core operator has installed and qualified the -pinned Codex Runtime image, configured a stable default managed provider, and -accepted its Docker isolation and model-provider boundary: +## Local Core and Docker -```dotenv -AGENTS_CORE_WEB_OPENAI_HOSTED_SESSIONS=1 -``` +When Web cannot reach the local Core, Dashboard opens a connection guide with two paths: -This flag likewise does not discover Core configuration or prove Runtime, native -harness, model, provider, Function, or tool readiness. The Core may still reject -creation when no qualified provider is configured. - -Keep credentials server-side. A direct Core URL in the connection dialog is only -for a compatible Core that explicitly allows the Web origin, methods, and headers -through CORS. - -Do not have a Core running yet? Use the immutable -[current Parsar setup guide](https://github.com/MiniMax-AI-Dev/parsar/blob/dadf64a76bde58255281f3b6c3e939f8b556be09/services/agents-api/README.md#standalone-http-service). -The repository's [Web connection runbook](docs/core-connection.md) is pinned to the -same revision and separates ordinary daemon/self-hosted setup from the managed -Docker-hosted operator profile. - -## First use - -1. Open **Agents** and create an Agent with a name, instructions, and model ID. -2. Review, edit, or delete the saved Agent, or open **Start Session**. The default - uses no Environment. -3. Optionally set a title, enter the first text message, or - configure the bounded whole-field Agent overrides used only by this Session. -4. In **Sessions**, choose **All Agents** or one root Agent, select a Session, and - continue the conversation. -5. Follow live Items, cancel active work, or return a requested function result. -6. Open **System → Source Files** to upload, retrieve, download, or delete one - project-owned `user_data` file by its Core ID. Core has no Source Files list, so - retain the returned ID; Web does not persist it across page reloads. - -**Start Session** accepts an exact non-empty text string or an ordered array of user -messages containing `input_text` parts only. Message order and grouping are preserved; -images, attachments, non-user roles, and other content parts are not supported. -Meaningful input is sent by streaming `POST /v1/agents/sessions` with `stream:true`; Web consumes -that creation SSE while running durable reconciliation for Session, Item, and -eligible Environment state and starting the paginated Turn read independently. After -the POST settles, Web hands live updates off to `GET .../events`. Empty or -whitespace-only input is omitted and uses the JSON `stream:false` create path for -`none` and `self_hosted`, so the Session starts idle. Web deliberately uses creation -SSE for `openai_hosted`, including idle creation, so it can reconcile provisioning -events before handing off to `GET .../events`. The optional title becomes -`metadata.title`; Start Session does not expose additional metadata. Additional -string metadata remains editable from the actions for an existing Session and must -stay within the pinned Core limits. Never put credentials or secrets there. - -Session-only Agent overrides are deliberately finite and whole-field based. Web can -replace `model`, set or clear `instructions`, replace the plain-text configuration, -reset saved-only `multi_agent`, `reasoning`, or `service_tier` values to Core -defaults, and inherit, clear, or fully replace `tools` through the same bounded -Function/HTTP MCP editor. Untouched fields are omitted. There is no arbitrary Agent -JSON editor or patch-style partial Tool update. Environment choices are no Environment, -separately enabled -`self_hosted`, and separately enabled basic `openai_hosted`; the managed choice is -blocked when the effective Agent contains MCP because hosted MCP is not qualified. - -After a failed create, only an explicit unchanged retry reuses the in-memory -idempotency key. The stable request fingerprint covers `agent_id`, the finite `agent` -override when present, `environment`, exact optional `input`, normalized `metadata`, -`stream`, and sorted derived `vault_ids`; any change to that projected request -rotates the key. The Sessions root-Agent picker is also server-side: every -continuation request carries the same `agent_id`, while **All Agents** omits the -parameter instead of filtering an already loaded page in the browser. - -If an HTTP MCP server needs a static bearer, open **Vaults**, create a Vault and a -write-only Credential for the exact HTTPS endpoint, then select it under -**Agent → HTTP MCP → Authentication**. When the Session starts, Web attaches the -owning Vault and never reads the token back. The option is shown only after the -connected Core successfully exposes the Vault catalog; catalog metadata alone is -not proof that the MCP server can be reached at runtime. - -When the operator opt-in is enabled, **Start Session** also offers **Self-hosted**. -Its absolute Workspace path is on the executor host, not in the browser, Web server, -or `parsar-daemon` container. After Core creates the Session, Web can show a -launcher template built from that Session's Environment ID and executor origin. The -operator-issued executor credential file stays outside Web, and the launcher itself -runs on caller-managed Linux executor compute. See -[Connecting Agent Core](docs/core-connection.md#optional-self-hosted-session-creation) -for the exact boundary. - -The separately opt-in `AGENTS_CORE_WEB_DOCKER_BACKEND_GUIDE=1` profile turns Dashboard -gateway failures into an explicit recovery entry point. For an existing stack, the -connection panel shows validated, copyable commands for the configured database, Core -API, and daemon containers plus the loopback health check. For first-time use, it shows -the Core image build command and immutable Parsar container/daemon setup links. Parsar -still requires operator-created database and credential state; Web never runs these -commands, accesses Docker, or invents secrets. Container names remain non-secret -operator configuration from `.env.example`. - -For the reviewed local loopback stack, an operator can additionally enable the -default-off `AGENTS_CORE_WEB_DOCKER_GUIDE=1` profile and its required non-secret -`AGENTS_CORE_WEB_DOCKER_*` settings from `.env.example`. The connection panel then -offers a copyable Docker command alongside the native launcher. Web still never -reads the credential file or talks to Docker, and running the command can release -already queued paid input. - -The Source Files surface is independent of Session Environment choice. For a complete -basic managed Session, Core provisions the `openai_hosted` Runtime automatically; -Web shows its managed ID, enabled/disabled network policy, empty startup-install -metadata, and durable/live status. Workspace file controls are independently -default-off; set `AGENTS_CORE_WEB_ENVIRONMENT_FILES=1` only after qualifying the -connected Core Files.list and managed Files.create APIs. Managed reads use -`/workspace`; self-hosted reads use the -exact Session `workspace_directory`. Web never shows a -self-hosted launcher or caller connection action for that profile. Inline writes in -the Session panel and Source-ID copies in System appear only after an exact current -`openai_hosted` resource read confirms a non-terminal status and empty -files/plugins/skills metadata. Missing write responses are never replayed. Templates, -restricted domains, populated startup installs, hosted MCP, readiness discovery, and -other hosted engines remain unavailable. `self_hosted` Workspace files remain -read-only. Docker is Core's private managed Runtime adapter, not another public -Environment discriminator. - -The model ID must be supported by the connected execution runtime. Core currently -has no model-catalog endpoint, so Web suggestions are editable hints rather than -availability guarantees. Successfully saving an Agent proves configuration storage, -not that a daemon, model, or provider credential can execute it. - -## Relationship to Parsar - -```mermaid -flowchart LR - user["User"] --> web["Agents Core Web"] - web -->|"HTTP JSON + SSE"| core["Compatible Agent Core"] - core --> runtime["Execution runtime / daemon"] - runtime --> tools["Models / MCP / tools"] -``` +- **Already set up** — start the configured database, Core API, and daemon containers, + verify `/healthz`, then run **Test connection**. +- **First time on this computer** — build the Core image and follow the pinned Parsar + guides to create the database, caller identity, migrations, API container, and daemon + profile. -[Parsar](https://github.com/MiniMax-AI-Dev/parsar) owns its standalone Agents API -Core, `parsar-daemon`, and native Codex/Claude execution adapters. This repository -owns only the open Web experience and `@agents-core-web/agents-client`. The browser -connects to the Core protocol; it never uses the daemon WebSocket as its API URL. -For `self_hosted`, a separate operator-managed Linux executor connects to Core with -its own credential and runs commands in its own Workspace; neither Web nor the daemon -container becomes that Environment. +Enable the local recovery guide with the non-secret settings documented in +[`.env.example`](.env.example). Web displays reviewed commands but never receives the +Docker socket, executes commands, creates credentials, or invents database identities. -See [Architecture](docs/architecture.md) for the full component and trust boundaries. +For complete setup, see [Connecting Agent Core](docs/core-connection.md). Starting a +daemon can release queued work and trigger model usage; review pending Sessions first. -## Common problems +## Compatible Cores -| Symptom | What to check | +Agents Core Web uses the tested `/v1/agents/**` HTTP and SSE contract documented in +[Protocol coverage](docs/protocol-coverage.md). + +| Core | Status | | --- | --- | -| Web cannot reach Core | Confirm the Core address and `AGENTS_API_PROXY_TARGET`, then restart Vite | -| `401 invalid_api_key` | The plaintext caller bearer must match the current Core key binding | -| `503 execution_unavailable` / `Execution is not enabled` | Core rejected execution; inspect its safe error plus runtime and ownership state. A worker, executor, or daemon may be unconfigured or disconnected, or an execution lease may have been lost | -| Agent saves but its model fails | Use a model ID and provider credential supported by the connected runtime | -| Self-hosted option is hidden | Set the non-secret `AGENTS_CORE_WEB_SELF_HOSTED_SESSIONS=1` operator flag and restart/rebuild Web only after the connected Codex Core and executor path have been reviewed | -| Managed hosted option is hidden | Set `AGENTS_CORE_WEB_OPENAI_HOSTED_SESSIONS=1` and restart/rebuild Web only after the pinned Core managed Runtime provider has been qualified | -| Workspace files are hidden | Set `AGENTS_CORE_WEB_ENVIRONMENT_FILES=1` and restart/rebuild Web only after the connected Core Files.list plus managed Files.create routes and Environment profiles have been qualified | - -`/healthz` proves HTTP liveness only, not chat readiness. Check durable Core state and -the current pinned Parsar guide before retrying an uncertain request; see the -[connection troubleshooting runbook](docs/core-connection.md#troubleshooting). +| [Parsar Agents API Core at `dadf64a7`](https://github.com/MiniMax-AI-Dev/parsar/tree/dadf64a76bde58255281f3b6c3e939f8b556be09/services/agents-api) | Primary tested integration | +| Another Core implementing the documented subset | Compatible after contract qualification | +| OpenAI hosted Agents API | Complete compatibility is not claimed | +| OpenAI Agents SDK, Responses API, or Parsar daemon WebSocket | Different interfaces; not direct Core endpoints | + +The browser talks to Core. Core owns authentication, durable Agent and Session state, +scheduling, execution, and runtime resources. The browser never connects directly to a +daemon or model provider. ## Documentation -- [Current Parsar Core setup](https://github.com/MiniMax-AI-Dev/parsar/blob/dadf64a76bde58255281f3b6c3e939f8b556be09/services/agents-api/README.md#standalone-http-service) — immutable current upstream guide -- [Web connection runbook](docs/core-connection.md) — matching `dadf64a7` operator and browser boundary -- [Protocol coverage](docs/protocol-coverage.md) — exact supported API surface -- [Architecture](docs/architecture.md) — ownership, runtime, and trust boundaries -- [Roadmap](docs/roadmap.md) — planned Web and Core integrations -- [Issue-driven iteration](docs/self-iteration.md) — contributor automation contract -- [Contributor policy](AGENTS.md) — repository scope, safety, and quality requirements +- [Connecting Agent Core](docs/core-connection.md) — local, remote, Docker, daemon and Environment setup +- [Protocol coverage](docs/protocol-coverage.md) — tested resources, events and capability boundaries +- [Architecture](docs/architecture.md) — components, ownership and trust boundaries +- [Roadmap](docs/roadmap.md) — planned product and Core integrations +- [Contributor policy](AGENTS.md) — repository scope, security and quality requirements + +The screenshots use isolated local fixture data and do not contain production data or +prove model-provider readiness. Agents Core Web is available under the [MIT License](LICENSE). diff --git a/README.zh-CN.md b/README.zh-CN.md index 67d7470..34767ad 100644 --- a/README.zh-CN.md +++ b/README.zh-CN.md @@ -2,228 +2,151 @@ [English](README.md) | **简体中文** -一个开源 Web 控制台,用于在 Parsar Agent Core 或其他兼容的 Agents API Core -上创建 Agent 并运行持久化对话。 +Agents Core Web 是一个开源的 AI Agent 工作台,用于创建 Agent、启动可持续的 +Session、跟踪实时执行过程,并管理兼容 Agent Core 提供的资源。团队可以为自己的 +Core 部署提供完整的产品界面,同时让凭据和执行能力始终留在浏览器之外。 -## 这是什么 +![Agents Core Web Dashboard](docs/images/dashboard.png) -Agents Core Web 为独立部署的 Agent Core 提供专用的浏览器界面和可复用的 -TypeScript 客户端。鉴权、持久化、调度和执行仍由 Core 负责;本项目不内置或 -重新实现 Agent Core。 +## 可以做什么 -## 能做什么 +- **通过 Dashboard 统一管理**:查看 Agent、活跃 Session、需要关注的工作、最近活动 + 和常用创建入口。 +- **创建可复用 Agent**:从空白配置或实用模板开始,设置模型、指令、文本行为、 + Function 和 HTTP MCP 服务。 +- **运行持久化对话**:创建 Session、发送消息、查看实时事件、重新打开历史工作、 + 检查 Trace,并在 Turn 失败后继续对话。 +- **安全使用工具**:检查 Function 调用、提交被请求的 Function 结果、查看命令和 + Patch 轨迹,并通过 Vault 绑定只写的 MCP 凭据。 +- **选择执行 Environment**:使用 Core 默认执行链路、连接调用方管理的 self-hosted + executor,或使用运维方启用的 managed Runtime。 +- **理解连接状态**:查看 Core 可达性和已暴露能力;本地后端未就绪时获得明确的 + Docker 恢复步骤。 -- 创建、查看、编辑和删除可复用的 Agent 配置。 -- 启动可带初始文本、可选标题和有限 Session 级 Agent 覆盖的持久化 Session, - 并查看其中保存的 Item。 -- 查看所有 Agent 的 Session,或使用服务端 root-Agent 筛选。 -- 可选创建 Codex `self_hosted` Session,并查看运维方管理的 Linux executor 连接状态。 -- 可选通过运维方已验收的 managed Runtime 创建基础 Codex `openai_hosted` - Session,查看精确 Environment 状态,并显式列出或添加有界 `/workspace` 文件。 -- 通过 Dashboard 查看最近一次成功遍历到 Core 分页结束标记的 Agent/Session - 加载结果,通过 System 查看实时 API 可达性、固定契约范围、Source Files 和所有权边界。 -- 通过 SSE 查看实时进度,并在重连后恢复已持久化的输出。 -- 取消正在执行的任务,并回传函数执行结果或错误。 -- 使用同一个 Web 客户端连接 Parsar Core 或其他经验证兼容的 Core。 +## 产品界面 -## 兼容哪些 Agent Core +### Dashboard -| Core 或接口 | Web 能否连接? | 说明 | -| --- | --- | --- | -| [`dadf64a7` 的 Parsar Agents API Core](https://github.com/MiniMax-AI-Dev/parsar/tree/dadf64a76bde58255281f3b6c3e939f8b556be09/services/agents-api) | 可以 | 主要且经过测试的集成,也是不可变能力基线 | -| 实现了 `/v1/agents/**` 已测试 HTTP/SSE 子集的其他 Core | 可以 | 必须符合[协议覆盖范围](docs/protocol-coverage.md)记录的资源和行为 | -| OpenAI 托管的 Agents API | 不作承诺 | 本项目不承诺与托管 API 完全兼容 | -| OpenAI Agents SDK、Responses API 或 Parsar daemon WebSocket | 不可以 | 它们分别是 SDK 接口、模型 API 和内部执行接口,不是可直接连接的 Core 协议 | +Dashboard 是默认首页,集中展示当前 Agent 和 Session 结果、需要关注的 Session, +并可直接进入创建 Agent 或启动 Session 的流程。 -Web 使用 [OpenAI Agents API](https://developers.openai.com/api/docs/guides/agents) -beta HTTP 资源形态中经过测试的子集: -`/v1/agents/**` 下的 JSON 请求和鉴权 SSE,并携带 -`OpenAI-Beta: agents=v1`。这里的兼容是指已记录、已测试的子集, -仅仅接受该请求头或名称相似,并不代表兼容。 +### Agents -下文所有能力说明都以不可变 Parsar revision -[`dadf64a7`](https://github.com/MiniMax-AI-Dev/parsar/commit/dadf64a76bde58255281f3b6c3e939f8b556be09) -为审计基线,而不是跟随变化的上游分支。 +Agent 是可以反复使用的工作配置。可以从空白 Agent 开始,也可以使用事故响应、 +Slack 协作、数据分析、GitHub 问题调查和合同审阅模板。点击已有 Agent 会直接进入 +编辑,也可以从卡片立即启动 Session。 -## 已有 Core 时启动 Web +![Agent 列表和入门模板](docs/images/agents.png) -你需要 Node.js 22.12+、pnpm 10.30.3、一个正在运行的兼容 Agent Core, -以及由该 Core 运维方提供或配置的调用方 Bearer 凭据。要正常聊天,Core 还必须 -具备已配置的执行链路。 +### Sessions -克隆并启动 Web: +Session 的对话和工作历史保存在 Core 中。一个页面同时提供 Session 导航、实时连接 +状态、对话输出、Trace、工具活动和后续输入,不会丢失持久化记录。 + +![持久化 Session 对话](docs/images/sessions.png) + +### System 与连接状态 + +System 展示当前 Core 对 Web 暴露的能力,并区分 API 访问、Vault、self-hosted 展示 +开关和运行时就绪状态,避免把 HTTP 服务正常误认为模型执行链路已经可用。 + +![Core 连接和能力状态](docs/images/system.png) + +## 主要能力 + +| 区域 | 用户可以完成的工作 | +| --- | --- | +| Dashboard | 查看 Agent/Session 概览、关注队列、最近活动和快捷入口 | +| Agents | 创建、搜索、查看、编辑、删除、使用模板并启动 Session | +| Sessions | 持久化对话、按 Agent 筛选、实时事件、取消、重试和继续执行 | +| Trace | 查看 Turn 历史、Core 报告的 Usage、命令输出、Function 和 Patch 活动 | +| Functions 与 MCP | 配置支持的工具、查看调用、提交所需结果并绑定 Vault 凭据 | +| Vaults | 创建项目 Vault,管理只写 MCP Bearer 凭据,Web 不会读回 Token | +| Environments | 默认执行、可选 self-hosted executor 连接和可选 managed Runtime | +| Workspace 与 Files | 在 Core 支持时查看 Environment 文件并管理项目 Source Files | +| System | 查看连接、已暴露能力、Core 所有权边界和本地恢复引导 | + +只有连接的 Core 和 Web 运维配置明确暴露的能力才会显示。Agent 保存成功只代表定义 +已经持久化;实际执行仍依赖 Core 的运行时、模型提供商、凭据和工具连接。 + +## 快速开始 + +### 环境要求 + +- Node.js 22.12+ +- pnpm 10.30.3 +- 一个正在运行的[兼容 Agent Core](#兼容的-core) +- 由 Core 运维方签发的调用方密钥 + +### 启动 Web ```bash git clone https://github.com/MiniMax-AI-Dev/agents-core-web.git cd agents-core-web pnpm install +cp .env.example .env.local pnpm dev ``` -默认本地配置为: - -- Agent Core 位于 `http://127.0.0.1:8091`; -- 浏览器请求通过同源 `/v1` 代理; -- 明文调用方 Bearer 凭据位于 `~/.parsar/agents-api/web-token`,且只由本地 - Vite 服务器读取。 - -打开 Vite 输出的本机回环 URL。连接地址保持为 `/v1`;看到 -**Server-managed Core key active** 时,浏览器 token 输入框应保持为空。 +开发服务器默认使用 `http://127.0.0.1:4173`,并把浏览器请求代理到 +`http://127.0.0.1:8091` 的 Core。 -如需使用其他服务地址或私密调用方凭据文件,请将 `.env.example` 复制为 -`.env.local`,并设置以下可选的服务端变量: +在 `.env.local` 中配置本地代理: ```dotenv AGENTS_API_PROXY_TARGET=http://127.0.0.1:8091 AGENTS_API_PROXY_TOKEN_FILE=/absolute/private/path/to/web-token ``` -Self-hosted Session 创建是默认隐藏的非秘密运维开关。只有已经核对 Codex Core、 -executor registry 和 executor origin 的部署才应启用: +只有本地 Web 服务会读取调用方密钥文件。不要把明文密钥放进 `VITE_*` 变量、URL、 +截图、Agent、Session metadata 或 Git。 -```dotenv -AGENTS_CORE_WEB_SELF_HOSTED_SESSIONS=1 -``` +### 第一个工作流 -该开关只暴露已支持的表单,不会探测 Core 能力,也不能证明 executor、原生运行时、 -模型或提供商已就绪。不得在其中放入 executor key 或其他凭据。 +1. 打开 **Agents**,选择 **Create agent** 或一个入门模板。 +2. 设置名称、模型和指令,只在需要时添加支持的工具。 +3. 选择 **Start Session**,选择 Environment,并可同时发送第一条消息。 +4. 在 **Sessions** 中继续工作,查看实时事件和持久化历史。 +5. 工作流需要时再进入 **Trace**、**Vaults**、**Environment** 或 **System**。 -基础 managed hosted Session 创建使用另一个默认关闭的展示开关。只有 Core 运维方已 -安装并验收固定 Codex Runtime 镜像、配置稳定的默认 managed provider,并接受 Docker -隔离和模型提供商边界后才启用: +## 本地 Core 与 Docker -```dotenv -AGENTS_CORE_WEB_OPENAI_HOSTED_SESSIONS=1 -``` +Web 无法访问本地 Core 时,Dashboard 会打开连接引导,提供两条路径: -该开关同样不会发现 Core 配置,也不能证明 Runtime、原生 harness、模型、提供商、 -Function 或 Tool 已就绪。Core 未配置合格 provider 时仍会拒绝创建。 - -修改后重启 `pnpm dev`。凭据应保留在服务端。只有兼容 Core 通过 CORS -明确允许 Web 的源、方法和请求头时,才能在连接对话框中使用 Core 直连 URL。 - -还没有运行中的 Core?请使用不可变的 -[当前 Parsar 配置指南](https://github.com/MiniMax-AI-Dev/parsar/blob/dadf64a76bde58255281f3b6c3e939f8b556be09/services/agents-api/README.md#standalone-http-service)。 -仓库内的 [Web 连接手册](docs/core-connection.md)固定在同一 revision,并区分普通 -daemon/self-hosted 配置与 managed Docker-hosted 运维 profile。 - -## 第一次使用 - -1. 打开 **Agents**,使用名称、指令(instructions)和 model ID 创建 Agent。 -2. 查看、编辑或删除已保存的 Agent,或打开 **Start Session**;默认不使用 - Environment。 -3. 可以设置标题、输入第一条文本消息,或配置只作用于该 Session - 的有限 whole-field Agent 覆盖。 -4. 在 **Sessions** 中选择 **All Agents** 或一个 root Agent,再选择 Session 并继续对话。 -5. 查看实时 Item、取消正在执行的任务,或回传请求的函数结果。 -6. 打开 **System → Source Files**,按 Core 返回的 ID 上传、查询、下载或删除一个 - project-owned `user_data` 文件。Core 没有 Source Files 列表,Web 也不会在刷新后 - 持久保存该 ID。 - -**Start Session** 接受精确保留的非空文本字符串,或按原顺序排列、仅包含 -`input_text` part 的 user message 数组;不支持图片、附件、非 user role 或其他 -content part。有效输入通过带 `stream:true` 的流式 `POST /v1/agents/sessions` 发送;Web 一边消费创建 SSE,一边对 -Session、Item 和合格 Environment 的持久状态执行协调,并独立启动 Turn 分页读取。 -POST 结束后,Web 把实时更新交接给 `GET .../events`。对 `none` 和 `self_hosted`, -空输入或纯空白输入会被省略并走 JSON `stream:false` 创建路径,因此 Session 以 idle -状态开始。Web 对 `openai_hosted`(包括 idle 创建)固定使用创建 SSE,以便在交接到 -`GET .../events` 前协调 provisioning 事件。可选标题写入 `metadata.title`; -Start Session 不再暴露额外 metadata。额外字符串 metadata 仍可在已有 Session 的 -Actions 中编辑,并须符合固定 Core 限制;其中绝不能放入凭据或秘密。 - -Session 级 Agent 覆盖是有限且按 whole-field 生效的集合:Web 可以替换 `model`、 -设置或清空 `instructions`、替换纯文本配置,将 saved-only 的 `multi_agent`、 -`reasoning` 或 `service_tier` 重置为 Core 默认值,并通过同一套受限的 -Function/HTTP MCP 编辑器继承、清空或完整替换 `tools`。未操作的字段不会发送; -这里没有任意 Agent JSON 编辑器,也不提供 patch 风格的局部 Tool 更新。 -Environment 选项包括无 Environment、单独启用的 `self_hosted` 和单独启用的基础 -`openai_hosted`;effective Agent 含 MCP 时 managed -选项会被阻止,因为 hosted MCP 尚未验收。 - -创建失败后,只有显式发起且请求未变化的重试才会复用内存中的幂等 key。稳定 -request fingerprint 完整覆盖 `agent_id`、存在时的有限 `agent` 覆盖、 -`environment`、精确可选 `input`、规范化 `metadata`、`stream` 和排序后的派生 -`vault_ids`;投影请求发生任何变化都会换 key。Sessions 的 root-Agent 选择器同样在 -服务端生效:每个分页请求都携带相同 `agent_id`,而 **All Agents** 会省略该参数, -不是在浏览器中只筛选已经加载的一页。 - -HTTP MCP 需要静态 Bearer 时,先在 **Vaults** 中为精确 HTTPS 地址创建 Vault 和 -只写 Credential,再在 **Agent → HTTP MCP → Authentication** 中选择它。创建 Session -时 Web 会附加所属 Vault,且永不读回 token。只有连接的 Core 成功暴露完整 Vault -catalog 后才会显示这项能力;catalog 元数据本身不能证明运行时可访问 MCP 服务。 - -启用运维开关后,**Start Session** 还会提供 **Self-hosted**。Workspace 是 executor -主机或容器中的绝对路径,不是浏览器、Web 服务或 daemon 容器的目录。Web 只展示 -Core 返回的 Environment ID、executor origin、连接状态和安全 launcher 模板; -运维方签发的 executor credential 文件始终留在 Web 之外。完整边界见 -[连接 Agent Core](docs/core-connection.md#optional-self-hosted-session-creation)。 - -可单独启用 `AGENTS_CORE_WEB_DOCKER_BACKEND_GUIDE=1`。Dashboard 遇到网关错误时会明确 -提示 Core 后端未就绪。已有容器时,连接面板会根据 `.env.example` 中经过校验的非秘密 -容器名,展示数据库、Core API、daemon 和 loopback 健康检查的可复制命令;首次使用时, -则展示 Core 镜像构建命令以及固定 Parsar 版本的容器和 daemon 初始化文档。Parsar 首次 -初始化仍需要运维方创建独立数据库和凭据,Web 不执行命令、不访问 Docker,也不猜测密钥。 - -对于已核对的本地 loopback 栈,还可以配置 `.env.example` 中默认关闭的 -`AGENTS_CORE_WEB_DOCKER_GUIDE=1` 以及完整的非秘密 `AGENTS_CORE_WEB_DOCKER_*` -参数。连接面板会在原生 launcher 之外提供可复制的 Docker 命令;Web 仍不会读取 -credential 文件或访问 Docker。若 Session 已有排队输入,运行命令可能立即触发付费调用。 - -Source Files 与 Session 是否使用 Environment 无关。对于完整的基础 managed Session, -Core 会自动配置 `openai_hosted` Runtime;Web 展示 managed ID、enabled/disabled 网络 -策略、空 startup-install 元数据、durable/live 状态和显式 `/workspace` 文件列表,绝不 -展示 self-hosted launcher 或调用方连接动作。Session 内联写入和 System 中的 Source-ID -复制只有在精确查询当前 `openai_hosted` resource、确认非 terminal 状态且 -files/plugins/skills 元数据为空后才显示;写入响应丢失时不会重放。Templates、受限域名、 -非空启动安装、hosted MCP、readiness discovery 和其他 hosted engine 仍不可用。 -`self_hosted` Workspace Files 继续只读。Docker 是 Core 的私有 managed Runtime adapter, -不是另一个公开 Environment discriminator。 - -model ID 必须由已连接的执行运行时支持。Core 当前没有模型目录接口, -因此 Web 建议项只是可编辑提示,不代表模型一定可用。成功保存 Agent 只能证明 -配置已持久化,不能证明 daemon、模型或提供商凭据能够实际执行它。 - -## 与 Parsar 的关系 - -```mermaid -flowchart LR - user["User"] --> web["Agents Core Web"] - web -->|"HTTP JSON + SSE"| core["Compatible Agent Core"] - core --> runtime["Execution runtime / daemon"] - runtime --> tools["Models / MCP / tools"] -``` +- **这台电脑已经配置过**:启动已配置的数据库、Core API 和 daemon 容器,验证 + `/healthz`,然后运行 **Test connection**。 +- **这台电脑第一次使用**:构建 Core 镜像,并按照固定 Parsar 版本文档创建数据库、 + 调用方身份、迁移、API 容器和 daemon profile。 + +可使用 [`.env.example`](.env.example) 中的非秘密配置启用本地恢复引导。Web 只展示 +经过校验的命令,不会获得 Docker socket、执行命令、创建凭据或猜测数据库身份。 -[Parsar](https://github.com/MiniMax-AI-Dev/parsar) 负责其独立的 Agents API Core、 -`parsar-daemon` 以及原生 Codex/Claude 执行适配器。本仓库只负责开源 Web 体验和 -`@agents-core-web/agents-client`。浏览器连接的是 Core 协议,绝不会把 daemon -WebSocket 当作 API URL。 +完整步骤参见[连接 Agent Core](docs/core-connection.md)。启动 daemon 可能释放已排队工作 +并产生模型用量,操作前应先检查待处理 Session。 -完整的组件和信任边界参见[架构说明](docs/architecture.md)。 +## 兼容的 Core -## 常见问题 +Agents Core Web 使用[协议覆盖范围](docs/protocol-coverage.md)中经过测试的 +`/v1/agents/**` HTTP 和 SSE 契约。 -| 现象 | 检查内容 | +| Core | 状态 | | --- | --- | -| Web 无法访问 Core | 确认 Core 地址和 `AGENTS_API_PROXY_TARGET`,然后重启 Vite | -| `401 invalid_api_key` | 明文调用方 Bearer 凭据必须与 Core 当前的密钥绑定匹配 | -| `503 execution_unavailable` / `Execution is not enabled` | Core 拒绝执行;请检查其安全错误、运行时和 ownership 状态。worker、executor 或 daemon 可能未配置或已断连,也可能丢失了执行 lease | -| Agent 保存成功但模型运行失败 | 使用已连接运行时支持的 model ID 和提供商凭据 | -| Self-hosted 选项未显示 | 只有核对兼容 Codex Core 与 executor 链路后,设置非秘密 `AGENTS_CORE_WEB_SELF_HOSTED_SESSIONS=1` 并重启或重建 Web | -| Managed hosted 选项未显示 | 只有固定 Core 的 managed Runtime provider 已验收后,设置 `AGENTS_CORE_WEB_OPENAI_HOSTED_SESSIONS=1` 并重启或重建 Web | -| Workspace files 未显示 | 只有已验收当前 Core 的 Files.list、managed Files.create 和 Environment profile 后,设置 `AGENTS_CORE_WEB_ENVIRONMENT_FILES=1` 并重启或重建 Web;self-hosted 使用 Session 返回的实际 `workspace_directory` | - -`/healthz` 只能证明 HTTP 存活,不能证明聊天已就绪。重试结果不确定的请求前, -请先核对 Core 持久状态和当前固定版本的 Parsar 指南;参见 -[连接故障排查手册](docs/core-connection.md#troubleshooting)。 +| [`dadf64a7` 的 Parsar Agents API Core](https://github.com/MiniMax-AI-Dev/parsar/tree/dadf64a76bde58255281f3b6c3e939f8b556be09/services/agents-api) | 主要且经过测试的集成 | +| 实现了已记录子集的其他 Core | 完成契约验收后兼容 | +| OpenAI 托管 Agents API | 不承诺完全兼容 | +| OpenAI Agents SDK、Responses API 或 Parsar daemon WebSocket | 属于不同接口,不能作为 Core 地址直接连接 | + +浏览器只连接 Core。鉴权、持久化 Agent/Session 状态、调度、执行和运行时资源都由 Core +负责;浏览器不会直接连接 daemon 或模型提供商。 ## 文档入口 -- [当前 Parsar Core 配置](https://github.com/MiniMax-AI-Dev/parsar/blob/dadf64a76bde58255281f3b6c3e939f8b556be09/services/agents-api/README.md#standalone-http-service) — 不可变的当前上游指南 -- [Web 连接手册](docs/core-connection.md) — 对齐 `dadf64a7` 的运维和浏览器边界 -- [协议覆盖范围](docs/protocol-coverage.md) — 准确的已支持 API 范围 -- [架构说明](docs/architecture.md) — 所有权、运行时和信任边界 -- [路线图](docs/roadmap.md) — 计划中的 Web 和 Core 集成 -- [Issue 驱动的自迭代](docs/self-iteration.md) — 贡献者自动化约定 +- [连接 Agent Core](docs/core-connection.md) — 本地、远程、Docker、daemon 和 Environment 配置 +- [协议覆盖范围](docs/protocol-coverage.md) — 已测试资源、事件和能力边界 +- [架构说明](docs/architecture.md) — 组件、所有权和信任边界 +- [路线图](docs/roadmap.md) — 计划中的产品和 Core 集成 - [贡献者规范](AGENTS.md) — 仓库范围、安全和质量要求 +README 截图使用隔离的本地 fixture 数据,不包含生产数据,也不能证明模型提供商已经就绪。 + Agents Core Web 采用 [MIT License](LICENSE)。 diff --git a/docs/images/agents.png b/docs/images/agents.png new file mode 100644 index 0000000..fdffb77 Binary files /dev/null and b/docs/images/agents.png differ diff --git a/docs/images/dashboard.png b/docs/images/dashboard.png new file mode 100644 index 0000000..2f1fa21 Binary files /dev/null and b/docs/images/dashboard.png differ diff --git a/docs/images/sessions.png b/docs/images/sessions.png new file mode 100644 index 0000000..7edc88c Binary files /dev/null and b/docs/images/sessions.png differ diff --git a/docs/images/system.png b/docs/images/system.png new file mode 100644 index 0000000..7d1fe40 Binary files /dev/null and b/docs/images/system.png differ