@hasna/browser 0.3.8 → 0.4.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/index.js +160 -63
- package/dist/engines/selector.d.ts.map +1 -1
- package/dist/engines/tui.d.ts +49 -0
- package/dist/engines/tui.d.ts.map +1 -0
- package/dist/engines/tui.test.d.ts +2 -0
- package/dist/engines/tui.test.d.ts.map +1 -0
- package/dist/index.js +139 -42
- package/dist/lib/login-scripts.d.ts +89 -0
- package/dist/lib/login-scripts.d.ts.map +1 -0
- package/dist/lib/session.d.ts.map +1 -1
- package/dist/mcp/index.js +156 -59
- package/dist/server/index.js +135 -41
- package/dist/types/index.d.ts +3 -2
- package/dist/types/index.d.ts.map +1 -1
- package/package.json +2 -2
package/dist/mcp/index.js
CHANGED
|
@@ -6,60 +6,39 @@ var __defProp = Object.defineProperty;
|
|
|
6
6
|
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
7
7
|
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
8
8
|
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
9
|
-
function __accessProp(key) {
|
|
10
|
-
return this[key];
|
|
11
|
-
}
|
|
12
|
-
var __toESMCache_node;
|
|
13
|
-
var __toESMCache_esm;
|
|
14
9
|
var __toESM = (mod, isNodeMode, target) => {
|
|
15
|
-
var canCache = mod != null && typeof mod === "object";
|
|
16
|
-
if (canCache) {
|
|
17
|
-
var cache = isNodeMode ? __toESMCache_node ??= new WeakMap : __toESMCache_esm ??= new WeakMap;
|
|
18
|
-
var cached = cache.get(mod);
|
|
19
|
-
if (cached)
|
|
20
|
-
return cached;
|
|
21
|
-
}
|
|
22
10
|
target = mod != null ? __create(__getProtoOf(mod)) : {};
|
|
23
11
|
const to = isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target;
|
|
24
12
|
for (let key of __getOwnPropNames(mod))
|
|
25
13
|
if (!__hasOwnProp.call(to, key))
|
|
26
14
|
__defProp(to, key, {
|
|
27
|
-
get:
|
|
15
|
+
get: () => mod[key],
|
|
28
16
|
enumerable: true
|
|
29
17
|
});
|
|
30
|
-
if (canCache)
|
|
31
|
-
cache.set(mod, to);
|
|
32
18
|
return to;
|
|
33
19
|
};
|
|
20
|
+
var __moduleCache = /* @__PURE__ */ new WeakMap;
|
|
34
21
|
var __toCommonJS = (from) => {
|
|
35
|
-
var entry =
|
|
22
|
+
var entry = __moduleCache.get(from), desc;
|
|
36
23
|
if (entry)
|
|
37
24
|
return entry;
|
|
38
25
|
entry = __defProp({}, "__esModule", { value: true });
|
|
39
|
-
if (from && typeof from === "object" || typeof from === "function")
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable
|
|
45
|
-
});
|
|
46
|
-
}
|
|
26
|
+
if (from && typeof from === "object" || typeof from === "function")
|
|
27
|
+
__getOwnPropNames(from).map((key) => !__hasOwnProp.call(entry, key) && __defProp(entry, key, {
|
|
28
|
+
get: () => from[key],
|
|
29
|
+
enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable
|
|
30
|
+
}));
|
|
47
31
|
__moduleCache.set(from, entry);
|
|
48
32
|
return entry;
|
|
49
33
|
};
|
|
50
|
-
var __moduleCache;
|
|
51
34
|
var __commonJS = (cb, mod) => () => (mod || cb((mod = { exports: {} }).exports, mod), mod.exports);
|
|
52
|
-
var __returnValue = (v) => v;
|
|
53
|
-
function __exportSetter(name, newValue) {
|
|
54
|
-
this[name] = __returnValue.bind(null, newValue);
|
|
55
|
-
}
|
|
56
35
|
var __export = (target, all) => {
|
|
57
36
|
for (var name in all)
|
|
58
37
|
__defProp(target, name, {
|
|
59
38
|
get: all[name],
|
|
60
39
|
enumerable: true,
|
|
61
40
|
configurable: true,
|
|
62
|
-
set:
|
|
41
|
+
set: (newValue) => all[name] = () => newValue
|
|
63
42
|
});
|
|
64
43
|
};
|
|
65
44
|
var __esm = (fn, res) => () => (fn && (res = fn(fn = 0)), res);
|
|
@@ -143,11 +122,11 @@ import { homedir as homedir4 } from "os";
|
|
|
143
122
|
import { join as join4 } from "path";
|
|
144
123
|
import { join as join6, dirname } from "path";
|
|
145
124
|
import { homedir as homedir5, platform } from "os";
|
|
146
|
-
function
|
|
125
|
+
function __accessProp(key) {
|
|
147
126
|
return this[key];
|
|
148
127
|
}
|
|
149
|
-
function
|
|
150
|
-
this[name] =
|
|
128
|
+
function __exportSetter(name, newValue) {
|
|
129
|
+
this[name] = __returnValue.bind(null, newValue);
|
|
151
130
|
}
|
|
152
131
|
function translateSql(sql, dialect) {
|
|
153
132
|
if (dialect === "sqlite")
|
|
@@ -1177,10 +1156,10 @@ class SyncProgressTracker {
|
|
|
1177
1156
|
}
|
|
1178
1157
|
}
|
|
1179
1158
|
}
|
|
1180
|
-
var __create2, __getProtoOf2, __defProp2, __getOwnPropNames2, __hasOwnProp2,
|
|
1159
|
+
var __create2, __getProtoOf2, __defProp2, __getOwnPropNames2, __hasOwnProp2, __toESMCache_node, __toESMCache_esm, __toESM2 = (mod, isNodeMode, target) => {
|
|
1181
1160
|
var canCache = mod != null && typeof mod === "object";
|
|
1182
1161
|
if (canCache) {
|
|
1183
|
-
var cache = isNodeMode ?
|
|
1162
|
+
var cache = isNodeMode ? __toESMCache_node ??= new WeakMap : __toESMCache_esm ??= new WeakMap;
|
|
1184
1163
|
var cached = cache.get(mod);
|
|
1185
1164
|
if (cached)
|
|
1186
1165
|
return cached;
|
|
@@ -1190,19 +1169,19 @@ var __create2, __getProtoOf2, __defProp2, __getOwnPropNames2, __hasOwnProp2, __t
|
|
|
1190
1169
|
for (let key of __getOwnPropNames2(mod))
|
|
1191
1170
|
if (!__hasOwnProp2.call(to, key))
|
|
1192
1171
|
__defProp2(to, key, {
|
|
1193
|
-
get:
|
|
1172
|
+
get: __accessProp.bind(mod, key),
|
|
1194
1173
|
enumerable: true
|
|
1195
1174
|
});
|
|
1196
1175
|
if (canCache)
|
|
1197
1176
|
cache.set(mod, to);
|
|
1198
1177
|
return to;
|
|
1199
|
-
}, __commonJS2 = (cb, mod) => () => (mod || cb((mod = { exports: {} }).exports, mod), mod.exports),
|
|
1178
|
+
}, __commonJS2 = (cb, mod) => () => (mod || cb((mod = { exports: {} }).exports, mod), mod.exports), __returnValue = (v) => v, __export2 = (target, all) => {
|
|
1200
1179
|
for (var name in all)
|
|
1201
1180
|
__defProp2(target, name, {
|
|
1202
1181
|
get: all[name],
|
|
1203
1182
|
enumerable: true,
|
|
1204
1183
|
configurable: true,
|
|
1205
|
-
set:
|
|
1184
|
+
set: __exportSetter.bind(all, name)
|
|
1206
1185
|
});
|
|
1207
1186
|
}, __esm2 = (fn, res) => () => (fn && (res = fn(fn = 0)), res), __require2, require_postgres_array, require_arrayParser, require_postgres_date, require_mutable, require_postgres_interval, require_postgres_bytea, require_textParsers, require_pg_int8, require_binaryParsers, require_builtins, require_pg_types, require_defaults, require_utils, require_utils_legacy, require_utils_webcrypto, require_utils2, require_cert_signatures, require_sasl, require_type_overrides, require_pg_connection_string, require_connection_parameters, require_result, require_query, require_messages, require_buffer_writer, require_serializer, require_buffer_reader, require_parser, require_dist, require_empty, require_stream, require_connection, require_split2, require_helper, require_lib, require_client, require_pg_pool, require_query2, require_client2, require_lib2, import_lib, Client, Pool, Connection, types2, Query, DatabaseError, escapeIdentifier, escapeLiteral, Result, TypeOverrides, defaults, esm_default, init_esm, init_adapter, util3, objectUtil2, ZodParsedType2, getParsedType2 = (data) => {
|
|
1208
1187
|
const t = typeof data;
|
|
@@ -10619,6 +10598,89 @@ var init_bun_webview = __esm(() => {
|
|
|
10619
10598
|
};
|
|
10620
10599
|
});
|
|
10621
10600
|
|
|
10601
|
+
// src/engines/tui.ts
|
|
10602
|
+
import { execSync as execSync2, spawn as spawn2 } from "child_process";
|
|
10603
|
+
function isTuiAvailable() {
|
|
10604
|
+
try {
|
|
10605
|
+
execSync2("which ttyd", { stdio: "ignore" });
|
|
10606
|
+
return true;
|
|
10607
|
+
} catch {
|
|
10608
|
+
return false;
|
|
10609
|
+
}
|
|
10610
|
+
}
|
|
10611
|
+
async function findAvailablePort(startPort) {
|
|
10612
|
+
let port = startPort;
|
|
10613
|
+
for (let i = 0;i < 100; i++) {
|
|
10614
|
+
try {
|
|
10615
|
+
const resp = await fetch(`http://localhost:${port}`);
|
|
10616
|
+
port++;
|
|
10617
|
+
} catch {
|
|
10618
|
+
return port;
|
|
10619
|
+
}
|
|
10620
|
+
}
|
|
10621
|
+
throw new BrowserError("No available port found for ttyd", "TUI_PORT_EXHAUSTED");
|
|
10622
|
+
}
|
|
10623
|
+
async function waitForTtyd(port, timeoutMs = 1e4) {
|
|
10624
|
+
const start = Date.now();
|
|
10625
|
+
while (Date.now() - start < timeoutMs) {
|
|
10626
|
+
try {
|
|
10627
|
+
const resp = await fetch(`http://localhost:${port}`);
|
|
10628
|
+
if (resp.ok || resp.status === 200)
|
|
10629
|
+
return;
|
|
10630
|
+
} catch {}
|
|
10631
|
+
await new Promise((r) => setTimeout(r, 150));
|
|
10632
|
+
}
|
|
10633
|
+
throw new BrowserError(`ttyd did not start within ${timeoutMs}ms`, "TUI_TIMEOUT");
|
|
10634
|
+
}
|
|
10635
|
+
async function launchTui(command, options = {}) {
|
|
10636
|
+
if (!isTuiAvailable()) {
|
|
10637
|
+
throw new BrowserError("ttyd not found \u2014 install with: brew install ttyd", "TUI_NOT_AVAILABLE");
|
|
10638
|
+
}
|
|
10639
|
+
const port = await findAvailablePort(nextPort);
|
|
10640
|
+
nextPort = port + 1;
|
|
10641
|
+
const ttydProcess = spawn2("ttyd", ["--writable", "--port", String(port), "/bin/sh", "-c", command], {
|
|
10642
|
+
stdio: "ignore",
|
|
10643
|
+
detached: false
|
|
10644
|
+
});
|
|
10645
|
+
ttydProcess.on("error", (err) => {
|
|
10646
|
+
console.error(`[tui] ttyd process error: ${err.message}`);
|
|
10647
|
+
});
|
|
10648
|
+
try {
|
|
10649
|
+
await waitForTtyd(port);
|
|
10650
|
+
const viewport = options.viewport ?? { width: 1280, height: 720 };
|
|
10651
|
+
const browser = await launchPlaywright({
|
|
10652
|
+
headless: options.headless ?? true,
|
|
10653
|
+
viewport
|
|
10654
|
+
});
|
|
10655
|
+
const page = await getPage(browser, { viewport });
|
|
10656
|
+
await page.goto(`http://localhost:${port}`, {
|
|
10657
|
+
waitUntil: "domcontentloaded"
|
|
10658
|
+
});
|
|
10659
|
+
await page.waitForSelector(".xterm-screen", { timeout: 1e4 });
|
|
10660
|
+
return { ttydProcess, port, browser, page };
|
|
10661
|
+
} catch (err) {
|
|
10662
|
+
ttydProcess.kill();
|
|
10663
|
+
throw err;
|
|
10664
|
+
}
|
|
10665
|
+
}
|
|
10666
|
+
async function closeTui(session) {
|
|
10667
|
+
try {
|
|
10668
|
+
await session.page.close();
|
|
10669
|
+
} catch {}
|
|
10670
|
+
try {
|
|
10671
|
+
await session.browser.close();
|
|
10672
|
+
} catch {}
|
|
10673
|
+
try {
|
|
10674
|
+
session.ttydProcess.kill("SIGTERM");
|
|
10675
|
+
} catch {}
|
|
10676
|
+
}
|
|
10677
|
+
var DEFAULT_TTYD_PORT_START = 7780, nextPort;
|
|
10678
|
+
var init_tui = __esm(() => {
|
|
10679
|
+
init_types();
|
|
10680
|
+
init_playwright();
|
|
10681
|
+
nextPort = DEFAULT_TTYD_PORT_START;
|
|
10682
|
+
});
|
|
10683
|
+
|
|
10622
10684
|
// src/engines/selector.ts
|
|
10623
10685
|
function selectEngine(useCase, explicit) {
|
|
10624
10686
|
if (explicit && explicit !== "auto")
|
|
@@ -10642,6 +10704,7 @@ var init_selector = __esm(() => {
|
|
|
10642
10704
|
init_types();
|
|
10643
10705
|
init_lightpanda();
|
|
10644
10706
|
init_bun_webview();
|
|
10707
|
+
init_tui();
|
|
10645
10708
|
ENGINE_MAP = {
|
|
10646
10709
|
["scrape" /* SCRAPE */]: "bun",
|
|
10647
10710
|
["extract_links" /* EXTRACT_LINKS */]: "bun",
|
|
@@ -10652,6 +10715,7 @@ var init_selector = __esm(() => {
|
|
|
10652
10715
|
["auth_flow" /* AUTH_FLOW */]: "playwright",
|
|
10653
10716
|
["multi_tab" /* MULTI_TAB */]: "playwright",
|
|
10654
10717
|
["record_replay" /* RECORD_REPLAY */]: "playwright",
|
|
10718
|
+
["terminal_test" /* TERMINAL_TEST */]: "tui",
|
|
10655
10719
|
["network_monitor" /* NETWORK_MONITOR */]: "cdp",
|
|
10656
10720
|
["har_capture" /* HAR_CAPTURE */]: "cdp",
|
|
10657
10721
|
["perf_profile" /* PERF_PROFILE */]: "cdp",
|
|
@@ -12017,7 +12081,7 @@ async function createSession2(opts = {}) {
|
|
|
12017
12081
|
try {
|
|
12018
12082
|
cleanups2.push(setupDialogHandler(page2, session2.id));
|
|
12019
12083
|
} catch {}
|
|
12020
|
-
handles.set(session2.id, { browser: cdpBrowser, bunView: null, page: page2, engine: "cdp", cleanups: cleanups2, tokenBudget: { total: 0, used: 0 }, lastActivity: Date.now(), autoGallery: opts.autoGallery ?? false });
|
|
12084
|
+
handles.set(session2.id, { browser: cdpBrowser, bunView: null, tuiSession: null, page: page2, engine: "cdp", cleanups: cleanups2, tokenBudget: { total: 0, used: 0 }, lastActivity: Date.now(), autoGallery: opts.autoGallery ?? false });
|
|
12021
12085
|
return { session: session2, page: page2 };
|
|
12022
12086
|
}
|
|
12023
12087
|
const engine = opts.engine === "auto" || !opts.engine ? selectEngine(opts.useCase ?? "spa_navigate" /* SPA_NAVIGATE */, opts.engine) : opts.engine;
|
|
@@ -12043,6 +12107,38 @@ async function createSession2(opts = {}) {
|
|
|
12043
12107
|
browser = await connectLightpanda();
|
|
12044
12108
|
const context = await browser.newContext({ viewport: opts.viewport ?? { width: 1280, height: 720 } });
|
|
12045
12109
|
page = await context.newPage();
|
|
12110
|
+
} else if (resolvedEngine === "tui") {
|
|
12111
|
+
const command = opts.startUrl ?? "bash";
|
|
12112
|
+
const tuiSess = await launchTui(command, {
|
|
12113
|
+
headless: opts.headless ?? true,
|
|
12114
|
+
viewport: opts.viewport
|
|
12115
|
+
});
|
|
12116
|
+
browser = tuiSess.browser;
|
|
12117
|
+
page = tuiSess.page;
|
|
12118
|
+
const session2 = createSession({
|
|
12119
|
+
engine: "tui",
|
|
12120
|
+
projectId: opts.projectId,
|
|
12121
|
+
agentId: opts.agentId,
|
|
12122
|
+
startUrl: opts.startUrl,
|
|
12123
|
+
name: opts.name ?? "tui"
|
|
12124
|
+
});
|
|
12125
|
+
const cleanups2 = [];
|
|
12126
|
+
cleanups2.push(() => closeTui(tuiSess));
|
|
12127
|
+
if (opts.captureNetwork !== false) {
|
|
12128
|
+
try {
|
|
12129
|
+
cleanups2.push(enableNetworkLogging(page, session2.id));
|
|
12130
|
+
} catch {}
|
|
12131
|
+
}
|
|
12132
|
+
if (opts.captureConsole !== false) {
|
|
12133
|
+
try {
|
|
12134
|
+
cleanups2.push(enableConsoleCapture(page, session2.id));
|
|
12135
|
+
} catch {}
|
|
12136
|
+
}
|
|
12137
|
+
try {
|
|
12138
|
+
cleanups2.push(setupDialogHandler(page, session2.id));
|
|
12139
|
+
} catch {}
|
|
12140
|
+
handles.set(session2.id, { browser, bunView: null, tuiSession: tuiSess, page, engine: "tui", cleanups: cleanups2, tokenBudget: { total: 0, used: 0 }, lastActivity: Date.now(), autoGallery: opts.autoGallery ?? false });
|
|
12141
|
+
return { session: session2, page };
|
|
12046
12142
|
} else {
|
|
12047
12143
|
browser = await pool.acquire(opts.headless ?? true);
|
|
12048
12144
|
if (opts.storageState) {
|
|
@@ -12113,7 +12209,7 @@ async function createSession2(opts = {}) {
|
|
|
12113
12209
|
} catch {}
|
|
12114
12210
|
}
|
|
12115
12211
|
}
|
|
12116
|
-
handles.set(session.id, { browser, bunView, page, engine: bunView ? "bun" : resolvedEngine, cleanups, tokenBudget: { total: 0, used: 0 }, lastActivity: Date.now(), autoGallery: opts.autoGallery ?? false });
|
|
12212
|
+
handles.set(session.id, { browser, bunView, tuiSession: null, page, engine: bunView ? "bun" : resolvedEngine, cleanups, tokenBudget: { total: 0, used: 0 }, lastActivity: Date.now(), autoGallery: opts.autoGallery ?? false });
|
|
12117
12213
|
if (opts.startUrl) {
|
|
12118
12214
|
try {
|
|
12119
12215
|
if (bunView) {
|
|
@@ -12183,7 +12279,7 @@ async function closeSession2(sessionId) {
|
|
|
12183
12279
|
try {
|
|
12184
12280
|
await handle.bunView.close();
|
|
12185
12281
|
} catch {}
|
|
12186
|
-
} else {
|
|
12282
|
+
} else if (handle.tuiSession) {} else {
|
|
12187
12283
|
try {
|
|
12188
12284
|
await handle.page.context().close();
|
|
12189
12285
|
} catch {}
|
|
@@ -12283,6 +12379,7 @@ var init_session = __esm(() => {
|
|
|
12283
12379
|
init_lightpanda();
|
|
12284
12380
|
init_bun_webview();
|
|
12285
12381
|
init_selector();
|
|
12382
|
+
init_tui();
|
|
12286
12383
|
init_network();
|
|
12287
12384
|
init_console();
|
|
12288
12385
|
init_stealth();
|
|
@@ -24010,8 +24107,8 @@ import { join as join33 } from "path";
|
|
|
24010
24107
|
import { existsSync as existsSync43, mkdirSync as mkdirSync4, readFileSync as readFileSync33, writeFileSync as writeFileSync33 } from "fs";
|
|
24011
24108
|
import { homedir as homedir33 } from "os";
|
|
24012
24109
|
import { join as join43 } from "path";
|
|
24013
|
-
function
|
|
24014
|
-
this[name] =
|
|
24110
|
+
function __exportSetter2(name, newValue) {
|
|
24111
|
+
this[name] = __returnValue2.bind(null, newValue);
|
|
24015
24112
|
}
|
|
24016
24113
|
function isInMemoryDb(path) {
|
|
24017
24114
|
return path === ":memory:" || path.startsWith("file::memory:");
|
|
@@ -27125,13 +27222,13 @@ function clearActiveModel() {
|
|
|
27125
27222
|
delete config.activeModel;
|
|
27126
27223
|
writeConfig(config);
|
|
27127
27224
|
}
|
|
27128
|
-
var __defProp3,
|
|
27225
|
+
var __defProp3, __returnValue2 = (v) => v, __export3 = (target, all) => {
|
|
27129
27226
|
for (var name in all)
|
|
27130
27227
|
__defProp3(target, name, {
|
|
27131
27228
|
get: all[name],
|
|
27132
27229
|
enumerable: true,
|
|
27133
27230
|
configurable: true,
|
|
27134
|
-
set:
|
|
27231
|
+
set: __exportSetter2.bind(all, name)
|
|
27135
27232
|
});
|
|
27136
27233
|
}, __esm3 = (fn, res) => () => (fn && (res = fn(fn = 0)), res), exports_database, MIGRATIONS, _db2 = null, init_database, AgentConflictError, EntityNotFoundError, MemoryNotFoundError, DuplicateMemoryError, MemoryExpiredError, InvalidScopeError, VersionConflictError, MemoryConflictError, OPENAI_EMBED_URL = "https://api.openai.com/v1/embeddings", EMBED_MODEL = "text-embedding-3-small", EMBED_DIMENSIONS = 1536, REDACTED = "[REDACTED]", SECRET_PATTERNS, _idCounter = 0, hookRegistry, INSTRUCTION_PATTERNS, PROMOTIONAL_PATTERNS, RECALL_PROMOTE_THRESHOLD = 3, CONFLICT_WINDOW_MS, MEMORY_WRITE_TTL = 30, MemoryLockConflictError, sessionFocus, STOP_WORDS, DEFAULT_CONFIG, VALID_SCOPES, VALID_CATEGORIES, defaultSyncAgents, DEFAULT_AUTO_MEMORY_CONFIG, MEMORY_EXTRACTION_SYSTEM_PROMPT = `You are a precise memory extraction engine for an AI agent.
|
|
27137
27234
|
Given text, extract facts worth remembering as structured JSON.
|
|
@@ -28654,11 +28751,11 @@ import { randomUUID as randomUUID22 } from "crypto";
|
|
|
28654
28751
|
import { readFileSync as readFileSync24, writeFileSync as writeFileSync7, mkdirSync as mkdirSync34 } from "fs";
|
|
28655
28752
|
import { join as join44, dirname as dirname24 } from "path";
|
|
28656
28753
|
import { homedir as homedir42 } from "os";
|
|
28657
|
-
function
|
|
28754
|
+
function __accessProp2(key) {
|
|
28658
28755
|
return this[key];
|
|
28659
28756
|
}
|
|
28660
|
-
function
|
|
28661
|
-
this[name] =
|
|
28757
|
+
function __exportSetter3(name, newValue) {
|
|
28758
|
+
this[name] = __returnValue3.bind(null, newValue);
|
|
28662
28759
|
}
|
|
28663
28760
|
function getDbPath3() {
|
|
28664
28761
|
if (process.env.CONVERSATIONS_DB_PATH)
|
|
@@ -30643,10 +30740,10 @@ function getGraphStats() {
|
|
|
30643
30740
|
map[r.relation] = r.c;
|
|
30644
30741
|
return { total_edges: total, by_relation: map };
|
|
30645
30742
|
}
|
|
30646
|
-
var __create3, __getProtoOf3, __defProp4, __getOwnPropNames3, __getOwnPropDesc2, __hasOwnProp3,
|
|
30743
|
+
var __create3, __getProtoOf3, __defProp4, __getOwnPropNames3, __getOwnPropDesc2, __hasOwnProp3, __toESMCache_node2, __toESMCache_esm2, __toESM3 = (mod, isNodeMode, target) => {
|
|
30647
30744
|
var canCache = mod != null && typeof mod === "object";
|
|
30648
30745
|
if (canCache) {
|
|
30649
|
-
var cache = isNodeMode ?
|
|
30746
|
+
var cache = isNodeMode ? __toESMCache_node2 ??= new WeakMap : __toESMCache_esm2 ??= new WeakMap;
|
|
30650
30747
|
var cached = cache.get(mod);
|
|
30651
30748
|
if (cached)
|
|
30652
30749
|
return cached;
|
|
@@ -30656,7 +30753,7 @@ var __create3, __getProtoOf3, __defProp4, __getOwnPropNames3, __getOwnPropDesc2,
|
|
|
30656
30753
|
for (let key of __getOwnPropNames3(mod))
|
|
30657
30754
|
if (!__hasOwnProp3.call(to, key))
|
|
30658
30755
|
__defProp4(to, key, {
|
|
30659
|
-
get:
|
|
30756
|
+
get: __accessProp2.bind(mod, key),
|
|
30660
30757
|
enumerable: true
|
|
30661
30758
|
});
|
|
30662
30759
|
if (canCache)
|
|
@@ -30671,19 +30768,19 @@ var __create3, __getProtoOf3, __defProp4, __getOwnPropNames3, __getOwnPropDesc2,
|
|
|
30671
30768
|
for (var key of __getOwnPropNames3(from))
|
|
30672
30769
|
if (!__hasOwnProp3.call(entry, key))
|
|
30673
30770
|
__defProp4(entry, key, {
|
|
30674
|
-
get:
|
|
30771
|
+
get: __accessProp2.bind(from, key),
|
|
30675
30772
|
enumerable: !(desc = __getOwnPropDesc2(from, key)) || desc.enumerable
|
|
30676
30773
|
});
|
|
30677
30774
|
}
|
|
30678
30775
|
__moduleCache2.set(from, entry);
|
|
30679
30776
|
return entry;
|
|
30680
|
-
}, __moduleCache2, __commonJS3 = (cb, mod) => () => (mod || cb((mod = { exports: {} }).exports, mod), mod.exports),
|
|
30777
|
+
}, __moduleCache2, __commonJS3 = (cb, mod) => () => (mod || cb((mod = { exports: {} }).exports, mod), mod.exports), __returnValue3 = (v) => v, __export4 = (target, all) => {
|
|
30681
30778
|
for (var name in all)
|
|
30682
30779
|
__defProp4(target, name, {
|
|
30683
30780
|
get: all[name],
|
|
30684
30781
|
enumerable: true,
|
|
30685
30782
|
configurable: true,
|
|
30686
|
-
set:
|
|
30783
|
+
set: __exportSetter3.bind(all, name)
|
|
30687
30784
|
});
|
|
30688
30785
|
}, exports_db, db = null, init_db = () => {}, require_react_development, require_react, cachedConfig = null, configLoadedAt = 0, CONFIG_CACHE_MS = 1e4, import_react, AGENT_NAMES, AGENT_ID_FILE, cachedAutoName = null, ONLINE_THRESHOLD_SECONDS = 60, CONFLICT_THRESHOLD_SECONDS, DEFAULT_LOCK_EXPIRY_MS, STALE_HEARTBEAT_SECONDS, STOPWORDS;
|
|
30689
30786
|
var init_dist4 = __esm(() => {
|
|
@@ -33297,7 +33394,7 @@ import { existsSync as existsSync62 } from "fs";
|
|
|
33297
33394
|
import { join as join62 } from "path";
|
|
33298
33395
|
import { readFileSync as readFileSync43, statSync as statSync22 } from "fs";
|
|
33299
33396
|
import { relative as relative2, resolve as resolve23, join as join72 } from "path";
|
|
33300
|
-
import { execSync as
|
|
33397
|
+
import { execSync as execSync3 } from "child_process";
|
|
33301
33398
|
|
|
33302
33399
|
class TodosClient {
|
|
33303
33400
|
baseUrl;
|
|
@@ -37645,7 +37742,7 @@ function parseGitHubUrl(url) {
|
|
|
37645
37742
|
return { owner: match[1], repo: match[2], number: parseInt(match[3], 10) };
|
|
37646
37743
|
}
|
|
37647
37744
|
function fetchGitHubIssue(owner, repo, number) {
|
|
37648
|
-
const json2 =
|
|
37745
|
+
const json2 = execSync3(`gh api repos/${owner}/${repo}/issues/${number}`, { encoding: "utf-8", timeout: 15000 });
|
|
37649
37746
|
const data = JSON.parse(json2);
|
|
37650
37747
|
return {
|
|
37651
37748
|
number: data.number,
|
|
@@ -43710,7 +43807,7 @@ function resolveSessionId(sessionId) {
|
|
|
43710
43807
|
// src/mcp/sessions.ts
|
|
43711
43808
|
function register(server) {
|
|
43712
43809
|
server.tool("browser_session_create", "Create a new browser session. If agent_id is set and already has an active session, returns the existing one (use force_new to override). If session_id is omitted on other tools, the single active session is auto-selected. Use cdp_url to attach to an already-running Chrome instance.", {
|
|
43713
|
-
engine: exports_external.enum(["playwright", "cdp", "lightpanda", "bun", "auto"]).optional().default("auto"),
|
|
43810
|
+
engine: exports_external.enum(["playwright", "cdp", "lightpanda", "bun", "tui", "auto"]).optional().default("auto"),
|
|
43714
43811
|
use_case: exports_external.string().optional(),
|
|
43715
43812
|
project_id: exports_external.string().optional(),
|
|
43716
43813
|
agent_id: exports_external.string().optional(),
|
|
@@ -45225,7 +45322,7 @@ function register5(server) {
|
|
|
45225
45322
|
max_pages: exports_external.number().optional().default(50),
|
|
45226
45323
|
same_domain: exports_external.boolean().optional().default(true),
|
|
45227
45324
|
project_id: exports_external.string().optional(),
|
|
45228
|
-
engine: exports_external.enum(["playwright", "cdp", "lightpanda", "bun", "auto"]).optional().default("auto")
|
|
45325
|
+
engine: exports_external.enum(["playwright", "cdp", "lightpanda", "bun", "tui", "auto"]).optional().default("auto")
|
|
45229
45326
|
}, async ({ url, max_depth, max_pages, same_domain, project_id, engine }) => {
|
|
45230
45327
|
try {
|
|
45231
45328
|
const result = await crawl(url, {
|
|
@@ -45307,7 +45404,7 @@ function register6(server) {
|
|
|
45307
45404
|
server.tool("browser_script_run", "Run a saved script asynchronously. Returns run_id immediately \u2014 poll with browser_script_status for step-by-step progress. Scripts combine browser actions + connector calls + AI reasoning. Works with any engine (Bun.WebView, Playwright, CDP).", {
|
|
45308
45405
|
name: exports_external.string().describe("Script name"),
|
|
45309
45406
|
session_id: exports_external.string().optional(),
|
|
45310
|
-
engine: exports_external.enum(["playwright", "cdp", "lightpanda", "bun", "auto"]).optional().default("auto"),
|
|
45407
|
+
engine: exports_external.enum(["playwright", "cdp", "lightpanda", "bun", "tui", "auto"]).optional().default("auto"),
|
|
45311
45408
|
variables: exports_external.record(exports_external.string()).optional().describe("Override script variables")
|
|
45312
45409
|
}, async ({ name, session_id, engine, variables }) => {
|
|
45313
45410
|
try {
|