NewLoopWithWorkDir creates a new Loop instance with a configurable working directory. When workDir is empty, defaults to the project root for backward compatibility.
(prdPath, workDir string, prompt string, maxIter int, provider Provider)
| 77 | // NewLoopWithWorkDir creates a new Loop instance with a configurable working directory. |
| 78 | // When workDir is empty, defaults to the project root for backward compatibility. |
| 79 | func NewLoopWithWorkDir(prdPath, workDir string, prompt string, maxIter int, provider Provider) *Loop { |
| 80 | return &Loop{ |
| 81 | prdPath: prdPath, |
| 82 | workDir: workDir, |
| 83 | prompt: prompt, |
| 84 | maxIter: maxIter, |
| 85 | provider: provider, |
| 86 | events: make(chan Event, 100), |
| 87 | retryConfig: DefaultRetryConfig(), |
| 88 | watchdogTimeout: DefaultWatchdogTimeout, |
| 89 | } |
| 90 | } |
| 91 | |
| 92 | // NewLoopWithEmbeddedPrompt creates a new Loop instance using the embedded agent prompt. |
| 93 | // The prompt is rebuilt on each iteration to inline the current story context. |