@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.
package/dist/index.cjs CHANGED
@@ -539,6 +539,7 @@ var KontextMcp = class {
539
539
  config;
540
540
  storage;
541
541
  oauthProvider;
542
+ clientSessionId = typeof globalThis.crypto?.randomUUID === "function" ? globalThis.crypto.randomUUID() : `kontext-sdk-${Date.now().toString(36)}-${Math.random().toString(36).slice(2)}`;
542
543
  transport = null;
543
544
  client = null;
544
545
  _isConnected = false;
@@ -858,13 +859,14 @@ var KontextMcp = class {
858
859
  if (this.config.onElicitationUrl) {
859
860
  capabilities.elicitation = { url: {} };
860
861
  }
861
- this.client = new index_js.Client(
862
- {
863
- name: this.config.clientName ?? "kontext-sdk",
864
- version: this.config.clientVersion ?? "0.0.1"
865
- },
866
- { capabilities }
867
- );
862
+ const clientInfo = {
863
+ name: this.config.clientName ?? "kontext-sdk",
864
+ version: this.config.clientVersion ?? "0.0.1",
865
+ sessionId: this.clientSessionId
866
+ };
867
+ this.client = new index_js.Client(clientInfo, {
868
+ capabilities
869
+ });
868
870
  if (this.config.onElicitationUrl) {
869
871
  const onElicitationUrl = this.config.onElicitationUrl;
870
872
  this.client.setRequestHandler(types_js.ElicitRequestSchema, async (request) => {
@@ -2118,7 +2120,11 @@ function createKontextOrchestrator(config) {
2118
2120
  }
2119
2121
 
2120
2122
  // src/client/index.ts
2121
- var META_TOOL_NAMES = /* @__PURE__ */ new Set(["SEARCH_TOOLS", "EXECUTE_TOOL"]);
2123
+ var META_TOOL_NAMES = /* @__PURE__ */ new Set([
2124
+ "SEARCH_TOOLS",
2125
+ "EXECUTE_TOOL",
2126
+ "REQUEST_CAPABILITY"
2127
+ ]);
2122
2128
  function hasMetaTools(tools) {
2123
2129
  let hasSearch = false;
2124
2130
  let hasExecute = false;
@@ -3684,6 +3690,7 @@ var Kontext = class _Kontext {
3684
3690
  },
3685
3691
  body: JSON.stringify({
3686
3692
  tokenIdentifier,
3693
+ clientSessionId: mcpSessionId,
3687
3694
  hostname: metadata?.hostname,
3688
3695
  userAgent: metadata?.userAgent,
3689
3696
  clientInfo: metadata?.clientInfo,