@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/README.md
CHANGED
|
@@ -165,10 +165,13 @@ const graph = await nexus.knowledge.query({
|
|
|
165
165
|
|
|
166
166
|
| Method | Description |
|
|
167
167
|
|--------|-------------|
|
|
168
|
-
| `
|
|
169
|
-
| `listEntities(params?)` | List entities with optional filtering |
|
|
168
|
+
| `listEntities(params)` | List entities for a user (`user_id` required) |
|
|
170
169
|
| `query(request)` | BFS graph traversal from a named entity |
|
|
171
|
-
| `extract(request)` | Extract entities and relationships from text |
|
|
170
|
+
| `extract(request)` | Extract entities and relationships from text (also how entities are created) |
|
|
171
|
+
|
|
172
|
+
> v3.0.0: `createEntity()` was removed — the backend has no
|
|
173
|
+
> `POST /knowledge/entities` route (the SDK method 404'd at runtime).
|
|
174
|
+
> Entities are created via `extract()`.
|
|
172
175
|
|
|
173
176
|
### Activity Service
|
|
174
177
|
|
|
@@ -202,14 +205,14 @@ Tenant profile and usage management. Identity is derived from the API key.
|
|
|
202
205
|
const tenant = await nexus.tenants.me();
|
|
203
206
|
console.log(tenant.name, tenant.tier);
|
|
204
207
|
|
|
205
|
-
const usage = await nexus.tenants.usage();
|
|
206
|
-
console.log(
|
|
208
|
+
const usage = await nexus.tenants.usage('week');
|
|
209
|
+
console.log(`API calls: ${usage.api_calls} (${usage.success_rate}% ok)`);
|
|
207
210
|
```
|
|
208
211
|
|
|
209
212
|
| Method | Description |
|
|
210
213
|
|--------|-------------|
|
|
211
|
-
| `me()` | Retrieve the current tenant profile |
|
|
212
|
-
| `usage()` |
|
|
214
|
+
| `me()` | Retrieve the current tenant profile (flat counts + `quota_remaining`) |
|
|
215
|
+
| `usage(period?)` | Usage statistics for `'day'` (default) / `'week'` / `'month'` — 13-field `UsageStats` |
|
|
213
216
|
|
|
214
217
|
## Error Handling
|
|
215
218
|
|
package/dist/index.d.mts
CHANGED
|
@@ -802,13 +802,26 @@ declare class ContextService extends BaseService {
|
|
|
802
802
|
type MemoryType = 'episodic' | 'semantic' | 'procedural';
|
|
803
803
|
/**
|
|
804
804
|
* A memory record stored in the Nexus platform.
|
|
805
|
-
*
|
|
805
|
+
*
|
|
806
|
+
* Mirrors backend `MemoryResponse` (schemas/memory.py, 14 fields).
|
|
807
|
+
*
|
|
808
|
+
* v4.0.0 (memory-conversation-contract-reconciliation): adds the
|
|
809
|
+
* compound-identifier trio (`memory_id` / `tenant_id` / `agent_id`) and the
|
|
810
|
+
* US-035 temporal-validity window (`valid_from` / `valid_until` /
|
|
811
|
+
* `valid_until_source`) — all emitted by the backend but previously missing
|
|
812
|
+
* from this type (readers got `undefined`).
|
|
806
813
|
*/
|
|
807
814
|
interface Memory {
|
|
815
|
+
/** Compound memory ID ("tenant::user::uuid") — needed for multi-tenant ops */
|
|
816
|
+
memory_id: string;
|
|
808
817
|
/** Unique memory identifier (UUID) */
|
|
809
818
|
id: string;
|
|
819
|
+
/** Tenant identifier */
|
|
820
|
+
tenant_id: string;
|
|
810
821
|
/** User ID that owns this memory */
|
|
811
822
|
user_id: string;
|
|
823
|
+
/** Originating agent (null when not agent-written) */
|
|
824
|
+
agent_id?: string | null;
|
|
812
825
|
/** Memory content text */
|
|
813
826
|
content: string;
|
|
814
827
|
/** Classification of the memory */
|
|
@@ -816,7 +829,13 @@ interface Memory {
|
|
|
816
829
|
/** Additional metadata key-value pairs */
|
|
817
830
|
metadata?: Record<string, unknown>;
|
|
818
831
|
/** Relevance score (present in search results) */
|
|
819
|
-
score?: number;
|
|
832
|
+
score?: number | null;
|
|
833
|
+
/** Start of the temporal validity window (inclusive; server-managed) */
|
|
834
|
+
valid_from?: string | null;
|
|
835
|
+
/** End of the temporal validity window (exclusive; null = permanent) */
|
|
836
|
+
valid_until?: string | null;
|
|
837
|
+
/** Provenance of valid_until (permanent / extracted / sdk_provided / ...) */
|
|
838
|
+
valid_until_source?: string | null;
|
|
820
839
|
/** Timestamp when the memory was created (ISO 8601) */
|
|
821
840
|
created_at: string;
|
|
822
841
|
/** Timestamp when the memory was last updated (ISO 8601) */
|
|
@@ -920,22 +939,25 @@ interface MemorySearchResult {
|
|
|
920
939
|
/**
|
|
921
940
|
* Paginated list of memories.
|
|
922
941
|
*
|
|
923
|
-
* GET /memories?user_id=...
|
|
942
|
+
* GET /memories?user_id=... — mirrors backend `MemoryListResponse` (FLAT
|
|
943
|
+
* container).
|
|
944
|
+
*
|
|
945
|
+
* v5.0.0 BREAKING: was nested `{data, pagination:{total, limit, offset,
|
|
946
|
+
* has_more}}` — that shape never existed on the wire. The backend response
|
|
947
|
+
* is flat `{memories, total_count, limit, offset, has_next}`; the old nested
|
|
948
|
+
* shape meant `result.data` was always `undefined` at runtime.
|
|
924
949
|
*/
|
|
925
950
|
interface MemoryList {
|
|
926
951
|
/** Array of memory records */
|
|
927
|
-
|
|
928
|
-
/**
|
|
929
|
-
|
|
930
|
-
|
|
931
|
-
|
|
932
|
-
|
|
933
|
-
|
|
934
|
-
|
|
935
|
-
|
|
936
|
-
/** Whether more results exist */
|
|
937
|
-
has_more: boolean;
|
|
938
|
-
};
|
|
952
|
+
memories: Memory[];
|
|
953
|
+
/** Total number of memories matching the query */
|
|
954
|
+
total_count: number;
|
|
955
|
+
/** Current page size limit */
|
|
956
|
+
limit: number;
|
|
957
|
+
/** Current offset */
|
|
958
|
+
offset: number;
|
|
959
|
+
/** Whether more results exist beyond this page */
|
|
960
|
+
has_next: boolean;
|
|
939
961
|
}
|
|
940
962
|
/**
|
|
941
963
|
* A single journal entry representing a memory on a specific date.
|
|
@@ -985,8 +1007,13 @@ interface JournalResponse {
|
|
|
985
1007
|
* Parameters for listing memories with optional filtering and pagination.
|
|
986
1008
|
*/
|
|
987
1009
|
interface MemoryListParams {
|
|
988
|
-
/**
|
|
989
|
-
|
|
1010
|
+
/**
|
|
1011
|
+
* User ID within the tenant whose memories to list.
|
|
1012
|
+
*
|
|
1013
|
+
* v5.0.0 BREAKING: now required — backend `GET /memories` declares
|
|
1014
|
+
* `user_id` as `Query(..., min_length=1)`; omitting it returns 422.
|
|
1015
|
+
*/
|
|
1016
|
+
user_id: string;
|
|
990
1017
|
/** Filter by memory type classification */
|
|
991
1018
|
memory_type?: MemoryType;
|
|
992
1019
|
/** Maximum number of results per page */
|
|
@@ -1008,8 +1035,9 @@ interface MemoryJournalParams {
|
|
|
1008
1035
|
user_id?: string;
|
|
1009
1036
|
}
|
|
1010
1037
|
/**
|
|
1011
|
-
* Service for managing long-term memories
|
|
1038
|
+
* Service for managing long-term memories.
|
|
1012
1039
|
*
|
|
1040
|
+
* Backed by the Nexus Memory Service (Native pgvector + ProfileWorker).
|
|
1013
1041
|
* Provides full CRUD operations, semantic search, and the chronological
|
|
1014
1042
|
* Memory Journal view for reviewing memories over time.
|
|
1015
1043
|
*
|
|
@@ -1097,10 +1125,17 @@ declare class MemoryService extends BaseService {
|
|
|
1097
1125
|
/**
|
|
1098
1126
|
* @nexusm/sdk - Conversation Types
|
|
1099
1127
|
*
|
|
1100
|
-
* Type definitions for the Conversation Service
|
|
1128
|
+
* Type definitions for the Conversation Service.
|
|
1101
1129
|
* Manages conversation history, messages, and auto-generated summaries.
|
|
1102
1130
|
*
|
|
1103
|
-
*
|
|
1131
|
+
* v4.0.0 BREAKING (memory-conversation-contract-reconciliation, 2026-06-11):
|
|
1132
|
+
* canonical = backend Pydantic response models (`schemas/conversation.py`)
|
|
1133
|
+
* serialized wire names. The previous shapes were drifted: nested
|
|
1134
|
+
* `{data, pagination}` containers never existed on the wire (backend lists
|
|
1135
|
+
* are FLAT), the conversation identifier wire key is `conversation_id` (the
|
|
1136
|
+
* old `session_id` was a phantom), `ConversationDetail` described a response
|
|
1137
|
+
* no endpoint emits, and `ConversationSummary` declared phantom
|
|
1138
|
+
* `key_points`/`generated_at` while missing the real count fields.
|
|
1104
1139
|
*/
|
|
1105
1140
|
/** Valid message roles in a conversation */
|
|
1106
1141
|
type MessageRole = 'user' | 'assistant' | 'system' | 'tool';
|
|
@@ -1108,21 +1143,39 @@ type MessageRole = 'user' | 'assistant' | 'system' | 'tool';
|
|
|
1108
1143
|
type ConversationStatus = 'active' | 'archived' | 'deleted';
|
|
1109
1144
|
/**
|
|
1110
1145
|
* A conversation session between a user and an AI agent.
|
|
1111
|
-
*
|
|
1146
|
+
*
|
|
1147
|
+
* GET /conversations/{conversation_id} — mirrors backend
|
|
1148
|
+
* `ConversationResponse` (11 fields, flat).
|
|
1149
|
+
*
|
|
1150
|
+
* v4.0.0 BREAKING: `session_id` → `conversation_id` (the real wire key —
|
|
1151
|
+
* backend field `compound_session_id` serializes via alias); adds
|
|
1152
|
+
* `tenant_id` / `agent_id` / `status` (previously missing).
|
|
1112
1153
|
*/
|
|
1113
1154
|
interface Conversation {
|
|
1114
1155
|
/** Unique conversation identifier (UUID) */
|
|
1115
1156
|
id: string;
|
|
1157
|
+
/** Compound session ID ("tenant::user::session") — the wire key */
|
|
1158
|
+
conversation_id: string;
|
|
1159
|
+
/** Tenant identifier */
|
|
1160
|
+
tenant_id: string;
|
|
1116
1161
|
/** User ID that owns this conversation */
|
|
1117
1162
|
user_id: string;
|
|
1118
|
-
/**
|
|
1119
|
-
|
|
1120
|
-
|
|
1121
|
-
|
|
1163
|
+
/**
|
|
1164
|
+
* Originating agent (null when not agent-created).
|
|
1165
|
+
*
|
|
1166
|
+
* v5.0.0: required-nullable convention — always emitted by the backend
|
|
1167
|
+
* (`ConversationResponse.agent_id: str | None`), value may be null. Was
|
|
1168
|
+
* `agent_id?: string | null` (optional); now `string | null` (required dict).
|
|
1169
|
+
*/
|
|
1170
|
+
agent_id: string | null;
|
|
1171
|
+
/** Conversation status (e.g. active / archived) */
|
|
1172
|
+
status: string;
|
|
1173
|
+
/** Auto-generated conversation summary (null until first summary worker run) */
|
|
1174
|
+
summary: string | null;
|
|
1122
1175
|
/** Total number of messages in the conversation */
|
|
1123
1176
|
message_count: number;
|
|
1124
|
-
/** Additional metadata key-value pairs */
|
|
1125
|
-
metadata
|
|
1177
|
+
/** Additional metadata key-value pairs (always emitted, defaults to {}) */
|
|
1178
|
+
metadata: Record<string, unknown>;
|
|
1126
1179
|
/** Timestamp when the conversation was created (ISO 8601) */
|
|
1127
1180
|
created_at: string;
|
|
1128
1181
|
/** Timestamp when the conversation was last updated (ISO 8601) */
|
|
@@ -1131,30 +1184,45 @@ interface Conversation {
|
|
|
1131
1184
|
/**
|
|
1132
1185
|
* Request payload for creating a new conversation.
|
|
1133
1186
|
*
|
|
1134
|
-
* POST /conversations
|
|
1187
|
+
* POST /conversations — mirrors backend `CreateConversationRequest`.
|
|
1188
|
+
*
|
|
1189
|
+
* v5.0.0 BREAKING: removed phantom `session_id` — the backend
|
|
1190
|
+
* (`CreateConversationRequest`) does not accept it; it was silently dropped
|
|
1191
|
+
* by Pydantic `extra=ignore`, and the session id is ALWAYS auto-generated
|
|
1192
|
+
* server-side regardless of input (the old "auto-generated if not provided"
|
|
1193
|
+
* doc was false). Added `agent_id` — the backend accepts it but the SDK had
|
|
1194
|
+
* no way to send it.
|
|
1135
1195
|
*/
|
|
1136
1196
|
interface ConversationCreate {
|
|
1137
1197
|
/** User ID to associate the conversation with */
|
|
1138
1198
|
user_id: string;
|
|
1139
|
-
/**
|
|
1140
|
-
|
|
1199
|
+
/** Optional agent identifier to associate the conversation with */
|
|
1200
|
+
agent_id?: string;
|
|
1141
1201
|
/** Additional metadata key-value pairs */
|
|
1142
1202
|
metadata?: Record<string, unknown>;
|
|
1143
1203
|
}
|
|
1144
|
-
/**
|
|
1145
|
-
* Conversation with its messages included.
|
|
1146
|
-
* Returned when include_messages=true.
|
|
1147
|
-
*/
|
|
1148
|
-
interface ConversationDetail extends Conversation {
|
|
1149
|
-
/** Messages in the conversation */
|
|
1150
|
-
messages: Message[];
|
|
1151
|
-
}
|
|
1152
1204
|
/**
|
|
1153
1205
|
* A single message within a conversation.
|
|
1206
|
+
*
|
|
1207
|
+
* Mirrors backend `MessageResponse` (11 fields).
|
|
1208
|
+
*
|
|
1209
|
+
* v4.0.0 BREAKING: adds `message_id` / `conversation_id` /
|
|
1210
|
+
* `conversation_compound_id` / `tenant_id` / `user_id` correlation fields
|
|
1211
|
+
* (previously missing from the SDK type while present on the wire).
|
|
1154
1212
|
*/
|
|
1155
1213
|
interface Message {
|
|
1156
1214
|
/** Unique message identifier (UUID) */
|
|
1157
1215
|
id: string;
|
|
1216
|
+
/** Compound message ID */
|
|
1217
|
+
message_id: string;
|
|
1218
|
+
/** Owning conversation UUID (NOT the compound id — see conversation_compound_id) */
|
|
1219
|
+
conversation_id: string;
|
|
1220
|
+
/** Owning conversation compound ID ("tenant::user::session") */
|
|
1221
|
+
conversation_compound_id: string;
|
|
1222
|
+
/** Tenant identifier */
|
|
1223
|
+
tenant_id: string;
|
|
1224
|
+
/** User identifier */
|
|
1225
|
+
user_id: string;
|
|
1158
1226
|
/** Message role (user, assistant, system, or tool) */
|
|
1159
1227
|
role: MessageRole;
|
|
1160
1228
|
/** Message content text */
|
|
@@ -1162,7 +1230,7 @@ interface Message {
|
|
|
1162
1230
|
/** Additional metadata key-value pairs */
|
|
1163
1231
|
metadata?: Record<string, unknown>;
|
|
1164
1232
|
/** Message sequence number within the conversation */
|
|
1165
|
-
sequence
|
|
1233
|
+
sequence: number;
|
|
1166
1234
|
/** Timestamp when the message was created (ISO 8601) */
|
|
1167
1235
|
created_at: string;
|
|
1168
1236
|
}
|
|
@@ -1182,68 +1250,93 @@ interface MessageCreate {
|
|
|
1182
1250
|
/**
|
|
1183
1251
|
* Paginated list of conversations.
|
|
1184
1252
|
*
|
|
1185
|
-
* GET /conversations?user_id=...
|
|
1253
|
+
* GET /conversations?user_id=... — mirrors backend
|
|
1254
|
+
* `ConversationListResponse` (FLAT container).
|
|
1255
|
+
*
|
|
1256
|
+
* v4.0.0 BREAKING: was nested `{data, pagination:{total, limit, offset,
|
|
1257
|
+
* has_more}}` — that shape never existed on the wire.
|
|
1186
1258
|
*/
|
|
1187
1259
|
interface ConversationList {
|
|
1188
1260
|
/** Array of conversation records */
|
|
1189
|
-
|
|
1190
|
-
/**
|
|
1191
|
-
|
|
1192
|
-
|
|
1193
|
-
|
|
1194
|
-
|
|
1195
|
-
|
|
1196
|
-
|
|
1197
|
-
|
|
1198
|
-
/** Whether more results exist */
|
|
1199
|
-
has_more: boolean;
|
|
1200
|
-
};
|
|
1261
|
+
conversations: Conversation[];
|
|
1262
|
+
/** Total number of conversations */
|
|
1263
|
+
total_count: number;
|
|
1264
|
+
/** Current page size limit */
|
|
1265
|
+
limit: number;
|
|
1266
|
+
/** Current offset */
|
|
1267
|
+
offset: number;
|
|
1268
|
+
/** Whether more results exist */
|
|
1269
|
+
has_next: boolean;
|
|
1201
1270
|
}
|
|
1202
1271
|
/**
|
|
1203
1272
|
* Paginated list of messages within a conversation.
|
|
1204
1273
|
*
|
|
1205
|
-
* GET /conversations/:conversation_id/messages
|
|
1274
|
+
* GET /conversations/:conversation_id/messages — mirrors backend
|
|
1275
|
+
* `MessageListResponse` (FLAT container).
|
|
1276
|
+
*
|
|
1277
|
+
* v4.0.0 BREAKING: was `{data, has_more}` — missing
|
|
1278
|
+
* total_count/limit/offset and using a phantom container key.
|
|
1206
1279
|
*/
|
|
1207
1280
|
interface MessageList {
|
|
1208
1281
|
/** Array of message records */
|
|
1209
|
-
|
|
1210
|
-
/**
|
|
1211
|
-
|
|
1282
|
+
messages: Message[];
|
|
1283
|
+
/** Total number of messages */
|
|
1284
|
+
total_count: number;
|
|
1285
|
+
/** Current page size limit */
|
|
1286
|
+
limit: number;
|
|
1287
|
+
/** Current offset */
|
|
1288
|
+
offset: number;
|
|
1289
|
+
/** Whether more messages exist */
|
|
1290
|
+
has_next: boolean;
|
|
1212
1291
|
}
|
|
1213
1292
|
/**
|
|
1214
1293
|
* Auto-generated summary of a conversation.
|
|
1215
|
-
* Generated by Zep OSS temporal graph analysis.
|
|
1216
1294
|
*
|
|
1217
|
-
* GET /conversations/:conversation_id/summary
|
|
1295
|
+
* GET /conversations/:conversation_id/summary — mirrors backend
|
|
1296
|
+
* `SummaryResponse` (5 fields).
|
|
1297
|
+
*
|
|
1298
|
+
* v4.0.0 BREAKING: the previous shape declared phantom `key_points[]` /
|
|
1299
|
+
* `generated_at`; the backend emits message counts + `created_at`. The wire
|
|
1300
|
+
* id key is `conversation_id` (unified 2026-06-11 — the endpoint previously
|
|
1301
|
+
* emitted `compound_session_id`, an internal third id variant).
|
|
1218
1302
|
*/
|
|
1219
1303
|
interface ConversationSummary {
|
|
1220
|
-
/**
|
|
1304
|
+
/** Compound conversation ID (same key as Conversation.conversation_id) */
|
|
1221
1305
|
conversation_id: string;
|
|
1222
|
-
/** Generated summary text */
|
|
1223
|
-
summary?: string;
|
|
1224
|
-
/**
|
|
1225
|
-
|
|
1226
|
-
/**
|
|
1227
|
-
|
|
1306
|
+
/** Generated summary text (null until first summary) */
|
|
1307
|
+
summary?: string | null;
|
|
1308
|
+
/** Number of messages already folded into the summary */
|
|
1309
|
+
summary_message_count: number;
|
|
1310
|
+
/** Total number of messages in the conversation */
|
|
1311
|
+
message_count: number;
|
|
1312
|
+
/** Timestamp when the conversation was created (ISO 8601) */
|
|
1313
|
+
created_at: string;
|
|
1228
1314
|
}
|
|
1229
1315
|
|
|
1230
1316
|
/**
|
|
1231
1317
|
* @module services/conversations
|
|
1232
1318
|
* @description Conversation Service - Conversation history and auto-summary management.
|
|
1233
1319
|
*
|
|
1234
|
-
* Wraps the Nexus Conversation API
|
|
1235
|
-
*
|
|
1236
|
-
*
|
|
1320
|
+
* Wraps the Nexus Conversation API (Native implementation: incremental
|
|
1321
|
+
* summaries produced by the backend SummaryWorker, NOT Zep OSS). Supports
|
|
1322
|
+
* conversation lifecycle management, message operations, and access to
|
|
1323
|
+
* auto-generated summaries.
|
|
1237
1324
|
*
|
|
1238
|
-
*
|
|
1325
|
+
* v5.0.0: corrected stale "Zep OSS"/"temporal graph"/"API v2.0" docs — the
|
|
1326
|
+
* backend has always used a Native SummaryWorker.
|
|
1239
1327
|
*/
|
|
1240
1328
|
|
|
1241
1329
|
/**
|
|
1242
1330
|
* Parameters for listing conversations with optional filtering and pagination.
|
|
1243
1331
|
*/
|
|
1244
1332
|
interface ConversationListParams {
|
|
1245
|
-
/**
|
|
1246
|
-
|
|
1333
|
+
/**
|
|
1334
|
+
* User ID within the tenant whose conversations to list.
|
|
1335
|
+
*
|
|
1336
|
+
* v5.0.0 BREAKING: now required — backend `GET /conversations` declares
|
|
1337
|
+
* `user_id` as `Query(..., min_length=1)`; omitting it returns 422.
|
|
1338
|
+
*/
|
|
1339
|
+
user_id: string;
|
|
1247
1340
|
/** Maximum number of results per page */
|
|
1248
1341
|
limit?: number;
|
|
1249
1342
|
/** Offset for pagination */
|
|
@@ -1259,11 +1352,11 @@ interface MessageListParams {
|
|
|
1259
1352
|
offset?: number;
|
|
1260
1353
|
}
|
|
1261
1354
|
/**
|
|
1262
|
-
* Service for managing conversations and messages
|
|
1355
|
+
* Service for managing conversations and messages.
|
|
1263
1356
|
*
|
|
1264
1357
|
* Provides conversation lifecycle management (create, list, get, delete),
|
|
1265
1358
|
* message operations (add, list), and access to auto-generated summaries
|
|
1266
|
-
* produced by
|
|
1359
|
+
* produced by the backend SummaryWorker (Native, incremental).
|
|
1267
1360
|
*
|
|
1268
1361
|
* @example
|
|
1269
1362
|
* ```typescript
|
|
@@ -1301,21 +1394,25 @@ declare class ConversationService extends BaseService {
|
|
|
1301
1394
|
*/
|
|
1302
1395
|
list(params?: ConversationListParams, options?: RequestOptions): Promise<ConversationList>;
|
|
1303
1396
|
/**
|
|
1304
|
-
* Retrieve a conversation
|
|
1397
|
+
* Retrieve a conversation.
|
|
1398
|
+
*
|
|
1399
|
+
* v4.0.0 BREAKING: returns `Conversation` — the backend response has no
|
|
1400
|
+
* `messages` array (the previous `ConversationDetail` shape was a
|
|
1401
|
+
* phantom). Fetch messages via {@link getMessages}.
|
|
1305
1402
|
*
|
|
1306
|
-
* @param conversationId -
|
|
1307
|
-
* @returns
|
|
1403
|
+
* @param conversationId - Compound conversation ID to retrieve.
|
|
1404
|
+
* @returns The conversation record.
|
|
1308
1405
|
* @throws {ApiError} 404 if the conversation does not exist.
|
|
1309
1406
|
*/
|
|
1310
|
-
get(conversationId: string, options?: RequestOptions): Promise<
|
|
1407
|
+
get(conversationId: string, options?: RequestOptions): Promise<Conversation>;
|
|
1311
1408
|
/**
|
|
1312
1409
|
* Add a message to an existing conversation.
|
|
1313
1410
|
*
|
|
1314
|
-
* The message is appended to the conversation's message sequence.
|
|
1315
|
-
*
|
|
1316
|
-
* new messages are added.
|
|
1411
|
+
* The message is appended to the conversation's message sequence. The
|
|
1412
|
+
* backend SummaryWorker asynchronously updates the conversation summary
|
|
1413
|
+
* after new messages are added.
|
|
1317
1414
|
*
|
|
1318
|
-
* @param conversationId -
|
|
1415
|
+
* @param conversationId - Compound conversation ID ("tenant::user::session").
|
|
1319
1416
|
* @param message - Message payload including role and content.
|
|
1320
1417
|
* @returns The newly created message with generated ID and sequence number.
|
|
1321
1418
|
* @throws {ApiError} 404 if the conversation does not exist.
|
|
@@ -1326,7 +1423,7 @@ declare class ConversationService extends BaseService {
|
|
|
1326
1423
|
*
|
|
1327
1424
|
* Messages are returned in chronological order (oldest first).
|
|
1328
1425
|
*
|
|
1329
|
-
* @param conversationId -
|
|
1426
|
+
* @param conversationId - Compound conversation ID ("tenant::user::session").
|
|
1330
1427
|
* @param params - Optional pagination controls (limit, offset).
|
|
1331
1428
|
* @returns Paginated list of messages.
|
|
1332
1429
|
* @throws {ApiError} 404 if the conversation does not exist.
|
|
@@ -1335,21 +1432,24 @@ declare class ConversationService extends BaseService {
|
|
|
1335
1432
|
/**
|
|
1336
1433
|
* Retrieve the auto-generated summary of a conversation.
|
|
1337
1434
|
*
|
|
1338
|
-
* Summaries are produced by
|
|
1339
|
-
*
|
|
1435
|
+
* Summaries are produced incrementally by the backend SummaryWorker from
|
|
1436
|
+
* the conversation history.
|
|
1340
1437
|
*
|
|
1341
|
-
* @param conversationId -
|
|
1342
|
-
* @returns The conversation summary
|
|
1438
|
+
* @param conversationId - Compound conversation ID ("tenant::user::session").
|
|
1439
|
+
* @returns The conversation summary ({@link ConversationSummary}: summary
|
|
1440
|
+
* text + message counts + created_at). Note: no "key points" or
|
|
1441
|
+
* "generated_at" fields — those were phantom (removed in v4.0.0).
|
|
1343
1442
|
* @throws {ApiError} 404 if the conversation does not exist.
|
|
1344
1443
|
*/
|
|
1345
1444
|
getSummary(conversationId: string, options?: RequestOptions): Promise<ConversationSummary>;
|
|
1346
1445
|
/**
|
|
1347
|
-
* Delete a conversation
|
|
1446
|
+
* Delete a conversation.
|
|
1348
1447
|
*
|
|
1349
|
-
*
|
|
1350
|
-
*
|
|
1448
|
+
* Soft-delete: the backend sets `deleted_at` (the conversation stops
|
|
1449
|
+
* appearing in list/get) rather than physically removing the row and its
|
|
1450
|
+
* messages.
|
|
1351
1451
|
*
|
|
1352
|
-
* @param conversationId -
|
|
1452
|
+
* @param conversationId - Compound conversation ID ("tenant::user::session").
|
|
1353
1453
|
* @throws {ApiError} 404 if the conversation does not exist.
|
|
1354
1454
|
*/
|
|
1355
1455
|
delete(conversationId: string, options?: RequestOptions): Promise<void>;
|
|
@@ -1758,6 +1858,8 @@ interface TenantQuotas {
|
|
|
1758
1858
|
max_memories?: number;
|
|
1759
1859
|
/** Maximum number of conversations allowed */
|
|
1760
1860
|
max_conversations?: number;
|
|
1861
|
+
/** Maximum number of knowledge graph nodes allowed */
|
|
1862
|
+
max_graph_nodes?: number;
|
|
1761
1863
|
/** Maximum API calls per day */
|
|
1762
1864
|
max_api_calls_per_day?: number;
|
|
1763
1865
|
/** Forward-compatible: any additional quota dimensions */
|
|
@@ -1833,9 +1935,12 @@ interface ApiKeyCreate {
|
|
|
1833
1935
|
/** Human-readable name for the API key (1-255 characters) */
|
|
1834
1936
|
name: string;
|
|
1835
1937
|
/**
|
|
1836
|
-
* Permission scopes for the key (known values: read, write, admin,
|
|
1837
|
-
*
|
|
1838
|
-
*
|
|
1938
|
+
* Permission scopes for the key (known values: read, write, admin,
|
|
1939
|
+
* admin:dashboard, feedback:diagnose, "*" wildcard).
|
|
1940
|
+
* @default ["read", "write"] — least-privilege default (backend tightened
|
|
1941
|
+
* in security-scopes-admin-hardening, 2026-06-11). The "*" wildcard must be
|
|
1942
|
+
* requested explicitly; the default intentionally omits admin:dashboard /
|
|
1943
|
+
* feedback:diagnose.
|
|
1839
1944
|
*/
|
|
1840
1945
|
scopes?: string[];
|
|
1841
1946
|
/**
|
|
@@ -2505,16 +2610,16 @@ declare const memorySearchSchema: z.ZodObject<{
|
|
|
2505
2610
|
|
|
2506
2611
|
declare const conversationCreateSchema: z.ZodObject<{
|
|
2507
2612
|
user_id: z.ZodString;
|
|
2508
|
-
|
|
2613
|
+
agent_id: z.ZodOptional<z.ZodString>;
|
|
2509
2614
|
metadata: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
|
|
2510
2615
|
}, "strip", z.ZodTypeAny, {
|
|
2511
2616
|
user_id: string;
|
|
2512
2617
|
metadata?: Record<string, unknown> | undefined;
|
|
2513
|
-
|
|
2618
|
+
agent_id?: string | undefined;
|
|
2514
2619
|
}, {
|
|
2515
2620
|
user_id: string;
|
|
2516
2621
|
metadata?: Record<string, unknown> | undefined;
|
|
2517
|
-
|
|
2622
|
+
agent_id?: string | undefined;
|
|
2518
2623
|
}>;
|
|
2519
2624
|
declare const messageCreateSchema: z.ZodObject<{
|
|
2520
2625
|
role: z.ZodEnum<["user", "assistant", "system", "tool"]>;
|
|
@@ -2571,4 +2676,4 @@ declare const apiKeyCreateSchema: z.ZodObject<{
|
|
|
2571
2676
|
expires_in_days?: number | undefined;
|
|
2572
2677
|
}>;
|
|
2573
2678
|
|
|
2574
|
-
export { type Activity, type ActivityProcessingStatus, ActivityService, type ActivityStats, type ActivityStatusResponse, type ActivityStreamRequest, type ActivityStreamResponse, type ActivityType, ApiError, type ApiErrorDetail, type ApiKey, type ApiKeyCreate, type ApiKeyCreated, type ApiResponse, AuthenticationError, type CacheConfig, type CompoundId, ConfigurationError, type ContextDepth, type ContextDepthPreset, type ContextGraphEntity, type ContextLayer, type ContextRequest, type ContextRetrieveResponse, ContextService, type Conversation, type ConversationCreate, type
|
|
2679
|
+
export { type Activity, type ActivityProcessingStatus, ActivityService, type ActivityStats, type ActivityStatusResponse, type ActivityStreamRequest, type ActivityStreamResponse, type ActivityType, ApiError, type ApiErrorDetail, type ApiKey, type ApiKeyCreate, type ApiKeyCreated, type ApiResponse, AuthenticationError, type CacheConfig, type CompoundId, ConfigurationError, type ContextDepth, type ContextDepthPreset, type ContextGraphEntity, type ContextLayer, type ContextRequest, type ContextRetrieveResponse, ContextService, type Conversation, type ConversationCreate, type ConversationList, type ConversationListParams, type ConversationMessage, ConversationService, type ConversationStatus, type ConversationSummary, DEFAULT_CONFIG, DEPTH_PRESETS, type EntityListParams, type EntityListResponse, type ErrorReportRequest, type ErrorReportResponse, ErrorService, type ErrorSeverity, type ErrorType, type ExtractionRequest, type ExtractionResult, type FeedbackItemRequest, type FeedbackListItem, type FeedbackListParams, type FeedbackListResponse, type FeedbackResponse, FeedbackService, type FeedbackSubmitRequest, type GraphPath, type GraphPathEntity, type GraphPathRelationship, type GraphQueryRequest, type GraphQueryResponse, type HealthResponse, type HealthStatus, InputValidationError, type JournalEntry, type JournalResponse, type KnowledgeEntity, type KnowledgeRelationship, KnowledgeService, type Memory, type MemoryCreate, type MemoryJournalParams, type MemoryList, type MemoryListParams, type MemorySearch, type MemorySearchResult, MemoryService, type MemoryType, type MemoryUpdate, type Message, type MessageCreate, type MessageList, type MessageListParams, type MessageRole, NetworkError, NexusClient, type NexusConfig, NexusError, NotFoundError, type OfflineConfig, OfflineQueue, type PaginatedResponse, type Pagination, type ProfileMemory, type QueuedRequest, RateLimitError, type RequestOptions, type ResolvedCacheConfig, type ResolvedConfig, type ResolvedRetryConfig, type RetryConfig, type SearchResult, type ServiceStatus, type SortOrder, type Tenant, type TenantQuotas, TenantService, type TenantTier, TimeoutError, type UsageStats, ValidationError, apiKeyCreateSchema, contextRequestSchema, conversationCreateSchema, extractionRequestSchema, graphQueryRequestSchema, memoryCreateSchema, memorySearchSchema, memoryUpdateSchema, messageCreateSchema, resolveConfig };
|