intercomtools

package
v0.3.1 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jul 30, 2026 License: MIT Imports: 7 Imported by: 0

Documentation

Overview

Package intercomtools defines the provider-neutral tool contract exposed to every agent adapter.

Index

Constants

View Source
const (
	SendMessageName = "send_message"
	ListPeersName   = "list_peers"

	// MaxOutboundMessageBytes is the raw UTF-8 message ceiling. Validation also
	// measures the encoded delivery frame because JSON escaping can expand a
	// message substantially.
	MaxOutboundMessageBytes = 200 * 1024
)
View Source
const (
	SendMessageDescription = "" /* 137-byte string literal not displayed */
	ListPeersDescription   = "Lists the names of other agent sessions connected to the Intercom broker."
)

Variables

View Source
var (
	SendMessageInputSchema = json.RawMessage(`{
		"type": "object",
		"properties": {
			"to":      {"type": "string", "description": "The peer name of the destination session."},
			"message": {"type": "string", "description": "The message body."}
		},
		"required": ["to", "message"],
		"additionalProperties": false
	}`)
	ListPeersInputSchema = json.RawMessage(`{"type":"object","properties":{},"additionalProperties":false}`)
)

Functions

func DecodeListPeers

func DecodeListPeers(raw json.RawMessage) error

DecodeListPeers validates the empty-object contract shared by all adapters.

func FormatPeers

func FormatPeers(peers []string) string

func ListPeersFailed

func ListPeersFailed(err error) string

func SendAccepted

func SendAccepted(to string) string

func SendFailed

func SendFailed(err error) string

func SendRejected

func SendRejected(code wire.Code, message string) string

Types

type SendMessageArgs

type SendMessageArgs struct {
	To      string `json:"to"`
	Message string `json:"message"`
}

func DecodeSendMessage

func DecodeSendMessage(raw json.RawMessage) (SendMessageArgs, error)

DecodeSendMessage decodes and validates the shared send_message contract.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL