verybot 0.1.3
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.
Potentially problematic release.
This version of verybot might be problematic. Click here for more details.
- package/dist/brain/agent-registry.d.ts +75 -0
- package/dist/brain/agent-registry.js +124 -0
- package/dist/brain/agent.d.ts +146 -0
- package/dist/brain/agent.js +680 -0
- package/dist/brain/channel-store.d.ts +27 -0
- package/dist/brain/channel-store.js +78 -0
- package/dist/brain/compaction.d.ts +37 -0
- package/dist/brain/compaction.js +214 -0
- package/dist/brain/context.d.ts +33 -0
- package/dist/brain/context.js +77 -0
- package/dist/brain/delegation-store.d.ts +33 -0
- package/dist/brain/delegation-store.js +106 -0
- package/dist/brain/loop.d.ts +21 -0
- package/dist/brain/loop.js +161 -0
- package/dist/brain/mcp-adapter.d.ts +39 -0
- package/dist/brain/mcp-adapter.js +227 -0
- package/dist/brain/memory-extractor.d.ts +26 -0
- package/dist/brain/memory-extractor.js +82 -0
- package/dist/brain/providers.d.ts +10 -0
- package/dist/brain/providers.js +69 -0
- package/dist/brain/queue.d.ts +18 -0
- package/dist/brain/queue.js +84 -0
- package/dist/brain/run-tools.d.ts +47 -0
- package/dist/brain/run-tools.js +84 -0
- package/dist/brain/session-key.d.ts +23 -0
- package/dist/brain/session-key.js +41 -0
- package/dist/brain/session-state.d.ts +36 -0
- package/dist/brain/session-state.js +51 -0
- package/dist/brain/session-store.d.ts +50 -0
- package/dist/brain/session-store.js +207 -0
- package/dist/brain/session.d.ts +32 -0
- package/dist/brain/session.js +75 -0
- package/dist/brain/utils.d.ts +4 -0
- package/dist/brain/utils.js +26 -0
- package/dist/brain/worker-coordinator.d.ts +25 -0
- package/dist/brain/worker-coordinator.js +83 -0
- package/dist/channels/commands.d.ts +35 -0
- package/dist/channels/commands.js +65 -0
- package/dist/channels/discord/channel.d.ts +18 -0
- package/dist/channels/discord/channel.js +154 -0
- package/dist/channels/discord/markdown.d.ts +19 -0
- package/dist/channels/discord/markdown.js +62 -0
- package/dist/channels/manager.d.ts +29 -0
- package/dist/channels/manager.js +100 -0
- package/dist/channels/slack/channel.d.ts +26 -0
- package/dist/channels/slack/channel.js +207 -0
- package/dist/channels/slack/markdown.d.ts +19 -0
- package/dist/channels/slack/markdown.js +62 -0
- package/dist/channels/specs.d.ts +21 -0
- package/dist/channels/specs.js +96 -0
- package/dist/channels/telegram/channel.d.ts +18 -0
- package/dist/channels/telegram/channel.js +156 -0
- package/dist/channels/telegram/markdown.d.ts +17 -0
- package/dist/channels/telegram/markdown.js +66 -0
- package/dist/channels/types.d.ts +26 -0
- package/dist/channels/types.js +1 -0
- package/dist/channels/whatsapp/channel.d.ts +23 -0
- package/dist/channels/whatsapp/channel.js +242 -0
- package/dist/channels/whatsapp/markdown.d.ts +20 -0
- package/dist/channels/whatsapp/markdown.js +51 -0
- package/dist/cli/config.d.ts +5 -0
- package/dist/cli/config.js +78 -0
- package/dist/cli/index.d.ts +5 -0
- package/dist/cli/index.js +13 -0
- package/dist/computer/browser/actions.d.ts +31 -0
- package/dist/computer/browser/actions.js +148 -0
- package/dist/computer/browser/manager.d.ts +55 -0
- package/dist/computer/browser/manager.js +496 -0
- package/dist/computer/browser/profile-badge.d.ts +13 -0
- package/dist/computer/browser/profile-badge.js +67 -0
- package/dist/computer/browser/screenshot.d.ts +5 -0
- package/dist/computer/browser/screenshot.js +21 -0
- package/dist/computer/browser/snapshot.d.ts +30 -0
- package/dist/computer/browser/snapshot.js +242 -0
- package/dist/computer/browser/tools.d.ts +5 -0
- package/dist/computer/browser/tools.js +167 -0
- package/dist/computer/desktop/adapter.d.ts +25 -0
- package/dist/computer/desktop/adapter.js +11 -0
- package/dist/computer/desktop/macos.d.ts +24 -0
- package/dist/computer/desktop/macos.js +223 -0
- package/dist/computer/desktop/tools.d.ts +25 -0
- package/dist/computer/desktop/tools.js +114 -0
- package/dist/config/agent-config.d.ts +41 -0
- package/dist/config/agent-config.js +14 -0
- package/dist/config/model-catalog.d.ts +22 -0
- package/dist/config/model-catalog.js +99 -0
- package/dist/config/store.d.ts +25 -0
- package/dist/config/store.js +143 -0
- package/dist/config.d.ts +103 -0
- package/dist/config.js +224 -0
- package/dist/control-ui/assets/index-BANXNUyt.js +143 -0
- package/dist/control-ui/assets/index-BSUFrP9R.css +1 -0
- package/dist/control-ui/assets/noto-sans-cyrillic-ext-wght-normal-DSNfmdVt.woff2 +0 -0
- package/dist/control-ui/assets/noto-sans-cyrillic-wght-normal-B2hlT84T.woff2 +0 -0
- package/dist/control-ui/assets/noto-sans-devanagari-wght-normal-Cv-Vwajv.woff2 +0 -0
- package/dist/control-ui/assets/noto-sans-greek-ext-wght-normal-12T8GTDR.woff2 +0 -0
- package/dist/control-ui/assets/noto-sans-greek-wght-normal-Ymb6dZNd.woff2 +0 -0
- package/dist/control-ui/assets/noto-sans-latin-ext-wght-normal-W1qJv59z.woff2 +0 -0
- package/dist/control-ui/assets/noto-sans-latin-wght-normal-BYSzYMf3.woff2 +0 -0
- package/dist/control-ui/assets/noto-sans-vietnamese-wght-normal-DLTJy58D.woff2 +0 -0
- package/dist/control-ui/index.html +14 -0
- package/dist/control-ui/vite.svg +1 -0
- package/dist/events.d.ts +2 -0
- package/dist/events.js +11 -0
- package/dist/gateway/broadcast.d.ts +5 -0
- package/dist/gateway/broadcast.js +33 -0
- package/dist/gateway/methods/chat.d.ts +24 -0
- package/dist/gateway/methods/chat.js +19 -0
- package/dist/gateway/methods/config.d.ts +13 -0
- package/dist/gateway/methods/config.js +14 -0
- package/dist/gateway/methods/models.d.ts +10 -0
- package/dist/gateway/methods/models.js +14 -0
- package/dist/gateway/methods/prompt-templates.d.ts +23 -0
- package/dist/gateway/methods/prompt-templates.js +82 -0
- package/dist/gateway/methods/scheduler.d.ts +62 -0
- package/dist/gateway/methods/scheduler.js +129 -0
- package/dist/gateway/methods/sessions.d.ts +26 -0
- package/dist/gateway/methods/sessions.js +54 -0
- package/dist/gateway/methods/skills.d.ts +35 -0
- package/dist/gateway/methods/skills.js +202 -0
- package/dist/gateway/methods/system.d.ts +12 -0
- package/dist/gateway/methods/system.js +39 -0
- package/dist/gateway/methods/tasks.d.ts +21 -0
- package/dist/gateway/methods/tasks.js +46 -0
- package/dist/gateway/methods/teams.d.ts +70 -0
- package/dist/gateway/methods/teams.js +374 -0
- package/dist/gateway/methods/tools.d.ts +6 -0
- package/dist/gateway/methods/tools.js +7 -0
- package/dist/gateway/methods/whatsapp.d.ts +19 -0
- package/dist/gateway/methods/whatsapp.js +35 -0
- package/dist/gateway/rpc.d.ts +38 -0
- package/dist/gateway/rpc.js +75 -0
- package/dist/gateway/server.d.ts +4 -0
- package/dist/gateway/server.js +133 -0
- package/dist/index.d.ts +1 -0
- package/dist/index.js +212 -0
- package/dist/integrations/github.d.ts +7 -0
- package/dist/integrations/github.js +133 -0
- package/dist/integrations/mcp.d.ts +7 -0
- package/dist/integrations/mcp.js +106 -0
- package/dist/integrations/registry.d.ts +43 -0
- package/dist/integrations/registry.js +258 -0
- package/dist/integrations/scanner.d.ts +10 -0
- package/dist/integrations/scanner.js +122 -0
- package/dist/integrations/twitter.d.ts +10 -0
- package/dist/integrations/twitter.js +120 -0
- package/dist/integrations/types.d.ts +72 -0
- package/dist/integrations/types.js +1 -0
- package/dist/logger.d.ts +16 -0
- package/dist/logger.js +104 -0
- package/dist/markdown/chunk.d.ts +9 -0
- package/dist/markdown/chunk.js +52 -0
- package/dist/markdown/ir.d.ts +37 -0
- package/dist/markdown/ir.js +529 -0
- package/dist/markdown/render.d.ts +22 -0
- package/dist/markdown/render.js +148 -0
- package/dist/markdown/table-render.d.ts +43 -0
- package/dist/markdown/table-render.js +219 -0
- package/dist/markdown/tables.d.ts +17 -0
- package/dist/markdown/tables.js +27 -0
- package/dist/memory/embedding.d.ts +16 -0
- package/dist/memory/embedding.js +66 -0
- package/dist/memory/extractor.d.ts +6 -0
- package/dist/memory/extractor.js +72 -0
- package/dist/memory/search.d.ts +15 -0
- package/dist/memory/search.js +57 -0
- package/dist/memory/store.d.ts +34 -0
- package/dist/memory/store.js +328 -0
- package/dist/memory/types.d.ts +9 -0
- package/dist/memory/types.js +2 -0
- package/dist/paths.d.ts +20 -0
- package/dist/paths.js +29 -0
- package/dist/prompt-templates/builtins.d.ts +2 -0
- package/dist/prompt-templates/builtins.js +72 -0
- package/dist/prompt-templates/store.d.ts +39 -0
- package/dist/prompt-templates/store.js +174 -0
- package/dist/prompt-templates/types.d.ts +10 -0
- package/dist/prompt-templates/types.js +1 -0
- package/dist/scheduler/connected-channels.d.ts +24 -0
- package/dist/scheduler/connected-channels.js +57 -0
- package/dist/scheduler/scheduler.d.ts +22 -0
- package/dist/scheduler/scheduler.js +132 -0
- package/dist/scheduler/store.d.ts +27 -0
- package/dist/scheduler/store.js +205 -0
- package/dist/scheduler/types.d.ts +29 -0
- package/dist/scheduler/types.js +1 -0
- package/dist/security/command-validator.d.ts +22 -0
- package/dist/security/command-validator.js +160 -0
- package/dist/security/docker-sandbox.d.ts +48 -0
- package/dist/security/docker-sandbox.js +218 -0
- package/dist/security/env-filter.d.ts +8 -0
- package/dist/security/env-filter.js +41 -0
- package/dist/skills/loader.d.ts +33 -0
- package/dist/skills/loader.js +132 -0
- package/dist/skills/prompt.d.ts +6 -0
- package/dist/skills/prompt.js +17 -0
- package/dist/skills/read-tool.d.ts +7 -0
- package/dist/skills/read-tool.js +24 -0
- package/dist/skills/scanner.d.ts +6 -0
- package/dist/skills/scanner.js +73 -0
- package/dist/skills/types.d.ts +15 -0
- package/dist/skills/types.js +1 -0
- package/dist/tasks/store.d.ts +47 -0
- package/dist/tasks/store.js +193 -0
- package/dist/tasks/types.d.ts +75 -0
- package/dist/tasks/types.js +32 -0
- package/dist/teams/store.d.ts +78 -0
- package/dist/teams/store.js +420 -0
- package/dist/teams/types.d.ts +23 -0
- package/dist/teams/types.js +1 -0
- package/dist/tools/bash.d.ts +16 -0
- package/dist/tools/bash.js +62 -0
- package/dist/tools/channel-history.d.ts +10 -0
- package/dist/tools/channel-history.js +43 -0
- package/dist/tools/delegate.d.ts +16 -0
- package/dist/tools/delegate.js +216 -0
- package/dist/tools/fs.d.ts +4 -0
- package/dist/tools/fs.js +335 -0
- package/dist/tools/integration-toggle.d.ts +14 -0
- package/dist/tools/integration-toggle.js +47 -0
- package/dist/tools/memory.d.ts +13 -0
- package/dist/tools/memory.js +65 -0
- package/dist/tools/registry.d.ts +6 -0
- package/dist/tools/registry.js +9 -0
- package/dist/tools/schedule.d.ts +8 -0
- package/dist/tools/schedule.js +219 -0
- package/dist/tools/speak.d.ts +10 -0
- package/dist/tools/speak.js +56 -0
- package/dist/tools/tasks.d.ts +29 -0
- package/dist/tools/tasks.js +92 -0
- package/dist/tools/teams.d.ts +7 -0
- package/dist/tools/teams.js +180 -0
- package/dist/tools/web-fetch.d.ts +3 -0
- package/dist/tools/web-fetch.js +22 -0
- package/dist/tts/edge.d.ts +10 -0
- package/dist/tts/edge.js +60 -0
- package/dist/tts/speak.d.ts +12 -0
- package/dist/tts/speak.js +81 -0
- package/dist/tts/transcribe.d.ts +5 -0
- package/dist/tts/transcribe.js +40 -0
- package/dist/utils.d.ts +5 -0
- package/dist/utils.js +22 -0
- package/package.json +90 -0
- package/verybot.js +2 -0
|
@@ -0,0 +1,374 @@
|
|
|
1
|
+
import { randomUUID } from "crypto";
|
|
2
|
+
import { emit } from "../../events.js";
|
|
3
|
+
import { MAX_NAME_LENGTH, MAX_IDENTITY_LENGTH, MAX_MODEL_LENGTH, HEX_COLOR_RE } from "../../teams/store.js";
|
|
4
|
+
import { DEFAULT_TEAM_ID, DEFAULT_WORKER_TIMEOUT_S } from "../../config/agent-config.js";
|
|
5
|
+
import { searchMemory } from "../../memory/search.js";
|
|
6
|
+
import { logger } from "../../logger.js";
|
|
7
|
+
const VALID_ROLES = new Set(["orchestrator", "worker"]);
|
|
8
|
+
const MAX_FACT_LENGTH = 2000;
|
|
9
|
+
const MAX_PAGE_SIZE = 200;
|
|
10
|
+
export function teamMethods(teamStore, memoryStore, embeddingProvider) {
|
|
11
|
+
return {
|
|
12
|
+
/** List all teams with their agents. */
|
|
13
|
+
"teams.list": async () => {
|
|
14
|
+
const teams = teamStore.listTeams();
|
|
15
|
+
const result = teams.map((team) => ({
|
|
16
|
+
...team,
|
|
17
|
+
agents: teamStore.listAgentsByTeam(team.id),
|
|
18
|
+
}));
|
|
19
|
+
return { teams: result };
|
|
20
|
+
},
|
|
21
|
+
/** Return teams in the TeamConfig[] format used by the UI. */
|
|
22
|
+
"teams.configs": async () => {
|
|
23
|
+
return { teams: teamStore.toTeamConfigs() };
|
|
24
|
+
},
|
|
25
|
+
/**
|
|
26
|
+
* Save a single team (create or update) including its agents.
|
|
27
|
+
* Accepts a full TeamConfig; handles agent diff internally.
|
|
28
|
+
*/
|
|
29
|
+
"teams.save": async (params) => {
|
|
30
|
+
const { team } = (params ?? {});
|
|
31
|
+
if (!team || typeof team !== "object")
|
|
32
|
+
throw new Error("team object is required");
|
|
33
|
+
validateTeamConfig(team);
|
|
34
|
+
teamStore.transaction(() => saveTeam(teamStore, team));
|
|
35
|
+
emit("teamChange", { action: "saved", teamId: team.id });
|
|
36
|
+
return { teams: teamStore.toTeamConfigs() };
|
|
37
|
+
},
|
|
38
|
+
/** Create a new team. */
|
|
39
|
+
"teams.create": async (params) => {
|
|
40
|
+
const { name, color } = (params ?? {});
|
|
41
|
+
if (!name || typeof name !== "string")
|
|
42
|
+
throw new Error("name is required");
|
|
43
|
+
const trimmed = name.trim();
|
|
44
|
+
if (trimmed.length === 0)
|
|
45
|
+
throw new Error("name cannot be empty");
|
|
46
|
+
if (trimmed.length > MAX_NAME_LENGTH)
|
|
47
|
+
throw new Error(`name exceeds maximum length of ${MAX_NAME_LENGTH}`);
|
|
48
|
+
if (typeof color === "string" && color !== "" && !HEX_COLOR_RE.test(color))
|
|
49
|
+
throw new Error("color must be a valid hex color (e.g. #ef4444)");
|
|
50
|
+
const team = teamStore.createTeam({ name: trimmed, color: typeof color === "string" ? color : undefined });
|
|
51
|
+
emit("teamChange", { action: "created", team });
|
|
52
|
+
return { team };
|
|
53
|
+
},
|
|
54
|
+
/** Update a team (rename / recolor / workspace / variables). */
|
|
55
|
+
"teams.update": async (params) => {
|
|
56
|
+
const p = (params ?? {});
|
|
57
|
+
const id = p.id;
|
|
58
|
+
const name = p.name;
|
|
59
|
+
const color = p.color;
|
|
60
|
+
const workspace = p.workspace;
|
|
61
|
+
const variables = p.variables;
|
|
62
|
+
if (!id || typeof id !== "string")
|
|
63
|
+
throw new Error("id is required");
|
|
64
|
+
if (name !== undefined) {
|
|
65
|
+
if (typeof name !== "string" || name.trim().length === 0)
|
|
66
|
+
throw new Error("name cannot be empty");
|
|
67
|
+
}
|
|
68
|
+
if (typeof color === "string" && color !== "" && !HEX_COLOR_RE.test(color))
|
|
69
|
+
throw new Error("color must be a valid hex color (e.g. #ef4444)");
|
|
70
|
+
if (workspace !== undefined && typeof workspace !== "string")
|
|
71
|
+
throw new Error("workspace must be a string");
|
|
72
|
+
const team = teamStore.updateTeam(id, {
|
|
73
|
+
name: name?.trim(),
|
|
74
|
+
color: typeof color === "string" ? color : undefined,
|
|
75
|
+
workspace: typeof workspace === "string" ? workspace : undefined,
|
|
76
|
+
variables: typeof variables === "object" && variables !== null ? variables : undefined,
|
|
77
|
+
});
|
|
78
|
+
if (!team)
|
|
79
|
+
throw new Error(`Team not found: ${id}`);
|
|
80
|
+
emit("teamChange", { action: "updated", team });
|
|
81
|
+
return { team };
|
|
82
|
+
},
|
|
83
|
+
/** Delete a team and all its agents. */
|
|
84
|
+
"teams.delete": async (params) => {
|
|
85
|
+
const { id } = (params ?? {});
|
|
86
|
+
if (!id || typeof id !== "string")
|
|
87
|
+
throw new Error("id is required");
|
|
88
|
+
const deleted = teamStore.deleteTeam(id);
|
|
89
|
+
if (!deleted)
|
|
90
|
+
throw new Error(`Team not found: ${id}`);
|
|
91
|
+
emit("teamChange", { action: "deleted", id });
|
|
92
|
+
return { teams: teamStore.toTeamConfigs() };
|
|
93
|
+
},
|
|
94
|
+
/** Add an agent to a team. */
|
|
95
|
+
"teams.createAgent": async (params) => {
|
|
96
|
+
const p = (params ?? {});
|
|
97
|
+
const teamId = p.teamId;
|
|
98
|
+
const name = p.name;
|
|
99
|
+
const role = p.role;
|
|
100
|
+
const model = p.model;
|
|
101
|
+
if (!teamId || typeof teamId !== "string")
|
|
102
|
+
throw new Error("teamId is required");
|
|
103
|
+
if (!name || typeof name !== "string")
|
|
104
|
+
throw new Error("name is required");
|
|
105
|
+
if (name.length > MAX_NAME_LENGTH)
|
|
106
|
+
throw new Error(`name exceeds maximum length of ${MAX_NAME_LENGTH}`);
|
|
107
|
+
if (!role || !VALID_ROLES.has(role))
|
|
108
|
+
throw new Error("role must be 'orchestrator' or 'worker'");
|
|
109
|
+
if (!model || typeof model !== "string")
|
|
110
|
+
throw new Error("model is required");
|
|
111
|
+
if (model.length > MAX_MODEL_LENGTH)
|
|
112
|
+
throw new Error(`model exceeds maximum length of ${MAX_MODEL_LENGTH}`);
|
|
113
|
+
if (typeof p.identity === "string" && p.identity.length > MAX_IDENTITY_LENGTH)
|
|
114
|
+
throw new Error(`identity exceeds maximum length of ${MAX_IDENTITY_LENGTH}`);
|
|
115
|
+
const agent = teamStore.createAgent(teamId, {
|
|
116
|
+
name,
|
|
117
|
+
role: role,
|
|
118
|
+
model,
|
|
119
|
+
contextWindow: typeof p.contextWindow === "number" ? p.contextWindow : undefined,
|
|
120
|
+
maxSteps: typeof p.maxSteps === "number" ? p.maxSteps : undefined,
|
|
121
|
+
identity: typeof p.identity === "string" ? p.identity : undefined,
|
|
122
|
+
tools: Array.isArray(p.tools) ? p.tools.filter((t) => typeof t === "string") : undefined,
|
|
123
|
+
timeout: typeof p.timeout === "number" ? p.timeout : undefined,
|
|
124
|
+
templateId: typeof p.templateId === "string" ? p.templateId : (p.templateId === null ? null : undefined),
|
|
125
|
+
});
|
|
126
|
+
emit("teamChange", { action: "agentCreated", agent });
|
|
127
|
+
return { agent };
|
|
128
|
+
},
|
|
129
|
+
/** Update an agent's configuration. */
|
|
130
|
+
"teams.updateAgent": async (params) => {
|
|
131
|
+
const p = (params ?? {});
|
|
132
|
+
const id = p.id;
|
|
133
|
+
if (!id || typeof id !== "string")
|
|
134
|
+
throw new Error("id is required");
|
|
135
|
+
if (p.role !== undefined && !VALID_ROLES.has(p.role)) {
|
|
136
|
+
throw new Error("role must be 'orchestrator' or 'worker'");
|
|
137
|
+
}
|
|
138
|
+
const agent = teamStore.updateAgent(id, {
|
|
139
|
+
name: typeof p.name === "string" ? p.name : undefined,
|
|
140
|
+
role: VALID_ROLES.has(p.role) ? p.role : undefined,
|
|
141
|
+
model: typeof p.model === "string" ? p.model : undefined,
|
|
142
|
+
contextWindow: typeof p.contextWindow === "number" ? p.contextWindow : undefined,
|
|
143
|
+
maxSteps: typeof p.maxSteps === "number" ? p.maxSteps : undefined,
|
|
144
|
+
identity: typeof p.identity === "string" ? p.identity : undefined,
|
|
145
|
+
tools: Array.isArray(p.tools) ? p.tools.filter((t) => typeof t === "string") : undefined,
|
|
146
|
+
timeout: typeof p.timeout === "number" ? p.timeout : undefined,
|
|
147
|
+
templateId: typeof p.templateId === "string" ? p.templateId : (p.templateId === null ? null : undefined),
|
|
148
|
+
});
|
|
149
|
+
if (!agent)
|
|
150
|
+
throw new Error(`Agent not found: ${id}`);
|
|
151
|
+
emit("teamChange", { action: "agentUpdated", agent });
|
|
152
|
+
return { agent };
|
|
153
|
+
},
|
|
154
|
+
/** Remove an agent from a team. */
|
|
155
|
+
"teams.deleteAgent": async (params) => {
|
|
156
|
+
const { id } = (params ?? {});
|
|
157
|
+
if (!id || typeof id !== "string")
|
|
158
|
+
throw new Error("id is required");
|
|
159
|
+
const deleted = teamStore.deleteAgent(id);
|
|
160
|
+
if (!deleted)
|
|
161
|
+
throw new Error(`Agent not found: ${id}`);
|
|
162
|
+
emit("teamChange", { action: "agentDeleted", id });
|
|
163
|
+
return { status: "ok" };
|
|
164
|
+
},
|
|
165
|
+
/* ---------------------------------------------------------------- */
|
|
166
|
+
/* Team memory methods */
|
|
167
|
+
/* All endpoints reject DEFAULT_TEAM_ID — global memory is managed */
|
|
168
|
+
/* by the agent automatically, not via the team memory UI. */
|
|
169
|
+
/* ---------------------------------------------------------------- */
|
|
170
|
+
/** List memories for a team (paginated). */
|
|
171
|
+
"teams.memories.list": async (params) => {
|
|
172
|
+
if (!memoryStore)
|
|
173
|
+
throw new Error("Memory is not enabled");
|
|
174
|
+
const p = (params ?? {});
|
|
175
|
+
requireNonDefaultTeamId(p.teamId);
|
|
176
|
+
const limit = typeof p.limit === "number" ? Math.min(Math.max(1, p.limit), MAX_PAGE_SIZE) : 50;
|
|
177
|
+
const offset = typeof p.offset === "number" ? Math.max(0, p.offset) : 0;
|
|
178
|
+
return memoryStore.listByTeam(p.teamId, limit, offset);
|
|
179
|
+
},
|
|
180
|
+
/** Search memories scoped to a team (returns global + team). */
|
|
181
|
+
"teams.memories.search": async (params) => {
|
|
182
|
+
if (!memoryStore)
|
|
183
|
+
throw new Error("Memory is not enabled");
|
|
184
|
+
const p = (params ?? {});
|
|
185
|
+
requireNonDefaultTeamId(p.teamId);
|
|
186
|
+
if (!p.query || typeof p.query !== "string")
|
|
187
|
+
throw new Error("query is required");
|
|
188
|
+
const limit = typeof p.limit === "number" ? Math.min(Math.max(1, p.limit), MAX_PAGE_SIZE) : 20;
|
|
189
|
+
const facts = await searchMemory(memoryStore, p.query, {
|
|
190
|
+
limit,
|
|
191
|
+
teamId: p.teamId,
|
|
192
|
+
embeddingProvider: embeddingProvider ?? undefined,
|
|
193
|
+
});
|
|
194
|
+
return { facts };
|
|
195
|
+
},
|
|
196
|
+
/** Manually add a memory for a team. */
|
|
197
|
+
"teams.memories.add": async (params) => {
|
|
198
|
+
if (!memoryStore)
|
|
199
|
+
throw new Error("Memory is not enabled");
|
|
200
|
+
const p = (params ?? {});
|
|
201
|
+
requireNonDefaultTeamId(p.teamId);
|
|
202
|
+
if (!p.fact || typeof p.fact !== "string")
|
|
203
|
+
throw new Error("fact is required");
|
|
204
|
+
const trimmed = p.fact.trim();
|
|
205
|
+
if (trimmed.length === 0)
|
|
206
|
+
throw new Error("fact cannot be empty");
|
|
207
|
+
if (trimmed.length > MAX_FACT_LENGTH)
|
|
208
|
+
throw new Error(`fact exceeds maximum length of ${MAX_FACT_LENGTH}`);
|
|
209
|
+
let embedding;
|
|
210
|
+
if (embeddingProvider) {
|
|
211
|
+
embedding = await embeddingProvider.embed(trimmed) ?? undefined;
|
|
212
|
+
}
|
|
213
|
+
const saved = memoryStore.save({
|
|
214
|
+
id: randomUUID(),
|
|
215
|
+
fact: trimmed,
|
|
216
|
+
source: "manual",
|
|
217
|
+
timestamp: Date.now(),
|
|
218
|
+
teamId: p.teamId,
|
|
219
|
+
embedding,
|
|
220
|
+
});
|
|
221
|
+
return { saved };
|
|
222
|
+
},
|
|
223
|
+
/** Delete a single memory by ID (team-scoped for authorization). */
|
|
224
|
+
"teams.memories.delete": async (params) => {
|
|
225
|
+
if (!memoryStore)
|
|
226
|
+
throw new Error("Memory is not enabled");
|
|
227
|
+
const p = (params ?? {});
|
|
228
|
+
if (!p.id || typeof p.id !== "string")
|
|
229
|
+
throw new Error("id is required");
|
|
230
|
+
requireNonDefaultTeamId(p.teamId);
|
|
231
|
+
const deleted = memoryStore.deleteById(p.id, p.teamId);
|
|
232
|
+
if (!deleted)
|
|
233
|
+
throw new Error(`Memory not found or not owned by this team: ${p.id}`);
|
|
234
|
+
return { status: "ok" };
|
|
235
|
+
},
|
|
236
|
+
};
|
|
237
|
+
}
|
|
238
|
+
/* ------------------------------------------------------------------ */
|
|
239
|
+
/* Shared validation */
|
|
240
|
+
/* ------------------------------------------------------------------ */
|
|
241
|
+
/** Reject missing, empty, or default team IDs — team memory endpoints must target a real team. */
|
|
242
|
+
function requireNonDefaultTeamId(teamId) {
|
|
243
|
+
if (!teamId || typeof teamId !== "string")
|
|
244
|
+
throw new Error("teamId is required");
|
|
245
|
+
if (teamId === DEFAULT_TEAM_ID)
|
|
246
|
+
throw new Error("Team memory is only available for non-default teams");
|
|
247
|
+
}
|
|
248
|
+
/* ------------------------------------------------------------------ */
|
|
249
|
+
/* Input validation for teams.save */
|
|
250
|
+
/* ------------------------------------------------------------------ */
|
|
251
|
+
function validateAgentConfig(agent, label) {
|
|
252
|
+
if (typeof agent !== "object" || agent === null)
|
|
253
|
+
throw new Error(`${label} must be an object`);
|
|
254
|
+
const a = agent;
|
|
255
|
+
if (typeof a.name !== "string" || a.name.trim().length === 0)
|
|
256
|
+
throw new Error(`${label}.name is required`);
|
|
257
|
+
if (a.name.length > MAX_NAME_LENGTH)
|
|
258
|
+
throw new Error(`${label}.name exceeds maximum length of ${MAX_NAME_LENGTH}`);
|
|
259
|
+
if (typeof a.model !== "string" || a.model.length === 0)
|
|
260
|
+
throw new Error(`${label}.model is required`);
|
|
261
|
+
if (a.model.length > MAX_MODEL_LENGTH)
|
|
262
|
+
throw new Error(`${label}.model exceeds maximum length of ${MAX_MODEL_LENGTH}`);
|
|
263
|
+
if (typeof a.identity === "string" && a.identity.length > MAX_IDENTITY_LENGTH) {
|
|
264
|
+
throw new Error(`${label}.identity exceeds maximum length of ${MAX_IDENTITY_LENGTH}`);
|
|
265
|
+
}
|
|
266
|
+
}
|
|
267
|
+
function validateTeamConfig(tc) {
|
|
268
|
+
const t = tc;
|
|
269
|
+
if (typeof t.id !== "string" || t.id.trim().length === 0)
|
|
270
|
+
throw new Error("team.id is required");
|
|
271
|
+
if (typeof t.name !== "string" || t.name.trim().length === 0)
|
|
272
|
+
throw new Error("team.name is required");
|
|
273
|
+
if (t.name.length > MAX_NAME_LENGTH)
|
|
274
|
+
throw new Error(`team.name exceeds maximum length of ${MAX_NAME_LENGTH}`);
|
|
275
|
+
if (typeof t.color === "string" && t.color !== "" && !HEX_COLOR_RE.test(t.color)) {
|
|
276
|
+
throw new Error("team.color must be a valid hex color (e.g. #ef4444)");
|
|
277
|
+
}
|
|
278
|
+
if (t.workspace !== undefined && typeof t.workspace !== "string") {
|
|
279
|
+
throw new Error("team.workspace must be a string");
|
|
280
|
+
}
|
|
281
|
+
if (t.variables !== undefined) {
|
|
282
|
+
if (typeof t.variables !== "object" || t.variables === null || Array.isArray(t.variables)) {
|
|
283
|
+
throw new Error("team.variables must be an object of string key-value pairs");
|
|
284
|
+
}
|
|
285
|
+
for (const [k, v] of Object.entries(t.variables)) {
|
|
286
|
+
if (typeof v !== "string")
|
|
287
|
+
throw new Error(`team.variables["${k}"] must be a string`);
|
|
288
|
+
}
|
|
289
|
+
}
|
|
290
|
+
if (t.orchestrator) {
|
|
291
|
+
validateAgentConfig(t.orchestrator, "team.orchestrator");
|
|
292
|
+
}
|
|
293
|
+
if (Array.isArray(t.workers)) {
|
|
294
|
+
for (let j = 0; j < t.workers.length; j++) {
|
|
295
|
+
validateAgentConfig(t.workers[j], `team.workers[${j}]`);
|
|
296
|
+
}
|
|
297
|
+
}
|
|
298
|
+
}
|
|
299
|
+
/* ------------------------------------------------------------------ */
|
|
300
|
+
/* Save a single team: create or update team + reconcile agents */
|
|
301
|
+
/* ------------------------------------------------------------------ */
|
|
302
|
+
function saveTeam(store, tc) {
|
|
303
|
+
const existing = store.getTeamById(tc.id);
|
|
304
|
+
if (existing) {
|
|
305
|
+
store.updateTeam(tc.id, {
|
|
306
|
+
name: tc.name?.trim(),
|
|
307
|
+
color: tc.color,
|
|
308
|
+
workspace: tc.workspace,
|
|
309
|
+
variables: tc.variables,
|
|
310
|
+
});
|
|
311
|
+
}
|
|
312
|
+
else {
|
|
313
|
+
store.createTeam({
|
|
314
|
+
id: tc.id,
|
|
315
|
+
name: tc.name?.trim() ?? tc.id,
|
|
316
|
+
color: tc.color ?? "",
|
|
317
|
+
workspace: tc.workspace ?? "",
|
|
318
|
+
variables: tc.variables ?? {},
|
|
319
|
+
});
|
|
320
|
+
}
|
|
321
|
+
syncAgents(store, tc.id, tc);
|
|
322
|
+
}
|
|
323
|
+
function syncAgents(store, teamId, tc) {
|
|
324
|
+
const existingAgents = store.listAgentsByTeam(teamId);
|
|
325
|
+
const existingById = new Map(existingAgents.map((a) => [a.id, a]));
|
|
326
|
+
// Collect all incoming agent configs (orchestrator + workers)
|
|
327
|
+
const incomingAgents = [];
|
|
328
|
+
if (tc.orchestrator?.id) {
|
|
329
|
+
incomingAgents.push({ config: tc.orchestrator, role: "orchestrator" });
|
|
330
|
+
}
|
|
331
|
+
for (const w of tc.workers ?? []) {
|
|
332
|
+
if (w.id)
|
|
333
|
+
incomingAgents.push({ config: w, role: "worker" });
|
|
334
|
+
}
|
|
335
|
+
const incomingAgentIds = new Set(incomingAgents.map((a) => a.config.id));
|
|
336
|
+
// If the orchestrator id changed, delete the old one first so the new one can be created
|
|
337
|
+
const existingOrchestrator = existingAgents.find((a) => a.role === "orchestrator");
|
|
338
|
+
const incomingOrchestrator = incomingAgents.find((a) => a.role === "orchestrator");
|
|
339
|
+
if (existingOrchestrator && incomingOrchestrator && existingOrchestrator.id !== incomingOrchestrator.config.id) {
|
|
340
|
+
store.updateAgent(existingOrchestrator.id, { role: "worker" });
|
|
341
|
+
store.deleteAgent(existingOrchestrator.id);
|
|
342
|
+
}
|
|
343
|
+
// Delete workers that were removed
|
|
344
|
+
for (const agent of existingAgents) {
|
|
345
|
+
if (!incomingAgentIds.has(agent.id) && agent.role === "worker") {
|
|
346
|
+
try {
|
|
347
|
+
store.deleteAgent(agent.id);
|
|
348
|
+
}
|
|
349
|
+
catch (err) {
|
|
350
|
+
logger.warn(`teams.save: failed to delete agent ${agent.id}: ${err}`);
|
|
351
|
+
}
|
|
352
|
+
}
|
|
353
|
+
}
|
|
354
|
+
// Create or update agents
|
|
355
|
+
for (const { config, role } of incomingAgents) {
|
|
356
|
+
const agentFields = {
|
|
357
|
+
name: config.name,
|
|
358
|
+
role,
|
|
359
|
+
model: config.model,
|
|
360
|
+
contextWindow: config.contextWindow,
|
|
361
|
+
maxSteps: config.maxSteps,
|
|
362
|
+
identity: config.identity,
|
|
363
|
+
tools: config.tools,
|
|
364
|
+
timeout: config.timeout ?? DEFAULT_WORKER_TIMEOUT_S,
|
|
365
|
+
templateId: config.templateId ?? null,
|
|
366
|
+
};
|
|
367
|
+
if (existingById.has(config.id)) {
|
|
368
|
+
store.updateAgent(config.id, agentFields);
|
|
369
|
+
}
|
|
370
|
+
else {
|
|
371
|
+
store.createAgent(teamId, { id: config.id, ...agentFields });
|
|
372
|
+
}
|
|
373
|
+
}
|
|
374
|
+
}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import type { Agent } from "../../brain/agent.js";
|
|
2
|
+
import type { ConfigStore } from "../../config/store.js";
|
|
3
|
+
export declare function whatsappMethods(getAgent: () => Agent, configStore: ConfigStore): {
|
|
4
|
+
/**
|
|
5
|
+
* Generate an opaque phoneId, save it to config, and trigger channel start.
|
|
6
|
+
* The WhatsApp channel will emit QR code events via the event bus.
|
|
7
|
+
*/
|
|
8
|
+
"whatsapp.link": () => Promise<{
|
|
9
|
+
phoneId: `${string}-${string}-${string}-${string}-${string}`;
|
|
10
|
+
}>;
|
|
11
|
+
/** Clear the phoneId from config, stop the channel, and wipe auth state. */
|
|
12
|
+
"whatsapp.unlink": () => Promise<{
|
|
13
|
+
status: string;
|
|
14
|
+
}>;
|
|
15
|
+
/** Return whether WhatsApp is configured (has a non-empty phoneId). */
|
|
16
|
+
"whatsapp.status": () => Promise<{
|
|
17
|
+
linked: boolean;
|
|
18
|
+
}>;
|
|
19
|
+
};
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
import { randomUUID } from "node:crypto";
|
|
2
|
+
import { rm } from "node:fs/promises";
|
|
3
|
+
import { logger } from "../../logger.js";
|
|
4
|
+
import { WHATSAPP_AUTH_DIR } from "../../paths.js";
|
|
5
|
+
export function whatsappMethods(getAgent, configStore) {
|
|
6
|
+
return {
|
|
7
|
+
/**
|
|
8
|
+
* Generate an opaque phoneId, save it to config, and trigger channel start.
|
|
9
|
+
* The WhatsApp channel will emit QR code events via the event bus.
|
|
10
|
+
*/
|
|
11
|
+
"whatsapp.link": async () => {
|
|
12
|
+
const phoneId = randomUUID();
|
|
13
|
+
configStore.patch({ WHATSAPP_PHONE_ID: phoneId });
|
|
14
|
+
logger.info(`[whatsapp] link requested, phoneId=${phoneId}`);
|
|
15
|
+
await getAgent().forceConfigReload();
|
|
16
|
+
return { phoneId };
|
|
17
|
+
},
|
|
18
|
+
/** Clear the phoneId from config, stop the channel, and wipe auth state. */
|
|
19
|
+
"whatsapp.unlink": async () => {
|
|
20
|
+
configStore.patch({ WHATSAPP_PHONE_ID: "" });
|
|
21
|
+
logger.info("[whatsapp] unlink requested");
|
|
22
|
+
await getAgent().forceConfigReload();
|
|
23
|
+
// Remove Baileys auth state so next link starts a fresh QR session
|
|
24
|
+
await rm(WHATSAPP_AUTH_DIR, { recursive: true, force: true });
|
|
25
|
+
return { status: "unlinked" };
|
|
26
|
+
},
|
|
27
|
+
/** Return whether WhatsApp is configured (has a non-empty phoneId). */
|
|
28
|
+
"whatsapp.status": async () => {
|
|
29
|
+
const data = configStore.load();
|
|
30
|
+
const phoneId = data.WHATSAPP_PHONE_ID;
|
|
31
|
+
const linked = typeof phoneId === "string" && phoneId !== "";
|
|
32
|
+
return { linked };
|
|
33
|
+
},
|
|
34
|
+
};
|
|
35
|
+
}
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
import type { WebSocket } from "ws";
|
|
2
|
+
import type { Agent } from "../brain/agent.js";
|
|
3
|
+
import type { ConfigStore } from "../config/store.js";
|
|
4
|
+
import type { TaskStore } from "../tasks/store.js";
|
|
5
|
+
import type { TeamStore } from "../teams/store.js";
|
|
6
|
+
import type { ScheduleStore } from "../scheduler/store.js";
|
|
7
|
+
import type { ConnectedChannelRegistry } from "../scheduler/connected-channels.js";
|
|
8
|
+
import type { MemoryStore } from "../memory/store.js";
|
|
9
|
+
import type { EmbeddingProvider } from "../memory/embedding.js";
|
|
10
|
+
import type { SkillManager } from "../skills/loader.js";
|
|
11
|
+
import type { PromptTemplateStore } from "../prompt-templates/store.js";
|
|
12
|
+
/** Per-call context passed from the WS layer to RPC methods. */
|
|
13
|
+
export interface RpcContext {
|
|
14
|
+
/** The WebSocket that initiated this RPC call. */
|
|
15
|
+
ws: WebSocket;
|
|
16
|
+
}
|
|
17
|
+
export interface RpcOptions {
|
|
18
|
+
configStore?: ConfigStore;
|
|
19
|
+
/** Hot-restart callback: tears down current runtime and boots a new one. */
|
|
20
|
+
restart?: () => Promise<void>;
|
|
21
|
+
/** Getter for TaskStore (follows runtime swaps on hot restart). */
|
|
22
|
+
getTaskStore?: () => TaskStore;
|
|
23
|
+
/** Getter for TeamStore (follows runtime swaps on hot restart). */
|
|
24
|
+
getTeamStore?: () => TeamStore;
|
|
25
|
+
/** Getter for ScheduleStore (follows runtime swaps on hot restart). */
|
|
26
|
+
getScheduleStore?: () => ScheduleStore;
|
|
27
|
+
/** Getter for ConnectedChannelRegistry (follows runtime swaps on hot restart). */
|
|
28
|
+
getConnectedChannels?: () => ConnectedChannelRegistry;
|
|
29
|
+
/** Getter for SkillManager (follows runtime swaps on hot restart). */
|
|
30
|
+
getSkillManager?: () => SkillManager;
|
|
31
|
+
/** Getter for MemoryStore (follows runtime swaps on hot restart). */
|
|
32
|
+
getMemoryStore?: () => MemoryStore | null;
|
|
33
|
+
/** Getter for EmbeddingProvider (follows runtime swaps on hot restart). */
|
|
34
|
+
getEmbeddingProvider?: () => EmbeddingProvider | null;
|
|
35
|
+
/** Getter for PromptTemplateStore (follows runtime swaps on hot restart). */
|
|
36
|
+
getPromptTemplateStore?: () => PromptTemplateStore;
|
|
37
|
+
}
|
|
38
|
+
export declare function createRpcDispatcher(getAgent: () => Agent, opts?: RpcOptions): (method: string, params: unknown, ctx?: RpcContext) => Promise<unknown>;
|
|
@@ -0,0 +1,75 @@
|
|
|
1
|
+
import { chatMethods } from "./methods/chat.js";
|
|
2
|
+
import { sessionMethods } from "./methods/sessions.js";
|
|
3
|
+
import { configMethods } from "./methods/config.js";
|
|
4
|
+
import { systemMethods } from "./methods/system.js";
|
|
5
|
+
import { taskMethods } from "./methods/tasks.js";
|
|
6
|
+
import { teamMethods } from "./methods/teams.js";
|
|
7
|
+
import { schedulerMethods } from "./methods/scheduler.js";
|
|
8
|
+
import { modelMethods } from "./methods/models.js";
|
|
9
|
+
import { skillMethods } from "./methods/skills.js";
|
|
10
|
+
import { toolMethods } from "./methods/tools.js";
|
|
11
|
+
import { whatsappMethods } from "./methods/whatsapp.js";
|
|
12
|
+
import { promptTemplateMethods } from "./methods/prompt-templates.js";
|
|
13
|
+
export function createRpcDispatcher(getAgent, opts = {}) {
|
|
14
|
+
const { configStore, restart, getTaskStore, getTeamStore, getScheduleStore, getConnectedChannels, getSkillManager, getMemoryStore, getEmbeddingProvider, getPromptTemplateStore } = opts;
|
|
15
|
+
const staticMethods = {
|
|
16
|
+
...chatMethods(getAgent),
|
|
17
|
+
...sessionMethods(getAgent),
|
|
18
|
+
...(configStore ? configMethods(configStore) : {}),
|
|
19
|
+
...modelMethods(),
|
|
20
|
+
};
|
|
21
|
+
return async (method, params, ctx) => {
|
|
22
|
+
// 1. Static methods (no ctx or hot-restart dependency)
|
|
23
|
+
if (staticMethods[method])
|
|
24
|
+
return staticMethods[method](params);
|
|
25
|
+
// 2. Tool methods (derived from Agent)
|
|
26
|
+
if (method.startsWith("tools.")) {
|
|
27
|
+
const methods = toolMethods(getAgent);
|
|
28
|
+
if (methods[method])
|
|
29
|
+
return methods[method](params);
|
|
30
|
+
}
|
|
31
|
+
// 3. System methods (need ctx for per-client log subscriptions)
|
|
32
|
+
if (restart && method.startsWith("system.")) {
|
|
33
|
+
const methods = systemMethods(restart, ctx);
|
|
34
|
+
if (methods[method])
|
|
35
|
+
return methods[method](params);
|
|
36
|
+
}
|
|
37
|
+
// 4. Task methods (lazy for hot-restart safety)
|
|
38
|
+
if (getTaskStore && method.startsWith("tasks.")) {
|
|
39
|
+
const methods = taskMethods(getTaskStore());
|
|
40
|
+
if (methods[method])
|
|
41
|
+
return methods[method](params);
|
|
42
|
+
}
|
|
43
|
+
// 5. Team methods (lazy for hot-restart safety)
|
|
44
|
+
if (getTeamStore && method.startsWith("teams.")) {
|
|
45
|
+
const methods = teamMethods(getTeamStore(), getMemoryStore?.() ?? null, getEmbeddingProvider?.() ?? null);
|
|
46
|
+
if (methods[method])
|
|
47
|
+
return methods[method](params);
|
|
48
|
+
}
|
|
49
|
+
// 6. Prompt template methods (lazy for hot-restart safety)
|
|
50
|
+
if (getPromptTemplateStore && method.startsWith("promptTemplates.")) {
|
|
51
|
+
const methods = promptTemplateMethods(getPromptTemplateStore());
|
|
52
|
+
if (methods[method])
|
|
53
|
+
return methods[method](params);
|
|
54
|
+
}
|
|
55
|
+
// 7. Scheduler methods (lazy + ctx for hot-restart safety)
|
|
56
|
+
if (getScheduleStore && getConnectedChannels && method.startsWith("scheduler.")) {
|
|
57
|
+
const methods = schedulerMethods(getAgent, getScheduleStore, getConnectedChannels, ctx);
|
|
58
|
+
if (methods[method])
|
|
59
|
+
return methods[method](params);
|
|
60
|
+
}
|
|
61
|
+
// 7. Skill methods (lazy for hot-restart safety)
|
|
62
|
+
if (getSkillManager && method.startsWith("skills.")) {
|
|
63
|
+
const methods = skillMethods(getSkillManager);
|
|
64
|
+
if (methods[method])
|
|
65
|
+
return methods[method](params);
|
|
66
|
+
}
|
|
67
|
+
// 8. WhatsApp methods (link/unlink/status)
|
|
68
|
+
if (configStore && method.startsWith("whatsapp.")) {
|
|
69
|
+
const methods = whatsappMethods(getAgent, configStore);
|
|
70
|
+
if (methods[method])
|
|
71
|
+
return methods[method](params);
|
|
72
|
+
}
|
|
73
|
+
throw new Error(`Unknown method: ${method}`);
|
|
74
|
+
};
|
|
75
|
+
}
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import { type IncomingMessage, type ServerResponse } from "node:http";
|
|
2
|
+
import type { Agent } from "../brain/agent.js";
|
|
3
|
+
import { type RpcOptions } from "./rpc.js";
|
|
4
|
+
export declare function startGateway(port: number, token: string, getAgent: () => Agent, opts?: RpcOptions): import("node:http").Server<typeof IncomingMessage, typeof ServerResponse>;
|