@jmanuelcorral/openteam 0.1.20 → 0.1.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.md +14 -0
- package/dist/cli/dashboardServe.d.ts +45 -0
- package/dist/cli/dashboardServe.d.ts.map +1 -0
- package/dist/cli.js +1183 -479
- package/dist/commands/dashboard.d.ts.map +1 -1
- package/dist/commands/dispatch.d.ts.map +1 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +102 -80
- package/dist/web/git.d.ts +9 -0
- package/dist/web/git.d.ts.map +1 -0
- package/dist/web/server.d.ts +8 -7
- package/dist/web/server.d.ts.map +1 -1
- package/dist/web/start.d.ts +2 -2
- package/dist/web/start.d.ts.map +1 -1
- package/package.json +1 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"dashboard.d.ts","sourceRoot":"","sources":["../../src/commands/dashboard.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,kBAAkB,CAAC;AAExD;;;;;GAKG;AACH,wBAAgB,qBAAqB,CAAC,SAAS,EAAE,eAAe,GAAG,MAAM,
|
|
1
|
+
{"version":3,"file":"dashboard.d.ts","sourceRoot":"","sources":["../../src/commands/dashboard.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,kBAAkB,CAAC;AAExD;;;;;GAKG;AACH,wBAAgB,qBAAqB,CAAC,SAAS,EAAE,eAAe,GAAG,MAAM,CA4BxE"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"dispatch.d.ts","sourceRoot":"","sources":["../../src/commands/dispatch.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,kBAAkB,CAAC;AACvD,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,gBAAgB,CAAC;AAC3D,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,oBAAoB,CAAC;AACr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AAEF,MAAM,MAAM,SAAS,GAAG;IACtB,QAAQ,EAAE,MAAM,CAAC;IACjB,MAAM,EAAE,MAAM,CAAC;CAChB,CAAC;AAyNF,wBAAsB,MAAM,CAC1B,IAAI,EAAE,SAAS,MAAM,EAAE,EACvB,IAAI,EAAE,OAAO,GACZ,OAAO,CAAC,SAAS,CAAC,CA+DpB"}
|
package/dist/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,UAAU,EACV,KAAK,EAIN,MAAM,kBAAkB,CAAC;AAG1B,OAAO,KAAK,EAAE,MAAM,EAAe,YAAY,EAAE,MAAM,qBAAqB,CAAC;AAE7E,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,qBAAqB,CAAC;AAKnD,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,iBAAiB,CAAC;AACtD,OAAO,KAAK,EAAE,aAAa,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,UAAU,EACV,KAAK,EAIN,MAAM,kBAAkB,CAAC;AAG1B,OAAO,KAAK,EAAE,MAAM,EAAe,YAAY,EAAE,MAAM,qBAAqB,CAAC;AAE7E,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,qBAAqB,CAAC;AAKnD,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,iBAAiB,CAAC;AACtD,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,mBAAmB,CAAC;AAEvD,OAAO,EAAE,eAAe,EAAE,MAAM,kBAAkB,CAAC;AAmBnD,KAAK,gBAAgB,GAAG;IACtB,KAAK,CAAC,EAAE,OAAO,KAAK,CAAC;IACrB,UAAU,CAAC,EAAE,OAAO,UAAU,CAAC;CAChC,CAAC;AAcF,wBAAgB,2BAA2B,CAAC,KAAK,EAAE,OAAO,GAAG,IAAI,CAGhE;AAED,wBAAgB,iBAAiB,CAAC,KAAK,EAAE,OAAO,GAAG,IAAI,CAGtD;AA0BD,wBAAgB,kBAAkB,CAChC,QAAQ,EAAE,MAAM,EAChB,IAAI,GAAE,gBAAqB,GAC1B,CAAC,IAAI,EAAE,MAAM,KAAK,OAAO,CAAC,IAAI,CAAC,CAQjC;AAeD,wBAAgB,aAAa,CAAC,KAAK,EAAE,OAAO,GAAG,OAAO,CAOrD;AAmBD;;;;GAIG;AACH,wBAAgB,iBAAiB,CAC/B,KAAK,EAAE;IAAE,IAAI,EAAE,MAAM,CAAA;CAAE,EACvB,GAAG,EAAE,MAAM,MAAM,GAChB,aAAa,GAAG,SAAS,CAM3B;AAED,wBAAgB,aAAa,CAC3B,MAAM,EAAE,cAAc,EACtB,QAAQ,EAAE,eAAe,EACzB,aAAa,EAAE,MAAM,GACpB,OAAO,CA4DT;AAED,eAAO,MAAM,MAAM,EAAE,MAyDpB,CAAC;AAEF,QAAA,MAAM,MAAM,EAAE,YAGb,CAAC;AAEF,eAAe,MAAM,CAAC"}
|
package/dist/index.js
CHANGED
|
@@ -974,9 +974,12 @@ function renderDashboardStatus(dashboard) {
|
|
|
974
974
|
return [
|
|
975
975
|
"Dashboard: deshabilitado.",
|
|
976
976
|
"",
|
|
977
|
-
'Para activarlo, pon "dashboard": { "enabled": true }
|
|
978
|
-
"y recarga opencode. Se servirá (loopback) en:",
|
|
979
|
-
` ${url}
|
|
977
|
+
'Para activarlo dentro de opencode, pon "dashboard": { "enabled": true }',
|
|
978
|
+
"en .opencode/openteam.json y recarga opencode. Se servirá (loopback) en:",
|
|
979
|
+
` ${url}`,
|
|
980
|
+
"",
|
|
981
|
+
"O véelo ahora mismo sin editar la config:",
|
|
982
|
+
" openteam dashboard --serve (añade --open para abrir el navegador)"
|
|
980
983
|
].join(`
|
|
981
984
|
`);
|
|
982
985
|
}
|
|
@@ -988,7 +991,8 @@ function renderDashboardStatus(dashboard) {
|
|
|
988
991
|
dashboard.autoPortFallback ? " Puerto: con fallback automático si está ocupado" : " Puerto: fijo (sin fallback)",
|
|
989
992
|
"",
|
|
990
993
|
"Nota: solo escucha en loopback y nunca expone prompts (solo hashes).",
|
|
991
|
-
"El servidor corre dentro de la sesión de opencode; se cierra al salir."
|
|
994
|
+
"El servidor corre dentro de la sesión de opencode; se cierra al salir.",
|
|
995
|
+
"Para verlo fuera de opencode: openteam dashboard --serve"
|
|
992
996
|
].join(`
|
|
993
997
|
`);
|
|
994
998
|
}
|
|
@@ -1143,6 +1147,7 @@ var HELP = [
|
|
|
1143
1147
|
" openteam doctor Diagnóstico de runtimes y config",
|
|
1144
1148
|
" openteam agents Lista los agentes y el LLM (local/frontier) de cada uno",
|
|
1145
1149
|
" openteam dashboard Estado y URL del dashboard web (loopback)",
|
|
1150
|
+
" openteam dashboard --serve Levanta el dashboard web (Ctrl+C para parar; --open abre el navegador)",
|
|
1146
1151
|
" openteam report Resumen de coste/ahorro (telemetría)",
|
|
1147
1152
|
" openteam yolo status Muestra si el modo YOLO está activo",
|
|
1148
1153
|
" openteam yolo on Activa YOLO (opencode auto-aprueba todo)",
|
|
@@ -2025,6 +2030,25 @@ async function readCostRecords(path, deps = {}) {
|
|
|
2025
2030
|
}
|
|
2026
2031
|
}
|
|
2027
2032
|
|
|
2033
|
+
// src/web/git.ts
|
|
2034
|
+
function createGitLastCommit(exec) {
|
|
2035
|
+
return async () => {
|
|
2036
|
+
const output = await exec("git", [
|
|
2037
|
+
"log",
|
|
2038
|
+
"-1",
|
|
2039
|
+
"--pretty=format:%h%x1f%s%x1f%cI"
|
|
2040
|
+
]);
|
|
2041
|
+
if (output.exitCode !== 0) {
|
|
2042
|
+
return;
|
|
2043
|
+
}
|
|
2044
|
+
const [hash, subject, at] = output.stdout.trim().split("\x1F");
|
|
2045
|
+
if (hash === undefined || subject === undefined || at === undefined) {
|
|
2046
|
+
return;
|
|
2047
|
+
}
|
|
2048
|
+
return { hash, subject, at };
|
|
2049
|
+
};
|
|
2050
|
+
}
|
|
2051
|
+
|
|
2028
2052
|
// src/web/paths.ts
|
|
2029
2053
|
var DEFAULT_BACKLOG_PATH = ".opencode/openteam-backlog.md";
|
|
2030
2054
|
|
|
@@ -2047,6 +2071,11 @@ function createActivityBuffer(max = 100) {
|
|
|
2047
2071
|
};
|
|
2048
2072
|
}
|
|
2049
2073
|
|
|
2074
|
+
// src/web/server.ts
|
|
2075
|
+
import {
|
|
2076
|
+
createServer as createHttpServer
|
|
2077
|
+
} from "node:http";
|
|
2078
|
+
|
|
2050
2079
|
// src/dashboard/render.ts
|
|
2051
2080
|
var TIERS2 = [
|
|
2052
2081
|
"trivial",
|
|
@@ -2394,94 +2423,101 @@ data: ${json}
|
|
|
2394
2423
|
|
|
2395
2424
|
`;
|
|
2396
2425
|
}
|
|
2397
|
-
function
|
|
2398
|
-
|
|
2426
|
+
function tryListen(server, host, port) {
|
|
2427
|
+
return new Promise((resolve, reject) => {
|
|
2428
|
+
const onError = (error) => {
|
|
2429
|
+
server.removeListener("listening", onListening);
|
|
2430
|
+
if (isAddressInUse(error)) {
|
|
2431
|
+
resolve(false);
|
|
2432
|
+
} else {
|
|
2433
|
+
reject(error);
|
|
2434
|
+
}
|
|
2435
|
+
};
|
|
2436
|
+
const onListening = () => {
|
|
2437
|
+
server.removeListener("error", onError);
|
|
2438
|
+
resolve(true);
|
|
2439
|
+
};
|
|
2440
|
+
server.once("error", onError);
|
|
2441
|
+
server.once("listening", onListening);
|
|
2442
|
+
server.listen(port, host);
|
|
2443
|
+
});
|
|
2444
|
+
}
|
|
2445
|
+
async function createDashboardServer(deps) {
|
|
2446
|
+
const create = deps.createServer ?? createHttpServer;
|
|
2399
2447
|
const log = deps.log ?? ((message) => console.log(message));
|
|
2400
|
-
const encoder = new TextEncoder;
|
|
2401
2448
|
const clients = new Set;
|
|
2402
|
-
const
|
|
2403
|
-
const url2 = new URL(request.url);
|
|
2449
|
+
const handle = async (request, response) => {
|
|
2404
2450
|
if (request.method !== "GET") {
|
|
2405
|
-
|
|
2451
|
+
response.writeHead(405).end("method not allowed");
|
|
2452
|
+
return;
|
|
2406
2453
|
}
|
|
2407
|
-
|
|
2408
|
-
|
|
2454
|
+
const url2 = new URL(request.url ?? "/", "http://localhost");
|
|
2455
|
+
const path = url2.pathname;
|
|
2456
|
+
if (path === "/" || path === "/index.html") {
|
|
2457
|
+
response.writeHead(200, HTML_HEADERS).end(await renderState(deps));
|
|
2458
|
+
return;
|
|
2409
2459
|
}
|
|
2410
|
-
if (
|
|
2411
|
-
|
|
2460
|
+
if (path === "/api/state") {
|
|
2461
|
+
response.writeHead(200, JSON_HEADERS).end(await stateJson(deps));
|
|
2462
|
+
return;
|
|
2412
2463
|
}
|
|
2413
|
-
if (
|
|
2414
|
-
|
|
2415
|
-
|
|
2416
|
-
});
|
|
2464
|
+
if (path === "/healthz") {
|
|
2465
|
+
response.writeHead(200, JSON_HEADERS).end(JSON.stringify({ ok: true }));
|
|
2466
|
+
return;
|
|
2417
2467
|
}
|
|
2418
|
-
if (
|
|
2419
|
-
|
|
2420
|
-
|
|
2421
|
-
|
|
2422
|
-
|
|
2423
|
-
|
|
2424
|
-
|
|
2425
|
-
|
|
2426
|
-
|
|
2427
|
-
|
|
2428
|
-
cancel(controller) {
|
|
2429
|
-
clients.delete(controller);
|
|
2430
|
-
}
|
|
2468
|
+
if (path === "/favicon.ico") {
|
|
2469
|
+
response.writeHead(204).end();
|
|
2470
|
+
return;
|
|
2471
|
+
}
|
|
2472
|
+
if (path === "/events") {
|
|
2473
|
+
response.writeHead(200, SSE_HEADERS);
|
|
2474
|
+
response.write(sseMessage(await stateJson(deps)));
|
|
2475
|
+
clients.add(response);
|
|
2476
|
+
request.on("close", () => {
|
|
2477
|
+
clients.delete(response);
|
|
2431
2478
|
});
|
|
2432
|
-
return
|
|
2479
|
+
return;
|
|
2433
2480
|
}
|
|
2434
|
-
|
|
2481
|
+
response.writeHead(404).end("not found");
|
|
2435
2482
|
};
|
|
2483
|
+
const server = create((request, response) => {
|
|
2484
|
+
handle(request, response);
|
|
2485
|
+
});
|
|
2436
2486
|
const maxAttempts = deps.config.autoPortFallback ? 20 : 1;
|
|
2437
|
-
let
|
|
2438
|
-
let
|
|
2487
|
+
let bound = false;
|
|
2488
|
+
let boundPort = deps.config.port;
|
|
2439
2489
|
for (let offset = 0;offset < maxAttempts; offset += 1) {
|
|
2440
2490
|
const port = deps.config.port + offset;
|
|
2441
2491
|
if (port > 65535) {
|
|
2442
2492
|
break;
|
|
2443
2493
|
}
|
|
2444
|
-
|
|
2445
|
-
|
|
2446
|
-
|
|
2447
|
-
port,
|
|
2448
|
-
fetch: handler
|
|
2449
|
-
});
|
|
2494
|
+
if (await tryListen(server, deps.config.host, port)) {
|
|
2495
|
+
boundPort = port;
|
|
2496
|
+
bound = true;
|
|
2450
2497
|
break;
|
|
2451
|
-
} catch (error) {
|
|
2452
|
-
lastError = error;
|
|
2453
|
-
if (!isAddressInUse(error)) {
|
|
2454
|
-
throw error;
|
|
2455
|
-
}
|
|
2456
2498
|
}
|
|
2457
2499
|
}
|
|
2458
|
-
if (
|
|
2459
|
-
throw
|
|
2500
|
+
if (!bound) {
|
|
2501
|
+
throw new Error("dashboard: no available port");
|
|
2460
2502
|
}
|
|
2461
|
-
const boundPort = server.port ?? deps.config.port;
|
|
2462
2503
|
const url = `http://${deps.config.host}:${boundPort}`;
|
|
2463
2504
|
log(`[openteam] dashboard en ${url}`);
|
|
2464
2505
|
const notify = async () => {
|
|
2465
2506
|
if (clients.size === 0) {
|
|
2466
2507
|
return;
|
|
2467
2508
|
}
|
|
2468
|
-
const message =
|
|
2469
|
-
for (const
|
|
2470
|
-
|
|
2471
|
-
controller.enqueue(message);
|
|
2472
|
-
} catch {
|
|
2473
|
-
clients.delete(controller);
|
|
2474
|
-
}
|
|
2509
|
+
const message = sseMessage(await stateJson(deps));
|
|
2510
|
+
for (const response of clients) {
|
|
2511
|
+
response.write(message);
|
|
2475
2512
|
}
|
|
2476
2513
|
};
|
|
2477
2514
|
const close = () => {
|
|
2478
|
-
for (const
|
|
2479
|
-
|
|
2480
|
-
controller.close();
|
|
2481
|
-
} catch {}
|
|
2515
|
+
for (const response of clients) {
|
|
2516
|
+
response.end();
|
|
2482
2517
|
}
|
|
2483
2518
|
clients.clear();
|
|
2484
|
-
server.
|
|
2519
|
+
server.close();
|
|
2520
|
+
server.closeAllConnections?.();
|
|
2485
2521
|
};
|
|
2486
2522
|
return { url, port: boundPort, notify, close };
|
|
2487
2523
|
}
|
|
@@ -2558,6 +2594,9 @@ function watchSources(paths, onChange, deps, debounceMs = 250) {
|
|
|
2558
2594
|
|
|
2559
2595
|
// src/web/start.ts
|
|
2560
2596
|
function startDashboard(deps) {
|
|
2597
|
+
return createDashboardRuntime(deps);
|
|
2598
|
+
}
|
|
2599
|
+
async function createDashboardRuntime(deps) {
|
|
2561
2600
|
const backlogPath = deps.backlogPath ?? DEFAULT_BACKLOG_PATH;
|
|
2562
2601
|
const activity = createActivityBuffer(deps.config.recentRoutes);
|
|
2563
2602
|
const readSnapshot = createSnapshotReader({
|
|
@@ -2575,7 +2614,7 @@ function startDashboard(deps) {
|
|
|
2575
2614
|
...deps.session !== undefined ? { session: deps.session } : {}
|
|
2576
2615
|
});
|
|
2577
2616
|
const createServer = deps.serve ?? createDashboardServer;
|
|
2578
|
-
const server = createServer({
|
|
2617
|
+
const server = await createServer({
|
|
2579
2618
|
readSnapshot,
|
|
2580
2619
|
config: deps.config,
|
|
2581
2620
|
...deps.log !== undefined ? { log: deps.log } : {}
|
|
@@ -2657,23 +2696,6 @@ async function readTextOptional(path) {
|
|
|
2657
2696
|
throw error;
|
|
2658
2697
|
}
|
|
2659
2698
|
}
|
|
2660
|
-
function createGitLastCommit(exec) {
|
|
2661
|
-
return async () => {
|
|
2662
|
-
const output = await exec("git", [
|
|
2663
|
-
"log",
|
|
2664
|
-
"-1",
|
|
2665
|
-
"--pretty=format:%h%x1f%s%x1f%cI"
|
|
2666
|
-
]);
|
|
2667
|
-
if (output.exitCode !== 0) {
|
|
2668
|
-
return;
|
|
2669
|
-
}
|
|
2670
|
-
const [hash, subject, at] = output.stdout.trim().split("\x1F");
|
|
2671
|
-
if (hash === undefined || subject === undefined || at === undefined) {
|
|
2672
|
-
return;
|
|
2673
|
-
}
|
|
2674
|
-
return { hash, subject, at };
|
|
2675
|
-
};
|
|
2676
|
-
}
|
|
2677
2699
|
var DASHBOARD_EVENT_SUMMARIES = {
|
|
2678
2700
|
"session.created": "Sesión creada",
|
|
2679
2701
|
"session.idle": "Sesión en reposo",
|
|
@@ -2764,7 +2786,7 @@ var server = async (ctx, rawOptions) => {
|
|
|
2764
2786
|
let dashboard;
|
|
2765
2787
|
if (config.dashboard.enabled) {
|
|
2766
2788
|
try {
|
|
2767
|
-
dashboard = startDashboard({
|
|
2789
|
+
dashboard = await startDashboard({
|
|
2768
2790
|
config: config.dashboard,
|
|
2769
2791
|
telemetryPath,
|
|
2770
2792
|
agentDir: dirname2(ORCHESTRATOR_AGENT_PATH),
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import type { CommitView } from "../dashboard/types";
|
|
2
|
+
import type { ExecLike } from "../local/foundry-local";
|
|
3
|
+
/**
|
|
4
|
+
* Lee el último commit (`git log -1`) usando el `exec` inyectado y lo devuelve
|
|
5
|
+
* como `CommitView`. Devuelve `undefined` si git falla o la salida es inválida.
|
|
6
|
+
* El separador `\u001f` (Unit Separator) evita colisiones con el asunto.
|
|
7
|
+
*/
|
|
8
|
+
export declare function createGitLastCommit(exec: ExecLike): () => Promise<CommitView | undefined>;
|
|
9
|
+
//# sourceMappingURL=git.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"git.d.ts","sourceRoot":"","sources":["../../src/web/git.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,oBAAoB,CAAC;AACrD,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,wBAAwB,CAAC;AAEvD;;;;GAIG;AACH,wBAAgB,mBAAmB,CACjC,IAAI,EAAE,QAAQ,GACb,MAAM,OAAO,CAAC,UAAU,GAAG,SAAS,CAAC,CAgBvC"}
|
package/dist/web/server.d.ts
CHANGED
|
@@ -1,11 +1,12 @@
|
|
|
1
|
+
import { createServer as createHttpServer } from "node:http";
|
|
1
2
|
import type { DashboardConfig } from "../config/schema";
|
|
2
3
|
import type { DashboardInputs } from "../dashboard/state";
|
|
3
4
|
export type DashboardServerDeps = {
|
|
4
5
|
/** Relee las fuentes y produce los inputs crudos del dashboard. */
|
|
5
6
|
readSnapshot: () => Promise<DashboardInputs>;
|
|
6
7
|
config: DashboardConfig;
|
|
7
|
-
/** Inyectable para tests; por defecto `
|
|
8
|
-
|
|
8
|
+
/** Inyectable para tests; por defecto el `createServer` de `node:http`. */
|
|
9
|
+
createServer?: typeof createHttpServer;
|
|
9
10
|
/** Logger (por defecto `console`). */
|
|
10
11
|
log?: (message: string) => void;
|
|
11
12
|
};
|
|
@@ -17,10 +18,10 @@ export type DashboardServer = {
|
|
|
17
18
|
close: () => void;
|
|
18
19
|
};
|
|
19
20
|
/**
|
|
20
|
-
* Arranca el servidor del dashboard con `
|
|
21
|
-
* `/api/state` (JSON), `/events` (SSE) y `/healthz`.
|
|
22
|
-
* ≠ GET → 405; ruta desconocida → 404. Con
|
|
23
|
-
* sucesivos si el preferido está ocupado.
|
|
21
|
+
* Arranca el servidor del dashboard con `node:http` (portable a Node y Bun) en
|
|
22
|
+
* loopback. Sirve `/` (HTML), `/api/state` (JSON), `/events` (SSE) y `/healthz`.
|
|
23
|
+
* Solo lectura: cualquier método ≠ GET → 405; ruta desconocida → 404. Con
|
|
24
|
+
* `autoPortFallback` prueba puertos sucesivos si el preferido está ocupado.
|
|
24
25
|
*/
|
|
25
|
-
export declare function createDashboardServer(deps: DashboardServerDeps): DashboardServer
|
|
26
|
+
export declare function createDashboardServer(deps: DashboardServerDeps): Promise<DashboardServer>;
|
|
26
27
|
//# sourceMappingURL=server.d.ts.map
|
package/dist/web/server.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"server.d.ts","sourceRoot":"","sources":["../../src/web/server.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,kBAAkB,CAAC;AAExD,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,oBAAoB,CAAC;AAY1D,MAAM,MAAM,mBAAmB,GAAG;IAChC,mEAAmE;IACnE,YAAY,EAAE,MAAM,OAAO,CAAC,eAAe,CAAC,CAAC;IAC7C,MAAM,EAAE,eAAe,CAAC;IACxB,
|
|
1
|
+
{"version":3,"file":"server.d.ts","sourceRoot":"","sources":["../../src/web/server.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,YAAY,IAAI,gBAAgB,EAIjC,MAAM,WAAW,CAAC;AAEnB,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,kBAAkB,CAAC;AAExD,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,oBAAoB,CAAC;AAY1D,MAAM,MAAM,mBAAmB,GAAG;IAChC,mEAAmE;IACnE,YAAY,EAAE,MAAM,OAAO,CAAC,eAAe,CAAC,CAAC;IAC7C,MAAM,EAAE,eAAe,CAAC;IACxB,2EAA2E;IAC3E,YAAY,CAAC,EAAE,OAAO,gBAAgB,CAAC;IACvC,sCAAsC;IACtC,GAAG,CAAC,EAAE,CAAC,OAAO,EAAE,MAAM,KAAK,IAAI,CAAC;CACjC,CAAC;AAEF,MAAM,MAAM,eAAe,GAAG;IAC5B,GAAG,EAAE,MAAM,CAAC;IACZ,IAAI,EAAE,MAAM,CAAC;IACb,oEAAoE;IACpE,MAAM,EAAE,MAAM,OAAO,CAAC,IAAI,CAAC,CAAC;IAC5B,KAAK,EAAE,MAAM,IAAI,CAAC;CACnB,CAAC;AAkDF;;;;;GAKG;AACH,wBAAsB,qBAAqB,CACzC,IAAI,EAAE,mBAAmB,GACxB,OAAO,CAAC,eAAe,CAAC,CA4F1B"}
|
package/dist/web/start.d.ts
CHANGED
|
@@ -29,8 +29,8 @@ export type DashboardRuntime = {
|
|
|
29
29
|
};
|
|
30
30
|
/**
|
|
31
31
|
* Compone el runtime del dashboard: buffer de actividad + lector de snapshot +
|
|
32
|
-
* servidor `
|
|
32
|
+
* servidor `node:http` + watcher de ficheros. El plugin lo arranca cuando
|
|
33
33
|
* `config.dashboard.enabled` y lo cierra al terminar la sesión.
|
|
34
34
|
*/
|
|
35
|
-
export declare function startDashboard(deps: DashboardRuntimeDeps): DashboardRuntime
|
|
35
|
+
export declare function startDashboard(deps: DashboardRuntimeDeps): Promise<DashboardRuntime>;
|
|
36
36
|
//# sourceMappingURL=start.d.ts.map
|
package/dist/web/start.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"start.d.ts","sourceRoot":"","sources":["../../src/web/start.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,IAAI,OAAO,EAAE,MAAM,SAAS,CAAC;AAE3C,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,oBAAoB,CAAC;AACpD,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,kBAAkB,CAAC;AACxD,OAAO,KAAK,EAAE,aAAa,EAAE,UAAU,EAAE,MAAM,oBAAoB,CAAC;AAOpE,MAAM,MAAM,oBAAoB,GAAG;IACjC,MAAM,EAAE,eAAe,CAAC;IACxB,aAAa,EAAE,MAAM,CAAC;IACtB,QAAQ,EAAE,MAAM,CAAC;IACjB,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,QAAQ,EAAE,CAAC,IAAI,EAAE,MAAM,KAAK,OAAO,CAAC,MAAM,GAAG,SAAS,CAAC,CAAC;IACxD,cAAc,EAAE,CAAC,GAAG,EAAE,MAAM,KAAK,OAAO,CAAC,SAAS,EAAE,CAAC,CAAC;IACtD,GAAG,EAAE,MAAM,MAAM,CAAC;IAClB,aAAa,CAAC,EAAE,MAAM,OAAO,CAAC,UAAU,GAAG,SAAS,CAAC,CAAC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