| 262 | // Terminal paths append follow-up reminders, so the agent needs a context |
| 263 | // exposing appendSystemReminder. |
| 264 | function agentWithContext( |
| 265 | store: GoalMode, |
| 266 | reminders: Array<{ readonly content: string; readonly origin: unknown }> = [], |
| 267 | ): Agent { |
| 268 | return { |
| 269 | type: 'main', |
| 270 | goal: store, |
| 271 | context: { |
| 272 | appendSystemReminder: (content: string, origin: unknown) => { |
| 273 | reminders.push({ content, origin }); |
| 274 | }, |
| 275 | }, |
| 276 | } as unknown as Agent; |
| 277 | } |
| 278 | |
| 279 | it('accepts only active / complete / paused / blocked', () => { |
| 280 | for (const status of ['active', 'complete', 'paused', 'blocked']) { |