@jmanuelcorral/openteam 0.2.0 → 0.2.2

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 (42) hide show
  1. package/README.es.md +5 -5
  2. package/README.md +5 -5
  3. package/dist/cli/consoleServe.d.ts +9 -0
  4. package/dist/cli/consoleServe.d.ts.map +1 -1
  5. package/dist/cli/graphViewProvider.d.ts +30 -0
  6. package/dist/cli/graphViewProvider.d.ts.map +1 -0
  7. package/dist/cli.js +1271 -240
  8. package/dist/commands/dispatch.d.ts +1 -0
  9. package/dist/commands/dispatch.d.ts.map +1 -1
  10. package/dist/commands/orchestratorAgent.d.ts.map +1 -1
  11. package/dist/config/graphFeatureGate.d.ts +8 -3
  12. package/dist/config/graphFeatureGate.d.ts.map +1 -1
  13. package/dist/config/schema.d.ts +5 -0
  14. package/dist/config/schema.d.ts.map +1 -1
  15. package/dist/context/redaction.d.ts +8 -0
  16. package/dist/context/redaction.d.ts.map +1 -1
  17. package/dist/graph/certificate.d.ts +12 -2
  18. package/dist/graph/certificate.d.ts.map +1 -1
  19. package/dist/graph/soakLedger.d.ts +25 -2
  20. package/dist/graph/soakLedger.d.ts.map +1 -1
  21. package/dist/index.d.ts +11 -5
  22. package/dist/index.d.ts.map +1 -1
  23. package/dist/index.js +3028 -1678
  24. package/dist/orchestrator/coordinator.d.ts +37 -2
  25. package/dist/orchestrator/coordinator.d.ts.map +1 -1
  26. package/dist/orchestrator/graphIngress.d.ts +1 -1
  27. package/dist/orchestrator/graphIngress.d.ts.map +1 -1
  28. package/dist/orchestrator/ledger.d.ts +11 -42
  29. package/dist/orchestrator/ledger.d.ts.map +1 -1
  30. package/dist/orchestrator/sddCompiler.d.ts +25 -1
  31. package/dist/orchestrator/sddCompiler.d.ts.map +1 -1
  32. package/dist/plugin/orchestrateTool.d.ts +197 -0
  33. package/dist/plugin/orchestrateTool.d.ts.map +1 -0
  34. package/dist/telemetry/events.d.ts +37 -0
  35. package/dist/telemetry/events.d.ts.map +1 -1
  36. package/dist/version.d.ts +3 -0
  37. package/dist/version.d.ts.map +1 -0
  38. package/package.json +1 -1
  39. package/dist/orchestrator/sdd.d.ts +0 -180
  40. package/dist/orchestrator/sdd.d.ts.map +0 -1
  41. package/dist/storage/graph/migrateLegacyBriefs.d.ts +0 -32
  42. package/dist/storage/graph/migrateLegacyBriefs.d.ts.map +0 -1
@@ -1,180 +0,0 @@
1
- import type { OpenTeamConfig } from "../config/schema";
2
- import { type ArtifactManifest, type ContextRef, type PrivacyClass } from "../context/schema";
3
- import type { TaskSignals } from "../router/types";
4
- import type { StorageProvider } from "../storage/provider";
5
- import { type CoordinatorDeps, type RoleTaskResult } from "./coordinator";
6
- /**
7
- * Operator-facing deprecation notice for legacy SDD authority.
8
- *
9
- * Legacy authority means using `progress.md` as the authoritative ledger for
10
- * task completion in the SDD loop (`runSddTask` / `runSddPlan`). The ability
11
- * to **import** an existing `progress.md` into graph authority is NOT
12
- * deprecated and will remain available after v1.0.0.
13
- *
14
- * **Reachability note (2026-08-23):** As of this date, neither `runSddTask`
15
- * nor `runSddPlan` has a production caller — the two entry points
16
- * (`src/index.ts`, `src/cli.ts`) do not import them. No operator will see
17
- * this warning today. The warning exists as defence-in-depth: if a future
18
- * change wires the SDD loop back into a production path, reachability and
19
- * operator notification arrive together. An invariant test in
20
- * `tests/orchestrator/sdd-unreachability.test.ts` enforces this.
21
- */
22
- export declare const LEGACY_AUTHORITY_DEPRECATION_WARNING: string;
23
- /**
24
- * Emits the deprecation warning once per process when legacy SDD authority is
25
- * exercised. The `warn` callback defaults to `console.warn`; tests inject a
26
- * spy to verify the seam reaches the operator channel.
27
- *
28
- * Currently no production code path calls this function — it is defence-in-
29
- * depth so that if `runSddTask` / `runSddPlan` are wired back into a
30
- * production caller, the operator is immediately notified of the deprecation.
31
- *
32
- * @returns `true` if the warning was emitted on this call, `false` if it was
33
- * already emitted in a prior call (once-only guard).
34
- */
35
- export declare function emitLegacyAuthorityWarning(warn?: (message: string) => void): boolean;
36
- /**
37
- * Resets the once-only deprecation state. **Test-only** — production code must
38
- * never call this; the flag is per-process by design.
39
- */
40
- export declare function _resetLegacyAuthorityWarning(): void;
41
- /**
42
- * Loop de **subagent-driven-development** (SDD), adaptado de obra/superpowers al
43
- * boundary de openteam. Por cada tarea:
44
- *
45
- * 1. Reanuda desde el ledger: si la tarea ya está `complete`, la salta.
46
- * 2. Persiste un **manifiesto redactado** de inputs del brief (referencia +
47
- * digest, nunca el brief crudo) y entrega el brief íntegro al implementer
48
- * **en memoria** vía el prompt (higiene de contexto: el implementer recibe
49
- * solo su tarea, no el historial acumulado).
50
- * 3. Despacha el **implementer** con el brief.
51
- * 4. Despacha el **reviewer** (rol con alto code-quality) para revisar el
52
- * cambio; la generación del diff vive en el propio agente reviewer.
53
- * 5. Si el veredicto pide arreglos, despacha **UN** fix subagent con TODOS los
54
- * findings (no uno por finding), con un número de rondas acotado.
55
- * 6. Escribe el resultado en el ledger durable.
56
- *
57
- * Es una capa de orquestación **inyectable y determinista**: cliente opencode,
58
- * storage, reloj, generadores de id y el intérprete de review se inyectan, así
59
- * que se prueba con fakes/memory provider. No hace I/O de git ni shell: los
60
- * artefactos persistidos son metadatos **redactados** (nunca prompts ni la
61
- * respuesta cruda del modelo).
62
- */
63
- /** Directorio de artefactos del loop SDD (estado derivado). */
64
- export declare const DEFAULT_SDD_WORKSPACE_DIR = ".opencode/openteam/sdd";
65
- /** Rol reviewer por defecto. */
66
- export declare const DEFAULT_REVIEWER_ROLE_ID = "reviewer";
67
- export type SddTask = {
68
- /** Id estable y sin `:` (kebab-case) usado para ledger y artefactos. */
69
- id: string;
70
- /** Rol que implementa (y arregla) la tarea. */
71
- implementerRoleID: string;
72
- /** Título humano corto. */
73
- title: string;
74
- /** Brief accionable de la tarea (cuerpo del prompt del implementer). */
75
- brief: string;
76
- /** Señales de routing para la tarea. */
77
- task: TaskSignals;
78
- /** Rol reviewer específico (sobreescribe `deps.reviewerRoleID`). */
79
- reviewerRoleID?: string;
80
- };
81
- export type ReviewVerdict = {
82
- needsFix: boolean;
83
- /** Resumen redactado de findings para el fix dispatch. */
84
- findings?: string;
85
- };
86
- export type SddDeps = CoordinatorDeps & {
87
- storage: StorageProvider;
88
- config: OpenTeamConfig;
89
- workspaceDir?: string;
90
- ledgerPath?: string;
91
- reviewerRoleID?: string;
92
- interpretReview?: (review: RoleTaskResult) => ReviewVerdict;
93
- /** Máximo de rondas de fix+re-review (def: 1). */
94
- maxFixRounds?: number;
95
- parentSessionID?: string;
96
- directory?: string;
97
- /**
98
- * Callback for operator-facing warnings (defaults to `console.warn`).
99
- * Used by the legacy authority deprecation to reach the operator channel.
100
- */
101
- onWarning?: (message: string) => void;
102
- };
103
- export type SddTaskStatus = "complete" | "failed" | "skipped";
104
- export type SddTaskOutcome = {
105
- taskID: string;
106
- status: SddTaskStatus;
107
- implement?: RoleTaskResult;
108
- review?: RoleTaskResult;
109
- fixes: RoleTaskResult[];
110
- };
111
- export type SddPlanResult = {
112
- outcomes: SddTaskOutcome[];
113
- completed: string[];
114
- failed: string[];
115
- skipped: string[];
116
- };
117
- /**
118
- * Texto **completo** del brief en memoria para el prompt del implementer.
119
- *
120
- * GE-007 congela que el brief íntegro es un input de dispatch **en memoria**
121
- * (byte a byte), nunca solo una ruta a fichero; un prompt path-only es una
122
- * regresión funcional. GE-038 lo cablea al text part de `session.prompt`. Puro:
123
- * no persiste nada.
124
- */
125
- export declare function implementerBriefInput(task: SddTask): string;
126
- /** Opciones del manifiesto redactado de inputs del brief. */
127
- export type BriefManifestOptions = {
128
- /** Clase de privacidad del manifiesto (def: `internal`). */
129
- privacyClass?: PrivacyClass;
130
- /** Referencia estable del brief cuando persiste como artefacto revalidable. */
131
- briefRef?: ContextRef;
132
- };
133
- /** Manifiesto redactado del brief más su elegibilidad para shadow. */
134
- export type BriefManifestResult = {
135
- manifest: ArtifactManifest;
136
- /** Solo elegible si **cada** input seleccionado tiene referencia estable. */
137
- shadowEligible: boolean;
138
- };
139
- /**
140
- * Construye el manifiesto **redactado** de inputs del brief (GE-007).
141
- *
142
- * Sustituye el fichero de brief crudo por una referencia/digest ordenada:
143
- * versión, taskID, clase de privacidad y una entrada por input con digest
144
- * SHA-256 y tamaño en bytes; nunca título, extracto, prompt ni salida del
145
- * modelo. Un brief sin referencia estable produce una entrada solo-digest y
146
- * queda **inelegible** para shadow (no se fabrica una referencia). Puro y
147
- * determinista: solo cómputo de digest, sin I/O.
148
- */
149
- export declare function briefInputManifest(task: SddTask, options?: BriefManifestOptions): BriefManifestResult;
150
- /** Extrae texto de una respuesta opaca del modelo (best-effort). Puro. */
151
- export declare function extractResponseText(response: unknown): string;
152
- /**
153
- * Veredicto por defecto: escanea el texto de la review en busca de marcadores de
154
- * severidad. Conservador y determinista; los llamadores pueden inyectar su
155
- * propio intérprete vía `deps.interpretReview`.
156
- */
157
- export declare function defaultReviewVerdict(review: RoleTaskResult): ReviewVerdict;
158
- /**
159
- * Ejecuta una única tarea del loop SDD (con reanudación desde el ledger).
160
- *
161
- * @deprecated Legacy SDD authority (progress.md as task-completion ledger)
162
- * will be removed in v1.0.0. Use graph authority instead.
163
- * See docs/guide/graph-migration.md.
164
- * **Note:** This function currently has no production caller — it is only
165
- * invoked by tests. The deprecation warning is defence-in-depth.
166
- */
167
- export declare function runSddTask(task: SddTask, deps: SddDeps): Promise<SddTaskOutcome>;
168
- /**
169
- * Ejecuta un plan SDD **en orden** (las tareas son secuenciales por diseño; la
170
- * paralelización de tareas independientes es otra capa). Reanuda saltando las ya
171
- * completas y resume el resultado por estado.
172
- *
173
- * @deprecated Legacy SDD authority (progress.md as task-completion ledger)
174
- * will be removed in v1.0.0. Use graph authority instead.
175
- * See docs/guide/graph-migration.md.
176
- * **Note:** This function currently has no production caller — it is only
177
- * invoked by tests. The deprecation warning is defence-in-depth.
178
- */
179
- export declare function runSddPlan(tasks: readonly SddTask[], deps: SddDeps): Promise<SddPlanResult>;
180
- //# sourceMappingURL=sdd.d.ts.map
@@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AAC;CACvB,CAAC;AAEF,sEAAsE;AACtE,MAAM,MAAM,mBAAmB,GAAG;IAChC,QAAQ,EAAE,gBAAgB,CAAC;IAC3B,6EAA6E;IAC7E,cAAc,EAAE,OAAO,CAAC;CACzB,CAAC;AAEF;;;;;;;;;GASG;AACH,wBAAgB,kBAAkB,CAChC,IAAI,EAAE,OAAO,EACb,OAAO,GAAE,oBAAyB,GACjC,mBAAmB,CAarB;AA6ED,0EAA0E;AAC1E,wBAAgB,mBAAmB,CAAC,QAAQ,EAAE,OAAO,GAAG,MAAM,CAuB7D;AAKD;;;;GAIG;AACH,wBAAgB,oBAAoB,CAAC,MAAM,EAAE,cAAc,GAAG,aAAa,CAO1E;AAuBD;;;;;;;;GAQG;AACH,wBAAsB,UAAU,CAC9B,IAAI,EAAE,OAAO,EACb,IAAI,EAAE,OAAO,GACZ,OAAO,CAAC,cAAc,CAAC,CAyHzB;AAED;;;;;;;;;;GAUG;AACH,wBAAsB,UAAU,CAC9B,KAAK,EAAE,SAAS,OAAO,EAAE,EACzB,IAAI,EAAE,OAAO,GACZ,OAAO,CAAC,aAAa,CAAC,CAoBxB"}
@@ -1,32 +0,0 @@
1
- import type { StorageProvider } from "../provider";
2
- /** Plan (dry-run) de migración: solo rutas y conteo, nunca contenido. */
3
- export type BriefMigrationPlan = {
4
- readonly workspaceDir: string;
5
- readonly briefPaths: readonly string[];
6
- readonly count: number;
7
- };
8
- /** Resultado de aplicar la migración: manifiestos escritos y conteo. */
9
- export type BriefMigrationReport = {
10
- readonly workspaceDir: string;
11
- readonly migrated: readonly string[];
12
- readonly count: number;
13
- };
14
- /** Código de fallo fail-closed de la migración. */
15
- export type MigrationErrorCode = "unreadable" | "unknown-schema";
16
- /** Error tipado de una migración abortada (deja el crudo intacto). */
17
- export declare class MigrationError extends Error {
18
- readonly code: MigrationErrorCode;
19
- readonly path: string;
20
- constructor(code: MigrationErrorCode, path: string);
21
- }
22
- /**
23
- * Planifica la migración (dry-run). Lista los briefs crudos y devuelve sus
24
- * rutas y conteo; **no** lee ni transporta el cuerpo de ningún brief.
25
- */
26
- export declare function planLegacyBriefMigration(storage: StorageProvider, workspaceDir: string): Promise<BriefMigrationPlan>;
27
- /**
28
- * Aplica la migración: por cada brief crudo escribe el manifiesto redactado y
29
- * borra el crudo (sin backup). Idempotente y fail-closed.
30
- */
31
- export declare function applyLegacyBriefMigration(storage: StorageProvider, workspaceDir: string): Promise<BriefMigrationReport>;
32
- //# sourceMappingURL=migrateLegacyBriefs.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"migrateLegacyBriefs.d.ts","sourceRoot":"","sources":["../../../src/storage/graph/migrateLegacyBriefs.ts"],"names":[],"mappings":"AAMA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,aAAa,CAAC;AA4BnD,yEAAyE;AACzE,MAAM,MAAM,kBAAkB,GAAG;IAC/B,QAAQ,CAAC,YAAY,EAAE,MAAM,CAAC;IAC9B,QAAQ,CAAC,UAAU,EAAE,SAAS,MAAM,EAAE,CAAC;IACvC,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAC;CACxB,CAAC;AAEF,wEAAwE;AACxE,MAAM,MAAM,oBAAoB,GAAG;IACjC,QAAQ,CAAC,YAAY,EAAE,MAAM,CAAC;IAC9B,QAAQ,CAAC,QAAQ,EAAE,SAAS,MAAM,EAAE,CAAC;IACrC,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAC;CACxB,CAAC;AAEF,mDAAmD;AACnD,MAAM,MAAM,kBAAkB,GAAG,YAAY,GAAG,gBAAgB,CAAC;AAEjE,sEAAsE;AACtE,qBAAa,cAAe,SAAQ,KAAK;IACvC,QAAQ,CAAC,IAAI,EAAE,kBAAkB,CAAC;IAClC,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;IAEtB,YAAY,IAAI,EAAE,kBAAkB,EAAE,IAAI,EAAE,MAAM,EAKjD;CACF;AA6CD;;;GAGG;AACH,wBAAsB,wBAAwB,CAC5C,OAAO,EAAE,eAAe,EACxB,YAAY,EAAE,MAAM,GACnB,OAAO,CAAC,kBAAkB,CAAC,CAM7B;AAED;;;GAGG;AACH,wBAAsB,yBAAyB,CAC7C,OAAO,EAAE,eAAe,EACxB,YAAY,EAAE,MAAM,GACnB,OAAO,CAAC,oBAAoB,CAAC,CAuB/B"}