Package dev.miyomiyo.agentbridge.client
Interface WorkObservations
- Functional Interface:
- This is a functional interface and can therefore be used as the assignment target for a lambda expression or method reference.
@FunctionalInterface
public interface WorkObservations
A registered, replaceable domain observation stream owned by the Minecraft client thread.
-
Method Summary
Modifier and TypeMethodDescriptionbooleanpublish(dev.miyomiyo.agentbridge.api.WorldContext world, java.lang.String json, java.util.Optional<java.lang.String> operationToken) Retain the newest JSON object for this location.
-
Method Details
-
publish
boolean publish(dev.miyomiyo.agentbridge.api.WorldContext world, java.lang.String json, java.util.Optional<java.lang.String> operationToken) Retain the newest JSON object for this location. Call when domain facts change, not for one-shot events or operations: intermediate observations may be coalesced. The host owns sequence numbers, reconnection, retries and transport; this call does no I/O and does not guarantee remote receipt or start an agent directly. Identical values do not create new observations. The source's registered observation schema is enforced. When a tool changes these facts, publish on the client thread before completing its result. The host carries the calling MOD's current observations with that receipt and commits them before returning to the agent. Ordinary observation delivery still covers lost/expired calls.- Parameters:
world- current world visit and location; old-location calls are discardedjson- detached JSON object in the registered source's schemaoperationToken- original ToolCall token when these facts reflect that applied effect; empty for observations unrelated to an operation. Retired/unknown tokens grant no association transfer. The host never trusts task IDs embedded in observation JSON.- Returns:
- true when retained locally, false after the requested location has retired
- Throws:
java.lang.IllegalArgumentException- for invalid observation datajava.lang.IllegalStateException- when called outside the Minecraft client thread
-