@mearl/native-host 2.0.1 → 2.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/agent/codex-provider.d.ts +7 -2
- package/dist/agent/executable-resolver.d.ts +34 -0
- package/dist/agent/manager.d.ts +3 -0
- package/dist/agent/provider.d.ts +2 -1
- package/dist/agent/qoder-provider.d.ts +6 -1
- package/dist/analytics.d.ts +2 -0
- package/dist/cdp-backend/action-registry.d.ts +4 -3
- package/dist/cdp-backend/buffers.d.ts +2 -1
- package/dist/cdp-backend/cdp-session.d.ts +7 -0
- package/dist/cdp-backend/cdp-utils.d.ts +2 -5
- package/dist/cdp-backend/composite-handlers.d.ts +3 -3
- package/dist/cdp-backend/controlled-indicator.d.ts +10 -9
- package/dist/cdp-backend/cookie-handlers.d.ts +4 -0
- package/dist/cdp-backend/handlers.d.ts +2 -0
- package/dist/cdp-backend/mock-handlers.d.ts +2 -0
- package/dist/cdp-backend/page-refs.d.ts +9 -0
- package/dist/cdp-backend/recording-handlers.d.ts +2 -0
- package/dist/cdp-backend/release-control.d.ts +13 -0
- package/dist/cdp-backend/tab-handlers.d.ts +2 -1
- package/dist/index.js +3625 -1379
- package/dist/internal-extension-actions.d.ts +8 -0
- package/dist/version.d.ts +1 -0
- package/package.json +3 -3
- package/dist/agent/instructions.d.ts +0 -1
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { AgentChatImageInput, AgentChatProviderDescriptor, AgentInstalledSkill } from '@mearl/browser-core';
|
|
1
|
+
import type { AgentChatImageInput, AgentChatModelInfo, AgentChatProviderDescriptor, AgentInstalledSkill } from '@mearl/browser-core';
|
|
2
2
|
import type { AgentProvider, AgentProviderEvent, AgentProviderListSessionsOptions, AgentProviderListSessionsResult, AgentProviderResumeResult, AgentProviderSessionOptions } from './provider.js';
|
|
3
3
|
export declare function codexThreadUrl(providerSessionId: string): string;
|
|
4
4
|
export declare function externalOpenCommand(url: string, platform?: NodeJS.Platform): {
|
|
@@ -8,6 +8,7 @@ export declare function externalOpenCommand(url: string, platform?: NodeJS.Platf
|
|
|
8
8
|
export declare class CodexAgentProvider implements AgentProvider {
|
|
9
9
|
private readonly log;
|
|
10
10
|
private readonly clientVersion;
|
|
11
|
+
private readonly mearlSocketPath?;
|
|
11
12
|
readonly id = "codex";
|
|
12
13
|
private process;
|
|
13
14
|
private initialized;
|
|
@@ -16,13 +17,16 @@ export declare class CodexAgentProvider implements AgentProvider {
|
|
|
16
17
|
private pendingRequests;
|
|
17
18
|
private listeners;
|
|
18
19
|
private knownThreadIds;
|
|
19
|
-
|
|
20
|
+
private sessionModels;
|
|
21
|
+
private readonly executableResolver;
|
|
22
|
+
constructor(log: (...args: any[]) => void, clientVersion: string, mearlSocketPath?: string | undefined);
|
|
20
23
|
getDescriptor(): Promise<AgentChatProviderDescriptor>;
|
|
21
24
|
onEvent(listener: (event: AgentProviderEvent) => void): () => void;
|
|
22
25
|
listSessions(options: AgentProviderListSessionsOptions): Promise<AgentProviderListSessionsResult>;
|
|
23
26
|
listSkills(cwd?: string): Promise<AgentInstalledSkill[]>;
|
|
24
27
|
startSession(options: AgentProviderSessionOptions): Promise<string>;
|
|
25
28
|
resumeSession(providerSessionId: string, options: AgentProviderSessionOptions): Promise<AgentProviderResumeResult>;
|
|
29
|
+
getSessionModel(providerSessionId: string): AgentChatModelInfo | undefined;
|
|
26
30
|
sendMessage(providerSessionId: string, message: string, images?: AgentChatImageInput[]): Promise<{
|
|
27
31
|
turnId: string;
|
|
28
32
|
}>;
|
|
@@ -42,4 +46,5 @@ export declare class CodexAgentProvider implements AgentProvider {
|
|
|
42
46
|
private extractThreadId;
|
|
43
47
|
private probeExecutable;
|
|
44
48
|
private resolveExecutable;
|
|
49
|
+
private resolveExecutableCandidates;
|
|
45
50
|
}
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
export type AgentExecutableResolution = {
|
|
2
|
+
executable: string;
|
|
3
|
+
error: null;
|
|
4
|
+
} | {
|
|
5
|
+
executable: null;
|
|
6
|
+
error: string;
|
|
7
|
+
};
|
|
8
|
+
interface AgentExecutableResolverOptions {
|
|
9
|
+
candidates: () => string[];
|
|
10
|
+
probe: (executable: string) => Promise<string | null>;
|
|
11
|
+
notFoundError: string;
|
|
12
|
+
unusableError: string;
|
|
13
|
+
onFailure?: (executable: string, error: string) => void;
|
|
14
|
+
}
|
|
15
|
+
interface AgentExecutableProbeOptions {
|
|
16
|
+
args: string[];
|
|
17
|
+
timeoutMs: number;
|
|
18
|
+
timeoutError: string;
|
|
19
|
+
startError: (error: Error) => string;
|
|
20
|
+
exitError: (code: number | null) => string;
|
|
21
|
+
}
|
|
22
|
+
export declare class AgentExecutableResolver {
|
|
23
|
+
private readonly options;
|
|
24
|
+
private resolvedExecutable;
|
|
25
|
+
private resolutionPromise;
|
|
26
|
+
private generation;
|
|
27
|
+
constructor(options: AgentExecutableResolverOptions);
|
|
28
|
+
resolve(): Promise<AgentExecutableResolution>;
|
|
29
|
+
reset(): void;
|
|
30
|
+
private probeCandidates;
|
|
31
|
+
}
|
|
32
|
+
export declare function executableFileCandidates(candidates: Array<string | null | undefined>): string[];
|
|
33
|
+
export declare function probeAgentExecutable(executable: string, options: AgentExecutableProbeOptions): Promise<string | null>;
|
|
34
|
+
export {};
|
package/dist/agent/manager.d.ts
CHANGED
|
@@ -9,6 +9,8 @@ export declare class AgentChatManager {
|
|
|
9
9
|
private readonly completedTurns;
|
|
10
10
|
private readonly recentEvents;
|
|
11
11
|
private readonly recentEventBytes;
|
|
12
|
+
private readonly compactedEventCounts;
|
|
13
|
+
private readonly truncatedEventSessions;
|
|
12
14
|
private readonly unsubscribe;
|
|
13
15
|
constructor(providers: AgentProvider[], emit: (event: AgentChatEvent) => void);
|
|
14
16
|
getStatus(): Promise<AgentChatStatus>;
|
|
@@ -36,6 +38,7 @@ export declare class AgentChatManager {
|
|
|
36
38
|
private handleProviderEvent;
|
|
37
39
|
private emitEvent;
|
|
38
40
|
private recordEvent;
|
|
41
|
+
private trimReplayBuffer;
|
|
39
42
|
private getProvider;
|
|
40
43
|
private getSession;
|
|
41
44
|
private providerThreadKey;
|
package/dist/agent/provider.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { AgentChatEventKind, AgentChatImageInput, AgentChatProviderDescriptor, AgentInstalledSkill } from '@mearl/browser-core';
|
|
1
|
+
import type { AgentChatEventKind, AgentChatImageInput, AgentChatModelInfo, AgentChatProviderDescriptor, AgentInstalledSkill } from '@mearl/browser-core';
|
|
2
2
|
export interface AgentProviderEvent {
|
|
3
3
|
providerSessionId?: string;
|
|
4
4
|
kind: AgentChatEventKind;
|
|
@@ -41,6 +41,7 @@ export interface AgentProvider {
|
|
|
41
41
|
listSkills?(cwd?: string): Promise<AgentInstalledSkill[]>;
|
|
42
42
|
startSession(options: AgentProviderSessionOptions): Promise<string>;
|
|
43
43
|
resumeSession(providerSessionId: string, options: AgentProviderSessionOptions): Promise<AgentProviderResumeResult>;
|
|
44
|
+
getSessionModel?(providerSessionId: string): AgentChatModelInfo | undefined;
|
|
44
45
|
validateMessageInput?(images: AgentChatImageInput[]): Promise<void>;
|
|
45
46
|
sendMessage(providerSessionId: string, message: string, images?: AgentChatImageInput[]): Promise<{
|
|
46
47
|
turnId: string;
|
|
@@ -1,5 +1,7 @@
|
|
|
1
|
-
import
|
|
1
|
+
import * as acp from '@agentclientprotocol/sdk';
|
|
2
|
+
import type { AgentChatImageInput, AgentChatModelInfo, AgentChatProviderDescriptor, AgentInstalledSkill } from '@mearl/browser-core';
|
|
2
3
|
import type { AgentProvider, AgentProviderEvent, AgentProviderListSessionsOptions, AgentProviderListSessionsResult, AgentProviderResumeResult, AgentProviderSessionOptions } from './provider.js';
|
|
4
|
+
export declare function qoderModelInfo(configOptions: acp.SessionConfigOption[] | null | undefined): AgentChatModelInfo | undefined;
|
|
3
5
|
export declare function parseQoderSkillsList(output: string, cwd: string, home?: string): AgentInstalledSkill[];
|
|
4
6
|
export declare function qoderInstallCommand(platform?: NodeJS.Platform): string;
|
|
5
7
|
export declare class QoderAgentProvider implements AgentProvider {
|
|
@@ -16,6 +18,7 @@ export declare class QoderAgentProvider implements AgentProvider {
|
|
|
16
18
|
private pendingPermissions;
|
|
17
19
|
private historyCaptures;
|
|
18
20
|
private nextTurnId;
|
|
21
|
+
private readonly executableResolver;
|
|
19
22
|
constructor(log: (...args: any[]) => void, clientVersion: string);
|
|
20
23
|
getDescriptor(): Promise<AgentChatProviderDescriptor>;
|
|
21
24
|
onEvent(listener: (event: AgentProviderEvent) => void): () => void;
|
|
@@ -23,6 +26,7 @@ export declare class QoderAgentProvider implements AgentProvider {
|
|
|
23
26
|
listSkills(cwd?: string): Promise<AgentInstalledSkill[]>;
|
|
24
27
|
startSession(options: AgentProviderSessionOptions): Promise<string>;
|
|
25
28
|
resumeSession(providerSessionId: string, options: AgentProviderSessionOptions): Promise<AgentProviderResumeResult>;
|
|
29
|
+
getSessionModel(providerSessionId: string): AgentChatModelInfo | undefined;
|
|
26
30
|
validateMessageInput(images: AgentChatImageInput[]): Promise<void>;
|
|
27
31
|
sendMessage(providerSessionId: string, message: string, images?: AgentChatImageInput[]): Promise<{
|
|
28
32
|
turnId: string;
|
|
@@ -45,5 +49,6 @@ export declare class QoderAgentProvider implements AgentProvider {
|
|
|
45
49
|
private probeExecutable;
|
|
46
50
|
private runSkillsList;
|
|
47
51
|
private resolveExecutable;
|
|
52
|
+
private resolveExecutableCandidates;
|
|
48
53
|
private emit;
|
|
49
54
|
}
|
package/dist/analytics.d.ts
CHANGED
|
@@ -8,16 +8,17 @@
|
|
|
8
8
|
* - `browser`: handler receives CdpSession (for tab management, tdbank, etc.)
|
|
9
9
|
* - `page`: handler receives PageSession (for most page-level actions)
|
|
10
10
|
*/
|
|
11
|
+
import type { ControlSource } from '@mearl/browser-core';
|
|
11
12
|
import type { CdpSession, PageSession } from './cdp-session.js';
|
|
12
13
|
export interface BrowserAction {
|
|
13
14
|
name: string;
|
|
14
15
|
session: 'browser';
|
|
15
|
-
handler: (session: CdpSession, data: any) => Promise<any>;
|
|
16
|
+
handler: (session: CdpSession, data: any, controlSource: ControlSource) => Promise<any>;
|
|
16
17
|
}
|
|
17
18
|
export interface PageAction {
|
|
18
19
|
name: string;
|
|
19
20
|
session: 'page';
|
|
20
|
-
handler: (session: PageSession, data: any) => Promise<any>;
|
|
21
|
+
handler: (session: PageSession, data: any, controlSource: ControlSource) => Promise<any>;
|
|
21
22
|
}
|
|
22
23
|
export type CdpAction = BrowserAction | PageAction;
|
|
23
24
|
/** Register one or more CDP actions. Called by each handler sub-module. */
|
|
@@ -32,4 +33,4 @@ export declare function getRegisteredActionNames(): string[];
|
|
|
32
33
|
* Resolves the appropriate session level and calls the handler.
|
|
33
34
|
* Throws if the action is unknown or CDP is not available.
|
|
34
35
|
*/
|
|
35
|
-
export declare function dispatchCdpAction(cdpSession: CdpSession, action: string, data: any): Promise<any>;
|
|
36
|
+
export declare function dispatchCdpAction(cdpSession: CdpSession, action: string, data: any, controlSource?: ControlSource): Promise<any>;
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
* RUM/tracking events. A single CdpSession subscribes to CDP events and
|
|
4
4
|
* fills these buffers; callers read from them without CDP interaction.
|
|
5
5
|
*/
|
|
6
|
-
import type { MtopRequest, RumEvent, ConsoleLog } from '@mearl/browser-core';
|
|
6
|
+
import type { MtopRequest, RumEvent, ConsoleLog, RequestBufferAccounting } from '@mearl/browser-core';
|
|
7
7
|
import type { CdpClient, CdpChildSession } from './client.js';
|
|
8
8
|
interface PartialRequest {
|
|
9
9
|
id: number;
|
|
@@ -40,6 +40,7 @@ export interface CdpBuffers {
|
|
|
40
40
|
events: RumEvent[];
|
|
41
41
|
pending: Map<string, PartialRequest>;
|
|
42
42
|
requestCounter: number;
|
|
43
|
+
requestBufferAccounting: RequestBufferAccounting;
|
|
43
44
|
}
|
|
44
45
|
export declare function createBuffers(): CdpBuffers;
|
|
45
46
|
export declare function setupBufferListeners(client: CdpClient | CdpChildSession, buffers: CdpBuffers): void;
|
|
@@ -13,6 +13,10 @@ export interface PageSession {
|
|
|
13
13
|
buffers: CdpBuffers;
|
|
14
14
|
targetId: string;
|
|
15
15
|
url: string;
|
|
16
|
+
emulation?: {
|
|
17
|
+
mobile: boolean;
|
|
18
|
+
touch: boolean;
|
|
19
|
+
};
|
|
16
20
|
}
|
|
17
21
|
export declare class CdpSession {
|
|
18
22
|
readonly port: number;
|
|
@@ -56,5 +60,8 @@ export declare class CdpSession {
|
|
|
56
60
|
private findTargetByIdViaCdp;
|
|
57
61
|
private findDefaultPageTargetViaCdp;
|
|
58
62
|
private fetchVersionInfo;
|
|
63
|
+
hasActiveConnections(): boolean;
|
|
64
|
+
listOpenPageSessions(): PageSession[];
|
|
65
|
+
listRegisteredTabIds(targetIds?: ReadonlySet<string>): number[];
|
|
59
66
|
close(): void;
|
|
60
67
|
}
|
|
@@ -4,8 +4,8 @@
|
|
|
4
4
|
* Contains: HTTP helper (nodeFetch), cookie utilities, page-load waiters,
|
|
5
5
|
* viewport helpers, and serialized function sources for page injection.
|
|
6
6
|
*/
|
|
7
|
+
import { type PageClickPointerType } from '@mearl/browser-core';
|
|
7
8
|
import type { PageSession } from './cdp-session.js';
|
|
8
|
-
import { type CdpTarget } from './discover.js';
|
|
9
9
|
export declare const TYPE_INTO_ELEMENT_SRC: string;
|
|
10
10
|
export declare const CLICK_ELEMENT_VIA_JS_SRC: string;
|
|
11
11
|
export declare const GET_CLICK_COORDS_FROM_NODE_SRC: string;
|
|
@@ -47,9 +47,6 @@ export declare function buildMultipartFormBody(fields: Record<string, string>):
|
|
|
47
47
|
body: string;
|
|
48
48
|
};
|
|
49
49
|
export declare function waitForPageLoad(session: PageSession, timeoutMs: number): Promise<void>;
|
|
50
|
-
export declare function waitForTargetLoad(session: {
|
|
51
|
-
port: number;
|
|
52
|
-
}, targetId: string, timeoutMs: number): Promise<CdpTarget | null>;
|
|
53
50
|
export declare function getPageViewportSize(session: PageSession): Promise<{
|
|
54
51
|
width: number;
|
|
55
52
|
height: number;
|
|
@@ -62,5 +59,5 @@ export declare function toCdpInputPoint(session: PageSession, x: number, y: numb
|
|
|
62
59
|
x: number;
|
|
63
60
|
y: number;
|
|
64
61
|
}>;
|
|
65
|
-
export declare function dispatchCdpClick(session: PageSession, x: number, y: number): Promise<void>;
|
|
62
|
+
export declare function dispatchCdpClick(session: PageSession, x: number, y: number, pointerType: PageClickPointerType): Promise<void>;
|
|
66
63
|
export declare function resolveBackendNodeObjectId(session: PageSession, backendNodeId: number): Promise<string>;
|
|
@@ -7,8 +7,8 @@
|
|
|
7
7
|
* built-in observation.
|
|
8
8
|
*/
|
|
9
9
|
import type { CdpSession } from './cdp-session.js';
|
|
10
|
-
import { type PageActAction } from '@mearl/browser-core';
|
|
11
|
-
export declare function cdpRunActions(session: CdpSession, data: any): Promise<any>;
|
|
10
|
+
import { type ControlSource, type PageActAction } from '@mearl/browser-core';
|
|
11
|
+
export declare function cdpRunActions(session: CdpSession, data: any, controlSource?: ControlSource): Promise<any>;
|
|
12
12
|
/**
|
|
13
13
|
* Runs a page interaction action with built-in observation: executes the raw
|
|
14
14
|
* handler inside `runPageAct` and reports resulting page changes / navigation
|
|
@@ -16,4 +16,4 @@ export declare function cdpRunActions(session: CdpSession, data: any): Promise<a
|
|
|
16
16
|
* dispatches the raw handler directly. `run_actions` steps never go through
|
|
17
17
|
* this wrapper — they use dispatchCdpAction and stay lightweight.
|
|
18
18
|
*/
|
|
19
|
-
export declare function cdpObservedPageAction(session: CdpSession, action: PageActAction, data: any): Promise<any>;
|
|
19
|
+
export declare function cdpObservedPageAction(session: CdpSession, action: PageActAction, data: any, controlSource?: ControlSource): Promise<any>;
|
|
@@ -1,17 +1,18 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* CDP 模式的受控页面视觉标识。
|
|
3
3
|
*
|
|
4
|
-
*
|
|
5
|
-
*
|
|
6
|
-
* 网络请求。
|
|
4
|
+
* 与扩展模式共享同一套 Mearl favicon 变体,本地操作显示绿色圆点角标,云端操作
|
|
5
|
+
* 显示紫色云朵角标。图标通过 data URL 内联到新文档脚本,不依赖扩展资源或网络。
|
|
7
6
|
*
|
|
8
|
-
* 注入通过 Page.addScriptToEvaluateOnNewDocument + runImmediately
|
|
9
|
-
* PageSession
|
|
10
|
-
* session 断开重建后由下一次动作重新注册。
|
|
7
|
+
* 注入通过 Page.addScriptToEvaluateOnNewDocument + runImmediately 完成:脚本在
|
|
8
|
+
* PageSession 存续期内跨导航生效;控制来源变化时替换脚本并立即更新当前文档。
|
|
11
9
|
*/
|
|
10
|
+
import { type ControlSource } from '@mearl/browser-core';
|
|
12
11
|
import type { PageSession } from './cdp-session.js';
|
|
13
12
|
/**
|
|
14
|
-
* 确保受控标识已注入到该 page session
|
|
15
|
-
*
|
|
13
|
+
* 确保受控标识已注入到该 page session。相同来源幂等;来源变化时替换跨导航脚本,
|
|
14
|
+
* runImmediately 同步更新当前文档。任何异常都不阻断 agent 动作本身。
|
|
16
15
|
*/
|
|
17
|
-
export declare function ensureControlledIndicator(session: PageSession): Promise<void>;
|
|
16
|
+
export declare function ensureControlledIndicator(session: PageSession, controlSource?: ControlSource): Promise<void>;
|
|
17
|
+
/** browser_release 使用:停止跨导航注入并恢复当前文档的 favicon。 */
|
|
18
|
+
export declare function releaseControlledIndicator(session: PageSession): Promise<void>;
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
/** CDP handler for changing one named cookie in the current page scope. */
|
|
2
|
+
import type { PageSession } from './cdp-session.js';
|
|
3
|
+
export declare function cdpSetCookie(session: PageSession, data: any): Promise<any>;
|
|
4
|
+
export declare function cdpGetCookie(session: PageSession, data: any): Promise<any>;
|
|
@@ -12,6 +12,7 @@ import './tdbank-handlers.js';
|
|
|
12
12
|
import './tab-handlers.js';
|
|
13
13
|
import './interaction-handlers.js';
|
|
14
14
|
import './timezone-handlers.js';
|
|
15
|
+
import './cookie-handlers.js';
|
|
15
16
|
import './snapshot-handlers.js';
|
|
16
17
|
import './recording-handlers.js';
|
|
17
18
|
import './composite-handlers.js';
|
|
@@ -27,3 +28,4 @@ export { cdpPageSnapshot, cdpPageFrames } from './snapshot-handlers.js';
|
|
|
27
28
|
export { cdpRecordStart, cdpRecordStop } from './recording-handlers.js';
|
|
28
29
|
export { cdpRunActions, cdpObservedPageAction } from './composite-handlers.js';
|
|
29
30
|
export { cdpSetTimezone } from './timezone-handlers.js';
|
|
31
|
+
export { cdpGetCookie, cdpSetCookie } from './cookie-handlers.js';
|
|
@@ -2,5 +2,7 @@
|
|
|
2
2
|
* CDP mock interception handlers.
|
|
3
3
|
*/
|
|
4
4
|
import type { PageSession } from './cdp-session.js';
|
|
5
|
+
/** browser_release 使用:丢弃所有依赖当前 CDP 会话的 mock 状态。 */
|
|
6
|
+
export declare function clearCdpMockState(): void;
|
|
5
7
|
export declare function cdpSetMock(session: PageSession, data: any): Promise<any>;
|
|
6
8
|
export declare function cdpGetMocks(_session: PageSession, _data: any): any;
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { BackendNodeRefRegistry, type BackendNodeSnapshotRefAllocator, type PageChangeSet, type PageEffectRefEntry } from '@mearl/browser-core';
|
|
2
|
+
import type { PageSession } from './cdp-session.js';
|
|
3
|
+
export type PageRefEntry = PageEffectRefEntry;
|
|
4
|
+
export declare function getPageRefRegistry(session: PageSession): BackendNodeRefRegistry<PageRefEntry>;
|
|
5
|
+
export declare function beginPageSnapshotRefs(session: PageSession): BackendNodeSnapshotRefAllocator<PageRefEntry>;
|
|
6
|
+
export declare function resolvePageRef(session: PageSession, ref: string): PageRefEntry | undefined;
|
|
7
|
+
export declare function deletePageRef(session: PageSession, ref: string): void;
|
|
8
|
+
export declare function clearPageRefsForNavigation(session: PageSession): void;
|
|
9
|
+
export declare function enrichCdpPageChangeSetWithRefs(session: PageSession, observation: PageChangeSet): Promise<PageChangeSet>;
|
|
@@ -7,3 +7,5 @@
|
|
|
7
7
|
import type { PageSession } from './cdp-session.js';
|
|
8
8
|
export declare function cdpRecordStart(session: PageSession, _data: any): Promise<any>;
|
|
9
9
|
export declare function cdpRecordStop(session: PageSession, _data: any): Promise<any>;
|
|
10
|
+
/** browser_release 使用:停止仍存活页面的录制,并丢弃已失效 target 的残留状态。 */
|
|
11
|
+
export declare function releaseCdpRecordings(sessions: PageSession[]): Promise<void>;
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Browser-level CDP control release.
|
|
3
|
+
*
|
|
4
|
+
* Closes Mearl's browser/page WebSocket sessions while keeping Chrome and all
|
|
5
|
+
* targets alive. A later browser action may create a fresh CdpSession.
|
|
6
|
+
*/
|
|
7
|
+
import type { CdpSession } from './cdp-session.js';
|
|
8
|
+
export interface CdpReleaseResult {
|
|
9
|
+
released: boolean;
|
|
10
|
+
hadActiveControl: boolean;
|
|
11
|
+
affectedTabIds: number[];
|
|
12
|
+
}
|
|
13
|
+
export declare function releaseCdpControl(session: CdpSession): Promise<CdpReleaseResult>;
|
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* CDP tab management handlers.
|
|
3
3
|
*/
|
|
4
|
+
import { type ControlSource } from '@mearl/browser-core';
|
|
4
5
|
import type { CdpSession } from './cdp-session.js';
|
|
5
|
-
export declare function cdpTabOpen(session: CdpSession, data: any): Promise<any>;
|
|
6
|
+
export declare function cdpTabOpen(session: CdpSession, data: any, controlSource?: ControlSource): Promise<any>;
|
|
6
7
|
export declare function cdpTabClose(session: CdpSession, data: any): Promise<any>;
|
|
7
8
|
export declare function cdpTabList(session: CdpSession, _data: any): Promise<any>;
|