auth

package
v1.7.0 Latest Latest
Warning

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

Go to latest
Published: Feb 2, 2026 License: MIT Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type AuthFlow

type AuthFlow interface {
	InitiateAuth(paneID string) error
}

AuthFlow interface for provider-specific auth actions

type AuthResult

type AuthResult struct {
	State AuthState
	Error error
	URL   string // For manual browser opening
}

AuthResult contains the result of an authentication attempt

type AuthState

type AuthState string

AuthState represents the current state of authentication

const (
	AuthInProgress     AuthState = "in_progress"
	AuthNeedsBrowser   AuthState = "needs_browser"
	AuthNeedsChallenge AuthState = "needs_challenge"
	AuthSuccess        AuthState = "success"
	AuthFailed         AuthState = "failed"
)

type ClaudeAuthFlow

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

ClaudeAuthFlow handles the authentication process for Claude Code

func NewClaudeAuthFlow

func NewClaudeAuthFlow(isRemote bool) *ClaudeAuthFlow

NewClaudeAuthFlow creates a new Claude auth flow handler

func (*ClaudeAuthFlow) DetectAuthFailure

func (f *ClaudeAuthFlow) DetectAuthFailure(output string) bool

DetectAuthFailure checks if authentication failed

func (*ClaudeAuthFlow) DetectAuthSuccess

func (f *ClaudeAuthFlow) DetectAuthSuccess(output string) bool

DetectAuthSuccess checks if authentication was successful

func (*ClaudeAuthFlow) DetectBrowserURL

func (f *ClaudeAuthFlow) DetectBrowserURL(output string) (string, bool)

DetectBrowserURL finds the auth URL in the output

func (*ClaudeAuthFlow) DetectChallengeCode

func (f *ClaudeAuthFlow) DetectChallengeCode(output string) (string, bool)

DetectChallengeCode finds the challenge code prompt

func (*ClaudeAuthFlow) InitiateAuth

func (f *ClaudeAuthFlow) InitiateAuth(paneID string) error

InitiateAuth starts the authentication process

func (*ClaudeAuthFlow) MonitorAuth

func (f *ClaudeAuthFlow) MonitorAuth(ctx context.Context, paneID string) (*AuthResult, error)

MonitorAuth watches the pane output for auth prompts and handles them

func (*ClaudeAuthFlow) SendContinuation

func (f *ClaudeAuthFlow) SendContinuation(paneID, prompt string) error

SendContinuation sends a prompt to continue after auth is complete

type Orchestrator

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

Orchestrator manages the restart process

func NewOrchestrator

func NewOrchestrator(cfg *config.Config) *Orchestrator

NewOrchestrator creates a new Orchestrator

func (*Orchestrator) ExecuteRestartStrategy

func (o *Orchestrator) ExecuteRestartStrategy(ctx RestartContext) error

ExecuteRestartStrategy performs the terminate-switch-restart flow

func (*Orchestrator) PromptBrowserAuth

func (o *Orchestrator) PromptBrowserAuth(email string)

PromptBrowserAuth simulates prompting the user

func (*Orchestrator) RegisterAuthFlow

func (o *Orchestrator) RegisterAuthFlow(provider string, flow AuthFlow)

RegisterAuthFlow registers a flow for a provider

func (*Orchestrator) StartNewAgentSession

func (o *Orchestrator) StartNewAgentSession(ctx RestartContext) error

StartNewAgentSession launches the agent command in the pane

func (*Orchestrator) TerminateSession

func (o *Orchestrator) TerminateSession(paneID string, provider string) error

TerminateSession tries to gracefully stop the agent, then force kills if needed

func (*Orchestrator) WaitForShellPrompt

func (o *Orchestrator) WaitForShellPrompt(paneID string, timeout time.Duration) error

WaitForShellPrompt waits until the pane shows a shell prompt

type RestartContext

type RestartContext struct {
	PaneID      string
	Provider    string
	TargetEmail string
	ModelAlias  string
	SessionName string
	PaneIndex   int
	ProjectDir  string
}

RestartContext holds context for restarting an agent

Jump to

Keyboard shortcuts

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