POC: offer to install first-party extensions on first use - #881
Draft
tedkahwaji wants to merge 1 commit into
Draft
tedkahwaji wants to merge 1 commit into
tedkahwaji wants to merge 1 commit into
Conversation
Running a first-party extension that is not installed yet, such as `pup setup`, previously failed as an unknown subcommand. Pup now offers to install it from its release source and then dispatches as usual. - Interactive terminals get a y/N prompt; declining keeps today's error - --yes and agent mode install with a one-line stderr notice - Read-only mode refuses; non-interactive runs print the install command - Debug builds can install from a local file for testing via PUP_DEV_FIRST_PARTY_LOCAL_SOURCE Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This branch has not been deployed
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.
Why
Proof of concept for making first-party extensions discoverable without a separate install step. Today an agent or user has to know to run
pup extension install <owner/repo>beforepup setup(for example, a setup extension wrapping the public@datadog/ai-setup-clipackage) does anything. Without that,pup setupfails as an unknown subcommand.This POC keeps the extension's code, release cadence and CI outside pup core, but makes the first run feel built in.
What
src/extensions/first_party.rswith a small allowlist. It has one entry,setup->DataDog/pup-setup, which is a placeholder: that repository and release don't exist yet.main.rs, if the candidate is neither built-in nor installed but is on the allowlist, pup offers to install it using the existinginstall_from_githubpath, then dispatches as usual.Install it now? [y/N]. Declining falls through to today's unknown-command error--yesor agent mode--yespup extension installcommand--read-onlyPUP_DEV_FIRST_PARTY_LOCAL_SOURCE=<file>installs from a local file instead of GitHub, so the flow can be exercised before a release exists. It's compiled out of release builds viacfg!(debug_assertions).docs/EXTENSIONS.md.Testing
cargo test --bin pup first_party: 7 passed. Covers the allowlist lookup (known, unknown, wrong case, empty) and every decision branch.cargo test --bin pup extensions: 123 passed.cargo clippy -- -D warningsandcargo fmt --checkare clean.Smoke tests ran against
./target/debug/pupwith an emptyPUP_CONFIG_DIR, in a clean environment so agent-mode autodetection stays off.Non-interactive, no
--yes:Read-only plus agent mode:
Interactive, user declines:
Interactive, user accepts (debug local source, stub extension):
Agent mode (debug local source), then a second run dispatching directly to the now-installed extension:
--yesagainst the placeholder GitHub source fails cleanly with the existing "no releases found for DataDog/pup-setup" error.Open questions
--yes. Agents usually pass--yes, but autodetected agent mode also implies auto-approve today, which is why the smoke tests needed a clean environment.checksums.txt(optional today) or a signature before running?pup --agent setup --helpstill prints pup's schema rather than the extension's help (an existing limitation).🤖 Generated with Claude Code