Repository navigation
feat(server): the agent front door: /llms.txt, an installer and patchy setup - #500
Merged
Merged
Conversation
…y setup An outside agent given "Set up Patchy using <host>/llms.txt" now has a path in. /llms.txt says what Patchy Cloud is and gives the install-and-login line. /install.mjs, served with the instance's address baked in, verifies the release tarball's SHA-512 integrity, installs it globally with npm and runs the new `patchy setup`, which links the bundled global skill as ~/.agents/skills/patchy and ~/.claude/skills/patchy. A stale global CLI is now told to rerun its instance's installer; inside a patch repo the guidance stays `pnpm patchy refresh`. Refs #36 Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
- ReleaseMismatch carries the install line as a field instead of reading the platform in its message. - The server's publish release refusal names both repairs, since it cannot tell a repo publish from a global CLI's file publish; the repo paths that said "patchy refresh" now say "pnpm patchy refresh". - Setup errors name the step, path and errno code rather than copying the cause's text; ENOENT checks use Schema like the rest of the CLI. - The front door has one error for an unreadable installer, and replaces its placeholder with a function so a URL cannot inject `$` patterns. - /llms.txt and the global skill tell PowerShell agents to call patchy.cmd. Refs #36 Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
…and old Node From the codex review: - Under Volta, node prepends its Node image's bin for its own children, so the PATH check passed while the calling shell could not find patchy. The check now ignores those directories. - Windows ran npm.cmd and patchy.cmd through cmd with quoted paths, which still expands %VAR%. npm now gets only fixed arguments, naming the tarball relative to its cwd, and setup runs the package's entry with node, with no shell between them. - The install and login lines single-quote the instance URL, as login's own `next` does, so an IPv6 host's brackets cannot glob. - Default imports, no top-level await and a version check before any temp directory let Node 14 and 18 reach the upgrade message. Adds installer tests for Volta and for another patchy shadowing the new one on PATH. Refs #36 Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
- Volta: refuse before installing when npm's prefix is inside Volta's Node image, naming a prefix to own, instead of filtering PATH, which also hid an image bin the user had put on PATH deliberately. - Windows: the tarball reaches npm.cmd as an absolute path through an environment variable cmd expands once, so a UNC temp directory works and `%` in the path still cannot expand. - Bare built-in specifiers load on Node 14.0 to 14.13. - Only an executable file on PATH counts as a patchy the shell would run. Refs #36 Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
…r agent The empty portal said "Ask your agent to publish a page with Patchy", which gave the agent nothing to start from. It now shows three steps: paste the selectable line `Set up Patchy using <instance>/llms.txt` to your agent, confirm the code it shows you, then ask for a page or a tool. Allison picked this layout (mock C on #36) because many first publishers have never signed in a CLI and the separate steps carry them through it. Refs #36 Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
allisonmahmood
force-pushed
the
t3code/implement-issue-36
branch
from
October 3, 2026 19:15
019ac58 to
47f22de
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
A new beta user's agent had no way in. The CLI is deliberately not on npm, the install steps lived only in the README and inside the skill they would install, nothing registered that skill with any agent, and the empty portal said "Ask your agent to publish a page with Patchy" with nothing behind it. A stale global CLI was told
patchy refresh, which only reconciles a repo.Now the person gives their agent one line:
Set up Patchy using https://<host>/llms.txt.GET /llms.txt(public, no-store): what Patchy Cloud is, the private beta, Node ≥ 22.22.0, the install-and-login line for macOS/Linux and PowerShell, the browser handoff, and the skill to read next. The copy is a first draft for Allison to edit here.GET /install.mjs(public, no-store): a dependency-free Node script inpackages/sdk/front-door/, served withPATCHY_PUBLIC_BASE_URLbaked in./api/releaseand checks the tarball's SHA-512 againstpackage.integritybefore installing anything.npm install --global --ignore-scripts, then runs the new package'ssetup --jsonby absolute path with no shell in between.patchymissing from PATH, or another runnablepatchyahead of it on PATH (which would otherwise loop on release mismatch).%in a path can't expand and a UNC temp directory still works.patchy setup [--remove] [--json]links the bundledskills/patchydirectory as~/.agents/skills/patchyand~/.claude/skills/patchy(symlinks on POSIX, junctions on Windows). It owns only links into apatchypackage's skill, including dangling ones from a removed npm prefix. It checks both paths before changing either and refuses anything else with exit 1 andskill_conflict.--removedeletes only owned links.Upgrade guidance: file publish with a stale global CLI names the instance's install line. Repo paths name
pnpm patchy refresh. The server's own refusal can't tell the two apart, so it names both.Surfaces:
docs/API.md, the package README, ADR-0004,docs/SKILL_DISTRIBUTION.md, the global skill and its lock hash, the Publishing glossary,CONTEXT-MAP.mdanddocs/product.md. ADR-0011 is unchanged. Instance URLs in the install and login lines are single-quoted, as login's ownnextquotes them.The empty portal walks a person through it in three steps: paste the selectable line
Set up Patchy using <instance>/llms.txtto your agent, confirm the code it shows you, then ask for a page or a tool. This is mock C from feat(server): the agent front door: /llms.txt, an installer and patchy setup #36 (https://post.patchyhq.com/d/nu13cerlx61o), picked because many first publishers have never signed in a CLI. It uses only the shell's shared components.Verified
packages/sdk/src/install.test.tsruns the real installer with real npm against a stub instance, with a clean HOME and a fresh npm prefix under paths with spaces. It covers:patchymissing from PATHpatchyignored, and a runnable one refusedpnpm test:packed-cli-e2efetches/llms.txtfrom the real server, runs its POSIX line on a clean HOME and npm prefix, and gets the login handoff. A second run reinstalls, keeps the links and polls the same login.Setup.test.ts, and its--jsonand exit-code contract through the bundled CLI incli.test.ts. The file-mode and repo-mode mismatch messages are tested incliPublish.test.tsandcliRepoPublish.test.ts.pnpm dev shotof a fresh instance matches the mock. On that live instance,/llms.txtand/install.mjsanswer 200 with the address baked in.pnpm verifypasses: format, lint, typecheck, test, postgres-concurrency, cli-smoke, tier2-smoke and browser.Hand checks (no CI runners)
/llms.txtline, then rerun as an upgradepatchy.cmdloginNot breaking: new routes and a new command. The only changed behaviour is the repair text in
release_mismatchmessages.Closes #36
Made by Claude Opus 5.5 via Claude Code; reviewed by GPT 6.1 Sol via codex.