@framers/agentos-ext-web-browser 1.1.0 → 1.1.1
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/README.md +22 -23
- package/dist/index.d.ts +68 -12
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +23 -23
- package/dist/index.js.map +1 -1
- package/dist/services/browserService.d.ts +1 -1
- package/dist/services/browserService.d.ts.map +1 -1
- package/dist/services/browserService.js.map +1 -1
- package/dist/tools/click.d.ts +15 -18
- package/dist/tools/click.d.ts.map +1 -1
- package/dist/tools/click.js +27 -27
- package/dist/tools/click.js.map +1 -1
- package/dist/tools/navigate.d.ts +15 -18
- package/dist/tools/navigate.d.ts.map +1 -1
- package/dist/tools/navigate.js +37 -37
- package/dist/tools/navigate.js.map +1 -1
- package/dist/tools/scrape.d.ts +15 -18
- package/dist/tools/scrape.d.ts.map +1 -1
- package/dist/tools/scrape.js +31 -31
- package/dist/tools/scrape.js.map +1 -1
- package/dist/tools/screenshot.d.ts +15 -18
- package/dist/tools/screenshot.d.ts.map +1 -1
- package/dist/tools/screenshot.js +38 -38
- package/dist/tools/screenshot.js.map +1 -1
- package/dist/tools/snapshot.d.ts +16 -19
- package/dist/tools/snapshot.d.ts.map +1 -1
- package/dist/tools/snapshot.js +36 -27
- package/dist/tools/snapshot.js.map +1 -1
- package/dist/tools/type.d.ts +15 -18
- package/dist/tools/type.d.ts.map +1 -1
- package/dist/tools/type.js +36 -36
- package/dist/tools/type.js.map +1 -1
- package/manifest.json +13 -7
- package/package.json +3 -2
package/dist/tools/type.d.ts
CHANGED
|
@@ -4,17 +4,22 @@
|
|
|
4
4
|
*
|
|
5
5
|
* @module @framers/agentos-ext-web-browser
|
|
6
6
|
*/
|
|
7
|
-
import type { ITool } from '@framers/agentos';
|
|
8
|
-
import type { BrowserService } from '../services/browserService';
|
|
9
|
-
import type { TypeResult } from '../types';
|
|
7
|
+
import type { ITool, JSONSchemaObject, ToolExecutionContext, ToolExecutionResult } from '@framers/agentos';
|
|
8
|
+
import type { BrowserService } from '../services/browserService.js';
|
|
9
|
+
import type { TypeResult } from '../types.js';
|
|
10
10
|
/**
|
|
11
11
|
* Tool for typing into inputs
|
|
12
12
|
*/
|
|
13
13
|
export declare class TypeTool implements ITool {
|
|
14
14
|
private browserService;
|
|
15
|
-
readonly id = "
|
|
16
|
-
|
|
17
|
-
readonly
|
|
15
|
+
readonly id = "web-browser-type-v1";
|
|
16
|
+
/** Tool call name used by the LLM / ToolExecutor. */
|
|
17
|
+
readonly name = "browser_type";
|
|
18
|
+
readonly displayName = "Browser Type";
|
|
19
|
+
readonly description = "Type text into an input field using a CSS selector.";
|
|
20
|
+
readonly category = "research";
|
|
21
|
+
readonly hasSideEffects = true;
|
|
22
|
+
readonly inputSchema: JSONSchemaObject;
|
|
18
23
|
constructor(browserService: BrowserService);
|
|
19
24
|
/**
|
|
20
25
|
* Execute typing
|
|
@@ -24,21 +29,13 @@ export declare class TypeTool implements ITool {
|
|
|
24
29
|
text: string;
|
|
25
30
|
delay?: number;
|
|
26
31
|
clear?: boolean;
|
|
27
|
-
}): Promise<
|
|
28
|
-
success: boolean;
|
|
29
|
-
output?: TypeResult;
|
|
30
|
-
error?: string;
|
|
31
|
-
}>;
|
|
32
|
+
}, _context: ToolExecutionContext): Promise<ToolExecutionResult<TypeResult>>;
|
|
32
33
|
/**
|
|
33
34
|
* Validate input
|
|
34
35
|
*/
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
errors
|
|
36
|
+
validateArgs(input: Record<string, any>): {
|
|
37
|
+
isValid: boolean;
|
|
38
|
+
errors?: any[];
|
|
38
39
|
};
|
|
39
|
-
/**
|
|
40
|
-
* Get JSON schema for tool
|
|
41
|
-
*/
|
|
42
|
-
getSchema(): any;
|
|
43
40
|
}
|
|
44
41
|
//# sourceMappingURL=type.d.ts.map
|
package/dist/tools/type.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"type.d.ts","sourceRoot":"","sources":["../../src/tools/type.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,kBAAkB,CAAC;
|
|
1
|
+
{"version":3,"file":"type.d.ts","sourceRoot":"","sources":["../../src/tools/type.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,KAAK,EAAE,KAAK,EAAE,gBAAgB,EAAE,oBAAoB,EAAE,mBAAmB,EAAE,MAAM,kBAAkB,CAAC;AAC3G,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,+BAA+B,CAAC;AACpE,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,aAAa,CAAC;AAE9C;;GAEG;AACH,qBAAa,QAAS,YAAW,KAAK;IAmCxB,OAAO,CAAC,cAAc;IAlClC,SAAgB,EAAE,yBAAyB;IAC3C,qDAAqD;IACrD,SAAgB,IAAI,kBAAkB;IACtC,SAAgB,WAAW,kBAAkB;IAC7C,SAAgB,WAAW,yDAAyD;IACpF,SAAgB,QAAQ,cAAc;IACtC,SAAgB,cAAc,QAAQ;IAEtC,SAAgB,WAAW,EAAE,gBAAgB,CAwB3C;gBAEkB,cAAc,EAAE,cAAc;IAElD;;OAEG;IACG,OAAO,CACX,KAAK,EAAE;QAAE,QAAQ,EAAE,MAAM,CAAC;QAAC,IAAI,EAAE,MAAM,CAAC;QAAC,KAAK,CAAC,EAAE,MAAM,CAAC;QAAC,KAAK,CAAC,EAAE,OAAO,CAAA;KAAE,EAC1E,QAAQ,EAAE,oBAAoB,GAC7B,OAAO,CAAC,mBAAmB,CAAC,UAAU,CAAC,CAAC;IAa3C;;OAEG;IACH,YAAY,CAAC,KAAK,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,GAAG;QAAE,OAAO,EAAE,OAAO,CAAC;QAAC,MAAM,CAAC,EAAE,GAAG,EAAE,CAAA;KAAE;CAiB/E"}
|
package/dist/tools/type.js
CHANGED
|
@@ -9,22 +9,51 @@
|
|
|
9
9
|
*/
|
|
10
10
|
export class TypeTool {
|
|
11
11
|
browserService;
|
|
12
|
-
id = '
|
|
13
|
-
name
|
|
14
|
-
|
|
12
|
+
id = 'web-browser-type-v1';
|
|
13
|
+
/** Tool call name used by the LLM / ToolExecutor. */
|
|
14
|
+
name = 'browser_type';
|
|
15
|
+
displayName = 'Browser Type';
|
|
16
|
+
description = 'Type text into an input field using a CSS selector.';
|
|
17
|
+
category = 'research';
|
|
18
|
+
hasSideEffects = true;
|
|
19
|
+
inputSchema = {
|
|
20
|
+
type: 'object',
|
|
21
|
+
required: ['selector', 'text'],
|
|
22
|
+
properties: {
|
|
23
|
+
selector: {
|
|
24
|
+
type: 'string',
|
|
25
|
+
description: 'CSS selector for the input element',
|
|
26
|
+
},
|
|
27
|
+
text: {
|
|
28
|
+
type: 'string',
|
|
29
|
+
description: 'Text to type',
|
|
30
|
+
},
|
|
31
|
+
delay: {
|
|
32
|
+
type: 'number',
|
|
33
|
+
description: 'Delay between keystrokes (ms)',
|
|
34
|
+
default: 0,
|
|
35
|
+
},
|
|
36
|
+
clear: {
|
|
37
|
+
type: 'boolean',
|
|
38
|
+
description: 'Clear existing text before typing',
|
|
39
|
+
default: false,
|
|
40
|
+
},
|
|
41
|
+
},
|
|
42
|
+
additionalProperties: false,
|
|
43
|
+
};
|
|
15
44
|
constructor(browserService) {
|
|
16
45
|
this.browserService = browserService;
|
|
17
46
|
}
|
|
18
47
|
/**
|
|
19
48
|
* Execute typing
|
|
20
49
|
*/
|
|
21
|
-
async execute(input) {
|
|
50
|
+
async execute(input, _context) {
|
|
22
51
|
try {
|
|
23
52
|
const result = await this.browserService.type(input.selector, input.text, {
|
|
24
53
|
delay: input.delay,
|
|
25
54
|
clear: input.clear,
|
|
26
55
|
});
|
|
27
|
-
return { success: result.success, output: result };
|
|
56
|
+
return { success: result.success, output: result, error: result.success ? undefined : 'Type failed' };
|
|
28
57
|
}
|
|
29
58
|
catch (error) {
|
|
30
59
|
return { success: false, error: error.message };
|
|
@@ -33,7 +62,7 @@ export class TypeTool {
|
|
|
33
62
|
/**
|
|
34
63
|
* Validate input
|
|
35
64
|
*/
|
|
36
|
-
|
|
65
|
+
validateArgs(input) {
|
|
37
66
|
const errors = [];
|
|
38
67
|
if (!input.selector) {
|
|
39
68
|
errors.push('Selector is required');
|
|
@@ -47,36 +76,7 @@ export class TypeTool {
|
|
|
47
76
|
else if (typeof input.text !== 'string') {
|
|
48
77
|
errors.push('Text must be a string');
|
|
49
78
|
}
|
|
50
|
-
return
|
|
51
|
-
}
|
|
52
|
-
/**
|
|
53
|
-
* Get JSON schema for tool
|
|
54
|
-
*/
|
|
55
|
-
getSchema() {
|
|
56
|
-
return {
|
|
57
|
-
type: 'object',
|
|
58
|
-
required: ['selector', 'text'],
|
|
59
|
-
properties: {
|
|
60
|
-
selector: {
|
|
61
|
-
type: 'string',
|
|
62
|
-
description: 'CSS selector for the input element',
|
|
63
|
-
},
|
|
64
|
-
text: {
|
|
65
|
-
type: 'string',
|
|
66
|
-
description: 'Text to type',
|
|
67
|
-
},
|
|
68
|
-
delay: {
|
|
69
|
-
type: 'number',
|
|
70
|
-
description: 'Delay between keystrokes (ms)',
|
|
71
|
-
default: 0,
|
|
72
|
-
},
|
|
73
|
-
clear: {
|
|
74
|
-
type: 'boolean',
|
|
75
|
-
description: 'Clear existing text before typing',
|
|
76
|
-
default: false,
|
|
77
|
-
},
|
|
78
|
-
},
|
|
79
|
-
};
|
|
79
|
+
return errors.length === 0 ? { isValid: true } : { isValid: false, errors };
|
|
80
80
|
}
|
|
81
81
|
}
|
|
82
82
|
//# sourceMappingURL=type.js.map
|
package/dist/tools/type.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"type.js","sourceRoot":"","sources":["../../src/tools/type.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAMH;;GAEG;AACH,MAAM,OAAO,QAAQ;
|
|
1
|
+
{"version":3,"file":"type.js","sourceRoot":"","sources":["../../src/tools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K,EAAE,MAAM,CAAC,OAAO,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC,CAAC,aAAa,EAAE,CAAC;QACxG,CAAC;QAAC,OAAO,KAAU,EAAE,CAAC;YACpB,OAAO,EAAE,OAAO,EAAE,KAAK,EAAE,KAAK,EAAE,KAAK,CAAC,OAAO,EAAE,CAAC;QAClD,CAAC;IACH,CAAC;IAED;;OAEG;IACH,YAAY,CAAC,KAA0B;QACrC,MAAM,MAAM,GAAa,EAAE,CAAC;QAE5B,IAAI,CAAC,KAAK,CAAC,QAAQ,EAAE,CAAC;YACpB,MAAM,CAAC,IAAI,CAAC,sBAAsB,CAAC,CAAC;QACtC,CAAC;aAAM,IAAI,OAAO,KAAK,CAAC,QAAQ,KAAK,QAAQ,EAAE,CAAC;YAC9C,MAAM,CAAC,IAAI,CAAC,2BAA2B,CAAC,CAAC;QAC3C,CAAC;QAED,IAAI,KAAK,CAAC,IAAI,KAAK,SAAS,IAAI,KAAK,CAAC,IAAI,KAAK,IAAI,EAAE,CAAC;YACpD,MAAM,CAAC,IAAI,CAAC,kBAAkB,CAAC,CAAC;QAClC,CAAC;aAAM,IAAI,OAAO,KAAK,CAAC,IAAI,KAAK,QAAQ,EAAE,CAAC;YAC1C,MAAM,CAAC,IAAI,CAAC,uBAAuB,CAAC,CAAC;QACvC,CAAC;QAED,OAAO,MAAM,CAAC,MAAM,KAAK,CAAC,CAAC,CAAC,CAAC,EAAE,OAAO,EAAE,IAAI,EAAE,CAAC,CAAC,CAAC,EAAE,OAAO,EAAE,KAAK,EAAE,MAAM,EAAE,CAAC;IAC9E,CAAC;CACF"}
|
package/manifest.json
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
"$schema": "https://agentos.sh/schemas/extension-manifest-v1.json",
|
|
3
3
|
"id": "com.framers.research.web-browser",
|
|
4
4
|
"name": "Web Browser Extension",
|
|
5
|
-
"version": "1.
|
|
5
|
+
"version": "1.1.0",
|
|
6
6
|
"description": "Browser automation capabilities for AgentOS - navigate pages, scrape content, click links, and capture screenshots",
|
|
7
7
|
"author": {
|
|
8
8
|
"name": "Frame.dev",
|
|
@@ -20,38 +20,45 @@
|
|
|
20
20
|
"extensions": [
|
|
21
21
|
{
|
|
22
22
|
"kind": "tool",
|
|
23
|
-
"id": "
|
|
23
|
+
"id": "browser_navigate",
|
|
24
24
|
"displayName": "Navigate to URL",
|
|
25
25
|
"description": "Navigate browser to a URL and get page content",
|
|
26
26
|
"entry": "./dist/tools/navigate.js"
|
|
27
27
|
},
|
|
28
28
|
{
|
|
29
29
|
"kind": "tool",
|
|
30
|
-
"id": "
|
|
30
|
+
"id": "browser_scrape",
|
|
31
31
|
"displayName": "Scrape Content",
|
|
32
32
|
"description": "Extract content from web page using CSS selectors",
|
|
33
33
|
"entry": "./dist/tools/scrape.js"
|
|
34
34
|
},
|
|
35
35
|
{
|
|
36
36
|
"kind": "tool",
|
|
37
|
-
"id": "
|
|
37
|
+
"id": "browser_click",
|
|
38
38
|
"displayName": "Click Element",
|
|
39
39
|
"description": "Click on an element in the current page",
|
|
40
40
|
"entry": "./dist/tools/click.js"
|
|
41
41
|
},
|
|
42
42
|
{
|
|
43
43
|
"kind": "tool",
|
|
44
|
-
"id": "
|
|
44
|
+
"id": "browser_screenshot",
|
|
45
45
|
"displayName": "Take Screenshot",
|
|
46
46
|
"description": "Capture screenshot of current page or element",
|
|
47
47
|
"entry": "./dist/tools/screenshot.js"
|
|
48
48
|
},
|
|
49
49
|
{
|
|
50
50
|
"kind": "tool",
|
|
51
|
-
"id": "
|
|
51
|
+
"id": "browser_type",
|
|
52
52
|
"displayName": "Type Text",
|
|
53
53
|
"description": "Type text into an input field",
|
|
54
54
|
"entry": "./dist/tools/type.js"
|
|
55
|
+
},
|
|
56
|
+
{
|
|
57
|
+
"kind": "tool",
|
|
58
|
+
"id": "browser_snapshot",
|
|
59
|
+
"displayName": "Page Snapshot",
|
|
60
|
+
"description": "Extract a structured snapshot of the current page DOM",
|
|
61
|
+
"entry": "./dist/tools/snapshot.js"
|
|
55
62
|
}
|
|
56
63
|
],
|
|
57
64
|
"configuration": {
|
|
@@ -90,4 +97,3 @@
|
|
|
90
97
|
}
|
|
91
98
|
|
|
92
99
|
|
|
93
|
-
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@framers/agentos-ext-web-browser",
|
|
3
|
-
"version": "1.1.
|
|
3
|
+
"version": "1.1.1",
|
|
4
4
|
"description": "Browser automation extension for AgentOS",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"types": "dist/index.d.ts",
|
|
@@ -56,8 +56,9 @@
|
|
|
56
56
|
"cheerio": "^1.0.0-rc.12"
|
|
57
57
|
},
|
|
58
58
|
"devDependencies": {
|
|
59
|
+
"@framers/agentos": "^0.1.0",
|
|
59
60
|
"@types/node": "^20.0.0",
|
|
60
61
|
"typescript": "^5.4.0",
|
|
61
62
|
"vitest": "^1.6.0"
|
|
62
63
|
}
|
|
63
|
-
}
|
|
64
|
+
}
|