All public types are exported from theDocumentation Index
Fetch the complete documentation index at: https://mintlify.com/alibaba/page-agent/llms.txt
Use this file to discover all available pages before exploring further.
page-agent package (re-exported from @page-agent/core). Import them directly for full TypeScript type safety in your application code or build tooling integrations.
AgentStatus
Represents the lifecycle state of an agent instance. Transitions flow fromidle → running → completed | error | stopped.
The agent has been constructed but has not yet started a task, or the previous task has been fully torn down.
A task is currently in progress. The agent is executing steps.
The most recent task finished successfully — the LLM called the
done tool with success: true.The task terminated due to an unrecoverable error (LLM error, step limit exceeded, etc.).
The task was cancelled by a user or programmatic call to
agent.stop().AgentActivity
Ephemeral, real-time state describing what the agent is doing right now. UnlikeHistoricalEvent, activities are not persisted. Absence of an activity event means the agent is idle. Listen to the activity event on the agent instance to update live UI.
The LLM is generating its next action.
A tool call has been dispatched and is awaiting its result.
A tool call completed successfully.
The LLM call failed and a retry is about to be attempted.
A terminal error has occurred.
ExecutionResult
Returned byagent.execute(task) and by the Extension API’s window.PAGE_AGENT_EXT.execute().
true if the agent called done with success: true; false on error or user stop.The agent’s final summary text — the value passed to the
done tool’s text parameter.Complete ordered list of all events that occurred during the task. See HistoricalEvent below.
HistoricalEvent
A persisted record of something that occurred during a task. Stored inExecutionResult.history and streamed via onAfterStep and onHistoryUpdate.
A completed LLM reasoning + tool-execution cycle. See AgentStepEvent for the full structure.
A persistent observation injected into the agent’s memory. Stays in context for the duration of the task.
Marks a point at which the user briefly took manual control of the browser.
Records that an LLM call was retried.
A fatal error event that ended the task.
AgentStepEvent
One complete step: the LLM reflected on the previous action and chose a new one.Discriminant literal — always
'step'.Zero-indexed position of this step within the task.
The LLM’s self-reflection before acting. See AgentReflection.
The tool call made during this step.
Token consumption for this step’s LLM call.
Unprocessed LLM response object. Useful for debugging provider-specific fields.
Unprocessed LLM request object. Useful for inspecting exactly what was sent.
AgentReflection
The structured reasoning state the LLM must produce before every tool call. Enforces a reflection-before-action mental model.The LLM’s assessment of whether the previous action achieved its intended goal.
Key information the LLM wants to carry forward into subsequent steps.
A concise statement of what the LLM intends to accomplish in the upcoming action.
PageAgentTool
The interface for both built-in and custom tools. Theexecute function runs with the PageAgentCore instance as this, giving it access to this.pageController and other agent internals.
Natural language description sent to the LLM to help it decide when to call this tool.
Zod schema that defines and validates the tool’s input parameters. Converted to a JSON Schema for the LLM.
Async function that performs the tool action. Must return a descriptive result string. Must honour
ctx.signal — check signal.throwIfAborted() in any loop or pass it to fetch.The tool() helper
Use the tool() helper for full TypeScript inference on execute’s parameter types.
SupportedLanguage
AgentConfig.language. Controls the language of agent-generated UI text and internal prompts.