feat: improve runtime visibility and browser interaction

This commit is contained in:
lofyer
2026-08-07 17:53:14 +08:00
parent 2c715e5e81
commit 53d18e2b06
36 changed files with 1680 additions and 907 deletions
+2
View File
@@ -75,6 +75,8 @@ export const conversationToolActivitySchema = z
'interrupted'
]),
summary: z.string().max(2_000),
input: z.string().max(4_000).optional(),
output: z.string().max(16_000).optional(),
error: z.string().max(2_000).optional()
})
.strict()
+3 -3
View File
@@ -28,7 +28,7 @@ export const builtinModelTools = [
{
name: 'browser_navigate',
displayName: '浏览器导航',
description: '在隔离浏览器中打开公开的 HTTP(S) 页面。',
description: '在隔离浏览器中打开当前设备可连接的 HTTP 或 HTTPS 页面。',
access: 'write'
},
{
@@ -40,13 +40,13 @@ export const builtinModelTools = [
{
name: 'browser_click',
displayName: '点击浏览器元素',
description: '点击最近一次浏览器快照中的可见且未受保护元素。',
description: '点击最近一次浏览器快照中的可见元素。',
access: 'write'
},
{
name: 'browser_type',
displayName: '输入浏览器文本',
description: '向可编辑且未受保护的页面元素输入文本;不支持上传文件。',
description: '向可编辑页面元素(包括密码框)输入文本;不支持上传文件。',
access: 'write'
},
{
+6
View File
@@ -660,6 +660,8 @@ export type AgentEvent =
| 'failed'
| 'recoverable'
summary: string
input?: string
output?: string
error?: string
}
| {
@@ -728,6 +730,7 @@ export const browserLiveStateSchema = z
'loading',
'ready',
'acting',
'interactive',
'failed',
'stopped'
]),
@@ -753,6 +756,8 @@ export const browserStopRequestSchema = z
})
.strict()
export const browserInteractRequestSchema = browserStopRequestSchema
export const knowledgeIdSchema = z.string().uuid()
export const knowledgeCreateSchema = z
.object({
@@ -919,6 +924,7 @@ export type DesktopApi = {
onEvent: (listener: (event: AgentEvent) => void) => () => void
}
browser: {
interact: (conversationId: string) => Promise<void>
stop: (conversationId: string) => Promise<void>
onState: (listener: (state: BrowserLiveState) => void) => () => void
}
+1
View File
@@ -16,6 +16,7 @@ export const ipcChannels = {
agentApprovalRespond: 'agent:approval:respond',
agentQuestionRespond: 'agent:question:respond',
agentEvent: 'agent:event',
browserInteract: 'browser:interact',
browserStop: 'browser:stop',
browserState: 'browser:state',
runtimeSettingsGet: 'settings:runtime:get',