# local-operator-ui 中文文档

规范地址：https://npmcn.com/package/local-operator-ui/

版本：0\.48\.11
npm 元数据更新时间：2026-11-04T01:47:01.428Z
中文译文更新时间：2026-11-04T02:19:18.793Z
软件包许可：MIT

本文由上游 README 翻译，可能存在偏差，请结合原文核对 API、命令与配置。版权与许可归原作者所有。

原始 npm 页面：https://www.npmjs.com/package/local-operator-ui
原文对照：https://npmcn.com/package/local-operator-ui/?lang=original
项目主页：https://github.com/damianvtran/local-operator-ui#readme
源码仓库：https://github.com/damianvtran/local-operator-ui

## 关键信息（来自 npm 元数据）

- 包体积（解压后）：36.1 MB，187 个文件
- 模块格式：CommonJS
- TypeScript 类型：未声明
- Node.js 要求：\>=22\.13\.1
- 运行依赖：8 个
- peer 依赖：react \>=18\.0\.0，react-dom \>=18\.0\.0
- 首次发布：2025-03-09T04:00:24.156Z
- 最新版本发布：2026-11-04T01:47:01.083Z
- 已发布版本数：427（近 12 个月 351 个）

## 中文简介

AI代理助手的用户界面，通过直观的聊天界面在您的设备上安全地运行Python代码。支持具有内置安全功能的本地和云LLM模型。

## 安装

```sh
npm install local-operator-ui
```

也可以使用：`pnpm add local-operator-ui`、`yarn add local-operator-ui`、`bun add local-operator-ui`

## README

![Shows a black Local Operator Logo in light color mode and a white one in dark color mode.](https://npmcn.com/package/local-operator-ui/resources/local-operator-icon-2-light-clear.png)

# 当地的运营商

_你设备上的人工智能代理助手——他们计划、编写和运行Python，每一步都停留在对话中。_

[![Latest release](https://img.shields.io/github/v/release/damianvtran/local-operator-ui)](https://github.com/damianvtran/local-operator-ui/releases/latest) [![CI status](https://img.shields.io/github/actions/workflow/status/damianvtran/local-operator-ui/ci.yml?branch=main)](https://github.com/damianvtran/local-operator-ui/actions/workflows/ci.yml) [![npm version](https://img.shields.io/npm/v/local-operator-ui)](https://www.npmjs.com/package/local-operator-ui) [![License: MIT](https://img.shields.io/github/license/damianvtran/local-operator-ui)](https://npmcn.com/package/local-operator-ui/LICENSE) ![Platforms: macOS, Windows, and Linux](https://img.shields.io/badge/platform-macOS%20%7C%20Windows%20%7C%20Linux-lightgrey)

  

![The app's chat view: an agent's reply, the run details panel with two subagents running, and their shared to-do list.](https://npmcn.com/package/local-operator-ui/resources/readme/app-shell-chat-light.webp)  
`the app at work` -与一个代理的对话，在它旁边运行的两个子代理，以及它们共享的待办事项列表。

  

**当地的运营商** 通过桌面聊天应用程序，在你自己的机器上运行AI代理助手。你给代理一个目标；它计划工作，在你的设备上写和运行Python，读写文件，并在冒险之前询问。整个运行过程——消息、工具调用、命令和结果——都停留在您面前的对话中。

关于代理环境CLI和服务器后端，请参见 [本地操作员存储库](https://github.com/damianvtran/local-operator)。

[代理端](https://github.com/damianvtran/local-operator) • [网站](https://local-operator.com/) • [例子](https://github.com/damianvtran/local-operator/tree/main/examples/notebooks)

## 开始

### 先决条件

-   **node . js** 22.13.1或更新版本，用于下面的NPM安装路径。 [nvm](https://github.com/nvm-sh/nvm) 是管理Node版本的好方法。桌面安装程序不需要工具链。

### 使用npx运行

```bash
# Download and run in one command
npx local-operator-ui
```

这将运行最新版本并启动应用程序。

### 使用npm安装

```bash
# Install globally
npm install -g local-operator-ui

# Run the application
local-operator-ui
```

### 桌面应用程序

预构建的应用程序在 [下载页面](https://local-operator.com/download) 和 [发布页面](https://github.com/damianvtran/local-operator-ui/releases)：

-   **macOS**：下载 `.dmg` (或 `.zip`)，然后打开它。
-   **窗户**：下载 `.exe` 安装程序，并按照安装提示操作。
-   **Linux**：下载 `.deb`， `.rpm`,或 `.AppImage` 为您的分销。

Local Operator后端与应用程序捆绑在一起，并在首次运行时自动安装。如果你已经安装了本地操作器后端，应用程序会检测它并使用它；默认情况下，它连接到后端API `http://localhost:1111`。

## 它是什么样子的

### 聊天和代理

| 光 | 黑暗 |
| :-: | :-: |
| ![Light theme: a conversation showing tool rows, a blocked risky action, and a question the agent asked.](https://npmcn.com/package/local-operator-ui/resources/readme/chat-trace-light.webp) | ![Dark theme: the same conversation.](https://npmcn.com/package/local-operator-ui/resources/readme/chat-trace-dark.webp) |

`chat` -一个工作代理的工具行，一个被阻止的危险动作，以及它在继续之前问的问题。

### 子代理

| 光 | 黑暗 |
| :-: | :-: |
| ![Light theme: the run details panel, two subagents running with their elapsed time and cost, a third child queued behind the capacity gate, and the shared to-do list.](https://npmcn.com/package/local-operator-ui/resources/readme/subagents-light.webp) | ![Dark theme: the same run details panel.](https://npmcn.com/package/local-operator-ui/resources/readme/subagents-dark.webp) |

`subagents` -两个助手处理一个请求，每个助手都有自己的运行时间、上下文使用和成本，下一个子线程排在容量门后面。

### 团队

| 光 | 黑暗 |
| :-: | :-: |
| ![Light theme: the agents and teams page, with the release-crew roster: its manager agent, members and collaboration instructions.](https://npmcn.com/package/local-operator-ui/resources/readme/teams-light.webp) | ![Dark theme: the same teams page.](https://npmcn.com/package/local-operator-ui/resources/readme/teams-dark.webp) |

`teams` -代理商在经理的领导下分组，有花名册、合作指示和项目简介。

### 对话中的媒体

| 光 | 黑暗 |
| :-: | :-: |
| ![Light theme: a conversation holding a pasted chart and a bar chart the agent plotted, rendered under the tool row that made it.](https://npmcn.com/package/local-operator-ui/resources/readme/media-in-conversation-light.webp) | ![Dark theme: the same conversation.](https://npmcn.com/package/local-operator-ui/resources/readme/media-in-conversation-dark.webp) |

`media` -一个是手工粘贴的图表，另一个是特工绘制的图表，两者都在文字记录中呈现。

### 代理中心

| 光 | 黑暗 |
| :-: | :-: |
| ![Light theme: the agent hub with categories and a grid of community agents.](https://npmcn.com/package/local-operator-ui/resources/readme/agent-hub-light.webp) | ![Dark theme: the agent hub grid.](https://npmcn.com/package/local-operator-ui/resources/readme/agent-hub-dark.webp) |

`agent hub` -社区代理可按类别浏览及下载。

### 日程安排

| 光 | 黑暗 |
| :-: | :-: |
| ![Light theme: the schedules page, listing scheduled wakes with their cadence and run history.](https://npmcn.com/package/local-operator-ui/resources/readme/schedules-light.webp) | ![Dark theme: the schedules page.](https://npmcn.com/package/local-operator-ui/resources/readme/schedules-dark.webp) |

`schedules` -在计时器上唤醒的对话，包括运行的内容和下一次运行的时间。

### 项目

| 光 | 黑暗 |
| :-: | :-: |
| ![Light theme: the projects board with active, paused, and done columns.](https://npmcn.com/package/local-operator-ui/resources/readme/projects-board-light.webp) | ![Dark theme: the projects board.](https://npmcn.com/package/local-operator-ui/resources/readme/projects-board-dark.webp) |

`projects` -工作流程，你和你的代理跟踪跨会议，作为一个板或时间表。

### 外观

| 光 | 黑暗 |
| :-: | :-: |
| ![Light theme: the appearance picker showing the Local Operator themes as swatches.](https://npmcn.com/package/local-operator-ui/resources/readme/appearance-light.webp) | ![Dark theme: the appearance picker.](https://npmcn.com/package/local-operator-ui/resources/readme/appearance-dark.webp) |

`appearance` - 59种颜色的主题与应用程序；默认为Local Operator Dark。

## 特性

-   **与代理商聊天** -实时对话与标记降低渲染代码块和格式化的文本，语法高亮，和每次对话的历史。
-   **代理管理** —创建、更新、删除座席，并配置座席的设置：模型和描述（general）、温度和top\_p （chat）、安全提示和执行权限（security）。
-   **设置** -系统提示配置，API凭据管理和应用程序配置在一个地方。
-   **本地运营商API集成** -应用程序与本地操作后端API对话，并显示长时间运行的操作的实时状态更新。
-   **捆绑后端** 本地操作员后端会在每个平台上首次运行时自动安装检测并使用现有的后端安装。

## 项目结构

代码库是为模块化和代码重用而组织的：

-   `src/renderer/src/shared/`：包含所有共享代码，包括组件、钩子、存储、配置、主题和实用程序。使用 `@shared/` 导入的路径别名。
-   `src/renderer/src/features/`：包含特定于功能的UI代码，按域组织。
-   `src/renderer/src/app.tsx`， `main.tsx`等：电子呈现过程的入口点。
-   `build/`， `resources/`， `scripts/`：构建资产、静态资源和构建脚本。

**进口约定:**

-   使用 `@shared/` 对于共享模块(例如， `import { useAgents } from "@shared/hooks/use-agents"`）.
-   使用 `@features/` 用于特定于功能的模块。
-   构建还解决了旧的别名(`@renderer`， `@components`， `@hooks`等)，用于仍然导入它们的文件。

有关构建或贡献的详细信息，请参阅 [贡献指南](https://npmcn.com/package/local-operator-ui/CONTRIBUTING.md) 和 [BUILD.md](https://npmcn.com/package/local-operator-ui/docs/BUILD.md)。

## 从源构建

如果要从源代码构建应用程序，请参见 [BUILD.md](https://npmcn.com/package/local-operator-ui/docs/BUILD.md) 存档以获取详细说明。

### Python绑定

对于macOS版本，该应用程序直接捆绑了一个独立的Python，而不需要在Homebrew中安装。这种方法:

-   在安装过程中不需要管理员权限
-   保持应用程序自包含
-   离线工作
-   支持使用pip安装Python包

要设置用于开发的独立Python：

```bash
# Run the setup script to download and configure standalone Python
pnpm setup-python-standalone
```

它使用 [python-build-standalone](https://github.com/indygreg/python-build-standalone)，与Datasette Desktop和PyOxidizer使用的方法相同。

有关详细信息，请参见 [PYTHON\_BUNDLING.md](https://npmcn.com/package/local-operator-ui/docs/PYTHON_BUNDLING.md) 文档。

### 代码签名和公证

所有桌面应用程序都经过代码签名和公证，以确保安全和信任：

-   **macOS**：使用Apple Developer ID签署申请，并通过Apple的公证服务进行公证
-   **窗户**：应用程序使用可信代码签名证书进行签名
-   **Linux**虽然代码签名在Linux上不太常见，但包是用完整性检查构建的

有关代码签名和公证过程的详细信息，请参见 [CODE\_SIGNING.md](https://npmcn.com/package/local-operator-ui/docs/CODE_SIGNING.md) 文档。

## 贡献

欢迎投稿！请参阅我们的 [贡献指南](https://npmcn.com/package/local-operator-ui/CONTRIBUTING.md) 有关如何开始开发，代码风格指南和我们的贡献过程的详细信息。

## 故障排除

### 常见问题

#### 应用程序连接到后端失败

-   如果Local Operator后端尚未运行，应用程序将自动安装并启动它
-   如果您有一个现有的后端正在运行 `http://localhost:1111`，应用程序将使用它
-   检查一下 `VITE_LOCAL_OPERATOR_API_URL` 环境变量没有设置为不同的URL。该值自动设置为 `http://localhost:1111` 如果是习俗 `.env` 没有特别说明
-   如果需要禁用后端自动管理，请设置 `VITE_DISABLE_BACKEND_MANAGER` 环境变量to `true`
-   验证UI和后端之间的网络连接

#### 后端安装失败

-   检查应用程序日志中的错误消息
-   对于macOS，该应用程序使用捆绑的Python框架，而不需要Homebrew和pyenv
-   如果在使用捆绑的Python时遇到问题，请参阅 [PYTHON\_BUNDLING.md](https://npmcn.com/package/local-operator-ui/docs/PYTHON_BUNDLING.md) 文档
-   作为备选方案，您可以尝试使用 `pip install local-operator` 然后开始 `local-operator serve`

#### 开发服务器崩溃

-   检查控制台是否有错误消息
-   确保正确安装了所有依赖项
-   尝试清除node\_modules文件夹并重新安装依赖项

#### UI渲染问题

-   检查开发人员工具中的控制台错误
-   确保您使用的是兼容版本的Node.js
-   尝试重新启动开发服务器

#### 窗户自己开到了前面，或者根本就没有跑过

每当应用程序将一个窗口带到前台时，它就会向自己的后端日志(`~/Library/Application Support/Local Operator/logs/backend-service.log` 在macOS;这个 `LOCAL_OPERATOR_LOG_DIR` 环境变量移动它)：

```
[window-raise] trigger=second-instance mode=normal requested=focus pid=9182 cwd=/Users/you/project applied=restore+show+focus
```

`trigger` 被问到的名字： `initial-present` （应用程序启动） `second-instance` （第二次发射共享此配置文件）， `banner-click`， `viewer-focus` 或 `viewer-resume`。 `pid` 和 `cwd`，当他们在那里时，说出要求的过程-如果有东西一直在做，那就是停止。一个没有引发任何问题的运行不会写入任何内容，因此一个从未出现的应用程序根本没有行-尽管正在等待窗口的对话：A `headless` 启动一个没有窗口打开的应用程序 `applied=parked`， `parked=<id>` 而不是加薪，这个对话打开了你给应用程序的下一个窗口。 `mode` 窗口模式是在和下面运行的吗 `applied` 是它实际做的。

第二次发射只能使窗口达到IT要求的程度 `headless` Run永远不会引发它（它仍然可以加载它命名的对话） `inactive` 在没有激活应用程序，也没有将其从Dock中拉出的情况下命令窗口，并且一个没有声明任何内容的启动-你在应用程序已经运行时双击它-仍然出现在前面。

## 得到帮助

如果您遇到此处未涉及的问题，请：

1.  检查 [GitHub的问题](https://github.com/damianvtran/local-operator-ui/issues) 对于类似的问题
2.  如果您的问题尚未报告，则打开一个新问题

## 学分

这里有一些通用的UX风格和交互方式的启发 [deepseek-harness](https://github.com/deepseek-ai/deepseek-harness) （`dsh`）.

## 许可证

本项目在麻省理工学院许可下授权-参见 [许可证](https://npmcn.com/package/local-operator-ui/LICENSE) 文件查看详细信息。它是开源的，因为每个人都应该可以使用AI工具，而你的贡献和反馈有助于实现这一目标。

## 常见问题

### local-operator-ui 是什么？

AI代理助手的用户界面，通过直观的聊天界面在您的设备上安全地运行Python代码。支持具有内置安全功能的本地和云LLM模型。

### 如何安装 local-operator-ui？

在项目目录运行 npm install local-operator-ui，或使用 pnpm add / yarn add / bun add。它还需要宿主项目提供 peer 依赖：react（\>=18\.0\.0）、react-dom（\>=18\.0\.0）。npm 7 及以上与 pnpm 8 及以上默认会自动安装必需的 peer 依赖，Yarn 需要手动安装。它还提供命令行工具 local-operator-ui，可以用 npx local-operator-ui 直接运行。

### local-operator-ui 支持 TypeScript 吗？

该包的 package\.json 没有声明类型入口。需要类型提示时，可以在 npm 上查找社区维护的 @types/local-operator-ui 是否存在。

### local-operator-ui 支持 ESM 还是 CommonJS？

以 CommonJS 形式发布，可以直接 require\(\)；在 ES Module 项目中也可以用 import 引入（Node\.js 会把 module\.exports 作为默认导出）。

### local-operator-ui 需要什么版本的 Node\.js？

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

### local-operator-ui 可以商用吗？

local-operator-ui 使用 MIT 许可。宽松许可：允许商业使用、修改和再分发，通常只需在分发时保留原版权与许可声明。以上为概括，不构成法律意见，请以许可原文为准。

### local-operator-ui 还在维护吗？

最新版本 0\.48\.11 发布于 2026/11/04（今天）；至今共发布 427 个版本，其中过去 12 个月发布了 351 个；首次发布于 2025/03/09。发布频率只是参考信号：功能稳定的工具可能很少需要更新，建议结合源码仓库的 issue 和提交记录判断。

