@memnexus-ai/typescript-sdk 1.53.28 → 1.53.29

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/dist/index.cjs CHANGED
@@ -38,6 +38,7 @@ __export(index_exports, {
38
38
  MonitoringService: () => MonitoringService,
39
39
  NarrativesService: () => NarrativesService,
40
40
  PatternsService: () => PatternsService,
41
+ SdkError: () => SdkError,
41
42
  SerializationStyle: () => SerializationStyle,
42
43
  SystemService: () => SystemService,
43
44
  TopicsService: () => TopicsService,
@@ -123,6 +124,47 @@ __export(index_exports, {
123
124
  });
124
125
  module.exports = __toCommonJS(index_exports);
125
126
 
127
+ // src/http/http-types.ts
128
+ var SerializationStyle = /* @__PURE__ */ ((SerializationStyle2) => {
129
+ SerializationStyle2["SIMPLE"] = "simple";
130
+ SerializationStyle2["LABEL"] = "label";
131
+ SerializationStyle2["MATRIX"] = "matrix";
132
+ SerializationStyle2["FORM"] = "form";
133
+ SerializationStyle2["SPACE_DELIMITED"] = "space_delimited";
134
+ SerializationStyle2["PIPE_DELIMITED"] = "pipe_delimited";
135
+ SerializationStyle2["DEEP_OBJECT"] = "deep_object";
136
+ SerializationStyle2["NONE"] = "none";
137
+ return SerializationStyle2;
138
+ })(SerializationStyle || {});
139
+ var ContentType = /* @__PURE__ */ ((ContentType2) => {
140
+ ContentType2["Json"] = "json";
141
+ ContentType2["Xml"] = "xml";
142
+ ContentType2["Pdf"] = "pdf";
143
+ ContentType2["Image"] = "image";
144
+ ContentType2["File"] = "file";
145
+ ContentType2["Binary"] = "binary";
146
+ ContentType2["FormUrlEncoded"] = "form";
147
+ ContentType2["Text"] = "text";
148
+ ContentType2["MultipartFormData"] = "multipartFormData";
149
+ ContentType2["EventStream"] = "eventStream";
150
+ ContentType2["NoContent"] = "noContent";
151
+ return ContentType2;
152
+ })(ContentType || {});
153
+ var Environment = /* @__PURE__ */ ((Environment2) => {
154
+ Environment2["DEFAULT"] = "http://localhost:3000";
155
+ return Environment2;
156
+ })(Environment || {});
157
+ var SdkError = class _SdkError extends Error {
158
+ constructor(status, statusText, data, message) {
159
+ super(message);
160
+ this.status = status;
161
+ this.statusText = statusText;
162
+ this.data = data;
163
+ this.name = "SdkError";
164
+ Object.setPrototypeOf(this, _SdkError.prototype);
165
+ }
166
+ };
167
+
126
168
  // src/http/handlers.ts
127
169
  var BaseHandler = class {
128
170
  nextHandler;
@@ -283,9 +325,7 @@ var ExecuteHandler = class extends BaseHandler {
283
325
  raw
284
326
  };
285
327
  if (!response.ok) {
286
- const error2 = new Error(`HTTP ${response.status}: ${response.statusText}`);
287
- error2.response = httpResponse;
288
- throw error2;
328
+ throw new SdkError(response.status, response.statusText, data, `HTTP ${response.status}: ${response.statusText}`);
289
329
  }
290
330
  return httpResponse;
291
331
  } finally {
@@ -3781,6 +3821,7 @@ var ConversationsService = class extends BaseService {
3781
3821
  * @param since - Return only conversations created after this timestamp (ISO 8601 format)
3782
3822
  * @param sortBy - Field to sort conversations by
3783
3823
  * @param order - Sort order
3824
+ * @param hasMemories - When true, return only conversations that contain at least one memory
3784
3825
  */
3785
3826
  async listConversations(options) {
3786
3827
  const request = new Request({
@@ -3856,6 +3897,18 @@ var ConversationsService = class extends BaseService {
3856
3897
  isCursor: false
3857
3898
  });
3858
3899
  }
3900
+ if (options?.hasMemories !== void 0) {
3901
+ request.addQueryParam("hasMemories", {
3902
+ key: "hasMemories",
3903
+ value: options.hasMemories,
3904
+ explode: false,
3905
+ encode: true,
3906
+ style: "form",
3907
+ isLimit: false,
3908
+ isOffset: false,
3909
+ isCursor: false
3910
+ });
3911
+ }
3859
3912
  return this.client.call(request);
3860
3913
  }
3861
3914
  /**
@@ -4832,37 +4885,6 @@ var AdminService = class extends BaseService {
4832
4885
  }
4833
4886
  };
4834
4887
 
4835
- // src/http/http-types.ts
4836
- var SerializationStyle = /* @__PURE__ */ ((SerializationStyle2) => {
4837
- SerializationStyle2["SIMPLE"] = "simple";
4838
- SerializationStyle2["LABEL"] = "label";
4839
- SerializationStyle2["MATRIX"] = "matrix";
4840
- SerializationStyle2["FORM"] = "form";
4841
- SerializationStyle2["SPACE_DELIMITED"] = "space_delimited";
4842
- SerializationStyle2["PIPE_DELIMITED"] = "pipe_delimited";
4843
- SerializationStyle2["DEEP_OBJECT"] = "deep_object";
4844
- SerializationStyle2["NONE"] = "none";
4845
- return SerializationStyle2;
4846
- })(SerializationStyle || {});
4847
- var ContentType = /* @__PURE__ */ ((ContentType2) => {
4848
- ContentType2["Json"] = "json";
4849
- ContentType2["Xml"] = "xml";
4850
- ContentType2["Pdf"] = "pdf";
4851
- ContentType2["Image"] = "image";
4852
- ContentType2["File"] = "file";
4853
- ContentType2["Binary"] = "binary";
4854
- ContentType2["FormUrlEncoded"] = "form";
4855
- ContentType2["Text"] = "text";
4856
- ContentType2["MultipartFormData"] = "multipartFormData";
4857
- ContentType2["EventStream"] = "eventStream";
4858
- ContentType2["NoContent"] = "noContent";
4859
- return ContentType2;
4860
- })(ContentType || {});
4861
- var Environment = /* @__PURE__ */ ((Environment2) => {
4862
- Environment2["DEFAULT"] = "http://localhost:3000";
4863
- return Environment2;
4864
- })(Environment || {});
4865
-
4866
4888
  // src/models/schemas.ts
4867
4889
  var import_zod = require("zod");
4868
4890
  var error = import_zod.z.object({
@@ -4924,6 +4946,8 @@ var memory = import_zod.z.object({
4924
4946
  userTopics: import_zod.z.array(import_zod.z.string()).optional(),
4925
4947
  /** Topics automatically extracted from content */
4926
4948
  extractedTopics: import_zod.z.array(import_zod.z.string()).optional(),
4949
+ /** Agent session ID that created this memory (MCP session ID or CLI session UUID). Used to group memories by agent instance for conversation threading. */
4950
+ agentSessionId: import_zod.z.string().nullable().optional(),
4927
4951
  /** Entities extracted from memory content */
4928
4952
  entities: import_zod.z.array(import_zod.z.object({
4929
4953
  /** Entity name */
@@ -4937,7 +4961,8 @@ var memory = import_zod.z.object({
4937
4961
  var createMemoryRequest = import_zod.z.object({
4938
4962
  /** Conversation ID - use "NEW" to create a new conversation or provide existing conversation ID */
4939
4963
  conversationId: import_zod.z.string().min(1),
4940
- /** AI agent session ID (e.g. Claude Code session UUID). When provided with conversationId "NEW", reuses the existing conversation for this session instead of creating a new one. */
4964
+ /** Agent session ID (e.g. MCP session ID, Claude Code session UUID). When provided with conversationId "NEW", reuses the existing conversation for this session instead of creating a new one. Works with any MCP client (Claude, Copilot, Cursor, etc.). */
4965
+ agentSessionId: import_zod.z.string().max(200).optional(),
4941
4966
  claudeSessionId: import_zod.z.string().max(200).optional(),
4942
4967
  /** Optional human-readable name for deterministic retrieval. Must be unique per user. */
4943
4968
  name: import_zod.z.string().regex(/^[a-z0-9][a-z0-9-]{0,62}[a-z0-9]$/).optional(),
@@ -5032,6 +5057,8 @@ var relatedMemoryResult = import_zod.z.object({
5032
5057
  userTopics: import_zod.z.array(import_zod.z.string()).optional(),
5033
5058
  /** Topics automatically extracted from content */
5034
5059
  extractedTopics: import_zod.z.array(import_zod.z.string()).optional(),
5060
+ /** Agent session ID that created this memory (MCP session ID or CLI session UUID). Used to group memories by agent instance for conversation threading. */
5061
+ agentSessionId: import_zod.z.string().nullable().optional(),
5035
5062
  /** Entities extracted from memory content */
5036
5063
  entities: import_zod.z.array(import_zod.z.object({
5037
5064
  /** Entity name */
@@ -5331,6 +5358,8 @@ var searchResult = import_zod.z.lazy(() => import_zod.z.object({
5331
5358
  userTopics: import_zod.z.array(import_zod.z.string()).optional(),
5332
5359
  /** Topics automatically extracted from content */
5333
5360
  extractedTopics: import_zod.z.array(import_zod.z.string()).optional(),
5361
+ /** Agent session ID that created this memory (MCP session ID or CLI session UUID). Used to group memories by agent instance for conversation threading. */
5362
+ agentSessionId: import_zod.z.string().nullable().optional(),
5334
5363
  /** Entities extracted from memory content */
5335
5364
  entities: import_zod.z.array(import_zod.z.object({
5336
5365
  /** Entity name */
@@ -5699,6 +5728,8 @@ var narrativeMemory = import_zod.z.object({
5699
5728
  userTopics: import_zod.z.array(import_zod.z.string()).optional(),
5700
5729
  /** Topics automatically extracted from content */
5701
5730
  extractedTopics: import_zod.z.array(import_zod.z.string()).optional(),
5731
+ /** Agent session ID that created this memory (MCP session ID or CLI session UUID). Used to group memories by agent instance for conversation threading. */
5732
+ agentSessionId: import_zod.z.string().nullable().optional(),
5702
5733
  /** Entities extracted from memory content */
5703
5734
  entities: import_zod.z.array(import_zod.z.object({
5704
5735
  /** Entity name */
@@ -6239,6 +6270,7 @@ var index_default = Memnexus;
6239
6270
  MonitoringService,
6240
6271
  NarrativesService,
6241
6272
  PatternsService,
6273
+ SdkError,
6242
6274
  SerializationStyle,
6243
6275
  SystemService,
6244
6276
  TopicsService,