feat: change onAfterStep params

This commit is contained in:
Simon
2026-01-17 23:31:02 +08:00
parent 15ffc27059
commit 722eb10286
2 changed files with 2 additions and 6 deletions

View File

@@ -281,7 +281,7 @@ export class PageAgent extends EventTarget {
console.log(chalk.green('Step finished:'), actionName)
console.groupEnd()
await onAfterStep.call(this, step, this.history)
await onAfterStep.call(this, this.history)
step++
if (step > MAX_STEPS) {

View File

@@ -68,11 +68,7 @@ export interface AgentConfig {
// @todo: remove `this` binding, pass agent as explicit parameter instead
onBeforeStep?: (this: PageAgent, stepCnt: number) => Promise<void> | void
onAfterStep?: (
this: PageAgent,
stepCnt: number,
history: HistoricalEvent[]
) => Promise<void> | void
onAfterStep?: (this: PageAgent, history: HistoricalEvent[]) => Promise<void> | void
onBeforeTask?: (this: PageAgent) => Promise<void> | void
onAfterTask?: (this: PageAgent, result: ExecutionResult) => Promise<void> | void