@jakedowns/progress-tool-opencode-plugin 0.0.0-stage → 2.14.1

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/src/types.ts ADDED
@@ -0,0 +1,48 @@
1
+ /**
2
+ * Shared types for the progress plugin parts.
3
+ *
4
+ * Kept dependency-free so the GUI bundle can import it without pulling in
5
+ * Node built-ins.
6
+ */
7
+
8
+ export type ProgressStatus = "running" | "done" | "error" | "waiting";
9
+
10
+ export interface ProgressEntry {
11
+ id: string;
12
+ sessionId?: string;
13
+ status: ProgressStatus;
14
+ /** Task label; may contain `\n` line breaks. */
15
+ title: string;
16
+ /** Optional detail; may contain `\n` line breaks. */
17
+ detail?: string | null;
18
+ /** 0..1 fraction, or null when unknown. */
19
+ progress?: number | null;
20
+ parentId?: string | null;
21
+ startedAt?: number;
22
+ createdAt?: number;
23
+ updatedAt?: number;
24
+ /**
25
+ * View-plane metadata: a user dismissed this task, with the rolled-up
26
+ * status at dismiss time. Written by the plugin (atomic + locked, spec
27
+ * §4.3/§4.4), preserved by agent/relay upserts, cleared on lifecycle
28
+ * restart. Revival semantics live in tree.ts `isDismissed`.
29
+ */
30
+ dismissed?: { status: string; at: number } | null;
31
+ }
32
+
33
+ export interface ProgressState {
34
+ entries: Record<string, ProgressEntry>;
35
+ version?: number;
36
+ }
37
+
38
+ export interface TreeNode extends ProgressEntry {
39
+ /** Stable key from the state file map (may be session-scoped). */
40
+ key: string;
41
+ children: TreeNode[];
42
+ /**
43
+ * The entry's own stored `updatedAt`, before buildTree projects the latest
44
+ * child update onto `updatedAt`. Dismissal logic uses this to tell "the
45
+ * agent re-reported this task" apart from "a child ticked / a sibling moved".
46
+ */
47
+ reportedAt?: number;
48
+ }