@mandors/cli 0.0.10 → 0.0.11

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.
Binary file
Binary file
Binary file
Binary file
@@ -57,33 +57,40 @@ async function install(options = {}) {
57
57
  */
58
58
  function useBundledBinary(platform, arch) {
59
59
  const filename = `mandor-${platform}-${arch}`;
60
- // Tarball extracts to npm/binaries/ as just "mandor" (not in subdir)
61
- const bundledBinary = path.join(BUNDLE_DIR, 'mandor');
60
+ const tarball = path.join(BUNDLE_DIR, `${filename}.tar.gz`);
61
+ const cacheDir = path.join(os.homedir(), '.mandor', 'bin');
62
+ const dest = path.join(cacheDir, filename);
62
63
 
63
64
  console.log(`DEBUG: Looking for binary for ${platform}-${arch}`);
64
65
  console.log(`DEBUG: BUNDLE_DIR: ${BUNDLE_DIR}`);
65
66
  console.log(`DEBUG: Files in BUNDLE_DIR: ${fs.readdirSync(BUNDLE_DIR).join(', ')}`);
66
67
 
67
- if (!fs.existsSync(bundledBinary)) {
68
- console.log(`DEBUG: No bundled binary found at: ${bundledBinary}`);
68
+ // First check if binary already exists in cache
69
+ if (fs.existsSync(dest)) {
70
+ console.log(`DEBUG: Using cached binary: ${dest}`);
71
+ return dest;
72
+ }
73
+
74
+ // Check if tarball exists
75
+ if (!fs.existsSync(tarball)) {
76
+ console.log(`DEBUG: No tarball found at: ${tarball}`);
69
77
  return null;
70
78
  }
71
79
 
72
- console.log(`DEBUG: Found bundled binary: ${bundledBinary}`);
80
+ console.log(`DEBUG: Extracting tarball: ${tarball}`);
73
81
 
74
- const cacheDir = path.join(os.homedir(), '.mandor', 'bin');
75
82
  if (!fs.existsSync(cacheDir)) {
76
83
  fs.mkdirSync(cacheDir, { recursive: true });
77
84
  }
78
85
 
79
- const dest = path.join(cacheDir, filename);
80
-
81
86
  try {
82
- fs.copyFileSync(bundledBinary, dest);
87
+ const { execSync } = require('child_process');
88
+ execSync(`tar -xzf "${tarball}" -C "${cacheDir}"`, { stdio: 'pipe' });
83
89
  fs.chmodSync(dest, '755');
90
+ console.log(`DEBUG: Extracted to: ${dest}`);
84
91
  return dest;
85
92
  } catch (e) {
86
- console.log(`DEBUG: Failed to copy: ${e.message}`);
93
+ console.log(`DEBUG: Failed to extract tarball: ${e.message}`);
87
94
  return null;
88
95
  }
89
96
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@mandors/cli",
3
- "version": "0.0.10",
3
+ "version": "0.0.11",
4
4
  "description": "Event-based task manager CLI for AI agent workflows",
5
5
  "main": "npm/lib/index.js",
6
6
  "bin": {