testutil

package
v0.0.5 Latest Latest
Warning

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

Go to latest
Published: May 29, 2026 License: MIT Imports: 33 Imported by: 0

Documentation

Overview

Package testutil provides shared helpers for API-layer tests.

Index

Constants

This section is empty.

Variables

View Source
var ErrStubNetworkServiceWaitInboxNotImplemented = errors.New("stub network service WaitInbox not implemented")
View Source
var ErrStubWorkspaceServiceNotImplemented = errors.New("stub workspace service method not implemented")

Functions

func AssertMemoryV2RouteParity

func AssertMemoryV2RouteParity(t testing.TB, got []string)

AssertMemoryV2RouteParity fails when a transport drifts from the Memory v2 route contract.

func ConfigWithDisabledNetwork

func ConfigWithDisabledNetwork(homePaths aghconfig.HomePaths) aghconfig.Config

ConfigWithDisabledNetwork returns a default test config with networking turned off.

func DecodeJSONResponse

func DecodeJSONResponse(t *testing.T, recorder *httptest.ResponseRecorder, dest any)

func DecodeSSEData

func DecodeSSEData(t *testing.T, record SSERecord, dest any)

func DiscardLogger

func DiscardLogger() *slog.Logger

func ExpectedMemoryV2RouteKeys

func ExpectedMemoryV2RouteKeys() []string

ExpectedMemoryV2RouteKeys is the shared parity contract for every transport.

func MemoryV2RouteKeysFromGin

func MemoryV2RouteKeysFromGin(routes gin.RoutesInfo) []string

MemoryV2RouteKeysFromGin returns the normalized Memory v2 route keys registered on a Gin engine.

func MustJSONBody

func MustJSONBody(t *testing.T, value any) []byte

func NewDisabledNetworkHomeConfig

func NewDisabledNetworkHomeConfig(t *testing.T) (aghconfig.HomePaths, aghconfig.Config)

NewDisabledNetworkHomeConfig creates one test home and derives a disabled-network config from it.

func NewSession

func NewSession(id string) *session.Session

func NewSessionInfo

func NewSessionInfo(id string) *session.Info

func NewTestHomePaths

func NewTestHomePaths(t *testing.T) aghconfig.HomePaths

func PerformRequest

func PerformRequest(t *testing.T, engine http.Handler, method, path string, body []byte) *httptest.ResponseRecorder

func PerformRequestWithHeaders

func PerformRequestWithHeaders(
	t *testing.T,
	engine http.Handler,
	method, path string,
	body []byte,
	headers map[string]string,
) *httptest.ResponseRecorder

func WriteAgentDef

func WriteAgentDef(t *testing.T, homePaths aghconfig.HomePaths, name string)

Types

type SSERecord

type SSERecord struct {
	ID    string
	Event string
	Data  []byte
}

func ParseSSE

func ParseSSE(t *testing.T, body string) []SSERecord

type StubAutomationManager

type StubAutomationManager struct {
	ListJobsFn      func(context.Context, automationpkg.JobListQuery) ([]automationpkg.Job, error)
	JobsFn          func(context.Context) ([]automationpkg.Job, error)
	GetJobFn        func(context.Context, string) (automationpkg.Job, error)
	CreateJobFn     func(context.Context, automationpkg.Job) (automationpkg.Job, error)
	UpdateJobFn     func(context.Context, automationpkg.Job) (automationpkg.Job, error)
	DeleteJobFn     func(context.Context, string) error
	TriggerJobFn    func(context.Context, string) (automationpkg.Run, error)
	ListTriggersFn  func(context.Context, automationpkg.TriggerListQuery) ([]automationpkg.Trigger, error)
	TriggersFn      func(context.Context) ([]automationpkg.Trigger, error)
	GetTriggerFn    func(context.Context, string) (automationpkg.Trigger, error)
	CreateTriggerFn func(
		context.Context,
		automationpkg.Trigger,
		automationpkg.WebhookSecretWrite,
	) (automationpkg.Trigger, error)
	UpdateTriggerFn func(
		context.Context,
		automationpkg.Trigger,
		*automationpkg.WebhookSecretWrite,
	) (automationpkg.Trigger, error)
	DeleteTriggerFn     func(context.Context, string) error
	ListRunsFn          func(context.Context, automationpkg.RunQuery) ([]automationpkg.Run, error)
	RunsFn              func(context.Context, automationpkg.RunQuery) ([]automationpkg.Run, error)
	GetRunFn            func(context.Context, string) (automationpkg.Run, error)
	StatusFn            func(context.Context) (automationpkg.ManagerStatus, error)
	SetJobEnabledFn     func(context.Context, string, bool) (automationpkg.Job, error)
	SetTriggerEnabledFn func(context.Context, string, bool) (automationpkg.Trigger, error)
	HandleWebhookFn     func(context.Context, automationpkg.WebhookRequest) (automationpkg.TriggerResult, error)
}

func (StubAutomationManager) CreateJob

func (StubAutomationManager) CreateTrigger

func (StubAutomationManager) DeleteJob

func (s StubAutomationManager) DeleteJob(ctx context.Context, id string) error

func (StubAutomationManager) DeleteTrigger

func (s StubAutomationManager) DeleteTrigger(ctx context.Context, id string) error

func (StubAutomationManager) GetJob

func (StubAutomationManager) GetRun

func (StubAutomationManager) GetTrigger

func (StubAutomationManager) HandleWebhook

func (StubAutomationManager) Jobs

func (StubAutomationManager) ListJobs

func (StubAutomationManager) ListRuns

func (StubAutomationManager) ListTriggers

func (StubAutomationManager) Runs

func (StubAutomationManager) SetJobEnabled

func (s StubAutomationManager) SetJobEnabled(ctx context.Context, id string, enabled bool) (automationpkg.Job, error)

func (StubAutomationManager) SetTriggerEnabled

func (s StubAutomationManager) SetTriggerEnabled(
	ctx context.Context,
	id string,
	enabled bool,
) (automationpkg.Trigger, error)

func (StubAutomationManager) Status

func (StubAutomationManager) TriggerJob

func (StubAutomationManager) Triggers

func (StubAutomationManager) UpdateJob

func (StubAutomationManager) UpdateTrigger

type StubBridgeService

type StubBridgeService struct {
	CreateInstanceFn        func(context.Context, bridgepkg.CreateInstanceRequest) (*bridgepkg.BridgeInstance, error)
	GetInstanceFn           func(context.Context, string) (*bridgepkg.BridgeInstance, error)
	ListInstancesFn         func(context.Context) ([]bridgepkg.BridgeInstance, error)
	ListProvidersFn         func(context.Context) ([]bridgepkg.BridgeProvider, error)
	ListSecretBindingsFn    func(context.Context, string) ([]bridgepkg.BridgeSecretBinding, error)
	PutSecretBindingFn      func(context.Context, bridgepkg.BridgeSecretBinding, *string) error
	DeleteSecretBindingFn   func(context.Context, string, string) error
	UpdateInstanceFn        func(context.Context, bridgepkg.UpdateInstanceRequest) (*bridgepkg.BridgeInstance, error)
	UpdateInstanceStateFn   func(context.Context, bridgepkg.UpdateInstanceStateRequest) (*bridgepkg.BridgeInstance, error)
	BuildRoutingKeyFn       func(context.Context, bridgepkg.RoutingKey) (bridgepkg.RoutingKey, error)
	ResolveRouteFn          func(context.Context, bridgepkg.RoutingKey) (*bridgepkg.BridgeRoute, error)
	ResolveOrCreateRouteFn  func(context.Context, bridgepkg.BridgeRoute) (*bridgepkg.BridgeRoute, bool, error)
	UpsertRouteFn           func(context.Context, bridgepkg.BridgeRoute) (*bridgepkg.BridgeRoute, error)
	ListRoutesFn            func(context.Context, string) ([]bridgepkg.BridgeRoute, error)
	PutTaskSubscriptionFn   func(context.Context, bridgepkg.BridgeTaskSubscription) error
	GetTaskSubscriptionFn   func(context.Context, string) (bridgepkg.BridgeTaskSubscription, error)
	ListTaskSubscriptionsFn func(context.Context, bridgepkg.BridgeTaskSubscriptionQuery) (
		[]bridgepkg.BridgeTaskSubscription,
		error,
	)
	DeleteTaskSubscriptionFn func(context.Context, string) error
	GetCursorFn              func(context.Context, notifications.CursorKey) (notifications.Cursor, error)
	ResolveDeliveryTargetFn  func(
		context.Context,
		bridgepkg.ResolveDeliveryTargetRequest,
	) (*bridgepkg.DeliveryTarget, error)
	RefreshBridgeTargetsFn func(
		context.Context,
		string,
		[]bridgepkg.BridgeTargetSnapshot,
	) ([]bridgepkg.BridgeTarget, error)
	ListBridgeTargetsFn   func(context.Context, bridgepkg.BridgeTargetQuery) (bridgepkg.BridgeTargetsResult, error)
	ResolveBridgeTargetFn func(context.Context, string, string) (bridgepkg.ResolveBridgeTargetResult, error)
	StartInstanceFn       func(context.Context, string) (*bridgepkg.BridgeInstance, error)
	StopInstanceFn        func(context.Context, string) (*bridgepkg.BridgeInstance, error)
	RestartInstanceFn     func(context.Context, string) (*bridgepkg.BridgeInstance, error)
}

func (StubBridgeService) BuildRoutingKey

func (s StubBridgeService) BuildRoutingKey(
	ctx context.Context,
	key bridgepkg.RoutingKey,
) (bridgepkg.RoutingKey, error)

func (StubBridgeService) CreateInstance

func (StubBridgeService) DeleteBridgeTaskSubscription

func (s StubBridgeService) DeleteBridgeTaskSubscription(ctx context.Context, subscriptionID string) error

func (StubBridgeService) DeleteSecretBinding

func (s StubBridgeService) DeleteSecretBinding(ctx context.Context, bridgeInstanceID string, bindingName string) error

func (StubBridgeService) GetBridgeTaskSubscription

func (s StubBridgeService) GetBridgeTaskSubscription(
	ctx context.Context,
	subscriptionID string,
) (bridgepkg.BridgeTaskSubscription, error)

func (StubBridgeService) GetCursor

func (StubBridgeService) GetInstance

func (StubBridgeService) ListBridgeTargets

func (StubBridgeService) ListBridgeTaskSubscriptions

func (StubBridgeService) ListInstances

func (s StubBridgeService) ListInstances(ctx context.Context) ([]bridgepkg.BridgeInstance, error)

func (StubBridgeService) ListProviders

func (s StubBridgeService) ListProviders(ctx context.Context) ([]bridgepkg.BridgeProvider, error)

func (StubBridgeService) ListRoutes

func (s StubBridgeService) ListRoutes(ctx context.Context, bridgeInstanceID string) ([]bridgepkg.BridgeRoute, error)

func (StubBridgeService) ListSecretBindings

func (s StubBridgeService) ListSecretBindings(
	ctx context.Context,
	bridgeInstanceID string,
) ([]bridgepkg.BridgeSecretBinding, error)

func (StubBridgeService) PutBridgeTaskSubscription

func (s StubBridgeService) PutBridgeTaskSubscription(
	ctx context.Context,
	subscription bridgepkg.BridgeTaskSubscription,
) error

func (StubBridgeService) PutSecretBinding

func (s StubBridgeService) PutSecretBinding(
	ctx context.Context,
	binding bridgepkg.BridgeSecretBinding,
	secretValue *string,
) error

func (StubBridgeService) RefreshBridgeTargets

func (s StubBridgeService) RefreshBridgeTargets(
	ctx context.Context,
	bridgeID string,
	snapshots []bridgepkg.BridgeTargetSnapshot,
) ([]bridgepkg.BridgeTarget, error)

func (StubBridgeService) ResolveBridgeTarget

func (s StubBridgeService) ResolveBridgeTarget(
	ctx context.Context,
	bridgeID string,
	query string,
) (bridgepkg.ResolveBridgeTargetResult, error)

func (StubBridgeService) ResolveDeliveryTarget

func (StubBridgeService) ResolveOrCreateRoute

func (s StubBridgeService) ResolveOrCreateRoute(
	ctx context.Context,
	route bridgepkg.BridgeRoute,
) (*bridgepkg.BridgeRoute, bool, error)

func (StubBridgeService) ResolveRoute

func (StubBridgeService) RestartInstance

func (s StubBridgeService) RestartInstance(ctx context.Context, id string) (*bridgepkg.BridgeInstance, error)

func (StubBridgeService) StartInstance

func (s StubBridgeService) StartInstance(ctx context.Context, id string) (*bridgepkg.BridgeInstance, error)

func (StubBridgeService) StopInstance

func (StubBridgeService) UpdateInstance

func (StubBridgeService) UpdateInstanceState

func (StubBridgeService) UpsertRoute

type StubNetworkService

type StubNetworkService struct {
	SendFn         func(context.Context, network.SendRequest) (string, error)
	ListPeersFn    func(context.Context, string, string) ([]network.PeerInfo, error)
	ListChannelsFn func(context.Context, string) ([]network.ChannelInfo, error)
	StatusFn       func(context.Context) (*network.Status, error)
	InboxFn        func(context.Context, string) ([]network.Envelope, error)
	WaitInboxFn    func(context.Context, string, string) ([]network.Envelope, error)
}

func (StubNetworkService) Inbox

func (s StubNetworkService) Inbox(ctx context.Context, sessionID string) ([]network.Envelope, error)

func (StubNetworkService) ListChannels

func (s StubNetworkService) ListChannels(ctx context.Context, workspaceID string) ([]network.ChannelInfo, error)

func (StubNetworkService) ListPeers

func (s StubNetworkService) ListPeers(
	ctx context.Context,
	workspaceID string,
	channel string,
) ([]network.PeerInfo, error)

func (StubNetworkService) Send

func (StubNetworkService) Status

func (StubNetworkService) WaitInbox

func (s StubNetworkService) WaitInbox(
	ctx context.Context,
	sessionID string,
	channel string,
) ([]network.Envelope, error)

type StubNetworkStore

type StubNetworkStore struct {
	ResolveDirectRoomFn        func(context.Context, store.NetworkDirectRoomEntry) (store.NetworkDirectRoomSummary, error)
	WriteConversationMessageFn func(
		context.Context,
		store.NetworkConversationMessage,
	) (store.NetworkConversationWriteResult, error)
	ListThreadsFn func(
		context.Context,
		store.NetworkChannelRef,
		store.NetworkThreadQuery,
	) ([]store.NetworkThreadSummary, error)
	GetThreadFn       func(context.Context, store.NetworkChannelRef, string) (store.NetworkThreadSummary, error)
	ListDirectRoomsFn func(
		context.Context,
		store.NetworkChannelRef,
		store.NetworkDirectRoomQuery,
	) ([]store.NetworkDirectRoomSummary, error)
	GetDirectRoomFn func(
		context.Context,
		store.NetworkChannelRef,
		string,
	) (store.NetworkDirectRoomSummary, error)
	ListConversationMessagesFn func(
		context.Context,
		store.NetworkConversationRef,
		store.NetworkConversationMessageQuery,
	) ([]store.NetworkConversationMessage, error)
	GetWorkFn              func(context.Context, string, string) (store.NetworkWorkEntry, error)
	GetNetworkChannelFn    func(context.Context, store.NetworkChannelRef) (store.NetworkChannelEntry, error)
	ListNetworkChannelsFn  func(context.Context, store.NetworkChannelQuery) ([]store.NetworkChannelEntry, error)
	WriteNetworkChannelFn  func(context.Context, store.NetworkChannelEntry) error
	DeleteNetworkChannelFn func(context.Context, store.NetworkChannelRef) error
	ListNetworkAuditFn     func(context.Context, store.NetworkAuditQuery) ([]store.NetworkAuditEntry, error)
	ListNetworkMessagesFn  func(context.Context, store.NetworkMessageQuery) ([]store.NetworkMessageEntry, error)
}

func (StubNetworkStore) DeleteNetworkChannel

func (s StubNetworkStore) DeleteNetworkChannel(ctx context.Context, ref store.NetworkChannelRef) error

func (StubNetworkStore) GetDirectRoom

func (StubNetworkStore) GetNetworkChannel

func (StubNetworkStore) GetThread

func (StubNetworkStore) GetWork

func (s StubNetworkStore) GetWork(
	ctx context.Context,
	workspaceID string,
	workID string,
) (store.NetworkWorkEntry, error)

func (StubNetworkStore) ListDirectRooms

func (StubNetworkStore) ListNetworkAudit

func (s StubNetworkStore) ListNetworkAudit(
	ctx context.Context,
	query store.NetworkAuditQuery,
) ([]store.NetworkAuditEntry, error)

func (StubNetworkStore) ListNetworkChannels

func (s StubNetworkStore) ListNetworkChannels(
	ctx context.Context,
	query store.NetworkChannelQuery,
) ([]store.NetworkChannelEntry, error)

func (StubNetworkStore) ListNetworkMessages

func (s StubNetworkStore) ListNetworkMessages(
	ctx context.Context,
	query store.NetworkMessageQuery,
) ([]store.NetworkMessageEntry, error)

func (StubNetworkStore) ListThreads

func (StubNetworkStore) ResolveDirectRoom

func (StubNetworkStore) WriteConversationMessage

func (StubNetworkStore) WriteNetworkChannel

func (s StubNetworkStore) WriteNetworkChannel(
	ctx context.Context,
	entry store.NetworkChannelEntry,
) error

type StubObserver

type StubObserver struct {
	QueryEventsFn        func(context.Context, store.EventSummaryQuery) ([]store.EventSummary, error)
	QueryHookCatalogFn   func(context.Context, hookspkg.CatalogFilter) ([]hookspkg.CatalogEntry, error)
	QueryHookRunsFn      func(context.Context, store.HookRunQuery) ([]hookspkg.HookRunRecord, error)
	QueryHookEventsFn    func(context.Context, hookspkg.EventFilter) ([]hookspkg.EventDescriptor, error)
	QueryBridgeHealthFn  func(context.Context) ([]observe.BridgeInstanceHealth, error)
	HealthFn             func(context.Context) (observe.Health, error)
	QueryTaskDashboardFn func(context.Context, observe.TaskDashboardQuery) (observe.TaskDashboardView, error)
	QueryTaskInboxFn     func(
		context.Context,
		observe.TaskInboxQuery,
		taskpkg.ActorIdentity,
	) (observe.TaskInboxView, error)
}

func (StubObserver) Health

func (s StubObserver) Health(ctx context.Context) (observe.Health, error)

func (StubObserver) QueryBridgeHealth

func (s StubObserver) QueryBridgeHealth(ctx context.Context) ([]observe.BridgeInstanceHealth, error)

func (StubObserver) QueryEvents

func (s StubObserver) QueryEvents(ctx context.Context, query store.EventSummaryQuery) ([]store.EventSummary, error)

func (StubObserver) QueryHookCatalog

func (s StubObserver) QueryHookCatalog(
	ctx context.Context,
	filter hookspkg.CatalogFilter,
) ([]hookspkg.CatalogEntry, error)

func (StubObserver) QueryHookEvents

func (s StubObserver) QueryHookEvents(
	ctx context.Context,
	filter hookspkg.EventFilter,
) ([]hookspkg.EventDescriptor, error)

func (StubObserver) QueryHookRuns

func (s StubObserver) QueryHookRuns(ctx context.Context, query store.HookRunQuery) ([]hookspkg.HookRunRecord, error)

func (StubObserver) QueryTaskDashboard

func (s StubObserver) QueryTaskDashboard(
	ctx context.Context,
	query observe.TaskDashboardQuery,
) (observe.TaskDashboardView, error)

func (StubObserver) QueryTaskInbox

type StubResourceService

func (StubResourceService) Delete

func (s StubResourceService) Delete(
	ctx context.Context,
	kind resources.ResourceKind,
	id string,
	expectedVersion int64,
) error

func (StubResourceService) Get

func (StubResourceService) List

func (StubResourceService) Put

type StubSessionManager

type StubSessionManager struct {
	CreateFn        func(context.Context, session.CreateOpts) (*session.Session, error)
	ListFn          func() []*session.Info
	ListAllFn       func(context.Context) ([]*session.Info, error)
	ListSessionsFn  func(context.Context, store.SessionListQuery) ([]store.SessionInfo, error)
	StatusFn        func(context.Context, string) (*session.Info, error)
	EventsFn        func(context.Context, string, store.EventQuery) ([]store.SessionEvent, error)
	HistoryFn       func(context.Context, string, store.EventQuery) ([]store.TurnHistory, error)
	TranscriptFn    func(context.Context, string) ([]transcript.UIMessage, error)
	RepairFn        func(context.Context, session.RepairOpts) (*session.RepairResult, error)
	DeleteFn        func(context.Context, string) error
	StopFn          func(context.Context, string) error
	StopWithCauseFn func(context.Context, string, session.StopCause, string) error
	ResumeFn        func(context.Context, string) (*session.Session, error)
	AttachSessionFn func(context.Context, store.SessionAttachRequest) (store.SessionAttach, error)
	ClearFn         func(context.Context, string) (*session.Session, error)
	PromptFn        func(context.Context, string, string) (<-chan acp.AgentEvent, error)
	SendPromptFn    func(context.Context, string, session.SendPromptOpts) (session.SendPromptResult, error)
	InterruptFn     func(context.Context, string) (session.SendPromptResult, error)
	SteerFn         func(context.Context, string, string) (session.SendPromptResult, error)
	CancelQueuedFn  func(context.Context, string, string) (session.SendPromptResult, error)
	CancelPromptFn  func(context.Context, string) error
	ApproveFn       func(context.Context, string, acp.ApproveRequest) error
	InputQueueFn    func(context.Context, string) (session.InputQueueSummary, error)
}

func (StubSessionManager) ApprovePermission

func (s StubSessionManager) ApprovePermission(ctx context.Context, id string, req acp.ApproveRequest) error

func (StubSessionManager) AttachSession

func (StubSessionManager) CancelPrompt

func (s StubSessionManager) CancelPrompt(ctx context.Context, id string) error

func (StubSessionManager) CancelQueuedPrompt

func (s StubSessionManager) CancelQueuedPrompt(
	ctx context.Context,
	id string,
	queueEntryID string,
) (session.SendPromptResult, error)

func (StubSessionManager) ClearConversation

func (s StubSessionManager) ClearConversation(
	ctx context.Context,
	id string,
) (*session.Session, error)

func (StubSessionManager) Create

func (StubSessionManager) Delete

func (s StubSessionManager) Delete(ctx context.Context, id string) error

func (StubSessionManager) Events

func (s StubSessionManager) Events(
	ctx context.Context,
	id string,
	query store.EventQuery,
) ([]store.SessionEvent, error)

func (StubSessionManager) History

func (s StubSessionManager) History(
	ctx context.Context,
	id string,
	query store.EventQuery,
) ([]store.TurnHistory, error)

func (StubSessionManager) InputQueueSummary

func (s StubSessionManager) InputQueueSummary(ctx context.Context, id string) (session.InputQueueSummary, error)

func (StubSessionManager) InterruptPrompt

func (s StubSessionManager) InterruptPrompt(ctx context.Context, id string) (session.SendPromptResult, error)

func (StubSessionManager) List

func (s StubSessionManager) List() []*session.Info

func (StubSessionManager) ListAll

func (s StubSessionManager) ListAll(ctx context.Context) ([]*session.Info, error)

func (StubSessionManager) ListSessions

func (s StubSessionManager) ListSessions(
	ctx context.Context,
	query store.SessionListQuery,
) ([]store.SessionInfo, error)

func (StubSessionManager) Prompt

func (s StubSessionManager) Prompt(ctx context.Context, id string, msg string) (<-chan acp.AgentEvent, error)

func (StubSessionManager) RepairSession

func (s StubSessionManager) RepairSession(
	ctx context.Context,
	opts session.RepairOpts,
) (*session.RepairResult, error)

func (StubSessionManager) Resume

func (StubSessionManager) SendPrompt

func (StubSessionManager) Status

func (s StubSessionManager) Status(ctx context.Context, id string) (*session.Info, error)

func (StubSessionManager) SteerPrompt

func (s StubSessionManager) SteerPrompt(
	ctx context.Context,
	id string,
	msg string,
) (session.SendPromptResult, error)

func (StubSessionManager) Stop

func (s StubSessionManager) Stop(ctx context.Context, id string) error

func (StubSessionManager) StopWithCause

func (s StubSessionManager) StopWithCause(
	ctx context.Context,
	id string,
	cause session.StopCause,
	detail string,
) error

func (StubSessionManager) Transcript

func (s StubSessionManager) Transcript(ctx context.Context, id string) ([]transcript.UIMessage, error)

type StubSkillsRegistry

type StubSkillsRegistry struct {
	GetFn          func(name string) (*skills.Skill, bool)
	ListFn         func() []*skills.Skill
	ForWorkspaceFn func(ctx context.Context, resolved *workspacepkg.ResolvedWorkspace) ([]*skills.Skill, error)
	ForAgentFn     func(
		ctx context.Context,
		resolved *workspacepkg.ResolvedWorkspace,
		agentName string,
	) ([]*skills.Skill, error)
	LoadContentFn        func(ctx context.Context, skill *skills.Skill) (string, error)
	LoadResourceFn       func(ctx context.Context, skill *skills.Skill, relativePath string) (string, error)
	SetEnabledFn         func(name string, resolved *workspacepkg.ResolvedWorkspace, enabled bool) error
	SetEnabledForAgentFn func(name string, resolved *workspacepkg.ResolvedWorkspace, agentName string, enabled bool) error
	RefreshGlobalFn      func(ctx context.Context) error
}

func (StubSkillsRegistry) ForAgent

func (s StubSkillsRegistry) ForAgent(
	ctx context.Context,
	resolved *workspacepkg.ResolvedWorkspace,
	agentName string,
) ([]*skills.Skill, error)

func (StubSkillsRegistry) ForWorkspace

func (s StubSkillsRegistry) ForWorkspace(
	ctx context.Context,
	resolved *workspacepkg.ResolvedWorkspace,
) ([]*skills.Skill, error)

func (StubSkillsRegistry) Get

func (s StubSkillsRegistry) Get(name string) (*skills.Skill, bool)

func (StubSkillsRegistry) List

func (s StubSkillsRegistry) List() []*skills.Skill

func (StubSkillsRegistry) LoadContent

func (s StubSkillsRegistry) LoadContent(ctx context.Context, skill *skills.Skill) (string, error)

func (StubSkillsRegistry) LoadResource

func (s StubSkillsRegistry) LoadResource(
	ctx context.Context,
	skill *skills.Skill,
	relativePath string,
) (string, error)

func (StubSkillsRegistry) RefreshGlobal

func (s StubSkillsRegistry) RefreshGlobal(ctx context.Context) error

func (StubSkillsRegistry) SetEnabled

func (s StubSkillsRegistry) SetEnabled(name string, resolved *workspacepkg.ResolvedWorkspace, enabled bool) error

func (StubSkillsRegistry) SetEnabledForAgent

func (s StubSkillsRegistry) SetEnabledForAgent(
	name string,
	resolved *workspacepkg.ResolvedWorkspace,
	agentName string,
	enabled bool,
) error

type StubTaskManager

type StubTaskManager struct {
	CreateTaskFn      func(context.Context, taskpkg.CreateTask, taskpkg.ActorContext) (*taskpkg.Task, error)
	CreateChildTaskFn func(
		context.Context,
		string,
		taskpkg.CreateTask,
		taskpkg.ActorContext,
	) (*taskpkg.Task, error)
	DeleteTaskFn  func(context.Context, string, taskpkg.ActorContext) error
	UpdateTaskFn  func(context.Context, string, taskpkg.Patch, taskpkg.ActorContext) (*taskpkg.Task, error)
	PublishTaskFn func(
		context.Context,
		string,
		taskpkg.ExecutionRequest,
		taskpkg.ActorContext,
	) (*taskpkg.Execution, error)
	StartTaskFn func(
		context.Context,
		string,
		taskpkg.ExecutionRequest,
		taskpkg.ActorContext,
	) (*taskpkg.Execution, error)
	ApproveTaskFn func(
		context.Context,
		string,
		taskpkg.ExecutionRequest,
		taskpkg.ActorContext,
	) (*taskpkg.Execution, error)
	RejectTaskFn func(context.Context, string, taskpkg.ActorContext) (*taskpkg.Task, error)
	CancelTaskFn func(
		context.Context,
		string,
		taskpkg.CancelTask,
		taskpkg.ActorContext,
	) (*taskpkg.Task, error)
	MarkTaskReadFn        func(context.Context, string, taskpkg.ActorContext) (taskpkg.TriageState, error)
	ArchiveTaskFn         func(context.Context, string, taskpkg.ActorContext) (taskpkg.TriageState, error)
	DismissTaskFn         func(context.Context, string, taskpkg.ActorContext) (taskpkg.TriageState, error)
	GetExecutionProfileFn func(
		context.Context,
		string,
		taskpkg.ActorContext,
	) (taskpkg.ExecutionProfile, error)
	SetExecutionProfileFn func(
		context.Context,
		string,
		*taskpkg.ExecutionProfile,
		taskpkg.ActorContext,
	) (taskpkg.ExecutionProfile, error)
	DeleteExecutionProfileFn func(context.Context, string, taskpkg.ActorContext) error
	RequestRunReviewFn       func(
		context.Context,
		taskpkg.RunReviewRequest,
		taskpkg.ActorContext,
	) (taskpkg.RunReview, bool, error)
	GetRunReviewFn    func(context.Context, string, taskpkg.ActorContext) (taskpkg.RunReview, error)
	RecordRunReviewFn func(
		context.Context,
		taskpkg.RecordRunReviewRequest,
		taskpkg.ActorContext,
	) (taskpkg.RunReviewResult, error)
	BindRunReviewSessionFn func(
		context.Context,
		taskpkg.BindRunReviewSessionRequest,
		taskpkg.ActorContext,
	) (taskpkg.RunReviewBinding, error)
	LookupRunReviewForSessionFn func(
		context.Context,
		string,
		taskpkg.ActorContext,
	) (taskpkg.RunReviewBinding, error)
	ListRunReviewsFn   func(context.Context, taskpkg.RunReviewQuery, taskpkg.ActorContext) ([]taskpkg.RunReview, error)
	AddDependencyFn    func(context.Context, taskpkg.AddDependency, taskpkg.ActorContext) error
	RemoveDependencyFn func(context.Context, string, string, taskpkg.ActorContext) error
	EnqueueRunFn       func(context.Context, taskpkg.EnqueueRun, taskpkg.ActorContext) (*taskpkg.Run, error)
	ClaimNextRunFn     func(
		context.Context,
		taskpkg.ClaimCriteria,
		taskpkg.ActorContext,
	) (*taskpkg.ClaimResult, error)
	ClaimRunFn             func(context.Context, string, taskpkg.ClaimRun, taskpkg.ActorContext) (*taskpkg.Run, error)
	StartRunFn             func(context.Context, string, taskpkg.StartRun, taskpkg.ActorContext) (*taskpkg.Run, error)
	AttachRunSessionFn     func(context.Context, string, string, taskpkg.ActorContext) (*taskpkg.Run, error)
	HeartbeatRunLeaseFn    func(context.Context, taskpkg.LeaseHeartbeat, taskpkg.ActorContext) (*taskpkg.Run, error)
	ReleaseRunLeaseFn      func(context.Context, taskpkg.LeaseRelease, taskpkg.ActorContext) (*taskpkg.Run, error)
	ForceReleaseRunFn      forceReleaseRunFunc
	ForceFailRunFn         forceFailRunFunc
	RetryRunFn             retryRunFunc
	RecoverRunFn           recoverRunFunc
	BulkForceReleaseRunsFn bulkForceRunFunc
	BulkForceFailRunsFn    bulkForceRunFunc
	PauseTaskFn            pauseTaskFunc
	ResumeTaskFn           resumeTaskFunc
	SchedulerStatusFn      func(context.Context, taskpkg.ActorContext) (taskpkg.SchedulerStatus, error)
	PauseSchedulerFn       func(
		context.Context,
		taskpkg.SchedulerPauseRequest,
		taskpkg.ActorContext,
	) (taskpkg.SchedulerStatus, error)
	ResumeSchedulerFn func(
		context.Context,
		taskpkg.SchedulerResumeRequest,
		taskpkg.ActorContext,
	) (taskpkg.SchedulerStatus, error)
	DrainSchedulerFn func(
		context.Context,
		taskpkg.SchedulerDrainRequest,
		taskpkg.ActorContext,
	) (taskpkg.SchedulerDrainResult, error)
	SchedulerBacklogFn func(
		context.Context,
		taskpkg.SchedulerBacklogQuery,
		taskpkg.ActorContext,
	) (taskpkg.SchedulerBacklog, error)
	CompleteRunLeaseFn          func(context.Context, taskpkg.LeaseCompletion, taskpkg.ActorContext) (*taskpkg.Run, error)
	FailRunLeaseFn              func(context.Context, taskpkg.LeaseFailure, taskpkg.ActorContext) (*taskpkg.Run, error)
	LookupActiveRunForSessionFn func(
		context.Context,
		string,
		string,
	) (taskpkg.AutonomyLeaseHandle, error)
	CompleteRunFn             func(context.Context, string, taskpkg.RunResult, taskpkg.ActorContext) (*taskpkg.Run, error)
	FailRunFn                 func(context.Context, string, taskpkg.RunFailure, taskpkg.ActorContext) (*taskpkg.Run, error)
	CancelRunFn               func(context.Context, string, taskpkg.CancelRun, taskpkg.ActorContext) (*taskpkg.Run, error)
	RecoverExpiredRunLeasesFn func(
		context.Context,
		taskpkg.ExpiredLeaseRecovery,
		taskpkg.ActorContext,
	) ([]taskpkg.ExpiredLeaseRecoveryResult, error)
	GetTaskFn      func(context.Context, string, taskpkg.ActorContext) (*taskpkg.View, error)
	InspectTaskFn  func(context.Context, string, taskpkg.ActorContext) (*taskpkg.InspectView, error)
	InspectRunFn   func(context.Context, string, taskpkg.ActorContext) (*taskpkg.InspectView, error)
	ListTaskRunsFn func(context.Context, string, taskpkg.RunQuery, taskpkg.ActorContext) ([]taskpkg.Run, error)
	ListTasksFn    func(context.Context, taskpkg.Query, taskpkg.ActorContext) ([]taskpkg.Summary, error)
	TimelineFn     func(
		context.Context,
		string,
		taskpkg.TimelineQuery,
		taskpkg.ActorContext,
	) ([]taskpkg.TimelineItem, error)
	StreamFn func(
		context.Context,
		string,
		taskpkg.StreamQuery,
		taskpkg.ActorContext,
	) (<-chan taskpkg.StreamEvent, error)
	TreeFn      func(context.Context, string, taskpkg.ActorContext) (*taskpkg.TreeView, error)
	RunDetailFn func(context.Context, string, taskpkg.ActorContext) (*taskpkg.RunDetailView, error)
}

func (StubTaskManager) AddDependency

func (s StubTaskManager) AddDependency(
	ctx context.Context,
	spec taskpkg.AddDependency,
	actor taskpkg.ActorContext,
) error

func (StubTaskManager) ApproveTask

func (StubTaskManager) ArchiveTask

func (s StubTaskManager) ArchiveTask(
	ctx context.Context,
	id string,
	actor taskpkg.ActorContext,
) (taskpkg.TriageState, error)

func (StubTaskManager) AttachRunSession

func (s StubTaskManager) AttachRunSession(
	ctx context.Context,
	runID string,
	sessionID string,
	actor taskpkg.ActorContext,
) (*taskpkg.Run, error)

func (StubTaskManager) BindRunReviewSession

func (StubTaskManager) BulkForceFailRuns

func (StubTaskManager) BulkForceReleaseRuns

func (StubTaskManager) CancelRun

func (s StubTaskManager) CancelRun(
	ctx context.Context,
	runID string,
	req taskpkg.CancelRun,
	actor taskpkg.ActorContext,
) (*taskpkg.Run, error)

func (StubTaskManager) CancelTask

func (s StubTaskManager) CancelTask(
	ctx context.Context,
	id string,
	req taskpkg.CancelTask,
	actor taskpkg.ActorContext,
) (*taskpkg.Task, error)

func (StubTaskManager) ClaimNextRun

func (s StubTaskManager) ClaimNextRun(
	ctx context.Context,
	criteria taskpkg.ClaimCriteria,
	actor taskpkg.ActorContext,
) (*taskpkg.ClaimResult, error)

func (StubTaskManager) ClaimRun

func (s StubTaskManager) ClaimRun(
	ctx context.Context,
	runID string,
	claim taskpkg.ClaimRun,
	actor taskpkg.ActorContext,
) (*taskpkg.Run, error)

func (StubTaskManager) CompleteRun

func (s StubTaskManager) CompleteRun(
	ctx context.Context,
	runID string,
	result taskpkg.RunResult,
	actor taskpkg.ActorContext,
) (*taskpkg.Run, error)

func (StubTaskManager) CompleteRunLease

func (s StubTaskManager) CompleteRunLease(
	ctx context.Context,
	completion taskpkg.LeaseCompletion,
	actor taskpkg.ActorContext,
) (*taskpkg.Run, error)

func (StubTaskManager) CreateChildTask

func (s StubTaskManager) CreateChildTask(
	ctx context.Context,
	parentTaskID string,
	spec taskpkg.CreateTask,
	actor taskpkg.ActorContext,
) (*taskpkg.Task, error)

func (StubTaskManager) CreateTask

func (s StubTaskManager) CreateTask(
	ctx context.Context,
	spec taskpkg.CreateTask,
	actor taskpkg.ActorContext,
) (*taskpkg.Task, error)

func (StubTaskManager) DeleteExecutionProfile

func (s StubTaskManager) DeleteExecutionProfile(
	ctx context.Context,
	taskID string,
	actor taskpkg.ActorContext,
) error

func (StubTaskManager) DeleteTask

func (s StubTaskManager) DeleteTask(
	ctx context.Context,
	id string,
	actor taskpkg.ActorContext,
) error

func (StubTaskManager) DismissTask

func (s StubTaskManager) DismissTask(
	ctx context.Context,
	id string,
	actor taskpkg.ActorContext,
) (taskpkg.TriageState, error)

func (StubTaskManager) DrainScheduler

func (StubTaskManager) EnqueueRun

func (s StubTaskManager) EnqueueRun(
	ctx context.Context,
	spec taskpkg.EnqueueRun,
	actor taskpkg.ActorContext,
) (*taskpkg.Run, error)

func (StubTaskManager) FailRun

func (s StubTaskManager) FailRun(
	ctx context.Context,
	runID string,
	failure taskpkg.RunFailure,
	actor taskpkg.ActorContext,
) (*taskpkg.Run, error)

func (StubTaskManager) FailRunLease

func (s StubTaskManager) FailRunLease(
	ctx context.Context,
	failure taskpkg.LeaseFailure,
	actor taskpkg.ActorContext,
) (*taskpkg.Run, error)

func (StubTaskManager) ForceFailRun

func (s StubTaskManager) ForceFailRun(
	ctx context.Context,
	runID string,
	failure taskpkg.ForceFailRun,
	actor taskpkg.ActorContext,
) (*taskpkg.Run, error)

func (StubTaskManager) ForceReleaseRun

func (s StubTaskManager) ForceReleaseRun(
	ctx context.Context,
	runID string,
	release taskpkg.ForceReleaseRun,
	actor taskpkg.ActorContext,
) (*taskpkg.Run, error)

func (StubTaskManager) GetExecutionProfile

func (s StubTaskManager) GetExecutionProfile(
	ctx context.Context,
	taskID string,
	actor taskpkg.ActorContext,
) (taskpkg.ExecutionProfile, error)

func (StubTaskManager) GetRunReview

func (s StubTaskManager) GetRunReview(
	ctx context.Context,
	reviewID string,
	actor taskpkg.ActorContext,
) (taskpkg.RunReview, error)

func (StubTaskManager) GetTask

func (s StubTaskManager) GetTask(
	ctx context.Context,
	id string,
	actor taskpkg.ActorContext,
) (*taskpkg.View, error)

func (StubTaskManager) HeartbeatRunLease

func (s StubTaskManager) HeartbeatRunLease(
	ctx context.Context,
	heartbeat taskpkg.LeaseHeartbeat,
	actor taskpkg.ActorContext,
) (*taskpkg.Run, error)

func (StubTaskManager) InspectRun

func (s StubTaskManager) InspectRun(
	ctx context.Context,
	runID string,
	actor taskpkg.ActorContext,
) (*taskpkg.InspectView, error)

func (StubTaskManager) InspectTask

func (s StubTaskManager) InspectTask(
	ctx context.Context,
	taskID string,
	actor taskpkg.ActorContext,
) (*taskpkg.InspectView, error)

func (StubTaskManager) ListRunReviews

func (s StubTaskManager) ListRunReviews(
	ctx context.Context,
	query taskpkg.RunReviewQuery,
	actor taskpkg.ActorContext,
) ([]taskpkg.RunReview, error)

func (StubTaskManager) ListTaskRuns

func (s StubTaskManager) ListTaskRuns(
	ctx context.Context,
	taskID string,
	query taskpkg.RunQuery,
	actor taskpkg.ActorContext,
) ([]taskpkg.Run, error)

func (StubTaskManager) ListTasks

func (s StubTaskManager) ListTasks(
	ctx context.Context,
	query taskpkg.Query,
	actor taskpkg.ActorContext,
) ([]taskpkg.Summary, error)

func (StubTaskManager) LookupActiveRunForSession

func (s StubTaskManager) LookupActiveRunForSession(
	ctx context.Context,
	sessionID string,
	runID string,
) (taskpkg.AutonomyLeaseHandle, error)

func (StubTaskManager) LookupRunReviewForSession

func (s StubTaskManager) LookupRunReviewForSession(
	ctx context.Context,
	sessionID string,
	actor taskpkg.ActorContext,
) (taskpkg.RunReviewBinding, error)

func (StubTaskManager) MarkTaskRead

func (s StubTaskManager) MarkTaskRead(
	ctx context.Context,
	id string,
	actor taskpkg.ActorContext,
) (taskpkg.TriageState, error)

func (StubTaskManager) PauseScheduler

func (StubTaskManager) PauseTask

func (s StubTaskManager) PauseTask(
	ctx context.Context,
	taskID string,
	req taskpkg.PauseTaskRequest,
	actor taskpkg.ActorContext,
) (*taskpkg.Task, error)

func (StubTaskManager) PublishTask

func (StubTaskManager) RecordRunReview

func (StubTaskManager) RecoverExpiredRunLeases

func (StubTaskManager) RecoverRun added in v0.0.5

func (StubTaskManager) RejectTask

func (s StubTaskManager) RejectTask(
	ctx context.Context,
	id string,
	actor taskpkg.ActorContext,
) (*taskpkg.Task, error)

func (StubTaskManager) ReleaseRunLease

func (s StubTaskManager) ReleaseRunLease(
	ctx context.Context,
	release taskpkg.LeaseRelease,
	actor taskpkg.ActorContext,
) (*taskpkg.Run, error)

func (StubTaskManager) RemoveDependency

func (s StubTaskManager) RemoveDependency(
	ctx context.Context,
	taskID string,
	dependsOnID string,
	actor taskpkg.ActorContext,
) error

func (StubTaskManager) RequestRunReview

func (StubTaskManager) ResumeScheduler

func (StubTaskManager) ResumeTask

func (s StubTaskManager) ResumeTask(
	ctx context.Context,
	taskID string,
	req taskpkg.ResumeTaskRequest,
	actor taskpkg.ActorContext,
) (*taskpkg.Task, error)

func (StubTaskManager) RetryRun

func (StubTaskManager) RunDetail

func (s StubTaskManager) RunDetail(
	ctx context.Context,
	runID string,
	actor taskpkg.ActorContext,
) (*taskpkg.RunDetailView, error)

func (StubTaskManager) SchedulerBacklog

func (StubTaskManager) SchedulerStatus

func (s StubTaskManager) SchedulerStatus(
	ctx context.Context,
	actor taskpkg.ActorContext,
) (taskpkg.SchedulerStatus, error)

func (StubTaskManager) SetExecutionProfile

func (s StubTaskManager) SetExecutionProfile(
	ctx context.Context,
	taskID string,
	profile *taskpkg.ExecutionProfile,
	actor taskpkg.ActorContext,
) (taskpkg.ExecutionProfile, error)

func (StubTaskManager) StartRun

func (s StubTaskManager) StartRun(
	ctx context.Context,
	runID string,
	req taskpkg.StartRun,
	actor taskpkg.ActorContext,
) (*taskpkg.Run, error)

func (StubTaskManager) StartTask

func (StubTaskManager) Stream

func (s StubTaskManager) Stream(
	ctx context.Context,
	taskID string,
	query taskpkg.StreamQuery,
	actor taskpkg.ActorContext,
) (<-chan taskpkg.StreamEvent, error)

func (StubTaskManager) Timeline

func (StubTaskManager) Tree

func (s StubTaskManager) Tree(
	ctx context.Context,
	taskID string,
	actor taskpkg.ActorContext,
) (*taskpkg.TreeView, error)

func (StubTaskManager) UpdateTask

func (s StubTaskManager) UpdateTask(
	ctx context.Context,
	id string,
	patch taskpkg.Patch,
	actor taskpkg.ActorContext,
) (*taskpkg.Task, error)

type StubWorkspaceService

func (StubWorkspaceService) Get

func (StubWorkspaceService) List

func (StubWorkspaceService) Register

func (StubWorkspaceService) Resolve

func (StubWorkspaceService) ResolveOrRegister

func (s StubWorkspaceService) ResolveOrRegister(
	ctx context.Context,
	path string,
) (workspacepkg.ResolvedWorkspace, error)

func (StubWorkspaceService) Unregister

func (s StubWorkspaceService) Unregister(ctx context.Context, id string) error

func (StubWorkspaceService) Update

Jump to

Keyboard shortcuts

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