@rickydata/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.cjs +968 -0
- package/dist/index.d.cts +603 -0
- package/dist/index.d.ts +603 -0
- package/dist/index.js +917 -0
- package/package.json +36 -0
package/dist/index.d.cts
ADDED
|
@@ -0,0 +1,603 @@
|
|
|
1
|
+
import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
2
|
+
import { ReactNode } from 'react';
|
|
3
|
+
import { AgentClient, AgentDetailResponse, AgentInfo, WalletBalanceResponse, WalletTransactionsResponse, SessionDetail, SessionListEntry, WalletSettings } from 'rickydata/agent';
|
|
4
|
+
export { AgentClientConfig, AgentDetailResponse, AgentInfo, SSEEvent, SessionDetail, SessionListEntry, WalletBalanceResponse, WalletSettings } from 'rickydata/agent';
|
|
5
|
+
import * as _tanstack_react_query from '@tanstack/react-query';
|
|
6
|
+
import * as _tanstack_query_core from '@tanstack/query-core';
|
|
7
|
+
|
|
8
|
+
interface RickyDataProviderProps {
|
|
9
|
+
/** Config to auto-create an AgentClient. Provide `getAuthToken` for browser use. */
|
|
10
|
+
config?: {
|
|
11
|
+
gatewayUrl?: string;
|
|
12
|
+
getAuthToken: () => Promise<string | undefined>;
|
|
13
|
+
};
|
|
14
|
+
/** Pre-built client (for testing/mocks). Mutually exclusive with `config`. */
|
|
15
|
+
client?: AgentClient;
|
|
16
|
+
children: ReactNode;
|
|
17
|
+
}
|
|
18
|
+
/**
|
|
19
|
+
* Provides an `AgentClient` instance to all descendant hooks and components.
|
|
20
|
+
*
|
|
21
|
+
* Usage:
|
|
22
|
+
* ```tsx
|
|
23
|
+
* <RickyDataProvider config={{ getAuthToken: () => getToken() }}>
|
|
24
|
+
* <App />
|
|
25
|
+
* </RickyDataProvider>
|
|
26
|
+
* ```
|
|
27
|
+
*/
|
|
28
|
+
declare function RickyDataProvider({ config, client, children }: RickyDataProviderProps): react_jsx_runtime.JSX.Element;
|
|
29
|
+
/**
|
|
30
|
+
* Access the AgentClient from context. Throws if used outside `<RickyDataProvider>`.
|
|
31
|
+
*/
|
|
32
|
+
declare function useRickyData(): AgentClient;
|
|
33
|
+
|
|
34
|
+
declare const agentKeys: {
|
|
35
|
+
all: readonly ["agents"];
|
|
36
|
+
lists: () => readonly ["agents", "list"];
|
|
37
|
+
details: () => readonly ["agents", "detail"];
|
|
38
|
+
detail: (id: string) => readonly ["agents", "detail", string];
|
|
39
|
+
};
|
|
40
|
+
/** Fetch all published agents. */
|
|
41
|
+
declare function useAgents(): _tanstack_react_query.UseQueryResult<AgentInfo[], Error>;
|
|
42
|
+
/** Fetch a single agent's detail (tools, skills). */
|
|
43
|
+
declare function useAgent(agentId: string | undefined): _tanstack_react_query.UseQueryResult<AgentDetailResponse, Error>;
|
|
44
|
+
|
|
45
|
+
declare const apiKeyKeys: {
|
|
46
|
+
all: readonly ["apikey"];
|
|
47
|
+
status: () => readonly ["apikey", "status"];
|
|
48
|
+
openai: () => readonly ["apikey", "openai"];
|
|
49
|
+
};
|
|
50
|
+
/** Check if Anthropic API key is configured. */
|
|
51
|
+
declare function useApiKeyStatus(): _tanstack_react_query.UseQueryResult<{
|
|
52
|
+
configured: boolean;
|
|
53
|
+
}, Error>;
|
|
54
|
+
/** Mutation to set the Anthropic API key. Invalidates status on success. */
|
|
55
|
+
declare function useSetApiKey(): _tanstack_react_query.UseMutationResult<{
|
|
56
|
+
configured: boolean;
|
|
57
|
+
}, Error, string, unknown>;
|
|
58
|
+
/** Mutation to delete the Anthropic API key. */
|
|
59
|
+
declare function useDeleteApiKey(): _tanstack_react_query.UseMutationResult<void, Error, void, unknown>;
|
|
60
|
+
/** Check if OpenAI API key is configured. */
|
|
61
|
+
declare function useOpenAIApiKeyStatus(): _tanstack_react_query.UseQueryResult<{
|
|
62
|
+
configured: boolean;
|
|
63
|
+
}, Error>;
|
|
64
|
+
/** Mutation to set the OpenAI API key. */
|
|
65
|
+
declare function useSetOpenAIApiKey(): _tanstack_react_query.UseMutationResult<{
|
|
66
|
+
configured: boolean;
|
|
67
|
+
}, Error, string, unknown>;
|
|
68
|
+
|
|
69
|
+
declare const balanceKeys: {
|
|
70
|
+
all: readonly ["wallet-balance"];
|
|
71
|
+
balance: () => readonly ["wallet-balance", "balance"];
|
|
72
|
+
transactions: (limit?: number, offset?: number) => readonly ["wallet-balance", "transactions", {
|
|
73
|
+
readonly limit: number | undefined;
|
|
74
|
+
readonly offset: number | undefined;
|
|
75
|
+
}];
|
|
76
|
+
};
|
|
77
|
+
interface UseWalletBalanceOptions {
|
|
78
|
+
enabled?: boolean;
|
|
79
|
+
/** Stale time in ms. Defaults to 60s. */
|
|
80
|
+
staleTime?: number;
|
|
81
|
+
}
|
|
82
|
+
/** Fetch wallet balance with formatted display value. */
|
|
83
|
+
declare function useWalletBalance(opts?: UseWalletBalanceOptions): {
|
|
84
|
+
balance: string;
|
|
85
|
+
balanceDisplay: string;
|
|
86
|
+
depositAddress: string | undefined;
|
|
87
|
+
agentSpends: Record<string, {
|
|
88
|
+
totalSpent: string;
|
|
89
|
+
}> | undefined;
|
|
90
|
+
refresh: () => Promise<_tanstack_query_core.QueryObserverResult<WalletBalanceResponse, Error>>;
|
|
91
|
+
data: WalletBalanceResponse;
|
|
92
|
+
error: Error;
|
|
93
|
+
isError: true;
|
|
94
|
+
isPending: false;
|
|
95
|
+
isLoading: false;
|
|
96
|
+
isLoadingError: false;
|
|
97
|
+
isRefetchError: true;
|
|
98
|
+
isSuccess: false;
|
|
99
|
+
isPlaceholderData: false;
|
|
100
|
+
status: "error";
|
|
101
|
+
dataUpdatedAt: number;
|
|
102
|
+
errorUpdatedAt: number;
|
|
103
|
+
failureCount: number;
|
|
104
|
+
failureReason: Error | null;
|
|
105
|
+
errorUpdateCount: number;
|
|
106
|
+
isFetched: boolean;
|
|
107
|
+
isFetchedAfterMount: boolean;
|
|
108
|
+
isFetching: boolean;
|
|
109
|
+
isInitialLoading: boolean;
|
|
110
|
+
isPaused: boolean;
|
|
111
|
+
isRefetching: boolean;
|
|
112
|
+
isStale: boolean;
|
|
113
|
+
isEnabled: boolean;
|
|
114
|
+
refetch: (options?: _tanstack_query_core.RefetchOptions) => Promise<_tanstack_query_core.QueryObserverResult<WalletBalanceResponse, Error>>;
|
|
115
|
+
fetchStatus: _tanstack_query_core.FetchStatus;
|
|
116
|
+
promise: Promise<WalletBalanceResponse>;
|
|
117
|
+
} | {
|
|
118
|
+
balance: string;
|
|
119
|
+
balanceDisplay: string;
|
|
120
|
+
depositAddress: string | undefined;
|
|
121
|
+
agentSpends: Record<string, {
|
|
122
|
+
totalSpent: string;
|
|
123
|
+
}> | undefined;
|
|
124
|
+
refresh: () => Promise<_tanstack_query_core.QueryObserverResult<WalletBalanceResponse, Error>>;
|
|
125
|
+
data: WalletBalanceResponse;
|
|
126
|
+
error: null;
|
|
127
|
+
isError: false;
|
|
128
|
+
isPending: false;
|
|
129
|
+
isLoading: false;
|
|
130
|
+
isLoadingError: false;
|
|
131
|
+
isRefetchError: false;
|
|
132
|
+
isSuccess: true;
|
|
133
|
+
isPlaceholderData: false;
|
|
134
|
+
status: "success";
|
|
135
|
+
dataUpdatedAt: number;
|
|
136
|
+
errorUpdatedAt: number;
|
|
137
|
+
failureCount: number;
|
|
138
|
+
failureReason: Error | null;
|
|
139
|
+
errorUpdateCount: number;
|
|
140
|
+
isFetched: boolean;
|
|
141
|
+
isFetchedAfterMount: boolean;
|
|
142
|
+
isFetching: boolean;
|
|
143
|
+
isInitialLoading: boolean;
|
|
144
|
+
isPaused: boolean;
|
|
145
|
+
isRefetching: boolean;
|
|
146
|
+
isStale: boolean;
|
|
147
|
+
isEnabled: boolean;
|
|
148
|
+
refetch: (options?: _tanstack_query_core.RefetchOptions) => Promise<_tanstack_query_core.QueryObserverResult<WalletBalanceResponse, Error>>;
|
|
149
|
+
fetchStatus: _tanstack_query_core.FetchStatus;
|
|
150
|
+
promise: Promise<WalletBalanceResponse>;
|
|
151
|
+
} | {
|
|
152
|
+
balance: string;
|
|
153
|
+
balanceDisplay: string;
|
|
154
|
+
depositAddress: string | undefined;
|
|
155
|
+
agentSpends: Record<string, {
|
|
156
|
+
totalSpent: string;
|
|
157
|
+
}> | undefined;
|
|
158
|
+
refresh: () => Promise<_tanstack_query_core.QueryObserverResult<WalletBalanceResponse, Error>>;
|
|
159
|
+
data: undefined;
|
|
160
|
+
error: Error;
|
|
161
|
+
isError: true;
|
|
162
|
+
isPending: false;
|
|
163
|
+
isLoading: false;
|
|
164
|
+
isLoadingError: true;
|
|
165
|
+
isRefetchError: false;
|
|
166
|
+
isSuccess: false;
|
|
167
|
+
isPlaceholderData: false;
|
|
168
|
+
status: "error";
|
|
169
|
+
dataUpdatedAt: number;
|
|
170
|
+
errorUpdatedAt: number;
|
|
171
|
+
failureCount: number;
|
|
172
|
+
failureReason: Error | null;
|
|
173
|
+
errorUpdateCount: number;
|
|
174
|
+
isFetched: boolean;
|
|
175
|
+
isFetchedAfterMount: boolean;
|
|
176
|
+
isFetching: boolean;
|
|
177
|
+
isInitialLoading: boolean;
|
|
178
|
+
isPaused: boolean;
|
|
179
|
+
isRefetching: boolean;
|
|
180
|
+
isStale: boolean;
|
|
181
|
+
isEnabled: boolean;
|
|
182
|
+
refetch: (options?: _tanstack_query_core.RefetchOptions) => Promise<_tanstack_query_core.QueryObserverResult<WalletBalanceResponse, Error>>;
|
|
183
|
+
fetchStatus: _tanstack_query_core.FetchStatus;
|
|
184
|
+
promise: Promise<WalletBalanceResponse>;
|
|
185
|
+
} | {
|
|
186
|
+
balance: string;
|
|
187
|
+
balanceDisplay: string;
|
|
188
|
+
depositAddress: string | undefined;
|
|
189
|
+
agentSpends: Record<string, {
|
|
190
|
+
totalSpent: string;
|
|
191
|
+
}> | undefined;
|
|
192
|
+
refresh: () => Promise<_tanstack_query_core.QueryObserverResult<WalletBalanceResponse, Error>>;
|
|
193
|
+
data: undefined;
|
|
194
|
+
error: null;
|
|
195
|
+
isError: false;
|
|
196
|
+
isPending: true;
|
|
197
|
+
isLoading: true;
|
|
198
|
+
isLoadingError: false;
|
|
199
|
+
isRefetchError: false;
|
|
200
|
+
isSuccess: false;
|
|
201
|
+
isPlaceholderData: false;
|
|
202
|
+
status: "pending";
|
|
203
|
+
dataUpdatedAt: number;
|
|
204
|
+
errorUpdatedAt: number;
|
|
205
|
+
failureCount: number;
|
|
206
|
+
failureReason: Error | null;
|
|
207
|
+
errorUpdateCount: number;
|
|
208
|
+
isFetched: boolean;
|
|
209
|
+
isFetchedAfterMount: boolean;
|
|
210
|
+
isFetching: boolean;
|
|
211
|
+
isInitialLoading: boolean;
|
|
212
|
+
isPaused: boolean;
|
|
213
|
+
isRefetching: boolean;
|
|
214
|
+
isStale: boolean;
|
|
215
|
+
isEnabled: boolean;
|
|
216
|
+
refetch: (options?: _tanstack_query_core.RefetchOptions) => Promise<_tanstack_query_core.QueryObserverResult<WalletBalanceResponse, Error>>;
|
|
217
|
+
fetchStatus: _tanstack_query_core.FetchStatus;
|
|
218
|
+
promise: Promise<WalletBalanceResponse>;
|
|
219
|
+
} | {
|
|
220
|
+
balance: string;
|
|
221
|
+
balanceDisplay: string;
|
|
222
|
+
depositAddress: string | undefined;
|
|
223
|
+
agentSpends: Record<string, {
|
|
224
|
+
totalSpent: string;
|
|
225
|
+
}> | undefined;
|
|
226
|
+
refresh: () => Promise<_tanstack_query_core.QueryObserverResult<WalletBalanceResponse, Error>>;
|
|
227
|
+
data: undefined;
|
|
228
|
+
error: null;
|
|
229
|
+
isError: false;
|
|
230
|
+
isPending: true;
|
|
231
|
+
isLoadingError: false;
|
|
232
|
+
isRefetchError: false;
|
|
233
|
+
isSuccess: false;
|
|
234
|
+
isPlaceholderData: false;
|
|
235
|
+
status: "pending";
|
|
236
|
+
dataUpdatedAt: number;
|
|
237
|
+
errorUpdatedAt: number;
|
|
238
|
+
failureCount: number;
|
|
239
|
+
failureReason: Error | null;
|
|
240
|
+
errorUpdateCount: number;
|
|
241
|
+
isFetched: boolean;
|
|
242
|
+
isFetchedAfterMount: boolean;
|
|
243
|
+
isFetching: boolean;
|
|
244
|
+
isLoading: boolean;
|
|
245
|
+
isInitialLoading: boolean;
|
|
246
|
+
isPaused: boolean;
|
|
247
|
+
isRefetching: boolean;
|
|
248
|
+
isStale: boolean;
|
|
249
|
+
isEnabled: boolean;
|
|
250
|
+
refetch: (options?: _tanstack_query_core.RefetchOptions) => Promise<_tanstack_query_core.QueryObserverResult<WalletBalanceResponse, Error>>;
|
|
251
|
+
fetchStatus: _tanstack_query_core.FetchStatus;
|
|
252
|
+
promise: Promise<WalletBalanceResponse>;
|
|
253
|
+
} | {
|
|
254
|
+
balance: string;
|
|
255
|
+
balanceDisplay: string;
|
|
256
|
+
depositAddress: string | undefined;
|
|
257
|
+
agentSpends: Record<string, {
|
|
258
|
+
totalSpent: string;
|
|
259
|
+
}> | undefined;
|
|
260
|
+
refresh: () => Promise<_tanstack_query_core.QueryObserverResult<WalletBalanceResponse, Error>>;
|
|
261
|
+
data: WalletBalanceResponse;
|
|
262
|
+
isError: false;
|
|
263
|
+
error: null;
|
|
264
|
+
isPending: false;
|
|
265
|
+
isLoading: false;
|
|
266
|
+
isLoadingError: false;
|
|
267
|
+
isRefetchError: false;
|
|
268
|
+
isSuccess: true;
|
|
269
|
+
isPlaceholderData: true;
|
|
270
|
+
status: "success";
|
|
271
|
+
dataUpdatedAt: number;
|
|
272
|
+
errorUpdatedAt: number;
|
|
273
|
+
failureCount: number;
|
|
274
|
+
failureReason: Error | null;
|
|
275
|
+
errorUpdateCount: number;
|
|
276
|
+
isFetched: boolean;
|
|
277
|
+
isFetchedAfterMount: boolean;
|
|
278
|
+
isFetching: boolean;
|
|
279
|
+
isInitialLoading: boolean;
|
|
280
|
+
isPaused: boolean;
|
|
281
|
+
isRefetching: boolean;
|
|
282
|
+
isStale: boolean;
|
|
283
|
+
isEnabled: boolean;
|
|
284
|
+
refetch: (options?: _tanstack_query_core.RefetchOptions) => Promise<_tanstack_query_core.QueryObserverResult<WalletBalanceResponse, Error>>;
|
|
285
|
+
fetchStatus: _tanstack_query_core.FetchStatus;
|
|
286
|
+
promise: Promise<WalletBalanceResponse>;
|
|
287
|
+
};
|
|
288
|
+
/** Fetch wallet transaction history. */
|
|
289
|
+
declare function useWalletTransactions(limit?: number, offset?: number): _tanstack_react_query.UseQueryResult<WalletTransactionsResponse, Error>;
|
|
290
|
+
|
|
291
|
+
declare const sessionKeys: {
|
|
292
|
+
all: readonly ["sessions"];
|
|
293
|
+
lists: (agentId: string) => readonly ["sessions", "list", string];
|
|
294
|
+
details: () => readonly ["sessions", "detail"];
|
|
295
|
+
detail: (agentId: string, sessionId: string) => readonly ["sessions", "detail", string, string];
|
|
296
|
+
};
|
|
297
|
+
/** List sessions for an agent. */
|
|
298
|
+
declare function useSessions(agentId: string | undefined): _tanstack_react_query.UseQueryResult<SessionListEntry[], Error>;
|
|
299
|
+
/** Get session detail including messages. */
|
|
300
|
+
declare function useSession(agentId: string | undefined, sessionId: string | undefined): _tanstack_react_query.UseQueryResult<SessionDetail, Error>;
|
|
301
|
+
/** Mutation to delete a session. */
|
|
302
|
+
declare function useDeleteSession(): _tanstack_react_query.UseMutationResult<void, Error, {
|
|
303
|
+
agentId: string;
|
|
304
|
+
sessionId: string;
|
|
305
|
+
}, unknown>;
|
|
306
|
+
|
|
307
|
+
declare const walletSettingsKeys: {
|
|
308
|
+
all: readonly ["wallet-settings"];
|
|
309
|
+
settings: () => readonly ["wallet-settings", "current"];
|
|
310
|
+
};
|
|
311
|
+
/** Fetch wallet settings. */
|
|
312
|
+
declare function useWalletSettings(): {
|
|
313
|
+
settings: WalletSettings | undefined;
|
|
314
|
+
updateSettings: _tanstack_react_query.UseMutateAsyncFunction<WalletSettings, Error, Partial<WalletSettings>, unknown>;
|
|
315
|
+
isUpdating: boolean;
|
|
316
|
+
data: WalletSettings;
|
|
317
|
+
error: Error;
|
|
318
|
+
isError: true;
|
|
319
|
+
isPending: false;
|
|
320
|
+
isLoading: false;
|
|
321
|
+
isLoadingError: false;
|
|
322
|
+
isRefetchError: true;
|
|
323
|
+
isSuccess: false;
|
|
324
|
+
isPlaceholderData: false;
|
|
325
|
+
status: "error";
|
|
326
|
+
dataUpdatedAt: number;
|
|
327
|
+
errorUpdatedAt: number;
|
|
328
|
+
failureCount: number;
|
|
329
|
+
failureReason: Error | null;
|
|
330
|
+
errorUpdateCount: number;
|
|
331
|
+
isFetched: boolean;
|
|
332
|
+
isFetchedAfterMount: boolean;
|
|
333
|
+
isFetching: boolean;
|
|
334
|
+
isInitialLoading: boolean;
|
|
335
|
+
isPaused: boolean;
|
|
336
|
+
isRefetching: boolean;
|
|
337
|
+
isStale: boolean;
|
|
338
|
+
isEnabled: boolean;
|
|
339
|
+
refetch: (options?: _tanstack_query_core.RefetchOptions) => Promise<_tanstack_query_core.QueryObserverResult<WalletSettings, Error>>;
|
|
340
|
+
fetchStatus: _tanstack_query_core.FetchStatus;
|
|
341
|
+
promise: Promise<WalletSettings>;
|
|
342
|
+
} | {
|
|
343
|
+
settings: WalletSettings | undefined;
|
|
344
|
+
updateSettings: _tanstack_react_query.UseMutateAsyncFunction<WalletSettings, Error, Partial<WalletSettings>, unknown>;
|
|
345
|
+
isUpdating: boolean;
|
|
346
|
+
data: WalletSettings;
|
|
347
|
+
error: null;
|
|
348
|
+
isError: false;
|
|
349
|
+
isPending: false;
|
|
350
|
+
isLoading: false;
|
|
351
|
+
isLoadingError: false;
|
|
352
|
+
isRefetchError: false;
|
|
353
|
+
isSuccess: true;
|
|
354
|
+
isPlaceholderData: false;
|
|
355
|
+
status: "success";
|
|
356
|
+
dataUpdatedAt: number;
|
|
357
|
+
errorUpdatedAt: number;
|
|
358
|
+
failureCount: number;
|
|
359
|
+
failureReason: Error | null;
|
|
360
|
+
errorUpdateCount: number;
|
|
361
|
+
isFetched: boolean;
|
|
362
|
+
isFetchedAfterMount: boolean;
|
|
363
|
+
isFetching: boolean;
|
|
364
|
+
isInitialLoading: boolean;
|
|
365
|
+
isPaused: boolean;
|
|
366
|
+
isRefetching: boolean;
|
|
367
|
+
isStale: boolean;
|
|
368
|
+
isEnabled: boolean;
|
|
369
|
+
refetch: (options?: _tanstack_query_core.RefetchOptions) => Promise<_tanstack_query_core.QueryObserverResult<WalletSettings, Error>>;
|
|
370
|
+
fetchStatus: _tanstack_query_core.FetchStatus;
|
|
371
|
+
promise: Promise<WalletSettings>;
|
|
372
|
+
} | {
|
|
373
|
+
settings: WalletSettings | undefined;
|
|
374
|
+
updateSettings: _tanstack_react_query.UseMutateAsyncFunction<WalletSettings, Error, Partial<WalletSettings>, unknown>;
|
|
375
|
+
isUpdating: boolean;
|
|
376
|
+
data: undefined;
|
|
377
|
+
error: Error;
|
|
378
|
+
isError: true;
|
|
379
|
+
isPending: false;
|
|
380
|
+
isLoading: false;
|
|
381
|
+
isLoadingError: true;
|
|
382
|
+
isRefetchError: false;
|
|
383
|
+
isSuccess: false;
|
|
384
|
+
isPlaceholderData: false;
|
|
385
|
+
status: "error";
|
|
386
|
+
dataUpdatedAt: number;
|
|
387
|
+
errorUpdatedAt: number;
|
|
388
|
+
failureCount: number;
|
|
389
|
+
failureReason: Error | null;
|
|
390
|
+
errorUpdateCount: number;
|
|
391
|
+
isFetched: boolean;
|
|
392
|
+
isFetchedAfterMount: boolean;
|
|
393
|
+
isFetching: boolean;
|
|
394
|
+
isInitialLoading: boolean;
|
|
395
|
+
isPaused: boolean;
|
|
396
|
+
isRefetching: boolean;
|
|
397
|
+
isStale: boolean;
|
|
398
|
+
isEnabled: boolean;
|
|
399
|
+
refetch: (options?: _tanstack_query_core.RefetchOptions) => Promise<_tanstack_query_core.QueryObserverResult<WalletSettings, Error>>;
|
|
400
|
+
fetchStatus: _tanstack_query_core.FetchStatus;
|
|
401
|
+
promise: Promise<WalletSettings>;
|
|
402
|
+
} | {
|
|
403
|
+
settings: WalletSettings | undefined;
|
|
404
|
+
updateSettings: _tanstack_react_query.UseMutateAsyncFunction<WalletSettings, Error, Partial<WalletSettings>, unknown>;
|
|
405
|
+
isUpdating: boolean;
|
|
406
|
+
data: undefined;
|
|
407
|
+
error: null;
|
|
408
|
+
isError: false;
|
|
409
|
+
isPending: true;
|
|
410
|
+
isLoading: true;
|
|
411
|
+
isLoadingError: false;
|
|
412
|
+
isRefetchError: false;
|
|
413
|
+
isSuccess: false;
|
|
414
|
+
isPlaceholderData: false;
|
|
415
|
+
status: "pending";
|
|
416
|
+
dataUpdatedAt: number;
|
|
417
|
+
errorUpdatedAt: number;
|
|
418
|
+
failureCount: number;
|
|
419
|
+
failureReason: Error | null;
|
|
420
|
+
errorUpdateCount: number;
|
|
421
|
+
isFetched: boolean;
|
|
422
|
+
isFetchedAfterMount: boolean;
|
|
423
|
+
isFetching: boolean;
|
|
424
|
+
isInitialLoading: boolean;
|
|
425
|
+
isPaused: boolean;
|
|
426
|
+
isRefetching: boolean;
|
|
427
|
+
isStale: boolean;
|
|
428
|
+
isEnabled: boolean;
|
|
429
|
+
refetch: (options?: _tanstack_query_core.RefetchOptions) => Promise<_tanstack_query_core.QueryObserverResult<WalletSettings, Error>>;
|
|
430
|
+
fetchStatus: _tanstack_query_core.FetchStatus;
|
|
431
|
+
promise: Promise<WalletSettings>;
|
|
432
|
+
} | {
|
|
433
|
+
settings: WalletSettings | undefined;
|
|
434
|
+
updateSettings: _tanstack_react_query.UseMutateAsyncFunction<WalletSettings, Error, Partial<WalletSettings>, unknown>;
|
|
435
|
+
isUpdating: boolean;
|
|
436
|
+
data: undefined;
|
|
437
|
+
error: null;
|
|
438
|
+
isError: false;
|
|
439
|
+
isPending: true;
|
|
440
|
+
isLoadingError: false;
|
|
441
|
+
isRefetchError: false;
|
|
442
|
+
isSuccess: false;
|
|
443
|
+
isPlaceholderData: false;
|
|
444
|
+
status: "pending";
|
|
445
|
+
dataUpdatedAt: number;
|
|
446
|
+
errorUpdatedAt: number;
|
|
447
|
+
failureCount: number;
|
|
448
|
+
failureReason: Error | null;
|
|
449
|
+
errorUpdateCount: number;
|
|
450
|
+
isFetched: boolean;
|
|
451
|
+
isFetchedAfterMount: boolean;
|
|
452
|
+
isFetching: boolean;
|
|
453
|
+
isLoading: boolean;
|
|
454
|
+
isInitialLoading: boolean;
|
|
455
|
+
isPaused: boolean;
|
|
456
|
+
isRefetching: boolean;
|
|
457
|
+
isStale: boolean;
|
|
458
|
+
isEnabled: boolean;
|
|
459
|
+
refetch: (options?: _tanstack_query_core.RefetchOptions) => Promise<_tanstack_query_core.QueryObserverResult<WalletSettings, Error>>;
|
|
460
|
+
fetchStatus: _tanstack_query_core.FetchStatus;
|
|
461
|
+
promise: Promise<WalletSettings>;
|
|
462
|
+
} | {
|
|
463
|
+
settings: WalletSettings | undefined;
|
|
464
|
+
updateSettings: _tanstack_react_query.UseMutateAsyncFunction<WalletSettings, Error, Partial<WalletSettings>, unknown>;
|
|
465
|
+
isUpdating: boolean;
|
|
466
|
+
data: WalletSettings;
|
|
467
|
+
isError: false;
|
|
468
|
+
error: null;
|
|
469
|
+
isPending: false;
|
|
470
|
+
isLoading: false;
|
|
471
|
+
isLoadingError: false;
|
|
472
|
+
isRefetchError: false;
|
|
473
|
+
isSuccess: true;
|
|
474
|
+
isPlaceholderData: true;
|
|
475
|
+
status: "success";
|
|
476
|
+
dataUpdatedAt: number;
|
|
477
|
+
errorUpdatedAt: number;
|
|
478
|
+
failureCount: number;
|
|
479
|
+
failureReason: Error | null;
|
|
480
|
+
errorUpdateCount: number;
|
|
481
|
+
isFetched: boolean;
|
|
482
|
+
isFetchedAfterMount: boolean;
|
|
483
|
+
isFetching: boolean;
|
|
484
|
+
isInitialLoading: boolean;
|
|
485
|
+
isPaused: boolean;
|
|
486
|
+
isRefetching: boolean;
|
|
487
|
+
isStale: boolean;
|
|
488
|
+
isEnabled: boolean;
|
|
489
|
+
refetch: (options?: _tanstack_query_core.RefetchOptions) => Promise<_tanstack_query_core.QueryObserverResult<WalletSettings, Error>>;
|
|
490
|
+
fetchStatus: _tanstack_query_core.FetchStatus;
|
|
491
|
+
promise: Promise<WalletSettings>;
|
|
492
|
+
};
|
|
493
|
+
|
|
494
|
+
/** Chat message as used in React UI state. */
|
|
495
|
+
interface ChatMessage {
|
|
496
|
+
id: string;
|
|
497
|
+
role: 'user' | 'agent';
|
|
498
|
+
content: string;
|
|
499
|
+
toolExecutions?: ToolExecution[];
|
|
500
|
+
timestamp: string;
|
|
501
|
+
costUSD?: string;
|
|
502
|
+
}
|
|
503
|
+
/** A tool call + optional result within a chat message. */
|
|
504
|
+
interface ToolExecution {
|
|
505
|
+
id: string;
|
|
506
|
+
name: string;
|
|
507
|
+
displayName?: string;
|
|
508
|
+
args: unknown;
|
|
509
|
+
result?: {
|
|
510
|
+
content?: string;
|
|
511
|
+
isError: boolean;
|
|
512
|
+
};
|
|
513
|
+
}
|
|
514
|
+
/** Section of missing secrets to configure. */
|
|
515
|
+
interface SecretSection {
|
|
516
|
+
id: string;
|
|
517
|
+
label: string;
|
|
518
|
+
keys: string[];
|
|
519
|
+
configuredKeys: string[];
|
|
520
|
+
save: (secrets: Record<string, string>) => Promise<void>;
|
|
521
|
+
}
|
|
522
|
+
|
|
523
|
+
interface UseSecretsOptions {
|
|
524
|
+
agentId: string;
|
|
525
|
+
mcpServers?: string[];
|
|
526
|
+
}
|
|
527
|
+
interface UseSecretsResult {
|
|
528
|
+
sections: SecretSection[];
|
|
529
|
+
loading: boolean;
|
|
530
|
+
allConfigured: boolean;
|
|
531
|
+
refresh: () => void;
|
|
532
|
+
}
|
|
533
|
+
/**
|
|
534
|
+
* Discovers all missing secrets (API key + agent + MCP) for an agent.
|
|
535
|
+
* Returns sections with save callbacks for each.
|
|
536
|
+
*/
|
|
537
|
+
declare function useSecrets({ agentId, mcpServers }: UseSecretsOptions): UseSecretsResult;
|
|
538
|
+
|
|
539
|
+
interface UseAgentChatOptions {
|
|
540
|
+
agentId: string;
|
|
541
|
+
model?: 'haiku' | 'sonnet' | 'opus';
|
|
542
|
+
resumeSessionId?: string;
|
|
543
|
+
}
|
|
544
|
+
interface UseAgentChatResult {
|
|
545
|
+
messages: ChatMessage[];
|
|
546
|
+
messagesLoading: boolean;
|
|
547
|
+
sending: boolean;
|
|
548
|
+
sessionId: string | null;
|
|
549
|
+
streamingPhase: 'idle' | 'tools' | 'streaming';
|
|
550
|
+
activeTools: string[];
|
|
551
|
+
apiKeyConfigured: boolean | null;
|
|
552
|
+
sendMessage: (text: string) => Promise<void>;
|
|
553
|
+
clearChat: () => void;
|
|
554
|
+
refreshApiKeyStatus: () => void;
|
|
555
|
+
}
|
|
556
|
+
/**
|
|
557
|
+
* SSE streaming chat hook. NOT React Query — uses imperative state management.
|
|
558
|
+
*
|
|
559
|
+
* Ported from rickydata_agentbook/src/hooks/useAgentTextChat.ts.
|
|
560
|
+
*/
|
|
561
|
+
declare function useAgentChat({ agentId, model, resumeSessionId, }: UseAgentChatOptions): UseAgentChatResult;
|
|
562
|
+
|
|
563
|
+
interface SecretFormProps {
|
|
564
|
+
secretKeys: string[];
|
|
565
|
+
configuredKeys: string[];
|
|
566
|
+
onSave: (secrets: Record<string, string>) => Promise<void>;
|
|
567
|
+
onDelete?: (() => Promise<void>) | null;
|
|
568
|
+
onClose?: () => void;
|
|
569
|
+
className?: string;
|
|
570
|
+
}
|
|
571
|
+
/**
|
|
572
|
+
* Generic secret/password form with show/hide toggle.
|
|
573
|
+
* Uses inline styles — no CSS framework dependency.
|
|
574
|
+
*/
|
|
575
|
+
declare function SecretForm({ secretKeys, configuredKeys, onSave, onDelete, onClose, className }: SecretFormProps): react_jsx_runtime.JSX.Element;
|
|
576
|
+
|
|
577
|
+
interface SecretOrchestratorProps {
|
|
578
|
+
agentId: string;
|
|
579
|
+
mcpServers?: string[];
|
|
580
|
+
onAllConfigured?: () => void;
|
|
581
|
+
className?: string;
|
|
582
|
+
compact?: boolean;
|
|
583
|
+
}
|
|
584
|
+
/**
|
|
585
|
+
* Discovers all missing secrets for an agent and renders collapsible
|
|
586
|
+
* SecretForm sections for each. Calls `onAllConfigured` when done.
|
|
587
|
+
*/
|
|
588
|
+
declare function SecretOrchestrator({ agentId, mcpServers, onAllConfigured, className, compact, }: SecretOrchestratorProps): react_jsx_runtime.JSX.Element | null;
|
|
589
|
+
|
|
590
|
+
interface WalletChipProps {
|
|
591
|
+
address: string;
|
|
592
|
+
balanceDisplay?: string;
|
|
593
|
+
displayName?: string;
|
|
594
|
+
onPress?: () => void;
|
|
595
|
+
className?: string;
|
|
596
|
+
}
|
|
597
|
+
/**
|
|
598
|
+
* Compact wallet identity pill with optional balance badge.
|
|
599
|
+
* Pure presentational, inline styles, no framework dependency.
|
|
600
|
+
*/
|
|
601
|
+
declare function WalletChip({ address, balanceDisplay, displayName, onPress, className }: WalletChipProps): react_jsx_runtime.JSX.Element;
|
|
602
|
+
|
|
603
|
+
export { type ChatMessage, RickyDataProvider, type RickyDataProviderProps, SecretForm, type SecretFormProps, SecretOrchestrator, type SecretOrchestratorProps, type SecretSection, type ToolExecution, type UseAgentChatOptions, type UseAgentChatResult, WalletChip, type WalletChipProps, agentKeys, apiKeyKeys, balanceKeys, sessionKeys, useAgent, useAgentChat, useAgents, useApiKeyStatus, useDeleteApiKey, useDeleteSession, useOpenAIApiKeyStatus, useRickyData, useSecrets, useSession, useSessions, useSetApiKey, useSetOpenAIApiKey, useWalletBalance, useWalletSettings, useWalletTransactions, walletSettingsKeys };
|