feat(workspace): session-scoped Caller.Holder + ReleaseByHolder for ACP integration

This commit is contained in:
2026-05-07 14:21:00 +08:00
parent 9fc96b0a1a
commit 3e50da4a49
6 changed files with 91 additions and 4 deletions
+6
View File
@@ -184,6 +184,12 @@ func (s *worktreeService) Release(ctx context.Context, c Caller, wtID uuid.UUID)
return out, nil
}
// ReleaseByHolder 释放给定 holder 字符串持有的所有活跃 worktree。
// 实现仅委托 repo;audit 由 caller 在更高层根据自己上下文写入。
func (s *worktreeService) ReleaseByHolder(ctx context.Context, holder string) ([]*Worktree, error) {
return s.repo.ReleaseWorktreesByHolder(ctx, holder)
}
func (s *worktreeService) audit(ctx context.Context, uid *uuid.UUID, action, ttype, tid string, meta map[string]any) {
_ = s.rec.Record(ctx, audit.Entry{
UserID: uid, Action: action, TargetType: ttype, TargetID: tid, Metadata: meta,