@framers/agentos-ext-web-browser 1.1.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.
Files changed (39) hide show
  1. package/README.md +161 -0
  2. package/dist/index.d.ts +50 -0
  3. package/dist/index.d.ts.map +1 -0
  4. package/dist/index.js +128 -0
  5. package/dist/index.js.map +1 -0
  6. package/dist/services/browserService.d.ts +81 -0
  7. package/dist/services/browserService.d.ts.map +1 -0
  8. package/dist/services/browserService.js +381 -0
  9. package/dist/services/browserService.js.map +1 -0
  10. package/dist/tools/click.d.ts +42 -0
  11. package/dist/tools/click.d.ts.map +1 -0
  12. package/dist/tools/click.js +66 -0
  13. package/dist/tools/click.js.map +1 -0
  14. package/dist/tools/navigate.d.ts +44 -0
  15. package/dist/tools/navigate.d.ts.map +1 -0
  16. package/dist/tools/navigate.js +100 -0
  17. package/dist/tools/navigate.js.map +1 -0
  18. package/dist/tools/scrape.d.ts +43 -0
  19. package/dist/tools/scrape.d.ts.map +1 -0
  20. package/dist/tools/scrape.js +86 -0
  21. package/dist/tools/scrape.js.map +1 -0
  22. package/dist/tools/screenshot.d.ts +44 -0
  23. package/dist/tools/screenshot.d.ts.map +1 -0
  24. package/dist/tools/screenshot.js +83 -0
  25. package/dist/tools/screenshot.js.map +1 -0
  26. package/dist/tools/snapshot.d.ts +42 -0
  27. package/dist/tools/snapshot.d.ts.map +1 -0
  28. package/dist/tools/snapshot.js +57 -0
  29. package/dist/tools/snapshot.js.map +1 -0
  30. package/dist/tools/type.d.ts +44 -0
  31. package/dist/tools/type.d.ts.map +1 -0
  32. package/dist/tools/type.js +82 -0
  33. package/dist/tools/type.js.map +1 -0
  34. package/dist/types.d.ts +168 -0
  35. package/dist/types.d.ts.map +1 -0
  36. package/dist/types.js +6 -0
  37. package/dist/types.js.map +1 -0
  38. package/manifest.json +93 -0
  39. package/package.json +63 -0
@@ -0,0 +1,168 @@
1
+ /**
2
+ * Web Browser Extension Types
3
+ * @module @framers/agentos-ext-web-browser
4
+ */
5
+ /**
6
+ * Browser configuration options
7
+ */
8
+ export interface BrowserConfig {
9
+ /** Run browser in headless mode */
10
+ headless?: boolean;
11
+ /** Default timeout for operations (ms) */
12
+ timeout?: number;
13
+ /** Custom user agent string */
14
+ userAgent?: string;
15
+ /** Viewport dimensions */
16
+ viewport?: {
17
+ width: number;
18
+ height: number;
19
+ };
20
+ /** Executable path for browser (for puppeteer-core) */
21
+ executablePath?: string;
22
+ }
23
+ /**
24
+ * Result of a navigation operation
25
+ */
26
+ export interface NavigationResult {
27
+ /** Final URL after any redirects */
28
+ url: string;
29
+ /** HTTP status code */
30
+ status: number;
31
+ /** Page title */
32
+ title: string;
33
+ /** Full HTML content */
34
+ html?: string;
35
+ /** Extracted text content */
36
+ text?: string;
37
+ /** Time taken to load (ms) */
38
+ loadTime: number;
39
+ /** Any console messages */
40
+ consoleMessages?: string[];
41
+ }
42
+ /**
43
+ * Result of a scrape operation
44
+ */
45
+ export interface ScrapeResult {
46
+ /** Selector used */
47
+ selector: string;
48
+ /** Number of elements found */
49
+ count: number;
50
+ /** Extracted content */
51
+ elements: ScrapeElement[];
52
+ }
53
+ /**
54
+ * A single scraped element
55
+ */
56
+ export interface ScrapeElement {
57
+ /** Element tag name */
58
+ tag: string;
59
+ /** Element text content */
60
+ text: string;
61
+ /** Element HTML content */
62
+ html: string;
63
+ /** Element attributes */
64
+ attributes: Record<string, string>;
65
+ /** Href if it's a link */
66
+ href?: string;
67
+ /** Src if it's an image/media */
68
+ src?: string;
69
+ }
70
+ /**
71
+ * Result of a click operation
72
+ */
73
+ export interface ClickResult {
74
+ /** Whether click was successful */
75
+ success: boolean;
76
+ /** Element that was clicked (selector) */
77
+ element: string;
78
+ /** New URL if navigation occurred */
79
+ newUrl?: string;
80
+ /** Any text content change detected */
81
+ contentChanged?: boolean;
82
+ }
83
+ /**
84
+ * Result of a type operation
85
+ */
86
+ export interface TypeResult {
87
+ /** Whether typing was successful */
88
+ success: boolean;
89
+ /** Element that received input */
90
+ element: string;
91
+ /** Text that was typed */
92
+ text: string;
93
+ }
94
+ /**
95
+ * Screenshot capture options
96
+ */
97
+ export interface ScreenshotOptions {
98
+ /** Capture full scrollable page */
99
+ fullPage?: boolean;
100
+ /** CSS selector for specific element */
101
+ selector?: string;
102
+ /** Image format */
103
+ format?: 'png' | 'jpeg' | 'webp';
104
+ /** Quality for jpeg/webp (0-100) */
105
+ quality?: number;
106
+ }
107
+ /**
108
+ * Result of a screenshot operation
109
+ */
110
+ export interface ScreenshotResult {
111
+ /** Base64-encoded image data */
112
+ data: string;
113
+ /** Image format */
114
+ format: 'png' | 'jpeg' | 'webp';
115
+ /** Width in pixels */
116
+ width: number;
117
+ /** Height in pixels */
118
+ height: number;
119
+ /** File size in bytes */
120
+ size: number;
121
+ }
122
+ /**
123
+ * Page snapshot for accessibility tree
124
+ */
125
+ export interface PageSnapshot {
126
+ /** Current URL */
127
+ url: string;
128
+ /** Page title */
129
+ title: string;
130
+ /** Simplified DOM structure */
131
+ elements: SnapshotElement[];
132
+ /** Links on the page */
133
+ links: {
134
+ text: string;
135
+ href: string;
136
+ ref: string;
137
+ }[];
138
+ /** Forms on the page */
139
+ forms: {
140
+ id?: string;
141
+ action?: string;
142
+ fields: string[];
143
+ }[];
144
+ /** Interactive elements */
145
+ interactable: {
146
+ ref: string;
147
+ type: string;
148
+ label: string;
149
+ }[];
150
+ }
151
+ /**
152
+ * Element in page snapshot
153
+ */
154
+ export interface SnapshotElement {
155
+ /** Reference ID for interaction */
156
+ ref: string;
157
+ /** Element type */
158
+ type: string;
159
+ /** Accessible name/label */
160
+ label: string;
161
+ /** Role (button, link, input, etc.) */
162
+ role?: string;
163
+ /** Value for inputs */
164
+ value?: string;
165
+ /** Whether element is visible */
166
+ visible: boolean;
167
+ }
168
+ //# sourceMappingURL=types.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":"AAAA;;;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,IAAI,EAAE,MAAM,CAAC;QAAC,IAAI,EAAE,MAAM,CAAC;QAAC,GAAG,EAAE,MAAM,CAAA;KAAE,EAAE,CAAC;IACrD,wBAAwB;IACxB,KAAK,EAAE;QAAE,EAAE,CAAC,EAAE,MAAM,CAAC;QAAC,MAAM,CAAC,EAAE,MAAM,CAAC;QAAC,MAAM,EAAE,MAAM,EAAE,CAAA;KAAE,EAAE,CAAC;IAC5D,2BAA2B;IAC3B,YAAY,EAAE;QAAE,GAAG,EAAE,MAAM,CAAC;QAAC,IAAI,EAAE,MAAM,CAAC;QAAC,KAAK,EAAE,MAAM,CAAA;KAAE,EAAE,CAAC;CAC9D;AAED;;GAEG;AACH,MAAM,WAAW,eAAe;IAC9B,mCAAmC;IACnC,GAAG,EAAE,MAAM,CAAC;IACZ,mBAAmB;IACnB,IAAI,EAAE,MAAM,CAAC;IACb,4BAA4B;IAC5B,KAAK,EAAE,MAAM,CAAC;IACd,uCAAuC;IACvC,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,uBAAuB;IACvB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,iCAAiC;IACjC,OAAO,EAAE,OAAO,CAAC;CAClB"}
package/dist/types.js ADDED
@@ -0,0 +1,6 @@
1
+ /**
2
+ * Web Browser Extension Types
3
+ * @module @framers/agentos-ext-web-browser
4
+ */
5
+ export {};
6
+ //# sourceMappingURL=types.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"types.js","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":"AAAA;;;GAGG"}
package/manifest.json ADDED
@@ -0,0 +1,93 @@
1
+ {
2
+ "$schema": "https://agentos.sh/schemas/extension-manifest-v1.json",
3
+ "id": "com.framers.research.web-browser",
4
+ "name": "Web Browser Extension",
5
+ "version": "1.0.0",
6
+ "description": "Browser automation capabilities for AgentOS - navigate pages, scrape content, click links, and capture screenshots",
7
+ "author": {
8
+ "name": "Frame.dev",
9
+ "email": "support@frame.dev",
10
+ "url": "https://github.com/framersai"
11
+ },
12
+ "license": "MIT",
13
+ "keywords": ["browser", "scraping", "automation", "puppeteer", "playwright", "web", "navigate"],
14
+ "agentosVersion": "^2.0.0",
15
+ "categories": ["productivity", "research", "automation"],
16
+ "repository": {
17
+ "type": "git",
18
+ "url": "https://github.com/framersai/agentos-extensions"
19
+ },
20
+ "extensions": [
21
+ {
22
+ "kind": "tool",
23
+ "id": "browserNavigate",
24
+ "displayName": "Navigate to URL",
25
+ "description": "Navigate browser to a URL and get page content",
26
+ "entry": "./dist/tools/navigate.js"
27
+ },
28
+ {
29
+ "kind": "tool",
30
+ "id": "browserScrape",
31
+ "displayName": "Scrape Content",
32
+ "description": "Extract content from web page using CSS selectors",
33
+ "entry": "./dist/tools/scrape.js"
34
+ },
35
+ {
36
+ "kind": "tool",
37
+ "id": "browserClick",
38
+ "displayName": "Click Element",
39
+ "description": "Click on an element in the current page",
40
+ "entry": "./dist/tools/click.js"
41
+ },
42
+ {
43
+ "kind": "tool",
44
+ "id": "browserScreenshot",
45
+ "displayName": "Take Screenshot",
46
+ "description": "Capture screenshot of current page or element",
47
+ "entry": "./dist/tools/screenshot.js"
48
+ },
49
+ {
50
+ "kind": "tool",
51
+ "id": "browserType",
52
+ "displayName": "Type Text",
53
+ "description": "Type text into an input field",
54
+ "entry": "./dist/tools/type.js"
55
+ }
56
+ ],
57
+ "configuration": {
58
+ "properties": {
59
+ "browser.headless": {
60
+ "type": "boolean",
61
+ "default": true,
62
+ "description": "Run browser in headless mode"
63
+ },
64
+ "browser.timeout": {
65
+ "type": "number",
66
+ "default": 30000,
67
+ "minimum": 5000,
68
+ "maximum": 120000,
69
+ "description": "Default timeout for browser operations (ms)"
70
+ },
71
+ "browser.userAgent": {
72
+ "type": "string",
73
+ "description": "Custom user agent string"
74
+ },
75
+ "browser.viewport.width": {
76
+ "type": "number",
77
+ "default": 1920,
78
+ "description": "Browser viewport width"
79
+ },
80
+ "browser.viewport.height": {
81
+ "type": "number",
82
+ "default": 1080,
83
+ "description": "Browser viewport height"
84
+ }
85
+ }
86
+ },
87
+ "dependencies": {
88
+ "puppeteer-core": "^22.0.0"
89
+ }
90
+ }
91
+
92
+
93
+
package/package.json ADDED
@@ -0,0 +1,63 @@
1
+ {
2
+ "name": "@framers/agentos-ext-web-browser",
3
+ "version": "1.1.0",
4
+ "description": "Browser automation extension for AgentOS",
5
+ "main": "dist/index.js",
6
+ "types": "dist/index.d.ts",
7
+ "type": "module",
8
+ "exports": {
9
+ ".": {
10
+ "types": "./dist/index.d.ts",
11
+ "import": "./dist/index.js"
12
+ }
13
+ },
14
+ "files": [
15
+ "dist",
16
+ "manifest.json",
17
+ "README.md"
18
+ ],
19
+ "scripts": {
20
+ "build": "tsc",
21
+ "test": "vitest run",
22
+ "test:watch": "vitest",
23
+ "clean": "rm -rf dist"
24
+ },
25
+ "keywords": [
26
+ "agentos",
27
+ "extension",
28
+ "browser",
29
+ "automation",
30
+ "scraping",
31
+ "puppeteer"
32
+ ],
33
+ "author": {
34
+ "name": "Framers AI",
35
+ "email": "team@frame.dev",
36
+ "url": "https://frame.dev"
37
+ },
38
+ "contributors": [
39
+ {
40
+ "name": "Johnny Dunn",
41
+ "email": "johnnyfived@protonmail.com",
42
+ "url": "https://github.com/jddunn"
43
+ }
44
+ ],
45
+ "license": "MIT",
46
+ "repository": {
47
+ "type": "git",
48
+ "url": "https://github.com/framersai/agentos-extensions",
49
+ "directory": "registry/curated/research/web-browser"
50
+ },
51
+ "peerDependencies": {
52
+ "@framers/agentos": "^0.1.0"
53
+ },
54
+ "dependencies": {
55
+ "puppeteer-core": "^22.0.0",
56
+ "cheerio": "^1.0.0-rc.12"
57
+ },
58
+ "devDependencies": {
59
+ "@types/node": "^20.0.0",
60
+ "typescript": "^5.4.0",
61
+ "vitest": "^1.6.0"
62
+ }
63
+ }