personal-bot 0.4.0 → 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/docs/architecture/extensibility.md +3 -3
- package/docs/architecture/model-context.md +6 -3
- package/docs/guides/cross-harness-workers.md +1 -1
- package/docs/guides/workspace-configuration.md +1 -1
- package/docs/hosts/claude-code.md +1 -1
- package/docs/hosts/codex-qoder.md +3 -1
- package/hooks/hooks.json +3 -0
- package/lib/antigravity-plugin/lib/extension/acp-worker.js +3 -3
- package/lib/antigravity-plugin/lib/extension/cli.js +33 -34
- package/lib/antigravity-plugin/lib/extension/hosts/plugin-runtime.js +1 -1
- package/lib/antigravity-plugin/lib/extension/mcp.js +70 -105
- 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/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/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-worker.js +3 -3
- package/lib/extension/cli.js +33 -34
- package/lib/extension/hosts/dsh/command.js +1 -1
- package/lib/extension/hosts/dsh/workspace.js +4 -2
- package/lib/extension/hosts/plugin-runtime.js +1 -1
- package/lib/extension/mcp/tool-contract.js +61 -99
- package/lib/extension/mcp/workers.js +5 -7
- package/lib/extension/mcp.js +70 -105
- 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/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/agent-service.js +2 -2
- 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/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/cli/commands/mcp.ts +1 -1
- package/src/extension/hosts/dsh/command.ts +1 -1
- package/src/extension/hosts/dsh/workspace.ts +4 -1
- package/src/extension/hosts/pi/command.ts +1 -1
- package/src/extension/hosts/pi/events.ts +1 -1
- package/src/extension/hosts/plugin-runtime.ts +1 -1
- package/src/extension/mcp/tool-contract.ts +61 -100
- package/src/extension/mcp/workers.ts +5 -7
- 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/prompt-hooks.ts +3 -6
- package/src/pbot.ts +2 -2
- package/src/services/agents/agent-service.ts +2 -2
- 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/storage/history-files.ts +3 -2
- package/src/tools/history/contract.ts +14 -16
|
@@ -108,11 +108,11 @@ export class AgentService {
|
|
|
108
108
|
}
|
|
109
109
|
const target = input.requestId ? pending.find(item => item.requestId === input.requestId) : pending[0];
|
|
110
110
|
requireThat(target, input.requestId
|
|
111
|
-
?
|
|
111
|
+
? `没有待回复的请求 ${input.requestId}。用 worker_discover 查询 target="workers"、workerId="${id}" 的当前请求。`
|
|
112
112
|
: "当前没有待回复的请求。");
|
|
113
113
|
this.files.ensureSubdirectory(id, "interactions");
|
|
114
114
|
if (target.kind === "permission") {
|
|
115
|
-
requireThat(input.content === undefined, "
|
|
115
|
+
requireThat(input.content === undefined, "请移除 content。权限请求用 action 回复,选择具体权限范围时加上 optionId。");
|
|
116
116
|
let resolved: string | null = null;
|
|
117
117
|
if (input.action === "cancel") {
|
|
118
118
|
requireThat(input.optionId === undefined, "action 为 cancel 时不能同时指定 optionId。");
|
|
@@ -57,7 +57,7 @@ function formatSessionSummaries(summaries: readonly SummaryArtifact[]): string {
|
|
|
57
57
|
export const monthlySummaryDimension: SummaryDimension = {
|
|
58
58
|
id: "monthly",
|
|
59
59
|
title: "月度历史汇总",
|
|
60
|
-
description: "
|
|
60
|
+
description: "按会话开始的 UTC 月份汇总会话摘要,可从月度结果查回各会话。",
|
|
61
61
|
requiresMonthlyLayout: true,
|
|
62
62
|
|
|
63
63
|
plan(
|
|
@@ -46,7 +46,7 @@ function isStrictUnchangedPrefix(
|
|
|
46
46
|
export const sessionSummaryDimension: SummaryDimension = {
|
|
47
47
|
id: "session",
|
|
48
48
|
title: "会话任务摘要",
|
|
49
|
-
description: "
|
|
49
|
+
description: "汇总单次会话的目标、决定、结果和未决事项。",
|
|
50
50
|
|
|
51
51
|
plan(
|
|
52
52
|
raws: readonly RawHistory[],
|
|
@@ -119,9 +119,12 @@ export const sessionSummaryDimension: SummaryDimension = {
|
|
|
119
119
|
...heading,
|
|
120
120
|
`【已有摘要(${task.existing.from} — ${task.existing.to})】\n${task.existing.text}`,
|
|
121
121
|
`【新增对话】\n${formatExchanges(task.addedExchanges)}`,
|
|
122
|
-
"在已有摘要基础上合并新增对话,输出更新后的完整摘要:保留仍有效的事实,用新决定覆盖旧决定,去重并保持简洁。",
|
|
123
122
|
].join("\n\n");
|
|
124
|
-
return {
|
|
123
|
+
return {
|
|
124
|
+
system: system + "\n合并已有摘要与新增对话,输出完整摘要。保留仍有效的事实,用后续明确的决定更新相应结论。",
|
|
125
|
+
prompt,
|
|
126
|
+
maxTokens: 2048,
|
|
127
|
+
};
|
|
125
128
|
}
|
|
126
129
|
const prompt = [
|
|
127
130
|
...heading,
|
|
@@ -94,9 +94,9 @@ function evaluateSummaryReminder(
|
|
|
94
94
|
|
|
95
95
|
const rawAgeDays = Math.floor((nowMs - oldestRawMs) / dayMs);
|
|
96
96
|
const daysSinceLastSummary = latestSummaryMs === undefined ? undefined : Math.floor((nowMs - latestSummaryMs) / dayMs);
|
|
97
|
-
const
|
|
98
|
-
|
|
99
|
-
|
|
97
|
+
const lastUpdate = daysSinceLastSummary === undefined ? "尚无摘要" : `上次更新摘要在 ${daysSinceLastSummary} 天前`;
|
|
98
|
+
const message = `工作区已积累 ${rawAgeDays} 天的历史,${lastUpdate},${pendingCount} 项待摘要。` +
|
|
99
|
+
"可在工作区根目录运行 pbot history summary,或在 Pi、dsh 会话中输入 /pbot history summary。";
|
|
100
100
|
|
|
101
101
|
return {
|
|
102
102
|
rawCount: raws.length,
|
|
@@ -305,8 +305,9 @@ export class HistoryFiles {
|
|
|
305
305
|
summaryCount,
|
|
306
306
|
total,
|
|
307
307
|
message:
|
|
308
|
-
|
|
309
|
-
|
|
308
|
+
`当前按年月读取历史,平铺目录中的 ${rawCount} 份原文和 ${summaryCount} 份摘要尚未纳入检索。` +
|
|
309
|
+
"可在工作区根目录用 pbot history migrate --dry-run 预览,用 pbot history migrate 执行(Pi、dsh 可用 /pbot history migrate)。" +
|
|
310
|
+
'要继续使用平铺目录,可在 .pbot/config.json 中设置 "history": { "layout": "flat" }。',
|
|
310
311
|
};
|
|
311
312
|
}
|
|
312
313
|
|
|
@@ -10,7 +10,7 @@ const node = Type.Object({
|
|
|
10
10
|
host: identifier,
|
|
11
11
|
id: Type.String(),
|
|
12
12
|
kind: Type.Union([Type.Literal("session"), Type.Literal("exchange"), Type.Literal("summary")], {
|
|
13
|
-
description: "session
|
|
13
|
+
description: "session 为会话,summary 为摘要,exchange 为单轮问答原文。",
|
|
14
14
|
}),
|
|
15
15
|
dimension: Type.Optional(identifier),
|
|
16
16
|
sessionId: Type.String(),
|
|
@@ -19,7 +19,7 @@ const node = Type.Object({
|
|
|
19
19
|
from: Type.String(),
|
|
20
20
|
to: Type.String(),
|
|
21
21
|
ready: Type.Boolean({ description: "正文或摘要是否已生成。" }),
|
|
22
|
-
completed: Type.Boolean({ description: "
|
|
22
|
+
completed: Type.Boolean({ description: "false 表示会话或问答中断或未完成。" }),
|
|
23
23
|
});
|
|
24
24
|
|
|
25
25
|
export const historyResultSchema = Type.Object({
|
|
@@ -50,24 +50,22 @@ export const historyResultSchema = Type.Object({
|
|
|
50
50
|
});
|
|
51
51
|
|
|
52
52
|
export const historyDescription =
|
|
53
|
-
"
|
|
54
|
-
"search 按不区分大小写的连续关键词匹配原文与摘要,省略 query 列出各会话或指定维度摘要;" +
|
|
55
|
-
"read 按 id 读取正文与上下级(可从 monthly 汇总下钻至 session 摘要和 exchange 原文),用 nextOffset 与 nextChildrenOffset 分页续读。";
|
|
53
|
+
"查找工作区各宿主归档的问答和摘要。沿子节点可从月度汇总查到会话摘要和原始问答。";
|
|
56
54
|
|
|
57
55
|
export const historyParameters = Type.Object({
|
|
58
56
|
action: Type.Union([Type.Literal("search"), Type.Literal("read")], {
|
|
59
|
-
description: "search
|
|
57
|
+
description: "search 搜索或列出记录,read 按 id 读取正文和上下级。",
|
|
60
58
|
}),
|
|
61
|
-
host: nullable(Type.String({ pattern: historyIdentifierPattern.source, description: "
|
|
62
|
-
dimension: nullable(Type.String({ pattern: historyIdentifierPattern.source, description: "
|
|
63
|
-
query: nullable(Type.String({ description: "
|
|
64
|
-
sessionId: nullable(Type.String({ description: "
|
|
65
|
-
from: nullable(Type.String({ description: "
|
|
66
|
-
to: nullable(Type.String({ description: "
|
|
67
|
-
id: nullable(Type.String({ description: "
|
|
68
|
-
offset: nullable(Type.Integer({ minimum: 0, description: "search
|
|
69
|
-
limit: nullable(Type.Integer({ minimum: 1, maximum: historyPageLimits.read.max, description: `search
|
|
70
|
-
childrenOffset: nullable(Type.Integer({ minimum: 0, description: "
|
|
59
|
+
host: nullable(Type.String({ pattern: historyIdentifierPattern.source, description: "来源宿主,如 pi 或 claude。可筛选搜索结果或区分重名节点。" })),
|
|
60
|
+
dimension: nullable(Type.String({ pattern: historyIdentifierPattern.source, description: "search 的范围。raw 为原始问答,session、monthly 等为摘要维度。关键词搜索默认查全部。" })),
|
|
61
|
+
query: nullable(Type.String({ description: "search 匹配连续文本,忽略大小写。省略时列会话,指定摘要维度则列该维度的摘要。" })),
|
|
62
|
+
sessionId: nullable(Type.String({ description: "search 按原始会话 ID 筛选。" })),
|
|
63
|
+
from: nullable(Type.String({ description: "search 时间区间起点(含),用 ISO 日期或时间。" })),
|
|
64
|
+
to: nullable(Type.String({ description: "search 时间区间终点(含),仅填日期表示该日 UTC 零点。" })),
|
|
65
|
+
id: nullable(Type.String({ description: "read 必填。使用搜索结果、父节点或子节点的 id。" })),
|
|
66
|
+
offset: nullable(Type.Integer({ minimum: 0, description: "翻页传上页的 nextOffset。search 按条目,read 按正文字符,默认从 0 开始。" })),
|
|
67
|
+
limit: nullable(Type.Integer({ minimum: 1, maximum: historyPageLimits.read.max, description: `search 每页默认 ${historyPageLimits.search.default} 条,最多 ${historyPageLimits.search.max} 条。read 每页默认 ${historyPageLimits.read.default} 个字符。` })),
|
|
68
|
+
childrenOffset: nullable(Type.Integer({ minimum: 0, description: "read 的子节点起点,默认 0。翻页传上页的 nextChildrenOffset。" })),
|
|
71
69
|
}, { additionalProperties: false });
|
|
72
70
|
|
|
73
71
|
export type HistoryInput =
|