Documentation
¶
Index ¶
- Constants
- Variables
- type API
- type CreateFileOptions
- type CreateFileResult
- type DeleteFileOptions
- type DeleteFileResult
- type DiffFile
- type DiffSkip
- type EditFileOptions
- type EditResult
- type ExactEdit
- type GitDiff
- type GitDiffOptions
- type GitRunner
- type GitStatus
- type GitStatusOptions
- type Options
- type ReadFileOptions
- type Service
- func (svc *Service) CreateFile(ctx context.Context, projectID string, options CreateFileOptions) (CreateFileResult, error)
- func (svc *Service) DeleteFile(ctx context.Context, projectID string, options DeleteFileOptions) (DeleteFileResult, error)
- func (svc *Service) EditFile(ctx context.Context, projectID string, options EditFileOptions) (EditResult, error)
- func (svc *Service) GitAvailable(ctx context.Context, projectID string) (bool, error)
- func (svc *Service) GitDiff(ctx context.Context, projectID string, options GitDiffOptions) (GitDiff, error)
- func (svc *Service) GitStatus(ctx context.Context, projectID string, options GitStatusOptions) (GitStatus, error)
- func (svc *Service) ReadFile(ctx context.Context, projectID string, options ReadFileOptions) (WorkspaceFile, error)
- func (svc *Service) SetGitRunner(runner GitRunner)
- func (svc *Service) SetPolicyRecorder(recorder *agentactivity.Recorder)
- type StatusEntry
- type WorkspaceFile
Constants ¶
View Source
const ( ModeDisabled = "disabled" ModeReadOnly = "read_only" ModeEdit = "edit" DiffScopeWorkingTree = "working_tree" DiffScopeStaged = "staged" DiffScopeHead = "head" )
View Source
const ( DefaultMaxDiffBytes = 64 << 10 MaxDiffBytes = 256 << 10 DefaultMaxReadBytes = 64 << 10 MaxReadBytes = 256 << 10 MaxPageSize = 100 )
Variables ¶
View Source
var ( ErrProjectNotFound = errors.New("workspace project not found") ErrInvalidInput = errors.New("invalid workspace input") ErrWorkspaceDisabled = errors.New("workspace disabled") ErrWorkspaceReadOnly = errors.New("workspace read only") ErrUnsafeContent = errors.New("unsafe workspace content") ErrEditTokenInvalid = errors.New("edit token invalid") ErrEditConflict = errors.New("edit conflict") ErrIngestionUnsupported = errors.New("workspace ingestion unsupported") )
Functions ¶
This section is empty.
Types ¶
type API ¶
type API interface {
GitAvailable(ctx context.Context, projectID string) (bool, error)
GitStatus(ctx context.Context, projectID string, options GitStatusOptions) (GitStatus, error)
GitDiff(ctx context.Context, projectID string, options GitDiffOptions) (GitDiff, error)
ReadFile(ctx context.Context, projectID string, options ReadFileOptions) (WorkspaceFile, error)
EditFile(ctx context.Context, projectID string, options EditFileOptions) (EditResult, error)
CreateFile(ctx context.Context, projectID string, options CreateFileOptions) (CreateFileResult, error)
DeleteFile(ctx context.Context, projectID string, options DeleteFileOptions) (DeleteFileResult, error)
}
type CreateFileOptions ¶ added in v0.1.13
type CreateFileResult ¶ added in v0.1.13
type CreateFileResult struct {
Applied bool `json:"applied"`
File WorkspaceFile `json:"file"`
IngestionRunID string `json:"ingestion_run_id,omitempty"`
NewEditToken string `json:"new_edit_token,omitempty"`
}
type DeleteFileOptions ¶ added in v0.1.13
type DeleteFileResult ¶ added in v0.1.13
type EditFileOptions ¶
type EditResult ¶
type GitDiffOptions ¶
type GitStatusOptions ¶
type ReadFileOptions ¶
type Service ¶
type Service struct {
// contains filtered or unexported fields
}
func NewService ¶
func NewService(registry *projectregistry.Registry, ingest workspaceIngestion, options Options) *Service
func (*Service) CreateFile ¶ added in v0.1.13
func (svc *Service) CreateFile(ctx context.Context, projectID string, options CreateFileOptions) (CreateFileResult, error)
func (*Service) DeleteFile ¶ added in v0.1.13
func (svc *Service) DeleteFile(ctx context.Context, projectID string, options DeleteFileOptions) (DeleteFileResult, error)
func (*Service) EditFile ¶
func (svc *Service) EditFile(ctx context.Context, projectID string, options EditFileOptions) (EditResult, error)
func (*Service) GitAvailable ¶ added in v0.1.6
func (*Service) ReadFile ¶
func (svc *Service) ReadFile(ctx context.Context, projectID string, options ReadFileOptions) (WorkspaceFile, error)
func (*Service) SetGitRunner ¶
func (*Service) SetPolicyRecorder ¶ added in v0.1.12
func (svc *Service) SetPolicyRecorder(recorder *agentactivity.Recorder)
type StatusEntry ¶
type WorkspaceFile ¶
type WorkspaceFile struct {
FileID string `json:"file_id,omitempty"`
ProjectID string `json:"project_id"`
RelativePath string `json:"relative_path"`
Extension string `json:"extension,omitempty"`
SizeBytes int64 `json:"size_bytes"`
ModifiedAt time.Time `json:"modified_at"`
Text string `json:"text"`
TextTruncated bool `json:"text_truncated"`
LineCount int `json:"line_count"`
EditToken string `json:"edit_token,omitempty"`
}
Click to show internal directories.
Click to hide internal directories.