Package dev.miyomiyo.agentbridge.client
Interface ClientRegistrar
public interface ClientRegistrar
Minecraft-specific entries share the same page IDs and categories as declarative forms.
-
Method Summary
Modifier and TypeMethodDescriptionvoidcommand(ClientCommand.Placement placement, java.lang.String name, ClientCommand command) Declare client command syntax.voidObserve changes to the player's debug mode after publication, on the client thread.voidhud(java.lang.String name, dev.miyomiyo.agentbridge.api.world.WorldBinding<? extends HudSession> binding) Register a world-owned HUD without resolving the world during registration.voidinspection(dev.miyomiyo.agentbridge.api.QueryDefinition definition, dev.miyomiyo.agentbridge.api.ToolHandler handler) Declare a read-only developer inspection.Obtain a visit-scoped local notice channel.voidresourceReload(java.lang.String name, java.lang.Runnable invalidate) Register cache invalidation during client resource reload's apply phase.voidsettings(dev.miyomiyo.agentbridge.api.settings.SettingsPage page, SettingsScreenOpener opener) voidshortcut(ShortcutKey key, KeyModifiers modifiers, java.lang.Runnable action) Add an exact modifier action to a remappable key.work()Obtain read-only task observations; registration itself reads no world or agent.workObservations(java.lang.String name) Obtain a sender for this MOD's previously declared WorkDefinition.
-
Method Details
-
inspection
void inspection(dev.miyomiyo.agentbridge.api.QueryDefinition definition, dev.miyomiyo.agentbridge.api.ToolHandler handler) Declare a read-only developer inspection. Uses the same schema vocabulary and call lifetime as a query, but is discoverable only through the authenticated debug endpoint, never by AI. The host requires debug mode and an exact current location. The handler must return promptly and release asynchronous resources when its CallContext ends. Partial data uses ToolResult.partial; presenting player assistance is not allowed. Registration invokes no handler. -
debugMode
Observe changes to the player's debug mode after publication, on the client thread. The initial mode is DISABLED. The host commits permission and retires disallowed inspections before callbacks; listener failure does not block other listeners. Return promptly and do not change the host's mode from this callback. Registration itself invokes no callback. -
notifications
ClientNotifications notifications()Obtain a visit-scoped local notice channel. Registration itself displays nothing. -
work
ClientWork work()Obtain read-only task observations; registration itself reads no world or agent. -
workObservations
Obtain a sender for this MOD's previously declared WorkDefinition. Registration retains no observation and starts no communication. The short name is resolved in this MOD's namespace. -
settings
-
hud
void hud(java.lang.String name, dev.miyomiyo.agentbridge.api.world.WorldBinding<? extends HudSession> binding) Register a world-owned HUD without resolving the world during registration. The short name is namespaced by this extension's MOD ID. Registration does not call render or open a screen.- Parameters:
name- lower-case name, starting with a letter, up to 20 letters/digits/underscoresbinding- the extension's already registered world binding
-
command
Declare client command syntax. Names are not automatically prefixed. Duplicate names in the same placement are rejected, and a command cannot replace a host or existing client command. The name is lower-case, starts with a letter and contains up to 40 letters/digits/underscores. -
resourceReload
void resourceReload(java.lang.String name, java.lang.Runnable invalidate) Register cache invalidation during client resource reload's apply phase. The callback runs on the Minecraft client thread and must return promptly. Invalidate here and rebuild lazily on next use: other reload listeners need not have finished yet. No world is required. Registration itself performs no reload or callback. Only reloads after client declaration publication are delivered; do not depend on an initial notification. Each listener is isolated: a failure is logged and does not skip other extensions' invalidations.- Parameters:
name- lower-case name, starting with a letter, up to 20 letters/digits/underscores
-
shortcut
Add an exact modifier action to a remappable key. The host creates one native mapping per key ID before Minecraft reads key settings. Duplicate key/modifier actions and conflicting metadata fail registration. The callback runs on the client thread only during world play, with no screen open; it must return promptly and owns any work it starts. No input is deferred until a later visit. Loader-native key bindings remain available for other input needs.
-