Repository navigation
fix(prompts): restore the formatInstructionFooter signature from 1.8 - #635
Conversation
🦋 Changeset detectedLatest commit: 70f092e The changes in this PR will be included in the next version bump. This PR includes changesets to release 1 package
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
|
in future, please open an issue first. i know it is tempting to have an agent churn out PRs, but it just drains the time of maintainers reviewing something that hasn't even been discussed yet. it also created the test in an inappropriate place, inconsistent with the rest of the repo. having said that, i'm happy to reorder the signature once you sort the tests out. |
|
Thanks! I’ll open an issue first next time. I moved the tests to |
|
sadly its still not in the right place. forget the tests. ill sort it |
This test is purely testing that the argument order changed, which makes no sense when this isn't a question of backwards compat of any kind. Agents going off on one as per.
What does this PR do?
#631 (released in 1.9.0) added
outputas the first parameter offormatInstructionFooter:The prompts docs still describe the two-argument form, and the custom prompt example there calls
formatInstructionFooter(['Enter: submit'], true). I also found more than ten public projects calling it this way. On 1.9.0 these calls fail to type-check (TS2554) and throw at runtime withTypeError: o.join is not a function, since the array is taken asoutputandtrueasinstructions.This PR moves
outputto an optional third parameter:outputstill wraps the footer to the stream's width.select,multiselectandgroupMultiselectnow passopts.outputlast.output.Code already updated to the 1.9.0 order would have to switch back, but I couldn't find any outside this repo. If you'd prefer to keep
outputfirst, I can change this to accept both forms instead, by checking whether the first argument is an array.I didn't open an issue first since the change is small.
Type of change
Checklist
pnpm testpasses (or targeted tests for my change)pnpm formathas been runAI-generated code disclosure