workflow

package
v0.5.0 Latest Latest
Warning

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

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

Documentation

Index

Constants

View Source
const (
	TypeCoding        = domain.TypeCoding
	TypeTest          = domain.TypeTest
	TypeDoc           = domain.TypeDoc
	TypeSecurity      = domain.TypeSecurity
	TypeDeploy        = domain.TypeDeploy
	TypeRefineHarness = domain.TypeRefineHarness
	TypeCustom        = domain.TypeCustom
)
View Source
const (
	WorkflowFamilyPlanning    = domain.WorkflowFamilyPlanning
	WorkflowFamilyDispatcher  = domain.WorkflowFamilyDispatcher
	WorkflowFamilyCoding      = domain.WorkflowFamilyCoding
	WorkflowFamilyReview      = domain.WorkflowFamilyReview
	WorkflowFamilyTest        = domain.WorkflowFamilyTest
	WorkflowFamilyDocs        = domain.WorkflowFamilyDocs
	WorkflowFamilyDeploy      = domain.WorkflowFamilyDeploy
	WorkflowFamilySecurity    = domain.WorkflowFamilySecurity
	WorkflowFamilyHarness     = domain.WorkflowFamilyHarness
	WorkflowFamilyEnvironment = domain.WorkflowFamilyEnvironment
	WorkflowFamilyResearch    = domain.WorkflowFamilyResearch
	WorkflowFamilyReporting   = domain.WorkflowFamilyReporting
	WorkflowFamilyUnknown     = domain.WorkflowFamilyUnknown
)

Variables

View Source
var (
	ErrUnavailable                        = errors.New("workflow service unavailable")
	ErrProjectNotFound                    = domain.ErrProjectNotFound
	ErrWorkflowNotFound                   = domain.ErrWorkflowNotFound
	ErrStatusNotFound                     = domain.ErrStatusNotFound
	ErrAgentNotFound                      = domain.ErrAgentNotFound
	ErrWorkflowNameConflict               = domain.ErrWorkflowNameConflict
	ErrWorkflowHarnessPathConflict        = domain.ErrWorkflowHarnessPathConflict
	ErrWorkflowConflict                   = domain.ErrWorkflowConflict
	ErrPickupStatusConflict               = domain.ErrPickupStatusConflict
	ErrWorkflowStatusBindingOverlap       = domain.ErrWorkflowStatusBindingOverlap
	ErrWorkflowReferencedByTickets        = domain.ErrWorkflowReferencedByTickets
	ErrWorkflowReferencedByScheduledJobs  = domain.ErrWorkflowReferencedByScheduledJobs
	ErrWorkflowInUse                      = domain.ErrWorkflowInUse
	ErrWorkflowReplacementRequired        = domain.ErrWorkflowReplacementRequired
	ErrWorkflowActiveAgentRuns            = domain.ErrWorkflowActiveAgentRuns
	ErrWorkflowHistoricalAgentRuns        = domain.ErrWorkflowHistoricalAgentRuns
	ErrWorkflowReplacementInvalid         = domain.ErrWorkflowReplacementInvalid
	ErrWorkflowReplacementNotFound        = domain.ErrWorkflowReplacementNotFound
	ErrWorkflowReplacementProjectMismatch = domain.ErrWorkflowReplacementProjectMismatch
	ErrWorkflowReplacementInactive        = domain.ErrWorkflowReplacementInactive
	ErrHarnessInvalid                     = errors.New("workflow harness is invalid")
	ErrHookConfigInvalid                  = errors.New("workflow hook config is invalid")
	ErrWorkflowHookBlocked                = errors.New("workflow hook blocked the lifecycle operation")
)
View Source
var (
	ErrSkillInvalid  = domain.ErrSkillInvalid
	ErrSkillNotFound = domain.ErrSkillNotFound
)

Functions

func ParseHarnessSkills

func ParseHarnessSkills(content string) ([]string, error)

func RenderHarnessBody

func RenderHarnessBody(content string, data HarnessTemplateData) (string, error)

Types

type BuildHarnessTemplateDataInput

type BuildHarnessTemplateDataInput = domain.BuildHarnessTemplateDataInput

type CreateInput

type CreateInput = domain.CreateInput

type CreateSkillBundleInput

type CreateSkillBundleInput = domain.CreateSkillBundleInput

type CreateSkillInput

type CreateSkillInput = domain.CreateSkillInput

type DraftSkillProjection

type DraftSkillProjection struct {
	WorkspaceRoot string
	SkillsDir     string
	SkillDir      string
	Bundle        SkillBundle
}

func MaterializeDraftSkillBundle

func MaterializeDraftSkillBundle(input DraftSkillProjectionInput) (DraftSkillProjection, error)

type DraftSkillProjectionInput

type DraftSkillProjectionInput struct {
	WorkspaceRoot string
	AdapterType   string
	Bundle        SkillBundle
}

type HarnessAccessibleMachineData

type HarnessAccessibleMachineData = domain.HarnessAccessibleMachineData

type HarnessAgentData

type HarnessAgentData = domain.HarnessAgentData

type HarnessDocument

type HarnessDocument = domain.HarnessDocument

type HarnessMachineData

type HarnessMachineData = domain.HarnessMachineData

type HarnessPlatformData

type HarnessPlatformData = domain.HarnessPlatformData

type HarnessProjectData

type HarnessProjectData = domain.HarnessProjectData

type HarnessProjectMachineData

type HarnessProjectMachineData = domain.HarnessProjectMachineData

type HarnessProjectStatusData

type HarnessProjectStatusData = domain.HarnessProjectStatusData

type HarnessProjectUpdateCommentData

type HarnessProjectUpdateCommentData = domain.HarnessProjectUpdateCommentData

type HarnessProjectUpdateThreadData

type HarnessProjectUpdateThreadData = domain.HarnessProjectUpdateThreadData

type HarnessProjectWorkflowData

type HarnessProjectWorkflowData = domain.HarnessProjectWorkflowData

type HarnessProjectWorkflowTicketData

type HarnessProjectWorkflowTicketData = domain.HarnessProjectWorkflowTicketData

type HarnessRepoData

type HarnessRepoData = domain.HarnessRepoData

type HarnessTemplateData

type HarnessTemplateData domain.HarnessTemplateData

type HarnessTemplateDataBuilder

type HarnessTemplateDataBuilder interface {
	BuildHarnessTemplateData(ctx context.Context, input domain.BuildHarnessTemplateDataInput) (domain.HarnessTemplateData, error)
}

type HarnessTicketData

type HarnessTicketData = domain.HarnessTicketData

type HarnessTicketDependencyData

type HarnessTicketDependencyData = domain.HarnessTicketDependencyData

type HarnessTicketLinkData

type HarnessTicketLinkData = domain.HarnessTicketLinkData

type HarnessVariableGroup

type HarnessVariableGroup = domain.HarnessVariableGroup

func HarnessVariableDictionary

func HarnessVariableDictionary() []HarnessVariableGroup

type HarnessVariableMetadata

type HarnessVariableMetadata = domain.HarnessVariableMetadata

type HarnessWorkflowData

type HarnessWorkflowData = domain.HarnessWorkflowData

type MaterializeRuntimeSnapshotInput

type MaterializeRuntimeSnapshotInput = domain.MaterializeRuntimeSnapshotInput

type MaterializedRuntimeSnapshot

type MaterializedRuntimeSnapshot = domain.MaterializedRuntimeSnapshot

type Optional

type Optional[T any] = domain.Optional[T]

func Some

func Some[T any](value T) Optional[T]

type PlatformAccess

type PlatformAccess struct {
	Configured bool
	Allowed    []string
}

func ParsePlatformAccess

func ParsePlatformAccess(content string) (PlatformAccess, error)

type ProjectValidationRepository

type ProjectValidationRepository interface {
	EnsureProjectExists(ctx context.Context, projectID uuid.UUID) error
	EnsureAgentBelongsToProject(ctx context.Context, projectID uuid.UUID, agentID uuid.UUID) error
	EnsureStatusBindingsBelongToProject(ctx context.Context, projectID uuid.UUID, statusIDs []uuid.UUID) error
	EnsureWorkflowNameAvailable(ctx context.Context, projectID uuid.UUID, name string, excludeWorkflowID uuid.UUID) error
	EnsurePickupStatusBindingsAvailable(ctx context.Context, projectID uuid.UUID, statusIDs []uuid.UUID, excludeWorkflowID uuid.UUID) error
	EnsureHarnessPathAvailable(ctx context.Context, projectID uuid.UUID, harnessPath string, excludeWorkflowID uuid.UUID) error
	StatusNames(ctx context.Context, statusIDs []uuid.UUID) ([]string, error)
}

type RefreshSkillsInput

type RefreshSkillsInput = domain.RefreshSkillsInput

type RefreshSkillsResult

type RefreshSkillsResult = domain.RefreshSkillsResult

type ReplaceWorkflowReferencesInput

type ReplaceWorkflowReferencesInput = domain.ReplaceWorkflowReferencesInput

type ReplaceWorkflowReferencesResult

type ReplaceWorkflowReferencesResult = domain.ReplaceWorkflowReferencesResult

type ResolveRecordedRuntimeSnapshotInput

type ResolveRecordedRuntimeSnapshotInput = domain.ResolveRecordedRuntimeSnapshotInput

type RuntimeSkillFileSnapshot

type RuntimeSkillFileSnapshot = domain.RuntimeSkillFileSnapshot

type RuntimeSkillSnapshot

type RuntimeSkillSnapshot = domain.RuntimeSkillSnapshot

type RuntimeSkillTarget

type RuntimeSkillTarget struct {
	SkillsDir string
}

func ResolveSkillTargetForRuntime

func ResolveSkillTargetForRuntime(workspaceRoot string, rawAdapterType string) (RuntimeSkillTarget, error)

type RuntimeSnapshot

type RuntimeSnapshot = domain.RuntimeSnapshot

type RuntimeWorkflowSnapshot

type RuntimeWorkflowSnapshot = domain.RuntimeWorkflowSnapshot

type Service

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

func NewService

func NewService(source serviceDependencySource, logger *slog.Logger, projectsRoot string) (*Service, error)

func NewServiceWithDependencies

func NewServiceWithDependencies(deps ServiceDependencies, logger *slog.Logger, projectsRoot string) (*Service, error)

func (*Service) BindSkill

func (s *Service) BindSkill(ctx context.Context, input UpdateSkillBindingsInput) (SkillDetail, error)

func (*Service) BindSkills

func (*Service) BuildHarnessTemplateData

func (s *Service) BuildHarnessTemplateData(ctx context.Context, input BuildHarnessTemplateDataInput) (HarnessTemplateData, error)

func (*Service) Close

func (s *Service) Close() error

func (*Service) Create

func (s *Service) Create(ctx context.Context, input CreateInput) (WorkflowDetail, error)

func (*Service) CreateSkill

func (s *Service) CreateSkill(ctx context.Context, input CreateSkillInput) (SkillDetail, error)

func (*Service) CreateSkillBundle

func (s *Service) CreateSkillBundle(ctx context.Context, input CreateSkillBundleInput) (SkillDetail, error)

func (*Service) Delete

func (s *Service) Delete(ctx context.Context, workflowID uuid.UUID) (Workflow, error)

func (*Service) DeleteSkill

func (s *Service) DeleteSkill(ctx context.Context, skillID uuid.UUID) error

func (*Service) DisableSkill

func (s *Service) DisableSkill(ctx context.Context, skillID uuid.UUID) (SkillDetail, error)

func (*Service) EnableSkill

func (s *Service) EnableSkill(ctx context.Context, skillID uuid.UUID) (SkillDetail, error)

func (*Service) Get

func (s *Service) Get(ctx context.Context, workflowID uuid.UUID) (WorkflowDetail, error)

func (*Service) GetHarness

func (s *Service) GetHarness(ctx context.Context, workflowID uuid.UUID) (HarnessDocument, error)

func (*Service) GetSkill

func (s *Service) GetSkill(ctx context.Context, skillID uuid.UUID) (SkillDetail, error)

func (*Service) GetSkillInProject

func (s *Service) GetSkillInProject(ctx context.Context, projectID uuid.UUID, skillID uuid.UUID) (SkillDetail, error)

func (*Service) ImpactAnalysis

func (s *Service) ImpactAnalysis(ctx context.Context, workflowID uuid.UUID) (WorkflowImpactAnalysis, error)

func (*Service) List

func (s *Service) List(ctx context.Context, projectID uuid.UUID) ([]Workflow, error)

func (*Service) ListSkillVersions

func (s *Service) ListSkillVersions(ctx context.Context, skillID uuid.UUID) ([]VersionSummary, error)

func (*Service) ListSkills

func (s *Service) ListSkills(ctx context.Context, projectID uuid.UUID) ([]Skill, error)

func (*Service) ListWorkflowVersions

func (s *Service) ListWorkflowVersions(ctx context.Context, workflowID uuid.UUID) ([]VersionSummary, error)

func (*Service) MaterializeRuntimeSnapshot

func (s *Service) MaterializeRuntimeSnapshot(input MaterializeRuntimeSnapshotInput) (MaterializedRuntimeSnapshot, error)

func (*Service) ProjectControlRoot added in v0.3.0

func (s *Service) ProjectControlRoot(projectID uuid.UUID) (string, error)

func (*Service) RefreshSkills

func (s *Service) RefreshSkills(ctx context.Context, input RefreshSkillsInput) (RefreshSkillsResult, error)

func (*Service) ResolveRecordedRuntimeSnapshot

func (s *Service) ResolveRecordedRuntimeSnapshot(ctx context.Context, input ResolveRecordedRuntimeSnapshotInput) (RuntimeSnapshot, error)

func (*Service) ResolveRuntimeSnapshot

func (s *Service) ResolveRuntimeSnapshot(ctx context.Context, workflowID uuid.UUID) (RuntimeSnapshot, error)

func (*Service) Retire

func (s *Service) Retire(ctx context.Context, workflowID uuid.UUID, editedBy string) (WorkflowDetail, error)

func (*Service) UnbindSkill

func (s *Service) UnbindSkill(ctx context.Context, input UpdateSkillBindingsInput) (SkillDetail, error)

func (*Service) UnbindSkills

func (s *Service) UnbindSkills(ctx context.Context, input UpdateWorkflowSkillsInput) (HarnessDocument, error)

func (*Service) Update

func (s *Service) Update(ctx context.Context, input UpdateInput) (WorkflowDetail, error)

func (*Service) UpdateHarness

func (s *Service) UpdateHarness(ctx context.Context, input UpdateHarnessInput) (HarnessDocument, error)

func (*Service) UpdateSkill

func (s *Service) UpdateSkill(ctx context.Context, input UpdateSkillInput) (SkillDetail, error)

func (*Service) UpdateSkillBundle

func (s *Service) UpdateSkillBundle(ctx context.Context, input UpdateSkillBundleInput) (SkillDetail, error)

type ServiceDependencies

type ServiceDependencies struct {
	Validators       ProjectValidationRepository
	Workflows        WorkflowRepository
	WorkflowVersions WorkflowVersionRepository
	Skills           SkillRepository
	SkillVersions    SkillVersionRepository
	WorkflowSkills   WorkflowSkillBindingRepository
	RuntimeSnapshots WorkflowRuntimeSnapshotReader
	HarnessTemplates HarnessTemplateDataBuilder
}

type Skill

type Skill = domain.Skill

type SkillBundle

type SkillBundle = domain.SkillBundle

func BuildSkillBundle

func BuildSkillBundle(name string, files []SkillBundleFileInput) (SkillBundle, error)

func LoadSkillBundleFromDirectory

func LoadSkillBundleFromDirectory(name string, root string) (SkillBundle, error)

type SkillBundleFile

type SkillBundleFile = domain.SkillBundleFile

type SkillBundleFileInput

type SkillBundleFileInput = domain.SkillBundleFileInput

type SkillDetail

type SkillDetail = domain.SkillDetail

type SkillRepository

type SkillRepository interface {
	EnsureBuiltinSkills(ctx context.Context, projectID uuid.UUID, now time.Time, bundles []domain.SkillBundle) error
	ListSkills(ctx context.Context, projectID uuid.UUID) ([]domain.Skill, error)
	Skill(ctx context.Context, skillID uuid.UUID) (domain.SkillRecord, error)
	SkillInProject(ctx context.Context, projectID uuid.UUID, skillID uuid.UUID) (domain.SkillRecord, error)
	SkillByName(ctx context.Context, projectID uuid.UUID, name string) (domain.SkillRecord, error)
	SkillDetail(ctx context.Context, skillID uuid.UUID) (domain.SkillDetail, error)
	CreateSkillBundle(
		ctx context.Context,
		input domain.CreateSkillBundleInput,
		bundle domain.SkillBundle,
		enabled bool,
		createdBy string,
		now time.Time,
	) (domain.SkillDetail, error)
	UpdateSkillBundle(ctx context.Context, skillID uuid.UUID, bundle domain.SkillBundle, updatedAt time.Time) (domain.SkillDetail, error)
	DeleteSkill(ctx context.Context, skillID uuid.UUID, deletedAt time.Time) error
	SetSkillEnabled(ctx context.Context, skillID uuid.UUID, enabled bool, updatedAt time.Time) (domain.SkillDetail, error)
}

type SkillVersionRepository

type SkillVersionRepository interface {
	CurrentSkillVersion(ctx context.Context, skillID uuid.UUID, requiredVersionID *uuid.UUID) (domain.SkillVersionRecord, error)
	ListSkillVersions(ctx context.Context, skillID uuid.UUID) ([]domain.VersionSummary, error)
	SkillVersionFiles(ctx context.Context, versionID uuid.UUID) ([]domain.SkillBundleFile, error)
}

type SkillWorkflowBinding

type SkillWorkflowBinding = domain.SkillWorkflowBinding

type StatusBindingSet

type StatusBindingSet = domain.StatusBindingSet

func MustStatusBindingSet

func MustStatusBindingSet(ids ...uuid.UUID) StatusBindingSet

func ParseStatusBindingSet

func ParseStatusBindingSet(fieldName string, raw []uuid.UUID) (StatusBindingSet, error)

type Type

type Type = domain.Type

func ParseType

func ParseType(raw string) (Type, error)

type TypeLabel

type TypeLabel = domain.TypeLabel

func MustParseTypeLabel

func MustParseTypeLabel(raw string) TypeLabel

func ParseTypeLabel

func ParseTypeLabel(raw string) (TypeLabel, error)

type UpdateHarnessInput

type UpdateHarnessInput = domain.UpdateHarnessInput

type UpdateInput

type UpdateInput = domain.UpdateInput

type UpdateSkillBindingsInput

type UpdateSkillBindingsInput = domain.UpdateSkillBindingsInput

type UpdateSkillBundleInput

type UpdateSkillBundleInput = domain.UpdateSkillBundleInput

type UpdateSkillInput

type UpdateSkillInput = domain.UpdateSkillInput

type UpdateWorkflowSkillsInput

type UpdateWorkflowSkillsInput = domain.UpdateWorkflowSkillsInput

type ValidationIssue

type ValidationIssue struct {
	Level   string `json:"level"`
	Message string `json:"message"`
	Line    int    `json:"line,omitempty"`
	Column  int    `json:"column,omitempty"`
}

type ValidationResult

type ValidationResult struct {
	Valid  bool              `json:"valid"`
	Issues []ValidationIssue `json:"issues"`
}

func ValidateHarnessContent

func ValidateHarnessContent(content string) ValidationResult

type VersionSummary

type VersionSummary = domain.VersionSummary

type Workflow

type Workflow = domain.Workflow

type WorkflowClassificationInput

type WorkflowClassificationInput = domain.WorkflowClassificationInput

type WorkflowDetail

type WorkflowDetail = domain.WorkflowDetail

type WorkflowFamily

type WorkflowFamily = domain.WorkflowFamily

type WorkflowImpactAnalysis

type WorkflowImpactAnalysis = domain.WorkflowImpactAnalysis

type WorkflowImpactConflict

type WorkflowImpactConflict = domain.WorkflowImpactConflict

type WorkflowRepository

type WorkflowRepository interface {
	List(ctx context.Context, projectID uuid.UUID) ([]domain.Workflow, error)
	Get(ctx context.Context, workflowID uuid.UUID) (domain.Workflow, error)
	Create(ctx context.Context, workflow domain.Workflow, skillIDs []uuid.UUID, harnessContent string, createdBy string) (domain.Workflow, error)
	Update(ctx context.Context, workflow domain.Workflow) (domain.Workflow, error)
	ImpactAnalysis(ctx context.Context, workflowID uuid.UUID) (domain.WorkflowImpactAnalysis, error)
	ReplaceReferences(ctx context.Context, input domain.ReplaceWorkflowReferencesInput) (domain.ReplaceWorkflowReferencesResult, error)
	Delete(ctx context.Context, workflowID uuid.UUID) (domain.Workflow, error)
}

type WorkflowRuntimeSnapshotReader

type WorkflowRuntimeSnapshotReader interface {
	ResolveRuntimeSnapshot(ctx context.Context, workflowID uuid.UUID) (domain.RuntimeSnapshot, error)
	ResolveRecordedRuntimeSnapshot(ctx context.Context, input domain.ResolveRecordedRuntimeSnapshotInput) (domain.RuntimeSnapshot, error)
}

type WorkflowScheduledJobReference

type WorkflowScheduledJobReference = domain.WorkflowScheduledJobReference

type WorkflowSkillBindingRepository

type WorkflowSkillBindingRepository interface {
	ListWorkflowBoundSkillNames(ctx context.Context, workflowID uuid.UUID, enabledOnly bool) ([]string, error)
	ResolveInjectedSkillNames(ctx context.Context, projectID uuid.UUID, workflowID *uuid.UUID) ([]string, error)
	ApplyWorkflowSkillBindings(ctx context.Context, workflowID uuid.UUID, skillIDs []uuid.UUID, bind bool, content string, createdBy string) (domain.Workflow, error)
}

type WorkflowTicketReference

type WorkflowTicketReference = domain.WorkflowTicketReference

type WorkflowVersionRepository

type WorkflowVersionRepository interface {
	CurrentWorkflowVersion(ctx context.Context, workflowID uuid.UUID) (domain.WorkflowVersionRecord, error)
	RecordedWorkflowVersion(ctx context.Context, workflowID uuid.UUID, workflowVersionID *uuid.UUID) (domain.WorkflowVersionRecord, error)
	ListWorkflowVersions(ctx context.Context, workflowID uuid.UUID) ([]domain.VersionSummary, error)
	PublishWorkflowVersion(ctx context.Context, workflowID uuid.UUID, content string, createdBy string) (domain.Workflow, error)
}

Jump to

Keyboard shortcuts

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