You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
32 lines
922 B
32 lines
922 B
import type { AgentInvocation, AgentInvocationResult } from "./types";
|
|
import { getAgentBySlug } from "./agent";
|
|
import log4js from "logger";
|
|
|
|
const logger = log4js.getLogger("APP");
|
|
|
|
export async function invokeAgent(invocation: AgentInvocation): Promise<AgentInvocationResult> {
|
|
const { agentSlug, input, context } = invocation;
|
|
|
|
const agent = await getAgentBySlug(agentSlug);
|
|
if (!agent) {
|
|
return { agentSlug, output: "", ok: false, error: `agent not found: ${agentSlug}` };
|
|
}
|
|
|
|
if (!agent.isCallable) {
|
|
return { agentSlug, output: "", ok: false, error: `agent not callable: ${agentSlug}` };
|
|
}
|
|
|
|
logger.warn(
|
|
"[COLLAB] invokeAgent stub called agentSlug=%s inputLen=%d context=%j — orchestration not yet implemented",
|
|
agentSlug,
|
|
input.length,
|
|
context ?? {},
|
|
);
|
|
|
|
return {
|
|
agentSlug,
|
|
output: "",
|
|
ok: false,
|
|
error: "agent orchestration not yet implemented",
|
|
};
|
|
}
|
|
|