@mearl/native-host 2.2.2 → 2.3.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.
@@ -1,5 +1,13 @@
1
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
+ interface CodexExecutableCandidateOptions {
4
+ env?: NodeJS.ProcessEnv;
5
+ homedir?: () => string;
6
+ platform?: NodeJS.Platform;
7
+ processExecPath?: string;
8
+ readdirSync?: typeof import('node:fs').readdirSync;
9
+ }
10
+ export declare function codexExecutableCandidatePaths(options?: CodexExecutableCandidateOptions): string[];
3
11
  export declare function codexThreadUrl(providerSessionId: string): string;
4
12
  export declare function externalOpenCommand(url: string, platform?: NodeJS.Platform): {
5
13
  command: string;
@@ -49,3 +57,4 @@ export declare class CodexAgentProvider implements AgentProvider {
49
57
  private resolveExecutable;
50
58
  private resolveExecutableCandidates;
51
59
  }
60
+ export {};
@@ -1,3 +1,4 @@
1
+ import fs from 'node:fs';
1
2
  export type AgentExecutableResolution = {
2
3
  executable: string;
3
4
  error: null;
@@ -19,6 +20,17 @@ interface AgentExecutableProbeOptions {
19
20
  startError: (error: Error) => string;
20
21
  exitError: (code: number | null) => string;
21
22
  }
23
+ interface AgentExecutableCandidateOptions {
24
+ executableNames: string[];
25
+ configuredPath?: string;
26
+ env?: NodeJS.ProcessEnv;
27
+ extraUserCandidates?: string[];
28
+ home: string;
29
+ platform?: NodeJS.Platform;
30
+ processExecPath?: string;
31
+ readdirSync?: typeof fs.readdirSync;
32
+ }
33
+ export declare function agentExecutableCandidatePaths({ executableNames, configuredPath, env, extraUserCandidates, home, platform, processExecPath, readdirSync, }: AgentExecutableCandidateOptions): string[];
22
34
  export declare class AgentExecutableResolver {
23
35
  private readonly options;
24
36
  private resolvedExecutable;
@@ -1,2 +1,2 @@
1
- export { prependNodePath as createAgentChildEnv, resolveSpawnCommand as agentSpawnCommand, } from '@mearl/setup/process';
1
+ export { prependNodePath as createAgentChildEnv, resolveSpawnCommand as agentSpawnCommand, versionManagerExecutableCandidates, } from '@mearl/setup/process';
2
2
  export type { SpawnCommand as AgentSpawnCommand } from '@mearl/setup/process';
@@ -1,9 +1,18 @@
1
+ import fs from 'node:fs';
1
2
  import * as acp from '@agentclientprotocol/sdk';
2
3
  import type { AgentChatImageInput, AgentChatModelInfo, AgentChatProviderDescriptor, AgentInstalledSkill } from '@mearl/browser-core';
3
4
  import type { AgentProvider, AgentProviderEvent, AgentProviderListSessionsOptions, AgentProviderListSessionsResult, AgentProviderResumeResult, AgentProviderSessionOptions } from './provider.js';
4
5
  export declare function qoderModelInfo(configOptions: acp.SessionConfigOption[] | null | undefined): AgentChatModelInfo | undefined;
5
6
  export declare function parseQoderSkillsList(output: string, cwd: string, home?: string): AgentInstalledSkill[];
6
7
  export declare function qoderInstallCommand(platform?: NodeJS.Platform): string;
8
+ interface QoderExecutableCandidateOptions {
9
+ env?: NodeJS.ProcessEnv;
10
+ homedir?: () => string;
11
+ platform?: NodeJS.Platform;
12
+ processExecPath?: string;
13
+ readdirSync?: typeof fs.readdirSync;
14
+ }
15
+ export declare function qoderExecutableCandidatePaths(options?: QoderExecutableCandidateOptions): string[];
7
16
  export declare class QoderAgentProvider implements AgentProvider {
8
17
  private readonly log;
9
18
  private readonly clientVersion;
@@ -53,3 +62,4 @@ export declare class QoderAgentProvider implements AgentProvider {
53
62
  private resolveExecutableCandidates;
54
63
  private emit;
55
64
  }
65
+ export {};
@@ -4,8 +4,9 @@
4
4
  * fills these buffers; callers read from them without CDP interaction.
5
5
  */
6
6
  import type { MtopRequest, RumEvent, ConsoleLog, RequestBufferAccounting } from '@mearl/browser-core';
7
+ import { type CaptureSequenceState } from '@mearl/browser-core';
7
8
  import type { CdpClient, CdpChildSession } from './client.js';
8
- interface PartialRequest {
9
+ interface PartialRequest extends MtopRequest {
9
10
  id: number;
10
11
  requestId: string;
11
12
  timestamp: string;
@@ -32,7 +33,7 @@ interface PartialRequest {
32
33
  isProxy: boolean;
33
34
  proxyRequestUrl: string | null;
34
35
  proxyData: any;
35
- startTs: number;
36
+ startTs?: number;
36
37
  }
37
38
  export interface CdpBuffers {
38
39
  requests: MtopRequest[];
@@ -41,7 +42,11 @@ export interface CdpBuffers {
41
42
  pending: Map<string, PartialRequest>;
42
43
  requestCounter: number;
43
44
  requestBufferAccounting: RequestBufferAccounting;
45
+ capture: CaptureSequenceState & {
46
+ droppedRequestsThroughSequence: number;
47
+ droppedLogsThroughSequence: number;
48
+ };
44
49
  }
45
- export declare function createBuffers(): CdpBuffers;
46
- export declare function setupBufferListeners(client: CdpClient | CdpChildSession, buffers: CdpBuffers): void;
50
+ export declare function createBuffers(tabId?: number): CdpBuffers;
51
+ export declare function setupBufferListeners(client: CdpClient | CdpChildSession, buffers: CdpBuffers): Promise<void>;
47
52
  export {};
@@ -9,6 +9,7 @@
9
9
  import { CdpClient, CdpChildSession } from './client.js';
10
10
  import { type CdpBuffers } from './buffers.js';
11
11
  export interface PageSession {
12
+ tabId: number;
12
13
  client: CdpClient | CdpChildSession;
13
14
  buffers: CdpBuffers;
14
15
  targetId: string;
@@ -10,10 +10,9 @@ import type { CdpSession } from './cdp-session.js';
10
10
  import { type ControlSource, type PageActAction, type RunActionsParams } from '@mearl/browser-core';
11
11
  export declare function cdpRunActions(session: CdpSession, data: RunActionsParams, controlSource?: ControlSource): Promise<any>;
12
12
  /**
13
- * Runs a page interaction action with built-in observation: executes the raw
14
- * handler inside `runPageAct` and reports resulting page changes / navigation
15
- * in the same round trip. Callers opt out with `observe: false`, which
16
- * dispatches the raw handler directly. `run_actions` steps never go through
17
- * this wrapper — they use dispatchCdpAction and stay lightweight.
13
+ * Runs a page interaction action with built-in observation and diagnostic
14
+ * deltas. `observe: false` disables DOM/navigation observation;
15
+ * `diagnostics: false` also disables the atomic console/network result.
16
+ * `run_actions` stays lightweight and never enters this wrapper.
18
17
  */
19
18
  export declare function cdpObservedPageAction(session: CdpSession, action: PageActAction, data: any, controlSource?: ControlSource): Promise<any>;
@@ -1,8 +1,10 @@
1
1
  /**
2
2
  * CDP request/log/event buffer query handlers.
3
3
  */
4
- import type { GetEventsParams, GetLogsParams, GetRequestsParams } from '@mearl/browser-core';
4
+ import type { CaptureCheckpointParams, GetEventsParams, GetLogsParams, GetRequestsParams, PageDiagnosticsOptions } from '@mearl/browser-core';
5
5
  import type { PageSession } from './cdp-session.js';
6
6
  export declare function cdpGetRequests(session: PageSession, data: GetRequestsParams): Promise<any>;
7
7
  export declare function cdpGetLogs(session: PageSession, data: GetLogsParams): Promise<any>;
8
+ export declare function cdpCaptureCheckpoint(session: PageSession, _data: CaptureCheckpointParams): Promise<any>;
9
+ export declare function collectCdpPageDiagnostics(session: PageSession, after: string, diagnostics: PageDiagnosticsOptions): Promise<Record<string, any>>;
8
10
  export declare function cdpGetEvents(session: PageSession, data: GetEventsParams): Promise<any>;