b4n1-web 0.6.2 → 0.7.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.
- package/README.md +107 -69
- package/bin/b4n1web-linux +0 -0
- package/dist/browser.d.ts +11 -54
- package/dist/browser.d.ts.map +1 -1
- package/dist/browser.js +99 -62
- package/dist/browser.js.map +1 -1
- package/dist/errors.d.ts +3 -12
- package/dist/errors.d.ts.map +1 -1
- package/dist/errors.js +9 -13
- package/dist/errors.js.map +1 -1
- package/dist/index.d.ts +2 -8
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +5 -7
- package/dist/index.js.map +1 -1
- package/dist/types.d.ts +1 -3
- package/dist/types.d.ts.map +1 -1
- package/dist/types.js +0 -3
- package/dist/types.js.map +1 -1
- package/package.json +3 -4
package/README.md
CHANGED
|
@@ -1,108 +1,146 @@
|
|
|
1
1
|
# B4n1Web JavaScript/TypeScript SDK
|
|
2
2
|
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
3
|
+
<p align="center">
|
|
4
|
+
<a href="https://www.npmjs.com/package/b4n1-web"><img src="https://img.shields.io/npm/v/b4n1-web.svg" alt="NPM version"></a>
|
|
5
|
+
<a href="https://www.npmjs.com/package/b4n1-web"><img src="https://img.shields.io/npm/dt/b4n1-web.svg" alt="NPM downloads"></a>
|
|
6
|
+
<a href="https://github.com/B4N1-com/b4n1-web"><img src="https://img.shields.io/github/stars/B4N1-com/b4n1-web?style=flat" alt="GitHub stars"></a>
|
|
7
|
+
</p>
|
|
6
8
|
|
|
7
|
-
|
|
9
|
+
TypeScript/JavaScript bindings for B4n1Web: The Agentic Browser Engine.
|
|
8
10
|
|
|
9
|
-
##
|
|
11
|
+
## Installation
|
|
12
|
+
|
|
13
|
+
### 1. Install the B4n1Web Binary
|
|
14
|
+
|
|
15
|
+
```bash
|
|
16
|
+
curl -sL https://github.com/B4N1-com/b4n1-web/releases/latest/download/b4n1web-v0.6.2-flat.tar.gz | tar -xz && ./b4n1web --version
|
|
17
|
+
```
|
|
18
|
+
|
|
19
|
+
### 2. Install the JavaScript SDK
|
|
10
20
|
|
|
11
21
|
```bash
|
|
12
22
|
npm install b4n1-web
|
|
13
23
|
```
|
|
14
24
|
|
|
15
|
-
|
|
25
|
+
Or with yarn:
|
|
26
|
+
|
|
27
|
+
```bash
|
|
28
|
+
yarn add b4n1-web
|
|
29
|
+
```
|
|
30
|
+
|
|
31
|
+
Or with pnpm:
|
|
32
|
+
|
|
33
|
+
```bash
|
|
34
|
+
pnpm add b4n1-web
|
|
35
|
+
```
|
|
16
36
|
|
|
17
37
|
## Quick Start
|
|
18
38
|
|
|
19
39
|
```typescript
|
|
20
|
-
import { AgentBrowser, BrowserMode } from 'b4n1-web';
|
|
40
|
+
import { AgentBrowser, BrowserMode, Page } from 'b4n1-web';
|
|
21
41
|
|
|
42
|
+
// Create a browser instance
|
|
22
43
|
const browser = new AgentBrowser({ mode: BrowserMode.LIGHT });
|
|
44
|
+
|
|
45
|
+
// Navigate to a page
|
|
23
46
|
const page = await browser.goto('https://example.com');
|
|
24
|
-
console.log(page.markdown);
|
|
25
|
-
console.log(`${page.links.length} links found`);
|
|
26
|
-
browser.close();
|
|
27
|
-
```
|
|
28
47
|
|
|
29
|
-
|
|
48
|
+
// Access structured data
|
|
49
|
+
console.log('Page content:', page.markdown);
|
|
50
|
+
console.log('Found', page.links.length, 'links');
|
|
30
51
|
|
|
31
|
-
|
|
32
|
-
page.
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
52
|
+
// Extract main content
|
|
53
|
+
const mainContent = page.getMainContent();
|
|
54
|
+
console.log('Main content:', mainContent.substring(0, 200) + '...');
|
|
55
|
+
|
|
56
|
+
// Find specific links
|
|
57
|
+
const githubLinks = page.findLinksByText('github');
|
|
58
|
+
console.log('GitHub links:', githubLinks);
|
|
36
59
|
|
|
37
|
-
|
|
38
|
-
|
|
60
|
+
// Close browser when done
|
|
61
|
+
browser.close();
|
|
39
62
|
```
|
|
40
63
|
|
|
41
64
|
## Browser Modes
|
|
42
65
|
|
|
43
|
-
|
|
44
|
-
|------|-------------|
|
|
45
|
-
| `BrowserMode.LIGHT` | HTTP + HTML parsing |
|
|
46
|
-
| `BrowserMode.JS` | Light + script extraction |
|
|
47
|
-
| `BrowserMode.RENDER` | Full Chromium + screenshots |
|
|
66
|
+
### Light Mode (Default)
|
|
48
67
|
|
|
49
|
-
|
|
68
|
+
- **Use case**: Reading articles, scraping static content, extracting links
|
|
69
|
+
- **Performance**: < 15MB RAM, instant startup
|
|
70
|
+
- **Capabilities**: HTML parsing, markdown conversion, link extraction
|
|
71
|
+
- **Limitations**: No JavaScript execution
|
|
50
72
|
|
|
51
73
|
```typescript
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
const shield = new SecurityShield();
|
|
55
|
-
shield.markDomain('evil.com', false);
|
|
56
|
-
const { isSafe, needsApiCheck } = shield.isUrlSafe('https://evil.com');
|
|
74
|
+
const browser = new AgentBrowser({ mode: BrowserMode.LIGHT });
|
|
57
75
|
```
|
|
58
76
|
|
|
59
|
-
|
|
77
|
+
### JS Mode
|
|
78
|
+
|
|
79
|
+
- **Use case**: Extracting JavaScript from pages, SPA analysis
|
|
80
|
+
- **Performance**: Same as Light, instant startup
|
|
81
|
+
- **Capabilities**: HTML parsing + JavaScript tag extraction
|
|
60
82
|
|
|
61
83
|
```typescript
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
try {
|
|
65
|
-
const browser = new AgentBrowser();
|
|
66
|
-
} catch (e) {
|
|
67
|
-
if (e instanceof BinaryNotFoundError) {
|
|
68
|
-
console.error('Install binary: curl -sL https://web.b4n1.com/install | bash');
|
|
69
|
-
}
|
|
70
|
-
}
|
|
84
|
+
const browser = new AgentBrowser({ mode: BrowserMode.JS });
|
|
71
85
|
```
|
|
72
86
|
|
|
73
|
-
|
|
87
|
+
### Render Mode (Coming Soon)
|
|
88
|
+
|
|
89
|
+
- **Use case**: SPAs, form filling, visual verification, E2E testing
|
|
90
|
+
- **Status**: Coming in v0.3.0
|
|
91
|
+
|
|
92
|
+
## API Reference
|
|
93
|
+
|
|
94
|
+
### AgentBrowser
|
|
95
|
+
|
|
96
|
+
Main browser class for web automation.
|
|
97
|
+
|
|
98
|
+
#### Constructor Options
|
|
99
|
+
|
|
100
|
+
- `mode`: BrowserMode.LIGHT, BrowserMode.JS, or BrowserMode.RENDER
|
|
101
|
+
- `timeout`: Request timeout in seconds (default: 30)
|
|
102
|
+
- `userAgent`: Custom user agent string
|
|
103
|
+
|
|
104
|
+
#### Methods
|
|
105
|
+
|
|
106
|
+
- `goto(url: string)`: Navigate to URL and return structured page data
|
|
107
|
+
- `close()`: Close the browser session
|
|
108
|
+
|
|
109
|
+
### Page
|
|
110
|
+
|
|
111
|
+
Structured data from a web page.
|
|
112
|
+
|
|
113
|
+
#### Properties
|
|
114
|
+
|
|
115
|
+
- `url: string`: The page URL
|
|
116
|
+
- `markdown: string`: Clean markdown content
|
|
117
|
+
- `links: string[]`: Extracted links
|
|
118
|
+
- `screenshot?: string`: Base64-encoded screenshot (render mode only)
|
|
119
|
+
|
|
120
|
+
#### Methods
|
|
121
|
+
|
|
122
|
+
- `getMainContent()`: Extract main content, skipping headers/footers
|
|
123
|
+
- `findLinksByText(text: string)`: Find links containing specific text
|
|
124
|
+
|
|
125
|
+
## SecurityShield
|
|
126
|
+
|
|
127
|
+
Optional security validation with caching:
|
|
74
128
|
|
|
75
129
|
```typescript
|
|
76
|
-
import {
|
|
77
|
-
|
|
78
|
-
async function main() {
|
|
79
|
-
const browser = new AgentBrowser();
|
|
80
|
-
try {
|
|
81
|
-
const page = await browser.goto('https://example.com');
|
|
82
|
-
console.log(page.markdown);
|
|
83
|
-
} finally {
|
|
84
|
-
browser.close();
|
|
85
|
-
}
|
|
86
|
-
}
|
|
87
|
-
|
|
88
|
-
// Or with async dispose:
|
|
89
|
-
const browser = new AgentBrowser();
|
|
90
|
-
try {
|
|
91
|
-
await browser.goto('https://example.com');
|
|
92
|
-
} finally {
|
|
93
|
-
await browser[Symbol.asyncDispose]();
|
|
94
|
-
}
|
|
95
|
-
```
|
|
130
|
+
import { SecurityShield, navigate } from 'b4n1-web';
|
|
96
131
|
|
|
97
|
-
|
|
132
|
+
// With security check
|
|
133
|
+
const result = await navigate('https://example.com');
|
|
134
|
+
|
|
135
|
+
// With custom shield
|
|
136
|
+
const shield = new SecurityShield({ cacheDays: 30 });
|
|
137
|
+
const { isSafe, needsApiCheck } = shield.isUrlSafe('https://example.com');
|
|
138
|
+
```
|
|
98
139
|
|
|
99
|
-
|
|
140
|
+
## TypeScript
|
|
100
141
|
|
|
101
|
-
|
|
142
|
+
This package includes TypeScript type definitions. No additional installation needed.
|
|
102
143
|
|
|
103
|
-
|
|
104
|
-
- [GitHub](https://github.com/B4N1-com/b4n1-web)
|
|
105
|
-
- [Website](https://web.b4n1.com)
|
|
144
|
+
## License
|
|
106
145
|
|
|
107
|
-
|
|
108
|
-
*Built by B4N1 with ❤️ · All rights reserved.*
|
|
146
|
+
MIT
|
package/bin/b4n1web-linux
CHANGED
|
Binary file
|
package/dist/browser.d.ts
CHANGED
|
@@ -1,78 +1,35 @@
|
|
|
1
|
-
|
|
2
|
-
* B4n1Web Browser - JavaScript/TypeScript Implementation
|
|
3
|
-
*/
|
|
4
|
-
import { type BrowserOptions, type PageData } from './types';
|
|
5
|
-
/**
|
|
6
|
-
* Find the b4n1web binary in bundled location or system install
|
|
7
|
-
*/
|
|
1
|
+
import { BrowserMode, type BrowserOptions, type PageData } from './types';
|
|
8
2
|
export declare function getB4n1webBinary(): string | null;
|
|
9
|
-
/**
|
|
10
|
-
* Get B4n1Web binary version
|
|
11
|
-
*/
|
|
12
3
|
export declare function getB4n1webVersion(): string | null;
|
|
13
|
-
/**
|
|
14
|
-
* Check version compatibility and warn if mismatch
|
|
15
|
-
*/
|
|
16
4
|
export declare function checkVersionCompatibility(): string | null;
|
|
17
|
-
/**
|
|
18
|
-
* Page data returned by B4n1Web
|
|
19
|
-
*/
|
|
20
5
|
export declare class Page implements PageData {
|
|
21
6
|
url: string;
|
|
22
7
|
markdown: string;
|
|
23
8
|
links: string[];
|
|
24
9
|
screenshot?: string;
|
|
10
|
+
jsOutput?: string;
|
|
25
11
|
constructor(data: PageData);
|
|
26
|
-
/**
|
|
27
|
-
* Extract main content from markdown, skipping headers
|
|
28
|
-
*/
|
|
29
12
|
getMainContent(): string;
|
|
30
|
-
/**
|
|
31
|
-
* Find links containing specific text
|
|
32
|
-
*/
|
|
33
13
|
findLinksByText(text: string): string[];
|
|
34
14
|
}
|
|
35
|
-
/**
|
|
36
|
-
* B4n1Web Agent Browser
|
|
37
|
-
*
|
|
38
|
-
* A browser instance optimized for AI agent workflows.
|
|
39
|
-
* Requires B4n1Web binary to be installed.
|
|
40
|
-
*
|
|
41
|
-
* @example
|
|
42
|
-
* ```typescript
|
|
43
|
-
* import { AgentBrowser, BrowserMode } from 'b4n1-web';
|
|
44
|
-
*
|
|
45
|
-
* const browser = new AgentBrowser({ mode: BrowserMode.LIGHT });
|
|
46
|
-
* const page = await browser.goto('https://example.com');
|
|
47
|
-
* console.log(page.markdown);
|
|
48
|
-
* browser.close();
|
|
49
|
-
* ```
|
|
50
|
-
*/
|
|
51
15
|
export declare class AgentBrowser {
|
|
52
16
|
private mode;
|
|
53
17
|
private timeout;
|
|
54
18
|
private userAgent;
|
|
55
19
|
private binaryPath;
|
|
20
|
+
private currentUrl;
|
|
56
21
|
constructor(options?: BrowserOptions);
|
|
57
|
-
|
|
58
|
-
* Navigate to a URL and extract structured content
|
|
59
|
-
*/
|
|
60
|
-
goto(url: string): Promise<Page>;
|
|
61
|
-
/**
|
|
62
|
-
* Parse text output from the binary
|
|
63
|
-
*/
|
|
22
|
+
goto(url: string, waitFor?: string): Promise<Page>;
|
|
64
23
|
private parseOutput;
|
|
65
|
-
/**
|
|
66
|
-
* Close the browser session
|
|
67
|
-
*/
|
|
68
24
|
close(): void;
|
|
69
|
-
/**
|
|
70
|
-
* Use as async context manager
|
|
71
|
-
*/
|
|
72
25
|
[Symbol.asyncDispose](): Promise<void>;
|
|
26
|
+
screenshot(width?: number, height?: number): string;
|
|
27
|
+
waitForSelector(selector: string, timeoutMs?: number): Promise<boolean>;
|
|
28
|
+
click(selector: string): Promise<void>;
|
|
29
|
+
typeText(selector: string, text: string, clearFirst?: boolean): Promise<void>;
|
|
30
|
+
getLinks(): string[];
|
|
31
|
+
static getLinksFromPage(url: string, mode?: BrowserMode): Promise<string[]>;
|
|
32
|
+
static findBinary(): string | null;
|
|
73
33
|
}
|
|
74
|
-
/**
|
|
75
|
-
* Create a browser and navigate in one go
|
|
76
|
-
*/
|
|
77
34
|
export declare function createBrowserAndGoto(url: string, options?: BrowserOptions): Promise<Page>;
|
|
78
35
|
//# sourceMappingURL=browser.d.ts.map
|
package/dist/browser.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"browser.d.ts","sourceRoot":"","sources":["../src/browser.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"browser.d.ts","sourceRoot":"","sources":["../src/browser.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,WAAW,EAAE,KAAK,cAAc,EAAE,KAAK,QAAQ,EAAuB,MAAM,SAAS,CAAC;AAE/F,wBAAgB,gBAAgB,IAAI,MAAM,GAAG,IAAI,CAsChD;AAED,wBAAgB,iBAAiB,IAAI,MAAM,GAAG,IAAI,CAejD;AAID,wBAAgB,yBAAyB,IAAI,MAAM,GAAG,IAAI,CAczD;AAED,qBAAa,IAAK,YAAW,QAAQ;IACnC,GAAG,EAAE,MAAM,CAAC;IACZ,QAAQ,EAAE,MAAM,CAAC;IACjB,KAAK,EAAE,MAAM,EAAE,CAAC;IAChB,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,QAAQ,CAAC,EAAE,MAAM,CAAC;gBAEN,IAAI,EAAE,QAAQ;IAQ1B,cAAc,IAAI,MAAM;IAMxB,eAAe,CAAC,IAAI,EAAE,MAAM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.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
6
3
|
if (k2 === undefined) k2 = k;
|
|
7
4
|
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
@@ -45,13 +42,9 @@ const child_process_1 = require("child_process");
|
|
|
45
42
|
const fs = __importStar(require("fs"));
|
|
46
43
|
const path = __importStar(require("path"));
|
|
47
44
|
const types_1 = require("./types");
|
|
48
|
-
/**
|
|
49
|
-
* Find the b4n1web binary in bundled location or system install
|
|
50
|
-
*/
|
|
51
45
|
function getB4n1webBinary() {
|
|
52
46
|
const home = process.env.HOME || process.env.USERPROFILE || '/home/' + process.env.USER;
|
|
53
47
|
const paths = [];
|
|
54
|
-
// 1. Check bundled binary (bundled with npm package)
|
|
55
48
|
const bundledBinary = path.join(__dirname, '..', 'bin', 'b4n1web-linux');
|
|
56
49
|
if (fs.existsSync(bundledBinary)) {
|
|
57
50
|
try {
|
|
@@ -59,12 +52,9 @@ function getB4n1webBinary() {
|
|
|
59
52
|
return bundledBinary;
|
|
60
53
|
}
|
|
61
54
|
catch {
|
|
62
|
-
// Not executable, continue searching
|
|
63
55
|
}
|
|
64
56
|
}
|
|
65
|
-
// 2. Check system install locations
|
|
66
57
|
paths.push('/usr/local/bin/b4n1web', '/usr/bin/b4n1web', home + '/.local/bin/b4n1web', home + '/.b4n1web/bin/b4n1web');
|
|
67
|
-
// 3. Also check PATH
|
|
68
58
|
const pathEnv = process.env.PATH || '';
|
|
69
59
|
const pathDirs = pathEnv.split(':').filter(p => p);
|
|
70
60
|
for (const dir of pathDirs) {
|
|
@@ -80,14 +70,10 @@ function getB4n1webBinary() {
|
|
|
80
70
|
}
|
|
81
71
|
}
|
|
82
72
|
catch {
|
|
83
|
-
// Path doesn't exist or not executable
|
|
84
73
|
}
|
|
85
74
|
}
|
|
86
75
|
return null;
|
|
87
76
|
}
|
|
88
|
-
/**
|
|
89
|
-
* Get B4n1Web binary version
|
|
90
|
-
*/
|
|
91
77
|
function getB4n1webVersion() {
|
|
92
78
|
const binaryPath = getB4n1webBinary();
|
|
93
79
|
if (!binaryPath) {
|
|
@@ -106,66 +92,40 @@ function getB4n1webVersion() {
|
|
|
106
92
|
}
|
|
107
93
|
}
|
|
108
94
|
const SDK_VERSION = '0.5.0';
|
|
109
|
-
/**
|
|
110
|
-
* Check version compatibility and warn if mismatch
|
|
111
|
-
*/
|
|
112
95
|
function checkVersionCompatibility() {
|
|
113
96
|
const binaryVersion = getB4n1webVersion();
|
|
114
97
|
if (!binaryVersion) {
|
|
115
98
|
return null;
|
|
116
99
|
}
|
|
117
100
|
if (binaryVersion !== SDK_VERSION) {
|
|
118
|
-
console.warn(
|
|
101
|
+
console.warn(`Warning: Version mismatch: SDK v${SDK_VERSION} requires binary v${SDK_VERSION}, ` +
|
|
119
102
|
`but found v${binaryVersion}. Some features may not work correctly. ` +
|
|
120
103
|
`To update: curl -sL https://web.b4n1.com/install | bash`);
|
|
121
104
|
}
|
|
122
105
|
return binaryVersion;
|
|
123
106
|
}
|
|
124
|
-
/**
|
|
125
|
-
* Page data returned by B4n1Web
|
|
126
|
-
*/
|
|
127
107
|
class Page {
|
|
128
108
|
constructor(data) {
|
|
129
109
|
this.url = data.url;
|
|
130
110
|
this.markdown = data.markdown;
|
|
131
111
|
this.links = data.links;
|
|
132
112
|
this.screenshot = data.screenshot;
|
|
113
|
+
this.jsOutput = data.jsOutput;
|
|
133
114
|
}
|
|
134
|
-
/**
|
|
135
|
-
* Extract main content from markdown, skipping headers
|
|
136
|
-
*/
|
|
137
115
|
getMainContent() {
|
|
138
116
|
const lines = this.markdown.split('\n');
|
|
139
117
|
const contentLines = lines.length > 2 ? lines.slice(2) : lines;
|
|
140
118
|
return contentLines.join('\n').trim();
|
|
141
119
|
}
|
|
142
|
-
/**
|
|
143
|
-
* Find links containing specific text
|
|
144
|
-
*/
|
|
145
120
|
findLinksByText(text) {
|
|
146
121
|
const lowerText = text.toLowerCase();
|
|
147
122
|
return this.links.filter(link => link.toLowerCase().includes(lowerText));
|
|
148
123
|
}
|
|
149
124
|
}
|
|
150
125
|
exports.Page = Page;
|
|
151
|
-
/**
|
|
152
|
-
* B4n1Web Agent Browser
|
|
153
|
-
*
|
|
154
|
-
* A browser instance optimized for AI agent workflows.
|
|
155
|
-
* Requires B4n1Web binary to be installed.
|
|
156
|
-
*
|
|
157
|
-
* @example
|
|
158
|
-
* ```typescript
|
|
159
|
-
* import { AgentBrowser, BrowserMode } from 'b4n1-web';
|
|
160
|
-
*
|
|
161
|
-
* const browser = new AgentBrowser({ mode: BrowserMode.LIGHT });
|
|
162
|
-
* const page = await browser.goto('https://example.com');
|
|
163
|
-
* console.log(page.markdown);
|
|
164
|
-
* browser.close();
|
|
165
|
-
* ```
|
|
166
|
-
*/
|
|
167
126
|
class AgentBrowser {
|
|
168
127
|
constructor(options = {}) {
|
|
128
|
+
this.currentUrl = null;
|
|
169
129
|
this.mode = options.mode ?? types_1.BrowserMode.LIGHT;
|
|
170
130
|
this.timeout = options.timeout ?? 30;
|
|
171
131
|
this.userAgent = options.userAgent ?? 'B4n1Web-Agent/1.0';
|
|
@@ -183,13 +143,15 @@ class AgentBrowser {
|
|
|
183
143
|
}
|
|
184
144
|
this.binaryPath = binary;
|
|
185
145
|
}
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
*/
|
|
189
|
-
async goto(url) {
|
|
146
|
+
async goto(url, waitFor) {
|
|
147
|
+
this.currentUrl = url;
|
|
190
148
|
return new Promise((resolve, reject) => {
|
|
191
149
|
try {
|
|
192
|
-
|
|
150
|
+
let cmd = `${this.binaryPath} goto ${url} --mode ${this.mode}`;
|
|
151
|
+
if (waitFor) {
|
|
152
|
+
cmd += ` --wait-for ${JSON.stringify(waitFor)}`;
|
|
153
|
+
}
|
|
154
|
+
const output = (0, child_process_1.execSync)(cmd, { timeout: this.timeout * 1000 }).toString();
|
|
193
155
|
const page = this.parseOutput(url, output);
|
|
194
156
|
resolve(page);
|
|
195
157
|
}
|
|
@@ -203,13 +165,11 @@ class AgentBrowser {
|
|
|
203
165
|
}
|
|
204
166
|
});
|
|
205
167
|
}
|
|
206
|
-
/**
|
|
207
|
-
* Parse text output from the binary
|
|
208
|
-
*/
|
|
209
168
|
parseOutput(url, output) {
|
|
210
169
|
let markdown = '';
|
|
211
170
|
let links = [];
|
|
212
171
|
let screenshot;
|
|
172
|
+
let jsOutput;
|
|
213
173
|
for (const line of output.split('\n')) {
|
|
214
174
|
if (line.startsWith('URL:')) {
|
|
215
175
|
continue;
|
|
@@ -219,7 +179,7 @@ class AgentBrowser {
|
|
|
219
179
|
}
|
|
220
180
|
else if (line.startsWith('Links:')) {
|
|
221
181
|
try {
|
|
222
|
-
links =
|
|
182
|
+
links = JSON.parse(line.slice(6).trim());
|
|
223
183
|
}
|
|
224
184
|
catch {
|
|
225
185
|
links = [];
|
|
@@ -228,6 +188,9 @@ class AgentBrowser {
|
|
|
228
188
|
else if (line.startsWith('Screenshot:')) {
|
|
229
189
|
screenshot = line.slice(10).trim() || undefined;
|
|
230
190
|
}
|
|
191
|
+
else if (line.startsWith('js_output:')) {
|
|
192
|
+
jsOutput = line.slice(10).trim() || undefined;
|
|
193
|
+
}
|
|
231
194
|
else {
|
|
232
195
|
markdown += line + '\n';
|
|
233
196
|
}
|
|
@@ -237,25 +200,99 @@ class AgentBrowser {
|
|
|
237
200
|
markdown: markdown.trim(),
|
|
238
201
|
links,
|
|
239
202
|
screenshot,
|
|
203
|
+
jsOutput,
|
|
240
204
|
});
|
|
241
205
|
}
|
|
242
|
-
/**
|
|
243
|
-
* Close the browser session
|
|
244
|
-
*/
|
|
245
206
|
close() {
|
|
246
|
-
// No persistent session to close in current implementation
|
|
247
207
|
}
|
|
248
|
-
/**
|
|
249
|
-
* Use as async context manager
|
|
250
|
-
*/
|
|
251
208
|
async [Symbol.asyncDispose]() {
|
|
252
209
|
this.close();
|
|
253
210
|
}
|
|
211
|
+
screenshot(width = 1280, height = 720) {
|
|
212
|
+
if (!this.currentUrl) {
|
|
213
|
+
throw new Error('No page loaded. Call goto() first.');
|
|
214
|
+
}
|
|
215
|
+
try {
|
|
216
|
+
const output = (0, child_process_1.execSync)(`${this.binaryPath} screenshot --url ${this.currentUrl} --mode ${this.mode} --width ${width} --height ${height}`, { timeout: this.timeout * 1000 }).toString().trim();
|
|
217
|
+
return output;
|
|
218
|
+
}
|
|
219
|
+
catch (error) {
|
|
220
|
+
if (error.message?.includes('timed out')) {
|
|
221
|
+
throw new Error(`Screenshot timed out after ${this.timeout}s`);
|
|
222
|
+
}
|
|
223
|
+
throw new Error(`Screenshot failed: ${error.message}`);
|
|
224
|
+
}
|
|
225
|
+
}
|
|
226
|
+
async waitForSelector(selector, timeoutMs = 10000) {
|
|
227
|
+
if (!this.currentUrl) {
|
|
228
|
+
throw new Error('No page loaded. Call goto() first.');
|
|
229
|
+
}
|
|
230
|
+
try {
|
|
231
|
+
const output = (0, child_process_1.execSync)(`${this.binaryPath} wait-for-selector --url ${this.currentUrl} --selector ${JSON.stringify(selector)} --timeout ${timeoutMs}`, { timeout: Math.ceil(timeoutMs / 1000) + 5 }).toString().trim();
|
|
232
|
+
return output === 'true';
|
|
233
|
+
}
|
|
234
|
+
catch {
|
|
235
|
+
return false;
|
|
236
|
+
}
|
|
237
|
+
}
|
|
238
|
+
async click(selector) {
|
|
239
|
+
if (!this.currentUrl) {
|
|
240
|
+
throw new Error('No page loaded. Call goto() first.');
|
|
241
|
+
}
|
|
242
|
+
try {
|
|
243
|
+
(0, child_process_1.execSync)(`${this.binaryPath} click --url ${this.currentUrl} --mode ${this.mode} --selector ${JSON.stringify(selector)}`, { timeout: this.timeout * 1000 });
|
|
244
|
+
}
|
|
245
|
+
catch (error) {
|
|
246
|
+
throw new Error(`Click failed on "${selector}": ${error.message}`);
|
|
247
|
+
}
|
|
248
|
+
}
|
|
249
|
+
async typeText(selector, text, clearFirst = false) {
|
|
250
|
+
if (!this.currentUrl) {
|
|
251
|
+
throw new Error('No page loaded. Call goto() first.');
|
|
252
|
+
}
|
|
253
|
+
try {
|
|
254
|
+
let cmd = `${this.binaryPath} type-text --url ${this.currentUrl} --mode ${this.mode} --selector ${JSON.stringify(selector)} --text ${JSON.stringify(text)}`;
|
|
255
|
+
if (clearFirst) {
|
|
256
|
+
cmd += ' --clear-first';
|
|
257
|
+
}
|
|
258
|
+
(0, child_process_1.execSync)(cmd, { timeout: this.timeout * 1000 });
|
|
259
|
+
}
|
|
260
|
+
catch (error) {
|
|
261
|
+
throw new Error(`Type text failed on "${selector}": ${error.message}`);
|
|
262
|
+
}
|
|
263
|
+
}
|
|
264
|
+
getLinks() {
|
|
265
|
+
if (!this.currentUrl) {
|
|
266
|
+
throw new Error('No page loaded. Call goto() first.');
|
|
267
|
+
}
|
|
268
|
+
try {
|
|
269
|
+
const output = (0, child_process_1.execSync)(`${this.binaryPath} get-links --url ${this.currentUrl} --mode ${this.mode}`, { timeout: this.timeout * 1000 }).toString().trim();
|
|
270
|
+
try {
|
|
271
|
+
return JSON.parse(output);
|
|
272
|
+
}
|
|
273
|
+
catch {
|
|
274
|
+
return [];
|
|
275
|
+
}
|
|
276
|
+
}
|
|
277
|
+
catch {
|
|
278
|
+
return [];
|
|
279
|
+
}
|
|
280
|
+
}
|
|
281
|
+
static async getLinksFromPage(url, mode = types_1.BrowserMode.LIGHT) {
|
|
282
|
+
const browser = new AgentBrowser({ mode });
|
|
283
|
+
try {
|
|
284
|
+
const page = await browser.goto(url);
|
|
285
|
+
return page.links;
|
|
286
|
+
}
|
|
287
|
+
finally {
|
|
288
|
+
browser.close();
|
|
289
|
+
}
|
|
290
|
+
}
|
|
291
|
+
static findBinary() {
|
|
292
|
+
return getB4n1webBinary();
|
|
293
|
+
}
|
|
254
294
|
}
|
|
255
295
|
exports.AgentBrowser = AgentBrowser;
|
|
256
|
-
/**
|
|
257
|
-
* Create a browser and navigate in one go
|
|
258
|
-
*/
|
|
259
296
|
async function createBrowserAndGoto(url, options = {}) {
|
|
260
297
|
const browser = new AgentBrowser(options);
|
|
261
298
|
try {
|
package/dist/browser.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"browser.js","sourceRoot":"","sources":["../src/browser.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"browser.js","sourceRoot":"","sources":["../src/browser.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAKA,4CAsCC;AAED,8CAeC;AAID,8DAcC;AAyND,oDAUC;AAjTD,iDAAyC;AACzC,uCAAyB;AACzB,2CAA6B;AAC7B,mCAA+F;AAE/F,SAAgB,gBAAgB;IAC9B,MAAM,IAAI,GAAG,OAAO,CAAC,GAAG,CAAC,IAAI,IAAI,OAAO,CAAC,GAAG,CAAC,WAAW,IAAI,QAAQ,GAAG,OAAO,CAAC,GAAG,CAAC,IAAI,CAAC;IACxF,MAAM,KAAK,GAAa,EAAE,CAAC;IAE3B,MAAM,aAAa,GAAG,IAAI,CAAC,IAAI,CAAC,SAAS,EAAE,IAAI,EAAE,KAAK,EAAE,eAAe,CAAC,CAAC;IACzE,IAAI,EAAE,CAAC,UAAU,CAAC,aAAa,CAAC,EAAE,CAAC;QACjC,IAAI,CAAC;YACH,EAAE,CAAC,UAAU,CAAC,aAAa,EAAE,EAAE,CAAC,SAAS,CAAC,IAAI,CAAC,CAAC;YAChD,OAAO,aAAa,CAAC;QACvB,CAAC;QAAC,MAAM,CAAC;QACT,CAAC;IACH,CAAC;IAED,KAAK,CAAC,IAAI,CACR,wBAAwB,EACxB,kBAAkB,EAClB,IAAI,GAAG,qBAAqB,EAC5B,IAAI,GAAG,uBAAuB,CAC/B,CAAC;IAEF,MAAM,OAAO,GAAG,OAAO,CAAC,GAAG,CAAC,IAAI,IAAI,EAAE,CAAC;IACvC,MAAM,QAAQ,GAAG,OAAO,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC;IACnD,KAAK,MAAM,GAAG,IAAI,QAAQ,EAAE,CA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EAAE,CACjC,CAAC,QAAQ,EAAE,CAAC,IAAI,EAAE,CAAC;YACpB,IAAI,CAAC;gBACH,OAAO,IAAI,CAAC,KAAK,CAAC,MAAM,CAAC,CAAC;YAC5B,CAAC;YAAC,MAAM,CAAC;gBACP,OAAO,EAAE,CAAC;YACZ,CAAC;QACH,CAAC;QAAC,MAAM,CAAC;YACP,OAAO,EAAE,CAAC;QACZ,CAAC;IACH,CAAC;IAED,MAAM,CAAC,KAAK,CAAC,gBAAgB,CAAC,GAAW,EAAE,OAAoB,mBAAW,CAAC,KAAK;QAC9E,MAAM,OAAO,GAAG,IAAI,YAAY,CAAC,EAAE,IAAI,EAAE,CAAC,CAAC;QAC3C,IAAI,CAAC;YACH,MAAM,IAAI,GAAG,MAAM,OAAO,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;YACrC,OAAO,IAAI,CAAC,KAAK,CAAC;QACpB,CAAC;gBAAS,CAAC;YACT,OAAO,CAAC,KAAK,EAAE,CAAC;QAClB,CAAC;IACH,CAAC;IAED,MAAM,CAAC,UAAU;QACf,OAAO,gBAAgB,EAAE,CAAC;IAC5B,CAAC;CACF;AA1LD,oCA0LC;AAEM,KAAK,UAAU,oBAAoB,CACxC,GAAW,EACX,UAA0B,EAAE;IAE5B,MAAM,OAAO,GAAG,IAAI,YAAY,CAAC,OAAO,CAAC,CAAC;IAC1C,IAAI,CAAC;QACH,OAAO,MAAM,OAAO,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;IACjC,CAAC;YAAS,CAAC;QACT,OAAO,CAAC,KAAK,EAAE,CAAC;IAClB,CAAC;AACH,CAAC"}
|
package/dist/errors.d.ts
CHANGED
|
@@ -1,24 +1,15 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* B4n1Web Errors
|
|
3
|
-
*/
|
|
4
|
-
/**
|
|
5
|
-
* Error thrown when B4n1Web binary is not found
|
|
6
|
-
*/
|
|
7
1
|
export declare class BinaryNotFoundError extends Error {
|
|
8
2
|
constructor(message?: string);
|
|
9
3
|
}
|
|
10
|
-
/**
|
|
11
|
-
* Error thrown when navigation fails
|
|
12
|
-
*/
|
|
13
4
|
export declare class NavigationError extends Error {
|
|
14
5
|
readonly url: string;
|
|
15
6
|
constructor(message: string, url: string);
|
|
16
7
|
}
|
|
17
|
-
/**
|
|
18
|
-
* Error thrown when binary execution fails
|
|
19
|
-
*/
|
|
20
8
|
export declare class BinaryError extends Error {
|
|
21
9
|
readonly stderr: string;
|
|
22
10
|
constructor(message: string, stderr: string);
|
|
23
11
|
}
|
|
12
|
+
export declare class SelectorTimeoutError extends Error {
|
|
13
|
+
constructor(selector: string, timeoutMs: number);
|
|
14
|
+
}
|
|
24
15
|
//# sourceMappingURL=errors.d.ts.map
|
package/dist/errors.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"errors.d.ts","sourceRoot":"","sources":["../src/errors.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"errors.d.ts","sourceRoot":"","sources":["../src/errors.ts"],"names":[],"mappings":"AAAA,qBAAa,mBAAoB,SAAQ,KAAK;gBAChC,OAAO,SAAuG;CAK3H;AAED,qBAAa,eAAgB,SAAQ,KAAK;aACK,GAAG,EAAE,MAAM;gBAA5C,OAAO,EAAE,MAAM,EAAkB,GAAG,EAAE,MAAM;CAKzD;AAED,qBAAa,WAAY,SAAQ,KAAK;aACS,MAAM,EAAE,MAAM;gBAA/C,OAAO,EAAE,MAAM,EAAkB,MAAM,EAAE,MAAM;CAK5D;AAED,qBAAa,oBAAqB,SAAQ,KAAK;gBACjC,QAAQ,EAAE,MAAM,EAAE,SAAS,EAAE,MAAM;CAKhD"}
|
package/dist/errors.js
CHANGED
|
@@ -1,12 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
/**
|
|
3
|
-
* B4n1Web Errors
|
|
4
|
-
*/
|
|
5
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
-
exports.BinaryError = exports.NavigationError = exports.BinaryNotFoundError = void 0;
|
|
7
|
-
/**
|
|
8
|
-
* Error thrown when B4n1Web binary is not found
|
|
9
|
-
*/
|
|
3
|
+
exports.SelectorTimeoutError = exports.BinaryError = exports.NavigationError = exports.BinaryNotFoundError = void 0;
|
|
10
4
|
class BinaryNotFoundError extends Error {
|
|
11
5
|
constructor(message = 'B4n1Web binary not found. Please install it first:\n curl -sL https://web.b4n1.com/install | bash') {
|
|
12
6
|
super(message);
|
|
@@ -15,9 +9,6 @@ class BinaryNotFoundError extends Error {
|
|
|
15
9
|
}
|
|
16
10
|
}
|
|
17
11
|
exports.BinaryNotFoundError = BinaryNotFoundError;
|
|
18
|
-
/**
|
|
19
|
-
* Error thrown when navigation fails
|
|
20
|
-
*/
|
|
21
12
|
class NavigationError extends Error {
|
|
22
13
|
constructor(message, url) {
|
|
23
14
|
super(message);
|
|
@@ -27,9 +18,6 @@ class NavigationError extends Error {
|
|
|
27
18
|
}
|
|
28
19
|
}
|
|
29
20
|
exports.NavigationError = NavigationError;
|
|
30
|
-
/**
|
|
31
|
-
* Error thrown when binary execution fails
|
|
32
|
-
*/
|
|
33
21
|
class BinaryError extends Error {
|
|
34
22
|
constructor(message, stderr) {
|
|
35
23
|
super(message);
|
|
@@ -39,4 +27,12 @@ class BinaryError extends Error {
|
|
|
39
27
|
}
|
|
40
28
|
}
|
|
41
29
|
exports.BinaryError = BinaryError;
|
|
30
|
+
class SelectorTimeoutError extends Error {
|
|
31
|
+
constructor(selector, timeoutMs) {
|
|
32
|
+
super(`Selector "${selector}" not found within ${timeoutMs}ms`);
|
|
33
|
+
this.name = 'SelectorTimeoutError';
|
|
34
|
+
Error.captureStackTrace(this, SelectorTimeoutError);
|
|
35
|
+
}
|
|
36
|
+
}
|
|
37
|
+
exports.SelectorTimeoutError = SelectorTimeoutError;
|
|
42
38
|
//# sourceMappingURL=errors.js.map
|
package/dist/errors.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"errors.js","sourceRoot":"","sources":["../src/errors.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"errors.js","sourceRoot":"","sources":["../src/errors.ts"],"names":[],"mappings":";;;AAAA,MAAa,mBAAoB,SAAQ,KAAK;IAC5C,YAAY,OAAO,GAAG,oGAAoG;QACxH,KAAK,CAAC,OAAO,CAAC,CAAC;QACf,IAAI,CAAC,IAAI,GAAG,qBAAqB,CAAC;QAClC,KAAK,CAAC,iBAAiB,CAAC,IAAI,EAAE,mBAAmB,CAAC,CAAC;IACrD,CAAC;CACF;AAND,kDAMC;AAED,MAAa,eAAgB,SAAQ,KAAK;IACxC,YAAY,OAAe,EAAkB,GAAW;QACtD,KAAK,CAAC,OAAO,CAAC,CAAC;QAD4B,QAAG,GAAH,GAAG,CAAQ;QAEtD,IAAI,CAAC,IAAI,GAAG,iBAAiB,CAAC;QAC9B,KAAK,CAAC,iBAAiB,CAAC,IAAI,EAAE,eAAe,CAAC,CAAC;IACjD,CAAC;CACF;AAND,0CAMC;AAED,MAAa,WAAY,SAAQ,KAAK;IACpC,YAAY,OAAe,EAAkB,MAAc;QACzD,KAAK,CAAC,OAAO,CAAC,CAAC;QAD4B,WAAM,GAAN,MAAM,CAAQ;QAEzD,IAAI,CAAC,IAAI,GAAG,aAAa,CAAC;QAC1B,KAAK,CAAC,iBAAiB,CAAC,IAAI,EAAE,WAAW,CAAC,CAAC;IAC7C,CAAC;CACF;AAND,kCAMC;AAED,MAAa,oBAAqB,SAAQ,KAAK;IAC7C,YAAY,QAAgB,EAAE,SAAiB;QAC7C,KAAK,CAAC,aAAa,QAAQ,sBAAsB,SAAS,IAAI,CAAC,CAAC;QAChE,IAAI,CAAC,IAAI,GAAG,sBAAsB,CAAC;QACnC,KAAK,CAAC,iBAAiB,CAAC,IAAI,EAAE,oBAAoB,CAAC,CAAC;IACtD,CAAC;CACF;AAND,oDAMC"}
|
package/dist/index.d.ts
CHANGED
|
@@ -1,10 +1,4 @@
|
|
|
1
|
-
|
|
2
|
-
* B4n1Web SDK for JavaScript/TypeScript
|
|
3
|
-
* Zero-overhead, high-speed web execution for sovereign AI agents.
|
|
4
|
-
*
|
|
5
|
-
* @module b4n1web
|
|
6
|
-
*/
|
|
7
|
-
export { AgentBrowser, Page, getB4n1webBinary, getB4n1webVersion, checkVersionCompatibility } from './browser';
|
|
1
|
+
export { AgentBrowser, Page, getB4n1webBinary, getB4n1webVersion, checkVersionCompatibility, createBrowserAndGoto } from './browser';
|
|
8
2
|
export { BrowserMode } from './types';
|
|
9
|
-
export { BinaryNotFoundError } from './errors';
|
|
3
|
+
export { BinaryNotFoundError, NavigationError, BinaryError, SelectorTimeoutError } from './errors';
|
|
10
4
|
//# sourceMappingURL=index.d.ts.map
|
package/dist/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,IAAI,EAAE,gBAAgB,EAAE,iBAAiB,EAAE,yBAAyB,EAAE,oBAAoB,EAAE,MAAM,WAAW,CAAC;AACrI,OAAO,EAAE,WAAW,EAAE,MAAM,SAAS,CAAC;AACtC,OAAO,EAAE,mBAAmB,EAAE,eAAe,EAAE,WAAW,EAAE,oBAAoB,EAAE,MAAM,UAAU,CAAC"}
|
package/dist/index.js
CHANGED
|
@@ -1,20 +1,18 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
/**
|
|
3
|
-
* B4n1Web SDK for JavaScript/TypeScript
|
|
4
|
-
* Zero-overhead, high-speed web execution for sovereign AI agents.
|
|
5
|
-
*
|
|
6
|
-
* @module b4n1web
|
|
7
|
-
*/
|
|
8
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
9
|
-
exports.BinaryNotFoundError = exports.BrowserMode = exports.checkVersionCompatibility = exports.getB4n1webVersion = exports.getB4n1webBinary = exports.Page = exports.AgentBrowser = void 0;
|
|
3
|
+
exports.SelectorTimeoutError = exports.BinaryError = exports.NavigationError = exports.BinaryNotFoundError = exports.BrowserMode = exports.createBrowserAndGoto = exports.checkVersionCompatibility = exports.getB4n1webVersion = exports.getB4n1webBinary = exports.Page = exports.AgentBrowser = void 0;
|
|
10
4
|
var browser_1 = require("./browser");
|
|
11
5
|
Object.defineProperty(exports, "AgentBrowser", { enumerable: true, get: function () { return browser_1.AgentBrowser; } });
|
|
12
6
|
Object.defineProperty(exports, "Page", { enumerable: true, get: function () { return browser_1.Page; } });
|
|
13
7
|
Object.defineProperty(exports, "getB4n1webBinary", { enumerable: true, get: function () { return browser_1.getB4n1webBinary; } });
|
|
14
8
|
Object.defineProperty(exports, "getB4n1webVersion", { enumerable: true, get: function () { return browser_1.getB4n1webVersion; } });
|
|
15
9
|
Object.defineProperty(exports, "checkVersionCompatibility", { enumerable: true, get: function () { return browser_1.checkVersionCompatibility; } });
|
|
10
|
+
Object.defineProperty(exports, "createBrowserAndGoto", { enumerable: true, get: function () { return browser_1.createBrowserAndGoto; } });
|
|
16
11
|
var types_1 = require("./types");
|
|
17
12
|
Object.defineProperty(exports, "BrowserMode", { enumerable: true, get: function () { return types_1.BrowserMode; } });
|
|
18
13
|
var errors_1 = require("./errors");
|
|
19
14
|
Object.defineProperty(exports, "BinaryNotFoundError", { enumerable: true, get: function () { return errors_1.BinaryNotFoundError; } });
|
|
15
|
+
Object.defineProperty(exports, "NavigationError", { enumerable: true, get: function () { return errors_1.NavigationError; } });
|
|
16
|
+
Object.defineProperty(exports, "BinaryError", { enumerable: true, get: function () { return errors_1.BinaryError; } });
|
|
17
|
+
Object.defineProperty(exports, "SelectorTimeoutError", { enumerable: true, get: function () { return errors_1.SelectorTimeoutError; } });
|
|
20
18
|
//# sourceMappingURL=index.js.map
|
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";;;AAAA,qCAAqI;AAA5H,uGAAA,YAAY,OAAA;AAAE,+FAAA,IAAI,OAAA;AAAE,2GAAA,gBAAgB,OAAA;AAAE,4GAAA,iBAAiB,OAAA;AAAE,oHAAA,yBAAyB,OAAA;AAAE,+GAAA,oBAAoB,OAAA;AACjH,iCAAsC;AAA7B,oGAAA,WAAW,OAAA;AACpB,mCAAmG;AAA1F,6GAAA,mBAAmB,OAAA;AAAE,yGAAA,eAAe,OAAA;AAAE,qGAAA,WAAW,OAAA;AAAE,8GAAA,oBAAoB,OAAA"}
|
package/dist/types.d.ts
CHANGED
|
@@ -1,6 +1,3 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* B4n1Web TypeScript Types
|
|
3
|
-
*/
|
|
4
1
|
export declare enum BrowserMode {
|
|
5
2
|
LIGHT = "light",
|
|
6
3
|
JS = "js",
|
|
@@ -16,6 +13,7 @@ export interface PageData {
|
|
|
16
13
|
markdown: string;
|
|
17
14
|
links: string[];
|
|
18
15
|
screenshot?: string;
|
|
16
|
+
jsOutput?: string;
|
|
19
17
|
}
|
|
20
18
|
export interface NavigateResult {
|
|
21
19
|
url: string;
|
package/dist/types.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":"AAAA,oBAAY,WAAW;IACrB,KAAK,UAAU;IACf,EAAE,OAAO;IACT,MAAM,WAAW;CAClB;AAED,MAAM,WAAW,cAAc;IAC7B,IAAI,CAAC,EAAE,WAAW,CAAC;IACnB,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB;AAED,MAAM,WAAW,QAAQ;IACvB,GAAG,EAAE,MAAM,CAAC;IACZ,QAAQ,EAAE,MAAM,CAAC;IACjB,KAAK,EAAE,MAAM,EAAE,CAAC;IAChB,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,QAAQ,CAAC,EAAE,MAAM,CAAC;CACnB;AAED,MAAM,WAAW,cAAc;IAC7B,GAAG,EAAE,MAAM,CAAC;IACZ,OAAO,EAAE,OAAO,CAAC;IACjB,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,KAAK,CAAC,EAAE,MAAM,EAAE,CAAC;IACjB,KAAK,CAAC,EAAE,MAAM,CAAC;CAChB;AAED,MAAM,WAAW,qBAAqB;IACpC,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB;AAED,MAAM,WAAW,mBAAmB;IAClC,MAAM,EAAE,OAAO,CAAC;IAChB,aAAa,EAAE,OAAO,CAAC;CACxB;AAED,qBAAa,mBAAoB,SAAQ,KAAK;gBAChC,OAAO,SAAuG;CAI3H"}
|
package/dist/types.js
CHANGED
package/dist/types.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.js","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"types.js","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":";;;AAAA,IAAY,WAIX;AAJD,WAAY,WAAW;IACrB,8BAAe,CAAA;IACf,wBAAS,CAAA;IACT,gCAAiB,CAAA;AACnB,CAAC,EAJW,WAAW,2BAAX,WAAW,QAItB;AAkCD,MAAa,mBAAoB,SAAQ,KAAK;IAC5C,YAAY,OAAO,GAAG,oGAAoG;QACxH,KAAK,CAAC,OAAO,CAAC,CAAC;QACf,IAAI,CAAC,IAAI,GAAG,qBAAqB,CAAC;IACpC,CAAC;CACF;AALD,kDAKC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "b4n1-web",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.7.0",
|
|
4
4
|
"description": "B4n1Web SDK for JavaScript/TypeScript - Agentic Browser Engine with bundled binary",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"types": "dist/index.d.ts",
|
|
@@ -28,7 +28,7 @@
|
|
|
28
28
|
],
|
|
29
29
|
"author": "Bani Montoya <banimontoya@gmail.com>",
|
|
30
30
|
"license": "MIT",
|
|
31
|
-
"homepage": "https://
|
|
31
|
+
"homepage": "https://github.com/B4N1-com/b4n1-web",
|
|
32
32
|
"repository": {
|
|
33
33
|
"type": "git",
|
|
34
34
|
"url": "https://github.com/B4N1-com/b4n1-web.git"
|
|
@@ -38,8 +38,7 @@
|
|
|
38
38
|
},
|
|
39
39
|
"devDependencies": {
|
|
40
40
|
"@types/node": "^20.0.0",
|
|
41
|
-
"typescript": "^5.0.0"
|
|
42
|
-
"vitest": "^1.0.0"
|
|
41
|
+
"typescript": "^5.0.0"
|
|
43
42
|
},
|
|
44
43
|
"engines": {
|
|
45
44
|
"node": ">=18.0.0"
|