Documentation
¶
Index ¶
- Constants
- Variables
- func AbortSetup(input json.RawMessage) (string, error)
- func FetchManifestFromURL(url string) (string, error)
- func GetManifestURLForProjectType(projectType string) string
- func ResetPhaseProgress(workDir string) func(json.RawMessage) (string, error)
- type AbortError
- type ClientInfo
- type CloudLoginResult
- type CloudTools
- func (ct *CloudTools) CheckApiKeyExists(input json.RawMessage) (string, error)
- func (ct *CloudTools) CheckAuth(input json.RawMessage) (string, error)
- func (ct *CloudTools) CreateApiKey(input json.RawMessage) (string, error)
- func (ct *CloudTools) CreateObservableService(input json.RawMessage) (string, error)
- func (ct *CloudTools) DetectGitRepo(input json.RawMessage) (string, error)
- func (ct *CloudTools) GetClients(input json.RawMessage) (string, error)
- func (ct *CloudTools) GetCodeHostingAuthURL(input json.RawMessage) (string, error)
- func (ct *CloudTools) Login(input json.RawMessage) (string, error)
- func (ct *CloudTools) OpenBrowser(input json.RawMessage) (string, error)
- func (ct *CloudTools) SaveCloudConfig(input json.RawMessage) (string, error)
- func (ct *CloudTools) SelectClient(input json.RawMessage) (string, error)
- func (ct *CloudTools) UploadTraces(input json.RawMessage) (string, error)
- func (ct *CloudTools) VerifyRepoAccess(input json.RawMessage) (string, error)
- func (ct *CloudTools) WaitForAuth(input json.RawMessage) (string, error)
- func (ct *CloudTools) WaitForLogin(input json.RawMessage) (string, error)
- type FilesystemTools
- func (ft *FilesystemTools) Grep(input json.RawMessage) (string, error)
- func (ft *FilesystemTools) ListDirectory(input json.RawMessage) (string, error)
- func (ft *FilesystemTools) PatchFile(input json.RawMessage) (string, error)
- func (ft *FilesystemTools) ReadFile(input json.RawMessage) (string, error)
- func (ft *FilesystemTools) WriteFile(input json.RawMessage) (string, error)
- type HTTPTools
- type LoginDeviceCodeResult
- type ManagedProcess
- type ProcessManager
- type ProcessTools
- func (pt *ProcessTools) GetLogs(input json.RawMessage) (string, error)
- func (pt *ProcessTools) RunCommand(input json.RawMessage) (string, error)
- func (pt *ProcessTools) StartBackground(input json.RawMessage) (string, error)
- func (pt *ProcessTools) StopBackground(input json.RawMessage) (string, error)
- func (pt *ProcessTools) WaitForReady(input json.RawMessage) (string, error)
- type RingBuffer
- type TuskTools
- type UserTools
Constants ¶
const ( NodeSDKManifestURL = sdk.NodeSDKManifestURL PythonSDKManifestURL = sdk.PythonSDKManifestURL )
Variables ¶
var ErrSetupAborted = errors.New("setup aborted")
ErrSetupAborted is a sentinel error for checking abort status
Functions ¶
func AbortSetup ¶
func AbortSetup(input json.RawMessage) (string, error)
AbortSetup handles graceful exit when setup cannot proceed This is used when the agent detects an unsupported project type
func FetchManifestFromURL ¶
FetchManifestFromURL fetches an SDK manifest from a URL Returns the raw JSON string
func GetManifestURLForProjectType ¶ added in v0.1.34
GetManifestURLForProjectType returns the SDK manifest URL for a given project type. Returns empty string if no manifest URL is available for the project type.
func ResetPhaseProgress ¶ added in v0.1.46
func ResetPhaseProgress(workDir string) func(json.RawMessage) (string, error)
ResetPhaseProgress removes a specific phase from the progress file so it will run again on next setup. If no phase_name is provided, removes all cloud phases.
Types ¶
type AbortError ¶
AbortError wraps ErrSetupAborted with the reason and detected project type
func (*AbortError) Error ¶
func (e *AbortError) Error() string
func (*AbortError) Is ¶
func (e *AbortError) Is(target error) bool
type ClientInfo ¶ added in v0.1.35
ClientInfo represents a Tusk client/organization
type CloudLoginResult ¶ added in v0.1.35
type CloudLoginResult struct {
Success bool `json:"success"`
Email string `json:"email"`
UserId string `json:"user_id"`
Error string `json:"error,omitempty"`
NeedsLogin bool `json:"needs_login"`
}
CloudLoginResult contains the result of a cloud login operation
type CloudTools ¶ added in v0.1.35
type CloudTools struct {
// contains filtered or unexported fields
}
CloudTools provides cloud-related operations for the agent
func NewCloudTools ¶ added in v0.1.35
func NewCloudTools() *CloudTools
NewCloudTools creates a new CloudTools instance
func (*CloudTools) CheckApiKeyExists ¶ added in v0.1.35
func (ct *CloudTools) CheckApiKeyExists(input json.RawMessage) (string, error)
CheckApiKeyExists checks if the user already has an API key configured
func (*CloudTools) CheckAuth ¶ added in v0.1.35
func (ct *CloudTools) CheckAuth(input json.RawMessage) (string, error)
CheckAuth checks if the user is already authenticated
func (*CloudTools) CreateApiKey ¶ added in v0.1.35
func (ct *CloudTools) CreateApiKey(input json.RawMessage) (string, error)
CreateApiKey creates a new API key
func (*CloudTools) CreateObservableService ¶ added in v0.1.35
func (ct *CloudTools) CreateObservableService(input json.RawMessage) (string, error)
CreateObservableService creates a new observable service in Tusk Cloud
func (*CloudTools) DetectGitRepo ¶ added in v0.1.35
func (ct *CloudTools) DetectGitRepo(input json.RawMessage) (string, error)
DetectGitRepo detects the git repository information
func (*CloudTools) GetClients ¶ added in v0.1.35
func (ct *CloudTools) GetClients(input json.RawMessage) (string, error)
GetClients returns the list of organizations/clients the user belongs to
func (*CloudTools) GetCodeHostingAuthURL ¶ added in v0.1.35
func (ct *CloudTools) GetCodeHostingAuthURL(input json.RawMessage) (string, error)
GetCodeHostingAuthURL returns the URL for GitHub/GitLab app installation
func (*CloudTools) Login ¶ added in v0.1.35
func (ct *CloudTools) Login(input json.RawMessage) (string, error)
Login initiates the device code login flow - returns device code info for agent to display The agent should then call WaitForLogin to complete the authentication
func (*CloudTools) OpenBrowser ¶ added in v0.1.35
func (ct *CloudTools) OpenBrowser(input json.RawMessage) (string, error)
OpenBrowser opens a URL in the default browser
func (*CloudTools) SaveCloudConfig ¶ added in v0.1.35
func (ct *CloudTools) SaveCloudConfig(input json.RawMessage) (string, error)
SaveCloudConfig saves the cloud configuration to .tusk/config.yaml
func (*CloudTools) SelectClient ¶ added in v0.1.35
func (ct *CloudTools) SelectClient(input json.RawMessage) (string, error)
SelectClient saves the selected client to CLI config
func (*CloudTools) UploadTraces ¶ added in v0.1.46
func (ct *CloudTools) UploadTraces(input json.RawMessage) (string, error)
UploadTraces uploads local traces to Tusk Cloud
func (*CloudTools) VerifyRepoAccess ¶ added in v0.1.35
func (ct *CloudTools) VerifyRepoAccess(input json.RawMessage) (string, error)
VerifyRepoAccess verifies that Tusk has access to the repository
func (*CloudTools) WaitForAuth ¶ added in v0.1.35
func (ct *CloudTools) WaitForAuth(input json.RawMessage) (string, error)
WaitForAuth waits for authentication to complete with polling This is called after opening the browser for device code flow
func (*CloudTools) WaitForLogin ¶ added in v0.1.35
func (ct *CloudTools) WaitForLogin(input json.RawMessage) (string, error)
WaitForLogin polls for the device code authentication to complete
type FilesystemTools ¶
type FilesystemTools struct {
// contains filtered or unexported fields
}
FilesystemTools provides file system operations
func NewFilesystemTools ¶
func NewFilesystemTools(workDir string) *FilesystemTools
NewFilesystemTools creates a new FilesystemTools instance
func (*FilesystemTools) Grep ¶
func (ft *FilesystemTools) Grep(input json.RawMessage) (string, error)
Grep searches for a pattern in files
func (*FilesystemTools) ListDirectory ¶
func (ft *FilesystemTools) ListDirectory(input json.RawMessage) (string, error)
ListDirectory lists files and directories in a path
func (*FilesystemTools) PatchFile ¶
func (ft *FilesystemTools) PatchFile(input json.RawMessage) (string, error)
PatchFile applies a targeted edit to a file
func (*FilesystemTools) ReadFile ¶
func (ft *FilesystemTools) ReadFile(input json.RawMessage) (string, error)
ReadFile reads the contents of a file
func (*FilesystemTools) WriteFile ¶
func (ft *FilesystemTools) WriteFile(input json.RawMessage) (string, error)
WriteFile writes content to a file
type HTTPTools ¶
type HTTPTools struct {
// contains filtered or unexported fields
}
HTTPTools provides HTTP request operations
type LoginDeviceCodeResult ¶ added in v0.1.35
type LoginDeviceCodeResult struct {
DeviceCode string `json:"device_code"`
UserCode string `json:"user_code"`
VerificationURL string `json:"verification_url"`
ExpiresIn int `json:"expires_in"`
BrowserOpened bool `json:"browser_opened"`
}
LoginDeviceCodeResult contains the device code info for display
type ManagedProcess ¶
type ManagedProcess struct {
// contains filtered or unexported fields
}
ManagedProcess represents a background process
type ProcessManager ¶
type ProcessManager struct {
// contains filtered or unexported fields
}
ProcessManager manages background processes
func NewProcessManager ¶
func NewProcessManager(workDir string) *ProcessManager
NewProcessManager creates a new ProcessManager. Agent commands are not sandboxed - we rely on validateCommandSafety() for protection. Replay sandboxing (to detect uninstrumented packages) is handled by runner.createReplayFenceConfig().
func (*ProcessManager) StopAll ¶
func (pm *ProcessManager) StopAll()
StopAll stops all managed processes and cleans up resources
type ProcessTools ¶
type ProcessTools struct {
// contains filtered or unexported fields
}
ProcessTools provides process management operations
func NewProcessTools ¶
func NewProcessTools(pm *ProcessManager, workDir string) *ProcessTools
NewProcessTools creates a new ProcessTools instance
func (*ProcessTools) GetLogs ¶
func (pt *ProcessTools) GetLogs(input json.RawMessage) (string, error)
GetLogs returns recent logs from a background process
func (*ProcessTools) RunCommand ¶
func (pt *ProcessTools) RunCommand(input json.RawMessage) (string, error)
RunCommand executes a command and waits for completion
func (*ProcessTools) StartBackground ¶
func (pt *ProcessTools) StartBackground(input json.RawMessage) (string, error)
StartBackground starts a process in the background. Note: This is NOT sandboxed because it's used for: - "Confirm App Starts" phase (needs real DB connections) - "Record" mode (needs real outbound calls to capture behavior) Replay mode sandboxing is handled by the runner package, not here.
func (*ProcessTools) StopBackground ¶
func (pt *ProcessTools) StopBackground(input json.RawMessage) (string, error)
StopBackground stops a background process
func (*ProcessTools) WaitForReady ¶
func (pt *ProcessTools) WaitForReady(input json.RawMessage) (string, error)
WaitForReady polls a URL until it responds successfully
type RingBuffer ¶
type RingBuffer struct {
// contains filtered or unexported fields
}
RingBuffer keeps the last N lines
func NewRingBuffer ¶
func NewRingBuffer(size int) *RingBuffer
NewRingBuffer creates a new ring buffer
func (*RingBuffer) Lines ¶
func (rb *RingBuffer) Lines(n int) []string
Lines returns the last n lines
type TuskTools ¶
type TuskTools struct {
// contains filtered or unexported fields
}
TuskTools provides Tusk CLI operations using internal runner package
func NewTuskTools ¶
NewTuskTools creates a new TuskTools instance
func (*TuskTools) List ¶
func (tt *TuskTools) List(input json.RawMessage) (string, error)
List loads and lists traces from the .tusk/traces directory
func (*TuskTools) Run ¶
func (tt *TuskTools) Run(input json.RawMessage) (string, error)
Run runs tests using the internal runner
func (*TuskTools) RunValidation ¶ added in v0.1.46
func (tt *TuskTools) RunValidation(input json.RawMessage) (string, error)
RunValidation runs 'tusk run --cloud --validate-suite --print' and returns the results
func (*TuskTools) ValidateConfig ¶ added in v0.1.44
func (tt *TuskTools) ValidateConfig(input json.RawMessage) (string, error)
ValidateConfig validates the .tusk/config.yaml file and returns detailed results. This should be called after creating or modifying the config to catch errors early.