@johpaz/hive 1.7.19 → 2.0.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.
- package/README.md +29 -16
- package/dist/hive.js +63 -7
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -114,7 +114,7 @@ docker run -d \
|
|
|
114
114
|
-v hive-data:/root/.hive \
|
|
115
115
|
--name hive \
|
|
116
116
|
--restart unless-stopped \
|
|
117
|
-
johpaz/hive:
|
|
117
|
+
johpaz/hive:2.0.1
|
|
118
118
|
```
|
|
119
119
|
|
|
120
120
|
**Variables de entorno disponibles:**
|
|
@@ -188,10 +188,10 @@ En el equipo donde tienes conexión a internet:
|
|
|
188
188
|
|
|
189
189
|
```bash
|
|
190
190
|
# Descargar la imagen si no la tienes
|
|
191
|
-
docker pull johpaz/hive:
|
|
191
|
+
docker pull johpaz/hive:2.0.1
|
|
192
192
|
|
|
193
193
|
# Exportar a archivo tar (cabe en cualquier USB de 512 MB+)
|
|
194
|
-
docker save johpaz/hive:
|
|
194
|
+
docker save johpaz/hive:2.0.1 -o /media/usb/hive-image.tar
|
|
195
195
|
```
|
|
196
196
|
|
|
197
197
|
**Paso 2 — Crear la estructura en la USB**
|
|
@@ -209,7 +209,7 @@ Crea el `docker-compose.yml` en la USB con el volumen apuntando a la USB:
|
|
|
209
209
|
```yaml
|
|
210
210
|
services:
|
|
211
211
|
hive:
|
|
212
|
-
image: johpaz/hive:
|
|
212
|
+
image: johpaz/hive:2.0.1
|
|
213
213
|
ports:
|
|
214
214
|
- "18790:18790"
|
|
215
215
|
volumes:
|
|
@@ -288,11 +288,11 @@ Descarga manual de cualquier plataforma o versión específica.
|
|
|
288
288
|
|
|
289
289
|
| Plataforma | Archivo | Descarga directa |
|
|
290
290
|
|------------|---------|------------------|
|
|
291
|
-
| Linux x64 | `hive-
|
|
292
|
-
| Linux ARM64 (Raspberry Pi, etc.) | `hive-
|
|
293
|
-
| macOS Apple Silicon (M1/M2/M3/M4) | `hive-
|
|
294
|
-
| macOS Intel | `hive-
|
|
295
|
-
| Windows x64 | `hive-
|
|
291
|
+
| Linux x64 | `hive-v2.0.1-linux-x64` | [Descargar](https://github.com/johpaz/hive/releases/latest/download/hive-v2.0.1-linux-x64) |
|
|
292
|
+
| Linux ARM64 (Raspberry Pi, etc.) | `hive-v2.0.1-linux-arm64` | [Descargar](https://github.com/johpaz/hive/releases/latest/download/hive-v2.0.1-linux-arm64) |
|
|
293
|
+
| macOS Apple Silicon (M1/M2/M3/M4) | `hive-v2.0.1-macos-arm64` | [Descargar](https://github.com/johpaz/hive/releases/latest/download/hive-v2.0.1-macos-arm64) |
|
|
294
|
+
| macOS Intel | `hive-v2.0.1-macos-x64` | [Descargar](https://github.com/johpaz/hive/releases/latest/download/hive-v2.0.1-macos-x64) |
|
|
295
|
+
| Windows x64 | `hive-v2.0.1-windows-x64.exe` | [Descargar](https://github.com/johpaz/hive/releases/latest/download/hive-v2.0.1-windows-x64.exe) |
|
|
296
296
|
|
|
297
297
|
> Los links anteriores siempre apuntan a la última versión publicada. Si necesitas una versión específica, visita la [página de releases](https://github.com/johpaz/hive/releases).
|
|
298
298
|
|
|
@@ -302,7 +302,7 @@ Descarga manual de cualquier plataforma o versión específica.
|
|
|
302
302
|
|
|
303
303
|
```bash
|
|
304
304
|
# 1. Descargar el binario (reemplaza "linux-x64" por "linux-arm64" si es ARM)
|
|
305
|
-
curl -L -o hive https://github.com/johpaz/hive/releases/latest/download/hive-
|
|
305
|
+
curl -L -o hive https://github.com/johpaz/hive/releases/latest/download/hive-v2.0.1-linux-x64
|
|
306
306
|
|
|
307
307
|
# 2. Dar permisos de ejecución
|
|
308
308
|
chmod +x hive
|
|
@@ -334,7 +334,7 @@ hive start
|
|
|
334
334
|
|
|
335
335
|
```bash
|
|
336
336
|
# 1. Descargar
|
|
337
|
-
curl -L -o hive https://github.com/johpaz/hive/releases/latest/download/hive-
|
|
337
|
+
curl -L -o hive https://github.com/johpaz/hive/releases/latest/download/hive-v2.0.1-macos-arm64
|
|
338
338
|
|
|
339
339
|
# 2. Dar permisos de ejecución
|
|
340
340
|
chmod +x hive
|
|
@@ -374,7 +374,7 @@ hive start
|
|
|
374
374
|
Igual que Apple Silicon pero descarga `macos-x64`:
|
|
375
375
|
|
|
376
376
|
```bash
|
|
377
|
-
curl -L -o hive https://github.com/johpaz/hive/releases/latest/download/hive-
|
|
377
|
+
curl -L -o hive https://github.com/johpaz/hive/releases/latest/download/hive-v2.0.1-macos-x64
|
|
378
378
|
chmod +x hive
|
|
379
379
|
xattr -d com.apple.quarantine hive
|
|
380
380
|
curl -L https://github.com/johpaz/hive/releases/latest/download/ui-dist.tar.gz \
|
|
@@ -389,7 +389,7 @@ mkdir -p ~/.hive/ui && cp -r ui-dist/* ~/.hive/ui/
|
|
|
389
389
|
|
|
390
390
|
**Paso 1 — Descargar el binario**
|
|
391
391
|
|
|
392
|
-
Descarga [`hive-
|
|
392
|
+
Descarga [`hive-v2.0.1-windows-x64.exe`](https://github.com/johpaz/hive/releases/latest/download/hive-v2.0.1-windows-x64.exe) desde GitHub o desde [hiveagents.io](https://www.hiveagents.io/#installation).
|
|
393
393
|
|
|
394
394
|
**Paso 2 — Windows SmartScreen**
|
|
395
395
|
|
|
@@ -419,7 +419,7 @@ tar -xzf ui-dist.tar.gz -C "$env:USERPROFILE\.hive\ui"
|
|
|
419
419
|
**Paso 4 — Ejecutar**
|
|
420
420
|
|
|
421
421
|
```powershell
|
|
422
|
-
.\hive-
|
|
422
|
+
.\hive-v2.0.1-windows-x64.exe start
|
|
423
423
|
```
|
|
424
424
|
|
|
425
425
|
El navegador se abre automáticamente en `http://localhost:18790`.
|
|
@@ -428,7 +428,7 @@ El navegador se abre automáticamente en `http://localhost:18790`.
|
|
|
428
428
|
|
|
429
429
|
```powershell
|
|
430
430
|
# Mover a una carpeta ya en el PATH, por ejemplo:
|
|
431
|
-
Move-Item .\hive-
|
|
431
|
+
Move-Item .\hive-v2.0.1-windows-x64.exe C:\Windows\System32\hive.exe
|
|
432
432
|
|
|
433
433
|
# Luego ejecutar desde cualquier lugar:
|
|
434
434
|
hive start
|
|
@@ -479,7 +479,7 @@ El binario standalone es ideal para llevarlo en una USB. Tu agente viaja contigo
|
|
|
479
479
|
**Preparar la USB:**
|
|
480
480
|
|
|
481
481
|
```bash
|
|
482
|
-
cp hive-
|
|
482
|
+
cp hive-v2.0.1-linux-x64 /media/usb/hive
|
|
483
483
|
chmod +x /media/usb/hive
|
|
484
484
|
cp -r ui-dist/* /media/usb/ui/
|
|
485
485
|
|
|
@@ -944,6 +944,19 @@ const data = await browser_script({
|
|
|
944
944
|
|
|
945
945
|
---
|
|
946
946
|
|
|
947
|
+
## Seguridad
|
|
948
|
+
|
|
949
|
+
| Tema | Resumen |
|
|
950
|
+
|------|---------|
|
|
951
|
+
| **Autenticación** | Define `HIVE_AUTH_TOKEN` siempre en producción. Sin él, cualquiera que alcance el puerto puede usar el dashboard. |
|
|
952
|
+
| **Red** | En VPS o servidores, pon Hive detrás de un reverse proxy con HTTPS y abre solo el puerto `18790`. |
|
|
953
|
+
| **Container** | El proceso corre como `root` dentro del contenedor (sin `--privileged`). Migración a usuario no-root pendiente en versiones futuras. |
|
|
954
|
+
| **Datos** | Todo se almacena en el volumen `hive-data` / `~/.hive/`. No se envía telemetría a servidores externos. Las API keys se guardan cifradas. |
|
|
955
|
+
|
|
956
|
+
Consulta [SECURITY.md](SECURITY.md) para instrucciones detalladas de configuración, backup y hardening.
|
|
957
|
+
|
|
958
|
+
---
|
|
959
|
+
|
|
947
960
|
## Desarrollo
|
|
948
961
|
|
|
949
962
|
```bash
|
package/dist/hive.js
CHANGED
|
@@ -555622,6 +555622,41 @@ function isSetupMode() {
|
|
|
555622
555622
|
return true;
|
|
555623
555623
|
}
|
|
555624
555624
|
}
|
|
555625
|
+
function handleSetupProviders(addCorsHeaders, req) {
|
|
555626
|
+
const llmModelsByProvider = new Map;
|
|
555627
|
+
for (const model of SEED_DATA.models) {
|
|
555628
|
+
if (model.modelType !== "llm")
|
|
555629
|
+
continue;
|
|
555630
|
+
if (!llmModelsByProvider.has(model.providerId)) {
|
|
555631
|
+
llmModelsByProvider.set(model.providerId, []);
|
|
555632
|
+
}
|
|
555633
|
+
llmModelsByProvider.get(model.providerId).push({ id: model.id, name: model.name });
|
|
555634
|
+
}
|
|
555635
|
+
const result2 = SEED_DATA.providers.filter((p2) => llmModelsByProvider.has(p2.id) || p2.id === "ollama").map((p2) => ({
|
|
555636
|
+
id: p2.id,
|
|
555637
|
+
name: p2.name,
|
|
555638
|
+
models: llmModelsByProvider.get(p2.id) ?? []
|
|
555639
|
+
}));
|
|
555640
|
+
return addCorsHeaders(Response.json(result2), req);
|
|
555641
|
+
}
|
|
555642
|
+
function handleSetupEthics(addCorsHeaders, req) {
|
|
555643
|
+
try {
|
|
555644
|
+
const db = getDb();
|
|
555645
|
+
const ethics = db.query(`
|
|
555646
|
+
SELECT id, name, description, content, is_default, active FROM ethics ORDER BY id
|
|
555647
|
+
`).all();
|
|
555648
|
+
return addCorsHeaders(Response.json(ethics.map((e) => ({
|
|
555649
|
+
id: e.id,
|
|
555650
|
+
name: e.name,
|
|
555651
|
+
description: e.description,
|
|
555652
|
+
content: e.content,
|
|
555653
|
+
isDefault: e.is_default === 1,
|
|
555654
|
+
active: e.active === 1
|
|
555655
|
+
}))), req);
|
|
555656
|
+
} catch (error50) {
|
|
555657
|
+
return addCorsHeaders(Response.json({ error: error50.message }, { status: 500 }), req);
|
|
555658
|
+
}
|
|
555659
|
+
}
|
|
555625
555660
|
async function handleSetupStatus() {
|
|
555626
555661
|
const setupMode = isSetupMode();
|
|
555627
555662
|
return Response.json({
|
|
@@ -555826,9 +555861,17 @@ async function handleCompleteSetup(req, config3, addCorsHeaders) {
|
|
|
555826
555861
|
ttsProvider: body.ttsProvider || "elevenlabs"
|
|
555827
555862
|
});
|
|
555828
555863
|
}
|
|
555829
|
-
|
|
555864
|
+
if (body.ethicsRules && typeof body.ethicsRules === "object") {
|
|
555865
|
+
for (const [ethicsId, enabled] of Object.entries(body.ethicsRules)) {
|
|
555866
|
+
if (enabled)
|
|
555867
|
+
activateEthics(userId, ethicsId);
|
|
555868
|
+
}
|
|
555869
|
+
} else {
|
|
555870
|
+
activateEthics(userId, "default");
|
|
555871
|
+
}
|
|
555830
555872
|
const authToken = randomUUID2().replace(/-/g, "");
|
|
555831
555873
|
process.env.HIVE_AUTH_TOKEN = authToken;
|
|
555874
|
+
setTimeout(() => process.exit(0), 800);
|
|
555832
555875
|
return addCorsHeaders(Response.json({
|
|
555833
555876
|
success: true,
|
|
555834
555877
|
userId,
|
|
@@ -555845,6 +555888,7 @@ async function handleCompleteSetup(req, config3, addCorsHeaders) {
|
|
|
555845
555888
|
}
|
|
555846
555889
|
var init_setup = __esm(() => {
|
|
555847
555890
|
init_sqlite();
|
|
555891
|
+
init_seed();
|
|
555848
555892
|
init_onboarding();
|
|
555849
555893
|
});
|
|
555850
555894
|
|
|
@@ -558056,7 +558100,7 @@ function addCorsHeaders(response, request3) {
|
|
|
558056
558100
|
const origin = request3.headers.get("Origin");
|
|
558057
558101
|
if (!origin)
|
|
558058
558102
|
return response;
|
|
558059
|
-
const isLocalhost = origin.includes("localhost") || origin.includes("127.0.0.1");
|
|
558103
|
+
const isLocalhost = origin.includes("localhost") || origin.includes("127.0.0.1") || origin.includes("0.0.0.0");
|
|
558060
558104
|
const isCorsOrigin = CORS_ORIGINS.some((o2) => origin.includes(o2.replace("http://", "")));
|
|
558061
558105
|
if (isCorsOrigin || isLocalhost) {
|
|
558062
558106
|
const headers = new Headers(response.headers);
|
|
@@ -558995,7 +559039,7 @@ async function startGateway(config3) {
|
|
|
558995
559039
|
hostname: host,
|
|
558996
559040
|
fetch: (req) => {
|
|
558997
559041
|
const origin = req.headers.get("Origin") ?? "";
|
|
558998
|
-
const isLocalhost = origin.includes("localhost") || origin.includes("127.0.0.1");
|
|
559042
|
+
const isLocalhost = origin.includes("localhost") || origin.includes("127.0.0.1") || origin.includes("0.0.0.0");
|
|
558999
559043
|
const corsHeaders = isLocalhost ? {
|
|
559000
559044
|
"Access-Control-Allow-Origin": origin,
|
|
559001
559045
|
"Access-Control-Allow-Methods": "GET, POST, PUT, PATCH, DELETE, OPTIONS",
|
|
@@ -559004,13 +559048,18 @@ async function startGateway(config3) {
|
|
|
559004
559048
|
} : {};
|
|
559005
559049
|
if (req.method === "OPTIONS")
|
|
559006
559050
|
return new Response(null, { status: 204, headers: corsHeaders });
|
|
559007
|
-
|
|
559051
|
+
const pathname = new URL(req.url).pathname;
|
|
559052
|
+
if (pathname === "/health" || pathname === "/health/") {
|
|
559053
|
+
return Response.json({ status: "starting" }, { headers: corsHeaders });
|
|
559054
|
+
}
|
|
559055
|
+
return Response.json({ status: "starting" }, { status: 503, headers: corsHeaders });
|
|
559008
559056
|
},
|
|
559009
559057
|
websocket: { open() {}, message() {}, close() {} }
|
|
559010
559058
|
});
|
|
559011
559059
|
log69.info(`Port ${port} bound (initializing gateway...)`);
|
|
559012
559060
|
try {
|
|
559013
559061
|
initializeDatabase();
|
|
559062
|
+
seedAllData();
|
|
559014
559063
|
} catch {}
|
|
559015
559064
|
let gatewaySetupMode = false;
|
|
559016
559065
|
try {
|
|
@@ -559268,7 +559317,7 @@ ${messageContent}`;
|
|
|
559268
559317
|
const handleRequest = async () => {
|
|
559269
559318
|
if (req.method === "OPTIONS") {
|
|
559270
559319
|
const origin = req.headers.get("Origin");
|
|
559271
|
-
if (origin && (origin.includes("localhost") || origin.includes("127.0.0.1") || CORS_ORIGINS.some((o2) => origin.includes(o2.replace("http://", ""))))) {
|
|
559320
|
+
if (origin && (origin.includes("localhost") || origin.includes("127.0.0.1") || origin.includes("0.0.0.0") || CORS_ORIGINS.some((o2) => origin.includes(o2.replace("http://", ""))))) {
|
|
559272
559321
|
return new Response(null, {
|
|
559273
559322
|
status: 204,
|
|
559274
559323
|
headers: {
|
|
@@ -559385,6 +559434,12 @@ ${messageContent}`;
|
|
|
559385
559434
|
if (url3.pathname === "/api/setup/status" || url3.pathname === "/api/setup/status/") {
|
|
559386
559435
|
return addCorsHeaders(await handleSetupStatus(), req);
|
|
559387
559436
|
}
|
|
559437
|
+
if (url3.pathname === "/api/setup/providers" && req.method === "GET") {
|
|
559438
|
+
return handleSetupProviders(addCorsHeaders, req);
|
|
559439
|
+
}
|
|
559440
|
+
if (url3.pathname === "/api/setup/ethics" && req.method === "GET") {
|
|
559441
|
+
return handleSetupEthics(addCorsHeaders, req);
|
|
559442
|
+
}
|
|
559388
559443
|
if (url3.pathname === "/api/setup/verify-provider" && req.method === "POST") {
|
|
559389
559444
|
return addCorsHeaders(await handleVerifyProvider(req), req);
|
|
559390
559445
|
}
|
|
@@ -560466,6 +560521,7 @@ var init_server = __esm(() => {
|
|
|
560466
560521
|
init_lane_queue();
|
|
560467
560522
|
init_slash_commands();
|
|
560468
560523
|
init_sqlite();
|
|
560524
|
+
init_seed();
|
|
560469
560525
|
init_canvas_manager();
|
|
560470
560526
|
init_emitter();
|
|
560471
560527
|
init_bridge_events();
|
|
@@ -562787,7 +562843,7 @@ async function start(flags) {
|
|
|
562787
562843
|
\u2551 \u2588\u2588\u2551 \u2588\u2588\u2551\u2588\u2588\u2551 \u255A\u2588\u2588\u2588\u2588\u2554\u255D \u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2557 \u2551
|
|
562788
562844
|
\u2551 \u255A\u2550\u255D \u255A\u2550\u255D\u255A\u2550\u255D \u255A\u2550\u2550\u2550\u255D \u255A\u2550\u2550\u2550\u2550\u2550\u2550\u255D \u2551
|
|
562789
562845
|
\u2551 \u2551
|
|
562790
|
-
\u2551 Personal Swarm AI Gateway \u2014
|
|
562846
|
+
\u2551 Personal Swarm AI Gateway \u2014 v2.0.1 \u2551
|
|
562791
562847
|
\u255A\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u255D
|
|
562792
562848
|
`);
|
|
562793
562849
|
}
|
|
@@ -564997,7 +565053,7 @@ async function executeAsync(gatewayUrl, payload, spinner) {
|
|
|
564997
565053
|
}
|
|
564998
565054
|
|
|
564999
565055
|
// packages/cli/src/index.ts
|
|
565000
|
-
var VERSION4 = "
|
|
565056
|
+
var VERSION4 = "2.0.1";
|
|
565001
565057
|
var HELP = `
|
|
565002
565058
|
\uD83D\uDC1D Hive \u2014 Personal Swarm AI Gateway v${VERSION4}
|
|
565003
565059
|
|