@browserbasehq/browse-cli 0.5.0-alpha-666baf1 → 0.5.0

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.
Files changed (2) hide show
  1. package/dist/index.js +8 -84
  2. package/package.json +1 -1
package/dist/index.js CHANGED
@@ -164843,9 +164843,6 @@ function getLocalConfigPath(session) {
164843
164843
  function getLocalInfoPath(session) {
164844
164844
  return path11.join(SOCKET_DIR, `browse-${session}.local-info`);
164845
164845
  }
164846
- function getSessionParamsPath(session) {
164847
- return path11.join(SOCKET_DIR, `browse-${session}.session-params`);
164848
- }
164849
164846
  async function readLocalConfig(session) {
164850
164847
  try {
164851
164848
  const raw = await import_fs11.promises.readFile(getLocalConfigPath(session), "utf-8");
@@ -165102,8 +165099,7 @@ async function cleanupStaleFiles(session) {
165102
165099
  // Client-written config, only cleaned on full shutdown
165103
165100
  getContextPath(session),
165104
165101
  getConnectPath(session),
165105
- getLocalConfigPath(session),
165106
- getSessionParamsPath(session)
165102
+ getLocalConfigPath(session)
165107
165103
  ];
165108
165104
  for (const file2 of files) {
165109
165105
  try {
@@ -165180,12 +165176,6 @@ async function runDaemon(session, headless) {
165180
165176
  connectSessionId = (await import_fs11.promises.readFile(getConnectPath(session), "utf-8")).trim();
165181
165177
  } catch {
165182
165178
  }
165183
- let sessionParams = {};
165184
- try {
165185
- const raw = await import_fs11.promises.readFile(getSessionParamsPath(session), "utf-8");
165186
- sessionParams = JSON.parse(raw);
165187
- } catch {
165188
- }
165189
165179
  let localLaunchOptions;
165190
165180
  let localInfo;
165191
165181
  if (!useBrowserbase) {
@@ -165210,19 +165200,14 @@ async function runDaemon(session, headless) {
165210
165200
  keepAlive: true
165211
165201
  } : {},
165212
165202
  ...!connectSessionId ? {
165213
- browserbaseSessionCreateParams: (() => {
165214
- const sessionBrowserSettings = sessionParams.browserSettings || {};
165215
- const { browserSettings: _2, ...sessionParamsWithoutBS } = sessionParams;
165216
- void _2;
165217
- return {
165218
- userMetadata: { browse_cli: "true" },
165219
- ...sessionParamsWithoutBS,
165203
+ browserbaseSessionCreateParams: {
165204
+ userMetadata: { browse_cli: "true" },
165205
+ ...contextConfig ? {
165220
165206
  browserSettings: {
165221
- ...sessionBrowserSettings,
165222
- ...contextConfig ? { context: contextConfig } : {}
165207
+ context: contextConfig
165223
165208
  }
165224
- };
165225
- })()
165209
+ } : {}
165210
+ }
165226
165211
  } : {}
165227
165212
  } : {
165228
165213
  localBrowserLaunchOptions: localLaunchOptions
@@ -166034,24 +166019,6 @@ function getSession(opts) {
166034
166019
  function isHeadless(opts) {
166035
166020
  return opts.headless === true && opts.headed !== true;
166036
166021
  }
166037
- function buildSessionParamsFromOpts(opts) {
166038
- const params = {};
166039
- const browserSettings = {};
166040
- if (opts.proxies) params.proxies = true;
166041
- if (opts.region) params.region = opts.region;
166042
- if (opts.keepAlive) params.keepAlive = true;
166043
- if (opts.sessionTimeout !== void 0) params.timeout = opts.sessionTimeout;
166044
- if (opts.advancedStealth) browserSettings.advancedStealth = true;
166045
- if (opts.blockAds) browserSettings.blockAds = true;
166046
- if (opts.solveCaptchas !== void 0) {
166047
- browserSettings.solveCaptchas = opts.solveCaptchas;
166048
- }
166049
- if (Object.keys(browserSettings).length > 0) {
166050
- params.browserSettings = browserSettings;
166051
- }
166052
- if (Object.keys(params).length === 0) return null;
166053
- return params;
166054
- }
166055
166022
  function output(data, json2) {
166056
166023
  if (json2) {
166057
166024
  console.log(JSON.stringify(data, null, 2));
@@ -166106,29 +166073,6 @@ async function runCommand(command, args) {
166106
166073
  } catch {
166107
166074
  }
166108
166075
  }
166109
- const sessionParams = buildSessionParamsFromOpts(opts);
166110
- if (sessionParams) {
166111
- const desiredMode = await getDesiredMode(session);
166112
- if (desiredMode !== "browserbase") {
166113
- console.error(
166114
- JSON.stringify({
166115
- error: "Session flags (--proxies, --advanced-stealth, etc.) are only supported in remote mode. Run 'browse env remote' first."
166116
- })
166117
- );
166118
- process.exit(1);
166119
- }
166120
- const paramsPath = getSessionParamsPath(session);
166121
- const newParamsJson = JSON.stringify(sessionParams);
166122
- let currentParamsJson = "";
166123
- try {
166124
- currentParamsJson = await import_fs11.promises.readFile(paramsPath, "utf-8");
166125
- } catch {
166126
- }
166127
- await import_fs11.promises.writeFile(paramsPath, newParamsJson);
166128
- if (currentParamsJson !== newParamsJson && await isDaemonRunning(session)) {
166129
- await stopDaemonAndCleanup(session);
166130
- }
166131
- }
166132
166076
  await ensureDaemon(session, headless);
166133
166077
  return sendCommand(session, command, args, headless);
166134
166078
  }
@@ -166141,19 +166085,6 @@ program.name("browse").description("Browser automation CLI for AI agents").versi
166141
166085
  ).option(
166142
166086
  "--connect <session-id>",
166143
166087
  "Connect to an existing Browserbase session by ID"
166144
- ).option("--proxies", "Enable Browserbase proxy (remote only)").option("--advanced-stealth", "Enable advanced stealth mode (remote only)").option("--solve-captchas", "Enable automatic CAPTCHA solving (remote only)").option(
166145
- "--no-solve-captchas",
166146
- "Disable automatic CAPTCHA solving (remote only)"
166147
- ).option("--block-ads", "Enable ad blocking (remote only)").option(
166148
- "--region <region>",
166149
- "Session region: us-west-2, us-east-1, eu-central-1, ap-southeast-1 (remote only)"
166150
- ).option(
166151
- "--keep-alive",
166152
- "Keep session alive after disconnection (remote only)"
166153
- ).option(
166154
- "--session-timeout <seconds>",
166155
- "Session timeout in seconds (remote only)",
166156
- parseInt
166157
166088
  );
166158
166089
  program.command("start").description("Start browser daemon (auto-started by other commands)").action(async () => {
166159
166090
  const opts = program.opts();
@@ -166213,12 +166144,6 @@ program.command("status").description("Check daemon status").action(async () =>
166213
166144
  };
166214
166145
  }
166215
166146
  }
166216
- let sessionParams = null;
166217
- try {
166218
- const raw = await import_fs11.promises.readFile(getSessionParamsPath(session), "utf-8");
166219
- sessionParams = JSON.parse(raw);
166220
- } catch {
166221
- }
166222
166147
  console.log(
166223
166148
  JSON.stringify({
166224
166149
  running,
@@ -166226,8 +166151,7 @@ program.command("status").description("Check daemon status").action(async () =>
166226
166151
  wsUrl,
166227
166152
  mode,
166228
166153
  browserbaseSessionId,
166229
- ...localDetails,
166230
- ...sessionParams ? { sessionParams } : {}
166154
+ ...localDetails
166231
166155
  })
166232
166156
  );
166233
166157
  });
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@browserbasehq/browse-cli",
3
- "version": "0.5.0-alpha-666baf1",
3
+ "version": "0.5.0",
4
4
  "description": "Browser automation CLI for AI agents, built on Stagehand",
5
5
  "type": "commonjs",
6
6
  "license": "MIT",