@anvia/studio

中文文档
1.3.26发布于 2026/11/06MITTypeScriptES Module构建来源已验证近 30 天下载 3240

Studio UI and HTTP runtime for Anvia agents.

原始使用文档
文档目录4 节
  1. Installation
  2. Quick start
  3. What you get
  4. Learn more

@anvia/studio

A local workspace for building and inspecting Anvia agents. Chat with the agents your application actually runs, follow tool calls and traces, and inspect their memory without creating a separate demo implementation.

Installation

pnpm add @anvia/studio @anvia/core @anvia/openai

Quick start

Set OPENAI_API_KEY, start the server, then open localhost:4021/ui/playground.

import { Agent } from "@anvia/core";
import { OpenAIClient } from "@anvia/openai";
import { Studio } from "@anvia/studio";

const openai = new OpenAIClient({ apiKey: process.env.OPENAI_API_KEY! });
const agent = new Agent({
  id: "support",
  name: "Support",
  model: openai.completionModel({ modelId: "gpt-5", api: "responses" }),
  instructions: "Answer support questions clearly.",
});

await new Studio([agent]).serve({ port: 4021 });

What you get

  • Chat playground with model selection, approvals, and saved sessions.
  • Agent teams with member activity and human interactions.
  • Traces, tool and MCP inspectors, memory, and retrieval views.
  • Pipeline execution, history, graphs, and evaluation runs.
  • Knowledge-graph exploration and browser sandbox viewing with human takeover.
  • Optional SQLite session storage and graceful server shutdown.

The knowledge inspector returns HTTP 400 bad_request with message Invalid cursor for invalid static-context cursors or when a dynamic context/tool store raises VectorInspectCursorError.

Session storage is in memory by default; configure SQLite to persist it across restarts. Studio is intended for local development. Add application authentication and authorization when exposing it remotely.

Studio rejects HTTP requests with an untrusted Host or Origin hostname. Loopback hosts are trusted by default, as is an explicitly configured non-wildcard bind hostname. When binding to 0.0.0.0 or ::, set allowedHosts to the hostnames clients use, for example serve({ hostname: "0.0.0.0", allowedHosts: ["studio.lan"] }). This allowlist also applies to Origin hosts; ports are ignored. See the serving guide.

Learn more

版本与发布记录

@anvia/studio 共发布 144 个版本,首次发布于 2026/05/03;过去 12 个月发布了 144 个版本。最新版本附带 npm provenance 构建来源证明,可追溯到公开的 CI 构建记录。

版本发布日期距今
1.3.26latest2026/11/061 天前
1.3.252026/11/061 天前
1.3.242026/11/043 天前
1.3.232026/10/2910 天前
1.3.222026/10/2711 天前
1.3.202026/10/2315 天前

其他发布通道:preview → 0.7.10-preview.20260628T094557.2ab9488,rc → 1.0.0-rc.11。

关于 @anvia/studio 的常见问题

@anvia/studio 是什么?

Studio UI and HTTP runtime for Anvia agents.

如何安装 @anvia/studio?

在项目目录运行 npm install @anvia/studio,或使用 pnpm add / yarn add / bun add。它还需要宿主项目提供 peer 依赖:@anvia/core(^1.18.0)。npm 7 及以上与 pnpm 8 及以上默认会自动安装必需的 peer 依赖,Yarn 需要手动安装。

@anvia/studio 支持 TypeScript 吗?

支持。包内自带 TypeScript 类型声明(package.json 声明了 types 入口),安装后即可获得类型提示,无需再安装 @types 包。

@anvia/studio 支持 ESM 还是 CommonJS?

以 ES Module 形式发布,推荐使用 import 引入。在 CommonJS 项目中,Node.js 20.19+ / 22.12+ 可以直接 require() 不含顶层 await 的 ES Module,更早的版本需要改用动态 import()。

@anvia/studio 需要什么版本的 Node.js?

package.json 的 engines 字段要求 Node.js >=20.12.0。版本不符时 npm 默认只给出警告,开启 engine-strict 后会拒绝安装。

@anvia/studio 可以商用吗?

@anvia/studio 使用 MIT 许可。宽松许可:允许商业使用、修改和再分发,通常只需在分发时保留原版权与许可声明。以上为概括,不构成法律意见,请以许可原文为准。

@anvia/studio 的下载量有多少?

根据 npm 官方下载统计,@anvia/studio 在 2026/10/06 – 2026/11/04 这 30 天内被下载 3,240 次,日均约 108 次。下载量会把 CI 构建、镜像同步和作为其他包依赖的安装一并计入,适合横向比较热度,不能直接等同于使用人数。

@anvia/studio 还在维护吗?

最新版本 1.3.26 发布于 2026/11/06(1 天前);至今共发布 144 个版本,其中过去 12 个月发布了 144 个;首次发布于 2026/05/03。发布频率只是参考信号:功能稳定的工具可能很少需要更新,建议结合源码仓库的 issue 和提交记录判断。