feat: add Polytoken installer support#2575
Conversation
📝 WalkthroughWalkthroughAdds Polytoken native-skills installer metadata and end-to-end installation tests. Updates installer prompts with runtime fallbacks for unavailable autocomplete, multiselect, box, and directory APIs. ChangesPolytoken installation
Prompt compatibility fallbacks
Estimated code review effort: 3 (Moderate) | ~20 minutes Possibly related PRs
Suggested reviewers: 🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
Actionable comments posted: 1
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In `@tools/installer/prompts.js`:
- Around line 269-280: Update the fallback multiselect path around
clack.multiselect so locked values cannot be deselected, matching the primary
AutocompletePrompt behavior. Mark locked options with a clear “always installed”
hint and ensure required validation allows submission when only locked values
remain selected. Preserve the existing deduplication and locked-value
re-addition in the returned result.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Path: .coderabbit.yaml
Review profile: CHILL
Plan: Pro
Run ID: 7728d6ef-22d8-4660-ac70-304a386acdcd
📒 Files selected for processing (3)
test/test-installation-components.jstools/installer/ide/platform-codes.yamltools/installer/prompts.js
| if (typeof core.AutocompletePrompt !== 'function') { | ||
| const initialValues = [...new Set([...(options.initialValues || []), ...(options.lockedValues || [])])]; | ||
| const result = await clack.multiselect({ | ||
| message: options.message, | ||
| options: options.options, | ||
| initialValues: initialValues.length > 0 ? initialValues : undefined, | ||
| required: options.required || false, | ||
| maxItems: options.maxItems, | ||
| }); | ||
| await handleCancel(result); | ||
| return [...new Set([...result, ...(options.lockedValues || [])])]; | ||
| } |
There was a problem hiding this comment.
🎯 Functional Correctness | 🟡 Minor | ⚡ Quick win
Locked values can be deselected in the fallback multiselect UI.
In the primary path (lines 366-376), locked values are prevented from being toggled off via a custom toggleSelected override. In this fallback, the user can freely deselect locked values in the clack.multiselect UI. While the return on line 279 re-adds them so the final result is correct, two issues arise:
- UX confusion: The user deselects an item marked as selected, submits, and it silently reappears in the result.
- Submission block: If
requiredis true and the user deselects all items (including locked ones),clack.multiselectblocks submission — whereas the primary path always allows submitting with just locked values.
Consider adding a hint to locked options so users understand they are always installed, which partially mitigates the confusion:
💡 Suggested improvement
const result = await clack.multiselect({
message: options.message,
- options: options.options,
+ options: options.options.map((opt) =>
+ lockedSet.has(opt.value)
+ ? { ...opt, hint: opt.hint ?? 'always installed' }
+ : opt
+ ),
initialValues: initialValues.length > 0 ? initialValues : undefined,
required: options.required || false,
maxItems: options.maxItems,
});🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
In `@tools/installer/prompts.js` around lines 269 - 280, Update the fallback
multiselect path around clack.multiselect so locked values cannot be deselected,
matching the primary AutocompletePrompt behavior. Mark locked options with a
clear “always installed” hint and ensure required validation allows submission
when only locked values remain selected. Preserve the existing deduplication and
locked-value re-addition in the returned result.
What
Add Polytoken (https://docs.polytoken.dev), a new coding agent currently in early alpha testing, as a supported installer platform, writing native skills to
.polytoken/skills.Why
Polytoken users should be able to select the platform during BMAD installation and receive native skill-directory output.
How
Testing
npm run test:install— 402 passed, 0 failednpm run quality— formatting passed, then repository-wide lint was blocked by unrelated local untracked.serena/*.ymlfiles; those files are not included in this PR