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
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
import { requireThat } from "../../common/validation.js";
|
|
2
|
+
import { antigravityAdapter } from "./antigravity.js";
|
|
3
|
+
import { claudeAdapter } from "./claude.js";
|
|
4
|
+
/** Extensible registry of hook-based plugin host adapters; runtime never branches on host IDs. */
|
|
5
|
+
export class PluginHostRegistry {
|
|
6
|
+
#adapters = new Map();
|
|
7
|
+
constructor(initial = []) {
|
|
8
|
+
for (const adapter of initial)
|
|
9
|
+
this.register(adapter);
|
|
10
|
+
}
|
|
11
|
+
register(adapter) {
|
|
12
|
+
requireThat(typeof adapter.host === "string" && adapter.host.length > 0, "插件宿主标识无效。");
|
|
13
|
+
this.#adapters.set(adapter.host, adapter);
|
|
14
|
+
return this;
|
|
15
|
+
}
|
|
16
|
+
unregister(host) {
|
|
17
|
+
return this.#adapters.delete(host);
|
|
18
|
+
}
|
|
19
|
+
get(host) {
|
|
20
|
+
return this.#adapters.get(host);
|
|
21
|
+
}
|
|
22
|
+
require(host) {
|
|
23
|
+
const adapter = this.#adapters.get(host);
|
|
24
|
+
requireThat(adapter, `未注册的插件宿主:${host}。可用宿主:${this.list().join(", ")}`);
|
|
25
|
+
return adapter;
|
|
26
|
+
}
|
|
27
|
+
list() {
|
|
28
|
+
return [...this.#adapters.keys()];
|
|
29
|
+
}
|
|
30
|
+
}
|
|
31
|
+
export const pluginHosts = new PluginHostRegistry([claudeAdapter, antigravityAdapter]);
|
|
32
|
+
export const registerPluginHost = (adapter) => pluginHosts.register(adapter);
|
|
33
|
+
export const getPluginHost = (host) => pluginHosts.get(host);
|
|
34
|
+
export const listPluginHosts = () => pluginHosts.list();
|
package/lib/model/acp.d.ts
CHANGED
|
@@ -1,13 +1,27 @@
|
|
|
1
|
-
export
|
|
1
|
+
export declare const mcpWorkerToolNames: readonly ["worker_create", "worker_close", "worker_request", "worker_response", "worker_output", "worker_discover"];
|
|
2
|
+
export type McpWorkerToolName = typeof mcpWorkerToolNames[number];
|
|
3
|
+
export declare function isMcpWorkerTool(name: string): boolean;
|
|
4
|
+
export type AcpBackend = string;
|
|
2
5
|
export interface AcpCommand {
|
|
3
6
|
command: string;
|
|
4
7
|
args: string[];
|
|
8
|
+
env?: Record<string, string>;
|
|
5
9
|
}
|
|
6
|
-
|
|
10
|
+
/** ask: forward target permission requests to the parent session; allow/deny: answer them automatically. */
|
|
11
|
+
export type AcpPermissionPolicy = "ask" | "allow" | "deny";
|
|
12
|
+
/** Workspace `acp.<name>` entry; omitting `command` keeps a registered harness's default command. */
|
|
13
|
+
export interface AcpHarnessConfig {
|
|
14
|
+
command?: string;
|
|
15
|
+
args?: string[];
|
|
16
|
+
env?: Record<string, string>;
|
|
17
|
+
permission?: AcpPermissionPolicy;
|
|
18
|
+
}
|
|
19
|
+
export type AcpCommands = Record<string, AcpHarnessConfig>;
|
|
7
20
|
export interface AcpSessionReference extends AcpCommand {
|
|
8
21
|
host: "acp";
|
|
9
22
|
backend: AcpBackend;
|
|
10
23
|
sessionId: string | null;
|
|
24
|
+
permission?: AcpPermissionPolicy;
|
|
11
25
|
capabilities?: {
|
|
12
26
|
resume: boolean;
|
|
13
27
|
load: boolean;
|
|
@@ -20,6 +34,19 @@ export interface AcpModelSelection {
|
|
|
20
34
|
resolvedModel?: string;
|
|
21
35
|
thinking?: string;
|
|
22
36
|
}
|
|
37
|
+
export interface AcpChoice {
|
|
38
|
+
value: string;
|
|
39
|
+
name: string;
|
|
40
|
+
description?: string;
|
|
41
|
+
}
|
|
42
|
+
export interface AcpModelsResult {
|
|
43
|
+
backend: AcpBackend;
|
|
44
|
+
models: AcpChoice[];
|
|
45
|
+
thinking: AcpChoice[];
|
|
46
|
+
currentModel?: string;
|
|
47
|
+
currentThinking?: string;
|
|
48
|
+
selection: AcpModelSelection;
|
|
49
|
+
}
|
|
23
50
|
export interface AcpModelState extends AcpModelSelection {
|
|
24
51
|
generation: string;
|
|
25
52
|
}
|
|
@@ -57,3 +84,81 @@ export interface AcpPermissionReply {
|
|
|
57
84
|
requestId: string;
|
|
58
85
|
optionId: string | null;
|
|
59
86
|
}
|
|
87
|
+
export type AcpElicitationAction = "accept" | "decline" | "cancel";
|
|
88
|
+
export type AcpElicitationValue = string | number | boolean | string[];
|
|
89
|
+
export type AcpElicitationContent = Record<string, AcpElicitationValue>;
|
|
90
|
+
export interface AcpElicitation {
|
|
91
|
+
generation: string;
|
|
92
|
+
requestId: string;
|
|
93
|
+
mode: "form" | "url";
|
|
94
|
+
message: string;
|
|
95
|
+
schema?: Record<string, unknown>;
|
|
96
|
+
url?: string;
|
|
97
|
+
}
|
|
98
|
+
export interface AcpElicitationReply {
|
|
99
|
+
generation: string;
|
|
100
|
+
requestId: string;
|
|
101
|
+
action: AcpElicitationAction;
|
|
102
|
+
content?: AcpElicitationContent;
|
|
103
|
+
}
|
|
104
|
+
export interface AcpStartOptions {
|
|
105
|
+
name?: string;
|
|
106
|
+
message?: string;
|
|
107
|
+
files?: string[];
|
|
108
|
+
provider?: string;
|
|
109
|
+
model?: string;
|
|
110
|
+
thinking?: string;
|
|
111
|
+
cwd?: string;
|
|
112
|
+
tools?: string[];
|
|
113
|
+
noExtensions?: boolean;
|
|
114
|
+
noSkills?: boolean;
|
|
115
|
+
noPromptTemplates?: boolean;
|
|
116
|
+
noContextFiles?: boolean;
|
|
117
|
+
}
|
|
118
|
+
export interface AcpLaunchContext {
|
|
119
|
+
readonly reference: AcpSessionReference;
|
|
120
|
+
readonly cwd: string;
|
|
121
|
+
readonly directory: string;
|
|
122
|
+
readonly packageRoot: string;
|
|
123
|
+
readonly options: AcpStartOptions;
|
|
124
|
+
readonly env: NodeJS.ProcessEnv;
|
|
125
|
+
readonly features?: {
|
|
126
|
+
readonly prompts: boolean;
|
|
127
|
+
readonly skills: boolean;
|
|
128
|
+
readonly mcp: boolean;
|
|
129
|
+
};
|
|
130
|
+
}
|
|
131
|
+
export interface AcpPreparedLaunch {
|
|
132
|
+
readonly command: AcpSessionReference;
|
|
133
|
+
readonly env: NodeJS.ProcessEnv;
|
|
134
|
+
readonly sessionMeta?: Record<string, unknown>;
|
|
135
|
+
readonly defaultThinking?: string;
|
|
136
|
+
}
|
|
137
|
+
/** Narrow adapter isolating harness-specific ACP conventions from the generic runtime. */
|
|
138
|
+
export interface AcpHarnessAdapter {
|
|
139
|
+
readonly id: AcpBackend;
|
|
140
|
+
/** Product name users say in conversation, e.g. "Claude Code". */
|
|
141
|
+
readonly label?: string;
|
|
142
|
+
/** Alternative backend names accepted from callers; configured custom names take precedence. */
|
|
143
|
+
readonly aliases?: readonly string[];
|
|
144
|
+
readonly defaultCommand?: AcpCommand;
|
|
145
|
+
readonly installHint?: string;
|
|
146
|
+
readonly configureHint?: string;
|
|
147
|
+
readonly exactAnswer?: boolean;
|
|
148
|
+
readonly eagerSessionId?: boolean;
|
|
149
|
+
readonly requireSystemPrompt?: boolean;
|
|
150
|
+
readonly nativeWorkspaceSkills?: boolean;
|
|
151
|
+
readonly nativeWorkspaceMcp?: boolean;
|
|
152
|
+
readonly customNotificationMethod?: string;
|
|
153
|
+
filterStartOptions?(options: AcpStartOptions): AcpStartOptions;
|
|
154
|
+
validateStartOptions?(options: AcpStartOptions): void;
|
|
155
|
+
prepareLaunch?(context: AcpLaunchContext): Promise<AcpPreparedLaunch> | AcpPreparedLaunch;
|
|
156
|
+
parseModelValue?(value: string): {
|
|
157
|
+
provider?: string;
|
|
158
|
+
model: string;
|
|
159
|
+
};
|
|
160
|
+
formatModelQuery?(model: string, provider?: string): string | undefined;
|
|
161
|
+
parseCustomNotification?(params: unknown, sessionId: string): {
|
|
162
|
+
resolvedModel?: string;
|
|
163
|
+
} | undefined;
|
|
164
|
+
}
|
package/lib/model/acp.js
CHANGED
|
@@ -1 +1,12 @@
|
|
|
1
|
-
export
|
|
1
|
+
export const mcpWorkerToolNames = [
|
|
2
|
+
"worker_create",
|
|
3
|
+
"worker_close",
|
|
4
|
+
"worker_request",
|
|
5
|
+
"worker_response",
|
|
6
|
+
"worker_output",
|
|
7
|
+
"worker_discover",
|
|
8
|
+
];
|
|
9
|
+
export function isMcpWorkerTool(name) {
|
|
10
|
+
const bare = name.startsWith("mcp__pbot__") ? name.slice("mcp__pbot__".length) : name;
|
|
11
|
+
return bare === "pbot_worker" || mcpWorkerToolNames.includes(bare);
|
|
12
|
+
}
|
package/lib/model/agent.d.ts
CHANGED
|
@@ -1,20 +1,7 @@
|
|
|
1
|
-
import type { AcpBackend, AcpModelSelection, AcpSessionReference } from "./acp.js";
|
|
1
|
+
import type { AcpBackend, AcpElicitationAction, AcpElicitationContent, AcpModelSelection, AcpSessionReference, AcpStartOptions } from "./acp.js";
|
|
2
|
+
export type AgentOptions = AcpStartOptions;
|
|
2
3
|
export interface AgentStartOptions extends AgentOptions {
|
|
3
|
-
backend
|
|
4
|
-
}
|
|
5
|
-
export interface AgentOptions {
|
|
6
|
-
name?: string;
|
|
7
|
-
message?: string;
|
|
8
|
-
files?: string[];
|
|
9
|
-
provider?: string;
|
|
10
|
-
model?: string;
|
|
11
|
-
thinking?: string;
|
|
12
|
-
cwd?: string;
|
|
13
|
-
tools?: string[];
|
|
14
|
-
noExtensions?: boolean;
|
|
15
|
-
noSkills?: boolean;
|
|
16
|
-
noPromptTemplates?: boolean;
|
|
17
|
-
noContextFiles?: boolean;
|
|
4
|
+
backend: AcpBackend;
|
|
18
5
|
}
|
|
19
6
|
export interface AgentOwner {
|
|
20
7
|
sessionId: string;
|
|
@@ -31,19 +18,7 @@ export interface AgentDescriptor {
|
|
|
31
18
|
createdAt: number;
|
|
32
19
|
options: AgentOptions;
|
|
33
20
|
}
|
|
34
|
-
|
|
35
|
-
export interface AgentSessionRef {
|
|
36
|
-
file: string | null;
|
|
37
|
-
}
|
|
38
|
-
export type NativeAgentHost = "pi" | "dsh";
|
|
39
|
-
/** Native references are interpreted only by their owning host adapter. */
|
|
40
|
-
export type AgentSessionReference = {
|
|
41
|
-
host: "pi";
|
|
42
|
-
file: string | null;
|
|
43
|
-
} | {
|
|
44
|
-
host: "dsh";
|
|
45
|
-
sessionId: string;
|
|
46
|
-
} | AcpSessionReference;
|
|
21
|
+
export type AgentSessionReference = AcpSessionReference;
|
|
47
22
|
export interface AgentLaunch {
|
|
48
23
|
generation: string;
|
|
49
24
|
name: string;
|
|
@@ -84,18 +59,45 @@ export interface AgentView extends AgentDescriptor {
|
|
|
84
59
|
generation: string;
|
|
85
60
|
state: AgentStatus["state"];
|
|
86
61
|
activity: string;
|
|
87
|
-
|
|
88
|
-
|
|
62
|
+
alive: boolean;
|
|
63
|
+
backend: AcpBackend;
|
|
64
|
+
transport: "acp";
|
|
89
65
|
selection?: AcpModelSelection;
|
|
90
|
-
capabilities
|
|
66
|
+
capabilities: {
|
|
91
67
|
steer: boolean;
|
|
92
68
|
resume: boolean;
|
|
93
|
-
team: boolean;
|
|
94
69
|
transcript: boolean;
|
|
95
70
|
};
|
|
96
71
|
cycle?: AgentCycle;
|
|
97
72
|
error?: string;
|
|
98
73
|
owned: boolean;
|
|
74
|
+
pendingRequests?: AgentPendingRequest[];
|
|
75
|
+
}
|
|
76
|
+
export type AgentPendingRequest = {
|
|
77
|
+
requestId: string;
|
|
78
|
+
kind: "permission";
|
|
79
|
+
description: string;
|
|
80
|
+
options: {
|
|
81
|
+
optionId: string;
|
|
82
|
+
name: string;
|
|
83
|
+
kind: string;
|
|
84
|
+
}[];
|
|
85
|
+
} | {
|
|
86
|
+
requestId: string;
|
|
87
|
+
kind: "form";
|
|
88
|
+
message: string;
|
|
89
|
+
schema: Record<string, unknown>;
|
|
90
|
+
} | {
|
|
91
|
+
requestId: string;
|
|
92
|
+
kind: "url";
|
|
93
|
+
message: string;
|
|
94
|
+
url: string;
|
|
95
|
+
};
|
|
96
|
+
export interface AgentResponseInput {
|
|
97
|
+
requestId?: string;
|
|
98
|
+
action: AcpElicitationAction;
|
|
99
|
+
optionId?: string;
|
|
100
|
+
content?: AcpElicitationContent;
|
|
99
101
|
}
|
|
100
102
|
export interface AgentCompletion {
|
|
101
103
|
agentId: string;
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
import type { WorkspaceSkillMeta } from "./workspace-mcp.js";
|
|
2
|
+
export type HostId = string;
|
|
3
|
+
export type PluginHostId = string;
|
|
4
|
+
export type WorkspaceRole = "coordinator" | "general-purpose";
|
|
5
|
+
export interface WorkspaceEnvironment {
|
|
6
|
+
host: HostId;
|
|
7
|
+
workspaceRoot: string;
|
|
8
|
+
resourceRoot: string;
|
|
9
|
+
}
|
|
10
|
+
export interface WorkspaceContext {
|
|
11
|
+
workspace: string;
|
|
12
|
+
role: string;
|
|
13
|
+
rootAgents: string;
|
|
14
|
+
workspaceSkills: WorkspaceSkillMeta[];
|
|
15
|
+
environment: WorkspaceEnvironment;
|
|
16
|
+
text: string;
|
|
17
|
+
}
|
|
18
|
+
export type HostEvent = {
|
|
19
|
+
kind: "ignore";
|
|
20
|
+
} | {
|
|
21
|
+
kind: "inject-context";
|
|
22
|
+
role: WorkspaceRole;
|
|
23
|
+
localRoleOnly?: boolean;
|
|
24
|
+
cwd: string;
|
|
25
|
+
raw: unknown;
|
|
26
|
+
} | {
|
|
27
|
+
kind: "check-skill";
|
|
28
|
+
skill: string;
|
|
29
|
+
cwd: string;
|
|
30
|
+
raw: unknown;
|
|
31
|
+
};
|
|
32
|
+
export interface PluginHostAdapter {
|
|
33
|
+
readonly host: PluginHostId;
|
|
34
|
+
readonly nativeRootAgents: boolean;
|
|
35
|
+
readonly nativeWorkspaceSkills?: boolean;
|
|
36
|
+
readonly coordinatorPrompt?: string;
|
|
37
|
+
readonly initCommandHint: string;
|
|
38
|
+
readonly usage: string;
|
|
39
|
+
resolveRoot(cwd: string, rawPayload?: unknown): Promise<string>;
|
|
40
|
+
parseEvent(payload: unknown): HostEvent;
|
|
41
|
+
formatPass(payload: unknown): Record<string, unknown>;
|
|
42
|
+
formatContext(event: Extract<HostEvent, {
|
|
43
|
+
kind: "inject-context";
|
|
44
|
+
}>, context: WorkspaceContext): Record<string, unknown>;
|
|
45
|
+
formatDeny(event: Extract<HostEvent, {
|
|
46
|
+
kind: "check-skill";
|
|
47
|
+
}>, reason: string): Record<string, unknown>;
|
|
48
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -1,6 +1,17 @@
|
|
|
1
1
|
import type { AcpCommands } from "./acp.js";
|
|
2
|
+
export interface WorkspaceFeatures {
|
|
3
|
+
prompts?: boolean;
|
|
4
|
+
skills?: boolean;
|
|
5
|
+
mcp?: boolean;
|
|
6
|
+
}
|
|
7
|
+
export interface ResolvedWorkspaceFeatures {
|
|
8
|
+
readonly prompts: boolean;
|
|
9
|
+
readonly skills: boolean;
|
|
10
|
+
readonly mcp: boolean;
|
|
11
|
+
}
|
|
2
12
|
export interface WorkspaceConfig {
|
|
3
13
|
enabled?: boolean;
|
|
14
|
+
features?: WorkspaceFeatures;
|
|
4
15
|
acp?: AcpCommands;
|
|
5
16
|
}
|
|
6
17
|
export interface WorkspaceConfiguration {
|
|
@@ -8,5 +19,6 @@ export interface WorkspaceConfiguration {
|
|
|
8
19
|
present: boolean;
|
|
9
20
|
enabled: boolean;
|
|
10
21
|
error?: string;
|
|
22
|
+
features?: WorkspaceFeatures;
|
|
11
23
|
acp?: AcpCommands;
|
|
12
24
|
}
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
export declare const workspaceMcpToolNames: readonly ["workspace_mcp_discover", "workspace_mcp_call"];
|
|
2
|
+
export type WorkspaceMcpToolName = typeof workspaceMcpToolNames[number];
|
|
3
|
+
export interface WorkspaceMcpServerBase {
|
|
4
|
+
description?: string;
|
|
5
|
+
timeout?: number;
|
|
6
|
+
enabled?: boolean;
|
|
7
|
+
}
|
|
8
|
+
export interface WorkspaceMcpStdioServer extends WorkspaceMcpServerBase {
|
|
9
|
+
command: string;
|
|
10
|
+
args?: string[];
|
|
11
|
+
env?: Record<string, string>;
|
|
12
|
+
cwd?: string;
|
|
13
|
+
}
|
|
14
|
+
export interface WorkspaceMcpHttpServer extends WorkspaceMcpServerBase {
|
|
15
|
+
url: string;
|
|
16
|
+
headers?: Record<string, string>;
|
|
17
|
+
}
|
|
18
|
+
export type WorkspaceMcpServer = WorkspaceMcpStdioServer | WorkspaceMcpHttpServer;
|
|
19
|
+
export interface WorkspaceMcpConfig {
|
|
20
|
+
mcpServers: Record<string, WorkspaceMcpServer>;
|
|
21
|
+
}
|
|
22
|
+
export interface WorkspaceMcpConfiguration {
|
|
23
|
+
path: string;
|
|
24
|
+
present: boolean;
|
|
25
|
+
servers: Record<string, WorkspaceMcpServer>;
|
|
26
|
+
error?: string;
|
|
27
|
+
}
|
|
28
|
+
export interface ResolvedWorkspaceMcpStdioServer {
|
|
29
|
+
readonly transport: "stdio";
|
|
30
|
+
readonly name: string;
|
|
31
|
+
readonly command: string;
|
|
32
|
+
readonly args: string[];
|
|
33
|
+
readonly env: Record<string, string>;
|
|
34
|
+
readonly cwd: string;
|
|
35
|
+
readonly description?: string;
|
|
36
|
+
readonly timeout: number;
|
|
37
|
+
}
|
|
38
|
+
export interface ResolvedWorkspaceMcpHttpServer {
|
|
39
|
+
readonly transport: "http";
|
|
40
|
+
readonly name: string;
|
|
41
|
+
readonly url: string;
|
|
42
|
+
readonly headers: Record<string, string>;
|
|
43
|
+
readonly description?: string;
|
|
44
|
+
readonly timeout: number;
|
|
45
|
+
}
|
|
46
|
+
export type ResolvedWorkspaceMcpServer = ResolvedWorkspaceMcpStdioServer | ResolvedWorkspaceMcpHttpServer;
|
|
47
|
+
export interface WorkspaceSkillMeta {
|
|
48
|
+
readonly name: string;
|
|
49
|
+
readonly description: string;
|
|
50
|
+
readonly path: string;
|
|
51
|
+
}
|
package/lib/plugin.d.ts
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare function main(args: readonly string[]): Promise<void>;
|
package/lib/plugin.js
ADDED
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { realpathSync } from "node:fs";
|
|
2
|
+
import { pathToFileURL } from "node:url";
|
|
3
|
+
import { requireThat } from "./common/validation.js";
|
|
4
|
+
import { runPluginHost } from "./extension/plugin-runtime.js";
|
|
5
|
+
import { listPluginHosts, pluginHosts } from "./integrations/hosts/registry.js";
|
|
6
|
+
export async function main(args) {
|
|
7
|
+
const [host, ...rest] = args;
|
|
8
|
+
const adapter = host ? pluginHosts.get(host) : undefined;
|
|
9
|
+
requireThat(adapter, `用法:node <插件目录>/lib/plugin.js <${listPluginHosts().join("|")}> hook|init|status`);
|
|
10
|
+
await runPluginHost(adapter, rest);
|
|
11
|
+
}
|
|
12
|
+
if (process.argv[1] && import.meta.url === pathToFileURL(realpathSync(process.argv[1])).href) {
|
|
13
|
+
void main(process.argv.slice(2)).catch(error => {
|
|
14
|
+
process.stderr.write("Personal Bot: " + (error instanceof Error ? error.message : String(error)) + "\n");
|
|
15
|
+
process.exitCode = 1;
|
|
16
|
+
});
|
|
17
|
+
}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { AgentDescriptor, AgentMessage } from "../../model/agent.js";
|
|
2
|
-
import type { AcpPermission } from "../../model/acp.js";
|
|
2
|
+
import type { AcpElicitationAction, AcpElicitationContent, AcpPermission } from "../../model/acp.js";
|
|
3
3
|
import { AgentFiles } from "../../storage/agent-files.js";
|
|
4
4
|
import { AgentRun } from "./agent-run.js";
|
|
5
5
|
export interface AcpProgress {
|
|
@@ -35,6 +35,18 @@ export declare class AcpAgentRun {
|
|
|
35
35
|
private current;
|
|
36
36
|
update(value: AcpProgress): void;
|
|
37
37
|
permission(description: string, options: AcpPermission["options"], signal: AbortSignal): Promise<string | null>;
|
|
38
|
+
elicitation(input: {
|
|
39
|
+
mode: "form";
|
|
40
|
+
message: string;
|
|
41
|
+
schema: Record<string, unknown>;
|
|
42
|
+
} | {
|
|
43
|
+
mode: "url";
|
|
44
|
+
message: string;
|
|
45
|
+
url: string;
|
|
46
|
+
}, signal: AbortSignal): Promise<{
|
|
47
|
+
action: AcpElicitationAction;
|
|
48
|
+
content?: AcpElicitationContent;
|
|
49
|
+
}>;
|
|
38
50
|
run(): Promise<void>;
|
|
39
51
|
private perform;
|
|
40
52
|
settled(): Promise<void> | undefined;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { randomUUID } from "node:crypto";
|
|
2
2
|
import { setTimeout as delay } from "node:timers/promises";
|
|
3
3
|
import { AgentFiles, launch } from "../../storage/agent-files.js";
|
|
4
|
-
import { acpAnswer, acpInput, acpPermission, acpPermissionReply, acpReport } from "../../storage/acp-files.js";
|
|
4
|
+
import { acpAnswer, acpElicitation, acpElicitationReply, acpInput, acpPermission, acpPermissionReply, acpReport } from "../../storage/acp-files.js";
|
|
5
5
|
import { AgentRun } from "./agent-run.js";
|
|
6
6
|
export class AcpAnswerBuffer {
|
|
7
7
|
#text = "";
|
|
@@ -54,16 +54,44 @@ export class AcpAgentRun {
|
|
|
54
54
|
}
|
|
55
55
|
async permission(description, options, signal) {
|
|
56
56
|
const requestId = randomUUID(), request = { generation: this.generation, requestId, description, options };
|
|
57
|
+
this.files.ensureSubdirectory(this.id, "permissions");
|
|
57
58
|
this.files.write(this.id, "permissions/" + requestId + ".json", request, acpPermission, true);
|
|
58
59
|
this.execution.save({ state: "busy", activity: "等待确认" });
|
|
59
60
|
while (!signal.aborted && !this.#stopping && this.current() && !this.files.read(this.id, "launch.json", launch).stop) {
|
|
60
61
|
const reply = this.files.optional(this.id, "permissions/" + requestId + "-reply.json", acpPermissionReply);
|
|
61
|
-
if (reply?.generation === this.generation)
|
|
62
|
+
if (reply?.generation === this.generation) {
|
|
63
|
+
this.execution.save({ state: this.#stopping ? "stopping" : "busy", activity: reply.optionId ? "已获确认" : "确认被拒绝" });
|
|
62
64
|
return reply.optionId;
|
|
65
|
+
}
|
|
63
66
|
await delay(100);
|
|
64
67
|
}
|
|
68
|
+
// Close the request so it no longer shows as pending once the turn or worker has ended.
|
|
69
|
+
if (this.current())
|
|
70
|
+
this.files.write(this.id, "permissions/" + requestId + "-reply.json", { generation: this.generation, requestId, optionId: null }, acpPermissionReply, true);
|
|
65
71
|
return null;
|
|
66
72
|
}
|
|
73
|
+
async elicitation(input, signal) {
|
|
74
|
+
const requestId = randomUUID();
|
|
75
|
+
const request = input.mode === "form"
|
|
76
|
+
? { generation: this.generation, requestId, mode: "form", message: input.message, schema: input.schema }
|
|
77
|
+
: { generation: this.generation, requestId, mode: "url", message: input.message, url: input.url };
|
|
78
|
+
this.files.ensureSubdirectory(this.id, "elicitations");
|
|
79
|
+
this.files.write(this.id, "elicitations/" + requestId + ".json", request, acpElicitation, true);
|
|
80
|
+
this.execution.save({ state: "busy", activity: "等待回复" });
|
|
81
|
+
while (!signal.aborted && !this.#stopping && this.current() && !this.files.read(this.id, "launch.json", launch).stop) {
|
|
82
|
+
const reply = this.files.optional(this.id, "elicitations/" + requestId + "-reply.json", acpElicitationReply);
|
|
83
|
+
if (reply?.generation === this.generation) {
|
|
84
|
+
const label = reply.action === "accept" ? "已收到回复" : reply.action === "decline" ? "回复已拒绝" : "回复已取消";
|
|
85
|
+
this.execution.save({ state: this.#stopping ? "stopping" : "busy", activity: label });
|
|
86
|
+
return { action: reply.action, ...(reply.content ? { content: reply.content } : {}) };
|
|
87
|
+
}
|
|
88
|
+
await delay(100);
|
|
89
|
+
}
|
|
90
|
+
if (this.current()) {
|
|
91
|
+
this.files.write(this.id, "elicitations/" + requestId + "-reply.json", { generation: this.generation, requestId, action: "cancel" }, acpElicitationReply, true);
|
|
92
|
+
}
|
|
93
|
+
return { action: "cancel" };
|
|
94
|
+
}
|
|
67
95
|
async run() {
|
|
68
96
|
this.execution.recover();
|
|
69
97
|
this.execution.save({ state: "idle", activity: "空闲" });
|