import { build } from 'esbuild' await build({ entryPoints: ['src/main/agent/claude/claude-kernel.ts'], outfile: '.tmp/b03-real-kernel.mjs', bundle: true, platform: 'node', format: 'esm', external: ['@anthropic-ai/claude-agent-sdk'], logLevel: 'warning', banner: { js: `import { createRequire } from 'node:module'; const require = createRequire(import.meta.url);` }, plugins: [{ name: 'isolated-electron-paths-only', setup(plugin) { plugin.onResolve({ filter: /^electron$/ }, () => ({ path: 'electron', namespace: 'b03-test' })) plugin.onLoad({ filter: /.*/, namespace: 'b03-test' }, () => ({ loader: 'js', contents: ` export const app = { getPath: name => { if (name !== 'userData') throw new Error('Unexpected Electron path request'); return process.env.CLAUDE_TEST_USER_DATA }, getAppPath: () => process.cwd() }; export const safeStorage = { isEncryptionAvailable: () => false }; ` })) } }] })