fix:disable-agent-sandbox-at-runtime
This commit is contained in:
1 parent
3be45999f7
commit
c7d6c558e6
24 files changed
+147
-500
No files matched your search
@@ -96,10 +96,7 @@ function owned(args: Record<string, unknown>, key: string): ManagedBrowser {
|
||||
if (!browser || browser.scope !== key || browser.window.isDestroyed()) throw new Error('浏览器标签不存在、不属于当前会话,或存在多个标签;请先 list 并指定 tabId')
|
||||
return browser
|
||||
}
|
||||
async function approve(action: string, args: Record<string, unknown>, ctx: ToolContext): Promise<void> {
|
||||
if (ctx.permissionMode === 'full-access' || !['open', 'navigate', 'click', 'type', 'press_key'].includes(action)) return
|
||||
const target = action === 'open' || action === 'navigate' ? url(args.url) : String(args.ref || args.selector || args.key || '')
|
||||
if (!ctx.approve || !await ctx.approve(`浏览器 ${action}:${target}`, ctx.signal)) throw new Error('浏览器操作未获用户批准')
|
||||
async function approve(_action: string, _args: Record<string, unknown>, ctx: ToolContext): Promise<void> {
|
||||
active(ctx)
|
||||
}
|
||||
function create(key: string, ctx: ToolContext): ManagedBrowser {
|
||||
|
||||
Reference in new issue
Block a user