chat

package
v0.6.0 Latest Latest
Warning

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

Go to latest
Published: Apr 15, 2026 License: Apache-2.0 Imports: 48 Imported by: 0

Documentation

Index

Constants

View Source
const (
	DefaultMaxTurns     = 10
	DefaultMaxBudgetUSD = 2.0
)

Variables

View Source
var (
	ErrConversationTerminalUnsupported     = errors.New("project conversation terminal is unsupported")
	ErrConversationTerminalSessionNotFound = errors.New("project conversation terminal session not found")
	ErrConversationTerminalAttachForbidden = errors.New("project conversation terminal attach forbidden")
	ErrConversationTerminalAlreadyAttached = errors.New("project conversation terminal session is already attached")
)
View Source
var (
	ErrConversationNotFound         = chatrepo.ErrNotFound
	ErrConversationConflict         = chatrepo.ErrConflict
	ErrConversationTurnActive       = chatrepo.ErrTurnAlreadyActive
	ErrConversationTurnNotActive    = fmt.Errorf("%w: project conversation does not have an active turn", domain.ErrConflict)
	ErrConversationInterruptPending = domain.ErrInterruptPending
	ErrPendingInterruptNotFound     = chatrepo.ErrNotFound
	ErrConversationRuntimeAbsent    = fmt.Errorf("chat conversation runtime is unavailable")
)
View Source
var (
	ErrProjectConversationWorkspaceUnavailable   = errors.New("project conversation workspace unavailable")
	ErrProjectConversationWorkspaceRepoNotFound  = errors.New("project conversation workspace repo not found")
	ErrProjectConversationWorkspacePathInvalid   = errors.New("project conversation workspace path is invalid")
	ErrProjectConversationWorkspaceEntryNotFound = errors.New("project conversation workspace entry not found")
	ErrProjectConversationWorkspaceEntryExists   = errors.New("project conversation workspace entry already exists")
)
View Source
var (
	ErrUnavailable             = errors.New("chat service unavailable")
	ErrSourceUnsupported       = errors.New("chat source is unsupported")
	ErrProviderNotFound        = errors.New("chat-capable provider not found for project")
	ErrProviderUnsupported     = errors.New("chat provider does not support ephemeral chat")
	ErrProviderUnavailable     = errors.New("chat provider is unavailable")
	ErrSessionNotFound         = errors.New("chat session not found")
	ErrSessionProviderMismatch = errors.New("chat session cannot resume across providers")
	ErrSessionTurnLimitReached = errors.New("chat session reached the turn limit; please create a ticket for further work")
	ErrSessionBudgetExceeded   = errors.New("chat session reached the budget cap; please create a ticket for further work")
)
View Source
var ErrProjectConversationWorkspaceSyncRequired = errors.New("project conversation workspace sync required")

Functions

This section is empty.

Types

type AttachedConversationTerminal added in v0.4.0

type AttachedConversationTerminal struct {
	Session ConversationTerminalSession
	Events  <-chan ConversationTerminalEvent
	// contains filtered or unexported fields
}

func (AttachedConversationTerminal) Close added in v0.4.0

func (AttachedConversationTerminal) Detach added in v0.4.0

func (AttachedConversationTerminal) Resize added in v0.4.0

func (a AttachedConversationTerminal) Resize(cols int, rows int) error

func (AttachedConversationTerminal) WriteInput added in v0.4.0

func (a AttachedConversationTerminal) WriteInput(data []byte) error

type ClaudeRuntime

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

func NewClaudeRuntime

func NewClaudeRuntime(adapter provider.ClaudeCodeAdapter) *ClaudeRuntime

func (*ClaudeRuntime) CloseSession

func (r *ClaudeRuntime) CloseSession(sessionID SessionID) bool

func (*ClaudeRuntime) ConfigureSecretResolver added in v0.3.0

func (r *ClaudeRuntime) ConfigureSecretResolver(resolver RuntimeEnvironmentResolver)

func (*ClaudeRuntime) InterruptTurn added in v0.4.0

func (r *ClaudeRuntime) InterruptTurn(
	_ context.Context,
	sessionID SessionID,
) (RuntimeSessionAnchor, error)

func (*ClaudeRuntime) RespondInterrupt

func (r *ClaudeRuntime) RespondInterrupt(
	ctx context.Context,
	input RuntimeInterruptResponseInput,
) (TurnStream, error)

func (*ClaudeRuntime) SessionAnchor

func (r *ClaudeRuntime) SessionAnchor(sessionID SessionID) RuntimeSessionAnchor

func (*ClaudeRuntime) StartTurn

func (r *ClaudeRuntime) StartTurn(ctx context.Context, input RuntimeTurnInput) (TurnStream, error)

func (*ClaudeRuntime) Supports

func (r *ClaudeRuntime) Supports(providerItem catalogdomain.AgentProvider) bool

type CodexRuntime

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

func NewCodexRuntime

func NewCodexRuntime(adapter *codexadapter.Adapter) *CodexRuntime

func (*CodexRuntime) CloseSession

func (r *CodexRuntime) CloseSession(sessionID SessionID) bool

func (*CodexRuntime) ConfigureSecretResolver added in v0.3.0

func (r *CodexRuntime) ConfigureSecretResolver(resolver RuntimeEnvironmentResolver)

func (*CodexRuntime) EnsureSession

func (r *CodexRuntime) EnsureSession(ctx context.Context, input RuntimeTurnInput) error

func (*CodexRuntime) InterruptTurn added in v0.4.0

func (r *CodexRuntime) InterruptTurn(
	ctx context.Context,
	sessionID SessionID,
) (RuntimeSessionAnchor, error)

func (*CodexRuntime) RespondInterrupt

func (r *CodexRuntime) RespondInterrupt(
	ctx context.Context,
	input RuntimeInterruptResponseInput,
) (TurnStream, error)

func (*CodexRuntime) SessionAnchor

func (r *CodexRuntime) SessionAnchor(sessionID SessionID) RuntimeSessionAnchor

func (*CodexRuntime) StartTurn

func (r *CodexRuntime) StartTurn(ctx context.Context, input RuntimeTurnInput) (TurnStream, error)

func (*CodexRuntime) Supports

func (r *CodexRuntime) Supports(providerItem catalogdomain.AgentProvider) bool

type Context

type Context struct {
	ProjectID    uuid.UUID
	TicketID     *uuid.UUID
	ProjectFocus *ProjectConversationFocus
}

type ConversationTerminalEvent added in v0.4.0

type ConversationTerminalEvent struct {
	Type     string
	Data     []byte
	ExitCode int
	Signal   string
	Message  string
}

type ConversationTerminalService added in v0.4.0

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

func NewConversationTerminalService added in v0.4.0

func NewConversationTerminalService(
	logger *slog.Logger,
	conversations *ProjectConversationService,
) *ConversationTerminalService

func (*ConversationTerminalService) AttachSession added in v0.4.0

func (s *ConversationTerminalService) AttachSession(
	userID UserID,
	conversationID uuid.UUID,
	sessionID uuid.UUID,
	attachToken string,
) (AttachedConversationTerminal, error)

func (*ConversationTerminalService) CloseSession added in v0.4.0

func (s *ConversationTerminalService) CloseSession(conversationID uuid.UUID, sessionID uuid.UUID) error

func (*ConversationTerminalService) CreateSession added in v0.4.0

type ConversationTerminalSession added in v0.4.0

type ConversationTerminalSession struct {
	ID             uuid.UUID
	ConversationID uuid.UUID
	UserID         UserID
	Mode           chatdomain.TerminalMode
	CWD            string
	WSPath         string
	AttachToken    string
	CreatedAt      time.Time
	LastAttachedAt *time.Time
}

type GeminiRuntime

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

func NewGeminiRuntime

func NewGeminiRuntime(processManager provider.AgentCLIProcessManager) *GeminiRuntime

func (*GeminiRuntime) CloseSession

func (r *GeminiRuntime) CloseSession(sessionID SessionID) bool

func (*GeminiRuntime) ConfigureSecretResolver added in v0.3.0

func (r *GeminiRuntime) ConfigureSecretResolver(resolver RuntimeEnvironmentResolver)

func (*GeminiRuntime) InterruptTurn added in v0.4.0

func (r *GeminiRuntime) InterruptTurn(
	_ context.Context,
	sessionID SessionID,
) (RuntimeSessionAnchor, error)

func (*GeminiRuntime) SessionAnchor added in v0.4.0

func (r *GeminiRuntime) SessionAnchor(sessionID SessionID) RuntimeSessionAnchor

func (*GeminiRuntime) StartTurn

func (r *GeminiRuntime) StartTurn(ctx context.Context, input RuntimeTurnInput) (TurnStream, error)

func (*GeminiRuntime) Supports

func (r *GeminiRuntime) Supports(providerItem catalogdomain.AgentProvider) bool

type ProjectConversationFocusKind

type ProjectConversationFocusKind string
const (
	ProjectConversationFocusWorkflow  ProjectConversationFocusKind = "workflow"
	ProjectConversationFocusSkill     ProjectConversationFocusKind = "skill"
	ProjectConversationFocusTicket    ProjectConversationFocusKind = "ticket"
	ProjectConversationFocusMachine   ProjectConversationFocusKind = "machine"
	ProjectConversationFocusWorkspace ProjectConversationFocusKind = "workspace_file"
)

type ProjectConversationMachineFocus

type ProjectConversationMachineFocus struct {
	ID            uuid.UUID
	Name          string
	Host          string
	Status        string
	SelectedArea  string
	HealthSummary string
}

type ProjectConversationMuxEvent

type ProjectConversationMuxEvent struct {
	Event          string
	ConversationID uuid.UUID
	Payload        any
	SentAt         time.Time
}

type ProjectConversationService

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

func NewProjectConversationService

func NewProjectConversationService(
	logger *slog.Logger,
	stores projectConversationStoreSource,
	catalog projectConversationCatalog,
	tickets ticketReader,
	workflows workflowReader,
	localProcessManager provider.AgentCLIProcessManager,
	sshPool *sshinfra.Pool,
) *ProjectConversationService

func (*ProjectConversationService) AppendSystemEntry added in v0.3.0

func (s *ProjectConversationService) AppendSystemEntry(
	ctx context.Context,
	userID UserID,
	conversationID uuid.UUID,
	turnID *uuid.UUID,
	payload map[string]any,
) (domain.Entry, error)

func (*ProjectConversationService) CheckoutWorkspaceBranch added in v0.5.0

func (*ProjectConversationService) CloseRuntime

func (s *ProjectConversationService) CloseRuntime(ctx context.Context, userID UserID, conversationID uuid.UUID) error

func (*ProjectConversationService) CommitWorkspace added in v0.5.0

func (*ProjectConversationService) ConfigureActivityEmitter added in v0.4.0

func (s *ProjectConversationService) ConfigureActivityEmitter(emitter projectConversationActivityEmitter)

func (*ProjectConversationService) ConfigureGitHubCredentials

func (s *ProjectConversationService) ConfigureGitHubCredentials(resolver githubauthservice.TokenResolver)

func (*ProjectConversationService) ConfigurePlatformEnvironment

func (s *ProjectConversationService) ConfigurePlatformEnvironment(
	apiURL string,
	platform projectConversationAgentPlatform,
)

func (*ProjectConversationService) ConfigureSecretManager added in v0.3.0

func (s *ProjectConversationService) ConfigureSecretManager(manager projectConversationSecretManager)

func (*ProjectConversationService) ConfigureSecretResolver added in v0.3.0

func (s *ProjectConversationService) ConfigureSecretResolver(resolver RuntimeEnvironmentResolver)

func (*ProjectConversationService) CreateConversation

func (s *ProjectConversationService) CreateConversation(
	ctx context.Context,
	userID UserID,
	projectID uuid.UUID,
	providerID uuid.UUID,
) (domain.Conversation, error)

func (*ProjectConversationService) CreateWorkspaceBranch added in v0.5.0

func (*ProjectConversationService) CreateWorkspaceFile added in v0.5.0

func (*ProjectConversationService) DeleteConversation added in v0.4.0

func (s *ProjectConversationService) DeleteConversation(
	ctx context.Context,
	userID UserID,
	conversationID uuid.UUID,
	input domain.DeleteConversationInput,
) (domain.DeleteConversationResult, error)

func (*ProjectConversationService) DeleteWorkspaceFile added in v0.5.0

func (*ProjectConversationService) DiscardWorkspaceFile added in v0.5.0

func (*ProjectConversationService) GetConversation

func (s *ProjectConversationService) GetConversation(ctx context.Context, userID UserID, conversationID uuid.UUID) (domain.Conversation, error)

func (*ProjectConversationService) GetPrincipal

func (s *ProjectConversationService) GetPrincipal(ctx context.Context, userID UserID, conversationID uuid.UUID) (domain.ProjectConversationPrincipal, error)

func (*ProjectConversationService) GetWorkspaceDiff

func (s *ProjectConversationService) GetWorkspaceDiff(
	ctx context.Context,
	userID UserID,
	conversationID uuid.UUID,
) (ProjectConversationWorkspaceDiff, error)

func (*ProjectConversationService) GetWorkspaceGitGraph added in v0.5.0

func (s *ProjectConversationService) GetWorkspaceGitGraph(
	ctx context.Context,
	userID UserID,
	conversationID uuid.UUID,
	repoPath WorkspaceRepoPath,
	window WorkspaceGitGraphWindow,
) (ProjectConversationWorkspaceGitGraph, error)

func (*ProjectConversationService) GetWorkspaceMetadata added in v0.4.0

func (s *ProjectConversationService) GetWorkspaceMetadata(
	ctx context.Context,
	userID UserID,
	conversationID uuid.UUID,
) (ProjectConversationWorkspaceMetadata, error)

func (*ProjectConversationService) GetWorkspaceRepoRefs added in v0.5.0

func (s *ProjectConversationService) GetWorkspaceRepoRefs(
	ctx context.Context,
	userID UserID,
	conversationID uuid.UUID,
	repoPath WorkspaceRepoPath,
) (ProjectConversationWorkspaceRepoRefs, error)

func (*ProjectConversationService) InterruptTurn added in v0.4.0

func (s *ProjectConversationService) InterruptTurn(
	ctx context.Context,
	userID UserID,
	conversationID uuid.UUID,
) error

func (*ProjectConversationService) ListConversations

func (s *ProjectConversationService) ListConversations(
	ctx context.Context,
	userID UserID,
	projectID uuid.UUID,
	providerID *uuid.UUID,
) ([]domain.Conversation, error)

func (*ProjectConversationService) ListEntries

func (s *ProjectConversationService) ListEntries(ctx context.Context, userID UserID, conversationID uuid.UUID) ([]domain.Entry, error)

func (*ProjectConversationService) ListWorkspaceTree added in v0.4.0

func (s *ProjectConversationService) ListWorkspaceTree(
	ctx context.Context,
	userID UserID,
	conversationID uuid.UUID,
	repoPath string,
	treePath string,
) (ProjectConversationWorkspaceTree, error)

func (*ProjectConversationService) ReadWorkspaceFilePatch added in v0.4.0

func (s *ProjectConversationService) ReadWorkspaceFilePatch(
	ctx context.Context,
	userID UserID,
	conversationID uuid.UUID,
	repoPath string,
	filePath string,
) (ProjectConversationWorkspaceFilePatch, error)

func (*ProjectConversationService) ReadWorkspaceFilePreview added in v0.4.0

func (s *ProjectConversationService) ReadWorkspaceFilePreview(
	ctx context.Context,
	userID UserID,
	conversationID uuid.UUID,
	repoPath string,
	filePath string,
) (ProjectConversationWorkspaceFilePreview, error)

func (*ProjectConversationService) RenameWorkspaceFile added in v0.5.0

func (*ProjectConversationService) RespondInterrupt

func (s *ProjectConversationService) RespondInterrupt(
	ctx context.Context,
	userID UserID,
	conversationID uuid.UUID,
	interruptID uuid.UUID,
	response domain.InterruptResponse,
) (domain.PendingInterrupt, error)

func (*ProjectConversationService) RunRetentionCleanup added in v0.4.0

func (s *ProjectConversationService) RunRetentionCleanup(
	ctx context.Context,
) ([]domain.RetentionCleanupResult, error)

func (*ProjectConversationService) RunWorkspaceGitRemoteOp added in v0.5.0

func (*ProjectConversationService) SaveWorkspaceFile added in v0.5.0

func (*ProjectConversationService) SearchWorkspacePaths added in v0.5.0

func (s *ProjectConversationService) SearchWorkspacePaths(
	ctx context.Context,
	userID UserID,
	conversationID uuid.UUID,
	repoPath string,
	query string,
	limit int,
) (ProjectConversationWorkspaceSearch, error)

func (*ProjectConversationService) StageWorkspaceAll added in v0.5.0

func (*ProjectConversationService) StageWorkspaceFile added in v0.5.0

func (*ProjectConversationService) StartTurn

func (s *ProjectConversationService) StartTurn(
	ctx context.Context,
	userID UserID,
	conversationID uuid.UUID,
	message string,
	focus *ProjectConversationFocus,
) (domain.Turn, error)

func (*ProjectConversationService) StartTurnWithWorkspaceFileDraft added in v0.5.0

func (s *ProjectConversationService) StartTurnWithWorkspaceFileDraft(
	ctx context.Context,
	userID UserID,
	conversationID uuid.UUID,
	message string,
	focus *ProjectConversationFocus,
	workspaceFileDraft *ProjectConversationWorkspaceFileDraftContext,
) (domain.Turn, error)

func (*ProjectConversationService) SyncWorkspace added in v0.4.0

func (s *ProjectConversationService) SyncWorkspace(
	ctx context.Context,
	userID UserID,
	conversationID uuid.UUID,
) (ProjectConversationWorkspaceMetadata, error)

func (*ProjectConversationService) UnstageWorkspace added in v0.5.0

func (*ProjectConversationService) WatchConversation

func (s *ProjectConversationService) WatchConversation(
	ctx context.Context,
	userID UserID,
	conversationID uuid.UUID,
) (<-chan StreamEvent, func(), error)

func (*ProjectConversationService) WatchProjectConversations

func (s *ProjectConversationService) WatchProjectConversations(
	ctx context.Context,
	userID UserID,
	projectID uuid.UUID,
) (<-chan ProjectConversationMuxEvent, func(), error)

type ProjectConversationSkillFocus

type ProjectConversationSkillFocus struct {
	ID                 uuid.UUID
	Name               string
	SelectedFilePath   string
	BoundWorkflowNames []string
	HasDirtyDraft      bool
}

type ProjectConversationTicketActivity

type ProjectConversationTicketActivity struct {
	EventType string
	Message   string
	CreatedAt string
}

type ProjectConversationTicketAssignedAgent

type ProjectConversationTicketAssignedAgent struct {
	ID                  string
	Name                string
	Provider            string
	RuntimeControlState string
	RuntimePhase        string
}

type ProjectConversationTicketDependency

type ProjectConversationTicketDependency struct {
	Identifier string
	Title      string
	Relation   string
	Status     string
}

type ProjectConversationTicketFocus

type ProjectConversationTicketFocus struct {
	ID             uuid.UUID
	Identifier     string
	Title          string
	Description    string
	Status         string
	Priority       string
	AttemptCount   int
	RetryPaused    bool
	PauseReason    string
	SelectedArea   string
	Dependencies   []ProjectConversationTicketDependency
	RepoScopes     []ProjectConversationTicketRepoScope
	RecentActivity []ProjectConversationTicketActivity
	HookHistory    []ProjectConversationTicketHook
	AssignedAgent  *ProjectConversationTicketAssignedAgent
	CurrentRun     *ProjectConversationTicketRun
	TargetMachine  *ProjectConversationTicketTargetMachine
}

type ProjectConversationTicketHook

type ProjectConversationTicketHook struct {
	HookName  string
	Status    string
	Output    string
	Timestamp string
}

type ProjectConversationTicketRepoScope

type ProjectConversationTicketRepoScope struct {
	RepoID         string
	RepoName       string
	BranchName     string
	PullRequestURL string
}

type ProjectConversationTicketRun

type ProjectConversationTicketRun struct {
	ID                 string
	AttemptNumber      int
	Status             string
	CurrentStepStatus  string
	CurrentStepSummary string
	LastError          string
}

type ProjectConversationTicketTargetMachine

type ProjectConversationTicketTargetMachine struct {
	ID   string
	Name string
	Host string
}

type ProjectConversationWorkflowFocus

type ProjectConversationWorkflowFocus struct {
	ID            uuid.UUID
	Name          string
	Type          string
	HarnessPath   string
	IsActive      bool
	SelectedArea  string
	HasDirtyDraft bool
}

type ProjectConversationWorkspaceBranchRef added in v0.5.0

type ProjectConversationWorkspaceBranchRef struct {
	Name                     string
	FullName                 string
	Scope                    ProjectConversationWorkspaceBranchScope
	Current                  bool
	CommitID                 string
	ShortCommitID            string
	Subject                  string
	UpstreamName             string
	Ahead                    int
	Behind                   int
	SuggestedLocalBranchName string
}

type ProjectConversationWorkspaceBranchScope added in v0.5.0

type ProjectConversationWorkspaceBranchScope string
const (
	ProjectConversationWorkspaceBranchScopeLocal          ProjectConversationWorkspaceBranchScope = "local_branch"
	ProjectConversationWorkspaceBranchScopeRemoteTracking ProjectConversationWorkspaceBranchScope = "remote_tracking_branch"
)

type ProjectConversationWorkspaceCheckoutInput added in v0.5.0

type ProjectConversationWorkspaceCheckoutInput struct {
	RepoPath               WorkspaceRepoPath
	Target                 WorkspaceCheckoutTarget
	ExpectedCleanWorkspace bool
}

type ProjectConversationWorkspaceCheckoutPreconditionError added in v0.5.0

type ProjectConversationWorkspaceCheckoutPreconditionError struct {
	Reason          ProjectConversationWorkspaceCheckoutPreconditionReason
	RequestedBranch string
	SuggestedBranch string
}

func (*ProjectConversationWorkspaceCheckoutPreconditionError) Error added in v0.5.0

type ProjectConversationWorkspaceCheckoutPreconditionReason added in v0.5.0

type ProjectConversationWorkspaceCheckoutPreconditionReason string
const (
	ProjectConversationWorkspaceCheckoutPreconditionDirtyWorkspace    ProjectConversationWorkspaceCheckoutPreconditionReason = "dirty_workspace"
	ProjectConversationWorkspaceCheckoutPreconditionLocalBranchExists ProjectConversationWorkspaceCheckoutPreconditionReason = "local_branch_exists"
)

type ProjectConversationWorkspaceCheckoutResult added in v0.5.0

type ProjectConversationWorkspaceCheckoutResult struct {
	ConversationID     uuid.UUID
	RepoPath           string
	CurrentRef         ProjectConversationWorkspaceCurrentRef
	CreatedLocalBranch string
}

type ProjectConversationWorkspaceCommitInput added in v0.5.0

type ProjectConversationWorkspaceCommitInput struct {
	RepoPath WorkspaceRepoPath
	Message  string
}

type ProjectConversationWorkspaceCommitResult added in v0.5.0

type ProjectConversationWorkspaceCommitResult struct {
	ConversationID uuid.UUID
	RepoPath       string
	Output         string
}

type ProjectConversationWorkspaceCreateBranchInput added in v0.5.0

type ProjectConversationWorkspaceCreateBranchInput struct {
	RepoPath   WorkspaceRepoPath
	BranchName WorkspaceBranchName
	StartPoint string
}

type ProjectConversationWorkspaceCreateBranchResult added in v0.5.0

type ProjectConversationWorkspaceCreateBranchResult struct {
	ConversationID uuid.UUID
	RepoPath       string
	BranchName     string
}

type ProjectConversationWorkspaceCurrentRef added in v0.5.0

type ProjectConversationWorkspaceCurrentRef struct {
	Kind           ProjectConversationWorkspaceCurrentRefKind
	DisplayName    string
	CacheKey       string
	BranchName     string
	BranchFullName string
	CommitID       string
	ShortCommitID  string
	Subject        string
}

type ProjectConversationWorkspaceCurrentRefKind added in v0.5.0

type ProjectConversationWorkspaceCurrentRefKind string
const (
	ProjectConversationWorkspaceCurrentRefKindBranch   ProjectConversationWorkspaceCurrentRefKind = "branch"
	ProjectConversationWorkspaceCurrentRefKindDetached ProjectConversationWorkspaceCurrentRefKind = "detached"
)

type ProjectConversationWorkspaceDiff

type ProjectConversationWorkspaceDiff struct {
	ConversationID uuid.UUID
	WorkspacePath  string
	Dirty          bool
	ReposChanged   int
	FilesChanged   int
	Added          int
	Removed        int
	Repos          []ProjectConversationWorkspaceRepoDiff
	SyncPrompt     *ProjectConversationWorkspaceSyncPrompt
}

type ProjectConversationWorkspaceDiffKind added in v0.4.0

type ProjectConversationWorkspaceDiffKind string
const (
	ProjectConversationWorkspaceDiffKindNone   ProjectConversationWorkspaceDiffKind = "none"
	ProjectConversationWorkspaceDiffKindText   ProjectConversationWorkspaceDiffKind = "text"
	ProjectConversationWorkspaceDiffKindBinary ProjectConversationWorkspaceDiffKind = "binary"
)

type ProjectConversationWorkspaceDiscardFileInput added in v0.5.0

type ProjectConversationWorkspaceDiscardFileInput struct {
	RepoPath WorkspaceRepoPath
	Path     string
}

type ProjectConversationWorkspaceDiscardFileResult added in v0.5.0

type ProjectConversationWorkspaceDiscardFileResult struct {
	ConversationID uuid.UUID
	RepoPath       string
	Path           string
}

type ProjectConversationWorkspaceFileConflictError added in v0.5.0

type ProjectConversationWorkspaceFileConflictError struct {
	CurrentFile ProjectConversationWorkspaceFilePreview
}

func (*ProjectConversationWorkspaceFileConflictError) Error added in v0.5.0

type ProjectConversationWorkspaceFileCreateInput added in v0.5.0

type ProjectConversationWorkspaceFileCreateInput struct {
	RepoPath WorkspaceRepoPath
	Path     WorkspaceCreatableFilePath
}

type ProjectConversationWorkspaceFileCreated added in v0.5.0

type ProjectConversationWorkspaceFileCreated struct {
	ConversationID uuid.UUID
	RepoPath       string
	Path           string
	Revision       string
	SizeBytes      int64
	Encoding       string
	LineEnding     string
}

type ProjectConversationWorkspaceFileDeleteInput added in v0.5.0

type ProjectConversationWorkspaceFileDeleteInput struct {
	RepoPath WorkspaceRepoPath
	Path     WorkspaceDeleteableFilePath
}

type ProjectConversationWorkspaceFileDeleted added in v0.5.0

type ProjectConversationWorkspaceFileDeleted struct {
	ConversationID uuid.UUID
	RepoPath       string
	Path           string
}

type ProjectConversationWorkspaceFileDiff

type ProjectConversationWorkspaceFileDiff struct {
	Path     string
	OldPath  string
	Status   ProjectConversationWorkspaceFileStatus
	Staged   bool
	Unstaged bool
	Added    int
	Removed  int
}

type ProjectConversationWorkspaceFileDraftContext added in v0.5.0

type ProjectConversationWorkspaceFileDraftContext struct {
	RepoPath   WorkspaceRepoPath
	Path       WorkspaceFilePath
	Content    WorkspaceTextContent
	Encoding   WorkspaceEncoding
	LineEnding WorkspaceLineEnding
}

type ProjectConversationWorkspaceFilePatch added in v0.4.0

type ProjectConversationWorkspaceFilePatch struct {
	ConversationID uuid.UUID
	RepoPath       string
	Path           string
	Status         ProjectConversationWorkspaceFileStatus
	DiffKind       ProjectConversationWorkspaceDiffKind
	Truncated      bool
	Diff           string
}

type ProjectConversationWorkspaceFilePreview added in v0.4.0

type ProjectConversationWorkspaceFilePreview struct {
	ConversationID uuid.UUID
	RepoPath       string
	Path           string
	SizeBytes      int64
	MediaType      string
	PreviewKind    ProjectConversationWorkspacePreviewKind
	Truncated      bool
	Content        string
	Revision       string
	Writable       bool
	ReadOnlyReason string
	Encoding       string
	LineEnding     string
}

type ProjectConversationWorkspaceFileReadOnlyError added in v0.5.0

type ProjectConversationWorkspaceFileReadOnlyError struct {
	Reason ProjectConversationWorkspaceReadOnlyReason
}

func (*ProjectConversationWorkspaceFileReadOnlyError) Error added in v0.5.0

type ProjectConversationWorkspaceFileRenameInput added in v0.5.0

type ProjectConversationWorkspaceFileRenameInput struct {
	RepoPath WorkspaceRepoPath
	FromPath WorkspaceRenamableFilePath
	ToPath   WorkspaceCreatableFilePath
}

type ProjectConversationWorkspaceFileRenamed added in v0.5.0

type ProjectConversationWorkspaceFileRenamed struct {
	ConversationID uuid.UUID
	RepoPath       string
	FromPath       string
	ToPath         string
}

type ProjectConversationWorkspaceFileSaveInput added in v0.5.0

type ProjectConversationWorkspaceFileSaveInput struct {
	RepoPath     WorkspaceRepoPath
	Path         WorkspaceFilePath
	BaseRevision WorkspaceFileRevision
	Content      WorkspaceTextContent
	Encoding     WorkspaceEncoding
	LineEnding   WorkspaceLineEnding
}

type ProjectConversationWorkspaceFileSaved added in v0.5.0

type ProjectConversationWorkspaceFileSaved struct {
	ConversationID uuid.UUID
	RepoPath       string
	Path           string
	Revision       string
	SizeBytes      int64
	Encoding       string
	LineEnding     string
}

type ProjectConversationWorkspaceFileStatus

type ProjectConversationWorkspaceFileStatus string
const (
	ProjectConversationWorkspaceFileStatusModified  ProjectConversationWorkspaceFileStatus = "modified"
	ProjectConversationWorkspaceFileStatusAdded     ProjectConversationWorkspaceFileStatus = "added"
	ProjectConversationWorkspaceFileStatusDeleted   ProjectConversationWorkspaceFileStatus = "deleted"
	ProjectConversationWorkspaceFileStatusRenamed   ProjectConversationWorkspaceFileStatus = "renamed"
	ProjectConversationWorkspaceFileStatusUntracked ProjectConversationWorkspaceFileStatus = "untracked"
)

type ProjectConversationWorkspaceFocus added in v0.5.0

type ProjectConversationWorkspaceFocus struct {
	ConversationID uuid.UUID
	RepoPath       string
	FilePath       string
	SelectedArea   string
	HasDirtyDraft  bool
	Selection      *ProjectConversationWorkspaceSelection
	WorkingSet     []ProjectConversationWorkspaceWorkingSet
}

type ProjectConversationWorkspaceGitGraph added in v0.5.0

type ProjectConversationWorkspaceGitGraph struct {
	ConversationID uuid.UUID
	RepoPath       string
	Window         WorkspaceGitGraphWindow
	Commits        []ProjectConversationWorkspaceGitGraphCommit
}

type ProjectConversationWorkspaceGitGraphCommit added in v0.5.0

type ProjectConversationWorkspaceGitGraphCommit struct {
	CommitID      string
	ShortCommitID string
	ParentIDs     []string
	Subject       string
	AuthorName    string
	AuthoredAt    time.Time
	Labels        []ProjectConversationWorkspaceGitRefLabel
	Head          bool
}

type ProjectConversationWorkspaceGitRefLabel added in v0.5.0

type ProjectConversationWorkspaceGitRefLabel struct {
	Name     string
	FullName string
	Scope    ProjectConversationWorkspaceGitRefLabelScope
	Current  bool
}

type ProjectConversationWorkspaceGitRefLabelScope added in v0.5.0

type ProjectConversationWorkspaceGitRefLabelScope string
const (
	ProjectConversationWorkspaceGitRefLabelScopeHead           ProjectConversationWorkspaceGitRefLabelScope = "head"
	ProjectConversationWorkspaceGitRefLabelScopeLocalBranch    ProjectConversationWorkspaceGitRefLabelScope = "local_branch"
	ProjectConversationWorkspaceGitRefLabelScopeRemoteTracking ProjectConversationWorkspaceGitRefLabelScope = "remote_tracking_branch"
)

type ProjectConversationWorkspaceGitRemoteOpInput added in v0.5.0

type ProjectConversationWorkspaceGitRemoteOpInput struct {
	RepoPath WorkspaceRepoPath
	Op       ProjectConversationWorkspaceGitRemoteOpKind
}

type ProjectConversationWorkspaceGitRemoteOpKind added in v0.5.0

type ProjectConversationWorkspaceGitRemoteOpKind string
const (
	ProjectConversationWorkspaceGitRemoteOpFetch ProjectConversationWorkspaceGitRemoteOpKind = "fetch"
	ProjectConversationWorkspaceGitRemoteOpPull  ProjectConversationWorkspaceGitRemoteOpKind = "pull"
	ProjectConversationWorkspaceGitRemoteOpPush  ProjectConversationWorkspaceGitRemoteOpKind = "push"
)

type ProjectConversationWorkspaceGitRemoteOpResult added in v0.5.0

type ProjectConversationWorkspaceGitRemoteOpResult struct {
	ConversationID uuid.UUID
	RepoPath       string
	Op             ProjectConversationWorkspaceGitRemoteOpKind
	Output         string
}

type ProjectConversationWorkspaceMetadata added in v0.4.0

type ProjectConversationWorkspaceMetadata struct {
	ConversationID uuid.UUID
	Available      bool
	WorkspacePath  string
	Repos          []ProjectConversationWorkspaceRepoMetadata
	SyncPrompt     *ProjectConversationWorkspaceSyncPrompt
}

type ProjectConversationWorkspaceMissingRepo added in v0.4.0

type ProjectConversationWorkspaceMissingRepo struct {
	Name string
	Path string
}

type ProjectConversationWorkspacePreviewKind added in v0.4.0

type ProjectConversationWorkspacePreviewKind string
const (
	ProjectConversationWorkspacePreviewKindText   ProjectConversationWorkspacePreviewKind = "text"
	ProjectConversationWorkspacePreviewKindBinary ProjectConversationWorkspacePreviewKind = "binary"
)

type ProjectConversationWorkspaceReadOnlyReason added in v0.5.0

type ProjectConversationWorkspaceReadOnlyReason string
const (
	ProjectConversationWorkspaceReadOnlyReasonBinaryFile          ProjectConversationWorkspaceReadOnlyReason = "binary_file"
	ProjectConversationWorkspaceReadOnlyReasonFileTooLarge        ProjectConversationWorkspaceReadOnlyReason = "file_too_large"
	ProjectConversationWorkspaceReadOnlyReasonUnsupportedEncoding ProjectConversationWorkspaceReadOnlyReason = "unsupported_encoding"
)

func (ProjectConversationWorkspaceReadOnlyReason) String added in v0.5.0

type ProjectConversationWorkspaceRepoDiff

type ProjectConversationWorkspaceRepoDiff struct {
	Name         string
	Path         string
	Branch       string
	Dirty        bool
	FilesChanged int
	Added        int
	Removed      int
	Files        []ProjectConversationWorkspaceFileDiff
}

type ProjectConversationWorkspaceRepoMetadata added in v0.4.0

type ProjectConversationWorkspaceRepoMetadata struct {
	Name         string
	Path         string
	Branch       string
	CurrentRef   ProjectConversationWorkspaceCurrentRef
	HeadCommit   string
	HeadSummary  string
	Dirty        bool
	FilesChanged int
	Added        int
	Removed      int
}

type ProjectConversationWorkspaceRepoRefs added in v0.5.0

type ProjectConversationWorkspaceRepoRefs struct {
	ConversationID uuid.UUID
	RepoPath       string
	CurrentRef     ProjectConversationWorkspaceCurrentRef
	LocalBranches  []ProjectConversationWorkspaceBranchRef
	RemoteBranches []ProjectConversationWorkspaceBranchRef
}

type ProjectConversationWorkspaceSearch added in v0.5.0

type ProjectConversationWorkspaceSearch struct {
	ConversationID uuid.UUID
	RepoPath       string
	Query          string
	Truncated      bool
	Results        []ProjectConversationWorkspaceSearchResult
}

type ProjectConversationWorkspaceSearchResult added in v0.5.0

type ProjectConversationWorkspaceSearchResult struct {
	Path string
	Name string
}

type ProjectConversationWorkspaceSelection added in v0.5.0

type ProjectConversationWorkspaceSelection struct {
	From          int
	To            int
	StartLine     int
	StartColumn   int
	EndLine       int
	EndColumn     int
	Text          string
	ContextBefore string
	ContextAfter  string
	Truncated     bool
}

type ProjectConversationWorkspaceStageAllInput added in v0.5.0

type ProjectConversationWorkspaceStageAllInput struct {
	RepoPath WorkspaceRepoPath
}

type ProjectConversationWorkspaceStageAllResult added in v0.5.0

type ProjectConversationWorkspaceStageAllResult struct {
	ConversationID uuid.UUID
	RepoPath       string
}

type ProjectConversationWorkspaceStageFileInput added in v0.5.0

type ProjectConversationWorkspaceStageFileInput struct {
	RepoPath WorkspaceRepoPath
	Path     string
}

type ProjectConversationWorkspaceStageFileResult added in v0.5.0

type ProjectConversationWorkspaceStageFileResult struct {
	ConversationID uuid.UUID
	RepoPath       string
	Path           string
}

type ProjectConversationWorkspaceSyncPrompt added in v0.4.0

type ProjectConversationWorkspaceSyncPrompt struct {
	Reason       ProjectConversationWorkspaceSyncReason
	MissingRepos []ProjectConversationWorkspaceMissingRepo
}

type ProjectConversationWorkspaceSyncReason added in v0.4.0

type ProjectConversationWorkspaceSyncReason string
const (
	ProjectConversationWorkspaceSyncReasonRepoBindingChanged ProjectConversationWorkspaceSyncReason = "repo_binding_changed"
	ProjectConversationWorkspaceSyncReasonRepoMissing        ProjectConversationWorkspaceSyncReason = "repo_missing"
)

type ProjectConversationWorkspaceSyncRequiredError added in v0.4.0

type ProjectConversationWorkspaceSyncRequiredError struct {
	Prompt   ProjectConversationWorkspaceSyncPrompt
	RepoPath string
}

func (*ProjectConversationWorkspaceSyncRequiredError) Error added in v0.4.0

func (*ProjectConversationWorkspaceSyncRequiredError) Is added in v0.4.0

type ProjectConversationWorkspaceTree added in v0.4.0

type ProjectConversationWorkspaceTree struct {
	ConversationID uuid.UUID
	RepoPath       string
	Path           string
	Entries        []ProjectConversationWorkspaceTreeEntry
}

type ProjectConversationWorkspaceTreeEntry added in v0.4.0

type ProjectConversationWorkspaceTreeEntry struct {
	Path      string
	Name      string
	Kind      ProjectConversationWorkspaceTreeEntryKind
	SizeBytes int64
}

type ProjectConversationWorkspaceTreeEntryKind added in v0.4.0

type ProjectConversationWorkspaceTreeEntryKind string
const (
	ProjectConversationWorkspaceTreeEntryKindDirectory ProjectConversationWorkspaceTreeEntryKind = "directory"
	ProjectConversationWorkspaceTreeEntryKindFile      ProjectConversationWorkspaceTreeEntryKind = "file"
)

type ProjectConversationWorkspaceUnstageInput added in v0.5.0

type ProjectConversationWorkspaceUnstageInput struct {
	RepoPath WorkspaceRepoPath
	Path     string
}

type ProjectConversationWorkspaceUnstageResult added in v0.5.0

type ProjectConversationWorkspaceUnstageResult struct {
	ConversationID uuid.UUID
	RepoPath       string
	Path           string
}

type ProjectConversationWorkspaceWorkingSet added in v0.5.0

type ProjectConversationWorkspaceWorkingSet struct {
	FilePath       string
	ContentExcerpt string
	Dirty          bool
	Truncated      bool
}

type RawChatContext

type RawChatContext struct {
	ProjectID *string `json:"project_id"`
	TicketID  *string `json:"ticket_id"`
}

type RawProjectConversationFocus

type RawProjectConversationFocus struct {
	Kind                            string                                      `json:"kind"`
	ConversationID                  *string                                     `json:"conversation_id"`
	WorkflowID                      *string                                     `json:"workflow_id"`
	WorkflowName                    *string                                     `json:"workflow_name"`
	WorkflowType                    *string                                     `json:"workflow_type"`
	HarnessPath                     *string                                     `json:"harness_path"`
	IsActive                        *bool                                       `json:"is_active"`
	SelectedArea                    *string                                     `json:"selected_area"`
	HasDirtyDraft                   *bool                                       `json:"has_dirty_draft"`
	SkillID                         *string                                     `json:"skill_id"`
	SkillName                       *string                                     `json:"skill_name"`
	SelectedFilePath                *string                                     `json:"selected_file_path"`
	BoundWorkflowNames              []string                                    `json:"bound_workflow_names"`
	TicketID                        *string                                     `json:"ticket_id"`
	TicketIdentifier                *string                                     `json:"ticket_identifier"`
	TicketTitle                     *string                                     `json:"ticket_title"`
	TicketDescription               *string                                     `json:"ticket_description"`
	TicketStatus                    *string                                     `json:"ticket_status"`
	TicketPriority                  *string                                     `json:"ticket_priority"`
	TicketAttemptCount              *int                                        `json:"ticket_attempt_count"`
	TicketRetryPaused               *bool                                       `json:"ticket_retry_paused"`
	TicketPauseReason               *string                                     `json:"ticket_pause_reason"`
	TicketDependencies              []RawProjectConversationTicketDependency    `json:"ticket_dependencies"`
	TicketRepoScopes                []RawProjectConversationTicketRepoScope     `json:"ticket_repo_scopes"`
	TicketRecentActivity            []RawProjectConversationTicketActivity      `json:"ticket_recent_activity"`
	TicketHookHistory               []RawProjectConversationTicketHook          `json:"ticket_hook_history"`
	TicketAssignedAgent             *RawProjectConversationTicketAssignedAgent  `json:"ticket_assigned_agent"`
	TicketCurrentRun                *RawProjectConversationTicketRun            `json:"ticket_current_run"`
	TicketTargetMachine             *RawProjectConversationTicketTargetMachine  `json:"ticket_target_machine"`
	MachineID                       *string                                     `json:"machine_id"`
	MachineName                     *string                                     `json:"machine_name"`
	MachineHost                     *string                                     `json:"machine_host"`
	MachineStatus                   *string                                     `json:"machine_status"`
	HealthSummary                   *string                                     `json:"health_summary"`
	WorkspaceRepoPath               *string                                     `json:"workspace_repo_path"`
	WorkspaceFilePath               *string                                     `json:"workspace_file_path"`
	WorkspaceSelectionFrom          *int                                        `json:"workspace_selection_from"`
	WorkspaceSelectionTo            *int                                        `json:"workspace_selection_to"`
	WorkspaceSelectionStartLine     *int                                        `json:"workspace_selection_start_line"`
	WorkspaceSelectionStartColumn   *int                                        `json:"workspace_selection_start_column"`
	WorkspaceSelectionEndLine       *int                                        `json:"workspace_selection_end_line"`
	WorkspaceSelectionEndColumn     *int                                        `json:"workspace_selection_end_column"`
	WorkspaceSelectionText          *string                                     `json:"workspace_selection_text"`
	WorkspaceSelectionContextBefore *string                                     `json:"workspace_selection_context_before"`
	WorkspaceSelectionContextAfter  *string                                     `json:"workspace_selection_context_after"`
	WorkspaceSelectionTruncated     *bool                                       `json:"workspace_selection_truncated"`
	WorkspaceWorkingSet             []RawProjectConversationWorkspaceWorkingSet `json:"workspace_working_set"`
}

type RawProjectConversationTicketActivity

type RawProjectConversationTicketActivity struct {
	EventType *string `json:"event_type"`
	Message   *string `json:"message"`
	CreatedAt *string `json:"created_at"`
}

type RawProjectConversationTicketAssignedAgent

type RawProjectConversationTicketAssignedAgent struct {
	ID                  *string `json:"id"`
	Name                *string `json:"name"`
	Provider            *string `json:"provider"`
	RuntimeControlState *string `json:"runtime_control_state"`
	RuntimePhase        *string `json:"runtime_phase"`
}

type RawProjectConversationTicketDependency

type RawProjectConversationTicketDependency struct {
	Identifier *string `json:"identifier"`
	Title      *string `json:"title"`
	Relation   *string `json:"relation"`
	Status     *string `json:"status"`
}

type RawProjectConversationTicketHook

type RawProjectConversationTicketHook struct {
	HookName  *string `json:"hook_name"`
	Status    *string `json:"status"`
	Output    *string `json:"output"`
	Timestamp *string `json:"timestamp"`
}

type RawProjectConversationTicketRepoScope

type RawProjectConversationTicketRepoScope struct {
	RepoID         *string `json:"repo_id"`
	RepoName       *string `json:"repo_name"`
	BranchName     *string `json:"branch_name"`
	PullRequestURL *string `json:"pull_request_url"`
}

type RawProjectConversationTicketRun

type RawProjectConversationTicketRun struct {
	ID                 *string `json:"id"`
	AttemptNumber      *int    `json:"attempt_number"`
	Status             *string `json:"status"`
	CurrentStepStatus  *string `json:"current_step_status"`
	CurrentStepSummary *string `json:"current_step_summary"`
	LastError          *string `json:"last_error"`
}

type RawProjectConversationTicketTargetMachine

type RawProjectConversationTicketTargetMachine struct {
	ID   *string `json:"id"`
	Name *string `json:"name"`
	Host *string `json:"host"`
}

type RawProjectConversationWorkspaceWorkingSet added in v0.5.0

type RawProjectConversationWorkspaceWorkingSet struct {
	FilePath       *string `json:"file_path"`
	ContentExcerpt *string `json:"content_excerpt"`
	Dirty          *bool   `json:"dirty"`
	Truncated      *bool   `json:"truncated"`
}

type RawStartInput

type RawStartInput struct {
	Message    string         `json:"message"`
	Source     string         `json:"source"`
	ProviderID *string        `json:"provider_id"`
	Context    RawChatContext `json:"context"`
	SessionID  *string        `json:"session_id"`
}

type Runtime

type Runtime interface {
	Supports(catalogdomain.AgentProvider) bool
	StartTurn(context.Context, RuntimeTurnInput) (TurnStream, error)
	CloseSession(SessionID) bool
}

func NewRuntime

func NewRuntime(runtimes ...Runtime) Runtime

type RuntimeEnvironmentResolveInput added in v0.3.0

type RuntimeEnvironmentResolveInput struct {
	ProjectID          uuid.UUID
	ProviderAuthConfig map[string]any
	BaseEnvironment    []string
	TicketID           *uuid.UUID
	WorkflowID         *uuid.UUID
	AgentID            *uuid.UUID
}

type RuntimeEnvironmentResolver added in v0.3.0

type RuntimeEnvironmentResolver interface {
	ResolveProviderEnvironment(ctx context.Context, input RuntimeEnvironmentResolveInput) ([]string, error)
}

type RuntimeInterruptDecision

type RuntimeInterruptDecision struct {
	ID    string `json:"id"`
	Label string `json:"label"`
}

type RuntimeInterruptEvent

type RuntimeInterruptEvent struct {
	RequestID string                     `json:"request_id"`
	Kind      string                     `json:"kind"`
	Options   []RuntimeInterruptDecision `json:"options,omitempty"`
	Payload   map[string]any             `json:"payload,omitempty"`
}

type RuntimeInterruptResponseInput

type RuntimeInterruptResponseInput struct {
	SessionID              SessionID
	ProjectID              uuid.UUID
	TicketID               *uuid.UUID
	WorkflowID             *uuid.UUID
	AgentID                *uuid.UUID
	Provider               catalogdomain.AgentProvider
	RequestID              string
	Kind                   string
	Decision               string
	Answer                 map[string]any
	Payload                map[string]any
	WorkingDirectory       provider.AbsolutePath
	Environment            []string
	ResumeProviderThreadID string
	ResumeProviderTurnID   string
	PersistentConversation bool
}

type RuntimeSessionAnchor

type RuntimeSessionAnchor struct {
	ProviderThreadID          string
	LastTurnID                string
	ProviderThreadStatus      string
	ProviderThreadActiveFlags []string
	ProviderAnchorID          string
	ProviderAnchorKind        string
	ProviderTurnSupported     bool
}

type RuntimeTurnInput

type RuntimeTurnInput struct {
	SessionID              SessionID
	ProjectID              uuid.UUID
	TicketID               *uuid.UUID
	WorkflowID             *uuid.UUID
	AgentID                *uuid.UUID
	Provider               catalogdomain.AgentProvider
	Message                string
	SystemPrompt           string
	WorkingDirectory       provider.AbsolutePath
	Environment            []string
	ResumeProviderThreadID string
	ResumeProviderTurnID   string
	MaxTurns               int
	MaxBudgetUSD           float64
	PersistentConversation bool
}

type Service

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

func NewService

func NewService(
	logger *slog.Logger,
	runtime Runtime,
	catalog catalogReader,
	tickets ticketReader,
	workflows workflowReader,
	statuses statusReader,
	projectsRoot provider.AbsolutePath,
) *Service

func (*Service) CloseSession

func (s *Service) CloseSession(userID UserID, sessionID SessionID) bool

func (*Service) EnableDurableSessions

func (s *Service) EnableDurableSessions(path string)

func (*Service) StartTurn

func (s *Service) StartTurn(ctx context.Context, userID UserID, input StartInput) (TurnStream, error)

type SessionID

type SessionID string

func ParseCloseSessionID

func ParseCloseSessionID(raw string) (SessionID, error)

func ParseSessionID

func ParseSessionID(raw string) (SessionID, error)

func (SessionID) String

func (s SessionID) String() string

type Source

type Source string
const (
	SourceProjectSidebar Source = "project_sidebar"
	SourceTicketDetail   Source = "ticket_detail"
)

type StartInput

type StartInput struct {
	Message    string
	Source     Source
	ProviderID *uuid.UUID
	Context    Context
	SessionID  *SessionID
}

func ParseStartInput

func ParseStartInput(raw RawStartInput) (StartInput, error)

type StreamEvent

type StreamEvent struct {
	Event   string
	Payload any
}

type TurnStream

type TurnStream struct {
	Events <-chan StreamEvent
}

type UserID

type UserID string
const AnonymousUserID UserID = "anonymous"
const LocalProjectConversationUserID UserID = "local-user:default"

LocalProjectConversationUserID is the stable non-OIDC owner used for persistent project conversations when browser login is disabled.

func ParseUserID

func ParseUserID(raw string) (UserID, error)

func (UserID) String

func (u UserID) String() string

type WorkspaceBranchName added in v0.5.0

type WorkspaceBranchName string

func ParseWorkspaceBranchName added in v0.5.0

func ParseWorkspaceBranchName(raw string) (WorkspaceBranchName, error)

func (WorkspaceBranchName) String added in v0.5.0

func (n WorkspaceBranchName) String() string

type WorkspaceCheckoutTarget added in v0.5.0

type WorkspaceCheckoutTarget struct {
	Kind                 WorkspaceCheckoutTargetKind
	BranchName           WorkspaceBranchName
	CreateTrackingBranch bool
	LocalBranchName      *WorkspaceBranchName
}

func ParseWorkspaceCheckoutTarget added in v0.5.0

func ParseWorkspaceCheckoutTarget(
	targetKind string,
	targetName string,
	createTrackingBranch bool,
	localBranchName string,
) (WorkspaceCheckoutTarget, error)

type WorkspaceCheckoutTargetKind added in v0.5.0

type WorkspaceCheckoutTargetKind string
const (
	WorkspaceCheckoutTargetKindLocalBranch          WorkspaceCheckoutTargetKind = "local_branch"
	WorkspaceCheckoutTargetKindRemoteTrackingBranch WorkspaceCheckoutTargetKind = "remote_tracking_branch"
	WorkspaceCheckoutTargetKindNewLocalBranch       WorkspaceCheckoutTargetKind = "new_local_branch"
)

type WorkspaceCommitID added in v0.5.0

type WorkspaceCommitID string

func ParseWorkspaceCommitID added in v0.5.0

func ParseWorkspaceCommitID(raw string) (WorkspaceCommitID, error)

func (WorkspaceCommitID) String added in v0.5.0

func (id WorkspaceCommitID) String() string

type WorkspaceCreatableFilePath added in v0.5.0

type WorkspaceCreatableFilePath string

func ParseWorkspaceCreatableFilePath added in v0.5.0

func ParseWorkspaceCreatableFilePath(raw string) (WorkspaceCreatableFilePath, error)

func (WorkspaceCreatableFilePath) String added in v0.5.0

type WorkspaceDeleteableFilePath added in v0.5.0

type WorkspaceDeleteableFilePath string

func ParseWorkspaceDeleteableFilePath added in v0.5.0

func ParseWorkspaceDeleteableFilePath(raw string) (WorkspaceDeleteableFilePath, error)

func (WorkspaceDeleteableFilePath) String added in v0.5.0

type WorkspaceEncoding added in v0.5.0

type WorkspaceEncoding string
const WorkspaceEncodingUTF8 WorkspaceEncoding = "utf-8"

func ParseWorkspaceEncoding added in v0.5.0

func ParseWorkspaceEncoding(raw string) (WorkspaceEncoding, error)

func (WorkspaceEncoding) String added in v0.5.0

func (e WorkspaceEncoding) String() string

type WorkspaceFilePath added in v0.5.0

type WorkspaceFilePath string

func ParseWorkspaceFilePath added in v0.5.0

func ParseWorkspaceFilePath(raw string) (WorkspaceFilePath, error)

func (WorkspaceFilePath) String added in v0.5.0

func (p WorkspaceFilePath) String() string

type WorkspaceFileRevision added in v0.5.0

type WorkspaceFileRevision string

func ParseWorkspaceFileRevision added in v0.5.0

func ParseWorkspaceFileRevision(raw string) (WorkspaceFileRevision, error)

func (WorkspaceFileRevision) String added in v0.5.0

func (r WorkspaceFileRevision) String() string

type WorkspaceGitGraphWindow added in v0.5.0

type WorkspaceGitGraphWindow struct {
	Limit int
}

func ParseWorkspaceGitGraphWindow added in v0.5.0

func ParseWorkspaceGitGraphWindow(raw string) (WorkspaceGitGraphWindow, error)

type WorkspaceLineEnding added in v0.5.0

type WorkspaceLineEnding string
const (
	WorkspaceLineEndingLF   WorkspaceLineEnding = "lf"
	WorkspaceLineEndingCRLF WorkspaceLineEnding = "crlf"
)

func ParseWorkspaceLineEnding added in v0.5.0

func ParseWorkspaceLineEnding(raw string) (WorkspaceLineEnding, error)

func (WorkspaceLineEnding) String added in v0.5.0

func (l WorkspaceLineEnding) String() string

type WorkspaceRenamableFilePath added in v0.5.0

type WorkspaceRenamableFilePath string

func ParseWorkspaceRenamableFilePath added in v0.5.0

func ParseWorkspaceRenamableFilePath(raw string) (WorkspaceRenamableFilePath, error)

func (WorkspaceRenamableFilePath) String added in v0.5.0

type WorkspaceRepoPath added in v0.5.0

type WorkspaceRepoPath string

func ParseWorkspaceRepoPath added in v0.5.0

func ParseWorkspaceRepoPath(raw string) (WorkspaceRepoPath, error)

func (WorkspaceRepoPath) String added in v0.5.0

func (p WorkspaceRepoPath) String() string

type WorkspaceTextContent added in v0.5.0

type WorkspaceTextContent string

func ParseWorkspaceTextContent added in v0.5.0

func ParseWorkspaceTextContent(raw string) (WorkspaceTextContent, error)

func (WorkspaceTextContent) String added in v0.5.0

func (c WorkspaceTextContent) String() string

Jump to

Keyboard shortcuts

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