apteva 0.4.56 → 0.4.57
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/package.json +1 -1
- package/src/mcp-platform.ts +37 -4
package/package.json
CHANGED
package/src/mcp-platform.ts
CHANGED
|
@@ -5,7 +5,7 @@ import { AgentDB, ProjectDB, McpServerDB, McpServerToolDB, SkillDB, TelemetryDB,
|
|
|
5
5
|
import { TestCaseDB, TestRunDB } from "./db-tests";
|
|
6
6
|
import { runTest, runAll } from "./test-runner";
|
|
7
7
|
import { getProvidersWithStatus, PROVIDERS, ProviderKeys } from "./providers";
|
|
8
|
-
import { startAgentProcess, setAgentStatus, toApiAgent, META_AGENT_ID, agentFetch, fetchFromAgent } from "./routes/api/agent-utils";
|
|
8
|
+
import { startAgentProcess, setAgentStatus, toApiAgent, META_AGENT_ID, agentFetch, fetchFromAgent, buildAgentConfig, pushConfigToAgent, pushSkillsToAgent } from "./routes/api/agent-utils";
|
|
9
9
|
import { agentProcesses } from "./server";
|
|
10
10
|
import { getTriggerProvider, getTriggerProviderIds, registerTriggerProvider } from "./triggers";
|
|
11
11
|
import { ComposioTriggerProvider } from "./triggers/composio";
|
|
@@ -126,7 +126,7 @@ TIPS:
|
|
|
126
126
|
},
|
|
127
127
|
{
|
|
128
128
|
name: "update_agent",
|
|
129
|
-
description: `Update an existing agent's configuration. Only provide fields you want to change.
|
|
129
|
+
description: `Update an existing agent's configuration. Only provide fields you want to change. Changes are applied live — if the agent is running, the new config is pushed automatically. No restart needed.
|
|
130
130
|
|
|
131
131
|
SKILLS & MCP SERVERS:
|
|
132
132
|
- Pass skill_ids or mcp_server_ids to SET the full list (replaces existing).
|
|
@@ -1009,7 +1009,10 @@ async function executeTool(name: string, args: Record<string, any>): Promise<{ c
|
|
|
1009
1009
|
project_id: args.project_id || null,
|
|
1010
1010
|
});
|
|
1011
1011
|
|
|
1012
|
-
|
|
1012
|
+
const enabledFeatures = Object.entries(agent.features)
|
|
1013
|
+
.filter(([_, v]) => v === true || (typeof v === "object" && v?.enabled))
|
|
1014
|
+
.map(([k]) => k === "agents" ? "multi-agent (call_agent, delegate_task, list_available_agents)" : k);
|
|
1015
|
+
return { content: [{ type: "text", text: `Agent created successfully:\n${JSON.stringify({ id: agent.id, name: agent.name, provider: agent.provider, model: agent.model, features: enabledFeatures.length > 0 ? enabledFeatures.join(", ") : "none" }, null, 2)}` }] };
|
|
1013
1016
|
}
|
|
1014
1017
|
|
|
1015
1018
|
case "update_agent": {
|
|
@@ -1074,7 +1077,37 @@ async function executeTool(name: string, args: Record<string, any>): Promise<{ c
|
|
|
1074
1077
|
}
|
|
1075
1078
|
|
|
1076
1079
|
const updated = AgentDB.update(args.agent_id, updates);
|
|
1077
|
-
|
|
1080
|
+
|
|
1081
|
+
// Push config to running agent (live update, no restart needed)
|
|
1082
|
+
let configPushed = false;
|
|
1083
|
+
if (updated && updated.status === "running" && updated.port) {
|
|
1084
|
+
const providerKey = ProviderKeys.getDecrypted(updated.provider);
|
|
1085
|
+
if (providerKey) {
|
|
1086
|
+
const config = buildAgentConfig(updated, providerKey);
|
|
1087
|
+
const configResult = await pushConfigToAgent(updated.id, updated.port, config);
|
|
1088
|
+
configPushed = configResult.success;
|
|
1089
|
+
// Push skills if any
|
|
1090
|
+
if (config.skills?.definitions?.length > 0) {
|
|
1091
|
+
await pushSkillsToAgent(updated.id, updated.port, config.skills.definitions);
|
|
1092
|
+
}
|
|
1093
|
+
}
|
|
1094
|
+
}
|
|
1095
|
+
|
|
1096
|
+
// Build a clear summary of what changed
|
|
1097
|
+
const summary: Record<string, any> = { id: updated?.id, name: updated?.name };
|
|
1098
|
+
if (updates.features) {
|
|
1099
|
+
const enabledFeatures = Object.entries(updates.features)
|
|
1100
|
+
.filter(([_, v]) => v === true || (typeof v === "object" && v?.enabled))
|
|
1101
|
+
.map(([k]) => k === "agents" ? "multi-agent (call_agent, delegate_task, list_available_agents)" : k);
|
|
1102
|
+
summary.features = enabledFeatures.join(", ") || "none";
|
|
1103
|
+
}
|
|
1104
|
+
if (updates.skills !== undefined) summary.skills = updates.skills.length + " skills";
|
|
1105
|
+
if (updates.mcp_servers !== undefined) summary.mcp_servers = updates.mcp_servers.length + " servers";
|
|
1106
|
+
if (updates.name) summary.name = updates.name;
|
|
1107
|
+
if (updates.model) summary.model = updates.model;
|
|
1108
|
+
if (updates.system_prompt) summary.system_prompt = "updated";
|
|
1109
|
+
if (configPushed) summary.config_status = "applied live (no restart needed)";
|
|
1110
|
+
return { content: [{ type: "text", text: `Agent updated: ${JSON.stringify(summary, null, 2)}` }] };
|
|
1078
1111
|
}
|
|
1079
1112
|
|
|
1080
1113
|
case "delete_agent": {
|