feat: add wait-download command and fix responsive layout in .pw skills (#829)#909
Merged
Conversation
- Add `wait-download` command to extension background.ts — waits for the next Chrome download to complete and returns the full saved file path via chrome.downloads.onChanged listener (30s timeout, error on interruption) - Add `wait-download` to COMMANDS map and 'Other' category in resolve.ts - Fix download-bill.pw: prepend `resize 1280 800` so Rogers shows "Save PDF" at desktop width (not the narrow-viewport variant); add `wait-download` at end - Align SKILL.md parameters with .pw variables (billing_period + filename) - Document wait-download in AGENT.md commands reference table Related: #829 Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
b5a8368 to
80ddfc7
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.
Summary
wait-downloadcommand — waits for the next browser download to complete and returns the full saved file path. Resolves Known Issue updated the readme, adding contents and fix typos #2 from Stagecraft: Node.js skill library and agent runtime #829.download-bill.pwnow prependsresize 1280 800so Rogers renders the "Save PDF" button (not the narrow-viewport variant "Save or download bill"). Resolves Known Issue [feature] support reading and saving csv/excel/markdown format #4.billing_periods(plural, wrong) →billing_period+ addedfilenameparameter to match.pwvariables.wait-downloadadded to commands reference table.How wait-download works
chrome.downloads.onChangedfires when a download state changes. The command registers a one-shot resolver that fires onstate === 'complete'(returns filename path) orstate === 'interrupted'(returns error). 30s timeout.Typical
.pwskill flow:Test plan
download-bill.pwviastagecraft run download-rogers-bill --http -v billing_period="..." -v filename="..."— verify path is returned after downloadwait-downloadtimes out with error after 30s if no download starts🤖 Generated with Claude Code