@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,73 @@
|
|
|
1
|
+
import type { ConfigSource } from "../config/resolve";
|
|
2
|
+
import type { GraphMode } from "../config/schema";
|
|
3
|
+
import type { WorktreeReconcileReport } from "../orchestrator/worktreeReconciler";
|
|
4
|
+
import type { LeaseRecord } from "../storage/graph/workspaceLease";
|
|
5
|
+
/**
|
|
6
|
+
* GE-045 — operator commands for the graph runtime as pure dry-run plans.
|
|
7
|
+
*
|
|
8
|
+
* These functions never touch I/O: the caller reads the journal, lease, and
|
|
9
|
+
* config health, hands a settled snapshot here, and this module renders the
|
|
10
|
+
* operator view and decides which action is safe. Execution (recover/cancel)
|
|
11
|
+
* happens in the wiring layer only when a plan authorises it.
|
|
12
|
+
*
|
|
13
|
+
* Safety contract:
|
|
14
|
+
* - Commands are idempotent: a settled state plans `none`.
|
|
15
|
+
* - Recovering a corrupt journal is blocked unless the operator explicitly
|
|
16
|
+
* acknowledges the unsafe reconciliation.
|
|
17
|
+
* - Cancelling a run held by another holder (a stale takeover) is blocked
|
|
18
|
+
* unless the operator explicitly forces it.
|
|
19
|
+
*/
|
|
20
|
+
/** Health of the on-disk journal tail as classified by recovery. */
|
|
21
|
+
export type GraphJournalHealth = "clean" | "recovered" | "corrupt";
|
|
22
|
+
/** Settled, side-effect-free view of the graph runtime for the operator. */
|
|
23
|
+
export type GraphHealthSnapshot = {
|
|
24
|
+
/** Where the effective graph config was resolved from. */
|
|
25
|
+
readonly source: ConfigSource;
|
|
26
|
+
/** Effective graph mode after config resolution. */
|
|
27
|
+
readonly effectiveMode: GraphMode;
|
|
28
|
+
/** Current workspace lease, or `undefined` when no run is active. */
|
|
29
|
+
readonly lease: LeaseRecord | undefined;
|
|
30
|
+
/** Journal tail health. */
|
|
31
|
+
readonly journal: GraphJournalHealth;
|
|
32
|
+
/** Committed effects still awaiting a receipt. */
|
|
33
|
+
readonly pendingEffects: number;
|
|
34
|
+
/** Effects whose outcome is unknown and require reconciliation. */
|
|
35
|
+
readonly unknownEffects: number;
|
|
36
|
+
};
|
|
37
|
+
/** Action an operator command would take, decided without executing it. */
|
|
38
|
+
export type GraphActionKind = "none" | "recover" | "cancel" | "blocked";
|
|
39
|
+
/** Result of planning an operator command. */
|
|
40
|
+
export type GraphActionPlan = {
|
|
41
|
+
/** What the command would do. */
|
|
42
|
+
readonly kind: GraphActionKind;
|
|
43
|
+
/** Stable machine-readable reason for the decision. */
|
|
44
|
+
readonly reason: string;
|
|
45
|
+
/** `true` when the action preserves invariants without operator override. */
|
|
46
|
+
readonly safe: boolean;
|
|
47
|
+
};
|
|
48
|
+
/** Options for planning a journal recovery. */
|
|
49
|
+
export type GraphRecoverOptions = {
|
|
50
|
+
/** Operator explicitly accepts an unsafe reconciliation of a corrupt tail. */
|
|
51
|
+
readonly acknowledgeUnsafe?: boolean;
|
|
52
|
+
};
|
|
53
|
+
/** Options for planning a run cancellation. */
|
|
54
|
+
export type GraphCancelOptions = {
|
|
55
|
+
/** Identity of the operator requesting the cancel. */
|
|
56
|
+
readonly holder: string;
|
|
57
|
+
/** Operator explicitly accepts taking over a run held by someone else. */
|
|
58
|
+
readonly force?: boolean;
|
|
59
|
+
};
|
|
60
|
+
/** Render the operator-facing status view of a graph health snapshot. */
|
|
61
|
+
export declare function renderGraphStatus(snapshot: GraphHealthSnapshot): string;
|
|
62
|
+
/** Decide whether recovering the journal tail is a safe, idempotent action. */
|
|
63
|
+
export declare function planGraphRecover(snapshot: GraphHealthSnapshot, options?: GraphRecoverOptions): GraphActionPlan;
|
|
64
|
+
/** Decide whether cancelling the active run is a safe, idempotent action. */
|
|
65
|
+
export declare function planGraphCancel(snapshot: GraphHealthSnapshot, options: GraphCancelOptions): GraphActionPlan;
|
|
66
|
+
/**
|
|
67
|
+
* Render the operator-facing view of a worktree reconciliation plan (GE-074).
|
|
68
|
+
* Pure: the caller supplies a settled report from `planWorktreeReconciliation`
|
|
69
|
+
* and this only formats it. A disabled report renders a single no-op line so
|
|
70
|
+
* the operator can see isolation is off without any worktree being touched.
|
|
71
|
+
*/
|
|
72
|
+
export declare function renderWorktreeReconciliation(report: WorktreeReconcileReport): string;
|
|
73
|
+
//# sourceMapping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C/C,MAAM,MAAM,mBAAmB,GAAG;IAChC,8EAA8E;IAC9E,QAAQ,CAAC,iBAAiB,CAAC,EAAE,OAAO,CAAC;CACtC,CAAC;AAEF,+CAA+C;AAC/C,MAAM,MAAM,kBAAkB,GAAG;IAC/B,sDAAsD;IACtD,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAC;IACxB,0EAA0E;IAC1E,QAAQ,CAAC,KAAK,CAAC,EAAE,OAAO,CAAC;CAC1B,CAAC;AAUF,yEAAyE;AACzE,wBAAgB,iBAAiB,CAAC,QAAQ,EAAE,mBAAmB,GAAG,MAAM,CAkBvE;AAED,+EAA+E;AAC/E,wBAAgB,gBAAgB,CAC9B,QAAQ,EAAE,mBAAmB,EAC7B,OAAO,GAAE,mBAAwB,GAChC,eAAe,CAejB;AAED,6EAA6E;AAC7E,wBAAgB,eAAe,CAC7B,QAAQ,EAAE,mBAAmB,EAC7B,OAAO,EAAE,kBAAkB,GAC1B,eAAe,CAejB;AAED;;;;;GAKG;AACH,wBAAgB,4BAA4B,CAC1C,MAAM,EAAE,uBAAuB,GAC9B,MAAM,CAoBR"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"load.d.ts","sourceRoot":"","sources":["../../src/config/load.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,qBAAqB,CAAC;
|
|
1
|
+
{"version":3,"file":"load.d.ts","sourceRoot":"","sources":["../../src/config/load.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,qBAAqB,CAAC;AAE3D,OAAO,EAAE,KAAK,cAAc,EAAwB,MAAM,UAAU,CAAC;AAErE,wBAAgB,kBAAkB,CAAC,GAAG,EAAE,OAAO,GAAG,cAAc,CAE/D;AAED,wBAAsB,sBAAsB,CAC1C,IAAI,SAA4B,EAChC,OAAO,GAAE,eAAwD,GAChE,OAAO,CAAC,cAAc,CAAC,CAMzB"}
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Migración **versionada** de la config de openteam (GE-040).
|
|
3
|
+
*
|
|
4
|
+
* La config declara opcionalmente `configVersion`. Cuando falta se asume la
|
|
5
|
+
* versión actual (config legacy). Una versión no entera/positiva es
|
|
6
|
+
* `unknown-version`; una versión futura mayor que la soportada es
|
|
7
|
+
* `unsupported-version`. La migración es pura: normaliza la entrada para el
|
|
8
|
+
* parseo de esquema y **falla cerrado** ante versiones no soportadas, de modo
|
|
9
|
+
* que CLI y plugin comparten exactamente la misma resolución.
|
|
10
|
+
*/
|
|
11
|
+
/** Versión de config soportada por esta build. */
|
|
12
|
+
export declare const CURRENT_CONFIG_VERSION: 1;
|
|
13
|
+
/** Código de fallo de migración de config. */
|
|
14
|
+
export type ConfigMigrationErrorCode = "unknown-version" | "unsupported-version";
|
|
15
|
+
/** Error tipado de una migración de config rechazada. */
|
|
16
|
+
export declare class ConfigMigrationError extends Error {
|
|
17
|
+
readonly code: ConfigMigrationErrorCode;
|
|
18
|
+
readonly detail: string;
|
|
19
|
+
constructor(code: ConfigMigrationErrorCode, detail: string);
|
|
20
|
+
}
|
|
21
|
+
/**
|
|
22
|
+
* Normaliza la config cruda a la versión actual. Devuelve la entrada intacta si
|
|
23
|
+
* no es un objeto (el parseo de esquema la rechazará); en caso contrario valida
|
|
24
|
+
* `configVersion` y falla cerrado ante versiones desconocidas o futuras.
|
|
25
|
+
*/
|
|
26
|
+
export declare function migrateConfig(raw: unknown): unknown;
|
|
27
|
+
//# sourceMappingURL=migrations.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"migrations.d.ts","sourceRoot":"","sources":["../../src/config/migrations.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AAEH,kDAAkD;AAClD,eAAO,MAAM,sBAAsB,EAAG,CAAU,CAAC;AAEjD,8CAA8C;AAC9C,MAAM,MAAM,wBAAwB,GAChC,iBAAiB,GACjB,qBAAqB,CAAC;AAE1B,yDAAyD;AACzD,qBAAa,oBAAqB,SAAQ,KAAK;IAC7C,QAAQ,CAAC,IAAI,EAAE,wBAAwB,CAAC;IACxC,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAC;gBAEZ,IAAI,EAAE,wBAAwB,EAAE,MAAM,EAAE,MAAM;CAM3D;AAED;;;;GAIG;AACH,wBAAgB,aAAa,CAAC,GAAG,EAAE,OAAO,GAAG,OAAO,CAoBnD"}
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
import type { GraphMode, OpenTeamConfig } from "./schema";
|
|
2
|
+
/**
|
|
3
|
+
* Resolver **efectivo** y compartido de la config de Graph (GE-040).
|
|
4
|
+
*
|
|
5
|
+
* CLI y plugin resuelven a través de esta única función, así que una misma
|
|
6
|
+
* config produce exactamente el mismo resultado en ambos. Reglas:
|
|
7
|
+
*
|
|
8
|
+
* - **Default off**: sin sección `graph`, el modo efectivo es `off`.
|
|
9
|
+
* - **Kill switch en vivo**: si `killSwitch` está activo, el modo efectivo es
|
|
10
|
+
* `off` sea cual sea el modo configurado.
|
|
11
|
+
* - **Shadow sin executor**: solo `active` habilita el executor; `shadow` y
|
|
12
|
+
* `off` no reciben executor.
|
|
13
|
+
* - **Fuente visible**: el origen de la config se propaga al resultado.
|
|
14
|
+
*
|
|
15
|
+
* Puro: sin I/O, reloj ni estado global.
|
|
16
|
+
*/
|
|
17
|
+
/** Origen de la config resuelta (para trazabilidad/observabilidad). */
|
|
18
|
+
export type ConfigSource = "file" | "inline" | "default";
|
|
19
|
+
/** Resolución efectiva de la config de Graph. */
|
|
20
|
+
export type ResolvedGraphConfig = {
|
|
21
|
+
/** Modo declarado en la config (default `off`). */
|
|
22
|
+
readonly configuredMode: GraphMode;
|
|
23
|
+
/** Modo efectivo tras aplicar el kill switch. */
|
|
24
|
+
readonly effectiveMode: GraphMode;
|
|
25
|
+
/** Solo `active` habilita el executor. */
|
|
26
|
+
readonly executorEnabled: boolean;
|
|
27
|
+
/** Kill switch en vivo. */
|
|
28
|
+
readonly killSwitch: boolean;
|
|
29
|
+
/** Origen de la config. */
|
|
30
|
+
readonly source: ConfigSource;
|
|
31
|
+
};
|
|
32
|
+
/** Resuelve la config de Graph efectiva a partir de la config y su origen. */
|
|
33
|
+
export declare function resolveGraphConfig(config: OpenTeamConfig, source: ConfigSource): ResolvedGraphConfig;
|
|
34
|
+
//# sourceMappingURL=resolve.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"resolve.d.ts","sourceRoot":"","sources":["../../src/config/resolve.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,cAAc,EAAE,MAAM,UAAU,CAAC;AAE1D;;;;;;;;;;;;;;GAcG;AAEH,uEAAuE;AACvE,MAAM,MAAM,YAAY,GAAG,MAAM,GAAG,QAAQ,GAAG,SAAS,CAAC;AAEzD,iDAAiD;AACjD,MAAM,MAAM,mBAAmB,GAAG;IAChC,mDAAmD;IACnD,QAAQ,CAAC,cAAc,EAAE,SAAS,CAAC;IACnC,iDAAiD;IACjD,QAAQ,CAAC,aAAa,EAAE,SAAS,CAAC;IAClC,0CAA0C;IAC1C,QAAQ,CAAC,eAAe,EAAE,OAAO,CAAC;IAClC,2BAA2B;IAC3B,QAAQ,CAAC,UAAU,EAAE,OAAO,CAAC;IAC7B,2BAA2B;IAC3B,QAAQ,CAAC,MAAM,EAAE,YAAY,CAAC;CAC/B,CAAC;AAEF,8EAA8E;AAC9E,wBAAgB,kBAAkB,CAChC,MAAM,EAAE,cAAc,EACtB,MAAM,EAAE,YAAY,GACnB,mBAAmB,CAWrB"}
|
package/dist/config/schema.d.ts
CHANGED
|
@@ -17,6 +17,30 @@ export declare const BaselineModeSchema: z.ZodEnum<{
|
|
|
17
17
|
auto: "auto";
|
|
18
18
|
pinned: "pinned";
|
|
19
19
|
}>;
|
|
20
|
+
/**
|
|
21
|
+
* Modo del subsistema Graph (GE-040). `off` mantiene el camino legacy; `shadow`
|
|
22
|
+
* observa sin ejecutar efectos; `active` habilita el executor. Default `off`.
|
|
23
|
+
*/
|
|
24
|
+
export declare const GraphModeSchema: z.ZodEnum<{
|
|
25
|
+
off: "off";
|
|
26
|
+
shadow: "shadow";
|
|
27
|
+
active: "active";
|
|
28
|
+
}>;
|
|
29
|
+
/**
|
|
30
|
+
* Sección `graph` de la config. Opcional: cuando falta, el resolver aplica
|
|
31
|
+
* `off`. Un `killSwitch` en vivo fuerza `off` sea cual sea el modo configurado.
|
|
32
|
+
*/
|
|
33
|
+
export declare const GraphConfigSchema: z.ZodObject<{
|
|
34
|
+
mode: z.ZodDefault<z.ZodEnum<{
|
|
35
|
+
off: "off";
|
|
36
|
+
shadow: "shadow";
|
|
37
|
+
active: "active";
|
|
38
|
+
}>>;
|
|
39
|
+
killSwitch: z.ZodDefault<z.ZodBoolean>;
|
|
40
|
+
worktrees: z.ZodDefault<z.ZodObject<{
|
|
41
|
+
enabled: z.ZodDefault<z.ZodBoolean>;
|
|
42
|
+
}, z.core.$strip>>;
|
|
43
|
+
}, z.core.$strip>;
|
|
20
44
|
export declare const ConsoleHostSchema: z.ZodEnum<{
|
|
21
45
|
"127.0.0.1": "127.0.0.1";
|
|
22
46
|
localhost: "localhost";
|
|
@@ -36,6 +60,9 @@ export declare const ConsoleConfigSchema: z.ZodDefault<z.ZodObject<{
|
|
|
36
60
|
enabled: z.ZodDefault<z.ZodBoolean>;
|
|
37
61
|
pty: z.ZodOptional<z.ZodBoolean>;
|
|
38
62
|
}, z.core.$strip>>;
|
|
63
|
+
graphView: z.ZodOptional<z.ZodObject<{
|
|
64
|
+
enabled: z.ZodDefault<z.ZodBoolean>;
|
|
65
|
+
}, z.core.$strip>>;
|
|
39
66
|
}, z.core.$strip>>;
|
|
40
67
|
/**
|
|
41
68
|
* Bloque de configuración de la Console web (nombre canónico `console`).
|
|
@@ -249,6 +276,9 @@ export declare const OpenTeamConfigObjectSchema: z.ZodObject<{
|
|
|
249
276
|
enabled: z.ZodDefault<z.ZodBoolean>;
|
|
250
277
|
pty: z.ZodOptional<z.ZodBoolean>;
|
|
251
278
|
}, z.core.$strip>>;
|
|
279
|
+
graphView: z.ZodOptional<z.ZodObject<{
|
|
280
|
+
enabled: z.ZodDefault<z.ZodBoolean>;
|
|
281
|
+
}, z.core.$strip>>;
|
|
252
282
|
}, z.core.$strip>>;
|
|
253
283
|
storage: z.ZodDefault<z.ZodObject<{
|
|
254
284
|
sqliteIndex: z.ZodDefault<z.ZodObject<{
|
|
@@ -298,6 +328,17 @@ export declare const OpenTeamConfigObjectSchema: z.ZodObject<{
|
|
|
298
328
|
}, z.core.$strip>>;
|
|
299
329
|
}, z.core.$strip>>;
|
|
300
330
|
}, z.core.$strip>>;
|
|
331
|
+
graph: z.ZodOptional<z.ZodObject<{
|
|
332
|
+
mode: z.ZodDefault<z.ZodEnum<{
|
|
333
|
+
off: "off";
|
|
334
|
+
shadow: "shadow";
|
|
335
|
+
active: "active";
|
|
336
|
+
}>>;
|
|
337
|
+
killSwitch: z.ZodDefault<z.ZodBoolean>;
|
|
338
|
+
worktrees: z.ZodDefault<z.ZodObject<{
|
|
339
|
+
enabled: z.ZodDefault<z.ZodBoolean>;
|
|
340
|
+
}, z.core.$strip>>;
|
|
341
|
+
}, z.core.$strip>>;
|
|
301
342
|
}, z.core.$strip>;
|
|
302
343
|
/** Esquema público de la config de openteam. */
|
|
303
344
|
export declare const OpenTeamConfigSchema: z.ZodObject<{
|
|
@@ -375,6 +416,9 @@ export declare const OpenTeamConfigSchema: z.ZodObject<{
|
|
|
375
416
|
enabled: z.ZodDefault<z.ZodBoolean>;
|
|
376
417
|
pty: z.ZodOptional<z.ZodBoolean>;
|
|
377
418
|
}, z.core.$strip>>;
|
|
419
|
+
graphView: z.ZodOptional<z.ZodObject<{
|
|
420
|
+
enabled: z.ZodDefault<z.ZodBoolean>;
|
|
421
|
+
}, z.core.$strip>>;
|
|
378
422
|
}, z.core.$strip>>;
|
|
379
423
|
storage: z.ZodDefault<z.ZodObject<{
|
|
380
424
|
sqliteIndex: z.ZodDefault<z.ZodObject<{
|
|
@@ -424,10 +468,23 @@ export declare const OpenTeamConfigSchema: z.ZodObject<{
|
|
|
424
468
|
}, z.core.$strip>>;
|
|
425
469
|
}, z.core.$strip>>;
|
|
426
470
|
}, z.core.$strip>>;
|
|
471
|
+
graph: z.ZodOptional<z.ZodObject<{
|
|
472
|
+
mode: z.ZodDefault<z.ZodEnum<{
|
|
473
|
+
off: "off";
|
|
474
|
+
shadow: "shadow";
|
|
475
|
+
active: "active";
|
|
476
|
+
}>>;
|
|
477
|
+
killSwitch: z.ZodDefault<z.ZodBoolean>;
|
|
478
|
+
worktrees: z.ZodDefault<z.ZodObject<{
|
|
479
|
+
enabled: z.ZodDefault<z.ZodBoolean>;
|
|
480
|
+
}, z.core.$strip>>;
|
|
481
|
+
}, z.core.$strip>>;
|
|
427
482
|
}, z.core.$strip>;
|
|
428
483
|
export type ModelRef = z.infer<typeof ModelRefSchema>;
|
|
429
484
|
export type RouterMode = z.infer<typeof RouterModeSchema>;
|
|
430
485
|
export type PrivacyMode = z.infer<typeof PrivacyModeSchema>;
|
|
486
|
+
export type GraphMode = z.infer<typeof GraphModeSchema>;
|
|
487
|
+
export type GraphConfig = z.infer<typeof GraphConfigSchema>;
|
|
431
488
|
export type OpenTeamConfig = z.infer<typeof OpenTeamConfigSchema>;
|
|
432
489
|
export type LocalRuntime = z.infer<typeof LocalRuntimeSchema>;
|
|
433
490
|
export type ConsoleConfig = z.infer<typeof ConsoleConfigSchema>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"schema.d.ts","sourceRoot":"","sources":["../../src/config/schema.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB,eAAO,MAAM,cAAc;;;iBAGzB,CAAC;AAEH,eAAO,MAAM,gBAAgB;;;;EAA6C,CAAC;AAC3E,eAAO,MAAM,iBAAiB;;;;EAI5B,CAAC;AACH,eAAO,MAAM,kBAAkB;;;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oB,CAEtB"}
|
package/dist/console/assets.d.ts
CHANGED
|
@@ -5,5 +5,13 @@
|
|
|
5
5
|
* todo el contenido dinámico antes de insertarlo.
|
|
6
6
|
*/
|
|
7
7
|
export declare const CONSOLE_STYLE = "\n:root{color-scheme:dark;--bg:#0f1115;--panel:#171a21;--fg:#e6e8eb;--muted:#8b929c;--good:#3fb950;--local:#58a6ff;--frontier:#d29922;--line:#262b34}\n*{box-sizing:border-box}\nbody{margin:0;background:var(--bg);color:var(--fg);font:14px/1.5 ui-sans-serif,system-ui,Segoe UI,Roboto,sans-serif}\nheader{padding:16px 24px;border-bottom:1px solid var(--line);display:flex;justify-content:space-between;align-items:baseline;gap:12px;flex-wrap:wrap}\nheader h1{font-size:18px;margin:0}\nheader .meta{color:var(--muted);font-size:12px}\nmain{display:grid;grid-template-columns:repeat(auto-fit,minmax(320px,1fr));gap:16px;padding:24px}\n.panel{background:var(--panel);border:1px solid var(--line);border-radius:10px;padding:16px}\n.panel h2{font-size:14px;margin:0 0 12px;color:var(--muted);text-transform:uppercase;letter-spacing:.04em}\n.grid{display:grid;grid-template-columns:repeat(2,1fr);gap:10px}\n.stat{display:flex;flex-direction:column;gap:2px}\n.stat .k{color:var(--muted);font-size:12px}\n.stat .v{font-size:18px;font-weight:600}\n.good{color:var(--good)}\n.local{color:var(--local)}\n.frontier{color:var(--frontier)}\n.muted{color:var(--muted)}\ntable{width:100%;border-collapse:collapse;font-size:13px}\nth,td{text-align:left;padding:6px 8px;border-bottom:1px solid var(--line)}\nth{color:var(--muted);font-weight:600}\n.hash{font-family:ui-monospace,Consolas,monospace;color:var(--muted)}\n.progress{height:10px;background:#0b0d11;border-radius:6px;overflow:hidden;border:1px solid var(--line)}\n.progress .bar{height:100%;background:var(--good)}\nul.items,ul.timeline{list-style:none;margin:8px 0 0;padding:0;max-height:320px;overflow:auto}\nul.items li,ul.timeline li{padding:4px 0;border-bottom:1px solid var(--line)}\nul.items li.done{color:var(--muted)}\nul.items .box{font-family:monospace}\n.who{color:var(--local)}\n.tag{color:var(--frontier);font-size:12px}\n.kind{display:inline-block;min-width:66px;color:var(--muted);font-size:12px}\ncode{font-family:ui-monospace,Consolas,monospace;background:#0b0d11;padding:1px 5px;border-radius:4px}\n.mono{font-family:ui-monospace,Consolas,monospace;font-size:12px}\n.tabs{display:flex;gap:6px;padding:12px 24px 0;flex-wrap:wrap;border-bottom:1px solid var(--line)}\n.tabs .tab{background:var(--panel);color:var(--fg);border:1px solid var(--line);border-bottom:none;border-radius:8px 8px 0 0;padding:8px 14px;cursor:pointer;font:inherit;display:flex;align-items:center;gap:6px}\n.tabs .tab.active{background:var(--bg);border-color:var(--local);color:var(--fg)}\n.dot{width:8px;height:8px;border-radius:50%;display:inline-block;background:var(--muted)}\n.badge{font-size:11px;padding:1px 8px;border-radius:10px;border:1px solid var(--line);color:var(--muted);vertical-align:middle}\n.status-running{background:var(--good)}\n.badge.status-running{color:var(--good);border-color:var(--good)}\n.status-idle{background:var(--muted)}\n.badge.status-idle{color:var(--muted)}\n.status-waiting-input{background:var(--frontier)}\n.badge.status-waiting-input{color:var(--frontier);border-color:var(--frontier)}\n.status-ended{background:#6e7681}\n.badge.status-ended{color:#6e7681}\n.term .termlog{background:#0b0d11;border:1px solid var(--line);border-radius:8px;padding:10px;max-height:340px;overflow:auto;font-family:ui-monospace,Consolas,monospace;font-size:12px;white-space:pre-wrap}\n.term .tl{padding:1px 0}\n.term .tl.input{color:var(--local)}\n.term .tl.tool{color:var(--frontier)}\n.term .tl.status{color:var(--muted)}\n.term .tl.error{color:#f85149}\n.term .tl.permission{color:var(--frontier);font-weight:600}\n.term form.terminput{display:flex;gap:8px;margin-top:10px}\n.term form.terminput input{flex:1;background:#0b0d11;color:var(--fg);border:1px solid var(--line);border-radius:8px;padding:8px 10px;font:inherit}\n.term form.terminput button{background:var(--local);color:#04122b;border:none;border-radius:8px;padding:8px 16px;cursor:pointer;font:inherit;font-weight:600}\n.pty .ptylog{background:#05070a;border:1px solid var(--line);border-radius:8px;padding:10px;max-height:340px;overflow:auto;font-family:ui-monospace,Consolas,monospace;font-size:12px;white-space:pre-wrap;color:#c8d1dc}\n.pty form.ptyinput{display:flex;gap:8px;margin-top:10px}\n.pty form.ptyinput input{flex:1;background:#05070a;color:var(--fg);border:1px solid var(--line);border-radius:8px;padding:8px 10px;font:inherit}\n.pty form.ptyinput button,.pty .pty-start{background:var(--frontier);color:#1a1200;border:none;border-radius:8px;padding:8px 16px;cursor:pointer;font:inherit;font-weight:600;margin-top:8px}\n.pty .pty-start:disabled{opacity:.5;cursor:default}\n";
|
|
8
|
-
|
|
8
|
+
/**
|
|
9
|
+
* Estilos del render del grafo de agentes (GE-083). Se inyectan en el `<style>`
|
|
10
|
+
* **solo** cuando la vista del grafo está habilitada, de modo que con la vista
|
|
11
|
+
* apagada la Console es byte-idéntica a hoy. Colorean cada nodo por estado y dan
|
|
12
|
+
* formato a las aristas y a los badges reference-only (intento/error/timeout/
|
|
13
|
+
* cancelación/veredicto/linaje/artefacto).
|
|
14
|
+
*/
|
|
15
|
+
export declare const GRAPH_STYLE = "\n.graph-wrap{overflow:auto;background:#0b0d11;border:1px solid var(--line);border-radius:8px;padding:8px}\nsvg.graph{display:block}\n.gedge{stroke:#3a4250;stroke-width:1.5;marker-end:url(#garrow)}\n.gnode rect{fill:var(--panel);stroke:var(--line);stroke-width:1.5;rx:8}\n.gnode .gname{fill:var(--fg);font:600 12px ui-monospace,Consolas,monospace}\n.gnode .grole{fill:var(--muted);font-size:11px}\n.gnode .gstate{font-size:10px;text-transform:uppercase;letter-spacing:.05em}\n.gnode.state-pending rect{stroke:#6e7681}\n.gnode.state-pending .gstate{fill:#6e7681}\n.gnode.state-ready rect{stroke:var(--local)}\n.gnode.state-ready .gstate{fill:var(--local)}\n.gnode.state-active rect{stroke:var(--frontier)}\n.gnode.state-active .gstate{fill:var(--frontier)}\n.gnode.state-succeeded rect{stroke:var(--good)}\n.gnode.state-succeeded .gstate{fill:var(--good)}\n.gnode.state-failed rect{stroke:#f85149}\n.gnode.state-failed .gstate{fill:#f85149}\n.gnode.state-cancelled rect{stroke:#484f58}\n.gnode.state-cancelled .gstate{fill:#484f58}\n.gbadge{font-size:10px;font-family:ui-monospace,Consolas,monospace}\n.gbadge.badge-retry{fill:var(--frontier)}\n.gbadge.badge-error{fill:#f85149}\n.gbadge.badge-cancelled{fill:#484f58}\n.gbadge.badge-verdict.verdict-approved{fill:var(--good)}\n.gbadge.badge-verdict.verdict-rejected{fill:#f85149}\n.gbadge.badge-verdict.verdict-inconclusive{fill:var(--frontier)}\n.gbadge.badge-lineage{fill:var(--local)}\n.gbadge.badge-artifact{fill:var(--muted)}\n.gnode[data-session]{cursor:pointer}\n.gnode[data-session]:hover rect{stroke-width:2.5}\n.graph-health{display:flex;flex-wrap:wrap;gap:8px;margin:0 0 12px}\n.gchip{font-size:11px;padding:2px 10px;border-radius:10px;border:1px solid var(--line);color:var(--muted)}\n.gchip.on{font-weight:600}\n.gchip.gh-recovery.on,.gchip.gh-unknown.on{color:var(--frontier);border-color:var(--frontier)}\n.gchip.gh-conflict.on,.gchip.gh-kill.on{color:#f85149;border-color:#f85149}\n.graph-drill{margin-top:14px;border-top:1px solid var(--line);padding-top:12px}\n.graph-drill h3{font-size:13px;margin:0 0 8px;color:var(--muted);text-transform:uppercase;letter-spacing:.04em}\n.graph-drill .drilllog{background:#0b0d11;border:1px solid var(--line);border-radius:8px;padding:10px;max-height:280px;overflow:auto;font-family:ui-monospace,Consolas,monospace;font-size:12px;white-space:pre-wrap}\n.graph-drill .drilllog .tl{padding:1px 0}\n.graph-drill .drilllog .tl.tool{color:var(--frontier)}\n.graph-drill .drilllog .tl.status{color:var(--muted)}\n.graph-drill .drilllog .tl.permission{color:var(--frontier);font-weight:600}\n.graph-drill .drilllog .tl.error{color:#f85149}\n";
|
|
16
|
+
export declare const CONSOLE_CLIENT_JS = "\n(function(){\n var authTok='';\n try{\n var qp=new URLSearchParams(window.location.search).get('token');\n if(qp){authTok='?token='+encodeURIComponent(qp)}\n }catch(e){/* ignore */}\n function reloadIfChanged(prev){\n fetch('/api/state'+authTok).then(function(r){return r.json()}).then(function(s){\n if(s.generatedAt!==prev){location.reload()}\n }).catch(function(){});\n }\n var current=document.documentElement.getAttribute('data-generated')||'';\n if('EventSource' in window){\n try{\n var es=new EventSource('/events'+authTok);\n es.addEventListener('state',function(){location.reload()});\n es.onerror=function(){/* fallback below */};\n }catch(e){/* ignore */}\n }\n var ms=parseInt(document.documentElement.getAttribute('data-refresh')||'2000',10);\n setInterval(function(){reloadIfChanged(current)},isNaN(ms)?2000:Math.max(250,ms));\n\n function selectTab(name){\n var tabs=document.querySelectorAll('#tabbar .tab');\n for(var i=0;i<tabs.length;i++){tabs[i].classList.toggle('active',tabs[i].getAttribute('data-tab')===name)}\n var views=document.querySelectorAll('main .view');\n var matched=false;\n for(var j=0;j<views.length;j++){\n var show=views[j].getAttribute('data-view')===name;\n views[j].hidden=!show;\n if(show){matched=true;if(name!=='all'){connectTerminal(views[j],name)}}\n }\n if(!matched){return false}\n try{sessionStorage.setItem('openteam.tab',name)}catch(e){}\n return true;\n }\n function connectTerminal(view,id){\n if(view.__wired){return}\n var root=document.documentElement;\n var token=root.getAttribute('data-token');\n if(root.getAttribute('data-terminal')!=='1'||!token){return}\n var log=view.querySelector('.termlog');\n if(!log){return}\n view.__wired=true;\n function append(cls,text){\n var line=document.createElement('div');\n line.className='tl '+cls;line.textContent=text;\n log.appendChild(line);log.scrollTop=log.scrollHeight;\n }\n var q='/console/session/'+encodeURIComponent(id);\n var tk='token='+encodeURIComponent(token);\n if('EventSource' in window){\n try{\n var es=new EventSource(q+'/stream?'+tk);\n es.addEventListener('frame',function(e){try{var f=JSON.parse(e.data);append(f.kind,f.text)}catch(_){}}); \n es.onerror=function(){/* reconecta solo */};\n }catch(_){/* ignore */}\n }\n var form=view.querySelector('form.terminput');\n if(form){\n form.addEventListener('submit',function(e){\n e.preventDefault();\n var inp=form.querySelector('input[name=text]');\n var text=inp.value;\n if(!text){return}\n inp.value='';append('input','\u203A '+text);\n fetch(q+'/input?'+tk,{method:'POST',headers:{'content-type':'application/json'},body:JSON.stringify({text:text})})\n .then(function(r){if(!r.ok){append('error','\u2716 env\u00EDo rechazado ('+r.status+')')}})\n .catch(function(){append('error','\u2716 no se pudo enviar')});\n });\n }\n connectPty(view,id,q,tk);\n }\n function connectPty(view,id,q,tk){\n var root=document.documentElement;\n if(root.getAttribute('data-pty')!=='1'){return}\n var pane=view.querySelector('.pty');\n if(!pane){return}\n var log=pane.querySelector('.ptylog');\n var startBtn=pane.querySelector('.pty-start');\n var input=pane.querySelector('form.ptyinput');\n function plog(text){\n var d=document.createElement('span');d.textContent=text;\n log.appendChild(d);log.scrollTop=log.scrollHeight;\n }\n if(!startBtn){return}\n startBtn.addEventListener('click',function(){\n startBtn.disabled=true;plog('Abriendo shell\u2026\n');\n fetch(q+'/pty?'+tk,{method:'POST',headers:{'content-type':'application/json'},body:'{}'})\n .then(function(r){return r.ok?r.json():Promise.reject(r.status)})\n .then(function(info){openPtyWs(info.wsUrl)})\n .catch(function(s){plog('\u2716 no se pudo abrir PTY ('+s+')\n');startBtn.disabled=false});\n });\n function openPtyWs(url){\n try{\n var ws=new WebSocket(url);\n ws.binaryType='arraybuffer';\n ws.onmessage=function(e){\n var data=e.data;\n if(data instanceof ArrayBuffer){data=new TextDecoder().decode(new Uint8Array(data))}\n plog(data);\n };\n ws.onclose=function(){plog('\n[shell cerrada]\n');startBtn.disabled=false};\n ws.onerror=function(){plog('\n\u2716 error de WebSocket\n')};\n if(input){\n input.hidden=false;\n input.addEventListener('submit',function(e){\n e.preventDefault();\n var c=input.querySelector('input[name=cmd]');\n if(!c.value){return}\n ws.send(c.value+'\r');c.value='';\n });\n }\n }catch(_){plog('\n\u2716 WebSocket no disponible\n');startBtn.disabled=false}\n }\n }\n function wireGraphDrill(){\n var root=document.documentElement;\n if(root.getAttribute('data-drilldown')!=='1'){return}\n var token=root.getAttribute('data-token');\n if(!token){return}\n var drill=document.querySelector('.graph-drill');\n if(!drill){return}\n var gview=drill.closest('.view');\n if(!gview){return}\n var log=drill.querySelector('.drilllog');\n var title=drill.querySelector('.drill-title');\n if(!log){return}\n var es=null;\n function append(cls,text){\n var line=document.createElement('div');\n line.className='tl '+cls;line.textContent=text;\n log.appendChild(line);log.scrollTop=log.scrollHeight;\n }\n function open(id){\n if(es){try{es.close()}catch(_){}}\n log.textContent='';drill.hidden=false;\n if(title){title.textContent='Conversaci\u00F3n \u00B7 '+id}\n var tk='token='+encodeURIComponent(token);\n var base='/console/session/'+encodeURIComponent(id);\n fetch(base+'/messages?'+tk).then(function(r){return r.ok?r.json():Promise.reject(r.status)})\n .then(function(d){(d&&d.frames||[]).forEach(function(f){append(f.kind,f.text)})})\n .catch(function(s){append('error','\u2716 no se pudo cargar la conversaci\u00F3n ('+s+')')});\n if('EventSource' in window){\n try{\n es=new EventSource(base+'/stream?'+tk);\n es.addEventListener('frame',function(e){try{var f=JSON.parse(e.data);append(f.kind,f.text)}catch(_){}}); \n es.onerror=function(){/* reconecta solo */};\n }catch(_){/* ignore */}\n }\n }\n gview.addEventListener('click',function(e){\n var t=e.target;\n while(t&&t!==gview&&!(t.getAttribute&&t.getAttribute('data-session'))){t=t.parentNode}\n if(t&&t.getAttribute&&t.getAttribute('data-session')){open(t.getAttribute('data-session'))}\n });\n }\n var bar=document.getElementById('tabbar');\n if(bar){\n bar.addEventListener('click',function(e){\n var t=e.target;\n while(t&&t!==bar&&!t.getAttribute('data-tab')){t=t.parentNode}\n if(t&&t.getAttribute('data-tab')){selectTab(t.getAttribute('data-tab'))}\n });\n }\n var saved='all';\n try{saved=sessionStorage.getItem('openteam.tab')||'all'}catch(e){}\n if(!selectTab(saved)){selectTab('all')}\n wireGraphDrill();\n})();\n";
|
|
9
17
|
//# sourceMappingURL=assets.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"assets.d.ts","sourceRoot":"","sources":["../../src/console/assets.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,eAAO,MAAM,aAAa,igJA6DzB,CAAC;AAEF,eAAO,MAAM,iBAAiB,
|
|
1
|
+
{"version":3,"file":"assets.d.ts","sourceRoot":"","sources":["../../src/console/assets.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,eAAO,MAAM,aAAa,igJA6DzB,CAAC;AAEF;;;;;;GAMG;AACH,eAAO,MAAM,WAAW,klFA4CvB,CAAC;AAEF,eAAO,MAAM,iBAAiB,kmOA2K7B,CAAC"}
|
|
@@ -18,6 +18,12 @@ export type ConsoleClient = {
|
|
|
18
18
|
sendPrompt: (sessionID: string, text: string) => Promise<void>;
|
|
19
19
|
/** Responde a una solicitud de permiso. */
|
|
20
20
|
respondPermission: (sessionID: string, permissionID: string, response: "once" | "always" | "reject") => Promise<void>;
|
|
21
|
+
/**
|
|
22
|
+
* Lee el histórico de la conversación de una sesión vía `session.messages`
|
|
23
|
+
* (GET **de solo lectura**) para el drill-down del grafo (GE-084). Devuelve
|
|
24
|
+
* frames reference-only; nunca persiste ni registra el contenido.
|
|
25
|
+
*/
|
|
26
|
+
listMessages: (sessionID: string) => Promise<SessionFrame[]>;
|
|
21
27
|
/**
|
|
22
28
|
* Suscribe a los eventos de la sesión y llama `onFrame` por cada frame legible.
|
|
23
29
|
* Se detiene cuando `signal` aborta o el stream termina.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"opencodeClient.d.ts","sourceRoot":"","sources":["../../src/console/opencodeClient.ts"],"names":[],"mappings":"AAAA,OAAO,
|
|
1
|
+
{"version":3,"file":"opencodeClient.d.ts","sourceRoot":"","sources":["../../src/console/opencodeClient.ts"],"names":[],"mappings":"AAAA,OAAO,EAIL,KAAK,YAAY,EAClB,MAAM,YAAY,CAAC;AACpB,OAAO,EAA2B,KAAK,UAAU,EAAE,MAAM,OAAO,CAAC;AAEjE;;;;GAIG;AAEH,MAAM,MAAM,SAAS,GAAG,OAAO,KAAK,CAAC;AAErC,MAAM,MAAM,iBAAiB,GAAG;IAC9B,oEAAoE;IACpE,QAAQ,EAAE,MAAM,CAAC;IACjB,6EAA6E;IAC7E,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,KAAK,CAAC,EAAE,SAAS,CAAC;CACnB,CAAC;AAEF,MAAM,MAAM,aAAa,GAAG;IAC1B,iFAAiF;IACjF,UAAU,EAAE,CAAC,SAAS,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,KAAK,OAAO,CAAC,IAAI,CAAC,CAAC;IAC/D,2CAA2C;IAC3C,iBAAiB,EAAE,CACjB,SAAS,EAAE,MAAM,EACjB,YAAY,EAAE,MAAM,EACpB,QAAQ,EAAE,MAAM,GAAG,QAAQ,GAAG,QAAQ,KACnC,OAAO,CAAC,IAAI,CAAC,CAAC;IACnB;;;;OAIG;IACH,YAAY,EAAE,CAAC,SAAS,EAAE,MAAM,KAAK,OAAO,CAAC,YAAY,EAAE,CAAC,CAAC;IAC7D;;;OAGG;IACH,YAAY,EAAE,CACZ,SAAS,EAAE,MAAM,EACjB,OAAO,EAAE,CAAC,KAAK,EAAE,YAAY,KAAK,IAAI,EACtC,MAAM,EAAE,WAAW,KAChB,OAAO,CAAC,IAAI,CAAC,CAAC;CACpB,CAAC;AAgBF,oFAAoF;AACpF,wBAAgB,cAAc,CAC5B,OAAO,EAAE,UAAU,EACnB,SAAS,EAAE,MAAM,GAChB,YAAY,GAAG,SAAS,CAK1B;AAED,wBAAgB,mBAAmB,CAAC,IAAI,EAAE,iBAAiB,GAAG,aAAa,CA+E1E"}
|
|
@@ -31,6 +31,14 @@ export type OpencodeEventLike = {
|
|
|
31
31
|
* campo directo como los anidados (`part.sessionID`, `info.sessionID`). Pure.
|
|
32
32
|
*/
|
|
33
33
|
export declare function eventSessionID(event: OpencodeEventLike): string | undefined;
|
|
34
|
+
/**
|
|
35
|
+
* Traduce la respuesta de `session.messages` (histórico de la conversación) a
|
|
36
|
+
* frames legibles para el drill-down **de solo lectura** (GE-084). Acepta la
|
|
37
|
+
* forma laxa `{ info?, parts? }[]`, descarta entradas de otra sesión y traduce
|
|
38
|
+
* cada `part` con `partToFrame`. Nunca incluye argumentos de tool ni secretos.
|
|
39
|
+
* Determinista y sin I/O: el driver (`console/opencodeClient.ts`) aporta la red.
|
|
40
|
+
*/
|
|
41
|
+
export declare function messagesToFrames(raw: unknown, sessionID: string): SessionFrame[];
|
|
34
42
|
/**
|
|
35
43
|
* Traduce un evento opencode a un frame de sesión legible, **solo** si pertenece
|
|
36
44
|
* a `sessionID`. Devuelve `undefined` para eventos irrelevantes o de otra sesión.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"protocol.d.ts","sourceRoot":"","sources":["../../src/console/protocol.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB;;;;;GAKG;AAEH,mFAAmF;AACnF,eAAO,MAAM,eAAe,SAAU,CAAC;AAEvC,eAAO,MAAM,kBAAkB;;iBAE7B,CAAC;AAEH,MAAM,MAAM,YAAY,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,kBAAkB,CAAC,CAAC;AAE9D,qFAAqF;AACrF,wBAAgB,iBAAiB,CAAC,GAAG,EAAE,OAAO,GAAG,YAAY,GAAG,SAAS,CAGxE;AAED,MAAM,MAAM,gBAAgB,GACxB,MAAM,GACN,MAAM,GACN,QAAQ,GACR,YAAY,GACZ,OAAO,CAAC;AAEZ,wEAAwE;AACxE,MAAM,MAAM,YAAY,GAAG;IACzB,IAAI,EAAE,gBAAgB,CAAC;IACvB,IAAI,EAAE,MAAM,CAAC;IACb,kEAAkE;IAClE,YAAY,CAAC,EAAE,MAAM,CAAC;CACvB,CAAC;AAEF,4EAA4E;AAC5E,MAAM,MAAM,iBAAiB,GAAG;IAC9B,IAAI,EAAE,MAAM,CAAC;IACb,UAAU,CAAC,EAAE,OAAO,CAAC;CACtB,CAAC;AAYF;;;GAGG;AACH,wBAAgB,cAAc,CAAC,KAAK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B,SAAS,EAAE,MAAM,GAChB,YAAY,GAAG,SAAS,CA6B1B;AAED,gEAAgE;AAChE,wBAAgB,UAAU,CAAC,KAAK,EAAE,YAAY,GAAG,MAAM,CAEtD"}
|
package/dist/console/render.d.ts
CHANGED
|
@@ -1,6 +1,15 @@
|
|
|
1
|
+
import type { GraphViewProjectionV1 } from "../telemetry/graphView";
|
|
1
2
|
import type { ConsoleState } from "./types";
|
|
2
3
|
/** Escapa texto para HTML. Evita fuga de markup y roturas de `</script>`. Pure. */
|
|
3
4
|
export declare function escapeHtml(value: string): string;
|
|
5
|
+
/**
|
|
6
|
+
* Renderiza el DAG del grafo de agentes como SVG **determinista** a partir de la
|
|
7
|
+
* proyección reference-only (GE-083). Colorea cada nodo por estado y pinta los
|
|
8
|
+
* badges de intento/error/timeout/cancelación/veredicto/linaje. Escapa todo
|
|
9
|
+
* identificador; **nunca** incluye contenido crudo. Puro: mismas entradas ->
|
|
10
|
+
* misma salida.
|
|
11
|
+
*/
|
|
12
|
+
export declare function renderGraphView(projection: GraphViewProjectionV1 | null): string;
|
|
4
13
|
export type RenderOptions = {
|
|
5
14
|
/** Fallback de polling en ms (default 2000). */
|
|
6
15
|
refreshMs?: number;
|
|
@@ -10,6 +19,22 @@ export type RenderOptions = {
|
|
|
10
19
|
terminalEnabled?: boolean;
|
|
11
20
|
/** Habilita la vista "Terminal" (PTY real, Fase 5). Opt-in. */
|
|
12
21
|
ptyEnabled?: boolean;
|
|
22
|
+
/**
|
|
23
|
+
* Habilita la vista "Grafo" (GE-083). Opt-in: cuando se pasa, se añade la
|
|
24
|
+
* pestaña/vista del DAG y sus estilos; sin ella, la salida es byte-idéntica a
|
|
25
|
+
* hoy. `projection` es la vista reference-only del grafo (o `null` si no hay
|
|
26
|
+
* run activo).
|
|
27
|
+
*/
|
|
28
|
+
graphView?: {
|
|
29
|
+
readonly projection: GraphViewProjectionV1 | null;
|
|
30
|
+
};
|
|
31
|
+
/**
|
|
32
|
+
* Habilita el drill-down nodo->conversación de solo lectura (GE-084). Solo
|
|
33
|
+
* surte efecto junto a `graphView`: añade el panel de conversación y expone el
|
|
34
|
+
* token/marca `data-drilldown` que usa el cliente. Sin él, la vista del grafo
|
|
35
|
+
* es idéntica a GE-083.
|
|
36
|
+
*/
|
|
37
|
+
drilldownEnabled?: boolean;
|
|
13
38
|
};
|
|
14
39
|
/**
|
|
15
40
|
* Renderiza el console como un único HTML autocontenido (CSS + JS inline, sin
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"render.d.ts","sourceRoot":"","sources":["../../src/console/render.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"render.d.ts","sourceRoot":"","sources":["../../src/console/render.ts"],"names":[],"mappings":"AAUA,OAAO,KAAK,EAGV,qBAAqB,EACtB,MAAM,wBAAwB,CAAC;AAGhC,OAAO,KAAK,EAGV,YAAY,EAIb,MAAM,SAAS,CAAC;AASjB,mFAAmF;AACnF,wBAAgB,UAAU,CAAC,KAAK,EAAE,MAAM,GAAG,MAAM,CAOhD;AAyhBD;;;;;;GAMG;AACH,wBAAgB,eAAe,CAC7B,UAAU,EAAE,qBAAqB,GAAG,IAAI,GACvC,MAAM,CAwBR;AAmED,MAAM,MAAM,aAAa,GAAG;IAC1B,gDAAgD;IAChD,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,oEAAoE;IACpE,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,kEAAkE;IAClE,eAAe,CAAC,EAAE,OAAO,CAAC;IAC1B,+DAA+D;IAC/D,UAAU,CAAC,EAAE,OAAO,CAAC;IACrB;;;;;OAKG;IACH,SAAS,CAAC,EAAE;QACV,QAAQ,CAAC,UAAU,EAAE,qBAAqB,GAAG,IAAI,CAAC;KACnD,CAAC;IACF;;;;;OAKG;IACH,gBAAgB,CAAC,EAAE,OAAO,CAAC;CAC5B,CAAC;AAEF;;;;GAIG;AACH,wBAAgB,iBAAiB,CAC/B,KAAK,EAAE,YAAY,EACnB,OAAO,GAAE,aAAkB,GAC1B,MAAM,CAyDR"}
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
import type { ContextRef, ManifestEntry } from "./schema";
|
|
2
|
+
/**
|
|
3
|
+
* Utilidades de **redacción** del seam de contexto.
|
|
4
|
+
*
|
|
5
|
+
* Calcula digests SHA-256 estables y construye entradas de manifiesto a partir
|
|
6
|
+
* de contenido en memoria **sin persistirlo**. También ofrece un guard que
|
|
7
|
+
* rechaza estructuras con campos de contenido crudo, para mantener journal,
|
|
8
|
+
* snapshots y telemetría solo con referencias.
|
|
9
|
+
*
|
|
10
|
+
* Cómputo determinista: `node:crypto` y `Buffer` no son I/O, reloj ni random.
|
|
11
|
+
*/
|
|
12
|
+
/** Error tipado de una violación de la política reference-only. */
|
|
13
|
+
export declare class RedactionError extends Error {
|
|
14
|
+
readonly code: "raw-content";
|
|
15
|
+
readonly key: string;
|
|
16
|
+
constructor(key: string);
|
|
17
|
+
}
|
|
18
|
+
/** Digest SHA-256 en hex minúscula de una cadena UTF-8. */
|
|
19
|
+
export declare function sha256Hex(input: string): string;
|
|
20
|
+
/** Par digest + tamaño en bytes UTF-8 de un contenido en memoria. */
|
|
21
|
+
export type Digest = {
|
|
22
|
+
sha256: string;
|
|
23
|
+
bytes: number;
|
|
24
|
+
};
|
|
25
|
+
/** Deriva el digest y el tamaño UTF-8 de un contenido, sin almacenarlo. */
|
|
26
|
+
export declare function digestUtf8(text: string): Digest;
|
|
27
|
+
/**
|
|
28
|
+
* Construye una entrada de manifiesto redactada a partir de contenido en
|
|
29
|
+
* memoria. Incluye la `ContextRef` solo si se aporta una referencia estable.
|
|
30
|
+
*/
|
|
31
|
+
export declare function buildManifestEntry(label: string, text: string, ref?: ContextRef): ManifestEntry;
|
|
32
|
+
/**
|
|
33
|
+
* Proyección **reference-only** de una `ContextRef`: solo localización lógica,
|
|
34
|
+
* digest y tamaño. Descarta `mediaType` para mantener la telemetría acotada;
|
|
35
|
+
* nunca transporta contenido.
|
|
36
|
+
*/
|
|
37
|
+
export declare function redactedRef(ref: ContextRef): {
|
|
38
|
+
uri: string;
|
|
39
|
+
sha256: string;
|
|
40
|
+
bytes: number;
|
|
41
|
+
};
|
|
42
|
+
/**
|
|
43
|
+
* Recorre una estructura y lanza `RedactionError` si encuentra alguna clave de
|
|
44
|
+
* contenido crudo. Guard barato para journal/snapshots/telemetría; no valida
|
|
45
|
+
* esquema, solo ausencia de campos crudos.
|
|
46
|
+
*/
|
|
47
|
+
export declare function assertReferenceOnly(value: unknown): void;
|
|
48
|
+
//# sourceMappingURL=redaction.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"redaction.d.ts","sourceRoot":"","sources":["../../src/context/redaction.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,UAAU,EAAE,aAAa,EAAE,MAAM,UAAU,CAAC;AAE1D;;;;;;;;;GASG;AAEH,mEAAmE;AACnE,qBAAa,cAAe,SAAQ,KAAK;IACvC,QAAQ,CAAC,IAAI,EAAE,aAAa,CAAC;IAC7B,QAAQ,CAAC,GAAG,EAAE,MAAM,CAAC;gBAET,GAAG,EAAE,MAAM;CAMxB;AAED,2DAA2D;AAC3D,wBAAgB,SAAS,CAAC,KAAK,EAAE,MAAM,GAAG,MAAM,CAE/C;AAED,qEAAqE;AACrE,MAAM,MAAM,MAAM,GAAG;IACnB,MAAM,EAAE,MAAM,CAAC;IACf,KAAK,EAAE,MAAM,CAAC;CACf,CAAC;AAEF,2EAA2E;AAC3E,wBAAgB,UAAU,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM,CAK/C;AAED;;;GAGG;AACH,wBAAgB,kBAAkB,CAChC,KAAK,EAAE,MAAM,EACb,IAAI,EAAE,MAAM,EACZ,GAAG,CAAC,EAAE,UAAU,GACf,aAAa,CAKf;AAED;;;;GAIG;AACH,wBAAgB,WAAW,CAAC,GAAG,EAAE,UAAU,GAAG;IAC5C,GAAG,EAAE,MAAM,CAAC;IACZ,MAAM,EAAE,MAAM,CAAC;IACf,KAAK,EAAE,MAAM,CAAC;CACf,CAEA;AAgBD;;;;GAIG;AACH,wBAAgB,mBAAmB,CAAC,KAAK,EAAE,OAAO,GAAG,IAAI,CAkBxD"}
|
|
@@ -0,0 +1,115 @@
|
|
|
1
|
+
import { z } from "zod";
|
|
2
|
+
/**
|
|
3
|
+
* Esquemas Zod del **seam de contexto** de Graph V1.
|
|
4
|
+
*
|
|
5
|
+
* Este módulo es la capa base pura: define referencias, digests y clases de
|
|
6
|
+
* privacidad que el resto de Graph consume. Solo transporta **referencias y
|
|
7
|
+
* digests**; nunca contenido crudo (brief, prompt, findings o salida del
|
|
8
|
+
* modelo). Todos los objetos usan `.strict()`, de modo que cualquier campo
|
|
9
|
+
* desconocido —incluidos campos de contenido crudo— falla con un error tipado.
|
|
10
|
+
*
|
|
11
|
+
* Prohibido en `src/context/**`: Prefill, llamadas al modelo, cache warming,
|
|
12
|
+
* filesystem y telemetría. `sha256Hex`/`digestUtf8` viven en `redaction.ts` y
|
|
13
|
+
* solo hacen cómputo determinista.
|
|
14
|
+
*/
|
|
15
|
+
/** Clase de privacidad de un artefacto o contrato de contexto. */
|
|
16
|
+
export declare const PrivacyClassSchema: z.ZodEnum<{
|
|
17
|
+
public: "public";
|
|
18
|
+
internal: "internal";
|
|
19
|
+
sensitive: "sensitive";
|
|
20
|
+
}>;
|
|
21
|
+
export type PrivacyClass = z.infer<typeof PrivacyClassSchema>;
|
|
22
|
+
/** Digest SHA-256 en hex minúscula (exactamente 64 caracteres). */
|
|
23
|
+
export declare const Sha256Schema: z.ZodString;
|
|
24
|
+
export type Sha256 = z.infer<typeof Sha256Schema>;
|
|
25
|
+
/**
|
|
26
|
+
* Identificador estable (taskID, etiquetas de manifiesto). No es contenido:
|
|
27
|
+
* charset acotado y longitud limitada para mantener el seam determinista.
|
|
28
|
+
*/
|
|
29
|
+
export declare const IdentifierSchema: z.ZodString;
|
|
30
|
+
export type Identifier = z.infer<typeof IdentifierSchema>;
|
|
31
|
+
/**
|
|
32
|
+
* `TaskAnchor` — referencia estable a la tarea/spec que ancla un nodo. Solo
|
|
33
|
+
* identificador y digest; nunca contenido.
|
|
34
|
+
*/
|
|
35
|
+
export declare const TaskAnchorSchema: z.ZodObject<{
|
|
36
|
+
taskID: z.ZodString;
|
|
37
|
+
specDigest: z.ZodString;
|
|
38
|
+
}, z.core.$strict>;
|
|
39
|
+
export type TaskAnchor = z.infer<typeof TaskAnchorSchema>;
|
|
40
|
+
/**
|
|
41
|
+
* `ContextRef` — referencia acotada a contenido por digest. No transporta el
|
|
42
|
+
* contenido: solo su localización lógica, digest SHA-256 y tamaño en bytes.
|
|
43
|
+
*/
|
|
44
|
+
export declare const ContextRefSchema: z.ZodObject<{
|
|
45
|
+
uri: z.ZodString;
|
|
46
|
+
sha256: z.ZodString;
|
|
47
|
+
bytes: z.ZodNumber;
|
|
48
|
+
mediaType: z.ZodOptional<z.ZodString>;
|
|
49
|
+
}, z.core.$strict>;
|
|
50
|
+
export type ContextRef = z.infer<typeof ContextRefSchema>;
|
|
51
|
+
/**
|
|
52
|
+
* Entrada de un manifiesto de artefactos: etiqueta estable, digest y tamaño;
|
|
53
|
+
* opcionalmente una `ContextRef` estable cuando el input persiste como
|
|
54
|
+
* referencia revalidable. Nunca lleva título, extracto ni contenido.
|
|
55
|
+
*/
|
|
56
|
+
export declare const ManifestEntrySchema: z.ZodObject<{
|
|
57
|
+
label: z.ZodString;
|
|
58
|
+
sha256: z.ZodString;
|
|
59
|
+
bytes: z.ZodNumber;
|
|
60
|
+
ref: z.ZodOptional<z.ZodObject<{
|
|
61
|
+
uri: z.ZodString;
|
|
62
|
+
sha256: z.ZodString;
|
|
63
|
+
bytes: z.ZodNumber;
|
|
64
|
+
mediaType: z.ZodOptional<z.ZodString>;
|
|
65
|
+
}, z.core.$strict>>;
|
|
66
|
+
}, z.core.$strict>;
|
|
67
|
+
export type ManifestEntry = z.infer<typeof ManifestEntrySchema>;
|
|
68
|
+
/**
|
|
69
|
+
* Manifiesto redactado de inputs seleccionados: versión, taskID, clase de
|
|
70
|
+
* privacidad y entradas ordenadas. El orden más los digests bastan para probar
|
|
71
|
+
* exactamente qué inputs se seleccionaron, sin exponer su contenido.
|
|
72
|
+
*/
|
|
73
|
+
export declare const ArtifactManifestSchema: z.ZodObject<{
|
|
74
|
+
version: z.ZodLiteral<1>;
|
|
75
|
+
taskID: z.ZodString;
|
|
76
|
+
privacyClass: z.ZodEnum<{
|
|
77
|
+
public: "public";
|
|
78
|
+
internal: "internal";
|
|
79
|
+
sensitive: "sensitive";
|
|
80
|
+
}>;
|
|
81
|
+
entries: z.ZodArray<z.ZodObject<{
|
|
82
|
+
label: z.ZodString;
|
|
83
|
+
sha256: z.ZodString;
|
|
84
|
+
bytes: z.ZodNumber;
|
|
85
|
+
ref: z.ZodOptional<z.ZodObject<{
|
|
86
|
+
uri: z.ZodString;
|
|
87
|
+
sha256: z.ZodString;
|
|
88
|
+
bytes: z.ZodNumber;
|
|
89
|
+
mediaType: z.ZodOptional<z.ZodString>;
|
|
90
|
+
}, z.core.$strict>>;
|
|
91
|
+
}, z.core.$strict>>;
|
|
92
|
+
}, z.core.$strict>;
|
|
93
|
+
export type ArtifactManifest = z.infer<typeof ArtifactManifestSchema>;
|
|
94
|
+
/**
|
|
95
|
+
* `NodeContextContract` — único seam de contexto de V1. Identifica referencias
|
|
96
|
+
* acotadas y digests; no hace fetch, prefill, warm, cache, summarize ni reserva
|
|
97
|
+
* de tokens.
|
|
98
|
+
*/
|
|
99
|
+
export declare const NodeContextContractSchema: z.ZodObject<{
|
|
100
|
+
version: z.ZodLiteral<1>;
|
|
101
|
+
refs: z.ZodArray<z.ZodObject<{
|
|
102
|
+
uri: z.ZodString;
|
|
103
|
+
sha256: z.ZodString;
|
|
104
|
+
bytes: z.ZodNumber;
|
|
105
|
+
mediaType: z.ZodOptional<z.ZodString>;
|
|
106
|
+
}, z.core.$strict>>;
|
|
107
|
+
privacyClass: z.ZodEnum<{
|
|
108
|
+
public: "public";
|
|
109
|
+
internal: "internal";
|
|
110
|
+
sensitive: "sensitive";
|
|
111
|
+
}>;
|
|
112
|
+
maxInputTokens: z.ZodOptional<z.ZodNumber>;
|
|
113
|
+
}, z.core.$strict>;
|
|
114
|
+
export type NodeContextContract = z.infer<typeof NodeContextContractSchema>;
|
|
115
|
+
//# sourceMappingURL=schema.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"schema.d.ts","sourceRoot":"","sources":["../../src/context/schema.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB;;;;;;;;;;;;GAYG;AAEH,kEAAkE;AAClE,eAAO,MAAM,kBAAkB;;;;EAA8C,CAAC;AAC9E,MAAM,MAAM,YAAY,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,kBAAkB,CAAC,CAAC;AAE9D,mEAAmE;AACnE,eAAO,MAAM,YAAY,aAEmC,CAAC;AAC7D,MAAM,MAAM,MAAM,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,YAAY,CAAC,CAAC;AAElD;;;GAGG;AACH,eAAO,MAAM,gBAAgB,aAIkC,CAAC;AAChE,MAAM,MAAM,UAAU,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,gBAAgB,CAAC,CAAC;AAE1D;;;GAGG;AACH,eAAO,MAAM,gBAAgB;;;kBAKlB,CAAC;AACZ,MAAM,MAAM,UAAU,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,gBAAgB,CAAC,CAAC;AAE1D;;;GAGG;AACH,eAAO,MAAM,gBAAgB;;;;;kBAOlB,CAAC;AACZ,MAAM,MAAM,UAAU,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,gBAAgB,CAAC,CAAC;AAE1D;;;;GAIG;AACH,eAAO,MAAM,mBAAmB;;;;;;;;;;kBAOrB,CAAC;AACZ,MAAM,MAAM,aAAa,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,mBAAmB,CAAC,CAAC;AAEhE;;;;GAIG;AACH,eAAO,MAAM,sBAAsB;;;;;;;;;;;;;;;;;;;kBAOxB,CAAC;AACZ,MAAM,MAAM,gBAAgB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,sBAAsB,CAAC,CAAC;AAEtE;;;;GAIG;AACH,eAAO,MAAM,yBAAyB;;;;;;;;;;;;;;kBAO3B,CAAC;AACZ,MAAM,MAAM,mBAAmB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,yBAAyB,CAAC,CAAC"}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Superficie de tipos del seam de contexto. Reexporta los tipos inferidos de
|
|
3
|
+
* los esquemas Zod para que el resto de Graph importe tipos sin acoplarse al
|
|
4
|
+
* detalle de validación, y expone el tipo `Digest` de `redaction.ts`.
|
|
5
|
+
*/
|
|
6
|
+
export type { Digest } from "./redaction";
|
|
7
|
+
export type { ArtifactManifest, ContextRef, Identifier, ManifestEntry, NodeContextContract, PrivacyClass, Sha256, TaskAnchor, } from "./schema";
|
|
8
|
+
//# sourceMappingURL=types.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../src/context/types.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,YAAY,EAAE,MAAM,EAAE,MAAM,aAAa,CAAC;AAC1C,YAAY,EACV,gBAAgB,EAChB,UAAU,EACV,UAAU,EACV,aAAa,EACb,mBAAmB,EACnB,YAAY,EACZ,MAAM,EACN,UAAU,GACX,MAAM,UAAU,CAAC"}
|