mirror of
https://github.com/stablyai/orca.git
synced 2026-11-19 04:23:57 +00:00
refactor(browser): group CLI and preload owners (#37182)
This commit is contained in:
@@ -461,8 +461,8 @@
|
||||
"src/cli/automation-format.test.ts": 93,
|
||||
"src/cli/automation-owner-conflict-recovery.test.ts": 330,
|
||||
"src/cli/automation-runs-paging.test.ts": 653,
|
||||
"src/cli/browser-empty-values.test.ts": 191,
|
||||
"src/cli/browser.test.ts": 439,
|
||||
"src/cli/browser/browser-empty-values.test.ts": 191,
|
||||
"src/cli/browser/browser.test.ts": 439,
|
||||
"src/cli/cli-version.test.ts": 59,
|
||||
"src/cli/codex-command-classification.test.ts": 66,
|
||||
"src/cli/command-suggestion-budget.test.ts": 90,
|
||||
|
||||
@@ -1,50 +0,0 @@
|
||||
import { ORCA_BROWSER_CLI_COMMAND_KEYS } from '../shared/orca-browser-cli-commands'
|
||||
import type { HandlerGroup } from './handler-group-manifest'
|
||||
|
||||
export const BROWSER_HANDLER_GROUPS: readonly HandlerGroup[] = [
|
||||
{
|
||||
name: 'browser-identity',
|
||||
keys: ORCA_BROWSER_CLI_COMMAND_KEYS['browser-identity'],
|
||||
load: async () => (await import('./handlers/browser-identity.js')).BROWSER_IDENTITY_HANDLERS
|
||||
},
|
||||
{
|
||||
name: 'browser-nav',
|
||||
keys: ORCA_BROWSER_CLI_COMMAND_KEYS['browser-nav'],
|
||||
load: async () => (await import('./handlers/browser-nav.js')).BROWSER_NAV_HANDLERS
|
||||
},
|
||||
{
|
||||
name: 'browser-interact',
|
||||
keys: ORCA_BROWSER_CLI_COMMAND_KEYS['browser-interact'],
|
||||
load: async () => (await import('./handlers/browser-interact.js')).BROWSER_INTERACT_HANDLERS
|
||||
},
|
||||
{
|
||||
name: 'browser-tab',
|
||||
keys: ORCA_BROWSER_CLI_COMMAND_KEYS['browser-tab'],
|
||||
load: async () => (await import('./handlers/browser-tab.js')).BROWSER_TAB_HANDLERS
|
||||
},
|
||||
{
|
||||
name: 'browser-profile',
|
||||
keys: ORCA_BROWSER_CLI_COMMAND_KEYS['browser-profile'],
|
||||
load: async () => (await import('./handlers/browser-profile.js')).BROWSER_PROFILE_HANDLERS
|
||||
},
|
||||
{
|
||||
name: 'browser-cookie',
|
||||
keys: ORCA_BROWSER_CLI_COMMAND_KEYS['browser-cookie'],
|
||||
load: async () => (await import('./handlers/browser-cookie.js')).BROWSER_COOKIE_HANDLERS
|
||||
},
|
||||
{
|
||||
name: 'browser-capture',
|
||||
keys: ORCA_BROWSER_CLI_COMMAND_KEYS['browser-capture'],
|
||||
load: async () => (await import('./handlers/browser-capture.js')).BROWSER_CAPTURE_HANDLERS
|
||||
},
|
||||
{
|
||||
name: 'browser-env',
|
||||
keys: ORCA_BROWSER_CLI_COMMAND_KEYS['browser-env'],
|
||||
load: async () => (await import('./handlers/browser-env.js')).BROWSER_ENV_HANDLERS
|
||||
},
|
||||
{
|
||||
name: 'browser-storage',
|
||||
keys: ORCA_BROWSER_CLI_COMMAND_KEYS['browser-storage'],
|
||||
load: async () => (await import('./handlers/browser-storage.js')).BROWSER_STORAGE_HANDLERS
|
||||
}
|
||||
]
|
||||
@@ -6,7 +6,7 @@ import type {
|
||||
BrowserInterceptEnableResult,
|
||||
BrowserInterceptedRequest,
|
||||
BrowserNetworkLogResult
|
||||
} from '../../shared/runtime-types'
|
||||
} from '../../shared/runtime-browser-contracts'
|
||||
import type { CommandHandler } from '../dispatch'
|
||||
import { printResult } from '../format'
|
||||
import { getOptionalPositiveIntegerFlag, getOptionalStringFlag } from '../flags'
|
||||
@@ -2,7 +2,7 @@ import type {
|
||||
BrowserCookieDeleteResult,
|
||||
BrowserCookieGetResult,
|
||||
BrowserCookieSetResult
|
||||
} from '../../shared/runtime-types'
|
||||
} from '../../shared/runtime-browser-contracts'
|
||||
import type { CommandHandler } from '../dispatch'
|
||||
import { printResult } from '../format'
|
||||
import {
|
||||
@@ -10,7 +10,7 @@ import {
|
||||
getRequiredStringFlag,
|
||||
getRequiredStringFlagAllowingEmpty
|
||||
} from '../flags'
|
||||
import { RuntimeClientError } from '../runtime-client'
|
||||
import { RuntimeClientError } from '../runtime/types'
|
||||
import { getBrowserCommandTarget } from '../selectors'
|
||||
|
||||
function getOptionalCookieExpiry(flags: Map<string, string | boolean>): number | undefined {
|
||||
+17
-9
@@ -1,14 +1,9 @@
|
||||
import { afterEach, beforeEach, describe, expect, it, vi } from 'vitest'
|
||||
import type * as RuntimeTypes from '../runtime/types'
|
||||
|
||||
const callMock = vi.fn()
|
||||
|
||||
vi.mock('./runtime-client', () => {
|
||||
class RuntimeClient {
|
||||
call = callMock
|
||||
getCliStatus = vi.fn()
|
||||
openOrca = vi.fn()
|
||||
}
|
||||
|
||||
vi.mock('../runtime/types', () => {
|
||||
class RuntimeClientError extends Error {
|
||||
readonly code: string
|
||||
|
||||
@@ -27,6 +22,19 @@ vi.mock('./runtime-client', () => {
|
||||
}
|
||||
}
|
||||
|
||||
return { RuntimeClientError, RuntimeRpcFailureError }
|
||||
})
|
||||
|
||||
vi.mock('../runtime-client', async () => {
|
||||
class RuntimeClient {
|
||||
call = callMock
|
||||
getCliStatus = vi.fn()
|
||||
openOrca = vi.fn()
|
||||
}
|
||||
|
||||
const { RuntimeClientError, RuntimeRpcFailureError } =
|
||||
await vi.importMock<typeof RuntimeTypes>('../runtime/types')
|
||||
|
||||
return {
|
||||
RuntimeClient,
|
||||
RuntimeClientError,
|
||||
@@ -34,8 +42,8 @@ vi.mock('./runtime-client', () => {
|
||||
}
|
||||
})
|
||||
|
||||
import { main } from './index'
|
||||
import { okFixture, queueFixtures } from './test-fixtures'
|
||||
import { main } from '../index'
|
||||
import { okFixture, queueFixtures } from '../test-fixtures'
|
||||
|
||||
describe('orca cli storage set preserves an empty value', () => {
|
||||
beforeEach(() => {
|
||||
@@ -1,4 +1,7 @@
|
||||
import type { BrowserGeolocationResult, BrowserViewportResult } from '../../shared/runtime-types'
|
||||
import type {
|
||||
BrowserGeolocationResult,
|
||||
BrowserViewportResult
|
||||
} from '../../shared/runtime-browser-contracts'
|
||||
import type { CommandHandler } from '../dispatch'
|
||||
import { printResult } from '../format'
|
||||
import {
|
||||
@@ -8,7 +11,7 @@ import {
|
||||
getRequiredStringFlag,
|
||||
getRequiredStringFlagAllowingEmpty
|
||||
} from '../flags'
|
||||
import { RuntimeClientError } from '../runtime-client'
|
||||
import { RuntimeClientError } from '../runtime/types'
|
||||
import { getBrowserCommandTarget } from '../selectors'
|
||||
|
||||
export const BROWSER_ENV_HANDLERS: Record<string, CommandHandler> = {
|
||||
@@ -1,6 +1,6 @@
|
||||
import { readBrowserActionEffects } from '../shared/browser-action-effects'
|
||||
import { writeCliScreenshotTempFile } from './cli-screenshot-temp-file'
|
||||
import type { RuntimeRpcSuccess } from './runtime-client'
|
||||
import { readBrowserActionEffects } from '../../shared/browser-action-effects'
|
||||
import { writeCliScreenshotTempFile } from '../cli-screenshot-temp-file'
|
||||
import type { RuntimeRpcSuccess } from '../../shared/runtime-rpc-envelope'
|
||||
import type {
|
||||
BrowserProfileListResult,
|
||||
BrowserScreenshotResult,
|
||||
@@ -10,7 +10,7 @@ import type {
|
||||
BrowserTabProfileCloneResult,
|
||||
BrowserTabProfileShowResult,
|
||||
BrowserTabShowResult
|
||||
} from '../shared/runtime-types'
|
||||
} from '../../shared/runtime-browser-contracts'
|
||||
|
||||
export function formatSnapshot(result: BrowserSnapshotResult): string {
|
||||
// Older runtimes leave url and title unset.
|
||||
@@ -0,0 +1,50 @@
|
||||
import { ORCA_BROWSER_CLI_COMMAND_KEYS } from '../../shared/orca-browser-cli-commands'
|
||||
import type { HandlerGroup } from '../handler-group-manifest'
|
||||
|
||||
export const BROWSER_HANDLER_GROUPS: readonly HandlerGroup[] = [
|
||||
{
|
||||
name: 'browser-identity',
|
||||
keys: ORCA_BROWSER_CLI_COMMAND_KEYS['browser-identity'],
|
||||
load: async () => (await import('./browser-identity.js')).BROWSER_IDENTITY_HANDLERS
|
||||
},
|
||||
{
|
||||
name: 'browser-nav',
|
||||
keys: ORCA_BROWSER_CLI_COMMAND_KEYS['browser-nav'],
|
||||
load: async () => (await import('./browser-nav.js')).BROWSER_NAV_HANDLERS
|
||||
},
|
||||
{
|
||||
name: 'browser-interact',
|
||||
keys: ORCA_BROWSER_CLI_COMMAND_KEYS['browser-interact'],
|
||||
load: async () => (await import('./browser-interact.js')).BROWSER_INTERACT_HANDLERS
|
||||
},
|
||||
{
|
||||
name: 'browser-tab',
|
||||
keys: ORCA_BROWSER_CLI_COMMAND_KEYS['browser-tab'],
|
||||
load: async () => (await import('./browser-tab.js')).BROWSER_TAB_HANDLERS
|
||||
},
|
||||
{
|
||||
name: 'browser-profile',
|
||||
keys: ORCA_BROWSER_CLI_COMMAND_KEYS['browser-profile'],
|
||||
load: async () => (await import('./browser-profile.js')).BROWSER_PROFILE_HANDLERS
|
||||
},
|
||||
{
|
||||
name: 'browser-cookie',
|
||||
keys: ORCA_BROWSER_CLI_COMMAND_KEYS['browser-cookie'],
|
||||
load: async () => (await import('./browser-cookie.js')).BROWSER_COOKIE_HANDLERS
|
||||
},
|
||||
{
|
||||
name: 'browser-capture',
|
||||
keys: ORCA_BROWSER_CLI_COMMAND_KEYS['browser-capture'],
|
||||
load: async () => (await import('./browser-capture.js')).BROWSER_CAPTURE_HANDLERS
|
||||
},
|
||||
{
|
||||
name: 'browser-env',
|
||||
keys: ORCA_BROWSER_CLI_COMMAND_KEYS['browser-env'],
|
||||
load: async () => (await import('./browser-env.js')).BROWSER_ENV_HANDLERS
|
||||
},
|
||||
{
|
||||
name: 'browser-storage',
|
||||
keys: ORCA_BROWSER_CLI_COMMAND_KEYS['browser-storage'],
|
||||
load: async () => (await import('./browser-storage.js')).BROWSER_STORAGE_HANDLERS
|
||||
}
|
||||
]
|
||||
@@ -3,12 +3,12 @@ import type {
|
||||
BrowserIdentityModeStatus,
|
||||
BrowserUserAgentMode
|
||||
} from '../../shared/browser-user-agent-mode'
|
||||
import { BROWSER_IDENTITY_RUNTIME_CAPABILITY } from '../../shared/protocol-version'
|
||||
import type { RuntimeStatus } from '../../shared/runtime-types'
|
||||
import { BROWSER_IDENTITY_RUNTIME_CAPABILITY } from '../../shared/browser-runtime-capabilities'
|
||||
import type { RuntimeStatus } from '../../shared/runtime-session-contracts'
|
||||
import type { CommandHandler, HandlerContext } from '../dispatch'
|
||||
import { getRequiredStringFlag } from '../flags'
|
||||
import { printResult } from '../format'
|
||||
import { RuntimeClientError } from '../runtime-client'
|
||||
import { RuntimeClientError } from '../runtime/types'
|
||||
|
||||
async function assertBrowserIdentitySupported({ client }: HandlerContext): Promise<void> {
|
||||
const status = await client.call<RuntimeStatus>('status.get')
|
||||
@@ -11,7 +11,7 @@ import type {
|
||||
BrowserSelectResult,
|
||||
BrowserTypeResult,
|
||||
BrowserUploadResult
|
||||
} from '../../shared/runtime-types'
|
||||
} from '../../shared/runtime-browser-contracts'
|
||||
import type { CommandHandler } from '../dispatch'
|
||||
import { resolveRepoPathArgument } from '../repo-path-arguments'
|
||||
import { printResult } from '../format'
|
||||
@@ -9,15 +9,16 @@ import type {
|
||||
BrowserScrollResult,
|
||||
BrowserSnapshotResult,
|
||||
BrowserWaitResult
|
||||
} from '../../shared/runtime-types'
|
||||
} from '../../shared/runtime-browser-contracts'
|
||||
import type { CommandHandler } from '../dispatch'
|
||||
import { formatScreenshot, formatSnapshot, printResult, saveBrowserScreenshot } from '../format'
|
||||
import { formatScreenshot, formatSnapshot, saveBrowserScreenshot } from './browser-format'
|
||||
import { printResult } from '../format'
|
||||
import {
|
||||
getOptionalPositiveIntegerFlag,
|
||||
getOptionalStringFlag,
|
||||
getRequiredStringFlag
|
||||
} from '../flags'
|
||||
import { RuntimeClientError } from '../runtime-client'
|
||||
import { RuntimeClientError } from '../runtime/types'
|
||||
import { getBrowserCommandTarget } from '../selectors'
|
||||
import { browserWaitRequestTimeoutMs } from '../../shared/browser-wait-timeout'
|
||||
|
||||
@@ -5,16 +5,16 @@ import type {
|
||||
BrowserTabProfileCloneResult,
|
||||
BrowserTabProfileShowResult,
|
||||
BrowserTabSetProfileResult
|
||||
} from '../../shared/runtime-types'
|
||||
} from '../../shared/runtime-browser-contracts'
|
||||
import type { CommandHandler } from '../dispatch'
|
||||
import { getOptionalStringFlag, getRequiredStringFlag } from '../flags'
|
||||
import {
|
||||
formatBrowserProfileList,
|
||||
formatTabProfileClone,
|
||||
formatTabProfileShow,
|
||||
printResult
|
||||
} from '../format'
|
||||
import { RuntimeClientError } from '../runtime-client'
|
||||
formatTabProfileShow
|
||||
} from './browser-format'
|
||||
import { printResult } from '../format'
|
||||
import { RuntimeClientError } from '../runtime/types'
|
||||
import { getBrowserCommandTarget } from '../selectors'
|
||||
|
||||
function parseScopeFlag(flags: Map<string, string | boolean>): 'isolated' | 'imported' {
|
||||
@@ -3,16 +3,17 @@ import type {
|
||||
BrowserTabListResult,
|
||||
BrowserTabShowResult,
|
||||
BrowserTabSwitchResult
|
||||
} from '../../shared/runtime-types'
|
||||
} from '../../shared/runtime-browser-contracts'
|
||||
import type { CommandHandler } from '../dispatch'
|
||||
import { formatTabList, formatTabListWithProfiles, formatTabShow, printResult } from '../format'
|
||||
import { formatTabList, formatTabListWithProfiles, formatTabShow } from './browser-format'
|
||||
import { printResult } from '../format'
|
||||
import {
|
||||
getOptionalNonNegativeIntegerFlag,
|
||||
getOptionalStringFlag,
|
||||
getPresentStringFlag,
|
||||
getRequiredStringFlag
|
||||
} from '../flags'
|
||||
import { RuntimeClientError } from '../runtime-client'
|
||||
import { RuntimeClientError } from '../runtime/types'
|
||||
import { isBrowserTabSplitDirection } from '../../shared/browser-tab-split-direction'
|
||||
import { getBrowserCommandTarget, getBrowserWorktreeSelector } from '../selectors'
|
||||
|
||||
@@ -2,16 +2,11 @@ import { mkdtempSync, readFileSync, rmSync } from 'node:fs'
|
||||
import { tmpdir } from 'node:os'
|
||||
import { join } from 'node:path'
|
||||
import { afterEach, beforeEach, describe, expect, it, vi } from 'vitest'
|
||||
import type * as RuntimeTypes from '../runtime/types'
|
||||
|
||||
const callMock = vi.fn()
|
||||
|
||||
vi.mock('./runtime-client', () => {
|
||||
class RuntimeClient {
|
||||
call = callMock
|
||||
getCliStatus = vi.fn()
|
||||
openOrca = vi.fn()
|
||||
}
|
||||
|
||||
vi.mock('../runtime/types', () => {
|
||||
class RuntimeClientError extends Error {
|
||||
readonly code: string
|
||||
|
||||
@@ -30,6 +25,19 @@ vi.mock('./runtime-client', () => {
|
||||
}
|
||||
}
|
||||
|
||||
return { RuntimeClientError, RuntimeRpcFailureError }
|
||||
})
|
||||
|
||||
vi.mock('../runtime-client', async () => {
|
||||
class RuntimeClient {
|
||||
call = callMock
|
||||
getCliStatus = vi.fn()
|
||||
openOrca = vi.fn()
|
||||
}
|
||||
|
||||
const { RuntimeClientError, RuntimeRpcFailureError } =
|
||||
await vi.importMock<typeof RuntimeTypes>('../runtime/types')
|
||||
|
||||
return {
|
||||
RuntimeClient,
|
||||
RuntimeClientError,
|
||||
@@ -37,9 +45,9 @@ vi.mock('./runtime-client', () => {
|
||||
}
|
||||
})
|
||||
|
||||
import { main } from './index'
|
||||
import { RuntimeClientError } from './runtime-client'
|
||||
import { buildWorktree, okFixture, queueFixtures, worktreeListFixture } from './test-fixtures'
|
||||
import { main } from '../index'
|
||||
import { RuntimeClientError } from '../runtime/types'
|
||||
import { buildWorktree, okFixture, queueFixtures, worktreeListFixture } from '../test-fixtures'
|
||||
|
||||
describe('orca cli browser page targeting', () => {
|
||||
beforeEach(() => {
|
||||
+1
-13
@@ -1,23 +1,11 @@
|
||||
import type { CliStatusCaller } from '../shared/orchestration-caller-status'
|
||||
import type { CliStatusResult } from '../shared/runtime-types'
|
||||
import { formatBrowserActionEffects } from './browser-format'
|
||||
import { formatBrowserActionEffects } from './browser/browser-format'
|
||||
import { prepareComputerCliJsonResult } from './computer-format'
|
||||
import type { RuntimeRpcSuccess } from './runtime-client'
|
||||
|
||||
export { formatCliError, reportCliError, type CliErrorContext } from './cli-error'
|
||||
|
||||
export {
|
||||
formatBrowserProfileList,
|
||||
formatScreenshot,
|
||||
formatSnapshot,
|
||||
formatTabList,
|
||||
formatTabListWithProfiles,
|
||||
formatTabProfileClone,
|
||||
formatTabProfileShow,
|
||||
formatTabShow,
|
||||
saveBrowserScreenshot
|
||||
} from './browser-format'
|
||||
|
||||
export {
|
||||
formatComputerAction,
|
||||
formatGetAppState,
|
||||
|
||||
@@ -46,7 +46,10 @@ describe('handler group manifest', () => {
|
||||
it('routes every command exported by a handler module', async () => {
|
||||
const routes = buildHandlerRoutes(HANDLER_GROUPS)
|
||||
const unroutable: string[] = []
|
||||
for (const file of listHandlerModules(HANDLERS_DIR)) {
|
||||
for (const file of [
|
||||
...listHandlerModules(HANDLERS_DIR),
|
||||
...listHandlerModules(join(__dirname, 'browser'))
|
||||
]) {
|
||||
const exports: Record<string, unknown> = await import(file)
|
||||
for (const [name, value] of Object.entries(exports)) {
|
||||
if (!HANDLER_RECORD_EXPORT.test(name) || !isHandlerRecord(value)) {
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
import type { CommandHandler } from './dispatch'
|
||||
import { BROWSER_HANDLER_GROUPS } from './browser-handler-groups'
|
||||
import { BROWSER_HANDLER_GROUPS } from './browser/browser-handler-groups'
|
||||
import { JIRA_HANDLER_GROUP } from './jira-handler-group'
|
||||
import { LINEAR_HANDLER_GROUP } from './linear-handler-group'
|
||||
import { REFERENCE_HANDLER_GROUP } from './reference-handler-group'
|
||||
|
||||
@@ -40,7 +40,7 @@ beforeAll(async () => {
|
||||
join(root, 'preload.ts'),
|
||||
`
|
||||
import { contextBridge, ipcRenderer } from 'electron'
|
||||
import { browserPageInteractionAndSessionsApi } from ${JSON.stringify(join(process.cwd(), 'src/preload/api/browser-bridge-page-interaction-and-sessions.ts'))}
|
||||
import { browserPageInteractionAndSessionsApi } from ${JSON.stringify(join(process.cwd(), 'src/preload/api/browser/browser-bridge-page-interaction-and-sessions.ts'))}
|
||||
let heldOpen = null
|
||||
contextBridge.exposeInMainWorld('probeApi', {
|
||||
browser: { ...browserPageInteractionAndSessionsApi, onOpenLinkInOrcaTab: (callback) => browserPageInteractionAndSessionsApi.onOpenLinkInOrcaTab((event) => { heldOpen = () => callback(event) }), registerGuest: (args) => ipcRenderer.invoke('link-probe:register', args) },
|
||||
|
||||
@@ -20,7 +20,7 @@ import type {
|
||||
import type { AiVaultApi } from './api/ai-vault-api'
|
||||
import type { AppApi, E2EApi, PlatformApi } from './api/app-api'
|
||||
import type { AutomationsApi } from './api/automation-api'
|
||||
import type { BrowserApi } from './api/browser-api'
|
||||
import type { BrowserApi } from './api/browser/browser-api'
|
||||
import type { CliApi } from './api/cli-install-api'
|
||||
import type { CrashReportsApi, FeedbackApi } from './api/crash-report-api'
|
||||
import type { DashboardApi, TerminalPreviewApi } from './api/dashboard-api'
|
||||
@@ -184,7 +184,11 @@ export type {
|
||||
export type { AiVaultApi } from './api/ai-vault-api'
|
||||
export type { AutomationsApi, ExternalAutomationManagerResult } from './api/automation-api'
|
||||
export type { AppApi } from './api/app-api'
|
||||
export type { BrowserApi, DetectedBrowserInfo, DetectedBrowserProfileInfo } from './api/browser-api'
|
||||
export type {
|
||||
BrowserApi,
|
||||
DetectedBrowserInfo,
|
||||
DetectedBrowserProfileInfo
|
||||
} from './api/browser/browser-api'
|
||||
export type { EmulatorApi } from './api/emulator-api'
|
||||
export type { ExportApi } from './api/filesystem-api'
|
||||
export type {
|
||||
|
||||
@@ -1,46 +1,46 @@
|
||||
import type { BrowserSessionCookieApi } from './browser-session-cookie-api'
|
||||
import type { BrowserDevToolsDockBounds } from '../../shared/browser-devtools-dock'
|
||||
import type { BrowserSetAnnotationViewportBridgeArgs } from '../../shared/browser-annotation-viewport-bridge'
|
||||
import type { BrowserDevToolsDockBounds } from '../../../shared/browser-devtools-dock'
|
||||
import type { BrowserSetAnnotationViewportBridgeArgs } from '../../../shared/browser-annotation-viewport-bridge'
|
||||
import type {
|
||||
BrowserAgentActivityEvent,
|
||||
BrowserAgentCursorEvent
|
||||
} from '../../shared/browser-agent-activity-contract'
|
||||
import type { ManagedBrowserProfileOwner } from '../../shared/browser-profile-scope'
|
||||
} from '../../../shared/browser-agent-activity-contract'
|
||||
import type { ManagedBrowserProfileOwner } from '../../../shared/browser-profile-scope'
|
||||
import type { BrowserExtensionToolbarApi } from './browser-extension-toolbar-api'
|
||||
import type { BrowserExtensionContextMenuApi } from './browser-extension-context-menu-api'
|
||||
import type { BrowserExtensionWebStoreApi } from './browser-extension-webstore-api'
|
||||
import type {
|
||||
BrowserExtensionActionResult,
|
||||
BrowserExtensionListResult
|
||||
} from '../../shared/browser-extension-types'
|
||||
} from '../../../shared/browser-extension-types'
|
||||
import type {
|
||||
BrowserPageSiteDisplay,
|
||||
BrowserSiteColorScheme
|
||||
} from '../../shared/browser-site-display'
|
||||
import type { BrowserPageZoomDirection } from '../../shared/browser-page-zoom'
|
||||
} from '../../../shared/browser-site-display'
|
||||
import type { BrowserPageZoomDirection } from '../../../shared/browser-page-zoom'
|
||||
import type {
|
||||
BrowserIdentityModeSetResult,
|
||||
BrowserIdentityModeStatus,
|
||||
BrowserUserAgentMode
|
||||
} from '../../shared/browser-user-agent-mode'
|
||||
} from '../../../shared/browser-user-agent-mode'
|
||||
import type {
|
||||
BrowserClientPageMetadataParams,
|
||||
BrowserClientPageMetadataPublishOutcome
|
||||
} from '../../shared/browser-client-page-metadata-protocol'
|
||||
} from '../../../shared/browser-client-page-metadata-protocol'
|
||||
import type {
|
||||
BrowserWebAuthnAccountRequest,
|
||||
BrowserWebAuthnAccountResponse
|
||||
} from '../../shared/browser-webauthn-account'
|
||||
} from '../../../shared/browser-webauthn-account'
|
||||
import type {
|
||||
BrowserPagePromptRequest,
|
||||
BrowserPagePromptResponse,
|
||||
BrowserPagePromptResult
|
||||
} from '../../shared/browser-page-prompt'
|
||||
} from '../../../shared/browser-page-prompt'
|
||||
import type {
|
||||
BrowserSitePermission,
|
||||
BrowserSitePermissionDecision,
|
||||
BrowserSitePermissionEntry
|
||||
} from '../../shared/browser-site-permission'
|
||||
} from '../../../shared/browser-site-permission'
|
||||
import type {
|
||||
BrowserSetGrabModeArgs,
|
||||
BrowserSetGrabModeResult,
|
||||
@@ -52,7 +52,7 @@ import type {
|
||||
BrowserExtractHoverArgs,
|
||||
BrowserExtractHoverResult,
|
||||
GrabIntent
|
||||
} from '../../shared/browser-grab-types'
|
||||
} from '../../../shared/browser-grab-types'
|
||||
import type {
|
||||
BrowserContextMenuDismissedEvent,
|
||||
BrowserContextMenuRequestedEvent,
|
||||
@@ -62,7 +62,7 @@ import type {
|
||||
BrowserPermissionDeniedEvent,
|
||||
BrowserPopupEvent,
|
||||
BrowserTargetUrlChangedEvent
|
||||
} from '../../shared/browser-guest-events'
|
||||
} from '../../../shared/browser-guest-events'
|
||||
import type {
|
||||
BrowserCertificateFailure,
|
||||
BrowserCertificateProceedResult,
|
||||
@@ -73,11 +73,11 @@ import type {
|
||||
BrowserSessionProfileSource,
|
||||
BrowserViewportOverride,
|
||||
BrowserViewportScrollState
|
||||
} from '../../shared/browser-workspace-types'
|
||||
} from '../../../shared/browser-workspace-types'
|
||||
import type {
|
||||
BrowserClientPageRendererOutcome,
|
||||
BrowserClientPageRendererRequest
|
||||
} from '../../shared/browser-client-page-renderer-protocol'
|
||||
} from '../../../shared/browser-client-page-renderer-protocol'
|
||||
|
||||
export type BrowserApi = {
|
||||
/** Absent on clients that host no browser guests, including web clients. */
|
||||
+3
-3
@@ -1,13 +1,13 @@
|
||||
import { ipcRenderer } from 'electron'
|
||||
import type { PreloadApi } from '../api-types'
|
||||
import type { BrowserExtensionActionResult } from '../../shared/browser-extension-types'
|
||||
import type { PreloadApi } from '../../api-types'
|
||||
import type { BrowserExtensionActionResult } from '../../../shared/browser-extension-types'
|
||||
import {
|
||||
BROWSER_EXTENSION_POPUP_REQUEST_CHANNEL,
|
||||
BROWSER_EXTENSION_TOOLBAR_CHANGED_CHANNEL,
|
||||
type BrowserExtensionAnchorRect,
|
||||
type BrowserExtensionPopupRequest,
|
||||
type BrowserExtensionToolbarState
|
||||
} from '../../shared/browser-extension-toolbar-types'
|
||||
} from '../../../shared/browser-extension-toolbar-types'
|
||||
|
||||
/** The browser toolbar's extension buttons and the extension-driven tab activation round trip. */
|
||||
export const browserExtensionToolbarApi = {
|
||||
+2
-2
@@ -1,12 +1,12 @@
|
||||
import { ipcRenderer } from 'electron'
|
||||
import type { PreloadApi } from '../api-types'
|
||||
import type { PreloadApi } from '../../api-types'
|
||||
import {
|
||||
BROWSER_EXTENSION_INSTALL_PROMPT_CLOSED_CHANNEL,
|
||||
BROWSER_EXTENSION_INSTALL_PROMPT_REQUESTED_CHANNEL,
|
||||
type BrowserExtensionInstallPromptRequest,
|
||||
type BrowserExtensionInstallPromptResponse,
|
||||
type BrowserExtensionWebStoreInstallResult
|
||||
} from '../../shared/browser-extension-webstore'
|
||||
} from '../../../shared/browser-extension-webstore'
|
||||
|
||||
/** "Add from Chrome Web Store" and Orca's install/uninstall confirmation round trip. */
|
||||
export const browserExtensionWebStoreApi = {
|
||||
+2
-2
@@ -1,10 +1,10 @@
|
||||
import { ipcRenderer } from 'electron'
|
||||
import type { PreloadApi } from '../api-types'
|
||||
import type { PreloadApi } from '../../api-types'
|
||||
import {
|
||||
BROWSER_EXTENSIONS_CHANGED_CHANNEL,
|
||||
type BrowserExtensionActionResult,
|
||||
type BrowserExtensionListResult
|
||||
} from '../../shared/browser-extension-types'
|
||||
} from '../../../shared/browser-extension-types'
|
||||
|
||||
/** Settings › Browser › Extensions. */
|
||||
export const browserExtensionsApi = {
|
||||
+9
-9
@@ -1,23 +1,23 @@
|
||||
import type { BrowserDevToolsDockBounds } from '../../shared/browser-devtools-dock'
|
||||
import type { BrowserDevToolsDockBounds } from '../../../shared/browser-devtools-dock'
|
||||
import { ipcRenderer } from 'electron'
|
||||
import type { BrowserViewportOverride } from '../../shared/browser-workspace-types'
|
||||
import type { BrowserViewportOverride } from '../../../shared/browser-workspace-types'
|
||||
import type {
|
||||
BrowserPageSiteDisplay,
|
||||
BrowserSiteColorScheme
|
||||
} from '../../shared/browser-site-display'
|
||||
import type { BrowserPageZoomDirection } from '../../shared/browser-page-zoom'
|
||||
} from '../../../shared/browser-site-display'
|
||||
import type { BrowserPageZoomDirection } from '../../../shared/browser-page-zoom'
|
||||
import type {
|
||||
BrowserWebAuthnAccountRequest,
|
||||
BrowserWebAuthnAccountResponse
|
||||
} from '../../shared/browser-webauthn-account'
|
||||
} from '../../../shared/browser-webauthn-account'
|
||||
import type {
|
||||
BrowserPagePromptRequest,
|
||||
BrowserPagePromptResponse,
|
||||
BrowserPagePromptResult
|
||||
} from '../../shared/browser-page-prompt'
|
||||
import { readBrowserClientHostIdArgument } from '../../shared/browser-client-host-id-argument'
|
||||
import { browserClientPageRendererRequests } from '../preload-runtime-support'
|
||||
import type { PreloadApi } from '../api-types'
|
||||
} from '../../../shared/browser-page-prompt'
|
||||
import { readBrowserClientHostIdArgument } from '../../../shared/browser-client-host-id-argument'
|
||||
import { browserClientPageRendererRequests } from '../../preload-runtime-support'
|
||||
import type { PreloadApi } from '../../api-types'
|
||||
|
||||
export const browserGuestRegistrationAndDownloadsApi = {
|
||||
onClientPageRendererRequest: browserClientPageRendererRequests.subscribe,
|
||||
+8
-8
@@ -1,4 +1,4 @@
|
||||
import type { GoogleCookieClearLocalTarget } from '../../shared/browser-google-cookie-clear'
|
||||
import type { GoogleCookieClearLocalTarget } from '../../../shared/browser-google-cookie-clear'
|
||||
import { ipcRenderer } from 'electron'
|
||||
import {
|
||||
BROWSER_AGENT_ACTIVITY_CHANNEL,
|
||||
@@ -6,19 +6,19 @@ import {
|
||||
BROWSER_AGENT_CURSOR_CHANNEL,
|
||||
type BrowserAgentActivityEvent,
|
||||
type BrowserAgentCursorEvent
|
||||
} from '../../shared/browser-agent-activity-contract'
|
||||
import type { PreloadApi } from '../api-types'
|
||||
import type { BrowserUserAgentMode } from '../../shared/browser-user-agent-mode'
|
||||
import type { ManagedBrowserProfileOwner } from '../../shared/browser-profile-scope'
|
||||
import type { GrabIntent } from '../../shared/browser-grab-types'
|
||||
} from '../../../shared/browser-agent-activity-contract'
|
||||
import type { PreloadApi } from '../../api-types'
|
||||
import type { BrowserUserAgentMode } from '../../../shared/browser-user-agent-mode'
|
||||
import type { ManagedBrowserProfileOwner } from '../../../shared/browser-profile-scope'
|
||||
import type { GrabIntent } from '../../../shared/browser-grab-types'
|
||||
import type {
|
||||
BrowserSitePermission,
|
||||
BrowserSitePermissionDecision
|
||||
} from '../../shared/browser-site-permission'
|
||||
} from '../../../shared/browser-site-permission'
|
||||
import type {
|
||||
BrowserContextMenuRequestedEvent,
|
||||
BrowserTargetUrlChangedEvent
|
||||
} from '../../shared/browser-guest-events'
|
||||
} from '../../../shared/browser-guest-events'
|
||||
|
||||
export const browserPageInteractionAndSessionsApi = {
|
||||
onContextMenuRequested: (
|
||||
@@ -4,7 +4,7 @@ import { browserExtensionsApi } from './browser-bridge-extensions'
|
||||
import { browserExtensionToolbarApi } from './browser-bridge-extension-toolbar'
|
||||
import { browserExtensionWebStoreApi } from './browser-bridge-extension-webstore'
|
||||
import { browserExtensionContextMenuApi } from './browser-bridge-extension-context-menu'
|
||||
import type { PreloadApi } from '../api-types'
|
||||
import type { PreloadApi } from '../../api-types'
|
||||
|
||||
export const browserApi = {
|
||||
...browserGuestRegistrationAndDownloadsApi,
|
||||
+1
-1
@@ -1,7 +1,7 @@
|
||||
import type {
|
||||
BrowserExtensionContextMenuClick,
|
||||
BrowserExtensionContextMenuPayload
|
||||
} from '../../shared/browser-extension-context-menu-types'
|
||||
} from '../../../shared/browser-extension-context-menu-types'
|
||||
|
||||
/** window.api.browser members behind extension items in the page and toolbar-button menus. */
|
||||
export type BrowserExtensionContextMenuApi = {
|
||||
+2
-2
@@ -1,9 +1,9 @@
|
||||
import type { BrowserExtensionActionResult } from '../../shared/browser-extension-types'
|
||||
import type { BrowserExtensionActionResult } from '../../../shared/browser-extension-types'
|
||||
import type {
|
||||
BrowserExtensionAnchorRect,
|
||||
BrowserExtensionPopupRequest,
|
||||
BrowserExtensionToolbarState
|
||||
} from '../../shared/browser-extension-toolbar-types'
|
||||
} from '../../../shared/browser-extension-toolbar-types'
|
||||
|
||||
/** window.api.browser members behind the browser toolbar's extension buttons. */
|
||||
export type BrowserExtensionToolbarApi = {
|
||||
+1
-1
@@ -2,7 +2,7 @@ import type {
|
||||
BrowserExtensionInstallPromptRequest,
|
||||
BrowserExtensionInstallPromptResponse,
|
||||
BrowserExtensionWebStoreInstallResult
|
||||
} from '../../shared/browser-extension-webstore'
|
||||
} from '../../../shared/browser-extension-webstore'
|
||||
|
||||
/** window.api.browser members behind "Add from Chrome Web Store" and Orca's install prompt. */
|
||||
export type BrowserExtensionWebStoreApi = {
|
||||
+2
-2
@@ -1,8 +1,8 @@
|
||||
import type {
|
||||
GoogleCookieClearLocalTarget,
|
||||
GoogleCookieClearResult
|
||||
} from '../../shared/browser-google-cookie-clear'
|
||||
import type { BrowserCookieImportResult } from '../../shared/browser-workspace-types'
|
||||
} from '../../../shared/browser-google-cookie-clear'
|
||||
import type { BrowserCookieImportResult } from '../../../shared/browser-workspace-types'
|
||||
|
||||
export type BrowserSessionCookieApi = {
|
||||
/** Null when the environment's pages are not client-hosted on this desktop. */
|
||||
@@ -54,7 +54,7 @@ import { computerUsePermissionsApi } from './api/computer-use-permissions-bridge
|
||||
import { shellApi } from './api/shell-bridge'
|
||||
import { skillsApi } from './api/skills-bridge'
|
||||
import { petApi } from './api/pet-bridge'
|
||||
import { browserApi } from './api/browser-bridge'
|
||||
import { browserApi } from './api/browser/browser-bridge'
|
||||
import { emulatorApi } from './api/emulator-bridge'
|
||||
import { hooksApi } from './api/hooks-bridge'
|
||||
import { ephemeralVmApi } from './api/ephemeral-vm-bridge'
|
||||
|
||||
Reference in New Issue
Block a user