docs: add Chinese README as default, keep English as README.en.md, add local modifications section vs upstream
This commit is contained in:
+826
@@ -0,0 +1,826 @@
|
||||
<h1 align="center" style="font-size: 1.75em;">OpenOPC: Build Your Personal AI-Native Company — Self-Built, Self-Run, Self-Grown</h1>
|
||||
|
||||
<p align="center">
|
||||
<b>English</b> | <a href="README.md">简体中文</a>
|
||||
</p>
|
||||
|
||||
🏗️ **Self-Built** — Fully automated to recruit role-specific AI employees and build the org.
|
||||
|
||||
⚙️ **Self-Run** — Fully automated to assign tasks, drive handoffs, and keep moving toward your goal.
|
||||
|
||||
🌱 **Self-Grown** — Learns from every task, builds organizational memory, always delivers smarter.
|
||||
|
||||
<p align="center">
|
||||
<img alt="Python 3.10+" src="https://img.shields.io/badge/python-3.10%2B-3776AB?style=flat-square&logo=python&logoColor=white">
|
||||
<img alt="Office UI" src="https://img.shields.io/badge/Office%20UI-React%20%2B%20Phaser-14b8a6?style=flat-square">
|
||||
<img alt="CLI and UI" src="https://img.shields.io/badge/interface-CLI%20%2B%20Office%20UI-64748b?style=flat-square">
|
||||
<img alt="License MIT" src="https://img.shields.io/badge/license-MIT-111827?style=flat-square">
|
||||
<a href="https://github.com/HKUDS/.github/blob/main/profile/README.md"><img src="https://img.shields.io/badge/Feishu-Group-E9DBFC?style=flat-square&logo=feishu&logoColor=white" alt="Feishu" /></a>
|
||||
<a href="https://github.com/HKUDS/.github/blob/main/profile/README.md"><img src="https://img.shields.io/badge/WeChat-Group-C5EAB4?style=flat-square&logo=wechat&logoColor=white" alt="WeChat" /></a>
|
||||
</p>
|
||||
|
||||

|
||||
|
||||
## News
|
||||
|
||||
- **Jul 14, 2026 — More resilient company runs:** Company-mode sessions now recover and resume more seamlessly while preserving agent identity, shared role context, delegation, and review progress.
|
||||
- **Jul 13, 2026 — Smoother Office UI:** Faster live updates and chat scrolling improve long-running projects.
|
||||
- **Jul 8, 2026 — Smarter approvals:** Session grants persist, low-risk actions flow automatically, and deferred decisions stay available.
|
||||
|
||||
## Table Of Contents
|
||||
|
||||
- [When To Use OpenOPC](#when-to-use-openopc)
|
||||
- [Demos](#demos)
|
||||
- [How OpenOPC Works](#how-openopc-works)
|
||||
- [Quick Start](#quick-start)
|
||||
- [Office UI Guide](#office-ui-guide)
|
||||
- [CLI Guide](#cli-guide)
|
||||
- [Configuration](#configuration)
|
||||
- [Ecosystem And Sharing](#ecosystem-and-sharing)
|
||||
- [Roadmap](#roadmap)
|
||||
- [Acknowledgements](#acknowledgements)
|
||||
|
||||
## When to Use OpenOPC
|
||||
|
||||
**OpenOPC** covers nine core verticals — from AI development and software engineering to finance, sales, media, e-commerce, and education. Whatever the industry, OpenOPC assembles the right team and delivers end-to-end.
|
||||
|
||||
<table>
|
||||
<tr>
|
||||
<td width="33%" valign="top">
|
||||
<br><strong>🤖 AI Tech & Research</strong>
|
||||
<br><sub>Model training & evaluation, Agent development, LLM apps & AI infrastructure</sub>
|
||||
</td>
|
||||
<td width="33%" valign="top">
|
||||
<br><strong>💻 Software Development</strong>
|
||||
<br><sub>Android apps, SaaS MVPs, websites, mini programs & game development</sub>
|
||||
</td>
|
||||
<td width="33%" valign="top">
|
||||
<br><strong>📈 Financial Investment</strong>
|
||||
<br><sub>Investment memos, market maps, due diligence & IC decision packages</sub>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td valign="top">
|
||||
<strong>🚀 Sales Growth</strong>
|
||||
<br><sub>Outbound sales, deal strategy, proposals & channel expansion</sub>
|
||||
</td>
|
||||
<td valign="top">
|
||||
<strong>🎬 Content & Media</strong>
|
||||
<br><sub>Video production, short-form content, scripts, storyboards & multi-platform cuts</sub>
|
||||
</td>
|
||||
<td valign="top">
|
||||
<strong>🤝 Industry Assistants</strong>
|
||||
<br><sub>Copilots for support, real estate, legal intake, HR onboarding, retail</sub>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td valign="top">
|
||||
<strong>🧾 Accounting & Finance</strong>
|
||||
<br><sub>Bookkeeping, financial reporting, tax compliance, budgeting & risk review</sub>
|
||||
</td>
|
||||
<td valign="top">
|
||||
<strong>🛍️ Brand & E-commerce</strong>
|
||||
<br><sub>Brand planning, product selection, store ops, user growth & retention</sub>
|
||||
</td>
|
||||
<td valign="top">
|
||||
<strong>🎓 Education & Training</strong>
|
||||
<br><sub>Curriculum design, knowledge base, learner management & content production</sub>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
|
||||
## Demos
|
||||
|
||||
<table>
|
||||
<tr>
|
||||
<td width="33%" align="center" valign="top">
|
||||
<a href="https://youtu.be/XqQeTt6XvPQ">
|
||||
<img src="https://img.youtube.com/vi/XqQeTt6XvPQ/maxresdefault.jpg" alt="OpenOPC video production demo" width="100%">
|
||||
</a>
|
||||
<br><br>
|
||||
<strong>🎬 Video Production</strong>
|
||||
</td>
|
||||
<td width="33%" align="center" valign="top">
|
||||
<a href="https://drive.google.com/drive/folders/1T1Nl6CCE-cmbGy6sKrYML7_UnP8XID88?usp=drive_link">
|
||||
<img src="docs/assets/vc-research-package.svg" alt="OpenOPC VC investment research demo" width="100%">
|
||||
</a>
|
||||
<br><br>
|
||||
<strong>📈 Investment Research</strong>
|
||||
</td>
|
||||
<td width="33%" align="center" valign="top">
|
||||
<a href="https://youtu.be/SVc9BvE5ohY">
|
||||
<img src="https://img.youtube.com/vi/SVc9BvE5ohY/maxresdefault.jpg" alt="OpenOPC game prototype demo" width="100%">
|
||||
</a>
|
||||
<br><br>
|
||||
<strong>🎮 Game Prototype</strong>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
|
||||
## How OpenOPC Works
|
||||
|
||||
OpenOPC assembles a AI company around complex, real-world tasks — through three tightly coupled mechanisms: **Self-Built** staffs the organisation, **Self-Run** executes the work, and **Self-Grown** learns from the outcome.
|
||||
|
||||
<p align="center">
|
||||
<img src="docs/assets/video.png" alt="An OpenOPC company: roles, reporting lines, and the employee staffed into each role" width="100%">
|
||||
</p>
|
||||
|
||||
**1. Self-Built — Staffing the Organisation**
|
||||
|
||||
Before any work begins, the right people must be in place. Given a goal, OpenOPC:
|
||||
|
||||
- 🌿 Drafts the org chart — deriving the roles and reporting structure the task demands.
|
||||
- 🎯 Fills each role — a recruiter agent chooses between reusing an existing employee (shaped by prior projects) and onboarding a fresh hire from the talent pool.
|
||||
|
||||
💡 Experienced employees carry accumulated context; fresh hires offer a clean slate when a role demands it.
|
||||
|
||||
**⚙️ 2. Self-Run — Executing the Work**
|
||||
|
||||
With the team assembled, Self-Run orchestrates its members toward a finished deliverable. The central challenge is not raw execution but efficient collaboration under uncertainty, which manifests in two distinct problems.
|
||||
|
||||
🔀 Dynamic collaboration orchestration. Real work cannot be fully planned upfront. OpenOPC addresses this through a work-item state machine, where each item's phase determines:
|
||||
|
||||
- 📋 Its kanban column — where it stands in the workflow.
|
||||
- 👑 Its owner — the role responsible at that phase.
|
||||
- ✅ Its runnability — whether it is ready to proceed.
|
||||
|
||||
A manager decomposes items, assigns, and reviews results — accepting, reworking, or escalating — across five modes: execute, delegate, review, integrate, and rework. Decomposition defines a dependency DAG, so:
|
||||
|
||||
- ⚡ Independent items proceed in parallel.
|
||||
- ⏳ Dependent items wait until prerequisites are resolved.
|
||||
|
||||
🔗 Dependency resolution and rejection propagate as structured phase transitions, eliminating ad-hoc coordination.
|
||||
|
||||
🛡️ Handling blockers surfacing mid-run. Not all obstacles are visible upfront. OpenOPC resolves them at two levels:
|
||||
|
||||
- 💬 Within the team — a blocking message pauses the sender, activating the role best positioned to resolve it.
|
||||
- 📡 Beyond the team — when a blocker exceeds the team's authority, the runtime escalates to the human owner, invoking human judgment precisely when needed.
|
||||
|
||||
🖥️ The kanban and office views render this orchestration in real time.
|
||||
|
||||
**🌱 3. Self-Grown — Learning from the Run**
|
||||
|
||||
Execution generates raw experience; Self-Grown turns it into lasting improvement, guided by two principles.
|
||||
|
||||
🏅 Attributing outcomes to the right roles. Crediting the whole company teaches nothing. Instead, OpenOPC:
|
||||
|
||||
- 🔍 Resolves user feedback into per-employee evaluations.
|
||||
- 🎯 Updates only roles that owned the relevant work items — credit and blame land where they were earned.
|
||||
|
||||
📖 Distilling trajectories into knowledge. Execution traces are too noisy to learn from. OpenOPC therefore:
|
||||
- 💡 Distils each role's tasks into high-signal lessons, stored in its private experience profile.
|
||||
- 📚 Promotes recurring lessons into shared playbooks, which new hires inherit from the outset — compounding organisational knowledge over time.
|
||||
|
||||
<details>
|
||||
<summary><strong>How this maps to the UI</strong></summary>
|
||||
|
||||
- `Org -> Team` edits the company architecture and roles.
|
||||
- `Org -> Employees` hires talent into vacant roles.
|
||||
- `Team Roster -> Deploy` turns a hired employee into a visible office agent.
|
||||
- The Workspace composer selects the Task Mode execution agent.
|
||||
- The role inspector can set runtime policy and preferred external agent for Company Mode roles.
|
||||
- During execution, Workspace `Agents` and the Execution Progress panel show which role is active, which work item it owns, and which execution agent is doing the concrete work.
|
||||
</details>
|
||||
|
||||
## Quick Start
|
||||
|
||||
`uv` is the recommended setup path for OpenOPC. It can install/manage Python, create the project virtualenv, and run commands against that environment without mixing OpenOPC dependencies into your global Python.
|
||||
|
||||
OpenOPC requires Python `>=3.10`; the examples below use Python `3.12`.
|
||||
|
||||
For direct one-off work, OpenOPC also includes Task Mode, a LobeChat-like single-agent workspace using OpenOPC Native, Codex, Claude Code, Cursor, or OpenCode.
|
||||
|
||||
<details open>
|
||||
<summary><strong>Recommended: uv environment setup</strong></summary>
|
||||
|
||||
**macOS**
|
||||
|
||||
```bash
|
||||
# Install uv with Homebrew, or use the official standalone installer.
|
||||
brew install uv
|
||||
# curl -LsSf https://astral.sh/uv/install.sh | sh
|
||||
|
||||
cd /path/to/OpenOPC
|
||||
uv python install 3.12
|
||||
uv venv --python 3.12
|
||||
source .venv/bin/activate
|
||||
```
|
||||
|
||||
**Linux**
|
||||
|
||||
```bash
|
||||
curl -LsSf https://astral.sh/uv/install.sh | sh
|
||||
source "$HOME/.local/bin/env"
|
||||
|
||||
cd /path/to/OpenOPC
|
||||
uv python install 3.12
|
||||
uv venv --python 3.12
|
||||
source .venv/bin/activate
|
||||
```
|
||||
|
||||
**Windows PowerShell**
|
||||
|
||||
```powershell
|
||||
powershell -ExecutionPolicy ByPass -c "irm https://astral.sh/uv/install.ps1 | iex"
|
||||
|
||||
cd C:\path\to\OpenOPC
|
||||
uv python install 3.12
|
||||
uv venv --python 3.12
|
||||
.\.venv\Scripts\Activate.ps1
|
||||
```
|
||||
|
||||
**Windows Command Prompt**
|
||||
|
||||
```bat
|
||||
winget install --id=astral-sh.uv -e
|
||||
:: Or run the standalone installer from cmd:
|
||||
:: powershell -ExecutionPolicy ByPass -c "irm https://astral.sh/uv/install.ps1 | iex"
|
||||
|
||||
cd C:\path\to\OpenOPC
|
||||
uv python install 3.12
|
||||
uv venv --python 3.12
|
||||
.venv\Scripts\activate.bat
|
||||
```
|
||||
</details>
|
||||
|
||||
```bash
|
||||
# Install OpenOPC into the uv-managed environment
|
||||
uv pip install -e .
|
||||
|
||||
# Optional but recommended for browser tools
|
||||
uv run python -m playwright install chromium
|
||||
|
||||
# Initialize local config, memory, skills, projects, and workspace folders
|
||||
uv run opc init
|
||||
|
||||
# Add an API key in .opc/config/llm_config.yaml
|
||||
# or configure the env var named by llm.api_key_env.
|
||||
|
||||
# Launch the browser UI
|
||||
uv run opc ui
|
||||
```
|
||||
|
||||
Open `http://localhost:8765` by default.
|
||||
|
||||
```bash
|
||||
# Interactive CLI
|
||||
uv run opc chat -p demo
|
||||
|
||||
# One-shot task mode
|
||||
uv run opc chat -p demo --mode task --agent codex "Refactor this module and run focused tests"
|
||||
|
||||
# Company mode with the built-in Corporate architecture
|
||||
uv run opc chat -p demo --mode company --company-profile corporate "Plan, implement, review, and document this feature"
|
||||
|
||||
# Non-interactive scripting / CI style usage
|
||||
uv run opc exec -p demo --mode task --agent native --json "Summarize the current repo status"
|
||||
```
|
||||
|
||||
<details>
|
||||
<summary><strong>Install notes</strong></summary>
|
||||
|
||||
- Python: `>=3.10`. Current required dependencies do not all publish Python 3.9-compatible releases.
|
||||
- `uv` is recommended for local development and release testing. If you prefer classic pip, create and activate a Python `>=3.10` virtualenv, then run `python -m pip install -e .`.
|
||||
- If virtualenv activation is blocked, stay unactivated and run commands with `uv run ...`.
|
||||
- See the official [`uv` installation](https://docs.astral.sh/uv/getting-started/installation/) and [Python management](https://docs.astral.sh/uv/guides/install-python/) docs for alternative package managers and managed Python details.
|
||||
- Node.js: `>=18` is needed when the Office UI frontend must be built.
|
||||
- `opc ui` auto-installs missing `aiohttp` / `aiosqlite` and auto-builds the frontend if needed.
|
||||
- If you have not installed external agent CLIs yet, run `opc init --no-external-agent-preflight` to skip the first-run external-agent checks.
|
||||
- Browser tools are native Playwright tools. Install Chromium with `python -m playwright install chromium` before asking agents to browse pages.
|
||||
</details>
|
||||
|
||||
<details>
|
||||
<summary><b>Development setup (build from source)</b></summary>
|
||||
|
||||
```bash
|
||||
python -m pip install -e .
|
||||
python -m pytest
|
||||
|
||||
cd opc/plugins/office_ui/frontend_src
|
||||
npm install
|
||||
npm run typecheck
|
||||
npm run build
|
||||
```
|
||||
|
||||
The frontend build output is served from `opc/plugins/office_ui/frontend_dist/`.
|
||||
</details>
|
||||
|
||||
## Office UI Guide
|
||||
|
||||
<details>
|
||||
<summary><b>Expand the Office UI guide — visual tour, workspace, company mode, kanban, office, org</b></summary>
|
||||
|
||||
Start it with:
|
||||
|
||||
```bash
|
||||
opc ui
|
||||
opc ui --port 9000 --project demo
|
||||
opc ui --rebuild
|
||||
```
|
||||
|
||||
### Visual Tour
|
||||
|
||||
Scroll horizontally to browse the Office UI walkthrough. Each screenshot keeps its short guide text attached.
|
||||
|
||||
<div style="overflow-x:auto; padding:8px 0 18px;">
|
||||
<div style="display:flex; gap:18px; min-width:5520px;">
|
||||
<figure style="flex:0 0 900px; width:900px; margin:0;">
|
||||
<img src="docs/assets/fig1.png" alt="Workspace project, chat, mode, organization, and agent controls" width="900">
|
||||
<figcaption><strong>Workspace And Setup.</strong> Choose or create a project, start <code>New Chat</code>, then select <code>Company</code> or <code>Task</code> plus the matching organization or agent. In Company Mode, pick role employees and execution agents, or let OpenOPC auto-recruit.</figcaption>
|
||||
</figure>
|
||||
<figure style="flex:0 0 900px; width:900px; margin:0;">
|
||||
<img src="docs/assets/fig2.png" alt="Execution Progress panel showing role status and execution records" width="900">
|
||||
<figcaption><strong>Execution Progress.</strong> Track every role's state, then click a role or work item to inspect detailed execution records, tool activity, handoffs, reviews, and runtime metadata.</figcaption>
|
||||
</figure>
|
||||
<figure style="flex:0 0 900px; width:900px; margin:0;">
|
||||
<img src="docs/assets/fig3.png" alt="Kanban board showing agent work items and status" width="900">
|
||||
<figcaption><strong>Kanban.</strong> Supervise each agent's concrete tasks and work items as they move through planning, execution, review, blockers, and completion.</figcaption>
|
||||
</figure>
|
||||
<figure style="flex:0 0 900px; width:900px; margin:0;">
|
||||
<img src="docs/assets/fig4.png" alt="Organization editor for tuning existing organizations and creating new ones" width="900">
|
||||
<figcaption><strong>Org Control.</strong> Tune existing organizations, adjust roles and reporting lines, review runtime policy, or create a new organization.</figcaption>
|
||||
</figure>
|
||||
<figure style="flex:0 0 900px; width:900px; margin:0;">
|
||||
<img src="docs/assets/fig5.png" alt="Talent market for browsing and recruiting employees" width="900">
|
||||
<figcaption><strong>Talent Market.</strong> Browse talent templates, inspect candidate details, and recruit employees into vacant roles when the company needs more capability.</figcaption>
|
||||
</figure>
|
||||
<figure style="flex:0 0 900px; width:900px; margin:0;">
|
||||
<img src="docs/assets/fig6.png" alt="Animated office view showing what each role is doing" width="900">
|
||||
<figcaption><strong>Office View.</strong> Watch the organization as an animated office, with each role/agent showing status, current task, active tool, seat, and runtime activity.</figcaption>
|
||||
</figure>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
The Office UI has three primary pages:
|
||||
|
||||
| Page | What you do there |
|
||||
|---|---|
|
||||
| **Workspace** | Main working surface: session list, kanban board, chat, task details, role progress, comms, and team cockpit. |
|
||||
| **Office** | Visual office map: agents appear as characters, can be selected, moved, assigned to seats, and inspected. |
|
||||
| **Org** | Company architecture: switch corporate/saved orgs, create new organizations, edit roles, hire talent, apply architecture presets, and import/export configs. |
|
||||
|
||||
### Workspace
|
||||
|
||||
The Workspace page is the default screen.
|
||||
|
||||
| Area | What to look for |
|
||||
|---|---|
|
||||
| Left sidebar | Project sessions, activity, unread counts, and new chat creation. |
|
||||
| Center board | Kanban cards. In Task Mode, a card is normally one task-backed chat session. In Company Mode, the board follows the selected runtime session and shows delegated work items. |
|
||||
| Right panel | Context panel with tabs such as `Chat`, `Agents`, `Info`, `Comms`, and `Team`. Collapse, resize, or maximize it while work is running. |
|
||||
| Composer | Send messages, attach files, choose mode, choose company architecture, and in Task Mode choose the execution agent. |
|
||||
|
||||
### Start Work From The UI
|
||||
|
||||
1. Create or select a project from the top project selector.
|
||||
2. In Workspace, click `New Chat`.
|
||||
3. In the composer, choose `Task` or `Company`.
|
||||
4. For Task Mode, choose the agent: `OpenOPC Native`, `Codex`, `Claude Code`, `Cursor`, or `OpenCode`.
|
||||
5. For Company Mode, choose `Corporate` or a saved org architecture.
|
||||
6. Send the brief.
|
||||
|
||||
Once the first message is sent, the mode and task agent are locked for that chat. Use the locked-mode popover to continue in a new chat with a different mode.
|
||||
|
||||
### Company Mode In The UI
|
||||
|
||||
Company Mode turns one brief into a runtime session plus role-owned work items.
|
||||
|
||||
| Tab | What it shows |
|
||||
|---|---|
|
||||
| `Chat` | Parent conversation, final responses, runtime progress cards, checkpoint replies, stop/continue/done controls, and links into work-item execution. |
|
||||
| `Agents` | Role rollup: active/waiting/pending/done roles, current tool, role work items, filters, search, and links to detailed execution progress. |
|
||||
| `Info` | Status, assignees, role identity, employee assignment, selected execution agent, timing, and developer details. |
|
||||
| `Comms` | Role inboxes, unread/read/sent messages, meetings, decisions, and recent communication failures. |
|
||||
| `Team` | Runtime cockpit: teams, seats, approvals, unread communication, run state, and stop controls for the current run. |
|
||||
|
||||
To inspect the detailed workflow for a role, open a company-mode session and click a role/work item in the `Chat` progress card or `Agents` tab. The Execution Progress panel shows each work item, its status, activity sections, tool progress, handoffs, review targets, and execution turn metadata.
|
||||
|
||||
### Kanban
|
||||
|
||||
- Task Mode: the kanban is a project-level board. You can quick-create tasks in `Todo`, start them, and inspect each task from the right panel.
|
||||
- Company Mode: the active board follows the selected runtime session. Cards represent company work items and move from planning/execution/review/done according to backend runtime state.
|
||||
- Manual drag between status columns is intentionally restricted when runtime owns the state. Same-column reorder is supported where applicable.
|
||||
|
||||
### Office
|
||||
|
||||
Use the Office page when you want a visual view of the running team.
|
||||
|
||||
- Click an agent character or row to inspect status, current tool, current task, role, office, and seat.
|
||||
- Use the office/seat controls to move an agent.
|
||||
- Sub-agents can be shown or hidden.
|
||||
- Agents created from employees or templates appear in the office and are persisted in `.opc/ui_state.db`.
|
||||
|
||||
### Org
|
||||
|
||||
The Org page is where company structure becomes runnable.
|
||||
|
||||
| Sub-tab | Purpose |
|
||||
|---|---|
|
||||
| `Team` | View/edit the role graph, table, role inspector, roster, saved org selector, export package flow, and deploy hired employees to the office. |
|
||||
| `Runtime` | Tune runtime teams, seats, final decider, delegation strategy, and runtime policy. Corporate is read-only; saved orgs are editable. |
|
||||
| `Architecture` | Browse built-in architecture presets, preview/apply packages, manage installed packages, and import/export YAML. |
|
||||
| `Employees` | Search talent templates, view details, hire into vacant roles, and staff the company. |
|
||||
|
||||
To create a new company: open `Org`, click `New organization`, enter a name, add at least two members with responsibilities and reporting lines, review, and create. OpenOPC saves it automatically and switches the composer to `Company / <your org>`.
|
||||
|
||||
To recruit: import talent templates first, then open `Org -> Employees`, search a template, click `Hire`, choose a vacant role, and deploy the employee from `Team Roster` if you want it visible in the Office page.
|
||||
|
||||
```bash
|
||||
opc talent import /path/to/agency-agents
|
||||
```
|
||||
|
||||
<details>
|
||||
<summary><strong>Where project files live</strong></summary>
|
||||
|
||||
OpenOPC separates runtime/config state from deliverable workspace files.
|
||||
|
||||
| Path | Meaning |
|
||||
|---|---|
|
||||
| `.opc/config/` | Local config copied from `config/` by `opc init`. |
|
||||
| `.opc/memory/` | Global and project markdown memory. |
|
||||
| `.opc/projects/<project>/` | Project runtime metadata and task stores. |
|
||||
| `.opc/ui_state.db` | Office UI chat, channels, and visual agent state. |
|
||||
| `../OpenOPC_workplace/<project>/` | Default project workplace. Agents should write durable project files here. |
|
||||
| `../OpenOPC_workplace/<project>/.opc-comms/` | Internal company-mode comms mailboxes, meetings, and tool-result scratch space. |
|
||||
|
||||
Set `OPC_HOME=/path/to/opc-home` if you want config and runtime state outside the repo.
|
||||
</details>
|
||||
|
||||
</details>
|
||||
|
||||
## CLI Guide
|
||||
|
||||
<details>
|
||||
<summary><b>Expand the CLI guide — common commands and interactive slash commands</b></summary>
|
||||
|
||||
OpenOPC exposes both high-level natural-language commands and lower-level UI/service commands.
|
||||
|
||||
Conceptually OpenOPC has two execution modes: `task` and `company`. Some lower-level CLI/service commands still expose `org` as a compatibility selector for Company Mode with a saved organization architecture; in the UI this appears as Company plus an architecture choice.
|
||||
|
||||
### Common Commands
|
||||
|
||||
```bash
|
||||
# Chat
|
||||
opc chat
|
||||
opc chat -p demo --mode task --agent native "Inspect the failing tests"
|
||||
opc chat -p demo --mode company --company-profile corporate "Ship this change with review"
|
||||
|
||||
# Scriptable execution
|
||||
opc exec -p demo --mode task --agent codex --stream-json "Run the migration check"
|
||||
opc exec -p demo --mode company --company-profile corporate "Draft the research report"
|
||||
|
||||
# Project lifecycle
|
||||
opc project list
|
||||
opc project create demo
|
||||
opc project switch demo
|
||||
|
||||
# Sessions
|
||||
opc session list -p demo
|
||||
opc session create "New feature" -p demo --mode company
|
||||
opc session send <task_id> "Continue with implementation" -p demo
|
||||
opc session stop <task_id> -p demo
|
||||
opc session continue <task_id> "Proceed after review" -p demo
|
||||
|
||||
# Runtime inspection
|
||||
opc runtime status -p demo
|
||||
opc runtime logs <task_id> -p demo
|
||||
opc work-item list -p demo
|
||||
opc work-item show <work_item_id> -p demo
|
||||
opc comms state <task_id> -p demo
|
||||
|
||||
# Recruitment
|
||||
opc talent import /path/to/agency-agents
|
||||
opc talent hire <template_id> <role_id> -p demo
|
||||
```
|
||||
|
||||
### Interactive Slash Commands
|
||||
|
||||
Run `opc chat`, then use slash commands:
|
||||
|
||||
```text
|
||||
/status
|
||||
/mode task
|
||||
/mode company corporate
|
||||
/agent codex
|
||||
/project switch demo
|
||||
/session list
|
||||
/runtime --full
|
||||
/logs <task_id> --full
|
||||
/comms <task_id> --full
|
||||
/org
|
||||
/talent list
|
||||
/market list
|
||||
```
|
||||
|
||||
See [`docs/cli-chat-slash.md`](docs/cli-chat-slash.md) for the full command table.
|
||||
|
||||
<details>
|
||||
<summary><strong>CLI command groups</strong></summary>
|
||||
|
||||
| Group | Examples |
|
||||
|---|---|
|
||||
| `opc project` | `list`, `show`, `create`, `switch`, `rename`, `delete --yes` |
|
||||
| `opc session` | `list`, `create`, `show`, `config`, `send`, `rename`, `delete --yes`, `stop`, `continue`, `resume`, `complete` |
|
||||
| `opc mode` | `show`, `set task`, `set company --profile corporate`, `set org --org <id>` for a saved-org company run |
|
||||
| `opc kanban` | `view`, `task create`, `task update`, `task move`, `task assign`, `task status`, `task delete --yes` |
|
||||
| `opc agent` | `list`, `create`, `create-from-template`, `import-employee`, `detail`, `move`, `delete --yes` |
|
||||
| `opc org` | `info`, `export`, `import`, `saved list/save/load/delete`, `role add/update/bulk-add/delete`, `policy update`, `strategy update`, `reset --yes` |
|
||||
| `opc talent` | `list`, `employees`, `import`, `hire`, `scan`, `import-selected`, `employee-detail`, `import-agent` |
|
||||
| `opc market` | `presets`, `browse`, `preview`, `apply-preset`, `export`, `install`, `list`, `uninstall --yes` |
|
||||
| `opc runtime` | `status`, `checkpoints`, `logs`, `run` |
|
||||
| `opc channels` | `status`, `login`, `start`, `stop` |
|
||||
|
||||
Most service-style commands accept `--project/-p` and `--json`.
|
||||
|
||||
For saved organization architectures, some CLI/service commands currently use `org` as a compatibility selector even though the conceptual runtime is still Company Mode:
|
||||
|
||||
```bash
|
||||
opc exec -p demo --mode org --org hku_research_lab "Draft the research report"
|
||||
opc session create "Research sprint" -p demo --mode org --org hku_research_lab
|
||||
```
|
||||
</details>
|
||||
|
||||
</details>
|
||||
|
||||
## Configuration
|
||||
|
||||
Run `opc init` once from the repo root. It creates `.opc/`, copies the template config from `config/`, creates memory/skills/log folders, and optionally creates the first project.
|
||||
|
||||
<details>
|
||||
<summary><b>Expand configuration — config files, LLM keys, external agents, channels, browser/MCP, troubleshooting</b></summary>
|
||||
|
||||
| File | Purpose |
|
||||
|---|---|
|
||||
| `.opc/config/llm_config.yaml` | Default model, LiteLLM/OpenRouter-compatible API base, API key, env var indirection, routing, fallback, temperature, token limit. |
|
||||
| `.opc/config/system_config.yaml` | Runtime behavior, browser tools, native runtime, compaction, verification, permissions, sandbox, and safety settings. |
|
||||
| `.opc/config/agent_config.yaml` | External agent command paths, preferred order, model flags, session modes, timeouts, approval modes, and native subagent profiles. |
|
||||
| `.opc/config/channel_config.yaml` | External messaging providers and credentials. Inbound sender lists are deny-by-default. |
|
||||
| `.opc/config/company_corporate_config.yaml` | Built-in corporate company architecture template. |
|
||||
| `.opc/config/company_orgs/org_<id>_config.yaml` | Saved custom company architectures used by Company Mode. |
|
||||
| `.opc/config/org_index.yaml` | Active saved company architecture selector. |
|
||||
|
||||
### LLM Keys
|
||||
|
||||
After `opc init`, edit `.opc/config/llm_config.yaml` in the repo-local OPC home. If you set `OPC_HOME`, edit `$OPC_HOME/config/llm_config.yaml` instead.
|
||||
|
||||
The template leaves secrets empty. Write your key directly into the file:
|
||||
|
||||
```yaml
|
||||
llm:
|
||||
default_model: "openai/gpt-5.4"
|
||||
api_base: "https://openrouter.ai/api/v1"
|
||||
api_key: "sk-or-v1-..." # your OpenRouter (or other provider) API key
|
||||
|
||||
max_tokens: 32768 # max output tokens per request; lower it if your
|
||||
# model's output cap is smaller
|
||||
# context_window: 128000 # total input window. Usually auto-detected via
|
||||
# litellm; unmapped models fall back to 128000.
|
||||
# Uncomment and set only when the fallback is
|
||||
# wrong for your model.
|
||||
```
|
||||
|
||||
Then verify with `opc status`.
|
||||
|
||||
If you prefer not to store the key in the file, leave `api_key` empty and set `api_key_env` to the name of an environment variable that holds it (e.g. `api_key_env: "OPENROUTER_API_KEY"`).
|
||||
|
||||
### Approval & Agent Permissions
|
||||
|
||||
The `autonomy` section of `.opc/config/system_config.yaml` controls how much an agent can do without asking. The key knob is `max_auto_approve_risk` — the highest risk level that can be auto-approved:
|
||||
|
||||
```yaml
|
||||
autonomy:
|
||||
max_auto_approve_risk: medium # low | medium | high | critical
|
||||
allow_native_tool_auto_approval: true
|
||||
tool_first_use_approval: true # first use of each tool always asks
|
||||
```
|
||||
|
||||
Every native tool call is risk-classified before it runs: known destructive commands (`rm -rf`, `drop table`, force-push, …) and sensitive keywords (credentials, deploys, …) are `high`/`critical` and always escalate to a human; allowlisted safe prefixes (`ls`, `git status`, …) are `low`; everything else is `medium` and goes through an LLM review before auto-approval.
|
||||
|
||||
- `medium` (default): balanced — ordinary commands run without prompts; dangerous ones escalate.
|
||||
- `low`: strict — anything not on the safe allowlist asks for approval. Recommended for shared or production machines.
|
||||
- `high`/`critical`: permissive — only for throwaway sandboxes.
|
||||
|
||||
The first time a tool is used you are always prompted (unless the tool is in `tool_approval_exemptions`), and your "Always allow" choices accumulate in a per-project allowlist.
|
||||
|
||||
### External Agents
|
||||
|
||||
Task Mode can explicitly select an execution agent:
|
||||
|
||||
```bash
|
||||
opc chat -p demo --mode task --agent codex "Implement the change"
|
||||
```
|
||||
|
||||
Available values are `native`, `codex`, `claude_code`, `cursor`, and `opencode`. Configure command names, flags, timeouts, session reuse, and approval behavior in `.opc/config/agent_config.yaml`.
|
||||
|
||||
In Company Mode, roles can prefer external agents through their role config or the Org role inspector. A role can use `auto`, `native`, or `external` execution strategy, with an optional preferred external agent.
|
||||
|
||||
### Feishu Connection
|
||||
|
||||
```bash
|
||||
pip install -e .[channels-feishu]
|
||||
opc init
|
||||
opc channels login feishu
|
||||
```
|
||||
|
||||
Edit `.opc/config/channel_config.yaml`:
|
||||
|
||||
```yaml
|
||||
channels:
|
||||
feishu:
|
||||
enabled: true
|
||||
app_id: "cli_xxx"
|
||||
app_secret: "..."
|
||||
encrypt_key: ""
|
||||
verification_token: ""
|
||||
react_emoji: THUMBSUP
|
||||
allow_from:
|
||||
- "ou_xxx"
|
||||
```
|
||||
|
||||
Then:
|
||||
|
||||
```bash
|
||||
opc channels status
|
||||
opc channels start -p demo
|
||||
# or run the long-lived engine + channel runtime:
|
||||
opc run -p demo
|
||||
```
|
||||
|
||||
Feishu uses the `lark-oapi` WebSocket client. `app_id` and `app_secret` are required; `encrypt_key` and `verification_token` are optional unless your tenant/app configuration requires them. Keep `allow_from` explicit; an empty list denies all inbound messages.
|
||||
|
||||
<details>
|
||||
<summary><strong>Other channel providers</strong></summary>
|
||||
|
||||
| Provider | Install extra | Runtime | Required fields |
|
||||
|---|---|---|---|
|
||||
| Telegram | `channels-telegram` | polling | `token` |
|
||||
| Slack | `channels-slack` | socket | `bot_token`, `app_token` |
|
||||
| Discord | `channels-discord` | socket | `token` |
|
||||
| DingTalk | `channels-dingtalk` | socket | `client_id`, `client_secret` |
|
||||
| Email | `channels-email` | polling | IMAP/SMTP fields, `consent_granted` |
|
||||
| Matrix | `channels-matrix` | sync/polling | `homeserver`, `access_token`, `user_id` |
|
||||
| QQ | `channels-qq` | socket | `app_id`, `secret` |
|
||||
| WhatsApp | `channels-whatsapp` | bridge | `bridge_url` |
|
||||
| Mochat | `channels-mochat` | bridge | `base_url`, `claw_token`, `agent_user_id` |
|
||||
|
||||
Useful commands:
|
||||
|
||||
```bash
|
||||
opc channels login slack
|
||||
opc channels status
|
||||
opc channels start -p demo
|
||||
opc channels stop
|
||||
opc run -p demo
|
||||
```
|
||||
|
||||
See [`docs/channels.md`](docs/channels.md) and [`docs/channel-bridges.md`](docs/channel-bridges.md).
|
||||
</details>
|
||||
|
||||
<details>
|
||||
<summary><strong>Browser tools and MCP servers</strong></summary>
|
||||
|
||||
Browser tools:
|
||||
|
||||
```bash
|
||||
python -m playwright install chromium
|
||||
```
|
||||
|
||||
Configure launch behavior in `.opc/config/system_config.yaml`:
|
||||
|
||||
```yaml
|
||||
system:
|
||||
browser:
|
||||
mode: embedded # embedded | chrome | auto
|
||||
headless: true
|
||||
chrome_channel: chrome
|
||||
user_data_dir: ""
|
||||
```
|
||||
|
||||
Native browser tools include `browser_navigate`, `browser_snapshot`, `browser_click`, `browser_type`, `browser_wait_for`, `browser_scroll`, `browser_select_option`, `browser_evaluate`, `browser_take_screenshot`, and `browser_close`.
|
||||
|
||||
MCP servers can be added under `mcp_servers` in `system_config.yaml`. Local servers use stdio commands; remote servers use HTTP/SSE-style URLs. Discovered tools are registered with a server prefix to avoid collisions.
|
||||
</details>
|
||||
|
||||
### Troubleshooting
|
||||
|
||||
<details>
|
||||
<summary><strong>Office UI does not open or looks stale</strong></summary>
|
||||
|
||||
```bash
|
||||
opc ui --rebuild
|
||||
```
|
||||
|
||||
If the browser still shows stale UI state, hard refresh the page. If a previous process died mid-run, restart `opc ui` first so in-memory locks are released.
|
||||
</details>
|
||||
|
||||
<details>
|
||||
<summary><strong>A task appears stuck</strong></summary>
|
||||
|
||||
Start with a server restart and browser hard refresh. If persisted task state is still dirty, use the reset helper:
|
||||
|
||||
```bash
|
||||
python scripts/reset_stuck_task.py --project <project> --session <session_id> --apply
|
||||
python scripts/reset_stuck_task.py --all --apply
|
||||
```
|
||||
</details>
|
||||
|
||||
<details>
|
||||
<summary><strong>External agent is not available</strong></summary>
|
||||
|
||||
Run:
|
||||
|
||||
```bash
|
||||
opc status
|
||||
```
|
||||
|
||||
Check `.opc/config/agent_config.yaml` for command names such as `codex`, `claude`, `cursor-agent`, and `opencode`. Disable or reprioritize agents you do not have installed.
|
||||
</details>
|
||||
|
||||
<details>
|
||||
<summary><strong>Channel provider receives no messages</strong></summary>
|
||||
|
||||
Check:
|
||||
|
||||
- The provider extra is installed, for example `pip install -e .[channels-feishu]`.
|
||||
- The provider is `enabled: true`.
|
||||
- Required credentials are filled.
|
||||
- `allow_from` contains the sender IDs you expect.
|
||||
- `opc channels status` reports the provider as configured and available.
|
||||
</details>
|
||||
|
||||
</details>
|
||||
|
||||
## Ecosystem And Sharing
|
||||
|
||||
Everything OpenOPC builds is yours to keep, reuse, and share — organizations, employees, talent templates, skills, and channels are just files. Import a popular talent library, reuse a team across projects, or package a whole company as a shareable `.opcpkg`.
|
||||
|
||||
```bash
|
||||
# Hire from a talent library (e.g. agency-agents) into a role
|
||||
opc talent import /path/to/agency-agents
|
||||
opc talent hire <template_id> <role_id> -p demo
|
||||
|
||||
# Reuse or share a whole organization
|
||||
opc org export --json > my-org.yaml
|
||||
opc market export --id hku_lab --name "HKU Lab" --output-dir packages
|
||||
opc market install packages/hku_lab.opcpkg
|
||||
```
|
||||
|
||||
<!--
|
||||
## Architecture
|
||||
|
||||
OpenOPC is a coordination runtime, not just an agent launcher — it separates interaction, organization, execution, tools, memory, and observability into seven layers.
|
||||
|
||||
<details>
|
||||
<summary><b>The seven layers</b></summary>
|
||||
|
||||
| Layer | Name | Responsibilities |
|
||||
|---|---|---|
|
||||
| 0 | Interaction | CLI, Office UI, message bus, external channel runtime. |
|
||||
| 1 | Perception & Context | Context loading, routing metadata, context assembly. |
|
||||
| 2 | Organization | Work-item planning, company runtime, comms, escalation, approval, recovery, recruitment. |
|
||||
| 3 | Agent Execution | Native runtime, subagents, external agent adapters, permissions, tool planning. |
|
||||
| 4 | Tools | Shell, file ops, browser, web search, Python execution, git, collaboration tools. |
|
||||
| 5 | Memory & Evolution | Markdown memory, session compaction, preferences, skill library, talent import. |
|
||||
| 6 | Observability | Events, cost tracking, structured logs, UI/runtime snapshots. |
|
||||
</details>
|
||||
|
||||
<details>
|
||||
<summary><b>Core mechanisms</b></summary>
|
||||
|
||||
- **Collaboration** — Company Mode compiles a brief into a work-item graph; each role runs in its own session, with reviewers and final deciders as first-class runtime roles. Roles pause on `AWAITING_PEER`, hand off, meet, and pass review/delivery gates — all mirrored to the UI (chat, transcripts, Agents, Comms, Kanban, Execution Progress).
|
||||
- **Communication** — a file-backed, role-scoped `.opc-comms/` workspace (inboxes, meeting transcripts, shared memory) that can be audited, replayed, and used to wake blocked peers.
|
||||
- **Self-evolution** — runs feed employee experience, reviewer preferences, checklists, and learned skills into `employee_evolution.json`, so the org improves who it assigns and what context each role gets.
|
||||
</details>
|
||||
-->
|
||||
|
||||
## Roadmap
|
||||
|
||||
OpenOPC is moving quickly. The areas below reflect active development priorities — each grounded in real gaps identified during early usage.
|
||||
|
||||
| Area | Planned direction |
|
||||
|---|---|
|
||||
| **Role-level skills** | Role config already carries `skill_refs`, and the Org UI surfaces skill metadata today. The next step is letting users select which skills mount to which roles directly from the Org page — feeding into a broader self-evolving skill ecosystem. |
|
||||
| **Secretary settings** | The secretary will grow into a stronger configuration and memory steward: owning OPC system memory, analysing and comparing projects, and providing guided setup for OpenOPC YAML configuration. |
|
||||
| **Company-mode channels** | External channels will evolve beyond simple chat entrypoints into richer company-mode workflows — with role-aware notifications, structured approvals, and cross-platform collaboration. |
|
||||
| **CLI parity** | The CLI is functional today, but the Office UI remains the more complete surface. Upcoming work targets org editing, company-mode inspection, failure recovery, and long-running runtime control from the terminal. |
|
||||
| **TUI** | A full terminal UI is under consideration once CLI parity matures. The Office UI remains the primary interface in the meantime. |
|
||||
| **Market and presets** | More architecture presets, recruitable talent packs, import/export workflows, and a package marketplace for sharing and discovering community-built components. |
|
||||
| **Runtime polish** | Continued improvements to recovery, checkpointing, execution-progress visibility, and visual documentation — making long company runs more observable and resilient. |
|
||||
|
||||
## Acknowledgements
|
||||
|
||||
OpenOPC is built with gratitude for several open-source projects that helped shape its agent design, skill structure, and talent template ecosystem:
|
||||
|
||||
- [openai/codex](https://github.com/openai/codex/) for inspiring practical coding-agent workflows and execution patterns.
|
||||
- [BloopAI/vibe-kanban](https://github.com/BloopAI/vibe-kanban) for inspiration around kanban-centered agent work management and task visibility.
|
||||
- [msitarzewski/agency-agents](https://github.com/msitarzewski/agency-agents) for the talent-template foundation. All talent templates included in this repository are imported from `agency-agents`.
|
||||
- [HKUDS/nanobot](https://github.com/HKUDS/nanobot) for inspiration around skill-oriented agent design and `SKILL.md`-style organization.
|
||||
- [pixel-agents-hq/pixel-agents](https://github.com/pixel-agents-hq/pixel-agents) for inspiration around the animated pixel-art office visualization of agent activity.
|
||||
|
||||
---
|
||||
|
||||
<p align="center">
|
||||
<em> ❤️ Thanks for visiting ✨ OpenOPC!</em><br><br>
|
||||
<img src="https://visitor-badge.laobi.icu/badge?page_id=HKUDS.OpenOPC&style=for-the-badge&color=00d4ff"
|
||||
alt="Views">
|
||||
</p>
|
||||
-791
@@ -1,791 +0,0 @@
|
||||
<h1 align="center" style="font-size: 1.75em;">OpenOPC:打造你的个人 AI 原生公司 — 自建、自营、自成长</h1>
|
||||
|
||||
<p align="center">
|
||||
<a href="README.md">English</a> | <b>简体中文</b>
|
||||
</p>
|
||||
|
||||
🏗️ **自建(Self-Built)** — 全自动招募各岗位的 AI 员工,搭建组织架构。
|
||||
|
||||
⚙️ **自营(Self-Run)** — 全自动分派任务、驱动交接,持续朝你的目标推进。
|
||||
|
||||
🌱 **自成长(Self-Grown)** — 从每个任务中学习,沉淀组织记忆,交付越来越聪明。
|
||||
|
||||
<p align="center">
|
||||
<img alt="Python 3.10+" src="https://img.shields.io/badge/python-3.10%2B-3776AB?style=flat-square&logo=python&logoColor=white">
|
||||
<img alt="Office UI" src="https://img.shields.io/badge/Office%20UI-React%20%2B%20Phaser-14b8a6?style=flat-square">
|
||||
<img alt="CLI and UI" src="https://img.shields.io/badge/interface-CLI%20%2B%20Office%20UI-64748b?style=flat-square">
|
||||
<img alt="License MIT" src="https://img.shields.io/badge/license-MIT-111827?style=flat-square">
|
||||
<a href="https://github.com/HKUDS/.github/blob/main/profile/README.md"><img src="https://img.shields.io/badge/Feishu-Group-E9DBFC?style=flat-square&logo=feishu&logoColor=white" alt="Feishu" /></a>
|
||||
<a href="https://github.com/HKUDS/.github/blob/main/profile/README.md"><img src="https://img.shields.io/badge/WeChat-Group-C5EAB4?style=flat-square&logo=wechat&logoColor=white" alt="WeChat" /></a>
|
||||
</p>
|
||||
|
||||

|
||||
|
||||
## 目录
|
||||
|
||||
- [何时使用 OpenOPC](#何时使用-openopc)
|
||||
- [演示](#演示)
|
||||
- [OpenOPC 如何工作](#openopc-如何工作)
|
||||
- [快速开始](#快速开始)
|
||||
- [Office UI 指南](#office-ui-指南)
|
||||
- [CLI 指南](#cli-指南)
|
||||
- [配置](#配置)
|
||||
- [生态与分享](#生态与分享)
|
||||
- [路线图](#路线图)
|
||||
- [致谢](#致谢)
|
||||
|
||||
## 何时使用 OpenOPC
|
||||
|
||||
**OpenOPC** 覆盖九大核心垂直领域 — 从 AI 开发、软件工程到金融、销售、媒体、电商与教育。无论哪个行业,OpenOPC 都会组建合适的团队并端到端交付。
|
||||
|
||||
<table>
|
||||
<tr>
|
||||
<td width="33%" valign="top">
|
||||
<br><strong>🤖 AI 技术与研究</strong>
|
||||
<br><sub>模型训练与评估、Agent 开发、LLM 应用与 AI 基础设施</sub>
|
||||
</td>
|
||||
<td width="33%" valign="top">
|
||||
<br><strong>💻 软件开发</strong>
|
||||
<br><sub>Android 应用、SaaS MVP、网站、小程序与游戏开发</sub>
|
||||
</td>
|
||||
<td width="33%" valign="top">
|
||||
<br><strong>📈 金融投资</strong>
|
||||
<br><sub>投资备忘录、市场图谱、尽职调查与投决会材料</sub>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td valign="top">
|
||||
<strong>🚀 销售增长</strong>
|
||||
<br><sub>外呼销售、交易策略、方案书与渠道拓展</sub>
|
||||
</td>
|
||||
<td valign="top">
|
||||
<strong>🎬 内容与媒体</strong>
|
||||
<br><sub>视频制作、短视频内容、脚本、分镜与多平台剪辑</sub>
|
||||
</td>
|
||||
<td valign="top">
|
||||
<strong>🤝 行业助理</strong>
|
||||
<br><sub>客服、房产、法律咨询、HR 入职、零售等场景的 Copilot</sub>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td valign="top">
|
||||
<strong>🧾 会计与财务</strong>
|
||||
<br><sub>记账、财务报告、税务合规、预算与风险审查</sub>
|
||||
</td>
|
||||
<td valign="top">
|
||||
<strong>🛍️ 品牌与电商</strong>
|
||||
<br><sub>品牌规划、选品、店铺运营、用户增长与留存</sub>
|
||||
</td>
|
||||
<td valign="top">
|
||||
<strong>🎓 教育与培训</strong>
|
||||
<br><sub>课程设计、知识库、学员管理与内容生产</sub>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
|
||||
## 演示
|
||||
|
||||
<table>
|
||||
<tr>
|
||||
<td width="33%" align="center" valign="top">
|
||||
<a href="https://youtu.be/XqQeTt6XvPQ">
|
||||
<img src="https://img.youtube.com/vi/XqQeTt6XvPQ/maxresdefault.jpg" alt="OpenOPC 视频制作演示" width="100%">
|
||||
</a>
|
||||
<br><br>
|
||||
<strong>🎬 视频制作</strong>
|
||||
</td>
|
||||
<td width="33%" align="center" valign="top">
|
||||
<a href="https://drive.google.com/drive/folders/1T1Nl6CCE-cmbGy6sKrYML7_UnP8XID88?usp=drive_link">
|
||||
<img src="docs/assets/vc-research-package.svg" alt="OpenOPC VC 投资研究演示" width="100%">
|
||||
</a>
|
||||
<br><br>
|
||||
<strong>📈 投资研究</strong>
|
||||
</td>
|
||||
<td width="33%" align="center" valign="top">
|
||||
<a href="https://youtu.be/SVc9BvE5ohY">
|
||||
<img src="https://img.youtube.com/vi/SVc9BvE5ohY/maxresdefault.jpg" alt="OpenOPC 游戏原型演示" width="100%">
|
||||
</a>
|
||||
<br><br>
|
||||
<strong>🎮 游戏原型</strong>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
|
||||
## OpenOPC 如何工作
|
||||
|
||||
OpenOPC 围绕复杂的真实任务组建一家 AI 公司 — 通过三个紧密耦合的机制:**自建**负责组织配员,**自营**负责执行工作,**自成长**负责从结果中学习。
|
||||
|
||||
<p align="center">
|
||||
<img src="docs/assets/video.png" alt="一家 OpenOPC 公司:角色、汇报关系,以及每个角色配备的员工" width="100%">
|
||||
</p>
|
||||
|
||||
**1. 自建 — 为组织配员**
|
||||
|
||||
在任何工作开始之前,必须先把合适的人放到合适的位置。给定一个目标,OpenOPC 会:
|
||||
|
||||
- 🌿 起草组织架构图 — 从任务需求推导出所需的角色与汇报结构。
|
||||
- 🎯 填补每个角色 — 由招聘 Agent 在「复用现有员工(带着以往项目塑造的经验)」与「从人才池中招募新人」之间做出选择。
|
||||
|
||||
💡 有经验的员工携带积累的上下文;当角色需要时,新员工则提供一张白纸。
|
||||
|
||||
**⚙️ 2. 自营 — 执行工作**
|
||||
|
||||
团队组建完成后,自营机制协调成员产出最终交付物。核心挑战不在于单纯执行,而在于不确定性下的高效协作,具体体现为两个问题。
|
||||
|
||||
🔀 动态协作编排。真实工作无法完全提前规划。OpenOPC 通过工作项状态机来解决,每个工作项所处的阶段决定:
|
||||
|
||||
- 📋 它在看板的哪一列 — 处于工作流的哪个位置。
|
||||
- 👑 它的负责人 — 该阶段由哪个角色负责。
|
||||
- ✅ 它的可执行性 — 是否已经具备推进条件。
|
||||
|
||||
管理者负责拆解工作项、分派并评审结果 — 接受、返工或上报 — 覆盖五种模式:执行(execute)、委派(delegate)、评审(review)、集成(integrate)与返工(rework)。拆解定义了一个依赖 DAG,因此:
|
||||
|
||||
- ⚡ 相互独立的工作项并行推进。
|
||||
- ⏳ 有依赖的工作项等待前置项完成。
|
||||
|
||||
🔗 依赖解除与驳回都作为结构化的阶段转换传播,消除了临时的人为协调。
|
||||
|
||||
🛡️ 处理运行中途出现的阻塞。并非所有障碍都能提前预见。OpenOPC 在两个层面解决:
|
||||
|
||||
- 💬 团队内部 — 一条阻塞消息会暂停发送者,并激活最适合解决该问题的角色。
|
||||
- 📡 团队之外 — 当阻塞超出团队权限时,运行时会上报给人类所有者,在真正需要时引入人类判断。
|
||||
|
||||
🖥️ 看板与办公室视图实时呈现这一编排过程。
|
||||
|
||||
**🌱 3. 自成长 — 从运行中学习**
|
||||
|
||||
执行产生原始经验;自成长把它转化为持久的改进,遵循两条原则。
|
||||
|
||||
🏅 把结果归因到正确的角色。把功劳记给整个公司学不到任何东西。因此 OpenOPC:
|
||||
|
||||
- 🔍 将用户反馈解析为针对每位员工的评估。
|
||||
- 🎯 只更新负责了相关工作项的角色 — 功与过都落到应得之处。
|
||||
|
||||
📖 把执行轨迹提炼为知识。执行轨迹噪声太大,无法直接学习。因此 OpenOPC:
|
||||
- 💡 把每个角色的任务提炼为高信号的经验教训,存入其私有经验档案。
|
||||
- 📚 把反复出现的经验提升为共享的作业手册(playbook),新员工从入职起即可继承 — 让组织知识随时间复利增长。
|
||||
|
||||
<details>
|
||||
<summary><strong>这些机制如何对应到 UI</strong></summary>
|
||||
|
||||
- `Org -> Team` 编辑公司架构与角色。
|
||||
- `Org -> Employees` 为空缺角色招募人才。
|
||||
- `Team Roster -> Deploy` 把已录用的员工变成办公室中可见的 Agent。
|
||||
- Workspace 输入框可选择 Task 模式的执行 Agent。
|
||||
- 角色检查器可为 Company 模式的角色设置运行时策略与偏好的外部 Agent。
|
||||
- 执行期间,Workspace 的 `Agents` 页签与 Execution Progress 面板会显示哪个角色处于活动状态、它负责哪个工作项、以及由哪个执行 Agent 完成具体工作。
|
||||
</details>
|
||||
|
||||
## 快速开始
|
||||
|
||||
推荐使用 `uv` 来安装 OpenOPC。它可以安装/管理 Python、创建项目虚拟环境,并在该环境中运行命令,而不会把 OpenOPC 的依赖混入全局 Python。
|
||||
|
||||
OpenOPC 要求 Python `>=3.10`;下面的示例使用 Python `3.12`。
|
||||
|
||||
对于直接的一次性工作,OpenOPC 还提供 Task 模式 — 一个类 LobeChat 的单 Agent 工作台,可使用 OpenOPC Native、Codex、Claude Code、Cursor 或 OpenCode。
|
||||
|
||||
<details open>
|
||||
<summary><strong>推荐:uv 环境搭建</strong></summary>
|
||||
|
||||
**macOS**
|
||||
|
||||
```bash
|
||||
# 使用 Homebrew 安装 uv,或使用官方独立安装脚本。
|
||||
brew install uv
|
||||
# curl -LsSf https://astral.sh/uv/install.sh | sh
|
||||
|
||||
cd /path/to/OpenOPC
|
||||
uv python install 3.12
|
||||
uv venv --python 3.12
|
||||
source .venv/bin/activate
|
||||
```
|
||||
|
||||
**Linux**
|
||||
|
||||
```bash
|
||||
curl -LsSf https://astral.sh/uv/install.sh | sh
|
||||
source "$HOME/.local/bin/env"
|
||||
|
||||
cd /path/to/OpenOPC
|
||||
uv python install 3.12
|
||||
uv venv --python 3.12
|
||||
source .venv/bin/activate
|
||||
```
|
||||
|
||||
**Windows PowerShell**
|
||||
|
||||
```powershell
|
||||
powershell -ExecutionPolicy ByPass -c "irm https://astral.sh/uv/install.ps1 | iex"
|
||||
|
||||
cd C:\path\to\OpenOPC
|
||||
uv python install 3.12
|
||||
uv venv --python 3.12
|
||||
.\.venv\Scripts\Activate.ps1
|
||||
```
|
||||
|
||||
**Windows 命令提示符**
|
||||
|
||||
```bat
|
||||
winget install --id=astral-sh.uv -e
|
||||
:: 或在 cmd 中运行独立安装脚本:
|
||||
:: powershell -ExecutionPolicy ByPass -c "irm https://astral.sh/uv/install.ps1 | iex"
|
||||
|
||||
cd C:\path\to\OpenOPC
|
||||
uv python install 3.12
|
||||
uv venv --python 3.12
|
||||
.venv\Scripts\activate.bat
|
||||
```
|
||||
</details>
|
||||
|
||||
```bash
|
||||
# 将 OpenOPC 安装到 uv 管理的环境中
|
||||
uv pip install -e .
|
||||
|
||||
# 可选但推荐:安装浏览器工具所需的 Chromium
|
||||
uv run python -m playwright install chromium
|
||||
|
||||
# 初始化本地配置、记忆、技能、项目与工作区目录
|
||||
uv run opc init
|
||||
|
||||
# 在 .opc/config/llm_config.yaml 中填入 API key,
|
||||
# 或配置 llm.api_key_env 指定的环境变量。
|
||||
|
||||
# 启动浏览器 UI
|
||||
uv run opc ui
|
||||
```
|
||||
|
||||
默认打开 `http://localhost:8765`。
|
||||
|
||||
```bash
|
||||
# 交互式 CLI
|
||||
uv run opc chat -p demo
|
||||
|
||||
# 一次性 Task 模式
|
||||
uv run opc chat -p demo --mode task --agent codex "Refactor this module and run focused tests"
|
||||
|
||||
# 使用内置 Corporate 架构的 Company 模式
|
||||
uv run opc chat -p demo --mode company --company-profile corporate "Plan, implement, review, and document this feature"
|
||||
|
||||
# 非交互脚本 / CI 风格用法
|
||||
uv run opc exec -p demo --mode task --agent native --json "Summarize the current repo status"
|
||||
```
|
||||
|
||||
<details>
|
||||
<summary><strong>安装说明</strong></summary>
|
||||
|
||||
- Python:`>=3.10`。当前必需依赖并非全部提供兼容 Python 3.9 的版本。
|
||||
- 本地开发与发布测试推荐使用 `uv`。如果你偏好经典 pip,请创建并激活一个 Python `>=3.10` 的虚拟环境,然后运行 `python -m pip install -e .`。
|
||||
- 如果虚拟环境激活被阻止,可以不激活,直接用 `uv run ...` 运行命令。
|
||||
- 关于其他包管理器与托管 Python 的细节,参见官方 [`uv` 安装文档](https://docs.astral.sh/uv/getting-started/installation/) 与 [Python 管理文档](https://docs.astral.sh/uv/guides/install-python/)。
|
||||
- Node.js:需要构建 Office UI 前端时要求 `>=18`。
|
||||
- `opc ui` 会自动安装缺失的 `aiohttp` / `aiosqlite`,并在需要时自动构建前端。
|
||||
- 如果你尚未安装外部 Agent CLI,运行 `opc init --no-external-agent-preflight` 可跳过首次运行的外部 Agent 检查。
|
||||
- 浏览器工具基于原生 Playwright。在让 Agent 浏览网页之前,先用 `python -m playwright install chromium` 安装 Chromium。
|
||||
</details>
|
||||
|
||||
<details>
|
||||
<summary><b>开发环境搭建(从源码构建)</b></summary>
|
||||
|
||||
```bash
|
||||
python -m pip install -e .
|
||||
python -m pytest
|
||||
|
||||
cd opc/plugins/office_ui/frontend_src
|
||||
npm install
|
||||
npm run typecheck
|
||||
npm run build
|
||||
```
|
||||
|
||||
前端构建产物从 `opc/plugins/office_ui/frontend_dist/` 提供服务。
|
||||
</details>
|
||||
|
||||
## Office UI 指南
|
||||
|
||||
<details>
|
||||
<summary><b>展开 Office UI 指南 — 视觉导览、工作台、Company 模式、看板、办公室、组织</b></summary>
|
||||
|
||||
启动方式:
|
||||
|
||||
```bash
|
||||
opc ui
|
||||
opc ui --port 9000 --project demo
|
||||
opc ui --rebuild
|
||||
```
|
||||
|
||||
### 视觉导览
|
||||
|
||||
横向滚动浏览 Office UI 演示。每张截图都附有简短的说明文字。
|
||||
|
||||
<div style="overflow-x:auto; padding:8px 0 18px;">
|
||||
<div style="display:flex; gap:18px; min-width:5520px;">
|
||||
<figure style="flex:0 0 900px; width:900px; margin:0;">
|
||||
<img src="docs/assets/fig1.png" alt="Workspace 的项目、聊天、模式、组织与 Agent 控件" width="900">
|
||||
<figcaption><strong>工作台与初始设置。</strong>选择或创建项目,点击 <code>New Chat</code>,然后选择 <code>Company</code> 或 <code>Task</code> 以及对应的组织或 Agent。在 Company 模式下,可以指定角色员工与执行 Agent,也可以让 OpenOPC 自动招募。</figcaption>
|
||||
</figure>
|
||||
<figure style="flex:0 0 900px; width:900px; margin:0;">
|
||||
<img src="docs/assets/fig2.png" alt="Execution Progress 面板显示角色状态与执行记录" width="900">
|
||||
<figcaption><strong>执行进度。</strong>跟踪每个角色的状态,点击角色或工作项即可查看详细的执行记录、工具活动、交接、评审与运行时元数据。</figcaption>
|
||||
</figure>
|
||||
<figure style="flex:0 0 900px; width:900px; margin:0;">
|
||||
<img src="docs/assets/fig3.png" alt="看板展示 Agent 的工作项与状态" width="900">
|
||||
<figcaption><strong>看板。</strong>监督每个 Agent 的具体任务与工作项,观察它们在规划、执行、评审、阻塞与完成之间流转。</figcaption>
|
||||
</figure>
|
||||
<figure style="flex:0 0 900px; width:900px; margin:0;">
|
||||
<img src="docs/assets/fig4.png" alt="组织编辑器,可调整现有组织或新建组织" width="900">
|
||||
<figcaption><strong>组织管理。</strong>调整现有组织、修改角色与汇报关系、查看运行时策略,或创建一个新组织。</figcaption>
|
||||
</figure>
|
||||
<figure style="flex:0 0 900px; width:900px; margin:0;">
|
||||
<img src="docs/assets/fig5.png" alt="人才市场,可浏览并招募员工" width="900">
|
||||
<figcaption><strong>人才市场。</strong>浏览人才模板,查看候选人详情,在公司需要更多能力时把员工招募到空缺角色上。</figcaption>
|
||||
</figure>
|
||||
<figure style="flex:0 0 900px; width:900px; margin:0;">
|
||||
<img src="docs/assets/fig6.png" alt="动画办公室视图,展示每个角色正在做什么" width="900">
|
||||
<figcaption><strong>办公室视图。</strong>以动画办公室的形式观察整个组织,每个角色/Agent 都会显示状态、当前任务、正在使用的工具、座位与运行时活动。</figcaption>
|
||||
</figure>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
Office UI 有三个主要页面:
|
||||
|
||||
| 页面 | 在这里做什么 |
|
||||
|---|---|
|
||||
| **Workspace** | 主要工作界面:会话列表、看板、聊天、任务详情、角色进度、通讯与团队驾驶舱。 |
|
||||
| **Office** | 可视化办公室地图:Agent 以角色形象出现,可以选中、移动、分配座位与查看详情。 |
|
||||
| **Org** | 公司架构:切换 Corporate/已保存的组织、创建新组织、编辑角色、招募人才、应用架构预设、导入/导出配置。 |
|
||||
|
||||
### 工作台(Workspace)
|
||||
|
||||
Workspace 页面是默认界面。
|
||||
|
||||
| 区域 | 关注点 |
|
||||
|---|---|
|
||||
| 左侧边栏 | 项目会话、活动、未读计数与新建聊天。 |
|
||||
| 中间看板 | 看板卡片。Task 模式下,一张卡片通常对应一个任务型聊天会话。Company 模式下,看板跟随所选的运行时会话,展示已委派的工作项。 |
|
||||
| 右侧面板 | 上下文面板,包含 `Chat`、`Agents`、`Info`、`Comms`、`Team` 等页签。工作运行期间可以折叠、调整大小或最大化。 |
|
||||
| 输入框 | 发送消息、附加文件、选择模式、选择公司架构;在 Task 模式下选择执行 Agent。 |
|
||||
|
||||
### 从 UI 开始工作
|
||||
|
||||
1. 在顶部项目选择器中创建或选择一个项目。
|
||||
2. 在 Workspace 中点击 `New Chat`。
|
||||
3. 在输入框中选择 `Task` 或 `Company`。
|
||||
4. Task 模式下选择 Agent:`OpenOPC Native`、`Codex`、`Claude Code`、`Cursor` 或 `OpenCode`。
|
||||
5. Company 模式下选择 `Corporate` 或一个已保存的组织架构。
|
||||
6. 发送任务简报。
|
||||
|
||||
第一条消息发出后,该聊天的模式与任务 Agent 即被锁定。若需换用其他模式,可通过锁定模式的弹出提示在新聊天中继续。
|
||||
|
||||
### UI 中的 Company 模式
|
||||
|
||||
Company 模式把一份简报变成一个运行时会话加一组由角色负责的工作项。
|
||||
|
||||
| 页签 | 展示内容 |
|
||||
|---|---|
|
||||
| `Chat` | 父级对话、最终回复、运行时进度卡片、检查点回复、停止/继续/完成控件,以及跳转到工作项执行的链接。 |
|
||||
| `Agents` | 角色汇总:活动/等待/待定/完成的角色、当前工具、角色工作项、筛选、搜索,以及详细执行进度的链接。 |
|
||||
| `Info` | 状态、负责人、角色身份、员工分配、所选执行 Agent、时间信息与开发者详情。 |
|
||||
| `Comms` | 角色收件箱、未读/已读/已发消息、会议、决策与最近的通讯故障。 |
|
||||
| `Team` | 运行时驾驶舱:团队、座位、审批、未读通讯、恢复状态与当前运行的停止控件。 |
|
||||
|
||||
要查看某个角色的详细工作流,打开一个 Company 模式会话,在 `Chat` 进度卡片或 `Agents` 页签中点击角色/工作项。Execution Progress 面板会展示每个工作项及其状态、活动分区、工具进度、交接、评审对象与执行轮次元数据。
|
||||
|
||||
### 看板(Kanban)
|
||||
|
||||
- Task 模式:看板是项目级面板。可以在 `Todo` 中快速创建任务、启动任务,并从右侧面板查看每个任务。
|
||||
- Company 模式:当前面板跟随所选运行时会话。卡片代表公司工作项,按照后端运行时状态在规划/执行/评审/完成之间流转。
|
||||
- 当运行时掌管状态时,跨状态列的手动拖拽会被有意限制。同列内重新排序在适用时是支持的。
|
||||
|
||||
### 办公室(Office)
|
||||
|
||||
当你想以可视化方式查看运行中的团队时,使用 Office 页面。
|
||||
|
||||
- 点击 Agent 角色形象或列表行,查看状态、当前工具、当前任务、角色、办公室与座位。
|
||||
- 使用办公室/座位控件移动 Agent。
|
||||
- 子 Agent 可以显示或隐藏。
|
||||
- 由员工或模板创建的 Agent 会出现在办公室中,并持久化在 `.opc/ui_state.db`。
|
||||
|
||||
### 组织(Org)
|
||||
|
||||
Org 页面是公司结构变得可运行的地方。
|
||||
|
||||
| 子页签 | 用途 |
|
||||
|---|---|
|
||||
| `Team` | 查看/编辑角色图谱、表格、角色检查器、花名册、已保存组织选择器、导出打包流程,并把已录用员工部署到办公室。 |
|
||||
| `Runtime` | 调整运行时团队、座位、最终决策者、委派策略与运行时策略。Corporate 为只读;已保存的组织可编辑。 |
|
||||
| `Architecture` | 浏览内置架构预设、预览/应用包、管理已安装的包、导入/导出 YAML。 |
|
||||
| `Employees` | 搜索人才模板、查看详情、招募到空缺角色、为公司配员。 |
|
||||
|
||||
创建新公司:打开 `Org`,点击 `New organization`,输入名称,添加至少两名带职责与汇报关系的成员,检查并创建。OpenOPC 会自动保存,并把输入框切换为 `Company / <你的组织>`。
|
||||
|
||||
招募:先导入人才模板,然后打开 `Org -> Employees`,搜索模板,点击 `Hire`,选择一个空缺角色;若希望员工出现在 Office 页面,再从 `Team Roster` 部署。
|
||||
|
||||
```bash
|
||||
opc talent import /path/to/agency-agents
|
||||
```
|
||||
|
||||
<details>
|
||||
<summary><strong>项目文件的位置</strong></summary>
|
||||
|
||||
OpenOPC 把运行时/配置状态与交付物工作区文件分开存放。
|
||||
|
||||
| 路径 | 含义 |
|
||||
|---|---|
|
||||
| `.opc/config/` | 由 `opc init` 从 `config/` 复制而来的本地配置。 |
|
||||
| `.opc/memory/` | 全局与项目级 Markdown 记忆。 |
|
||||
| `.opc/projects/<project>/` | 项目运行时元数据与任务存储。 |
|
||||
| `.opc/ui_state.db` | Office UI 的聊天、频道与可视化 Agent 状态。 |
|
||||
| `../OpenOPC_workplace/<project>/` | 默认项目工作区。Agent 应把持久的项目文件写到这里。 |
|
||||
| `../OpenOPC_workplace/<project>/.opc-comms/` | Company 模式内部通讯信箱、会议与工具结果暂存区。 |
|
||||
|
||||
若希望配置与运行时状态放在仓库之外,设置 `OPC_HOME=/path/to/opc-home`。
|
||||
</details>
|
||||
|
||||
</details>
|
||||
|
||||
## CLI 指南
|
||||
|
||||
<details>
|
||||
<summary><b>展开 CLI 指南 — 常用命令与交互式斜杠命令</b></summary>
|
||||
|
||||
OpenOPC 同时提供高层的自然语言命令与更底层的 UI/服务命令。
|
||||
|
||||
概念上 OpenOPC 有两种执行模式:`task` 与 `company`。部分底层 CLI/服务命令仍将 `org` 作为「Company 模式 + 已保存组织架构」的兼容选择器;在 UI 中这表现为 Company 加一个架构选择。
|
||||
|
||||
### 常用命令
|
||||
|
||||
```bash
|
||||
# 聊天
|
||||
opc chat
|
||||
opc chat -p demo --mode task --agent native "Inspect the failing tests"
|
||||
opc chat -p demo --mode company --company-profile corporate "Ship this change with review"
|
||||
|
||||
# 可脚本化执行
|
||||
opc exec -p demo --mode task --agent codex --stream-json "Run the migration check"
|
||||
opc exec -p demo --mode company --company-profile corporate "Draft the research report"
|
||||
|
||||
# 项目生命周期
|
||||
opc project list
|
||||
opc project create demo
|
||||
opc project switch demo
|
||||
|
||||
# 会话
|
||||
opc session list -p demo
|
||||
opc session create "New feature" -p demo --mode company
|
||||
opc session send <task_id> "Continue with implementation" -p demo
|
||||
opc session stop <task_id> -p demo
|
||||
opc session continue <task_id> "Proceed after review" -p demo
|
||||
|
||||
# 运行时检查
|
||||
opc runtime status -p demo
|
||||
opc runtime logs <task_id> -p demo
|
||||
opc work-item list -p demo
|
||||
opc work-item show <work_item_id> -p demo
|
||||
opc comms state <task_id> -p demo
|
||||
|
||||
# 招募
|
||||
opc talent import /path/to/agency-agents
|
||||
opc talent hire <template_id> <role_id> -p demo
|
||||
```
|
||||
|
||||
### 交互式斜杠命令
|
||||
|
||||
运行 `opc chat`,然后使用斜杠命令:
|
||||
|
||||
```text
|
||||
/status
|
||||
/mode task
|
||||
/mode company corporate
|
||||
/agent codex
|
||||
/project switch demo
|
||||
/session list
|
||||
/runtime --full
|
||||
/logs <task_id> --full
|
||||
/comms <task_id> --full
|
||||
/org
|
||||
/talent list
|
||||
/market list
|
||||
```
|
||||
|
||||
完整命令表见 [`docs/cli-chat-slash.md`](docs/cli-chat-slash.md)。
|
||||
|
||||
<details>
|
||||
<summary><strong>CLI 命令分组</strong></summary>
|
||||
|
||||
| 分组 | 示例 |
|
||||
|---|---|
|
||||
| `opc project` | `list`、`show`、`create`、`switch`、`rename`、`delete --yes` |
|
||||
| `opc session` | `list`、`create`、`show`、`config`、`send`、`rename`、`delete --yes`、`stop`、`continue`、`resume`、`complete` |
|
||||
| `opc mode` | `show`、`set task`、`set company --profile corporate`、以及用于已保存组织公司运行的 `set org --org <id>` |
|
||||
| `opc kanban` | `view`、`task create`、`task update`、`task move`、`task assign`、`task status`、`task delete --yes` |
|
||||
| `opc agent` | `list`、`create`、`create-from-template`、`import-employee`、`detail`、`move`、`delete --yes` |
|
||||
| `opc org` | `info`、`export`、`import`、`saved list/save/load/delete`、`role add/update/bulk-add/delete`、`policy update`、`strategy update`、`reset --yes` |
|
||||
| `opc talent` | `list`、`employees`、`import`、`hire`、`scan`、`import-selected`、`employee-detail`、`import-agent` |
|
||||
| `opc market` | `presets`、`browse`、`preview`、`apply-preset`、`export`、`install`、`list`、`uninstall --yes` |
|
||||
| `opc runtime` | `status`、`checkpoints`、`logs`、`run` |
|
||||
| `opc channels` | `status`、`login`、`start`、`stop` |
|
||||
|
||||
大多数服务类命令都支持 `--project/-p` 与 `--json`。
|
||||
|
||||
对于已保存的组织架构,部分 CLI/服务命令目前将 `org` 作为兼容选择器使用,尽管概念上的运行时仍是 Company 模式:
|
||||
|
||||
```bash
|
||||
opc exec -p demo --mode org --org hku_research_lab "Draft the research report"
|
||||
opc session create "Research sprint" -p demo --mode org --org hku_research_lab
|
||||
```
|
||||
</details>
|
||||
|
||||
</details>
|
||||
|
||||
## 配置
|
||||
|
||||
在仓库根目录运行一次 `opc init`。它会创建 `.opc/`、从 `config/` 复制模板配置、创建记忆/技能/日志目录,并可选地创建第一个项目。
|
||||
|
||||
<details>
|
||||
<summary><b>展开配置 — 配置文件、LLM 密钥、外部 Agent、频道、浏览器/MCP、故障排查</b></summary>
|
||||
|
||||
| 文件 | 用途 |
|
||||
|---|---|
|
||||
| `.opc/config/llm_config.yaml` | 默认模型、兼容 LiteLLM/OpenRouter 的 API base、API key、环境变量间接引用、路由、回退、temperature、token 限制。 |
|
||||
| `.opc/config/system_config.yaml` | 运行时行为、浏览器工具、原生运行时、压缩、验证、权限、沙箱与安全设置。 |
|
||||
| `.opc/config/agent_config.yaml` | 外部 Agent 命令路径、优先顺序、模型参数、会话模式、超时、审批模式与原生子 Agent 配置。 |
|
||||
| `.opc/config/channel_config.yaml` | 外部消息提供方与凭据。入站发送者列表默认拒绝。 |
|
||||
| `.opc/config/company_corporate_config.yaml` | 内置 Corporate 公司架构模板。 |
|
||||
| `.opc/config/company_orgs/org_<id>_config.yaml` | Company 模式使用的自定义公司架构。 |
|
||||
| `.opc/config/org_index.yaml` | 当前生效的已保存公司架构选择器。 |
|
||||
|
||||
### LLM 密钥
|
||||
|
||||
运行 `opc init` 后,编辑仓库本地 OPC home 中的 `.opc/config/llm_config.yaml`。如果设置了 `OPC_HOME`,则改为编辑 `$OPC_HOME/config/llm_config.yaml`。
|
||||
|
||||
模板中的密钥留空。直接把 key 写入文件:
|
||||
|
||||
```yaml
|
||||
llm:
|
||||
default_model: "openai/gpt-5.4"
|
||||
api_base: "https://openrouter.ai/api/v1"
|
||||
api_key: "sk-or-v1-..." # 你的 OpenRouter(或其他提供方)API key
|
||||
|
||||
max_tokens: 32768 # 每次请求的最大输出 token;如果你的模型
|
||||
# 输出上限更小,请调低
|
||||
# context_window: 128000 # 总输入窗口。通常由 litellm 自动检测;
|
||||
# 未收录的模型回退为 128000。仅当回退值
|
||||
# 不适合你的模型时才取消注释并设置。
|
||||
```
|
||||
|
||||
然后用 `opc status` 验证。
|
||||
|
||||
如果不想把密钥存在文件里,可以将 `api_key` 留空,并把 `api_key_env` 设置为持有密钥的环境变量名(例如 `api_key_env: "OPENROUTER_API_KEY"`)。
|
||||
|
||||
### 审批与 Agent 权限
|
||||
|
||||
`.opc/config/system_config.yaml` 的 `autonomy` 部分控制 Agent 无需询问即可执行多少操作。关键旋钮是 `max_auto_approve_risk` — 可被自动批准的最高风险等级:
|
||||
|
||||
```yaml
|
||||
autonomy:
|
||||
max_auto_approve_risk: medium # low | medium | high | critical
|
||||
allow_native_tool_auto_approval: true
|
||||
tool_first_use_approval: true # 每个工具首次使用时总是询问
|
||||
```
|
||||
|
||||
每次原生工具调用在运行前都会做风险分级:已知的破坏性命令(`rm -rf`、`drop table`、force-push 等)与敏感关键词(凭据、部署等)为 `high`/`critical`,总是上报给人类;白名单中的安全前缀(`ls`、`git status` 等)为 `low`;其余为 `medium`,在自动批准前会经过 LLM 审查。
|
||||
|
||||
- `medium`(默认):平衡 — 普通命令无提示运行;危险命令上报。
|
||||
- `low`:严格 — 不在安全白名单中的任何操作都需要审批。推荐用于共享或生产机器。
|
||||
- `high`/`critical`:宽松 — 仅用于可随时丢弃的沙箱。
|
||||
|
||||
每个工具首次使用时总会提示(除非该工具在 `tool_approval_exemptions` 中),你的「始终允许」选择会累积到项目级白名单。
|
||||
|
||||
### 外部 Agent
|
||||
|
||||
Task 模式可以显式选择执行 Agent:
|
||||
|
||||
```bash
|
||||
opc chat -p demo --mode task --agent codex "Implement the change"
|
||||
```
|
||||
|
||||
可用值有 `native`、`codex`、`claude_code`、`cursor` 与 `opencode`。在 `.opc/config/agent_config.yaml` 中配置命令名、参数、超时、会话复用与审批行为。
|
||||
|
||||
在 Company 模式下,角色可以通过角色配置或 Org 角色检查器指定偏好的外部 Agent。角色的执行策略可以是 `auto`、`native` 或 `external`,并可选地指定偏好的外部 Agent。
|
||||
|
||||
### 飞书接入
|
||||
|
||||
```bash
|
||||
pip install -e .[channels-feishu]
|
||||
opc init
|
||||
opc channels login feishu
|
||||
```
|
||||
|
||||
编辑 `.opc/config/channel_config.yaml`:
|
||||
|
||||
```yaml
|
||||
channels:
|
||||
feishu:
|
||||
enabled: true
|
||||
app_id: "cli_xxx"
|
||||
app_secret: "..."
|
||||
encrypt_key: ""
|
||||
verification_token: ""
|
||||
react_emoji: THUMBSUP
|
||||
allow_from:
|
||||
- "ou_xxx"
|
||||
```
|
||||
|
||||
然后:
|
||||
|
||||
```bash
|
||||
opc channels status
|
||||
opc channels start -p demo
|
||||
# 或运行常驻引擎 + 频道运行时:
|
||||
opc run -p demo
|
||||
```
|
||||
|
||||
飞书使用 `lark-oapi` WebSocket 客户端。`app_id` 与 `app_secret` 为必填;`encrypt_key` 与 `verification_token` 为可选,除非你的租户/应用配置要求。请保持 `allow_from` 显式配置;空列表会拒绝所有入站消息。
|
||||
|
||||
<details>
|
||||
<summary><strong>其他频道提供方</strong></summary>
|
||||
|
||||
| 提供方 | 安装 extra | 运行方式 | 必填字段 |
|
||||
|---|---|---|---|
|
||||
| Telegram | `channels-telegram` | polling | `token` |
|
||||
| Slack | `channels-slack` | socket | `bot_token`、`app_token` |
|
||||
| Discord | `channels-discord` | socket | `token` |
|
||||
| 钉钉 | `channels-dingtalk` | socket | `client_id`、`client_secret` |
|
||||
| 邮件 | `channels-email` | polling | IMAP/SMTP 字段、`consent_granted` |
|
||||
| Matrix | `channels-matrix` | sync/polling | `homeserver`、`access_token`、`user_id` |
|
||||
| QQ | `channels-qq` | socket | `app_id`、`secret` |
|
||||
| WhatsApp | `channels-whatsapp` | bridge | `bridge_url` |
|
||||
| Mochat | `channels-mochat` | bridge | `base_url`、`claw_token`、`agent_user_id` |
|
||||
|
||||
常用命令:
|
||||
|
||||
```bash
|
||||
opc channels login slack
|
||||
opc channels status
|
||||
opc channels start -p demo
|
||||
opc channels stop
|
||||
opc run -p demo
|
||||
```
|
||||
|
||||
参见 [`docs/channels.md`](docs/channels.md) 与 [`docs/channel-bridges.md`](docs/channel-bridges.md)。
|
||||
</details>
|
||||
|
||||
<details>
|
||||
<summary><strong>浏览器工具与 MCP 服务器</strong></summary>
|
||||
|
||||
浏览器工具:
|
||||
|
||||
```bash
|
||||
python -m playwright install chromium
|
||||
```
|
||||
|
||||
在 `.opc/config/system_config.yaml` 中配置启动行为:
|
||||
|
||||
```yaml
|
||||
system:
|
||||
browser:
|
||||
mode: embedded # embedded | chrome | auto
|
||||
headless: true
|
||||
chrome_channel: chrome
|
||||
user_data_dir: ""
|
||||
```
|
||||
|
||||
原生浏览器工具包括 `browser_navigate`、`browser_snapshot`、`browser_click`、`browser_type`、`browser_wait_for`、`browser_scroll`、`browser_select_option`、`browser_evaluate`、`browser_take_screenshot` 与 `browser_close`。
|
||||
|
||||
MCP 服务器可添加到 `system_config.yaml` 的 `mcp_servers` 下。本地服务器使用 stdio 命令;远程服务器使用 HTTP/SSE 风格的 URL。发现的工具会以服务器前缀注册,避免命名冲突。
|
||||
</details>
|
||||
|
||||
### 故障排查
|
||||
|
||||
<details>
|
||||
<summary><strong>Office UI 无法打开或界面陈旧</strong></summary>
|
||||
|
||||
```bash
|
||||
opc ui --rebuild
|
||||
```
|
||||
|
||||
如果浏览器仍显示陈旧的 UI 状态,强制刷新页面。如果之前的进程在运行中途崩溃,先重启 `opc ui` 以释放内存中的锁。
|
||||
</details>
|
||||
|
||||
<details>
|
||||
<summary><strong>任务看起来卡住了</strong></summary>
|
||||
|
||||
先重启服务器并强制刷新浏览器。如果持久化的任务状态仍然异常,使用重置工具:
|
||||
|
||||
```bash
|
||||
python scripts/reset_stuck_task.py --project <project> --session <session_id> --apply
|
||||
python scripts/reset_stuck_task.py --all --apply
|
||||
```
|
||||
</details>
|
||||
|
||||
<details>
|
||||
<summary><strong>外部 Agent 不可用</strong></summary>
|
||||
|
||||
运行:
|
||||
|
||||
```bash
|
||||
opc status
|
||||
```
|
||||
|
||||
检查 `.opc/config/agent_config.yaml` 中的命令名,例如 `codex`、`claude`、`cursor-agent` 与 `opencode`。禁用或调整你未安装的 Agent 的优先级。
|
||||
</details>
|
||||
|
||||
<details>
|
||||
<summary><strong>频道提供方收不到消息</strong></summary>
|
||||
|
||||
检查:
|
||||
|
||||
- 已安装对应的 extra,例如 `pip install -e .[channels-feishu]`。
|
||||
- 该提供方为 `enabled: true`。
|
||||
- 必填凭据已填写。
|
||||
- `allow_from` 包含你期望的发送者 ID。
|
||||
- `opc channels status` 显示该提供方已配置且可用。
|
||||
</details>
|
||||
|
||||
</details>
|
||||
|
||||
## 生态与分享
|
||||
|
||||
OpenOPC 构建的一切都归你所有,可以保留、复用与分享 — 组织、员工、人才模板、技能与频道都只是文件。你可以导入一个流行的人才库、跨项目复用一个团队,或者把整个公司打包成可分享的 `.opcpkg`。
|
||||
|
||||
```bash
|
||||
# 从人才库(例如 agency-agents)招募到某个角色
|
||||
opc talent import /path/to/agency-agents
|
||||
opc talent hire <template_id> <role_id> -p demo
|
||||
|
||||
# 复用或分享整个组织
|
||||
opc org export --json > my-org.yaml
|
||||
opc market export --id hku_lab --name "HKU Lab" --output-dir packages
|
||||
opc market install packages/hku_lab.opcpkg
|
||||
```
|
||||
|
||||
## 路线图
|
||||
|
||||
OpenOPC 正在快速迭代。以下领域反映当前的开发重点 — 每一项都源自早期使用中发现的真实缺口。
|
||||
|
||||
| 领域 | 计划方向 |
|
||||
|---|---|
|
||||
| **角色级技能** | 角色配置已支持 `skill_refs`,Org UI 目前也展示技能元数据。下一步是让用户直接在 Org 页面选择哪些技能挂载到哪些角色 — 汇入更广泛的自演化技能生态。 |
|
||||
| **秘书设置** | 秘书将成长为更强的配置与记忆管家:负责 OPC 系统记忆、分析与对比项目,并为 OpenOPC YAML 配置提供引导式设置。 |
|
||||
| **Company 模式频道** | 外部频道将从简单的聊天入口演进为更丰富的 Company 模式工作流 — 支持角色感知的通知、结构化审批与跨平台协作。 |
|
||||
| **CLI 对齐** | CLI 目前可用,但 Office UI 仍是更完整的界面。后续工作聚焦于从终端进行组织编辑、Company 模式检查、故障恢复与长时运行时控制。 |
|
||||
| **TUI** | CLI 对齐成熟后将考虑完整的终端 UI。在此期间 Office UI 仍是主要界面。 |
|
||||
| **市场与预设** | 更多架构预设、可招募的人才包、导入/导出工作流,以及用于分享与发现社区组件的包市场。 |
|
||||
| **运行时打磨** | 持续改进恢复、检查点、执行进度可见性与可视化文档 — 让长时间的公司运行更可观察、更有韧性。 |
|
||||
|
||||
## 致谢
|
||||
|
||||
OpenOPC 的 Agent 设计、技能结构与人才模板生态受益于多个开源项目,在此致谢:
|
||||
|
||||
- [openai/codex](https://github.com/openai/codex/) 启发了实用的编码 Agent 工作流与执行模式。
|
||||
- [BloopAI/vibe-kanban](https://github.com/BloopAI/vibe-kanban) 启发了以看板为中心的 Agent 工作管理与任务可见性。
|
||||
- [msitarzewski/agency-agents](https://github.com/msitarzewski/agency-agents) 提供了人才模板的基础。本仓库包含的所有人才模板均导入自 `agency-agents`。
|
||||
- [HKUDS/nanobot](https://github.com/HKUDS/nanobot) 启发了面向技能的 Agent 设计与 `SKILL.md` 风格的组织方式。
|
||||
- [pixel-agents-hq/pixel-agents](https://github.com/pixel-agents-hq/pixel-agents) 启发了以像素动画办公室可视化 Agent 活动的方式。
|
||||
|
||||
---
|
||||
|
||||
<p align="center">
|
||||
<em> ❤️ 感谢访问 ✨ OpenOPC!</em><br><br>
|
||||
<img src="https://visitor-badge.laobi.icu/badge?page_id=HKUDS.OpenOPC&style=for-the-badge&color=00d4ff"
|
||||
alt="Views">
|
||||
</p>
|
||||
Reference in New Issue
Block a user