reddit-demand-kit 0.1.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/bin/rdk.js +35 -0
- package/lib/platform.js +30 -0
- package/package.json +31 -0
package/bin/rdk.js
ADDED
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
// reddit-demand-kit — bin shim.
|
|
3
|
+
// Forwards CLI args to the platform-specific rdk binary installed via
|
|
4
|
+
// optionalDependencies. Exit code propagates from the child process.
|
|
5
|
+
|
|
6
|
+
"use strict";
|
|
7
|
+
|
|
8
|
+
const { execFileSync } = require("child_process");
|
|
9
|
+
const { getBinaryPackage } = require("../lib/platform.js");
|
|
10
|
+
|
|
11
|
+
let pkgName;
|
|
12
|
+
try {
|
|
13
|
+
pkgName = getBinaryPackage(process.platform, process.arch);
|
|
14
|
+
} catch (e) {
|
|
15
|
+
console.error(e.message);
|
|
16
|
+
process.exit(1);
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
const binaryName = process.platform === "win32" ? "rdk.exe" : "rdk";
|
|
20
|
+
|
|
21
|
+
let binaryPath;
|
|
22
|
+
try {
|
|
23
|
+
binaryPath = require.resolve(`${pkgName}/bin/${binaryName}`);
|
|
24
|
+
} catch (_e) {
|
|
25
|
+
console.error(`rdk binary not found in ${pkgName}.`);
|
|
26
|
+
console.error(`This usually means the platform package was skipped during install.`);
|
|
27
|
+
console.error(`Try: npm install ${pkgName} --no-save`);
|
|
28
|
+
process.exit(1);
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
try {
|
|
32
|
+
execFileSync(binaryPath, process.argv.slice(2), { stdio: "inherit" });
|
|
33
|
+
} catch (e) {
|
|
34
|
+
process.exit(typeof e.status === "number" ? e.status : 1);
|
|
35
|
+
}
|
package/lib/platform.js
ADDED
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
// reddit-demand-kit — platform resolution.
|
|
2
|
+
//
|
|
3
|
+
// Pure CommonJS. Adding a new platform requires:
|
|
4
|
+
// 1. New entry in SUPPORTED below
|
|
5
|
+
// 2. New optionalDependency in npm/cli/package.json
|
|
6
|
+
// 3. New directory npm/cli-<key>/ with package.json (matching os + cpu)
|
|
7
|
+
// 4. New deno compile target in scripts/build-all.sh
|
|
8
|
+
|
|
9
|
+
const SUPPORTED = {
|
|
10
|
+
"darwin-arm64": "@taprun/rdk-darwin-arm64",
|
|
11
|
+
"darwin-x64": "@taprun/rdk-darwin-x64",
|
|
12
|
+
"linux-x64": "@taprun/rdk-linux-x64",
|
|
13
|
+
"win32-x64": "@taprun/rdk-win32-x64",
|
|
14
|
+
};
|
|
15
|
+
|
|
16
|
+
function getBinaryPackage(platform, arch) {
|
|
17
|
+
const key = `${platform}-${arch}`;
|
|
18
|
+
const pkg = SUPPORTED[key];
|
|
19
|
+
if (!pkg) {
|
|
20
|
+
const supportedList = Object.keys(SUPPORTED).join(", ");
|
|
21
|
+
throw new Error(
|
|
22
|
+
`reddit-demand-kit does not support platform "${key}". ` +
|
|
23
|
+
`Supported: ${supportedList}. ` +
|
|
24
|
+
`Open an issue at https://github.com/AINativeLab/reddit-demand-kit/issues`
|
|
25
|
+
);
|
|
26
|
+
}
|
|
27
|
+
return pkg;
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
module.exports = { getBinaryPackage, SUPPORTED };
|
package/package.json
ADDED
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "reddit-demand-kit",
|
|
3
|
+
"version": "0.1.0",
|
|
4
|
+
"description": "MCP-first demand intelligence for Reddit. Discover pain points, track competitors, find what's worth building.",
|
|
5
|
+
"homepage": "https://rdk.taprun.dev",
|
|
6
|
+
"repository": {
|
|
7
|
+
"type": "git",
|
|
8
|
+
"url": "git+https://github.com/AINativeLab/reddit-demand-kit.git"
|
|
9
|
+
},
|
|
10
|
+
"license": "UNLICENSED",
|
|
11
|
+
"bin": {
|
|
12
|
+
"rdk": "bin/rdk.js"
|
|
13
|
+
},
|
|
14
|
+
"files": [
|
|
15
|
+
"bin",
|
|
16
|
+
"lib",
|
|
17
|
+
"README.md"
|
|
18
|
+
],
|
|
19
|
+
"engines": {
|
|
20
|
+
"node": ">=16"
|
|
21
|
+
},
|
|
22
|
+
"publishConfig": {
|
|
23
|
+
"access": "public"
|
|
24
|
+
},
|
|
25
|
+
"optionalDependencies": {
|
|
26
|
+
"@taprun/rdk-darwin-arm64": "0.1.0",
|
|
27
|
+
"@taprun/rdk-darwin-x64": "0.1.0",
|
|
28
|
+
"@taprun/rdk-linux-x64": "0.1.0",
|
|
29
|
+
"@taprun/rdk-win32-x64": "0.1.0"
|
|
30
|
+
}
|
|
31
|
+
}
|