@gr33n-ai/jade-sdk-client 0.1.0 → 0.1.2
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/README.md +1 -1
- package/dist/index.cjs +927 -0
- package/dist/index.d.cts +236 -4
- package/dist/index.d.ts +236 -4
- package/dist/index.js +916 -1
- package/package.json +16 -21
- package/dist/react/index.cjs +0 -2082
- package/dist/react/index.d.cts +0 -95
- package/dist/react/index.d.ts +0 -95
- package/dist/react/index.js +0 -2070
- package/dist/types-peBknkiN.d.cts +0 -145
- package/dist/types-peBknkiN.d.ts +0 -145
package/dist/index.d.cts
CHANGED
|
@@ -1,7 +1,150 @@
|
|
|
1
|
-
import { ConversationEntry } from '@gr33n-ai/agent-sdk-client';
|
|
1
|
+
import { ConversationEntry, AgentClientConfig } from '@gr33n-ai/agent-sdk-client';
|
|
2
2
|
export * from '@gr33n-ai/agent-sdk-client';
|
|
3
|
-
|
|
4
|
-
|
|
3
|
+
export { AgentClient as JadeClient } from '@gr33n-ai/agent-sdk-client';
|
|
4
|
+
import { UseAgentSessionOptions, UseAgentSessionReturn, AgentProvider } from '@gr33n-ai/agent-sdk-client/react';
|
|
5
|
+
export * from '@gr33n-ai/agent-sdk-client/react';
|
|
6
|
+
|
|
7
|
+
/**
|
|
8
|
+
* Tool types for Jade SDK.
|
|
9
|
+
* Used for parsing tool inputs and results.
|
|
10
|
+
*/
|
|
11
|
+
interface ParsedToolInput {
|
|
12
|
+
type: string;
|
|
13
|
+
data: Record<string, unknown>;
|
|
14
|
+
}
|
|
15
|
+
interface ParsedToolResult {
|
|
16
|
+
type: string;
|
|
17
|
+
data: Record<string, unknown>;
|
|
18
|
+
}
|
|
19
|
+
interface ToolDefinition {
|
|
20
|
+
name: string;
|
|
21
|
+
displayName: string;
|
|
22
|
+
iconName: string;
|
|
23
|
+
iconVariant?: (input: unknown) => string;
|
|
24
|
+
category: 'generation' | 'processing' | 'utility' | 'system';
|
|
25
|
+
consumesResult: boolean;
|
|
26
|
+
consumeExtra?: number;
|
|
27
|
+
parseInput: (toolInput: unknown) => ParsedToolInput | null;
|
|
28
|
+
parseResult?: (content: string) => ParsedToolResult | null;
|
|
29
|
+
}
|
|
30
|
+
interface MediaResult {
|
|
31
|
+
requestId: string;
|
|
32
|
+
urls: string[];
|
|
33
|
+
fileType?: string;
|
|
34
|
+
metadata?: Record<string, unknown>;
|
|
35
|
+
originalSource?: string;
|
|
36
|
+
}
|
|
37
|
+
interface ToolMediaResult {
|
|
38
|
+
requestId: string;
|
|
39
|
+
urls: string[];
|
|
40
|
+
fileType?: string;
|
|
41
|
+
metadata?: Record<string, unknown>;
|
|
42
|
+
originalSource?: string;
|
|
43
|
+
originalToolUseId?: string;
|
|
44
|
+
originalToolName?: string;
|
|
45
|
+
prompt?: string;
|
|
46
|
+
model?: string;
|
|
47
|
+
aspectRatio?: string;
|
|
48
|
+
inputMediaUrls?: string[];
|
|
49
|
+
lastFrameUrl?: string;
|
|
50
|
+
elements?: string[][];
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
/**
|
|
54
|
+
* Parser for gr3.suggestion tags in assistant text.
|
|
55
|
+
* Extracts suggestions and returns clean text with suggestion metadata.
|
|
56
|
+
*/
|
|
57
|
+
interface ParsedSuggestion {
|
|
58
|
+
text: string;
|
|
59
|
+
startIndex: number;
|
|
60
|
+
endIndex: number;
|
|
61
|
+
}
|
|
62
|
+
interface SuggestionParseResult {
|
|
63
|
+
cleanText: string;
|
|
64
|
+
suggestions: ParsedSuggestion[];
|
|
65
|
+
segments: TextSegment[];
|
|
66
|
+
}
|
|
67
|
+
type TextSegment = {
|
|
68
|
+
type: 'text';
|
|
69
|
+
content: string;
|
|
70
|
+
} | {
|
|
71
|
+
type: 'suggestion';
|
|
72
|
+
content: string;
|
|
73
|
+
};
|
|
74
|
+
/**
|
|
75
|
+
* Parse text containing gr3.suggestion tags.
|
|
76
|
+
* Returns the clean text (with tags removed) and an array of suggestions with their positions.
|
|
77
|
+
*/
|
|
78
|
+
declare function parseSuggestions(text: string): SuggestionParseResult;
|
|
79
|
+
/**
|
|
80
|
+
* Check if text contains any gr3.suggestion tags.
|
|
81
|
+
*/
|
|
82
|
+
declare function hasSuggestions(text: string): boolean;
|
|
83
|
+
|
|
84
|
+
/**
|
|
85
|
+
* Type definitions for Jade SDK.
|
|
86
|
+
*/
|
|
87
|
+
|
|
88
|
+
interface ProcessedEntry {
|
|
89
|
+
/** The original conversation entry */
|
|
90
|
+
entry: ConversationEntry;
|
|
91
|
+
/** Original entry type category */
|
|
92
|
+
originalType: 'tool_call' | 'tool_result' | 'assistant_text' | 'user_text' | 'compact' | 'error';
|
|
93
|
+
/** Display type for UI rendering */
|
|
94
|
+
displayType: string;
|
|
95
|
+
/** Icon name for this entry (e.g., 'Image', 'Video', 'Bot') */
|
|
96
|
+
iconName: string;
|
|
97
|
+
/** Additional data for dynamic icon selection */
|
|
98
|
+
iconData?: unknown;
|
|
99
|
+
/** Display title (for mcp__jade__ tools) */
|
|
100
|
+
title?: string;
|
|
101
|
+
/** Parsed data for rendering */
|
|
102
|
+
data: Record<string, unknown>;
|
|
103
|
+
/** ISO 8601 timestamp */
|
|
104
|
+
timestamp: string;
|
|
105
|
+
/** Tool definition if this is a tool call */
|
|
106
|
+
toolDefinition?: ToolDefinition;
|
|
107
|
+
/** Parsed input if this is a tool call */
|
|
108
|
+
parsedInput?: ParsedToolInput;
|
|
109
|
+
/** Parsed result if tool consumed its result */
|
|
110
|
+
parsedResult?: ParsedToolResult;
|
|
111
|
+
/** The consumed result entry (if tool consumed it) */
|
|
112
|
+
consumedResult?: ConversationEntry;
|
|
113
|
+
/** Media URLs extracted from the result */
|
|
114
|
+
mediaUrls?: string[];
|
|
115
|
+
/** Parsed suggestions from gr3.suggestion tags */
|
|
116
|
+
suggestions?: ParsedSuggestion[];
|
|
117
|
+
/** Text segments for rendering (alternating text and suggestions) */
|
|
118
|
+
textSegments?: TextSegment[];
|
|
119
|
+
}
|
|
120
|
+
interface ProcessingOptions {
|
|
121
|
+
/** Skip Skill context injection entries (default: true) */
|
|
122
|
+
skipSkillContext?: boolean;
|
|
123
|
+
/** Pair tool calls with their results (default: true) */
|
|
124
|
+
pairToolResults?: boolean;
|
|
125
|
+
/** Extract media URLs from results (default: true) */
|
|
126
|
+
extractMedia?: boolean;
|
|
127
|
+
}
|
|
128
|
+
interface MediaInfo {
|
|
129
|
+
/** Media URL */
|
|
130
|
+
url: string;
|
|
131
|
+
/** Media type */
|
|
132
|
+
type: 'image' | 'video' | 'audio';
|
|
133
|
+
/** ISO 8601 timestamp */
|
|
134
|
+
timestamp: string;
|
|
135
|
+
/** Tool name that generated this media */
|
|
136
|
+
toolName?: string;
|
|
137
|
+
/** Tool use ID */
|
|
138
|
+
toolUseId?: string;
|
|
139
|
+
/** Prompt used to generate this media */
|
|
140
|
+
prompt?: string;
|
|
141
|
+
/** Model used for generation */
|
|
142
|
+
model?: string;
|
|
143
|
+
/** Aspect ratio */
|
|
144
|
+
aspectRatio?: string;
|
|
145
|
+
/** Input media URLs used for generation */
|
|
146
|
+
inputMediaUrls?: string[];
|
|
147
|
+
}
|
|
5
148
|
|
|
6
149
|
/**
|
|
7
150
|
* Conversation processor for Jade SDK.
|
|
@@ -90,4 +233,93 @@ declare function extractMediaInfo(content: string): {
|
|
|
90
233
|
urls: string[];
|
|
91
234
|
} | null;
|
|
92
235
|
|
|
93
|
-
|
|
236
|
+
interface UseJadeSessionOptions extends UseAgentSessionOptions {
|
|
237
|
+
/** Skip Skill context injection entries (default: true) */
|
|
238
|
+
skipSkillContext?: boolean;
|
|
239
|
+
/** Processing options */
|
|
240
|
+
processingOptions?: ProcessingOptions;
|
|
241
|
+
}
|
|
242
|
+
interface UseJadeSessionReturn extends UseAgentSessionReturn {
|
|
243
|
+
/** Processed conversation entries with tool pairing and parsing */
|
|
244
|
+
processedConversation: ProcessedEntry[];
|
|
245
|
+
/** All media extracted from conversation (deduplicated, sorted by timestamp) */
|
|
246
|
+
media: MediaInfo[];
|
|
247
|
+
}
|
|
248
|
+
/**
|
|
249
|
+
* Hook for managing Jade agent sessions with enhanced conversation processing.
|
|
250
|
+
*
|
|
251
|
+
* Extends useAgentSession with:
|
|
252
|
+
* - Processed conversation (tool call/result pairing, parsed inputs/results)
|
|
253
|
+
* - Media extraction from generated content
|
|
254
|
+
*
|
|
255
|
+
* @example
|
|
256
|
+
* ```tsx
|
|
257
|
+
* const {
|
|
258
|
+
* conversation,
|
|
259
|
+
* processedConversation,
|
|
260
|
+
* media,
|
|
261
|
+
* isStreaming,
|
|
262
|
+
* sendMessage,
|
|
263
|
+
* } = useJadeSession();
|
|
264
|
+
*
|
|
265
|
+
* // Render processed entries
|
|
266
|
+
* {processedConversation.map((entry, i) => (
|
|
267
|
+
* <MessageRenderer key={i} entry={entry} />
|
|
268
|
+
* ))}
|
|
269
|
+
*
|
|
270
|
+
* // Show media gallery
|
|
271
|
+
* {media.map((item) => (
|
|
272
|
+
* <MediaThumbnail key={item.url} {...item} />
|
|
273
|
+
* ))}
|
|
274
|
+
* ```
|
|
275
|
+
*/
|
|
276
|
+
declare function useJadeSession(options?: UseJadeSessionOptions): UseJadeSessionReturn;
|
|
277
|
+
|
|
278
|
+
/**
|
|
279
|
+
* Hook for extracting media from conversation entries.
|
|
280
|
+
*
|
|
281
|
+
* @param conversation - Array of conversation entries
|
|
282
|
+
* @returns Array of media info objects (deduplicated, sorted by timestamp)
|
|
283
|
+
*
|
|
284
|
+
* @example
|
|
285
|
+
* ```tsx
|
|
286
|
+
* const media = useMedia(conversation);
|
|
287
|
+
*
|
|
288
|
+
* {media.map((item) => (
|
|
289
|
+
* <MediaThumbnail
|
|
290
|
+
* key={item.url}
|
|
291
|
+
* url={item.url}
|
|
292
|
+
* type={item.type}
|
|
293
|
+
* prompt={item.prompt}
|
|
294
|
+
* />
|
|
295
|
+
* ))}
|
|
296
|
+
* ```
|
|
297
|
+
*/
|
|
298
|
+
declare function useMedia(conversation: ConversationEntry[]): MediaInfo[];
|
|
299
|
+
|
|
300
|
+
/**
|
|
301
|
+
* JadeProvider for Jade SDK.
|
|
302
|
+
* Re-exports AgentProvider with Jade branding.
|
|
303
|
+
*/
|
|
304
|
+
|
|
305
|
+
/**
|
|
306
|
+
* Configuration for JadeProvider.
|
|
307
|
+
*/
|
|
308
|
+
type JadeClientConfig = AgentClientConfig;
|
|
309
|
+
/**
|
|
310
|
+
* Provider component for Jade SDK.
|
|
311
|
+
* Wraps your app to provide the agent client context.
|
|
312
|
+
*
|
|
313
|
+
* @example
|
|
314
|
+
* ```tsx
|
|
315
|
+
* <JadeProvider config={{
|
|
316
|
+
* endpoint: 'https://api.jade.gr33n.ai',
|
|
317
|
+
* getAuthToken: () => authToken,
|
|
318
|
+
* }}>
|
|
319
|
+
* <App />
|
|
320
|
+
* </JadeProvider>
|
|
321
|
+
* ```
|
|
322
|
+
*/
|
|
323
|
+
declare const JadeProvider: typeof AgentProvider;
|
|
324
|
+
|
|
325
|
+
export { type JadeClientConfig, JadeProvider, type MediaInfo, type MediaResult, type MediaType, type ParsedSuggestion, type ParsedToolInput, type ParsedToolResult, type ProcessedEntry, type ProcessingOptions, type SuggestionParseResult, TOOL_REGISTRY, type TextSegment, type ToolDefinition, type ToolMediaResult, type UseJadeSessionOptions, type UseJadeSessionReturn, createMediaParseResult, extractMedia, extractMediaInfo, extractMediaInfoFromToolResult, getMediaTypeFromExtension, getMediaTypeFromUrl, getToolDefinition, getToolIconName, hasSuggestions, parseSuggestions, parseToolResultContent, processConversation, useJadeSession, useMedia };
|
package/dist/index.d.ts
CHANGED
|
@@ -1,7 +1,150 @@
|
|
|
1
|
-
import { ConversationEntry } from '@gr33n-ai/agent-sdk-client';
|
|
1
|
+
import { ConversationEntry, AgentClientConfig } from '@gr33n-ai/agent-sdk-client';
|
|
2
2
|
export * from '@gr33n-ai/agent-sdk-client';
|
|
3
|
-
|
|
4
|
-
|
|
3
|
+
export { AgentClient as JadeClient } from '@gr33n-ai/agent-sdk-client';
|
|
4
|
+
import { UseAgentSessionOptions, UseAgentSessionReturn, AgentProvider } from '@gr33n-ai/agent-sdk-client/react';
|
|
5
|
+
export * from '@gr33n-ai/agent-sdk-client/react';
|
|
6
|
+
|
|
7
|
+
/**
|
|
8
|
+
* Tool types for Jade SDK.
|
|
9
|
+
* Used for parsing tool inputs and results.
|
|
10
|
+
*/
|
|
11
|
+
interface ParsedToolInput {
|
|
12
|
+
type: string;
|
|
13
|
+
data: Record<string, unknown>;
|
|
14
|
+
}
|
|
15
|
+
interface ParsedToolResult {
|
|
16
|
+
type: string;
|
|
17
|
+
data: Record<string, unknown>;
|
|
18
|
+
}
|
|
19
|
+
interface ToolDefinition {
|
|
20
|
+
name: string;
|
|
21
|
+
displayName: string;
|
|
22
|
+
iconName: string;
|
|
23
|
+
iconVariant?: (input: unknown) => string;
|
|
24
|
+
category: 'generation' | 'processing' | 'utility' | 'system';
|
|
25
|
+
consumesResult: boolean;
|
|
26
|
+
consumeExtra?: number;
|
|
27
|
+
parseInput: (toolInput: unknown) => ParsedToolInput | null;
|
|
28
|
+
parseResult?: (content: string) => ParsedToolResult | null;
|
|
29
|
+
}
|
|
30
|
+
interface MediaResult {
|
|
31
|
+
requestId: string;
|
|
32
|
+
urls: string[];
|
|
33
|
+
fileType?: string;
|
|
34
|
+
metadata?: Record<string, unknown>;
|
|
35
|
+
originalSource?: string;
|
|
36
|
+
}
|
|
37
|
+
interface ToolMediaResult {
|
|
38
|
+
requestId: string;
|
|
39
|
+
urls: string[];
|
|
40
|
+
fileType?: string;
|
|
41
|
+
metadata?: Record<string, unknown>;
|
|
42
|
+
originalSource?: string;
|
|
43
|
+
originalToolUseId?: string;
|
|
44
|
+
originalToolName?: string;
|
|
45
|
+
prompt?: string;
|
|
46
|
+
model?: string;
|
|
47
|
+
aspectRatio?: string;
|
|
48
|
+
inputMediaUrls?: string[];
|
|
49
|
+
lastFrameUrl?: string;
|
|
50
|
+
elements?: string[][];
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
/**
|
|
54
|
+
* Parser for gr3.suggestion tags in assistant text.
|
|
55
|
+
* Extracts suggestions and returns clean text with suggestion metadata.
|
|
56
|
+
*/
|
|
57
|
+
interface ParsedSuggestion {
|
|
58
|
+
text: string;
|
|
59
|
+
startIndex: number;
|
|
60
|
+
endIndex: number;
|
|
61
|
+
}
|
|
62
|
+
interface SuggestionParseResult {
|
|
63
|
+
cleanText: string;
|
|
64
|
+
suggestions: ParsedSuggestion[];
|
|
65
|
+
segments: TextSegment[];
|
|
66
|
+
}
|
|
67
|
+
type TextSegment = {
|
|
68
|
+
type: 'text';
|
|
69
|
+
content: string;
|
|
70
|
+
} | {
|
|
71
|
+
type: 'suggestion';
|
|
72
|
+
content: string;
|
|
73
|
+
};
|
|
74
|
+
/**
|
|
75
|
+
* Parse text containing gr3.suggestion tags.
|
|
76
|
+
* Returns the clean text (with tags removed) and an array of suggestions with their positions.
|
|
77
|
+
*/
|
|
78
|
+
declare function parseSuggestions(text: string): SuggestionParseResult;
|
|
79
|
+
/**
|
|
80
|
+
* Check if text contains any gr3.suggestion tags.
|
|
81
|
+
*/
|
|
82
|
+
declare function hasSuggestions(text: string): boolean;
|
|
83
|
+
|
|
84
|
+
/**
|
|
85
|
+
* Type definitions for Jade SDK.
|
|
86
|
+
*/
|
|
87
|
+
|
|
88
|
+
interface ProcessedEntry {
|
|
89
|
+
/** The original conversation entry */
|
|
90
|
+
entry: ConversationEntry;
|
|
91
|
+
/** Original entry type category */
|
|
92
|
+
originalType: 'tool_call' | 'tool_result' | 'assistant_text' | 'user_text' | 'compact' | 'error';
|
|
93
|
+
/** Display type for UI rendering */
|
|
94
|
+
displayType: string;
|
|
95
|
+
/** Icon name for this entry (e.g., 'Image', 'Video', 'Bot') */
|
|
96
|
+
iconName: string;
|
|
97
|
+
/** Additional data for dynamic icon selection */
|
|
98
|
+
iconData?: unknown;
|
|
99
|
+
/** Display title (for mcp__jade__ tools) */
|
|
100
|
+
title?: string;
|
|
101
|
+
/** Parsed data for rendering */
|
|
102
|
+
data: Record<string, unknown>;
|
|
103
|
+
/** ISO 8601 timestamp */
|
|
104
|
+
timestamp: string;
|
|
105
|
+
/** Tool definition if this is a tool call */
|
|
106
|
+
toolDefinition?: ToolDefinition;
|
|
107
|
+
/** Parsed input if this is a tool call */
|
|
108
|
+
parsedInput?: ParsedToolInput;
|
|
109
|
+
/** Parsed result if tool consumed its result */
|
|
110
|
+
parsedResult?: ParsedToolResult;
|
|
111
|
+
/** The consumed result entry (if tool consumed it) */
|
|
112
|
+
consumedResult?: ConversationEntry;
|
|
113
|
+
/** Media URLs extracted from the result */
|
|
114
|
+
mediaUrls?: string[];
|
|
115
|
+
/** Parsed suggestions from gr3.suggestion tags */
|
|
116
|
+
suggestions?: ParsedSuggestion[];
|
|
117
|
+
/** Text segments for rendering (alternating text and suggestions) */
|
|
118
|
+
textSegments?: TextSegment[];
|
|
119
|
+
}
|
|
120
|
+
interface ProcessingOptions {
|
|
121
|
+
/** Skip Skill context injection entries (default: true) */
|
|
122
|
+
skipSkillContext?: boolean;
|
|
123
|
+
/** Pair tool calls with their results (default: true) */
|
|
124
|
+
pairToolResults?: boolean;
|
|
125
|
+
/** Extract media URLs from results (default: true) */
|
|
126
|
+
extractMedia?: boolean;
|
|
127
|
+
}
|
|
128
|
+
interface MediaInfo {
|
|
129
|
+
/** Media URL */
|
|
130
|
+
url: string;
|
|
131
|
+
/** Media type */
|
|
132
|
+
type: 'image' | 'video' | 'audio';
|
|
133
|
+
/** ISO 8601 timestamp */
|
|
134
|
+
timestamp: string;
|
|
135
|
+
/** Tool name that generated this media */
|
|
136
|
+
toolName?: string;
|
|
137
|
+
/** Tool use ID */
|
|
138
|
+
toolUseId?: string;
|
|
139
|
+
/** Prompt used to generate this media */
|
|
140
|
+
prompt?: string;
|
|
141
|
+
/** Model used for generation */
|
|
142
|
+
model?: string;
|
|
143
|
+
/** Aspect ratio */
|
|
144
|
+
aspectRatio?: string;
|
|
145
|
+
/** Input media URLs used for generation */
|
|
146
|
+
inputMediaUrls?: string[];
|
|
147
|
+
}
|
|
5
148
|
|
|
6
149
|
/**
|
|
7
150
|
* Conversation processor for Jade SDK.
|
|
@@ -90,4 +233,93 @@ declare function extractMediaInfo(content: string): {
|
|
|
90
233
|
urls: string[];
|
|
91
234
|
} | null;
|
|
92
235
|
|
|
93
|
-
|
|
236
|
+
interface UseJadeSessionOptions extends UseAgentSessionOptions {
|
|
237
|
+
/** Skip Skill context injection entries (default: true) */
|
|
238
|
+
skipSkillContext?: boolean;
|
|
239
|
+
/** Processing options */
|
|
240
|
+
processingOptions?: ProcessingOptions;
|
|
241
|
+
}
|
|
242
|
+
interface UseJadeSessionReturn extends UseAgentSessionReturn {
|
|
243
|
+
/** Processed conversation entries with tool pairing and parsing */
|
|
244
|
+
processedConversation: ProcessedEntry[];
|
|
245
|
+
/** All media extracted from conversation (deduplicated, sorted by timestamp) */
|
|
246
|
+
media: MediaInfo[];
|
|
247
|
+
}
|
|
248
|
+
/**
|
|
249
|
+
* Hook for managing Jade agent sessions with enhanced conversation processing.
|
|
250
|
+
*
|
|
251
|
+
* Extends useAgentSession with:
|
|
252
|
+
* - Processed conversation (tool call/result pairing, parsed inputs/results)
|
|
253
|
+
* - Media extraction from generated content
|
|
254
|
+
*
|
|
255
|
+
* @example
|
|
256
|
+
* ```tsx
|
|
257
|
+
* const {
|
|
258
|
+
* conversation,
|
|
259
|
+
* processedConversation,
|
|
260
|
+
* media,
|
|
261
|
+
* isStreaming,
|
|
262
|
+
* sendMessage,
|
|
263
|
+
* } = useJadeSession();
|
|
264
|
+
*
|
|
265
|
+
* // Render processed entries
|
|
266
|
+
* {processedConversation.map((entry, i) => (
|
|
267
|
+
* <MessageRenderer key={i} entry={entry} />
|
|
268
|
+
* ))}
|
|
269
|
+
*
|
|
270
|
+
* // Show media gallery
|
|
271
|
+
* {media.map((item) => (
|
|
272
|
+
* <MediaThumbnail key={item.url} {...item} />
|
|
273
|
+
* ))}
|
|
274
|
+
* ```
|
|
275
|
+
*/
|
|
276
|
+
declare function useJadeSession(options?: UseJadeSessionOptions): UseJadeSessionReturn;
|
|
277
|
+
|
|
278
|
+
/**
|
|
279
|
+
* Hook for extracting media from conversation entries.
|
|
280
|
+
*
|
|
281
|
+
* @param conversation - Array of conversation entries
|
|
282
|
+
* @returns Array of media info objects (deduplicated, sorted by timestamp)
|
|
283
|
+
*
|
|
284
|
+
* @example
|
|
285
|
+
* ```tsx
|
|
286
|
+
* const media = useMedia(conversation);
|
|
287
|
+
*
|
|
288
|
+
* {media.map((item) => (
|
|
289
|
+
* <MediaThumbnail
|
|
290
|
+
* key={item.url}
|
|
291
|
+
* url={item.url}
|
|
292
|
+
* type={item.type}
|
|
293
|
+
* prompt={item.prompt}
|
|
294
|
+
* />
|
|
295
|
+
* ))}
|
|
296
|
+
* ```
|
|
297
|
+
*/
|
|
298
|
+
declare function useMedia(conversation: ConversationEntry[]): MediaInfo[];
|
|
299
|
+
|
|
300
|
+
/**
|
|
301
|
+
* JadeProvider for Jade SDK.
|
|
302
|
+
* Re-exports AgentProvider with Jade branding.
|
|
303
|
+
*/
|
|
304
|
+
|
|
305
|
+
/**
|
|
306
|
+
* Configuration for JadeProvider.
|
|
307
|
+
*/
|
|
308
|
+
type JadeClientConfig = AgentClientConfig;
|
|
309
|
+
/**
|
|
310
|
+
* Provider component for Jade SDK.
|
|
311
|
+
* Wraps your app to provide the agent client context.
|
|
312
|
+
*
|
|
313
|
+
* @example
|
|
314
|
+
* ```tsx
|
|
315
|
+
* <JadeProvider config={{
|
|
316
|
+
* endpoint: 'https://api.jade.gr33n.ai',
|
|
317
|
+
* getAuthToken: () => authToken,
|
|
318
|
+
* }}>
|
|
319
|
+
* <App />
|
|
320
|
+
* </JadeProvider>
|
|
321
|
+
* ```
|
|
322
|
+
*/
|
|
323
|
+
declare const JadeProvider: typeof AgentProvider;
|
|
324
|
+
|
|
325
|
+
export { type JadeClientConfig, JadeProvider, type MediaInfo, type MediaResult, type MediaType, type ParsedSuggestion, type ParsedToolInput, type ParsedToolResult, type ProcessedEntry, type ProcessingOptions, type SuggestionParseResult, TOOL_REGISTRY, type TextSegment, type ToolDefinition, type ToolMediaResult, type UseJadeSessionOptions, type UseJadeSessionReturn, createMediaParseResult, extractMedia, extractMediaInfo, extractMediaInfoFromToolResult, getMediaTypeFromExtension, getMediaTypeFromUrl, getToolDefinition, getToolIconName, hasSuggestions, parseSuggestions, parseToolResultContent, processConversation, useJadeSession, useMedia };
|