MCPcopy Create free account
hub / github.com/MiniCodeMonkey/chief / RegisterWithWorktree

Method RegisterWithWorktree

internal/loop/manager.go:168–186  ·  view source on GitHub ↗

RegisterWithWorktree registers a PRD with worktree metadata (does not start it).

(name, prdPath, worktreeDir, branch string)

Source from the content-addressed store, hash-verified

166
167// RegisterWithWorktree registers a PRD with worktree metadata (does not start it).
168func (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).
189func (m *Manager) Unregister(name string) error {

Calls

no outgoing calls