Files
claude-mnemonic/pkg/models/session.go
lukaszraczylo 4f4b4ac70f feat(chunking): add AST-aware code chunking for Go, Python, TypeScript
- [x] Add language-specific chunkers with AST parsing (Go, Python, TypeScript)
- [x] Implement chunking manager to dispatch files to appropriate chunkers
- [x] Integrate code chunks into vector sync for semantic search
- [x] Add tree-sitter dependency for Python/TypeScript parsing
- [x] Reorder struct fields for consistency across codebase
- [x] Rename error variables to follow Go conventions (err → unmarshalErr, etc.)
- [x] Add code chunk metadata to vector documents (language, symbol name, line ranges)
- [x] Update worker service to initialize chunking pipeline with all three languages
2026-01-07 13:19:58 +00:00

46 lines
1.7 KiB
Go

// Package models contains domain models for claude-mnemonic.
package models
import (
"database/sql"
"time"
)
// SessionStatus represents the status of an SDK session.
type SessionStatus string
const (
SessionStatusActive SessionStatus = "active"
SessionStatusCompleted SessionStatus = "completed"
SessionStatusFailed SessionStatus = "failed"
)
// SDKSession represents a Claude Code session tracked by the memory system.
type SDKSession struct {
ClaudeSessionID string `db:"claude_session_id" json:"claude_session_id"`
Project string `db:"project" json:"project"`
Status SessionStatus `db:"status" json:"status"`
StartedAt string `db:"started_at" json:"started_at"`
SDKSessionID sql.NullString `db:"sdk_session_id" json:"sdk_session_id,omitempty"`
UserPrompt sql.NullString `db:"user_prompt" json:"user_prompt,omitempty"`
CompletedAt sql.NullString `db:"completed_at" json:"completed_at,omitempty"`
WorkerPort sql.NullInt64 `db:"worker_port" json:"worker_port,omitempty"`
CompletedAtEpoch sql.NullInt64 `db:"completed_at_epoch" json:"completed_at_epoch,omitempty"`
ID int64 `db:"id" json:"id"`
PromptCounter int64 `db:"prompt_counter" json:"prompt_counter"`
StartedAtEpoch int64 `db:"started_at_epoch" json:"started_at_epoch"`
}
// ActiveSession represents an in-memory active session being processed.
type ActiveSession struct {
StartTime time.Time
ClaudeSessionID string
SDKSessionID string
Project string
UserPrompt string
SessionDBID int64
LastPromptNumber int
CumulativeInputTokens int64
CumulativeOutputTokens int64
}