RegisterWithWorktree registers a PRD with worktree metadata (does not start it).
(name, prdPath, worktreeDir, branch string)
| 166 | |
| 167 | // RegisterWithWorktree registers a PRD with worktree metadata (does not start it). |
| 168 | func (m *Manager) RegisterWithWorktree(name, prdPath, worktreeDir, branch string) error { |
| 169 | m.mu.Lock() |
| 170 | defer m.mu.Unlock() |
| 171 | |
| 172 | // Check if already registered |
| 173 | if _, exists := m.instances[name]; exists { |
| 174 | return fmt.Errorf("PRD %s is already registered", name) |
| 175 | } |
| 176 | |
| 177 | m.instances[name] = &LoopInstance{ |
| 178 | Name: name, |
| 179 | PRDPath: prdPath, |
| 180 | WorktreeDir: worktreeDir, |
| 181 | Branch: branch, |
| 182 | State: LoopStateReady, |
| 183 | } |
| 184 | |
| 185 | return nil |
| 186 | } |
| 187 | |
| 188 | // Unregister removes a PRD from the manager (stops it first if running). |
| 189 | func (m *Manager) Unregister(name string) error { |
no outgoing calls