Register registers a PRD with the manager (does not start it).
(name, prdPath string)
| 147 | |
| 148 | // Register registers a PRD with the manager (does not start it). |
| 149 | func (m *Manager) Register(name, prdPath string) error { |
| 150 | m.mu.Lock() |
| 151 | defer m.mu.Unlock() |
| 152 | |
| 153 | // Check if already registered |
| 154 | if _, exists := m.instances[name]; exists { |
| 155 | return fmt.Errorf("PRD %s is already registered", name) |
| 156 | } |
| 157 | |
| 158 | m.instances[name] = &LoopInstance{ |
| 159 | Name: name, |
| 160 | PRDPath: prdPath, |
| 161 | State: LoopStateReady, |
| 162 | } |
| 163 | |
| 164 | return nil |
| 165 | } |
| 166 | |
| 167 | // RegisterWithWorktree registers a PRD with worktree metadata (does not start it). |
| 168 | func (m *Manager) RegisterWithWorktree(name, prdPath, worktreeDir, branch string) error { |
no outgoing calls