@nexusm/sdk 3.0.0 → 4.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 CHANGED
@@ -165,10 +165,13 @@ const graph = await nexus.knowledge.query({
165
165
 
166
166
  | Method | Description |
167
167
  |--------|-------------|
168
- | `createEntity(data)` | Create a new entity in the knowledge graph |
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('Memories:', usage.memories_count);
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()` | Retrieve resource usage statistics |
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
- * Represents a single piece of user knowledge managed by Mem0.
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) */
@@ -1097,10 +1116,17 @@ declare class MemoryService extends BaseService {
1097
1116
  /**
1098
1117
  * @nexusm/sdk - Conversation Types
1099
1118
  *
1100
- * Type definitions for the Conversation Service powered by Zep OSS.
1119
+ * Type definitions for the Conversation Service.
1101
1120
  * Manages conversation history, messages, and auto-generated summaries.
1102
1121
  *
1103
- * Based on Nexus API v2.0 OpenAPI specification.
1122
+ * v4.0.0 BREAKING (memory-conversation-contract-reconciliation, 2026-06-11):
1123
+ * canonical = backend Pydantic response models (`schemas/conversation.py`)
1124
+ * serialized wire names. The previous shapes were drifted: nested
1125
+ * `{data, pagination}` containers never existed on the wire (backend lists
1126
+ * are FLAT), the conversation identifier wire key is `conversation_id` (the
1127
+ * old `session_id` was a phantom), `ConversationDetail` described a response
1128
+ * no endpoint emits, and `ConversationSummary` declared phantom
1129
+ * `key_points`/`generated_at` while missing the real count fields.
1104
1130
  */
1105
1131
  /** Valid message roles in a conversation */
1106
1132
  type MessageRole = 'user' | 'assistant' | 'system' | 'tool';
@@ -1108,17 +1134,29 @@ type MessageRole = 'user' | 'assistant' | 'system' | 'tool';
1108
1134
  type ConversationStatus = 'active' | 'archived' | 'deleted';
1109
1135
  /**
1110
1136
  * A conversation session between a user and an AI agent.
1111
- * Managed by Zep OSS for temporal graph and auto-summary.
1137
+ *
1138
+ * GET /conversations/{conversation_id} — mirrors backend
1139
+ * `ConversationResponse` (11 fields, flat).
1140
+ *
1141
+ * v4.0.0 BREAKING: `session_id` → `conversation_id` (the real wire key —
1142
+ * backend field `compound_session_id` serializes via alias); adds
1143
+ * `tenant_id` / `agent_id` / `status` (previously missing).
1112
1144
  */
1113
1145
  interface Conversation {
1114
1146
  /** Unique conversation identifier (UUID) */
1115
1147
  id: string;
1148
+ /** Compound session ID ("tenant::user::session") — the wire key */
1149
+ conversation_id: string;
1150
+ /** Tenant identifier */
1151
+ tenant_id: string;
1116
1152
  /** User ID that owns this conversation */
1117
1153
  user_id: string;
1118
- /** Session identifier for the conversation */
1119
- session_id?: string;
1154
+ /** Originating agent (null when not agent-created) */
1155
+ agent_id?: string | null;
1156
+ /** Conversation status (e.g. active / archived) */
1157
+ status: string;
1120
1158
  /** Auto-generated conversation summary */
1121
- summary?: string;
1159
+ summary?: string | null;
1122
1160
  /** Total number of messages in the conversation */
1123
1161
  message_count: number;
1124
1162
  /** Additional metadata key-value pairs */
@@ -1141,20 +1179,28 @@ interface ConversationCreate {
1141
1179
  /** Additional metadata key-value pairs */
1142
1180
  metadata?: Record<string, unknown>;
1143
1181
  }
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
1182
  /**
1153
1183
  * A single message within a conversation.
1184
+ *
1185
+ * Mirrors backend `MessageResponse` (11 fields).
1186
+ *
1187
+ * v4.0.0 BREAKING: adds `message_id` / `conversation_id` /
1188
+ * `conversation_compound_id` / `tenant_id` / `user_id` correlation fields
1189
+ * (previously missing from the SDK type while present on the wire).
1154
1190
  */
1155
1191
  interface Message {
1156
1192
  /** Unique message identifier (UUID) */
1157
1193
  id: string;
1194
+ /** Compound message ID */
1195
+ message_id: string;
1196
+ /** Owning conversation UUID (NOT the compound id — see conversation_compound_id) */
1197
+ conversation_id: string;
1198
+ /** Owning conversation compound ID ("tenant::user::session") */
1199
+ conversation_compound_id: string;
1200
+ /** Tenant identifier */
1201
+ tenant_id: string;
1202
+ /** User identifier */
1203
+ user_id: string;
1158
1204
  /** Message role (user, assistant, system, or tool) */
1159
1205
  role: MessageRole;
1160
1206
  /** Message content text */
@@ -1162,7 +1208,7 @@ interface Message {
1162
1208
  /** Additional metadata key-value pairs */
1163
1209
  metadata?: Record<string, unknown>;
1164
1210
  /** Message sequence number within the conversation */
1165
- sequence?: number;
1211
+ sequence: number;
1166
1212
  /** Timestamp when the message was created (ISO 8601) */
1167
1213
  created_at: string;
1168
1214
  }
@@ -1182,49 +1228,67 @@ interface MessageCreate {
1182
1228
  /**
1183
1229
  * Paginated list of conversations.
1184
1230
  *
1185
- * GET /conversations?user_id=...
1231
+ * GET /conversations?user_id=... — mirrors backend
1232
+ * `ConversationListResponse` (FLAT container).
1233
+ *
1234
+ * v4.0.0 BREAKING: was nested `{data, pagination:{total, limit, offset,
1235
+ * has_more}}` — that shape never existed on the wire.
1186
1236
  */
1187
1237
  interface ConversationList {
1188
1238
  /** Array of conversation records */
1189
- data: Conversation[];
1190
- /** Pagination metadata */
1191
- pagination: {
1192
- /** Total number of conversations */
1193
- total: number;
1194
- /** Current page size limit */
1195
- limit: number;
1196
- /** Current offset */
1197
- offset: number;
1198
- /** Whether more results exist */
1199
- has_more: boolean;
1200
- };
1239
+ conversations: Conversation[];
1240
+ /** Total number of conversations */
1241
+ total_count: number;
1242
+ /** Current page size limit */
1243
+ limit: number;
1244
+ /** Current offset */
1245
+ offset: number;
1246
+ /** Whether more results exist */
1247
+ has_next: boolean;
1201
1248
  }
1202
1249
  /**
1203
1250
  * Paginated list of messages within a conversation.
1204
1251
  *
1205
- * GET /conversations/:conversation_id/messages
1252
+ * GET /conversations/:conversation_id/messages — mirrors backend
1253
+ * `MessageListResponse` (FLAT container).
1254
+ *
1255
+ * v4.0.0 BREAKING: was `{data, has_more}` — missing
1256
+ * total_count/limit/offset and using a phantom container key.
1206
1257
  */
1207
1258
  interface MessageList {
1208
1259
  /** Array of message records */
1209
- data: Message[];
1210
- /** Whether more messages exist before the current page */
1211
- has_more: boolean;
1260
+ messages: Message[];
1261
+ /** Total number of messages */
1262
+ total_count: number;
1263
+ /** Current page size limit */
1264
+ limit: number;
1265
+ /** Current offset */
1266
+ offset: number;
1267
+ /** Whether more messages exist */
1268
+ has_next: boolean;
1212
1269
  }
1213
1270
  /**
1214
1271
  * Auto-generated summary of a conversation.
1215
- * Generated by Zep OSS temporal graph analysis.
1216
1272
  *
1217
- * GET /conversations/:conversation_id/summary
1273
+ * GET /conversations/:conversation_id/summary — mirrors backend
1274
+ * `SummaryResponse` (5 fields).
1275
+ *
1276
+ * v4.0.0 BREAKING: the previous shape declared phantom `key_points[]` /
1277
+ * `generated_at`; the backend emits message counts + `created_at`. The wire
1278
+ * id key is `conversation_id` (unified 2026-06-11 — the endpoint previously
1279
+ * emitted `compound_session_id`, an internal third id variant).
1218
1280
  */
1219
1281
  interface ConversationSummary {
1220
- /** Conversation identifier (UUID) */
1282
+ /** Compound conversation ID (same key as Conversation.conversation_id) */
1221
1283
  conversation_id: string;
1222
- /** Generated summary text */
1223
- summary?: string;
1224
- /** Key points extracted from the conversation */
1225
- key_points?: string[];
1226
- /** Timestamp when the summary was generated (ISO 8601) */
1227
- generated_at: string;
1284
+ /** Generated summary text (null until first summary) */
1285
+ summary?: string | null;
1286
+ /** Number of messages already folded into the summary */
1287
+ summary_message_count: number;
1288
+ /** Total number of messages in the conversation */
1289
+ message_count: number;
1290
+ /** Timestamp when the conversation was created (ISO 8601) */
1291
+ created_at: string;
1228
1292
  }
1229
1293
 
1230
1294
  /**
@@ -1301,13 +1365,17 @@ declare class ConversationService extends BaseService {
1301
1365
  */
1302
1366
  list(params?: ConversationListParams, options?: RequestOptions): Promise<ConversationList>;
1303
1367
  /**
1304
- * Retrieve a conversation with its messages included.
1368
+ * Retrieve a conversation.
1369
+ *
1370
+ * v4.0.0 BREAKING: returns `Conversation` — the backend response has no
1371
+ * `messages` array (the previous `ConversationDetail` shape was a
1372
+ * phantom). Fetch messages via {@link getMessages}.
1305
1373
  *
1306
- * @param conversationId - UUID of the conversation to retrieve.
1307
- * @returns Conversation detail including the full message list.
1374
+ * @param conversationId - Compound conversation ID to retrieve.
1375
+ * @returns The conversation record.
1308
1376
  * @throws {ApiError} 404 if the conversation does not exist.
1309
1377
  */
1310
- get(conversationId: string, options?: RequestOptions): Promise<ConversationDetail>;
1378
+ get(conversationId: string, options?: RequestOptions): Promise<Conversation>;
1311
1379
  /**
1312
1380
  * Add a message to an existing conversation.
1313
1381
  *
@@ -1758,6 +1826,8 @@ interface TenantQuotas {
1758
1826
  max_memories?: number;
1759
1827
  /** Maximum number of conversations allowed */
1760
1828
  max_conversations?: number;
1829
+ /** Maximum number of knowledge graph nodes allowed */
1830
+ max_graph_nodes?: number;
1761
1831
  /** Maximum API calls per day */
1762
1832
  max_api_calls_per_day?: number;
1763
1833
  /** Forward-compatible: any additional quota dimensions */
@@ -2571,4 +2641,4 @@ declare const apiKeyCreateSchema: z.ZodObject<{
2571
2641
  expires_in_days?: number | undefined;
2572
2642
  }>;
2573
2643
 
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 ConversationDetail, 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 };
2644
+ 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 };
package/dist/index.d.ts 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
- * Represents a single piece of user knowledge managed by Mem0.
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) */
@@ -1097,10 +1116,17 @@ declare class MemoryService extends BaseService {
1097
1116
  /**
1098
1117
  * @nexusm/sdk - Conversation Types
1099
1118
  *
1100
- * Type definitions for the Conversation Service powered by Zep OSS.
1119
+ * Type definitions for the Conversation Service.
1101
1120
  * Manages conversation history, messages, and auto-generated summaries.
1102
1121
  *
1103
- * Based on Nexus API v2.0 OpenAPI specification.
1122
+ * v4.0.0 BREAKING (memory-conversation-contract-reconciliation, 2026-06-11):
1123
+ * canonical = backend Pydantic response models (`schemas/conversation.py`)
1124
+ * serialized wire names. The previous shapes were drifted: nested
1125
+ * `{data, pagination}` containers never existed on the wire (backend lists
1126
+ * are FLAT), the conversation identifier wire key is `conversation_id` (the
1127
+ * old `session_id` was a phantom), `ConversationDetail` described a response
1128
+ * no endpoint emits, and `ConversationSummary` declared phantom
1129
+ * `key_points`/`generated_at` while missing the real count fields.
1104
1130
  */
1105
1131
  /** Valid message roles in a conversation */
1106
1132
  type MessageRole = 'user' | 'assistant' | 'system' | 'tool';
@@ -1108,17 +1134,29 @@ type MessageRole = 'user' | 'assistant' | 'system' | 'tool';
1108
1134
  type ConversationStatus = 'active' | 'archived' | 'deleted';
1109
1135
  /**
1110
1136
  * A conversation session between a user and an AI agent.
1111
- * Managed by Zep OSS for temporal graph and auto-summary.
1137
+ *
1138
+ * GET /conversations/{conversation_id} — mirrors backend
1139
+ * `ConversationResponse` (11 fields, flat).
1140
+ *
1141
+ * v4.0.0 BREAKING: `session_id` → `conversation_id` (the real wire key —
1142
+ * backend field `compound_session_id` serializes via alias); adds
1143
+ * `tenant_id` / `agent_id` / `status` (previously missing).
1112
1144
  */
1113
1145
  interface Conversation {
1114
1146
  /** Unique conversation identifier (UUID) */
1115
1147
  id: string;
1148
+ /** Compound session ID ("tenant::user::session") — the wire key */
1149
+ conversation_id: string;
1150
+ /** Tenant identifier */
1151
+ tenant_id: string;
1116
1152
  /** User ID that owns this conversation */
1117
1153
  user_id: string;
1118
- /** Session identifier for the conversation */
1119
- session_id?: string;
1154
+ /** Originating agent (null when not agent-created) */
1155
+ agent_id?: string | null;
1156
+ /** Conversation status (e.g. active / archived) */
1157
+ status: string;
1120
1158
  /** Auto-generated conversation summary */
1121
- summary?: string;
1159
+ summary?: string | null;
1122
1160
  /** Total number of messages in the conversation */
1123
1161
  message_count: number;
1124
1162
  /** Additional metadata key-value pairs */
@@ -1141,20 +1179,28 @@ interface ConversationCreate {
1141
1179
  /** Additional metadata key-value pairs */
1142
1180
  metadata?: Record<string, unknown>;
1143
1181
  }
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
1182
  /**
1153
1183
  * A single message within a conversation.
1184
+ *
1185
+ * Mirrors backend `MessageResponse` (11 fields).
1186
+ *
1187
+ * v4.0.0 BREAKING: adds `message_id` / `conversation_id` /
1188
+ * `conversation_compound_id` / `tenant_id` / `user_id` correlation fields
1189
+ * (previously missing from the SDK type while present on the wire).
1154
1190
  */
1155
1191
  interface Message {
1156
1192
  /** Unique message identifier (UUID) */
1157
1193
  id: string;
1194
+ /** Compound message ID */
1195
+ message_id: string;
1196
+ /** Owning conversation UUID (NOT the compound id — see conversation_compound_id) */
1197
+ conversation_id: string;
1198
+ /** Owning conversation compound ID ("tenant::user::session") */
1199
+ conversation_compound_id: string;
1200
+ /** Tenant identifier */
1201
+ tenant_id: string;
1202
+ /** User identifier */
1203
+ user_id: string;
1158
1204
  /** Message role (user, assistant, system, or tool) */
1159
1205
  role: MessageRole;
1160
1206
  /** Message content text */
@@ -1162,7 +1208,7 @@ interface Message {
1162
1208
  /** Additional metadata key-value pairs */
1163
1209
  metadata?: Record<string, unknown>;
1164
1210
  /** Message sequence number within the conversation */
1165
- sequence?: number;
1211
+ sequence: number;
1166
1212
  /** Timestamp when the message was created (ISO 8601) */
1167
1213
  created_at: string;
1168
1214
  }
@@ -1182,49 +1228,67 @@ interface MessageCreate {
1182
1228
  /**
1183
1229
  * Paginated list of conversations.
1184
1230
  *
1185
- * GET /conversations?user_id=...
1231
+ * GET /conversations?user_id=... — mirrors backend
1232
+ * `ConversationListResponse` (FLAT container).
1233
+ *
1234
+ * v4.0.0 BREAKING: was nested `{data, pagination:{total, limit, offset,
1235
+ * has_more}}` — that shape never existed on the wire.
1186
1236
  */
1187
1237
  interface ConversationList {
1188
1238
  /** Array of conversation records */
1189
- data: Conversation[];
1190
- /** Pagination metadata */
1191
- pagination: {
1192
- /** Total number of conversations */
1193
- total: number;
1194
- /** Current page size limit */
1195
- limit: number;
1196
- /** Current offset */
1197
- offset: number;
1198
- /** Whether more results exist */
1199
- has_more: boolean;
1200
- };
1239
+ conversations: Conversation[];
1240
+ /** Total number of conversations */
1241
+ total_count: number;
1242
+ /** Current page size limit */
1243
+ limit: number;
1244
+ /** Current offset */
1245
+ offset: number;
1246
+ /** Whether more results exist */
1247
+ has_next: boolean;
1201
1248
  }
1202
1249
  /**
1203
1250
  * Paginated list of messages within a conversation.
1204
1251
  *
1205
- * GET /conversations/:conversation_id/messages
1252
+ * GET /conversations/:conversation_id/messages — mirrors backend
1253
+ * `MessageListResponse` (FLAT container).
1254
+ *
1255
+ * v4.0.0 BREAKING: was `{data, has_more}` — missing
1256
+ * total_count/limit/offset and using a phantom container key.
1206
1257
  */
1207
1258
  interface MessageList {
1208
1259
  /** Array of message records */
1209
- data: Message[];
1210
- /** Whether more messages exist before the current page */
1211
- has_more: boolean;
1260
+ messages: Message[];
1261
+ /** Total number of messages */
1262
+ total_count: number;
1263
+ /** Current page size limit */
1264
+ limit: number;
1265
+ /** Current offset */
1266
+ offset: number;
1267
+ /** Whether more messages exist */
1268
+ has_next: boolean;
1212
1269
  }
1213
1270
  /**
1214
1271
  * Auto-generated summary of a conversation.
1215
- * Generated by Zep OSS temporal graph analysis.
1216
1272
  *
1217
- * GET /conversations/:conversation_id/summary
1273
+ * GET /conversations/:conversation_id/summary — mirrors backend
1274
+ * `SummaryResponse` (5 fields).
1275
+ *
1276
+ * v4.0.0 BREAKING: the previous shape declared phantom `key_points[]` /
1277
+ * `generated_at`; the backend emits message counts + `created_at`. The wire
1278
+ * id key is `conversation_id` (unified 2026-06-11 — the endpoint previously
1279
+ * emitted `compound_session_id`, an internal third id variant).
1218
1280
  */
1219
1281
  interface ConversationSummary {
1220
- /** Conversation identifier (UUID) */
1282
+ /** Compound conversation ID (same key as Conversation.conversation_id) */
1221
1283
  conversation_id: string;
1222
- /** Generated summary text */
1223
- summary?: string;
1224
- /** Key points extracted from the conversation */
1225
- key_points?: string[];
1226
- /** Timestamp when the summary was generated (ISO 8601) */
1227
- generated_at: string;
1284
+ /** Generated summary text (null until first summary) */
1285
+ summary?: string | null;
1286
+ /** Number of messages already folded into the summary */
1287
+ summary_message_count: number;
1288
+ /** Total number of messages in the conversation */
1289
+ message_count: number;
1290
+ /** Timestamp when the conversation was created (ISO 8601) */
1291
+ created_at: string;
1228
1292
  }
1229
1293
 
1230
1294
  /**
@@ -1301,13 +1365,17 @@ declare class ConversationService extends BaseService {
1301
1365
  */
1302
1366
  list(params?: ConversationListParams, options?: RequestOptions): Promise<ConversationList>;
1303
1367
  /**
1304
- * Retrieve a conversation with its messages included.
1368
+ * Retrieve a conversation.
1369
+ *
1370
+ * v4.0.0 BREAKING: returns `Conversation` — the backend response has no
1371
+ * `messages` array (the previous `ConversationDetail` shape was a
1372
+ * phantom). Fetch messages via {@link getMessages}.
1305
1373
  *
1306
- * @param conversationId - UUID of the conversation to retrieve.
1307
- * @returns Conversation detail including the full message list.
1374
+ * @param conversationId - Compound conversation ID to retrieve.
1375
+ * @returns The conversation record.
1308
1376
  * @throws {ApiError} 404 if the conversation does not exist.
1309
1377
  */
1310
- get(conversationId: string, options?: RequestOptions): Promise<ConversationDetail>;
1378
+ get(conversationId: string, options?: RequestOptions): Promise<Conversation>;
1311
1379
  /**
1312
1380
  * Add a message to an existing conversation.
1313
1381
  *
@@ -1758,6 +1826,8 @@ interface TenantQuotas {
1758
1826
  max_memories?: number;
1759
1827
  /** Maximum number of conversations allowed */
1760
1828
  max_conversations?: number;
1829
+ /** Maximum number of knowledge graph nodes allowed */
1830
+ max_graph_nodes?: number;
1761
1831
  /** Maximum API calls per day */
1762
1832
  max_api_calls_per_day?: number;
1763
1833
  /** Forward-compatible: any additional quota dimensions */
@@ -2571,4 +2641,4 @@ declare const apiKeyCreateSchema: z.ZodObject<{
2571
2641
  expires_in_days?: number | undefined;
2572
2642
  }>;
2573
2643
 
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 ConversationDetail, 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 };
2644
+ 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 };
package/dist/index.js CHANGED
@@ -1123,10 +1123,14 @@ var ConversationService = class extends BaseService {
1123
1123
  return this.http.get("/conversations", params, options?.signal);
1124
1124
  }
1125
1125
  /**
1126
- * Retrieve a conversation with its messages included.
1126
+ * Retrieve a conversation.
1127
1127
  *
1128
- * @param conversationId - UUID of the conversation to retrieve.
1129
- * @returns Conversation detail including the full message list.
1128
+ * v4.0.0 BREAKING: returns `Conversation` the backend response has no
1129
+ * `messages` array (the previous `ConversationDetail` shape was a
1130
+ * phantom). Fetch messages via {@link getMessages}.
1131
+ *
1132
+ * @param conversationId - Compound conversation ID to retrieve.
1133
+ * @returns The conversation record.
1130
1134
  * @throws {ApiError} 404 if the conversation does not exist.
1131
1135
  */
1132
1136
  async get(conversationId, options) {