@echothink-ui/task 0.1.0

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 (64) hide show
  1. package/README.md +5 -0
  2. package/dist/components/BackendThinkingChain.d.ts +2 -0
  3. package/dist/components/BlockingReasonPanel.d.ts +2 -0
  4. package/dist/components/DAGEdge.d.ts +2 -0
  5. package/dist/components/DAGLegend.d.ts +2 -0
  6. package/dist/components/DAGNode.d.ts +4 -0
  7. package/dist/components/DecisionRequiredPanel.d.ts +2 -0
  8. package/dist/components/HumanInterventionPanel.d.ts +2 -0
  9. package/dist/components/MobileTaskShell.d.ts +12 -0
  10. package/dist/components/TaskApprovalPanel.d.ts +2 -0
  11. package/dist/components/TaskCard.d.ts +2 -0
  12. package/dist/components/TaskDependencyList.d.ts +2 -0
  13. package/dist/components/TaskDetailPanel.d.ts +2 -0
  14. package/dist/components/TaskHandoffPanel.d.ts +2 -0
  15. package/dist/components/TaskProgressIndicator.d.ts +2 -0
  16. package/dist/components/TaskRetryPanel.d.ts +2 -0
  17. package/dist/components/TaskRunLog.d.ts +2 -0
  18. package/dist/components/TaskStatusBadge.d.ts +2 -0
  19. package/dist/components/TaskTable.d.ts +5 -0
  20. package/dist/components/TaskTimeline.d.ts +2 -0
  21. package/dist/components/TaskWaveDAG.d.ts +2 -0
  22. package/dist/components/TaskWaveHeader.d.ts +2 -0
  23. package/dist/components/TaskWaveTable.d.ts +2 -0
  24. package/dist/components/utils.d.ts +13 -0
  25. package/dist/index.cjs +2434 -0
  26. package/dist/index.cjs.map +1 -0
  27. package/dist/index.css +2402 -0
  28. package/dist/index.css.map +1 -0
  29. package/dist/index.d.ts +27 -0
  30. package/dist/index.js +2388 -0
  31. package/dist/index.js.map +1 -0
  32. package/dist/types.d.ts +249 -0
  33. package/package.json +45 -0
  34. package/src/components/BackendThinkingChain.tsx +129 -0
  35. package/src/components/BlockingReasonPanel.tsx +67 -0
  36. package/src/components/DAGEdge.tsx +97 -0
  37. package/src/components/DAGLegend.tsx +86 -0
  38. package/src/components/DAGNode.tsx +103 -0
  39. package/src/components/DecisionRequiredPanel.tsx +166 -0
  40. package/src/components/HumanInterventionPanel.tsx +82 -0
  41. package/src/components/MobileTaskShell.tsx +52 -0
  42. package/src/components/TaskApprovalPanel.tsx +159 -0
  43. package/src/components/TaskCard.tsx +71 -0
  44. package/src/components/TaskDependencyList.test.tsx +54 -0
  45. package/src/components/TaskDependencyList.tsx +105 -0
  46. package/src/components/TaskDetailPanel.test.tsx +49 -0
  47. package/src/components/TaskDetailPanel.tsx +139 -0
  48. package/src/components/TaskHandoffPanel.tsx +125 -0
  49. package/src/components/TaskProgressIndicator.tsx +70 -0
  50. package/src/components/TaskRetryPanel.test.tsx +29 -0
  51. package/src/components/TaskRetryPanel.tsx +103 -0
  52. package/src/components/TaskRunLog.tsx +156 -0
  53. package/src/components/TaskStatusBadge.tsx +29 -0
  54. package/src/components/TaskTable.tsx +294 -0
  55. package/src/components/TaskTimeline.tsx +98 -0
  56. package/src/components/TaskWaveDAG.tsx +202 -0
  57. package/src/components/TaskWaveHeader.tsx +82 -0
  58. package/src/components/TaskWaveTable.tsx +151 -0
  59. package/src/components/css.d.ts +1 -0
  60. package/src/components/utils.ts +116 -0
  61. package/src/index.test.tsx +316 -0
  62. package/src/index.tsx +90 -0
  63. package/src/styles.css +2889 -0
  64. package/src/types.ts +289 -0
package/src/types.ts ADDED
@@ -0,0 +1,289 @@
1
+ import type * as React from "react";
2
+ import type {
3
+ EthAction,
4
+ EthDensity,
5
+ EthIntent,
6
+ EthOperationalStatus,
7
+ SurfaceComponentProps
8
+ } from "@echothink-ui/core";
9
+ import type { BulkAction, DataColumn } from "@echothink-ui/data";
10
+
11
+ export type TaskPriority = "low" | "medium" | "high" | "critical";
12
+
13
+ export interface TaskDependency extends Record<string, unknown> {
14
+ id: string;
15
+ title: string;
16
+ status: EthOperationalStatus;
17
+ relationship?: "blocks" | "blocked-by";
18
+ }
19
+
20
+ export interface TaskTimelineEvent extends Record<string, unknown> {
21
+ id: string;
22
+ timestamp: string | Date;
23
+ actor?: string;
24
+ kind: "status_change" | "comment" | "assignment" | "attachment" | "system";
25
+ summary: React.ReactNode;
26
+ details?: React.ReactNode;
27
+ }
28
+
29
+ export interface Task extends Record<string, unknown> {
30
+ id: string;
31
+ title: string;
32
+ assignee?: React.ReactNode;
33
+ dueAt?: string | Date;
34
+ status: EthOperationalStatus;
35
+ priority?: TaskPriority;
36
+ tags?: string[];
37
+ description?: React.ReactNode;
38
+ dependencies?: TaskDependency[];
39
+ history?: TaskTimelineEvent[];
40
+ order?: number;
41
+ durationMs?: number;
42
+ dependencyIds?: string[];
43
+ dependencyCount?: number;
44
+ }
45
+
46
+ export interface TaskWave extends Record<string, unknown> {
47
+ id: string;
48
+ label: string;
49
+ totalTasks: number;
50
+ statuses: Partial<Record<EthOperationalStatus, number>>;
51
+ startedAt?: string | Date;
52
+ eta?: string | Date;
53
+ }
54
+
55
+ export interface TaskStep {
56
+ id: string;
57
+ label: string;
58
+ status: EthOperationalStatus;
59
+ }
60
+
61
+ export interface DAGNodeModel extends Record<string, unknown> {
62
+ id: string;
63
+ label: string;
64
+ status: EthOperationalStatus;
65
+ x?: number;
66
+ y?: number;
67
+ }
68
+
69
+ export interface PositionedDAGNode extends DAGNodeModel {
70
+ x: number;
71
+ y: number;
72
+ }
73
+
74
+ export interface DAGEdgeModel extends Record<string, unknown> {
75
+ from: string;
76
+ to: string;
77
+ status?: EthOperationalStatus;
78
+ label?: string;
79
+ }
80
+
81
+ export type DAGEdgeLegendVariant = "dependency" | "critical" | "conditional";
82
+
83
+ export interface DAGEdgeLegendItem {
84
+ id: string;
85
+ label: React.ReactNode;
86
+ status?: EthOperationalStatus;
87
+ variant?: DAGEdgeLegendVariant;
88
+ }
89
+
90
+ export interface DecisionEvidence {
91
+ id: string;
92
+ label: string;
93
+ href?: string;
94
+ preview?: React.ReactNode;
95
+ }
96
+
97
+ export interface DecisionOption {
98
+ id: string;
99
+ label: string;
100
+ intent?: EthIntent;
101
+ description?: string;
102
+ }
103
+
104
+ export type RiskLevel = "low" | "medium" | "high" | "critical";
105
+
106
+ export interface BackendThinkingStep {
107
+ id: string;
108
+ title: string;
109
+ status: EthOperationalStatus;
110
+ summary?: string;
111
+ toolName?: string;
112
+ durationMs?: number;
113
+ redacted?: boolean;
114
+ children?: BackendThinkingStep[];
115
+ }
116
+
117
+ export interface TaskRunLogEntry extends Record<string, unknown> {
118
+ id: string;
119
+ timestamp: string | Date;
120
+ level: "info" | "warn" | "error" | "debug";
121
+ message: string;
122
+ redacted?: boolean;
123
+ }
124
+
125
+ export interface TaskCardProps
126
+ extends Omit<React.HTMLAttributes<HTMLElement>, "title" | "onSelect"> {
127
+ task: Task;
128
+ actions?: EthAction[];
129
+ onSelect?: (task: Task) => void;
130
+ }
131
+
132
+ export interface TaskTableProps extends Omit<SurfaceComponentProps, "children"> {
133
+ tasks?: Task[];
134
+ density?: EthDensity;
135
+ selectable?: boolean;
136
+ selectedRows?: React.Key[];
137
+ onSelectionChange?: (keys: React.Key[]) => void;
138
+ rowActions?: (task: Task) => EthAction[];
139
+ bulkActions?: BulkAction<Task>[];
140
+ columns?: DataColumn<Task>[];
141
+ showFilters?: boolean;
142
+ statusFilter?: EthOperationalStatus | "all";
143
+ onStatusFilterChange?: (status: EthOperationalStatus | "all") => void;
144
+ }
145
+
146
+ export interface TaskDetailPanelProps extends Omit<SurfaceComponentProps, "children"> {
147
+ task?: Task;
148
+ dependencies?: TaskDependency[];
149
+ events?: TaskTimelineEvent[];
150
+ actions?: EthAction[];
151
+ }
152
+
153
+ export interface TaskStatusBadgeProps
154
+ extends Omit<React.HTMLAttributes<HTMLSpanElement>, "children"> {
155
+ status: EthOperationalStatus;
156
+ label?: string;
157
+ }
158
+
159
+ export interface TaskProgressIndicatorProps
160
+ extends Omit<React.HTMLAttributes<HTMLDivElement>, "children"> {
161
+ value?: number;
162
+ total?: number;
163
+ steps?: TaskStep[];
164
+ label?: string;
165
+ }
166
+
167
+ export interface TaskDependencyListProps
168
+ extends Omit<React.HTMLAttributes<HTMLDivElement>, "children"> {
169
+ dependencies?: TaskDependency[];
170
+ blocks?: TaskDependency[];
171
+ blockedBy?: TaskDependency[];
172
+ emptyTitle?: React.ReactNode;
173
+ }
174
+
175
+ export interface TaskTimelineProps
176
+ extends Omit<React.HTMLAttributes<HTMLDivElement>, "children"> {
177
+ events?: TaskTimelineEvent[];
178
+ }
179
+
180
+ export interface TaskWaveHeaderProps extends Omit<SurfaceComponentProps, "children"> {
181
+ wave?: TaskWave;
182
+ actions?: EthAction[];
183
+ }
184
+
185
+ export interface TaskWaveTableProps extends Omit<SurfaceComponentProps, "children"> {
186
+ wave?: TaskWave;
187
+ tasks?: Task[];
188
+ onTaskSelect?: (task: Task) => void;
189
+ rowActions?: (task: Task) => EthAction[];
190
+ }
191
+
192
+ export interface TaskWaveDAGProps extends Omit<SurfaceComponentProps, "children"> {
193
+ nodes?: DAGNodeModel[];
194
+ edges?: DAGEdgeModel[];
195
+ layout?: "lr" | "tb";
196
+ onNodeSelect?: (node: DAGNodeModel) => void;
197
+ selectedNodeId?: string;
198
+ }
199
+
200
+ export interface DAGNodeProps
201
+ extends Omit<React.SVGAttributes<SVGGElement>, "children" | "onSelect"> {
202
+ node: PositionedDAGNode;
203
+ selected?: boolean;
204
+ onSelect?: (node: PositionedDAGNode) => void;
205
+ }
206
+
207
+ export interface DAGEdgeProps extends Omit<React.SVGAttributes<SVGPathElement>, "from" | "to"> {
208
+ from: { x: number; y: number };
209
+ to: { x: number; y: number };
210
+ status?: EthOperationalStatus;
211
+ label?: string;
212
+ }
213
+
214
+ export interface DAGLegendProps extends Omit<React.HTMLAttributes<HTMLDivElement>, "children"> {
215
+ statuses?: EthOperationalStatus[];
216
+ edgeTypes?: DAGEdgeLegendItem[];
217
+ }
218
+
219
+ export interface DecisionRequiredPanelProps extends Omit<SurfaceComponentProps, "children"> {
220
+ title: React.ReactNode;
221
+ summary?: React.ReactNode;
222
+ riskLevel?: RiskLevel;
223
+ evidence?: DecisionEvidence[];
224
+ options?: DecisionOption[];
225
+ onDecide?: (optionId: string) => void;
226
+ decidedOptionId?: string;
227
+ }
228
+
229
+ export interface TaskApprovalPanelProps extends Omit<SurfaceComponentProps, "children"> {
230
+ taskRef?: React.ReactNode;
231
+ diffRef?: React.ReactNode;
232
+ policyRef?: React.ReactNode;
233
+ summary?: React.ReactNode;
234
+ evidence?: DecisionEvidence[];
235
+ onApprove?: (reason: string) => void;
236
+ onReject?: (reason: string) => void;
237
+ onRequestChanges?: (reason: string) => void;
238
+ state?: "idle" | "pending" | "approved" | "rejected";
239
+ }
240
+
241
+ export interface BackendThinkingChainProps
242
+ extends Omit<React.HTMLAttributes<HTMLElement>, "children"> {
243
+ steps?: BackendThinkingStep[];
244
+ streaming?: boolean;
245
+ }
246
+
247
+ export interface HumanInterventionPanelProps extends Omit<SurfaceComponentProps, "children"> {
248
+ reason?: React.ReactNode;
249
+ affectedTask?: Pick<Task, "id" | "title">;
250
+ actions?: EthAction[];
251
+ urgency?: "low" | "medium" | "high";
252
+ }
253
+
254
+ export interface BlockingReasonPanelProps extends Omit<SurfaceComponentProps, "children"> {
255
+ blockers?: Array<{
256
+ id: string;
257
+ reason: React.ReactNode;
258
+ ownerActor?: string;
259
+ resolveAction?: EthAction;
260
+ }>;
261
+ }
262
+
263
+ export interface TaskHandoffPanelProps extends Omit<SurfaceComponentProps, "children"> {
264
+ assigneeOptions?: Array<{ id: string; label: string; kind: "user" | "team" | "agent" }>;
265
+ currentAssigneeId?: string;
266
+ onHandoff?: (toId: string, reason: string) => void;
267
+ reasonRequired?: boolean;
268
+ }
269
+
270
+ export interface TaskRunLogProps extends Omit<SurfaceComponentProps, "children"> {
271
+ entries?: TaskRunLogEntry[];
272
+ streaming?: boolean;
273
+ onPauseToggle?: () => void;
274
+ onFilter?: (level: TaskRunLogEntry["level"]) => void;
275
+ levelFilter?: string[];
276
+ windowSize?: number;
277
+ }
278
+
279
+ export interface TaskRetryPanelProps extends Omit<SurfaceComponentProps, "children"> {
280
+ taskRef?: React.ReactNode;
281
+ failureSummary?: React.ReactNode;
282
+ retryPolicy?: {
283
+ maxRetries: number;
284
+ backoff: "linear" | "exponential";
285
+ intervalMs: number;
286
+ };
287
+ attemptCount?: number;
288
+ onRetry?: (reason: string) => void;
289
+ }