@jmanuelcorral/openteam 0.1.20 → 0.1.22

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 (45) hide show
  1. package/README.md +29 -17
  2. package/dist/cli/dashboardServe.d.ts +52 -0
  3. package/dist/cli/dashboardServe.d.ts.map +1 -0
  4. package/dist/cli.js +1816 -499
  5. package/dist/commands/dashboard.d.ts +4 -4
  6. package/dist/commands/dashboard.d.ts.map +1 -1
  7. package/dist/commands/dispatch.d.ts.map +1 -1
  8. package/dist/commands/orchestratorAgent.d.ts.map +1 -1
  9. package/dist/contract/opencode.d.ts +1 -1
  10. package/dist/contract/opencode.d.ts.map +1 -1
  11. package/dist/dashboard/render.d.ts.map +1 -1
  12. package/dist/dashboard/state.d.ts +14 -6
  13. package/dist/dashboard/state.d.ts.map +1 -1
  14. package/dist/dashboard/types.d.ts +14 -3
  15. package/dist/dashboard/types.d.ts.map +1 -1
  16. package/dist/index.d.ts +8 -9
  17. package/dist/index.d.ts.map +1 -1
  18. package/dist/index.js +476 -780
  19. package/dist/orchestrator/coordinator.d.ts +14 -2
  20. package/dist/orchestrator/coordinator.d.ts.map +1 -1
  21. package/dist/plugin/capture.d.ts +46 -0
  22. package/dist/plugin/capture.d.ts.map +1 -0
  23. package/dist/plugin/hooks.d.ts +2 -2
  24. package/dist/plugin/hooks.d.ts.map +1 -1
  25. package/dist/plugin/toolcalls.d.ts +21 -0
  26. package/dist/plugin/toolcalls.d.ts.map +1 -0
  27. package/dist/telemetry/aggregate.d.ts +89 -0
  28. package/dist/telemetry/aggregate.d.ts.map +1 -0
  29. package/dist/telemetry/decisions.d.ts +25 -0
  30. package/dist/telemetry/decisions.d.ts.map +1 -0
  31. package/dist/telemetry/eventLog.d.ts +63 -0
  32. package/dist/telemetry/eventLog.d.ts.map +1 -0
  33. package/dist/telemetry/events.d.ts +217 -0
  34. package/dist/telemetry/events.d.ts.map +1 -0
  35. package/dist/web/git.d.ts +9 -0
  36. package/dist/web/git.d.ts.map +1 -0
  37. package/dist/web/server.d.ts +8 -7
  38. package/dist/web/server.d.ts.map +1 -1
  39. package/dist/web/snapshot.d.ts +13 -7
  40. package/dist/web/snapshot.d.ts.map +1 -1
  41. package/dist/web/start.d.ts +11 -8
  42. package/dist/web/start.d.ts.map +1 -1
  43. package/package.json +1 -1
  44. package/dist/web/activity.d.ts +0 -12
  45. package/dist/web/activity.d.ts.map +0 -1
@@ -1,10 +1,12 @@
1
1
  import type { AgentFile } from "../commands/agents";
2
2
  import type { DashboardInputs } from "../dashboard/state";
3
- import type { ActivityEntry, CommitView } from "../dashboard/types";
3
+ import type { CommitView } from "../dashboard/types";
4
4
  /** Dependencias de I/O que el driver inyecta para leer las fuentes del dashboard. */
5
5
  export type SnapshotDeps = {
6
6
  /** Lee un fichero de texto; devuelve `undefined` si no existe (ENOENT). */
7
7
  readText: (path: string) => Promise<string | undefined>;
8
+ /** Lista los nombres de fichero de un directorio; `[]` si no existe. */
9
+ listFiles: (dir: string) => Promise<string[]>;
8
10
  /** Lista los ficheros `.md` de `.opencode/agent/`. */
9
11
  listAgentFiles: (dir: string) => Promise<AgentFile[]>;
10
12
  /** Reloj: ISO-8601. Fuera del core puro. */
@@ -13,13 +15,16 @@ export type SnapshotDeps = {
13
15
  gitLastCommit?: () => Promise<CommitView | undefined>;
14
16
  };
15
17
  export type SnapshotPaths = {
16
- telemetryPath: string;
18
+ /** Directorio de logs de sesión (`sessions/*.jsonl`). */
19
+ sessionsDir: string;
20
+ /** Fichero de decisiones del scribe (markdown). */
21
+ decisionsPath: string;
17
22
  backlogPath: string;
18
23
  agentDir: string;
24
+ /** Telemetry legacy (`openteam-telemetry.jsonl`) a fusionar como route events. */
25
+ legacyTelemetryPath?: string;
19
26
  };
20
27
  export type SnapshotContext = {
21
- /** Actividad viva (buffer del driver). */
22
- activity: () => ActivityEntry[];
23
28
  session?: {
24
29
  id?: string;
25
30
  startedAt?: string;
@@ -27,8 +32,9 @@ export type SnapshotContext = {
27
32
  recentRoutesLimit?: number;
28
33
  };
29
34
  /**
30
- * Crea un lector de snapshot: cada llamada relee las fuentes en disco y devuelve
31
- * los `DashboardInputs` crudos que `buildDashboardState` (puro) compondrá.
35
+ * Crea un lector de snapshot: cada llamada relee las fuentes en disco (todos los
36
+ * logs de sesión + decisiones + backlog + agentes) y devuelve los `DashboardInputs`
37
+ * crudos que `buildDashboardState` (puro) compondrá agregando las sesiones.
32
38
  */
33
- export declare function createSnapshotReader(deps: SnapshotDeps, paths: SnapshotPaths, context: SnapshotContext): () => Promise<DashboardInputs>;
39
+ export declare function createSnapshotReader(deps: SnapshotDeps, paths: SnapshotPaths, context?: SnapshotContext): () => Promise<DashboardInputs>;
34
40
  //# sourceMappingURL=snapshot.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"snapshot.d.ts","sourceRoot":"","sources":["../../src/web/snapshot.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAa,MAAM,oBAAoB,CAAC;AAG/D,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,oBAAoB,CAAC;AAC1D,OAAO,KAAK,EAAE,aAAa,EAAE,UAAU,EAAE,MAAM,oBAAoB,CAAC;AAGpE,qFAAqF;AACrF,MAAM,MAAM,YAAY,GAAG;IACzB,2EAA2E;IAC3E,QAAQ,EAAE,CAAC,IAAI,EAAE,MAAM,KAAK,OAAO,CAAC,MAAM,GAAG,SAAS,CAAC,CAAC;IACxD,sDAAsD;IACtD,cAAc,EAAE,CAAC,GAAG,EAAE,MAAM,KAAK,OAAO,CAAC,SAAS,EAAE,CAAC,CAAC;IACtD,4CAA4C;IAC5C,GAAG,EAAE,MAAM,MAAM,CAAC;IAClB,qCAAqC;IACrC,aAAa,CAAC,EAAE,MAAM,OAAO,CAAC,UAAU,GAAG,SAAS,CAAC,CAAC;CACvD,CAAC;AAEF,MAAM,MAAM,aAAa,GAAG;IAC1B,aAAa,EAAE,MAAM,CAAC;IACtB,WAAW,EAAE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Aa,GAAG;IAC1B,yDAAyD;IACzD,WAAW,EAAE,MAAM,CAAC;IACpB,mDAAmD;IACnD,aAAa,EAAE,MAAM,CAAC;IACtB,WAAW,EAAE,MAAM,CAAC;IACpB,QAAQ,EAAE,MAAM,CAAC;IACjB,kFAAkF;IAClF,mBAAmB,CAAC,EAAE,MAAM,CAAC;CAC9B,CAAC;AAEF,MAAM,MAAM,eAAe,GAAG;IAC5B,OAAO,CAAC,EAAE;QAAE,EAAE,CAAC,EAAE,MAAM,CAAC;QAAC,SAAS,CAAC,EAAE,MAAM,CAAA;KAAE,CAAC;IAC9C,iBAAiB,CAAC,EAAE,MAAM,CAAC;CAC5B,CAAC;AAEF;;;;GAIG;AACH,wBAAgB,oBAAoB,CAClC,IAAI,EAAE,YAAY,EAClB,KAAK,EAAE,aAAa,EACpB,OAAO,GAAE,eAAoB,GAC5B,MAAM,OAAO,CAAC,eAAe,CAAC,CAiDhC"}
@@ -1,13 +1,18 @@
1
1
  import { watch as fsWatch } from "node:fs";
2
2
  import type { AgentFile } from "../commands/agents";
3
3
  import type { DashboardConfig } from "../config/schema";
4
- import type { ActivityEntry, CommitView } from "../dashboard/types";
4
+ import type { CommitView } from "../dashboard/types";
5
5
  export type DashboardRuntimeDeps = {
6
6
  config: DashboardConfig;
7
- telemetryPath: string;
7
+ /** Directorio de logs de sesión (`sessions/*.jsonl`). */
8
+ sessionsDir: string;
8
9
  agentDir: string;
10
+ decisionsPath?: string;
9
11
  backlogPath?: string;
12
+ /** Telemetry legacy a fusionar como route events. Opcional. */
13
+ legacyTelemetryPath?: string;
10
14
  readText: (path: string) => Promise<string | undefined>;
15
+ listFiles: (dir: string) => Promise<string[]>;
11
16
  listAgentFiles: (dir: string) => Promise<AgentFile[]>;
12
17
  now: () => string;
13
18
  gitLastCommit?: () => Promise<CommitView | undefined>;
@@ -23,14 +28,12 @@ export type DashboardRuntimeDeps = {
23
28
  export type DashboardRuntime = {
24
29
  url: string;
25
30
  port: number;
26
- /** Registra actividad en vivo y la empuja a los clientes SSE. */
27
- pushActivity: (entry: ActivityEntry) => void;
28
31
  close: () => void;
29
32
  };
30
33
  /**
31
- * Compone el runtime del dashboard: buffer de actividad + lector de snapshot +
32
- * servidor `Bun.serve` + watcher de ficheros. El plugin lo arranca cuando
33
- * `config.dashboard.enabled` y lo cierra al terminar la sesión.
34
+ * Compone el runtime del dashboard: lector de snapshot multi-sesión + servidor
35
+ * `node:http` + watcher de ficheros. Lo arranca la CLI (`openteam dashboard`) y
36
+ * agrega **todas** las sesiones de opencode que escriben en `sessionsDir`.
34
37
  */
35
- export declare function startDashboard(deps: DashboardRuntimeDeps): DashboardRuntime;
38
+ export declare function startDashboard(deps: DashboardRuntimeDeps): Promise<DashboardRuntime>;
36
39
  //# sourceMappingURL=start.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"start.d.ts","sourceRoot":"","sources":["../../src/web/start.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,IAAI,OAAO,EAAE,MAAM,SAAS,CAAC;AAE3C,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,oBAAoB,CAAC;AACpD,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,kBAAkB,CAAC;AACxD,OAAO,KAAK,EAAE,aAAa,EAAE,UAAU,EAAE,MAAM,oBAAoB,CAAC;AAOpE,MAAM,MAAM,oBAAoB,GAAG;IACjC,MAAM,EAAE,eAAe,CAAC;IACxB,aAAa,EAAE,MAAM,CAAC;IACtB,QAAQ,EAAE,MAAM,CAAC;IACjB,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,QAAQ,EAAE,CAAC,IAAI,EAAE,MAAM,KAAK,OAAO,CAAC,MAAM,GAAG,SAAS,CAAC,CAAC;IACxD,cAAc,EAAE,CAAC,GAAG,EAAE,MAAM,KAAK,OAAO,CAAC,SAAS,EAAE,CAAC,CAAC;IACtD,GAAG,EAAE,MAAM,MAAM,CAAC;IAClB,aAAa,CAAC,EAAE,MAAM,OAAO,CAAC,UA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DAA+D;IAC/D,mBAAmB,CAAC,EAAE,MAAM,CAAC;IAC7B,QAAQ,EAAE,CAAC,IAAI,EAAE,MAAM,KAAK,OAAO,CAAC,MAAM,GAAG,SAAS,CAAC,CAAC;IACxD,SAAS,EAAE,CAAC,GAAG,EAAE,MAAM,KAAK,OAAO,CAAC,MAAM,EAAE,CAAC,CAAC;IAC9C,cAAc,EAAE,CAAC,GAAG,EAAE,MAAM,KAAK,OAAO,CAAC,SAAS,EAAE,CAAC,CAAC;IACtD,GAAG,EAAE,MAAM,MAAM,CAAC;IAClB,aAAa,CAAC,EAAE,MAAM,OAAO,CAAC,UAAU,GAAG,SAAS,CAAC,CAAC;IACtD,OAAO,CAAC,EAAE;QAAE,EAAE,CAAC,EAAE,MAAM,CAAC;QAAC,SAAS,CAAC,EAAE,MAAM,CAAA;KAAE,CAAC;IAC9C,8BAA8B;IAC9B,KAAK,CAAC,EAAE,cAAc,UAAU,EAAE,qBAAqB,CAAC;IACxD,KAAK,CAAC,EAAE,CAAC,IAAI,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,IAAI,KAAK,UAAU,CAAC,OAAO,OAAO,CAAC,CAAC;IAC3E,GAAG,CAAC,EAAE,CAAC,OAAO,EAAE,MAAM,KAAK,IAAI,CAAC;CACjC,CAAC;AAEF,MAAM,MAAM,gBAAgB,GAAG;IAC7B,GAAG,EAAE,MAAM,CAAC;IACZ,IAAI,EAAE,MAAM,CAAC;IACb,KAAK,EAAE,MAAM,IAAI,CAAC;CACnB,CAAC;AAEF;;;;GAIG;AACH,wBAAgB,cAAc,CAC5B,IAAI,EAAE,oBAAoB,GACzB,OAAO,CAAC,gBAAgB,CAAC,CAE3B"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@jmanuelcorral/openteam",
3
- "version": "0.1.20",
3
+ "version": "0.1.22",
4
4
  "description": "Plugin opencode de routing coste-consciente local-first con orquestación Squad.",
5
5
  "license": "MIT",
6
6
  "author": "Jose Manuel Corral",
@@ -1,12 +0,0 @@
1
- import type { ActivityEntry } from "../dashboard/types";
2
- /**
3
- * Buffer en memoria de actividad reciente (eventos de opencode y del loop). Mantiene
4
- * como mucho `max` entradas, descartando las más antiguas. El estado vive aquí, en el
5
- * driver, no en el core puro del dashboard.
6
- */
7
- export type ActivityBuffer = {
8
- push: (entry: ActivityEntry) => void;
9
- list: () => ActivityEntry[];
10
- };
11
- export declare function createActivityBuffer(max?: number): ActivityBuffer;
12
- //# sourceMappingURL=activity.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"activity.d.ts","sourceRoot":"","sources":["../../src/web/activity.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,oBAAoB,CAAC;AAExD;;;;GAIG;AACH,MAAM,MAAM,cAAc,GAAG;IAC3B,IAAI,EAAE,CAAC,KAAK,EAAE,aAAa,KAAK,IAAI,CAAC;IACrC,IAAI,EAAE,MAAM,aAAa,EAAE,CAAC;CAC7B,CAAC;AAEF,wBAAgB,oBAAoB,CAAC,GAAG,SAAM,GAAG,cAAc,CAc9D"}