Help us shape the future of Go! Take the 2026 Go Developer Survey

send

package
v0.3.69 Latest Latest
Warning

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

Go to latest
Published: Oct 13, 2026 License: MIT Imports: 14 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Dispatch added in v0.1.10

func Dispatch(ctx context.Context, deps SendDeps, cfg SendConfig, input SendInput) error

Dispatch sends a proactive message through the delivery sender.

func NewSend

func NewSend(cfg SendConfig, deps SendDeps) (agentkit.Tool, error)

NewSend registers tool/send: Send a proactive user-visible message through the platform.

Best practices:

  • Wire the same sender instance runner uses (platform.default).
  • Text and path may be sent together (text first, then file). Path needs the workspace dep.
  • Platform/channel routing comes from context. Target sessionId, userId, or neither (current inbox).
  • Slash: /send [-r|--raw] <chatId> <message> (bare channel/chat id; platform from context; message may be multiline)

Types

type SendConfig

type SendConfig struct {
	// Root is the workspace subdirectory files are resolved from, matching
	// tool/fs-workspace root (typically ".").
	Root string `json:"root"`
}

type SendDeps

type SendDeps struct {
	Sender    capsdelivery.Sender    `json:"sender"`
	Delivery  capsdelivery.Assistant `json:"delivery"`
	Workspace workspace.Service      `json:"workspace,omitempty"`
	// FS verifies attachment existence (wire an unrestricted filesystem/local
	// instance; the resolved path is also handed to the platform as a local URL).
	FS filesystem.Service `json:"fs,omitempty"`
}

type SendInput

type SendInput struct {
	Text      string `json:"text,omitempty" jsonschema:"Text message to send"`
	Path      string `` /* 149-byte string literal not displayed */
	SessionID string `json:"sessionId,omitempty" jsonschema:"Optional delivery target; defaults to the current inbox"`
	UserID    string `json:"userId,omitempty" jsonschema:"Optional user target when sessionId is omitted"`
	Raw       bool   `json:"raw,omitempty" jsonschema:"Send plain text without platform markdown conversion"`
}

func ParseSlashArgs added in v0.1.10

func ParseSlashArgs(args string) (SendInput, error)

ParseSlashArgs parses /send arguments: /send [-r|--raw] <chatId> <message>. chatId is a bare channel/chat id for the current platform from context. Message may span multiple lines when the platform passes them in one payload.

type SendOutput

type SendOutput struct {
	Sent bool `json:"sent"`
}

Jump to

Keyboard shortcuts

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