From 2de61003d51c3edcc1d9207fd8d344628568d33f Mon Sep 17 00:00:00 2001 From: Mario Tarosso Date: Fri, 2 Oct 2026 09:55:42 +0100 Subject: [PATCH] [NO-TICKET] Say what the package is at the top of AGENT-INSTALL.md, and fix four inaccuracies Co-Authored-By: Claude Opus 5.5 (1M context) --- AGENT-INSTALL.md | 17 +++++++++++------ src/cli.ts | 4 ++-- 2 files changed, 13 insertions(+), 8 deletions(-) diff --git a/AGENT-INSTALL.md b/AGENT-INSTALL.md index 8808784..156a271 100644 --- a/AGENT-INSTALL.md +++ b/AGENT-INSTALL.md @@ -2,6 +2,13 @@ This versioned reference ships inside `@patchstack/connect` and documents each setup command and its project changes. +## What this package is + +- **An npm package for JavaScript and Node.js projects**, published by Patchstack under the `@patchstack` scope. It is not a WordPress plugin and needs no PHP. Patchstack also protects WordPress sites; this package is its integration for JS/Node projects — Vite, Next.js, plain vanilla JS, anything with a lockfile. +- **Source and releases:** MIT-licensed, source at https://github.com/patchstack/connect. Each version is published to npm from that repository's GitHub Actions workflow with an npm provenance attestation. +- **How to check it yourself:** `npm view @patchstack/connect` shows the live registry metadata, including the repository and the attestation. After installing, `npm audit signatures` verifies the registry signatures and provenance attestations of the installed packages, this one included. +- **What it does:** it sends the project's package names and versions to Patchstack for vulnerability matching, adds the Patchstack Connector widget to the site, installs a runtime exploit guard (`protect`) in the server's request path, and adds scan steps to the install and build scripts. It can also analyse the server's attack surface locally (`map`), which leaves the machine only with `--upload`. The [Command reference](#command-reference) lists every command, what it reads and writes, and what it sends. + ## Choose the project path first Use the package setup flow below for an existing JS/Node application. Work in its package directory; a missing `package.json` can mean you are in a subdirectory or looking at generated HTML rather than the source project. A page containing HTML can still belong to a server-rendered application. Do not infer that runtime protection is unnecessary from the file extension alone. @@ -86,7 +93,6 @@ Only `map` produces an attack-surface analysis, and only `map --upload` sends th ## Package and command behavior -- Package: [`@patchstack/connect`](https://www.npmjs.com/package/@patchstack/connect), MIT-licensed, source at https://github.com/patchstack/connect. `npm view @patchstack/connect` shows the live registry metadata. - **What is sent to Patchstack is the dependency list, plus this site's public address and name** — the dependencies are read from the lockfile (`package-lock.json`, `pnpm-lock.yaml`, `yarn.lock`) or, on bun projects (`bun.lock`/`bun.lockb`), by enumerating the installed packages under `node_modules/` — package names + versions, for vulnerability matching. No source code, no file paths, no git history is ever transmitted. - **`scan --install-paths` is the one exception, and it is opt-in.** It adds where each package sits in the dependency tree — repo-relative paths made of `node_modules` segments, plus a workspace directory name when a workspace pins its own copy. They are read from the lockfile's own keys or from the `node_modules` walk, **never from your source tree**: no path to a file you wrote is sent by either form of `scan`. - Why it exists: the same package is routinely installed twice at different versions, and without the locations an advisory affecting only one of them cannot be matched to the copy your code actually loads. Node resolves an import by walking up from the importing file, so the location is what distinguishes "you are running the vulnerable copy" from "the vulnerable copy is installed but nothing reaches it". Absent them, every installed version has to be treated as if the app used it — warnings about code you never call, and protection rules pinned to routes that run the safe copy. @@ -97,14 +103,13 @@ Only `map` produces an attack-surface analysis, and only `map --upload` sends th - **Only `map` produces an attack-surface analysis.** It parses your server source to report your app's attack surface. It runs only when you invoke it and prints to stdout. It transmits nothing unless you explicitly pass `--upload`, which sends that description of your app's structure to your own site's Patchstack endpoint — never source code, and never without that flag. `protect` separately parses supported wiring and route files for local integration, without producing or uploading a map. A `prebuild` scan reads the scaffolded guard and rules JSON only to identify and clear the reserved map stamp; it does not analyse them or transmit their contents. - **`scan` makes up to three source edits:** the Patchstack Connector's `