aether-react 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.
- package/dist/index.d.ts +159 -0
- package/dist/index.js +2056 -0
- package/dist/index.js.map +1 -0
- package/package.json +57 -0
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1,159 @@
|
|
|
1
|
+
import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
2
|
+
import React from 'react';
|
|
3
|
+
import { Aether, MemoryEvent, RetrievalOptions, RetrievalType, MemoryStats } from 'aether-core';
|
|
4
|
+
|
|
5
|
+
interface AetherContextValue {
|
|
6
|
+
aether: Aether | null;
|
|
7
|
+
events: MemoryEvent[];
|
|
8
|
+
loading: boolean;
|
|
9
|
+
error: Error | null;
|
|
10
|
+
add: (content: string, context?: Record<string, unknown>) => Promise<MemoryEvent | null>;
|
|
11
|
+
retrieve: (query: string, options?: RetrievalOptions) => Promise<MemoryEvent[]>;
|
|
12
|
+
refresh: () => Promise<void>;
|
|
13
|
+
clearEvents: () => void;
|
|
14
|
+
}
|
|
15
|
+
interface AetherProviderProps {
|
|
16
|
+
aether: Aether;
|
|
17
|
+
children: React.ReactNode;
|
|
18
|
+
/** Initial actor to load history for */
|
|
19
|
+
initialActor?: string;
|
|
20
|
+
/** Auto-subscribe to new events */
|
|
21
|
+
autoSubscribe?: boolean;
|
|
22
|
+
}
|
|
23
|
+
declare function AetherProvider({ aether, children, initialActor, autoSubscribe, }: AetherProviderProps): react_jsx_runtime.JSX.Element;
|
|
24
|
+
declare function useAether(): AetherContextValue;
|
|
25
|
+
|
|
26
|
+
interface WebSocketMessage {
|
|
27
|
+
type: string;
|
|
28
|
+
data?: unknown;
|
|
29
|
+
}
|
|
30
|
+
interface UseMemoryStreamOptions {
|
|
31
|
+
/** Auto-connect on mount */
|
|
32
|
+
autoConnect?: boolean;
|
|
33
|
+
/** Reconnect on disconnect */
|
|
34
|
+
autoReconnect?: boolean;
|
|
35
|
+
/** Max reconnect attempts */
|
|
36
|
+
maxReconnectAttempts?: number;
|
|
37
|
+
/** Reconnect delay in ms */
|
|
38
|
+
reconnectDelay?: number;
|
|
39
|
+
}
|
|
40
|
+
interface UseMemoryStreamReturn {
|
|
41
|
+
events: MemoryEvent[];
|
|
42
|
+
connected: boolean;
|
|
43
|
+
error: Error | null;
|
|
44
|
+
connect: () => void;
|
|
45
|
+
disconnect: () => void;
|
|
46
|
+
send: (message: WebSocketMessage) => void;
|
|
47
|
+
clearEvents: () => void;
|
|
48
|
+
}
|
|
49
|
+
declare function useMemoryStream(serverUrl: string, options?: UseMemoryStreamOptions): UseMemoryStreamReturn;
|
|
50
|
+
|
|
51
|
+
interface MemoryGraphViewProps {
|
|
52
|
+
events: MemoryEvent[];
|
|
53
|
+
width?: number;
|
|
54
|
+
height?: number;
|
|
55
|
+
onNodeClick?: (event: MemoryEvent) => void;
|
|
56
|
+
highlightActor?: string;
|
|
57
|
+
showRelations?: boolean;
|
|
58
|
+
className?: string;
|
|
59
|
+
}
|
|
60
|
+
declare function MemoryGraphView({ events, width, height, onNodeClick, highlightActor, showRelations, className, }: MemoryGraphViewProps): react_jsx_runtime.JSX.Element;
|
|
61
|
+
|
|
62
|
+
interface TimelineViewProps {
|
|
63
|
+
events: MemoryEvent[];
|
|
64
|
+
onEventClick?: (event: MemoryEvent) => void;
|
|
65
|
+
selectedEventId?: string;
|
|
66
|
+
showContext?: boolean;
|
|
67
|
+
groupBy?: 'none' | 'day' | 'actor';
|
|
68
|
+
maxHeight?: string | number;
|
|
69
|
+
className?: string;
|
|
70
|
+
}
|
|
71
|
+
declare function TimelineView({ events, onEventClick, selectedEventId, showContext, groupBy, maxHeight, className, }: TimelineViewProps): react_jsx_runtime.JSX.Element;
|
|
72
|
+
|
|
73
|
+
interface ClusterMapProps {
|
|
74
|
+
events: MemoryEvent[];
|
|
75
|
+
width?: number;
|
|
76
|
+
height?: number;
|
|
77
|
+
onEventClick?: (event: MemoryEvent) => void;
|
|
78
|
+
colorBy?: 'actor' | 'action';
|
|
79
|
+
className?: string;
|
|
80
|
+
}
|
|
81
|
+
/**
|
|
82
|
+
* ClusterMap visualizes events in a 2D space based on their embeddings.
|
|
83
|
+
* Note: Full t-SNE/UMAP implementation requires additional dependencies.
|
|
84
|
+
* This is a simplified version that uses a basic layout.
|
|
85
|
+
*/
|
|
86
|
+
declare function ClusterMap({ events, width, height, onEventClick, colorBy, className, }: ClusterMapProps): react_jsx_runtime.JSX.Element;
|
|
87
|
+
|
|
88
|
+
interface MemoryExplorerProps {
|
|
89
|
+
events: MemoryEvent[];
|
|
90
|
+
onEventClick?: (event: MemoryEvent) => void;
|
|
91
|
+
defaultView?: 'timeline' | 'graph' | 'cluster';
|
|
92
|
+
showViewSwitcher?: boolean;
|
|
93
|
+
className?: string;
|
|
94
|
+
}
|
|
95
|
+
declare function MemoryExplorer({ events, onEventClick, defaultView, showViewSwitcher, className, }: MemoryExplorerProps): react_jsx_runtime.JSX.Element;
|
|
96
|
+
|
|
97
|
+
interface MemoryCardProps {
|
|
98
|
+
event: MemoryEvent;
|
|
99
|
+
onClick?: (event: MemoryEvent) => void;
|
|
100
|
+
selected?: boolean;
|
|
101
|
+
showContext?: boolean;
|
|
102
|
+
className?: string;
|
|
103
|
+
}
|
|
104
|
+
declare function MemoryCard({ event, onClick, selected, showContext, className, }: MemoryCardProps): react_jsx_runtime.JSX.Element;
|
|
105
|
+
|
|
106
|
+
interface AddMemoryFormProps {
|
|
107
|
+
onAdd: (content: string, actor: string, context?: Record<string, unknown>) => Promise<void>;
|
|
108
|
+
loading?: boolean;
|
|
109
|
+
defaultActor?: string;
|
|
110
|
+
placeholder?: string;
|
|
111
|
+
className?: string;
|
|
112
|
+
}
|
|
113
|
+
declare function AddMemoryForm({ onAdd, loading, defaultActor, placeholder, className, }: AddMemoryFormProps): react_jsx_runtime.JSX.Element;
|
|
114
|
+
|
|
115
|
+
interface SearchBarProps {
|
|
116
|
+
onSearch: (query: string, options: SearchOptions) => Promise<void>;
|
|
117
|
+
loading?: boolean;
|
|
118
|
+
placeholder?: string;
|
|
119
|
+
className?: string;
|
|
120
|
+
}
|
|
121
|
+
interface SearchOptions {
|
|
122
|
+
retrievalType: RetrievalType;
|
|
123
|
+
limit: number;
|
|
124
|
+
actor?: string;
|
|
125
|
+
}
|
|
126
|
+
declare function SearchBar({ onSearch, loading, placeholder, className, }: SearchBarProps): react_jsx_runtime.JSX.Element;
|
|
127
|
+
|
|
128
|
+
interface StatsPanelProps {
|
|
129
|
+
stats: MemoryStats | null;
|
|
130
|
+
loading?: boolean;
|
|
131
|
+
className?: string;
|
|
132
|
+
}
|
|
133
|
+
declare function StatsPanel({ stats, loading, className }: StatsPanelProps): react_jsx_runtime.JSX.Element;
|
|
134
|
+
|
|
135
|
+
interface ActorSelectorProps {
|
|
136
|
+
actors: string[];
|
|
137
|
+
selectedActor: string | null;
|
|
138
|
+
onSelect: (actor: string | null) => void;
|
|
139
|
+
loading?: boolean;
|
|
140
|
+
className?: string;
|
|
141
|
+
}
|
|
142
|
+
declare function ActorSelector({ actors, selectedActor, onSelect, loading, className, }: ActorSelectorProps): react_jsx_runtime.JSX.Element;
|
|
143
|
+
|
|
144
|
+
interface ConnectionStatusProps {
|
|
145
|
+
connected: boolean;
|
|
146
|
+
error?: Error | null;
|
|
147
|
+
onReconnect?: () => void;
|
|
148
|
+
className?: string;
|
|
149
|
+
}
|
|
150
|
+
declare function ConnectionStatus({ connected, error, onReconnect, className, }: ConnectionStatusProps): react_jsx_runtime.JSX.Element;
|
|
151
|
+
|
|
152
|
+
interface DashboardProps {
|
|
153
|
+
aether: Aether;
|
|
154
|
+
title?: string;
|
|
155
|
+
className?: string;
|
|
156
|
+
}
|
|
157
|
+
declare function Dashboard({ aether, title, className }: DashboardProps): react_jsx_runtime.JSX.Element;
|
|
158
|
+
|
|
159
|
+
export { ActorSelector, type ActorSelectorProps, AddMemoryForm, type AddMemoryFormProps, AetherProvider, ClusterMap, type ClusterMapProps, ConnectionStatus, type ConnectionStatusProps, Dashboard, type DashboardProps, MemoryCard, type MemoryCardProps, MemoryExplorer, type MemoryExplorerProps, MemoryGraphView, type MemoryGraphViewProps, SearchBar, type SearchBarProps, type SearchOptions, StatsPanel, type StatsPanelProps, TimelineView, type TimelineViewProps, useAether, useMemoryStream };
|