agentplatform

package
v0.4.0 Latest Latest
Warning

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

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

Documentation

Index

Constants

View Source
const (
	ScopeAgentsInterrupt               = domain.ScopeAgentsInterrupt
	ScopeTicketsCreate                 = domain.ScopeTicketsCreate
	ScopeTicketsList                   = domain.ScopeTicketsList
	ScopeTicketsUpdate                 = domain.ScopeTicketsUpdate
	ScopeTicketsReportUsage            = domain.ScopeTicketsReportUsage
	ScopeTicketsUpdateSelf             = domain.ScopeTicketsUpdateSelf
	ScopeProjectsUpdate                = domain.ScopeProjectsUpdate
	ScopeProjectsAddRepo               = domain.ScopeProjectsAddRepo
	ScopeActivityRead                  = domain.ScopeActivityRead
	ScopeReposCreate                   = domain.ScopeReposCreate
	ScopeReposRead                     = domain.ScopeReposRead
	ScopeReposUpdate                   = domain.ScopeReposUpdate
	ScopeReposDelete                   = domain.ScopeReposDelete
	ScopeScheduledJobsList             = domain.ScopeScheduledJobsList
	ScopeScheduledJobsCreate           = domain.ScopeScheduledJobsCreate
	ScopeScheduledJobsUpdate           = domain.ScopeScheduledJobsUpdate
	ScopeScheduledJobsDelete           = domain.ScopeScheduledJobsDelete
	ScopeScheduledJobsTrigger          = domain.ScopeScheduledJobsTrigger
	ScopeSkillsList                    = domain.ScopeSkillsList
	ScopeSkillsRead                    = domain.ScopeSkillsRead
	ScopeSkillsCreate                  = domain.ScopeSkillsCreate
	ScopeSkillsImport                  = domain.ScopeSkillsImport
	ScopeSkillsRefresh                 = domain.ScopeSkillsRefresh
	ScopeSkillsUpdate                  = domain.ScopeSkillsUpdate
	ScopeSkillsDelete                  = domain.ScopeSkillsDelete
	ScopeSkillsEnable                  = domain.ScopeSkillsEnable
	ScopeSkillsDisable                 = domain.ScopeSkillsDisable
	ScopeSkillsBind                    = domain.ScopeSkillsBind
	ScopeStatusesList                  = domain.ScopeStatusesList
	ScopeStatusesCreate                = domain.ScopeStatusesCreate
	ScopeStatusesUpdate                = domain.ScopeStatusesUpdate
	ScopeStatusesDelete                = domain.ScopeStatusesDelete
	ScopeStatusesReset                 = domain.ScopeStatusesReset
	ScopeTicketRepoScopesList          = domain.ScopeTicketRepoScopesList
	ScopeTicketRepoScopesCreate        = domain.ScopeTicketRepoScopesCreate
	ScopeTicketRepoScopesUpdate        = domain.ScopeTicketRepoScopesUpdate
	ScopeTicketRepoScopesDelete        = domain.ScopeTicketRepoScopesDelete
	ScopeWorkflowsList                 = domain.ScopeWorkflowsList
	ScopeWorkflowsRead                 = domain.ScopeWorkflowsRead
	ScopeWorkflowsCreate               = domain.ScopeWorkflowsCreate
	ScopeWorkflowsUpdate               = domain.ScopeWorkflowsUpdate
	ScopeWorkflowsDelete               = domain.ScopeWorkflowsDelete
	ScopeWorkflowsHarnessRead          = domain.ScopeWorkflowsHarnessRead
	ScopeWorkflowsHarnessHistoryRead   = domain.ScopeWorkflowsHarnessHistoryRead
	ScopeWorkflowsHarnessUpdate        = domain.ScopeWorkflowsHarnessUpdate
	ScopeWorkflowsHarnessValidate      = domain.ScopeWorkflowsHarnessValidate
	ScopeWorkflowsHarnessVariablesRead = domain.ScopeWorkflowsHarnessVariablesRead
)
View Source
const (
	PrincipalKindTicketAgent         = domain.PrincipalKindTicketAgent
	PrincipalKindProjectConversation = domain.PrincipalKindProjectConversation
)
View Source
const TokenPrefix = domain.TokenPrefix

Variables

View Source
var (
	ErrUnavailable       = errors.New("agent platform service unavailable")
	ErrTokenNotFound     = errors.New("agent token not found")
	ErrTokenExpired      = errors.New("agent token expired")
	ErrInvalidToken      = errors.New("agent token is invalid")
	ErrInvalidScope      = errors.New("agent token scope is invalid")
	ErrInvalidPrincipal  = errors.New("agent token principal is invalid")
	ErrAgentNotFound     = errors.New("agent not found")
	ErrPrincipalNotFound = errors.New("principal not found")
	ErrProjectMismatch   = errors.New("agent token project mismatch")
)

Functions

func BuildCapabilityContract

func BuildCapabilityContract(input RuntimeContractInput) string

func BuildEnvironment

func BuildEnvironment(apiURL string, token string, projectID uuid.UUID, ticketID uuid.UUID) []string

func BuildRuntimeEnvironment

func BuildRuntimeEnvironment(input RuntimeContractInput) []string

func DefaultScopes

func DefaultScopes() []string

func DefaultScopesForPrincipalKind

func DefaultScopesForPrincipalKind(kind PrincipalKind) []string

func ParseBearerToken

func ParseBearerToken(header string) (string, error)

func ParseToken

func ParseToken(raw string) (string, error)

func PrivilegedScopes

func PrivilegedScopes() []string

func PrivilegedScopesForPrincipalKind

func PrivilegedScopesForPrincipalKind(kind PrincipalKind) []string

func SupportedScopes

func SupportedScopes() []string

func SupportedScopesForPrincipalKind

func SupportedScopesForPrincipalKind(kind PrincipalKind) []string

Types

type Claims

type Claims = domain.Claims

type IssueInput

type IssueInput = domain.IssueInput

type IssuedToken

type IssuedToken = domain.IssuedToken

type PrincipalKind

type PrincipalKind = domain.PrincipalKind

type ProjectTokenInventory

type ProjectTokenInventory = domain.ProjectTokenInventory

type Repository

type Repository interface {
	AgentPrincipal(ctx context.Context, agentID uuid.UUID) (domain.AgentPrincipal, error)
	ProjectConversationPrincipal(ctx context.Context, principalID uuid.UUID) (domain.ProjectConversationPrincipal, error)
	CreateToken(ctx context.Context, record domain.CreateTokenRecord) error
	TokenByHash(ctx context.Context, tokenHash string) (domain.StoredTokenRecord, error)
	TouchTokenLastUsed(ctx context.Context, tokenID uuid.UUID, usedAt time.Time) error
	ProjectTokenInventory(ctx context.Context, projectID uuid.UUID, now time.Time) (domain.ProjectTokenInventory, error)
}

type RuntimeContractInput

type RuntimeContractInput = domain.RuntimeContractInput

type Scope

type Scope = domain.Scope

type ScopeGroup

type ScopeGroup = domain.ScopeGroup

func SupportedScopeGroups

func SupportedScopeGroups() []ScopeGroup

func SupportedScopeGroupsForPrincipalKind

func SupportedScopeGroupsForPrincipalKind(kind PrincipalKind) []ScopeGroup

type ScopeSet

type ScopeSet = domain.ScopeSet

type ScopeWhitelist

type ScopeWhitelist = domain.ScopeWhitelist

type Service

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

func NewService

func NewService(repo Repository) *Service

func (*Service) Authenticate

func (s *Service) Authenticate(ctx context.Context, rawToken string) (Claims, error)

func (*Service) IssueToken

func (s *Service) IssueToken(ctx context.Context, input IssueInput) (IssuedToken, error)

func (*Service) ProjectTokenInventory

func (s *Service) ProjectTokenInventory(ctx context.Context, projectID uuid.UUID) (ProjectTokenInventory, error)

Jump to

Keyboard shortcuts

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