@seaverse/conversation-sdk 0.2.0 → 0.2.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 +253 -86
- package/dist/aggregated/apps-with-conversations.d.ts +2 -2
- package/dist/aggregated/apps-with-conversations.js +20 -19
- package/dist/aggregated/apps-with-conversations.js.map +1 -1
- package/dist/functional-api.d.ts +6 -1
- package/dist/functional-api.d.ts.map +1 -1
- package/dist/functional-api.js +24 -1
- package/dist/functional-api.js.map +1 -1
- package/dist/index.d.ts +2 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js.map +1 -1
- package/dist/resources/ConversationsResource.d.ts +5 -1
- package/dist/resources/ConversationsResource.d.ts.map +1 -1
- package/dist/resources/ConversationsResource.js +43 -7
- package/dist/resources/ConversationsResource.js.map +1 -1
- package/dist/transforms/conversation.transform.d.ts +5 -1
- package/dist/transforms/conversation.transform.d.ts.map +1 -1
- package/dist/transforms/conversation.transform.js +19 -0
- package/dist/transforms/conversation.transform.js.map +1 -1
- package/dist/types/index.d.ts +1 -1
- package/dist/types/index.d.ts.map +1 -1
- package/dist/types/models.types.d.ts +17 -1
- package/dist/types/models.types.d.ts.map +1 -1
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -1,18 +1,18 @@
|
|
|
1
1
|
# @seaverse/conversation-sdk
|
|
2
2
|
|
|
3
|
-
SeaVerse Conversation SDK -
|
|
3
|
+
SeaVerse Conversation SDK - A functional SDK for managing conversations and messages.
|
|
4
4
|
|
|
5
|
-
##
|
|
5
|
+
## Installation
|
|
6
6
|
|
|
7
7
|
```bash
|
|
8
8
|
npm install @seaverse/conversation-sdk
|
|
9
|
-
#
|
|
9
|
+
# or
|
|
10
10
|
pnpm add @seaverse/conversation-sdk
|
|
11
11
|
```
|
|
12
12
|
|
|
13
|
-
##
|
|
13
|
+
## Quick Start
|
|
14
14
|
|
|
15
|
-
###
|
|
15
|
+
### Initialize SDK
|
|
16
16
|
|
|
17
17
|
```typescript
|
|
18
18
|
import { initConversationSdk } from '@seaverse/conversation-sdk';
|
|
@@ -23,19 +23,54 @@ const sdk = initConversationSdk({
|
|
|
23
23
|
});
|
|
24
24
|
```
|
|
25
25
|
|
|
26
|
-
###
|
|
26
|
+
### Get Conversations List
|
|
27
27
|
|
|
28
28
|
```typescript
|
|
29
|
-
//
|
|
29
|
+
// Get all conversations with pagination
|
|
30
|
+
const result = await sdk.getConversationsList({
|
|
31
|
+
userId: 'user-123',
|
|
32
|
+
appId: 'app-456',
|
|
33
|
+
page: 1,
|
|
34
|
+
pageSize: 20
|
|
35
|
+
});
|
|
36
|
+
|
|
37
|
+
console.log(result.data); // Conversation[]
|
|
38
|
+
console.log(result.pagination); // Pagination info
|
|
39
|
+
```
|
|
40
|
+
|
|
41
|
+
### Create Conversation
|
|
42
|
+
|
|
43
|
+
```typescript
|
|
44
|
+
// Create a new conversation
|
|
45
|
+
const conversation = await sdk.createConversation({
|
|
46
|
+
title: 'My Conversation',
|
|
47
|
+
appId: 'app-123',
|
|
48
|
+
userId: 'user-456'
|
|
49
|
+
});
|
|
50
|
+
|
|
51
|
+
console.log(conversation.conversation_id); // New conversation ID
|
|
52
|
+
```
|
|
53
|
+
|
|
54
|
+
### Delete Conversation
|
|
55
|
+
|
|
56
|
+
```typescript
|
|
57
|
+
// Delete a conversation
|
|
58
|
+
await sdk.deleteConversation('conversation-id');
|
|
59
|
+
```
|
|
60
|
+
|
|
61
|
+
### Get Apps with Conversations
|
|
62
|
+
|
|
63
|
+
```typescript
|
|
64
|
+
// Get all apps, each app returns all conversations sorted by updated time
|
|
30
65
|
const result = await sdk.getAppsWithConversationsList({
|
|
31
66
|
page: 1,
|
|
32
67
|
pageSize: 20
|
|
33
68
|
});
|
|
34
69
|
|
|
35
70
|
console.log(result.apps); // AppWithConversations[]
|
|
36
|
-
console.log(result.hasMore); // boolean -
|
|
71
|
+
console.log(result.hasMore); // boolean - whether there's a next page
|
|
37
72
|
|
|
38
|
-
//
|
|
73
|
+
// Get a specific app
|
|
39
74
|
const appResult = await sdk.getAppsWithConversationsList({
|
|
40
75
|
appId: 'app-123',
|
|
41
76
|
page: 1,
|
|
@@ -43,106 +78,231 @@ const appResult = await sdk.getAppsWithConversationsList({
|
|
|
43
78
|
});
|
|
44
79
|
```
|
|
45
80
|
|
|
46
|
-
###
|
|
81
|
+
### Get Messages List
|
|
47
82
|
|
|
48
83
|
```typescript
|
|
49
|
-
//
|
|
84
|
+
// Get message list for a conversation (descending order, newest first)
|
|
50
85
|
const result = await sdk.getMessagesList('conversation-id', {
|
|
51
86
|
page: 1,
|
|
52
87
|
pageSize: 50
|
|
53
88
|
});
|
|
54
89
|
|
|
55
90
|
console.log(result.messages); // Message[]
|
|
56
|
-
console.log(result.hasMore); // boolean -
|
|
91
|
+
console.log(result.hasMore); // boolean - whether there's a next page
|
|
57
92
|
```
|
|
58
93
|
|
|
59
|
-
## API
|
|
94
|
+
## API Reference
|
|
60
95
|
|
|
61
96
|
### initConversationSdk(config)
|
|
62
97
|
|
|
63
|
-
|
|
98
|
+
Initialize the Conversation SDK and return functional API.
|
|
64
99
|
|
|
65
|
-
|
|
100
|
+
**Parameters**:
|
|
66
101
|
```typescript
|
|
67
102
|
{
|
|
68
|
-
environment: 'dev' | 'prod'; //
|
|
69
|
-
token: string; //
|
|
70
|
-
getToken?: () => Promise<string>; //
|
|
71
|
-
fetch?: typeof fetch; //
|
|
72
|
-
timeout?: number; //
|
|
103
|
+
environment: 'dev' | 'prod'; // Environment configuration
|
|
104
|
+
token: string; // Access token
|
|
105
|
+
getToken?: () => Promise<string>; // Dynamic token getter (optional)
|
|
106
|
+
fetch?: typeof fetch; // Custom fetch implementation (optional)
|
|
107
|
+
timeout?: number; // Request timeout, default 30000ms (optional)
|
|
73
108
|
}
|
|
74
109
|
```
|
|
75
110
|
|
|
76
|
-
|
|
111
|
+
**Returns**: Object containing the following methods:
|
|
112
|
+
- `getConversationsList` - Get conversations list with pagination
|
|
113
|
+
- `getAppsWithConversationsList` - Get apps with their conversations
|
|
114
|
+
- `getMessagesList` - Get messages for a conversation
|
|
115
|
+
- `createConversation` - Create a new conversation
|
|
116
|
+
- `deleteConversation` - Delete a conversation
|
|
117
|
+
|
|
118
|
+
---
|
|
119
|
+
|
|
120
|
+
### getConversationsList(options?)
|
|
121
|
+
|
|
122
|
+
Get list of conversations with pagination.
|
|
123
|
+
|
|
124
|
+
**Parameters**:
|
|
125
|
+
```typescript
|
|
126
|
+
{
|
|
127
|
+
appId?: string; // Filter by app ID
|
|
128
|
+
userId?: string; // Filter by user ID
|
|
129
|
+
orderBy?: 'createdAt' | 'updatedAt' | 'lastActiveAt'; // Sort field, default 'createdAt'
|
|
130
|
+
order?: 'asc' | 'desc'; // Sort direction, default 'desc'
|
|
131
|
+
page?: number; // Page number, default 1
|
|
132
|
+
pageSize?: number; // Items per page, default 20
|
|
133
|
+
}
|
|
134
|
+
```
|
|
135
|
+
|
|
136
|
+
**Returns**:
|
|
137
|
+
```typescript
|
|
138
|
+
Promise<{
|
|
139
|
+
data: Conversation[];
|
|
140
|
+
pagination: {
|
|
141
|
+
page: number;
|
|
142
|
+
pageSize: number;
|
|
143
|
+
total: number;
|
|
144
|
+
totalPages: number;
|
|
145
|
+
hasNextPage: boolean;
|
|
146
|
+
hasPrevPage: boolean;
|
|
147
|
+
};
|
|
148
|
+
}>
|
|
149
|
+
```
|
|
150
|
+
|
|
151
|
+
---
|
|
152
|
+
|
|
153
|
+
### createConversation(data)
|
|
154
|
+
|
|
155
|
+
Create a new conversation.
|
|
156
|
+
|
|
157
|
+
**Parameters**:
|
|
158
|
+
```typescript
|
|
159
|
+
{
|
|
160
|
+
title: string; // Conversation title
|
|
161
|
+
appId?: string | null; // Associated app ID (optional)
|
|
162
|
+
userId: string; // User ID
|
|
163
|
+
}
|
|
164
|
+
```
|
|
165
|
+
|
|
166
|
+
**Returns**:
|
|
167
|
+
```typescript
|
|
168
|
+
Promise<ConversationResponse>
|
|
169
|
+
```
|
|
170
|
+
|
|
171
|
+
The response includes:
|
|
172
|
+
```typescript
|
|
173
|
+
{
|
|
174
|
+
conversation_id: string;
|
|
175
|
+
app_id: string | null;
|
|
176
|
+
backend: string;
|
|
177
|
+
backend_session_id: string | null;
|
|
178
|
+
title: string;
|
|
179
|
+
created_at: number; // Unix timestamp in seconds
|
|
180
|
+
updated_at: number; // Unix timestamp in seconds
|
|
181
|
+
message_count: number;
|
|
182
|
+
skills_json: any | null;
|
|
183
|
+
metadata: Record<string, unknown>;
|
|
184
|
+
user_id: string;
|
|
185
|
+
}
|
|
186
|
+
```
|
|
187
|
+
|
|
188
|
+
---
|
|
189
|
+
|
|
190
|
+
### deleteConversation(conversationId)
|
|
191
|
+
|
|
192
|
+
Delete a conversation by ID.
|
|
193
|
+
|
|
194
|
+
**Parameters**:
|
|
195
|
+
- `conversationId`: `string` - Conversation ID to delete
|
|
196
|
+
|
|
197
|
+
**Returns**: `Promise<void>`
|
|
198
|
+
|
|
199
|
+
---
|
|
77
200
|
|
|
78
201
|
### getAppsWithConversationsList(options?)
|
|
79
202
|
|
|
80
|
-
|
|
203
|
+
Get list of apps with their conversations. Each app returns all conversations sorted by updated time (newest first).
|
|
81
204
|
|
|
82
|
-
|
|
205
|
+
**Parameters**:
|
|
83
206
|
```typescript
|
|
84
207
|
{
|
|
85
|
-
appId?: string; //
|
|
86
|
-
page?: number; //
|
|
87
|
-
pageSize?: number; //
|
|
208
|
+
appId?: string; // Optional, filter by app ID
|
|
209
|
+
page?: number; // Page number, default 1
|
|
210
|
+
pageSize?: number; // Items per page, default 20
|
|
88
211
|
}
|
|
89
212
|
```
|
|
90
213
|
|
|
91
|
-
|
|
214
|
+
**Returns**:
|
|
92
215
|
```typescript
|
|
93
216
|
Promise<{
|
|
94
217
|
apps: AppWithConversations[];
|
|
95
|
-
hasMore: boolean; //
|
|
218
|
+
hasMore: boolean; // Whether there's a next page
|
|
96
219
|
}>
|
|
97
220
|
```
|
|
98
221
|
|
|
222
|
+
---
|
|
223
|
+
|
|
99
224
|
### getMessagesList(conversationId, options?)
|
|
100
225
|
|
|
101
|
-
|
|
226
|
+
Get message list for a conversation (descending order by time, newest first).
|
|
102
227
|
|
|
103
|
-
|
|
104
|
-
- `conversationId`: `string` -
|
|
105
|
-
- `options?`:
|
|
228
|
+
**Parameters**:
|
|
229
|
+
- `conversationId`: `string` - Conversation ID (required)
|
|
230
|
+
- `options?`: Optional query options
|
|
106
231
|
```typescript
|
|
107
232
|
{
|
|
108
|
-
page?: number; //
|
|
109
|
-
pageSize?: number; //
|
|
233
|
+
page?: number; // Page number, default 1
|
|
234
|
+
pageSize?: number; // Items per page, default 100
|
|
110
235
|
}
|
|
111
236
|
```
|
|
112
237
|
|
|
113
|
-
|
|
238
|
+
**Returns**:
|
|
114
239
|
```typescript
|
|
115
240
|
Promise<{
|
|
116
241
|
messages: Message[];
|
|
117
|
-
hasMore: boolean; //
|
|
242
|
+
hasMore: boolean; // Whether there's a next page
|
|
118
243
|
}>
|
|
119
244
|
```
|
|
120
245
|
|
|
121
|
-
##
|
|
246
|
+
## Type Definitions
|
|
247
|
+
|
|
248
|
+
### Conversation
|
|
249
|
+
|
|
250
|
+
```typescript
|
|
251
|
+
interface Conversation {
|
|
252
|
+
id: string;
|
|
253
|
+
title: string;
|
|
254
|
+
appId: string | null;
|
|
255
|
+
userId: string;
|
|
256
|
+
createdAt: number; // Unix timestamp in milliseconds
|
|
257
|
+
updatedAt: number; // Unix timestamp in milliseconds
|
|
258
|
+
lastActiveAt: number; // Unix timestamp in milliseconds
|
|
259
|
+
messageCount?: number; // Message count
|
|
260
|
+
}
|
|
261
|
+
```
|
|
262
|
+
|
|
263
|
+
### ConversationResponse
|
|
264
|
+
|
|
265
|
+
API response format (snake_case, matches runtime-plugins):
|
|
266
|
+
|
|
267
|
+
```typescript
|
|
268
|
+
interface ConversationResponse {
|
|
269
|
+
conversation_id: string;
|
|
270
|
+
app_id: string | null;
|
|
271
|
+
backend: string;
|
|
272
|
+
backend_session_id: string | null;
|
|
273
|
+
title: string;
|
|
274
|
+
created_at: number; // Unix timestamp in seconds
|
|
275
|
+
updated_at: number; // Unix timestamp in seconds
|
|
276
|
+
message_count: number;
|
|
277
|
+
skills_json: any | null;
|
|
278
|
+
metadata: Record<string, unknown>;
|
|
279
|
+
user_id: string;
|
|
280
|
+
}
|
|
281
|
+
```
|
|
122
282
|
|
|
123
283
|
### Message
|
|
124
284
|
|
|
125
285
|
```typescript
|
|
126
286
|
interface Message {
|
|
127
287
|
id: string;
|
|
128
|
-
role?: 'user' | 'assistant' | 'system'; // tips
|
|
129
|
-
content?: string; // tips
|
|
130
|
-
timestamp: number; //
|
|
288
|
+
role?: 'user' | 'assistant' | 'system'; // tips messages don't have role
|
|
289
|
+
content?: string; // tips messages don't return this field
|
|
290
|
+
timestamp: number; // Unix timestamp in seconds
|
|
131
291
|
type?: 'text' | 'conversation_tips' | string;
|
|
132
|
-
tips?: string[]; // conversation_tips
|
|
133
|
-
toolCalls?: ToolCall[]; //
|
|
292
|
+
tips?: string[]; // Specific to conversation_tips type
|
|
293
|
+
toolCalls?: ToolCall[]; // Tool call information
|
|
134
294
|
}
|
|
135
295
|
```
|
|
136
296
|
|
|
137
|
-
**Tips
|
|
297
|
+
**Tips Message Format**:
|
|
138
298
|
```typescript
|
|
139
299
|
{
|
|
140
300
|
id: string;
|
|
141
|
-
conversation_id: string; //
|
|
301
|
+
conversation_id: string; // Only tips messages have this field
|
|
142
302
|
timestamp: number;
|
|
143
303
|
type: "conversation_tips";
|
|
144
304
|
tips: string[];
|
|
145
|
-
//
|
|
305
|
+
// Note: tips messages don't have content and role fields
|
|
146
306
|
}
|
|
147
307
|
```
|
|
148
308
|
|
|
@@ -157,27 +317,12 @@ interface ToolCall {
|
|
|
157
317
|
}
|
|
158
318
|
```
|
|
159
319
|
|
|
160
|
-
### Conversation
|
|
161
|
-
|
|
162
|
-
```typescript
|
|
163
|
-
interface Conversation {
|
|
164
|
-
id: string;
|
|
165
|
-
title: string;
|
|
166
|
-
appId: string | null;
|
|
167
|
-
userId: string;
|
|
168
|
-
createdAt: number; // 毫秒时间戳
|
|
169
|
-
updatedAt: number; // 毫秒时间戳
|
|
170
|
-
lastActiveAt: number; // 毫秒时间戳
|
|
171
|
-
messageCount?: number; // 消息计数
|
|
172
|
-
}
|
|
173
|
-
```
|
|
174
|
-
|
|
175
320
|
### AppWithConversations
|
|
176
321
|
|
|
177
322
|
```typescript
|
|
178
323
|
interface AppWithConversations {
|
|
179
324
|
app: App;
|
|
180
|
-
conversations: Conversation[]; //
|
|
325
|
+
conversations: Conversation[]; // All conversations sorted by updatedAt desc
|
|
181
326
|
}
|
|
182
327
|
```
|
|
183
328
|
|
|
@@ -197,14 +342,14 @@ interface App {
|
|
|
197
342
|
positiveCount: number;
|
|
198
343
|
forkCount: number;
|
|
199
344
|
commentCount: number;
|
|
200
|
-
createdAt: number; //
|
|
201
|
-
updatedAt: number; //
|
|
345
|
+
createdAt: number; // Unix timestamp in milliseconds
|
|
346
|
+
updatedAt: number; // Unix timestamp in milliseconds
|
|
202
347
|
}
|
|
203
348
|
```
|
|
204
349
|
|
|
205
|
-
##
|
|
350
|
+
## Error Handling
|
|
206
351
|
|
|
207
|
-
SDK
|
|
352
|
+
The SDK provides several error types:
|
|
208
353
|
|
|
209
354
|
```typescript
|
|
210
355
|
import {
|
|
@@ -216,69 +361,91 @@ import {
|
|
|
216
361
|
} from '@seaverse/conversation-sdk';
|
|
217
362
|
|
|
218
363
|
try {
|
|
219
|
-
const result = await sdk.
|
|
364
|
+
const result = await sdk.getConversationsList();
|
|
220
365
|
} catch (error) {
|
|
221
366
|
if (error instanceof AuthError) {
|
|
222
|
-
console.error('
|
|
367
|
+
console.error('Authentication failed:', error.message);
|
|
223
368
|
} else if (error instanceof NetworkError) {
|
|
224
|
-
console.error('
|
|
369
|
+
console.error('Network error:', error.message);
|
|
225
370
|
} else if (error instanceof TimeoutError) {
|
|
226
|
-
console.error('
|
|
371
|
+
console.error('Request timeout:', error.message);
|
|
372
|
+
} else if (error instanceof ProtocolError) {
|
|
373
|
+
console.error('Protocol error:', error.message);
|
|
227
374
|
} else {
|
|
228
|
-
console.error('
|
|
375
|
+
console.error('Unknown error:', error);
|
|
229
376
|
}
|
|
230
377
|
}
|
|
231
378
|
```
|
|
232
379
|
|
|
233
|
-
##
|
|
380
|
+
## Complete Example
|
|
234
381
|
|
|
235
382
|
```typescript
|
|
236
383
|
import { initConversationSdk } from '@seaverse/conversation-sdk';
|
|
237
384
|
|
|
238
|
-
//
|
|
385
|
+
// Initialize SDK
|
|
239
386
|
const sdk = initConversationSdk({
|
|
240
387
|
environment: 'prod',
|
|
241
388
|
token: 'your-access-token'
|
|
242
389
|
});
|
|
243
390
|
|
|
244
|
-
// 1.
|
|
391
|
+
// 1. Create a new conversation
|
|
392
|
+
const newConversation = await sdk.createConversation({
|
|
393
|
+
title: 'My New Chat',
|
|
394
|
+
appId: 'app-123',
|
|
395
|
+
userId: 'user-456'
|
|
396
|
+
});
|
|
397
|
+
console.log('Created:', newConversation.conversation_id);
|
|
398
|
+
|
|
399
|
+
// 2. Get conversations list
|
|
400
|
+
const conversations = await sdk.getConversationsList({
|
|
401
|
+
userId: 'user-456',
|
|
402
|
+
page: 1,
|
|
403
|
+
pageSize: 10
|
|
404
|
+
});
|
|
405
|
+
console.log('Conversations:', conversations.data);
|
|
406
|
+
console.log('Total:', conversations.pagination.total);
|
|
407
|
+
|
|
408
|
+
// 3. Get all apps with their conversations
|
|
245
409
|
const appsResult = await sdk.getAppsWithConversationsList({
|
|
246
410
|
page: 1,
|
|
247
411
|
pageSize: 20
|
|
248
412
|
});
|
|
249
|
-
|
|
250
413
|
console.log('Apps:', appsResult.apps);
|
|
251
|
-
console.log('
|
|
414
|
+
console.log('Has more:', appsResult.hasMore);
|
|
252
415
|
|
|
253
|
-
//
|
|
254
|
-
const conversationId =
|
|
416
|
+
// 4. Get messages for a conversation
|
|
417
|
+
const conversationId = conversations.data[0]?.id;
|
|
255
418
|
if (conversationId) {
|
|
256
419
|
const messagesResult = await sdk.getMessagesList(conversationId, {
|
|
257
420
|
page: 1,
|
|
258
421
|
pageSize: 50
|
|
259
422
|
});
|
|
260
423
|
|
|
261
|
-
console.log('
|
|
262
|
-
console.log('
|
|
424
|
+
console.log('Messages:', messagesResult.messages);
|
|
425
|
+
console.log('Has more messages:', messagesResult.hasMore);
|
|
263
426
|
|
|
264
|
-
//
|
|
427
|
+
// Handle different message types
|
|
265
428
|
messagesResult.messages.forEach(msg => {
|
|
266
429
|
if (msg.type === 'conversation_tips') {
|
|
267
430
|
console.log('Tips:', msg.tips);
|
|
268
431
|
} else {
|
|
269
|
-
console.log('
|
|
432
|
+
console.log('Message:', msg.content);
|
|
270
433
|
}
|
|
271
434
|
});
|
|
272
435
|
}
|
|
436
|
+
|
|
437
|
+
// 5. Delete a conversation
|
|
438
|
+
await sdk.deleteConversation(newConversation.conversation_id);
|
|
439
|
+
console.log('Deleted:', newConversation.conversation_id);
|
|
273
440
|
```
|
|
274
441
|
|
|
275
|
-
##
|
|
442
|
+
## Environment Configuration
|
|
276
443
|
|
|
277
|
-
SDK
|
|
444
|
+
The SDK automatically selects the corresponding service endpoint based on the `environment` parameter:
|
|
278
445
|
|
|
279
|
-
- `'dev'`:
|
|
280
|
-
- `'prod'`:
|
|
446
|
+
- `'dev'`: Development environment (https://postgrest.sg.seaverse.dev)
|
|
447
|
+
- `'prod'`: Production environment (https://db.seaverse.ai)
|
|
281
448
|
|
|
282
|
-
##
|
|
449
|
+
## License
|
|
283
450
|
|
|
284
451
|
MIT
|
|
@@ -25,12 +25,12 @@ export interface ListAppsWithConversationsConfig {
|
|
|
25
25
|
}
|
|
26
26
|
/**
|
|
27
27
|
* List apps with their conversations (aggregated query)
|
|
28
|
-
*
|
|
28
|
+
* Returns ALL conversations for each app, sorted by updated_at descending (newest first).
|
|
29
29
|
*
|
|
30
30
|
* Implementation: Real-time message counting
|
|
31
31
|
* - Queries all conversations
|
|
32
32
|
* - Counts messages for each conversation from messages table
|
|
33
|
-
* -
|
|
33
|
+
* - Returns all conversations sorted by last update time
|
|
34
34
|
*
|
|
35
35
|
* This ensures accuracy even if message_count field is not maintained.
|
|
36
36
|
*
|
|
@@ -3,12 +3,12 @@ import { transformApp } from '../transforms/app.transform.js';
|
|
|
3
3
|
import { pageToOffset } from '../types/pagination.types.js';
|
|
4
4
|
/**
|
|
5
5
|
* List apps with their conversations (aggregated query)
|
|
6
|
-
*
|
|
6
|
+
* Returns ALL conversations for each app, sorted by updated_at descending (newest first).
|
|
7
7
|
*
|
|
8
8
|
* Implementation: Real-time message counting
|
|
9
9
|
* - Queries all conversations
|
|
10
10
|
* - Counts messages for each conversation from messages table
|
|
11
|
-
* -
|
|
11
|
+
* - Returns all conversations sorted by last update time
|
|
12
12
|
*
|
|
13
13
|
* This ensures accuracy even if message_count field is not maintained.
|
|
14
14
|
*
|
|
@@ -27,12 +27,14 @@ export async function listAppsWithConversations(config) {
|
|
|
27
27
|
const { limit, offset } = pageToOffset(page, pageSize);
|
|
28
28
|
// Parallel requests to avoid waterfall
|
|
29
29
|
const [dbApps, dbConversations] = await Promise.all([
|
|
30
|
-
// Get apps with pagination
|
|
30
|
+
// Get apps with pagination, sorted by created_at descending
|
|
31
31
|
db.get('apps', appId
|
|
32
|
-
? { filter: { app_id: `eq.${appId}` }, limit, offset, count: 'exact' }
|
|
33
|
-
: { limit, offset, count: 'exact' }),
|
|
34
|
-
// Get conversations (all conversations
|
|
35
|
-
db.get('conversations', appId
|
|
32
|
+
? { filter: { app_id: `eq.${appId}` }, order: 'created_at.desc', limit, offset, count: 'exact' }
|
|
33
|
+
: { order: 'created_at.desc', limit, offset, count: 'exact' }),
|
|
34
|
+
// Get conversations (all conversations), sorted by updated_at descending
|
|
35
|
+
db.get('conversations', appId
|
|
36
|
+
? { filter: { app_id: `eq.${appId}` }, order: 'updated_at.desc' }
|
|
37
|
+
: { order: 'updated_at.desc' }),
|
|
36
38
|
]);
|
|
37
39
|
// Extract all conversation IDs for message counting
|
|
38
40
|
const conversationIds = dbConversations.data
|
|
@@ -52,31 +54,30 @@ export async function listAppsWithConversations(config) {
|
|
|
52
54
|
realMessageCounts.set(msg.conversation_id, count + 1);
|
|
53
55
|
}
|
|
54
56
|
}
|
|
55
|
-
// Group conversations by appId and
|
|
56
|
-
|
|
57
|
+
// Group conversations by appId and include ALL conversations
|
|
58
|
+
// Conversations are already sorted by updated_at.desc from database query
|
|
59
|
+
const conversationsByAppId = new Map();
|
|
57
60
|
for (const dbConv of dbConversations.data) {
|
|
58
61
|
const conv = transformConversation(dbConv);
|
|
59
62
|
const convId = dbConv.conversation_id || dbConv.id;
|
|
60
63
|
// Use real message count instead of db field
|
|
61
64
|
const realCount = realMessageCounts.get(convId) || 0;
|
|
65
|
+
conv.messageCount = realCount;
|
|
62
66
|
// Only process conversations with appId (skip global conversations)
|
|
63
67
|
if (conv.appId) {
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
// Only keep the conversation with highest REAL message count
|
|
67
|
-
if (!existing || realCount > existingCount) {
|
|
68
|
-
// Update messageCount with real count
|
|
69
|
-
conv.messageCount = realCount;
|
|
70
|
-
topConversationByAppId.set(conv.appId, conv);
|
|
68
|
+
if (!conversationsByAppId.has(conv.appId)) {
|
|
69
|
+
conversationsByAppId.set(conv.appId, []);
|
|
71
70
|
}
|
|
71
|
+
conversationsByAppId.get(conv.appId).push(conv);
|
|
72
72
|
}
|
|
73
73
|
}
|
|
74
|
-
// Build response (each app has
|
|
74
|
+
// Build response (each app has ALL conversations sorted by updatedAt)
|
|
75
75
|
const appsWithConversations = dbApps.data.map((dbApp) => {
|
|
76
|
-
const
|
|
76
|
+
const appId = (dbApp.app_id || dbApp.id);
|
|
77
|
+
const conversations = conversationsByAppId.get(appId) || [];
|
|
77
78
|
return {
|
|
78
79
|
app: transformApp(dbApp),
|
|
79
|
-
conversations
|
|
80
|
+
conversations,
|
|
80
81
|
};
|
|
81
82
|
});
|
|
82
83
|
// Calculate hasMore (是否还有下一页)
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"apps-with-conversations.js","sourceRoot":"","sources":["../../src/aggregated/apps-with-conversations.ts"],"names":[],"mappings":"AAOA,OAAO,EAAE,qBAAqB,EAAE,MAAM,yCAAyC,CAAC;AAChF,OAAO,EAAE,YAAY,EAAE,MAAM,gCAAgC,CAAC;AAC9D,OAAO,EAAE,YAAY,EAAE,MAAM,8BAA8B,CAAC;AA6B5D;;;;;;;;;;;;;;;;;;;GAmBG;AACH,MAAM,CAAC,KAAK,UAAU,yBAAyB,CAC7C,MAAuC;IAEvC,MAAM,EACJ,KAAK,EACL,IAAI,GAAG,CAAC,EACR,QAAQ,GAAG,EAAE,EACb,EAAE,GACH,GAAG,MAAM,CAAC;IAEX,8BAA8B;IAC9B,MAAM,EAAE,KAAK,EAAE,MAAM,EAAE,GAAG,YAAY,CAAC,IAAI,EAAE,QAAQ,CAAC,CAAC;IAEvD,uCAAuC;IACvC,MAAM,CAAC,MAAM,EAAE,eAAe,CAAC,GAAG,MAAM,OAAO,CAAC,GAAG,CAAC;QAClD,
|
|
1
|
+
{"version":3,"file":"apps-with-conversations.js","sourceRoot":"","sources":["../../src/aggregated/apps-with-conversations.ts"],"names":[],"mappings":"AAOA,OAAO,EAAE,qBAAqB,EAAE,MAAM,yCAAyC,CAAC;AAChF,OAAO,EAAE,YAAY,EAAE,MAAM,gCAAgC,CAAC;AAC9D,OAAO,EAAE,YAAY,EAAE,MAAM,8BAA8B,CAAC;AA6B5D;;;;;;;;;;;;;;;;;;;GAmBG;AACH,MAAM,CAAC,KAAK,UAAU,yBAAyB,CAC7C,MAAuC;IAEvC,MAAM,EACJ,KAAK,EACL,IAAI,GAAG,CAAC,EACR,QAAQ,GAAG,EAAE,EACb,EAAE,GACH,GAAG,MAAM,CAAC;IAEX,8BAA8B;IAC9B,MAAM,EAAE,KAAK,EAAE,MAAM,EAAE,GAAG,YAAY,CAAC,IAAI,EAAE,QAAQ,CAAC,CAAC;IAEvD,uCA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CAAC,IAAI,EAAE,CAAC;QAC5D,OAAO;YACL,GAAG,EAAE,YAAY,CAAC,KAAK,CAAC;YACxB,aAAa;SACd,CAAC;IACJ,CAAC,CAAC,CAAC;IAEH,8BAA8B;IAC9B,MAAM,KAAK,GAAG,MAAM,CAAC,KAAK,IAAI,CAAC,CAAC;IAChC,MAAM,OAAO,GAAG,IAAI,GAAG,QAAQ,GAAG,KAAK,CAAC;IAExC,OAAO;QACL,IAAI,EAAE,qBAAqB;QAC3B,OAAO;KACR,CAAC;AACJ,CAAC"}
|
package/dist/functional-api.d.ts
CHANGED
|
@@ -3,11 +3,14 @@
|
|
|
3
3
|
* 提供简洁的函数式调用方式
|
|
4
4
|
*/
|
|
5
5
|
import type { ConversationClientConfig } from './types/config.types.js';
|
|
6
|
-
import type { ListAppsWithConversationsResult, Message } from './types/index.js';
|
|
6
|
+
import type { ListAppsWithConversationsResult, Message, ConversationResponse, Conversation } from './types/index.js';
|
|
7
|
+
import type { PaginatedResult } from './types/pagination.types.js';
|
|
8
|
+
import { type CreateConversationData, type ListConversationsOptions } from './resources/ConversationsResource.js';
|
|
7
9
|
/**
|
|
8
10
|
* 初始化 Conversation SDK
|
|
9
11
|
*/
|
|
10
12
|
export declare function initConversationSdk(config: ConversationClientConfig): {
|
|
13
|
+
getConversationsList: (options?: ListConversationsOptions) => Promise<PaginatedResult<Conversation>>;
|
|
11
14
|
getAppsWithConversationsList: (options?: {
|
|
12
15
|
appId?: string;
|
|
13
16
|
page?: number;
|
|
@@ -20,5 +23,7 @@ export declare function initConversationSdk(config: ConversationClientConfig): {
|
|
|
20
23
|
messages: Message[];
|
|
21
24
|
hasMore: boolean;
|
|
22
25
|
}>;
|
|
26
|
+
createConversation: (data: CreateConversationData) => Promise<ConversationResponse>;
|
|
27
|
+
deleteConversation: (conversationId: string) => Promise<void>;
|
|
23
28
|
};
|
|
24
29
|
//# sourceMappingURL=functional-api.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"functional-api.d.ts","sourceRoot":"","sources":["../src/functional-api.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAIH,OAAO,KAAK,EAAE,wBAAwB,EAAE,MAAM,yBAAyB,CAAC;AAGxE,OAAO,KAAK,EAAE,+BAA+B,EAAE,OAAO,EAAE,MAAM,kBAAkB,CAAC;
|
|
1
|
+
{"version":3,"file":"functional-api.d.ts","sourceRoot":"","sources":["../src/functional-api.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAIH,OAAO,KAAK,EAAE,wBAAwB,EAAE,MAAM,yBAAyB,CAAC;AAGxE,OAAO,KAAK,EAAE,+BAA+B,EAAE,OAAO,EAAE,oBAAoB,EAAE,YAAY,EAAE,MAAM,kBAAkB,CAAC;AACrH,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,6BAA6B,CAAC;AAEnE,OAAO,EAAyB,KAAK,sBAAsB,EAAE,KAAK,wBAAwB,EAAE,MAAM,sCAAsC,CAAC;AAEzI;;GAEG;AACH,wBAAgB,mBAAmB,CAAC,MAAM,EAAE,wBAAwB;qCA6BtD,wBAAwB,KACjC,OAAO,CAAC,eAAe,CAAC,YAAY,CAAC,CAAC;6CAQa;QACpD,KAAK,CAAC,EAAE,MAAM,CAAC;QACf,IAAI,CAAC,EAAE,MAAM,CAAC;QACd,QAAQ,CAAC,EAAE,MAAM,CAAC;KACnB,KAAG,OAAO,CAAC,+BAA+B,CAAC;sCAW1B,MAAM,YACZ;QACR,IAAI,CAAC,EAAE,MAAM,CAAC;QACd,QAAQ,CAAC,EAAE,MAAM,CAAC;KACnB,KACA,OAAO,CAAC;QAAE,QAAQ,EAAE,OAAO,EAAE,CAAC;QAAC,OAAO,EAAE,OAAO,CAAA;KAAE,CAAC;+BAab,sBAAsB,KAAG,OAAO,CAAC,oBAAoB,CAAC;yCAO5C,MAAM,KAAG,OAAO,CAAC,IAAI,CAAC;EAWzE"}
|
package/dist/functional-api.js
CHANGED
|
@@ -7,6 +7,7 @@ import { DbClient } from './data/DbClient.js';
|
|
|
7
7
|
import { getEnvironmentConfig } from './client/EnvironmentConfig.js';
|
|
8
8
|
import { listAppsWithConversations } from './aggregated/apps-with-conversations.js';
|
|
9
9
|
import { MessagesResource } from './resources/MessagesResource.js';
|
|
10
|
+
import { ConversationsResource } from './resources/ConversationsResource.js';
|
|
10
11
|
/**
|
|
11
12
|
* 初始化 Conversation SDK
|
|
12
13
|
*/
|
|
@@ -30,9 +31,16 @@ export function initConversationSdk(config) {
|
|
|
30
31
|
});
|
|
31
32
|
const db = new DbClient(http);
|
|
32
33
|
const messagesResource = new MessagesResource(db);
|
|
34
|
+
const conversationsResource = new ConversationsResource(db);
|
|
35
|
+
/**
|
|
36
|
+
* 获取会话列表(带分页)
|
|
37
|
+
*/
|
|
38
|
+
async function getConversationsList(options) {
|
|
39
|
+
return conversationsResource.list(options);
|
|
40
|
+
}
|
|
33
41
|
/**
|
|
34
42
|
* 获取 Apps 及其会话列表
|
|
35
|
-
* 每个 app
|
|
43
|
+
* 每个 app 返回全部会话,按最后更新时间倒序排列
|
|
36
44
|
*/
|
|
37
45
|
async function getAppsWithConversationsList(options) {
|
|
38
46
|
return listAppsWithConversations({
|
|
@@ -51,9 +59,24 @@ export function initConversationSdk(config) {
|
|
|
51
59
|
hasMore: result.pagination.hasNextPage,
|
|
52
60
|
};
|
|
53
61
|
}
|
|
62
|
+
/**
|
|
63
|
+
* 创建会话
|
|
64
|
+
*/
|
|
65
|
+
async function createConversation(data) {
|
|
66
|
+
return conversationsResource.createWithResponse(data);
|
|
67
|
+
}
|
|
68
|
+
/**
|
|
69
|
+
* 删除会话
|
|
70
|
+
*/
|
|
71
|
+
async function deleteConversation(conversationId) {
|
|
72
|
+
return conversationsResource.delete(conversationId);
|
|
73
|
+
}
|
|
54
74
|
return {
|
|
75
|
+
getConversationsList,
|
|
55
76
|
getAppsWithConversationsList,
|
|
56
77
|
getMessagesList,
|
|
78
|
+
createConversation,
|
|
79
|
+
deleteConversation,
|
|
57
80
|
};
|
|
58
81
|
}
|
|
59
82
|
//# sourceMappingURL=functional-api.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"functional-api.js","sourceRoot":"","sources":["../src/functional-api.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAAE,gBAAgB,EAAE,MAAM,sBAAsB,CAAC;AACxD,OAAO,EAAE,QAAQ,EAAE,MAAM,oBAAoB,CAAC;AAE9C,OAAO,EAAE,oBAAoB,EAAE,MAAM,+BAA+B,CAAC;AACrE,OAAO,EAAE,yBAAyB,EAAE,MAAM,yCAAyC,CAAC;
|
|
1
|
+
{"version":3,"file":"functional-api.js","sourceRoot":"","sources":["../src/functional-api.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAAE,gBAAgB,EAAE,MAAM,sBAAsB,CAAC;AACxD,OAAO,EAAE,QAAQ,EAAE,MAAM,oBAAoB,CAAC;AAE9C,OAAO,EAAE,oBAAoB,EAAE,MAAM,+BAA+B,CAAC;AACrE,OAAO,EAAE,yBAAyB,EAAE,MAAM,yCAAyC,CAAC;AAGpF,OAAO,EAAE,gBAAgB,EAAE,MAAM,iCAAiC,CAAC;AACnE,OAAO,EAAE,qBAAqB,EAA8D,MAAM,sCAAsC,CAAC;AAEzI;;GAEG;AACH,MAAM,UAAU,mBAAmB,CAAC,MAAgC;IAClE,SAAS;IACT,MAAM,SAAS,GAAG,oBAAoB,CAAC,MAAM,CAAC,WAAW,CAAC,CAAC;IAE3D,MAAM,UAAU,GAAG;QACjB,WAAW,EAAE,MAAM,CAAC,WAAW;QAC/B,KAAK,EAAE,MAAM,CAAC,KAAK;QACnB,QAAQ,EAAE,MAAM,CAAC,QAAQ,IAAI,CAAC,GAAG,EAAE,CAAC,MAAM,CAAC,KAAK,CAAC;QACjD,KAAK,EAAE,MAAM,CAAC,KAAK,IAAI,UAAU,CAAC,KAAK;QACvC,OAAO,EAAE,MAAM,CAAC,OAAO,IAAI,KAAK;QAChC,IAAI,EAAE,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ACL,oBAAoB;QACpB,4BAA4B;QAC5B,eAAe;QACf,kBAAkB;QAClB,kBAAkB;KACnB,CAAC;AACJ,CAAC"}
|
package/dist/index.d.ts
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
export { initConversationSdk } from './functional-api.js';
|
|
2
2
|
export type { ConversationClientConfig } from './types/config.types.js';
|
|
3
|
-
export type { Conversation, Message, ToolCall, } from './types/index.js';
|
|
3
|
+
export type { Conversation, ConversationResponse, Message, ToolCall, } from './types/index.js';
|
|
4
|
+
export type { CreateConversationData } from './resources/ConversationsResource.js';
|
|
4
5
|
export { BaseError, NetworkError, AuthError, TimeoutError, ProtocolError, } from './errors/index.js';
|
|
5
6
|
//# sourceMappingURL=index.d.ts.map
|
package/dist/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,mBAAmB,EAAE,MAAM,qBAAqB,CAAC;AAC1D,YAAY,EAAE,wBAAwB,EAAE,MAAM,yBAAyB,CAAC;AAKxE,YAAY,EAEV,YAAY,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,mBAAmB,EAAE,MAAM,qBAAqB,CAAC;AAC1D,YAAY,EAAE,wBAAwB,EAAE,MAAM,yBAAyB,CAAC;AAKxE,YAAY,EAEV,YAAY,EACZ,oBAAoB,EAEpB,OAAO,EACP,QAAQ,GACT,MAAM,kBAAkB,CAAC;AAE1B,YAAY,EAAE,sBAAsB,EAAE,MAAM,sCAAsC,CAAC;AAKnF,OAAO,EACL,SAAS,EACT,YAAY,EACZ,SAAS,EACT,YAAY,EACZ,aAAa,GACd,MAAM,mBAAmB,CAAC"}
|
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,0CAA0C;AAC1C,QAAQ;AACR,0CAA0C;AAC1C,OAAO,EAAE,mBAAmB,EAAE,MAAM,qBAAqB,CAAC;
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,0CAA0C;AAC1C,QAAQ;AACR,0CAA0C;AAC1C,OAAO,EAAE,mBAAmB,EAAE,MAAM,qBAAqB,CAAC;AAiB1D,0CAA0C;AAC1C,gBAAgB;AAChB,0CAA0C;AAC1C,OAAO,EACL,SAAS,EACT,YAAY,EACZ,SAAS,EACT,YAAY,EACZ,aAAa,GACd,MAAM,mBAAmB,CAAC"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { DbClient } from '../data/DbClient.js';
|
|
2
|
-
import type { Conversation, ListAppsWithConversationsResult } from '../types/models.types.js';
|
|
2
|
+
import type { Conversation, ConversationResponse, ListAppsWithConversationsResult } from '../types/models.types.js';
|
|
3
3
|
import type { PaginationOptions, PaginatedResult } from '../types/pagination.types.js';
|
|
4
4
|
/**
|
|
5
5
|
* 会话列表查询选项
|
|
@@ -56,6 +56,10 @@ export declare class ConversationsResource {
|
|
|
56
56
|
* 创建会话
|
|
57
57
|
*/
|
|
58
58
|
create(data: CreateConversationData): Promise<Conversation>;
|
|
59
|
+
/**
|
|
60
|
+
* 创建会话并返回 API 响应格式(snake_case)
|
|
61
|
+
*/
|
|
62
|
+
createWithResponse(data: CreateConversationData): Promise<ConversationResponse>;
|
|
59
63
|
/**
|
|
60
64
|
* 更新会话
|
|
61
65
|
*/
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ConversationsResource.d.ts","sourceRoot":"","sources":["../../src/resources/ConversationsResource.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,qBAAqB,CAAC;AACpD,OAAO,KAAK,EACV,YAAY,
|
|
1
|
+
{"version":3,"file":"ConversationsResource.d.ts","sourceRoot":"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B,CAAC;IA6BrF;;OAEG;IACG,MAAM,CAAC,EAAE,EAAE,MAAM,EAAE,IAAI,EAAE,sBAAsB,GAAG,OAAO,CAAC,YAAY,CAAC;IAa7E;;OAEG;IACG,MAAM,CAAC,EAAE,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC;IAIvC;;;;;;OAMG;IACG,yBAAyB,CAAC,OAAO,CAAC,EAAE;QACxC,KAAK,CAAC,EAAE,MAAM,CAAC;QACf,MAAM,CAAC,EAAE,MAAM,CAAC;QAChB,IAAI,CAAC,EAAE,MAAM,CAAC;QACd,QAAQ,CAAC,EAAE,MAAM,CAAC;KACnB,GAAG,OAAO,CAAC,+BAA+B,CAAC;CAW7C"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { calculatePaginationMeta, pageToOffset } from '../types/pagination.types.js';
|
|
2
|
-
import { transformConversation, toDbConversation } from '../transforms/conversation.transform.js';
|
|
2
|
+
import { transformConversation, toDbConversation, toConversationResponse } from '../transforms/conversation.transform.js';
|
|
3
3
|
import { listAppsWithConversations as listAppsWithConversationsAggregated } from '../aggregated/apps-with-conversations.js';
|
|
4
4
|
/**
|
|
5
5
|
* 会话资源类
|
|
@@ -57,17 +57,53 @@ export class ConversationsResource {
|
|
|
57
57
|
* 创建会话
|
|
58
58
|
*/
|
|
59
59
|
async create(data) {
|
|
60
|
-
const
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
60
|
+
const now = Math.floor(Date.now() / 1000); // 秒时间戳
|
|
61
|
+
// 生成唯一的 conversation_id(格式与 runtime-plugins 一致)
|
|
62
|
+
const conversationId = crypto.randomUUID();
|
|
63
|
+
// 构建完整的数据库数据(匹配 runtime-plugins 的实现)
|
|
64
|
+
const fullDbData = {
|
|
65
|
+
conversation_id: conversationId,
|
|
66
|
+
app_id: data.appId || null,
|
|
67
|
+
backend: 'seaverse',
|
|
68
|
+
backend_session_id: null,
|
|
69
|
+
title: data.title || 'New Conversation',
|
|
70
|
+
created_at: now,
|
|
71
|
+
updated_at: now,
|
|
72
|
+
message_count: 0,
|
|
73
|
+
user_id: data.userId,
|
|
74
|
+
};
|
|
75
|
+
const results = await this.db.post('conversations', fullDbData, {
|
|
66
76
|
returning: 'representation',
|
|
67
77
|
});
|
|
68
78
|
const dbConv = results[0];
|
|
69
79
|
return transformConversation(dbConv);
|
|
70
80
|
}
|
|
81
|
+
/**
|
|
82
|
+
* 创建会话并返回 API 响应格式(snake_case)
|
|
83
|
+
*/
|
|
84
|
+
async createWithResponse(data) {
|
|
85
|
+
const now = Math.floor(Date.now() / 1000); // 秒时间戳
|
|
86
|
+
// 生成唯一的 conversation_id(格式与 runtime-plugins 一致)
|
|
87
|
+
const conversationId = crypto.randomUUID();
|
|
88
|
+
// 构建完整的数据库数据(匹配 runtime-plugins 的实现)
|
|
89
|
+
const fullDbData = {
|
|
90
|
+
conversation_id: conversationId,
|
|
91
|
+
app_id: data.appId || null,
|
|
92
|
+
backend: 'seaverse',
|
|
93
|
+
backend_session_id: null,
|
|
94
|
+
title: data.title || 'New Conversation',
|
|
95
|
+
created_at: now,
|
|
96
|
+
updated_at: now,
|
|
97
|
+
message_count: 0,
|
|
98
|
+
// user_id 由 RLS trigger 自动填充,但我们也传递以备用
|
|
99
|
+
user_id: data.userId,
|
|
100
|
+
};
|
|
101
|
+
const results = await this.db.post('conversations', fullDbData, {
|
|
102
|
+
returning: 'representation',
|
|
103
|
+
});
|
|
104
|
+
const dbConv = results[0];
|
|
105
|
+
return toConversationResponse(dbConv);
|
|
106
|
+
}
|
|
71
107
|
/**
|
|
72
108
|
* 更新会话
|
|
73
109
|
*/
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ConversationsResource.js","sourceRoot":"","sources":["../../src/resources/ConversationsResource.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"ConversationsResource.js","sourceRoot":"","sources":["../../src/resources/ConversationsResource.ts"],"names":[],"mappings":"AASA,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EAAE,CAAC,KAAK,CACjC,eAAe,EACf,EAAE,EAAE,EAAE,MAAM,EAAE,EAAE,EAAE,EAClB,MAAM,EACN,EAAE,SAAS,EAAE,gBAAgB,EAAE,CAChC,CAAC;QAEF,OAAO,qBAAqB,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC,CAAC;IAC3C,CAAC;IAED;;OAEG;IACH,KAAK,CAAC,MAAM,CAAC,EAAU;QACrB,MAAM,IAAI,CAAC,EAAE,CAAC,MAAM,CAAC,eAAe,EAAE,EAAE,EAAE,EAAE,MAAM,EAAE,EAAE,EAAE,CAAC,CAAC;IAC5D,CAAC;IAED;;;;;;OAMG;IACH,KAAK,CAAC,yBAAyB,CAAC,OAK/B;QACC,iCAAiC;QACjC,qDAAqD;QAErD,OAAO,MAAM,mCAAmC,CAAC;YAC/C,KAAK,EAAE,OAAO,EAAE,KAAK;YACrB,IAAI,EAAE,OAAO,EAAE,IAAI;YACnB,QAAQ,EAAE,OAAO,EAAE,QAAQ;YAC3B,EAAE,EAAE,IAAI,CAAC,EAAE;SACZ,CAAC,CAAC;IACL,CAAC;CACF"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { Conversation, DbSchema } from '../types/models.types.js';
|
|
1
|
+
import type { Conversation, ConversationResponse, DbSchema } from '../types/models.types.js';
|
|
2
2
|
/**
|
|
3
3
|
* 转换数据库会话对象为前端模型
|
|
4
4
|
*/
|
|
@@ -7,4 +7,8 @@ export declare function transformConversation(dbConv: DbSchema.Conversation): Co
|
|
|
7
7
|
* 转换前端会话对象为数据库格式(用于创建/更新)
|
|
8
8
|
*/
|
|
9
9
|
export declare function toDbConversation(conv: Partial<Conversation>): Partial<DbSchema.Conversation>;
|
|
10
|
+
/**
|
|
11
|
+
* 转换数据库会话对象为 API 响应格式(snake_case,匹配 runtime-plugins)
|
|
12
|
+
*/
|
|
13
|
+
export declare function toConversationResponse(dbConv: DbSchema.Conversation): ConversationResponse;
|
|
10
14
|
//# sourceMappingURL=conversation.transform.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"conversation.transform.d.ts","sourceRoot":"","sources":["../../src/transforms/conversation.transform.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,YAAY,EAAE,QAAQ,EAAE,MAAM,0BAA0B,CAAC;
|
|
1
|
+
{"version":3,"file":"conversation.transform.d.ts","sourceRoot":"","sources":["../../src/transforms/conversation.transform.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,YAAY,EAAE,oBAAoB,EAAE,QAAQ,EAAE,MAAM,0BAA0B,CAAC;AAa7F;;GAEG;AACH,wBAAgB,qBAAqB,CACnC,MAAM,EAAE,QAAQ,CAAC,YAAY,GAC5B,YAAY,CAYd;AAED;;GAEG;AACH,wBAAgB,gBAAgB,CAAC,IAAI,EAAE,OAAO,CAAC,YAAY,CAAC,GAAG,OAAO,CAAC,QAAQ,CAAC,YAAY,CAAC,CAU5F;AAED;;GAEG;AACH,wBAAgB,sBAAsB,CACpC,MAAM,EAAE,QAAQ,CAAC,YAAY,GAC5B,oBAAoB,CAetB"}
|
|
@@ -42,4 +42,23 @@ export function toDbConversation(conv) {
|
|
|
42
42
|
result.user_id = conv.userId;
|
|
43
43
|
return result;
|
|
44
44
|
}
|
|
45
|
+
/**
|
|
46
|
+
* 转换数据库会话对象为 API 响应格式(snake_case,匹配 runtime-plugins)
|
|
47
|
+
*/
|
|
48
|
+
export function toConversationResponse(dbConv) {
|
|
49
|
+
const conversation_id = (dbConv.conversation_id || dbConv.id || '').toString();
|
|
50
|
+
return {
|
|
51
|
+
conversation_id,
|
|
52
|
+
app_id: dbConv.app_id,
|
|
53
|
+
backend: 'seaverse',
|
|
54
|
+
backend_session_id: null,
|
|
55
|
+
title: dbConv.title || 'Untitled',
|
|
56
|
+
created_at: dbConv.created_at || 0,
|
|
57
|
+
updated_at: dbConv.updated_at || 0,
|
|
58
|
+
message_count: dbConv.message_count || 0,
|
|
59
|
+
skills_json: null,
|
|
60
|
+
metadata: {},
|
|
61
|
+
user_id: dbConv.user_id,
|
|
62
|
+
};
|
|
63
|
+
}
|
|
45
64
|
//# sourceMappingURL=conversation.transform.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"conversation.transform.js","sourceRoot":"","sources":["../../src/transforms/conversation.transform.ts"],"names":[],"mappings":"AAEA;;GAEG;AACH,SAAS,cAAc,CAAC,OAA2B;IACjD,IAAI,CAAC,OAAO;QAAE,OAAO,CAAC,CAAC;IACvB,uBAAuB;IACvB,IAAI,OAAO,GAAG,WAAW;QAAE,OAAO,OAAO,CAAC;IAC1C,UAAU;IACV,OAAO,OAAO,GAAG,IAAI,CAAC;AACxB,CAAC;AAED;;GAEG;AACH,MAAM,UAAU,qBAAqB,CACnC,MAA6B;IAE7B,MAAM,EAAE,GAAG,CAAC,MAAM,CAAC,eAAe,IAAI,MAAM,CAAC,EAAE,IAAI,EAAE,CAAC,CAAC,QAAQ,EAAE,CAAC;IAClE,OAAO;QACL,EAAE;QACF,KAAK,EAAE,MAAM,CAAC,KAAK,IAAI,UAAU;QACjC,KAAK,EAAE,MAAM,CAAC,MAAM;QACpB,MAAM,EAAE,MAAM,CAAC,OAAO;QACtB,SAAS,EAAE,cAAc,CAAC,MAAM,CAAC,UAAU,CAAC;QAC5C,SAAS,EAAE,cAAc,CAAC,MAAM,CAAC,UAAU,CAAC;QAC5C,YAAY,EAAE,cAAc,CAAC,MAAM,CAAC,uBAAuB,IAAI,MAAM,CAAC,UAAU,CAAC;QACjF,YAAY,EAAE,MAAM,CAAC,aAAa;KACnC,CAAC;AACJ,CAAC;AAED;;GAEG;AACH,MAAM,UAAU,gBAAgB,CAAC,IAA2B;IAC1D,MAAM,MAAM,GAAmC,EAAE,CAAC;IAElD,yBAAyB;IACzB,IAAI,IAAI,CAAC,EAAE;QAAE,MAAM,CAAC,eAAe,GAAG,IAAI,CAAC,EAAE,CAAC;IAC9C,IAAI,IAAI,CAAC,KAAK;QAAE,MAAM,CAAC,KAAK,GAAG,IAAI,CAAC,KAAK,CAAC;IAC1C,IAAI,IAAI,CAAC,KAAK,KAAK,SAAS;QAAE,MAAM,CAAC,MAAM,GAAG,IAAI,CAAC,KAAK,CAAC;IACzD,IAAI,IAAI,CAAC,MAAM;QAAE,MAAM,CAAC,OAAO,GAAG,IAAI,CAAC,MAAM,CAAC;IAE9C,OAAO,MAAM,CAAC;AAChB,CAAC"}
|
|
1
|
+
{"version":3,"file":"conversation.transform.js","sourceRoot":"","sources":["../../src/transforms/conversation.transform.ts"],"names":[],"mappings":"AAEA;;GAEG;AACH,SAAS,cAAc,CAAC,OAA2B;IACjD,IAAI,CAAC,OAAO;QAAE,OAAO,CAAC,CAAC;IACvB,uBAAuB;IACvB,IAAI,OAAO,GAAG,WAAW;QAAE,OAAO,OAAO,CAAC;IAC1C,UAAU;IACV,OAAO,OAAO,GAAG,IAAI,CAAC;AACxB,CAAC;AAED;;GAEG;AACH,MAAM,UAAU,qBAAqB,CACnC,MAA6B;IAE7B,MAAM,EAAE,GAAG,CAAC,MAAM,CAAC,eAAe,IAAI,MAAM,CAAC,EAAE,IAAI,EAAE,CAAC,CAAC,QAAQ,EAAE,CAAC;IAClE,OAAO;QACL,EAAE;QACF,KAAK,EAAE,MAAM,CAAC,KAAK,IAAI,UAAU;QACjC,KAAK,EAAE,MAAM,CAAC,MAAM;QACpB,MAAM,EAAE,MAAM,CAAC,OAAO;QACtB,SAAS,EAAE,cAAc,CAAC,MAAM,CAAC,UAAU,CAAC;QAC5C,SAAS,EAAE,cAAc,CAAC,MAAM,CAAC,UAAU,CAAC;QAC5C,YAAY,EAAE,cAAc,CAAC,MAAM,CAAC,uBAAuB,IAAI,MAAM,CAAC,UAAU,CAAC;QACjF,YAAY,EAAE,MAAM,CAAC,aAAa;KACnC,CAAC;AACJ,CAAC;AAED;;GAEG;AACH,MAAM,UAAU,gBAAgB,CAAC,IAA2B;IAC1D,MAAM,MAAM,GAAmC,EAAE,CAAC;IAElD,yBAAyB;IACzB,IAAI,IAAI,CAAC,EAAE;QAAE,MAAM,CAAC,eAAe,GAAG,IAAI,CAAC,EAAE,CAAC;IAC9C,IAAI,IAAI,CAAC,KAAK;QAAE,MAAM,CAAC,KAAK,GAAG,IAAI,CAAC,KAAK,CAAC;IAC1C,IAAI,IAAI,CAAC,KAAK,KAAK,SAAS;QAAE,MAAM,CAAC,MAAM,GAAG,IAAI,CAAC,KAAK,CAAC;IACzD,IAAI,IAAI,CAAC,MAAM;QAAE,MAAM,CAAC,OAAO,GAAG,IAAI,CAAC,MAAM,CAAC;IAE9C,OAAO,MAAM,CAAC;AAChB,CAAC;AAED;;GAEG;AACH,MAAM,UAAU,sBAAsB,CACpC,MAA6B;IAE7B,MAAM,eAAe,GAAG,CAAC,MAAM,CAAC,eAAe,IAAI,MAAM,CAAC,EAAE,IAAI,EAAE,CAAC,CAAC,QAAQ,EAAE,CAAC;IAC/E,OAAO;QACL,eAAe;QACf,MAAM,EAAE,MAAM,CAAC,MAAM;QACrB,OAAO,EAAE,UAAU;QACnB,kBAAkB,EAAE,IAAI;QACxB,KAAK,EAAE,MAAM,CAAC,KAAK,IAAI,UAAU;QACjC,UAAU,EAAE,MAAM,CAAC,UAAU,IAAI,CAAC;QAClC,UAAU,EAAE,MAAM,CAAC,UAAU,IAAI,CAAC;QAClC,aAAa,EAAE,MAAM,CAAC,aAAa,IAAI,CAAC;QACxC,WAAW,EAAE,IAAI;QACjB,QAAQ,EAAE,EAAE;QACZ,OAAO,EAAE,MAAM,CAAC,OAAO;KACxB,CAAC;AACJ,CAAC"}
|
package/dist/types/index.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
export type { ConversationClientConfig } from './config.types.js';
|
|
2
|
-
export type { Conversation, Message, ToolCall, App, AppWithConversations, ListAppsWithConversationsResult, } from './models.types.js';
|
|
2
|
+
export type { Conversation, ConversationResponse, Message, ToolCall, App, AppWithConversations, ListAppsWithConversationsResult, } from './models.types.js';
|
|
3
3
|
export type { PaginationMeta, PaginatedResult, PaginationOptions, } from './pagination.types.js';
|
|
4
4
|
export type { ListConversationsOptions, CreateConversationData, UpdateConversationData, } from '../resources/ConversationsResource.js';
|
|
5
5
|
export type { ListMessagesOptions, CreateMessageData, } from '../resources/MessagesResource.js';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/types/index.ts"],"names":[],"mappings":"AACA,YAAY,EAAE,wBAAwB,EAAE,MAAM,mBAAmB,CAAC;AAGlE,YAAY,EACV,YAAY,EACZ,OAAO,EACP,QAAQ,EACR,GAAG,EACH,oBAAoB,EACpB,+BAA+B,GAChC,MAAM,mBAAmB,CAAC;AAG3B,YAAY,EACV,cAAc,EACd,eAAe,EACf,iBAAiB,GAClB,MAAM,uBAAuB,CAAC;AAG/B,YAAY,EACV,wBAAwB,EACxB,sBAAsB,EACtB,sBAAsB,GACvB,MAAM,uCAAuC,CAAC;AAE/C,YAAY,EACV,mBAAmB,EACnB,iBAAiB,GAClB,MAAM,kCAAkC,CAAC;AAE1C,YAAY,EACV,eAAe,GAChB,MAAM,8BAA8B,CAAC"}
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/types/index.ts"],"names":[],"mappings":"AACA,YAAY,EAAE,wBAAwB,EAAE,MAAM,mBAAmB,CAAC;AAGlE,YAAY,EACV,YAAY,EACZ,oBAAoB,EACpB,OAAO,EACP,QAAQ,EACR,GAAG,EACH,oBAAoB,EACpB,+BAA+B,GAChC,MAAM,mBAAmB,CAAC;AAG3B,YAAY,EACV,cAAc,EACd,eAAe,EACf,iBAAiB,GAClB,MAAM,uBAAuB,CAAC;AAG/B,YAAY,EACV,wBAAwB,EACxB,sBAAsB,EACtB,sBAAsB,GACvB,MAAM,uCAAuC,CAAC;AAE/C,YAAY,EACV,mBAAmB,EACnB,iBAAiB,GAClB,MAAM,kCAAkC,CAAC;AAE1C,YAAY,EACV,eAAe,GAChB,MAAM,8BAA8B,CAAC"}
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
* 前端业务模型(camelCase 格式)
|
|
3
3
|
*/
|
|
4
4
|
/**
|
|
5
|
-
*
|
|
5
|
+
* 会话模型(camelCase,内部使用)
|
|
6
6
|
*/
|
|
7
7
|
export interface Conversation {
|
|
8
8
|
id: string;
|
|
@@ -14,6 +14,22 @@ export interface Conversation {
|
|
|
14
14
|
lastActiveAt: number;
|
|
15
15
|
messageCount?: number;
|
|
16
16
|
}
|
|
17
|
+
/**
|
|
18
|
+
* 会话响应模型(snake_case,匹配 runtime-plugins 格式)
|
|
19
|
+
*/
|
|
20
|
+
export interface ConversationResponse {
|
|
21
|
+
conversation_id: string;
|
|
22
|
+
app_id: string | null;
|
|
23
|
+
backend: string;
|
|
24
|
+
backend_session_id: string | null;
|
|
25
|
+
title: string;
|
|
26
|
+
created_at: number;
|
|
27
|
+
updated_at: number;
|
|
28
|
+
message_count: number;
|
|
29
|
+
skills_json: any | null;
|
|
30
|
+
metadata: Record<string, unknown>;
|
|
31
|
+
user_id: string;
|
|
32
|
+
}
|
|
17
33
|
/**
|
|
18
34
|
* 工具调用信息
|
|
19
35
|
*/
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"models.types.d.ts","sourceRoot":"","sources":["../../src/types/models.types.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH;;GAEG;AACH,MAAM,WAAW,YAAY;IAC3B,EAAE,EAAE,MAAM,CAAC;IACX,KAAK,EAAE,MAAM,CAAC;IACd,KAAK,EAAE,MAAM,GAAG,IAAI,CAAC;IACrB,MAAM,EAAE,MAAM,CAAC;IACf,SAAS,EAAE,MAAM,CAAC;IAClB,SAAS,EAAE,MAAM,CAAC;IAClB,YAAY,EAAE,MAAM,CAAC;IACrB,YAAY,CAAC,EAAE,MAAM,CAAC;CACvB;AAED;;GAEG;AACH,MAAM,WAAW,QAAQ;IACvB,EAAE,EAAE,MAAM,CAAC;IACX,QAAQ,EAAE,MAAM,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