Changeset 0.21.2 (#88)
This commit is contained in:
@@ -31,6 +31,8 @@ type Workspace struct {
|
||||
MaxBytes *int64 `json:"max_bytes,omitempty" db:"max_bytes"`
|
||||
Status string `json:"status" db:"status"`
|
||||
|
||||
IndexingEnabled bool `json:"indexing_enabled" db:"indexing_enabled"`
|
||||
|
||||
// Computed fields (not DB columns)
|
||||
FileCount int `json:"file_count,omitempty"`
|
||||
TotalBytes int64 `json:"total_bytes,omitempty"`
|
||||
@@ -38,9 +40,10 @@ type Workspace struct {
|
||||
|
||||
// WorkspacePatch holds optional fields for updating a workspace.
|
||||
type WorkspacePatch struct {
|
||||
Name *string `json:"name,omitempty"`
|
||||
MaxBytes *int64 `json:"max_bytes,omitempty"`
|
||||
Status *string `json:"status,omitempty"`
|
||||
Name *string `json:"name,omitempty"`
|
||||
MaxBytes *int64 `json:"max_bytes,omitempty"`
|
||||
Status *string `json:"status,omitempty"`
|
||||
IndexingEnabled *bool `json:"indexing_enabled,omitempty"`
|
||||
}
|
||||
|
||||
// WorkspaceFile represents metadata for a single file or directory in a workspace.
|
||||
@@ -52,6 +55,8 @@ type WorkspaceFile struct {
|
||||
ContentType string `json:"content_type,omitempty" db:"content_type"`
|
||||
SizeBytes int64 `json:"size_bytes" db:"size_bytes"`
|
||||
SHA256 string `json:"sha256,omitempty" db:"sha256"`
|
||||
IndexStatus string `json:"index_status,omitempty" db:"index_status"`
|
||||
ChunkCount int `json:"chunk_count,omitempty" db:"chunk_count"`
|
||||
CreatedAt time.Time `json:"created_at" db:"created_at"`
|
||||
UpdatedAt time.Time `json:"updated_at" db:"updated_at"`
|
||||
}
|
||||
@@ -64,3 +69,37 @@ type WorkspaceStats struct {
|
||||
TotalBytes int64 `json:"total_bytes"`
|
||||
MaxBytes *int64 `json:"max_bytes,omitempty"`
|
||||
}
|
||||
|
||||
// =========================================
|
||||
// WORKSPACE CHUNKS (v0.21.2)
|
||||
// =========================================
|
||||
|
||||
// Workspace file index status constants.
|
||||
const (
|
||||
IndexStatusPending = "pending"
|
||||
IndexStatusIndexing = "indexing"
|
||||
IndexStatusReady = "ready"
|
||||
IndexStatusError = "error"
|
||||
IndexStatusSkipped = "skipped"
|
||||
)
|
||||
|
||||
// WorkspaceChunk is a text segment from a workspace file with its embedding vector.
|
||||
type WorkspaceChunk struct {
|
||||
ID string `json:"id" db:"id"`
|
||||
WorkspaceID string `json:"workspace_id" db:"workspace_id"`
|
||||
FileID string `json:"file_id" db:"file_id"`
|
||||
ChunkIndex int `json:"chunk_index" db:"chunk_index"`
|
||||
Content string `json:"content" db:"content"`
|
||||
TokenCount int `json:"token_count" db:"token_count"`
|
||||
Embedding []float64 `json:"-" db:"embedding"` // never serialized to API
|
||||
Metadata JSONMap `json:"metadata" db:"metadata"`
|
||||
}
|
||||
|
||||
// WorkspaceChunkResult is a single result from workspace similarity search.
|
||||
type WorkspaceChunkResult struct {
|
||||
FilePath string `json:"file_path"`
|
||||
Content string `json:"content"`
|
||||
Score float64 `json:"score"`
|
||||
LineHint int `json:"line_hint,omitempty"`
|
||||
Metadata JSONMap `json:"metadata,omitempty"`
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user