@jmanuelcorral/openteam 0.1.24 → 0.1.26
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/.opencode/command/openteam.md +2 -2
- package/README.md +65 -16
- package/dist/cli/{dashboardServe.d.ts → consoleServe.d.ts} +23 -13
- package/dist/cli/consoleServe.d.ts.map +1 -0
- package/dist/cli/tunnel.d.ts +89 -0
- package/dist/cli/tunnel.d.ts.map +1 -0
- package/dist/cli.js +1168 -187
- package/dist/commands/console.d.ts +9 -0
- package/dist/commands/console.d.ts.map +1 -0
- package/dist/commands/dispatch.d.ts.map +1 -1
- package/dist/config/schema.d.ts +88 -4
- package/dist/config/schema.d.ts.map +1 -1
- package/dist/console/backlog.d.ts.map +1 -0
- package/dist/console/opencodeClient.d.ts +30 -0
- package/dist/console/opencodeClient.d.ts.map +1 -0
- package/dist/console/protocol.d.ts +42 -0
- package/dist/console/protocol.d.ts.map +1 -0
- package/dist/console/pty.d.ts +47 -0
- package/dist/console/pty.d.ts.map +1 -0
- package/dist/console/render.d.ts +20 -0
- package/dist/console/render.d.ts.map +1 -0
- package/dist/console/session.d.ts +23 -0
- package/dist/console/session.d.ts.map +1 -0
- package/dist/console/sse.d.ts +21 -0
- package/dist/console/sse.d.ts.map +1 -0
- package/dist/{dashboard → console}/state.d.ts +10 -5
- package/dist/console/state.d.ts.map +1 -0
- package/dist/console/token.d.ts +24 -0
- package/dist/console/token.d.ts.map +1 -0
- package/dist/{dashboard → console}/types.d.ts +24 -3
- package/dist/console/types.d.ts.map +1 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +85 -34
- package/dist/plugin/capture.d.ts +12 -1
- package/dist/plugin/capture.d.ts.map +1 -1
- package/dist/plugin/commandTool.d.ts +1 -1
- package/dist/plugin/commandTool.d.ts.map +1 -1
- package/dist/telemetry/aggregate.d.ts +15 -1
- package/dist/telemetry/aggregate.d.ts.map +1 -1
- package/dist/telemetry/decisions.d.ts +1 -1
- package/dist/telemetry/eventLog.d.ts +1 -1
- package/dist/telemetry/eventLog.d.ts.map +1 -1
- package/dist/telemetry/events.d.ts +28 -1
- package/dist/telemetry/events.d.ts.map +1 -1
- package/dist/web/console.d.ts +28 -0
- package/dist/web/console.d.ts.map +1 -0
- package/dist/web/git.d.ts +1 -1
- package/dist/web/git.d.ts.map +1 -1
- package/dist/web/paths.d.ts +1 -1
- package/dist/web/paths.d.ts.map +1 -1
- package/dist/web/server.d.ts +20 -9
- package/dist/web/server.d.ts.map +1 -1
- package/dist/web/snapshot.d.ts +6 -6
- package/dist/web/snapshot.d.ts.map +1 -1
- package/dist/web/start.d.ts +19 -9
- package/dist/web/start.d.ts.map +1 -1
- package/package.json +4 -2
- package/dist/cli/dashboardServe.d.ts.map +0 -1
- package/dist/commands/dashboard.d.ts +0 -9
- package/dist/commands/dashboard.d.ts.map +0 -1
- package/dist/dashboard/backlog.d.ts.map +0 -1
- package/dist/dashboard/render.d.ts +0 -14
- package/dist/dashboard/render.d.ts.map +0 -1
- package/dist/dashboard/state.d.ts.map +0 -1
- package/dist/dashboard/types.d.ts.map +0 -1
- /package/dist/{dashboard → console}/backlog.d.ts +0 -0
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
---
|
|
2
|
-
description: Comandos runtime de openteam (baseline show|set|auto, doctor, agents,
|
|
2
|
+
description: Comandos runtime de openteam (baseline show|set|auto, doctor, agents, console, report)
|
|
3
3
|
---
|
|
4
4
|
|
|
5
5
|
Usa la herramienta `openteam` para ejecutar el comando indicado por el usuario: $ARGUMENTS
|
|
@@ -11,7 +11,7 @@ Interpreta los argumentos así y llama a la herramienta `openteam` una sola vez:
|
|
|
11
11
|
- `baseline auto` → `action: "auto"`
|
|
12
12
|
- `doctor` → `action: "doctor"`
|
|
13
13
|
- `agents` → `action: "agents"`
|
|
14
|
-
- `
|
|
14
|
+
- `console` → `action: "console"`
|
|
15
15
|
- `report` → `action: "report"`
|
|
16
16
|
|
|
17
17
|
Devuelve la salida de la herramienta tal cual, sin reinterpretarla.
|
package/README.md
CHANGED
|
@@ -355,7 +355,7 @@ Los cambios de `set`/`auto` se persisten en `.opencode/openteam.json` y aplican
|
|
|
355
355
|
/openteam baseline auto
|
|
356
356
|
/openteam doctor
|
|
357
357
|
/openteam agents
|
|
358
|
-
/openteam
|
|
358
|
+
/openteam console
|
|
359
359
|
/openteam report
|
|
360
360
|
```
|
|
361
361
|
|
|
@@ -371,7 +371,7 @@ openteam baseline show
|
|
|
371
371
|
openteam baseline set openai/gpt-5-mini
|
|
372
372
|
openteam doctor --config .opencode/openteam.json
|
|
373
373
|
openteam agents
|
|
374
|
-
openteam
|
|
374
|
+
openteam console
|
|
375
375
|
openteam report --telemetry .opencode/openteam-telemetry.jsonl
|
|
376
376
|
openteam yolo status
|
|
377
377
|
openteam yolo on
|
|
@@ -421,13 +421,14 @@ También puedes activarlo durante `openteam setup` (te lo pregunta), o al vuelo
|
|
|
421
421
|
|
|
422
422
|
Segundo modo de operación: un **bucle externo** que invoca `opencode run` contra un backlog persistente hasta vaciarlo, con contexto fresco por iteración y topes de seguridad (presupuesto, máx. iteraciones, sin-progreso). Complementa al orquestador interactivo, no lo sustituye. Consulta el diseño y los ejemplos en **[docs/loop.md](docs/loop.md)**.
|
|
423
423
|
|
|
424
|
-
###
|
|
424
|
+
### Console web multi-sesión (se lanza desde la CLI)
|
|
425
425
|
|
|
426
|
-
openteam expone
|
|
427
|
-
`openteam
|
|
428
|
-
|
|
429
|
-
|
|
430
|
-
sesión
|
|
426
|
+
openteam expone una **Console web local** que **lanzas tú desde la CLI** con
|
|
427
|
+
`openteam console`.
|
|
428
|
+
Agrega **todas** las sesiones de opencode a la vez: puedes tener varias pestañas
|
|
429
|
+
de opencode abiertas y todas aparecen en la **misma** Console, con una pestaña por
|
|
430
|
+
sesión (más "Todas"), porque cada plugin **escribe eventos redactados** en logs
|
|
431
|
+
JSONL por sesión y la Console los vigila (`fs.watch`) y **agrega**.
|
|
431
432
|
|
|
432
433
|
Muestra en vivo: **coste y tokens reales por mensaje** (input/output/reasoning/
|
|
433
434
|
cache), **toolcalls con duración** y ok/fallo, ruteo reciente (coste/ahorro y
|
|
@@ -436,12 +437,18 @@ agentes (scribe) y **reuniones** (batches multi-agente del orquestador), progres
|
|
|
436
437
|
del backlog del loop, el equipo de agentes (LLM local/frontier de cada uno) y
|
|
437
438
|
últimos commits. Se actualiza por **SSE** (con *polling* de respaldo).
|
|
438
439
|
|
|
439
|
-
|
|
440
|
+
Cada pestaña de sesión incluye además una **vista "Sesión"**: una consola por la
|
|
441
|
+
que puedes **ver la salida en vivo** (SSE) y **enviar prompts** o **responder
|
|
442
|
+
permisos** a esa sesión de opencode, autenticada con un **token efímero** por
|
|
443
|
+
arranque. Opcionalmente, con el flag `terminal.pty`, una **vista "Terminal"** abre
|
|
444
|
+
una **shell real** en el workspace vía la API de PTY de opencode (sin `node-pty`).
|
|
445
|
+
|
|
446
|
+
Lánzala contra el repo actual; escucha en loopback y corre hasta **Ctrl+C**:
|
|
440
447
|
|
|
441
448
|
```powershell
|
|
442
|
-
openteam
|
|
443
|
-
openteam
|
|
444
|
-
openteam
|
|
449
|
+
openteam console # imprime la URL y sirve la Console multi-sesión
|
|
450
|
+
openteam console --open # además abre el navegador
|
|
451
|
+
openteam console --status # solo imprime la config (no lanza el servidor)
|
|
445
452
|
```
|
|
446
453
|
|
|
447
454
|
Las sesiones se leen de:
|
|
@@ -450,22 +457,44 @@ Las sesiones se leen de:
|
|
|
450
457
|
.opencode/openteam/sessions/*.jsonl
|
|
451
458
|
```
|
|
452
459
|
|
|
453
|
-
Puedes ajustar host/puerto y
|
|
460
|
+
Puedes ajustar host/puerto y la terminal en `.opencode/openteam.json` (bloque
|
|
461
|
+
`console`):
|
|
454
462
|
|
|
455
463
|
```json
|
|
456
464
|
{
|
|
457
|
-
"
|
|
465
|
+
"console": {
|
|
458
466
|
"host": "127.0.0.1",
|
|
459
467
|
"port": 4599,
|
|
460
468
|
"autoPortFallback": true,
|
|
461
469
|
"refreshMs": 2000,
|
|
462
470
|
"recentRoutes": 50,
|
|
463
|
-
"openBrowser": false
|
|
471
|
+
"openBrowser": false,
|
|
472
|
+
"terminal": { "enabled": true, "pty": false }
|
|
464
473
|
}
|
|
465
474
|
}
|
|
466
475
|
```
|
|
467
476
|
|
|
468
|
-
> **Seguridad**: el servidor escucha **solo en loopback** (`127.0.0.1`/`localhost`, validado por Zod) y **nunca expone prompts** (solo `promptHash`), args de toolcall ni contenido de mensajes: solo contadores, costes y resúmenes redactados. Si el puerto está ocupado y `autoPortFallback` es `true`, prueba el siguiente libre.
|
|
477
|
+
> **Seguridad**: el servidor escucha **solo en loopback** (`127.0.0.1`/`localhost`, validado por Zod) y **nunca expone prompts** (solo `promptHash`), args de toolcall ni contenido de mensajes: solo contadores, costes y resúmenes redactados. La vista "Sesión"/"Terminal" exige el token efímero. Si el puerto está ocupado y `autoPortFallback` es `true`, prueba el siguiente libre.
|
|
478
|
+
|
|
479
|
+
### Acceso remoto seguro: `openteam tunnel`
|
|
480
|
+
|
|
481
|
+
Para acceder a la Console (y, opcionalmente, operar la terminal) **desde fuera**,
|
|
482
|
+
`openteam tunnel` la expone vía **Microsoft Dev Tunnels** en lugar de bindear a
|
|
483
|
+
`0.0.0.0`. Comprueba que `devtunnel` esté instalado y con sesión iniciada,
|
|
484
|
+
hospeda el puerto de la Console e imprime la URL pública hasta **Ctrl+C**:
|
|
485
|
+
|
|
486
|
+
```powershell
|
|
487
|
+
openteam tunnel # expone solo la Console (observación), autenticado
|
|
488
|
+
openteam tunnel --terminal # además expone opencode para la terminal remota
|
|
489
|
+
openteam tunnel --allow-anonymous --yes # túnel anónimo (requiere doble confirmación)
|
|
490
|
+
```
|
|
491
|
+
|
|
492
|
+
> **Seguridad del túnel**: autenticado por defecto. La **terminal remota** exige
|
|
493
|
+
> `OPENCODE_SERVER_PASSWORD` definido; sin ella, `--terminal` se ignora y solo se
|
|
494
|
+
> expone la Console (observación). El túnel **anónimo** requiere `--yes` (doble
|
|
495
|
+
> confirmación) y avisa de que opencode puede ejecutar comandos y editar ficheros.
|
|
496
|
+
> Instala devtunnel con `winget install Microsoft.devtunnel` e inicia sesión con
|
|
497
|
+
> `devtunnel user login`.
|
|
469
498
|
|
|
470
499
|
|
|
471
500
|
|
|
@@ -514,6 +543,26 @@ bun run format:check
|
|
|
514
543
|
bun run build
|
|
515
544
|
```
|
|
516
545
|
|
|
546
|
+
### Desarrollo local en modo dev (sin registry)
|
|
547
|
+
|
|
548
|
+
Para que la CLI global `openteam` y opencode usen la build local de este repo en
|
|
549
|
+
lugar de la versión publicada (sin pasar por ningún registry), se enlaza el
|
|
550
|
+
paquete con un symlink global:
|
|
551
|
+
|
|
552
|
+
```powershell
|
|
553
|
+
Set-Location -Path "C:\gitrepos\openteam"
|
|
554
|
+
bun run link:local # = bun run build && npm link
|
|
555
|
+
```
|
|
556
|
+
|
|
557
|
+
`npm link` crea un enlace global (junction/symlink) hacia este repo, así que tras
|
|
558
|
+
cada `bun run build` la CLI global refleja el código local.
|
|
559
|
+
|
|
560
|
+
Un hook `pre-push` versionado (`.githooks/pre-push`) ejecuta `bun run link:local`
|
|
561
|
+
automáticamente antes de cada `git push`, manteniendo la instalación local al día.
|
|
562
|
+
El hook se activa vía `core.hooksPath=.githooks`, que el script `prepare` configura
|
|
563
|
+
automáticamente al ejecutar `bun install` en el repo. Es best-effort: si el build o
|
|
564
|
+
el link fallan, avisa pero **no bloquea** el push.
|
|
565
|
+
|
|
517
566
|
## Privacidad
|
|
518
567
|
|
|
519
568
|
Con `privacyMode: "forceLocalOnSensitive"`, si `TaskSignals.privacySensitive` es `true`, `chooseModel` usa local y no permite fallback frontier. Si no hay local utilizable, la decisión conserva la ruta local y registra la razón en `rationale`.
|
|
@@ -1,9 +1,11 @@
|
|
|
1
1
|
import type { AgentFile } from "../commands/agents";
|
|
2
2
|
import type { OpenTeamConfig } from "../config/schema";
|
|
3
|
-
import type
|
|
4
|
-
import
|
|
5
|
-
|
|
6
|
-
|
|
3
|
+
import { type ConsoleClient } from "../console/opencodeClient";
|
|
4
|
+
import { type PtyClient } from "../console/pty";
|
|
5
|
+
import type { CommitView } from "../console/types";
|
|
6
|
+
import type { ConsoleRuntime, ConsoleRuntimeDeps } from "../web/start";
|
|
7
|
+
/** Dependencias inyectables del launcher `openteam console`. */
|
|
8
|
+
export type ConsoleServeDeps = {
|
|
7
9
|
loadConfig: (path: string) => Promise<OpenTeamConfig>;
|
|
8
10
|
configPath: string;
|
|
9
11
|
/** Directorio de logs de sesión (`sessions/*.jsonl`). */
|
|
@@ -21,32 +23,40 @@ export type DashboardServeDeps = {
|
|
|
21
23
|
/** Espera hasta que el usuario pare el proceso (SIGINT/SIGTERM). */
|
|
22
24
|
waitForSignal: () => Promise<void>;
|
|
23
25
|
log: (message: string) => void;
|
|
24
|
-
/**
|
|
25
|
-
|
|
26
|
+
/** `OPENCODE_SERVER_PASSWORD` si el servidor opencode la exige. Opcional. */
|
|
27
|
+
serverPassword?: string;
|
|
28
|
+
/** Genera el token efímero de la Console. Inyectable en tests. */
|
|
29
|
+
generateToken?: () => string;
|
|
30
|
+
/** Factoría de cliente opencode. Inyectable en tests. */
|
|
31
|
+
createConsoleClient?: (endpoint: string) => ConsoleClient;
|
|
32
|
+
/** Factoría de cliente PTY. Inyectable en tests. */
|
|
33
|
+
createPtyClient?: (endpoint: string) => PtyClient;
|
|
34
|
+
/** Inyectable para tests; por defecto `startConsole`. */
|
|
35
|
+
startConsole?: (deps: ConsoleRuntimeDeps) => ConsoleRuntime | Promise<ConsoleRuntime>;
|
|
26
36
|
/** Abre el navegador en la URL dada (opcional; solo con `--open`). */
|
|
27
37
|
openBrowser?: (url: string) => void | Promise<void>;
|
|
28
38
|
};
|
|
29
|
-
export type
|
|
39
|
+
export type ConsoleServeOptions = {
|
|
30
40
|
open: boolean;
|
|
31
41
|
};
|
|
32
42
|
/**
|
|
33
|
-
* Parsea los flags de `openteam
|
|
43
|
+
* Parsea los flags de `openteam console`. Por defecto **levanta el servidor**
|
|
34
44
|
* (agrega todas las sesiones); `--status` imprime solo el resumen de texto;
|
|
35
45
|
* `--open` abre el navegador; `--serve` se acepta como alias de compatibilidad.
|
|
36
46
|
*/
|
|
37
|
-
export declare function
|
|
47
|
+
export declare function parseConsoleServeArgs(rest: readonly string[]): {
|
|
38
48
|
status: boolean;
|
|
39
49
|
serve: boolean;
|
|
40
50
|
open: boolean;
|
|
41
51
|
};
|
|
42
|
-
export type
|
|
52
|
+
export type ConsoleServeResult = {
|
|
43
53
|
exitCode: number;
|
|
44
54
|
};
|
|
45
55
|
/**
|
|
46
|
-
* `openteam
|
|
56
|
+
* `openteam console`: arranca el console web multi-sesión contra el repo
|
|
47
57
|
* actual, agregando **todas** las sesiones de opencode que escriben eventos en
|
|
48
58
|
* `.opencode/openteam/sessions/*.jsonl`. Imprime la URL y corre hasta que el
|
|
49
59
|
* usuario lo para (Ctrl+C). Solo escucha en loopback.
|
|
50
60
|
*/
|
|
51
|
-
export declare function
|
|
52
|
-
//# sourceMappingURL=
|
|
61
|
+
export declare function runConsoleServe(deps: ConsoleServeDeps, options: ConsoleServeOptions): Promise<ConsoleServeResult>;
|
|
62
|
+
//# sourceMappingURL=consoleServe.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"consoleServe.d.ts","sourceRoot":"","sources":["../../src/cli/consoleServe.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,oBAAoB,CAAC;AACpD,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,kBAAkB,CAAC;AACvD,OAAO,EACL,KAAK,aAAa,EAEnB,MAAM,2BAA2B,CAAC;AACnC,OAAO,EAAmB,KAAK,SAAS,EAAE,MAAM,gBAAgB,CAAC;AAEjE,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,kBAAkB,CAAC;AACnD,OAAO,KAAK,EAAE,cAAc,EAAE,kBAAkB,EAAE,MAAM,cAAc,CAAC;AAGvE,gEA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,sEAAsE;IACtE,WAAW,CAAC,EAAE,CAAC,GAAG,EAAE,MAAM,KAAK,IAAI,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;CACrD,CAAC;AAEF,MAAM,MAAM,mBAAmB,GAAG;IAChC,IAAI,EAAE,OAAO,CAAC;CACf,CAAC;AAEF;;;;GAIG;AACH,wBAAgB,qBAAqB,CAAC,IAAI,EAAE,SAAS,MAAM,EAAE,GAAG;IAC9D,MAAM,EAAE,OAAO,CAAC;IAChB,KAAK,EAAE,OAAO,CAAC;IACf,IAAI,EAAE,OAAO,CAAC;CACf,CAMA;AAED,MAAM,MAAM,kBAAkB,GAAG;IAAE,QAAQ,EAAE,MAAM,CAAA;CAAE,CAAC;AAEtD;;;;;GAKG;AACH,wBAAsB,eAAe,CACnC,IAAI,EAAE,gBAAgB,EACtB,OAAO,EAAE,mBAAmB,GAC3B,OAAO,CAAC,kBAAkB,CAAC,CAyE7B"}
|
|
@@ -0,0 +1,89 @@
|
|
|
1
|
+
import type { EventEmitter } from "node:events";
|
|
2
|
+
/**
|
|
3
|
+
* Comando `openteam tunnel`: expone la Console (y, opcionalmente, el servidor
|
|
4
|
+
* opencode para terminal remota) vía Microsoft Dev Tunnels. El **núcleo es puro**
|
|
5
|
+
* (parseo de flags, parseo de stdout de devtunnel, plan de seguridad §7); el
|
|
6
|
+
* runner solo orquesta el proceso y espera la señal de parada. Sin secretos en
|
|
7
|
+
* logs: passwords y tokens nunca se imprimen.
|
|
8
|
+
*/
|
|
9
|
+
export type TunnelOptions = {
|
|
10
|
+
/** Expone también el puerto de opencode (terminal remota). Requiere password. */
|
|
11
|
+
terminal: boolean;
|
|
12
|
+
/** Túnel anónimo (sin auth). Requiere `--yes` (doble confirmación). */
|
|
13
|
+
allowAnonymous: boolean;
|
|
14
|
+
/** Confirmación explícita para operaciones peligrosas (túnel anónimo). */
|
|
15
|
+
yes: boolean;
|
|
16
|
+
/** Override del puerto de la Console. */
|
|
17
|
+
consolePort?: number;
|
|
18
|
+
/** Override del puerto de opencode. */
|
|
19
|
+
opencodePort?: number;
|
|
20
|
+
};
|
|
21
|
+
/** Parsea los flags de `openteam tunnel`. Determinista. Pure. */
|
|
22
|
+
export declare function parseTunnelArgs(rest: readonly string[]): TunnelOptions;
|
|
23
|
+
export type TunnelUrl = {
|
|
24
|
+
port: number;
|
|
25
|
+
url: string;
|
|
26
|
+
};
|
|
27
|
+
/**
|
|
28
|
+
* Extrae las URLs públicas del stdout de `devtunnel host` (no tiene `--json`).
|
|
29
|
+
* Reconoce la línea `Hosting port <p> at <url>`. Determinista. Pure.
|
|
30
|
+
*/
|
|
31
|
+
export declare function parseDevtunnelUrls(stdout: string): TunnelUrl[];
|
|
32
|
+
export type TunnelPlan = {
|
|
33
|
+
/** Puertos a hospedar (siempre incluye la Console). */
|
|
34
|
+
ports: number[];
|
|
35
|
+
/** `true` si el puerto de opencode se expone (terminal remota disponible). */
|
|
36
|
+
exposeTerminal: boolean;
|
|
37
|
+
/** `true` si el túnel es anónimo (sin auth). */
|
|
38
|
+
allowAnonymous: boolean;
|
|
39
|
+
/** Avisos no bloqueantes a mostrar al usuario. */
|
|
40
|
+
warnings: string[];
|
|
41
|
+
/** Errores bloqueantes; si hay alguno, `ok` es `false`. */
|
|
42
|
+
errors: string[];
|
|
43
|
+
ok: boolean;
|
|
44
|
+
};
|
|
45
|
+
export type TunnelPlanInput = {
|
|
46
|
+
options: TunnelOptions;
|
|
47
|
+
consolePort: number;
|
|
48
|
+
opencodePort: number;
|
|
49
|
+
hasServerPassword: boolean;
|
|
50
|
+
};
|
|
51
|
+
/**
|
|
52
|
+
* Decide el plan del túnel aplicando el gating de seguridad §7 del PRD:
|
|
53
|
+
* loopback→túnel autenticado por defecto, password obligatoria para terminal
|
|
54
|
+
* remota, doble confirmación para túnel anónimo. Determinista. Pure.
|
|
55
|
+
*/
|
|
56
|
+
export declare function planTunnel(input: TunnelPlanInput): TunnelPlan;
|
|
57
|
+
/** Construye los argumentos de `devtunnel host` para el plan dado. Pure. */
|
|
58
|
+
export declare function buildDevtunnelArgs(plan: TunnelPlan): string[];
|
|
59
|
+
/** Proceso hijo mínimo que necesita el runner (subconjunto de `ChildProcess`). */
|
|
60
|
+
export type TunnelChild = {
|
|
61
|
+
stdout: EventEmitter | null;
|
|
62
|
+
stderr: EventEmitter | null;
|
|
63
|
+
on: (event: "exit", cb: (code: number | null) => void) => void;
|
|
64
|
+
kill: () => void;
|
|
65
|
+
};
|
|
66
|
+
export type TunnelRunDeps = {
|
|
67
|
+
/** `true` si el CLI `devtunnel` está instalado. */
|
|
68
|
+
isInstalled: () => Promise<boolean>;
|
|
69
|
+
/** `true` si hay sesión iniciada en Dev Tunnels. */
|
|
70
|
+
isLoggedIn: () => Promise<boolean>;
|
|
71
|
+
/** Lanza `devtunnel` con los args dados. */
|
|
72
|
+
spawn: (command: string, args: string[]) => TunnelChild;
|
|
73
|
+
consolePort: number;
|
|
74
|
+
opencodePort: number;
|
|
75
|
+
hasServerPassword: boolean;
|
|
76
|
+
/** Espera hasta que el usuario para el proceso (Ctrl+C). */
|
|
77
|
+
waitForSignal: () => Promise<void>;
|
|
78
|
+
log: (message: string) => void;
|
|
79
|
+
};
|
|
80
|
+
export type TunnelRunResult = {
|
|
81
|
+
exitCode: number;
|
|
82
|
+
};
|
|
83
|
+
/**
|
|
84
|
+
* `openteam tunnel`: comprueba `devtunnel` (instalado + login), aplica el plan de
|
|
85
|
+
* seguridad, hospeda los puertos y muestra las URLs públicas hasta Ctrl+C. Solo
|
|
86
|
+
* imprime URLs y avisos redactados; nunca password ni tokens.
|
|
87
|
+
*/
|
|
88
|
+
export declare function runTunnel(deps: TunnelRunDeps, options: TunnelOptions): Promise<TunnelRunResult>;
|
|
89
|
+
//# sourceMappingURL=tunnel.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"tunnel.d.ts","sourceRoot":"","sources":["../../src/cli/tunnel.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,Y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