import { defineConfig } from "tsup";

const bundledWorkspaceDeps = ["@qjclaw/gateway-client", "@qjclaw/runtime-manager", "@qjclaw/shared-types"];

export default defineConfig([
  {
    clean: true,
    dts: false,
    entry: {
      index: "src/main/index.ts",
      "project-workspace-agent-runner": "src/main/project-workspace-agent-runner.ts"
    },
    external: ["electron"],
    noExternal: bundledWorkspaceDeps,
    format: ["cjs"],
    outDir: "dist/main",
    platform: "node",
    target: "node20"
  },
  {
    clean: false,
    dts: false,
    entry: {
      index: "src/preload/index.ts"
    },
    external: ["electron"],
    noExternal: bundledWorkspaceDeps,
    format: ["cjs"],
    outDir: "dist/preload",
    platform: "node",
    target: "node20"
  }
]);

