Record Class OutboundAddress

java.lang.Object
java.lang.Record
io.agentscope.harness.agent.gateway.channel.OutboundAddress
Record Components:
channelId - the channel adapter to deliver through (e.g. "chatui", "slack")
accountId - optional multi-account identifier (nullable for single-account channels)
to - delivery address in "channelId:peerKind:peerId" format (e.g. "dingtalk:GROUP:cidXXX")
threadId - optional thread context for threaded replies (nullable)

public record OutboundAddress(String channelId, String accountId, String to, String threadId) extends Record
Delivery target for outbound (proactive) messages. Constructed by ChannelRouter during inbound routing and stored by the gateway as the session's "last route" so that proactive replies (e.g. subagent completion announces) can be delivered back to the correct channel and peer.
  • Constructor Details

    • OutboundAddress

      public OutboundAddress(String channelId, String accountId, String to, String threadId)
      Creates an instance of a OutboundAddress record class.
      Parameters:
      channelId - the value for the channelId record component
      accountId - the value for the accountId record component
      to - the value for the to record component
      threadId - the value for the threadId record component
  • Method Details

    • direct

      public static OutboundAddress direct(String channelId, String to)
      Creates an address for a direct (non-threaded) message.
    • withAccount

      public static OutboundAddress withAccount(String channelId, String accountId, String to)
      Creates an address with account context.
    • toMap

      public Map<String,Object> toMap()
      Serializes this address to a flat map for BaseStore persistence.
    • fromMap

      public static OutboundAddress fromMap(Map<String,Object> m)
      Reconstructs an address from a persisted map, tolerating missing optional fields.
    • toString

      public final String toString()
      Returns a string representation of this record class. The representation contains the name of the class, followed by the name and value of each of the record components.
      Specified by:
      toString in class Record
      Returns:
      a string representation of this object
    • hashCode

      public final int hashCode()
      Returns a hash code value for this object. The value is derived from the hash code of each of the record components.
      Specified by:
      hashCode in class Record
      Returns:
      a hash code value for this object
    • equals

      public final boolean equals(Object o)
      Indicates whether some other object is "equal to" this one. The objects are equal if the other object is of the same class and if all the record components are equal. All components in this record class are compared with Objects::equals(Object,Object).
      Specified by:
      equals in class Record
      Parameters:
      o - the object with which to compare
      Returns:
      true if this object is the same as the o argument; false otherwise.
    • channelId

      public String channelId()
      Returns the value of the channelId record component.
      Returns:
      the value of the channelId record component
    • accountId

      public String accountId()
      Returns the value of the accountId record component.
      Returns:
      the value of the accountId record component
    • to

      public String to()
      Returns the value of the to record component.
      Returns:
      the value of the to record component
    • threadId

      public String threadId()
      Returns the value of the threadId record component.
      Returns:
      the value of the threadId record component