octo-dev 0.4.2 → 0.4.3

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "octo-dev",
3
- "version": "0.4.2",
3
+ "version": "0.4.3",
4
4
  "description": "CLI for monorepo build orchestration, semantic versioning, and local infrastructure management",
5
5
  "type": "module",
6
6
  "license": "MIT",
package/src/cli/index.ts CHANGED
@@ -11,7 +11,7 @@ const program = new Command();
11
11
  program
12
12
  .name('octo')
13
13
  .description('Monorepo build orchestration, versioning, and infrastructure CLI')
14
- .version('0.4.2');
14
+ .version('0.4.3');
15
15
 
16
16
  program
17
17
  .command('init')
@@ -19,10 +19,29 @@ async function hasModel(model: string): Promise<boolean> {
19
19
  return result.stdout.includes(model);
20
20
  }
21
21
 
22
+ /**
23
+ * Ensures a system dependency is available, installing it if the user agrees.
24
+ */
25
+ async function ensureDependency(command: string, installCmd: string, name: string): Promise<boolean> {
26
+ const check = await run('which', [command], { timeout: 5_000 });
27
+ if (check.exitCode === 0) return true;
28
+
29
+ const shouldInstall = await confirm(`${name} não encontrado (necessário para Ollama). Instalar? (s/n) `);
30
+ if (!shouldInstall) return false;
31
+
32
+ const result = await run('sudo', installCmd.split(' '), { timeout: 60_000, interactive: true });
33
+ return result.exitCode === 0;
34
+ }
35
+
22
36
  /**
23
37
  * Installs Ollama via the official install script.
24
38
  */
25
39
  async function install(): Promise<boolean> {
40
+ // Ollama requires zstd for extraction
41
+ if (!await ensureDependency('zstd', 'apt-get install -y zstd', 'zstd')) {
42
+ return false;
43
+ }
44
+
26
45
  logger.info('Instalando Ollama...');
27
46
  const result = await run('curl -fsSL https://ollama.com/install.sh | sh', [], {
28
47
  timeout: 120_000,