artifacts

package
v0.6.72 Latest Latest
Warning

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

Go to latest
Published: Oct 23, 2026 License: AGPL-3.0, Apache-2.0, MIT Imports: 19 Imported by: 0

Documentation

Index

Constants

View Source
const (
	SessionTarName  = "agent-session.tar.gz"
	SessionJSONName = "agent-session.json"
	PatchFileName   = "changes.patch"
)

Variables

This section is empty.

Functions

func RestoreArchiveTree added in v0.6.72

func RestoreArchiveTree(ctx context.Context, extractDir, archivePath, destination string) error

RestoreArchiveTree copies the archived session tree from extractDir into destination. Archive entries are stored under ArchivePath; destination should be the provider-native directory that ArchivePath maps to (for example workDir/.claude/projects when ArchivePath is "projects").

func StageSessionDirectory added in v0.6.65

func StageSessionDirectory(ctx context.Context, source, destination string) (bool, error)

StageSessionDirectory copies a provider-native session directory into a disposable artifact staging directory. It preserves directories, symlinks, and regular-file permissions, while ignoring special files such as FIFOs.

Types

type ArtifactBuilder

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

func NewAgentRunArtifactBuilder

func NewAgentRunArtifactBuilder(config Config, sessionWriter SessionArchiveWriter, patchGenerator PatchGenerator) *ArtifactBuilder

func (*ArtifactBuilder) Build

type BuildArtifactsOptions

type BuildArtifactsOptions struct {
	Provider string
	Source   SessionSource
	// SessionID is the provider-native session identifier captured during the
	// run. The same value must be passed to provider resume flags on follow-up.
	SessionID string
}

type Config

type Config struct {
	WorkDir       string
	RepositoryDir string
	Run           *agentrunv1.AgentRun
}

func (Config) UploadsDir

func (in Config) UploadsDir() string

type GitPatchGenerator

type GitPatchGenerator struct {
	RepositoryDir string
	BaseCommit    string
}

func NewGitPatchGenerator

func NewGitPatchGenerator(repositoryDir string) *GitPatchGenerator

func (*GitPatchGenerator) BuildPatch

func (in *GitPatchGenerator) BuildPatch() (string, error)

func (*GitPatchGenerator) Write

func (in *GitPatchGenerator) Write(path string) (bool, error)

type PatchGenerator

type PatchGenerator interface {
	Write(path string) (bool, error)
}

type RestoredSession added in v0.6.72

type RestoredSession struct {
	Manifest   *SessionManifest
	ExtractDir string
}

RestoredSession is the result of downloading and unpacking a prior agent session archive.

func DownloadAndExtractSession added in v0.6.72

func DownloadAndExtractSession(ctx context.Context, sessionURL, workDir string) (*RestoredSession, error)

DownloadAndExtractSession downloads a gzipped session tarball from sessionURL and unpacks it into a temporary directory under workDir. The caller owns ExtractDir and should remove it when finished.

type SessionArchiveWriter

type SessionArchiveWriter interface {
	Write(path string, manifest *SessionManifest, source *SessionSource) error
}

type SessionManifest

type SessionManifest struct {
	Version    int             `json:"version"`
	AgentRunID string          `json:"agentRunId"`
	Provider   string          `json:"provider"`
	Repository string          `json:"repository"`
	Branch     string          `json:"branch,omitempty"`
	Session    SessionMetadata `json:"session"`
}

func ReadSessionManifest added in v0.6.72

func ReadSessionManifest(extractDir string) (*SessionManifest, error)

ReadSessionManifest loads manifest.json from an extracted session archive.

type SessionMetadata

type SessionMetadata struct {
	ID          string `json:"id,omitempty"`
	Path        string `json:"path,omitempty"`
	ArchivePath string `json:"archivePath,omitempty"`
}

type SessionSource

type SessionSource struct {
	Path         string
	ArchivePath  string
	ExcludeNames []string
}

type TarSessionArchiveWriter

type TarSessionArchiveWriter struct{}

func (*TarSessionArchiveWriter) Write

func (in *TarSessionArchiveWriter) Write(path string, manifest *SessionManifest, source *SessionSource) error

type UploadArtifactBuilder

type UploadArtifactBuilder interface {
	Build(ctx context.Context, opts BuildArtifactsOptions) (*UploadArtifacts, error)
}

func NewUploadArtifactBuilder

func NewUploadArtifactBuilder(config Config) UploadArtifactBuilder

type UploadArtifacts

type UploadArtifacts struct {
	SessionPath string
	PatchPath   string
}

Jump to

Keyboard shortcuts

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