Skip to content

Commit 1cf29b8

Browse files
authored
Merge pull request #68 from sanketsudake/helium-default-browser
Make Helium the browser these configs drive
2 parents e54cdee + 496f6cd commit 1cf29b8

10 files changed

Lines changed: 68 additions & 32 deletions

File tree

CLAUDE.md

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -163,8 +163,10 @@ Rules and docs reference scripts via `$CLAUDE_CONFIG_DIR/scripts/...` so the pat
163163
`claude/scripts/` currently holds `agent-routing-hook.sh` (the `PreToolUse` routing hook referenced by `rules/model-routing.md`),
164164
`safety-guard-hook.py` (a `PreToolUse` deny/ask gate on `Bash` and `Edit|Write` — the Claude-side twin of pi's `permission-gate.ts` + `protected-paths.ts`, referenced by `rules/git-hygiene.md`),
165165
`usage-log-hook.py` + `usage-report.py` (`SubagentStop`/`Stop`/`SessionEnd` telemetry into `$CLAUDE_CONFIG_DIR/usage.jsonl` and its aggregator, also referenced by `rules/model-routing.md`; `make usage-report` runs the aggregator for every profile),
166+
`browser-endpoint.sh` (prints the CDP endpoint of the user's browser, referenced by `claude/CLAUDE.md`),
166167
and `statusline-command.sh` (a `statusLine` hook script).
167-
None is symlinked-by-reference; a profile must opt in via its own `settings.json`, which is not tracked in this repo — each hook script's header carries its wiring snippet.
168+
No hook among them is wired by default; a profile must opt in via its own `settings.json`, which is not tracked in this repo — each hook script's header carries its wiring snippet.
169+
`browser-endpoint.sh` is a plain helper instead: it is invoked by path and needs no wiring.
168170
Agents are single `.md` files fetched and tracked by `resource-manager.sh` (see "Skill & agent source management").
169171
- **`plugins.txt` is desired-state only.**
170172
Installation is manual per-profile; the Makefile only reports drift.

claude/CLAUDE.md

Lines changed: 10 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -36,17 +36,13 @@ It preserves rendered output, code blocks, tables, and frontmatter.
3636

3737
# Interacting with browser
3838

39-
- Default to `/agent-browser` for browser work.
40-
For my running Chrome (live logins), attach with `--cdp 9222 --pin-tab`;
41-
that needs Chrome launched with `--remote-debugging-port=9222` (`open -a "Google Chrome" --args --remote-debugging-port=9222`, no consent prompt).
42-
The `chrome://inspect` toggle serves no `/json` discovery, so `--cdp 9222` and `--auto-connect` time out there;
43-
pass the browser WebSocket URL from Chrome's `DevToolsActivePort` file to `--cdp` instead.
44-
For a detached or headless browser, use its own named session.
45-
- Use `/drive-chrome-cdp` (`chrome-cdp`) when a skill names it (the Workday, Engage, and Microsoft-SSO skills)
46-
or when the task needs its primitives:
47-
`wait --request`, cascade `select`, `fill --by cell`, `--in-row`, `grid`, `recipe`, exit-code branching.
48-
On the `chrome://inspect` path, `--endpoint ws://…` (the URL from `DevToolsActivePort`) attaches where port discovery fails.
49-
For parallel agents on one Chrome, `--session <name>` namespaces the sticky current tab so they do not steal each other's tab.
50-
- Both tools attach to my real Chrome and can raise one "Allow remote debugging?" consent prompt;
51-
run one probe and wait for it, do not stack probes.
52-
- Type no credentials in either tool; stop at a login or passkey page and ask me to sign in.
39+
- My browser is **Helium**, not Chrome; it holds the live logins.
40+
Read "the user's real Chrome" in any skill as Helium.
41+
- Attach to the running browser; never launch a new one.
42+
`$CLAUDE_CONFIG_DIR/scripts/browser-endpoint.sh` prints the CDP endpoint to pass explicitly —
43+
port-only attach times out.
44+
If the script fails, ask me to enable `helium://inspect/#remote-debugging`.
45+
- Default to `/agent-browser`; use `/drive-chrome-cdp` when a skill names it or needs its primitives.
46+
- Attaching raises one consent prompt per session:
47+
start the `chrome-cdp` daemon, run one probe, and wait — do not stack probes.
48+
- Type no credentials; stop at a login or passkey page and ask me to sign in.

claude/scripts/browser-endpoint.sh

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
#!/usr/bin/env bash
2+
# Print the CDP browser WebSocket endpoint of the user's browser (Helium).
3+
#
4+
# Helium is a Chromium fork; its remote-debugging port file is its own, not
5+
# Chrome's, so tools that default to Chrome's path fail with connection_failed.
6+
# The port file appears only after the user enables the toggle at
7+
# helium://inspect/#remote-debugging (no restart; tabs and logins survive).
8+
# That toggle serves no /json discovery, so port-only attach (--cdp 9222,
9+
# --auto-connect) times out; pass this endpoint explicitly instead.
10+
#
11+
# Usage:
12+
# EP="$("$CLAUDE_CONFIG_DIR"/scripts/browser-endpoint.sh)" || ask the user to enable the toggle
13+
# chrome-cdp daemon start --endpoint "$EP" --json
14+
# agent-browser --cdp "$EP" --pin-tab
15+
#
16+
# Exit 1 with a message on stderr when the port file is absent.
17+
set -euo pipefail
18+
19+
PORT_FILE="${HELIUM_DEVTOOLS_PORT_FILE:-$HOME/Library/Application Support/net.imput.helium/DevToolsActivePort}"
20+
21+
if [ ! -s "$PORT_FILE" ]; then
22+
echo "browser-endpoint: no port file at $PORT_FILE" >&2
23+
echo "browser-endpoint: ask the user to enable helium://inspect/#remote-debugging" >&2
24+
exit 1
25+
fi
26+
27+
port="$(head -1 "$PORT_FILE")"
28+
path="$(sed -n 2p "$PORT_FILE")"
29+
echo "ws://127.0.0.1:${port}${path}"

skills/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -91,7 +91,7 @@ Generated by `make skills-catalog` — do not edit by hand (`make skills-doctor`
9191
| [`drive-chrome-cdp`](https://github.com/sanketsudake/chrome-cdp-cli/tree/deee3056260e6dea5f182760e3559d79a7222291/skills/drive-chrome-cdp) | Drive the user's real, already-running local Chrome — its live tabs, logins, and cookies, so it types no credentials — from the shell via the `chrome-cdp` CL... |
9292
| [`fill-workday-timesheet`](fill-workday-timesheet/SKILL.md) | Fills in the user's Workday timesheet: hours per weekday against a project for one week or every unfilled week up to a date, review-first, showing the planne... |
9393
| [`list-week-meetings`](list-week-meetings/SKILL.md) | Lists a week's meetings from the Outlook (Microsoft 365) web calendar, grouped by day with time, title, organizer, online/in-person status, and meeting status. |
94-
| [`login-microsoft-sso`](login-microsoft-sso/SKILL.md) | Ensures a Chrome tab is signed in to an app behind your organization's Microsoft (Entra) SSO (e.g. Workday, Engage, Outlook), driven by the `chrome-cdp` CLI ... |
94+
| [`login-microsoft-sso`](login-microsoft-sso/SKILL.md) | Ensures a browser tab is signed in to an app behind your organization's Microsoft (Entra) SSO (e.g. Workday, Engage, Outlook), driven by the `chrome-cdp` CLI... |
9595
| [`record-engage-activity`](record-engage-activity/SKILL.md) | Fills and submits the Engage Add Activity form (category, type, date, quantity, notes) via the chrome-cdp CLI, showing the entry and points before submitting. |
9696

9797
## knowledge-base

skills/apply-workday-leave/SKILL.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ description: >-
66
reconciles the timesheet so the leave day carries no project hours.
77
Use when the user wants to apply leave, absence, sick leave, casual leave,
88
planned leave, or comp off in Workday, or invokes /apply-workday-leave.
9-
Drives the user's real Chrome via the chrome-cdp CLI and logs in through
9+
Drives the user's real browser via the chrome-cdp CLI and logs in through
1010
login-microsoft-sso.
1111
disable-model-invocation: true
1212
license: Apache-2.0
@@ -17,7 +17,7 @@ metadata:
1717

1818
# Apply Workday Leave
1919

20-
This skill automates the Workday **Request Absence** flow via **`chrome-cdp`** on the user's real, logged-in Chrome.
20+
This skill automates the Workday **Request Absence** flow via **`chrome-cdp`** on the user's real, logged-in browser.
2121
It requests absence for given dates and type, shows the plan, and waits for confirmation before submitting — then checks the timesheet and clears any project hours already entered.
2222
Submitting writes real data and notifies the approver; never submit without explicit confirmation.
2323

skills/approve-workday-tasks/SKILL.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ description: >-
66
Use when the user wants to review or approve pending Workday tasks,
77
invoked as /approve-workday-tasks, or mentions Workday "My Tasks",
88
pending approvals, Time Entry Approval, or the chrome-cdp CLI.
9-
Drives the user's real Chrome via chrome-cdp and logs in through
9+
Drives the user's real browser via chrome-cdp and logs in through
1010
login-microsoft-sso.
1111
disable-model-invocation: true
1212
license: Apache-2.0
@@ -17,7 +17,7 @@ metadata:
1717

1818
# Approve Workday Tasks
1919

20-
Automates the Workday **My Tasks** approval flow with review first, using **`chrome-cdp`** on the user's real, logged-in Chrome.
20+
Automates the Workday **My Tasks** approval flow with review first, using **`chrome-cdp`** on the user's real, logged-in browser.
2121
It lists pending items and approves only the ones the user selects.
2222
Never approve an item the user did not explicitly choose.
2323

skills/fill-workday-timesheet/SKILL.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ description: >-
88
Use when the user wants to fill in their Workday timesheet ("fill my
99
timesheet", "make sure time is entered through the 15th"), invoked as
1010
/fill-workday-timesheet.
11-
Drives the user's real Chrome via the chrome-cdp CLI, logging in through
11+
Drives the user's real browser via the chrome-cdp CLI, logging in through
1212
login-microsoft-sso.
1313
disable-model-invocation: true
1414
license: Apache-2.0
@@ -19,7 +19,7 @@ metadata:
1919

2020
# Fill Workday Timesheet
2121

22-
Automates Workday's **Enter Time** flow with the **`chrome-cdp`** CLI, in the user's real, logged-in Chrome.
22+
Automates Workday's **Enter Time** flow with the **`chrome-cdp`** CLI, in the user's real, logged-in browser.
2323
For each week in scope, it proposes hours per weekday against a project, shows the whole plan, and waits for confirmation before saving.
2424
Entering time writes real data.
2525

skills/list-week-meetings/SKILL.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ description: >-
66
meeting status.
77
Use when the user asks for their week's meetings, "what's on my calendar
88
this week", a meeting list, or invokes /list-week-meetings.
9-
Drives the user's real, logged-in Chrome via the chrome-cdp CLI and logs
9+
Drives the user's real, logged-in browser via the chrome-cdp CLI and logs
1010
in through login-microsoft-sso (app outlook).
1111
Read-only — never creates, edits, or deletes calendar events.
1212
disable-model-invocation: true
@@ -19,7 +19,7 @@ metadata:
1919
# List Week Meetings
2020

2121
This skill reads a week's meetings from the Outlook web calendar.
22-
It uses the `chrome-cdp` CLI to drive the user's real, logged-in Chrome browser.
22+
It uses the `chrome-cdp` CLI to drive the user's real, logged-in browser.
2323
It groups events by day.
2424
It does not create, edit, or delete any event.
2525

skills/login-microsoft-sso/SKILL.md

Lines changed: 16 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
---
22
name: login-microsoft-sso
33
description: >-
4-
Ensures a Chrome tab is signed in to an app behind your organization's
4+
Ensures a browser tab is signed in to an app behind your organization's
55
Microsoft (Entra) SSO (e.g. Workday, Engage, Outlook), driven by the
6-
`chrome-cdp` CLI on the user's real, already-logged-in Chrome — so it
6+
`chrome-cdp` CLI on the user's real, already-logged-in browser — so it
77
types no credentials.
88
Use when another skill or task needs a logged-in tab before automating
99
Workday, Engage, or Outlook web, or when the user runs
@@ -19,8 +19,8 @@ metadata:
1919

2020
# Login to an SSO app (Microsoft-federated)
2121

22-
Ensure a Chrome tab is signed in to an app behind your organization's **Microsoft (Entra) SSO**.
23-
Use the **`chrome-cdp`** CLI on the user's real, already signed-in Chrome — this skill types **no** credentials.
22+
Ensure a browser tab is signed in to an app behind your organization's **Microsoft (Entra) SSO**.
23+
Use the **`chrome-cdp`** CLI on the user's real, already signed-in browser — this skill types **no** credentials.
2424

2525
> See **`drive-chrome-cdp`** for CLI setup, output contract, and the passkey rule.
2626
> Local skill, maintained in this repo (`.source.json` has `"repo": null`).
@@ -44,8 +44,17 @@ All commands take `--json`.
4444
Parse the envelope and branch on the exit code (see `drive-chrome-cdp`).
4545

4646
1. **Connection.**
47-
Run `chrome-cdp doctor --json`.
48-
If `ok:false` (connection_failed), tell the user to enable `chrome://inspect/#remote-debugging`, then re-run.
47+
`doctor` defaults to Chrome's port file, and the user's browser is Helium —
48+
so pass the endpoint and start the daemon first (one consent prompt per session):
49+
50+
```sh
51+
EP="$("$CLAUDE_CONFIG_DIR"/scripts/browser-endpoint.sh)"
52+
chrome-cdp daemon start --endpoint "$EP" --json
53+
```
54+
55+
Then run `chrome-cdp doctor --json`.
56+
If the script fails, or `ok:false` (connection_failed),
57+
tell the user to enable `helium://inspect/#remote-debugging`, then re-run.
4958
Do not proceed until ready.
5059
2. **Pick a tab.**
5160
Run `chrome-cdp list --url "<app host>" --json` (filters, so it skips scanning the full list).
@@ -77,7 +86,7 @@ Parse the envelope and branch on the exit code (see `drive-chrome-cdp`).
7786

7887
## Output
7988

80-
The Chrome tab id (from `list` or `use`), signed in to the app.
89+
The browser tab id (from `list` or `use`), signed in to the app.
8190
Reuse it via `--target <id>` (or the sticky `use`).
8291

8392
## Safety

skills/record-engage-activity/SKILL.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ metadata:
2222

2323
# Record Engage Activity
2424

25-
Assisted, review-first automation of the Engage **Add Activity** form, driven by the **`chrome-cdp`** CLI (the user's real, logged-in Chrome).
25+
Assisted, review-first automation of the Engage **Add Activity** form, driven by the **`chrome-cdp`** CLI (the user's real, logged-in browser).
2626
It fills category, type, date, quantity, and notes, then shows the entry and points before submitting.
2727
Submit only after the user confirms — it writes real data and points.
2828

0 commit comments

Comments
 (0)