bazilion 0.26.1 → 0.27.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/dist/cli.js +1 -2
- package/dist/cli.js.map +1 -1
- package/dist/daemon.js +599 -230
- package/dist/daemon.js.map +1 -1
- package/dist/worker.js +51 -7
- package/dist/worker.js.map +1 -1
- package/package.json +1 -2
package/dist/worker.js
CHANGED
|
@@ -581,7 +581,7 @@ var SERVICES = [
|
|
|
581
581
|
displayName: "Browser Automation",
|
|
582
582
|
category: "service",
|
|
583
583
|
team: "Browser",
|
|
584
|
-
hint:
|
|
584
|
+
hint: 'Each Agent gets its own persistent browser profile (cookies, logins), kept across turns and Team moves and excluded from backups. Reset on the Agent page, or deleting the Agent, removes it. With "Use my running browser" on, Agents work in your own Chrome or Chromium instead.',
|
|
585
585
|
fields: [
|
|
586
586
|
{
|
|
587
587
|
envVar: "BROWSER_ENABLED",
|
|
@@ -595,14 +595,28 @@ var SERVICES = [
|
|
|
595
595
|
kind: "config",
|
|
596
596
|
label: "Browser executable (optional)",
|
|
597
597
|
placeholder: "/usr/bin/brave-browser",
|
|
598
|
-
description: "Absolute path to a Chromium-family browser. When unset, Bazilion uses the first installed Chrome, Brave, Edge or Chromium
|
|
598
|
+
description: "Absolute path to a Chromium-family browser. When unset, Bazilion uses the first installed Chrome, Brave, Edge or Chromium; when none is installed it downloads Chromium once."
|
|
599
|
+
},
|
|
600
|
+
{
|
|
601
|
+
envVar: "BROWSER_ATTACH",
|
|
602
|
+
kind: "config",
|
|
603
|
+
label: "Use my running browser",
|
|
604
|
+
placeholder: "false",
|
|
605
|
+
description: "true makes Agents work in the Chrome or Chromium you already have open, with your logins, in tabs of their own. Allow it first in Chrome at chrome://inspect/#remote-debugging. Default false: each Agent gets a browser of its own."
|
|
606
|
+
},
|
|
607
|
+
{
|
|
608
|
+
envVar: "BROWSER_ATTACH_URL",
|
|
609
|
+
kind: "config",
|
|
610
|
+
label: "Running browser address (optional)",
|
|
611
|
+
placeholder: "http://127.0.0.1:9222",
|
|
612
|
+
description: 'DevTools address of the browser to use when "Use my running browser" is on, for one started with --remote-debugging-port. When unset, Bazilion finds the running Chrome or Chromium itself.'
|
|
599
613
|
},
|
|
600
614
|
{
|
|
601
615
|
envVar: "BROWSER_HEADLESS",
|
|
602
616
|
kind: "config",
|
|
603
617
|
label: "Headless",
|
|
604
618
|
placeholder: "true",
|
|
605
|
-
description: "true (default) runs the browser without a window; false opens a visible browser window on the desktop the daemon runs in."
|
|
619
|
+
description: "true (default) runs the browser without a window; false opens a visible browser window on the desktop the daemon runs in. Not used with a running browser."
|
|
606
620
|
},
|
|
607
621
|
{
|
|
608
622
|
envVar: "BROWSER_ALLOW_PRIVATE_NETWORK",
|
|
@@ -1358,6 +1372,30 @@ import {
|
|
|
1358
1372
|
SettingsManager
|
|
1359
1373
|
} from "@earendil-works/pi-coding-agent";
|
|
1360
1374
|
|
|
1375
|
+
// ../daemon/src/lib/browser/config.ts
|
|
1376
|
+
var FALSEY = /* @__PURE__ */ new Set(["false", "0", "no", "off"]);
|
|
1377
|
+
function envBool(value, fallback) {
|
|
1378
|
+
if (value === void 0 || value.trim() === "") return fallback;
|
|
1379
|
+
return !FALSEY.has(value.trim().toLowerCase());
|
|
1380
|
+
}
|
|
1381
|
+
function envInt(value, fallback) {
|
|
1382
|
+
const n = Number.parseInt(value ?? "", 10);
|
|
1383
|
+
return Number.isFinite(n) && n > 0 ? n : fallback;
|
|
1384
|
+
}
|
|
1385
|
+
function resolveBrowserConfig(env) {
|
|
1386
|
+
const executablePath = env.BROWSER_EXECUTABLE_PATH?.trim();
|
|
1387
|
+
const attachUrl = env.BROWSER_ATTACH_URL?.trim();
|
|
1388
|
+
return {
|
|
1389
|
+
headless: envBool(env.BROWSER_HEADLESS, true),
|
|
1390
|
+
...executablePath ? { executablePath } : {},
|
|
1391
|
+
allowPrivate: envBool(env.BROWSER_ALLOW_PRIVATE_NETWORK, false),
|
|
1392
|
+
attach: envBool(env.BROWSER_ATTACH, false),
|
|
1393
|
+
...attachUrl ? { attachUrl } : {},
|
|
1394
|
+
idleMs: envInt(env.BROWSER_IDLE_MS, 9e5),
|
|
1395
|
+
maxSessions: envInt(env.BROWSER_MAX_SESSIONS, 4)
|
|
1396
|
+
};
|
|
1397
|
+
}
|
|
1398
|
+
|
|
1361
1399
|
// ../daemon/src/runtime/providers/pi-runtime.ts
|
|
1362
1400
|
import { InMemoryCredentialStore } from "@earendil-works/pi-ai";
|
|
1363
1401
|
import { ModelRuntime } from "@earendil-works/pi-coding-agent";
|
|
@@ -1521,12 +1559,15 @@ function isContained2(root, candidate) {
|
|
|
1521
1559
|
}
|
|
1522
1560
|
|
|
1523
1561
|
// ../daemon/src/runtime/session/browser-guide.ts
|
|
1524
|
-
function browserGuideSection() {
|
|
1562
|
+
function browserGuideSection(attached = false) {
|
|
1525
1563
|
return [
|
|
1526
1564
|
"# Browser",
|
|
1527
1565
|
"",
|
|
1528
|
-
"You have a browser of your own (`browser_*` tools). Its cookies and logins persist across turns.",
|
|
1566
|
+
attached ? "The `browser_*` tools work in the user's own running browser, signed in to their accounts. You see and drive only the tabs you open; their other tabs are not yours to see." : "You have a browser of your own (`browser_*` tools). Its cookies and logins persist across turns.",
|
|
1529
1567
|
"",
|
|
1568
|
+
...attached ? [
|
|
1569
|
+
"- On every site the user is signed in to, you act as them. Post, send, buy, delete or change settings only when the user asked for exactly that; otherwise ask first."
|
|
1570
|
+
] : [],
|
|
1530
1571
|
"- Read a page with `browser_snapshot`: an accessibility tree whose elements carry refs like `[ref=e5]`. Use `browser_take_screenshot` only when the visual layout matters.",
|
|
1531
1572
|
"- Act with refs from the latest snapshot. Every action returns a fresh snapshot; take the next refs from it.",
|
|
1532
1573
|
"- A link that opens a new tab does not switch to it: list the tabs with `browser_tabs` and select the new one.",
|
|
@@ -1672,7 +1713,10 @@ ${contextBlocks.join("\n\n")}`
|
|
|
1672
1713
|
});
|
|
1673
1714
|
}
|
|
1674
1715
|
if (options.browserGuide) {
|
|
1675
|
-
parts.push({
|
|
1716
|
+
parts.push({
|
|
1717
|
+
id: "browser-guide",
|
|
1718
|
+
text: browserGuideSection(options.browserGuide === "attached")
|
|
1719
|
+
});
|
|
1676
1720
|
}
|
|
1677
1721
|
const teamLines = [
|
|
1678
1722
|
"# Team",
|
|
@@ -3701,7 +3745,7 @@ function turnSurface(opts) {
|
|
|
3701
3745
|
skills: promptSkills,
|
|
3702
3746
|
sandboxMode: shellTools.config.sandboxMode,
|
|
3703
3747
|
// The guides ride along exactly when their tools are admitted.
|
|
3704
|
-
...opts.browserHost ? { browserGuide: true } : {},
|
|
3748
|
+
...opts.browserHost ? { browserGuide: resolveBrowserConfig(env).attach ? "attached" : true } : {},
|
|
3705
3749
|
...opts.webSearchHost ? { searchGuide: true } : {}
|
|
3706
3750
|
};
|
|
3707
3751
|
return {
|