linkque-cli-v2 1.6.20 → 1.6.22

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.
Files changed (17) hide show
  1. package/dev/worker.js +61 -17
  2. package/linkquejs.js +294 -161
  3. package/package.json +1 -1
  4. package/vendor/linkque-agent-appwrite-integrate/dist/esm/{chunk-WHXLLQZR.js → chunk-27TIUPEZ.js} +1 -1
  5. package/vendor/linkque-agent-appwrite-integrate/dist/esm/{chunk-JMBJJF7P.js → chunk-2QJITP7G.js} +62 -18
  6. package/vendor/linkque-agent-appwrite-integrate/dist/esm/{chunk-5MR5ICJ4.js → chunk-5YW4CWBG.js} +2988 -2022
  7. package/vendor/linkque-agent-appwrite-integrate/dist/esm/{chunk-22EQ6RXO.js → chunk-Q6N5427R.js} +3019 -168
  8. package/vendor/linkque-agent-appwrite-integrate/dist/esm/{dist-TGBYXSBU.js → dist-6U5W3RLM.js} +74 -95
  9. package/vendor/linkque-agent-appwrite-integrate/dist/esm/{google-generative-ai-KD7MXONK.js → google-generative-ai-RT2OOQDJ.js} +1 -1
  10. package/vendor/linkque-agent-appwrite-integrate/dist/esm/{google-vertex-TREYA472.js → google-vertex-HVFMVQVY.js} +1 -1
  11. package/vendor/linkque-agent-appwrite-integrate/dist/esm/{mistral-conversations-5EI6JQBZ.js → mistral-conversations-KIOTOF73.js} +1 -1
  12. package/vendor/linkque-agent-appwrite-integrate/dist/esm/{otel-RUUFBBFE.js → otel-LQR5KPZ3.js} +578 -266
  13. package/vendor/linkque-agent-appwrite-integrate/dist/esm/runtime/handler/chat.js +1357 -658
  14. package/vendor/linkque-agent-appwrite-integrate/dist/esm/runtime/handler/clientCapability.js +2 -3
  15. package/vendor/linkque-agent-appwrite-integrate/dist/esm/runtime/protocol.js +2 -3
  16. package/worker.js +6028 -4038
  17. package/vendor/linkque-agent-appwrite-integrate/dist/esm/chunk-EAODRPW4.js +0 -518
@@ -23,7 +23,7 @@ import {
23
23
  RuntimeConfigProvider,
24
24
  getRunEmbeddedQuery,
25
25
  isDebugLoggingEnabled
26
- } from "./chunk-5MR5ICJ4.js";
26
+ } from "./chunk-5YW4CWBG.js";
27
27
  import {
28
28
  __commonJS,
29
29
  __require,
@@ -7378,6 +7378,9 @@ var AUTHORIZATION_CHECKPOINT_COLUMNS = [
7378
7378
  }
7379
7379
  ];
7380
7380
 
7381
+ // ../linkque-agent-appwrite-integrate/dist/esm/runtime/sessionMemorySchemaDefinition.js
7382
+ var SESSION_MEMORY_TABLE = "linkque_session_memories";
7383
+
7381
7384
  // ../linkque-agent-appwrite-integrate/dist/esm/runtime/externalActionSchema.js
7382
7385
  var definitions = [
7383
7386
  ["state", 16],
@@ -7420,6 +7423,8 @@ var APPBASE_RUNTIME_CONFIG_DEFAULTS = Object.freeze({
7420
7423
  LINKQUE_EMBEDDED_QUERY_ENABLED: "false",
7421
7424
  RUN_DATABASE_ID: "linkque",
7422
7425
  RUN_TABLE_ID: "linkque_conversation_runs",
7426
+ SESSION_MEMORY_DATABASE_ID: "linkque",
7427
+ SESSION_MEMORY_TABLE_ID: "linkque_session_memories",
7423
7428
  SESSION_DATABASE_ID: "linkque",
7424
7429
  SESSION_TABLE_ID: "linkque_sessions",
7425
7430
  SESSION_LEASE_DATABASE_ID: "linkque",
@@ -11452,35 +11457,50 @@ var Databases = class {
11452
11457
  }
11453
11458
  };
11454
11459
 
11455
- // ../../node_modules/@alipay/appbase-node-sdk/dist/services/tables-db.mjs
11456
- var TablesDB = class {
11460
+ // ../../node_modules/@alipay/appbase-node-sdk/dist/services/memory.mjs
11461
+ var Memory = class {
11457
11462
  constructor(client) {
11458
11463
  this.client = client;
11459
11464
  }
11460
- list(paramsOrFirst, ...rest) {
11465
+ listAudits(paramsOrFirst, ...rest) {
11461
11466
  let params;
11462
11467
  if (!paramsOrFirst || paramsOrFirst && typeof paramsOrFirst === "object" && !Array.isArray(paramsOrFirst)) {
11463
11468
  params = paramsOrFirst || {};
11464
11469
  } else {
11465
11470
  params = {
11466
- queries: paramsOrFirst,
11467
- search: rest[0],
11468
- total: rest[1]
11471
+ jobId: paramsOrFirst,
11472
+ query: rest[0],
11473
+ operation: rest[1],
11474
+ outcome: rest[2],
11475
+ limit: rest[3],
11476
+ cursor: rest[4]
11469
11477
  };
11470
11478
  }
11471
- const queries = params.queries;
11472
- const search = params.search;
11473
- const total = params.total;
11474
- const apiPath = "/tablesdb";
11479
+ const jobId = params.jobId;
11480
+ const query = params.query;
11481
+ const operation = params.operation;
11482
+ const outcome = params.outcome;
11483
+ const limit = params.limit;
11484
+ const cursor = params.cursor;
11485
+ const apiPath = "/memory/audits";
11475
11486
  const payload = {};
11476
- if (typeof queries !== "undefined") {
11477
- payload["queries"] = queries;
11487
+ if (typeof jobId !== "undefined") {
11488
+ payload["jobId"] = jobId;
11478
11489
  }
11479
- if (typeof search !== "undefined") {
11480
- payload["search"] = search;
11490
+ if (typeof query !== "undefined") {
11491
+ payload["query"] = query;
11481
11492
  }
11482
- if (typeof total !== "undefined") {
11483
- payload["total"] = total;
11493
+ if (typeof operation !== "undefined") {
11494
+ payload["operation"] = operation;
11495
+ }
11496
+ if (typeof outcome !== "undefined") {
11497
+ payload["outcome"] = outcome;
11498
+ }
11499
+ if (typeof limit !== "undefined") {
11500
+ payload["limit"] = limit;
11501
+ }
11502
+ if (typeof cursor !== "undefined") {
11503
+ payload["cursor"] = cursor;
11484
11504
  }
11485
11505
  const uri = new URL(this.client.config.endpoint + apiPath);
11486
11506
  const apiHeaders = {};
@@ -11491,63 +11511,70 @@ var TablesDB = class {
11491
11511
  payload
11492
11512
  );
11493
11513
  }
11494
- create(paramsOrFirst, ...rest) {
11514
+ getJob(paramsOrFirst) {
11495
11515
  let params;
11496
11516
  if (paramsOrFirst && typeof paramsOrFirst === "object" && !Array.isArray(paramsOrFirst)) {
11497
11517
  params = paramsOrFirst || {};
11498
11518
  } else {
11499
11519
  params = {
11500
- databaseId: paramsOrFirst,
11501
- name: rest[0],
11502
- enabled: rest[1]
11520
+ jobId: paramsOrFirst
11503
11521
  };
11504
11522
  }
11505
- const databaseId = params.databaseId;
11506
- const name = params.name;
11507
- const enabled = params.enabled;
11508
- if (typeof databaseId === "undefined") {
11509
- throw new AppBaseException('Missing required parameter: "databaseId"');
11510
- }
11511
- if (typeof name === "undefined") {
11512
- throw new AppBaseException('Missing required parameter: "name"');
11523
+ const jobId = params.jobId;
11524
+ if (typeof jobId === "undefined") {
11525
+ throw new AppBaseException('Missing required parameter: "jobId"');
11513
11526
  }
11514
- const apiPath = "/tablesdb";
11527
+ const apiPath = "/memory/jobs/{jobId}".replace("{jobId}", jobId);
11515
11528
  const payload = {};
11516
- if (typeof databaseId !== "undefined") {
11517
- payload["databaseId"] = databaseId;
11518
- }
11519
- if (typeof name !== "undefined") {
11520
- payload["name"] = name;
11521
- }
11522
- if (typeof enabled !== "undefined") {
11523
- payload["enabled"] = enabled;
11524
- }
11525
11529
  const uri = new URL(this.client.config.endpoint + apiPath);
11526
- const apiHeaders = {
11527
- "content-type": "application/json"
11528
- };
11530
+ const apiHeaders = {};
11529
11531
  return this.client.call(
11530
- "post",
11532
+ "get",
11531
11533
  uri,
11532
11534
  apiHeaders,
11533
11535
  payload
11534
11536
  );
11535
11537
  }
11536
- listTransactions(paramsOrFirst) {
11538
+ list(paramsOrFirst, ...rest) {
11537
11539
  let params;
11538
11540
  if (!paramsOrFirst || paramsOrFirst && typeof paramsOrFirst === "object" && !Array.isArray(paramsOrFirst)) {
11539
11541
  params = paramsOrFirst || {};
11540
11542
  } else {
11541
11543
  params = {
11542
- queries: paramsOrFirst
11544
+ cursor: paramsOrFirst,
11545
+ limit: rest[0],
11546
+ filter: rest[1],
11547
+ queries: rest[2],
11548
+ userId: rest[3],
11549
+ accessMode: rest[4]
11543
11550
  };
11544
11551
  }
11552
+ const cursor = params.cursor;
11553
+ const limit = params.limit;
11554
+ const filter = params.filter;
11545
11555
  const queries = params.queries;
11546
- const apiPath = "/tablesdb/transactions";
11556
+ const userId = params.userId;
11557
+ const accessMode = params.accessMode;
11558
+ const apiPath = "/memory/memories";
11547
11559
  const payload = {};
11560
+ if (typeof cursor !== "undefined") {
11561
+ payload["cursor"] = cursor;
11562
+ }
11563
+ if (typeof limit !== "undefined") {
11564
+ payload["limit"] = limit;
11565
+ }
11566
+ if (typeof filter !== "undefined") {
11567
+ payload["filter"] = filter;
11568
+ }
11548
11569
  if (typeof queries !== "undefined") {
11549
11570
  payload["queries"] = queries;
11550
11571
  }
11572
+ if (typeof userId !== "undefined") {
11573
+ payload["userId"] = userId;
11574
+ }
11575
+ if (typeof accessMode !== "undefined") {
11576
+ payload["accessMode"] = accessMode;
11577
+ }
11551
11578
  const uri = new URL(this.client.config.endpoint + apiPath);
11552
11579
  const apiHeaders = {};
11553
11580
  return this.client.call(
@@ -11557,20 +11584,97 @@ var TablesDB = class {
11557
11584
  payload
11558
11585
  );
11559
11586
  }
11560
- createTransaction(paramsOrFirst) {
11587
+ create(paramsOrFirst, ...rest) {
11561
11588
  let params;
11562
- if (!paramsOrFirst || paramsOrFirst && typeof paramsOrFirst === "object" && !Array.isArray(paramsOrFirst)) {
11589
+ if (paramsOrFirst && typeof paramsOrFirst === "object" && !Array.isArray(paramsOrFirst)) {
11563
11590
  params = paramsOrFirst || {};
11564
11591
  } else {
11565
11592
  params = {
11566
- ttl: paramsOrFirst
11593
+ userId: paramsOrFirst,
11594
+ scope: rest[0],
11595
+ memoryType: rest[1],
11596
+ recordKind: rest[2],
11597
+ content: rest[3],
11598
+ messages: rest[4],
11599
+ agentId: rest[5],
11600
+ runId: rest[6],
11601
+ sensitivity: rest[7],
11602
+ handlingPolicy: rest[8],
11603
+ metadata: rest[9],
11604
+ infer: rest[10],
11605
+ reRemember: rest[11],
11606
+ async: rest[12]
11567
11607
  };
11568
11608
  }
11569
- const ttl = params.ttl;
11570
- const apiPath = "/tablesdb/transactions";
11609
+ const userId = params.userId;
11610
+ const scope = params.scope;
11611
+ const memoryType = params.memoryType;
11612
+ const recordKind = params.recordKind;
11613
+ const content = params.content;
11614
+ const messages = params.messages;
11615
+ const agentId = params.agentId;
11616
+ const runId = params.runId;
11617
+ const sensitivity = params.sensitivity;
11618
+ const handlingPolicy = params.handlingPolicy;
11619
+ const metadata = params.metadata;
11620
+ const infer = params.infer;
11621
+ const reRemember = params.reRemember;
11622
+ const async = params.async;
11623
+ if (typeof userId === "undefined") {
11624
+ throw new AppBaseException('Missing required parameter: "userId"');
11625
+ }
11626
+ if (typeof scope === "undefined") {
11627
+ throw new AppBaseException('Missing required parameter: "scope"');
11628
+ }
11629
+ if (typeof memoryType === "undefined") {
11630
+ throw new AppBaseException('Missing required parameter: "memoryType"');
11631
+ }
11632
+ if (typeof recordKind === "undefined") {
11633
+ throw new AppBaseException('Missing required parameter: "recordKind"');
11634
+ }
11635
+ const apiPath = "/memory/memories";
11571
11636
  const payload = {};
11572
- if (typeof ttl !== "undefined") {
11573
- payload["ttl"] = ttl;
11637
+ if (typeof content !== "undefined") {
11638
+ payload["content"] = content;
11639
+ }
11640
+ if (typeof messages !== "undefined") {
11641
+ payload["messages"] = messages;
11642
+ }
11643
+ if (typeof userId !== "undefined") {
11644
+ payload["userId"] = userId;
11645
+ }
11646
+ if (typeof agentId !== "undefined") {
11647
+ payload["agentId"] = agentId;
11648
+ }
11649
+ if (typeof runId !== "undefined") {
11650
+ payload["runId"] = runId;
11651
+ }
11652
+ if (typeof scope !== "undefined") {
11653
+ payload["scope"] = scope;
11654
+ }
11655
+ if (typeof sensitivity !== "undefined") {
11656
+ payload["sensitivity"] = sensitivity;
11657
+ }
11658
+ if (typeof handlingPolicy !== "undefined") {
11659
+ payload["handlingPolicy"] = handlingPolicy;
11660
+ }
11661
+ if (typeof memoryType !== "undefined") {
11662
+ payload["memoryType"] = memoryType;
11663
+ }
11664
+ if (typeof recordKind !== "undefined") {
11665
+ payload["recordKind"] = recordKind;
11666
+ }
11667
+ if (typeof metadata !== "undefined") {
11668
+ payload["metadata"] = metadata;
11669
+ }
11670
+ if (typeof infer !== "undefined") {
11671
+ payload["infer"] = infer;
11672
+ }
11673
+ if (typeof reRemember !== "undefined") {
11674
+ payload["reRemember"] = reRemember;
11675
+ }
11676
+ if (typeof async !== "undefined") {
11677
+ payload["async"] = async;
11574
11678
  }
11575
11679
  const uri = new URL(this.client.config.endpoint + apiPath);
11576
11680
  const apiHeaders = {
@@ -11583,111 +11687,184 @@ var TablesDB = class {
11583
11687
  payload
11584
11688
  );
11585
11689
  }
11586
- getTransaction(paramsOrFirst) {
11690
+ deleteMany(paramsOrFirst, ...rest) {
11587
11691
  let params;
11588
- if (paramsOrFirst && typeof paramsOrFirst === "object" && !Array.isArray(paramsOrFirst)) {
11692
+ if (!paramsOrFirst || paramsOrFirst && typeof paramsOrFirst === "object" && !Array.isArray(paramsOrFirst)) {
11589
11693
  params = paramsOrFirst || {};
11590
11694
  } else {
11591
11695
  params = {
11592
- transactionId: paramsOrFirst
11696
+ userId: paramsOrFirst,
11697
+ limit: rest[0],
11698
+ reason: rest[1],
11699
+ source: rest[2]
11593
11700
  };
11594
11701
  }
11595
- const transactionId = params.transactionId;
11596
- if (typeof transactionId === "undefined") {
11597
- throw new AppBaseException('Missing required parameter: "transactionId"');
11598
- }
11599
- const apiPath = "/tablesdb/transactions/{transactionId}".replace("{transactionId}", transactionId);
11702
+ const userId = params.userId;
11703
+ const limit = params.limit;
11704
+ const reason = params.reason;
11705
+ const source = params.source;
11706
+ const apiPath = "/memory/memories";
11600
11707
  const payload = {};
11708
+ if (typeof userId !== "undefined") {
11709
+ payload["userId"] = userId;
11710
+ }
11711
+ if (typeof limit !== "undefined") {
11712
+ payload["limit"] = limit;
11713
+ }
11714
+ if (typeof reason !== "undefined") {
11715
+ payload["reason"] = reason;
11716
+ }
11717
+ if (typeof source !== "undefined") {
11718
+ payload["source"] = source;
11719
+ }
11601
11720
  const uri = new URL(this.client.config.endpoint + apiPath);
11602
- const apiHeaders = {};
11721
+ const apiHeaders = {
11722
+ "content-type": "application/json"
11723
+ };
11603
11724
  return this.client.call(
11604
- "get",
11725
+ "delete",
11605
11726
  uri,
11606
11727
  apiHeaders,
11607
11728
  payload
11608
11729
  );
11609
11730
  }
11610
- updateTransaction(paramsOrFirst, ...rest) {
11731
+ createBatch(paramsOrFirst) {
11611
11732
  let params;
11612
- if (paramsOrFirst && typeof paramsOrFirst === "object" && !Array.isArray(paramsOrFirst)) {
11733
+ if (paramsOrFirst && typeof paramsOrFirst === "object" && !Array.isArray(paramsOrFirst) && "items" in paramsOrFirst) {
11613
11734
  params = paramsOrFirst || {};
11614
11735
  } else {
11615
11736
  params = {
11616
- transactionId: paramsOrFirst,
11617
- commit: rest[0],
11618
- rollback: rest[1]
11737
+ items: paramsOrFirst
11619
11738
  };
11620
11739
  }
11621
- const transactionId = params.transactionId;
11622
- const commit = params.commit;
11623
- const rollback = params.rollback;
11624
- if (typeof transactionId === "undefined") {
11625
- throw new AppBaseException('Missing required parameter: "transactionId"');
11740
+ const items = params.items;
11741
+ if (typeof items === "undefined") {
11742
+ throw new AppBaseException('Missing required parameter: "items"');
11626
11743
  }
11627
- const apiPath = "/tablesdb/transactions/{transactionId}".replace("{transactionId}", transactionId);
11744
+ const apiPath = "/memory/memories/batch";
11628
11745
  const payload = {};
11629
- if (typeof commit !== "undefined") {
11630
- payload["commit"] = commit;
11631
- }
11632
- if (typeof rollback !== "undefined") {
11633
- payload["rollback"] = rollback;
11746
+ if (typeof items !== "undefined") {
11747
+ payload["items"] = items;
11634
11748
  }
11635
11749
  const uri = new URL(this.client.config.endpoint + apiPath);
11636
11750
  const apiHeaders = {
11637
11751
  "content-type": "application/json"
11638
11752
  };
11639
11753
  return this.client.call(
11640
- "patch",
11754
+ "post",
11641
11755
  uri,
11642
11756
  apiHeaders,
11643
11757
  payload
11644
11758
  );
11645
11759
  }
11646
- deleteTransaction(paramsOrFirst) {
11760
+ listContexts(paramsOrFirst, ...rest) {
11647
11761
  let params;
11648
- if (paramsOrFirst && typeof paramsOrFirst === "object" && !Array.isArray(paramsOrFirst)) {
11762
+ if (!paramsOrFirst || paramsOrFirst && typeof paramsOrFirst === "object" && !Array.isArray(paramsOrFirst) && ("scope" in paramsOrFirst || "userId" in paramsOrFirst || "agentId" in paramsOrFirst || "sessionId" in paramsOrFirst || "runId" in paramsOrFirst || "memorySubStoreId" in paramsOrFirst || "status" in paramsOrFirst || "kind" in paramsOrFirst || "cursor" in paramsOrFirst || "limit" in paramsOrFirst)) {
11649
11763
  params = paramsOrFirst || {};
11650
11764
  } else {
11651
11765
  params = {
11652
- transactionId: paramsOrFirst
11766
+ scope: paramsOrFirst,
11767
+ userId: rest[0],
11768
+ agentId: rest[1],
11769
+ sessionId: rest[2],
11770
+ runId: rest[3],
11771
+ memorySubStoreId: rest[4],
11772
+ status: rest[5],
11773
+ kind: rest[6],
11774
+ cursor: rest[7],
11775
+ limit: rest[8]
11653
11776
  };
11654
11777
  }
11655
- const transactionId = params.transactionId;
11656
- if (typeof transactionId === "undefined") {
11657
- throw new AppBaseException('Missing required parameter: "transactionId"');
11658
- }
11659
- const apiPath = "/tablesdb/transactions/{transactionId}".replace("{transactionId}", transactionId);
11778
+ const scope = params.scope;
11779
+ const userId = params.userId;
11780
+ const agentId = params.agentId;
11781
+ const sessionId = params.sessionId;
11782
+ const runId = params.runId;
11783
+ const memorySubStoreId = params.memorySubStoreId;
11784
+ const status = params.status;
11785
+ const kind = params.kind;
11786
+ const cursor = params.cursor;
11787
+ const limit = params.limit;
11788
+ const apiPath = "/memory/memories/contexts";
11660
11789
  const payload = {};
11790
+ if (typeof scope !== "undefined") {
11791
+ payload["scope"] = scope;
11792
+ }
11793
+ if (typeof userId !== "undefined") {
11794
+ payload["userId"] = userId;
11795
+ }
11796
+ if (typeof agentId !== "undefined") {
11797
+ payload["agentId"] = agentId;
11798
+ }
11799
+ if (typeof sessionId !== "undefined") {
11800
+ payload["sessionId"] = sessionId;
11801
+ }
11802
+ if (typeof runId !== "undefined") {
11803
+ payload["runId"] = runId;
11804
+ }
11805
+ if (typeof memorySubStoreId !== "undefined") {
11806
+ payload["memorySubStoreId"] = memorySubStoreId;
11807
+ }
11808
+ if (typeof status !== "undefined") {
11809
+ payload["status"] = status;
11810
+ }
11811
+ if (typeof kind !== "undefined") {
11812
+ payload["kind"] = kind;
11813
+ }
11814
+ if (typeof cursor !== "undefined") {
11815
+ payload["cursor"] = cursor;
11816
+ }
11817
+ if (typeof limit !== "undefined") {
11818
+ payload["limit"] = limit;
11819
+ }
11661
11820
  const uri = new URL(this.client.config.endpoint + apiPath);
11662
- const apiHeaders = {
11663
- "content-type": "application/json"
11664
- };
11821
+ const apiHeaders = {};
11665
11822
  return this.client.call(
11666
- "delete",
11823
+ "get",
11667
11824
  uri,
11668
11825
  apiHeaders,
11669
11826
  payload
11670
11827
  );
11671
11828
  }
11672
- createOperations(paramsOrFirst, ...rest) {
11829
+ createContextRun(paramsOrFirst, ...rest) {
11673
11830
  let params;
11674
- if (paramsOrFirst && typeof paramsOrFirst === "object" && !Array.isArray(paramsOrFirst)) {
11831
+ if (!paramsOrFirst || paramsOrFirst && typeof paramsOrFirst === "object" && !Array.isArray(paramsOrFirst) && ("scope" in paramsOrFirst || "userId" in paramsOrFirst || "agentId" in paramsOrFirst || "sessionId" in paramsOrFirst || "runId" in paramsOrFirst || "memorySubStoreId" in paramsOrFirst)) {
11675
11832
  params = paramsOrFirst || {};
11676
11833
  } else {
11677
11834
  params = {
11678
- transactionId: paramsOrFirst,
11679
- operations: rest[0]
11835
+ scope: paramsOrFirst,
11836
+ userId: rest[0],
11837
+ agentId: rest[1],
11838
+ sessionId: rest[2],
11839
+ runId: rest[3],
11840
+ memorySubStoreId: rest[4]
11680
11841
  };
11681
11842
  }
11682
- const transactionId = params.transactionId;
11683
- const operations = params.operations;
11684
- if (typeof transactionId === "undefined") {
11685
- throw new AppBaseException('Missing required parameter: "transactionId"');
11686
- }
11687
- const apiPath = "/tablesdb/transactions/{transactionId}/operations".replace("{transactionId}", transactionId);
11843
+ const scope = params.scope;
11844
+ const userId = params.userId;
11845
+ const agentId = params.agentId;
11846
+ const sessionId = params.sessionId;
11847
+ const runId = params.runId;
11848
+ const memorySubStoreId = params.memorySubStoreId;
11849
+ const apiPath = "/memory/memories/contexts/runs";
11688
11850
  const payload = {};
11689
- if (typeof operations !== "undefined") {
11690
- payload["operations"] = operations;
11851
+ if (typeof scope !== "undefined") {
11852
+ payload["scope"] = scope;
11853
+ }
11854
+ if (typeof userId !== "undefined") {
11855
+ payload["userId"] = userId;
11856
+ }
11857
+ if (typeof agentId !== "undefined") {
11858
+ payload["agentId"] = agentId;
11859
+ }
11860
+ if (typeof sessionId !== "undefined") {
11861
+ payload["sessionId"] = sessionId;
11862
+ }
11863
+ if (typeof runId !== "undefined") {
11864
+ payload["runId"] = runId;
11865
+ }
11866
+ if (typeof memorySubStoreId !== "undefined") {
11867
+ payload["memorySubStoreId"] = memorySubStoreId;
11691
11868
  }
11692
11869
  const uri = new URL(this.client.config.endpoint + apiPath);
11693
11870
  const apiHeaders = {
@@ -11700,21 +11877,46 @@ var TablesDB = class {
11700
11877
  payload
11701
11878
  );
11702
11879
  }
11703
- get(paramsOrFirst) {
11880
+ getContextStatus(paramsOrFirst, ...rest) {
11704
11881
  let params;
11705
- if (paramsOrFirst && typeof paramsOrFirst === "object" && !Array.isArray(paramsOrFirst)) {
11882
+ if (!paramsOrFirst || paramsOrFirst && typeof paramsOrFirst === "object" && !Array.isArray(paramsOrFirst) && ("scope" in paramsOrFirst || "userId" in paramsOrFirst || "agentId" in paramsOrFirst || "sessionId" in paramsOrFirst || "runId" in paramsOrFirst || "memorySubStoreId" in paramsOrFirst)) {
11706
11883
  params = paramsOrFirst || {};
11707
11884
  } else {
11708
11885
  params = {
11709
- databaseId: paramsOrFirst
11886
+ scope: paramsOrFirst,
11887
+ userId: rest[0],
11888
+ agentId: rest[1],
11889
+ sessionId: rest[2],
11890
+ runId: rest[3],
11891
+ memorySubStoreId: rest[4]
11710
11892
  };
11711
11893
  }
11712
- const databaseId = params.databaseId;
11713
- if (typeof databaseId === "undefined") {
11714
- throw new AppBaseException('Missing required parameter: "databaseId"');
11715
- }
11716
- const apiPath = "/tablesdb/{databaseId}".replace("{databaseId}", databaseId);
11894
+ const scope = params.scope;
11895
+ const userId = params.userId;
11896
+ const agentId = params.agentId;
11897
+ const sessionId = params.sessionId;
11898
+ const runId = params.runId;
11899
+ const memorySubStoreId = params.memorySubStoreId;
11900
+ const apiPath = "/memory/memories/contexts/status";
11717
11901
  const payload = {};
11902
+ if (typeof scope !== "undefined") {
11903
+ payload["scope"] = scope;
11904
+ }
11905
+ if (typeof userId !== "undefined") {
11906
+ payload["userId"] = userId;
11907
+ }
11908
+ if (typeof agentId !== "undefined") {
11909
+ payload["agentId"] = agentId;
11910
+ }
11911
+ if (typeof sessionId !== "undefined") {
11912
+ payload["sessionId"] = sessionId;
11913
+ }
11914
+ if (typeof runId !== "undefined") {
11915
+ payload["runId"] = runId;
11916
+ }
11917
+ if (typeof memorySubStoreId !== "undefined") {
11918
+ payload["memorySubStoreId"] = memorySubStoreId;
11919
+ }
11718
11920
  const uri = new URL(this.client.config.endpoint + apiPath);
11719
11921
  const apiHeaders = {};
11720
11922
  return this.client.call(
@@ -11724,88 +11926,185 @@ var TablesDB = class {
11724
11926
  payload
11725
11927
  );
11726
11928
  }
11727
- update(paramsOrFirst, ...rest) {
11929
+ getContext(paramsOrFirst, ...rest) {
11728
11930
  let params;
11729
11931
  if (paramsOrFirst && typeof paramsOrFirst === "object" && !Array.isArray(paramsOrFirst)) {
11730
11932
  params = paramsOrFirst || {};
11731
11933
  } else {
11732
11934
  params = {
11733
- databaseId: paramsOrFirst,
11734
- name: rest[0],
11735
- enabled: rest[1]
11935
+ contextId: paramsOrFirst,
11936
+ scope: rest[0],
11937
+ userId: rest[1],
11938
+ agentId: rest[2],
11939
+ sessionId: rest[3],
11940
+ runId: rest[4],
11941
+ memorySubStoreId: rest[5]
11736
11942
  };
11737
11943
  }
11738
- const databaseId = params.databaseId;
11739
- const name = params.name;
11740
- const enabled = params.enabled;
11741
- if (typeof databaseId === "undefined") {
11742
- throw new AppBaseException('Missing required parameter: "databaseId"');
11743
- }
11744
- const apiPath = "/tablesdb/{databaseId}".replace("{databaseId}", databaseId);
11944
+ const contextId = params.contextId;
11945
+ const scope = params.scope;
11946
+ const userId = params.userId;
11947
+ const agentId = params.agentId;
11948
+ const sessionId = params.sessionId;
11949
+ const runId = params.runId;
11950
+ const memorySubStoreId = params.memorySubStoreId;
11951
+ if (typeof contextId === "undefined") {
11952
+ throw new AppBaseException('Missing required parameter: "contextId"');
11953
+ }
11954
+ const apiPath = "/memory/memories/contexts/{contextId}".replace("{contextId}", contextId);
11745
11955
  const payload = {};
11746
- if (typeof name !== "undefined") {
11747
- payload["name"] = name;
11956
+ if (typeof scope !== "undefined") {
11957
+ payload["scope"] = scope;
11748
11958
  }
11749
- if (typeof enabled !== "undefined") {
11750
- payload["enabled"] = enabled;
11959
+ if (typeof userId !== "undefined") {
11960
+ payload["userId"] = userId;
11961
+ }
11962
+ if (typeof agentId !== "undefined") {
11963
+ payload["agentId"] = agentId;
11964
+ }
11965
+ if (typeof sessionId !== "undefined") {
11966
+ payload["sessionId"] = sessionId;
11967
+ }
11968
+ if (typeof runId !== "undefined") {
11969
+ payload["runId"] = runId;
11970
+ }
11971
+ if (typeof memorySubStoreId !== "undefined") {
11972
+ payload["memorySubStoreId"] = memorySubStoreId;
11751
11973
  }
11752
11974
  const uri = new URL(this.client.config.endpoint + apiPath);
11753
- const apiHeaders = {
11754
- "content-type": "application/json"
11755
- };
11975
+ const apiHeaders = {};
11756
11976
  return this.client.call(
11757
- "put",
11977
+ "get",
11758
11978
  uri,
11759
11979
  apiHeaders,
11760
11980
  payload
11761
11981
  );
11762
11982
  }
11763
- delete(paramsOrFirst) {
11983
+ confirmContext(paramsOrFirst, ...rest) {
11764
11984
  let params;
11765
11985
  if (paramsOrFirst && typeof paramsOrFirst === "object" && !Array.isArray(paramsOrFirst)) {
11766
11986
  params = paramsOrFirst || {};
11767
11987
  } else {
11768
11988
  params = {
11769
- databaseId: paramsOrFirst
11989
+ contextId: paramsOrFirst,
11990
+ expectedVersion: rest[0],
11991
+ reason: rest[1],
11992
+ scope: rest[2],
11993
+ userId: rest[3],
11994
+ agentId: rest[4],
11995
+ sessionId: rest[5],
11996
+ runId: rest[6],
11997
+ memorySubStoreId: rest[7]
11770
11998
  };
11771
11999
  }
11772
- const databaseId = params.databaseId;
11773
- if (typeof databaseId === "undefined") {
11774
- throw new AppBaseException('Missing required parameter: "databaseId"');
11775
- }
11776
- const apiPath = "/tablesdb/{databaseId}".replace("{databaseId}", databaseId);
12000
+ const contextId = params.contextId;
12001
+ const expectedVersion = params.expectedVersion;
12002
+ const reason = params.reason;
12003
+ const scope = params.scope;
12004
+ const userId = params.userId;
12005
+ const agentId = params.agentId;
12006
+ const sessionId = params.sessionId;
12007
+ const runId = params.runId;
12008
+ const memorySubStoreId = params.memorySubStoreId;
12009
+ if (typeof contextId === "undefined") {
12010
+ throw new AppBaseException('Missing required parameter: "contextId"');
12011
+ }
12012
+ if (typeof expectedVersion === "undefined") {
12013
+ throw new AppBaseException('Missing required parameter: "expectedVersion"');
12014
+ }
12015
+ if (typeof reason === "undefined") {
12016
+ throw new AppBaseException('Missing required parameter: "reason"');
12017
+ }
12018
+ const apiPath = "/memory/memories/contexts/{contextId}/confirm".replace("{contextId}", contextId);
11777
12019
  const payload = {};
12020
+ if (typeof scope !== "undefined") {
12021
+ payload["scope"] = scope;
12022
+ }
12023
+ if (typeof userId !== "undefined") {
12024
+ payload["userId"] = userId;
12025
+ }
12026
+ if (typeof agentId !== "undefined") {
12027
+ payload["agentId"] = agentId;
12028
+ }
12029
+ if (typeof sessionId !== "undefined") {
12030
+ payload["sessionId"] = sessionId;
12031
+ }
12032
+ if (typeof runId !== "undefined") {
12033
+ payload["runId"] = runId;
12034
+ }
12035
+ if (typeof memorySubStoreId !== "undefined") {
12036
+ payload["memorySubStoreId"] = memorySubStoreId;
12037
+ }
12038
+ if (typeof expectedVersion !== "undefined") {
12039
+ payload["expectedVersion"] = expectedVersion;
12040
+ }
12041
+ if (typeof reason !== "undefined") {
12042
+ payload["reason"] = reason;
12043
+ }
11778
12044
  const uri = new URL(this.client.config.endpoint + apiPath);
11779
12045
  const apiHeaders = {
11780
12046
  "content-type": "application/json"
11781
12047
  };
11782
12048
  return this.client.call(
11783
- "delete",
12049
+ "post",
11784
12050
  uri,
11785
12051
  apiHeaders,
11786
12052
  payload
11787
12053
  );
11788
12054
  }
11789
- rollbackSchemaVersion(paramsOrFirst, ...rest) {
12055
+ rebuildContext(paramsOrFirst, ...rest) {
11790
12056
  let params;
11791
12057
  if (paramsOrFirst && typeof paramsOrFirst === "object" && !Array.isArray(paramsOrFirst)) {
11792
12058
  params = paramsOrFirst || {};
11793
12059
  } else {
11794
12060
  params = {
11795
- databaseId: paramsOrFirst,
11796
- versionId: rest[0]
12061
+ contextId: paramsOrFirst,
12062
+ reason: rest[0],
12063
+ scope: rest[1],
12064
+ userId: rest[2],
12065
+ agentId: rest[3],
12066
+ sessionId: rest[4],
12067
+ runId: rest[5],
12068
+ memorySubStoreId: rest[6]
11797
12069
  };
11798
12070
  }
11799
- const databaseId = params.databaseId;
11800
- const versionId = params.versionId;
11801
- if (typeof databaseId === "undefined") {
11802
- throw new AppBaseException('Missing required parameter: "databaseId"');
12071
+ const contextId = params.contextId;
12072
+ const reason = params.reason;
12073
+ const scope = params.scope;
12074
+ const userId = params.userId;
12075
+ const agentId = params.agentId;
12076
+ const sessionId = params.sessionId;
12077
+ const runId = params.runId;
12078
+ const memorySubStoreId = params.memorySubStoreId;
12079
+ if (typeof contextId === "undefined") {
12080
+ throw new AppBaseException('Missing required parameter: "contextId"');
12081
+ }
12082
+ if (typeof reason === "undefined") {
12083
+ throw new AppBaseException('Missing required parameter: "reason"');
12084
+ }
12085
+ const apiPath = "/memory/memories/contexts/{contextId}/rebuild".replace("{contextId}", contextId);
12086
+ const payload = {};
12087
+ if (typeof scope !== "undefined") {
12088
+ payload["scope"] = scope;
11803
12089
  }
11804
- if (typeof versionId === "undefined") {
11805
- throw new AppBaseException('Missing required parameter: "versionId"');
12090
+ if (typeof userId !== "undefined") {
12091
+ payload["userId"] = userId;
12092
+ }
12093
+ if (typeof agentId !== "undefined") {
12094
+ payload["agentId"] = agentId;
12095
+ }
12096
+ if (typeof sessionId !== "undefined") {
12097
+ payload["sessionId"] = sessionId;
12098
+ }
12099
+ if (typeof runId !== "undefined") {
12100
+ payload["runId"] = runId;
12101
+ }
12102
+ if (typeof memorySubStoreId !== "undefined") {
12103
+ payload["memorySubStoreId"] = memorySubStoreId;
12104
+ }
12105
+ if (typeof reason !== "undefined") {
12106
+ payload["reason"] = reason;
11806
12107
  }
11807
- const apiPath = "/tablesdb/{databaseId}/schema/rollback/{versionId}".replace("{databaseId}", databaseId).replace("{versionId}", versionId);
11808
- const payload = {};
11809
12108
  const uri = new URL(this.client.config.endpoint + apiPath);
11810
12109
  const apiHeaders = {
11811
12110
  "content-type": "application/json"
@@ -11817,35 +12116,2564 @@ var TablesDB = class {
11817
12116
  payload
11818
12117
  );
11819
12118
  }
11820
- listSchemaVersions(paramsOrFirst, ...rest) {
12119
+ rollbackContext(paramsOrFirst, ...rest) {
11821
12120
  let params;
11822
12121
  if (paramsOrFirst && typeof paramsOrFirst === "object" && !Array.isArray(paramsOrFirst)) {
11823
12122
  params = paramsOrFirst || {};
11824
12123
  } else {
11825
12124
  params = {
11826
- databaseId: paramsOrFirst,
11827
- queries: rest[0],
11828
- total: rest[1]
12125
+ contextId: paramsOrFirst,
12126
+ expectedVersion: rest[0],
12127
+ targetRevision: rest[1],
12128
+ reason: rest[2],
12129
+ scope: rest[3],
12130
+ userId: rest[4],
12131
+ agentId: rest[5],
12132
+ sessionId: rest[6],
12133
+ runId: rest[7],
12134
+ memorySubStoreId: rest[8]
11829
12135
  };
11830
12136
  }
11831
- const databaseId = params.databaseId;
11832
- const queries = params.queries;
11833
- const total = params.total;
11834
- if (typeof databaseId === "undefined") {
11835
- throw new AppBaseException('Missing required parameter: "databaseId"');
11836
- }
11837
- const apiPath = "/tablesdb/{databaseId}/schema/versions".replace("{databaseId}", databaseId);
12137
+ const contextId = params.contextId;
12138
+ const expectedVersion = params.expectedVersion;
12139
+ const targetRevision = params.targetRevision;
12140
+ const reason = params.reason;
12141
+ const scope = params.scope;
12142
+ const userId = params.userId;
12143
+ const agentId = params.agentId;
12144
+ const sessionId = params.sessionId;
12145
+ const runId = params.runId;
12146
+ const memorySubStoreId = params.memorySubStoreId;
12147
+ if (typeof contextId === "undefined") {
12148
+ throw new AppBaseException('Missing required parameter: "contextId"');
12149
+ }
12150
+ if (typeof expectedVersion === "undefined") {
12151
+ throw new AppBaseException('Missing required parameter: "expectedVersion"');
12152
+ }
12153
+ if (typeof targetRevision === "undefined") {
12154
+ throw new AppBaseException('Missing required parameter: "targetRevision"');
12155
+ }
12156
+ if (typeof reason === "undefined") {
12157
+ throw new AppBaseException('Missing required parameter: "reason"');
12158
+ }
12159
+ const apiPath = "/memory/memories/contexts/{contextId}/rollback".replace("{contextId}", contextId);
11838
12160
  const payload = {};
11839
- if (typeof queries !== "undefined") {
11840
- payload["queries"] = queries;
12161
+ if (typeof scope !== "undefined") {
12162
+ payload["scope"] = scope;
11841
12163
  }
11842
- if (typeof total !== "undefined") {
11843
- payload["total"] = total;
12164
+ if (typeof userId !== "undefined") {
12165
+ payload["userId"] = userId;
12166
+ }
12167
+ if (typeof agentId !== "undefined") {
12168
+ payload["agentId"] = agentId;
12169
+ }
12170
+ if (typeof sessionId !== "undefined") {
12171
+ payload["sessionId"] = sessionId;
12172
+ }
12173
+ if (typeof runId !== "undefined") {
12174
+ payload["runId"] = runId;
12175
+ }
12176
+ if (typeof memorySubStoreId !== "undefined") {
12177
+ payload["memorySubStoreId"] = memorySubStoreId;
12178
+ }
12179
+ if (typeof expectedVersion !== "undefined") {
12180
+ payload["expectedVersion"] = expectedVersion;
12181
+ }
12182
+ if (typeof targetRevision !== "undefined") {
12183
+ payload["targetRevision"] = targetRevision;
12184
+ }
12185
+ if (typeof reason !== "undefined") {
12186
+ payload["reason"] = reason;
11844
12187
  }
11845
12188
  const uri = new URL(this.client.config.endpoint + apiPath);
11846
- const apiHeaders = {};
11847
- return this.client.call(
11848
- "get",
12189
+ const apiHeaders = {
12190
+ "content-type": "application/json"
12191
+ };
12192
+ return this.client.call(
12193
+ "post",
12194
+ uri,
12195
+ apiHeaders,
12196
+ payload
12197
+ );
12198
+ }
12199
+ listDistillations(paramsOrFirst, ...rest) {
12200
+ let params;
12201
+ if (!paramsOrFirst || paramsOrFirst && typeof paramsOrFirst === "object" && !Array.isArray(paramsOrFirst) && ("scope" in paramsOrFirst || "userId" in paramsOrFirst || "agentId" in paramsOrFirst || "sessionId" in paramsOrFirst || "runId" in paramsOrFirst || "memorySubStoreId" in paramsOrFirst || "status" in paramsOrFirst || "cursor" in paramsOrFirst || "limit" in paramsOrFirst)) {
12202
+ params = paramsOrFirst || {};
12203
+ } else {
12204
+ params = {
12205
+ scope: paramsOrFirst,
12206
+ userId: rest[0],
12207
+ agentId: rest[1],
12208
+ sessionId: rest[2],
12209
+ runId: rest[3],
12210
+ memorySubStoreId: rest[4],
12211
+ status: rest[5],
12212
+ cursor: rest[6],
12213
+ limit: rest[7]
12214
+ };
12215
+ }
12216
+ const scope = params.scope;
12217
+ const userId = params.userId;
12218
+ const agentId = params.agentId;
12219
+ const sessionId = params.sessionId;
12220
+ const runId = params.runId;
12221
+ const memorySubStoreId = params.memorySubStoreId;
12222
+ const status = params.status;
12223
+ const cursor = params.cursor;
12224
+ const limit = params.limit;
12225
+ const apiPath = "/memory/memories/distillations";
12226
+ const payload = {};
12227
+ if (typeof scope !== "undefined") {
12228
+ payload["scope"] = scope;
12229
+ }
12230
+ if (typeof userId !== "undefined") {
12231
+ payload["userId"] = userId;
12232
+ }
12233
+ if (typeof agentId !== "undefined") {
12234
+ payload["agentId"] = agentId;
12235
+ }
12236
+ if (typeof sessionId !== "undefined") {
12237
+ payload["sessionId"] = sessionId;
12238
+ }
12239
+ if (typeof runId !== "undefined") {
12240
+ payload["runId"] = runId;
12241
+ }
12242
+ if (typeof memorySubStoreId !== "undefined") {
12243
+ payload["memorySubStoreId"] = memorySubStoreId;
12244
+ }
12245
+ if (typeof status !== "undefined") {
12246
+ payload["status"] = status;
12247
+ }
12248
+ if (typeof cursor !== "undefined") {
12249
+ payload["cursor"] = cursor;
12250
+ }
12251
+ if (typeof limit !== "undefined") {
12252
+ payload["limit"] = limit;
12253
+ }
12254
+ const uri = new URL(this.client.config.endpoint + apiPath);
12255
+ const apiHeaders = {};
12256
+ return this.client.call(
12257
+ "get",
12258
+ uri,
12259
+ apiHeaders,
12260
+ payload
12261
+ );
12262
+ }
12263
+ submitDistillation(paramsOrFirst, ...rest) {
12264
+ let params;
12265
+ if (!paramsOrFirst || paramsOrFirst && typeof paramsOrFirst === "object" && !Array.isArray(paramsOrFirst) && ("scope" in paramsOrFirst || "userId" in paramsOrFirst || "agentId" in paramsOrFirst || "sessionId" in paramsOrFirst || "runId" in paramsOrFirst || "memorySubStoreId" in paramsOrFirst || "sourceId" in paramsOrFirst || "sourceType" in paramsOrFirst || "messages" in paramsOrFirst || "toolEvents" in paramsOrFirst || "mode" in paramsOrFirst || "idempotencyKey" in paramsOrFirst)) {
12266
+ params = paramsOrFirst || {};
12267
+ } else {
12268
+ params = {
12269
+ scope: paramsOrFirst,
12270
+ userId: rest[0],
12271
+ agentId: rest[1],
12272
+ sessionId: rest[2],
12273
+ runId: rest[3],
12274
+ memorySubStoreId: rest[4],
12275
+ sourceId: rest[5],
12276
+ sourceType: rest[6],
12277
+ messages: rest[7],
12278
+ toolEvents: rest[8],
12279
+ mode: rest[9],
12280
+ idempotencyKey: rest[10]
12281
+ };
12282
+ }
12283
+ const scope = params.scope;
12284
+ const userId = params.userId;
12285
+ const agentId = params.agentId;
12286
+ const sessionId = params.sessionId;
12287
+ const runId = params.runId;
12288
+ const memorySubStoreId = params.memorySubStoreId;
12289
+ const sourceId = params.sourceId;
12290
+ const sourceType = params.sourceType;
12291
+ const messages = params.messages;
12292
+ const toolEvents = params.toolEvents;
12293
+ const mode = params.mode;
12294
+ const idempotencyKey = params.idempotencyKey;
12295
+ const apiPath = "/memory/memories/distillations";
12296
+ const payload = {};
12297
+ if (typeof scope !== "undefined") {
12298
+ payload["scope"] = scope;
12299
+ }
12300
+ if (typeof userId !== "undefined") {
12301
+ payload["userId"] = userId;
12302
+ }
12303
+ if (typeof agentId !== "undefined") {
12304
+ payload["agentId"] = agentId;
12305
+ }
12306
+ if (typeof sessionId !== "undefined") {
12307
+ payload["sessionId"] = sessionId;
12308
+ }
12309
+ if (typeof runId !== "undefined") {
12310
+ payload["runId"] = runId;
12311
+ }
12312
+ if (typeof memorySubStoreId !== "undefined") {
12313
+ payload["memorySubStoreId"] = memorySubStoreId;
12314
+ }
12315
+ if (typeof sourceId !== "undefined") {
12316
+ payload["sourceId"] = sourceId;
12317
+ }
12318
+ if (typeof sourceType !== "undefined") {
12319
+ payload["sourceType"] = sourceType;
12320
+ }
12321
+ if (typeof messages !== "undefined") {
12322
+ payload["messages"] = messages;
12323
+ }
12324
+ if (typeof toolEvents !== "undefined") {
12325
+ payload["toolEvents"] = toolEvents;
12326
+ }
12327
+ if (typeof mode !== "undefined") {
12328
+ payload["mode"] = mode;
12329
+ }
12330
+ if (typeof idempotencyKey !== "undefined") {
12331
+ payload["idempotencyKey"] = idempotencyKey;
12332
+ }
12333
+ const uri = new URL(this.client.config.endpoint + apiPath);
12334
+ const apiHeaders = {
12335
+ "content-type": "application/json"
12336
+ };
12337
+ return this.client.call(
12338
+ "post",
12339
+ uri,
12340
+ apiHeaders,
12341
+ payload
12342
+ );
12343
+ }
12344
+ getDistillation(paramsOrFirst, ...rest) {
12345
+ let params;
12346
+ if (paramsOrFirst && typeof paramsOrFirst === "object" && !Array.isArray(paramsOrFirst)) {
12347
+ params = paramsOrFirst || {};
12348
+ } else {
12349
+ params = {
12350
+ distillationId: paramsOrFirst,
12351
+ scope: rest[0],
12352
+ userId: rest[1],
12353
+ agentId: rest[2],
12354
+ sessionId: rest[3],
12355
+ runId: rest[4],
12356
+ memorySubStoreId: rest[5]
12357
+ };
12358
+ }
12359
+ const distillationId = params.distillationId;
12360
+ const scope = params.scope;
12361
+ const userId = params.userId;
12362
+ const agentId = params.agentId;
12363
+ const sessionId = params.sessionId;
12364
+ const runId = params.runId;
12365
+ const memorySubStoreId = params.memorySubStoreId;
12366
+ if (typeof distillationId === "undefined") {
12367
+ throw new AppBaseException('Missing required parameter: "distillationId"');
12368
+ }
12369
+ const apiPath = "/memory/memories/distillations/{distillationId}".replace("{distillationId}", distillationId);
12370
+ const payload = {};
12371
+ if (typeof scope !== "undefined") {
12372
+ payload["scope"] = scope;
12373
+ }
12374
+ if (typeof userId !== "undefined") {
12375
+ payload["userId"] = userId;
12376
+ }
12377
+ if (typeof agentId !== "undefined") {
12378
+ payload["agentId"] = agentId;
12379
+ }
12380
+ if (typeof sessionId !== "undefined") {
12381
+ payload["sessionId"] = sessionId;
12382
+ }
12383
+ if (typeof runId !== "undefined") {
12384
+ payload["runId"] = runId;
12385
+ }
12386
+ if (typeof memorySubStoreId !== "undefined") {
12387
+ payload["memorySubStoreId"] = memorySubStoreId;
12388
+ }
12389
+ const uri = new URL(this.client.config.endpoint + apiPath);
12390
+ const apiHeaders = {};
12391
+ return this.client.call(
12392
+ "get",
12393
+ uri,
12394
+ apiHeaders,
12395
+ payload
12396
+ );
12397
+ }
12398
+ replayDistillation(paramsOrFirst, ...rest) {
12399
+ let params;
12400
+ if (paramsOrFirst && typeof paramsOrFirst === "object" && !Array.isArray(paramsOrFirst)) {
12401
+ params = paramsOrFirst || {};
12402
+ } else {
12403
+ params = {
12404
+ distillationId: paramsOrFirst,
12405
+ scope: rest[0],
12406
+ userId: rest[1],
12407
+ agentId: rest[2],
12408
+ sessionId: rest[3],
12409
+ runId: rest[4],
12410
+ memorySubStoreId: rest[5]
12411
+ };
12412
+ }
12413
+ const distillationId = params.distillationId;
12414
+ const scope = params.scope;
12415
+ const userId = params.userId;
12416
+ const agentId = params.agentId;
12417
+ const sessionId = params.sessionId;
12418
+ const runId = params.runId;
12419
+ const memorySubStoreId = params.memorySubStoreId;
12420
+ if (typeof distillationId === "undefined") {
12421
+ throw new AppBaseException('Missing required parameter: "distillationId"');
12422
+ }
12423
+ const apiPath = "/memory/memories/distillations/{distillationId}/replay".replace("{distillationId}", distillationId);
12424
+ const payload = {};
12425
+ if (typeof scope !== "undefined") {
12426
+ payload["scope"] = scope;
12427
+ }
12428
+ if (typeof userId !== "undefined") {
12429
+ payload["userId"] = userId;
12430
+ }
12431
+ if (typeof agentId !== "undefined") {
12432
+ payload["agentId"] = agentId;
12433
+ }
12434
+ if (typeof sessionId !== "undefined") {
12435
+ payload["sessionId"] = sessionId;
12436
+ }
12437
+ if (typeof runId !== "undefined") {
12438
+ payload["runId"] = runId;
12439
+ }
12440
+ if (typeof memorySubStoreId !== "undefined") {
12441
+ payload["memorySubStoreId"] = memorySubStoreId;
12442
+ }
12443
+ const uri = new URL(this.client.config.endpoint + apiPath);
12444
+ const apiHeaders = {
12445
+ "content-type": "application/json"
12446
+ };
12447
+ return this.client.call(
12448
+ "post",
12449
+ uri,
12450
+ apiHeaders,
12451
+ payload
12452
+ );
12453
+ }
12454
+ listExperiences(paramsOrFirst, ...rest) {
12455
+ let params;
12456
+ if (!paramsOrFirst || paramsOrFirst && typeof paramsOrFirst === "object" && !Array.isArray(paramsOrFirst) && ("scope" in paramsOrFirst || "userId" in paramsOrFirst || "agentId" in paramsOrFirst || "sessionId" in paramsOrFirst || "runId" in paramsOrFirst || "memorySubStoreId" in paramsOrFirst || "cursor" in paramsOrFirst || "limit" in paramsOrFirst)) {
12457
+ params = paramsOrFirst || {};
12458
+ } else {
12459
+ params = {
12460
+ scope: paramsOrFirst,
12461
+ userId: rest[0],
12462
+ agentId: rest[1],
12463
+ sessionId: rest[2],
12464
+ runId: rest[3],
12465
+ memorySubStoreId: rest[4],
12466
+ cursor: rest[5],
12467
+ limit: rest[6]
12468
+ };
12469
+ }
12470
+ const scope = params.scope;
12471
+ const userId = params.userId;
12472
+ const agentId = params.agentId;
12473
+ const sessionId = params.sessionId;
12474
+ const runId = params.runId;
12475
+ const memorySubStoreId = params.memorySubStoreId;
12476
+ const cursor = params.cursor;
12477
+ const limit = params.limit;
12478
+ const apiPath = "/memory/memories/experiences";
12479
+ const payload = {};
12480
+ if (typeof scope !== "undefined") {
12481
+ payload["scope"] = scope;
12482
+ }
12483
+ if (typeof userId !== "undefined") {
12484
+ payload["userId"] = userId;
12485
+ }
12486
+ if (typeof agentId !== "undefined") {
12487
+ payload["agentId"] = agentId;
12488
+ }
12489
+ if (typeof sessionId !== "undefined") {
12490
+ payload["sessionId"] = sessionId;
12491
+ }
12492
+ if (typeof runId !== "undefined") {
12493
+ payload["runId"] = runId;
12494
+ }
12495
+ if (typeof memorySubStoreId !== "undefined") {
12496
+ payload["memorySubStoreId"] = memorySubStoreId;
12497
+ }
12498
+ if (typeof cursor !== "undefined") {
12499
+ payload["cursor"] = cursor;
12500
+ }
12501
+ if (typeof limit !== "undefined") {
12502
+ payload["limit"] = limit;
12503
+ }
12504
+ const uri = new URL(this.client.config.endpoint + apiPath);
12505
+ const apiHeaders = {};
12506
+ return this.client.call(
12507
+ "get",
12508
+ uri,
12509
+ apiHeaders,
12510
+ payload
12511
+ );
12512
+ }
12513
+ searchExperiences(paramsOrFirst, ...rest) {
12514
+ let params;
12515
+ if (paramsOrFirst && typeof paramsOrFirst === "object" && !Array.isArray(paramsOrFirst)) {
12516
+ params = paramsOrFirst || {};
12517
+ } else {
12518
+ params = {
12519
+ query: paramsOrFirst,
12520
+ scope: rest[0],
12521
+ userId: rest[1],
12522
+ agentId: rest[2],
12523
+ sessionId: rest[3],
12524
+ runId: rest[4],
12525
+ memorySubStoreId: rest[5],
12526
+ cursor: rest[6],
12527
+ limit: rest[7],
12528
+ retrieval: rest[8]
12529
+ };
12530
+ }
12531
+ const query = params.query;
12532
+ const scope = params.scope;
12533
+ const userId = params.userId;
12534
+ const agentId = params.agentId;
12535
+ const sessionId = params.sessionId;
12536
+ const runId = params.runId;
12537
+ const memorySubStoreId = params.memorySubStoreId;
12538
+ const cursor = params.cursor;
12539
+ const limit = params.limit;
12540
+ const retrieval = params.retrieval;
12541
+ if (typeof query === "undefined") {
12542
+ throw new AppBaseException('Missing required parameter: "query"');
12543
+ }
12544
+ const apiPath = "/memory/memories/experiences/search";
12545
+ const payload = {};
12546
+ if (typeof scope !== "undefined") {
12547
+ payload["scope"] = scope;
12548
+ }
12549
+ if (typeof userId !== "undefined") {
12550
+ payload["userId"] = userId;
12551
+ }
12552
+ if (typeof agentId !== "undefined") {
12553
+ payload["agentId"] = agentId;
12554
+ }
12555
+ if (typeof sessionId !== "undefined") {
12556
+ payload["sessionId"] = sessionId;
12557
+ }
12558
+ if (typeof runId !== "undefined") {
12559
+ payload["runId"] = runId;
12560
+ }
12561
+ if (typeof memorySubStoreId !== "undefined") {
12562
+ payload["memorySubStoreId"] = memorySubStoreId;
12563
+ }
12564
+ if (typeof query !== "undefined") {
12565
+ payload["query"] = query;
12566
+ }
12567
+ if (typeof cursor !== "undefined") {
12568
+ payload["cursor"] = cursor;
12569
+ }
12570
+ if (typeof limit !== "undefined") {
12571
+ payload["limit"] = limit;
12572
+ }
12573
+ if (typeof retrieval !== "undefined") {
12574
+ payload["retrieval"] = retrieval;
12575
+ }
12576
+ const uri = new URL(this.client.config.endpoint + apiPath);
12577
+ const apiHeaders = {
12578
+ "content-type": "application/json"
12579
+ };
12580
+ return this.client.call(
12581
+ "post",
12582
+ uri,
12583
+ apiHeaders,
12584
+ payload
12585
+ );
12586
+ }
12587
+ getExperience(paramsOrFirst, ...rest) {
12588
+ let params;
12589
+ if (paramsOrFirst && typeof paramsOrFirst === "object" && !Array.isArray(paramsOrFirst)) {
12590
+ params = paramsOrFirst || {};
12591
+ } else {
12592
+ params = {
12593
+ knowledgeId: paramsOrFirst,
12594
+ scope: rest[0],
12595
+ userId: rest[1],
12596
+ agentId: rest[2],
12597
+ sessionId: rest[3],
12598
+ runId: rest[4],
12599
+ memorySubStoreId: rest[5]
12600
+ };
12601
+ }
12602
+ const knowledgeId = params.knowledgeId;
12603
+ const scope = params.scope;
12604
+ const userId = params.userId;
12605
+ const agentId = params.agentId;
12606
+ const sessionId = params.sessionId;
12607
+ const runId = params.runId;
12608
+ const memorySubStoreId = params.memorySubStoreId;
12609
+ if (typeof knowledgeId === "undefined") {
12610
+ throw new AppBaseException('Missing required parameter: "knowledgeId"');
12611
+ }
12612
+ const apiPath = "/memory/memories/experiences/{knowledgeId}".replace("{knowledgeId}", knowledgeId);
12613
+ const payload = {};
12614
+ if (typeof scope !== "undefined") {
12615
+ payload["scope"] = scope;
12616
+ }
12617
+ if (typeof userId !== "undefined") {
12618
+ payload["userId"] = userId;
12619
+ }
12620
+ if (typeof agentId !== "undefined") {
12621
+ payload["agentId"] = agentId;
12622
+ }
12623
+ if (typeof sessionId !== "undefined") {
12624
+ payload["sessionId"] = sessionId;
12625
+ }
12626
+ if (typeof runId !== "undefined") {
12627
+ payload["runId"] = runId;
12628
+ }
12629
+ if (typeof memorySubStoreId !== "undefined") {
12630
+ payload["memorySubStoreId"] = memorySubStoreId;
12631
+ }
12632
+ const uri = new URL(this.client.config.endpoint + apiPath);
12633
+ const apiHeaders = {};
12634
+ return this.client.call(
12635
+ "get",
12636
+ uri,
12637
+ apiHeaders,
12638
+ payload
12639
+ );
12640
+ }
12641
+ listExperienceSources(paramsOrFirst, ...rest) {
12642
+ let params;
12643
+ if (paramsOrFirst && typeof paramsOrFirst === "object" && !Array.isArray(paramsOrFirst)) {
12644
+ params = paramsOrFirst || {};
12645
+ } else {
12646
+ params = {
12647
+ knowledgeId: paramsOrFirst,
12648
+ scope: rest[0],
12649
+ userId: rest[1],
12650
+ agentId: rest[2],
12651
+ sessionId: rest[3],
12652
+ runId: rest[4],
12653
+ memorySubStoreId: rest[5],
12654
+ cursor: rest[6],
12655
+ limit: rest[7]
12656
+ };
12657
+ }
12658
+ const knowledgeId = params.knowledgeId;
12659
+ const scope = params.scope;
12660
+ const userId = params.userId;
12661
+ const agentId = params.agentId;
12662
+ const sessionId = params.sessionId;
12663
+ const runId = params.runId;
12664
+ const memorySubStoreId = params.memorySubStoreId;
12665
+ const cursor = params.cursor;
12666
+ const limit = params.limit;
12667
+ if (typeof knowledgeId === "undefined") {
12668
+ throw new AppBaseException('Missing required parameter: "knowledgeId"');
12669
+ }
12670
+ const apiPath = "/memory/memories/experiences/{knowledgeId}/sources".replace("{knowledgeId}", knowledgeId);
12671
+ const payload = {};
12672
+ if (typeof scope !== "undefined") {
12673
+ payload["scope"] = scope;
12674
+ }
12675
+ if (typeof userId !== "undefined") {
12676
+ payload["userId"] = userId;
12677
+ }
12678
+ if (typeof agentId !== "undefined") {
12679
+ payload["agentId"] = agentId;
12680
+ }
12681
+ if (typeof sessionId !== "undefined") {
12682
+ payload["sessionId"] = sessionId;
12683
+ }
12684
+ if (typeof runId !== "undefined") {
12685
+ payload["runId"] = runId;
12686
+ }
12687
+ if (typeof memorySubStoreId !== "undefined") {
12688
+ payload["memorySubStoreId"] = memorySubStoreId;
12689
+ }
12690
+ if (typeof cursor !== "undefined") {
12691
+ payload["cursor"] = cursor;
12692
+ }
12693
+ if (typeof limit !== "undefined") {
12694
+ payload["limit"] = limit;
12695
+ }
12696
+ const uri = new URL(this.client.config.endpoint + apiPath);
12697
+ const apiHeaders = {};
12698
+ return this.client.call(
12699
+ "get",
12700
+ uri,
12701
+ apiHeaders,
12702
+ payload
12703
+ );
12704
+ }
12705
+ getExport(paramsOrFirst, ...rest) {
12706
+ let params;
12707
+ if (paramsOrFirst && typeof paramsOrFirst === "object" && !Array.isArray(paramsOrFirst)) {
12708
+ params = paramsOrFirst || {};
12709
+ } else {
12710
+ params = {
12711
+ userId: paramsOrFirst,
12712
+ format: rest[0],
12713
+ mode: rest[1],
12714
+ includeForgotten: rest[2],
12715
+ includeVectors: rest[3],
12716
+ includeRawSources: rest[4]
12717
+ };
12718
+ }
12719
+ const userId = params.userId;
12720
+ const format = params.format;
12721
+ const mode = params.mode;
12722
+ const includeForgotten = params.includeForgotten;
12723
+ const includeVectors = params.includeVectors;
12724
+ const includeRawSources = params.includeRawSources;
12725
+ if (typeof userId === "undefined") {
12726
+ throw new AppBaseException('Missing required parameter: "userId"');
12727
+ }
12728
+ const apiPath = "/memory/memories/export";
12729
+ const payload = {};
12730
+ if (typeof userId !== "undefined") {
12731
+ payload["userId"] = userId;
12732
+ }
12733
+ if (typeof format !== "undefined") {
12734
+ payload["format"] = format;
12735
+ }
12736
+ if (typeof mode !== "undefined") {
12737
+ payload["mode"] = mode;
12738
+ }
12739
+ if (typeof includeForgotten !== "undefined") {
12740
+ payload["includeForgotten"] = includeForgotten;
12741
+ }
12742
+ if (typeof includeVectors !== "undefined") {
12743
+ payload["includeVectors"] = includeVectors;
12744
+ }
12745
+ if (typeof includeRawSources !== "undefined") {
12746
+ payload["includeRawSources"] = includeRawSources;
12747
+ }
12748
+ const uri = new URL(this.client.config.endpoint + apiPath);
12749
+ const apiHeaders = {};
12750
+ return this.client.call(
12751
+ "get",
12752
+ uri,
12753
+ apiHeaders,
12754
+ payload
12755
+ );
12756
+ }
12757
+ createExport(paramsOrFirst, ...rest) {
12758
+ let params;
12759
+ if (paramsOrFirst && typeof paramsOrFirst === "object" && !Array.isArray(paramsOrFirst)) {
12760
+ params = paramsOrFirst || {};
12761
+ } else {
12762
+ params = {
12763
+ userId: paramsOrFirst,
12764
+ format: rest[0],
12765
+ includeForgotten: rest[1],
12766
+ includeVectors: rest[2],
12767
+ includeRawSources: rest[3],
12768
+ mode: rest[4]
12769
+ };
12770
+ }
12771
+ const userId = params.userId;
12772
+ const format = params.format;
12773
+ const includeForgotten = params.includeForgotten;
12774
+ const includeVectors = params.includeVectors;
12775
+ const includeRawSources = params.includeRawSources;
12776
+ const mode = params.mode;
12777
+ if (typeof userId === "undefined") {
12778
+ throw new AppBaseException('Missing required parameter: "userId"');
12779
+ }
12780
+ const apiPath = "/memory/memories/exports";
12781
+ const payload = {};
12782
+ if (typeof userId !== "undefined") {
12783
+ payload["userId"] = userId;
12784
+ }
12785
+ if (typeof format !== "undefined") {
12786
+ payload["format"] = format;
12787
+ }
12788
+ if (typeof includeForgotten !== "undefined") {
12789
+ payload["includeForgotten"] = includeForgotten;
12790
+ }
12791
+ if (typeof includeVectors !== "undefined") {
12792
+ payload["includeVectors"] = includeVectors;
12793
+ }
12794
+ if (typeof includeRawSources !== "undefined") {
12795
+ payload["includeRawSources"] = includeRawSources;
12796
+ }
12797
+ if (typeof mode !== "undefined") {
12798
+ payload["mode"] = mode;
12799
+ }
12800
+ const uri = new URL(this.client.config.endpoint + apiPath);
12801
+ const apiHeaders = {
12802
+ "content-type": "application/json"
12803
+ };
12804
+ return this.client.call(
12805
+ "post",
12806
+ uri,
12807
+ apiHeaders,
12808
+ payload
12809
+ );
12810
+ }
12811
+ getExportJob(paramsOrFirst) {
12812
+ let params;
12813
+ if (paramsOrFirst && typeof paramsOrFirst === "object" && !Array.isArray(paramsOrFirst)) {
12814
+ params = paramsOrFirst || {};
12815
+ } else {
12816
+ params = {
12817
+ exportId: paramsOrFirst
12818
+ };
12819
+ }
12820
+ const exportId = params.exportId;
12821
+ if (typeof exportId === "undefined") {
12822
+ throw new AppBaseException('Missing required parameter: "exportId"');
12823
+ }
12824
+ const apiPath = "/memory/memories/exports/{exportId}".replace("{exportId}", exportId);
12825
+ const payload = {};
12826
+ const uri = new URL(this.client.config.endpoint + apiPath);
12827
+ const apiHeaders = {};
12828
+ return this.client.call(
12829
+ "get",
12830
+ uri,
12831
+ apiHeaders,
12832
+ payload
12833
+ );
12834
+ }
12835
+ createKnowledgeFeedback(paramsOrFirst, ...rest) {
12836
+ let params;
12837
+ if (paramsOrFirst && typeof paramsOrFirst === "object" && !Array.isArray(paramsOrFirst)) {
12838
+ params = paramsOrFirst || {};
12839
+ } else {
12840
+ params = {
12841
+ injectionId: paramsOrFirst,
12842
+ knowledgeId: rest[0],
12843
+ revision: rest[1],
12844
+ feedbackType: rest[2],
12845
+ scope: rest[3],
12846
+ userId: rest[4],
12847
+ agentId: rest[5],
12848
+ sessionId: rest[6],
12849
+ runId: rest[7],
12850
+ memorySubStoreId: rest[8],
12851
+ reasonCode: rest[9],
12852
+ idempotencyKey: rest[10]
12853
+ };
12854
+ }
12855
+ const injectionId = params.injectionId;
12856
+ const knowledgeId = params.knowledgeId;
12857
+ const revision = params.revision;
12858
+ const feedbackType = params.feedbackType;
12859
+ const scope = params.scope;
12860
+ const userId = params.userId;
12861
+ const agentId = params.agentId;
12862
+ const sessionId = params.sessionId;
12863
+ const runId = params.runId;
12864
+ const memorySubStoreId = params.memorySubStoreId;
12865
+ const reasonCode = params.reasonCode;
12866
+ const idempotencyKey = params.idempotencyKey;
12867
+ if (typeof injectionId === "undefined") {
12868
+ throw new AppBaseException('Missing required parameter: "injectionId"');
12869
+ }
12870
+ if (typeof knowledgeId === "undefined") {
12871
+ throw new AppBaseException('Missing required parameter: "knowledgeId"');
12872
+ }
12873
+ if (typeof revision === "undefined") {
12874
+ throw new AppBaseException('Missing required parameter: "revision"');
12875
+ }
12876
+ if (typeof feedbackType === "undefined") {
12877
+ throw new AppBaseException('Missing required parameter: "feedbackType"');
12878
+ }
12879
+ const apiPath = "/memory/memories/feedback";
12880
+ const payload = {};
12881
+ if (typeof scope !== "undefined") {
12882
+ payload["scope"] = scope;
12883
+ }
12884
+ if (typeof userId !== "undefined") {
12885
+ payload["userId"] = userId;
12886
+ }
12887
+ if (typeof agentId !== "undefined") {
12888
+ payload["agentId"] = agentId;
12889
+ }
12890
+ if (typeof sessionId !== "undefined") {
12891
+ payload["sessionId"] = sessionId;
12892
+ }
12893
+ if (typeof runId !== "undefined") {
12894
+ payload["runId"] = runId;
12895
+ }
12896
+ if (typeof memorySubStoreId !== "undefined") {
12897
+ payload["memorySubStoreId"] = memorySubStoreId;
12898
+ }
12899
+ if (typeof injectionId !== "undefined") {
12900
+ payload["injectionId"] = injectionId;
12901
+ }
12902
+ if (typeof knowledgeId !== "undefined") {
12903
+ payload["knowledgeId"] = knowledgeId;
12904
+ }
12905
+ if (typeof revision !== "undefined") {
12906
+ payload["revision"] = revision;
12907
+ }
12908
+ if (typeof feedbackType !== "undefined") {
12909
+ payload["feedbackType"] = feedbackType;
12910
+ }
12911
+ if (typeof reasonCode !== "undefined") {
12912
+ payload["reasonCode"] = reasonCode;
12913
+ }
12914
+ if (typeof idempotencyKey !== "undefined") {
12915
+ payload["idempotencyKey"] = idempotencyKey;
12916
+ }
12917
+ const uri = new URL(this.client.config.endpoint + apiPath);
12918
+ const apiHeaders = {
12919
+ "content-type": "application/json"
12920
+ };
12921
+ return this.client.call(
12922
+ "post",
12923
+ uri,
12924
+ apiHeaders,
12925
+ payload
12926
+ );
12927
+ }
12928
+ createImport(paramsOrFirst, ...rest) {
12929
+ let params;
12930
+ if (paramsOrFirst && typeof paramsOrFirst === "object" && !Array.isArray(paramsOrFirst)) {
12931
+ params = paramsOrFirst || {};
12932
+ } else {
12933
+ params = {
12934
+ userId: paramsOrFirst,
12935
+ format: rest[0],
12936
+ data: rest[1],
12937
+ records: rest[2],
12938
+ dryRun: rest[3]
12939
+ };
12940
+ }
12941
+ const userId = params.userId;
12942
+ const format = params.format;
12943
+ const data = params.data;
12944
+ const records = params.records;
12945
+ const dryRun = params.dryRun;
12946
+ if (typeof userId === "undefined") {
12947
+ throw new AppBaseException('Missing required parameter: "userId"');
12948
+ }
12949
+ const apiPath = "/memory/memories/imports";
12950
+ const payload = {};
12951
+ if (typeof userId !== "undefined") {
12952
+ payload["userId"] = userId;
12953
+ }
12954
+ if (typeof format !== "undefined") {
12955
+ payload["format"] = format;
12956
+ }
12957
+ if (typeof data !== "undefined") {
12958
+ payload["data"] = data;
12959
+ }
12960
+ if (typeof records !== "undefined") {
12961
+ payload["records"] = records;
12962
+ }
12963
+ if (typeof dryRun !== "undefined") {
12964
+ payload["dryRun"] = dryRun;
12965
+ }
12966
+ const uri = new URL(this.client.config.endpoint + apiPath);
12967
+ const apiHeaders = {
12968
+ "content-type": "application/json"
12969
+ };
12970
+ return this.client.call(
12971
+ "post",
12972
+ uri,
12973
+ apiHeaders,
12974
+ payload
12975
+ );
12976
+ }
12977
+ getImport(paramsOrFirst) {
12978
+ let params;
12979
+ if (paramsOrFirst && typeof paramsOrFirst === "object" && !Array.isArray(paramsOrFirst)) {
12980
+ params = paramsOrFirst || {};
12981
+ } else {
12982
+ params = {
12983
+ importId: paramsOrFirst
12984
+ };
12985
+ }
12986
+ const importId = params.importId;
12987
+ if (typeof importId === "undefined") {
12988
+ throw new AppBaseException('Missing required parameter: "importId"');
12989
+ }
12990
+ const apiPath = "/memory/memories/imports/{importId}".replace("{importId}", importId);
12991
+ const payload = {};
12992
+ const uri = new URL(this.client.config.endpoint + apiPath);
12993
+ const apiHeaders = {};
12994
+ return this.client.call(
12995
+ "get",
12996
+ uri,
12997
+ apiHeaders,
12998
+ payload
12999
+ );
13000
+ }
13001
+ updateKnowledge(paramsOrFirst, ...rest) {
13002
+ let params;
13003
+ if (paramsOrFirst && typeof paramsOrFirst === "object" && !Array.isArray(paramsOrFirst)) {
13004
+ params = paramsOrFirst || {};
13005
+ } else {
13006
+ params = {
13007
+ knowledgeId: paramsOrFirst,
13008
+ expectedVersion: rest[0],
13009
+ scope: rest[1],
13010
+ userId: rest[2],
13011
+ agentId: rest[3],
13012
+ sessionId: rest[4],
13013
+ runId: rest[5],
13014
+ memorySubStoreId: rest[6],
13015
+ status: rest[7],
13016
+ validationStatus: rest[8]
13017
+ };
13018
+ }
13019
+ const knowledgeId = params.knowledgeId;
13020
+ const expectedVersion = params.expectedVersion;
13021
+ const scope = params.scope;
13022
+ const userId = params.userId;
13023
+ const agentId = params.agentId;
13024
+ const sessionId = params.sessionId;
13025
+ const runId = params.runId;
13026
+ const memorySubStoreId = params.memorySubStoreId;
13027
+ const status = params.status;
13028
+ const validationStatus = params.validationStatus;
13029
+ if (typeof knowledgeId === "undefined") {
13030
+ throw new AppBaseException('Missing required parameter: "knowledgeId"');
13031
+ }
13032
+ if (typeof expectedVersion === "undefined") {
13033
+ throw new AppBaseException('Missing required parameter: "expectedVersion"');
13034
+ }
13035
+ const apiPath = "/memory/memories/knowledge/{knowledgeId}".replace("{knowledgeId}", knowledgeId);
13036
+ const payload = {};
13037
+ if (typeof scope !== "undefined") {
13038
+ payload["scope"] = scope;
13039
+ }
13040
+ if (typeof userId !== "undefined") {
13041
+ payload["userId"] = userId;
13042
+ }
13043
+ if (typeof agentId !== "undefined") {
13044
+ payload["agentId"] = agentId;
13045
+ }
13046
+ if (typeof sessionId !== "undefined") {
13047
+ payload["sessionId"] = sessionId;
13048
+ }
13049
+ if (typeof runId !== "undefined") {
13050
+ payload["runId"] = runId;
13051
+ }
13052
+ if (typeof memorySubStoreId !== "undefined") {
13053
+ payload["memorySubStoreId"] = memorySubStoreId;
13054
+ }
13055
+ if (typeof expectedVersion !== "undefined") {
13056
+ payload["expectedVersion"] = expectedVersion;
13057
+ }
13058
+ if (typeof status !== "undefined") {
13059
+ payload["status"] = status;
13060
+ }
13061
+ if (typeof validationStatus !== "undefined") {
13062
+ payload["validationStatus"] = validationStatus;
13063
+ }
13064
+ const uri = new URL(this.client.config.endpoint + apiPath);
13065
+ const apiHeaders = {
13066
+ "content-type": "application/json"
13067
+ };
13068
+ return this.client.call(
13069
+ "patch",
13070
+ uri,
13071
+ apiHeaders,
13072
+ payload
13073
+ );
13074
+ }
13075
+ forgetKnowledge(paramsOrFirst, ...rest) {
13076
+ let params;
13077
+ if (paramsOrFirst && typeof paramsOrFirst === "object" && !Array.isArray(paramsOrFirst)) {
13078
+ params = paramsOrFirst || {};
13079
+ } else {
13080
+ params = {
13081
+ knowledgeId: paramsOrFirst,
13082
+ expectedVersion: rest[0],
13083
+ scope: rest[1],
13084
+ userId: rest[2],
13085
+ agentId: rest[3],
13086
+ sessionId: rest[4],
13087
+ runId: rest[5],
13088
+ memorySubStoreId: rest[6],
13089
+ reason: rest[7],
13090
+ source: rest[8]
13091
+ };
13092
+ }
13093
+ const knowledgeId = params.knowledgeId;
13094
+ const expectedVersion = params.expectedVersion;
13095
+ const scope = params.scope;
13096
+ const userId = params.userId;
13097
+ const agentId = params.agentId;
13098
+ const sessionId = params.sessionId;
13099
+ const runId = params.runId;
13100
+ const memorySubStoreId = params.memorySubStoreId;
13101
+ const reason = params.reason;
13102
+ const source = params.source;
13103
+ if (typeof knowledgeId === "undefined") {
13104
+ throw new AppBaseException('Missing required parameter: "knowledgeId"');
13105
+ }
13106
+ if (typeof expectedVersion === "undefined") {
13107
+ throw new AppBaseException('Missing required parameter: "expectedVersion"');
13108
+ }
13109
+ const apiPath = "/memory/memories/knowledge/{knowledgeId}".replace("{knowledgeId}", knowledgeId);
13110
+ const payload = {};
13111
+ if (typeof scope !== "undefined") {
13112
+ payload["scope"] = scope;
13113
+ }
13114
+ if (typeof userId !== "undefined") {
13115
+ payload["userId"] = userId;
13116
+ }
13117
+ if (typeof agentId !== "undefined") {
13118
+ payload["agentId"] = agentId;
13119
+ }
13120
+ if (typeof sessionId !== "undefined") {
13121
+ payload["sessionId"] = sessionId;
13122
+ }
13123
+ if (typeof runId !== "undefined") {
13124
+ payload["runId"] = runId;
13125
+ }
13126
+ if (typeof memorySubStoreId !== "undefined") {
13127
+ payload["memorySubStoreId"] = memorySubStoreId;
13128
+ }
13129
+ if (typeof expectedVersion !== "undefined") {
13130
+ payload["expectedVersion"] = expectedVersion;
13131
+ }
13132
+ if (typeof reason !== "undefined") {
13133
+ payload["reason"] = reason;
13134
+ }
13135
+ if (typeof source !== "undefined") {
13136
+ payload["source"] = source;
13137
+ }
13138
+ const uri = new URL(this.client.config.endpoint + apiPath);
13139
+ const apiHeaders = {
13140
+ "content-type": "application/json"
13141
+ };
13142
+ return this.client.call(
13143
+ "delete",
13144
+ uri,
13145
+ apiHeaders,
13146
+ payload
13147
+ );
13148
+ }
13149
+ createKnowledgeObservation(paramsOrFirst, ...rest) {
13150
+ let params;
13151
+ if (paramsOrFirst && typeof paramsOrFirst === "object" && !Array.isArray(paramsOrFirst)) {
13152
+ params = paramsOrFirst || {};
13153
+ } else {
13154
+ params = {
13155
+ knowledgeId: paramsOrFirst,
13156
+ revision: rest[0],
13157
+ outcome: rest[1],
13158
+ evidence: rest[2],
13159
+ scope: rest[3],
13160
+ userId: rest[4],
13161
+ agentId: rest[5],
13162
+ sessionId: rest[6],
13163
+ runId: rest[7],
13164
+ memorySubStoreId: rest[8],
13165
+ sourceId: rest[9],
13166
+ injectionId: rest[10],
13167
+ verificationSource: rest[11],
13168
+ toolName: rest[12],
13169
+ toolVersion: rest[13],
13170
+ toolSchemaVersion: rest[14],
13171
+ errorFingerprint: rest[15],
13172
+ weight: rest[16],
13173
+ observedAt: rest[17],
13174
+ idempotencyKey: rest[18]
13175
+ };
13176
+ }
13177
+ const knowledgeId = params.knowledgeId;
13178
+ const revision = params.revision;
13179
+ const outcome = params.outcome;
13180
+ const evidence = params.evidence;
13181
+ const scope = params.scope;
13182
+ const userId = params.userId;
13183
+ const agentId = params.agentId;
13184
+ const sessionId = params.sessionId;
13185
+ const runId = params.runId;
13186
+ const memorySubStoreId = params.memorySubStoreId;
13187
+ const sourceId = params.sourceId;
13188
+ const injectionId = params.injectionId;
13189
+ const verificationSource = params.verificationSource;
13190
+ const toolName = params.toolName;
13191
+ const toolVersion = params.toolVersion;
13192
+ const toolSchemaVersion = params.toolSchemaVersion;
13193
+ const errorFingerprint = params.errorFingerprint;
13194
+ const weight = params.weight;
13195
+ const observedAt = params.observedAt;
13196
+ const idempotencyKey = params.idempotencyKey;
13197
+ if (typeof knowledgeId === "undefined") {
13198
+ throw new AppBaseException('Missing required parameter: "knowledgeId"');
13199
+ }
13200
+ if (typeof revision === "undefined") {
13201
+ throw new AppBaseException('Missing required parameter: "revision"');
13202
+ }
13203
+ if (typeof outcome === "undefined") {
13204
+ throw new AppBaseException('Missing required parameter: "outcome"');
13205
+ }
13206
+ if (typeof evidence === "undefined") {
13207
+ throw new AppBaseException('Missing required parameter: "evidence"');
13208
+ }
13209
+ const apiPath = "/memory/memories/observations";
13210
+ const payload = {};
13211
+ if (typeof scope !== "undefined") {
13212
+ payload["scope"] = scope;
13213
+ }
13214
+ if (typeof userId !== "undefined") {
13215
+ payload["userId"] = userId;
13216
+ }
13217
+ if (typeof agentId !== "undefined") {
13218
+ payload["agentId"] = agentId;
13219
+ }
13220
+ if (typeof sessionId !== "undefined") {
13221
+ payload["sessionId"] = sessionId;
13222
+ }
13223
+ if (typeof runId !== "undefined") {
13224
+ payload["runId"] = runId;
13225
+ }
13226
+ if (typeof memorySubStoreId !== "undefined") {
13227
+ payload["memorySubStoreId"] = memorySubStoreId;
13228
+ }
13229
+ if (typeof knowledgeId !== "undefined") {
13230
+ payload["knowledgeId"] = knowledgeId;
13231
+ }
13232
+ if (typeof revision !== "undefined") {
13233
+ payload["revision"] = revision;
13234
+ }
13235
+ if (typeof sourceId !== "undefined") {
13236
+ payload["sourceId"] = sourceId;
13237
+ }
13238
+ if (typeof injectionId !== "undefined") {
13239
+ payload["injectionId"] = injectionId;
13240
+ }
13241
+ if (typeof outcome !== "undefined") {
13242
+ payload["outcome"] = outcome;
13243
+ }
13244
+ if (typeof verificationSource !== "undefined") {
13245
+ payload["verificationSource"] = verificationSource;
13246
+ }
13247
+ if (typeof toolName !== "undefined") {
13248
+ payload["toolName"] = toolName;
13249
+ }
13250
+ if (typeof toolVersion !== "undefined") {
13251
+ payload["toolVersion"] = toolVersion;
13252
+ }
13253
+ if (typeof toolSchemaVersion !== "undefined") {
13254
+ payload["toolSchemaVersion"] = toolSchemaVersion;
13255
+ }
13256
+ if (typeof errorFingerprint !== "undefined") {
13257
+ payload["errorFingerprint"] = errorFingerprint;
13258
+ }
13259
+ if (typeof evidence !== "undefined") {
13260
+ payload["evidence"] = evidence;
13261
+ }
13262
+ if (typeof weight !== "undefined") {
13263
+ payload["weight"] = weight;
13264
+ }
13265
+ if (typeof observedAt !== "undefined") {
13266
+ payload["observedAt"] = observedAt;
13267
+ }
13268
+ if (typeof idempotencyKey !== "undefined") {
13269
+ payload["idempotencyKey"] = idempotencyKey;
13270
+ }
13271
+ const uri = new URL(this.client.config.endpoint + apiPath);
13272
+ const apiHeaders = {
13273
+ "content-type": "application/json"
13274
+ };
13275
+ return this.client.call(
13276
+ "post",
13277
+ uri,
13278
+ apiHeaders,
13279
+ payload
13280
+ );
13281
+ }
13282
+ createProjectionRebuild(paramsOrFirst, ...rest) {
13283
+ let params;
13284
+ if (paramsOrFirst && typeof paramsOrFirst === "object" && !Array.isArray(paramsOrFirst) && ("routes" in paramsOrFirst || "cursor" in paramsOrFirst || "limit" in paramsOrFirst || "dryRun" in paramsOrFirst)) {
13285
+ params = paramsOrFirst || {};
13286
+ } else {
13287
+ params = {
13288
+ routes: paramsOrFirst,
13289
+ cursor: rest[0],
13290
+ limit: rest[1],
13291
+ dryRun: rest[2]
13292
+ };
13293
+ }
13294
+ const routes = params.routes;
13295
+ const cursor = params.cursor;
13296
+ const limit = params.limit;
13297
+ const dryRun = params.dryRun;
13298
+ if (typeof routes === "undefined") {
13299
+ throw new AppBaseException('Missing required parameter: "routes"');
13300
+ }
13301
+ const apiPath = "/memory/memories/projections/rebuild";
13302
+ const payload = {};
13303
+ if (typeof routes !== "undefined") {
13304
+ payload["routes"] = routes;
13305
+ }
13306
+ if (typeof cursor !== "undefined") {
13307
+ payload["cursor"] = cursor;
13308
+ }
13309
+ if (typeof limit !== "undefined") {
13310
+ payload["limit"] = limit;
13311
+ }
13312
+ if (typeof dryRun !== "undefined") {
13313
+ payload["dryRun"] = dryRun;
13314
+ }
13315
+ const uri = new URL(this.client.config.endpoint + apiPath);
13316
+ const apiHeaders = {
13317
+ "content-type": "application/json"
13318
+ };
13319
+ return this.client.call(
13320
+ "post",
13321
+ uri,
13322
+ apiHeaders,
13323
+ payload
13324
+ );
13325
+ }
13326
+ /**
13327
+ * Get project memory projection recovery verification.
13328
+ *
13329
+ * @throws {AppBaseException}
13330
+ * @returns {Promise<{}>}
13331
+ */
13332
+ getProjectionVerification() {
13333
+ const apiPath = "/memory/memories/projections/verification";
13334
+ const payload = {};
13335
+ const uri = new URL(this.client.config.endpoint + apiPath);
13336
+ const apiHeaders = {};
13337
+ return this.client.call(
13338
+ "get",
13339
+ uri,
13340
+ apiHeaders,
13341
+ payload
13342
+ );
13343
+ }
13344
+ /**
13345
+ * Get a memory quality report.
13346
+ *
13347
+ * @throws {AppBaseException}
13348
+ * @returns {Promise<{}>}
13349
+ */
13350
+ getQuality() {
13351
+ const apiPath = "/memory/memories/quality";
13352
+ const payload = {};
13353
+ const uri = new URL(this.client.config.endpoint + apiPath);
13354
+ const apiHeaders = {};
13355
+ return this.client.call(
13356
+ "get",
13357
+ uri,
13358
+ apiHeaders,
13359
+ payload
13360
+ );
13361
+ }
13362
+ recallKnowledge(paramsOrFirst, ...rest) {
13363
+ let params;
13364
+ if (paramsOrFirst && typeof paramsOrFirst === "object" && !Array.isArray(paramsOrFirst)) {
13365
+ params = paramsOrFirst || {};
13366
+ } else {
13367
+ params = {
13368
+ query: paramsOrFirst,
13369
+ scope: rest[0],
13370
+ userId: rest[1],
13371
+ agentId: rest[2],
13372
+ sessionId: rest[3],
13373
+ runId: rest[4],
13374
+ memorySubStoreId: rest[5],
13375
+ kinds: rest[6],
13376
+ limit: rest[7],
13377
+ tokenBudget: rest[8],
13378
+ retrieval: rest[9],
13379
+ accessMode: rest[10]
13380
+ };
13381
+ }
13382
+ const query = params.query;
13383
+ const scope = params.scope;
13384
+ const userId = params.userId;
13385
+ const agentId = params.agentId;
13386
+ const sessionId = params.sessionId;
13387
+ const runId = params.runId;
13388
+ const memorySubStoreId = params.memorySubStoreId;
13389
+ const kinds = params.kinds;
13390
+ const limit = params.limit;
13391
+ const tokenBudget = params.tokenBudget;
13392
+ const retrieval = params.retrieval;
13393
+ const accessMode = params.accessMode;
13394
+ if (typeof query === "undefined") {
13395
+ throw new AppBaseException('Missing required parameter: "query"');
13396
+ }
13397
+ const apiPath = "/memory/memories/recall";
13398
+ const payload = {};
13399
+ if (typeof scope !== "undefined") {
13400
+ payload["scope"] = scope;
13401
+ }
13402
+ if (typeof userId !== "undefined") {
13403
+ payload["userId"] = userId;
13404
+ }
13405
+ if (typeof agentId !== "undefined") {
13406
+ payload["agentId"] = agentId;
13407
+ }
13408
+ if (typeof sessionId !== "undefined") {
13409
+ payload["sessionId"] = sessionId;
13410
+ }
13411
+ if (typeof runId !== "undefined") {
13412
+ payload["runId"] = runId;
13413
+ }
13414
+ if (typeof memorySubStoreId !== "undefined") {
13415
+ payload["memorySubStoreId"] = memorySubStoreId;
13416
+ }
13417
+ if (typeof query !== "undefined") {
13418
+ payload["query"] = query;
13419
+ }
13420
+ if (typeof kinds !== "undefined") {
13421
+ payload["kinds"] = kinds;
13422
+ }
13423
+ if (typeof limit !== "undefined") {
13424
+ payload["limit"] = limit;
13425
+ }
13426
+ if (typeof tokenBudget !== "undefined") {
13427
+ payload["tokenBudget"] = tokenBudget;
13428
+ }
13429
+ if (typeof retrieval !== "undefined") {
13430
+ payload["retrieval"] = retrieval;
13431
+ }
13432
+ if (typeof accessMode !== "undefined") {
13433
+ payload["accessMode"] = accessMode;
13434
+ }
13435
+ const uri = new URL(this.client.config.endpoint + apiPath);
13436
+ const apiHeaders = {
13437
+ "content-type": "application/json"
13438
+ };
13439
+ return this.client.call(
13440
+ "post",
13441
+ uri,
13442
+ apiHeaders,
13443
+ payload
13444
+ );
13445
+ }
13446
+ search(paramsOrFirst, ...rest) {
13447
+ let params;
13448
+ if (paramsOrFirst && typeof paramsOrFirst === "object" && !Array.isArray(paramsOrFirst)) {
13449
+ params = paramsOrFirst || {};
13450
+ } else {
13451
+ params = {
13452
+ query: paramsOrFirst,
13453
+ searchMode: rest[0],
13454
+ retrieval: rest[1],
13455
+ userId: rest[2],
13456
+ agentId: rest[3],
13457
+ runId: rest[4],
13458
+ scope: rest[5],
13459
+ memoryType: rest[6],
13460
+ recordKind: rest[7],
13461
+ filter: rest[8],
13462
+ limit: rest[9],
13463
+ cursor: rest[10],
13464
+ sort: rest[11],
13465
+ memorySubStoreId: rest[12],
13466
+ sessionId: rest[13],
13467
+ groupId: rest[14],
13468
+ accessMode: rest[15]
13469
+ };
13470
+ }
13471
+ const query = params.query;
13472
+ const searchMode = params.searchMode;
13473
+ const retrieval = params.retrieval;
13474
+ const userId = params.userId;
13475
+ const agentId = params.agentId;
13476
+ const runId = params.runId;
13477
+ const scope = params.scope;
13478
+ const memoryType = params.memoryType;
13479
+ const recordKind = params.recordKind;
13480
+ const filter = params.filter;
13481
+ const limit = params.limit;
13482
+ const cursor = params.cursor;
13483
+ const sort = params.sort;
13484
+ const memorySubStoreId = params.memorySubStoreId;
13485
+ const sessionId = params.sessionId;
13486
+ const groupId = params.groupId;
13487
+ const accessMode = params.accessMode;
13488
+ if (typeof query === "undefined") {
13489
+ throw new AppBaseException('Missing required parameter: "query"');
13490
+ }
13491
+ const apiPath = "/memory/memories/search";
13492
+ const payload = {};
13493
+ if (typeof query !== "undefined") {
13494
+ payload["query"] = query;
13495
+ }
13496
+ if (typeof searchMode !== "undefined") {
13497
+ payload["searchMode"] = searchMode;
13498
+ }
13499
+ if (typeof retrieval !== "undefined") {
13500
+ payload["retrieval"] = retrieval;
13501
+ }
13502
+ if (typeof userId !== "undefined") {
13503
+ payload["userId"] = userId;
13504
+ }
13505
+ if (typeof agentId !== "undefined") {
13506
+ payload["agentId"] = agentId;
13507
+ }
13508
+ if (typeof runId !== "undefined") {
13509
+ payload["runId"] = runId;
13510
+ }
13511
+ if (typeof scope !== "undefined") {
13512
+ payload["scope"] = scope;
13513
+ }
13514
+ if (typeof memoryType !== "undefined") {
13515
+ payload["memoryType"] = memoryType;
13516
+ }
13517
+ if (typeof recordKind !== "undefined") {
13518
+ payload["recordKind"] = recordKind;
13519
+ }
13520
+ if (typeof filter !== "undefined") {
13521
+ payload["filter"] = filter;
13522
+ }
13523
+ if (typeof limit !== "undefined") {
13524
+ payload["limit"] = limit;
13525
+ }
13526
+ if (typeof cursor !== "undefined") {
13527
+ payload["cursor"] = cursor;
13528
+ }
13529
+ if (typeof sort !== "undefined") {
13530
+ payload["sort"] = sort;
13531
+ }
13532
+ if (typeof memorySubStoreId !== "undefined") {
13533
+ payload["memorySubStoreId"] = memorySubStoreId;
13534
+ }
13535
+ if (typeof sessionId !== "undefined") {
13536
+ payload["sessionId"] = sessionId;
13537
+ }
13538
+ if (typeof groupId !== "undefined") {
13539
+ payload["groupId"] = groupId;
13540
+ }
13541
+ if (typeof accessMode !== "undefined") {
13542
+ payload["accessMode"] = accessMode;
13543
+ }
13544
+ const uri = new URL(this.client.config.endpoint + apiPath);
13545
+ const apiHeaders = {
13546
+ "content-type": "application/json"
13547
+ };
13548
+ return this.client.call(
13549
+ "post",
13550
+ uri,
13551
+ apiHeaders,
13552
+ payload
13553
+ );
13554
+ }
13555
+ /**
13556
+ * Get memory session aggregates.
13557
+ *
13558
+ * @throws {AppBaseException}
13559
+ * @returns {Promise<{}>}
13560
+ */
13561
+ getSessions() {
13562
+ const apiPath = "/memory/memories/sessions";
13563
+ const payload = {};
13564
+ const uri = new URL(this.client.config.endpoint + apiPath);
13565
+ const apiHeaders = {};
13566
+ return this.client.call(
13567
+ "get",
13568
+ uri,
13569
+ apiHeaders,
13570
+ payload
13571
+ );
13572
+ }
13573
+ listSkills(paramsOrFirst, ...rest) {
13574
+ let params;
13575
+ if (!paramsOrFirst || paramsOrFirst && typeof paramsOrFirst === "object" && !Array.isArray(paramsOrFirst) && ("scope" in paramsOrFirst || "userId" in paramsOrFirst || "agentId" in paramsOrFirst || "sessionId" in paramsOrFirst || "runId" in paramsOrFirst || "memorySubStoreId" in paramsOrFirst || "cursor" in paramsOrFirst || "limit" in paramsOrFirst)) {
13576
+ params = paramsOrFirst || {};
13577
+ } else {
13578
+ params = {
13579
+ scope: paramsOrFirst,
13580
+ userId: rest[0],
13581
+ agentId: rest[1],
13582
+ sessionId: rest[2],
13583
+ runId: rest[3],
13584
+ memorySubStoreId: rest[4],
13585
+ cursor: rest[5],
13586
+ limit: rest[6]
13587
+ };
13588
+ }
13589
+ const scope = params.scope;
13590
+ const userId = params.userId;
13591
+ const agentId = params.agentId;
13592
+ const sessionId = params.sessionId;
13593
+ const runId = params.runId;
13594
+ const memorySubStoreId = params.memorySubStoreId;
13595
+ const cursor = params.cursor;
13596
+ const limit = params.limit;
13597
+ const apiPath = "/memory/memories/skills";
13598
+ const payload = {};
13599
+ if (typeof scope !== "undefined") {
13600
+ payload["scope"] = scope;
13601
+ }
13602
+ if (typeof userId !== "undefined") {
13603
+ payload["userId"] = userId;
13604
+ }
13605
+ if (typeof agentId !== "undefined") {
13606
+ payload["agentId"] = agentId;
13607
+ }
13608
+ if (typeof sessionId !== "undefined") {
13609
+ payload["sessionId"] = sessionId;
13610
+ }
13611
+ if (typeof runId !== "undefined") {
13612
+ payload["runId"] = runId;
13613
+ }
13614
+ if (typeof memorySubStoreId !== "undefined") {
13615
+ payload["memorySubStoreId"] = memorySubStoreId;
13616
+ }
13617
+ if (typeof cursor !== "undefined") {
13618
+ payload["cursor"] = cursor;
13619
+ }
13620
+ if (typeof limit !== "undefined") {
13621
+ payload["limit"] = limit;
13622
+ }
13623
+ const uri = new URL(this.client.config.endpoint + apiPath);
13624
+ const apiHeaders = {};
13625
+ return this.client.call(
13626
+ "get",
13627
+ uri,
13628
+ apiHeaders,
13629
+ payload
13630
+ );
13631
+ }
13632
+ searchSkills(paramsOrFirst, ...rest) {
13633
+ let params;
13634
+ if (paramsOrFirst && typeof paramsOrFirst === "object" && !Array.isArray(paramsOrFirst)) {
13635
+ params = paramsOrFirst || {};
13636
+ } else {
13637
+ params = {
13638
+ query: paramsOrFirst,
13639
+ scope: rest[0],
13640
+ userId: rest[1],
13641
+ agentId: rest[2],
13642
+ sessionId: rest[3],
13643
+ runId: rest[4],
13644
+ memorySubStoreId: rest[5],
13645
+ cursor: rest[6],
13646
+ limit: rest[7],
13647
+ retrieval: rest[8]
13648
+ };
13649
+ }
13650
+ const query = params.query;
13651
+ const scope = params.scope;
13652
+ const userId = params.userId;
13653
+ const agentId = params.agentId;
13654
+ const sessionId = params.sessionId;
13655
+ const runId = params.runId;
13656
+ const memorySubStoreId = params.memorySubStoreId;
13657
+ const cursor = params.cursor;
13658
+ const limit = params.limit;
13659
+ const retrieval = params.retrieval;
13660
+ if (typeof query === "undefined") {
13661
+ throw new AppBaseException('Missing required parameter: "query"');
13662
+ }
13663
+ const apiPath = "/memory/memories/skills/search";
13664
+ const payload = {};
13665
+ if (typeof scope !== "undefined") {
13666
+ payload["scope"] = scope;
13667
+ }
13668
+ if (typeof userId !== "undefined") {
13669
+ payload["userId"] = userId;
13670
+ }
13671
+ if (typeof agentId !== "undefined") {
13672
+ payload["agentId"] = agentId;
13673
+ }
13674
+ if (typeof sessionId !== "undefined") {
13675
+ payload["sessionId"] = sessionId;
13676
+ }
13677
+ if (typeof runId !== "undefined") {
13678
+ payload["runId"] = runId;
13679
+ }
13680
+ if (typeof memorySubStoreId !== "undefined") {
13681
+ payload["memorySubStoreId"] = memorySubStoreId;
13682
+ }
13683
+ if (typeof query !== "undefined") {
13684
+ payload["query"] = query;
13685
+ }
13686
+ if (typeof cursor !== "undefined") {
13687
+ payload["cursor"] = cursor;
13688
+ }
13689
+ if (typeof limit !== "undefined") {
13690
+ payload["limit"] = limit;
13691
+ }
13692
+ if (typeof retrieval !== "undefined") {
13693
+ payload["retrieval"] = retrieval;
13694
+ }
13695
+ const uri = new URL(this.client.config.endpoint + apiPath);
13696
+ const apiHeaders = {
13697
+ "content-type": "application/json"
13698
+ };
13699
+ return this.client.call(
13700
+ "post",
13701
+ uri,
13702
+ apiHeaders,
13703
+ payload
13704
+ );
13705
+ }
13706
+ getSkill(paramsOrFirst, ...rest) {
13707
+ let params;
13708
+ if (paramsOrFirst && typeof paramsOrFirst === "object" && !Array.isArray(paramsOrFirst)) {
13709
+ params = paramsOrFirst || {};
13710
+ } else {
13711
+ params = {
13712
+ knowledgeId: paramsOrFirst,
13713
+ scope: rest[0],
13714
+ userId: rest[1],
13715
+ agentId: rest[2],
13716
+ sessionId: rest[3],
13717
+ runId: rest[4],
13718
+ memorySubStoreId: rest[5]
13719
+ };
13720
+ }
13721
+ const knowledgeId = params.knowledgeId;
13722
+ const scope = params.scope;
13723
+ const userId = params.userId;
13724
+ const agentId = params.agentId;
13725
+ const sessionId = params.sessionId;
13726
+ const runId = params.runId;
13727
+ const memorySubStoreId = params.memorySubStoreId;
13728
+ if (typeof knowledgeId === "undefined") {
13729
+ throw new AppBaseException('Missing required parameter: "knowledgeId"');
13730
+ }
13731
+ const apiPath = "/memory/memories/skills/{knowledgeId}".replace("{knowledgeId}", knowledgeId);
13732
+ const payload = {};
13733
+ if (typeof scope !== "undefined") {
13734
+ payload["scope"] = scope;
13735
+ }
13736
+ if (typeof userId !== "undefined") {
13737
+ payload["userId"] = userId;
13738
+ }
13739
+ if (typeof agentId !== "undefined") {
13740
+ payload["agentId"] = agentId;
13741
+ }
13742
+ if (typeof sessionId !== "undefined") {
13743
+ payload["sessionId"] = sessionId;
13744
+ }
13745
+ if (typeof runId !== "undefined") {
13746
+ payload["runId"] = runId;
13747
+ }
13748
+ if (typeof memorySubStoreId !== "undefined") {
13749
+ payload["memorySubStoreId"] = memorySubStoreId;
13750
+ }
13751
+ const uri = new URL(this.client.config.endpoint + apiPath);
13752
+ const apiHeaders = {};
13753
+ return this.client.call(
13754
+ "get",
13755
+ uri,
13756
+ apiHeaders,
13757
+ payload
13758
+ );
13759
+ }
13760
+ listSkillSources(paramsOrFirst, ...rest) {
13761
+ let params;
13762
+ if (paramsOrFirst && typeof paramsOrFirst === "object" && !Array.isArray(paramsOrFirst)) {
13763
+ params = paramsOrFirst || {};
13764
+ } else {
13765
+ params = {
13766
+ knowledgeId: paramsOrFirst,
13767
+ scope: rest[0],
13768
+ userId: rest[1],
13769
+ agentId: rest[2],
13770
+ sessionId: rest[3],
13771
+ runId: rest[4],
13772
+ memorySubStoreId: rest[5],
13773
+ cursor: rest[6],
13774
+ limit: rest[7]
13775
+ };
13776
+ }
13777
+ const knowledgeId = params.knowledgeId;
13778
+ const scope = params.scope;
13779
+ const userId = params.userId;
13780
+ const agentId = params.agentId;
13781
+ const sessionId = params.sessionId;
13782
+ const runId = params.runId;
13783
+ const memorySubStoreId = params.memorySubStoreId;
13784
+ const cursor = params.cursor;
13785
+ const limit = params.limit;
13786
+ if (typeof knowledgeId === "undefined") {
13787
+ throw new AppBaseException('Missing required parameter: "knowledgeId"');
13788
+ }
13789
+ const apiPath = "/memory/memories/skills/{knowledgeId}/sources".replace("{knowledgeId}", knowledgeId);
13790
+ const payload = {};
13791
+ if (typeof scope !== "undefined") {
13792
+ payload["scope"] = scope;
13793
+ }
13794
+ if (typeof userId !== "undefined") {
13795
+ payload["userId"] = userId;
13796
+ }
13797
+ if (typeof agentId !== "undefined") {
13798
+ payload["agentId"] = agentId;
13799
+ }
13800
+ if (typeof sessionId !== "undefined") {
13801
+ payload["sessionId"] = sessionId;
13802
+ }
13803
+ if (typeof runId !== "undefined") {
13804
+ payload["runId"] = runId;
13805
+ }
13806
+ if (typeof memorySubStoreId !== "undefined") {
13807
+ payload["memorySubStoreId"] = memorySubStoreId;
13808
+ }
13809
+ if (typeof cursor !== "undefined") {
13810
+ payload["cursor"] = cursor;
13811
+ }
13812
+ if (typeof limit !== "undefined") {
13813
+ payload["limit"] = limit;
13814
+ }
13815
+ const uri = new URL(this.client.config.endpoint + apiPath);
13816
+ const apiHeaders = {};
13817
+ return this.client.call(
13818
+ "get",
13819
+ uri,
13820
+ apiHeaders,
13821
+ payload
13822
+ );
13823
+ }
13824
+ /**
13825
+ * Get memory statistics visible to the current caller.
13826
+ *
13827
+ * @throws {AppBaseException}
13828
+ * @returns {Promise<{}>}
13829
+ */
13830
+ getStats() {
13831
+ const apiPath = "/memory/memories/stats";
13832
+ const payload = {};
13833
+ const uri = new URL(this.client.config.endpoint + apiPath);
13834
+ const apiHeaders = {};
13835
+ return this.client.call(
13836
+ "get",
13837
+ uri,
13838
+ apiHeaders,
13839
+ payload
13840
+ );
13841
+ }
13842
+ /**
13843
+ * Get a memory activity timeline.
13844
+ *
13845
+ * @throws {AppBaseException}
13846
+ * @returns {Promise<{}>}
13847
+ */
13848
+ getTimeline() {
13849
+ const apiPath = "/memory/memories/timeline";
13850
+ const payload = {};
13851
+ const uri = new URL(this.client.config.endpoint + apiPath);
13852
+ const apiHeaders = {};
13853
+ return this.client.call(
13854
+ "get",
13855
+ uri,
13856
+ apiHeaders,
13857
+ payload
13858
+ );
13859
+ }
13860
+ getProfile(paramsOrFirst, ...rest) {
13861
+ let params;
13862
+ if (paramsOrFirst && typeof paramsOrFirst === "object" && !Array.isArray(paramsOrFirst)) {
13863
+ params = paramsOrFirst || {};
13864
+ } else {
13865
+ params = {
13866
+ userId: paramsOrFirst,
13867
+ profileType: rest[0]
13868
+ };
13869
+ }
13870
+ const userId = params.userId;
13871
+ const profileType = params.profileType;
13872
+ if (typeof userId === "undefined") {
13873
+ throw new AppBaseException('Missing required parameter: "userId"');
13874
+ }
13875
+ const apiPath = "/memory/memories/users/{userId}/profile".replace("{userId}", userId);
13876
+ const payload = {};
13877
+ if (typeof profileType !== "undefined") {
13878
+ payload["profileType"] = profileType;
13879
+ }
13880
+ const uri = new URL(this.client.config.endpoint + apiPath);
13881
+ const apiHeaders = {};
13882
+ return this.client.call(
13883
+ "get",
13884
+ uri,
13885
+ apiHeaders,
13886
+ payload
13887
+ );
13888
+ }
13889
+ deleteProfile(paramsOrFirst, ...rest) {
13890
+ let params;
13891
+ if (paramsOrFirst && typeof paramsOrFirst === "object" && !Array.isArray(paramsOrFirst)) {
13892
+ params = paramsOrFirst || {};
13893
+ } else {
13894
+ params = {
13895
+ userId: paramsOrFirst,
13896
+ profileType: rest[0],
13897
+ reason: rest[1],
13898
+ source: rest[2]
13899
+ };
13900
+ }
13901
+ const userId = params.userId;
13902
+ const profileType = params.profileType;
13903
+ const reason = params.reason;
13904
+ const source = params.source;
13905
+ if (typeof userId === "undefined") {
13906
+ throw new AppBaseException('Missing required parameter: "userId"');
13907
+ }
13908
+ const apiPath = "/memory/memories/users/{userId}/profile".replace("{userId}", userId);
13909
+ const payload = {};
13910
+ if (typeof profileType !== "undefined") {
13911
+ payload["profileType"] = profileType;
13912
+ }
13913
+ if (typeof reason !== "undefined") {
13914
+ payload["reason"] = reason;
13915
+ }
13916
+ if (typeof source !== "undefined") {
13917
+ payload["source"] = source;
13918
+ }
13919
+ const uri = new URL(this.client.config.endpoint + apiPath);
13920
+ const apiHeaders = {
13921
+ "content-type": "application/json"
13922
+ };
13923
+ return this.client.call(
13924
+ "delete",
13925
+ uri,
13926
+ apiHeaders,
13927
+ payload
13928
+ );
13929
+ }
13930
+ createProfileExtraction(paramsOrFirst, ...rest) {
13931
+ let params;
13932
+ if (paramsOrFirst && typeof paramsOrFirst === "object" && !Array.isArray(paramsOrFirst)) {
13933
+ params = paramsOrFirst || {};
13934
+ } else {
13935
+ params = {
13936
+ userId: paramsOrFirst,
13937
+ profileType: rest[0],
13938
+ messages: rest[1],
13939
+ sourceMemoryIds: rest[2],
13940
+ mode: rest[3]
13941
+ };
13942
+ }
13943
+ const userId = params.userId;
13944
+ const profileType = params.profileType;
13945
+ const messages = params.messages;
13946
+ const sourceMemoryIds = params.sourceMemoryIds;
13947
+ const mode = params.mode;
13948
+ if (typeof userId === "undefined") {
13949
+ throw new AppBaseException('Missing required parameter: "userId"');
13950
+ }
13951
+ const apiPath = "/memory/memories/users/{userId}/profile/extractions".replace("{userId}", userId);
13952
+ const payload = {};
13953
+ if (typeof profileType !== "undefined") {
13954
+ payload["profileType"] = profileType;
13955
+ }
13956
+ if (typeof messages !== "undefined") {
13957
+ payload["messages"] = messages;
13958
+ }
13959
+ if (typeof sourceMemoryIds !== "undefined") {
13960
+ payload["sourceMemoryIds"] = sourceMemoryIds;
13961
+ }
13962
+ if (typeof mode !== "undefined") {
13963
+ payload["mode"] = mode;
13964
+ }
13965
+ const uri = new URL(this.client.config.endpoint + apiPath);
13966
+ const apiHeaders = {
13967
+ "content-type": "application/json"
13968
+ };
13969
+ return this.client.call(
13970
+ "post",
13971
+ uri,
13972
+ apiHeaders,
13973
+ payload
13974
+ );
13975
+ }
13976
+ createProfileRebuild(paramsOrFirst, ...rest) {
13977
+ let params;
13978
+ if (paramsOrFirst && typeof paramsOrFirst === "object" && !Array.isArray(paramsOrFirst)) {
13979
+ params = paramsOrFirst || {};
13980
+ } else {
13981
+ params = {
13982
+ userId: paramsOrFirst,
13983
+ profileType: rest[0]
13984
+ };
13985
+ }
13986
+ const userId = params.userId;
13987
+ const profileType = params.profileType;
13988
+ if (typeof userId === "undefined") {
13989
+ throw new AppBaseException('Missing required parameter: "userId"');
13990
+ }
13991
+ const apiPath = "/memory/memories/users/{userId}/profile/rebuild".replace("{userId}", userId);
13992
+ const payload = {};
13993
+ if (typeof profileType !== "undefined") {
13994
+ payload["profileType"] = profileType;
13995
+ }
13996
+ const uri = new URL(this.client.config.endpoint + apiPath);
13997
+ const apiHeaders = {
13998
+ "content-type": "application/json"
13999
+ };
14000
+ return this.client.call(
14001
+ "post",
14002
+ uri,
14003
+ apiHeaders,
14004
+ payload
14005
+ );
14006
+ }
14007
+ listProfileSources(paramsOrFirst, ...rest) {
14008
+ let params;
14009
+ if (paramsOrFirst && typeof paramsOrFirst === "object" && !Array.isArray(paramsOrFirst)) {
14010
+ params = paramsOrFirst || {};
14011
+ } else {
14012
+ params = {
14013
+ userId: paramsOrFirst,
14014
+ profileType: rest[0]
14015
+ };
14016
+ }
14017
+ const userId = params.userId;
14018
+ const profileType = params.profileType;
14019
+ if (typeof userId === "undefined") {
14020
+ throw new AppBaseException('Missing required parameter: "userId"');
14021
+ }
14022
+ const apiPath = "/memory/memories/users/{userId}/profile/sources".replace("{userId}", userId);
14023
+ const payload = {};
14024
+ if (typeof profileType !== "undefined") {
14025
+ payload["profileType"] = profileType;
14026
+ }
14027
+ const uri = new URL(this.client.config.endpoint + apiPath);
14028
+ const apiHeaders = {};
14029
+ return this.client.call(
14030
+ "get",
14031
+ uri,
14032
+ apiHeaders,
14033
+ payload
14034
+ );
14035
+ }
14036
+ get(paramsOrFirst) {
14037
+ let params;
14038
+ if (paramsOrFirst && typeof paramsOrFirst === "object" && !Array.isArray(paramsOrFirst)) {
14039
+ params = paramsOrFirst || {};
14040
+ } else {
14041
+ params = {
14042
+ memoryId: paramsOrFirst
14043
+ };
14044
+ }
14045
+ const memoryId = params.memoryId;
14046
+ if (typeof memoryId === "undefined") {
14047
+ throw new AppBaseException('Missing required parameter: "memoryId"');
14048
+ }
14049
+ const apiPath = "/memory/memories/{memoryId}".replace("{memoryId}", memoryId);
14050
+ const payload = {};
14051
+ const uri = new URL(this.client.config.endpoint + apiPath);
14052
+ const apiHeaders = {};
14053
+ return this.client.call(
14054
+ "get",
14055
+ uri,
14056
+ apiHeaders,
14057
+ payload
14058
+ );
14059
+ }
14060
+ update(paramsOrFirst, ...rest) {
14061
+ let params;
14062
+ if (paramsOrFirst && typeof paramsOrFirst === "object" && !Array.isArray(paramsOrFirst)) {
14063
+ params = paramsOrFirst || {};
14064
+ } else {
14065
+ params = {
14066
+ memoryId: paramsOrFirst,
14067
+ version: rest[0],
14068
+ content: rest[1],
14069
+ metadata: rest[2],
14070
+ retentionPolicy: rest[3]
14071
+ };
14072
+ }
14073
+ const memoryId = params.memoryId;
14074
+ const version = params.version;
14075
+ const content = params.content;
14076
+ const metadata = params.metadata;
14077
+ const retentionPolicy = params.retentionPolicy;
14078
+ if (typeof memoryId === "undefined") {
14079
+ throw new AppBaseException('Missing required parameter: "memoryId"');
14080
+ }
14081
+ if (typeof version === "undefined") {
14082
+ throw new AppBaseException('Missing required parameter: "version"');
14083
+ }
14084
+ const apiPath = "/memory/memories/{memoryId}".replace("{memoryId}", memoryId);
14085
+ const payload = {};
14086
+ if (typeof version !== "undefined") {
14087
+ payload["version"] = version;
14088
+ }
14089
+ if (typeof content !== "undefined") {
14090
+ payload["content"] = content;
14091
+ }
14092
+ if (typeof metadata !== "undefined") {
14093
+ payload["metadata"] = metadata;
14094
+ }
14095
+ if (typeof retentionPolicy !== "undefined") {
14096
+ payload["retentionPolicy"] = retentionPolicy;
14097
+ }
14098
+ const uri = new URL(this.client.config.endpoint + apiPath);
14099
+ const apiHeaders = {
14100
+ "content-type": "application/json"
14101
+ };
14102
+ return this.client.call(
14103
+ "patch",
14104
+ uri,
14105
+ apiHeaders,
14106
+ payload
14107
+ );
14108
+ }
14109
+ delete(paramsOrFirst, ...rest) {
14110
+ let params;
14111
+ if (paramsOrFirst && typeof paramsOrFirst === "object" && !Array.isArray(paramsOrFirst)) {
14112
+ params = paramsOrFirst || {};
14113
+ } else {
14114
+ params = {
14115
+ memoryId: paramsOrFirst,
14116
+ reason: rest[0],
14117
+ source: rest[1]
14118
+ };
14119
+ }
14120
+ const memoryId = params.memoryId;
14121
+ const reason = params.reason;
14122
+ const source = params.source;
14123
+ if (typeof memoryId === "undefined") {
14124
+ throw new AppBaseException('Missing required parameter: "memoryId"');
14125
+ }
14126
+ const apiPath = "/memory/memories/{memoryId}".replace("{memoryId}", memoryId);
14127
+ const payload = {};
14128
+ if (typeof reason !== "undefined") {
14129
+ payload["reason"] = reason;
14130
+ }
14131
+ if (typeof source !== "undefined") {
14132
+ payload["source"] = source;
14133
+ }
14134
+ const uri = new URL(this.client.config.endpoint + apiPath);
14135
+ const apiHeaders = {
14136
+ "content-type": "application/json"
14137
+ };
14138
+ return this.client.call(
14139
+ "delete",
14140
+ uri,
14141
+ apiHeaders,
14142
+ payload
14143
+ );
14144
+ }
14145
+ listShares(paramsOrFirst) {
14146
+ let params;
14147
+ if (paramsOrFirst && typeof paramsOrFirst === "object" && !Array.isArray(paramsOrFirst)) {
14148
+ params = paramsOrFirst || {};
14149
+ } else {
14150
+ params = {
14151
+ memoryId: paramsOrFirst
14152
+ };
14153
+ }
14154
+ const memoryId = params.memoryId;
14155
+ if (typeof memoryId === "undefined") {
14156
+ throw new AppBaseException('Missing required parameter: "memoryId"');
14157
+ }
14158
+ const apiPath = "/memory/memories/{memoryId}/shares".replace("{memoryId}", memoryId);
14159
+ const payload = {};
14160
+ const uri = new URL(this.client.config.endpoint + apiPath);
14161
+ const apiHeaders = {};
14162
+ return this.client.call(
14163
+ "get",
14164
+ uri,
14165
+ apiHeaders,
14166
+ payload
14167
+ );
14168
+ }
14169
+ createShare(paramsOrFirst, ...rest) {
14170
+ let params;
14171
+ if (paramsOrFirst && typeof paramsOrFirst === "object" && !Array.isArray(paramsOrFirst)) {
14172
+ params = paramsOrFirst || {};
14173
+ } else {
14174
+ params = {
14175
+ memoryId: paramsOrFirst,
14176
+ subjectType: rest[0],
14177
+ subjectId: rest[1],
14178
+ expiresAt: rest[2]
14179
+ };
14180
+ }
14181
+ const memoryId = params.memoryId;
14182
+ const subjectType = params.subjectType;
14183
+ const subjectId = params.subjectId;
14184
+ const expiresAt = params.expiresAt;
14185
+ if (typeof memoryId === "undefined") {
14186
+ throw new AppBaseException('Missing required parameter: "memoryId"');
14187
+ }
14188
+ if (typeof subjectType === "undefined") {
14189
+ throw new AppBaseException('Missing required parameter: "subjectType"');
14190
+ }
14191
+ if (typeof subjectId === "undefined") {
14192
+ throw new AppBaseException('Missing required parameter: "subjectId"');
14193
+ }
14194
+ const apiPath = "/memory/memories/{memoryId}/shares".replace("{memoryId}", memoryId);
14195
+ const payload = {};
14196
+ if (typeof subjectType !== "undefined") {
14197
+ payload["subjectType"] = subjectType;
14198
+ }
14199
+ if (typeof subjectId !== "undefined") {
14200
+ payload["subjectId"] = subjectId;
14201
+ }
14202
+ if (typeof expiresAt !== "undefined") {
14203
+ payload["expiresAt"] = expiresAt;
14204
+ }
14205
+ const uri = new URL(this.client.config.endpoint + apiPath);
14206
+ const apiHeaders = {
14207
+ "content-type": "application/json"
14208
+ };
14209
+ return this.client.call(
14210
+ "post",
14211
+ uri,
14212
+ apiHeaders,
14213
+ payload
14214
+ );
14215
+ }
14216
+ deleteShare(paramsOrFirst, ...rest) {
14217
+ let params;
14218
+ if (paramsOrFirst && typeof paramsOrFirst === "object" && !Array.isArray(paramsOrFirst)) {
14219
+ params = paramsOrFirst || {};
14220
+ } else {
14221
+ params = {
14222
+ memoryId: paramsOrFirst,
14223
+ shareId: rest[0]
14224
+ };
14225
+ }
14226
+ const memoryId = params.memoryId;
14227
+ const shareId = params.shareId;
14228
+ if (typeof memoryId === "undefined") {
14229
+ throw new AppBaseException('Missing required parameter: "memoryId"');
14230
+ }
14231
+ if (typeof shareId === "undefined") {
14232
+ throw new AppBaseException('Missing required parameter: "shareId"');
14233
+ }
14234
+ const apiPath = "/memory/memories/{memoryId}/shares/{shareId}".replace("{memoryId}", memoryId).replace("{shareId}", shareId);
14235
+ const payload = {};
14236
+ const uri = new URL(this.client.config.endpoint + apiPath);
14237
+ const apiHeaders = {
14238
+ "content-type": "application/json"
14239
+ };
14240
+ return this.client.call(
14241
+ "delete",
14242
+ uri,
14243
+ apiHeaders,
14244
+ payload
14245
+ );
14246
+ }
14247
+ listSources(paramsOrFirst, ...rest) {
14248
+ let params;
14249
+ if (paramsOrFirst && typeof paramsOrFirst === "object" && !Array.isArray(paramsOrFirst)) {
14250
+ params = paramsOrFirst || {};
14251
+ } else {
14252
+ params = {
14253
+ memoryId: paramsOrFirst,
14254
+ cursor: rest[0],
14255
+ limit: rest[1]
14256
+ };
14257
+ }
14258
+ const memoryId = params.memoryId;
14259
+ const cursor = params.cursor;
14260
+ const limit = params.limit;
14261
+ if (typeof memoryId === "undefined") {
14262
+ throw new AppBaseException('Missing required parameter: "memoryId"');
14263
+ }
14264
+ const apiPath = "/memory/memories/{memoryId}/sources".replace("{memoryId}", memoryId);
14265
+ const payload = {};
14266
+ if (typeof cursor !== "undefined") {
14267
+ payload["cursor"] = cursor;
14268
+ }
14269
+ if (typeof limit !== "undefined") {
14270
+ payload["limit"] = limit;
14271
+ }
14272
+ const uri = new URL(this.client.config.endpoint + apiPath);
14273
+ const apiHeaders = {};
14274
+ return this.client.call(
14275
+ "get",
14276
+ uri,
14277
+ apiHeaders,
14278
+ payload
14279
+ );
14280
+ }
14281
+ };
14282
+
14283
+ // ../../node_modules/@alipay/appbase-node-sdk/dist/services/tables-db.mjs
14284
+ var TablesDB = class {
14285
+ constructor(client) {
14286
+ this.client = client;
14287
+ }
14288
+ list(paramsOrFirst, ...rest) {
14289
+ let params;
14290
+ if (!paramsOrFirst || paramsOrFirst && typeof paramsOrFirst === "object" && !Array.isArray(paramsOrFirst)) {
14291
+ params = paramsOrFirst || {};
14292
+ } else {
14293
+ params = {
14294
+ queries: paramsOrFirst,
14295
+ search: rest[0],
14296
+ total: rest[1]
14297
+ };
14298
+ }
14299
+ const queries = params.queries;
14300
+ const search = params.search;
14301
+ const total = params.total;
14302
+ const apiPath = "/tablesdb";
14303
+ const payload = {};
14304
+ if (typeof queries !== "undefined") {
14305
+ payload["queries"] = queries;
14306
+ }
14307
+ if (typeof search !== "undefined") {
14308
+ payload["search"] = search;
14309
+ }
14310
+ if (typeof total !== "undefined") {
14311
+ payload["total"] = total;
14312
+ }
14313
+ const uri = new URL(this.client.config.endpoint + apiPath);
14314
+ const apiHeaders = {};
14315
+ return this.client.call(
14316
+ "get",
14317
+ uri,
14318
+ apiHeaders,
14319
+ payload
14320
+ );
14321
+ }
14322
+ create(paramsOrFirst, ...rest) {
14323
+ let params;
14324
+ if (paramsOrFirst && typeof paramsOrFirst === "object" && !Array.isArray(paramsOrFirst)) {
14325
+ params = paramsOrFirst || {};
14326
+ } else {
14327
+ params = {
14328
+ databaseId: paramsOrFirst,
14329
+ name: rest[0],
14330
+ enabled: rest[1]
14331
+ };
14332
+ }
14333
+ const databaseId = params.databaseId;
14334
+ const name = params.name;
14335
+ const enabled = params.enabled;
14336
+ if (typeof databaseId === "undefined") {
14337
+ throw new AppBaseException('Missing required parameter: "databaseId"');
14338
+ }
14339
+ if (typeof name === "undefined") {
14340
+ throw new AppBaseException('Missing required parameter: "name"');
14341
+ }
14342
+ const apiPath = "/tablesdb";
14343
+ const payload = {};
14344
+ if (typeof databaseId !== "undefined") {
14345
+ payload["databaseId"] = databaseId;
14346
+ }
14347
+ if (typeof name !== "undefined") {
14348
+ payload["name"] = name;
14349
+ }
14350
+ if (typeof enabled !== "undefined") {
14351
+ payload["enabled"] = enabled;
14352
+ }
14353
+ const uri = new URL(this.client.config.endpoint + apiPath);
14354
+ const apiHeaders = {
14355
+ "content-type": "application/json"
14356
+ };
14357
+ return this.client.call(
14358
+ "post",
14359
+ uri,
14360
+ apiHeaders,
14361
+ payload
14362
+ );
14363
+ }
14364
+ listTransactions(paramsOrFirst) {
14365
+ let params;
14366
+ if (!paramsOrFirst || paramsOrFirst && typeof paramsOrFirst === "object" && !Array.isArray(paramsOrFirst)) {
14367
+ params = paramsOrFirst || {};
14368
+ } else {
14369
+ params = {
14370
+ queries: paramsOrFirst
14371
+ };
14372
+ }
14373
+ const queries = params.queries;
14374
+ const apiPath = "/tablesdb/transactions";
14375
+ const payload = {};
14376
+ if (typeof queries !== "undefined") {
14377
+ payload["queries"] = queries;
14378
+ }
14379
+ const uri = new URL(this.client.config.endpoint + apiPath);
14380
+ const apiHeaders = {};
14381
+ return this.client.call(
14382
+ "get",
14383
+ uri,
14384
+ apiHeaders,
14385
+ payload
14386
+ );
14387
+ }
14388
+ createTransaction(paramsOrFirst) {
14389
+ let params;
14390
+ if (!paramsOrFirst || paramsOrFirst && typeof paramsOrFirst === "object" && !Array.isArray(paramsOrFirst)) {
14391
+ params = paramsOrFirst || {};
14392
+ } else {
14393
+ params = {
14394
+ ttl: paramsOrFirst
14395
+ };
14396
+ }
14397
+ const ttl = params.ttl;
14398
+ const apiPath = "/tablesdb/transactions";
14399
+ const payload = {};
14400
+ if (typeof ttl !== "undefined") {
14401
+ payload["ttl"] = ttl;
14402
+ }
14403
+ const uri = new URL(this.client.config.endpoint + apiPath);
14404
+ const apiHeaders = {
14405
+ "content-type": "application/json"
14406
+ };
14407
+ return this.client.call(
14408
+ "post",
14409
+ uri,
14410
+ apiHeaders,
14411
+ payload
14412
+ );
14413
+ }
14414
+ getTransaction(paramsOrFirst) {
14415
+ let params;
14416
+ if (paramsOrFirst && typeof paramsOrFirst === "object" && !Array.isArray(paramsOrFirst)) {
14417
+ params = paramsOrFirst || {};
14418
+ } else {
14419
+ params = {
14420
+ transactionId: paramsOrFirst
14421
+ };
14422
+ }
14423
+ const transactionId = params.transactionId;
14424
+ if (typeof transactionId === "undefined") {
14425
+ throw new AppBaseException('Missing required parameter: "transactionId"');
14426
+ }
14427
+ const apiPath = "/tablesdb/transactions/{transactionId}".replace("{transactionId}", transactionId);
14428
+ const payload = {};
14429
+ const uri = new URL(this.client.config.endpoint + apiPath);
14430
+ const apiHeaders = {};
14431
+ return this.client.call(
14432
+ "get",
14433
+ uri,
14434
+ apiHeaders,
14435
+ payload
14436
+ );
14437
+ }
14438
+ updateTransaction(paramsOrFirst, ...rest) {
14439
+ let params;
14440
+ if (paramsOrFirst && typeof paramsOrFirst === "object" && !Array.isArray(paramsOrFirst)) {
14441
+ params = paramsOrFirst || {};
14442
+ } else {
14443
+ params = {
14444
+ transactionId: paramsOrFirst,
14445
+ commit: rest[0],
14446
+ rollback: rest[1]
14447
+ };
14448
+ }
14449
+ const transactionId = params.transactionId;
14450
+ const commit = params.commit;
14451
+ const rollback = params.rollback;
14452
+ if (typeof transactionId === "undefined") {
14453
+ throw new AppBaseException('Missing required parameter: "transactionId"');
14454
+ }
14455
+ const apiPath = "/tablesdb/transactions/{transactionId}".replace("{transactionId}", transactionId);
14456
+ const payload = {};
14457
+ if (typeof commit !== "undefined") {
14458
+ payload["commit"] = commit;
14459
+ }
14460
+ if (typeof rollback !== "undefined") {
14461
+ payload["rollback"] = rollback;
14462
+ }
14463
+ const uri = new URL(this.client.config.endpoint + apiPath);
14464
+ const apiHeaders = {
14465
+ "content-type": "application/json"
14466
+ };
14467
+ return this.client.call(
14468
+ "patch",
14469
+ uri,
14470
+ apiHeaders,
14471
+ payload
14472
+ );
14473
+ }
14474
+ deleteTransaction(paramsOrFirst) {
14475
+ let params;
14476
+ if (paramsOrFirst && typeof paramsOrFirst === "object" && !Array.isArray(paramsOrFirst)) {
14477
+ params = paramsOrFirst || {};
14478
+ } else {
14479
+ params = {
14480
+ transactionId: paramsOrFirst
14481
+ };
14482
+ }
14483
+ const transactionId = params.transactionId;
14484
+ if (typeof transactionId === "undefined") {
14485
+ throw new AppBaseException('Missing required parameter: "transactionId"');
14486
+ }
14487
+ const apiPath = "/tablesdb/transactions/{transactionId}".replace("{transactionId}", transactionId);
14488
+ const payload = {};
14489
+ const uri = new URL(this.client.config.endpoint + apiPath);
14490
+ const apiHeaders = {
14491
+ "content-type": "application/json"
14492
+ };
14493
+ return this.client.call(
14494
+ "delete",
14495
+ uri,
14496
+ apiHeaders,
14497
+ payload
14498
+ );
14499
+ }
14500
+ createOperations(paramsOrFirst, ...rest) {
14501
+ let params;
14502
+ if (paramsOrFirst && typeof paramsOrFirst === "object" && !Array.isArray(paramsOrFirst)) {
14503
+ params = paramsOrFirst || {};
14504
+ } else {
14505
+ params = {
14506
+ transactionId: paramsOrFirst,
14507
+ operations: rest[0]
14508
+ };
14509
+ }
14510
+ const transactionId = params.transactionId;
14511
+ const operations = params.operations;
14512
+ if (typeof transactionId === "undefined") {
14513
+ throw new AppBaseException('Missing required parameter: "transactionId"');
14514
+ }
14515
+ const apiPath = "/tablesdb/transactions/{transactionId}/operations".replace("{transactionId}", transactionId);
14516
+ const payload = {};
14517
+ if (typeof operations !== "undefined") {
14518
+ payload["operations"] = operations;
14519
+ }
14520
+ const uri = new URL(this.client.config.endpoint + apiPath);
14521
+ const apiHeaders = {
14522
+ "content-type": "application/json"
14523
+ };
14524
+ return this.client.call(
14525
+ "post",
14526
+ uri,
14527
+ apiHeaders,
14528
+ payload
14529
+ );
14530
+ }
14531
+ get(paramsOrFirst) {
14532
+ let params;
14533
+ if (paramsOrFirst && typeof paramsOrFirst === "object" && !Array.isArray(paramsOrFirst)) {
14534
+ params = paramsOrFirst || {};
14535
+ } else {
14536
+ params = {
14537
+ databaseId: paramsOrFirst
14538
+ };
14539
+ }
14540
+ const databaseId = params.databaseId;
14541
+ if (typeof databaseId === "undefined") {
14542
+ throw new AppBaseException('Missing required parameter: "databaseId"');
14543
+ }
14544
+ const apiPath = "/tablesdb/{databaseId}".replace("{databaseId}", databaseId);
14545
+ const payload = {};
14546
+ const uri = new URL(this.client.config.endpoint + apiPath);
14547
+ const apiHeaders = {};
14548
+ return this.client.call(
14549
+ "get",
14550
+ uri,
14551
+ apiHeaders,
14552
+ payload
14553
+ );
14554
+ }
14555
+ update(paramsOrFirst, ...rest) {
14556
+ let params;
14557
+ if (paramsOrFirst && typeof paramsOrFirst === "object" && !Array.isArray(paramsOrFirst)) {
14558
+ params = paramsOrFirst || {};
14559
+ } else {
14560
+ params = {
14561
+ databaseId: paramsOrFirst,
14562
+ name: rest[0],
14563
+ enabled: rest[1]
14564
+ };
14565
+ }
14566
+ const databaseId = params.databaseId;
14567
+ const name = params.name;
14568
+ const enabled = params.enabled;
14569
+ if (typeof databaseId === "undefined") {
14570
+ throw new AppBaseException('Missing required parameter: "databaseId"');
14571
+ }
14572
+ const apiPath = "/tablesdb/{databaseId}".replace("{databaseId}", databaseId);
14573
+ const payload = {};
14574
+ if (typeof name !== "undefined") {
14575
+ payload["name"] = name;
14576
+ }
14577
+ if (typeof enabled !== "undefined") {
14578
+ payload["enabled"] = enabled;
14579
+ }
14580
+ const uri = new URL(this.client.config.endpoint + apiPath);
14581
+ const apiHeaders = {
14582
+ "content-type": "application/json"
14583
+ };
14584
+ return this.client.call(
14585
+ "put",
14586
+ uri,
14587
+ apiHeaders,
14588
+ payload
14589
+ );
14590
+ }
14591
+ delete(paramsOrFirst) {
14592
+ let params;
14593
+ if (paramsOrFirst && typeof paramsOrFirst === "object" && !Array.isArray(paramsOrFirst)) {
14594
+ params = paramsOrFirst || {};
14595
+ } else {
14596
+ params = {
14597
+ databaseId: paramsOrFirst
14598
+ };
14599
+ }
14600
+ const databaseId = params.databaseId;
14601
+ if (typeof databaseId === "undefined") {
14602
+ throw new AppBaseException('Missing required parameter: "databaseId"');
14603
+ }
14604
+ const apiPath = "/tablesdb/{databaseId}".replace("{databaseId}", databaseId);
14605
+ const payload = {};
14606
+ const uri = new URL(this.client.config.endpoint + apiPath);
14607
+ const apiHeaders = {
14608
+ "content-type": "application/json"
14609
+ };
14610
+ return this.client.call(
14611
+ "delete",
14612
+ uri,
14613
+ apiHeaders,
14614
+ payload
14615
+ );
14616
+ }
14617
+ rollbackSchemaVersion(paramsOrFirst, ...rest) {
14618
+ let params;
14619
+ if (paramsOrFirst && typeof paramsOrFirst === "object" && !Array.isArray(paramsOrFirst)) {
14620
+ params = paramsOrFirst || {};
14621
+ } else {
14622
+ params = {
14623
+ databaseId: paramsOrFirst,
14624
+ versionId: rest[0]
14625
+ };
14626
+ }
14627
+ const databaseId = params.databaseId;
14628
+ const versionId = params.versionId;
14629
+ if (typeof databaseId === "undefined") {
14630
+ throw new AppBaseException('Missing required parameter: "databaseId"');
14631
+ }
14632
+ if (typeof versionId === "undefined") {
14633
+ throw new AppBaseException('Missing required parameter: "versionId"');
14634
+ }
14635
+ const apiPath = "/tablesdb/{databaseId}/schema/rollback/{versionId}".replace("{databaseId}", databaseId).replace("{versionId}", versionId);
14636
+ const payload = {};
14637
+ const uri = new URL(this.client.config.endpoint + apiPath);
14638
+ const apiHeaders = {
14639
+ "content-type": "application/json"
14640
+ };
14641
+ return this.client.call(
14642
+ "post",
14643
+ uri,
14644
+ apiHeaders,
14645
+ payload
14646
+ );
14647
+ }
14648
+ listSchemaVersions(paramsOrFirst, ...rest) {
14649
+ let params;
14650
+ if (paramsOrFirst && typeof paramsOrFirst === "object" && !Array.isArray(paramsOrFirst)) {
14651
+ params = paramsOrFirst || {};
14652
+ } else {
14653
+ params = {
14654
+ databaseId: paramsOrFirst,
14655
+ queries: rest[0],
14656
+ total: rest[1]
14657
+ };
14658
+ }
14659
+ const databaseId = params.databaseId;
14660
+ const queries = params.queries;
14661
+ const total = params.total;
14662
+ if (typeof databaseId === "undefined") {
14663
+ throw new AppBaseException('Missing required parameter: "databaseId"');
14664
+ }
14665
+ const apiPath = "/tablesdb/{databaseId}/schema/versions".replace("{databaseId}", databaseId);
14666
+ const payload = {};
14667
+ if (typeof queries !== "undefined") {
14668
+ payload["queries"] = queries;
14669
+ }
14670
+ if (typeof total !== "undefined") {
14671
+ payload["total"] = total;
14672
+ }
14673
+ const uri = new URL(this.client.config.endpoint + apiPath);
14674
+ const apiHeaders = {};
14675
+ return this.client.call(
14676
+ "get",
11849
14677
  uri,
11850
14678
  apiHeaders,
11851
14679
  payload
@@ -15273,6 +18101,24 @@ _Operator.dateAddDays = (days) => new _Operator("dateAddDays", [days]).toString(
15273
18101
  _Operator.dateSubDays = (days) => new _Operator("dateSubDays", [days]).toString();
15274
18102
  _Operator.dateSetNow = () => new _Operator("dateSetNow", []).toString();
15275
18103
 
18104
+ // ../../node_modules/@alipay/appbase-node-sdk/dist/enums/memory-scope.mjs
18105
+ var MemoryScope = /* @__PURE__ */ ((MemoryScope2) => {
18106
+ MemoryScope2["Private"] = "private";
18107
+ MemoryScope2["StrictPrivate"] = "strict_private";
18108
+ MemoryScope2["User"] = "user";
18109
+ MemoryScope2["Group"] = "group";
18110
+ MemoryScope2["Project"] = "project";
18111
+ return MemoryScope2;
18112
+ })(MemoryScope || {});
18113
+
18114
+ // ../../node_modules/@alipay/appbase-node-sdk/dist/enums/memory-record-kind.mjs
18115
+ var MemoryRecordKind = /* @__PURE__ */ ((MemoryRecordKind2) => {
18116
+ MemoryRecordKind2["Conversation"] = "conversation";
18117
+ MemoryRecordKind2["Fact"] = "fact";
18118
+ MemoryRecordKind2["Action"] = "action";
18119
+ return MemoryRecordKind2;
18120
+ })(MemoryRecordKind || {});
18121
+
15276
18122
  // ../linkque-agent-appwrite-integrate/dist/esm/runtime/runStorage.js
15277
18123
  var ENDPOINT_SOURCES = [
15278
18124
  "APPWRITE_FUNCTION_API_ENDPOINT",
@@ -15986,12 +18832,17 @@ function nonEmpty(value) {
15986
18832
 
15987
18833
  export {
15988
18834
  AUTHORIZATION_CHECKPOINT_TABLE,
18835
+ SESSION_MEMORY_TABLE,
15989
18836
  EXTERNAL_ACTION_COLUMNS,
15990
18837
  LINKQUE_ENDPOINT_PRE,
15991
18838
  APPBASE_RUNTIME_CONFIG_DEFAULTS,
15992
18839
  AppbaseRuntimeConfigProvider,
15993
18840
  Query,
18841
+ Databases,
18842
+ Memory,
15994
18843
  TablesDB,
18844
+ MemoryScope,
18845
+ MemoryRecordKind,
15995
18846
  withIsoTimestamp,
15996
18847
  isDebugLogLevel,
15997
18848
  describeRuntimeEnv,