@@ -258,7 +258,7 @@ export class Agent {
258258 }
259259 }
260260
261- private async _generatePlan ( task : string , _context : AgentContext ) : Promise < Plan > {
261+ private async _generatePlan ( task : string , context : AgentContext ) : Promise < Plan > {
262262 if ( ! this . _reasoningPattern ) {
263263 throw new Error ( 'Reasoning pattern not initialized' ) ;
264264 }
@@ -268,6 +268,10 @@ export class Agent {
268268 currentState : this . _state ,
269269 availableTools : this . _toolExecutor ?. getAvailableTools ( ) || [ ] ,
270270 previousResults : [ ] ,
271+ apiKeys : context . apiKeys ,
272+ files : context . files ,
273+ webcontainer : context . webcontainer ,
274+ workingDirectory : context . workingDirectory ,
271275 } ;
272276
273277 return await this . _reasoningPattern . generatePlan ( task , reasoningContext ) ;
@@ -292,7 +296,7 @@ export class Agent {
292296 return results ;
293297 }
294298
295- private async _executeStep ( step : PlanStep , _context : AgentContext ) : Promise < any > {
299+ private async _executeStep ( step : PlanStep , context : AgentContext ) : Promise < any > {
296300 if ( ! this . _reasoningPattern ) {
297301 throw new Error ( 'Reasoning pattern not initialized' ) ;
298302 }
@@ -302,12 +306,16 @@ export class Agent {
302306 currentState : this . _state ,
303307 availableTools : this . _toolExecutor ?. getAvailableTools ( ) || [ ] ,
304308 previousResults : [ ] ,
309+ apiKeys : context . apiKeys ,
310+ files : context . files ,
311+ webcontainer : context . webcontainer ,
312+ workingDirectory : context . workingDirectory ,
305313 } ;
306314
307315 return await this . _reasoningPattern . executeStep ( step , reasoningContext ) ;
308316 }
309317
310- private async _reflect ( results : any [ ] , task : string , _context : AgentContext ) : Promise < Reflection > {
318+ private async _reflect ( results : any [ ] , task : string , context : AgentContext ) : Promise < Reflection > {
311319 if ( ! this . _reasoningPattern ) {
312320 throw new Error ( 'Reasoning pattern not initialized' ) ;
313321 }
@@ -317,6 +325,10 @@ export class Agent {
317325 currentState : this . _state ,
318326 availableTools : this . _toolExecutor ?. getAvailableTools ( ) || [ ] ,
319327 previousResults : results ,
328+ apiKeys : context . apiKeys ,
329+ files : context . files ,
330+ webcontainer : context . webcontainer ,
331+ workingDirectory : context . workingDirectory ,
320332 } ;
321333
322334 return await this . _reasoningPattern . reflect ( results , task , reasoningContext ) ;
0 commit comments