Fix bd-2: Add daemon RPC support for sync export operations

- Added OpExport/OpImport to RPC protocol
- Implemented handleExport() in daemon to export via RPC
- Modified sync command to use daemon export when available
- Prevents nil pointer dereference when daemon is running
- Falls back to direct mode if daemon unavailable
This commit is contained in:
Steve Yegge
2025-10-22 00:00:50 -07:00
parent e691fa00b1
commit 49ed3e74f0
4 changed files with 195 additions and 0 deletions

View File

@@ -32,6 +32,8 @@ const (
OpReposClearCache = "repos_clear_cache"
OpCompact = "compact"
OpCompactStats = "compact_stats"
OpExport = "export"
OpImport = "import"
)
// Request represents an RPC request from client to daemon
@@ -284,3 +286,13 @@ type CompactStatsData struct {
Tier2MinAge string `json:"tier2_min_age"`
EstimatedSavings string `json:"estimated_savings,omitempty"`
}
// ExportArgs represents arguments for the export operation
type ExportArgs struct {
JSONLPath string `json:"jsonl_path"` // Path to export JSONL file
}
// ImportArgs represents arguments for the import operation
type ImportArgs struct {
JSONLPath string `json:"jsonl_path"` // Path to import JSONL file
}