unbrowse 3.0.1 → 3.0.2
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 +18 -2
- package/dist/mcp.js +4 -4
- package/package.json +1 -1
- package/runtime-src/build-info.generated.ts +4 -4
- package/runtime-src/client/index.ts +18 -2
package/dist/cli.js
CHANGED
|
@@ -22,7 +22,7 @@ var __promiseAll = (args) => Promise.all(args);
|
|
|
22
22
|
var __require = /* @__PURE__ */ createRequire(import.meta.url);
|
|
23
23
|
|
|
24
24
|
// ../../src/build-info.generated.ts
|
|
25
|
-
var BUILD_RELEASE_VERSION = "3.0.
|
|
25
|
+
var BUILD_RELEASE_VERSION = "3.0.2", BUILD_GIT_SHA = "25aed2ccf282", BUILD_CODE_HASH = "1488fc1d92b7", BUILD_RELEASE_MANIFEST_BASE64 = "eyJzY2hlbWFfdmVyc2lvbiI6MSwicmVsZWFzZV92ZXJzaW9uIjoiMy4wLjIiLCJnaXRfc2hhIjoiMjVhZWQyY2NmMjgyIiwiY29kZV9oYXNoIjoiMTQ4OGZjMWQ5MmI3IiwidHJhY2VfdmVyc2lvbiI6IjE0ODhmYzFkOTJiN0AyNWFlZDJjY2YyODIiLCJpc3N1ZWRfYXQiOiIyMDI2LTA0LTA0VDE0OjExOjM3LjQ4NloifQ", BUILD_RELEASE_MANIFEST_SIGNATURE = "KPLG1erp1N-qP2bkczhQp8g-pod6ObDr845_DElQzdM", BUILD_DEFAULT_BACKEND_URL = "https://beta-api.unbrowse.ai";
|
|
26
26
|
|
|
27
27
|
// ../../src/version.ts
|
|
28
28
|
import { createHash } from "crypto";
|
|
@@ -1564,6 +1564,21 @@ async function api(method, path, body, opts) {
|
|
|
1564
1564
|
const { data } = await apiRequest(method, path, body, opts);
|
|
1565
1565
|
return data;
|
|
1566
1566
|
}
|
|
1567
|
+
function parseInstallAttribution() {
|
|
1568
|
+
const result = {};
|
|
1569
|
+
const b64 = process.env.UNBROWSE_ATTRIBUTION_B64;
|
|
1570
|
+
if (b64) {
|
|
1571
|
+
try {
|
|
1572
|
+
const decoded = JSON.parse(Buffer.from(b64, "base64").toString("utf8"));
|
|
1573
|
+
if (decoded && typeof decoded === "object")
|
|
1574
|
+
result.install_attribution = decoded;
|
|
1575
|
+
} catch {}
|
|
1576
|
+
}
|
|
1577
|
+
const token = process.env.UNBROWSE_LANDING_TOKEN;
|
|
1578
|
+
if (token && token.length < 2048)
|
|
1579
|
+
result.landing_token = token;
|
|
1580
|
+
return result;
|
|
1581
|
+
}
|
|
1567
1582
|
async function promptTosAcceptance(summary, tosUrl) {
|
|
1568
1583
|
if (process.env.UNBROWSE_NON_INTERACTIVE === "1") {
|
|
1569
1584
|
if (process.env.UNBROWSE_TOS_ACCEPTED === "1") {
|
|
@@ -1695,7 +1710,8 @@ async function ensureRegistered(options) {
|
|
|
1695
1710
|
console.log(`Registering as "${name}"...`);
|
|
1696
1711
|
try {
|
|
1697
1712
|
const wallet = getLocalWalletContext();
|
|
1698
|
-
const
|
|
1713
|
+
const attribution = parseInstallAttribution();
|
|
1714
|
+
const { agent_id, api_key } = await api("POST", "/v1/agents/register", { name, tos_version: tosInfo.version, ...wallet, ...attribution });
|
|
1699
1715
|
process.env.UNBROWSE_API_KEY = api_key;
|
|
1700
1716
|
saveConfig({
|
|
1701
1717
|
api_key,
|
package/dist/mcp.js
CHANGED
|
@@ -108,11 +108,11 @@ import { dirname, join, parse } from "path";
|
|
|
108
108
|
import { fileURLToPath as fileURLToPath2 } from "url";
|
|
109
109
|
|
|
110
110
|
// ../../src/build-info.generated.ts
|
|
111
|
-
var BUILD_RELEASE_VERSION = "3.0.
|
|
112
|
-
var BUILD_GIT_SHA = "
|
|
111
|
+
var BUILD_RELEASE_VERSION = "3.0.2";
|
|
112
|
+
var BUILD_GIT_SHA = "25aed2ccf282";
|
|
113
113
|
var BUILD_CODE_HASH = "1488fc1d92b7";
|
|
114
|
-
var BUILD_RELEASE_MANIFEST_BASE64 = "
|
|
115
|
-
var BUILD_RELEASE_MANIFEST_SIGNATURE = "
|
|
114
|
+
var BUILD_RELEASE_MANIFEST_BASE64 = "eyJzY2hlbWFfdmVyc2lvbiI6MSwicmVsZWFzZV92ZXJzaW9uIjoiMy4wLjIiLCJnaXRfc2hhIjoiMjVhZWQyY2NmMjgyIiwiY29kZV9oYXNoIjoiMTQ4OGZjMWQ5MmI3IiwidHJhY2VfdmVyc2lvbiI6IjE0ODhmYzFkOTJiN0AyNWFlZDJjY2YyODIiLCJpc3N1ZWRfYXQiOiIyMDI2LTA0LTA0VDE0OjExOjM3LjQ4NloifQ";
|
|
115
|
+
var BUILD_RELEASE_MANIFEST_SIGNATURE = "KPLG1erp1N-qP2bkczhQp8g-pod6ObDr845_DElQzdM";
|
|
116
116
|
var BUILD_DEFAULT_BACKEND_URL = "https://beta-api.unbrowse.ai";
|
|
117
117
|
|
|
118
118
|
// ../../src/version.ts
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
export const BUILD_RELEASE_VERSION = "3.0.
|
|
2
|
-
export const BUILD_GIT_SHA = "
|
|
1
|
+
export const BUILD_RELEASE_VERSION = "3.0.2";
|
|
2
|
+
export const BUILD_GIT_SHA = "25aed2ccf282";
|
|
3
3
|
export const BUILD_CODE_HASH = "1488fc1d92b7";
|
|
4
|
-
export const BUILD_RELEASE_MANIFEST_BASE64 = "
|
|
5
|
-
export const BUILD_RELEASE_MANIFEST_SIGNATURE = "
|
|
4
|
+
export const BUILD_RELEASE_MANIFEST_BASE64 = "eyJzY2hlbWFfdmVyc2lvbiI6MSwicmVsZWFzZV92ZXJzaW9uIjoiMy4wLjIiLCJnaXRfc2hhIjoiMjVhZWQyY2NmMjgyIiwiY29kZV9oYXNoIjoiMTQ4OGZjMWQ5MmI3IiwidHJhY2VfdmVyc2lvbiI6IjE0ODhmYzFkOTJiN0AyNWFlZDJjY2YyODIiLCJpc3N1ZWRfYXQiOiIyMDI2LTA0LTA0VDE0OjExOjM3LjQ4NloifQ";
|
|
5
|
+
export const BUILD_RELEASE_MANIFEST_SIGNATURE = "KPLG1erp1N-qP2bkczhQp8g-pod6ObDr845_DElQzdM";
|
|
6
6
|
export const BUILD_DEFAULT_BACKEND_URL = "https://beta-api.unbrowse.ai";
|
|
@@ -526,8 +526,23 @@ async function api<T = unknown>(method: string, path: string, body?: unknown, op
|
|
|
526
526
|
return data;
|
|
527
527
|
}
|
|
528
528
|
|
|
529
|
-
// ---
|
|
529
|
+
// --- Install attribution ---
|
|
530
|
+
|
|
531
|
+
function parseInstallAttribution(): { install_attribution?: Record<string, string>; landing_token?: string } {
|
|
532
|
+
const result: { install_attribution?: Record<string, string>; landing_token?: string } = {};
|
|
533
|
+
const b64 = process.env.UNBROWSE_ATTRIBUTION_B64;
|
|
534
|
+
if (b64) {
|
|
535
|
+
try {
|
|
536
|
+
const decoded = JSON.parse(Buffer.from(b64, "base64").toString("utf8"));
|
|
537
|
+
if (decoded && typeof decoded === "object") result.install_attribution = decoded;
|
|
538
|
+
} catch { /* malformed — ignore */ }
|
|
539
|
+
}
|
|
540
|
+
const token = process.env.UNBROWSE_LANDING_TOKEN;
|
|
541
|
+
if (token && token.length < 2048) result.landing_token = token;
|
|
542
|
+
return result;
|
|
543
|
+
}
|
|
530
544
|
|
|
545
|
+
// --- ToS acceptance ---
|
|
531
546
|
async function promptTosAcceptance(summary: string, tosUrl: string): Promise<boolean> {
|
|
532
547
|
// Non-interactive mode: skip the readline prompt, return false.
|
|
533
548
|
// The calling agent is expected to show the ToS to the user and ask for consent,
|
|
@@ -677,8 +692,9 @@ export async function ensureRegistered(options?: { promptForEmail?: boolean; exi
|
|
|
677
692
|
|
|
678
693
|
try {
|
|
679
694
|
const wallet = getLocalWalletContext();
|
|
695
|
+
const attribution = parseInstallAttribution();
|
|
680
696
|
const { agent_id, api_key } = await api<{ agent_id: string; api_key: string }>(
|
|
681
|
-
"POST", "/v1/agents/register", { name, tos_version: tosInfo.version, ...wallet }
|
|
697
|
+
"POST", "/v1/agents/register", { name, tos_version: tosInfo.version, ...wallet, ...attribution }
|
|
682
698
|
);
|
|
683
699
|
|
|
684
700
|
process.env.UNBROWSE_API_KEY = api_key;
|