refactor(ui): implement dedicated package @page-agent/ui

This commit is contained in:
Simon
2025-12-15 17:34:12 +08:00
parent 2b8b6ef86a
commit d1c8ca8197
18 changed files with 150 additions and 15 deletions

View File

@@ -14,9 +14,7 @@
}
},
"files": [
"dist/",
"README.md",
"LICENSE"
"dist/"
],
"description": "GUI agent for web applications - add intelligent automation to any webpage with a single script",
"keywords": [
@@ -47,9 +45,9 @@
"postpublish": "node -e \"['README.md','LICENSE'].forEach(f=>{try{require('fs').unlinkSync(f)}catch{}})\""
},
"dependencies": {
"ai-motion": "^0.4.7",
"chalk": "^5.6.2",
"zod": "^4.1.12",
"@page-agent/page-controller": "0.0.7"
"@page-agent/page-controller": "0.0.7",
"@page-agent/ui": "0.0.7"
}
}

View File

@@ -3,6 +3,7 @@
* All rights reserved.
*/
import { PageController } from '@page-agent/page-controller'
import { Panel, SimulatorMask } from '@page-agent/ui'
import chalk from 'chalk'
import zod from 'zod'
@@ -11,8 +12,6 @@ import { MAX_STEPS } from './config/constants'
import { LLM, type Tool } from './llms'
import SYSTEM_PROMPT from './prompts/system_prompt.md?raw'
import { tools } from './tools'
import { Panel } from './ui/Panel'
import { SimulatorMask } from './ui/SimulatorMask'
import { trimLines, uid, waitUntil } from './utils'
import { assert } from './utils/assert'

View File

@@ -1,7 +1,7 @@
import type { PageControllerConfig } from '@page-agent/page-controller'
import type { SupportedLanguage } from '@page-agent/ui'
import type { AgentHistory, ExecutionResult, PageAgent } from '../PageAgent'
import type { SupportedLanguage } from '../i18n'
import type { PageAgentTool } from '../tools'
import {
DEFAULT_API_KEY,

View File

@@ -61,6 +61,7 @@ const umdConfig = {
resolve: {
alias: {
'@page-agent/page-controller': resolve(__dirname, '../page-controller/src/PageController.ts'),
'@page-agent/ui': resolve(__dirname, '../ui/src/index.ts'),
},
},
build: {