@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.
Files changed (113) hide show
  1. package/AGENTS.md +15 -0
  2. package/README.es.md +1 -1
  3. package/README.md +1 -1
  4. package/dist/cli.js +457 -37
  5. package/dist/commands/graph.d.ts +73 -0
  6. package/dist/commands/graph.d.ts.map +1 -0
  7. package/dist/config/load.d.ts.map +1 -1
  8. package/dist/config/migrations.d.ts +27 -0
  9. package/dist/config/migrations.d.ts.map +1 -0
  10. package/dist/config/resolve.d.ts +34 -0
  11. package/dist/config/resolve.d.ts.map +1 -0
  12. package/dist/config/schema.d.ts +57 -0
  13. package/dist/config/schema.d.ts.map +1 -1
  14. package/dist/console/assets.d.ts +9 -1
  15. package/dist/console/assets.d.ts.map +1 -1
  16. package/dist/console/opencodeClient.d.ts +6 -0
  17. package/dist/console/opencodeClient.d.ts.map +1 -1
  18. package/dist/console/protocol.d.ts +8 -0
  19. package/dist/console/protocol.d.ts.map +1 -1
  20. package/dist/console/render.d.ts +25 -0
  21. package/dist/console/render.d.ts.map +1 -1
  22. package/dist/context/redaction.d.ts +48 -0
  23. package/dist/context/redaction.d.ts.map +1 -0
  24. package/dist/context/schema.d.ts +115 -0
  25. package/dist/context/schema.d.ts.map +1 -0
  26. package/dist/context/types.d.ts +8 -0
  27. package/dist/context/types.d.ts.map +1 -0
  28. package/dist/graph/events.d.ts +25 -0
  29. package/dist/graph/events.d.ts.map +1 -0
  30. package/dist/graph/ids.d.ts +5 -0
  31. package/dist/graph/ids.d.ts.map +1 -0
  32. package/dist/graph/planner.d.ts +15 -0
  33. package/dist/graph/planner.d.ts.map +1 -0
  34. package/dist/graph/policies.d.ts +34 -0
  35. package/dist/graph/policies.d.ts.map +1 -0
  36. package/dist/graph/privacyPolicy.d.ts +29 -0
  37. package/dist/graph/privacyPolicy.d.ts.map +1 -0
  38. package/dist/graph/reducer.d.ts +27 -0
  39. package/dist/graph/reducer.d.ts.map +1 -0
  40. package/dist/graph/replay.d.ts +20 -0
  41. package/dist/graph/replay.d.ts.map +1 -0
  42. package/dist/graph/reviewerPolicy.d.ts +27 -0
  43. package/dist/graph/reviewerPolicy.d.ts.map +1 -0
  44. package/dist/graph/schema.d.ts +220 -0
  45. package/dist/graph/schema.d.ts.map +1 -0
  46. package/dist/graph/types.d.ts +40 -0
  47. package/dist/graph/types.d.ts.map +1 -0
  48. package/dist/graph/validate.d.ts +19 -0
  49. package/dist/graph/validate.d.ts.map +1 -0
  50. package/dist/index.js +46 -3
  51. package/dist/orchestrator/graphCancellation.d.ts +84 -0
  52. package/dist/orchestrator/graphCancellation.d.ts.map +1 -0
  53. package/dist/orchestrator/graphEffects.d.ts +63 -0
  54. package/dist/orchestrator/graphEffects.d.ts.map +1 -0
  55. package/dist/orchestrator/graphReview.d.ts +84 -0
  56. package/dist/orchestrator/graphReview.d.ts.map +1 -0
  57. package/dist/orchestrator/graphRuntime.d.ts +69 -0
  58. package/dist/orchestrator/graphRuntime.d.ts.map +1 -0
  59. package/dist/orchestrator/opencodeSessionAdapter.d.ts +117 -0
  60. package/dist/orchestrator/opencodeSessionAdapter.d.ts.map +1 -0
  61. package/dist/orchestrator/sdd.d.ts +38 -2
  62. package/dist/orchestrator/sdd.d.ts.map +1 -1
  63. package/dist/orchestrator/sddCompiler.d.ts +44 -0
  64. package/dist/orchestrator/sddCompiler.d.ts.map +1 -0
  65. package/dist/orchestrator/sessionReconciler.d.ts +74 -0
  66. package/dist/orchestrator/sessionReconciler.d.ts.map +1 -0
  67. package/dist/orchestrator/shadowComparator.d.ts +62 -0
  68. package/dist/orchestrator/shadowComparator.d.ts.map +1 -0
  69. package/dist/orchestrator/worktreeAdapter.d.ts +39 -0
  70. package/dist/orchestrator/worktreeAdapter.d.ts.map +1 -0
  71. package/dist/orchestrator/worktreeDispatch.d.ts +84 -0
  72. package/dist/orchestrator/worktreeDispatch.d.ts.map +1 -0
  73. package/dist/orchestrator/worktreeReconciler.d.ts +74 -0
  74. package/dist/orchestrator/worktreeReconciler.d.ts.map +1 -0
  75. package/dist/storage/graph/codec.d.ts +52 -0
  76. package/dist/storage/graph/codec.d.ts.map +1 -0
  77. package/dist/storage/graph/fsGraphJournal.d.ts +3 -0
  78. package/dist/storage/graph/fsGraphJournal.d.ts.map +1 -0
  79. package/dist/storage/graph/importLegacy.d.ts +62 -0
  80. package/dist/storage/graph/importLegacy.d.ts.map +1 -0
  81. package/dist/storage/graph/memoryGraphJournal.d.ts +11 -0
  82. package/dist/storage/graph/memoryGraphJournal.d.ts.map +1 -0
  83. package/dist/storage/graph/migrateLegacyBriefs.d.ts +32 -0
  84. package/dist/storage/graph/migrateLegacyBriefs.d.ts.map +1 -0
  85. package/dist/storage/graph/projections.d.ts +31 -0
  86. package/dist/storage/graph/projections.d.ts.map +1 -0
  87. package/dist/storage/graph/provider.d.ts +52 -0
  88. package/dist/storage/graph/provider.d.ts.map +1 -0
  89. package/dist/storage/graph/recovery.d.ts +38 -0
  90. package/dist/storage/graph/recovery.d.ts.map +1 -0
  91. package/dist/storage/graph/runRegistry.d.ts +17 -0
  92. package/dist/storage/graph/runRegistry.d.ts.map +1 -0
  93. package/dist/storage/graph/snapshot.d.ts +44 -0
  94. package/dist/storage/graph/snapshot.d.ts.map +1 -0
  95. package/dist/storage/graph/workspaceLease.d.ts +36 -0
  96. package/dist/storage/graph/workspaceLease.d.ts.map +1 -0
  97. package/dist/storage/graph/worktreeRegistry.d.ts +29 -0
  98. package/dist/storage/graph/worktreeRegistry.d.ts.map +1 -0
  99. package/dist/storage/graph/writer.d.ts +20 -0
  100. package/dist/storage/graph/writer.d.ts.map +1 -0
  101. package/dist/telemetry/graphProjection.d.ts +36 -0
  102. package/dist/telemetry/graphProjection.d.ts.map +1 -0
  103. package/dist/telemetry/graphView.d.ts +75 -0
  104. package/dist/telemetry/graphView.d.ts.map +1 -0
  105. package/dist/web/console.d.ts +6 -0
  106. package/dist/web/console.d.ts.map +1 -1
  107. package/dist/web/graphRoute.d.ts +36 -0
  108. package/dist/web/graphRoute.d.ts.map +1 -0
  109. package/dist/web/server.d.ts +21 -2
  110. package/dist/web/server.d.ts.map +1 -1
  111. package/dist/web/start.d.ts +11 -0
  112. package/dist/web/start.d.ts.map +1 -1
  113. package/package.json +1 -1
@@ -0,0 +1,25 @@
1
+ import type { ContextRef } from "../context/schema";
2
+ import type { ErrorClass, GraphEventType, GraphEventV1 } from "./schema";
3
+ /**
4
+ * Constructores y type guards para el sobre de eventos de Graph V1.
5
+ *
6
+ * Los constructores producen literales ya conformes al esquema (no validan;
7
+ * validar es `parseGraphEvent`). Puro: sin I/O ni estado global.
8
+ */
9
+ /** Lista exhaustiva de tipos de evento, en orden estable. */
10
+ export declare const EVENT_TYPES: readonly GraphEventType[];
11
+ export declare function runStarted(runID: string, seq: number, specDigest: string): GraphEventV1;
12
+ export declare function nodeDispatched(runID: string, seq: number, nodeID: string, operationID: string, attemptID: string): GraphEventV1;
13
+ export declare function nodeSucceeded(runID: string, seq: number, nodeID: string, operationID: string, attemptID: string, artifact: ContextRef): GraphEventV1;
14
+ export declare function nodeFailed(runID: string, seq: number, nodeID: string, operationID: string, attemptID: string, errorClass: ErrorClass): GraphEventV1;
15
+ export declare function nodeCancelled(runID: string, seq: number, nodeID: string): GraphEventV1;
16
+ export declare function runCompleted(runID: string, seq: number): GraphEventV1;
17
+ export declare function runFailed(runID: string, seq: number): GraphEventV1;
18
+ export declare function runCancelled(runID: string, seq: number): GraphEventV1;
19
+ /** Evento que afecta a un nodo concreto (lleva `nodeID`). */
20
+ export type NodeEvent = Extract<GraphEventV1, {
21
+ nodeID: string;
22
+ }>;
23
+ export declare function isNodeEvent(event: GraphEventV1): event is NodeEvent;
24
+ export declare function isRunEvent(event: GraphEventV1): boolean;
25
+ //# sourceMappingURL=events.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"events.d.ts","sourceRoot":"","sources":["../../src/graph/events.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,mBAAmB,CAAC;AACpD,OAAO,KAAK,EAAE,UAAU,EAAE,cAAc,EAAE,YAAY,EAAE,MAAM,UAAU,CAAC;AAGzE;;;;;GAKG;AAEH,6DAA6D;AAC7D,eAAO,MAAM,WAAW,EAAE,SAAS,cAAc,EAShD,CAAC;AAEF,wBAAgB,UAAU,CACxB,KAAK,EAAE,MAAM,EACb,GAAG,EAAE,MAAM,EACX,UAAU,EAAE,MAAM,GACjB,YAAY,CAQd;AAED,wBAAgB,cAAc,CAC5B,KAAK,EAAE,MAAM,EACb,GAAG,EAAE,MAAM,EACX,MAAM,EAAE,MAAM,EACd,WAAW,EAAE,MAAM,EACnB,SAAS,EAAE,MAAM,GAChB,YAAY,CAUd;AAED,wBAAgB,aAAa,CAC3B,KAAK,EAAE,MAAM,EACb,GAAG,EAAE,MAAM,EACX,MAAM,EAAE,MAAM,EACd,WAAW,EAAE,MAAM,EACnB,SAAS,EAAE,MAAM,EACjB,QAAQ,EAAE,UAAU,GACnB,YAAY,CAWd;AAED,wBAAgB,UAAU,CACxB,KAAK,EAAE,MAAM,EACb,GAAG,EAAE,MAAM,EACX,MAAM,EAAE,MAAM,EACd,WAAW,EAAE,MAAM,EACnB,SAAS,EAAE,MAAM,EACjB,UAAU,EAAE,UAAU,GACrB,YAAY,CAWd;AAED,wBAAgB,aAAa,CAC3B,KAAK,EAAE,MAAM,EACb,GAAG,EAAE,MAAM,EACX,MAAM,EAAE,MAAM,GACb,YAAY,CAEd;AAED,wBAAgB,YAAY,CAAC,KAAK,EAAE,MAAM,EAAE,GAAG,EAAE,MAAM,GAAG,YAAY,CAErE;AAED,wBAAgB,SAAS,CAAC,KAAK,EAAE,MAAM,EAAE,GAAG,EAAE,MAAM,GAAG,YAAY,CAElE;AAED,wBAAgB,YAAY,CAAC,KAAK,EAAE,MAAM,EAAE,GAAG,EAAE,MAAM,GAAG,YAAY,CAErE;AAED,6DAA6D;AAC7D,MAAM,MAAM,SAAS,GAAG,OAAO,CAAC,YAAY,EAAE;IAAE,MAAM,EAAE,MAAM,CAAA;CAAE,CAAC,CAAC;AAElE,wBAAgB,WAAW,CAAC,KAAK,EAAE,YAAY,GAAG,KAAK,IAAI,SAAS,CAOnE;AAED,wBAAgB,UAAU,CAAC,KAAK,EAAE,YAAY,GAAG,OAAO,CAEvD"}
@@ -0,0 +1,5 @@
1
+ /** ID estable del efecto de un nodo, opcionalmente por revisión. */
2
+ export declare function operationID(runID: string, nodeID: string, revision?: number): string;
3
+ /** ID del intento `attempt` (>= 0) de una operación dada. */
4
+ export declare function attemptID(operation: string, attempt: number): string;
5
+ //# sourceMappingURL=ids.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ids.d.ts","sourceRoot":"","sources":["../../src/graph/ids.ts"],"names":[],"mappings":"AAYA,oEAAoE;AACpE,wBAAgB,WAAW,CACzB,KAAK,EAAE,MAAM,EACb,MAAM,EAAE,MAAM,EACd,QAAQ,SAAI,GACX,MAAM,CAKR;AAED,6DAA6D;AAC7D,wBAAgB,SAAS,CAAC,SAAS,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,GAAG,MAAM,CAEpE"}
@@ -0,0 +1,15 @@
1
+ import type { GraphSpecV1 } from "./schema";
2
+ import type { GraphState, ReadyNode } from "./types";
3
+ /**
4
+ * Planificador determinista del conjunto listo (ready-set).
5
+ *
6
+ * Un nodo está listo si el run sigue `running`, el nodo está `pending` y todas
7
+ * sus dependencias están `succeeded`. El orden es estable (por id). La
8
+ * cancelación del run —o de una dependencia— bloquea el despacho. IDs
9
+ * reproducibles vía `ids.ts`. Puro: sin I/O, reloj ni random.
10
+ */
11
+ /** IDs de nodo listos, en orden estable. */
12
+ export declare function readyNodeIDs(spec: GraphSpecV1, state: GraphState): string[];
13
+ /** Plan de despacho: nodos listos con sus IDs deterministas de operación. */
14
+ export declare function plan(spec: GraphSpecV1, state: GraphState): ReadyNode[];
15
+ //# sourceMappingURL=planner.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"planner.d.ts","sourceRoot":"","sources":["../../src/graph/planner.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,UAAU,CAAC;AAC5C,OAAO,KAAK,EAAE,UAAU,EAAE,SAAS,EAAE,MAAM,SAAS,CAAC;AAErD;;;;;;;GAOG;AAEH,4CAA4C;AAC5C,wBAAgB,YAAY,CAAC,IAAI,EAAE,WAAW,EAAE,KAAK,EAAE,UAAU,GAAG,MAAM,EAAE,CAiB3E;AAED,6EAA6E;AAC7E,wBAAgB,IAAI,CAAC,IAAI,EAAE,WAAW,EAAE,KAAK,EAAE,UAAU,GAAG,SAAS,EAAE,CAUtE"}
@@ -0,0 +1,34 @@
1
+ import type { ErrorClass } from "./schema";
2
+ /**
3
+ * Políticas puras de transición y reintento. Deterministas: sin reloj, jitter
4
+ * oculto ni random. Incluye la taxonomía reutilizable, el límite por defecto y
5
+ * el backoff determinista (GE-033); el runtime aplica límites y expone el
6
+ * retardo sin dormir por su cuenta.
7
+ */
8
+ /** Límite de intentos por defecto para un error reintentable. */
9
+ export declare const DEFAULT_RETRY_LIMIT = 3;
10
+ /** Número de revisiones por defecto que puede encadenar un rechazo (GE-036). */
11
+ export declare const DEFAULT_REVISION_LIMIT = 2;
12
+ /**
13
+ * `true` si se permite otra revisión: `currentRevision` (revisiones ya hechas,
14
+ * 0 la implementación inicial) aún no alcanza el límite. Determinista.
15
+ */
16
+ export declare function revisionAllowed(currentRevision: number, limit?: number): boolean;
17
+ /** Base en milisegundos del backoff exponencial determinista. */
18
+ export declare const DEFAULT_BACKOFF_BASE_MS = 100;
19
+ /**
20
+ * Retardo determinista (ms) antes del intento `attempt` (índice basado en 0).
21
+ * El primer intento (`attempt <= 0`) no espera; a partir de ahí crece de forma
22
+ * exponencial (`base * 2^(attempt-1)`). Función pura: sin reloj, jitter ni
23
+ * random, de modo que la misma secuencia se reproduce tras un reinicio. El
24
+ * runtime la expone en el resultado del paso; no duerme por su cuenta.
25
+ */
26
+ export declare function backoffDelayMs(attempt: number, baseMs?: number): number;
27
+ /** `true` si la clase de error justifica un reintento con nuevo intento. */
28
+ export declare function isRetryableError(errorClass: ErrorClass): boolean;
29
+ /**
30
+ * `true` si se permite otro intento: el error es reintentable y aún no se han
31
+ * agotado los intentos. `attempts` es el número de intentos ya consumidos.
32
+ */
33
+ export declare function retryAllowed(errorClass: ErrorClass, attempts: number, limit?: number): boolean;
34
+ //# sourceMappingURL=policies.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"policies.d.ts","sourceRoot":"","sources":["../../src/graph/policies.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,UAAU,CAAC;AAE3C;;;;;GAKG;AAEH,iEAAiE;AACjE,eAAO,MAAM,mBAAmB,IAAI,CAAC;AAErC,gFAAgF;AAChF,eAAO,MAAM,sBAAsB,IAAI,CAAC;AAExC;;;GAGG;AACH,wBAAgB,eAAe,CAC7B,eAAe,EAAE,MAAM,EACvB,KAAK,GAAE,MAA+B,GACrC,OAAO,CAET;AAED,iEAAiE;AACjE,eAAO,MAAM,uBAAuB,MAAM,CAAC;AAE3C;;;;;;GAMG;AACH,wBAAgB,cAAc,CAC5B,OAAO,EAAE,MAAM,EACf,MAAM,GAAE,MAAgC,GACvC,MAAM,CAKR;AAED,4EAA4E;AAC5E,wBAAgB,gBAAgB,CAAC,UAAU,EAAE,UAAU,GAAG,OAAO,CAEhE;AAED;;;GAGG;AACH,wBAAgB,YAAY,CAC1B,UAAU,EAAE,UAAU,EACtB,QAAQ,EAAE,MAAM,EAChB,KAAK,GAAE,MAA4B,GAClC,OAAO,CAET"}
@@ -0,0 +1,29 @@
1
+ import type { PrivacyClass } from "../context/schema";
2
+ /**
3
+ * Política pura de privacidad en el despacho de efectos. Deterministas: sin
4
+ * I/O, reloj ni random. Reexporta `assertReferenceOnly` para rechazar payloads
5
+ * con contenido crudo en la frontera de despacho.
6
+ */
7
+ export { assertReferenceOnly } from "../context/redaction";
8
+ /** Modo de privacidad efectivo (coincide con `config.privacyMode`). */
9
+ export type PrivacyMode = "forceLocalOnSensitive" | "consentBeforeFrontier" | "off";
10
+ /** Destino de ruta de un efecto. */
11
+ export type RouteKind = "local" | "frontier";
12
+ /** Error tipado de una violación de privacidad en el despacho. */
13
+ export declare class PrivacyPolicyError extends Error {
14
+ readonly code: "sensitive-forced-local";
15
+ readonly detail: string;
16
+ constructor(detail: string);
17
+ }
18
+ /**
19
+ * `true` si una clase de privacidad puede planificar frontier bajo un modo. Un
20
+ * artefacto `sensitive` con `forceLocalOnSensitive` nunca puede ir a frontier.
21
+ */
22
+ export declare function frontierAllowed(privacyClass: PrivacyClass, mode: PrivacyMode): boolean;
23
+ /** Lanza si un despacho a frontier viola la política de privacidad. */
24
+ export declare function assertPrivacyDispatch(input: {
25
+ privacyClass: PrivacyClass;
26
+ mode: PrivacyMode;
27
+ routeKind: RouteKind;
28
+ }): void;
29
+ //# sourceMappingURL=privacyPolicy.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"privacyPolicy.d.ts","sourceRoot":"","sources":["../../src/graph/privacyPolicy.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,mBAAmB,CAAC;AAEtD;;;;GAIG;AAEH,OAAO,EAAE,mBAAmB,EAAE,MAAM,sBAAsB,CAAC;AAE3D,uEAAuE;AACvE,MAAM,MAAM,WAAW,GACnB,uBAAuB,GACvB,uBAAuB,GACvB,KAAK,CAAC;AAEV,oCAAoC;AACpC,MAAM,MAAM,SAAS,GAAG,OAAO,GAAG,UAAU,CAAC;AAE7C,kEAAkE;AAClE,qBAAa,kBAAmB,SAAQ,KAAK;IAC3C,QAAQ,CAAC,IAAI,EAAE,wBAAwB,CAAC;IACxC,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAC;gBAEZ,MAAM,EAAE,MAAM;CAM3B;AAED;;;GAGG;AACH,wBAAgB,eAAe,CAC7B,YAAY,EAAE,YAAY,EAC1B,IAAI,EAAE,WAAW,GAChB,OAAO,CAET;AAED,uEAAuE;AACvE,wBAAgB,qBAAqB,CAAC,KAAK,EAAE;IAC3C,YAAY,EAAE,YAAY,CAAC;IAC3B,IAAI,EAAE,WAAW,CAAC;IAClB,SAAS,EAAE,SAAS,CAAC;CACtB,GAAG,IAAI,CAOP"}
@@ -0,0 +1,27 @@
1
+ import type { GraphEventV1, GraphSpecV1 } from "./schema";
2
+ import { type GraphState } from "./types";
3
+ /**
4
+ * Reducer total y determinista de Graph V1.
5
+ *
6
+ * Aplica un evento a un estado y devuelve el nuevo estado, o lanza
7
+ * `ReducerError` cerrando en falso ante transiciones ilegales, conflictos de
8
+ * identidad o mutaciones post-terminales. Reaplicar un evento ya reflejado
9
+ * (misma operación/intento) es idempotente. Puro: sin I/O, reloj ni random.
10
+ */
11
+ export type ReducerErrorCode = "run-mismatch" | "post-terminal" | "run-started-conflict" | "unknown-node" | "dependency-not-satisfied" | "dispatch-conflict" | "receipt-conflict" | "illegal-transition" | "incomplete-run";
12
+ /** Error tipado de una transición inválida del reducer. */
13
+ export declare class ReducerError extends Error {
14
+ readonly code: ReducerErrorCode;
15
+ readonly detail: string;
16
+ constructor(code: ReducerErrorCode, detail: string);
17
+ }
18
+ /** Estado inicial: todos los nodos `pending`, run `running`, sin eventos. */
19
+ export declare function initialState(spec: GraphSpecV1): GraphState;
20
+ /**
21
+ * Aplica un evento al estado. Idempotente ante duplicados exactos; cierra en
22
+ * falso ante conflictos, transiciones ilegales o mutación post-terminal.
23
+ */
24
+ export declare function applyEvent(spec: GraphSpecV1, state: GraphState, event: GraphEventV1): GraphState;
25
+ /** Hash SHA-256 determinista del estado reducido (orden de nodos estable). */
26
+ export declare function stateHash(state: GraphState): string;
27
+ //# sourceMappingURL=reducer.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"reducer.d.ts","sourceRoot":"","sources":["../../src/graph/reducer.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,YAAY,EAAa,WAAW,EAAE,MAAM,UAAU,CAAC;AACrE,OAAO,EACL,KAAK,UAAU,EAGhB,MAAM,SAAS,CAAC;AAEjB;;;;;;;GAOG;AAEH,MAAM,MAAM,gBAAgB,GACxB,cAAc,GACd,eAAe,GACf,sBAAsB,GACtB,cAAc,GACd,0BAA0B,GAC1B,mBAAmB,GACnB,kBAAkB,GAClB,oBAAoB,GACpB,gBAAgB,CAAC;AAErB,2DAA2D;AAC3D,qBAAa,YAAa,SAAQ,KAAK;IACrC,QAAQ,CAAC,IAAI,EAAE,gBAAgB,CAAC;IAChC,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAC;gBAEZ,IAAI,EAAE,gBAAgB,EAAE,MAAM,EAAE,MAAM;CAMnD;AAED,6EAA6E;AAC7E,wBAAgB,YAAY,CAAC,IAAI,EAAE,WAAW,GAAG,UAAU,CAM1D;AAoLD;;;GAGG;AACH,wBAAgB,UAAU,CACxB,IAAI,EAAE,WAAW,EACjB,KAAK,EAAE,UAAU,EACjB,KAAK,EAAE,YAAY,GAClB,UAAU,CAkCZ;AAyBD,8EAA8E;AAC9E,wBAAgB,SAAS,CAAC,KAAK,EAAE,UAAU,GAAG,MAAM,CAEnD"}
@@ -0,0 +1,20 @@
1
+ import type { GraphEventV1, GraphSpecV1 } from "./schema";
2
+ import type { GraphState } from "./types";
3
+ /**
4
+ * Replay estricto de un journal de eventos sobre un spec.
5
+ *
6
+ * Exige secuencia contigua desde 0: cualquier hueco, reordenación o duplicado
7
+ * de `seq` cierra en falso. Los mismos bytes producen el mismo estado y el
8
+ * mismo hash. Puro: sin I/O, reloj ni random.
9
+ */
10
+ /** Error tipado de un journal con secuencia inválida. */
11
+ export declare class ReplayError extends Error {
12
+ readonly code: "sequence-gap";
13
+ readonly detail: string;
14
+ constructor(detail: string);
15
+ }
16
+ /** Reduce una secuencia estricta de eventos al estado final. */
17
+ export declare function replay(spec: GraphSpecV1, events: readonly GraphEventV1[]): GraphState;
18
+ /** Hash determinista del estado resultante del replay. */
19
+ export declare function replayHash(spec: GraphSpecV1, events: readonly GraphEventV1[]): string;
20
+ //# sourceMappingURL=replay.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"replay.d.ts","sourceRoot":"","sources":["../../src/graph/replay.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,YAAY,EAAE,WAAW,EAAE,MAAM,UAAU,CAAC;AAC1D,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,SAAS,CAAC;AAE1C;;;;;;GAMG;AAEH,yDAAyD;AACzD,qBAAa,WAAY,SAAQ,KAAK;IACpC,QAAQ,CAAC,IAAI,EAAE,cAAc,CAAC;IAC9B,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAC;gBAEZ,MAAM,EAAE,MAAM;CAM3B;AAED,gEAAgE;AAChE,wBAAgB,MAAM,CACpB,IAAI,EAAE,WAAW,EACjB,MAAM,EAAE,SAAS,YAAY,EAAE,GAC9B,UAAU,CASZ;AAED,0DAA0D;AAC1D,wBAAgB,UAAU,CACxB,IAAI,EAAE,WAAW,EACjB,MAAM,EAAE,SAAS,YAAY,EAAE,GAC9B,MAAM,CAER"}
@@ -0,0 +1,27 @@
1
+ import type { GraphSpecV1 } from "./schema";
2
+ import type { Capability } from "./types";
3
+ /**
4
+ * Políticas puras de reviewer: independencia autor/reviewer y lockout de
5
+ * capacidades. Deterministas: sin I/O, reloj ni random.
6
+ */
7
+ /** Capacidades que un reviewer puede planificar (solo lectura). */
8
+ export declare const REVIEWER_ALLOWED_CAPABILITIES: readonly Capability[];
9
+ export type ReviewerPolicyCode = "self-review" | "reviewer-capability" | "unassigned";
10
+ /** Error tipado de una violación de política de reviewer. */
11
+ export declare class ReviewerPolicyError extends Error {
12
+ readonly code: ReviewerPolicyCode;
13
+ readonly detail: string;
14
+ constructor(code: ReviewerPolicyCode, detail: string);
15
+ }
16
+ /** `true` si el reviewer no es el autor del artefacto que revisa. */
17
+ export declare function reviewerCanReview(authorID: string, reviewerID: string): boolean;
18
+ /** Lanza si autor y reviewer coinciden (self-review). */
19
+ export declare function assertReviewerIndependence(authorID: string, reviewerID: string): void;
20
+ /** Lanza si el reviewer planifica cualquier capacidad mutante. */
21
+ export declare function assertReviewerCapabilities(planned: readonly Capability[]): void;
22
+ /**
23
+ * Valida las asignaciones autor/reviewer del spec: cada reviewer debe estar
24
+ * asignado a alguien distinto del autor del nodo que revisa.
25
+ */
26
+ export declare function assertReviewAssignments(spec: GraphSpecV1, assignments: Readonly<Record<string, string>>): void;
27
+ //# sourceMappingURL=reviewerPolicy.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"reviewerPolicy.d.ts","sourceRoot":"","sources":["../../src/graph/reviewerPolicy.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,UAAU,CAAC;AAC5C,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,SAAS,CAAC;AAE1C;;;GAGG;AAEH,mEAAmE;AACnE,eAAO,MAAM,6BAA6B,EAAE,SAAS,UAAU,EAAa,CAAC;AAE7E,MAAM,MAAM,kBAAkB,GAC1B,aAAa,GACb,qBAAqB,GACrB,YAAY,CAAC;AAEjB,6DAA6D;AAC7D,qBAAa,mBAAoB,SAAQ,KAAK;IAC5C,QAAQ,CAAC,IAAI,EAAE,kBAAkB,CAAC;IAClC,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAC;gBAEZ,IAAI,EAAE,kBAAkB,EAAE,MAAM,EAAE,MAAM;CAMrD;AAED,qEAAqE;AACrE,wBAAgB,iBAAiB,CAC/B,QAAQ,EAAE,MAAM,EAChB,UAAU,EAAE,MAAM,GACjB,OAAO,CAET;AAED,yDAAyD;AACzD,wBAAgB,0BAA0B,CACxC,QAAQ,EAAE,MAAM,EAChB,UAAU,EAAE,MAAM,GACjB,IAAI,CAIN;AAED,kEAAkE;AAClE,wBAAgB,0BAA0B,CACxC,OAAO,EAAE,SAAS,UAAU,EAAE,GAC7B,IAAI,CAMN;AAED;;;GAGG;AACH,wBAAgB,uBAAuB,CACrC,IAAI,EAAE,WAAW,EACjB,WAAW,EAAE,QAAQ,CAAC,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC,GAC5C,IAAI,CAYN"}
@@ -0,0 +1,220 @@
1
+ import { z } from "zod";
2
+ /**
3
+ * Esquemas Zod versionados de Graph V1: spec estático, nodos, roles y el sobre
4
+ * de eventos como unión discriminada exhaustiva.
5
+ *
6
+ * Superficie de validación pura: sin I/O, SDK, storage, router, telemetría,
7
+ * reloj, random ni env. `.strict()` en todos los objetos rechaza campos
8
+ * desconocidos —incluidos campos de contenido crudo— con un error tipado.
9
+ */
10
+ export declare const GRAPH_SPEC_VERSION: 1;
11
+ export declare const GRAPH_EVENT_VERSION: 1;
12
+ /** Identificador de nodo/run: charset acotado y path-safe, determinista. */
13
+ export declare const NodeIDSchema: z.ZodString;
14
+ export type NodeID = z.infer<typeof NodeIDSchema>;
15
+ /** Rol de un nodo: quién ejecuta el efecto. */
16
+ export declare const NodeRoleSchema: z.ZodEnum<{
17
+ implementer: "implementer";
18
+ reviewer: "reviewer";
19
+ }>;
20
+ export type NodeRole = z.infer<typeof NodeRoleSchema>;
21
+ /** ID de operación/intento: hex derivado de forma determinista (`ids.ts`). */
22
+ export declare const OperationIDSchema: z.ZodString;
23
+ export declare const AttemptIDSchema: z.ZodString;
24
+ /** Taxonomía acotada de clases de error de un efecto. */
25
+ export declare const ErrorClassSchema: z.ZodEnum<{
26
+ unknown: "unknown";
27
+ transient: "transient";
28
+ permanent: "permanent";
29
+ timeout: "timeout";
30
+ cancelled: "cancelled";
31
+ }>;
32
+ export type ErrorClass = z.infer<typeof ErrorClassSchema>;
33
+ /**
34
+ * Nodo del grafo. Un `reviewer` referencia con `reviews` el nodo cuyo artefacto
35
+ * revisa; un `implementer` nunca lleva `reviews`.
36
+ */
37
+ export declare const GraphNodeSchema: z.ZodObject<{
38
+ id: z.ZodString;
39
+ role: z.ZodEnum<{
40
+ implementer: "implementer";
41
+ reviewer: "reviewer";
42
+ }>;
43
+ dependsOn: z.ZodDefault<z.ZodArray<z.ZodString>>;
44
+ anchor: z.ZodObject<{
45
+ taskID: z.ZodString;
46
+ specDigest: z.ZodString;
47
+ }, z.core.$strict>;
48
+ reviews: z.ZodOptional<z.ZodString>;
49
+ }, z.core.$strict>;
50
+ export type GraphNode = z.infer<typeof GraphNodeSchema>;
51
+ /** Spec estático versionado de un run: un DAG con al menos un nodo. */
52
+ export declare const GraphSpecV1Schema: z.ZodObject<{
53
+ version: z.ZodLiteral<1>;
54
+ runID: z.ZodString;
55
+ nodes: z.ZodArray<z.ZodObject<{
56
+ id: z.ZodString;
57
+ role: z.ZodEnum<{
58
+ implementer: "implementer";
59
+ reviewer: "reviewer";
60
+ }>;
61
+ dependsOn: z.ZodDefault<z.ZodArray<z.ZodString>>;
62
+ anchor: z.ZodObject<{
63
+ taskID: z.ZodString;
64
+ specDigest: z.ZodString;
65
+ }, z.core.$strict>;
66
+ reviews: z.ZodOptional<z.ZodString>;
67
+ }, z.core.$strict>>;
68
+ }, z.core.$strict>;
69
+ export type GraphSpecV1 = z.infer<typeof GraphSpecV1Schema>;
70
+ export declare const RunStartedEventSchema: z.ZodObject<{
71
+ type: z.ZodLiteral<"run.started">;
72
+ specDigest: z.ZodString;
73
+ v: z.ZodLiteral<1>;
74
+ seq: z.ZodNumber;
75
+ runID: z.ZodString;
76
+ }, z.core.$strict>;
77
+ export declare const NodeDispatchedEventSchema: z.ZodObject<{
78
+ type: z.ZodLiteral<"node.dispatched">;
79
+ nodeID: z.ZodString;
80
+ operationID: z.ZodString;
81
+ attemptID: z.ZodString;
82
+ v: z.ZodLiteral<1>;
83
+ seq: z.ZodNumber;
84
+ runID: z.ZodString;
85
+ }, z.core.$strict>;
86
+ export declare const NodeSucceededEventSchema: z.ZodObject<{
87
+ type: z.ZodLiteral<"node.succeeded">;
88
+ nodeID: z.ZodString;
89
+ operationID: z.ZodString;
90
+ attemptID: z.ZodString;
91
+ artifact: z.ZodObject<{
92
+ uri: z.ZodString;
93
+ sha256: z.ZodString;
94
+ bytes: z.ZodNumber;
95
+ mediaType: z.ZodOptional<z.ZodString>;
96
+ }, z.core.$strict>;
97
+ v: z.ZodLiteral<1>;
98
+ seq: z.ZodNumber;
99
+ runID: z.ZodString;
100
+ }, z.core.$strict>;
101
+ export declare const NodeFailedEventSchema: z.ZodObject<{
102
+ type: z.ZodLiteral<"node.failed">;
103
+ nodeID: z.ZodString;
104
+ operationID: z.ZodString;
105
+ attemptID: z.ZodString;
106
+ errorClass: z.ZodEnum<{
107
+ unknown: "unknown";
108
+ transient: "transient";
109
+ permanent: "permanent";
110
+ timeout: "timeout";
111
+ cancelled: "cancelled";
112
+ }>;
113
+ v: z.ZodLiteral<1>;
114
+ seq: z.ZodNumber;
115
+ runID: z.ZodString;
116
+ }, z.core.$strict>;
117
+ export declare const NodeCancelledEventSchema: z.ZodObject<{
118
+ type: z.ZodLiteral<"node.cancelled">;
119
+ nodeID: z.ZodString;
120
+ v: z.ZodLiteral<1>;
121
+ seq: z.ZodNumber;
122
+ runID: z.ZodString;
123
+ }, z.core.$strict>;
124
+ export declare const RunCompletedEventSchema: z.ZodObject<{
125
+ type: z.ZodLiteral<"run.completed">;
126
+ v: z.ZodLiteral<1>;
127
+ seq: z.ZodNumber;
128
+ runID: z.ZodString;
129
+ }, z.core.$strict>;
130
+ export declare const RunFailedEventSchema: z.ZodObject<{
131
+ type: z.ZodLiteral<"run.failed">;
132
+ v: z.ZodLiteral<1>;
133
+ seq: z.ZodNumber;
134
+ runID: z.ZodString;
135
+ }, z.core.$strict>;
136
+ export declare const RunCancelledEventSchema: z.ZodObject<{
137
+ type: z.ZodLiteral<"run.cancelled">;
138
+ v: z.ZodLiteral<1>;
139
+ seq: z.ZodNumber;
140
+ runID: z.ZodString;
141
+ }, z.core.$strict>;
142
+ /** Unión discriminada exhaustiva de los eventos de Graph V1. */
143
+ export declare const GraphEventV1Schema: z.ZodDiscriminatedUnion<[z.ZodObject<{
144
+ type: z.ZodLiteral<"run.started">;
145
+ specDigest: z.ZodString;
146
+ v: z.ZodLiteral<1>;
147
+ seq: z.ZodNumber;
148
+ runID: z.ZodString;
149
+ }, z.core.$strict>, z.ZodObject<{
150
+ type: z.ZodLiteral<"node.dispatched">;
151
+ nodeID: z.ZodString;
152
+ operationID: z.ZodString;
153
+ attemptID: z.ZodString;
154
+ v: z.ZodLiteral<1>;
155
+ seq: z.ZodNumber;
156
+ runID: z.ZodString;
157
+ }, z.core.$strict>, z.ZodObject<{
158
+ type: z.ZodLiteral<"node.succeeded">;
159
+ nodeID: z.ZodString;
160
+ operationID: z.ZodString;
161
+ attemptID: z.ZodString;
162
+ artifact: z.ZodObject<{
163
+ uri: z.ZodString;
164
+ sha256: z.ZodString;
165
+ bytes: z.ZodNumber;
166
+ mediaType: z.ZodOptional<z.ZodString>;
167
+ }, z.core.$strict>;
168
+ v: z.ZodLiteral<1>;
169
+ seq: z.ZodNumber;
170
+ runID: z.ZodString;
171
+ }, z.core.$strict>, z.ZodObject<{
172
+ type: z.ZodLiteral<"node.failed">;
173
+ nodeID: z.ZodString;
174
+ operationID: z.ZodString;
175
+ attemptID: z.ZodString;
176
+ errorClass: z.ZodEnum<{
177
+ unknown: "unknown";
178
+ transient: "transient";
179
+ permanent: "permanent";
180
+ timeout: "timeout";
181
+ cancelled: "cancelled";
182
+ }>;
183
+ v: z.ZodLiteral<1>;
184
+ seq: z.ZodNumber;
185
+ runID: z.ZodString;
186
+ }, z.core.$strict>, z.ZodObject<{
187
+ type: z.ZodLiteral<"node.cancelled">;
188
+ nodeID: z.ZodString;
189
+ v: z.ZodLiteral<1>;
190
+ seq: z.ZodNumber;
191
+ runID: z.ZodString;
192
+ }, z.core.$strict>, z.ZodObject<{
193
+ type: z.ZodLiteral<"run.completed">;
194
+ v: z.ZodLiteral<1>;
195
+ seq: z.ZodNumber;
196
+ runID: z.ZodString;
197
+ }, z.core.$strict>, z.ZodObject<{
198
+ type: z.ZodLiteral<"run.failed">;
199
+ v: z.ZodLiteral<1>;
200
+ seq: z.ZodNumber;
201
+ runID: z.ZodString;
202
+ }, z.core.$strict>, z.ZodObject<{
203
+ type: z.ZodLiteral<"run.cancelled">;
204
+ v: z.ZodLiteral<1>;
205
+ seq: z.ZodNumber;
206
+ runID: z.ZodString;
207
+ }, z.core.$strict>], "type">;
208
+ export type GraphEventV1 = z.infer<typeof GraphEventV1Schema>;
209
+ export type GraphEventType = GraphEventV1["type"];
210
+ /** Error tipado de validación de esquema Graph. */
211
+ export declare class GraphSchemaError extends Error {
212
+ readonly code: "invalid-spec" | "invalid-event";
213
+ readonly issues: string[];
214
+ constructor(code: "invalid-spec" | "invalid-event", error: z.ZodError);
215
+ }
216
+ /** Parsea un spec, lanzando `GraphSchemaError` con `code="invalid-spec"`. */
217
+ export declare function parseGraphSpec(input: unknown): GraphSpecV1;
218
+ /** Parsea un evento, lanzando `GraphSchemaError` con `code="invalid-event"`. */
219
+ export declare function parseGraphEvent(input: unknown): GraphEventV1;
220
+ //# sourceMappingURL=schema.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"schema.d.ts","sourceRoot":"","sources":["../../src/graph/schema.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAQxB;;;;;;;GAOG;AAEH,eAAO,MAAM,kBAAkB,EAAG,CAAU,CAAC;AAC7C,eAAO,MAAM,mBAAmB,EAAG,CAAU,CAAC;AAE9C,4EAA4E;AAC5E,eAAO,MAAM,YAAY,aAIkC,CAAC;AAC5D,MAAM,MAAM,MAAM,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,YAAY,CAAC,CAAC;AAElD,+CAA+C;AAC/C,eAAO,MAAM,cAAc;;;EAAsC,CAAC;AAClE,MAAM,MAAM,QAAQ,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,cAAc,CAAC,CAAC;AAEtD,8EAA8E;AAC9E,eAAO,MAAM,iBAAiB,aAEsB,CAAC;AACrD,eAAO,MAAM,eAAe,aAEsB,CAAC;AAEnD,yDAAyD;AACzD,eAAO,MAAM,gBAAgB;;;;;;EAM3B,CAAC;AACH,MAAM,MAAM,UAAU,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,gBAAgB,CAAC,CAAC;AAE1D;;;GAGG;AACH,eAAO,MAAM,eAAe;;;;;;;;;;;;kBAQjB,CAAC;AACZ,MAAM,MAAM,SAAS,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,eAAe,CAAC,CAAC;AAExD,uEAAuE;AACvE,eAAO,MAAM,iBAAiB;;;;;;;;;;;;;;;;kBAMnB,CAAC;AACZ,MAAM,MAAM,WAAW,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,iBAAiB,CAAC,CAAC;AAQ5D,eAAO,MAAM,qBAAqB;;;;;;kBAMvB,CAAC;AAEZ,eAAO,MAAM,yBAAyB;;;;;;;;kBAQ3B,CAAC;AAEZ,eAAO,MAAM,wBAAwB;;;;;;;;;;;;;;kBAS1B,CAAC;AAEZ,eAAO,MAAM,qBAAqB;;;;;;;;;;;;;;;kBASvB,CAAC;AAEZ,eAAO,MAAM,wBAAwB;;;;;;kBAM1B,CAAC;AAEZ,eAAO,MAAM,uBAAuB;;;;;kBAEzB,CAAC;AAEZ,eAAO,MAAM,oBAAoB;;;;;kBAEtB,CAAC;AAEZ,eAAO,MAAM,uBAAuB;;;;;kBAEzB,CAAC;AAEZ,gEAAgE;AAChE,eAAO,MAAM,kBAAkB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;4BAS7B,CAAC;AACH,MAAM,MAAM,YAAY,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,kBAAkB,CAAC,CAAC;AAC9D,MAAM,MAAM,cAAc,GAAG,YAAY,CAAC,MAAM,CAAC,CAAC;AAElD,mDAAmD;AACnD,qBAAa,gBAAiB,SAAQ,KAAK;IACzC,QAAQ,CAAC,IAAI,EAAE,cAAc,GAAG,eAAe,CAAC;IAChD,QAAQ,CAAC,MAAM,EAAE,MAAM,EAAE,CAAC;gBAEd,IAAI,EAAE,cAAc,GAAG,eAAe,EAAE,KAAK,EAAE,CAAC,CAAC,QAAQ;CAMtE;AAED,6EAA6E;AAC7E,wBAAgB,cAAc,CAAC,KAAK,EAAE,OAAO,GAAG,WAAW,CAM1D;AAED,gFAAgF;AAChF,wBAAgB,eAAe,CAAC,KAAK,EAAE,OAAO,GAAG,YAAY,CAM5D"}
@@ -0,0 +1,40 @@
1
+ import type { ErrorClass, GraphEventType, GraphEventV1, GraphNode, GraphSpecV1, NodeID, NodeRole } from "./schema";
2
+ /**
3
+ * Tipos internos computados de Graph V1: estados de nodo/run, estado reducido y
4
+ * capacidades. No se parsean de entrada externa (los construye el reducer), por
5
+ * eso viven fuera de los esquemas Zod. Puro: sin I/O ni estado global.
6
+ */
7
+ /** Estado persistente de un nodo. `pending` es el estado inicial. */
8
+ export type NodeStatus = "pending" | "running" | "succeeded" | "failed" | "cancelled";
9
+ /** Estado del run completo. */
10
+ export type RunStatus = "running" | "completed" | "failed" | "cancelled";
11
+ /** Estados terminales (no admiten más transiciones). */
12
+ export declare const TERMINAL_NODE_STATUSES: ReadonlySet<NodeStatus>;
13
+ export declare const TERMINAL_RUN_STATUSES: ReadonlySet<RunStatus>;
14
+ /** Estado runtime de un nodo dentro del estado reducido. */
15
+ export type NodeRuntimeState = {
16
+ status: NodeStatus;
17
+ attempts: number;
18
+ operationID?: string;
19
+ attemptID?: string;
20
+ artifactSha256?: string;
21
+ };
22
+ /** Estado reducido y determinista de un run. */
23
+ export type GraphState = {
24
+ runID: string;
25
+ status: RunStatus;
26
+ /** Seq del último evento aplicado; -1 antes de `run.started`. */
27
+ seq: number;
28
+ specDigest?: string;
29
+ nodes: Record<string, NodeRuntimeState>;
30
+ };
31
+ /** Capacidad que un efecto puede planificar. */
32
+ export type Capability = "read" | "edit" | "shell" | "network" | "destructive";
33
+ /** Nodo listo para despacho, con sus IDs deterministas ya calculados. */
34
+ export type ReadyNode = {
35
+ nodeID: NodeID;
36
+ operationID: string;
37
+ attemptID: string;
38
+ };
39
+ export type { ErrorClass, GraphEventType, GraphEventV1, GraphNode, GraphSpecV1, NodeID, NodeRole, };
40
+ //# sourceMappingURL=types.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../src/graph/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,UAAU,EACV,cAAc,EACd,YAAY,EACZ,SAAS,EACT,WAAW,EACX,MAAM,EACN,QAAQ,EACT,MAAM,UAAU,CAAC;AAElB;;;;GAIG;AAEH,qEAAqE;AACrE,MAAM,MAAM,UAAU,GAClB,SAAS,GACT,SAAS,GACT,WAAW,GACX,QAAQ,GACR,WAAW,CAAC;AAEhB,+BAA+B;AAC/B,MAAM,MAAM,SAAS,GAAG,SAAS,GAAG,WAAW,GAAG,QAAQ,GAAG,WAAW,CAAC;AAEzE,wDAAwD;AACxD,eAAO,MAAM,sBAAsB,EAAE,WAAW,CAAC,UAAU,CAGzD,CAAC;AACH,eAAO,MAAM,qBAAqB,EAAE,WAAW,CAAC,SAAS,CAIvD,CAAC;AAEH,4DAA4D;AAC5D,MAAM,MAAM,gBAAgB,GAAG;IAC7B,MAAM,EAAE,UAAU,CAAC;IACnB,QAAQ,EAAE,MAAM,CAAC;IACjB,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,cAAc,CAAC,EAAE,MAAM,CAAC;CACzB,CAAC;AAEF,gDAAgD;AAChD,MAAM,MAAM,UAAU,GAAG;IACvB,KAAK,EAAE,MAAM,CAAC;IACd,MAAM,EAAE,SAAS,CAAC;IAClB,iEAAiE;IACjE,GAAG,EAAE,MAAM,CAAC;IACZ,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,KAAK,EAAE,MAAM,CAAC,MAAM,EAAE,gBAAgB,CAAC,CAAC;CACzC,CAAC;AAEF,gDAAgD;AAChD,MAAM,MAAM,UAAU,GAAG,MAAM,GAAG,MAAM,GAAG,OAAO,GAAG,SAAS,GAAG,aAAa,CAAC;AAE/E,yEAAyE;AACzE,MAAM,MAAM,SAAS,GAAG;IACtB,MAAM,EAAE,MAAM,CAAC;IACf,WAAW,EAAE,MAAM,CAAC;IACpB,SAAS,EAAE,MAAM,CAAC;CACnB,CAAC;AAEF,YAAY,EACV,UAAU,EACV,cAAc,EACd,YAAY,EACZ,SAAS,EACT,WAAW,EACX,MAAM,EACN,QAAQ,GACT,CAAC"}
@@ -0,0 +1,19 @@
1
+ import type { GraphSpecV1 } from "./schema";
2
+ /**
3
+ * Validación estructural pura de un `GraphSpecV1` ya conforme al esquema.
4
+ * Detecta de forma **determinista** duplicados, dependencias colgantes, ciclos,
5
+ * violaciones de rol/review y grafos desconectados. Sin I/O ni estado global.
6
+ */
7
+ export type GraphValidationCode = "duplicate-node" | "missing-dependency" | "cycle" | "implementer-has-review" | "reviewer-missing-review" | "self-review" | "invalid-review-target" | "disconnected";
8
+ /** Error tipado de validación estructural. */
9
+ export declare class GraphValidationError extends Error {
10
+ readonly code: GraphValidationCode;
11
+ readonly detail: string;
12
+ constructor(code: GraphValidationCode, detail: string);
13
+ }
14
+ /**
15
+ * Valida la estructura del DAG. Lanza `GraphValidationError` en el primer fallo,
16
+ * en orden determinista. No devuelve nada si el spec es válido.
17
+ */
18
+ export declare function validateGraphSpec(spec: GraphSpecV1): void;
19
+ //# sourceMappingURL=validate.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"validate.d.ts","sourceRoot":"","sources":["../../src/graph/validate.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAa,WAAW,EAAE,MAAM,UAAU,CAAC;AAEvD;;;;GAIG;AAEH,MAAM,MAAM,mBAAmB,GAC3B,gBAAgB,GAChB,oBAAoB,GACpB,OAAO,GACP,wBAAwB,GACxB,yBAAyB,GACzB,aAAa,GACb,uBAAuB,GACvB,cAAc,CAAC;AAEnB,8CAA8C;AAC9C,qBAAa,oBAAqB,SAAQ,KAAK;IAC7C,QAAQ,CAAC,IAAI,EAAE,mBAAmB,CAAC;IACnC,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAC;gBAEZ,IAAI,EAAE,mBAAmB,EAAE,MAAM,EAAE,MAAM;CAMtD;AAqHD;;;GAGG;AACH,wBAAgB,iBAAiB,CAAC,IAAI,EAAE,WAAW,GAAG,IAAI,CAMzD"}
package/dist/index.js CHANGED
@@ -336,6 +336,14 @@ var PrivacyModeSchema = z.enum([
336
336
  "off"
337
337
  ]);
338
338
  var BaselineModeSchema = z.enum(["auto", "pinned"]);
339
+ var GraphModeSchema = z.enum(["off", "shadow", "active"]);
340
+ var GraphConfigSchema = z.object({
341
+ mode: GraphModeSchema.default("off"),
342
+ killSwitch: z.boolean().default(false),
343
+ worktrees: z.object({
344
+ enabled: z.boolean().default(false)
345
+ }).default({ enabled: false })
346
+ });
339
347
  var ConsoleHostSchema = z.enum(["127.0.0.1", "localhost"]);
340
348
  var ConsoleConfigSchema = z.object({
341
349
  host: ConsoleHostSchema.default("127.0.0.1"),
@@ -348,7 +356,10 @@ var ConsoleConfigSchema = z.object({
348
356
  terminal: z.object({
349
357
  enabled: z.boolean().default(true),
350
358
  pty: z.boolean().optional()
351
- }).default({ enabled: true })
359
+ }).default({ enabled: true }),
360
+ graphView: z.object({
361
+ enabled: z.boolean().default(false)
362
+ }).optional()
352
363
  }).default({
353
364
  host: "127.0.0.1",
354
365
  port: 4599,
@@ -477,7 +488,8 @@ var OpenTeamConfigObjectSchema = z.object({
477
488
  privacyMode: PrivacyModeSchema.default("forceLocalOnSensitive"),
478
489
  console: ConsoleConfigSchema,
479
490
  storage: StorageConfigSchema,
480
- memory: MemoryConfigSchema.optional()
491
+ memory: MemoryConfigSchema.optional(),
492
+ graph: GraphConfigSchema.optional()
481
493
  });
482
494
  var OpenTeamConfigSchema = OpenTeamConfigObjectSchema;
483
495
  function resolveMemorySemantic(config) {
@@ -498,9 +510,40 @@ async function writeOpenTeamConfigFile(config, path = DEFAULT_CONFIG_PATH, stora
498
510
  // src/commands/setup.ts
499
511
  var OPENCODE_CONFIG_PATH = "opencode.json";
500
512
 
513
+ // src/config/migrations.ts
514
+ var CURRENT_CONFIG_VERSION = 1;
515
+
516
+ class ConfigMigrationError extends Error {
517
+ code;
518
+ detail;
519
+ constructor(code, detail) {
520
+ super(`${code}: ${detail}`);
521
+ this.name = "ConfigMigrationError";
522
+ this.code = code;
523
+ this.detail = detail;
524
+ }
525
+ }
526
+ function migrateConfig(raw) {
527
+ if (typeof raw !== "object" || raw === null) {
528
+ return raw;
529
+ }
530
+ const record = raw;
531
+ const version = record.configVersion;
532
+ if (version === undefined) {
533
+ return { ...record, configVersion: CURRENT_CONFIG_VERSION };
534
+ }
535
+ if (typeof version !== "number" || !Number.isInteger(version) || version < 1) {
536
+ throw new ConfigMigrationError("unknown-version", String(version));
537
+ }
538
+ if (version > CURRENT_CONFIG_VERSION) {
539
+ throw new ConfigMigrationError("unsupported-version", String(version));
540
+ }
541
+ return record;
542
+ }
543
+
501
544
  // src/config/load.ts
502
545
  function loadOpenTeamConfig(raw) {
503
- return OpenTeamConfigSchema.parse(raw ?? {});
546
+ return OpenTeamConfigSchema.parse(migrateConfig(raw ?? {}));
504
547
  }
505
548
 
506
549
  // src/local/openai-compatible.ts