fix(pi): add installer and runtime path guidance
This commit is contained in:
@@ -41,6 +41,8 @@ pnpm rebuild better-sqlite3 esbuild
|
||||
|
||||
Pi can also load this repo through settings or package installs as documented in [docs/PI.md](../../../docs/PI.md).
|
||||
|
||||
If you installed this repo from a local checkout with `./scripts/install-pi-package.sh`, the runtime stays in the checkout mirror at `pi-package/skills/web-automation/scripts`.
|
||||
|
||||
## Updating CloakBrowser
|
||||
|
||||
Run inside the installed `scripts/` directory for the pi skill. The commands below work for both global and project-local installs as long as you run them from the installed `scripts/` directory.
|
||||
@@ -54,10 +56,14 @@ pnpm rebuild better-sqlite3 esbuild
|
||||
|
||||
## Prerequisite Check (MANDATORY)
|
||||
|
||||
Before running automation, verify CloakBrowser and Playwright Core are installed and wired correctly. The command block below uses the global install path; for a project-local install, replace `~/.pi/agent/skills/web-automation/` with `.pi/skills/web-automation/`.
|
||||
Before running automation, verify the runtime from the location that matches your install style:
|
||||
|
||||
- local checkout package install: `pi-package/skills/web-automation/scripts`
|
||||
- project-local copied install: `.pi/skills/web-automation/scripts`
|
||||
- global copied install: `~/.pi/agent/skills/web-automation/scripts`
|
||||
|
||||
```bash
|
||||
cd ~/.pi/agent/skills/web-automation/scripts
|
||||
cd pi-package/skills/web-automation/scripts
|
||||
node check-install.js
|
||||
```
|
||||
|
||||
@@ -68,7 +74,7 @@ If the check fails, stop and return:
|
||||
If runtime fails with missing native bindings for `better-sqlite3` or `esbuild`, run the same commands from your installed `scripts/` directory:
|
||||
|
||||
```bash
|
||||
cd ~/.pi/agent/skills/web-automation/scripts
|
||||
cd pi-package/skills/web-automation/scripts
|
||||
pnpm approve-builds
|
||||
pnpm rebuild better-sqlite3 esbuild
|
||||
```
|
||||
|
||||
@@ -18,9 +18,11 @@ async function main() {
|
||||
try {
|
||||
await import("cloakbrowser");
|
||||
await import("playwright-core");
|
||||
await import("better-sqlite3");
|
||||
await import("esbuild");
|
||||
} catch (error) {
|
||||
fail(
|
||||
"Missing dependency/config: web-automation requires cloakbrowser and playwright-core.",
|
||||
"Missing dependency/config: web-automation requires cloakbrowser, playwright-core, better-sqlite3, and esbuild.",
|
||||
error instanceof Error ? error.message : String(error)
|
||||
);
|
||||
}
|
||||
@@ -32,6 +34,7 @@ async function main() {
|
||||
}
|
||||
|
||||
process.stdout.write("OK: cloakbrowser + playwright-core installed\n");
|
||||
process.stdout.write("OK: better-sqlite3 + esbuild installed\n");
|
||||
process.stdout.write("OK: CloakBrowser integration detected in browse.ts\n");
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user