personal-bot 0.2.20 → 0.3.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 -5
- package/.mcp.json +11 -0
- package/CONTEXT.md +17 -73
- package/README.md +41 -120
- package/README.zh-CN.md +41 -120
- package/docs/README.md +31 -23
- package/docs/architecture/design.md +74 -0
- package/docs/architecture/extensibility.md +78 -0
- package/docs/architecture/model-context.md +31 -0
- package/docs/architecture/model-instruction-guidelines.md +34 -0
- package/docs/architecture/principles.md +33 -0
- package/docs/guides/capabilities.md +36 -0
- package/docs/guides/cross-harness-workers.md +83 -0
- package/docs/guides/history.md +25 -0
- package/docs/guides/workspace-configuration.md +102 -0
- package/docs/hosts/antigravity.md +52 -0
- package/docs/hosts/claude-code.md +47 -0
- package/docs/hosts/dsh.md +67 -0
- package/docs/hosts/pi.md +49 -0
- package/docs/maintainers/release.md +59 -0
- package/hooks/hooks.json +0 -3
- package/lib/antigravity-plugin/hooks.json +23 -0
- package/lib/antigravity-plugin/lib/claude.d.ts +1 -0
- package/lib/antigravity-plugin/lib/claude.js +13 -0
- package/lib/antigravity-plugin/lib/common/json.d.ts +6 -0
- package/lib/antigravity-plugin/lib/common/json.js +16 -0
- package/lib/antigravity-plugin/lib/common/paths.d.ts +1 -0
- package/lib/antigravity-plugin/lib/common/paths.js +2 -0
- package/lib/antigravity-plugin/lib/common/validation.d.ts +3 -0
- package/lib/antigravity-plugin/lib/common/validation.js +8 -0
- package/lib/antigravity-plugin/lib/common/version.d.ts +3 -0
- package/lib/antigravity-plugin/lib/common/version.js +13 -0
- package/lib/antigravity-plugin/lib/extension/acp-worker.js +11597 -0
- package/lib/antigravity-plugin/lib/extension/mcp.js +2715 -0
- package/lib/antigravity-plugin/lib/extension/plugin-runtime.d.ts +10 -0
- package/lib/antigravity-plugin/lib/extension/plugin-runtime.js +67 -0
- package/lib/antigravity-plugin/lib/integrations/agent-resources.d.ts +16 -0
- package/lib/antigravity-plugin/lib/integrations/agent-resources.js +56 -0
- package/lib/antigravity-plugin/lib/integrations/hosts/antigravity.d.ts +4 -0
- package/lib/antigravity-plugin/lib/integrations/hosts/antigravity.js +79 -0
- package/lib/antigravity-plugin/lib/integrations/hosts/claude.d.ts +3 -0
- package/lib/antigravity-plugin/lib/integrations/hosts/claude.js +60 -0
- package/lib/antigravity-plugin/lib/integrations/hosts/registry.d.ts +15 -0
- package/lib/antigravity-plugin/lib/integrations/hosts/registry.js +34 -0
- package/lib/antigravity-plugin/lib/model/acp.d.ts +164 -0
- package/lib/antigravity-plugin/lib/model/acp.js +12 -0
- package/lib/antigravity-plugin/lib/model/plugin-host.d.ts +48 -0
- package/lib/antigravity-plugin/lib/model/workspace-config.d.ts +24 -0
- package/lib/antigravity-plugin/lib/model/workspace-config.js +1 -0
- package/lib/antigravity-plugin/lib/model/workspace-mcp.d.ts +51 -0
- package/lib/antigravity-plugin/lib/model/workspace-mcp.js +4 -0
- package/lib/antigravity-plugin/lib/plugin.d.ts +1 -0
- package/lib/antigravity-plugin/lib/plugin.js +17 -0
- package/lib/antigravity-plugin/lib/services/workspace/workspace-config.d.ts +8 -0
- package/lib/antigravity-plugin/lib/services/workspace/workspace-config.js +95 -0
- package/lib/antigravity-plugin/lib/services/workspace/workspace-preparation.d.ts +3 -0
- package/lib/antigravity-plugin/lib/services/workspace/workspace-preparation.js +26 -0
- package/lib/antigravity-plugin/lib/services/workspace/workspace-skills.d.ts +8 -0
- package/lib/antigravity-plugin/lib/services/workspace/workspace-skills.js +91 -0
- package/lib/antigravity-plugin/lib/storage/atomic-json.d.ts +11 -0
- package/lib/antigravity-plugin/lib/storage/atomic-json.js +101 -0
- package/lib/antigravity-plugin/mcp_config.json +13 -0
- package/lib/antigravity-plugin/package.json +6 -0
- package/lib/antigravity-plugin/plugin.json +7 -0
- package/lib/antigravity-plugin/resources/agents/coordinator.md +11 -0
- package/{resources/claude → lib/antigravity-plugin/resources}/agents/general-purpose.md +0 -5
- package/lib/antigravity-plugin/resources/prompts/plugin-coordinator.md +1 -0
- package/lib/antigravity-plugin/resources/prompts/workspace.md +31 -0
- package/lib/antigravity-plugin/resources/references/compute-finance.md +22 -0
- package/lib/antigravity-plugin/resources/references/compute.md +16 -0
- package/lib/antigravity-plugin/resources/references/task-conductor.md +25 -0
- package/lib/antigravity-plugin/resources/templates/workspace-agents.md +21 -0
- package/lib/antigravity-plugin/skills/pbot/SKILL.md +16 -0
- package/lib/antigravity-plugin/skills/project-maintenance/SKILL.md +35 -0
- package/lib/antigravity-plugin/skills/provider-connections/SKILL.md +42 -0
- package/lib/claude.js +4 -11
- package/lib/client.js +14 -531
- package/lib/common/markdown.js +2 -3
- package/lib/common/validation.d.ts +2 -0
- package/lib/common/validation.js +4 -0
- package/lib/extension/acp-member.d.ts +2 -0
- package/lib/extension/acp-member.js +9 -8
- package/lib/extension/acp-worker.js +11578 -121
- package/lib/extension/dsh/acp-member.js +26 -2
- package/lib/extension/dsh/command.js +19 -57
- package/lib/extension/dsh/history.js +2 -4
- package/lib/extension/dsh/management.d.ts +0 -2
- package/lib/extension/dsh/management.js +27 -126
- package/lib/extension/dsh/workspace.d.ts +5 -47
- package/lib/extension/dsh/workspace.js +76 -108
- package/lib/extension/mcp-bridge.d.ts +41 -0
- package/lib/extension/mcp-bridge.js +412 -0
- package/lib/extension/mcp-workers.d.ts +980 -0
- package/lib/extension/mcp-workers.js +882 -0
- package/lib/extension/mcp.js +2715 -0
- package/lib/extension/plugin-runtime.d.ts +10 -0
- package/lib/extension/plugin-runtime.js +67 -0
- package/lib/extension/setup-cli.js +215 -2
- package/lib/integrations/acp/agents.d.ts +10 -11
- package/lib/integrations/acp/agents.js +65 -33
- package/lib/integrations/acp/claude.d.ts +2 -2
- package/lib/integrations/acp/claude.js +5 -3
- package/lib/integrations/acp/connection.d.ts +17 -4
- package/lib/integrations/acp/connection.js +53 -27
- package/lib/integrations/acp/executable.d.ts +3 -0
- package/lib/integrations/acp/executable.js +42 -0
- package/lib/integrations/acp/harnesses/claude.d.ts +2 -0
- package/lib/integrations/acp/harnesses/claude.js +49 -0
- package/lib/integrations/acp/harnesses/dsh.d.ts +2 -0
- package/lib/integrations/acp/harnesses/dsh.js +35 -0
- package/lib/integrations/acp/harnesses/generic.d.ts +13 -0
- package/lib/integrations/acp/harnesses/generic.js +37 -0
- package/lib/integrations/acp/harnesses/pi.d.ts +2 -0
- package/lib/integrations/acp/harnesses/pi.js +34 -0
- package/lib/integrations/acp/harnesses/presets.d.ts +3 -0
- package/lib/integrations/acp/harnesses/presets.js +20 -0
- package/lib/integrations/acp/launch.d.ts +33 -4
- package/lib/integrations/acp/launch.js +60 -48
- package/lib/integrations/acp/mcp.d.ts +6 -0
- package/lib/integrations/acp/mcp.js +40 -0
- package/lib/integrations/acp/model-selection.d.ts +9 -2
- package/lib/integrations/acp/model-selection.js +73 -27
- package/lib/integrations/acp/registry.d.ts +18 -0
- package/lib/integrations/acp/registry.js +50 -0
- package/lib/integrations/agent-resources.d.ts +16 -1
- package/lib/integrations/agent-resources.js +45 -9
- package/lib/integrations/dsh/mcp.d.ts +4 -0
- package/lib/integrations/dsh/mcp.js +28 -0
- package/lib/integrations/dsh/resources.d.ts +3 -3
- package/lib/integrations/dsh/resources.js +21 -12
- package/lib/integrations/dsh/skills.d.ts +5 -1
- package/lib/integrations/dsh/skills.js +10 -6
- package/lib/integrations/hosts/antigravity.d.ts +4 -0
- package/lib/integrations/hosts/antigravity.js +79 -0
- package/lib/integrations/hosts/claude.d.ts +3 -0
- package/lib/integrations/hosts/claude.js +60 -0
- package/lib/integrations/hosts/registry.d.ts +15 -0
- package/lib/integrations/hosts/registry.js +34 -0
- package/lib/model/acp.d.ts +107 -2
- package/lib/model/acp.js +12 -1
- package/lib/model/agent.d.ts +35 -33
- package/lib/model/plugin-host.d.ts +48 -0
- package/lib/model/plugin-host.js +1 -0
- package/lib/model/workspace-config.d.ts +12 -0
- package/lib/model/workspace-mcp.d.ts +51 -0
- package/lib/model/workspace-mcp.js +4 -0
- package/lib/plugin.d.ts +1 -0
- package/lib/plugin.js +17 -0
- package/lib/services/agents/acp-run.d.ts +13 -1
- package/lib/services/agents/acp-run.js +30 -2
- package/lib/services/agents/agent-service.d.ts +35 -120
- package/lib/services/agents/agent-service.js +156 -160
- package/lib/services/installation/setup-service.js +17 -1
- package/lib/services/workspace/workspace-config.d.ts +2 -1
- package/lib/services/workspace/workspace-config.js +43 -9
- package/lib/services/workspace/workspace-mcp.d.ts +14 -0
- package/lib/services/workspace/workspace-mcp.js +200 -0
- package/lib/services/workspace/workspace-skills.d.ts +8 -0
- package/lib/services/workspace/workspace-skills.js +91 -0
- package/lib/storage/acp-files.d.ts +3 -1
- package/lib/storage/acp-files.js +32 -2
- package/lib/storage/acp-history.d.ts +3 -2
- package/lib/storage/acp-history.js +19 -7
- package/lib/storage/agent-files.d.ts +8 -8
- package/lib/storage/agent-files.js +27 -47
- package/lib/tools/history/contract.d.ts +1 -1
- package/lib/tools/history/contract.js +17 -11
- package/lib/ui/dsh/index.js +8 -3
- package/lib/ui/dsh/management.d.ts +1 -1
- package/lib/ui/dsh/management.js +24 -456
- package/lib/ui/dsh/remote.d.ts +0 -2
- package/lib/ui/dsh/remote.js +1 -1
- package/package.json +12 -7
- package/resources/agents/coordinator.md +2 -2
- package/resources/antigravity/skills/pbot/SKILL.md +16 -0
- package/resources/claude/skills/pbot/SKILL.md +1 -1
- package/resources/prompts/history-coordinator.md +1 -0
- package/resources/prompts/plugin-coordinator.md +1 -0
- package/resources/prompts/workspace.md +9 -8
- package/resources/references/compute.md +9 -11
- package/resources/references/task-conductor.md +12 -26
- package/resources/skills/project-maintenance/SKILL.md +16 -21
- package/resources/skills/provider-connections/SKILL.md +24 -40
- package/resources/templates/workspace-agents.md +4 -0
- package/scripts/README.md +17 -34
- package/src/claude.ts +4 -8
- package/src/common/markdown.ts +2 -3
- package/src/common/validation.ts +6 -0
- package/src/extension/acp-member.ts +9 -8
- package/src/extension/acp-worker.ts +239 -97
- package/src/extension/command.ts +38 -36
- package/src/extension/dsh/acp-member.ts +21 -2
- package/src/extension/dsh/command.ts +21 -51
- package/src/extension/dsh/files.ts +1 -0
- package/src/extension/dsh/history.ts +9 -6
- package/src/extension/dsh/management.ts +27 -58
- package/src/extension/dsh/workspace.ts +88 -99
- package/src/extension/events.ts +13 -10
- package/src/extension/history.ts +2 -50
- package/src/extension/lifecycle.ts +37 -22
- package/src/extension/mcp-bridge.ts +412 -0
- package/src/extension/mcp-workers.ts +941 -0
- package/src/extension/pi-acp-member.ts +29 -5
- package/src/extension/plugin-runtime.ts +63 -0
- package/src/extension/setup-cli.ts +186 -2
- package/src/integrations/acp/agents.ts +70 -24
- package/src/integrations/acp/claude.ts +11 -4
- package/src/integrations/acp/connection.ts +63 -25
- package/src/integrations/acp/executable.ts +41 -0
- package/src/integrations/acp/harnesses/claude.ts +50 -0
- package/src/integrations/acp/harnesses/dsh.ts +40 -0
- package/src/integrations/acp/harnesses/generic.ts +52 -0
- package/src/integrations/acp/harnesses/pi.ts +35 -0
- package/src/integrations/acp/harnesses/presets.ts +22 -0
- package/src/integrations/acp/launch.ts +69 -47
- package/src/integrations/acp/mcp.ts +43 -0
- package/src/integrations/acp/model-selection.ts +68 -25
- package/src/integrations/acp/registry.ts +60 -0
- package/src/integrations/agent-resources.ts +70 -6
- package/src/integrations/dsh/mcp.ts +30 -0
- package/src/integrations/dsh/resources.ts +28 -13
- package/src/integrations/dsh/skills.ts +16 -6
- package/src/integrations/hosts/antigravity.ts +83 -0
- package/src/integrations/hosts/claude.ts +62 -0
- package/src/integrations/hosts/registry.ts +42 -0
- package/src/integrations/pi/mcp.ts +26 -0
- package/src/mcp.ts +14 -0
- package/src/model/acp.ts +113 -3
- package/src/model/agent.ts +18 -14
- package/src/model/plugin-host.ts +39 -0
- package/src/model/workspace-config.ts +14 -0
- package/src/model/workspace-mcp.ts +64 -0
- package/src/pbot.ts +69 -20
- package/src/plugin.ts +19 -0
- package/src/services/agents/acp-run.ts +35 -3
- package/src/services/agents/agent-service.ts +180 -160
- package/src/services/installation/setup-service.ts +17 -2
- package/src/services/workspace/workspace-config.ts +46 -8
- package/src/services/workspace/workspace-mcp.ts +242 -0
- package/src/services/workspace/workspace-skills.ts +78 -0
- package/src/storage/acp-files.ts +32 -3
- package/src/storage/acp-history.ts +18 -7
- package/src/storage/agent-files.ts +27 -41
- package/src/tools/history/contract.ts +17 -11
- package/src/tools/register.ts +4 -8
- package/src/ui/dsh/index.ts +8 -3
- package/src/ui/dsh/management.ts +40 -282
- package/src/ui/dsh/remote.ts +2 -2
- package/docs/adr/0001-claude-skill-discovery.md +0 -3
- package/docs/adr/0002-claude-native-collaboration.md +0 -3
- package/docs/agent-collaboration.md +0 -190
- package/docs/architecture-guidelines.md +0 -37
- package/docs/capability-design.md +0 -55
- package/docs/claude-code-design.md +0 -44
- package/docs/claude-code.md +0 -57
- package/docs/dsh.md +0 -337
- package/docs/file-storage.md +0 -97
- package/docs/history.md +0 -54
- package/docs/installation-design.md +0 -86
- package/docs/interaction-design.md +0 -21
- package/docs/model-context.md +0 -76
- package/docs/model-instruction-guidelines.md +0 -51
- package/docs/release.md +0 -108
- package/docs/technical-design.md +0 -163
- package/docs/workspace-configuration.md +0 -79
- package/lib/extension/claude-hooks.d.ts +0 -9
- package/lib/extension/claude-hooks.js +0 -78
- package/lib/extension/dsh/agent-events.d.ts +0 -24
- package/lib/extension/dsh/agent-events.js +0 -242
- package/lib/extension/dsh/agent-runtime.d.ts +0 -49
- package/lib/extension/dsh/agent-runtime.js +0 -351
- package/lib/integrations/dsh/dsh-agents.d.ts +0 -30
- package/lib/integrations/dsh/dsh-agents.js +0 -104
- package/lib/integrations/dsh/input.d.ts +0 -21
- package/lib/integrations/dsh/input.js +0 -62
- package/lib/integrations/dsh/notifications.d.ts +0 -8
- package/lib/integrations/dsh/notifications.js +0 -55
- package/lib/integrations/dsh/session.d.ts +0 -14
- package/lib/integrations/dsh/session.js +0 -60
- package/lib/integrations/team-context.d.ts +0 -18
- package/lib/integrations/team-context.js +0 -61
- package/lib/model/team.d.ts +0 -85
- package/lib/services/agents/agent-notices.d.ts +0 -13
- package/lib/services/agents/agent-notices.js +0 -25
- package/lib/services/agents/start-options.d.ts +0 -4
- package/lib/services/agents/start-options.js +0 -20
- package/lib/services/agents/team-service.d.ts +0 -168
- package/lib/services/agents/team-service.js +0 -345
- package/lib/storage/team-files.d.ts +0 -16
- package/lib/storage/team-files.js +0 -111
- package/lib/tools/agents/actions.d.ts +0 -62
- package/lib/tools/agents/actions.js +0 -62
- package/lib/tools/agents/contract.d.ts +0 -181
- package/lib/tools/agents/contract.js +0 -84
- package/lib/tools/agents/dsh-tool.d.ts +0 -5
- package/lib/tools/agents/dsh-tool.js +0 -34
- package/lib/tools/result.d.ts +0 -18
- package/lib/tools/result.js +0 -10
- package/lib/tools/teams/actions.d.ts +0 -23
- package/lib/tools/teams/actions.js +0 -40
- package/lib/tools/teams/contract.d.ts +0 -201
- package/lib/tools/teams/contract.js +0 -91
- package/lib/tools/teams/dsh-tool.d.ts +0 -8
- package/lib/tools/teams/dsh-tool.js +0 -39
- package/lib/ui/dsh/attachments.d.ts +0 -5
- package/lib/ui/dsh/attachments.js +0 -39
- package/resources/prompts/claude-coordinator.md +0 -1
- package/resources/prompts/native-coordinator.md +0 -1
- package/resources/prompts/team-member.md +0 -7
- package/src/extension/agent-events.ts +0 -210
- package/src/extension/agents-command.ts +0 -89
- package/src/extension/claude-hooks.ts +0 -74
- package/src/extension/dsh/agent-events.ts +0 -148
- package/src/extension/dsh/agent-runtime.ts +0 -252
- package/src/extension/subagent-entry.ts +0 -270
- package/src/extension/teams-command.ts +0 -67
- package/src/integrations/dsh/dsh-agents.ts +0 -97
- package/src/integrations/dsh/input.ts +0 -66
- package/src/integrations/dsh/notifications.ts +0 -46
- package/src/integrations/pi/agent-context.ts +0 -18
- package/src/integrations/pi/agent-input.ts +0 -19
- package/src/integrations/pi/pi-agents.ts +0 -84
- package/src/integrations/pi/team-context.ts +0 -26
- package/src/integrations/team-context.ts +0 -64
- package/src/model/team.ts +0 -29
- package/src/services/agents/agent-notices.ts +0 -28
- package/src/services/agents/start-options.ts +0 -19
- package/src/services/agents/team-service.ts +0 -275
- package/src/storage/team-files.ts +0 -93
- package/src/tools/agents/actions.ts +0 -57
- package/src/tools/agents/contract.ts +0 -101
- package/src/tools/agents/dsh-tool.ts +0 -37
- package/src/tools/agents/tool.ts +0 -20
- package/src/tools/teams/actions.ts +0 -34
- package/src/tools/teams/contract.ts +0 -109
- package/src/tools/teams/dsh-tool.ts +0 -45
- package/src/tools/teams/tool.ts +0 -29
- package/src/ui/agent-display.ts +0 -14
- package/src/ui/dsh/attachments.ts +0 -42
- package/src/ui/pi/menu.ts +0 -37
- package/src/ui/pi/reader.ts +0 -46
- /package/lib/{model/team.js → antigravity-plugin/lib/model/plugin-host.js} +0 -0
|
@@ -1,8 +1,11 @@
|
|
|
1
|
+
import * as McpClient from "@deepseek-ai/dsh-mcp-client";
|
|
1
2
|
import { acpMember } from "../acp-member.js";
|
|
2
3
|
import { rootAgents } from "../../integrations/dsh/root-agents.js";
|
|
3
4
|
import { dshResources, dshExpertTools } from "../../integrations/dsh/resources.js";
|
|
4
5
|
import { registerDshSkills } from "../../integrations/dsh/skills.js";
|
|
6
|
+
import { toDshMcpConfig } from "../../integrations/dsh/mcp.js";
|
|
5
7
|
import { finalDshAnswer } from "../../integrations/dsh/messages.js";
|
|
8
|
+
import { readWorkspaceMcpConfig, resolveWorkspaceMcpServer } from "../../services/workspace/workspace-mcp.js";
|
|
6
9
|
import { registerDshFileEvents } from "./files.js";
|
|
7
10
|
import { requireThat } from "../../common/validation.js";
|
|
8
11
|
export const name = "pbot-acp-member";
|
|
@@ -24,9 +27,30 @@ export async function apply(ctx) {
|
|
|
24
27
|
requireThat(reference.host === "acp" && reference.backend === "dsh" && agent.session.header.cwd === member.d.cwd &&
|
|
25
28
|
(reference.sessionId === null || reference.sessionId === agent.id), "dsh ACP 会话身份或工作目录不匹配。");
|
|
26
29
|
await agent.ctx.plugin({ name: "pbot-acp-expert", inject, apply: async (scope) => {
|
|
27
|
-
|
|
30
|
+
if (member.features.skills)
|
|
31
|
+
registerDshSkills(scope, agent, { workspaceRoot: member.d.workspace });
|
|
32
|
+
if (member.features.mcp && process.env.PBOT_ACP_VALIDATE !== "1") {
|
|
33
|
+
const mcpConfig = await readWorkspaceMcpConfig(member.d.workspace);
|
|
34
|
+
if (mcpConfig.error) {
|
|
35
|
+
ctx.logger.warn(mcpConfig.error);
|
|
36
|
+
}
|
|
37
|
+
else {
|
|
38
|
+
for (const [serverName, server] of Object.entries(mcpConfig.servers)) {
|
|
39
|
+
if (server.enabled === false)
|
|
40
|
+
continue;
|
|
41
|
+
try {
|
|
42
|
+
const resolved = resolveWorkspaceMcpServer(member.d.workspace, serverName, server);
|
|
43
|
+
await scope.plugin(McpClient, toDshMcpConfig(resolved));
|
|
44
|
+
}
|
|
45
|
+
catch (error) {
|
|
46
|
+
ctx.logger.warn(error instanceof Error ? error.message : String(error));
|
|
47
|
+
}
|
|
48
|
+
}
|
|
49
|
+
}
|
|
50
|
+
}
|
|
28
51
|
dshExpertTools(scope, agent, member.d.options);
|
|
29
|
-
|
|
52
|
+
if (member.features.prompts)
|
|
53
|
+
await dshResources(scope, agent, member.d.workspace, "general-purpose", member.check);
|
|
30
54
|
registerDshFileEvents(scope, agent, member.d.workspace, true, member.check);
|
|
31
55
|
let input, answer = "";
|
|
32
56
|
scope.on("session/event", (session, event) => {
|
|
@@ -1,34 +1,23 @@
|
|
|
1
|
-
import { Type } from "../../common/typebox.js";
|
|
2
1
|
import { object, json } from "../../common/json.js";
|
|
3
2
|
import { requireThat } from "../../common/validation.js";
|
|
4
|
-
import { schema } from "../../common/schema.js";
|
|
5
|
-
import { executeAgent } from "../../tools/agents/actions.js";
|
|
6
|
-
import { agentInput } from "../../tools/agents/contract.js";
|
|
7
|
-
import { executeTeam, executeTeamMessage } from "../../tools/teams/actions.js";
|
|
8
|
-
import { teamInput, teamMessageInput } from "../../tools/teams/contract.js";
|
|
9
3
|
import { dshWorkspaceStatus } from "./management.js";
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
files: Type.Optional(Type.Array(Type.String({ minLength: 1 }), { maxItems: 32 })) }, { additionalProperties: false });
|
|
13
|
-
const validChat = schema(chatSchema);
|
|
14
|
-
const approvalSchema = Type.Object({ agentId: Type.String({ minLength: 1 }), requestId: Type.String({ minLength: 1 }),
|
|
15
|
-
optionId: Type.Union([Type.String({ minLength: 1 }), Type.Null()]) }, { additionalProperties: false });
|
|
16
|
-
const validApproval = schema(approvalSchema);
|
|
17
|
-
const usage = '用法:/pbot status | init | agent {"action":…} | chat {"agentId":…,"text":…} | team {"action":…} | messages {"teamId":…} | post {"teamId":…,"text":…} | history {"action":…} | records {"agentId":…}';
|
|
4
|
+
import { parseWorkerCommand } from "../mcp-workers.js";
|
|
5
|
+
const usage = '用法:/pbot status | init | worker [overview|status|backends|models|create|request|response|output|close] [JSON] | history {"action":…}';
|
|
18
6
|
export function registerDshCommand(ctx, workspaces, management) {
|
|
19
|
-
ctx.commands.register({
|
|
20
|
-
|
|
21
|
-
|
|
7
|
+
ctx.commands.register({
|
|
8
|
+
name: "pbot",
|
|
9
|
+
description: "Personal Bot 工作区、跨 Harness worker 与历史管理",
|
|
10
|
+
recordInput: false,
|
|
11
|
+
input: { hint: "status | init | worker ... | history JSON", attachments: false },
|
|
12
|
+
async handler({ agent, rawInput, signal }) {
|
|
22
13
|
signal.throwIfAborted();
|
|
23
14
|
const command = rawInput.trim(), split = command.search(/\s/);
|
|
24
15
|
if (!command || command === "status") {
|
|
25
|
-
requireThat(!attachments.length, "状态查询不接受附件。");
|
|
26
16
|
const status = await dshWorkspaceStatus(workspaces, agent);
|
|
27
17
|
signal.throwIfAborted();
|
|
28
18
|
return { kind: "success", text: JSON.stringify(status, null, 2) };
|
|
29
19
|
}
|
|
30
20
|
if (command === "init") {
|
|
31
|
-
requireThat(!attachments.length, "初始化不接受附件。");
|
|
32
21
|
await workspaces.initialize(agent);
|
|
33
22
|
signal.throwIfAborted();
|
|
34
23
|
return { kind: "success", text: JSON.stringify(await dshWorkspaceStatus(workspaces, agent), null, 2) };
|
|
@@ -36,50 +25,23 @@ export function registerDshCommand(ctx, workspaces, management) {
|
|
|
36
25
|
const workspace = await workspaces.get(agent);
|
|
37
26
|
signal.throwIfAborted();
|
|
38
27
|
const verb = split < 0 ? command : command.slice(0, split);
|
|
39
|
-
|
|
40
|
-
requireThat(split >= 0, usage);
|
|
41
|
-
const input = JSON.parse(command.slice(split));
|
|
42
|
-
requireThat(object(input), "命令参数必须是 JSON 对象。");
|
|
28
|
+
const rest = split < 0 ? "" : command.slice(split).trim();
|
|
43
29
|
let result;
|
|
44
30
|
switch (verb) {
|
|
45
|
-
case "
|
|
46
|
-
const
|
|
47
|
-
|
|
48
|
-
provider: selection.provider, model: selection.model,
|
|
49
|
-
...(selection.reasoningEffort ? { thinking: selection.reasoningEffort } : {}),
|
|
50
|
-
} : {});
|
|
51
|
-
result = output.structuredContent;
|
|
31
|
+
case "worker": {
|
|
32
|
+
const { tool, args } = parseWorkerCommand(rest);
|
|
33
|
+
result = await workspace.workers.callTool(tool, { workspace: workspace.root, ...args });
|
|
52
34
|
break;
|
|
53
35
|
}
|
|
54
|
-
case "
|
|
55
|
-
requireThat(
|
|
56
|
-
const
|
|
57
|
-
|
|
58
|
-
break;
|
|
59
|
-
}
|
|
60
|
-
case "approval": {
|
|
61
|
-
requireThat(validApproval(input), "ACP 确认答复参数无效。");
|
|
62
|
-
const args = input;
|
|
63
|
-
workspace.agents.answerPermission(args.agentId, args.requestId, args.optionId, workspace.owner);
|
|
64
|
-
result = { answered: true };
|
|
65
|
-
break;
|
|
66
|
-
}
|
|
67
|
-
case "team":
|
|
68
|
-
result = executeTeam(workspace.teams, workspace.agents, teamInput(input), workspace.owner).structuredContent;
|
|
69
|
-
break;
|
|
70
|
-
case "messages":
|
|
71
|
-
result = executeTeamMessage(workspace.teams, teamMessageInput({ ...input, action: "read" }), { kind: "coordinator", owner: workspace.owner }, commandId).structuredContent;
|
|
72
|
-
break;
|
|
73
|
-
case "post":
|
|
74
|
-
result = executeTeamMessage(workspace.teams, teamMessageInput({ ...input, action: "post" }), { kind: "user", owner: workspace.owner }, commandId).structuredContent;
|
|
75
|
-
break;
|
|
76
|
-
case "history":
|
|
36
|
+
case "history": {
|
|
37
|
+
requireThat(rest.length > 0, usage);
|
|
38
|
+
const input = JSON.parse(rest);
|
|
39
|
+
requireThat(object(input), "命令参数必须是 JSON 对象。");
|
|
77
40
|
result = await management.history({ parentSessionId: agent.id, input: json(input) }, signal);
|
|
78
41
|
break;
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
default: throw new Error(usage);
|
|
42
|
+
}
|
|
43
|
+
default:
|
|
44
|
+
throw new Error(usage);
|
|
83
45
|
}
|
|
84
46
|
workspace.check();
|
|
85
47
|
return { kind: "success", text: JSON.stringify(result, null, 2) };
|
|
@@ -1,12 +1,11 @@
|
|
|
1
1
|
import { join } from "node:path";
|
|
2
|
-
import { dshHomePath } from "@deepseek-ai/dsh-home-paths";
|
|
3
|
-
import { AgentFiles } from "../../storage/agent-files.js";
|
|
4
2
|
import { acpHistorySessions } from "../../storage/acp-history.js";
|
|
5
3
|
import { HistoryFiles } from "../../storage/history-files.js";
|
|
6
4
|
import { HistoryService } from "../../services/history/history-service.js";
|
|
7
5
|
import { DshHistory } from "../../integrations/dsh/history.js";
|
|
8
6
|
import { dshHistorySummarizer } from "../../integrations/dsh/history-summary.js";
|
|
9
7
|
import { finalDshAnswer } from "../../integrations/dsh/messages.js";
|
|
8
|
+
import { defaultWorkerDirectory } from "../mcp-workers.js";
|
|
10
9
|
/** One server-owned organizer per workspace, shared by its parent Sessions. */
|
|
11
10
|
export class DshHistoryWork {
|
|
12
11
|
ctx;
|
|
@@ -17,8 +16,7 @@ export class DshHistoryWork {
|
|
|
17
16
|
#closing;
|
|
18
17
|
constructor(ctx, root) {
|
|
19
18
|
this.ctx = ctx;
|
|
20
|
-
|
|
21
|
-
this.service = new HistoryService(root, new HistoryFiles(join(root, ".pbot/history"), "dsh"), new DshHistory(ctx, root, () => agents.list().filter(value => value.workspace === root).map(value => value.agentId)), [new HistoryFiles(join(root, ".pbot/history"), "pi"), new HistoryFiles(join(root, ".pbot/history"), "claude")], () => acpHistorySessions({ dsh: agents.root }));
|
|
19
|
+
this.service = new HistoryService(root, new HistoryFiles(join(root, ".pbot/history"), "dsh"), new DshHistory(ctx, root), [new HistoryFiles(join(root, ".pbot/history"), "pi"), new HistoryFiles(join(root, ".pbot/history"), "claude")], () => acpHistorySessions({ mcp: defaultWorkerDirectory() }));
|
|
22
20
|
}
|
|
23
21
|
attach(agent) { this.#parents.add(agent); return () => { this.#parents.delete(agent); }; }
|
|
24
22
|
cancel() { this.#controller?.abort(); }
|
|
@@ -13,8 +13,6 @@ export declare class PbotManagement extends TypertRemoteService {
|
|
|
13
13
|
private parent;
|
|
14
14
|
private workspace;
|
|
15
15
|
snapshot(request: Json, signal: AbortSignal): Promise<Json>;
|
|
16
|
-
expert(request: Json, signal: AbortSignal): Promise<Json>;
|
|
17
|
-
team(request: Json, signal: AbortSignal): Promise<Json>;
|
|
18
16
|
history(request: Json, signal: AbortSignal): Promise<Json>;
|
|
19
17
|
}
|
|
20
18
|
declare module "@deepseek-ai/cordis" {
|
|
@@ -32,61 +32,8 @@ var __esDecorate = (this && this.__esDecorate) || function (ctor, descriptorIn,
|
|
|
32
32
|
if (target) Object.defineProperty(target, contextIn.name, descriptor);
|
|
33
33
|
done = true;
|
|
34
34
|
};
|
|
35
|
-
var __addDisposableResource = (this && this.__addDisposableResource) || function (env, value, async) {
|
|
36
|
-
if (value !== null && value !== void 0) {
|
|
37
|
-
if (typeof value !== "object" && typeof value !== "function") throw new TypeError("Object expected.");
|
|
38
|
-
var dispose, inner;
|
|
39
|
-
if (async) {
|
|
40
|
-
if (!Symbol.asyncDispose) throw new TypeError("Symbol.asyncDispose is not defined.");
|
|
41
|
-
dispose = value[Symbol.asyncDispose];
|
|
42
|
-
}
|
|
43
|
-
if (dispose === void 0) {
|
|
44
|
-
if (!Symbol.dispose) throw new TypeError("Symbol.dispose is not defined.");
|
|
45
|
-
dispose = value[Symbol.dispose];
|
|
46
|
-
if (async) inner = dispose;
|
|
47
|
-
}
|
|
48
|
-
if (typeof dispose !== "function") throw new TypeError("Object not disposable.");
|
|
49
|
-
if (inner) dispose = function() { try { inner.call(this); } catch (e) { return Promise.reject(e); } };
|
|
50
|
-
env.stack.push({ value: value, dispose: dispose, async: async });
|
|
51
|
-
}
|
|
52
|
-
else if (async) {
|
|
53
|
-
env.stack.push({ async: true });
|
|
54
|
-
}
|
|
55
|
-
return value;
|
|
56
|
-
};
|
|
57
|
-
var __disposeResources = (this && this.__disposeResources) || (function (SuppressedError) {
|
|
58
|
-
return function (env) {
|
|
59
|
-
function fail(e) {
|
|
60
|
-
env.error = env.hasError ? new SuppressedError(e, env.error, "An error was suppressed during disposal.") : e;
|
|
61
|
-
env.hasError = true;
|
|
62
|
-
}
|
|
63
|
-
var r, s = 0;
|
|
64
|
-
function next() {
|
|
65
|
-
while (r = env.stack.pop()) {
|
|
66
|
-
try {
|
|
67
|
-
if (!r.async && s === 1) return s = 0, env.stack.push(r), Promise.resolve().then(next);
|
|
68
|
-
if (r.dispose) {
|
|
69
|
-
var result = r.dispose.call(r.value);
|
|
70
|
-
if (r.async) return s |= 2, Promise.resolve(result).then(next, function(e) { fail(e); return next(); });
|
|
71
|
-
}
|
|
72
|
-
else s |= 1;
|
|
73
|
-
}
|
|
74
|
-
catch (e) {
|
|
75
|
-
fail(e);
|
|
76
|
-
}
|
|
77
|
-
}
|
|
78
|
-
if (s === 1) return env.hasError ? Promise.reject(env.error) : Promise.resolve();
|
|
79
|
-
if (env.hasError) throw env.error;
|
|
80
|
-
}
|
|
81
|
-
return next();
|
|
82
|
-
};
|
|
83
|
-
})(typeof SuppressedError === "function" ? SuppressedError : function (error, suppressed, message) {
|
|
84
|
-
var e = new Error(message);
|
|
85
|
-
return e.name = "SuppressedError", e.error = error, e.suppressed = suppressed, e;
|
|
86
|
-
});
|
|
87
35
|
import { Remote, TypertRemoteService } from "@deepseek-ai/dsh-typert-protocol";
|
|
88
36
|
import { SessionId } from "@deepseek-ai/dsh-session";
|
|
89
|
-
import { extractSessionEventText } from "@deepseek-ai/dsh-session-query";
|
|
90
37
|
import { Type } from "../../common/typebox.js";
|
|
91
38
|
import { json } from "../../common/json.js";
|
|
92
39
|
import { requireThat } from "../../common/validation.js";
|
|
@@ -96,29 +43,36 @@ import { historyInput } from "../../tools/history/contract.js";
|
|
|
96
43
|
import { executeHistory } from "../../tools/history/actions.js";
|
|
97
44
|
import { pbotReadRemote } from "../../ui/dsh/remote.js";
|
|
98
45
|
const requestSchema = Type.Object({ parentSessionId: Type.String({ minLength: 1 }), input: Type.Optional(Type.Unknown()) }, { additionalProperties: false });
|
|
99
|
-
const
|
|
100
|
-
limit: Type.Optional(Type.Integer({ minimum: 1, maximum: 100 })), seq: Type.Optional(Type.Integer({ minimum: 0 })),
|
|
101
|
-
textOffset: Type.Optional(Type.Integer({ minimum: 0 })), textLimit: Type.Optional(Type.Integer({ minimum: 2, maximum: 24000 })),
|
|
102
|
-
format: Type.Optional(Type.Union([Type.Literal("text"), Type.Literal("json")])) }, { additionalProperties: false });
|
|
103
|
-
const teamSchema = Type.Object({ teamId: Type.String({ minLength: 1 }), afterSeq: Type.Optional(Type.Integer({ minimum: 0 })),
|
|
104
|
-
seq: Type.Optional(Type.Integer({ minimum: 1 })), offset: Type.Optional(Type.Integer({ minimum: 0 })),
|
|
105
|
-
limit: Type.Optional(Type.Integer({ minimum: 1, maximum: 16000 })) }, { additionalProperties: false });
|
|
106
|
-
const validRequest = schema(requestSchema), validExpert = schema(expertSchema), validTeam = schema(teamSchema);
|
|
46
|
+
const validRequest = schema(requestSchema);
|
|
107
47
|
export function dshStatus(workspace) {
|
|
108
48
|
workspace.check();
|
|
109
|
-
|
|
110
|
-
|
|
49
|
+
return json({
|
|
50
|
+
host: "dsh",
|
|
51
|
+
release: packageVersion,
|
|
52
|
+
enabled: true,
|
|
53
|
+
state: "running",
|
|
54
|
+
workspaceRoot: workspace.root,
|
|
55
|
+
sessionId: workspace.agent.id,
|
|
111
56
|
model: workspace.agent.model.current() ?? null,
|
|
112
|
-
|
|
113
|
-
|
|
57
|
+
history: workspace.history.status,
|
|
58
|
+
});
|
|
114
59
|
}
|
|
115
60
|
/** Status remains available when this workspace has not opted in. */
|
|
116
61
|
export async function dshWorkspaceStatus(workspaces, agent) {
|
|
117
62
|
const { root, configuration } = await workspaces.configuration(agent);
|
|
118
|
-
if (!configuration.enabled)
|
|
119
|
-
return json({
|
|
120
|
-
|
|
121
|
-
|
|
63
|
+
if (!configuration.enabled) {
|
|
64
|
+
return json({
|
|
65
|
+
host: "dsh",
|
|
66
|
+
release: packageVersion,
|
|
67
|
+
enabled: false,
|
|
68
|
+
state: configuration.error ? "error" : "disabled",
|
|
69
|
+
nextStep: configuration.error ? configuration.error : "/pbot init",
|
|
70
|
+
workspaceRoot: root,
|
|
71
|
+
sessionId: agent.id,
|
|
72
|
+
configuration,
|
|
73
|
+
model: agent.model.current() ?? null,
|
|
74
|
+
});
|
|
75
|
+
}
|
|
122
76
|
return json({ ...dshStatus(await workspaces.get(agent)), configuration });
|
|
123
77
|
}
|
|
124
78
|
/** Native Remote owns transport and access checks. These workspace reads do not admit or cancel execution. */
|
|
@@ -126,19 +80,13 @@ let PbotManagement = (() => {
|
|
|
126
80
|
let _classSuper = TypertRemoteService;
|
|
127
81
|
let _instanceExtraInitializers = [];
|
|
128
82
|
let _snapshot_decorators;
|
|
129
|
-
let _expert_decorators;
|
|
130
|
-
let _team_decorators;
|
|
131
83
|
let _history_decorators;
|
|
132
84
|
return class PbotManagement extends _classSuper {
|
|
133
85
|
static {
|
|
134
86
|
const _metadata = typeof Symbol === "function" && Symbol.metadata ? Object.create(_classSuper[Symbol.metadata] ?? null) : void 0;
|
|
135
87
|
_snapshot_decorators = [Remote];
|
|
136
|
-
_expert_decorators = [Remote];
|
|
137
|
-
_team_decorators = [Remote];
|
|
138
88
|
_history_decorators = [Remote];
|
|
139
89
|
__esDecorate(this, null, _snapshot_decorators, { kind: "method", name: "snapshot", static: false, private: false, access: { has: obj => "snapshot" in obj, get: obj => obj.snapshot }, metadata: _metadata }, null, _instanceExtraInitializers);
|
|
140
|
-
__esDecorate(this, null, _expert_decorators, { kind: "method", name: "expert", static: false, private: false, access: { has: obj => "expert" in obj, get: obj => obj.expert }, metadata: _metadata }, null, _instanceExtraInitializers);
|
|
141
|
-
__esDecorate(this, null, _team_decorators, { kind: "method", name: "team", static: false, private: false, access: { has: obj => "team" in obj, get: obj => obj.team }, metadata: _metadata }, null, _instanceExtraInitializers);
|
|
142
90
|
__esDecorate(this, null, _history_decorators, { kind: "method", name: "history", static: false, private: false, access: { has: obj => "history" in obj, get: obj => obj.history }, metadata: _metadata }, null, _instanceExtraInitializers);
|
|
143
91
|
if (_metadata) Object.defineProperty(this, Symbol.metadata, { enumerable: true, configurable: true, writable: true, value: _metadata });
|
|
144
92
|
}
|
|
@@ -169,55 +117,6 @@ let PbotManagement = (() => {
|
|
|
169
117
|
signal.throwIfAborted();
|
|
170
118
|
return status;
|
|
171
119
|
}
|
|
172
|
-
async expert(request, signal) {
|
|
173
|
-
const env_1 = { stack: [], error: void 0, hasError: false };
|
|
174
|
-
try {
|
|
175
|
-
const current = await this.workspace(request, signal), { workspace, input } = current;
|
|
176
|
-
requireThat(validExpert(input), "专家记录查询参数无效。");
|
|
177
|
-
const args = input;
|
|
178
|
-
const view = workspace.agents.status(args.agentId, workspace.owner);
|
|
179
|
-
if (view.transport === "acp")
|
|
180
|
-
return json(await workspace.agents.recordPage(args.agentId, workspace.owner, args));
|
|
181
|
-
const observation = __addDisposableResource(env_1, await this.ctx.sessionQuery.observeSession(SessionId(view.agentId), { projectionMode: "none", signal: current.signal }), false);
|
|
182
|
-
workspace.check();
|
|
183
|
-
current.signal.throwIfAborted();
|
|
184
|
-
const header = observation.header;
|
|
185
|
-
requireThat(header.id === view.agentId && header.cwd === view.cwd && header.parentSession === workspace.agent.id &&
|
|
186
|
-
header.origin === "subagent" && !header.isSeeded, "原生专家记录的身份或归属不匹配。");
|
|
187
|
-
const events = observation.events;
|
|
188
|
-
if (args.seq !== undefined) {
|
|
189
|
-
const event = events.find(value => value.seq === args.seq);
|
|
190
|
-
requireThat(event, "原生记录位置不存在。");
|
|
191
|
-
const text = (args.format === "text" ? extractSessionEventText(event) : "") || JSON.stringify(event, null, 2), offset = args.textOffset ?? 0;
|
|
192
|
-
requireThat(offset <= text.length, "原生记录分页位置超出范围。");
|
|
193
|
-
let end = Math.min(text.length, offset + (args.textLimit ?? 12000));
|
|
194
|
-
if (end < text.length && /[\uD800-\uDBFF]/.test(text[end - 1]))
|
|
195
|
-
end--;
|
|
196
|
-
return json({ agent: view, cursor: observation.cursor, seq: event.seq, offset, text: text.slice(offset, end),
|
|
197
|
-
totalLength: text.length, nextOffset: end < text.length ? end : null });
|
|
198
|
-
}
|
|
199
|
-
const limit = args.limit ?? 30, offset = args.offset ?? Math.max(0, events.length - limit);
|
|
200
|
-
requireThat(offset <= events.length, "原生记录分页位置超出范围。");
|
|
201
|
-
return json({ agent: view, header, cursor: observation.cursor, total: events.length, offset,
|
|
202
|
-
nextOffset: offset + limit < events.length ? offset + limit : null,
|
|
203
|
-
events: events.slice(offset, offset + limit).map(event => ({ seq: event.seq, type: event.type, time: event.time,
|
|
204
|
-
...(event.type === "user/message" ? { source: event.data.source.kind } : {}), preview: extractSessionEventText(event).slice(0, 800) })) });
|
|
205
|
-
}
|
|
206
|
-
catch (e_1) {
|
|
207
|
-
env_1.error = e_1;
|
|
208
|
-
env_1.hasError = true;
|
|
209
|
-
}
|
|
210
|
-
finally {
|
|
211
|
-
__disposeResources(env_1);
|
|
212
|
-
}
|
|
213
|
-
}
|
|
214
|
-
async team(request, signal) {
|
|
215
|
-
const { workspace, input } = await this.workspace(request, signal);
|
|
216
|
-
requireThat(validTeam(input), "团队记录查询参数无效。");
|
|
217
|
-
const args = input;
|
|
218
|
-
return json({ team: workspace.teams.status(args.teamId, workspace.owner, workspace.agents.list(workspace.owner)),
|
|
219
|
-
page: workspace.teams.read(args.teamId, { kind: "user", owner: workspace.owner }, args) });
|
|
220
|
-
}
|
|
221
120
|
async history(request, signal) {
|
|
222
121
|
const current = await this.workspace(request, signal), { workspace, input } = current;
|
|
223
122
|
const result = await executeHistory(workspace.history, historyInput(input), { host: "dsh", sessionId: workspace.agent.id }, current.signal);
|
|
@@ -229,7 +128,9 @@ let PbotManagement = (() => {
|
|
|
229
128
|
})();
|
|
230
129
|
export { PbotManagement };
|
|
231
130
|
export function registerDshManagement(ctx, workspaces) {
|
|
232
|
-
ctx.typert.register({
|
|
233
|
-
|
|
131
|
+
ctx.typert.register({
|
|
132
|
+
package: pbotReadRemote.package, face: "host", schemas: [],
|
|
133
|
+
model: { services: [], events: [], objects: [] }, invocations: pbotReadRemote.descriptors,
|
|
134
|
+
});
|
|
234
135
|
return new PbotManagement(ctx, workspaces);
|
|
235
136
|
}
|
|
@@ -1,15 +1,9 @@
|
|
|
1
1
|
import type { Agent } from "@deepseek-ai/dsh-agent";
|
|
2
2
|
import type { Context } from "@deepseek-ai/cordis";
|
|
3
|
-
import type { FileBlock, ImageBlock } from "@deepseek-ai/dsh-llm";
|
|
4
|
-
import type { AcpCommands } from "../../model/acp.js";
|
|
5
|
-
import type { AgentOwner } from "../../model/agent.js";
|
|
6
|
-
import { DshAgents } from "../../integrations/dsh/dsh-agents.js";
|
|
7
|
-
import { AgentService } from "../../services/agents/agent-service.js";
|
|
8
|
-
import { TeamService } from "../../services/agents/team-service.js";
|
|
9
|
-
import { DshAgentRuntime } from "./agent-runtime.js";
|
|
10
3
|
import { DshHistoryWork } from "./history.js";
|
|
11
4
|
import type { HistoryService } from "../../services/history/history-service.js";
|
|
12
|
-
import type { WorkspaceConfiguration } from "../../model/workspace-config.js";
|
|
5
|
+
import type { ResolvedWorkspaceFeatures, WorkspaceConfiguration } from "../../model/workspace-config.js";
|
|
6
|
+
import { McpWorkerRuntime } from "../mcp-workers.js";
|
|
13
7
|
export declare const dshDependencies: string[];
|
|
14
8
|
export declare class DshWorkspace {
|
|
15
9
|
#private;
|
|
@@ -19,49 +13,13 @@ export declare class DshWorkspace {
|
|
|
19
13
|
readonly component: AbortSignal;
|
|
20
14
|
private readonly historyWork;
|
|
21
15
|
private readonly releaseHistory;
|
|
16
|
+
readonly features: ResolvedWorkspaceFeatures;
|
|
22
17
|
readonly lifetime: AbortController;
|
|
23
|
-
readonly host: DshAgents;
|
|
24
|
-
readonly agents: AgentService;
|
|
25
|
-
readonly teams: TeamService;
|
|
26
18
|
readonly history: HistoryService;
|
|
27
|
-
readonly
|
|
28
|
-
constructor(ctx: Context, root: string, agent: Agent, component: AbortSignal, historyWork: DshHistoryWork, releaseHistory: () => Promise<void>,
|
|
19
|
+
readonly workers: McpWorkerRuntime;
|
|
20
|
+
constructor(ctx: Context, root: string, agent: Agent, component: AbortSignal, historyWork: DshHistoryWork, releaseHistory: () => Promise<void>, features?: ResolvedWorkspaceFeatures);
|
|
29
21
|
check: () => void;
|
|
30
|
-
get controlError(): string | undefined;
|
|
31
22
|
open(): Promise<void>;
|
|
32
|
-
interact(id: string, text: string, delivery: "steer" | "followUp" | undefined, files: readonly string[] | undefined, attachments: readonly (ImageBlock | FileBlock)[] | undefined, signal: AbortSignal): Promise<{
|
|
33
|
-
requestId: string;
|
|
34
|
-
messageStatus: "queued";
|
|
35
|
-
name: string;
|
|
36
|
-
generation: string;
|
|
37
|
-
state: import("../../model/agent.js").AgentStatus["state"];
|
|
38
|
-
activity: string;
|
|
39
|
-
backend?: import("../../model/acp.js").AcpBackend;
|
|
40
|
-
transport?: "native" | "acp";
|
|
41
|
-
selection?: import("../../model/acp.js").AcpModelSelection;
|
|
42
|
-
capabilities?: {
|
|
43
|
-
steer: boolean;
|
|
44
|
-
resume: boolean;
|
|
45
|
-
team: boolean;
|
|
46
|
-
transcript: boolean;
|
|
47
|
-
};
|
|
48
|
-
cycle?: import("../../model/agent.js").AgentCycle;
|
|
49
|
-
error?: string;
|
|
50
|
-
owned: boolean;
|
|
51
|
-
agentId: string;
|
|
52
|
-
release: string;
|
|
53
|
-
workspace: string;
|
|
54
|
-
cwd: string;
|
|
55
|
-
parentSessionId: string;
|
|
56
|
-
parentLeaf: string | null;
|
|
57
|
-
createdAt: number;
|
|
58
|
-
options: import("../../model/agent.js").AgentOptions;
|
|
59
|
-
alive: boolean;
|
|
60
|
-
} | {
|
|
61
|
-
status: "queued";
|
|
62
|
-
messageId: import("@deepseek-ai/dsh-llm").MessageId;
|
|
63
|
-
}>;
|
|
64
|
-
expert(id: string): DshAgentRuntime;
|
|
65
23
|
close(): Promise<void>;
|
|
66
24
|
}
|
|
67
25
|
export declare class DshWorkspaces {
|