@echothink-ui/agent 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 (56) hide show
  1. package/README.md +5 -0
  2. package/dist/components/AgentApprovalGate.d.ts +10 -0
  3. package/dist/components/AgentContextViewer.d.ts +7 -0
  4. package/dist/components/AgentGeneratedArtifactPanel.d.ts +8 -0
  5. package/dist/components/AgentHandoffPanel.d.ts +22 -0
  6. package/dist/components/AgentInterruptionPanel.d.ts +13 -0
  7. package/dist/components/AgentMemoryPanel.d.ts +9 -0
  8. package/dist/components/AgentMessageList.d.ts +8 -0
  9. package/dist/components/AgentPlanDiff.d.ts +7 -0
  10. package/dist/components/AgentPlanPreview.d.ts +6 -0
  11. package/dist/components/AgentPromptBox.d.ts +15 -0
  12. package/dist/components/AgentRunControls.d.ts +10 -0
  13. package/dist/components/AgentSafetyPanel.d.ts +6 -0
  14. package/dist/components/AgentStateBadge.d.ts +6 -0
  15. package/dist/components/AgentThinkingChain.d.ts +8 -0
  16. package/dist/components/AgentThinkingPanel.d.ts +8 -0
  17. package/dist/components/AgentToolCallLog.d.ts +7 -0
  18. package/dist/components/AgentTraceViewer.d.ts +6 -0
  19. package/dist/components/AppDomainAgentPanel.d.ts +17 -0
  20. package/dist/components/ChatAgentRail.d.ts +24 -0
  21. package/dist/components/ScopeAttachmentPanel.d.ts +7 -0
  22. package/dist/components/utils.d.ts +20 -0
  23. package/dist/index.cjs +2709 -0
  24. package/dist/index.cjs.map +1 -0
  25. package/dist/index.css +2433 -0
  26. package/dist/index.css.map +1 -0
  27. package/dist/index.d.ts +44 -0
  28. package/dist/index.js +2666 -0
  29. package/dist/index.js.map +1 -0
  30. package/dist/types.d.ts +128 -0
  31. package/package.json +45 -0
  32. package/src/components/AgentApprovalGate.tsx +165 -0
  33. package/src/components/AgentContextViewer.tsx +161 -0
  34. package/src/components/AgentGeneratedArtifactPanel.tsx +224 -0
  35. package/src/components/AgentHandoffPanel.tsx +154 -0
  36. package/src/components/AgentInterruptionPanel.tsx +85 -0
  37. package/src/components/AgentMemoryPanel.tsx +167 -0
  38. package/src/components/AgentMessageList.tsx +209 -0
  39. package/src/components/AgentPlanDiff.tsx +149 -0
  40. package/src/components/AgentPlanPreview.tsx +106 -0
  41. package/src/components/AgentPromptBox.tsx +163 -0
  42. package/src/components/AgentRunControls.tsx +221 -0
  43. package/src/components/AgentSafetyPanel.tsx +113 -0
  44. package/src/components/AgentStateBadge.tsx +30 -0
  45. package/src/components/AgentThinkingChain.tsx +151 -0
  46. package/src/components/AgentThinkingPanel.tsx +56 -0
  47. package/src/components/AgentToolCallLog.tsx +262 -0
  48. package/src/components/AgentTraceViewer.tsx +218 -0
  49. package/src/components/AppDomainAgentPanel.tsx +66 -0
  50. package/src/components/ChatAgentRail.tsx +192 -0
  51. package/src/components/ScopeAttachmentPanel.tsx +130 -0
  52. package/src/components/utils.ts +186 -0
  53. package/src/index.test.tsx +212 -0
  54. package/src/index.tsx +88 -0
  55. package/src/styles.css +2902 -0
  56. package/src/types.ts +158 -0
package/src/types.ts ADDED
@@ -0,0 +1,158 @@
1
+ import type * as React from "react";
2
+ import type {
3
+ EthOperationalStatus,
4
+ EthSeverity,
5
+ SurfaceComponentProps
6
+ } from "@echothink-ui/core";
7
+
8
+ export type AgentRunState =
9
+ | "idle"
10
+ | "listening"
11
+ | "thinking"
12
+ | "tool-calling"
13
+ | "waiting-for-user"
14
+ | "interrupted"
15
+ | "failed"
16
+ | "completed";
17
+
18
+ export interface AgentCitation {
19
+ id: string;
20
+ label: string;
21
+ description?: React.ReactNode;
22
+ meta?: React.ReactNode;
23
+ href?: string;
24
+ }
25
+
26
+ export interface AgentMessage {
27
+ id: string;
28
+ role: "user" | "agent" | "system" | "tool";
29
+ content: React.ReactNode;
30
+ status?: EthOperationalStatus;
31
+ createdAt: string;
32
+ citations?: AgentCitation[];
33
+ streaming?: boolean;
34
+ }
35
+
36
+ export interface ChatAgentRailAttachment {
37
+ id: string;
38
+ label: string;
39
+ kind: "file" | "resource" | "scope";
40
+ }
41
+
42
+ export interface AgentScopeAttachment {
43
+ id: string;
44
+ label: string;
45
+ kind: "project" | "resource" | "document" | "task" | "app-domain" | "scope";
46
+ status?: EthOperationalStatus;
47
+ }
48
+
49
+ export interface AgentStep {
50
+ id: string;
51
+ title: string;
52
+ status: EthOperationalStatus;
53
+ observation?: string;
54
+ action?: string;
55
+ blocker?: string;
56
+ durationMs?: number;
57
+ redacted?: boolean;
58
+ children?: AgentStep[];
59
+ }
60
+
61
+ export interface AgentTraceSpan {
62
+ id: string;
63
+ name: string;
64
+ startedAt: string;
65
+ durationMs: number;
66
+ status: EthOperationalStatus;
67
+ parentId?: string;
68
+ attributes?: Record<string, unknown>;
69
+ }
70
+
71
+ export interface AgentToolCall {
72
+ id: string;
73
+ toolName: string;
74
+ args?: unknown;
75
+ result?: unknown;
76
+ status: EthOperationalStatus;
77
+ startedAt: string;
78
+ durationMs?: number;
79
+ redacted?: boolean;
80
+ error?: string;
81
+ }
82
+
83
+ export interface AgentApprovalAction {
84
+ id: string;
85
+ label: string;
86
+ description: string;
87
+ riskLevel?: "low" | "medium" | "high" | "critical";
88
+ }
89
+
90
+ export interface AgentPlanStep {
91
+ id: string;
92
+ description: string;
93
+ durationEstimate?: string;
94
+ risks?: string[];
95
+ }
96
+
97
+ export interface AgentPlan {
98
+ id: string;
99
+ title: string;
100
+ steps: AgentPlanStep[];
101
+ assumptions?: string[];
102
+ risks?: string[];
103
+ }
104
+
105
+ export interface AgentMemoryEntry {
106
+ id: string;
107
+ kind: "user" | "project" | "feedback" | "reference";
108
+ key: string;
109
+ value: React.ReactNode;
110
+ lastUpdatedAt?: string;
111
+ pinned?: boolean;
112
+ }
113
+
114
+ export interface AgentContextSource {
115
+ id: string;
116
+ label: string;
117
+ type: "document" | "message" | "query" | "tool-result";
118
+ href?: string;
119
+ excerpt?: string;
120
+ relevance?: number;
121
+ }
122
+
123
+ export interface AgentSafetyCheck {
124
+ id: string;
125
+ label: string;
126
+ status: "pass" | "warn" | "fail";
127
+ details?: string;
128
+ }
129
+
130
+ export interface AgentHandoffTarget {
131
+ id: string;
132
+ label: string;
133
+ type: "human" | "team" | "agent";
134
+ description?: string;
135
+ status?: EthOperationalStatus;
136
+ }
137
+
138
+ export interface AgentGeneratedArtifact {
139
+ id: string;
140
+ label: string;
141
+ kind: "file" | "doc" | "chart" | "image" | "code";
142
+ size?: string;
143
+ createdAt: string;
144
+ previewUrl?: string;
145
+ href?: string;
146
+ mimeType?: string;
147
+ content?: string;
148
+ }
149
+
150
+ export interface AgentDiffItem {
151
+ id: string;
152
+ before?: AgentPlanStep;
153
+ after?: AgentPlanStep;
154
+ status: "added" | "removed" | "modified" | "unchanged";
155
+ severity: EthSeverity;
156
+ }
157
+
158
+ export type AgentComponentSurfaceProps = SurfaceComponentProps;