@nuanu-ai/agentbrowse 0.2.33 → 0.2.35

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/index.js CHANGED
@@ -7,7 +7,7 @@ import { preflightAgentpayGateway } from './agentpay-gateway.js';
7
7
  import { browseCommand, browseCommandName } from './command-name.js';
8
8
  import { loadSession } from './session.js';
9
9
  import { outputError, outputJSON, fatal, info } from './output.js';
10
- import { applyDemoProxyBootstrapFromEnv } from './solver/config.js';
10
+ import { applyDemoProxyBootstrap } from './solver/config.js';
11
11
  function usageText() {
12
12
  return `Usage: ${browseCommandName()} <command> [args] [options]
13
13
 
@@ -215,7 +215,7 @@ function requireSessionRecord() {
215
215
  };
216
216
  }
217
217
  async function main(argv = process.argv) {
218
- applyDemoProxyBootstrapFromEnv();
218
+ applyDemoProxyBootstrap();
219
219
  const parsed = getCommand(argv);
220
220
  if (!parsed)
221
221
  process.exit(1);
@@ -5,7 +5,7 @@ export declare function getConfigPath(): string;
5
5
  export declare function ensureDirs(): void;
6
6
  export declare function readConfig(): SolverConfig;
7
7
  export declare function writeConfig(config: SolverConfig): void;
8
- export declare function applyDemoProxyBootstrapFromEnv(): boolean;
8
+ export declare function applyDemoProxyBootstrap(): boolean;
9
9
  export declare function getProfileDir(profileName: string): string;
10
10
  export declare function getExistingProfileDir(profileName: string): string | null;
11
11
  export declare function getUserDataDir(profileName: string): string;
@@ -1 +1 @@
1
- {"version":3,"file":"config.d.ts","sourceRoot":"","sources":["../../src/solver/config.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,YAAY,CAAC;AAW/C,wBAAgB,YAAY,IAAI,MAAM,CAErC;AAED,wBAAgB,cAAc,IAAI,MAAM,CAQvC;AAED,wBAAgB,aAAa,IAAI,MAAM,CAEtC;AAED,wBAAgB,UAAU,IAAI,IAAI,CAEjC;AAED,wBAAgB,UAAU,IAAI,YAAY,CAYzC;AAED,wBAAgB,WAAW,CAAC,MAAM,EAAE,YAAY,GAAG,IAAI,CAGtD;AAED,wBAAgB,8BAA8B,IAAI,OAAO,CAmBxD;AAED,wBAAgB,aAAa,CAAC,WAAW,EAAE,MAAM,GAAG,MAAM,CAEzD;AAED,wBAAgB,qBAAqB,CAAC,WAAW,EAAE,MAAM,GAAG,MAAM,GAAG,IAAI,CAUxE;AAED,wBAAgB,cAAc,CAAC,WAAW,EAAE,MAAM,GAAG,MAAM,CAE1D;AAED,wBAAgB,kBAAkB,CAAC,WAAW,EAAE,MAAM,GAAG,MAAM,CAE9D"}
1
+ {"version":3,"file":"config.d.ts","sourceRoot":"","sources":["../../src/solver/config.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,YAAY,CAAC;AAQ/C,wBAAgB,YAAY,IAAI,MAAM,CAErC;AAED,wBAAgB,cAAc,IAAI,MAAM,CAEvC;AAED,wBAAgB,aAAa,IAAI,MAAM,CAEtC;AAED,wBAAgB,UAAU,IAAI,IAAI,CAEjC;AAED,wBAAgB,UAAU,IAAI,YAAY,CAOzC;AAED,wBAAgB,WAAW,CAAC,MAAM,EAAE,YAAY,GAAG,IAAI,CAGtD;AAED,wBAAgB,uBAAuB,IAAI,OAAO,CAuBjD;AAED,wBAAgB,aAAa,CAAC,WAAW,EAAE,MAAM,GAAG,MAAM,CAEzD;AAED,wBAAgB,qBAAqB,CAAC,WAAW,EAAE,MAAM,GAAG,MAAM,GAAG,IAAI,CAMxE;AAED,wBAAgB,cAAc,CAAC,WAAW,EAAE,MAAM,GAAG,MAAM,CAE1D;AAED,wBAAgB,kBAAkB,CAAC,WAAW,EAAE,MAAM,GAAG,MAAM,CAE9D"}
@@ -3,22 +3,13 @@ import os from 'node:os';
3
3
  import path from 'node:path';
4
4
  const AGENTPAY_DIR = path.join(os.homedir(), '.agentpay');
5
5
  const PRIMARY_DIR = path.join(AGENTPAY_DIR, 'agentbrowse');
6
- const LEGACY_DIR = path.join(AGENTPAY_DIR, 'solver');
7
6
  const PRIMARY_CONFIG_PATH = path.join(PRIMARY_DIR, 'config.json');
8
- const LEGACY_CONFIG_PATH = path.join(LEGACY_DIR, 'config.json');
9
7
  const PRIMARY_PROFILES_DIR = path.join(PRIMARY_DIR, 'profiles');
10
- const LEGACY_PROFILES_DIR = path.join(LEGACY_DIR, 'profiles');
11
- const DEMO_PROXY_ENV = 'AGENTBROWSE_DEMO_PROXY';
8
+ const DEMO_PROXY_PLACEHOLDER = 'http://user:pass@31.98.19.10:6186/';
12
9
  export function getSolverDir() {
13
10
  return PRIMARY_DIR;
14
11
  }
15
12
  export function getProfilesDir() {
16
- if (fs.existsSync(PRIMARY_PROFILES_DIR)) {
17
- return PRIMARY_PROFILES_DIR;
18
- }
19
- if (fs.existsSync(LEGACY_PROFILES_DIR)) {
20
- return LEGACY_PROFILES_DIR;
21
- }
22
13
  return PRIMARY_PROFILES_DIR;
23
14
  }
24
15
  export function getConfigPath() {
@@ -33,33 +24,30 @@ export function readConfig() {
33
24
  return JSON.parse(raw);
34
25
  }
35
26
  catch {
36
- try {
37
- const raw = fs.readFileSync(LEGACY_CONFIG_PATH, 'utf-8');
38
- return JSON.parse(raw);
39
- }
40
- catch {
41
- return {};
42
- }
27
+ return {};
43
28
  }
44
29
  }
45
30
  export function writeConfig(config) {
46
31
  ensureDirs();
47
32
  fs.writeFileSync(PRIMARY_CONFIG_PATH, JSON.stringify(config, null, 2) + '\n', 'utf-8');
48
33
  }
49
- export function applyDemoProxyBootstrapFromEnv() {
50
- const demoProxy = process.env[DEMO_PROXY_ENV]?.trim();
51
- if (!demoProxy) {
34
+ export function applyDemoProxyBootstrap() {
35
+ const existingProxy = readConfig().defaults?.proxy;
36
+ if (typeof existingProxy === 'string' && existingProxy.trim().length > 0) {
52
37
  return false;
53
38
  }
54
- const current = readConfig();
55
- if (current.defaults?.proxy === demoProxy) {
39
+ if (existingProxy &&
40
+ typeof existingProxy === 'object' &&
41
+ typeof existingProxy.server === 'string' &&
42
+ existingProxy.server.trim().length > 0) {
56
43
  return false;
57
44
  }
45
+ const current = readConfig();
58
46
  writeConfig({
59
47
  ...current,
60
48
  defaults: {
61
49
  ...current.defaults,
62
- proxy: demoProxy,
50
+ proxy: DEMO_PROXY_PLACEHOLDER,
63
51
  },
64
52
  });
65
53
  return true;
@@ -72,10 +60,6 @@ export function getExistingProfileDir(profileName) {
72
60
  if (fs.existsSync(primary)) {
73
61
  return primary;
74
62
  }
75
- const legacy = path.join(LEGACY_PROFILES_DIR, profileName);
76
- if (fs.existsSync(legacy)) {
77
- return legacy;
78
- }
79
63
  return null;
80
64
  }
81
65
  export function getUserDataDir(profileName) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@nuanu-ai/agentbrowse",
3
- "version": "0.2.33",
3
+ "version": "0.2.35",
4
4
  "type": "module",
5
5
  "description": "Browser automation CLI for AI agents: control a CDP browser, observe UI surfaces, act on refs, extract data, capture screenshots, complete protected fills, and solve captchas",
6
6
  "keywords": [