@jmanuelcorral/openteam 0.1.40 → 0.1.42
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/AGENTS.md +15 -0
- package/README.es.md +1 -1
- package/README.md +1 -1
- package/dist/cli.js +457 -37
- package/dist/commands/graph.d.ts +73 -0
- package/dist/commands/graph.d.ts.map +1 -0
- package/dist/config/load.d.ts.map +1 -1
- package/dist/config/migrations.d.ts +27 -0
- package/dist/config/migrations.d.ts.map +1 -0
- package/dist/config/resolve.d.ts +34 -0
- package/dist/config/resolve.d.ts.map +1 -0
- package/dist/config/schema.d.ts +57 -0
- package/dist/config/schema.d.ts.map +1 -1
- package/dist/console/assets.d.ts +9 -1
- package/dist/console/assets.d.ts.map +1 -1
- package/dist/console/opencodeClient.d.ts +6 -0
- package/dist/console/opencodeClient.d.ts.map +1 -1
- package/dist/console/protocol.d.ts +8 -0
- package/dist/console/protocol.d.ts.map +1 -1
- package/dist/console/render.d.ts +25 -0
- package/dist/console/render.d.ts.map +1 -1
- package/dist/context/redaction.d.ts +48 -0
- package/dist/context/redaction.d.ts.map +1 -0
- package/dist/context/schema.d.ts +115 -0
- package/dist/context/schema.d.ts.map +1 -0
- package/dist/context/types.d.ts +8 -0
- package/dist/context/types.d.ts.map +1 -0
- package/dist/graph/events.d.ts +25 -0
- package/dist/graph/events.d.ts.map +1 -0
- package/dist/graph/ids.d.ts +5 -0
- package/dist/graph/ids.d.ts.map +1 -0
- package/dist/graph/planner.d.ts +15 -0
- package/dist/graph/planner.d.ts.map +1 -0
- package/dist/graph/policies.d.ts +34 -0
- package/dist/graph/policies.d.ts.map +1 -0
- package/dist/graph/privacyPolicy.d.ts +29 -0
- package/dist/graph/privacyPolicy.d.ts.map +1 -0
- package/dist/graph/reducer.d.ts +27 -0
- package/dist/graph/reducer.d.ts.map +1 -0
- package/dist/graph/replay.d.ts +20 -0
- package/dist/graph/replay.d.ts.map +1 -0
- package/dist/graph/reviewerPolicy.d.ts +27 -0
- package/dist/graph/reviewerPolicy.d.ts.map +1 -0
- package/dist/graph/schema.d.ts +220 -0
- package/dist/graph/schema.d.ts.map +1 -0
- package/dist/graph/types.d.ts +40 -0
- package/dist/graph/types.d.ts.map +1 -0
- package/dist/graph/validate.d.ts +19 -0
- package/dist/graph/validate.d.ts.map +1 -0
- package/dist/index.js +46 -3
- package/dist/orchestrator/graphCancellation.d.ts +84 -0
- package/dist/orchestrator/graphCancellation.d.ts.map +1 -0
- package/dist/orchestrator/graphEffects.d.ts +63 -0
- package/dist/orchestrator/graphEffects.d.ts.map +1 -0
- package/dist/orchestrator/graphReview.d.ts +84 -0
- package/dist/orchestrator/graphReview.d.ts.map +1 -0
- package/dist/orchestrator/graphRuntime.d.ts +69 -0
- package/dist/orchestrator/graphRuntime.d.ts.map +1 -0
- package/dist/orchestrator/opencodeSessionAdapter.d.ts +117 -0
- package/dist/orchestrator/opencodeSessionAdapter.d.ts.map +1 -0
- package/dist/orchestrator/sdd.d.ts +38 -2
- package/dist/orchestrator/sdd.d.ts.map +1 -1
- package/dist/orchestrator/sddCompiler.d.ts +44 -0
- package/dist/orchestrator/sddCompiler.d.ts.map +1 -0
- package/dist/orchestrator/sessionReconciler.d.ts +74 -0
- package/dist/orchestrator/sessionReconciler.d.ts.map +1 -0
- package/dist/orchestrator/shadowComparator.d.ts +62 -0
- package/dist/orchestrator/shadowComparator.d.ts.map +1 -0
- package/dist/orchestrator/worktreeAdapter.d.ts +39 -0
- package/dist/orchestrator/worktreeAdapter.d.ts.map +1 -0
- package/dist/orchestrator/worktreeDispatch.d.ts +84 -0
- package/dist/orchestrator/worktreeDispatch.d.ts.map +1 -0
- package/dist/orchestrator/worktreeReconciler.d.ts +74 -0
- package/dist/orchestrator/worktreeReconciler.d.ts.map +1 -0
- package/dist/storage/graph/codec.d.ts +52 -0
- package/dist/storage/graph/codec.d.ts.map +1 -0
- package/dist/storage/graph/fsGraphJournal.d.ts +3 -0
- package/dist/storage/graph/fsGraphJournal.d.ts.map +1 -0
- package/dist/storage/graph/importLegacy.d.ts +62 -0
- package/dist/storage/graph/importLegacy.d.ts.map +1 -0
- package/dist/storage/graph/memoryGraphJournal.d.ts +11 -0
- package/dist/storage/graph/memoryGraphJournal.d.ts.map +1 -0
- package/dist/storage/graph/migrateLegacyBriefs.d.ts +32 -0
- package/dist/storage/graph/migrateLegacyBriefs.d.ts.map +1 -0
- package/dist/storage/graph/projections.d.ts +31 -0
- package/dist/storage/graph/projections.d.ts.map +1 -0
- package/dist/storage/graph/provider.d.ts +52 -0
- package/dist/storage/graph/provider.d.ts.map +1 -0
- package/dist/storage/graph/recovery.d.ts +38 -0
- package/dist/storage/graph/recovery.d.ts.map +1 -0
- package/dist/storage/graph/runRegistry.d.ts +17 -0
- package/dist/storage/graph/runRegistry.d.ts.map +1 -0
- package/dist/storage/graph/snapshot.d.ts +44 -0
- package/dist/storage/graph/snapshot.d.ts.map +1 -0
- package/dist/storage/graph/workspaceLease.d.ts +36 -0
- package/dist/storage/graph/workspaceLease.d.ts.map +1 -0
- package/dist/storage/graph/worktreeRegistry.d.ts +29 -0
- package/dist/storage/graph/worktreeRegistry.d.ts.map +1 -0
- package/dist/storage/graph/writer.d.ts +20 -0
- package/dist/storage/graph/writer.d.ts.map +1 -0
- package/dist/telemetry/graphProjection.d.ts +36 -0
- package/dist/telemetry/graphProjection.d.ts.map +1 -0
- package/dist/telemetry/graphView.d.ts +75 -0
- package/dist/telemetry/graphView.d.ts.map +1 -0
- package/dist/web/console.d.ts +6 -0
- package/dist/web/console.d.ts.map +1 -1
- package/dist/web/graphRoute.d.ts +36 -0
- package/dist/web/graphRoute.d.ts.map +1 -0
- package/dist/web/server.d.ts +21 -2
- package/dist/web/server.d.ts.map +1 -1
- package/dist/web/start.d.ts +11 -0
- package/dist/web/start.d.ts.map +1 -1
- package/package.json +1 -1
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
import type { GraphEventV1, GraphSpecV1 } from "../../graph/schema";
|
|
2
|
+
import type { GraphState } from "../../graph/types";
|
|
3
|
+
/**
|
|
4
|
+
* Snapshots versionados del estado reducido con equivalencia al replay total.
|
|
5
|
+
*
|
|
6
|
+
* Un snapshot captura el `GraphState` tras aplicar los primeros `count` eventos
|
|
7
|
+
* junto al digest de cadena de ese prefijo (`prefixDigest`). Cargar puede así
|
|
8
|
+
* arrancar desde el snapshot y reproducir sólo la cola, obteniendo exactamente
|
|
9
|
+
* el mismo estado que reproducir el journal completo desde génesis.
|
|
10
|
+
*
|
|
11
|
+
* El journal sigue siendo la autoridad: el snapshot es un acelerador desechable.
|
|
12
|
+
* - Borrarlo no pierde autoridad: se recae al replay total del journal.
|
|
13
|
+
* - Un snapshot corrupto o de versión desconocida no se confía: se recae **sólo**
|
|
14
|
+
* al replay estricto del journal (nunca a un estado a medio validar).
|
|
15
|
+
*
|
|
16
|
+
* La integridad se ancla con un checksum sobre el sobre y el hash del estado, y
|
|
17
|
+
* el `prefixDigest` ata el snapshot a un prefijo concreto del journal.
|
|
18
|
+
*/
|
|
19
|
+
export declare const SNAPSHOT_VERSION = 1;
|
|
20
|
+
/** Snapshot del estado reducido en un punto del journal. */
|
|
21
|
+
export type GraphSnapshot = {
|
|
22
|
+
version: number;
|
|
23
|
+
runID: string;
|
|
24
|
+
count: number;
|
|
25
|
+
prefixDigest: string;
|
|
26
|
+
state: GraphState;
|
|
27
|
+
};
|
|
28
|
+
/** Construye un snapshot puro tras los primeros `count` eventos del journal. */
|
|
29
|
+
export declare function snapshotAt(spec: GraphSpecV1, events: readonly GraphEventV1[], count: number): GraphSnapshot;
|
|
30
|
+
/** Persiste el snapshot de forma durable en `<root>/<runID>/snapshot.json`. */
|
|
31
|
+
export declare function writeSnapshot(root: string, snapshot: GraphSnapshot): void;
|
|
32
|
+
/**
|
|
33
|
+
* Lee el snapshot si es íntegro y de versión conocida; devuelve `undefined`
|
|
34
|
+
* (para recaer al replay) si falta, es ilegible, tiene versión desconocida o su
|
|
35
|
+
* checksum no cuadra.
|
|
36
|
+
*/
|
|
37
|
+
export declare function readSnapshot(root: string, runID: string): GraphSnapshot | undefined;
|
|
38
|
+
/**
|
|
39
|
+
* Resuelve el estado del run: si el snapshot ata al prefijo del journal, arranca
|
|
40
|
+
* desde él y reproduce la cola; en cualquier otro caso recae al replay estricto
|
|
41
|
+
* y total del journal, que es la autoridad.
|
|
42
|
+
*/
|
|
43
|
+
export declare function resolveState(spec: GraphSpecV1, events: readonly GraphEventV1[], snapshot: GraphSnapshot | undefined): GraphState;
|
|
44
|
+
//# sourceMappingURL=snapshot.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"snapshot.d.ts","sourceRoot":"","sources":["../../../src/storage/graph/snapshot.ts"],"names":[],"mappings":"AAOA,OAAO,KAAK,EAAE,YAAY,EAAE,WAAW,EAAE,MAAM,oBAAoB,CAAC;AACpE,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,mBAAmB,CAAC;AAIpD;;;;;;;;;;;;;;;GAeG;AAEH,eAAO,MAAM,gBAAgB,IAAI,CAAC;AAIlC,4DAA4D;AAC5D,MAAM,MAAM,aAAa,GAAG;IAC1B,OAAO,EAAE,MAAM,CAAC;IAChB,KAAK,EAAE,MAAM,CAAC;IACd,KAAK,EAAE,MAAM,CAAC;IACd,YAAY,EAAE,MAAM,CAAC;IACrB,KAAK,EAAE,UAAU,CAAC;CACnB,CAAC;AAkDF,gFAAgF;AAChF,wBAAgB,UAAU,CACxB,IAAI,EAAE,WAAW,EACjB,MAAM,EAAE,SAAS,YAAY,EAAE,EAC/B,KAAK,EAAE,MAAM,GACZ,aAAa,CASf;AAED,+EAA+E;AAC/E,wBAAgB,aAAa,CAAC,IAAI,EAAE,MAAM,EAAE,QAAQ,EAAE,aAAa,GAAG,IAAI,CAIzE;AAED;;;;GAIG;AACH,wBAAgB,YAAY,CAC1B,IAAI,EAAE,MAAM,EACZ,KAAK,EAAE,MAAM,GACZ,aAAa,GAAG,SAAS,CA8B3B;AA4BD;;;;GAIG;AACH,wBAAgB,YAAY,CAC1B,IAAI,EAAE,WAAW,EACjB,MAAM,EAAE,SAAS,YAAY,EAAE,EAC/B,QAAQ,EAAE,aAAa,GAAG,SAAS,GAClC,UAAU,CAKZ"}
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
import { z } from "zod";
|
|
2
|
+
import { type RunRegistry } from "./runRegistry";
|
|
3
|
+
declare const leaseRecordSchema: z.ZodObject<{
|
|
4
|
+
runID: z.ZodString;
|
|
5
|
+
holder: z.ZodString;
|
|
6
|
+
token: z.ZodString;
|
|
7
|
+
released: z.ZodBoolean;
|
|
8
|
+
}, z.core.$strip>;
|
|
9
|
+
/** Registro persistido de un lease del workspace. */
|
|
10
|
+
export type LeaseRecord = z.infer<typeof leaseRecordSchema>;
|
|
11
|
+
/** Taxonomía cerrada de errores del lease. */
|
|
12
|
+
export type LeaseErrorCode = "held" | "not-holder" | "not-found" | "corrupt";
|
|
13
|
+
/** Error tipado de una operación inválida sobre el lease. */
|
|
14
|
+
export declare class LeaseError extends Error {
|
|
15
|
+
readonly code: LeaseErrorCode;
|
|
16
|
+
readonly detail: string;
|
|
17
|
+
constructor(code: LeaseErrorCode, detail: string);
|
|
18
|
+
}
|
|
19
|
+
/** Concesión de un lease a un holder concreto. */
|
|
20
|
+
export type LeaseHandle = {
|
|
21
|
+
readonly runID: string;
|
|
22
|
+
readonly holder: string;
|
|
23
|
+
readonly token: string;
|
|
24
|
+
};
|
|
25
|
+
/** Contrato del lease exclusivo del workspace. */
|
|
26
|
+
export interface WorkspaceLease {
|
|
27
|
+
/** Adquiere el run para `holder`; readquisición del mismo holder es idempotente. */
|
|
28
|
+
acquire(runID: string, holder: string): Promise<LeaseHandle>;
|
|
29
|
+
/** Libera el run de forma durable; el registro deja de listarlo. */
|
|
30
|
+
release(handle: LeaseHandle): Promise<void>;
|
|
31
|
+
/** Devuelve el registro persistido del lease, o `undefined` si no existe. */
|
|
32
|
+
inspect(runID: string): Promise<LeaseRecord | undefined>;
|
|
33
|
+
}
|
|
34
|
+
export declare function createWorkspaceLease(root: string, registry?: RunRegistry): WorkspaceLease;
|
|
35
|
+
export {};
|
|
36
|
+
//# sourceMappingURL=workspaceLease.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"workspaceLease.d.ts","sourceRoot":"","sources":["../../../src/storage/graph/workspaceLease.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAGxB,OAAO,EAAqB,KAAK,WAAW,EAAE,MAAM,eAAe,CAAC;AAuBpE,QAAA,MAAM,iBAAiB;;;;;iBAKrB,CAAC;AAEH,qDAAqD;AACrD,MAAM,MAAM,WAAW,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,iBAAiB,CAAC,CAAC;AAE5D,8CAA8C;AAC9C,MAAM,MAAM,cAAc,GAAG,MAAM,GAAG,YAAY,GAAG,WAAW,GAAG,SAAS,CAAC;AAE7E,6DAA6D;AAC7D,qBAAa,UAAW,SAAQ,KAAK;IACnC,QAAQ,CAAC,IAAI,EAAE,cAAc,CAAC;IAC9B,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAC;gBAEZ,IAAI,EAAE,cAAc,EAAE,MAAM,EAAE,MAAM;CAMjD;AAED,kDAAkD;AAClD,MAAM,MAAM,WAAW,GAAG;IACxB,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAC;IACvB,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAC;IACxB,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAC;CACxB,CAAC;AAEF,kDAAkD;AAClD,MAAM,WAAW,cAAc;IAC7B,oFAAoF;IACpF,OAAO,CAAC,KAAK,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,GAAG,OAAO,CAAC,WAAW,CAAC,CAAC;IAC7D,oEAAoE;IACpE,OAAO,CAAC,MAAM,EAAE,WAAW,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;IAC5C,6EAA6E;IAC7E,OAAO,CAAC,KAAK,EAAE,MAAM,GAAG,OAAO,CAAC,WAAW,GAAG,SAAS,CAAC,CAAC;CAC1D;AAED,wBAAgB,oBAAoB,CAClC,IAAI,EAAE,MAAM,EACZ,QAAQ,GAAE,WAAqC,GAC9C,cAAc,CA0EhB"}
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import { z } from "zod";
|
|
2
|
+
declare const bindingSchema: z.ZodObject<{
|
|
3
|
+
runID: z.ZodString;
|
|
4
|
+
worktreePath: z.ZodString;
|
|
5
|
+
}, z.core.$strip>;
|
|
6
|
+
/** Vinculación persistida de un run a su worktree. */
|
|
7
|
+
export type WorktreeBinding = z.infer<typeof bindingSchema>;
|
|
8
|
+
/** Taxonomía cerrada de errores del registro de worktrees. */
|
|
9
|
+
export type WorktreeRegistryErrorCode = "conflict" | "invalid-run" | "invalid-path" | "corrupt";
|
|
10
|
+
/** Error tipado de una operación inválida sobre el registro. */
|
|
11
|
+
export declare class WorktreeRegistryError extends Error {
|
|
12
|
+
readonly code: WorktreeRegistryErrorCode;
|
|
13
|
+
readonly detail: string;
|
|
14
|
+
constructor(code: WorktreeRegistryErrorCode, detail: string);
|
|
15
|
+
}
|
|
16
|
+
/** Contrato del registro durable de vinculaciones run->worktree. */
|
|
17
|
+
export interface WorktreeRegistry {
|
|
18
|
+
/** Vincula `runID` a `worktreePath` de forma durable e idempotente. */
|
|
19
|
+
bind(runID: string, worktreePath: string): Promise<WorktreeBinding>;
|
|
20
|
+
/** Resuelve la ruta del worktree del run, o `undefined` si no está vinculado. */
|
|
21
|
+
resolve(runID: string): Promise<string | undefined>;
|
|
22
|
+
/** Elimina la vinculación del run (idempotente). */
|
|
23
|
+
unbind(runID: string): Promise<void>;
|
|
24
|
+
/** Lista las vinculaciones, ordenadas por `runID`. */
|
|
25
|
+
list(): Promise<WorktreeBinding[]>;
|
|
26
|
+
}
|
|
27
|
+
export declare function createWorktreeRegistry(root: string): WorktreeRegistry;
|
|
28
|
+
export {};
|
|
29
|
+
//# sourceMappingURL=worktreeRegistry.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"worktreeRegistry.d.ts","sourceRoot":"","sources":["../../../src/storage/graph/worktreeRegistry.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAiCxB,QAAA,MAAM,aAAa;;;iBAGjB,CAAC;AAIH,sDAAsD;AACtD,MAAM,MAAM,eAAe,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,aAAa,CAAC,CAAC;AAE5D,8DAA8D;AAC9D,MAAM,MAAM,yBAAyB,GACjC,UAAU,GACV,aAAa,GACb,cAAc,GACd,SAAS,CAAC;AAEd,gEAAgE;AAChE,qBAAa,qBAAsB,SAAQ,KAAK;IAC9C,QAAQ,CAAC,IAAI,EAAE,yBAAyB,CAAC;IACzC,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAC;gBAEZ,IAAI,EAAE,yBAAyB,EAAE,MAAM,EAAE,MAAM;CAM5D;AAED,oEAAoE;AACpE,MAAM,WAAW,gBAAgB;IAC/B,uEAAuE;IACvE,IAAI,CAAC,KAAK,EAAE,MAAM,EAAE,YAAY,EAAE,MAAM,GAAG,OAAO,CAAC,eAAe,CAAC,CAAC;IACpE,iFAAiF;IACjF,OAAO,CAAC,KAAK,EAAE,MAAM,GAAG,OAAO,CAAC,MAAM,GAAG,SAAS,CAAC,CAAC;IACpD,oDAAoD;IACpD,MAAM,CAAC,KAAK,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;IACrC,sDAAsD;IACtD,IAAI,IAAI,OAAO,CAAC,eAAe,EAAE,CAAC,CAAC;CACpC;AAaD,wBAAgB,sBAAsB,CAAC,IAAI,EAAE,MAAM,GAAG,gBAAgB,CA8ErE"}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Primitiva de durabilidad del journal FS: escrituras que sólo retornan tras
|
|
3
|
+
* `fsync` del descriptor, de modo que el boundary de confirmación coincide con
|
|
4
|
+
* la persistencia real (no con el buffer del SO). Es la única razón por la que
|
|
5
|
+
* el journal no se apoya en `StorageProvider.append`, que no fuerza `fsync`.
|
|
6
|
+
*
|
|
7
|
+
* Aísla `node:fs` para que el resto del adapter permanezca declarativo. No
|
|
8
|
+
* interpreta contenido: sólo bytes, directorios y el boundary de flush.
|
|
9
|
+
*/
|
|
10
|
+
/** Crea el directorio (recursivo, idempotente). */
|
|
11
|
+
export declare function ensureDir(dir: string): void;
|
|
12
|
+
/** Escribe (trunca) un fichero y fuerza `fsync` antes de retornar. */
|
|
13
|
+
export declare function writeDurable(file: string, content: string): void;
|
|
14
|
+
/** Anexa al final de un fichero y fuerza `fsync` antes de retornar. */
|
|
15
|
+
export declare function appendDurable(file: string, content: string): void;
|
|
16
|
+
/** Lee el contenido UTF-8 de un fichero; `undefined` si no existe. */
|
|
17
|
+
export declare function readText(file: string): string | undefined;
|
|
18
|
+
/** `true` si la ruta existe (fichero o directorio). */
|
|
19
|
+
export declare function pathExists(path: string): boolean;
|
|
20
|
+
//# sourceMappingURL=writer.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"writer.d.ts","sourceRoot":"","sources":["../../../src/storage/graph/writer.ts"],"names":[],"mappings":"AAUA;;;;;;;;GAQG;AAEH,mDAAmD;AACnD,wBAAgB,SAAS,CAAC,GAAG,EAAE,MAAM,GAAG,IAAI,CAE3C;AAED,sEAAsE;AACtE,wBAAgB,YAAY,CAAC,IAAI,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,GAAG,IAAI,CAQhE;AAED,uEAAuE;AACvE,wBAAgB,aAAa,CAAC,IAAI,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,GAAG,IAAI,CAQjE;AAED,sEAAsE;AACtE,wBAAgB,QAAQ,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM,GAAG,SAAS,CAKzD;AAED,uDAAuD;AACvD,wBAAgB,UAAU,CAAC,IAAI,EAAE,MAAM,GAAG,OAAO,CAEhD"}
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
import type { ErrorClass, GraphEventType, GraphEventV1 } from "../graph/schema";
|
|
2
|
+
/**
|
|
3
|
+
* Proyección de telemetría **reference-only** de eventos de Graph (GE-037).
|
|
4
|
+
*
|
|
5
|
+
* `projectGraphEvent` mapea un evento validado a un registro de telemetría con
|
|
6
|
+
* un conjunto de campos **allow-listed y acotados**: envoltura (`v`, `seq`,
|
|
7
|
+
* `runID`, `type`) más identificadores/digests concretos según el tipo. Nunca
|
|
8
|
+
* copia el evento entero ni transporta contenido crudo; el artefacto se reduce
|
|
9
|
+
* a su referencia (`uri`, `sha256`, `bytes`). Un guard final rechaza cualquier
|
|
10
|
+
* campo de contenido crudo. Puro y determinista: sin I/O, reloj ni random.
|
|
11
|
+
*/
|
|
12
|
+
/** Registro de telemetría de un evento Graph: solo campos allow-listed. */
|
|
13
|
+
export type GraphTelemetryRecord = {
|
|
14
|
+
readonly v: number;
|
|
15
|
+
readonly seq: number;
|
|
16
|
+
readonly runID: string;
|
|
17
|
+
readonly type: GraphEventType;
|
|
18
|
+
readonly nodeID?: string;
|
|
19
|
+
readonly operationID?: string;
|
|
20
|
+
readonly attemptID?: string;
|
|
21
|
+
readonly errorClass?: ErrorClass;
|
|
22
|
+
readonly specDigest?: string;
|
|
23
|
+
readonly artifact?: {
|
|
24
|
+
readonly uri: string;
|
|
25
|
+
readonly sha256: string;
|
|
26
|
+
readonly bytes: number;
|
|
27
|
+
};
|
|
28
|
+
};
|
|
29
|
+
/**
|
|
30
|
+
* Proyecta un evento Graph a un registro de telemetría reference-only. Solo
|
|
31
|
+
* emite los campos allow-listed presentes en el evento y reduce el artefacto a
|
|
32
|
+
* su referencia; el guard reference-only asegura que ningún derivado futuro
|
|
33
|
+
* introduzca contenido crudo.
|
|
34
|
+
*/
|
|
35
|
+
export declare function projectGraphEvent(event: GraphEventV1): GraphTelemetryRecord;
|
|
36
|
+
//# sourceMappingURL=graphProjection.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"graphProjection.d.ts","sourceRoot":"","sources":["../../src/telemetry/graphProjection.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,UAAU,EAAE,cAAc,EAAE,YAAY,EAAE,MAAM,iBAAiB,CAAC;AAEhF;;;;;;;;;GASG;AAEH,2EAA2E;AAC3E,MAAM,MAAM,oBAAoB,GAAG;IACjC,QAAQ,CAAC,CAAC,EAAE,MAAM,CAAC;IACnB,QAAQ,CAAC,GAAG,EAAE,MAAM,CAAC;IACrB,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAC;IACvB,QAAQ,CAAC,IAAI,EAAE,cAAc,CAAC;IAC9B,QAAQ,CAAC,MAAM,CAAC,EAAE,MAAM,CAAC;IACzB,QAAQ,CAAC,WAAW,CAAC,EAAE,MAAM,CAAC;IAC9B,QAAQ,CAAC,SAAS,CAAC,EAAE,MAAM,CAAC;IAC5B,QAAQ,CAAC,UAAU,CAAC,EAAE,UAAU,CAAC;IACjC,QAAQ,CAAC,UAAU,CAAC,EAAE,MAAM,CAAC;IAC7B,QAAQ,CAAC,QAAQ,CAAC,EAAE;QAClB,QAAQ,CAAC,GAAG,EAAE,MAAM,CAAC;QACrB,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAC;QACxB,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAC;KACxB,CAAC;CACH,CAAC;AAEF;;;;;GAKG;AACH,wBAAgB,iBAAiB,CAAC,KAAK,EAAE,YAAY,GAAG,oBAAoB,CAe3E"}
|
|
@@ -0,0 +1,75 @@
|
|
|
1
|
+
import type { ErrorClass, GraphSpecV1 } from "../graph/schema";
|
|
2
|
+
import type { GraphState } from "../graph/types";
|
|
3
|
+
import type { GraphTelemetryRecord } from "./graphProjection";
|
|
4
|
+
/**
|
|
5
|
+
* Proyección **pura y reference-only** de la vista del grafo (GE-081).
|
|
6
|
+
*
|
|
7
|
+
* `buildGraphView` pliega el spec estático (topología), el estado reducido del
|
|
8
|
+
* journal (estado/intentos/artefacto por nodo), la telemetría reference-only
|
|
9
|
+
* (`errorClass`, artefacto) y las métricas de runtime-health en un
|
|
10
|
+
* `GraphViewProjectionV1`. Cada campo mapea a la fuente allow-listed que congela
|
|
11
|
+
* `docs/adr/graph-observability-web.md`; los veredictos de revisor se **derivan**
|
|
12
|
+
* del estado terminal del nodo revisor más su enlace `reviews`, nunca se
|
|
13
|
+
* almacenan como contenido. Puro y determinista: sin reloj, I/O ni random. Un
|
|
14
|
+
* guard final rechaza cualquier campo de contenido crudo.
|
|
15
|
+
*/
|
|
16
|
+
/** Estado de nodo en la vista: añade `ready`/`active` sobre el estado reducido. */
|
|
17
|
+
export type GraphViewNodeState = "pending" | "ready" | "active" | "succeeded" | "failed" | "cancelled";
|
|
18
|
+
/** Veredicto derivado de una revisión. */
|
|
19
|
+
export type ReviewVerdict = "approved" | "rejected" | "inconclusive";
|
|
20
|
+
/** Referencia reference-only a un artefacto (sin contenido). */
|
|
21
|
+
export type GraphArtifactRef = {
|
|
22
|
+
readonly uri: string;
|
|
23
|
+
readonly sha256: string;
|
|
24
|
+
readonly bytes: number;
|
|
25
|
+
};
|
|
26
|
+
/** Vista de un nodo del grafo: solo campos allow-listed y reference-only. */
|
|
27
|
+
export type GraphNodeView = {
|
|
28
|
+
readonly nodeID: string;
|
|
29
|
+
readonly role: string;
|
|
30
|
+
readonly state: GraphViewNodeState;
|
|
31
|
+
readonly attempts: number;
|
|
32
|
+
readonly lastErrorClass?: ErrorClass;
|
|
33
|
+
readonly review?: {
|
|
34
|
+
readonly verdict: ReviewVerdict;
|
|
35
|
+
readonly reassigned: boolean;
|
|
36
|
+
};
|
|
37
|
+
readonly revisionOf?: string;
|
|
38
|
+
readonly artifact?: GraphArtifactRef;
|
|
39
|
+
readonly sessionRef?: string;
|
|
40
|
+
};
|
|
41
|
+
/** Arista del DAG (dependencia `from` -> `to`). */
|
|
42
|
+
export type GraphViewEdge = {
|
|
43
|
+
readonly from: string;
|
|
44
|
+
readonly to: string;
|
|
45
|
+
};
|
|
46
|
+
/** Métricas de runtime-health de la vista (GE-052), acotadas y sin contenido. */
|
|
47
|
+
export type GraphViewHealth = {
|
|
48
|
+
readonly recoveryRequired: boolean;
|
|
49
|
+
readonly unknownEffects: number;
|
|
50
|
+
readonly conflicts: number;
|
|
51
|
+
readonly killSwitch: boolean;
|
|
52
|
+
};
|
|
53
|
+
/** Proyección versionada y reference-only de la vista completa del grafo. */
|
|
54
|
+
export type GraphViewProjectionV1 = {
|
|
55
|
+
readonly version: 1;
|
|
56
|
+
readonly runID: string;
|
|
57
|
+
readonly nodes: readonly GraphNodeView[];
|
|
58
|
+
readonly edges: readonly GraphViewEdge[];
|
|
59
|
+
readonly health: GraphViewHealth;
|
|
60
|
+
};
|
|
61
|
+
/** Entradas reference-only del proyector: topología, estado, telemetría, salud. */
|
|
62
|
+
export type GraphViewInput = {
|
|
63
|
+
readonly spec: GraphSpecV1;
|
|
64
|
+
readonly state: GraphState;
|
|
65
|
+
readonly telemetry: readonly GraphTelemetryRecord[];
|
|
66
|
+
readonly health: GraphViewHealth;
|
|
67
|
+
readonly sessions?: Readonly<Record<string, string>>;
|
|
68
|
+
};
|
|
69
|
+
/**
|
|
70
|
+
* Construye la proyección reference-only de la vista del grafo a partir de sus
|
|
71
|
+
* fuentes allow-listed. Determinista: mismas entradas -> misma salida. El guard
|
|
72
|
+
* final asegura que ningún campo transporta contenido crudo.
|
|
73
|
+
*/
|
|
74
|
+
export declare function buildGraphView(input: GraphViewInput): GraphViewProjectionV1;
|
|
75
|
+
//# sourceMappingURL=graphView.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"graphView.d.ts","sourceRoot":"","sources":["../../src/telemetry/graphView.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,UAAU,EAAa,WAAW,EAAE,MAAM,iBAAiB,CAAC;AAC1E,O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;CACrB,CAAC;AAEF,iFAAiF;AACjF,MAAM,MAAM,eAAe,GAAG;IAC5B,QAAQ,CAAC,gBAAgB,EAAE,OAAO,CAAC;IACnC,QAAQ,CAAC,cAAc,EAAE,MAAM,CAAC;IAChC,QAAQ,CAAC,SAAS,EAAE,MAAM,CAAC;IAC3B,QAAQ,CAAC,UAAU,EAAE,OAAO,CAAC;CAC9B,CAAC;AAEF,6EAA6E;AAC7E,MAAM,MAAM,qBAAqB,GAAG;IAClC,QAAQ,CAAC,OAAO,EAAE,CAAC,CAAC;IACpB,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAC;IACvB,QAAQ,CAAC,KAAK,EAAE,SAAS,aAAa,EAAE,CAAC;IACzC,QAAQ,CAAC,KAAK,EAAE,SAAS,aAAa,EAAE,CAAC;IACzC,QAAQ,CAAC,MAAM,EAAE,eAAe,CAAC;CAClC,CAAC;AAEF,mFAAmF;AACnF,MAAM,MAAM,cAAc,GAAG;IAC3B,QAAQ,CAAC,IAAI,EAAE,WAAW,CAAC;IAC3B,QAAQ,CAAC,KAAK,EAAE,UAAU,CAAC;IAC3B,QAAQ,CAAC,SAAS,EAAE,SAAS,oBAAoB,EAAE,CAAC;IACpD,QAAQ,CAAC,MAAM,EAAE,eAAe,CAAC;IACjC,QAAQ,CAAC,QAAQ,CAAC,EAAE,QAAQ,CAAC,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC,CAAC;CACtD,CAAC;AA8FF;;;;GAIG;AACH,wBAAgB,cAAc,CAAC,KAAK,EAAE,cAAc,GAAG,qBAAqB,CAgB3E"}
|
package/dist/web/console.d.ts
CHANGED
|
@@ -10,6 +10,12 @@ import type { PtyClient } from "../console/pty";
|
|
|
10
10
|
export type ConsoleRouteDeps = {
|
|
11
11
|
token: string;
|
|
12
12
|
terminalEnabled: boolean;
|
|
13
|
+
/**
|
|
14
|
+
* Habilita el drill-down **de solo lectura** del grafo (GE-084): las acciones
|
|
15
|
+
* de lectura (`stream`, `messages`) quedan accesibles tras la misma bandera del
|
|
16
|
+
* grafo aunque la terminal (escritura) esté apagada. Opt-in.
|
|
17
|
+
*/
|
|
18
|
+
drilldownEnabled?: boolean;
|
|
13
19
|
/** Habilita la vista "Terminal" (PTY real, Fase 5). Opt-in. */
|
|
14
20
|
ptyEnabled?: boolean;
|
|
15
21
|
/** Resuelve el origen del servidor opencode de una sesión (o `undefined`). */
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"console.d.ts","sourceRoot":"","sources":["../../src/web/console.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,eAAe,EAAE,cAAc,EAAE,MAAM,WAAW,CAAC;AAEjE,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,2BAA2B,CAAC;AAM/D,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,gBAAgB,CAAC;AAGhD;;;;;GAKG;AACH,MAAM,MAAM,gBAAgB,GAAG;IAC7B,KAAK,EAAE,MAAM,CAAC;IACd,eAAe,EAAE,OAAO,CAAC;IACzB,+DAA+D;IAC/D,UAAU,CAAC,EAAE,OAAO,CAAC;IACrB,8EAA8E;IAC9E,eAAe,EAAE,CAAC,SAAS,EAAE,MAAM,KAAK,OAAO,CAAC,MAAM,GAAG,SAAS,CAAC,CAAC;IACpE,uEAAuE;IACvE,YAAY,EAAE,CAAC,QAAQ,EAAE,MAAM,KAAK,aAAa,CAAC;IAClD,mEAAmE;IACnE,eAAe,CAAC,EAAE,CAAC,QAAQ,EAAE,MAAM,KAAK,SAAS,CAAC;CACnD,CAAC;
|
|
1
|
+
{"version":3,"file":"console.d.ts","sourceRoot":"","sources":["../../src/web/console.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,eAAe,EAAE,cAAc,EAAE,MAAM,WAAW,CAAC;AAEjE,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,2BAA2B,CAAC;AAM/D,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,gBAAgB,CAAC;AAGhD;;;;;GAKG;AACH,MAAM,MAAM,gBAAgB,GAAG;IAC7B,KAAK,EAAE,MAAM,CAAC;IACd,eAAe,EAAE,OAAO,CAAC;IACzB;;;;OAIG;IACH,gBAAgB,CAAC,EAAE,OAAO,CAAC;IAC3B,+DAA+D;IAC/D,UAAU,CAAC,EAAE,OAAO,CAAC;IACrB,8EAA8E;IAC9E,eAAe,EAAE,CAAC,SAAS,EAAE,MAAM,KAAK,OAAO,CAAC,MAAM,GAAG,SAAS,CAAC,CAAC;IACpE,uEAAuE;IACvE,YAAY,EAAE,CAAC,QAAQ,EAAE,MAAM,KAAK,aAAa,CAAC;IAClD,mEAAmE;IACnE,eAAe,CAAC,EAAE,CAAC,QAAQ,EAAE,MAAM,KAAK,SAAS,CAAC;CACnD,CAAC;AA4OF;;;;GAIG;AACH,wBAAsB,kBAAkB,CACtC,OAAO,EAAE,eAAe,EACxB,QAAQ,EAAE,cAAc,EACxB,GAAG,EAAE,GAAG,EACR,IAAI,EAAE,gBAAgB,GACrB,OAAO,CAAC,OAAO,CAAC,CAqDlB"}
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
import type { IncomingMessage, ServerResponse } from "node:http";
|
|
2
|
+
import type { GraphViewProjectionV1 } from "../telemetry/graphView";
|
|
3
|
+
/**
|
|
4
|
+
* Endpoint HTTP **additivo** que sirve la proyección reference-only de la vista
|
|
5
|
+
* del grafo (GE-082): `GET /api/graph` (JSON) y el marco SSE `event: graph` que
|
|
6
|
+
* se empuja en cada cambio de runtime por el canal `/events` existente.
|
|
7
|
+
*
|
|
8
|
+
* Seguridad — **paridad de token con `/api/state`**: cuando la Console se expone
|
|
9
|
+
* en remoto (con `storageApi`), `remoteToken` exige el mismo token efímero que el
|
|
10
|
+
* resto de rutas de lectura; sin él → 401. En loopback puro (`remoteToken`
|
|
11
|
+
* indefinido) queda abierto, igual que `/api/state`.
|
|
12
|
+
*
|
|
13
|
+
* Solo lectura y additivo: ninguna página enlaza este endpoint todavía, así que
|
|
14
|
+
* la Console por defecto (sin `graphApi` inyectado) es idéntica a hoy.
|
|
15
|
+
*/
|
|
16
|
+
export type GraphRouteDeps = {
|
|
17
|
+
/** Proyección actual de la vista, o `null` cuando no hay run activo. */
|
|
18
|
+
readView: () => Promise<GraphViewProjectionV1 | null>;
|
|
19
|
+
/**
|
|
20
|
+
* Token de exposición remota, en paridad con `/api/state`. `undefined` en
|
|
21
|
+
* loopback puro (ruta abierta).
|
|
22
|
+
*/
|
|
23
|
+
remoteToken?: string;
|
|
24
|
+
};
|
|
25
|
+
/** Tipo de evento SSE del canal de grafo, multiplexado sobre `/events`. */
|
|
26
|
+
export declare const GRAPH_SSE_EVENT: "graph";
|
|
27
|
+
/** Marco SSE del canal de grafo para un payload JSON ya serializado. */
|
|
28
|
+
export declare function graphSseMessage(json: string): string;
|
|
29
|
+
/**
|
|
30
|
+
* Enruta `GET /api/graph`. Devuelve `true` si atendió (y respondió) la petición,
|
|
31
|
+
* `false` para que el servidor siga con sus rutas. Método ≠ GET → 405; sin token
|
|
32
|
+
* válido cuando hay `remoteToken` → 401; en otro caso 200 con la proyección
|
|
33
|
+
* (o `null` si no hay run activo).
|
|
34
|
+
*/
|
|
35
|
+
export declare function handleGraphRoute(request: IncomingMessage, response: ServerResponse, url: URL, deps: GraphRouteDeps): Promise<boolean>;
|
|
36
|
+
//# sourceMappingURL=graphRoute.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"graphRoute.d.ts","sourceRoot":"","sources":["../../src/web/graphRoute.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,eAAe,EAAE,cAAc,EAAE,MAAM,WAAW,CAAC;AAGjE,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,wBAAwB,CAAC;AAEpE;;;;;;;;;;;;GAYG;AACH,MAAM,MAAM,cAAc,GAAG;IAC3B,wEAAwE;IACxE,QAAQ,EAAE,MAAM,OAAO,CAAC,qBAAqB,GAAG,IAAI,CAAC,CAAC;IACtD;;;OAGG;IACH,WAAW,CAAC,EAAE,MAAM,CAAC;CACtB,CAAC;AAIF,2EAA2E;AAC3E,eAAO,MAAM,eAAe,EAAG,OAAgB,CAAC;AAEhD,wEAAwE;AACxE,wBAAgB,eAAe,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM,CAEpD;AAoBD;;;;;GAKG;AACH,wBAAsB,gBAAgB,CACpC,OAAO,EAAE,eAAe,EACxB,QAAQ,EAAE,cAAc,EACxB,GAAG,EAAE,GAAG,EACR,IAAI,EAAE,cAAc,GACnB,OAAO,CAAC,OAAO,CAAC,CAsBlB"}
|
package/dist/web/server.d.ts
CHANGED
|
@@ -3,6 +3,7 @@ import type { ConsoleConfig } from "../config/schema";
|
|
|
3
3
|
import type { ConsoleClient } from "../console/opencodeClient";
|
|
4
4
|
import type { PtyClient } from "../console/pty";
|
|
5
5
|
import type { ConsoleInputs } from "../console/state";
|
|
6
|
+
import type { GraphViewProjectionV1 } from "../telemetry/graphView";
|
|
6
7
|
import { type StorageRouteDeps } from "./storageRoute";
|
|
7
8
|
export type ConsoleServerDeps = {
|
|
8
9
|
/** Relee las fuentes y produce los inputs crudos del console. */
|
|
@@ -16,6 +17,13 @@ export type ConsoleServerDeps = {
|
|
|
16
17
|
console?: {
|
|
17
18
|
token: string;
|
|
18
19
|
terminalEnabled: boolean;
|
|
20
|
+
/**
|
|
21
|
+
* Habilita el drill-down de solo lectura del grafo (GE-084): expone las
|
|
22
|
+
* acciones de lectura (`stream`, `messages`) y el render del panel de
|
|
23
|
+
* conversación tras la misma bandera del grafo, sin activar la terminal de
|
|
24
|
+
* escritura. Opt-in.
|
|
25
|
+
*/
|
|
26
|
+
drilldownEnabled?: boolean;
|
|
19
27
|
/** Habilita la vista "Terminal" (PTY real, Fase 5). Opt-in. */
|
|
20
28
|
ptyEnabled?: boolean;
|
|
21
29
|
createClient: (endpoint: string) => ConsoleClient;
|
|
@@ -26,6 +34,15 @@ export type ConsoleServerDeps = {
|
|
|
26
34
|
* estado del equipo autenticado con token para una Console remota vía tunnel.
|
|
27
35
|
*/
|
|
28
36
|
storageApi?: StorageRouteDeps;
|
|
37
|
+
/**
|
|
38
|
+
* Proveedor opt-in de la vista del grafo (`/api/graph` + canal SSE `graph`).
|
|
39
|
+
* Additivo: sin él inyectado, la Console por defecto es idéntica a hoy. La
|
|
40
|
+
* proyección es reference-only (GE-081) y el endpoint hereda el token de
|
|
41
|
+
* `/api/state` (paridad remota); en loopback puro queda abierto.
|
|
42
|
+
*/
|
|
43
|
+
graphApi?: {
|
|
44
|
+
readView: () => Promise<GraphViewProjectionV1 | null>;
|
|
45
|
+
};
|
|
29
46
|
};
|
|
30
47
|
export type ConsoleServer = {
|
|
31
48
|
url: string;
|
|
@@ -37,8 +54,10 @@ export type ConsoleServer = {
|
|
|
37
54
|
/**
|
|
38
55
|
* Arranca el servidor del console con `node:http` (portable a Node y Bun) en
|
|
39
56
|
* loopback. Sirve `/` (HTML), `/api/state` (JSON), `/events` (SSE) y `/healthz`.
|
|
40
|
-
*
|
|
41
|
-
* `
|
|
57
|
+
* Con `graphApi` opt-in añade `/api/graph` (JSON) y multiplexa el marco SSE
|
|
58
|
+
* `event: graph` sobre `/events`. Solo lectura: cualquier método ≠ GET → 405;
|
|
59
|
+
* ruta desconocida → 404. Con `autoPortFallback` prueba puertos sucesivos si el
|
|
60
|
+
* preferido está ocupado.
|
|
42
61
|
*
|
|
43
62
|
* Cuando se inyecta `storageApi` (exposición remota opt-in), las rutas de lectura
|
|
44
63
|
* (`/`, `/api/state`, `/events`) además exigen token (bearer o `?token=`); sin él
|
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,EACL,YAAY,IAAI,gBAAgB,EAIjC,MAAM,WAAW,CAAC;AACnB,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,kBAAkB,CAAC;AACtD,OAAO,KA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MAAM,KAAK,SAAS,CAAC;KACnD,CAAC;IACF;;;OAGG;IACH,UAAU,CAAC,EAAE,gBAAgB,CAAC;IAC9B;;;;;OAKG;IACH,QAAQ,CAAC,EAAE;QACT,QAAQ,EAAE,MAAM,OAAO,CAAC,qBAAqB,GAAG,IAAI,CAAC,CAAC;KACvD,CAAC;CACH,CAAC;AAEF,MAAM,MAAM,aAAa,GAAG;IAC1B,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;AA2FF;;;;;;;;;;;GAWG;AACH,wBAAsB,mBAAmB,CACvC,IAAI,EAAE,iBAAiB,GACtB,OAAO,CAAC,aAAa,CAAC,CA2LxB"}
|
package/dist/web/start.d.ts
CHANGED
|
@@ -5,6 +5,7 @@ import type { ConsoleClient } from "../console/opencodeClient";
|
|
|
5
5
|
import type { PtyClient } from "../console/pty";
|
|
6
6
|
import type { CommitView } from "../console/types";
|
|
7
7
|
import type { StorageProvider } from "../storage/provider";
|
|
8
|
+
import type { GraphViewProjectionV1 } from "../telemetry/graphView";
|
|
8
9
|
import type { StorageRouteDeps } from "./storageRoute";
|
|
9
10
|
export type ConsoleRuntimeDeps = {
|
|
10
11
|
config: ConsoleConfig;
|
|
@@ -28,12 +29,22 @@ export type ConsoleRuntimeDeps = {
|
|
|
28
29
|
console?: {
|
|
29
30
|
token: string;
|
|
30
31
|
terminalEnabled: boolean;
|
|
32
|
+
drilldownEnabled?: boolean;
|
|
31
33
|
ptyEnabled?: boolean;
|
|
32
34
|
createClient: (endpoint: string) => ConsoleClient;
|
|
33
35
|
createPtyClient?: (endpoint: string) => PtyClient;
|
|
34
36
|
};
|
|
35
37
|
/** Endpoint remoto de storage (`/storage/*`). Opcional y opt-in. */
|
|
36
38
|
storageApi?: StorageRouteDeps;
|
|
39
|
+
/**
|
|
40
|
+
* Proveedor reference-only de la vista del grafo (GE-083). Solo se cablea como
|
|
41
|
+
* `graphApi` (activando `/api/graph`, el canal SSE `graph` y el render del DAG)
|
|
42
|
+
* cuando `config.graphView.enabled` es `true`; en caso contrario la Console es
|
|
43
|
+
* idéntica a hoy.
|
|
44
|
+
*/
|
|
45
|
+
graphView?: {
|
|
46
|
+
readView: () => Promise<GraphViewProjectionV1 | null>;
|
|
47
|
+
};
|
|
37
48
|
/** Inyectables para tests. */
|
|
38
49
|
serve?: typeof import("./server").createConsoleServer;
|
|
39
50
|
watch?: (path: string, listener: () => void) => ReturnType<typeof fsWatch>;
|
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,aAAa,EAAE,MAAM,kBAAkB,CAAC;AACtD,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,2BAA2B,CAAC;AAC/D,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,gBAAgB,CAAC;AAChD,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,kBAAkB,CAAC;AACnD,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,qBAAqB,CAAC;
|
|
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,aAAa,EAAE,MAAM,kBAAkB,CAAC;AACtD,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,2BAA2B,CAAC;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IACpE,UAAU,CAAC,EAAE,gBAAgB,CAAC;IAC9B;;;;;OAKG;IACH,SAAS,CAAC,EAAE;QACV,QAAQ,EAAE,MAAM,OAAO,CAAC,qBAAqB,GAAG,IAAI,CAAC,CAAC;KACvD,CAAC;IACF,8BAA8B;IAC9B,KAAK,CAAC,EAAE,cAAc,UAAU,EAAE,mBAAmB,CAAC;IACtD,KAAK,CAAC,EAAE,CAAC,IAAI,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,IAAI,KAAK,UAAU,CAAC,OAAO,OAAO,CAAC,CAAC;IAC3E,GAAG,CAAC,EAAE,CAAC,OAAO,EAAE,MAAM,KAAK,IAAI,CAAC;CACjC,CAAC;AAEF,MAAM,MAAM,cAAc,GAAG;IAC3B,GAAG,EAAE,MAAM,CAAC;IACZ,IAAI,EAAE,MAAM,CAAC;IACb,KAAK,EAAE,MAAM,IAAI,CAAC;CACnB,CAAC;AAEF;;;;GAIG;AACH,wBAAgB,YAAY,CAC1B,IAAI,EAAE,kBAAkB,GACvB,OAAO,CAAC,cAAc,CAAC,CAEzB"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@jmanuelcorral/openteam",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.42",
|
|
4
4
|
"packageManager": "bun@1.3.14",
|
|
5
5
|
"description": "Cost-aware, local-first routing plugin for opencode with cheapest-capable frontier fallback and multi-agent orchestration.",
|
|
6
6
|
"license": "MIT",
|