Skip to content

Commit ecec14b

Browse files
Testclaude
andcommitted
Fix: replace dynamic require() with static imports in mcp-api
The dynamic require('./account') and require('./capabilities') calls broke after vite bundled everything into main.js — no separate files exist at runtime to resolve against. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
1 parent 55997d8 commit ecec14b

1 file changed

Lines changed: 2 additions & 3 deletions

File tree

electron/mcp-api.ts

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,9 @@
11
import { createServer, IncomingMessage, ServerResponse } from 'http'
2-
import { getAllCapabilities, getCapability } from './capabilities'
2+
import { getAllCapabilities, getCapability, updateCapability } from './capabilities'
33
import { getAllSites, getSite, getSession } from './sites'
44
import { getAllDecryptedValues } from './vault'
55
import { isLocked } from './app-lock'
6+
import { isLicenseValid } from './account'
67
import { PlaywrightEngine } from '../core/browser/playwright-engine'
78
import { healSelector } from './healer'
89
import { store } from './store'
@@ -73,7 +74,6 @@ export function startMCPApi(): number {
7374
}
7475

7576
// Block execution when license is invalid
76-
const { isLicenseValid } = require('./account')
7777
if (!isLicenseValid()) {
7878
res.writeHead(402)
7979
res.end(JSON.stringify({
@@ -137,7 +137,6 @@ export function startMCPApi(): number {
137137
// Persist AI-healed locators back into the capability
138138
const healed = engine.getHealedLocators()
139139
if (healed.length > 0) {
140-
const { updateCapability } = require('./capabilities')
141140
const updatedActions = [...(cap.actions as any[])]
142141
for (const h of healed) {
143142
const idx = h.actionIndex

0 commit comments

Comments
 (0)