feat: zod support v3/4
This commit is contained in:
27
package-lock.json
generated
27
package-lock.json
generated
@@ -11118,8 +11118,13 @@
|
|||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@page-agent/llms": "1.4.4",
|
"@page-agent/llms": "1.4.4",
|
||||||
"@page-agent/page-controller": "1.4.4",
|
"@page-agent/page-controller": "1.4.4",
|
||||||
"chalk": "^5.6.2",
|
"chalk": "^5.6.2"
|
||||||
|
},
|
||||||
|
"devDependencies": {
|
||||||
"zod": "^4.3.5"
|
"zod": "^4.3.5"
|
||||||
|
},
|
||||||
|
"peerDependencies": {
|
||||||
|
"zod": "^3.25.0 || ^4.0.0"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"packages/extension": {
|
"packages/extension": {
|
||||||
@@ -11132,8 +11137,7 @@
|
|||||||
"@page-agent/page-controller": "1.4.4",
|
"@page-agent/page-controller": "1.4.4",
|
||||||
"@page-agent/ui": "1.4.4",
|
"@page-agent/ui": "1.4.4",
|
||||||
"ai-motion": "^0.4.8",
|
"ai-motion": "^0.4.8",
|
||||||
"chalk": "^5.6.2",
|
"chalk": "^5.6.2"
|
||||||
"zod": "^4.3.5"
|
|
||||||
},
|
},
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
"@radix-ui/react-hover-card": "^1.1.15",
|
"@radix-ui/react-hover-card": "^1.1.15",
|
||||||
@@ -11162,6 +11166,9 @@
|
|||||||
"tailwindcss": "^4.1.14",
|
"tailwindcss": "^4.1.14",
|
||||||
"tw-animate-css": "^1.4.0",
|
"tw-animate-css": "^1.4.0",
|
||||||
"wxt": "^0.20.18"
|
"wxt": "^0.20.18"
|
||||||
|
},
|
||||||
|
"peerDependencies": {
|
||||||
|
"zod": "^3.25.0 || ^4.0.0"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"packages/llms": {
|
"packages/llms": {
|
||||||
@@ -11169,8 +11176,13 @@
|
|||||||
"version": "1.4.4",
|
"version": "1.4.4",
|
||||||
"license": "MIT",
|
"license": "MIT",
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"chalk": "^5.6.2",
|
"chalk": "^5.6.2"
|
||||||
|
},
|
||||||
|
"devDependencies": {
|
||||||
"zod": "^4.3.5"
|
"zod": "^4.3.5"
|
||||||
|
},
|
||||||
|
"peerDependencies": {
|
||||||
|
"zod": "^3.25.0 || ^4.0.0"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"packages/page-agent": {
|
"packages/page-agent": {
|
||||||
@@ -11181,8 +11193,13 @@
|
|||||||
"@page-agent/llms": "1.4.4",
|
"@page-agent/llms": "1.4.4",
|
||||||
"@page-agent/page-controller": "1.4.4",
|
"@page-agent/page-controller": "1.4.4",
|
||||||
"@page-agent/ui": "1.4.4",
|
"@page-agent/ui": "1.4.4",
|
||||||
"chalk": "^5.6.2",
|
"chalk": "^5.6.2"
|
||||||
|
},
|
||||||
|
"devDependencies": {
|
||||||
"zod": "^4.3.5"
|
"zod": "^4.3.5"
|
||||||
|
},
|
||||||
|
"peerDependencies": {
|
||||||
|
"zod": "^3.25.0 || ^4.0.0"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"packages/page-controller": {
|
"packages/page-controller": {
|
||||||
|
|||||||
@@ -44,8 +44,13 @@
|
|||||||
},
|
},
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"chalk": "^5.6.2",
|
"chalk": "^5.6.2",
|
||||||
"zod": "^4.3.5",
|
|
||||||
"@page-agent/llms": "1.4.4",
|
"@page-agent/llms": "1.4.4",
|
||||||
"@page-agent/page-controller": "1.4.4"
|
"@page-agent/page-controller": "1.4.4"
|
||||||
|
},
|
||||||
|
"peerDependencies": {
|
||||||
|
"zod": "^3.25.0 || ^4.0.0"
|
||||||
|
},
|
||||||
|
"devDependencies": {
|
||||||
|
"zod": "^4.3.5"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -5,7 +5,7 @@
|
|||||||
import { InvokeError, LLM, type Tool } from '@page-agent/llms'
|
import { InvokeError, LLM, type Tool } from '@page-agent/llms'
|
||||||
import type { BrowserState, PageController } from '@page-agent/page-controller'
|
import type { BrowserState, PageController } from '@page-agent/page-controller'
|
||||||
import chalk from 'chalk'
|
import chalk from 'chalk'
|
||||||
import * as z from 'zod'
|
import * as z from 'zod/v4'
|
||||||
|
|
||||||
import SYSTEM_PROMPT from './prompts/system_prompt.md?raw'
|
import SYSTEM_PROMPT from './prompts/system_prompt.md?raw'
|
||||||
import { tools } from './tools'
|
import { tools } from './tools'
|
||||||
|
|||||||
@@ -2,7 +2,7 @@
|
|||||||
* Internal tools for PageAgent.
|
* Internal tools for PageAgent.
|
||||||
* @note Adapted from browser-use
|
* @note Adapted from browser-use
|
||||||
*/
|
*/
|
||||||
import * as z from 'zod'
|
import * as z from 'zod/v4'
|
||||||
|
|
||||||
import type { PageAgentCore } from '../PageAgentCore'
|
import type { PageAgentCore } from '../PageAgentCore'
|
||||||
import { waitFor } from '../utils'
|
import { waitFor } from '../utils'
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
import { InvokeError, InvokeErrorType } from '@page-agent/llms'
|
import { InvokeError, InvokeErrorType } from '@page-agent/llms'
|
||||||
import chalk from 'chalk'
|
import chalk from 'chalk'
|
||||||
import * as z from 'zod'
|
import * as z from 'zod/v4'
|
||||||
|
|
||||||
import type { PageAgentTool } from '../tools'
|
import type { PageAgentTool } from '../tools'
|
||||||
|
|
||||||
|
|||||||
@@ -30,6 +30,7 @@ export default defineConfig({
|
|||||||
external: [
|
external: [
|
||||||
'chalk',
|
'chalk',
|
||||||
'zod',
|
'zod',
|
||||||
|
'zod/v4',
|
||||||
// all the internal packages
|
// all the internal packages
|
||||||
/^@page-agent\//,
|
/^@page-agent\//,
|
||||||
],
|
],
|
||||||
|
|||||||
@@ -43,7 +43,9 @@
|
|||||||
"@page-agent/page-controller": "1.4.4",
|
"@page-agent/page-controller": "1.4.4",
|
||||||
"@page-agent/ui": "1.4.4",
|
"@page-agent/ui": "1.4.4",
|
||||||
"ai-motion": "^0.4.8",
|
"ai-motion": "^0.4.8",
|
||||||
"chalk": "^5.6.2",
|
"chalk": "^5.6.2"
|
||||||
"zod": "^4.3.5"
|
},
|
||||||
|
"peerDependencies": {
|
||||||
|
"zod": "^3.25.0 || ^4.0.0"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -6,7 +6,7 @@
|
|||||||
* - switch_to_tab: Switch to an existing tab
|
* - switch_to_tab: Switch to an existing tab
|
||||||
* - close_tab: Close a tab (optionally switch to another)
|
* - close_tab: Close a tab (optionally switch to another)
|
||||||
*/
|
*/
|
||||||
import * as z from 'zod'
|
import * as z from 'zod/v4'
|
||||||
|
|
||||||
import type { TabsController } from './TabsController'
|
import type { TabsController } from './TabsController'
|
||||||
|
|
||||||
|
|||||||
@@ -37,7 +37,12 @@
|
|||||||
"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"
|
||||||
|
},
|
||||||
|
"peerDependencies": {
|
||||||
|
"zod": "^3.25.0 || ^4.0.0"
|
||||||
|
},
|
||||||
|
"devDependencies": {
|
||||||
"zod": "^4.3.5"
|
"zod": "^4.3.5"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
/**
|
/**
|
||||||
* OpenAI Client implementation
|
* OpenAI Client implementation
|
||||||
*/
|
*/
|
||||||
import * as z from 'zod'
|
import * as z from 'zod/v4'
|
||||||
|
|
||||||
import { InvokeError, InvokeErrorType } from './errors'
|
import { InvokeError, InvokeErrorType } from './errors'
|
||||||
import type { InvokeOptions, InvokeResult, LLMClient, LLMConfig, Message, Tool } from './types'
|
import type { InvokeOptions, InvokeResult, LLMClient, LLMConfig, Message, Tool } from './types'
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
/**
|
/**
|
||||||
* Core types for LLM integration
|
* Core types for LLM integration
|
||||||
*/
|
*/
|
||||||
import type * as z from 'zod'
|
import type * as z from 'zod/v4'
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Message format - OpenAI standard (industry standard)
|
* Message format - OpenAI standard (industry standard)
|
||||||
|
|||||||
@@ -2,7 +2,7 @@
|
|||||||
* Utility functions for LLM integration
|
* Utility functions for LLM integration
|
||||||
*/
|
*/
|
||||||
import chalk from 'chalk'
|
import chalk from 'chalk'
|
||||||
import * as z from 'zod'
|
import * as z from 'zod/v4'
|
||||||
|
|
||||||
import type { Tool } from './types'
|
import type { Tool } from './types'
|
||||||
|
|
||||||
|
|||||||
@@ -25,7 +25,7 @@ export default defineConfig({
|
|||||||
},
|
},
|
||||||
outDir: resolve(__dirname, 'dist', 'lib'),
|
outDir: resolve(__dirname, 'dist', 'lib'),
|
||||||
rollupOptions: {
|
rollupOptions: {
|
||||||
external: ['chalk', 'zod'],
|
external: ['chalk', 'zod', 'zod/v4'],
|
||||||
},
|
},
|
||||||
minify: false,
|
minify: false,
|
||||||
sourcemap: true,
|
sourcemap: true,
|
||||||
|
|||||||
@@ -48,7 +48,12 @@
|
|||||||
"@page-agent/llms": "1.4.4",
|
"@page-agent/llms": "1.4.4",
|
||||||
"@page-agent/page-controller": "1.4.4",
|
"@page-agent/page-controller": "1.4.4",
|
||||||
"@page-agent/ui": "1.4.4",
|
"@page-agent/ui": "1.4.4",
|
||||||
"chalk": "^5.6.2",
|
"chalk": "^5.6.2"
|
||||||
|
},
|
||||||
|
"peerDependencies": {
|
||||||
|
"zod": "^3.25.0 || ^4.0.0"
|
||||||
|
},
|
||||||
|
"devDependencies": {
|
||||||
"zod": "^4.3.5"
|
"zod": "^4.3.5"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -30,6 +30,7 @@ export default defineConfig({
|
|||||||
external: [
|
external: [
|
||||||
'chalk',
|
'chalk',
|
||||||
'zod',
|
'zod',
|
||||||
|
'zod/v4',
|
||||||
// all the internal packages
|
// all the internal packages
|
||||||
/^@page-agent\//,
|
/^@page-agent\//,
|
||||||
],
|
],
|
||||||
|
|||||||
Reference in New Issue
Block a user