feat(cli): add hosted agent claim command - #815
Merged
Conversation
|
I hit an error while handling your request (Model unavailable on AI Gateway free tier: Free tier users do not have access to this model. Upgrade to paid credits at https://vercel.com/d?to=%2F%5Bteam%5D%2F%7E%2Fai%3Fmodal%3Dtop-up for unrestricted…). Please try again, rephrase, or reach out if it keeps failing. Error id: f233eac6-11b8-47c4-ab07-54e3546b476d |
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.
What does this PR do?
Adds
pascal agent claim, which lets an autonomous hosted Pascal agent request its existing 15-minute claim code from the CLI and open the human claim page. The command readsPASCAL_API_KEYfor that request only, deletes it from the process environment before any child process can inherit it, disables HTTP redirects, validates a bounded response, and supports--no-openand browser-free--jsonoutput.Claiming links human accountability and lifts claim-gated capabilities. It does not transfer project ownership, grant private-project access, or upload local editor projects.
How to test
bun test packages/cli/src.bun --filter @pascal-app/cli check-types.bun --filter @pascal-app/cli prepublishOnlyto build, stage, pack, and smoke-test the portable runtime.Screenshots / screen recording
Not applicable; this is a terminal command.
Checklist
bun devmainbranchNote
Medium Risk
Touches credential handling and a new authenticated hosted API path; mitigations (env stripping, response bounds, no secret reflection) are explicit but mishandling could still affect agent API keys in user environments.
Overview
Adds
pascal agent claimso an autonomous hosted agent can start a short-lived claim flow from the terminal, linking the agent to a human without changing project ownership.The CLI reads
PASCAL_API_KEYonce for a POST to the hosted claim endpoint, then removes it fromprocess.env(and strips it from the browser opener’s child env) so secrets are not stored, printed, or leaked in errors. The HTTP client usesredirect: 'error', a bounded JSON body read, and strict validation of claim code, URL, and expiry; human output ignores server-controlled agent metadata.--no-openand--jsonsupport headless and scripted use. README documents the hosted-agent claim workflow and limits of claiming.Tests cover the claim client, browser env sanitization, and end-to-end CLI behavior (help, missing key, JSON contract, error codes).
Reviewed by Cursor Bugbot for commit 9bed617. Bugbot is set up for automated code reviews on this repo. Configure here.