@browserbasehq/browse-cli 0.3.0-alpha-e81dde715786d70e65524c8b7ce10e00a909efd9 → 0.3.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 (3) hide show
  1. package/dist/index.js +40 -10
  2. package/package.json +16 -15
  3. package/LICENSE +0 -21
package/dist/index.js CHANGED
@@ -114574,7 +114574,7 @@ var OpenAICUAClient = class extends AgentClient {
114574
114574
  const messageList = [];
114575
114575
  let finalMessage = "";
114576
114576
  this.reasoningItems.clear();
114577
- let inputItems = this.createInitialInputItems(instruction);
114577
+ let inputItems = await this.createInitialInputItems(instruction);
114578
114578
  let previousResponseId = void 0;
114579
114579
  let totalInputTokens = 0;
114580
114580
  let totalOutputTokens = 0;
@@ -114781,17 +114781,37 @@ var OpenAICUAClient = class extends AgentClient {
114781
114781
  isFunctionCallItem(item) {
114782
114782
  return item.type === "function_call" && "call_id" in item && "name" in item && "arguments" in item;
114783
114783
  }
114784
- createInitialInputItems(instruction) {
114785
- return [
114786
- {
114784
+ async createInitialInputItems(instruction) {
114785
+ const inputItems = [];
114786
+ if (this.userProvidedInstructions) {
114787
+ const systemMessage = {
114787
114788
  role: "system",
114788
114789
  content: this.userProvidedInstructions
114789
- },
114790
- {
114791
- role: "user",
114792
- content: instruction
114793
- }
114790
+ };
114791
+ inputItems.push(systemMessage);
114792
+ }
114793
+ const textInput = {
114794
+ type: "input_text",
114795
+ text: instruction
114796
+ };
114797
+ const userContent = [
114798
+ textInput
114794
114799
  ];
114800
+ const initialScreenshot = await this.captureInitialScreenshot();
114801
+ if (initialScreenshot) {
114802
+ const screenshotInput = {
114803
+ type: "input_image",
114804
+ image_url: initialScreenshot,
114805
+ detail: "high"
114806
+ };
114807
+ userContent.push(screenshotInput);
114808
+ }
114809
+ const userMessage = {
114810
+ role: "user",
114811
+ content: userContent
114812
+ };
114813
+ inputItems.push(userMessage);
114814
+ return inputItems;
114795
114815
  }
114796
114816
  async getAction(inputItems, previousResponseId) {
114797
114817
  try {
@@ -115050,6 +115070,16 @@ var OpenAICUAClient = class extends AgentClient {
115050
115070
  this.pendingContextNotes = [];
115051
115071
  return notes;
115052
115072
  }
115073
+ async captureInitialScreenshot() {
115074
+ if (!this.screenshotProvider) {
115075
+ return void 0;
115076
+ }
115077
+ try {
115078
+ return await this.captureScreenshot();
115079
+ } catch {
115080
+ return void 0;
115081
+ }
115082
+ }
115053
115083
  convertFunctionCallToAction(call) {
115054
115084
  try {
115055
115085
  const args = JSON.parse(call.arguments);
@@ -164590,7 +164620,7 @@ var import_child_process4 = require("child_process");
164590
164620
  var readline = __toESM(require("readline"));
164591
164621
 
164592
164622
  // package.json
164593
- var version3 = "0.3.0-alpha-e81dde715786d70e65524c8b7ce10e00a909efd9";
164623
+ var version3 = "0.3.0";
164594
164624
 
164595
164625
  // src/index.ts
164596
164626
  var program = new import_commander.Command();
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@browserbasehq/browse-cli",
3
- "version": "0.3.0-alpha-e81dde715786d70e65524c8b7ce10e00a909efd9",
3
+ "version": "0.3.0",
4
4
  "description": "Browser automation CLI for AI agents, built on Stagehand",
5
5
  "type": "commonjs",
6
6
  "license": "MIT",
@@ -41,13 +41,25 @@
41
41
  "README.md",
42
42
  "LICENSE"
43
43
  ],
44
+ "scripts": {
45
+ "build": "tsup",
46
+ "dev": "tsx src/index.ts",
47
+ "browse": "tsx src/index.ts",
48
+ "typecheck": "tsc --noEmit",
49
+ "eslint": "eslint .",
50
+ "lint": "cd ../.. && prettier --check packages/cli && cd packages/cli && pnpm run eslint && pnpm run typecheck",
51
+ "test": "vitest run",
52
+ "test:cli": "vitest run",
53
+ "test:watch": "vitest",
54
+ "prepublishOnly": "pnpm run build"
55
+ },
44
56
  "dependencies": {
57
+ "@browserbasehq/stagehand": "workspace:*",
45
58
  "commander": "^12.0.0",
46
59
  "dotenv": "^16.4.5",
47
60
  "pino": "^9.6.0",
48
61
  "pino-pretty": "^13.0.0",
49
- "ws": "^8.18.0",
50
- "@browserbasehq/stagehand": "3.2.1-alpha-e81dde715786d70e65524c8b7ce10e00a909efd9"
62
+ "ws": "^8.18.0"
51
63
  },
52
64
  "devDependencies": {
53
65
  "@types/node": "^20.11.30",
@@ -57,16 +69,5 @@
57
69
  "tsx": "^4.10.5",
58
70
  "typescript": "5.8.3",
59
71
  "vitest": "^4.0.8"
60
- },
61
- "scripts": {
62
- "build": "tsup",
63
- "dev": "tsx src/index.ts",
64
- "browse": "tsx src/index.ts",
65
- "typecheck": "tsc --noEmit",
66
- "eslint": "eslint .",
67
- "lint": "cd ../.. && prettier --check packages/cli && cd packages/cli && pnpm run eslint && pnpm run typecheck",
68
- "test": "vitest run",
69
- "test:cli": "vitest run",
70
- "test:watch": "vitest"
71
72
  }
72
- }
73
+ }
package/LICENSE DELETED
@@ -1,21 +0,0 @@
1
- MIT License
2
-
3
- Copyright (c) 2024 Browserbase Inc.
4
-
5
- Permission is hereby granted, free of charge, to any person obtaining a copy
6
- of this software and associated documentation files (the "Software"), to deal
7
- in the Software without restriction, including without limitation the rights
8
- to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
- copies of the Software, and to permit persons to whom the Software is
10
- furnished to do so, subject to the following conditions:
11
-
12
- The above copyright notice and this permission notice shall be included in all
13
- copies or substantial portions of the Software.
14
-
15
- THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
- IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
- FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
- AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
- LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
- OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
- SOFTWARE.