- 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>
40 lines
1.0 KiB
Go
40 lines
1.0 KiB
Go
package repository
|
|
|
|
import (
|
|
"context"
|
|
|
|
"github.com/user/obsidian-mcp-server/internal/domain"
|
|
)
|
|
|
|
type GraphNode struct {
|
|
Path string `json:"path"`
|
|
Title string `json:"title"`
|
|
}
|
|
|
|
type GraphEdge struct {
|
|
From string `json:"from"`
|
|
To string `json:"to"`
|
|
}
|
|
|
|
type GraphData struct {
|
|
Nodes []*GraphNode `json:"nodes"`
|
|
Edges []*GraphEdge `json:"edges"`
|
|
}
|
|
|
|
type BacklinkInfo struct {
|
|
From string `json:"from"`
|
|
Context string `json:"context"`
|
|
Line int `json:"line"`
|
|
}
|
|
|
|
type GraphIndex interface {
|
|
AddNote(ctx context.Context, note *domain.Note) error
|
|
RemoveNote(ctx context.Context, path string) error
|
|
GetBacklinks(ctx context.Context, path string) ([]*BacklinkInfo, error)
|
|
GetOutlinks(ctx context.Context, path string) ([]string, error)
|
|
GetConnected(ctx context.Context, path string, depth int) (*GraphData, error)
|
|
FindBrokenLinks(ctx context.Context, notePath string) ([]string, error)
|
|
UpdateLinks(ctx context.Context, oldPath, newPath string) error
|
|
Rebuild(ctx context.Context, notes []*domain.Note) error
|
|
Clear() error
|
|
} |