controlplane

package
v0.0.0-...-e3ccff7 Latest Latest
Warning

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

Go to latest
Published: May 12, 2026 License: AGPL-3.0 Imports: 51 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// BlobWriterMaxCommands is the max number of queued Redis commands per
	// pipeline flush. Mirrors workspaceFSWriteBatchEntries so both writers
	// exert similar pressure on Redis.
	BlobWriterMaxCommands = 512
	// BlobWriterMaxBytes is the max queued payload bytes per pipeline flush.
	BlobWriterMaxBytes = 8 << 20 // 8 MiB
)
View Source
const (
	ChangeSourceCheckpoint      = "checkpoint"
	ChangeSourceAgentSync       = "agent_sync"
	ChangeSourceMCP             = "mcp"
	ChangeSourceMount           = "mount"
	ChangeSourceVersionRestore  = "version_restore"
	ChangeSourceVersionUndelete = "version_undelete"
	ChangeSourceServerRestore   = "server_restore"
	ChangeSourceImport          = "import"
)

Change source tags. One value per origin so session logs can tell a live-sync FS write apart from an explicit checkpoint save, a restore, or the initial import seed.

View Source
const (
	ChangeOpPut     = "put"     // create or modify a file
	ChangeOpDelete  = "delete"  // remove a path
	ChangeOpMkdir   = "mkdir"   // create a directory
	ChangeOpRmdir   = "rmdir"   // remove a directory
	ChangeOpRename  = "rename"  // move a tracked file lineage to a new path
	ChangeOpSymlink = "symlink" // create/replace a symlink
	ChangeOpChmod   = "chmod"   // mode-only change on an existing entry
)

Change ops. Derived from manifest-entry diffs.

View Source
const (
	DiffOpCreate   = "create"
	DiffOpUpdate   = "update"
	DiffOpDelete   = "delete"
	DiffOpRename   = "rename"
	DiffOpMetadata = "metadata"
)
View Source
const (
	FileLineageStateLive    = "live"
	FileLineageStateDeleted = "deleted"
)
View Source
const (
	FileVersionKindFile      = "file"
	FileVersionKindSymlink   = "symlink"
	FileVersionKindTombstone = "tombstone"
)
View Source
const (
	MCPProfileWorkspaceRO           = "workspace-ro"
	MCPProfileWorkspaceRW           = "workspace-rw"
	MCPProfileWorkspaceRWCheckpoint = "workspace-rw-checkpoint"
	MCPProfileAdminRO               = "admin-ro"
	MCPProfileAdminRW               = "admin-rw"
)
View Source
const (
	MCPCapabilityRO           = "ro"
	MCPCapabilityRW           = "rw"
	MCPCapabilityRWCheckpoint = "rw-checkpoint"
	MCPCapabilityAdmin        = "admin"
)
View Source
const (
	// ProductModeEnvVar declares whether this control plane is the AFS Cloud
	// build or a self-hosted deployment. Affects install.sh output
	// and the /v1/auth/config response so the UI can tailor onboarding.
	ProductModeEnvVar = "AFS_PRODUCT_MODE"

	// SeedGettingStartedEnvVar controls whether a fresh self-hosted control
	// plane auto-seeds a `getting-started` workspace on first boot. Defaults
	// to "1" in self-hosted mode, "0" in cloud. Operators can override either
	// way by setting the variable explicitly.
	SeedGettingStartedEnvVar = "AFS_SEED_GETTING_STARTED"

	ProductModeCloud      = "cloud"
	ProductModeSelfHosted = "self-hosted"
)
View Source
const (
	SourceBlank       = sourceBlank
	SourceGitImport   = sourceGitImport
	SourceCloudImport = sourceCloudImport
)
View Source
const (
	FormatVersion         = formatVersion
	InlineThreshold       = inlineThreshold
	InitialCheckpointName = initialCheckpointName
)
View Source
const (
	CheckpointKindManual = "manual"
	CheckpointKindImport = "import"
	CheckpointKindFork   = "fork"
	CheckpointKindSafety = "safety"
	CheckpointKindSystem = "system"
)
View Source
const (
	CheckpointSourceCLI        = "cli"
	CheckpointSourceImport     = "import"
	CheckpointSourceMCP        = "mcp"
	CheckpointSourceServer     = "server"
	CheckpointSourceQuickstart = "quickstart"
)
View Source
const (
	WorkspaceVersioningModeOff   = "off"
	WorkspaceVersioningModeAll   = "all"
	WorkspaceVersioningModePaths = "paths"
)
View Source
const (
	WorkspaceQueryChunkStrategyAuto  = "auto"
	WorkspaceQueryChunkStrategyRegex = "regex"
)
View Source
const AgentIDHeader = "X-AFS-Agent-Id"

AgentIDHeader is the optional HTTP header carrying a stable caller identity for hosted or custom agent clients that cannot persist CLI config.

View Source
const SessionIDHeader = "X-AFS-Session-Id"

SessionIDHeader is the HTTP header carrying the current session identity from the agent CLI to the control plane.

Variables

View Source
var ErrAmbiguousDatabase = errors.New("control plane database is ambiguous")
View Source
var ErrAmbiguousWorkspace = errors.New("control plane workspace is ambiguous")
View Source
var ErrCLIAccessTokenInvalid = errors.New("cli access token is invalid or expired")
View Source
var ErrForbidden = fmt.Errorf("forbidden")
View Source
var ErrFreeTierLimitReached = errors.New("free tier workspace limit reached")

ErrFreeTierLimitReached is returned when a user attempts to create a workspace on the shared onboarding database after reaching their free tier quota.

View Source
var ErrImportInProgress = errors.New("workspace import in progress")

ErrImportInProgress is returned when a workspace is currently being imported and another operation (mount, fork, checkpoint, create) attempts to touch it.

View Source
var ErrMCPAccessTokenInvalid = errors.New("mcp access token is invalid or expired")
View Source
var ErrOnboardingTokenInvalid = errors.New("onboarding token is invalid or expired")
View Source
var ErrUnauthorized = fmt.Errorf("authentication required")
View Source
var ErrUnsupportedView = errors.New("control plane operation is not available for this workspace view")
View Source
var ErrWorkspaceConflict = errors.New("control plane workspace conflict")

Functions

func BlobKey

func BlobKey(workspace, blobID string) string

func BlobRefKey

func BlobRefKey(workspace, blobID string) string

func ChangelogStreamKey

func ChangelogStreamKey(workspace string) string

Exported for tests and internal readers.

func CheckImportLock

func CheckImportLock(ctx context.Context, store *Store, workspace string) error

CheckImportLock returns ErrImportInProgress if the workspace currently has an active import lock. It is a read-only EXISTS check.

func EnsureWorkspaceRoot

func EnsureWorkspaceRoot(ctx context.Context, store *Store, workspace string) (string, string, bool, error)

func HashManifest

func HashManifest(m Manifest) (string, error)

func ImportLockKey

func ImportLockKey(workspace string) string

ImportLockKey returns the Redis key used for the workspace import lock.

func MCPCapabilityFromProfile

func MCPCapabilityFromProfile(profile string) string

func MCPProfileAllowsTool

func MCPProfileAllowsTool(profile, tool string) bool

func MCPProfileFromCapability

func MCPProfileFromCapability(scope, capability string) string

func MCPProfileIncludesCheckpoint

func MCPProfileIncludesCheckpoint(profile string) bool

func MCPProfileIsReadonly

func MCPProfileIsReadonly(profile string) bool

func MCPProfileIsWorkspaceBound

func MCPProfileIsWorkspaceBound(profile string) bool

func ManifestBlobRefs

func ManifestBlobRefs(m Manifest) map[string]int64

func ManifestEntryData

func ManifestEntryData(entry ManifestEntry, fetchBlob func(blobID string) ([]byte, error)) ([]byte, error)

func ManifestEquivalent

func ManifestEquivalent(a, b Manifest) bool

func MarkWorkspaceRootClean

func MarkWorkspaceRootClean(ctx context.Context, store *Store, workspace, headSavepoint string) error

func MarkWorkspaceRootDirty

func MarkWorkspaceRootDirty(ctx context.Context, store *Store, workspace string) error

func NewAdminHandler

func NewAdminHandler(manager *DatabaseManager, allowOrigin string) http.Handler

func NewAdminHandlerWithOptions

func NewAdminHandlerWithOptions(manager *DatabaseManager, opts HandlerOptions) http.Handler

func NewClientHandler

func NewClientHandler(manager *DatabaseManager, allowOrigin string) http.Handler

func NewHandler

func NewHandler(manager *DatabaseManager, allowOrigin string) http.Handler

func NewHandlerWithOptions

func NewHandlerWithOptions(manager *DatabaseManager, opts HandlerOptions) http.Handler

func NewMountVersionObserver

func NewMountVersionObserver(rdb *redis.Client) afsclient.MutationObserver

func NewRedisClient

func NewRedisClient(cfg Config, poolSize int) *redis.Client

func NormalizeMCPCapability

func NormalizeMCPCapability(raw string) (string, error)

func NormalizeMCPProfile

func NormalizeMCPProfile(raw string) (string, error)

func PathLastKey

func PathLastKey(workspace, path string) string

func ProductModeFromEnv

func ProductModeFromEnv() string

ProductModeFromEnv returns the declared product mode. Defaults to "self-hosted" — the cloud deployment must opt in explicitly.

func SavepointManifestKey

func SavepointManifestKey(workspace, savepoint string) string

func SavepointMetaKey

func SavepointMetaKey(workspace, savepoint string) string

func SemanticQueryDisabledMessage

func SemanticQueryDisabledMessage(workspace string) string

func SemanticQueryUnavailableMessage

func SemanticQueryUnavailableMessage(workspace string) string

func SessionSummaryKey

func SessionSummaryKey(workspace, sessionID string) string

func ShouldSeedGettingStarted

func ShouldSeedGettingStarted() bool

ShouldSeedGettingStarted reports whether boot-time seeding of a `getting-started` workspace is enabled. An explicit value of the env var takes precedence; otherwise defaults to true for self-hosted mode and false for cloud.

func SyncWorkspaceRoot

func SyncWorkspaceRoot(ctx context.Context, store *Store, workspace string, m Manifest) error

func SyncWorkspaceRootWithOptions

func SyncWorkspaceRootWithOptions(ctx context.Context, store *Store, workspace string, m Manifest, opts SyncOptions) error

SyncWorkspaceRootWithOptions materializes a manifest into the live workspace FS namespace. Callers that have already loaded file bodies (e.g., during import) can pass a BlobProvider to avoid reloading them from Redis.

func ValidateName

func ValidateName(kind, value string) error

func ValidateWorkspaceConfig

func ValidateWorkspaceConfig(cfg WorkspaceConfig) error

func ValidateWorkspaceVersioningPolicy

func ValidateWorkspaceVersioningPolicy(policy WorkspaceVersioningPolicy) error

func WithChangeSessionContext

func WithChangeSessionContext(ctx context.Context, sc ChangeSessionContext) context.Context

WithChangeSessionContext returns a new context carrying the given session context. HTTP handlers attach this after parsing the X-AFS-Session-Id header; service-layer code reads it at apply time.

func WorkspaceAuditKey

func WorkspaceAuditKey(workspace string) string

func WorkspaceConfigKey

func WorkspaceConfigKey(workspace string) string

func WorkspaceEventsKey

func WorkspaceEventsKey(workspace string) string

func WorkspaceFSKey

func WorkspaceFSKey(workspace string) string

func WorkspaceMetaKey

func WorkspaceMetaKey(workspace string) string

func WorkspacePattern

func WorkspacePattern(workspace string) string

func WorkspaceRootDirtyKey

func WorkspaceRootDirtyKey(workspace string) string

func WorkspaceRootDirtyState

func WorkspaceRootDirtyState(ctx context.Context, store *Store, workspace string) (dirty bool, known bool, err error)

func WorkspaceSavepointsKey

func WorkspaceSavepointsKey(workspace string) string

func WorkspaceSource

func WorkspaceSource(meta WorkspaceMeta) string

func WorkspaceStorageID

func WorkspaceStorageID(meta WorkspaceMeta) string

WorkspaceStorageID returns the identifier used as the `{hashtag}` portion of every Redis key for this workspace. Prefers the opaque ID (set by the server for multi-tenant workspaces) and falls back to the name (legacy local-mode workspaces that never had an opaque ID assigned).

func WorkspaceTags

func WorkspaceTags(region, source string) []string

func WorkspaceVersioningPolicyKey

func WorkspaceVersioningPolicyKey(workspace string) string

func WorkspaceVersioningPolicyTracksPath

func WorkspaceVersioningPolicyTracksPath(policy WorkspaceVersioningPolicy, rawPath string) (bool, error)

func WriteChangeEntries

func WriteChangeEntries(ctx context.Context, rdb redis.Cmdable, storageID string, entries []ChangeEntry)

WriteChangeEntries is the exported non-transactional write path. Used by clients that hold a Redis connection directly (e.g. the sync daemon's uploader goroutine in cmd/afs) and by in-package import paths. Failures are logged but do NOT surface to the caller — observability must not block correctness.

Types

type ActivityEvent

type ActivityEvent = activityEvent

type ActivityListRequest

type ActivityListRequest = activityListRequest

type ActivityListResponse

type ActivityListResponse = activityListResponse

type AuditRecord

type AuditRecord = auditRecord

type AuthConfig

type AuthConfig struct {
	Mode                AuthMode
	TrustedUserHeader   string
	TrustedNameHeader   string
	TrustedEmailHeader  string
	TrustedGroupsHeader string
	ClerkSecretKey      string
	ClerkPublishableKey string
	ClerkJWTKey         string
	ClerkProxyURL       string
}

func DefaultAuthConfig

func DefaultAuthConfig() AuthConfig

func LoadAuthConfigFromEnv

func LoadAuthConfigFromEnv() (AuthConfig, error)

type AuthHandler

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

func LoadAuthHandlerFromEnv

func LoadAuthHandlerFromEnv() (*AuthHandler, error)

func NewAuthHandler

func NewAuthHandler(cfg AuthConfig) (*AuthHandler, error)

func NewNoAuthHandler

func NewNoAuthHandler() *AuthHandler

func (*AuthHandler) AttachCLITokenAuthenticator

func (a *AuthHandler) AttachCLITokenAuthenticator(authenticate func(context.Context, string) (*AuthIdentity, error))

func (*AuthHandler) AttachMCPTokenAuthenticator

func (a *AuthHandler) AttachMCPTokenAuthenticator(authenticate func(context.Context, string) (*AuthIdentity, error))

func (*AuthHandler) CanDeleteIdentity

func (a *AuthHandler) CanDeleteIdentity() bool

func (*AuthHandler) DeleteCurrentIdentity

func (a *AuthHandler) DeleteCurrentIdentity(ctx context.Context) error

func (*AuthHandler) Middleware

func (a *AuthHandler) Middleware(next http.Handler) http.Handler

func (*AuthHandler) RuntimeConfig

func (a *AuthHandler) RuntimeConfig(r *http.Request) authRuntimeConfigResponse

type AuthIdentity

type AuthIdentity struct {
	Subject  string
	Name     string
	Email    string
	Groups   []string
	Provider string
	TokenID  string
	// Scope carries the token scope on token-authenticated requests:
	//   "account"                  for account/org-scoped CLI tokens,
	//   "workspace:<workspace-id>" for workspace-bound CLI/MCP tokens,
	//   "control-plane"            for user-scoped control-plane MCP tokens,
	//   ""                         for non-token auth paths.
	Scope             string
	Capability        string
	ScopedDatabaseID  string
	ScopedWorkspaceID string
	ScopedWorkspace   string
	MCPProfile        string
	Readonly          bool
	// WorkspaceMountCapabilities is set for workspace-scoped MCP tokens and
	// Agent Workspace-scoped CLI tokens. It maps volume_id → capability
	// (ro/rw/rw-checkpoint or mount-ro/mount-rw) for the volumes mounted in the
	// bound Agent Workspace composition. The MCP server and CLI HTTP middleware
	// use this map to enforce per-mount access.
	WorkspaceMountCapabilities map[string]string
}

func AuthIdentityFromContext

func AuthIdentityFromContext(ctx context.Context) (AuthIdentity, bool)

type AuthMode

type AuthMode string
const (
	AuthModeNone          AuthMode = "none"
	AuthModeTrustedHeader AuthMode = "trusted-header"
	AuthModeClerk         AuthMode = "clerk"
)

type BlobRef

type BlobRef = blobRef

type BlobStats

type BlobStats struct {
	Count int
	Bytes int64
}

type BlobWriter

type BlobWriter struct {
	FlushMaxCommands int
	FlushMaxBytes    int64
	// contains filtered or unexported fields
}

BlobWriter pipelines blob and blob-ref writes to Redis, flushing on byte or command-count thresholds. It is safe for a single goroutine to call Submit sequentially; multiple producers must serialize externally or use a mutex.

On a fresh import every blob reference is brand new (ref count 1 with no prior record), so BlobWriter does not read existing refs before writing, which cuts the Redis round trips in half.

func NewBlobWriter

func NewBlobWriter(rdb redis.Cmdable, workspace string, createdAt time.Time) *BlobWriter

NewBlobWriter returns a BlobWriter that writes into the given workspace. The `rdb` argument can be either a *redis.Client or a redis.Pipeliner from an enclosing transaction.

func (*BlobWriter) Flush

func (w *BlobWriter) Flush(ctx context.Context) error

Flush drains any queued commands to Redis. Must be called before the import is considered complete.

func (*BlobWriter) Submit

func (w *BlobWriter) Submit(ctx context.Context, blobID string, data []byte, size int64) error

Submit queues a blob body and its ref-count record for writing. Duplicate blob IDs submitted during the lifetime of the writer are silently deduped: the second submission is a no-op (the first copy is assumed to be identical since blob IDs are content hashes).

func (*BlobWriter) Totals

func (w *BlobWriter) Totals() (int64, int64)

Totals returns the cumulative number of unique blobs written and their total byte size.

type ChangeEntry

type ChangeEntry struct {
	SessionID    string // session that caused the change; empty for server-initiated ops
	AgentID      string // stable agent identity across multiple sessions; optional
	User         string // authenticated principal (Clerk user, CLI token owner); optional
	Label        string // human-readable session label; optional
	AgentVersion string // client afs version; optional
	Op           string // one of ChangeOp*
	Path         string // workspace-relative path
	PrevPath     string // set on renames
	SizeBytes    int64  // final size after op
	DeltaBytes   int64  // signed change in size vs previous state
	ContentHash  string // post-op blob hash or manifest-entry hash proxy
	PrevHash     string // pre-op blob hash
	Mode         uint32 // final mode bits
	FileID       string // exact versioned-file lineage id when available
	VersionID    string // exact file version id produced by the operation when available
	CheckpointID string // set when op was part of a checkpoint save
	Source       string // one of ChangeSource*
}

ChangeEntry is a single row in the workspace changelog stream. Fields with empty/zero values are elided at write time to keep stream entries compact.

type ChangeSessionContext

type ChangeSessionContext struct {
	SessionID string
}

ChangeSessionContext carries the session-identity bits used to tag changelog entries emitted by the current request.

func ChangeSessionContextFromContext

func ChangeSessionContextFromContext(ctx context.Context) (ChangeSessionContext, bool)

ChangeSessionContextFromContext extracts the session context if one was attached. Returns a zero value and false otherwise.

type ChangelogEntryRow

type ChangelogEntryRow struct {
	ID            string `json:"id"`
	OccurredAt    string `json:"occurred_at,omitempty"`
	WorkspaceID   string `json:"workspace_id,omitempty"`
	WorkspaceName string `json:"workspace_name,omitempty"`
	DatabaseID    string `json:"database_id,omitempty"`
	DatabaseName  string `json:"database_name,omitempty"`
	SessionID     string `json:"session_id,omitempty"`
	AgentID       string `json:"agent_id,omitempty"`
	User          string `json:"user,omitempty"`
	Label         string `json:"label,omitempty"`
	AgentVersion  string `json:"agent_version,omitempty"`
	Op            string `json:"op"`
	Path          string `json:"path"`
	PrevPath      string `json:"prev_path,omitempty"`
	SizeBytes     int64  `json:"size_bytes,omitempty"`
	DeltaBytes    int64  `json:"delta_bytes,omitempty"`
	ContentHash   string `json:"content_hash,omitempty"`
	PrevHash      string `json:"prev_hash,omitempty"`
	Mode          uint32 `json:"mode,omitempty"`
	FileID        string `json:"file_id,omitempty"`
	VersionID     string `json:"version_id,omitempty"`
	CheckpointID  string `json:"checkpoint_id,omitempty"`
	Source        string `json:"source,omitempty"`
}

ChangelogEntryRow is the wire shape of one stream entry. Fields mirror the ChangeEntry with the addition of an ID (Redis stream entry ID) and occurred_at timestamp parsed from the ts_ms field.

type ChangelogListRequest

type ChangelogListRequest struct {
	SessionID string // if set, entries are filtered to this session
	Path      string // if set, entries are filtered to this path or prev_path
	Since     string // entry ID to read after (exclusive) — start of the range
	Until     string // entry ID to read up to (exclusive) — end of the range
	Limit     int    // hard cap on entries returned; default 100, max 1000
	Reverse   bool   // if true, read newest-first via XREVRANGE
}

ChangelogListRequest parameterizes a changelog read. All fields optional.

type ChangelogListResponse

type ChangelogListResponse struct {
	Entries    []ChangelogEntryRow `json:"entries"`
	NextCursor string              `json:"next_cursor,omitempty"`
}

ChangelogListResponse wraps a page of changelog entries.

type CheckpointDetail

type CheckpointDetail = checkpointDetail

type CheckpointSummary

type CheckpointSummary = checkpointSummary

type Config

type Config struct {
	RedisConfig `json:"redis"`
}

func LoadConfig

func LoadConfig(configPathOverride string) (Config, error)

func LoadConfigWithPresence

func LoadConfigWithPresence(configPathOverride string) (Config, bool, error)

type CreateWorkspaceBookmarkRequest

type CreateWorkspaceBookmarkRequest = createWorkspaceBookmarkRequest

type CreateWorkspaceCompositionRequest

type CreateWorkspaceCompositionRequest = createWorkspaceCompositionRequest

type CreateWorkspaceRequest

type CreateWorkspaceRequest = createWorkspaceRequest

type CreateWorkspaceSessionRequest

type CreateWorkspaceSessionRequest = createWorkspaceSessionRequest

type DatabaseListResponse

type DatabaseListResponse = databaseListResponse

type DatabaseManager

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

func OpenDatabaseManager

func OpenDatabaseManager(configPathOverride string) (*DatabaseManager, error)

func (*DatabaseManager) Account

func (m *DatabaseManager) Account(ctx context.Context) (accountResponse, error)

func (*DatabaseManager) AddResolvedWorkspaceCompositionMount

func (m *DatabaseManager) AddResolvedWorkspaceCompositionMount(ctx context.Context, workspace string, mount workspaceCompositionMount) (workspaceCompositionDetail, error)

func (*DatabaseManager) AdminAgents

func (m *DatabaseManager) AdminAgents(ctx context.Context) (workspaceSessionListResponse, error)

func (*DatabaseManager) AdminDatabases

func (m *DatabaseManager) AdminDatabases(ctx context.Context) (databaseListResponse, error)

func (*DatabaseManager) AdminOverview

func (m *DatabaseManager) AdminOverview(ctx context.Context) (adminOverviewResponse, error)

func (*DatabaseManager) AdminUsers

func (m *DatabaseManager) AdminUsers(ctx context.Context) (adminUserListResponse, error)

func (*DatabaseManager) AdminWorkspaces

func (m *DatabaseManager) AdminWorkspaces(ctx context.Context) (workspaceListResponse, error)

func (*DatabaseManager) AuthenticateCLIAccessToken

func (m *DatabaseManager) AuthenticateCLIAccessToken(ctx context.Context, rawToken string) (cliAccessTokenRecord, error)

func (*DatabaseManager) AuthenticateMCPAccessToken

func (m *DatabaseManager) AuthenticateMCPAccessToken(ctx context.Context, rawToken string) (mcpAccessTokenRecord, error)

func (*DatabaseManager) CatalogHealth

func (m *DatabaseManager) CatalogHealth(ctx context.Context) (catalogHealthResponse, error)

func (*DatabaseManager) CleanQueryIndex

func (m *DatabaseManager) CleanQueryIndex(ctx context.Context, databaseID, workspace string, request WorkspaceQueryIndexCleanRequest) (WorkspaceQueryIndexCleanResponse, error)

func (*DatabaseManager) CleanResolvedQueryIndex

func (m *DatabaseManager) CleanResolvedQueryIndex(ctx context.Context, workspace string, request WorkspaceQueryIndexCleanRequest) (WorkspaceQueryIndexCleanResponse, error)

func (*DatabaseManager) Close

func (m *DatabaseManager) Close()

func (*DatabaseManager) CloseResolvedWorkspaceSession

func (m *DatabaseManager) CloseResolvedWorkspaceSession(ctx context.Context, workspace, sessionID string) error

func (*DatabaseManager) CloseWorkspaceSession

func (m *DatabaseManager) CloseWorkspaceSession(ctx context.Context, databaseID, workspace, sessionID string) error

func (*DatabaseManager) CreateControlPlaneMCPAccessToken

func (m *DatabaseManager) CreateControlPlaneMCPAccessToken(ctx context.Context, input createControlPlaneTokenRequest) (mcpAccessTokenResponse, error)

CreateControlPlaneMCPAccessToken issues a user-scoped control-plane token with no workspace binding. In auth-enabled deployments the token is bound to the caller's subject; in self-hosted no-auth mode the owner fields are left empty and anyone with access to the control plane can use/revoke the token.

func (*DatabaseManager) CreateMCPAccessToken

func (m *DatabaseManager) CreateMCPAccessToken(ctx context.Context, databaseID, workspace string, input createMCPAccessTokenRequest) (mcpAccessTokenResponse, error)

func (*DatabaseManager) CreateOnboardingToken

func (m *DatabaseManager) CreateOnboardingToken(ctx context.Context, databaseID, workspace string) (onboardingTokenResponse, error)

func (*DatabaseManager) CreateResolvedMCPAccessToken

func (m *DatabaseManager) CreateResolvedMCPAccessToken(ctx context.Context, workspace string, input createMCPAccessTokenRequest) (mcpAccessTokenResponse, error)

func (*DatabaseManager) CreateResolvedOnboardingToken

func (m *DatabaseManager) CreateResolvedOnboardingToken(ctx context.Context, workspace string) (onboardingTokenResponse, error)

func (*DatabaseManager) CreateResolvedWorkspace

func (m *DatabaseManager) CreateResolvedWorkspace(ctx context.Context, input createWorkspaceRequest) (workspaceDetail, error)

func (*DatabaseManager) CreateResolvedWorkspaceBookmark

func (m *DatabaseManager) CreateResolvedWorkspaceBookmark(ctx context.Context, workspace string, input createWorkspaceBookmarkRequest) (workspaceBookmark, error)

func (*DatabaseManager) CreateResolvedWorkspaceCLIAccessToken

func (m *DatabaseManager) CreateResolvedWorkspaceCLIAccessToken(ctx context.Context, workspace string, input createCLIAccessTokenRequest) (cliAccessTokenResponse, error)

func (*DatabaseManager) CreateResolvedWorkspaceComposition

func (m *DatabaseManager) CreateResolvedWorkspaceComposition(ctx context.Context, input createWorkspaceCompositionRequest) (workspaceCompositionDetail, error)

func (*DatabaseManager) CreateResolvedWorkspaceCompositionAPIKey

func (m *DatabaseManager) CreateResolvedWorkspaceCompositionAPIKey(ctx context.Context, workspace string, input createMCPAccessTokenRequest) (mcpAccessTokenResponse, error)

CreateResolvedWorkspaceCompositionAPIKey mints an MCP token scoped to an Agent Workspace composition. The token's scope is `workspace:<compositionId>` and works for both the MCP server and the CLI HTTP API. Per-mount capabilities are validated against the composition manifest: every MountCapability must reference a volume that's currently mounted in the composition. If MountCapabilities is empty the manager populates it from the composition's manifest using the top-level Capability as the default (and `ro` for any mount already flagged readonly).

func (*DatabaseManager) CreateResolvedWorkspaceCompositionCLIAccessToken

func (m *DatabaseManager) CreateResolvedWorkspaceCompositionCLIAccessToken(ctx context.Context, workspace string, input createCLIAccessTokenRequest) (cliAccessTokenResponse, error)

func (*DatabaseManager) CreateResolvedWorkspaceSession

func (m *DatabaseManager) CreateResolvedWorkspaceSession(ctx context.Context, workspace string, input createWorkspaceSessionRequest) (workspaceSession, error)

func (*DatabaseManager) CreateWorkspace

func (m *DatabaseManager) CreateWorkspace(ctx context.Context, databaseID string, input createWorkspaceRequest) (workspaceDetail, error)

func (*DatabaseManager) CreateWorkspaceCLIAccessToken

func (m *DatabaseManager) CreateWorkspaceCLIAccessToken(ctx context.Context, databaseID, workspace string, input createCLIAccessTokenRequest) (cliAccessTokenResponse, error)

func (*DatabaseManager) CreateWorkspaceComposition

func (m *DatabaseManager) CreateWorkspaceComposition(ctx context.Context, databaseID string, input createWorkspaceCompositionRequest) (workspaceCompositionDetail, error)

func (*DatabaseManager) CreateWorkspaceSession

func (m *DatabaseManager) CreateWorkspaceSession(ctx context.Context, databaseID, workspace string, input createWorkspaceSessionRequest) (workspaceSession, error)

func (*DatabaseManager) DeleteDatabase

func (m *DatabaseManager) DeleteDatabase(id string) error

func (*DatabaseManager) DeleteDatabaseWithContext

func (m *DatabaseManager) DeleteDatabaseWithContext(ctx context.Context, id string) error

func (*DatabaseManager) DeleteResolvedWorkspace

func (m *DatabaseManager) DeleteResolvedWorkspace(ctx context.Context, workspace string) error

func (*DatabaseManager) DeleteResolvedWorkspaceComposition

func (m *DatabaseManager) DeleteResolvedWorkspaceComposition(ctx context.Context, workspace string) error

func (*DatabaseManager) DeleteWorkspace

func (m *DatabaseManager) DeleteWorkspace(ctx context.Context, databaseID, workspace string) error

func (*DatabaseManager) DiffFileVersions

func (m *DatabaseManager) DiffFileVersions(ctx context.Context, databaseID, workspace, rawPath string, from, to FileVersionDiffOperand) (FileVersionDiffResponse, error)

func (*DatabaseManager) DiffResolvedFileVersions

func (m *DatabaseManager) DiffResolvedFileVersions(ctx context.Context, workspace, rawPath string, from, to FileVersionDiffOperand) (FileVersionDiffResponse, error)

func (*DatabaseManager) DiffResolvedWorkspace

func (m *DatabaseManager) DiffResolvedWorkspace(ctx context.Context, workspace, baseView, headView string) (WorkspaceDiffResponse, error)

func (*DatabaseManager) DiffWorkspace

func (m *DatabaseManager) DiffWorkspace(ctx context.Context, databaseID, workspace, baseView, headView string) (WorkspaceDiffResponse, error)

func (*DatabaseManager) DownloadQueryModel

func (*DatabaseManager) ExchangeOnboardingToken

func (m *DatabaseManager) ExchangeOnboardingToken(ctx context.Context, token string) (onboardingExchangeResponse, error)

func (*DatabaseManager) ForkResolvedWorkspace

func (m *DatabaseManager) ForkResolvedWorkspace(ctx context.Context, sourceWorkspace, newWorkspace string) error

func (*DatabaseManager) ForkWorkspace

func (m *DatabaseManager) ForkWorkspace(ctx context.Context, databaseID, sourceWorkspace, newWorkspace string) error

func (*DatabaseManager) GetCheckpoint

func (m *DatabaseManager) GetCheckpoint(ctx context.Context, databaseID, workspace, checkpointID string) (checkpointDetail, error)

func (*DatabaseManager) GetFileContent

func (m *DatabaseManager) GetFileContent(ctx context.Context, databaseID, workspace, rawView, rawPath string) (fileContentResponse, error)

func (*DatabaseManager) GetFileHistory

func (m *DatabaseManager) GetFileHistory(ctx context.Context, databaseID, workspace, rawPath string, newestFirst bool) (FileHistoryResponse, error)

func (*DatabaseManager) GetFileHistoryPage

func (m *DatabaseManager) GetFileHistoryPage(ctx context.Context, databaseID, workspace string, req FileHistoryRequest) (FileHistoryResponse, error)

func (*DatabaseManager) GetFileVersionContent

func (m *DatabaseManager) GetFileVersionContent(ctx context.Context, databaseID, workspace, versionID string) (FileVersionContentResponse, error)

func (*DatabaseManager) GetFileVersionContentAtOrdinal

func (m *DatabaseManager) GetFileVersionContentAtOrdinal(ctx context.Context, databaseID, workspace, fileID string, ordinal int64) (FileVersionContentResponse, error)

func (*DatabaseManager) GetPathLastWriter

func (m *DatabaseManager) GetPathLastWriter(ctx context.Context, databaseID, workspace, path string) (PathLastWriter, error)

GetPathLastWriter returns the last-writer metadata for a single path.

func (*DatabaseManager) GetResolvedCheckpoint

func (m *DatabaseManager) GetResolvedCheckpoint(ctx context.Context, workspace, checkpointID string) (checkpointDetail, error)

func (*DatabaseManager) GetResolvedFileContent

func (m *DatabaseManager) GetResolvedFileContent(ctx context.Context, workspace, rawView, rawPath string) (fileContentResponse, error)

func (*DatabaseManager) GetResolvedFileHistory

func (m *DatabaseManager) GetResolvedFileHistory(ctx context.Context, workspace, rawPath string, newestFirst bool) (FileHistoryResponse, error)

func (*DatabaseManager) GetResolvedFileHistoryPage

func (m *DatabaseManager) GetResolvedFileHistoryPage(ctx context.Context, workspace string, req FileHistoryRequest) (FileHistoryResponse, error)

func (*DatabaseManager) GetResolvedFileVersionContent

func (m *DatabaseManager) GetResolvedFileVersionContent(ctx context.Context, workspace, versionID string) (FileVersionContentResponse, error)

func (*DatabaseManager) GetResolvedFileVersionContentAtOrdinal

func (m *DatabaseManager) GetResolvedFileVersionContentAtOrdinal(ctx context.Context, workspace, fileID string, ordinal int64) (FileVersionContentResponse, error)

func (*DatabaseManager) GetResolvedPathLastWriter

func (m *DatabaseManager) GetResolvedPathLastWriter(ctx context.Context, workspace, path string) (PathLastWriter, error)

func (*DatabaseManager) GetResolvedSessionChangelogSummary

func (m *DatabaseManager) GetResolvedSessionChangelogSummary(ctx context.Context, workspace, sessionID string) (SessionChangelogSummary, error)

func (*DatabaseManager) GetResolvedTree

func (m *DatabaseManager) GetResolvedTree(ctx context.Context, workspace, rawView, rawPath string, depth int) (treeResponse, error)

func (*DatabaseManager) GetResolvedWorkspace

func (m *DatabaseManager) GetResolvedWorkspace(ctx context.Context, workspace string) (workspaceDetail, error)

func (*DatabaseManager) GetResolvedWorkspaceComposition

func (m *DatabaseManager) GetResolvedWorkspaceComposition(ctx context.Context, workspace string) (workspaceCompositionDetail, error)

func (*DatabaseManager) GetResolvedWorkspaceConfig

func (m *DatabaseManager) GetResolvedWorkspaceConfig(ctx context.Context, workspace string) (WorkspaceConfig, error)

func (*DatabaseManager) GetResolvedWorkspaceVersioningPolicy

func (m *DatabaseManager) GetResolvedWorkspaceVersioningPolicy(ctx context.Context, workspace string) (WorkspaceVersioningPolicy, error)

func (*DatabaseManager) GetSessionChangelogSummary

func (m *DatabaseManager) GetSessionChangelogSummary(ctx context.Context, databaseID, workspace, sessionID string) (SessionChangelogSummary, error)

GetSessionChangelogSummary returns the per-session rollup (op counts, delta bytes).

func (*DatabaseManager) GetTree

func (m *DatabaseManager) GetTree(ctx context.Context, databaseID, workspace, rawView, rawPath string, depth int) (treeResponse, error)

func (*DatabaseManager) GetWorkspace

func (m *DatabaseManager) GetWorkspace(ctx context.Context, databaseID, workspace string) (workspaceDetail, error)

func (*DatabaseManager) GetWorkspaceConfig

func (m *DatabaseManager) GetWorkspaceConfig(ctx context.Context, databaseID, workspace string) (WorkspaceConfig, error)

func (*DatabaseManager) GetWorkspaceVersioningPolicy

func (m *DatabaseManager) GetWorkspaceVersioningPolicy(ctx context.Context, databaseID, workspace string) (WorkspaceVersioningPolicy, error)

func (*DatabaseManager) HeartbeatResolvedWorkspaceSession

func (m *DatabaseManager) HeartbeatResolvedWorkspaceSession(ctx context.Context, workspace, sessionID string, input ...createWorkspaceSessionRequest) (workspaceSessionInfo, error)

func (*DatabaseManager) HeartbeatWorkspaceSession

func (m *DatabaseManager) HeartbeatWorkspaceSession(ctx context.Context, databaseID, workspace, sessionID string, input ...createWorkspaceSessionRequest) (workspaceSessionInfo, error)

func (*DatabaseManager) ImportLocal

func (m *DatabaseManager) ImportLocal(ctx context.Context, databaseID string, input ImportLocalRequest) (ImportLocalResponse, error)

ImportLocal creates a workspace from a directory on the local filesystem. It mirrors the behaviour of `afs ws import` but runs via the HTTP API.

func (*DatabaseManager) ImportResolvedLocal

func (m *DatabaseManager) ImportResolvedLocal(ctx context.Context, input ImportLocalRequest) (ImportLocalResponse, error)

func (*DatabaseManager) ImportResolvedWorkspace

func (m *DatabaseManager) ImportResolvedWorkspace(ctx context.Context, input ImportWorkspaceRequest) (ImportWorkspaceResponse, error)

func (*DatabaseManager) ImportWorkspace

func (m *DatabaseManager) ImportWorkspace(ctx context.Context, databaseID string, input ImportWorkspaceRequest) (ImportWorkspaceResponse, error)

ImportWorkspace creates a workspace from a client-uploaded manifest and blob payload through the scoped database manager API.

func (*DatabaseManager) ListAgentSessions

func (m *DatabaseManager) ListAgentSessions(ctx context.Context, databaseID string) (workspaceSessionListResponse, error)

func (*DatabaseManager) ListAllActivity

func (m *DatabaseManager) ListAllActivity(ctx context.Context, req activityListRequest) (activityListResponse, error)

func (*DatabaseManager) ListAllCLIAccessTokens

func (m *DatabaseManager) ListAllCLIAccessTokens(ctx context.Context) ([]cliAccessTokenResponse, error)

ListAllCLIAccessTokens returns every active CLI access token owned by the caller's subject. Mirrors the MCP token list shape so the dashboard can merge both into one view.

func (*DatabaseManager) ListAllChangelog

func (*DatabaseManager) ListAllEvents

func (*DatabaseManager) ListAllMCPAccessTokens

func (m *DatabaseManager) ListAllMCPAccessTokens(ctx context.Context) ([]mcpAccessTokenResponse, error)

func (*DatabaseManager) ListAllWorkspaceCompositions

func (m *DatabaseManager) ListAllWorkspaceCompositions(ctx context.Context) (workspaceCompositionListResponse, error)

func (*DatabaseManager) ListAllWorkspaceSummaries

func (m *DatabaseManager) ListAllWorkspaceSummaries(ctx context.Context) (workspaceListResponse, error)

func (*DatabaseManager) ListChangelog

func (m *DatabaseManager) ListChangelog(ctx context.Context, databaseID, workspace string, req ChangelogListRequest) (ChangelogListResponse, error)

ListChangelog reads per-session file-change entries for a workspace.

func (*DatabaseManager) ListCheckpoints

func (m *DatabaseManager) ListCheckpoints(ctx context.Context, databaseID, workspace string, limit int) ([]checkpointSummary, error)

func (*DatabaseManager) ListControlPlaneMCPAccessTokens

func (m *DatabaseManager) ListControlPlaneMCPAccessTokens(ctx context.Context) ([]mcpAccessTokenResponse, error)

ListControlPlaneMCPAccessTokens returns every control-plane token owned by the caller. Requires an authenticated subject.

func (*DatabaseManager) ListDatabases

func (m *DatabaseManager) ListDatabases(ctx context.Context) (databaseListResponse, error)

func (*DatabaseManager) ListGlobalActivity

func (m *DatabaseManager) ListGlobalActivity(ctx context.Context, databaseID string, req activityListRequest) (activityListResponse, error)

func (*DatabaseManager) ListGlobalChangelog

func (m *DatabaseManager) ListGlobalChangelog(ctx context.Context, databaseID string, req ChangelogListRequest) (ChangelogListResponse, error)

func (*DatabaseManager) ListGlobalEvents

func (m *DatabaseManager) ListGlobalEvents(ctx context.Context, databaseID string, req EventListRequest) (EventListResponse, error)

func (*DatabaseManager) ListMCPAccessTokens

func (m *DatabaseManager) ListMCPAccessTokens(ctx context.Context, databaseID, workspace string) ([]mcpAccessTokenResponse, error)

func (*DatabaseManager) ListResolvedChangelog

func (m *DatabaseManager) ListResolvedChangelog(ctx context.Context, workspace string, req ChangelogListRequest) (ChangelogListResponse, error)

func (*DatabaseManager) ListResolvedCheckpoints

func (m *DatabaseManager) ListResolvedCheckpoints(ctx context.Context, workspace string, limit int) ([]checkpointSummary, error)

func (*DatabaseManager) ListResolvedMCPAccessTokens

func (m *DatabaseManager) ListResolvedMCPAccessTokens(ctx context.Context, workspace string) ([]mcpAccessTokenResponse, error)

func (*DatabaseManager) ListResolvedWorkspaceActivity

func (m *DatabaseManager) ListResolvedWorkspaceActivity(ctx context.Context, workspace string, req activityListRequest) (activityListResponse, error)

func (*DatabaseManager) ListResolvedWorkspaceBookmarks

func (m *DatabaseManager) ListResolvedWorkspaceBookmarks(ctx context.Context, workspace string) (workspaceBookmarkListResponse, error)

func (*DatabaseManager) ListResolvedWorkspaceEvents

func (m *DatabaseManager) ListResolvedWorkspaceEvents(ctx context.Context, workspace string, req EventListRequest) (EventListResponse, error)

func (*DatabaseManager) ListResolvedWorkspaceSessions

func (m *DatabaseManager) ListResolvedWorkspaceSessions(ctx context.Context, workspace string) (workspaceSessionListResponse, error)

func (*DatabaseManager) ListWorkspaceActivity

func (m *DatabaseManager) ListWorkspaceActivity(ctx context.Context, databaseID, workspace string, req activityListRequest) (activityListResponse, error)

func (*DatabaseManager) ListWorkspaceCompositions

func (m *DatabaseManager) ListWorkspaceCompositions(ctx context.Context, databaseID string) (workspaceCompositionListResponse, error)

func (*DatabaseManager) ListWorkspaceEvents

func (m *DatabaseManager) ListWorkspaceEvents(ctx context.Context, databaseID, workspace string, req EventListRequest) (EventListResponse, error)

func (*DatabaseManager) ListWorkspaceSessions

func (m *DatabaseManager) ListWorkspaceSessions(ctx context.Context, databaseID, workspace string) (workspaceSessionListResponse, error)

func (*DatabaseManager) ListWorkspaceSummaries

func (m *DatabaseManager) ListWorkspaceSummaries(ctx context.Context, databaseID string) (workspaceListResponse, error)

func (*DatabaseManager) QueryIndexStatus

func (m *DatabaseManager) QueryIndexStatus(ctx context.Context, databaseID, workspace string, request WorkspaceQueryIndexStatusRequest) (WorkspaceQueryIndexStatus, error)

func (*DatabaseManager) QueryModelStatus

func (m *DatabaseManager) QueryModelStatus(ctx context.Context, request QueryModelStatusRequest) (QueryModelStatus, error)

func (*DatabaseManager) QueryResolvedIndexStatus

func (m *DatabaseManager) QueryResolvedIndexStatus(ctx context.Context, workspace string, request WorkspaceQueryIndexStatusRequest) (WorkspaceQueryIndexStatus, error)

func (*DatabaseManager) QueryResolvedWorkspace

func (m *DatabaseManager) QueryResolvedWorkspace(ctx context.Context, workspace string, request mcptools.FileQueryRequest) (mcptools.FileQueryResponse, error)

func (*DatabaseManager) QueryWorkspace

func (m *DatabaseManager) QueryWorkspace(ctx context.Context, databaseID, workspace string, request mcptools.FileQueryRequest) (mcptools.FileQueryResponse, error)

func (*DatabaseManager) Quickstart

Quickstart creates a database connection and a workspace pre-populated with sample content in a single call. It is designed for first-time onboarding.

func (*DatabaseManager) RebuildQueryIndex

func (m *DatabaseManager) RebuildQueryIndex(ctx context.Context, databaseID, workspace string, request WorkspaceQueryIndexRebuildRequest) (WorkspaceQueryIndexRebuildResponse, error)

func (*DatabaseManager) RebuildResolvedQueryIndex

func (m *DatabaseManager) RebuildResolvedQueryIndex(ctx context.Context, workspace string, request WorkspaceQueryIndexRebuildRequest) (WorkspaceQueryIndexRebuildResponse, error)

func (*DatabaseManager) ReconcileCatalog

func (m *DatabaseManager) ReconcileCatalog(ctx context.Context) (catalogHealthResponse, error)

func (*DatabaseManager) RemoveResolvedWorkspaceCompositionMount

func (m *DatabaseManager) RemoveResolvedWorkspaceCompositionMount(ctx context.Context, workspace, volumeID string) (workspaceCompositionDetail, error)

func (*DatabaseManager) ReplaceResolvedWorkspaceCompositionMounts

func (m *DatabaseManager) ReplaceResolvedWorkspaceCompositionMounts(ctx context.Context, workspace string, mounts []workspaceCompositionMount) (workspaceCompositionDetail, error)

func (*DatabaseManager) ResetAccountData

func (m *DatabaseManager) ResetAccountData(ctx context.Context) (accountResponse, error)

func (*DatabaseManager) RestoreCheckpoint

func (m *DatabaseManager) RestoreCheckpoint(ctx context.Context, databaseID, workspace, checkpointID string) error

func (*DatabaseManager) RestoreCheckpointWithResult

func (m *DatabaseManager) RestoreCheckpointWithResult(ctx context.Context, databaseID, workspace, checkpointID string) (RestoreCheckpointResult, error)

func (*DatabaseManager) RestoreFileVersion

func (m *DatabaseManager) RestoreFileVersion(ctx context.Context, databaseID, workspace, rawPath string, selector FileVersionSelector) (FileVersionRestoreResponse, error)

func (*DatabaseManager) RestoreResolvedCheckpoint

func (m *DatabaseManager) RestoreResolvedCheckpoint(ctx context.Context, workspace, checkpointID string) error

func (*DatabaseManager) RestoreResolvedCheckpointWithResult

func (m *DatabaseManager) RestoreResolvedCheckpointWithResult(ctx context.Context, workspace, checkpointID string) (RestoreCheckpointResult, error)

func (*DatabaseManager) RestoreResolvedFileVersion

func (m *DatabaseManager) RestoreResolvedFileVersion(ctx context.Context, workspace, rawPath string, selector FileVersionSelector) (FileVersionRestoreResponse, error)

func (*DatabaseManager) RestoreResolvedWorkspaceBookmark

func (m *DatabaseManager) RestoreResolvedWorkspaceBookmark(ctx context.Context, workspace, name string) (workspaceBookmark, error)

func (*DatabaseManager) RevokeCLIAccessToken

func (m *DatabaseManager) RevokeCLIAccessToken(ctx context.Context, tokenID string) error

RevokeCLIAccessToken marks a CLI token revoked. Scoped to the caller's subject so users cannot revoke tokens belonging to others.

func (*DatabaseManager) RevokeControlPlaneMCPAccessToken

func (m *DatabaseManager) RevokeControlPlaneMCPAccessToken(ctx context.Context, tokenID string) error

RevokeControlPlaneMCPAccessToken revokes a control-plane token by ID, scoped to the caller's owner subject.

func (*DatabaseManager) RevokeMCPAccessToken

func (m *DatabaseManager) RevokeMCPAccessToken(ctx context.Context, databaseID, workspace, tokenID string) error

func (*DatabaseManager) RevokeResolvedMCPAccessToken

func (m *DatabaseManager) RevokeResolvedMCPAccessToken(ctx context.Context, workspace, tokenID string) error

func (*DatabaseManager) SaveCheckpoint

func (m *DatabaseManager) SaveCheckpoint(ctx context.Context, databaseID, workspace string, input SaveCheckpointRequest) (bool, error)

func (*DatabaseManager) SaveCheckpointFromLive

func (m *DatabaseManager) SaveCheckpointFromLive(ctx context.Context, databaseID, workspace, checkpointID string) (bool, error)

func (*DatabaseManager) SaveCheckpointFromLiveWithOptions

func (m *DatabaseManager) SaveCheckpointFromLiveWithOptions(ctx context.Context, databaseID, workspace, checkpointID string, options SaveCheckpointFromLiveOptions) (bool, error)

func (*DatabaseManager) SaveResolvedCheckpoint

func (m *DatabaseManager) SaveResolvedCheckpoint(ctx context.Context, workspace string, input SaveCheckpointRequest) (bool, error)

func (*DatabaseManager) SaveResolvedCheckpointFromLive

func (m *DatabaseManager) SaveResolvedCheckpointFromLive(ctx context.Context, workspace, checkpointID string) (bool, error)

func (*DatabaseManager) SaveResolvedCheckpointFromLiveWithOptions

func (m *DatabaseManager) SaveResolvedCheckpointFromLiveWithOptions(ctx context.Context, workspace, checkpointID string, options SaveCheckpointFromLiveOptions) (bool, error)

func (*DatabaseManager) SeedGettingStarted

func (m *DatabaseManager) SeedGettingStarted(ctx context.Context) error

SeedGettingStarted ensures a `getting-started` workspace exists on the control plane, creating a default database if needed. It is idempotent and safe to call on every boot: if the workspace already exists (from an earlier boot or a prior Quickstart call), it returns without mutating anything. Intended for self-hosted deployments so a fresh `afs auth login --self-hosted` lands the user on a usable workspace without manual setup.

func (*DatabaseManager) SetDefaultDatabase

func (m *DatabaseManager) SetDefaultDatabase(ctx context.Context, id string) (databaseRecord, error)

func (*DatabaseManager) UndeleteFileVersion

func (m *DatabaseManager) UndeleteFileVersion(ctx context.Context, databaseID, workspace, rawPath string, selector FileVersionSelector) (FileVersionUndeleteResponse, error)

func (*DatabaseManager) UndeleteResolvedFileVersion

func (m *DatabaseManager) UndeleteResolvedFileVersion(ctx context.Context, workspace, rawPath string, selector FileVersionSelector) (FileVersionUndeleteResponse, error)

func (*DatabaseManager) UpdateResolvedWorkspace

func (m *DatabaseManager) UpdateResolvedWorkspace(ctx context.Context, workspace string, input updateWorkspaceRequest) (workspaceDetail, error)

func (*DatabaseManager) UpdateResolvedWorkspaceComposition

func (m *DatabaseManager) UpdateResolvedWorkspaceComposition(ctx context.Context, workspace string, input updateWorkspaceCompositionRequest) (workspaceCompositionDetail, error)

func (*DatabaseManager) UpdateResolvedWorkspaceConfig

func (m *DatabaseManager) UpdateResolvedWorkspaceConfig(ctx context.Context, workspace string, cfg WorkspaceConfig) (WorkspaceConfig, error)

func (*DatabaseManager) UpdateResolvedWorkspaceVersioningPolicy

func (m *DatabaseManager) UpdateResolvedWorkspaceVersioningPolicy(ctx context.Context, workspace string, policy WorkspaceVersioningPolicy) (WorkspaceVersioningPolicy, error)

func (*DatabaseManager) UpdateWorkspace

func (m *DatabaseManager) UpdateWorkspace(ctx context.Context, databaseID, workspace string, input updateWorkspaceRequest) (workspaceDetail, error)

func (*DatabaseManager) UpdateWorkspaceConfig

func (m *DatabaseManager) UpdateWorkspaceConfig(ctx context.Context, databaseID, workspace string, cfg WorkspaceConfig) (WorkspaceConfig, error)

func (*DatabaseManager) UpdateWorkspaceVersioningPolicy

func (m *DatabaseManager) UpdateWorkspaceVersioningPolicy(ctx context.Context, databaseID, workspace string, policy WorkspaceVersioningPolicy) (WorkspaceVersioningPolicy, error)

func (*DatabaseManager) UpsertDatabase

func (m *DatabaseManager) UpsertDatabase(ctx context.Context, id string, input upsertDatabaseRequest) (databaseRecord, error)

func (*DatabaseManager) UpsertWorkspaceSession

func (m *DatabaseManager) UpsertWorkspaceSession(ctx context.Context, databaseID, workspace, sessionID string, input createWorkspaceSessionRequest) (workspaceSessionInfo, error)

type DatabaseRecord

type DatabaseRecord = databaseRecord

type DiffEntry

type DiffEntry struct {
	Op                string    `json:"op"`
	Path              string    `json:"path"`
	PreviousPath      string    `json:"previous_path,omitempty"`
	Kind              string    `json:"kind,omitempty"`
	PreviousKind      string    `json:"previous_kind,omitempty"`
	SizeBytes         int64     `json:"size_bytes,omitempty"`
	PreviousSizeBytes int64     `json:"previous_size_bytes,omitempty"`
	DeltaBytes        int64     `json:"delta_bytes,omitempty"`
	ContentHash       string    `json:"content_hash,omitempty"`
	PreviousHash      string    `json:"previous_hash,omitempty"`
	Mode              uint32    `json:"mode,omitempty"`
	PreviousMode      uint32    `json:"previous_mode,omitempty"`
	TextDiff          *TextDiff `json:"text_diff,omitempty"`
}

type DiffState

type DiffState struct {
	View         string `json:"view"`
	CheckpointID string `json:"checkpoint_id,omitempty"`
	ManifestHash string `json:"manifest_hash,omitempty"`
	FileCount    int    `json:"file_count"`
	FolderCount  int    `json:"folder_count"`
	TotalBytes   int64  `json:"total_bytes"`
}

type DiffSummary

type DiffSummary struct {
	Total           int   `json:"total"`
	Created         int   `json:"created"`
	Updated         int   `json:"updated"`
	Deleted         int   `json:"deleted"`
	Renamed         int   `json:"renamed"`
	MetadataChanged int   `json:"metadata_changed"`
	BytesAdded      int64 `json:"bytes_added"`
	BytesRemoved    int64 `json:"bytes_removed"`
}

type EventEntry

type EventEntry = eventEntry

type EventListRequest

type EventListRequest = eventListRequest

type EventListResponse

type EventListResponse = eventListResponse

type FileContentResponse

type FileContentResponse = fileContentResponse

type FileHistoryLineage

type FileHistoryLineage struct {
	FileID      string        `json:"file_id"`
	State       string        `json:"state"`
	CurrentPath string        `json:"current_path"`
	Versions    []FileVersion `json:"versions"`
}

type FileHistoryRequest

type FileHistoryRequest struct {
	Path        string `json:"path"`
	NewestFirst bool   `json:"-"`
	Limit       int    `json:"limit,omitempty"`
	Cursor      string `json:"cursor,omitempty"`
}

type FileHistoryResponse

type FileHistoryResponse struct {
	WorkspaceID string               `json:"workspace_id"`
	Path        string               `json:"path"`
	Order       string               `json:"order"`
	Lineages    []FileHistoryLineage `json:"lineages"`
	NextCursor  string               `json:"next_cursor,omitempty"`
}

type FileLineage

type FileLineage struct {
	FileID        string    `json:"file_id"`
	WorkspaceID   string    `json:"workspace_id"`
	CurrentPath   string    `json:"current_path"`
	State         string    `json:"state"`
	CreatedAt     time.Time `json:"created_at"`
	UpdatedAt     time.Time `json:"updated_at"`
	DeletedAt     time.Time `json:"deleted_at,omitempty"`
	HeadOrdinal   int64     `json:"head_ordinal,omitempty"`
	HeadVersionID string    `json:"head_version_id,omitempty"`
}

type FileVersion

type FileVersion struct {
	VersionID     string    `json:"version_id"`
	FileID        string    `json:"file_id"`
	Ordinal       int64     `json:"ordinal"`
	Path          string    `json:"path"`
	PrevPath      string    `json:"prev_path,omitempty"`
	Op            string    `json:"op"`
	Kind          string    `json:"kind"`
	BlobID        string    `json:"blob_id,omitempty"`
	ContentHash   string    `json:"content_hash,omitempty"`
	PrevHash      string    `json:"prev_hash,omitempty"`
	SizeBytes     int64     `json:"size_bytes,omitempty"`
	DeltaBytes    int64     `json:"delta_bytes,omitempty"`
	Mode          uint32    `json:"mode,omitempty"`
	Target        string    `json:"target,omitempty"`
	Source        string    `json:"source,omitempty"`
	SessionID     string    `json:"session_id,omitempty"`
	AgentID       string    `json:"agent_id,omitempty"`
	User          string    `json:"user,omitempty"`
	CheckpointIDs []string  `json:"checkpoint_ids,omitempty"`
	CreatedAt     time.Time `json:"created_at"`
}

type FileVersionContentResponse

type FileVersionContentResponse struct {
	WorkspaceID string `json:"workspace_id"`
	FileID      string `json:"file_id"`
	VersionID   string `json:"version_id"`
	Ordinal     int64  `json:"ordinal"`
	Path        string `json:"path"`
	Kind        string `json:"kind"`
	Source      string `json:"source,omitempty"`
	Content     string `json:"content,omitempty"`
	Target      string `json:"target,omitempty"`
	Binary      bool   `json:"binary,omitempty"`
	Encoding    string `json:"encoding,omitempty"`
	ContentType string `json:"content_type,omitempty"`
	Language    string `json:"language,omitempty"`
	Size        int64  `json:"size"`
	CreatedAt   string `json:"created_at"`
}

type FileVersionDiffOperand

type FileVersionDiffOperand struct {
	Ref       string `json:"ref,omitempty"`
	VersionID string `json:"version_id,omitempty"`
	FileID    string `json:"file_id,omitempty"`
	Ordinal   int64  `json:"ordinal,omitempty"`
}

type FileVersionDiffResponse

type FileVersionDiffResponse struct {
	WorkspaceID string `json:"workspace_id"`
	Path        string `json:"path"`
	From        string `json:"from"`
	To          string `json:"to"`
	Binary      bool   `json:"binary"`
	Diff        string `json:"diff,omitempty"`
}

type FileVersionMutationMetadata

type FileVersionMutationMetadata struct {
	Source       string
	SessionID    string
	AgentID      string
	User         string
	CheckpointID string
}

type FileVersionRestoreResponse

type FileVersionRestoreResponse struct {
	WorkspaceID           string `json:"workspace_id"`
	Path                  string `json:"path"`
	Dirty                 bool   `json:"dirty"`
	FileID                string `json:"file_id,omitempty"`
	VersionID             string `json:"version_id,omitempty"`
	RestoredFromVersionID string `json:"restored_from_version_id,omitempty"`
	RestoredFromFileID    string `json:"restored_from_file_id,omitempty"`
	RestoredFromOrdinal   int64  `json:"restored_from_ordinal,omitempty"`
}

type FileVersionSelector

type FileVersionSelector struct {
	VersionID string `json:"version_id,omitempty"`
	FileID    string `json:"file_id,omitempty"`
	Ordinal   int64  `json:"ordinal,omitempty"`
}

type FileVersionUndeleteResponse

type FileVersionUndeleteResponse struct {
	WorkspaceID            string `json:"workspace_id"`
	Path                   string `json:"path"`
	Dirty                  bool   `json:"dirty"`
	FileID                 string `json:"file_id,omitempty"`
	VersionID              string `json:"version_id,omitempty"`
	UndeletedFromVersionID string `json:"undeleted_from_version_id,omitempty"`
	UndeletedFromFileID    string `json:"undeleted_from_file_id,omitempty"`
	UndeletedFromOrdinal   int64  `json:"undeleted_from_ordinal,omitempty"`
}

type HandlerOptions

type HandlerOptions struct {
	AllowOrigin string
	Auth        *AuthHandler
}

type ImportLocalRequest

type ImportLocalRequest struct {
	DatabaseID       string                     `json:"database_id,omitempty"`
	Name             string                     `json:"name"`
	Path             string                     `json:"path"`
	Description      string                     `json:"description"`
	VersioningPolicy *WorkspaceVersioningPolicy `json:"versioning_policy,omitempty"`
}

ImportLocalRequest describes a local directory to import as a workspace.

type ImportLocalResponse

type ImportLocalResponse struct {
	WorkspaceID string          `json:"workspace_id"`
	Workspace   workspaceDetail `json:"workspace"`
	FileCount   int             `json:"file_count"`
	DirCount    int             `json:"dir_count"`
	TotalBytes  int64           `json:"total_bytes"`
}

ImportLocalResponse is returned on successful local import.

type ImportLock

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

ImportLock represents an acquired workspace import lock. It runs a background heartbeat until Release is called.

func AcquireImportLock

func AcquireImportLock(ctx context.Context, store *Store, workspace string) (*ImportLock, error)

AcquireImportLock acquires the per-workspace import lock. If another import is already in progress, it returns ErrImportInProgress.

func (*ImportLock) Lost

func (l *ImportLock) Lost() error

Lost reports whether the heartbeat has observed that the lock was lost (e.g., Redis evicted the key or another process seized it). Callers should treat a lost lock as fatal to the current import.

func (*ImportLock) Release

func (l *ImportLock) Release(ctx context.Context) error

Release cancels the heartbeat and deletes the lock key (only if still held). Safe to call multiple times.

func (*ImportLock) Token

func (l *ImportLock) Token() string

Token returns the opaque value written to the lock key. Exposed for tests.

type ImportWorkspaceRequest

type ImportWorkspaceRequest struct {
	DatabaseID       string                     `json:"database_id,omitempty"`
	Name             string                     `json:"name"`
	Description      string                     `json:"description,omitempty"`
	Manifest         Manifest                   `json:"manifest"`
	Blobs            map[string][]byte          `json:"blobs,omitempty"`
	FileCount        int                        `json:"file_count"`
	DirCount         int                        `json:"dir_count"`
	TotalBytes       int64                      `json:"total_bytes"`
	VersioningPolicy *WorkspaceVersioningPolicy `json:"versioning_policy,omitempty"`
}

ImportWorkspaceRequest uploads a client-built manifest and blob set to create a workspace with an initial checkpoint.

type ImportWorkspaceResponse

type ImportWorkspaceResponse struct {
	WorkspaceID string          `json:"workspace_id"`
	Workspace   workspaceDetail `json:"workspace"`
	FileCount   int             `json:"file_count"`
	DirCount    int             `json:"dir_count"`
	TotalBytes  int64           `json:"total_bytes"`
}

ImportWorkspaceResponse is returned after a successful uploaded import.

type Manifest

type Manifest struct {
	Version   int                      `json:"version"`
	Workspace string                   `json:"workspace"`
	Savepoint string                   `json:"savepoint"`
	Entries   map[string]ManifestEntry `json:"entries"`
}

func BuildManifestFromWorkspaceRoot

func BuildManifestFromWorkspaceRoot(ctx context.Context, rdb *redis.Client, workspace, savepoint string) (Manifest, map[string][]byte, int, int, int64, error)

BuildManifestFromWorkspaceRoot reads the live workspace root in Redis via pipelined BFS and returns a Manifest plus any blob data that exceeds the inline threshold. This is the server-side equivalent of the client-side buildManifestFromWorkspaceRoot in cmd/afs/workspace_mount_bridge.go.

type ManifestEntry

type ManifestEntry struct {
	Type    string `json:"type"`
	Mode    uint32 `json:"mode"`
	MtimeMs int64  `json:"mtime_ms"`
	Size    int64  `json:"size"`
	BlobID  string `json:"blob_id,omitempty"`
	Inline  string `json:"inline,omitempty"`
	Target  string `json:"target,omitempty"`
}

type PathLastWriter

type PathLastWriter struct {
	Path        string `json:"path"`
	SessionID   string `json:"session_id,omitempty"`
	Op          string `json:"op,omitempty"`
	ContentHash string `json:"content_hash,omitempty"`
	OccurredAt  string `json:"occurred_at,omitempty"`
}

PathLastWriter is the HGETALL result from a path:last hash.

type QueryEmbeddingBackfillResult

type QueryEmbeddingBackfillResult struct {
	Enabled   bool   `json:"enabled"`
	Available bool   `json:"available"`
	Provider  string `json:"provider,omitempty"`
	Model     string `json:"model,omitempty"`
	Dimension int    `json:"dimension,omitempty"`
	Scanned   int    `json:"scanned"`
	Embedded  int    `json:"embedded"`
	Message   string `json:"message,omitempty"`
}

type QueryEmbeddingStatus

type QueryEmbeddingStatus struct {
	Enabled   bool   `json:"enabled"`
	Available bool   `json:"available"`
	Provider  string `json:"provider,omitempty"`
	Model     string `json:"model,omitempty"`
	Dimension int    `json:"dimension,omitempty"`
	Message   string `json:"message,omitempty"`
}

type QueryModelDownloadRequest

type QueryModelDownloadRequest struct {
	Model string `json:"model,omitempty"`
}

type QueryModelStatus

type QueryModelStatus = queryembedding.LocalModelStatus

type QueryModelStatusRequest

type QueryModelStatusRequest struct {
	Model string `json:"model,omitempty"`
}

type QuickstartRequest

type QuickstartRequest struct {
	RedisAddr     string `json:"redis_addr"`
	RedisPassword string `json:"redis_password"`
	RedisUsername string `json:"redis_username"`
	RedisDB       int    `json:"redis_db"`
	RedisTLS      bool   `json:"redis_tls"`
}

QuickstartRequest contains optional overrides for the quickstart flow.

type QuickstartResponse

type QuickstartResponse struct {
	DatabaseID  string          `json:"database_id"`
	WorkspaceID string          `json:"workspace_id"`
	Workspace   workspaceDetail `json:"workspace"`
}

QuickstartResponse is returned on successful quickstart.

type RedisConfig

type RedisConfig struct {
	RedisAddr     string `json:"addr"`
	RedisUsername string `json:"username"`
	RedisPassword string `json:"password"`
	RedisDB       int    `json:"db"`
	RedisTLS      bool   `json:"tls"`
}

type RedisStats

type RedisStats struct {
	// Server
	RedisVersion string `json:"redis_version,omitempty"`

	// Memory
	UsedMemoryBytes int64   `json:"used_memory_bytes"`
	MaxMemoryBytes  int64   `json:"max_memory_bytes"` // 0 = no limit configured
	FragmentationR  float64 `json:"fragmentation_ratio,omitempty"`

	// Keyspace (DBSIZE for the currently selected DB index)
	KeyCount int64 `json:"key_count"`

	// Throughput & cache efficiency
	OpsPerSec        int64   `json:"ops_per_sec"`
	CacheHitRate     float64 `json:"cache_hit_rate,omitempty"` // 0.0–1.0; 0 if no hits/misses observed
	ConnectedClients int64   `json:"connected_clients"`

	// Sampling metadata
	SampledAt string `json:"sampled_at,omitempty"`
}

RedisStats captures a snapshot of Redis server health for a single database profile. All fields are best-effort: if the server is unreachable or the relevant INFO line is missing, the field is left zero.

type RestoreCheckpointResult

type RestoreCheckpointResult struct {
	Restored                bool   `json:"restored"`
	CheckpointID            string `json:"checkpoint_id"`
	SafetyCheckpointID      string `json:"safety_checkpoint_id,omitempty"`
	SafetyCheckpointCreated bool   `json:"safety_checkpoint_created"`
	WorkspaceID             string `json:"workspace_id,omitempty"`
	WorkspaceName           string `json:"workspace_name,omitempty"`
}

type SaveCheckpointFromLiveOptions

type SaveCheckpointFromLiveOptions struct {
	Description    string
	Kind           string
	Source         string
	Author         string
	CreatedBy      string
	AllowUnchanged bool
}

type SaveCheckpointRequest

type SaveCheckpointRequest struct {
	Workspace             string
	ExpectedHead          string
	CheckpointID          string
	Description           string
	Kind                  string
	Source                string
	Author                string
	CreatedBy             string
	Manifest              Manifest
	Blobs                 map[string][]byte
	FileCount             int
	DirCount              int
	TotalBytes            int64
	SkipWorkspaceRootSync bool
	AllowUnchanged        bool
}

type SavepointMeta

type SavepointMeta struct {
	Version         int       `json:"version"`
	ID              string    `json:"id"`
	Name            string    `json:"name"`
	Description     string    `json:"description,omitempty"`
	Kind            string    `json:"kind,omitempty"`
	Source          string    `json:"source,omitempty"`
	Author          string    `json:"author,omitempty"`
	CreatedBy       string    `json:"created_by,omitempty"`
	SessionID       string    `json:"session_id,omitempty"`
	AgentID         string    `json:"agent_id,omitempty"`
	AgentName       string    `json:"agent_name,omitempty"`
	Workspace       string    `json:"workspace"`
	ParentSavepoint string    `json:"parent_savepoint,omitempty"`
	ManifestHash    string    `json:"manifest_hash"`
	CreatedAt       time.Time `json:"created_at"`
	FileCount       int       `json:"file_count"`
	DirCount        int       `json:"dir_count"`
	TotalBytes      int64     `json:"total_bytes"`
}

type Service

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

func NewService

func NewService(cfg Config, store *Store) *Service

func NewServiceWithCatalog

func NewServiceWithCatalog(cfg Config, store *Store, catalog catalogStore, databaseID, databaseName string) *Service

func (*Service) AddWorkspaceCompositionMount

func (s *Service) AddWorkspaceCompositionMount(ctx context.Context, workspace string, mount workspaceCompositionMount) (workspaceCompositionDetail, error)

func (*Service) CleanQueryIndex

func (*Service) CloseWorkspaceSession

func (s *Service) CloseWorkspaceSession(ctx context.Context, workspace, sessionID string) error

func (*Service) CreateWorkspace

func (s *Service) CreateWorkspace(ctx context.Context, input CreateWorkspaceRequest) (WorkspaceDetail, error)

func (*Service) CreateWorkspaceBookmark

func (s *Service) CreateWorkspaceBookmark(ctx context.Context, workspace string, input createWorkspaceBookmarkRequest) (workspaceBookmark, error)

func (*Service) CreateWorkspaceComposition

func (s *Service) CreateWorkspaceComposition(ctx context.Context, input createWorkspaceCompositionRequest) (workspaceCompositionDetail, error)

func (*Service) CreateWorkspaceSession

func (s *Service) CreateWorkspaceSession(ctx context.Context, workspace string, input CreateWorkspaceSessionRequest) (WorkspaceSession, error)

func (*Service) DeleteWorkspace

func (s *Service) DeleteWorkspace(ctx context.Context, workspace string) error

func (*Service) DeleteWorkspaceComposition

func (s *Service) DeleteWorkspaceComposition(ctx context.Context, workspace string) error

func (*Service) DiffFileVersions

func (s *Service) DiffFileVersions(ctx context.Context, workspace, rawPath string, from, to FileVersionDiffOperand) (FileVersionDiffResponse, error)

func (*Service) DiffWorkspace

func (s *Service) DiffWorkspace(ctx context.Context, workspace, baseView, headView string) (WorkspaceDiffResponse, error)

func (*Service) DownloadQueryModel

func (s *Service) DownloadQueryModel(ctx context.Context, request QueryModelDownloadRequest) (QueryModelDownloadResult, error)

func (*Service) ForkWorkspace

func (s *Service) ForkWorkspace(ctx context.Context, sourceWorkspace, newWorkspace string) error

func (*Service) GetCheckpoint

func (s *Service) GetCheckpoint(ctx context.Context, workspace, checkpointID string) (CheckpointDetail, error)

func (*Service) GetFileContent

func (s *Service) GetFileContent(ctx context.Context, workspace, rawView, rawPath string) (FileContentResponse, error)

func (*Service) GetFileHistory

func (s *Service) GetFileHistory(ctx context.Context, workspace, rawPath string, newestFirst bool) (FileHistoryResponse, error)

func (*Service) GetFileHistoryPage

func (s *Service) GetFileHistoryPage(ctx context.Context, workspace string, req FileHistoryRequest) (FileHistoryResponse, error)

func (*Service) GetFileVersionContent

func (s *Service) GetFileVersionContent(ctx context.Context, workspace, versionID string) (FileVersionContentResponse, error)

func (*Service) GetFileVersionContentAtOrdinal

func (s *Service) GetFileVersionContentAtOrdinal(ctx context.Context, workspace, fileID string, ordinal int64) (FileVersionContentResponse, error)

func (*Service) GetPathLastWriter

func (s *Service) GetPathLastWriter(ctx context.Context, workspace, path string) (PathLastWriter, error)

GetPathLastWriter reads the companion path:last hash for a single path.

func (*Service) GetSessionChangelogSummary

func (s *Service) GetSessionChangelogSummary(ctx context.Context, workspace, sessionID string) (SessionChangelogSummary, error)

GetSessionChangelogSummary reads the per-session rollup hash.

func (*Service) GetTree

func (s *Service) GetTree(ctx context.Context, workspace, rawView, rawPath string, depth int) (TreeResponse, error)

func (*Service) GetWorkspace

func (s *Service) GetWorkspace(ctx context.Context, workspace string) (WorkspaceDetail, error)

func (*Service) GetWorkspaceComposition

func (s *Service) GetWorkspaceComposition(ctx context.Context, workspace string) (workspaceCompositionDetail, error)

func (*Service) GetWorkspaceConfig

func (s *Service) GetWorkspaceConfig(ctx context.Context, workspace string) (WorkspaceConfig, error)

func (*Service) GetWorkspaceVersioningPolicy

func (s *Service) GetWorkspaceVersioningPolicy(ctx context.Context, workspace string) (WorkspaceVersioningPolicy, error)

func (*Service) HeartbeatWorkspaceSession

func (s *Service) HeartbeatWorkspaceSession(ctx context.Context, workspace, sessionID string, input ...CreateWorkspaceSessionRequest) (WorkspaceSessionInfo, error)

func (*Service) ImportWorkspace

func (s *Service) ImportWorkspace(ctx context.Context, input ImportWorkspaceRequest) (ImportWorkspaceResponse, error)

ImportWorkspace creates a workspace from a client-uploaded manifest and blob payload, preserving the initial checkpoint semantics used by local imports.

func (*Service) ListChangelog

func (s *Service) ListChangelog(ctx context.Context, workspace string, req ChangelogListRequest) (ChangelogListResponse, error)

ListChangelog reads a page of workspace file-change entries. See ChangelogListRequest for filter options.

func (*Service) ListCheckpoints

func (s *Service) ListCheckpoints(ctx context.Context, workspace string, limit int) ([]CheckpointSummary, error)

func (*Service) ListGlobalActivity

func (s *Service) ListGlobalActivity(ctx context.Context, limit int) (ActivityListResponse, error)

func (*Service) ListGlobalActivityPage

func (s *Service) ListGlobalActivityPage(ctx context.Context, req ActivityListRequest) (ActivityListResponse, error)

func (*Service) ListGlobalChangelog

func (s *Service) ListGlobalChangelog(ctx context.Context, req ChangelogListRequest) (ChangelogListResponse, error)

func (*Service) ListGlobalEvents

func (s *Service) ListGlobalEvents(ctx context.Context, req EventListRequest) (EventListResponse, error)

func (*Service) ListWorkspaceActivity

func (s *Service) ListWorkspaceActivity(ctx context.Context, workspace string, limit int) (ActivityListResponse, error)

func (*Service) ListWorkspaceActivityPage

func (s *Service) ListWorkspaceActivityPage(ctx context.Context, workspace string, req ActivityListRequest) (ActivityListResponse, error)

func (*Service) ListWorkspaceBookmarks

func (s *Service) ListWorkspaceBookmarks(ctx context.Context, workspace string) (workspaceBookmarkListResponse, error)

func (*Service) ListWorkspaceCompositions

func (s *Service) ListWorkspaceCompositions(ctx context.Context) (workspaceCompositionListResponse, error)

func (*Service) ListWorkspaceEvents

func (s *Service) ListWorkspaceEvents(ctx context.Context, workspace string, req EventListRequest) (EventListResponse, error)

func (*Service) ListWorkspaceSessions

func (s *Service) ListWorkspaceSessions(ctx context.Context, workspace string) (WorkspaceSessionListResponse, error)

func (*Service) ListWorkspaceSummaries

func (s *Service) ListWorkspaceSummaries(ctx context.Context) (WorkspaceListResponse, error)

func (*Service) QueryIndexStatus

func (s *Service) QueryIndexStatus(ctx context.Context, workspace string, request WorkspaceQueryIndexStatusRequest) (WorkspaceQueryIndexStatus, error)

func (*Service) QueryModelStatus

func (s *Service) QueryModelStatus(ctx context.Context, request QueryModelStatusRequest) (QueryModelStatus, error)

func (*Service) QueryWorkspace

func (s *Service) QueryWorkspace(ctx context.Context, workspace string, request mcptools.FileQueryRequest) (mcptools.FileQueryResponse, error)

func (*Service) RebuildQueryIndex

func (*Service) RemoveWorkspaceCompositionMount

func (s *Service) RemoveWorkspaceCompositionMount(ctx context.Context, workspace, volumeID string) (workspaceCompositionDetail, error)

func (*Service) ReplaceWorkspaceCompositionMounts

func (s *Service) ReplaceWorkspaceCompositionMounts(ctx context.Context, workspace string, mounts []workspaceCompositionMount) (workspaceCompositionDetail, error)

func (*Service) RestoreCheckpoint

func (s *Service) RestoreCheckpoint(ctx context.Context, workspace, checkpointID string) error

func (*Service) RestoreCheckpointWithResult

func (s *Service) RestoreCheckpointWithResult(ctx context.Context, workspace, checkpointID string) (RestoreCheckpointResult, error)

func (*Service) RestoreFileVersion

func (s *Service) RestoreFileVersion(ctx context.Context, workspace, rawPath string, selector FileVersionSelector) (FileVersionRestoreResponse, error)

func (*Service) RestoreWorkspaceBookmark

func (s *Service) RestoreWorkspaceBookmark(ctx context.Context, workspace, name string) (workspaceBookmark, error)

func (*Service) SaveCheckpoint

func (s *Service) SaveCheckpoint(ctx context.Context, input SaveCheckpointRequest) (bool, error)

func (*Service) SaveCheckpointFromLive

func (s *Service) SaveCheckpointFromLive(ctx context.Context, workspace, checkpointID string) (bool, error)

func (*Service) SaveCheckpointFromLiveWithOptions

func (s *Service) SaveCheckpointFromLiveWithOptions(ctx context.Context, workspace, checkpointID string, options SaveCheckpointFromLiveOptions) (bool, error)

SaveCheckpointFromLiveWithOptions builds a manifest from the live workspace root in Redis and saves it as a new checkpoint with caller-provided metadata.

func (*Service) UndeleteFileVersion

func (s *Service) UndeleteFileVersion(ctx context.Context, workspace, rawPath string, selector FileVersionSelector) (FileVersionUndeleteResponse, error)

func (*Service) UpdateWorkspace

func (s *Service) UpdateWorkspace(ctx context.Context, workspace string, input UpdateWorkspaceRequest) (WorkspaceDetail, error)

func (*Service) UpdateWorkspaceComposition

func (s *Service) UpdateWorkspaceComposition(ctx context.Context, workspace string, input updateWorkspaceCompositionRequest) (workspaceCompositionDetail, error)

func (*Service) UpdateWorkspaceConfig

func (s *Service) UpdateWorkspaceConfig(ctx context.Context, workspace string, cfg WorkspaceConfig) (WorkspaceConfig, error)

func (*Service) UpdateWorkspaceVersioningPolicy

func (s *Service) UpdateWorkspaceVersioningPolicy(ctx context.Context, workspace string, policy WorkspaceVersioningPolicy) (WorkspaceVersioningPolicy, error)

func (*Service) UpsertWorkspaceSession

func (s *Service) UpsertWorkspaceSession(ctx context.Context, workspace, sessionID string, input CreateWorkspaceSessionRequest) (WorkspaceSessionInfo, error)

type SessionChangelogSummary

type SessionChangelogSummary struct {
	SessionID  string         `json:"session_id"`
	OpCounts   map[string]int `json:"op_counts"`
	DeltaBytes int64          `json:"delta_bytes"`
	LastOpAt   string         `json:"last_op_at,omitempty"`
}

SessionChangelogSummary is the HGETALL result from a session summary hash, decoded into the fields the UI actually needs.

type SourceRef

type SourceRef = sourceRef

type Store

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

func NewStore

func NewStore(rdb *redis.Client) *Store

func OpenStore

func OpenStore(ctx context.Context, cfg Config) (*Store, func(), error)

func (*Store) AddBlobRefs

func (s *Store) AddBlobRefs(ctx context.Context, workspace string, m Manifest, createdAt time.Time) error

func (*Store) AppendFileVersion

func (s *Store) AppendFileVersion(ctx context.Context, workspace, fileID string, version FileVersion) (FileVersion, error)

func (*Store) AppendFileVersionChecked

func (s *Store) AppendFileVersionChecked(ctx context.Context, workspace, fileID string, expected VersionedFileSnapshot, version FileVersion, deleteAfter bool) (FileVersion, error)

func (*Store) Audit

func (s *Store) Audit(ctx context.Context, workspace, op string, extra map[string]any) error

func (*Store) BlobStats

func (s *Store) BlobStats(ctx context.Context, workspace string) (BlobStats, error)

func (*Store) CloneFileVersionHistory

func (s *Store) CloneFileVersionHistory(ctx context.Context, sourceStorageID, destStorageID string) error

func (*Store) CollectRedisStats

func (s *Store) CollectRedisStats(ctx context.Context) (RedisStats, error)

CollectRedisStats issues a single INFO + DBSIZE round-trip and returns the parsed snapshot. Called by the background poller in DatabaseManager.

func (*Store) CreateFileLineage

func (s *Store) CreateFileLineage(ctx context.Context, workspace, path string, createdAt time.Time) (FileLineage, error)

func (*Store) DeleteFileLineage

func (s *Store) DeleteFileLineage(ctx context.Context, workspace, fileID string, deletedAt time.Time) (FileLineage, error)

func (*Store) DeleteWorkspace

func (s *Store) DeleteWorkspace(ctx context.Context, workspace string) error

func (*Store) DeleteWorkspaceComposition

func (s *Store) DeleteWorkspaceComposition(ctx context.Context, workspace string) error

func (*Store) GetBlob

func (s *Store) GetBlob(ctx context.Context, workspace, blobID string) ([]byte, error)

func (*Store) GetFileLineage

func (s *Store) GetFileLineage(ctx context.Context, workspace, fileID string) (FileLineage, error)

func (*Store) GetFileVersion

func (s *Store) GetFileVersion(ctx context.Context, workspace, versionID string) (FileVersion, error)

func (*Store) GetFileVersionAtOrdinal

func (s *Store) GetFileVersionAtOrdinal(ctx context.Context, workspace, fileID string, ordinal int64) (FileVersion, error)

func (*Store) GetManifest

func (s *Store) GetManifest(ctx context.Context, workspace, savepoint string) (Manifest, error)

func (*Store) GetPathLastWriter

func (s *Store) GetPathLastWriter(ctx context.Context, storageID, path string) (PathLastWriter, error)

GetPathLastWriter reads the companion path:last hash for a single path.

func (*Store) GetSavepointMeta

func (s *Store) GetSavepointMeta(ctx context.Context, workspace, savepoint string) (SavepointMeta, error)

func (*Store) GetSessionChangelogSummary

func (s *Store) GetSessionChangelogSummary(ctx context.Context, storageID, sessionID string) (SessionChangelogSummary, error)

GetSessionChangelogSummary reads the per-session rollup hash.

func (*Store) GetWorkspaceBookmark

func (s *Store) GetWorkspaceBookmark(ctx context.Context, workspace, name string) (workspaceBookmark, error)

func (*Store) GetWorkspaceComposition

func (s *Store) GetWorkspaceComposition(ctx context.Context, workspace string) (workspaceComposition, error)

func (*Store) GetWorkspaceConfig

func (s *Store) GetWorkspaceConfig(ctx context.Context, workspace string) (WorkspaceConfig, error)

func (*Store) GetWorkspaceMeta

func (s *Store) GetWorkspaceMeta(ctx context.Context, workspace string) (WorkspaceMeta, error)

func (*Store) GetWorkspaceSession

func (s *Store) GetWorkspaceSession(ctx context.Context, workspace, sessionID string) (WorkspaceSessionRecord, error)

func (*Store) GetWorkspaceVersioningPolicy

func (s *Store) GetWorkspaceVersioningPolicy(ctx context.Context, workspace string) (WorkspaceVersioningPolicy, error)

func (*Store) ListAudit

func (s *Store) ListAudit(ctx context.Context, workspace string, limit int64) ([]auditRecord, error)

func (*Store) ListChangelog

func (s *Store) ListChangelog(ctx context.Context, storageID string, req ChangelogListRequest) (ChangelogListResponse, error)

ListChangelog reads a page of entries from a workspace's changelog stream. Optional session-ID filter is applied in-memory; for well-bounded session reads this is fine since sessions are short-lived.

func (*Store) ListEvents

func (s *Store) ListEvents(ctx context.Context, storageID string, req EventListRequest) (EventListResponse, error)

func (*Store) ListExpiredWorkspaceSessionIDs

func (s *Store) ListExpiredWorkspaceSessionIDs(ctx context.Context, workspace string, now time.Time) ([]string, error)

func (*Store) ListFileVersions

func (s *Store) ListFileVersions(ctx context.Context, workspace, fileID string, ascending bool) ([]FileVersion, error)

func (*Store) ListPathHistoryVersionIDs

func (s *Store) ListPathHistoryVersionIDs(ctx context.Context, workspace, path string) ([]string, error)

func (*Store) ListSavepoints

func (s *Store) ListSavepoints(ctx context.Context, workspace string, limit int64) ([]SavepointMeta, error)

func (*Store) ListWorkspaceBookmarks

func (s *Store) ListWorkspaceBookmarks(ctx context.Context, workspace string) ([]workspaceBookmark, error)

func (*Store) ListWorkspaceCompositions

func (s *Store) ListWorkspaceCompositions(ctx context.Context) ([]workspaceComposition, error)

func (*Store) ListWorkspaceSessions

func (s *Store) ListWorkspaceSessions(ctx context.Context, workspace string) ([]WorkspaceSessionRecord, error)

func (*Store) ListWorkspaces

func (s *Store) ListWorkspaces(ctx context.Context) ([]WorkspaceMeta, error)

func (*Store) MoveWorkspaceHead

func (s *Store) MoveWorkspaceHead(ctx context.Context, workspace, savepoint string, updatedAt time.Time) error

func (*Store) Now

func (s *Store) Now(ctx context.Context) (time.Time, error)

func (*Store) PutSavepoint

func (s *Store) PutSavepoint(ctx context.Context, meta SavepointMeta, m Manifest) error

func (*Store) PutWorkspaceBookmark

func (s *Store) PutWorkspaceBookmark(ctx context.Context, bookmark workspaceBookmark) error

func (*Store) PutWorkspaceComposition

func (s *Store) PutWorkspaceComposition(ctx context.Context, item workspaceComposition) error

func (*Store) PutWorkspaceConfig

func (s *Store) PutWorkspaceConfig(ctx context.Context, workspace string, cfg WorkspaceConfig) error

func (*Store) PutWorkspaceMeta

func (s *Store) PutWorkspaceMeta(ctx context.Context, meta WorkspaceMeta) error

func (*Store) PutWorkspaceSession

func (s *Store) PutWorkspaceSession(ctx context.Context, record WorkspaceSessionRecord) error

func (*Store) PutWorkspaceSessionWithTTL

func (s *Store) PutWorkspaceSessionWithTTL(ctx context.Context, record WorkspaceSessionRecord, ttl time.Duration) error

func (*Store) PutWorkspaceVersioningPolicy

func (s *Store) PutWorkspaceVersioningPolicy(ctx context.Context, workspace string, policy WorkspaceVersioningPolicy) error

func (*Store) RecordFileVersionMutation

func (s *Store) RecordFileVersionMutation(ctx context.Context, workspace string, before, after VersionedFileSnapshot, metadata FileVersionMutationMetadata) (*FileVersion, error)

func (*Store) RecordManifestVersionChanges

func (s *Store) RecordManifestVersionChanges(ctx context.Context, workspace string, before, after Manifest, metadata FileVersionMutationMetadata) error

func (*Store) RecordManifestVersionChangesWithResults

func (s *Store) RecordManifestVersionChangesWithResults(ctx context.Context, workspace string, before, after Manifest, metadata FileVersionMutationMetadata) (map[string]*FileVersion, error)

func (*Store) RemoveWorkspaceSessionPresence

func (s *Store) RemoveWorkspaceSessionPresence(ctx context.Context, workspace, sessionID string) error

func (*Store) RenameFileLineage

func (s *Store) RenameFileLineage(ctx context.Context, workspace, fileID, newPath string, updatedAt time.Time) (FileLineage, error)

func (*Store) RenameFileLineageWithVersion

func (s *Store) RenameFileLineageWithVersion(ctx context.Context, workspace, fileID string, expected VersionedFileSnapshot, version FileVersion) (FileVersion, error)

func (*Store) ResolveLiveFileLineageByPath

func (s *Store) ResolveLiveFileLineageByPath(ctx context.Context, workspace, path string) (FileLineage, error)

func (*Store) ReviveFileLineage

func (s *Store) ReviveFileLineage(ctx context.Context, workspace, fileID, path string, revivedAt time.Time) (FileLineage, error)

func (*Store) SaveBlobs

func (s *Store) SaveBlobs(ctx context.Context, workspace string, blobs map[string][]byte) error

func (*Store) SaveBlobsBatch

func (s *Store) SaveBlobsBatch(ctx context.Context, workspace string, blobs map[string][]byte, sizes map[string]int64, createdAt time.Time) error

SaveBlobsBatch writes an entire map of blobs (plus their ref records) to Redis using the pipelined writer. Intended for callers that already hold a complete in-memory map (e.g., HTTP fork). Import path uses Submit directly to stream blobs as they're hashed.

func (*Store) SavepointExists

func (s *Store) SavepointExists(ctx context.Context, workspace, savepoint string) (bool, error)

func (*Store) WorkspaceExists

func (s *Store) WorkspaceExists(ctx context.Context, workspace string) (bool, error)

func (*Store) WorkspaceSessionLeaseAlive

func (s *Store) WorkspaceSessionLeaseAlive(ctx context.Context, workspace, sessionID string) (bool, error)

type SyncOptions

type SyncOptions struct {
	// BlobProvider, when set, short-circuits GetBlob for materialized file
	// nodes. It returns (data, true) if the caller has the blob in memory;
	// otherwise (nil, false) and the sync falls back to Redis.
	BlobProvider func(blobID string) ([]byte, bool)
	// SkipNamespaceReset bypasses the SCAN+DEL pass over the existing FS
	// namespace. Safe only when the workspace is known to be empty
	// (fresh import, or right after DeleteWorkspace).
	SkipNamespaceReset bool
}

SyncOptions tunes SyncWorkspaceRootWithOptions for callers that can avoid round trips the default path must make.

type TextDiff

type TextDiff struct {
	Available     bool           `json:"available"`
	SkippedReason string         `json:"skipped_reason,omitempty"`
	Language      string         `json:"language,omitempty"`
	MaxBytes      int            `json:"max_bytes,omitempty"`
	Hunks         []TextDiffHunk `json:"hunks,omitempty"`
}

type TextDiffHunk

type TextDiffHunk struct {
	OldStart int            `json:"old_start"`
	OldLines int            `json:"old_lines"`
	NewStart int            `json:"new_start"`
	NewLines int            `json:"new_lines"`
	Lines    []TextDiffLine `json:"lines"`
}

type TextDiffLine

type TextDiffLine struct {
	Kind    string `json:"kind"`
	OldLine int    `json:"old_line,omitempty"`
	NewLine int    `json:"new_line,omitempty"`
	Text    string `json:"text"`
}

type TreeItem

type TreeItem = treeItem

type TreeResponse

type TreeResponse = treeResponse

type UpdateWorkspaceCompositionRequest

type UpdateWorkspaceCompositionRequest = updateWorkspaceCompositionRequest

type UpdateWorkspaceRequest

type UpdateWorkspaceRequest = updateWorkspaceRequest

type UpsertDatabaseRequest

type UpsertDatabaseRequest = upsertDatabaseRequest

type VersionedFileSnapshot

type VersionedFileSnapshot struct {
	Path        string
	Exists      bool
	Kind        string
	Mode        uint32
	Content     []byte
	Target      string
	BlobID      string
	ContentHash string
	SizeBytes   int64
}

type WorkspaceBookmark

type WorkspaceBookmark = workspaceBookmark

type WorkspaceBookmarkListResponse

type WorkspaceBookmarkListResponse = workspaceBookmarkListResponse

type WorkspaceCompositionDetail

type WorkspaceCompositionDetail = workspaceCompositionDetail

type WorkspaceCompositionListResponse

type WorkspaceCompositionListResponse = workspaceCompositionListResponse

type WorkspaceCompositionMount

type WorkspaceCompositionMount = workspaceCompositionMount

type WorkspaceCompositionSummary

type WorkspaceCompositionSummary = workspaceCompositionSummary

type WorkspaceConfig

type WorkspaceConfig struct {
	Versioning WorkspaceVersioningPolicy `json:"versioning"`
	Query      WorkspaceQueryConfig      `json:"query"`
}

func DefaultWorkspaceConfig

func DefaultWorkspaceConfig() WorkspaceConfig

func NormalizeWorkspaceConfig

func NormalizeWorkspaceConfig(cfg WorkspaceConfig) WorkspaceConfig

type WorkspaceDetail

type WorkspaceDetail = workspaceDetail

type WorkspaceDiffResponse

type WorkspaceDiffResponse struct {
	WorkspaceID   string      `json:"workspace_id"`
	WorkspaceName string      `json:"workspace_name,omitempty"`
	Base          DiffState   `json:"base"`
	Head          DiffState   `json:"head"`
	Summary       DiffSummary `json:"summary"`
	Entries       []DiffEntry `json:"entries"`
}

type WorkspaceListResponse

type WorkspaceListResponse = workspaceListResponse

type WorkspaceMeta

type WorkspaceMeta struct {
	Version                 int       `json:"version"`
	ID                      string    `json:"id,omitempty"`
	Name                    string    `json:"name"`
	Description             string    `json:"description,omitempty"`
	DatabaseID              string    `json:"database_id,omitempty"`
	DatabaseName            string    `json:"database_name,omitempty"`
	CloudAccount            string    `json:"cloud_account,omitempty"`
	Region                  string    `json:"region,omitempty"`
	Source                  string    `json:"source,omitempty"`
	Tags                    []string  `json:"tags,omitempty"`
	CreatedAt               time.Time `json:"created_at"`
	UpdatedAt               time.Time `json:"updated_at"`
	HeadSavepoint           string    `json:"head_savepoint"`
	DefaultSavepoint        string    `json:"default_savepoint"`
	DirtyHint               bool      `json:"dirty_hint"`
	LastMaterializedAt      time.Time `json:"last_materialized_at"`
	LastKnownMaterializedAt string    `json:"last_materialized_host,omitempty"`
}

func ApplyWorkspaceMetaDefaults

func ApplyWorkspaceMetaDefaults(cfg Config, meta WorkspaceMeta) WorkspaceMeta

type WorkspaceQueryConfig

type WorkspaceQueryConfig struct {
	Embeddings WorkspaceQueryEmbeddingsConfig `json:"embeddings"`
}

type WorkspaceQueryEmbeddingsConfig

type WorkspaceQueryEmbeddingsConfig struct {
	Enabled       bool   `json:"enabled"`
	Model         string `json:"model,omitempty"`
	ChunkStrategy string `json:"chunk_strategy,omitempty"`
}

type WorkspaceQueryIndexCleanRequest

type WorkspaceQueryIndexCleanRequest struct {
	Workspace string `json:"workspace,omitempty"`
	Confirm   bool   `json:"confirm,omitempty"`
}

type WorkspaceQueryIndexCleanResponse

type WorkspaceQueryIndexCleanResponse struct {
	Workspace     string                    `json:"workspace"`
	Cleared       bool                      `json:"cleared"`
	RemovedFiles  int                       `json:"removed_files"`
	RemovedChunks int                       `json:"removed_chunks"`
	Status        WorkspaceQueryIndexStatus `json:"status"`
	Message       string                    `json:"message,omitempty"`
}

type WorkspaceQueryIndexRebuildRequest

type WorkspaceQueryIndexRebuildRequest struct {
	Workspace  string `json:"workspace,omitempty"`
	Path       string `json:"path,omitempty"`
	Force      bool   `json:"force,omitempty"`
	Wait       bool   `json:"wait,omitempty"`
	Embeddings bool   `json:"embeddings,omitempty"`
}

type WorkspaceQueryIndexRebuildResponse

type WorkspaceQueryIndexRebuildResponse struct {
	Workspace  string                        `json:"workspace"`
	Path       string                        `json:"path,omitempty"`
	Keyword    queryindex.RebuildResult      `json:"keyword"`
	Embeddings *QueryEmbeddingBackfillResult `json:"embeddings,omitempty"`
	Status     WorkspaceQueryIndexStatus     `json:"status"`
	Message    string                        `json:"message,omitempty"`
}

type WorkspaceQueryIndexStatus

type WorkspaceQueryIndexStatus struct {
	Workspace  string               `json:"workspace"`
	Path       string               `json:"path,omitempty"`
	State      string               `json:"state"`
	Message    string               `json:"message,omitempty"`
	Keyword    queryindex.Status    `json:"keyword"`
	Embeddings QueryEmbeddingStatus `json:"embeddings"`
}

type WorkspaceQueryIndexStatusRequest

type WorkspaceQueryIndexStatusRequest struct {
	Workspace string `json:"workspace,omitempty"`
	Path      string `json:"path,omitempty"`
}

type WorkspaceSession

type WorkspaceSession = workspaceSession

type WorkspaceSessionInfo

type WorkspaceSessionInfo = workspaceSessionInfo

type WorkspaceSessionListResponse

type WorkspaceSessionListResponse = workspaceSessionListResponse

type WorkspaceSessionRecord

type WorkspaceSessionRecord struct {
	SessionID       string    `json:"session_id"`
	Workspace       string    `json:"workspace"`
	AgentID         string    `json:"agent_id,omitempty"`
	AgentName       string    `json:"agent_name,omitempty"`
	SessionName     string    `json:"session_name,omitempty"`
	ClientKind      string    `json:"client_kind,omitempty"`
	AFSVersion      string    `json:"afs_version,omitempty"`
	Hostname        string    `json:"hostname,omitempty"`
	OperatingSystem string    `json:"os,omitempty"`
	LocalPath       string    `json:"local_path,omitempty"`
	Label           string    `json:"label,omitempty"`
	Readonly        bool      `json:"readonly,omitempty"`
	State           string    `json:"state"`
	StartedAt       time.Time `json:"started_at"`
	LastSeenAt      time.Time `json:"last_seen_at"`
	LeaseExpiresAt  time.Time `json:"lease_expires_at"`
}

type WorkspaceSummary

type WorkspaceSummary = workspaceSummary

type WorkspaceVersioningPolicy

type WorkspaceVersioningPolicy struct {
	Mode                 string   `json:"mode"`
	IncludeGlobs         []string `json:"include_globs,omitempty"`
	ExcludeGlobs         []string `json:"exclude_globs,omitempty"`
	MaxVersionsPerFile   int      `json:"max_versions_per_file,omitempty"`
	MaxAgeDays           int      `json:"max_age_days,omitempty"`
	MaxTotalBytes        int64    `json:"max_total_bytes,omitempty"`
	LargeFileCutoffBytes int64    `json:"large_file_cutoff_bytes,omitempty"`
}

func DefaultWorkspaceVersioningPolicy

func DefaultWorkspaceVersioningPolicy() WorkspaceVersioningPolicy

func NormalizeWorkspaceVersioningPolicy

func NormalizeWorkspaceVersioningPolicy(policy WorkspaceVersioningPolicy) WorkspaceVersioningPolicy

Jump to

Keyboard shortcuts

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