File size: 614 Bytes
68d7816
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
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 };
}