@itz4blitz/agentful 1.4.0 → 1.4.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.
@@ -18,19 +18,39 @@ import { fileURLToPath } from 'url';
18
18
  const __filename = fileURLToPath(import.meta.url);
19
19
  const __dirname = path.dirname(__filename);
20
20
 
21
+ /**
22
+ * Check if file is a native binary (Mach-O, ELF, etc.) vs JavaScript
23
+ * @param {string} filePath - Path to file
24
+ * @returns {boolean} true if native binary
25
+ */
26
+ function isNativeBinary(filePath) {
27
+ try {
28
+ const magic = Buffer.alloc(4);
29
+ const fd = fs.openSync(filePath, 'r');
30
+ fs.readSync(fd, magic, 0, 4, 0);
31
+ fs.closeSync(fd);
32
+ const hex = magic.toString('hex');
33
+ return hex === 'cffaedfe' || hex === 'cafebabe' || hex === '7f454c46';
34
+ } catch {
35
+ return false;
36
+ }
37
+ }
38
+
21
39
  /**
22
40
  * Detect if TeammateTool is available in current Claude Code installation
23
41
  * Auto-enables if possible
24
42
  */
25
43
  export function detectTeammateTool() {
26
44
  try {
27
- // Find Claude Code installation
28
45
  const claudePath = findClaudeCodeBinary();
29
46
  if (!claudePath) {
30
47
  return { available: false, reason: 'Claude Code binary not found' };
31
48
  }
32
49
 
33
- // Read CLI content
50
+ if (isNativeBinary(claudePath)) {
51
+ return { available: false, reason: 'Native binary detected - patching not supported', isNative: true };
52
+ }
53
+
34
54
  const cliContent = fs.readFileSync(claudePath, 'utf8');
35
55
 
36
56
  // Check for TeammateTool presence
@@ -130,6 +150,10 @@ export function enableTeammateTool() {
130
150
  throw new Error('Claude Code binary not found');
131
151
  }
132
152
 
153
+ if (isNativeBinary(claudePath)) {
154
+ return { success: false, error: 'Native binary detected - patching not supported. TeammateTool patching only works with npm-installed Claude Code.' };
155
+ }
156
+
133
157
  // Backup original
134
158
  const backupPath = `${claudePath}.backup-${Date.now()}`;
135
159
  fs.copyFileSync(claudePath, backupPath);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@itz4blitz/agentful",
3
- "version": "1.4.0",
3
+ "version": "1.4.1",
4
4
  "description": "Pre-configured AI toolkit with self-hosted execution - works with any LLM, any tech stack, any platform.",
5
5
  "type": "module",
6
6
  "bin": {
package/version.json CHANGED
@@ -1,3 +1,3 @@
1
1
  {
2
- "version": "1.3.0"
2
+ "version": "1.4.0"
3
3
  }