@_xtribe/cli 2.1.9 → 2.2.0

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.
Files changed (2) hide show
  1. package/install-tribe.js +38 -8
  2. package/package.json +1 -1
package/install-tribe.js CHANGED
@@ -24,14 +24,29 @@ const arch = os.arch() === 'x64' ? 'amd64' : (os.arch() === 'arm64' ? 'arm64' :
24
24
  const homeDir = os.homedir();
25
25
  const tribeDir = path.join(homeDir, '.tribe');
26
26
  const tribeBinDir = path.join(tribeDir, 'bin');
27
-
28
- // Ensure directories exist
29
- if (!fs.existsSync(tribeDir)) {
30
- fs.mkdirSync(tribeDir, { recursive: true });
31
- }
32
- if (!fs.existsSync(tribeBinDir)) {
33
- fs.mkdirSync(tribeBinDir, { recursive: true });
34
- }
27
+ const tutorDir = path.join(tribeDir, 'tutor');
28
+ const logsDir = path.join(tribeDir, 'logs');
29
+
30
+ // Ensure all directories exist with proper permissions (700)
31
+ const directories = [
32
+ { path: tribeDir, name: 'base' },
33
+ { path: tribeBinDir, name: 'bin' },
34
+ { path: tutorDir, name: 'tutor' },
35
+ { path: logsDir, name: 'logs' }
36
+ ];
37
+
38
+ directories.forEach(({ path: dirPath, name }) => {
39
+ if (!fs.existsSync(dirPath)) {
40
+ fs.mkdirSync(dirPath, { recursive: true, mode: 0o700 });
41
+ } else {
42
+ // Fix permissions if directory already exists
43
+ try {
44
+ fs.chmodSync(dirPath, 0o700);
45
+ } catch (err) {
46
+ // Ignore permission errors on some systems
47
+ }
48
+ }
49
+ });
35
50
 
36
51
  function showWelcome() {
37
52
  console.clear();
@@ -116,10 +131,25 @@ async function installTribeCLIQuiet() {
116
131
  await downloadFile(downloadUrl, tribeDest);
117
132
  fs.chmodSync(tribeDest, '755');
118
133
 
134
+ // Also download tutor-collector binary
135
+ const tutorCollectorDest = path.join(tribeBinDir, 'tutor-collector');
136
+ const tutorCollectorUrl = `https://github.com/${githubRepo}/releases/latest/download/tutor-collector-${platform}-${arch}`;
137
+
138
+ try {
139
+ await downloadFile(tutorCollectorUrl, tutorCollectorDest);
140
+ fs.chmodSync(tutorCollectorDest, '755');
141
+ } catch (tutorError) {
142
+ // Tutor collector is optional for basic CLI functionality
143
+ console.warn('Warning: Could not download tutor-collector binary');
144
+ }
145
+
119
146
  // Remove macOS quarantine if needed
120
147
  if (platform === 'darwin') {
121
148
  try {
122
149
  execSync(`xattr -d com.apple.quarantine "${tribeDest}"`, { stdio: 'ignore' });
150
+ if (fs.existsSync(tutorCollectorDest)) {
151
+ execSync(`xattr -d com.apple.quarantine "${tutorCollectorDest}"`, { stdio: 'ignore' });
152
+ }
123
153
  } catch {
124
154
  // Not critical
125
155
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@_xtribe/cli",
3
- "version": "2.1.9",
3
+ "version": "2.2.0",
4
4
  "description": "TRIBE - Track, measure and optimize your AI coding agents to become 10x faster",
5
5
  "main": "install-tribe.js",
6
6
  "bin": {