harness

package
v0.2.2 Latest Latest
Warning

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

Go to latest
Published: Apr 3, 2026 License: MIT Imports: 23 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AssertEventSequence

func AssertEventSequence(t *testing.T, events []agent.AgentEvent, want ...agent.AgentEventType)

func CollectRemoteEventsUntilEOF

func CollectRemoteEventsUntilEOF(recv api.AgentEventReceiver) ([]agent.AgentEvent, error)

func DebugEvents

func DebugEvents(events []agent.AgentEvent) string

Types

type MemorySandboxService

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

func NewMemorySandboxService

func NewMemorySandboxService() *MemorySandboxService

func (*MemorySandboxService) CreateSession

func (*MemorySandboxService) CreateSnapshot

func (*MemorySandboxService) DestroySession

func (*MemorySandboxService) ExecuteCalls

func (m *MemorySandboxService) ExecuteCalls() int64

func (*MemorySandboxService) ExecuteTool

func (*MemorySandboxService) ExecuteToolStream

func (*MemorySandboxService) GetProcessStatus

func (*MemorySandboxService) GetSession

func (*MemorySandboxService) HealthCheck

func (*MemorySandboxService) KillProcess

func (*MemorySandboxService) LaunchProcess

func (*MemorySandboxService) ListSnapshots

func (*MemorySandboxService) PauseSession

func (*MemorySandboxService) ReadSessionFile

func (m *MemorySandboxService) ReadSessionFile(sessionID, filePath string) (string, bool)

func (*MemorySandboxService) ResumeSession

func (*MemorySandboxService) RollbackSession

func (*MemorySandboxService) Routes

func (m *MemorySandboxService) Routes() []ToolRoute

func (*MemorySandboxService) SeedBaseSnapshot

func (m *MemorySandboxService) SeedBaseSnapshot(name string, files map[string]string)

func (*MemorySandboxService) TurnComplete

type RemoteEnv

type RemoteEnv struct {
	Service      *MemorySandboxService
	Lifecycle    *SessionLifecycle
	Client       *client.SandboxClient
	EventServer  *server.AgentEventServer
	Agent        *agent.Agent
	Provider     *testutil.ScriptedProvider
	SessionID    string
	BaseSnapshot string
	// contains filtered or unexported fields
}

func NewRemoteEnv

func NewRemoteEnv(t *testing.T, script []testutil.ScriptEntry, baseFiles map[string]string) *RemoteEnv

func (*RemoteEnv) Events

func (e *RemoteEnv) Events() []agent.AgentEvent

func (*RemoteEnv) PromptAndWait

func (e *RemoteEnv) PromptAndWait(t *testing.T, prompt string, timeout time.Duration)

func (*RemoteEnv) Stop

func (e *RemoteEnv) Stop(t *testing.T)

func (*RemoteEnv) SubscribeRemoteEvents

func (e *RemoteEnv) SubscribeRemoteEvents(t *testing.T) api.AgentEventReceiver

type SessionLifecycle

type SessionLifecycle struct {
	Service api.SandboxService
}

func NewSessionLifecycle

func NewSessionLifecycle(service api.SandboxService) *SessionLifecycle

func (*SessionLifecycle) Create

func (l *SessionLifecycle) Create(ctx context.Context, baseSnapshot, sessionID string) (*api.Session, error)

func (*SessionLifecycle) Destroy

func (l *SessionLifecycle) Destroy(ctx context.Context, sessionID string) error

func (*SessionLifecycle) Get

func (l *SessionLifecycle) Get(ctx context.Context, sessionID string) (*api.Session, error)

func (*SessionLifecycle) Pause

func (l *SessionLifecycle) Pause(ctx context.Context, sessionID string) error

func (*SessionLifecycle) Resume

func (l *SessionLifecycle) Resume(ctx context.Context, sessionID string) error

type SnapshotAssertion

type SnapshotAssertion struct{}

func (SnapshotAssertion) AssertFileContent

func (SnapshotAssertion) AssertFileContent(t *testing.T, svc *MemorySandboxService, sessionID, filePath string, wantContains string)

func (SnapshotAssertion) AssertMonotonicIDs

func (SnapshotAssertion) AssertMonotonicIDs(t *testing.T, snaps []api.Snapshot)

type ToolRoute

type ToolRoute struct {
	SessionID  string
	ToolCallID string
	ToolName   string
	Tier       int
	SnapshotID string
}

Jump to

Keyboard shortcuts

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