mirror of
https://github.com/coder/coder.git
synced 2026-06-02 20:48:20 +00:00
6b0bb02e5d
Fixes three classes of edit_files bugs and adds structured per-file
diff output for tool callers:
- New IncludeDiff flag on FileEditRequest; when set, the agent
returns FileEditResponse.Files[]{Path, Diff} with unified diffs
computed via go-udiff v0.4.1 Lines + ToUnified (not Unified,
which calls log.Fatalf on internal error).
- Fuzzy match comparators split each line into leading whitespace,
body, trailing whitespace, and ending. The splice substitutes at
each position: on agreement between search and replace the file's
bytes win; on disagreement the replacement's bytes are spliced
verbatim. Carve-outs for empty-body lines, multi-line EOF splices,
and level-aware indent translation for inserted lines.
- Indent-unit detection (GCD for spaces, tab-priority) lets a 4sp
LLM search insert correctly into tab or 2sp files. Falls back to
the previous cLead-inheritance path when units can't be detected
cleanly.
- Empty search is rejected with "search string must not be empty".
- Duplicate file paths in one request are rejected; symlink aliases
resolved via api.resolvePath before the dedup check.
- Frontend EditFilesRenderer consumes the structured files array by
explicit path (no label munging) with per-file synthetic fallback
for older agents or mismatched paths. On error, no diff is
rendered so the synthetic fallback doesn't misrepresent a
rejected edit as applied.
Breaking change: AgentConn.EditFiles changes from (ctx, req) error
to (ctx, req) (FileEditResponse, error) in codersdk/workspacesdk.
Source-breaking for external Go consumers; no compat shim per plan
owner.
Out of scope (tracked in CODAGT-214): level-aware indent for
middle-substituted splice lines. Locked in
TestEditFiles_FuzzyIndent_InsertionLevelAware's Lock_* cases plus
TestEditFiles_ReplaceAll_FuzzyIndentGap.
671 lines
26 KiB
Go
671 lines
26 KiB
Go
// Code generated by MockGen. DO NOT EDIT.
|
|
// Source: .. (interfaces: AgentConn)
|
|
//
|
|
// Generated by this command:
|
|
//
|
|
// mockgen -destination ./agentconnmock.go -package agentconnmock .. AgentConn
|
|
//
|
|
|
|
// Package agentconnmock is a generated GoMock package.
|
|
package agentconnmock
|
|
|
|
import (
|
|
context "context"
|
|
io "io"
|
|
net "net"
|
|
http "net/http"
|
|
reflect "reflect"
|
|
time "time"
|
|
|
|
uuid "github.com/google/uuid"
|
|
gomock "go.uber.org/mock/gomock"
|
|
ssh "golang.org/x/crypto/ssh"
|
|
gonet "gvisor.dev/gvisor/pkg/tcpip/adapters/gonet"
|
|
ipnstate "tailscale.com/ipn/ipnstate"
|
|
speedtest "tailscale.com/net/speedtest"
|
|
|
|
slog "cdr.dev/slog/v3"
|
|
codersdk "github.com/coder/coder/v2/codersdk"
|
|
healthsdk "github.com/coder/coder/v2/codersdk/healthsdk"
|
|
workspacesdk "github.com/coder/coder/v2/codersdk/workspacesdk"
|
|
wsjson "github.com/coder/coder/v2/codersdk/wsjson"
|
|
tailnet "github.com/coder/coder/v2/tailnet"
|
|
)
|
|
|
|
// MockAgentConn is a mock of AgentConn interface.
|
|
type MockAgentConn struct {
|
|
ctrl *gomock.Controller
|
|
recorder *MockAgentConnMockRecorder
|
|
isgomock struct{}
|
|
}
|
|
|
|
// MockAgentConnMockRecorder is the mock recorder for MockAgentConn.
|
|
type MockAgentConnMockRecorder struct {
|
|
mock *MockAgentConn
|
|
}
|
|
|
|
// NewMockAgentConn creates a new mock instance.
|
|
func NewMockAgentConn(ctrl *gomock.Controller) *MockAgentConn {
|
|
mock := &MockAgentConn{ctrl: ctrl}
|
|
mock.recorder = &MockAgentConnMockRecorder{mock}
|
|
return mock
|
|
}
|
|
|
|
// EXPECT returns an object that allows the caller to indicate expected use.
|
|
func (m *MockAgentConn) EXPECT() *MockAgentConnMockRecorder {
|
|
return m.recorder
|
|
}
|
|
|
|
// AwaitReachable mocks base method.
|
|
func (m *MockAgentConn) AwaitReachable(ctx context.Context) bool {
|
|
m.ctrl.T.Helper()
|
|
ret := m.ctrl.Call(m, "AwaitReachable", ctx)
|
|
ret0, _ := ret[0].(bool)
|
|
return ret0
|
|
}
|
|
|
|
// AwaitReachable indicates an expected call of AwaitReachable.
|
|
func (mr *MockAgentConnMockRecorder) AwaitReachable(ctx any) *gomock.Call {
|
|
mr.mock.ctrl.T.Helper()
|
|
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "AwaitReachable", reflect.TypeOf((*MockAgentConn)(nil).AwaitReachable), ctx)
|
|
}
|
|
|
|
// CallMCPTool mocks base method.
|
|
func (m *MockAgentConn) CallMCPTool(ctx context.Context, req workspacesdk.CallMCPToolRequest) (workspacesdk.CallMCPToolResponse, error) {
|
|
m.ctrl.T.Helper()
|
|
ret := m.ctrl.Call(m, "CallMCPTool", ctx, req)
|
|
ret0, _ := ret[0].(workspacesdk.CallMCPToolResponse)
|
|
ret1, _ := ret[1].(error)
|
|
return ret0, ret1
|
|
}
|
|
|
|
// CallMCPTool indicates an expected call of CallMCPTool.
|
|
func (mr *MockAgentConnMockRecorder) CallMCPTool(ctx, req any) *gomock.Call {
|
|
mr.mock.ctrl.T.Helper()
|
|
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "CallMCPTool", reflect.TypeOf((*MockAgentConn)(nil).CallMCPTool), ctx, req)
|
|
}
|
|
|
|
// Close mocks base method.
|
|
func (m *MockAgentConn) Close() error {
|
|
m.ctrl.T.Helper()
|
|
ret := m.ctrl.Call(m, "Close")
|
|
ret0, _ := ret[0].(error)
|
|
return ret0
|
|
}
|
|
|
|
// Close indicates an expected call of Close.
|
|
func (mr *MockAgentConnMockRecorder) Close() *gomock.Call {
|
|
mr.mock.ctrl.T.Helper()
|
|
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Close", reflect.TypeOf((*MockAgentConn)(nil).Close))
|
|
}
|
|
|
|
// ConnectDesktopVNC mocks base method.
|
|
func (m *MockAgentConn) ConnectDesktopVNC(ctx context.Context) (net.Conn, error) {
|
|
m.ctrl.T.Helper()
|
|
ret := m.ctrl.Call(m, "ConnectDesktopVNC", ctx)
|
|
ret0, _ := ret[0].(net.Conn)
|
|
ret1, _ := ret[1].(error)
|
|
return ret0, ret1
|
|
}
|
|
|
|
// ConnectDesktopVNC indicates an expected call of ConnectDesktopVNC.
|
|
func (mr *MockAgentConnMockRecorder) ConnectDesktopVNC(ctx any) *gomock.Call {
|
|
mr.mock.ctrl.T.Helper()
|
|
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "ConnectDesktopVNC", reflect.TypeOf((*MockAgentConn)(nil).ConnectDesktopVNC), ctx)
|
|
}
|
|
|
|
// ContextConfig mocks base method.
|
|
func (m *MockAgentConn) ContextConfig(ctx context.Context) (workspacesdk.ContextConfigResponse, error) {
|
|
m.ctrl.T.Helper()
|
|
ret := m.ctrl.Call(m, "ContextConfig", ctx)
|
|
ret0, _ := ret[0].(workspacesdk.ContextConfigResponse)
|
|
ret1, _ := ret[1].(error)
|
|
return ret0, ret1
|
|
}
|
|
|
|
// ContextConfig indicates an expected call of ContextConfig.
|
|
func (mr *MockAgentConnMockRecorder) ContextConfig(ctx any) *gomock.Call {
|
|
mr.mock.ctrl.T.Helper()
|
|
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "ContextConfig", reflect.TypeOf((*MockAgentConn)(nil).ContextConfig), ctx)
|
|
}
|
|
|
|
// DebugLogs mocks base method.
|
|
func (m *MockAgentConn) DebugLogs(ctx context.Context) ([]byte, error) {
|
|
m.ctrl.T.Helper()
|
|
ret := m.ctrl.Call(m, "DebugLogs", ctx)
|
|
ret0, _ := ret[0].([]byte)
|
|
ret1, _ := ret[1].(error)
|
|
return ret0, ret1
|
|
}
|
|
|
|
// DebugLogs indicates an expected call of DebugLogs.
|
|
func (mr *MockAgentConnMockRecorder) DebugLogs(ctx any) *gomock.Call {
|
|
mr.mock.ctrl.T.Helper()
|
|
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "DebugLogs", reflect.TypeOf((*MockAgentConn)(nil).DebugLogs), ctx)
|
|
}
|
|
|
|
// DebugMagicsock mocks base method.
|
|
func (m *MockAgentConn) DebugMagicsock(ctx context.Context) ([]byte, error) {
|
|
m.ctrl.T.Helper()
|
|
ret := m.ctrl.Call(m, "DebugMagicsock", ctx)
|
|
ret0, _ := ret[0].([]byte)
|
|
ret1, _ := ret[1].(error)
|
|
return ret0, ret1
|
|
}
|
|
|
|
// DebugMagicsock indicates an expected call of DebugMagicsock.
|
|
func (mr *MockAgentConnMockRecorder) DebugMagicsock(ctx any) *gomock.Call {
|
|
mr.mock.ctrl.T.Helper()
|
|
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "DebugMagicsock", reflect.TypeOf((*MockAgentConn)(nil).DebugMagicsock), ctx)
|
|
}
|
|
|
|
// DebugManifest mocks base method.
|
|
func (m *MockAgentConn) DebugManifest(ctx context.Context) ([]byte, error) {
|
|
m.ctrl.T.Helper()
|
|
ret := m.ctrl.Call(m, "DebugManifest", ctx)
|
|
ret0, _ := ret[0].([]byte)
|
|
ret1, _ := ret[1].(error)
|
|
return ret0, ret1
|
|
}
|
|
|
|
// DebugManifest indicates an expected call of DebugManifest.
|
|
func (mr *MockAgentConnMockRecorder) DebugManifest(ctx any) *gomock.Call {
|
|
mr.mock.ctrl.T.Helper()
|
|
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "DebugManifest", reflect.TypeOf((*MockAgentConn)(nil).DebugManifest), ctx)
|
|
}
|
|
|
|
// DeleteDevcontainer mocks base method.
|
|
func (m *MockAgentConn) DeleteDevcontainer(ctx context.Context, devcontainerID string) error {
|
|
m.ctrl.T.Helper()
|
|
ret := m.ctrl.Call(m, "DeleteDevcontainer", ctx, devcontainerID)
|
|
ret0, _ := ret[0].(error)
|
|
return ret0
|
|
}
|
|
|
|
// DeleteDevcontainer indicates an expected call of DeleteDevcontainer.
|
|
func (mr *MockAgentConnMockRecorder) DeleteDevcontainer(ctx, devcontainerID any) *gomock.Call {
|
|
mr.mock.ctrl.T.Helper()
|
|
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "DeleteDevcontainer", reflect.TypeOf((*MockAgentConn)(nil).DeleteDevcontainer), ctx, devcontainerID)
|
|
}
|
|
|
|
// DialContext mocks base method.
|
|
func (m *MockAgentConn) DialContext(ctx context.Context, network, addr string) (net.Conn, error) {
|
|
m.ctrl.T.Helper()
|
|
ret := m.ctrl.Call(m, "DialContext", ctx, network, addr)
|
|
ret0, _ := ret[0].(net.Conn)
|
|
ret1, _ := ret[1].(error)
|
|
return ret0, ret1
|
|
}
|
|
|
|
// DialContext indicates an expected call of DialContext.
|
|
func (mr *MockAgentConnMockRecorder) DialContext(ctx, network, addr any) *gomock.Call {
|
|
mr.mock.ctrl.T.Helper()
|
|
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "DialContext", reflect.TypeOf((*MockAgentConn)(nil).DialContext), ctx, network, addr)
|
|
}
|
|
|
|
// EditFiles mocks base method.
|
|
func (m *MockAgentConn) EditFiles(ctx context.Context, edits workspacesdk.FileEditRequest) (workspacesdk.FileEditResponse, error) {
|
|
m.ctrl.T.Helper()
|
|
ret := m.ctrl.Call(m, "EditFiles", ctx, edits)
|
|
ret0, _ := ret[0].(workspacesdk.FileEditResponse)
|
|
ret1, _ := ret[1].(error)
|
|
return ret0, ret1
|
|
}
|
|
|
|
// EditFiles indicates an expected call of EditFiles.
|
|
func (mr *MockAgentConnMockRecorder) EditFiles(ctx, edits any) *gomock.Call {
|
|
mr.mock.ctrl.T.Helper()
|
|
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "EditFiles", reflect.TypeOf((*MockAgentConn)(nil).EditFiles), ctx, edits)
|
|
}
|
|
|
|
// ExecuteDesktopAction mocks base method.
|
|
func (m *MockAgentConn) ExecuteDesktopAction(ctx context.Context, action workspacesdk.DesktopAction) (workspacesdk.DesktopActionResponse, error) {
|
|
m.ctrl.T.Helper()
|
|
ret := m.ctrl.Call(m, "ExecuteDesktopAction", ctx, action)
|
|
ret0, _ := ret[0].(workspacesdk.DesktopActionResponse)
|
|
ret1, _ := ret[1].(error)
|
|
return ret0, ret1
|
|
}
|
|
|
|
// ExecuteDesktopAction indicates an expected call of ExecuteDesktopAction.
|
|
func (mr *MockAgentConnMockRecorder) ExecuteDesktopAction(ctx, action any) *gomock.Call {
|
|
mr.mock.ctrl.T.Helper()
|
|
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "ExecuteDesktopAction", reflect.TypeOf((*MockAgentConn)(nil).ExecuteDesktopAction), ctx, action)
|
|
}
|
|
|
|
// GetPeerDiagnostics mocks base method.
|
|
func (m *MockAgentConn) GetPeerDiagnostics() tailnet.PeerDiagnostics {
|
|
m.ctrl.T.Helper()
|
|
ret := m.ctrl.Call(m, "GetPeerDiagnostics")
|
|
ret0, _ := ret[0].(tailnet.PeerDiagnostics)
|
|
return ret0
|
|
}
|
|
|
|
// GetPeerDiagnostics indicates an expected call of GetPeerDiagnostics.
|
|
func (mr *MockAgentConnMockRecorder) GetPeerDiagnostics() *gomock.Call {
|
|
mr.mock.ctrl.T.Helper()
|
|
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetPeerDiagnostics", reflect.TypeOf((*MockAgentConn)(nil).GetPeerDiagnostics))
|
|
}
|
|
|
|
// LS mocks base method.
|
|
func (m *MockAgentConn) LS(ctx context.Context, path string, req workspacesdk.LSRequest) (workspacesdk.LSResponse, error) {
|
|
m.ctrl.T.Helper()
|
|
ret := m.ctrl.Call(m, "LS", ctx, path, req)
|
|
ret0, _ := ret[0].(workspacesdk.LSResponse)
|
|
ret1, _ := ret[1].(error)
|
|
return ret0, ret1
|
|
}
|
|
|
|
// LS indicates an expected call of LS.
|
|
func (mr *MockAgentConnMockRecorder) LS(ctx, path, req any) *gomock.Call {
|
|
mr.mock.ctrl.T.Helper()
|
|
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "LS", reflect.TypeOf((*MockAgentConn)(nil).LS), ctx, path, req)
|
|
}
|
|
|
|
// ListContainers mocks base method.
|
|
func (m *MockAgentConn) ListContainers(ctx context.Context) (codersdk.WorkspaceAgentListContainersResponse, error) {
|
|
m.ctrl.T.Helper()
|
|
ret := m.ctrl.Call(m, "ListContainers", ctx)
|
|
ret0, _ := ret[0].(codersdk.WorkspaceAgentListContainersResponse)
|
|
ret1, _ := ret[1].(error)
|
|
return ret0, ret1
|
|
}
|
|
|
|
// ListContainers indicates an expected call of ListContainers.
|
|
func (mr *MockAgentConnMockRecorder) ListContainers(ctx any) *gomock.Call {
|
|
mr.mock.ctrl.T.Helper()
|
|
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "ListContainers", reflect.TypeOf((*MockAgentConn)(nil).ListContainers), ctx)
|
|
}
|
|
|
|
// ListMCPTools mocks base method.
|
|
func (m *MockAgentConn) ListMCPTools(ctx context.Context) (workspacesdk.ListMCPToolsResponse, error) {
|
|
m.ctrl.T.Helper()
|
|
ret := m.ctrl.Call(m, "ListMCPTools", ctx)
|
|
ret0, _ := ret[0].(workspacesdk.ListMCPToolsResponse)
|
|
ret1, _ := ret[1].(error)
|
|
return ret0, ret1
|
|
}
|
|
|
|
// ListMCPTools indicates an expected call of ListMCPTools.
|
|
func (mr *MockAgentConnMockRecorder) ListMCPTools(ctx any) *gomock.Call {
|
|
mr.mock.ctrl.T.Helper()
|
|
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "ListMCPTools", reflect.TypeOf((*MockAgentConn)(nil).ListMCPTools), ctx)
|
|
}
|
|
|
|
// ListProcesses mocks base method.
|
|
func (m *MockAgentConn) ListProcesses(ctx context.Context) (workspacesdk.ListProcessesResponse, error) {
|
|
m.ctrl.T.Helper()
|
|
ret := m.ctrl.Call(m, "ListProcesses", ctx)
|
|
ret0, _ := ret[0].(workspacesdk.ListProcessesResponse)
|
|
ret1, _ := ret[1].(error)
|
|
return ret0, ret1
|
|
}
|
|
|
|
// ListProcesses indicates an expected call of ListProcesses.
|
|
func (mr *MockAgentConnMockRecorder) ListProcesses(ctx any) *gomock.Call {
|
|
mr.mock.ctrl.T.Helper()
|
|
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "ListProcesses", reflect.TypeOf((*MockAgentConn)(nil).ListProcesses), ctx)
|
|
}
|
|
|
|
// ListeningPorts mocks base method.
|
|
func (m *MockAgentConn) ListeningPorts(ctx context.Context) (codersdk.WorkspaceAgentListeningPortsResponse, error) {
|
|
m.ctrl.T.Helper()
|
|
ret := m.ctrl.Call(m, "ListeningPorts", ctx)
|
|
ret0, _ := ret[0].(codersdk.WorkspaceAgentListeningPortsResponse)
|
|
ret1, _ := ret[1].(error)
|
|
return ret0, ret1
|
|
}
|
|
|
|
// ListeningPorts indicates an expected call of ListeningPorts.
|
|
func (mr *MockAgentConnMockRecorder) ListeningPorts(ctx any) *gomock.Call {
|
|
mr.mock.ctrl.T.Helper()
|
|
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "ListeningPorts", reflect.TypeOf((*MockAgentConn)(nil).ListeningPorts), ctx)
|
|
}
|
|
|
|
// Netcheck mocks base method.
|
|
func (m *MockAgentConn) Netcheck(ctx context.Context) (healthsdk.AgentNetcheckReport, error) {
|
|
m.ctrl.T.Helper()
|
|
ret := m.ctrl.Call(m, "Netcheck", ctx)
|
|
ret0, _ := ret[0].(healthsdk.AgentNetcheckReport)
|
|
ret1, _ := ret[1].(error)
|
|
return ret0, ret1
|
|
}
|
|
|
|
// Netcheck indicates an expected call of Netcheck.
|
|
func (mr *MockAgentConnMockRecorder) Netcheck(ctx any) *gomock.Call {
|
|
mr.mock.ctrl.T.Helper()
|
|
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Netcheck", reflect.TypeOf((*MockAgentConn)(nil).Netcheck), ctx)
|
|
}
|
|
|
|
// Ping mocks base method.
|
|
func (m *MockAgentConn) Ping(ctx context.Context) (time.Duration, bool, *ipnstate.PingResult, error) {
|
|
m.ctrl.T.Helper()
|
|
ret := m.ctrl.Call(m, "Ping", ctx)
|
|
ret0, _ := ret[0].(time.Duration)
|
|
ret1, _ := ret[1].(bool)
|
|
ret2, _ := ret[2].(*ipnstate.PingResult)
|
|
ret3, _ := ret[3].(error)
|
|
return ret0, ret1, ret2, ret3
|
|
}
|
|
|
|
// Ping indicates an expected call of Ping.
|
|
func (mr *MockAgentConnMockRecorder) Ping(ctx any) *gomock.Call {
|
|
mr.mock.ctrl.T.Helper()
|
|
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Ping", reflect.TypeOf((*MockAgentConn)(nil).Ping), ctx)
|
|
}
|
|
|
|
// ProcessOutput mocks base method.
|
|
func (m *MockAgentConn) ProcessOutput(ctx context.Context, id string, opts *workspacesdk.ProcessOutputOptions) (workspacesdk.ProcessOutputResponse, error) {
|
|
m.ctrl.T.Helper()
|
|
ret := m.ctrl.Call(m, "ProcessOutput", ctx, id, opts)
|
|
ret0, _ := ret[0].(workspacesdk.ProcessOutputResponse)
|
|
ret1, _ := ret[1].(error)
|
|
return ret0, ret1
|
|
}
|
|
|
|
// ProcessOutput indicates an expected call of ProcessOutput.
|
|
func (mr *MockAgentConnMockRecorder) ProcessOutput(ctx, id, opts any) *gomock.Call {
|
|
mr.mock.ctrl.T.Helper()
|
|
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "ProcessOutput", reflect.TypeOf((*MockAgentConn)(nil).ProcessOutput), ctx, id, opts)
|
|
}
|
|
|
|
// PrometheusMetrics mocks base method.
|
|
func (m *MockAgentConn) PrometheusMetrics(ctx context.Context) ([]byte, error) {
|
|
m.ctrl.T.Helper()
|
|
ret := m.ctrl.Call(m, "PrometheusMetrics", ctx)
|
|
ret0, _ := ret[0].([]byte)
|
|
ret1, _ := ret[1].(error)
|
|
return ret0, ret1
|
|
}
|
|
|
|
// PrometheusMetrics indicates an expected call of PrometheusMetrics.
|
|
func (mr *MockAgentConnMockRecorder) PrometheusMetrics(ctx any) *gomock.Call {
|
|
mr.mock.ctrl.T.Helper()
|
|
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "PrometheusMetrics", reflect.TypeOf((*MockAgentConn)(nil).PrometheusMetrics), ctx)
|
|
}
|
|
|
|
// ReadFile mocks base method.
|
|
func (m *MockAgentConn) ReadFile(ctx context.Context, path string, offset, limit int64) (io.ReadCloser, string, error) {
|
|
m.ctrl.T.Helper()
|
|
ret := m.ctrl.Call(m, "ReadFile", ctx, path, offset, limit)
|
|
ret0, _ := ret[0].(io.ReadCloser)
|
|
ret1, _ := ret[1].(string)
|
|
ret2, _ := ret[2].(error)
|
|
return ret0, ret1, ret2
|
|
}
|
|
|
|
// ReadFile indicates an expected call of ReadFile.
|
|
func (mr *MockAgentConnMockRecorder) ReadFile(ctx, path, offset, limit any) *gomock.Call {
|
|
mr.mock.ctrl.T.Helper()
|
|
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "ReadFile", reflect.TypeOf((*MockAgentConn)(nil).ReadFile), ctx, path, offset, limit)
|
|
}
|
|
|
|
// ReadFileLines mocks base method.
|
|
func (m *MockAgentConn) ReadFileLines(ctx context.Context, path string, offset, limit int64, limits workspacesdk.ReadFileLinesLimits) (workspacesdk.ReadFileLinesResponse, error) {
|
|
m.ctrl.T.Helper()
|
|
ret := m.ctrl.Call(m, "ReadFileLines", ctx, path, offset, limit, limits)
|
|
ret0, _ := ret[0].(workspacesdk.ReadFileLinesResponse)
|
|
ret1, _ := ret[1].(error)
|
|
return ret0, ret1
|
|
}
|
|
|
|
// ReadFileLines indicates an expected call of ReadFileLines.
|
|
func (mr *MockAgentConnMockRecorder) ReadFileLines(ctx, path, offset, limit, limits any) *gomock.Call {
|
|
mr.mock.ctrl.T.Helper()
|
|
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "ReadFileLines", reflect.TypeOf((*MockAgentConn)(nil).ReadFileLines), ctx, path, offset, limit, limits)
|
|
}
|
|
|
|
// ReconnectingPTY mocks base method.
|
|
func (m *MockAgentConn) ReconnectingPTY(ctx context.Context, id uuid.UUID, height, width uint16, command string, initOpts ...workspacesdk.AgentReconnectingPTYInitOption) (net.Conn, error) {
|
|
m.ctrl.T.Helper()
|
|
varargs := []any{ctx, id, height, width, command}
|
|
for _, a := range initOpts {
|
|
varargs = append(varargs, a)
|
|
}
|
|
ret := m.ctrl.Call(m, "ReconnectingPTY", varargs...)
|
|
ret0, _ := ret[0].(net.Conn)
|
|
ret1, _ := ret[1].(error)
|
|
return ret0, ret1
|
|
}
|
|
|
|
// ReconnectingPTY indicates an expected call of ReconnectingPTY.
|
|
func (mr *MockAgentConnMockRecorder) ReconnectingPTY(ctx, id, height, width, command any, initOpts ...any) *gomock.Call {
|
|
mr.mock.ctrl.T.Helper()
|
|
varargs := append([]any{ctx, id, height, width, command}, initOpts...)
|
|
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "ReconnectingPTY", reflect.TypeOf((*MockAgentConn)(nil).ReconnectingPTY), varargs...)
|
|
}
|
|
|
|
// RecreateDevcontainer mocks base method.
|
|
func (m *MockAgentConn) RecreateDevcontainer(ctx context.Context, devcontainerID string) (codersdk.Response, error) {
|
|
m.ctrl.T.Helper()
|
|
ret := m.ctrl.Call(m, "RecreateDevcontainer", ctx, devcontainerID)
|
|
ret0, _ := ret[0].(codersdk.Response)
|
|
ret1, _ := ret[1].(error)
|
|
return ret0, ret1
|
|
}
|
|
|
|
// RecreateDevcontainer indicates an expected call of RecreateDevcontainer.
|
|
func (mr *MockAgentConnMockRecorder) RecreateDevcontainer(ctx, devcontainerID any) *gomock.Call {
|
|
mr.mock.ctrl.T.Helper()
|
|
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "RecreateDevcontainer", reflect.TypeOf((*MockAgentConn)(nil).RecreateDevcontainer), ctx, devcontainerID)
|
|
}
|
|
|
|
// ResolvePath mocks base method.
|
|
func (m *MockAgentConn) ResolvePath(ctx context.Context, path string) (string, error) {
|
|
m.ctrl.T.Helper()
|
|
ret := m.ctrl.Call(m, "ResolvePath", ctx, path)
|
|
ret0, _ := ret[0].(string)
|
|
ret1, _ := ret[1].(error)
|
|
return ret0, ret1
|
|
}
|
|
|
|
// ResolvePath indicates an expected call of ResolvePath.
|
|
func (mr *MockAgentConnMockRecorder) ResolvePath(ctx, path any) *gomock.Call {
|
|
mr.mock.ctrl.T.Helper()
|
|
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "ResolvePath", reflect.TypeOf((*MockAgentConn)(nil).ResolvePath), ctx, path)
|
|
}
|
|
|
|
// SSH mocks base method.
|
|
func (m *MockAgentConn) SSH(ctx context.Context) (*gonet.TCPConn, error) {
|
|
m.ctrl.T.Helper()
|
|
ret := m.ctrl.Call(m, "SSH", ctx)
|
|
ret0, _ := ret[0].(*gonet.TCPConn)
|
|
ret1, _ := ret[1].(error)
|
|
return ret0, ret1
|
|
}
|
|
|
|
// SSH indicates an expected call of SSH.
|
|
func (mr *MockAgentConnMockRecorder) SSH(ctx any) *gomock.Call {
|
|
mr.mock.ctrl.T.Helper()
|
|
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "SSH", reflect.TypeOf((*MockAgentConn)(nil).SSH), ctx)
|
|
}
|
|
|
|
// SSHClient mocks base method.
|
|
func (m *MockAgentConn) SSHClient(ctx context.Context) (*ssh.Client, error) {
|
|
m.ctrl.T.Helper()
|
|
ret := m.ctrl.Call(m, "SSHClient", ctx)
|
|
ret0, _ := ret[0].(*ssh.Client)
|
|
ret1, _ := ret[1].(error)
|
|
return ret0, ret1
|
|
}
|
|
|
|
// SSHClient indicates an expected call of SSHClient.
|
|
func (mr *MockAgentConnMockRecorder) SSHClient(ctx any) *gomock.Call {
|
|
mr.mock.ctrl.T.Helper()
|
|
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "SSHClient", reflect.TypeOf((*MockAgentConn)(nil).SSHClient), ctx)
|
|
}
|
|
|
|
// SSHClientOnPort mocks base method.
|
|
func (m *MockAgentConn) SSHClientOnPort(ctx context.Context, port uint16) (*ssh.Client, error) {
|
|
m.ctrl.T.Helper()
|
|
ret := m.ctrl.Call(m, "SSHClientOnPort", ctx, port)
|
|
ret0, _ := ret[0].(*ssh.Client)
|
|
ret1, _ := ret[1].(error)
|
|
return ret0, ret1
|
|
}
|
|
|
|
// SSHClientOnPort indicates an expected call of SSHClientOnPort.
|
|
func (mr *MockAgentConnMockRecorder) SSHClientOnPort(ctx, port any) *gomock.Call {
|
|
mr.mock.ctrl.T.Helper()
|
|
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "SSHClientOnPort", reflect.TypeOf((*MockAgentConn)(nil).SSHClientOnPort), ctx, port)
|
|
}
|
|
|
|
// SSHOnPort mocks base method.
|
|
func (m *MockAgentConn) SSHOnPort(ctx context.Context, port uint16) (*gonet.TCPConn, error) {
|
|
m.ctrl.T.Helper()
|
|
ret := m.ctrl.Call(m, "SSHOnPort", ctx, port)
|
|
ret0, _ := ret[0].(*gonet.TCPConn)
|
|
ret1, _ := ret[1].(error)
|
|
return ret0, ret1
|
|
}
|
|
|
|
// SSHOnPort indicates an expected call of SSHOnPort.
|
|
func (mr *MockAgentConnMockRecorder) SSHOnPort(ctx, port any) *gomock.Call {
|
|
mr.mock.ctrl.T.Helper()
|
|
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "SSHOnPort", reflect.TypeOf((*MockAgentConn)(nil).SSHOnPort), ctx, port)
|
|
}
|
|
|
|
// SetExtraHeaders mocks base method.
|
|
func (m *MockAgentConn) SetExtraHeaders(h http.Header) {
|
|
m.ctrl.T.Helper()
|
|
m.ctrl.Call(m, "SetExtraHeaders", h)
|
|
}
|
|
|
|
// SetExtraHeaders indicates an expected call of SetExtraHeaders.
|
|
func (mr *MockAgentConnMockRecorder) SetExtraHeaders(h any) *gomock.Call {
|
|
mr.mock.ctrl.T.Helper()
|
|
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "SetExtraHeaders", reflect.TypeOf((*MockAgentConn)(nil).SetExtraHeaders), h)
|
|
}
|
|
|
|
// SignalProcess mocks base method.
|
|
func (m *MockAgentConn) SignalProcess(ctx context.Context, id, signal string) error {
|
|
m.ctrl.T.Helper()
|
|
ret := m.ctrl.Call(m, "SignalProcess", ctx, id, signal)
|
|
ret0, _ := ret[0].(error)
|
|
return ret0
|
|
}
|
|
|
|
// SignalProcess indicates an expected call of SignalProcess.
|
|
func (mr *MockAgentConnMockRecorder) SignalProcess(ctx, id, signal any) *gomock.Call {
|
|
mr.mock.ctrl.T.Helper()
|
|
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "SignalProcess", reflect.TypeOf((*MockAgentConn)(nil).SignalProcess), ctx, id, signal)
|
|
}
|
|
|
|
// Speedtest mocks base method.
|
|
func (m *MockAgentConn) Speedtest(ctx context.Context, direction speedtest.Direction, duration time.Duration) ([]speedtest.Result, error) {
|
|
m.ctrl.T.Helper()
|
|
ret := m.ctrl.Call(m, "Speedtest", ctx, direction, duration)
|
|
ret0, _ := ret[0].([]speedtest.Result)
|
|
ret1, _ := ret[1].(error)
|
|
return ret0, ret1
|
|
}
|
|
|
|
// Speedtest indicates an expected call of Speedtest.
|
|
func (mr *MockAgentConnMockRecorder) Speedtest(ctx, direction, duration any) *gomock.Call {
|
|
mr.mock.ctrl.T.Helper()
|
|
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Speedtest", reflect.TypeOf((*MockAgentConn)(nil).Speedtest), ctx, direction, duration)
|
|
}
|
|
|
|
// StartDesktopRecording mocks base method.
|
|
func (m *MockAgentConn) StartDesktopRecording(ctx context.Context, req workspacesdk.StartDesktopRecordingRequest) error {
|
|
m.ctrl.T.Helper()
|
|
ret := m.ctrl.Call(m, "StartDesktopRecording", ctx, req)
|
|
ret0, _ := ret[0].(error)
|
|
return ret0
|
|
}
|
|
|
|
// StartDesktopRecording indicates an expected call of StartDesktopRecording.
|
|
func (mr *MockAgentConnMockRecorder) StartDesktopRecording(ctx, req any) *gomock.Call {
|
|
mr.mock.ctrl.T.Helper()
|
|
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "StartDesktopRecording", reflect.TypeOf((*MockAgentConn)(nil).StartDesktopRecording), ctx, req)
|
|
}
|
|
|
|
// StartProcess mocks base method.
|
|
func (m *MockAgentConn) StartProcess(ctx context.Context, req workspacesdk.StartProcessRequest) (workspacesdk.StartProcessResponse, error) {
|
|
m.ctrl.T.Helper()
|
|
ret := m.ctrl.Call(m, "StartProcess", ctx, req)
|
|
ret0, _ := ret[0].(workspacesdk.StartProcessResponse)
|
|
ret1, _ := ret[1].(error)
|
|
return ret0, ret1
|
|
}
|
|
|
|
// StartProcess indicates an expected call of StartProcess.
|
|
func (mr *MockAgentConnMockRecorder) StartProcess(ctx, req any) *gomock.Call {
|
|
mr.mock.ctrl.T.Helper()
|
|
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "StartProcess", reflect.TypeOf((*MockAgentConn)(nil).StartProcess), ctx, req)
|
|
}
|
|
|
|
// StopDesktopRecording mocks base method.
|
|
func (m *MockAgentConn) StopDesktopRecording(ctx context.Context, req workspacesdk.StopDesktopRecordingRequest) (workspacesdk.StopDesktopRecordingResponse, error) {
|
|
m.ctrl.T.Helper()
|
|
ret := m.ctrl.Call(m, "StopDesktopRecording", ctx, req)
|
|
ret0, _ := ret[0].(workspacesdk.StopDesktopRecordingResponse)
|
|
ret1, _ := ret[1].(error)
|
|
return ret0, ret1
|
|
}
|
|
|
|
// StopDesktopRecording indicates an expected call of StopDesktopRecording.
|
|
func (mr *MockAgentConnMockRecorder) StopDesktopRecording(ctx, req any) *gomock.Call {
|
|
mr.mock.ctrl.T.Helper()
|
|
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "StopDesktopRecording", reflect.TypeOf((*MockAgentConn)(nil).StopDesktopRecording), ctx, req)
|
|
}
|
|
|
|
// TailnetConn mocks base method.
|
|
func (m *MockAgentConn) TailnetConn() *tailnet.Conn {
|
|
m.ctrl.T.Helper()
|
|
ret := m.ctrl.Call(m, "TailnetConn")
|
|
ret0, _ := ret[0].(*tailnet.Conn)
|
|
return ret0
|
|
}
|
|
|
|
// TailnetConn indicates an expected call of TailnetConn.
|
|
func (mr *MockAgentConnMockRecorder) TailnetConn() *gomock.Call {
|
|
mr.mock.ctrl.T.Helper()
|
|
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "TailnetConn", reflect.TypeOf((*MockAgentConn)(nil).TailnetConn))
|
|
}
|
|
|
|
// WatchContainers mocks base method.
|
|
func (m *MockAgentConn) WatchContainers(ctx context.Context, logger slog.Logger) (<-chan codersdk.WorkspaceAgentListContainersResponse, io.Closer, error) {
|
|
m.ctrl.T.Helper()
|
|
ret := m.ctrl.Call(m, "WatchContainers", ctx, logger)
|
|
ret0, _ := ret[0].(<-chan codersdk.WorkspaceAgentListContainersResponse)
|
|
ret1, _ := ret[1].(io.Closer)
|
|
ret2, _ := ret[2].(error)
|
|
return ret0, ret1, ret2
|
|
}
|
|
|
|
// WatchContainers indicates an expected call of WatchContainers.
|
|
func (mr *MockAgentConnMockRecorder) WatchContainers(ctx, logger any) *gomock.Call {
|
|
mr.mock.ctrl.T.Helper()
|
|
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "WatchContainers", reflect.TypeOf((*MockAgentConn)(nil).WatchContainers), ctx, logger)
|
|
}
|
|
|
|
// WatchGit mocks base method.
|
|
func (m *MockAgentConn) WatchGit(ctx context.Context, logger slog.Logger, chatID uuid.UUID) (*wsjson.Stream[codersdk.WorkspaceAgentGitServerMessage, codersdk.WorkspaceAgentGitClientMessage], error) {
|
|
m.ctrl.T.Helper()
|
|
ret := m.ctrl.Call(m, "WatchGit", ctx, logger, chatID)
|
|
ret0, _ := ret[0].(*wsjson.Stream[codersdk.WorkspaceAgentGitServerMessage, codersdk.WorkspaceAgentGitClientMessage])
|
|
ret1, _ := ret[1].(error)
|
|
return ret0, ret1
|
|
}
|
|
|
|
// WatchGit indicates an expected call of WatchGit.
|
|
func (mr *MockAgentConnMockRecorder) WatchGit(ctx, logger, chatID any) *gomock.Call {
|
|
mr.mock.ctrl.T.Helper()
|
|
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "WatchGit", reflect.TypeOf((*MockAgentConn)(nil).WatchGit), ctx, logger, chatID)
|
|
}
|
|
|
|
// WriteFile mocks base method.
|
|
func (m *MockAgentConn) WriteFile(ctx context.Context, path string, reader io.Reader) error {
|
|
m.ctrl.T.Helper()
|
|
ret := m.ctrl.Call(m, "WriteFile", ctx, path, reader)
|
|
ret0, _ := ret[0].(error)
|
|
return ret0
|
|
}
|
|
|
|
// WriteFile indicates an expected call of WriteFile.
|
|
func (mr *MockAgentConnMockRecorder) WriteFile(ctx, path, reader any) *gomock.Call {
|
|
mr.mock.ctrl.T.Helper()
|
|
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "WriteFile", reflect.TypeOf((*MockAgentConn)(nil).WriteFile), ctx, path, reader)
|
|
}
|