superduck-cli 0.2.4 → 0.2.6
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/README.md +1 -1
- package/SKILL.md +1 -1
- package/bin/superduck.js +27 -2
- package/package.json +5 -5
package/README.md
CHANGED
package/SKILL.md
CHANGED
|
@@ -45,7 +45,7 @@ superduck log --tail 20 # ~/.superduck/audit.jsonl
|
|
|
45
45
|
If the `superduck` command is not found, it can be installed with:
|
|
46
46
|
|
|
47
47
|
```bash
|
|
48
|
-
npm install -g superduck
|
|
48
|
+
npm install -g superduck-cli
|
|
49
49
|
superduck setup # registers the native messaging manifest
|
|
50
50
|
```
|
|
51
51
|
|
package/bin/superduck.js
CHANGED
|
@@ -8,6 +8,31 @@ const { platform, arch } = process;
|
|
|
8
8
|
const exeName = platform === "win32" ? "superduck.exe" : "superduck";
|
|
9
9
|
const pkg = `superduck-${platform}-${arch}`;
|
|
10
10
|
|
|
11
|
+
function randomHex(bytes) {
|
|
12
|
+
try {
|
|
13
|
+
return require("crypto").randomBytes(bytes).toString("hex");
|
|
14
|
+
} catch {
|
|
15
|
+
return `${Date.now()}${Math.random()}`.replace(/\D/g, "");
|
|
16
|
+
}
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
function ensureAnalyticsId() {
|
|
20
|
+
if (platform === "win32") return;
|
|
21
|
+
const home = process.env.HOME;
|
|
22
|
+
if (!home) return;
|
|
23
|
+
|
|
24
|
+
const dir = path.join(home, ".superduck");
|
|
25
|
+
const file = path.join(dir, "analytics-id");
|
|
26
|
+
try {
|
|
27
|
+
const existing = fs.existsSync(file) ? fs.readFileSync(file, "utf8").trim() : "";
|
|
28
|
+
if (existing.startsWith("sdid-")) return;
|
|
29
|
+
fs.mkdirSync(dir, { recursive: true, mode: 0o755 });
|
|
30
|
+
fs.writeFileSync(file, `sdid-${randomHex(16)}\n`, { mode: 0o600 });
|
|
31
|
+
} catch {
|
|
32
|
+
// Analytics identity is best-effort; install must never fail because of it.
|
|
33
|
+
}
|
|
34
|
+
}
|
|
35
|
+
|
|
11
36
|
let binPath;
|
|
12
37
|
try {
|
|
13
38
|
binPath = require.resolve(`${pkg}/bin/${exeName}`);
|
|
@@ -19,11 +44,11 @@ try {
|
|
|
19
44
|
if (!binPath) {
|
|
20
45
|
console.error(`superduck: no prebuilt binary found for ${platform}-${arch}.`);
|
|
21
46
|
console.error(`expected optional dependency '${pkg}'.`);
|
|
22
|
-
console.error(`if you are on a supported platform, try: npm install -g --force superduck`);
|
|
23
|
-
process.exit(127);
|
|
47
|
+
console.error(`if you are on a supported platform, try: npm install -g --force superduck-cli`); process.exit(127);
|
|
24
48
|
}
|
|
25
49
|
|
|
26
50
|
if (process.argv[2] === "--postinstall") {
|
|
51
|
+
ensureAnalyticsId();
|
|
27
52
|
try {
|
|
28
53
|
if (platform !== "win32") fs.chmodSync(binPath, 0o755);
|
|
29
54
|
} catch (e) {}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "superduck-cli",
|
|
3
|
-
"version": "0.2.
|
|
3
|
+
"version": "0.2.6",
|
|
4
4
|
"description": "Your browser's session, callable as a tool. CLI bridge from Claude Code/Codex/etc to your active Chrome tab.",
|
|
5
5
|
"bin": {
|
|
6
6
|
"superduck": "bin/superduck.js"
|
|
@@ -14,10 +14,10 @@
|
|
|
14
14
|
"postinstall": "node bin/superduck.js --postinstall || true"
|
|
15
15
|
},
|
|
16
16
|
"optionalDependencies": {
|
|
17
|
-
"superduck-darwin-arm64": "0.2.
|
|
18
|
-
"superduck-darwin-x64": "0.2.
|
|
19
|
-
"superduck-linux-arm64": "0.2.
|
|
20
|
-
"superduck-linux-x64": "0.2.
|
|
17
|
+
"superduck-darwin-arm64": "0.2.6",
|
|
18
|
+
"superduck-darwin-x64": "0.2.6",
|
|
19
|
+
"superduck-linux-arm64": "0.2.6",
|
|
20
|
+
"superduck-linux-x64": "0.2.6"
|
|
21
21
|
},
|
|
22
22
|
"engines": {
|
|
23
23
|
"node": ">=16"
|