Documentation
¶
Index ¶
- func ApplyFileBindCleanups(jobs []FileBindCleanup, txErr error)
- func BuildProcessQueueContext(httpCtx core.HTTPContext, tx *gorm.DB, node *models.CanvasNode, ...) (*core.ProcessQueueContext, error)
- func DispatchOnError(tx *gorm.DB, execution *models.CanvasNodeExecution, ...)
- func EmitWorkOrderCreated(tx *gorm.DB, factoryModel *models.Factory, order *models.FactoryWorkOrder)
- func EmitWorkOrderCreatedOnCanvas(tx *gorm.DB, factoryModel *models.Factory, order *models.FactoryWorkOrder, ...) error
- func NewIntegrationSubscriptionContext(tx *gorm.DB, registry *registry.Registry, ...) core.IntegrationSubscriptionContext
- func ResolveQueueName(tx *gorm.DB, node *models.CanvasNode, item *models.CanvasNodeQueueItem) (string, error)
- func SkipPausedIntakeFeed(tx *gorm.DB, canvasID uuid.UUID) (bool, error)
- func WithoutRunTitleConfiguration(configuration map[string]any) map[string]any
- type AppContext
- type AppExecutionContext
- type AuthReader
- func (c *AuthReader) AuthenticatedUser() *core.User
- func (c *AuthReader) GetGroup(name string) (*core.GroupRef, error)
- func (c *AuthReader) GetRole(name string) (*core.RoleRef, error)
- func (c *AuthReader) GetUser(id uuid.UUID) (*core.User, error)
- func (c *AuthReader) HasRole(role string) (bool, error)
- func (c *AuthReader) InGroup(group string) (bool, error)
- type CanvasMemoryContext
- func (c *CanvasMemoryContext) Add(namespace string, values any) error
- func (c *CanvasMemoryContext) AddRecord(namespace string, values any) (core.CanvasMemoryRecord, error)
- func (c *CanvasMemoryContext) Delete(namespace string, matches map[string]any) ([]any, error)
- func (c *CanvasMemoryContext) Find(namespace string, matches map[string]any) ([]any, error)
- func (c *CanvasMemoryContext) FindFirst(namespace string, matches map[string]any) (any, error)
- func (c *CanvasMemoryContext) Update(namespace string, matches map[string]any, values map[string]any) ([]any, error)
- func (c *CanvasMemoryContext) UpdateNamespace(namespace string, values map[string]any) ([]any, error)
- func (c *CanvasMemoryContext) UpdateNamespaceRecords(namespace string, values map[string]any) ([]core.CanvasMemoryRecord, error)
- func (c *CanvasMemoryContext) UpdateRecords(namespace string, matches map[string]any, values map[string]any) ([]core.CanvasMemoryRecord, error)
- func (c *CanvasMemoryContext) WithChangeCallback(onChanged func()) *CanvasMemoryContext
- type CapabilityContext
- func (c *CapabilityContext) Available(capabilities ...string)
- func (c *CapabilityContext) Clear()
- func (c *CapabilityContext) Disable(capabilities ...string)
- func (c *CapabilityContext) Enable(capabilities ...string)
- func (c *CapabilityContext) Enabled() []string
- func (c *CapabilityContext) IsRequested(capabilities ...string) bool
- func (c *CapabilityContext) Request(capabilities ...string)
- func (c *CapabilityContext) Requested() []string
- func (c *CapabilityContext) States() []models.CapabilityState
- func (c *CapabilityContext) Unavailable(capabilities ...string)
- type ConfigurationBuildError
- type EventContext
- type ExecutionMetadataContext
- type ExecutionRequestContext
- type ExecutionStateContext
- func (s *ExecutionStateContext) Cancel() error
- func (s *ExecutionStateContext) Emit(channel, payloadType string, payloads []any) error
- func (s *ExecutionStateContext) EmitAndContinue(channel, payloadType string, payloads []any) error
- func (s *ExecutionStateContext) Fail(reason, message string) error
- func (s *ExecutionStateContext) GetKV(key string) (string, error)
- func (s *ExecutionStateContext) IsCancelling() bool
- func (s *ExecutionStateContext) IsFinished() bool
- func (s *ExecutionStateContext) Pass() error
- func (s *ExecutionStateContext) SetKV(key, value string) error
- type ExpressionContext
- type FactoryContext
- func (c *FactoryContext) AddPullRequest(params core.AddPullRequestParams) (*core.PullRequest, error)
- func (c *FactoryContext) AddPullRequestActivity(params core.AddPullRequestActivityParams) (*core.PullRequestActivityResult, error)
- func (c *FactoryContext) AddWorkOrderArtifact(params core.AddWorkOrderArtifactParams) (*core.WorkOrderArtifact, error)
- func (c *FactoryContext) AddWorkOrderComment(params core.AddWorkOrderCommentParams) error
- func (c *FactoryContext) CreateWorkOrder(params core.WorkOrderParams) (*core.WorkOrder, bool, error)
- func (c *FactoryContext) FindPullRequest(params core.FindPullRequestParams) (*core.PullRequestMatch, error)
- func (c *FactoryContext) FindWorkOrder(params core.FindWorkOrderParams) (*core.WorkOrder, error)
- func (c *FactoryContext) ReportWorkOrderCheck(params core.ReportWorkOrderCheckParams) (*core.WorkOrderCheck, error)
- func (c *FactoryContext) SetWorkOrderStatusNote(params core.SetWorkOrderStatusNoteParams) (*core.WorkOrderStatusNote, error)
- func (c *FactoryContext) UpdatePullRequest(params core.UpdatePullRequestParams) (*core.PullRequest, error)
- func (c *FactoryContext) UpdatePullRequestActivity(params core.UpdatePullRequestActivityParams) (*core.PullRequestActivityResult, error)
- func (c *FactoryContext) UpdateWorkOrderStatus(params core.UpdateWorkOrderStatusParams) (*core.WorkOrder, bool, error)
- func (c *FactoryContext) VCSProvider() (string, error)
- func (c *FactoryContext) WithFileBindCleanup(callback func(FileBindCleanup)) *FactoryContext
- func (c *FactoryContext) WithGitHubPullRequestRecorded(callback func(organizationID, factoryID, pullRequestID uuid.UUID)) *FactoryContext
- func (c *FactoryContext) WithJiraIssueFiles(read jiraFileRead) *FactoryContext
- func (c *FactoryContext) WithLinearIssueFiles(read linearFileRead) *FactoryContext
- func (c *FactoryContext) WithProductiveTaskFiles(read productiveFileRead) *FactoryContext
- func (c *FactoryContext) WithRemoteImageFetch(fetch storedfiles.FetchFunc) *FactoryContext
- func (c *FactoryContext) WithRemoteImageIngest(encryptor crypto.Encryptor, registry *registry.Registry) *FactoryContext
- func (c *FactoryContext) WithRunsCancelled(callback func([]*models.RunCancellationResult)) *FactoryContext
- func (c *FactoryContext) WithWorkOrderNotification(callback func(messages.FactoryWorkOrderNotificationMessage)) *FactoryContext
- func (c *FactoryContext) WithWorkOrderUpdated(callback func(factoryID, orderID, reason string)) *FactoryContext
- type FileBindCleanup
- type HostedLLMContext
- func (c *HostedLLMContext) AssertCreditAvailable() error
- func (c *HostedLLMContext) AssertModelSelectable(provider, fundingSource, model string) error
- func (c *HostedLLMContext) DefaultModel() (core.DefaultHostedLLMModel, error)
- func (c *HostedLLMContext) Resolve(provider string) (core.HostedLLMAccess, error)
- type IntegrationContext
- func (c *IntegrationContext) Error(message string)
- func (c *IntegrationContext) FindSubscription(predicate func(core.IntegrationSubscriptionContext) bool) (core.IntegrationSubscriptionContext, error)
- func (c *IntegrationContext) GetConfig(name string) ([]byte, error)
- func (c *IntegrationContext) GetMetadata() any
- func (c *IntegrationContext) GetOptionalConfig(name string) ([]byte, error)
- func (c *IntegrationContext) GetSecrets() ([]core.IntegrationSecret, error)
- func (c *IntegrationContext) GetState() string
- func (c *IntegrationContext) ID() uuid.UUID
- func (c *IntegrationContext) LegacySetup() bool
- func (c *IntegrationContext) ListNodeConfigurations() ([]any, error)
- func (c *IntegrationContext) ListSubscriptions() ([]core.IntegrationSubscriptionContext, error)
- func (c *IntegrationContext) NewBrowserAction(action core.BrowserAction)
- func (c *IntegrationContext) Persist() error
- func (c *IntegrationContext) PersistMetadata() error
- func (c *IntegrationContext) Properties() core.IntegrationPropertyStorage
- func (c *IntegrationContext) Ready()
- func (c *IntegrationContext) RemoveBrowserAction()
- func (c *IntegrationContext) RequestWebhook(configuration any) error
- func (c *IntegrationContext) ScheduleActionCall(actionName string, parameters any, interval time.Duration) error
- func (c *IntegrationContext) ScheduleResync(interval time.Duration) error
- func (c *IntegrationContext) Secrets() core.IntegrationSecretStorage
- func (c *IntegrationContext) SetMetadata(value any)
- func (c *IntegrationContext) SetSecret(name string, value []byte) error
- func (c *IntegrationContext) Subscribe(configuration any) (*uuid.UUID, error)
- type IntegrationPropertyStorage
- func (s *IntegrationPropertyStorage) Create(def core.IntegrationPropertyDefinition) error
- func (s *IntegrationPropertyStorage) CreateMany(defs []core.IntegrationPropertyDefinition) error
- func (s *IntegrationPropertyStorage) Delete(names ...string) error
- func (s *IntegrationPropertyStorage) Get(name string) (any, error)
- func (s *IntegrationPropertyStorage) GetString(name string) (string, error)
- type IntegrationSecretStorage
- func (s *IntegrationSecretStorage) Create(def core.IntegrationSecretDefinition) error
- func (s *IntegrationSecretStorage) CreateMany(defs []core.IntegrationSecretDefinition) error
- func (s *IntegrationSecretStorage) Delete(name string) error
- func (s *IntegrationSecretStorage) Get(name string) (string, error)
- func (s *IntegrationSecretStorage) Update(name string, value string) error
- type IntegrationSetupContext
- type IntegrationSubscriptionContext
- type NodeConfigurationBuilder
- func (b *NodeConfigurationBuilder) Build(configuration map[string]any) (map[string]any, error)
- func (b *NodeConfigurationBuilder) BuildExecutionMessageChain() (map[string]any, error)
- func (b *NodeConfigurationBuilder) ResolveExpression(expression string) (any, error)
- func (b *NodeConfigurationBuilder) ResolveExpressionWithExtraVariables(expression string, variables map[string]any) (any, error)
- func (b *NodeConfigurationBuilder) ResolveTemplateExpressions(expression string) (any, error)
- func (b *NodeConfigurationBuilder) WithConfigurationFields(fields []configuration.Field) *NodeConfigurationBuilder
- func (b *NodeConfigurationBuilder) WithExpressionVariables(variables map[string]any) *NodeConfigurationBuilder
- func (b *NodeConfigurationBuilder) WithIncomingEventID(incomingEventID *uuid.UUID) *NodeConfigurationBuilder
- func (b *NodeConfigurationBuilder) WithInput(input any) *NodeConfigurationBuilder
- func (b *NodeConfigurationBuilder) WithNodeID(nodeID string) *NodeConfigurationBuilder
- func (b *NodeConfigurationBuilder) WithPreviousExecution(previousExecutionID *uuid.UUID) *NodeConfigurationBuilder
- func (b *NodeConfigurationBuilder) WithRootEvent(rootEventID *uuid.UUID) *NodeConfigurationBuilder
- func (b *NodeConfigurationBuilder) WithRootPayload(payload any) *NodeConfigurationBuilder
- type NodeMetadataContext
- type NodeRequestContext
- type NodeWebhookContext
- type RunExecutionContext
- func (c *RunExecutionContext) AddError(message string) error
- func (c *RunExecutionContext) Cancel() error
- func (c *RunExecutionContext) Create(params core.RunCreationParams) (*core.Run, error)
- func (c *RunExecutionContext) WithPendingRunCreated(fn func(workflowID, runID uuid.UUID)) *RunExecutionContext
- func (c *RunExecutionContext) WithRunCancelled(...) *RunExecutionContext
- type RunnerTaskContext
- type SecretsContext
- type UsageContext
- type WebhookContext
- func (c *WebhookContext) CallbackHasActiveNodes(webhookID string) (bool, error)
- func (c *WebhookContext) GetConfiguration() any
- func (c *WebhookContext) GetID() string
- func (c *WebhookContext) GetMetadata() any
- func (c *WebhookContext) GetSecret() ([]byte, error)
- func (c *WebhookContext) GetURL() string
- func (c *WebhookContext) SetSecret(secret []byte) error
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ApplyFileBindCleanups ¶
func ApplyFileBindCleanups(jobs []FileBindCleanup, txErr error)
func BuildProcessQueueContext ¶
func BuildProcessQueueContext( httpCtx core.HTTPContext, tx *gorm.DB, node *models.CanvasNode, queueItem *models.CanvasNodeQueueItem, configFields []configuration.Field, onNewEvents func([]models.CanvasEvent), ) (*core.ProcessQueueContext, error)
func DispatchOnError ¶ added in v0.26.0
func DispatchOnError(tx *gorm.DB, execution *models.CanvasNodeExecution, onNewEvents func([]models.CanvasEvent))
DispatchOnError fans an errored execution out to every On Error trigger node in the same canvas by emitting a root event on each of them. The emitted events are collected through onNewEvents, so the caller publishes them after its transaction commits (and the EventRouter starts a new run for each).
On Error nodes are not wired through edges, so this is what connects a failed execution to them. The event payload describes which node errored and carries the payloads emitted by every upstream node in the failed run.
Dispatch failures must never roll back or mask the original execution failure, so any error here is logged and swallowed.
func EmitWorkOrderCreated ¶
func EmitWorkOrderCreated(tx *gorm.DB, factoryModel *models.Factory, order *models.FactoryWorkOrder)
EmitWorkOrderCreated fans a new work order out to every On Work Order trigger in the factory. When Planning is off, the Backlog canvas is skipped so no planning or analysis run starts. Failures are logged: the work order already exists, and a missed score can be retried by creating the item again.
func NewIntegrationSubscriptionContext ¶ added in v0.5.0
func NewIntegrationSubscriptionContext( tx *gorm.DB, registry *registry.Registry, subscription *models.NodeSubscription, node *models.CanvasNode, integration *models.Integration, integrationCtx *IntegrationContext, onNewEvents func([]models.CanvasEvent), ) core.IntegrationSubscriptionContext
func ResolveQueueName ¶
func ResolveQueueName(tx *gorm.DB, node *models.CanvasNode, item *models.CanvasNodeQueueItem) (string, error)
ResolveQueueName returns the resolved queue name for a queue item and persists it on the item, so key expressions are evaluated exactly once. A node without a concurrency key uses its implicit queue, named after the node ID.
func SkipPausedIntakeFeed ¶
Types ¶
type AppContext ¶ added in v0.29.0
type AppContext struct {
// contains filtered or unexported fields
}
func NewAppContext ¶ added in v0.29.0
func NewAppContext(tx *gorm.DB, canvas *models.Canvas, node *models.CanvasNode) *AppContext
func (*AppContext) Get ¶ added in v0.29.0
func (c *AppContext) Get(idOrName string) (*core.App, error)
func (*AppContext) GetNode ¶ added in v0.30.0
func (c *AppContext) GetNode(app, node string) (*core.CanvasNode, error)
func (*AppContext) Subscribe ¶ added in v0.29.0
func (c *AppContext) Subscribe(id string) error
func (*AppContext) Unsubscribe ¶ added in v0.29.0
func (c *AppContext) Unsubscribe() error
type AppExecutionContext ¶ added in v0.29.0
type AppExecutionContext struct {
// contains filtered or unexported fields
}
func NewAppExecutionContext ¶ added in v0.29.0
func NewAppExecutionContext( tx *gorm.DB, canvas *models.Canvas, node *models.CanvasNode, execution *models.CanvasNodeExecution, ) *AppExecutionContext
func (*AppExecutionContext) Broadcast ¶ added in v0.29.0
func (c *AppExecutionContext) Broadcast(payload any) error
type AuthReader ¶ added in v0.17.0
type AuthReader struct {
// contains filtered or unexported fields
}
func NewAuthReader ¶ added in v0.17.0
func NewAuthReader(tx *gorm.DB, orgID uuid.UUID, authService authorization.Authorization, authenticatedUser *models.User) *AuthReader
func (*AuthReader) AuthenticatedUser ¶ added in v0.17.0
func (c *AuthReader) AuthenticatedUser() *core.User
func (*AuthReader) GetGroup ¶ added in v0.17.0
func (c *AuthReader) GetGroup(name string) (*core.GroupRef, error)
func (*AuthReader) GetRole ¶ added in v0.17.0
func (c *AuthReader) GetRole(name string) (*core.RoleRef, error)
type CanvasMemoryContext ¶ added in v0.10.0
type CanvasMemoryContext struct {
// contains filtered or unexported fields
}
func NewCanvasMemoryContext ¶ added in v0.10.0
func NewCanvasMemoryContext(tx *gorm.DB, canvasID uuid.UUID) *CanvasMemoryContext
func (*CanvasMemoryContext) Add ¶ added in v0.10.0
func (c *CanvasMemoryContext) Add(namespace string, values any) error
func (*CanvasMemoryContext) AddRecord ¶ added in v0.23.0
func (c *CanvasMemoryContext) AddRecord(namespace string, values any) (core.CanvasMemoryRecord, error)
func (*CanvasMemoryContext) UpdateNamespace ¶ added in v0.23.0
func (*CanvasMemoryContext) UpdateNamespaceRecords ¶ added in v0.23.0
func (c *CanvasMemoryContext) UpdateNamespaceRecords(namespace string, values map[string]any) ([]core.CanvasMemoryRecord, error)
func (*CanvasMemoryContext) UpdateRecords ¶ added in v0.23.0
func (c *CanvasMemoryContext) UpdateRecords(namespace string, matches map[string]any, values map[string]any) ([]core.CanvasMemoryRecord, error)
func (*CanvasMemoryContext) WithChangeCallback ¶ added in v0.26.0
func (c *CanvasMemoryContext) WithChangeCallback(onChanged func()) *CanvasMemoryContext
WithChangeCallback registers a callback invoked whenever a mutating operation (Add/Delete/Update/UpdateNamespace) succeeds. Used to signal callers that memory was modified so they can publish a websocket event post-commit.
type CapabilityContext ¶ added in v0.19.0
type CapabilityContext struct {
// contains filtered or unexported fields
}
func NewCapabilityContext ¶ added in v0.19.0
func NewCapabilityContext(definitions []core.Capability, states []models.CapabilityState) *CapabilityContext
func (*CapabilityContext) Available ¶ added in v0.19.0
func (c *CapabilityContext) Available(capabilities ...string)
func (*CapabilityContext) Clear ¶ added in v0.19.0
func (c *CapabilityContext) Clear()
func (*CapabilityContext) Disable ¶ added in v0.19.0
func (c *CapabilityContext) Disable(capabilities ...string)
func (*CapabilityContext) Enable ¶ added in v0.19.0
func (c *CapabilityContext) Enable(capabilities ...string)
func (*CapabilityContext) Enabled ¶ added in v0.20.0
func (c *CapabilityContext) Enabled() []string
func (*CapabilityContext) IsRequested ¶ added in v0.19.0
func (c *CapabilityContext) IsRequested(capabilities ...string) bool
func (*CapabilityContext) Request ¶ added in v0.19.0
func (c *CapabilityContext) Request(capabilities ...string)
func (*CapabilityContext) Requested ¶ added in v0.19.0
func (c *CapabilityContext) Requested() []string
func (*CapabilityContext) States ¶ added in v0.19.0
func (c *CapabilityContext) States() []models.CapabilityState
func (*CapabilityContext) Unavailable ¶ added in v0.19.0
func (c *CapabilityContext) Unavailable(capabilities ...string)
type ConfigurationBuildError ¶
type ConfigurationBuildError struct {
Err error
QueueItem *models.CanvasNodeQueueItem
Node *models.CanvasNode
Event *models.CanvasEvent
RootEventID uuid.UUID
}
func (*ConfigurationBuildError) Error ¶
func (e *ConfigurationBuildError) Error() string
func (*ConfigurationBuildError) Unwrap ¶
func (e *ConfigurationBuildError) Unwrap() error
type EventContext ¶
type EventContext struct {
// contains filtered or unexported fields
}
func NewEventContext ¶
func NewEventContext(tx *gorm.DB, node *models.CanvasNode, run *models.CanvasRun, onNewEvents func([]models.CanvasEvent)) *EventContext
type ExecutionMetadataContext ¶
type ExecutionMetadataContext struct {
// contains filtered or unexported fields
}
func NewExecutionMetadataContext ¶
func NewExecutionMetadataContext(tx *gorm.DB, execution *models.CanvasNodeExecution) *ExecutionMetadataContext
func (*ExecutionMetadataContext) Get ¶
func (m *ExecutionMetadataContext) Get() any
func (*ExecutionMetadataContext) Set ¶
func (m *ExecutionMetadataContext) Set(value any) error
type ExecutionRequestContext ¶
type ExecutionRequestContext struct {
// contains filtered or unexported fields
}
func NewExecutionRequestContext ¶
func NewExecutionRequestContext(tx *gorm.DB, execution *models.CanvasNodeExecution) *ExecutionRequestContext
func (*ExecutionRequestContext) ScheduleActionCall ¶
type ExecutionStateContext ¶
type ExecutionStateContext struct {
// contains filtered or unexported fields
}
func NewExecutionStateContext ¶
func NewExecutionStateContext( tx *gorm.DB, execution *models.CanvasNodeExecution, onNewEvents func([]models.CanvasEvent), ) *ExecutionStateContext
func (*ExecutionStateContext) Cancel ¶
func (s *ExecutionStateContext) Cancel() error
func (*ExecutionStateContext) Emit ¶
func (s *ExecutionStateContext) Emit(channel, payloadType string, payloads []any) error
func (*ExecutionStateContext) EmitAndContinue ¶ added in v0.26.0
func (s *ExecutionStateContext) EmitAndContinue(channel, payloadType string, payloads []any) error
func (*ExecutionStateContext) Fail ¶
func (s *ExecutionStateContext) Fail(reason, message string) error
func (*ExecutionStateContext) GetKV ¶ added in v0.22.0
func (s *ExecutionStateContext) GetKV(key string) (string, error)
func (*ExecutionStateContext) IsCancelling ¶
func (s *ExecutionStateContext) IsCancelling() bool
func (*ExecutionStateContext) IsFinished ¶
func (s *ExecutionStateContext) IsFinished() bool
func (*ExecutionStateContext) Pass ¶
func (s *ExecutionStateContext) Pass() error
func (*ExecutionStateContext) SetKV ¶
func (s *ExecutionStateContext) SetKV(key, value string) error
type ExpressionContext ¶ added in v0.16.0
type ExpressionContext struct {
// contains filtered or unexported fields
}
func NewExpressionContext ¶ added in v0.16.0
func NewExpressionContext(configurationBuilder *NodeConfigurationBuilder) *ExpressionContext
func (*ExpressionContext) BuildExecutionMessageChain ¶ added in v0.25.0
func (c *ExpressionContext) BuildExecutionMessageChain() (map[string]any, error)
func (*ExpressionContext) Run ¶ added in v0.16.0
func (c *ExpressionContext) Run(expression string) (any, error)
func (*ExpressionContext) RunWithExtraVariables ¶ added in v0.23.0
type FactoryContext ¶
type FactoryContext struct {
// contains filtered or unexported fields
}
func NewFactoryContext ¶
func NewFactoryContext(tx *gorm.DB, canvas *models.Canvas, execution *models.CanvasNodeExecution) *FactoryContext
func (*FactoryContext) AddPullRequest ¶
func (c *FactoryContext) AddPullRequest(params core.AddPullRequestParams) (*core.PullRequest, error)
func (*FactoryContext) AddPullRequestActivity ¶
func (c *FactoryContext) AddPullRequestActivity(params core.AddPullRequestActivityParams) (*core.PullRequestActivityResult, error)
func (*FactoryContext) AddWorkOrderArtifact ¶
func (c *FactoryContext) AddWorkOrderArtifact(params core.AddWorkOrderArtifactParams) (*core.WorkOrderArtifact, error)
func (*FactoryContext) AddWorkOrderComment ¶
func (c *FactoryContext) AddWorkOrderComment(params core.AddWorkOrderCommentParams) error
func (*FactoryContext) CreateWorkOrder ¶
func (c *FactoryContext) CreateWorkOrder(params core.WorkOrderParams) (*core.WorkOrder, bool, error)
func (*FactoryContext) FindPullRequest ¶
func (c *FactoryContext) FindPullRequest(params core.FindPullRequestParams) (*core.PullRequestMatch, error)
func (*FactoryContext) FindWorkOrder ¶
func (c *FactoryContext) FindWorkOrder(params core.FindWorkOrderParams) (*core.WorkOrder, error)
FindWorkOrder resolves a work order by id or by an artifact key, independent of the current run's `factory_work_order_executions` row. This is what lets a plain webhook-triggered run (e.g. github.onPullRequest) locate a work order to act on.
func (*FactoryContext) ReportWorkOrderCheck ¶
func (c *FactoryContext) ReportWorkOrderCheck(params core.ReportWorkOrderCheckParams) (*core.WorkOrderCheck, error)
func (*FactoryContext) SetWorkOrderStatusNote ¶
func (c *FactoryContext) SetWorkOrderStatusNote(params core.SetWorkOrderStatusNoteParams) (*core.WorkOrderStatusNote, error)
func (*FactoryContext) UpdatePullRequest ¶
func (c *FactoryContext) UpdatePullRequest(params core.UpdatePullRequestParams) (*core.PullRequest, error)
func (*FactoryContext) UpdatePullRequestActivity ¶
func (c *FactoryContext) UpdatePullRequestActivity(params core.UpdatePullRequestActivityParams) (*core.PullRequestActivityResult, error)
func (*FactoryContext) UpdateWorkOrderStatus ¶
func (c *FactoryContext) UpdateWorkOrderStatus(params core.UpdateWorkOrderStatusParams) (*core.WorkOrder, bool, error)
func (*FactoryContext) VCSProvider ¶
func (c *FactoryContext) VCSProvider() (string, error)
VCSProvider returns the stored Git host. An empty value means GitHub. A canvas that is not owned by a factory has no provider.
func (*FactoryContext) WithFileBindCleanup ¶
func (c *FactoryContext) WithFileBindCleanup(callback func(FileBindCleanup)) *FactoryContext
func (*FactoryContext) WithGitHubPullRequestRecorded ¶
func (c *FactoryContext) WithGitHubPullRequestRecorded( callback func(organizationID, factoryID, pullRequestID uuid.UUID), ) *FactoryContext
func (*FactoryContext) WithJiraIssueFiles ¶
func (c *FactoryContext) WithJiraIssueFiles(read jiraFileRead) *FactoryContext
func (*FactoryContext) WithLinearIssueFiles ¶
func (c *FactoryContext) WithLinearIssueFiles(read linearFileRead) *FactoryContext
func (*FactoryContext) WithProductiveTaskFiles ¶
func (c *FactoryContext) WithProductiveTaskFiles(read productiveFileRead) *FactoryContext
func (*FactoryContext) WithRemoteImageFetch ¶
func (c *FactoryContext) WithRemoteImageFetch(fetch storedfiles.FetchFunc) *FactoryContext
func (*FactoryContext) WithRemoteImageIngest ¶
func (c *FactoryContext) WithRemoteImageIngest(encryptor crypto.Encryptor, registry *registry.Registry) *FactoryContext
func (*FactoryContext) WithRunsCancelled ¶
func (c *FactoryContext) WithRunsCancelled(callback func([]*models.RunCancellationResult)) *FactoryContext
func (*FactoryContext) WithWorkOrderNotification ¶
func (c *FactoryContext) WithWorkOrderNotification( callback func(messages.FactoryWorkOrderNotificationMessage), ) *FactoryContext
func (*FactoryContext) WithWorkOrderUpdated ¶
func (c *FactoryContext) WithWorkOrderUpdated(callback func(factoryID, orderID, reason string)) *FactoryContext
type FileBindCleanup ¶
type FileBindCleanup struct {
OrganizationID uuid.UUID
FactoryID uuid.UUID
Result storedfiles.BindResult
BindErr error
}
FileBindCleanup is blob deletion work that must run after the surrounding database transaction commits. Apply it with ApplyFileBindCleanups.
type HostedLLMContext ¶
type HostedLLMContext struct {
// contains filtered or unexported fields
}
HostedLLMContext resolves installation-hosted provider credentials. Credit checks use a committed connection so remaining credit includes billed spend from other runs.
func NewHostedLLMContext ¶
func (*HostedLLMContext) AssertCreditAvailable ¶
func (c *HostedLLMContext) AssertCreditAvailable() error
func (*HostedLLMContext) AssertModelSelectable ¶
func (c *HostedLLMContext) AssertModelSelectable(provider, fundingSource, model string) error
func (*HostedLLMContext) DefaultModel ¶
func (c *HostedLLMContext) DefaultModel() (core.DefaultHostedLLMModel, error)
func (*HostedLLMContext) Resolve ¶
func (c *HostedLLMContext) Resolve(provider string) (core.HostedLLMAccess, error)
type IntegrationContext ¶
type IntegrationContext struct {
// contains filtered or unexported fields
}
func NewIntegrationContext ¶
func NewIntegrationContext( tx *gorm.DB, node *models.CanvasNode, integration *models.Integration, encryptor crypto.Encryptor, registry *registry.Registry, onNewEvents func([]models.CanvasEvent), ) *IntegrationContext
func (*IntegrationContext) Error ¶ added in v0.6.0
func (c *IntegrationContext) Error(message string)
func (*IntegrationContext) FindSubscription ¶ added in v0.9.0
func (c *IntegrationContext) FindSubscription(predicate func(core.IntegrationSubscriptionContext) bool) (core.IntegrationSubscriptionContext, error)
FindSubscription finds the first subscription matching the predicate. Note: This loads all subscriptions via ListSubscriptions() and iterates through them. For installations with many subscriptions, this may be inefficient. Consider adding an index-based lookup if performance becomes an issue.
func (*IntegrationContext) GetConfig ¶ added in v0.5.0
func (c *IntegrationContext) GetConfig(name string) ([]byte, error)
func (*IntegrationContext) GetMetadata ¶ added in v0.5.0
func (c *IntegrationContext) GetMetadata() any
func (*IntegrationContext) GetOptionalConfig ¶ added in v0.9.0
func (c *IntegrationContext) GetOptionalConfig(name string) ([]byte, error)
func (*IntegrationContext) GetSecrets ¶ added in v0.5.0
func (c *IntegrationContext) GetSecrets() ([]core.IntegrationSecret, error)
func (*IntegrationContext) GetState ¶ added in v0.5.0
func (c *IntegrationContext) GetState() string
func (*IntegrationContext) ID ¶ added in v0.5.0
func (c *IntegrationContext) ID() uuid.UUID
func (*IntegrationContext) LegacySetup ¶ added in v0.19.0
func (c *IntegrationContext) LegacySetup() bool
func (*IntegrationContext) ListNodeConfigurations ¶
func (c *IntegrationContext) ListNodeConfigurations() ([]any, error)
func (*IntegrationContext) ListSubscriptions ¶ added in v0.5.0
func (c *IntegrationContext) ListSubscriptions() ([]core.IntegrationSubscriptionContext, error)
func (*IntegrationContext) NewBrowserAction ¶ added in v0.5.0
func (c *IntegrationContext) NewBrowserAction(action core.BrowserAction)
func (*IntegrationContext) Persist ¶
func (c *IntegrationContext) Persist() error
func (*IntegrationContext) PersistMetadata ¶
func (c *IntegrationContext) PersistMetadata() error
PersistMetadata writes only the metadata keys this context changed. Webhook Setup and Cleanup mirror provider state onto the integration (Jira keeps the registration id its refresh hook must extend), and those handlers run outside any code path that saves the integration afterwards. The row is locked and each changed key is applied only when the stored value still matches the snapshot from load, so a sync running at the same time does not lose OAuth expiration, user, or project data. A conflicting write returns an error so webhook setup retries instead of reporting ready without a stored id.
func (*IntegrationContext) Properties ¶ added in v0.19.0
func (c *IntegrationContext) Properties() core.IntegrationPropertyStorage
func (*IntegrationContext) Ready ¶ added in v0.6.0
func (c *IntegrationContext) Ready()
func (*IntegrationContext) RemoveBrowserAction ¶ added in v0.5.0
func (c *IntegrationContext) RemoveBrowserAction()
func (*IntegrationContext) RequestWebhook ¶ added in v0.5.0
func (c *IntegrationContext) RequestWebhook(configuration any) error
func (*IntegrationContext) ScheduleActionCall ¶ added in v0.6.0
func (*IntegrationContext) ScheduleResync ¶ added in v0.5.0
func (c *IntegrationContext) ScheduleResync(interval time.Duration) error
func (*IntegrationContext) Secrets ¶ added in v0.19.0
func (c *IntegrationContext) Secrets() core.IntegrationSecretStorage
func (*IntegrationContext) SetMetadata ¶ added in v0.5.0
func (c *IntegrationContext) SetMetadata(value any)
type IntegrationPropertyStorage ¶ added in v0.19.0
type IntegrationPropertyStorage struct {
// contains filtered or unexported fields
}
func NewIntegrationPropertyStorage ¶ added in v0.19.0
func NewIntegrationPropertyStorage(integration *models.Integration) *IntegrationPropertyStorage
func (*IntegrationPropertyStorage) Create ¶ added in v0.19.0
func (s *IntegrationPropertyStorage) Create(def core.IntegrationPropertyDefinition) error
func (*IntegrationPropertyStorage) CreateMany ¶ added in v0.19.0
func (s *IntegrationPropertyStorage) CreateMany(defs []core.IntegrationPropertyDefinition) error
func (*IntegrationPropertyStorage) Delete ¶ added in v0.19.0
func (s *IntegrationPropertyStorage) Delete(names ...string) error
type IntegrationSecretStorage ¶ added in v0.19.0
type IntegrationSecretStorage struct {
// contains filtered or unexported fields
}
func NewIntegrationSecretStorage ¶ added in v0.19.0
func NewIntegrationSecretStorage(tx *gorm.DB, encryptor crypto.Encryptor, integration *models.Integration) *IntegrationSecretStorage
func (*IntegrationSecretStorage) Create ¶ added in v0.19.0
func (s *IntegrationSecretStorage) Create(def core.IntegrationSecretDefinition) error
func (*IntegrationSecretStorage) CreateMany ¶ added in v0.19.0
func (s *IntegrationSecretStorage) CreateMany(defs []core.IntegrationSecretDefinition) error
func (*IntegrationSecretStorage) Delete ¶ added in v0.19.0
func (s *IntegrationSecretStorage) Delete(name string) error
type IntegrationSetupContext ¶ added in v0.20.0
type IntegrationSetupContext struct {
Integration *models.Integration
}
func NewIntegrationSetupContext ¶ added in v0.20.0
func NewIntegrationSetupContext(integration *models.Integration) *IntegrationSetupContext
type IntegrationSubscriptionContext ¶ added in v0.5.0
type IntegrationSubscriptionContext struct {
// contains filtered or unexported fields
}
func (*IntegrationSubscriptionContext) Configuration ¶ added in v0.5.0
func (c *IntegrationSubscriptionContext) Configuration() any
func (*IntegrationSubscriptionContext) SendMessage ¶ added in v0.5.0
func (c *IntegrationSubscriptionContext) SendMessage(message any) error
type NodeConfigurationBuilder ¶
type NodeConfigurationBuilder struct {
// contains filtered or unexported fields
}
func NewNodeConfigurationBuilder ¶
func NewNodeConfigurationBuilder(tx *gorm.DB, workflowID uuid.UUID) *NodeConfigurationBuilder
func (*NodeConfigurationBuilder) BuildExecutionMessageChain ¶ added in v0.25.0
func (b *NodeConfigurationBuilder) BuildExecutionMessageChain() (map[string]any, error)
BuildExecutionMessageChain returns upstream node payloads keyed by canvas node name. This is the $ object passed to runner JavaScript tasks.
func (*NodeConfigurationBuilder) ResolveExpression ¶
func (b *NodeConfigurationBuilder) ResolveExpression(expression string) (any, error)
func (*NodeConfigurationBuilder) ResolveExpressionWithExtraVariables ¶ added in v0.23.0
func (b *NodeConfigurationBuilder) ResolveExpressionWithExtraVariables(expression string, variables map[string]any) (any, error)
ResolveExpressionWithExtraVariables evaluates an expression with extra variables merged into the eval environment. Provided keys cannot override built-ins; we reject any attempt to shadow reserved names so that `$`, `memory`, `config`, `root`, and `previous` stay deterministic.
func (*NodeConfigurationBuilder) ResolveTemplateExpressions ¶ added in v0.16.0
func (b *NodeConfigurationBuilder) ResolveTemplateExpressions(expression string) (any, error)
func (*NodeConfigurationBuilder) WithConfigurationFields ¶ added in v0.0.45
func (b *NodeConfigurationBuilder) WithConfigurationFields(fields []configuration.Field) *NodeConfigurationBuilder
func (*NodeConfigurationBuilder) WithExpressionVariables ¶ added in v0.23.0
func (b *NodeConfigurationBuilder) WithExpressionVariables(variables map[string]any) *NodeConfigurationBuilder
func (*NodeConfigurationBuilder) WithIncomingEventID ¶ added in v0.26.0
func (b *NodeConfigurationBuilder) WithIncomingEventID(incomingEventID *uuid.UUID) *NodeConfigurationBuilder
func (*NodeConfigurationBuilder) WithInput ¶
func (b *NodeConfigurationBuilder) WithInput(input any) *NodeConfigurationBuilder
WithInput stores input normalized for expression evaluation (see normalizeExpressionValue).
func (*NodeConfigurationBuilder) WithNodeID ¶ added in v0.1.6
func (b *NodeConfigurationBuilder) WithNodeID(nodeID string) *NodeConfigurationBuilder
func (*NodeConfigurationBuilder) WithPreviousExecution ¶
func (b *NodeConfigurationBuilder) WithPreviousExecution(previousExecutionID *uuid.UUID) *NodeConfigurationBuilder
func (*NodeConfigurationBuilder) WithRootEvent ¶
func (b *NodeConfigurationBuilder) WithRootEvent(rootEventID *uuid.UUID) *NodeConfigurationBuilder
func (*NodeConfigurationBuilder) WithRootPayload ¶ added in v0.18.0
func (b *NodeConfigurationBuilder) WithRootPayload(payload any) *NodeConfigurationBuilder
WithRootPayload stores payload normalized for expression evaluation (see normalizeExpressionValue).
type NodeMetadataContext ¶
type NodeMetadataContext struct {
// contains filtered or unexported fields
}
func NewNodeMetadataContext ¶
func NewNodeMetadataContext(tx *gorm.DB, node *models.CanvasNode) *NodeMetadataContext
func (*NodeMetadataContext) Get ¶
func (m *NodeMetadataContext) Get() any
func (*NodeMetadataContext) Set ¶
func (m *NodeMetadataContext) Set(value any) error
type NodeRequestContext ¶
type NodeRequestContext struct {
// contains filtered or unexported fields
}
func NewNodeRequestContext ¶
func NewNodeRequestContext(tx *gorm.DB, node *models.CanvasNode) *NodeRequestContext
func (*NodeRequestContext) ScheduleActionCall ¶
type NodeWebhookContext ¶ added in v0.0.30
type NodeWebhookContext struct {
// contains filtered or unexported fields
}
func NewNodeWebhookContext ¶ added in v0.0.30
func NewNodeWebhookContext(ctx context.Context, tx *gorm.DB, encryptor crypto.Encryptor, node *models.CanvasNode, baseURL string) *NodeWebhookContext
func (*NodeWebhookContext) GetBaseURL ¶ added in v0.0.30
func (c *NodeWebhookContext) GetBaseURL() string
func (*NodeWebhookContext) GetSecret ¶ added in v0.0.30
func (c *NodeWebhookContext) GetSecret() ([]byte, error)
func (*NodeWebhookContext) ResetSecret ¶ added in v0.0.30
func (c *NodeWebhookContext) ResetSecret() ([]byte, []byte, error)
func (*NodeWebhookContext) SetSecret ¶ added in v0.10.0
func (c *NodeWebhookContext) SetSecret(secret []byte) error
func (*NodeWebhookContext) Setup ¶ added in v0.0.30
func (c *NodeWebhookContext) Setup() (string, error)
type RunExecutionContext ¶ added in v0.30.0
type RunExecutionContext struct {
// contains filtered or unexported fields
}
func NewRunExecutionContext ¶ added in v0.30.0
func NewRunExecutionContext(tx *gorm.DB, canvas *models.Canvas, node *models.CanvasNode, execution *models.CanvasNodeExecution) *RunExecutionContext
func (*RunExecutionContext) AddError ¶
func (c *RunExecutionContext) AddError(message string) error
func (*RunExecutionContext) Cancel ¶ added in v0.30.0
func (c *RunExecutionContext) Cancel() error
func (*RunExecutionContext) Create ¶ added in v0.30.0
func (c *RunExecutionContext) Create(params core.RunCreationParams) (*core.Run, error)
func (*RunExecutionContext) WithPendingRunCreated ¶ added in v0.30.0
func (c *RunExecutionContext) WithPendingRunCreated(fn func(workflowID, runID uuid.UUID)) *RunExecutionContext
func (*RunExecutionContext) WithRunCancelled ¶ added in v0.30.0
func (c *RunExecutionContext) WithRunCancelled(fn func(workflowID, runID uuid.UUID, drainResult *models.RunCancellationDrainResult)) *RunExecutionContext
type RunnerTaskContext ¶
type RunnerTaskContext struct {
// contains filtered or unexported fields
}
func NewRunnerTaskContext ¶
func (*RunnerTaskContext) Create ¶
func (c *RunnerTaskContext) Create(rawID, fleetID string, payload []byte) error
func (*RunnerTaskContext) Find ¶
func (c *RunnerTaskContext) Find(rawID string) (*core.RunnerTask, error)
func (*RunnerTaskContext) IntegratedBackendEnabled ¶
func (c *RunnerTaskContext) IntegratedBackendEnabled() (bool, error)
func (*RunnerTaskContext) RequestCancel ¶
func (c *RunnerTaskContext) RequestCancel(rawID string) error
type SecretsContext ¶ added in v0.7.0
type SecretsContext struct {
// contains filtered or unexported fields
}
* SecretsContext implements core.SecretsContext, * resolving organization secret key values for component execution.
func NewSecretsContext ¶ added in v0.7.0
func (*SecretsContext) GetIntegrationSecrets ¶
func (c *SecretsContext) GetIntegrationSecrets(integrationName string) (core.IntegrationSecrets, error)
func (*SecretsContext) GetKey ¶ added in v0.7.0
func (c *SecretsContext) GetKey(secretName, keyName string) ([]byte, error)
func (*SecretsContext) GetSecretKeys ¶ added in v0.30.0
func (c *SecretsContext) GetSecretKeys(secretName string) (map[string][]byte, error)
type UsageContext ¶
type UsageContext struct {
// contains filtered or unexported fields
}
UsageContext records workspace spend for the current node execution. Inserts use a committed connection, not the node-executor transaction. The provider already billed the tokens or VM seconds; a later Emit/Fail/rollback must not drop the ledger row.
func NewUsageContext ¶
func NewUsageContext(organizationID uuid.UUID, execution *models.CanvasNodeExecution) *UsageContext
func (*UsageContext) Record ¶
func (c *UsageContext) Record(record core.UsageRecord) error
func (*UsageContext) RecordCompute ¶
func (c *UsageContext) RecordCompute(record core.ComputeUsageRecord) error
type WebhookContext ¶
type WebhookContext struct {
// contains filtered or unexported fields
}
func NewWebhookContext ¶
func (*WebhookContext) CallbackHasActiveNodes ¶
func (c *WebhookContext) CallbackHasActiveNodes(webhookID string) (bool, error)
func (*WebhookContext) GetConfiguration ¶ added in v0.0.30
func (c *WebhookContext) GetConfiguration() any
func (*WebhookContext) GetID ¶ added in v0.0.30
func (c *WebhookContext) GetID() string
func (*WebhookContext) GetMetadata ¶ added in v0.0.30
func (c *WebhookContext) GetMetadata() any
func (*WebhookContext) GetSecret ¶
func (c *WebhookContext) GetSecret() ([]byte, error)
func (*WebhookContext) GetURL ¶ added in v0.0.30
func (c *WebhookContext) GetURL() string
func (*WebhookContext) SetSecret ¶ added in v0.0.30
func (c *WebhookContext) SetSecret(secret []byte) error
Source Files
¶
- app_context.go
- app_execution_context.go
- auth_reader.go
- canvas_memory_context.go
- capability_context.go
- event_context.go
- execution_metadata_context.go
- execution_output_lookup.go
- execution_request_context.go
- execution_state_context.go
- expression_context.go
- factory_context.go
- hosted_llm_context.go
- integration_context.go
- integration_property_storage.go
- integration_secret_storage.go
- integration_setup_context.go
- integration_subscription_context.go
- jira_files.go
- linear_files.go
- node_configuration_builder.go
- node_metadata_context.go
- node_request_context.go
- node_webhook_context.go
- on_error_dispatch.go
- paused_intake.go
- process_queue_context.go
- productive_files.go
- run_execution_context.go
- runner_task_context.go
- secrets_context.go
- usage_context.go
- webhook_context.go
- work_order_created.go