message

package
v0.1.9 Latest Latest
Warning

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

Go to latest
Published: May 27, 2026 License: Apache-2.0 Imports: 26 Imported by: 1

Documentation

Index

Constants

View Source
const Name = "message"

Variables

This section is empty.

Functions

This section is empty.

Types

type AddInput added in v0.1.8

type AddInput struct {
	Role    string `json:"role" description:"Message role. Currently only assistant is supported."`
	Content string `json:"content" description:"Message content to persist in the current turn."`
	Interim *bool  `json:"interim,omitempty" description:"Whether the message is interim. Defaults to false."`
	Mode    string `json:"mode,omitempty" description:"Optional message mode, e.g. task or exec."`
	Status  string `json:"status,omitempty" description:"Optional message status."`
}

type AddOutput added in v0.1.8

type AddOutput struct {
	MessageID       string `json:"messageId,omitempty"`
	ConversationID  string `json:"conversationId,omitempty"`
	TurnID          string `json:"turnId,omitempty"`
	ParentMessageID string `json:"parentMessageId,omitempty"`
	Sequence        int    `json:"sequence,omitempty"`
}

type AskUserInput

type AskUserInput struct {
	Message         string                 `json:"message" description:"The question or prompt to display to the user."`
	RequestedSchema map[string]interface{} `json:"requestedSchema,omitempty" description:"Optional JSON Schema for the expected user response."`
	Schema          map[string]interface{} `json:"schema,omitempty" description:"Legacy alias for requestedSchema."`
}

AskUserInput is the tool input for message-askUser.

type AskUserOutput

type AskUserOutput struct {
	Action  string                 `json:"action"`
	Payload map[string]interface{} `json:"payload,omitempty"`
}

AskUserOutput is the tool result for message-askUser.

type Candidate

type Candidate struct {
	MessageID string `json:"messageId"`
	Type      string `json:"type"`
	Role      string `json:"role,omitempty"`
	ToolName  string `json:"toolName,omitempty"`
	Preview   string `json:"preview"`
	ByteSize  int    `json:"byteSize"`
	TokenSize int    `json:"tokenSize"`
}

type CompactInput

type CompactInput struct {
	MaxTokens      int    `json:"maxTokens" description:"Target total token budget for retained messages."`
	Strategy       string `` /* 146-byte string literal not displayed */
	PreservePinned bool   `json:"preservePinned,omitempty" description:"Reserved for future use (no effect in v1)."`
}

type CompactOutput

type CompactOutput struct {
	RemovedCount int `json:"removedCount"`
	FreedTokens  int `json:"freedTokens"`
	KeptTokens   int `json:"keptTokens"`
}

type DebugInfo

type DebugInfo struct {
	Source     string `json:"source,omitempty"`
	RawLen     int    `json:"rawLen,omitempty"`
	RawPreview string `json:"rawPreview,omitempty"`
}

type Elicitor

type Elicitor interface {
	Elicit(ctx context.Context, turn *runtimerequestctx.TurnMeta, role string, req *execution.Elicitation) (messageID string, status string, payload map[string]interface{}, err error)
}

Elicitor abstracts the elicitation service to avoid a direct import cycle.

type ListCandidatesInput

type ListCandidatesInput struct {
	// Max number of candidates to return (default: 50)
	Limit int `json:"limit,omitempty" description:"Max number of candidates to return (default 50)."`
	// Types filter (user, assistant, tool). Empty = all
	Types []string `json:"types,omitempty" description:"Optional types to include: user, assistant, tool."`
}

type ListCandidatesOutput

type ListCandidatesOutput struct {
	Candidates []Candidate `json:"candidates"`
}

type MatchFragment

type MatchFragment struct {
	Offset  int     `json:"offset"`
	Limit   int     `json:"limit"`
	Score   float64 `json:"score"`
	Content string  `json:"content"`
}

type MatchInput

type MatchInput struct {
	MessageID string `json:"messageId"`
	Query     string `json:"query"`
	TopK      int    `json:"topK,omitempty"`
}

type MatchOutput

type MatchOutput struct {
	Size      int             `json:"size"`
	Fragments []MatchFragment `json:"fragments"`
}

type Option

type Option func(*Service)

Option configures optional dependencies on the message service.

func WithElicitor

func WithElicitor(e Elicitor) Option

WithElicitor sets the elicitation dependency for the askUser tool.

type ProjectInput added in v0.1.7

type ProjectInput struct {
	TurnIDs    []string `json:"turnIds,omitempty" description:"turn IDs to hide from active prompt history"`
	MessageIDs []string `json:"messageIds,omitempty" description:"message IDs to hide from active prompt history"`
	Reason     string   `json:"reason,omitempty" description:"short human-readable reason for the projection update"`
}

type ProjectOutput added in v0.1.7

type ProjectOutput struct {
	HiddenTurnIDs    []string `json:"hiddenTurnIds,omitempty"`
	HiddenMessageIDs []string `json:"hiddenMessageIds,omitempty"`
	Reason           string   `json:"reason,omitempty"`
}

type RemoveInput

type RemoveInput struct {
	Tuples []RemoveTuple `json:"tuples"`
}

type RemoveOutput

type RemoveOutput struct {
	CreatedSummaryMessageIds []string `json:"createdSummaryMessageIds"`
	ArchivedMessages         int      `json:"archivedMessages"`
}

type RemoveTuple

type RemoveTuple struct {
	Summary    string   `json:"summary" description:"summary to associate with removed messages"`
	MessageIds []string `json:"messageIds"`
	Role       string   `json:"role,omitempty"`
}

type Service

type Service struct {
	// contains filtered or unexported fields
}

Service provides message utilities exposed to agents.

func New

func New(conv apiconv.Client) *Service

New creates a basic service; summarization/match require dependencies set via options or NewWithDeps.

func NewWithDeps

func NewWithDeps(conv apiconv.Client, core coreGen, emb embedder.Finder, summarizeChunk, matchChunk int, summaryModel, summaryPrompt, defaultModel, embedModel string, opts ...Option) *Service

NewWithDeps provides full dependencies for summarize/match operations.

func (*Service) CacheableMethods added in v0.1.7

func (s *Service) CacheableMethods() map[string]bool

CacheableMethods declares which methods produce cacheable outputs.

func (*Service) Method

func (s *Service) Method(name string) (svc.Executable, error)

func (*Service) Methods

func (s *Service) Methods() svc.Signatures

func (*Service) Name

func (s *Service) Name() string

type ShowInput

type ShowInput struct {
	MessageID string             `json:"messageId"`
	ByteRange *textutil.IntRange `json:"byteRange,omitempty" description:"Optional byte range [from,to) over the selected content."`
	Sed       []string           `json:"sed,omitempty" description:"List of sed programs applied in order to the selected content."`
	Transform *TransformSpec     `json:"transform,omitempty" description:"Transform with selector+fields or queryLanguage+query, then format as csv or ndjson."`
}

type ShowOutput

type ShowOutput struct {
	MessageID string `json:"messageId,omitempty"`
	Content   string `json:"content"`
	Offset    int    `json:"offset"`
	Limit     int    `json:"limit"`
	Size      int    `json:"size"`
	// Continuation carries paging/truncation hints when only part of the message is returned.
	Continuation *extension.Continuation `json:"continuation,omitempty"`
}

type SummarizeChunk

type SummarizeChunk struct {
	Offset  int    `json:"offset"`
	Limit   int    `json:"limit"`
	Summary string `json:"summary"`
}

type SummarizeInput

type SummarizeInput struct {
	Body      string `json:"body" internal:"true"`
	MessageID string `json:"messageId"`
	Chunk     int    `json:"chunk,omitempty"`
	Page      int    `json:"page,omitempty"`
	PerPage   int    `json:"perPage,omitempty"`
}

type SummarizeOutput

type SummarizeOutput struct {
	Size        int              `json:"size"`
	Chunks      []SummarizeChunk `json:"chunks"`
	Summary     string           `json:"summary"`
	TotalChunks int              `json:"totalChunks"`
	TotalPages  int              `json:"totalPages"`
	Page        int              `json:"page"`
	PerPage     int              `json:"perPage"`
}

type TransformSpec

type TransformSpec struct {
	Selector string   `json:"selector,omitempty" description:"Simple dot-path (e.g., data or data.items). No wildcards or object construction."`
	Format   string   `json:"format,omitempty" description:"Output format" choices:"csv,ndjson"`
	Fields   []string `json:"fields,omitempty" description:"CSV column order; derived when empty."`
	MaxRows  int      `json:"maxRows,omitempty" description:"Row cap (0 = no cap)."`
}

Jump to

Keyboard shortcuts

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