feat(ext): expose ext meta data to main world

This commit is contained in:
Simon
2026-02-03 16:39:24 +08:00
parent 1a0422f99d
commit 648a0c1bda
5 changed files with 8 additions and 5 deletions

View File

@@ -23,6 +23,10 @@ export default defineUnlistedScript(() => {
return _lastId
}
w.PAGE_AGENT_EXT_INSTALLED = true
w.PAGE_AGENT_EXT_VERSION = __EXT_VERSION__
w.PAGE_AGENT_EXT_CORE_VERSION = __CORE_VERSION__
w.execute = async (task: string, llmConfig: LLMConfig, hooks?: ExecuteHooks) => {
if (typeof task !== 'string') throw new Error('Task must be a string')
if (task.trim().length === 0) throw new Error('Task cannot be empty')