aboutsummaryrefslogtreecommitdiff
path: root/FORK.md
diff options
context:
space:
mode:
authorIgor Soarez <igor@soarez.org>2026-10-15 23:08:24 +0100
committerIgor Soarez <igor@soarez.org>2026-10-15 23:08:24 +0100
commit99d5702cb2ff0ead8e3a2b7a95fd057eefa89862 (patch)
treefd5b576c7f5216bffb6cf58cc5abc23f857782ce /FORK.md
parent63774bab8b2b6d7b4c96666bb87654f6b76354d5 (diff)
castle-search: pi-castle-cdp-search joins the fork as sz-chrome-remote-cdp
Diffstat (limited to 'FORK.md')
-rw-r--r--FORK.md42
1 files changed, 34 insertions, 8 deletions
diff --git a/FORK.md b/FORK.md
index 8464128..ee041c9 100644
--- a/FORK.md
+++ b/FORK.md
@@ -1,17 +1,23 @@
# Fork notes
-A fork of [amankumarsingh77/pi-browser-harness](https://github.com/amankumarsingh77/pi-browser-harness),
-carrying one patch: `BU_CDP_HTTP`, which lets pi drive a browser on **another
-host**.
+**sz-chrome-remote-cdp**: driving a Chrome on another host over its DevTools
+port. A fork of [amankumarsingh77/pi-browser-harness](https://github.com/amankumarsingh77/pi-browser-harness),
+carrying one patch, `BU_CDP_HTTP`, which lets pi drive a browser on **another
+host**, plus `castle-search/`, a web-search tool over the same route (below).
+Until 2026-10 this repository was named pi-browser-harness.
Hosted on the fleet git host rather than a public forge — deliberately not
published to npm and not proposed upstream.
```
-origin git@git.soarez.net:sz/pi-browser-harness.git (canonical)
+origin git@git.soarez.net:sz/sz-chrome-remote-cdp.git (canonical)
upstream https://github.com/amankumarsingh77/pi-browser-harness.git
```
+The package keeps upstream's name, `pi-browser-harness`, in `package.json`:
+renaming it would conflict on every rebase, and pi identifies a git package by
+its URL, not its name.
+
## Why the patch exists
Upstream can only reach a browser on localhost:
@@ -44,10 +50,10 @@ watchdog restarts Chrome whenever CDP stops answering, plus once a day; see
## Install
```
-pi install git:git@git.soarez.net:sz/pi-browser-harness.git
+pi install git:git@git.soarez.net:sz/sz-chrome-remote-cdp.git
```
-Clones to `~/.pi/agent/git/git.soarez.net/sz/pi-browser-harness`. The same
+Clones to `~/.pi/agent/git/git.soarez.net/sz/sz-chrome-remote-cdp`. The same
identifier works on macOS and Linux, which a local-path install could not do —
pi records those by resolved absolute path, and `settings.json` is shared across
hosts via the dotfiles symlink.
@@ -55,6 +61,23 @@ hosts via the dotfiles symlink.
Nothing else to configure: castle is the built-in default
(`DEFAULT_REMOTE_CDP` in `src/cdp/endpoint.ts`).
+## castle-search
+
+`castle-search/` is `castle_cdp_search`, web search run in the same remote
+Chrome: it opens a background tab on an engine's results page, reads it and
+closes it. It was its own repository, pi-castle-cdp-search, until 2026-10; its
+commits were replayed here with `git am --directory=castle-search`, linear, so
+they rebase like any fork commit. Its README has the details.
+
+It touches no upstream file except the root `package.json`, where it is listed
+in `pi.extensions` and added to `check`. It keeps its own `package.json`,
+`tsconfig.json` and tests, and its own copy of the endpoint logic rather than
+importing the harness's `src/cdp/endpoint.ts`: that would tie it to upstream's
+layout, which rebases move. Both read `~/.pi/agent/browser-target.json`.
+
+The root `.gitignore` ignores `docs/` at any depth, so a new file under
+`castle-search/docs/` needs `git add -f`.
+
## Choosing a browser
From inside a pi session:
@@ -129,9 +152,12 @@ and the `host` parameter on `queryLiveWsUrl`) and `src/setup.ts` (the skipped
local-process precondition). Upstream refactors also touch the fork's hunks in
`src/index.ts` (imports, `/browser-status`, `before_agent_start`),
`src/prompt.ts`, `src/daemon/spawn.ts` (`stopDaemon`), `src/profile/*` and
-`CHANGELOG.md`.
+`CHANGELOG.md`, and `package.json` (castle-search's entries in `pi.extensions`
+and `check`). Commits under `castle-search/` never conflict.
-Verify with `npm run check` (typecheck, the boundary scanner and the tests).
+Verify with `npm run check` (typecheck, the boundary scanner and the tests,
+then castle-search's typecheck and tests; `npm --prefix castle-search install`
+first).
The boundary scanner rejects unguarded casts, so parse JSON with
`src/util/guards.ts`. `test/daemon/entry-imports-test.ts` walks the daemon's
import graph, which includes `endpoint.ts` and `target-store.ts`, and fails if