@duckmind/duckmind 1.0.1

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/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2025 deepquark
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
package/README.md ADDED
@@ -0,0 +1,16 @@
1
+ <p align="center"><code>npm i -g @duckmind/duckmind@latest</code></p>
2
+ <p align="center"><strong>DuckMind</strong> is designed as an **AI coworker** that runs on your computer.
3
+ It can handle complex tasks, break them into smaller steps, and execute them sequentially until the job is completed.
4
+ </p>
5
+
6
+ ---
7
+
8
+ ## Quickstart
9
+
10
+ ### Installing and running DuckMind CLI
11
+
12
+ Install globally with npm:
13
+
14
+ ```shell
15
+ npm install -g @duckmind/duckmind@latest
16
+ ```
@@ -0,0 +1,140 @@
1
+ #!/usr/bin/env node
2
+ // Unified entry point for the DuckMind CLI.
3
+
4
+ import { spawn } from "node:child_process";
5
+ import { accessSync, constants } from "node:fs";
6
+ import { createRequire } from "node:module";
7
+ import path from "node:path";
8
+ import { fileURLToPath } from "node:url";
9
+
10
+ const __filename = fileURLToPath(import.meta.url);
11
+ const __dirname = path.dirname(__filename);
12
+ const require = createRequire(import.meta.url);
13
+
14
+ const PLATFORM_PACKAGE_BY_TARGET = {
15
+ "x86_64-unknown-linux-musl": "@duckmind/duckmind-linux-x64",
16
+ "aarch64-apple-darwin": "@duckmind/duckmind-darwin-arm64",
17
+ };
18
+
19
+ function resolveTargetTriple(platform, arch) {
20
+ switch (platform) {
21
+ case "linux":
22
+ case "android":
23
+ switch (arch) {
24
+ case "x64":
25
+ return "x86_64-unknown-linux-musl";
26
+ case "arm64":
27
+ return "aarch64-unknown-linux-musl";
28
+ default:
29
+ return null;
30
+ }
31
+ case "darwin":
32
+ switch (arch) {
33
+ case "x64":
34
+ return "x86_64-apple-darwin";
35
+ case "arm64":
36
+ return "aarch64-apple-darwin";
37
+ default:
38
+ return null;
39
+ }
40
+ case "win32":
41
+ switch (arch) {
42
+ case "x64":
43
+ return "x86_64-pc-windows-msvc";
44
+ case "arm64":
45
+ return "aarch64-pc-windows-msvc";
46
+ default:
47
+ return null;
48
+ }
49
+ default:
50
+ return null;
51
+ }
52
+ }
53
+
54
+ function detectPackageManager() {
55
+ const userAgent = process.env.npm_config_user_agent || "";
56
+ if (/\bbun\//.test(userAgent)) {
57
+ return "bun";
58
+ }
59
+ const execPath = process.env.npm_execpath || "";
60
+ if (execPath.includes("bun")) {
61
+ return "bun";
62
+ }
63
+ return userAgent ? "npm" : null;
64
+ }
65
+
66
+ function reinstallHint() {
67
+ return detectPackageManager() === "bun"
68
+ ? "bun install -g @duckmind/duckmind@latest"
69
+ : "npm install -g @duckmind/duckmind@latest";
70
+ }
71
+
72
+ const targetTriple = resolveTargetTriple(process.platform, process.arch);
73
+
74
+ if (!targetTriple) {
75
+ throw new Error(`Unsupported platform: ${process.platform} (${process.arch})`);
76
+ }
77
+
78
+ const platformPackage = PLATFORM_PACKAGE_BY_TARGET[targetTriple];
79
+ if (!platformPackage) {
80
+ throw new Error(`Unsupported target triple: ${targetTriple}`);
81
+ }
82
+
83
+ const binaryName = process.platform === "win32" ? "duckmind.exe" : "duckmind";
84
+
85
+ let binaryPath;
86
+ try {
87
+ const packageJsonPath = require.resolve(`${platformPackage}/package.json`);
88
+ const packageRoot = path.dirname(packageJsonPath);
89
+ binaryPath = path.join(packageRoot, "bin", binaryName);
90
+ accessSync(binaryPath, constants.X_OK);
91
+ } catch {
92
+ throw new Error(
93
+ `Missing optional dependency ${platformPackage}. Reinstall DuckMind: ${reinstallHint()}`
94
+ );
95
+ }
96
+
97
+ const manager = detectPackageManager();
98
+ const env = { ...process.env };
99
+ if (manager === "bun") {
100
+ env.DEEPQUARK_MANAGED_BY_BUN = "1";
101
+ } else {
102
+ env.DEEPQUARK_MANAGED_BY_NPM = "1";
103
+ }
104
+
105
+ const child = spawn(binaryPath, process.argv.slice(2), {
106
+ stdio: "inherit",
107
+ env,
108
+ });
109
+
110
+ child.on("error", (err) => {
111
+ console.error(err);
112
+ process.exit(1);
113
+ });
114
+
115
+ const forwardSignal = (signal) => {
116
+ if (child.killed) return;
117
+ try {
118
+ child.kill(signal);
119
+ } catch {}
120
+ };
121
+
122
+ ["SIGINT", "SIGTERM", "SIGHUP"].forEach((sig) => {
123
+ process.on(sig, () => forwardSignal(sig));
124
+ });
125
+
126
+ const childResult = await new Promise((resolve) => {
127
+ child.on("exit", (code, signal) => {
128
+ if (signal) {
129
+ resolve({ type: "signal", signal });
130
+ } else {
131
+ resolve({ type: "code", exitCode: code ?? 1 });
132
+ }
133
+ });
134
+ });
135
+
136
+ if (childResult.type === "signal") {
137
+ process.kill(process.pid, childResult.signal);
138
+ } else {
139
+ process.exit(childResult.exitCode);
140
+ }
package/bin/rg ADDED
@@ -0,0 +1,79 @@
1
+ #!/usr/bin/env dotslash
2
+
3
+ {
4
+ "name": "rg",
5
+ "platforms": {
6
+ "macos-aarch64": {
7
+ "size": 1777930,
8
+ "hash": "sha256",
9
+ "digest": "378e973289176ca0c6054054ee7f631a065874a352bf43f0fa60ef079b6ba715",
10
+ "format": "tar.gz",
11
+ "path": "ripgrep-15.1.0-aarch64-apple-darwin/rg",
12
+ "providers": [
13
+ {
14
+ "url": "https://github.com/BurntSushi/ripgrep/releases/download/15.1.0/ripgrep-15.1.0-aarch64-apple-darwin.tar.gz"
15
+ }
16
+ ]
17
+ },
18
+ "linux-aarch64": {
19
+ "size": 1869959,
20
+ "hash": "sha256",
21
+ "digest": "2b661c6ef508e902f388e9098d9c4c5aca72c87b55922d94abdba830b4dc885e",
22
+ "format": "tar.gz",
23
+ "path": "ripgrep-15.1.0-aarch64-unknown-linux-gnu/rg",
24
+ "providers": [
25
+ {
26
+ "url": "https://github.com/BurntSushi/ripgrep/releases/download/15.1.0/ripgrep-15.1.0-aarch64-unknown-linux-gnu.tar.gz"
27
+ }
28
+ ]
29
+ },
30
+ "macos-x86_64": {
31
+ "size": 1894127,
32
+ "hash": "sha256",
33
+ "digest": "64811cb24e77cac3057d6c40b63ac9becf9082eedd54ca411b475b755d334882",
34
+ "format": "tar.gz",
35
+ "path": "ripgrep-15.1.0-x86_64-apple-darwin/rg",
36
+ "providers": [
37
+ {
38
+ "url": "https://github.com/BurntSushi/ripgrep/releases/download/15.1.0/ripgrep-15.1.0-x86_64-apple-darwin.tar.gz"
39
+ }
40
+ ]
41
+ },
42
+ "linux-x86_64": {
43
+ "size": 2263077,
44
+ "hash": "sha256",
45
+ "digest": "1c9297be4a084eea7ecaedf93eb03d058d6faae29bbc57ecdaf5063921491599",
46
+ "format": "tar.gz",
47
+ "path": "ripgrep-15.1.0-x86_64-unknown-linux-musl/rg",
48
+ "providers": [
49
+ {
50
+ "url": "https://github.com/BurntSushi/ripgrep/releases/download/15.1.0/ripgrep-15.1.0-x86_64-unknown-linux-musl.tar.gz"
51
+ }
52
+ ]
53
+ },
54
+ "windows-x86_64": {
55
+ "size": 1810687,
56
+ "hash": "sha256",
57
+ "digest": "124510b94b6baa3380d051fdf4650eaa80a302c876d611e9dba0b2e18d87493a",
58
+ "format": "zip",
59
+ "path": "ripgrep-15.1.0-x86_64-pc-windows-msvc/rg.exe",
60
+ "providers": [
61
+ {
62
+ "url": "https://github.com/BurntSushi/ripgrep/releases/download/15.1.0/ripgrep-15.1.0-x86_64-pc-windows-msvc.zip"
63
+ }
64
+ ]
65
+ },
66
+ "windows-aarch64": {
67
+ "size": 1675460,
68
+ "hash": "sha256",
69
+ "digest": "00d931fb5237c9696ca49308818edb76d8eb6fc132761cb2a1bd616b2df02f8e",
70
+ "format": "zip",
71
+ "path": "ripgrep-15.1.0-aarch64-pc-windows-msvc/rg.exe",
72
+ "providers": [
73
+ {
74
+ "url": "https://github.com/BurntSushi/ripgrep/releases/download/15.1.0/ripgrep-15.1.0-aarch64-pc-windows-msvc.zip"
75
+ }
76
+ ]
77
+ }
78
+ }
79
+ }
package/package.json ADDED
@@ -0,0 +1,37 @@
1
+ {
2
+ "name": "@duckmind/duckmind",
3
+ "version": "1.0.1",
4
+ "license": "MIT",
5
+ "description": "DuckMind CLI - The power of agents at work ",
6
+ "bin": {
7
+ "duckmind": "bin/duckmind.js"
8
+ },
9
+ "type": "module",
10
+ "engines": {
11
+ "node": ">=16"
12
+ },
13
+ "files": [
14
+ "bin",
15
+ "README.md"
16
+ ],
17
+ "repository": {
18
+ "type": "git",
19
+ "url": "git+https://github.com/DuckMind/duckmind-cli.git",
20
+ "directory": "packages/duckmind"
21
+ },
22
+ "homepage": "https://duckmind.ai",
23
+ "bugs": {
24
+ "url": "https://duckmind.ai"
25
+ },
26
+ "keywords": [
27
+ "duckmind",
28
+ "cli",
29
+ "agent",
30
+ "ai",
31
+ "coding-agent"
32
+ ],
33
+ "optionalDependencies": {
34
+ "@duckmind/duckmind-linux-x64": "1.0.1",
35
+ "@duckmind/duckmind-darwin-arm64": "1.0.1"
36
+ }
37
+ }