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.
- package/dist/browser/utils/binary-manager.d.ts +3 -0
- package/dist/browser/utils/binary-manager.js +13 -0
- package/dist/cli/index.js +15 -1
- package/dist/cli/router.js +0 -1
- package/dist/utils/binary-manager.d.ts +3 -0
- package/dist/utils/binary-manager.js +13 -0
- package/dist/version.js +1 -1
- package/package.json +1 -1
|
@@ -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));
|
package/dist/cli/router.js
CHANGED
|
@@ -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
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "recker",
|
|
3
|
-
"version": "1.0.
|
|
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",
|