Documentation
¶
Index ¶
- Variables
- func AuthorizeAgentRequest(ctx context.Context, policyClient interfaces.PolicyClient, noAuthz bool, ...) error
- func CollectThreadComments(ctx context.Context, repo interfaces.Repository, ticketID types.TicketID, ...) []ticket.Comment
- func LoadHistory(ctx context.Context, repo interfaces.Repository, ticketID types.TicketID, ...) (*gollem.History, error)
- func SaveHistory(ctx context.Context, repo interfaces.Repository, ...) error
- type Option
- type RunContext
- type Strategy
- type UseCase
Constants ¶
This section is empty.
Variables ¶
var ( // ErrAgentAuthPolicyNotDefined is returned when agent authorization policy is not defined ErrAgentAuthPolicyNotDefined = errors.New("agent authorization policy not defined") // ErrAgentAuthDenied is returned when agent authorization is denied ErrAgentAuthDenied = errors.New("agent request not authorized") )
var ( // ErrSessionAborted is returned when a session is aborted by user request ErrSessionAborted = goerr.New("session aborted by user") )
Functions ¶
func AuthorizeAgentRequest ¶
func AuthorizeAgentRequest(ctx context.Context, policyClient interfaces.PolicyClient, noAuthz bool, message string) error
AuthorizeAgentRequest checks policy-based authorization for agent execution.
func CollectThreadComments ¶
func CollectThreadComments(ctx context.Context, repo interfaces.Repository, ticketID types.TicketID, currentSession *session.Session) []ticket.Comment
CollectThreadComments retrieves thread comments posted between sessions. If currentSession is nil, it collects recent comments without session-based filtering.
func LoadHistory ¶
func LoadHistory(ctx context.Context, repo interfaces.Repository, ticketID types.TicketID, storageSvc *storage.Service) (*gollem.History, error)
LoadHistory loads the chat history for a ticket from storage. It first tries to load from latest.json, falling back to history/{id}.json.
func SaveHistory ¶
func SaveHistory(ctx context.Context, repo interfaces.Repository, storageClient interfaces.StorageClient, storageSvc *storage.Service, ticketID types.TicketID, history *gollem.History) error
SaveHistory saves a gollem History to storage and records it in the repository.
Types ¶
type Option ¶ added in v0.15.0
type Option func(*UseCase)
Option configures a UseCase.
func WithFrontendURL ¶ added in v0.15.0
WithFrontendURL sets the frontend URL for session links.
func WithNoAuthorization ¶ added in v0.15.0
WithNoAuthorization disables policy-based authorization checks.
func WithPolicyClient ¶ added in v0.15.0
func WithPolicyClient(pc interfaces.PolicyClient) Option
WithPolicyClient sets the policy client for authorization.
func WithRepository ¶ added in v0.15.0
func WithRepository(repo interfaces.Repository) Option
WithRepository sets the repository.
func WithSlackService ¶ added in v0.15.0
func WithSlackService(svc *slackService.Service) Option
WithSlackService sets the Slack service for message routing.
type RunContext ¶ added in v0.15.0
type RunContext struct {
Session *session.Session
Message string
ChatCtx *chatModel.ChatContext
}
RunContext holds all the pre-initialized resources that UseCase passes to a Strategy after completing common setup.
type Strategy ¶ added in v0.15.0
type Strategy interface {
Execute(ctx context.Context, rc *RunContext) error
}
Strategy defines the interface for chat execution strategies. Implementations receive a RunContext with a pre-initialized Warren session (session created, message routing configured, authorization verified). The strategy is responsible for its own gollem LLM session management and execution workflow (planning, task execution, replanning, etc.).
type UseCase ¶ added in v0.15.0
type UseCase struct {
// contains filtered or unexported fields
}
UseCase implements interfaces.ChatUseCase by performing common setup (Warren session management, message routing, authorization) and delegating strategy-specific execution to a Strategy implementation.
func NewUseCase ¶ added in v0.15.0
NewUseCase creates a new UseCase with the given strategy and options.