feat(commands): add contextual tab completion
Release / release (push) Successful in 2m35s
CI / build (push) Successful in 1m21s

This commit is contained in:
dmg
2026-08-21 22:58:58 -04:00
parent 80810b3ba1
commit 7318d4afa6
11 changed files with 488 additions and 0 deletions
+12
View File
@@ -6,6 +6,18 @@ description: Chronological record of material decisions affecting the Spigot Tyr
# Spigot Tyrant Design Log
## 2026-08-21 — Contextual command completion completed
- Completed US-018 with registered completers for `/tyrant`, `/vigilante`, and `/tyrantadmin`, replacing Bukkit's unconditional online-player fallback.
- Suggestions now follow argument position, filter case-insensitively, expose eligible assignment and recruitment targets, identify current Followers for dismissal, and gate administration by permission.
- Administrative completion remains available to permitted console senders, while player-only commands return no console suggestions.
- Verified syntax, eligibility, membership, permissions, prefix filtering, compiler warnings, tests, and packaging with `./gradlew clean check jar`.
## 2026-08-21 — Contextual command completion started
- US-018 begins a test-first replacement of Bukkit's player-name fallback with syntax-aware Tyrant, Vigilante, and administrative command suggestions.
- Player arguments will be filtered by the applicable assignment or membership rules, while administrative suggestions remain permission-gated.
## 2026-08-21 — Single-mob Tamer custody completed
- Completed US-007 with an authoritative one-mob custody limit that rejects a second capture before inventory, entity, or state mutation and tells the Tamer to release the held mob first.
+1
View File
@@ -17,3 +17,4 @@
15. [US-015: Manage a reign through the Tyrant control panel](us-015-manage-tyrant-control-panel.md)
16. [US-016: Manage Followers through the Vigilante control panel](us-016-manage-vigilante-control-panel.md)
17. [US-017: Use bound role control items](us-017-use-bound-role-control-items.md)
18. [US-018: Complete Tyrant commands contextually](us-018-complete-commands-contextually.md)
@@ -0,0 +1,39 @@
---
type: User Story
title: "US-018: Complete Tyrant commands contextually"
description: Replace Bukkit's player-name fallback with valid context-aware command suggestions.
status: done
---
# US-018: Complete Tyrant commands contextually
As a **player or administrator**, I want contextual command suggestions so that I can discover valid Tyrant commands and arguments.
## Acceptance criteria
- [x] `/tyrant` suggests its available subcommands instead of arbitrary player names.
- [x] `/tyrant buy` suggests Tyrant unlock names.
- [x] `/tyrant assign` suggests `assassin`, `fixer`, and `tamer`, followed by eligible online players.
- [x] `/tyrant relinquish` suggests `confirm`.
- [x] `/vigilante` suggests its available subcommands.
- [x] `/vigilante invite` suggests eligible online recruitment candidates.
- [x] `/vigilante dismiss` suggests current online Followers.
- [x] `/tyrantadmin` suggestions are visible only to senders with `spigottyrant.admin`.
- [x] `/tyrantadmin start` suggests online Tyrant and Vigilante candidates.
- [x] `/tyrantadmin reset` suggests `confirm`.
- [x] Suggestions are filtered case-insensitively by the partially typed argument.
- [x] Suggestions never include syntactically invalid options for the current argument position.
- [x] Console completion works for administrative commands without exposing player-only commands as executable console actions.
- [x] Existing command execution behavior remains unchanged.
## Validation
Automated tests verify root syntax, unlocks, classes, confirmations, eligible recruits, current Followers, permission gating, online administrative candidates, argument positions, and case-insensitive prefix filtering. The complete `./gradlew clean check jar` lifecycle passes.
## Related
- [Start, pause, and administer the game](us-001-start-pause-and-administer.md)
- [Assign unlocked classes](us-004-assign-unlocked-classes.md)
- [Support the Vigilante and Followers](us-008-support-vigilante-and-followers.md)
- [Manage a reign through the Tyrant control panel](us-015-manage-tyrant-control-panel.md)
- [Manage Followers through the Vigilante control panel](us-016-manage-vigilante-control-panel.md)