Add RPC support for compact command (bd-184)
- Added OpCompact and OpCompactStats operation constants - Added CompactArgs, CompactStatsArgs, and response types to RPC protocol - Implemented handleCompact and handleCompactStats in RPC server - Updated compact command to use RPC when daemon is available - Fixed RPC client to include Cwd for proper database routing - Compact now works in daemon mode with --no-daemon flag Amp-Thread-ID: https://ampcode.com/threads/T-87885d07-80ad-466d-9ffb-cc96fab4853f Co-authored-by: Amp <amp@ampcode.com>
This commit is contained in:
@@ -99,10 +99,14 @@ func (c *Client) Execute(operation string, args interface{}) (*Response, error)
|
||||
return nil, fmt.Errorf("failed to marshal args: %w", err)
|
||||
}
|
||||
|
||||
// Get current working directory for database routing
|
||||
cwd, _ := os.Getwd()
|
||||
|
||||
req := Request{
|
||||
Operation: operation,
|
||||
Args: argsJSON,
|
||||
ClientVersion: ClientVersion,
|
||||
Cwd: cwd,
|
||||
}
|
||||
|
||||
reqJSON, err := json.Marshal(req)
|
||||
|
||||
Reference in New Issue
Block a user