Documentation
¶
Index ¶
- func LooksLikeMinecraft(image, invocation string, features map[string][]string) bool
- func LooksLikeMinecraftEnv(image, invocation string, features map[string][]string, env map[string]string) bool
- func NormalizeCursor(line string, cursor int) int
- type ArgSpec
- type Command
- type Request
- type Response
- type Tree
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func LooksLikeMinecraft ¶
LooksLikeMinecraft reports whether server metadata suggests a Minecraft egg.
func LooksLikeMinecraftEnv ¶
func LooksLikeMinecraftEnv(image, invocation string, features map[string][]string, env map[string]string) bool
LooksLikeMinecraftEnv is like LooksLikeMinecraft but also checks egg environment variables (e.g. MINECRAFT_VERSION, SERVER_JARFILE) which are more reliable than the unresolved {{SERVER_JARFILE}} startup template.
func NormalizeCursor ¶
NormalizeCursor clamps cursor into [0, len(line)].
Types ¶
type Command ¶
type Command struct {
// Args[i] is the completion spec for the i-th argument after the command name.
Args []ArgSpec `json:"args"`
}
Command describes sequential argument completions for a command.
type Response ¶
type Response struct {
ID string `json:"id"`
Line string `json:"line"`
Cursor int `json:"cursor"`
Start int `json:"start"`
End int `json:"end"`
Suggestions []string `json:"suggestions"`
}
Response is returned to the panel for Tab completion.
func Suggest ¶
Suggest walks tree for the partial line and returns prefix-filtered matches plus the byte range [Start, End) that the panel should replace.
Token rules (prefix = line[:cursor]):
- "/gam" → command names matching "gam"
- "/gamemode " → first-arg values
- "/gamemode c" → first-arg values matching "c"
- "/gamemode survival " → second-arg values (if defined)
type Tree ¶
Tree is a static CLI completion tree for a server console. Commands map the first token (without a leading slash) to argument specs.
func Builtin ¶
Builtin returns a named built-in completion profile, or nil if unknown. Profiles are optional conveniences; any egg can ship a full Tree via process_configuration.completion instead.
func Minecraft ¶
func Minecraft() *Tree
Minecraft is a built-in completion profile for common vanilla / Paper-style console commands. Eggs for any app should prefer shipping their own tree via process_configuration.completion; this profile is only a convenience.
func ResolveTree ¶
ResolveTree picks a completion tree for a server console.
Order:
- Explicit egg/process tree (any app) — wins when non-empty
- Egg feature "console_completion" listing built-in profile names
- Auto-detect a known built-in (currently Minecraft) as a convenience