chore: prettier json and markdowns

This commit is contained in:
Simon
2026-01-17 16:15:36 +08:00
parent 0fc88c0080
commit 54e9bdad7d
30 changed files with 8823 additions and 8812 deletions

View File

@@ -6,7 +6,7 @@ on:
- 'v*' - 'v*'
permissions: permissions:
id-token: write # Required for OIDC id-token: write # Required for OIDC
contents: read contents: read
jobs: jobs:

View File

@@ -1,3 +1,3 @@
{ {
"recommendations": ["dbaeumer.vscode-eslint", "prettier.prettier-vscode"] "recommendations": ["dbaeumer.vscode-eslint", "prettier.prettier-vscode"]
} }

54
.vscode/settings.json vendored
View File

@@ -1,29 +1,29 @@
{ {
"editor.fontLigatures": true, "editor.fontLigatures": true,
"cSpell.words": [ "cSpell.words": [
"deepseek", "deepseek",
"HITL", "HITL",
"innerhtml", "innerhtml",
"llms", "llms",
"onwarn", "onwarn",
"opensource", "opensource",
"qwen", "qwen",
"retryable", "retryable",
"shadcn", "shadcn",
"wouter" "wouter"
], ],
"markdownlint.config": { "markdownlint.config": {
// "comment": "Relaxed rules", // "comment": "Relaxed rules",
"default": true, "default": true,
"whitespace": false, "whitespace": false,
"line_length": false, "line_length": false,
"ul-indent": false, "ul-indent": false,
"no-inline-html": false, "no-inline-html": false,
"no-bare-urls": false, "no-bare-urls": false,
"fenced-code-language": false, "fenced-code-language": false,
"first-line-h1": false, "first-line-h1": false,
"block-spacing": false, "block-spacing": false,
"blanks-around-lists": false, "blanks-around-lists": false,
"ol-prefix": false "ol-prefix": false
} }
} }

View File

@@ -7,16 +7,16 @@ Thank you for your interest in contributing to Page-Agent! We welcome contributi
### Development Setup ### Development Setup
1. **Prerequisites** 1. **Prerequisites**
- `node.js >= 20` with `npm >= 10` - `node.js >= 20` with `npm >= 10`
- An editor that supports `ts/eslint/prettier` - An editor that supports `ts/eslint/prettier`
- Make sure `eslint`, `prettier` and `commitlint` work well - Make sure `eslint`, `prettier` and `commitlint` work well
2. **Setup** 2. **Setup**
```bash ```bash
npm ci npm ci
npm start # Start demo and documentation site npm start # Start demo and documentation site
``` ```
### Project Structure ### Project Structure
@@ -44,39 +44,39 @@ We use a simplified monorepo solution with `native npm-workspace + ts reference
1. **Fork and Clone** 1. **Fork and Clone**
```bash ```bash
git clone https://github.com/your-username/page-agent.git git clone https://github.com/your-username/page-agent.git
cd page-agent cd page-agent
``` ```
2. **Create Feature Branch** 2. **Create Feature Branch**
```bash ```bash
git checkout -b feat/your-feature-name git checkout -b feat/your-feature-name
``` ```
3. **Make Changes** 3. **Make Changes**
- Follow existing code style and patterns - Follow existing code style and patterns
- Add tests for new functionality - Add tests for new functionality
- Update documentation as needed - Update documentation as needed
4. **Test Your Changes** 4. **Test Your Changes**
- Test in our demo website - Test in our demo website
- Test it on other websites if applicable - Test it on other websites if applicable
- `@TODO: test suite` - `@TODO: test suite`
5. **Commit and Push** 5. **Commit and Push**
```bash ```bash
git add . git add .
git commit -m "feat: add awesome feature" git commit -m "feat: add awesome feature"
git push origin feat/your-feature-name git push origin feat/your-feature-name
``` ```
6. **Create Pull Request** 6. **Create Pull Request**
- Provide clear description of changes - Provide clear description of changes
- Link related issues - Link related issues
- Include screenshots for UI changes - Include screenshots for UI changes
## 📝 Code Style ## 📝 Code Style
@@ -101,11 +101,11 @@ We use a simplified monorepo solution with `native npm-workspace + ts reference
- Create a `.env` file in the repo root with your LLM API config - Create a `.env` file in the repo root with your LLM API config
```env ```env
LLM_MODEL_NAME=gpt-5.2 LLM_MODEL_NAME=gpt-5.2
LLM_API_KEY=your-api-key LLM_API_KEY=your-api-key
LLM_BASE_URL=https://api.your-llm-provider.com/v1 LLM_BASE_URL=https://api.your-llm-provider.com/v1
``` ```
- Restart the dev server to load new env vars - Restart the dev server to load new env vars
- If not provided, the demo will the free testing proxy by default - If not provided, the demo will the free testing proxy by default
@@ -120,15 +120,15 @@ npm start
- Start and serve a local `iife` script - Start and serve a local `iife` script
```bash ```bash
npm run dev:iife # Serving IIFE with auto rebuild at http://localhost:5174/page-agent.js npm run dev:iife # Serving IIFE with auto rebuild at http://localhost:5174/page-agent.js
``` ```
- Add a new bookmark - Add a new bookmark
```javascript ```javascript
javascript:(function(){var s=document.createElement('script');s.src=`http://localhost:5174/page-agent.js?t=${Math.random()}`;s.onload=()=>console.log(%27PageAgent ready!%27);document.head.appendChild(s);})(); javascript:(function(){var s=document.createElement('script');s.src=`http://localhost:5174/page-agent.js?t=${Math.random()}`;s.onload=()=>console.log(%27PageAgent ready!%27);document.head.appendChild(s);})();
``` ```
- Click the bookmark on any page to load Page-Agent - Click the bookmark on any page to load Page-Agent

View File

@@ -37,8 +37,8 @@
```html ```html
<script <script
src="https://registry.npmmirror.com/@page-agent/cdn/latest/files/dist/page-agent.demo.js" src="https://registry.npmmirror.com/@page-agent/cdn/latest/files/dist/page-agent.demo.js"
crossorigin="true" crossorigin="true"
></script> ></script>
``` ```
@@ -59,10 +59,10 @@ npm install page-agent
import { PageAgent } from 'page-agent' import { PageAgent } from 'page-agent'
const agent = new PageAgent({ const agent = new PageAgent({
model: 'deepseek-chat', model: 'deepseek-chat',
baseURL: 'https://api.deepseek.com', baseURL: 'https://api.deepseek.com',
apiKey: 'YOUR_API_KEY', apiKey: 'YOUR_API_KEY',
language: 'zh-CN', language: 'zh-CN',
}) })
await agent.execute('点击登录按钮') await agent.execute('点击登录按钮')

View File

@@ -37,8 +37,8 @@ Fastest way to try PageAgent:
```html ```html
<script <script
src="https://cdn.jsdelivr.net/npm/@page-agent/cdn/dist/page-agent.demo.js" src="https://cdn.jsdelivr.net/npm/@page-agent/cdn/dist/page-agent.demo.js"
crossorigin="true" crossorigin="true"
></script> ></script>
``` ```
@@ -59,10 +59,10 @@ npm install page-agent
import { PageAgent } from 'page-agent' import { PageAgent } from 'page-agent'
const agent = new PageAgent({ const agent = new PageAgent({
model: 'deepseek-chat', model: 'deepseek-chat',
baseURL: 'https://api.deepseek.com', baseURL: 'https://api.deepseek.com',
apiKey: 'YOUR_API_KEY', apiKey: 'YOUR_API_KEY',
language: 'en-US', language: 'en-US',
}) })
await agent.execute('Click the login button') await agent.execute('Click the login button')

16416
package-lock.json generated

File diff suppressed because it is too large Load Diff

View File

@@ -1,107 +1,123 @@
{ {
"name": "root", "name": "root",
"private": true, "private": true,
"version": "0.2.3", "version": "0.2.3",
"type": "module", "type": "module",
"workspaces": [ "workspaces": [
"packages/page-controller", "packages/page-controller",
"packages/ui", "packages/ui",
"packages/llms", "packages/llms",
"packages/page-agent", "packages/page-agent",
"packages/cdn", "packages/cdn",
"packages/website" "packages/website"
], ],
"description": "AI-powered UI agent for web applications", "description": "AI-powered UI agent for web applications",
"author": "Simon<gaomeng1900>", "author": "Simon<gaomeng1900>",
"license": "MIT", "license": "MIT",
"repository": { "repository": {
"type": "git", "type": "git",
"url": "https://github.com/alibaba/page-agent.git" "url": "https://github.com/alibaba/page-agent.git"
}, },
"homepage": "https://alibaba.github.io/page-agent/", "homepage": "https://alibaba.github.io/page-agent/",
"engines": { "engines": {
"node": ">=20.0.0", "node": ">=20.0.0",
"npm": ">=10.0.0" "npm": ">=10.0.0"
}, },
"scripts": { "scripts": {
"cleanup": "rm -rf packages/*/dist", "cleanup": "rm -rf packages/*/dist",
"start": "npm run dev --workspace=@page-agent/website", "start": "npm run dev --workspace=@page-agent/website",
"build:website": "npm run build:website --workspace=@page-agent/website", "build:website": "npm run build:website --workspace=@page-agent/website",
"build:libs": "npm run build --workspaces --if-present", "build:libs": "npm run build --workspaces --if-present",
"build": "npm run build:libs && npm run build:website", "build": "npm run build:libs && npm run build:website",
"dev:iife": "npm run dev:iife --workspace=page-agent", "dev:iife": "npm run dev:iife --workspace=page-agent",
"version": "node scripts/sync-version.js", "version": "node scripts/sync-version.js",
"lint": "eslint .", "lint": "eslint .",
"prepare": "husky" "prepare": "husky"
}, },
"devDependencies": { "devDependencies": {
"@commitlint/cli": "^20.3.1", "@commitlint/cli": "^20.3.1",
"@commitlint/config-conventional": "^20.3.1", "@commitlint/config-conventional": "^20.3.1",
"@eslint/js": "^9.39.2", "@eslint/js": "^9.39.2",
"@microsoft/api-extractor": "^7.55.2", "@microsoft/api-extractor": "^7.55.2",
"@trivago/prettier-plugin-sort-imports": "^6.0.2", "@trivago/prettier-plugin-sort-imports": "^6.0.2",
"@types/node": "^25.0.7", "@types/node": "^25.0.7",
"concurrently": "^9.2.1", "concurrently": "^9.2.1",
"dotenv": "^17.2.3", "dotenv": "^17.2.3",
"eslint": "^9.39.2", "eslint": "^9.39.2",
"eslint-config-prettier": "^10.1.8", "eslint-config-prettier": "^10.1.8",
"eslint-plugin-react-dom": "^2.5.7", "eslint-plugin-react-dom": "^2.5.7",
"eslint-plugin-react-hooks": "^7.0.1", "eslint-plugin-react-hooks": "^7.0.1",
"eslint-plugin-react-refresh": "^0.4.26", "eslint-plugin-react-refresh": "^0.4.26",
"eslint-plugin-react-x": "^2.5.7", "eslint-plugin-react-x": "^2.5.7",
"globals": "^17.0.0", "globals": "^17.0.0",
"husky": "^9.1.7", "husky": "^9.1.7",
"lint-staged": "^16.2.4", "lint-staged": "^16.2.4",
"prettier": "^3.7.4", "prettier": "^3.7.4",
"typescript": "^5.9.3", "typescript": "^5.9.3",
"typescript-eslint": "^8.53.0", "typescript-eslint": "^8.53.0",
"unplugin-dts": "^1.0.0-beta.6", "unplugin-dts": "^1.0.0-beta.6",
"vite": "^7.3.1", "vite": "^7.3.1",
"vite-plugin-css-injected-by-js": "^3.5.2" "vite-plugin-css-injected-by-js": "^3.5.2"
}, },
"overrides": { "overrides": {
"typescript": "^5.9.3" "typescript": "^5.9.3"
}, },
"lint-staged": { "lint-staged": {
"*.{js,ts,cjs,cts,mjs,mts}": [ "*.{js,ts,cjs,cts,mjs,mts}": [
"npx prettier --write --ignore-unknown", "npx prettier --write --ignore-unknown",
"npx eslint --quiet" "npx eslint --quiet"
], ],
"*.{jsx,tsx}": [ "*.{jsx,tsx}": [
"npx prettier --write --ignore-unknown", "npx prettier --write --ignore-unknown",
"npx eslint --quiet" "npx eslint --quiet"
], ],
"*.css": [ "*.css": [
"npx prettier --write --ignore-unknown" "npx prettier --write --ignore-unknown"
] ]
}, },
"commitlint": { "commitlint": {
"extends": [ "extends": [
"@commitlint/config-conventional" "@commitlint/config-conventional"
], ],
"rules": { "rules": {
"subject-case": [ "subject-case": [
0, 0,
"never" "never"
] ]
} }
}, },
"prettier": { "prettier": {
"singleQuote": true, "singleQuote": true,
"semi": false, "semi": false,
"useTabs": true, "useTabs": true,
"printWidth": 100, "printWidth": 100,
"trailingComma": "es5", "trailingComma": "es5",
"plugins": [ "plugins": [
"@trivago/prettier-plugin-sort-imports" "@trivago/prettier-plugin-sort-imports"
], ],
"importOrder": [ "importOrder": [
"<THIRD_PARTY_MODULES>", "<THIRD_PARTY_MODULES>",
"^(@/).*(?<!css)$", "^(@/).*(?<!css)$",
"^[./].*(?<!css)$", "^[./].*(?<!css)$",
".css$" ".css$"
], ],
"importOrderSeparation": true, "importOrderSeparation": true,
"importOrderSortSpecifiers": true "importOrderSortSpecifiers": true,
} "overrides": [
{
"files": "*.md",
"options": {
"useTabs": false,
"tabWidth": 4
}
},
{
"files": "*.json",
"options": {
"useTabs": false,
"tabWidth": 4
}
}
]
}
} }

View File

@@ -1,23 +1,23 @@
{ {
"name": "@page-agent/cdn", "name": "@page-agent/cdn",
"private": false, "private": false,
"version": "0.2.3", "version": "0.2.3",
"type": "module", "type": "module",
"files": [ "files": [
"dist/" "dist/"
], ],
"description": "CDN builds for page-agent - IIFE bundles for script tag usage", "description": "CDN builds for page-agent - IIFE bundles for script tag usage",
"author": "Simon<gaomeng1900>", "author": "Simon<gaomeng1900>",
"license": "MIT", "license": "MIT",
"repository": { "repository": {
"type": "git", "type": "git",
"url": "https://github.com/alibaba/page-agent.git" "url": "https://github.com/alibaba/page-agent.git"
}, },
"homepage": "https://alibaba.github.io/page-agent/", "homepage": "https://alibaba.github.io/page-agent/",
"scripts": { "scripts": {
"build": "vite build && vite build --mode demo" "build": "vite build && vite build --mode demo"
}, },
"dependencies": { "dependencies": {
"page-agent": "0.2.3" "page-agent": "0.2.3"
} }
} }

View File

@@ -1,43 +1,43 @@
{ {
"name": "@page-agent/llms", "name": "@page-agent/llms",
"version": "0.2.3", "version": "0.2.3",
"type": "module", "type": "module",
"main": "./dist/lib/page-agent-llms.js", "main": "./dist/lib/page-agent-llms.js",
"module": "./dist/lib/page-agent-llms.js", "module": "./dist/lib/page-agent-llms.js",
"types": "./dist/lib/index.d.ts", "types": "./dist/lib/index.d.ts",
"exports": { "exports": {
".": { ".": {
"types": "./dist/lib/index.d.ts", "types": "./dist/lib/index.d.ts",
"import": "./dist/lib/page-agent-llms.js", "import": "./dist/lib/page-agent-llms.js",
"default": "./dist/lib/page-agent-llms.js" "default": "./dist/lib/page-agent-llms.js"
} }
}, },
"files": [ "files": [
"dist/" "dist/"
], ],
"description": "LLM client with reflection-before-action mental model for page-agent", "description": "LLM client with reflection-before-action mental model for page-agent",
"keywords": [ "keywords": [
"page-agent", "page-agent",
"llm", "llm",
"openai", "openai",
"tool-calling", "tool-calling",
"agent" "agent"
], ],
"author": "Simon<gaomeng1900>", "author": "Simon<gaomeng1900>",
"license": "MIT", "license": "MIT",
"repository": { "repository": {
"type": "git", "type": "git",
"url": "https://github.com/alibaba/page-agent.git", "url": "https://github.com/alibaba/page-agent.git",
"directory": "packages/llms" "directory": "packages/llms"
}, },
"homepage": "https://alibaba.github.io/page-agent/", "homepage": "https://alibaba.github.io/page-agent/",
"scripts": { "scripts": {
"build": "vite build", "build": "vite build",
"prepublishOnly": "node -e \"const fs=require('fs');['LICENSE'].forEach(f=>fs.copyFileSync('../../'+f,f))\"", "prepublishOnly": "node -e \"const fs=require('fs');['LICENSE'].forEach(f=>fs.copyFileSync('../../'+f,f))\"",
"postpublish": "node -e \"['LICENSE'].forEach(f=>{try{require('fs').unlinkSync(f)}catch{}})\"" "postpublish": "node -e \"['LICENSE'].forEach(f=>{try{require('fs').unlinkSync(f)}catch{}})\""
}, },
"dependencies": { "dependencies": {
"chalk": "^5.6.2", "chalk": "^5.6.2",
"zod": "^4.3.5" "zod": "^4.3.5"
} }
} }

View File

@@ -1,10 +1,9 @@
{ {
"extends": "./tsconfig.json", "extends": "./tsconfig.json",
"compilerOptions": { "compilerOptions": {
// @workaround DTS bug // @workaround DTS bug
// dts do not work with monorepo path mapping // dts do not work with monorepo path mapping
// disable path mapping for it // disable path mapping for it
"paths": {} "paths": {}
} }
} }

View File

@@ -1,13 +1,12 @@
{ {
"extends": "../../tsconfig.base.json", "extends": "../../tsconfig.base.json",
"compilerOptions": { "compilerOptions": {
"tsBuildInfoFile": "./node_modules/.tmp/tsconfig.tsbuildinfo", "tsBuildInfoFile": "./node_modules/.tmp/tsconfig.tsbuildinfo",
"noEmit": false, "noEmit": false,
"allowImportingTsExtensions": false, "allowImportingTsExtensions": false,
"baseUrl": ".", "baseUrl": ".",
"outDir": "dist" "outDir": "dist"
}, },
"include": ["**/*.ts"], "include": ["**/*.ts"],
"exclude": ["dist", "node_modules"] "exclude": ["dist", "node_modules"]
} }

View File

@@ -1,52 +1,52 @@
{ {
"name": "page-agent", "name": "page-agent",
"private": false, "private": false,
"version": "0.2.3", "version": "0.2.3",
"type": "module", "type": "module",
"main": "./dist/esm/page-agent.js", "main": "./dist/esm/page-agent.js",
"module": "./dist/esm/page-agent.js", "module": "./dist/esm/page-agent.js",
"types": "./dist/esm/PageAgent.d.ts", "types": "./dist/esm/PageAgent.d.ts",
"exports": { "exports": {
".": { ".": {
"types": "./dist/esm/PageAgent.d.ts", "types": "./dist/esm/PageAgent.d.ts",
"import": "./dist/esm/page-agent.js", "import": "./dist/esm/page-agent.js",
"default": "./dist/esm/page-agent.js" "default": "./dist/esm/page-agent.js"
} }
}, },
"files": [ "files": [
"dist/" "dist/"
], ],
"description": "GUI agent for web applications - add intelligent automation to any webpage with a single script", "description": "GUI agent for web applications - add intelligent automation to any webpage with a single script",
"keywords": [ "keywords": [
"ai", "ai",
"automation", "automation",
"ui-agent", "ui-agent",
"GUI-agent", "GUI-agent",
"browser-automation", "browser-automation",
"web-agent", "web-agent",
"llm", "llm",
"dom-interaction", "dom-interaction",
"web-automation", "web-automation",
"GUI-simulation" "GUI-simulation"
], ],
"author": "Simon<gaomeng1900>", "author": "Simon<gaomeng1900>",
"license": "MIT", "license": "MIT",
"repository": { "repository": {
"type": "git", "type": "git",
"url": "https://github.com/alibaba/page-agent.git" "url": "https://github.com/alibaba/page-agent.git"
}, },
"homepage": "https://alibaba.github.io/page-agent/", "homepage": "https://alibaba.github.io/page-agent/",
"scripts": { "scripts": {
"build": "vite build", "build": "vite build",
"dev:iife": "concurrently \"vite build --config vite.iife.config.js --watch\" \"npx serve dist/iife -p 5174\"", "dev:iife": "concurrently \"vite build --config vite.iife.config.js --watch\" \"npx serve dist/iife -p 5174\"",
"prepublishOnly": "node -e \"const fs=require('fs');['README.md','LICENSE'].forEach(f=>fs.copyFileSync('../../'+f,f))\"", "prepublishOnly": "node -e \"const fs=require('fs');['README.md','LICENSE'].forEach(f=>fs.copyFileSync('../../'+f,f))\"",
"postpublish": "node -e \"['README.md','LICENSE'].forEach(f=>{try{require('fs').unlinkSync(f)}catch{}})\"" "postpublish": "node -e \"['README.md','LICENSE'].forEach(f=>{try{require('fs').unlinkSync(f)}catch{}})\""
}, },
"dependencies": { "dependencies": {
"chalk": "^5.6.2", "chalk": "^5.6.2",
"zod": "^4.3.5", "zod": "^4.3.5",
"@page-agent/llms": "0.2.3", "@page-agent/llms": "0.2.3",
"@page-agent/page-controller": "0.2.3", "@page-agent/page-controller": "0.2.3",
"@page-agent/ui": "0.2.3" "@page-agent/ui": "0.2.3"
} }
} }

View File

@@ -1,9 +1,9 @@
{ {
"extends": "./tsconfig.json", "extends": "./tsconfig.json",
"compilerOptions": { "compilerOptions": {
// @workaround DTS bug // @workaround DTS bug
// dts do not work with monorepo path mapping // dts do not work with monorepo path mapping
// disable path mapping for it // disable path mapping for it
"paths": {} "paths": {}
} }
} }

View File

@@ -1,24 +1,24 @@
{ {
"extends": "../../tsconfig.base.json", "extends": "../../tsconfig.base.json",
"compilerOptions": { "compilerOptions": {
"tsBuildInfoFile": "./node_modules/.tmp/tsconfig.tsbuildinfo", "tsBuildInfoFile": "./node_modules/.tmp/tsconfig.tsbuildinfo",
"noEmit": false, "noEmit": false,
"allowImportingTsExtensions": false, "allowImportingTsExtensions": false,
"baseUrl": ".", "baseUrl": ".",
"outDir": "dist", "outDir": "dist",
"paths": { "paths": {
// //
"@page-agent/llms": ["../llms/src/index.ts"], "@page-agent/llms": ["../llms/src/index.ts"],
"@page-agent/page-controller": ["../page-controller/src/PageController.ts"], "@page-agent/page-controller": ["../page-controller/src/PageController.ts"],
"@page-agent/ui": ["../ui/src/index.ts"] "@page-agent/ui": ["../ui/src/index.ts"]
} }
}, },
"include": ["**/*.ts"], "include": ["**/*.ts"],
"exclude": ["dist", "node_modules"], "exclude": ["dist", "node_modules"],
"references": [ "references": [
// //
{ "path": "../llms" }, { "path": "../llms" },
{ "path": "../page-controller" }, { "path": "../page-controller" },
{ "path": "../ui" } { "path": "../ui" }
] ]
} }

View File

@@ -1,41 +1,41 @@
{ {
"name": "@page-agent/page-controller", "name": "@page-agent/page-controller",
"version": "0.2.3", "version": "0.2.3",
"type": "module", "type": "module",
"main": "./dist/lib/page-controller.js", "main": "./dist/lib/page-controller.js",
"module": "./dist/lib/page-controller.js", "module": "./dist/lib/page-controller.js",
"types": "./dist/lib/PageController.d.ts", "types": "./dist/lib/PageController.d.ts",
"exports": { "exports": {
".": { ".": {
"types": "./dist/lib/PageController.d.ts", "types": "./dist/lib/PageController.d.ts",
"import": "./dist/lib/page-controller.js", "import": "./dist/lib/page-controller.js",
"default": "./dist/lib/page-controller.js" "default": "./dist/lib/page-controller.js"
} }
}, },
"files": [ "files": [
"dist/" "dist/"
], ],
"description": "Page controller for page-agent - DOM operations and element interactions", "description": "Page controller for page-agent - DOM operations and element interactions",
"keywords": [ "keywords": [
"page-agent", "page-agent",
"dom", "dom",
"browser-automation", "browser-automation",
"web-automation" "web-automation"
], ],
"author": "Simon<gaomeng1900>", "author": "Simon<gaomeng1900>",
"license": "MIT", "license": "MIT",
"repository": { "repository": {
"type": "git", "type": "git",
"url": "https://github.com/alibaba/page-agent.git", "url": "https://github.com/alibaba/page-agent.git",
"directory": "packages/page-controller" "directory": "packages/page-controller"
}, },
"homepage": "https://alibaba.github.io/page-agent/", "homepage": "https://alibaba.github.io/page-agent/",
"scripts": { "scripts": {
"build": "vite build", "build": "vite build",
"prepublishOnly": "node -e \"const fs=require('fs');['LICENSE'].forEach(f=>fs.copyFileSync('../../'+f,f))\"", "prepublishOnly": "node -e \"const fs=require('fs');['LICENSE'].forEach(f=>fs.copyFileSync('../../'+f,f))\"",
"postpublish": "node -e \"['LICENSE'].forEach(f=>{try{require('fs').unlinkSync(f)}catch{}})\"" "postpublish": "node -e \"['LICENSE'].forEach(f=>{try{require('fs').unlinkSync(f)}catch{}})\""
}, },
"dependencies": { "dependencies": {
"ai-motion": "^0.4.8" "ai-motion": "^0.4.8"
} }
} }

View File

@@ -1,9 +1,9 @@
{ {
"extends": "./tsconfig.json", "extends": "./tsconfig.json",
"compilerOptions": { "compilerOptions": {
// @workaround DTS bug // @workaround DTS bug
// dts do not work with monorepo path mapping // dts do not work with monorepo path mapping
// disable path mapping for it // disable path mapping for it
"paths": {} "paths": {}
} }
} }

View File

@@ -1,12 +1,12 @@
{ {
"extends": "../../tsconfig.base.json", "extends": "../../tsconfig.base.json",
"compilerOptions": { "compilerOptions": {
"tsBuildInfoFile": "./node_modules/.tmp/tsconfig.tsbuildinfo", "tsBuildInfoFile": "./node_modules/.tmp/tsconfig.tsbuildinfo",
"noEmit": false, "noEmit": false,
"allowImportingTsExtensions": false, "allowImportingTsExtensions": false,
"baseUrl": ".", "baseUrl": ".",
"outDir": "dist" "outDir": "dist"
}, },
"include": ["**/*.ts", "**/*.js"], "include": ["**/*.ts", "**/*.js"],
"exclude": ["dist", "node_modules"] "exclude": ["dist", "node_modules"]
} }

View File

@@ -1,38 +1,38 @@
{ {
"name": "@page-agent/ui", "name": "@page-agent/ui",
"version": "0.2.3", "version": "0.2.3",
"type": "module", "type": "module",
"main": "./dist/lib/page-agent-ui.js", "main": "./dist/lib/page-agent-ui.js",
"module": "./dist/lib/page-agent-ui.js", "module": "./dist/lib/page-agent-ui.js",
"types": "./dist/lib/index.d.ts", "types": "./dist/lib/index.d.ts",
"exports": { "exports": {
".": { ".": {
"types": "./dist/lib/index.d.ts", "types": "./dist/lib/index.d.ts",
"import": "./dist/lib/page-agent-ui.js", "import": "./dist/lib/page-agent-ui.js",
"default": "./dist/lib/page-agent-ui.js" "default": "./dist/lib/page-agent-ui.js"
} }
}, },
"files": [ "files": [
"dist/" "dist/"
], ],
"description": "UI components for page-agent - Panel and i18n", "description": "UI components for page-agent - Panel and i18n",
"keywords": [ "keywords": [
"page-agent", "page-agent",
"ui", "ui",
"panel", "panel",
"i18n" "i18n"
], ],
"author": "Simon<gaomeng1900>", "author": "Simon<gaomeng1900>",
"license": "MIT", "license": "MIT",
"repository": { "repository": {
"type": "git", "type": "git",
"url": "https://github.com/alibaba/page-agent.git", "url": "https://github.com/alibaba/page-agent.git",
"directory": "packages/ui" "directory": "packages/ui"
}, },
"homepage": "https://alibaba.github.io/page-agent/", "homepage": "https://alibaba.github.io/page-agent/",
"scripts": { "scripts": {
"build": "vite build", "build": "vite build",
"prepublishOnly": "node -e \"const fs=require('fs');['LICENSE'].forEach(f=>fs.copyFileSync('../../'+f,f))\"", "prepublishOnly": "node -e \"const fs=require('fs');['LICENSE'].forEach(f=>fs.copyFileSync('../../'+f,f))\"",
"postpublish": "node -e \"['LICENSE'].forEach(f=>{try{require('fs').unlinkSync(f)}catch{}})\"" "postpublish": "node -e \"['LICENSE'].forEach(f=>{try{require('fs').unlinkSync(f)}catch{}})\""
} }
} }

View File

@@ -1,10 +1,9 @@
{ {
"extends": "./tsconfig.json", "extends": "./tsconfig.json",
"compilerOptions": { "compilerOptions": {
// @workaround DTS bug // @workaround DTS bug
// dts do not work with monorepo path mapping // dts do not work with monorepo path mapping
// disable path mapping for it // disable path mapping for it
"paths": {} "paths": {}
} }
} }

View File

@@ -1,13 +1,12 @@
{ {
"extends": "../../tsconfig.base.json", "extends": "../../tsconfig.base.json",
"compilerOptions": { "compilerOptions": {
"tsBuildInfoFile": "./node_modules/.tmp/tsconfig.tsbuildinfo", "tsBuildInfoFile": "./node_modules/.tmp/tsconfig.tsbuildinfo",
"noEmit": false, "noEmit": false,
"allowImportingTsExtensions": false, "allowImportingTsExtensions": false,
"baseUrl": ".", "baseUrl": ".",
"outDir": "dist" "outDir": "dist"
}, },
"include": ["**/*.ts", "**/*.js"], "include": ["**/*.ts", "**/*.js"],
"exclude": ["dist", "node_modules"] "exclude": ["dist", "node_modules"]
} }

View File

@@ -1,24 +1,24 @@
{ {
"$schema": "https://ui.shadcn.com/schema.json", "$schema": "https://ui.shadcn.com/schema.json",
"style": "new-york", "style": "new-york",
"rsc": false, "rsc": false,
"tsx": true, "tsx": true,
"tailwind": { "tailwind": {
"config": "", "config": "",
"css": "src/index.css", "css": "src/index.css",
"baseColor": "neutral", "baseColor": "neutral",
"cssVariables": true, "cssVariables": true,
"prefix": "" "prefix": ""
}, },
"iconLibrary": "lucide", "iconLibrary": "lucide",
"aliases": { "aliases": {
"components": "@/components", "components": "@/components",
"utils": "@/lib/utils", "utils": "@/lib/utils",
"ui": "@/components/ui", "ui": "@/components/ui",
"lib": "@/lib", "lib": "@/lib",
"hooks": "@/hooks" "hooks": "@/hooks"
}, },
"registries": { "registries": {
"@magicui": "https://magicui.design/r/{name}.json" "@magicui": "https://magicui.design/r/{name}.json"
} }
} }

View File

@@ -1,42 +1,42 @@
{ {
"name": "@page-agent/website", "name": "@page-agent/website",
"private": true, "private": true,
"version": "0.2.3", "version": "0.2.3",
"type": "module", "type": "module",
"scripts": { "scripts": {
"dev": "vite --host 0.0.0.0", "dev": "vite --host 0.0.0.0",
"build:website": "vite build", "build:website": "vite build",
"preview": "vite preview", "preview": "vite preview",
"typecheck": "tsc --noEmit" "typecheck": "tsc --noEmit"
}, },
"devDependencies": { "devDependencies": {
"@tailwindcss/vite": "^4.1.18", "@tailwindcss/vite": "^4.1.18",
"@types/react": "^19.2.8", "@types/react": "^19.2.8",
"@types/react-dom": "^19.2.1", "@types/react-dom": "^19.2.1",
"@vitejs/plugin-react-swc": "^4.1.0", "@vitejs/plugin-react-swc": "^4.1.0",
"i18next": "^25.7.4", "i18next": "^25.7.4",
"i18next-browser-languagedetector": "^8.2.0", "i18next-browser-languagedetector": "^8.2.0",
"react": "^19.2.3", "react": "^19.2.3",
"react-dom": "^19.2.3", "react-dom": "^19.2.3",
"react-i18next": "^16.5.2", "react-i18next": "^16.5.2",
"tailwindcss": "^4.1.14", "tailwindcss": "^4.1.14",
"tw-animate-css": "^1.4.0", "tw-animate-css": "^1.4.0",
"wouter": "^3.9.0" "wouter": "^3.9.0"
}, },
"dependencies": { "dependencies": {
"@radix-ui/react-icons": "^1.3.2", "@radix-ui/react-icons": "^1.3.2",
"@radix-ui/react-separator": "^1.1.8", "@radix-ui/react-separator": "^1.1.8",
"@radix-ui/react-slot": "^1.2.4", "@radix-ui/react-slot": "^1.2.4",
"@radix-ui/react-switch": "^1.2.6", "@radix-ui/react-switch": "^1.2.6",
"@radix-ui/react-tooltip": "^1.2.8", "@radix-ui/react-tooltip": "^1.2.8",
"class-variance-authority": "^0.7.1", "class-variance-authority": "^0.7.1",
"clsx": "^2.1.1", "clsx": "^2.1.1",
"lucide-react": "^0.562.0", "lucide-react": "^0.562.0",
"motion": "^12.26.1", "motion": "^12.26.1",
"next-themes": "^0.4.6", "next-themes": "^0.4.6",
"rough-notation": "^0.5.1", "rough-notation": "^0.5.1",
"simple-icons": "^16.5.0", "simple-icons": "^16.5.0",
"sonner": "^2.0.7", "sonner": "^2.0.7",
"tailwind-merge": "^3.4.0" "tailwind-merge": "^3.4.0"
} }
} }

View File

@@ -28,9 +28,9 @@ pages/i18n/
import { useTranslation } from 'react-i18next' import { useTranslation } from 'react-i18next'
function MyComponent() { function MyComponent() {
const { t } = useTranslation('common') // 指定命名空间 const { t } = useTranslation('common') // 指定命名空间
return <h1>{t('header.nav_docs')}</h1> return <h1>{t('header.nav_docs')}</h1>
} }
``` ```
@@ -71,4 +71,3 @@ t('common:header.nav_docs')
- [ ] 文档页翻译(`docs.json` - [ ] 文档页翻译(`docs.json`
- [ ] DocsLayout 导航结构国际化 - [ ] DocsLayout 导航结构国际化
- [ ] 404 页面国际化 - [ ] 404 页面国际化

View File

@@ -1,29 +1,29 @@
{ {
"extends": "../../tsconfig.base.json", "extends": "../../tsconfig.base.json",
"compilerOptions": { "compilerOptions": {
"tsBuildInfoFile": "./node_modules/.tmp/tsconfig.tsbuildinfo", "tsBuildInfoFile": "./node_modules/.tmp/tsconfig.tsbuildinfo",
"noEmit": false, "noEmit": false,
"allowImportingTsExtensions": false, "allowImportingTsExtensions": false,
"baseUrl": ".", "baseUrl": ".",
"outDir": "dist", "outDir": "dist",
"paths": { "paths": {
// Self root // Self root
"@/*": ["src/*"], "@/*": ["src/*"],
// Simplified monorepo solution (raw npm workspace with hoisting) // Simplified monorepo solution (raw npm workspace with hoisting)
"page-agent": ["../page-agent/src/PageAgent.ts"], "page-agent": ["../page-agent/src/PageAgent.ts"],
"@page-agent/llms": ["../llms/src/index.ts"], "@page-agent/llms": ["../llms/src/index.ts"],
"@page-agent/page-controller": ["../page-controller/src/PageController.ts"], "@page-agent/page-controller": ["../page-controller/src/PageController.ts"],
"@page-agent/ui": ["../ui/src/index.ts"] "@page-agent/ui": ["../ui/src/index.ts"]
} }
}, },
"include": ["**/*.ts", "**/*.tsx"], "include": ["**/*.ts", "**/*.tsx"],
"exclude": ["dist", "node_modules"], "exclude": ["dist", "node_modules"],
"references": [ "references": [
// //
{ "path": "../llms" }, { "path": "../llms" },
{ "path": "../page-agent" }, { "path": "../page-agent" },
{ "path": "../page-controller" }, { "path": "../page-controller" },
{ "path": "../ui" } { "path": "../ui" }
] ]
} }

View File

@@ -1,47 +1,47 @@
{ {
"compilerOptions": { "compilerOptions": {
"composite": true, "composite": true,
"target": "ES2024", "target": "ES2024",
"useDefineForClassFields": true, "useDefineForClassFields": true,
"lib": ["ES2024", "DOM", "DOM.Iterable"], "lib": ["ES2024", "DOM", "DOM.Iterable"],
"module": "ESNext", "module": "ESNext",
"skipLibCheck": true, "skipLibCheck": true,
"allowJs": true, "allowJs": true,
// "tsBuildInfoFile": "./node_modules/.tmp/tsconfig.tsbuildinfo", // "tsBuildInfoFile": "./node_modules/.tmp/tsconfig.tsbuildinfo",
// "baseUrl": "src", // "baseUrl": "src",
"baseUrl": ".", "baseUrl": ".",
"outDir": "dist", "outDir": "dist",
// "incremental": true, // "incremental": true,
/* Bundler mode */ /* Bundler mode */
"moduleResolution": "bundler", "moduleResolution": "bundler",
"verbatimModuleSyntax": false, "verbatimModuleSyntax": false,
"noEmit": true, "noEmit": true,
"jsx": "react-jsx", "jsx": "react-jsx",
"allowImportingTsExtensions": true, "allowImportingTsExtensions": true,
/* Linting */ /* Linting */
"strict": true, "strict": true,
"noUnusedLocals": false, "noUnusedLocals": false,
"noUnusedParameters": false, "noUnusedParameters": false,
"erasableSyntaxOnly": true, "erasableSyntaxOnly": true,
"noFallthroughCasesInSwitch": true, "noFallthroughCasesInSwitch": true,
"noUncheckedSideEffectImports": true "noUncheckedSideEffectImports": true
// "paths": { // "paths": {
// // Simplified monorepo solution (raw npm workspace with hoisting) // // Simplified monorepo solution (raw npm workspace with hoisting)
// "@page-agent/page-controller": ["./packages/page-controller/src/PageController.ts"], // "@page-agent/page-controller": ["./packages/page-controller/src/PageController.ts"],
// "page-agent": ["./packages/page-agent/src/PageAgent.ts"] // "page-agent": ["./packages/page-agent/src/PageAgent.ts"]
// } // }
} }
// "references": [ // "references": [
// { "path": "./packages/page-controller" }, // { "path": "./packages/page-controller" },
// { "path": "./packages/page-agent" }, // { "path": "./packages/page-agent" },
// { "path": "./packages/website" } // { "path": "./packages/website" }
// ], // ],
// "include": ["packages/*/src/**/*.ts", "packages/*/src/**/*.tsx"], // "include": ["packages/*/src/**/*.ts", "packages/*/src/**/*.tsx"],
// "exclude": ["node_modules", "dist", "packages/*/dist"] // "exclude": ["node_modules", "dist", "packages/*/dist"]
// "files": ["env.d.ts"] // "files": ["env.d.ts"]
// "files": [] // "files": []
} }

View File

@@ -1,12 +1,12 @@
{ {
"extends": "./tsconfig.base.json", "extends": "./tsconfig.base.json",
"references": [ "references": [
{ "path": "./packages/page-controller" }, { "path": "./packages/page-controller" },
{ "path": "./packages/ui" }, { "path": "./packages/ui" },
{ "path": "./packages/llms" }, { "path": "./packages/llms" },
{ "path": "./packages/page-agent" }, { "path": "./packages/page-agent" },
{ "path": "./packages/website" } { "path": "./packages/website" }
], ],
"include": ["packages/*/src/**/*.ts", "packages/*/src/**/*.tsx"], "include": ["packages/*/src/**/*.ts", "packages/*/src/**/*.tsx"],
"exclude": ["node_modules", "dist", "packages/*/dist"] "exclude": ["node_modules", "dist", "packages/*/dist"]
} }