Repository navigation
@rgstr/mcp: rgstr as MCP tools (plan/apply, confirm before apply); API errors print code + hint - #31
Merged
Merged
Conversation
…I errors print code + hint - pnpm workspace: packages/cli (@rgstr/cli) and packages/mcp (@rgstr/mcp 0.0.1) - claim, route and check flows moved out of index.ts into claim-flow.ts, route-flow.ts, check-flow.ts so the MCP server runs exactly the CLI's code - RgstrApiError carries code, hint, requestId, details; the CLI prints the hint last, --json includes code/hint/requestId; claim --check reads 422 proof_not_found as 'no proof yet' - MCP server: rgstr_whois/search/check, claim/setup/route plan+apply, rgstr_claim_check, rgstr_login; errors are isError results with the same envelope - SKILL.md: MCP section + the errors rule; changesets for both packages
Contributor
|
I'll fix CI failures and address comments from users with write access. I'll skip comments containing "(aside)".
|
Contributor
There was a problem hiding this comment.
✅ Devin resolved all 11 findings on d8e33c8
Fixed by Devin (11)
- Device login leaves organization unset
- Concurrent logins lose a registry's credentials
- Completed login still prompts for approval
- Concurrent login loses tool errors
- Login guidance points to another host
- Claim plan promises an impossible pull request
- Badge pull requests become unreachable
- Changed setup configuration still gets deleted
- Stored plans can target another organization
- Failed login hangs the tool call
- MCP hints lose last-line placement
- rgstr_login no longer hangs when the device-code request fails before a prompt; after login the one organization becomes active (rememberOrganization, shared with rgstr login) - stored plans remember the organization and host they were made for; apply refuses a different one - rgstr_setup_apply plans again and refuses when the files changed since the plan - isError text puts the envelope first so the hint is the last line, as in the CLI
…m (fingerprint includes the current file bytes)
…; a failed /api/v1/me after login forgets the stored organization - rgstr_claim_apply / rgstr_setup_apply / rgstr_route_apply accept plan_id only; the name/raw-argument paths are gone - claim plans carry a byte fingerprint of the READMEs they would edit (setup already did); a changed file, organization or host answers isError code plan_stale, hint "Run rgstr_<x>_plan again and show the user the new plan" - rememberOrganization (rgstr login and rgstr_login): when /api/v1/me fails after approval, the remembered organization is cleared and the error says "Signed in, but no organization was selected; run `rgstr org use <slug>`" (no_organization) - SKILL.md / README: no apply without a plan; plan_stale
… so rgstr_claim_apply can open the badge pull request
…kout has an origin remote
- search: rgstr.owner is the organization's display name (a string); the CLI prints it again (test against the real API shape) - rgstr_login tracks the outcome: call again for waiting / approved (and for which organization) / rejected / expired / failed with the next step; no_credentials hints mention the last login outcome; the flow is injectable for tests - claim plans fingerprint the target manifests too (a renamed package is a new plan); route plans are pinned to the organization they were made for (plan_stale on mismatch)
…ever replace the tool's own error
devin-ai-integration Bot
pushed a commit
that referenced
this pull request
Oct 21, 2026
…nization switch, search shows the organization
HeyGarrison
added a commit
that referenced
this pull request
Oct 21, 2026
* @rgstr/mcp: rgstr as MCP tools (plan/apply, confirm before apply); API errors print code + hint - pnpm workspace: packages/cli (@rgstr/cli) and packages/mcp (@rgstr/mcp 0.0.1) - claim, route and check flows moved out of index.ts into claim-flow.ts, route-flow.ts, check-flow.ts so the MCP server runs exactly the CLI's code - RgstrApiError carries code, hint, requestId, details; the CLI prints the hint last, --json includes code/hint/requestId; claim --check reads 422 proof_not_found as 'no proof yet' - MCP server: rgstr_whois/search/check, claim/setup/route plan+apply, rgstr_claim_check, rgstr_login; errors are isError results with the same envelope - SKILL.md: MCP section + the errors rule; changesets for both packages * @rgstr/mcp: review fixes - rgstr_login no longer hangs when the device-code request fails before a prompt; after login the one organization becomes active (rememberOrganization, shared with rgstr login) - stored plans remember the organization and host they were made for; apply refuses a different one - rgstr_setup_apply plans again and refuses when the files changed since the plan - isError text puts the envelope first so the hint is the last line, as in the CLI * @rgstr/mcp: a setup plan is applied only to the files it was made from (fingerprint includes the current file bytes) * @rgstr/mcp: apply takes only a plan_id; stale plans answer plan_stale; a failed /api/v1/me after login forgets the stored organization - rgstr_claim_apply / rgstr_setup_apply / rgstr_route_apply accept plan_id only; the name/raw-argument paths are gone - claim plans carry a byte fingerprint of the READMEs they would edit (setup already did); a changed file, organization or host answers isError code plan_stale, hint "Run rgstr_<x>_plan again and show the user the new plan" - rememberOrganization (rgstr login and rgstr_login): when /api/v1/me fails after approval, the remembered organization is cleared and the error says "Signed in, but no organization was selected; run `rgstr org use <slug>`" (no_organization) - SKILL.md / README: no apply without a plan; plan_stale * @rgstr/mcp: pr is part of the claim plan (rgstr_claim_plan pr: true), so rgstr_claim_apply can open the badge pull request * @rgstr/mcp: a claim plan promises the pull request only when the checkout has an origin remote * docs: one story across README, SKILL.md, MCP README and --help — claimed, badge-only proof, person reviews, claim --check records proof * changeset: docs pass * @rgstr/cli + @rgstr/mcp: review fixes from the docs lane - search: rgstr.owner is the organization's display name (a string); the CLI prints it again (test against the real API shape) - rgstr_login tracks the outcome: call again for waiting / approved (and for which organization) / rejected / expired / failed with the next step; no_credentials hints mention the last login outcome; the flow is injectable for tests - claim plans fingerprint the target manifests too (a renamed package is a new plan); route plans are pinned to the organization they were made for (plan_stale on mismatch) * @rgstr/mcp: a login note is only shown for the registry the login was for * @rgstr/mcp: the login note reads a snapshot of the outcome, and can never replace the tool's own error * @rgstr/mcp: read the login outcome once, after resolving the registry * docs: merge #31 head b811560; rgstr_login outcome, plan_stale on organization switch, search shows the organization
…il the first is approved or rejected
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.
Summary
rgstr becomes usable by an agent without a shell, and every failure says its next step.
Repository → pnpm workspace.
@rgstr/climoves topackages/cli(unchanged bin,files, tests; its build copies the rootskills/in so the npm tarball still ships the skill),@rgstr/mcp0.0.1 ispackages/mcp. Changesets' root package can't be versioned in a workspace, hence two package dirs. CI/release workflows run the same root scripts (pnpm build/test/typecheck/lintare nowpnpm -r). First publish of@rgstr/mcpneeds the npm trusted publisher (or a token) added for the new package name.CLI flows become importable (
packages/cli/src):claim-flow.ts(resolveClaimTargets→planClaims→applyClaims, pluscheckOne,previewJson,outcomeJson),route-flow.ts(planRoutes→renderRoutePlan→applyRoutes),check-flow.ts(checkProject),api-types.ts.index.tskeeps commander + prompting only. The human lines go through asay: Saycallback — the terminal in the CLI, a collected plan in MCP — so the plan the MCP returns is byte-for-byte whatrgstr claimprints. No behaviour change;cli.test.tsis unchanged except for the new error tests.Errors print their next step.
claim --checkreads the platform's new 422proof_not_found(outcome indetails) as "no proof found yet" and prints its hint.@rgstr/mcp(@modelcontextprotocol/sdkpinned1.32.1, stdio). Tools:rgstr_whois,rgstr_search,rgstr_check,rgstr_claim_plan/rgstr_claim_apply,rgstr_claim_check,rgstr_setup_plan/rgstr_setup_apply,rgstr_route_plan/rgstr_route_apply,rgstr_login. Plan tools return the CLI's plan text + JSON with aplan_id; apply takes only thatplan_idand applies exactly that plan, once — there is no apply without a plan. A plan whose files (README / .npmrc / pip.conf, byte fingerprint), organization or host changed since it was shown answersisErrorcodeplan_stale, hint "Run rgstr__plan again and show the user the new plan", and writes nothing. Every apply description and the serverinstructionscarry the rule from SKILL.md / llms.txt: show the user the plan, get confirmation, then apply. Auth is the CLI's stored device login (RGSTR_HOME),RGSTR_TOKEN/RGSTR_ORG/RGSTR_URLhonoured;rgstr_loginruns device-code and, likergstr login, makes the user's one organization the active one via the sharedpackages/cli/src/login.ts— if/api/v1/mefails after approval, both forget the previously stored organization and answerno_organization("Signed in, but no organization was selected; runrgstr org use <slug>"); no credentials →{ error: "Not logged in.", code: "no_credentials", hint: "Runnpx @rgstr/cli@latest login" }. Errors areisErrorresults: the JSON envelope first, then therenderErrortext, so the hint is the last line as in the CLI.Tests (
packages/mcp/src/__tests__/server.test.ts, in-memory transport, mockedfetch): tool list + rule text, whois/search, claim_plan posts/writes nothing, claim_apply = exactly onePOST /api/v1/registry/claimsand the badge with the real token, plan_id single-use and required,plan_staleon a README/config edit or organization change since the plan, no-credentials message, route/setup plan→apply;login.test.tscovers the organization selection and the failed-lookup path. Docs:packages/mcp/README.md(Claude Desktop / Cursor / Devin config),skills/rgstr/SKILL.md"Without a shell: MCP" section + errors rule (mirrored in benchmarks-platform'slib/registry/skill.tson the companion PR), changesets for both packages.Companion: computesdk/benchmarks-platform "rgstr API: every 4xx names its next step".
Stdio against prod
node packages/mcp/scripts/stdio-smoke.mjs computesdk(initialize → tools/list → tools/call):Link to Devin session: https://app.devin.ai/sessions/fe389c0a51364fe5bf8a7724b7049bc9
Open in Devin Desktop: https://app.devin.ai/desktop/session/fe389c0a51364fe5bf8a7724b7049bc9?variant=devin
Requested by: @HeyGarrison
Link to Devin session: https://app.devin.ai/sessions/fe389c0a51364fe5bf8a7724b7049bc9
Open in Devin Desktop: https://app.devin.ai/desktop/session/fe389c0a51364fe5bf8a7724b7049bc9?variant=devin
Requested by: @HeyGarrison