primarytext

package
v0.0.27 Latest Latest
Warning

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

Go to latest
Published: Jul 5, 2026 License: MIT Imports: 11 Imported by: 0

Documentation

Overview

Package primarytext holds shared primary text connector helpers.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GoalProgressText

func GoalProgressText(turnNumber, maxTurns int) string

GoalProgressText returns the shared visible goal progress prefix.

func OneOffCronjobSeedText added in v0.0.12

func OneOffCronjobSeedText(loaded cronjob.OneOffCronjob, result cronjob.RunResult) string

OneOffCronjobSeedText returns the managed-conversation seed for a completed one-off cron run.

func ParseSocialAgentSwitch added in v0.0.11

func ParseSocialAgentSwitch(text string) (string, bool)

ParseSocialAgentSwitch returns the social-mode agent switch target, if text is a switch control message.

func RunOneOffCronjob

func RunOneOffCronjob(ctx context.Context, runner OneOffCronjobRunner, loaded cronjob.OneOffCronjob, publish func(context.Context, string, string, bool, bool, []events.OutboundAttachment) error, afterFinalPublish func(context.Context, cronjob.RunResult), onPublishError func(error))

RunOneOffCronjob wires shared on-demand cron progress and final output handling.

func ScheduledCronjobSeedText added in v0.0.16

func ScheduledCronjobSeedText(relativePath, ranAt, agent, text string, attachments []events.OutboundAttachment) string

ScheduledCronjobSeedText returns the managed-conversation seed for a scheduled cron result.

func SplitSlackText

func SplitSlackText(text string, preferredLimit, hardLimit int) []string

SplitSlackText splits Slack responses on the same preferred boundaries as the connector.

Types

type OneOffCronjobRunner

type OneOffCronjobRunner interface {
	LoadOneOffCronjob(string) (cronjob.OneOffCronjob, error)
	RunOneOffCronjob(context.Context, cronjob.OneOffCronjob, *harnessbridge.RawRunProgress, func(context.Context, cronjob.RunResult, error))
}

OneOffCronjobRunner runs one loaded cronjob with progress callbacks.

type ThreadAgent

type ThreadAgent struct {
	Prefix, Agent string
	PreSeed       bool
}

ThreadAgent is one configured text prefix to managed-agent mapping.

func MatchThreadAgent

func MatchThreadAgent(text string, agents []ThreadAgent, trimText bool) (ThreadAgent, string, bool)

MatchThreadAgent returns the configured agent matched by a connector-normalized prefix.

func NormalizeThreadAgents

func NormalizeThreadAgents(threadAgents config.ThreadAgents, longestFirst bool) []ThreadAgent

NormalizeThreadAgents trims configured managed-agent prefixes and preserves connector-specific ordering.

Jump to

Keyboard shortcuts

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