@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/README.md ADDED
@@ -0,0 +1,5 @@
1
+ # @echothink-ui/agent
2
+
3
+ Agent package for EchoThink app-domain websites.
4
+
5
+ This package is part of the EchoThink-UI app-domain library. It is designed for normal website app domains rendered inside EchoThink Studio's Chromium shell, not for implementing the studio browser chrome itself.
@@ -0,0 +1,10 @@
1
+ import type { SurfaceComponentProps } from "@echothink-ui/core";
2
+ import type { AgentApprovalAction, AgentCitation } from "../types";
3
+ export interface AgentApprovalGateProps extends Omit<SurfaceComponentProps, "children"> {
4
+ action: AgentApprovalAction;
5
+ evidence?: AgentCitation[];
6
+ onApprove?: (reason?: string) => void;
7
+ onReject?: (reason?: string) => void;
8
+ state?: "idle" | "pending" | "approved" | "rejected";
9
+ }
10
+ export declare function AgentApprovalGate({ action, evidence, onApprove, onReject, state, title, className, ...props }: AgentApprovalGateProps): import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1,7 @@
1
+ import type { SurfaceComponentProps } from "@echothink-ui/core";
2
+ import type { AgentContextSource } from "../types";
3
+ export interface AgentContextViewerProps extends Omit<SurfaceComponentProps, "children" | "onSelect"> {
4
+ sources: AgentContextSource[];
5
+ onSelect?: (source: AgentContextSource) => void;
6
+ }
7
+ export declare function AgentContextViewer({ sources, onSelect, title, className, ...props }: AgentContextViewerProps): import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1,8 @@
1
+ import type { SurfaceComponentProps } from "@echothink-ui/core";
2
+ import type { AgentGeneratedArtifact } from "../types";
3
+ export interface AgentGeneratedArtifactPanelProps extends Omit<SurfaceComponentProps, "children" | "onSelect"> {
4
+ artifacts: AgentGeneratedArtifact[];
5
+ onSelect?: (artifact: AgentGeneratedArtifact) => void;
6
+ selectedId?: string;
7
+ }
8
+ export declare function AgentGeneratedArtifactPanel({ artifacts, onSelect, selectedId, density, title, className, ...props }: AgentGeneratedArtifactPanelProps): import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1,22 @@
1
+ import type { SurfaceComponentProps } from "@echothink-ui/core";
2
+ import type { AgentHandoffTarget } from "../types";
3
+ export interface AgentHandoffPanelProps extends Omit<SurfaceComponentProps, "children" | "onChange" | "onSubmit"> {
4
+ itemRef?: string;
5
+ agentRef?: string;
6
+ assigneeOptions?: AgentHandoffTarget[];
7
+ selectedAssigneeId?: string;
8
+ reason?: string;
9
+ reasonSchema?: {
10
+ label?: string;
11
+ placeholder?: string;
12
+ required?: boolean;
13
+ };
14
+ disabled?: boolean;
15
+ onAssigneeChange?: (id: string) => void;
16
+ onReasonChange?: (reason: string) => void;
17
+ onSubmit?: (handoff: {
18
+ assigneeId?: string;
19
+ reason: string;
20
+ }) => void;
21
+ }
22
+ export declare function AgentHandoffPanel({ itemRef, agentRef, assigneeOptions, selectedAssigneeId, reason, reasonSchema, disabled, onAssigneeChange, onReasonChange, onSubmit, title, className, ...props }: AgentHandoffPanelProps): import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1,13 @@
1
+ import * as React from "react";
2
+ import type { SurfaceComponentProps } from "@echothink-ui/core";
3
+ export interface AgentInterruptionPanelProps extends Omit<SurfaceComponentProps, "children" | "onChange" | "onSubmit"> {
4
+ prompt: string;
5
+ onChange: (prompt: string) => void;
6
+ onSubmit?: (prompt: string) => void;
7
+ disabled?: boolean;
8
+ promptLabel?: React.ReactNode;
9
+ helperText?: React.ReactNode;
10
+ placeholder?: string;
11
+ submitLabel?: React.ReactNode;
12
+ }
13
+ export declare function AgentInterruptionPanel({ prompt, onChange, onSubmit, disabled, title, subtitle, metadata, promptLabel, helperText, placeholder, submitLabel, className, ...props }: AgentInterruptionPanelProps): import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1,9 @@
1
+ import type { SurfaceComponentProps } from "@echothink-ui/core";
2
+ import type { AgentMemoryEntry } from "../types";
3
+ export interface AgentMemoryPanelProps extends Omit<SurfaceComponentProps, "children"> {
4
+ entries: AgentMemoryEntry[];
5
+ onPin?: (id: string) => void;
6
+ onEdit?: (id: string) => void;
7
+ onDelete?: (id: string) => void;
8
+ }
9
+ export declare function AgentMemoryPanel({ entries, onPin, onEdit, onDelete, title, subtitle, className, ...props }: AgentMemoryPanelProps): import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1,8 @@
1
+ import * as React from "react";
2
+ import type { AgentMessage } from "../types";
3
+ export interface AgentMessageListProps extends Omit<React.HTMLAttributes<HTMLDivElement>, "children"> {
4
+ messages: AgentMessage[];
5
+ streaming?: boolean;
6
+ autoScroll?: boolean;
7
+ }
8
+ export declare function AgentMessageList({ messages, streaming, autoScroll, className, style, ...props }: AgentMessageListProps): import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1,7 @@
1
+ import type { SurfaceComponentProps } from "@echothink-ui/core";
2
+ import type { AgentPlanStep } from "../types";
3
+ export interface AgentPlanDiffProps extends Omit<SurfaceComponentProps, "children"> {
4
+ before: AgentPlanStep[];
5
+ after: AgentPlanStep[];
6
+ }
7
+ export declare function AgentPlanDiff({ before, after, title, subtitle, className, ...props }: AgentPlanDiffProps): import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1,6 @@
1
+ import type { SurfaceComponentProps } from "@echothink-ui/core";
2
+ import type { AgentPlan } from "../types";
3
+ export interface AgentPlanPreviewProps extends Omit<SurfaceComponentProps, "children"> {
4
+ plan: AgentPlan;
5
+ }
6
+ export declare function AgentPlanPreview({ plan, title, className, ...props }: AgentPlanPreviewProps): import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1,15 @@
1
+ import * as React from "react";
2
+ import type { AgentScopeAttachment } from "../types";
3
+ export interface AgentPromptBoxProps extends Omit<React.FormHTMLAttributes<HTMLFormElement>, "children" | "onChange" | "onSubmit"> {
4
+ value: string;
5
+ onChange: (value: string) => void;
6
+ onSubmit?: (value: string) => void;
7
+ placeholder?: string;
8
+ disabled?: boolean;
9
+ scopeLabel?: React.ReactNode;
10
+ attachments?: AgentScopeAttachment[];
11
+ onAttach?: () => void;
12
+ onAttachmentRemove?: (id: string) => void;
13
+ onSlash?: () => void;
14
+ }
15
+ export declare function AgentPromptBox({ value, onChange, onSubmit, placeholder, disabled, scopeLabel, attachments, onAttach, onAttachmentRemove, onSlash, className, style, ...props }: AgentPromptBoxProps): import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1,10 @@
1
+ import * as React from "react";
2
+ export interface AgentRunControlsProps extends Omit<React.HTMLAttributes<HTMLElement>, "children" | "onChange"> {
3
+ state: "running" | "paused" | "stopped" | "failed" | "completed";
4
+ onPause?: () => void;
5
+ onResume?: () => void;
6
+ onStop?: () => void;
7
+ onRetry?: () => void;
8
+ onInterrupt?: (reason: string) => void;
9
+ }
10
+ export declare function AgentRunControls({ state, onPause, onResume, onStop, onRetry, onInterrupt, className, style, "aria-label": ariaLabel, "aria-describedby": ariaDescribedBy, ...props }: AgentRunControlsProps): import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1,6 @@
1
+ import type { SurfaceComponentProps } from "@echothink-ui/core";
2
+ import type { AgentSafetyCheck } from "../types";
3
+ export interface AgentSafetyPanelProps extends Omit<SurfaceComponentProps, "children"> {
4
+ checks: AgentSafetyCheck[];
5
+ }
6
+ export declare function AgentSafetyPanel({ checks, title, subtitle, className, ...props }: AgentSafetyPanelProps): import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1,6 @@
1
+ import * as React from "react";
2
+ import type { AgentRunState } from "../types";
3
+ export interface AgentStateBadgeProps extends React.HTMLAttributes<HTMLSpanElement> {
4
+ state?: AgentRunState;
5
+ }
6
+ export declare function AgentStateBadge({ state, className, ...props }: AgentStateBadgeProps): import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1,8 @@
1
+ import type { SurfaceComponentProps } from "@echothink-ui/core";
2
+ import type { AgentStep } from "../types";
3
+ export interface AgentThinkingChainProps extends Omit<SurfaceComponentProps, "children"> {
4
+ steps: AgentStep[];
5
+ streaming?: boolean;
6
+ redactionPolicy?: string;
7
+ }
8
+ export declare function AgentThinkingChain({ steps, streaming, redactionPolicy, title, className, ...props }: AgentThinkingChainProps): import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1,8 @@
1
+ import type { SurfaceComponentProps } from "@echothink-ui/core";
2
+ export interface AgentThinkingPanelProps extends Omit<SurfaceComponentProps, "children"> {
3
+ currentStep?: string;
4
+ summary?: string;
5
+ progress?: number;
6
+ lastUpdatedAt?: string;
7
+ }
8
+ export declare function AgentThinkingPanel({ currentStep, summary, progress, lastUpdatedAt, title, subtitle, metadata, className, ...props }: AgentThinkingPanelProps): import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1,7 @@
1
+ import type { SurfaceComponentProps } from "@echothink-ui/core";
2
+ import type { AgentToolCall } from "../types";
3
+ export interface AgentToolCallLogProps extends Omit<SurfaceComponentProps, "children" | "onSelect"> {
4
+ calls: AgentToolCall[];
5
+ onSelect?: (call: AgentToolCall) => void;
6
+ }
7
+ export declare function AgentToolCallLog({ calls, onSelect, title, subtitle, className, ...props }: AgentToolCallLogProps): import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1,6 @@
1
+ import type { SurfaceComponentProps } from "@echothink-ui/core";
2
+ import type { AgentTraceSpan } from "../types";
3
+ export interface AgentTraceViewerProps extends Omit<SurfaceComponentProps, "children"> {
4
+ spans: AgentTraceSpan[];
5
+ }
6
+ export declare function AgentTraceViewer({ spans, title, className, ...props }: AgentTraceViewerProps): import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1,17 @@
1
+ import * as React from "react";
2
+ import type { AgentMessage, AgentRunState, ChatAgentRailAttachment } from "../types";
3
+ export interface AppDomainAgentPanelProps extends Omit<React.HTMLAttributes<HTMLElement>, "children" | "onSubmit"> {
4
+ appDomainRef: string;
5
+ agentRef?: string;
6
+ projectRef?: string;
7
+ messages?: AgentMessage[];
8
+ state?: AgentRunState;
9
+ prompt?: string;
10
+ onPromptChange?: (value: string) => void;
11
+ onSubmit?: (prompt: string, attachments?: ChatAgentRailAttachment[]) => void;
12
+ attachments?: ChatAgentRailAttachment[];
13
+ onAttachmentRemove?: (id: string) => void;
14
+ runControls?: React.ReactNode;
15
+ children?: React.ReactNode;
16
+ }
17
+ export declare function AppDomainAgentPanel({ appDomainRef, agentRef, projectRef, messages, state, prompt, onPromptChange, onSubmit, attachments, onAttachmentRemove, runControls, children, ...props }: AppDomainAgentPanelProps): import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1,24 @@
1
+ import * as React from "react";
2
+ import type { AgentMessage, AgentRunState, ChatAgentRailAttachment } from "../types";
3
+ export interface ChatAgentRailProps extends Omit<React.HTMLAttributes<HTMLElement>, "children" | "onSubmit"> {
4
+ agentRef?: string;
5
+ projectRef?: string;
6
+ messages: AgentMessage[];
7
+ state?: AgentRunState;
8
+ prompt: string;
9
+ onPromptChange: (value: string) => void;
10
+ onSubmit?: (prompt: string, attachments?: ChatAgentRailAttachment[]) => void;
11
+ attachments?: ChatAgentRailAttachment[];
12
+ onAttachmentRemove?: (id: string) => void;
13
+ onAttach?: () => void;
14
+ onSlash?: () => void;
15
+ autoScroll?: boolean;
16
+ runControls?: React.ReactNode;
17
+ header?: React.ReactNode;
18
+ scopeLabel?: React.ReactNode;
19
+ width?: number | string;
20
+ }
21
+ export interface LeftAgentRailProps extends ChatAgentRailProps {
22
+ }
23
+ export declare function ChatAgentRail(props: ChatAgentRailProps): import("react/jsx-runtime").JSX.Element;
24
+ export declare function LeftAgentRail(props: LeftAgentRailProps): import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1,7 @@
1
+ import type { SurfaceComponentProps } from "@echothink-ui/core";
2
+ import type { AgentScopeAttachment } from "../types";
3
+ export interface ScopeAttachmentPanelProps extends Omit<SurfaceComponentProps, "children" | "items" | "metadata"> {
4
+ attachments: AgentScopeAttachment[];
5
+ onRemove?: (id: string) => void;
6
+ }
7
+ export declare function ScopeAttachmentPanel({ attachments, onRemove, title, subtitle, severity, className, ...props }: ScopeAttachmentPanelProps): import("react/jsx-runtime").JSX.Element | null;
@@ -0,0 +1,20 @@
1
+ import type * as React from "react";
2
+ import type { EthOperationalStatus, EthSeverity } from "@echothink-ui/core";
3
+ import type { AgentDiffItem, AgentPlanStep, AgentRunState, AgentSafetyCheck } from "../types";
4
+ export declare const EMPTY_MARK = "\u2014";
5
+ export declare function formatDateTime(value: string): string;
6
+ export declare function formatTime(value: string): string;
7
+ export declare function formatDuration(durationMs?: number): string;
8
+ export declare function jsonPreview(value: unknown, redacted?: boolean, maxLength?: number): string;
9
+ export declare function prettyJson(value: unknown, redacted?: boolean): string;
10
+ export declare function stateLabel(state: AgentRunState): "Idle" | "Listening" | "Thinking" | "Calling tools" | "Waiting for user" | "Interrupted" | "Failed" | "Completed";
11
+ export declare function stateSeverity(state: AgentRunState): EthSeverity;
12
+ export declare function stateStatus(state: AgentRunState): EthOperationalStatus;
13
+ export declare function isActiveAgentState(state: AgentRunState): state is "listening" | "thinking" | "tool-calling";
14
+ export declare function statusSeverity(status: EthOperationalStatus): EthSeverity;
15
+ export declare function riskSeverity(riskLevel?: "low" | "medium" | "high" | "critical"): "warning" | "info" | "danger";
16
+ export declare function safetyStatus(check: AgentSafetyCheck): EthOperationalStatus;
17
+ export declare function safetySeverity(check: AgentSafetyCheck): EthSeverity;
18
+ export declare function mergeStyle(base: React.CSSProperties, incoming?: React.CSSProperties): React.CSSProperties;
19
+ export declare function diffPlanSteps(before: AgentPlanStep[], after: AgentPlanStep[]): AgentDiffItem[];
20
+ export declare const visuallyHiddenStyle: React.CSSProperties;