feat(cli): add tab profile lifecycle commands (#1397)
Co-authored-by: Orca <help@stably.ai> Co-authored-by: Nikolatesla-lj <Nikolatesla-lj@users.noreply.github.com> Co-authored-by: Jinwoo-H <jinwoo0825@gmail.com>
This commit is contained in:
co-authored by
Orca
Nikolatesla-lj
Jinwoo-H
parent
f90da6ea37
commit
9bf339eeb9
@@ -57,6 +57,9 @@ import type {
|
||||
BrowserEvalResult,
|
||||
BrowserTabListResult,
|
||||
BrowserTabSwitchResult,
|
||||
BrowserProfileCreateResult,
|
||||
BrowserProfileDeleteResult,
|
||||
BrowserProfileListResult,
|
||||
BrowserHoverResult,
|
||||
BrowserDragResult,
|
||||
BrowserUploadResult,
|
||||
@@ -82,6 +85,7 @@ import type {
|
||||
import { BrowserWindow, ipcMain } from 'electron'
|
||||
import type { AgentBrowserBridge } from '../browser/agent-browser-bridge'
|
||||
import { BrowserError } from '../browser/cdp-bridge'
|
||||
import { browserSessionRegistry } from '../browser/browser-session-registry'
|
||||
import { waitForTabRegistration } from '../ipc/browser'
|
||||
import { getPRForBranch } from '../github/client'
|
||||
import {
|
||||
@@ -4484,6 +4488,26 @@ export class OrcaRuntimeService {
|
||||
return { browserPageId }
|
||||
}
|
||||
|
||||
async browserProfileList(): Promise<BrowserProfileListResult> {
|
||||
return { profiles: browserSessionRegistry.listProfiles() }
|
||||
}
|
||||
|
||||
async browserProfileCreate(params: {
|
||||
label: string
|
||||
scope: 'isolated' | 'imported'
|
||||
}): Promise<BrowserProfileCreateResult> {
|
||||
return {
|
||||
profile: browserSessionRegistry.createProfile(params.scope, params.label)
|
||||
}
|
||||
}
|
||||
|
||||
async browserProfileDelete(params: { profileId: string }): Promise<BrowserProfileDeleteResult> {
|
||||
return {
|
||||
deleted: await browserSessionRegistry.deleteProfile(params.profileId),
|
||||
profileId: params.profileId
|
||||
}
|
||||
}
|
||||
|
||||
async browserTabClose(params: {
|
||||
index?: number
|
||||
page?: string
|
||||
|
||||
Reference in New Issue
Block a user