pudu-ai 0.2.18 → 0.2.21

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.es.md ADDED
@@ -0,0 +1,85 @@
1
+ # Pudu-AI
2
+
3
+ **Laboratorio local de hardware y benchmarks de IA** para la terminal.
4
+
5
+ [English](README.md) · [Español](README.es.md)
6
+
7
+ Descubre, inspecciona, mide y compara modelos que corren en tu máquina. Las mediciones se quedan locales. Las estimaciones nunca se mezclan con resultados reales de `llama-bench`.
8
+
9
+ ```bash
10
+ npx pudu-ai --lang es
11
+ ```
12
+
13
+ El idioma de la UI por defecto es inglés. Usa `--lang es` para español.
14
+
15
+ El nombre npm `pudu` está ocupado. Este CLI es **`pudu-ai`**.
16
+
17
+ ## Instalar
18
+
19
+ ```bash
20
+ git clone https://github.com/devjaime/pudu-ai.git
21
+ cd pudu-ai
22
+ npm install
23
+ npx . --lang es
24
+ ```
25
+
26
+ O:
27
+
28
+ ```bash
29
+ npm run pudu-ai -- --lang es
30
+ ```
31
+
32
+ `PUDU_AI_LANG=es` o un `LANG` español (p. ej. `es_CL.UTF-8`) también seleccionan español.
33
+
34
+ ## Comandos
35
+
36
+ ```bash
37
+ npx pudu-ai --lang es
38
+ npx pudu-ai hardware
39
+ npx pudu-ai models
40
+ npx pudu-ai setup
41
+ npx pudu-ai recommend
42
+ npx pudu-ai tasks --for code --lang es
43
+ npx pudu-ai benchmark qwen3:8b --json --preset quick
44
+ npx pudu-ai doctor --lang es
45
+ npx pudu-ai launch opencode
46
+ npx pudu-ai repo search validate_user --json
47
+ npx pudu-ai repo search --structural 'def $FUNC($$$ARGS): $$$BODY' --repo .
48
+ ```
49
+
50
+ Flags: `--json` `--csv` `--no-network` `--no-color` `--verbose` `--preset` `--lang en|es` `--repo` `--structural` `--intent` `--glob` `--limit`
51
+
52
+ ## Agent Lab (vista previa)
53
+
54
+ Búsqueda determinista de repositorio. Python 3.10+, `rg` y `ast-grep` opcionales. Sin LLM.
55
+
56
+ - Uso: [Español](docs/agent-lab-usage.es.md) · [English](docs/agent-lab-usage.md)
57
+ - Spec: [Español](docs/spec/agent-lab.es.md) · [English](docs/spec/agent-lab.md)
58
+
59
+ ```bash
60
+ npx pudu-ai repo search validate_user --repo . --json --lang es
61
+ ```
62
+
63
+ Hace falta `python3` en PATH. Si faltan `rg` o `ast-grep`, el JSON dice `available: false`; no inventa coincidencias.
64
+
65
+ La iteración 1 solo incluye `repo search`. Grafo, context pack y agentes aún no.
66
+
67
+ ## Privacidad
68
+
69
+ Local-first. Benchmarks, rutas de modelos e identificadores de máquina se quedan en `~/.pudu-ai/`. Nada se sube. La red es opcional (catálogo CanIRun; `--no-network` la desactiva). Agent Lab no envía el repositorio a ninguna API.
70
+
71
+ ## Puntuación
72
+
73
+ **Pudu-AI Score** es solo rendimiento de hardware. No incluye calidad/inteligencia del modelo. Ver `docs/spec/03-scoring.md`.
74
+
75
+ **Pudu Task Score** (Agent Lab, aún no implementado) será otra métrica, separada.
76
+
77
+ ## Créditos
78
+
79
+ **Medido:** `llama-bench` y telemetría del SO.
80
+
81
+ **Estimado:** [CanIRun.ai](https://canirun.ai) de [midudev](https://midu.dev) ([GitHub](https://github.com/midudev/canirun.ai)), siempre etiquetado como estimado.
82
+
83
+ ## Contribuir
84
+
85
+ Ver [CONTRIBUTING.md](CONTRIBUTING.md). Licencia MIT.
package/README.md CHANGED
@@ -8,7 +8,7 @@ Discover, inspect, benchmark, and compare models that run on your machine. Measu
8
8
  npx pudu-ai
9
9
  ```
10
10
 
11
- English is the default UI language. Use `--lang es` for Spanish.
11
+ English is the default UI language. Use `--lang es` for Spanish. Docs: [English](README.md) · [Español](README.es.md).
12
12
 
13
13
  The npm name `pudu` is taken by an empty stub. This CLI is **`pudu-ai`**.
14
14
 
@@ -59,9 +59,11 @@ npx pudu-ai report --markdown
59
59
  npx pudu-ai launch
60
60
  npx pudu-ai launch opencode
61
61
  npx pudu-ai launch opencode --yes
62
+ npx pudu-ai repo search validate_user --json
63
+ npx pudu-ai repo search --structural 'def $FUNC($$$ARGS): $$$BODY' --repo .
62
64
  ```
63
65
 
64
- Flags: `--json` `--csv` `--no-network` `--no-color` `--verbose` `--preset quick|standard|stress` `--lang en|es` `--for` `--scope` `--priority`
66
+ Flags: `--json` `--csv` `--no-network` `--no-color` `--verbose` `--preset quick|standard|stress` `--lang en|es` `--for` `--scope` `--priority` `--repo` `--structural` `--intent` `--glob` `--limit`
65
67
 
66
68
  ```bash
67
69
  npx pudu-ai --lang es
@@ -136,6 +138,21 @@ npx pudu-ai launch
136
138
  npx pudu-ai launch opencode --yes
137
139
  ```
138
140
 
141
+ ## Agent Lab (preview)
142
+
143
+ Deterministic repository search. Optional Python 3.10+, `rg`, and `ast-grep`. No LLM.
144
+
145
+ - Usage: [English](docs/agent-lab-usage.md) · [Español](docs/agent-lab-usage.es.md)
146
+ - Spec: [English](docs/spec/agent-lab.md) · [Español](docs/spec/agent-lab.es.md)
147
+
148
+ ```bash
149
+ npx pudu-ai repo search validate_user --repo . --json
150
+ npx pudu-ai repo search --structural 'def $FUNC($$$ARGS): $$$BODY'
151
+ npx pudu-ai repo search validate_user --lang es
152
+ ```
153
+
154
+ Requires `python3` on PATH. If `rg` or `ast-grep` is missing, JSON reports `available: false` instead of inventing hits.
155
+
139
156
  ## Privacy
140
157
 
141
158
  Local-first. Benchmarks, model paths, and machine identifiers stay in `~/.pudu-ai/`. Nothing is uploaded. Network is optional and used only for the CanIRun catalog (`--no-network` disables it).
@@ -0,0 +1,80 @@
1
+ import {
2
+ commandExists,
3
+ runCommand
4
+ } from "./chunk-SS7OXXQQ.js";
5
+
6
+ // src/integrations/brew.ts
7
+ var BREW_CANDIDATES = ["/opt/homebrew/bin/brew", "/usr/local/bin/brew", "brew"];
8
+ async function resolveBrew() {
9
+ for (const bin of BREW_CANDIDATES) {
10
+ const found = await commandExists(bin);
11
+ if (found) return found;
12
+ }
13
+ return void 0;
14
+ }
15
+ async function dockerReady() {
16
+ const docker = await commandExists("docker");
17
+ if (!docker) return false;
18
+ const info = await runCommand("docker", ["info"], { timeout: 8e3 });
19
+ return info.exitCode === 0;
20
+ }
21
+ async function ensureBrew() {
22
+ const existing = await resolveBrew();
23
+ if (existing) return { ok: true, brew: existing, log: existing };
24
+ const install = await runCommand(
25
+ "/bin/bash",
26
+ ["-c", 'NONINTERACTIVE=1 /bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"'],
27
+ { timeout: 15 * 6e4 }
28
+ );
29
+ const after = await resolveBrew();
30
+ if (after) return { ok: true, brew: after, log: after };
31
+ return {
32
+ ok: false,
33
+ log: install.stderr || "Homebrew missing. Install: https://brew.sh"
34
+ };
35
+ }
36
+ async function brewInstall(args) {
37
+ const ensured = await ensureBrew();
38
+ if (!ensured.ok || !ensured.brew) return { ok: false, log: ensured.log };
39
+ const result = await runCommand(ensured.brew, args, { timeout: 15 * 6e4 });
40
+ return {
41
+ ok: result.exitCode === 0,
42
+ log: `${ensured.brew} ${args.join(" ")}
43
+ ${result.stdout || result.stderr}`
44
+ };
45
+ }
46
+ async function brewInstallCask(name) {
47
+ const brew = await resolveBrew();
48
+ if (!brew) {
49
+ const ensured = await ensureBrew();
50
+ if (!ensured.ok || !ensured.brew) return { ok: false, log: ensured.log };
51
+ const result2 = await runCommand(ensured.brew, ["install", "--cask", name], { timeout: 15 * 6e4 });
52
+ return { ok: result2.exitCode === 0, log: result2.stderr || result2.stdout };
53
+ }
54
+ const result = await runCommand(brew, ["install", "--cask", name], { timeout: 15 * 6e4 });
55
+ if (result.exitCode === 0) return { ok: true, log: result.stdout };
56
+ const formula = await runCommand(brew, ["install", name], { timeout: 15 * 6e4 });
57
+ return { ok: formula.exitCode === 0, log: formula.stderr || formula.stdout };
58
+ }
59
+ async function startDockerDesktop() {
60
+ if (process.platform === "darwin") {
61
+ await runCommand("open", ["-a", "Docker"], { timeout: 15e3 });
62
+ }
63
+ }
64
+ async function waitForDocker(ms = 9e4) {
65
+ const start = Date.now();
66
+ while (Date.now() - start < ms) {
67
+ if (await dockerReady()) return true;
68
+ await new Promise((resolve) => setTimeout(resolve, 2500));
69
+ }
70
+ return dockerReady();
71
+ }
72
+ export {
73
+ brewInstall,
74
+ brewInstallCask,
75
+ dockerReady,
76
+ ensureBrew,
77
+ resolveBrew,
78
+ startDockerDesktop,
79
+ waitForDocker
80
+ };