personal-bot 0.2.8 → 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.
Files changed (75) hide show
  1. package/CONTEXT.md +40 -59
  2. package/README.md +70 -119
  3. package/README.zh-CN.md +73 -116
  4. package/docs/README.md +22 -19
  5. package/docs/agent-collaboration.md +10 -12
  6. package/docs/architecture-guidelines.md +2 -2
  7. package/docs/capability-design.md +4 -12
  8. package/docs/dsh.md +32 -96
  9. package/docs/file-storage.md +8 -5
  10. package/docs/history.md +5 -12
  11. package/docs/installation-design.md +56 -198
  12. package/docs/model-context.md +23 -37
  13. package/docs/model-instruction-guidelines.md +2 -2
  14. package/docs/release.md +5 -5
  15. package/docs/technical-design.md +16 -12
  16. package/docs/workspace-configuration.md +55 -0
  17. package/lib/client.js +28 -3
  18. package/lib/common/typebox.LICENSE +23 -0
  19. package/lib/common/typebox.js +4740 -0
  20. package/lib/dsh.js +0 -5
  21. package/lib/extension/dsh/command.js +15 -11
  22. package/lib/extension/dsh/history.js +1 -1
  23. package/lib/extension/dsh/management.d.ts +4 -0
  24. package/lib/extension/dsh/management.js +21 -6
  25. package/lib/extension/dsh/workspace.d.ts +7 -1
  26. package/lib/extension/dsh/workspace.js +68 -1
  27. package/lib/extension/setup-cli.js +1 -1
  28. package/lib/integrations/dsh/skills.d.ts +4 -0
  29. package/lib/integrations/dsh/skills.js +27 -0
  30. package/lib/model/history.d.ts +1 -0
  31. package/lib/model/workspace-config.d.ts +9 -0
  32. package/lib/model/workspace-config.js +1 -0
  33. package/lib/services/history/history-service.d.ts +1 -2
  34. package/lib/services/history/history-service.js +27 -40
  35. package/lib/services/workspace/workspace-config.d.ts +7 -0
  36. package/lib/services/workspace/workspace-config.js +50 -0
  37. package/lib/services/workspace/workspace-preparation.d.ts +1 -0
  38. package/lib/services/workspace/workspace-preparation.js +8 -0
  39. package/lib/storage/history-files.d.ts +5 -1
  40. package/lib/storage/history-files.js +68 -15
  41. package/lib/tools/agents/contract.js +1 -1
  42. package/lib/tools/agents/dsh-contract.js +1 -1
  43. package/lib/tools/history/contract.js +1 -1
  44. package/lib/tools/teams/contract.js +1 -1
  45. package/lib/ui/dsh/management.js +27 -3
  46. package/npm-shrinkwrap.json +10 -3
  47. package/package.json +102 -31
  48. package/python/README.md +6 -6
  49. package/resources/prompts/workspace.md +3 -3
  50. package/scripts/README.md +16 -15
  51. package/src/dsh.ts +0 -5
  52. package/src/extension/command.ts +25 -8
  53. package/src/extension/dsh/command.ts +13 -8
  54. package/src/extension/dsh/history.ts +2 -2
  55. package/src/extension/dsh/management.ts +21 -5
  56. package/src/extension/dsh/workspace.ts +62 -5
  57. package/src/extension/events.ts +18 -1
  58. package/src/extension/lifecycle.ts +9 -2
  59. package/src/extension/setup-cli.ts +1 -1
  60. package/src/extension/subagent-entry.ts +4 -1
  61. package/src/integrations/dsh/skills.ts +30 -0
  62. package/src/integrations/pi/skills.ts +52 -0
  63. package/src/model/history.ts +1 -0
  64. package/src/model/workspace-config.ts +10 -0
  65. package/src/pbot.ts +2 -3
  66. package/src/services/history/history-service.ts +15 -25
  67. package/src/services/workspace/workspace-config.ts +49 -0
  68. package/src/services/workspace/workspace-preparation.ts +8 -0
  69. package/src/storage/history-files.ts +53 -15
  70. package/src/ui/dsh/management.ts +20 -3
  71. package/docs/dsh-implementation-plan.md +0 -160
  72. package/docs/dsh-support-proposal.md +0 -298
  73. package/docs/dsh.en.md +0 -333
  74. package/docs/subagent-upgrade-proposal.md +0 -357
  75. package/docs/validation.md +0 -189
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, "\u8D44\u6599\u76EE\u5F55\u5DF2\u51C6\u5907\u3002");
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 = `\u4E13\u5BB6 ${agents.length} \xB7 \u6267\u884C\u4E2D ${active} \xB7 \u56E2\u961F ${teams2.length}`;
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`]
@@ -0,0 +1,23 @@
1
+ TypeBox
2
+
3
+ The MIT License (MIT)
4
+
5
+ Copyright (c) 2017-2026 Haydn Paterson
6
+
7
+ Permission is hereby granted, free of charge, to any person obtaining a copy
8
+ of this software and associated documentation files (the "Software"), to deal
9
+ in the Software without restriction, including without limitation the rights
10
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
11
+ copies of the Software, and to permit persons to whom the Software is
12
+ furnished to do so, subject to the following conditions:
13
+
14
+ The above copyright notice and this permission notice shall be included in
15
+ all copies or substantial portions of the Software.
16
+
17
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
18
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
19
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
20
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
21
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
22
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
23
+ THE SOFTWARE.