personal-bot 0.3.7 → 0.4.1
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/.claude-plugin/marketplace.json +3 -3
- package/.claude-plugin/plugin.json +2 -2
- package/README.md +5 -8
- package/README.zh-CN.md +5 -8
- package/bin/pbot-pi-acp.mjs +1 -1
- package/docs/architecture/design.md +2 -2
- package/docs/architecture/extensibility.md +4 -4
- package/docs/architecture/model-context.md +6 -3
- package/docs/guides/cross-harness-workers.md +5 -5
- package/docs/guides/history.md +1 -3
- package/docs/guides/workspace-configuration.md +5 -5
- package/docs/hosts/claude-code.md +3 -3
- package/docs/hosts/codex-qoder.md +4 -2
- package/hooks/hooks.json +3 -0
- package/lib/antigravity-plugin/bin/pbot-pi-acp.mjs +1 -1
- package/lib/antigravity-plugin/lib/extension/acp/member.d.ts +1 -1
- package/lib/antigravity-plugin/lib/extension/acp/member.js +11 -10
- package/lib/antigravity-plugin/lib/extension/acp-worker.js +349 -204
- package/lib/antigravity-plugin/lib/extension/cli.js +596 -572
- package/lib/antigravity-plugin/lib/extension/hosts/dsh/acp-member.js +1 -1
- package/lib/antigravity-plugin/lib/extension/hosts/pi/acp-member.js +3 -4
- package/lib/antigravity-plugin/lib/extension/hosts/plugin-runtime.js +1 -12
- package/lib/antigravity-plugin/lib/extension/mcp.js +463 -379
- package/lib/antigravity-plugin/lib/integrations/agent-resources.d.ts +2 -2
- package/lib/antigravity-plugin/lib/integrations/agent-resources.js +3 -3
- package/lib/antigravity-plugin/lib/integrations/hosts/antigravity/adapter.js +0 -1
- package/lib/antigravity-plugin/lib/integrations/hosts/claude/adapter.js +1 -2
- package/lib/antigravity-plugin/lib/integrations/hosts/dsh/resources.d.ts +1 -1
- package/lib/antigravity-plugin/lib/integrations/hosts/prompt-hooks.js +4 -7
- package/lib/antigravity-plugin/lib/model/acp.d.ts +29 -35
- package/lib/antigravity-plugin/lib/model/agent.d.ts +33 -17
- package/lib/antigravity-plugin/lib/model/agent.js +0 -1
- package/lib/antigravity-plugin/lib/services/history/summary-dimensions/monthly.js +1 -1
- package/lib/antigravity-plugin/lib/services/history/summary-dimensions/session.js +6 -3
- package/lib/antigravity-plugin/lib/services/history/summary-runner.js +3 -3
- package/lib/antigravity-plugin/lib/storage/acp-files.d.ts +5 -8
- package/lib/antigravity-plugin/lib/storage/acp-files.js +34 -40
- package/lib/antigravity-plugin/lib/storage/agent-files.d.ts +19 -10
- package/lib/antigravity-plugin/lib/storage/agent-files.js +147 -43
- package/lib/antigravity-plugin/lib/storage/history-files.js +3 -2
- package/lib/antigravity-plugin/package.json +1 -1
- package/lib/antigravity-plugin/plugin.json +2 -2
- package/lib/antigravity-plugin/resources/agents/coordinator.md +2 -4
- package/lib/antigravity-plugin/resources/agents/general-purpose.md +2 -4
- package/lib/antigravity-plugin/resources/prompts/history-monthly-summary.md +6 -11
- package/lib/antigravity-plugin/resources/prompts/history-summary.md +6 -11
- package/lib/antigravity-plugin/resources/prompts/plugin-coordinator.md +1 -1
- package/lib/antigravity-plugin/resources/prompts/workspace.md +16 -23
- package/lib/antigravity-plugin/resources/skills/project-maintenance/SKILL.md +14 -21
- package/lib/antigravity-plugin/resources/skills/provider-connections/SKILL.md +23 -36
- package/lib/antigravity-plugin/resources/templates/workspace-agents.md +5 -13
- package/lib/antigravity-plugin/skills/pbot/SKILL.md +6 -23
- package/lib/antigravity-plugin/skills/project-maintenance/SKILL.md +14 -21
- package/lib/antigravity-plugin/skills/provider-connections/SKILL.md +23 -36
- package/lib/codex-marketplace/plugins/personal-bot/.codex-plugin/plugin.json +2 -2
- package/lib/codex-marketplace/plugins/personal-bot/.mcp.json +2 -2
- package/lib/codex-marketplace/plugins/personal-bot/hooks/hooks.json +3 -3
- package/lib/codex-marketplace/plugins/personal-bot/skills/pbot/SKILL.md +11 -3
- package/lib/extension/acp/member.d.ts +1 -1
- package/lib/extension/acp/member.js +11 -10
- package/lib/extension/acp/worker.js +34 -33
- package/lib/extension/acp-worker.js +349 -204
- package/lib/extension/cli.js +596 -572
- package/lib/extension/hosts/dsh/acp-member.js +1 -1
- package/lib/extension/hosts/dsh/command.js +2 -2
- package/lib/extension/hosts/dsh/workspace.js +5 -5
- package/lib/extension/hosts/pi/acp-member.js +3 -4
- package/lib/extension/hosts/plugin-runtime.js +1 -12
- package/lib/extension/mcp/tool-contract.d.ts +8 -50
- package/lib/extension/mcp/tool-contract.js +61 -107
- package/lib/extension/mcp/workers.d.ts +7 -27
- package/lib/extension/mcp/workers.js +40 -24
- package/lib/extension/mcp.js +463 -379
- package/lib/integrations/acp/agents.d.ts +2 -3
- package/lib/integrations/acp/agents.js +22 -22
- package/lib/integrations/acp/harnesses/claude.js +1 -1
- package/lib/integrations/agent-resources.d.ts +2 -2
- package/lib/integrations/agent-resources.js +3 -3
- package/lib/integrations/hosts/antigravity/adapter.js +0 -1
- package/lib/integrations/hosts/claude/adapter.js +1 -2
- package/lib/integrations/hosts/dsh/resources.d.ts +1 -1
- package/lib/integrations/hosts/prompt-hooks.js +4 -7
- package/lib/model/acp.d.ts +29 -35
- package/lib/model/agent.d.ts +33 -17
- package/lib/model/agent.js +0 -1
- package/lib/qoder-plugin/.mcp.json +2 -2
- package/lib/qoder-plugin/.qoder-plugin/plugin.json +2 -2
- package/lib/qoder-plugin/hooks/hooks.json +3 -3
- package/lib/qoder-plugin/skills/pbot/SKILL.md +11 -3
- package/lib/services/agents/acp-run.d.ts +6 -4
- package/lib/services/agents/acp-run.js +62 -43
- package/lib/services/agents/agent-run.d.ts +10 -6
- package/lib/services/agents/agent-run.js +142 -65
- package/lib/services/agents/agent-service.d.ts +3 -21
- package/lib/services/agents/agent-service.js +182 -128
- package/lib/services/history/summary-dimensions/monthly.js +1 -1
- package/lib/services/history/summary-dimensions/session.js +6 -3
- package/lib/services/history/summary-runner.js +3 -3
- package/lib/storage/acp-files.d.ts +5 -8
- package/lib/storage/acp-files.js +34 -40
- package/lib/storage/agent-files.d.ts +19 -10
- package/lib/storage/agent-files.js +147 -43
- package/lib/storage/history-files.js +3 -2
- package/lib/tools/history/contract.d.ts +1 -1
- package/lib/tools/history/contract.js +14 -16
- package/package.json +2 -2
- package/resources/agents/coordinator.md +2 -4
- package/resources/agents/general-purpose.md +2 -4
- package/resources/antigravity/skills/pbot/SKILL.md +6 -23
- package/resources/claude/skills/pbot/SKILL.md +6 -23
- package/resources/plugin/skills/pbot/SKILL.md +11 -3
- package/resources/prompts/history-coordinator.md +1 -1
- package/resources/prompts/history-monthly-summary.md +6 -11
- package/resources/prompts/history-summary.md +6 -11
- package/resources/prompts/plugin-coordinator.md +1 -1
- package/resources/prompts/workspace.md +16 -23
- package/resources/skills/project-maintenance/SKILL.md +14 -21
- package/resources/skills/provider-connections/SKILL.md +23 -36
- package/resources/templates/workspace-agents.md +5 -13
- package/src/extension/acp/member.ts +14 -11
- package/src/extension/acp/worker.ts +31 -28
- package/src/extension/cli/commands/mcp.ts +1 -1
- package/src/extension/cli/commands/upgrade.ts +8 -36
- package/src/extension/cli/commands/workspace.ts +3 -8
- package/src/extension/cli/index.ts +1 -2
- package/src/extension/hosts/dsh/acp-member.ts +1 -1
- package/src/extension/hosts/dsh/command.ts +2 -2
- package/src/extension/hosts/dsh/workspace.ts +5 -4
- package/src/extension/hosts/pi/acp-member.ts +3 -4
- package/src/extension/hosts/pi/command.ts +2 -2
- package/src/extension/hosts/pi/events.ts +1 -1
- package/src/extension/hosts/pi/lifecycle.ts +0 -2
- package/src/extension/hosts/plugin-runtime.ts +1 -11
- package/src/extension/mcp/tool-contract.ts +61 -108
- package/src/extension/mcp/workers.ts +39 -24
- package/src/integrations/acp/agents.ts +28 -27
- package/src/integrations/acp/harnesses/claude.ts +1 -1
- package/src/integrations/agent-resources.ts +5 -5
- package/src/integrations/hosts/antigravity/adapter.ts +0 -1
- package/src/integrations/hosts/claude/adapter.ts +1 -2
- package/src/integrations/hosts/dsh/resources.ts +1 -1
- package/src/integrations/hosts/dsh/session.ts +2 -2
- package/src/integrations/hosts/prompt-hooks.ts +3 -6
- package/src/integrations/installation/cli-update.ts +2 -2
- package/src/integrations/installation/installers/claude.ts +4 -4
- package/src/integrations/installation/installers/qoder.ts +5 -5
- package/src/integrations/installation/upgraders/antigravity.ts +57 -15
- package/src/integrations/installation/upgraders/claude.ts +1 -4
- package/src/integrations/installation/upgraders/codex.ts +85 -15
- package/src/integrations/installation/upgraders/dsh.ts +46 -24
- package/src/integrations/installation/upgraders/pi.ts +18 -11
- package/src/integrations/installation/upgraders/qoder.ts +95 -20
- package/src/model/acp.ts +27 -29
- package/src/model/agent.ts +80 -16
- package/src/model/installation.ts +0 -2
- package/src/pbot.ts +3 -3
- package/src/services/agents/acp-run.ts +81 -49
- package/src/services/agents/agent-run.ts +154 -56
- package/src/services/agents/agent-service.ts +206 -135
- package/src/services/history/summary-dimensions/monthly.ts +1 -1
- package/src/services/history/summary-dimensions/session.ts +6 -3
- package/src/services/history/summary-runner.ts +3 -3
- package/src/services/installation/upgrade-service.ts +1 -5
- package/src/storage/acp-files.ts +50 -45
- package/src/storage/agent-files.ts +159 -46
- package/src/storage/history-files.ts +3 -2
- package/src/tools/history/contract.ts +14 -16
- package/lib/antigravity-plugin/lib/services/workspace/plugin-releases.d.ts +0 -15
- package/lib/antigravity-plugin/lib/services/workspace/plugin-releases.js +0 -126
- package/lib/services/workspace/plugin-releases.d.ts +0 -15
- package/lib/services/workspace/plugin-releases.js +0 -126
- package/src/services/workspace/plugin-releases.ts +0 -121
|
@@ -14,38 +14,31 @@ function formatBackendItem(entry, defaultBackend) {
|
|
|
14
14
|
tags.push("当前宿主");
|
|
15
15
|
return tags.length ? `${entry.backend}(${tags.join(",")})` : entry.backend;
|
|
16
16
|
}
|
|
17
|
-
function summarizeBackends(commands = {}, defaultBackend) {
|
|
18
|
-
const entries = inspectAcpBackends(commands);
|
|
19
|
-
const available = entries.filter(item => item.available);
|
|
20
|
-
const unavailable = entries.filter(item => !item.available);
|
|
21
|
-
const availableText = available.map(item => formatBackendItem(item, defaultBackend)).join("、");
|
|
22
|
-
const unavailableText = unavailable.map(item => formatBackendItem(item, defaultBackend)).join("、");
|
|
23
|
-
const overview = available.length
|
|
24
|
-
? unavailable.length
|
|
25
|
-
? `当前可用助手:${availableText};暂不可用:${unavailableText}。`
|
|
26
|
-
: `当前可用助手:${availableText}。`
|
|
27
|
-
: `当前无可用外部助手(暂不可用:${unavailableText})。`;
|
|
28
|
-
const availableIds = available.map(item => item.backend).join("、");
|
|
29
|
-
return { overview, availableIds };
|
|
30
|
-
}
|
|
31
17
|
function workspaceProperty(workspaceBound) {
|
|
32
18
|
return {
|
|
33
19
|
type: "string",
|
|
34
20
|
description: workspaceBound
|
|
35
|
-
? "
|
|
36
|
-
: "
|
|
21
|
+
? "工作区根目录的绝对路径,默认当前绑定的工作区。"
|
|
22
|
+
: "传目标工作区的绝对路径(workspaceRoot)。省略时使用服务的当前目录。",
|
|
37
23
|
};
|
|
38
24
|
}
|
|
39
25
|
export function buildPbotWorkerTools(commands = {}, defaultBackend, workspaceBound = false) {
|
|
40
|
-
const
|
|
41
|
-
const
|
|
42
|
-
?
|
|
43
|
-
: "
|
|
26
|
+
const available = inspectAcpBackends(commands).filter(item => item.available);
|
|
27
|
+
const overview = available.length
|
|
28
|
+
? "可用助手:" + available.map(item => formatBackendItem(item, defaultBackend)).join("、") + "。"
|
|
29
|
+
: "当前没有可用助手。用 worker_discover 的 backends 查看接入状态。";
|
|
44
30
|
const workspace = workspaceProperty(workspaceBound);
|
|
31
|
+
const workerId = { type: "string", description: "助手会话 ID。" };
|
|
32
|
+
const waitMs = {
|
|
33
|
+
type: "integer",
|
|
34
|
+
minimum: 0,
|
|
35
|
+
maximum: maxWaitMs,
|
|
36
|
+
description: `等待本轮结果的毫秒数,默认 ${defaultWaitMs}。0 表示不等待结果。`,
|
|
37
|
+
};
|
|
45
38
|
return [
|
|
46
39
|
{
|
|
47
40
|
name: "worker_create",
|
|
48
|
-
description: "
|
|
41
|
+
description: "新建独立助手会话,返回 workerId。用 worker_request 发送首个任务。\n" +
|
|
49
42
|
overview,
|
|
50
43
|
annotations: {
|
|
51
44
|
title: "Create Worker",
|
|
@@ -61,19 +54,15 @@ export function buildPbotWorkerTools(commands = {}, defaultBackend, workspaceBou
|
|
|
61
54
|
properties: {
|
|
62
55
|
backend: {
|
|
63
56
|
type: "string",
|
|
64
|
-
description: "
|
|
57
|
+
description: "助手标识或别名,如 claude-code、agy。",
|
|
65
58
|
},
|
|
66
59
|
model: {
|
|
67
60
|
type: "string",
|
|
68
|
-
description: "
|
|
61
|
+
description: "模型 ID、显示名或 provider/model。未指定模型时省略,使用助手默认模型。",
|
|
69
62
|
},
|
|
70
63
|
thinking: {
|
|
71
64
|
type: "string",
|
|
72
|
-
description: "
|
|
73
|
-
},
|
|
74
|
-
cwd: {
|
|
75
|
-
type: "string",
|
|
76
|
-
description: "执行目录(绝对路径或相对工作区路径),默认工作区根目录。",
|
|
65
|
+
description: "思考深度,如 high。未指定时省略,使用助手默认设置。",
|
|
77
66
|
},
|
|
78
67
|
workspace,
|
|
79
68
|
},
|
|
@@ -81,7 +70,7 @@ export function buildPbotWorkerTools(commands = {}, defaultBackend, workspaceBou
|
|
|
81
70
|
},
|
|
82
71
|
{
|
|
83
72
|
name: "worker_close",
|
|
84
|
-
description: "
|
|
73
|
+
description: "任务结束后关闭助手。提前关闭会中断执行。创建结果中 resume 为 true 时,可用原 workerId 续接。",
|
|
85
74
|
annotations: {
|
|
86
75
|
title: "Close Worker",
|
|
87
76
|
readOnlyHint: false,
|
|
@@ -94,18 +83,13 @@ export function buildPbotWorkerTools(commands = {}, defaultBackend, workspaceBou
|
|
|
94
83
|
additionalProperties: false,
|
|
95
84
|
required: ["workerId"],
|
|
96
85
|
properties: {
|
|
97
|
-
workerId
|
|
98
|
-
type: "string",
|
|
99
|
-
description: "助手会话 ID(来自 worker_create 或 worker_discover)。",
|
|
100
|
-
},
|
|
101
|
-
workspace,
|
|
86
|
+
workerId,
|
|
102
87
|
},
|
|
103
88
|
},
|
|
104
89
|
},
|
|
105
90
|
{
|
|
106
91
|
name: "worker_request",
|
|
107
|
-
description: "
|
|
108
|
-
`默认最多等待 ${defaultWaitMs / 1000} 秒(waitMs 设为 0 可立即转后台并行);返回 timedOut 或 nextOffset 用 worker_output,返回 needsResponse 先向用户确认再用 worker_response。`,
|
|
92
|
+
description: "向助手派发任务或在同一会话追问。后台结果用 worker_output 收取。",
|
|
109
93
|
annotations: {
|
|
110
94
|
title: "Send Request to Worker",
|
|
111
95
|
readOnlyHint: false,
|
|
@@ -118,28 +102,18 @@ export function buildPbotWorkerTools(commands = {}, defaultBackend, workspaceBou
|
|
|
118
102
|
additionalProperties: false,
|
|
119
103
|
required: ["workerId", "message"],
|
|
120
104
|
properties: {
|
|
121
|
-
workerId
|
|
122
|
-
type: "string",
|
|
123
|
-
description: "助手会话 ID(来自 worker_create 或 worker_discover)。",
|
|
124
|
-
},
|
|
105
|
+
workerId,
|
|
125
106
|
message: {
|
|
126
107
|
type: "string",
|
|
127
|
-
description: "
|
|
108
|
+
description: "任务或追问。助手看不到主会话历史,首次派发时写明背景、目标、文件路径、约束和交付要求。",
|
|
128
109
|
},
|
|
129
|
-
waitMs
|
|
130
|
-
type: "integer",
|
|
131
|
-
minimum: 0,
|
|
132
|
-
maximum: maxWaitMs,
|
|
133
|
-
description: `最多等待毫秒数(默认 ${defaultWaitMs});0 表示立即返回转后台执行。`,
|
|
134
|
-
},
|
|
135
|
-
workspace,
|
|
110
|
+
waitMs,
|
|
136
111
|
},
|
|
137
112
|
},
|
|
138
113
|
},
|
|
139
114
|
{
|
|
140
115
|
name: "worker_response",
|
|
141
|
-
description: "
|
|
142
|
-
`提交前先向用户确认;提交后默认等待最多 ${defaultWaitMs / 1000} 秒返回后续结果。`,
|
|
116
|
+
description: "收到 needsResponse 时,将权限选项、表单问题或链接交给用户确认,再提交用户的决定。",
|
|
143
117
|
annotations: {
|
|
144
118
|
title: "Respond to Worker Request",
|
|
145
119
|
readOnlyHint: false,
|
|
@@ -152,41 +126,32 @@ export function buildPbotWorkerTools(commands = {}, defaultBackend, workspaceBou
|
|
|
152
126
|
additionalProperties: false,
|
|
153
127
|
required: ["workerId", "action"],
|
|
154
128
|
properties: {
|
|
155
|
-
workerId
|
|
156
|
-
type: "string",
|
|
157
|
-
description: "等待回复的助手会话 ID。",
|
|
158
|
-
},
|
|
129
|
+
workerId,
|
|
159
130
|
action: {
|
|
160
131
|
type: "string",
|
|
161
132
|
enum: [...acpElicitationActions],
|
|
162
|
-
description: "accept
|
|
133
|
+
description: "accept 同意或提交答案,decline 拒绝,cancel 取消请求。",
|
|
163
134
|
},
|
|
164
135
|
requestId: {
|
|
165
136
|
type: "string",
|
|
166
|
-
description: "
|
|
137
|
+
description: "待回复的请求 ID。仅有一条待处理请求时可省略。",
|
|
167
138
|
},
|
|
168
139
|
optionId: {
|
|
169
140
|
type: "string",
|
|
170
|
-
description: "
|
|
141
|
+
description: "允许或拒绝操作时填用户所选权限的 ID。省略时优先单次,缺少单次选项时可能采用长期选项。",
|
|
171
142
|
},
|
|
172
143
|
content: {
|
|
173
144
|
type: "object",
|
|
174
145
|
additionalProperties: true,
|
|
175
|
-
description: "
|
|
176
|
-
},
|
|
177
|
-
waitMs: {
|
|
178
|
-
type: "integer",
|
|
179
|
-
minimum: 0,
|
|
180
|
-
maximum: maxWaitMs,
|
|
181
|
-
description: `提交后最多等待毫秒数(默认 ${defaultWaitMs});0 表示立即返回。`,
|
|
146
|
+
description: "接受表单时,按表单字段填写答案。值可为字符串、数字、布尔值或字符串数组。",
|
|
182
147
|
},
|
|
183
|
-
|
|
148
|
+
waitMs,
|
|
184
149
|
},
|
|
185
150
|
},
|
|
186
151
|
},
|
|
187
152
|
{
|
|
188
153
|
name: "worker_output",
|
|
189
|
-
description: "
|
|
154
|
+
description: "读取助手最近一轮的结果。后台执行或返回 timedOut 时,用原 workerId 继续等待。",
|
|
190
155
|
annotations: {
|
|
191
156
|
title: "Get Worker Output",
|
|
192
157
|
readOnlyHint: true,
|
|
@@ -199,28 +164,19 @@ export function buildPbotWorkerTools(commands = {}, defaultBackend, workspaceBou
|
|
|
199
164
|
additionalProperties: false,
|
|
200
165
|
required: ["workerId"],
|
|
201
166
|
properties: {
|
|
202
|
-
workerId
|
|
203
|
-
type: "string",
|
|
204
|
-
description: "助手会话 ID。",
|
|
205
|
-
},
|
|
167
|
+
workerId,
|
|
206
168
|
offset: {
|
|
207
169
|
type: "integer",
|
|
208
170
|
minimum: 0,
|
|
209
|
-
description: "
|
|
210
|
-
},
|
|
211
|
-
waitMs: {
|
|
212
|
-
type: "integer",
|
|
213
|
-
minimum: 0,
|
|
214
|
-
maximum: maxWaitMs,
|
|
215
|
-
description: `运行中最多等待毫秒数(默认 ${defaultWaitMs});已结束或翻页时立即返回。`,
|
|
171
|
+
description: "续读传上页的 nextOffset,默认从 0 开始。",
|
|
216
172
|
},
|
|
217
|
-
|
|
173
|
+
waitMs,
|
|
218
174
|
},
|
|
219
175
|
},
|
|
220
176
|
},
|
|
221
177
|
{
|
|
222
178
|
name: "worker_discover",
|
|
223
|
-
description: "
|
|
179
|
+
description: "查找可复用的会话、查看助手状态或核对模型选项。查询模型会临时启动目标助手。",
|
|
224
180
|
annotations: {
|
|
225
181
|
title: "Discover Workers, Backends & Models",
|
|
226
182
|
readOnlyHint: true,
|
|
@@ -236,21 +192,19 @@ export function buildPbotWorkerTools(commands = {}, defaultBackend, workspaceBou
|
|
|
236
192
|
target: {
|
|
237
193
|
type: "string",
|
|
238
194
|
enum: [...discoverTargets],
|
|
239
|
-
description: "overview
|
|
195
|
+
description: "overview(默认)列助手及当前会话拥有的 worker,workers 只查会话,backends 只查助手可用情况,models 查模型与思考深度。",
|
|
240
196
|
},
|
|
241
197
|
workerId: {
|
|
242
198
|
type: "string",
|
|
243
|
-
description: "
|
|
199
|
+
description: "查 workers 时可指定单个会话,省略列出全部所属会话。",
|
|
244
200
|
},
|
|
245
201
|
backend: {
|
|
246
202
|
type: "string",
|
|
247
|
-
description:
|
|
248
|
-
? `仅 target="models" 可用(${modelsBackendHint}):目标助手标识,支持别名;当前可用:${availableIds}。`
|
|
249
|
-
: `仅 target="models" 可用(${modelsBackendHint}):目标助手标识,支持别名。`,
|
|
203
|
+
description: defaultBackend ? `查 models 时选择助手,默认 ${defaultBackend}。` : "查 models 时必填助手标识。",
|
|
250
204
|
},
|
|
251
205
|
model: {
|
|
252
206
|
type: "string",
|
|
253
|
-
description: "
|
|
207
|
+
description: "查 models 时可指定模型以查看它支持的思考深度。",
|
|
254
208
|
},
|
|
255
209
|
workspace,
|
|
256
210
|
},
|
|
@@ -263,7 +217,7 @@ export function buildWorkspaceMcpTools(workspaceBound = false) {
|
|
|
263
217
|
return [
|
|
264
218
|
{
|
|
265
219
|
name: "workspace_mcp_discover",
|
|
266
|
-
description: "
|
|
220
|
+
description: "查找工作区共享的 MCP 服务,以及服务提供的工具和参数。",
|
|
267
221
|
annotations: {
|
|
268
222
|
title: "Discover Workspace MCP Servers & Tools",
|
|
269
223
|
readOnlyHint: true,
|
|
@@ -278,7 +232,7 @@ export function buildWorkspaceMcpTools(workspaceBound = false) {
|
|
|
278
232
|
properties: {
|
|
279
233
|
server: {
|
|
280
234
|
type: "string",
|
|
281
|
-
description: "
|
|
235
|
+
description: "填服务名列出其工具,省略则列出已配置的服务。",
|
|
282
236
|
},
|
|
283
237
|
workspace,
|
|
284
238
|
},
|
|
@@ -286,11 +240,11 @@ export function buildWorkspaceMcpTools(workspaceBound = false) {
|
|
|
286
240
|
},
|
|
287
241
|
{
|
|
288
242
|
name: "workspace_mcp_call",
|
|
289
|
-
description: "
|
|
243
|
+
description: "执行工作区共享 MCP 服务的工具,读写效果取决于所选工具。工具名和参数可用 workspace_mcp_discover 查询。",
|
|
290
244
|
annotations: {
|
|
291
245
|
title: "Call Workspace MCP Tool",
|
|
292
246
|
readOnlyHint: false,
|
|
293
|
-
destructiveHint:
|
|
247
|
+
destructiveHint: true,
|
|
294
248
|
idempotentHint: false,
|
|
295
249
|
openWorldHint: true,
|
|
296
250
|
},
|
|
@@ -301,16 +255,16 @@ export function buildWorkspaceMcpTools(workspaceBound = false) {
|
|
|
301
255
|
properties: {
|
|
302
256
|
server: {
|
|
303
257
|
type: "string",
|
|
304
|
-
description: "
|
|
258
|
+
description: "工作区中登记的服务名。",
|
|
305
259
|
},
|
|
306
260
|
tool: {
|
|
307
261
|
type: "string",
|
|
308
|
-
description: "
|
|
262
|
+
description: "该服务提供的工具名。",
|
|
309
263
|
},
|
|
310
264
|
arguments: {
|
|
311
265
|
type: "object",
|
|
312
266
|
additionalProperties: true,
|
|
313
|
-
description: "
|
|
267
|
+
description: "按所选工具的参数定义填写,默认 {}。",
|
|
314
268
|
},
|
|
315
269
|
workspace,
|
|
316
270
|
},
|
|
@@ -323,7 +277,7 @@ export function buildHistoryMcpTools(workspaceBound = false) {
|
|
|
323
277
|
return [
|
|
324
278
|
{
|
|
325
279
|
name: "history_search",
|
|
326
|
-
description: "
|
|
280
|
+
description: "查找工作区各宿主归档的问答或摘要。用命中项的 id 调用 history_read 可读全文。",
|
|
327
281
|
annotations: {
|
|
328
282
|
title: "Search Workspace History",
|
|
329
283
|
readOnlyHint: true,
|
|
@@ -338,38 +292,38 @@ export function buildHistoryMcpTools(workspaceBound = false) {
|
|
|
338
292
|
properties: {
|
|
339
293
|
host: {
|
|
340
294
|
type: "string",
|
|
341
|
-
description: "
|
|
295
|
+
description: "按来源宿主筛选,如 pi 或 claude。默认查全部来源。",
|
|
342
296
|
},
|
|
343
297
|
dimension: {
|
|
344
298
|
type: "string",
|
|
345
|
-
description: "
|
|
299
|
+
description: "raw 为原始问答,session、monthly 等为摘要维度。关键词搜索默认查全部。",
|
|
346
300
|
},
|
|
347
301
|
query: {
|
|
348
302
|
type: "string",
|
|
349
|
-
description: "
|
|
303
|
+
description: "匹配连续文本,忽略大小写。省略时列会话,指定摘要维度则列该维度的摘要。",
|
|
350
304
|
},
|
|
351
305
|
sessionId: {
|
|
352
306
|
type: "string",
|
|
353
|
-
description: "
|
|
307
|
+
description: "按原始会话 ID 筛选。",
|
|
354
308
|
},
|
|
355
309
|
from: {
|
|
356
310
|
type: "string",
|
|
357
|
-
description: "ISO
|
|
311
|
+
description: "时间区间起点(含),用 ISO 日期或时间。",
|
|
358
312
|
},
|
|
359
313
|
to: {
|
|
360
314
|
type: "string",
|
|
361
|
-
description: "ISO
|
|
315
|
+
description: "时间区间终点(含),仅填 ISO 日期表示该日 UTC 零点。",
|
|
362
316
|
},
|
|
363
317
|
offset: {
|
|
364
318
|
type: "integer",
|
|
365
319
|
minimum: 0,
|
|
366
|
-
description: "
|
|
320
|
+
description: "结果起点,默认 0。翻页传上页的 nextOffset。",
|
|
367
321
|
},
|
|
368
322
|
limit: {
|
|
369
323
|
type: "integer",
|
|
370
324
|
minimum: 1,
|
|
371
325
|
maximum: historyPageLimits.search.max,
|
|
372
|
-
description:
|
|
326
|
+
description: `每页条数,默认 ${historyPageLimits.search.default}。`,
|
|
373
327
|
},
|
|
374
328
|
workspace,
|
|
375
329
|
},
|
|
@@ -377,7 +331,7 @@ export function buildHistoryMcpTools(workspaceBound = false) {
|
|
|
377
331
|
},
|
|
378
332
|
{
|
|
379
333
|
name: "history_read",
|
|
380
|
-
description: "
|
|
334
|
+
description: "读取历史节点的正文和上下级。沿子节点可从月度汇总找到会话摘要和原始问答。",
|
|
381
335
|
annotations: {
|
|
382
336
|
title: "Read Workspace History Node",
|
|
383
337
|
readOnlyHint: true,
|
|
@@ -392,27 +346,27 @@ export function buildHistoryMcpTools(workspaceBound = false) {
|
|
|
392
346
|
properties: {
|
|
393
347
|
id: {
|
|
394
348
|
type: "string",
|
|
395
|
-
description: "
|
|
349
|
+
description: "搜索结果、父节点或子节点的 id。",
|
|
396
350
|
},
|
|
397
351
|
host: {
|
|
398
352
|
type: "string",
|
|
399
|
-
description: "
|
|
353
|
+
description: "节点 id 重名时填来源宿主。",
|
|
400
354
|
},
|
|
401
355
|
offset: {
|
|
402
356
|
type: "integer",
|
|
403
357
|
minimum: 0,
|
|
404
|
-
description: "正文字符偏移,默认 0
|
|
358
|
+
description: "正文字符偏移,默认 0。续读传上页的 nextOffset。",
|
|
405
359
|
},
|
|
406
360
|
limit: {
|
|
407
361
|
type: "integer",
|
|
408
362
|
minimum: 1,
|
|
409
363
|
maximum: historyPageLimits.read.max,
|
|
410
|
-
description:
|
|
364
|
+
description: `每页正文字符数,默认 ${historyPageLimits.read.default}。`,
|
|
411
365
|
},
|
|
412
366
|
childrenOffset: {
|
|
413
367
|
type: "integer",
|
|
414
368
|
minimum: 0,
|
|
415
|
-
description: "
|
|
369
|
+
description: "子节点起点,默认 0。翻页传上页的 nextChildrenOffset。",
|
|
416
370
|
},
|
|
417
371
|
workspace,
|
|
418
372
|
},
|
|
@@ -7,7 +7,7 @@ export declare function buildMcpInstructions(options: {
|
|
|
7
7
|
}): string;
|
|
8
8
|
export declare const mcpWorkerOnlyInstructions: string;
|
|
9
9
|
export declare const mcpInstructions: string;
|
|
10
|
-
export declare function defaultWorkerDirectory(): string;
|
|
10
|
+
export declare function defaultWorkerDirectory(workspaceRoot: string): string;
|
|
11
11
|
/** Parse Pi/dsh `/pbot worker ...` CLI arguments into a canonical MCP tool call. */
|
|
12
12
|
export declare function parseWorkerCommand(raw: string): {
|
|
13
13
|
tool: McpWorkerToolName;
|
|
@@ -33,6 +33,7 @@ export declare class McpWorkerRuntime {
|
|
|
33
33
|
get nativeHistory(): boolean;
|
|
34
34
|
private resolveBackend;
|
|
35
35
|
private resolveWorkspace;
|
|
36
|
+
private resolveWorkerWorkspace;
|
|
36
37
|
private workerService;
|
|
37
38
|
private resolveToolContext;
|
|
38
39
|
serverInstructions(): Promise<string>;
|
|
@@ -63,10 +64,6 @@ export declare class McpWorkerRuntime {
|
|
|
63
64
|
type: string;
|
|
64
65
|
description: string;
|
|
65
66
|
};
|
|
66
|
-
cwd: {
|
|
67
|
-
type: string;
|
|
68
|
-
description: string;
|
|
69
|
-
};
|
|
70
67
|
workspace: {
|
|
71
68
|
type: string;
|
|
72
69
|
description: string;
|
|
@@ -101,14 +98,10 @@ export declare class McpWorkerRuntime {
|
|
|
101
98
|
type: string;
|
|
102
99
|
description: string;
|
|
103
100
|
};
|
|
104
|
-
workspace: {
|
|
105
|
-
type: string;
|
|
106
|
-
description: string;
|
|
107
|
-
};
|
|
108
101
|
backend?: never;
|
|
109
102
|
model?: never;
|
|
110
103
|
thinking?: never;
|
|
111
|
-
|
|
104
|
+
workspace?: never;
|
|
112
105
|
message?: never;
|
|
113
106
|
waitMs?: never;
|
|
114
107
|
action?: never;
|
|
@@ -148,14 +141,10 @@ export declare class McpWorkerRuntime {
|
|
|
148
141
|
maximum: number;
|
|
149
142
|
description: string;
|
|
150
143
|
};
|
|
151
|
-
workspace: {
|
|
152
|
-
type: string;
|
|
153
|
-
description: string;
|
|
154
|
-
};
|
|
155
144
|
backend?: never;
|
|
156
145
|
model?: never;
|
|
157
146
|
thinking?: never;
|
|
158
|
-
|
|
147
|
+
workspace?: never;
|
|
159
148
|
action?: never;
|
|
160
149
|
requestId?: never;
|
|
161
150
|
optionId?: never;
|
|
@@ -207,14 +196,10 @@ export declare class McpWorkerRuntime {
|
|
|
207
196
|
maximum: number;
|
|
208
197
|
description: string;
|
|
209
198
|
};
|
|
210
|
-
workspace: {
|
|
211
|
-
type: string;
|
|
212
|
-
description: string;
|
|
213
|
-
};
|
|
214
199
|
backend?: never;
|
|
215
200
|
model?: never;
|
|
216
201
|
thinking?: never;
|
|
217
|
-
|
|
202
|
+
workspace?: never;
|
|
218
203
|
message?: never;
|
|
219
204
|
offset?: never;
|
|
220
205
|
target?: never;
|
|
@@ -250,14 +235,10 @@ export declare class McpWorkerRuntime {
|
|
|
250
235
|
maximum: number;
|
|
251
236
|
description: string;
|
|
252
237
|
};
|
|
253
|
-
workspace: {
|
|
254
|
-
type: string;
|
|
255
|
-
description: string;
|
|
256
|
-
};
|
|
257
238
|
backend?: never;
|
|
258
239
|
model?: never;
|
|
259
240
|
thinking?: never;
|
|
260
|
-
|
|
241
|
+
workspace?: never;
|
|
261
242
|
message?: never;
|
|
262
243
|
action?: never;
|
|
263
244
|
requestId?: never;
|
|
@@ -303,7 +284,6 @@ export declare class McpWorkerRuntime {
|
|
|
303
284
|
description: string;
|
|
304
285
|
};
|
|
305
286
|
thinking?: never;
|
|
306
|
-
cwd?: never;
|
|
307
287
|
message?: never;
|
|
308
288
|
waitMs?: never;
|
|
309
289
|
action?: never;
|
|
@@ -486,7 +466,7 @@ export declare class McpWorkerRuntime {
|
|
|
486
466
|
/** Wait until ACP handshake and model/thinking configuration finish so invalid options fail synchronously on create/resume. */
|
|
487
467
|
private waitReady;
|
|
488
468
|
private waitFor;
|
|
489
|
-
callTool(toolName: string, input: unknown, progress?: ProgressReporter): Promise<unknown>;
|
|
469
|
+
callTool(toolName: string, input: unknown, progress?: ProgressReporter, defaultWorkspace?: string): Promise<unknown>;
|
|
490
470
|
close(preserve?: boolean): Promise<void>;
|
|
491
471
|
}
|
|
492
472
|
export declare function handleMcpRequest(runtime: McpWorkerRuntime, message: unknown, notify?: (notification: Record<string, unknown>) => void): Promise<Record<string, unknown> | null>;
|