@mearl/native-host 2.0.0 → 2.0.2

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,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): {
@@ -16,6 +16,7 @@ export declare class CodexAgentProvider implements AgentProvider {
16
16
  private pendingRequests;
17
17
  private listeners;
18
18
  private knownThreadIds;
19
+ private sessionModels;
19
20
  constructor(log: (...args: any[]) => void, clientVersion: string);
20
21
  getDescriptor(): Promise<AgentChatProviderDescriptor>;
21
22
  onEvent(listener: (event: AgentProviderEvent) => void): () => void;
@@ -23,6 +24,7 @@ export declare class CodexAgentProvider implements AgentProvider {
23
24
  listSkills(cwd?: string): Promise<AgentInstalledSkill[]>;
24
25
  startSession(options: AgentProviderSessionOptions): Promise<string>;
25
26
  resumeSession(providerSessionId: string, options: AgentProviderSessionOptions): Promise<AgentProviderResumeResult>;
27
+ getSessionModel(providerSessionId: string): AgentChatModelInfo | undefined;
26
28
  sendMessage(providerSessionId: string, message: string, images?: AgentChatImageInput[]): Promise<{
27
29
  turnId: string;
28
30
  }>;
@@ -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;
@@ -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 type { AgentChatImageInput, AgentChatProviderDescriptor, AgentInstalledSkill } from '@mearl/browser-core';
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 {
@@ -23,6 +25,7 @@ export declare class QoderAgentProvider implements AgentProvider {
23
25
  listSkills(cwd?: string): Promise<AgentInstalledSkill[]>;
24
26
  startSession(options: AgentProviderSessionOptions): Promise<string>;
25
27
  resumeSession(providerSessionId: string, options: AgentProviderSessionOptions): Promise<AgentProviderResumeResult>;
28
+ getSessionModel(providerSessionId: string): AgentChatModelInfo | undefined;
26
29
  validateMessageInput(images: AgentChatImageInput[]): Promise<void>;
27
30
  sendMessage(providerSessionId: string, message: string, images?: AgentChatImageInput[]): Promise<{
28
31
  turnId: string;
@@ -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;
@@ -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>;
@@ -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>;