@jmanuelcorral/openteam 0.1.15 → 0.1.17
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/README.md +35 -0
- package/dist/cli.js +51 -1
- package/dist/commands/dashboard.d.ts +9 -0
- package/dist/commands/dashboard.d.ts.map +1 -0
- package/dist/commands/dispatch.d.ts.map +1 -1
- package/dist/config/schema.d.ts +29 -0
- package/dist/config/schema.d.ts.map +1 -1
- 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/dist/index.d.ts +9 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +703 -4
- package/dist/plugin/commandTool.d.ts +1 -1
- package/dist/plugin/commandTool.d.ts.map +1 -1
- package/dist/web/activity.d.ts +12 -0
- package/dist/web/activity.d.ts.map +1 -0
- package/dist/web/paths.d.ts +4 -0
- package/dist/web/paths.d.ts.map +1 -0
- package/dist/web/server.d.ts +26 -0
- package/dist/web/server.d.ts.map +1 -0
- package/dist/web/snapshot.d.ts +34 -0
- package/dist/web/snapshot.d.ts.map +1 -0
- package/dist/web/start.d.ts +36 -0
- package/dist/web/start.d.ts.map +1 -0
- package/dist/web/watch.d.ts +19 -0
- package/dist/web/watch.d.ts.map +1 -0
- package/package.json +1 -1
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { type ToolDefinition } from "@opencode-ai/plugin";
|
|
2
2
|
import { type CliDeps } from "../commands/dispatch";
|
|
3
|
-
export type CommandAction = "show" | "set" | "auto" | "doctor" | "report" | "agents";
|
|
3
|
+
export type CommandAction = "show" | "set" | "auto" | "doctor" | "report" | "agents" | "dashboard";
|
|
4
4
|
/**
|
|
5
5
|
* Map a tool action (+ optional model) to the argv understood by {@link runCli}.
|
|
6
6
|
* Pure so it can be unit-tested without the opencode runtime.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"commandTool.d.ts","sourceRoot":"","sources":["../../src/plugin/commandTool.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,cAAc,EAAQ,MAAM,qBAAqB,CAAC;AAEhE,OAAO,EAAE,KAAK,OAAO,EAAU,MAAM,sBAAsB,CAAC;AAE5D,MAAM,MAAM,aAAa,GACrB,MAAM,GACN,KAAK,GACL,MAAM,GACN,QAAQ,GACR,QAAQ,GACR,QAAQ,CAAC;
|
|
1
|
+
{"version":3,"file":"commandTool.d.ts","sourceRoot":"","sources":["../../src/plugin/commandTool.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,cAAc,EAAQ,MAAM,qBAAqB,CAAC;AAEhE,OAAO,EAAE,KAAK,OAAO,EAAU,MAAM,sBAAsB,CAAC;AAE5D,MAAM,MAAM,aAAa,GACrB,MAAM,GACN,KAAK,GACL,MAAM,GACN,QAAQ,GACR,QAAQ,GACR,QAAQ,GACR,WAAW,CAAC;AAEhB;;;GAGG;AACH,wBAAgB,WAAW,CAAC,MAAM,EAAE,aAAa,EAAE,KAAK,CAAC,EAAE,MAAM,GAAG,MAAM,EAAE,CAmB3E;AAED,wBAAgB,iBAAiB,CAAC,IAAI,EAAE,OAAO,GAAG,cAAc,CA0B/D"}
|
|
@@ -0,0 +1,12 @@
|
|
|
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
|
|
@@ -0,0 +1 @@
|
|
|
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"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"paths.d.ts","sourceRoot":"","sources":["../../src/web/paths.ts"],"names":[],"mappings":"AAAA,mEAAmE;AACnE,eAAO,MAAM,oBAAoB,kCAAkC,CAAC;AACpE,eAAO,MAAM,sBAAsB,oCAAoC,CAAC"}
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import type { DashboardConfig } from "../config/schema";
|
|
2
|
+
import type { DashboardInputs } from "../dashboard/state";
|
|
3
|
+
export type DashboardServerDeps = {
|
|
4
|
+
/** Relee las fuentes y produce los inputs crudos del dashboard. */
|
|
5
|
+
readSnapshot: () => Promise<DashboardInputs>;
|
|
6
|
+
config: DashboardConfig;
|
|
7
|
+
/** Inyectable para tests; por defecto `Bun.serve`. */
|
|
8
|
+
serve?: typeof Bun.serve;
|
|
9
|
+
/** Logger (por defecto `console`). */
|
|
10
|
+
log?: (message: string) => void;
|
|
11
|
+
};
|
|
12
|
+
export type DashboardServer = {
|
|
13
|
+
url: string;
|
|
14
|
+
port: number;
|
|
15
|
+
/** Reevalúa el estado y lo empuja a los clientes SSE conectados. */
|
|
16
|
+
notify: () => Promise<void>;
|
|
17
|
+
close: () => void;
|
|
18
|
+
};
|
|
19
|
+
/**
|
|
20
|
+
* Arranca el servidor del dashboard con `Bun.serve` en loopback. Sirve `/` (HTML),
|
|
21
|
+
* `/api/state` (JSON), `/events` (SSE) y `/healthz`. Solo lectura: cualquier método
|
|
22
|
+
* ≠ GET → 405; ruta desconocida → 404. Con `autoPortFallback` prueba puertos
|
|
23
|
+
* sucesivos si el preferido está ocupado.
|
|
24
|
+
*/
|
|
25
|
+
export declare function createDashboardServer(deps: DashboardServerDeps): DashboardServer;
|
|
26
|
+
//# sourceMappingURL=server.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"server.d.ts","sourceRoot":"","sources":["../../src/web/server.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,kBAAkB,CAAC;AAExD,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,oBAAoB,CAAC;AAY1D,MAAM,MAAM,mBAAmB,GAAG;IAChC,mEAAmE;IACnE,YAAY,EAAE,MAAM,OAAO,CAAC,eAAe,CAAC,CAAC;IAC7C,MAAM,EAAE,eAAe,CAAC;IACxB,sDAAsD;IACtD,KAAK,CAAC,EAAE,OAAO,GAAG,CAAC,KAAK,CAAC;IACzB,sCAAsC;IACtC,GAAG,CAAC,EAAE,CAAC,OAAO,EAAE,MAAM,KAAK,IAAI,CAAC;CACjC,CAAC;AAEF,MAAM,MAAM,eAAe,GAAG;IAC5B,GAAG,EAAE,MAAM,CAAC;IACZ,IAAI,EAAE,MAAM,CAAC;IACb,oEAAoE;IACpE,MAAM,EAAE,MAAM,OAAO,CAAC,IAAI,CAAC,CAAC;IAC5B,KAAK,EAAE,MAAM,IAAI,CAAC;CACnB,CAAC;AAyBF;;;;;GAKG;AACH,wBAAgB,qBAAqB,CACnC,IAAI,EAAE,mBAAmB,GACxB,eAAe,CAsGjB"}
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
import type { AgentFile } from "../commands/agents";
|
|
2
|
+
import type { DashboardInputs } from "../dashboard/state";
|
|
3
|
+
import type { ActivityEntry, CommitView } from "../dashboard/types";
|
|
4
|
+
/** Dependencias de I/O que el driver inyecta para leer las fuentes del dashboard. */
|
|
5
|
+
export type SnapshotDeps = {
|
|
6
|
+
/** Lee un fichero de texto; devuelve `undefined` si no existe (ENOENT). */
|
|
7
|
+
readText: (path: string) => Promise<string | undefined>;
|
|
8
|
+
/** Lista los ficheros `.md` de `.opencode/agent/`. */
|
|
9
|
+
listAgentFiles: (dir: string) => Promise<AgentFile[]>;
|
|
10
|
+
/** Reloj: ISO-8601. Fuera del core puro. */
|
|
11
|
+
now: () => string;
|
|
12
|
+
/** Último commit (git); opcional. */
|
|
13
|
+
gitLastCommit?: () => Promise<CommitView | undefined>;
|
|
14
|
+
};
|
|
15
|
+
export type SnapshotPaths = {
|
|
16
|
+
telemetryPath: string;
|
|
17
|
+
backlogPath: string;
|
|
18
|
+
agentDir: string;
|
|
19
|
+
};
|
|
20
|
+
export type SnapshotContext = {
|
|
21
|
+
/** Actividad viva (buffer del driver). */
|
|
22
|
+
activity: () => ActivityEntry[];
|
|
23
|
+
session?: {
|
|
24
|
+
id?: string;
|
|
25
|
+
startedAt?: string;
|
|
26
|
+
};
|
|
27
|
+
recentRoutesLimit?: number;
|
|
28
|
+
};
|
|
29
|
+
/**
|
|
30
|
+
* Crea un lector de snapshot: cada llamada relee las fuentes en disco y devuelve
|
|
31
|
+
* los `DashboardInputs` crudos que `buildDashboardState` (puro) compondrá.
|
|
32
|
+
*/
|
|
33
|
+
export declare function createSnapshotReader(deps: SnapshotDeps, paths: SnapshotPaths, context: SnapshotContext): () => Promise<DashboardInputs>;
|
|
34
|
+
//# sourceMappingURL=snapshot.d.ts.map
|
|
@@ -0,0 +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,MAAM,CAAC;IACpB,QAAQ,EAAE,MAAM,CAAC;CAClB,CAAC;AAEF,MAAM,MAAM,eAAe,GAAG;IAC5B,0CAA0C;IAC1C,QAAQ,EAAE,MAAM,aAAa,EAAE,CAAC;IAChC,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;;;GAGG;AACH,wBAAgB,oBAAoB,CAClC,IAAI,EAAE,YAAY,EAClB,KAAK,EAAE,aAAa,EACpB,OAAO,EAAE,eAAe,GACvB,MAAM,OAAO,CAAC,eAAe,CAAC,CAwChC"}
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
import { watch as fsWatch } from "node:fs";
|
|
2
|
+
import type { AgentFile } from "../commands/agents";
|
|
3
|
+
import type { DashboardConfig } from "../config/schema";
|
|
4
|
+
import type { ActivityEntry, CommitView } from "../dashboard/types";
|
|
5
|
+
export type DashboardRuntimeDeps = {
|
|
6
|
+
config: DashboardConfig;
|
|
7
|
+
telemetryPath: string;
|
|
8
|
+
agentDir: string;
|
|
9
|
+
backlogPath?: string;
|
|
10
|
+
readText: (path: string) => Promise<string | undefined>;
|
|
11
|
+
listAgentFiles: (dir: string) => Promise<AgentFile[]>;
|
|
12
|
+
now: () => string;
|
|
13
|
+
gitLastCommit?: () => Promise<CommitView | undefined>;
|
|
14
|
+
session?: {
|
|
15
|
+
id?: string;
|
|
16
|
+
startedAt?: string;
|
|
17
|
+
};
|
|
18
|
+
/** Inyectables para tests. */
|
|
19
|
+
serve?: typeof import("./server").createDashboardServer;
|
|
20
|
+
watch?: (path: string, listener: () => void) => ReturnType<typeof fsWatch>;
|
|
21
|
+
log?: (message: string) => void;
|
|
22
|
+
};
|
|
23
|
+
export type DashboardRuntime = {
|
|
24
|
+
url: string;
|
|
25
|
+
port: number;
|
|
26
|
+
/** Registra actividad en vivo y la empuja a los clientes SSE. */
|
|
27
|
+
pushActivity: (entry: ActivityEntry) => void;
|
|
28
|
+
close: () => void;
|
|
29
|
+
};
|
|
30
|
+
/**
|
|
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
|
+
*/
|
|
35
|
+
export declare function startDashboard(deps: DashboardRuntimeDeps): DashboardRuntime;
|
|
36
|
+
//# sourceMappingURL=start.d.ts.map
|
|
@@ -0,0 +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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,19 @@
|
|
|
1
|
+
import type { FSWatcher } from "node:fs";
|
|
2
|
+
/** Firma mínima de `fs.watch` que necesitamos (inyectable en tests). */
|
|
3
|
+
export type WatchFn = (path: string, listener: () => void) => FSWatcher;
|
|
4
|
+
export type WatchDeps = {
|
|
5
|
+
watch: WatchFn;
|
|
6
|
+
/** Programa un callback tras `ms`; por defecto `setTimeout`. */
|
|
7
|
+
setTimer?: (callback: () => void, ms: number) => unknown;
|
|
8
|
+
clearTimer?: (handle: unknown) => void;
|
|
9
|
+
};
|
|
10
|
+
export type FileWatcher = {
|
|
11
|
+
close: () => void;
|
|
12
|
+
};
|
|
13
|
+
/**
|
|
14
|
+
* Observa varias rutas y, con un debounce, invoca `onChange` cuando alguna cambia.
|
|
15
|
+
* Tolera rutas que aún no existen (se ignora el error de `watch`). El I/O real
|
|
16
|
+
* (`fs.watch`) se inyecta para poder testear el debounce sin tocar disco.
|
|
17
|
+
*/
|
|
18
|
+
export declare function watchSources(paths: readonly string[], onChange: () => void, deps: WatchDeps, debounceMs?: number): FileWatcher;
|
|
19
|
+
//# sourceMappingURL=watch.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"watch.d.ts","sourceRoot":"","sources":["../../src/web/watch.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,SAAS,CAAC;AAEzC,wEAAwE;AACxE,MAAM,MAAM,OAAO,GAAG,CAAC,IAAI,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,IAAI,KAAK,SAAS,CAAC;AAExE,MAAM,MAAM,SAAS,GAAG;IACtB,KAAK,EAAE,OAAO,CAAC;IACf,gEAAgE;IAChE,QAAQ,CAAC,EAAE,CAAC,QAAQ,EAAE,MAAM,IAAI,EAAE,EAAE,EAAE,MAAM,KAAK,OAAO,CAAC;IACzD,UAAU,CAAC,EAAE,CAAC,MAAM,EAAE,OAAO,KAAK,IAAI,CAAC;CACxC,CAAC;AAEF,MAAM,MAAM,WAAW,GAAG;IACxB,KAAK,EAAE,MAAM,IAAI,CAAC;CACnB,CAAC;AAEF;;;;GAIG;AACH,wBAAgB,YAAY,CAC1B,KAAK,EAAE,SAAS,MAAM,EAAE,EACxB,QAAQ,EAAE,MAAM,IAAI,EACpB,IAAI,EAAE,SAAS,EACf,UAAU,SAAM,GACf,WAAW,CAqCb"}
|