()
| 66 | let liveRoot: Root | null = null |
| 67 | |
| 68 | export function installReplPerfEnvironment(): void { |
| 69 | if (!(globalThis as { MACRO?: MacroGlobals }).MACRO) { |
| 70 | ;(globalThis as { MACRO?: MacroGlobals }).MACRO = { |
| 71 | VERSION: '0.0.0-test', |
| 72 | VERSION_CHANGELOG: '', |
| 73 | BUILD_TIME: 'test', |
| 74 | } |
| 75 | } |
| 76 | |
| 77 | process.env.NODE_ENV ??= 'test' |
| 78 | |
| 79 | if (mocksInstalled) { |
| 80 | return |
| 81 | } |
| 82 | mocksInstalled = true |
| 83 | |
| 84 | mock.module('@ant/claude-for-chrome-mcp', () => ({ |
| 85 | BROWSER_TOOLS: [], |
| 86 | createClaudeForChromeMcpServer: () => ({ connect: async () => {} }), |
| 87 | })) |
| 88 | mock.module('@ant/computer-use-mcp', () => ({ |
| 89 | buildComputerUseTools: () => [], |
| 90 | bindSessionContext: () => {}, |
| 91 | DEFAULT_GRANT_FLAGS: [], |
| 92 | API_RESIZE_PARAMS: {}, |
| 93 | targetImageSize: () => ({ width: 0, height: 0 }), |
| 94 | })) |
| 95 | mock.module('@ant/computer-use-mcp/types', () => ({ |
| 96 | DEFAULT_GRANT_FLAGS: [], |
| 97 | })) |
| 98 | mock.module('@ant/computer-use-mcp/sentinelApps', () => ({ |
| 99 | getSentinelCategory: () => null, |
| 100 | })) |
| 101 | mock.module('@ant/computer-use-input', () => ({})) |
| 102 | mock.module('@ant/computer-use-swift', () => ({})) |
| 103 | } |
| 104 | |
| 105 | export async function cleanupMountedRepl(): Promise<void> { |
| 106 | if (liveRoot) { |
no outgoing calls