personal-bot 0.2.9 → 0.2.10
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +22 -11
- package/README.zh-CN.md +20 -9
- package/docs/README.md +3 -2
- package/docs/agent-collaboration.md +1 -1
- package/docs/dsh.md +4 -6
- package/docs/file-storage.md +7 -4
- package/docs/history.md +2 -9
- package/docs/installation-design.md +4 -1
- package/docs/model-context.md +4 -4
- package/docs/technical-design.md +11 -9
- package/docs/workspace-configuration.md +55 -0
- package/lib/client.js +28 -3
- package/lib/dsh.js +0 -5
- package/lib/extension/dsh/command.js +14 -10
- package/lib/extension/dsh/history.js +1 -1
- package/lib/extension/dsh/management.d.ts +4 -0
- package/lib/extension/dsh/management.js +20 -5
- package/lib/extension/dsh/workspace.d.ts +7 -1
- package/lib/extension/dsh/workspace.js +68 -1
- package/lib/extension/setup-cli.js +1 -1
- package/lib/integrations/dsh/skills.d.ts +4 -0
- package/lib/integrations/dsh/skills.js +27 -0
- package/lib/model/history.d.ts +1 -0
- package/lib/model/workspace-config.d.ts +9 -0
- package/lib/model/workspace-config.js +1 -0
- package/lib/services/history/history-service.d.ts +1 -2
- package/lib/services/history/history-service.js +27 -40
- package/lib/services/workspace/workspace-config.d.ts +7 -0
- package/lib/services/workspace/workspace-config.js +50 -0
- package/lib/services/workspace/workspace-preparation.d.ts +1 -0
- package/lib/services/workspace/workspace-preparation.js +8 -0
- package/lib/storage/history-files.d.ts +5 -1
- package/lib/storage/history-files.js +68 -15
- package/lib/ui/dsh/management.js +27 -3
- package/npm-shrinkwrap.json +7 -3
- package/package.json +7 -4
- package/python/README.md +2 -2
- package/src/dsh.ts +0 -5
- package/src/extension/command.ts +25 -8
- package/src/extension/dsh/command.ts +13 -8
- package/src/extension/dsh/history.ts +2 -2
- package/src/extension/dsh/management.ts +21 -5
- package/src/extension/dsh/workspace.ts +62 -5
- package/src/extension/events.ts +18 -1
- package/src/extension/lifecycle.ts +9 -2
- package/src/extension/setup-cli.ts +1 -1
- package/src/extension/subagent-entry.ts +4 -1
- package/src/integrations/dsh/skills.ts +30 -0
- package/src/integrations/pi/skills.ts +52 -0
- package/src/model/history.ts +1 -0
- package/src/model/workspace-config.ts +10 -0
- package/src/pbot.ts +2 -3
- package/src/services/history/history-service.ts +15 -25
- package/src/services/workspace/workspace-config.ts +49 -0
- package/src/services/workspace/workspace-preparation.ts +8 -0
- package/src/storage/history-files.ts +53 -15
- package/src/ui/dsh/management.ts +20 -3
- package/docs/dsh.en.md +0 -339
package/README.md
CHANGED
|
@@ -6,6 +6,16 @@ English | [简体中文](README.zh-CN.md)
|
|
|
6
6
|
|
|
7
7
|
Personal Bot provides a workspace-scoped [Pi](https://pi.dev) extension and a native dsh Web integration for organizing materials, project work, research, specialist collaboration, and authorized operations. The model handles analysis and coordination; the plugin adds workspace materials, specialist sessions, history search, and a shared Python environment.
|
|
8
8
|
|
|
9
|
+
## Enable a workspace
|
|
10
|
+
|
|
11
|
+
After installation, open Pi or dsh in the target workspace and run `/pbot init` to initialize and enable it. Pi and dsh share the `.pbot/config.json` created by this command:
|
|
12
|
+
|
|
13
|
+
```json
|
|
14
|
+
{ "enabled": true }
|
|
15
|
+
```
|
|
16
|
+
|
|
17
|
+
A missing file or false leaves Personal Bot inactive, without packaged skills or pbot prompts, and directs the user to `init`. Pi's status bar and the dsh workspace page show the runtime state; `/pbot status` remains available. After manual configuration edits, use `/reload` in Pi or restart dsh. See [workspace configuration](docs/workspace-configuration.md) (Chinese).
|
|
18
|
+
|
|
9
19
|
## Install
|
|
10
20
|
|
|
11
21
|
### Pi setup wizard
|
|
@@ -40,7 +50,7 @@ pi install --local npm:personal-bot
|
|
|
40
50
|
pi
|
|
41
51
|
```
|
|
42
52
|
|
|
43
|
-
`--local` saves the declaration in the project's `.pi/settings.json`.
|
|
53
|
+
`--local` saves the installation declaration in the project's `.pi/settings.json`. Once Pi starts, enter `/pbot init` in chat. A global installation can serve several explicitly enabled workspaces. Manage existing sources with `pi list` or `pi config`, keeping one active source per package.
|
|
44
54
|
|
|
45
55
|
### dsh
|
|
46
56
|
|
|
@@ -54,7 +64,7 @@ dsh plugin --profile pbot add personal-bot@latest
|
|
|
54
64
|
dsh --profile pbot
|
|
55
65
|
```
|
|
56
66
|
|
|
57
|
-
|
|
67
|
+
Select the workspace and a main session in the browser, configure models and authentication, and run `/pbot init` to initialize and enable it. Enter `/pbot` in chat to open management or `/pbot status` to inspect state.
|
|
58
68
|
|
|
59
69
|
For later starts, run `dsh --profile pbot`. Stop active specialists and the server before updating the plugin:
|
|
60
70
|
|
|
@@ -62,7 +72,7 @@ For later starts, run `dsh --profile pbot`. Stop active specialists and the serv
|
|
|
62
72
|
dsh plugin --profile pbot update personal-bot --latest
|
|
63
73
|
```
|
|
64
74
|
|
|
65
|
-
The desktop application installs `personal-bot@latest` through its native Plugins page and uses a separate desktop profile. See the [dsh guide](docs/dsh.
|
|
75
|
+
The desktop application installs `personal-bot@latest` through its native Plugins page and uses a separate desktop profile. See the [dsh guide](docs/dsh.md) (Chinese) for launcher options, updates, and chat commands.
|
|
66
76
|
|
|
67
77
|
### Use from source
|
|
68
78
|
|
|
@@ -74,13 +84,13 @@ npm run build:cli
|
|
|
74
84
|
node bin/pbot.mjs setup
|
|
75
85
|
```
|
|
76
86
|
|
|
77
|
-
To load only the Pi source extension, run `pi install --local /absolute/path/to/personal-bot` from the workspace and keep that source directory and its dependencies available. For dsh, follow the [source installation steps](docs/dsh.
|
|
87
|
+
To load only the Pi source extension, run `pi install --local /absolute/path/to/personal-bot` from the workspace and keep that source directory and its dependencies available. For dsh, follow the [source installation steps](docs/dsh.md#从源码安装) (Chinese).
|
|
78
88
|
|
|
79
89
|
### Optional: Task Conductor
|
|
80
90
|
|
|
81
91
|
Use `task-conductor-plugin` for schedules, recurring workflows, DAGs, and tasks that continue after the host exits. Install the plugin and its service separately, following the [upstream integration guide](https://github.com/realqiyan/task-conductor/blob/master/docs/host-integrations.md).
|
|
82
92
|
|
|
83
|
-
Pi users run `pi install --local npm:task-conductor-plugin` from the workspace, reload, then read `/skill:using-task-conductor`. dsh users follow the [Task Conductor setup](docs/dsh.
|
|
93
|
+
Pi users run `pi install --local npm:task-conductor-plugin` from the workspace, reload, then read `/skill:using-task-conductor`. dsh users follow the [Task Conductor setup](docs/dsh.md#task-conductor) (Chinese) and read `/using-task-conductor` in the main session.
|
|
84
94
|
|
|
85
95
|
Notifications return to the session that submitted the task. Service tasks continue after Pi or dsh closes. Query and stop the current run and future recurrences separately.
|
|
86
96
|
|
|
@@ -91,19 +101,19 @@ Describe the task directly: organize materials, compare findings, delegate a rev
|
|
|
91
101
|
| Command | Purpose |
|
|
92
102
|
| --- | --- |
|
|
93
103
|
| `/pbot` | Open the workspace menu |
|
|
94
|
-
| `/pbot init` |
|
|
95
|
-
| `/pbot status` | Inspect workspace, version, and Python state |
|
|
104
|
+
| `/pbot init` | Enable the workspace and create missing material directories and root `AGENTS.md` |
|
|
105
|
+
| `/pbot status` | Inspect activation, workspace, version, and Python state |
|
|
96
106
|
| `/pbot history [text]` | Search exchanges and summaries, then read originals |
|
|
97
107
|
| `/pbot agents` | Inspect, enter, rename, stop, or send instructions to specialists |
|
|
98
108
|
| `/pbot teams` | Inspect teams and public messages; start rounds, pause, or close |
|
|
99
109
|
| `/pbot python setup` | Retry shared Python preparation |
|
|
100
110
|
| `/reload` | Pi's native command to reload extensions and resources |
|
|
101
111
|
|
|
102
|
-
- **
|
|
112
|
+
- **Initialization and materials:** `/pbot init` creates missing materials and enables the workspace, preserving existing materials and other configuration fields. Pi reloads on first activation; an already running workspace loads a newly created root AGENTS after `/reload`.
|
|
103
113
|
- **Native tools:** Use CLI tools through Bash and MCP through the host's configuration. Add Pi project connections with `pi mcp add --local <server> ...` and inspect their source with `/mcp`. See the [connection skill](resources/skills/provider-connections/SKILL.md).
|
|
104
114
|
- **History:** Pi and dsh query shared workspace archives. Originals are searchable first; after a main interaction, the current model fills pending summaries through additional model calls. New input cancels that work first. See [history](docs/history.md).
|
|
105
115
|
- **Specialists and teams:** Delegate independent work, continue a conversation, or organize ordered discussions and parallel rounds. Pi specialists require tmux; dsh uses native sessions. A running team reserves its members. Pause and drain in-flight work before private tasks. See [specialist collaboration](docs/agent-collaboration.md).
|
|
106
|
-
- **Python:**
|
|
116
|
+
- **Python:** Enabled workspaces share one venv for the current user. Workspace activation prepares it and activates it in the host process. Use `python` or `python3` through Bash. Stop scripts using the environment before dependency updates. See the [Python guide](python/README.md) for paths, troubleshooting, and licenses.
|
|
107
117
|
- **Material maintenance:** Ask the assistant to organize a project, repeat an analysis with its existing definitions, or check a delivery. The [maintenance skill](resources/skills/project-maintenance/SKILL.md) updates current guidance and extracts reusable methods while preserving formal materials, history, and backups.
|
|
108
118
|
|
|
109
119
|
Use `pi --resume` to select the main session explicitly; `pi --continue` can select the most recently active child. Enter managed specialists through `/pbot agents`. Opening a stopped specialist's saved session leaves it idle; use resume with a new instruction to continue work. Keep one writer per running session.
|
|
@@ -112,10 +122,11 @@ Use `pi --resume` to select the main session explicitly; `pi --continue` can sel
|
|
|
112
122
|
|
|
113
123
|
| Location | Purpose |
|
|
114
124
|
| --- | --- |
|
|
125
|
+
| `.pbot/config.json` | Shared Pi/dsh workspace activation and configuration |
|
|
115
126
|
| `AGENTS.md` | Navigation and working agreements |
|
|
116
127
|
| `areas/`, `projects/` | Long-term goals, tasks, conclusions, and deliverables |
|
|
117
128
|
| `knowledge/` | Reusable concepts, methods, and analysis definitions |
|
|
118
|
-
| `.
|
|
129
|
+
| `.pbot/history/` | Pi/dsh exchanges, summaries, and node links |
|
|
119
130
|
| `providers/` | External tool guidance, data definitions, and sources |
|
|
120
131
|
| `scratch/` | Temporary scripts, calculation data, downloads, and environments |
|
|
121
132
|
| `agents/`, `.agents/skills/` | Role additions and workspace skills |
|
|
@@ -124,7 +135,7 @@ Existing layouts and agreements take precedence. Fetch queryable data when neede
|
|
|
124
135
|
|
|
125
136
|
## Updates and operating scope
|
|
126
137
|
|
|
127
|
-
Current release: **0.2.
|
|
138
|
+
Current release: **0.2.10**. Update through the host's native package manager. For a local Pi source, update the checkout, run `npm ci --ignore-scripts` when dependencies change, then reload or restart. Stop active specialists before changing versions. Recreate specialists across compatibility lines; existing materials, history, and backups are preserved.
|
|
128
139
|
|
|
129
140
|
Operations follow the user's request, existing agreements, and required confirmations. Bash, Python, MCP, and extensions use the actual account and credential permissions. Enforce hard limits through read-only credentials, service controls, or restricted environments. Trades, transfers, and ledger changes require authorization for those operations. After cancellation, timeout, or disconnection, query native status before retrying to avoid duplicate execution.
|
|
130
141
|
|
package/README.zh-CN.md
CHANGED
|
@@ -6,6 +6,16 @@
|
|
|
6
6
|
|
|
7
7
|
Personal Bot 提供按工作区加载的 [Pi](https://pi.dev) 扩展和原生 dsh Web 接入,支持资料整理、项目推进、研究分析、专家协作和已授权的业务操作。模型负责分析与协调,插件提供资料目录、专家会话、历史查询和共享 Python 环境。
|
|
8
8
|
|
|
9
|
+
## 工作区启用
|
|
10
|
+
|
|
11
|
+
安装后,从目标工作区打开 Pi 或 dsh,执行 `/pbot init` 初始化并启用。Pi 和 dsh 共用该命令创建的 `.pbot/config.json`:
|
|
12
|
+
|
|
13
|
+
```json
|
|
14
|
+
{ "enabled": true }
|
|
15
|
+
```
|
|
16
|
+
|
|
17
|
+
文件缺失或设为 false 时,Personal Bot 保持未启用,不加载包内技能和提示词,并引导执行 `init`。Pi 状态栏和 dsh 工作区页显示启动状态;`/pbot status` 随时可用。手工修改配置后,Pi 执行 `/reload`,dsh 重启宿主。规则见[工作区配置](docs/workspace-configuration.md)。
|
|
18
|
+
|
|
9
19
|
## 安装
|
|
10
20
|
|
|
11
21
|
### Pi 安装向导
|
|
@@ -40,7 +50,7 @@ pi install --local npm:personal-bot
|
|
|
40
50
|
pi
|
|
41
51
|
```
|
|
42
52
|
|
|
43
|
-
`--local`
|
|
53
|
+
`--local` 将安装声明保存在项目 `.pi/settings.json`。启动后在聊天框执行 `/pbot init`。全局安装可让同一份扩展服务多个显式启用的工作区。已有来源通过 `pi list` 或 `pi config` 管理,同一包保留一个有效来源。
|
|
44
54
|
|
|
45
55
|
### dsh
|
|
46
56
|
|
|
@@ -54,7 +64,7 @@ dsh plugin --profile pbot add personal-bot@latest
|
|
|
54
64
|
dsh --profile pbot
|
|
55
65
|
```
|
|
56
66
|
|
|
57
|
-
|
|
67
|
+
在浏览器中选择工作区和主会话,配置模型与认证,执行 `/pbot init` 初始化并启用。聊天输入框的 `/pbot` 打开管理界面,`/pbot status` 查看状态。
|
|
58
68
|
|
|
59
69
|
以后直接运行 `dsh --profile pbot`。停止活动专家和服务后更新插件:
|
|
60
70
|
|
|
@@ -62,7 +72,7 @@ dsh --profile pbot
|
|
|
62
72
|
dsh plugin --profile pbot update personal-bot --latest
|
|
63
73
|
```
|
|
64
74
|
|
|
65
|
-
桌面应用通过原生“插件”页面安装 `personal-bot@latest`,使用独立的 desktop profile。完整终端参数、更新步骤与聊天命令见 [dsh 指南](docs/dsh.md)
|
|
75
|
+
桌面应用通过原生“插件”页面安装 `personal-bot@latest`,使用独立的 desktop profile。完整终端参数、更新步骤与聊天命令见 [dsh 指南](docs/dsh.md)。
|
|
66
76
|
|
|
67
77
|
### 从源码使用
|
|
68
78
|
|
|
@@ -91,19 +101,19 @@ Pi 用户从工作区运行 `pi install --local npm:task-conductor-plugin`,重
|
|
|
91
101
|
| 命令 | 用途 |
|
|
92
102
|
| --- | --- |
|
|
93
103
|
| `/pbot` | 打开工作区菜单 |
|
|
94
|
-
| `/pbot init` |
|
|
95
|
-
| `/pbot status` |
|
|
104
|
+
| `/pbot init` | 启用工作区,补建资料目录与缺失的根 `AGENTS.md` |
|
|
105
|
+
| `/pbot status` | 查看启用状态、工作区、版本和 Python 状态 |
|
|
96
106
|
| `/pbot history [关键词]` | 搜索历史问答与摘要,展开原文 |
|
|
97
107
|
| `/pbot agents` | 查看、进入、重命名、停止专家,或补充要求 |
|
|
98
108
|
| `/pbot teams` | 查看团队与公共消息,开始轮次、暂停或关闭 |
|
|
99
109
|
| `/pbot python setup` | 重试共享 Python 环境准备 |
|
|
100
110
|
| `/reload` | Pi 原生命令,重载扩展与资源 |
|
|
101
111
|
|
|
102
|
-
-
|
|
112
|
+
- **初始化与资料准备**:`/pbot init` 补建资料并启用工作区,保留已有资料与其他配置字段。Pi 首次启用时自动重载;已启动时补建的根 AGENTS 经 `/reload` 加载。
|
|
103
113
|
- **原生工具**:CLI 通过 Bash 使用,MCP 使用宿主配置。Pi 新增项目连接时执行 `pi mcp add --local <server> ...`,通过 `/mcp` 查看来源。接入方法见[技能](resources/skills/provider-connections/SKILL.md)。
|
|
104
114
|
- **历史回溯**:Pi 与 dsh 共同查询工作区归档。原文先可查询,主交互结束后用当前模型补齐摘要,会产生额外模型调用;新输入优先取消整理。详见[历史对话](docs/history.md)。
|
|
105
115
|
- **专家与团队**:可独立委派、持续对话,或组织轮流讨论和并行轮次。Pi 专家需要 tmux;dsh 使用原生会话。团队运行时占用成员,切换私人工作前先暂停并等待在途工作结束。详见[专家协作](docs/agent-collaboration.md)。
|
|
106
|
-
- **Python
|
|
116
|
+
- **Python**:所有已启用工作区共用当前用户的一份 venv,启用后自动准备并在宿主进程激活,通过 Bash 使用 `python` 或 `python3`。更新依赖前停止使用该环境的脚本。路径、排障与许可见 [Python 说明](python/README.md)。
|
|
107
117
|
- **资料维护**:可请助手整理项目、按既有口径重做分析或检查交付。按[维护技能](resources/skills/project-maintenance/SKILL.md)更新当前说明、提炼方法,保留正式资料、历史与备份。
|
|
108
118
|
|
|
109
119
|
Pi 主会话恢复用 `pi --resume` 明确选择;`pi --continue` 可能选中最近活跃的子会话。受管专家从 `/pbot agents` 进入,停止后打开原会话会保持待命,携新要求继续时使用 resume。运行中的会话只保留一个写入进程。
|
|
@@ -112,10 +122,11 @@ Pi 主会话恢复用 `pi --resume` 明确选择;`pi --continue` 可能选中
|
|
|
112
122
|
|
|
113
123
|
| 位置 | 用途 |
|
|
114
124
|
| --- | --- |
|
|
125
|
+
| `.pbot/config.json` | Pi/dsh 共用的工作区启用与配置 |
|
|
115
126
|
| `AGENTS.md` | 资料导航与工作约定 |
|
|
116
127
|
| `areas/`、`projects/` | 长期目标、任务、结论与交付物 |
|
|
117
128
|
| `knowledge/` | 可复用的概念、方法与口径 |
|
|
118
|
-
| `.
|
|
129
|
+
| `.pbot/history/` | Pi/dsh 问答原文、摘要与节点关系 |
|
|
119
130
|
| `providers/` | 外部工具的使用说明、数据口径与来源 |
|
|
120
131
|
| `scratch/` | 临时脚本、计算数据、下载与运行环境 |
|
|
121
132
|
| `agents/`、`.agents/skills/` | 职责补充与工作区技能 |
|
|
@@ -124,7 +135,7 @@ Pi 主会话恢复用 `pi --resume` 明确选择;`pi --continue` 可能选中
|
|
|
124
135
|
|
|
125
136
|
## 更新与操作范围
|
|
126
137
|
|
|
127
|
-
当前版本为 **0.2.
|
|
138
|
+
当前版本为 **0.2.10**。通过宿主原生包管理更新;本地 Pi 来源更新源码,依赖变化后运行 `npm ci --ignore-scripts`,再重载或重启。更换版本前停止活动专家;不同兼容线的专家需重新创建,旧资料、历史和备份保留。
|
|
128
139
|
|
|
129
140
|
操作按用户请求、已有约定和必要确认执行。Bash、Python、MCP 和扩展使用实际账户与凭据权限;硬限制应由只读凭据、服务端控制或受限环境提供。交易、转账和账本修改需要相应授权。取消、超时或断连后,先查原生状态再决定是否重试,避免重复执行。
|
|
130
141
|
|
package/docs/README.md
CHANGED
|
@@ -3,7 +3,8 @@
|
|
|
3
3
|
## 使用
|
|
4
4
|
|
|
5
5
|
- [项目介绍与安装](../README.zh-CN.md) / [English](../README.md)
|
|
6
|
-
- [dsh 使用](dsh.md)
|
|
6
|
+
- [dsh 使用](dsh.md):profile、插件、Web 管理与聊天命令
|
|
7
|
+
- [工作区配置](workspace-configuration.md):Pi/dsh 共用配置、启用范围与重载
|
|
7
8
|
- [专家协作](agent-collaboration.md):独立委派、团队、通知与恢复
|
|
8
9
|
- [历史对话](history.md):查询、摘要与归档
|
|
9
10
|
- [Python 环境](../python/README.md):准备、排障、计算库与许可
|
|
@@ -24,4 +25,4 @@
|
|
|
24
25
|
| [npm 发布](release.md) | 候选检查、发布配置与操作 |
|
|
25
26
|
| [维护脚本](../scripts/README.md) | 构建与安装包检查 |
|
|
26
27
|
|
|
27
|
-
|
|
28
|
+
根目录 README 保留中英文版本,其他主题各维护一份当前说明。测试结果放在任务、PR 或 CI 输出中,历史方案与变更过程通过 Git 查询。
|
|
@@ -118,7 +118,7 @@ Pi 独立周期的 read 结果进入当前分支后领取该周期通知,包
|
|
|
118
118
|
| 事件 | 行为 |
|
|
119
119
|
| --- | --- |
|
|
120
120
|
| 独立周期完成 | 保持 idle,可继续对话 |
|
|
121
|
-
| Pi 主 reload |
|
|
121
|
+
| Pi 主 reload | 工作区仍启用时保留子进程并暂停团队;配置关闭或无效时停止所属专家;不续排旧批次 |
|
|
122
122
|
| dsh 页面关闭、刷新、重连 | 已接纳工作继续归服务端,查看不恢复旧任务 |
|
|
123
123
|
| dsh 父 Agent 释放、组件停用或卸载 | 暂停安排,取消预约并等待自己的专家资源释放;后续须显式恢复 |
|
|
124
124
|
| 主中断 | 暂停团队新增安排,已领取工作默认收尾 |
|
package/docs/dsh.md
CHANGED
|
@@ -1,7 +1,5 @@
|
|
|
1
1
|
# dsh 使用说明
|
|
2
2
|
|
|
3
|
-
[English](dsh.en.md) | 简体中文
|
|
4
|
-
|
|
5
3
|
Personal Bot 使用 dsh 原生 Web 界面,提供工作区资料、专家、团队、历史查询和 Python 环境。它与 Pi 共用资料、角色、方法及协作规则,各自管理原生会话、模型配置、认证与 MCP。
|
|
6
4
|
|
|
7
5
|
安装和更新使用 dsh 最新版,最低宿主版本为 `0.2.2-rc.1`。本文区分终端命令与聊天框中的 `/pbot` 命令,升级后可查看实际安装版的帮助。
|
|
@@ -19,7 +17,7 @@ dsh plugin --profile pbot add personal-bot@latest
|
|
|
19
17
|
dsh --profile pbot
|
|
20
18
|
```
|
|
21
19
|
|
|
22
|
-
`pbot` 是可自选的 profile
|
|
20
|
+
`pbot` 是可自选的 profile 名称,内置 `web` 也可安装同一插件。安装和插件开关作用于 profile,各工作区通过 `/pbot init` 创建共用的 `.pbot/config.json` 并启用 Personal Bot,规则见[工作区配置](workspace-configuration.md)。已有 profile 更新时不要重复执行 `--from-default-profile`。
|
|
23
21
|
|
|
24
22
|
dsh 启动 Web 服务并通常自动打开浏览器。SSH 或 `--no-open` 模式下手动打开输出的 URL;该地址含访问令牌,应妥善保管。选择工作区和主会话,配置模型与认证,再在聊天框执行:
|
|
25
23
|
|
|
@@ -29,7 +27,7 @@ dsh 启动 Web 服务并通常自动打开浏览器。SSH 或 `--no-open` 模式
|
|
|
29
27
|
/pbot
|
|
30
28
|
```
|
|
31
29
|
|
|
32
|
-
`status`
|
|
30
|
+
`status` 显示未启用或已启动状态;`init` 补建资料目录和根 AGENTS,保留已有资料与其他配置字段,并立即启用此目录下已打开的主会话;裸 `/pbot` 打开管理界面。已启用工作区加载后会自动准备当前用户共享的 Python venv。准备失败时修复基础环境,再运行 `/pbot python setup`。
|
|
33
31
|
|
|
34
32
|
一个 profile 可管理多个工作区。通过原生工作区选择器指定目录;默认使用系统 Documents。pbot 绑定主会话创建时的根目录,后续 cwd 变化只影响相对路径解析。
|
|
35
33
|
|
|
@@ -161,7 +159,7 @@ task-conductor setup
|
|
|
161
159
|
|
|
162
160
|
| 页签 | 操作 |
|
|
163
161
|
| --- | --- |
|
|
164
|
-
| 工作区 |
|
|
162
|
+
| 工作区 | 启动状态、来源、目录、模型、Python 和历史整理状态;初始化启用、准备资料或重试 Python |
|
|
165
163
|
| 专家 | 创建、重命名、停止、显式恢复;人工对话、附件和完整原生记录 |
|
|
166
164
|
| 团队 | 固定成员与职责、有限轮次、暂停、关闭、公共原文和长消息分页 |
|
|
167
165
|
| 历史 | 按 Pi/dsh 来源与时间查询,读取问答和摘要,沿父子节点导航 |
|
|
@@ -325,7 +323,7 @@ query 按不区分大小写的连续文本搜索已就绪问答与摘要;省
|
|
|
325
323
|
|
|
326
324
|
search 返回 matches、total、nextOffset 和 warnings,续页保持筛选条件并回填 nextOffset。read 返回 node:`node.nextOffset` 用于正文 offset,`node.nextChildrenOffset` 用于 childrenOffset;沿 parents/children 的 id 继续读取。没有 childrenLimit 参数。摘要提供线索,关键事实应回到问答原文;历史归档不能替代专家完整工具记录。
|
|
327
325
|
|
|
328
|
-
Pi
|
|
326
|
+
Pi 与 dsh 共用 `.pbot/history/`,共同查询已有归档,只更新和整理自己的来源。查询不调用模型;正常主交互结束后的空闲阶段才使用当前宿主模型补齐摘要,新人工输入优先取消整理。详见[历史对话](history.md)。
|
|
329
327
|
|
|
330
328
|
## 模型工具
|
|
331
329
|
|
package/docs/file-storage.md
CHANGED
|
@@ -4,6 +4,7 @@
|
|
|
4
4
|
|
|
5
5
|
| 位置 | 内容与所有者 |
|
|
6
6
|
| --- | --- |
|
|
7
|
+
| 工作区 .pbot/config.json | Pi/dsh 共用的启用与功能配置 |
|
|
7
8
|
| 工作区 AGENTS.md、areas/、projects/、knowledge/ 等 | 用户资料、任务定义、方法、结论与交付物 |
|
|
8
9
|
| 工作区 providers/<id>/GUIDE.md | 提供方使用说明 |
|
|
9
10
|
| 工作区 .pi/settings.json、.pi/mcp.json | Pi 原生项目配置 |
|
|
@@ -12,10 +13,10 @@
|
|
|
12
13
|
| 当前 Pi agent dir 的 pbot/teams/ | Pi 团队资料、批次与公共原文 |
|
|
13
14
|
| dsh 原生会话存储 | dsh 主会话与专家的原生事件,由 dsh 管理 |
|
|
14
15
|
| dsh home 的 pbot/subagents/、pbot/teams/ | dsh 专家控制记录、原生 ID 引用与团队公共记录 |
|
|
15
|
-
| 工作区 .
|
|
16
|
+
| 工作区 .pbot/history/ | Pi/dsh 问答、摘要、节点关系;双方共同查询,各写本来源 |
|
|
16
17
|
| 用户级 pbot/python/.venv | 共享 Python 环境 |
|
|
17
18
|
|
|
18
|
-
各宿主管理自己的主会话、专家对话与原生配置,不跨宿主恢复或接管。Personal Bot
|
|
19
|
+
各宿主管理自己的主会话、专家对话与原生配置,不跨宿主恢复或接管。Personal Bot 的工作区资料是普通文件,启用配置集中在 `.pbot/config.json`,不维护工作区格式版本。详细目录用途见[项目 README](../README.zh-CN.md#工作区资料),Python 路径见 [Python 说明](../python/README.md)。
|
|
19
20
|
|
|
20
21
|
## 资料准备
|
|
21
22
|
|
|
@@ -60,7 +61,9 @@ I/O 失败后当前文件实例停止后续写入,不能因下一次读取成
|
|
|
60
61
|
|
|
61
62
|
## 历史索引
|
|
62
63
|
|
|
63
|
-
|
|
64
|
+
历史存档统一保存在工作区 `.pbot/history/`,按 host 与原生 session ID 关联会话。两种来源使用相同格式,顶层 `host` 字段标明 `pi` 或 `dsh`,文件名与根 ID 一致。归档包含问答文本、来源消息 ID、分支内的四叉摘要与父子关系,复用原子 JSON 写入;双方分别持有本来源的短写锁,只更新自己的记录。
|
|
65
|
+
|
|
66
|
+
原生会话不可用时仍可查询归档,复制到其他目录或机器后仍可读取,重新发现原生会话时复用原节点。收录范围与查询见[历史对话](history.md)。
|
|
64
67
|
|
|
65
68
|
## 历史与复制
|
|
66
69
|
|
|
@@ -68,4 +71,4 @@ I/O 失败后当前文件实例停止后续写入,不能因下一次读取成
|
|
|
68
71
|
|
|
69
72
|
加载、资料准备和重载保留已有资料、历史记录及备份。扩展管理自己的子会话、历史存档与 Python 环境,不自动导入或转换其他应用数据。
|
|
70
73
|
|
|
71
|
-
|
|
74
|
+
复制工作区前停止旧实例。包含 `.pbot/history/` 的副本会带上两种来源的问答与摘要,但不会转移用户级原生会话、运行进程、环境或认证;不支持多机同时写入同步目录。
|
package/docs/history.md
CHANGED
|
@@ -37,16 +37,9 @@ dsh 通过公开 SessionQuery 冷读本工作区根会话与按父关系关联
|
|
|
37
37
|
|
|
38
38
|
## 存储与并发
|
|
39
39
|
|
|
40
|
-
|
|
41
|
-
| --- | --- | --- |
|
|
42
|
-
| Pi | `.pi/pbot/history/<id>.json` | Pi 收录与整理自己的原生会话 |
|
|
43
|
-
| dsh | `.dsh/pbot/history/<id>.json` | dsh 收录与整理自己的原生会话 |
|
|
40
|
+
历史归档统一保存在 `.pbot/history/<id>.json`,顶层 `host` 字段标明 `pi` 或 `dsh`。两种来源共用归档格式,保存问答文本、来源 ID、节点关系与摘要;文件名与根 ID 一致。目录决定工作区,读取器按 `host` 筛选记录,双方只收录和整理自己的原生来源。复制 `.pbot/history/` 即可查询现成内容;原生恢复仍需各宿主自己的会话数据,工具日志和附件二进制不在归档内。
|
|
44
41
|
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
Pi 保留既有旧索引处理:将当前 Pi agent dir 中旧 `pbot/history/` 下属于本工作区且尚未存在的记录复制到工作区,保留旧副本,不覆盖新归档;移除已有 Pi 归档中的旧 file 字段时保留正文、摘要和节点 ID。失败的旧目录读取可在后续刷新重试。dsh 不导入这些旧 Pi 记录,也不清理或回写 Pi 归档。
|
|
48
|
-
|
|
49
|
-
每个来源有独立的短写锁。原生扫描和模型调用在锁外进行,提交时重读最新归档;过时扫描不能覆盖后来保存的原文,过时摘要不能覆盖变更后的子节点或已提交摘要。一个来源损坏时,另一来源仍可查询并附带警告。多个进程同时整理可能产生重复模型调用。
|
|
42
|
+
每个来源在共用目录内有独立的短写锁 `.write-pi`、`.write-dsh`。原生扫描和模型调用在锁外进行,提交时重读最新归档;过时扫描不能覆盖后来保存的原文,过时摘要不能覆盖变更后的子节点或已提交摘要。损坏文件产生警告,其他归档仍可查询。多个进程同时整理可能产生重复模型调用。
|
|
50
43
|
|
|
51
44
|
服务位于 `services/history`,负责分组、查询、摘要队列与提交规则;`integrations/pi/history` 和 `integrations/dsh/history` 负责各自原生投影,`storage/history-files` 负责校验、短锁与原子文件发布。命令和工具调用同一服务。查询使用全文扫描,不增加数据库或向量索引。
|
|
52
45
|
|
|
@@ -13,7 +13,7 @@ flowchart TD
|
|
|
13
13
|
E --> F[补装 tmux,安装或更新 Pi]
|
|
14
14
|
F --> G[安装或更新工作区 pbot]
|
|
15
15
|
G --> H[逐项处理可选插件并汇总结果]
|
|
16
|
-
H --> I[选择是否启动 Pi]
|
|
16
|
+
H --> I[选择是否启动 Pi 并初始化启用工作区]
|
|
17
17
|
I --> J[Pi 处理项目信任并执行 /pbot init]
|
|
18
18
|
```
|
|
19
19
|
|
|
@@ -26,6 +26,7 @@ flowchart TD
|
|
|
26
26
|
| pbot 与可选插件 | 安装到所选工作区,使用 Pi 原生包管理 |
|
|
27
27
|
| tmux | 已有时复用;缺失时通过已有 Homebrew、apt、dnf、pacman、zypper 或 apk 安装 |
|
|
28
28
|
| Python | 检查 3.11+、venv 与 ensurepip;共享 venv 由 pbot 加载时准备 |
|
|
29
|
+
| 工作区启用 | 由 `/pbot init` 创建或更新 `.pbot/config.json` 的 enabled,保留其他字段;无效配置报错 |
|
|
29
30
|
| 工作区资料 | 由 `/pbot init` 补建,保留已有内容 |
|
|
30
31
|
| 插件的外部服务 | 按对应插件的安装与配置流程处理 |
|
|
31
32
|
|
|
@@ -57,6 +58,8 @@ Git 和本地目录必须存在,且 package.json 有有效包名;独立单
|
|
|
57
58
|
|
|
58
59
|
## 启动与恢复
|
|
59
60
|
|
|
61
|
+
配置规则见[工作区配置](workspace-configuration.md)。软件安装阶段不创建或修改启用配置。选择启动并执行 init 会显式启用工作区;无效配置由用户修复后重试。
|
|
62
|
+
|
|
60
63
|
用户选择启动后,子进程以工作区为 cwd 并继承终端,执行 `pi "/pbot init"`。Pi 完成项目信任和扩展加载后分发命令,初始化结束仍留在同一交互会话。
|
|
61
64
|
|
|
62
65
|
本次启动临时加载 `setup-guard`:若 `/pbot init` 未被注册命令处理,拦截该输入并请求 Pi 关闭,避免落入模型请求。引导文件缺失时不启动 Pi。资料创建和 Python 准备仍由 pbot 各自报告。
|
package/docs/model-context.md
CHANGED
|
@@ -19,11 +19,11 @@
|
|
|
19
19
|
|
|
20
20
|
## Pi
|
|
21
21
|
|
|
22
|
-
|
|
22
|
+
工作区通过 `.pbot/config.json` 显式启用后,主会话保留 Pi 原生系统提示、工具、AGENTS、技能目录和 cwd,再加入公共约定、协调者职责、工作区补充和环境状态。未启用时只保留状态和初始化入口,不创建 pbot 实例,不注册业务工具、提示词或包内技能。专家使用 general-purpose 职责;原生资料由专家 cwd 决定,pbot 职责补充从原工作区读取。
|
|
23
23
|
|
|
24
|
-
|
|
24
|
+
已启用的 Pi 主会话通过 `resources_discover` 提供包内技能路径,由原生加载器读取,遵守 CLI `--no-skills` 和包级过滤;专家使用自己的 noSkills 选项。技能与提示模板正文在读取或展开时加入。
|
|
25
25
|
|
|
26
|
-
`before_agent_start` 完整读取公共约定与角色后更新 section,读取失败取消本轮。角色补充在下一工作周期刷新;原生 AGENTS 与技能目录经 `/reload` 更新。`/pbot init`
|
|
26
|
+
`before_agent_start` 完整读取公共约定与角色后更新 section,读取失败取消本轮。角色补充在下一工作周期刷新;原生 AGENTS 与技能目录经 `/reload` 更新。`/pbot init` 首次启用时自动重载并加载新建根 AGENTS;已启动时补建的根 AGENTS 经 `/reload` 加载。
|
|
27
27
|
|
|
28
28
|
未变的 section 沿用,变更通过原生差量更新,有效系统内容随后续请求传递。团队公共消息按 teamId、seq 和当前分支去重,在安全边界补充新消息;压缩后需要的原文通过团队 read 读取。
|
|
29
29
|
|
|
@@ -33,7 +33,7 @@
|
|
|
33
33
|
|
|
34
34
|
公共约定和角色在 `system-prompt/assemble` 当次读取。显式 complete persona 按宿主规则覆盖普通提示 section,其完整行为要求由该 persona 提供。
|
|
35
35
|
|
|
36
|
-
|
|
36
|
+
只有已启用工作区的主会话及受管专家注册包内技能 provider。项目和用户技能沿用原生 provider 的目录优先级与文件更新监听,包内方法让位于继承的同名方法。noSkills 关闭专家的模型技能目录和 skill 工具;用户显式技能命令按宿主规则处理。
|
|
37
37
|
|
|
38
38
|
普通请求包含宿主提示、pbot 约定与角色、工具声明,以及原生 AGENTS、环境与技能目录。未变的原生内容沿用;PTC 的工具目录和 run_code 由宿主管理。
|
|
39
39
|
|
package/docs/technical-design.md
CHANGED
|
@@ -34,7 +34,7 @@ src/pbot.ts 装配 Pi 入口,src/dsh.ts 装配 dsh Host,src/ui/dsh/index.ts
|
|
|
34
34
|
|
|
35
35
|
| 主体 | 管理内容 |
|
|
36
36
|
| --- | --- |
|
|
37
|
-
| prepareWorkspace |
|
|
37
|
+
| initializeWorkspace / prepareWorkspace | 初始化依次准备资料并写入共用启用配置;资料准备补建目录与根 AGENTS.md |
|
|
38
38
|
| PythonEnvironmentService | venv 准备、依赖检查、状态与取消等待 |
|
|
39
39
|
| AgentService / AgentRun | 原生专家实例、启动预约、代次、inbox、领取/进入/消费/完成与交付资格;拒绝向被团队占用的成员发送私人任务 |
|
|
40
40
|
| TeamService | 固定成员、公共消息、有限轮次、团队占用与暂停规则 |
|
|
@@ -43,15 +43,17 @@ src/pbot.ts 装配 Pi 入口,src/dsh.ts 装配 dsh Host,src/ui/dsh/index.ts
|
|
|
43
43
|
|
|
44
44
|
## 加载与关闭
|
|
45
45
|
|
|
46
|
-
|
|
46
|
+
宿主原生配置决定插件加载范围,工作区根目录下的 `.pbot/config.json` 决定业务实例是否启动。`services/workspace/workspace-config` 为两种宿主读取同一 JSON;缺失、false 或无效配置保持未启用,错误由状态入口报告,不向父目录继承。规则与修改生效方式见[工作区配置](workspace-configuration.md)。
|
|
47
|
+
|
|
48
|
+
Pi 的 session_start 读取启动目录配置,仅在 enabled 为 true 时创建实例、注册工具和准备 Python。未启用时保留状态和初始化入口,不注册包内技能,也不注入 pbot 提示词;状态栏显示未启用或已启动。加载本身不开展模型任务。
|
|
47
49
|
|
|
48
50
|
Pi 的 `/pbot` 打开原生菜单,状态与长记录使用只读阅读页;dsh 使用独立工作台。见[界面设计](interaction-design.md)。
|
|
49
51
|
|
|
50
|
-
`/pbot init`
|
|
52
|
+
`/pbot init` 先准备资料,再将共用配置中的 enabled 设为 true,保留其他字段;无效配置在写入前报错。Pi 从未启用状态初始化后调用原生 ctx.reload,让实例、工具、技能和新建根 AGENTS 一起生效;已启动会话仅补建资料,新建 AGENTS 经 `/reload` 加载。`/pbot status` 展示运行状态、路径、版本和完整 Python 状态;模型环境只保留工作区、资源根目录及 Python 状态与就绪目录。实际 cwd 由宿主提供,准备错误日志保留在状态入口。
|
|
51
53
|
|
|
52
|
-
主 reload
|
|
54
|
+
主 reload 在配置仍启用时保留子进程并重新关联,但暂停团队,不继续安排旧批次;配置关闭或损坏时停止所属专家;退出或切换会话时清理子进程、取消环境准备并恢复本实例持有的环境变量。关闭操作幂等。子会话的分支归属、通知和恢复规则见[专家协作](agent-collaboration.md)。
|
|
53
55
|
|
|
54
|
-
dsh
|
|
56
|
+
dsh 为原生 registry 中的每个根 Agent 读取其原始 cwd 下的配置,仅对已启用根目录建立协调者工作区。关闭的工作区保留只读状态和初始化入口,其余业务命令与 Remote 查询拒绝进入;init 写入配置后重新打开同一根目录下尚未启用的主会话,按目录合并并发初始化;首个已启用工作区触发共享 Python 准备。专家使用同进程独立 Agent/Session;组件或所属父 Agent 关闭时取消预约、暂停安排并等待自己拥有的执行资源释放。打开页面、轮询、重连不恢复专家或启动模型,已接纳工作不归浏览器生命周期所有。原生存在但由其他实例持有的专家不能替换或假称已释放。
|
|
55
57
|
|
|
56
58
|
## 资源加载
|
|
57
59
|
|
|
@@ -65,9 +67,9 @@ dsh 只为原生 registry 中的根 Agent 建立协调者工作区,绑定其
|
|
|
65
67
|
| resources/references/ | 按任务读取;普通计算与指标/回测分开 |
|
|
66
68
|
| resources/templates/workspace-agents.md | 补建根资料入口的模板,不覆盖现有文件 |
|
|
67
69
|
|
|
68
|
-
Pi
|
|
70
|
+
Pi 包清单关闭包内技能的静态发现,已启用主会话通过 resources_discover 返回技能路径,再由原生加载器读取和去重。接入适配遵守 CLI `--no-skills` 与包级资源过滤;用户级过滤与项目 delta 保留各自优先级。专家按自己的 noSkills 选择发现包内及原工作区技能。Pi SDK 的 DefaultResourceLoader.noSkills 只关闭自动发现;SDK 宿主使用包级 skills 过滤控制这些显式动态路径,并绑定原生 commandContextActions.reload 以支持 init 后重载。before_agent_start 读取公共约定和角色补充,完整读取后更新 section;读取失败显式取消本轮,避免宿主只报告 hook 错误后继续。原生 AGENTS、技能元数据和提示模板由 Pi 自己加载、重载与去重;pbot 不另拼根 AGENTS,工具也不重复附加公共指南。
|
|
69
71
|
|
|
70
|
-
dsh 专家通过原生 composeFrom 应用父会话 preset
|
|
72
|
+
dsh 专家通过原生 composeFrom 应用父会话 preset,再限制其工具。包内技能 provider 仅在已启用主会话和受管专家的 scope 注册,原生文件系统 provider 负责读取和监听;作用域适配保留继承的项目/用户同名方法优先级;公共约定和角色在 system-prompt/assemble 当次刷新,遵守宿主 complete persona 覆盖。团队简报随首个已接纳团队上下文提供,不放在先于 pre-step 求值的动态 system section。
|
|
71
73
|
|
|
72
74
|
同一会话中不变的 section 由宿主沿用,有效系统内容随后续请求传递。团队公共消息按结构化来源与序号去重,压缩后需要的原文通过 read 续取。目录用途常驻,维护方法、接入、计算和调度细节按需读取。具体加载方式见[模型上下文](model-context.md)。
|
|
73
75
|
|
|
@@ -75,9 +77,9 @@ dsh 专家通过原生 composeFrom 应用父会话 preset,再限制其工具
|
|
|
75
77
|
|
|
76
78
|
## 历史查询
|
|
77
79
|
|
|
78
|
-
Pi
|
|
80
|
+
Pi 与 dsh 共用 `.pbot/history/`,共同查询归档,只收录和整理自己的原生来源。两种来源使用相同归档格式,顶层保存 `host`、`id`、`sessionId`、`name` 和 `nodes`;来源识别、读取筛选与写入校验使用必填的 `host` 字段。文件名与根 ID 一致,两端分别使用 `.write-pi`、`.write-dsh` 短写锁。
|
|
79
81
|
|
|
80
|
-
扫描与模型调用在短写锁外,提交时重读,拒绝过期原文或摘要覆盖。查询不调用模型;正常主交互结束后才在空闲阶段整理,新人工输入优先取消。dsh 使用原生 LLM 路由,不创建额外 Agent
|
|
82
|
+
扫描与模型调用在短写锁外,提交时重读,拒绝过期原文或摘要覆盖。查询不调用模型;正常主交互结束后才在空闲阶段整理,新人工输入优先取消。dsh 使用原生 LLM 路由,不创建额外 Agent,也不写主聊天。原生会话缺失时保留现成归档;损坏文件单独报告,其他归档继续可查。有不可读归档时只更新已识别会话,避免为其原生会话重复分配根 ID。实现与限制见[历史对话](history.md)。
|
|
81
83
|
|
|
82
84
|
## 原生子会话存储
|
|
83
85
|
|
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
# 工作区配置
|
|
2
|
+
|
|
3
|
+
Pi 和 dsh 共用工作区根目录下的 `.pbot/config.json`。宿主原生配置负责安装和加载插件,此文件决定 Personal Bot 是否在当前工作区启动,也作为后续工作区功能配置的统一入口。
|
|
4
|
+
|
|
5
|
+
## 初始化与状态
|
|
6
|
+
|
|
7
|
+
安装后,从目标工作区打开 Pi 或 dsh,在聊天框执行:
|
|
8
|
+
|
|
9
|
+
```text
|
|
10
|
+
/pbot init
|
|
11
|
+
/pbot status
|
|
12
|
+
```
|
|
13
|
+
|
|
14
|
+
`init` 补建资料目录和缺失的根 `AGENTS.md`,将配置中的 `enabled` 设为 true,并启动 Personal Bot。已有资料和其他配置字段保留。Pi 在首次启用时自动重载;dsh 立即启用此目录下已打开的主会话。已经启动时,再次执行 `init` 主要用于补建资料;Pi 新建的根 AGENTS 经 `/reload` 加载。
|
|
15
|
+
|
|
16
|
+
Pi 状态栏显示“PBot 未启用”或“PBot 已启动”。dsh 的 Personal Bot 工作区页显示状态,未启用时提供“初始化并启用”按钮。两种宿主都保留 `/pbot status`,其结构化状态包含 `enabled`、运行时 `state`、工作区路径和配置路径。`state` 表示当前运行状态,取值为 `disabled`、`running` 或 `error`。
|
|
17
|
+
|
|
18
|
+
## 启用与停用
|
|
19
|
+
|
|
20
|
+
初始化后的配置为:
|
|
21
|
+
|
|
22
|
+
```json
|
|
23
|
+
{
|
|
24
|
+
"enabled": true
|
|
25
|
+
}
|
|
26
|
+
```
|
|
27
|
+
|
|
28
|
+
例如,ONEBASE 使用 `~/onebase/.pbot/config.json`。同一 dsh profile 可以同时打开开启和关闭的工作区。
|
|
29
|
+
|
|
30
|
+
| 配置情况 | 行为 |
|
|
31
|
+
| --- | --- |
|
|
32
|
+
| `enabled: true` | 启动工作区实例,加载工具、提示词和包内技能,并准备 Python |
|
|
33
|
+
| 文件不存在、缺少 enabled 或 `enabled: false` | 保持未启用,提示执行 `/pbot init`;保留宿主原生功能 |
|
|
34
|
+
| JSON 损坏、字段类型错误或文件不可读取 | 保持未启用,报告配置错误;修复文件后再执行 `init` |
|
|
35
|
+
|
|
36
|
+
未启用时,包内技能不会进入原生技能目录,也不注入 pbot 提示词。用户自己的 AGENTS、技能和其他插件仍按宿主配置加载。
|
|
37
|
+
|
|
38
|
+
只读取当前工作区根目录,不向父目录查找配置。在 `~/onebase/projects/example` 单独建立会话时,该目录需要自己的配置。受 Personal Bot 管理的专家沿用所属工作区的启用决定,专家的工作目录可以不同。
|
|
39
|
+
|
|
40
|
+
配置使用普通 JSON,当前支持可选的布尔值 `enabled`。其他字段原样保留,后续工作区功能也在此文件中配置。
|
|
41
|
+
|
|
42
|
+
## 应用手工修改
|
|
43
|
+
|
|
44
|
+
- **Pi**:修改配置后执行原生 `/reload`,或重新启动 Pi。
|
|
45
|
+
- **dsh**:修改配置后重启对应服务或桌面宿主。
|
|
46
|
+
|
|
47
|
+
手工修改前已加载的会话保持原配置。修改 cwd 不改变所属工作区。停用后重载会撤下工具并释放所属专家、团队调度和历史整理;资料、历史与备份保留。需要重新启用时可直接执行 `/pbot init`。
|
|
48
|
+
|
|
49
|
+
所有已启用工作区共用用户级 Python venv。dsh 的进程环境激活由整个插件组件持有,同一 Host 中的 Bash 进程可能继承该环境。Python 使用方式见[计算环境](../python/README.md)。
|
|
50
|
+
|
|
51
|
+
## 安装与更新
|
|
52
|
+
|
|
53
|
+
插件安装完成后,通过 `/pbot init` 创建启用配置并启动工作区。`pbot setup` 可在安装后启动 Pi 执行此命令;手工安装后,在目标工作区的聊天框执行。
|
|
54
|
+
|
|
55
|
+
从此前“加载即启动”的版本更新后,同样通过 `init` 启用目标工作区,保留现有安装配置、资料和历史数据。
|
package/lib/client.js
CHANGED
|
@@ -419,6 +419,7 @@ function showManagement(ctx, parentSessionId) {
|
|
|
419
419
|
return node;
|
|
420
420
|
}
|
|
421
421
|
function activate(id) {
|
|
422
|
+
if (snapshot?.enabled === false && id !== "status") return;
|
|
422
423
|
tab = id;
|
|
423
424
|
for (const [key, section2] of sections) section2.hidden = key !== id;
|
|
424
425
|
for (const [key, item] of tabs) {
|
|
@@ -487,8 +488,8 @@ function showManagement(ctx, parentSessionId) {
|
|
|
487
488
|
counts.classList.add("pbot-counts");
|
|
488
489
|
const materials = group(status, "pbot-setting");
|
|
489
490
|
materials.append(element("h3", "\u8D44\u6599\u76EE\u5F55"));
|
|
490
|
-
button(materials, "\u51C6\u5907\u76EE\u5F55", async () => {
|
|
491
|
-
await command("init", void 0, "\
|
|
491
|
+
const initializeButton = button(materials, "\u51C6\u5907\u76EE\u5F55", async () => {
|
|
492
|
+
await command("init", void 0, "\u5DE5\u4F5C\u533A\u5DF2\u521D\u59CB\u5316\u5E76\u542F\u7528\u3002");
|
|
492
493
|
});
|
|
493
494
|
const pythonCard = group(status, "pbot-setting"), pythonInfo = group(pythonCard);
|
|
494
495
|
const pythonButton = button(pythonCard, "\u51C6\u5907 Python", async () => {
|
|
@@ -962,14 +963,38 @@ function showManagement(ctx, parentSessionId) {
|
|
|
962
963
|
if (!snapshot) return;
|
|
963
964
|
location.textContent = text(snapshot.workspaceRoot).split(/[\\/]/).filter(Boolean).at(-1) ?? "";
|
|
964
965
|
location.title = text(snapshot.workspaceRoot);
|
|
966
|
+
if (snapshot.enabled === false) {
|
|
967
|
+
const configuration = record(snapshot.configuration);
|
|
968
|
+
counts.textContent = configuration.error ? "Personal Bot \u914D\u7F6E\u9519\u8BEF" : "Personal Bot \u672A\u542F\u7528";
|
|
969
|
+
workspaceInfo.replaceChildren(
|
|
970
|
+
facts([["\u72B6\u6001", configuration.error ? "\u914D\u7F6E\u9519\u8BEF" : "\u672A\u542F\u7528"], ["\u5DE5\u4F5C\u533A", snapshot.workspaceRoot], ["\u914D\u7F6E\u6587\u4EF6", configuration.path]]),
|
|
971
|
+
note(configuration.error ? "\u4FEE\u590D\u914D\u7F6E\u6587\u4EF6\u540E\u6267\u884C /pbot init\u3002" : "\u6267\u884C /pbot init\uFF0C\u6216\u70B9\u51FB\u4E0B\u65B9\u6309\u94AE\u521D\u59CB\u5316\u5E76\u542F\u7528\u3002")
|
|
972
|
+
);
|
|
973
|
+
pythonInfo.replaceChildren(note("\u542F\u7528\u5DE5\u4F5C\u533A\u540E\u81EA\u52A8\u51C6\u5907\u5171\u4EAB Python \u73AF\u5883\u3002"));
|
|
974
|
+
materials.hidden = false;
|
|
975
|
+
initializeButton.textContent = "\u521D\u59CB\u5316\u5E76\u542F\u7528";
|
|
976
|
+
enabled(initializeButton, !configuration.error);
|
|
977
|
+
for (const [id, control] of tabs) enabled(control, id === "status");
|
|
978
|
+
enabled(pythonButton, false);
|
|
979
|
+
activate("status");
|
|
980
|
+
statusBody.textContent = JSON.stringify(snapshot, null, 2);
|
|
981
|
+
if (configuration.error) inform(text(configuration.error), "error");
|
|
982
|
+
return;
|
|
983
|
+
}
|
|
984
|
+
for (const control of tabs.values()) enabled(control, true);
|
|
985
|
+
materials.hidden = false;
|
|
986
|
+
initializeButton.textContent = "\u51C6\u5907\u76EE\u5F55";
|
|
987
|
+
enabled(initializeButton, true);
|
|
965
988
|
const agents = rows(snapshot.agents), teams2 = rows(snapshot.teams), python = record(snapshot.python), history2 = record(snapshot.history);
|
|
966
989
|
tabCounts.get("experts").textContent = text(agents.length);
|
|
967
990
|
tabCounts.get("teams").textContent = text(teams2.length);
|
|
968
991
|
const active = agents.filter((agent) => ["starting", "busy", "stopping"].includes(text(agent.state))).length;
|
|
969
|
-
counts.textContent =
|
|
992
|
+
counts.textContent = `Personal Bot \u5DF2\u542F\u52A8 \xB7 \u4E13\u5BB6 ${agents.length} \xB7 \u6267\u884C\u4E2D ${active} \xB7 \u56E2\u961F ${teams2.length}`;
|
|
970
993
|
const model2 = object(snapshot.model) ? snapshot.model : {};
|
|
971
994
|
workspaceInfo.replaceChildren(facts([
|
|
995
|
+
["\u72B6\u6001", "\u5DF2\u542F\u52A8"],
|
|
972
996
|
["\u5DE5\u4F5C\u533A", snapshot.workspaceRoot],
|
|
997
|
+
["\u914D\u7F6E\u6587\u4EF6", record(snapshot.configuration).path],
|
|
973
998
|
["\u6A21\u578B", model2.model || "\u5C1A\u672A\u9009\u62E9"],
|
|
974
999
|
["Provider", model2.provider || "\u2014"],
|
|
975
1000
|
["\u5386\u53F2", history2.organizing ? "\u6574\u7406\u4E2D" : history2.pending === null ? "\u67E5\u8BE2\u65F6\u66F4\u65B0\u7D22\u5F15" : `${history2.pending} \u9879\u5F85\u6574\u7406`]
|
package/lib/dsh.js
CHANGED
|
@@ -1,6 +1,3 @@
|
|
|
1
|
-
import { join } from "node:path";
|
|
2
|
-
import * as SkillFilesystem from "@deepseek-ai/dsh-skill-filesystem";
|
|
3
|
-
import { resourceRoot } from "./common/paths.js";
|
|
4
1
|
import { registerDshCommand } from "./extension/dsh/command.js";
|
|
5
2
|
import { registerDshManagement } from "./extension/dsh/management.js";
|
|
6
3
|
import { DshWorkspaces, dshDependencies } from "./extension/dsh/workspace.js";
|
|
@@ -10,7 +7,6 @@ export const inject = ["commands", "typert", ...dshDependencies];
|
|
|
10
7
|
export async function apply(ctx) {
|
|
11
8
|
const [major, minor] = process.versions.node.split(".").map(Number);
|
|
12
9
|
requireThat(major > 24 || (major === 24 && minor >= 9), "dsh 接入需要 Node.js 24.9.0 或更新版本。");
|
|
13
|
-
await ctx.plugin(SkillFilesystem, { providerName: "pbot", includeDefaultRoots: false, bundledSkillDir: join(resourceRoot, "skills") });
|
|
14
10
|
const workspaces = new DshWorkspaces(ctx);
|
|
15
11
|
ctx.effect(() => () => workspaces.close());
|
|
16
12
|
const management = registerDshManagement(ctx, workspaces);
|
|
@@ -22,5 +18,4 @@ export async function apply(ctx) {
|
|
|
22
18
|
for (const agent of ctx.agents.roots())
|
|
23
19
|
if (agent.session.header.origin !== "subagent")
|
|
24
20
|
await workspaces.open(agent);
|
|
25
|
-
void workspaces.preparePython().catch(error => ctx.logger.warn(String(error)));
|
|
26
21
|
}
|