kimi-code / packages /agent-core-v2 /src /agent /tools /mainAgentOnly.ts
SaylorTwift's picture
SaylorTwift HF Staff
Add files using upload-large-folder tool
68d7816 verified
Raw History Blame Contribute Delete
614 Bytes
import type { ToolExecution } from '#/tool/toolContract';
import type { IAgentScopeContext } from '#/agent/scopeContext/scopeContext';
import { MAIN_AGENT_ID } from '#/session/agentLifecycle/agentLifecycle';
export const CRON_MAIN_AGENT_ONLY = 'Cron tools are only supported by the main agent.';
export const GOAL_MAIN_AGENT_ONLY = 'Goal tools are only supported by the main agent.';
export function mainAgentOnlyExecution(
scopeContext: IAgentScopeContext,
output: string,
): ToolExecution | undefined {
if (scopeContext.agentId === MAIN_AGENT_ID) return undefined;
return { isError: true, output };
}