Show actor on status/pinned change events in activity feed
Added actor field to RPC client and set it before daemon requests. This ensures status changes (like pinned events) show who performed the action in bd activity output. Changes: - Added actor field to Client struct - Added SetActor method to set actor for audit trail - Modified ExecuteWithCwd to include actor in RPC requests - Updated main.go to call SetActor after daemon connection Fixes gt-1ydd9 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
@@ -37,6 +37,7 @@ type Client struct {
|
||||
socketPath string
|
||||
timeout time.Duration
|
||||
dbPath string // Expected database path for validation
|
||||
actor string // Actor for audit trail (who is performing operations)
|
||||
}
|
||||
|
||||
// TryConnect attempts to connect to the daemon socket
|
||||
@@ -157,6 +158,11 @@ func (c *Client) SetDatabasePath(dbPath string) {
|
||||
c.dbPath = dbPath
|
||||
}
|
||||
|
||||
// SetActor sets the actor for audit trail (who is performing operations)
|
||||
func (c *Client) SetActor(actor string) {
|
||||
c.actor = actor
|
||||
}
|
||||
|
||||
// Execute sends an RPC request and waits for a response
|
||||
func (c *Client) Execute(operation string, args interface{}) (*Response, error) {
|
||||
return c.ExecuteWithCwd(operation, args, "")
|
||||
@@ -177,6 +183,7 @@ func (c *Client) ExecuteWithCwd(operation string, args interface{}, cwd string)
|
||||
req := Request{
|
||||
Operation: operation,
|
||||
Args: argsJSON,
|
||||
Actor: c.actor, // Who is performing this operation
|
||||
ClientVersion: ClientVersion,
|
||||
Cwd: cwd,
|
||||
ExpectedDB: c.dbPath, // Send expected database path for validation
|
||||
|
||||
Reference in New Issue
Block a user