@memnexus-ai/typescript-sdk 1.42.17 → 1.44.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/dist/index.cjs CHANGED
@@ -755,6 +755,8 @@ var TopicsService = class extends BaseService {
755
755
  * List all topics with pagination
756
756
  * @param limit - Maximum number of topics to return
757
757
  * @param offset - Number of topics to skip
758
+ * @param sortBy - Field to sort topics by
759
+ * @param order - Sort order
758
760
  */
759
761
  async listTopics(options) {
760
762
  const request = new Request({
@@ -794,6 +796,30 @@ var TopicsService = class extends BaseService {
794
796
  isCursor: false
795
797
  });
796
798
  }
799
+ if (options?.sortBy !== void 0) {
800
+ request.addQueryParam("sortBy", {
801
+ key: "sortBy",
802
+ value: options.sortBy,
803
+ explode: false,
804
+ encode: true,
805
+ style: "form",
806
+ isLimit: false,
807
+ isOffset: false,
808
+ isCursor: false
809
+ });
810
+ }
811
+ if (options?.order !== void 0) {
812
+ request.addQueryParam("order", {
813
+ key: "order",
814
+ value: options.order,
815
+ explode: false,
816
+ encode: true,
817
+ style: "form",
818
+ isLimit: false,
819
+ isOffset: false,
820
+ isCursor: false
821
+ });
822
+ }
797
823
  return this.client.call(request);
798
824
  }
799
825
  /**
@@ -1903,6 +1929,8 @@ var MemoriesService = class extends BaseService {
1903
1929
  * @param limit - Maximum number of memories to return
1904
1930
  * @param offset - Number of memories to skip
1905
1931
  * @param page - Page number (alternative to offset)
1932
+ * @param sortBy - Field to sort results by
1933
+ * @param order - Sort order
1906
1934
  */
1907
1935
  async listMemories(options) {
1908
1936
  const request = new Request({
@@ -1966,6 +1994,30 @@ var MemoriesService = class extends BaseService {
1966
1994
  isCursor: false
1967
1995
  });
1968
1996
  }
1997
+ if (options?.sortBy !== void 0) {
1998
+ request.addQueryParam("sortBy", {
1999
+ key: "sortBy",
2000
+ value: options.sortBy,
2001
+ explode: false,
2002
+ encode: true,
2003
+ style: "form",
2004
+ isLimit: false,
2005
+ isOffset: false,
2006
+ isCursor: false
2007
+ });
2008
+ }
2009
+ if (options?.order !== void 0) {
2010
+ request.addQueryParam("order", {
2011
+ key: "order",
2012
+ value: options.order,
2013
+ explode: false,
2014
+ encode: true,
2015
+ style: "form",
2016
+ isLimit: false,
2017
+ isOffset: false,
2018
+ isCursor: false
2019
+ });
2020
+ }
1969
2021
  return this.client.call(request);
1970
2022
  }
1971
2023
  /**
@@ -2047,6 +2099,15 @@ var MemoriesService = class extends BaseService {
2047
2099
  * @param ingestionTimeTo - Ingestion time range end (ISO 8601 datetime)
2048
2100
  * @param includeExpired - Include expired memories in results
2049
2101
  * @param temporalMode - Temporal query mode
2102
+ * @param sortBy - Field to sort results by
2103
+ * @param order - Sort order
2104
+ * @param expandEntities - Enable entity graph traversal branch in hybrid search
2105
+ * @param expandTopics - Enable topic graph traversal branch in hybrid search
2106
+ * @param expandFacts - Enable fact graph traversal branch in hybrid search
2107
+ * @param includeSuperseded - Include superseded and contradicted memories in results
2108
+ * @param entityWeight - Weight for entity graph branch in hybrid search
2109
+ * @param topicWeight - Weight for topic graph branch in hybrid search
2110
+ * @param factWeight - Weight for fact graph branch in hybrid search
2050
2111
  */
2051
2112
  async searchMemoriesGet(options) {
2052
2113
  const request = new Request({
@@ -2338,6 +2399,114 @@ var MemoriesService = class extends BaseService {
2338
2399
  isCursor: false
2339
2400
  });
2340
2401
  }
2402
+ if (options?.sortBy !== void 0) {
2403
+ request.addQueryParam("sortBy", {
2404
+ key: "sortBy",
2405
+ value: options.sortBy,
2406
+ explode: false,
2407
+ encode: true,
2408
+ style: "form",
2409
+ isLimit: false,
2410
+ isOffset: false,
2411
+ isCursor: false
2412
+ });
2413
+ }
2414
+ if (options?.order !== void 0) {
2415
+ request.addQueryParam("order", {
2416
+ key: "order",
2417
+ value: options.order,
2418
+ explode: false,
2419
+ encode: true,
2420
+ style: "form",
2421
+ isLimit: false,
2422
+ isOffset: false,
2423
+ isCursor: false
2424
+ });
2425
+ }
2426
+ if (options?.expandEntities !== void 0) {
2427
+ request.addQueryParam("expandEntities", {
2428
+ key: "expandEntities",
2429
+ value: options.expandEntities,
2430
+ explode: false,
2431
+ encode: true,
2432
+ style: "form",
2433
+ isLimit: false,
2434
+ isOffset: false,
2435
+ isCursor: false
2436
+ });
2437
+ }
2438
+ if (options?.expandTopics !== void 0) {
2439
+ request.addQueryParam("expandTopics", {
2440
+ key: "expandTopics",
2441
+ value: options.expandTopics,
2442
+ explode: false,
2443
+ encode: true,
2444
+ style: "form",
2445
+ isLimit: false,
2446
+ isOffset: false,
2447
+ isCursor: false
2448
+ });
2449
+ }
2450
+ if (options?.expandFacts !== void 0) {
2451
+ request.addQueryParam("expandFacts", {
2452
+ key: "expandFacts",
2453
+ value: options.expandFacts,
2454
+ explode: false,
2455
+ encode: true,
2456
+ style: "form",
2457
+ isLimit: false,
2458
+ isOffset: false,
2459
+ isCursor: false
2460
+ });
2461
+ }
2462
+ if (options?.includeSuperseded !== void 0) {
2463
+ request.addQueryParam("includeSuperseded", {
2464
+ key: "includeSuperseded",
2465
+ value: options.includeSuperseded,
2466
+ explode: false,
2467
+ encode: true,
2468
+ style: "form",
2469
+ isLimit: false,
2470
+ isOffset: false,
2471
+ isCursor: false
2472
+ });
2473
+ }
2474
+ if (options?.entityWeight !== void 0) {
2475
+ request.addQueryParam("entityWeight", {
2476
+ key: "entityWeight",
2477
+ value: options.entityWeight,
2478
+ explode: false,
2479
+ encode: true,
2480
+ style: "form",
2481
+ isLimit: false,
2482
+ isOffset: false,
2483
+ isCursor: false
2484
+ });
2485
+ }
2486
+ if (options?.topicWeight !== void 0) {
2487
+ request.addQueryParam("topicWeight", {
2488
+ key: "topicWeight",
2489
+ value: options.topicWeight,
2490
+ explode: false,
2491
+ encode: true,
2492
+ style: "form",
2493
+ isLimit: false,
2494
+ isOffset: false,
2495
+ isCursor: false
2496
+ });
2497
+ }
2498
+ if (options?.factWeight !== void 0) {
2499
+ request.addQueryParam("factWeight", {
2500
+ key: "factWeight",
2501
+ value: options.factWeight,
2502
+ explode: false,
2503
+ encode: true,
2504
+ style: "form",
2505
+ isLimit: false,
2506
+ isOffset: false,
2507
+ isCursor: false
2508
+ });
2509
+ }
2341
2510
  return this.client.call(request);
2342
2511
  }
2343
2512
  /**
@@ -3107,6 +3276,8 @@ var FactsService = class extends BaseService {
3107
3276
  * List all facts for the authenticated user
3108
3277
  * @param limit - Maximum number of facts to return
3109
3278
  * @param offset - Number of facts to skip
3279
+ * @param sortBy - Field to sort facts by
3280
+ * @param order - Sort order
3110
3281
  */
3111
3282
  async listFacts(options) {
3112
3283
  const request = new Request({
@@ -3146,6 +3317,30 @@ var FactsService = class extends BaseService {
3146
3317
  isCursor: false
3147
3318
  });
3148
3319
  }
3320
+ if (options?.sortBy !== void 0) {
3321
+ request.addQueryParam("sortBy", {
3322
+ key: "sortBy",
3323
+ value: options.sortBy,
3324
+ explode: false,
3325
+ encode: true,
3326
+ style: "form",
3327
+ isLimit: false,
3328
+ isOffset: false,
3329
+ isCursor: false
3330
+ });
3331
+ }
3332
+ if (options?.order !== void 0) {
3333
+ request.addQueryParam("order", {
3334
+ key: "order",
3335
+ value: options.order,
3336
+ explode: false,
3337
+ encode: true,
3338
+ style: "form",
3339
+ isLimit: false,
3340
+ isOffset: false,
3341
+ isCursor: false
3342
+ });
3343
+ }
3149
3344
  return this.client.call(request);
3150
3345
  }
3151
3346
  /**
@@ -3454,6 +3649,8 @@ var ConversationsService = class extends BaseService {
3454
3649
  * @param limit - Maximum number of conversations to return
3455
3650
  * @param offset - Number of conversations to skip
3456
3651
  * @param since - Return only conversations created after this timestamp (ISO 8601 format)
3652
+ * @param sortBy - Field to sort conversations by
3653
+ * @param order - Sort order
3457
3654
  */
3458
3655
  async listConversations(options) {
3459
3656
  const request = new Request({
@@ -3505,6 +3702,30 @@ var ConversationsService = class extends BaseService {
3505
3702
  isCursor: false
3506
3703
  });
3507
3704
  }
3705
+ if (options?.sortBy !== void 0) {
3706
+ request.addQueryParam("sortBy", {
3707
+ key: "sortBy",
3708
+ value: options.sortBy,
3709
+ explode: false,
3710
+ encode: true,
3711
+ style: "form",
3712
+ isLimit: false,
3713
+ isOffset: false,
3714
+ isCursor: false
3715
+ });
3716
+ }
3717
+ if (options?.order !== void 0) {
3718
+ request.addQueryParam("order", {
3719
+ key: "order",
3720
+ value: options.order,
3721
+ explode: false,
3722
+ encode: true,
3723
+ style: "form",
3724
+ isLimit: false,
3725
+ isOffset: false,
3726
+ isCursor: false
3727
+ });
3728
+ }
3508
3729
  return this.client.call(request);
3509
3730
  }
3510
3731
  /**
@@ -4894,7 +5115,25 @@ var searchRequest = import_zod.z.object({
4894
5115
  /** Include facts extracted from matched memories (defaults to false for performance) */
4895
5116
  includeFacts: import_zod.z.boolean().optional(),
4896
5117
  /** Filter entities by type (e.g., PERSON, TECHNOLOGY, PROJECT) */
4897
- entityTypes: import_zod.z.array(import_zod.z.string().max(50)).max(20).optional()
5118
+ entityTypes: import_zod.z.array(import_zod.z.string().max(50)).max(20).optional(),
5119
+ /** Enable entity graph traversal branch in hybrid search (default false) */
5120
+ expandEntities: import_zod.z.boolean().optional(),
5121
+ /** Enable topic graph traversal branch in hybrid search (default false) */
5122
+ expandTopics: import_zod.z.boolean().optional(),
5123
+ /** Enable fact graph traversal branch in hybrid search (default false) */
5124
+ expandFacts: import_zod.z.boolean().optional(),
5125
+ /** Include superseded and contradicted memories in results (default false) */
5126
+ includeSuperseded: import_zod.z.boolean().optional(),
5127
+ /** Weight for entity graph branch in hybrid search (0-1, default 0.7) */
5128
+ entityWeight: import_zod.z.number().min(0).max(1).optional(),
5129
+ /** Weight for topic graph branch in hybrid search (0-1, default 0.5) */
5130
+ topicWeight: import_zod.z.number().min(0).max(1).optional(),
5131
+ /** Weight for fact graph branch in hybrid search (0-1, default 0.6) */
5132
+ factWeight: import_zod.z.number().min(0).max(1).optional(),
5133
+ /** Field to sort results by (defaults to 'relevance' for search, 'createdAt' for list) */
5134
+ sortBy: import_zod.z.enum(["relevance", "createdAt", "updatedAt", "eventTime"]).optional(),
5135
+ /** Sort order: 'asc' or 'desc' (defaults to 'desc' for timestamps, 'desc' for relevance) */
5136
+ order: import_zod.z.enum(["asc", "desc"]).optional()
4898
5137
  });
4899
5138
  var entity = import_zod.z.object({
4900
5139
  /** Entity name */
@@ -4997,6 +5236,10 @@ var searchResult = import_zod.z.lazy(() => import_zod.z.object({
4997
5236
  fulltextScore: import_zod.z.number().optional(),
4998
5237
  /** Rank in fulltext search results */
4999
5238
  fulltextRank: import_zod.z.number().nullable().optional(),
5239
+ /** Search branches that contributed to this result (e.g. ['semantic', 'entity']) */
5240
+ matchedVia: import_zod.z.array(import_zod.z.string()).optional(),
5241
+ /** Per-branch RRF scores for this result */
5242
+ branchScores: import_zod.z.object({}).catchall(import_zod.z.number()).optional(),
5000
5243
  /** Detailed explanation of the match (only when explain=true) */
5001
5244
  explanation: import_zod.z.object({
5002
5245
  /** Human-readable explanation of why this result matched */