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.
Files changed (100) hide show
  1. package/.claude-plugin/marketplace.json +3 -3
  2. package/.claude-plugin/plugin.json +2 -2
  3. package/docs/architecture/extensibility.md +3 -3
  4. package/docs/architecture/model-context.md +6 -3
  5. package/docs/guides/cross-harness-workers.md +1 -1
  6. package/docs/guides/workspace-configuration.md +1 -1
  7. package/docs/hosts/claude-code.md +1 -1
  8. package/docs/hosts/codex-qoder.md +3 -1
  9. package/hooks/hooks.json +3 -0
  10. package/lib/antigravity-plugin/lib/extension/acp-worker.js +3 -3
  11. package/lib/antigravity-plugin/lib/extension/cli.js +33 -34
  12. package/lib/antigravity-plugin/lib/extension/hosts/plugin-runtime.js +1 -1
  13. package/lib/antigravity-plugin/lib/extension/mcp.js +70 -105
  14. package/lib/antigravity-plugin/lib/integrations/agent-resources.d.ts +2 -2
  15. package/lib/antigravity-plugin/lib/integrations/agent-resources.js +3 -3
  16. package/lib/antigravity-plugin/lib/integrations/hosts/antigravity/adapter.js +0 -1
  17. package/lib/antigravity-plugin/lib/integrations/hosts/claude/adapter.js +1 -2
  18. package/lib/antigravity-plugin/lib/integrations/hosts/dsh/resources.d.ts +1 -1
  19. package/lib/antigravity-plugin/lib/integrations/hosts/prompt-hooks.js +4 -7
  20. package/lib/antigravity-plugin/lib/services/history/summary-dimensions/monthly.js +1 -1
  21. package/lib/antigravity-plugin/lib/services/history/summary-dimensions/session.js +6 -3
  22. package/lib/antigravity-plugin/lib/services/history/summary-runner.js +3 -3
  23. package/lib/antigravity-plugin/lib/storage/history-files.js +3 -2
  24. package/lib/antigravity-plugin/package.json +1 -1
  25. package/lib/antigravity-plugin/plugin.json +2 -2
  26. package/lib/antigravity-plugin/resources/agents/coordinator.md +2 -4
  27. package/lib/antigravity-plugin/resources/agents/general-purpose.md +2 -4
  28. package/lib/antigravity-plugin/resources/prompts/history-monthly-summary.md +6 -11
  29. package/lib/antigravity-plugin/resources/prompts/history-summary.md +6 -11
  30. package/lib/antigravity-plugin/resources/prompts/plugin-coordinator.md +1 -1
  31. package/lib/antigravity-plugin/resources/prompts/workspace.md +16 -23
  32. package/lib/antigravity-plugin/resources/skills/project-maintenance/SKILL.md +14 -21
  33. package/lib/antigravity-plugin/resources/skills/provider-connections/SKILL.md +23 -36
  34. package/lib/antigravity-plugin/resources/templates/workspace-agents.md +5 -13
  35. package/lib/antigravity-plugin/skills/pbot/SKILL.md +6 -23
  36. package/lib/antigravity-plugin/skills/project-maintenance/SKILL.md +14 -21
  37. package/lib/antigravity-plugin/skills/provider-connections/SKILL.md +23 -36
  38. package/lib/codex-marketplace/plugins/personal-bot/.codex-plugin/plugin.json +2 -2
  39. package/lib/codex-marketplace/plugins/personal-bot/.mcp.json +2 -2
  40. package/lib/codex-marketplace/plugins/personal-bot/hooks/hooks.json +3 -3
  41. package/lib/codex-marketplace/plugins/personal-bot/skills/pbot/SKILL.md +11 -3
  42. package/lib/extension/acp-worker.js +3 -3
  43. package/lib/extension/cli.js +33 -34
  44. package/lib/extension/hosts/dsh/command.js +1 -1
  45. package/lib/extension/hosts/dsh/workspace.js +4 -2
  46. package/lib/extension/hosts/plugin-runtime.js +1 -1
  47. package/lib/extension/mcp/tool-contract.js +61 -99
  48. package/lib/extension/mcp/workers.js +5 -7
  49. package/lib/extension/mcp.js +70 -105
  50. package/lib/integrations/agent-resources.d.ts +2 -2
  51. package/lib/integrations/agent-resources.js +3 -3
  52. package/lib/integrations/hosts/antigravity/adapter.js +0 -1
  53. package/lib/integrations/hosts/claude/adapter.js +1 -2
  54. package/lib/integrations/hosts/dsh/resources.d.ts +1 -1
  55. package/lib/integrations/hosts/prompt-hooks.js +4 -7
  56. package/lib/qoder-plugin/.mcp.json +2 -2
  57. package/lib/qoder-plugin/.qoder-plugin/plugin.json +2 -2
  58. package/lib/qoder-plugin/hooks/hooks.json +3 -3
  59. package/lib/qoder-plugin/skills/pbot/SKILL.md +11 -3
  60. package/lib/services/agents/agent-service.js +2 -2
  61. package/lib/services/history/summary-dimensions/monthly.js +1 -1
  62. package/lib/services/history/summary-dimensions/session.js +6 -3
  63. package/lib/services/history/summary-runner.js +3 -3
  64. package/lib/storage/history-files.js +3 -2
  65. package/lib/tools/history/contract.d.ts +1 -1
  66. package/lib/tools/history/contract.js +14 -16
  67. package/package.json +2 -2
  68. package/resources/agents/coordinator.md +2 -4
  69. package/resources/agents/general-purpose.md +2 -4
  70. package/resources/antigravity/skills/pbot/SKILL.md +6 -23
  71. package/resources/claude/skills/pbot/SKILL.md +6 -23
  72. package/resources/plugin/skills/pbot/SKILL.md +11 -3
  73. package/resources/prompts/history-coordinator.md +1 -1
  74. package/resources/prompts/history-monthly-summary.md +6 -11
  75. package/resources/prompts/history-summary.md +6 -11
  76. package/resources/prompts/plugin-coordinator.md +1 -1
  77. package/resources/prompts/workspace.md +16 -23
  78. package/resources/skills/project-maintenance/SKILL.md +14 -21
  79. package/resources/skills/provider-connections/SKILL.md +23 -36
  80. package/resources/templates/workspace-agents.md +5 -13
  81. package/src/extension/cli/commands/mcp.ts +1 -1
  82. package/src/extension/hosts/dsh/command.ts +1 -1
  83. package/src/extension/hosts/dsh/workspace.ts +4 -1
  84. package/src/extension/hosts/pi/command.ts +1 -1
  85. package/src/extension/hosts/pi/events.ts +1 -1
  86. package/src/extension/hosts/plugin-runtime.ts +1 -1
  87. package/src/extension/mcp/tool-contract.ts +61 -100
  88. package/src/extension/mcp/workers.ts +5 -7
  89. package/src/integrations/agent-resources.ts +5 -5
  90. package/src/integrations/hosts/antigravity/adapter.ts +0 -1
  91. package/src/integrations/hosts/claude/adapter.ts +1 -2
  92. package/src/integrations/hosts/dsh/resources.ts +1 -1
  93. package/src/integrations/hosts/prompt-hooks.ts +3 -6
  94. package/src/pbot.ts +2 -2
  95. package/src/services/agents/agent-service.ts +2 -2
  96. package/src/services/history/summary-dimensions/monthly.ts +1 -1
  97. package/src/services/history/summary-dimensions/session.ts +6 -3
  98. package/src/services/history/summary-runner.ts +3 -3
  99. package/src/storage/history-files.ts +3 -2
  100. package/src/tools/history/contract.ts +14 -16
@@ -1,9 +1,17 @@
1
1
  ---
2
2
  name: pbot
3
- description: 初始化 Personal Bot 工作区、查看状态、搜索归档或生成历史摘要。
3
+ description: 初始化或检查 Personal Bot 工作区,检索、汇总或迁移历史归档。
4
4
  disable-model-invocation: true
5
5
  ---
6
6
 
7
- `--workspace` 传入当前会话的 `workspaceRoot`(工作区未启用时使用当前工作区根目录)。省略子命令时使用 `status`。可执行 `init`、`status`、`history status|list|summary|migrate|search|read`,保留用户指定的维度、模型和筛选参数。
7
+ 用当前会话的工作区根目录替换 `<workspaceRoot>`。无参数时执行 `status`。用户要求初始化时执行 `init`,启用工作区并补建缺失的资料目录和根 `AGENTS.md`。
8
8
 
9
- 若 `pbot --at-least 0.4.0` 返回 0,运行 `pbot <子命令> --workspace "<workspaceRoot>"`;否则运行 `npx --yes personal-bot@0.4.0 <子命令> --workspace "<workspaceRoot>"`。返回实际结果。
9
+ 会话给出 `resourceRoot` 时,用随包 CLI 执行所选命令。查看状态可运行
10
+
11
+ ```sh
12
+ node "<resourceRoot>/../lib/extension/cli.js" status --workspace "<workspaceRoot>"
13
+ ```
14
+
15
+ 没有该路径时,若 `pbot --at-least 0.4.1` 成功,用 `pbot` 替换上例的 `node ".../cli.js"`,否则用 `npx --yes --ignore-scripts personal-bot@0.4.1`。
16
+
17
+ 历史操作将 `status` 替换为 `history` 和用户指定的子命令、参数。`history summary` 更新各维度,`history summary monthly` 汇总已有会话摘要。迁移预览用 `history migrate --dry-run`,其他用法见 `history --help`。
@@ -11158,7 +11158,7 @@ async function readLocalRole(agent, root) {
11158
11158
  async function agentText(agent, root, coordinatorPrompt = "plugin-coordinator.md") {
11159
11159
  requireThat(agent === "coordinator" || agent === "general-purpose", "\u672A\u77E5\u804C\u8D23\u3002");
11160
11160
  let text3 = await readFile(join7(resourceRoot, "agents", agent + ".md"), "utf8");
11161
- if (agent === "coordinator") {
11161
+ if (agent === "coordinator" && coordinatorPrompt) {
11162
11162
  text3 += "\n\n" + await readFile(join7(resourceRoot, "prompts", coordinatorPrompt), "utf8");
11163
11163
  }
11164
11164
  const local = await readLocalRole(agent, root);
@@ -11169,7 +11169,7 @@ async function agentText(agent, root, coordinatorPrompt = "plugin-coordinator.md
11169
11169
  function formatWorkspaceSkills(skills) {
11170
11170
  if (!skills.length) return "";
11171
11171
  const lines = skills.map((skill) => `- **${skill.name}**\uFF08\`${skill.path}\`\uFF09\uFF1A${skill.description}`);
11172
- return "## \u53EF\u7528\u6280\u80FD\n\n\u4EFB\u52A1\u5339\u914D\u65F6\u6309\u9700\u8BFB\u53D6\u5BF9\u5E94 `SKILL.md` \u6B63\u6587\uFF1A\n" + lines.join("\n");
11172
+ return "## \u6309\u9700\u8BFB\u53D6\u7684\u6280\u80FD\n\n" + lines.join("\n");
11173
11173
  }
11174
11174
  async function loadWorkspaceContext(options) {
11175
11175
  const {
@@ -11189,7 +11189,7 @@ async function loadWorkspaceContext(options) {
11189
11189
  includeRootAgents ? readOptionalFile(join7(root, "AGENTS.md")) : Promise.resolve("")
11190
11190
  ]) : ["", "", ""];
11191
11191
  const skillsSection = formatWorkspaceSkills(workspaceSkills);
11192
- const noticesSection = notices.length ? "## \u542F\u52A8\u63D0\u793A\n\n\u4EE5\u4E0B\u4E3A\u5DE5\u4F5C\u533A\u7EF4\u62A4\u63D0\u9192\uFF0C\u9002\u65F6\u987A\u5E26\u544A\u77E5\u7528\u6237\u5373\u53EF\uFF0C\u52FF\u672A\u7ECF\u7528\u6237\u8981\u6C42\u81EA\u884C\u6267\u884C\uFF1A\n" + notices.map((item) => `- ${item}`).join("\n") : "";
11192
+ const noticesSection = notices.length ? "## \u7EF4\u62A4\u63D0\u9192\n\n\u544A\u77E5\u7528\u6237\uFF0C\u6309\u7528\u6237\u8981\u6C42\u6267\u884C\u3002\n\n" + notices.map((item) => `- ${item}`).join("\n") : "";
11193
11193
  const environment = { host, workspaceRoot: root, resourceRoot };
11194
11194
  const text3 = [
11195
11195
  workspace,
@@ -3310,7 +3310,7 @@ var init_history_files = __esm({
3310
3310
  rawCount,
3311
3311
  summaryCount,
3312
3312
  total,
3313
- message: `\u68C0\u6D4B\u5230 ${total} \u4E2A\u672A\u8FC1\u79FB\u7684\u5E73\u94FA\u5386\u53F2\u6587\u4EF6\uFF08raw ${rawCount}\uFF0Csummaries ${summaryCount}\uFF09\uFF1B\u5F53\u524D\u4E3A\u5E74\u6708\u76EE\u5F55\u5E03\u5C40\uFF08history.layout: monthly\uFF09\uFF0C\u672A\u8FC1\u79FB\u6587\u4EF6\u4E0D\u4F1A\u88AB\u8BFB\u53D6\u3002\u8BF7\u5728\u7EC8\u7AEF\u8FD0\u884C pbot history migrate \u6574\u7406\u5230 YYYY/MM/ \u76EE\u5F55\uFF08Pi/dsh \u53EF\u7528 /pbot history migrate\uFF09\uFF0C\u6216\u5728 .pbot/config.json \u4E2D\u8BBE\u7F6E "history": { "layout": "flat" } \u5207\u56DE\u5E73\u94FA\u5E03\u5C40\u3002`
3313
+ message: `\u5F53\u524D\u6309\u5E74\u6708\u8BFB\u53D6\u5386\u53F2\uFF0C\u5E73\u94FA\u76EE\u5F55\u4E2D\u7684 ${rawCount} \u4EFD\u539F\u6587\u548C ${summaryCount} \u4EFD\u6458\u8981\u5C1A\u672A\u7EB3\u5165\u68C0\u7D22\u3002\u53EF\u5728\u5DE5\u4F5C\u533A\u6839\u76EE\u5F55\u7528 pbot history migrate --dry-run \u9884\u89C8\uFF0C\u7528 pbot history migrate \u6267\u884C\uFF08Pi\u3001dsh \u53EF\u7528 /pbot history migrate\uFF09\u3002\u8981\u7EE7\u7EED\u4F7F\u7528\u5E73\u94FA\u76EE\u5F55\uFF0C\u53EF\u5728 .pbot/config.json \u4E2D\u8BBE\u7F6E "history": { "layout": "flat" }\u3002`
3314
3314
  };
3315
3315
  }
3316
3316
  listFlatRawFiles() {
@@ -3571,7 +3571,7 @@ var init_monthly = __esm({
3571
3571
  monthlySummaryDimension = {
3572
3572
  id: "monthly",
3573
3573
  title: "\u6708\u5EA6\u5386\u53F2\u6C47\u603B",
3574
- description: "\u6309\u81EA\u7136\u6708\uFF08UTC YYYY/MM\uFF09\u5F52\u7EB3\u5F53\u6708\u5355\u4F1A\u8BDD\u6458\u8981\uFF0C\u63D0\u70BC\u6708\u5EA6\u4E3B\u9898\u3001\u5173\u952E\u51B3\u5B9A\u4E0E\u4EA7\u51FA\uFF0C\u652F\u6301\u9010\u5C42\u4E0B\u94BB\u3002",
3574
+ description: "\u6309\u4F1A\u8BDD\u5F00\u59CB\u7684 UTC \u6708\u4EFD\u6C47\u603B\u4F1A\u8BDD\u6458\u8981\uFF0C\u53EF\u4ECE\u6708\u5EA6\u7ED3\u679C\u67E5\u56DE\u5404\u4F1A\u8BDD\u3002",
3575
3575
  requiresMonthlyLayout: true,
3576
3576
  plan(_raws, existing, options = {}) {
3577
3577
  const force = Boolean(options.force);
@@ -3780,7 +3780,7 @@ var init_session = __esm({
3780
3780
  sessionSummaryDimension = {
3781
3781
  id: "session",
3782
3782
  title: "\u4F1A\u8BDD\u4EFB\u52A1\u6458\u8981",
3783
- description: "\u6309\u5355\u4E2A\u4F1A\u8BDD\u63D0\u70BC\u4EFB\u52A1\u76EE\u6807\u3001\u5173\u952E\u51B3\u5B9A\u3001\u7ED3\u679C\u4E0E\u672A\u51B3\u4E8B\u9879\uFF0C\u652F\u6301\u53BB\u91CD\u8DF3\u8FC7\u4E0E\u589E\u91CF\u6EDA\u52A8\u66F4\u65B0\u3002",
3783
+ description: "\u6C47\u603B\u5355\u6B21\u4F1A\u8BDD\u7684\u76EE\u6807\u3001\u51B3\u5B9A\u3001\u7ED3\u679C\u548C\u672A\u51B3\u4E8B\u9879\u3002",
3784
3784
  plan(raws, existing, options = {}) {
3785
3785
  const force = Boolean(options.force);
3786
3786
  const tasks = [];
@@ -3841,10 +3841,13 @@ var init_session = __esm({
3841
3841
  `\u3010\u5DF2\u6709\u6458\u8981\uFF08${task.existing.from} \u2014 ${task.existing.to}\uFF09\u3011
3842
3842
  ${task.existing.text}`,
3843
3843
  `\u3010\u65B0\u589E\u5BF9\u8BDD\u3011
3844
- ${formatExchanges(task.addedExchanges)}`,
3845
- "\u5728\u5DF2\u6709\u6458\u8981\u57FA\u7840\u4E0A\u5408\u5E76\u65B0\u589E\u5BF9\u8BDD\uFF0C\u8F93\u51FA\u66F4\u65B0\u540E\u7684\u5B8C\u6574\u6458\u8981\uFF1A\u4FDD\u7559\u4ECD\u6709\u6548\u7684\u4E8B\u5B9E\uFF0C\u7528\u65B0\u51B3\u5B9A\u8986\u76D6\u65E7\u51B3\u5B9A\uFF0C\u53BB\u91CD\u5E76\u4FDD\u6301\u7B80\u6D01\u3002"
3844
+ ${formatExchanges(task.addedExchanges)}`
3846
3845
  ].join("\n\n");
3847
- return { system, prompt: prompt2, maxTokens: 2048 };
3846
+ return {
3847
+ system: system + "\n\u5408\u5E76\u5DF2\u6709\u6458\u8981\u4E0E\u65B0\u589E\u5BF9\u8BDD\uFF0C\u8F93\u51FA\u5B8C\u6574\u6458\u8981\u3002\u4FDD\u7559\u4ECD\u6709\u6548\u7684\u4E8B\u5B9E\uFF0C\u7528\u540E\u7EED\u660E\u786E\u7684\u51B3\u5B9A\u66F4\u65B0\u76F8\u5E94\u7ED3\u8BBA\u3002",
3848
+ prompt: prompt2,
3849
+ maxTokens: 2048
3850
+ };
3848
3851
  }
3849
3852
  const prompt = [
3850
3853
  ...heading,
@@ -3956,7 +3959,8 @@ function evaluateSummaryReminder(raws, allSummaries, pendingCount, options = {})
3956
3959
  if (latestSummaryMs !== void 0 && nowMs - latestSummaryMs < thresholdMs) return void 0;
3957
3960
  const rawAgeDays = Math.floor((nowMs - oldestRawMs) / dayMs);
3958
3961
  const daysSinceLastSummary = latestSummaryMs === void 0 ? void 0 : Math.floor((nowMs - latestSummaryMs) / dayMs);
3959
- const message = daysSinceLastSummary === void 0 ? `\u5386\u53F2\u539F\u6587\u5DF2\u7D2F\u8BA1 ${rawAgeDays} \u5929\uFF08\u5F85\u6458\u8981 ${pendingCount} \u9879\uFF09\uFF0C\u5C1A\u672A\u89E6\u53D1\u8FC7\u6458\u8981\u6574\u7406\uFF1B\u53EF\u5728\u7EC8\u7AEF\u8FD0\u884C pbot history summary \u751F\u6210\u6458\u8981\uFF08Pi/dsh \u53EF\u7528 /pbot history summary\uFF09\u3002` : `\u5386\u53F2\u539F\u6587\u5DF2\u7D2F\u8BA1 ${rawAgeDays} \u5929\uFF0C\u4E14\u5DF2 ${daysSinceLastSummary} \u5929\u672A\u89E6\u53D1\u6458\u8981\u6574\u7406\uFF08\u5F85\u6458\u8981 ${pendingCount} \u9879\uFF09\uFF1B\u53EF\u5728\u7EC8\u7AEF\u8FD0\u884C pbot history summary \u66F4\u65B0\u6458\u8981\uFF08Pi/dsh \u53EF\u7528 /pbot history summary\uFF09\u3002`;
3962
+ const lastUpdate = daysSinceLastSummary === void 0 ? "\u5C1A\u65E0\u6458\u8981" : `\u4E0A\u6B21\u66F4\u65B0\u6458\u8981\u5728 ${daysSinceLastSummary} \u5929\u524D`;
3963
+ const message = `\u5DE5\u4F5C\u533A\u5DF2\u79EF\u7D2F ${rawAgeDays} \u5929\u7684\u5386\u53F2\uFF0C${lastUpdate}\uFF0C${pendingCount} \u9879\u5F85\u6458\u8981\u3002\u53EF\u5728\u5DE5\u4F5C\u533A\u6839\u76EE\u5F55\u8FD0\u884C pbot history summary\uFF0C\u6216\u5728 Pi\u3001dsh \u4F1A\u8BDD\u4E2D\u8F93\u5165 /pbot history summary\u3002`;
3960
3964
  return {
3961
3965
  rawCount: raws.length,
3962
3966
  pendingCount,
@@ -19382,7 +19386,7 @@ var init_contract = __esm({
19382
19386
  host: identifier,
19383
19387
  id: typebox_exports.String(),
19384
19388
  kind: typebox_exports.Union([typebox_exports.Literal("session"), typebox_exports.Literal("exchange"), typebox_exports.Literal("summary")], {
19385
- description: "session=\u4F1A\u8BDD\u6839\uFF1Bsummary=\u7EF4\u5EA6\u6458\u8981\uFF1Bexchange=\u5355\u8F6E\u95EE\u7B54\u539F\u6587\u3002"
19389
+ description: "session \u4E3A\u4F1A\u8BDD\uFF0Csummary \u4E3A\u6458\u8981\uFF0Cexchange \u4E3A\u5355\u8F6E\u95EE\u7B54\u539F\u6587\u3002"
19386
19390
  }),
19387
19391
  dimension: typebox_exports.Optional(identifier),
19388
19392
  sessionId: typebox_exports.String(),
@@ -19391,7 +19395,7 @@ var init_contract = __esm({
19391
19395
  from: typebox_exports.String(),
19392
19396
  to: typebox_exports.String(),
19393
19397
  ready: typebox_exports.Boolean({ description: "\u6B63\u6587\u6216\u6458\u8981\u662F\u5426\u5DF2\u751F\u6210\u3002" }),
19394
- completed: typebox_exports.Boolean({ description: "\u8BE5\u5BF9\u8BDD\u6216\u95EE\u7B54\u662F\u5426\u6B63\u5E38\u7ED3\u675F\uFF08false \u8868\u793A\u4E2D\u65AD\u6216\u672A\u5B8C\uFF09\u3002" })
19398
+ completed: typebox_exports.Boolean({ description: "false \u8868\u793A\u4F1A\u8BDD\u6216\u95EE\u7B54\u4E2D\u65AD\u6216\u672A\u5B8C\u6210\u3002" })
19395
19399
  });
19396
19400
  historyResultSchema = typebox_exports.Object({
19397
19401
  matches: typebox_exports.Optional(typebox_exports.Array(typebox_exports.Object({
@@ -19421,18 +19425,18 @@ var init_contract = __esm({
19421
19425
  });
19422
19426
  historyParameters = typebox_exports.Object({
19423
19427
  action: typebox_exports.Union([typebox_exports.Literal("search"), typebox_exports.Literal("read")], {
19424
- description: "search \u641C\u7D22\u6216\u5217\u8868\uFF1Bread \u6309 id \u8BFB\u53D6\u6B63\u6587\u4E0E\u4E0A\u4E0B\u7EA7\u3002\u4EC5\u8BFB\u53D6\u5BF9\u5E94\u52A8\u4F5C\u53C2\u6570\uFF0C\u5176\u4F59\u5FFD\u7565\u3002"
19428
+ description: "search \u641C\u7D22\u6216\u5217\u51FA\u8BB0\u5F55\uFF0Cread \u6309 id \u8BFB\u53D6\u6B63\u6587\u548C\u4E0A\u4E0B\u7EA7\u3002"
19425
19429
  }),
19426
- host: nullable(typebox_exports.String({ pattern: historyIdentifierPattern.source, description: "\u6765\u6E90\u5BBF\u4E3B\u7B5B\u9009\uFF08\u5982 pi\u3001dsh\u3001claude\u3001antigravity\u3001codex\u3001qoder\uFF09\uFF1B\u7701\u7565\u67E5\u5168\u90E8\u3002" })),
19427
- dimension: nullable(typebox_exports.String({ pattern: historyIdentifierPattern.source, description: "\u4EC5 search\uFF1Araw \u4EC5\u539F\u6587\uFF0C\u6216\u6307\u5B9A\u6458\u8981\u7EF4\u5EA6\uFF08\u5982 monthly\u3001session\uFF09\uFF1B\u7701\u7565\u67E5\u5168\u90E8\u3002" })),
19428
- query: nullable(typebox_exports.String({ description: "\u4EC5 search\uFF1A\u8FDE\u7EED\u5173\u952E\u8BCD\uFF08\u4E0D\u533A\u5206\u5927\u5C0F\u5199\uFF09\uFF1B\u7701\u7565\u5217\u4F1A\u8BDD\u6216\u6307\u5B9A\u7EF4\u5EA6\u6458\u8981\u3002" })),
19429
- sessionId: nullable(typebox_exports.String({ description: "\u4EC5 search\uFF1A\u9650\u5B9A\u5728\u6307\u5B9A\u539F\u59CB\u4F1A\u8BDD ID \u5185\u641C\u7D22\u3002" })),
19430
- from: nullable(typebox_exports.String({ description: "\u4EC5 search\uFF1AISO \u65E5\u671F\u6216\u65F6\u95F4\u4E0B\u754C\u3002" })),
19431
- to: nullable(typebox_exports.String({ description: "\u4EC5 search\uFF1AISO \u65E5\u671F\u6216\u65F6\u95F4\u4E0A\u754C\u3002" })),
19432
- id: nullable(typebox_exports.String({ description: "\u4EC5 read\uFF0C\u5FC5\u586B\uFF1A\u8282\u70B9 id\uFF08\u6765\u81EA search \u6216\u4E0A\u4E0B\u7EA7\uFF09\u3002" })),
19433
- offset: nullable(typebox_exports.Integer({ minimum: 0, description: "search \u4E3A\u7ED3\u679C\u504F\u79FB\uFF0Cread \u4E3A\u6B63\u6587\u5B57\u7B26\u504F\u79FB\uFF1B\u9ED8\u8BA4 0\u3002" })),
19434
- limit: nullable(typebox_exports.Integer({ minimum: 1, maximum: historyPageLimits.read.max, description: `search\uFF1A\u8FD4\u56DE\u6761\u6570\uFF081\u2013${historyPageLimits.search.max}\uFF0C\u9ED8\u8BA4 ${historyPageLimits.search.default}\uFF09\uFF1Bread\uFF1A\u6B63\u6587\u5B57\u7B26\u6570\uFF08\u9ED8\u8BA4 ${historyPageLimits.read.default}\uFF09\u3002` })),
19435
- childrenOffset: nullable(typebox_exports.Integer({ minimum: 0, description: "\u4EC5 read\uFF1A\u5B50\u8282\u70B9\u504F\u79FB\uFF0C\u9ED8\u8BA4 0\uFF1B\u7EED\u8BFB\u4F20\u4E0A\u6B21 nextChildrenOffset\u3002" }))
19430
+ host: nullable(typebox_exports.String({ pattern: historyIdentifierPattern.source, description: "\u6765\u6E90\u5BBF\u4E3B\uFF0C\u5982 pi \u6216 claude\u3002\u53EF\u7B5B\u9009\u641C\u7D22\u7ED3\u679C\u6216\u533A\u5206\u91CD\u540D\u8282\u70B9\u3002" })),
19431
+ dimension: nullable(typebox_exports.String({ pattern: historyIdentifierPattern.source, description: "search \u7684\u8303\u56F4\u3002raw \u4E3A\u539F\u59CB\u95EE\u7B54\uFF0Csession\u3001monthly \u7B49\u4E3A\u6458\u8981\u7EF4\u5EA6\u3002\u5173\u952E\u8BCD\u641C\u7D22\u9ED8\u8BA4\u67E5\u5168\u90E8\u3002" })),
19432
+ query: nullable(typebox_exports.String({ description: "search \u5339\u914D\u8FDE\u7EED\u6587\u672C\uFF0C\u5FFD\u7565\u5927\u5C0F\u5199\u3002\u7701\u7565\u65F6\u5217\u4F1A\u8BDD\uFF0C\u6307\u5B9A\u6458\u8981\u7EF4\u5EA6\u5219\u5217\u8BE5\u7EF4\u5EA6\u7684\u6458\u8981\u3002" })),
19433
+ sessionId: nullable(typebox_exports.String({ description: "search \u6309\u539F\u59CB\u4F1A\u8BDD ID \u7B5B\u9009\u3002" })),
19434
+ from: nullable(typebox_exports.String({ description: "search \u65F6\u95F4\u533A\u95F4\u8D77\u70B9\uFF08\u542B\uFF09\uFF0C\u7528 ISO \u65E5\u671F\u6216\u65F6\u95F4\u3002" })),
19435
+ to: nullable(typebox_exports.String({ description: "search \u65F6\u95F4\u533A\u95F4\u7EC8\u70B9\uFF08\u542B\uFF09\uFF0C\u4EC5\u586B\u65E5\u671F\u8868\u793A\u8BE5\u65E5 UTC \u96F6\u70B9\u3002" })),
19436
+ id: nullable(typebox_exports.String({ description: "read \u5FC5\u586B\u3002\u4F7F\u7528\u641C\u7D22\u7ED3\u679C\u3001\u7236\u8282\u70B9\u6216\u5B50\u8282\u70B9\u7684 id\u3002" })),
19437
+ offset: nullable(typebox_exports.Integer({ minimum: 0, description: "\u7FFB\u9875\u4F20\u4E0A\u9875\u7684 nextOffset\u3002search \u6309\u6761\u76EE\uFF0Cread \u6309\u6B63\u6587\u5B57\u7B26\uFF0C\u9ED8\u8BA4\u4ECE 0 \u5F00\u59CB\u3002" })),
19438
+ limit: nullable(typebox_exports.Integer({ minimum: 1, maximum: historyPageLimits.read.max, description: `search \u6BCF\u9875\u9ED8\u8BA4 ${historyPageLimits.search.default} \u6761\uFF0C\u6700\u591A ${historyPageLimits.search.max} \u6761\u3002read \u6BCF\u9875\u9ED8\u8BA4 ${historyPageLimits.read.default} \u4E2A\u5B57\u7B26\u3002` })),
19439
+ childrenOffset: nullable(typebox_exports.Integer({ minimum: 0, description: "read \u7684\u5B50\u8282\u70B9\u8D77\u70B9\uFF0C\u9ED8\u8BA4 0\u3002\u7FFB\u9875\u4F20\u4E0A\u9875\u7684 nextChildrenOffset\u3002" }))
19436
19440
  }, { additionalProperties: false });
19437
19441
  valid2 = schema(historyParameters);
19438
19442
  }
@@ -20478,7 +20482,6 @@ var antigravityAdapter = {
20478
20482
  host: "antigravity",
20479
20483
  nativeRootAgents: true,
20480
20484
  nativeWorkspaceSkills: true,
20481
- coordinatorPrompt: "plugin-coordinator.md",
20482
20485
  initCommandHint: "/pbot init",
20483
20486
  usage: "\u7528\u6CD5\uFF1Anode <\u63D2\u4EF6\u76EE\u5F55>/lib/plugin.js antigravity init|status",
20484
20487
  resolveRoot(cwd, rawPayload) {
@@ -20559,12 +20562,9 @@ function parsePromptEvent(value) {
20559
20562
  if (name !== "Stop" && name !== "UserPromptSubmit" && name !== "SessionStart") return { kind: "ignore" };
20560
20563
  if (typeof value.agent_id === "string") return { kind: "ignore" };
20561
20564
  requireThat(typeof value.cwd === "string", "\u63D2\u4EF6 hook \u7F3A\u5C11\u5DE5\u4F5C\u76EE\u5F55\u3002");
20562
- if (name === "Stop") return { kind: "record-history", cwd: value.cwd, raw: value };
20563
- if (name === "SessionStart") {
20564
- if (value.source === "resume" || value.source === "compact") return { kind: "ignore" };
20565
- return { kind: "inject-context", role: "coordinator", isSessionStart: true, noticesOnly: true, cwd: value.cwd, raw: value };
20566
- }
20567
- return { kind: "inject-context", role: "coordinator", cwd: value.cwd, raw: value };
20565
+ if (name !== "SessionStart") return { kind: "record-history", cwd: value.cwd, raw: value };
20566
+ if (value.source === "resume" || value.source === "compact") return { kind: "ignore" };
20567
+ return { kind: "inject-context", role: "coordinator", isSessionStart: true, cwd: value.cwd, raw: value };
20568
20568
  }
20569
20569
  var promptHooks = {
20570
20570
  async extractHistory(event) {
@@ -20610,7 +20610,7 @@ var promptHooks = {
20610
20610
  };
20611
20611
 
20612
20612
  // src/integrations/hosts/claude/adapter.ts
20613
- var supportedEvents2 = ["UserPromptSubmit", "PreToolUse", "UserPromptExpansion", "Stop"];
20613
+ var supportedEvents2 = ["SessionStart", "UserPromptSubmit", "PreToolUse", "UserPromptExpansion", "Stop"];
20614
20614
  var boundWorkspaceRoot = () => process.env.CLAUDE_PROJECT_DIR;
20615
20615
  async function claudeWorkspaceRoot(cwd, projectDirectory = boundWorkspaceRoot()) {
20616
20616
  return pluginWorkspaceRoot(projectDirectory || cwd);
@@ -20619,7 +20619,6 @@ var claudeAdapter = {
20619
20619
  host: "claude",
20620
20620
  nativeRootAgents: false,
20621
20621
  nativeWorkspaceSkills: false,
20622
- coordinatorPrompt: "plugin-coordinator.md",
20623
20622
  initCommandHint: "/personal-bot:pbot init",
20624
20623
  usage: "\u7528\u6CD5\uFF1Anode <\u63D2\u4EF6\u76EE\u5F55>/lib/claude.js init|status",
20625
20624
  boundWorkspaceRoot,
@@ -20865,7 +20864,7 @@ async function removeWorkspaceMcpServer(root, name) {
20865
20864
  }
20866
20865
 
20867
20866
  // src/extension/cli/commands/mcp.ts
20868
- var mcpUsage = "\u7528\u6CD5\uFF1A\n pbot mcp\n pbot mcp list [--workspace <\u76EE\u5F55>] [--json]\n pbot mcp add <name> --url <url> [--header K=V]... [--description <\u8BF4\u660E>] [--timeout <\u79D2>] [--disabled] [--workspace <\u76EE\u5F55>]\n pbot mcp add <name> [--env K=V]... [--cwd <\u76EE\u5F55>] [--description <\u8BF4\u660E>] [--timeout <\u79D2>] [--disabled] [--workspace <\u76EE\u5F55>] -- <command> [args...]\n pbot mcp remove <name> [--workspace <\u76EE\u5F55>]\n\n\u65E0\u53C2\u6570\u65F6\u542F\u52A8\u7EDF\u4E00 stdio MCP \u670D\u52A1\uFF08\u66B4\u9732 worker_* \u4E0E workspace_mcp_*\uFF09\uFF1B\u5E26 list/add/remove \u65F6\u7BA1\u7406\u5DE5\u4F5C\u533A .pbot/mcp.json\u3002";
20867
+ var mcpUsage = "\u7528\u6CD5\uFF1A\n pbot mcp\n pbot mcp list [--workspace <\u76EE\u5F55>] [--json]\n pbot mcp add <name> --url <url> [--header K=V]... [--description <\u8BF4\u660E>] [--timeout <\u79D2>] [--disabled] [--workspace <\u76EE\u5F55>]\n pbot mcp add <name> [--env K=V]... [--cwd <\u76EE\u5F55>] [--description <\u8BF4\u660E>] [--timeout <\u79D2>] [--disabled] [--workspace <\u76EE\u5F55>] -- <command> [args...]\n pbot mcp remove <name> [--workspace <\u76EE\u5F55>]\n\n\u4E0D\u5E26\u5B50\u547D\u4EE4\u65F6\u542F\u52A8 stdio MCP \u670D\u52A1\u3002\u7528 list\u3001add\u3001remove \u7BA1\u7406\u5DE5\u4F5C\u533A\u7684 .pbot/mcp.json\u3002";
20869
20868
  async function runMcpServer() {
20870
20869
  const entry = join19(packageRoot, "lib/extension/mcp.js");
20871
20870
  if (!existsSync2(entry)) {
@@ -21044,7 +21043,7 @@ async function readLocalRole(agent, root) {
21044
21043
  async function agentText(agent, root, coordinatorPrompt = "plugin-coordinator.md") {
21045
21044
  requireThat(agent === "coordinator" || agent === "general-purpose", "\u672A\u77E5\u804C\u8D23\u3002");
21046
21045
  let text = await readFile8(join20(resourceRoot, "agents", agent + ".md"), "utf8");
21047
- if (agent === "coordinator") {
21046
+ if (agent === "coordinator" && coordinatorPrompt) {
21048
21047
  text += "\n\n" + await readFile8(join20(resourceRoot, "prompts", coordinatorPrompt), "utf8");
21049
21048
  }
21050
21049
  const local = await readLocalRole(agent, root);
@@ -21055,7 +21054,7 @@ async function agentText(agent, root, coordinatorPrompt = "plugin-coordinator.md
21055
21054
  function formatWorkspaceSkills(skills) {
21056
21055
  if (!skills.length) return "";
21057
21056
  const lines = skills.map((skill) => `- **${skill.name}**\uFF08\`${skill.path}\`\uFF09\uFF1A${skill.description}`);
21058
- return "## \u53EF\u7528\u6280\u80FD\n\n\u4EFB\u52A1\u5339\u914D\u65F6\u6309\u9700\u8BFB\u53D6\u5BF9\u5E94 `SKILL.md` \u6B63\u6587\uFF1A\n" + lines.join("\n");
21057
+ return "## \u6309\u9700\u8BFB\u53D6\u7684\u6280\u80FD\n\n" + lines.join("\n");
21059
21058
  }
21060
21059
  async function loadWorkspaceContext(options) {
21061
21060
  const {
@@ -21075,7 +21074,7 @@ async function loadWorkspaceContext(options) {
21075
21074
  includeRootAgents ? readOptionalFile(join20(root, "AGENTS.md")) : Promise.resolve("")
21076
21075
  ]) : ["", "", ""];
21077
21076
  const skillsSection = formatWorkspaceSkills(workspaceSkills);
21078
- const noticesSection = notices.length ? "## \u542F\u52A8\u63D0\u793A\n\n\u4EE5\u4E0B\u4E3A\u5DE5\u4F5C\u533A\u7EF4\u62A4\u63D0\u9192\uFF0C\u9002\u65F6\u987A\u5E26\u544A\u77E5\u7528\u6237\u5373\u53EF\uFF0C\u52FF\u672A\u7ECF\u7528\u6237\u8981\u6C42\u81EA\u884C\u6267\u884C\uFF1A\n" + notices.map((item) => `- ${item}`).join("\n") : "";
21077
+ const noticesSection = notices.length ? "## \u7EF4\u62A4\u63D0\u9192\n\n\u544A\u77E5\u7528\u6237\uFF0C\u6309\u7528\u6237\u8981\u6C42\u6267\u884C\u3002\n\n" + notices.map((item) => `- ${item}`).join("\n") : "";
21079
21078
  const environment = { host, workspaceRoot: root, resourceRoot };
21080
21079
  const text = [
21081
21080
  workspace,
@@ -21354,7 +21353,7 @@ async function pluginHook(adapter, payload, replay) {
21354
21353
  host: adapter.host,
21355
21354
  root,
21356
21355
  role: event.role,
21357
- ...adapter.coordinatorPrompt ? { coordinatorPrompt: adapter.coordinatorPrompt } : {},
21356
+ coordinatorPrompt: adapter.coordinatorPrompt ?? (features.history ? "plugin-coordinator.md" : null),
21358
21357
  includePrompts,
21359
21358
  includeRootAgents: includePrompts && !adapter.nativeRootAgents,
21360
21359
  ...event.localRoleOnly ? { localRoleOnly: true } : {},
@@ -5,7 +5,7 @@ const usage = '用法:/pbot status | init | history [summary [维度] [--force
5
5
  export function registerDshCommand(ctx, workspaces) {
6
6
  ctx.commands.register({
7
7
  name: "pbot",
8
- description: "Personal Bot 工作区、历史摘要与跨 Harness worker 管理",
8
+ description: "初始化或检查工作区,查询历史、更新摘要、管理委派的助手。",
9
9
  recordInput: false,
10
10
  input: { hint: "status | init | history ... | worker ...", attachments: false },
11
11
  async handler({ agent, rawInput, signal }) {
@@ -41,8 +41,10 @@ export class DshWorkspace {
41
41
  apply: async (ctx) => {
42
42
  if (this.features.skills)
43
43
  registerDshSkills(ctx, this.agent, { workspaceRoot: this.root });
44
- if (this.features.prompts)
45
- await dshResources(ctx, this.agent, this.root, "coordinator", this.check, "history-coordinator.md");
44
+ if (this.features.prompts) {
45
+ const historyPrompt = this.features.history ? "history-coordinator.md" : null;
46
+ await dshResources(ctx, this.agent, this.root, "coordinator", this.check, historyPrompt);
47
+ }
46
48
  registerDshFileEvents(ctx, this.agent, this.root, false, this.check);
47
49
  if (this.features.history) {
48
50
  registerDshHistoryTool(ctx, this.agent, this.root, this.lifetime.signal, this.check);
@@ -86,7 +86,7 @@ export async function pluginHook(adapter, payload, replay) {
86
86
  host: adapter.host,
87
87
  root,
88
88
  role: event.role,
89
- ...(adapter.coordinatorPrompt ? { coordinatorPrompt: adapter.coordinatorPrompt } : {}),
89
+ coordinatorPrompt: adapter.coordinatorPrompt ?? (features.history ? "plugin-coordinator.md" : null),
90
90
  includePrompts,
91
91
  includeRootAgents: includePrompts && !adapter.nativeRootAgents,
92
92
  ...(event.localRoleOnly ? { localRoleOnly: true } : {}),