duduclaw 1.3.23
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/duduclaw +45 -0
- package/package.json +36 -0
- package/scripts/install.js +33 -0
package/bin/duduclaw
ADDED
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
|
|
3
|
+
"use strict";
|
|
4
|
+
|
|
5
|
+
const { spawnSync } = require("child_process");
|
|
6
|
+
const path = require("path");
|
|
7
|
+
|
|
8
|
+
const PLATFORM_PACKAGES = {
|
|
9
|
+
"darwin-arm64": "@duduclaw/darwin-arm64",
|
|
10
|
+
"darwin-x64": "@duduclaw/darwin-x64",
|
|
11
|
+
"linux-x64": "@duduclaw/linux-x64",
|
|
12
|
+
"linux-arm64": "@duduclaw/linux-arm64",
|
|
13
|
+
};
|
|
14
|
+
|
|
15
|
+
function getBinaryPath() {
|
|
16
|
+
const key = `${process.platform}-${process.arch}`;
|
|
17
|
+
const pkg = PLATFORM_PACKAGES[key];
|
|
18
|
+
if (!pkg) {
|
|
19
|
+
throw new Error(
|
|
20
|
+
`DuDuClaw does not support ${process.platform}-${process.arch} yet.`
|
|
21
|
+
);
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
try {
|
|
25
|
+
const pkgDir = path.dirname(require.resolve(`${pkg}/package.json`));
|
|
26
|
+
return path.join(pkgDir, "bin", "duduclaw");
|
|
27
|
+
} catch {
|
|
28
|
+
throw new Error(
|
|
29
|
+
`Could not find ${pkg}. Please reinstall duduclaw:\n npm install -g duduclaw`
|
|
30
|
+
);
|
|
31
|
+
}
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
const binPath = getBinaryPath();
|
|
35
|
+
const result = spawnSync(binPath, process.argv.slice(2), {
|
|
36
|
+
stdio: "inherit",
|
|
37
|
+
env: process.env,
|
|
38
|
+
});
|
|
39
|
+
|
|
40
|
+
if (result.error) {
|
|
41
|
+
console.error(`Failed to run DuDuClaw: ${result.error.message}`);
|
|
42
|
+
process.exit(1);
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
process.exit(result.status ?? 1);
|
package/package.json
ADDED
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "duduclaw",
|
|
3
|
+
"version": "1.3.23",
|
|
4
|
+
"description": "DuDuClaw — Multi-Agent AI Assistant Platform (Community Edition)",
|
|
5
|
+
"license": "Apache-2.0",
|
|
6
|
+
"repository": {
|
|
7
|
+
"type": "git",
|
|
8
|
+
"url": "https://github.com/zhixuli0406/DuDuClaw.git",
|
|
9
|
+
"directory": "npm/duduclaw"
|
|
10
|
+
},
|
|
11
|
+
"homepage": "https://github.com/zhixuli0406/DuDuClaw",
|
|
12
|
+
"keywords": [
|
|
13
|
+
"ai",
|
|
14
|
+
"agent",
|
|
15
|
+
"claude",
|
|
16
|
+
"multi-agent",
|
|
17
|
+
"assistant",
|
|
18
|
+
"duduclaw"
|
|
19
|
+
],
|
|
20
|
+
"bin": {
|
|
21
|
+
"duduclaw": "bin/duduclaw"
|
|
22
|
+
},
|
|
23
|
+
"files": [
|
|
24
|
+
"bin",
|
|
25
|
+
"scripts"
|
|
26
|
+
],
|
|
27
|
+
"scripts": {
|
|
28
|
+
"postinstall": "node scripts/install.js"
|
|
29
|
+
},
|
|
30
|
+
"optionalDependencies": {
|
|
31
|
+
"@duduclaw/darwin-arm64": "1.3.23",
|
|
32
|
+
"@duduclaw/darwin-x64": "1.3.23",
|
|
33
|
+
"@duduclaw/linux-x64": "1.3.23",
|
|
34
|
+
"@duduclaw/linux-arm64": "1.3.23"
|
|
35
|
+
}
|
|
36
|
+
}
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
// Verify the platform-specific binary was installed via optionalDependencies.
|
|
4
|
+
// If not, print a helpful message. The binary itself is in the platform package.
|
|
5
|
+
|
|
6
|
+
const PLATFORM_PACKAGES = {
|
|
7
|
+
"darwin-arm64": "@duduclaw/darwin-arm64",
|
|
8
|
+
"darwin-x64": "@duduclaw/darwin-x64",
|
|
9
|
+
"linux-x64": "@duduclaw/linux-x64",
|
|
10
|
+
"linux-arm64": "@duduclaw/linux-arm64",
|
|
11
|
+
};
|
|
12
|
+
|
|
13
|
+
const key = `${process.platform}-${process.arch}`;
|
|
14
|
+
const pkg = PLATFORM_PACKAGES[key];
|
|
15
|
+
|
|
16
|
+
if (!pkg) {
|
|
17
|
+
console.warn(
|
|
18
|
+
`\n[duduclaw] Warning: unsupported platform ${key}.\n` +
|
|
19
|
+
`Supported: darwin-arm64, darwin-x64, linux-x64, linux-arm64.\n` +
|
|
20
|
+
`You can install from source: https://github.com/zhixuli0406/DuDuClaw\n`
|
|
21
|
+
);
|
|
22
|
+
process.exit(0);
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
try {
|
|
26
|
+
require.resolve(`${pkg}/package.json`);
|
|
27
|
+
} catch {
|
|
28
|
+
console.warn(
|
|
29
|
+
`\n[duduclaw] Warning: platform package ${pkg} was not installed.\n` +
|
|
30
|
+
`This may happen with --no-optional. Try:\n` +
|
|
31
|
+
` npm install -g duduclaw\n`
|
|
32
|
+
);
|
|
33
|
+
}
|