Skip to content

feat(pi-extension): autocomplete /ponytail arguments - #1080

Merged
DietrichGebert merged 4 commits into
DietrichGebert:mainfrom
ruttybob:feat/ponytail-arg-completions
Oct 13, 2026
Merged

DietrichGebert merged 4 commits into
DietrichGebert:mainfrom
ruttybob:feat/ponytail-arg-completions

Conversation

@ruttybob

@ruttybob ruttybob commented Oct 9, 2026 •

Copy link
Copy Markdown
Contributor

Summary

 pi.registerCommand("ponytail", {
   description: PONYTAIL_COMMAND_DESCRIPTION,
+  getArgumentCompletions: (prefix) => completePonytailArgs(prefix),
   handler: async (args, ctx) => ...
 })
completePonytailArgs(prefix)
  split prefix into words
  1 word  → filter completion table by prefix
            (lite, full, ultra, off, status, default)
  "default <…>" → complete runtime levels on the 2nd word,
                  insert "default <mode>"
  extra words / no match → null

Mirrors the built-in /mcp command completion pattern (startsWith filter,
null when nothing matches, trailing space after default so the second
level opens immediately). review is deliberately not offered: it is
session-only and rejected by parsePonytailCommand (#377).

Evidence

  • Before: typing /ponytail d offers nothing; default accepts modes users cannot discover.
    After: /ponytail d → default → /ponytail default → off/lite/full/ultra.
  • npm test in pi-extension/: 29 pass, 0 fail, including the new
    /ponytail autocompletes modes, commands and default <mode> (8 assertions:
    full list, prefix filter, both default levels, no-match → null).
  • node scripts/check-rule-copies.js ✅ · node scripts/check-versions.js ✅
    Fixes pi-extension: argument completion for /ponytail #1081
  • Note: npm test at the repo root has one pre-existing failure on main
    (csv: correct pandas one-liner passes) — the local env lacks pandas,
    documented in CONTRIBUTING. Verified it fails on a clean tree via git stash.

Merge Danger

Door: two-way — additive, UI-only; Pi versions without
getArgumentCompletions ignore the field.

Blast Radius: pi-extension only.

ruttybob and others added 4 commits October 9, 2026 15:59
Wire getArgumentCompletions into the /ponytail command, mirroring Pi's
built-in /mcp pattern: first word completes the modes (lite, full,
ultra, off) plus status and default; default <mode> completes runtime
levels on the second word. Unknown or extra words return null.
@DietrichGebert
DietrichGebert merged commit ce8f0e9 into DietrichGebert:main Oct 13, 2026
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

pi-extension: argument completion for /ponytail

2 participants