@nexusm/sdk 3.0.0 → 5.0.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/README.md +10 -7
- package/dist/index.d.mts +202 -97
- package/dist/index.d.ts +202 -97
- package/dist/index.js +24 -17
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +24 -17
- package/dist/index.mjs.map +1 -1
- package/package.json +2 -1
package/dist/index.mjs
CHANGED
|
@@ -1022,7 +1022,7 @@ import { z as z3 } from "zod";
|
|
|
1022
1022
|
var messageRoleSchema = z3.enum(["user", "assistant", "system", "tool"]);
|
|
1023
1023
|
var conversationCreateSchema = z3.object({
|
|
1024
1024
|
user_id: z3.string().min(1),
|
|
1025
|
-
|
|
1025
|
+
agent_id: z3.string().max(255).optional(),
|
|
1026
1026
|
metadata: z3.record(z3.unknown()).optional()
|
|
1027
1027
|
});
|
|
1028
1028
|
var messageCreateSchema = z3.object({
|
|
@@ -1056,10 +1056,14 @@ var ConversationService = class extends BaseService {
|
|
|
1056
1056
|
return this.http.get("/conversations", params, options?.signal);
|
|
1057
1057
|
}
|
|
1058
1058
|
/**
|
|
1059
|
-
* Retrieve a conversation
|
|
1059
|
+
* Retrieve a conversation.
|
|
1060
1060
|
*
|
|
1061
|
-
*
|
|
1062
|
-
*
|
|
1061
|
+
* v4.0.0 BREAKING: returns `Conversation` — the backend response has no
|
|
1062
|
+
* `messages` array (the previous `ConversationDetail` shape was a
|
|
1063
|
+
* phantom). Fetch messages via {@link getMessages}.
|
|
1064
|
+
*
|
|
1065
|
+
* @param conversationId - Compound conversation ID to retrieve.
|
|
1066
|
+
* @returns The conversation record.
|
|
1063
1067
|
* @throws {ApiError} 404 if the conversation does not exist.
|
|
1064
1068
|
*/
|
|
1065
1069
|
async get(conversationId, options) {
|
|
@@ -1068,11 +1072,11 @@ var ConversationService = class extends BaseService {
|
|
|
1068
1072
|
/**
|
|
1069
1073
|
* Add a message to an existing conversation.
|
|
1070
1074
|
*
|
|
1071
|
-
* The message is appended to the conversation's message sequence.
|
|
1072
|
-
*
|
|
1073
|
-
* new messages are added.
|
|
1075
|
+
* The message is appended to the conversation's message sequence. The
|
|
1076
|
+
* backend SummaryWorker asynchronously updates the conversation summary
|
|
1077
|
+
* after new messages are added.
|
|
1074
1078
|
*
|
|
1075
|
-
* @param conversationId -
|
|
1079
|
+
* @param conversationId - Compound conversation ID ("tenant::user::session").
|
|
1076
1080
|
* @param message - Message payload including role and content.
|
|
1077
1081
|
* @returns The newly created message with generated ID and sequence number.
|
|
1078
1082
|
* @throws {ApiError} 404 if the conversation does not exist.
|
|
@@ -1089,7 +1093,7 @@ var ConversationService = class extends BaseService {
|
|
|
1089
1093
|
*
|
|
1090
1094
|
* Messages are returned in chronological order (oldest first).
|
|
1091
1095
|
*
|
|
1092
|
-
* @param conversationId -
|
|
1096
|
+
* @param conversationId - Compound conversation ID ("tenant::user::session").
|
|
1093
1097
|
* @param params - Optional pagination controls (limit, offset).
|
|
1094
1098
|
* @returns Paginated list of messages.
|
|
1095
1099
|
* @throws {ApiError} 404 if the conversation does not exist.
|
|
@@ -1104,23 +1108,26 @@ var ConversationService = class extends BaseService {
|
|
|
1104
1108
|
/**
|
|
1105
1109
|
* Retrieve the auto-generated summary of a conversation.
|
|
1106
1110
|
*
|
|
1107
|
-
* Summaries are produced by
|
|
1108
|
-
*
|
|
1111
|
+
* Summaries are produced incrementally by the backend SummaryWorker from
|
|
1112
|
+
* the conversation history.
|
|
1109
1113
|
*
|
|
1110
|
-
* @param conversationId -
|
|
1111
|
-
* @returns The conversation summary
|
|
1114
|
+
* @param conversationId - Compound conversation ID ("tenant::user::session").
|
|
1115
|
+
* @returns The conversation summary ({@link ConversationSummary}: summary
|
|
1116
|
+
* text + message counts + created_at). Note: no "key points" or
|
|
1117
|
+
* "generated_at" fields — those were phantom (removed in v4.0.0).
|
|
1112
1118
|
* @throws {ApiError} 404 if the conversation does not exist.
|
|
1113
1119
|
*/
|
|
1114
1120
|
async getSummary(conversationId, options) {
|
|
1115
1121
|
return this.http.get(`/conversations/${conversationId}/summary`, void 0, options?.signal);
|
|
1116
1122
|
}
|
|
1117
1123
|
/**
|
|
1118
|
-
* Delete a conversation
|
|
1124
|
+
* Delete a conversation.
|
|
1119
1125
|
*
|
|
1120
|
-
*
|
|
1121
|
-
*
|
|
1126
|
+
* Soft-delete: the backend sets `deleted_at` (the conversation stops
|
|
1127
|
+
* appearing in list/get) rather than physically removing the row and its
|
|
1128
|
+
* messages.
|
|
1122
1129
|
*
|
|
1123
|
-
* @param conversationId -
|
|
1130
|
+
* @param conversationId - Compound conversation ID ("tenant::user::session").
|
|
1124
1131
|
* @throws {ApiError} 404 if the conversation does not exist.
|
|
1125
1132
|
*/
|
|
1126
1133
|
async delete(conversationId, options) {
|