personal-bot 0.3.7 → 0.4.0
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 +2 -2
- package/.claude-plugin/plugin.json +1 -1
- 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 +1 -1
- package/docs/guides/cross-harness-workers.md +4 -4
- package/docs/guides/history.md +1 -3
- package/docs/guides/workspace-configuration.md +4 -4
- package/docs/hosts/claude-code.md +2 -2
- package/docs/hosts/codex-qoder.md +1 -1
- 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 +346 -201
- package/lib/antigravity-plugin/lib/extension/cli.js +563 -538
- 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 +0 -11
- package/lib/antigravity-plugin/lib/extension/mcp.js +397 -278
- 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/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/package.json +1 -1
- package/lib/antigravity-plugin/plugin.json +1 -1
- package/lib/codex-marketplace/plugins/personal-bot/.codex-plugin/plugin.json +1 -1
- 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 +1 -1
- 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 +346 -201
- package/lib/extension/cli.js +563 -538
- package/lib/extension/hosts/dsh/acp-member.js +1 -1
- package/lib/extension/hosts/dsh/command.js +1 -1
- package/lib/extension/hosts/dsh/workspace.js +1 -3
- package/lib/extension/hosts/pi/acp-member.js +3 -4
- package/lib/extension/hosts/plugin-runtime.js +0 -11
- package/lib/extension/mcp/tool-contract.d.ts +8 -50
- package/lib/extension/mcp/tool-contract.js +0 -8
- package/lib/extension/mcp/workers.d.ts +7 -27
- package/lib/extension/mcp/workers.js +35 -17
- package/lib/extension/mcp.js +397 -278
- 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/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 +1 -1
- package/lib/qoder-plugin/hooks/hooks.json +3 -3
- package/lib/qoder-plugin/skills/pbot/SKILL.md +1 -1
- 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 +180 -126
- 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/package.json +1 -1
- package/src/extension/acp/member.ts +14 -11
- package/src/extension/acp/worker.ts +31 -28
- 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 +1 -1
- package/src/extension/hosts/dsh/workspace.ts +1 -3
- package/src/extension/hosts/pi/acp-member.ts +3 -4
- package/src/extension/hosts/pi/command.ts +1 -1
- package/src/extension/hosts/pi/lifecycle.ts +0 -2
- package/src/extension/hosts/plugin-runtime.ts +0 -10
- package/src/extension/mcp/tool-contract.ts +0 -8
- package/src/extension/mcp/workers.ts +34 -17
- package/src/integrations/acp/agents.ts +28 -27
- package/src/integrations/acp/harnesses/claude.ts +1 -1
- package/src/integrations/hosts/dsh/session.ts +2 -2
- 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 +1 -1
- 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 +204 -133
- 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/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
|
@@ -24,7 +24,7 @@ export async function apply(ctx) {
|
|
|
24
24
|
if (source === "resume")
|
|
25
25
|
agent.inbox.clear();
|
|
26
26
|
const reference = member.files.reference(member.id);
|
|
27
|
-
requireThat(reference.host === "acp" && reference.backend === "dsh" && agent.session.header.cwd === member.d.
|
|
27
|
+
requireThat(reference.host === "acp" && reference.backend === "dsh" && agent.session.header.cwd === member.d.workspace &&
|
|
28
28
|
(reference.sessionId === null || reference.sessionId === agent.id), "dsh ACP 会话身份或工作目录不匹配。");
|
|
29
29
|
await agent.ctx.plugin({ name: "pbot-acp-expert", inject, apply: async (scope) => {
|
|
30
30
|
if (member.features.skills)
|
|
@@ -8,7 +8,6 @@ import { toPiMcpConfig } from "../../../integrations/hosts/pi/mcp.js";
|
|
|
8
8
|
import { authorizeMutation } from "../../../services/workspace/workspace-files.js";
|
|
9
9
|
import { loadNativeWorkspaceServers } from "../workspace-mcp.js";
|
|
10
10
|
import { resourceRoot } from "../../../common/paths.js";
|
|
11
|
-
import { launch } from "../../../storage/agent-files.js";
|
|
12
11
|
import { requireThat } from "../../../common/validation.js";
|
|
13
12
|
const isBlockedTool = (name) => name === "pbot_history" || isMcpWorkerTool(name);
|
|
14
13
|
/** Member resources and authoritative final answers; ACP owns input delivery. */
|
|
@@ -18,7 +17,7 @@ export default async function piAcpMember(pi) {
|
|
|
18
17
|
let input, startLeaf = null;
|
|
19
18
|
const checkSession = (ctx) => {
|
|
20
19
|
const reference = member.files.reference(member.id);
|
|
21
|
-
requireThat(reference.host === "acp" && reference.backend === "pi" && realpathSync(ctx.cwd) === member.d.
|
|
20
|
+
requireThat(reference.host === "acp" && reference.backend === "pi" && realpathSync(ctx.cwd) === member.d.workspace &&
|
|
22
21
|
(reference.sessionId === null || reference.sessionId === ctx.sessionManager.getSessionId()), "Pi ACP 会话身份或工作目录不匹配。");
|
|
23
22
|
};
|
|
24
23
|
const workspaceMcpServers = [];
|
|
@@ -42,7 +41,7 @@ export default async function piAcpMember(pi) {
|
|
|
42
41
|
pi.on("session_start", (_event, ctx) => {
|
|
43
42
|
checkSession(ctx);
|
|
44
43
|
const active = pi.getActiveTools();
|
|
45
|
-
for (const tool of agentFileTools(member.d.
|
|
44
|
+
for (const tool of agentFileTools(member.d.workspace, lifetime.signal, async (path, change, signal) => {
|
|
46
45
|
member.check();
|
|
47
46
|
await authorizeMutation(member.d.workspace, path, change, async () => false, signal);
|
|
48
47
|
member.check();
|
|
@@ -53,7 +52,7 @@ export default async function piAcpMember(pi) {
|
|
|
53
52
|
registeredMcp.push(server.name);
|
|
54
53
|
}
|
|
55
54
|
pi.setActiveTools(active.filter(name => !isBlockedTool(name)));
|
|
56
|
-
pi.setSessionName(member.
|
|
55
|
+
pi.setSessionName(member.id.slice(0, 8));
|
|
57
56
|
startLeaf = ctx.sessionManager.getLeafId();
|
|
58
57
|
});
|
|
59
58
|
pi.on("before_agent_start", async (event, ctx) => {
|
|
@@ -5,7 +5,6 @@ import { requireThat } from "../../common/validation.js";
|
|
|
5
5
|
import { loadWorkspaceContext } from "../../integrations/agent-resources.js";
|
|
6
6
|
import { recordHistoryCapture } from "../../services/history/history-capture.js";
|
|
7
7
|
import { historyStartupNotices } from "../../services/history/summary-runner.js";
|
|
8
|
-
import { bindWorkspacePlugin, workspacePluginDrift, workspacePluginReleases } from "../../services/workspace/plugin-releases.js";
|
|
9
8
|
import { readWorkspaceConfig, workspaceFeatures } from "../../services/workspace/workspace-config.js";
|
|
10
9
|
import { initializeWorkspace } from "../../services/workspace/workspace-preparation.js";
|
|
11
10
|
import { discoverSkills, discoverWorkspaceSkills } from "../../services/workspace/workspace-skills.js";
|
|
@@ -18,7 +17,6 @@ export async function pluginCommand(adapter, args, cwd) {
|
|
|
18
17
|
requireThat(["init", "status"].includes(action), adapter.usage);
|
|
19
18
|
if (action === "init") {
|
|
20
19
|
await initializeWorkspace(root);
|
|
21
|
-
bindWorkspacePlugin(root, adapter.host, process.env.PBOT_PLUGIN_MANIFEST || process.env.PBOT_PLUGIN_VERSION);
|
|
22
20
|
}
|
|
23
21
|
const configuration = await readWorkspaceConfig(root);
|
|
24
22
|
return { version: packageVersion, workspaceRoot: root, resourceRoot, configuration };
|
|
@@ -62,8 +60,6 @@ export async function pluginHook(adapter, payload, replay) {
|
|
|
62
60
|
}
|
|
63
61
|
if (!configuration.enabled)
|
|
64
62
|
return adapter.formatPass(payload);
|
|
65
|
-
if (event.kind === "inject-context")
|
|
66
|
-
bindWorkspacePlugin(root, adapter.host, process.env.PBOT_PLUGIN_MANIFEST || process.env.PBOT_PLUGIN_VERSION);
|
|
67
63
|
if (features.history && adapter.extractHistory) {
|
|
68
64
|
try {
|
|
69
65
|
const capture = await adapter.extractHistory(event);
|
|
@@ -84,13 +80,6 @@ export async function pluginHook(adapter, payload, replay) {
|
|
|
84
80
|
workspaceSkills.push(...await discoverSkills(directory, directory));
|
|
85
81
|
}
|
|
86
82
|
const notices = event.isSessionStart && features.history ? [...historyStartupNotices(root)] : [];
|
|
87
|
-
if (event.isSessionStart) {
|
|
88
|
-
const drift = workspacePluginDrift(workspacePluginReleases(root));
|
|
89
|
-
if (drift.outOfSync) {
|
|
90
|
-
const summary = Object.entries(drift.versions).map(([host, version]) => `${host}=${version}`).join(", ");
|
|
91
|
-
notices.push(`检测到当前工作区各宿主 Personal Bot 插件版本不一致(${summary}),可在终端运行 pbot upgrade 统一升级。`);
|
|
92
|
-
}
|
|
93
|
-
}
|
|
94
83
|
if (!includePrompts && !workspaceSkills.length && !notices.length)
|
|
95
84
|
return adapter.formatPass(payload);
|
|
96
85
|
const context = await loadWorkspaceContext({
|