dank-ai 1.0.11 → 1.0.13

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 CHANGED
@@ -1,9 +1,16 @@
1
+ <div align="center">
2
+ <img src="assets/danklarge.png" alt="Dank Logo" width="400">
3
+ </div>
4
+
1
5
  # 🚀 Dank Agent Service
2
6
 
3
7
  **Docker-based AI Agent Orchestration Platform**
4
8
 
5
9
  Dank is a powerful Node.js service that allows you to define, deploy, and manage AI agents using Docker containers. Each agent runs in its own isolated environment with configurable resources, LLM providers, and custom handlers. Built for production with comprehensive CI/CD support and Docker registry integration.
6
10
 
11
+ 🌐 **Website**: [https://dank-ai.xyz](https://dank-ai.xyz)
12
+ 📦 **NPM Package**: [https://www.npmjs.com/package/dank-ai](https://www.npmjs.com/package/dank-ai)
13
+
7
14
  ## ✨ Features
8
15
 
9
16
  - **🤖 Multi-LLM Support**: OpenAI, Anthropic, Cohere, Ollama, and custom providers
@@ -97,10 +104,6 @@ module.exports = {
97
104
  # Build agent images (base image is pulled automatically)
98
105
  dank build
99
106
 
100
- # Or build only the base image
101
- dank build --base
102
- ```
103
-
104
107
  ### 6. Start your agents
105
108
  ```bash
106
109
  # Start all agents
@@ -132,16 +132,58 @@ class DockerManager {
132
132
  async installDockerMacOS() {
133
133
  this.logger.info('Installing Docker Desktop for macOS...');
134
134
 
135
- // Check if Homebrew is available
135
+ // Check if Homebrew is available with multiple methods
136
+ let homebrewAvailable = false;
137
+ let homebrewPath = 'brew';
138
+
136
139
  try {
137
- await execAsync('which brew');
138
- this.logger.info('Using Homebrew to install Docker Desktop...');
139
-
140
- // Install Docker Desktop via Homebrew
141
- await this.runCommand('brew install --cask docker', 'Installing Docker Desktop via Homebrew');
142
-
140
+ // Try different ways to detect Homebrew
141
+ await execAsync('brew --version');
142
+ homebrewAvailable = true;
143
+ homebrewPath = 'brew';
143
144
  } catch (error) {
145
+ try {
146
+ // Try with full path (Apple Silicon Macs)
147
+ await execAsync('/opt/homebrew/bin/brew --version');
148
+ homebrewAvailable = true;
149
+ homebrewPath = '/opt/homebrew/bin/brew';
150
+ } catch (error2) {
151
+ try {
152
+ // Try with usr/local path (Intel Macs)
153
+ await execAsync('/usr/local/bin/brew --version');
154
+ homebrewAvailable = true;
155
+ homebrewPath = '/usr/local/bin/brew';
156
+ } catch (error3) {
157
+ // Try to find brew in PATH
158
+ try {
159
+ const { stdout } = await execAsync('which brew');
160
+ if (stdout.trim()) {
161
+ await execAsync(`${stdout.trim()} --version`);
162
+ homebrewAvailable = true;
163
+ homebrewPath = stdout.trim();
164
+ }
165
+ } catch (error4) {
166
+ // Homebrew not found
167
+ this.logger.debug('Homebrew detection failed:', error4.message);
168
+ }
169
+ }
170
+ }
171
+ }
172
+
173
+ if (homebrewAvailable) {
174
+ this.logger.info(`Using Homebrew to install Docker Desktop (found at: ${homebrewPath})...`);
175
+
176
+ try {
177
+ // Use the detected Homebrew path
178
+ await this.runCommand(`${homebrewPath} install --cask docker`, 'Installing Docker Desktop via Homebrew');
179
+ } catch (error) {
180
+ this.logger.warn('Homebrew found but installation failed. Please install Docker Desktop manually from https://www.docker.com/products/docker-desktop/');
181
+ this.logger.error(`Installation error: ${error.message}`);
182
+ throw new Error('Docker Desktop installation via Homebrew failed. Please install manually from https://www.docker.com/products/docker-desktop/');
183
+ }
184
+ } else {
144
185
  this.logger.warn('Homebrew not found. Please install Docker Desktop manually from https://www.docker.com/products/docker-desktop/');
186
+ this.logger.info('You can install Homebrew by running: /bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"');
145
187
  throw new Error('Docker Desktop installation requires manual intervention. Please install from https://www.docker.com/products/docker-desktop/');
146
188
  }
147
189
  }
@@ -171,7 +213,7 @@ class DockerManager {
171
213
  // Install Docker
172
214
  await this.runCommand('sudo apt-get install -y docker-ce docker-ce-cli containerd.io', 'Installing Docker');
173
215
 
174
- // Add current user to docker group
216
+ // Add current user to docker groupl
175
217
  await this.runCommand('sudo usermod -aG docker $USER', 'Adding user to docker group');
176
218
 
177
219
  this.logger.info('Docker installation completed. You may need to log out and back in for group changes to take effect.');
@@ -258,6 +300,7 @@ class DockerManager {
258
300
  */
259
301
  async runCommand(command, description) {
260
302
  this.logger.info(`${description}...`);
303
+ this.logger.debug(`Executing command: ${command}`);
261
304
 
262
305
  return new Promise((resolve, reject) => {
263
306
  const child = spawn('sh', ['-c', command], {
@@ -269,11 +312,17 @@ class DockerManager {
269
312
  let stderr = '';
270
313
 
271
314
  child.stdout.on('data', (data) => {
272
- stdout += data.toString();
315
+ const output = data.toString();
316
+ stdout += output;
317
+ // Log output in debug mode
318
+ this.logger.debug(`STDOUT: ${output.trim()}`);
273
319
  });
274
320
 
275
321
  child.stderr.on('data', (data) => {
276
- stderr += data.toString();
322
+ const output = data.toString();
323
+ stderr += output;
324
+ // Log stderr in debug mode
325
+ this.logger.debug(`STDERR: ${output.trim()}`);
277
326
  });
278
327
 
279
328
  child.on('close', (code) => {
@@ -283,12 +332,16 @@ class DockerManager {
283
332
  } else {
284
333
  const error = new Error(`Command failed with exit code ${code}: ${stderr}`);
285
334
  this.logger.error(`${description} failed: ${error.message}`);
335
+ this.logger.error(`Command: ${command}`);
336
+ this.logger.error(`STDOUT: ${stdout}`);
337
+ this.logger.error(`STDERR: ${stderr}`);
286
338
  reject(error);
287
339
  }
288
340
  });
289
341
 
290
342
  child.on('error', (error) => {
291
343
  this.logger.error(`${description} failed: ${error.message}`);
344
+ this.logger.error(`Command: ${command}`);
292
345
  reject(error);
293
346
  });
294
347
  });
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "dank-ai",
3
- "version": "1.0.11",
3
+ "version": "1.0.13",
4
4
  "description": "Dank Agent Service - Docker-based AI agent orchestration platform",
5
5
  "main": "lib/index.js",
6
6
  "exports": {
@@ -19,6 +19,7 @@
19
19
  "docker:build-base": "docker build -t dank-agent-base -f docker/Dockerfile.base ."
20
20
  },
21
21
  "dependencies": {
22
+ "axios": "^1.7.9",
22
23
  "commander": "^11.0.0",
23
24
  "chalk": "^4.1.2",
24
25
  "dockerode": "^4.0.0",