catalog

package
v0.2.2 Latest Latest
Warning

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

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

Documentation

Index

Constants

View Source
const (
	DefaultActivityEventLimit = 40
	MaxActivityEventLimit     = 200
)
View Source
const (
	DefaultAgentRunTranscriptPageLimit = 200
	MaxAgentRunTranscriptPageLimit     = 500
	AgentRunTranscriptKindStep         = "step"
	AgentRunTranscriptKindTrace        = "trace"

	AgentTraceKindAssistantDelta     = "assistant_delta"
	AgentTraceKindAssistantSnapshot  = "assistant_snapshot"
	AgentTraceKindCommandDelta       = "command_output_delta"
	AgentTraceKindCommandSnapshot    = "command_output_snapshot"
	AgentTraceKindToolCallStarted    = "tool_call_started"
	AgentTraceKindApprovalRequested  = "approval_requested"
	AgentTraceKindUserInputRequested = "user_input_requested"
	AgentTraceKindThreadStatus       = "thread_status"
	AgentTraceKindTaskStarted        = "task_started"
	AgentTraceKindTaskProgress       = "task_progress"
	AgentTraceKindTaskNotification   = "task_notification"
	AgentTraceKindSessionState       = "session_state"
	AgentTraceKindError              = "error"
	AgentTraceKindTurnDiffUpdated    = "turn_diff_updated"
	AgentTraceKindReasoningUpdated   = "reasoning_updated"
)
View Source
const (
	ProviderAvailabilityL4Interval = 30 * time.Minute
	ProviderAvailabilityStaleAfter = 2 * ProviderAvailabilityL4Interval
)
View Source
const (
	DefaultAgentProviderModelTemperature   float64 = 0
	DefaultAgentProviderModelMaxTokens             = 16384
	DefaultAgentProviderMaxParallelRuns            = 0
	DefaultAgentProviderCostPerInputToken  float64 = 0
	DefaultAgentProviderCostPerOutputToken float64 = 0

	AgentProviderAdapterTypeClaudeCodeCLI  AgentProviderAdapterType = "claude-code-cli"
	AgentProviderAdapterTypeCodexAppServer AgentProviderAdapterType = "codex-app-server"
	AgentProviderAdapterTypeGeminiCLI      AgentProviderAdapterType = "gemini-cli"
	AgentProviderAdapterTypeCustom         AgentProviderAdapterType = "custom"
)
View Source
const (
	DefaultAgentProviderPermissionProfile      = AgentProviderPermissionProfileUnrestricted
	AgentProviderPermissionProfileStandard     = "standard"
	AgentProviderPermissionProfileUnrestricted = "unrestricted"
)
View Source
const (
	DefaultAgentStatus                AgentStatus = AgentStatusIdle
	DefaultAgentTotalTokensUsed       int64       = 0
	DefaultAgentTotalTicketsCompleted             = 0

	AgentStatusIdle       AgentStatus = "idle"
	AgentStatusClaimed    AgentStatus = "claimed"
	AgentStatusRunning    AgentStatus = "running"
	AgentStatusPaused     AgentStatus = "paused"
	AgentStatusFailed     AgentStatus = "failed"
	AgentStatusTerminated AgentStatus = "terminated"
)
View Source
const (
	EnvironmentProvisionerRoleSlug            = "env-provisioner"
	EnvironmentProvisionerRoleName            = "Environment Provisioner"
	EnvironmentProvisionerSkillInstallClaude  = "install-claude-code"
	EnvironmentProvisionerSkillInstallCodex   = "install-codex"
	EnvironmentProvisionerSkillSetupGit       = "setup-git"
	EnvironmentProvisionerSkillSetupGitHubCLI = "setup-gh-cli"
)
View Source
const (
	LocalMachineName = "local"
	LocalMachineHost = "local"
)
View Source
const AgentOutputEventType = "agent.output"
View Source
const AgentStepEventType = "agent.step"
View Source
const DefaultAgentRunSummaryPrompt = `` /* 579-byte string literal not displayed */
View Source
const DefaultOrganizationTokenUsageWindowDays = 30

Variables

View Source
var (
	ErrNotFound     = errors.New("catalog resource not found")
	ErrConflict     = errors.New("catalog resource conflict")
	ErrInvalidInput = errors.New("catalog invalid input")

	ErrOrganizationSlugConflict = fmt.Errorf("%w: organization slug already exists", ErrConflict)
	ErrProjectSlugConflict      = fmt.Errorf("%w: project slug already exists", ErrConflict)
	ErrMachineNameConflict      = fmt.Errorf("%w: machine name already exists", ErrConflict)
	ErrMachineInUseConflict     = fmt.Errorf("%w: machine is still referenced by other resources", ErrConflict)

	ErrAgentProviderNameConflict    = fmt.Errorf("%w: agent provider name already exists", ErrConflict)
	ErrProjectRepoNameConflict      = fmt.Errorf("%w: repository name already exists", ErrConflict)
	ErrProjectRepoInUseConflict     = fmt.Errorf("%w: repository is still referenced by other resources", ErrConflict)
	ErrTicketRepoScopeConflict      = fmt.Errorf("%w: repository is already attached to this ticket", ErrConflict)
	ErrTicketRepoScopeInUseConflict = fmt.Errorf("%w: ticket repository scope is still referenced by active runtime resources", ErrConflict)

	ErrAgentNameConflict  = fmt.Errorf("%w: agent name already exists", ErrConflict)
	ErrAgentInUseConflict = fmt.Errorf("%w: agent is still referenced by other resources", ErrConflict)
)

Functions

func AgentOutputMetadataStream

func AgentOutputMetadataStream(metadata map[string]any) string

func AgentTraceOutputKinds

func AgentTraceOutputKinds() []string

func BuiltinAgentProviderPricingConfig

func BuiltinAgentProviderPricingConfig(
	adapterType AgentProviderAdapterType,
	modelID string,
) (pricing.ProviderModelPricingConfig, bool)

func CompareAgentRunTranscriptCursor added in v0.2.0

func CompareAgentRunTranscriptCursor(left AgentRunTranscriptCursor, right AgentRunTranscriptCursor) int

func IsActiveProjectStatus

func IsActiveProjectStatus(status string) bool

func IsTerminalTicketStatusStage

func IsTerminalTicketStatusStage(stage string) bool

func MachineDetectionMessage

func MachineDetectionMessage(
	detectedOS MachineDetectedOS,
	detectedArch MachineDetectedArch,
	status MachineDetectionStatus,
) string

func ResolveAgentProviderPricingConfig

func ResolveAgentProviderPricingConfig(
	adapterType AgentProviderAdapterType,
	modelID string,
	costPerInputToken float64,
	costPerOutputToken float64,
	raw map[string]any,
) pricing.ProviderModelPricingConfig

func ResolveMachineConnectionMode added in v0.2.0

func ResolveMachineConnectionMode(
	connectionModeRaw string,
	reachabilityModeRaw string,
	executionModeRaw string,
	host string,
) (MachineConnectionMode, MachineReachabilityMode, MachineExecutionMode, error)

Types

type ActivityEvent

type ActivityEvent struct {
	ID                  uuid.UUID
	ProjectID           uuid.UUID
	TicketID            *uuid.UUID
	AgentID             *uuid.UUID
	EventType           activityevent.Type
	UnknownEventTypeRaw string
	Message             string
	Metadata            map[string]any
	CreatedAt           time.Time
}

type ActivityEventListInput

type ActivityEventListInput struct {
	AgentID  string
	TicketID string
	Limit    string
}

type Agent

type Agent struct {
	ID                    uuid.UUID
	ProviderID            uuid.UUID
	ProjectID             uuid.UUID
	Name                  string
	RuntimeControlState   AgentRuntimeControlState
	TotalTokensUsed       int64
	TotalTicketsCompleted int
	Runtime               *AgentRuntime
}

type AgentDeleteConflict

type AgentDeleteConflict struct {
	AgentID        uuid.UUID           `json:"agent_id"`
	ActiveRuns     []AgentRunReference `json:"active_runs"`
	HistoricalRuns []AgentRunReference `json:"historical_runs"`
}

func (*AgentDeleteConflict) Error

func (e *AgentDeleteConflict) Error() string

func (*AgentDeleteConflict) Unwrap

func (e *AgentDeleteConflict) Unwrap() error

type AgentEventListInput

type AgentEventListInput struct {
	TicketID string
	Limit    string
}

type AgentInput

type AgentInput struct {
	ProviderID string `json:"provider_id"`
	Name       string `json:"name"`
}

type AgentOutputEntry

type AgentOutputEntry struct {
	ID         uuid.UUID
	ProjectID  uuid.UUID
	AgentID    uuid.UUID
	TicketID   *uuid.UUID
	AgentRunID uuid.UUID
	Stream     string
	Output     string
	CreatedAt  time.Time
}

type AgentOutputListInput

type AgentOutputListInput struct {
	TicketID string
	Limit    string
}

type AgentProvider

type AgentProvider struct {
	ID                    uuid.UUID
	OrganizationID        uuid.UUID
	MachineID             uuid.UUID
	MachineName           string
	MachineHost           string
	MachineStatus         MachineStatus
	MachineSSHUser        *string
	MachineWorkspaceRoot  *string
	MachineAgentCLIPath   *string
	MachineResources      map[string]any
	Name                  string
	AdapterType           AgentProviderAdapterType
	PermissionProfile     AgentProviderPermissionProfile
	AvailabilityState     AgentProviderAvailabilityState
	Available             bool
	AvailabilityCheckedAt *time.Time
	AvailabilityReason    *string
	Capabilities          AgentProviderCapabilities
	CliCommand            string
	CliArgs               []string
	AuthConfig            map[string]any
	CLIRateLimit          map[string]any
	CLIRateLimitUpdatedAt *time.Time
	ModelName             string
	ModelTemperature      float64
	ModelMaxTokens        int
	MaxParallelRuns       int
	CostPerInputToken     float64
	CostPerOutputToken    float64
	PricingConfig         pricing.ProviderModelPricingConfig
}

func DeriveAgentProviderAvailability

func DeriveAgentProviderAvailability(item AgentProvider, now time.Time) AgentProvider

func DeriveAgentProviderCapabilities

func DeriveAgentProviderCapabilities(item AgentProvider) AgentProvider

func DeriveAgentProviderPricing

func DeriveAgentProviderPricing(item AgentProvider) AgentProvider

type AgentProviderAdapterType

type AgentProviderAdapterType string

func BuiltinAgentProviderAdaptersWithModelOptions

func BuiltinAgentProviderAdaptersWithModelOptions() []AgentProviderAdapterType

func (AgentProviderAdapterType) IsValid

func (s AgentProviderAdapterType) IsValid() bool

func (AgentProviderAdapterType) String

func (s AgentProviderAdapterType) String() string

type AgentProviderAvailabilityState

type AgentProviderAvailabilityState string
const (
	AgentProviderAvailabilityStateUnknown     AgentProviderAvailabilityState = "unknown"
	AgentProviderAvailabilityStateAvailable   AgentProviderAvailabilityState = "available"
	AgentProviderAvailabilityStateUnavailable AgentProviderAvailabilityState = "unavailable"
	AgentProviderAvailabilityStateStale       AgentProviderAvailabilityState = "stale"
)

func ResolveAgentProviderAvailability

func ResolveAgentProviderAvailability(
	item AgentProvider,
	now time.Time,
) (AgentProviderAvailabilityState, *time.Time, *string)

func (AgentProviderAvailabilityState) IsValid

func (AgentProviderAvailabilityState) String

type AgentProviderCapabilities

type AgentProviderCapabilities struct {
	EphemeralChat AgentProviderCapability
	HarnessAI     AgentProviderCapability
	SkillAI       AgentProviderCapability
}

func ResolveAgentProviderCapabilities

func ResolveAgentProviderCapabilities(item AgentProvider) AgentProviderCapabilities

type AgentProviderCapability

type AgentProviderCapability struct {
	State  AgentProviderCapabilityState
	Reason *string
}

func ResolveAgentProviderEphemeralChatCapability

func ResolveAgentProviderEphemeralChatCapability(item AgentProvider) AgentProviderCapability

func ResolveAgentProviderHarnessAICapability

func ResolveAgentProviderHarnessAICapability(item AgentProvider) AgentProviderCapability

func ResolveAgentProviderSkillAICapability

func ResolveAgentProviderSkillAICapability(item AgentProvider) AgentProviderCapability

type AgentProviderCapabilityState

type AgentProviderCapabilityState string
const (
	AgentProviderCapabilityStateAvailable   AgentProviderCapabilityState = "available"
	AgentProviderCapabilityStateUnavailable AgentProviderCapabilityState = "unavailable"
	AgentProviderCapabilityStateUnsupported AgentProviderCapabilityState = "unsupported"
)

func (AgentProviderCapabilityState) IsValid

func (s AgentProviderCapabilityState) IsValid() bool

func (AgentProviderCapabilityState) String

type AgentProviderInput

type AgentProviderInput struct {
	MachineID          string         `json:"machine_id"`
	Name               string         `json:"name"`
	AdapterType        string         `json:"adapter_type"`
	PermissionProfile  string         `json:"permission_profile"`
	CliCommand         string         `json:"cli_command"`
	CliArgs            []string       `json:"cli_args"`
	AuthConfig         map[string]any `json:"auth_config"`
	ModelName          string         `json:"model_name"`
	ModelTemperature   *float64       `json:"model_temperature"`
	ModelMaxTokens     *int           `json:"model_max_tokens"`
	MaxParallelRuns    *int           `json:"max_parallel_runs"`
	CostPerInputToken  *float64       `json:"cost_per_input_token"`
	CostPerOutputToken *float64       `json:"cost_per_output_token"`
	PricingConfig      map[string]any `json:"pricing_config"`
}

type AgentProviderModelOption

type AgentProviderModelOption struct {
	ID            string
	Label         string
	Description   string
	Recommended   bool
	Preview       bool
	PricingConfig *pricing.ProviderModelPricingConfig
}

func BuiltinAgentProviderModelOptions

func BuiltinAgentProviderModelOptions(adapterType AgentProviderAdapterType) []AgentProviderModelOption

type AgentProviderPermissionProfile

type AgentProviderPermissionProfile string

func (AgentProviderPermissionProfile) IsValid

func (AgentProviderPermissionProfile) String

type AgentRun

type AgentRun struct {
	ID                           uuid.UUID
	AgentID                      uuid.UUID
	WorkflowID                   uuid.UUID
	WorkflowVersionID            *uuid.UUID
	TicketID                     uuid.UUID
	ProviderID                   uuid.UUID
	SkillVersionIDs              []uuid.UUID
	Status                       AgentRunStatus
	SessionID                    string
	RuntimeStartedAt             *time.Time
	TerminalAt                   *time.Time
	LastError                    string
	LastHeartbeatAt              *time.Time
	InputTokens                  int64
	OutputTokens                 int64
	CachedInputTokens            int64
	CacheCreationInputTokens     int64
	ReasoningTokens              int64
	PromptTokens                 int64
	CandidateTokens              int64
	ToolTokens                   int64
	TotalTokens                  int64
	CurrentStepStatus            *string
	CurrentStepSummary           *string
	CurrentStepChangedAt         *time.Time
	CompletionSummaryStatus      *AgentRunCompletionSummaryStatus
	CompletionSummaryMarkdown    *string
	CompletionSummaryJSON        map[string]any
	CompletionSummaryInput       map[string]any
	CompletionSummaryGeneratedAt *time.Time
	CompletionSummaryError       *string
	CreatedAt                    time.Time
}

type AgentRunCompletionSummaryStatus

type AgentRunCompletionSummaryStatus string
const (
	AgentRunCompletionSummaryStatusPending   AgentRunCompletionSummaryStatus = "pending"
	AgentRunCompletionSummaryStatusCompleted AgentRunCompletionSummaryStatus = "completed"
	AgentRunCompletionSummaryStatusFailed    AgentRunCompletionSummaryStatus = "failed"
)

func (AgentRunCompletionSummaryStatus) IsValid

func (AgentRunCompletionSummaryStatus) String

type AgentRunReference

type AgentRunReference struct {
	ID       uuid.UUID `json:"id"`
	TicketID uuid.UUID `json:"ticket_id"`
	Status   string    `json:"status"`
}

type AgentRunStatus

type AgentRunStatus string
const (
	AgentRunStatusLaunching  AgentRunStatus = "launching"
	AgentRunStatusReady      AgentRunStatus = "ready"
	AgentRunStatusExecuting  AgentRunStatus = "executing"
	AgentRunStatusCompleted  AgentRunStatus = "completed"
	AgentRunStatusErrored    AgentRunStatus = "errored"
	AgentRunStatusTerminated AgentRunStatus = "terminated"
)

func (AgentRunStatus) IsValid

func (s AgentRunStatus) IsValid() bool

func (AgentRunStatus) String

func (s AgentRunStatus) String() string

type AgentRunSummaryPromptSource

type AgentRunSummaryPromptSource string
const (
	AgentRunSummaryPromptSourceBuiltin         AgentRunSummaryPromptSource = "builtin"
	AgentRunSummaryPromptSourceProjectOverride AgentRunSummaryPromptSource = "project_override"
)

func EffectiveAgentRunSummaryPrompt

func EffectiveAgentRunSummaryPrompt(rawOverride string) (string, AgentRunSummaryPromptSource)

func (AgentRunSummaryPromptSource) String

type AgentRunTranscriptCursor added in v0.2.0

type AgentRunTranscriptCursor struct {
	CreatedAt time.Time
	Kind      string
	Order     int64
	ID        uuid.UUID
}

func AgentRunTranscriptCursorForStep added in v0.2.0

func AgentRunTranscriptCursorForStep(entry AgentStepEntry) AgentRunTranscriptCursor

func AgentRunTranscriptCursorForTrace added in v0.2.0

func AgentRunTranscriptCursorForTrace(entry AgentTraceEntry) AgentRunTranscriptCursor

func ParseAgentRunTranscriptCursor added in v0.2.0

func ParseAgentRunTranscriptCursor(raw string) (AgentRunTranscriptCursor, error)

func (AgentRunTranscriptCursor) String added in v0.2.0

func (c AgentRunTranscriptCursor) String() string

type AgentRunTranscriptItem added in v0.2.0

type AgentRunTranscriptItem struct {
	Kind       string
	Cursor     string
	TraceEntry *AgentTraceEntry
	StepEntry  *AgentStepEntry
}

type AgentRunTranscriptPage added in v0.2.0

type AgentRunTranscriptPage struct {
	Items            []AgentRunTranscriptItem
	HasOlder         bool
	HiddenOlderCount int
	HasNewer         bool
	HiddenNewerCount int
	OldestCursor     string
	NewestCursor     string
}

type AgentRunTranscriptPageInput added in v0.2.0

type AgentRunTranscriptPageInput struct {
	Limit  string
	Before string
	After  string
}

type AgentRuntime

type AgentRuntime struct {
	ActiveRunCount       int
	CurrentRunID         *uuid.UUID
	Status               AgentStatus
	CurrentTicketID      *uuid.UUID
	SessionID            string
	RuntimePhase         AgentRuntimePhase
	RuntimeStartedAt     *time.Time
	LastError            string
	LastHeartbeatAt      *time.Time
	CurrentStepStatus    *string
	CurrentStepSummary   *string
	CurrentStepChangedAt *time.Time
}

func BuildAgentRuntimeSummary

func BuildAgentRuntimeSummary(currentRuns []AgentRun, controlState AgentRuntimeControlState) *AgentRuntime

type AgentRuntimeControlState

type AgentRuntimeControlState string
const (
	DefaultAgentRuntimeControlState        AgentRuntimeControlState = AgentRuntimeControlStateActive
	AgentRuntimeControlStateActive         AgentRuntimeControlState = "active"
	AgentRuntimeControlStatePauseRequested AgentRuntimeControlState = "pause_requested"
	AgentRuntimeControlStatePaused         AgentRuntimeControlState = "paused"
	AgentRuntimeControlStateRetired        AgentRuntimeControlState = "retired"
)

func ResolvePauseRuntimeControlState

func ResolvePauseRuntimeControlState(agent Agent) (AgentRuntimeControlState, error)

func ResolveResumeRuntimeControlState

func ResolveResumeRuntimeControlState(agent Agent) (AgentRuntimeControlState, error)

func ResolveRetireRuntimeControlState

func ResolveRetireRuntimeControlState(agent Agent) (AgentRuntimeControlState, error)

func (AgentRuntimeControlState) IsValid

func (s AgentRuntimeControlState) IsValid() bool

func (AgentRuntimeControlState) String

func (s AgentRuntimeControlState) String() string

type AgentRuntimePhase

type AgentRuntimePhase string
const (
	DefaultAgentRuntimePhase   AgentRuntimePhase = AgentRuntimePhaseNone
	AgentRuntimePhaseNone      AgentRuntimePhase = "none"
	AgentRuntimePhaseLaunching AgentRuntimePhase = "launching"
	AgentRuntimePhaseReady     AgentRuntimePhase = "ready"
	AgentRuntimePhaseExecuting AgentRuntimePhase = "executing"
	AgentRuntimePhaseFailed    AgentRuntimePhase = "failed"
)

func (AgentRuntimePhase) IsValid

func (s AgentRuntimePhase) IsValid() bool

func (AgentRuntimePhase) String

func (s AgentRuntimePhase) String() string

type AgentStatus

type AgentStatus string

func (AgentStatus) IsValid

func (s AgentStatus) IsValid() bool

func (AgentStatus) String

func (s AgentStatus) String() string

type AgentStepEntry

type AgentStepEntry struct {
	ID                 uuid.UUID
	ProjectID          uuid.UUID
	AgentID            uuid.UUID
	TicketID           *uuid.UUID
	AgentRunID         uuid.UUID
	StepStatus         string
	Summary            string
	SourceTraceEventID *uuid.UUID
	CreatedAt          time.Time
}

type AgentTraceEntry

type AgentTraceEntry struct {
	ID         uuid.UUID
	ProjectID  uuid.UUID
	AgentID    uuid.UUID
	TicketID   *uuid.UUID
	AgentRunID uuid.UUID
	Sequence   int64
	Provider   string
	Kind       string
	Stream     string
	Output     string
	Payload    map[string]any
	CreatedAt  time.Time
}

type BuiltinAgentProviderTemplate

type BuiltinAgentProviderTemplate struct {
	ID          string
	Name        string
	Command     string
	AdapterType AgentProviderAdapterType
	ModelName   string
	CliArgs     []string
}

func BuiltinAgentProviderTemplates

func BuiltinAgentProviderTemplates() []BuiltinAgentProviderTemplate

type CreateAgent

type CreateAgent struct {
	ProjectID             uuid.UUID
	ProviderID            uuid.UUID
	Name                  string
	RuntimeControlState   AgentRuntimeControlState
	TotalTokensUsed       int64
	TotalTicketsCompleted int
}

func ParseCreateAgent

func ParseCreateAgent(projectID uuid.UUID, raw AgentInput) (CreateAgent, error)

type CreateAgentProvider

type CreateAgentProvider struct {
	OrganizationID     uuid.UUID
	MachineID          uuid.UUID
	Name               string
	AdapterType        AgentProviderAdapterType
	PermissionProfile  AgentProviderPermissionProfile
	CliCommand         string
	CliArgs            []string
	AuthConfig         map[string]any
	ModelName          string
	ModelTemperature   float64
	ModelMaxTokens     int
	MaxParallelRuns    int
	CostPerInputToken  float64
	CostPerOutputToken float64
	PricingConfig      pricing.ProviderModelPricingConfig
}

func ParseCreateAgentProvider

func ParseCreateAgentProvider(organizationID uuid.UUID, raw AgentProviderInput) (CreateAgentProvider, error)

type CreateMachine

type CreateMachine struct {
	OrganizationID        uuid.UUID
	Name                  string
	Host                  string
	Port                  int
	ReachabilityMode      MachineReachabilityMode
	ExecutionMode         MachineExecutionMode
	ConnectionMode        MachineConnectionMode
	TransportCapabilities []MachineTransportCapability
	SSHUser               *string
	SSHKeyPath            *string
	AdvertisedEndpoint    *string
	DaemonStatus          MachineDaemonStatus
	DetectedOS            MachineDetectedOS
	DetectedArch          MachineDetectedArch
	DetectionStatus       MachineDetectionStatus
	ChannelCredential     MachineChannelCredential
	Description           string
	Labels                []string
	Status                MachineStatus
	WorkspaceRoot         *string
	AgentCLIPath          *string
	EnvVars               []string
}

func ParseCreateMachine

func ParseCreateMachine(organizationID uuid.UUID, raw MachineInput) (CreateMachine, error)

type CreateOrganization

type CreateOrganization struct {
	Name                   string
	Slug                   string
	DefaultAgentProviderID *uuid.UUID
}

func ParseCreateOrganization

func ParseCreateOrganization(raw OrganizationInput) (CreateOrganization, error)

type CreateProject

type CreateProject struct {
	OrganizationID         uuid.UUID
	Name                   string
	Slug                   string
	Description            string
	Status                 ProjectStatus
	DefaultAgentProviderID *uuid.UUID
	AccessibleMachineIDs   []uuid.UUID
	MaxConcurrentAgents    int
	AgentRunSummaryPrompt  string
}

func ParseCreateProject

func ParseCreateProject(organizationID uuid.UUID, raw ProjectInput) (CreateProject, error)

type CreateProjectRepo

type CreateProjectRepo struct {
	ProjectID        uuid.UUID
	Name             string
	RepositoryURL    string
	DefaultBranch    string
	WorkspaceDirname string
	Labels           []string
}

func ParseCreateProjectRepo

func ParseCreateProjectRepo(projectID uuid.UUID, raw ProjectRepoInput) (CreateProjectRepo, error)

type CreateTicketRepoScope

type CreateTicketRepoScope struct {
	ProjectID      uuid.UUID
	TicketID       uuid.UUID
	RepoID         uuid.UUID
	BranchName     *string
	PullRequestURL *string
}

func ParseCreateTicketRepoScope

func ParseCreateTicketRepoScope(projectID uuid.UUID, ticketID uuid.UUID, raw TicketRepoScopeInput) (CreateTicketRepoScope, error)

type GetOrganizationTokenUsage

type GetOrganizationTokenUsage struct {
	OrganizationID uuid.UUID
	FromDate       time.Time
	ToDate         time.Time
}

func ParseOrganizationTokenUsage

func ParseOrganizationTokenUsage(
	organizationID uuid.UUID,
	raw OrganizationTokenUsageListInput,
	now time.Time,
) (GetOrganizationTokenUsage, error)

type GetProjectTokenUsage

type GetProjectTokenUsage struct {
	ProjectID uuid.UUID
	FromDate  time.Time
	ToDate    time.Time
}

func ParseProjectTokenUsage

func ParseProjectTokenUsage(
	projectID uuid.UUID,
	raw ProjectTokenUsageListInput,
	now time.Time,
) (GetProjectTokenUsage, error)

type ListActivityEvents

type ListActivityEvents struct {
	ProjectID uuid.UUID
	AgentID   *uuid.UUID
	TicketID  *uuid.UUID
	Limit     int
}

func ParseListActivityEvents

func ParseListActivityEvents(projectID uuid.UUID, raw ActivityEventListInput) (ListActivityEvents, error)

type ListAgentOutput

type ListAgentOutput struct {
	ProjectID uuid.UUID
	AgentID   uuid.UUID
	TicketID  *uuid.UUID
	Limit     int
}

func ParseListAgentOutput

func ParseListAgentOutput(projectID uuid.UUID, agentID uuid.UUID, raw AgentOutputListInput) (ListAgentOutput, error)

type ListAgentRunStepEntries

type ListAgentRunStepEntries struct {
	ProjectID  uuid.UUID
	AgentRunID uuid.UUID
	Limit      int
}

type ListAgentRunTraceEntries

type ListAgentRunTraceEntries struct {
	ProjectID  uuid.UUID
	AgentRunID uuid.UUID
	Limit      int
}

type ListAgentRunTranscriptPage added in v0.2.0

type ListAgentRunTranscriptPage struct {
	ProjectID  uuid.UUID
	AgentRunID uuid.UUID
	Limit      int
	Before     *AgentRunTranscriptCursor
	After      *AgentRunTranscriptCursor
}

func ParseListAgentRunTranscriptPage added in v0.2.0

func ParseListAgentRunTranscriptPage(
	projectID uuid.UUID,
	agentRunID uuid.UUID,
	raw AgentRunTranscriptPageInput,
) (ListAgentRunTranscriptPage, error)

type ListAgentSteps

type ListAgentSteps struct {
	ProjectID uuid.UUID
	AgentID   uuid.UUID
	TicketID  *uuid.UUID
	Limit     int
}

func ParseListAgentSteps

func ParseListAgentSteps(projectID uuid.UUID, agentID uuid.UUID, raw AgentEventListInput) (ListAgentSteps, error)

type Machine

type Machine struct {
	ID                    uuid.UUID
	OrganizationID        uuid.UUID
	Name                  string
	Host                  string
	Port                  int
	ReachabilityMode      MachineReachabilityMode
	ExecutionMode         MachineExecutionMode
	ConnectionMode        MachineConnectionMode
	TransportCapabilities []MachineTransportCapability
	SSHUser               *string
	SSHKeyPath            *string
	AdvertisedEndpoint    *string
	DaemonStatus          MachineDaemonStatus
	DetectedOS            MachineDetectedOS
	DetectedArch          MachineDetectedArch
	DetectionStatus       MachineDetectionStatus
	ChannelCredential     MachineChannelCredential
	Description           string
	Labels                []string
	Status                MachineStatus
	WorkspaceRoot         *string
	AgentCLIPath          *string
	EnvVars               []string
	LastHeartbeatAt       *time.Time
	Resources             map[string]any
}

type MachineAgentAuthMode

type MachineAgentAuthMode string
const (
	MachineAgentAuthModeUnknown MachineAgentAuthMode = "unknown"
	MachineAgentAuthModeLogin   MachineAgentAuthMode = "login"
	MachineAgentAuthModeAPIKey  MachineAgentAuthMode = "api_key"
)

type MachineAgentAuthStatus

type MachineAgentAuthStatus string
const (
	MachineAgentAuthStatusUnknown     MachineAgentAuthStatus = "unknown"
	MachineAgentAuthStatusLoggedIn    MachineAgentAuthStatus = "logged_in"
	MachineAgentAuthStatusNotLoggedIn MachineAgentAuthStatus = "not_logged_in"
)

type MachineAgentCLI

type MachineAgentCLI struct {
	Name       string
	Installed  bool
	Version    string
	AuthStatus MachineAgentAuthStatus
	AuthMode   MachineAgentAuthMode
	Ready      bool
}

type MachineAgentEnvironment

type MachineAgentEnvironment struct {
	CollectedAt  time.Time
	Dispatchable bool
	CLIs         []MachineAgentCLI
}

func ParseMachineAgentEnvironment

func ParseMachineAgentEnvironment(raw string, collectedAt time.Time) (MachineAgentEnvironment, error)

type MachineChannelCredential

type MachineChannelCredential struct {
	Kind          MachineChannelCredentialKind
	TokenID       *string
	CertificateID *string
}

type MachineChannelCredentialInput

type MachineChannelCredentialInput struct {
	Kind          string  `json:"kind"`
	TokenID       *string `json:"token_id"`
	CertificateID *string `json:"certificate_id"`
}

type MachineChannelCredentialKind

type MachineChannelCredentialKind string
const (
	MachineChannelCredentialKindNone        MachineChannelCredentialKind = "none"
	MachineChannelCredentialKindToken       MachineChannelCredentialKind = "token"
	MachineChannelCredentialKindCertificate MachineChannelCredentialKind = "certificate"
)

func ParseStoredMachineChannelCredentialKind

func ParseStoredMachineChannelCredentialKind(raw string) (MachineChannelCredentialKind, error)

func (MachineChannelCredentialKind) IsValid

func (k MachineChannelCredentialKind) IsValid() bool

func (MachineChannelCredentialKind) String

type MachineConnectionMode

type MachineConnectionMode string
const (
	MachineConnectionModeLocal      MachineConnectionMode = "local"
	MachineConnectionModeSSH        MachineConnectionMode = "ssh"
	MachineConnectionModeWSReverse  MachineConnectionMode = "ws_reverse"
	MachineConnectionModeWSListener MachineConnectionMode = "ws_listener"
)

func ParseStoredMachineConnectionMode

func ParseStoredMachineConnectionMode(raw string, host string) (MachineConnectionMode, error)

func (MachineConnectionMode) ExecutionMode added in v0.2.0

func (m MachineConnectionMode) ExecutionMode() MachineExecutionMode

func (MachineConnectionMode) IsValid

func (m MachineConnectionMode) IsValid() bool

func (MachineConnectionMode) ReachabilityMode added in v0.2.0

func (m MachineConnectionMode) ReachabilityMode() MachineReachabilityMode

func (MachineConnectionMode) RequiresSSHHelper added in v0.2.0

func (m MachineConnectionMode) RequiresSSHHelper() bool

func (MachineConnectionMode) String

func (m MachineConnectionMode) String() string

type MachineDaemonStatus

type MachineDaemonStatus struct {
	Registered       bool
	LastRegisteredAt *time.Time
	CurrentSessionID *string
	SessionState     MachineTransportSessionState
}

type MachineDaemonStatusInput

type MachineDaemonStatusInput struct {
	Registered       *bool   `json:"registered"`
	LastRegisteredAt *string `json:"last_registered_at"`
	CurrentSessionID *string `json:"current_session_id"`
	SessionState     string  `json:"session_state"`
}

type MachineDetectedArch

type MachineDetectedArch string
const (
	MachineDetectedArchAMD64   MachineDetectedArch = "amd64"
	MachineDetectedArchARM64   MachineDetectedArch = "arm64"
	MachineDetectedArchUnknown MachineDetectedArch = "unknown"
)

func ParseStoredMachineDetectedArch

func ParseStoredMachineDetectedArch(raw string) (MachineDetectedArch, error)

func (MachineDetectedArch) IsValid

func (a MachineDetectedArch) IsValid() bool

func (MachineDetectedArch) String

func (a MachineDetectedArch) String() string

type MachineDetectedOS

type MachineDetectedOS string
const (
	MachineDetectedOSDarwin  MachineDetectedOS = "darwin"
	MachineDetectedOSLinux   MachineDetectedOS = "linux"
	MachineDetectedOSUnknown MachineDetectedOS = "unknown"
)

func ParseStoredMachineDetectedOS

func ParseStoredMachineDetectedOS(raw string) (MachineDetectedOS, error)

func (MachineDetectedOS) IsValid

func (o MachineDetectedOS) IsValid() bool

func (MachineDetectedOS) String

func (o MachineDetectedOS) String() string

type MachineDetectionStatus

type MachineDetectionStatus string
const (
	MachineDetectionStatusPending  MachineDetectionStatus = "pending"
	MachineDetectionStatusOK       MachineDetectionStatus = "ok"
	MachineDetectionStatusDegraded MachineDetectionStatus = "degraded"
	MachineDetectionStatusUnknown  MachineDetectionStatus = "unknown"
)

func ParseStoredMachineDetectionStatus

func ParseStoredMachineDetectionStatus(raw string) (MachineDetectionStatus, error)

func (MachineDetectionStatus) IsValid

func (s MachineDetectionStatus) IsValid() bool

func (MachineDetectionStatus) String

func (s MachineDetectionStatus) String() string

type MachineEnvironmentProvisioningIssue

type MachineEnvironmentProvisioningIssue struct {
	Code      string  `json:"code"`
	Source    string  `json:"source"`
	Title     string  `json:"title"`
	Detail    string  `json:"detail"`
	SkillName *string `json:"skill_name,omitempty"`
}

type MachineEnvironmentProvisioningPlan

type MachineEnvironmentProvisioningPlan struct {
	Available         bool                                  `json:"available"`
	Needed            bool                                  `json:"needed"`
	Runnable          bool                                  `json:"runnable"`
	RoleSlug          string                                `json:"role_slug"`
	RoleName          string                                `json:"role_name"`
	RequiredSkills    []string                              `json:"required_skills"`
	Summary           string                                `json:"summary"`
	Issues            []MachineEnvironmentProvisioningIssue `json:"issues"`
	Notes             []string                              `json:"notes"`
	TicketTitle       string                                `json:"ticket_title"`
	TicketDescription string                                `json:"ticket_description"`
}

func PlanMachineEnvironmentProvisioning

func PlanMachineEnvironmentProvisioning(machine Machine) MachineEnvironmentProvisioningPlan

type MachineExecutionMode added in v0.2.0

type MachineExecutionMode string
const (
	MachineExecutionModeLocalProcess MachineExecutionMode = "local_process"
	MachineExecutionModeWebsocket    MachineExecutionMode = "websocket"
	MachineExecutionModeSSHCompat    MachineExecutionMode = "ssh_compat"
)

func ParseStoredMachineExecutionMode added in v0.2.0

func ParseStoredMachineExecutionMode(raw string, host string) (MachineExecutionMode, error)

func (MachineExecutionMode) IsValid added in v0.2.0

func (m MachineExecutionMode) IsValid() bool

func (MachineExecutionMode) String added in v0.2.0

func (m MachineExecutionMode) String() string

type MachineFullAudit

type MachineFullAudit struct {
	CollectedAt      time.Time
	Git              MachineGitAudit
	GitHubCLI        MachineGitHubCLIAudit
	GitHubTokenProbe githubauthdomain.TokenProbe
	Network          MachineNetworkAudit
}

func ParseMachineFullAudit

func ParseMachineFullAudit(raw string, collectedAt time.Time) (MachineFullAudit, error)

type MachineGPU

type MachineGPU struct {
	Index              int
	Name               string
	MemoryTotalGB      float64
	MemoryUsedGB       float64
	UtilizationPercent float64
}

type MachineGPUResources

type MachineGPUResources struct {
	CollectedAt time.Time
	Available   bool
	GPUs        []MachineGPU
}

func ParseMachineGPUResources

func ParseMachineGPUResources(raw string, collectedAt time.Time) (MachineGPUResources, error)

type MachineGitAudit

type MachineGitAudit struct {
	Installed bool
	UserName  string
	UserEmail string
}

type MachineGitHubCLIAudit

type MachineGitHubCLIAudit struct {
	Installed  bool
	AuthStatus MachineAgentAuthStatus
}

type MachineInput

type MachineInput struct {
	Name                  string                         `json:"name"`
	Host                  string                         `json:"host"`
	Port                  *int                           `json:"port"`
	ReachabilityMode      string                         `json:"reachability_mode"`
	ExecutionMode         string                         `json:"execution_mode"`
	ConnectionMode        string                         `json:"connection_mode"`
	TransportCapabilities []string                       `json:"transport_capabilities"`
	SSHUser               *string                        `json:"ssh_user"`
	SSHKeyPath            *string                        `json:"ssh_key_path"`
	AdvertisedEndpoint    *string                        `json:"advertised_endpoint"`
	DaemonStatus          MachineDaemonStatusInput       `json:"daemon_status"`
	DetectedOS            string                         `json:"detected_os"`
	DetectedArch          string                         `json:"detected_arch"`
	DetectionStatus       string                         `json:"detection_status"`
	ChannelCredential     *MachineChannelCredentialInput `json:"channel_credential"`
	Description           string                         `json:"description"`
	Labels                []string                       `json:"labels"`
	Status                string                         `json:"status"`
	WorkspaceRoot         *string                        `json:"workspace_root"`
	AgentCLIPath          *string                        `json:"agent_cli_path"`
	EnvVars               []string                       `json:"env_vars"`
}

type MachineNetworkAudit

type MachineNetworkAudit struct {
	GitHubReachable bool
	PyPIReachable   bool
	NPMReachable    bool
}

type MachineProbe

type MachineProbe struct {
	CheckedAt       time.Time
	Transport       string
	Output          string
	Resources       map[string]any
	DetectedOS      MachineDetectedOS
	DetectedArch    MachineDetectedArch
	DetectionStatus MachineDetectionStatus
}

type MachineReachability

type MachineReachability struct {
	CheckedAt    time.Time
	Transport    string
	Reachable    bool
	LatencyMS    int64
	FailureCause string
}

type MachineReachabilityMode added in v0.2.0

type MachineReachabilityMode string
const (
	MachineReachabilityModeLocal          MachineReachabilityMode = "local"
	MachineReachabilityModeDirectConnect  MachineReachabilityMode = "direct_connect"
	MachineReachabilityModeReverseConnect MachineReachabilityMode = "reverse_connect"
)

func ParseStoredMachineReachabilityMode added in v0.2.0

func ParseStoredMachineReachabilityMode(raw string, host string) (MachineReachabilityMode, error)

func (MachineReachabilityMode) IsValid added in v0.2.0

func (m MachineReachabilityMode) IsValid() bool

func (MachineReachabilityMode) String added in v0.2.0

func (m MachineReachabilityMode) String() string

type MachineStatus

type MachineStatus string
const (
	MachineStatusOnline      MachineStatus = "online"
	MachineStatusOffline     MachineStatus = "offline"
	MachineStatusDegraded    MachineStatus = "degraded"
	MachineStatusMaintenance MachineStatus = "maintenance"
)

func (MachineStatus) IsValid

func (s MachineStatus) IsValid() bool

func (MachineStatus) String

func (s MachineStatus) String() string

type MachineSystemResources

type MachineSystemResources struct {
	CollectedAt            time.Time
	CPUCores               int
	CPUUsagePercent        float64
	MemoryTotalGB          float64
	MemoryUsedGB           float64
	MemoryAvailableGB      float64
	MemoryAvailablePercent float64
	DiskTotalGB            float64
	DiskAvailableGB        float64
	DiskAvailablePercent   float64
}

func ParseMachineSystemResources

func ParseMachineSystemResources(raw string, collectedAt time.Time) (MachineSystemResources, error)

type MachineTransportCapability

type MachineTransportCapability string
const (
	MachineTransportCapabilityProbe            MachineTransportCapability = "probe"
	MachineTransportCapabilityWorkspacePrepare MachineTransportCapability = "workspace_prepare"
	MachineTransportCapabilityArtifactSync     MachineTransportCapability = "artifact_sync"
	MachineTransportCapabilityProcessStreaming MachineTransportCapability = "process_streaming"
)

func ParseStoredMachineTransportCapabilities

func ParseStoredMachineTransportCapabilities(
	raw []string,
	mode MachineConnectionMode,
) ([]MachineTransportCapability, error)

func SupportedMachineTransportCapabilities added in v0.2.0

func SupportedMachineTransportCapabilities(mode MachineConnectionMode) []MachineTransportCapability

func (MachineTransportCapability) IsValid

func (c MachineTransportCapability) IsValid() bool

func (MachineTransportCapability) String

type MachineTransportSessionState

type MachineTransportSessionState string
const (
	MachineTransportSessionStateUnknown      MachineTransportSessionState = "unknown"
	MachineTransportSessionStateConnected    MachineTransportSessionState = "connected"
	MachineTransportSessionStateDisconnected MachineTransportSessionState = "disconnected"
	MachineTransportSessionStateUnavailable  MachineTransportSessionState = "unavailable"
)

func ParseStoredMachineSessionState

func ParseStoredMachineSessionState(raw string) (MachineTransportSessionState, error)

func (MachineTransportSessionState) IsValid

func (s MachineTransportSessionState) IsValid() bool

func (MachineTransportSessionState) String

type Organization

type Organization struct {
	ID                     uuid.UUID
	Name                   string
	Slug                   string
	Status                 OrganizationStatus
	DefaultAgentProviderID *uuid.UUID
}

type OrganizationDailyTokenUsage

type OrganizationDailyTokenUsage struct {
	UsageDate         time.Time
	InputTokens       int64
	OutputTokens      int64
	CachedInputTokens int64
	ReasoningTokens   int64
	TotalTokens       int64
	FinalizedRunCount int
	RecomputedAt      time.Time
	SourceMode        string
}

type OrganizationDashboardSummary

type OrganizationDashboardSummary struct {
	OrganizationID     uuid.UUID
	ProjectCount       int
	ActiveProjectCount int
	ProviderCount      int
	RunningAgents      int
	ActiveTickets      int
	TodayCost          float64
	TotalTokens        int64
	Projects           []OrganizationProjectSummary
}

type OrganizationInput

type OrganizationInput struct {
	Name                   string  `json:"name"`
	Slug                   string  `json:"slug"`
	DefaultAgentProviderID *string `json:"default_agent_provider_id"`
}

type OrganizationProjectSummary

type OrganizationProjectSummary struct {
	ProjectID      uuid.UUID
	Name           string
	Description    string
	Status         string
	RunningAgents  int
	ActiveTickets  int
	TodayCost      float64
	TotalTokens    int64
	LastActivityAt *time.Time
}

type OrganizationStatus

type OrganizationStatus string
const (
	OrganizationStatusActive   OrganizationStatus = "active"
	OrganizationStatusArchived OrganizationStatus = "archived"
)

func (OrganizationStatus) IsValid

func (s OrganizationStatus) IsValid() bool

func (OrganizationStatus) String

func (s OrganizationStatus) String() string

type OrganizationTokenUsageListInput

type OrganizationTokenUsageListInput struct {
	From string
	To   string
}

type OrganizationTokenUsagePeakDay

type OrganizationTokenUsagePeakDay struct {
	Date        time.Time
	TotalTokens int64
}

type OrganizationTokenUsageReport

type OrganizationTokenUsageReport struct {
	OrganizationID uuid.UUID
	FromDate       time.Time
	ToDate         time.Time
	Days           []OrganizationDailyTokenUsage
	Summary        OrganizationTokenUsageSummary
}

type OrganizationTokenUsageSummary

type OrganizationTokenUsageSummary struct {
	TotalTokens    int64
	AvgDailyTokens int64
	PeakDay        *OrganizationTokenUsagePeakDay
}

type Project

type Project struct {
	ID                     uuid.UUID
	OrganizationID         uuid.UUID
	Name                   string
	Slug                   string
	Description            string
	Status                 ProjectStatus
	DefaultAgentProviderID *uuid.UUID
	AccessibleMachineIDs   []uuid.UUID
	MaxConcurrentAgents    int
	AgentRunSummaryPrompt  string
}

type ProjectDailyTokenUsage

type ProjectDailyTokenUsage = OrganizationDailyTokenUsage

type ProjectInput

type ProjectInput struct {
	Name                   string   `json:"name"`
	Slug                   string   `json:"slug"`
	Description            string   `json:"description"`
	Status                 string   `json:"status"`
	DefaultAgentProviderID *string  `json:"default_agent_provider_id"`
	AccessibleMachineIDs   []string `json:"accessible_machine_ids"`
	MaxConcurrentAgents    *int     `json:"max_concurrent_agents"`
	AgentRunSummaryPrompt  *string  `json:"agent_run_summary_prompt"`
}

type ProjectRepo

type ProjectRepo struct {
	ID               uuid.UUID
	ProjectID        uuid.UUID
	Name             string
	RepositoryURL    string
	DefaultBranch    string
	WorkspaceDirname string
	Labels           []string
}

type ProjectRepoDeleteConflict

type ProjectRepoDeleteConflict struct {
	RepoID       uuid.UUID                       `json:"repo_id"`
	TicketScopes []ProjectRepoScopeReference     `json:"ticket_scopes"`
	Workspaces   []ProjectRepoWorkspaceReference `json:"workspaces"`
}

func (*ProjectRepoDeleteConflict) Error

func (e *ProjectRepoDeleteConflict) Error() string

func (*ProjectRepoDeleteConflict) Unwrap

func (e *ProjectRepoDeleteConflict) Unwrap() error

type ProjectRepoInput

type ProjectRepoInput struct {
	Name             string   `json:"name"`
	RepositoryURL    string   `json:"repository_url"`
	DefaultBranch    string   `json:"default_branch"`
	WorkspaceDirname *string  `json:"workspace_dirname"`
	Labels           []string `json:"labels"`
}

type ProjectRepoScopeReference

type ProjectRepoScopeReference struct {
	ID         uuid.UUID `json:"id"`
	TicketID   uuid.UUID `json:"ticket_id"`
	BranchName string    `json:"branch_name"`
}

type ProjectRepoWorkspaceReference

type ProjectRepoWorkspaceReference struct {
	ID         uuid.UUID `json:"id"`
	TicketID   uuid.UUID `json:"ticket_id"`
	AgentRunID uuid.UUID `json:"agent_run_id"`
	State      string    `json:"state"`
}

type ProjectStatus

type ProjectStatus string
const (
	DefaultProjectStatus              ProjectStatus = ProjectStatusPlanned
	DefaultProjectMaxConcurrentAgents               = 0

	ProjectStatusBacklog    ProjectStatus = "Backlog"
	ProjectStatusPlanned    ProjectStatus = "Planned"
	ProjectStatusInProgress ProjectStatus = "In Progress"
	ProjectStatusCompleted  ProjectStatus = "Completed"
	ProjectStatusCanceled   ProjectStatus = "Canceled"
	ProjectStatusArchived   ProjectStatus = "Archived"
)

func (ProjectStatus) IsValid

func (s ProjectStatus) IsValid() bool

func (ProjectStatus) String

func (s ProjectStatus) String() string

type ProjectTokenUsageListInput

type ProjectTokenUsageListInput struct {
	From string
	To   string
}

type ProjectTokenUsagePeakDay

type ProjectTokenUsagePeakDay = OrganizationTokenUsagePeakDay

type ProjectTokenUsageReport

type ProjectTokenUsageReport struct {
	ProjectID uuid.UUID
	FromDate  time.Time
	ToDate    time.Time
	Days      []ProjectDailyTokenUsage
	Summary   ProjectTokenUsageSummary
}

type ProjectTokenUsageSummary

type ProjectTokenUsageSummary = OrganizationTokenUsageSummary

type RecordMachineProbe

type RecordMachineProbe struct {
	ID              uuid.UUID
	Status          MachineStatus
	LastHeartbeatAt time.Time
	Resources       map[string]any
	DetectedOS      MachineDetectedOS
	DetectedArch    MachineDetectedArch
	DetectionStatus MachineDetectionStatus
}

type TicketRepoScope

type TicketRepoScope struct {
	ID             uuid.UUID
	TicketID       uuid.UUID
	RepoID         uuid.UUID
	BranchName     string
	PullRequestURL *string
}

type TicketRepoScopeActiveRunReference

type TicketRepoScopeActiveRunReference struct {
	TicketID     uuid.UUID `json:"ticket_id"`
	CurrentRunID uuid.UUID `json:"current_run_id"`
}

type TicketRepoScopeDeleteConflict

type TicketRepoScopeDeleteConflict struct {
	ScopeID    uuid.UUID                           `json:"scope_id"`
	TicketID   uuid.UUID                           `json:"ticket_id"`
	ActiveRun  *TicketRepoScopeActiveRunReference  `json:"active_run,omitempty"`
	Workspaces []TicketRepoScopeWorkspaceReference `json:"workspaces"`
}

func (*TicketRepoScopeDeleteConflict) Error

func (*TicketRepoScopeDeleteConflict) Unwrap

type TicketRepoScopeInput

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

type TicketRepoScopeWorkspaceReference

type TicketRepoScopeWorkspaceReference struct {
	ID         uuid.UUID `json:"id"`
	AgentRunID uuid.UUID `json:"agent_run_id"`
	State      string    `json:"state"`
}

type UpdateAgent

type UpdateAgent struct {
	ID         uuid.UUID
	ProjectID  uuid.UUID
	ProviderID uuid.UUID
	Name       string
}

func ParseUpdateAgent

func ParseUpdateAgent(id uuid.UUID, projectID uuid.UUID, raw AgentInput) (UpdateAgent, error)

type UpdateAgentProvider

type UpdateAgentProvider struct {
	ID                 uuid.UUID
	OrganizationID     uuid.UUID
	MachineID          uuid.UUID
	Name               string
	AdapterType        AgentProviderAdapterType
	PermissionProfile  AgentProviderPermissionProfile
	CliCommand         string
	CliArgs            []string
	AuthConfig         map[string]any
	ModelName          string
	ModelTemperature   float64
	ModelMaxTokens     int
	MaxParallelRuns    int
	CostPerInputToken  float64
	CostPerOutputToken float64
	PricingConfig      pricing.ProviderModelPricingConfig
}

func ParseUpdateAgentProvider

func ParseUpdateAgentProvider(id uuid.UUID, organizationID uuid.UUID, raw AgentProviderInput) (UpdateAgentProvider, error)

type UpdateAgentRuntimeControlState

type UpdateAgentRuntimeControlState struct {
	ID                  uuid.UUID
	RuntimeControlState AgentRuntimeControlState
}

type UpdateMachine

type UpdateMachine struct {
	ID                    uuid.UUID
	OrganizationID        uuid.UUID
	Name                  string
	Host                  string
	Port                  int
	ReachabilityMode      MachineReachabilityMode
	ExecutionMode         MachineExecutionMode
	ConnectionMode        MachineConnectionMode
	TransportCapabilities []MachineTransportCapability
	SSHUser               *string
	SSHKeyPath            *string
	AdvertisedEndpoint    *string
	DaemonStatus          MachineDaemonStatus
	DetectedOS            MachineDetectedOS
	DetectedArch          MachineDetectedArch
	DetectionStatus       MachineDetectionStatus
	ChannelCredential     MachineChannelCredential
	Description           string
	Labels                []string
	Status                MachineStatus
	WorkspaceRoot         *string
	AgentCLIPath          *string
	EnvVars               []string
}

func ParseUpdateMachine

func ParseUpdateMachine(id uuid.UUID, organizationID uuid.UUID, raw MachineInput) (UpdateMachine, error)

type UpdateOrganization

type UpdateOrganization struct {
	ID                     uuid.UUID
	Name                   string
	Slug                   string
	DefaultAgentProviderID *uuid.UUID
}

func ParseUpdateOrganization

func ParseUpdateOrganization(id uuid.UUID, raw OrganizationInput) (UpdateOrganization, error)

type UpdateProject

type UpdateProject struct {
	ID                     uuid.UUID
	OrganizationID         uuid.UUID
	Name                   string
	Slug                   string
	Description            string
	Status                 ProjectStatus
	DefaultAgentProviderID *uuid.UUID
	AccessibleMachineIDs   []uuid.UUID
	MaxConcurrentAgents    int
	AgentRunSummaryPrompt  string
}

func ParseUpdateProject

func ParseUpdateProject(id uuid.UUID, organizationID uuid.UUID, raw ProjectInput) (UpdateProject, error)

type UpdateProjectRepo

type UpdateProjectRepo struct {
	ID               uuid.UUID
	ProjectID        uuid.UUID
	Name             string
	RepositoryURL    string
	DefaultBranch    string
	WorkspaceDirname string
	Labels           []string
}

func ParseUpdateProjectRepo

func ParseUpdateProjectRepo(id uuid.UUID, projectID uuid.UUID, raw ProjectRepoInput) (UpdateProjectRepo, error)

type UpdateTicketRepoScope

type UpdateTicketRepoScope struct {
	ID             uuid.UUID
	ProjectID      uuid.UUID
	TicketID       uuid.UUID
	RepoID         uuid.UUID
	BranchName     *string
	BranchNameSet  bool
	PullRequestURL *string
	PullRequestSet bool
}

func ParseUpdateTicketRepoScope

func ParseUpdateTicketRepoScope(id uuid.UUID, projectID uuid.UUID, ticketID uuid.UUID, raw TicketRepoScopeInput) (UpdateTicketRepoScope, error)

type WorkspaceDashboardSummary

type WorkspaceDashboardSummary struct {
	OrganizationCount int
	ProjectCount      int
	ProviderCount     int
	RunningAgents     int
	ActiveTickets     int
	TodayCost         float64
	TotalTokens       int64
	Organizations     []WorkspaceOrganizationSummary
}

type WorkspaceOrganizationSummary

type WorkspaceOrganizationSummary struct {
	OrganizationID uuid.UUID
	Name           string
	Slug           string
	ProjectCount   int
	ProviderCount  int
	RunningAgents  int
	ActiveTickets  int
	TodayCost      float64
	TotalTokens    int64
}

Jump to

Keyboard shortcuts

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