@jmanuelcorral/openteam 0.1.15 → 0.1.16
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/dist/dashboard/backlog.d.ts +9 -0
- package/dist/dashboard/backlog.d.ts.map +1 -0
- package/dist/dashboard/render.d.ts +14 -0
- package/dist/dashboard/render.d.ts.map +1 -0
- package/dist/dashboard/state.d.ts +33 -0
- package/dist/dashboard/state.d.ts.map +1 -0
- package/dist/dashboard/types.d.ts +71 -0
- package/dist/dashboard/types.d.ts.map +1 -0
- package/package.json +1 -1
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import type { BacklogItem, LoopSnapshot } from "./types";
|
|
2
|
+
/** Extrae los ítems de checklist de un backlog Markdown. Pure. */
|
|
3
|
+
export declare function parseBacklog(text: string): BacklogItem[];
|
|
4
|
+
/**
|
|
5
|
+
* Construye el snapshot del loop a partir de los ítems parseados. `progressPct`
|
|
6
|
+
* es determinista: 100 si no hay ítems. Pure.
|
|
7
|
+
*/
|
|
8
|
+
export declare function buildLoopSnapshot(backlogPath: string, items: readonly BacklogItem[]): LoopSnapshot;
|
|
9
|
+
//# sourceMappingURL=backlog.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"backlog.d.ts","sourceRoot":"","sources":["../../src/dashboard/backlog.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,WAAW,EAAE,YAAY,EAAE,MAAM,SAAS,CAAC;AAwBzD,kEAAkE;AAClE,wBAAgB,YAAY,CAAC,IAAI,EAAE,MAAM,GAAG,WAAW,EAAE,CAmBxD;AAED;;;GAGG;AACH,wBAAgB,iBAAiB,CAC/B,WAAW,EAAE,MAAM,EACnB,KAAK,EAAE,SAAS,WAAW,EAAE,GAC5B,YAAY,CAcd"}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import type { DashboardState } from "./types";
|
|
2
|
+
/** Escapa texto para HTML. Evita fuga de markup y roturas de `</script>`. Pure. */
|
|
3
|
+
export declare function escapeHtml(value: string): string;
|
|
4
|
+
export type RenderOptions = {
|
|
5
|
+
/** Fallback de polling en ms (default 2000). */
|
|
6
|
+
refreshMs?: number;
|
|
7
|
+
};
|
|
8
|
+
/**
|
|
9
|
+
* Renderiza el dashboard como un único HTML autocontenido (CSS + JS inline, sin
|
|
10
|
+
* CDNs). Escapa todo texto de usuario y **nunca** incluye prompts en claro.
|
|
11
|
+
* Determinista. Pure.
|
|
12
|
+
*/
|
|
13
|
+
export declare function renderDashboardHtml(state: DashboardState, options?: RenderOptions): string;
|
|
14
|
+
//# sourceMappingURL=render.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"render.d.ts","sourceRoot":"","sources":["../../src/dashboard/render.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAGV,cAAc,EAGf,MAAM,SAAS,CAAC;AASjB,mFAAmF;AACnF,wBAAgB,UAAU,CAAC,KAAK,EAAE,MAAM,GAAG,MAAM,CAOhD;AAiND,MAAM,MAAM,aAAa,GAAG;IAC1B,gDAAgD;IAChD,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB,CAAC;AAEF;;;;GAIG;AACH,wBAAgB,mBAAmB,CACjC,KAAK,EAAE,cAAc,EACrB,OAAO,GAAE,aAAkB,GAC1B,MAAM,CAmCR"}
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import type { AgentInfo } from "../commands/agents";
|
|
2
|
+
import type { CostRecord } from "../telemetry/types";
|
|
3
|
+
import type { ActivityEntry, BacklogItem, CommitView, DashboardState } from "./types";
|
|
4
|
+
export declare const DEFAULT_RECENT_ROUTES = 50;
|
|
5
|
+
export declare const DEFAULT_ACTIVITY_LIMIT = 100;
|
|
6
|
+
/** Fuentes crudas ya leídas por el driver. `buildDashboardState` las compone. */
|
|
7
|
+
export type DashboardInputs = {
|
|
8
|
+
/** ISO-8601 inyectado por el driver. */
|
|
9
|
+
generatedAt: string;
|
|
10
|
+
session?: {
|
|
11
|
+
id?: string;
|
|
12
|
+
startedAt?: string;
|
|
13
|
+
};
|
|
14
|
+
costRecords: readonly CostRecord[];
|
|
15
|
+
/** `undefined` si no hay backlog en disco. */
|
|
16
|
+
backlog?: {
|
|
17
|
+
path: string;
|
|
18
|
+
items: readonly BacklogItem[];
|
|
19
|
+
lastCommit?: CommitView;
|
|
20
|
+
};
|
|
21
|
+
team: readonly AgentInfo[];
|
|
22
|
+
activity: readonly ActivityEntry[];
|
|
23
|
+
/** Tope de `recentRoutes` (def 50). */
|
|
24
|
+
recentRoutesLimit?: number;
|
|
25
|
+
/** Tope de `activity` (def 100). */
|
|
26
|
+
activityLimit?: number;
|
|
27
|
+
};
|
|
28
|
+
/**
|
|
29
|
+
* Compone el snapshot del dashboard a partir de las fuentes crudas. Determinista:
|
|
30
|
+
* el orden de `recentRoutes`/`activity` no depende del orden de entrada. Pure.
|
|
31
|
+
*/
|
|
32
|
+
export declare function buildDashboardState(inputs: DashboardInputs): DashboardState;
|
|
33
|
+
//# sourceMappingURL=state.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"state.d.ts","sourceRoot":"","sources":["../../src/dashboard/state.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,oBAAoB,CAAC;AAEpD,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,oBAAoB,CAAC;AAErD,OAAO,KAAK,EACV,aAAa,EACb,WAAW,EACX,UAAU,EACV,cAAc,EAGf,MAAM,SAAS,CAAC;AAEjB,eAAO,MAAM,qBAAqB,KAAK,CAAC;AACxC,eAAO,MAAM,sBAAsB,MAAM,CAAC;AAE1C,iFAAiF;AACjF,MAAM,MAAM,eAAe,GAAG;IAC5B,wCAAwC;IACxC,WAAW,EAAE,MAAM,CAAC;IACpB,OAAO,CAAC,EAAE;QACR,EAAE,CAAC,EAAE,MAAM,CAAC;QACZ,SAAS,CAAC,EAAE,MAAM,CAAC;KACpB,CAAC;IACF,WAAW,EAAE,SAAS,UAAU,EAAE,CAAC;IACnC,8CAA8C;IAC9C,OAAO,CAAC,EAAE;QACR,IAAI,EAAE,MAAM,CAAC;QACb,KAAK,EAAE,SAAS,WAAW,EAAE,CAAC;QAC9B,UAAU,CAAC,EAAE,UAAU,CAAC;KACzB,CAAC;IACF,IAAI,EAAE,SAAS,SAAS,EAAE,CAAC;IAC3B,QAAQ,EAAE,SAAS,aAAa,EAAE,CAAC;IACnC,uCAAuC;IACvC,iBAAiB,CAAC,EAAE,MAAM,CAAC;IAC3B,oCAAoC;IACpC,aAAa,CAAC,EAAE,MAAM,CAAC;CACxB,CAAC;AA8CF;;;GAGG;AACH,wBAAgB,mBAAmB,CAAC,MAAM,EAAE,eAAe,GAAG,cAAc,CA0B3E"}
|
|
@@ -0,0 +1,71 @@
|
|
|
1
|
+
import type { ComplexityTier } from "../capabilities/types";
|
|
2
|
+
import type { AgentInfo } from "../commands/agents";
|
|
3
|
+
import type { CostReport } from "../commands/report";
|
|
4
|
+
/**
|
|
5
|
+
* Snapshot inmutable del estado del dashboard. Producido por `buildDashboardState`
|
|
6
|
+
* (puro) y servido en `/api/state`. Reutiliza tipos ya existentes (`CostReport`,
|
|
7
|
+
* `AgentInfo`). Nunca contiene texto de prompt en claro: solo `promptHash`.
|
|
8
|
+
*/
|
|
9
|
+
export type DashboardState = {
|
|
10
|
+
/** ISO-8601. Lo inyecta el driver (no el core determinista). */
|
|
11
|
+
generatedAt: string;
|
|
12
|
+
session: {
|
|
13
|
+
id?: string;
|
|
14
|
+
startedAt?: string;
|
|
15
|
+
};
|
|
16
|
+
/** Routing / coste — reutiliza `summarizeCostRecords()`. */
|
|
17
|
+
cost: CostReport;
|
|
18
|
+
/** Últimas decisiones de routing (redactadas: solo `promptHash`). */
|
|
19
|
+
recentRoutes: RouteView[];
|
|
20
|
+
/** Progreso del loop. `undefined` si no hay backlog. */
|
|
21
|
+
loop?: LoopSnapshot;
|
|
22
|
+
/** Equipo — reutiliza el frontmatter de los agentes. */
|
|
23
|
+
team: AgentInfo[];
|
|
24
|
+
/** Actividad reciente (scribe + eventos opencode), más nueva primero. */
|
|
25
|
+
activity: ActivityEntry[];
|
|
26
|
+
};
|
|
27
|
+
export type RouteView = {
|
|
28
|
+
ts: number;
|
|
29
|
+
tier: ComplexityTier;
|
|
30
|
+
routeKind: "local" | "frontier";
|
|
31
|
+
/** "providerID/modelID". */
|
|
32
|
+
model: string;
|
|
33
|
+
/** NUNCA el prompt. */
|
|
34
|
+
promptHash: string;
|
|
35
|
+
estimatedCostUSD: number;
|
|
36
|
+
estimatedSavingsUSD: number;
|
|
37
|
+
budgetAction: string;
|
|
38
|
+
};
|
|
39
|
+
export type LoopSnapshot = {
|
|
40
|
+
backlogPath: string;
|
|
41
|
+
total: number;
|
|
42
|
+
done: number;
|
|
43
|
+
open: number;
|
|
44
|
+
/** 0..100, derivado de forma determinista. */
|
|
45
|
+
progressPct: number;
|
|
46
|
+
items: BacklogItem[];
|
|
47
|
+
/** Lo aporta el driver (git), opcional. */
|
|
48
|
+
lastCommit?: CommitView;
|
|
49
|
+
};
|
|
50
|
+
export type BacklogItem = {
|
|
51
|
+
text: string;
|
|
52
|
+
done: boolean;
|
|
53
|
+
/** Del prefijo `[@Nombre]` del casting. */
|
|
54
|
+
assignee?: string;
|
|
55
|
+
};
|
|
56
|
+
export type CommitView = {
|
|
57
|
+
/** short sha. */
|
|
58
|
+
hash: string;
|
|
59
|
+
subject: string;
|
|
60
|
+
/** ISO-8601. */
|
|
61
|
+
at: string;
|
|
62
|
+
};
|
|
63
|
+
export type ActivityEntry = {
|
|
64
|
+
ts: number;
|
|
65
|
+
kind: "route" | "agent" | "decision" | "commit";
|
|
66
|
+
/** Nombre del agente si aplica. */
|
|
67
|
+
agent?: string;
|
|
68
|
+
/** Texto ya redactado. */
|
|
69
|
+
summary: string;
|
|
70
|
+
};
|
|
71
|
+
//# sourceMappingURL=types.d.ts.map
|
|
@@ -0,0 +1 @@
|
|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