prospect-ai-agent 1.0.0 → 1.0.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -6,13 +6,23 @@ export class BrowserManager {
6
6
  context = null;
7
7
  async launchForTask(cookies) {
8
8
  log.info("Launching headless Chromium for task...");
9
- this.browser = await chromium.launch({
10
- headless: true,
11
- args: [
12
- "--disable-blink-features=AutomationControlled",
13
- "--no-sandbox",
14
- ],
15
- });
9
+ try {
10
+ this.browser = await chromium.launch({
11
+ headless: true,
12
+ args: [
13
+ "--disable-blink-features=AutomationControlled",
14
+ "--no-sandbox",
15
+ ],
16
+ });
17
+ }
18
+ catch (err) {
19
+ const msg = err.message;
20
+ if (msg.includes("Executable doesn't exist") || msg.includes("browserType.launch")) {
21
+ log.error("Chromium browser is not installed. Run: npx playwright install chromium");
22
+ throw new Error("Chromium not installed");
23
+ }
24
+ throw err;
25
+ }
16
26
  this.context = await this.browser.newContext({
17
27
  viewport: { width: 1280, height: 900 },
18
28
  userAgent: "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/120.0.0.0 Safari/537.36",
package/dist/index.js CHANGED
@@ -6,7 +6,7 @@ import { ApiClient } from "./api-client.js";
6
6
  import { Agent } from "./agent.js";
7
7
  import { runLogin } from "./login.js";
8
8
  import { log } from "./logger.js";
9
- const VERSION = "1.0.0";
9
+ const VERSION = "1.0.1";
10
10
  const DEFAULT_SERVER = "http://localhost:3000";
11
11
  const program = new Command();
12
12
  program
package/dist/login.js CHANGED
@@ -10,7 +10,21 @@ export async function runLogin(serverUrl, token) {
10
10
  const browser = new BrowserManager();
11
11
  log.info("Opening LinkedIn login page in headed browser...");
12
12
  log.info("Please log in to your LinkedIn account.\n");
13
- const { page, context } = await browser.launchHeaded();
13
+ let page, context;
14
+ try {
15
+ ({ page, context } = await browser.launchHeaded());
16
+ }
17
+ catch (err) {
18
+ const msg = err.message;
19
+ if (msg.includes("Executable doesn't exist") || msg.includes("browserType.launch")) {
20
+ log.error("Chromium browser is not installed.");
21
+ log.info("Run this command to install it:\n");
22
+ log.info(" npx playwright install chromium\n");
23
+ log.info("Then try 'login' again.");
24
+ process.exit(1);
25
+ }
26
+ throw err;
27
+ }
14
28
  await page.goto(LINKEDIN_LOGIN_URL, { waitUntil: "domcontentloaded" });
15
29
  log.info("Waiting for you to complete login...");
16
30
  log.info("(The browser will close automatically once logged in)\n");
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "prospect-ai-agent",
3
- "version": "1.0.0",
3
+ "version": "1.0.1",
4
4
  "description": "ProspectAI Desktop Agent — browser automation for campaigns (no Chrome extension)",
5
5
  "type": "module",
6
6
  "main": "dist/index.js",
@@ -23,7 +23,8 @@
23
23
  "build:binaries": "npm run build && node build-binaries.mjs",
24
24
  "build:mac": "npm run build && npx pkg dist/index.js --target node18-macos-arm64 --output binaries/prospect-ai-agent-macos --compress GZip",
25
25
  "build:win": "npm run build && npx pkg dist/index.js --target node18-win-x64 --output binaries/prospect-ai-agent-win.exe --compress GZip",
26
- "prepublishOnly": "npm run build"
26
+ "prepublishOnly": "npm run build",
27
+ "postinstall": "npx playwright install chromium 2>/dev/null || echo 'Note: Run npx playwright install chromium if browser launch fails.'"
27
28
  },
28
29
  "pkg": {
29
30
  "assets": [