From 73f756ecc1d6f35b064a9c551e0ef54c90a05f00 Mon Sep 17 00:00:00 2001 From: Danilo Date: Wed, 29 Jul 2026 13:29:17 +0200 Subject: [PATCH] Signal Patchstack when the package is uninstalled from a project MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Prompt-driven uninstalls previously left the site record on Patchstack untouched — a claimed site kept consuming a site slot with no nudge to its owner, and AGENT-INSTALL.md documented account-side deletion as impossible. Add `patchstack-connect uninstall`: it POSTs a package-removed signal to the new /monitor/pulse/package-removed/{uuid} endpoint. The server deletes an unclaimed (anonymous) site record outright and only flags a claimed one — the UUID is a public identifier, so the signal can be forged and must never destroy account data. The command is signal-only (local file removal stays with the uninstall steps) and never fails the flow: an unreachable server warns and moves on. AGENT-INSTALL.md's Uninstalling section runs the command as step 5, while the package and .patchstackrc.json still exist, and now ends by telling the user their claimed site keeps using a slot until removed in the dashboard — replacing the "there is no CLI command for account-side deletion" guidance. Requires the SaaS endpoint to be deployed first: against an older backend the 404 is reported as "site record no longer exists". Co-Authored-By: Claude Fable 5 --- AGENT-INSTALL.md | 9 ++-- src/cli.ts | 58 +++++++++++++++++++++++- src/client.ts | 62 ++++++++++++++++++++++++++ tests/client.test.ts | 102 +++++++++++++++++++++++++++++++++++++++++++ 4 files changed, 225 insertions(+), 6 deletions(-) diff --git a/AGENT-INSTALL.md b/AGENT-INSTALL.md index 3b00d6c..6c7d3d3 100644 --- a/AGENT-INSTALL.md +++ b/AGENT-INSTALL.md @@ -119,10 +119,11 @@ Remove only the pieces that are actually present — check for each first. If no 2. **Remove the widget snippets** from the layout/template: the `