@kontext-dev/js-sdk 0.1.1 → 0.3.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -462,6 +462,7 @@ var KontextMcp = class {
462
462
  config;
463
463
  storage;
464
464
  oauthProvider;
465
+ clientSessionId = typeof globalThis.crypto?.randomUUID === "function" ? globalThis.crypto.randomUUID() : `kontext-sdk-${Date.now().toString(36)}-${Math.random().toString(36).slice(2)}`;
465
466
  transport = null;
466
467
  client = null;
467
468
  _isConnected = false;
@@ -781,13 +782,14 @@ var KontextMcp = class {
781
782
  if (this.config.onElicitationUrl) {
782
783
  capabilities.elicitation = { url: {} };
783
784
  }
784
- this.client = new Client(
785
- {
786
- name: this.config.clientName ?? "kontext-sdk",
787
- version: this.config.clientVersion ?? "0.0.1"
788
- },
789
- { capabilities }
790
- );
785
+ const clientInfo = {
786
+ name: this.config.clientName ?? "kontext-sdk",
787
+ version: this.config.clientVersion ?? "0.0.1",
788
+ sessionId: this.clientSessionId
789
+ };
790
+ this.client = new Client(clientInfo, {
791
+ capabilities
792
+ });
791
793
  if (this.config.onElicitationUrl) {
792
794
  const onElicitationUrl = this.config.onElicitationUrl;
793
795
  this.client.setRequestHandler(ElicitRequestSchema, async (request) => {
@@ -2041,7 +2043,11 @@ function createKontextOrchestrator(config) {
2041
2043
  }
2042
2044
 
2043
2045
  // src/client/index.ts
2044
- var META_TOOL_NAMES = /* @__PURE__ */ new Set(["SEARCH_TOOLS", "EXECUTE_TOOL"]);
2046
+ var META_TOOL_NAMES = /* @__PURE__ */ new Set([
2047
+ "SEARCH_TOOLS",
2048
+ "EXECUTE_TOOL",
2049
+ "REQUEST_CAPABILITY"
2050
+ ]);
2045
2051
  function hasMetaTools(tools) {
2046
2052
  let hasSearch = false;
2047
2053
  let hasExecute = false;