@getmateo/plugin 0.19.9 → 0.19.10

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,5 @@
1
1
  import type { MateoApi, MateoWorkspaceActions, MateoWorkspaceHandle } from "@getmateo/client";
2
+ import type { BrowserAutomationCommand, BrowserAutomationDialogEvent, BrowserAutomationErrorCode, BrowserAutomationResult, BrowserAutomationTabInfo, BrowserDownloadReceipt } from "@getmateo/protocol/browser-automation/rpc-schemas";
2
3
  import type { ZodType, input as ZodInput, output as ZodOutput } from "zod";
3
4
  import type { PluginRpcContract } from "../rpc.js";
4
5
  import type { PluginCleanup } from "../contracts.js";
@@ -6,7 +7,108 @@ import type { ProviderRegistration } from "./provider.js";
6
7
  import type { UsageSourceRegistration } from "./usage.js";
7
8
  import type { ModelSourceRegistration } from "./models.js";
8
9
  import type { PluginLifecycleRegistration } from "./lifecycle.js";
9
- export interface PluginWorkspaceBrowser {
10
+ export type { BrowserAutomationCommand, BrowserAutomationDialogEvent, BrowserAutomationErrorCode, BrowserAutomationResult, BrowserAutomationTabInfo, BrowserDownloadReceipt, };
11
+ export interface PluginBrowserTab extends BrowserAutomationTabInfo {
12
+ origin: string;
13
+ }
14
+ export interface PluginBrowserExecuteOptions {
15
+ workspaceId?: string;
16
+ timeoutMs?: number;
17
+ }
18
+ export interface PluginBrowserAutomation {
19
+ /** Execute any browser-automation command directly so new protocol commands work without SDK changes. */
20
+ execute<C extends BrowserAutomationCommand>(command: C, options?: PluginBrowserExecuteOptions): Promise<Extract<BrowserAutomationResult, {
21
+ command: C["command"];
22
+ }>>;
23
+ listTabs(options?: PluginBrowserExecuteOptions): Promise<PluginBrowserTab[]>;
24
+ newTab(url?: string, options?: PluginBrowserExecuteOptions): Promise<{
25
+ browserId: string;
26
+ url: string;
27
+ workspaceId?: string;
28
+ }>;
29
+ closeTab(browserId: string, options?: PluginBrowserExecuteOptions): Promise<void>;
30
+ navigate(browserId: string, url: string, options?: PluginBrowserExecuteOptions): Promise<void>;
31
+ back(browserId: string, options?: PluginBrowserExecuteOptions): Promise<void>;
32
+ forward(browserId: string, options?: PluginBrowserExecuteOptions): Promise<void>;
33
+ reload(browserId: string, options?: PluginBrowserExecuteOptions): Promise<void>;
34
+ wait(browserId: string, condition: {
35
+ text?: string;
36
+ url?: string;
37
+ timeoutMs?: number;
38
+ }, options?: PluginBrowserExecuteOptions): Promise<{
39
+ matched: "text" | "url";
40
+ }>;
41
+ snapshot(browserId: string, options?: PluginBrowserExecuteOptions): Promise<Extract<BrowserAutomationResult, {
42
+ command: "snapshot";
43
+ }>>;
44
+ screenshot(browserId: string, options?: {
45
+ fullPage?: boolean;
46
+ } & PluginBrowserExecuteOptions): Promise<Extract<BrowserAutomationResult, {
47
+ command: "screenshot";
48
+ }>>;
49
+ click(browserId: string, input: {
50
+ ref: string;
51
+ button?: "left" | "right" | "middle";
52
+ doubleClick?: boolean;
53
+ modifiers?: readonly ("Alt" | "Control" | "Meta" | "Shift")[];
54
+ }, options?: PluginBrowserExecuteOptions): Promise<Extract<BrowserAutomationResult, {
55
+ command: "click";
56
+ }>>;
57
+ fill(browserId: string, input: {
58
+ ref: string;
59
+ value: string;
60
+ }, options?: PluginBrowserExecuteOptions): Promise<void>;
61
+ type(browserId: string, input: {
62
+ text: string;
63
+ ref?: string;
64
+ }, options?: PluginBrowserExecuteOptions): Promise<void>;
65
+ keypress(browserId: string, input: {
66
+ key: string;
67
+ ref?: string;
68
+ }, options?: PluginBrowserExecuteOptions): Promise<void>;
69
+ select(browserId: string, input: {
70
+ ref: string;
71
+ value: string;
72
+ }, options?: PluginBrowserExecuteOptions): Promise<void>;
73
+ hover(browserId: string, input: {
74
+ ref: string;
75
+ }, options?: PluginBrowserExecuteOptions): Promise<void>;
76
+ drag(browserId: string, input: {
77
+ sourceRef: string;
78
+ targetRef: string;
79
+ }, options?: PluginBrowserExecuteOptions): Promise<void>;
80
+ scroll(browserId: string, input: {
81
+ deltaX: number;
82
+ deltaY: number;
83
+ ref?: string;
84
+ }, options?: PluginBrowserExecuteOptions): Promise<void>;
85
+ resize(browserId: string, input: {
86
+ width: number;
87
+ height: number;
88
+ }, options?: PluginBrowserExecuteOptions): Promise<{
89
+ width: number;
90
+ height: number;
91
+ }>;
92
+ logs(browserId: string, options?: {
93
+ maxEntries?: number;
94
+ } & PluginBrowserExecuteOptions): Promise<Extract<BrowserAutomationResult, {
95
+ command: "logs";
96
+ }>>;
97
+ evaluate<T = unknown>(browserId: string, fn: string, options?: {
98
+ ref?: string;
99
+ } & PluginBrowserExecuteOptions): Promise<{
100
+ value: T;
101
+ resultJson: string;
102
+ truncated: boolean;
103
+ }>;
104
+ uploadFiles(browserId: string, input: {
105
+ ref: string;
106
+ filePaths: readonly string[];
107
+ }, options?: PluginBrowserExecuteOptions): Promise<void>;
108
+ listDownloads(options?: PluginBrowserExecuteOptions): Promise<BrowserDownloadReceipt[]>;
109
+ }
110
+ export interface PluginWorkspaceBrowser extends Omit<PluginBrowserAutomation, "listTabs" | "navigate" | "wait"> {
111
+ readonly automation: PluginBrowserAutomation;
10
112
  listTabs(): Promise<{
11
113
  browserId: string;
12
114
  origin: string;
@@ -24,6 +126,7 @@ export interface PluginWorkspaceBrowser {
24
126
  }): Promise<void>;
25
127
  }
26
128
  export interface PluginMateoApi extends MateoApi {
129
+ readonly browser: PluginBrowserAutomation;
27
130
  readonly workspaces: Omit<MateoWorkspaceActions, "ref"> & {
28
131
  ref(...args: Parameters<MateoWorkspaceActions["ref"]>): MateoWorkspaceHandle & {
29
132
  readonly browser: PluginWorkspaceBrowser;
@@ -1,6 +1,6 @@
1
1
  export type { UsageSourceRegistration, UsageReport, UsageWindow, UsageBalance, UsageDetail, } from "./usage.js";
2
2
  export type { ModelSourceMode, ModelSourceModel, ModelSourceRegistration, ModelSourceRequest, ModelSourceResult, } from "./models.js";
3
- export type { PluginBuiltinState, PluginHandlerContext, PluginMateoApi, PluginWorkspaceBrowser, PluginServerContext, PluginServerContribution, PluginServerPlugins, PluginSettings, PluginSettingsState, } from "./contracts.js";
3
+ export type { BrowserAutomationCommand, BrowserAutomationDialogEvent, BrowserAutomationErrorCode, BrowserAutomationResult, BrowserAutomationTabInfo, BrowserDownloadReceipt, PluginBrowserAutomation, PluginBrowserExecuteOptions, PluginBrowserTab, PluginBuiltinState, PluginHandlerContext, PluginMateoApi, PluginWorkspaceBrowser, PluginServerContext, PluginServerContribution, PluginServerPlugins, PluginSettings, PluginSettingsState, } from "./contracts.js";
4
4
  export type { PluginHookContext, PluginHookWorkspace, PluginHookAgent, PluginSessionOpenRequest, PluginTurnOutcome, PluginLifecycleEvents, PluginBeforeRequests, PluginLifecycleRegistration, } from "./lifecycle.js";
5
5
  export { spawnProcess, execCommand, terminateProcess } from "./process.js";
6
6
  //# sourceMappingURL=index.d.ts.map
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@getmateo/plugin",
3
- "version": "0.19.9",
3
+ "version": "0.19.10",
4
4
  "description": "Mateo plugin SDK package",
5
5
  "license": "Apache-2.0",
6
6
  "repository": {
@@ -76,8 +76,8 @@
76
76
  "use-sync-external-store": "^1.6.0"
77
77
  },
78
78
  "devDependencies": {
79
- "@getmateo/client": "0.19.9",
80
- "@getmateo/protocol": "0.19.9",
79
+ "@getmateo/client": "0.19.10",
80
+ "@getmateo/protocol": "0.19.10",
81
81
  "@types/node": "^20.9.0",
82
82
  "@types/react": "~19.3.0",
83
83
  "react": "19.3.0",
@@ -87,8 +87,8 @@
87
87
  "zod": "4.6.7"
88
88
  },
89
89
  "peerDependencies": {
90
- "@getmateo/client": "0.19.9",
91
- "@getmateo/protocol": "0.19.9",
90
+ "@getmateo/client": "0.19.10",
91
+ "@getmateo/protocol": "0.19.10",
92
92
  "react": "^19.1.0",
93
93
  "react-native": ">=0.81.5",
94
94
  "zod": "4.6.7"