Documentation
¶
Overview ¶
Package workflow implements the core business logic and state transitions for various system operations.
Index ¶
- func CreateSession(store sessionPickerStore, workingDir string) (string, error)
- func ResolveWorkspaceSession(store sessionStore, workingDir string) (*domain.Session, error)
- func RunAuth(ctx context.Context, deps *AuthDeps) <-chan error
- func RunHistory(_ context.Context, deps *HistoryDeps, bus historyBus) <-chan error
- func RunInfo(ctx context.Context, deps *InfoDeps) <-chan error
- func RunModelPicker(ctx context.Context, deps *ModelPickerDeps) <-chan error
- func RunPrompt(ctx context.Context, input string, deps *PromptDeps) <-chan error
- func RunSessionPicker(ctx context.Context, deps *SessionPickerDeps) <-chan error
- type ActionForwarder
- type AuthDeps
- type AuthWorkflow
- type HistoryDeps
- type HistoryResult
- type InfoDeps
- type InfoWorkflow
- type ModelPickerDeps
- type PromptDeps
- type SessionPickerDeps
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func CreateSession ¶
CreateSession is a public helper to create a new session and update state. Used by the 'autocmd session new' command.
func ResolveWorkspaceSession ¶
ResolveWorkspaceSession finds or creates the active session for a working directory.
func RunHistory ¶
func RunHistory(_ context.Context, deps *HistoryDeps, bus historyBus) <-chan error
RunHistory starts the history gathering workflow asynchronously.
func RunModelPicker ¶
func RunModelPicker(ctx context.Context, deps *ModelPickerDeps) <-chan error
RunModelPicker starts the model selection workflow asynchronously.
func RunSessionPicker ¶
func RunSessionPicker(ctx context.Context, deps *SessionPickerDeps) <-chan error
RunSessionPicker starts the session management workflow asynchronously.
Types ¶
type ActionForwarder ¶
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 ¶
func (w *AuthWorkflow) Gather(ctx context.Context) (*domain.AuthProviderListEvent, error)
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 ¶
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.