@gencode/agents 0.0.6 → 0.0.7
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/dist/config-DJX-VM7S.js +198 -0
- package/dist/config-DJX-VM7S.js.map +1 -0
- package/dist/index-JD6Ye-N5.d.ts +149 -0
- package/dist/index-JD6Ye-N5.d.ts.map +1 -0
- package/dist/index.d.ts +2 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/manager-qXa-NP0p.js +1651 -0
- package/dist/manager-qXa-NP0p.js.map +1 -0
- package/dist/message.d.ts +11 -0
- package/dist/message.d.ts.map +1 -0
- package/dist/message.js +46 -0
- package/dist/message.js.map +1 -0
- package/dist/plugins/hooks.d.ts +2 -0
- package/dist/plugins/hooks.d.ts.map +1 -1
- package/dist/plugins/hooks.js.map +1 -1
- package/dist/plugins/tool-hooks.d.ts.map +1 -1
- package/dist/plugins/tool-hooks.js +4 -1
- package/dist/plugins/tool-hooks.js.map +1 -1
- package/dist/runner/event-dispatcher.d.ts +3 -22
- package/dist/runner/event-dispatcher.d.ts.map +1 -1
- package/dist/runner/event-dispatcher.js +6 -75
- package/dist/runner/event-dispatcher.js.map +1 -1
- package/dist/runner/session-lifecycle.d.ts.map +1 -1
- package/dist/runner/session-lifecycle.js +5 -13
- package/dist/runner/session-lifecycle.js.map +1 -1
- package/dist/runner/turn-executor.d.ts.map +1 -1
- package/dist/runner/turn-executor.js +42 -3
- package/dist/runner/turn-executor.js.map +1 -1
- package/dist/security/command-dangerous-rules.d.ts +4 -0
- package/dist/security/command-dangerous-rules.d.ts.map +1 -0
- package/dist/security/command-dangerous-rules.js +26 -0
- package/dist/security/command-dangerous-rules.js.map +1 -0
- package/dist/security/command-parser.d.ts +3 -0
- package/dist/security/command-parser.d.ts.map +1 -0
- package/dist/security/command-parser.js +191 -0
- package/dist/security/command-parser.js.map +1 -0
- package/dist/security/command-path-guard.d.ts +10 -0
- package/dist/security/command-path-guard.d.ts.map +1 -0
- package/dist/security/command-path-guard.js +126 -0
- package/dist/security/command-path-guard.js.map +1 -0
- package/dist/security/command-policy-config.d.ts +5 -0
- package/dist/security/command-policy-config.d.ts.map +1 -0
- package/dist/security/command-policy-config.js +212 -0
- package/dist/security/command-policy-config.js.map +1 -0
- package/dist/security/command-policy-engine.d.ts +8 -0
- package/dist/security/command-policy-engine.d.ts.map +1 -0
- package/dist/security/command-policy-engine.js +122 -0
- package/dist/security/command-policy-engine.js.map +1 -0
- package/dist/security/command-policy-types.d.ts +67 -0
- package/dist/security/command-policy-types.d.ts.map +1 -0
- package/dist/security/command-policy-types.js +2 -0
- package/dist/security/command-policy-types.js.map +1 -0
- package/dist/security/command-safe-bins.d.ts +4 -0
- package/dist/security/command-safe-bins.d.ts.map +1 -0
- package/dist/security/command-safe-bins.js +84 -0
- package/dist/security/command-safe-bins.js.map +1 -0
- package/dist/security/command-trusted-executables.d.ts +6 -0
- package/dist/security/command-trusted-executables.d.ts.map +1 -0
- package/dist/security/command-trusted-executables.js +57 -0
- package/dist/security/command-trusted-executables.js.map +1 -0
- package/dist/tools/cron.d.ts +22 -15
- package/dist/tools/cron.d.ts.map +1 -1
- package/dist/tools/cron.js +40 -20
- package/dist/tools/cron.js.map +1 -1
- package/dist/tools/exec.d.ts.map +1 -1
- package/dist/tools/exec.js +28 -9
- package/dist/tools/exec.js.map +1 -1
- package/dist/tools/process-registry.d.ts.map +1 -1
- package/dist/tools/process-registry.js +25 -15
- package/dist/tools/process-registry.js.map +1 -1
- package/dist/types.d.ts +4 -97
- package/dist/types.d.ts.map +1 -1
- package/package.json +3 -2
|
@@ -0,0 +1,198 @@
|
|
|
1
|
+
import fs from "node:fs/promises";
|
|
2
|
+
import path from "node:path";
|
|
3
|
+
|
|
4
|
+
//#region src/config/agents-config.ts
|
|
5
|
+
/**
|
|
6
|
+
* Agent configuration management for Pingclaw.
|
|
7
|
+
* Handles loading/saving agents.json from .pingclaw directory.
|
|
8
|
+
*/
|
|
9
|
+
const AGENTS_CONFIG_FILE = "agents.json";
|
|
10
|
+
/**
|
|
11
|
+
* Resolves the .pingclaw directory path within a data directory.
|
|
12
|
+
*/
|
|
13
|
+
function pingclawDir(dataDir) {
|
|
14
|
+
return path.join(dataDir, ".pingclaw");
|
|
15
|
+
}
|
|
16
|
+
/**
|
|
17
|
+
* Resolves the agents configuration file path.
|
|
18
|
+
*/
|
|
19
|
+
function resolveAgentsConfigPath(dataDir) {
|
|
20
|
+
return path.join(pingclawDir(dataDir), AGENTS_CONFIG_FILE);
|
|
21
|
+
}
|
|
22
|
+
/**
|
|
23
|
+
* Resolves the agent-specific directory path.
|
|
24
|
+
*/
|
|
25
|
+
function resolveAgentDir(dataDir, agentId) {
|
|
26
|
+
return path.join(pingclawDir(dataDir), "agents", agentId);
|
|
27
|
+
}
|
|
28
|
+
/**
|
|
29
|
+
* Loads the agents configuration from disk.
|
|
30
|
+
* Returns a default config if the file doesn't exist.
|
|
31
|
+
*/
|
|
32
|
+
async function loadAgentsConfig(dataDir) {
|
|
33
|
+
const configPath = resolveAgentsConfigPath(dataDir);
|
|
34
|
+
try {
|
|
35
|
+
const content = await fs.readFile(configPath, "utf-8");
|
|
36
|
+
const parsed = JSON.parse(content);
|
|
37
|
+
if (!parsed || typeof parsed !== "object") throw new Error("Invalid agents config: not an object");
|
|
38
|
+
if (!Array.isArray(parsed.agents)) parsed.agents = [];
|
|
39
|
+
if (!Array.isArray(parsed.bindings)) parsed.bindings = [];
|
|
40
|
+
return parsed;
|
|
41
|
+
} catch (err) {
|
|
42
|
+
if (err.code === "ENOENT") return { agents: [{
|
|
43
|
+
id: "main",
|
|
44
|
+
default: true
|
|
45
|
+
}] };
|
|
46
|
+
throw err;
|
|
47
|
+
}
|
|
48
|
+
}
|
|
49
|
+
/**
|
|
50
|
+
* Saves the agents configuration to disk.
|
|
51
|
+
*/
|
|
52
|
+
async function saveAgentsConfig(dataDir, config) {
|
|
53
|
+
const configPath = resolveAgentsConfigPath(dataDir);
|
|
54
|
+
await fs.mkdir(path.dirname(configPath), { recursive: true });
|
|
55
|
+
await fs.writeFile(configPath, JSON.stringify(config, null, 2), "utf-8");
|
|
56
|
+
}
|
|
57
|
+
/**
|
|
58
|
+
* Lists all valid agent configurations.
|
|
59
|
+
*/
|
|
60
|
+
function listAgents(config) {
|
|
61
|
+
if (!Array.isArray(config.agents)) return [];
|
|
62
|
+
return config.agents.filter((a) => a && typeof a === "object" && typeof a.id === "string");
|
|
63
|
+
}
|
|
64
|
+
/**
|
|
65
|
+
* Gets the default agent ID.
|
|
66
|
+
* Returns the first agent marked as default, or "main" if none found.
|
|
67
|
+
*/
|
|
68
|
+
function resolveDefaultAgentId(config) {
|
|
69
|
+
return listAgents(config).find((a) => a.default === true)?.id ?? "main";
|
|
70
|
+
}
|
|
71
|
+
/**
|
|
72
|
+
* Normalizes an agent ID (lowercase, trimmed).
|
|
73
|
+
*/
|
|
74
|
+
function normalizeAgentId(id) {
|
|
75
|
+
if (!id) return "main";
|
|
76
|
+
return id.trim().toLowerCase();
|
|
77
|
+
}
|
|
78
|
+
/**
|
|
79
|
+
* Gets an agent configuration by ID.
|
|
80
|
+
*/
|
|
81
|
+
function getAgentConfig(config, agentId) {
|
|
82
|
+
const normalizedId = normalizeAgentId(agentId);
|
|
83
|
+
return listAgents(config).find((a) => normalizeAgentId(a.id) === normalizedId);
|
|
84
|
+
}
|
|
85
|
+
/**
|
|
86
|
+
* Lists all routing bindings.
|
|
87
|
+
*/
|
|
88
|
+
function listBindings(config) {
|
|
89
|
+
if (!Array.isArray(config.bindings)) return [];
|
|
90
|
+
return config.bindings.filter((b) => b && typeof b === "object" && typeof b.agentId === "string");
|
|
91
|
+
}
|
|
92
|
+
/**
|
|
93
|
+
* Resolves the agent ID for a given channel/account/user combination.
|
|
94
|
+
* Returns the agent ID from the first matching binding, or the default agent ID.
|
|
95
|
+
*/
|
|
96
|
+
function resolveAgentIdByBinding(config, channel, accountId, userId) {
|
|
97
|
+
for (const binding of listBindings(config)) {
|
|
98
|
+
const match = binding.match;
|
|
99
|
+
if (!match) continue;
|
|
100
|
+
if (match.channel !== channel) continue;
|
|
101
|
+
if (match.accountId && match.accountId !== accountId) continue;
|
|
102
|
+
if (match.userId && match.userId !== userId) continue;
|
|
103
|
+
return binding.agentId;
|
|
104
|
+
}
|
|
105
|
+
return resolveDefaultAgentId(config);
|
|
106
|
+
}
|
|
107
|
+
/**
|
|
108
|
+
* Resolves the model string from an AgentModelConfig or plain string.
|
|
109
|
+
*/
|
|
110
|
+
function resolveModelString(model) {
|
|
111
|
+
if (!model) return void 0;
|
|
112
|
+
if (typeof model === "string") return model;
|
|
113
|
+
return model.primary;
|
|
114
|
+
}
|
|
115
|
+
/**
|
|
116
|
+
* Resolves the model fallbacks from an AgentModelConfig.
|
|
117
|
+
*/
|
|
118
|
+
function resolveModelFallbacks(model) {
|
|
119
|
+
if (!model || typeof model === "string") return void 0;
|
|
120
|
+
return model.fallbacks;
|
|
121
|
+
}
|
|
122
|
+
/**
|
|
123
|
+
* Adds a new agent to the configuration.
|
|
124
|
+
* Returns false if an agent with the same ID already exists.
|
|
125
|
+
*/
|
|
126
|
+
async function addAgent(dataDir, agent) {
|
|
127
|
+
const config = await loadAgentsConfig(dataDir);
|
|
128
|
+
if (getAgentConfig(config, normalizeAgentId(agent.id))) return false;
|
|
129
|
+
config.agents = config.agents ?? [];
|
|
130
|
+
config.agents.push(agent);
|
|
131
|
+
await saveAgentsConfig(dataDir, config);
|
|
132
|
+
const agentDir = resolveAgentDir(dataDir, agent.id);
|
|
133
|
+
await fs.mkdir(agentDir, { recursive: true });
|
|
134
|
+
return true;
|
|
135
|
+
}
|
|
136
|
+
/**
|
|
137
|
+
* Removes an agent from the configuration.
|
|
138
|
+
* Returns false if the agent doesn't exist or is the default agent.
|
|
139
|
+
*/
|
|
140
|
+
async function removeAgent(dataDir, agentId) {
|
|
141
|
+
const config = await loadAgentsConfig(dataDir);
|
|
142
|
+
const normalizedId = normalizeAgentId(agentId);
|
|
143
|
+
const index = config.agents?.findIndex((a) => a && normalizeAgentId(a.id) === normalizedId);
|
|
144
|
+
if (index === void 0 || index < 0) return false;
|
|
145
|
+
if (config.agents?.[index]?.default === true) return false;
|
|
146
|
+
config.agents?.splice(index, 1);
|
|
147
|
+
config.bindings = config.bindings?.filter((b) => normalizeAgentId(b.agentId) !== normalizedId);
|
|
148
|
+
await saveAgentsConfig(dataDir, config);
|
|
149
|
+
return true;
|
|
150
|
+
}
|
|
151
|
+
/**
|
|
152
|
+
* Adds a routing binding to the configuration.
|
|
153
|
+
*/
|
|
154
|
+
async function addBinding(dataDir, binding) {
|
|
155
|
+
const config = await loadAgentsConfig(dataDir);
|
|
156
|
+
config.bindings = config.bindings ?? [];
|
|
157
|
+
config.bindings.push(binding);
|
|
158
|
+
await saveAgentsConfig(dataDir, config);
|
|
159
|
+
}
|
|
160
|
+
/**
|
|
161
|
+
* Removes routing bindings matching the given criteria.
|
|
162
|
+
* If channel is "*", removes all bindings for the agent.
|
|
163
|
+
*/
|
|
164
|
+
async function removeBindings(dataDir, agentId, channel, accountId) {
|
|
165
|
+
const config = await loadAgentsConfig(dataDir);
|
|
166
|
+
const normalizedAgentId = normalizeAgentId(agentId);
|
|
167
|
+
const originalLength = config.bindings?.length ?? 0;
|
|
168
|
+
if (channel === "*") config.bindings = config.bindings?.filter((b) => normalizeAgentId(b.agentId) !== normalizedAgentId);
|
|
169
|
+
else config.bindings = config.bindings?.filter((b) => {
|
|
170
|
+
if (normalizeAgentId(b.agentId) !== normalizedAgentId) return true;
|
|
171
|
+
if (channel && b.match?.channel !== channel) return true;
|
|
172
|
+
if (accountId && b.match?.accountId !== accountId) return true;
|
|
173
|
+
return false;
|
|
174
|
+
});
|
|
175
|
+
const removed = originalLength - (config.bindings?.length ?? 0);
|
|
176
|
+
if (removed > 0) await saveAgentsConfig(dataDir, config);
|
|
177
|
+
return removed;
|
|
178
|
+
}
|
|
179
|
+
/**
|
|
180
|
+
* Updates an agent's identity configuration.
|
|
181
|
+
*/
|
|
182
|
+
async function updateAgentIdentity(dataDir, agentId, identity) {
|
|
183
|
+
const config = await loadAgentsConfig(dataDir);
|
|
184
|
+
const agent = getAgentConfig(config, agentId);
|
|
185
|
+
if (!agent) return false;
|
|
186
|
+
const updatedIdentity = { ...agent.identity ?? {} };
|
|
187
|
+
if (identity.name !== void 0) updatedIdentity.name = identity.name;
|
|
188
|
+
if (identity.theme !== void 0) updatedIdentity.theme = identity.theme;
|
|
189
|
+
if (identity.emoji !== void 0) updatedIdentity.emoji = identity.emoji;
|
|
190
|
+
if (identity.avatar !== void 0) updatedIdentity.avatar = identity.avatar;
|
|
191
|
+
agent.identity = updatedIdentity;
|
|
192
|
+
await saveAgentsConfig(dataDir, config);
|
|
193
|
+
return true;
|
|
194
|
+
}
|
|
195
|
+
|
|
196
|
+
//#endregion
|
|
197
|
+
export { saveAgentsConfig as _, listBindings as a, pingclawDir as c, resolveAgentDir as d, resolveAgentIdByBinding as f, resolveModelString as g, resolveModelFallbacks as h, listAgents as i, removeAgent as l, resolveDefaultAgentId as m, addBinding as n, loadAgentsConfig as o, resolveAgentsConfigPath as p, getAgentConfig as r, normalizeAgentId as s, addAgent as t, removeBindings as u, updateAgentIdentity as v };
|
|
198
|
+
//# sourceMappingURL=config-DJX-VM7S.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"config-DJX-VM7S.js","names":[],"sources":["../src/config/agents-config.ts"],"sourcesContent":["/**\n * Agent configuration management for Pingclaw.\n * Handles loading/saving agents.json from .pingclaw directory.\n */\n\nimport fs from \"node:fs/promises\";\nimport path from \"node:path\";\nimport type { AgentsConfig, AgentConfig, AgentBinding, AgentModelConfig } from \"./types.js\";\n\nexport const AGENTS_CONFIG_FILE = \"agents.json\";\n\n/**\n * Resolves the .pingclaw directory path within a data directory.\n */\nexport function pingclawDir(dataDir: string): string {\n return path.join(dataDir, \".pingclaw\");\n}\n\n/**\n * Resolves the agents configuration file path.\n */\nexport function resolveAgentsConfigPath(dataDir: string): string {\n return path.join(pingclawDir(dataDir), AGENTS_CONFIG_FILE);\n}\n\n/**\n * Resolves the agent-specific directory path.\n */\nexport function resolveAgentDir(dataDir: string, agentId: string): string {\n return path.join(pingclawDir(dataDir), \"agents\", agentId);\n}\n\n/**\n * Loads the agents configuration from disk.\n * Returns a default config if the file doesn't exist.\n */\nexport async function loadAgentsConfig(dataDir: string): Promise<AgentsConfig> {\n const configPath = resolveAgentsConfigPath(dataDir);\n try {\n const content = await fs.readFile(configPath, \"utf-8\");\n const parsed = JSON.parse(content);\n // Validate and normalize the config\n if (!parsed || typeof parsed !== \"object\") {\n throw new Error(\"Invalid agents config: not an object\");\n }\n if (!Array.isArray(parsed.agents)) {\n parsed.agents = [];\n }\n if (!Array.isArray(parsed.bindings)) {\n parsed.bindings = [];\n }\n return parsed as AgentsConfig;\n } catch (err) {\n const code = (err as { code?: string }).code;\n if (code === \"ENOENT\") {\n // Return default config for new installations\n return { agents: [{ id: \"main\", default: true }] };\n }\n throw err;\n }\n}\n\n/**\n * Saves the agents configuration to disk.\n */\nexport async function saveAgentsConfig(\n dataDir: string,\n config: AgentsConfig,\n): Promise<void> {\n const configPath = resolveAgentsConfigPath(dataDir);\n await fs.mkdir(path.dirname(configPath), { recursive: true });\n await fs.writeFile(configPath, JSON.stringify(config, null, 2), \"utf-8\");\n}\n\n/**\n * Lists all valid agent configurations.\n */\nexport function listAgents(config: AgentsConfig): AgentConfig[] {\n if (!Array.isArray(config.agents)) {\n return [];\n }\n return config.agents.filter((a): a is AgentConfig =>\n a && typeof a === \"object\" && typeof a.id === \"string\"\n );\n}\n\n/**\n * Gets the default agent ID.\n * Returns the first agent marked as default, or \"main\" if none found.\n */\nexport function resolveDefaultAgentId(config: AgentsConfig): string {\n const agents = listAgents(config);\n const defaultAgent = agents.find(a => a.default === true);\n return defaultAgent?.id ?? \"main\";\n}\n\n/**\n * Normalizes an agent ID (lowercase, trimmed).\n */\nexport function normalizeAgentId(id: string | undefined): string {\n if (!id) return \"main\";\n return id.trim().toLowerCase();\n}\n\n/**\n * Gets an agent configuration by ID.\n */\nexport function getAgentConfig(\n config: AgentsConfig,\n agentId: string,\n): AgentConfig | undefined {\n const normalizedId = normalizeAgentId(agentId);\n return listAgents(config).find(a => normalizeAgentId(a.id) === normalizedId);\n}\n\n/**\n * Lists all routing bindings.\n */\nexport function listBindings(config: AgentsConfig): AgentBinding[] {\n if (!Array.isArray(config.bindings)) {\n return [];\n }\n return config.bindings.filter((b): b is AgentBinding =>\n b && typeof b === \"object\" && typeof b.agentId === \"string\"\n );\n}\n\n/**\n * Resolves the agent ID for a given channel/account/user combination.\n * Returns the agent ID from the first matching binding, or the default agent ID.\n */\nexport function resolveAgentIdByBinding(\n config: AgentsConfig,\n channel: string,\n accountId?: string,\n userId?: string,\n): string {\n for (const binding of listBindings(config)) {\n const match = binding.match;\n if (!match) continue;\n\n // Match channel\n if (match.channel !== channel) continue;\n\n // Match account if specified\n if (match.accountId && match.accountId !== accountId) continue;\n\n // Match user if specified\n if (match.userId && match.userId !== userId) continue;\n\n return binding.agentId;\n }\n\n // No matching binding, use default agent\n return resolveDefaultAgentId(config);\n}\n\n/**\n * Resolves the model string from an AgentModelConfig or plain string.\n */\nexport function resolveModelString(\n model: string | AgentModelConfig | undefined,\n): string | undefined {\n if (!model) return undefined;\n if (typeof model === \"string\") return model;\n return model.primary;\n}\n\n/**\n * Resolves the model fallbacks from an AgentModelConfig.\n */\nexport function resolveModelFallbacks(\n model: string | AgentModelConfig | undefined,\n): string[] | undefined {\n if (!model || typeof model === \"string\") return undefined;\n return model.fallbacks;\n}\n\n/**\n * Adds a new agent to the configuration.\n * Returns false if an agent with the same ID already exists.\n */\nexport async function addAgent(\n dataDir: string,\n agent: AgentConfig,\n): Promise<boolean> {\n const config = await loadAgentsConfig(dataDir);\n const normalizedId = normalizeAgentId(agent.id);\n\n // Check for existing agent\n if (getAgentConfig(config, normalizedId)) {\n return false;\n }\n\n config.agents = config.agents ?? [];\n config.agents.push(agent);\n await saveAgentsConfig(dataDir, config);\n\n // Create agent directory\n const agentDir = resolveAgentDir(dataDir, agent.id);\n await fs.mkdir(agentDir, { recursive: true });\n\n return true;\n}\n\n/**\n * Removes an agent from the configuration.\n * Returns false if the agent doesn't exist or is the default agent.\n */\nexport async function removeAgent(\n dataDir: string,\n agentId: string,\n): Promise<boolean> {\n const config = await loadAgentsConfig(dataDir);\n const normalizedId = normalizeAgentId(agentId);\n\n const index = config.agents?.findIndex(\n a => a && normalizeAgentId(a.id) === normalizedId\n );\n\n if (index === undefined || index < 0) {\n return false;\n }\n\n // Don't allow removing the default agent\n if (config.agents?.[index]?.default === true) {\n return false;\n }\n\n config.agents?.splice(index, 1);\n\n // Remove associated bindings\n config.bindings = config.bindings?.filter(\n b => normalizeAgentId(b.agentId) !== normalizedId\n );\n\n await saveAgentsConfig(dataDir, config);\n return true;\n}\n\n/**\n * Adds a routing binding to the configuration.\n */\nexport async function addBinding(\n dataDir: string,\n binding: AgentBinding,\n): Promise<void> {\n const config = await loadAgentsConfig(dataDir);\n config.bindings = config.bindings ?? [];\n config.bindings.push(binding);\n await saveAgentsConfig(dataDir, config);\n}\n\n/**\n * Removes routing bindings matching the given criteria.\n * If channel is \"*\", removes all bindings for the agent.\n */\nexport async function removeBindings(\n dataDir: string,\n agentId: string,\n channel?: string,\n accountId?: string,\n): Promise<number> {\n const config = await loadAgentsConfig(dataDir);\n const normalizedAgentId = normalizeAgentId(agentId);\n\n const originalLength = config.bindings?.length ?? 0;\n\n if (channel === \"*\") {\n // Remove all bindings for this agent\n config.bindings = config.bindings?.filter(\n b => normalizeAgentId(b.agentId) !== normalizedAgentId\n );\n } else {\n // Remove matching bindings\n config.bindings = config.bindings?.filter(b => {\n if (normalizeAgentId(b.agentId) !== normalizedAgentId) return true;\n if (channel && b.match?.channel !== channel) return true;\n if (accountId && b.match?.accountId !== accountId) return true;\n return false;\n });\n }\n\n const removed = originalLength - (config.bindings?.length ?? 0);\n if (removed > 0) {\n await saveAgentsConfig(dataDir, config);\n }\n\n return removed;\n}\n\n/**\n * Updates an agent's identity configuration.\n */\nexport async function updateAgentIdentity(\n dataDir: string,\n agentId: string,\n identity: Partial<NonNullable<AgentConfig[\"identity\"]>>,\n): Promise<boolean> {\n const config = await loadAgentsConfig(dataDir);\n const agent = getAgentConfig(config, agentId);\n\n if (!agent) {\n return false;\n }\n\n // Initialize identity if not present\n const currentIdentity = agent.identity ?? {};\n const updatedIdentity: NonNullable<AgentConfig[\"identity\"]> = {\n ...currentIdentity,\n };\n\n // Type-safe property updates\n if (identity.name !== undefined) {\n updatedIdentity.name = identity.name;\n }\n if (identity.theme !== undefined) {\n updatedIdentity.theme = identity.theme;\n }\n if (identity.emoji !== undefined) {\n updatedIdentity.emoji = identity.emoji;\n }\n if (identity.avatar !== undefined) {\n updatedIdentity.avatar = identity.avatar;\n }\n\n agent.identity = updatedIdentity;\n\n await saveAgentsConfig(dataDir, config);\n return true;\n}\n"],"mappings":";;;;;;;;AASA,MAAa,qBAAqB;;;;AAKlC,SAAgB,YAAY,SAAyB;AACnD,QAAO,KAAK,KAAK,SAAS,YAAY;;;;;AAMxC,SAAgB,wBAAwB,SAAyB;AAC/D,QAAO,KAAK,KAAK,YAAY,QAAQ,EAAE,mBAAmB;;;;;AAM5D,SAAgB,gBAAgB,SAAiB,SAAyB;AACxE,QAAO,KAAK,KAAK,YAAY,QAAQ,EAAE,UAAU,QAAQ;;;;;;AAO3D,eAAsB,iBAAiB,SAAwC;CAC7E,MAAM,aAAa,wBAAwB,QAAQ;AACnD,KAAI;EACF,MAAM,UAAU,MAAM,GAAG,SAAS,YAAY,QAAQ;EACtD,MAAM,SAAS,KAAK,MAAM,QAAQ;AAElC,MAAI,CAAC,UAAU,OAAO,WAAW,SAC/B,OAAM,IAAI,MAAM,uCAAuC;AAEzD,MAAI,CAAC,MAAM,QAAQ,OAAO,OAAO,CAC/B,QAAO,SAAS,EAAE;AAEpB,MAAI,CAAC,MAAM,QAAQ,OAAO,SAAS,CACjC,QAAO,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ts
|
|
2
|
+
/**
|
|
3
|
+
* Agent configuration types for Pingclaw multi-agent support.
|
|
4
|
+
* Compatible with the .pingclaw/agents.json config file.
|
|
5
|
+
*/
|
|
6
|
+
/**
|
|
7
|
+
* Single agent configuration.
|
|
8
|
+
* Each agent can have its own model, skills, identity, and subagent settings.
|
|
9
|
+
*/
|
|
10
|
+
type AgentConfig = {
|
|
11
|
+
/** Unique agent identifier */id: string; /** Whether this is the default agent */
|
|
12
|
+
default?: boolean; /** Display name (overrides identity.name) */
|
|
13
|
+
name?: string; /** Model configuration (string or object with primary/fallbacks) */
|
|
14
|
+
model?: string | AgentModelConfig; /** Skills allowlist (omit = all skills; empty = none) */
|
|
15
|
+
skills?: string[]; /** Identity configuration for display/persona */
|
|
16
|
+
identity?: {
|
|
17
|
+
name?: string;
|
|
18
|
+
theme?: string;
|
|
19
|
+
emoji?: string;
|
|
20
|
+
avatar?: string;
|
|
21
|
+
}; /** Subagent configuration for this agent */
|
|
22
|
+
subagents?: {
|
|
23
|
+
/** Allow spawning subagents under other agent ids. Use "*" to allow any. */allowAgents?: string[]; /** Per-agent default model for spawned subagents (string or {primary,fallbacks}). */
|
|
24
|
+
model?: string | AgentModelConfig;
|
|
25
|
+
};
|
|
26
|
+
};
|
|
27
|
+
/**
|
|
28
|
+
* Model configuration with primary and optional fallbacks.
|
|
29
|
+
*/
|
|
30
|
+
type AgentModelConfig = {
|
|
31
|
+
primary: string;
|
|
32
|
+
fallbacks?: string[];
|
|
33
|
+
};
|
|
34
|
+
/**
|
|
35
|
+
* Routing binding configuration.
|
|
36
|
+
* Maps channel/account/peer to a specific agent.
|
|
37
|
+
*/
|
|
38
|
+
type AgentBinding = {
|
|
39
|
+
/** Target agent ID for this binding */agentId: string; /** Optional comment/description */
|
|
40
|
+
comment?: string; /** Match conditions for this binding */
|
|
41
|
+
match: {
|
|
42
|
+
/** Channel type: H5 | WEB | KLPA | CRON */channel: "H5" | "WEB" | "KLPA" | "CRON"; /** Account ID (optional, for multi-account routing) */
|
|
43
|
+
accountId?: string; /** User ID (optional, for user-specific routing) */
|
|
44
|
+
userId?: string;
|
|
45
|
+
};
|
|
46
|
+
};
|
|
47
|
+
/**
|
|
48
|
+
* Root agents configuration structure.
|
|
49
|
+
* Stored in .pingclaw/agents.json
|
|
50
|
+
*/
|
|
51
|
+
type AgentsConfig = {
|
|
52
|
+
/** List of configured agents */agents: AgentConfig[]; /** Routing bindings (channel -> agent mapping) */
|
|
53
|
+
bindings?: AgentBinding[]; /** Default configuration (optional) */
|
|
54
|
+
defaults?: {
|
|
55
|
+
model?: string | AgentModelConfig;
|
|
56
|
+
/**
|
|
57
|
+
* Maximum number of recent user turns to keep in context.
|
|
58
|
+
* 0 or undefined means no limit.
|
|
59
|
+
*/
|
|
60
|
+
historyLimit?: number; /** LLM-based history compaction settings */
|
|
61
|
+
compaction?: {
|
|
62
|
+
/** Whether to enable automatic LLM summarisation; defaults to true */enabled?: boolean; /** Fraction of context window that triggers compaction; defaults to 0.6 */
|
|
63
|
+
thresholdRatio?: number;
|
|
64
|
+
};
|
|
65
|
+
};
|
|
66
|
+
};
|
|
67
|
+
//#endregion
|
|
68
|
+
//#region src/config/agents-config.d.ts
|
|
69
|
+
/**
|
|
70
|
+
* Resolves the .pingclaw directory path within a data directory.
|
|
71
|
+
*/
|
|
72
|
+
declare function pingclawDir(dataDir: string): string;
|
|
73
|
+
/**
|
|
74
|
+
* Resolves the agents configuration file path.
|
|
75
|
+
*/
|
|
76
|
+
declare function resolveAgentsConfigPath(dataDir: string): string;
|
|
77
|
+
/**
|
|
78
|
+
* Resolves the agent-specific directory path.
|
|
79
|
+
*/
|
|
80
|
+
declare function resolveAgentDir(dataDir: string, agentId: string): string;
|
|
81
|
+
/**
|
|
82
|
+
* Loads the agents configuration from disk.
|
|
83
|
+
* Returns a default config if the file doesn't exist.
|
|
84
|
+
*/
|
|
85
|
+
declare function loadAgentsConfig(dataDir: string): Promise<AgentsConfig>;
|
|
86
|
+
/**
|
|
87
|
+
* Saves the agents configuration to disk.
|
|
88
|
+
*/
|
|
89
|
+
declare function saveAgentsConfig(dataDir: string, config: AgentsConfig): Promise<void>;
|
|
90
|
+
/**
|
|
91
|
+
* Lists all valid agent configurations.
|
|
92
|
+
*/
|
|
93
|
+
declare function listAgents(config: AgentsConfig): AgentConfig[];
|
|
94
|
+
/**
|
|
95
|
+
* Gets the default agent ID.
|
|
96
|
+
* Returns the first agent marked as default, or "main" if none found.
|
|
97
|
+
*/
|
|
98
|
+
declare function resolveDefaultAgentId(config: AgentsConfig): string;
|
|
99
|
+
/**
|
|
100
|
+
* Normalizes an agent ID (lowercase, trimmed).
|
|
101
|
+
*/
|
|
102
|
+
declare function normalizeAgentId(id: string | undefined): string;
|
|
103
|
+
/**
|
|
104
|
+
* Gets an agent configuration by ID.
|
|
105
|
+
*/
|
|
106
|
+
declare function getAgentConfig(config: AgentsConfig, agentId: string): AgentConfig | undefined;
|
|
107
|
+
/**
|
|
108
|
+
* Lists all routing bindings.
|
|
109
|
+
*/
|
|
110
|
+
declare function listBindings(config: AgentsConfig): AgentBinding[];
|
|
111
|
+
/**
|
|
112
|
+
* Resolves the agent ID for a given channel/account/user combination.
|
|
113
|
+
* Returns the agent ID from the first matching binding, or the default agent ID.
|
|
114
|
+
*/
|
|
115
|
+
declare function resolveAgentIdByBinding(config: AgentsConfig, channel: string, accountId?: string, userId?: string): string;
|
|
116
|
+
/**
|
|
117
|
+
* Resolves the model string from an AgentModelConfig or plain string.
|
|
118
|
+
*/
|
|
119
|
+
declare function resolveModelString(model: string | AgentModelConfig | undefined): string | undefined;
|
|
120
|
+
/**
|
|
121
|
+
* Resolves the model fallbacks from an AgentModelConfig.
|
|
122
|
+
*/
|
|
123
|
+
declare function resolveModelFallbacks(model: string | AgentModelConfig | undefined): string[] | undefined;
|
|
124
|
+
/**
|
|
125
|
+
* Adds a new agent to the configuration.
|
|
126
|
+
* Returns false if an agent with the same ID already exists.
|
|
127
|
+
*/
|
|
128
|
+
declare function addAgent(dataDir: string, agent: AgentConfig): Promise<boolean>;
|
|
129
|
+
/**
|
|
130
|
+
* Removes an agent from the configuration.
|
|
131
|
+
* Returns false if the agent doesn't exist or is the default agent.
|
|
132
|
+
*/
|
|
133
|
+
declare function removeAgent(dataDir: string, agentId: string): Promise<boolean>;
|
|
134
|
+
/**
|
|
135
|
+
* Adds a routing binding to the configuration.
|
|
136
|
+
*/
|
|
137
|
+
declare function addBinding(dataDir: string, binding: AgentBinding): Promise<void>;
|
|
138
|
+
/**
|
|
139
|
+
* Removes routing bindings matching the given criteria.
|
|
140
|
+
* If channel is "*", removes all bindings for the agent.
|
|
141
|
+
*/
|
|
142
|
+
declare function removeBindings(dataDir: string, agentId: string, channel?: string, accountId?: string): Promise<number>;
|
|
143
|
+
/**
|
|
144
|
+
* Updates an agent's identity configuration.
|
|
145
|
+
*/
|
|
146
|
+
declare function updateAgentIdentity(dataDir: string, agentId: string, identity: Partial<NonNullable<AgentConfig["identity"]>>): Promise<boolean>;
|
|
147
|
+
//#endregion
|
|
148
|
+
export { AgentsConfig as S, saveAgentsConfig as _, listBindings as a, AgentConfig as b, pingclawDir as c, resolveAgentDir as d, resolveAgentIdByBinding as f, resolveModelString as g, resolveModelFallbacks as h, listAgents as i, removeAgent as l, resolveDefaultAgentId as m, addBinding as n, loadAgentsConfig as o, resolveAgentsConfigPath as p, getAgentConfig as r, normalizeAgentId as s, addAgent as t, removeBindings as u, updateAgentIdentity as v, AgentModelConfig as x, AgentBinding as y };
|
|
149
|
+
//# sourceMappingURL=index-JD6Ye-N5.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index-JD6Ye-N5.d.ts","names":[],"sources":["../src/config/types.ts","../src/config/agents-config.ts"],"mappings":";;AASA;;;;;;;KAAY,WAAA;EAQO,8BANjB,EAAA,UAUA;EARA,OAAA,YAUE;EARF,IAAA,WAUE;EARF,KAAA,YAAiB,gBAAA,EAaf;EAXF,MAAA,aAamB;EAXnB,QAAA;IACE,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A,CACd,KAAA,WAAgB,gBAAA;;;AA9JlB;;iBAwKsB,QAAA,CACpB,OAAA,UACA,KAAA,EAAO,WAAA,GACN,OAAA;;;AApKH;;iBA4LsB,WAAA,CACpB,OAAA,UACA,OAAA,WACC,OAAA;;;AAxLH;iBAuNsB,UAAA,CACpB,OAAA,UACA,OAAA,EAAS,YAAA,GACR,OAAA;;;;AAlNH;iBA6NsB,cAAA,CACpB,OAAA,UACA,OAAA,UACA,OAAA,WACA,SAAA,YACC,OAAA;;;;iBAgCmB,mBAAA,CACpB,OAAA,UACA,OAAA,UACA,QAAA,EAAU,OAAA,CAAQ,WAAA,CAAY,WAAA,iBAC7B,OAAA"}
|
package/dist/index.d.ts
CHANGED
|
@@ -4,7 +4,8 @@
|
|
|
4
4
|
* Core entry point for running agent sessions.
|
|
5
5
|
*/
|
|
6
6
|
export { runAgent, generateSessionTitle } from "./runner/runner.js";
|
|
7
|
-
export type { AgentRunParams,
|
|
7
|
+
export type { AgentRunParams, AgentRunResult, CallbackPayload, TranscriptEntry, SubagentContext, Channel, } from "./types.js";
|
|
8
|
+
export type { AgentProgressEvent, CallbackEventPayload, RunResultPayload } from "@gencode/shared";
|
|
8
9
|
export type { ToolLoopDetectionConfig } from "./loop-detection/tool-loop-detection.js";
|
|
9
10
|
export { createSession, ensureSession, loadTranscript, appendTranscriptEntry, listSessions, listSessionSummaries, saveSessionMetadata, loadSessionMetadata, sessionsDir, sessionDir, transcriptPath, metadataPath, } from "./session/session.js";
|
|
10
11
|
export type { SessionMetadata, SessionSummary } from "./session/session.js";
|
package/dist/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAGH,OAAO,EAAE,QAAQ,EAAE,oBAAoB,EAAE,MAAM,oBAAoB,CAAC;AAGpE,YAAY,EACV,cAAc,EACd,
|
|
1
|
+
{"version":3,"file":"index.d.ts","source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