@datalayer/agent-runtimes

中文文档
1.6.23发布于 2026/11/11TypeScriptES Module构建来源已验证近 30 天下载 2.2万
原始使用文档
文档目录6 节
  1. Install
  2. Run
  3. Features
  4. Examples
  5. Documentation
  6. License

Datalayer

Become a Sponsor

🤖 🚀 Agent Runtimes

Github Actions Status PyPI - Version

Agent Runtimes runs AI agents and serves them over the protocols the agent world speaks. It is a Python server that hosts agents built from agentspecs (Pydantic AI by default), with their MCP tools, skills, code sandbox and guardrails. It is also a set of React components (chat, floating assistant, the Loop workspace) that talk to them. It drives coding agents such as Claude Code as harnesses, behind the Shield. It runs on your machine with your own model keys, or on Datalayer runtimes.

An agent answering in the chat, its code execution shown

Install

pip install agent-runtimes        # Python 3.11 or later: the server and the `loop` CLI
npm install @datalayer/agent-runtimes   # the React components

Run

With a model key in the environment (for example ANTHROPIC_API_KEY, OPENAI_API_KEY or AWS Bedrock credentials):

loop --local -a example-simple

loop starts a local server with the example-simple agent and opens a chat in the terminal. agent-runtimes serve --port 8765 starts the server on its own, for the web components.

The loop CLI: a question, a code execution, the answer

Features

  • The meta-harness. Coding agents run as harnesses, driven over the Agent Client Protocol (ACP): Claude Code, Codex, OpenCode and pi today. The runtime launches the harness, lends it tools through the MCP gateway and writes the skills into its workspace. It serves the harness over every protocol it serves its own agents on. The Shield surrounds it: the pod's egress boundary, the policies and the session's rules, the audit record and the trace. See Harnesses and the Shield.

  • Protocol integrations.

    • Transports to a UI or another agent: AG-UI, the Vercel AI SDK, ACP and A2A (served, and called as a client), with A2UI and MCP-UI for generative UI.
    • Tools: MCP, local servers over stdio and remote servers over Streamable HTTP.
    • Identity, consent and commerce, each a Reactor plugin: Web Bot Auth (with a draft TAP profile), PAP (Personal Agent Protocol), PACT, UCP and the Agentic Commerce Protocol.

    See Protocols.

  • Applications. An Appspec (or a Python app.py) becomes a chat, a widget, a worker or a decision. You run it with loop apps run, deploy it at its own address and embed it in any page with the <datalayer-app> element. See Apps.

  • Tools and code. MCP servers, skills, a code sandbox and Codemode, which calls tools from code. See Programmatic Tools.

  • Controls. Guardrails, tool approvals, budgets, hooks, monitoring and OpenTelemetry. See Identity and Hooks.

  • Sessions, subagents and teams. Sessions you can resume, clone, export and import. Subagents, and teams of agents over A2A. See Sessions and Subagents.

  • Chat UI. React chat components, a floating assistant with its avatar, voice, presence, and the Loop workspace in the browser. See Chat.

  • Agent Nodes. Your own machine registers as a node and is reached from Datalayer. See Agent Nodes.

Examples

npm install && pip install -e .
make examples      # the local server on :8765 and the examples gallery on :3000

Documentation

Everything else is on the documentation site: agent-runtimes.datalayer.tech. It covers the CLI, endpoints, agentspecs, integrations, sessions, plugins and the API references.

License

BSD 3-Clause.

版本与发布记录

@datalayer/agent-runtimes 共发布 245 个版本,首次发布于 2026/01/10;过去 12 个月发布了 245 个版本。最新版本附带 npm provenance 构建来源证明,可追溯到公开的 CI 构建记录。

版本发布日期距今
1.6.23latest2026/11/11今天
1.6.222026/11/11今天
1.6.212026/11/11今天
1.6.192026/11/11今天
1.6.172026/11/11今天
1.6.162026/11/11今天

关于 @datalayer/agent-runtimes 的常见问题

如何安装 @datalayer/agent-runtimes?

在项目目录运行 npm install @datalayer/agent-runtimes,或使用 pnpm add / yarn add / bun add。

@datalayer/agent-runtimes 支持 TypeScript 吗?

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

@datalayer/agent-runtimes 支持 ESM 还是 CommonJS?

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

@datalayer/agent-runtimes 可以商用吗?

@datalayer/agent-runtimes 使用 未声明 许可。package.json 没有声明许可证。没有许可证的代码默认保留全部权利,商用前请联系作者或查看仓库中的 LICENSE 文件。以上为概括,不构成法律意见,请以许可原文为准。

@datalayer/agent-runtimes 的下载量有多少?

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

@datalayer/agent-runtimes 还在维护吗?

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