@mind-harness/mh-browser 0.1.1 → 0.1.3

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.
@@ -26,7 +26,8 @@ export interface Dialog {
26
26
  message: string;
27
27
  }
28
28
  export interface PageView {
29
- tab: TabId;
29
+ /** Present when this result opened, or reused, a tab. */
30
+ tab?: TabId;
30
31
  url: string;
31
32
  title: string;
32
33
  observedAt: string;
@@ -51,6 +52,11 @@ export interface PageView {
51
52
  /** Response text of a textual non-HTML document navigation, shown in place of the snapshot. */
52
53
  body?: string;
53
54
  inPresence: boolean;
55
+ /**
56
+ * A non-GET declared action's landing page: the result carries the header
57
+ * and one sentence, and the page is not a delivery.
58
+ */
59
+ headerOnly?: boolean;
54
60
  dialog?: Dialog;
55
61
  incomplete?: {
56
62
  load: boolean;
@@ -61,58 +67,114 @@ export interface PageView {
61
67
  seconds: number;
62
68
  };
63
69
  download?: Download;
70
+ /**
71
+ * When set, the page element body is this sentence instead of the snapshot.
72
+ * An empty string is a page with attributes and no body.
73
+ */
74
+ summary?: string;
75
+ /** Text that follows `summary` inside the page element. */
76
+ detail?: string;
77
+ /** Write requests sent while `browser_evaluate` ran, grouped by method, site, and sender. */
78
+ writes?: {
79
+ method: string;
80
+ origin: string;
81
+ fromCall: boolean;
82
+ count: number;
83
+ }[];
84
+ /** Screenshot bytes. The tool saves them; they are not written into meta. */
85
+ shot?: {
86
+ mediaType: 'image/png' | 'image/jpeg' | 'image/webp';
87
+ bytes: Uint8Array;
88
+ };
64
89
  }
65
- export interface PageError {
66
- tab?: TabId;
67
- url: string;
68
- reason: string;
69
- }
70
- export interface TabInfo {
71
- tab: TabId;
72
- url: string;
73
- title: string;
74
- occupied: boolean;
75
- inPresence: boolean;
76
- mayHaveChanged: boolean;
90
+ export type Modifier = 'Alt' | 'Control' | 'ControlOrMeta' | 'Meta' | 'Shift';
91
+ export interface Target {
92
+ target: string;
93
+ element?: string;
77
94
  }
78
- export type ActAction = {
95
+ /** One page operation. `kind` is the tool name without the `browser_` prefix. */
96
+ export type PageOp = (Target & {
79
97
  kind: 'click';
80
- ref: string;
81
- double?: boolean;
98
+ doubleClick?: boolean;
82
99
  button?: 'left' | 'right' | 'middle';
83
- modifiers?: Array<'Alt' | 'Control' | 'Meta' | 'Shift'>;
84
- } | {
85
- kind: 'select';
86
- ref: string;
100
+ modifiers?: Modifier[];
101
+ }) | (Target & {
102
+ kind: 'hover';
103
+ }) | (Target & {
104
+ kind: 'select_option';
87
105
  values: string[];
106
+ }) | {
107
+ kind: 'drag';
108
+ startTarget: string;
109
+ startElement?: string;
110
+ endTarget: string;
111
+ endElement?: string;
112
+ } | (Target & {
113
+ kind: 'type';
114
+ text: string;
115
+ submit?: boolean;
116
+ slowly?: boolean;
117
+ }) | {
118
+ kind: 'fill_form';
119
+ fields: (Target & {
120
+ name: string;
121
+ type: 'textbox' | 'checkbox' | 'radio' | 'combobox' | 'slider';
122
+ value: string;
123
+ })[];
88
124
  } | {
89
- kind: 'press';
125
+ kind: 'press_key';
90
126
  key: string;
91
- ref?: string;
92
- } | {
93
- kind: 'fill';
94
- fields: {
95
- ref: string;
96
- value: string;
97
- }[];
98
127
  } | {
99
- kind: 'upload';
100
- ref: string;
101
- files: string[];
128
+ kind: 'file_upload';
129
+ paths?: string[];
102
130
  } | {
103
- kind: 'dialog';
131
+ kind: 'handle_dialog';
104
132
  accept: boolean;
105
133
  promptText?: string;
106
134
  } | {
107
- kind: 'back';
135
+ kind: 'navigate_back';
108
136
  } | {
109
- kind: 'wait';
137
+ kind: 'wait_for';
110
138
  text?: string;
111
139
  textGone?: string;
112
140
  time?: number;
113
141
  } | {
114
- kind: 'look';
142
+ kind: 'snapshot';
143
+ target?: string;
144
+ depth?: number;
145
+ boxes?: boolean;
146
+ } | {
147
+ kind: 'find';
148
+ text?: string;
149
+ regex?: string;
150
+ maxResults?: number;
151
+ } | {
152
+ kind: 'take_screenshot';
153
+ element?: string;
154
+ target?: string;
155
+ type?: 'png' | 'jpeg' | 'webp';
156
+ fullPage?: boolean;
157
+ scale?: 'css' | 'device';
158
+ } | {
159
+ kind: 'evaluate';
160
+ element?: string;
161
+ target?: string;
162
+ function: string;
163
+ callId: string;
115
164
  };
165
+ export interface PageError {
166
+ tab?: TabId;
167
+ url: string;
168
+ reason: string;
169
+ }
170
+ export interface TabInfo {
171
+ tab: TabId;
172
+ url: string;
173
+ title: string;
174
+ occupied: boolean;
175
+ inPresence: boolean;
176
+ mayHaveChanged: boolean;
177
+ }
116
178
  export declare class MhBrowserError extends Error {
117
179
  readonly code: string;
118
180
  readonly page?: PageView;
@@ -157,7 +219,11 @@ export interface InvokeCall {
157
219
  name: string;
158
220
  item?: string;
159
221
  input?: Record<string, unknown>;
160
- seen: SeenView | 'not-in-context';
222
+ /** The Agent View text the model was shown, and the address it was read from. */
223
+ shown: {
224
+ url: string;
225
+ text: string;
226
+ };
161
227
  }
162
228
  /** The Agent View the model saw last: its declared `version` when it had one, and its digest. */
163
229
  export interface SeenView {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@mind-harness/mh-browser",
3
- "version": "0.1.1",
3
+ "version": "0.1.3",
4
4
  "description": "Opens pages in a real browser for the agent, keeps chosen Agent Views in context, and hands the browser to you when a person is needed.",
5
5
  "license": "SEE LICENSE IN LICENSE",
6
6
  "files": [
@@ -43,27 +43,27 @@
43
43
  "access": "public"
44
44
  },
45
45
  "dependencies": {
46
- "playwright": "1.64.1",
46
+ "playwright": "^1.64.1",
47
47
  "yaml": "^2.9.1",
48
- "zod": "4.4.3"
48
+ "zod": "^4.6.6"
49
49
  },
50
50
  "devDependencies": {
51
- "@deepseek-ai/cordis": "4.0.5",
52
- "@deepseek-ai/dsh-agent": "0.2.1-rc.3",
53
- "@deepseek-ai/dsh-agent-loop": "0.2.1-rc.3",
54
- "@deepseek-ai/dsh-agent-loop-testkit": "0.2.1-rc.3",
55
- "@deepseek-ai/dsh-attachment": "0.2.1-rc.3",
56
- "@deepseek-ai/dsh-browser-use": "0.2.1-rc.3",
57
- "@deepseek-ai/dsh-home-paths": "0.2.1-rc.3",
58
- "@deepseek-ai/dsh-llm": "0.2.1-rc.3",
59
- "@deepseek-ai/dsh-llm-mock-server": "0.2.1-rc.3",
60
- "@deepseek-ai/dsh-sandbox-policy": "0.2.1-rc.3",
61
- "@deepseek-ai/dsh-session": "0.2.1-rc.3",
62
- "@deepseek-ai/dsh-session-projection": "0.2.1-rc.3",
63
- "@deepseek-ai/dsh-tools": "0.2.1-rc.3",
64
- "@deepseek-ai/dsh-typert-protocol": "0.2.1-rc.3",
65
- "@deepseek-ai/dsh-user-questions": "0.2.1-rc.3",
66
- "@deepseek-ai/schemastery": "3.18.5"
51
+ "@deepseek-ai/cordis": "~4.0.5",
52
+ "@deepseek-ai/dsh-agent": "^0.2.1-rc.3",
53
+ "@deepseek-ai/dsh-agent-loop": "^0.2.1-rc.3",
54
+ "@deepseek-ai/dsh-agent-loop-testkit": "^0.2.1-rc.3",
55
+ "@deepseek-ai/dsh-attachment": "^0.2.1-rc.3",
56
+ "@deepseek-ai/dsh-browser-use": "^0.2.1-rc.3",
57
+ "@deepseek-ai/dsh-home-paths": "^0.2.1-rc.3",
58
+ "@deepseek-ai/dsh-llm": "^0.2.1-rc.3",
59
+ "@deepseek-ai/dsh-llm-mock-server": "^0.2.1-rc.3",
60
+ "@deepseek-ai/dsh-sandbox-policy": "^0.2.1-rc.3",
61
+ "@deepseek-ai/dsh-session": "^0.2.1-rc.3",
62
+ "@deepseek-ai/dsh-session-projection": "^0.2.1-rc.3",
63
+ "@deepseek-ai/dsh-tools": "^0.2.1-rc.3",
64
+ "@deepseek-ai/dsh-typert-protocol": "^0.2.1-rc.3",
65
+ "@deepseek-ai/dsh-user-questions": "^0.2.1-rc.3",
66
+ "@deepseek-ai/schemastery": "~3.18.5"
67
67
  },
68
68
  "peerDependencies": {
69
69
  "@deepseek-ai/cordis": "~4.0.5",
@@ -75,5 +75,7 @@
75
75
  "@deepseek-ai/schemastery": "~3.18.5"
76
76
  },
77
77
  "icon": "./icon.svg",
78
- "scripts": {}
78
+ "scripts": {
79
+ "version": "node ../../scripts/mh/sync-extension-version.ts"
80
+ }
79
81
  }