Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 7 additions & 3 deletions packages/browser-ui/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -40,16 +40,18 @@ BrowserUI.create({
});
```

Or use the unpkg CDN to use it on any webpage:
<br />

- **CDN URL**: https://unpkg.com/@agent-infra/browser/dist/bundle/index.js
Or use the unpkg CDN:

- **CDN URL**: https://unpkg.com/@agent-infra/browser-ui/dist/bundle/index.js

```html
<!doctype html>
<html lang="en">
<body>
<div id="browserContainer"></div>
<script src="https://unpkg.com/@agent-infra/browser/dist/bundle/index.js"></script>
<script src="https://unpkg.com/@agent-infra/browser-ui/dist/bundle/index.js"></script>
<script>
const BrowserUI = window.agent_infra_browser_ui.BrowserUI;

Expand All @@ -67,6 +69,8 @@ Or use the unpkg CDN to use it on any webpage:
</html>
```

<br />

A complete usable example, which can be run directly with `npm run dev` in the current directory or viewed in the `/examples` directory within the package.

## Features
Expand Down
8 changes: 5 additions & 3 deletions packages/browser-ui/README.zh-CN.md
Original file line number Diff line number Diff line change
Expand Up @@ -40,16 +40,18 @@ BrowserUI.create({
});
```

或者直接使用 unpkg CDN 在任意网页中使用:
<br />

或者直接使用 unpkg CDN:

- **CDN URL**: https://unpkg.com/@agent-infra/browser/dist/bundle/index.js
- **CDN URL**: https://unpkg.com/@agent-infra/browser-ui/dist/bundle/index.js

```html
<!doctype html>
<html lang="en">
<body>
<div id="browserContainer"></div>
<script src="https://unpkg.com/@agent-infra/browser/dist/bundle/index.js"></script>
<script src="https://unpkg.com/@agent-infra/browser-ui/dist/bundle/index.js"></script>
<script>
const BrowserUI = window.agent_infra_browser_ui.BrowserUI;

Expand Down
5 changes: 0 additions & 5 deletions packages/browser-ui/examples/bundle/boot.ts
Original file line number Diff line number Diff line change
Expand Up @@ -42,19 +42,14 @@ async function main() {

if (req.url === '/' || req.url === '/index.html') {
const indexPath = new URL('./index.html', import.meta.url).pathname;
console.log(`Reading file: ${indexPath}`);

let html = await readFile(indexPath, 'utf-8');
console.log('File read successfully');

// Replace the import.meta.WSEndpoint with the actual wsEndpoint
html = html.replace(
'import.meta.WSEndpoint',
JSON.stringify(wsEndpoint),
);

console.log('HTML length:', html.length);

res.writeHead(200, { 'Content-Type': 'text/html' });
res.end(html);
} else if (req.url?.startsWith('/dist/')) {
Expand Down