@memnexus-ai/typescript-sdk 1.53.27 → 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.js CHANGED
@@ -1,3 +1,44 @@
1
+ // src/http/http-types.ts
2
+ var SerializationStyle = /* @__PURE__ */ ((SerializationStyle2) => {
3
+ SerializationStyle2["SIMPLE"] = "simple";
4
+ SerializationStyle2["LABEL"] = "label";
5
+ SerializationStyle2["MATRIX"] = "matrix";
6
+ SerializationStyle2["FORM"] = "form";
7
+ SerializationStyle2["SPACE_DELIMITED"] = "space_delimited";
8
+ SerializationStyle2["PIPE_DELIMITED"] = "pipe_delimited";
9
+ SerializationStyle2["DEEP_OBJECT"] = "deep_object";
10
+ SerializationStyle2["NONE"] = "none";
11
+ return SerializationStyle2;
12
+ })(SerializationStyle || {});
13
+ var ContentType = /* @__PURE__ */ ((ContentType2) => {
14
+ ContentType2["Json"] = "json";
15
+ ContentType2["Xml"] = "xml";
16
+ ContentType2["Pdf"] = "pdf";
17
+ ContentType2["Image"] = "image";
18
+ ContentType2["File"] = "file";
19
+ ContentType2["Binary"] = "binary";
20
+ ContentType2["FormUrlEncoded"] = "form";
21
+ ContentType2["Text"] = "text";
22
+ ContentType2["MultipartFormData"] = "multipartFormData";
23
+ ContentType2["EventStream"] = "eventStream";
24
+ ContentType2["NoContent"] = "noContent";
25
+ return ContentType2;
26
+ })(ContentType || {});
27
+ var Environment = /* @__PURE__ */ ((Environment2) => {
28
+ Environment2["DEFAULT"] = "http://localhost:3000";
29
+ return Environment2;
30
+ })(Environment || {});
31
+ var SdkError = class _SdkError extends Error {
32
+ constructor(status, statusText, data, message) {
33
+ super(message);
34
+ this.status = status;
35
+ this.statusText = statusText;
36
+ this.data = data;
37
+ this.name = "SdkError";
38
+ Object.setPrototypeOf(this, _SdkError.prototype);
39
+ }
40
+ };
41
+
1
42
  // src/http/handlers.ts
2
43
  var BaseHandler = class {
3
44
  nextHandler;
@@ -158,9 +199,7 @@ var ExecuteHandler = class extends BaseHandler {
158
199
  raw
159
200
  };
160
201
  if (!response.ok) {
161
- const error2 = new Error(`HTTP ${response.status}: ${response.statusText}`);
162
- error2.response = httpResponse;
163
- throw error2;
202
+ throw new SdkError(response.status, response.statusText, data, `HTTP ${response.status}: ${response.statusText}`);
164
203
  }
165
204
  return httpResponse;
166
205
  } finally {
@@ -3656,6 +3695,7 @@ var ConversationsService = class extends BaseService {
3656
3695
  * @param since - Return only conversations created after this timestamp (ISO 8601 format)
3657
3696
  * @param sortBy - Field to sort conversations by
3658
3697
  * @param order - Sort order
3698
+ * @param hasMemories - When true, return only conversations that contain at least one memory
3659
3699
  */
3660
3700
  async listConversations(options) {
3661
3701
  const request = new Request({
@@ -3731,6 +3771,18 @@ var ConversationsService = class extends BaseService {
3731
3771
  isCursor: false
3732
3772
  });
3733
3773
  }
3774
+ if (options?.hasMemories !== void 0) {
3775
+ request.addQueryParam("hasMemories", {
3776
+ key: "hasMemories",
3777
+ value: options.hasMemories,
3778
+ explode: false,
3779
+ encode: true,
3780
+ style: "form",
3781
+ isLimit: false,
3782
+ isOffset: false,
3783
+ isCursor: false
3784
+ });
3785
+ }
3734
3786
  return this.client.call(request);
3735
3787
  }
3736
3788
  /**
@@ -4707,37 +4759,6 @@ var AdminService = class extends BaseService {
4707
4759
  }
4708
4760
  };
4709
4761
 
4710
- // src/http/http-types.ts
4711
- var SerializationStyle = /* @__PURE__ */ ((SerializationStyle2) => {
4712
- SerializationStyle2["SIMPLE"] = "simple";
4713
- SerializationStyle2["LABEL"] = "label";
4714
- SerializationStyle2["MATRIX"] = "matrix";
4715
- SerializationStyle2["FORM"] = "form";
4716
- SerializationStyle2["SPACE_DELIMITED"] = "space_delimited";
4717
- SerializationStyle2["PIPE_DELIMITED"] = "pipe_delimited";
4718
- SerializationStyle2["DEEP_OBJECT"] = "deep_object";
4719
- SerializationStyle2["NONE"] = "none";
4720
- return SerializationStyle2;
4721
- })(SerializationStyle || {});
4722
- var ContentType = /* @__PURE__ */ ((ContentType2) => {
4723
- ContentType2["Json"] = "json";
4724
- ContentType2["Xml"] = "xml";
4725
- ContentType2["Pdf"] = "pdf";
4726
- ContentType2["Image"] = "image";
4727
- ContentType2["File"] = "file";
4728
- ContentType2["Binary"] = "binary";
4729
- ContentType2["FormUrlEncoded"] = "form";
4730
- ContentType2["Text"] = "text";
4731
- ContentType2["MultipartFormData"] = "multipartFormData";
4732
- ContentType2["EventStream"] = "eventStream";
4733
- ContentType2["NoContent"] = "noContent";
4734
- return ContentType2;
4735
- })(ContentType || {});
4736
- var Environment = /* @__PURE__ */ ((Environment2) => {
4737
- Environment2["DEFAULT"] = "http://localhost:3000";
4738
- return Environment2;
4739
- })(Environment || {});
4740
-
4741
4762
  // src/models/schemas.ts
4742
4763
  import { z } from "zod";
4743
4764
  var error = z.object({
@@ -4799,6 +4820,8 @@ var memory = z.object({
4799
4820
  userTopics: z.array(z.string()).optional(),
4800
4821
  /** Topics automatically extracted from content */
4801
4822
  extractedTopics: z.array(z.string()).optional(),
4823
+ /** Agent session ID that created this memory (MCP session ID or CLI session UUID). Used to group memories by agent instance for conversation threading. */
4824
+ agentSessionId: z.string().nullable().optional(),
4802
4825
  /** Entities extracted from memory content */
4803
4826
  entities: z.array(z.object({
4804
4827
  /** Entity name */
@@ -4812,7 +4835,8 @@ var memory = z.object({
4812
4835
  var createMemoryRequest = z.object({
4813
4836
  /** Conversation ID - use "NEW" to create a new conversation or provide existing conversation ID */
4814
4837
  conversationId: z.string().min(1),
4815
- /** 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. */
4838
+ /** 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.). */
4839
+ agentSessionId: z.string().max(200).optional(),
4816
4840
  claudeSessionId: z.string().max(200).optional(),
4817
4841
  /** Optional human-readable name for deterministic retrieval. Must be unique per user. */
4818
4842
  name: z.string().regex(/^[a-z0-9][a-z0-9-]{0,62}[a-z0-9]$/).optional(),
@@ -4907,6 +4931,8 @@ var relatedMemoryResult = z.object({
4907
4931
  userTopics: z.array(z.string()).optional(),
4908
4932
  /** Topics automatically extracted from content */
4909
4933
  extractedTopics: z.array(z.string()).optional(),
4934
+ /** Agent session ID that created this memory (MCP session ID or CLI session UUID). Used to group memories by agent instance for conversation threading. */
4935
+ agentSessionId: z.string().nullable().optional(),
4910
4936
  /** Entities extracted from memory content */
4911
4937
  entities: z.array(z.object({
4912
4938
  /** Entity name */
@@ -5206,6 +5232,8 @@ var searchResult = z.lazy(() => z.object({
5206
5232
  userTopics: z.array(z.string()).optional(),
5207
5233
  /** Topics automatically extracted from content */
5208
5234
  extractedTopics: z.array(z.string()).optional(),
5235
+ /** Agent session ID that created this memory (MCP session ID or CLI session UUID). Used to group memories by agent instance for conversation threading. */
5236
+ agentSessionId: z.string().nullable().optional(),
5209
5237
  /** Entities extracted from memory content */
5210
5238
  entities: z.array(z.object({
5211
5239
  /** Entity name */
@@ -5574,6 +5602,8 @@ var narrativeMemory = z.object({
5574
5602
  userTopics: z.array(z.string()).optional(),
5575
5603
  /** Topics automatically extracted from content */
5576
5604
  extractedTopics: z.array(z.string()).optional(),
5605
+ /** Agent session ID that created this memory (MCP session ID or CLI session UUID). Used to group memories by agent instance for conversation threading. */
5606
+ agentSessionId: z.string().nullable().optional(),
5577
5607
  /** Entities extracted from memory content */
5578
5608
  entities: z.array(z.object({
5579
5609
  /** Entity name */
@@ -6113,6 +6143,7 @@ export {
6113
6143
  MonitoringService,
6114
6144
  NarrativesService,
6115
6145
  PatternsService,
6146
+ SdkError,
6116
6147
  SerializationStyle,
6117
6148
  SystemService,
6118
6149
  TopicsService,