recker 1.0.92 → 1.0.93

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.
@@ -3,4 +3,7 @@ export declare function getCurlPath(): string;
3
3
  export declare function getLegacyCurlPath(): string;
4
4
  export declare function resolveCurlPath(): Promise<string | null>;
5
5
  export declare function hasImpersonate(): Promise<boolean>;
6
+ export declare function ensureCurlImpersonate(logger?: {
7
+ log: (...args: any[]) => void;
8
+ }): Promise<boolean>;
6
9
  export declare function installCurlImpersonate(logger?: Console): Promise<void>;
@@ -84,6 +84,19 @@ function getDownloadUrl() {
84
84
  }
85
85
  throw new Error(`Unsupported platform: ${p} ${a}`);
86
86
  }
87
+ export async function ensureCurlImpersonate(logger) {
88
+ if (await resolveCurlPath())
89
+ return true;
90
+ const log = logger ?? { log: () => { } };
91
+ try {
92
+ log.log('recker: curl-impersonate not found, installing...');
93
+ await installCurlImpersonate(log);
94
+ return true;
95
+ }
96
+ catch {
97
+ return false;
98
+ }
99
+ }
87
100
  export async function installCurlImpersonate(logger = console) {
88
101
  const url = getDownloadUrl();
89
102
  const tarPath = join(PACKAGE_BIN_DIR, 'curl-impersonate.tar.gz');
package/dist/cli/index.js CHANGED
@@ -51,6 +51,9 @@ async function main() {
51
51
  const { handleRequest } = await import('./handler.js');
52
52
  const { resolvePreset } = await import('./presets.js');
53
53
  const presets = await import('../presets/index.js');
54
+ import('../utils/binary-manager.js')
55
+ .then(({ ensureCurlImpersonate }) => ensureCurlImpersonate(console))
56
+ .catch(() => { });
54
57
  const version = await getVersion();
55
58
  function parseMixedArgs(args, initialClientOptions = {}) {
56
59
  const headers = { ...initialClientOptions.headers };
@@ -286,7 +289,18 @@ ${formatColumns(PRESET_NAMES, { prefix: '@', indent: 2, minWidth: 16, transform:
286
289
  process.exit(1);
287
290
  }
288
291
  });
289
- program.command('version').alias('info').action(async () => {
292
+ program.command('version').alias('info').action(async (args) => {
293
+ const { getVersionInfo } = await import('../version.js');
294
+ const info = await getVersionInfo();
295
+ if (args.includes('short')) {
296
+ console.log(info.version);
297
+ return;
298
+ }
299
+ const formatArg = args.find(a => a.startsWith('format='));
300
+ if (formatArg?.split('=')[1] === 'json') {
301
+ console.log(JSON.stringify(info, null, 2));
302
+ return;
303
+ }
290
304
  const versionInfo = await formatVersionInfo(true);
291
305
  console.log(theme.brand('recker') + ' ' + theme.version(version));
292
306
  console.log(theme.muted(versionInfo));
@@ -6,7 +6,6 @@ const KEYWORD_MAP = {
6
6
  quiet: '--quiet',
7
7
  json: '--json',
8
8
  help: '--help',
9
- version: '--version',
10
9
  secure: '--secure',
11
10
  implicit: '--implicit',
12
11
  };
@@ -3,4 +3,7 @@ export declare function getCurlPath(): string;
3
3
  export declare function getLegacyCurlPath(): string;
4
4
  export declare function resolveCurlPath(): Promise<string | null>;
5
5
  export declare function hasImpersonate(): Promise<boolean>;
6
+ export declare function ensureCurlImpersonate(logger?: {
7
+ log: (...args: any[]) => void;
8
+ }): Promise<boolean>;
6
9
  export declare function installCurlImpersonate(logger?: Console): Promise<void>;
@@ -84,6 +84,19 @@ function getDownloadUrl() {
84
84
  }
85
85
  throw new Error(`Unsupported platform: ${p} ${a}`);
86
86
  }
87
+ export async function ensureCurlImpersonate(logger) {
88
+ if (await resolveCurlPath())
89
+ return true;
90
+ const log = logger ?? { log: () => { } };
91
+ try {
92
+ log.log('recker: curl-impersonate not found, installing...');
93
+ await installCurlImpersonate(log);
94
+ return true;
95
+ }
96
+ catch {
97
+ return false;
98
+ }
99
+ }
87
100
  export async function installCurlImpersonate(logger = console) {
88
101
  const url = getDownloadUrl();
89
102
  const tarPath = join(PACKAGE_BIN_DIR, 'curl-impersonate.tar.gz');
package/dist/version.js CHANGED
@@ -1,4 +1,4 @@
1
- const VERSION = '1.0.92';
1
+ const VERSION = '1.0.93';
2
2
  let _version = null;
3
3
  export async function getVersion() {
4
4
  if (_version)
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "recker",
3
- "version": "1.0.92",
3
+ "version": "1.0.93",
4
4
  "description": "Multi-Protocol SDK for the AI Era - HTTP, WebSocket, DNS, FTP, SFTP, Telnet, HLS unified with AI providers and MCP tools",
5
5
  "main": "./dist/index.js",
6
6
  "types": "./dist/index.d.ts",