workflow

package
v1.0.1 Latest Latest
Warning

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

Go to latest
Published: Jun 2, 2026 License: MIT Imports: 6 Imported by: 0

Documentation

Overview

Package workflow implements the core business logic and state transitions for various system operations.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CreateSession

func CreateSession(store sessionPickerStore, workingDir string) (string, error)

CreateSession is a public helper to create a new session and update state. Used by the 'autocmd session new' command.

func ResolveWorkspaceSession

func ResolveWorkspaceSession(store sessionStore, workingDir string) (*domain.Session, error)

ResolveWorkspaceSession finds or creates the active session for a working directory.

func RunAuth

func RunAuth(ctx context.Context, deps *AuthDeps) <-chan error

RunAuth starts the authentication workflow asynchronously.

func RunHistory

func RunHistory(_ context.Context, deps *HistoryDeps, bus historyBus) <-chan error

RunHistory starts the history gathering workflow asynchronously.

func RunInfo

func RunInfo(ctx context.Context, deps *InfoDeps) <-chan error

RunInfo executes the info gathering process asynchronously.

func RunModelPicker

func RunModelPicker(ctx context.Context, deps *ModelPickerDeps) <-chan error

RunModelPicker starts the model selection workflow asynchronously.

func RunPrompt

func RunPrompt(ctx context.Context, input string, deps *PromptDeps) <-chan error

func RunSessionPicker

func RunSessionPicker(ctx context.Context, deps *SessionPickerDeps) <-chan error

RunSessionPicker starts the session management workflow asynchronously.

Types

type ActionForwarder

type ActionForwarder interface {
	Deliver(domain.Action)
}

ActionForwarder defines the interface for delivering structured actions.

type AuthDeps

type AuthDeps struct {
	Bus      authBus
	Registry authRegistry
	AuthMgr  authManager
	OAuthMgr oauthManager
	State    *domain.State
	Saver    authStateManager
}

AuthDeps contains the dependencies for the auth workflow.

type AuthWorkflow

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

AuthWorkflow orchestrates authentication operations.

func NewAuthWorkflow

func NewAuthWorkflow(registry authRegistry, authMgr authManager, oauthMgr oauthManager, state *domain.State, saver authStateManager) *AuthWorkflow

NewAuthWorkflow creates a new AuthWorkflow.

func (*AuthWorkflow) Gather

Gather returns the providers and their authentication status.

func (*AuthWorkflow) GetProvider

func (w *AuthWorkflow) GetProvider(id string) (domain.Provider, bool)

GetProvider returns a provider from the registry.

func (*AuthWorkflow) RemoveAuth

func (w *AuthWorkflow) RemoveAuth(_ context.Context, providerID string) error

RemoveAuth removes the authentication credentials for a provider and resets active model if needed.

type HistoryDeps

type HistoryDeps struct {
	Store     historySessionStore
	SessionID string
}

HistoryDeps contains the dependencies required to run the history workflow.

type HistoryResult

type HistoryResult struct {
	Session *domain.Session
}

HistoryResult is the outcome of a successful history workflow run.

func ResolveSession

func ResolveSession(deps *HistoryDeps) (*HistoryResult, error)

ResolveSession resolves which session's history should be displayed and loads it.

type InfoDeps

type InfoDeps struct {
	Bus              infoBus
	ProviderRegistry infoProviderRegistry
	LLMRegistry      infoLLMRegistry
	State            *domain.State
	Store            infoSessionStore
	SessionID        string
}

InfoDeps contains the dependencies for the system information workflow.

type InfoWorkflow

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

InfoWorkflow gathers information about the current configuration and state.

func NewInfoWorkflow

func NewInfoWorkflow(pRegistry infoProviderRegistry, lRegistry infoLLMRegistry, state *domain.State, store infoSessionStore, sessionID string) *InfoWorkflow

NewInfoWorkflow creates a new InfoWorkflow.

type ModelPickerDeps

type ModelPickerDeps struct {
	Bus      modelPickerBus
	Registry modelLLMRegistry
	State    *domain.State
	Saver    modelStateManager
}

ModelPickerDeps contains the dependencies for the model selection workflow.

type PromptDeps

type PromptDeps struct {
	Store     sessionStore
	LLM       domain.LLM
	Agent     agentRunner
	Bus       bus
	Forwarder ActionForwarder
	Session   *domain.Session
}

PromptDeps contains the dependencies required to run the agent prompt workflow.

type SessionPickerDeps

type SessionPickerDeps struct {
	Bus        sessionPickerBus
	Store      sessionPickerStore
	WorkingDir string
}

SessionPickerDeps contains the dependencies for the session selection workflow.

Jump to

Keyboard shortcuts

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