Documentation
¶
Index ¶
- Constants
- func RestoreArchiveTree(ctx context.Context, extractDir, archivePath, destination string) error
- func StageSessionDirectory(ctx context.Context, source, destination string) (bool, error)
- type ArtifactBuilder
- type BuildArtifactsOptions
- type Config
- type GitPatchGenerator
- type PatchGenerator
- type RestoredSession
- type SessionArchiveWriter
- type SessionManifest
- type SessionMetadata
- type SessionSource
- type TarSessionArchiveWriter
- type UploadArtifactBuilder
- type UploadArtifacts
Constants ¶
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
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
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 ¶
func (in *ArtifactBuilder) Build(_ context.Context, opts BuildArtifactsOptions) (*UploadArtifacts, error)
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 ¶
type GitPatchGenerator ¶
func NewGitPatchGenerator ¶
func NewGitPatchGenerator(repositoryDir string) *GitPatchGenerator
func (*GitPatchGenerator) BuildPatch ¶
func (in *GitPatchGenerator) BuildPatch() (string, error)
type PatchGenerator ¶
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 SessionSource ¶
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