You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: skills/lexmount-browser/SKILL.md
+18-6Lines changed: 18 additions & 6 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -5,20 +5,32 @@ description: Use Lexmount cloud browsers to open and interact with JavaScript-he
5
5
6
6
# Lexmount Browser
7
7
8
+
Resolve `<skill-root>` to the directory containing this loaded `SKILL.md` with
9
+
the current Agent's Skill locator:
10
+
11
+
- Codex: use the absolute `SKILL.md` source path supplied in the Skill metadata.
12
+
- Claude Code: use `${CLAUDE_SKILL_DIR}`.
13
+
- WorkBuddy/CodeBuddy: use `${CODEBUDDY_SKILL_DIR}`.
14
+
15
+
Do not infer `<skill-root>` from the working directory.
16
+
8
17
Select the native Rust binary for the current platform:
9
18
10
-
- macOS arm64: run `${CODEBUDDY_SKILL_DIR}/scripts/bootstrap.sh` when `${CODEBUDDY_SKILL_DIR}/bin/browser-cli` is missing, then use that file.
11
-
- Windows x64: run `${CODEBUDDY_SKILL_DIR}/scripts/bootstrap.ps1`when `${CODEBUDDY_SKILL_DIR}/bin/browser-cli.exe` is missing, then use that file.
19
+
- macOS arm64: run `sh "<skill-root>/scripts/bootstrap.sh"` when `<skill-root>/bin/browser-cli` is missing, then invoke `"<skill-root>/bin/browser-cli"`.
20
+
- Windows x64: run `& "<skill-root>\scripts\bootstrap.ps1"` in PowerShell when `<skill-root>\bin\browser-cli.exe` is missing, then invoke `& "<skill-root>\bin\browser-cli.exe"`.
12
21
13
22
Both bootstrap scripts download the fixed release version from Tencent Cloud COS and verify its SHA-256 digest.
23
+
The Agent-specific locator is needed to form the initial absolute command. Once
24
+
started, the bootstrap and doctor scripts locate the Skill directory from their
25
+
own file location.
14
26
15
-
Do not run the binary for the other platform. Both platform binaries emit JSON. The examples below abbreviate the selected path as `browser-cli`; resolve it before running commands.
27
+
Do not run the binary for the other platform. Both platform binaries emit JSON. The examples below abbreviate the selected absolute path as `browser-cli`; resolve it before running commands and do not assume it is on `PATH`.
16
28
17
29
## Setup
18
30
19
-
1.On macOS arm64, run `bootstrap.sh` if `bin/browser-cli` is missing, then run `doctor.sh`.
20
-
2.On Windows x64, run `bootstrap.ps1`if `bin/browser-cli.exe` is missing, then run `doctor.ps1`.
21
-
3. If credentials are missing, run `browser-cli auth login`. Let the user approve in their browser. Never ask them to paste an API key into chat.
31
+
1.Resolve `<skill-root>` from this `SKILL.md` and select the matching platform paths above.
32
+
2.Run the Skill-local bootstrap script if the binary is missing. Then run `sh "<skill-root>/scripts/doctor.sh"` on macOS arm64 or `& "<skill-root>\scripts\doctor.ps1"` in Windows PowerShell.
33
+
3. If credentials are missing, run `browser-cli auth login`. Pass `--client-name "<agent-name>"` when the current Agent has a user-facing name; otherwise the CLI uses `Agent`. Let the user approve in their browser. Never ask them to paste an API key into chat.
22
34
4. Run `browser-cli doctor` again. Continue only when `ready_for_browser_actions` is true.
23
35
24
36
Read [authentication.md](references/authentication.md) only when login or credentials fail. Read [commands.md](references/commands.md) when selecting commands. Read [troubleshooting.md](references/troubleshooting.md) only after an error.
Copy file name to clipboardExpand all lines: skills/lexmount-browser/references/authentication.md
+6-2Lines changed: 6 additions & 2 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -3,9 +3,13 @@
3
3
Preferred login:
4
4
5
5
```text
6
-
browser-cli auth login
6
+
browser-cli auth login [--client-name "NAME"]
7
7
```
8
8
9
+
The default client name is `Agent`. Quote and pass the current Agent's
10
+
user-facing name when available; for example, WorkBuddy can pass
11
+
`--client-name "WorkBuddy"`.
12
+
9
13
The CLI binds a random loopback port on `127.0.0.1`, creates a PKCE verifier and state, opens the Lexmount approval page, exchanges the returned one-time code, and stores the scoped credential in:
10
14
11
15
```text
@@ -14,6 +18,6 @@ The CLI binds a random loopback port on `127.0.0.1`, creates a PKCE verifier and
14
18
15
19
The file is mode `0600` on Unix. The CLI redacts the API key from all JSON output.
16
20
17
-
For managed environments, the SDK also accepts `LEXMOUNT_API_KEY`, `LEXMOUNT_PROJECT_ID`, optional `LEXMOUNT_BASE_URL`, and optional `LEXMOUNT_REGION`. Do not ask users to paste secret values into WorkBuddy chat.
21
+
For managed environments, the SDK also accepts `LEXMOUNT_API_KEY`, `LEXMOUNT_PROJECT_ID`, optional `LEXMOUNT_BASE_URL`, and optional `LEXMOUNT_REGION`. Do not ask users to paste secret values into an Agent chat.
18
22
19
23
Use `browser-cli auth logout` to remove only the local credential file. Environment variables are managed outside the CLI.
Copy file name to clipboardExpand all lines: skills/lexmount-browser/references/troubleshooting.md
+2-1Lines changed: 2 additions & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -7,6 +7,7 @@ Run `browser-cli doctor` first and use the failed check's message.
7
7
-`conflict`: a read-write Context is already locked. Use another Context, wait for the active session, or use read-only mode. Force-release only after confirming the session is dead.
8
8
-`timeout`: inspect session status and network access, then retry with a larger timeout.
9
9
-`cdp_error`: verify the session is active, inspect `session targets`, and take a snapshot before retrying the action.
10
-
- command not found after bootstrap: use the Skill-local binary under `${CODEBUDDY_SKILL_DIR}/bin/`; no PATH change or restart is required.
10
+
- Skill root unknown: resolve the directory containing the loaded `SKILL.md` with the current host's locator: Codex supplies its absolute source path in the Skill metadata, Claude Code provides `${CLAUDE_SKILL_DIR}`, and WorkBuddy/CodeBuddy provides `${CODEBUDDY_SKILL_DIR}`. Do not infer it from the working directory or search the user's home directory.
11
+
- command not found after bootstrap: invoke `"<skill-root>/bin/browser-cli"` on macOS arm64 or `& "<skill-root>\bin\browser-cli.exe"` in Windows PowerShell; no PATH change or restart is required.
11
12
12
13
Always close a newly created temporary session when abandoning a failed task.
constLOGIN_SUCCESS_PAGE:&str = "<!doctype html><meta charset=utf-8><title>Lexmount connected</title><h1>Lexmount connected</h1><p>You can close this window and return to your agent.</p>";
21
23
22
24
#[derive(Debug,Clone,Serialize,Deserialize)]
23
25
pubstructCredentials{
@@ -143,6 +145,24 @@ pub fn login(
143
145
timeout:Duration,
144
146
open_browser:bool,
145
147
path:Option<&Path>,
148
+
) -> Result<Value>{
149
+
login_with_client_name(
150
+
project_id,
151
+
DEFAULT_CLIENT_NAME,
152
+
connect_base_url,
153
+
timeout,
154
+
open_browser,
155
+
path,
156
+
)
157
+
}
158
+
159
+
pubfnlogin_with_client_name(
160
+
project_id:Option<&str>,
161
+
client_name:&str,
162
+
connect_base_url:&str,
163
+
timeout:Duration,
164
+
open_browser:bool,
165
+
path:Option<&Path>,
146
166
) -> Result<Value>{
147
167
let listener = TcpListener::bind("127.0.0.1:0")?;
148
168
listener.set_nonblocking(true)?;
@@ -153,32 +173,14 @@ pub fn login(
153
173
let verifier = random_urlsafe(32);
154
174
let challenge = URL_SAFE_NO_PAD.encode(Sha256::digest(verifier.as_bytes()));
155
175
let state = random_urlsafe(24);
156
-
let scopes = DEFAULT_SCOPES
157
-
.iter()
158
-
.map(|v| (*v).to_owned())
159
-
.collect::<Vec<_>>();
160
-
161
-
letmut url = Url::parse(&format!(
162
-
"{}/connect/codex",
163
-
connect_base_url.trim_end_matches('/')
164
-
))
165
-
.map_err(|e| Error::Config(format!("invalid connect base URL: {e}")))?;
let c = extract_api_key(&json!({"credential":{"projectId":"p1","apiKey":"secret","apiBaseUrl":"https://api.example","scope":"browser:sessions browser:actions"}})).unwrap();
0 commit comments