Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
var TempDirBase = ""
TempDirBase is the parent under which per-session work directories are created. Tests override it via t.TempDir(); production uses os.TempDir().
Functions ¶
Types ¶
type S3Config ¶
type S3Config struct {
Endpoint string
Region string
Bucket string
AccessKeyID string
SecretAccessKey string
UseSSL bool
PathStyle bool
}
S3Config carries the S3-compatible endpoint configuration. Endpoint is host:port without scheme; UseSSL controls https vs http. PathStyle must be true for MinIO and most on-prem S3 implementations; false for AWS S3 (virtual-hosted-style is required) and most public clouds.
type S3Store ¶
type S3Store struct {
// contains filtered or unexported fields
}
S3Store is the workspace persistence backend. One instance is held by the server and shared across all turns.
func NewS3Store ¶
func (*S3Store) DownloadTarGz ¶
DownloadTarGz streams the object at key, gunzip-untars it into destDir. Returns nil if the object does not exist (treated as empty workspace). Tar entries with paths escaping destDir are skipped.
func (*S3Store) UploadTarGz ¶
UploadTarGz walks srcDir, packages it as a tar.gz, and PUTs it to the given key. The tarball is buffered in memory so minio-go can issue a single PUT request (avoids multipart for the typical small workspace payload). Symlinks are skipped. File modes are normalized to 0644 (regular) / 0755 (dir). Failures during walk are logged and the offending file is skipped; the upload still completes with whatever was packed.
type Workspace ¶
type Workspace struct {
WorkspaceID string
SessionID string
TempDir string // root: /tmp/cc-broker/sess_<sessionID>
ClaudeDir string // <TempDir>/claude-config — CLAUDE_CONFIG_DIR
ProjectDir string // <TempDir>/project — CLI cwd (kept empty; only used for proj_hash)
MemoryDir string // <ClaudeDir>/projects/ws_<wid>/memory — auto-memory override
}
Workspace is the ephemeral local filesystem view a single CC turn operates in.
func Setup ¶
Setup creates the temp directory tree and downloads the workspace's claude-home tarball from S3. The returned Workspace must be passed to Teardown so the temp directory is removed and ClaudeDir is uploaded back.
On any error after the directory tree is created, Setup removes TempDir before returning, so callers do not leak per-session directories.