@base44-preview/sdk 0.8.57-pr.361.dda0ab9 → 0.8.57-pr.362.26c8eba
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.
|
@@ -193,7 +193,7 @@ export interface AgentsModuleConfig {
|
|
|
193
193
|
*
|
|
194
194
|
* This module is available to use with a client in all authentication modes:
|
|
195
195
|
*
|
|
196
|
-
* - **Anonymous or User authentication** (`base44.agents`): Access is scoped to the current user's permissions. Users must be authenticated to create and access conversations.
|
|
196
|
+
* - **Anonymous or User authentication** (`base44.agents`): Access is scoped to the current user's permissions. Users must be authenticated to create and access conversations. Each user can read and add messages only to conversations they created, even if the user is an admin.
|
|
197
197
|
* - **Service role authentication** (`base44.asServiceRole.agents`): Operations are invoked with the service role for backend code that needs elevated permissions.
|
|
198
198
|
*
|
|
199
199
|
* ## Generated Types
|
|
@@ -204,7 +204,7 @@ export interface AgentsModule {
|
|
|
204
204
|
/**
|
|
205
205
|
* Gets the current user's conversations with all agents in the app.
|
|
206
206
|
*
|
|
207
|
-
* Retrieves every conversation the current user started, across all agents. Conversations that other users started aren't included. Use {@linkcode listConversations | listConversations()} to filter which conversations are returned, apply sorting, or paginate results. Use {@linkcode getConversation | getConversation()} to retrieve a specific conversation by ID.
|
|
207
|
+
* Retrieves every conversation the current user started, across all agents. Conversations that other users started aren't included, even if the user is an admin. Use {@linkcode listConversations | listConversations()} to filter which conversations are returned, apply sorting, or paginate results. Use {@linkcode getConversation | getConversation()} to retrieve a specific conversation by ID.
|
|
208
208
|
*
|
|
209
209
|
* @returns Promise resolving to an array of conversations.
|
|
210
210
|
*
|
|
@@ -222,13 +222,15 @@ export interface AgentsModule {
|
|
|
222
222
|
/**
|
|
223
223
|
* Gets a specific conversation by ID.
|
|
224
224
|
*
|
|
225
|
-
* Retrieves a single conversation using its unique identifier. To retrieve
|
|
225
|
+
* Retrieves a single conversation using its unique identifier. The conversation must belong to the current user. If another user created it, the request fails with a `403` error. If no conversation has that ID, the request fails with a `404` error. To retrieve
|
|
226
226
|
* all of the current user's conversations, use {@linkcode getConversations | getConversations()}. To filter, sort, or paginate conversations, use {@linkcode listConversations | listConversations()}.
|
|
227
227
|
*
|
|
228
228
|
* This function returns the complete stored conversation including full tool call results, even for large responses.
|
|
229
229
|
*
|
|
230
|
+
* A user can access only their own conversations. Other users' conversations aren't available through this method.
|
|
231
|
+
*
|
|
230
232
|
* @param conversationId - The unique identifier of the conversation.
|
|
231
|
-
* @returns Promise resolving to the conversation
|
|
233
|
+
* @returns Promise resolving to the conversation.
|
|
232
234
|
*
|
|
233
235
|
* @example
|
|
234
236
|
* ```typescript
|
|
@@ -239,14 +241,14 @@ export interface AgentsModule {
|
|
|
239
241
|
* }
|
|
240
242
|
* ```
|
|
241
243
|
*
|
|
242
|
-
* @see {@linkcode getConversations | getConversations()} for retrieving all conversations
|
|
244
|
+
* @see {@linkcode getConversations | getConversations()} for retrieving all of the current user's conversations
|
|
243
245
|
* @see {@linkcode listConversations | listConversations()} for filtering and sorting conversations
|
|
244
246
|
*/
|
|
245
247
|
getConversation(conversationId: string): Promise<AgentConversation | undefined>;
|
|
246
248
|
/**
|
|
247
|
-
* Lists conversations with filtering, sorting, and pagination.
|
|
249
|
+
* Lists the current user's conversations with filtering, sorting, and pagination.
|
|
248
250
|
*
|
|
249
|
-
* Provides querying capabilities including filtering by fields, sorting, pagination, and field selection. For cases where you need all of the current user's conversations without filtering, use {@linkcode getConversations | getConversations()}. To retrieve a specific conversation by ID, use {@linkcode getConversation | getConversation()}.
|
|
251
|
+
* Provides querying capabilities including filtering by fields, sorting, pagination, and field selection. Results only include conversations the current user created, even with a filter on `created_by_id`. For cases where you need all of the current user's conversations without filtering, use {@linkcode getConversations | getConversations()}. To retrieve a specific conversation by ID, use {@linkcode getConversation | getConversation()}.
|
|
250
252
|
*
|
|
251
253
|
* @param filterParams - Filter parameters for querying conversations.
|
|
252
254
|
* @returns Promise resolving to an array of filtered conversations.
|
|
@@ -273,13 +275,15 @@ export interface AgentsModule {
|
|
|
273
275
|
* });
|
|
274
276
|
* ```
|
|
275
277
|
*
|
|
276
|
-
* @see {@linkcode getConversations | getConversations()} for retrieving all conversations without filtering
|
|
278
|
+
* @see {@linkcode getConversations | getConversations()} for retrieving all of the current user's conversations without filtering
|
|
277
279
|
* @see {@linkcode getConversation | getConversation()} for retrieving a specific conversation by ID
|
|
278
280
|
*/
|
|
279
281
|
listConversations(filterParams: ModelFilterParams): Promise<AgentConversation[]>;
|
|
280
282
|
/**
|
|
281
283
|
* Creates a new conversation with an agent.
|
|
282
284
|
*
|
|
285
|
+
* The conversation belongs to the current user. Only that user can read it or add messages to it.
|
|
286
|
+
*
|
|
283
287
|
* @param conversation - Conversation details including agent name and optional metadata.
|
|
284
288
|
* @returns Promise resolving to the created conversation.
|
|
285
289
|
*
|
|
@@ -301,9 +305,11 @@ export interface AgentsModule {
|
|
|
301
305
|
/**
|
|
302
306
|
* Adds a message to a conversation.
|
|
303
307
|
*
|
|
304
|
-
* Sends a message to the agent and updates the conversation. This method
|
|
308
|
+
* Sends a message to the agent and updates the conversation. You can only add messages to conversations the current user created. This method
|
|
305
309
|
* also updates the realtime socket to notify any subscribers.
|
|
306
310
|
*
|
|
311
|
+
* A user can add messages only to their own conversations. Other users' conversations aren't available through this method.
|
|
312
|
+
*
|
|
307
313
|
* @param conversation - The conversation to add the message to.
|
|
308
314
|
* @param message - The message to add.
|
|
309
315
|
* @returns Promise resolving to the created message.
|
|
@@ -323,9 +329,11 @@ export interface AgentsModule {
|
|
|
323
329
|
* Subscribes to realtime updates for a conversation.
|
|
324
330
|
*
|
|
325
331
|
* Establishes a WebSocket connection to receive instant updates when new
|
|
326
|
-
* messages are added to the conversation. Returns an unsubscribe function
|
|
332
|
+
* messages are added to the conversation. You can only subscribe to conversations the current user created. Returns an unsubscribe function
|
|
327
333
|
* to clean up the connection.
|
|
328
334
|
*
|
|
335
|
+
* A user can subscribe only to their own conversations. Other users' conversations aren't available through this method.
|
|
336
|
+
*
|
|
329
337
|
* <Note>
|
|
330
338
|
* When receiving messages through this function, tool call data is truncated for efficiency. The `arguments_string` is limited to 500 characters and `results` to 50 characters. The complete tool call data is always saved in storage and can be retrieved by calling {@linkcode getConversation | getConversation()} after the message completes.
|
|
331
339
|
* </Note>
|
|
@@ -45,7 +45,7 @@ export interface DeleteManyResult {
|
|
|
45
45
|
export interface UpdateManyResult {
|
|
46
46
|
/** Whether the operation was successful. */
|
|
47
47
|
success: boolean;
|
|
48
|
-
/** Number of entities that were updated. */
|
|
48
|
+
/** Number of entities that were updated. This includes records that already held the new values, because every update refreshes `updated_date`. */
|
|
49
49
|
updated: number;
|
|
50
50
|
/** Whether there are more entities matching the query that were not updated in this batch. When `true`, call `updateMany` again with the same query to update the next batch. */
|
|
51
51
|
has_more: boolean;
|
|
@@ -777,6 +777,8 @@ export interface EntityHandler<T = any> {
|
|
|
777
777
|
* records first and then updates them. Learn more about
|
|
778
778
|
* [concurrent updates](/developers/backend/resources/entities/entity-schemas#concurrent-updates).
|
|
779
779
|
*
|
|
780
|
+
* This method isn't available for the built-in `User` entity, and calling it fails with a 405 error.
|
|
781
|
+
*
|
|
780
782
|
* To update a single record by ID, use {@linkcode update | update()} instead. To update
|
|
781
783
|
* multiple specific records with different data each, use {@linkcode bulkUpdate | bulkUpdate()}.
|
|
782
784
|
*
|
|
@@ -1017,8 +1019,19 @@ export interface EntityHandler<T = any> {
|
|
|
1017
1019
|
*
|
|
1018
1020
|
* You can update up to 500 records per request.
|
|
1019
1021
|
*
|
|
1020
|
-
* This isn't
|
|
1021
|
-
*
|
|
1022
|
+
* This method isn't available for the built-in `User` entity, and calling it fails with a 405 error.
|
|
1023
|
+
*
|
|
1024
|
+
* This isn't a transaction. Before writing, the call validates each record and checks that:
|
|
1025
|
+
*
|
|
1026
|
+
* - The `id` matches an existing record that the entity's
|
|
1027
|
+
* [row-level security](/developers/backend/resources/entities/security#row-level-security-rls)
|
|
1028
|
+
* update rule lets you update.
|
|
1029
|
+
* - Each change passes the entity's
|
|
1030
|
+
* [field-level security](/developers/backend/resources/entities/security#field-level-security-fls)
|
|
1031
|
+
* write rules.
|
|
1032
|
+
* - The record matches the entity's schema.
|
|
1033
|
+
*
|
|
1034
|
+
* After validation, each record is updated independently. Learn more about
|
|
1022
1035
|
* [concurrent updates](/developers/backend/resources/entities/entity-schemas#concurrent-updates).
|
|
1023
1036
|
*
|
|
1024
1037
|
* To apply the same update to all records matching a query, use
|