- Add complete domain layer: Note, Vault, WikiLink, Tag, Frontmatter, Graph entities - Implement repository interfaces for data access abstraction - Create comprehensive configuration system with YAML and env support - Add CLI entry point with signal handling and graceful shutdown - Fix mermaid diagram syntax in design.md (array notation) - Add CLAUDE.md for development guidance 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <noreply@anthropic.com>
39 lines
1.3 KiB
Go
39 lines
1.3 KiB
Go
package repository
|
|
|
|
import (
|
|
"context"
|
|
|
|
"github.com/user/obsidian-mcp-server/internal/domain"
|
|
)
|
|
|
|
type VaultStructure struct {
|
|
Name string `json:"name"`
|
|
Path string `json:"path"`
|
|
Type string `json:"type"` // "file" or "directory"
|
|
Children []*VaultStructure `json:"children,omitempty"`
|
|
}
|
|
|
|
type MostLinkedNote struct {
|
|
Path string `json:"path"`
|
|
Count int `json:"count"`
|
|
}
|
|
|
|
type VaultStats struct {
|
|
TotalNotes int `json:"total_notes"`
|
|
TotalWords int `json:"total_words"`
|
|
TotalLinks int `json:"total_links"`
|
|
TotalTags int `json:"total_tags"`
|
|
AvgNoteLength int `json:"avg_note_length"`
|
|
MostLinked []*MostLinkedNote `json:"most_linked"`
|
|
OrphanedNotes int `json:"orphaned_notes"`
|
|
LastIndexed string `json:"last_indexed"`
|
|
}
|
|
|
|
type VaultRepository interface {
|
|
GetStats(ctx context.Context) (*VaultStats, error)
|
|
GetStructure(ctx context.Context, maxDepth int) (*VaultStructure, error)
|
|
FindOrphaned(ctx context.Context, excludePaths []string) ([]string, error)
|
|
GetMostLinked(ctx context.Context, limit int) ([]*MostLinkedNote, error)
|
|
Initialize(ctx context.Context, vault *domain.Vault) error
|
|
Rebuild(ctx context.Context) error
|
|
} |